@sesamy/sesamy-js 1.97.0 → 1.99.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- var sesamyJs=(function($e){"use strict";var js=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ds={},$n,Ms;function Re(){return Ms||(Ms=1,$n=function(e){try{return!!e()}catch{return!0}}),$n}var Un,Fs;function Vt(){if(Fs)return Un;Fs=1;var e=Re();return Un=!e(function(){var r=(function(){}).bind();return typeof r!="function"||r.hasOwnProperty("prototype")}),Un}var Ln,Bs;function pe(){if(Bs)return Ln;Bs=1;var e=Vt(),r=Function.prototype,t=r.call,n=e&&r.bind.bind(t,t);return Ln=e?n:function(a){return function(){return t.apply(a,arguments)}},Ln}var Nn,Hs;function zt(){if(Hs)return Nn;Hs=1;var e=pe(),r=e({}.toString),t=e("".slice);return Nn=function(n){return t(r(n),8,-1)},Nn}var xn,Gs;function Ws(){if(Gs)return xn;Gs=1;var e=pe(),r=Re(),t=zt(),n=Object,a=e("".split);return xn=r(function(){return!n("z").propertyIsEnumerable(0)})?function(i){return t(i)==="String"?a(i,""):n(i)}:n,xn}var jn,Vs;function Kt(){return Vs||(Vs=1,jn=function(e){return e==null}),jn}var Dn,zs;function Jt(){if(zs)return Dn;zs=1;var e=Kt(),r=TypeError;return Dn=function(t){if(e(t))throw new r("Can't call method on "+t);return t},Dn}var Mn,Ks;function bt(){if(Ks)return Mn;Ks=1;var e=Ws(),r=Jt();return Mn=function(t){return e(r(t))},Mn}var wt,Js;function me(){if(Js)return wt;Js=1;var e=function(r){return r&&r.Math===Math&&r};return wt=e(typeof globalThis=="object"&&globalThis)||e(typeof window=="object"&&window)||e(typeof self=="object"&&self)||e(typeof js=="object"&&js)||e(typeof wt=="object"&&wt)||(function(){return this})()||Function("return this")(),wt}var Fn={exports:{}},Bn,Ys;function ar(){return Ys||(Ys=1,Bn=!1),Bn}var Hn,Qs;function Gn(){if(Qs)return Hn;Qs=1;var e=me(),r=Object.defineProperty;return Hn=function(t,n){try{r(e,t,{value:n,configurable:!0,writable:!0})}catch{e[t]=n}return n},Hn}var Xs;function Wn(){if(Xs)return Fn.exports;Xs=1;var e=ar(),r=me(),t=Gn(),n="__core-js_shared__",a=Fn.exports=r[n]||t(n,{});return(a.versions||(a.versions=[])).push({version:"3.46.0",mode:e?"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"}),Fn.exports}var Vn,Zs;function eu(){if(Zs)return Vn;Zs=1;var e=Wn();return Vn=function(r,t){return e[r]||(e[r]=t||{})},Vn}var zn,ru;function Yt(){if(ru)return zn;ru=1;var e=Jt(),r=Object;return zn=function(t){return r(e(t))},zn}var Kn,tu;function We(){if(tu)return Kn;tu=1;var e=pe(),r=Yt(),t=e({}.hasOwnProperty);return Kn=Object.hasOwn||function(a,i){return t(r(a),i)},Kn}var Jn,nu;function au(){if(nu)return Jn;nu=1;var e=pe(),r=0,t=Math.random(),n=e(1.1.toString);return Jn=function(a){return"Symbol("+(a===void 0?"":a)+")_"+n(++r+t,36)},Jn}var Yn,iu;function St(){if(iu)return Yn;iu=1;var e=me(),r=e.navigator,t=r&&r.userAgent;return Yn=t?String(t):"",Yn}var Qn,ou;function su(){if(ou)return Qn;ou=1;var e=me(),r=St(),t=e.process,n=e.Deno,a=t&&t.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&&r&&(o=r.match(/Edge\/(\d+)/),(!o||o[1]>=74)&&(o=r.match(/Chrome\/(\d+)/),o&&(s=+o[1]))),Qn=s,Qn}var Xn,uu;function cu(){if(uu)return Xn;uu=1;var e=su(),r=Re(),t=me(),n=t.String;return Xn=!!Object.getOwnPropertySymbols&&!r(function(){var a=Symbol("symbol detection");return!n(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&e&&e<41}),Xn}var Zn,lu;function fu(){if(lu)return Zn;lu=1;var e=cu();return Zn=e&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Zn}var ea,du;function Te(){if(du)return ea;du=1;var e=me(),r=eu(),t=We(),n=au(),a=cu(),i=fu(),o=e.Symbol,s=r("wks"),u=i?o.for||o:o&&o.withoutSetter||n;return ea=function(c){return t(s,c)||(s[c]=a&&t(o,c)?o[c]:u("Symbol."+c)),s[c]},ea}var ra,vu;function ye(){if(vu)return ra;vu=1;var e=typeof document=="object"&&document.all;return ra=typeof e>"u"&&e!==void 0?function(r){return typeof r=="function"||r===e}:function(r){return typeof r=="function"},ra}var ta,hu;function Ve(){if(hu)return ta;hu=1;var e=ye();return ta=function(r){return typeof r=="object"?r!==null:e(r)},ta}var na,pu;function Xe(){if(pu)return na;pu=1;var e=Ve(),r=String,t=TypeError;return na=function(n){if(e(n))return n;throw new t(r(n)+" is not an object")},na}var aa={},ia,mu;function Oe(){if(mu)return ia;mu=1;var e=Re();return ia=!e(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),ia}var oa,gu;function yu(){if(gu)return oa;gu=1;var e=Oe(),r=Re();return oa=e&&r(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),oa}var sa={},ua,bu;function Qt(){if(bu)return ua;bu=1;var e=me(),r=Ve(),t=e.document,n=r(t)&&r(t.createElement);return ua=function(a){return n?t.createElement(a):{}},ua}var ca,wu;function Su(){if(wu)return ca;wu=1;var e=Oe(),r=Re(),t=Qt();return ca=!e&&!r(function(){return Object.defineProperty(t("div"),"a",{get:function(){return 7}}).a!==7}),ca}var la,Iu;function Ue(){if(Iu)return la;Iu=1;var e=Vt(),r=Function.prototype.call;return la=e?r.bind(r):function(){return r.apply(r,arguments)},la}var fa,Pu;function ze(){if(Pu)return fa;Pu=1;var e=me(),r=ye(),t=function(n){return r(n)?n:void 0};return fa=function(n,a){return arguments.length<2?t(e[n]):e[n]&&e[n][a]},fa}var da,Eu;function Xt(){if(Eu)return da;Eu=1;var e=pe();return da=e({}.isPrototypeOf),da}var va,Ru;function Tu(){if(Ru)return va;Ru=1;var e=ze(),r=ye(),t=Xt(),n=fu(),a=Object;return va=n?function(i){return typeof i=="symbol"}:function(i){var o=e("Symbol");return r(o)&&t(o.prototype,a(i))},va}var ha,Ou;function Zt(){if(Ou)return ha;Ou=1;var e=String;return ha=function(r){try{return e(r)}catch{return"Object"}},ha}var pa,Cu;function Ze(){if(Cu)return pa;Cu=1;var e=ye(),r=Zt(),t=TypeError;return pa=function(n){if(e(n))return n;throw new t(r(n)+" is not a function")},pa}var ma,_u;function ga(){if(_u)return ma;_u=1;var e=Ze(),r=Kt();return ma=function(t,n){var a=t[n];return r(a)?void 0:e(a)},ma}var ya,Au;function Bh(){if(Au)return ya;Au=1;var e=Ue(),r=ye(),t=Ve(),n=TypeError;return ya=function(a,i){var o,s;if(i==="string"&&r(o=a.toString)&&!t(s=e(o,a))||r(o=a.valueOf)&&!t(s=e(o,a))||i!=="string"&&r(o=a.toString)&&!t(s=e(o,a)))return s;throw new n("Can't convert object to primitive value")},ya}var ba,ku;function Hh(){if(ku)return ba;ku=1;var e=Ue(),r=Ve(),t=Tu(),n=ga(),a=Bh(),i=Te(),o=TypeError,s=i("toPrimitive");return ba=function(u,c){if(!r(u)||t(u))return u;var l=n(u,s),f;if(l){if(c===void 0&&(c="default"),f=e(l,u,c),!r(f)||t(f))return f;throw new o("Can't convert object to primitive value")}return c===void 0&&(c="number"),a(u,c)},ba}var wa,qu;function $u(){if(qu)return wa;qu=1;var e=Hh(),r=Tu();return wa=function(t){var n=e(t,"string");return r(n)?n:n+""},wa}var Uu;function cr(){if(Uu)return sa;Uu=1;var e=Oe(),r=Su(),t=yu(),n=Xe(),a=$u(),i=TypeError,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u="enumerable",c="configurable",l="writable";return sa.f=e?t?function(v,d,h){if(n(v),d=a(d),n(h),typeof v=="function"&&d==="prototype"&&"value"in h&&l in h&&!h[l]){var p=s(v,d);p&&p[l]&&(v[d]=h.value,h={configurable:c in h?h[c]:p[c],enumerable:u in h?h[u]:p[u],writable:!1})}return o(v,d,h)}:o:function(v,d,h){if(n(v),d=a(d),n(h),r)try{return o(v,d,h)}catch{}if("get"in h||"set"in h)throw new i("Accessors not supported");return"value"in h&&(v[d]=h.value),v},sa}var Sa,Lu;function Gh(){if(Lu)return Sa;Lu=1;var e=Math.ceil,r=Math.floor;return Sa=Math.trunc||function(n){var a=+n;return(a>0?r:e)(a)},Sa}var Ia,Nu;function Pa(){if(Nu)return Ia;Nu=1;var e=Gh();return Ia=function(r){var t=+r;return t!==t||t===0?0:e(t)},Ia}var Ea,xu;function ju(){if(xu)return Ea;xu=1;var e=Pa(),r=Math.max,t=Math.min;return Ea=function(n,a){var i=e(n);return i<0?r(i+a,0):t(i,a)},Ea}var Ra,Du;function Wh(){if(Du)return Ra;Du=1;var e=Pa(),r=Math.min;return Ra=function(t){var n=e(t);return n>0?r(n,9007199254740991):0},Ra}var Ta,Mu;function Oa(){if(Mu)return Ta;Mu=1;var e=Wh();return Ta=function(r){return e(r.length)},Ta}var Ca,Fu;function Vh(){if(Fu)return Ca;Fu=1;var e=bt(),r=ju(),t=Oa(),n=function(a){return function(i,o,s){var u=e(i),c=t(u);if(c===0)return!a&&-1;var l=r(s,c),f;if(a&&o!==o){for(;c>l;)if(f=u[l++],f!==f)return!0}else for(;c>l;l++)if((a||l in u)&&u[l]===o)return a||l||0;return!a&&-1}};return Ca={includes:n(!0),indexOf:n(!1)},Ca}var _a,Bu;function Aa(){return Bu||(Bu=1,_a={}),_a}var ka,Hu;function Gu(){if(Hu)return ka;Hu=1;var e=pe(),r=We(),t=bt(),n=Vh().indexOf,a=Aa(),i=e([].push);return ka=function(o,s){var u=t(o),c=0,l=[],f;for(f in u)!r(a,f)&&r(u,f)&&i(l,f);for(;s.length>c;)r(u,f=s[c++])&&(~n(l,f)||i(l,f));return l},ka}var qa,Wu;function $a(){return Wu||(Wu=1,qa=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),qa}var Ua,Vu;function zu(){if(Vu)return Ua;Vu=1;var e=Gu(),r=$a();return Ua=Object.keys||function(n){return e(n,r)},Ua}var Ku;function zh(){if(Ku)return aa;Ku=1;var e=Oe(),r=yu(),t=cr(),n=Xe(),a=bt(),i=zu();return aa.f=e&&!r?Object.defineProperties:function(s,u){n(s);for(var c=a(u),l=i(u),f=l.length,v=0,d;f>v;)t.f(s,d=l[v++],c[d]);return s},aa}var La,Ju;function Yu(){if(Ju)return La;Ju=1;var e=ze();return La=e("document","documentElement"),La}var Na,Qu;function xa(){if(Qu)return Na;Qu=1;var e=eu(),r=au(),t=e("keys");return Na=function(n){return t[n]||(t[n]=r(n))},Na}var ja,Xu;function It(){if(Xu)return ja;Xu=1;var e=Xe(),r=zh(),t=$a(),n=Aa(),a=Yu(),i=Qt(),o=xa(),s=">",u="<",c="prototype",l="script",f=o("IE_PROTO"),v=function(){},d=function(I){return u+l+s+I+u+"/"+l+s},h=function(I){I.write(d("")),I.close();var g=I.parentWindow.Object;return I=null,g},p=function(){var I=i("iframe"),g="java"+l+":",b;return I.style.display="none",a.appendChild(I),I.src=String(g),b=I.contentWindow.document,b.open(),b.write(d("document.F=Object")),b.close(),b.F},S,R=function(){try{S=new ActiveXObject("htmlfile")}catch{}R=typeof document<"u"?document.domain&&S?h(S):p():h(S);for(var I=t.length;I--;)delete R[c][t[I]];return R()};return n[f]=!0,ja=Object.create||function(g,b){var y;return g!==null?(v[c]=e(g),y=new v,v[c]=null,y[f]=g):y=R(),b===void 0?y:r.f(y,b)},ja}var Da,Zu;function Kh(){if(Zu)return Da;Zu=1;var e=Te(),r=It(),t=cr().f,n=e("unscopables"),a=Array.prototype;return a[n]===void 0&&t(a,n,{configurable:!0,value:r(null)}),Da=function(i){a[n][i]=!0},Da}var Ma,ec;function Pt(){return ec||(ec=1,Ma={}),Ma}var Fa,rc;function Jh(){if(rc)return Fa;rc=1;var e=me(),r=ye(),t=e.WeakMap;return Fa=r(t)&&/native code/.test(String(t)),Fa}var Ba,tc;function Ar(){return tc||(tc=1,Ba=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}}),Ba}var Ha,nc;function kr(){if(nc)return Ha;nc=1;var e=Oe(),r=cr(),t=Ar();return Ha=e?function(n,a,i){return r.f(n,a,t(1,i))}:function(n,a,i){return n[a]=i,n},Ha}var Ga,ac;function Kr(){if(ac)return Ga;ac=1;var e=Jh(),r=me(),t=Ve(),n=kr(),a=We(),i=Wn(),o=xa(),s=Aa(),u="Object already initialized",c=r.TypeError,l=r.WeakMap,f,v,d,h=function(I){return d(I)?v(I):f(I,{})},p=function(I){return function(g){var b;if(!t(g)||(b=v(g)).type!==I)throw new c("Incompatible receiver, "+I+" required");return b}};if(e||i.state){var S=i.state||(i.state=new l);S.get=S.get,S.has=S.has,S.set=S.set,f=function(I,g){if(S.has(I))throw new c(u);return g.facade=I,S.set(I,g),g},v=function(I){return S.get(I)||{}},d=function(I){return S.has(I)}}else{var R=o("state");s[R]=!0,f=function(I,g){if(a(I,R))throw new c(u);return g.facade=I,n(I,R,g),g},v=function(I){return a(I,R)?I[R]:{}},d=function(I){return a(I,R)}}return Ga={set:f,get:v,has:d,enforce:h,getterFor:p},Ga}var Wa={},Va={},ic;function oc(){if(ic)return Va;ic=1;var e={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,t=r&&!e.call({1:2},1);return Va.f=t?function(a){var i=r(this,a);return!!i&&i.enumerable}:e,Va}var sc;function uc(){if(sc)return Wa;sc=1;var e=Oe(),r=Ue(),t=oc(),n=Ar(),a=bt(),i=$u(),o=We(),s=Su(),u=Object.getOwnPropertyDescriptor;return Wa.f=e?u:function(l,f){if(l=a(l),f=i(f),s)try{return u(l,f)}catch{}if(o(l,f))return n(!r(t.f,l,f),l[f])},Wa}var za={exports:{}},Ka,cc;function lc(){if(cc)return Ka;cc=1;var e=Oe(),r=We(),t=Function.prototype,n=e&&Object.getOwnPropertyDescriptor,a=r(t,"name"),i=a&&(function(){}).name==="something",o=a&&(!e||e&&n(t,"name").configurable);return Ka={EXISTS:a,PROPER:i,CONFIGURABLE:o},Ka}var Ja,fc;function Ya(){if(fc)return Ja;fc=1;var e=pe(),r=ye(),t=Wn(),n=e(Function.toString);return r(t.inspectSource)||(t.inspectSource=function(a){return n(a)}),Ja=t.inspectSource,Ja}var dc;function vc(){if(dc)return za.exports;dc=1;var e=pe(),r=Re(),t=ye(),n=We(),a=Oe(),i=lc().CONFIGURABLE,o=Ya(),s=Kr(),u=s.enforce,c=s.get,l=String,f=Object.defineProperty,v=e("".slice),d=e("".replace),h=e([].join),p=a&&!r(function(){return f(function(){},"length",{value:8}).length!==8}),S=String(String).split("String"),R=za.exports=function(I,g,b){v(l(g),0,7)==="Symbol("&&(g="["+d(l(g),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),b&&b.getter&&(g="get "+g),b&&b.setter&&(g="set "+g),(!n(I,"name")||i&&I.name!==g)&&(a?f(I,"name",{value:g,configurable:!0}):I.name=g),p&&b&&n(b,"arity")&&I.length!==b.arity&&f(I,"length",{value:b.arity});try{b&&n(b,"constructor")&&b.constructor?a&&f(I,"prototype",{writable:!1}):I.prototype&&(I.prototype=void 0)}catch{}var y=u(I);return n(y,"source")||(y.source=h(S,typeof g=="string"?g:"")),I};return Function.prototype.toString=R(function(){return t(this)&&c(this).source||o(this)},"toString"),za.exports}var Qa,hc;function Ke(){if(hc)return Qa;hc=1;var e=ye(),r=cr(),t=vc(),n=Gn();return Qa=function(a,i,o,s){s||(s={});var u=s.enumerable,c=s.name!==void 0?s.name:i;if(e(o)&&t(o,c,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:r.f(a,i,{value:o,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return a},Qa}var Xa={},pc;function Yh(){if(pc)return Xa;pc=1;var e=Gu(),r=$a(),t=r.concat("length","prototype");return Xa.f=Object.getOwnPropertyNames||function(a){return e(a,t)},Xa}var Za={},mc;function gc(){return mc||(mc=1,Za.f=Object.getOwnPropertySymbols),Za}var ei,yc;function Qh(){if(yc)return ei;yc=1;var e=ze(),r=pe(),t=Yh(),n=gc(),a=Xe(),i=r([].concat);return ei=e("Reflect","ownKeys")||function(s){var u=t.f(a(s)),c=n.f;return c?i(u,c(s)):u},ei}var ri,bc;function wc(){if(bc)return ri;bc=1;var e=We(),r=Qh(),t=uc(),n=cr();return ri=function(a,i,o){for(var s=r(i),u=n.f,c=t.f,l=0;l<s.length;l++){var f=s[l];!e(a,f)&&!(o&&e(o,f))&&u(a,f,c(i,f))}},ri}var ti,Sc;function Ic(){if(Sc)return ti;Sc=1;var e=Re(),r=ye(),t=/#|\.prototype\./,n=function(u,c){var l=i[a(u)];return l===s?!0:l===o?!1:r(c)?e(c):!!c},a=n.normalize=function(u){return String(u).replace(t,".").toLowerCase()},i=n.data={},o=n.NATIVE="N",s=n.POLYFILL="P";return ti=n,ti}var ni,Pc;function Ie(){if(Pc)return ni;Pc=1;var e=me(),r=uc().f,t=kr(),n=Ke(),a=Gn(),i=wc(),o=Ic();return ni=function(s,u){var c=s.target,l=s.global,f=s.stat,v,d,h,p,S,R;if(l?d=e:f?d=e[c]||a(c,{}):d=e[c]&&e[c].prototype,d)for(h in u){if(S=u[h],s.dontCallGetSet?(R=r(d,h),p=R&&R.value):p=d[h],v=o(l?h:c+(f?".":"#")+h,s.forced),!v&&p!==void 0){if(typeof S==typeof p)continue;i(S,p)}(s.sham||p&&p.sham)&&t(S,"sham",!0),n(d,h,S,s)}},ni}var ai,Ec;function Xh(){if(Ec)return ai;Ec=1;var e=Re();return ai=!e(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype}),ai}var ii,Rc;function oi(){if(Rc)return ii;Rc=1;var e=We(),r=ye(),t=Yt(),n=xa(),a=Xh(),i=n("IE_PROTO"),o=Object,s=o.prototype;return ii=a?o.getPrototypeOf:function(u){var c=t(u);if(e(c,i))return c[i];var l=c.constructor;return r(l)&&c instanceof l?l.prototype:c instanceof o?s:null},ii}var si,Tc;function Oc(){if(Tc)return si;Tc=1;var e=Re(),r=ye(),t=Ve(),n=It(),a=oi(),i=Ke(),o=Te(),s=ar(),u=o("iterator"),c=!1,l,f,v;[].keys&&(v=[].keys(),"next"in v?(f=a(a(v)),f!==Object.prototype&&(l=f)):c=!0);var d=!t(l)||e(function(){var h={};return l[u].call(h)!==h});return d?l={}:s&&(l=n(l)),r(l[u])||i(l,u,function(){return this}),si={IteratorPrototype:l,BUGGY_SAFARI_ITERATORS:c},si}var ui,Cc;function Jr(){if(Cc)return ui;Cc=1;var e=cr().f,r=We(),t=Te(),n=t("toStringTag");return ui=function(a,i,o){a&&!o&&(a=a.prototype),a&&!r(a,n)&&e(a,n,{configurable:!0,value:i})},ui}var ci,_c;function Ac(){if(_c)return ci;_c=1;var e=Oc().IteratorPrototype,r=It(),t=Ar(),n=Jr(),a=Pt(),i=function(){return this};return ci=function(o,s,u,c){var l=s+" Iterator";return o.prototype=r(e,{next:t(+!c,u)}),n(o,l,!1,!0),a[l]=i,o},ci}var li,kc;function Zh(){if(kc)return li;kc=1;var e=pe(),r=Ze();return li=function(t,n,a){try{return e(r(Object.getOwnPropertyDescriptor(t,n)[a]))}catch{}},li}var fi,qc;function ep(){if(qc)return fi;qc=1;var e=Ve();return fi=function(r){return e(r)||r===null},fi}var di,$c;function rp(){if($c)return di;$c=1;var e=ep(),r=String,t=TypeError;return di=function(n){if(e(n))return n;throw new t("Can't set "+r(n)+" as a prototype")},di}var vi,Uc;function hi(){if(Uc)return vi;Uc=1;var e=Zh(),r=Ve(),t=Jt(),n=rp();return vi=Object.setPrototypeOf||("__proto__"in{}?(function(){var a=!1,i={},o;try{o=e(Object.prototype,"__proto__","set"),o(i,[]),a=i instanceof Array}catch{}return function(u,c){return t(u),n(c),r(u)&&(a?o(u,c):u.__proto__=c),u}})():void 0),vi}var pi,Lc;function Nc(){if(Lc)return pi;Lc=1;var e=Ie(),r=Ue(),t=ar(),n=lc(),a=ye(),i=Ac(),o=oi(),s=hi(),u=Jr(),c=kr(),l=Ke(),f=Te(),v=Pt(),d=Oc(),h=n.PROPER,p=n.CONFIGURABLE,S=d.IteratorPrototype,R=d.BUGGY_SAFARI_ITERATORS,I=f("iterator"),g="keys",b="values",y="entries",A=function(){return this};return pi=function(q,j,G,K,re,L,M){i(G,j,K);var x=function(J){if(J===re&&w)return w;if(!R&&J&&J in U)return U[J];switch(J){case g:return function(){return new G(this,J)};case b:return function(){return new G(this,J)};case y:return function(){return new G(this,J)}}return function(){return new G(this)}},m=j+" Iterator",C=!1,U=q.prototype,F=U[I]||U["@@iterator"]||re&&U[re],w=!R&&F||x(re),T=j==="Array"&&U.entries||F,N,H,Q;if(T&&(N=o(T.call(new q)),N!==Object.prototype&&N.next&&(!t&&o(N)!==S&&(s?s(N,S):a(N[I])||l(N,I,A)),u(N,m,!0,!0),t&&(v[m]=A))),h&&re===b&&F&&F.name!==b&&(!t&&p?c(U,"name",b):(C=!0,w=function(){return r(F,this)})),re)if(H={values:x(b),keys:L?w:x(g),entries:x(y)},M)for(Q in H)(R||C||!(Q in U))&&l(U,Q,H[Q]);else e({target:j,proto:!0,forced:R||C},H);return(!t||M)&&U[I]!==w&&l(U,I,w,{name:re}),v[j]=w,H},pi}var mi,xc;function gi(){return xc||(xc=1,mi=function(e,r){return{value:e,done:r}}),mi}var yi,jc;function bi(){if(jc)return yi;jc=1;var e=bt(),r=Kh(),t=Pt(),n=Kr(),a=cr().f,i=Nc(),o=gi(),s=ar(),u=Oe(),c="Array Iterator",l=n.set,f=n.getterFor(c);yi=i(Array,"Array",function(d,h){l(this,{type:c,target:e(d),index:0,kind:h})},function(){var d=f(this),h=d.target,p=d.index++;if(!h||p>=h.length)return d.target=null,o(void 0,!0);switch(d.kind){case"keys":return o(p,!1);case"values":return o(h[p],!1)}return o([p,h[p]],!1)},"values");var v=t.Arguments=t.Array;if(r("keys"),r("values"),r("entries"),!s&&u&&v.name!=="values")try{a(v,"name",{value:"values"})}catch{}return yi}var Dc={},Mc;function tp(){if(Mc)return Dc;Mc=1;var e=Ie(),r=pe(),t=ju(),n=RangeError,a=String.fromCharCode,i=String.fromCodePoint,o=r([].join),s=!!i&&i.length!==1;return e({target:"String",stat:!0,arity:1,forced:s},{fromCodePoint:function(c){for(var l=[],f=arguments.length,v=0,d;f>v;){if(d=+arguments[v++],t(d,1114111)!==d)throw new n(d+" is not a valid code point");l[v]=d<65536?a(d):a(((d-=65536)>>10)+55296,d%1024+56320)}return o(l,"")}}),Dc}var wi,Fc;function Bc(){if(Fc)return wi;Fc=1;var e=me(),r=Oe(),t=Object.getOwnPropertyDescriptor;return wi=function(n){if(!r)return e[n];var a=t(e,n);return a&&a.value},wi}var Si,Hc;function en(){if(Hc)return Si;Hc=1;var e=Re(),r=Te(),t=Oe(),n=ar(),a=r("iterator");return Si=!e(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(c,l){o.delete("b"),u+=l+c}),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||!t)||!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"}),Si}var Ii,Gc;function rn(){if(Gc)return Ii;Gc=1;var e=vc(),r=cr();return Ii=function(t,n,a){return a.get&&e(a.get,n,{getter:!0}),a.set&&e(a.set,n,{setter:!0}),r.f(t,n,a)},Ii}var Pi,Wc;function np(){if(Wc)return Pi;Wc=1;var e=Ke();return Pi=function(r,t,n){for(var a in t)e(r,a,t[a],n);return r},Pi}var Ei,Vc;function Ri(){if(Vc)return Ei;Vc=1;var e=Xt(),r=TypeError;return Ei=function(t,n){if(e(n,t))return t;throw new r("Incorrect invocation")},Ei}var Ti,zc;function ap(){if(zc)return Ti;zc=1;var e=zt(),r=pe();return Ti=function(t){if(e(t)==="Function")return r(t)},Ti}var Oi,Kc;function Yr(){if(Kc)return Oi;Kc=1;var e=ap(),r=Ze(),t=Vt(),n=e(e.bind);return Oi=function(a,i){return r(a),i===void 0?a:t?n(a,i):function(){return a.apply(i,arguments)}},Oi}var Ci,Jc;function _i(){if(Jc)return Ci;Jc=1;var e=Te(),r=e("toStringTag"),t={};return t[r]="z",Ci=String(t)==="[object z]",Ci}var Ai,Yc;function Et(){if(Yc)return Ai;Yc=1;var e=_i(),r=ye(),t=zt(),n=Te(),a=n("toStringTag"),i=Object,o=t((function(){return arguments})())==="Arguments",s=function(u,c){try{return u[c]}catch{}};return Ai=e?t:function(u){var c,l,f;return u===void 0?"Undefined":u===null?"Null":typeof(l=s(c=i(u),a))=="string"?l:o?t(c):(f=t(c))==="Object"&&r(c.callee)?"Arguments":f},Ai}var ki,Qc;function lr(){if(Qc)return ki;Qc=1;var e=Et(),r=String;return ki=function(t){if(e(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return r(t)},ki}var qi,Xc;function tn(){if(Xc)return qi;Xc=1;var e=Et(),r=ga(),t=Kt(),n=Pt(),a=Te(),i=a("iterator");return qi=function(o){if(!t(o))return r(o,i)||r(o,"@@iterator")||n[e(o)]},qi}var $i,Zc;function Ui(){if(Zc)return $i;Zc=1;var e=Ue(),r=Ze(),t=Xe(),n=Zt(),a=tn(),i=TypeError;return $i=function(o,s){var u=arguments.length<2?a(o):s;if(r(u))return t(e(u,o));throw new i(n(o)+" is not iterable")},$i}var Li,el;function qr(){if(el)return Li;el=1;var e=TypeError;return Li=function(r,t){if(r<t)throw new e("Not enough arguments");return r},Li}var Ni,rl;function nn(){if(rl)return Ni;rl=1;var e=pe();return Ni=e([].slice),Ni}var xi,tl;function ip(){if(tl)return xi;tl=1;var e=nn(),r=Math.floor,t=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 c=r(i/2),l=t(e(n,0,c),a),f=t(e(n,c),a),v=l.length,d=f.length,h=0,p=0;h<v||p<d;)n[h+p]=h<v&&p<d?a(l[h],f[p])<=0?l[h++]:f[p++]:h<v?l[h++]:f[p++];return n};return xi=t,xi}var ji,nl;function al(){if(nl)return ji;nl=1,bi(),tp();var e=Ie(),r=me(),t=Bc(),n=ze(),a=Ue(),i=pe(),o=Oe(),s=en(),u=Ke(),c=rn(),l=np(),f=Jr(),v=Ac(),d=Kr(),h=Ri(),p=ye(),S=We(),R=Yr(),I=Et(),g=Xe(),b=Ve(),y=lr(),A=It(),q=Ar(),j=Ui(),G=tn(),K=gi(),re=qr(),L=Te(),M=ip(),x=L("iterator"),m="URLSearchParams",C=m+"Iterator",U=d.set,F=d.getterFor(m),w=d.getterFor(C),T=t("fetch"),N=t("Request"),H=t("Headers"),Q=N&&N.prototype,J=H&&H.prototype,le=r.TypeError,ne=r.encodeURIComponent,ue=String.fromCharCode,ae=n("String","fromCodePoint"),_e=parseInt,xe=i("".charAt),Be=i([].join),Le=i([].push),tr=i("".replace),Cr=i([].shift),_r=i([].splice),Hr=i("".split),Gr=i("".slice),Gt=i(/./.exec),vt=/\+/g,Wr="�",be=/^[0-9a-f]+$/i,nr=function(D,V){var z=Gr(D,V,V+2);return Gt(be,z)?_e(z,16):NaN},Vr=function(D){for(var V=0,z=128;z>0&&(D&z)!==0;z>>=1)V++;return V},B=function(D){var V=null;switch(D.length){case 1:V=D[0];break;case 2:V=(D[0]&31)<<6|D[1]&63;break;case 3:V=(D[0]&15)<<12|(D[1]&63)<<6|D[2]&63;break;case 4:V=(D[0]&7)<<18|(D[1]&63)<<12|(D[2]&63)<<6|D[3]&63;break}return V>1114111?null:V},X=function(D){D=tr(D,vt," ");for(var V=D.length,z="",Y=0;Y<V;){var ie=xe(D,Y);if(ie==="%"){if(xe(D,Y+1)==="%"||Y+3>V){z+="%",Y++;continue}var se=nr(D,Y+1);if(se!==se){z+=ie,Y++;continue}Y+=2;var ve=Vr(se);if(ve===0)ie=ue(se);else{if(ve===1||ve>4){z+=Wr,Y++;continue}for(var he=[se],Se=1;Se<ve&&(Y++,!(Y+3>V||xe(D,Y)!=="%"));){var Ne=nr(D,Y+1);if(Ne!==Ne){Y+=3;break}if(Ne>191||Ne<128)break;Le(he,Ne),Y+=2,Se++}if(he.length!==ve){z+=Wr;continue}var sr=B(he);sr===null?z+=Wr:ie=ae(sr)}}z+=ie,Y++}return z},oe=/[!'()~]|%20/g,ce={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},fe=function(D){return ce[D]},Ge=function(D){return tr(ne(D),oe,fe)},Ae=v(function(V,z){U(this,{type:C,target:F(V).entries,index:0,kind:z})},m,function(){var V=w(this),z=V.target,Y=V.index++;if(!z||Y>=z.length)return V.target=null,K(void 0,!0);var ie=z[Y];switch(V.kind){case"keys":return K(ie.key,!1);case"values":return K(ie.value,!1)}return K([ie.key,ie.value],!1)},!0),He=function(D){this.entries=[],this.url=null,D!==void 0&&(b(D)?this.parseObject(D):this.parseQuery(typeof D=="string"?xe(D,0)==="?"?Gr(D,1):D:y(D)))};He.prototype={type:m,bindURL:function(D){this.url=D,this.update()},parseObject:function(D){var V=this.entries,z=G(D),Y,ie,se,ve,he,Se,Ne;if(z)for(Y=j(D,z),ie=Y.next;!(se=a(ie,Y)).done;){if(ve=j(g(se.value)),he=ve.next,(Se=a(he,ve)).done||(Ne=a(he,ve)).done||!a(he,ve).done)throw new le("Expected sequence with length 2");Le(V,{key:y(Se.value),value:y(Ne.value)})}else for(var sr in D)S(D,sr)&&Le(V,{key:sr,value:y(D[sr])})},parseQuery:function(D){if(D)for(var V=this.entries,z=Hr(D,"&"),Y=0,ie,se;Y<z.length;)ie=z[Y++],ie.length&&(se=Hr(ie,"="),Le(V,{key:X(Cr(se)),value:X(Be(se,"="))}))},serialize:function(){for(var D=this.entries,V=[],z=0,Y;z<D.length;)Y=D[z++],Le(V,Ge(Y.key)+"="+Ge(Y.value));return Be(V,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ke=function(){h(this,Je);var V=arguments.length>0?arguments[0]:void 0,z=U(this,new He(V));o||(this.size=z.entries.length)},Je=ke.prototype;if(l(Je,{append:function(V,z){var Y=F(this);re(arguments.length,2),Le(Y.entries,{key:y(V),value:y(z)}),o||this.length++,Y.updateURL()},delete:function(D){for(var V=F(this),z=re(arguments.length,1),Y=V.entries,ie=y(D),se=z<2?void 0:arguments[1],ve=se===void 0?se:y(se),he=0;he<Y.length;){var Se=Y[he];if(Se.key===ie&&(ve===void 0||Se.value===ve)){if(_r(Y,he,1),ve!==void 0)break}else he++}o||(this.size=Y.length),V.updateURL()},get:function(V){var z=F(this).entries;re(arguments.length,1);for(var Y=y(V),ie=0;ie<z.length;ie++)if(z[ie].key===Y)return z[ie].value;return null},getAll:function(V){var z=F(this).entries;re(arguments.length,1);for(var Y=y(V),ie=[],se=0;se<z.length;se++)z[se].key===Y&&Le(ie,z[se].value);return ie},has:function(V){for(var z=F(this).entries,Y=re(arguments.length,1),ie=y(V),se=Y<2?void 0:arguments[1],ve=se===void 0?se:y(se),he=0;he<z.length;){var Se=z[he++];if(Se.key===ie&&(ve===void 0||Se.value===ve))return!0}return!1},set:function(V,z){var Y=F(this);re(arguments.length,1);for(var ie=Y.entries,se=!1,ve=y(V),he=y(z),Se=0,Ne;Se<ie.length;Se++)Ne=ie[Se],Ne.key===ve&&(se?_r(ie,Se--,1):(se=!0,Ne.value=he));se||Le(ie,{key:ve,value:he}),o||(this.size=ie.length),Y.updateURL()},sort:function(){var V=F(this);M(V.entries,function(z,Y){return z.key>Y.key?1:-1}),V.updateURL()},forEach:function(V){for(var z=F(this).entries,Y=R(V,arguments.length>1?arguments[1]:void 0),ie=0,se;ie<z.length;)se=z[ie++],Y(se.value,se.key,this)},keys:function(){return new Ae(this,"keys")},values:function(){return new Ae(this,"values")},entries:function(){return new Ae(this,"entries")}},{enumerable:!0}),u(Je,x,Je.entries,{name:"entries"}),u(Je,"toString",function(){return F(this).serialize()},{enumerable:!0}),o&&c(Je,"size",{get:function(){return F(this).entries.length},configurable:!0,enumerable:!0}),f(ke,m),e({global:!0,constructor:!0,forced:!s},{URLSearchParams:ke}),!s&&p(H)){var ht=i(J.has),Wt=i(J.set),pt=function(D){if(b(D)){var V=D.body,z;if(I(V)===m)return z=D.headers?new H(D.headers):new H,ht(z,"content-type")||Wt(z,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),A(D,{body:q(0,y(V)),headers:q(0,z)})}return D};if(p(T)&&e({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(V){return T(V,arguments.length>1?pt(arguments[1]):{})}}),p(N)){var mt=function(V){return h(this,Q),new N(V,arguments.length>1?pt(arguments[1]):{})};Q.constructor=mt,mt.prototype=Q,e({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:mt})}}return ji={URLSearchParams:ke,getState:F},ji}var il;function op(){return il||(il=1,al()),Ds}var ol={},sl;function sp(){if(sl)return ol;sl=1;var e=Ke(),r=pe(),t=lr(),n=qr(),a=URLSearchParams,i=a.prototype,o=r(i.append),s=r(i.delete),u=r(i.forEach),c=r([].push),l=new a("a=1&a=2&b=3");return l.delete("a",1),l.delete("b",void 0),l+""!="a=2"&&e(i,"delete",function(f){var v=arguments.length,d=v<2?void 0:arguments[1];if(v&&d===void 0)return s(this,f);var h=[];u(this,function(A,q){c(h,{key:q,value:A})}),n(v,1);for(var p=t(f),S=t(d),R=0,I=0,g=!1,b=h.length,y;R<b;)y=h[R++],g||y.key===p?(g=!0,s(this,y.key)):I++;for(;I<b;)y=h[I++],y.key===p&&y.value===S||o(this,y.key,y.value)},{enumerable:!0,unsafe:!0}),ol}var ul={},cl;function up(){if(cl)return ul;cl=1;var e=Ke(),r=pe(),t=lr(),n=qr(),a=URLSearchParams,i=a.prototype,o=r(i.getAll),s=r(i.has),u=new a("a=1");return(u.has("a",2)||!u.has("a",void 0))&&e(i,"has",function(l){var f=arguments.length,v=f<2?void 0:arguments[1];if(f&&v===void 0)return s(this,l);var d=o(this,l);n(f,1);for(var h=t(v),p=0;p<d.length;)if(d[p++]===h)return!0;return!1},{enumerable:!0,unsafe:!0}),ul}var ll={},fl;function cp(){if(fl)return ll;fl=1;var e=Oe(),r=pe(),t=rn(),n=URLSearchParams.prototype,a=r(n.forEach);return e&&!("size"in n)&&t(n,"size",{get:function(){var o=0;return a(this,function(){o++}),o},configurable:!0,enumerable:!0}),ll}var Di,dl;function an(){if(dl)return Di;dl=1;var e=me();return Di=e,Di}var Mi,vl;function hl(){if(vl)return Mi;vl=1,op(),sp(),up(),cp();var e=an();return Mi=e.URLSearchParams,Mi}var pl={},ml={},gl={},Fi,yl;function bl(){if(yl)return Fi;yl=1;var e=pe(),r=Pa(),t=lr(),n=Jt(),a=e("".charAt),i=e("".charCodeAt),o=e("".slice),s=function(u){return function(c,l){var f=t(n(c)),v=r(l),d=f.length,h,p;return v<0||v>=d?u?"":void 0:(h=i(f,v),h<55296||h>56319||v+1===d||(p=i(f,v+1))<56320||p>57343?u?a(f,v):h:u?o(f,v,v+2):(h-55296<<10)+(p-56320)+65536)}};return Fi={codeAt:s(!1),charAt:s(!0)},Fi}var wl;function Sl(){if(wl)return gl;wl=1;var e=bl().charAt,r=lr(),t=Kr(),n=Nc(),a=gi(),i="String Iterator",o=t.set,s=t.getterFor(i);return n(String,"String",function(u){o(this,{type:i,string:r(u),index:0})},function(){var c=s(this),l=c.string,f=c.index,v;return f>=l.length?a(void 0,!0):(v=e(l,f),c.index+=v.length,a(v,!1))}),gl}var Bi,Il;function lp(){if(Il)return Bi;Il=1;var e=Oe(),r=pe(),t=Ue(),n=Re(),a=zu(),i=gc(),o=oc(),s=Yt(),u=Ws(),c=Object.assign,l=Object.defineProperty,f=r([].concat);return Bi=!c||n(function(){if(e&&c({b:1},c(l({},"a",{enumerable:!0,get:function(){l(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var v={},d={},h=Symbol("assign detection"),p="abcdefghijklmnopqrst";return v[h]=7,p.split("").forEach(function(S){d[S]=S}),c({},v)[h]!==7||a(c({},d)).join("")!==p})?function(d,h){for(var p=s(d),S=arguments.length,R=1,I=i.f,g=o.f;S>R;)for(var b=u(arguments[R++]),y=I?f(a(b),I(b)):a(b),A=y.length,q=0,j;A>q;)j=y[q++],(!e||t(g,b,j))&&(p[j]=b[j]);return p}:c,Bi}var Hi,Pl;function El(){if(Pl)return Hi;Pl=1;var e=Ue(),r=Xe(),t=ga();return Hi=function(n,a,i){var o,s;r(n);try{if(o=t(n,"return"),!o){if(a==="throw")throw i;return i}o=e(o,n)}catch(u){s=!0,o=u}if(a==="throw")throw i;if(s)throw o;return r(o),i},Hi}var Gi,Rl;function fp(){if(Rl)return Gi;Rl=1;var e=Xe(),r=El();return Gi=function(t,n,a,i){try{return i?n(e(a)[0],a[1]):n(a)}catch(o){r(t,"throw",o)}},Gi}var Wi,Tl;function Ol(){if(Tl)return Wi;Tl=1;var e=Te(),r=Pt(),t=e("iterator"),n=Array.prototype;return Wi=function(a){return a!==void 0&&(r.Array===a||n[t]===a)},Wi}var Vi,Cl;function _l(){if(Cl)return Vi;Cl=1;var e=pe(),r=Re(),t=ye(),n=Et(),a=ze(),i=Ya(),o=function(){},s=a("Reflect","construct"),u=/^\s*(?:class|function)\b/,c=e(u.exec),l=!u.test(o),f=function(h){if(!t(h))return!1;try{return s(o,[],h),!0}catch{return!1}},v=function(h){if(!t(h))return!1;switch(n(h)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return l||!!c(u,i(h))}catch{return!0}};return v.sham=!0,Vi=!s||r(function(){var d;return f(f.call)||!f(Object)||!f(function(){d=!0})||d})?v:f,Vi}var zi,Al;function dp(){if(Al)return zi;Al=1;var e=Oe(),r=cr(),t=Ar();return zi=function(n,a,i){e?r.f(n,a,t(0,i)):n[a]=i},zi}var Ki,kl;function vp(){if(kl)return Ki;kl=1;var e=Yr(),r=Ue(),t=Yt(),n=fp(),a=Ol(),i=_l(),o=Oa(),s=dp(),u=Ui(),c=tn(),l=Array;return Ki=function(v){var d=t(v),h=i(this),p=arguments.length,S=p>1?arguments[1]:void 0,R=S!==void 0;R&&(S=e(S,p>2?arguments[2]:void 0));var I=c(d),g=0,b,y,A,q,j,G;if(I&&!(this===l&&a(I)))for(y=h?new this:[],q=u(d,I),j=q.next;!(A=r(j,q)).done;g++)G=R?n(q,S,[A.value,g],!0):A.value,s(y,g,G);else for(b=o(d),y=h?new this(b):l(b);b>g;g++)G=R?S(d[g],g):d[g],s(y,g,G);return y.length=g,y},Ki}var Ji,ql;function hp(){if(ql)return Ji;ql=1;var e=pe(),r=2147483647,t=36,n=1,a=26,i=38,o=700,s=72,u=128,c="-",l=/[^\0-\u007E]/,f=/[.\u3002\uFF0E\uFF61]/g,v="Overflow: input needs wider integers to process",d=t-n,h=RangeError,p=e(f.exec),S=Math.floor,R=String.fromCharCode,I=e("".charCodeAt),g=e([].join),b=e([].push),y=e("".replace),A=e("".split),q=e("".toLowerCase),j=function(L){for(var M=[],x=0,m=L.length;x<m;){var C=I(L,x++);if(C>=55296&&C<=56319&&x<m){var U=I(L,x++);(U&64512)===56320?b(M,((C&1023)<<10)+(U&1023)+65536):(b(M,C),x--)}else b(M,C)}return M},G=function(L){return L+22+75*(L<26)},K=function(L,M,x){var m=0;for(L=x?S(L/o):L>>1,L+=S(L/M);L>d*a>>1;)L=S(L/d),m+=t;return S(m+(d+1)*L/(L+i))},re=function(L){var M=[];L=j(L);var x=L.length,m=u,C=0,U=s,F,w;for(F=0;F<L.length;F++)w=L[F],w<128&&b(M,R(w));var T=M.length,N=T;for(T&&b(M,c);N<x;){var H=r;for(F=0;F<L.length;F++)w=L[F],w>=m&&w<H&&(H=w);var Q=N+1;if(H-m>S((r-C)/Q))throw new h(v);for(C+=(H-m)*Q,m=H,F=0;F<L.length;F++){if(w=L[F],w<m&&++C>r)throw new h(v);if(w===m){for(var J=C,le=t;;){var ne=le<=U?n:le>=U+a?a:le-U;if(J<ne)break;var ue=J-ne,ae=t-ne;b(M,R(G(ne+ue%ae))),J=S(ue/ae),le+=t}b(M,R(G(J))),U=K(C,Q,N===T),C=0,N++}}C++,m++}return g(M,"")};return Ji=function(L){var M=[],x=A(y(q(L),f,"."),"."),m,C;for(m=0;m<x.length;m++)C=x[m],b(M,p(l,C)?"xn--"+re(C):C);return g(M,".")},Ji}var $l;function pp(){if($l)return ml;$l=1,Sl();var e=Ie(),r=Oe(),t=en(),n=me(),a=Yr(),i=pe(),o=Ke(),s=rn(),u=Ri(),c=We(),l=lp(),f=vp(),v=nn(),d=bl().codeAt,h=hp(),p=lr(),S=Jr(),R=qr(),I=al(),g=Kr(),b=g.set,y=g.getterFor("URL"),A=I.URLSearchParams,q=I.getState,j=n.URL,G=n.TypeError,K=n.parseInt,re=Math.floor,L=Math.pow,M=i("".charAt),x=i(/./.exec),m=i([].join),C=i(1.1.toString),U=i([].pop),F=i([].push),w=i("".replace),T=i([].shift),N=i("".split),H=i("".slice),Q=i("".toLowerCase),J=i([].unshift),le="Invalid authority",ne="Invalid scheme",ue="Invalid host",ae="Invalid port",_e=/[a-z]/i,xe=/[\d+-.a-z]/i,Be=/\d/,Le=/^0x/i,tr=/^[0-7]+$/,Cr=/^\d+$/,_r=/^[\da-f]+$/i,Hr=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Gr=/[\0\t\n\r #/:<>?@[\\\]^|]/,Gt=/^[\u0000-\u0020]+/,vt=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,Wr=/[\t\n\r]/g,be,nr=function(E){var $=N(E,"."),O,P,_,te,W,we,Pe;if($.length&&$[$.length-1]===""&&$.length--,O=$.length,O>4)return E;for(P=[],_=0;_<O;_++){if(te=$[_],te==="")return E;if(W=10,te.length>1&&M(te,0)==="0"&&(W=x(Le,te)?16:8,te=H(te,W===8?1:2)),te==="")we=0;else{if(!x(W===10?Cr:W===8?tr:_r,te))return E;we=K(te,W)}F(P,we)}for(_=0;_<O;_++)if(we=P[_],_===O-1){if(we>=L(256,5-O))return null}else if(we>255)return null;for(Pe=U(P),_=0;_<P.length;_++)Pe+=P[_]*L(256,3-_);return Pe},Vr=function(E){var $=[0,0,0,0,0,0,0,0],O=0,P=null,_=0,te,W,we,Pe,qe,Qe,k,Ee=function(){return M(E,_)};if(Ee()===":"){if(M(E,1)!==":")return;_+=2,O++,P=O}for(;Ee();){if(O===8)return;if(Ee()===":"){if(P!==null)return;_++,O++,P=O;continue}for(te=W=0;W<4&&x(_r,Ee());)te=te*16+K(Ee(),16),_++,W++;if(Ee()==="."){if(W===0||(_-=W,O>6))return;for(we=0;Ee();){if(Pe=null,we>0)if(Ee()==="."&&we<4)_++;else return;if(!x(Be,Ee()))return;for(;x(Be,Ee());){if(qe=K(Ee(),10),Pe===null)Pe=qe;else{if(Pe===0)return;Pe=Pe*10+qe}if(Pe>255)return;_++}$[O]=$[O]*256+Pe,we++,(we===2||we===4)&&O++}if(we!==4)return;break}else if(Ee()===":"){if(_++,!Ee())return}else if(Ee())return;$[O++]=te}if(P!==null)for(Qe=O-P,O=7;O!==0&&Qe>0;)k=$[O],$[O--]=$[P+Qe-1],$[P+--Qe]=k;else if(O!==8)return;return $},B=function(E){for(var $=null,O=1,P=null,_=0,te=0;te<8;te++)E[te]!==0?(_>O&&($=P,O=_),P=null,_=0):(P===null&&(P=te),++_);return _>O?P:$},X=function(E){var $,O,P,_;if(typeof E=="number"){for($=[],O=0;O<4;O++)J($,E%256),E=re(E/256);return m($,".")}if(typeof E=="object"){for($="",P=B(E),O=0;O<8;O++)_&&E[O]===0||(_&&(_=!1),P===O?($+=O?":":"::",_=!0):($+=C(E[O],16),O<7&&($+=":")));return"["+$+"]"}return E},oe={},ce=l({},oe,{" ":1,'"':1,"<":1,">":1,"`":1}),fe=l({},ce,{"#":1,"?":1,"{":1,"}":1}),Ge=l({},fe,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Ae=function(E,$){var O=d(E,0);return O>32&&O<127&&!c($,E)?E:encodeURIComponent(E)},He={ftp:21,file:null,http:80,https:443,ws:80,wss:443},ke=function(E,$){var O;return E.length===2&&x(_e,M(E,0))&&((O=M(E,1))===":"||!$&&O==="|")},Je=function(E){var $;return E.length>1&&ke(H(E,0,2))&&(E.length===2||($=M(E,2))==="/"||$==="\\"||$==="?"||$==="#")},ht=function(E){return E==="."||Q(E)==="%2e"},Wt=function(E){return E=Q(E),E===".."||E==="%2e."||E===".%2e"||E==="%2e%2e"},pt={},mt={},D={},V={},z={},Y={},ie={},se={},ve={},he={},Se={},Ne={},sr={},$s={},Lh={},Us={},gt={},ur={},Nh={},zr={},br={},Ls=function(E,$,O){var P=p(E),_,te,W;if($){if(te=this.parse(P),te)throw new G(te);this.searchParams=null}else{if(O!==void 0&&(_=new Ls(O,!0)),te=this.parse(P,null,_),te)throw new G(te);W=q(new A),W.bindURL(this),this.searchParams=W}};Ls.prototype={type:"URL",parse:function(E,$,O){var P=this,_=$||pt,te=0,W="",we=!1,Pe=!1,qe=!1,Qe,k,Ee,wr;for(E=p(E),$||(P.scheme="",P.username="",P.password="",P.host=null,P.port=null,P.path=[],P.query=null,P.fragment=null,P.cannotBeABaseURL=!1,E=w(E,Gt,""),E=w(E,vt,"$1")),E=w(E,Wr,""),Qe=f(E);te<=Qe.length;){switch(k=Qe[te],_){case pt:if(k&&x(_e,k))W+=Q(k),_=mt;else{if($)return ne;_=D;continue}break;case mt:if(k&&(x(xe,k)||k==="+"||k==="-"||k==="."))W+=Q(k);else if(k===":"){if($&&(P.isSpecial()!==c(He,W)||W==="file"&&(P.includesCredentials()||P.port!==null)||P.scheme==="file"&&!P.host))return;if(P.scheme=W,$){P.isSpecial()&&He[P.scheme]===P.port&&(P.port=null);return}W="",P.scheme==="file"?_=$s:P.isSpecial()&&O&&O.scheme===P.scheme?_=V:P.isSpecial()?_=se:Qe[te+1]==="/"?(_=z,te++):(P.cannotBeABaseURL=!0,F(P.path,""),_=Nh)}else{if($)return ne;W="",_=D,te=0;continue}break;case D:if(!O||O.cannotBeABaseURL&&k!=="#")return ne;if(O.cannotBeABaseURL&&k==="#"){P.scheme=O.scheme,P.path=v(O.path),P.query=O.query,P.fragment="",P.cannotBeABaseURL=!0,_=br;break}_=O.scheme==="file"?$s:Y;continue;case V:if(k==="/"&&Qe[te+1]==="/")_=ve,te++;else{_=Y;continue}break;case z:if(k==="/"){_=he;break}else{_=ur;continue}case Y:if(P.scheme=O.scheme,k===be)P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,P.path=v(O.path),P.query=O.query;else if(k==="/"||k==="\\"&&P.isSpecial())_=ie;else if(k==="?")P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,P.path=v(O.path),P.query="",_=zr;else if(k==="#")P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,P.path=v(O.path),P.query=O.query,P.fragment="",_=br;else{P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,P.path=v(O.path),P.path.length--,_=ur;continue}break;case ie:if(P.isSpecial()&&(k==="/"||k==="\\"))_=ve;else if(k==="/")_=he;else{P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,_=ur;continue}break;case se:if(_=ve,k!=="/"||M(W,te+1)!=="/")continue;te++;break;case ve:if(k!=="/"&&k!=="\\"){_=he;continue}break;case he:if(k==="@"){we&&(W="%40"+W),we=!0,Ee=f(W);for(var Ns=0;Ns<Ee.length;Ns++){var Dh=Ee[Ns];if(Dh===":"&&!qe){qe=!0;continue}var Mh=Ae(Dh,Ge);qe?P.password+=Mh:P.username+=Mh}W=""}else if(k===be||k==="/"||k==="?"||k==="#"||k==="\\"&&P.isSpecial()){if(we&&W==="")return le;te-=f(W).length+1,W="",_=Se}else W+=k;break;case Se:case Ne:if($&&P.scheme==="file"){_=Us;continue}else if(k===":"&&!Pe){if(W==="")return ue;if(wr=P.parseHost(W),wr)return wr;if(W="",_=sr,$===Ne)return}else if(k===be||k==="/"||k==="?"||k==="#"||k==="\\"&&P.isSpecial()){if(P.isSpecial()&&W==="")return ue;if($&&W===""&&(P.includesCredentials()||P.port!==null))return;if(wr=P.parseHost(W),wr)return wr;if(W="",_=gt,$)return;continue}else k==="["?Pe=!0:k==="]"&&(Pe=!1),W+=k;break;case sr:if(x(Be,k))W+=k;else if(k===be||k==="/"||k==="?"||k==="#"||k==="\\"&&P.isSpecial()||$){if(W!==""){var xs=K(W,10);if(xs>65535)return ae;P.port=P.isSpecial()&&xs===He[P.scheme]?null:xs,W=""}if($)return;_=gt;continue}else return ae;break;case $s:if(P.scheme="file",k==="/"||k==="\\")_=Lh;else if(O&&O.scheme==="file")switch(k){case be:P.host=O.host,P.path=v(O.path),P.query=O.query;break;case"?":P.host=O.host,P.path=v(O.path),P.query="",_=zr;break;case"#":P.host=O.host,P.path=v(O.path),P.query=O.query,P.fragment="",_=br;break;default:Je(m(v(Qe,te),""))||(P.host=O.host,P.path=v(O.path),P.shortenPath()),_=ur;continue}else{_=ur;continue}break;case Lh:if(k==="/"||k==="\\"){_=Us;break}O&&O.scheme==="file"&&!Je(m(v(Qe,te),""))&&(ke(O.path[0],!0)?F(P.path,O.path[0]):P.host=O.host),_=ur;continue;case Us:if(k===be||k==="/"||k==="\\"||k==="?"||k==="#"){if(!$&&ke(W))_=ur;else if(W===""){if(P.host="",$)return;_=gt}else{if(wr=P.parseHost(W),wr)return wr;if(P.host==="localhost"&&(P.host=""),$)return;W="",_=gt}continue}else W+=k;break;case gt:if(P.isSpecial()){if(_=ur,k!=="/"&&k!=="\\")continue}else if(!$&&k==="?")P.query="",_=zr;else if(!$&&k==="#")P.fragment="",_=br;else if(k!==be&&(_=ur,k!=="/"))continue;break;case ur:if(k===be||k==="/"||k==="\\"&&P.isSpecial()||!$&&(k==="?"||k==="#")){if(Wt(W)?(P.shortenPath(),k!=="/"&&!(k==="\\"&&P.isSpecial())&&F(P.path,"")):ht(W)?k!=="/"&&!(k==="\\"&&P.isSpecial())&&F(P.path,""):(P.scheme==="file"&&!P.path.length&&ke(W)&&(P.host&&(P.host=""),W=M(W,0)+":"),F(P.path,W)),W="",P.scheme==="file"&&(k===be||k==="?"||k==="#"))for(;P.path.length>1&&P.path[0]==="";)T(P.path);k==="?"?(P.query="",_=zr):k==="#"&&(P.fragment="",_=br)}else W+=Ae(k,fe);break;case Nh:k==="?"?(P.query="",_=zr):k==="#"?(P.fragment="",_=br):k!==be&&(P.path[0]+=Ae(k,oe));break;case zr:!$&&k==="#"?(P.fragment="",_=br):k!==be&&(k==="'"&&P.isSpecial()?P.query+="%27":k==="#"?P.query+="%23":P.query+=Ae(k,oe));break;case br:k!==be&&(P.fragment+=Ae(k,ce));break}te++}},parseHost:function(E){var $,O,P;if(M(E,0)==="["){if(M(E,E.length-1)!=="]"||($=Vr(H(E,1,-1)),!$))return ue;this.host=$}else if(this.isSpecial()){if(E=h(E),x(Hr,E)||($=nr(E),$===null))return ue;this.host=$}else{if(x(Gr,E))return ue;for($="",O=f(E),P=0;P<O.length;P++)$+=Ae(O[P],oe);this.host=$}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return c(He,this.scheme)},shortenPath:function(){var E=this.path,$=E.length;$&&(this.scheme!=="file"||$!==1||!ke(E[0],!0))&&E.length--},serialize:function(){var E=this,$=E.scheme,O=E.username,P=E.password,_=E.host,te=E.port,W=E.path,we=E.query,Pe=E.fragment,qe=$+":";return _!==null?(qe+="//",E.includesCredentials()&&(qe+=O+(P?":"+P:"")+"@"),qe+=X(_),te!==null&&(qe+=":"+te)):$==="file"&&(qe+="//"),qe+=E.cannotBeABaseURL?W[0]:W.length?"/"+m(W,"/"):"",we!==null&&(qe+="?"+we),Pe!==null&&(qe+="#"+Pe),qe},setHref:function(E){var $=this.parse(E);if($)throw new G($);this.searchParams.update()},getOrigin:function(){var E=this.scheme,$=this.port;if(E==="blob")try{return new yt(E.path[0]).origin}catch{return"null"}return E==="file"||!this.isSpecial()?"null":E+"://"+X(this.host)+($!==null?":"+$:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(E){this.parse(p(E)+":",pt)},getUsername:function(){return this.username},setUsername:function(E){var $=f(p(E));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var O=0;O<$.length;O++)this.username+=Ae($[O],Ge)}},getPassword:function(){return this.password},setPassword:function(E){var $=f(p(E));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var O=0;O<$.length;O++)this.password+=Ae($[O],Ge)}},getHost:function(){var E=this.host,$=this.port;return E===null?"":$===null?X(E):X(E)+":"+$},setHost:function(E){this.cannotBeABaseURL||this.parse(E,Se)},getHostname:function(){var E=this.host;return E===null?"":X(E)},setHostname:function(E){this.cannotBeABaseURL||this.parse(E,Ne)},getPort:function(){var E=this.port;return E===null?"":p(E)},setPort:function(E){this.cannotHaveUsernamePasswordPort()||(E=p(E),E===""?this.port=null:this.parse(E,sr))},getPathname:function(){var E=this.path;return this.cannotBeABaseURL?E[0]:E.length?"/"+m(E,"/"):""},setPathname:function(E){this.cannotBeABaseURL||(this.path=[],this.parse(E,gt))},getSearch:function(){var E=this.query;return E?"?"+E:""},setSearch:function(E){E=p(E),E===""?this.query=null:(M(E,0)==="?"&&(E=H(E,1)),this.query="",this.parse(E,zr)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var E=this.fragment;return E?"#"+E:""},setHash:function(E){if(E=p(E),E===""){this.fragment=null;return}M(E,0)==="#"&&(E=H(E,1)),this.fragment="",this.parse(E,br)},update:function(){this.query=this.searchParams.serialize()||null}};var yt=function($){var O=u(this,je),P=R(arguments.length,1)>1?arguments[1]:void 0,_=b(O,new Ls($,!1,P));r||(O.href=_.serialize(),O.origin=_.getOrigin(),O.protocol=_.getProtocol(),O.username=_.getUsername(),O.password=_.getPassword(),O.host=_.getHost(),O.hostname=_.getHostname(),O.port=_.getPort(),O.pathname=_.getPathname(),O.search=_.getSearch(),O.searchParams=_.getSearchParams(),O.hash=_.getHash())},je=yt.prototype,Ye=function(E,$){return{get:function(){return y(this)[E]()},set:$&&function(O){return y(this)[$](O)},configurable:!0,enumerable:!0}};if(r&&(s(je,"href",Ye("serialize","setHref")),s(je,"origin",Ye("getOrigin")),s(je,"protocol",Ye("getProtocol","setProtocol")),s(je,"username",Ye("getUsername","setUsername")),s(je,"password",Ye("getPassword","setPassword")),s(je,"host",Ye("getHost","setHost")),s(je,"hostname",Ye("getHostname","setHostname")),s(je,"port",Ye("getPort","setPort")),s(je,"pathname",Ye("getPathname","setPathname")),s(je,"search",Ye("getSearch","setSearch")),s(je,"searchParams",Ye("getSearchParams")),s(je,"hash",Ye("getHash","setHash"))),o(je,"toJSON",function(){return y(this).serialize()},{enumerable:!0}),o(je,"toString",function(){return y(this).serialize()},{enumerable:!0}),j){var xh=j.createObjectURL,jh=j.revokeObjectURL;xh&&o(yt,"createObjectURL",a(xh,j)),jh&&o(yt,"revokeObjectURL",a(jh,j))}return S(yt,"URL"),e({global:!0,constructor:!0,forced:!t,sham:!r},{URL:yt}),ml}var Ul;function mp(){return Ul||(Ul=1,pp()),pl}var Ll={},Nl;function gp(){if(Nl)return Ll;Nl=1;var e=Ie(),r=ze(),t=Re(),n=qr(),a=lr(),i=en(),o=r("URL"),s=i&&t(function(){o.canParse()}),u=t(function(){return o.canParse.length!==1});return e({target:"URL",stat:!0,forced:!s||u},{canParse:function(l){var f=n(arguments.length,1),v=a(l),d=f<2||arguments[1]===void 0?void 0:a(arguments[1]);try{return!!new o(v,d)}catch{return!1}}}),Ll}var xl={},jl;function yp(){if(jl)return xl;jl=1;var e=Ie(),r=ze(),t=qr(),n=lr(),a=en(),i=r("URL");return e({target:"URL",stat:!0,forced:!a},{parse:function(s){var u=t(arguments.length,1),c=n(s),l=u<2||arguments[1]===void 0?void 0:n(arguments[1]);try{return new i(c,l)}catch{return null}}}),xl}var Dl={},Ml;function bp(){if(Ml)return Dl;Ml=1;var e=Ie(),r=Ue();return e({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return r(URL.prototype.toString,this)}}),Dl}var Yi,Fl;function wp(){if(Fl)return Yi;Fl=1,hl(),mp(),gp(),yp(),bp();var e=an();return Yi=e.URL,Yi}var Qi,Bl;function Sp(){if(Bl)return Qi;Bl=1;var e=wp();return Qi=e,Qi}var Xi,Hl;function Ip(){if(Hl)return Xi;Hl=1;var e=Sp();return Xi=e,Xi}Ip();var Gl={},Zi,Wl;function Pp(){return Wl||(Wl=1,Zi={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}),Zi}var eo,Vl;function Ep(){if(Vl)return eo;Vl=1;var e=Qt(),r=e("span").classList,t=r&&r.constructor&&r.constructor.prototype;return eo=t===Object.prototype?void 0:t,eo}var zl;function Kl(){if(zl)return Gl;zl=1;var e=me(),r=Pp(),t=Ep(),n=bi(),a=kr(),i=Jr(),o=Te(),s=o("iterator"),u=n.values,c=function(f,v){if(f){if(f[s]!==u)try{a(f,s,u)}catch{f[s]=u}if(i(f,v,!0),r[v]){for(var d in n)if(f[d]!==n[d])try{a(f,d,n[d])}catch{f[d]=n[d]}}}};for(var l in r)c(e[l]&&e[l].prototype,l);return c(t,"DOMTokenList"),Gl}var ro,Jl;function Rp(){if(Jl)return ro;Jl=1;var e=hl();return Kl(),ro=e,ro}var to,Yl;function Tp(){if(Yl)return to;Yl=1;var e=Rp();return to=e,to}Tp();var Ql={},Xl={},no,Zl;function Op(){if(Zl)return no;Zl=1;var e=Ve(),r=kr();return no=function(t,n){e(n)&&"cause"in n&&r(t,"cause",n.cause)},no}var ao,ef;function Cp(){if(ef)return ao;ef=1;var e=pe(),r=Error,t=e("".replace),n=(function(o){return String(new r(o).stack)})("zxcasd"),a=/\n\s*at [^:]*:[^\n]*/,i=a.test(n);return ao=function(o,s){if(i&&typeof o=="string"&&!r.prepareStackTrace)for(;s--;)o=t(o,a,"");return o},ao}var io,rf;function _p(){if(rf)return io;rf=1;var e=Re(),r=Ar();return io=!e(function(){var t=new Error("a");return"stack"in t?(Object.defineProperty(t,"stack",r(1,7)),t.stack!==7):!0}),io}var oo,tf;function Ap(){if(tf)return oo;tf=1;var e=kr(),r=Cp(),t=_p(),n=Error.captureStackTrace;return oo=function(a,i,o,s){t&&(n?n(a,i):e(a,"stack",r(o,s)))},oo}var so,nf;function Rt(){if(nf)return so;nf=1;var e=Yr(),r=Ue(),t=Xe(),n=Zt(),a=Ol(),i=Oa(),o=Xt(),s=Ui(),u=tn(),c=El(),l=TypeError,f=function(d,h){this.stopped=d,this.result=h},v=f.prototype;return so=function(d,h,p){var S=p&&p.that,R=!!(p&&p.AS_ENTRIES),I=!!(p&&p.IS_RECORD),g=!!(p&&p.IS_ITERATOR),b=!!(p&&p.INTERRUPTED),y=e(h,S),A,q,j,G,K,re,L,M=function(m){return A&&c(A,"normal"),new f(!0,m)},x=function(m){return R?(t(m),b?y(m[0],m[1],M):y(m[0],m[1])):b?y(m,M):y(m)};if(I)A=d.iterator;else if(g)A=d;else{if(q=u(d),!q)throw new l(n(d)+" is not iterable");if(a(q)){for(j=0,G=i(d);G>j;j++)if(K=x(d[j]),K&&o(v,K))return K;return new f(!1)}A=s(d,q)}for(re=I?d.next:A.next;!(L=r(re,A)).done;){try{K=x(L.value)}catch(m){c(A,"throw",m)}if(typeof K=="object"&&K&&o(v,K))return K}return new f(!1)},so}var uo,af;function kp(){if(af)return uo;af=1;var e=lr();return uo=function(r,t){return r===void 0?arguments.length<2?"":t:e(r)},uo}var of;function qp(){if(of)return Xl;of=1;var e=Ie(),r=Xt(),t=oi(),n=hi(),a=wc(),i=It(),o=kr(),s=Ar(),u=Op(),c=Ap(),l=Rt(),f=kp(),v=Te(),d=v("toStringTag"),h=Error,p=[].push,S=function(g,b){var y=r(R,this),A;n?A=n(new h,y?t(this):R):(A=y?this:i(R),o(A,d,"Error")),b!==void 0&&o(A,"message",f(b)),c(A,S,A.stack,1),arguments.length>2&&u(A,arguments[2]);var q=[];return l(g,p,{that:q}),o(A,"errors",q),A};n?n(S,h):a(S,h,{name:!0});var R=S.prototype=i(h.prototype,{constructor:s(1,S),message:s(1,""),name:s(1,"AggregateError")});return e({global:!0,constructor:!0,arity:2},{AggregateError:S}),Xl}var sf;function $p(){return sf||(sf=1,qp()),Ql}var uf={},co,cf;function Up(){if(cf)return co;cf=1;var e=_i(),r=Et();return co=e?{}.toString:function(){return"[object "+r(this)+"]"},co}var lf;function Lp(){if(lf)return uf;lf=1;var e=_i(),r=Ke(),t=Up();return e||r(Object.prototype,"toString",t,{unsafe:!0}),uf}var ff={},df={},lo,vf;function hf(){if(vf)return lo;vf=1;var e=me(),r=St(),t=zt(),n=function(a){return r.slice(0,a.length)===a};return lo=(function(){return n("Bun/")?"BUN":n("Cloudflare-Workers")?"CLOUDFLARE":n("Deno/")?"DENO":n("Node.js/")?"NODE":e.Bun&&typeof Bun.version=="string"?"BUN":e.Deno&&typeof Deno.version=="object"?"DENO":t(e.process)==="process"?"NODE":e.window&&e.document?"BROWSER":"REST"})(),lo}var fo,pf;function vo(){if(pf)return fo;pf=1;var e=hf();return fo=e==="NODE",fo}var ho,mf;function Np(){if(mf)return ho;mf=1;var e=ze(),r=rn(),t=Te(),n=Oe(),a=t("species");return ho=function(i){var o=e(i);n&&o&&!o[a]&&r(o,a,{configurable:!0,get:function(){return this}})},ho}var po,gf;function xp(){if(gf)return po;gf=1;var e=_l(),r=Zt(),t=TypeError;return po=function(n){if(e(n))return n;throw new t(r(n)+" is not a constructor")},po}var mo,yf;function bf(){if(yf)return mo;yf=1;var e=Xe(),r=xp(),t=Kt(),n=Te(),a=n("species");return mo=function(i,o){var s=e(i).constructor,u;return s===void 0||t(u=e(s)[a])?o:r(u)},mo}var go,wf;function Sf(){if(wf)return go;wf=1;var e=Vt(),r=Function.prototype,t=r.apply,n=r.call;return go=typeof Reflect=="object"&&Reflect.apply||(e?n.bind(t):function(){return n.apply(t,arguments)}),go}var yo,If;function Pf(){if(If)return yo;If=1;var e=St();return yo=/(?:ipad|iphone|ipod).*applewebkit/i.test(e),yo}var bo,Ef;function Rf(){if(Ef)return bo;Ef=1;var e=me(),r=Sf(),t=Yr(),n=ye(),a=We(),i=Re(),o=Yu(),s=nn(),u=Qt(),c=qr(),l=Pf(),f=vo(),v=e.setImmediate,d=e.clearImmediate,h=e.process,p=e.Dispatch,S=e.Function,R=e.MessageChannel,I=e.String,g=0,b={},y="onreadystatechange",A,q,j,G;i(function(){A=e.location});var K=function(x){if(a(b,x)){var m=b[x];delete b[x],m()}},re=function(x){return function(){K(x)}},L=function(x){K(x.data)},M=function(x){e.postMessage(I(x),A.protocol+"//"+A.host)};return(!v||!d)&&(v=function(m){c(arguments.length,1);var C=n(m)?m:S(m),U=s(arguments,1);return b[++g]=function(){r(C,void 0,U)},q(g),g},d=function(m){delete b[m]},f?q=function(x){h.nextTick(re(x))}:p&&p.now?q=function(x){p.now(re(x))}:R&&!l?(j=new R,G=j.port2,j.port1.onmessage=L,q=t(G.postMessage,G)):e.addEventListener&&n(e.postMessage)&&!e.importScripts&&A&&A.protocol!=="file:"&&!i(M)?(q=M,e.addEventListener("message",L,!1)):y in u("script")?q=function(x){o.appendChild(u("script"))[y]=function(){o.removeChild(this),K(x)}}:q=function(x){setTimeout(re(x),0)}),bo={set:v,clear:d},bo}var wo,Tf;function Of(){if(Tf)return wo;Tf=1;var e=function(){this.head=null,this.tail=null};return e.prototype={add:function(r){var t={item:r,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var r=this.head;if(r){var t=this.head=r.next;return t===null&&(this.tail=null),r.item}}},wo=e,wo}var So,Cf;function jp(){if(Cf)return So;Cf=1;var e=St();return So=/ipad|iphone|ipod/i.test(e)&&typeof Pebble<"u",So}var Io,_f;function Dp(){if(_f)return Io;_f=1;var e=St();return Io=/web0s(?!.*chrome)/i.test(e),Io}var Po,Af;function Mp(){if(Af)return Po;Af=1;var e=me(),r=Bc(),t=Yr(),n=Rf().set,a=Of(),i=Pf(),o=jp(),s=Dp(),u=vo(),c=e.MutationObserver||e.WebKitMutationObserver,l=e.document,f=e.process,v=e.Promise,d=r("queueMicrotask"),h,p,S,R,I;if(!d){var g=new a,b=function(){var y,A;for(u&&(y=f.domain)&&y.exit();A=g.get();)try{A()}catch(q){throw g.head&&h(),q}y&&y.enter()};!i&&!u&&!s&&c&&l?(p=!0,S=l.createTextNode(""),new c(b).observe(S,{characterData:!0}),h=function(){S.data=p=!p}):!o&&v&&v.resolve?(R=v.resolve(void 0),R.constructor=v,I=t(R.then,R),h=function(){I(b)}):u?h=function(){f.nextTick(b)}:(n=t(n,e),h=function(){n(b)}),d=function(y){g.head||h(),g.add(y)}}return Po=d,Po}var Eo,kf;function Fp(){return kf||(kf=1,Eo=function(e,r){try{arguments.length===1?console.error(e):console.error(e,r)}catch{}}),Eo}var Ro,qf;function Qr(){return qf||(qf=1,Ro=function(e){try{return{error:!1,value:e()}}catch(r){return{error:!0,value:r}}}),Ro}var To,$f;function Xr(){if($f)return To;$f=1;var e=me();return To=e.Promise,To}var Oo,Uf;function Tt(){if(Uf)return Oo;Uf=1;var e=me(),r=Xr(),t=ye(),n=Ic(),a=Ya(),i=Te(),o=hf(),s=ar(),u=su(),c=r&&r.prototype,l=i("species"),f=!1,v=t(e.PromiseRejectionEvent),d=n("Promise",function(){var h=a(r),p=h!==String(r);if(!p&&u===66||s&&!(c.catch&&c.finally))return!0;if(!u||u<51||!/native code/.test(h)){var S=new r(function(g){g(1)}),R=function(g){g(function(){},function(){})},I=S.constructor={};if(I[l]=R,f=S.then(function(){})instanceof R,!f)return!0}return!p&&(o==="BROWSER"||o==="DENO")&&!v});return Oo={CONSTRUCTOR:d,REJECTION_EVENT:v,SUBCLASSING:f},Oo}var Co={},Lf;function fr(){if(Lf)return Co;Lf=1;var e=Ze(),r=TypeError,t=function(n){var a,i;this.promise=new n(function(o,s){if(a!==void 0||i!==void 0)throw new r("Bad Promise constructor");a=o,i=s}),this.resolve=e(a),this.reject=e(i)};return Co.f=function(n){return new t(n)},Co}var Nf;function Bp(){if(Nf)return df;Nf=1;var e=Ie(),r=ar(),t=vo(),n=me(),a=an(),i=Ue(),o=Ke(),s=hi(),u=Jr(),c=Np(),l=Ze(),f=ye(),v=Ve(),d=Ri(),h=bf(),p=Rf().set,S=Mp(),R=Fp(),I=Qr(),g=Of(),b=Kr(),y=Xr(),A=Tt(),q=fr(),j="Promise",G=A.CONSTRUCTOR,K=A.REJECTION_EVENT,re=A.SUBCLASSING,L=b.getterFor(j),M=b.set,x=y&&y.prototype,m=y,C=x,U=n.TypeError,F=n.document,w=n.process,T=q.f,N=T,H=!!(F&&F.createEvent&&n.dispatchEvent),Q="unhandledrejection",J="rejectionhandled",le=0,ne=1,ue=2,ae=1,_e=2,xe,Be,Le,tr,Cr=function(B){var X;return v(B)&&f(X=B.then)?X:!1},_r=function(B,X){var oe=X.value,ce=X.state===ne,fe=ce?B.ok:B.fail,Ge=B.resolve,Ae=B.reject,He=B.domain,ke,Je,ht;try{fe?(ce||(X.rejection===_e&&Wr(X),X.rejection=ae),fe===!0?ke=oe:(He&&He.enter(),ke=fe(oe),He&&(He.exit(),ht=!0)),ke===B.promise?Ae(new U("Promise-chain cycle")):(Je=Cr(ke))?i(Je,ke,Ge,Ae):Ge(ke)):Ae(oe)}catch(Wt){He&&!ht&&He.exit(),Ae(Wt)}},Hr=function(B,X){B.notified||(B.notified=!0,S(function(){for(var oe=B.reactions,ce;ce=oe.get();)_r(ce,B);B.notified=!1,X&&!B.rejection&&Gt(B)}))},Gr=function(B,X,oe){var ce,fe;H?(ce=F.createEvent("Event"),ce.promise=X,ce.reason=oe,ce.initEvent(B,!1,!0),n.dispatchEvent(ce)):ce={promise:X,reason:oe},!K&&(fe=n["on"+B])?fe(ce):B===Q&&R("Unhandled promise rejection",oe)},Gt=function(B){i(p,n,function(){var X=B.facade,oe=B.value,ce=vt(B),fe;if(ce&&(fe=I(function(){t?w.emit("unhandledRejection",oe,X):Gr(Q,X,oe)}),B.rejection=t||vt(B)?_e:ae,fe.error))throw fe.value})},vt=function(B){return B.rejection!==ae&&!B.parent},Wr=function(B){i(p,n,function(){var X=B.facade;t?w.emit("rejectionHandled",X):Gr(J,X,B.value)})},be=function(B,X,oe){return function(ce){B(X,ce,oe)}},nr=function(B,X,oe){B.done||(B.done=!0,oe&&(B=oe),B.value=X,B.state=ue,Hr(B,!0))},Vr=function(B,X,oe){if(!B.done){B.done=!0,oe&&(B=oe);try{if(B.facade===X)throw new U("Promise can't be resolved itself");var ce=Cr(X);ce?S(function(){var fe={done:!1};try{i(ce,X,be(Vr,fe,B),be(nr,fe,B))}catch(Ge){nr(fe,Ge,B)}}):(B.value=X,B.state=ne,Hr(B,!1))}catch(fe){nr({done:!1},fe,B)}}};if(G&&(m=function(X){d(this,C),l(X),i(xe,this);var oe=L(this);try{X(be(Vr,oe),be(nr,oe))}catch(ce){nr(oe,ce)}},C=m.prototype,xe=function(X){M(this,{type:j,done:!1,notified:!1,parent:!1,reactions:new g,rejection:!1,state:le,value:null})},xe.prototype=o(C,"then",function(X,oe){var ce=L(this),fe=T(h(this,m));return ce.parent=!0,fe.ok=f(X)?X:!0,fe.fail=f(oe)&&oe,fe.domain=t?w.domain:void 0,ce.state===le?ce.reactions.add(fe):S(function(){_r(fe,ce)}),fe.promise}),Be=function(){var B=new xe,X=L(B);this.promise=B,this.resolve=be(Vr,X),this.reject=be(nr,X)},q.f=T=function(B){return B===m||B===Le?new Be(B):N(B)},!r&&f(y)&&x!==Object.prototype)){tr=x.then,re||o(x,"then",function(X,oe){var ce=this;return new m(function(fe,Ge){i(tr,ce,fe,Ge)}).then(X,oe)},{unsafe:!0});try{delete x.constructor}catch{}s&&s(x,C)}return e({global:!0,constructor:!0,wrap:!0,forced:G},{Promise:m}),Le=a.Promise,u(m,j,!1,!0),c(j),df}var xf={},_o,jf;function Hp(){if(jf)return _o;jf=1;var e=Te(),r=e("iterator"),t=!1;try{var n=0,a={next:function(){return{done:!!n++}},return:function(){t=!0}};a[r]=function(){return this},Array.from(a,function(){throw 2})}catch{}return _o=function(i,o){try{if(!o&&!t)return!1}catch{return!1}var s=!1;try{var u={};u[r]=function(){return{next:function(){return{done:s=!0}}}},i(u)}catch{}return s},_o}var Ao,Df;function on(){if(Df)return Ao;Df=1;var e=Xr(),r=Hp(),t=Tt().CONSTRUCTOR;return Ao=t||!r(function(n){e.all(n).then(void 0,function(){})}),Ao}var Mf;function Gp(){if(Mf)return xf;Mf=1;var e=Ie(),r=Ue(),t=Ze(),n=fr(),a=Qr(),i=Rt(),o=on();return e({target:"Promise",stat:!0,forced:o},{all:function(u){var c=this,l=n.f(c),f=l.resolve,v=l.reject,d=a(function(){var h=t(c.resolve),p=[],S=0,R=1;i(u,function(I){var g=S++,b=!1;R++,r(h,c,I).then(function(y){b||(b=!0,p[g]=y,--R||f(p))},v)}),--R||f(p)});return d.error&&v(d.value),l.promise}}),xf}var Ff={},Bf;function Wp(){if(Bf)return Ff;Bf=1;var e=Ie(),r=ar(),t=Tt().CONSTRUCTOR,n=Xr(),a=ze(),i=ye(),o=Ke(),s=n&&n.prototype;if(e({target:"Promise",proto:!0,forced:t,real:!0},{catch:function(c){return this.then(void 0,c)}}),!r&&i(n)){var u=a("Promise").prototype.catch;s.catch!==u&&o(s,"catch",u,{unsafe:!0})}return Ff}var Hf={},Gf;function Vp(){if(Gf)return Hf;Gf=1;var e=Ie(),r=Ue(),t=Ze(),n=fr(),a=Qr(),i=Rt(),o=on();return e({target:"Promise",stat:!0,forced:o},{race:function(u){var c=this,l=n.f(c),f=l.reject,v=a(function(){var d=t(c.resolve);i(u,function(h){r(d,c,h).then(l.resolve,f)})});return v.error&&f(v.value),l.promise}}),Hf}var Wf={},Vf;function zp(){if(Vf)return Wf;Vf=1;var e=Ie(),r=fr(),t=Tt().CONSTRUCTOR;return e({target:"Promise",stat:!0,forced:t},{reject:function(a){var i=r.f(this),o=i.reject;return o(a),i.promise}}),Wf}var zf={},ko,Kf;function Jf(){if(Kf)return ko;Kf=1;var e=Xe(),r=Ve(),t=fr();return ko=function(n,a){if(e(n),r(a)&&a.constructor===n)return a;var i=t.f(n),o=i.resolve;return o(a),i.promise},ko}var Yf;function Kp(){if(Yf)return zf;Yf=1;var e=Ie(),r=ze(),t=ar(),n=Xr(),a=Tt().CONSTRUCTOR,i=Jf(),o=r("Promise"),s=t&&!a;return e({target:"Promise",stat:!0,forced:t||a},{resolve:function(c){return i(s&&this===o?n:this,c)}}),zf}var Qf;function Jp(){return Qf||(Qf=1,Bp(),Gp(),Wp(),Vp(),zp(),Kp()),ff}var Xf={},Zf;function Yp(){if(Zf)return Xf;Zf=1;var e=Ie(),r=Ue(),t=Ze(),n=fr(),a=Qr(),i=Rt(),o=on();return e({target:"Promise",stat:!0,forced:o},{allSettled:function(u){var c=this,l=n.f(c),f=l.resolve,v=l.reject,d=a(function(){var h=t(c.resolve),p=[],S=0,R=1;i(u,function(I){var g=S++,b=!1;R++,r(h,c,I).then(function(y){b||(b=!0,p[g]={status:"fulfilled",value:y},--R||f(p))},function(y){b||(b=!0,p[g]={status:"rejected",reason:y},--R||f(p))})}),--R||f(p)});return d.error&&v(d.value),l.promise}}),Xf}var ed={},rd;function Qp(){if(rd)return ed;rd=1;var e=Ie(),r=Ue(),t=Ze(),n=ze(),a=fr(),i=Qr(),o=Rt(),s=on(),u="No one promise resolved";return e({target:"Promise",stat:!0,forced:s},{any:function(l){var f=this,v=n("AggregateError"),d=a.f(f),h=d.resolve,p=d.reject,S=i(function(){var R=t(f.resolve),I=[],g=0,b=1,y=!1;o(l,function(A){var q=g++,j=!1;b++,r(R,f,A).then(function(G){j||y||(y=!0,h(G))},function(G){j||y||(j=!0,I[q]=G,--b||p(new v(I,u)))})}),--b||p(new v(I,u))});return S.error&&p(S.value),d.promise}}),ed}var td={},nd;function ad(){if(nd)return td;nd=1;var e=Ie(),r=me(),t=Sf(),n=nn(),a=fr(),i=Ze(),o=Qr(),s=r.Promise,u=!1,c=!s||!s.try||o(function(){s.try(function(l){u=l===8},8)}).error||!u;return e({target:"Promise",stat:!0,forced:c},{try:function(l){var f=arguments.length>1?n(arguments,1):[],v=a.f(this),d=o(function(){return t(i(l),void 0,f)});return(d.error?v.reject:v.resolve)(d.value),v.promise}}),td}var id={},od;function sd(){if(od)return id;od=1;var e=Ie(),r=fr();return e({target:"Promise",stat:!0},{withResolvers:function(){var n=r.f(this);return{promise:n.promise,resolve:n.resolve,reject:n.reject}}}),id}var ud={},cd;function Xp(){if(cd)return ud;cd=1;var e=Ie(),r=ar(),t=Xr(),n=Re(),a=ze(),i=ye(),o=bf(),s=Jf(),u=Ke(),c=t&&t.prototype,l=!!t&&n(function(){c.finally.call({then:function(){}},function(){})});if(e({target:"Promise",proto:!0,real:!0,forced:l},{finally:function(v){var d=o(this,a("Promise")),h=i(v);return this.then(h?function(p){return s(d,v()).then(function(){return p})}:v,h?function(p){return s(d,v()).then(function(){throw p})}:v)}}),!r&&i(t)){var f=a("Promise").prototype.finally;c.finally!==f&&u(c,"finally",f,{unsafe:!0})}return ud}var qo,ld;function Zp(){if(ld)return qo;ld=1,$p(),bi(),Lp(),Jp(),Yp(),Qp(),ad(),sd(),Xp(),Sl();var e=an();return qo=e.Promise,qo}var $o,fd;function em(){if(fd)return $o;fd=1;var e=Zp();return Kl(),$o=e,$o}var dd={},vd;function rm(){return vd||(vd=1,ad()),dd}var hd={},pd;function tm(){return pd||(pd=1,sd()),hd}var Uo,md;function nm(){if(md)return Uo;md=1;var e=em();return rm(),tm(),Uo=e,Uo}nm();const gd="sesamy-debug";function am(e,r,t){const n=new Date;n.setTime(n.getTime()+t*60*60*1e3);const a="expires="+n.toUTCString();document.cookie=`${e}=${r}; ${a}; path=/`}function im(e){if(typeof document>"u")return null;const r=e+"=",t=document.cookie.split(";");for(let n=0;n<t.length;n++){let a=t[n];for(;a.charAt(0)===" ";)a=a.substring(1);if(a.indexOf(r)===0)return a.substring(r.length,a.length)}return null}function om(e){am(gd,e.toString(),1)}function sm(){return im(gd)==="true"}function de(e){sm()&&console.log(e)}function $r(e,r){if(typeof window>"u")return;const t=new CustomEvent(e,{detail:r,bubbles:!0,composed:!0});de(`Triggering event: ${e}`),dispatchEvent(t)}const um=Object.freeze(Object.defineProperty({__proto__:null,triggerEvent:$r},Symbol.toStringTag,{value:"Module"}));let yd=null;function Lo(e){yd=e}function bd(){return yd}var er=(e=>(e.AUTH_INITIALIZED="sesamyJsAuthInitialized",e.READY="sesamyJsReady",e.AUTHENTICATED="sesamyJsAuthenticated",e.LOGOUT="sesamyJsLogout",e.CLEAR_CACHE="sesamyJsClearCache",e.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",e.PURCHASE="sesamyJsPurchase",e))(er||{});const cm=Object.freeze(Object.defineProperty({__proto__:null,Events:er},Symbol.toStringTag,{value:"Module"})),wd="sesamy_is_authenticated";function lm(){try{return document.cookie.split(";").some(e=>e.trim().startsWith(`${wd}=true`))}catch{return!1}}function No(e){try{const r=e?2592e3:0,t=window.location.protocol==="https:"?"; Secure":"";document.cookie=`${wd}=${e}; path=/; max-age=${r}; SameSite=Lax${t}`}catch{}}function fm(e={}){let r=e.baseUrl??"",t="",n=!1,a=null,i=null;async function o(){try{const u=await fetch(`${r}/auth/userinfo`,{credentials:"include",headers:{Accept:"application/json"}});return u.ok?await u.json():null}catch(u){return de(`[cookie-auth] Failed to fetch userinfo: ${u.message}`),null}}const s={async init(u){if(t=u.vendorId||u.clientId||"",de(`[cookie-auth] Initializing with baseUrl: ${r}`),lm()){const c=await o();c===null?de("[cookie-auth] userinfo fetch failed transiently; retaining session hint"):c.authenticated&&c.sub?(a=!0,i=c,No(!0),$r(er.AUTHENTICATED,{sub:c.sub,appState:void 0})):(a=!1,No(!1))}else a=!1;n=!0,$r(er.AUTH_INITIALIZED,{})},async isAuthenticated(){if(!n)return!1;if(a!==null)return a;const u=await o();return u===null?(de("[cookie-auth] userinfo fetch failed transiently in isAuthenticated; will retry"),!1):(a=u.authenticated,a)},async getTokenSilently(u,c){return null},async getUser(){if(!n)return null;if(i)return i;const u=await o();return u?.authenticated&&u.sub?(i=u,i):null},async login(u){if(!t)throw new Error("[cookie-auth] vendorId is required to build a login URL");const c=u?.returnTo??window.location.href,l=new URL(`${r}/auth/${encodeURIComponent(t)}/login`,window.location.origin);l.searchParams.set("return_to",c),window.location.href=l.toString()},async loginWithRedirect(u){return s.login(u)},async loginWithPopup(u){return de("[cookie-auth] loginWithPopup called — falling back to redirect"),s.login(u)},async logout(u){a=!1,i=null,No(!1),$r(er.LOGOUT,{});const c=u?.returnTo??window.location.href,l=new URL(`${r}/auth/logout`,window.location.origin);l.searchParams.set("return_to",c),u?.localOnly&&l.searchParams.set("local_only","true"),window.location.href=l.toString()}};return s}const dm="sesamyAccessToken";let Ot=!1;function Sr(){const e=bd();if(!e)throw new Error("[sesamy-js] No auth plugin registered. This should not happen.");return e}async function vm(e){if(e.enabled===!1){de("Auth disabled via config"),Ot=!0;return}if(e.useHttpCookies)de("useHttpCookies=true — using cookie-based BFF plugin"),Lo(fm());else if(!bd())throw new Error("[sesamy-js] No auth plugin registered. Load the auth0-plugin bundle before sesamy-js, or set useHttpCookies: true to use the cookie-based BFF plugin.");await Sr().init(e),Ot=!0}async function dr(){return Ot?Sr().isAuthenticated():!1}async function vr(e=!0,r=!1){return Ot?Sr().getTokenSilently(e,r):null}async function hm(){return Ot?Sr().getUser():null}async function pm(e){return Sr().login(e)}async function xo(e){return Sr().loginWithRedirect(e)}async function mm(e){return Sr().loginWithPopup(e)}async function gm(e={}){return Sr().logout(e)}async function jo(e){const r=e.split(".");if(r.length!==3)throw new Error("Invalid token");const t=decodeURIComponent(atob(r[1].replace(/-/g,"+").replace(/_/g,"/")).split("").map(o=>"%"+("00"+o.charCodeAt(0).toString(16)).slice(-2)).join("")),n=JSON.parse(t);if(!n?.exp||n.exp<Date.now()/1e3)throw new Error("Invalid token");de("Set token"),localStorage.setItem(dm,e);const{triggerEvent:a}=await Promise.resolve().then(()=>um),{Events:i}=await Promise.resolve().then(()=>cm);a(i.AUTHENTICATED,{...n,appState:void 0})}const ym=(e,r)=>r.skipDedupe||r.method!=="GET",bm=(e,r)=>r.method+"@"+e,wm=e=>e.clone(),Sm=({skip:e=ym,key:r=bm,resolver:t=wm}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const s=r(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,c)=>{n.get(s).push([u,c])});try{return a(i,o).then(u=>(n.get(s).forEach(([c])=>c(t(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,c])=>c(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},Im=(e,r)=>e*r,Pm=e=>e&&e.ok,Em=({delayTimer:e=500,delayRamp:r=Im,maxAttempts:t=10,until:n=Pm,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(c,l)=>{let f=0;if(s&&s(c,l))return u(c,l);const v=(d,h)=>Promise.resolve(n(d,h)).then(p=>p?d&&o?d:h?Promise.reject(h):d:(f++,!t||f<=t?new Promise(S=>{const R=r(e,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:h,url:c,options:l})).then((I={})=>{var g,b;S(u((g=I&&I.url)!==null&&g!==void 0?g:c,(b=I&&I.options)!==null&&b!==void 0?b:l))}):S(u(c,l))},R)}).then(v).catch(S=>{if(!i)throw S;return v(null,S)}):d&&o?d:Promise.reject(h||new Error("Number of attempts exceeded."))));return u(c,l).then(v).catch(d=>{if(!i)throw d;return v(null,d)})};let Do=class Fh extends Error{status;statusText;url;body;constructor(r,t,n,a,i){super(a),this.name="APIError",this.status=r,this.statusText=t,this.url=n,this.body=i,Error.captureStackTrace&&Error.captureStackTrace(this,Fh)}isClientError(){return this.status>=400&&this.status<500}isServerError(){return this.status>=500}isForbiddenError(){return this.status===403}isNotFoundError(){return this.status===404}};var sn=(e=>(e.BROWSER="browser",e.NORMAL="normal",e))(sn||{});const Rm="application/json",Sd="Content-Type",Zr=Symbol(),Id=Symbol();function Pd(e={}){var r;const t=e instanceof Array?Object.fromEntries(e):e;return(r=Object.entries(t).find(([n])=>n.toLowerCase()===Sd.toLowerCase()))===null||r===void 0?void 0:r[1]}function Ed(e){return/^application\/.*json.*/.test(e)}const Ur=function(e,r,t=!1){return Object.entries(r).reduce((n,[a,i])=>{const o=e[a];return Array.isArray(o)&&Array.isArray(i)?n[a]=t?[...o,...i]:i:typeof o=="object"&&typeof i=="object"?n[a]=Ur(o,i,t):n[a]=i,n},{...e})},et={options:{},errorType:"text",polyfills:{},polyfill(e,r=!0,t=!1,...n){const a=this.polyfills[e]||(typeof self<"u"?self[e]:null)||(typeof global<"u"?global[e]:null);if(r&&!a)throw new Error(e+" is not defined");return t&&a?new a(...n):a}};function Tm(e,r=!1){et.options=r?e:Ur(et.options,e)}function Om(e,r=!1){et.polyfills=r?e:Ur(et.polyfills,e)}function Cm(e){et.errorType=e}const _m=e=>r=>e.reduceRight((t,n)=>n(t),r)||r;let Rd=class extends Error{};const Am=e=>{const r=Object.create(null);e=e._addons.reduce((g,b)=>b.beforeRequest&&b.beforeRequest(g,e._options,r)||g,e);const{_url:t,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:u}=e,c=new Map(i),l=Ur(a.options,n);let f=t;const v=_m(s)((g,b)=>(f=g,a.polyfill("fetch")(g,b)))(t,l),d=new Error,h=v.catch(g=>{throw{[Zr]:g}}).then(g=>{var b;if(!g.ok){const y=new Rd;if(y.cause=d,y.stack=y.stack+`
2
- CAUSE: `+d.stack,y.response=g,y.status=g.status,y.url=f,g.type==="opaque")throw y;const A=a.errorType==="json"||((b=g.headers.get("Content-Type"))===null||b===void 0?void 0:b.split(";")[0])==="application/json";return(a.errorType?A?g.text():g[a.errorType]():Promise.resolve(g.body)).then(q=>{if(y.message=typeof q=="string"?q:g.statusText,q)if(A&&typeof q=="string"){y.text=q;try{y.json=JSON.parse(q)}catch{}}else y[a.errorType]=q;throw y})}return g}),p=g=>g.catch(b=>{const y=Object.prototype.hasOwnProperty.call(b,Zr),A=y?b[Zr]:b,q=A?.status&&c.get(A.status)||c.get(A?.name)||y&&c.has(Zr)&&c.get(Zr);if(q)return q(A,e);const j=c.get(Id);if(j)return j(A,e);throw A}),S=g=>b=>p(g?h.then(y=>y&&y[g]()).then(y=>b?b(y):y):h.then(y=>b?b(y):y)),R={_wretchReq:e,_fetchReq:v,_sharedState:r,res:S(null),json:S("json"),blob:S("blob"),formData:S("formData"),arrayBuffer:S("arrayBuffer"),text:S("text"),error(g,b){return c.set(g,b),this},badRequest(g){return this.error(400,g)},unauthorized(g){return this.error(401,g)},forbidden(g){return this.error(403,g)},notFound(g){return this.error(404,g)},timeout(g){return this.error(408,g)},internalError(g){return this.error(500,g)},fetchError(g){return this.error(Zr,g)}},I=u.reduce((g,b)=>({...g,...typeof b.resolver=="function"?b.resolver(g):b.resolver}),R);return o.reduce((g,b)=>b(g,e),I)},km={_url:"",_options:{},_config:et,_catchers:new Map,_resolvers:[],_deferred:[],_middlewares:[],_addons:[],addon(e){return{...this,_addons:[...this._addons,e],...e.wretch}},errorType(e){return{...this,_config:{...this._config,errorType:e}}},polyfills(e,r=!1){return{...this,_config:{...this._config,polyfills:r?e:Ur(this._config.polyfills,e)}}},url(e,r=!1){if(r)return{...this,_url:e};const t=this._url.split("?");return{...this,_url:t.length>1?t[0]+e+"?"+t[1]:this._url+e}},options(e,r=!1){return{...this,_options:r?e:Ur(this._options,e)}},headers(e){const r=e?Array.isArray(e)?Object.fromEntries(e):"entries"in e?Object.fromEntries(e.entries()):e:{};return{...this,_options:Ur(this._options,{headers:r})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[Sd]:e})},auth(e){return this.headers({Authorization:e})},catcher(e,r){const t=new Map(this._catchers);return t.set(e,r),{...this,_catchers:t}},catcherFallback(e){return this.catcher(Id,e)},resolve(e,r=!1){return{...this,_resolvers:r?[e]:[...this._resolvers,e]}},defer(e,r=!1){return{...this,_deferred:r?[e]:[...this._deferred,e]}},middlewares(e,r=!1){return{...this,_middlewares:r?e:[...this._middlewares,...e]}},fetch(e=this._options.method,r="",t=null){let n=this.url(r).options({method:e});const a=Pd(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof t=="object"&&!(i&&t instanceof i)&&(!n._options.headers||!a||Ed(a));return n=t?o?n.json(t,a):n.body(t):n,Am(n._deferred.reduce((s,u)=>u(s,s._url,s._options),n))},get(e=""){return this.fetch("GET",e)},delete(e=""){return this.fetch("DELETE",e)},put(e,r=""){return this.fetch("PUT",r,e)},post(e,r=""){return this.fetch("POST",r,e)},patch(e,r=""){return this.fetch("PATCH",r,e)},head(e=""){return this.fetch("HEAD",e)},opts(e=""){return this.fetch("OPTIONS",e)},body(e){return{...this,_options:{...this._options,body:e}}},json(e,r){const t=Pd(this._options.headers);return this.content(r||Ed(t)&&t||Rm).body(JSON.stringify(e))}};function ir(e="",r={}){return{...km,_url:e,_options:r}}ir.default=ir,ir.options=Tm,ir.errorType=Cm,ir.polyfills=Om,ir.WretchError=Rd;const qm=(e,r)=>r.skipDedupe||r.method!=="GET",$m=(e,r)=>r.method+"@"+e,Um=e=>e.clone(),Lm=({skip:e=qm,key:r=$m,resolver:t=Um}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const s=r(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,c)=>{n.get(s).push([u,c])});try{return a(i,o).then(u=>(n.get(s).forEach(([c])=>c(t(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,c])=>c(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},Nm=(e,r)=>r.skipCache||r.method!=="GET",xm=(e,r)=>r.method+"@"+e,jm=()=>!1,Dm=()=>null,Mm=e=>e.ok,Fm=({throttle:e=1e3,skip:r=Nm,key:t=xm,clear:n=jm,invalidate:a=Dm,condition:i=Mm,flagResponseOnCacheHit:o="__cached"}={})=>{const s=new Map,u=new Map,c=new Set,l=v=>{e&&!c.has(v)&&(c.add(v),setTimeout(()=>{c.delete(v)},e))},f=v=>(d,h)=>{const p=t(d,h);let S=a(d,h);if(S&&(S instanceof Array||(S=[S]),S.forEach(R=>{typeof R=="string"?s.delete(R):R instanceof RegExp&&s.forEach((I,g)=>{R.test(g)&&s.delete(g)})})),n(d,h)&&s.clear(),r(d,h))return v(d,h);if(c.has(p)){if(s.has(p)){const R=s.get(p).clone();return o&&Object.defineProperty(R,o,{value:p,enumerable:!1}),Promise.resolve(R)}else if(u.has(p))return new Promise((R,I)=>{u.get(p).push([R,I])})}return u.has(p)||u.set(p,[]),l(p),v(d,h).then(R=>(i(R.clone())&&s.set(p,R.clone()),u.get(p).forEach(([I])=>I(R.clone())),u.delete(p),R)).catch(R=>{throw u.get(p).forEach(([,I])=>I(R)),u.delete(p),R})};return f.cacheResponse=function(v,d){l(v),s.set(v,d)},f.cache=s,f.inflight=u,f.throttling=c,f},Bm=(e,r)=>e*r,Hm=e=>e&&e.ok,Gm=({delayTimer:e=500,delayRamp:r=Bm,maxAttempts:t=10,until:n=Hm,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(c,l)=>{let f=0;if(s&&s(c,l))return u(c,l);const v=(d,h)=>Promise.resolve(n(d,h)).then(p=>p?d&&o?d:h?Promise.reject(h):d:(f++,!t||f<=t?new Promise(S=>{const R=r(e,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:h,url:c,options:l})).then((I={})=>{var g,b;S(u((g=I&&I.url)!==null&&g!==void 0?g:c,(b=I&&I.options)!==null&&b!==void 0?b:l))}):S(u(c,l))},R)}).then(v).catch(S=>{if(!i)throw S;return v(null,S)}):d&&o?d:Promise.reject(h||new Error("Number of attempts exceeded."))));return u(c,l).then(v).catch(d=>{if(!i)throw d;return v(null,d)})},Wm="@sesamy/sdk",Vm="1.23.0";let zm=class{cache=new Map;get(r){return this.cache.get(r)||null}set(r,t){this.cache.set(r,t)}remove(r){this.cache.delete(r)}clear(){this.cache.clear()}};const Ct="sesamyCacheTimestamp",Km=e=>{const{libraryName:r=Wm,libraryVersion:t=Vm,cache:n}=e,a=n?.storage||new zm,i=[s=>async(u,c)=>{if(n?.mode===sn.BROWSER){let l;typeof sessionStorage<"u"?(l=sessionStorage.getItem(Ct),l||(l=Date.now().toString(),sessionStorage.setItem(Ct,l))):(l=a.get(Ct),l||(l=Date.now().toString(),a.set(Ct,l)));const f={...c,headers:{...c.headers,"Cache-Timestamp":l}};return s(u,f)}return s(u,c)},s=>async(u,c)=>{const l=await e.tokenProvider();if(l===null)return s(u,c);const f={...c,headers:{...c.headers,Authorization:l}};return s(u,f)},Lm()];n?.mode===sn.NORMAL&&i.push(Fm({throttle:300*1e3,skip:(s,u)=>u.method!=="GET"})),i.push(Gm({delayTimer:1e3,delayRamp:(s,u)=>s*u,maxAttempts:3,until:s=>!!(s&&(s.ok||s.status>=400&&s.status<500)),retryOnNetworkError:!1}));const o=ir(e.baseUrl).headers({"Content-Type":"application/json","X-Sesamy-Client":`${r}/${t}`,...e.headers}).middlewares(i);return{async request(s,u={}){try{const c=/^https?:\/\//.test(s);let l=o.url(s,c);u.headers&&(l=l.headers(u.headers));const f=(u.method||"GET").toLowerCase();let v;switch(f){case"get":v=l.get();break;case"post":v=l.post(u.body);break;case"put":v=l.put(u.body);break;case"patch":v=l.patch(u.body);break;case"delete":v=l.delete();break;default:v=l.get()}const d=await v.res();if(d.ok&&["post","patch","put","delete"].includes(f)&&hr(),d.status===204)return null;if(!d.ok){const h=await d.text().catch(()=>"Unknown error");throw new Do(d.status,d.statusText,d.url,`API Error ${d.status}: ${h}`,h)}return await d.json()}catch(c){if(c instanceof Do)throw c;const l=c.status||500,f=c.message||"Unknown error",v=`${e.baseUrl}${s}`;throw new Do(l,f,v,`API Error ${l}: ${c.message||"Unknown error"}`,c.message||"Unknown error")}}}},hr=()=>(typeof sessionStorage<"u"&&sessionStorage.removeItem(Ct),"Cache cleared"),_t={get:async(e,r)=>e.request(`/profile/${r}`),update:async(e,r,t)=>e.request(`/profile/${r}`,{method:"PATCH",body:JSON.stringify(t)}),checkSpotifyLink:async e=>e.request("/profile/spotify-link"),unlinkSpotify:async e=>e.request("/profile/unlink-spotify",{method:"POST"}),delete:async e=>{await e.request("/profile",{method:"DELETE"})}},Mo={list:async(e,r)=>{const t=new URLSearchParams;r?.type&&t.append("type",r.type),r?.sku&&t.append("sku",r.sku),r?.purchaseOptionId&&t.append("purchase-option-id",r.purchaseOptionId),r?.waitForEntitlementAfter&&t.append("wait-for-entitlement-after",r.waitForEntitlementAfter);const n=t.toString(),a=n?`/entitlements?${n}`:"/entitlements";return e.request(a)},get:async(e,r)=>e.request(`/entitlements/${r}`),getAccess:async(e,r)=>e.request(`/entitlements/${r}/access`)},Td={list:async e=>e.request("/subscriptions"),get:async(e,r)=>e.request(`/subscriptions/${r}`)},Od={get:async(e,r)=>e.request(`/products/${r}`),autoOnboard:async(e,r)=>e.request(`/products/${r}/auto-onboard`,{method:"POST"})},Jm=(e,r)=>{if(!e||!r)return e;const t=new URL(e);return t.hash=`access_token=${r}`,t.toString()},Cd=(e,r)=>!e.manageUrl||!r?e:{...e,manageUrl:Jm(e.manageUrl,r)},At={list:async e=>e.request("/contracts"),get:async(e,r)=>e.request(`/contracts/${r}`),cancel:async(e,r)=>e.request(`/contracts/${r}/cancel`,{method:"POST"}),createAmendment:async(e,r,t)=>e.request(`/contracts/${r}/amendments`,{method:"POST",body:JSON.stringify(t)}),confirmAmendment:async(e,r,t)=>e.request(`/contracts/${r}/amendments/${t}/confirm`,{method:"POST"})},Fo={get:async e=>e.request("/user-metadata"),set:async(e,r,t)=>{await e.request(`/user-metadata/${r}`,{method:"PUT",body:t})},delete:async(e,r)=>{await e.request(`/user-metadata/${r}`,{method:"DELETE"})}},rt={list:async e=>e.request("/tallies"),get:async(e,r)=>e.request(`/tallies/${r}`),update:async(e,r,t)=>e.request(`/tallies/${r}`,{method:"PUT",body:JSON.stringify(t)}),create:async(e,r)=>e.request("/tallies",{method:"POST",body:JSON.stringify(r)}),delete:async(e,r)=>{try{return await e.request(`/tallies/${r}`,{method:"DELETE"}),!0}catch{return!1}},push:async(e,r,t)=>e.request(`/tallies/${r}/push`,{method:"POST",body:JSON.stringify(t)})},Bo={list:async e=>e.request("/tags"),add:async(e,r)=>{await e.request("/tags",{method:"POST",body:JSON.stringify({tag:r})})},remove:async(e,r)=>{await e.request(`/tags/${r}`,{method:"DELETE"})}},tt={generateCheckoutLink:(e,r)=>{const t=new URL(`${e.apiUrl}/checkouts`);return r.items&&t.searchParams.set("items",JSON.stringify(r.items)),r.email&&t.searchParams.set("email",r.email),r.language&&t.searchParams.set("lang",r.language),r.redirectUrl&&t.searchParams.set("redirect-url",r.redirectUrl),r.giftMode&&t.searchParams.set("gift-mode","true"),r.payerEmail&&t.searchParams.set("payer-email",r.payerEmail),r.requireAddress&&t.searchParams.set("require-address","true"),r.metadata&&Object.entries(r.metadata).forEach(([n,a])=>{t.searchParams.set(`metadata.${n}`,a)}),t.toString()},generateAccountLink:(e,r)=>{const t=r.language||"en",n=new URL(`${e.baseUrl}/account/${encodeURIComponent(t)}/subscriptions/${encodeURIComponent(e.clientId)}${r.contractId?`/${encodeURIComponent(r.contractId)}`:""}`);return n.searchParams.set("sesamy-redirect-url",r.redirectUrl||"/"),n.toString()},generateChangePaymentLink:(e,r)=>{const t=r.language||"en",n=new URL(`${e.baseUrl}/account/${encodeURIComponent(t)}/subscriptions/${encodeURIComponent(e.clientId)}/${encodeURIComponent(r.contractId)}/change-payment-method`);return n.searchParams.set("sesamy-redirect-url",r.redirectUrl||"/"),n.toString()},generateChangePlanLink:(e,r)=>{const t=r.language||"en",n=new URL(`${e.baseUrl}/account/${encodeURIComponent(t)}/subscriptions/${encodeURIComponent(e.clientId)}/${encodeURIComponent(r.contractId)}/edit-plan`);return n.searchParams.set("sesamy-redirect-url",r.redirectUrl||"/"),n.toString()},generateConsumeLink:(e,r)=>{const t=r.language||"en";let n=new URL(`${e.baseUrl}/consume/${encodeURIComponent(t)}/@${encodeURIComponent(e.clientId)}/${encodeURIComponent(r.sku)}`);return r.episodeId?n.href+=`/${encodeURIComponent(r.episodeId)}`:n.href+="/listen",n.searchParams.set("sesamy-redirect-url",r.redirectUrl||"/"),n.toString()}},Ho={generateLink:(e,r)=>{const t=new URL(`${e.apiUrl}/checkouts`);return r.items&&t.searchParams.set("items",JSON.stringify(r.items)),r.email&&t.searchParams.set("email",r.email),r.language&&t.searchParams.set("lang",r.language),r.redirectUrl&&t.searchParams.set("redirect-url",r.redirectUrl),r.giftMode&&t.searchParams.set("gift-mode","true"),r.payerEmail&&t.searchParams.set("payer-email",r.payerEmail),r.requireAddress&&t.searchParams.set("require-address","true"),r.metadata&&Object.entries(r.metadata).forEach(([n,a])=>{t.searchParams.set(`metadata.${n}`,a)}),t.toString()},create:async(e,r)=>e.request("/checkouts",{method:"POST",body:JSON.stringify(r)}),get:async(e,r)=>e.request(`/checkouts/${r}`),update:async(e,r,t)=>e.request(`/checkouts/${r}`,{method:"PATCH",body:JSON.stringify(t)})},_d={list:async e=>e.request("/bills"),get:async(e,r)=>e.request(`/bills/${r}`)},Ad={list:async e=>e.request("/fulfillments"),create:async(e,r)=>e.request("/fulfillments",{method:"POST",body:JSON.stringify(r)})},Ym={get:async(e,r)=>{try{return new URL(r),e.request(r)}catch{return e.request(`/paywalls/${r}`)}}},Qm={list:async e=>e.request("/payment-issues")},Xm={content:async(e,r,t,n,a)=>{const i=new URLSearchParams({url:r});return t&&i.append("selector",t),n&&i.append("cache",n),e.request(`/proxy?${i.toString()}`,a)}},Zm={list:async(e,r)=>{const t=(r?new URLSearchParams({q:r}):new URLSearchParams).toString(),n=t?`/transactions?${t}`:"/transactions";return e.request(n)}},kd={get:async e=>e.request("/vendor"),list:async e=>e.request("/vendors")},eg=e=>{const r=Km(e);return{profile:{get:t=>_t.get(r,t),update:(t,n)=>_t.update(r,t,n),checkSpotifyLink:()=>_t.checkSpotifyLink(r),unlinkSpotify:()=>_t.unlinkSpotify(r),delete:()=>_t.delete(r)},entitlements:{list:t=>Mo.list(r,t),get:t=>Mo.get(r,t),getAccess:t=>Mo.getAccess(r,t)},subscriptions:{list:()=>Td.list(r),get:t=>Td.get(r,t)},products:{get:t=>Od.get(r,t),autoOnboard:t=>Od.autoOnboard(r,t)},contracts:{list:async()=>{const t=await At.list(r),n=await e.tokenProvider();if(!n.toLowerCase().startsWith("bearer "))return t;const a=n.substring(7);return t.map(i=>Cd(i,a))},get:async t=>{const n=await At.get(r,t),a=await e.tokenProvider();if(!a.toLowerCase().startsWith("bearer "))return n;const i=a.substring(7);return Cd(n,i)},cancel:t=>At.cancel(r,t),createAmendment:(t,n)=>At.createAmendment(r,t,n),confirmAmendment:(t,n)=>At.confirmAmendment(r,t,n)},userMetadata:{get:()=>Fo.get(r),set:(t,n)=>Fo.set(r,t,n),delete:t=>Fo.delete(r,t)},tallies:{list:()=>rt.list(r),get:t=>rt.get(r,t),update:(t,n)=>rt.update(r,t,n),create:t=>rt.create(r,t),delete:t=>rt.delete(r,t),push:(t,n)=>rt.push(r,t,n)},tags:{list:()=>Bo.list(r),add:t=>Bo.add(r,t),remove:t=>Bo.remove(r,t)},checkouts:{generateLink:(t,n)=>tt.generateCheckoutLink(t,n),create:t=>Ho.create(r,t),get:t=>Ho.get(r,t),update:(t,n)=>Ho.update(r,t,n)},links:{generateCheckoutLink:(t,n)=>tt.generateCheckoutLink(t,n),generateAccountLink:(t,n)=>tt.generateAccountLink(t,n),generateChangePaymentLink:(t,n)=>tt.generateChangePaymentLink(t,n),generateChangePlanLink:(t,n)=>tt.generateChangePlanLink(t,n),generateConsumeLink:(t,n)=>tt.generateConsumeLink(t,n)},bills:{list:()=>_d.list(r),get:t=>_d.get(r,t)},fulfillments:{list:()=>Ad.list(r),create:t=>Ad.create(r,t)},paywalls:{get:t=>Ym.get(r,t)},paymentIssues:{list:()=>Qm.list(r)},proxy:{content:(t,n,a,i)=>Xm.content(r,t,n,a,i)},transactions:{list:t=>Zm.list(r,t)},vendor:{get:()=>kd.get(r),list:()=>kd.list(r)}}},rg="sesamy.com",tg="sesamy.dev",ng="https://sesa.my",qd="sesamyCacheTimestamp",$d="sesamyContentReloaded";class ag{get(r){return typeof sessionStorage>"u"?null:sessionStorage.getItem(r)}set(r,t){typeof sessionStorage<"u"&&sessionStorage.setItem(r,t)}remove(r){typeof sessionStorage<"u"&&sessionStorage.removeItem(r)}clear(){}}function ig(e,r){return`${e}.${r==="dev"?tg:rg}`}function or(e,r){return`https://${ig(e,r)}`}function un(){let r=(document.documentElement.getAttribute("lang")??navigator.language??"en").split("-")[0]?.toLowerCase()??"en";return r==="nn"&&(r="nb"),r}function Go(e){let r;try{r=new URL(e)}catch{return!1}return r.protocol==="http:"||r.protocol==="https:"}function Ud(e,r){if(Go(e))return{itemSrc:e};const t=e.split(":");if(t.length<2)throw new Error(`Invalid itemSrc format: expected at least 2 segments separated by ':', got ${t.length}`);const[n,a,i]=t;if(!a)throw new Error("Invalid itemSrc format: sku segment is empty");return{sku:`${n}:${a}`,purchaseOption:r||i}}function Ld(e){return e.endsWith("/")?e.slice(0,-1):e}function Nd(e,r){if(!Go(e)||!Go(r))return!1;const t=new URL(e),n=new URL(r);return t.origin===n.origin&&Ld(t.pathname)===Ld(n.pathname)}function og(e,r,t){const n=new URL(`${or("checkout3",e.environment)}`);r.language&&n.searchParams.set("lang",r.language);let a=r.sku,i=r.purchaseOptionId,o=r.itemSrc;if(r.itemSrc){const l=Ud(r.itemSrc,r.purchaseOptionId);a=l.sku||a,i=l.purchaseOption||i,o=l.itemSrc}a?(n.searchParams.set("sku",a),i&&n.searchParams.set("po-id",i)):o&&n.searchParams.set("url",o),r.email&&n.searchParams.set("email",r.email),r.business&&n.searchParams.set("business","true"),r.currency&&n.searchParams.set("currency",r.currency),r.price&&n.searchParams.set("price",r.price.toString()),r.discountCode&&n.searchParams.set("discount-code",r.discountCode),r.attributionItemSrc?n.searchParams.set("itemSrc",r.attributionItemSrc):t.itemSrc&&n.searchParams.set("itemSrc",t.itemSrc),r.attributionPublisherContentId?n.searchParams.set("publisherContentId",r.attributionPublisherContentId):t.publisherContentId&&n.searchParams.set("publisherContentId",t.publisherContentId),r.utmSource?n.searchParams.set("utm_source",r.utmSource):t.utmSource&&n.searchParams.set("utm_source",t.utmSource),r.utmMedium?n.searchParams.set("utm_medium",r.utmMedium):t.utmMedium&&n.searchParams.set("utm_medium",t.utmMedium),r.utmCampaign?n.searchParams.set("utm_campaign",r.utmCampaign):t.utmCampaign&&n.searchParams.set("utm_campaign",t.utmCampaign),r.utmTerm?n.searchParams.set("utm_term",r.utmTerm):t.utmTerm&&n.searchParams.set("utm_term",t.utmTerm),r.utmContent?n.searchParams.set("utm_content",r.utmContent):t.utmContent&&n.searchParams.set("utm_content",t.utmContent);const s=["_ga","_gid","_fbp","_fbc"];document.cookie.split(";").map(l=>{const[f,v]=l.trim().split("=");return{key:f,value:v}}).filter(l=>s.some(f=>f===l.key)).forEach(l=>{n.searchParams.append(l.key,l.value)});let c=new URL(window.location.href);if(r.redirectUrl)try{c=new URL(r.redirectUrl)}catch{console.warn("Invalid redirect URL provided, using current URL instead:",r.redirectUrl)}return c.searchParams.set("force-refetch-entitlements","true"),r.itemSrc&&c.searchParams.set("sesamy-purchase",r.itemSrc),n.searchParams.set("redirect-url",c.toString()),r.paymentMethodsFilter&&n.searchParams.set("paymentmethods-filter",r.paymentMethodsFilter.flatMap(({provider:l,methods:f})=>f?f.map(v=>`${l}|${v}`):l).join(",")),r.requireAddress&&n.searchParams.set("require-address","true"),r.giftMode&&n.searchParams.set("gift-mode","true"),r.payerEmail&&n.searchParams.set("payer-email",r.payerEmail),r.metadata&&Object.entries(r.metadata).forEach(([l,f])=>{n.searchParams.set(`metadata.${l}`,String(f))}),n}const xd="sesamySignedURLs";function Wo(){const e=sessionStorage.getItem(xd);return e?JSON.parse(e):[]}function jd(e){const r=Wo();r.push(e),de(`Adding signed URL: ${e}`),sessionStorage.setItem(xd,JSON.stringify(r))}function sg(e){const r={};return Object.keys(e).forEach(t=>{const n=e[t];n!=null&&(r[t]=n.toString())}),r}const Vo="sesamyAttribution";function ug(e){const r=localStorage.getItem(e);if(!r)return null;try{return JSON.parse(r).value}catch{return console.error(`Failed to parse ${e}`),null}}function cg(e){return Object.keys(e).find(r=>r.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...e}:e}function cn(){return ug(Vo)||{}}function Dd(e){if(e===null)localStorage.removeItem(Vo);else{de(`Setting attribution ${JSON.stringify(e)}`);const r=cn()??{},t=sg({...r,...cg(e)});localStorage.setItem(Vo,JSON.stringify({value:t}))}}const zo="@sesamy/sesamy-js",kt="1.97.0",Md="sesamyFlags";async function Fd(e){try{localStorage.setItem(Md,JSON.stringify(e))}catch{de("Failed to save flags to localStorage")}}async function Bd(e,r){const t=await qt();t[e]=r,await Fd(t)}async function Hd(e){return(await qt())[e]}async function Gd(e){const r=await qt();e in r&&(delete r[e],await Fd(r))}async function qt(){try{const e=localStorage.getItem(Md);return e?JSON.parse(e):{}}catch{return{}}}function Wd(e){function r(n){return n.id?`#${n.id}`:n.classList.length>0?Array.from(n.classList).map(i=>`.${i}`).join(""):null}function t(n){const a=[];let i=n;for(;i&&i!==document.body&&i!==document.documentElement;){const o=r(i);if(o){a.unshift(o);break}if(i.parentElement){const s=Array.from(i.parentElement.children),u=s.indexOf(i)+1,c=i.tagName.toLowerCase();s.filter(f=>f.tagName.toLowerCase()===c).length>1?a.unshift(`${c}:nth-child(${u})`):a.unshift(c)}i=i.parentElement}return a.join(" > ")}return t(e)}function Vd(e){return e?Object.fromEntries(Object.entries(e).filter(([r,t])=>t!==void 0)):{}}function lg(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}let De={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"}},zd=[],Kd=!1,Ir;function Ko(){const e=window.location.pathname,r=new URLSearchParams(window.location.search),t=navigator.userAgent;return zd.find(n=>{if(n.path&&!e.includes(n.path)||n.queryParam&&r.get(n.queryParam.key)!==n.queryParam.value)return!1;if(n.headers){const a=n.headers.name.toLowerCase(),i=n.headers.contains.toLowerCase();if(a==="user-agent"){if(!t.toLowerCase().includes(i))return!1}else return!1}return!(n.userAgentContains&&!t.includes(n.userAgentContains))})}function fg(){return Ko()}function dg(e,r){zd=e.content||[];const t=Ko();t&&t.type==="article"&&(De={...De,...Vd(t.selectors)},Kd=t.enablePaywallSettingsUrlFallback||!1),Ir=r}function vg(e,r){const{selector:t,attribute:n}=r;return t===De.article.selector||n&&e.hasAttribute(n)?e:e.querySelector(t)}function Jd(e,r,t=!1){if(e){if(r.attribute){if(r.attribute==="textContent")return e.textContent??void 0;const n=e.getAttribute(r.attribute),a=Jd(e.parentElement,r,t);if(t){const i=[];return n&&i.push(...n.split(",").map(o=>o.trim()).filter(Boolean)),a&&i.push(...a.split(",").map(o=>o.trim()).filter(Boolean)),i.length>0?[...new Set(i)].join(","):void 0}return n??a}return e.textContent??void 0}}function ge(e){const r=document.head.querySelectorAll(`[property~='${e}'][content]`);for(let n=0;n<r.length;n+=1)if(r[n].content)return r[n].content;const t=document.head.querySelectorAll(`[name~='${e}'][content]`);for(let n=0;n<t.length;n+=1)if(t[n].content)return t[n].content}function $t(e){const r=[];return document.head.querySelectorAll(`[property~='${e}'][content]`).forEach(a=>{a.content&&r.push(a.content)}),document.head.querySelectorAll(`[name~='${e}'][content]`).forEach(a=>{a.content&&r.push(a.content)}),r}let Ut=null;function Yd(){const e=[],r=document.querySelectorAll('script[type="application/ld+json"]');for(const t of r)try{const n=JSON.parse(t.textContent||"");Array.isArray(n)?e.push(...n):n["@graph"]&&Array.isArray(n["@graph"])?e.push(...n["@graph"]):e.push(n)}catch{}return e}function Lt(e){const r=Yd(),t=n=>!e||n["@type"]===e||Array.isArray(n["@type"])&&n["@type"].includes(e);return r.find(t)||null}function hg(e){const r=Yd(),t=n=>!e||n["@type"]===e||Array.isArray(n["@type"])&&n["@type"].includes(e);return r.filter(t)}function Jo(e,r,t){if(!e||typeof e!="object")return typeof e=="string"?e:void 0;const a=e[r];if(typeof a=="string")return a;if(a&&typeof a=="object"&&t)return a[t]}function pg(e){if(!e)return;const t=(Array.isArray(e)?e:[e]).map(n=>{if(typeof n=="string")return{name:n};if(typeof n=="object"&&n!==null){const a=n,i=a.name;return i?{name:i,url:a.url,image:Jo(a,"image","url"),jobTitle:a.jobTitle,sameAs:a.sameAs}:null}return null}).filter(n=>n!==null&&!!n.name);return t.length>0?t:void 0}function Yo(e){if(Array.isArray(e))return e.filter(r=>typeof r=="string");if(typeof e=="string"){const r=e.split(",").map(t=>t.trim()).filter(Boolean);return r.length>0?r:void 0}}function Qd(){if(Ut)return Ut;const e=Lt("NewsArticle")||Lt("Article")||Lt("BlogPosting")||Lt("WebPage"),r=(...a)=>a.find(i=>i!=null&&i!=="")||void 0,t=(...a)=>a.find(i=>i&&i.length>0),n={contentType:e?Array.isArray(e["@type"])?e["@type"][0]:e["@type"]:void 0,authors:pg(e?.author)||($t("article:author").length>0?$t("article:author").map(a=>({name:a})):void 0)||(ge("author")?[{name:ge("author")}]:void 0),keywords:t(Yo(e?.keywords),Yo(ge("keywords"))),tags:$t("article:tag").length>0?$t("article:tag"):void 0,categories:Yo(ge("news_keywords")),section:r(e?.articleSection,ge("article:section")),publishedAt:r(e?.datePublished,ge("article:published_time")),modifiedAt:r(e?.dateModified,ge("article:modified_time")),ogType:ge("og:type"),ogSiteName:ge("og:site_name"),ogLocale:ge("og:locale"),twitterCard:ge("twitter:card"),twitterSite:ge("twitter:site"),twitterCreator:ge("twitter:creator"),creator:r(ge("creator"),ge("dc.creator")),mainEntityOfPage:e?Jo(e.mainEntityOfPage,"@id")||(typeof e.mainEntityOfPage=="string"?e.mainEntityOfPage:void 0):void 0,isAccessibleForFree:typeof e?.isAccessibleForFree=="boolean"?e.isAccessibleForFree:void 0,wordCount:typeof e?.wordCount=="number"?e.wordCount:void 0,publisher:e?.publisher&&typeof e.publisher=="object"?{name:e.publisher.name||"",url:e.publisher.url,logo:Jo(e.publisher,"logo","url")}:void 0};return Ut=Vd(n),Ut}function mg(){Ut=null}function Qo({publisherContentId:e,key:r,defaultValue:t=""}){const n=e?document.body.querySelector(`sesamy-content-data[id='${e}']`):null,a=r.replace(/-([a-z])/g,(i,o)=>o.toUpperCase());return n?.getAttribute(r)||ge(`sesamy:${r}`)||ge(`sesamy:${a}`)||ge(`og:${r}`)||ge(r)||t}function Xd(){const e=document.querySelectorAll(De.article.selector);return Array.from(e).map(Nt).filter(r=>r!==null)}function Nt(e){const r=typeof e=="string"?document.querySelector(e):e;if(!r)return null;const t={element:r,selector:typeof e=="string"?e:Wd(r)},n=(i,o,s,u)=>{const{transform:c,collect:l=!1}=u||{},f=vg(r,o),v=Jd(f,o,l),d=Qo({publisherContentId:s,key:lg(String(i))}),h=v||d||void 0;h&&(t[i]=c?c(h):h)};n("id",De.id),n("title",De.title,t.id),n("excerpt",De.excerpt,t.id),n("image",De.image,t.id),n("price",De.price,t.id,{transform:i=>{const o=parseFloat(i);return Number.isNaN(o)?void 0:o}}),n("currency",De.currency,t.id),n("url",De.url,t.id),n("pass",De.pass,t.id,{collect:!0}),n("paywallUrl",De.paywallUrl,t.id),n("accessLevel",De.accessLevel,t.id,{transform:i=>i||"entitlement"});const a=Ko();if(a&&a.type==="article"&&(a.pass&&(t.pass=t.pass?`${t.pass},${a.pass}`:a.pass),a.price&&!t.price&&(t.price=a.price.amount),a.price?.currency&&!t.currency&&(t.currency=a.price.currency),a.paywallUrl&&!t.paywallUrl&&(t.paywallUrl=a.paywallUrl)),Kd&&!t.paywallUrl){const i=document.querySelector("sesamy-paywall");if(i){const o=i.getAttribute("settings-url");o&&(t.paywallUrl=o)}}return t.url||(t.url=window.location.href),t.metadata=Qd(),t}async function gg(e){const r=Nt(e);if(!r)throw new Error("Could not find article element");if(r.accessLevel==="public")return!0;if(r.accessLevel==="logged-in"&&!r.paywallUrl)return await Ir.auth.isAuthenticated()?!0:null;if(r.paywallUrl&&((await Ir.paywalls.get(r.paywallUrl)).settings.template==="LOGIN"?"logged-in":"entitlement")==="logged-in")return await Ir.auth.isAuthenticated()?!0:null;if(!r.url)throw new Error("Article must have a URL");return await Ir.entitlements.hasAccess(r.url,r.pass?.split(",")||[])||null}async function Zd(e,r){const t=typeof e=="string"?document.querySelector(e):e;if(!t)throw new Error("Could not find element");const n=Nt(t);if(!n?.url)throw new Error("Could not find content for element");const a=await Ir.entitlements.hasAccess(n.url,n.pass?.split(",")||[]);if(!a)throw new Error("User does not have access to the content");let i;if(!a.id&&a.token)i=a.token;else{const s=await Ir.entitlements.access(a.id);if(!s.token)throw new Error("Could not get access token");i=s.token}const o=r||Wd(t.parentElement||t);return Ir.proxy.getContent(i,n.url,o)}function ev(e,r={}){const{closeOnBackdropClick:t=!0,closeOnEscape:n=!0,zIndex:a=2147483647,backdropBlur:i="5px",overlayBackground:o="rgba(0,0,0,0.5)"}=r,s=document.createElement("div");s.setAttribute("data-sesamy-modal","true"),Object.assign(s.style,{position:"fixed",top:"0",left:"0",width:"100vw",height:"100vh",background:o,zIndex:String(a),display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:`blur(${i})`});const u=document.createElement("div");u.setAttribute("data-sesamy-modal-content","true"),typeof e=="string"?u.innerHTML=e:u.appendChild(e),s.appendChild(u);const c=()=>{s.remove(),n&&document.removeEventListener("keydown",l)},l=f=>{f.key==="Escape"&&c()};return t&&s.addEventListener("click",f=>{f.target===s&&c()}),n&&document.addEventListener("keydown",l),document.body.appendChild(s),{element:s,close:c}}function yg(e,r={}){const{position:t="top",fixed:n=!0,zIndex:a=2147483647,autoDismissMs:i,pushContent:o=!1,height:s,transitionDuration:u="0.3s"}=r,c=document.createElement("div");c.setAttribute("data-sesamy-notification-bar","true"),c.setAttribute("data-sesamy-notification-position",t),Object.assign(c.style,{position:n?"fixed":"absolute",[t]:"0",left:"0",width:"100%",zIndex:String(a),boxSizing:"border-box",...s&&{height:s}}),typeof e=="string"?c.innerHTML=e:c.appendChild(e);let l,f,v;const d=()=>{if(v&&clearTimeout(v),o&&s){const h=document.documentElement;h.style.transform=l||"",setTimeout(()=>{c.remove(),h.style.transition=f||""},parseFloat(u)*1e3)}else c.remove()};if(i&&(v=setTimeout(d,i)),o&&s){const h=document.documentElement;l=h.style.transform,f=h.style.transition,h.style.transition=`transform ${u} ease`,c.style.transition=`transform ${u} ease`,t==="top"?(h.style.transform=`translateY(${s})`,c.style.transform=`translateY(-${s})`):(h.style.transform=`translateY(-${s})`,c.style.transform=`translateY(${s})`),document.documentElement.prepend(c)}else document.body.appendChild(c);return{element:c,close:d}}function bg(e){const r=e.endpoint??or("api2",e.environment),n=eg({baseUrl:r,tokenProvider:async()=>{if(await dr())try{const U=await vr(!1);return U?`Bearer ${U}`:null}catch{}const m=localStorage.getItem("__anon_id");return`Basic ${btoa(`${e.vendorId||e.clientId}|${m}:`)}`},libraryName:zo,libraryVersion:kt,vendorId:e.vendorId,cache:{mode:sn.BROWSER,storage:new ag}}),a=m=>async(C,U)=>{let F=sessionStorage.getItem(qd);F||(F=Date.now().toString(),sessionStorage.setItem(qd,F));const w={...U,headers:{...U.headers,"Cache-Timestamp":F}};return m(C,w)},i=(m=!0)=>C=>async(U,F)=>{const w=await vr(m);if(!w){if(await dr()){const N={...F,credentials:"include"};return C(U,N)}if(m)throw new Error("No access token available");return C(U,F)}const T={...F,headers:{...F.headers,Authorization:`Bearer ${w}`}};return C(U,T)},o=ir(r).headers({"Content-Type":"application/json"}).middlewares([a,i(),Sm(),Em({delayTimer:1e3,delayRamp:(m,C)=>m*C,maxAttempts:3,until:m=>!!(m&&(m.ok||m.status>=400&&m.status<500)),retryOnNetworkError:!1})]);async function s(m={}){const{waitForEntitlementAfter:C,includeSignedLinks:U=!0}=m,F=await dr()?await n.entitlements.list({waitForEntitlementAfter:C?.toISOString()}):[];return U&&F.push(...Wo()),F}async function u(m,C=[]){return(await s())?.find(w=>{if(m){const{sku:T,purchaseOption:N}=Ud(m);if("sku"in w&&T===w.sku||N&&"purchaseOptionsId"in w&&N===w.purchaseOptionsId||Nd(m,w.url))return!0}return!!C.some(T=>Nd(T,w.url))})}async function c(m,C,U){const F=new URL(r,window.location.origin);return F.pathname=F.pathname.replace(/\/$/,"")+"/proxy",F.searchParams.set("url",C),U&&F.searchParams.set("selector",U),ir(F.toString()).headers({Authorization:`Bearer ${m}`}).get().text()}async function l(m){if(!m)throw new Error("SKU is required to get fulfillments");return await dr()?await o.get(`/fulfillments?sku=${encodeURIComponent(m)}`).json():[]}async function f(m,C){if(!m||!C)throw new Error("SKU and itemId are required to request delivery");return(await o.post({sku:m},`/fulfillments/${encodeURIComponent(C)}/request-delivery?`).res()).ok}async function v(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),o.get("/subscriptions").json()}async function d(m){return(await n.transactions.list())?.find(U=>U.id===m)}async function h(){return await o.url("/tags").get().json()}async function p(m){const C=await o.url(`/tags/${encodeURIComponent(m)}`).delete().res();return hr(),C.ok}async function S(m){const C=await o.url("/tags").post(encodeURIComponent(m)).res();return $r(er.USER_ATTRIBUTE_CHANGED,{}),hr(),C.ok}async function R(m){return(await n.tallies.get(m)).value}async function I(){const m=await n.tallies.list(),C={};for(const U of m)C[U.id]=U.value;return C}async function g(m){return await n.tallies.delete(m)}async function b(m,C){return await n.tallies.push(m,C)}async function y(){return await vr(!1)?await o.url("/profile").get().json():null}async function A(m){const C=await o.url("/profile").patch(m).res();return hr(),C.ok}async function q(){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 G(m){const C=await vr(!1);if(!C)throw new Error("No access token available");const U=new URL(`${or("access-sync",e.environment)}/spotify/sesamy-callback`);U.searchParams.set("access_token",C),U.searchParams.set("state",m),window.location.href=U.toString()}async function K(m){const C=await o.url(`/products/${encodeURIComponent(m)}/auto-onboard`).post().json();return C.length&&hr(),C}async function re(m,C=3600){const{shortlink:U}=await ir(ng).post({url:m,ttl:C}).json();return U}async function L(m){const C=await vr(!1,!0);let U;const F=m.language||un(),w=cn();switch(m.target){case"account":U=new URL(`${or("account",e.environment)}/${encodeURIComponent(m.language||F)}/subscriptions/${encodeURIComponent(e.vendorId||e.clientId)}${m.contractId?`/${encodeURIComponent(m.contractId)}`:""}`),U.searchParams.set("sesamy-redirect-url",m.redirectUrl||window.location.href);break;case"change-payment":U=new URL(`${or("account",e.environment)}/${encodeURIComponent(m.language||F)}/subscriptions/${encodeURIComponent(e.vendorId||e.clientId)}/${encodeURIComponent(m.contractId)}/change-payment-method`),U.searchParams.set("sesamy-redirect-url",m.redirectUrl||window.location.href);break;case"change-plan":U=new URL(`${or("account",e.environment)}/${encodeURIComponent(m.language||F)}/subscriptions/${encodeURIComponent(e.vendorId||e.clientId)}/${encodeURIComponent(m.contractId)}/edit-plan`),U.searchParams.set("sesamy-redirect-url",m.redirectUrl||window.location.href);break;case"consume":U=new URL(`${or("consume",e.environment)}/${encodeURIComponent(m.language||F)}/@${encodeURIComponent(e.vendorId||e.clientId)}/${encodeURIComponent(m.sku)}`),m.episodeId?U.href+=`/${m.episodeId}`:U.href+="/listen",U.searchParams.set("sesamy-redirect-url",m.redirectUrl||window.location.href);break;case"checkout":U=og(e,{language:F,...m},w);break;default:throw new Error("Invalid target")}return C&&(U.hash=`#access_token=${C}`),m.shorten?re(U.href,m.ttl):U.href}async function M(){const m=await vr(!1),C=new URL(`${or("account",e.environment)}/subscriptions/${e.vendorId||e.clientId}`);m&&(C.hash=`#access_token=${m}`),window.location.href=C.toString()}async function x(m){const C=cn(),U=["_ga","_gid","_fbp","_fbc"];return document.cookie.split(";").forEach(F=>{const[w,T]=F.trim().split("=");U.includes(w)&&!C[w]&&(C[w]=T)}),n.checkouts.create({language:un(),...m,attribution:{...C,...m.attribution}})}return{autoOnboardProduct:K,bills:n.bills,checkouts:{create:x,get:n.checkouts.get,update:n.checkouts.update},content:{list:Xd,get:Nt,getLanguage:un,unlock:Zd,getPropertyFromHTML:Qo},contracts:n.contracts,deleteTag:p,deleteTally:g,entitlements:n.entitlements,flags:{get:Hd,set:Bd,list:qt,delete:Gd},generateLink:L,getProxyContent:c,getEntitlements:s,getFulfillments:l,requestDelivery:f,hasAccess:u,isSpotifyLinked:q,linkSpotify:G,openHostedAccountPage:M,paywalls:n.paywalls,paymentIssues:n.paymentIssues,getProfile:y,products:n.products,getSubscriptions:v,getTally:R,getTallies:I,getTags:h,getTransaction:d,transactions:n.transactions,userMetadata:n.userMetadata,pushTally:b,setTag:S,unlinkSpotify:j,updateProfile:A,vendor:n.vendor}}function rv(e,r,t,n,a){for(r=r.split?r.split("."):r,n=0;n<r.length;n++)e=e?e[r[n]]:a;return e===a?t:e}var wg="function",Sg="string",rr="undefined",Ig="boolean",ln="object",Pg="array",Eg="number",Rg="symbol",Tg="null",Xo=function(){},tv="any",nv="*",Lr="__",Og="form",Cg="input",_g="button",Ag="select",fn=typeof process!==rr?process:{};fn.env&&fn.env.NODE_ENV;var Ce=typeof document!==rr;fn.versions!=null&&fn.versions.node!=null,typeof Deno!==rr&&Deno.core,Ce&&window.name==="nodejs"||typeof navigator!==rr&&typeof navigator.userAgent!==rr&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function av(e,r){return r.charAt(0)[e]()+r.slice(1)}var kg=av.bind(null,"toUpperCase"),qg=av.bind(null,"toLowerCase");function $g(e){return iv(e)?kg(Tg):typeof e===ln?xg(e):Object.prototype.toString.call(e).slice(8,-1)}function dn(e,r){r===void 0&&(r=!0);var t=$g(e);return r?qg(t):t}function xt(e,r){return typeof r===e}var Me=xt.bind(null,wg),Pr=xt.bind(null,Sg),nt=xt.bind(null,rr),Ug=xt.bind(null,Ig);xt.bind(null,Rg);function iv(e){return e===null}function Lg(e){return dn(e)===Eg&&!isNaN(e)}function ov(e){return dn(e)===Pg}function Fe(e){if(!Ng(e))return!1;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function Ng(e){return e&&(typeof e===ln||e!==null)}function xg(e){return Me(e.constructor)?e.constructor.name:null}function jg(e){return e instanceof Error||Pr(e.message)&&e.constructor&&Lg(e.constructor.stackTraceLimit)}function sv(e,r){if(typeof r!="object"||iv(r))return!1;if(r instanceof e)return!0;var t=dn(new e(""));if(jg(r))for(;r;){if(dn(r)===t)return!0;r=Object.getPrototypeOf(r)}return!1}sv.bind(null,TypeError),sv.bind(null,SyntaxError);function vn(e,r){var t=e instanceof Element||e instanceof HTMLDocument;return t&&r?Dg(e,r):t}function Dg(e,r){return r===void 0&&(r=""),e&&e.nodeName===r.toUpperCase()}function hn(e){var r=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(r))}}hn(vn,Og),hn(vn,_g),hn(vn,Cg),hn(vn,Ag);function Mg(e){return e?ov(e)?e:[e]:[]}function uv(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function Fg(){if(Ce){var e=navigator,r=e.languages;return e.userLanguage||(r&&r.length?r[0]:e.language)}}function Bg(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function Hg(e){return(function(r){for(var t,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;t=a.exec(r);){var i=uv(t[1]),o=uv(t[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 c=u.split("[");c.length>1&&(Gg(n,c.map(function(l){return l.replace(/[?[\]\\ ]/g,"")}),n[u]),delete n[u])}return n})((function(r){return Ce&&window.location.search.substring(1)})())}function Gg(e,r,t){for(var n=r.length-1,a=0;a<n;++a){var i=r[a];if(i==="__proto__"||i==="constructor")break;i in e||(e[i]={}),e=e[i]}e[r[n]]=t}function pn(){for(var e="",r=0,t=4294967295*Math.random()|0;r++<36;){var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[r-1],a=15&t;e+=n=="-"||n=="4"?n:(n=="x"?a:3&a|8).toString(16),t=r%8==0?4294967295*Math.random()|0:t>>4}return e}function Wg(e,r){var t,n,a,i=null,o=0,s=function(){o=new Date,i=null,a=e.apply(t,n)};return function(){var u=new Date;o||(o=u);var c=r-(u-o);return t=this,n=arguments,c<=0?(clearTimeout(i),i=null,o=u,a=e.apply(t,n)):i||(i=setTimeout(s,c)),a}}var Nr="global",at=Lr+Nr+Lr,it=typeof self===ln&&self.self===self&&self||typeof global===ln&&global[Nr]===global&&global||void 0;function xr(e){return it[at][e]}function jr(e,r){return it[at][e]=r}function ot(e){delete it[at][e]}function st(e,r,t){var n;try{if(Zo(e)){var a=window[e];n=a[r].bind(a)}}catch{}return n||t}it[at]||(it[at]={});var mn={};function Zo(e){if(typeof mn[e]!==rr)return mn[e];try{var r=window[e];r.setItem(rr,rr),r.removeItem(rr)}catch{return mn[e]=!1}return mn[e]=!0}function Z(){return Z=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},Z.apply(null,arguments)}var Er="function",pr="undefined",jt="reducer",cv="@@redux/",es=cv+"INIT",Vg=cv+Math.random().toString(36),lv=(function(){return typeof Symbol===Er&&Symbol.observable||"@@observable"})(),gn=" != "+Er;function fv(e,r,t){var n;if(typeof r===Er&&typeof t===pr&&(t=r,r=void 0),typeof t!==pr){if(typeof t!==Er)throw new Error("enhancer"+gn);return t(fv)(e,r)}if(typeof e!==Er)throw new Error(jt+gn);var a=e,i=r,o=[],s=o,u=!1;function c(){s===o&&(s=o.slice())}function l(){return i}function f(d){if(typeof d!==Er)throw new Error("Listener"+gn);var h=!0;return c(),s.push(d),function(){if(h){h=!1,c();var p=s.indexOf(d);s.splice(p,1)}}}function v(d){if(!Fe(d))throw new Error("Act != obj");if(typeof d.type===pr)throw new Error("ActType "+pr);if(u)throw new Error("Dispatch in "+jt);try{u=!0,i=a(i,d)}finally{u=!1}for(var h=o=s,p=0;p<h.length;p++)(0,h[p])();return d}return v({type:es}),(n={dispatch:v,subscribe:f,getState:l,replaceReducer:function(d){if(typeof d!==Er)throw new Error("next "+jt+gn);a=d,v({type:es})}})[lv]=function(){var d,h=f;return(d={subscribe:function(p){if(typeof p!="object")throw new TypeError("Observer != obj");function S(){p.next&&p.next(l())}return S(),{unsubscribe:h(S)}}})[lv]=function(){return this},d},n}function zg(e,r){var t=r&&r.type;return"action "+(t&&t.toString()||"?")+jt+" "+e+" returns "+pr}function ut(){var e=[].slice.call(arguments);return e.length===0?function(r){return r}:e.length===1?e[0]:e.reduce(function(r,t){return function(){return r(t.apply(void 0,[].slice.call(arguments)))}})}function Kg(){var e=arguments;return function(r){return function(t,n,a){var i,o=r(t,n,a),s=o.dispatch,u={getState:o.getState,dispatch:function(c){return s(c)}};return i=[].slice.call(e).map(function(c){return c(u)}),Z({},o,{dispatch:s=ut.apply(void 0,i)(o.dispatch)})}}}var Rr=Lr+"anon_id",Dr=Lr+"user_id",ct=Lr+"user_traits",rs="analytics",Tr="userId",lt="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"],ts=["name","EVENTS","config","loaded"],ee=yn.reduce(function(e,r){return e[r]=r,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),dv=/^utm_/,vv=/^an_prop_/,hv=/^an_trait_/;function Jg(e){var r=e.storage.setItem;return function(t){return function(n){return function(a){if(a.type===ee.bootstrap){var i=a.params,o=a.user,s=a.persistedUser,u=a.initialUser,c=s.userId===o.userId;s.anonymousId!==o.anonymousId&&r(Rr,o.anonymousId),c||r(Dr,o.userId),u.traits&&r(ct,Z({},c&&s.traits?s.traits:{},u.traits));var l=Object.keys(a.params);if(l.length){var f=i.an_uid,v=i.an_event,d=l.reduce(function(h,p){if(p.match(dv)||p.match(/^(d|g)clid/)){var S=p.replace(dv,"");h.campaign[S==="campaign"?"name":S]=i[p]}return p.match(vv)&&(h.props[p.replace(vv,"")]=i[p]),p.match(hv)&&(h.traits[p.replace(hv,"")]=i[p]),h},{campaign:{},props:{},traits:{}});t.dispatch(Z({type:ee.params,raw:i},d,f?{userId:f}:{})),f&&setTimeout(function(){return e.identify(f,d.traits)},0),v&&setTimeout(function(){return e.track(v,d.props)},0),Object.keys(d.campaign).length&&t.dispatch({type:ee.campaign,campaign:d.campaign})}}return n(a)}}}}function Yg(e){return function(r,t){if(r===void 0&&(r={}),t===void 0&&(t={}),t.type===ee.setItemEnd){if(t.key===Rr)return Z({},r,{anonymousId:t.value});if(t.key===Dr)return Z({},r,{userId:t.value})}switch(t.type){case ee.identify:return Object.assign({},r,{userId:t.userId,traits:Z({},r.traits,t.traits)});case ee.reset:return[Dr,Rr,ct].forEach(function(n){e.removeItem(n)}),Object.assign({},r,{userId:null,anonymousId:null,traits:{}});default:return r}}}function pv(e){return{userId:e.getItem(Dr),anonymousId:e.getItem(Rr),traits:e.getItem(ct)}}var ns=function(e){return Lr+"TEMP"+Lr+e};function Qg(e){var r=e.storage,t=r.setItem,n=r.removeItem,a=r.getItem;return function(i){return function(o){return function(s){var u=s.userId,c=s.traits,l=s.options;if(s.type===ee.reset&&([Dr,ct,Rr].forEach(function(d){n(d)}),[Tr,lt,"traits"].forEach(function(d){ot(ns(d))})),s.type===ee.identify){a(Rr)||t(Rr,pn());var f=a(Dr),v=a(ct)||{};f&&f!==u&&i.dispatch({type:ee.userIdChanged,old:{userId:f,traits:v},new:{userId:u,traits:c},options:l}),u&&t(Dr,u),c&&t(ct,Z({},v,c))}return o(s)}}}}var Dt={};function mv(e,r){Dt[e]&&Me(Dt[e])&&(Dt[e](r),delete Dt[e])}function gv(e,r,t){return new Promise(function(n,a){return r()?n(e):t<1?a(Z({},e,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return gv(e,r,t-10).then(n,a)})})}function Xg(e){return{abort:e}}function yv(e,r,t){var n={},a=r(),i=e.getState(),o=i.plugins,s=i.queue,u=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var c=s.actions.reduce(function(f,v,d){return o[v.plugin].loaded?(f.process.push(v),f.processIndex.push(d)):(f.requeue.push(v),f.requeueIndex.push(d)),f},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(c.processIndex&&c.processIndex.length){c.processIndex.forEach(function(f){var v=s.actions[f],d=v.plugin,h=v.payload.type,p=a[d][h];if(p&&Me(p)){var S,R=(function(b,y){return b===void 0&&(b={}),y===void 0&&(y={}),[Tr,lt].reduce(function(A,q){return b.hasOwnProperty(q)&&y[q]&&y[q]!==b[q]&&(A[q]=y[q]),A},b)})(v.payload,u),I=n[R.meta.rid];if(!I&&(S=p({payload:R,config:o[d].config,instance:t,abort:Xg}))&&Fe(S)&&S.abort)return void(n[R.meta.rid]=!0);if(!I){var g=h+":"+d;e.dispatch(Z({},R,{type:g,_:{called:g,from:"queueDrain"}}))}}});var l=s.actions.filter(function(f,v){return!~c.processIndex.indexOf(v)});s.actions=l}}}var as=function(e){var r=e.data,t=e.action,n=e.instance,a=e.state,i=e.allPlugins,o=e.allMatches,s=e.store,u=e.EVENTS;try{var c=a.plugins,l=a.context,f=t.type,v=f.match(ft),d=r.exact.map(function(S){return S.pluginName});v&&(d=o.during.map(function(S){return S.pluginName}));var h=(function(S,R){return function(I,g,b){var y=g.config,A=g.name,q=A+"."+I.type;b&&(q=b.event);var j=I.type.match(ft)?(function(G,K,re,L,M){return function(x,m){var C=L?L.name:G,U=m&&Mt(m)?m:re;if(L&&(!(U=m&&Mt(m)?m:[G]).includes(G)||U.length!==1))throw new Error("Method "+K+" can only abort "+G+" plugin. "+JSON.stringify(U)+" input valid");return Z({},M,{abort:{reason:x,plugins:U,caller:K,_:C}})}})(A,q,R,b,I):(function(G,K){return function(){throw new Error(G.type+" action not cancellable. Remove abort in "+K)}})(I,q);return{payload:Zg(I),instance:S,config:y||{},abort:j}}})(n,d),p=r.exact.reduce(function(S,R){var I=R.pluginName,g=R.methodName,b=!1;return g.match(/^initialize/)||g.match(/^reset/)||(b=!c[I].loaded),l.offline&&g.match(/^(page|track|identify)/)&&(b=!0),S[""+I]=b,S},{});return Promise.resolve(r.exact.reduce(function(S,R,I){var g=R.pluginName;return Promise.resolve(S).then(function(b){function y(){return Promise.resolve(b)}var A=(function(){if(r.namespaced&&r.namespaced[g])return Promise.resolve(r.namespaced[g].reduce(function(q,j,G){return Promise.resolve(q).then(function(K){return j.method&&Me(j.method)?((function(x,m){var C=Tv(x);if(C&&C.name===m){var U=Tv(C.method);throw new Error([m+" plugin is calling method "+x,"Plugins cant call self","Use "+C.method+" "+(U?"or "+U.method:"")+" in "+m+" plugin insteadof "+x].join(`
3
- `))}})(j.methodName,j.pluginName),Promise.resolve(j.method({payload:K,instance:n,abort:(re=K,L=g,M=j.pluginName,function(x,m){return Z({},re,{abort:{reason:x,plugins:m||[L],caller:f,from:M||L}})}),config:Sv(j.pluginName,c,i),plugins:c})).then(function(x){var m=Fe(x)?x:{};return Promise.resolve(Z({},K,m))})):K;var re,L,M})},Promise.resolve(t))).then(function(q){b[g]=q});b[g]=t})();return A&&A.then?A.then(y):y()})},Promise.resolve({}))).then(function(S){return Promise.resolve(r.exact.reduce(function(R,I,g){try{var b=r.exact.length===g+1,y=I.pluginName,A=i[y];return Promise.resolve(R).then(function(q){var j=S[y]?S[y]:{};if(v&&(j=q),os(j,y))return is({data:j,method:f,instance:n,pluginName:y,store:s}),Promise.resolve(q);if(os(q,y))return b&&is({data:q,method:f,instance:n,store:s}),Promise.resolve(q);if(p.hasOwnProperty(y)&&p[y]===!0)return s.dispatch({type:"queue",plugin:y,payload:j,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(q);var G=h(S[y],i[y]);return Promise.resolve(A[f]({abort:G.abort,payload:j,instance:n,config:Sv(y,c,i),plugins:c})).then(function(K){var re=Fe(K)?K:{},L=Z({},q,re),M=S[y];if(os(M,y))is({data:M,method:f,instance:n,pluginName:y,store:s});else{var x=f+":"+y;(x.match(/:/g)||[]).length<2&&!f.match(bv)&&!f.match(wv)&&n.dispatch(Z({},v?L:j,{type:x,_:{called:x,from:"submethod"}}))}return Promise.resolve(L)})})}catch(q){return Promise.reject(q)}},Promise.resolve(t))).then(function(R){if(!(f.match(ft)||f.match(/^registerPlugin/)||f.match(wv)||f.match(bv)||f.match(/^params/)||f.match(/^userIdChanged/))){if(u.plugins.includes(f),R._&&R._.originalAction===f)return R;var I=Z({},R,{_:{originalAction:R.type,called:R.type,from:"engineEnd"}});Ev(R,r.exact.length)&&!f.match(/End$/)&&(I=Z({},I,{type:R.type+"Aborted"})),s.dispatch(I)}return R})})}catch(S){return Promise.reject(S)}},ft=/Start$/,bv=/^bootstrap/,wv=/^ready/;function is(e){var r=e.pluginName,t=e.method+"Aborted"+(r?":"+r:"");e.store.dispatch(Z({},e.data,{type:t,_:{called:t,from:"abort"}}))}function Sv(e,r,t){var n=r[e]||t[e];return n&&n.config?n.config:{}}function Iv(e,r){return r.reduce(function(t,n){return n[e]?t.concat({methodName:e,pluginName:n.name,method:n[e]}):t},[])}function Pv(e,r){var t=e.replace(ft,""),n=r?":"+r:"";return[""+e+n,""+t+n,t+"End"+n]}function os(e,r){var t=e.abort;return!!t&&(t===!0||Rv(t,r)||t&&Rv(t.plugins,r))}function Ev(e,r){var t=e.abort;if(!t)return!1;if(t===!0||Pr(t))return!0;var n=t.plugins;return Mt(t)&&t.length===r||Mt(n)&&n.length===r}function Mt(e){return Array.isArray(e)}function Rv(e,r){return!(!e||!Mt(e))&&e.includes(r)}function Tv(e){var r=e.match(/(.*):(.*)/);return!!r&&{method:r[1],name:r[2]}}function Zg(e){return Object.keys(e).reduce(function(r,t){return t==="type"||(r[t]=Fe(e[t])?Object.assign({},e[t]):e[t]),r},{})}function ey(e,r,t){var n={};return function(a){return function(i){return function(o){try{var s,u=function(b){return s?b:i(f)},c=o.type,l=o.plugins,f=o;if(o.abort)return Promise.resolve(i(o));if(c===ee.enablePlugin&&a.dispatch({type:ee.initializeStart,plugins:l,disabled:[],fromEnable:!0,meta:o.meta}),c===ee.disablePlugin&&setTimeout(function(){return mv(o.meta.rid,{payload:o})},0),c===ee.initializeEnd){var v=r(),d=Object.keys(v),h=d.filter(function(b){return l.includes(b)}).map(function(b){return v[b]}),p=[],S=[],R=o.disabled,I=h.map(function(b){var y=b.loaded,A=b.name,q=b.config;return gv(b,function(){return y({config:q})},1e4).then(function(j){return n[A]||(a.dispatch({type:ee.pluginReadyType(A),name:A,events:Object.keys(b).filter(function(G){return!ts.includes(G)})}),n[A]=!0),p=p.concat(A),b}).catch(function(j){if(j instanceof Error)throw new Error(j);return S=S.concat(j.name),j})});Promise.all(I).then(function(b){var y={plugins:p,failed:S,disabled:R};setTimeout(function(){d.length===I.length+R.length&&a.dispatch(Z({},{type:ee.ready},y))},0)})}var g=(function(){if(c!==ee.bootstrap)return/^ready:([^:]*)$/.test(c)&&setTimeout(function(){return yv(a,r,e)},0),Promise.resolve((function(b,y,A,q,j){try{var G=Me(y)?y():y,K=b.type,re=K.replace(ft,"");if(b._&&b._.called)return Promise.resolve(b);var L=A.getState(),M=(C=G,(U=L.plugins)===void 0&&(U={}),(F=b.options)===void 0&&(F={}),Object.keys(C).filter(function(w){var T=F.plugins||{};return Ug(T[w])?T[w]:T.all!==!1&&(!U[w]||U[w].enabled!==!1)}).map(function(w){return C[w]}));K===ee.initializeStart&&b.fromEnable&&(M=Object.keys(L.plugins).filter(function(w){var T=L.plugins[w];return b.plugins.includes(w)&&!T.initialized}).map(function(w){return G[w]}));var x=M.map(function(w){return w.name}),m=(function(w,T){var N=Pv(w).map(function(H){return Iv(H,T)});return T.reduce(function(H,Q){var J=Q.name,le=Pv(w,J).map(function(_e){return Iv(_e,T)}),ne=le[0],ue=le[1],ae=le[2];return ne.length&&(H.beforeNS[J]=ne),ue.length&&(H.duringNS[J]=ue),ae.length&&(H.afterNS[J]=ae),H},{before:N[0],beforeNS:{},during:N[1],duringNS:{},after:N[2],afterNS:{}})})(K,M);return Promise.resolve(as({action:b,data:{exact:m.before,namespaced:m.beforeNS},state:L,allPlugins:G,allMatches:m,instance:A,store:q,EVENTS:j})).then(function(w){function T(){var Q=(function(){if(K.match(ft))return Promise.resolve(as({action:Z({},N,{type:re+"End"}),data:{exact:m.after,namespaced:m.afterNS},state:L,allPlugins:G,allMatches:m,instance:A,store:q,EVENTS:j})).then(function(J){J.meta&&J.meta.hasCallback&&mv(J.meta.rid,{payload:J})})})();return Q&&Q.then?Q.then(function(){return w}):w}if(Ev(w,x.length))return w;var N,H=(function(){if(K!==re)return Promise.resolve(as({action:Z({},w,{type:re}),data:{exact:m.during,namespaced:m.duringNS},state:L,allPlugins:G,allMatches:m,instance:A,store:q,EVENTS:j})).then(function(Q){N=Q});N=w})();return H&&H.then?H.then(T):T()})}catch(w){return Promise.reject(w)}var C,U,F})(o,r,e,a,t)).then(function(b){var y=i(b);return s=1,y})})();return Promise.resolve(g&&g.then?g.then(u):u(g))}catch(b){return Promise.reject(b)}}}}}function ry(e){return function(r){return function(t){return function(n){var a=n.type,i=n.key,o=n.value,s=n.options;if(a===ee.setItem||a===ee.removeItem){if(n.abort)return t(n);a===ee.setItem?e.setItem(i,o,s):e.removeItem(i,s)}return t(n)}}}}var ty=function(){var e=this;this.before=[],this.after=[],this.addMiddleware=function(r,t){e[t]=e[t].concat(r)},this.removeMiddleware=function(r,t){var n=e[t].findIndex(function(a){return a===r});n!==-1&&(e[t]=[].concat(e[t].slice(0,n),e[t].slice(n+1)))},this.dynamicMiddlewares=function(r){return function(t){return function(n){return function(a){var i={getState:t.getState,dispatch:function(s){return t.dispatch(s)}},o=e[r].map(function(s){return s(i)});return ut.apply(void 0,o)(n)(a)}}}}};function ny(e){return function(r,t){r===void 0&&(r={});var n={};if(t.type==="initialize:aborted")return r;if(/^registerPlugin:([^:]*)$/.test(t.type)){var a=Ov(t.type,"registerPlugin"),i=e()[a];if(!i||!a)return r;var o=t.enabled,s=i.config;return n[a]={enabled:o,initialized:!!o&&!i.initialize,loaded:!!o&&!!i.loaded({config:s}),config:s},Z({},r,n)}if(/^initialize:([^:]*)$/.test(t.type)){var u=Ov(t.type,ee.initialize),c=e()[u];return c&&u?(n[u]=Z({},r[u],{initialized:!0,loaded:!!c.loaded({config:c.config})}),Z({},r,n)):r}if(/^ready:([^:]*)$/.test(t.type))return n[t.name]=Z({},r[t.name],{loaded:!0}),Z({},r,n);switch(t.type){case ee.disablePlugin:return Z({},r,Cv(t.plugins,!1,r));case ee.enablePlugin:return Z({},r,Cv(t.plugins,!0,r));default:return r}}}function Ov(e,r){return e.substring(r.length+1,e.length)}function Cv(e,r,t){return e.reduce(function(n,a){return n[a]=Z({},t[a],{enabled:r}),n},t)}function _v(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var ay={last:{},history:[]};function iy(e,r){e===void 0&&(e=ay);var t=r.options,n=r.meta;if(r.type===ee.track){var a=_v(Z({event:r.event,properties:r.properties},Object.keys(t).length&&{options:t},{meta:n}));return Z({},e,{last:a,history:e.history.concat(a)})}return e}var oy={actions:[]};function sy(e,r){e===void 0&&(e=oy);var t=r.payload;switch(r.type){case"queue":var n;return n=t&&t.type&&t.type===ee.identify?[r].concat(e.actions):e.actions.concat(r),Z({},e,{actions:n});case"dequeue":return[];default:return e}}var Av=/#.*$/;function uy(e){var r=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(r&&r[3]?r[3].split("?")[0].replace(Av,""):"")}var kv,qv,$v,Uv,cy=function(e){if(e===void 0&&(e={}),!Ce)return e;var r=document,t=r.title,n=r.referrer,a=window,i=a.location,o=a.innerWidth,s=a.innerHeight,u=i.hash,c=i.search,l=(function(v){var d=(function(){if(Ce){for(var h,p=document.getElementsByTagName("link"),S=0;h=p[S];S++)if(h.getAttribute("rel")==="canonical")return h.getAttribute("href")}})();return d?d.match(/\?/)?d:d+v:window.location.href.replace(Av,"")})(c),f={title:t,url:l,path:uy(l),hash:u,search:c,width:o,height:s};return n&&n!==""&&(f.referrer=n),Z({},f,e)},ly={last:{},history:[]};function fy(e,r){e===void 0&&(e=ly);var t=r.options;if(r.type===ee.page){var n=_v(Z({properties:r.properties,meta:r.meta},Object.keys(t).length&&{options:t}));return Z({},e,{last:n,history:e.history.concat(n)})}return e}kv=(function(){if(!Ce)return!1;var e=navigator.appVersion;return~e.indexOf("Win")?"Windows":~e.indexOf("Mac")?"MacOS":~e.indexOf("X11")?"UNIX":~e.indexOf("Linux")?"Linux":"Unknown OS"})(),qv=Ce?document.referrer:null,$v=Fg(),Uv=Bg();var Lv={initialized:!1,sessionId:pn(),app:null,version:null,debug:!1,offline:!!Ce&&!navigator.onLine,os:{name:kv},userAgent:Ce?navigator.userAgent:"node",library:{name:rs,version:"0.13.1"},timezone:Uv,locale:$v,campaign:{},referrer:qv};function dy(e,r){e===void 0&&(e=Lv);var t=e.initialized,n=r.campaign;switch(r.type){case ee.campaign:return Z({},e,{campaign:n});case ee.offline:return Z({},e,{offline:!0});case ee.online:return Z({},e,{offline:!1});default:return t?e:Z({},Lv,e,{initialized:!0})}}var vy=["plugins","reducers","storage"];function hy(e,r,t){if(Ce){var n=window[(t?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,r)})}}function py(e){var r=hy.bind(null,"online offline",function(t){return Promise.resolve(!navigator.onLine).then(e)});return r(!0),function(t){return r(!1)}}function Nv(){return jr(rs,[]),function(e){return function(r,t,n){var a=e(r,t,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return it[at][rs].push(o.action||o),i(o)}})}}}function xv(e){return function(){return ut(ut.apply(null,arguments),Nv())}}function ss(e){return e?ov(e)?e:[e]:[]}function jv(e,r,t){e===void 0&&(e={});var n,a,i=pn();return r&&(Dt[i]=(n=r,a=(function(o){for(var s,u=o||Array.prototype.slice.call(arguments),c=0;c<u.length;c++)if(Me(u[c])){s=u[c];break}return s})(t),function(o){a&&a(o),n(o)})),Z({},e,{rid:i,ts:new Date().getTime()},r?{hasCallback:!0}:{})}function my(e){e===void 0&&(e={});var r=e.reducers||{},t=e.initialUser||{},n=(e.plugins||[]).reduce(function(w,T){if(Me(T))return w.middlewares=w.middlewares.concat(T),w;if(T.NAMESPACE&&(T.name=T.NAMESPACE),!T.name)throw new Error("https://lytics.dev/errors/1");T.config||(T.config={});var N=T.EVENTS?Object.keys(T.EVENTS).map(function(J){return T.EVENTS[J]}):[];w.pluginEnabled[T.name]=!(T.enabled===!1||T.config.enabled===!1),delete T.enabled,T.methods&&(w.methods[T.name]=Object.keys(T.methods).reduce(function(J,le){var ne;return J[le]=(ne=T.methods[le],function(){for(var ue=Array.prototype.slice.call(arguments),ae=new Array(ne.length),_e=0;_e<ue.length;_e++)ae[_e]=ue[_e];return ae[ae.length]=y,ne.apply({instance:y},ae)}),J},{}),delete T.methods);var H=Object.keys(T).concat(N),Q=new Set(w.events.concat(H));if(w.events=Array.from(Q),w.pluginsArray=w.pluginsArray.concat(T),w.plugins[T.name])throw new Error(T.name+"AlreadyLoaded");return w.plugins[T.name]=T,w.plugins[T.name].loaded||(w.plugins[T.name].loaded=function(){return!0}),w},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=e.storage?e.storage:{getItem:xr,setItem:jr,removeItem:ot},i=(function(w){return function(T,N,H){return N.getState("user")[T]||(H&&Fe(H)&&H[T]?H[T]:pv(w)[T]||xr(ns(T))||null)}})(a),o=n.plugins,s=n.events.filter(function(w){return!ts.includes(w)}).sort(),u=new Set(s.concat(yn).filter(function(w){return!ts.includes(w)})),c=Array.from(u).sort(),l=function(){return o},f=new ty,v=f.addMiddleware,d=f.removeMiddleware,h=f.dynamicMiddlewares,p=function(){throw new Error("Abort disabled inListener")},S=Hg(),R=pv(a),I=Z({},R,t,S.an_uid?{userId:S.an_uid}:{},S.an_aid?{anonymousId:S.an_aid}:{});I.anonymousId||(I.anonymousId=pn());var g=Z({enable:function(w,T){return new Promise(function(N){m.dispatch({type:ee.enablePlugin,plugins:ss(w),_:{originalAction:ee.enablePlugin}},N,[T])})},disable:function(w,T){return new Promise(function(N){m.dispatch({type:ee.disablePlugin,plugins:ss(w),_:{originalAction:ee.disablePlugin}},N,[T])})}},n.methods),b=!1,y={identify:function(w,T,N,H){try{var Q=Pr(w)?w:null,J=Fe(w)?w:T,le=N||{},ne=y.user();jr(ns(Tr),Q);var ue=Q||J.userId||i(Tr,y,J);return Promise.resolve(new Promise(function(ae){m.dispatch(Z({type:ee.identifyStart,userId:ue,traits:J||{},options:le,anonymousId:ne.anonymousId},ne.id&&ne.id!==Q&&{previousId:ne.id}),ae,[T,N,H])}))}catch(ae){return Promise.reject(ae)}},track:function(w,T,N,H){try{var Q=Fe(w)?w.event:w;if(!Q||!Pr(Q))throw new Error("EventMissing");var J=Fe(w)?w:T||{},le=Fe(N)?N:{};return Promise.resolve(new Promise(function(ne){m.dispatch({type:ee.trackStart,event:Q,properties:J,options:le,userId:i(Tr,y,T),anonymousId:i(lt,y,T)},ne,[T,N,H])}))}catch(ne){return Promise.reject(ne)}},page:function(w,T,N){try{var H=Fe(w)?w:{},Q=Fe(T)?T:{};return Promise.resolve(new Promise(function(J){m.dispatch({type:ee.pageStart,properties:cy(H),options:Q,userId:i(Tr,y,H),anonymousId:i(lt,y,H)},J,[w,T,N])}))}catch(J){return Promise.reject(J)}},user:function(w){if(w===Tr||w==="id")return i(Tr,y);if(w===lt||w==="anonId")return i(lt,y);var T=y.getState("user");return w?rv(T,w):T},reset:function(w){return new Promise(function(T){m.dispatch({type:ee.resetStart},T,w)})},ready:function(w){return b&&w({plugins:g,instance:y}),y.on(ee.ready,function(T){w&&w(T),b=!0})},on:function(w,T){if(!w||!Me(T))return!1;if(w===ee.bootstrap)throw new Error(".on disabled for "+w);var N=/Start$|Start:/;if(w==="*"){var H=function(ne){return function(ue){return function(ae){return ae.type.match(N)&&T({payload:ae,instance:y,plugins:o}),ue(ae)}}},Q=function(ne){return function(ue){return function(ae){return ae.type.match(N)||T({payload:ae,instance:y,plugins:o}),ue(ae)}}};return v(H,bn),v(Q,wn),function(){d(H,bn),d(Q,wn)}}var J=w.match(N)?bn:wn,le=function(ne){return function(ue){return function(ae){return ae.type===w&&T({payload:ae,instance:y,plugins:o,abort:p}),ue(ae)}}};return v(le,J),function(){return d(le,J)}},once:function(w,T){if(!w||!Me(T))return!1;if(w===ee.bootstrap)throw new Error(".once disabled for "+w);var N=y.on(w,function(H){T({payload:H.payload,instance:y,plugins:o,abort:p}),N()});return N},getState:function(w){var T=m.getState();return w?rv(T,w):Object.assign({},T)},dispatch:function(w){var T=Pr(w)?{type:w}:w;if(yn.includes(T.type))throw new Error("reserved action "+T.type);var N=Z({},T,{_:Z({originalAction:T.type},w._||{})});m.dispatch(N)},enablePlugin:g.enable,disablePlugin:g.disable,plugins:g,storage:{getItem:a.getItem,setItem:function(w,T,N){m.dispatch({type:ee.setItemStart,key:w,value:T,options:N})},removeItem:function(w,T){m.dispatch({type:ee.removeItemStart,key:w,options:T})}},setAnonymousId:function(w,T){y.storage.setItem(Rr,w,T)},events:{core:yn,plugins:s}},A=n.middlewares.concat([function(w){return function(T){return function(N){return N.meta||(N.meta=jv()),T(N)}}},h(bn),ey(y,l,{all:c,plugins:s}),ry(a),Jg(y),Qg(y),h(wn)]),q={context:dy,user:Yg(a),page:fy,track:iy,plugins:ny(l),queue:sy},j=ut,G=ut;if(Ce&&e.debug){var K=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;K&&(j=K({trace:!0,traceLimit:25})),G=function(){return arguments.length===0?Nv():Fe(typeof arguments[0])?xv():xv().apply(null,arguments)}}var re,L=(function(w){return Object.keys(w).reduce(function(T,N){return vy.includes(N)||(T[N]=w[N]),T},{})})(e),M=n.pluginsArray.reduce(function(w,T){var N=T.name,H=T.config,Q=T.loaded,J=n.pluginEnabled[N];return w[N]={enabled:J,initialized:!!J&&!T.initialize,loaded:!!Q({config:H}),config:H},w},{}),x={context:L,user:I,plugins:M},m=fv((function(w){for(var T=Object.keys(w),N={},H=0;H<T.length;H++){var Q=T[H];typeof w[Q]===Er&&(N[Q]=w[Q])}var J,le=Object.keys(N);try{(function(ne){Object.keys(ne).forEach(function(ue){var ae=ne[ue];if(typeof ae(void 0,{type:es})===pr||typeof ae(void 0,{type:Vg})===pr)throw new Error(jt+" "+ue+" "+pr)})})(N)}catch(ne){J=ne}return function(ne,ue){if(ne===void 0&&(ne={}),J)throw J;for(var ae=!1,_e={},xe=0;xe<le.length;xe++){var Be=le[xe],Le=ne[Be],tr=(0,N[Be])(Le,ue);if(typeof tr===pr){var Cr=zg(Be,ue);throw new Error(Cr)}_e[Be]=tr,ae=ae||tr!==Le}return ae?_e:ne}})(Z({},q,r)),x,G(j(Kg.apply(void 0,A))));m.dispatch=(re=m.dispatch,function(w,T,N){var H=Z({},w,{meta:jv(w.meta,T,ss(N))});return re.apply(null,[H])});var C=Object.keys(o);m.dispatch({type:ee.bootstrap,plugins:C,config:L,params:S,user:I,initialUser:t,persistedUser:R});var U=C.filter(function(w){return n.pluginEnabled[w]}),F=C.filter(function(w){return!n.pluginEnabled[w]});return m.dispatch({type:ee.registerPlugins,plugins:C,enabled:n.pluginEnabled}),n.pluginsArray.map(function(w,T){var N=w.bootstrap,H=w.config,Q=w.name;N&&Me(N)&&N({instance:y,config:H,payload:w}),m.dispatch({type:ee.registerPluginType(Q),name:Q,enabled:n.pluginEnabled[Q],plugin:w}),n.pluginsArray.length===T+1&&m.dispatch({type:ee.initializeStart,plugins:U,disabled:F})}),py(function(w){m.dispatch({type:w?ee.offline:ee.online})}),(function(w,T,N){setInterval(function(){return yv(w,T,N)},3e3)})(m,l,y),y}var bn="before",wn="after",Mr="cookie",Fr=Fv(),Dv=Sn,gy=Sn;function Mv(e){return Fr?Sn(e,"",-1):ot(e)}function Fv(){if(Fr!==void 0)return Fr;var e=Mr+Mr;try{Sn(e,e),Fr=document.cookie.indexOf(e)!==-1,Mv(e)}catch{Fr=!1}return Fr}function Sn(e,r,t,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return Fr===!1&&(o?jr(e,r):xr(e)),o?document.cookie=e+"="+encodeURIComponent(r)+(t?"; expires="+new Date(+new Date+1e3*t).toUTCString()+(n?"; path="+n:"")+(a?"; domain="+a:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var mr="localStorage",yy=Zo.bind(null,mr);st(mr,"getItem",xr),st(mr,"setItem",jr),st(mr,"removeItem",ot);var gr="sessionStorage",by=Zo.bind(null,gr);st(gr,"getItem",xr),st(gr,"setItem",jr),st(gr,"removeItem",ot);function dt(e){var r=e;try{if((r=JSON.parse(e))==="true")return!0;if(r==="false")return!1;if(Fe(r))return r;parseFloat(r)===r&&(r=parseFloat(r))}catch{}if(r!==null&&r!=="")return r}var wy=yy(),Sy=by(),Iy=Fv();function Br(e,r){if(e){var t=us(r),n=!ds(t),a=cs(t)?dt(localStorage.getItem(e)):void 0;if(n&&!nt(a))return a;var i=ls(t)?dt(Dv(e)):void 0;if(n&&i)return i;var o=fs(t)?dt(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var s=xr(e);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function In(e,r,t){if(e&&!nt(r)){var n={},a=us(t),i=JSON.stringify(r),o=!ds(a);return cs(a)&&(n[mr]=En(mr,r,dt(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[mr]:ls(a)&&(n[Mr]=En(Mr,r,dt(Dv(e))),gy(e,i),o)?n[Mr]:fs(a)&&(n[gr]=En(gr,r,dt(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[gr]:(n[Nr]=En(Nr,r,xr(e)),jr(e,r),o?n[Nr]:n)}}function Py(e,r){if(e){var t=us(r),n=Br(e,nv),a={};return!nt(n.localStorage)&&cs(t)&&(localStorage.removeItem(e),a[mr]=n.localStorage),!nt(n.cookie)&&ls(t)&&(Mv(e),a[Mr]=n.cookie),!nt(n.sessionStorage)&&fs(t)&&(sessionStorage.removeItem(e),a[gr]=n.sessionStorage),!nt(n.global)&&Pn(t,Nr)&&(ot(e),a[Nr]=n.global),a}}function us(e){return e?Pr(e)?e:e.storage:tv}function cs(e){return wy&&Pn(e,mr)}function ls(e){return Iy&&Pn(e,Mr)}function fs(e){return Sy&&Pn(e,gr)}function ds(e){return e===nv||e==="all"}function Pn(e,r){return e===tv||e===r||ds(e)}function En(e,r,t){return{location:e,current:r,previous:t}}var Ey={setItem:In,getItem:Br,removeItem:Py};function Ry(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Bv(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,n)}return t}function Hv(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Bv(Object(t),!0).forEach(function(n){Ry(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Bv(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Ty(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r={storage:Ey};return my(Hv(Hv({},r),e))}function Oy(e){if(typeof window>"u")return;const{addEventListener:r,history:t,location:n}=window;let a=n.pathname;r("popstate",()=>e(n.pathname)),["push","replace"].map(i=>{const o=`${i}State`;if(o!=="pushState"&&o!=="replaceState")return;const s=t[o];t[o]=function(...u){const c=u[2]?.toString()||"",l=_y(c);return a!==l&&(a=l,setTimeout(()=>e(c),0)),s.apply(t,u)}})}function Cy(e,r){const t=e.indexOf(r);return t>-1?e.slice(0,t):e}function _y(e){return["#","?"].forEach(r=>e=Cy(e,r)),e}function Ay(){Oy(()=>{yr.page()})}var vs="up",hs="down";function ky(e){if(e===void 0&&(e={}),!Ce)return Xo;var r=Wv(),t=ps(),n=Gv(),a=Rn(n,r),i=Rn(t,r),o=[],s=[],u=[],c=n,l=a,f=i,v=Object.keys(e);if(!v.length)return Xo;var d=v.map(function(p){return Number(p)}),h=Wg(function(){var p=Wv(),S=(function(L,M){return M.map(function(x){return x===100?L-5:L*(x/100)})})(p,d),R=ps(),I=Gv(),g=Rn(I,p),b=Rn(R,p);if(l=g>l?g:l,f=b<f?b:f,!(o.length>=d.length)){var y=c===I,A=vs;y?A="initial":c<=I&&(A=hs);var q=S,j=d;(A===vs||y)&&(q=S.slice().reverse(),j=d.slice().reverse());var G=j.reduce(function(L,M,x){var m=q[x];return u.includes(M)&&I<=m&&(u=u.filter(function(C){return C!==M}),L.singleFunction=M),A===hs&&!o.includes(M)&&I>=m&&M>i?(s.push(M),L.callbacks=L.callbacks.concat(M),L):A===vs&&!o.includes(M)&&I<=m&&M<=g?(L.foundFunc=[M],L):(y&&I>=m&&L.foundFunc.length===0&&(L.foundFunc=[M]),!s.includes(M)&&I>=m&&(s.push(M),L.singleFunction?u.push(M):L.singleFunction=M),L)},{foundFunc:[],singleFunction:null,callbacks:[],direction:A});if(c=I,A===hs&&G.callbacks&&G.callbacks.forEach(function(L){Me(e[L])&&(e[L]({trigger:L,direction:A,scrollMin:f,scrollMax:l,range:[f,l]}),o.push(L))}),G.singleFunction){var K=G.singleFunction,re=G.direction;Me(e[K])&&e[K]({trigger:K,direction:re,scrollMin:f,scrollMax:l,range:[f,l]}),o.push(K)}}},500);return window.addEventListener("scroll",h),function(){return window.removeEventListener("scroll",h)}}function ps(){return Ce?document.body.scrollTop||document.documentElement.scrollTop:0}function qy(){return Ce?window.innerHeight||document.documentElement.clientHeight:0}function Gv(){return Math.round(ps()+qy())}function Wv(){if(!Ce)return 0;var e=document.body,r=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,r.clientHeight,r.scrollHeight,r.offsetHeight)}function Rn(e,r){return Math.round(e/r*100)}var ms="Event",Vv=ms+"Listener";function $y(e){return function(r,t,n,a){var i=n||Xo,o=a||!1;if(!Ce)return i;var s=Tn(t),u=Tn(r,!0);if(!u.length)throw new Error("noElements");if(!s.length)throw new Error("no"+ms);var c=[];return(function l(f){f&&(c=[]);for(var v=f?"add"+Vv:"remove"+Vv,d=0;d<u.length;d++){var h=u[d];c[d]=f?o&&o.once?Uy(i):i:c[d]||i;for(var p=0;p<s.length;p++)h[v]?h["on"+s[p]]=f?c[d]:null:h[v](s[p],c[d],o)}return l.bind(null,!f)})(e)}}function Tn(e,r){if(Pr(e))return r?Tn(document.querySelectorAll(e)):(t=e).split(t.indexOf(",")>-1?",":" ").map(function(o){return o.trim()});var t;if(NodeList.prototype.isPrototypeOf(e)){for(var n=[],a=e.length>>>0;a--;)n[a]=e[a];return n}var i=Mg(e);return r?i.map(function(o){return Pr(o)?Tn(o,!0):o}).flat():i}function Uy(e,r){var t;return function(){return e&&(t=e.apply(this,arguments),e=null),t}}var gs=$y(ms);function zv(e,r){return Ce&&Me(window[e])?(t=window[e],n=r,(a=window)===void 0&&(a=null),Me(t)?function(){t.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=r;var t,n,a}zv.bind(null,"onerror"),zv.bind(null,"onload");var Kv=typeof window>"u",Jv="hidden";function Ly(e){if(Kv)return!1;var r=Ny(),t="".concat(r.replace(/[H|h]idden/,""),"visibilitychange"),n=function(){return e(!!document[r])},a=function(){return document.addEventListener(t,n)};return a(),function(){return document.removeEventListener(t,n),a}}function Ny(){var e=["webkit","moz","ms","o"];return Kv||Jv in document?Jv:e.reduce(function(r,t){var n=t+"Hidden";return!r&&n in document?n:r},null)}var xy=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function jy(e,r){r===void 0&&(r={});var t=(function(o,s){var u=this,c=!1;return function(l){c||(o.call(u,l),c=!0,setTimeout(function(){return c=!1},s))}})(e,r.throttle||1e4),n=[];function a(){var o=Ly(function(s){s||t({type:"tabVisible"})});return n=[o].concat(xy.map(function(s){return gs(document,s,t)})).concat(gs(window,"load",t)).concat(gs(window,"scroll",t,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function Dy(e){var r,t,n=e.onIdle,a=e.onWakeUp,i=e.onHeartbeat,o=e.timeout,s=o,u=e.throttle,c=u===void 0?2e3:u,l=!1,f=!1,v=new Date,d=function(){return clearTimeout(r)};function h(S){d(),i&&!l&&i(Ft(v),S),a&&l&&(l=!1,a(Ft(t),S),v=new Date),r=setTimeout(function(){l=!0,n&&(t=new Date,n(Ft(v),S))},s)}var p=jy(h,{throttle:c});return{disable:function(){f=!0,l=!1,d();var S=p();return function(){return f=!1,v=new Date,h({type:"load"}),S()}},getStatus:function(){return{isIdle:l,isDisabled:f,active:l?0:Ft(v,f),idle:l?Ft(t,f):0}}}}function Ft(e,r){return r?0:Math.round((new Date-e)/1e3)}const Yv=5e3;class My{element;isInViewport=!1;isAwake=!1;isFlushing;observer;lastEventAt=Date.now();registeredView=!1;viewCallback;activeDurationCallback;idleDurationCallback;scrollCallback;constructor(r){this.element=r.element,this.viewCallback=r.viewCallback,this.activeDurationCallback=r.activeDurationCallback,this.idleDurationCallback=r.idleDurationCallback,this.scrollCallback=r.scrollCallback,this.observer=new IntersectionObserver(t=>{t.forEach(n=>{this.handleInViewPort(n.isIntersecting)})},{threshold:0}),this.observer.observe(this.element),Dy({onIdle:t=>this.handleAwake(!1,t),onWakeUp:t=>this.handleAwake(!0,t),timeout:Yv}),ky({25:this.handleScroll.bind(this),50:this.handleScroll.bind(this),75:this.handleScroll.bind(this),90:this.handleScroll.bind(this),100:this.handleScroll.bind(this)})}flush(){this.isFlushing=!0,this.handleAwake(!this.isAwake)}handleInViewPort(r){r?(this.isAwake=!0,this.trackInViewport()):this.handleAwake(!1),this.isInViewport=r}handleAwake(r,t=Math.round((Date.now()-this.lastEventAt)/1e3)){this.isAwake=r,this.lastEventAt=r?Date.now()-t*Yv:Date.now(),this.isInViewport&&this.trackAwake(r,t)}handleScroll(r){this.scrollCallback&&this.scrollCallback(r)}handleVisibilityChange(){this.isAwake=!1;const r=Math.round((Date.now()-this.lastEventAt)/1e3);r>1&&(this.lastEventAt=Date.now(),this.trackAwake(!1,r))}trackAwake(r,t){!r&&this.activeDurationCallback&&this.activeDurationCallback(t,this.isFlushing,this.lastEventAt),r&&this.idleDurationCallback&&this.idleDurationCallback(t,this.isFlushing,this.lastEventAt)}trackInViewport(){this.registeredView||(this.registeredView=!0,this.viewCallback&&this.viewCallback())}}function Qv(e){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e):e()}function Fy(e,r){r=r||{};var t,n,a=[],i=r.max||1/0;function o(){clearInterval(t),e(a.splice(0,i)),s()}function s(){t=setInterval(o,r.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(t)}}}const Xv="sesamy_session_id";function By(){let e=sessionStorage.getItem(Xv);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(Xv,e)),e}let Zv=!1,On,Cn,ys;function eh(e){return JSON.stringify(e.map(r=>{const{campaign:t,...n}=r.properties||{};return{anonymousId:r.anonymousId,userId:r.userId,type:r.type,properties:n,clientId:ys,requestId:Math.random().toString(36).slice(2,9),sessionId:By(),timestamp:new Date().toISOString(),version:kt,event:r.event,context:{...r.context,page:{url:window.location.href,title:document.title,referrer:document.referrer,itemSrc:ge("sesamy:item-src"),publisherContentId:ge("sesamy:publisher-content-id")},campaign:t,locale:navigator.language,library:zo,userAgent:navigator.userAgent,clientId:ys}}}))}const rh=Fy(async e=>{if(e.length>0){const r=eh(e);Zv?navigator.sendBeacon(Cn,r):(await fetch(Cn,{method:"POST",body:r,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function bs(e){if(e.anonymousId)if(e.properties?.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(Cn,eh([r]))}else rh.push(e)}function Hy(){return Zv=!0,rh.flush()}function Gy(e,r,t){On=r,Cn=`${or("logs",t)}/events`,ys=e}const Wy={name:"custom-analytics-plugin",page:({payload:e})=>{if(!On)return;const{properties:r,anonymousId:t,userId:n,event:a}=e;bs({anonymousId:t,userId:n,properties:r,event:a,type:"page"})},track:({payload:e})=>{if(!On)return;const{properties:r,anonymousId:t,userId:n,event:a}=e;bs({anonymousId:t,userId:n,properties:r,event:a,type:"track"})},identify:({payload:e})=>{if(!On)return;const{properties:r,anonymousId:t,userId:n}=e;bs({anonymousId:t,userId:n,properties:r,type:"identify"})}},th=["source","medium","campaign","term","content"],Or="utm_",Vy=1800*1e3;function nh(e){return e?Date.now()-parseInt(e,10)>Vy:!0}function ah(){const e=document.referrer||"";if(!e)return;const r=Br(`${Or}set_at`);(nh(r)||!Br(`${Or}referrer`))&&In(`${Or}referrer`,e)}function zy(){const e=()=>{const t={};for(const a of th){const i=Br(`${Or}${a}`);i&&(t[`utm_${a}`]=i)}const n=Br(`${Or}referrer`);return n&&(t.utm_referrer=n),t};return{name:"attribution-tracking",initialize(){ah()},campaign({payload:t}){const n=t?.campaign||{},a=Br(`${Or}set_at`);if(Object.keys(n).length>0&&nh(a)){for(const o of th){const s=n[o];s&&In(`${Or}${o}`,s)}In(`${Or}set_at`,String(Date.now()))}ah()},page({payload:t}){return t.properties.campaign=e(),t},track({payload:t}){return t.properties.campaign=e(),t},getStoredCampaignData:e}}const Ky=zy(),ih=new Map,oh=new Map;function Jy({clientId:e,enabled:r=!0,environment:t}){Gy(e,r,t),r&&(window.addEventListener("beforeunload",()=>{oh.forEach((n,a)=>{n.bind(a)()}),Hy()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&ih.forEach((n,a)=>{n.bind(a)()})}),Ay(),Qv(()=>{const n=new My({element:document.body,viewCallback:()=>{yr.page()},activeDurationCallback:(a,i,o)=>{yr.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{yr.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{yr.track("scroll",{scroll:a.scrollMax})}});oh.set(document.body,()=>{n.flush()}),ih.set(document.body,()=>{n.handleVisibilityChange()})}),window.addEventListener(er.AUTHENTICATED,async n=>{const a=n;await yr.identify(a.detail.sub)}),window.addEventListener(er.LOGOUT,async()=>{await yr.track("logout",{}),await yr.reset()}))}const yr=Ty({app:zo,version:kt,plugins:[Ky,Wy]});function sh(e,r){yr.track(e,r)}const Yy=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function uh(){return new Promise(e=>{const r=Yy.map(t=>{const n=document.createElement("div");return n.innerHTML="&nbsp;",n.id=t,n.style.position="absolute",document.body.appendChild(n),n});window.setTimeout(()=>{const t=!r.every(n=>document.querySelector(`#${n.id}`)?.offsetParent);r.forEach(n=>n.remove()),e(t)},100)})}function ch(){const e=navigator.userAgent.toLowerCase(),r=[{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 t of r)if(t.regex.test(e))return{isInAppBrowser:!0,browserName:t.name};return/; wv\)/.test(e)?{isInAppBrowser:!0,browserName:"Unknown In-App Browser"}:{isInAppBrowser:!1,browserName:null}}/*!
1
+ var sesamyJs=(function($e){"use strict";var js=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ds={},$n,Ms;function Re(){return Ms||(Ms=1,$n=function(e){try{return!!e()}catch{return!0}}),$n}var Un,Fs;function Vt(){if(Fs)return Un;Fs=1;var e=Re();return Un=!e(function(){var r=(function(){}).bind();return typeof r!="function"||r.hasOwnProperty("prototype")}),Un}var Ln,Bs;function pe(){if(Bs)return Ln;Bs=1;var e=Vt(),r=Function.prototype,t=r.call,n=e&&r.bind.bind(t,t);return Ln=e?n:function(a){return function(){return t.apply(a,arguments)}},Ln}var Nn,Hs;function zt(){if(Hs)return Nn;Hs=1;var e=pe(),r=e({}.toString),t=e("".slice);return Nn=function(n){return t(r(n),8,-1)},Nn}var xn,Gs;function Ws(){if(Gs)return xn;Gs=1;var e=pe(),r=Re(),t=zt(),n=Object,a=e("".split);return xn=r(function(){return!n("z").propertyIsEnumerable(0)})?function(i){return t(i)==="String"?a(i,""):n(i)}:n,xn}var jn,Vs;function Kt(){return Vs||(Vs=1,jn=function(e){return e==null}),jn}var Dn,zs;function Jt(){if(zs)return Dn;zs=1;var e=Kt(),r=TypeError;return Dn=function(t){if(e(t))throw new r("Can't call method on "+t);return t},Dn}var Mn,Ks;function bt(){if(Ks)return Mn;Ks=1;var e=Ws(),r=Jt();return Mn=function(t){return e(r(t))},Mn}var wt,Js;function me(){if(Js)return wt;Js=1;var e=function(r){return r&&r.Math===Math&&r};return wt=e(typeof globalThis=="object"&&globalThis)||e(typeof window=="object"&&window)||e(typeof self=="object"&&self)||e(typeof js=="object"&&js)||e(typeof wt=="object"&&wt)||(function(){return this})()||Function("return this")(),wt}var Fn={exports:{}},Bn,Ys;function ar(){return Ys||(Ys=1,Bn=!1),Bn}var Hn,Qs;function Gn(){if(Qs)return Hn;Qs=1;var e=me(),r=Object.defineProperty;return Hn=function(t,n){try{r(e,t,{value:n,configurable:!0,writable:!0})}catch{e[t]=n}return n},Hn}var Xs;function Wn(){if(Xs)return Fn.exports;Xs=1;var e=ar(),r=me(),t=Gn(),n="__core-js_shared__",a=Fn.exports=r[n]||t(n,{});return(a.versions||(a.versions=[])).push({version:"3.46.0",mode:e?"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"}),Fn.exports}var Vn,Zs;function eu(){if(Zs)return Vn;Zs=1;var e=Wn();return Vn=function(r,t){return e[r]||(e[r]=t||{})},Vn}var zn,ru;function Yt(){if(ru)return zn;ru=1;var e=Jt(),r=Object;return zn=function(t){return r(e(t))},zn}var Kn,tu;function We(){if(tu)return Kn;tu=1;var e=pe(),r=Yt(),t=e({}.hasOwnProperty);return Kn=Object.hasOwn||function(a,i){return t(r(a),i)},Kn}var Jn,nu;function au(){if(nu)return Jn;nu=1;var e=pe(),r=0,t=Math.random(),n=e(1.1.toString);return Jn=function(a){return"Symbol("+(a===void 0?"":a)+")_"+n(++r+t,36)},Jn}var Yn,iu;function St(){if(iu)return Yn;iu=1;var e=me(),r=e.navigator,t=r&&r.userAgent;return Yn=t?String(t):"",Yn}var Qn,ou;function su(){if(ou)return Qn;ou=1;var e=me(),r=St(),t=e.process,n=e.Deno,a=t&&t.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&&r&&(o=r.match(/Edge\/(\d+)/),(!o||o[1]>=74)&&(o=r.match(/Chrome\/(\d+)/),o&&(s=+o[1]))),Qn=s,Qn}var Xn,uu;function cu(){if(uu)return Xn;uu=1;var e=su(),r=Re(),t=me(),n=t.String;return Xn=!!Object.getOwnPropertySymbols&&!r(function(){var a=Symbol("symbol detection");return!n(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&e&&e<41}),Xn}var Zn,lu;function fu(){if(lu)return Zn;lu=1;var e=cu();return Zn=e&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Zn}var ea,du;function Te(){if(du)return ea;du=1;var e=me(),r=eu(),t=We(),n=au(),a=cu(),i=fu(),o=e.Symbol,s=r("wks"),u=i?o.for||o:o&&o.withoutSetter||n;return ea=function(c){return t(s,c)||(s[c]=a&&t(o,c)?o[c]:u("Symbol."+c)),s[c]},ea}var ra,vu;function ye(){if(vu)return ra;vu=1;var e=typeof document=="object"&&document.all;return ra=typeof e>"u"&&e!==void 0?function(r){return typeof r=="function"||r===e}:function(r){return typeof r=="function"},ra}var ta,hu;function Ve(){if(hu)return ta;hu=1;var e=ye();return ta=function(r){return typeof r=="object"?r!==null:e(r)},ta}var na,pu;function Xe(){if(pu)return na;pu=1;var e=Ve(),r=String,t=TypeError;return na=function(n){if(e(n))return n;throw new t(r(n)+" is not an object")},na}var aa={},ia,mu;function Oe(){if(mu)return ia;mu=1;var e=Re();return ia=!e(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),ia}var oa,gu;function yu(){if(gu)return oa;gu=1;var e=Oe(),r=Re();return oa=e&&r(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),oa}var sa={},ua,bu;function Qt(){if(bu)return ua;bu=1;var e=me(),r=Ve(),t=e.document,n=r(t)&&r(t.createElement);return ua=function(a){return n?t.createElement(a):{}},ua}var ca,wu;function Su(){if(wu)return ca;wu=1;var e=Oe(),r=Re(),t=Qt();return ca=!e&&!r(function(){return Object.defineProperty(t("div"),"a",{get:function(){return 7}}).a!==7}),ca}var la,Iu;function Ue(){if(Iu)return la;Iu=1;var e=Vt(),r=Function.prototype.call;return la=e?r.bind(r):function(){return r.apply(r,arguments)},la}var fa,Pu;function ze(){if(Pu)return fa;Pu=1;var e=me(),r=ye(),t=function(n){return r(n)?n:void 0};return fa=function(n,a){return arguments.length<2?t(e[n]):e[n]&&e[n][a]},fa}var da,Eu;function Xt(){if(Eu)return da;Eu=1;var e=pe();return da=e({}.isPrototypeOf),da}var va,Ru;function Tu(){if(Ru)return va;Ru=1;var e=ze(),r=ye(),t=Xt(),n=fu(),a=Object;return va=n?function(i){return typeof i=="symbol"}:function(i){var o=e("Symbol");return r(o)&&t(o.prototype,a(i))},va}var ha,Ou;function Zt(){if(Ou)return ha;Ou=1;var e=String;return ha=function(r){try{return e(r)}catch{return"Object"}},ha}var pa,Cu;function Ze(){if(Cu)return pa;Cu=1;var e=ye(),r=Zt(),t=TypeError;return pa=function(n){if(e(n))return n;throw new t(r(n)+" is not a function")},pa}var ma,_u;function ga(){if(_u)return ma;_u=1;var e=Ze(),r=Kt();return ma=function(t,n){var a=t[n];return r(a)?void 0:e(a)},ma}var ya,Au;function Bh(){if(Au)return ya;Au=1;var e=Ue(),r=ye(),t=Ve(),n=TypeError;return ya=function(a,i){var o,s;if(i==="string"&&r(o=a.toString)&&!t(s=e(o,a))||r(o=a.valueOf)&&!t(s=e(o,a))||i!=="string"&&r(o=a.toString)&&!t(s=e(o,a)))return s;throw new n("Can't convert object to primitive value")},ya}var ba,ku;function Hh(){if(ku)return ba;ku=1;var e=Ue(),r=Ve(),t=Tu(),n=ga(),a=Bh(),i=Te(),o=TypeError,s=i("toPrimitive");return ba=function(u,c){if(!r(u)||t(u))return u;var l=n(u,s),f;if(l){if(c===void 0&&(c="default"),f=e(l,u,c),!r(f)||t(f))return f;throw new o("Can't convert object to primitive value")}return c===void 0&&(c="number"),a(u,c)},ba}var wa,qu;function $u(){if(qu)return wa;qu=1;var e=Hh(),r=Tu();return wa=function(t){var n=e(t,"string");return r(n)?n:n+""},wa}var Uu;function cr(){if(Uu)return sa;Uu=1;var e=Oe(),r=Su(),t=yu(),n=Xe(),a=$u(),i=TypeError,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u="enumerable",c="configurable",l="writable";return sa.f=e?t?function(v,d,h){if(n(v),d=a(d),n(h),typeof v=="function"&&d==="prototype"&&"value"in h&&l in h&&!h[l]){var p=s(v,d);p&&p[l]&&(v[d]=h.value,h={configurable:c in h?h[c]:p[c],enumerable:u in h?h[u]:p[u],writable:!1})}return o(v,d,h)}:o:function(v,d,h){if(n(v),d=a(d),n(h),r)try{return o(v,d,h)}catch{}if("get"in h||"set"in h)throw new i("Accessors not supported");return"value"in h&&(v[d]=h.value),v},sa}var Sa,Lu;function Gh(){if(Lu)return Sa;Lu=1;var e=Math.ceil,r=Math.floor;return Sa=Math.trunc||function(n){var a=+n;return(a>0?r:e)(a)},Sa}var Ia,Nu;function Pa(){if(Nu)return Ia;Nu=1;var e=Gh();return Ia=function(r){var t=+r;return t!==t||t===0?0:e(t)},Ia}var Ea,xu;function ju(){if(xu)return Ea;xu=1;var e=Pa(),r=Math.max,t=Math.min;return Ea=function(n,a){var i=e(n);return i<0?r(i+a,0):t(i,a)},Ea}var Ra,Du;function Wh(){if(Du)return Ra;Du=1;var e=Pa(),r=Math.min;return Ra=function(t){var n=e(t);return n>0?r(n,9007199254740991):0},Ra}var Ta,Mu;function Oa(){if(Mu)return Ta;Mu=1;var e=Wh();return Ta=function(r){return e(r.length)},Ta}var Ca,Fu;function Vh(){if(Fu)return Ca;Fu=1;var e=bt(),r=ju(),t=Oa(),n=function(a){return function(i,o,s){var u=e(i),c=t(u);if(c===0)return!a&&-1;var l=r(s,c),f;if(a&&o!==o){for(;c>l;)if(f=u[l++],f!==f)return!0}else for(;c>l;l++)if((a||l in u)&&u[l]===o)return a||l||0;return!a&&-1}};return Ca={includes:n(!0),indexOf:n(!1)},Ca}var _a,Bu;function Aa(){return Bu||(Bu=1,_a={}),_a}var ka,Hu;function Gu(){if(Hu)return ka;Hu=1;var e=pe(),r=We(),t=bt(),n=Vh().indexOf,a=Aa(),i=e([].push);return ka=function(o,s){var u=t(o),c=0,l=[],f;for(f in u)!r(a,f)&&r(u,f)&&i(l,f);for(;s.length>c;)r(u,f=s[c++])&&(~n(l,f)||i(l,f));return l},ka}var qa,Wu;function $a(){return Wu||(Wu=1,qa=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),qa}var Ua,Vu;function zu(){if(Vu)return Ua;Vu=1;var e=Gu(),r=$a();return Ua=Object.keys||function(n){return e(n,r)},Ua}var Ku;function zh(){if(Ku)return aa;Ku=1;var e=Oe(),r=yu(),t=cr(),n=Xe(),a=bt(),i=zu();return aa.f=e&&!r?Object.defineProperties:function(s,u){n(s);for(var c=a(u),l=i(u),f=l.length,v=0,d;f>v;)t.f(s,d=l[v++],c[d]);return s},aa}var La,Ju;function Yu(){if(Ju)return La;Ju=1;var e=ze();return La=e("document","documentElement"),La}var Na,Qu;function xa(){if(Qu)return Na;Qu=1;var e=eu(),r=au(),t=e("keys");return Na=function(n){return t[n]||(t[n]=r(n))},Na}var ja,Xu;function It(){if(Xu)return ja;Xu=1;var e=Xe(),r=zh(),t=$a(),n=Aa(),a=Yu(),i=Qt(),o=xa(),s=">",u="<",c="prototype",l="script",f=o("IE_PROTO"),v=function(){},d=function(I){return u+l+s+I+u+"/"+l+s},h=function(I){I.write(d("")),I.close();var g=I.parentWindow.Object;return I=null,g},p=function(){var I=i("iframe"),g="java"+l+":",b;return I.style.display="none",a.appendChild(I),I.src=String(g),b=I.contentWindow.document,b.open(),b.write(d("document.F=Object")),b.close(),b.F},S,R=function(){try{S=new ActiveXObject("htmlfile")}catch{}R=typeof document<"u"?document.domain&&S?h(S):p():h(S);for(var I=t.length;I--;)delete R[c][t[I]];return R()};return n[f]=!0,ja=Object.create||function(g,b){var y;return g!==null?(v[c]=e(g),y=new v,v[c]=null,y[f]=g):y=R(),b===void 0?y:r.f(y,b)},ja}var Da,Zu;function Kh(){if(Zu)return Da;Zu=1;var e=Te(),r=It(),t=cr().f,n=e("unscopables"),a=Array.prototype;return a[n]===void 0&&t(a,n,{configurable:!0,value:r(null)}),Da=function(i){a[n][i]=!0},Da}var Ma,ec;function Pt(){return ec||(ec=1,Ma={}),Ma}var Fa,rc;function Jh(){if(rc)return Fa;rc=1;var e=me(),r=ye(),t=e.WeakMap;return Fa=r(t)&&/native code/.test(String(t)),Fa}var Ba,tc;function Ar(){return tc||(tc=1,Ba=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}}),Ba}var Ha,nc;function kr(){if(nc)return Ha;nc=1;var e=Oe(),r=cr(),t=Ar();return Ha=e?function(n,a,i){return r.f(n,a,t(1,i))}:function(n,a,i){return n[a]=i,n},Ha}var Ga,ac;function Kr(){if(ac)return Ga;ac=1;var e=Jh(),r=me(),t=Ve(),n=kr(),a=We(),i=Wn(),o=xa(),s=Aa(),u="Object already initialized",c=r.TypeError,l=r.WeakMap,f,v,d,h=function(I){return d(I)?v(I):f(I,{})},p=function(I){return function(g){var b;if(!t(g)||(b=v(g)).type!==I)throw new c("Incompatible receiver, "+I+" required");return b}};if(e||i.state){var S=i.state||(i.state=new l);S.get=S.get,S.has=S.has,S.set=S.set,f=function(I,g){if(S.has(I))throw new c(u);return g.facade=I,S.set(I,g),g},v=function(I){return S.get(I)||{}},d=function(I){return S.has(I)}}else{var R=o("state");s[R]=!0,f=function(I,g){if(a(I,R))throw new c(u);return g.facade=I,n(I,R,g),g},v=function(I){return a(I,R)?I[R]:{}},d=function(I){return a(I,R)}}return Ga={set:f,get:v,has:d,enforce:h,getterFor:p},Ga}var Wa={},Va={},ic;function oc(){if(ic)return Va;ic=1;var e={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,t=r&&!e.call({1:2},1);return Va.f=t?function(a){var i=r(this,a);return!!i&&i.enumerable}:e,Va}var sc;function uc(){if(sc)return Wa;sc=1;var e=Oe(),r=Ue(),t=oc(),n=Ar(),a=bt(),i=$u(),o=We(),s=Su(),u=Object.getOwnPropertyDescriptor;return Wa.f=e?u:function(l,f){if(l=a(l),f=i(f),s)try{return u(l,f)}catch{}if(o(l,f))return n(!r(t.f,l,f),l[f])},Wa}var za={exports:{}},Ka,cc;function lc(){if(cc)return Ka;cc=1;var e=Oe(),r=We(),t=Function.prototype,n=e&&Object.getOwnPropertyDescriptor,a=r(t,"name"),i=a&&(function(){}).name==="something",o=a&&(!e||e&&n(t,"name").configurable);return Ka={EXISTS:a,PROPER:i,CONFIGURABLE:o},Ka}var Ja,fc;function Ya(){if(fc)return Ja;fc=1;var e=pe(),r=ye(),t=Wn(),n=e(Function.toString);return r(t.inspectSource)||(t.inspectSource=function(a){return n(a)}),Ja=t.inspectSource,Ja}var dc;function vc(){if(dc)return za.exports;dc=1;var e=pe(),r=Re(),t=ye(),n=We(),a=Oe(),i=lc().CONFIGURABLE,o=Ya(),s=Kr(),u=s.enforce,c=s.get,l=String,f=Object.defineProperty,v=e("".slice),d=e("".replace),h=e([].join),p=a&&!r(function(){return f(function(){},"length",{value:8}).length!==8}),S=String(String).split("String"),R=za.exports=function(I,g,b){v(l(g),0,7)==="Symbol("&&(g="["+d(l(g),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),b&&b.getter&&(g="get "+g),b&&b.setter&&(g="set "+g),(!n(I,"name")||i&&I.name!==g)&&(a?f(I,"name",{value:g,configurable:!0}):I.name=g),p&&b&&n(b,"arity")&&I.length!==b.arity&&f(I,"length",{value:b.arity});try{b&&n(b,"constructor")&&b.constructor?a&&f(I,"prototype",{writable:!1}):I.prototype&&(I.prototype=void 0)}catch{}var y=u(I);return n(y,"source")||(y.source=h(S,typeof g=="string"?g:"")),I};return Function.prototype.toString=R(function(){return t(this)&&c(this).source||o(this)},"toString"),za.exports}var Qa,hc;function Ke(){if(hc)return Qa;hc=1;var e=ye(),r=cr(),t=vc(),n=Gn();return Qa=function(a,i,o,s){s||(s={});var u=s.enumerable,c=s.name!==void 0?s.name:i;if(e(o)&&t(o,c,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:r.f(a,i,{value:o,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return a},Qa}var Xa={},pc;function Yh(){if(pc)return Xa;pc=1;var e=Gu(),r=$a(),t=r.concat("length","prototype");return Xa.f=Object.getOwnPropertyNames||function(a){return e(a,t)},Xa}var Za={},mc;function gc(){return mc||(mc=1,Za.f=Object.getOwnPropertySymbols),Za}var ei,yc;function Qh(){if(yc)return ei;yc=1;var e=ze(),r=pe(),t=Yh(),n=gc(),a=Xe(),i=r([].concat);return ei=e("Reflect","ownKeys")||function(s){var u=t.f(a(s)),c=n.f;return c?i(u,c(s)):u},ei}var ri,bc;function wc(){if(bc)return ri;bc=1;var e=We(),r=Qh(),t=uc(),n=cr();return ri=function(a,i,o){for(var s=r(i),u=n.f,c=t.f,l=0;l<s.length;l++){var f=s[l];!e(a,f)&&!(o&&e(o,f))&&u(a,f,c(i,f))}},ri}var ti,Sc;function Ic(){if(Sc)return ti;Sc=1;var e=Re(),r=ye(),t=/#|\.prototype\./,n=function(u,c){var l=i[a(u)];return l===s?!0:l===o?!1:r(c)?e(c):!!c},a=n.normalize=function(u){return String(u).replace(t,".").toLowerCase()},i=n.data={},o=n.NATIVE="N",s=n.POLYFILL="P";return ti=n,ti}var ni,Pc;function Ie(){if(Pc)return ni;Pc=1;var e=me(),r=uc().f,t=kr(),n=Ke(),a=Gn(),i=wc(),o=Ic();return ni=function(s,u){var c=s.target,l=s.global,f=s.stat,v,d,h,p,S,R;if(l?d=e:f?d=e[c]||a(c,{}):d=e[c]&&e[c].prototype,d)for(h in u){if(S=u[h],s.dontCallGetSet?(R=r(d,h),p=R&&R.value):p=d[h],v=o(l?h:c+(f?".":"#")+h,s.forced),!v&&p!==void 0){if(typeof S==typeof p)continue;i(S,p)}(s.sham||p&&p.sham)&&t(S,"sham",!0),n(d,h,S,s)}},ni}var ai,Ec;function Xh(){if(Ec)return ai;Ec=1;var e=Re();return ai=!e(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype}),ai}var ii,Rc;function oi(){if(Rc)return ii;Rc=1;var e=We(),r=ye(),t=Yt(),n=xa(),a=Xh(),i=n("IE_PROTO"),o=Object,s=o.prototype;return ii=a?o.getPrototypeOf:function(u){var c=t(u);if(e(c,i))return c[i];var l=c.constructor;return r(l)&&c instanceof l?l.prototype:c instanceof o?s:null},ii}var si,Tc;function Oc(){if(Tc)return si;Tc=1;var e=Re(),r=ye(),t=Ve(),n=It(),a=oi(),i=Ke(),o=Te(),s=ar(),u=o("iterator"),c=!1,l,f,v;[].keys&&(v=[].keys(),"next"in v?(f=a(a(v)),f!==Object.prototype&&(l=f)):c=!0);var d=!t(l)||e(function(){var h={};return l[u].call(h)!==h});return d?l={}:s&&(l=n(l)),r(l[u])||i(l,u,function(){return this}),si={IteratorPrototype:l,BUGGY_SAFARI_ITERATORS:c},si}var ui,Cc;function Jr(){if(Cc)return ui;Cc=1;var e=cr().f,r=We(),t=Te(),n=t("toStringTag");return ui=function(a,i,o){a&&!o&&(a=a.prototype),a&&!r(a,n)&&e(a,n,{configurable:!0,value:i})},ui}var ci,_c;function Ac(){if(_c)return ci;_c=1;var e=Oc().IteratorPrototype,r=It(),t=Ar(),n=Jr(),a=Pt(),i=function(){return this};return ci=function(o,s,u,c){var l=s+" Iterator";return o.prototype=r(e,{next:t(+!c,u)}),n(o,l,!1,!0),a[l]=i,o},ci}var li,kc;function Zh(){if(kc)return li;kc=1;var e=pe(),r=Ze();return li=function(t,n,a){try{return e(r(Object.getOwnPropertyDescriptor(t,n)[a]))}catch{}},li}var fi,qc;function ep(){if(qc)return fi;qc=1;var e=Ve();return fi=function(r){return e(r)||r===null},fi}var di,$c;function rp(){if($c)return di;$c=1;var e=ep(),r=String,t=TypeError;return di=function(n){if(e(n))return n;throw new t("Can't set "+r(n)+" as a prototype")},di}var vi,Uc;function hi(){if(Uc)return vi;Uc=1;var e=Zh(),r=Ve(),t=Jt(),n=rp();return vi=Object.setPrototypeOf||("__proto__"in{}?(function(){var a=!1,i={},o;try{o=e(Object.prototype,"__proto__","set"),o(i,[]),a=i instanceof Array}catch{}return function(u,c){return t(u),n(c),r(u)&&(a?o(u,c):u.__proto__=c),u}})():void 0),vi}var pi,Lc;function Nc(){if(Lc)return pi;Lc=1;var e=Ie(),r=Ue(),t=ar(),n=lc(),a=ye(),i=Ac(),o=oi(),s=hi(),u=Jr(),c=kr(),l=Ke(),f=Te(),v=Pt(),d=Oc(),h=n.PROPER,p=n.CONFIGURABLE,S=d.IteratorPrototype,R=d.BUGGY_SAFARI_ITERATORS,I=f("iterator"),g="keys",b="values",y="entries",A=function(){return this};return pi=function($,j,G,K,re,N,M){i(G,j,K);var x=function(Y){if(Y===re&&w)return w;if(!R&&Y&&Y in L)return L[Y];switch(Y){case g:return function(){return new G(this,Y)};case b:return function(){return new G(this,Y)};case y:return function(){return new G(this,Y)}}return function(){return new G(this)}},m=j+" Iterator",C=!1,L=$.prototype,F=L[I]||L["@@iterator"]||re&&L[re],w=!R&&F||x(re),T=j==="Array"&&L.entries||F,k,H,J;if(T&&(k=o(T.call(new $)),k!==Object.prototype&&k.next&&(!t&&o(k)!==S&&(s?s(k,S):a(k[I])||l(k,I,A)),u(k,m,!0,!0),t&&(v[m]=A))),h&&re===b&&F&&F.name!==b&&(!t&&p?c(L,"name",b):(C=!0,w=function(){return r(F,this)})),re)if(H={values:x(b),keys:N?w:x(g),entries:x(y)},M)for(J in H)(R||C||!(J in L))&&l(L,J,H[J]);else e({target:j,proto:!0,forced:R||C},H);return(!t||M)&&L[I]!==w&&l(L,I,w,{name:re}),v[j]=w,H},pi}var mi,xc;function gi(){return xc||(xc=1,mi=function(e,r){return{value:e,done:r}}),mi}var yi,jc;function bi(){if(jc)return yi;jc=1;var e=bt(),r=Kh(),t=Pt(),n=Kr(),a=cr().f,i=Nc(),o=gi(),s=ar(),u=Oe(),c="Array Iterator",l=n.set,f=n.getterFor(c);yi=i(Array,"Array",function(d,h){l(this,{type:c,target:e(d),index:0,kind:h})},function(){var d=f(this),h=d.target,p=d.index++;if(!h||p>=h.length)return d.target=null,o(void 0,!0);switch(d.kind){case"keys":return o(p,!1);case"values":return o(h[p],!1)}return o([p,h[p]],!1)},"values");var v=t.Arguments=t.Array;if(r("keys"),r("values"),r("entries"),!s&&u&&v.name!=="values")try{a(v,"name",{value:"values"})}catch{}return yi}var Dc={},Mc;function tp(){if(Mc)return Dc;Mc=1;var e=Ie(),r=pe(),t=ju(),n=RangeError,a=String.fromCharCode,i=String.fromCodePoint,o=r([].join),s=!!i&&i.length!==1;return e({target:"String",stat:!0,arity:1,forced:s},{fromCodePoint:function(c){for(var l=[],f=arguments.length,v=0,d;f>v;){if(d=+arguments[v++],t(d,1114111)!==d)throw new n(d+" is not a valid code point");l[v]=d<65536?a(d):a(((d-=65536)>>10)+55296,d%1024+56320)}return o(l,"")}}),Dc}var wi,Fc;function Bc(){if(Fc)return wi;Fc=1;var e=me(),r=Oe(),t=Object.getOwnPropertyDescriptor;return wi=function(n){if(!r)return e[n];var a=t(e,n);return a&&a.value},wi}var Si,Hc;function en(){if(Hc)return Si;Hc=1;var e=Re(),r=Te(),t=Oe(),n=ar(),a=r("iterator");return Si=!e(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(c,l){o.delete("b"),u+=l+c}),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||!t)||!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"}),Si}var Ii,Gc;function rn(){if(Gc)return Ii;Gc=1;var e=vc(),r=cr();return Ii=function(t,n,a){return a.get&&e(a.get,n,{getter:!0}),a.set&&e(a.set,n,{setter:!0}),r.f(t,n,a)},Ii}var Pi,Wc;function np(){if(Wc)return Pi;Wc=1;var e=Ke();return Pi=function(r,t,n){for(var a in t)e(r,a,t[a],n);return r},Pi}var Ei,Vc;function Ri(){if(Vc)return Ei;Vc=1;var e=Xt(),r=TypeError;return Ei=function(t,n){if(e(n,t))return t;throw new r("Incorrect invocation")},Ei}var Ti,zc;function ap(){if(zc)return Ti;zc=1;var e=zt(),r=pe();return Ti=function(t){if(e(t)==="Function")return r(t)},Ti}var Oi,Kc;function Yr(){if(Kc)return Oi;Kc=1;var e=ap(),r=Ze(),t=Vt(),n=e(e.bind);return Oi=function(a,i){return r(a),i===void 0?a:t?n(a,i):function(){return a.apply(i,arguments)}},Oi}var Ci,Jc;function _i(){if(Jc)return Ci;Jc=1;var e=Te(),r=e("toStringTag"),t={};return t[r]="z",Ci=String(t)==="[object z]",Ci}var Ai,Yc;function Et(){if(Yc)return Ai;Yc=1;var e=_i(),r=ye(),t=zt(),n=Te(),a=n("toStringTag"),i=Object,o=t((function(){return arguments})())==="Arguments",s=function(u,c){try{return u[c]}catch{}};return Ai=e?t:function(u){var c,l,f;return u===void 0?"Undefined":u===null?"Null":typeof(l=s(c=i(u),a))=="string"?l:o?t(c):(f=t(c))==="Object"&&r(c.callee)?"Arguments":f},Ai}var ki,Qc;function lr(){if(Qc)return ki;Qc=1;var e=Et(),r=String;return ki=function(t){if(e(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return r(t)},ki}var qi,Xc;function tn(){if(Xc)return qi;Xc=1;var e=Et(),r=ga(),t=Kt(),n=Pt(),a=Te(),i=a("iterator");return qi=function(o){if(!t(o))return r(o,i)||r(o,"@@iterator")||n[e(o)]},qi}var $i,Zc;function Ui(){if(Zc)return $i;Zc=1;var e=Ue(),r=Ze(),t=Xe(),n=Zt(),a=tn(),i=TypeError;return $i=function(o,s){var u=arguments.length<2?a(o):s;if(r(u))return t(e(u,o));throw new i(n(o)+" is not iterable")},$i}var Li,el;function qr(){if(el)return Li;el=1;var e=TypeError;return Li=function(r,t){if(r<t)throw new e("Not enough arguments");return r},Li}var Ni,rl;function nn(){if(rl)return Ni;rl=1;var e=pe();return Ni=e([].slice),Ni}var xi,tl;function ip(){if(tl)return xi;tl=1;var e=nn(),r=Math.floor,t=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 c=r(i/2),l=t(e(n,0,c),a),f=t(e(n,c),a),v=l.length,d=f.length,h=0,p=0;h<v||p<d;)n[h+p]=h<v&&p<d?a(l[h],f[p])<=0?l[h++]:f[p++]:h<v?l[h++]:f[p++];return n};return xi=t,xi}var ji,nl;function al(){if(nl)return ji;nl=1,bi(),tp();var e=Ie(),r=me(),t=Bc(),n=ze(),a=Ue(),i=pe(),o=Oe(),s=en(),u=Ke(),c=rn(),l=np(),f=Jr(),v=Ac(),d=Kr(),h=Ri(),p=ye(),S=We(),R=Yr(),I=Et(),g=Xe(),b=Ve(),y=lr(),A=It(),$=Ar(),j=Ui(),G=tn(),K=gi(),re=qr(),N=Te(),M=ip(),x=N("iterator"),m="URLSearchParams",C=m+"Iterator",L=d.set,F=d.getterFor(m),w=d.getterFor(C),T=t("fetch"),k=t("Request"),H=t("Headers"),J=k&&k.prototype,Y=H&&H.prototype,le=r.TypeError,ne=r.encodeURIComponent,ue=String.fromCharCode,ae=n("String","fromCodePoint"),_e=parseInt,xe=i("".charAt),Be=i([].join),Le=i([].push),tr=i("".replace),Cr=i([].shift),_r=i([].splice),Hr=i("".split),Gr=i("".slice),Gt=i(/./.exec),vt=/\+/g,Wr="�",be=/^[0-9a-f]+$/i,nr=function(D,V){var z=Gr(D,V,V+2);return Gt(be,z)?_e(z,16):NaN},Vr=function(D){for(var V=0,z=128;z>0&&(D&z)!==0;z>>=1)V++;return V},B=function(D){var V=null;switch(D.length){case 1:V=D[0];break;case 2:V=(D[0]&31)<<6|D[1]&63;break;case 3:V=(D[0]&15)<<12|(D[1]&63)<<6|D[2]&63;break;case 4:V=(D[0]&7)<<18|(D[1]&63)<<12|(D[2]&63)<<6|D[3]&63;break}return V>1114111?null:V},X=function(D){D=tr(D,vt," ");for(var V=D.length,z="",Q=0;Q<V;){var ie=xe(D,Q);if(ie==="%"){if(xe(D,Q+1)==="%"||Q+3>V){z+="%",Q++;continue}var se=nr(D,Q+1);if(se!==se){z+=ie,Q++;continue}Q+=2;var ve=Vr(se);if(ve===0)ie=ue(se);else{if(ve===1||ve>4){z+=Wr,Q++;continue}for(var he=[se],Se=1;Se<ve&&(Q++,!(Q+3>V||xe(D,Q)!=="%"));){var Ne=nr(D,Q+1);if(Ne!==Ne){Q+=3;break}if(Ne>191||Ne<128)break;Le(he,Ne),Q+=2,Se++}if(he.length!==ve){z+=Wr;continue}var sr=B(he);sr===null?z+=Wr:ie=ae(sr)}}z+=ie,Q++}return z},oe=/[!'()~]|%20/g,ce={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},fe=function(D){return ce[D]},Ge=function(D){return tr(ne(D),oe,fe)},Ae=v(function(V,z){L(this,{type:C,target:F(V).entries,index:0,kind:z})},m,function(){var V=w(this),z=V.target,Q=V.index++;if(!z||Q>=z.length)return V.target=null,K(void 0,!0);var ie=z[Q];switch(V.kind){case"keys":return K(ie.key,!1);case"values":return K(ie.value,!1)}return K([ie.key,ie.value],!1)},!0),He=function(D){this.entries=[],this.url=null,D!==void 0&&(b(D)?this.parseObject(D):this.parseQuery(typeof D=="string"?xe(D,0)==="?"?Gr(D,1):D:y(D)))};He.prototype={type:m,bindURL:function(D){this.url=D,this.update()},parseObject:function(D){var V=this.entries,z=G(D),Q,ie,se,ve,he,Se,Ne;if(z)for(Q=j(D,z),ie=Q.next;!(se=a(ie,Q)).done;){if(ve=j(g(se.value)),he=ve.next,(Se=a(he,ve)).done||(Ne=a(he,ve)).done||!a(he,ve).done)throw new le("Expected sequence with length 2");Le(V,{key:y(Se.value),value:y(Ne.value)})}else for(var sr in D)S(D,sr)&&Le(V,{key:sr,value:y(D[sr])})},parseQuery:function(D){if(D)for(var V=this.entries,z=Hr(D,"&"),Q=0,ie,se;Q<z.length;)ie=z[Q++],ie.length&&(se=Hr(ie,"="),Le(V,{key:X(Cr(se)),value:X(Be(se,"="))}))},serialize:function(){for(var D=this.entries,V=[],z=0,Q;z<D.length;)Q=D[z++],Le(V,Ge(Q.key)+"="+Ge(Q.value));return Be(V,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ke=function(){h(this,Je);var V=arguments.length>0?arguments[0]:void 0,z=L(this,new He(V));o||(this.size=z.entries.length)},Je=ke.prototype;if(l(Je,{append:function(V,z){var Q=F(this);re(arguments.length,2),Le(Q.entries,{key:y(V),value:y(z)}),o||this.length++,Q.updateURL()},delete:function(D){for(var V=F(this),z=re(arguments.length,1),Q=V.entries,ie=y(D),se=z<2?void 0:arguments[1],ve=se===void 0?se:y(se),he=0;he<Q.length;){var Se=Q[he];if(Se.key===ie&&(ve===void 0||Se.value===ve)){if(_r(Q,he,1),ve!==void 0)break}else he++}o||(this.size=Q.length),V.updateURL()},get:function(V){var z=F(this).entries;re(arguments.length,1);for(var Q=y(V),ie=0;ie<z.length;ie++)if(z[ie].key===Q)return z[ie].value;return null},getAll:function(V){var z=F(this).entries;re(arguments.length,1);for(var Q=y(V),ie=[],se=0;se<z.length;se++)z[se].key===Q&&Le(ie,z[se].value);return ie},has:function(V){for(var z=F(this).entries,Q=re(arguments.length,1),ie=y(V),se=Q<2?void 0:arguments[1],ve=se===void 0?se:y(se),he=0;he<z.length;){var Se=z[he++];if(Se.key===ie&&(ve===void 0||Se.value===ve))return!0}return!1},set:function(V,z){var Q=F(this);re(arguments.length,1);for(var ie=Q.entries,se=!1,ve=y(V),he=y(z),Se=0,Ne;Se<ie.length;Se++)Ne=ie[Se],Ne.key===ve&&(se?_r(ie,Se--,1):(se=!0,Ne.value=he));se||Le(ie,{key:ve,value:he}),o||(this.size=ie.length),Q.updateURL()},sort:function(){var V=F(this);M(V.entries,function(z,Q){return z.key>Q.key?1:-1}),V.updateURL()},forEach:function(V){for(var z=F(this).entries,Q=R(V,arguments.length>1?arguments[1]:void 0),ie=0,se;ie<z.length;)se=z[ie++],Q(se.value,se.key,this)},keys:function(){return new Ae(this,"keys")},values:function(){return new Ae(this,"values")},entries:function(){return new Ae(this,"entries")}},{enumerable:!0}),u(Je,x,Je.entries,{name:"entries"}),u(Je,"toString",function(){return F(this).serialize()},{enumerable:!0}),o&&c(Je,"size",{get:function(){return F(this).entries.length},configurable:!0,enumerable:!0}),f(ke,m),e({global:!0,constructor:!0,forced:!s},{URLSearchParams:ke}),!s&&p(H)){var ht=i(Y.has),Wt=i(Y.set),pt=function(D){if(b(D)){var V=D.body,z;if(I(V)===m)return z=D.headers?new H(D.headers):new H,ht(z,"content-type")||Wt(z,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),A(D,{body:$(0,y(V)),headers:$(0,z)})}return D};if(p(T)&&e({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(V){return T(V,arguments.length>1?pt(arguments[1]):{})}}),p(k)){var mt=function(V){return h(this,J),new k(V,arguments.length>1?pt(arguments[1]):{})};J.constructor=mt,mt.prototype=J,e({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:mt})}}return ji={URLSearchParams:ke,getState:F},ji}var il;function op(){return il||(il=1,al()),Ds}var ol={},sl;function sp(){if(sl)return ol;sl=1;var e=Ke(),r=pe(),t=lr(),n=qr(),a=URLSearchParams,i=a.prototype,o=r(i.append),s=r(i.delete),u=r(i.forEach),c=r([].push),l=new a("a=1&a=2&b=3");return l.delete("a",1),l.delete("b",void 0),l+""!="a=2"&&e(i,"delete",function(f){var v=arguments.length,d=v<2?void 0:arguments[1];if(v&&d===void 0)return s(this,f);var h=[];u(this,function(A,$){c(h,{key:$,value:A})}),n(v,1);for(var p=t(f),S=t(d),R=0,I=0,g=!1,b=h.length,y;R<b;)y=h[R++],g||y.key===p?(g=!0,s(this,y.key)):I++;for(;I<b;)y=h[I++],y.key===p&&y.value===S||o(this,y.key,y.value)},{enumerable:!0,unsafe:!0}),ol}var ul={},cl;function up(){if(cl)return ul;cl=1;var e=Ke(),r=pe(),t=lr(),n=qr(),a=URLSearchParams,i=a.prototype,o=r(i.getAll),s=r(i.has),u=new a("a=1");return(u.has("a",2)||!u.has("a",void 0))&&e(i,"has",function(l){var f=arguments.length,v=f<2?void 0:arguments[1];if(f&&v===void 0)return s(this,l);var d=o(this,l);n(f,1);for(var h=t(v),p=0;p<d.length;)if(d[p++]===h)return!0;return!1},{enumerable:!0,unsafe:!0}),ul}var ll={},fl;function cp(){if(fl)return ll;fl=1;var e=Oe(),r=pe(),t=rn(),n=URLSearchParams.prototype,a=r(n.forEach);return e&&!("size"in n)&&t(n,"size",{get:function(){var o=0;return a(this,function(){o++}),o},configurable:!0,enumerable:!0}),ll}var Di,dl;function an(){if(dl)return Di;dl=1;var e=me();return Di=e,Di}var Mi,vl;function hl(){if(vl)return Mi;vl=1,op(),sp(),up(),cp();var e=an();return Mi=e.URLSearchParams,Mi}var pl={},ml={},gl={},Fi,yl;function bl(){if(yl)return Fi;yl=1;var e=pe(),r=Pa(),t=lr(),n=Jt(),a=e("".charAt),i=e("".charCodeAt),o=e("".slice),s=function(u){return function(c,l){var f=t(n(c)),v=r(l),d=f.length,h,p;return v<0||v>=d?u?"":void 0:(h=i(f,v),h<55296||h>56319||v+1===d||(p=i(f,v+1))<56320||p>57343?u?a(f,v):h:u?o(f,v,v+2):(h-55296<<10)+(p-56320)+65536)}};return Fi={codeAt:s(!1),charAt:s(!0)},Fi}var wl;function Sl(){if(wl)return gl;wl=1;var e=bl().charAt,r=lr(),t=Kr(),n=Nc(),a=gi(),i="String Iterator",o=t.set,s=t.getterFor(i);return n(String,"String",function(u){o(this,{type:i,string:r(u),index:0})},function(){var c=s(this),l=c.string,f=c.index,v;return f>=l.length?a(void 0,!0):(v=e(l,f),c.index+=v.length,a(v,!1))}),gl}var Bi,Il;function lp(){if(Il)return Bi;Il=1;var e=Oe(),r=pe(),t=Ue(),n=Re(),a=zu(),i=gc(),o=oc(),s=Yt(),u=Ws(),c=Object.assign,l=Object.defineProperty,f=r([].concat);return Bi=!c||n(function(){if(e&&c({b:1},c(l({},"a",{enumerable:!0,get:function(){l(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var v={},d={},h=Symbol("assign detection"),p="abcdefghijklmnopqrst";return v[h]=7,p.split("").forEach(function(S){d[S]=S}),c({},v)[h]!==7||a(c({},d)).join("")!==p})?function(d,h){for(var p=s(d),S=arguments.length,R=1,I=i.f,g=o.f;S>R;)for(var b=u(arguments[R++]),y=I?f(a(b),I(b)):a(b),A=y.length,$=0,j;A>$;)j=y[$++],(!e||t(g,b,j))&&(p[j]=b[j]);return p}:c,Bi}var Hi,Pl;function El(){if(Pl)return Hi;Pl=1;var e=Ue(),r=Xe(),t=ga();return Hi=function(n,a,i){var o,s;r(n);try{if(o=t(n,"return"),!o){if(a==="throw")throw i;return i}o=e(o,n)}catch(u){s=!0,o=u}if(a==="throw")throw i;if(s)throw o;return r(o),i},Hi}var Gi,Rl;function fp(){if(Rl)return Gi;Rl=1;var e=Xe(),r=El();return Gi=function(t,n,a,i){try{return i?n(e(a)[0],a[1]):n(a)}catch(o){r(t,"throw",o)}},Gi}var Wi,Tl;function Ol(){if(Tl)return Wi;Tl=1;var e=Te(),r=Pt(),t=e("iterator"),n=Array.prototype;return Wi=function(a){return a!==void 0&&(r.Array===a||n[t]===a)},Wi}var Vi,Cl;function _l(){if(Cl)return Vi;Cl=1;var e=pe(),r=Re(),t=ye(),n=Et(),a=ze(),i=Ya(),o=function(){},s=a("Reflect","construct"),u=/^\s*(?:class|function)\b/,c=e(u.exec),l=!u.test(o),f=function(h){if(!t(h))return!1;try{return s(o,[],h),!0}catch{return!1}},v=function(h){if(!t(h))return!1;switch(n(h)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return l||!!c(u,i(h))}catch{return!0}};return v.sham=!0,Vi=!s||r(function(){var d;return f(f.call)||!f(Object)||!f(function(){d=!0})||d})?v:f,Vi}var zi,Al;function dp(){if(Al)return zi;Al=1;var e=Oe(),r=cr(),t=Ar();return zi=function(n,a,i){e?r.f(n,a,t(0,i)):n[a]=i},zi}var Ki,kl;function vp(){if(kl)return Ki;kl=1;var e=Yr(),r=Ue(),t=Yt(),n=fp(),a=Ol(),i=_l(),o=Oa(),s=dp(),u=Ui(),c=tn(),l=Array;return Ki=function(v){var d=t(v),h=i(this),p=arguments.length,S=p>1?arguments[1]:void 0,R=S!==void 0;R&&(S=e(S,p>2?arguments[2]:void 0));var I=c(d),g=0,b,y,A,$,j,G;if(I&&!(this===l&&a(I)))for(y=h?new this:[],$=u(d,I),j=$.next;!(A=r(j,$)).done;g++)G=R?n($,S,[A.value,g],!0):A.value,s(y,g,G);else for(b=o(d),y=h?new this(b):l(b);b>g;g++)G=R?S(d[g],g):d[g],s(y,g,G);return y.length=g,y},Ki}var Ji,ql;function hp(){if(ql)return Ji;ql=1;var e=pe(),r=2147483647,t=36,n=1,a=26,i=38,o=700,s=72,u=128,c="-",l=/[^\0-\u007E]/,f=/[.\u3002\uFF0E\uFF61]/g,v="Overflow: input needs wider integers to process",d=t-n,h=RangeError,p=e(f.exec),S=Math.floor,R=String.fromCharCode,I=e("".charCodeAt),g=e([].join),b=e([].push),y=e("".replace),A=e("".split),$=e("".toLowerCase),j=function(N){for(var M=[],x=0,m=N.length;x<m;){var C=I(N,x++);if(C>=55296&&C<=56319&&x<m){var L=I(N,x++);(L&64512)===56320?b(M,((C&1023)<<10)+(L&1023)+65536):(b(M,C),x--)}else b(M,C)}return M},G=function(N){return N+22+75*(N<26)},K=function(N,M,x){var m=0;for(N=x?S(N/o):N>>1,N+=S(N/M);N>d*a>>1;)N=S(N/d),m+=t;return S(m+(d+1)*N/(N+i))},re=function(N){var M=[];N=j(N);var x=N.length,m=u,C=0,L=s,F,w;for(F=0;F<N.length;F++)w=N[F],w<128&&b(M,R(w));var T=M.length,k=T;for(T&&b(M,c);k<x;){var H=r;for(F=0;F<N.length;F++)w=N[F],w>=m&&w<H&&(H=w);var J=k+1;if(H-m>S((r-C)/J))throw new h(v);for(C+=(H-m)*J,m=H,F=0;F<N.length;F++){if(w=N[F],w<m&&++C>r)throw new h(v);if(w===m){for(var Y=C,le=t;;){var ne=le<=L?n:le>=L+a?a:le-L;if(Y<ne)break;var ue=Y-ne,ae=t-ne;b(M,R(G(ne+ue%ae))),Y=S(ue/ae),le+=t}b(M,R(G(Y))),L=K(C,J,k===T),C=0,k++}}C++,m++}return g(M,"")};return Ji=function(N){var M=[],x=A(y($(N),f,"."),"."),m,C;for(m=0;m<x.length;m++)C=x[m],b(M,p(l,C)?"xn--"+re(C):C);return g(M,".")},Ji}var $l;function pp(){if($l)return ml;$l=1,Sl();var e=Ie(),r=Oe(),t=en(),n=me(),a=Yr(),i=pe(),o=Ke(),s=rn(),u=Ri(),c=We(),l=lp(),f=vp(),v=nn(),d=bl().codeAt,h=hp(),p=lr(),S=Jr(),R=qr(),I=al(),g=Kr(),b=g.set,y=g.getterFor("URL"),A=I.URLSearchParams,$=I.getState,j=n.URL,G=n.TypeError,K=n.parseInt,re=Math.floor,N=Math.pow,M=i("".charAt),x=i(/./.exec),m=i([].join),C=i(1.1.toString),L=i([].pop),F=i([].push),w=i("".replace),T=i([].shift),k=i("".split),H=i("".slice),J=i("".toLowerCase),Y=i([].unshift),le="Invalid authority",ne="Invalid scheme",ue="Invalid host",ae="Invalid port",_e=/[a-z]/i,xe=/[\d+-.a-z]/i,Be=/\d/,Le=/^0x/i,tr=/^[0-7]+$/,Cr=/^\d+$/,_r=/^[\da-f]+$/i,Hr=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Gr=/[\0\t\n\r #/:<>?@[\\\]^|]/,Gt=/^[\u0000-\u0020]+/,vt=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,Wr=/[\t\n\r]/g,be,nr=function(E){var U=k(E,"."),O,P,_,te,W,we,Pe;if(U.length&&U[U.length-1]===""&&U.length--,O=U.length,O>4)return E;for(P=[],_=0;_<O;_++){if(te=U[_],te==="")return E;if(W=10,te.length>1&&M(te,0)==="0"&&(W=x(Le,te)?16:8,te=H(te,W===8?1:2)),te==="")we=0;else{if(!x(W===10?Cr:W===8?tr:_r,te))return E;we=K(te,W)}F(P,we)}for(_=0;_<O;_++)if(we=P[_],_===O-1){if(we>=N(256,5-O))return null}else if(we>255)return null;for(Pe=L(P),_=0;_<P.length;_++)Pe+=P[_]*N(256,3-_);return Pe},Vr=function(E){var U=[0,0,0,0,0,0,0,0],O=0,P=null,_=0,te,W,we,Pe,qe,Qe,q,Ee=function(){return M(E,_)};if(Ee()===":"){if(M(E,1)!==":")return;_+=2,O++,P=O}for(;Ee();){if(O===8)return;if(Ee()===":"){if(P!==null)return;_++,O++,P=O;continue}for(te=W=0;W<4&&x(_r,Ee());)te=te*16+K(Ee(),16),_++,W++;if(Ee()==="."){if(W===0||(_-=W,O>6))return;for(we=0;Ee();){if(Pe=null,we>0)if(Ee()==="."&&we<4)_++;else return;if(!x(Be,Ee()))return;for(;x(Be,Ee());){if(qe=K(Ee(),10),Pe===null)Pe=qe;else{if(Pe===0)return;Pe=Pe*10+qe}if(Pe>255)return;_++}U[O]=U[O]*256+Pe,we++,(we===2||we===4)&&O++}if(we!==4)return;break}else if(Ee()===":"){if(_++,!Ee())return}else if(Ee())return;U[O++]=te}if(P!==null)for(Qe=O-P,O=7;O!==0&&Qe>0;)q=U[O],U[O--]=U[P+Qe-1],U[P+--Qe]=q;else if(O!==8)return;return U},B=function(E){for(var U=null,O=1,P=null,_=0,te=0;te<8;te++)E[te]!==0?(_>O&&(U=P,O=_),P=null,_=0):(P===null&&(P=te),++_);return _>O?P:U},X=function(E){var U,O,P,_;if(typeof E=="number"){for(U=[],O=0;O<4;O++)Y(U,E%256),E=re(E/256);return m(U,".")}if(typeof E=="object"){for(U="",P=B(E),O=0;O<8;O++)_&&E[O]===0||(_&&(_=!1),P===O?(U+=O?":":"::",_=!0):(U+=C(E[O],16),O<7&&(U+=":")));return"["+U+"]"}return E},oe={},ce=l({},oe,{" ":1,'"':1,"<":1,">":1,"`":1}),fe=l({},ce,{"#":1,"?":1,"{":1,"}":1}),Ge=l({},fe,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Ae=function(E,U){var O=d(E,0);return O>32&&O<127&&!c(U,E)?E:encodeURIComponent(E)},He={ftp:21,file:null,http:80,https:443,ws:80,wss:443},ke=function(E,U){var O;return E.length===2&&x(_e,M(E,0))&&((O=M(E,1))===":"||!U&&O==="|")},Je=function(E){var U;return E.length>1&&ke(H(E,0,2))&&(E.length===2||(U=M(E,2))==="/"||U==="\\"||U==="?"||U==="#")},ht=function(E){return E==="."||J(E)==="%2e"},Wt=function(E){return E=J(E),E===".."||E==="%2e."||E===".%2e"||E==="%2e%2e"},pt={},mt={},D={},V={},z={},Q={},ie={},se={},ve={},he={},Se={},Ne={},sr={},$s={},Lh={},Us={},gt={},ur={},Nh={},zr={},br={},Ls=function(E,U,O){var P=p(E),_,te,W;if(U){if(te=this.parse(P),te)throw new G(te);this.searchParams=null}else{if(O!==void 0&&(_=new Ls(O,!0)),te=this.parse(P,null,_),te)throw new G(te);W=$(new A),W.bindURL(this),this.searchParams=W}};Ls.prototype={type:"URL",parse:function(E,U,O){var P=this,_=U||pt,te=0,W="",we=!1,Pe=!1,qe=!1,Qe,q,Ee,wr;for(E=p(E),U||(P.scheme="",P.username="",P.password="",P.host=null,P.port=null,P.path=[],P.query=null,P.fragment=null,P.cannotBeABaseURL=!1,E=w(E,Gt,""),E=w(E,vt,"$1")),E=w(E,Wr,""),Qe=f(E);te<=Qe.length;){switch(q=Qe[te],_){case pt:if(q&&x(_e,q))W+=J(q),_=mt;else{if(U)return ne;_=D;continue}break;case mt:if(q&&(x(xe,q)||q==="+"||q==="-"||q==="."))W+=J(q);else if(q===":"){if(U&&(P.isSpecial()!==c(He,W)||W==="file"&&(P.includesCredentials()||P.port!==null)||P.scheme==="file"&&!P.host))return;if(P.scheme=W,U){P.isSpecial()&&He[P.scheme]===P.port&&(P.port=null);return}W="",P.scheme==="file"?_=$s:P.isSpecial()&&O&&O.scheme===P.scheme?_=V:P.isSpecial()?_=se:Qe[te+1]==="/"?(_=z,te++):(P.cannotBeABaseURL=!0,F(P.path,""),_=Nh)}else{if(U)return ne;W="",_=D,te=0;continue}break;case D:if(!O||O.cannotBeABaseURL&&q!=="#")return ne;if(O.cannotBeABaseURL&&q==="#"){P.scheme=O.scheme,P.path=v(O.path),P.query=O.query,P.fragment="",P.cannotBeABaseURL=!0,_=br;break}_=O.scheme==="file"?$s:Q;continue;case V:if(q==="/"&&Qe[te+1]==="/")_=ve,te++;else{_=Q;continue}break;case z:if(q==="/"){_=he;break}else{_=ur;continue}case Q:if(P.scheme=O.scheme,q===be)P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,P.path=v(O.path),P.query=O.query;else if(q==="/"||q==="\\"&&P.isSpecial())_=ie;else if(q==="?")P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,P.path=v(O.path),P.query="",_=zr;else if(q==="#")P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,P.path=v(O.path),P.query=O.query,P.fragment="",_=br;else{P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,P.path=v(O.path),P.path.length--,_=ur;continue}break;case ie:if(P.isSpecial()&&(q==="/"||q==="\\"))_=ve;else if(q==="/")_=he;else{P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,_=ur;continue}break;case se:if(_=ve,q!=="/"||M(W,te+1)!=="/")continue;te++;break;case ve:if(q!=="/"&&q!=="\\"){_=he;continue}break;case he:if(q==="@"){we&&(W="%40"+W),we=!0,Ee=f(W);for(var Ns=0;Ns<Ee.length;Ns++){var Dh=Ee[Ns];if(Dh===":"&&!qe){qe=!0;continue}var Mh=Ae(Dh,Ge);qe?P.password+=Mh:P.username+=Mh}W=""}else if(q===be||q==="/"||q==="?"||q==="#"||q==="\\"&&P.isSpecial()){if(we&&W==="")return le;te-=f(W).length+1,W="",_=Se}else W+=q;break;case Se:case Ne:if(U&&P.scheme==="file"){_=Us;continue}else if(q===":"&&!Pe){if(W==="")return ue;if(wr=P.parseHost(W),wr)return wr;if(W="",_=sr,U===Ne)return}else if(q===be||q==="/"||q==="?"||q==="#"||q==="\\"&&P.isSpecial()){if(P.isSpecial()&&W==="")return ue;if(U&&W===""&&(P.includesCredentials()||P.port!==null))return;if(wr=P.parseHost(W),wr)return wr;if(W="",_=gt,U)return;continue}else q==="["?Pe=!0:q==="]"&&(Pe=!1),W+=q;break;case sr:if(x(Be,q))W+=q;else if(q===be||q==="/"||q==="?"||q==="#"||q==="\\"&&P.isSpecial()||U){if(W!==""){var xs=K(W,10);if(xs>65535)return ae;P.port=P.isSpecial()&&xs===He[P.scheme]?null:xs,W=""}if(U)return;_=gt;continue}else return ae;break;case $s:if(P.scheme="file",q==="/"||q==="\\")_=Lh;else if(O&&O.scheme==="file")switch(q){case be:P.host=O.host,P.path=v(O.path),P.query=O.query;break;case"?":P.host=O.host,P.path=v(O.path),P.query="",_=zr;break;case"#":P.host=O.host,P.path=v(O.path),P.query=O.query,P.fragment="",_=br;break;default:Je(m(v(Qe,te),""))||(P.host=O.host,P.path=v(O.path),P.shortenPath()),_=ur;continue}else{_=ur;continue}break;case Lh:if(q==="/"||q==="\\"){_=Us;break}O&&O.scheme==="file"&&!Je(m(v(Qe,te),""))&&(ke(O.path[0],!0)?F(P.path,O.path[0]):P.host=O.host),_=ur;continue;case Us:if(q===be||q==="/"||q==="\\"||q==="?"||q==="#"){if(!U&&ke(W))_=ur;else if(W===""){if(P.host="",U)return;_=gt}else{if(wr=P.parseHost(W),wr)return wr;if(P.host==="localhost"&&(P.host=""),U)return;W="",_=gt}continue}else W+=q;break;case gt:if(P.isSpecial()){if(_=ur,q!=="/"&&q!=="\\")continue}else if(!U&&q==="?")P.query="",_=zr;else if(!U&&q==="#")P.fragment="",_=br;else if(q!==be&&(_=ur,q!=="/"))continue;break;case ur:if(q===be||q==="/"||q==="\\"&&P.isSpecial()||!U&&(q==="?"||q==="#")){if(Wt(W)?(P.shortenPath(),q!=="/"&&!(q==="\\"&&P.isSpecial())&&F(P.path,"")):ht(W)?q!=="/"&&!(q==="\\"&&P.isSpecial())&&F(P.path,""):(P.scheme==="file"&&!P.path.length&&ke(W)&&(P.host&&(P.host=""),W=M(W,0)+":"),F(P.path,W)),W="",P.scheme==="file"&&(q===be||q==="?"||q==="#"))for(;P.path.length>1&&P.path[0]==="";)T(P.path);q==="?"?(P.query="",_=zr):q==="#"&&(P.fragment="",_=br)}else W+=Ae(q,fe);break;case Nh:q==="?"?(P.query="",_=zr):q==="#"?(P.fragment="",_=br):q!==be&&(P.path[0]+=Ae(q,oe));break;case zr:!U&&q==="#"?(P.fragment="",_=br):q!==be&&(q==="'"&&P.isSpecial()?P.query+="%27":q==="#"?P.query+="%23":P.query+=Ae(q,oe));break;case br:q!==be&&(P.fragment+=Ae(q,ce));break}te++}},parseHost:function(E){var U,O,P;if(M(E,0)==="["){if(M(E,E.length-1)!=="]"||(U=Vr(H(E,1,-1)),!U))return ue;this.host=U}else if(this.isSpecial()){if(E=h(E),x(Hr,E)||(U=nr(E),U===null))return ue;this.host=U}else{if(x(Gr,E))return ue;for(U="",O=f(E),P=0;P<O.length;P++)U+=Ae(O[P],oe);this.host=U}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return c(He,this.scheme)},shortenPath:function(){var E=this.path,U=E.length;U&&(this.scheme!=="file"||U!==1||!ke(E[0],!0))&&E.length--},serialize:function(){var E=this,U=E.scheme,O=E.username,P=E.password,_=E.host,te=E.port,W=E.path,we=E.query,Pe=E.fragment,qe=U+":";return _!==null?(qe+="//",E.includesCredentials()&&(qe+=O+(P?":"+P:"")+"@"),qe+=X(_),te!==null&&(qe+=":"+te)):U==="file"&&(qe+="//"),qe+=E.cannotBeABaseURL?W[0]:W.length?"/"+m(W,"/"):"",we!==null&&(qe+="?"+we),Pe!==null&&(qe+="#"+Pe),qe},setHref:function(E){var U=this.parse(E);if(U)throw new G(U);this.searchParams.update()},getOrigin:function(){var E=this.scheme,U=this.port;if(E==="blob")try{return new yt(E.path[0]).origin}catch{return"null"}return E==="file"||!this.isSpecial()?"null":E+"://"+X(this.host)+(U!==null?":"+U:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(E){this.parse(p(E)+":",pt)},getUsername:function(){return this.username},setUsername:function(E){var U=f(p(E));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var O=0;O<U.length;O++)this.username+=Ae(U[O],Ge)}},getPassword:function(){return this.password},setPassword:function(E){var U=f(p(E));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var O=0;O<U.length;O++)this.password+=Ae(U[O],Ge)}},getHost:function(){var E=this.host,U=this.port;return E===null?"":U===null?X(E):X(E)+":"+U},setHost:function(E){this.cannotBeABaseURL||this.parse(E,Se)},getHostname:function(){var E=this.host;return E===null?"":X(E)},setHostname:function(E){this.cannotBeABaseURL||this.parse(E,Ne)},getPort:function(){var E=this.port;return E===null?"":p(E)},setPort:function(E){this.cannotHaveUsernamePasswordPort()||(E=p(E),E===""?this.port=null:this.parse(E,sr))},getPathname:function(){var E=this.path;return this.cannotBeABaseURL?E[0]:E.length?"/"+m(E,"/"):""},setPathname:function(E){this.cannotBeABaseURL||(this.path=[],this.parse(E,gt))},getSearch:function(){var E=this.query;return E?"?"+E:""},setSearch:function(E){E=p(E),E===""?this.query=null:(M(E,0)==="?"&&(E=H(E,1)),this.query="",this.parse(E,zr)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var E=this.fragment;return E?"#"+E:""},setHash:function(E){if(E=p(E),E===""){this.fragment=null;return}M(E,0)==="#"&&(E=H(E,1)),this.fragment="",this.parse(E,br)},update:function(){this.query=this.searchParams.serialize()||null}};var yt=function(U){var O=u(this,je),P=R(arguments.length,1)>1?arguments[1]:void 0,_=b(O,new Ls(U,!1,P));r||(O.href=_.serialize(),O.origin=_.getOrigin(),O.protocol=_.getProtocol(),O.username=_.getUsername(),O.password=_.getPassword(),O.host=_.getHost(),O.hostname=_.getHostname(),O.port=_.getPort(),O.pathname=_.getPathname(),O.search=_.getSearch(),O.searchParams=_.getSearchParams(),O.hash=_.getHash())},je=yt.prototype,Ye=function(E,U){return{get:function(){return y(this)[E]()},set:U&&function(O){return y(this)[U](O)},configurable:!0,enumerable:!0}};if(r&&(s(je,"href",Ye("serialize","setHref")),s(je,"origin",Ye("getOrigin")),s(je,"protocol",Ye("getProtocol","setProtocol")),s(je,"username",Ye("getUsername","setUsername")),s(je,"password",Ye("getPassword","setPassword")),s(je,"host",Ye("getHost","setHost")),s(je,"hostname",Ye("getHostname","setHostname")),s(je,"port",Ye("getPort","setPort")),s(je,"pathname",Ye("getPathname","setPathname")),s(je,"search",Ye("getSearch","setSearch")),s(je,"searchParams",Ye("getSearchParams")),s(je,"hash",Ye("getHash","setHash"))),o(je,"toJSON",function(){return y(this).serialize()},{enumerable:!0}),o(je,"toString",function(){return y(this).serialize()},{enumerable:!0}),j){var xh=j.createObjectURL,jh=j.revokeObjectURL;xh&&o(yt,"createObjectURL",a(xh,j)),jh&&o(yt,"revokeObjectURL",a(jh,j))}return S(yt,"URL"),e({global:!0,constructor:!0,forced:!t,sham:!r},{URL:yt}),ml}var Ul;function mp(){return Ul||(Ul=1,pp()),pl}var Ll={},Nl;function gp(){if(Nl)return Ll;Nl=1;var e=Ie(),r=ze(),t=Re(),n=qr(),a=lr(),i=en(),o=r("URL"),s=i&&t(function(){o.canParse()}),u=t(function(){return o.canParse.length!==1});return e({target:"URL",stat:!0,forced:!s||u},{canParse:function(l){var f=n(arguments.length,1),v=a(l),d=f<2||arguments[1]===void 0?void 0:a(arguments[1]);try{return!!new o(v,d)}catch{return!1}}}),Ll}var xl={},jl;function yp(){if(jl)return xl;jl=1;var e=Ie(),r=ze(),t=qr(),n=lr(),a=en(),i=r("URL");return e({target:"URL",stat:!0,forced:!a},{parse:function(s){var u=t(arguments.length,1),c=n(s),l=u<2||arguments[1]===void 0?void 0:n(arguments[1]);try{return new i(c,l)}catch{return null}}}),xl}var Dl={},Ml;function bp(){if(Ml)return Dl;Ml=1;var e=Ie(),r=Ue();return e({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return r(URL.prototype.toString,this)}}),Dl}var Yi,Fl;function wp(){if(Fl)return Yi;Fl=1,hl(),mp(),gp(),yp(),bp();var e=an();return Yi=e.URL,Yi}var Qi,Bl;function Sp(){if(Bl)return Qi;Bl=1;var e=wp();return Qi=e,Qi}var Xi,Hl;function Ip(){if(Hl)return Xi;Hl=1;var e=Sp();return Xi=e,Xi}Ip();var Gl={},Zi,Wl;function Pp(){return Wl||(Wl=1,Zi={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}),Zi}var eo,Vl;function Ep(){if(Vl)return eo;Vl=1;var e=Qt(),r=e("span").classList,t=r&&r.constructor&&r.constructor.prototype;return eo=t===Object.prototype?void 0:t,eo}var zl;function Kl(){if(zl)return Gl;zl=1;var e=me(),r=Pp(),t=Ep(),n=bi(),a=kr(),i=Jr(),o=Te(),s=o("iterator"),u=n.values,c=function(f,v){if(f){if(f[s]!==u)try{a(f,s,u)}catch{f[s]=u}if(i(f,v,!0),r[v]){for(var d in n)if(f[d]!==n[d])try{a(f,d,n[d])}catch{f[d]=n[d]}}}};for(var l in r)c(e[l]&&e[l].prototype,l);return c(t,"DOMTokenList"),Gl}var ro,Jl;function Rp(){if(Jl)return ro;Jl=1;var e=hl();return Kl(),ro=e,ro}var to,Yl;function Tp(){if(Yl)return to;Yl=1;var e=Rp();return to=e,to}Tp();var Ql={},Xl={},no,Zl;function Op(){if(Zl)return no;Zl=1;var e=Ve(),r=kr();return no=function(t,n){e(n)&&"cause"in n&&r(t,"cause",n.cause)},no}var ao,ef;function Cp(){if(ef)return ao;ef=1;var e=pe(),r=Error,t=e("".replace),n=(function(o){return String(new r(o).stack)})("zxcasd"),a=/\n\s*at [^:]*:[^\n]*/,i=a.test(n);return ao=function(o,s){if(i&&typeof o=="string"&&!r.prepareStackTrace)for(;s--;)o=t(o,a,"");return o},ao}var io,rf;function _p(){if(rf)return io;rf=1;var e=Re(),r=Ar();return io=!e(function(){var t=new Error("a");return"stack"in t?(Object.defineProperty(t,"stack",r(1,7)),t.stack!==7):!0}),io}var oo,tf;function Ap(){if(tf)return oo;tf=1;var e=kr(),r=Cp(),t=_p(),n=Error.captureStackTrace;return oo=function(a,i,o,s){t&&(n?n(a,i):e(a,"stack",r(o,s)))},oo}var so,nf;function Rt(){if(nf)return so;nf=1;var e=Yr(),r=Ue(),t=Xe(),n=Zt(),a=Ol(),i=Oa(),o=Xt(),s=Ui(),u=tn(),c=El(),l=TypeError,f=function(d,h){this.stopped=d,this.result=h},v=f.prototype;return so=function(d,h,p){var S=p&&p.that,R=!!(p&&p.AS_ENTRIES),I=!!(p&&p.IS_RECORD),g=!!(p&&p.IS_ITERATOR),b=!!(p&&p.INTERRUPTED),y=e(h,S),A,$,j,G,K,re,N,M=function(m){return A&&c(A,"normal"),new f(!0,m)},x=function(m){return R?(t(m),b?y(m[0],m[1],M):y(m[0],m[1])):b?y(m,M):y(m)};if(I)A=d.iterator;else if(g)A=d;else{if($=u(d),!$)throw new l(n(d)+" is not iterable");if(a($)){for(j=0,G=i(d);G>j;j++)if(K=x(d[j]),K&&o(v,K))return K;return new f(!1)}A=s(d,$)}for(re=I?d.next:A.next;!(N=r(re,A)).done;){try{K=x(N.value)}catch(m){c(A,"throw",m)}if(typeof K=="object"&&K&&o(v,K))return K}return new f(!1)},so}var uo,af;function kp(){if(af)return uo;af=1;var e=lr();return uo=function(r,t){return r===void 0?arguments.length<2?"":t:e(r)},uo}var of;function qp(){if(of)return Xl;of=1;var e=Ie(),r=Xt(),t=oi(),n=hi(),a=wc(),i=It(),o=kr(),s=Ar(),u=Op(),c=Ap(),l=Rt(),f=kp(),v=Te(),d=v("toStringTag"),h=Error,p=[].push,S=function(g,b){var y=r(R,this),A;n?A=n(new h,y?t(this):R):(A=y?this:i(R),o(A,d,"Error")),b!==void 0&&o(A,"message",f(b)),c(A,S,A.stack,1),arguments.length>2&&u(A,arguments[2]);var $=[];return l(g,p,{that:$}),o(A,"errors",$),A};n?n(S,h):a(S,h,{name:!0});var R=S.prototype=i(h.prototype,{constructor:s(1,S),message:s(1,""),name:s(1,"AggregateError")});return e({global:!0,constructor:!0,arity:2},{AggregateError:S}),Xl}var sf;function $p(){return sf||(sf=1,qp()),Ql}var uf={},co,cf;function Up(){if(cf)return co;cf=1;var e=_i(),r=Et();return co=e?{}.toString:function(){return"[object "+r(this)+"]"},co}var lf;function Lp(){if(lf)return uf;lf=1;var e=_i(),r=Ke(),t=Up();return e||r(Object.prototype,"toString",t,{unsafe:!0}),uf}var ff={},df={},lo,vf;function hf(){if(vf)return lo;vf=1;var e=me(),r=St(),t=zt(),n=function(a){return r.slice(0,a.length)===a};return lo=(function(){return n("Bun/")?"BUN":n("Cloudflare-Workers")?"CLOUDFLARE":n("Deno/")?"DENO":n("Node.js/")?"NODE":e.Bun&&typeof Bun.version=="string"?"BUN":e.Deno&&typeof Deno.version=="object"?"DENO":t(e.process)==="process"?"NODE":e.window&&e.document?"BROWSER":"REST"})(),lo}var fo,pf;function vo(){if(pf)return fo;pf=1;var e=hf();return fo=e==="NODE",fo}var ho,mf;function Np(){if(mf)return ho;mf=1;var e=ze(),r=rn(),t=Te(),n=Oe(),a=t("species");return ho=function(i){var o=e(i);n&&o&&!o[a]&&r(o,a,{configurable:!0,get:function(){return this}})},ho}var po,gf;function xp(){if(gf)return po;gf=1;var e=_l(),r=Zt(),t=TypeError;return po=function(n){if(e(n))return n;throw new t(r(n)+" is not a constructor")},po}var mo,yf;function bf(){if(yf)return mo;yf=1;var e=Xe(),r=xp(),t=Kt(),n=Te(),a=n("species");return mo=function(i,o){var s=e(i).constructor,u;return s===void 0||t(u=e(s)[a])?o:r(u)},mo}var go,wf;function Sf(){if(wf)return go;wf=1;var e=Vt(),r=Function.prototype,t=r.apply,n=r.call;return go=typeof Reflect=="object"&&Reflect.apply||(e?n.bind(t):function(){return n.apply(t,arguments)}),go}var yo,If;function Pf(){if(If)return yo;If=1;var e=St();return yo=/(?:ipad|iphone|ipod).*applewebkit/i.test(e),yo}var bo,Ef;function Rf(){if(Ef)return bo;Ef=1;var e=me(),r=Sf(),t=Yr(),n=ye(),a=We(),i=Re(),o=Yu(),s=nn(),u=Qt(),c=qr(),l=Pf(),f=vo(),v=e.setImmediate,d=e.clearImmediate,h=e.process,p=e.Dispatch,S=e.Function,R=e.MessageChannel,I=e.String,g=0,b={},y="onreadystatechange",A,$,j,G;i(function(){A=e.location});var K=function(x){if(a(b,x)){var m=b[x];delete b[x],m()}},re=function(x){return function(){K(x)}},N=function(x){K(x.data)},M=function(x){e.postMessage(I(x),A.protocol+"//"+A.host)};return(!v||!d)&&(v=function(m){c(arguments.length,1);var C=n(m)?m:S(m),L=s(arguments,1);return b[++g]=function(){r(C,void 0,L)},$(g),g},d=function(m){delete b[m]},f?$=function(x){h.nextTick(re(x))}:p&&p.now?$=function(x){p.now(re(x))}:R&&!l?(j=new R,G=j.port2,j.port1.onmessage=N,$=t(G.postMessage,G)):e.addEventListener&&n(e.postMessage)&&!e.importScripts&&A&&A.protocol!=="file:"&&!i(M)?($=M,e.addEventListener("message",N,!1)):y in u("script")?$=function(x){o.appendChild(u("script"))[y]=function(){o.removeChild(this),K(x)}}:$=function(x){setTimeout(re(x),0)}),bo={set:v,clear:d},bo}var wo,Tf;function Of(){if(Tf)return wo;Tf=1;var e=function(){this.head=null,this.tail=null};return e.prototype={add:function(r){var t={item:r,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var r=this.head;if(r){var t=this.head=r.next;return t===null&&(this.tail=null),r.item}}},wo=e,wo}var So,Cf;function jp(){if(Cf)return So;Cf=1;var e=St();return So=/ipad|iphone|ipod/i.test(e)&&typeof Pebble<"u",So}var Io,_f;function Dp(){if(_f)return Io;_f=1;var e=St();return Io=/web0s(?!.*chrome)/i.test(e),Io}var Po,Af;function Mp(){if(Af)return Po;Af=1;var e=me(),r=Bc(),t=Yr(),n=Rf().set,a=Of(),i=Pf(),o=jp(),s=Dp(),u=vo(),c=e.MutationObserver||e.WebKitMutationObserver,l=e.document,f=e.process,v=e.Promise,d=r("queueMicrotask"),h,p,S,R,I;if(!d){var g=new a,b=function(){var y,A;for(u&&(y=f.domain)&&y.exit();A=g.get();)try{A()}catch($){throw g.head&&h(),$}y&&y.enter()};!i&&!u&&!s&&c&&l?(p=!0,S=l.createTextNode(""),new c(b).observe(S,{characterData:!0}),h=function(){S.data=p=!p}):!o&&v&&v.resolve?(R=v.resolve(void 0),R.constructor=v,I=t(R.then,R),h=function(){I(b)}):u?h=function(){f.nextTick(b)}:(n=t(n,e),h=function(){n(b)}),d=function(y){g.head||h(),g.add(y)}}return Po=d,Po}var Eo,kf;function Fp(){return kf||(kf=1,Eo=function(e,r){try{arguments.length===1?console.error(e):console.error(e,r)}catch{}}),Eo}var Ro,qf;function Qr(){return qf||(qf=1,Ro=function(e){try{return{error:!1,value:e()}}catch(r){return{error:!0,value:r}}}),Ro}var To,$f;function Xr(){if($f)return To;$f=1;var e=me();return To=e.Promise,To}var Oo,Uf;function Tt(){if(Uf)return Oo;Uf=1;var e=me(),r=Xr(),t=ye(),n=Ic(),a=Ya(),i=Te(),o=hf(),s=ar(),u=su(),c=r&&r.prototype,l=i("species"),f=!1,v=t(e.PromiseRejectionEvent),d=n("Promise",function(){var h=a(r),p=h!==String(r);if(!p&&u===66||s&&!(c.catch&&c.finally))return!0;if(!u||u<51||!/native code/.test(h)){var S=new r(function(g){g(1)}),R=function(g){g(function(){},function(){})},I=S.constructor={};if(I[l]=R,f=S.then(function(){})instanceof R,!f)return!0}return!p&&(o==="BROWSER"||o==="DENO")&&!v});return Oo={CONSTRUCTOR:d,REJECTION_EVENT:v,SUBCLASSING:f},Oo}var Co={},Lf;function fr(){if(Lf)return Co;Lf=1;var e=Ze(),r=TypeError,t=function(n){var a,i;this.promise=new n(function(o,s){if(a!==void 0||i!==void 0)throw new r("Bad Promise constructor");a=o,i=s}),this.resolve=e(a),this.reject=e(i)};return Co.f=function(n){return new t(n)},Co}var Nf;function Bp(){if(Nf)return df;Nf=1;var e=Ie(),r=ar(),t=vo(),n=me(),a=an(),i=Ue(),o=Ke(),s=hi(),u=Jr(),c=Np(),l=Ze(),f=ye(),v=Ve(),d=Ri(),h=bf(),p=Rf().set,S=Mp(),R=Fp(),I=Qr(),g=Of(),b=Kr(),y=Xr(),A=Tt(),$=fr(),j="Promise",G=A.CONSTRUCTOR,K=A.REJECTION_EVENT,re=A.SUBCLASSING,N=b.getterFor(j),M=b.set,x=y&&y.prototype,m=y,C=x,L=n.TypeError,F=n.document,w=n.process,T=$.f,k=T,H=!!(F&&F.createEvent&&n.dispatchEvent),J="unhandledrejection",Y="rejectionhandled",le=0,ne=1,ue=2,ae=1,_e=2,xe,Be,Le,tr,Cr=function(B){var X;return v(B)&&f(X=B.then)?X:!1},_r=function(B,X){var oe=X.value,ce=X.state===ne,fe=ce?B.ok:B.fail,Ge=B.resolve,Ae=B.reject,He=B.domain,ke,Je,ht;try{fe?(ce||(X.rejection===_e&&Wr(X),X.rejection=ae),fe===!0?ke=oe:(He&&He.enter(),ke=fe(oe),He&&(He.exit(),ht=!0)),ke===B.promise?Ae(new L("Promise-chain cycle")):(Je=Cr(ke))?i(Je,ke,Ge,Ae):Ge(ke)):Ae(oe)}catch(Wt){He&&!ht&&He.exit(),Ae(Wt)}},Hr=function(B,X){B.notified||(B.notified=!0,S(function(){for(var oe=B.reactions,ce;ce=oe.get();)_r(ce,B);B.notified=!1,X&&!B.rejection&&Gt(B)}))},Gr=function(B,X,oe){var ce,fe;H?(ce=F.createEvent("Event"),ce.promise=X,ce.reason=oe,ce.initEvent(B,!1,!0),n.dispatchEvent(ce)):ce={promise:X,reason:oe},!K&&(fe=n["on"+B])?fe(ce):B===J&&R("Unhandled promise rejection",oe)},Gt=function(B){i(p,n,function(){var X=B.facade,oe=B.value,ce=vt(B),fe;if(ce&&(fe=I(function(){t?w.emit("unhandledRejection",oe,X):Gr(J,X,oe)}),B.rejection=t||vt(B)?_e:ae,fe.error))throw fe.value})},vt=function(B){return B.rejection!==ae&&!B.parent},Wr=function(B){i(p,n,function(){var X=B.facade;t?w.emit("rejectionHandled",X):Gr(Y,X,B.value)})},be=function(B,X,oe){return function(ce){B(X,ce,oe)}},nr=function(B,X,oe){B.done||(B.done=!0,oe&&(B=oe),B.value=X,B.state=ue,Hr(B,!0))},Vr=function(B,X,oe){if(!B.done){B.done=!0,oe&&(B=oe);try{if(B.facade===X)throw new L("Promise can't be resolved itself");var ce=Cr(X);ce?S(function(){var fe={done:!1};try{i(ce,X,be(Vr,fe,B),be(nr,fe,B))}catch(Ge){nr(fe,Ge,B)}}):(B.value=X,B.state=ne,Hr(B,!1))}catch(fe){nr({done:!1},fe,B)}}};if(G&&(m=function(X){d(this,C),l(X),i(xe,this);var oe=N(this);try{X(be(Vr,oe),be(nr,oe))}catch(ce){nr(oe,ce)}},C=m.prototype,xe=function(X){M(this,{type:j,done:!1,notified:!1,parent:!1,reactions:new g,rejection:!1,state:le,value:null})},xe.prototype=o(C,"then",function(X,oe){var ce=N(this),fe=T(h(this,m));return ce.parent=!0,fe.ok=f(X)?X:!0,fe.fail=f(oe)&&oe,fe.domain=t?w.domain:void 0,ce.state===le?ce.reactions.add(fe):S(function(){_r(fe,ce)}),fe.promise}),Be=function(){var B=new xe,X=N(B);this.promise=B,this.resolve=be(Vr,X),this.reject=be(nr,X)},$.f=T=function(B){return B===m||B===Le?new Be(B):k(B)},!r&&f(y)&&x!==Object.prototype)){tr=x.then,re||o(x,"then",function(X,oe){var ce=this;return new m(function(fe,Ge){i(tr,ce,fe,Ge)}).then(X,oe)},{unsafe:!0});try{delete x.constructor}catch{}s&&s(x,C)}return e({global:!0,constructor:!0,wrap:!0,forced:G},{Promise:m}),Le=a.Promise,u(m,j,!1,!0),c(j),df}var xf={},_o,jf;function Hp(){if(jf)return _o;jf=1;var e=Te(),r=e("iterator"),t=!1;try{var n=0,a={next:function(){return{done:!!n++}},return:function(){t=!0}};a[r]=function(){return this},Array.from(a,function(){throw 2})}catch{}return _o=function(i,o){try{if(!o&&!t)return!1}catch{return!1}var s=!1;try{var u={};u[r]=function(){return{next:function(){return{done:s=!0}}}},i(u)}catch{}return s},_o}var Ao,Df;function on(){if(Df)return Ao;Df=1;var e=Xr(),r=Hp(),t=Tt().CONSTRUCTOR;return Ao=t||!r(function(n){e.all(n).then(void 0,function(){})}),Ao}var Mf;function Gp(){if(Mf)return xf;Mf=1;var e=Ie(),r=Ue(),t=Ze(),n=fr(),a=Qr(),i=Rt(),o=on();return e({target:"Promise",stat:!0,forced:o},{all:function(u){var c=this,l=n.f(c),f=l.resolve,v=l.reject,d=a(function(){var h=t(c.resolve),p=[],S=0,R=1;i(u,function(I){var g=S++,b=!1;R++,r(h,c,I).then(function(y){b||(b=!0,p[g]=y,--R||f(p))},v)}),--R||f(p)});return d.error&&v(d.value),l.promise}}),xf}var Ff={},Bf;function Wp(){if(Bf)return Ff;Bf=1;var e=Ie(),r=ar(),t=Tt().CONSTRUCTOR,n=Xr(),a=ze(),i=ye(),o=Ke(),s=n&&n.prototype;if(e({target:"Promise",proto:!0,forced:t,real:!0},{catch:function(c){return this.then(void 0,c)}}),!r&&i(n)){var u=a("Promise").prototype.catch;s.catch!==u&&o(s,"catch",u,{unsafe:!0})}return Ff}var Hf={},Gf;function Vp(){if(Gf)return Hf;Gf=1;var e=Ie(),r=Ue(),t=Ze(),n=fr(),a=Qr(),i=Rt(),o=on();return e({target:"Promise",stat:!0,forced:o},{race:function(u){var c=this,l=n.f(c),f=l.reject,v=a(function(){var d=t(c.resolve);i(u,function(h){r(d,c,h).then(l.resolve,f)})});return v.error&&f(v.value),l.promise}}),Hf}var Wf={},Vf;function zp(){if(Vf)return Wf;Vf=1;var e=Ie(),r=fr(),t=Tt().CONSTRUCTOR;return e({target:"Promise",stat:!0,forced:t},{reject:function(a){var i=r.f(this),o=i.reject;return o(a),i.promise}}),Wf}var zf={},ko,Kf;function Jf(){if(Kf)return ko;Kf=1;var e=Xe(),r=Ve(),t=fr();return ko=function(n,a){if(e(n),r(a)&&a.constructor===n)return a;var i=t.f(n),o=i.resolve;return o(a),i.promise},ko}var Yf;function Kp(){if(Yf)return zf;Yf=1;var e=Ie(),r=ze(),t=ar(),n=Xr(),a=Tt().CONSTRUCTOR,i=Jf(),o=r("Promise"),s=t&&!a;return e({target:"Promise",stat:!0,forced:t||a},{resolve:function(c){return i(s&&this===o?n:this,c)}}),zf}var Qf;function Jp(){return Qf||(Qf=1,Bp(),Gp(),Wp(),Vp(),zp(),Kp()),ff}var Xf={},Zf;function Yp(){if(Zf)return Xf;Zf=1;var e=Ie(),r=Ue(),t=Ze(),n=fr(),a=Qr(),i=Rt(),o=on();return e({target:"Promise",stat:!0,forced:o},{allSettled:function(u){var c=this,l=n.f(c),f=l.resolve,v=l.reject,d=a(function(){var h=t(c.resolve),p=[],S=0,R=1;i(u,function(I){var g=S++,b=!1;R++,r(h,c,I).then(function(y){b||(b=!0,p[g]={status:"fulfilled",value:y},--R||f(p))},function(y){b||(b=!0,p[g]={status:"rejected",reason:y},--R||f(p))})}),--R||f(p)});return d.error&&v(d.value),l.promise}}),Xf}var ed={},rd;function Qp(){if(rd)return ed;rd=1;var e=Ie(),r=Ue(),t=Ze(),n=ze(),a=fr(),i=Qr(),o=Rt(),s=on(),u="No one promise resolved";return e({target:"Promise",stat:!0,forced:s},{any:function(l){var f=this,v=n("AggregateError"),d=a.f(f),h=d.resolve,p=d.reject,S=i(function(){var R=t(f.resolve),I=[],g=0,b=1,y=!1;o(l,function(A){var $=g++,j=!1;b++,r(R,f,A).then(function(G){j||y||(y=!0,h(G))},function(G){j||y||(j=!0,I[$]=G,--b||p(new v(I,u)))})}),--b||p(new v(I,u))});return S.error&&p(S.value),d.promise}}),ed}var td={},nd;function ad(){if(nd)return td;nd=1;var e=Ie(),r=me(),t=Sf(),n=nn(),a=fr(),i=Ze(),o=Qr(),s=r.Promise,u=!1,c=!s||!s.try||o(function(){s.try(function(l){u=l===8},8)}).error||!u;return e({target:"Promise",stat:!0,forced:c},{try:function(l){var f=arguments.length>1?n(arguments,1):[],v=a.f(this),d=o(function(){return t(i(l),void 0,f)});return(d.error?v.reject:v.resolve)(d.value),v.promise}}),td}var id={},od;function sd(){if(od)return id;od=1;var e=Ie(),r=fr();return e({target:"Promise",stat:!0},{withResolvers:function(){var n=r.f(this);return{promise:n.promise,resolve:n.resolve,reject:n.reject}}}),id}var ud={},cd;function Xp(){if(cd)return ud;cd=1;var e=Ie(),r=ar(),t=Xr(),n=Re(),a=ze(),i=ye(),o=bf(),s=Jf(),u=Ke(),c=t&&t.prototype,l=!!t&&n(function(){c.finally.call({then:function(){}},function(){})});if(e({target:"Promise",proto:!0,real:!0,forced:l},{finally:function(v){var d=o(this,a("Promise")),h=i(v);return this.then(h?function(p){return s(d,v()).then(function(){return p})}:v,h?function(p){return s(d,v()).then(function(){throw p})}:v)}}),!r&&i(t)){var f=a("Promise").prototype.finally;c.finally!==f&&u(c,"finally",f,{unsafe:!0})}return ud}var qo,ld;function Zp(){if(ld)return qo;ld=1,$p(),bi(),Lp(),Jp(),Yp(),Qp(),ad(),sd(),Xp(),Sl();var e=an();return qo=e.Promise,qo}var $o,fd;function em(){if(fd)return $o;fd=1;var e=Zp();return Kl(),$o=e,$o}var dd={},vd;function rm(){return vd||(vd=1,ad()),dd}var hd={},pd;function tm(){return pd||(pd=1,sd()),hd}var Uo,md;function nm(){if(md)return Uo;md=1;var e=em();return rm(),tm(),Uo=e,Uo}nm();const gd="sesamy-debug";function am(e,r,t){const n=new Date;n.setTime(n.getTime()+t*60*60*1e3);const a="expires="+n.toUTCString();document.cookie=`${e}=${r}; ${a}; path=/`}function im(e){if(typeof document>"u")return null;const r=e+"=",t=document.cookie.split(";");for(let n=0;n<t.length;n++){let a=t[n];for(;a.charAt(0)===" ";)a=a.substring(1);if(a.indexOf(r)===0)return a.substring(r.length,a.length)}return null}function om(e){am(gd,e.toString(),1)}function sm(){return im(gd)==="true"}function de(e){sm()&&console.log(e)}function $r(e,r){if(typeof window>"u")return;const t=new CustomEvent(e,{detail:r,bubbles:!0,composed:!0});de(`Triggering event: ${e}`),dispatchEvent(t)}const um=Object.freeze(Object.defineProperty({__proto__:null,triggerEvent:$r},Symbol.toStringTag,{value:"Module"}));let yd=null;function Lo(e){yd=e}function bd(){return yd}var er=(e=>(e.AUTH_INITIALIZED="sesamyJsAuthInitialized",e.READY="sesamyJsReady",e.AUTHENTICATED="sesamyJsAuthenticated",e.LOGOUT="sesamyJsLogout",e.CLEAR_CACHE="sesamyJsClearCache",e.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",e.PURCHASE="sesamyJsPurchase",e))(er||{});const cm=Object.freeze(Object.defineProperty({__proto__:null,Events:er},Symbol.toStringTag,{value:"Module"})),wd="sesamy_is_authenticated";function lm(){try{return document.cookie.split(";").some(e=>e.trim().startsWith(`${wd}=true`))}catch{return!1}}function No(e){try{const r=e?2592e3:0,t=window.location.protocol==="https:"?"; Secure":"";document.cookie=`${wd}=${e}; path=/; max-age=${r}; SameSite=Lax${t}`}catch{}}function fm(e={}){let r=e.baseUrl??"",t="",n=!1,a=null,i=null;async function o(){try{const u=await fetch(`${r}/auth/userinfo`,{credentials:"include",headers:{Accept:"application/json"}});return u.ok?await u.json():null}catch(u){return de(`[cookie-auth] Failed to fetch userinfo: ${u.message}`),null}}const s={async init(u){if(t=u.vendorId||u.clientId||"",de(`[cookie-auth] Initializing with baseUrl: ${r}`),lm()){const c=await o();c===null?de("[cookie-auth] userinfo fetch failed transiently; retaining session hint"):c.authenticated&&c.sub?(a=!0,i=c,No(!0),$r(er.AUTHENTICATED,{sub:c.sub,appState:void 0})):(a=!1,No(!1))}else a=!1;n=!0,$r(er.AUTH_INITIALIZED,{})},async isAuthenticated(){if(!n)return!1;if(a!==null)return a;const u=await o();return u===null?(de("[cookie-auth] userinfo fetch failed transiently in isAuthenticated; will retry"),!1):(a=u.authenticated,a)},async getTokenSilently(u,c){return null},async getUser(){if(!n)return null;if(i)return i;const u=await o();return u?.authenticated&&u.sub?(i=u,i):null},async login(u){if(!t)throw new Error("[cookie-auth] vendorId is required to build a login URL");const c=u?.returnTo??window.location.href,l=new URL(`${r}/auth/${encodeURIComponent(t)}/login`,window.location.origin);l.searchParams.set("return_to",c),window.location.href=l.toString()},async loginWithRedirect(u){return s.login(u)},async loginWithPopup(u){return de("[cookie-auth] loginWithPopup called — falling back to redirect"),s.login(u)},async logout(u){a=!1,i=null,No(!1),$r(er.LOGOUT,{});const c=u?.returnTo??window.location.href,l=new URL(`${r}/auth/logout`,window.location.origin);l.searchParams.set("return_to",c),u?.localOnly&&l.searchParams.set("local_only","true"),window.location.href=l.toString()}};return s}const dm="sesamyAccessToken";let Ot=!1;function Sr(){const e=bd();if(!e)throw new Error("[sesamy-js] No auth plugin registered. This should not happen.");return e}async function vm(e){if(e.enabled===!1){de("Auth disabled via config"),Ot=!0;return}if(e.useHttpCookies)de("useHttpCookies=true — using cookie-based BFF plugin"),Lo(fm());else if(!bd())throw new Error("[sesamy-js] No auth plugin registered. Load the auth0-plugin bundle before sesamy-js, or set useHttpCookies: true to use the cookie-based BFF plugin.");await Sr().init(e),Ot=!0}async function dr(){return Ot?Sr().isAuthenticated():!1}async function vr(e=!0,r=!1){return Ot?Sr().getTokenSilently(e,r):null}async function hm(){return Ot?Sr().getUser():null}async function pm(e){return Sr().login(e)}async function xo(e){return Sr().loginWithRedirect(e)}async function mm(e){return Sr().loginWithPopup(e)}async function gm(e={}){return Sr().logout(e)}async function jo(e){const r=e.split(".");if(r.length!==3)throw new Error("Invalid token");const t=decodeURIComponent(atob(r[1].replace(/-/g,"+").replace(/_/g,"/")).split("").map(o=>"%"+("00"+o.charCodeAt(0).toString(16)).slice(-2)).join("")),n=JSON.parse(t);if(!n?.exp||n.exp<Date.now()/1e3)throw new Error("Invalid token");de("Set token"),localStorage.setItem(dm,e);const{triggerEvent:a}=await Promise.resolve().then(()=>um),{Events:i}=await Promise.resolve().then(()=>cm);a(i.AUTHENTICATED,{...n,appState:void 0})}const ym=(e,r)=>r.skipDedupe||r.method!=="GET",bm=(e,r)=>r.method+"@"+e,wm=e=>e.clone(),Sm=({skip:e=ym,key:r=bm,resolver:t=wm}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const s=r(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,c)=>{n.get(s).push([u,c])});try{return a(i,o).then(u=>(n.get(s).forEach(([c])=>c(t(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,c])=>c(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},Im=(e,r)=>e*r,Pm=e=>e&&e.ok,Em=({delayTimer:e=500,delayRamp:r=Im,maxAttempts:t=10,until:n=Pm,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(c,l)=>{let f=0;if(s&&s(c,l))return u(c,l);const v=(d,h)=>Promise.resolve(n(d,h)).then(p=>p?d&&o?d:h?Promise.reject(h):d:(f++,!t||f<=t?new Promise(S=>{const R=r(e,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:h,url:c,options:l})).then((I={})=>{var g,b;S(u((g=I&&I.url)!==null&&g!==void 0?g:c,(b=I&&I.options)!==null&&b!==void 0?b:l))}):S(u(c,l))},R)}).then(v).catch(S=>{if(!i)throw S;return v(null,S)}):d&&o?d:Promise.reject(h||new Error("Number of attempts exceeded."))));return u(c,l).then(v).catch(d=>{if(!i)throw d;return v(null,d)})};let Do=class Fh extends Error{status;statusText;url;body;constructor(r,t,n,a,i){super(a),this.name="APIError",this.status=r,this.statusText=t,this.url=n,this.body=i,Error.captureStackTrace&&Error.captureStackTrace(this,Fh)}isClientError(){return this.status>=400&&this.status<500}isServerError(){return this.status>=500}isForbiddenError(){return this.status===403}isNotFoundError(){return this.status===404}};var sn=(e=>(e.BROWSER="browser",e.NORMAL="normal",e))(sn||{});const Rm="application/json",Sd="Content-Type",Zr=Symbol(),Id=Symbol();function Pd(e={}){var r;const t=e instanceof Array?Object.fromEntries(e):e;return(r=Object.entries(t).find(([n])=>n.toLowerCase()===Sd.toLowerCase()))===null||r===void 0?void 0:r[1]}function Ed(e){return/^application\/.*json.*/.test(e)}const Ur=function(e,r,t=!1){return Object.entries(r).reduce((n,[a,i])=>{const o=e[a];return Array.isArray(o)&&Array.isArray(i)?n[a]=t?[...o,...i]:i:typeof o=="object"&&typeof i=="object"?n[a]=Ur(o,i,t):n[a]=i,n},{...e})},et={options:{},errorType:"text",polyfills:{},polyfill(e,r=!0,t=!1,...n){const a=this.polyfills[e]||(typeof self<"u"?self[e]:null)||(typeof global<"u"?global[e]:null);if(r&&!a)throw new Error(e+" is not defined");return t&&a?new a(...n):a}};function Tm(e,r=!1){et.options=r?e:Ur(et.options,e)}function Om(e,r=!1){et.polyfills=r?e:Ur(et.polyfills,e)}function Cm(e){et.errorType=e}const _m=e=>r=>e.reduceRight((t,n)=>n(t),r)||r;let Rd=class extends Error{};const Am=e=>{const r=Object.create(null);e=e._addons.reduce((g,b)=>b.beforeRequest&&b.beforeRequest(g,e._options,r)||g,e);const{_url:t,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:u}=e,c=new Map(i),l=Ur(a.options,n);let f=t;const v=_m(s)((g,b)=>(f=g,a.polyfill("fetch")(g,b)))(t,l),d=new Error,h=v.catch(g=>{throw{[Zr]:g}}).then(g=>{var b;if(!g.ok){const y=new Rd;if(y.cause=d,y.stack=y.stack+`
2
+ CAUSE: `+d.stack,y.response=g,y.status=g.status,y.url=f,g.type==="opaque")throw y;const A=a.errorType==="json"||((b=g.headers.get("Content-Type"))===null||b===void 0?void 0:b.split(";")[0])==="application/json";return(a.errorType?A?g.text():g[a.errorType]():Promise.resolve(g.body)).then($=>{if(y.message=typeof $=="string"?$:g.statusText,$)if(A&&typeof $=="string"){y.text=$;try{y.json=JSON.parse($)}catch{}}else y[a.errorType]=$;throw y})}return g}),p=g=>g.catch(b=>{const y=Object.prototype.hasOwnProperty.call(b,Zr),A=y?b[Zr]:b,$=A?.status&&c.get(A.status)||c.get(A?.name)||y&&c.has(Zr)&&c.get(Zr);if($)return $(A,e);const j=c.get(Id);if(j)return j(A,e);throw A}),S=g=>b=>p(g?h.then(y=>y&&y[g]()).then(y=>b?b(y):y):h.then(y=>b?b(y):y)),R={_wretchReq:e,_fetchReq:v,_sharedState:r,res:S(null),json:S("json"),blob:S("blob"),formData:S("formData"),arrayBuffer:S("arrayBuffer"),text:S("text"),error(g,b){return c.set(g,b),this},badRequest(g){return this.error(400,g)},unauthorized(g){return this.error(401,g)},forbidden(g){return this.error(403,g)},notFound(g){return this.error(404,g)},timeout(g){return this.error(408,g)},internalError(g){return this.error(500,g)},fetchError(g){return this.error(Zr,g)}},I=u.reduce((g,b)=>({...g,...typeof b.resolver=="function"?b.resolver(g):b.resolver}),R);return o.reduce((g,b)=>b(g,e),I)},km={_url:"",_options:{},_config:et,_catchers:new Map,_resolvers:[],_deferred:[],_middlewares:[],_addons:[],addon(e){return{...this,_addons:[...this._addons,e],...e.wretch}},errorType(e){return{...this,_config:{...this._config,errorType:e}}},polyfills(e,r=!1){return{...this,_config:{...this._config,polyfills:r?e:Ur(this._config.polyfills,e)}}},url(e,r=!1){if(r)return{...this,_url:e};const t=this._url.split("?");return{...this,_url:t.length>1?t[0]+e+"?"+t[1]:this._url+e}},options(e,r=!1){return{...this,_options:r?e:Ur(this._options,e)}},headers(e){const r=e?Array.isArray(e)?Object.fromEntries(e):"entries"in e?Object.fromEntries(e.entries()):e:{};return{...this,_options:Ur(this._options,{headers:r})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[Sd]:e})},auth(e){return this.headers({Authorization:e})},catcher(e,r){const t=new Map(this._catchers);return t.set(e,r),{...this,_catchers:t}},catcherFallback(e){return this.catcher(Id,e)},resolve(e,r=!1){return{...this,_resolvers:r?[e]:[...this._resolvers,e]}},defer(e,r=!1){return{...this,_deferred:r?[e]:[...this._deferred,e]}},middlewares(e,r=!1){return{...this,_middlewares:r?e:[...this._middlewares,...e]}},fetch(e=this._options.method,r="",t=null){let n=this.url(r).options({method:e});const a=Pd(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof t=="object"&&!(i&&t instanceof i)&&(!n._options.headers||!a||Ed(a));return n=t?o?n.json(t,a):n.body(t):n,Am(n._deferred.reduce((s,u)=>u(s,s._url,s._options),n))},get(e=""){return this.fetch("GET",e)},delete(e=""){return this.fetch("DELETE",e)},put(e,r=""){return this.fetch("PUT",r,e)},post(e,r=""){return this.fetch("POST",r,e)},patch(e,r=""){return this.fetch("PATCH",r,e)},head(e=""){return this.fetch("HEAD",e)},opts(e=""){return this.fetch("OPTIONS",e)},body(e){return{...this,_options:{...this._options,body:e}}},json(e,r){const t=Pd(this._options.headers);return this.content(r||Ed(t)&&t||Rm).body(JSON.stringify(e))}};function ir(e="",r={}){return{...km,_url:e,_options:r}}ir.default=ir,ir.options=Tm,ir.errorType=Cm,ir.polyfills=Om,ir.WretchError=Rd;const qm=(e,r)=>r.skipDedupe||r.method!=="GET",$m=(e,r)=>r.method+"@"+e,Um=e=>e.clone(),Lm=({skip:e=qm,key:r=$m,resolver:t=Um}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const s=r(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,c)=>{n.get(s).push([u,c])});try{return a(i,o).then(u=>(n.get(s).forEach(([c])=>c(t(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,c])=>c(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},Nm=(e,r)=>r.skipCache||r.method!=="GET",xm=(e,r)=>r.method+"@"+e,jm=()=>!1,Dm=()=>null,Mm=e=>e.ok,Fm=({throttle:e=1e3,skip:r=Nm,key:t=xm,clear:n=jm,invalidate:a=Dm,condition:i=Mm,flagResponseOnCacheHit:o="__cached"}={})=>{const s=new Map,u=new Map,c=new Set,l=v=>{e&&!c.has(v)&&(c.add(v),setTimeout(()=>{c.delete(v)},e))},f=v=>(d,h)=>{const p=t(d,h);let S=a(d,h);if(S&&(S instanceof Array||(S=[S]),S.forEach(R=>{typeof R=="string"?s.delete(R):R instanceof RegExp&&s.forEach((I,g)=>{R.test(g)&&s.delete(g)})})),n(d,h)&&s.clear(),r(d,h))return v(d,h);if(c.has(p)){if(s.has(p)){const R=s.get(p).clone();return o&&Object.defineProperty(R,o,{value:p,enumerable:!1}),Promise.resolve(R)}else if(u.has(p))return new Promise((R,I)=>{u.get(p).push([R,I])})}return u.has(p)||u.set(p,[]),l(p),v(d,h).then(R=>(i(R.clone())&&s.set(p,R.clone()),u.get(p).forEach(([I])=>I(R.clone())),u.delete(p),R)).catch(R=>{throw u.get(p).forEach(([,I])=>I(R)),u.delete(p),R})};return f.cacheResponse=function(v,d){l(v),s.set(v,d)},f.cache=s,f.inflight=u,f.throttling=c,f},Bm=(e,r)=>e*r,Hm=e=>e&&e.ok,Gm=({delayTimer:e=500,delayRamp:r=Bm,maxAttempts:t=10,until:n=Hm,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(c,l)=>{let f=0;if(s&&s(c,l))return u(c,l);const v=(d,h)=>Promise.resolve(n(d,h)).then(p=>p?d&&o?d:h?Promise.reject(h):d:(f++,!t||f<=t?new Promise(S=>{const R=r(e,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:h,url:c,options:l})).then((I={})=>{var g,b;S(u((g=I&&I.url)!==null&&g!==void 0?g:c,(b=I&&I.options)!==null&&b!==void 0?b:l))}):S(u(c,l))},R)}).then(v).catch(S=>{if(!i)throw S;return v(null,S)}):d&&o?d:Promise.reject(h||new Error("Number of attempts exceeded."))));return u(c,l).then(v).catch(d=>{if(!i)throw d;return v(null,d)})},Wm="@sesamy/sdk",Vm="1.23.0";let zm=class{cache=new Map;get(r){return this.cache.get(r)||null}set(r,t){this.cache.set(r,t)}remove(r){this.cache.delete(r)}clear(){this.cache.clear()}};const Ct="sesamyCacheTimestamp",Km=e=>{const{libraryName:r=Wm,libraryVersion:t=Vm,cache:n}=e,a=n?.storage||new zm,i=[s=>async(u,c)=>{if(n?.mode===sn.BROWSER){let l;typeof sessionStorage<"u"?(l=sessionStorage.getItem(Ct),l||(l=Date.now().toString(),sessionStorage.setItem(Ct,l))):(l=a.get(Ct),l||(l=Date.now().toString(),a.set(Ct,l)));const f={...c,headers:{...c.headers,"Cache-Timestamp":l}};return s(u,f)}return s(u,c)},s=>async(u,c)=>{const l=await e.tokenProvider();if(l===null)return s(u,c);const f={...c,headers:{...c.headers,Authorization:l}};return s(u,f)},Lm()];n?.mode===sn.NORMAL&&i.push(Fm({throttle:300*1e3,skip:(s,u)=>u.method!=="GET"})),i.push(Gm({delayTimer:1e3,delayRamp:(s,u)=>s*u,maxAttempts:3,until:s=>!!(s&&(s.ok||s.status>=400&&s.status<500)),retryOnNetworkError:!1}));const o=ir(e.baseUrl).headers({"Content-Type":"application/json","X-Sesamy-Client":`${r}/${t}`,...e.headers}).middlewares(i);return{async request(s,u={}){try{const c=/^https?:\/\//.test(s);let l=o.url(s,c);u.headers&&(l=l.headers(u.headers));const f=(u.method||"GET").toLowerCase();let v;switch(f){case"get":v=l.get();break;case"post":v=l.post(u.body);break;case"put":v=l.put(u.body);break;case"patch":v=l.patch(u.body);break;case"delete":v=l.delete();break;default:v=l.get()}const d=await v.res();if(d.ok&&["post","patch","put","delete"].includes(f)&&hr(),d.status===204)return null;if(!d.ok){const h=await d.text().catch(()=>"Unknown error");throw new Do(d.status,d.statusText,d.url,`API Error ${d.status}: ${h}`,h)}return await d.json()}catch(c){if(c instanceof Do)throw c;const l=c.status||500,f=c.message||"Unknown error",v=`${e.baseUrl}${s}`;throw new Do(l,f,v,`API Error ${l}: ${c.message||"Unknown error"}`,c.message||"Unknown error")}}}},hr=()=>(typeof sessionStorage<"u"&&sessionStorage.removeItem(Ct),"Cache cleared"),_t={get:async(e,r)=>e.request(`/profile/${r}`),update:async(e,r,t)=>e.request(`/profile/${r}`,{method:"PATCH",body:JSON.stringify(t)}),checkSpotifyLink:async e=>e.request("/profile/spotify-link"),unlinkSpotify:async e=>e.request("/profile/unlink-spotify",{method:"POST"}),delete:async e=>{await e.request("/profile",{method:"DELETE"})}},Mo={list:async(e,r)=>{const t=new URLSearchParams;r?.type&&t.append("type",r.type),r?.sku&&t.append("sku",r.sku),r?.purchaseOptionId&&t.append("purchase-option-id",r.purchaseOptionId),r?.waitForEntitlementAfter&&t.append("wait-for-entitlement-after",r.waitForEntitlementAfter);const n=t.toString(),a=n?`/entitlements?${n}`:"/entitlements";return e.request(a)},get:async(e,r)=>e.request(`/entitlements/${r}`),getAccess:async(e,r)=>e.request(`/entitlements/${r}/access`)},Td={list:async e=>e.request("/subscriptions"),get:async(e,r)=>e.request(`/subscriptions/${r}`)},Od={get:async(e,r)=>e.request(`/products/${r}`),autoOnboard:async(e,r)=>e.request(`/products/${r}/auto-onboard`,{method:"POST"})},Jm=(e,r)=>{if(!e||!r)return e;const t=new URL(e);return t.hash=`access_token=${r}`,t.toString()},Cd=(e,r)=>!e.manageUrl||!r?e:{...e,manageUrl:Jm(e.manageUrl,r)},At={list:async e=>e.request("/contracts"),get:async(e,r)=>e.request(`/contracts/${r}`),cancel:async(e,r)=>e.request(`/contracts/${r}/cancel`,{method:"POST"}),createAmendment:async(e,r,t)=>e.request(`/contracts/${r}/amendments`,{method:"POST",body:JSON.stringify(t)}),confirmAmendment:async(e,r,t)=>e.request(`/contracts/${r}/amendments/${t}/confirm`,{method:"POST"})},Fo={get:async e=>e.request("/user-metadata"),set:async(e,r,t)=>{await e.request(`/user-metadata/${r}`,{method:"PUT",body:t})},delete:async(e,r)=>{await e.request(`/user-metadata/${r}`,{method:"DELETE"})}},rt={list:async e=>e.request("/tallies"),get:async(e,r)=>e.request(`/tallies/${r}`),update:async(e,r,t)=>e.request(`/tallies/${r}`,{method:"PUT",body:JSON.stringify(t)}),create:async(e,r)=>e.request("/tallies",{method:"POST",body:JSON.stringify(r)}),delete:async(e,r)=>{try{return await e.request(`/tallies/${r}`,{method:"DELETE"}),!0}catch{return!1}},push:async(e,r,t)=>e.request(`/tallies/${r}/push`,{method:"POST",body:JSON.stringify(t)})},Bo={list:async e=>e.request("/tags"),add:async(e,r)=>{await e.request("/tags",{method:"POST",body:JSON.stringify({tag:r})})},remove:async(e,r)=>{await e.request(`/tags/${r}`,{method:"DELETE"})}},tt={generateCheckoutLink:(e,r)=>{const t=new URL(`${e.apiUrl}/checkouts`);return r.items&&t.searchParams.set("items",JSON.stringify(r.items)),r.email&&t.searchParams.set("email",r.email),r.language&&t.searchParams.set("lang",r.language),r.redirectUrl&&t.searchParams.set("redirect-url",r.redirectUrl),r.giftMode&&t.searchParams.set("gift-mode","true"),r.payerEmail&&t.searchParams.set("payer-email",r.payerEmail),r.requireAddress&&t.searchParams.set("require-address","true"),r.metadata&&Object.entries(r.metadata).forEach(([n,a])=>{t.searchParams.set(`metadata.${n}`,a)}),t.toString()},generateAccountLink:(e,r)=>{const t=r.language||"en",n=new URL(`${e.baseUrl}/account/${encodeURIComponent(t)}/subscriptions/${encodeURIComponent(e.clientId)}${r.contractId?`/${encodeURIComponent(r.contractId)}`:""}`);return n.searchParams.set("sesamy-redirect-url",r.redirectUrl||"/"),n.toString()},generateChangePaymentLink:(e,r)=>{const t=r.language||"en",n=new URL(`${e.baseUrl}/account/${encodeURIComponent(t)}/subscriptions/${encodeURIComponent(e.clientId)}/${encodeURIComponent(r.contractId)}/change-payment-method`);return n.searchParams.set("sesamy-redirect-url",r.redirectUrl||"/"),n.toString()},generateChangePlanLink:(e,r)=>{const t=r.language||"en",n=new URL(`${e.baseUrl}/account/${encodeURIComponent(t)}/subscriptions/${encodeURIComponent(e.clientId)}/${encodeURIComponent(r.contractId)}/edit-plan`);return n.searchParams.set("sesamy-redirect-url",r.redirectUrl||"/"),n.toString()},generateConsumeLink:(e,r)=>{const t=r.language||"en";let n=new URL(`${e.baseUrl}/consume/${encodeURIComponent(t)}/@${encodeURIComponent(e.clientId)}/${encodeURIComponent(r.sku)}`);return r.episodeId?n.href+=`/${encodeURIComponent(r.episodeId)}`:n.href+="/listen",n.searchParams.set("sesamy-redirect-url",r.redirectUrl||"/"),n.toString()}},Ho={generateLink:(e,r)=>{const t=new URL(`${e.apiUrl}/checkouts`);return r.items&&t.searchParams.set("items",JSON.stringify(r.items)),r.email&&t.searchParams.set("email",r.email),r.language&&t.searchParams.set("lang",r.language),r.redirectUrl&&t.searchParams.set("redirect-url",r.redirectUrl),r.giftMode&&t.searchParams.set("gift-mode","true"),r.payerEmail&&t.searchParams.set("payer-email",r.payerEmail),r.requireAddress&&t.searchParams.set("require-address","true"),r.metadata&&Object.entries(r.metadata).forEach(([n,a])=>{t.searchParams.set(`metadata.${n}`,a)}),t.toString()},create:async(e,r)=>e.request("/checkouts",{method:"POST",body:JSON.stringify(r)}),get:async(e,r)=>e.request(`/checkouts/${r}`),update:async(e,r,t)=>e.request(`/checkouts/${r}`,{method:"PATCH",body:JSON.stringify(t)})},_d={list:async e=>e.request("/bills"),get:async(e,r)=>e.request(`/bills/${r}`)},Ad={list:async e=>e.request("/fulfillments"),create:async(e,r)=>e.request("/fulfillments",{method:"POST",body:JSON.stringify(r)})},Ym={get:async(e,r)=>{try{return new URL(r),e.request(r)}catch{return e.request(`/paywalls/${r}`)}}},Qm={list:async e=>e.request("/payment-issues")},Xm={content:async(e,r,t,n,a)=>{const i=new URLSearchParams({url:r});return t&&i.append("selector",t),n&&i.append("cache",n),e.request(`/proxy?${i.toString()}`,a)}},Zm={list:async(e,r)=>{const t=(r?new URLSearchParams({q:r}):new URLSearchParams).toString(),n=t?`/transactions?${t}`:"/transactions";return e.request(n)}},kd={get:async e=>e.request("/vendor"),list:async e=>e.request("/vendors")},eg=e=>{const r=Km(e);return{profile:{get:t=>_t.get(r,t),update:(t,n)=>_t.update(r,t,n),checkSpotifyLink:()=>_t.checkSpotifyLink(r),unlinkSpotify:()=>_t.unlinkSpotify(r),delete:()=>_t.delete(r)},entitlements:{list:t=>Mo.list(r,t),get:t=>Mo.get(r,t),getAccess:t=>Mo.getAccess(r,t)},subscriptions:{list:()=>Td.list(r),get:t=>Td.get(r,t)},products:{get:t=>Od.get(r,t),autoOnboard:t=>Od.autoOnboard(r,t)},contracts:{list:async()=>{const t=await At.list(r),n=await e.tokenProvider();if(!n.toLowerCase().startsWith("bearer "))return t;const a=n.substring(7);return t.map(i=>Cd(i,a))},get:async t=>{const n=await At.get(r,t),a=await e.tokenProvider();if(!a.toLowerCase().startsWith("bearer "))return n;const i=a.substring(7);return Cd(n,i)},cancel:t=>At.cancel(r,t),createAmendment:(t,n)=>At.createAmendment(r,t,n),confirmAmendment:(t,n)=>At.confirmAmendment(r,t,n)},userMetadata:{get:()=>Fo.get(r),set:(t,n)=>Fo.set(r,t,n),delete:t=>Fo.delete(r,t)},tallies:{list:()=>rt.list(r),get:t=>rt.get(r,t),update:(t,n)=>rt.update(r,t,n),create:t=>rt.create(r,t),delete:t=>rt.delete(r,t),push:(t,n)=>rt.push(r,t,n)},tags:{list:()=>Bo.list(r),add:t=>Bo.add(r,t),remove:t=>Bo.remove(r,t)},checkouts:{generateLink:(t,n)=>tt.generateCheckoutLink(t,n),create:t=>Ho.create(r,t),get:t=>Ho.get(r,t),update:(t,n)=>Ho.update(r,t,n)},links:{generateCheckoutLink:(t,n)=>tt.generateCheckoutLink(t,n),generateAccountLink:(t,n)=>tt.generateAccountLink(t,n),generateChangePaymentLink:(t,n)=>tt.generateChangePaymentLink(t,n),generateChangePlanLink:(t,n)=>tt.generateChangePlanLink(t,n),generateConsumeLink:(t,n)=>tt.generateConsumeLink(t,n)},bills:{list:()=>_d.list(r),get:t=>_d.get(r,t)},fulfillments:{list:()=>Ad.list(r),create:t=>Ad.create(r,t)},paywalls:{get:t=>Ym.get(r,t)},paymentIssues:{list:()=>Qm.list(r)},proxy:{content:(t,n,a,i)=>Xm.content(r,t,n,a,i)},transactions:{list:t=>Zm.list(r,t)},vendor:{get:()=>kd.get(r),list:()=>kd.list(r)}}},rg="sesamy.com",tg="sesamy.dev",ng="https://sesa.my",qd="sesamyCacheTimestamp",$d="sesamyContentReloaded";class ag{get(r){return typeof sessionStorage>"u"?null:sessionStorage.getItem(r)}set(r,t){typeof sessionStorage<"u"&&sessionStorage.setItem(r,t)}remove(r){typeof sessionStorage<"u"&&sessionStorage.removeItem(r)}clear(){}}function ig(e,r){return`${e}.${r==="dev"?tg:rg}`}function or(e,r){return`https://${ig(e,r)}`}function un(){let r=(document.documentElement.getAttribute("lang")??navigator.language??"en").split("-")[0]?.toLowerCase()??"en";return r==="nn"&&(r="nb"),r}function Go(e){let r;try{r=new URL(e)}catch{return!1}return r.protocol==="http:"||r.protocol==="https:"}function Ud(e,r){if(Go(e))return{itemSrc:e};const t=e.split(":");if(t.length<2)throw new Error(`Invalid itemSrc format: expected at least 2 segments separated by ':', got ${t.length}`);const[n,a,i]=t;if(!a)throw new Error("Invalid itemSrc format: sku segment is empty");return{sku:`${n}:${a}`,purchaseOption:r||i}}function Ld(e){return e.endsWith("/")?e.slice(0,-1):e}function Nd(e,r){if(!Go(e)||!Go(r))return!1;const t=new URL(e),n=new URL(r);return t.origin===n.origin&&Ld(t.pathname)===Ld(n.pathname)}function og(e,r,t){const n=new URL(`${or("checkout3",e.environment)}`);r.language&&n.searchParams.set("lang",r.language);let a=r.sku,i=r.purchaseOptionId,o=r.itemSrc;if(r.itemSrc){const l=Ud(r.itemSrc,r.purchaseOptionId);a=l.sku||a,i=l.purchaseOption||i,o=l.itemSrc}a?(n.searchParams.set("sku",a),i&&n.searchParams.set("po-id",i)):o&&n.searchParams.set("url",o),r.email&&n.searchParams.set("email",r.email),r.business&&n.searchParams.set("business","true"),r.currency&&n.searchParams.set("currency",r.currency),r.price&&n.searchParams.set("price",r.price.toString()),r.discountCode&&n.searchParams.set("discount-code",r.discountCode),r.attributionItemSrc?n.searchParams.set("itemSrc",r.attributionItemSrc):t.itemSrc&&n.searchParams.set("itemSrc",t.itemSrc),r.attributionPublisherContentId?n.searchParams.set("publisherContentId",r.attributionPublisherContentId):t.publisherContentId&&n.searchParams.set("publisherContentId",t.publisherContentId),r.utmSource?n.searchParams.set("utm_source",r.utmSource):t.utmSource&&n.searchParams.set("utm_source",t.utmSource),r.utmMedium?n.searchParams.set("utm_medium",r.utmMedium):t.utmMedium&&n.searchParams.set("utm_medium",t.utmMedium),r.utmCampaign?n.searchParams.set("utm_campaign",r.utmCampaign):t.utmCampaign&&n.searchParams.set("utm_campaign",t.utmCampaign),r.utmTerm?n.searchParams.set("utm_term",r.utmTerm):t.utmTerm&&n.searchParams.set("utm_term",t.utmTerm),r.utmContent?n.searchParams.set("utm_content",r.utmContent):t.utmContent&&n.searchParams.set("utm_content",t.utmContent);const s=["_ga","_gid","_fbp","_fbc"];document.cookie.split(";").map(l=>{const[f,v]=l.trim().split("=");return{key:f,value:v}}).filter(l=>s.some(f=>f===l.key)).forEach(l=>{n.searchParams.append(l.key,l.value)});let c=new URL(window.location.href);if(r.redirectUrl)try{c=new URL(r.redirectUrl)}catch{console.warn("Invalid redirect URL provided, using current URL instead:",r.redirectUrl)}return c.searchParams.set("force-refetch-entitlements","true"),r.itemSrc&&c.searchParams.set("sesamy-purchase",r.itemSrc),n.searchParams.set("redirect-url",c.toString()),r.paymentMethodsFilter&&n.searchParams.set("paymentmethods-filter",r.paymentMethodsFilter.flatMap(({provider:l,methods:f})=>f?f.map(v=>`${l}|${v}`):l).join(",")),r.requireAddress&&n.searchParams.set("require-address","true"),r.giftMode&&n.searchParams.set("gift-mode","true"),r.payerEmail&&n.searchParams.set("payer-email",r.payerEmail),r.metadata&&Object.entries(r.metadata).forEach(([l,f])=>{n.searchParams.set(`metadata.${l}`,String(f))}),n}const xd="sesamySignedURLs";function Wo(){const e=sessionStorage.getItem(xd);return e?JSON.parse(e):[]}function jd(e){const r=Wo();r.push(e),de(`Adding signed URL: ${e}`),sessionStorage.setItem(xd,JSON.stringify(r))}function sg(e){const r={};return Object.keys(e).forEach(t=>{const n=e[t];n!=null&&(r[t]=n.toString())}),r}const Vo="sesamyAttribution";function ug(e){const r=localStorage.getItem(e);if(!r)return null;try{return JSON.parse(r).value}catch{return console.error(`Failed to parse ${e}`),null}}function cg(e){return Object.keys(e).find(r=>r.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...e}:e}function cn(){return ug(Vo)||{}}function Dd(e){if(e===null)localStorage.removeItem(Vo);else{de(`Setting attribution ${JSON.stringify(e)}`);const r=cn()??{},t=sg({...r,...cg(e)});localStorage.setItem(Vo,JSON.stringify({value:t}))}}const zo="@sesamy/sesamy-js",kt="1.99.0",Md="sesamyFlags";async function Fd(e){try{localStorage.setItem(Md,JSON.stringify(e))}catch{de("Failed to save flags to localStorage")}}async function Bd(e,r){const t=await qt();t[e]=r,await Fd(t)}async function Hd(e){return(await qt())[e]}async function Gd(e){const r=await qt();e in r&&(delete r[e],await Fd(r))}async function qt(){try{const e=localStorage.getItem(Md);return e?JSON.parse(e):{}}catch{return{}}}function Wd(e){function r(n){return n.id?`#${n.id}`:n.classList.length>0?Array.from(n.classList).map(i=>`.${i}`).join(""):null}function t(n){const a=[];let i=n;for(;i&&i!==document.body&&i!==document.documentElement;){const o=r(i);if(o){a.unshift(o);break}if(i.parentElement){const s=Array.from(i.parentElement.children),u=s.indexOf(i)+1,c=i.tagName.toLowerCase();s.filter(f=>f.tagName.toLowerCase()===c).length>1?a.unshift(`${c}:nth-child(${u})`):a.unshift(c)}i=i.parentElement}return a.join(" > ")}return t(e)}function Vd(e){return e?Object.fromEntries(Object.entries(e).filter(([r,t])=>t!==void 0)):{}}function lg(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}let De={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"}},zd=[],Kd=!1,Ir;function Ko(){const e=window.location.pathname,r=new URLSearchParams(window.location.search),t=navigator.userAgent;return zd.find(n=>{if(n.path&&!e.includes(n.path)||n.queryParam&&r.get(n.queryParam.key)!==n.queryParam.value)return!1;if(n.headers){const a=n.headers.name.toLowerCase(),i=n.headers.contains.toLowerCase();if(a==="user-agent"){if(!t.toLowerCase().includes(i))return!1}else return!1}return!(n.userAgentContains&&!t.includes(n.userAgentContains))})}function fg(){return Ko()}function dg(e,r){zd=e.content||[];const t=Ko();t&&t.type==="article"&&(De={...De,...Vd(t.selectors)},Kd=t.enablePaywallSettingsUrlFallback||!1),Ir=r}function vg(e,r){const{selector:t,attribute:n}=r;return t===De.article.selector||n&&e.hasAttribute(n)?e:e.querySelector(t)}function Jd(e,r,t=!1){if(e){if(r.attribute){if(r.attribute==="textContent")return e.textContent??void 0;const n=e.getAttribute(r.attribute),a=Jd(e.parentElement,r,t);if(t){const i=[];return n&&i.push(...n.split(",").map(o=>o.trim()).filter(Boolean)),a&&i.push(...a.split(",").map(o=>o.trim()).filter(Boolean)),i.length>0?[...new Set(i)].join(","):void 0}return n??a}return e.textContent??void 0}}function ge(e){const r=document.head.querySelectorAll(`[property~='${e}'][content]`);for(let n=0;n<r.length;n+=1)if(r[n].content)return r[n].content;const t=document.head.querySelectorAll(`[name~='${e}'][content]`);for(let n=0;n<t.length;n+=1)if(t[n].content)return t[n].content}function $t(e){const r=[];return document.head.querySelectorAll(`[property~='${e}'][content]`).forEach(a=>{a.content&&r.push(a.content)}),document.head.querySelectorAll(`[name~='${e}'][content]`).forEach(a=>{a.content&&r.push(a.content)}),r}let Ut=null;function Yd(){const e=[],r=document.querySelectorAll('script[type="application/ld+json"]');for(const t of r)try{const n=JSON.parse(t.textContent||"");Array.isArray(n)?e.push(...n):n["@graph"]&&Array.isArray(n["@graph"])?e.push(...n["@graph"]):e.push(n)}catch{}return e}function Lt(e){const r=Yd(),t=n=>!e||n["@type"]===e||Array.isArray(n["@type"])&&n["@type"].includes(e);return r.find(t)||null}function hg(e){const r=Yd(),t=n=>!e||n["@type"]===e||Array.isArray(n["@type"])&&n["@type"].includes(e);return r.filter(t)}function Jo(e,r,t){if(!e||typeof e!="object")return typeof e=="string"?e:void 0;const a=e[r];if(typeof a=="string")return a;if(a&&typeof a=="object"&&t)return a[t]}function pg(e){if(!e)return;const t=(Array.isArray(e)?e:[e]).map(n=>{if(typeof n=="string")return{name:n};if(typeof n=="object"&&n!==null){const a=n,i=a.name;return i?{name:i,url:a.url,image:Jo(a,"image","url"),jobTitle:a.jobTitle,sameAs:a.sameAs}:null}return null}).filter(n=>n!==null&&!!n.name);return t.length>0?t:void 0}function Yo(e){if(Array.isArray(e))return e.filter(r=>typeof r=="string");if(typeof e=="string"){const r=e.split(",").map(t=>t.trim()).filter(Boolean);return r.length>0?r:void 0}}function Qd(){if(Ut)return Ut;const e=Lt("NewsArticle")||Lt("Article")||Lt("BlogPosting")||Lt("WebPage"),r=(...a)=>a.find(i=>i!=null&&i!=="")||void 0,t=(...a)=>a.find(i=>i&&i.length>0),n={contentType:e?Array.isArray(e["@type"])?e["@type"][0]:e["@type"]:void 0,authors:pg(e?.author)||($t("article:author").length>0?$t("article:author").map(a=>({name:a})):void 0)||(ge("author")?[{name:ge("author")}]:void 0),keywords:t(Yo(e?.keywords),Yo(ge("keywords"))),tags:$t("article:tag").length>0?$t("article:tag"):void 0,categories:Yo(ge("news_keywords")),section:r(e?.articleSection,ge("article:section")),publishedAt:r(e?.datePublished,ge("article:published_time")),modifiedAt:r(e?.dateModified,ge("article:modified_time")),ogType:ge("og:type"),ogSiteName:ge("og:site_name"),ogLocale:ge("og:locale"),twitterCard:ge("twitter:card"),twitterSite:ge("twitter:site"),twitterCreator:ge("twitter:creator"),creator:r(ge("creator"),ge("dc.creator")),mainEntityOfPage:e?Jo(e.mainEntityOfPage,"@id")||(typeof e.mainEntityOfPage=="string"?e.mainEntityOfPage:void 0):void 0,isAccessibleForFree:typeof e?.isAccessibleForFree=="boolean"?e.isAccessibleForFree:void 0,wordCount:typeof e?.wordCount=="number"?e.wordCount:void 0,publisher:e?.publisher&&typeof e.publisher=="object"?{name:e.publisher.name||"",url:e.publisher.url,logo:Jo(e.publisher,"logo","url")}:void 0};return Ut=Vd(n),Ut}function mg(){Ut=null}function Qo({publisherContentId:e,key:r,defaultValue:t=""}){const n=e?document.body.querySelector(`sesamy-content-data[id='${e}']`):null,a=r.replace(/-([a-z])/g,(i,o)=>o.toUpperCase());return n?.getAttribute(r)||ge(`sesamy:${r}`)||ge(`sesamy:${a}`)||ge(`og:${r}`)||ge(r)||t}function Xd(){const e=document.querySelectorAll(De.article.selector);return Array.from(e).map(Nt).filter(r=>r!==null)}function Nt(e){const r=typeof e=="string"?document.querySelector(e):e;if(!r)return null;const t={element:r,selector:typeof e=="string"?e:Wd(r)},n=(i,o,s,u)=>{const{transform:c,collect:l=!1}=u||{},f=vg(r,o),v=Jd(f,o,l),d=Qo({publisherContentId:s,key:lg(String(i))}),h=v||d||void 0;h&&(t[i]=c?c(h):h)};n("id",De.id),n("title",De.title,t.id),n("excerpt",De.excerpt,t.id),n("image",De.image,t.id),n("price",De.price,t.id,{transform:i=>{const o=parseFloat(i);return Number.isNaN(o)?void 0:o}}),n("currency",De.currency,t.id),n("url",De.url,t.id),n("pass",De.pass,t.id,{collect:!0}),n("paywallUrl",De.paywallUrl,t.id),n("accessLevel",De.accessLevel,t.id,{transform:i=>i||"entitlement"});const a=Ko();if(a&&a.type==="article"&&(a.pass&&(t.pass=t.pass?`${t.pass},${a.pass}`:a.pass),a.price&&!t.price&&(t.price=a.price.amount),a.price?.currency&&!t.currency&&(t.currency=a.price.currency),a.paywallUrl&&!t.paywallUrl&&(t.paywallUrl=a.paywallUrl)),Kd&&!t.paywallUrl){const i=document.querySelector("sesamy-paywall");if(i){const o=i.getAttribute("settings-url");o&&(t.paywallUrl=o)}}return t.url||(t.url=window.location.href),t.metadata=Qd(),t}async function gg(e){const r=Nt(e);if(!r)throw new Error("Could not find article element");if(r.accessLevel==="public")return!0;if(r.accessLevel==="logged-in"&&!r.paywallUrl)return await Ir.auth.isAuthenticated()?!0:null;if(r.paywallUrl&&((await Ir.paywalls.get(r.paywallUrl)).settings.template==="LOGIN"?"logged-in":"entitlement")==="logged-in")return await Ir.auth.isAuthenticated()?!0:null;if(!r.url)throw new Error("Article must have a URL");return await Ir.entitlements.hasAccess(r.url,r.pass?.split(",")||[])||null}async function Zd(e,r){const t=typeof e=="string"?document.querySelector(e):e;if(!t)throw new Error("Could not find element");const n=Nt(t);if(!n?.url)throw new Error("Could not find content for element");const a=await Ir.entitlements.hasAccess(n.url,n.pass?.split(",")||[]);if(!a)throw new Error("User does not have access to the content");let i;if(a.token)i=a.token;else{const s=await Ir.entitlements.access(a.id);if(!s.token)throw new Error("Could not get access token");i=s.token}const o=r||Wd(t.parentElement||t);return Ir.proxy.getContent(i,n.url,o)}function ev(e,r={}){const{closeOnBackdropClick:t=!0,closeOnEscape:n=!0,zIndex:a=2147483647,backdropBlur:i="5px",overlayBackground:o="rgba(0,0,0,0.5)"}=r,s=document.createElement("div");s.setAttribute("data-sesamy-modal","true"),Object.assign(s.style,{position:"fixed",top:"0",left:"0",width:"100vw",height:"100vh",background:o,zIndex:String(a),display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:`blur(${i})`});const u=document.createElement("div");u.setAttribute("data-sesamy-modal-content","true"),typeof e=="string"?u.innerHTML=e:u.appendChild(e),s.appendChild(u);const c=()=>{s.remove(),n&&document.removeEventListener("keydown",l)},l=f=>{f.key==="Escape"&&c()};return t&&s.addEventListener("click",f=>{f.target===s&&c()}),n&&document.addEventListener("keydown",l),document.body.appendChild(s),{element:s,close:c}}function yg(e,r={}){const{position:t="top",fixed:n=!0,zIndex:a=2147483647,autoDismissMs:i,pushContent:o=!1,height:s,transitionDuration:u="0.3s"}=r,c=document.createElement("div");c.setAttribute("data-sesamy-notification-bar","true"),c.setAttribute("data-sesamy-notification-position",t),Object.assign(c.style,{position:n?"fixed":"absolute",[t]:"0",left:"0",width:"100%",zIndex:String(a),boxSizing:"border-box",...s&&{height:s}}),typeof e=="string"?c.innerHTML=e:c.appendChild(e);let l,f,v;const d=()=>{if(v&&clearTimeout(v),o&&s){const h=document.documentElement;h.style.transform=l||"",setTimeout(()=>{c.remove(),h.style.transition=f||""},parseFloat(u)*1e3)}else c.remove()};if(i&&(v=setTimeout(d,i)),o&&s){const h=document.documentElement;l=h.style.transform,f=h.style.transition,h.style.transition=`transform ${u} ease`,c.style.transition=`transform ${u} ease`,t==="top"?(h.style.transform=`translateY(${s})`,c.style.transform=`translateY(-${s})`):(h.style.transform=`translateY(-${s})`,c.style.transform=`translateY(${s})`),document.documentElement.prepend(c)}else document.body.appendChild(c);return{element:c,close:d}}function bg(e){const r=e.endpoint??or("api2",e.environment),n=eg({baseUrl:r,tokenProvider:async()=>{if(await dr())try{const L=await vr(!1);return L?`Bearer ${L}`:null}catch{}const m=localStorage.getItem("__anon_id");return`Basic ${btoa(`${e.vendorId||e.clientId}|${m}:`)}`},libraryName:zo,libraryVersion:kt,vendorId:e.vendorId,cache:{mode:sn.BROWSER,storage:new ag}}),a=m=>async(C,L)=>{let F=sessionStorage.getItem(qd);F||(F=Date.now().toString(),sessionStorage.setItem(qd,F));const w={...L,headers:{...L.headers,"Cache-Timestamp":F}};return m(C,w)},i=(m=!0)=>C=>async(L,F)=>{const w=await vr(m);if(!w){if(await dr()){const k={...F,credentials:"include"};return C(L,k)}if(m)throw new Error("No access token available");return C(L,F)}const T={...F,headers:{...F.headers,Authorization:`Bearer ${w}`}};return C(L,T)},o=ir(r).headers({"Content-Type":"application/json"}).middlewares([a,i(),Sm(),Em({delayTimer:1e3,delayRamp:(m,C)=>m*C,maxAttempts:3,until:m=>!!(m&&(m.ok||m.status>=400&&m.status<500)),retryOnNetworkError:!1})]);async function s(m={}){const{waitForEntitlementAfter:C,includeSignedLinks:L=!0}=m,F=await dr()?await n.entitlements.list({waitForEntitlementAfter:C?.toISOString()}):[];return L&&F.push(...Wo()),F}async function u(m,C=[]){return(await s())?.find(w=>{if(m){const{sku:T,purchaseOption:k}=Ud(m);if("sku"in w&&T===w.sku||k&&"purchaseOptionsId"in w&&k===w.purchaseOptionsId||Nd(m,w.url))return!0}return!!C.some(T=>Nd(T,w.url))})}async function c(m,C,L){const F=new URL(r,window.location.origin);return F.pathname=F.pathname.replace(/\/$/,"")+"/proxy",F.searchParams.set("url",C),L&&F.searchParams.set("selector",L),ir(F.toString()).headers({Authorization:`Bearer ${m}`}).get().text()}async function l(m){if(!m)throw new Error("SKU is required to get fulfillments");return await dr()?await o.get(`/fulfillments?sku=${encodeURIComponent(m)}`).json():[]}async function f(m,C){if(!m||!C)throw new Error("SKU and itemId are required to request delivery");return(await o.post({sku:m},`/fulfillments/${encodeURIComponent(C)}/request-delivery?`).res()).ok}async function v(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),o.get("/subscriptions").json()}async function d(m){return(await n.transactions.list())?.find(L=>L.id===m)}async function h(){return await o.url("/tags").get().json()}async function p(m){const C=await o.url(`/tags/${encodeURIComponent(m)}`).delete().res();return hr(),C.ok}async function S(m){const C=await o.url("/tags").post(encodeURIComponent(m)).res();return $r(er.USER_ATTRIBUTE_CHANGED,{}),hr(),C.ok}async function R(m){return(await n.tallies.get(m)).value}async function I(){const m=await n.tallies.list(),C={};for(const L of m)C[L.id]=L.value;return C}async function g(m){return await n.tallies.delete(m)}async function b(m,C){return await n.tallies.push(m,C)}async function y(){return await vr(!1)?await o.url("/profile").get().json():null}async function A(m){const C=await o.url("/profile").patch(m).res();return hr(),C.ok}async function $(){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 G(m){const C=await vr(!1);if(!C)throw new Error("No access token available");const L=new URL(`${or("access-sync",e.environment)}/spotify/sesamy-callback`);L.searchParams.set("access_token",C),L.searchParams.set("state",m),window.location.href=L.toString()}async function K(m){const C=await o.url(`/products/${encodeURIComponent(m)}/auto-onboard`).post().json();return C.length&&hr(),C}async function re(m,C=3600){const{shortlink:L}=await ir(ng).post({url:m,ttl:C}).json();return L}async function N(m){const C=await vr(!1,!0);let L;const F=m.language||un(),w=cn();switch(m.target){case"account":L=new URL(`${or("account",e.environment)}/${encodeURIComponent(m.language||F)}/subscriptions/${encodeURIComponent(e.vendorId||e.clientId)}${m.contractId?`/${encodeURIComponent(m.contractId)}`:""}`),L.searchParams.set("sesamy-redirect-url",m.redirectUrl||window.location.href);break;case"change-payment":L=new URL(`${or("account",e.environment)}/${encodeURIComponent(m.language||F)}/subscriptions/${encodeURIComponent(e.vendorId||e.clientId)}/${encodeURIComponent(m.contractId)}/change-payment-method`),L.searchParams.set("sesamy-redirect-url",m.redirectUrl||window.location.href);break;case"change-plan":L=new URL(`${or("account",e.environment)}/${encodeURIComponent(m.language||F)}/subscriptions/${encodeURIComponent(e.vendorId||e.clientId)}/${encodeURIComponent(m.contractId)}/edit-plan`),L.searchParams.set("sesamy-redirect-url",m.redirectUrl||window.location.href);break;case"consume":L=new URL(`${or("consume",e.environment)}/${encodeURIComponent(m.language||F)}/@${encodeURIComponent(e.vendorId||e.clientId)}/${encodeURIComponent(m.sku)}`),m.episodeId?L.href+=`/${m.episodeId}`:L.href+="/listen",L.searchParams.set("sesamy-redirect-url",m.redirectUrl||window.location.href);break;case"checkout":L=og(e,{language:F,...m},w);break;default:throw new Error("Invalid target")}return C&&(L.hash=`#access_token=${C}`),m.shorten?re(L.href,m.ttl):L.href}async function M(){const m=await vr(!1),C=new URL(`${or("account",e.environment)}/subscriptions/${e.vendorId||e.clientId}`);m&&(C.hash=`#access_token=${m}`),window.location.href=C.toString()}async function x(m){const C=cn(),L=["_ga","_gid","_fbp","_fbc"];return document.cookie.split(";").forEach(F=>{const[w,T]=F.trim().split("=");L.includes(w)&&!C[w]&&(C[w]=T)}),n.checkouts.create({language:un(),...m,attribution:{...C,...m.attribution}})}return{autoOnboardProduct:K,bills:n.bills,checkouts:{create:x,get:n.checkouts.get,update:n.checkouts.update},content:{list:Xd,get:Nt,getLanguage:un,unlock:Zd,getPropertyFromHTML:Qo},contracts:n.contracts,deleteTag:p,deleteTally:g,entitlements:n.entitlements,flags:{get:Hd,set:Bd,list:qt,delete:Gd},generateLink:N,getProxyContent:c,getEntitlements:s,getFulfillments:l,requestDelivery:f,hasAccess:u,isSpotifyLinked:$,linkSpotify:G,openHostedAccountPage:M,paywalls:n.paywalls,paymentIssues:n.paymentIssues,getProfile:y,products:n.products,getSubscriptions:v,getTally:R,getTallies:I,getTags:h,getTransaction:d,transactions:n.transactions,userMetadata:n.userMetadata,pushTally:b,setTag:S,unlinkSpotify:j,updateProfile:A,vendor:n.vendor}}function rv(e,r,t,n,a){for(r=r.split?r.split("."):r,n=0;n<r.length;n++)e=e?e[r[n]]:a;return e===a?t:e}var wg="function",Sg="string",rr="undefined",Ig="boolean",ln="object",Pg="array",Eg="number",Rg="symbol",Tg="null",Xo=function(){},tv="any",nv="*",Lr="__",Og="form",Cg="input",_g="button",Ag="select",fn=typeof process!==rr?process:{};fn.env&&fn.env.NODE_ENV;var Ce=typeof document!==rr;fn.versions!=null&&fn.versions.node!=null,typeof Deno!==rr&&Deno.core,Ce&&window.name==="nodejs"||typeof navigator!==rr&&typeof navigator.userAgent!==rr&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function av(e,r){return r.charAt(0)[e]()+r.slice(1)}var kg=av.bind(null,"toUpperCase"),qg=av.bind(null,"toLowerCase");function $g(e){return iv(e)?kg(Tg):typeof e===ln?xg(e):Object.prototype.toString.call(e).slice(8,-1)}function dn(e,r){r===void 0&&(r=!0);var t=$g(e);return r?qg(t):t}function xt(e,r){return typeof r===e}var Me=xt.bind(null,wg),Pr=xt.bind(null,Sg),nt=xt.bind(null,rr),Ug=xt.bind(null,Ig);xt.bind(null,Rg);function iv(e){return e===null}function Lg(e){return dn(e)===Eg&&!isNaN(e)}function ov(e){return dn(e)===Pg}function Fe(e){if(!Ng(e))return!1;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function Ng(e){return e&&(typeof e===ln||e!==null)}function xg(e){return Me(e.constructor)?e.constructor.name:null}function jg(e){return e instanceof Error||Pr(e.message)&&e.constructor&&Lg(e.constructor.stackTraceLimit)}function sv(e,r){if(typeof r!="object"||iv(r))return!1;if(r instanceof e)return!0;var t=dn(new e(""));if(jg(r))for(;r;){if(dn(r)===t)return!0;r=Object.getPrototypeOf(r)}return!1}sv.bind(null,TypeError),sv.bind(null,SyntaxError);function vn(e,r){var t=e instanceof Element||e instanceof HTMLDocument;return t&&r?Dg(e,r):t}function Dg(e,r){return r===void 0&&(r=""),e&&e.nodeName===r.toUpperCase()}function hn(e){var r=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(r))}}hn(vn,Og),hn(vn,_g),hn(vn,Cg),hn(vn,Ag);function Mg(e){return e?ov(e)?e:[e]:[]}function uv(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function Fg(){if(Ce){var e=navigator,r=e.languages;return e.userLanguage||(r&&r.length?r[0]:e.language)}}function Bg(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function Hg(e){return(function(r){for(var t,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;t=a.exec(r);){var i=uv(t[1]),o=uv(t[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 c=u.split("[");c.length>1&&(Gg(n,c.map(function(l){return l.replace(/[?[\]\\ ]/g,"")}),n[u]),delete n[u])}return n})((function(r){return Ce&&window.location.search.substring(1)})())}function Gg(e,r,t){for(var n=r.length-1,a=0;a<n;++a){var i=r[a];if(i==="__proto__"||i==="constructor")break;i in e||(e[i]={}),e=e[i]}e[r[n]]=t}function pn(){for(var e="",r=0,t=4294967295*Math.random()|0;r++<36;){var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[r-1],a=15&t;e+=n=="-"||n=="4"?n:(n=="x"?a:3&a|8).toString(16),t=r%8==0?4294967295*Math.random()|0:t>>4}return e}function Wg(e,r){var t,n,a,i=null,o=0,s=function(){o=new Date,i=null,a=e.apply(t,n)};return function(){var u=new Date;o||(o=u);var c=r-(u-o);return t=this,n=arguments,c<=0?(clearTimeout(i),i=null,o=u,a=e.apply(t,n)):i||(i=setTimeout(s,c)),a}}var Nr="global",at=Lr+Nr+Lr,it=typeof self===ln&&self.self===self&&self||typeof global===ln&&global[Nr]===global&&global||void 0;function xr(e){return it[at][e]}function jr(e,r){return it[at][e]=r}function ot(e){delete it[at][e]}function st(e,r,t){var n;try{if(Zo(e)){var a=window[e];n=a[r].bind(a)}}catch{}return n||t}it[at]||(it[at]={});var mn={};function Zo(e){if(typeof mn[e]!==rr)return mn[e];try{var r=window[e];r.setItem(rr,rr),r.removeItem(rr)}catch{return mn[e]=!1}return mn[e]=!0}function Z(){return Z=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},Z.apply(null,arguments)}var Er="function",pr="undefined",jt="reducer",cv="@@redux/",es=cv+"INIT",Vg=cv+Math.random().toString(36),lv=(function(){return typeof Symbol===Er&&Symbol.observable||"@@observable"})(),gn=" != "+Er;function fv(e,r,t){var n;if(typeof r===Er&&typeof t===pr&&(t=r,r=void 0),typeof t!==pr){if(typeof t!==Er)throw new Error("enhancer"+gn);return t(fv)(e,r)}if(typeof e!==Er)throw new Error(jt+gn);var a=e,i=r,o=[],s=o,u=!1;function c(){s===o&&(s=o.slice())}function l(){return i}function f(d){if(typeof d!==Er)throw new Error("Listener"+gn);var h=!0;return c(),s.push(d),function(){if(h){h=!1,c();var p=s.indexOf(d);s.splice(p,1)}}}function v(d){if(!Fe(d))throw new Error("Act != obj");if(typeof d.type===pr)throw new Error("ActType "+pr);if(u)throw new Error("Dispatch in "+jt);try{u=!0,i=a(i,d)}finally{u=!1}for(var h=o=s,p=0;p<h.length;p++)(0,h[p])();return d}return v({type:es}),(n={dispatch:v,subscribe:f,getState:l,replaceReducer:function(d){if(typeof d!==Er)throw new Error("next "+jt+gn);a=d,v({type:es})}})[lv]=function(){var d,h=f;return(d={subscribe:function(p){if(typeof p!="object")throw new TypeError("Observer != obj");function S(){p.next&&p.next(l())}return S(),{unsubscribe:h(S)}}})[lv]=function(){return this},d},n}function zg(e,r){var t=r&&r.type;return"action "+(t&&t.toString()||"?")+jt+" "+e+" returns "+pr}function ut(){var e=[].slice.call(arguments);return e.length===0?function(r){return r}:e.length===1?e[0]:e.reduce(function(r,t){return function(){return r(t.apply(void 0,[].slice.call(arguments)))}})}function Kg(){var e=arguments;return function(r){return function(t,n,a){var i,o=r(t,n,a),s=o.dispatch,u={getState:o.getState,dispatch:function(c){return s(c)}};return i=[].slice.call(e).map(function(c){return c(u)}),Z({},o,{dispatch:s=ut.apply(void 0,i)(o.dispatch)})}}}var Rr=Lr+"anon_id",Dr=Lr+"user_id",ct=Lr+"user_traits",rs="analytics",Tr="userId",lt="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"],ts=["name","EVENTS","config","loaded"],ee=yn.reduce(function(e,r){return e[r]=r,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),dv=/^utm_/,vv=/^an_prop_/,hv=/^an_trait_/;function Jg(e){var r=e.storage.setItem;return function(t){return function(n){return function(a){if(a.type===ee.bootstrap){var i=a.params,o=a.user,s=a.persistedUser,u=a.initialUser,c=s.userId===o.userId;s.anonymousId!==o.anonymousId&&r(Rr,o.anonymousId),c||r(Dr,o.userId),u.traits&&r(ct,Z({},c&&s.traits?s.traits:{},u.traits));var l=Object.keys(a.params);if(l.length){var f=i.an_uid,v=i.an_event,d=l.reduce(function(h,p){if(p.match(dv)||p.match(/^(d|g)clid/)){var S=p.replace(dv,"");h.campaign[S==="campaign"?"name":S]=i[p]}return p.match(vv)&&(h.props[p.replace(vv,"")]=i[p]),p.match(hv)&&(h.traits[p.replace(hv,"")]=i[p]),h},{campaign:{},props:{},traits:{}});t.dispatch(Z({type:ee.params,raw:i},d,f?{userId:f}:{})),f&&setTimeout(function(){return e.identify(f,d.traits)},0),v&&setTimeout(function(){return e.track(v,d.props)},0),Object.keys(d.campaign).length&&t.dispatch({type:ee.campaign,campaign:d.campaign})}}return n(a)}}}}function Yg(e){return function(r,t){if(r===void 0&&(r={}),t===void 0&&(t={}),t.type===ee.setItemEnd){if(t.key===Rr)return Z({},r,{anonymousId:t.value});if(t.key===Dr)return Z({},r,{userId:t.value})}switch(t.type){case ee.identify:return Object.assign({},r,{userId:t.userId,traits:Z({},r.traits,t.traits)});case ee.reset:return[Dr,Rr,ct].forEach(function(n){e.removeItem(n)}),Object.assign({},r,{userId:null,anonymousId:null,traits:{}});default:return r}}}function pv(e){return{userId:e.getItem(Dr),anonymousId:e.getItem(Rr),traits:e.getItem(ct)}}var ns=function(e){return Lr+"TEMP"+Lr+e};function Qg(e){var r=e.storage,t=r.setItem,n=r.removeItem,a=r.getItem;return function(i){return function(o){return function(s){var u=s.userId,c=s.traits,l=s.options;if(s.type===ee.reset&&([Dr,ct,Rr].forEach(function(d){n(d)}),[Tr,lt,"traits"].forEach(function(d){ot(ns(d))})),s.type===ee.identify){a(Rr)||t(Rr,pn());var f=a(Dr),v=a(ct)||{};f&&f!==u&&i.dispatch({type:ee.userIdChanged,old:{userId:f,traits:v},new:{userId:u,traits:c},options:l}),u&&t(Dr,u),c&&t(ct,Z({},v,c))}return o(s)}}}}var Dt={};function mv(e,r){Dt[e]&&Me(Dt[e])&&(Dt[e](r),delete Dt[e])}function gv(e,r,t){return new Promise(function(n,a){return r()?n(e):t<1?a(Z({},e,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return gv(e,r,t-10).then(n,a)})})}function Xg(e){return{abort:e}}function yv(e,r,t){var n={},a=r(),i=e.getState(),o=i.plugins,s=i.queue,u=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var c=s.actions.reduce(function(f,v,d){return o[v.plugin].loaded?(f.process.push(v),f.processIndex.push(d)):(f.requeue.push(v),f.requeueIndex.push(d)),f},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(c.processIndex&&c.processIndex.length){c.processIndex.forEach(function(f){var v=s.actions[f],d=v.plugin,h=v.payload.type,p=a[d][h];if(p&&Me(p)){var S,R=(function(b,y){return b===void 0&&(b={}),y===void 0&&(y={}),[Tr,lt].reduce(function(A,$){return b.hasOwnProperty($)&&y[$]&&y[$]!==b[$]&&(A[$]=y[$]),A},b)})(v.payload,u),I=n[R.meta.rid];if(!I&&(S=p({payload:R,config:o[d].config,instance:t,abort:Xg}))&&Fe(S)&&S.abort)return void(n[R.meta.rid]=!0);if(!I){var g=h+":"+d;e.dispatch(Z({},R,{type:g,_:{called:g,from:"queueDrain"}}))}}});var l=s.actions.filter(function(f,v){return!~c.processIndex.indexOf(v)});s.actions=l}}}var as=function(e){var r=e.data,t=e.action,n=e.instance,a=e.state,i=e.allPlugins,o=e.allMatches,s=e.store,u=e.EVENTS;try{var c=a.plugins,l=a.context,f=t.type,v=f.match(ft),d=r.exact.map(function(S){return S.pluginName});v&&(d=o.during.map(function(S){return S.pluginName}));var h=(function(S,R){return function(I,g,b){var y=g.config,A=g.name,$=A+"."+I.type;b&&($=b.event);var j=I.type.match(ft)?(function(G,K,re,N,M){return function(x,m){var C=N?N.name:G,L=m&&Mt(m)?m:re;if(N&&(!(L=m&&Mt(m)?m:[G]).includes(G)||L.length!==1))throw new Error("Method "+K+" can only abort "+G+" plugin. "+JSON.stringify(L)+" input valid");return Z({},M,{abort:{reason:x,plugins:L,caller:K,_:C}})}})(A,$,R,b,I):(function(G,K){return function(){throw new Error(G.type+" action not cancellable. Remove abort in "+K)}})(I,$);return{payload:Zg(I),instance:S,config:y||{},abort:j}}})(n,d),p=r.exact.reduce(function(S,R){var I=R.pluginName,g=R.methodName,b=!1;return g.match(/^initialize/)||g.match(/^reset/)||(b=!c[I].loaded),l.offline&&g.match(/^(page|track|identify)/)&&(b=!0),S[""+I]=b,S},{});return Promise.resolve(r.exact.reduce(function(S,R,I){var g=R.pluginName;return Promise.resolve(S).then(function(b){function y(){return Promise.resolve(b)}var A=(function(){if(r.namespaced&&r.namespaced[g])return Promise.resolve(r.namespaced[g].reduce(function($,j,G){return Promise.resolve($).then(function(K){return j.method&&Me(j.method)?((function(x,m){var C=Tv(x);if(C&&C.name===m){var L=Tv(C.method);throw new Error([m+" plugin is calling method "+x,"Plugins cant call self","Use "+C.method+" "+(L?"or "+L.method:"")+" in "+m+" plugin insteadof "+x].join(`
3
+ `))}})(j.methodName,j.pluginName),Promise.resolve(j.method({payload:K,instance:n,abort:(re=K,N=g,M=j.pluginName,function(x,m){return Z({},re,{abort:{reason:x,plugins:m||[N],caller:f,from:M||N}})}),config:Sv(j.pluginName,c,i),plugins:c})).then(function(x){var m=Fe(x)?x:{};return Promise.resolve(Z({},K,m))})):K;var re,N,M})},Promise.resolve(t))).then(function($){b[g]=$});b[g]=t})();return A&&A.then?A.then(y):y()})},Promise.resolve({}))).then(function(S){return Promise.resolve(r.exact.reduce(function(R,I,g){try{var b=r.exact.length===g+1,y=I.pluginName,A=i[y];return Promise.resolve(R).then(function($){var j=S[y]?S[y]:{};if(v&&(j=$),os(j,y))return is({data:j,method:f,instance:n,pluginName:y,store:s}),Promise.resolve($);if(os($,y))return b&&is({data:$,method:f,instance:n,store:s}),Promise.resolve($);if(p.hasOwnProperty(y)&&p[y]===!0)return s.dispatch({type:"queue",plugin:y,payload:j,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve($);var G=h(S[y],i[y]);return Promise.resolve(A[f]({abort:G.abort,payload:j,instance:n,config:Sv(y,c,i),plugins:c})).then(function(K){var re=Fe(K)?K:{},N=Z({},$,re),M=S[y];if(os(M,y))is({data:M,method:f,instance:n,pluginName:y,store:s});else{var x=f+":"+y;(x.match(/:/g)||[]).length<2&&!f.match(bv)&&!f.match(wv)&&n.dispatch(Z({},v?N:j,{type:x,_:{called:x,from:"submethod"}}))}return Promise.resolve(N)})})}catch($){return Promise.reject($)}},Promise.resolve(t))).then(function(R){if(!(f.match(ft)||f.match(/^registerPlugin/)||f.match(wv)||f.match(bv)||f.match(/^params/)||f.match(/^userIdChanged/))){if(u.plugins.includes(f),R._&&R._.originalAction===f)return R;var I=Z({},R,{_:{originalAction:R.type,called:R.type,from:"engineEnd"}});Ev(R,r.exact.length)&&!f.match(/End$/)&&(I=Z({},I,{type:R.type+"Aborted"})),s.dispatch(I)}return R})})}catch(S){return Promise.reject(S)}},ft=/Start$/,bv=/^bootstrap/,wv=/^ready/;function is(e){var r=e.pluginName,t=e.method+"Aborted"+(r?":"+r:"");e.store.dispatch(Z({},e.data,{type:t,_:{called:t,from:"abort"}}))}function Sv(e,r,t){var n=r[e]||t[e];return n&&n.config?n.config:{}}function Iv(e,r){return r.reduce(function(t,n){return n[e]?t.concat({methodName:e,pluginName:n.name,method:n[e]}):t},[])}function Pv(e,r){var t=e.replace(ft,""),n=r?":"+r:"";return[""+e+n,""+t+n,t+"End"+n]}function os(e,r){var t=e.abort;return!!t&&(t===!0||Rv(t,r)||t&&Rv(t.plugins,r))}function Ev(e,r){var t=e.abort;if(!t)return!1;if(t===!0||Pr(t))return!0;var n=t.plugins;return Mt(t)&&t.length===r||Mt(n)&&n.length===r}function Mt(e){return Array.isArray(e)}function Rv(e,r){return!(!e||!Mt(e))&&e.includes(r)}function Tv(e){var r=e.match(/(.*):(.*)/);return!!r&&{method:r[1],name:r[2]}}function Zg(e){return Object.keys(e).reduce(function(r,t){return t==="type"||(r[t]=Fe(e[t])?Object.assign({},e[t]):e[t]),r},{})}function ey(e,r,t){var n={};return function(a){return function(i){return function(o){try{var s,u=function(b){return s?b:i(f)},c=o.type,l=o.plugins,f=o;if(o.abort)return Promise.resolve(i(o));if(c===ee.enablePlugin&&a.dispatch({type:ee.initializeStart,plugins:l,disabled:[],fromEnable:!0,meta:o.meta}),c===ee.disablePlugin&&setTimeout(function(){return mv(o.meta.rid,{payload:o})},0),c===ee.initializeEnd){var v=r(),d=Object.keys(v),h=d.filter(function(b){return l.includes(b)}).map(function(b){return v[b]}),p=[],S=[],R=o.disabled,I=h.map(function(b){var y=b.loaded,A=b.name,$=b.config;return gv(b,function(){return y({config:$})},1e4).then(function(j){return n[A]||(a.dispatch({type:ee.pluginReadyType(A),name:A,events:Object.keys(b).filter(function(G){return!ts.includes(G)})}),n[A]=!0),p=p.concat(A),b}).catch(function(j){if(j instanceof Error)throw new Error(j);return S=S.concat(j.name),j})});Promise.all(I).then(function(b){var y={plugins:p,failed:S,disabled:R};setTimeout(function(){d.length===I.length+R.length&&a.dispatch(Z({},{type:ee.ready},y))},0)})}var g=(function(){if(c!==ee.bootstrap)return/^ready:([^:]*)$/.test(c)&&setTimeout(function(){return yv(a,r,e)},0),Promise.resolve((function(b,y,A,$,j){try{var G=Me(y)?y():y,K=b.type,re=K.replace(ft,"");if(b._&&b._.called)return Promise.resolve(b);var N=A.getState(),M=(C=G,(L=N.plugins)===void 0&&(L={}),(F=b.options)===void 0&&(F={}),Object.keys(C).filter(function(w){var T=F.plugins||{};return Ug(T[w])?T[w]:T.all!==!1&&(!L[w]||L[w].enabled!==!1)}).map(function(w){return C[w]}));K===ee.initializeStart&&b.fromEnable&&(M=Object.keys(N.plugins).filter(function(w){var T=N.plugins[w];return b.plugins.includes(w)&&!T.initialized}).map(function(w){return G[w]}));var x=M.map(function(w){return w.name}),m=(function(w,T){var k=Pv(w).map(function(H){return Iv(H,T)});return T.reduce(function(H,J){var Y=J.name,le=Pv(w,Y).map(function(_e){return Iv(_e,T)}),ne=le[0],ue=le[1],ae=le[2];return ne.length&&(H.beforeNS[Y]=ne),ue.length&&(H.duringNS[Y]=ue),ae.length&&(H.afterNS[Y]=ae),H},{before:k[0],beforeNS:{},during:k[1],duringNS:{},after:k[2],afterNS:{}})})(K,M);return Promise.resolve(as({action:b,data:{exact:m.before,namespaced:m.beforeNS},state:N,allPlugins:G,allMatches:m,instance:A,store:$,EVENTS:j})).then(function(w){function T(){var J=(function(){if(K.match(ft))return Promise.resolve(as({action:Z({},k,{type:re+"End"}),data:{exact:m.after,namespaced:m.afterNS},state:N,allPlugins:G,allMatches:m,instance:A,store:$,EVENTS:j})).then(function(Y){Y.meta&&Y.meta.hasCallback&&mv(Y.meta.rid,{payload:Y})})})();return J&&J.then?J.then(function(){return w}):w}if(Ev(w,x.length))return w;var k,H=(function(){if(K!==re)return Promise.resolve(as({action:Z({},w,{type:re}),data:{exact:m.during,namespaced:m.duringNS},state:N,allPlugins:G,allMatches:m,instance:A,store:$,EVENTS:j})).then(function(J){k=J});k=w})();return H&&H.then?H.then(T):T()})}catch(w){return Promise.reject(w)}var C,L,F})(o,r,e,a,t)).then(function(b){var y=i(b);return s=1,y})})();return Promise.resolve(g&&g.then?g.then(u):u(g))}catch(b){return Promise.reject(b)}}}}}function ry(e){return function(r){return function(t){return function(n){var a=n.type,i=n.key,o=n.value,s=n.options;if(a===ee.setItem||a===ee.removeItem){if(n.abort)return t(n);a===ee.setItem?e.setItem(i,o,s):e.removeItem(i,s)}return t(n)}}}}var ty=function(){var e=this;this.before=[],this.after=[],this.addMiddleware=function(r,t){e[t]=e[t].concat(r)},this.removeMiddleware=function(r,t){var n=e[t].findIndex(function(a){return a===r});n!==-1&&(e[t]=[].concat(e[t].slice(0,n),e[t].slice(n+1)))},this.dynamicMiddlewares=function(r){return function(t){return function(n){return function(a){var i={getState:t.getState,dispatch:function(s){return t.dispatch(s)}},o=e[r].map(function(s){return s(i)});return ut.apply(void 0,o)(n)(a)}}}}};function ny(e){return function(r,t){r===void 0&&(r={});var n={};if(t.type==="initialize:aborted")return r;if(/^registerPlugin:([^:]*)$/.test(t.type)){var a=Ov(t.type,"registerPlugin"),i=e()[a];if(!i||!a)return r;var o=t.enabled,s=i.config;return n[a]={enabled:o,initialized:!!o&&!i.initialize,loaded:!!o&&!!i.loaded({config:s}),config:s},Z({},r,n)}if(/^initialize:([^:]*)$/.test(t.type)){var u=Ov(t.type,ee.initialize),c=e()[u];return c&&u?(n[u]=Z({},r[u],{initialized:!0,loaded:!!c.loaded({config:c.config})}),Z({},r,n)):r}if(/^ready:([^:]*)$/.test(t.type))return n[t.name]=Z({},r[t.name],{loaded:!0}),Z({},r,n);switch(t.type){case ee.disablePlugin:return Z({},r,Cv(t.plugins,!1,r));case ee.enablePlugin:return Z({},r,Cv(t.plugins,!0,r));default:return r}}}function Ov(e,r){return e.substring(r.length+1,e.length)}function Cv(e,r,t){return e.reduce(function(n,a){return n[a]=Z({},t[a],{enabled:r}),n},t)}function _v(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var ay={last:{},history:[]};function iy(e,r){e===void 0&&(e=ay);var t=r.options,n=r.meta;if(r.type===ee.track){var a=_v(Z({event:r.event,properties:r.properties},Object.keys(t).length&&{options:t},{meta:n}));return Z({},e,{last:a,history:e.history.concat(a)})}return e}var oy={actions:[]};function sy(e,r){e===void 0&&(e=oy);var t=r.payload;switch(r.type){case"queue":var n;return n=t&&t.type&&t.type===ee.identify?[r].concat(e.actions):e.actions.concat(r),Z({},e,{actions:n});case"dequeue":return[];default:return e}}var Av=/#.*$/;function uy(e){var r=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(r&&r[3]?r[3].split("?")[0].replace(Av,""):"")}var kv,qv,$v,Uv,cy=function(e){if(e===void 0&&(e={}),!Ce)return e;var r=document,t=r.title,n=r.referrer,a=window,i=a.location,o=a.innerWidth,s=a.innerHeight,u=i.hash,c=i.search,l=(function(v){var d=(function(){if(Ce){for(var h,p=document.getElementsByTagName("link"),S=0;h=p[S];S++)if(h.getAttribute("rel")==="canonical")return h.getAttribute("href")}})();return d?d.match(/\?/)?d:d+v:window.location.href.replace(Av,"")})(c),f={title:t,url:l,path:uy(l),hash:u,search:c,width:o,height:s};return n&&n!==""&&(f.referrer=n),Z({},f,e)},ly={last:{},history:[]};function fy(e,r){e===void 0&&(e=ly);var t=r.options;if(r.type===ee.page){var n=_v(Z({properties:r.properties,meta:r.meta},Object.keys(t).length&&{options:t}));return Z({},e,{last:n,history:e.history.concat(n)})}return e}kv=(function(){if(!Ce)return!1;var e=navigator.appVersion;return~e.indexOf("Win")?"Windows":~e.indexOf("Mac")?"MacOS":~e.indexOf("X11")?"UNIX":~e.indexOf("Linux")?"Linux":"Unknown OS"})(),qv=Ce?document.referrer:null,$v=Fg(),Uv=Bg();var Lv={initialized:!1,sessionId:pn(),app:null,version:null,debug:!1,offline:!!Ce&&!navigator.onLine,os:{name:kv},userAgent:Ce?navigator.userAgent:"node",library:{name:rs,version:"0.13.1"},timezone:Uv,locale:$v,campaign:{},referrer:qv};function dy(e,r){e===void 0&&(e=Lv);var t=e.initialized,n=r.campaign;switch(r.type){case ee.campaign:return Z({},e,{campaign:n});case ee.offline:return Z({},e,{offline:!0});case ee.online:return Z({},e,{offline:!1});default:return t?e:Z({},Lv,e,{initialized:!0})}}var vy=["plugins","reducers","storage"];function hy(e,r,t){if(Ce){var n=window[(t?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,r)})}}function py(e){var r=hy.bind(null,"online offline",function(t){return Promise.resolve(!navigator.onLine).then(e)});return r(!0),function(t){return r(!1)}}function Nv(){return jr(rs,[]),function(e){return function(r,t,n){var a=e(r,t,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return it[at][rs].push(o.action||o),i(o)}})}}}function xv(e){return function(){return ut(ut.apply(null,arguments),Nv())}}function ss(e){return e?ov(e)?e:[e]:[]}function jv(e,r,t){e===void 0&&(e={});var n,a,i=pn();return r&&(Dt[i]=(n=r,a=(function(o){for(var s,u=o||Array.prototype.slice.call(arguments),c=0;c<u.length;c++)if(Me(u[c])){s=u[c];break}return s})(t),function(o){a&&a(o),n(o)})),Z({},e,{rid:i,ts:new Date().getTime()},r?{hasCallback:!0}:{})}function my(e){e===void 0&&(e={});var r=e.reducers||{},t=e.initialUser||{},n=(e.plugins||[]).reduce(function(w,T){if(Me(T))return w.middlewares=w.middlewares.concat(T),w;if(T.NAMESPACE&&(T.name=T.NAMESPACE),!T.name)throw new Error("https://lytics.dev/errors/1");T.config||(T.config={});var k=T.EVENTS?Object.keys(T.EVENTS).map(function(Y){return T.EVENTS[Y]}):[];w.pluginEnabled[T.name]=!(T.enabled===!1||T.config.enabled===!1),delete T.enabled,T.methods&&(w.methods[T.name]=Object.keys(T.methods).reduce(function(Y,le){var ne;return Y[le]=(ne=T.methods[le],function(){for(var ue=Array.prototype.slice.call(arguments),ae=new Array(ne.length),_e=0;_e<ue.length;_e++)ae[_e]=ue[_e];return ae[ae.length]=y,ne.apply({instance:y},ae)}),Y},{}),delete T.methods);var H=Object.keys(T).concat(k),J=new Set(w.events.concat(H));if(w.events=Array.from(J),w.pluginsArray=w.pluginsArray.concat(T),w.plugins[T.name])throw new Error(T.name+"AlreadyLoaded");return w.plugins[T.name]=T,w.plugins[T.name].loaded||(w.plugins[T.name].loaded=function(){return!0}),w},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=e.storage?e.storage:{getItem:xr,setItem:jr,removeItem:ot},i=(function(w){return function(T,k,H){return k.getState("user")[T]||(H&&Fe(H)&&H[T]?H[T]:pv(w)[T]||xr(ns(T))||null)}})(a),o=n.plugins,s=n.events.filter(function(w){return!ts.includes(w)}).sort(),u=new Set(s.concat(yn).filter(function(w){return!ts.includes(w)})),c=Array.from(u).sort(),l=function(){return o},f=new ty,v=f.addMiddleware,d=f.removeMiddleware,h=f.dynamicMiddlewares,p=function(){throw new Error("Abort disabled inListener")},S=Hg(),R=pv(a),I=Z({},R,t,S.an_uid?{userId:S.an_uid}:{},S.an_aid?{anonymousId:S.an_aid}:{});I.anonymousId||(I.anonymousId=pn());var g=Z({enable:function(w,T){return new Promise(function(k){m.dispatch({type:ee.enablePlugin,plugins:ss(w),_:{originalAction:ee.enablePlugin}},k,[T])})},disable:function(w,T){return new Promise(function(k){m.dispatch({type:ee.disablePlugin,plugins:ss(w),_:{originalAction:ee.disablePlugin}},k,[T])})}},n.methods),b=!1,y={identify:function(w,T,k,H){try{var J=Pr(w)?w:null,Y=Fe(w)?w:T,le=k||{},ne=y.user();jr(ns(Tr),J);var ue=J||Y.userId||i(Tr,y,Y);return Promise.resolve(new Promise(function(ae){m.dispatch(Z({type:ee.identifyStart,userId:ue,traits:Y||{},options:le,anonymousId:ne.anonymousId},ne.id&&ne.id!==J&&{previousId:ne.id}),ae,[T,k,H])}))}catch(ae){return Promise.reject(ae)}},track:function(w,T,k,H){try{var J=Fe(w)?w.event:w;if(!J||!Pr(J))throw new Error("EventMissing");var Y=Fe(w)?w:T||{},le=Fe(k)?k:{};return Promise.resolve(new Promise(function(ne){m.dispatch({type:ee.trackStart,event:J,properties:Y,options:le,userId:i(Tr,y,T),anonymousId:i(lt,y,T)},ne,[T,k,H])}))}catch(ne){return Promise.reject(ne)}},page:function(w,T,k){try{var H=Fe(w)?w:{},J=Fe(T)?T:{};return Promise.resolve(new Promise(function(Y){m.dispatch({type:ee.pageStart,properties:cy(H),options:J,userId:i(Tr,y,H),anonymousId:i(lt,y,H)},Y,[w,T,k])}))}catch(Y){return Promise.reject(Y)}},user:function(w){if(w===Tr||w==="id")return i(Tr,y);if(w===lt||w==="anonId")return i(lt,y);var T=y.getState("user");return w?rv(T,w):T},reset:function(w){return new Promise(function(T){m.dispatch({type:ee.resetStart},T,w)})},ready:function(w){return b&&w({plugins:g,instance:y}),y.on(ee.ready,function(T){w&&w(T),b=!0})},on:function(w,T){if(!w||!Me(T))return!1;if(w===ee.bootstrap)throw new Error(".on disabled for "+w);var k=/Start$|Start:/;if(w==="*"){var H=function(ne){return function(ue){return function(ae){return ae.type.match(k)&&T({payload:ae,instance:y,plugins:o}),ue(ae)}}},J=function(ne){return function(ue){return function(ae){return ae.type.match(k)||T({payload:ae,instance:y,plugins:o}),ue(ae)}}};return v(H,bn),v(J,wn),function(){d(H,bn),d(J,wn)}}var Y=w.match(k)?bn:wn,le=function(ne){return function(ue){return function(ae){return ae.type===w&&T({payload:ae,instance:y,plugins:o,abort:p}),ue(ae)}}};return v(le,Y),function(){return d(le,Y)}},once:function(w,T){if(!w||!Me(T))return!1;if(w===ee.bootstrap)throw new Error(".once disabled for "+w);var k=y.on(w,function(H){T({payload:H.payload,instance:y,plugins:o,abort:p}),k()});return k},getState:function(w){var T=m.getState();return w?rv(T,w):Object.assign({},T)},dispatch:function(w){var T=Pr(w)?{type:w}:w;if(yn.includes(T.type))throw new Error("reserved action "+T.type);var k=Z({},T,{_:Z({originalAction:T.type},w._||{})});m.dispatch(k)},enablePlugin:g.enable,disablePlugin:g.disable,plugins:g,storage:{getItem:a.getItem,setItem:function(w,T,k){m.dispatch({type:ee.setItemStart,key:w,value:T,options:k})},removeItem:function(w,T){m.dispatch({type:ee.removeItemStart,key:w,options:T})}},setAnonymousId:function(w,T){y.storage.setItem(Rr,w,T)},events:{core:yn,plugins:s}},A=n.middlewares.concat([function(w){return function(T){return function(k){return k.meta||(k.meta=jv()),T(k)}}},h(bn),ey(y,l,{all:c,plugins:s}),ry(a),Jg(y),Qg(y),h(wn)]),$={context:dy,user:Yg(a),page:fy,track:iy,plugins:ny(l),queue:sy},j=ut,G=ut;if(Ce&&e.debug){var K=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;K&&(j=K({trace:!0,traceLimit:25})),G=function(){return arguments.length===0?Nv():Fe(typeof arguments[0])?xv():xv().apply(null,arguments)}}var re,N=(function(w){return Object.keys(w).reduce(function(T,k){return vy.includes(k)||(T[k]=w[k]),T},{})})(e),M=n.pluginsArray.reduce(function(w,T){var k=T.name,H=T.config,J=T.loaded,Y=n.pluginEnabled[k];return w[k]={enabled:Y,initialized:!!Y&&!T.initialize,loaded:!!J({config:H}),config:H},w},{}),x={context:N,user:I,plugins:M},m=fv((function(w){for(var T=Object.keys(w),k={},H=0;H<T.length;H++){var J=T[H];typeof w[J]===Er&&(k[J]=w[J])}var Y,le=Object.keys(k);try{(function(ne){Object.keys(ne).forEach(function(ue){var ae=ne[ue];if(typeof ae(void 0,{type:es})===pr||typeof ae(void 0,{type:Vg})===pr)throw new Error(jt+" "+ue+" "+pr)})})(k)}catch(ne){Y=ne}return function(ne,ue){if(ne===void 0&&(ne={}),Y)throw Y;for(var ae=!1,_e={},xe=0;xe<le.length;xe++){var Be=le[xe],Le=ne[Be],tr=(0,k[Be])(Le,ue);if(typeof tr===pr){var Cr=zg(Be,ue);throw new Error(Cr)}_e[Be]=tr,ae=ae||tr!==Le}return ae?_e:ne}})(Z({},$,r)),x,G(j(Kg.apply(void 0,A))));m.dispatch=(re=m.dispatch,function(w,T,k){var H=Z({},w,{meta:jv(w.meta,T,ss(k))});return re.apply(null,[H])});var C=Object.keys(o);m.dispatch({type:ee.bootstrap,plugins:C,config:N,params:S,user:I,initialUser:t,persistedUser:R});var L=C.filter(function(w){return n.pluginEnabled[w]}),F=C.filter(function(w){return!n.pluginEnabled[w]});return m.dispatch({type:ee.registerPlugins,plugins:C,enabled:n.pluginEnabled}),n.pluginsArray.map(function(w,T){var k=w.bootstrap,H=w.config,J=w.name;k&&Me(k)&&k({instance:y,config:H,payload:w}),m.dispatch({type:ee.registerPluginType(J),name:J,enabled:n.pluginEnabled[J],plugin:w}),n.pluginsArray.length===T+1&&m.dispatch({type:ee.initializeStart,plugins:L,disabled:F})}),py(function(w){m.dispatch({type:w?ee.offline:ee.online})}),(function(w,T,k){setInterval(function(){return yv(w,T,k)},3e3)})(m,l,y),y}var bn="before",wn="after",Mr="cookie",Fr=Fv(),Dv=Sn,gy=Sn;function Mv(e){return Fr?Sn(e,"",-1):ot(e)}function Fv(){if(Fr!==void 0)return Fr;var e=Mr+Mr;try{Sn(e,e),Fr=document.cookie.indexOf(e)!==-1,Mv(e)}catch{Fr=!1}return Fr}function Sn(e,r,t,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return Fr===!1&&(o?jr(e,r):xr(e)),o?document.cookie=e+"="+encodeURIComponent(r)+(t?"; expires="+new Date(+new Date+1e3*t).toUTCString()+(n?"; path="+n:"")+(a?"; domain="+a:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var mr="localStorage",yy=Zo.bind(null,mr);st(mr,"getItem",xr),st(mr,"setItem",jr),st(mr,"removeItem",ot);var gr="sessionStorage",by=Zo.bind(null,gr);st(gr,"getItem",xr),st(gr,"setItem",jr),st(gr,"removeItem",ot);function dt(e){var r=e;try{if((r=JSON.parse(e))==="true")return!0;if(r==="false")return!1;if(Fe(r))return r;parseFloat(r)===r&&(r=parseFloat(r))}catch{}if(r!==null&&r!=="")return r}var wy=yy(),Sy=by(),Iy=Fv();function Br(e,r){if(e){var t=us(r),n=!ds(t),a=cs(t)?dt(localStorage.getItem(e)):void 0;if(n&&!nt(a))return a;var i=ls(t)?dt(Dv(e)):void 0;if(n&&i)return i;var o=fs(t)?dt(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var s=xr(e);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function In(e,r,t){if(e&&!nt(r)){var n={},a=us(t),i=JSON.stringify(r),o=!ds(a);return cs(a)&&(n[mr]=En(mr,r,dt(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[mr]:ls(a)&&(n[Mr]=En(Mr,r,dt(Dv(e))),gy(e,i),o)?n[Mr]:fs(a)&&(n[gr]=En(gr,r,dt(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[gr]:(n[Nr]=En(Nr,r,xr(e)),jr(e,r),o?n[Nr]:n)}}function Py(e,r){if(e){var t=us(r),n=Br(e,nv),a={};return!nt(n.localStorage)&&cs(t)&&(localStorage.removeItem(e),a[mr]=n.localStorage),!nt(n.cookie)&&ls(t)&&(Mv(e),a[Mr]=n.cookie),!nt(n.sessionStorage)&&fs(t)&&(sessionStorage.removeItem(e),a[gr]=n.sessionStorage),!nt(n.global)&&Pn(t,Nr)&&(ot(e),a[Nr]=n.global),a}}function us(e){return e?Pr(e)?e:e.storage:tv}function cs(e){return wy&&Pn(e,mr)}function ls(e){return Iy&&Pn(e,Mr)}function fs(e){return Sy&&Pn(e,gr)}function ds(e){return e===nv||e==="all"}function Pn(e,r){return e===tv||e===r||ds(e)}function En(e,r,t){return{location:e,current:r,previous:t}}var Ey={setItem:In,getItem:Br,removeItem:Py};function Ry(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Bv(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,n)}return t}function Hv(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Bv(Object(t),!0).forEach(function(n){Ry(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Bv(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Ty(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r={storage:Ey};return my(Hv(Hv({},r),e))}function Oy(e){if(typeof window>"u")return;const{addEventListener:r,history:t,location:n}=window;let a=n.pathname;r("popstate",()=>e(n.pathname)),["push","replace"].map(i=>{const o=`${i}State`;if(o!=="pushState"&&o!=="replaceState")return;const s=t[o];t[o]=function(...u){const c=u[2]?.toString()||"",l=_y(c);return a!==l&&(a=l,setTimeout(()=>e(c),0)),s.apply(t,u)}})}function Cy(e,r){const t=e.indexOf(r);return t>-1?e.slice(0,t):e}function _y(e){return["#","?"].forEach(r=>e=Cy(e,r)),e}function Ay(){Oy(()=>{yr.page()})}var vs="up",hs="down";function ky(e){if(e===void 0&&(e={}),!Ce)return Xo;var r=Wv(),t=ps(),n=Gv(),a=Rn(n,r),i=Rn(t,r),o=[],s=[],u=[],c=n,l=a,f=i,v=Object.keys(e);if(!v.length)return Xo;var d=v.map(function(p){return Number(p)}),h=Wg(function(){var p=Wv(),S=(function(N,M){return M.map(function(x){return x===100?N-5:N*(x/100)})})(p,d),R=ps(),I=Gv(),g=Rn(I,p),b=Rn(R,p);if(l=g>l?g:l,f=b<f?b:f,!(o.length>=d.length)){var y=c===I,A=vs;y?A="initial":c<=I&&(A=hs);var $=S,j=d;(A===vs||y)&&($=S.slice().reverse(),j=d.slice().reverse());var G=j.reduce(function(N,M,x){var m=$[x];return u.includes(M)&&I<=m&&(u=u.filter(function(C){return C!==M}),N.singleFunction=M),A===hs&&!o.includes(M)&&I>=m&&M>i?(s.push(M),N.callbacks=N.callbacks.concat(M),N):A===vs&&!o.includes(M)&&I<=m&&M<=g?(N.foundFunc=[M],N):(y&&I>=m&&N.foundFunc.length===0&&(N.foundFunc=[M]),!s.includes(M)&&I>=m&&(s.push(M),N.singleFunction?u.push(M):N.singleFunction=M),N)},{foundFunc:[],singleFunction:null,callbacks:[],direction:A});if(c=I,A===hs&&G.callbacks&&G.callbacks.forEach(function(N){Me(e[N])&&(e[N]({trigger:N,direction:A,scrollMin:f,scrollMax:l,range:[f,l]}),o.push(N))}),G.singleFunction){var K=G.singleFunction,re=G.direction;Me(e[K])&&e[K]({trigger:K,direction:re,scrollMin:f,scrollMax:l,range:[f,l]}),o.push(K)}}},500);return window.addEventListener("scroll",h),function(){return window.removeEventListener("scroll",h)}}function ps(){return Ce?document.body.scrollTop||document.documentElement.scrollTop:0}function qy(){return Ce?window.innerHeight||document.documentElement.clientHeight:0}function Gv(){return Math.round(ps()+qy())}function Wv(){if(!Ce)return 0;var e=document.body,r=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,r.clientHeight,r.scrollHeight,r.offsetHeight)}function Rn(e,r){return Math.round(e/r*100)}var ms="Event",Vv=ms+"Listener";function $y(e){return function(r,t,n,a){var i=n||Xo,o=a||!1;if(!Ce)return i;var s=Tn(t),u=Tn(r,!0);if(!u.length)throw new Error("noElements");if(!s.length)throw new Error("no"+ms);var c=[];return(function l(f){f&&(c=[]);for(var v=f?"add"+Vv:"remove"+Vv,d=0;d<u.length;d++){var h=u[d];c[d]=f?o&&o.once?Uy(i):i:c[d]||i;for(var p=0;p<s.length;p++)h[v]?h["on"+s[p]]=f?c[d]:null:h[v](s[p],c[d],o)}return l.bind(null,!f)})(e)}}function Tn(e,r){if(Pr(e))return r?Tn(document.querySelectorAll(e)):(t=e).split(t.indexOf(",")>-1?",":" ").map(function(o){return o.trim()});var t;if(NodeList.prototype.isPrototypeOf(e)){for(var n=[],a=e.length>>>0;a--;)n[a]=e[a];return n}var i=Mg(e);return r?i.map(function(o){return Pr(o)?Tn(o,!0):o}).flat():i}function Uy(e,r){var t;return function(){return e&&(t=e.apply(this,arguments),e=null),t}}var gs=$y(ms);function zv(e,r){return Ce&&Me(window[e])?(t=window[e],n=r,(a=window)===void 0&&(a=null),Me(t)?function(){t.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=r;var t,n,a}zv.bind(null,"onerror"),zv.bind(null,"onload");var Kv=typeof window>"u",Jv="hidden";function Ly(e){if(Kv)return!1;var r=Ny(),t="".concat(r.replace(/[H|h]idden/,""),"visibilitychange"),n=function(){return e(!!document[r])},a=function(){return document.addEventListener(t,n)};return a(),function(){return document.removeEventListener(t,n),a}}function Ny(){var e=["webkit","moz","ms","o"];return Kv||Jv in document?Jv:e.reduce(function(r,t){var n=t+"Hidden";return!r&&n in document?n:r},null)}var xy=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function jy(e,r){r===void 0&&(r={});var t=(function(o,s){var u=this,c=!1;return function(l){c||(o.call(u,l),c=!0,setTimeout(function(){return c=!1},s))}})(e,r.throttle||1e4),n=[];function a(){var o=Ly(function(s){s||t({type:"tabVisible"})});return n=[o].concat(xy.map(function(s){return gs(document,s,t)})).concat(gs(window,"load",t)).concat(gs(window,"scroll",t,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function Dy(e){var r,t,n=e.onIdle,a=e.onWakeUp,i=e.onHeartbeat,o=e.timeout,s=o,u=e.throttle,c=u===void 0?2e3:u,l=!1,f=!1,v=new Date,d=function(){return clearTimeout(r)};function h(S){d(),i&&!l&&i(Ft(v),S),a&&l&&(l=!1,a(Ft(t),S),v=new Date),r=setTimeout(function(){l=!0,n&&(t=new Date,n(Ft(v),S))},s)}var p=jy(h,{throttle:c});return{disable:function(){f=!0,l=!1,d();var S=p();return function(){return f=!1,v=new Date,h({type:"load"}),S()}},getStatus:function(){return{isIdle:l,isDisabled:f,active:l?0:Ft(v,f),idle:l?Ft(t,f):0}}}}function Ft(e,r){return r?0:Math.round((new Date-e)/1e3)}const Yv=5e3;class My{element;isInViewport=!1;isAwake=!1;isFlushing;observer;lastEventAt=Date.now();registeredView=!1;viewCallback;activeDurationCallback;idleDurationCallback;scrollCallback;constructor(r){this.element=r.element,this.viewCallback=r.viewCallback,this.activeDurationCallback=r.activeDurationCallback,this.idleDurationCallback=r.idleDurationCallback,this.scrollCallback=r.scrollCallback,this.observer=new IntersectionObserver(t=>{t.forEach(n=>{this.handleInViewPort(n.isIntersecting)})},{threshold:0}),this.observer.observe(this.element),Dy({onIdle:t=>this.handleAwake(!1,t),onWakeUp:t=>this.handleAwake(!0,t),timeout:Yv}),ky({25:this.handleScroll.bind(this),50:this.handleScroll.bind(this),75:this.handleScroll.bind(this),90:this.handleScroll.bind(this),100:this.handleScroll.bind(this)})}flush(){this.isFlushing=!0,this.handleAwake(!this.isAwake)}handleInViewPort(r){r?(this.isAwake=!0,this.trackInViewport()):this.handleAwake(!1),this.isInViewport=r}handleAwake(r,t=Math.round((Date.now()-this.lastEventAt)/1e3)){this.isAwake=r,this.lastEventAt=r?Date.now()-t*Yv:Date.now(),this.isInViewport&&this.trackAwake(r,t)}handleScroll(r){this.scrollCallback&&this.scrollCallback(r)}handleVisibilityChange(){this.isAwake=!1;const r=Math.round((Date.now()-this.lastEventAt)/1e3);r>1&&(this.lastEventAt=Date.now(),this.trackAwake(!1,r))}trackAwake(r,t){!r&&this.activeDurationCallback&&this.activeDurationCallback(t,this.isFlushing,this.lastEventAt),r&&this.idleDurationCallback&&this.idleDurationCallback(t,this.isFlushing,this.lastEventAt)}trackInViewport(){this.registeredView||(this.registeredView=!0,this.viewCallback&&this.viewCallback())}}function Qv(e){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e):e()}function Fy(e,r){r=r||{};var t,n,a=[],i=r.max||1/0;function o(){clearInterval(t),e(a.splice(0,i)),s()}function s(){t=setInterval(o,r.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(t)}}}const Xv="sesamy_session_id";function By(){let e=sessionStorage.getItem(Xv);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(Xv,e)),e}let Zv=!1,On,Cn,ys;function eh(e){return JSON.stringify(e.map(r=>{const{campaign:t,...n}=r.properties||{};return{anonymousId:r.anonymousId,userId:r.userId,type:r.type,properties:n,clientId:ys,requestId:Math.random().toString(36).slice(2,9),sessionId:By(),timestamp:new Date().toISOString(),version:kt,event:r.event,context:{...r.context,page:{url:window.location.href,title:document.title,referrer:document.referrer,itemSrc:ge("sesamy:item-src"),publisherContentId:ge("sesamy:publisher-content-id")},campaign:t,locale:navigator.language,library:zo,userAgent:navigator.userAgent,clientId:ys}}}))}const rh=Fy(async e=>{if(e.length>0){const r=eh(e);Zv?navigator.sendBeacon(Cn,r):(await fetch(Cn,{method:"POST",body:r,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function bs(e){if(e.anonymousId)if(e.properties?.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(Cn,eh([r]))}else rh.push(e)}function Hy(){return Zv=!0,rh.flush()}function Gy(e,r,t){On=r,Cn=`${or("logs",t)}/events`,ys=e}const Wy={name:"custom-analytics-plugin",page:({payload:e})=>{if(!On)return;const{properties:r,anonymousId:t,userId:n,event:a}=e;bs({anonymousId:t,userId:n,properties:r,event:a,type:"page"})},track:({payload:e})=>{if(!On)return;const{properties:r,anonymousId:t,userId:n,event:a}=e;bs({anonymousId:t,userId:n,properties:r,event:a,type:"track"})},identify:({payload:e})=>{if(!On)return;const{properties:r,anonymousId:t,userId:n}=e;bs({anonymousId:t,userId:n,properties:r,type:"identify"})}},th=["source","medium","campaign","term","content"],Or="utm_",Vy=1800*1e3;function nh(e){return e?Date.now()-parseInt(e,10)>Vy:!0}function ah(){const e=document.referrer||"";if(!e)return;const r=Br(`${Or}set_at`);(nh(r)||!Br(`${Or}referrer`))&&In(`${Or}referrer`,e)}function zy(){const e=()=>{const t={};for(const a of th){const i=Br(`${Or}${a}`);i&&(t[`utm_${a}`]=i)}const n=Br(`${Or}referrer`);return n&&(t.utm_referrer=n),t};return{name:"attribution-tracking",initialize(){ah()},campaign({payload:t}){const n=t?.campaign||{},a=Br(`${Or}set_at`);if(Object.keys(n).length>0&&nh(a)){for(const o of th){const s=n[o];s&&In(`${Or}${o}`,s)}In(`${Or}set_at`,String(Date.now()))}ah()},page({payload:t}){return t.properties.campaign=e(),t},track({payload:t}){return t.properties.campaign=e(),t},getStoredCampaignData:e}}const Ky=zy(),ih=new Map,oh=new Map;function Jy({clientId:e,enabled:r=!0,environment:t}){Gy(e,r,t),r&&(window.addEventListener("beforeunload",()=>{oh.forEach((n,a)=>{n.bind(a)()}),Hy()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&ih.forEach((n,a)=>{n.bind(a)()})}),Ay(),Qv(()=>{const n=new My({element:document.body,viewCallback:()=>{yr.page()},activeDurationCallback:(a,i,o)=>{yr.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{yr.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{yr.track("scroll",{scroll:a.scrollMax})}});oh.set(document.body,()=>{n.flush()}),ih.set(document.body,()=>{n.handleVisibilityChange()})}),window.addEventListener(er.AUTHENTICATED,async n=>{const a=n;await yr.identify(a.detail.sub)}),window.addEventListener(er.LOGOUT,async()=>{await yr.track("logout",{}),await yr.reset()}))}const yr=Ty({app:zo,version:kt,plugins:[Ky,Wy]});function sh(e,r){yr.track(e,r)}const Yy=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function uh(){return new Promise(e=>{const r=Yy.map(t=>{const n=document.createElement("div");return n.innerHTML="&nbsp;",n.id=t,n.style.position="absolute",document.body.appendChild(n),n});window.setTimeout(()=>{const t=!r.every(n=>document.querySelector(`#${n.id}`)?.offsetParent);r.forEach(n=>n.remove()),e(t)},100)})}function ch(){const e=navigator.userAgent.toLowerCase(),r=[{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 t of r)if(t.regex.test(e))return{isInAppBrowser:!0,browserName:t.name};return/; wv\)/.test(e)?{isInAppBrowser:!0,browserName:"Unknown In-App Browser"}:{isInAppBrowser:!1,browserName:null}}/*!
4
4
  *
5
5
  * detectIncognito v1.6.2
6
6
  *
@@ -139,7 +139,7 @@ CAUSE: `+d.stack,y.response=g,y.status=g.status,y.url=f,g.type==="opaque")throw
139
139
  <button class="btn-primary" data-action="send">Send Diagnostics</button>
140
140
  </div>
141
141
  <div class="status" style="display: none;"></div>
142
- `,e}function yh(e){return new Promise(r=>{const t=sb(),{close:n}=ev(t,{closeOnBackdropClick:!1,closeOnEscape:!0}),a=t.querySelector('[data-action="cancel"]'),i=t.querySelector('[data-action="send"]'),o=t.querySelector(".status"),s=(u,c)=>{o.style.display="block",o.className=`status ${c}`,c==="loading"?o.innerHTML=`<span class="spinner"></span>${u}`:o.textContent=u};a.addEventListener("click",()=>{n(),r({sent:!1})}),i.addEventListener("click",async()=>{i.disabled=!0,a.disabled=!0,s("Collecting diagnostics...","loading");try{const u=await ph(e);s("Sending diagnostics...","loading");const c=await ib(u,e.environment,e.clientId);s("Diagnostics sent successfully!","success"),setTimeout(()=>{n(),r({sent:!0,id:c.id})},1500)}catch(u){de(`Failed to send diagnostics: ${u.message}`),s(`Failed to send: ${u.message}`,"error"),i.disabled=!1,a.disabled=!1}})})}async function ub(e){const r=new URLSearchParams(window.location.search);if(r.get(mh)?.toLowerCase()!=="true")return;const n=r.get(gh);n&&(e.fallbackId=n),de("User diagnostics requested via query parameter");const a=new URL(window.location.href);a.searchParams.delete(mh),a.searchParams.delete(gh),window.history.replaceState(null,"",a);const i=await yh(e);i.sent?de(`Diagnostics sent with ID: ${i.id}`):de("User cancelled diagnostics")}async function cb(e){return yh(e)}function lb(e){const{autoOnboardProduct:r,bills:t,checkouts:n,contracts:a,deleteTag:i,deleteTally:o,entitlements:s,generateLink:u,getEntitlements:c,getFulfillments:l,getProfile:f,getProxyContent:v,getSubscriptions:d,getTags:h,getTally:p,getTallies:S,getTransaction:R,hasAccess:I,isSpotifyLinked:g,linkSpotify:b,openHostedAccountPage:y,paywalls:A,paymentIssues:q,products:j,pushTally:G,requestDelivery:K,setTag:re,transactions:L,unlinkSpotify:M,updateProfile:x,userMetadata:m,vendor:C}=bg(e),U=()=>q.list(),T={analytics:{track:sh},attribution:{get:cn,set:Dd},auth:{getUser:f,getTokenSilently:vr,isAuthenticated:dr,loginWithRedirect:xo,loginWithPopup:mm,login:pm,logout:gm,setToken:jo},bills:t,browser:{detectAdblock:uh,isInAppBrowser:ch,isIncognito:lh},checkouts:n,clearCache:hr,content:{list:Xd,get:Nt,getLanguage:un,hasAccess:gg,unlock:Zd,getPropertyFromHTML:Qo,showModal:ev,showNotificationBar:yg},contracts:a,diagnostics:{send:N=>cb({clientId:e.clientId||e.vendorId,environment:e.environment,fallbackId:N,getProfile:()=>f(),getEntitlements:()=>c(),getContracts:()=>a.list(),getTags:()=>h(),getTallies:()=>S()}),collect:N=>ph({clientId:e.clientId||e.vendorId,environment:e.environment,fallbackId:N,getProfile:()=>f(),getEntitlements:()=>c(),getContracts:()=>a.list(),getTags:()=>h(),getTallies:()=>S()})},entitlements:{...s,access:s.getAccess,hasAccess:I,list:c,signedLinks:Wo},events:{emit:Zy,cancel:eb},flags:{get:Hd,set:Bd,list:qt,delete:Gd},fulfillments:{list:l,requestDelivery:K},generateLink:u,getPaymentIssues:U,getVersion:fb,isReady:()=>$e.isInitialized,log:de,paywalls:A,paymentIssues:q,products:{...j,autoOnboard:r,linkSpotify:b},profile:{get:f,isSpotifyLinked:g,openHostedAccountPage:y,unlinkSpotify:M,update:x},proxy:{getContent:v},subscriptions:{list:d},tags:{delete:i,list:h,set:re},tallies:{delete:o,get:p,list:S,push:G},transactions:{...L,get:R},userMetadata:m,vendor:C,setToken:jo};return e.namespace&&typeof window<"u"&&(window[e.namespace]=T),T}function fb(){return kt}function db(e,r){e.style.position="relative",e.style.height="200px",e.style.overflow="hidden";let n=0;const a=Array.from(e.children);for(const o of a){const s=o.offsetHeight;n+s>200?o.remove():n+=s}const i=document.createElement("style");i.innerHTML=`
142
+ `,e}function yh(e){return new Promise(r=>{const t=sb(),{close:n}=ev(t,{closeOnBackdropClick:!1,closeOnEscape:!0}),a=t.querySelector('[data-action="cancel"]'),i=t.querySelector('[data-action="send"]'),o=t.querySelector(".status"),s=(u,c)=>{o.style.display="block",o.className=`status ${c}`,c==="loading"?o.innerHTML=`<span class="spinner"></span>${u}`:o.textContent=u};a.addEventListener("click",()=>{n(),r({sent:!1})}),i.addEventListener("click",async()=>{i.disabled=!0,a.disabled=!0,s("Collecting diagnostics...","loading");try{const u=await ph(e);s("Sending diagnostics...","loading");const c=await ib(u,e.environment,e.clientId);s("Diagnostics sent successfully!","success"),setTimeout(()=>{n(),r({sent:!0,id:c.id})},1500)}catch(u){de(`Failed to send diagnostics: ${u.message}`),s(`Failed to send: ${u.message}`,"error"),i.disabled=!1,a.disabled=!1}})})}async function ub(e){const r=new URLSearchParams(window.location.search);if(r.get(mh)?.toLowerCase()!=="true")return;const n=r.get(gh);n&&(e.fallbackId=n),de("User diagnostics requested via query parameter");const a=new URL(window.location.href);a.searchParams.delete(mh),a.searchParams.delete(gh),window.history.replaceState(null,"",a);const i=await yh(e);i.sent?de(`Diagnostics sent with ID: ${i.id}`):de("User cancelled diagnostics")}async function cb(e){return yh(e)}function lb(e){const{autoOnboardProduct:r,bills:t,checkouts:n,contracts:a,deleteTag:i,deleteTally:o,entitlements:s,generateLink:u,getEntitlements:c,getFulfillments:l,getProfile:f,getProxyContent:v,getSubscriptions:d,getTags:h,getTally:p,getTallies:S,getTransaction:R,hasAccess:I,isSpotifyLinked:g,linkSpotify:b,openHostedAccountPage:y,paywalls:A,paymentIssues:$,products:j,pushTally:G,requestDelivery:K,setTag:re,transactions:N,unlinkSpotify:M,updateProfile:x,userMetadata:m,vendor:C}=bg(e),L=()=>$.list(),T={analytics:{track:sh},attribution:{get:cn,set:Dd},auth:{getUser:f,getTokenSilently:vr,isAuthenticated:dr,loginWithRedirect:xo,loginWithPopup:mm,login:pm,logout:gm,setToken:jo},bills:t,browser:{detectAdblock:uh,isInAppBrowser:ch,isIncognito:lh},checkouts:n,clearCache:hr,content:{list:Xd,get:Nt,getLanguage:un,hasAccess:gg,unlock:Zd,getPropertyFromHTML:Qo,showModal:ev,showNotificationBar:yg},contracts:a,diagnostics:{send:k=>cb({clientId:e.clientId||e.vendorId,environment:e.environment,fallbackId:k,getProfile:()=>f(),getEntitlements:()=>c(),getContracts:()=>a.list(),getTags:()=>h(),getTallies:()=>S()}),collect:k=>ph({clientId:e.clientId||e.vendorId,environment:e.environment,fallbackId:k,getProfile:()=>f(),getEntitlements:()=>c(),getContracts:()=>a.list(),getTags:()=>h(),getTallies:()=>S()})},entitlements:{...s,access:async k=>{try{const J=(await c()).find(Y=>Y.id===k||Y.sku===k);if(J?.token&&J?.url)return{id:J.id,url:J.url,token:J.token}}catch{}return s.getAccess(k)},hasAccess:I,list:c,signedLinks:Wo},events:{emit:Zy,cancel:eb},flags:{get:Hd,set:Bd,list:qt,delete:Gd},fulfillments:{list:l,requestDelivery:K},generateLink:u,getPaymentIssues:L,getVersion:fb,isReady:()=>$e.isInitialized,log:de,paywalls:A,paymentIssues:$,products:{...j,autoOnboard:r,linkSpotify:b},profile:{get:f,isSpotifyLinked:g,openHostedAccountPage:y,unlinkSpotify:M,update:x},proxy:{getContent:v},subscriptions:{list:d},tags:{delete:i,list:h,set:re},tallies:{delete:o,get:p,list:S,push:G},transactions:{...N,get:R},userMetadata:m,vendor:C,setToken:jo};return e.namespace&&typeof window<"u"&&(window[e.namespace]=T),T}function fb(){return kt}function db(e,r){e.style.position="relative",e.style.height="200px",e.style.overflow="hidden";let n=0;const a=Array.from(e.children);for(const o of a){const s=o.offsetHeight;n+s>200?o.remove():n+=s}const i=document.createElement("style");i.innerHTML=`
143
143
  ${r.selector}::before {
144
144
  content: '';
145
145
  position: absolute;
@@ -150,4 +150,4 @@ CAUSE: `+d.stack,y.response=g,y.status=g.status,y.url=f,g.type==="opaque")throw
150
150
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), white);
151
151
  pointer-events: none;
152
152
  }
153
- `,document.head.appendChild(i)}async function vb(e){try{const r=await fetch(e);return r.ok?await r.text():(console.error(`Failed to fetch content from ${e}: ${r.statusText}`),null)}catch(r){return console.error(`Error fetching content from ${e}:`,r),null}}async function Rs(e){if(e.contentType==="selector"&&e.content){const r=document.querySelector(e.content);if(r)return r.innerHTML;console.warn(`Source element for selector '${e.content}' not found`)}else if(e.contentType==="url"&&e.content){const r=await vb(e.content);if(r)return r;console.warn(`Failed to fetch content from URL '${e.content}'`)}else if(e.content)return e.content;return""}async function hb(e,r){const t=r.insertionPoint||"inside",n=await Rs(r);switch(t){case"before":e.insertAdjacentHTML("beforebegin",n);break;case"after":e.insertAdjacentHTML("afterend",n);break;case"inside":default:e.innerHTML+=n;break}}async function pb(e,r){const t=await Rs(r);e.innerHTML=t}async function mb(e,r){const t=await Rs(r);e.innerHTML=t.replace("${content}",e.innerHTML)}async function gb({enabled:e=!1,rules:r}){e&&Qv(async()=>{const t=await dr(),n=window.location.href;for(const a of r){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!==t))switch(a.transform){case"insert":await hb(s,a);break;case"replace":await pb(s,a);break;case"remove":o.remove();break;case"wrap":await mb(s,a);break;case"gradient":db(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}})}const bh="access_token";function yb(){const e=new URLSearchParams(window.location.hash.substring(1)),r=e.get(bh);if(r){jo(r);const t=new URL(window.location.href);e.delete(bh),t.hash=e.toString(),window.history.replaceState(null,"",t)}}const wh="sesamy-refresh",Sh="force-refetch-entitlements";function bb(){const e=new URLSearchParams(window.location.search),r=e.get(Sh),t=e.get(wh);if(r!==null||t!==null){const n=new URL(window.location.href);e.delete(Sh),e.delete(wh),n.search=e.toString(),hr(),window.history.replaceState(null,"",n)}}const Ts=(e,r)=>r.some(t=>e instanceof t);let Ih,Ph;function wb(){return Ih||(Ih=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Sb(){return Ph||(Ph=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Os=new WeakMap,Cs=new WeakMap,An=new WeakMap;function Ib(e){const r=new Promise((t,n)=>{const a=()=>{e.removeEventListener("success",i),e.removeEventListener("error",o)},i=()=>{t(kn(e.result)),a()},o=()=>{n(e.error),a()};e.addEventListener("success",i),e.addEventListener("error",o)});return An.set(r,e),r}function Pb(e){if(Os.has(e))return;const r=new Promise((t,n)=>{const a=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",o),e.removeEventListener("abort",o)},i=()=>{t(),a()},o=()=>{n(e.error||new DOMException("AbortError","AbortError")),a()};e.addEventListener("complete",i),e.addEventListener("error",o),e.addEventListener("abort",o)});Os.set(e,r)}let _s={get(e,r,t){if(e instanceof IDBTransaction){if(r==="done")return Os.get(e);if(r==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return kn(e[r])},set(e,r,t){return e[r]=t,!0},has(e,r){return e instanceof IDBTransaction&&(r==="done"||r==="store")?!0:r in e}};function Eh(e){_s=e(_s)}function Eb(e){return Sb().includes(e)?function(...r){return e.apply(As(this),r),kn(this.request)}:function(...r){return kn(e.apply(As(this),r))}}function Rb(e){return typeof e=="function"?Eb(e):(e instanceof IDBTransaction&&Pb(e),Ts(e,wb())?new Proxy(e,_s):e)}function kn(e){if(e instanceof IDBRequest)return Ib(e);if(Cs.has(e))return Cs.get(e);const r=Rb(e);return r!==e&&(Cs.set(e,r),An.set(r,e)),r}const As=e=>An.get(e),Tb=["get","getKey","getAll","getAllKeys","count"],Ob=["put","add","delete","clear"],ks=new Map;function Rh(e,r){if(!(e instanceof IDBDatabase&&!(r in e)&&typeof r=="string"))return;if(ks.get(r))return ks.get(r);const t=r.replace(/FromIndex$/,""),n=r!==t,a=Ob.includes(t);if(!(t in(n?IDBIndex:IDBObjectStore).prototype)||!(a||Tb.includes(t)))return;const i=async function(o,...s){const u=this.transaction(o,a?"readwrite":"readonly");let c=u.store;return n&&(c=c.index(s.shift())),(await Promise.all([c[t](...s),a&&u.done]))[0]};return ks.set(r,i),i}Eh(e=>({...e,get:(r,t,n)=>Rh(r,t)||e.get(r,t,n),has:(r,t)=>!!Rh(r,t)||e.has(r,t)}));const Cb=["continue","continuePrimaryKey","advance"],Th={},qs=new WeakMap,Oh=new WeakMap,_b={get(e,r){if(!Cb.includes(r))return e[r];let t=Th[r];return t||(t=Th[r]=function(...n){qs.set(this,Oh.get(this)[r](...n))}),t}};async function*Ab(...e){let r=this;if(r instanceof IDBCursor||(r=await r.openCursor(...e)),!r)return;r=r;const t=new Proxy(r,_b);for(Oh.set(t,r),An.set(t,As(r));r;)yield t,r=await(qs.get(t)||r.continue()),qs.delete(t)}function Ch(e,r){return r===Symbol.asyncIterator&&Ts(e,[IDBIndex,IDBObjectStore,IDBCursor])||r==="iterate"&&Ts(e,[IDBIndex,IDBObjectStore])}Eh(e=>({...e,get(r,t,n){return Ch(r,t)?Ab:e.get(r,t,n)},has(r,t){return Ch(r,t)||e.has(r,t)}}));function kb(e){try{const r=e.lastIndexOf(".");if(r===-1)return{valid:!1,error:"invalid_format",message:"Token must contain payload and signature separated by '.'"};const t=e.substring(0,r),n=atob(qb(t)),a=JSON.parse(n);if(typeof a.v!="number"||typeof a.iss!="string"||typeof a.kid!="string"||typeof a.tier!="string"||typeof a.contentId!="string"||typeof a.exp!="number")return{valid:!1,error:"malformed",message:"Token missing required fields"};const i=Math.floor(Date.now()/1e3),o=a.exp-i;return{valid:!0,expired:o<0,expiresIn:o,payload:a}}catch{return{valid:!1,error:"malformed",message:"Failed to decode token"}}}function qb(e){let r=e.replace(/-/g,"+").replace(/_/g,"/");const t=r.length%4;return t&&(r+="=".repeat(4-t)),r}function $b(e){if(!e||typeof e!="string")throw new Error("Invalid token: token must be a non-empty string");const r=e.split(".");if(r.length!==3&&r.length!==2)throw new Error("Invalid JWT format: token must have 2 or 3 parts separated by dots");const t=r.length===3?r[1]:r[0];if(!t)throw new Error("Invalid JWT format: payload is empty");let n;try{n=atob(t)}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 Ub(e,r){const t=new Date(e.exp*1e3);return{id:"",title:e.p?.toString(),sku:e.s?.toString(),purchaseOption:e.p?.toString(),publisherContentId:e.pid?.toString(),url:e.url?.toString(),token:r,type:"article",hasAccess:!0,expiresAt:t.toISOString(),createdAt:new Date(e.iat*1e3).toISOString(),updatedAt:new Date(e.iat*1e3).toISOString()}}function Lb(e,r){const t=new Date(e.exp*1e3),n=e.meta;return{id:e.tid,title:n?.purchaseOption?.toString()||e.tier,sku:e.tier,purchaseOption:n?.purchaseOption?.toString(),publisherContentId:e.contentId,url:e.url,token:r,type:"article",hasAccess:!0,expiresAt:t.toISOString(),createdAt:new Date(e.iat*1e3).toISOString(),updatedAt:new Date(e.iat*1e3).toISOString()}}function Nb(){const e=new URLSearchParams(window.location.search),r=e.get("sesamy_token")||e.get("sesamy-token")||e.get("token");if(!r)return;try{const n=kb(r);if(n.valid&&!n.expired){const a=Lb(n.payload,r);jd(a)}else if(n.valid)n.expired&&de("Share token has expired");else{const a=$b(r),i=Ub(a,r);jd(i)}}catch(n){de(`Failed to extract signed link ${n}`)}const t=new URL(window.location.href);t.searchParams.delete("ss"),t.searchParams.delete("se"),t.searchParams.delete("sp"),t.searchParams.delete("so"),t.searchParams.delete("token"),t.searchParams.delete("sesamy-token"),t.searchParams.delete("sesamy_token"),window.history.replaceState(null,"",t)}const _h="sesamy-user";async function xb(){const r=new URLSearchParams(window.location.search).get(_h)?.toLowerCase();if(!r)return;const t=await hm();t?.email!==r?(de(`Current user does not match sesamy user: ${t?.email} !== ${r}`),hr(),xo({authorizationParams:{login_hint:r}})):de(`Current user matches sesamy user: ${t?.email} === ${r}`);const n=new URL(window.location.href);n.searchParams.delete(_h),window.history.replaceState(null,"",n)}const Ah="sesamy-purchase";function jb(){const e=new URLSearchParams(window.location.search),r=e.get(Ah);if(r!==null){const t=new URL(window.location.href);e.delete(Ah),t.search=e.toString(),de(`Purchase ${r}`),$r(er.PURCHASE,{itemSrc:r}),hr(),window.history.replaceState(null,"",t)}}const kh="sesamy-login",Db="sesamy_login";async function Mb(){const e=new URLSearchParams(window.location.search);if(!(e.get(kh)||e.get(Db)))return;await dr()||xo();const n=new URL(window.location.href);n.searchParams.delete(kh),window.history.replaceState(null,"",n)}const qh="sesamy-debug";async function Fb(){const r=new URLSearchParams(window.location.search).get(qh)?.toLowerCase();if(!r)return;om(r==="true");const t=new URL(window.location.href);t.searchParams.delete(qh),window.history.replaceState(null,"",t)}function qn(){return typeof window<"u"}function Bb(){if(!document.referrer.length)return;const e=new URL(document.referrer);if(!(e.hostname===window.location.hostname||e.hostname.includes("sesamy")))return document.referrer}async function Hb(e){if(!qn())return;const r=new URLSearchParams(window.location.search),t={utmSource:r.get("utm_source")??void 0,utmMedium:r.get("utm_medium")??void 0,utmCampaign:r.get("utm_campaign")??void 0,utmTerm:r.get("utm_term")??void 0,utmContent:r.get("utm_content")??void 0,ref:r.get("ref")??void 0,referrer:Bb()},[n]=e.content.list();n?.url&&(t.itemSrc=n.url,t.publisherContentId=n.id),Dd(t)}function Gb(){const e=new URLSearchParams(window.location.search);let r=!1;try{r=!!window.opener&&window.opener.location.origin===window.location.origin}catch{r=!1}const t=sessionStorage.getItem($d)==="true",n=e.has("code")||e.has("error")||e.has("state");!r||t||(sessionStorage.setItem($d,"true"),n||(de("Reloading page to get query params in incognito browser"),window.location.reload()))}async function Wb(e){const r=a=>i=>{i.preventDefault();try{a()}catch(o){console.error("Error handling click:",o)}},t=(a,i)=>{try{document.querySelectorAll(a).forEach(s=>{s.addEventListener("click",r(i))})}catch(o){console.error(`Error attaching event handlers (selector: ${a}):`,o)}};t('[sesamy-link="login"]',()=>e.auth.loginWithRedirect()),t('[sesamy-link="logout"]',()=>e.auth.logout());const n=await e.generateLink({target:"account"});n&&t('[sesamy-link="account"]',()=>{window.location.href=n})}async function Vb(e){const r=await e.auth.isAuthenticated();try{document.querySelectorAll(`[sesamy-visibility="${r?"not-logged-in":"logged-in"}"]`).forEach(a=>{a instanceof HTMLElement&&(a.style.display="none")}),document.querySelectorAll(`[sesamy-visibility="${r?"logged-in":"not-logged-in"}"]`).forEach(a=>{a instanceof HTMLElement&&(a.style.display="")})}catch(t){console.error("Error handling visibility:",t)}}async function zb(e){const r=ge("sesamy:locked-content-redirect-url");if(!r)return;const[t]=e.content.list();if(!t)return;await e.entitlements.hasAccess(t.url||"",t.pass?.split(",")||[])||(location.href=r)}$e.isInitialized=!1;async function $h(e,r,t){de(`Init with config: ${JSON.stringify(e)}`);try{Gb(),Jy({clientId:e.clientId,environment:e.environment,...e.analytics}),t&&Lo(t),await vm({clientId:e.clientId,vendorId:e.vendorId||e.clientId,organization:e.organization,environment:e.environment,...e.auth}),dg(e,r),e.transform&&await gb(e.transform),fh(),Fb(),ub({clientId:e.clientId||e.vendorId,environment:e.environment,getProfile:()=>r.profile.get(),getEntitlements:()=>r.entitlements.list(),getContracts:()=>r.contracts.list(),getTags:()=>r.tags.list(),getTallies:()=>r.tallies.list()}),Hb(r),yb(),bb(),Nb(),await Mb(),await xb(),jb(),await Vb(r),await Wb(r),await zb(r),$e.isInitialized=!0,$r(er.READY,{})}catch(n){de(`Failed to init ${n.message}`)}}async function Uh(e,r){de("Initializing Sesamy");const t=e.api?.namespace||"sesamy";if(qn()&&t in window)return de("Sesamy already initialized. This is likely due to a duplicate import"),$e.isInitialized=!0,window[t];const n=lb({clientId:e.clientId,vendorId:e.vendorId,environment:e.environment,...e.api,namespace:t});return qn()?(e.awaitAllServices?await $h(e,n,r?.authPlugin):$h(e,n,r?.authPlugin),n):($e.isInitialized=!0,n)}if(qn()){const e=document.getElementById("sesamy-js");if(e?.textContent)try{const r=JSON.parse(e.textContent),t=window,n=typeof t.auth0Plugin?.createAuth0Plugin=="function"?t.auth0Plugin.createAuth0Plugin():void 0;Uh(r,n?{authPlugin:n}:void 0)}catch(r){console.error("Failed to parse config",r)}}return $e.Events=er,$e.clearMetadataCache=mg,$e.getAllLdJson=hg,$e.getAllMetaTags=$t,$e.getContentConfig=fg,$e.getContentMetadata=Qd,$e.getLdJson=Lt,$e.init=Uh,$e.registerAuthPlugin=Lo,Object.defineProperty($e,Symbol.toStringTag,{value:"Module"}),$e})({});
153
+ `,document.head.appendChild(i)}async function vb(e){try{const r=await fetch(e);return r.ok?await r.text():(console.error(`Failed to fetch content from ${e}: ${r.statusText}`),null)}catch(r){return console.error(`Error fetching content from ${e}:`,r),null}}async function Rs(e){if(e.contentType==="selector"&&e.content){const r=document.querySelector(e.content);if(r)return r.innerHTML;console.warn(`Source element for selector '${e.content}' not found`)}else if(e.contentType==="url"&&e.content){const r=await vb(e.content);if(r)return r;console.warn(`Failed to fetch content from URL '${e.content}'`)}else if(e.content)return e.content;return""}async function hb(e,r){const t=r.insertionPoint||"inside",n=await Rs(r);switch(t){case"before":e.insertAdjacentHTML("beforebegin",n);break;case"after":e.insertAdjacentHTML("afterend",n);break;case"inside":default:e.innerHTML+=n;break}}async function pb(e,r){const t=await Rs(r);e.innerHTML=t}async function mb(e,r){const t=await Rs(r);e.innerHTML=t.replace("${content}",e.innerHTML)}async function gb({enabled:e=!1,rules:r}){e&&Qv(async()=>{const t=await dr(),n=window.location.href;for(const a of r){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!==t))switch(a.transform){case"insert":await hb(s,a);break;case"replace":await pb(s,a);break;case"remove":o.remove();break;case"wrap":await mb(s,a);break;case"gradient":db(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}})}const bh="access_token";function yb(){const e=new URLSearchParams(window.location.hash.substring(1)),r=e.get(bh);if(r){jo(r);const t=new URL(window.location.href);e.delete(bh),t.hash=e.toString(),window.history.replaceState(null,"",t)}}const wh="sesamy-refresh",Sh="force-refetch-entitlements";function bb(){const e=new URLSearchParams(window.location.search),r=e.get(Sh),t=e.get(wh);if(r!==null||t!==null){const n=new URL(window.location.href);e.delete(Sh),e.delete(wh),n.search=e.toString(),hr(),window.history.replaceState(null,"",n)}}const Ts=(e,r)=>r.some(t=>e instanceof t);let Ih,Ph;function wb(){return Ih||(Ih=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Sb(){return Ph||(Ph=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Os=new WeakMap,Cs=new WeakMap,An=new WeakMap;function Ib(e){const r=new Promise((t,n)=>{const a=()=>{e.removeEventListener("success",i),e.removeEventListener("error",o)},i=()=>{t(kn(e.result)),a()},o=()=>{n(e.error),a()};e.addEventListener("success",i),e.addEventListener("error",o)});return An.set(r,e),r}function Pb(e){if(Os.has(e))return;const r=new Promise((t,n)=>{const a=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",o),e.removeEventListener("abort",o)},i=()=>{t(),a()},o=()=>{n(e.error||new DOMException("AbortError","AbortError")),a()};e.addEventListener("complete",i),e.addEventListener("error",o),e.addEventListener("abort",o)});Os.set(e,r)}let _s={get(e,r,t){if(e instanceof IDBTransaction){if(r==="done")return Os.get(e);if(r==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return kn(e[r])},set(e,r,t){return e[r]=t,!0},has(e,r){return e instanceof IDBTransaction&&(r==="done"||r==="store")?!0:r in e}};function Eh(e){_s=e(_s)}function Eb(e){return Sb().includes(e)?function(...r){return e.apply(As(this),r),kn(this.request)}:function(...r){return kn(e.apply(As(this),r))}}function Rb(e){return typeof e=="function"?Eb(e):(e instanceof IDBTransaction&&Pb(e),Ts(e,wb())?new Proxy(e,_s):e)}function kn(e){if(e instanceof IDBRequest)return Ib(e);if(Cs.has(e))return Cs.get(e);const r=Rb(e);return r!==e&&(Cs.set(e,r),An.set(r,e)),r}const As=e=>An.get(e),Tb=["get","getKey","getAll","getAllKeys","count"],Ob=["put","add","delete","clear"],ks=new Map;function Rh(e,r){if(!(e instanceof IDBDatabase&&!(r in e)&&typeof r=="string"))return;if(ks.get(r))return ks.get(r);const t=r.replace(/FromIndex$/,""),n=r!==t,a=Ob.includes(t);if(!(t in(n?IDBIndex:IDBObjectStore).prototype)||!(a||Tb.includes(t)))return;const i=async function(o,...s){const u=this.transaction(o,a?"readwrite":"readonly");let c=u.store;return n&&(c=c.index(s.shift())),(await Promise.all([c[t](...s),a&&u.done]))[0]};return ks.set(r,i),i}Eh(e=>({...e,get:(r,t,n)=>Rh(r,t)||e.get(r,t,n),has:(r,t)=>!!Rh(r,t)||e.has(r,t)}));const Cb=["continue","continuePrimaryKey","advance"],Th={},qs=new WeakMap,Oh=new WeakMap,_b={get(e,r){if(!Cb.includes(r))return e[r];let t=Th[r];return t||(t=Th[r]=function(...n){qs.set(this,Oh.get(this)[r](...n))}),t}};async function*Ab(...e){let r=this;if(r instanceof IDBCursor||(r=await r.openCursor(...e)),!r)return;r=r;const t=new Proxy(r,_b);for(Oh.set(t,r),An.set(t,As(r));r;)yield t,r=await(qs.get(t)||r.continue()),qs.delete(t)}function Ch(e,r){return r===Symbol.asyncIterator&&Ts(e,[IDBIndex,IDBObjectStore,IDBCursor])||r==="iterate"&&Ts(e,[IDBIndex,IDBObjectStore])}Eh(e=>({...e,get(r,t,n){return Ch(r,t)?Ab:e.get(r,t,n)},has(r,t){return Ch(r,t)||e.has(r,t)}}));function kb(e){try{const r=e.lastIndexOf(".");if(r===-1)return{valid:!1,error:"invalid_format",message:"Token must contain payload and signature separated by '.'"};const t=e.substring(0,r),n=atob(qb(t)),a=JSON.parse(n);if(typeof a.v!="number"||typeof a.iss!="string"||typeof a.kid!="string"||typeof a.tier!="string"||typeof a.contentId!="string"||typeof a.exp!="number")return{valid:!1,error:"malformed",message:"Token missing required fields"};const i=Math.floor(Date.now()/1e3),o=a.exp-i;return{valid:!0,expired:o<0,expiresIn:o,payload:a}}catch{return{valid:!1,error:"malformed",message:"Failed to decode token"}}}function qb(e){let r=e.replace(/-/g,"+").replace(/_/g,"/");const t=r.length%4;return t&&(r+="=".repeat(4-t)),r}function $b(e){if(!e||typeof e!="string")throw new Error("Invalid token: token must be a non-empty string");const r=e.split(".");if(r.length!==3&&r.length!==2)throw new Error("Invalid JWT format: token must have 2 or 3 parts separated by dots");const t=r.length===3?r[1]:r[0];if(!t)throw new Error("Invalid JWT format: payload is empty");let n;try{n=atob(t)}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 Ub(e,r){const t=new Date(e.exp*1e3);return{id:e.s?.toString()||"",title:e.p?.toString(),sku:e.s?.toString(),purchaseOption:e.p?.toString(),publisherContentId:e.pid?.toString(),url:e.url?.toString(),token:r,type:"article",hasAccess:!0,expiresAt:t.toISOString(),createdAt:new Date(e.iat*1e3).toISOString(),updatedAt:new Date(e.iat*1e3).toISOString()}}function Lb(e,r){const t=new Date(e.exp*1e3),n=e.meta;return{id:e.tid,title:n?.purchaseOption?.toString()||e.tier,sku:e.tier,purchaseOption:n?.purchaseOption?.toString(),publisherContentId:e.contentId,url:e.url,token:r,type:"article",hasAccess:!0,expiresAt:t.toISOString(),createdAt:new Date(e.iat*1e3).toISOString(),updatedAt:new Date(e.iat*1e3).toISOString()}}function Nb(){const e=new URLSearchParams(window.location.search),r=e.get("sesamy_token")||e.get("sesamy-token")||e.get("token");if(!r)return;try{const n=kb(r);if(n.valid&&!n.expired){const a=Lb(n.payload,r);jd(a)}else if(n.valid)n.expired&&de("Share token has expired");else{const a=$b(r),i=Ub(a,r);jd(i)}}catch(n){de(`Failed to extract signed link ${n}`)}const t=new URL(window.location.href);t.searchParams.delete("ss"),t.searchParams.delete("se"),t.searchParams.delete("sp"),t.searchParams.delete("so"),t.searchParams.delete("token"),t.searchParams.delete("sesamy-token"),t.searchParams.delete("sesamy_token"),window.history.replaceState(null,"",t)}const _h="sesamy-user";async function xb(){const r=new URLSearchParams(window.location.search).get(_h)?.toLowerCase();if(!r)return;const t=await hm();t?.email!==r?(de(`Current user does not match sesamy user: ${t?.email} !== ${r}`),hr(),xo({authorizationParams:{login_hint:r}})):de(`Current user matches sesamy user: ${t?.email} === ${r}`);const n=new URL(window.location.href);n.searchParams.delete(_h),window.history.replaceState(null,"",n)}const Ah="sesamy-purchase";function jb(){const e=new URLSearchParams(window.location.search),r=e.get(Ah);if(r!==null){const t=new URL(window.location.href);e.delete(Ah),t.search=e.toString(),de(`Purchase ${r}`),$r(er.PURCHASE,{itemSrc:r}),hr(),window.history.replaceState(null,"",t)}}const kh="sesamy-login",Db="sesamy_login";async function Mb(){const e=new URLSearchParams(window.location.search);if(!(e.get(kh)||e.get(Db)))return;await dr()||xo();const n=new URL(window.location.href);n.searchParams.delete(kh),window.history.replaceState(null,"",n)}const qh="sesamy-debug";async function Fb(){const r=new URLSearchParams(window.location.search).get(qh)?.toLowerCase();if(!r)return;om(r==="true");const t=new URL(window.location.href);t.searchParams.delete(qh),window.history.replaceState(null,"",t)}function qn(){return typeof window<"u"}function Bb(){if(!document.referrer.length)return;const e=new URL(document.referrer);if(!(e.hostname===window.location.hostname||e.hostname.includes("sesamy")))return document.referrer}async function Hb(e){if(!qn())return;const r=new URLSearchParams(window.location.search),t={utmSource:r.get("utm_source")??void 0,utmMedium:r.get("utm_medium")??void 0,utmCampaign:r.get("utm_campaign")??void 0,utmTerm:r.get("utm_term")??void 0,utmContent:r.get("utm_content")??void 0,ref:r.get("ref")??void 0,referrer:Bb()},[n]=e.content.list();n?.url&&(t.itemSrc=n.url,t.publisherContentId=n.id),Dd(t)}function Gb(){const e=new URLSearchParams(window.location.search);let r=!1;try{r=!!window.opener&&window.opener.location.origin===window.location.origin}catch{r=!1}const t=sessionStorage.getItem($d)==="true",n=e.has("code")||e.has("error")||e.has("state");!r||t||(sessionStorage.setItem($d,"true"),n||(de("Reloading page to get query params in incognito browser"),window.location.reload()))}async function Wb(e){const r=a=>i=>{i.preventDefault();try{a()}catch(o){console.error("Error handling click:",o)}},t=(a,i)=>{try{document.querySelectorAll(a).forEach(s=>{s.addEventListener("click",r(i))})}catch(o){console.error(`Error attaching event handlers (selector: ${a}):`,o)}};t('[sesamy-link="login"]',()=>e.auth.loginWithRedirect()),t('[sesamy-link="logout"]',()=>e.auth.logout());const n=await e.generateLink({target:"account"});n&&t('[sesamy-link="account"]',()=>{window.location.href=n})}async function Vb(e){const r=await e.auth.isAuthenticated();try{document.querySelectorAll(`[sesamy-visibility="${r?"not-logged-in":"logged-in"}"]`).forEach(a=>{a instanceof HTMLElement&&(a.style.display="none")}),document.querySelectorAll(`[sesamy-visibility="${r?"logged-in":"not-logged-in"}"]`).forEach(a=>{a instanceof HTMLElement&&(a.style.display="")})}catch(t){console.error("Error handling visibility:",t)}}async function zb(e){const r=ge("sesamy:locked-content-redirect-url");if(!r)return;const[t]=e.content.list();if(!t)return;await e.entitlements.hasAccess(t.url||"",t.pass?.split(",")||[])||(location.href=r)}$e.isInitialized=!1;async function $h(e,r,t){de(`Init with config: ${JSON.stringify(e)}`);try{Gb(),Jy({clientId:e.clientId,environment:e.environment,...e.analytics}),t&&Lo(t),await vm({clientId:e.clientId,vendorId:e.vendorId||e.clientId,organization:e.organization,environment:e.environment,...e.auth}),dg(e,r),e.transform&&await gb(e.transform),fh(),Fb(),ub({clientId:e.clientId||e.vendorId,environment:e.environment,getProfile:()=>r.profile.get(),getEntitlements:()=>r.entitlements.list(),getContracts:()=>r.contracts.list(),getTags:()=>r.tags.list(),getTallies:()=>r.tallies.list()}),Hb(r),yb(),bb(),Nb(),await Mb(),await xb(),jb(),await Vb(r),await Wb(r),await zb(r),$e.isInitialized=!0,$r(er.READY,{})}catch(n){de(`Failed to init ${n.message}`)}}async function Uh(e,r){de("Initializing Sesamy");const t=e.api?.namespace||"sesamy";if(qn()&&t in window)return de("Sesamy already initialized. This is likely due to a duplicate import"),$e.isInitialized=!0,window[t];const n=lb({clientId:e.clientId,vendorId:e.vendorId,environment:e.environment,...e.api,namespace:t});return qn()?(e.awaitAllServices?await $h(e,n,r?.authPlugin):$h(e,n,r?.authPlugin),n):($e.isInitialized=!0,n)}if(qn()){const e=document.getElementById("sesamy-js");if(e?.textContent)try{const r=JSON.parse(e.textContent),t=window,n=typeof t.auth0Plugin?.createAuth0Plugin=="function"?t.auth0Plugin.createAuth0Plugin():void 0;Uh(r,n?{authPlugin:n}:void 0)}catch(r){console.error("Failed to parse config",r)}}return $e.Events=er,$e.clearMetadataCache=mg,$e.getAllLdJson=hg,$e.getAllMetaTags=$t,$e.getContentConfig=fg,$e.getContentMetadata=Qd,$e.getLdJson=Lt,$e.init=Uh,$e.registerAuthPlugin=Lo,Object.defineProperty($e,Symbol.toStringTag,{value:"Module"}),$e})({});