@sesamy/sesamy-js 1.35.7 → 1.35.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  "use strict";var ar=Object.defineProperty;var or=($e,De,Fe)=>De in $e?ar($e,De,{enumerable:!0,configurable:!0,writable:!0,value:Fe}):$e[De]=Fe;var Dt=($e,De,Fe)=>or($e,typeof De!="symbol"?De+"":De,Fe);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},fails$h=function($e){try{return!!$e()}catch{return!0}},fails$g=fails$h,functionBindNative=!fails$g(function(){var $e=(function(){}).bind();return typeof $e!="function"||$e.hasOwnProperty("prototype")}),NATIVE_BIND$3=functionBindNative,FunctionPrototype$2=Function.prototype,call$i=FunctionPrototype$2.call,uncurryThisWithBind=NATIVE_BIND$3&&FunctionPrototype$2.bind.bind(call$i,call$i),functionUncurryThis=NATIVE_BIND$3?uncurryThisWithBind:function($e){return function(){return call$i.apply($e,arguments)}},uncurryThis$n=functionUncurryThis,toString$a=uncurryThis$n({}.toString),stringSlice$4=uncurryThis$n("".slice),classofRaw$2=function($e){return stringSlice$4(toString$a($e),8,-1)},uncurryThis$m=functionUncurryThis,fails$f=fails$h,classof$7=classofRaw$2,$Object$4=Object,split$3=uncurryThis$m("".split),indexedObject=fails$f(function(){return!$Object$4("z").propertyIsEnumerable(0)})?function($e){return classof$7($e)==="String"?split$3($e,""):$Object$4($e)}:$Object$4,isNullOrUndefined$4=function($e){return $e==null},isNullOrUndefined$3=isNullOrUndefined$4,$TypeError$c=TypeError,requireObjectCoercible$4=function($e){if(isNullOrUndefined$3($e))throw new $TypeError$c("Can't call method on "+$e);return $e},IndexedObject$1=indexedObject,requireObjectCoercible$3=requireObjectCoercible$4,toIndexedObject$5=function($e){return IndexedObject$1(requireObjectCoercible$3($e))},check=function($e){return $e&&$e.Math===Math&&$e},globalThis_1=check(typeof globalThis=="object"&&globalThis)||check(typeof window=="object"&&window)||check(typeof self=="object"&&self)||check(typeof commonjsGlobal=="object"&&commonjsGlobal)||check(typeof commonjsGlobal=="object"&&commonjsGlobal)||function(){return this}()||Function("return this")(),sharedStore={exports:{}},isPure=!1,globalThis$n=globalThis_1,defineProperty$6=Object.defineProperty,defineGlobalProperty$3=function($e,De){try{defineProperty$6(globalThis$n,$e,{value:De,configurable:!0,writable:!0})}catch{globalThis$n[$e]=De}return De},globalThis$m=globalThis_1,defineGlobalProperty$2=defineGlobalProperty$3,SHARED="__core-js_shared__",store$3=sharedStore.exports=globalThis$m[SHARED]||defineGlobalProperty$2(SHARED,{});(store$3.versions||(store$3.versions=[])).push({version:"3.39.0",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"});var sharedStoreExports=sharedStore.exports,store$2=sharedStoreExports,shared$3=function($e,De){return store$2[$e]||(store$2[$e]=De||{})},requireObjectCoercible$2=requireObjectCoercible$4,$Object$3=Object,toObject$4=function($e){return $Object$3(requireObjectCoercible$2($e))},uncurryThis$l=functionUncurryThis,toObject$3=toObject$4,hasOwnProperty=uncurryThis$l({}.hasOwnProperty),hasOwnProperty_1=Object.hasOwn||function(De,Fe){return hasOwnProperty(toObject$3(De),Fe)},uncurryThis$k=functionUncurryThis,id=0,postfix=Math.random(),toString$9=uncurryThis$k(1 .toString),uid$2=function($e){return"Symbol("+($e===void 0?"":$e)+")_"+toString$9(++id+postfix,36)},globalThis$l=globalThis_1,navigator$1=globalThis$l.navigator,userAgent$5=navigator$1&&navigator$1.userAgent,environmentUserAgent=userAgent$5?String(userAgent$5):"",globalThis$k=globalThis_1,userAgent$4=environmentUserAgent,process$4=globalThis$k.process,Deno$1=globalThis$k.Deno,versions=process$4&&process$4.versions||Deno$1&&Deno$1.version,v8=versions&&versions.v8,match,version$1;v8&&(match=v8.split("."),version$1=match[0]>0&&match[0]<4?1:+(match[0]+match[1]));!version$1&&userAgent$4&&(match=userAgent$4.match(/Edge\/(\d+)/),(!match||match[1]>=74)&&(match=userAgent$4.match(/Chrome\/(\d+)/),match&&(version$1=+match[1])));var environmentV8Version=version$1,V8_VERSION$1=environmentV8Version,fails$e=fails$h,globalThis$j=globalThis_1,$String$5=globalThis$j.String,symbolConstructorDetection=!!Object.getOwnPropertySymbols&&!fails$e(function(){var $e=Symbol("symbol detection");return!$String$5($e)||!(Object($e)instanceof Symbol)||!Symbol.sham&&V8_VERSION$1&&V8_VERSION$1<41}),NATIVE_SYMBOL$1=symbolConstructorDetection,useSymbolAsUid=NATIVE_SYMBOL$1&&!Symbol.sham&&typeof Symbol.iterator=="symbol",globalThis$i=globalThis_1,shared$2=shared$3,hasOwn$b=hasOwnProperty_1,uid$1=uid$2,NATIVE_SYMBOL=symbolConstructorDetection,USE_SYMBOL_AS_UID$1=useSymbolAsUid,Symbol$1=globalThis$i.Symbol,WellKnownSymbolsStore=shared$2("wks"),createWellKnownSymbol=USE_SYMBOL_AS_UID$1?Symbol$1.for||Symbol$1:Symbol$1&&Symbol$1.withoutSetter||uid$1,wellKnownSymbol$h=function($e){return hasOwn$b(WellKnownSymbolsStore,$e)||(WellKnownSymbolsStore[$e]=NATIVE_SYMBOL&&hasOwn$b(Symbol$1,$e)?Symbol$1[$e]:createWellKnownSymbol("Symbol."+$e)),WellKnownSymbolsStore[$e]},documentAll=typeof document=="object"&&document.all,isCallable$l=typeof documentAll>"u"&&documentAll!==void 0?function($e){return typeof $e=="function"||$e===documentAll}:function($e){return typeof $e=="function"},isCallable$k=isCallable$l,isObject$c=function($e){return typeof $e=="object"?$e!==null:isCallable$k($e)},isObject$b=isObject$c,$String$4=String,$TypeError$b=TypeError,anObject$b=function($e){if(isObject$b($e))return $e;throw new $TypeError$b($String$4($e)+" is not an object")},objectDefineProperties={},fails$d=fails$h,descriptors=!fails$d(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),DESCRIPTORS$g=descriptors,fails$c=fails$h,v8PrototypeDefineBug=DESCRIPTORS$g&&fails$c(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),objectDefineProperty={},globalThis$h=globalThis_1,isObject$a=isObject$c,document$3=globalThis$h.document,EXISTS$1=isObject$a(document$3)&&isObject$a(document$3.createElement),documentCreateElement$2=function($e){return EXISTS$1?document$3.createElement($e):{}},DESCRIPTORS$f=descriptors,fails$b=fails$h,createElement$1=documentCreateElement$2,ie8DomDefine=!DESCRIPTORS$f&&!fails$b(function(){return Object.defineProperty(createElement$1("div"),"a",{get:function(){return 7}}).a!==7}),NATIVE_BIND$2=functionBindNative,call$h=Function.prototype.call,functionCall=NATIVE_BIND$2?call$h.bind(call$h):function(){return call$h.apply(call$h,arguments)},globalThis$g=globalThis_1,isCallable$j=isCallable$l,aFunction=function($e){return isCallable$j($e)?$e:void 0},getBuiltIn$c=function($e,De){return arguments.length<2?aFunction(globalThis$g[$e]):globalThis$g[$e]&&globalThis$g[$e][De]},uncurryThis$j=functionUncurryThis,objectIsPrototypeOf=uncurryThis$j({}.isPrototypeOf),getBuiltIn$b=getBuiltIn$c,isCallable$i=isCallable$l,isPrototypeOf$3=objectIsPrototypeOf,USE_SYMBOL_AS_UID=useSymbolAsUid,$Object$2=Object,isSymbol$2=USE_SYMBOL_AS_UID?function($e){return typeof $e=="symbol"}:function($e){var De=getBuiltIn$b("Symbol");return isCallable$i(De)&&isPrototypeOf$3(De.prototype,$Object$2($e))},$String$3=String,tryToString$4=function($e){try{return $String$3($e)}catch{return"Object"}},isCallable$h=isCallable$l,tryToString$3=tryToString$4,$TypeError$a=TypeError,aCallable$b=function($e){if(isCallable$h($e))return $e;throw new $TypeError$a(tryToString$3($e)+" is not a function")},aCallable$a=aCallable$b,isNullOrUndefined$2=isNullOrUndefined$4,getMethod$3=function($e,De){var Fe=$e[De];return isNullOrUndefined$2(Fe)?void 0:aCallable$a(Fe)},call$g=functionCall,isCallable$g=isCallable$l,isObject$9=isObject$c,$TypeError$9=TypeError,ordinaryToPrimitive$1=function($e,De){var Fe,Be;if(De==="string"&&isCallable$g(Fe=$e.toString)&&!isObject$9(Be=call$g(Fe,$e))||isCallable$g(Fe=$e.valueOf)&&!isObject$9(Be=call$g(Fe,$e))||De!=="string"&&isCallable$g(Fe=$e.toString)&&!isObject$9(Be=call$g(Fe,$e)))return Be;throw new $TypeError$9("Can't convert object to primitive value")},call$f=functionCall,isObject$8=isObject$c,isSymbol$1=isSymbol$2,getMethod$2=getMethod$3,ordinaryToPrimitive=ordinaryToPrimitive$1,wellKnownSymbol$g=wellKnownSymbol$h,$TypeError$8=TypeError,TO_PRIMITIVE=wellKnownSymbol$g("toPrimitive"),toPrimitive$1=function($e,De){if(!isObject$8($e)||isSymbol$1($e))return $e;var Fe=getMethod$2($e,TO_PRIMITIVE),Be;if(Fe){if(De===void 0&&(De="default"),Be=call$f(Fe,$e,De),!isObject$8(Be)||isSymbol$1(Be))return Be;throw new $TypeError$8("Can't convert object to primitive value")}return De===void 0&&(De="number"),ordinaryToPrimitive($e,De)},toPrimitive=toPrimitive$1,isSymbol=isSymbol$2,toPropertyKey$2=function($e){var De=toPrimitive($e,"string");return isSymbol(De)?De:De+""},DESCRIPTORS$e=descriptors,IE8_DOM_DEFINE$1=ie8DomDefine,V8_PROTOTYPE_DEFINE_BUG$1=v8PrototypeDefineBug,anObject$a=anObject$b,toPropertyKey$1=toPropertyKey$2,$TypeError$7=TypeError,$defineProperty=Object.defineProperty,$getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor,ENUMERABLE="enumerable",CONFIGURABLE$1="configurable",WRITABLE="writable";objectDefineProperty.f=DESCRIPTORS$e?V8_PROTOTYPE_DEFINE_BUG$1?function(De,Fe,Be){if(anObject$a(De),Fe=toPropertyKey$1(Fe),anObject$a(Be),typeof De=="function"&&Fe==="prototype"&&"value"in Be&&WRITABLE in Be&&!Be[WRITABLE]){var He=$getOwnPropertyDescriptor$1(De,Fe);He&&He[WRITABLE]&&(De[Fe]=Be.value,Be={configurable:CONFIGURABLE$1 in Be?Be[CONFIGURABLE$1]:He[CONFIGURABLE$1],enumerable:ENUMERABLE in Be?Be[ENUMERABLE]:He[ENUMERABLE],writable:!1})}return $defineProperty(De,Fe,Be)}:$defineProperty:function(De,Fe,Be){if(anObject$a(De),Fe=toPropertyKey$1(Fe),anObject$a(Be),IE8_DOM_DEFINE$1)try{return $defineProperty(De,Fe,Be)}catch{}if("get"in Be||"set"in Be)throw new $TypeError$7("Accessors not supported");return"value"in Be&&(De[Fe]=Be.value),De};var ceil=Math.ceil,floor$3=Math.floor,mathTrunc=Math.trunc||function(De){var Fe=+De;return(Fe>0?floor$3:ceil)(Fe)},trunc=mathTrunc,toIntegerOrInfinity$3=function($e){var De=+$e;return De!==De||De===0?0:trunc(De)},toIntegerOrInfinity$2=toIntegerOrInfinity$3,max=Math.max,min$1=Math.min,toAbsoluteIndex$2=function($e,De){var Fe=toIntegerOrInfinity$2($e);return Fe<0?max(Fe+De,0):min$1(Fe,De)},toIntegerOrInfinity$1=toIntegerOrInfinity$3,min=Math.min,toLength$1=function($e){var De=toIntegerOrInfinity$1($e);return De>0?min(De,9007199254740991):0},toLength=toLength$1,lengthOfArrayLike$3=function($e){return toLength($e.length)},toIndexedObject$4=toIndexedObject$5,toAbsoluteIndex$1=toAbsoluteIndex$2,lengthOfArrayLike$2=lengthOfArrayLike$3,createMethod$1=function($e){return function(De,Fe,Be){var He=toIndexedObject$4(De),Ke=lengthOfArrayLike$2(He);if(Ke===0)return!$e&&-1;var Ge=toAbsoluteIndex$1(Be,Ke),We;if($e&&Fe!==Fe){for(;Ke>Ge;)if(We=He[Ge++],We!==We)return!0}else for(;Ke>Ge;Ge++)if(($e||Ge in He)&&He[Ge]===Fe)return $e||Ge||0;return!$e&&-1}},arrayIncludes={includes:createMethod$1(!0),indexOf:createMethod$1(!1)},hiddenKeys$4={},uncurryThis$i=functionUncurryThis,hasOwn$a=hasOwnProperty_1,toIndexedObject$3=toIndexedObject$5,indexOf=arrayIncludes.indexOf,hiddenKeys$3=hiddenKeys$4,push$5=uncurryThis$i([].push),objectKeysInternal=function($e,De){var Fe=toIndexedObject$3($e),Be=0,He=[],Ke;for(Ke in Fe)!hasOwn$a(hiddenKeys$3,Ke)&&hasOwn$a(Fe,Ke)&&push$5(He,Ke);for(;De.length>Be;)hasOwn$a(Fe,Ke=De[Be++])&&(~indexOf(He,Ke)||push$5(He,Ke));return He},enumBugKeys$3=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],internalObjectKeys$1=objectKeysInternal,enumBugKeys$2=enumBugKeys$3,objectKeys$2=Object.keys||function(De){return internalObjectKeys$1(De,enumBugKeys$2)},DESCRIPTORS$d=descriptors,V8_PROTOTYPE_DEFINE_BUG=v8PrototypeDefineBug,definePropertyModule$4=objectDefineProperty,anObject$9=anObject$b,toIndexedObject$2=toIndexedObject$5,objectKeys$1=objectKeys$2;objectDefineProperties.f=DESCRIPTORS$d&&!V8_PROTOTYPE_DEFINE_BUG?Object.defineProperties:function(De,Fe){anObject$9(De);for(var Be=toIndexedObject$2(Fe),He=objectKeys$1(Fe),Ke=He.length,Ge=0,We;Ke>Ge;)definePropertyModule$4.f(De,We=He[Ge++],Be[We]);return De};var getBuiltIn$a=getBuiltIn$c,html$2=getBuiltIn$a("document","documentElement"),shared$1=shared$3,uid=uid$2,keys=shared$1("keys"),sharedKey$3=function($e){return keys[$e]||(keys[$e]=uid($e))},anObject$8=anObject$b,definePropertiesModule=objectDefineProperties,enumBugKeys$1=enumBugKeys$3,hiddenKeys$2=hiddenKeys$4,html$1=html$2,documentCreateElement$1=documentCreateElement$2,sharedKey$2=sharedKey$3,GT=">",LT="<",PROTOTYPE="prototype",SCRIPT="script",IE_PROTO$1=sharedKey$2("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function($e){return LT+SCRIPT+GT+$e+LT+"/"+SCRIPT+GT},NullProtoObjectViaActiveX=function($e){$e.write(scriptTag("")),$e.close();var De=$e.parentWindow.Object;return $e=null,De},NullProtoObjectViaIFrame=function(){var $e=documentCreateElement$1("iframe"),De="java"+SCRIPT+":",Fe;return $e.style.display="none",html$1.appendChild($e),$e.src=String(De),Fe=$e.contentWindow.document,Fe.open(),Fe.write(scriptTag("document.F=Object")),Fe.close(),Fe.F},activeXDocument,NullProtoObject=function(){try{activeXDocument=new ActiveXObject("htmlfile")}catch{}NullProtoObject=typeof document<"u"?document.domain&&activeXDocument?NullProtoObjectViaActiveX(activeXDocument):NullProtoObjectViaIFrame():NullProtoObjectViaActiveX(activeXDocument);for(var $e=enumBugKeys$1.length;$e--;)delete NullProtoObject[PROTOTYPE][enumBugKeys$1[$e]];return NullProtoObject()};hiddenKeys$2[IE_PROTO$1]=!0;var objectCreate=Object.create||function(De,Fe){var Be;return De!==null?(EmptyConstructor[PROTOTYPE]=anObject$8(De),Be=new EmptyConstructor,EmptyConstructor[PROTOTYPE]=null,Be[IE_PROTO$1]=De):Be=NullProtoObject(),Fe===void 0?Be:definePropertiesModule.f(Be,Fe)},wellKnownSymbol$f=wellKnownSymbol$h,create$3=objectCreate,defineProperty$5=objectDefineProperty.f,UNSCOPABLES=wellKnownSymbol$f("unscopables"),ArrayPrototype$1=Array.prototype;ArrayPrototype$1[UNSCOPABLES]===void 0&&defineProperty$5(ArrayPrototype$1,UNSCOPABLES,{configurable:!0,value:create$3(null)});var addToUnscopables$1=function($e){ArrayPrototype$1[UNSCOPABLES][$e]=!0},iterators={},globalThis$f=globalThis_1,isCallable$f=isCallable$l,WeakMap$1=globalThis$f.WeakMap,weakMapBasicDetection=isCallable$f(WeakMap$1)&&/native code/.test(String(WeakMap$1)),createPropertyDescriptor$7=function($e,De){return{enumerable:!($e&1),configurable:!($e&2),writable:!($e&4),value:De}},DESCRIPTORS$c=descriptors,definePropertyModule$3=objectDefineProperty,createPropertyDescriptor$6=createPropertyDescriptor$7,createNonEnumerableProperty$7=DESCRIPTORS$c?function($e,De,Fe){return definePropertyModule$3.f($e,De,createPropertyDescriptor$6(1,Fe))}:function($e,De,Fe){return $e[De]=Fe,$e},NATIVE_WEAK_MAP=weakMapBasicDetection,globalThis$e=globalThis_1,isObject$7=isObject$c,createNonEnumerableProperty$6=createNonEnumerableProperty$7,hasOwn$9=hasOwnProperty_1,shared=sharedStoreExports,sharedKey$1=sharedKey$3,hiddenKeys$1=hiddenKeys$4,OBJECT_ALREADY_INITIALIZED="Object already initialized",TypeError$4=globalThis$e.TypeError,WeakMap=globalThis$e.WeakMap,set$1,get,has,enforce=function($e){return has($e)?get($e):set$1($e,{})},getterFor=function($e){return function(De){var Fe;if(!isObject$7(De)||(Fe=get(De)).type!==$e)throw new TypeError$4("Incompatible receiver, "+$e+" required");return Fe}};if(NATIVE_WEAK_MAP||shared.state){var store$1=shared.state||(shared.state=new WeakMap);store$1.get=store$1.get,store$1.has=store$1.has,store$1.set=store$1.set,set$1=function($e,De){if(store$1.has($e))throw new TypeError$4(OBJECT_ALREADY_INITIALIZED);return De.facade=$e,store$1.set($e,De),De},get=function($e){return store$1.get($e)||{}},has=function($e){return store$1.has($e)}}else{var STATE=sharedKey$1("state");hiddenKeys$1[STATE]=!0,set$1=function($e,De){if(hasOwn$9($e,STATE))throw new TypeError$4(OBJECT_ALREADY_INITIALIZED);return De.facade=$e,createNonEnumerableProperty$6($e,STATE,De),De},get=function($e){return hasOwn$9($e,STATE)?$e[STATE]:{}},has=function($e){return hasOwn$9($e,STATE)}}var internalState={set:set$1,get,has,enforce,getterFor},objectGetOwnPropertyDescriptor={},objectPropertyIsEnumerable={},$propertyIsEnumerable={}.propertyIsEnumerable,getOwnPropertyDescriptor$2=Object.getOwnPropertyDescriptor,NASHORN_BUG=getOwnPropertyDescriptor$2&&!$propertyIsEnumerable.call({1:2},1);objectPropertyIsEnumerable.f=NASHORN_BUG?function(De){var Fe=getOwnPropertyDescriptor$2(this,De);return!!Fe&&Fe.enumerable}:$propertyIsEnumerable;var DESCRIPTORS$b=descriptors,call$e=functionCall,propertyIsEnumerableModule$1=objectPropertyIsEnumerable,createPropertyDescriptor$5=createPropertyDescriptor$7,toIndexedObject$1=toIndexedObject$5,toPropertyKey=toPropertyKey$2,hasOwn$8=hasOwnProperty_1,IE8_DOM_DEFINE=ie8DomDefine,$getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor;objectGetOwnPropertyDescriptor.f=DESCRIPTORS$b?$getOwnPropertyDescriptor:function(De,Fe){if(De=toIndexedObject$1(De),Fe=toPropertyKey(Fe),IE8_DOM_DEFINE)try{return $getOwnPropertyDescriptor(De,Fe)}catch{}if(hasOwn$8(De,Fe))return createPropertyDescriptor$5(!call$e(propertyIsEnumerableModule$1.f,De,Fe),De[Fe])};var makeBuiltIn$3={exports:{}},DESCRIPTORS$a=descriptors,hasOwn$7=hasOwnProperty_1,FunctionPrototype$1=Function.prototype,getDescriptor=DESCRIPTORS$a&&Object.getOwnPropertyDescriptor,EXISTS=hasOwn$7(FunctionPrototype$1,"name"),PROPER=EXISTS&&(function(){}).name==="something",CONFIGURABLE=EXISTS&&(!DESCRIPTORS$a||DESCRIPTORS$a&&getDescriptor(FunctionPrototype$1,"name").configurable),functionName={EXISTS,PROPER,CONFIGURABLE},uncurryThis$h=functionUncurryThis,isCallable$e=isCallable$l,store=sharedStoreExports,functionToString=uncurryThis$h(Function.toString);isCallable$e(store.inspectSource)||(store.inspectSource=function($e){return functionToString($e)});var inspectSource$3=store.inspectSource,uncurryThis$g=functionUncurryThis,fails$a=fails$h,isCallable$d=isCallable$l,hasOwn$6=hasOwnProperty_1,DESCRIPTORS$9=descriptors,CONFIGURABLE_FUNCTION_NAME$1=functionName.CONFIGURABLE,inspectSource$2=inspectSource$3,InternalStateModule$5=internalState,enforceInternalState=InternalStateModule$5.enforce,getInternalState$2=InternalStateModule$5.get,$String$2=String,defineProperty$4=Object.defineProperty,stringSlice$3=uncurryThis$g("".slice),replace$5=uncurryThis$g("".replace),join$4=uncurryThis$g([].join),CONFIGURABLE_LENGTH=DESCRIPTORS$9&&!fails$a(function(){return defineProperty$4(function(){},"length",{value:8}).length!==8}),TEMPLATE=String(String).split("String"),makeBuiltIn$2=makeBuiltIn$3.exports=function($e,De,Fe){stringSlice$3($String$2(De),0,7)==="Symbol("&&(De="["+replace$5($String$2(De),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),Fe&&Fe.getter&&(De="get "+De),Fe&&Fe.setter&&(De="set "+De),(!hasOwn$6($e,"name")||CONFIGURABLE_FUNCTION_NAME$1&&$e.name!==De)&&(DESCRIPTORS$9?defineProperty$4($e,"name",{value:De,configurable:!0}):$e.name=De),CONFIGURABLE_LENGTH&&Fe&&hasOwn$6(Fe,"arity")&&$e.length!==Fe.arity&&defineProperty$4($e,"length",{value:Fe.arity});try{Fe&&hasOwn$6(Fe,"constructor")&&Fe.constructor?DESCRIPTORS$9&&defineProperty$4($e,"prototype",{writable:!1}):$e.prototype&&($e.prototype=void 0)}catch{}var Be=enforceInternalState($e);return hasOwn$6(Be,"source")||(Be.source=join$4(TEMPLATE,typeof De=="string"?De:"")),$e};Function.prototype.toString=makeBuiltIn$2(function(){return isCallable$d(this)&&getInternalState$2(this).source||inspectSource$2(this)},"toString");var makeBuiltInExports=makeBuiltIn$3.exports,isCallable$c=isCallable$l,definePropertyModule$2=objectDefineProperty,makeBuiltIn$1=makeBuiltInExports,defineGlobalProperty$1=defineGlobalProperty$3,defineBuiltIn$c=function($e,De,Fe,Be){Be||(Be={});var He=Be.enumerable,Ke=Be.name!==void 0?Be.name:De;if(isCallable$c(Fe)&&makeBuiltIn$1(Fe,Ke,Be),Be.global)He?$e[De]=Fe:defineGlobalProperty$1(De,Fe);else{try{Be.unsafe?$e[De]&&(He=!0):delete $e[De]}catch{}He?$e[De]=Fe:definePropertyModule$2.f($e,De,{value:Fe,enumerable:!1,configurable:!Be.nonConfigurable,writable:!Be.nonWritable})}return $e},objectGetOwnPropertyNames={},internalObjectKeys=objectKeysInternal,enumBugKeys=enumBugKeys$3,hiddenKeys=enumBugKeys.concat("length","prototype");objectGetOwnPropertyNames.f=Object.getOwnPropertyNames||function(De){return internalObjectKeys(De,hiddenKeys)};var objectGetOwnPropertySymbols={};objectGetOwnPropertySymbols.f=Object.getOwnPropertySymbols;var getBuiltIn$9=getBuiltIn$c,uncurryThis$f=functionUncurryThis,getOwnPropertyNamesModule=objectGetOwnPropertyNames,getOwnPropertySymbolsModule$1=objectGetOwnPropertySymbols,anObject$7=anObject$b,concat$1=uncurryThis$f([].concat),ownKeys$2=getBuiltIn$9("Reflect","ownKeys")||function(De){var Fe=getOwnPropertyNamesModule.f(anObject$7(De)),Be=getOwnPropertySymbolsModule$1.f;return Be?concat$1(Fe,Be(De)):Fe},hasOwn$5=hasOwnProperty_1,ownKeys$1=ownKeys$2,getOwnPropertyDescriptorModule=objectGetOwnPropertyDescriptor,definePropertyModule$1=objectDefineProperty,copyConstructorProperties$2=function($e,De,Fe){for(var Be=ownKeys$1(De),He=definePropertyModule$1.f,Ke=getOwnPropertyDescriptorModule.f,Ge=0;Ge<Be.length;Ge++){var We=Be[Ge];!hasOwn$5($e,We)&&!(Fe&&hasOwn$5(Fe,We))&&He($e,We,Ke(De,We))}},fails$9=fails$h,isCallable$b=isCallable$l,replacement=/#|\.prototype\./,isForced$2=function($e,De){var Fe=data[normalize($e)];return Fe===POLYFILL?!0:Fe===NATIVE?!1:isCallable$b(De)?fails$9(De):!!De},normalize=isForced$2.normalize=function($e){return String($e).replace(replacement,".").toLowerCase()},data=isForced$2.data={},NATIVE=isForced$2.NATIVE="N",POLYFILL=isForced$2.POLYFILL="P",isForced_1=isForced$2,globalThis$d=globalThis_1,getOwnPropertyDescriptor$1=objectGetOwnPropertyDescriptor.f,createNonEnumerableProperty$5=createNonEnumerableProperty$7,defineBuiltIn$b=defineBuiltIn$c,defineGlobalProperty=defineGlobalProperty$3,copyConstructorProperties$1=copyConstructorProperties$2,isForced$1=isForced_1,_export=function($e,De){var Fe=$e.target,Be=$e.global,He=$e.stat,Ke,Ge,We,Ze,Xe,Je;if(Be?Ge=globalThis$d:He?Ge=globalThis$d[Fe]||defineGlobalProperty(Fe,{}):Ge=globalThis$d[Fe]&&globalThis$d[Fe].prototype,Ge)for(We in De){if(Xe=De[We],$e.dontCallGetSet?(Je=getOwnPropertyDescriptor$1(Ge,We),Ze=Je&&Je.value):Ze=Ge[We],Ke=isForced$1(Be?We:Fe+(He?".":"#")+We,$e.forced),!Ke&&Ze!==void 0){if(typeof Xe==typeof Ze)continue;copyConstructorProperties$1(Xe,Ze)}($e.sham||Ze&&Ze.sham)&&createNonEnumerableProperty$5(Xe,"sham",!0),defineBuiltIn$b(Ge,We,Xe,$e)}},fails$8=fails$h,correctPrototypeGetter=!fails$8(function(){function $e(){}return $e.prototype.constructor=null,Object.getPrototypeOf(new $e)!==$e.prototype}),hasOwn$4=hasOwnProperty_1,isCallable$a=isCallable$l,toObject$2=toObject$4,sharedKey=sharedKey$3,CORRECT_PROTOTYPE_GETTER=correctPrototypeGetter,IE_PROTO=sharedKey("IE_PROTO"),$Object$1=Object,ObjectPrototype=$Object$1.prototype,objectGetPrototypeOf=CORRECT_PROTOTYPE_GETTER?$Object$1.getPrototypeOf:function($e){var De=toObject$2($e);if(hasOwn$4(De,IE_PROTO))return De[IE_PROTO];var Fe=De.constructor;return isCallable$a(Fe)&&De instanceof Fe?Fe.prototype:De instanceof $Object$1?ObjectPrototype:null},fails$7=fails$h,isCallable$9=isCallable$l,isObject$6=isObject$c,getPrototypeOf$2=objectGetPrototypeOf,defineBuiltIn$a=defineBuiltIn$c,wellKnownSymbol$e=wellKnownSymbol$h,ITERATOR$7=wellKnownSymbol$e("iterator"),BUGGY_SAFARI_ITERATORS$1=!1,IteratorPrototype$2,PrototypeOfArrayIteratorPrototype,arrayIterator;[].keys&&(arrayIterator=[].keys(),"next"in arrayIterator?(PrototypeOfArrayIteratorPrototype=getPrototypeOf$2(getPrototypeOf$2(arrayIterator)),PrototypeOfArrayIteratorPrototype!==Object.prototype&&(IteratorPrototype$2=PrototypeOfArrayIteratorPrototype)):BUGGY_SAFARI_ITERATORS$1=!0);var NEW_ITERATOR_PROTOTYPE=!isObject$6(IteratorPrototype$2)||fails$7(function(){var $e={};return IteratorPrototype$2[ITERATOR$7].call($e)!==$e});NEW_ITERATOR_PROTOTYPE&&(IteratorPrototype$2={});isCallable$9(IteratorPrototype$2[ITERATOR$7])||defineBuiltIn$a(IteratorPrototype$2,ITERATOR$7,function(){return this});var iteratorsCore={IteratorPrototype:IteratorPrototype$2,BUGGY_SAFARI_ITERATORS:BUGGY_SAFARI_ITERATORS$1},defineProperty$3=objectDefineProperty.f,hasOwn$3=hasOwnProperty_1,wellKnownSymbol$d=wellKnownSymbol$h,TO_STRING_TAG$3=wellKnownSymbol$d("toStringTag"),setToStringTag$6=function($e,De,Fe){$e&&!Fe&&($e=$e.prototype),$e&&!hasOwn$3($e,TO_STRING_TAG$3)&&defineProperty$3($e,TO_STRING_TAG$3,{configurable:!0,value:De})},IteratorPrototype$1=iteratorsCore.IteratorPrototype,create$2=objectCreate,createPropertyDescriptor$4=createPropertyDescriptor$7,setToStringTag$5=setToStringTag$6,Iterators$4=iterators,returnThis$1=function(){return this},iteratorCreateConstructor=function($e,De,Fe,Be){var He=De+" Iterator";return $e.prototype=create$2(IteratorPrototype$1,{next:createPropertyDescriptor$4(+!Be,Fe)}),setToStringTag$5($e,He,!1),Iterators$4[He]=returnThis$1,$e},uncurryThis$e=functionUncurryThis,aCallable$9=aCallable$b,functionUncurryThisAccessor=function($e,De,Fe){try{return uncurryThis$e(aCallable$9(Object.getOwnPropertyDescriptor($e,De)[Fe]))}catch{}},isObject$5=isObject$c,isPossiblePrototype$1=function($e){return isObject$5($e)||$e===null},isPossiblePrototype=isPossiblePrototype$1,$String$1=String,$TypeError$6=TypeError,aPossiblePrototype$1=function($e){if(isPossiblePrototype($e))return $e;throw new $TypeError$6("Can't set "+$String$1($e)+" as a prototype")},uncurryThisAccessor=functionUncurryThisAccessor,isObject$4=isObject$c,requireObjectCoercible$1=requireObjectCoercible$4,aPossiblePrototype=aPossiblePrototype$1,objectSetPrototypeOf=Object.setPrototypeOf||("__proto__"in{}?function(){var $e=!1,De={},Fe;try{Fe=uncurryThisAccessor(Object.prototype,"__proto__","set"),Fe(De,[]),$e=De instanceof Array}catch{}return function(He,Ke){return requireObjectCoercible$1(He),aPossiblePrototype(Ke),isObject$4(He)&&($e?Fe(He,Ke):He.__proto__=Ke),He}}():void 0),$$l=_export,call$d=functionCall,FunctionName=functionName,isCallable$8=isCallable$l,createIteratorConstructor$1=iteratorCreateConstructor,getPrototypeOf$1=objectGetPrototypeOf,setPrototypeOf$2=objectSetPrototypeOf,setToStringTag$4=setToStringTag$6,createNonEnumerableProperty$4=createNonEnumerableProperty$7,defineBuiltIn$9=defineBuiltIn$c,wellKnownSymbol$c=wellKnownSymbol$h,Iterators$3=iterators,IteratorsCore=iteratorsCore,PROPER_FUNCTION_NAME=FunctionName.PROPER,CONFIGURABLE_FUNCTION_NAME=FunctionName.CONFIGURABLE,IteratorPrototype=IteratorsCore.IteratorPrototype,BUGGY_SAFARI_ITERATORS=IteratorsCore.BUGGY_SAFARI_ITERATORS,ITERATOR$6=wellKnownSymbol$c("iterator"),KEYS="keys",VALUES="values",ENTRIES="entries",returnThis=function(){return this},iteratorDefine=function($e,De,Fe,Be,He,Ke,Ge){createIteratorConstructor$1(Fe,De,Be);var We=function(ft){if(ft===He&&Qe)return Qe;if(!BUGGY_SAFARI_ITERATORS&&ft&&ft in Je)return Je[ft];switch(ft){case KEYS:return function(){return new Fe(this,ft)};case VALUES:return function(){return new Fe(this,ft)};case ENTRIES:return function(){return new Fe(this,ft)}}return function(){return new Fe(this)}},Ze=De+" Iterator",Xe=!1,Je=$e.prototype,Ye=Je[ITERATOR$6]||Je["@@iterator"]||He&&Je[He],Qe=!BUGGY_SAFARI_ITERATORS&&Ye||We(He),et=De==="Array"&&Je.entries||Ye,tt,ct,at;if(et&&(tt=getPrototypeOf$1(et.call(new $e)),tt!==Object.prototype&&tt.next&&(getPrototypeOf$1(tt)!==IteratorPrototype&&(setPrototypeOf$2?setPrototypeOf$2(tt,IteratorPrototype):isCallable$8(tt[ITERATOR$6])||defineBuiltIn$9(tt,ITERATOR$6,returnThis)),setToStringTag$4(tt,Ze,!0))),PROPER_FUNCTION_NAME&&He===VALUES&&Ye&&Ye.name!==VALUES&&(CONFIGURABLE_FUNCTION_NAME?createNonEnumerableProperty$4(Je,"name",VALUES):(Xe=!0,Qe=function(){return call$d(Ye,this)})),He)if(ct={values:We(VALUES),keys:Ke?Qe:We(KEYS),entries:We(ENTRIES)},Ge)for(at in ct)(BUGGY_SAFARI_ITERATORS||Xe||!(at in Je))&&defineBuiltIn$9(Je,at,ct[at]);else $$l({target:De,proto:!0,forced:BUGGY_SAFARI_ITERATORS||Xe},ct);return Je[ITERATOR$6]!==Qe&&defineBuiltIn$9(Je,ITERATOR$6,Qe,{name:He}),Iterators$3[De]=Qe,ct},createIterResultObject$3=function($e,De){return{value:$e,done:De}},toIndexedObject=toIndexedObject$5,addToUnscopables=addToUnscopables$1,Iterators$2=iterators,InternalStateModule$4=internalState,defineProperty$2=objectDefineProperty.f,defineIterator$1=iteratorDefine,createIterResultObject$2=createIterResultObject$3,DESCRIPTORS$8=descriptors,ARRAY_ITERATOR="Array Iterator",setInternalState$4=InternalStateModule$4.set,getInternalState$1=InternalStateModule$4.getterFor(ARRAY_ITERATOR),es_array_iterator=defineIterator$1(Array,"Array",function($e,De){setInternalState$4(this,{type:ARRAY_ITERATOR,target:toIndexedObject($e),index:0,kind:De})},function(){var $e=getInternalState$1(this),De=$e.target,Fe=$e.index++;if(!De||Fe>=De.length)return $e.target=null,createIterResultObject$2(void 0,!0);switch($e.kind){case"keys":return createIterResultObject$2(Fe,!1);case"values":return createIterResultObject$2(De[Fe],!1)}return createIterResultObject$2([Fe,De[Fe]],!1)},"values"),values=Iterators$2.Arguments=Iterators$2.Array;addToUnscopables("keys");addToUnscopables("values");addToUnscopables("entries");if(DESCRIPTORS$8&&values.name!=="values")try{defineProperty$2(values,"name",{value:"values"})}catch{}var $$k=_export,uncurryThis$d=functionUncurryThis,toAbsoluteIndex=toAbsoluteIndex$2,$RangeError$1=RangeError,fromCharCode$2=String.fromCharCode,$fromCodePoint=String.fromCodePoint,join$3=uncurryThis$d([].join),INCORRECT_LENGTH=!!$fromCodePoint&&$fromCodePoint.length!==1;$$k({target:"String",stat:!0,arity:1,forced:INCORRECT_LENGTH},{fromCodePoint:function(De){for(var Fe=[],Be=arguments.length,He=0,Ke;Be>He;){if(Ke=+arguments[He++],toAbsoluteIndex(Ke,1114111)!==Ke)throw new $RangeError$1(Ke+" is not a valid code point");Fe[He]=Ke<65536?fromCharCode$2(Ke):fromCharCode$2(((Ke-=65536)>>10)+55296,Ke%1024+56320)}return join$3(Fe,"")}});var globalThis$c=globalThis_1,DESCRIPTORS$7=descriptors,getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,safeGetBuiltIn$2=function($e){if(!DESCRIPTORS$7)return globalThis$c[$e];var De=getOwnPropertyDescriptor(globalThis$c,$e);return De&&De.value},fails$6=fails$h,wellKnownSymbol$b=wellKnownSymbol$h,DESCRIPTORS$6=descriptors,IS_PURE=isPure,ITERATOR$5=wellKnownSymbol$b("iterator"),urlConstructorDetection=!fails$6(function(){var $e=new URL("b?a=1&b=2&c=3","https://a"),De=$e.searchParams,Fe=new URLSearchParams("a=1&a=2&b=3"),Be="";return $e.pathname="c%20d",De.forEach(function(He,Ke){De.delete("b"),Be+=Ke+He}),Fe.delete("a",2),Fe.delete("b",void 0),IS_PURE&&(!$e.toJSON||!Fe.has("a",1)||Fe.has("a",2)||!Fe.has("a",void 0)||Fe.has("b"))||!De.size&&(IS_PURE||!DESCRIPTORS$6)||!De.sort||$e.href!=="https://a/c%20d?a=1&c=3"||De.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!De[ITERATOR$5]||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"||Be!=="a1c3"||new URL("https://x",void 0).host!=="x"}),makeBuiltIn=makeBuiltInExports,defineProperty$1=objectDefineProperty,defineBuiltInAccessor$4=function($e,De,Fe){return Fe.get&&makeBuiltIn(Fe.get,De,{getter:!0}),Fe.set&&makeBuiltIn(Fe.set,De,{setter:!0}),defineProperty$1.f($e,De,Fe)},defineBuiltIn$8=defineBuiltIn$c,defineBuiltIns$1=function($e,De,Fe){for(var Be in De)defineBuiltIn$8($e,Be,De[Be],Fe);return $e},isPrototypeOf$2=objectIsPrototypeOf,$TypeError$5=TypeError,anInstance$3=function($e,De){if(isPrototypeOf$2(De,$e))return $e;throw new $TypeError$5("Incorrect invocation")},classofRaw$1=classofRaw$2,uncurryThis$c=functionUncurryThis,functionUncurryThisClause=function($e){if(classofRaw$1($e)==="Function")return uncurryThis$c($e)},uncurryThis$b=functionUncurryThisClause,aCallable$8=aCallable$b,NATIVE_BIND$1=functionBindNative,bind$7=uncurryThis$b(uncurryThis$b.bind),functionBindContext=function($e,De){return aCallable$8($e),De===void 0?$e:NATIVE_BIND$1?bind$7($e,De):function(){return $e.apply(De,arguments)}},wellKnownSymbol$a=wellKnownSymbol$h,TO_STRING_TAG$2=wellKnownSymbol$a("toStringTag"),test={};test[TO_STRING_TAG$2]="z";var toStringTagSupport=String(test)==="[object z]",TO_STRING_TAG_SUPPORT$2=toStringTagSupport,isCallable$7=isCallable$l,classofRaw=classofRaw$2,wellKnownSymbol$9=wellKnownSymbol$h,TO_STRING_TAG$1=wellKnownSymbol$9("toStringTag"),$Object=Object,CORRECT_ARGUMENTS=classofRaw(function(){return arguments}())==="Arguments",tryGet=function($e,De){try{return $e[De]}catch{}},classof$6=TO_STRING_TAG_SUPPORT$2?classofRaw:function($e){var De,Fe,Be;return $e===void 0?"Undefined":$e===null?"Null":typeof(Fe=tryGet(De=$Object($e),TO_STRING_TAG$1))=="string"?Fe:CORRECT_ARGUMENTS?classofRaw(De):(Be=classofRaw(De))==="Object"&&isCallable$7(De.callee)?"Arguments":Be},classof$5=classof$6,$String=String,toString$8=function($e){if(classof$5($e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return $String($e)},classof$4=classof$6,getMethod$1=getMethod$3,isNullOrUndefined$1=isNullOrUndefined$4,Iterators$1=iterators,wellKnownSymbol$8=wellKnownSymbol$h,ITERATOR$4=wellKnownSymbol$8("iterator"),getIteratorMethod$4=function($e){if(!isNullOrUndefined$1($e))return getMethod$1($e,ITERATOR$4)||getMethod$1($e,"@@iterator")||Iterators$1[classof$4($e)]},call$c=functionCall,aCallable$7=aCallable$b,anObject$6=anObject$b,tryToString$2=tryToString$4,getIteratorMethod$3=getIteratorMethod$4,$TypeError$4=TypeError,getIterator$3=function($e,De){var Fe=arguments.length<2?getIteratorMethod$3($e):De;if(aCallable$7(Fe))return anObject$6(call$c(Fe,$e));throw new $TypeError$4(tryToString$2($e)+" is not iterable")},$TypeError$3=TypeError,validateArgumentsLength$7=function($e,De){if($e<De)throw new $TypeError$3("Not enough arguments");return $e},uncurryThis$a=functionUncurryThis,arraySlice$3=uncurryThis$a([].slice),arraySlice$2=arraySlice$3,floor$2=Math.floor,sort=function($e,De){var Fe=$e.length;if(Fe<8)for(var Be=1,He,Ke;Be<Fe;){for(Ke=Be,He=$e[Be];Ke&&De($e[Ke-1],He)>0;)$e[Ke]=$e[--Ke];Ke!==Be++&&($e[Ke]=He)}else for(var Ge=floor$2(Fe/2),We=sort(arraySlice$2($e,0,Ge),De),Ze=sort(arraySlice$2($e,Ge),De),Xe=We.length,Je=Ze.length,Ye=0,Qe=0;Ye<Xe||Qe<Je;)$e[Ye+Qe]=Ye<Xe&&Qe<Je?De(We[Ye],Ze[Qe])<=0?We[Ye++]:Ze[Qe++]:Ye<Xe?We[Ye++]:Ze[Qe++];return $e},arraySort$1=sort,$$j=_export,globalThis$b=globalThis_1,safeGetBuiltIn$1=safeGetBuiltIn$2,getBuiltIn$8=getBuiltIn$c,call$b=functionCall,uncurryThis$9=functionUncurryThis,DESCRIPTORS$5=descriptors,USE_NATIVE_URL$3=urlConstructorDetection,defineBuiltIn$7=defineBuiltIn$c,defineBuiltInAccessor$3=defineBuiltInAccessor$4,defineBuiltIns=defineBuiltIns$1,setToStringTag$3=setToStringTag$6,createIteratorConstructor=iteratorCreateConstructor,InternalStateModule$3=internalState,anInstance$2=anInstance$3,isCallable$6=isCallable$l,hasOwn$2=hasOwnProperty_1,bind$6=functionBindContext,classof$3=classof$6,anObject$5=anObject$b,isObject$3=isObject$c,$toString$1=toString$8,create$1=objectCreate,createPropertyDescriptor$3=createPropertyDescriptor$7,getIterator$2=getIterator$3,getIteratorMethod$2=getIteratorMethod$4,createIterResultObject$1=createIterResultObject$3,validateArgumentsLength$6=validateArgumentsLength$7,wellKnownSymbol$7=wellKnownSymbol$h,arraySort=arraySort$1,ITERATOR$3=wellKnownSymbol$7("iterator"),URL_SEARCH_PARAMS="URLSearchParams",URL_SEARCH_PARAMS_ITERATOR=URL_SEARCH_PARAMS+"Iterator",setInternalState$3=InternalStateModule$3.set,getInternalParamsState=InternalStateModule$3.getterFor(URL_SEARCH_PARAMS),getInternalIteratorState=InternalStateModule$3.getterFor(URL_SEARCH_PARAMS_ITERATOR),nativeFetch=safeGetBuiltIn$1("fetch"),NativeRequest=safeGetBuiltIn$1("Request"),Headers=safeGetBuiltIn$1("Headers"),RequestPrototype=NativeRequest&&NativeRequest.prototype,HeadersPrototype=Headers&&Headers.prototype,TypeError$3=globalThis$b.TypeError,encodeURIComponent$1=globalThis$b.encodeURIComponent,fromCharCode$1=String.fromCharCode,fromCodePoint=getBuiltIn$8("String","fromCodePoint"),$parseInt=parseInt,charAt$3=uncurryThis$9("".charAt),join$2=uncurryThis$9([].join),push$4=uncurryThis$9([].push),replace$4=uncurryThis$9("".replace),shift$1=uncurryThis$9([].shift),splice=uncurryThis$9([].splice),split$2=uncurryThis$9("".split),stringSlice$2=uncurryThis$9("".slice),exec$3=uncurryThis$9(/./.exec),plus=/\+/g,FALLBACK_REPLACER="�",VALID_HEX=/^[0-9a-f]+$/i,parseHexOctet=function($e,De){var Fe=stringSlice$2($e,De,De+2);return exec$3(VALID_HEX,Fe)?$parseInt(Fe,16):NaN},getLeadingOnes=function($e){for(var De=0,Fe=128;Fe>0&&$e&Fe;Fe>>=1)De++;return De},utf8Decode=function($e){var De=null;switch($e.length){case 1:De=$e[0];break;case 2:De=($e[0]&31)<<6|$e[1]&63;break;case 3:De=($e[0]&15)<<12|($e[1]&63)<<6|$e[2]&63;break;case 4:De=($e[0]&7)<<18|($e[1]&63)<<12|($e[2]&63)<<6|$e[3]&63;break}return De>1114111?null:De},decode=function($e){$e=replace$4($e,plus," ");for(var De=$e.length,Fe="",Be=0;Be<De;){var He=charAt$3($e,Be);if(He==="%"){if(charAt$3($e,Be+1)==="%"||Be+3>De){Fe+="%",Be++;continue}var Ke=parseHexOctet($e,Be+1);if(Ke!==Ke){Fe+=He,Be++;continue}Be+=2;var Ge=getLeadingOnes(Ke);if(Ge===0)He=fromCharCode$1(Ke);else{if(Ge===1||Ge>4){Fe+=FALLBACK_REPLACER,Be++;continue}for(var We=[Ke],Ze=1;Ze<Ge&&(Be++,!(Be+3>De||charAt$3($e,Be)!=="%"));){var Xe=parseHexOctet($e,Be+1);if(Xe!==Xe){Be+=3;break}if(Xe>191||Xe<128)break;push$4(We,Xe),Be+=2,Ze++}if(We.length!==Ge){Fe+=FALLBACK_REPLACER;continue}var Je=utf8Decode(We);Je===null?Fe+=FALLBACK_REPLACER:He=fromCodePoint(Je)}}Fe+=He,Be++}return Fe},find=/[!'()~]|%20/g,replacements={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},replacer=function($e){return replacements[$e]},serialize=function($e){return replace$4(encodeURIComponent$1($e),find,replacer)},URLSearchParamsIterator=createIteratorConstructor(function(De,Fe){setInternalState$3(this,{type:URL_SEARCH_PARAMS_ITERATOR,target:getInternalParamsState(De).entries,index:0,kind:Fe})},URL_SEARCH_PARAMS,function(){var De=getInternalIteratorState(this),Fe=De.target,Be=De.index++;if(!Fe||Be>=Fe.length)return De.target=null,createIterResultObject$1(void 0,!0);var He=Fe[Be];switch(De.kind){case"keys":return createIterResultObject$1(He.key,!1);case"values":return createIterResultObject$1(He.value,!1)}return createIterResultObject$1([He.key,He.value],!1)},!0),URLSearchParamsState=function($e){this.entries=[],this.url=null,$e!==void 0&&(isObject$3($e)?this.parseObject($e):this.parseQuery(typeof $e=="string"?charAt$3($e,0)==="?"?stringSlice$2($e,1):$e:$toString$1($e)))};URLSearchParamsState.prototype={type:URL_SEARCH_PARAMS,bindURL:function($e){this.url=$e,this.update()},parseObject:function($e){var De=this.entries,Fe=getIteratorMethod$2($e),Be,He,Ke,Ge,We,Ze,Xe;if(Fe)for(Be=getIterator$2($e,Fe),He=Be.next;!(Ke=call$b(He,Be)).done;){if(Ge=getIterator$2(anObject$5(Ke.value)),We=Ge.next,(Ze=call$b(We,Ge)).done||(Xe=call$b(We,Ge)).done||!call$b(We,Ge).done)throw new TypeError$3("Expected sequence with length 2");push$4(De,{key:$toString$1(Ze.value),value:$toString$1(Xe.value)})}else for(var Je in $e)hasOwn$2($e,Je)&&push$4(De,{key:Je,value:$toString$1($e[Je])})},parseQuery:function($e){if($e)for(var De=this.entries,Fe=split$2($e,"&"),Be=0,He,Ke;Be<Fe.length;)He=Fe[Be++],He.length&&(Ke=split$2(He,"="),push$4(De,{key:decode(shift$1(Ke)),value:decode(join$2(Ke,"="))}))},serialize:function(){for(var $e=this.entries,De=[],Fe=0,Be;Fe<$e.length;)Be=$e[Fe++],push$4(De,serialize(Be.key)+"="+serialize(Be.value));return join$2(De,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var URLSearchParamsConstructor=function(){anInstance$2(this,URLSearchParamsPrototype$3);var De=arguments.length>0?arguments[0]:void 0,Fe=setInternalState$3(this,new URLSearchParamsState(De));DESCRIPTORS$5||(this.size=Fe.entries.length)},URLSearchParamsPrototype$3=URLSearchParamsConstructor.prototype;defineBuiltIns(URLSearchParamsPrototype$3,{append:function(De,Fe){var Be=getInternalParamsState(this);validateArgumentsLength$6(arguments.length,2),push$4(Be.entries,{key:$toString$1(De),value:$toString$1(Fe)}),DESCRIPTORS$5||this.length++,Be.updateURL()},delete:function($e){for(var De=getInternalParamsState(this),Fe=validateArgumentsLength$6(arguments.length,1),Be=De.entries,He=$toString$1($e),Ke=Fe<2?void 0:arguments[1],Ge=Ke===void 0?Ke:$toString$1(Ke),We=0;We<Be.length;){var Ze=Be[We];if(Ze.key===He&&(Ge===void 0||Ze.value===Ge)){if(splice(Be,We,1),Ge!==void 0)break}else We++}DESCRIPTORS$5||(this.size=Be.length),De.updateURL()},get:function(De){var Fe=getInternalParamsState(this).entries;validateArgumentsLength$6(arguments.length,1);for(var Be=$toString$1(De),He=0;He<Fe.length;He++)if(Fe[He].key===Be)return Fe[He].value;return null},getAll:function(De){var Fe=getInternalParamsState(this).entries;validateArgumentsLength$6(arguments.length,1);for(var Be=$toString$1(De),He=[],Ke=0;Ke<Fe.length;Ke++)Fe[Ke].key===Be&&push$4(He,Fe[Ke].value);return He},has:function(De){for(var Fe=getInternalParamsState(this).entries,Be=validateArgumentsLength$6(arguments.length,1),He=$toString$1(De),Ke=Be<2?void 0:arguments[1],Ge=Ke===void 0?Ke:$toString$1(Ke),We=0;We<Fe.length;){var Ze=Fe[We++];if(Ze.key===He&&(Ge===void 0||Ze.value===Ge))return!0}return!1},set:function(De,Fe){var Be=getInternalParamsState(this);validateArgumentsLength$6(arguments.length,1);for(var He=Be.entries,Ke=!1,Ge=$toString$1(De),We=$toString$1(Fe),Ze=0,Xe;Ze<He.length;Ze++)Xe=He[Ze],Xe.key===Ge&&(Ke?splice(He,Ze--,1):(Ke=!0,Xe.value=We));Ke||push$4(He,{key:Ge,value:We}),DESCRIPTORS$5||(this.size=He.length),Be.updateURL()},sort:function(){var De=getInternalParamsState(this);arraySort(De.entries,function(Fe,Be){return Fe.key>Be.key?1:-1}),De.updateURL()},forEach:function(De){for(var Fe=getInternalParamsState(this).entries,Be=bind$6(De,arguments.length>1?arguments[1]:void 0),He=0,Ke;He<Fe.length;)Ke=Fe[He++],Be(Ke.value,Ke.key,this)},keys:function(){return new URLSearchParamsIterator(this,"keys")},values:function(){return new URLSearchParamsIterator(this,"values")},entries:function(){return new URLSearchParamsIterator(this,"entries")}},{enumerable:!0});defineBuiltIn$7(URLSearchParamsPrototype$3,ITERATOR$3,URLSearchParamsPrototype$3.entries,{name:"entries"});defineBuiltIn$7(URLSearchParamsPrototype$3,"toString",function(){return getInternalParamsState(this).serialize()},{enumerable:!0});DESCRIPTORS$5&&defineBuiltInAccessor$3(URLSearchParamsPrototype$3,"size",{get:function(){return getInternalParamsState(this).entries.length},configurable:!0,enumerable:!0});setToStringTag$3(URLSearchParamsConstructor,URL_SEARCH_PARAMS);$$j({global:!0,constructor:!0,forced:!USE_NATIVE_URL$3},{URLSearchParams:URLSearchParamsConstructor});if(!USE_NATIVE_URL$3&&isCallable$6(Headers)){var headersHas=uncurryThis$9(HeadersPrototype.has),headersSet=uncurryThis$9(HeadersPrototype.set),wrapRequestOptions=function($e){if(isObject$3($e)){var De=$e.body,Fe;if(classof$3(De)===URL_SEARCH_PARAMS)return Fe=$e.headers?new Headers($e.headers):new Headers,headersHas(Fe,"content-type")||headersSet(Fe,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),create$1($e,{body:createPropertyDescriptor$3(0,$toString$1(De)),headers:createPropertyDescriptor$3(0,Fe)})}return $e};if(isCallable$6(nativeFetch)&&$$j({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(De){return nativeFetch(De,arguments.length>1?wrapRequestOptions(arguments[1]):{})}}),isCallable$6(NativeRequest)){var RequestConstructor=function(De){return anInstance$2(this,RequestPrototype),new NativeRequest(De,arguments.length>1?wrapRequestOptions(arguments[1]):{})};RequestPrototype.constructor=RequestConstructor,RequestConstructor.prototype=RequestPrototype,$$j({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:RequestConstructor})}}var web_urlSearchParams_constructor={URLSearchParams:URLSearchParamsConstructor,getState:getInternalParamsState},defineBuiltIn$6=defineBuiltIn$c,uncurryThis$8=functionUncurryThis,toString$7=toString$8,validateArgumentsLength$5=validateArgumentsLength$7,$URLSearchParams$1=URLSearchParams,URLSearchParamsPrototype$2=$URLSearchParams$1.prototype,append=uncurryThis$8(URLSearchParamsPrototype$2.append),$delete=uncurryThis$8(URLSearchParamsPrototype$2.delete),forEach$1=uncurryThis$8(URLSearchParamsPrototype$2.forEach),push$3=uncurryThis$8([].push),params$1=new $URLSearchParams$1("a=1&a=2&b=3");params$1.delete("a",1);params$1.delete("b",void 0);params$1+""!="a=2"&&defineBuiltIn$6(URLSearchParamsPrototype$2,"delete",function($e){var De=arguments.length,Fe=De<2?void 0:arguments[1];if(De&&Fe===void 0)return $delete(this,$e);var Be=[];forEach$1(this,function(Ye,Qe){push$3(Be,{key:Qe,value:Ye})}),validateArgumentsLength$5(De,1);for(var He=toString$7($e),Ke=toString$7(Fe),Ge=0,We=0,Ze=!1,Xe=Be.length,Je;Ge<Xe;)Je=Be[Ge++],Ze||Je.key===He?(Ze=!0,$delete(this,Je.key)):We++;for(;We<Xe;)Je=Be[We++],Je.key===He&&Je.value===Ke||append(this,Je.key,Je.value)},{enumerable:!0,unsafe:!0});var defineBuiltIn$5=defineBuiltIn$c,uncurryThis$7=functionUncurryThis,toString$6=toString$8,validateArgumentsLength$4=validateArgumentsLength$7,$URLSearchParams=URLSearchParams,URLSearchParamsPrototype$1=$URLSearchParams.prototype,getAll=uncurryThis$7(URLSearchParamsPrototype$1.getAll),$has=uncurryThis$7(URLSearchParamsPrototype$1.has),params=new $URLSearchParams("a=1");(params.has("a",2)||!params.has("a",void 0))&&defineBuiltIn$5(URLSearchParamsPrototype$1,"has",function(De){var Fe=arguments.length,Be=Fe<2?void 0:arguments[1];if(Fe&&Be===void 0)return $has(this,De);var He=getAll(this,De);validateArgumentsLength$4(Fe,1);for(var Ke=toString$6(Be),Ge=0;Ge<He.length;)if(He[Ge++]===Ke)return!0;return!1},{enumerable:!0,unsafe:!0});var DESCRIPTORS$4=descriptors,uncurryThis$6=functionUncurryThis,defineBuiltInAccessor$2=defineBuiltInAccessor$4,URLSearchParamsPrototype=URLSearchParams.prototype,forEach=uncurryThis$6(URLSearchParamsPrototype.forEach);DESCRIPTORS$4&&!("size"in URLSearchParamsPrototype)&&defineBuiltInAccessor$2(URLSearchParamsPrototype,"size",{get:function(){var De=0;return forEach(this,function(){De++}),De},configurable:!0,enumerable:!0});var globalThis$a=globalThis_1,path$3=globalThis$a,path$2=path$3;path$2.URLSearchParams;var uncurryThis$5=functionUncurryThis,toIntegerOrInfinity=toIntegerOrInfinity$3,toString$5=toString$8,requireObjectCoercible=requireObjectCoercible$4,charAt$2=uncurryThis$5("".charAt),charCodeAt$1=uncurryThis$5("".charCodeAt),stringSlice$1=uncurryThis$5("".slice),createMethod=function($e){return function(De,Fe){var Be=toString$5(requireObjectCoercible(De)),He=toIntegerOrInfinity(Fe),Ke=Be.length,Ge,We;return He<0||He>=Ke?$e?"":void 0:(Ge=charCodeAt$1(Be,He),Ge<55296||Ge>56319||He+1===Ke||(We=charCodeAt$1(Be,He+1))<56320||We>57343?$e?charAt$2(Be,He):Ge:$e?stringSlice$1(Be,He,He+2):(Ge-55296<<10)+(We-56320)+65536)}},stringMultibyte={codeAt:createMethod(!1),charAt:createMethod(!0)},charAt$1=stringMultibyte.charAt,toString$4=toString$8,InternalStateModule$2=internalState,defineIterator=iteratorDefine,createIterResultObject=createIterResultObject$3,STRING_ITERATOR="String Iterator",setInternalState$2=InternalStateModule$2.set,getInternalState=InternalStateModule$2.getterFor(STRING_ITERATOR);defineIterator(String,"String",function($e){setInternalState$2(this,{type:STRING_ITERATOR,string:toString$4($e),index:0})},function(){var De=getInternalState(this),Fe=De.string,Be=De.index,He;return Be>=Fe.length?createIterResultObject(void 0,!0):(He=charAt$1(Fe,Be),De.index+=He.length,createIterResultObject(He,!1))});var DESCRIPTORS$3=descriptors,uncurryThis$4=functionUncurryThis,call$a=functionCall,fails$5=fails$h,objectKeys=objectKeys$2,getOwnPropertySymbolsModule=objectGetOwnPropertySymbols,propertyIsEnumerableModule=objectPropertyIsEnumerable,toObject$1=toObject$4,IndexedObject=indexedObject,$assign=Object.assign,defineProperty=Object.defineProperty,concat=uncurryThis$4([].concat),objectAssign=!$assign||fails$5(function(){if(DESCRIPTORS$3&&$assign({b:1},$assign(defineProperty({},"a",{enumerable:!0,get:function(){defineProperty(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var $e={},De={},Fe=Symbol("assign detection"),Be="abcdefghijklmnopqrst";return $e[Fe]=7,Be.split("").forEach(function(He){De[He]=He}),$assign({},$e)[Fe]!==7||objectKeys($assign({},De)).join("")!==Be})?function(De,Fe){for(var Be=toObject$1(De),He=arguments.length,Ke=1,Ge=getOwnPropertySymbolsModule.f,We=propertyIsEnumerableModule.f;He>Ke;)for(var Ze=IndexedObject(arguments[Ke++]),Xe=Ge?concat(objectKeys(Ze),Ge(Ze)):objectKeys(Ze),Je=Xe.length,Ye=0,Qe;Je>Ye;)Qe=Xe[Ye++],(!DESCRIPTORS$3||call$a(We,Ze,Qe))&&(Be[Qe]=Ze[Qe]);return Be}:$assign,call$9=functionCall,anObject$4=anObject$b,getMethod=getMethod$3,iteratorClose$2=function($e,De,Fe){var Be,He;anObject$4($e);try{if(Be=getMethod($e,"return"),!Be){if(De==="throw")throw Fe;return Fe}Be=call$9(Be,$e)}catch(Ke){He=!0,Be=Ke}if(De==="throw")throw Fe;if(He)throw Be;return anObject$4(Be),Fe},anObject$3=anObject$b,iteratorClose$1=iteratorClose$2,callWithSafeIterationClosing$1=function($e,De,Fe,Be){try{return Be?De(anObject$3(Fe)[0],Fe[1]):De(Fe)}catch(He){iteratorClose$1($e,"throw",He)}},wellKnownSymbol$6=wellKnownSymbol$h,Iterators=iterators,ITERATOR$2=wellKnownSymbol$6("iterator"),ArrayPrototype=Array.prototype,isArrayIteratorMethod$2=function($e){return $e!==void 0&&(Iterators.Array===$e||ArrayPrototype[ITERATOR$2]===$e)},uncurryThis$3=functionUncurryThis,fails$4=fails$h,isCallable$5=isCallable$l,classof$2=classof$6,getBuiltIn$7=getBuiltIn$c,inspectSource$1=inspectSource$3,noop=function(){},construct=getBuiltIn$7("Reflect","construct"),constructorRegExp=/^\s*(?:class|function)\b/,exec$2=uncurryThis$3(constructorRegExp.exec),INCORRECT_TO_STRING=!constructorRegExp.test(noop),isConstructorModern=function(De){if(!isCallable$5(De))return!1;try{return construct(noop,[],De),!0}catch{return!1}},isConstructorLegacy=function(De){if(!isCallable$5(De))return!1;switch(classof$2(De)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return INCORRECT_TO_STRING||!!exec$2(constructorRegExp,inspectSource$1(De))}catch{return!0}};isConstructorLegacy.sham=!0;var isConstructor$2=!construct||fails$4(function(){var $e;return isConstructorModern(isConstructorModern.call)||!isConstructorModern(Object)||!isConstructorModern(function(){$e=!0})||$e})?isConstructorLegacy:isConstructorModern,DESCRIPTORS$2=descriptors,definePropertyModule=objectDefineProperty,createPropertyDescriptor$2=createPropertyDescriptor$7,createProperty$1=function($e,De,Fe){DESCRIPTORS$2?definePropertyModule.f($e,De,createPropertyDescriptor$2(0,Fe)):$e[De]=Fe},bind$5=functionBindContext,call$8=functionCall,toObject=toObject$4,callWithSafeIterationClosing=callWithSafeIterationClosing$1,isArrayIteratorMethod$1=isArrayIteratorMethod$2,isConstructor$1=isConstructor$2,lengthOfArrayLike$1=lengthOfArrayLike$3,createProperty=createProperty$1,getIterator$1=getIterator$3,getIteratorMethod$1=getIteratorMethod$4,$Array=Array,arrayFrom$1=function(De){var Fe=toObject(De),Be=isConstructor$1(this),He=arguments.length,Ke=He>1?arguments[1]:void 0,Ge=Ke!==void 0;Ge&&(Ke=bind$5(Ke,He>2?arguments[2]:void 0));var We=getIteratorMethod$1(Fe),Ze=0,Xe,Je,Ye,Qe,et,tt;if(We&&!(this===$Array&&isArrayIteratorMethod$1(We)))for(Je=Be?new this:[],Qe=getIterator$1(Fe,We),et=Qe.next;!(Ye=call$8(et,Qe)).done;Ze++)tt=Ge?callWithSafeIterationClosing(Qe,Ke,[Ye.value,Ze],!0):Ye.value,createProperty(Je,Ze,tt);else for(Xe=lengthOfArrayLike$1(Fe),Je=Be?new this(Xe):$Array(Xe);Xe>Ze;Ze++)tt=Ge?Ke(Fe[Ze],Ze):Fe[Ze],createProperty(Je,Ze,tt);return Je.length=Ze,Je},uncurryThis$2=functionUncurryThis,maxInt=2147483647,base=36,tMin=1,tMax=26,skew=38,damp=700,initialBias=72,initialN=128,delimiter="-",regexNonASCII=/[^\0-\u007E]/,regexSeparators=/[.\u3002\uFF0E\uFF61]/g,OVERFLOW_ERROR="Overflow: input needs wider integers to process",baseMinusTMin=base-tMin,$RangeError=RangeError,exec$1=uncurryThis$2(regexSeparators.exec),floor$1=Math.floor,fromCharCode=String.fromCharCode,charCodeAt=uncurryThis$2("".charCodeAt),join$1=uncurryThis$2([].join),push$2=uncurryThis$2([].push),replace$3=uncurryThis$2("".replace),split$1=uncurryThis$2("".split),toLowerCase$1=uncurryThis$2("".toLowerCase),ucs2decode=function($e){for(var De=[],Fe=0,Be=$e.length;Fe<Be;){var He=charCodeAt($e,Fe++);if(He>=55296&&He<=56319&&Fe<Be){var Ke=charCodeAt($e,Fe++);(Ke&64512)===56320?push$2(De,((He&1023)<<10)+(Ke&1023)+65536):(push$2(De,He),Fe--)}else push$2(De,He)}return De},digitToBasic=function($e){return $e+22+75*($e<26)},adapt=function($e,De,Fe){var Be=0;for($e=Fe?floor$1($e/damp):$e>>1,$e+=floor$1($e/De);$e>baseMinusTMin*tMax>>1;)$e=floor$1($e/baseMinusTMin),Be+=base;return floor$1(Be+(baseMinusTMin+1)*$e/($e+skew))},encode=function($e){var De=[];$e=ucs2decode($e);var Fe=$e.length,Be=initialN,He=0,Ke=initialBias,Ge,We;for(Ge=0;Ge<$e.length;Ge++)We=$e[Ge],We<128&&push$2(De,fromCharCode(We));var Ze=De.length,Xe=Ze;for(Ze&&push$2(De,delimiter);Xe<Fe;){var Je=maxInt;for(Ge=0;Ge<$e.length;Ge++)We=$e[Ge],We>=Be&&We<Je&&(Je=We);var Ye=Xe+1;if(Je-Be>floor$1((maxInt-He)/Ye))throw new $RangeError(OVERFLOW_ERROR);for(He+=(Je-Be)*Ye,Be=Je,Ge=0;Ge<$e.length;Ge++){if(We=$e[Ge],We<Be&&++He>maxInt)throw new $RangeError(OVERFLOW_ERROR);if(We===Be){for(var Qe=He,et=base;;){var tt=et<=Ke?tMin:et>=Ke+tMax?tMax:et-Ke;if(Qe<tt)break;var ct=Qe-tt,at=base-tt;push$2(De,fromCharCode(digitToBasic(tt+ct%at))),Qe=floor$1(ct/at),et+=base}push$2(De,fromCharCode(digitToBasic(Qe))),Ke=adapt(He,Ye,Xe===Ze),He=0,Xe++}}He++,Be++}return join$1(De,"")},stringPunycodeToAscii=function($e){var De=[],Fe=split$1(replace$3(toLowerCase$1($e),regexSeparators,"."),"."),Be,He;for(Be=0;Be<Fe.length;Be++)He=Fe[Be],push$2(De,exec$1(regexNonASCII,He)?"xn--"+encode(He):He);return join$1(De,".")},$$i=_export,DESCRIPTORS$1=descriptors,USE_NATIVE_URL$2=urlConstructorDetection,globalThis$9=globalThis_1,bind$4=functionBindContext,uncurryThis$1=functionUncurryThis,defineBuiltIn$4=defineBuiltIn$c,defineBuiltInAccessor$1=defineBuiltInAccessor$4,anInstance$1=anInstance$3,hasOwn$1=hasOwnProperty_1,assign=objectAssign,arrayFrom=arrayFrom$1,arraySlice$1=arraySlice$3,codeAt=stringMultibyte.codeAt,toASCII=stringPunycodeToAscii,$toString=toString$8,setToStringTag$2=setToStringTag$6,validateArgumentsLength$3=validateArgumentsLength$7,URLSearchParamsModule=web_urlSearchParams_constructor,InternalStateModule$1=internalState,setInternalState$1=InternalStateModule$1.set,getInternalURLState=InternalStateModule$1.getterFor("URL"),URLSearchParams$1=URLSearchParamsModule.URLSearchParams,getInternalSearchParamsState=URLSearchParamsModule.getState,NativeURL=globalThis$9.URL,TypeError$2=globalThis$9.TypeError,parseInt$1=globalThis$9.parseInt,floor=Math.floor,pow=Math.pow,charAt=uncurryThis$1("".charAt),exec=uncurryThis$1(/./.exec),join=uncurryThis$1([].join),numberToString=uncurryThis$1(1 .toString),pop=uncurryThis$1([].pop),push$1=uncurryThis$1([].push),replace$2=uncurryThis$1("".replace),shift=uncurryThis$1([].shift),split=uncurryThis$1("".split),stringSlice=uncurryThis$1("".slice),toLowerCase=uncurryThis$1("".toLowerCase),unshift=uncurryThis$1([].unshift),INVALID_AUTHORITY="Invalid authority",INVALID_SCHEME="Invalid scheme",INVALID_HOST="Invalid host",INVALID_PORT="Invalid port",ALPHA=/[a-z]/i,ALPHANUMERIC=/[\d+-.a-z]/i,DIGIT=/\d/,HEX_START=/^0x/i,OCT=/^[0-7]+$/,DEC=/^\d+$/,HEX=/^[\da-f]+$/i,FORBIDDEN_HOST_CODE_POINT=/[\0\t\n\r #%/:<>?@[\\\]^|]/,FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT=/[\0\t\n\r #/:<>?@[\\\]^|]/,LEADING_C0_CONTROL_OR_SPACE=/^[\u0000-\u0020]+/,TRAILING_C0_CONTROL_OR_SPACE=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,TAB_AND_NEW_LINE=/[\t\n\r]/g,EOF,parseIPv4=function($e){var De=split($e,"."),Fe,Be,He,Ke,Ge,We,Ze;if(De.length&&De[De.length-1]===""&&De.length--,Fe=De.length,Fe>4)return $e;for(Be=[],He=0;He<Fe;He++){if(Ke=De[He],Ke==="")return $e;if(Ge=10,Ke.length>1&&charAt(Ke,0)==="0"&&(Ge=exec(HEX_START,Ke)?16:8,Ke=stringSlice(Ke,Ge===8?1:2)),Ke==="")We=0;else{if(!exec(Ge===10?DEC:Ge===8?OCT:HEX,Ke))return $e;We=parseInt$1(Ke,Ge)}push$1(Be,We)}for(He=0;He<Fe;He++)if(We=Be[He],He===Fe-1){if(We>=pow(256,5-Fe))return null}else if(We>255)return null;for(Ze=pop(Be),He=0;He<Be.length;He++)Ze+=Be[He]*pow(256,3-He);return Ze},parseIPv6=function($e){var De=[0,0,0,0,0,0,0,0],Fe=0,Be=null,He=0,Ke,Ge,We,Ze,Xe,Je,Ye,Qe=function(){return charAt($e,He)};if(Qe()===":"){if(charAt($e,1)!==":")return;He+=2,Fe++,Be=Fe}for(;Qe();){if(Fe===8)return;if(Qe()===":"){if(Be!==null)return;He++,Fe++,Be=Fe;continue}for(Ke=Ge=0;Ge<4&&exec(HEX,Qe());)Ke=Ke*16+parseInt$1(Qe(),16),He++,Ge++;if(Qe()==="."){if(Ge===0||(He-=Ge,Fe>6))return;for(We=0;Qe();){if(Ze=null,We>0)if(Qe()==="."&&We<4)He++;else return;if(!exec(DIGIT,Qe()))return;for(;exec(DIGIT,Qe());){if(Xe=parseInt$1(Qe(),10),Ze===null)Ze=Xe;else{if(Ze===0)return;Ze=Ze*10+Xe}if(Ze>255)return;He++}De[Fe]=De[Fe]*256+Ze,We++,(We===2||We===4)&&Fe++}if(We!==4)return;break}else if(Qe()===":"){if(He++,!Qe())return}else if(Qe())return;De[Fe++]=Ke}if(Be!==null)for(Je=Fe-Be,Fe=7;Fe!==0&&Je>0;)Ye=De[Fe],De[Fe--]=De[Be+Je-1],De[Be+--Je]=Ye;else if(Fe!==8)return;return De},findLongestZeroSequence=function($e){for(var De=null,Fe=1,Be=null,He=0,Ke=0;Ke<8;Ke++)$e[Ke]!==0?(He>Fe&&(De=Be,Fe=He),Be=null,He=0):(Be===null&&(Be=Ke),++He);return He>Fe?Be:De},serializeHost=function($e){var De,Fe,Be,He;if(typeof $e=="number"){for(De=[],Fe=0;Fe<4;Fe++)unshift(De,$e%256),$e=floor($e/256);return join(De,".")}if(typeof $e=="object"){for(De="",Be=findLongestZeroSequence($e),Fe=0;Fe<8;Fe++)He&&$e[Fe]===0||(He&&(He=!1),Be===Fe?(De+=Fe?":":"::",He=!0):(De+=numberToString($e[Fe],16),Fe<7&&(De+=":")));return"["+De+"]"}return $e},C0ControlPercentEncodeSet={},fragmentPercentEncodeSet=assign({},C0ControlPercentEncodeSet,{" ":1,'"':1,"<":1,">":1,"`":1}),pathPercentEncodeSet=assign({},fragmentPercentEncodeSet,{"#":1,"?":1,"{":1,"}":1}),userinfoPercentEncodeSet=assign({},pathPercentEncodeSet,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),percentEncode=function($e,De){var Fe=codeAt($e,0);return Fe>32&&Fe<127&&!hasOwn$1(De,$e)?$e:encodeURIComponent($e)},specialSchemes={ftp:21,file:null,http:80,https:443,ws:80,wss:443},isWindowsDriveLetter=function($e,De){var Fe;return $e.length===2&&exec(ALPHA,charAt($e,0))&&((Fe=charAt($e,1))===":"||!De&&Fe==="|")},startsWithWindowsDriveLetter=function($e){var De;return $e.length>1&&isWindowsDriveLetter(stringSlice($e,0,2))&&($e.length===2||(De=charAt($e,2))==="/"||De==="\\"||De==="?"||De==="#")},isSingleDot=function($e){return $e==="."||toLowerCase($e)==="%2e"},isDoubleDot=function($e){return $e=toLowerCase($e),$e===".."||$e==="%2e."||$e===".%2e"||$e==="%2e%2e"},SCHEME_START={},SCHEME={},NO_SCHEME={},SPECIAL_RELATIVE_OR_AUTHORITY={},PATH_OR_AUTHORITY={},RELATIVE={},RELATIVE_SLASH={},SPECIAL_AUTHORITY_SLASHES={},SPECIAL_AUTHORITY_IGNORE_SLASHES={},AUTHORITY={},HOST={},HOSTNAME={},PORT={},FILE={},FILE_SLASH={},FILE_HOST={},PATH_START={},PATH={},CANNOT_BE_A_BASE_URL_PATH={},QUERY={},FRAGMENT={},URLState=function($e,De,Fe){var Be=$toString($e),He,Ke,Ge;if(De){if(Ke=this.parse(Be),Ke)throw new TypeError$2(Ke);this.searchParams=null}else{if(Fe!==void 0&&(He=new URLState(Fe,!0)),Ke=this.parse(Be,null,He),Ke)throw new TypeError$2(Ke);Ge=getInternalSearchParamsState(new URLSearchParams$1),Ge.bindURL(this),this.searchParams=Ge}};URLState.prototype={type:"URL",parse:function($e,De,Fe){var Be=this,He=De||SCHEME_START,Ke=0,Ge="",We=!1,Ze=!1,Xe=!1,Je,Ye,Qe,et;for($e=$toString($e),De||(Be.scheme="",Be.username="",Be.password="",Be.host=null,Be.port=null,Be.path=[],Be.query=null,Be.fragment=null,Be.cannotBeABaseURL=!1,$e=replace$2($e,LEADING_C0_CONTROL_OR_SPACE,""),$e=replace$2($e,TRAILING_C0_CONTROL_OR_SPACE,"$1")),$e=replace$2($e,TAB_AND_NEW_LINE,""),Je=arrayFrom($e);Ke<=Je.length;){switch(Ye=Je[Ke],He){case SCHEME_START:if(Ye&&exec(ALPHA,Ye))Ge+=toLowerCase(Ye),He=SCHEME;else{if(De)return INVALID_SCHEME;He=NO_SCHEME;continue}break;case SCHEME:if(Ye&&(exec(ALPHANUMERIC,Ye)||Ye==="+"||Ye==="-"||Ye==="."))Ge+=toLowerCase(Ye);else if(Ye===":"){if(De&&(Be.isSpecial()!==hasOwn$1(specialSchemes,Ge)||Ge==="file"&&(Be.includesCredentials()||Be.port!==null)||Be.scheme==="file"&&!Be.host))return;if(Be.scheme=Ge,De){Be.isSpecial()&&specialSchemes[Be.scheme]===Be.port&&(Be.port=null);return}Ge="",Be.scheme==="file"?He=FILE:Be.isSpecial()&&Fe&&Fe.scheme===Be.scheme?He=SPECIAL_RELATIVE_OR_AUTHORITY:Be.isSpecial()?He=SPECIAL_AUTHORITY_SLASHES:Je[Ke+1]==="/"?(He=PATH_OR_AUTHORITY,Ke++):(Be.cannotBeABaseURL=!0,push$1(Be.path,""),He=CANNOT_BE_A_BASE_URL_PATH)}else{if(De)return INVALID_SCHEME;Ge="",He=NO_SCHEME,Ke=0;continue}break;case NO_SCHEME:if(!Fe||Fe.cannotBeABaseURL&&Ye!=="#")return INVALID_SCHEME;if(Fe.cannotBeABaseURL&&Ye==="#"){Be.scheme=Fe.scheme,Be.path=arraySlice$1(Fe.path),Be.query=Fe.query,Be.fragment="",Be.cannotBeABaseURL=!0,He=FRAGMENT;break}He=Fe.scheme==="file"?FILE:RELATIVE;continue;case SPECIAL_RELATIVE_OR_AUTHORITY:if(Ye==="/"&&Je[Ke+1]==="/")He=SPECIAL_AUTHORITY_IGNORE_SLASHES,Ke++;else{He=RELATIVE;continue}break;case PATH_OR_AUTHORITY:if(Ye==="/"){He=AUTHORITY;break}else{He=PATH;continue}case RELATIVE:if(Be.scheme=Fe.scheme,Ye===EOF)Be.username=Fe.username,Be.password=Fe.password,Be.host=Fe.host,Be.port=Fe.port,Be.path=arraySlice$1(Fe.path),Be.query=Fe.query;else if(Ye==="/"||Ye==="\\"&&Be.isSpecial())He=RELATIVE_SLASH;else if(Ye==="?")Be.username=Fe.username,Be.password=Fe.password,Be.host=Fe.host,Be.port=Fe.port,Be.path=arraySlice$1(Fe.path),Be.query="",He=QUERY;else if(Ye==="#")Be.username=Fe.username,Be.password=Fe.password,Be.host=Fe.host,Be.port=Fe.port,Be.path=arraySlice$1(Fe.path),Be.query=Fe.query,Be.fragment="",He=FRAGMENT;else{Be.username=Fe.username,Be.password=Fe.password,Be.host=Fe.host,Be.port=Fe.port,Be.path=arraySlice$1(Fe.path),Be.path.length--,He=PATH;continue}break;case RELATIVE_SLASH:if(Be.isSpecial()&&(Ye==="/"||Ye==="\\"))He=SPECIAL_AUTHORITY_IGNORE_SLASHES;else if(Ye==="/")He=AUTHORITY;else{Be.username=Fe.username,Be.password=Fe.password,Be.host=Fe.host,Be.port=Fe.port,He=PATH;continue}break;case SPECIAL_AUTHORITY_SLASHES:if(He=SPECIAL_AUTHORITY_IGNORE_SLASHES,Ye!=="/"||charAt(Ge,Ke+1)!=="/")continue;Ke++;break;case SPECIAL_AUTHORITY_IGNORE_SLASHES:if(Ye!=="/"&&Ye!=="\\"){He=AUTHORITY;continue}break;case AUTHORITY:if(Ye==="@"){We&&(Ge="%40"+Ge),We=!0,Qe=arrayFrom(Ge);for(var tt=0;tt<Qe.length;tt++){var ct=Qe[tt];if(ct===":"&&!Xe){Xe=!0;continue}var at=percentEncode(ct,userinfoPercentEncodeSet);Xe?Be.password+=at:Be.username+=at}Ge=""}else if(Ye===EOF||Ye==="/"||Ye==="?"||Ye==="#"||Ye==="\\"&&Be.isSpecial()){if(We&&Ge==="")return INVALID_AUTHORITY;Ke-=arrayFrom(Ge).length+1,Ge="",He=HOST}else Ge+=Ye;break;case HOST:case HOSTNAME:if(De&&Be.scheme==="file"){He=FILE_HOST;continue}else if(Ye===":"&&!Ze){if(Ge==="")return INVALID_HOST;if(et=Be.parseHost(Ge),et)return et;if(Ge="",He=PORT,De===HOSTNAME)return}else if(Ye===EOF||Ye==="/"||Ye==="?"||Ye==="#"||Ye==="\\"&&Be.isSpecial()){if(Be.isSpecial()&&Ge==="")return INVALID_HOST;if(De&&Ge===""&&(Be.includesCredentials()||Be.port!==null))return;if(et=Be.parseHost(Ge),et)return et;if(Ge="",He=PATH_START,De)return;continue}else Ye==="["?Ze=!0:Ye==="]"&&(Ze=!1),Ge+=Ye;break;case PORT:if(exec(DIGIT,Ye))Ge+=Ye;else if(Ye===EOF||Ye==="/"||Ye==="?"||Ye==="#"||Ye==="\\"&&Be.isSpecial()||De){if(Ge!==""){var ft=parseInt$1(Ge,10);if(ft>65535)return INVALID_PORT;Be.port=Be.isSpecial()&&ft===specialSchemes[Be.scheme]?null:ft,Ge=""}if(De)return;He=PATH_START;continue}else return INVALID_PORT;break;case FILE:if(Be.scheme="file",Ye==="/"||Ye==="\\")He=FILE_SLASH;else if(Fe&&Fe.scheme==="file")switch(Ye){case EOF:Be.host=Fe.host,Be.path=arraySlice$1(Fe.path),Be.query=Fe.query;break;case"?":Be.host=Fe.host,Be.path=arraySlice$1(Fe.path),Be.query="",He=QUERY;break;case"#":Be.host=Fe.host,Be.path=arraySlice$1(Fe.path),Be.query=Fe.query,Be.fragment="",He=FRAGMENT;break;default:startsWithWindowsDriveLetter(join(arraySlice$1(Je,Ke),""))||(Be.host=Fe.host,Be.path=arraySlice$1(Fe.path),Be.shortenPath()),He=PATH;continue}else{He=PATH;continue}break;case FILE_SLASH:if(Ye==="/"||Ye==="\\"){He=FILE_HOST;break}Fe&&Fe.scheme==="file"&&!startsWithWindowsDriveLetter(join(arraySlice$1(Je,Ke),""))&&(isWindowsDriveLetter(Fe.path[0],!0)?push$1(Be.path,Fe.path[0]):Be.host=Fe.host),He=PATH;continue;case FILE_HOST:if(Ye===EOF||Ye==="/"||Ye==="\\"||Ye==="?"||Ye==="#"){if(!De&&isWindowsDriveLetter(Ge))He=PATH;else if(Ge===""){if(Be.host="",De)return;He=PATH_START}else{if(et=Be.parseHost(Ge),et)return et;if(Be.host==="localhost"&&(Be.host=""),De)return;Ge="",He=PATH_START}continue}else Ge+=Ye;break;case PATH_START:if(Be.isSpecial()){if(He=PATH,Ye!=="/"&&Ye!=="\\")continue}else if(!De&&Ye==="?")Be.query="",He=QUERY;else if(!De&&Ye==="#")Be.fragment="",He=FRAGMENT;else if(Ye!==EOF&&(He=PATH,Ye!=="/"))continue;break;case PATH:if(Ye===EOF||Ye==="/"||Ye==="\\"&&Be.isSpecial()||!De&&(Ye==="?"||Ye==="#")){if(isDoubleDot(Ge)?(Be.shortenPath(),Ye!=="/"&&!(Ye==="\\"&&Be.isSpecial())&&push$1(Be.path,"")):isSingleDot(Ge)?Ye!=="/"&&!(Ye==="\\"&&Be.isSpecial())&&push$1(Be.path,""):(Be.scheme==="file"&&!Be.path.length&&isWindowsDriveLetter(Ge)&&(Be.host&&(Be.host=""),Ge=charAt(Ge,0)+":"),push$1(Be.path,Ge)),Ge="",Be.scheme==="file"&&(Ye===EOF||Ye==="?"||Ye==="#"))for(;Be.path.length>1&&Be.path[0]==="";)shift(Be.path);Ye==="?"?(Be.query="",He=QUERY):Ye==="#"&&(Be.fragment="",He=FRAGMENT)}else Ge+=percentEncode(Ye,pathPercentEncodeSet);break;case CANNOT_BE_A_BASE_URL_PATH:Ye==="?"?(Be.query="",He=QUERY):Ye==="#"?(Be.fragment="",He=FRAGMENT):Ye!==EOF&&(Be.path[0]+=percentEncode(Ye,C0ControlPercentEncodeSet));break;case QUERY:!De&&Ye==="#"?(Be.fragment="",He=FRAGMENT):Ye!==EOF&&(Ye==="'"&&Be.isSpecial()?Be.query+="%27":Ye==="#"?Be.query+="%23":Be.query+=percentEncode(Ye,C0ControlPercentEncodeSet));break;case FRAGMENT:Ye!==EOF&&(Be.fragment+=percentEncode(Ye,fragmentPercentEncodeSet));break}Ke++}},parseHost:function($e){var De,Fe,Be;if(charAt($e,0)==="["){if(charAt($e,$e.length-1)!=="]"||(De=parseIPv6(stringSlice($e,1,-1)),!De))return INVALID_HOST;this.host=De}else if(this.isSpecial()){if($e=toASCII($e),exec(FORBIDDEN_HOST_CODE_POINT,$e)||(De=parseIPv4($e),De===null))return INVALID_HOST;this.host=De}else{if(exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT,$e))return INVALID_HOST;for(De="",Fe=arrayFrom($e),Be=0;Be<Fe.length;Be++)De+=percentEncode(Fe[Be],C0ControlPercentEncodeSet);this.host=De}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return hasOwn$1(specialSchemes,this.scheme)},shortenPath:function(){var $e=this.path,De=$e.length;De&&(this.scheme!=="file"||De!==1||!isWindowsDriveLetter($e[0],!0))&&$e.length--},serialize:function(){var $e=this,De=$e.scheme,Fe=$e.username,Be=$e.password,He=$e.host,Ke=$e.port,Ge=$e.path,We=$e.query,Ze=$e.fragment,Xe=De+":";return He!==null?(Xe+="//",$e.includesCredentials()&&(Xe+=Fe+(Be?":"+Be:"")+"@"),Xe+=serializeHost(He),Ke!==null&&(Xe+=":"+Ke)):De==="file"&&(Xe+="//"),Xe+=$e.cannotBeABaseURL?Ge[0]:Ge.length?"/"+join(Ge,"/"):"",We!==null&&(Xe+="?"+We),Ze!==null&&(Xe+="#"+Ze),Xe},setHref:function($e){var De=this.parse($e);if(De)throw new TypeError$2(De);this.searchParams.update()},getOrigin:function(){var $e=this.scheme,De=this.port;if($e==="blob")try{return new URLConstructor($e.path[0]).origin}catch{return"null"}return $e==="file"||!this.isSpecial()?"null":$e+"://"+serializeHost(this.host)+(De!==null?":"+De:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function($e){this.parse($toString($e)+":",SCHEME_START)},getUsername:function(){return this.username},setUsername:function($e){var De=arrayFrom($toString($e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var Fe=0;Fe<De.length;Fe++)this.username+=percentEncode(De[Fe],userinfoPercentEncodeSet)}},getPassword:function(){return this.password},setPassword:function($e){var De=arrayFrom($toString($e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var Fe=0;Fe<De.length;Fe++)this.password+=percentEncode(De[Fe],userinfoPercentEncodeSet)}},getHost:function(){var $e=this.host,De=this.port;return $e===null?"":De===null?serializeHost($e):serializeHost($e)+":"+De},setHost:function($e){this.cannotBeABaseURL||this.parse($e,HOST)},getHostname:function(){var $e=this.host;return $e===null?"":serializeHost($e)},setHostname:function($e){this.cannotBeABaseURL||this.parse($e,HOSTNAME)},getPort:function(){var $e=this.port;return $e===null?"":$toString($e)},setPort:function($e){this.cannotHaveUsernamePasswordPort()||($e=$toString($e),$e===""?this.port=null:this.parse($e,PORT))},getPathname:function(){var $e=this.path;return this.cannotBeABaseURL?$e[0]:$e.length?"/"+join($e,"/"):""},setPathname:function($e){this.cannotBeABaseURL||(this.path=[],this.parse($e,PATH_START))},getSearch:function(){var $e=this.query;return $e?"?"+$e:""},setSearch:function($e){$e=$toString($e),$e===""?this.query=null:(charAt($e,0)==="?"&&($e=stringSlice($e,1)),this.query="",this.parse($e,QUERY)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var $e=this.fragment;return $e?"#"+$e:""},setHash:function($e){if($e=$toString($e),$e===""){this.fragment=null;return}charAt($e,0)==="#"&&($e=stringSlice($e,1)),this.fragment="",this.parse($e,FRAGMENT)},update:function(){this.query=this.searchParams.serialize()||null}};var URLConstructor=function(De){var Fe=anInstance$1(this,URLPrototype),Be=validateArgumentsLength$3(arguments.length,1)>1?arguments[1]:void 0,He=setInternalState$1(Fe,new URLState(De,!1,Be));DESCRIPTORS$1||(Fe.href=He.serialize(),Fe.origin=He.getOrigin(),Fe.protocol=He.getProtocol(),Fe.username=He.getUsername(),Fe.password=He.getPassword(),Fe.host=He.getHost(),Fe.hostname=He.getHostname(),Fe.port=He.getPort(),Fe.pathname=He.getPathname(),Fe.search=He.getSearch(),Fe.searchParams=He.getSearchParams(),Fe.hash=He.getHash())},URLPrototype=URLConstructor.prototype,accessorDescriptor=function($e,De){return{get:function(){return getInternalURLState(this)[$e]()},set:De&&function(Fe){return getInternalURLState(this)[De](Fe)},configurable:!0,enumerable:!0}};DESCRIPTORS$1&&(defineBuiltInAccessor$1(URLPrototype,"href",accessorDescriptor("serialize","setHref")),defineBuiltInAccessor$1(URLPrototype,"origin",accessorDescriptor("getOrigin")),defineBuiltInAccessor$1(URLPrototype,"protocol",accessorDescriptor("getProtocol","setProtocol")),defineBuiltInAccessor$1(URLPrototype,"username",accessorDescriptor("getUsername","setUsername")),defineBuiltInAccessor$1(URLPrototype,"password",accessorDescriptor("getPassword","setPassword")),defineBuiltInAccessor$1(URLPrototype,"host",accessorDescriptor("getHost","setHost")),defineBuiltInAccessor$1(URLPrototype,"hostname",accessorDescriptor("getHostname","setHostname")),defineBuiltInAccessor$1(URLPrototype,"port",accessorDescriptor("getPort","setPort")),defineBuiltInAccessor$1(URLPrototype,"pathname",accessorDescriptor("getPathname","setPathname")),defineBuiltInAccessor$1(URLPrototype,"search",accessorDescriptor("getSearch","setSearch")),defineBuiltInAccessor$1(URLPrototype,"searchParams",accessorDescriptor("getSearchParams")),defineBuiltInAccessor$1(URLPrototype,"hash",accessorDescriptor("getHash","setHash")));defineBuiltIn$4(URLPrototype,"toJSON",function(){return getInternalURLState(this).serialize()},{enumerable:!0});defineBuiltIn$4(URLPrototype,"toString",function(){return getInternalURLState(this).serialize()},{enumerable:!0});if(NativeURL){var nativeCreateObjectURL=NativeURL.createObjectURL,nativeRevokeObjectURL=NativeURL.revokeObjectURL;nativeCreateObjectURL&&defineBuiltIn$4(URLConstructor,"createObjectURL",bind$4(nativeCreateObjectURL,NativeURL)),nativeRevokeObjectURL&&defineBuiltIn$4(URLConstructor,"revokeObjectURL",bind$4(nativeRevokeObjectURL,NativeURL))}setToStringTag$2(URLConstructor,"URL");$$i({global:!0,constructor:!0,forced:!USE_NATIVE_URL$2,sham:!DESCRIPTORS$1},{URL:URLConstructor});var $$h=_export,getBuiltIn$6=getBuiltIn$c,fails$3=fails$h,validateArgumentsLength$2=validateArgumentsLength$7,toString$3=toString$8,USE_NATIVE_URL$1=urlConstructorDetection,URL$2=getBuiltIn$6("URL"),THROWS_WITHOUT_ARGUMENTS=USE_NATIVE_URL$1&&fails$3(function(){URL$2.canParse()}),WRONG_ARITY=fails$3(function(){return URL$2.canParse.length!==1});$$h({target:"URL",stat:!0,forced:!THROWS_WITHOUT_ARGUMENTS||WRONG_ARITY},{canParse:function(De){var Fe=validateArgumentsLength$2(arguments.length,1),Be=toString$3(De),He=Fe<2||arguments[1]===void 0?void 0:toString$3(arguments[1]);try{return!!new URL$2(Be,He)}catch{return!1}}});var $$g=_export,getBuiltIn$5=getBuiltIn$c,validateArgumentsLength$1=validateArgumentsLength$7,toString$2=toString$8,USE_NATIVE_URL=urlConstructorDetection,URL$1=getBuiltIn$5("URL");$$g({target:"URL",stat:!0,forced:!USE_NATIVE_URL},{parse:function(De){var Fe=validateArgumentsLength$1(arguments.length,1),Be=toString$2(De),He=Fe<2||arguments[1]===void 0?void 0:toString$2(arguments[1]);try{return new URL$1(Be,He)}catch{return null}}});var $$f=_export,call$7=functionCall;$$f({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return call$7(URL.prototype.toString,this)}});var path$1=path$3;path$1.URL;var domIterables={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},documentCreateElement=documentCreateElement$2,classList=documentCreateElement("span").classList,DOMTokenListPrototype$1=classList&&classList.constructor&&classList.constructor.prototype,domTokenListPrototype=DOMTokenListPrototype$1===Object.prototype?void 0:DOMTokenListPrototype$1,globalThis$8=globalThis_1,DOMIterables=domIterables,DOMTokenListPrototype=domTokenListPrototype,ArrayIteratorMethods=es_array_iterator,createNonEnumerableProperty$3=createNonEnumerableProperty$7,setToStringTag$1=setToStringTag$6,wellKnownSymbol$5=wellKnownSymbol$h,ITERATOR$1=wellKnownSymbol$5("iterator"),ArrayValues=ArrayIteratorMethods.values,handlePrototype=function($e,De){if($e){if($e[ITERATOR$1]!==ArrayValues)try{createNonEnumerableProperty$3($e,ITERATOR$1,ArrayValues)}catch{$e[ITERATOR$1]=ArrayValues}if(setToStringTag$1($e,De,!0),DOMIterables[De]){for(var Fe in ArrayIteratorMethods)if($e[Fe]!==ArrayIteratorMethods[Fe])try{createNonEnumerableProperty$3($e,Fe,ArrayIteratorMethods[Fe])}catch{$e[Fe]=ArrayIteratorMethods[Fe]}}}};for(var COLLECTION_NAME in DOMIterables)handlePrototype(globalThis$8[COLLECTION_NAME]&&globalThis$8[COLLECTION_NAME].prototype,COLLECTION_NAME);handlePrototype(DOMTokenListPrototype,"DOMTokenList");var isObject$2=isObject$c,createNonEnumerableProperty$2=createNonEnumerableProperty$7,installErrorCause$1=function($e,De){isObject$2(De)&&"cause"in De&&createNonEnumerableProperty$2($e,"cause",De.cause)},uncurryThis=functionUncurryThis,$Error$1=Error,replace$1=uncurryThis("".replace),TEST=function($e){return String(new $Error$1($e).stack)}("zxcasd"),V8_OR_CHAKRA_STACK_ENTRY=/\n\s*at [^:]*:[^\n]*/,IS_V8_OR_CHAKRA_STACK=V8_OR_CHAKRA_STACK_ENTRY.test(TEST),errorStackClear=function($e,De){if(IS_V8_OR_CHAKRA_STACK&&typeof $e=="string"&&!$Error$1.prepareStackTrace)for(;De--;)$e=replace$1($e,V8_OR_CHAKRA_STACK_ENTRY,"");return $e},fails$2=fails$h,createPropertyDescriptor$1=createPropertyDescriptor$7,errorStackInstallable=!fails$2(function(){var $e=new Error("a");return"stack"in $e?(Object.defineProperty($e,"stack",createPropertyDescriptor$1(1,7)),$e.stack!==7):!0}),createNonEnumerableProperty$1=createNonEnumerableProperty$7,clearErrorStack=errorStackClear,ERROR_STACK_INSTALLABLE=errorStackInstallable,captureStackTrace=Error.captureStackTrace,errorStackInstall=function($e,De,Fe,Be){ERROR_STACK_INSTALLABLE&&(captureStackTrace?captureStackTrace($e,De):createNonEnumerableProperty$1($e,"stack",clearErrorStack(Fe,Be)))},bind$3=functionBindContext,call$6=functionCall,anObject$2=anObject$b,tryToString$1=tryToString$4,isArrayIteratorMethod=isArrayIteratorMethod$2,lengthOfArrayLike=lengthOfArrayLike$3,isPrototypeOf$1=objectIsPrototypeOf,getIterator=getIterator$3,getIteratorMethod=getIteratorMethod$4,iteratorClose=iteratorClose$2,$TypeError$2=TypeError,Result=function($e,De){this.stopped=$e,this.result=De},ResultPrototype=Result.prototype,iterate$5=function($e,De,Fe){var Be=Fe&&Fe.that,He=!!(Fe&&Fe.AS_ENTRIES),Ke=!!(Fe&&Fe.IS_RECORD),Ge=!!(Fe&&Fe.IS_ITERATOR),We=!!(Fe&&Fe.INTERRUPTED),Ze=bind$3(De,Be),Xe,Je,Ye,Qe,et,tt,ct,at=function(ut){return Xe&&iteratorClose(Xe,"normal",ut),new Result(!0,ut)},ft=function(ut){return He?(anObject$2(ut),We?Ze(ut[0],ut[1],at):Ze(ut[0],ut[1])):We?Ze(ut,at):Ze(ut)};if(Ke)Xe=$e.iterator;else if(Ge)Xe=$e;else{if(Je=getIteratorMethod($e),!Je)throw new $TypeError$2(tryToString$1($e)+" is not iterable");if(isArrayIteratorMethod(Je)){for(Ye=0,Qe=lengthOfArrayLike($e);Qe>Ye;Ye++)if(et=ft($e[Ye]),et&&isPrototypeOf$1(ResultPrototype,et))return et;return new Result(!1)}Xe=getIterator($e,Je)}for(tt=Ke?$e.next:Xe.next;!(ct=call$6(tt,Xe)).done;){try{et=ft(ct.value)}catch(ut){iteratorClose(Xe,"throw",ut)}if(typeof et=="object"&&et&&isPrototypeOf$1(ResultPrototype,et))return et}return new Result(!1)},toString$1=toString$8,normalizeStringArgument$1=function($e,De){return $e===void 0?arguments.length<2?"":De:toString$1($e)},$$e=_export,isPrototypeOf=objectIsPrototypeOf,getPrototypeOf=objectGetPrototypeOf,setPrototypeOf$1=objectSetPrototypeOf,copyConstructorProperties=copyConstructorProperties$2,create=objectCreate,createNonEnumerableProperty=createNonEnumerableProperty$7,createPropertyDescriptor=createPropertyDescriptor$7,installErrorCause=installErrorCause$1,installErrorStack=errorStackInstall,iterate$4=iterate$5,normalizeStringArgument=normalizeStringArgument$1,wellKnownSymbol$4=wellKnownSymbol$h,TO_STRING_TAG=wellKnownSymbol$4("toStringTag"),$Error=Error,push=[].push,$AggregateError=function(De,Fe){var Be=isPrototypeOf(AggregateErrorPrototype,this),He;setPrototypeOf$1?He=setPrototypeOf$1(new $Error,Be?getPrototypeOf(this):AggregateErrorPrototype):(He=Be?this:create(AggregateErrorPrototype),createNonEnumerableProperty(He,TO_STRING_TAG,"Error")),Fe!==void 0&&createNonEnumerableProperty(He,"message",normalizeStringArgument(Fe)),installErrorStack(He,$AggregateError,He.stack,1),arguments.length>2&&installErrorCause(He,arguments[2]);var Ke=[];return iterate$4(De,push,{that:Ke}),createNonEnumerableProperty(He,"errors",Ke),He};setPrototypeOf$1?setPrototypeOf$1($AggregateError,$Error):copyConstructorProperties($AggregateError,$Error,{name:!0});var AggregateErrorPrototype=$AggregateError.prototype=create($Error.prototype,{constructor:createPropertyDescriptor(1,$AggregateError),message:createPropertyDescriptor(1,""),name:createPropertyDescriptor(1,"AggregateError")});$$e({global:!0,constructor:!0,arity:2},{AggregateError:$AggregateError});var TO_STRING_TAG_SUPPORT$1=toStringTagSupport,classof$1=classof$6,objectToString=TO_STRING_TAG_SUPPORT$1?{}.toString:function(){return"[object "+classof$1(this)+"]"},TO_STRING_TAG_SUPPORT=toStringTagSupport,defineBuiltIn$3=defineBuiltIn$c,toString=objectToString;TO_STRING_TAG_SUPPORT||defineBuiltIn$3(Object.prototype,"toString",toString,{unsafe:!0});var globalThis$7=globalThis_1,userAgent$3=environmentUserAgent,classof=classofRaw$2,userAgentStartsWith=function($e){return userAgent$3.slice(0,$e.length)===$e},environment=function(){return userAgentStartsWith("Bun/")?"BUN":userAgentStartsWith("Cloudflare-Workers")?"CLOUDFLARE":userAgentStartsWith("Deno/")?"DENO":userAgentStartsWith("Node.js/")?"NODE":globalThis$7.Bun&&typeof Bun.version=="string"?"BUN":globalThis$7.Deno&&typeof Deno.version=="object"?"DENO":classof(globalThis$7.process)==="process"?"NODE":globalThis$7.window&&globalThis$7.document?"BROWSER":"REST"}(),ENVIRONMENT$1=environment,environmentIsNode=ENVIRONMENT$1==="NODE",getBuiltIn$4=getBuiltIn$c,defineBuiltInAccessor=defineBuiltInAccessor$4,wellKnownSymbol$3=wellKnownSymbol$h,DESCRIPTORS=descriptors,SPECIES$2=wellKnownSymbol$3("species"),setSpecies$1=function($e){var De=getBuiltIn$4($e);DESCRIPTORS&&De&&!De[SPECIES$2]&&defineBuiltInAccessor(De,SPECIES$2,{configurable:!0,get:function(){return this}})},isConstructor=isConstructor$2,tryToString=tryToString$4,$TypeError$1=TypeError,aConstructor$1=function($e){if(isConstructor($e))return $e;throw new $TypeError$1(tryToString($e)+" is not a constructor")},anObject$1=anObject$b,aConstructor=aConstructor$1,isNullOrUndefined=isNullOrUndefined$4,wellKnownSymbol$2=wellKnownSymbol$h,SPECIES$1=wellKnownSymbol$2("species"),speciesConstructor$2=function($e,De){var Fe=anObject$1($e).constructor,Be;return Fe===void 0||isNullOrUndefined(Be=anObject$1(Fe)[SPECIES$1])?De:aConstructor(Be)},NATIVE_BIND=functionBindNative,FunctionPrototype=Function.prototype,apply$2=FunctionPrototype.apply,call$5=FunctionPrototype.call,functionApply=typeof Reflect=="object"&&Reflect.apply||(NATIVE_BIND?call$5.bind(apply$2):function(){return call$5.apply(apply$2,arguments)}),userAgent$2=environmentUserAgent,environmentIsIos=/(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2),globalThis$6=globalThis_1,apply$1=functionApply,bind$2=functionBindContext,isCallable$4=isCallable$l,hasOwn=hasOwnProperty_1,fails$1=fails$h,html=html$2,arraySlice=arraySlice$3,createElement=documentCreateElement$2,validateArgumentsLength=validateArgumentsLength$7,IS_IOS$1=environmentIsIos,IS_NODE$2=environmentIsNode,set=globalThis$6.setImmediate,clear=globalThis$6.clearImmediate,process$3=globalThis$6.process,Dispatch=globalThis$6.Dispatch,Function$1=globalThis$6.Function,MessageChannel$1=globalThis$6.MessageChannel,String$1=globalThis$6.String,counter=0,queue$3={},ONREADYSTATECHANGE="onreadystatechange",$location,defer,channel,port;fails$1(function(){$location=globalThis$6.location});var run=function($e){if(hasOwn(queue$3,$e)){var De=queue$3[$e];delete queue$3[$e],De()}},runner=function($e){return function(){run($e)}},eventListener=function($e){run($e.data)},globalPostMessageDefer=function($e){globalThis$6.postMessage(String$1($e),$location.protocol+"//"+$location.host)};(!set||!clear)&&(set=function(De){validateArgumentsLength(arguments.length,1);var Fe=isCallable$4(De)?De:Function$1(De),Be=arraySlice(arguments,1);return queue$3[++counter]=function(){apply$1(Fe,void 0,Be)},defer(counter),counter},clear=function(De){delete queue$3[De]},IS_NODE$2?defer=function($e){process$3.nextTick(runner($e))}:Dispatch&&Dispatch.now?defer=function($e){Dispatch.now(runner($e))}:MessageChannel$1&&!IS_IOS$1?(channel=new MessageChannel$1,port=channel.port2,channel.port1.onmessage=eventListener,defer=bind$2(port.postMessage,port)):globalThis$6.addEventListener&&isCallable$4(globalThis$6.postMessage)&&!globalThis$6.importScripts&&$location&&$location.protocol!=="file:"&&!fails$1(globalPostMessageDefer)?(defer=globalPostMessageDefer,globalThis$6.addEventListener("message",eventListener,!1)):ONREADYSTATECHANGE in createElement("script")?defer=function($e){html.appendChild(createElement("script"))[ONREADYSTATECHANGE]=function(){html.removeChild(this),run($e)}}:defer=function($e){setTimeout(runner($e),0)});var task$1={set,clear},Queue$2=function(){this.head=null,this.tail=null};Queue$2.prototype={add:function($e){var De={item:$e,next:null},Fe=this.tail;Fe?Fe.next=De:this.head=De,this.tail=De},get:function(){var $e=this.head;if($e){var De=this.head=$e.next;return De===null&&(this.tail=null),$e.item}}};var queue$2=Queue$2,userAgent$1=environmentUserAgent,environmentIsIosPebble=/ipad|iphone|ipod/i.test(userAgent$1)&&typeof Pebble<"u",userAgent=environmentUserAgent,environmentIsWebosWebkit=/web0s(?!.*chrome)/i.test(userAgent),globalThis$5=globalThis_1,safeGetBuiltIn=safeGetBuiltIn$2,bind$1=functionBindContext,macrotask=task$1.set,Queue$1=queue$2,IS_IOS=environmentIsIos,IS_IOS_PEBBLE=environmentIsIosPebble,IS_WEBOS_WEBKIT=environmentIsWebosWebkit,IS_NODE$1=environmentIsNode,MutationObserver=globalThis$5.MutationObserver||globalThis$5.WebKitMutationObserver,document$2=globalThis$5.document,process$2=globalThis$5.process,Promise$2=globalThis$5.Promise,microtask$1=safeGetBuiltIn("queueMicrotask"),notify$1,toggle,node,promise,then;if(!microtask$1){var queue$1=new Queue$1,flush=function(){var $e,De;for(IS_NODE$1&&($e=process$2.domain)&&$e.exit();De=queue$1.get();)try{De()}catch(Fe){throw queue$1.head&&notify$1(),Fe}$e&&$e.enter()};!IS_IOS&&!IS_NODE$1&&!IS_WEBOS_WEBKIT&&MutationObserver&&document$2?(toggle=!0,node=document$2.createTextNode(""),new MutationObserver(flush).observe(node,{characterData:!0}),notify$1=function(){node.data=toggle=!toggle}):!IS_IOS_PEBBLE&&Promise$2&&Promise$2.resolve?(promise=Promise$2.resolve(void 0),promise.constructor=Promise$2,then=bind$1(promise.then,promise),notify$1=function(){then(flush)}):IS_NODE$1?notify$1=function(){process$2.nextTick(flush)}:(macrotask=bind$1(macrotask,globalThis$5),notify$1=function(){macrotask(flush)}),microtask$1=function($e){queue$1.head||notify$1(),queue$1.add($e)}}var microtask_1=microtask$1,hostReportErrors$1=function($e,De){try{arguments.length===1?console.error($e):console.error($e,De)}catch{}},perform$6=function($e){try{return{error:!1,value:$e()}}catch(De){return{error:!0,value:De}}},globalThis$4=globalThis_1,promiseNativeConstructor=globalThis$4.Promise,globalThis$3=globalThis_1,NativePromiseConstructor$4=promiseNativeConstructor,isCallable$3=isCallable$l,isForced=isForced_1,inspectSource=inspectSource$3,wellKnownSymbol$1=wellKnownSymbol$h,ENVIRONMENT=environment,V8_VERSION=environmentV8Version;NativePromiseConstructor$4&&NativePromiseConstructor$4.prototype;var SPECIES=wellKnownSymbol$1("species"),SUBCLASSING=!1,NATIVE_PROMISE_REJECTION_EVENT$1=isCallable$3(globalThis$3.PromiseRejectionEvent),FORCED_PROMISE_CONSTRUCTOR$5=isForced("Promise",function(){var $e=inspectSource(NativePromiseConstructor$4),De=$e!==String(NativePromiseConstructor$4);if(!De&&V8_VERSION===66)return!0;if(!V8_VERSION||V8_VERSION<51||!/native code/.test($e)){var Fe=new NativePromiseConstructor$4(function(Ke){Ke(1)}),Be=function(Ke){Ke(function(){},function(){})},He=Fe.constructor={};if(He[SPECIES]=Be,SUBCLASSING=Fe.then(function(){})instanceof Be,!SUBCLASSING)return!0}return!De&&(ENVIRONMENT==="BROWSER"||ENVIRONMENT==="DENO")&&!NATIVE_PROMISE_REJECTION_EVENT$1}),promiseConstructorDetection={CONSTRUCTOR:FORCED_PROMISE_CONSTRUCTOR$5,REJECTION_EVENT:NATIVE_PROMISE_REJECTION_EVENT$1,SUBCLASSING},newPromiseCapability$2={},aCallable$6=aCallable$b,$TypeError=TypeError,PromiseCapability=function($e){var De,Fe;this.promise=new $e(function(Be,He){if(De!==void 0||Fe!==void 0)throw new $TypeError("Bad Promise constructor");De=Be,Fe=He}),this.resolve=aCallable$6(De),this.reject=aCallable$6(Fe)};newPromiseCapability$2.f=function($e){return new PromiseCapability($e)};var $$d=_export,IS_NODE=environmentIsNode,globalThis$2=globalThis_1,call$4=functionCall,defineBuiltIn$2=defineBuiltIn$c,setPrototypeOf=objectSetPrototypeOf,setToStringTag=setToStringTag$6,setSpecies=setSpecies$1,aCallable$5=aCallable$b,isCallable$2=isCallable$l,isObject$1=isObject$c,anInstance=anInstance$3,speciesConstructor$1=speciesConstructor$2,task=task$1.set,microtask=microtask_1,hostReportErrors=hostReportErrors$1,perform$5=perform$6,Queue=queue$2,InternalStateModule=internalState,NativePromiseConstructor$3=promiseNativeConstructor,PromiseConstructorDetection=promiseConstructorDetection,newPromiseCapabilityModule$7=newPromiseCapability$2,PROMISE="Promise",FORCED_PROMISE_CONSTRUCTOR$4=PromiseConstructorDetection.CONSTRUCTOR,NATIVE_PROMISE_REJECTION_EVENT=PromiseConstructorDetection.REJECTION_EVENT,NATIVE_PROMISE_SUBCLASSING=PromiseConstructorDetection.SUBCLASSING,getInternalPromiseState=InternalStateModule.getterFor(PROMISE),setInternalState=InternalStateModule.set,NativePromisePrototype$2=NativePromiseConstructor$3&&NativePromiseConstructor$3.prototype,PromiseConstructor=NativePromiseConstructor$3,PromisePrototype=NativePromisePrototype$2,TypeError$1=globalThis$2.TypeError,document$1=globalThis$2.document,process$1=globalThis$2.process,newPromiseCapability$1=newPromiseCapabilityModule$7.f,newGenericPromiseCapability=newPromiseCapability$1,DISPATCH_EVENT=!!(document$1&&document$1.createEvent&&globalThis$2.dispatchEvent),UNHANDLED_REJECTION="unhandledrejection",REJECTION_HANDLED="rejectionhandled",PENDING=0,FULFILLED=1,REJECTED=2,HANDLED=1,UNHANDLED=2,Internal,OwnPromiseCapability,PromiseWrapper,nativeThen,isThenable=function($e){var De;return isObject$1($e)&&isCallable$2(De=$e.then)?De:!1},callReaction=function($e,De){var Fe=De.value,Be=De.state===FULFILLED,He=Be?$e.ok:$e.fail,Ke=$e.resolve,Ge=$e.reject,We=$e.domain,Ze,Xe,Je;try{He?(Be||(De.rejection===UNHANDLED&&onHandleUnhandled(De),De.rejection=HANDLED),He===!0?Ze=Fe:(We&&We.enter(),Ze=He(Fe),We&&(We.exit(),Je=!0)),Ze===$e.promise?Ge(new TypeError$1("Promise-chain cycle")):(Xe=isThenable(Ze))?call$4(Xe,Ze,Ke,Ge):Ke(Ze)):Ge(Fe)}catch(Ye){We&&!Je&&We.exit(),Ge(Ye)}},notify=function($e,De){$e.notified||($e.notified=!0,microtask(function(){for(var Fe=$e.reactions,Be;Be=Fe.get();)callReaction(Be,$e);$e.notified=!1,De&&!$e.rejection&&onUnhandled($e)}))},dispatchEvent$1=function($e,De,Fe){var Be,He;DISPATCH_EVENT?(Be=document$1.createEvent("Event"),Be.promise=De,Be.reason=Fe,Be.initEvent($e,!1,!0),globalThis$2.dispatchEvent(Be)):Be={promise:De,reason:Fe},!NATIVE_PROMISE_REJECTION_EVENT&&(He=globalThis$2["on"+$e])?He(Be):$e===UNHANDLED_REJECTION&&hostReportErrors("Unhandled promise rejection",Fe)},onUnhandled=function($e){call$4(task,globalThis$2,function(){var De=$e.facade,Fe=$e.value,Be=isUnhandled($e),He;if(Be&&(He=perform$5(function(){IS_NODE?process$1.emit("unhandledRejection",Fe,De):dispatchEvent$1(UNHANDLED_REJECTION,De,Fe)}),$e.rejection=IS_NODE||isUnhandled($e)?UNHANDLED:HANDLED,He.error))throw He.value})},isUnhandled=function($e){return $e.rejection!==HANDLED&&!$e.parent},onHandleUnhandled=function($e){call$4(task,globalThis$2,function(){var De=$e.facade;IS_NODE?process$1.emit("rejectionHandled",De):dispatchEvent$1(REJECTION_HANDLED,De,$e.value)})},bind=function($e,De,Fe){return function(Be){$e(De,Be,Fe)}},internalReject=function($e,De,Fe){$e.done||($e.done=!0,Fe&&($e=Fe),$e.value=De,$e.state=REJECTED,notify($e,!0))},internalResolve=function($e,De,Fe){if(!$e.done){$e.done=!0,Fe&&($e=Fe);try{if($e.facade===De)throw new TypeError$1("Promise can't be resolved itself");var Be=isThenable(De);Be?microtask(function(){var He={done:!1};try{call$4(Be,De,bind(internalResolve,He,$e),bind(internalReject,He,$e))}catch(Ke){internalReject(He,Ke,$e)}}):($e.value=De,$e.state=FULFILLED,notify($e,!1))}catch(He){internalReject({done:!1},He,$e)}}};if(FORCED_PROMISE_CONSTRUCTOR$4&&(PromiseConstructor=function(De){anInstance(this,PromisePrototype),aCallable$5(De),call$4(Internal,this);var Fe=getInternalPromiseState(this);try{De(bind(internalResolve,Fe),bind(internalReject,Fe))}catch(Be){internalReject(Fe,Be)}},PromisePrototype=PromiseConstructor.prototype,Internal=function(De){setInternalState(this,{type:PROMISE,done:!1,notified:!1,parent:!1,reactions:new Queue,rejection:!1,state:PENDING,value:null})},Internal.prototype=defineBuiltIn$2(PromisePrototype,"then",function(De,Fe){var Be=getInternalPromiseState(this),He=newPromiseCapability$1(speciesConstructor$1(this,PromiseConstructor));return Be.parent=!0,He.ok=isCallable$2(De)?De:!0,He.fail=isCallable$2(Fe)&&Fe,He.domain=IS_NODE?process$1.domain:void 0,Be.state===PENDING?Be.reactions.add(He):microtask(function(){callReaction(He,Be)}),He.promise}),OwnPromiseCapability=function(){var $e=new Internal,De=getInternalPromiseState($e);this.promise=$e,this.resolve=bind(internalResolve,De),this.reject=bind(internalReject,De)},newPromiseCapabilityModule$7.f=newPromiseCapability$1=function($e){return $e===PromiseConstructor||$e===PromiseWrapper?new OwnPromiseCapability($e):newGenericPromiseCapability($e)},isCallable$2(NativePromiseConstructor$3)&&NativePromisePrototype$2!==Object.prototype)){nativeThen=NativePromisePrototype$2.then,NATIVE_PROMISE_SUBCLASSING||defineBuiltIn$2(NativePromisePrototype$2,"then",function(De,Fe){var Be=this;return new PromiseConstructor(function(He,Ke){call$4(nativeThen,Be,He,Ke)}).then(De,Fe)},{unsafe:!0});try{delete NativePromisePrototype$2.constructor}catch{}setPrototypeOf&&setPrototypeOf(NativePromisePrototype$2,PromisePrototype)}$$d({global:!0,constructor:!0,wrap:!0,forced:FORCED_PROMISE_CONSTRUCTOR$4},{Promise:PromiseConstructor});setToStringTag(PromiseConstructor,PROMISE,!1);setSpecies(PROMISE);var wellKnownSymbol=wellKnownSymbol$h,ITERATOR=wellKnownSymbol("iterator"),SAFE_CLOSING=!1;try{var called=0,iteratorWithReturn={next:function(){return{done:!!called++}},return:function(){SAFE_CLOSING=!0}};iteratorWithReturn[ITERATOR]=function(){return this},Array.from(iteratorWithReturn,function(){throw 2})}catch{}var checkCorrectnessOfIteration$1=function($e,De){try{if(!De&&!SAFE_CLOSING)return!1}catch{return!1}var Fe=!1;try{var Be={};Be[ITERATOR]=function(){return{next:function(){return{done:Fe=!0}}}},$e(Be)}catch{}return Fe},NativePromiseConstructor$2=promiseNativeConstructor,checkCorrectnessOfIteration=checkCorrectnessOfIteration$1,FORCED_PROMISE_CONSTRUCTOR$3=promiseConstructorDetection.CONSTRUCTOR,promiseStaticsIncorrectIteration=FORCED_PROMISE_CONSTRUCTOR$3||!checkCorrectnessOfIteration(function($e){NativePromiseConstructor$2.all($e).then(void 0,function(){})}),$$c=_export,call$3=functionCall,aCallable$4=aCallable$b,newPromiseCapabilityModule$6=newPromiseCapability$2,perform$4=perform$6,iterate$3=iterate$5,PROMISE_STATICS_INCORRECT_ITERATION$3=promiseStaticsIncorrectIteration;$$c({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION$3},{all:function(De){var Fe=this,Be=newPromiseCapabilityModule$6.f(Fe),He=Be.resolve,Ke=Be.reject,Ge=perform$4(function(){var We=aCallable$4(Fe.resolve),Ze=[],Xe=0,Je=1;iterate$3(De,function(Ye){var Qe=Xe++,et=!1;Je++,call$3(We,Fe,Ye).then(function(tt){et||(et=!0,Ze[Qe]=tt,--Je||He(Ze))},Ke)}),--Je||He(Ze)});return Ge.error&&Ke(Ge.value),Be.promise}});var $$b=_export,FORCED_PROMISE_CONSTRUCTOR$2=promiseConstructorDetection.CONSTRUCTOR,NativePromiseConstructor$1=promiseNativeConstructor,getBuiltIn$3=getBuiltIn$c,isCallable$1=isCallable$l,defineBuiltIn$1=defineBuiltIn$c,NativePromisePrototype$1=NativePromiseConstructor$1&&NativePromiseConstructor$1.prototype;$$b({target:"Promise",proto:!0,forced:FORCED_PROMISE_CONSTRUCTOR$2,real:!0},{catch:function($e){return this.then(void 0,$e)}});if(isCallable$1(NativePromiseConstructor$1)){var method$1=getBuiltIn$3("Promise").prototype.catch;NativePromisePrototype$1.catch!==method$1&&defineBuiltIn$1(NativePromisePrototype$1,"catch",method$1,{unsafe:!0})}var $$a=_export,call$2=functionCall,aCallable$3=aCallable$b,newPromiseCapabilityModule$5=newPromiseCapability$2,perform$3=perform$6,iterate$2=iterate$5,PROMISE_STATICS_INCORRECT_ITERATION$2=promiseStaticsIncorrectIteration;$$a({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION$2},{race:function(De){var Fe=this,Be=newPromiseCapabilityModule$5.f(Fe),He=Be.reject,Ke=perform$3(function(){var Ge=aCallable$3(Fe.resolve);iterate$2(De,function(We){call$2(Ge,Fe,We).then(Be.resolve,He)})});return Ke.error&&He(Ke.value),Be.promise}});var $$9=_export,newPromiseCapabilityModule$4=newPromiseCapability$2,FORCED_PROMISE_CONSTRUCTOR$1=promiseConstructorDetection.CONSTRUCTOR;$$9({target:"Promise",stat:!0,forced:FORCED_PROMISE_CONSTRUCTOR$1},{reject:function(De){var Fe=newPromiseCapabilityModule$4.f(this),Be=Fe.reject;return Be(De),Fe.promise}});var anObject=anObject$b,isObject=isObject$c,newPromiseCapability=newPromiseCapability$2,promiseResolve$2=function($e,De){if(anObject($e),isObject(De)&&De.constructor===$e)return De;var Fe=newPromiseCapability.f($e),Be=Fe.resolve;return Be(De),Fe.promise},$$8=_export,getBuiltIn$2=getBuiltIn$c,FORCED_PROMISE_CONSTRUCTOR=promiseConstructorDetection.CONSTRUCTOR,promiseResolve$1=promiseResolve$2;getBuiltIn$2("Promise");$$8({target:"Promise",stat:!0,forced:FORCED_PROMISE_CONSTRUCTOR},{resolve:function(De){return promiseResolve$1(this,De)}});var $$7=_export,call$1=functionCall,aCallable$2=aCallable$b,newPromiseCapabilityModule$3=newPromiseCapability$2,perform$2=perform$6,iterate$1=iterate$5,PROMISE_STATICS_INCORRECT_ITERATION$1=promiseStaticsIncorrectIteration;$$7({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION$1},{allSettled:function(De){var Fe=this,Be=newPromiseCapabilityModule$3.f(Fe),He=Be.resolve,Ke=Be.reject,Ge=perform$2(function(){var We=aCallable$2(Fe.resolve),Ze=[],Xe=0,Je=1;iterate$1(De,function(Ye){var Qe=Xe++,et=!1;Je++,call$1(We,Fe,Ye).then(function(tt){et||(et=!0,Ze[Qe]={status:"fulfilled",value:tt},--Je||He(Ze))},function(tt){et||(et=!0,Ze[Qe]={status:"rejected",reason:tt},--Je||He(Ze))})}),--Je||He(Ze)});return Ge.error&&Ke(Ge.value),Be.promise}});var $$6=_export,call=functionCall,aCallable$1=aCallable$b,getBuiltIn$1=getBuiltIn$c,newPromiseCapabilityModule$2=newPromiseCapability$2,perform$1=perform$6,iterate=iterate$5,PROMISE_STATICS_INCORRECT_ITERATION=promiseStaticsIncorrectIteration,PROMISE_ANY_ERROR="No one promise resolved";$$6({target:"Promise",stat:!0,forced:PROMISE_STATICS_INCORRECT_ITERATION},{any:function(De){var Fe=this,Be=getBuiltIn$1("AggregateError"),He=newPromiseCapabilityModule$2.f(Fe),Ke=He.resolve,Ge=He.reject,We=perform$1(function(){var Ze=aCallable$1(Fe.resolve),Xe=[],Je=0,Ye=1,Qe=!1;iterate(De,function(et){var tt=Je++,ct=!1;Ye++,call(Ze,Fe,et).then(function(at){ct||Qe||(Qe=!0,Ke(at))},function(at){ct||Qe||(ct=!0,Xe[tt]=at,--Ye||Ge(new Be(Xe,PROMISE_ANY_ERROR)))})}),--Ye||Ge(new Be(Xe,PROMISE_ANY_ERROR))});return We.error&&Ge(We.value),He.promise}});var $$5=_export,globalThis$1=globalThis_1,apply=functionApply,slice=arraySlice$3,newPromiseCapabilityModule$1=newPromiseCapability$2,aCallable=aCallable$b,perform=perform$6,Promise$1=globalThis$1.Promise,ACCEPT_ARGUMENTS=!1,FORCED=!Promise$1||!Promise$1.try||perform(function(){Promise$1.try(function($e){ACCEPT_ARGUMENTS=$e===8},8)}).error||!ACCEPT_ARGUMENTS;$$5({target:"Promise",stat:!0,forced:FORCED},{try:function($e){var De=arguments.length>1?slice(arguments,1):[],Fe=newPromiseCapabilityModule$1.f(this),Be=perform(function(){return apply(aCallable($e),void 0,De)});return(Be.error?Fe.reject:Fe.resolve)(Be.value),Fe.promise}});var $$4=_export,newPromiseCapabilityModule=newPromiseCapability$2;$$4({target:"Promise",stat:!0},{withResolvers:function(){var De=newPromiseCapabilityModule.f(this);return{promise:De.promise,resolve:De.resolve,reject:De.reject}}});var $$3=_export,NativePromiseConstructor=promiseNativeConstructor,fails=fails$h,getBuiltIn=getBuiltIn$c,isCallable=isCallable$l,speciesConstructor=speciesConstructor$2,promiseResolve=promiseResolve$2,defineBuiltIn=defineBuiltIn$c,NativePromisePrototype=NativePromiseConstructor&&NativePromiseConstructor.prototype,NON_GENERIC=!!NativePromiseConstructor&&fails(function(){NativePromisePrototype.finally.call({then:function(){}},function(){})});$$3({target:"Promise",proto:!0,real:!0,forced:NON_GENERIC},{finally:function($e){var De=speciesConstructor(this,getBuiltIn("Promise")),Fe=isCallable($e);return this.then(Fe?function(Be){return promiseResolve(De,$e()).then(function(){return Be})}:$e,Fe?function(Be){return promiseResolve(De,$e()).then(function(){throw Be})}:$e)}});if(isCallable(NativePromiseConstructor)){var method=getBuiltIn("Promise").prototype.finally;NativePromisePrototype.finally!==method&&defineBuiltIn(NativePromisePrototype,"finally",method,{unsafe:!0})}var path=path$3;path.Promise;const DEBUG_COOKIE="sesamy-debug";function setCookie($e,De,Fe){const Be=new Date;Be.setTime(Be.getTime()+Fe*60*60*1e3);const He="expires="+Be.toUTCString();document.cookie=`${$e}=${De}; ${He}; path=/`}function getCookie($e){if(typeof document>"u")return null;const De=$e+"=",Fe=document.cookie.split(";");for(let Be=0;Be<Fe.length;Be++){let He=Fe[Be];for(;He.charAt(0)===" ";)He=He.substring(1);if(He.indexOf(De)===0)return He.substring(De.length,He.length)}return null}function setDebug($e){setCookie(DEBUG_COOKIE,$e.toString(),1)}function getDebug(){return getCookie(DEBUG_COOKIE)==="true"}function log($e){getDebug()&&console.log($e)}function triggerEvent($e,De){if(typeof window>"u")return;const Fe=new CustomEvent($e,{detail:De,bubbles:!0,composed:!0});log(`Triggering event: ${$e}`),dispatchEvent(Fe)}function e$1($e,De){var Fe={};for(var Be in $e)Object.prototype.hasOwnProperty.call($e,Be)&&De.indexOf(Be)<0&&(Fe[Be]=$e[Be]);if($e!=null&&typeof Object.getOwnPropertySymbols=="function"){var He=0;for(Be=Object.getOwnPropertySymbols($e);He<Be.length;He++)De.indexOf(Be[He])<0&&Object.prototype.propertyIsEnumerable.call($e,Be[He])&&(Fe[Be[He]]=$e[Be[He]])}return Fe}var t$1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function i$6($e){return $e&&$e.__esModule&&Object.prototype.hasOwnProperty.call($e,"default")?$e.default:$e}function o$5($e,De){return $e(De={exports:{}},De.exports),De.exports}var n$2=o$5(function($e,De){Object.defineProperty(De,"__esModule",{value:!0});var Fe=function(){function Be(){var He=this;this.locked=new Map,this.addToLocked=function(Ke,Ge){var We=He.locked.get(Ke);We===void 0?Ge===void 0?He.locked.set(Ke,[]):He.locked.set(Ke,[Ge]):Ge!==void 0&&(We.unshift(Ge),He.locked.set(Ke,We))},this.isLocked=function(Ke){return He.locked.has(Ke)},this.lock=function(Ke){return new Promise(function(Ge,We){He.isLocked(Ke)?He.addToLocked(Ke,Ge):(He.addToLocked(Ke),Ge())})},this.unlock=function(Ke){var Ge=He.locked.get(Ke);if(Ge!==void 0&&Ge.length!==0){var We=Ge.pop();He.locked.set(Ke,Ge),We!==void 0&&setTimeout(We,0)}else He.locked.delete(Ke)}}return Be.getInstance=function(){return Be.instance===void 0&&(Be.instance=new Be),Be.instance},Be}();De.default=function(){return Fe.getInstance()}});i$6(n$2);var a$6=i$6(o$5(function($e,De){var Fe=t$1&&t$1.__awaiter||function(Je,Ye,Qe,et){return new(Qe||(Qe=Promise))(function(tt,ct){function at(ot){try{ut(et.next(ot))}catch(rt){ct(rt)}}function ft(ot){try{ut(et.throw(ot))}catch(rt){ct(rt)}}function ut(ot){ot.done?tt(ot.value):new Qe(function(rt){rt(ot.value)}).then(at,ft)}ut((et=et.apply(Je,Ye||[])).next())})},Be=t$1&&t$1.__generator||function(Je,Ye){var Qe,et,tt,ct,at={label:0,sent:function(){if(1&tt[0])throw tt[1];return tt[1]},trys:[],ops:[]};return ct={next:ft(0),throw:ft(1),return:ft(2)},typeof Symbol=="function"&&(ct[Symbol.iterator]=function(){return this}),ct;function ft(ut){return function(ot){return function(rt){if(Qe)throw new TypeError("Generator is already executing.");for(;at;)try{if(Qe=1,et&&(tt=2&rt[0]?et.return:rt[0]?et.throw||((tt=et.return)&&tt.call(et),0):et.next)&&!(tt=tt.call(et,rt[1])).done)return tt;switch(et=0,tt&&(rt=[2&rt[0],tt.value]),rt[0]){case 0:case 1:tt=rt;break;case 4:return at.label++,{value:rt[1],done:!1};case 5:at.label++,et=rt[1],rt=[0];continue;case 7:rt=at.ops.pop(),at.trys.pop();continue;default:if(tt=at.trys,!((tt=tt.length>0&&tt[tt.length-1])||rt[0]!==6&&rt[0]!==2)){at=0;continue}if(rt[0]===3&&(!tt||rt[1]>tt[0]&&rt[1]<tt[3])){at.label=rt[1];break}if(rt[0]===6&&at.label<tt[1]){at.label=tt[1],tt=rt;break}if(tt&&at.label<tt[2]){at.label=tt[2],at.ops.push(rt);break}tt[2]&&at.ops.pop(),at.trys.pop();continue}rt=Ye.call(Je,at)}catch(lt){rt=[6,lt],et=0}finally{Qe=tt=0}if(5&rt[0])throw rt[1];return{value:rt[0]?rt[1]:void 0,done:!0}}([ut,ot])}}},He=t$1;Object.defineProperty(De,"__esModule",{value:!0});var Ke="browser-tabs-lock-key",Ge={key:function(Je){return Fe(He,void 0,void 0,function(){return Be(this,function(Ye){throw new Error("Unsupported")})})},getItem:function(Je){return Fe(He,void 0,void 0,function(){return Be(this,function(Ye){throw new Error("Unsupported")})})},clear:function(){return Fe(He,void 0,void 0,function(){return Be(this,function(Je){return[2,window.localStorage.clear()]})})},removeItem:function(Je){return Fe(He,void 0,void 0,function(){return Be(this,function(Ye){throw new Error("Unsupported")})})},setItem:function(Je,Ye){return Fe(He,void 0,void 0,function(){return Be(this,function(Qe){throw new Error("Unsupported")})})},keySync:function(Je){return window.localStorage.key(Je)},getItemSync:function(Je){return window.localStorage.getItem(Je)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(Je){return window.localStorage.removeItem(Je)},setItemSync:function(Je,Ye){return window.localStorage.setItem(Je,Ye)}};function We(Je){return new Promise(function(Ye){return setTimeout(Ye,Je)})}function Ze(Je){for(var Ye="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",Qe="",et=0;et<Je;et++)Qe+=Ye[Math.floor(Math.random()*Ye.length)];return Qe}var Xe=function(){function Je(Ye){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+Ze(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=Ye,Je.waiters===void 0&&(Je.waiters=[])}return Je.prototype.acquireLock=function(Ye,Qe){return Qe===void 0&&(Qe=5e3),Fe(this,void 0,void 0,function(){var et,tt,ct,at,ft,ut,ot;return Be(this,function(rt){switch(rt.label){case 0:et=Date.now()+Ze(4),tt=Date.now()+Qe,ct=Ke+"-"+Ye,at=this.storageHandler===void 0?Ge:this.storageHandler,rt.label=1;case 1:return Date.now()<tt?[4,We(30)]:[3,8];case 2:return rt.sent(),at.getItemSync(ct)!==null?[3,5]:(ft=this.id+"-"+Ye+"-"+et,[4,We(Math.floor(25*Math.random()))]);case 3:return rt.sent(),at.setItemSync(ct,JSON.stringify({id:this.id,iat:et,timeoutKey:ft,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,We(30)];case 4:return rt.sent(),(ut=at.getItemSync(ct))!==null&&(ot=JSON.parse(ut)).id===this.id&&ot.iat===et?(this.acquiredIatSet.add(et),this.refreshLockWhileAcquired(ct,et),[2,!0]):[3,7];case 5:return Je.lockCorrector(this.storageHandler===void 0?Ge:this.storageHandler),[4,this.waitForSomethingToChange(tt)];case 6:rt.sent(),rt.label=7;case 7:return et=Date.now()+Ze(4),[3,1];case 8:return[2,!1]}})})},Je.prototype.refreshLockWhileAcquired=function(Ye,Qe){return Fe(this,void 0,void 0,function(){var et=this;return Be(this,function(tt){return setTimeout(function(){return Fe(et,void 0,void 0,function(){var ct,at,ft;return Be(this,function(ut){switch(ut.label){case 0:return[4,n$2.default().lock(Qe)];case 1:return ut.sent(),this.acquiredIatSet.has(Qe)?(ct=this.storageHandler===void 0?Ge:this.storageHandler,(at=ct.getItemSync(Ye))===null?(n$2.default().unlock(Qe),[2]):((ft=JSON.parse(at)).timeRefreshed=Date.now(),ct.setItemSync(Ye,JSON.stringify(ft)),n$2.default().unlock(Qe),this.refreshLockWhileAcquired(Ye,Qe),[2])):(n$2.default().unlock(Qe),[2])}})})},1e3),[2]})})},Je.prototype.waitForSomethingToChange=function(Ye){return Fe(this,void 0,void 0,function(){return Be(this,function(Qe){switch(Qe.label){case 0:return[4,new Promise(function(et){var tt=!1,ct=Date.now(),at=!1;function ft(){if(at||(window.removeEventListener("storage",ft),Je.removeFromWaiting(ft),clearTimeout(ut),at=!0),!tt){tt=!0;var ot=50-(Date.now()-ct);ot>0?setTimeout(et,ot):et(null)}}window.addEventListener("storage",ft),Je.addToWaiting(ft);var ut=setTimeout(ft,Math.max(0,Ye-Date.now()))})];case 1:return Qe.sent(),[2]}})})},Je.addToWaiting=function(Ye){this.removeFromWaiting(Ye),Je.waiters!==void 0&&Je.waiters.push(Ye)},Je.removeFromWaiting=function(Ye){Je.waiters!==void 0&&(Je.waiters=Je.waiters.filter(function(Qe){return Qe!==Ye}))},Je.notifyWaiters=function(){Je.waiters!==void 0&&Je.waiters.slice().forEach(function(Ye){return Ye()})},Je.prototype.releaseLock=function(Ye){return Fe(this,void 0,void 0,function(){return Be(this,function(Qe){switch(Qe.label){case 0:return[4,this.releaseLock__private__(Ye)];case 1:return[2,Qe.sent()]}})})},Je.prototype.releaseLock__private__=function(Ye){return Fe(this,void 0,void 0,function(){var Qe,et,tt,ct;return Be(this,function(at){switch(at.label){case 0:return Qe=this.storageHandler===void 0?Ge:this.storageHandler,et=Ke+"-"+Ye,(tt=Qe.getItemSync(et))===null?[2]:(ct=JSON.parse(tt)).id!==this.id?[3,2]:[4,n$2.default().lock(ct.iat)];case 1:at.sent(),this.acquiredIatSet.delete(ct.iat),Qe.removeItemSync(et),n$2.default().unlock(ct.iat),Je.notifyWaiters(),at.label=2;case 2:return[2]}})})},Je.lockCorrector=function(Ye){for(var Qe=Date.now()-5e3,et=Ye,tt=[],ct=0;;){var at=et.keySync(ct);if(at===null)break;tt.push(at),ct++}for(var ft=!1,ut=0;ut<tt.length;ut++){var ot=tt[ut];if(ot.includes(Ke)){var rt=et.getItemSync(ot);if(rt!==null){var lt=JSON.parse(rt);(lt.timeRefreshed===void 0&&lt.timeAcquired<Qe||lt.timeRefreshed!==void 0&&lt.timeRefreshed<Qe)&&(et.removeItemSync(ot),ft=!0)}}}ft&&Je.notifyWaiters()},Je.waiters=void 0,Je}();De.default=Xe}));const r$3={timeoutInSeconds:60},s$2={name:"auth0-spa-js",version:"2.1.3"},c$4=()=>Date.now();let d$2=class Wt extends Error{constructor(De,Fe){super(Fe),this.error=De,this.error_description=Fe,Object.setPrototypeOf(this,Wt.prototype)}static fromPayload({error:De,error_description:Fe}){return new Wt(De,Fe)}},u$4=class qt extends d$2{constructor(De,Fe,Be,He=null){super(De,Fe),this.state=Be,this.appState=He,Object.setPrototypeOf(this,qt.prototype)}},l$3=class Jt extends d$2{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,Jt.prototype)}},h$1=class Zt extends l$3{constructor(De){super(),this.popup=De,Object.setPrototypeOf(this,Zt.prototype)}},p$1=class Xt extends d$2{constructor(De){super("cancelled","Popup closed"),this.popup=De,Object.setPrototypeOf(this,Xt.prototype)}},m$2=class Qt extends d$2{constructor(De,Fe,Be){super(De,Fe),this.mfa_token=Be,Object.setPrototypeOf(this,Qt.prototype)}},f$2=class er extends d$2{constructor(De,Fe){super("missing_refresh_token",`Missing Refresh Token (audience: '${g$2(De,["default"])}', scope: '${g$2(Fe)}')`),this.audience=De,this.scope=Fe,Object.setPrototypeOf(this,er.prototype)}};function g$2($e,De=[]){return $e&&!De.includes($e)?$e:""}const w$1=()=>window.crypto,y$2=()=>{const $e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let De="";return Array.from(w$1().getRandomValues(new Uint8Array(43))).forEach(Fe=>De+=$e[Fe%$e.length]),De},k$2=$e=>btoa($e),v$1=$e=>{var{clientId:De}=$e,Fe=e$1($e,["clientId"]);return new URLSearchParams((Be=>Object.keys(Be).filter(He=>Be[He]!==void 0).reduce((He,Ke)=>Object.assign(Object.assign({},He),{[Ke]:Be[Ke]}),{}))(Object.assign({client_id:De},Fe))).toString()},b$5=$e=>(De=>decodeURIComponent(atob(De).split("").map(Fe=>"%"+("00"+Fe.charCodeAt(0).toString(16)).slice(-2)).join("")))($e.replace(/_/g,"/").replace(/-/g,"+")),_$1=async($e,De)=>{const Fe=await fetch($e,De);return{ok:Fe.ok,json:await Fe.json()}},I$3=async($e,De,Fe)=>{const Be=new AbortController;let He;return De.signal=Be.signal,Promise.race([_$1($e,De),new Promise((Ke,Ge)=>{He=setTimeout(()=>{Be.abort(),Ge(new Error("Timeout when executing 'fetch'"))},Fe)})]).finally(()=>{clearTimeout(He)})},S$1=async($e,De,Fe,Be,He,Ke,Ge)=>{return We={auth:{audience:De,scope:Fe},timeout:He,fetchUrl:$e,fetchOptions:Be,useFormData:Ge},Ze=Ke,new Promise(function(Xe,Je){const Ye=new MessageChannel;Ye.port1.onmessage=function(Qe){Qe.data.error?Je(new Error(Qe.data.error)):Xe(Qe.data),Ye.port1.close()},Ze.postMessage(We,[Ye.port2])});var We,Ze},O$2=async($e,De,Fe,Be,He,Ke,Ge=1e4)=>He?S$1($e,De,Fe,Be,Ge,He,Ke):I$3($e,Be,Ge);async function T$1($e,De){var{baseUrl:Fe,timeout:Be,audience:He,scope:Ke,auth0Client:Ge,useFormData:We}=$e,Ze=e$1($e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const Xe=We?v$1(Ze):JSON.stringify(Ze);return await async function(Je,Ye,Qe,et,tt,ct,at){let ft,ut=null;for(let vt=0;vt<3;vt++)try{ft=await O$2(Je,Qe,et,tt,ct,at,Ye),ut=null;break}catch(Et){ut=Et}if(ut)throw ut;const ot=ft.json,{error:rt,error_description:lt}=ot,pt=e$1(ot,["error","error_description"]),{ok:gt}=ft;if(!gt){const vt=lt||`HTTP error. Unable to fetch ${Je}`;throw rt==="mfa_required"?new m$2(rt,vt,pt.mfa_token):rt==="missing_refresh_token"?new f$2(Qe,et):new d$2(rt||"request_error",vt)}return pt}(`${Fe}/oauth/token`,Be,He||"default",Ke,{method:"POST",body:Xe,headers:{"Content-Type":We?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(Ge||s$2))}},De,We)}const j$1=(...$e)=>{return(De=$e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(De))).join(" ");var De};let C$2=class Yt{constructor(De,Fe="@@auth0spajs@@",Be){this.prefix=Fe,this.suffix=Be,this.clientId=De.clientId,this.scope=De.scope,this.audience=De.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(De){const[Fe,Be,He,Ke]=De.split("::");return new Yt({clientId:Be,scope:Ke,audience:He},Fe)}static fromCacheEntry(De){const{scope:Fe,audience:Be,client_id:He}=De;return new Yt({scope:Fe,audience:Be,clientId:He})}},z$1=class{set(De,Fe){localStorage.setItem(De,JSON.stringify(Fe))}get(De){const Fe=window.localStorage.getItem(De);if(Fe)try{return JSON.parse(Fe)}catch{return}}remove(De){localStorage.removeItem(De)}allKeys(){return Object.keys(window.localStorage).filter(De=>De.startsWith("@@auth0spajs@@"))}},P$1=class{constructor(){this.enclosedCache=function(){let De={};return{set(Fe,Be){De[Fe]=Be},get(Fe){const Be=De[Fe];if(Be)return Be},remove(Fe){delete De[Fe]},allKeys:()=>Object.keys(De)}}()}},x$2=class{constructor(De,Fe,Be){this.cache=De,this.keyManifest=Fe,this.nowProvider=Be||c$4}async setIdToken(De,Fe,Be){var He;const Ke=this.getIdTokenCacheKey(De);await this.cache.set(Ke,{id_token:Fe,decodedToken:Be}),await((He=this.keyManifest)===null||He===void 0?void 0:He.add(Ke))}async getIdToken(De){const Fe=await this.cache.get(this.getIdTokenCacheKey(De.clientId));if(!Fe&&De.scope&&De.audience){const Be=await this.get(De);return!Be||!Be.id_token||!Be.decodedToken?void 0:{id_token:Be.id_token,decodedToken:Be.decodedToken}}if(Fe)return{id_token:Fe.id_token,decodedToken:Fe.decodedToken}}async get(De,Fe=0){var Be;let He=await this.cache.get(De.toKey());if(!He){const We=await this.getCacheKeys();if(!We)return;const Ze=this.matchExistingCacheKey(De,We);Ze&&(He=await this.cache.get(Ze))}if(!He)return;const Ke=await this.nowProvider(),Ge=Math.floor(Ke/1e3);return He.expiresAt-Fe<Ge?He.body.refresh_token?(He.body={refresh_token:He.body.refresh_token},await this.cache.set(De.toKey(),He),He.body):(await this.cache.remove(De.toKey()),void await((Be=this.keyManifest)===null||Be===void 0?void 0:Be.remove(De.toKey()))):He.body}async set(De){var Fe;const Be=new C$2({clientId:De.client_id,scope:De.scope,audience:De.audience}),He=await this.wrapCacheEntry(De);await this.cache.set(Be.toKey(),He),await((Fe=this.keyManifest)===null||Fe===void 0?void 0:Fe.add(Be.toKey()))}async clear(De){var Fe;const Be=await this.getCacheKeys();Be&&(await Be.filter(He=>!De||He.includes(De)).reduce(async(He,Ke)=>{await He,await this.cache.remove(Ke)},Promise.resolve()),await((Fe=this.keyManifest)===null||Fe===void 0?void 0:Fe.clear()))}async wrapCacheEntry(De){const Fe=await this.nowProvider();return{body:De,expiresAt:Math.floor(Fe/1e3)+De.expires_in}}async getCacheKeys(){var De;return this.keyManifest?(De=await this.keyManifest.get())===null||De===void 0?void 0:De.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(De){return new C$2({clientId:De},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(De,Fe){return Fe.filter(Be=>{var He;const Ke=C$2.fromKey(Be),Ge=new Set(Ke.scope&&Ke.scope.split(" ")),We=((He=De.scope)===null||He===void 0?void 0:He.split(" "))||[],Ze=Ke.scope&&We.reduce((Xe,Je)=>Xe&&Ge.has(Je),!0);return Ke.prefix==="@@auth0spajs@@"&&Ke.clientId===De.clientId&&Ke.audience===De.audience&&Ze})[0]}},Z$1=class{constructor(De,Fe,Be){this.storage=De,this.clientId=Fe,this.cookieDomain=Be,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(De){this.storage.save(this.storageKey,De,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}};const K$1=$e=>typeof $e=="number",W$2=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],E$2=$e=>{if(!$e.id_token)throw new Error("ID token is required but missing");const De=(Ke=>{const Ge=Ke.split("."),[We,Ze,Xe]=Ge;if(Ge.length!==3||!We||!Ze||!Xe)throw new Error("ID token could not be decoded");const Je=JSON.parse(b$5(Ze)),Ye={__raw:Ke},Qe={};return Object.keys(Je).forEach(et=>{Ye[et]=Je[et],W$2.includes(et)||(Qe[et]=Je[et])}),{encoded:{header:We,payload:Ze,signature:Xe},header:JSON.parse(b$5(We)),claims:Ye,user:Qe}})($e.id_token);if(!De.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(De.claims.iss!==$e.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${$e.iss}", found "${De.claims.iss}"`);if(!De.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(De.header.alg!=="RS256")throw new Error(`Signature algorithm of "${De.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!De.claims.aud||typeof De.claims.aud!="string"&&!Array.isArray(De.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(De.claims.aud)){if(!De.claims.aud.includes($e.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${$e.aud}" but was not one of "${De.claims.aud.join(", ")}"`);if(De.claims.aud.length>1){if(!De.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(De.claims.azp!==$e.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${$e.aud}", found "${De.claims.azp}"`)}}else if(De.claims.aud!==$e.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${$e.aud}" but found "${De.claims.aud}"`);if($e.nonce){if(!De.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(De.claims.nonce!==$e.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${$e.nonce}", found "${De.claims.nonce}"`)}if($e.max_age&&!K$1(De.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(De.claims.exp==null||!K$1(De.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!K$1(De.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const Fe=$e.leeway||60,Be=new Date($e.now||Date.now()),He=new Date(0);if(He.setUTCSeconds(De.claims.exp+Fe),Be>He)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${Be}) is after expiration time (${He})`);if(De.claims.nbf!=null&&K$1(De.claims.nbf)){const Ke=new Date(0);if(Ke.setUTCSeconds(De.claims.nbf-Fe),Be<Ke)throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${Be}) is before ${Ke}`)}if(De.claims.auth_time!=null&&K$1(De.claims.auth_time)){const Ke=new Date(0);if(Ke.setUTCSeconds(parseInt(De.claims.auth_time)+$e.max_age+Fe),Be>Ke)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${Be}) is after last auth at ${Ke}`)}if($e.organization){const Ke=$e.organization.trim();if(Ke.startsWith("org_")){const Ge=Ke;if(!De.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(Ge!==De.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${Ge}", found "${De.claims.org_id}"`)}else{const Ge=Ke.toLowerCase();if(!De.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(Ge!==De.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${Ge}", found "${De.claims.org_name}"`)}}return De};var R$2=o$5(function($e,De){var Fe=t$1&&t$1.__assign||function(){return Fe=Object.assign||function(Ze){for(var Xe,Je=1,Ye=arguments.length;Je<Ye;Je++)for(var Qe in Xe=arguments[Je])Object.prototype.hasOwnProperty.call(Xe,Qe)&&(Ze[Qe]=Xe[Qe]);return Ze},Fe.apply(this,arguments)};function Be(Ze,Xe){if(!Xe)return"";var Je="; "+Ze;return Xe===!0?Je:Je+"="+Xe}function He(Ze,Xe,Je){return encodeURIComponent(Ze).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(Xe).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(Ye){if(typeof Ye.expires=="number"){var Qe=new Date;Qe.setMilliseconds(Qe.getMilliseconds()+864e5*Ye.expires),Ye.expires=Qe}return Be("Expires",Ye.expires?Ye.expires.toUTCString():"")+Be("Domain",Ye.domain)+Be("Path",Ye.path)+Be("Secure",Ye.secure)+Be("SameSite",Ye.sameSite)}(Je)}function Ke(Ze){for(var Xe={},Je=Ze?Ze.split("; "):[],Ye=/(%[\dA-F]{2})+/gi,Qe=0;Qe<Je.length;Qe++){var et=Je[Qe].split("="),tt=et.slice(1).join("=");tt.charAt(0)==='"'&&(tt=tt.slice(1,-1));try{Xe[et[0].replace(Ye,decodeURIComponent)]=tt.replace(Ye,decodeURIComponent)}catch{}}return Xe}function Ge(){return Ke(document.cookie)}function We(Ze,Xe,Je){document.cookie=He(Ze,Xe,Fe({path:"/"},Je))}De.__esModule=!0,De.encode=He,De.parse=Ke,De.getAll=Ge,De.get=function(Ze){return Ge()[Ze]},De.set=We,De.remove=function(Ze,Xe){We(Ze,"",Fe(Fe({},Xe),{expires:-1}))}});i$6(R$2),R$2.encode,R$2.parse,R$2.getAll;var U$2=R$2.get,L$2=R$2.set,D$1=R$2.remove;const X$1={get($e){const De=U$2($e);if(De!==void 0)return JSON.parse(De)},save($e,De,Fe){let Be={};window.location.protocol==="https:"&&(Be={secure:!0,sameSite:"none"}),Fe!=null&&Fe.daysUntilExpire&&(Be.expires=Fe.daysUntilExpire),Fe!=null&&Fe.cookieDomain&&(Be.domain=Fe.cookieDomain),L$2($e,JSON.stringify(De),Be)},remove($e,De){let Fe={};De!=null&&De.cookieDomain&&(Fe.domain=De.cookieDomain),D$1($e,Fe)}},N$2={get($e){return X$1.get($e)||X$1.get(`_legacy_${$e}`)},save($e,De,Fe){let Be={};window.location.protocol==="https:"&&(Be={secure:!0}),Fe!=null&&Fe.daysUntilExpire&&(Be.expires=Fe.daysUntilExpire),Fe!=null&&Fe.cookieDomain&&(Be.domain=Fe.cookieDomain),L$2(`_legacy_${$e}`,JSON.stringify(De),Be),X$1.save($e,De,Fe)},remove($e,De){let Fe={};De!=null&&De.cookieDomain&&(Fe.domain=De.cookieDomain),D$1($e,Fe),X$1.remove($e,De),X$1.remove(`_legacy_${$e}`,De)}},J$3={get($e){if(typeof sessionStorage>"u")return;const De=sessionStorage.getItem($e);return De!=null?JSON.parse(De):void 0},save($e,De){sessionStorage.setItem($e,JSON.stringify(De))},remove($e){sessionStorage.removeItem($e)}};function F$3($e,De,Fe){var Be=De===void 0?null:De,He=function(Ze,Xe){var Je=atob(Ze);if(Xe){for(var Ye=new Uint8Array(Je.length),Qe=0,et=Je.length;Qe<et;++Qe)Ye[Qe]=Je.charCodeAt(Qe);return String.fromCharCode.apply(null,new Uint16Array(Ye.buffer))}return Je}($e,Fe!==void 0&&Fe),Ke=He.indexOf(`
2
2
  `,10)+1,Ge=He.substring(Ke)+(Be?"//# sourceMappingURL="+Be:""),We=new Blob([Ge],{type:"application/javascript"});return URL.createObjectURL(We)}var H$2,Y$2,G$2,V$2,M$2=(H$2="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=",Y$2=null,G$2=!1,function($e){return V$2=V$2||F$3(H$2,Y$2,G$2),new Worker(V$2,$e)});const A$2={};let B$1=class{constructor(De,Fe){this.cache=De,this.clientId=Fe,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(De){var Fe;const Be=new Set(((Fe=await this.cache.get(this.manifestKey))===null||Fe===void 0?void 0:Fe.keys)||[]);Be.add(De),await this.cache.set(this.manifestKey,{keys:[...Be]})}async remove(De){const Fe=await this.cache.get(this.manifestKey);if(Fe){const Be=new Set(Fe.keys);return Be.delete(De),Be.size>0?await this.cache.set(this.manifestKey,{keys:[...Be]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(De){return`@@auth0spajs@@::${De}`}};const $$2={memory:()=>new P$1().enclosedCache,localstorage:()=>new z$1},q$2=$e=>$$2[$e],Q$2=$e=>{const{openUrl:De,onRedirect:Fe}=$e,Be=e$1($e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},Be),{openUrl:De===!1||De?De:Fe})},ee$1=new a$6;let te$1=class{constructor(De){let Fe,Be;if(this.userCache=new P$1().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{await ee$1.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),De),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),De.authorizationParams)}),typeof window<"u"&&(()=>{if(!w$1())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(w$1().subtle===void 0)throw new Error(`
3
3
  auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.
4
- `)})(),De.cache&&De.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),De.cache)Be=De.cache;else{if(Fe=De.cacheLocation||"memory",!q$2(Fe))throw new Error(`Invalid cache location "${Fe}"`);Be=q$2(Fe)()}this.httpTimeoutMs=De.httpTimeoutInSeconds?1e3*De.httpTimeoutInSeconds:1e4,this.cookieStorage=De.legacySameSiteCookie===!1?X$1:N$2,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(Ge=>`auth0.${Ge}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=De.sessionCheckExpiryDays||1;const He=De.useCookiesForTransactions?this.cookieStorage:J$3;var Ke;this.scope=j$1("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new Z$1(He,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||c$4,this.cacheManager=new x$2(Be,Be.allKeys?void 0:new B$1(Be,this.options.clientId),this.nowProvider),this.domainUrl=(Ke=this.options.domain,/^https?:\/\//.test(Ke)?Ke:`https://${Ke}`),this.tokenIssuer=((Ge,We)=>Ge?Ge.startsWith("https://")?Ge:`https://${Ge}/`:`${We}/`)(this.options.issuer,this.domainUrl),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&Fe==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new M$2)}_url(De){const Fe=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||s$2)));return`${this.domainUrl}${De}&auth0Client=${Fe}`}_authorizeUrl(De){return this._url(`/authorize?${v$1(De)}`)}async _verifyIdToken(De,Fe,Be){const He=await this.nowProvider();return E$2({iss:this.tokenIssuer,aud:this.options.clientId,id_token:De,nonce:Fe,organization:Be,leeway:this.options.leeway,max_age:(Ke=this.options.authorizationParams.max_age,typeof Ke!="string"?Ke:parseInt(Ke,10)||void 0),now:He});var Ke}_processOrgHint(De){De?this.cookieStorage.save(this.orgHintCookieName,De,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(De,Fe,Be){const He=k$2(y$2()),Ke=k$2(y$2()),Ge=y$2(),We=(Je=>{const Ye=new Uint8Array(Je);return(Qe=>{const et={"+":"-","/":"_","=":""};return Qe.replace(/[+/=]/g,tt=>et[tt])})(window.btoa(String.fromCharCode(...Array.from(Ye))))})(await(async Je=>await w$1().subtle.digest({name:"SHA-256"},new TextEncoder().encode(Je)))(Ge)),Ze=((Je,Ye,Qe,et,tt,ct,at,ft)=>Object.assign(Object.assign(Object.assign({client_id:Je.clientId},Je.authorizationParams),Qe),{scope:j$1(Ye,Qe.scope),response_type:"code",response_mode:ft||"query",state:et,nonce:tt,redirect_uri:at||Je.authorizationParams.redirect_uri,code_challenge:ct,code_challenge_method:"S256"}))(this.options,this.scope,De,He,Ke,We,De.redirect_uri||this.options.authorizationParams.redirect_uri||Be,Fe==null?void 0:Fe.response_mode),Xe=this._authorizeUrl(Ze);return{nonce:Ke,code_verifier:Ge,scope:Ze.scope,audience:Ze.audience||"default",redirect_uri:Ze.redirect_uri,state:He,url:Xe}}async loginWithPopup(De,Fe){var Be;if(De=De||{},!(Fe=Fe||{}).popup&&(Fe.popup=(We=>{const Ze=window.screenX+(window.innerWidth-400)/2,Xe=window.screenY+(window.innerHeight-600)/2;return window.open(We,"auth0:authorize:popup",`left=${Ze},top=${Xe},width=400,height=600,resizable,scrollbars=yes,status=1`)})(""),!Fe.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const He=await this._prepareAuthorizeUrl(De.authorizationParams||{},{response_mode:"web_message"},window.location.origin);Fe.popup.location.href=He.url;const Ke=await(We=>new Promise((Ze,Xe)=>{let Je;const Ye=setInterval(()=>{We.popup&&We.popup.closed&&(clearInterval(Ye),clearTimeout(Qe),window.removeEventListener("message",Je,!1),Xe(new p$1(We.popup)))},1e3),Qe=setTimeout(()=>{clearInterval(Ye),Xe(new h$1(We.popup)),window.removeEventListener("message",Je,!1)},1e3*(We.timeoutInSeconds||60));Je=function(et){if(et.data&&et.data.type==="authorization_response"){if(clearTimeout(Qe),clearInterval(Ye),window.removeEventListener("message",Je,!1),We.popup.close(),et.data.response.error)return Xe(d$2.fromPayload(et.data.response));Ze(et.data.response)}},window.addEventListener("message",Je)}))(Object.assign(Object.assign({},Fe),{timeoutInSeconds:Fe.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(He.state!==Ke.state)throw new d$2("state_mismatch","Invalid state");const Ge=((Be=De.authorizationParams)===null||Be===void 0?void 0:Be.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:He.audience,scope:He.scope,code_verifier:He.code_verifier,grant_type:"authorization_code",code:Ke.code,redirect_uri:He.redirect_uri},{nonceIn:He.nonce,organization:Ge})}async getUser(){var De;const Fe=await this._getIdTokenFromCache();return(De=Fe==null?void 0:Fe.decodedToken)===null||De===void 0?void 0:De.user}async getIdTokenClaims(){var De;const Fe=await this._getIdTokenFromCache();return(De=Fe==null?void 0:Fe.decodedToken)===null||De===void 0?void 0:De.claims}async loginWithRedirect(De={}){var Fe;const Be=Q$2(De),{openUrl:He,fragment:Ke,appState:Ge}=Be,We=e$1(Be,["openUrl","fragment","appState"]),Ze=((Fe=We.authorizationParams)===null||Fe===void 0?void 0:Fe.organization)||this.options.authorizationParams.organization,Xe=await this._prepareAuthorizeUrl(We.authorizationParams||{}),{url:Je}=Xe,Ye=e$1(Xe,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},Ye),{appState:Ge}),Ze&&{organization:Ze}));const Qe=Ke?`${Je}#${Ke}`:Je;He?await He(Qe):window.location.assign(Qe)}async handleRedirectCallback(De=window.location.href){const Fe=De.split("?").slice(1);if(Fe.length===0)throw new Error("There are no query params available for parsing.");const{state:Be,code:He,error:Ke,error_description:Ge}=(Ye=>{Ye.indexOf("#")>-1&&(Ye=Ye.substring(0,Ye.indexOf("#")));const Qe=new URLSearchParams(Ye);return{state:Qe.get("state"),code:Qe.get("code")||void 0,error:Qe.get("error")||void 0,error_description:Qe.get("error_description")||void 0}})(Fe.join("")),We=this.transactionManager.get();if(!We)throw new d$2("missing_transaction","Invalid state");if(this.transactionManager.remove(),Ke)throw new u$4(Ke,Ge||Ke,Be,We.appState);if(!We.code_verifier||We.state&&We.state!==Be)throw new d$2("state_mismatch","Invalid state");const Ze=We.organization,Xe=We.nonce,Je=We.redirect_uri;return await this._requestToken(Object.assign({audience:We.audience,scope:We.scope,code_verifier:We.code_verifier,grant_type:"authorization_code",code:He},Je?{redirect_uri:Je}:{}),{nonceIn:Xe,organization:Ze}),{appState:We.appState}}async checkSession(De){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(De)}catch{}}async getTokenSilently(De={}){var Fe;const Be=Object.assign(Object.assign({cacheMode:"on"},De),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),De.authorizationParams),{scope:j$1(this.scope,(Fe=De.authorizationParams)===null||Fe===void 0?void 0:Fe.scope)})}),He=await((Ke,Ge)=>{let We=A$2[Ge];return We||(We=Ke().finally(()=>{delete A$2[Ge],We=null}),A$2[Ge]=We),We})(()=>this._getTokenSilently(Be),`${this.options.clientId}::${Be.authorizationParams.audience}::${Be.authorizationParams.scope}`);return De.detailedResponse?He:He==null?void 0:He.access_token}async _getTokenSilently(De){const{cacheMode:Fe}=De,Be=e$1(De,["cacheMode"]);if(Fe!=="off"){const He=await this._getEntryFromCache({scope:Be.authorizationParams.scope,audience:Be.authorizationParams.audience||"default",clientId:this.options.clientId});if(He)return He}if(Fe!=="cache-only"){if(!await(async(He,Ke=3)=>{for(let Ge=0;Ge<Ke;Ge++)if(await He())return!0;return!1})(()=>ee$1.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new l$3;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),Fe!=="off"){const Xe=await this._getEntryFromCache({scope:Be.authorizationParams.scope,audience:Be.authorizationParams.audience||"default",clientId:this.options.clientId});if(Xe)return Xe}const He=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(Be):await this._getTokenFromIFrame(Be),{id_token:Ke,access_token:Ge,oauthTokenScope:We,expires_in:Ze}=He;return Object.assign(Object.assign({id_token:Ke,access_token:Ge},We?{scope:We}:null),{expires_in:Ze})}finally{await ee$1.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}}async getTokenWithPopup(De={},Fe={}){var Be;const He=Object.assign(Object.assign({},De),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),De.authorizationParams),{scope:j$1(this.scope,(Be=De.authorizationParams)===null||Be===void 0?void 0:Be.scope)})});return Fe=Object.assign(Object.assign({},r$3),Fe),await this.loginWithPopup(He,Fe),(await this.cacheManager.get(new C$2({scope:He.authorizationParams.scope,audience:He.authorizationParams.audience||"default",clientId:this.options.clientId}))).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(De){De.clientId!==null?De.clientId=De.clientId||this.options.clientId:delete De.clientId;const Fe=De.logoutParams||{},{federated:Be}=Fe,He=e$1(Fe,["federated"]),Ke=Be?"&federated":"";return this._url(`/v2/logout?${v$1(Object.assign({clientId:De.clientId},He))}`)+Ke}async logout(De={}){const Fe=Q$2(De),{openUrl:Be}=Fe,He=e$1(Fe,["openUrl"]);De.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(De.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@");const Ke=this._buildLogoutUrl(He);Be?await Be(Ke):Be!==!1&&window.location.assign(Ke)}async _getTokenFromIFrame(De){const Fe=Object.assign(Object.assign({},De.authorizationParams),{prompt:"none"}),Be=this.cookieStorage.get(this.orgHintCookieName);Be&&!Fe.organization&&(Fe.organization=Be);const{url:He,state:Ke,nonce:Ge,code_verifier:We,redirect_uri:Ze,scope:Xe,audience:Je}=await this._prepareAuthorizeUrl(Fe,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new d$2("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const Ye=De.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,Qe=await((tt,ct,at=60)=>new Promise((ft,ut)=>{const ot=window.document.createElement("iframe");ot.setAttribute("width","0"),ot.setAttribute("height","0"),ot.style.display="none";const rt=()=>{window.document.body.contains(ot)&&(window.document.body.removeChild(ot),window.removeEventListener("message",lt,!1))};let lt;const pt=setTimeout(()=>{ut(new l$3),rt()},1e3*at);lt=function(gt){if(gt.origin!=ct||!gt.data||gt.data.type!=="authorization_response")return;const vt=gt.source;vt&&vt.close(),gt.data.response.error?ut(d$2.fromPayload(gt.data.response)):ft(gt.data.response),clearTimeout(pt),window.removeEventListener("message",lt,!1),setTimeout(rt,2e3)},window.addEventListener("message",lt,!1),window.document.body.appendChild(ot),ot.setAttribute("src",tt)}))(He,this.domainUrl,Ye);if(Ke!==Qe.state)throw new d$2("state_mismatch","Invalid state");const et=await this._requestToken(Object.assign(Object.assign({},De.authorizationParams),{code_verifier:We,code:Qe.code,grant_type:"authorization_code",redirect_uri:Ze,timeout:De.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:Ge,organization:Fe.organization});return Object.assign(Object.assign({},et),{scope:Xe,oauthTokenScope:et.scope,audience:Je})}catch(Ye){throw Ye.error==="login_required"&&this.logout({openUrl:!1}),Ye}}async _getTokenUsingRefreshToken(De){const Fe=await this.cacheManager.get(new C$2({scope:De.authorizationParams.scope,audience:De.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(Fe&&Fe.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(De);throw new f$2(De.authorizationParams.audience||"default",De.authorizationParams.scope)}const Be=De.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,He=typeof De.timeoutInSeconds=="number"?1e3*De.timeoutInSeconds:null;try{const Ke=await this._requestToken(Object.assign(Object.assign(Object.assign({},De.authorizationParams),{grant_type:"refresh_token",refresh_token:Fe&&Fe.refresh_token,redirect_uri:Be}),He&&{timeout:He}));return Object.assign(Object.assign({},Ke),{scope:De.authorizationParams.scope,oauthTokenScope:Ke.scope,audience:De.authorizationParams.audience||"default"})}catch(Ke){if((Ke.message.indexOf("Missing Refresh Token")>-1||Ke.message&&Ke.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(De);throw Ke}}async _saveEntryInCache(De){const{id_token:Fe,decodedToken:Be}=De,He=e$1(De,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:Fe,decodedToken:Be}),await this.cacheManager.setIdToken(this.options.clientId,De.id_token,De.decodedToken),await this.cacheManager.set(He)}async _getIdTokenFromCache(){const De=this.options.authorizationParams.audience||"default",Fe=await this.cacheManager.getIdToken(new C$2({clientId:this.options.clientId,audience:De,scope:this.scope})),Be=this.userCache.get("@@user@@");return Fe&&Fe.id_token===(Be==null?void 0:Be.id_token)?Be:(this.userCache.set("@@user@@",Fe),Fe)}async _getEntryFromCache({scope:De,audience:Fe,clientId:Be}){const He=await this.cacheManager.get(new C$2({scope:De,audience:Fe,clientId:Be}),60);if(He&&He.access_token){const{access_token:Ke,oauthTokenScope:Ge,expires_in:We}=He,Ze=await this._getIdTokenFromCache();return Ze&&Object.assign(Object.assign({id_token:Ze.id_token,access_token:Ke},Ge?{scope:Ge}:null),{expires_in:We})}}async _requestToken(De,Fe){const{nonceIn:Be,organization:He}=Fe||{},Ke=await T$1(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},De),this.worker),Ge=await this._verifyIdToken(Ke.id_token,Be,He);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},Ke),{decodedToken:Ge,scope:De.scope,audience:De.audience||"default"}),Ke.scope?{oauthTokenScope:Ke.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(He||Ge.claims.org_id),Object.assign(Object.assign({},Ke),{decodedToken:Ge})}};async function oe$1($e){const De=new te$1($e);return await De.checkSession(),De}var Events=($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))(Events||{});const BASE_URL_DOMAIN="sesamy.com",DEV_BASE_URL_DOMAIN="sesamy.dev",SHORTLINK_URL="https://sesa.my",CACHE_TIMESTAMP_KEY="sesamyCacheTimestamp",SESMAY_CONTENT_RELOAD_KEY="sesamyContentReload";function getBaseUrl($e,De){return`https://${$e}.${De==="dev"?DEV_BASE_URL_DOMAIN:BASE_URL_DOMAIN}`}function getLanguage(){var Fe;return(Fe=(document.documentElement.getAttribute("lang")??navigator.language??"en").split("-")[0])==null?void 0:Fe.toLocaleLowerCase()}/*!
4
+ `)})(),De.cache&&De.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),De.cache)Be=De.cache;else{if(Fe=De.cacheLocation||"memory",!q$2(Fe))throw new Error(`Invalid cache location "${Fe}"`);Be=q$2(Fe)()}this.httpTimeoutMs=De.httpTimeoutInSeconds?1e3*De.httpTimeoutInSeconds:1e4,this.cookieStorage=De.legacySameSiteCookie===!1?X$1:N$2,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(Ge=>`auth0.${Ge}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=De.sessionCheckExpiryDays||1;const He=De.useCookiesForTransactions?this.cookieStorage:J$3;var Ke;this.scope=j$1("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new Z$1(He,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||c$4,this.cacheManager=new x$2(Be,Be.allKeys?void 0:new B$1(Be,this.options.clientId),this.nowProvider),this.domainUrl=(Ke=this.options.domain,/^https?:\/\//.test(Ke)?Ke:`https://${Ke}`),this.tokenIssuer=((Ge,We)=>Ge?Ge.startsWith("https://")?Ge:`https://${Ge}/`:`${We}/`)(this.options.issuer,this.domainUrl),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&Fe==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new M$2)}_url(De){const Fe=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||s$2)));return`${this.domainUrl}${De}&auth0Client=${Fe}`}_authorizeUrl(De){return this._url(`/authorize?${v$1(De)}`)}async _verifyIdToken(De,Fe,Be){const He=await this.nowProvider();return E$2({iss:this.tokenIssuer,aud:this.options.clientId,id_token:De,nonce:Fe,organization:Be,leeway:this.options.leeway,max_age:(Ke=this.options.authorizationParams.max_age,typeof Ke!="string"?Ke:parseInt(Ke,10)||void 0),now:He});var Ke}_processOrgHint(De){De?this.cookieStorage.save(this.orgHintCookieName,De,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(De,Fe,Be){const He=k$2(y$2()),Ke=k$2(y$2()),Ge=y$2(),We=(Je=>{const Ye=new Uint8Array(Je);return(Qe=>{const et={"+":"-","/":"_","=":""};return Qe.replace(/[+/=]/g,tt=>et[tt])})(window.btoa(String.fromCharCode(...Array.from(Ye))))})(await(async Je=>await w$1().subtle.digest({name:"SHA-256"},new TextEncoder().encode(Je)))(Ge)),Ze=((Je,Ye,Qe,et,tt,ct,at,ft)=>Object.assign(Object.assign(Object.assign({client_id:Je.clientId},Je.authorizationParams),Qe),{scope:j$1(Ye,Qe.scope),response_type:"code",response_mode:ft||"query",state:et,nonce:tt,redirect_uri:at||Je.authorizationParams.redirect_uri,code_challenge:ct,code_challenge_method:"S256"}))(this.options,this.scope,De,He,Ke,We,De.redirect_uri||this.options.authorizationParams.redirect_uri||Be,Fe==null?void 0:Fe.response_mode),Xe=this._authorizeUrl(Ze);return{nonce:Ke,code_verifier:Ge,scope:Ze.scope,audience:Ze.audience||"default",redirect_uri:Ze.redirect_uri,state:He,url:Xe}}async loginWithPopup(De,Fe){var Be;if(De=De||{},!(Fe=Fe||{}).popup&&(Fe.popup=(We=>{const Ze=window.screenX+(window.innerWidth-400)/2,Xe=window.screenY+(window.innerHeight-600)/2;return window.open(We,"auth0:authorize:popup",`left=${Ze},top=${Xe},width=400,height=600,resizable,scrollbars=yes,status=1`)})(""),!Fe.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const He=await this._prepareAuthorizeUrl(De.authorizationParams||{},{response_mode:"web_message"},window.location.origin);Fe.popup.location.href=He.url;const Ke=await(We=>new Promise((Ze,Xe)=>{let Je;const Ye=setInterval(()=>{We.popup&&We.popup.closed&&(clearInterval(Ye),clearTimeout(Qe),window.removeEventListener("message",Je,!1),Xe(new p$1(We.popup)))},1e3),Qe=setTimeout(()=>{clearInterval(Ye),Xe(new h$1(We.popup)),window.removeEventListener("message",Je,!1)},1e3*(We.timeoutInSeconds||60));Je=function(et){if(et.data&&et.data.type==="authorization_response"){if(clearTimeout(Qe),clearInterval(Ye),window.removeEventListener("message",Je,!1),We.popup.close(),et.data.response.error)return Xe(d$2.fromPayload(et.data.response));Ze(et.data.response)}},window.addEventListener("message",Je)}))(Object.assign(Object.assign({},Fe),{timeoutInSeconds:Fe.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(He.state!==Ke.state)throw new d$2("state_mismatch","Invalid state");const Ge=((Be=De.authorizationParams)===null||Be===void 0?void 0:Be.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:He.audience,scope:He.scope,code_verifier:He.code_verifier,grant_type:"authorization_code",code:Ke.code,redirect_uri:He.redirect_uri},{nonceIn:He.nonce,organization:Ge})}async getUser(){var De;const Fe=await this._getIdTokenFromCache();return(De=Fe==null?void 0:Fe.decodedToken)===null||De===void 0?void 0:De.user}async getIdTokenClaims(){var De;const Fe=await this._getIdTokenFromCache();return(De=Fe==null?void 0:Fe.decodedToken)===null||De===void 0?void 0:De.claims}async loginWithRedirect(De={}){var Fe;const Be=Q$2(De),{openUrl:He,fragment:Ke,appState:Ge}=Be,We=e$1(Be,["openUrl","fragment","appState"]),Ze=((Fe=We.authorizationParams)===null||Fe===void 0?void 0:Fe.organization)||this.options.authorizationParams.organization,Xe=await this._prepareAuthorizeUrl(We.authorizationParams||{}),{url:Je}=Xe,Ye=e$1(Xe,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},Ye),{appState:Ge}),Ze&&{organization:Ze}));const Qe=Ke?`${Je}#${Ke}`:Je;He?await He(Qe):window.location.assign(Qe)}async handleRedirectCallback(De=window.location.href){const Fe=De.split("?").slice(1);if(Fe.length===0)throw new Error("There are no query params available for parsing.");const{state:Be,code:He,error:Ke,error_description:Ge}=(Ye=>{Ye.indexOf("#")>-1&&(Ye=Ye.substring(0,Ye.indexOf("#")));const Qe=new URLSearchParams(Ye);return{state:Qe.get("state"),code:Qe.get("code")||void 0,error:Qe.get("error")||void 0,error_description:Qe.get("error_description")||void 0}})(Fe.join("")),We=this.transactionManager.get();if(!We)throw new d$2("missing_transaction","Invalid state");if(this.transactionManager.remove(),Ke)throw new u$4(Ke,Ge||Ke,Be,We.appState);if(!We.code_verifier||We.state&&We.state!==Be)throw new d$2("state_mismatch","Invalid state");const Ze=We.organization,Xe=We.nonce,Je=We.redirect_uri;return await this._requestToken(Object.assign({audience:We.audience,scope:We.scope,code_verifier:We.code_verifier,grant_type:"authorization_code",code:He},Je?{redirect_uri:Je}:{}),{nonceIn:Xe,organization:Ze}),{appState:We.appState}}async checkSession(De){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(De)}catch{}}async getTokenSilently(De={}){var Fe;const Be=Object.assign(Object.assign({cacheMode:"on"},De),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),De.authorizationParams),{scope:j$1(this.scope,(Fe=De.authorizationParams)===null||Fe===void 0?void 0:Fe.scope)})}),He=await((Ke,Ge)=>{let We=A$2[Ge];return We||(We=Ke().finally(()=>{delete A$2[Ge],We=null}),A$2[Ge]=We),We})(()=>this._getTokenSilently(Be),`${this.options.clientId}::${Be.authorizationParams.audience}::${Be.authorizationParams.scope}`);return De.detailedResponse?He:He==null?void 0:He.access_token}async _getTokenSilently(De){const{cacheMode:Fe}=De,Be=e$1(De,["cacheMode"]);if(Fe!=="off"){const He=await this._getEntryFromCache({scope:Be.authorizationParams.scope,audience:Be.authorizationParams.audience||"default",clientId:this.options.clientId});if(He)return He}if(Fe!=="cache-only"){if(!await(async(He,Ke=3)=>{for(let Ge=0;Ge<Ke;Ge++)if(await He())return!0;return!1})(()=>ee$1.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new l$3;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),Fe!=="off"){const Xe=await this._getEntryFromCache({scope:Be.authorizationParams.scope,audience:Be.authorizationParams.audience||"default",clientId:this.options.clientId});if(Xe)return Xe}const He=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(Be):await this._getTokenFromIFrame(Be),{id_token:Ke,access_token:Ge,oauthTokenScope:We,expires_in:Ze}=He;return Object.assign(Object.assign({id_token:Ke,access_token:Ge},We?{scope:We}:null),{expires_in:Ze})}finally{await ee$1.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}}async getTokenWithPopup(De={},Fe={}){var Be;const He=Object.assign(Object.assign({},De),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),De.authorizationParams),{scope:j$1(this.scope,(Be=De.authorizationParams)===null||Be===void 0?void 0:Be.scope)})});return Fe=Object.assign(Object.assign({},r$3),Fe),await this.loginWithPopup(He,Fe),(await this.cacheManager.get(new C$2({scope:He.authorizationParams.scope,audience:He.authorizationParams.audience||"default",clientId:this.options.clientId}))).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(De){De.clientId!==null?De.clientId=De.clientId||this.options.clientId:delete De.clientId;const Fe=De.logoutParams||{},{federated:Be}=Fe,He=e$1(Fe,["federated"]),Ke=Be?"&federated":"";return this._url(`/v2/logout?${v$1(Object.assign({clientId:De.clientId},He))}`)+Ke}async logout(De={}){const Fe=Q$2(De),{openUrl:Be}=Fe,He=e$1(Fe,["openUrl"]);De.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(De.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@");const Ke=this._buildLogoutUrl(He);Be?await Be(Ke):Be!==!1&&window.location.assign(Ke)}async _getTokenFromIFrame(De){const Fe=Object.assign(Object.assign({},De.authorizationParams),{prompt:"none"}),Be=this.cookieStorage.get(this.orgHintCookieName);Be&&!Fe.organization&&(Fe.organization=Be);const{url:He,state:Ke,nonce:Ge,code_verifier:We,redirect_uri:Ze,scope:Xe,audience:Je}=await this._prepareAuthorizeUrl(Fe,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new d$2("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const Ye=De.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,Qe=await((tt,ct,at=60)=>new Promise((ft,ut)=>{const ot=window.document.createElement("iframe");ot.setAttribute("width","0"),ot.setAttribute("height","0"),ot.style.display="none";const rt=()=>{window.document.body.contains(ot)&&(window.document.body.removeChild(ot),window.removeEventListener("message",lt,!1))};let lt;const pt=setTimeout(()=>{ut(new l$3),rt()},1e3*at);lt=function(gt){if(gt.origin!=ct||!gt.data||gt.data.type!=="authorization_response")return;const vt=gt.source;vt&&vt.close(),gt.data.response.error?ut(d$2.fromPayload(gt.data.response)):ft(gt.data.response),clearTimeout(pt),window.removeEventListener("message",lt,!1),setTimeout(rt,2e3)},window.addEventListener("message",lt,!1),window.document.body.appendChild(ot),ot.setAttribute("src",tt)}))(He,this.domainUrl,Ye);if(Ke!==Qe.state)throw new d$2("state_mismatch","Invalid state");const et=await this._requestToken(Object.assign(Object.assign({},De.authorizationParams),{code_verifier:We,code:Qe.code,grant_type:"authorization_code",redirect_uri:Ze,timeout:De.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:Ge,organization:Fe.organization});return Object.assign(Object.assign({},et),{scope:Xe,oauthTokenScope:et.scope,audience:Je})}catch(Ye){throw Ye.error==="login_required"&&this.logout({openUrl:!1}),Ye}}async _getTokenUsingRefreshToken(De){const Fe=await this.cacheManager.get(new C$2({scope:De.authorizationParams.scope,audience:De.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(Fe&&Fe.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(De);throw new f$2(De.authorizationParams.audience||"default",De.authorizationParams.scope)}const Be=De.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,He=typeof De.timeoutInSeconds=="number"?1e3*De.timeoutInSeconds:null;try{const Ke=await this._requestToken(Object.assign(Object.assign(Object.assign({},De.authorizationParams),{grant_type:"refresh_token",refresh_token:Fe&&Fe.refresh_token,redirect_uri:Be}),He&&{timeout:He}));return Object.assign(Object.assign({},Ke),{scope:De.authorizationParams.scope,oauthTokenScope:Ke.scope,audience:De.authorizationParams.audience||"default"})}catch(Ke){if((Ke.message.indexOf("Missing Refresh Token")>-1||Ke.message&&Ke.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(De);throw Ke}}async _saveEntryInCache(De){const{id_token:Fe,decodedToken:Be}=De,He=e$1(De,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:Fe,decodedToken:Be}),await this.cacheManager.setIdToken(this.options.clientId,De.id_token,De.decodedToken),await this.cacheManager.set(He)}async _getIdTokenFromCache(){const De=this.options.authorizationParams.audience||"default",Fe=await this.cacheManager.getIdToken(new C$2({clientId:this.options.clientId,audience:De,scope:this.scope})),Be=this.userCache.get("@@user@@");return Fe&&Fe.id_token===(Be==null?void 0:Be.id_token)?Be:(this.userCache.set("@@user@@",Fe),Fe)}async _getEntryFromCache({scope:De,audience:Fe,clientId:Be}){const He=await this.cacheManager.get(new C$2({scope:De,audience:Fe,clientId:Be}),60);if(He&&He.access_token){const{access_token:Ke,oauthTokenScope:Ge,expires_in:We}=He,Ze=await this._getIdTokenFromCache();return Ze&&Object.assign(Object.assign({id_token:Ze.id_token,access_token:Ke},Ge?{scope:Ge}:null),{expires_in:We})}}async _requestToken(De,Fe){const{nonceIn:Be,organization:He}=Fe||{},Ke=await T$1(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},De),this.worker),Ge=await this._verifyIdToken(Ke.id_token,Be,He);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},Ke),{decodedToken:Ge,scope:De.scope,audience:De.audience||"default"}),Ke.scope?{oauthTokenScope:Ke.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(He||Ge.claims.org_id),Object.assign(Object.assign({},Ke),{decodedToken:Ge})}};async function oe$1($e){const De=new te$1($e);return await De.checkSession(),De}var Events=($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))(Events||{});const BASE_URL_DOMAIN="sesamy.com",DEV_BASE_URL_DOMAIN="sesamy.dev",SHORTLINK_URL="https://sesa.my",CACHE_TIMESTAMP_KEY="sesamyCacheTimestamp",SESMAY_CONTENT_RELOAD_KEY="sesamyContentReload";function getBaseDomain($e,De){return`${$e}.${De==="dev"?DEV_BASE_URL_DOMAIN:BASE_URL_DOMAIN}`}function getBaseUrl($e,De){return`https://${getBaseDomain($e,De)}`}function getLanguage(){var Fe;return(Fe=(document.documentElement.getAttribute("lang")??navigator.language??"en").split("-")[0])==null?void 0:Fe.toLocaleLowerCase()}/*!
5
5
  *
6
6
  * detectIncognito v1.3.7
7
7
  *
@@ -31,8 +31,8 @@
31
31
  *
32
32
  * Please keep this comment intact in order to properly abide by the MIT License.
33
33
  *
34
- **/var __webpack_require__={d:($e,De)=>{for(var Fe in De)__webpack_require__.o(De,Fe)&&!__webpack_require__.o($e,Fe)&&Object.defineProperty($e,Fe,{enumerable:!0,get:De[Fe]})},o:($e,De)=>Object.prototype.hasOwnProperty.call($e,De)},__webpack_exports__={};__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__,k:()=>detectIncognito});var __awaiter=function($e,De,Fe,Be){return new(Fe||(Fe=Promise))(function(He,Ke){function Ge(Xe){try{Ze(Be.next(Xe))}catch(Je){Ke(Je)}}function We(Xe){try{Ze(Be.throw(Xe))}catch(Je){Ke(Je)}}function Ze(Xe){var Je;Xe.done?He(Xe.value):(Je=Xe.value,Je instanceof Fe?Je:new Fe(function(Ye){Ye(Je)})).then(Ge,We)}Ze((Be=Be.apply($e,[])).next())})},__generator=function($e,De){var Fe,Be,He,Ke,Ge={label:0,sent:function(){if(1&He[0])throw He[1];return He[1]},trys:[],ops:[]};return Ke={next:We(0),throw:We(1),return:We(2)},typeof Symbol=="function"&&(Ke[Symbol.iterator]=function(){return this}),Ke;function We(Ze){return function(Xe){return function(Je){if(Fe)throw new TypeError("Generator is already executing.");for(;Ke&&(Ke=0,Je[0]&&(Ge=0)),Ge;)try{if(Fe=1,Be&&(He=2&Je[0]?Be.return:Je[0]?Be.throw||((He=Be.return)&&He.call(Be),0):Be.next)&&!(He=He.call(Be,Je[1])).done)return He;switch(Be=0,He&&(Je=[2&Je[0],He.value]),Je[0]){case 0:case 1:He=Je;break;case 4:return Ge.label++,{value:Je[1],done:!1};case 5:Ge.label++,Be=Je[1],Je=[0];continue;case 7:Je=Ge.ops.pop(),Ge.trys.pop();continue;default:if(He=Ge.trys,!((He=He.length>0&&He[He.length-1])||Je[0]!==6&&Je[0]!==2)){Ge=0;continue}if(Je[0]===3&&(!He||Je[1]>He[0]&&Je[1]<He[3])){Ge.label=Je[1];break}if(Je[0]===6&&Ge.label<He[1]){Ge.label=He[1],He=Je;break}if(He&&Ge.label<He[2]){Ge.label=He[2],Ge.ops.push(Je);break}He[2]&&Ge.ops.pop(),Ge.trys.pop();continue}Je=De.call($e,Ge)}catch(Ye){Je=[6,Ye],Be=0}finally{Fe=He=0}if(5&Je[0])throw Je[1];return{value:Je[0]?Je[1]:void 0,done:!0}}([Ze,Xe])}}};function detectIncognito(){return __awaiter(this,void 0,Promise,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,new Promise(function(resolve,reject){var browserName="Unknown";function __callback($e){resolve({isPrivate:$e,browserName})}function identifyChromium(){var $e=navigator.userAgent;return $e.match(/Chrome/)?navigator.brave!==void 0?"Brave":$e.match(/Edg/)?"Edge":$e.match(/OPR/)?"Opera":"Chrome":"Chromium"}function assertEvalToString($e){return $e===eval.toString().length}function feid(){var toFixedEngineID=0;try{eval("(-1).toFixed(-1);")}catch($e){toFixedEngineID=$e.message.length}return toFixedEngineID}function isSafari(){return feid()===44}function isChrome(){return feid()===51}function isFirefox(){return feid()===25}function isMSIE(){return navigator.msSaveBlob!==void 0&&assertEvalToString(39)}function newSafariTest(){var $e=String(Math.random());try{window.indexedDB.open($e,1).onupgradeneeded=function(De){var Fe,Be,He=(Fe=De.target)===null||Fe===void 0?void 0:Fe.result;try{He.createObjectStore("test",{autoIncrement:!0}).put(new Blob),__callback(!1)}catch(Ge){var Ke=Ge;return Ge instanceof Error&&(Ke=(Be=Ge.message)!==null&&Be!==void 0?Be:Ge),typeof Ke!="string"?void __callback(!1):void __callback(Ke.includes("BlobURLs are not yet supported"))}finally{He.close(),window.indexedDB.deleteDatabase($e)}}}catch{__callback(!1)}}function oldSafariTest(){var $e=window.openDatabase,De=window.localStorage;try{$e(null,null,null,null)}catch{return void __callback(!0)}try{De.setItem("test","1"),De.removeItem("test")}catch{return void __callback(!0)}__callback(!1)}function safariPrivateTest(){navigator.maxTouchPoints!==void 0?newSafariTest():oldSafariTest()}function getQuotaLimit(){var $e=window;return $e.performance!==void 0&&$e.performance.memory!==void 0&&$e.performance.memory.jsHeapSizeLimit!==void 0?performance.memory.jsHeapSizeLimit:1073741824}function storageQuotaChromePrivateTest(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function($e,De){__callback(Math.round(De/1048576)<2*Math.round(getQuotaLimit()/1048576))},function($e){reject(new Error("detectIncognito somehow failed to query storage quota: "+$e.message))})}function oldChromePrivateTest(){(0,window.webkitRequestFileSystem)(0,1,function(){__callback(!1)},function(){__callback(!0)})}function chromePrivateTest(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?storageQuotaChromePrivateTest():oldChromePrivateTest()}function firefoxPrivateTest(){__callback(navigator.serviceWorker===void 0)}function msiePrivateTest(){__callback(window.indexedDB===void 0)}function main(){isSafari()?(browserName="Safari",safariPrivateTest()):isChrome()?(browserName=identifyChromium(),chromePrivateTest()):isFirefox()?(browserName="Firefox",firefoxPrivateTest()):isMSIE()?(browserName="Internet Explorer",msiePrivateTest()):reject(new Error("detectIncognito cannot determine the browser"))}main()})];case 1:return[2,_a.sent()]}})})}typeof window<"u"&&(window.detectIncognito=detectIncognito);const __WEBPACK_DEFAULT_EXPORT__=detectIncognito;__webpack_exports__.A;var __webpack_exports__detectIncognito=__webpack_exports__.k;async function isIncognito(){try{const{isPrivate:$e}=await __webpack_exports__detectIncognito();return $e}catch{return!1}}function isBrowser(){return typeof window<"u"}const STORAGE_KEY="sesamyFlags";async function saveFlags($e){try{localStorage.setItem(STORAGE_KEY,JSON.stringify($e))}catch{log("Failed to save flags to localStorage")}}async function setFlag($e,De){const Fe=await listFlags();Fe[$e]=De,await saveFlags(Fe)}async function getFlag($e){return(await listFlags())[$e]}async function deleteFlag($e){const De=await listFlags();$e in De&&(delete De[$e],await saveFlags(De))}async function listFlags(){try{const $e=localStorage.getItem(STORAGE_KEY);return $e?JSON.parse($e):{}}catch{return{}}}let auth0Client,organization,initialized=!1,loginInProgress=!1;isBrowser()&&window.addEventListener("pageshow",()=>{loginInProgress=!1});const ACCESS_TOKEN_KEY="sesamyAccessToken",REFRESH_TOKEN_KEY="sesamyRefreshToken";async function waitForInit(){return initialized?!0:new Promise(($e,De)=>{const Fe=setTimeout(()=>{initialized?$e(!0):De(new Error("Initialization failed: Timeout"))},2e3);window.addEventListener(Events.AUTH_INITIALIZED,()=>{clearTimeout(Fe),$e(!0)})})}async function refreshLocalAccessToken($e){if(!$e)return null;const De=localStorage.getItem(REFRESH_TOKEN_KEY);if(!De)return log("No refresh token found in localstorage"),null;const Fe=new URLSearchParams;Fe.set("client_id",$e.iss),Fe.set("refresh_token",De),Fe.set("grant_type","refresh_token");const Be=new URL($e.iss);Be.pathname="/oauth/token",Be.searchParams.set("user_id",$e.sub);try{const He=await fetch(Be.href,{body:Fe.toString(),method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"}});if(!He.ok)throw localStorage.removeItem(REFRESH_TOKEN_KEY),new Error("Renew token failed");const Ke=await He.json();return localStorage.setItem(REFRESH_TOKEN_KEY,Ke.refresh_token),localStorage.setItem(ACCESS_TOKEN_KEY,Ke.access_token),Ke.access_token}catch{logout()}}async function getLocalStorageAccessToken(){const $e=localStorage.getItem(ACCESS_TOKEN_KEY);if(!$e)return null;const De=getPayloadFromJwt($e);if(!De||!De.exp||De.exp<new Date().getTime()/1e3){const Fe=await refreshLocalAccessToken(De);if(Fe)return Fe;localStorage.removeItem(ACCESS_TOKEN_KEY)}return $e}function getTopLevelDomain($e){try{const De=new URL($e).hostname,Fe=De.split(".");return Fe.length>1?Fe.slice(-2).join("."):De}catch{return null}}async function init$3($e){if($e.enabled===!1)return;organization=$e.organization;const Fe=await getFlag("newAuth")&&$e.domain?$e.domain:getBaseUrl("token",$e.environment),Be={domain:Fe,clientId:$e.clientId,useCookiesForTransactions:!0};if(getTopLevelDomain(window.location.href)!==getTopLevelDomain(Fe)&&(Be.cacheLocation="localstorage",Be.useRefreshTokens=!0),log(`Initializing auth0 client: ${JSON.stringify(Be)}`),auth0Client=await oe$1(Be),window.location.search.includes("code=")){log("Code found in URL, handling redirect");try{const Ge=await auth0Client.handleRedirectCallback();log(`Login result: ${JSON.stringify(Ge)}`);const We=await auth0Client.getUser();if(!We)throw log("No user found"),new Error("No user found");log(`User found ${JSON.stringify(We)}`),triggerEvent(Events.AUTHENTICATED,We),log("Rewrite url")}catch(Ge){alert("There was an error logging in"),console.error(Ge)}const He=new URL(location.href),Ke=He.searchParams;Ke.delete("code"),Ke.delete("state"),He.search=Ke.toString(),window.history.replaceState({},document.title,He.toString())}initialized=!0,triggerEvent(Events.AUTH_INITIALIZED,{})}async function isAuthenticated(){return await waitForInit(),await getLocalStorageAccessToken()?!0:auth0Client?auth0Client.isAuthenticated():!1}async function getUser(){return await waitForInit(),await getLocalStorageAccessToken()?(log("Using local user"),{sub:"local",name:"Local User"}):auth0Client?auth0Client.getUser():null}async function loginWithRedirect($e){if(loginInProgress){log("Login already in progress");return}if(loginInProgress=!0,await waitForInit(),localStorage.removeItem(ACCESS_TOKEN_KEY),!auth0Client)throw new Error("Auth0 client not initialized");const De=($e==null?void 0:$e.authorizationParams)||{};return await isIncognito()&&navigator.userAgent.includes("Safari")&&navigator.userAgent.includes("iPhone")&&sessionStorage.setItem(SESMAY_CONTENT_RELOAD_KEY,"true"),auth0Client.loginWithRedirect({...$e,authorizationParams:{organization,redirect_uri:window.location.href,ui_locales:getLanguage(),...De}})}async function getTokenSilently($e=!0,De=!1){await waitForInit();const Fe=await getLocalStorageAccessToken();if(Fe)return Fe;try{if(!auth0Client)return log("Auth client not initialized"),null;let Be=await auth0Client.getTokenSilently();const He=getPayloadFromJwt(Be);return De&&(He!=null&&He.exp)&&He.exp+3600<new Date().getTime()/1e3&&(Be=await auth0Client.getTokenSilently({cacheMode:De?"off":"on"})),Be}catch(Be){const He=Be;if(log(`Failed to get token silently: ${He.message}`),He.message==="Invalid refresh token"&&await logout(),$e)throw Be;return null}}async function logout($e={}){if(await waitForInit(),localStorage.removeItem(ACCESS_TOKEN_KEY),triggerEvent(Events.LOGOUT,{}),!!auth0Client)return log(`Logout with options: ${JSON.stringify($e)}`),auth0Client.logout({...$e,logoutParams:{returnTo:window.location.href,...$e.logoutParams}})}function getPayloadFromJwt($e){const De=$e.split(".");if(De.length!==3)return null;const Be=De[1].replace(/-/g,"+").replace(/_/g,"/"),He=decodeURIComponent(atob(Be).split("").map(function(Ke){return"%"+("00"+Ke.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(He)}async function setToken($e){const De=getPayloadFromJwt($e);if(!De||!De.exp||De.exp<new Date().getTime()/1e3)throw new Error("Invalid token");log("Set token"),localStorage.setItem(ACCESS_TOKEN_KEY,$e),triggerEvent(Events.AUTHENTICATED,De)}const defaultSkip=($e,De)=>De.skipDedupe||De.method!=="GET",defaultKey=($e,De)=>De.method+"@"+$e,defaultResolver=$e=>$e.clone(),dedupe=({skip:$e=defaultSkip,key:De=defaultKey,resolver:Fe=defaultResolver}={})=>{const Be=new Map;return He=>(Ke,Ge)=>{if($e(Ke,Ge))return He(Ke,Ge);const We=De(Ke,Ge);if(!Be.has(We))Be.set(We,[]);else return new Promise((Ze,Xe)=>{Be.get(We).push([Ze,Xe])});try{return He(Ke,Ge).then(Ze=>(Be.get(We).forEach(([Xe])=>Xe(Fe(Ze))),Be.delete(We),Ze)).catch(Ze=>{throw Be.get(We).forEach(([,Xe])=>Xe(Ze)),Be.delete(We),Ze})}catch(Ze){return Be.delete(We),Promise.reject(Ze)}}},defaultDelayRamp=($e,De)=>$e*De,defaultUntil=$e=>$e&&$e.ok,retry=({delayTimer:$e=500,delayRamp:De=defaultDelayRamp,maxAttempts:Fe=10,until:Be=defaultUntil,onRetry:He=null,retryOnNetworkError:Ke=!1,resolveWithLatestResponse:Ge=!1,skip:We}={})=>Ze=>(Xe,Je)=>{let Ye=0;if(We&&We(Xe,Je))return Ze(Xe,Je);const Qe=(et,tt)=>Promise.resolve(Be(et,tt)).then(ct=>ct?et&&Ge?et:tt?Promise.reject(tt):et:(Ye++,!Fe||Ye<=Fe?new Promise(at=>{const ft=De($e,Ye);setTimeout(()=>{typeof He=="function"?Promise.resolve(He({response:et,error:tt,url:Xe,options:Je})).then((ut={})=>{var ot,rt;at(Ze((ot=ut&&ut.url)!==null&&ot!==void 0?ot:Xe,(rt=ut&&ut.options)!==null&&rt!==void 0?rt:Je))}):at(Ze(Xe,Je))},ft)}).then(Qe).catch(at=>{if(!Ke)throw at;return Qe(null,at)}):et&&Ge?et:Promise.reject(tt||new Error("Number of attempts exceeded."))));return Ze(Xe,Je).then(Qe).catch(et=>{if(!Ke)throw et;return Qe(null,et)})},JSON_MIME="application/json",CONTENT_TYPE_HEADER="Content-Type",FETCH_ERROR=Symbol(),CATCHER_FALLBACK=Symbol();function extractContentType($e={}){var De;return(De=Object.entries($e).find(([Fe])=>Fe.toLowerCase()===CONTENT_TYPE_HEADER.toLowerCase()))===null||De===void 0?void 0:De[1]}function isLikelyJsonMime($e){return/^application\/.*json.*/.test($e)}const mix=function($e,De,Fe=!1){return Object.entries(De).reduce((Be,[He,Ke])=>{const Ge=$e[He];return Array.isArray(Ge)&&Array.isArray(Ke)?Be[He]=Fe?[...Ge,...Ke]:Ke:typeof Ge=="object"&&typeof Ke=="object"?Be[He]=mix(Ge,Ke,Fe):Be[He]=Ke,Be},{...$e})},config={options:{},errorType:"text",polyfills:{},polyfill($e,De=!0,Fe=!1,...Be){const He=this.polyfills[$e]||(typeof self<"u"?self[$e]:null)||(typeof global<"u"?global[$e]:null);if(De&&!He)throw new Error($e+" is not defined");return Fe&&He?new He(...Be):He}};function setOptions($e,De=!1){config.options=De?$e:mix(config.options,$e)}function setPolyfills($e,De=!1){config.polyfills=De?$e:mix(config.polyfills,$e)}function setErrorType($e){config.errorType=$e}const middlewareHelper=$e=>De=>$e.reduceRight((Fe,Be)=>Be(Fe),De)||De;class WretchError extends Error{}const resolver=$e=>{const De=Object.create(null);$e=$e._addons.reduce((ot,rt)=>rt.beforeRequest&&rt.beforeRequest(ot,$e._options,De)||ot,$e);const{_url:Fe,_options:Be,_config:He,_catchers:Ke,_resolvers:Ge,_middlewares:We,_addons:Ze}=$e,Xe=new Map(Ke),Je=mix(He.options,Be);let Ye=Fe;const Qe=middlewareHelper(We)((ot,rt)=>(Ye=ot,He.polyfill("fetch")(ot,rt)))(Fe,Je),et=new Error,tt=Qe.catch(ot=>{throw{[FETCH_ERROR]:ot}}).then(ot=>{var rt;if(!ot.ok){const lt=new WretchError;if(lt.cause=et,lt.stack=lt.stack+`
35
- CAUSE: `+et.stack,lt.response=ot,lt.status=ot.status,lt.url=Ye,ot.type==="opaque")throw lt;const pt=He.errorType==="json"||((rt=ot.headers.get("Content-Type"))===null||rt===void 0?void 0:rt.split(";")[0])==="application/json";return(He.errorType?pt?ot.text():ot[He.errorType]():Promise.resolve(ot.body)).then(vt=>{throw lt.message=typeof vt=="string"?vt:ot.statusText,vt&&(pt&&typeof vt=="string"?(lt.text=vt,lt.json=JSON.parse(vt)):lt[He.errorType]=vt),lt})}return ot}),ct=ot=>ot.catch(rt=>{const lt=Object.prototype.hasOwnProperty.call(rt,FETCH_ERROR),pt=lt?rt[FETCH_ERROR]:rt,gt=(pt==null?void 0:pt.status)&&Xe.get(pt.status)||Xe.get(pt==null?void 0:pt.name)||lt&&Xe.has(FETCH_ERROR)&&Xe.get(FETCH_ERROR);if(gt)return gt(pt,$e);const vt=Xe.get(CATCHER_FALLBACK);if(vt)return vt(pt,$e);throw pt}),at=ot=>rt=>ct(ot?tt.then(lt=>lt&&lt[ot]()).then(lt=>rt?rt(lt):lt):tt.then(lt=>rt?rt(lt):lt)),ft={_wretchReq:$e,_fetchReq:Qe,_sharedState:De,res:at(null),json:at("json"),blob:at("blob"),formData:at("formData"),arrayBuffer:at("arrayBuffer"),text:at("text"),error(ot,rt){return Xe.set(ot,rt),this},badRequest(ot){return this.error(400,ot)},unauthorized(ot){return this.error(401,ot)},forbidden(ot){return this.error(403,ot)},notFound(ot){return this.error(404,ot)},timeout(ot){return this.error(408,ot)},internalError(ot){return this.error(500,ot)},fetchError(ot){return this.error(FETCH_ERROR,ot)}},ut=Ze.reduce((ot,rt)=>({...ot,...typeof rt.resolver=="function"?rt.resolver(ot):rt.resolver}),ft);return Ge.reduce((ot,rt)=>rt(ot,$e),ut)},core={_url:"",_options:{},_config:config,_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,De=!1){return{...this,_config:{...this._config,polyfills:De?$e:mix(this._config.polyfills,$e)}}},url($e,De=!1){if(De)return{...this,_url:$e};const Fe=this._url.split("?");return{...this,_url:Fe.length>1?Fe[0]+$e+"?"+Fe[1]:this._url+$e}},options($e,De=!1){return{...this,_options:De?$e:mix(this._options,$e)}},headers($e){const De=$e?Array.isArray($e)?Object.fromEntries($e):"entries"in $e?Object.fromEntries($e.entries()):$e:{};return{...this,_options:mix(this._options,{headers:De})}},accept($e){return this.headers({Accept:$e})},content($e){return this.headers({[CONTENT_TYPE_HEADER]:$e})},auth($e){return this.headers({Authorization:$e})},catcher($e,De){const Fe=new Map(this._catchers);return Fe.set($e,De),{...this,_catchers:Fe}},catcherFallback($e){return this.catcher(CATCHER_FALLBACK,$e)},resolve($e,De=!1){return{...this,_resolvers:De?[$e]:[...this._resolvers,$e]}},defer($e,De=!1){return{...this,_deferred:De?[$e]:[...this._deferred,$e]}},middlewares($e,De=!1){return{...this,_middlewares:De?$e:[...this._middlewares,...$e]}},fetch($e=this._options.method,De="",Fe=null){let Be=this.url(De).options({method:$e});const He=extractContentType(Be._options.headers),Ke=this._config.polyfill("FormData",!1),Ge=typeof Fe=="object"&&!(Ke&&Fe instanceof Ke)&&(!Be._options.headers||!He||isLikelyJsonMime(He));return Be=Fe?Ge?Be.json(Fe,He):Be.body(Fe):Be,resolver(Be._deferred.reduce((We,Ze)=>Ze(We,We._url,We._options),Be))},get($e=""){return this.fetch("GET",$e)},delete($e=""){return this.fetch("DELETE",$e)},put($e,De=""){return this.fetch("PUT",De,$e)},post($e,De=""){return this.fetch("POST",De,$e)},patch($e,De=""){return this.fetch("PATCH",De,$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,De){const Fe=extractContentType(this._options.headers);return this.content(De||isLikelyJsonMime(Fe)&&Fe||JSON_MIME).body(JSON.stringify($e))}};function factory($e="",De={}){return{...core,_url:$e,_options:De}}factory.default=factory;factory.options=setOptions;factory.errorType=setErrorType;factory.polyfills=setPolyfills;factory.WretchError=WretchError;function clearCache(){return sessionStorage.removeItem(CACHE_TIMESTAMP_KEY),log("Cache cleared"),triggerEvent(Events.CLEAR_CACHE,{}),"Cache cleared"}function isValidHttpUrl($e){let De;try{De=new URL($e)}catch{return!1}return De.protocol==="http:"||De.protocol==="https:"}function decodeItemSrc($e,De){if(isValidHttpUrl($e))return{itemSrc:$e};const[Fe,Be,He]=$e.split(":");return{sku:`${Fe}:${Be}`,purchaseOption:De||He}}function removeTrailingSlash($e){return $e.endsWith("/")?$e.slice(0,-1):$e}function compareUrlWithoutHash($e,De){if(!isValidHttpUrl($e)||!isValidHttpUrl(De))return!1;const Fe=new URL($e),Be=new URL(De);return Fe.origin===Be.origin&&removeTrailingSlash(Fe.pathname)===removeTrailingSlash(Be.pathname)}function generateCheckoutLink($e,De,Fe){const Be=new URL(`${getBaseUrl("checkout3",$e.environment)}`);if(De.language&&Be.searchParams.set("lang",De.language),De.sku)Be.searchParams.set("sku",De.sku),De.purchaseOptionId&&Be.searchParams.set("po-id",De.purchaseOptionId);else if(De.itemSrc){const{sku:We,purchaseOption:Ze,itemSrc:Xe}=decodeItemSrc(De.itemSrc,De.purchaseOptionId);Xe&&Be.searchParams.set("url",Xe),We&&Be.searchParams.set("sku",We),Ze&&Be.searchParams.set("po-id",Ze)}De.email&&Be.searchParams.set("email",De.email),De.business&&Be.searchParams.set("business","true"),De.currency&&Be.searchParams.set("currency",De.currency),De.price&&Be.searchParams.set("price",De.price.toString()),De.discountCode&&Be.searchParams.set("discount-code",De.discountCode),De.attributionItemSrc?Be.searchParams.set("itemSrc",De.attributionItemSrc):Fe.itemSrc&&Be.searchParams.set("itemSrc",Fe.itemSrc),De.attributionPublisherContentId?Be.searchParams.set("publisherContentId",De.attributionPublisherContentId):Fe.publisherContentId&&Be.searchParams.set("publisherContentId",Fe.publisherContentId),De.utmSource?Be.searchParams.set("utm_source",De.utmSource):Fe.utmSource&&Be.searchParams.set("utm_source",Fe.utmSource),De.utmMedium?Be.searchParams.set("utm_medium",De.utmMedium):Fe.utmMedium&&Be.searchParams.set("utm_medium",Fe.utmMedium),De.utmCampaign?Be.searchParams.set("utm_campaign",De.utmCampaign):Fe.utmCampaign&&Be.searchParams.set("utm_campaign",Fe.utmCampaign),De.utmTerm?Be.searchParams.set("utm_term",De.utmTerm):Fe.utmTerm&&Be.searchParams.set("utm_term",Fe.utmTerm),De.utmContent?Be.searchParams.set("utm_content",De.utmContent):Fe.utmContent&&Be.searchParams.set("utm_content",Fe.utmContent);const He=["_ga","_gid","_fbp","_fbc"];document.cookie.split(";").map(We=>{const[Ze,Xe]=We.trim().split("=");return{key:Ze,value:Xe}}).filter(We=>He.some(Ze=>Ze===We.key)).forEach(We=>{Be.searchParams.append(We.key,We.value)});const Ge=new URL(De.redirectUrl||window.location.href);return Ge.searchParams.set("force-refetch-entitlements","true"),De.itemSrc&&Ge.searchParams.set("sesamy-purchase",De.itemSrc),Be.searchParams.set("redirect-url",Ge.toString()),De.paymentMethodsFilter&&Be.searchParams.set("paymentmethods-filter",De.paymentMethodsFilter.flatMap(({provider:We,methods:Ze})=>Ze?Ze.map(Xe=>`${We}|${Xe}`):We).join(",")),Be}const SIGNED_URL_KEY="sesamySignedURLs";function getSignedLinks(){const $e=sessionStorage.getItem(SIGNED_URL_KEY);return $e?JSON.parse($e):[]}function addSignedLink($e){const De=getSignedLinks();De.push($e),log(`Adding signed URL: ${$e}`),sessionStorage.setItem(SIGNED_URL_KEY,JSON.stringify(De))}function removeUndefinedValues($e){const De={};return Object.keys($e).forEach(Fe=>{const Be=$e[Fe];Be!=null&&(De[Fe]=Be.toString())}),De}const ATTRIBUTION_KEY="sesamyAttribution";function parseFromLocalStorage($e){const De=localStorage.getItem($e);if(!De)return null;try{return JSON.parse(De).value}catch{return console.error(`Failed to parse ${$e}`),null}}function resetUtmTags($e){return Object.keys($e).find(De=>De.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...$e}:$e}function getAttribution(){return parseFromLocalStorage(ATTRIBUTION_KEY)||{}}function setAttribution($e){if($e===null)localStorage.removeItem(ATTRIBUTION_KEY);else{log(`Setting attribution ${JSON.stringify($e)}`);const De=getAttribution()??{},Fe=removeUndefinedValues({...De,...resetUtmTags($e)});localStorage.setItem(ATTRIBUTION_KEY,JSON.stringify({value:Fe}))}}function createApi($e){const De=getBaseUrl("api2",$e.environment),Fe=st=>async(dt,$t)=>{let Ct=sessionStorage.getItem(CACHE_TIMESTAMP_KEY);Ct||(Ct=Date.now().toString(),sessionStorage.setItem(CACHE_TIMESTAMP_KEY,Ct));const _t={...$t,headers:{...$t.headers,"Cache-Timestamp":Ct}};return st(dt,_t)},Be=(st=!0)=>dt=>async($t,Ct)=>{let _t=null;if(_t=await getTokenSilently(st),!_t){if(st)throw new Error("No access token available");return dt($t,Ct)}const Mt={...Ct,headers:{...Ct.headers,..._t?{Authorization:`Bearer ${_t}`}:{}}};return dt($t,Mt)},He=st=>(dt,$t)=>{if($t.headers.Authorization)return st(dt,$t);const Ct=localStorage.getItem("__anon_id"),_t=btoa(`${$e.clientId}|${Ct}:`),Mt={...$t,headers:{...$t.headers,Authorization:`Basic ${_t}`}};return st(dt,Mt)},Ke=factory(De).headers({"Content-Type":"application/json"}).middlewares([Fe,Be(),dedupe(),retry({delayTimer:1e3,delayRamp:(st,dt)=>st*dt,maxAttempts:3,until:st=>!!(st&&(st.ok||st.status>=400&&st.status<500)),retryOnNetworkError:!1})]),Ge=factory(De).headers({"Content-Type":"application/json"}).middlewares([Fe,Be(!1),He,dedupe(),retry({delayTimer:1e3,delayRamp:(st,dt)=>st*dt,maxAttempts:3,until:st=>!!(st&&(st.ok||st.status>=400&&st.status<500)),retryOnNetworkError:!1})]);async function We(st={}){const{waitForEntitlementAfter:dt,includeSignedLinks:$t=!0}=st,Ct=dt?`?wait-for-entitlement-after=${dt.toISOString()}`:"",_t=await isAuthenticated()?await Ke.get(`/entitlements${Ct}`).json():[];return $t&&_t.push(...getSignedLinks()),_t}async function Ze(st,dt=[]){const $t=await We();return $t==null?void 0:$t.find(_t=>{const{sku:Mt,purchaseOption:Ht}=decodeItemSrc(st);let Gt="sku"in _t&&Mt===_t.sku;Gt&&Ht&&"purchaseOptionId"in _t&&(Gt=Ht===_t.purchaseOptionId);const tr=compareUrlWithoutHash(st,_t.url),rr=dt.some(nr=>compareUrlWithoutHash(nr,_t.url));return Gt||tr||rr})}async function Xe(st){const dt=await Ke.get("/entitlements").json();return dt==null?void 0:dt.find($t=>$t.id===st)}async function Je(st){return Ke.get(`/entitlements/${encodeURIComponent(st)}/access`).json()}async function Ye(st,dt,$t){const Ct=new URL(getBaseUrl("api2",$e.environment));return Ct.pathname="/proxy",Ct.searchParams.set("url",dt),$t&&Ct.searchParams.set("selector",$t),factory(Ct.toString()).headers({Authorization:`Bearer ${st}`}).get().text()}async function Qe(st){return await isAuthenticated()?await Ke.get(`/fulfillments?sku=${encodeURIComponent(st)}`).json():[]}async function et(){return Ke.get("/contracts").json()}async function tt(st){const dt=await Ke.get("/contracts").json();return dt==null?void 0:dt.find($t=>$t.id===st)}async function ct(st){const dt=await Ke.post({},`/contracts/${encodeURIComponent(st)}/cancel`).res();return clearCache(),dt.ok}async function at(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),Ke.get("/subscriptions").json()}async function ft(){return Ke.get("/bills").json()}async function ut(st){const dt=await Ke.get("/bills").json();return dt==null?void 0:dt.find($t=>$t.id===st)}async function ot(){return Ke.get("/transactions").json()}async function rt(st){const dt=await Ke.get("/transactions").json();return dt==null?void 0:dt.find($t=>$t.id===st)}async function lt(st,dt){const $t=await Ke.url(`/user-metadata/${encodeURIComponent(st)}`).put(dt).json();return triggerEvent(Events.USER_ATTRIBUTE_CHANGED,{}),clearCache(),$t}async function pt(st){const dt=await Ke.url(`/user-metadata/${encodeURIComponent(st)}`).delete().res();return clearCache(),dt.ok}async function gt(st){return(await Ke.url(`/user-metadata/${encodeURIComponent(st)}`).get().json())[st]}async function vt(){return await Ke.url("/user-metadata").get().json()}async function Et(){return await Ke.url("/tags").get().json()}async function Pt(st){const dt=await Ke.url(`/tags/${encodeURIComponent(st)}`).delete().res();return clearCache(),dt.ok}async function Nt(st){const dt=await Ke.url("/tags").post(encodeURIComponent(st)).res();return triggerEvent(Events.USER_ATTRIBUTE_CHANGED,{}),clearCache(),dt.ok}async function yt(st){return(await Ge.url("/tallies").get().json())[st]}async function It(){return await Ge.url("/tallies").get().json()}async function Rt(st){const dt=await Ge.url(`/tallies/${st}`).delete().res();return clearCache(),dt.ok}async function mt(st,dt){return await Ge.url(`/tallies/${encodeURIComponent(st)}/push`).post(dt).json()}async function At(st){return await Ke.url(`/products/${encodeURIComponent(st)}`).get().json()}async function Ut(){return await getTokenSilently(!1)?await Ke.url("/profile").get().json():null}async function xt(st){const dt=await Ke.url("/profile").patch(st).res();return clearCache(),dt.ok}async function nt(){return await Ke.url("/payment-issues").get().json()}async function it(){return(await Ke.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function ht(){return(await Ke.url("/profile/unlink-spotify").post().res()).ok}async function St(st){const dt=await getTokenSilently(!1);if(!dt)throw new Error("No access token available");const $t=new URL(`${getBaseUrl("access-sync",$e.environment)}/spotify/sesamy-callback`);$t.searchParams.set("access_token",dt),$t.searchParams.set("state",st),window.location.href=$t.toString()}async function bt(st){const dt=await Ke.url(`/products/${encodeURIComponent(st)}/auto-onboard`).post().json();return dt.length&&clearCache(),dt}async function wt(st,dt=3600){const{shortlink:$t}=await factory(SHORTLINK_URL).post({url:st,ttl:dt}).json();return $t}async function kt(st){const dt=await getTokenSilently(!1,!0);let $t;const Ct=st.language||getLanguage(),_t=getAttribution();switch(st.target){case"account":$t=new URL(`${getBaseUrl("account",$e.environment)}/${encodeURIComponent(st.language||Ct)}/subscriptions/${encodeURIComponent($e.clientId)}`),$t.searchParams.set("sesamy-redirect-url",st.redirectUrl||window.location.href);break;case"change-payment":$t=new URL(`${getBaseUrl("account",$e.environment)}/${encodeURIComponent(st.language||Ct)}/subscriptions/${encodeURIComponent($e.clientId)}/${encodeURIComponent(st.contractId)}/change-payment-method`),$t.searchParams.set("sesamy-redirect-url",st.redirectUrl||window.location.href);break;case"change-plan":$t=new URL(`${getBaseUrl("account",$e.environment)}/${encodeURIComponent(st.language||Ct)}/subscriptions/${encodeURIComponent($e.clientId)}/${encodeURIComponent(st.contractId)}/edit-plan`),$t.searchParams.set("sesamy-redirect-url",st.redirectUrl||window.location.href);break;case"consume":$t=new URL(`${getBaseUrl("consume",$e.environment)}/${encodeURIComponent(st.language||Ct)}/@${encodeURIComponent($e.clientId)}/${encodeURIComponent(st.sku)}`),st.episodeId?$t.href+=`/${st.episodeId}`:$t.href+="/listen",$t.searchParams.set("sesamy-redirect-url",st.redirectUrl||window.location.href);break;case"checkout":$t=generateCheckoutLink($e,{language:Ct,...st},_t);break;default:throw new Error("Invalid target")}return dt&&($t.hash=`#access_token=${dt}`),st.shorten?wt($t.href,st.ttl):$t.href}async function Tt(st){const dt=getAttribution(),$t=["_ga","_gid","_fbp","_fbc"];return document.cookie.split(";").forEach(_t=>{const Mt=dt,[Ht,Gt]=_t.trim().split("=");$t.includes(Ht)&&!Mt[Ht]&&(Mt[Ht]=Gt)}),(await Ge.url("/checkouts").post({language:getLanguage(),...st,attribution:{...dt,...st.attribution},vendorId:$e.clientId})).json()}async function Lt(st,dt){return(await Ge.url(`/checkouts/${st}`).patch(dt)).json()}async function Ot(st){return(await Ge.url(`/checkouts/${st}`).get()).json()}async function jt(st){return(await Ge.url(`/paywalls/${st}`).get()).json()}async function Ft(){return(await Ge.url("/vendor").get()).json()}async function Bt(){return(await Ke.url("/vendors").get()).json()}async function Vt(st){return(await Ke.url(`/contracts/${encodeURIComponent(st.contractId)}/amendments`).post({amendmentType:st.amendmentType,discountCode:st.discountCode})).json()}async function Kt(st){return await Ke.url(`/amendments/${encodeURIComponent(st)}/confirm`).post(),!0}async function zt(){const st=await getTokenSilently(!1),dt=new URL(`${getBaseUrl("account",$e.environment)}/subscriptions/${$e.clientId}`);st&&(dt.hash=`#access_token=${st}`),window.location.href=dt.toString()}return{autoOnboardProduct:bt,cancelContract:ct,confirmAmendment:Kt,createAmendment:Vt,createCheckout:Tt,deleteTag:Pt,deleteTally:Rt,deleteUserMetadata:pt,generateLink:kt,getBill:ut,getBills:ft,getCheckout:Ot,getProxyContent:Ye,getContract:tt,getContracts:et,getEntitlement:Xe,getEntitlementAccess:Je,getEntitlements:We,getFulfillments:Qe,getPaywall:jt,getPaymentIssues:nt,getProfile:Ut,getProduct:At,getSubscriptions:at,getTally:yt,getTallies:It,getTags:Et,getTransaction:rt,getTransactions:ot,getUserMetadata:gt,hasAccess:Ze,isSpotifyLinked:it,linkSpotify:St,listUserMetadata:vt,openHostedAccountPage:zt,pushTally:mt,setTag:Nt,setUserMetadata:lt,unlinkSpotify:ht,updateCheckout:Lt,updateProfile:xt,getVendorSettings:Ft,listVendors:Bt}}const name="@sesamy/sesamy-js",version="1.35.7";function i$5($e,De,Fe,Be,He){for(De=De.split?De.split("."):De,Be=0;Be<De.length;Be++)$e=$e?$e[De[Be]]:He;return $e===He?Fe:$e}var e="undefined",o$4="object",g$1=function(){},b$4="any",m$1="*",j="__",F$2=typeof process<"u"?process:{};F$2.env&&F$2.env.NODE_ENV;var $$1=typeof document<"u";F$2.versions!=null&&F$2.versions.node!=null;typeof Deno<"u"&&Deno.core;$$1&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent!==void 0&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function M$1($e,De){return De.charAt(0)[$e]()+De.slice(1)}var U$1=M$1.bind(null,"toUpperCase"),H$1=M$1.bind(null,"toLowerCase");function J$2($e){return Y$1($e)?U$1("null"):typeof $e=="object"?yn($e):Object.prototype.toString.call($e).slice(8,-1)}function R$1($e,De){De===void 0&&(De=!0);var Fe=J$2($e);return De?H$1(Fe):Fe}function V$1($e,De){return typeof De===$e}var W$1=V$1.bind(null,"function"),q$1=V$1.bind(null,"string"),I$2=V$1.bind(null,"undefined"),Q$1=V$1.bind(null,"boolean");V$1.bind(null,"symbol");function Y$1($e){return $e===null}function nn($e){return R$1($e)==="number"&&!isNaN($e)}function rn($e){return R$1($e)==="array"}function on($e){if(!un($e))return!1;for(var De=$e;Object.getPrototypeOf(De)!==null;)De=Object.getPrototypeOf(De);return Object.getPrototypeOf($e)===De}function un($e){return $e&&(typeof $e=="object"||$e!==null)}function yn($e){return W$1($e.constructor)?$e.constructor.name:null}function hn($e){return $e instanceof Error||q$1($e.message)&&$e.constructor&&nn($e.constructor.stackTraceLimit)}function On($e,De){if(typeof De!="object"||Y$1(De))return!1;if(De instanceof $e)return!0;var Fe=R$1(new $e(""));if(hn(De))for(;De;){if(R$1(De)===Fe)return!0;De=Object.getPrototypeOf(De)}return!1}On.bind(null,TypeError);On.bind(null,SyntaxError);function $n($e,De){var Fe=$e instanceof Element||$e instanceof HTMLDocument;return Fe&&De?Tn($e,De):Fe}function Tn($e,De){return De===void 0&&(De=""),$e&&$e.nodeName===De.toUpperCase()}function _n($e){var De=[].slice.call(arguments,1);return function(){return $e.apply(void 0,[].slice.call(arguments).concat(De))}}_n($n,"form");_n($n,"button");_n($n,"input");_n($n,"select");function Hn($e){return $e?rn($e)?$e:[$e]:[]}function n$1($e){try{return decodeURIComponent($e.replace(/\+/g," "))}catch{return null}}function o$3(){if($$1){var $e=navigator,De=$e.languages;return $e.userLanguage||(De&&De.length?De[0]:$e.language)}}function a$5(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function s$1($e){return function(De){for(var Fe,Be=Object.create(null),He=/([^&=]+)=?([^&]*)/g;Fe=He.exec(De);){var Ke=n$1(Fe[1]),Ge=n$1(Fe[2]);Ke.substring(Ke.length-2)==="[]"?(Be[Ke=Ke.substring(0,Ke.length-2)]||(Be[Ke]=[])).push(Ge):Be[Ke]=Ge===""||Ge}for(var We in Be){var Ze=We.split("[");Ze.length>1&&(m(Be,Ze.map(function(Xe){return Xe.replace(/[?[\]\\ ]/g,"")}),Be[We]),delete Be[We])}return Be}(function(De){return $$1&&window.location.search.substring(1)}())}function m($e,De,Fe){for(var Be=De.length-1,He=0;He<Be;++He){var Ke=De[He];if(Ke==="__proto__"||Ke==="constructor")break;Ke in $e||($e[Ke]={}),$e=$e[Ke]}$e[De[Be]]=Fe}function y$1(){for(var $e="",De=0,Fe=4294967295*Math.random()|0;De++<36;){var Be="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[De-1],He=15&Fe;$e+=Be=="-"||Be=="4"?Be:(Be=="x"?He:3&He|8).toString(16),Fe=De%8==0?4294967295*Math.random()|0:Fe>>4}return $e}function b$3($e,De){var Fe,Be,He,Ke=null,Ge=0,We=function(){Ge=new Date,Ke=null,He=$e.apply(Fe,Be)};return function(){var Ze=new Date;Ge||(Ge=Ze);var Xe=De-(Ze-Ge);return Fe=this,Be=arguments,Xe<=0?(clearTimeout(Ke),Ke=null,Ge=Ze,He=$e.apply(Fe,Be)):Ke||(Ke=setTimeout(We,Xe)),He}}var l$2="global",o$2=j+"global"+j,n=typeof self===o$4&&self.self===self&&self||typeof global===o$4&&global.global===global&&global||void 0;function a$4($e){return n[o$2][$e]}function f$1($e,De){return n[o$2][$e]=De}function i$4($e){delete n[o$2][$e]}function u$3($e,De,Fe){var Be;try{if(b$2($e)){var He=window[$e];Be=He[De].bind(He)}}catch{}return Be||Fe}n[o$2]||(n[o$2]={});var c$3={};function b$2($e){if(typeof c$3[$e]!==e)return c$3[$e];try{var De=window[$e];De.setItem(e,e),De.removeItem(e)}catch{return c$3[$e]=!1}return c$3[$e]=!0}function v(){return v=Object.assign||function($e){for(var De=1;De<arguments.length;De++){var Fe=arguments[De];for(var Be in Fe)Object.prototype.hasOwnProperty.call(Fe,Be)&&($e[Be]=Fe[Be])}return $e},v.apply(this,arguments)}var y="function",b$1="undefined",I$1="@@redux/"+Math.random().toString(36),w=function(){return typeof Symbol===y&&Symbol.observable||"@@observable"}(),E$1=" != "+y;function P($e,De,Fe){var Be;if(typeof De===y&&typeof Fe===b$1&&(Fe=De,De=void 0),typeof Fe!==b$1){if(typeof Fe!==y)throw new Error("enhancer"+E$1);return Fe(P)($e,De)}if(typeof $e!==y)throw new Error("reducer"+E$1);var He=$e,Ke=De,Ge=[],We=Ge,Ze=!1;function Xe(){We===Ge&&(We=Ge.slice())}function Je(){return Ke}function Ye(et){if(typeof et!==y)throw new Error("Listener"+E$1);var tt=!0;return Xe(),We.push(et),function(){if(tt){tt=!1,Xe();var ct=We.indexOf(et);We.splice(ct,1)}}}function Qe(et){if(!on(et))throw new Error("Act != obj");if(typeof et.type===b$1)throw new Error("ActType "+b$1);if(Ze)throw new Error("Dispatch in reducer");try{Ze=!0,Ke=He(Ke,et)}finally{Ze=!1}for(var tt=Ge=We,ct=0;ct<tt.length;ct++)(0,tt[ct])();return et}return Qe({type:"@@redux/INIT"}),(Be={dispatch:Qe,subscribe:Ye,getState:Je,replaceReducer:function(et){if(typeof et!==y)throw new Error("next reducer"+E$1);He=et,Qe({type:"@@redux/INIT"})}})[w]=function(){var et,tt=Ye;return(et={subscribe:function(ct){if(typeof ct!="object")throw new TypeError("Observer != obj");function at(){ct.next&&ct.next(Je())}return at(),{unsubscribe:tt(at)}}})[w]=function(){return this},et},Be}function S($e,De){var Fe=De&&De.type;return"action "+(Fe&&Fe.toString()||"?")+"reducer "+$e+" returns "+b$1}function N$1(){var $e=[].slice.call(arguments);return $e.length===0?function(De){return De}:$e.length===1?$e[0]:$e.reduce(function(De,Fe){return function(){return De(Fe.apply(void 0,[].slice.call(arguments)))}})}function O$1(){var $e=arguments;return function(De){return function(Fe,Be,He){var Ke,Ge=De(Fe,Be,He),We=Ge.dispatch,Ze={getState:Ge.getState,dispatch:function(Xe){return We(Xe)}};return Ke=[].slice.call($e).map(function(Xe){return Xe(Ze)}),v({},Ge,{dispatch:We=N$1.apply(void 0,Ke)(Ge.dispatch)})}}}var A$1=j+"anon_id",_=j+"user_id",x$1=j+"user_traits",k$1="userId",T="anonymousId",z=["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"],M=["name","EVENTS","config","loaded"],q=z.reduce(function($e,De){return $e[De]=De,$e},{registerPluginType:function($e){return"registerPlugin:"+$e},pluginReadyType:function($e){return"ready:"+$e}}),U=/^utm_/,V=/^an_prop_/,L$1=/^an_trait_/;function C$1($e){var De=$e.storage.setItem;return function(Fe){return function(Be){return function(He){if(He.type===q.bootstrap){var Ke=He.params,Ge=He.user,We=He.persistedUser,Ze=He.initialUser,Xe=We.userId===Ge.userId;We.anonymousId!==Ge.anonymousId&&De(A$1,Ge.anonymousId),Xe||De(_,Ge.userId),Ze.traits&&De(x$1,v({},Xe&&We.traits?We.traits:{},Ze.traits));var Je=Object.keys(He.params);if(Je.length){var Ye=Ke.an_uid,Qe=Ke.an_event,et=Je.reduce(function(tt,ct){if(ct.match(U)||ct.match(/^(d|g)clid/)){var at=ct.replace(U,"");tt.campaign[at==="campaign"?"name":at]=Ke[ct]}return ct.match(V)&&(tt.props[ct.replace(V,"")]=Ke[ct]),ct.match(L$1)&&(tt.traits[ct.replace(L$1,"")]=Ke[ct]),tt},{campaign:{},props:{},traits:{}});Fe.dispatch(v({type:q.params,raw:Ke},et,Ye?{userId:Ye}:{})),Ye&&setTimeout(function(){return $e.identify(Ye,et.traits)},0),Qe&&setTimeout(function(){return $e.track(Qe,et.props)},0),Object.keys(et.campaign).length&&Fe.dispatch({type:q.campaign,campaign:et.campaign})}}return Be(He)}}}}function R($e){return function(De,Fe){if(De===void 0&&(De={}),Fe===void 0&&(Fe={}),Fe.type===q.setItemEnd){if(Fe.key===A$1)return v({},De,{anonymousId:Fe.value});if(Fe.key===_)return v({},De,{userId:Fe.value})}switch(Fe.type){case q.identify:return Object.assign({},De,{userId:Fe.userId,traits:v({},De.traits,Fe.traits)});case q.reset:return[_,A$1,x$1].forEach(function(Be){$e.removeItem(Be)}),Object.assign({},De,{userId:null,anonymousId:null,traits:{}});default:return De}}}function $($e){return{userId:$e.getItem(_),anonymousId:$e.getItem(A$1),traits:$e.getItem(x$1)}}var D=function($e){return j+"TEMP"+j+$e};function B($e){var De=$e.storage,Fe=De.setItem,Be=De.removeItem,He=De.getItem;return function(Ke){return function(Ge){return function(We){var Ze=We.userId,Xe=We.traits,Je=We.options;if(We.type===q.reset&&([_,x$1,A$1].forEach(function(et){Be(et)}),[k$1,T,"traits"].forEach(function(et){i$4(D(et))})),We.type===q.identify){He(A$1)||Fe(A$1,y$1());var Ye=He(_),Qe=He(x$1)||{};Ye&&Ye!==Ze&&Ke.dispatch({type:q.userIdChanged,old:{userId:Ye,traits:Qe},new:{userId:Ze,traits:Xe},options:Je}),Ze&&Fe(_,Ze),Xe&&Fe(x$1,v({},Qe,Xe))}return Ge(We)}}}}var X={};function J$1($e,De){X[$e]&&W$1(X[$e])&&(X[$e](De),delete X[$e])}function W($e,De,Fe){return new Promise(function(Be,He){return De()?Be($e):Fe<1?He(v({},$e,{queue:!0})):new Promise(function(Ke){return setTimeout(Ke,10)}).then(function(Ke){return W($e,De,Fe-10).then(Be,He)})})}function H($e){return{abort:$e}}function F$1($e,De,Fe){var Be={},He=De(),Ke=$e.getState(),Ge=Ke.plugins,We=Ke.queue,Ze=Ke.user;if(!Ke.context.offline&&We&&We.actions&&We.actions.length){var Xe=We.actions.reduce(function(Ye,Qe,et){return Ge[Qe.plugin].loaded?(Ye.process.push(Qe),Ye.processIndex.push(et)):(Ye.requeue.push(Qe),Ye.requeueIndex.push(et)),Ye},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(Xe.processIndex&&Xe.processIndex.length){Xe.processIndex.forEach(function(Ye){var Qe=We.actions[Ye],et=Qe.plugin,tt=Qe.payload.type,ct=He[et][tt];if(ct&&W$1(ct)){var at,ft=function(rt,lt){return rt===void 0&&(rt={}),lt===void 0&&(lt={}),[k$1,T].reduce(function(pt,gt){return rt.hasOwnProperty(gt)&&lt[gt]&&lt[gt]!==rt[gt]&&(pt[gt]=lt[gt]),pt},rt)}(Qe.payload,Ze),ut=Be[ft.meta.rid];if(!ut&&(at=ct({payload:ft,config:Ge[et].config,instance:Fe,abort:H}))&&on(at)&&at.abort)return void(Be[ft.meta.rid]=!0);if(!ut){var ot=tt+":"+et;$e.dispatch(v({},ft,{type:ot,_:{called:ot,from:"queueDrain"}}))}}});var Je=We.actions.filter(function(Ye,Qe){return!~Xe.processIndex.indexOf(Qe)});We.actions=Je}}}var G$1=function($e){var De=$e.data,Fe=$e.action,Be=$e.instance,He=$e.state,Ke=$e.allPlugins,Ge=$e.allMatches,We=$e.store,Ze=$e.EVENTS;try{var Xe=He.plugins,Je=He.context,Ye=Fe.type,Qe=Ye.match(K),et=De.exact.map(function(at){return at.pluginName});Qe&&(et=Ge.during.map(function(at){return at.pluginName}));var tt=function(at,ft){return function(ut,ot,rt){var lt=ot.config,pt=ot.name,gt=pt+"."+ut.type;rt&&(gt=rt.event);var vt=ut.type.match(K)?function(Et,Pt,Nt,yt,It){return function(Rt,mt){var At=yt?yt.name:Et,Ut=mt&&ae(mt)?mt:Nt;if(yt&&(!(Ut=mt&&ae(mt)?mt:[Et]).includes(Et)||Ut.length!==1))throw new Error("Method "+Pt+" can only abort "+Et+" plugin. "+JSON.stringify(Ut)+" input valid");return v({},It,{abort:{reason:Rt,plugins:Ut,caller:Pt,_:At}})}}(pt,gt,ft,rt,ut):function(Et,Pt){return function(){throw new Error(Et.type+" action not cancellable. Remove abort in "+Pt)}}(ut,gt);return{payload:ce(ut),instance:at,config:lt||{},abort:vt}}}(Be,et),ct=De.exact.reduce(function(at,ft){var ut=ft.pluginName,ot=ft.methodName,rt=!1;return ot.match(/^initialize/)||ot.match(/^reset/)||(rt=!Xe[ut].loaded),Je.offline&&ot.match(/^(page|track|identify)/)&&(rt=!0),at[""+ut]=rt,at},{});return Promise.resolve(De.exact.reduce(function(at,ft,ut){try{var ot=ft.pluginName;return Promise.resolve(at).then(function(rt){function lt(){return Promise.resolve(rt)}var pt=function(){if(De.namespaced&&De.namespaced[ot])return Promise.resolve(De.namespaced[ot].reduce(function(gt,vt,Et){try{return Promise.resolve(gt).then(function(Pt){return vt.method&&W$1(vt.method)?(function(Rt,mt){var At=ue(Rt);if(At&&At.name===mt){var Ut=ue(At.method);throw new Error([mt+" plugin is calling method "+Rt,"Plugins cant call self","Use "+At.method+" "+(Ut?"or "+Ut.method:"")+" in "+mt+" plugin insteadof "+Rt].join(`
34
+ **/var __webpack_require__={d:($e,De)=>{for(var Fe in De)__webpack_require__.o(De,Fe)&&!__webpack_require__.o($e,Fe)&&Object.defineProperty($e,Fe,{enumerable:!0,get:De[Fe]})},o:($e,De)=>Object.prototype.hasOwnProperty.call($e,De)},__webpack_exports__={};__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__,k:()=>detectIncognito});var __awaiter=function($e,De,Fe,Be){return new(Fe||(Fe=Promise))(function(He,Ke){function Ge(Xe){try{Ze(Be.next(Xe))}catch(Je){Ke(Je)}}function We(Xe){try{Ze(Be.throw(Xe))}catch(Je){Ke(Je)}}function Ze(Xe){var Je;Xe.done?He(Xe.value):(Je=Xe.value,Je instanceof Fe?Je:new Fe(function(Ye){Ye(Je)})).then(Ge,We)}Ze((Be=Be.apply($e,[])).next())})},__generator=function($e,De){var Fe,Be,He,Ke,Ge={label:0,sent:function(){if(1&He[0])throw He[1];return He[1]},trys:[],ops:[]};return Ke={next:We(0),throw:We(1),return:We(2)},typeof Symbol=="function"&&(Ke[Symbol.iterator]=function(){return this}),Ke;function We(Ze){return function(Xe){return function(Je){if(Fe)throw new TypeError("Generator is already executing.");for(;Ke&&(Ke=0,Je[0]&&(Ge=0)),Ge;)try{if(Fe=1,Be&&(He=2&Je[0]?Be.return:Je[0]?Be.throw||((He=Be.return)&&He.call(Be),0):Be.next)&&!(He=He.call(Be,Je[1])).done)return He;switch(Be=0,He&&(Je=[2&Je[0],He.value]),Je[0]){case 0:case 1:He=Je;break;case 4:return Ge.label++,{value:Je[1],done:!1};case 5:Ge.label++,Be=Je[1],Je=[0];continue;case 7:Je=Ge.ops.pop(),Ge.trys.pop();continue;default:if(He=Ge.trys,!((He=He.length>0&&He[He.length-1])||Je[0]!==6&&Je[0]!==2)){Ge=0;continue}if(Je[0]===3&&(!He||Je[1]>He[0]&&Je[1]<He[3])){Ge.label=Je[1];break}if(Je[0]===6&&Ge.label<He[1]){Ge.label=He[1],He=Je;break}if(He&&Ge.label<He[2]){Ge.label=He[2],Ge.ops.push(Je);break}He[2]&&Ge.ops.pop(),Ge.trys.pop();continue}Je=De.call($e,Ge)}catch(Ye){Je=[6,Ye],Be=0}finally{Fe=He=0}if(5&Je[0])throw Je[1];return{value:Je[0]?Je[1]:void 0,done:!0}}([Ze,Xe])}}};function detectIncognito(){return __awaiter(this,void 0,Promise,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,new Promise(function(resolve,reject){var browserName="Unknown";function __callback($e){resolve({isPrivate:$e,browserName})}function identifyChromium(){var $e=navigator.userAgent;return $e.match(/Chrome/)?navigator.brave!==void 0?"Brave":$e.match(/Edg/)?"Edge":$e.match(/OPR/)?"Opera":"Chrome":"Chromium"}function assertEvalToString($e){return $e===eval.toString().length}function feid(){var toFixedEngineID=0;try{eval("(-1).toFixed(-1);")}catch($e){toFixedEngineID=$e.message.length}return toFixedEngineID}function isSafari(){return feid()===44}function isChrome(){return feid()===51}function isFirefox(){return feid()===25}function isMSIE(){return navigator.msSaveBlob!==void 0&&assertEvalToString(39)}function newSafariTest(){var $e=String(Math.random());try{window.indexedDB.open($e,1).onupgradeneeded=function(De){var Fe,Be,He=(Fe=De.target)===null||Fe===void 0?void 0:Fe.result;try{He.createObjectStore("test",{autoIncrement:!0}).put(new Blob),__callback(!1)}catch(Ge){var Ke=Ge;return Ge instanceof Error&&(Ke=(Be=Ge.message)!==null&&Be!==void 0?Be:Ge),typeof Ke!="string"?void __callback(!1):void __callback(Ke.includes("BlobURLs are not yet supported"))}finally{He.close(),window.indexedDB.deleteDatabase($e)}}}catch{__callback(!1)}}function oldSafariTest(){var $e=window.openDatabase,De=window.localStorage;try{$e(null,null,null,null)}catch{return void __callback(!0)}try{De.setItem("test","1"),De.removeItem("test")}catch{return void __callback(!0)}__callback(!1)}function safariPrivateTest(){navigator.maxTouchPoints!==void 0?newSafariTest():oldSafariTest()}function getQuotaLimit(){var $e=window;return $e.performance!==void 0&&$e.performance.memory!==void 0&&$e.performance.memory.jsHeapSizeLimit!==void 0?performance.memory.jsHeapSizeLimit:1073741824}function storageQuotaChromePrivateTest(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function($e,De){__callback(Math.round(De/1048576)<2*Math.round(getQuotaLimit()/1048576))},function($e){reject(new Error("detectIncognito somehow failed to query storage quota: "+$e.message))})}function oldChromePrivateTest(){(0,window.webkitRequestFileSystem)(0,1,function(){__callback(!1)},function(){__callback(!0)})}function chromePrivateTest(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?storageQuotaChromePrivateTest():oldChromePrivateTest()}function firefoxPrivateTest(){__callback(navigator.serviceWorker===void 0)}function msiePrivateTest(){__callback(window.indexedDB===void 0)}function main(){isSafari()?(browserName="Safari",safariPrivateTest()):isChrome()?(browserName=identifyChromium(),chromePrivateTest()):isFirefox()?(browserName="Firefox",firefoxPrivateTest()):isMSIE()?(browserName="Internet Explorer",msiePrivateTest()):reject(new Error("detectIncognito cannot determine the browser"))}main()})];case 1:return[2,_a.sent()]}})})}typeof window<"u"&&(window.detectIncognito=detectIncognito);const __WEBPACK_DEFAULT_EXPORT__=detectIncognito;__webpack_exports__.A;var __webpack_exports__detectIncognito=__webpack_exports__.k;async function isIncognito(){try{const{isPrivate:$e}=await __webpack_exports__detectIncognito();return $e}catch{return!1}}function isBrowser(){return typeof window<"u"}const STORAGE_KEY="sesamyFlags";async function saveFlags($e){try{localStorage.setItem(STORAGE_KEY,JSON.stringify($e))}catch{log("Failed to save flags to localStorage")}}async function setFlag($e,De){const Fe=await listFlags();Fe[$e]=De,await saveFlags(Fe)}async function getFlag($e){return(await listFlags())[$e]}async function deleteFlag($e){const De=await listFlags();$e in De&&(delete De[$e],await saveFlags(De))}async function listFlags(){try{const $e=localStorage.getItem(STORAGE_KEY);return $e?JSON.parse($e):{}}catch{return{}}}let auth0Client,organization,initialized=!1,loginInProgress=!1;isBrowser()&&window.addEventListener("pageshow",()=>{loginInProgress=!1});const ACCESS_TOKEN_KEY="sesamyAccessToken",REFRESH_TOKEN_KEY="sesamyRefreshToken";async function waitForInit(){return initialized?!0:new Promise(($e,De)=>{const Fe=setTimeout(()=>{initialized?$e(!0):De(new Error("Initialization failed: Timeout"))},2e3);window.addEventListener(Events.AUTH_INITIALIZED,()=>{clearTimeout(Fe),$e(!0)})})}async function refreshLocalAccessToken($e){if(!$e)return null;const De=localStorage.getItem(REFRESH_TOKEN_KEY);if(!De)return log("No refresh token found in localstorage"),null;const Fe=new URLSearchParams;Fe.set("client_id",$e.iss),Fe.set("refresh_token",De),Fe.set("grant_type","refresh_token");const Be=new URL($e.iss);Be.pathname="/oauth/token",Be.searchParams.set("user_id",$e.sub);try{const He=await fetch(Be.href,{body:Fe.toString(),method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"}});if(!He.ok)throw localStorage.removeItem(REFRESH_TOKEN_KEY),new Error("Renew token failed");const Ke=await He.json();return localStorage.setItem(REFRESH_TOKEN_KEY,Ke.refresh_token),localStorage.setItem(ACCESS_TOKEN_KEY,Ke.access_token),Ke.access_token}catch{logout()}}async function getLocalStorageAccessToken(){const $e=localStorage.getItem(ACCESS_TOKEN_KEY);if(!$e)return null;const De=getPayloadFromJwt($e);if(!De||!De.exp||De.exp<new Date().getTime()/1e3){const Fe=await refreshLocalAccessToken(De);if(Fe)return Fe;localStorage.removeItem(ACCESS_TOKEN_KEY)}return $e}function getTopLevelDomain($e){try{const De=new URL($e).hostname,Fe=De.split(".");return Fe.length>1?Fe.slice(-2).join("."):De}catch{return null}}async function init$3($e){if($e.enabled===!1)return;organization=$e.organization;const Fe=await getFlag("newAuth")&&$e.domain?$e.domain:getBaseDomain("token",$e.environment),Be={domain:Fe,clientId:$e.clientId,useCookiesForTransactions:!0};if(getTopLevelDomain(window.location.href)!==getTopLevelDomain(`https://${Fe}`)&&(Be.cacheLocation="localstorage",Be.useRefreshTokens=!0),log(`Initializing auth0 client: ${JSON.stringify(Be)}`),auth0Client=await oe$1(Be),window.location.search.includes("code=")){log("Code found in URL, handling redirect");try{const Ge=await auth0Client.handleRedirectCallback();log(`Login result: ${JSON.stringify(Ge)}`);const We=await auth0Client.getUser();if(!We)throw log("No user found"),new Error("No user found");log(`User found ${JSON.stringify(We)}`),triggerEvent(Events.AUTHENTICATED,We),log("Rewrite url")}catch(Ge){alert("There was an error logging in"),console.error(Ge)}const He=new URL(location.href),Ke=He.searchParams;Ke.delete("code"),Ke.delete("state"),He.search=Ke.toString(),window.history.replaceState({},document.title,He.toString())}initialized=!0,triggerEvent(Events.AUTH_INITIALIZED,{})}async function isAuthenticated(){return await waitForInit(),await getLocalStorageAccessToken()?!0:auth0Client?auth0Client.isAuthenticated():!1}async function getUser(){return await waitForInit(),await getLocalStorageAccessToken()?(log("Using local user"),{sub:"local",name:"Local User"}):auth0Client?auth0Client.getUser():null}async function loginWithRedirect($e){if(loginInProgress){log("Login already in progress");return}if(loginInProgress=!0,await waitForInit(),localStorage.removeItem(ACCESS_TOKEN_KEY),!auth0Client)throw new Error("Auth0 client not initialized");const De=($e==null?void 0:$e.authorizationParams)||{};return await isIncognito()&&navigator.userAgent.includes("Safari")&&navigator.userAgent.includes("iPhone")&&sessionStorage.setItem(SESMAY_CONTENT_RELOAD_KEY,"true"),auth0Client.loginWithRedirect({...$e,authorizationParams:{organization,redirect_uri:window.location.href,ui_locales:getLanguage(),...De}})}async function getTokenSilently($e=!0,De=!1){await waitForInit();const Fe=await getLocalStorageAccessToken();if(Fe)return Fe;try{if(!auth0Client)return log("Auth client not initialized"),null;let Be=await auth0Client.getTokenSilently();const He=getPayloadFromJwt(Be);return De&&(He!=null&&He.exp)&&He.exp+3600<new Date().getTime()/1e3&&(Be=await auth0Client.getTokenSilently({cacheMode:De?"off":"on"})),Be}catch(Be){const He=Be;if(log(`Failed to get token silently: ${He.message}`),He.message==="Invalid refresh token"&&await logout(),$e)throw Be;return null}}async function logout($e={}){if(await waitForInit(),localStorage.removeItem(ACCESS_TOKEN_KEY),triggerEvent(Events.LOGOUT,{}),!!auth0Client)return log(`Logout with options: ${JSON.stringify($e)}`),auth0Client.logout({...$e,logoutParams:{returnTo:window.location.href,...$e.logoutParams}})}function getPayloadFromJwt($e){const De=$e.split(".");if(De.length!==3)return null;const Be=De[1].replace(/-/g,"+").replace(/_/g,"/"),He=decodeURIComponent(atob(Be).split("").map(function(Ke){return"%"+("00"+Ke.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(He)}async function setToken($e){const De=getPayloadFromJwt($e);if(!De||!De.exp||De.exp<new Date().getTime()/1e3)throw new Error("Invalid token");log("Set token"),localStorage.setItem(ACCESS_TOKEN_KEY,$e),triggerEvent(Events.AUTHENTICATED,De)}const defaultSkip=($e,De)=>De.skipDedupe||De.method!=="GET",defaultKey=($e,De)=>De.method+"@"+$e,defaultResolver=$e=>$e.clone(),dedupe=({skip:$e=defaultSkip,key:De=defaultKey,resolver:Fe=defaultResolver}={})=>{const Be=new Map;return He=>(Ke,Ge)=>{if($e(Ke,Ge))return He(Ke,Ge);const We=De(Ke,Ge);if(!Be.has(We))Be.set(We,[]);else return new Promise((Ze,Xe)=>{Be.get(We).push([Ze,Xe])});try{return He(Ke,Ge).then(Ze=>(Be.get(We).forEach(([Xe])=>Xe(Fe(Ze))),Be.delete(We),Ze)).catch(Ze=>{throw Be.get(We).forEach(([,Xe])=>Xe(Ze)),Be.delete(We),Ze})}catch(Ze){return Be.delete(We),Promise.reject(Ze)}}},defaultDelayRamp=($e,De)=>$e*De,defaultUntil=$e=>$e&&$e.ok,retry=({delayTimer:$e=500,delayRamp:De=defaultDelayRamp,maxAttempts:Fe=10,until:Be=defaultUntil,onRetry:He=null,retryOnNetworkError:Ke=!1,resolveWithLatestResponse:Ge=!1,skip:We}={})=>Ze=>(Xe,Je)=>{let Ye=0;if(We&&We(Xe,Je))return Ze(Xe,Je);const Qe=(et,tt)=>Promise.resolve(Be(et,tt)).then(ct=>ct?et&&Ge?et:tt?Promise.reject(tt):et:(Ye++,!Fe||Ye<=Fe?new Promise(at=>{const ft=De($e,Ye);setTimeout(()=>{typeof He=="function"?Promise.resolve(He({response:et,error:tt,url:Xe,options:Je})).then((ut={})=>{var ot,rt;at(Ze((ot=ut&&ut.url)!==null&&ot!==void 0?ot:Xe,(rt=ut&&ut.options)!==null&&rt!==void 0?rt:Je))}):at(Ze(Xe,Je))},ft)}).then(Qe).catch(at=>{if(!Ke)throw at;return Qe(null,at)}):et&&Ge?et:Promise.reject(tt||new Error("Number of attempts exceeded."))));return Ze(Xe,Je).then(Qe).catch(et=>{if(!Ke)throw et;return Qe(null,et)})},JSON_MIME="application/json",CONTENT_TYPE_HEADER="Content-Type",FETCH_ERROR=Symbol(),CATCHER_FALLBACK=Symbol();function extractContentType($e={}){var De;return(De=Object.entries($e).find(([Fe])=>Fe.toLowerCase()===CONTENT_TYPE_HEADER.toLowerCase()))===null||De===void 0?void 0:De[1]}function isLikelyJsonMime($e){return/^application\/.*json.*/.test($e)}const mix=function($e,De,Fe=!1){return Object.entries(De).reduce((Be,[He,Ke])=>{const Ge=$e[He];return Array.isArray(Ge)&&Array.isArray(Ke)?Be[He]=Fe?[...Ge,...Ke]:Ke:typeof Ge=="object"&&typeof Ke=="object"?Be[He]=mix(Ge,Ke,Fe):Be[He]=Ke,Be},{...$e})},config={options:{},errorType:"text",polyfills:{},polyfill($e,De=!0,Fe=!1,...Be){const He=this.polyfills[$e]||(typeof self<"u"?self[$e]:null)||(typeof global<"u"?global[$e]:null);if(De&&!He)throw new Error($e+" is not defined");return Fe&&He?new He(...Be):He}};function setOptions($e,De=!1){config.options=De?$e:mix(config.options,$e)}function setPolyfills($e,De=!1){config.polyfills=De?$e:mix(config.polyfills,$e)}function setErrorType($e){config.errorType=$e}const middlewareHelper=$e=>De=>$e.reduceRight((Fe,Be)=>Be(Fe),De)||De;class WretchError extends Error{}const resolver=$e=>{const De=Object.create(null);$e=$e._addons.reduce((ot,rt)=>rt.beforeRequest&&rt.beforeRequest(ot,$e._options,De)||ot,$e);const{_url:Fe,_options:Be,_config:He,_catchers:Ke,_resolvers:Ge,_middlewares:We,_addons:Ze}=$e,Xe=new Map(Ke),Je=mix(He.options,Be);let Ye=Fe;const Qe=middlewareHelper(We)((ot,rt)=>(Ye=ot,He.polyfill("fetch")(ot,rt)))(Fe,Je),et=new Error,tt=Qe.catch(ot=>{throw{[FETCH_ERROR]:ot}}).then(ot=>{var rt;if(!ot.ok){const lt=new WretchError;if(lt.cause=et,lt.stack=lt.stack+`
35
+ CAUSE: `+et.stack,lt.response=ot,lt.status=ot.status,lt.url=Ye,ot.type==="opaque")throw lt;const pt=He.errorType==="json"||((rt=ot.headers.get("Content-Type"))===null||rt===void 0?void 0:rt.split(";")[0])==="application/json";return(He.errorType?pt?ot.text():ot[He.errorType]():Promise.resolve(ot.body)).then(vt=>{throw lt.message=typeof vt=="string"?vt:ot.statusText,vt&&(pt&&typeof vt=="string"?(lt.text=vt,lt.json=JSON.parse(vt)):lt[He.errorType]=vt),lt})}return ot}),ct=ot=>ot.catch(rt=>{const lt=Object.prototype.hasOwnProperty.call(rt,FETCH_ERROR),pt=lt?rt[FETCH_ERROR]:rt,gt=(pt==null?void 0:pt.status)&&Xe.get(pt.status)||Xe.get(pt==null?void 0:pt.name)||lt&&Xe.has(FETCH_ERROR)&&Xe.get(FETCH_ERROR);if(gt)return gt(pt,$e);const vt=Xe.get(CATCHER_FALLBACK);if(vt)return vt(pt,$e);throw pt}),at=ot=>rt=>ct(ot?tt.then(lt=>lt&&lt[ot]()).then(lt=>rt?rt(lt):lt):tt.then(lt=>rt?rt(lt):lt)),ft={_wretchReq:$e,_fetchReq:Qe,_sharedState:De,res:at(null),json:at("json"),blob:at("blob"),formData:at("formData"),arrayBuffer:at("arrayBuffer"),text:at("text"),error(ot,rt){return Xe.set(ot,rt),this},badRequest(ot){return this.error(400,ot)},unauthorized(ot){return this.error(401,ot)},forbidden(ot){return this.error(403,ot)},notFound(ot){return this.error(404,ot)},timeout(ot){return this.error(408,ot)},internalError(ot){return this.error(500,ot)},fetchError(ot){return this.error(FETCH_ERROR,ot)}},ut=Ze.reduce((ot,rt)=>({...ot,...typeof rt.resolver=="function"?rt.resolver(ot):rt.resolver}),ft);return Ge.reduce((ot,rt)=>rt(ot,$e),ut)},core={_url:"",_options:{},_config:config,_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,De=!1){return{...this,_config:{...this._config,polyfills:De?$e:mix(this._config.polyfills,$e)}}},url($e,De=!1){if(De)return{...this,_url:$e};const Fe=this._url.split("?");return{...this,_url:Fe.length>1?Fe[0]+$e+"?"+Fe[1]:this._url+$e}},options($e,De=!1){return{...this,_options:De?$e:mix(this._options,$e)}},headers($e){const De=$e?Array.isArray($e)?Object.fromEntries($e):"entries"in $e?Object.fromEntries($e.entries()):$e:{};return{...this,_options:mix(this._options,{headers:De})}},accept($e){return this.headers({Accept:$e})},content($e){return this.headers({[CONTENT_TYPE_HEADER]:$e})},auth($e){return this.headers({Authorization:$e})},catcher($e,De){const Fe=new Map(this._catchers);return Fe.set($e,De),{...this,_catchers:Fe}},catcherFallback($e){return this.catcher(CATCHER_FALLBACK,$e)},resolve($e,De=!1){return{...this,_resolvers:De?[$e]:[...this._resolvers,$e]}},defer($e,De=!1){return{...this,_deferred:De?[$e]:[...this._deferred,$e]}},middlewares($e,De=!1){return{...this,_middlewares:De?$e:[...this._middlewares,...$e]}},fetch($e=this._options.method,De="",Fe=null){let Be=this.url(De).options({method:$e});const He=extractContentType(Be._options.headers),Ke=this._config.polyfill("FormData",!1),Ge=typeof Fe=="object"&&!(Ke&&Fe instanceof Ke)&&(!Be._options.headers||!He||isLikelyJsonMime(He));return Be=Fe?Ge?Be.json(Fe,He):Be.body(Fe):Be,resolver(Be._deferred.reduce((We,Ze)=>Ze(We,We._url,We._options),Be))},get($e=""){return this.fetch("GET",$e)},delete($e=""){return this.fetch("DELETE",$e)},put($e,De=""){return this.fetch("PUT",De,$e)},post($e,De=""){return this.fetch("POST",De,$e)},patch($e,De=""){return this.fetch("PATCH",De,$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,De){const Fe=extractContentType(this._options.headers);return this.content(De||isLikelyJsonMime(Fe)&&Fe||JSON_MIME).body(JSON.stringify($e))}};function factory($e="",De={}){return{...core,_url:$e,_options:De}}factory.default=factory;factory.options=setOptions;factory.errorType=setErrorType;factory.polyfills=setPolyfills;factory.WretchError=WretchError;function clearCache(){return sessionStorage.removeItem(CACHE_TIMESTAMP_KEY),log("Cache cleared"),triggerEvent(Events.CLEAR_CACHE,{}),"Cache cleared"}function isValidHttpUrl($e){let De;try{De=new URL($e)}catch{return!1}return De.protocol==="http:"||De.protocol==="https:"}function decodeItemSrc($e,De){if(isValidHttpUrl($e))return{itemSrc:$e};const[Fe,Be,He]=$e.split(":");return{sku:`${Fe}:${Be}`,purchaseOption:De||He}}function removeTrailingSlash($e){return $e.endsWith("/")?$e.slice(0,-1):$e}function compareUrlWithoutHash($e,De){if(!isValidHttpUrl($e)||!isValidHttpUrl(De))return!1;const Fe=new URL($e),Be=new URL(De);return Fe.origin===Be.origin&&removeTrailingSlash(Fe.pathname)===removeTrailingSlash(Be.pathname)}function generateCheckoutLink($e,De,Fe){const Be=new URL(`${getBaseUrl("checkout3",$e.environment)}`);if(De.language&&Be.searchParams.set("lang",De.language),De.sku)Be.searchParams.set("sku",De.sku),De.purchaseOptionId&&Be.searchParams.set("po-id",De.purchaseOptionId);else if(De.itemSrc){const{sku:We,purchaseOption:Ze,itemSrc:Xe}=decodeItemSrc(De.itemSrc,De.purchaseOptionId);Xe&&Be.searchParams.set("url",Xe),We&&Be.searchParams.set("sku",We),Ze&&Be.searchParams.set("po-id",Ze)}De.email&&Be.searchParams.set("email",De.email),De.business&&Be.searchParams.set("business","true"),De.currency&&Be.searchParams.set("currency",De.currency),De.price&&Be.searchParams.set("price",De.price.toString()),De.discountCode&&Be.searchParams.set("discount-code",De.discountCode),De.attributionItemSrc?Be.searchParams.set("itemSrc",De.attributionItemSrc):Fe.itemSrc&&Be.searchParams.set("itemSrc",Fe.itemSrc),De.attributionPublisherContentId?Be.searchParams.set("publisherContentId",De.attributionPublisherContentId):Fe.publisherContentId&&Be.searchParams.set("publisherContentId",Fe.publisherContentId),De.utmSource?Be.searchParams.set("utm_source",De.utmSource):Fe.utmSource&&Be.searchParams.set("utm_source",Fe.utmSource),De.utmMedium?Be.searchParams.set("utm_medium",De.utmMedium):Fe.utmMedium&&Be.searchParams.set("utm_medium",Fe.utmMedium),De.utmCampaign?Be.searchParams.set("utm_campaign",De.utmCampaign):Fe.utmCampaign&&Be.searchParams.set("utm_campaign",Fe.utmCampaign),De.utmTerm?Be.searchParams.set("utm_term",De.utmTerm):Fe.utmTerm&&Be.searchParams.set("utm_term",Fe.utmTerm),De.utmContent?Be.searchParams.set("utm_content",De.utmContent):Fe.utmContent&&Be.searchParams.set("utm_content",Fe.utmContent);const He=["_ga","_gid","_fbp","_fbc"];document.cookie.split(";").map(We=>{const[Ze,Xe]=We.trim().split("=");return{key:Ze,value:Xe}}).filter(We=>He.some(Ze=>Ze===We.key)).forEach(We=>{Be.searchParams.append(We.key,We.value)});const Ge=new URL(De.redirectUrl||window.location.href);return Ge.searchParams.set("force-refetch-entitlements","true"),De.itemSrc&&Ge.searchParams.set("sesamy-purchase",De.itemSrc),Be.searchParams.set("redirect-url",Ge.toString()),De.paymentMethodsFilter&&Be.searchParams.set("paymentmethods-filter",De.paymentMethodsFilter.flatMap(({provider:We,methods:Ze})=>Ze?Ze.map(Xe=>`${We}|${Xe}`):We).join(",")),Be}const SIGNED_URL_KEY="sesamySignedURLs";function getSignedLinks(){const $e=sessionStorage.getItem(SIGNED_URL_KEY);return $e?JSON.parse($e):[]}function addSignedLink($e){const De=getSignedLinks();De.push($e),log(`Adding signed URL: ${$e}`),sessionStorage.setItem(SIGNED_URL_KEY,JSON.stringify(De))}function removeUndefinedValues($e){const De={};return Object.keys($e).forEach(Fe=>{const Be=$e[Fe];Be!=null&&(De[Fe]=Be.toString())}),De}const ATTRIBUTION_KEY="sesamyAttribution";function parseFromLocalStorage($e){const De=localStorage.getItem($e);if(!De)return null;try{return JSON.parse(De).value}catch{return console.error(`Failed to parse ${$e}`),null}}function resetUtmTags($e){return Object.keys($e).find(De=>De.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...$e}:$e}function getAttribution(){return parseFromLocalStorage(ATTRIBUTION_KEY)||{}}function setAttribution($e){if($e===null)localStorage.removeItem(ATTRIBUTION_KEY);else{log(`Setting attribution ${JSON.stringify($e)}`);const De=getAttribution()??{},Fe=removeUndefinedValues({...De,...resetUtmTags($e)});localStorage.setItem(ATTRIBUTION_KEY,JSON.stringify({value:Fe}))}}function createApi($e){const De=getBaseUrl("api2",$e.environment),Fe=st=>async(dt,$t)=>{let Ct=sessionStorage.getItem(CACHE_TIMESTAMP_KEY);Ct||(Ct=Date.now().toString(),sessionStorage.setItem(CACHE_TIMESTAMP_KEY,Ct));const _t={...$t,headers:{...$t.headers,"Cache-Timestamp":Ct}};return st(dt,_t)},Be=(st=!0)=>dt=>async($t,Ct)=>{let _t=null;if(_t=await getTokenSilently(st),!_t){if(st)throw new Error("No access token available");return dt($t,Ct)}const Mt={...Ct,headers:{...Ct.headers,..._t?{Authorization:`Bearer ${_t}`}:{}}};return dt($t,Mt)},He=st=>(dt,$t)=>{if($t.headers.Authorization)return st(dt,$t);const Ct=localStorage.getItem("__anon_id"),_t=btoa(`${$e.clientId}|${Ct}:`),Mt={...$t,headers:{...$t.headers,Authorization:`Basic ${_t}`}};return st(dt,Mt)},Ke=factory(De).headers({"Content-Type":"application/json"}).middlewares([Fe,Be(),dedupe(),retry({delayTimer:1e3,delayRamp:(st,dt)=>st*dt,maxAttempts:3,until:st=>!!(st&&(st.ok||st.status>=400&&st.status<500)),retryOnNetworkError:!1})]),Ge=factory(De).headers({"Content-Type":"application/json"}).middlewares([Fe,Be(!1),He,dedupe(),retry({delayTimer:1e3,delayRamp:(st,dt)=>st*dt,maxAttempts:3,until:st=>!!(st&&(st.ok||st.status>=400&&st.status<500)),retryOnNetworkError:!1})]);async function We(st={}){const{waitForEntitlementAfter:dt,includeSignedLinks:$t=!0}=st,Ct=dt?`?wait-for-entitlement-after=${dt.toISOString()}`:"",_t=await isAuthenticated()?await Ke.get(`/entitlements${Ct}`).json():[];return $t&&_t.push(...getSignedLinks()),_t}async function Ze(st,dt=[]){const $t=await We();return $t==null?void 0:$t.find(_t=>{const{sku:Mt,purchaseOption:Ht}=decodeItemSrc(st);let Gt="sku"in _t&&Mt===_t.sku;Gt&&Ht&&"purchaseOptionId"in _t&&(Gt=Ht===_t.purchaseOptionId);const tr=compareUrlWithoutHash(st,_t.url),rr=dt.some(nr=>compareUrlWithoutHash(nr,_t.url));return Gt||tr||rr})}async function Xe(st){const dt=await Ke.get("/entitlements").json();return dt==null?void 0:dt.find($t=>$t.id===st)}async function Je(st){return Ke.get(`/entitlements/${encodeURIComponent(st)}/access`).json()}async function Ye(st,dt,$t){const Ct=new URL(getBaseUrl("api2",$e.environment));return Ct.pathname="/proxy",Ct.searchParams.set("url",dt),$t&&Ct.searchParams.set("selector",$t),factory(Ct.toString()).headers({Authorization:`Bearer ${st}`}).get().text()}async function Qe(st){return await isAuthenticated()?await Ke.get(`/fulfillments?sku=${encodeURIComponent(st)}`).json():[]}async function et(){return Ke.get("/contracts").json()}async function tt(st){const dt=await Ke.get("/contracts").json();return dt==null?void 0:dt.find($t=>$t.id===st)}async function ct(st){const dt=await Ke.post({},`/contracts/${encodeURIComponent(st)}/cancel`).res();return clearCache(),dt.ok}async function at(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),Ke.get("/subscriptions").json()}async function ft(){return Ke.get("/bills").json()}async function ut(st){const dt=await Ke.get("/bills").json();return dt==null?void 0:dt.find($t=>$t.id===st)}async function ot(){return Ke.get("/transactions").json()}async function rt(st){const dt=await Ke.get("/transactions").json();return dt==null?void 0:dt.find($t=>$t.id===st)}async function lt(st,dt){const $t=await Ke.url(`/user-metadata/${encodeURIComponent(st)}`).put(dt).json();return triggerEvent(Events.USER_ATTRIBUTE_CHANGED,{}),clearCache(),$t}async function pt(st){const dt=await Ke.url(`/user-metadata/${encodeURIComponent(st)}`).delete().res();return clearCache(),dt.ok}async function gt(st){return(await Ke.url(`/user-metadata/${encodeURIComponent(st)}`).get().json())[st]}async function vt(){return await Ke.url("/user-metadata").get().json()}async function Et(){return await Ke.url("/tags").get().json()}async function Pt(st){const dt=await Ke.url(`/tags/${encodeURIComponent(st)}`).delete().res();return clearCache(),dt.ok}async function Nt(st){const dt=await Ke.url("/tags").post(encodeURIComponent(st)).res();return triggerEvent(Events.USER_ATTRIBUTE_CHANGED,{}),clearCache(),dt.ok}async function yt(st){return(await Ge.url("/tallies").get().json())[st]}async function It(){return await Ge.url("/tallies").get().json()}async function Rt(st){const dt=await Ge.url(`/tallies/${st}`).delete().res();return clearCache(),dt.ok}async function mt(st,dt){return await Ge.url(`/tallies/${encodeURIComponent(st)}/push`).post(dt).json()}async function At(st){return await Ke.url(`/products/${encodeURIComponent(st)}`).get().json()}async function Ut(){return await getTokenSilently(!1)?await Ke.url("/profile").get().json():null}async function xt(st){const dt=await Ke.url("/profile").patch(st).res();return clearCache(),dt.ok}async function nt(){return await Ke.url("/payment-issues").get().json()}async function it(){return(await Ke.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function ht(){return(await Ke.url("/profile/unlink-spotify").post().res()).ok}async function St(st){const dt=await getTokenSilently(!1);if(!dt)throw new Error("No access token available");const $t=new URL(`${getBaseUrl("access-sync",$e.environment)}/spotify/sesamy-callback`);$t.searchParams.set("access_token",dt),$t.searchParams.set("state",st),window.location.href=$t.toString()}async function bt(st){const dt=await Ke.url(`/products/${encodeURIComponent(st)}/auto-onboard`).post().json();return dt.length&&clearCache(),dt}async function wt(st,dt=3600){const{shortlink:$t}=await factory(SHORTLINK_URL).post({url:st,ttl:dt}).json();return $t}async function kt(st){const dt=await getTokenSilently(!1,!0);let $t;const Ct=st.language||getLanguage(),_t=getAttribution();switch(st.target){case"account":$t=new URL(`${getBaseUrl("account",$e.environment)}/${encodeURIComponent(st.language||Ct)}/subscriptions/${encodeURIComponent($e.clientId)}`),$t.searchParams.set("sesamy-redirect-url",st.redirectUrl||window.location.href);break;case"change-payment":$t=new URL(`${getBaseUrl("account",$e.environment)}/${encodeURIComponent(st.language||Ct)}/subscriptions/${encodeURIComponent($e.clientId)}/${encodeURIComponent(st.contractId)}/change-payment-method`),$t.searchParams.set("sesamy-redirect-url",st.redirectUrl||window.location.href);break;case"change-plan":$t=new URL(`${getBaseUrl("account",$e.environment)}/${encodeURIComponent(st.language||Ct)}/subscriptions/${encodeURIComponent($e.clientId)}/${encodeURIComponent(st.contractId)}/edit-plan`),$t.searchParams.set("sesamy-redirect-url",st.redirectUrl||window.location.href);break;case"consume":$t=new URL(`${getBaseUrl("consume",$e.environment)}/${encodeURIComponent(st.language||Ct)}/@${encodeURIComponent($e.clientId)}/${encodeURIComponent(st.sku)}`),st.episodeId?$t.href+=`/${st.episodeId}`:$t.href+="/listen",$t.searchParams.set("sesamy-redirect-url",st.redirectUrl||window.location.href);break;case"checkout":$t=generateCheckoutLink($e,{language:Ct,...st},_t);break;default:throw new Error("Invalid target")}return dt&&($t.hash=`#access_token=${dt}`),st.shorten?wt($t.href,st.ttl):$t.href}async function Tt(st){const dt=getAttribution(),$t=["_ga","_gid","_fbp","_fbc"];return document.cookie.split(";").forEach(_t=>{const Mt=dt,[Ht,Gt]=_t.trim().split("=");$t.includes(Ht)&&!Mt[Ht]&&(Mt[Ht]=Gt)}),(await Ge.url("/checkouts").post({language:getLanguage(),...st,attribution:{...dt,...st.attribution},vendorId:$e.clientId})).json()}async function Lt(st,dt){return(await Ge.url(`/checkouts/${st}`).patch(dt)).json()}async function Ot(st){return(await Ge.url(`/checkouts/${st}`).get()).json()}async function jt(st){return(await Ge.url(`/paywalls/${st}`).get()).json()}async function Ft(){return(await Ge.url("/vendor").get()).json()}async function Bt(){return(await Ke.url("/vendors").get()).json()}async function Vt(st){return(await Ke.url(`/contracts/${encodeURIComponent(st.contractId)}/amendments`).post({amendmentType:st.amendmentType,discountCode:st.discountCode})).json()}async function Kt(st){return await Ke.url(`/amendments/${encodeURIComponent(st)}/confirm`).post(),!0}async function zt(){const st=await getTokenSilently(!1),dt=new URL(`${getBaseUrl("account",$e.environment)}/subscriptions/${$e.clientId}`);st&&(dt.hash=`#access_token=${st}`),window.location.href=dt.toString()}return{autoOnboardProduct:bt,cancelContract:ct,confirmAmendment:Kt,createAmendment:Vt,createCheckout:Tt,deleteTag:Pt,deleteTally:Rt,deleteUserMetadata:pt,generateLink:kt,getBill:ut,getBills:ft,getCheckout:Ot,getProxyContent:Ye,getContract:tt,getContracts:et,getEntitlement:Xe,getEntitlementAccess:Je,getEntitlements:We,getFulfillments:Qe,getPaywall:jt,getPaymentIssues:nt,getProfile:Ut,getProduct:At,getSubscriptions:at,getTally:yt,getTallies:It,getTags:Et,getTransaction:rt,getTransactions:ot,getUserMetadata:gt,hasAccess:Ze,isSpotifyLinked:it,linkSpotify:St,listUserMetadata:vt,openHostedAccountPage:zt,pushTally:mt,setTag:Nt,setUserMetadata:lt,unlinkSpotify:ht,updateCheckout:Lt,updateProfile:xt,getVendorSettings:Ft,listVendors:Bt}}const name="@sesamy/sesamy-js",version="1.35.8";function i$5($e,De,Fe,Be,He){for(De=De.split?De.split("."):De,Be=0;Be<De.length;Be++)$e=$e?$e[De[Be]]:He;return $e===He?Fe:$e}var e="undefined",o$4="object",g$1=function(){},b$4="any",m$1="*",j="__",F$2=typeof process<"u"?process:{};F$2.env&&F$2.env.NODE_ENV;var $$1=typeof document<"u";F$2.versions!=null&&F$2.versions.node!=null;typeof Deno<"u"&&Deno.core;$$1&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent!==void 0&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function M$1($e,De){return De.charAt(0)[$e]()+De.slice(1)}var U$1=M$1.bind(null,"toUpperCase"),H$1=M$1.bind(null,"toLowerCase");function J$2($e){return Y$1($e)?U$1("null"):typeof $e=="object"?yn($e):Object.prototype.toString.call($e).slice(8,-1)}function R$1($e,De){De===void 0&&(De=!0);var Fe=J$2($e);return De?H$1(Fe):Fe}function V$1($e,De){return typeof De===$e}var W$1=V$1.bind(null,"function"),q$1=V$1.bind(null,"string"),I$2=V$1.bind(null,"undefined"),Q$1=V$1.bind(null,"boolean");V$1.bind(null,"symbol");function Y$1($e){return $e===null}function nn($e){return R$1($e)==="number"&&!isNaN($e)}function rn($e){return R$1($e)==="array"}function on($e){if(!un($e))return!1;for(var De=$e;Object.getPrototypeOf(De)!==null;)De=Object.getPrototypeOf(De);return Object.getPrototypeOf($e)===De}function un($e){return $e&&(typeof $e=="object"||$e!==null)}function yn($e){return W$1($e.constructor)?$e.constructor.name:null}function hn($e){return $e instanceof Error||q$1($e.message)&&$e.constructor&&nn($e.constructor.stackTraceLimit)}function On($e,De){if(typeof De!="object"||Y$1(De))return!1;if(De instanceof $e)return!0;var Fe=R$1(new $e(""));if(hn(De))for(;De;){if(R$1(De)===Fe)return!0;De=Object.getPrototypeOf(De)}return!1}On.bind(null,TypeError);On.bind(null,SyntaxError);function $n($e,De){var Fe=$e instanceof Element||$e instanceof HTMLDocument;return Fe&&De?Tn($e,De):Fe}function Tn($e,De){return De===void 0&&(De=""),$e&&$e.nodeName===De.toUpperCase()}function _n($e){var De=[].slice.call(arguments,1);return function(){return $e.apply(void 0,[].slice.call(arguments).concat(De))}}_n($n,"form");_n($n,"button");_n($n,"input");_n($n,"select");function Hn($e){return $e?rn($e)?$e:[$e]:[]}function n$1($e){try{return decodeURIComponent($e.replace(/\+/g," "))}catch{return null}}function o$3(){if($$1){var $e=navigator,De=$e.languages;return $e.userLanguage||(De&&De.length?De[0]:$e.language)}}function a$5(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function s$1($e){return function(De){for(var Fe,Be=Object.create(null),He=/([^&=]+)=?([^&]*)/g;Fe=He.exec(De);){var Ke=n$1(Fe[1]),Ge=n$1(Fe[2]);Ke.substring(Ke.length-2)==="[]"?(Be[Ke=Ke.substring(0,Ke.length-2)]||(Be[Ke]=[])).push(Ge):Be[Ke]=Ge===""||Ge}for(var We in Be){var Ze=We.split("[");Ze.length>1&&(m(Be,Ze.map(function(Xe){return Xe.replace(/[?[\]\\ ]/g,"")}),Be[We]),delete Be[We])}return Be}(function(De){return $$1&&window.location.search.substring(1)}())}function m($e,De,Fe){for(var Be=De.length-1,He=0;He<Be;++He){var Ke=De[He];if(Ke==="__proto__"||Ke==="constructor")break;Ke in $e||($e[Ke]={}),$e=$e[Ke]}$e[De[Be]]=Fe}function y$1(){for(var $e="",De=0,Fe=4294967295*Math.random()|0;De++<36;){var Be="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[De-1],He=15&Fe;$e+=Be=="-"||Be=="4"?Be:(Be=="x"?He:3&He|8).toString(16),Fe=De%8==0?4294967295*Math.random()|0:Fe>>4}return $e}function b$3($e,De){var Fe,Be,He,Ke=null,Ge=0,We=function(){Ge=new Date,Ke=null,He=$e.apply(Fe,Be)};return function(){var Ze=new Date;Ge||(Ge=Ze);var Xe=De-(Ze-Ge);return Fe=this,Be=arguments,Xe<=0?(clearTimeout(Ke),Ke=null,Ge=Ze,He=$e.apply(Fe,Be)):Ke||(Ke=setTimeout(We,Xe)),He}}var l$2="global",o$2=j+"global"+j,n=typeof self===o$4&&self.self===self&&self||typeof global===o$4&&global.global===global&&global||void 0;function a$4($e){return n[o$2][$e]}function f$1($e,De){return n[o$2][$e]=De}function i$4($e){delete n[o$2][$e]}function u$3($e,De,Fe){var Be;try{if(b$2($e)){var He=window[$e];Be=He[De].bind(He)}}catch{}return Be||Fe}n[o$2]||(n[o$2]={});var c$3={};function b$2($e){if(typeof c$3[$e]!==e)return c$3[$e];try{var De=window[$e];De.setItem(e,e),De.removeItem(e)}catch{return c$3[$e]=!1}return c$3[$e]=!0}function v(){return v=Object.assign||function($e){for(var De=1;De<arguments.length;De++){var Fe=arguments[De];for(var Be in Fe)Object.prototype.hasOwnProperty.call(Fe,Be)&&($e[Be]=Fe[Be])}return $e},v.apply(this,arguments)}var y="function",b$1="undefined",I$1="@@redux/"+Math.random().toString(36),w=function(){return typeof Symbol===y&&Symbol.observable||"@@observable"}(),E$1=" != "+y;function P($e,De,Fe){var Be;if(typeof De===y&&typeof Fe===b$1&&(Fe=De,De=void 0),typeof Fe!==b$1){if(typeof Fe!==y)throw new Error("enhancer"+E$1);return Fe(P)($e,De)}if(typeof $e!==y)throw new Error("reducer"+E$1);var He=$e,Ke=De,Ge=[],We=Ge,Ze=!1;function Xe(){We===Ge&&(We=Ge.slice())}function Je(){return Ke}function Ye(et){if(typeof et!==y)throw new Error("Listener"+E$1);var tt=!0;return Xe(),We.push(et),function(){if(tt){tt=!1,Xe();var ct=We.indexOf(et);We.splice(ct,1)}}}function Qe(et){if(!on(et))throw new Error("Act != obj");if(typeof et.type===b$1)throw new Error("ActType "+b$1);if(Ze)throw new Error("Dispatch in reducer");try{Ze=!0,Ke=He(Ke,et)}finally{Ze=!1}for(var tt=Ge=We,ct=0;ct<tt.length;ct++)(0,tt[ct])();return et}return Qe({type:"@@redux/INIT"}),(Be={dispatch:Qe,subscribe:Ye,getState:Je,replaceReducer:function(et){if(typeof et!==y)throw new Error("next reducer"+E$1);He=et,Qe({type:"@@redux/INIT"})}})[w]=function(){var et,tt=Ye;return(et={subscribe:function(ct){if(typeof ct!="object")throw new TypeError("Observer != obj");function at(){ct.next&&ct.next(Je())}return at(),{unsubscribe:tt(at)}}})[w]=function(){return this},et},Be}function S($e,De){var Fe=De&&De.type;return"action "+(Fe&&Fe.toString()||"?")+"reducer "+$e+" returns "+b$1}function N$1(){var $e=[].slice.call(arguments);return $e.length===0?function(De){return De}:$e.length===1?$e[0]:$e.reduce(function(De,Fe){return function(){return De(Fe.apply(void 0,[].slice.call(arguments)))}})}function O$1(){var $e=arguments;return function(De){return function(Fe,Be,He){var Ke,Ge=De(Fe,Be,He),We=Ge.dispatch,Ze={getState:Ge.getState,dispatch:function(Xe){return We(Xe)}};return Ke=[].slice.call($e).map(function(Xe){return Xe(Ze)}),v({},Ge,{dispatch:We=N$1.apply(void 0,Ke)(Ge.dispatch)})}}}var A$1=j+"anon_id",_=j+"user_id",x$1=j+"user_traits",k$1="userId",T="anonymousId",z=["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"],M=["name","EVENTS","config","loaded"],q=z.reduce(function($e,De){return $e[De]=De,$e},{registerPluginType:function($e){return"registerPlugin:"+$e},pluginReadyType:function($e){return"ready:"+$e}}),U=/^utm_/,V=/^an_prop_/,L$1=/^an_trait_/;function C$1($e){var De=$e.storage.setItem;return function(Fe){return function(Be){return function(He){if(He.type===q.bootstrap){var Ke=He.params,Ge=He.user,We=He.persistedUser,Ze=He.initialUser,Xe=We.userId===Ge.userId;We.anonymousId!==Ge.anonymousId&&De(A$1,Ge.anonymousId),Xe||De(_,Ge.userId),Ze.traits&&De(x$1,v({},Xe&&We.traits?We.traits:{},Ze.traits));var Je=Object.keys(He.params);if(Je.length){var Ye=Ke.an_uid,Qe=Ke.an_event,et=Je.reduce(function(tt,ct){if(ct.match(U)||ct.match(/^(d|g)clid/)){var at=ct.replace(U,"");tt.campaign[at==="campaign"?"name":at]=Ke[ct]}return ct.match(V)&&(tt.props[ct.replace(V,"")]=Ke[ct]),ct.match(L$1)&&(tt.traits[ct.replace(L$1,"")]=Ke[ct]),tt},{campaign:{},props:{},traits:{}});Fe.dispatch(v({type:q.params,raw:Ke},et,Ye?{userId:Ye}:{})),Ye&&setTimeout(function(){return $e.identify(Ye,et.traits)},0),Qe&&setTimeout(function(){return $e.track(Qe,et.props)},0),Object.keys(et.campaign).length&&Fe.dispatch({type:q.campaign,campaign:et.campaign})}}return Be(He)}}}}function R($e){return function(De,Fe){if(De===void 0&&(De={}),Fe===void 0&&(Fe={}),Fe.type===q.setItemEnd){if(Fe.key===A$1)return v({},De,{anonymousId:Fe.value});if(Fe.key===_)return v({},De,{userId:Fe.value})}switch(Fe.type){case q.identify:return Object.assign({},De,{userId:Fe.userId,traits:v({},De.traits,Fe.traits)});case q.reset:return[_,A$1,x$1].forEach(function(Be){$e.removeItem(Be)}),Object.assign({},De,{userId:null,anonymousId:null,traits:{}});default:return De}}}function $($e){return{userId:$e.getItem(_),anonymousId:$e.getItem(A$1),traits:$e.getItem(x$1)}}var D=function($e){return j+"TEMP"+j+$e};function B($e){var De=$e.storage,Fe=De.setItem,Be=De.removeItem,He=De.getItem;return function(Ke){return function(Ge){return function(We){var Ze=We.userId,Xe=We.traits,Je=We.options;if(We.type===q.reset&&([_,x$1,A$1].forEach(function(et){Be(et)}),[k$1,T,"traits"].forEach(function(et){i$4(D(et))})),We.type===q.identify){He(A$1)||Fe(A$1,y$1());var Ye=He(_),Qe=He(x$1)||{};Ye&&Ye!==Ze&&Ke.dispatch({type:q.userIdChanged,old:{userId:Ye,traits:Qe},new:{userId:Ze,traits:Xe},options:Je}),Ze&&Fe(_,Ze),Xe&&Fe(x$1,v({},Qe,Xe))}return Ge(We)}}}}var X={};function J$1($e,De){X[$e]&&W$1(X[$e])&&(X[$e](De),delete X[$e])}function W($e,De,Fe){return new Promise(function(Be,He){return De()?Be($e):Fe<1?He(v({},$e,{queue:!0})):new Promise(function(Ke){return setTimeout(Ke,10)}).then(function(Ke){return W($e,De,Fe-10).then(Be,He)})})}function H($e){return{abort:$e}}function F$1($e,De,Fe){var Be={},He=De(),Ke=$e.getState(),Ge=Ke.plugins,We=Ke.queue,Ze=Ke.user;if(!Ke.context.offline&&We&&We.actions&&We.actions.length){var Xe=We.actions.reduce(function(Ye,Qe,et){return Ge[Qe.plugin].loaded?(Ye.process.push(Qe),Ye.processIndex.push(et)):(Ye.requeue.push(Qe),Ye.requeueIndex.push(et)),Ye},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(Xe.processIndex&&Xe.processIndex.length){Xe.processIndex.forEach(function(Ye){var Qe=We.actions[Ye],et=Qe.plugin,tt=Qe.payload.type,ct=He[et][tt];if(ct&&W$1(ct)){var at,ft=function(rt,lt){return rt===void 0&&(rt={}),lt===void 0&&(lt={}),[k$1,T].reduce(function(pt,gt){return rt.hasOwnProperty(gt)&&lt[gt]&&lt[gt]!==rt[gt]&&(pt[gt]=lt[gt]),pt},rt)}(Qe.payload,Ze),ut=Be[ft.meta.rid];if(!ut&&(at=ct({payload:ft,config:Ge[et].config,instance:Fe,abort:H}))&&on(at)&&at.abort)return void(Be[ft.meta.rid]=!0);if(!ut){var ot=tt+":"+et;$e.dispatch(v({},ft,{type:ot,_:{called:ot,from:"queueDrain"}}))}}});var Je=We.actions.filter(function(Ye,Qe){return!~Xe.processIndex.indexOf(Qe)});We.actions=Je}}}var G$1=function($e){var De=$e.data,Fe=$e.action,Be=$e.instance,He=$e.state,Ke=$e.allPlugins,Ge=$e.allMatches,We=$e.store,Ze=$e.EVENTS;try{var Xe=He.plugins,Je=He.context,Ye=Fe.type,Qe=Ye.match(K),et=De.exact.map(function(at){return at.pluginName});Qe&&(et=Ge.during.map(function(at){return at.pluginName}));var tt=function(at,ft){return function(ut,ot,rt){var lt=ot.config,pt=ot.name,gt=pt+"."+ut.type;rt&&(gt=rt.event);var vt=ut.type.match(K)?function(Et,Pt,Nt,yt,It){return function(Rt,mt){var At=yt?yt.name:Et,Ut=mt&&ae(mt)?mt:Nt;if(yt&&(!(Ut=mt&&ae(mt)?mt:[Et]).includes(Et)||Ut.length!==1))throw new Error("Method "+Pt+" can only abort "+Et+" plugin. "+JSON.stringify(Ut)+" input valid");return v({},It,{abort:{reason:Rt,plugins:Ut,caller:Pt,_:At}})}}(pt,gt,ft,rt,ut):function(Et,Pt){return function(){throw new Error(Et.type+" action not cancellable. Remove abort in "+Pt)}}(ut,gt);return{payload:ce(ut),instance:at,config:lt||{},abort:vt}}}(Be,et),ct=De.exact.reduce(function(at,ft){var ut=ft.pluginName,ot=ft.methodName,rt=!1;return ot.match(/^initialize/)||ot.match(/^reset/)||(rt=!Xe[ut].loaded),Je.offline&&ot.match(/^(page|track|identify)/)&&(rt=!0),at[""+ut]=rt,at},{});return Promise.resolve(De.exact.reduce(function(at,ft,ut){try{var ot=ft.pluginName;return Promise.resolve(at).then(function(rt){function lt(){return Promise.resolve(rt)}var pt=function(){if(De.namespaced&&De.namespaced[ot])return Promise.resolve(De.namespaced[ot].reduce(function(gt,vt,Et){try{return Promise.resolve(gt).then(function(Pt){return vt.method&&W$1(vt.method)?(function(Rt,mt){var At=ue(Rt);if(At&&At.name===mt){var Ut=ue(At.method);throw new Error([mt+" plugin is calling method "+Rt,"Plugins cant call self","Use "+At.method+" "+(Ut?"or "+Ut.method:"")+" in "+mt+" plugin insteadof "+Rt].join(`
36
36
  `))}}(vt.methodName,vt.pluginName),Promise.resolve(vt.method({payload:Pt,instance:Be,abort:(Nt=Pt,yt=ot,It=vt.pluginName,function(Rt,mt){return v({},Nt,{abort:{reason:Rt,plugins:mt||[yt],caller:Ye,from:It||yt}})}),config:ee(vt.pluginName,Xe,Ke),plugins:Xe})).then(function(Rt){var mt=on(Rt)?Rt:{};return Promise.resolve(v({},Pt,mt))})):Pt;var Nt,yt,It})}catch(Pt){return Promise.reject(Pt)}},Promise.resolve(Fe))).then(function(gt){rt[ot]=gt});rt[ot]=Fe}();return pt&&pt.then?pt.then(lt):lt()})}catch(rt){return Promise.reject(rt)}},Promise.resolve({}))).then(function(at){return Promise.resolve(De.exact.reduce(function(ft,ut,ot){try{var rt=De.exact.length===ot+1,lt=ut.pluginName,pt=Ke[lt];return Promise.resolve(ft).then(function(gt){var vt=at[lt]?at[lt]:{};if(Qe&&(vt=gt),re(vt,lt))return Z({data:vt,method:Ye,instance:Be,pluginName:lt,store:We}),Promise.resolve(gt);if(re(gt,lt))return rt&&Z({data:gt,method:Ye,instance:Be,store:We}),Promise.resolve(gt);if(ct.hasOwnProperty(lt)&&ct[lt]===!0)return We.dispatch({type:"queue",plugin:lt,payload:vt,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(gt);var Et=tt(at[lt],Ke[lt]);return Promise.resolve(pt[Ye]({abort:Et.abort,payload:vt,instance:Be,config:ee(lt,Xe,Ke),plugins:Xe})).then(function(Pt){var Nt=on(Pt)?Pt:{},yt=v({},gt,Nt),It=at[lt];if(re(It,lt))Z({data:It,method:Ye,instance:Be,pluginName:lt,store:We});else{var Rt=Ye+":"+lt;(Rt.match(/:/g)||[]).length<2&&!Ye.match(Q)&&!Ye.match(Y)&&Be.dispatch(v({},Qe?yt:vt,{type:Rt,_:{called:Rt,from:"submethod"}}))}return Promise.resolve(yt)})})}catch(gt){return Promise.reject(gt)}},Promise.resolve(Fe))).then(function(ft){if(!(Ye.match(K)||Ye.match(/^registerPlugin/)||Ye.match(Y)||Ye.match(Q)||Ye.match(/^params/)||Ye.match(/^userIdChanged/))){if(Ze.plugins.includes(Ye),ft._&&ft._.originalAction===Ye)return ft;var ut=v({},ft,{_:{originalAction:ft.type,called:ft.type,from:"engineEnd"}});ie(ft,De.exact.length)&&!Ye.match(/End$/)&&(ut=v({},ut,{type:ft.type+"Aborted"})),We.dispatch(ut)}return ft})})}catch(at){return Promise.reject(at)}},K=/Start$/,Q=/^bootstrap/,Y=/^ready/;function Z($e){var De=$e.pluginName,Fe=$e.method+"Aborted"+(De?":"+De:"");$e.store.dispatch(v({},$e.data,{type:Fe,_:{called:Fe,from:"abort"}}))}function ee($e,De,Fe){var Be=De[$e]||Fe[$e];return Be&&Be.config?Be.config:{}}function ne($e,De){return De.reduce(function(Fe,Be){return Be[$e]?Fe.concat({methodName:$e,pluginName:Be.name,method:Be[$e]}):Fe},[])}function te($e,De){var Fe=$e.replace(K,""),Be=De?":"+De:"";return[""+$e+Be,""+Fe+Be,Fe+"End"+Be]}function re($e,De){var Fe=$e.abort;return!!Fe&&(Fe===!0||oe(Fe,De)||Fe&&oe(Fe.plugins,De))}function ie($e,De){var Fe=$e.abort;if(!Fe)return!1;if(Fe===!0||q$1(Fe))return!0;var Be=Fe.plugins;return ae(Fe)&&Fe.length===De||ae(Be)&&Be.length===De}function ae($e){return Array.isArray($e)}function oe($e,De){return!(!$e||!ae($e))&&$e.includes(De)}function ue($e){var De=$e.match(/(.*):(.*)/);return!!De&&{method:De[1],name:De[2]}}function ce($e){return Object.keys($e).reduce(function(De,Fe){return Fe==="type"||(De[Fe]=on($e[Fe])?Object.assign({},$e[Fe]):$e[Fe]),De},{})}function se($e,De,Fe){var Be={};return function(He){return function(Ke){return function(Ge){try{var We,Ze=function(rt){return We?rt:Ke(Ye)},Xe=Ge.type,Je=Ge.plugins,Ye=Ge;if(Ge.abort)return Promise.resolve(Ke(Ge));if(Xe===q.enablePlugin&&He.dispatch({type:q.initializeStart,plugins:Je,disabled:[],fromEnable:!0,meta:Ge.meta}),Xe===q.disablePlugin&&setTimeout(function(){return J$1(Ge.meta.rid,{payload:Ge})},0),Xe===q.initializeEnd){var Qe=De(),et=Object.keys(Qe),tt=et.filter(function(rt){return Je.includes(rt)}).map(function(rt){return Qe[rt]}),ct=[],at=[],ft=Ge.disabled,ut=tt.map(function(rt){var lt=rt.loaded,pt=rt.name,gt=rt.config;return W(rt,function(){return lt({config:gt})},1e4).then(function(vt){return Be[pt]||(He.dispatch({type:q.pluginReadyType(pt),name:pt,events:Object.keys(rt).filter(function(Et){return!M.includes(Et)})}),Be[pt]=!0),ct=ct.concat(pt),rt}).catch(function(vt){if(vt instanceof Error)throw new Error(vt);return at=at.concat(vt.name),vt})});Promise.all(ut).then(function(rt){var lt={plugins:ct,failed:at,disabled:ft};setTimeout(function(){et.length===ut.length+ft.length&&He.dispatch(v({},{type:q.ready},lt))},0)})}var ot=function(){if(Xe!==q.bootstrap)return/^ready:([^:]*)$/.test(Xe)&&setTimeout(function(){return F$1(He,De,$e)},0),Promise.resolve(function(rt,lt,pt,gt,vt){try{var Et=W$1(lt)?lt():lt,Pt=rt.type,Nt=Pt.replace(K,"");if(rt._&&rt._.called)return Promise.resolve(rt);var yt=pt.getState(),It=(At=Et,(Ut=yt.plugins)===void 0&&(Ut={}),(xt=rt.options)===void 0&&(xt={}),Object.keys(At).filter(function(nt){var it=xt.plugins||{};return Q$1(it[nt])?it[nt]:it.all!==!1&&(!Ut[nt]||Ut[nt].enabled!==!1)}).map(function(nt){return At[nt]}));Pt===q.initializeStart&&rt.fromEnable&&(It=Object.keys(yt.plugins).filter(function(nt){var it=yt.plugins[nt];return rt.plugins.includes(nt)&&!it.initialized}).map(function(nt){return Et[nt]}));var Rt=It.map(function(nt){return nt.name}),mt=function(nt,it,ht){var St=te(nt).map(function(bt){return ne(bt,it)});return it.reduce(function(bt,wt){var kt=wt.name,Tt=te(nt,kt).map(function(Ft){return ne(Ft,it)}),Lt=Tt[0],Ot=Tt[1],jt=Tt[2];return Lt.length&&(bt.beforeNS[kt]=Lt),Ot.length&&(bt.duringNS[kt]=Ot),jt.length&&(bt.afterNS[kt]=jt),bt},{before:St[0],beforeNS:{},during:St[1],duringNS:{},after:St[2],afterNS:{}})}(Pt,It);return Promise.resolve(G$1({action:rt,data:{exact:mt.before,namespaced:mt.beforeNS},state:yt,allPlugins:Et,allMatches:mt,instance:pt,store:gt,EVENTS:vt})).then(function(nt){function it(){var bt=function(){if(Pt.match(K))return Promise.resolve(G$1({action:v({},ht,{type:Nt+"End"}),data:{exact:mt.after,namespaced:mt.afterNS},state:yt,allPlugins:Et,allMatches:mt,instance:pt,store:gt,EVENTS:vt})).then(function(wt){wt.meta&&wt.meta.hasCallback&&J$1(wt.meta.rid,{payload:wt})})}();return bt&&bt.then?bt.then(function(){return nt}):nt}if(ie(nt,Rt.length))return nt;var ht,St=function(){if(Pt!==Nt)return Promise.resolve(G$1({action:v({},nt,{type:Nt}),data:{exact:mt.during,namespaced:mt.duringNS},state:yt,allPlugins:Et,allMatches:mt,instance:pt,store:gt,EVENTS:vt})).then(function(bt){ht=bt});ht=nt}();return St&&St.then?St.then(it):it()})}catch(nt){return Promise.reject(nt)}var At,Ut,xt}(Ge,De,$e,He,Fe)).then(function(rt){return We=1,Ke(rt)})}();return Promise.resolve(ot&&ot.then?ot.then(Ze):Ze(ot))}catch(rt){return Promise.reject(rt)}}}}}function le($e){return function(De){return function(Fe){return function(Be){var He=Be.type,Ke=Be.key,Ge=Be.value,We=Be.options;if(He===q.setItem||He===q.removeItem){if(Be.abort)return Fe(Be);He===q.setItem?$e.setItem(Ke,Ge,We):$e.removeItem(Ke,We)}return Fe(Be)}}}}var fe=function(){var $e=this;this.before=[],this.after=[],this.addMiddleware=function(De,Fe){$e[Fe]=$e[Fe].concat(De)},this.removeMiddleware=function(De,Fe){var Be=$e[Fe].findIndex(function(He){return He===De});Be!==-1&&($e[Fe]=[].concat($e[Fe].slice(0,Be),$e[Fe].slice(Be+1)))},this.dynamicMiddlewares=function(De){return function(Fe){return function(Be){return function(He){var Ke={getState:Fe.getState,dispatch:function(We){return Fe.dispatch(We)}},Ge=$e[De].map(function(We){return We(Ke)});return N$1.apply(void 0,Ge)(Be)(He)}}}}};function de($e){return function(De,Fe){De===void 0&&(De={});var Be={};if(Fe.type==="initialize:aborted")return De;if(/^registerPlugin:([^:]*)$/.test(Fe.type)){var He=pe(Fe.type,"registerPlugin"),Ke=$e()[He];if(!Ke||!He)return De;var Ge=Fe.enabled,We=Ke.config;return Be[He]={enabled:Ge,initialized:!!Ge&&!Ke.initialize,loaded:!!Ge&&!!Ke.loaded({config:We}),config:We},v({},De,Be)}if(/^initialize:([^:]*)$/.test(Fe.type)){var Ze=pe(Fe.type,q.initialize),Xe=$e()[Ze];return Xe&&Ze?(Be[Ze]=v({},De[Ze],{initialized:!0,loaded:!!Xe.loaded({config:Xe.config})}),v({},De,Be)):De}if(/^ready:([^:]*)$/.test(Fe.type))return Be[Fe.name]=v({},De[Fe.name],{loaded:!0}),v({},De,Be);switch(Fe.type){case q.disablePlugin:return v({},De,me(Fe.plugins,!1,De));case q.enablePlugin:return v({},De,me(Fe.plugins,!0,De));default:return De}}}function pe($e,De){return $e.substring(De.length+1,$e.length)}function me($e,De,Fe){return $e.reduce(function(Be,He){return Be[He]=v({},Fe[He],{enabled:De}),Be},Fe)}function ge($e){try{return JSON.parse(JSON.stringify($e))}catch{}return $e}var he={last:{},history:[]};function ve($e,De){$e===void 0&&($e=he);var Fe=De.options,Be=De.meta;if(De.type===q.track){var He=ge(v({event:De.event,properties:De.properties},Object.keys(Fe).length&&{options:Fe},{meta:Be}));return v({},$e,{last:He,history:$e.history.concat(He)})}return $e}var ye={actions:[]};function be($e,De){$e===void 0&&($e=ye);var Fe=De.payload;switch(De.type){case"queue":var Be;return Be=Fe&&Fe.type&&Fe.type===q.identify?[De].concat($e.actions):$e.actions.concat(De),v({},$e,{actions:Be});case"dequeue":return[];default:return $e}}var Ie=/#.*$/;function we($e){var De=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec($e);return"/"+(De&&De[3]?De[3].split("?")[0].replace(Ie,""):"")}var Ee,Pe,Se,Ne,Oe=function($e){if($e===void 0&&($e={}),!$$1)return $e;var De=document,Fe=De.title,Be=De.referrer,He=window,Ke=He.location,Ge=He.innerWidth,We=He.innerHeight,Ze=Ke.hash,Xe=Ke.search,Je=function(Qe){var et=function(){if($$1){for(var tt,ct=document.getElementsByTagName("link"),at=0;tt=ct[at];at++)if(tt.getAttribute("rel")==="canonical")return tt.getAttribute("href")}}();return et?et.match(/\?/)?et:et+Qe:window.location.href.replace(Ie,"")}(Xe),Ye={title:Fe,url:Je,path:we(Je),hash:Ze,search:Xe,width:Ge,height:We};return Be&&Be!==""&&(Ye.referrer=Be),v({},Ye,$e)},Ae={last:{},history:[]};function _e($e,De){$e===void 0&&($e=Ae);var Fe=De.options;if(De.type===q.page){var Be=ge(v({properties:De.properties,meta:De.meta},Object.keys(Fe).length&&{options:Fe}));return v({},$e,{last:Be,history:$e.history.concat(Be)})}return $e}Ee=function(){if(!$$1)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"}(),Pe=$$1?document.referrer:null,Se=o$3(),Ne=a$5();var xe={initialized:!1,sessionId:y$1(),app:null,version:null,debug:!1,offline:!!$$1&&!navigator.onLine,os:{name:Ee},userAgent:$$1?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.13"},timezone:Ne,locale:Se,campaign:{},referrer:Pe};function je($e,De){$e===void 0&&($e=xe);var Fe=$e.initialized,Be=De.campaign;switch(De.type){case q.campaign:return v({},$e,{campaign:Be});case q.offline:return v({},$e,{offline:!0});case q.online:return v({},$e,{offline:!1});default:return Fe?$e:v({},xe,$e,{initialized:!0})}}var ke=["plugins","reducers","storage"];function Te($e,De,Fe){if($$1){var Be=window[(Fe?"add":"remove")+"EventListener"];$e.split(" ").forEach(function(He){Be(He,De)})}}function ze($e){var De=Te.bind(null,"online offline",function(Fe){return Promise.resolve(!navigator.onLine).then($e)});return De(!0),function(Fe){return De(!1)}}function Me(){return f$1("analytics",[]),function($e){return function(De,Fe,Be){var He=$e(De,Fe,Be),Ke=He.dispatch;return Object.assign(He,{dispatch:function(Ge){return n[o$2].analytics.push(Ge.action||Ge),Ke(Ge)}})}}}function qe($e){return function(){return N$1(N$1.apply(null,arguments),Me())}}function Ue($e){return $e?rn($e)?$e:[$e]:[]}function Ve($e,De,Fe){$e===void 0&&($e={});var Be,He,Ke=y$1();return De&&(X[Ke]=(Be=De,He=function(Ge){for(var We,Ze=Ge||Array.prototype.slice.call(arguments),Xe=0;Xe<Ze.length;Xe++)if(W$1(Ze[Xe])){We=Ze[Xe];break}return We}(Fe),function(Ge){He&&He(Ge),Be(Ge)})),v({},$e,{rid:Ke,ts:new Date().getTime()},De?{hasCallback:!0}:{})}function Le($e){$e===void 0&&($e={});var De=$e.reducers||{},Fe=$e.initialUser||{},Be=($e.plugins||[]).reduce(function(nt,it){if(W$1(it))return nt.middlewares=nt.middlewares.concat(it),nt;if(it.NAMESPACE&&(it.name=it.NAMESPACE),!it.name)throw new Error("https://lytics.dev/errors/1");it.config||(it.config={});var ht=it.EVENTS?Object.keys(it.EVENTS).map(function(wt){return it.EVENTS[wt]}):[];nt.pluginEnabled[it.name]=!(it.enabled===!1||it.config.enabled===!1),delete it.enabled,it.methods&&(nt.methods[it.name]=Object.keys(it.methods).reduce(function(wt,kt){var Tt;return wt[kt]=(Tt=it.methods[kt],function(){for(var Lt=Array.prototype.slice.call(arguments),Ot=new Array(Tt.length),jt=0;jt<Lt.length;jt++)Ot[jt]=Lt[jt];return Ot[Ot.length]=lt,Tt.apply({instance:lt},Ot)}),wt},{}),delete it.methods);var St=Object.keys(it).concat(ht),bt=new Set(nt.events.concat(St));if(nt.events=Array.from(bt),nt.pluginsArray=nt.pluginsArray.concat(it),nt.plugins[it.name])throw new Error(it.name+"AlreadyLoaded");return nt.plugins[it.name]=it,nt.plugins[it.name].loaded||(nt.plugins[it.name].loaded=function(){return!0}),nt},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),He=$e.storage?$e.storage:{getItem:a$4,setItem:f$1,removeItem:i$4},Ke=function(nt){return function(it,ht,St){return ht.getState("user")[it]||(St&&on(St)&&St[it]?St[it]:$(nt)[it]||a$4(D(it))||null)}}(He),Ge=Be.plugins,We=Be.events.filter(function(nt){return!M.includes(nt)}).sort(),Ze=new Set(We.concat(z).filter(function(nt){return!M.includes(nt)})),Xe=Array.from(Ze).sort(),Je=function(){return Ge},Ye=new fe,Qe=Ye.addMiddleware,et=Ye.removeMiddleware,tt=Ye.dynamicMiddlewares,ct=function(){throw new Error("Abort disabled inListener")},at=s$1(),ft=$(He),ut=v({},ft,Fe,at.an_uid?{userId:at.an_uid}:{},at.an_aid?{anonymousId:at.an_aid}:{});ut.anonymousId||(ut.anonymousId=y$1());var ot=v({enable:function(nt,it){return new Promise(function(ht){mt.dispatch({type:q.enablePlugin,plugins:Ue(nt),_:{originalAction:q.enablePlugin}},ht,[it])})},disable:function(nt,it){return new Promise(function(ht){mt.dispatch({type:q.disablePlugin,plugins:Ue(nt),_:{originalAction:q.disablePlugin}},ht,[it])})}},Be.methods),rt=!1,lt={identify:function(nt,it,ht,St){try{var bt=q$1(nt)?nt:null,wt=on(nt)?nt:it,kt=ht||{},Tt=lt.user();f$1(D(k$1),bt);var Lt=bt||wt.userId||Ke(k$1,lt,wt);return Promise.resolve(new Promise(function(Ot){mt.dispatch(v({type:q.identifyStart,userId:Lt,traits:wt||{},options:kt,anonymousId:Tt.anonymousId},Tt.id&&Tt.id!==bt&&{previousId:Tt.id}),Ot,[it,ht,St])}))}catch(Ot){return Promise.reject(Ot)}},track:function(nt,it,ht,St){try{var bt=on(nt)?nt.event:nt;if(!bt||!q$1(bt))throw new Error("EventMissing");var wt=on(nt)?nt:it||{},kt=on(ht)?ht:{};return Promise.resolve(new Promise(function(Tt){mt.dispatch({type:q.trackStart,event:bt,properties:wt,options:kt,userId:Ke(k$1,lt,it),anonymousId:Ke(T,lt,it)},Tt,[it,ht,St])}))}catch(Tt){return Promise.reject(Tt)}},page:function(nt,it,ht){try{var St=on(nt)?nt:{},bt=on(it)?it:{};return Promise.resolve(new Promise(function(wt){mt.dispatch({type:q.pageStart,properties:Oe(St),options:bt,userId:Ke(k$1,lt,St),anonymousId:Ke(T,lt,St)},wt,[nt,it,ht])}))}catch(wt){return Promise.reject(wt)}},user:function(nt){if(nt===k$1||nt==="id")return Ke(k$1,lt);if(nt===T||nt==="anonId")return Ke(T,lt);var it=lt.getState("user");return nt?i$5(it,nt):it},reset:function(nt){return new Promise(function(it){mt.dispatch({type:q.resetStart},it,nt)})},ready:function(nt){return rt&&nt({plugins:ot,instance:lt}),lt.on(q.ready,function(it){nt(it),rt=!0})},on:function(nt,it){if(!nt||!W$1(it))return!1;if(nt===q.bootstrap)throw new Error(".on disabled for "+nt);var ht=/Start$|Start:/;if(nt==="*"){var St=function(Tt){return function(Lt){return function(Ot){return Ot.type.match(ht)&&it({payload:Ot,instance:lt,plugins:Ge}),Lt(Ot)}}},bt=function(Tt){return function(Lt){return function(Ot){return Ot.type.match(ht)||it({payload:Ot,instance:lt,plugins:Ge}),Lt(Ot)}}};return Qe(St,Ce),Qe(bt,Re),function(){et(St,Ce),et(bt,Re)}}var wt=nt.match(ht)?Ce:Re,kt=function(Tt){return function(Lt){return function(Ot){return Ot.type===nt&&it({payload:Ot,instance:lt,plugins:Ge,abort:ct}),Lt(Ot)}}};return Qe(kt,wt),function(){return et(kt,wt)}},once:function(nt,it){if(!nt||!W$1(it))return!1;if(nt===q.bootstrap)throw new Error(".once disabled for "+nt);var ht=lt.on(nt,function(St){it({payload:St.payload,instance:lt,plugins:Ge,abort:ct}),ht()});return ht},getState:function(nt){var it=mt.getState();return nt?i$5(it,nt):Object.assign({},it)},dispatch:function(nt){var it=q$1(nt)?{type:nt}:nt;if(z.includes(it.type))throw new Error("reserved action "+it.type);var ht=v({},it,{_:v({originalAction:it.type},nt._||{})});mt.dispatch(ht)},enablePlugin:ot.enable,disablePlugin:ot.disable,plugins:ot,storage:{getItem:He.getItem,setItem:function(nt,it,ht){mt.dispatch({type:q.setItemStart,key:nt,value:it,options:ht})},removeItem:function(nt,it){mt.dispatch({type:q.removeItemStart,key:nt,options:it})}},setAnonymousId:function(nt,it){lt.storage.setItem(A$1,nt,it)},events:{core:z,plugins:We}},pt=Be.middlewares.concat([function(nt){return function(it){return function(ht){return ht.meta||(ht.meta=Ve()),it(ht)}}},tt(Ce),se(lt,Je,{all:Xe,plugins:We}),le(He),C$1(lt),B(lt),tt(Re)]),gt={context:je,user:R(He),page:_e,track:ve,plugins:de(Je),queue:be},vt=N$1,Et=N$1;if($$1&&$e.debug){var Pt=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;Pt&&(vt=Pt({trace:!0,traceLimit:25})),Et=function(){return arguments.length===0?Me():on(typeof arguments[0])?qe():qe().apply(null,arguments)}}var Nt,yt=function(nt){return Object.keys(nt).reduce(function(it,ht){return ke.includes(ht)||(it[ht]=nt[ht]),it},{})}($e),It=Be.pluginsArray.reduce(function(nt,it){var ht=it.name,St=it.config,bt=it.loaded,wt=Be.pluginEnabled[ht];return nt[ht]={enabled:wt,initialized:!!wt&&!it.initialize,loaded:!!bt({config:St}),config:St},nt},{}),Rt={context:yt,user:ut,plugins:It},mt=P(function(nt){for(var it=Object.keys(nt),ht={},St=0;St<it.length;St++){var bt=it[St];typeof nt[bt]===y&&(ht[bt]=nt[bt])}var wt,kt=Object.keys(ht);try{(function(Tt){Object.keys(Tt).forEach(function(Lt){var Ot=Tt[Lt];if(typeof Ot(void 0,{type:"@@redux/INIT"})===b$1||typeof Ot(void 0,{type:I$1})===b$1)throw new Error("reducer "+Lt+" "+b$1)})})(ht)}catch(Tt){wt=Tt}return function(Tt,Lt){if(Tt===void 0&&(Tt={}),wt)throw wt;for(var Ot=!1,jt={},Ft=0;Ft<kt.length;Ft++){var Bt=kt[Ft],Vt=Tt[Bt],Kt=(0,ht[Bt])(Vt,Lt);if(typeof Kt===b$1){var zt=S(Bt,Lt);throw new Error(zt)}jt[Bt]=Kt,Ot=Ot||Kt!==Vt}return Ot?jt:Tt}}(v({},gt,De)),Rt,Et(vt(O$1.apply(void 0,pt))));mt.dispatch=(Nt=mt.dispatch,function(nt,it,ht){var St=v({},nt,{meta:Ve(nt.meta,it,Ue(ht))});return Nt.apply(null,[St])});var At=Object.keys(Ge);mt.dispatch({type:q.bootstrap,plugins:At,config:yt,params:at,user:ut,initialUser:Fe,persistedUser:ft});var Ut=At.filter(function(nt){return Be.pluginEnabled[nt]}),xt=At.filter(function(nt){return!Be.pluginEnabled[nt]});return mt.dispatch({type:q.registerPlugins,plugins:At,enabled:Be.pluginEnabled}),Be.pluginsArray.map(function(nt,it){var ht=nt.bootstrap,St=nt.config,bt=nt.name;ht&&W$1(ht)&&ht({instance:lt,config:St,payload:nt}),mt.dispatch({type:q.registerPluginType(bt),name:bt,enabled:Be.pluginEnabled[bt],plugin:nt}),Be.pluginsArray.length===it+1&&mt.dispatch({type:q.initializeStart,plugins:Ut,disabled:xt})}),ze(function(nt){mt.dispatch({type:nt?q.offline:q.online})}),function(nt,it,ht){setInterval(function(){return F$1(nt,it,ht)},3e3)}(mt,Je,lt),lt}var Ce="before",Re="after",t="cookie",i$3=a$3(),r$2=d$1,c$2=d$1;function u$2($e){return i$3?d$1($e,"",-1):i$4($e)}function a$3(){if(i$3!==void 0)return i$3;var $e="cookiecookie";try{d$1($e,$e),i$3=document.cookie.indexOf($e)!==-1,u$2($e)}catch{i$3=!1}return i$3}function d$1($e,De,Fe,Be,He,Ke){if(typeof window<"u"){var Ge=arguments.length>1;return i$3===!1&&(Ge?f$1($e,De):a$4($e)),Ge?document.cookie=$e+"="+encodeURIComponent(De)+(Fe?"; expires="+new Date(+new Date+1e3*Fe).toUTCString()+(Be?"; path="+Be:"")+(He?"; domain="+He:"")+(Ke?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+$e+"=")[1]||"").split(";")[0])}}var r$1="localStorage",g=b$2.bind(null,"localStorage");u$3("localStorage","getItem",a$4);u$3("localStorage","setItem",f$1);u$3("localStorage","removeItem",i$4);var a$2="sessionStorage",i$2=b$2.bind(null,"sessionStorage");u$3("sessionStorage","getItem",a$4);u$3("sessionStorage","setItem",f$1);u$3("sessionStorage","removeItem",i$4);function I($e){var De=$e;try{if((De=JSON.parse($e))==="true")return!0;if(De==="false")return!1;if(on(De))return De;parseFloat(De)===De&&(De=parseFloat(De))}catch{}if(De!==null&&De!=="")return De}var k=g(),O=i$2(),x=a$3();function C($e,De){if($e){var Fe=A(De),Be=!N(Fe),He=d(Fe)?I(localStorage.getItem($e)):void 0;if(Be&&!I$2(He))return He;var Ke=h(Fe)?I(r$2($e)):void 0;if(Be&&Ke)return Ke;var Ge=E(Fe)?I(sessionStorage.getItem($e)):void 0;if(Be&&Ge)return Ge;var We=a$4($e);return Be?We:{localStorage:He,sessionStorage:Ge,cookie:Ke,global:We}}}function L($e,De,Fe){if($e&&!I$2(De)){var Be={},He=A(Fe),Ke=JSON.stringify(De),Ge=!N(He);return d(He)&&(Be[r$1]=F(r$1,De,I(localStorage.getItem($e))),localStorage.setItem($e,Ke),Ge)?Be[r$1]:h(He)&&(Be[t]=F(t,De,I(r$2($e))),c$2($e,Ke),Ge)?Be[t]:E(He)&&(Be[a$2]=F(a$2,De,I(sessionStorage.getItem($e))),sessionStorage.setItem($e,Ke),Ge)?Be[a$2]:(Be[l$2]=F(l$2,De,a$4($e)),f$1($e,De),Ge?Be[l$2]:Be)}}function b($e,De){if($e){var Fe=A(De),Be=C($e,m$1),He={};return!I$2(Be.localStorage)&&d(Fe)&&(localStorage.removeItem($e),He[r$1]=Be.localStorage),!I$2(Be.cookie)&&h(Fe)&&(u$2($e),He[t]=Be.cookie),!I$2(Be.sessionStorage)&&E(Fe)&&(sessionStorage.removeItem($e),He[a$2]=Be.sessionStorage),!I$2(Be.global)&&G(Fe,l$2)&&(i$4($e),He[l$2]=Be.global),He}}function A($e){return $e?q$1($e)?$e:$e.storage:b$4}function d($e){return k&&G($e,r$1)}function h($e){return x&&G($e,t)}function E($e){return O&&G($e,a$2)}function N($e){return $e===m$1||$e==="all"}function G($e,De){return $e===b$4||$e===De||N($e)}function F($e,De,Fe){return{location:$e,current:De,previous:Fe}}var J={setItem:L,getItem:C,removeItem:b};function _defineProperty($e,De,Fe){return De in $e?Object.defineProperty($e,De,{value:Fe,enumerable:!0,configurable:!0,writable:!0}):$e[De]=Fe,$e}function ownKeys($e,De){var Fe=Object.keys($e);if(Object.getOwnPropertySymbols){var Be=Object.getOwnPropertySymbols($e);De&&(Be=Be.filter(function(He){return Object.getOwnPropertyDescriptor($e,He).enumerable})),Fe.push.apply(Fe,Be)}return Fe}function _objectSpread2($e){for(var De=1;De<arguments.length;De++){var Fe=arguments[De]!=null?arguments[De]:{};De%2?ownKeys(Object(Fe),!0).forEach(function(Be){_defineProperty($e,Be,Fe[Be])}):Object.getOwnPropertyDescriptors?Object.defineProperties($e,Object.getOwnPropertyDescriptors(Fe)):ownKeys(Object(Fe)).forEach(function(Be){Object.defineProperty($e,Be,Object.getOwnPropertyDescriptor(Fe,Be))})}return $e}function analyticsLib(){var $e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},De={storage:J};return Le(_objectSpread2(_objectSpread2({},De),$e))}function saturated($e,De){De=De||{};var Fe,Be,He=[],Ke=De.max||1/0;function Ge(){clearInterval(Fe),$e(He.splice(0,Ke)),We()}function We(){Fe=setInterval(Ge,De.interval||1e4)}return We(),{flush:Ge,push:function(Ze){return Be=He.push(Ze),Be>=Ke&&Ge(),Be},size:function(){return He.length},end:function(Ze){Ze&&Ge(),clearInterval(Fe)}}}function onRouteChange($e){if(typeof window>"u")return;const{addEventListener:De,history:Fe,location:Be}=window;let He=Be.pathname;De("popstate",()=>$e(Be.pathname)),["push","replace"].map(Ke=>{const Ge=`${Ke}State`;if(Ge!=="pushState"&&Ge!=="replaceState")return;const We=Fe[Ge];Fe[Ge]=function(...Ze){var Ye;const Xe=((Ye=Ze[2])==null?void 0:Ye.toString())||"",Je=trimPath(Xe);return He!==Je&&(He=Je,setTimeout(()=>$e(Xe),0)),We.apply(Fe,Ze)}})}function remove($e,De){const Fe=$e.indexOf(De);return Fe>-1?$e.slice(0,Fe):$e}function trimPath($e){return["#","?"].forEach(De=>$e=remove($e,De)),$e}function routeChangeListener(){onRouteChange(()=>{analytics.page()})}function i$1($e){if($e===void 0&&($e={}),!$$1)return g$1;var De=l$1(),Fe=c$1(),Be=o$1(),He=s(Be,De),Ke=s(Fe,De),Ge=[],We=[],Ze=[],Xe=Be,Je=He,Ye=Ke,Qe=Object.keys($e);if(!Qe.length)return g$1;var et=Qe.map(function(ct){return Number(ct)}),tt=b$3(function(){var ct=l$1(),at=function(yt,It){return It.map(function(Rt){return Rt===100?yt-5:yt*(Rt/100)})}(ct,et),ft=c$1(),ut=o$1(),ot=s(ut,ct),rt=s(ft,ct);if(Je=ot>Je?ot:Je,Ye=rt<Ye?rt:Ye,!(Ge.length>=et.length)){var lt=Xe===ut,pt="up";lt?pt="initial":Xe<=ut&&(pt="down");var gt=at,vt=et;(pt==="up"||lt)&&(gt=at.slice().reverse(),vt=et.slice().reverse());var Et=vt.reduce(function(yt,It,Rt){var mt=gt[Rt];return Ze.includes(It)&&ut<=mt&&(Ze=Ze.filter(function(At){return At!==It}),yt.singleFunction=It),pt==="down"&&!Ge.includes(It)&&ut>=mt&&It>Ke?(We.push(It),yt.callbacks=yt.callbacks.concat(It),yt):pt==="up"&&!Ge.includes(It)&&ut<=mt&&It<=ot?(yt.foundFunc=[It],yt):(lt&&ut>=mt&&yt.foundFunc.length===0&&(yt.foundFunc=[It]),!We.includes(It)&&ut>=mt&&(We.push(It),yt.singleFunction?Ze.push(It):yt.singleFunction=It),yt)},{foundFunc:[],singleFunction:null,callbacks:[],direction:pt});if(Xe=ut,pt==="down"&&Et.callbacks&&Et.callbacks.forEach(function(yt){W$1($e[yt])&&($e[yt]({trigger:yt,direction:pt,scrollMin:Ye,scrollMax:Je,range:[Ye,Je]}),Ge.push(yt))}),Et.singleFunction){var Pt=Et.singleFunction,Nt=Et.direction;W$1($e[Pt])&&$e[Pt]({trigger:Pt,direction:Nt,scrollMin:Ye,scrollMax:Je,range:[Ye,Je]}),Ge.push(Pt)}}},500);return window.addEventListener("scroll",tt),function(){return window.removeEventListener("scroll",tt)}}function c$1(){return $$1?document.body.scrollTop||document.documentElement.scrollTop:0}function u$1(){return $$1?window.innerHeight||document.documentElement.clientHeight:0}function o$1(){return Math.round(c$1()+u$1())}function l$1(){if(!$$1)return 0;var $e=document.body,De=document.documentElement;return Math.max($e.scrollHeight,$e.offsetHeight,De.clientHeight,De.scrollHeight,De.offsetHeight)}function s($e,De){return Math.round($e/De*100)}var i="EventListener";function u($e){return function(De,Fe,Be,He){var Ke=Be||g$1,Ge=He||!1;if(!$$1)return Ke;var We=l(Fe),Ze=l(De,!0);if(!Ze.length)throw new Error("noElements");if(!We.length)throw new Error("noEvent");var Xe=[];return function Je(Ye){Ye&&(Xe=[]);for(var Qe=Ye?"add"+i:"remove"+i,et=0;et<Ze.length;et++){var tt=Ze[et];Xe[et]=Ye?Ge&&Ge.once?a$1(Ke):Ke:Xe[et]||Ke;for(var ct=0;ct<We.length;ct++)tt[Qe]?tt["on"+We[ct]]=Ye?Xe[et]:null:tt[Qe](We[ct],Xe[et],Ge)}return Je.bind(null,!Ye)}($e)}}function l($e,De){if(q$1($e))return De?l(document.querySelectorAll($e)):(Fe=$e).split(Fe.indexOf(",")>-1?",":" ").map(function(Ge){return Ge.trim()});var Fe;if(NodeList.prototype.isPrototypeOf($e)){for(var Be=[],He=$e.length>>>0;He--;)Be[He]=$e[He];return Be}var Ke=Hn($e);return De?Ke.map(function(Ge){return q$1(Ge)?l(Ge,!0):Ge}).flat():Ke}function a$1($e,De){var Fe;return function(){return $e&&(Fe=$e.apply(this,arguments),$e=null),Fe}}var f=u("Event");function p($e,De){return $$1&&W$1(window[$e])?(Fe=window[$e],Be=De,(He=window)===void 0&&(He=null),W$1(Fe)?function(){Fe.apply(He,arguments),Be.apply(He,arguments)}:Be):window[$e]=De;var Fe,Be,He}p.bind(null,"onerror");p.bind(null,"onload");var isServer=typeof window>"u",HIDDEN="hidden";function onTabChange($e){if(isServer)return!1;var De=getHiddenProp(),Fe="".concat(De.replace(/[H|h]idden/,""),"visibilitychange"),Be=function(){return $e(!!document[De])},He=function(){return document.addEventListener(Fe,Be)};return He(),function(){return document.removeEventListener(Fe,Be),He}}function getHiddenProp(){var $e=["webkit","moz","ms","o"];return isServer||HIDDEN in document?HIDDEN:$e.reduce(function(De,Fe){var Be=Fe+"Hidden";return!De&&Be in document?Be:De},null)}var o=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function r($e,De){De===void 0&&(De={});var Fe=function(Ge,We){var Ze=this,Xe=!1;return function(Je){Xe||(Ge.call(Ze,Je),Xe=!0,setTimeout(function(){return Xe=!1},We))}}($e,De.throttle||1e4),Be=[];function He(){var Ge=onTabChange(function(We){We||Fe({type:"tabVisible"})});return Be=[Ge].concat(o.map(function(We){return f(document,We,Fe)})).concat(f(window,"load",Fe)).concat(f(window,"scroll",Fe,{capture:!0,passive:!0})),Ke}function Ke(){Be.map(function(Ge){return Ge()})}return He(),function(){return Ke(),He}}function a($e){var De,Fe,Be=$e.onIdle,He=$e.onWakeUp,Ke=$e.onHeartbeat,Ge=$e.timeout,We=Ge===void 0?1e4:Ge,Ze=$e.throttle,Xe=Ze===void 0?2e3:Ze,Je=!1,Ye=!1,Qe=new Date,et=function(){return clearTimeout(De)};function tt(at){et(),Ke&&!Je&&Ke(c(Qe),at),He&&Je&&(Je=!1,He(c(Fe),at),Qe=new Date),De=setTimeout(function(){Je=!0,Be&&(Fe=new Date,Be(c(Qe),at))},We)}var ct=r(tt,{throttle:Xe});return{disable:function(){Ye=!0,Je=!1,et();var at=ct();return function(){return Ye=!1,Qe=new Date,tt({type:"load"}),at()}},getStatus:function(){return{isIdle:Je,isDisabled:Ye,active:Je?0:c(Qe,Ye),idle:Je?c(Fe,Ye):0}}}}function c($e,De){return De?0:Math.round((new Date-$e)/1e3)}const timeout=5e3;class ElementTracker{constructor(De){Dt(this,"element");Dt(this,"isInViewport",!1);Dt(this,"isAwake",!1);Dt(this,"isFlushing");Dt(this,"observer");Dt(this,"lastEventAt",Date.now());Dt(this,"registeredView",!1);Dt(this,"viewCallback");Dt(this,"activeDurationCallback");Dt(this,"idleDurationCallback");Dt(this,"scrollCallback");this.element=De.element,this.viewCallback=De.viewCallback,this.activeDurationCallback=De.activeDurationCallback,this.idleDurationCallback=De.idleDurationCallback,this.scrollCallback=De.scrollCallback,this.observer=new IntersectionObserver(Fe=>{Fe.forEach(Be=>{this.handleInViewPort(Be.isIntersecting)})},{threshold:0}),this.observer.observe(this.element),a({onIdle:Fe=>this.handleAwake(!1,Fe),onWakeUp:Fe=>this.handleAwake(!0,Fe),timeout}),i$1({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(De){De?(this.isAwake=!0,this.trackInViewport()):this.handleAwake(!1),this.isInViewport=De}handleAwake(De,Fe=Math.round((Date.now()-this.lastEventAt)/1e3)){this.isAwake=De,this.lastEventAt=De?Date.now()-Fe*timeout:Date.now(),this.isInViewport&&this.trackAwake(De,Fe)}handleScroll(De){this.scrollCallback&&this.scrollCallback(De)}handleVisibilityChange(){this.isAwake=!1;const De=Math.round((Date.now()-this.lastEventAt)/1e3);De>1&&(this.lastEventAt=Date.now(),this.trackAwake(!1,De))}trackAwake(De,Fe){!De&&this.activeDurationCallback&&this.activeDurationCallback(Fe,this.isFlushing,this.lastEventAt),De&&this.idleDurationCallback&&this.idleDurationCallback(Fe,this.isFlushing,this.lastEventAt)}trackInViewport(){this.registeredView||(this.registeredView=!0,this.viewCallback&&this.viewCallback())}}const SESSION_ID_KEY="sesamy_session_id";function getSessionId(){let $e=sessionStorage.getItem(SESSION_ID_KEY);return $e||($e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(SESSION_ID_KEY,$e)),$e}function generateCSSSelector($e){function De(Be){return Be.id?`#${Be.id}`:Be.classList.length>0?Array.from(Be.classList).map(Ke=>`.${Ke}`).join(""):null}function Fe(Be){const He=[];let Ke=Be;for(;Ke&&Ke!==document.body&&Ke!==document.documentElement;){const Ge=De(Ke);if(Ge){He.unshift(Ge);break}if(Ke.parentElement){const We=Array.from(Ke.parentElement.children),Ze=We.indexOf(Ke)+1,Xe=Ke.tagName.toLowerCase();We.filter(Ye=>Ye.tagName.toLowerCase()===Xe).length>1?He.unshift(`${Xe}:nth-child(${Ze})`):He.unshift(Xe)}Ke=Ke.parentElement}return He.join(" > ")}return Fe($e)}let contentSelectors={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"}},api;function init$2($e,De){var Fe;contentSelectors={...contentSelectors,...(Fe=$e.content)==null?void 0:Fe.article},api=De}function getElementFromSelector($e,De){const{selector:Fe}=De;return Fe===contentSelectors.article.selector?$e:$e.querySelector(Fe)}function getElementValue($e,De){if($e)return De.attribute?De.attribute==="textContent"?$e.textContent??void 0:$e.getAttribute(De.attribute)??getElementValue($e.parentElement,De):$e.textContent??void 0}function getMetaTag($e){const De=document.head.querySelectorAll(`[property~='${$e}'][content]`);for(let Be=0;Be<De.length;Be+=1)if(De[Be].content)return De[Be].content;const Fe=document.head.querySelectorAll(`[name~='${$e}'][content]`);for(let Be=0;Be<Fe.length;Be+=1)if(Fe[Be].content)return Fe[Be].content}function getPropertyFromHTML({publisherContentId:$e,key:De,defaultValue:Fe=""}){const Be=$e?document.body.querySelector(`sesamy-content-data[id='${$e}']`):null;return(Be==null?void 0:Be.getAttribute(De))||getMetaTag(`sesamy:${De}`)||getMetaTag(`og:${De}`)||getMetaTag(De)||Fe}function listContent(){const $e=document.querySelectorAll(contentSelectors.article.selector);return Array.from($e).map(getContent$1).filter(De=>De!==null)}function getContent$1($e){const De=typeof $e=="string"?document.querySelector($e):$e;if(!De)return null;const Fe={element:De,selector:typeof $e=="string"?$e:generateCSSSelector(De)},Be=(He,Ke,Ge,We)=>{const Ze=getElementFromSelector(De,Ke);if(Ze){const Xe=getElementValue(Ze,Ke)||getPropertyFromHTML({publisherContentId:Ge,key:He});Xe!==void 0&&(Fe[He]=We?We(Xe):Xe)}};return Be("id",contentSelectors.id),Be("title",contentSelectors.title,Fe.id),Be("excerpt",contentSelectors.excerpt,Fe.id),Be("image",contentSelectors.image,Fe.id),Be("price",contentSelectors.price,Fe.id,He=>parseFloat(He)),Be("currency",contentSelectors.currency,Fe.id),Be("url",contentSelectors.url,Fe.id),Be("pass",contentSelectors.pass,Fe.id),Be("accessLevel",contentSelectors.accessLevel,Fe.id,He=>He||"entitlement"),Fe}async function unlockContent($e,De){var We;const Fe=typeof $e=="string"?document.querySelector($e):$e;if(!Fe)throw new Error("Could not find element");const Be=getContent$1(Fe);if(!(Be!=null&&Be.url))throw new Error("Could not find content for element");const He=await api.entitlements.hasAccess(Be.url||"",((We=Be.pass)==null?void 0:We.split(","))||[]);if(!He)throw new Error("User does not have access to the content");const Ke=await api.entitlements.access(He.id);if(!Ke.token)throw new Error("Could not get access token");const Ge=De||generateCSSSelector(Fe.parentElement||Fe);return api.proxy.getContent(Ke.token,Be.url,Ge)}function onDOMContentLoaded($e){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",$e):$e()}let flushing=!1,_clientId,_enabled,_endpoint;const visibilityListeners=new Map;function initAnalytics({clientId:$e,enabled:De=!0,environment:Fe}){_clientId=$e,_enabled=De,_endpoint=`${getBaseUrl("logs",Fe)}/events`,_enabled&&(window.addEventListener("beforeunload",()=>{unloadPageListeners.forEach((Be,He)=>{Be.bind(He)()}),flushQueue()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&visibilityListeners.forEach((Be,He)=>{Be.bind(He)()})}),routeChangeListener(),onDOMContentLoaded(()=>{const Be=new ElementTracker({element:document.body,viewCallback:()=>{analytics.page()},activeDurationCallback:(He,Ke,Ge)=>{analytics.track("activeDuration",{duration:He,durationStart:Ge,flushing:Ke})},idleDurationCallback:(He,Ke,Ge)=>{analytics.track("idleDuration",{duration:He,durationStart:Ge,flushing:Ke})},scrollCallback:He=>{analytics.track("scroll",{scroll:He.scrollMax})}});addUnloadPageListener(document.body,()=>{Be.flush()}),addVisibilityListener(document.body,()=>{Be.handleVisibilityChange()})}),window.addEventListener(Events.AUTHENTICATED,async Be=>{const He=Be;await analytics.identify(He.detail.sub)}),window.addEventListener(Events.LOGOUT,async()=>{await analytics.track("logout",{}),queue.flush(),await analytics.reset()}))}function createMessage($e){return JSON.stringify($e.map(De=>({...De,clientId:_clientId,requestId:Math.random().toString(36).slice(2,9),sessionId:getSessionId(),timestamp:new Date().toISOString(),version,event:De.event,context:{page:{url:window.location.href,title:document.title,referrer:document.referrer,itemSrc:getMetaTag("sesamy:item-src"),publisherContentId:getMetaTag("sesamy:publisher-content-id")},locale:navigator.language,library:name,userAgent:navigator.userAgent,clientId:_clientId}})))}const queue=saturated(async $e=>{if($e.length>0){const De=createMessage($e);flushing?navigator.sendBeacon(_endpoint,De):(await fetch(_endpoint,{method:"POST",body:De,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function send($e){var De;if($e.anonymousId)if((De=$e.properties)!=null&&De.flushing){const Fe={...$e};delete Fe.properties.flushing,navigator.sendBeacon(_endpoint,createMessage([Fe]))}else queue.push($e)}const analytics=analyticsLib({app:name,version,plugins:[{name:"custom-analytics-plugin",page:({payload:$e})=>{const{properties:De,anonymousId:Fe,userId:Be,event:He}=$e;send({anonymousId:Fe,userId:Be,properties:De,event:He,type:"page"})},track:({payload:$e})=>{const{properties:De,anonymousId:Fe,userId:Be,event:He}=$e;send({anonymousId:Fe,userId:Be,properties:De,event:He,type:"track"})},identify:({payload:$e})=>{const{properties:De,anonymousId:Fe,userId:Be}=$e;send({anonymousId:Fe,userId:Be,properties:De,type:"identify"})}}]});function track($e,De){analytics.track($e,De)}function flushQueue(){return flushing=!0,queue.flush()}const unloadPageListeners=new Map;function addUnloadPageListener($e,De){unloadPageListeners.set($e,De)}function addVisibilityListener($e,De){visibilityListeners.set($e,De)}const bannerIds=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function detectAdblock(){return new Promise($e=>{const De=bannerIds.map(Fe=>{const Be=document.createElement("div");return Be.innerHTML="&nbsp;",Be.id=Fe,Be.style.position="absolute",document.body.appendChild(Be),Be});window.setTimeout(()=>{const Fe=!De.every(Be=>{const He=document.querySelector(`#${Be.id}`);return He==null?void 0:He.offsetParent});De.forEach(Be=>Be.remove()),$e(Fe)},100)})}function isInAppBrowser(){const $e=navigator.userAgent.toLowerCase(),De=[{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 Fe of De)if(Fe.regex.test($e))return{isInAppBrowser:!0,browserName:Fe.name};return/; wv\)/.test($e)?{isInAppBrowser:!0,browserName:"Unknown In-App Browser"}:{isInAppBrowser:!1,browserName:null}}function registerAPI($e){const{autoOnboardProduct:De,cancelContract:Fe,createCheckout:Be,deleteTag:He,deleteTally:Ke,deleteUserMetadata:Ge,generateLink:We,getBill:Ze,getBills:Xe,getCheckout:Je,getContract:Ye,getContracts:Qe,getEntitlement:et,getEntitlementAccess:tt,getEntitlements:ct,getFulfillments:at,getPaywall:ft,getPaymentIssues:ut,getProfile:ot,getProduct:rt,getProxyContent:lt,getSubscriptions:pt,getTags:gt,getTally:vt,getTallies:Et,getTransaction:Pt,getTransactions:Nt,getUserMetadata:yt,getVendorSettings:It,listVendors:Rt,hasAccess:mt,isSpotifyLinked:At,linkSpotify:Ut,listUserMetadata:xt,openHostedAccountPage:nt,pushTally:it,setTag:ht,setUserMetadata:St,unlinkSpotify:bt,updateCheckout:wt,updateProfile:kt}=createApi($e),Tt={analytics:{track},attribution:{get:getAttribution,set:setAttribution},auth:{getUser:ot,isAuthenticated,loginWithRedirect,logout,setToken},bills:{get:Ze,list:Xe},browser:{detectAdblock,isInAppBrowser,isIncognito},checkouts:{create:Be,get:Je,update:wt},clearCache,content:{list:listContent,get:getContent$1,getLanguage,unlock:unlockContent,getPropertyFromHTML},contracts:{cancel:Fe,get:Ye,list:Qe},entitlements:{access:tt,get:et,hasAccess:mt,list:ct,signedLinks:getSignedLinks},flags:{get:getFlag,set:setFlag,list:listFlags,delete:deleteFlag},fulfillments:{list:at},generateLink:We,getPaymentIssues:ut,getVersion,isReady:()=>exports.isInitialized,log,paywalls:{get:ft},products:{autoOnboard:De,get:rt,linkSpotify:Ut},profile:{get:ot,isSpotifyLinked:At,openHostedAccountPage:nt,unlinkSpotify:bt,update:kt},proxy:{getContent:lt},subscriptions:{list:pt},tags:{delete:He,list:gt,set:ht},tallies:{delete:Ke,get:vt,list:Et,push:it},transactions:{get:Pt,list:Nt},userMetadata:{delete:Ge,get:yt,list:xt,set:St},vendors:{get:It,list:Rt},setToken};return $e.namespace&&(window[$e.namespace]=Tt),Tt}function getVersion(){return version}function gradient($e,De){$e.style.position="relative",$e.style.height="200px",$e.style.overflow="hidden";let Be=0;const He=Array.from($e.children);for(const Ge of He){const We=Ge.offsetHeight;Be+We>200?Ge.remove():Be+=We}const Ke=document.createElement("style");Ke.innerHTML=`
37
37
  ${De.selector}::before {
38
38
  content: '';