PageSourceSearch

https://www.lyster.io/assets/index-CRu6kqKr.js

js lyster.io collected 2026-10-04 03:03:39 UTC 1,353,637 bytes, 81 lines download raw bytes

vendor: 4,396 bytes, line 1
1function QZ(t,e){for(var n=0;n<e.length;n++){const i=e[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in t)){const o=Object.getOwnPropertyDescriptor(i,r);o&&Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();function qD(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kk={exports:{}},up={};var SP;function eW(){if(SP)return up;SP=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(i,r,o){var l=null;if(o!==void 0&&(l=""+o),r.key!==void 0&&(l=""+r.key),"key"in r){o={};for(var u in r)u!=="key"&&(o[u]=r[u])}else o=r;return r=o.ref,{$$typeof:t,type:i,key:l,ref:r!==void 0?r:null,props:o}}return up.Fragment=e,up.jsx=n,up.jsxs=n,up}var kP;function tW(){return kP||(kP=1,kk.exports=eW()),kk.exports}var w=tW(),Ek={exports:{}},ht={};var EP;function nW(){if(EP)return ht;EP=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),v=Symbol.for("react.view_transition"),y=Symbol.iterator;function b(P){return P===null||typeof P!="object"?null:(P=y&&P[y]||P["@@iterator"],typeof P=="function"?P:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,k={};function T(P,F,re){this.props=P,this.context=F,this.refs=k,this.updater=re||x}T.prototype.isReactComponent={},T.prototype.setState=function(P,F){if(typeof P!="object"&&typeof P!="function"&&P!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,P,F,"setState")},T.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function C(){}C.prototype=T.prototype;function A(P,F,re){this.props=P,this.context=F,this.refs=k,this.updater=re||x}var $=A.prototype=new C;$.constructor=A,S($,T.prototype),$.isPureReactComponent=!0;var N=Array.isArray;function j(){}var O={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function B(P,F,re){var Y=re.ref;return{$$typeof:t,type:P,key:F,ref:Y!==void 0?Y:null,props:re}}function V(P,F){return B(P.type,F,P.props)}function ee(P){return typeof P=="object"&&P!==null&&P.$$typeof===t}function me(P){var F={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(re){return F[re]})}var ne=/\/+/g;function ce(P,F){return typeof P=="object"&&P!==null&&P.key!=null?me(""+P.key):F.toString(36)}function Z(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(j,j):(P.status="pending",P.then(function(F){P.status==="pending"&&(P.status="fulfilled",P.value=F)},function(F){P.status==="pending"&&(P.status="rejected",P.reason=F)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function ae(P,F,re,Y,de){var ke=typeof P;(ke==="undefined"||ke==="boolean")&&(P=null);var Ae=!1;if(P===null)Ae=!0;else switch(ke){case"bigint":case"string":case"number":Ae=!0;break;case"object":switch(P.$$typeof){case t:case e:Ae=!0;break;case p:return Ae=P._init,ae(Ae(P._payload),F,re,Y,de)}}if(Ae)return de=de(P),Ae=Y===""?"."+ce(P,0):Y,N(de)?(re="",Ae!=null&&(re=Ae.replace(ne,"$&/")+"/"),ae(de,F,re,"",function(je){return je}
vendor: 6,923 bytes, line 1
1)):de!=null&&(ee(de)&&(de=V(de,re+(de.key==null||P&&P.key===de.key?"":(""+de.key).replace(ne,"$&/")+"/")+Ae)),F.push(de)),1;Ae=0;var Se=Y===""?".":Y+":";if(N(P))for(var oe=0;oe<P.length;oe++)Y=P[oe],ke=Se+ce(Y,oe),Ae+=ae(Y,F,re,ke,de);else if(oe=b(P),typeof oe=="function")for(P=oe.call(P),oe=0;!(Y=P.next()).done;)Y=Y.value,ke=Se+ce(Y,oe++),Ae+=ae(Y,F,re,ke,de);else if(ke==="object"){if(typeof P.then=="function")return ae(Z(P),F,re,Y,de);throw F=String(P),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return Ae}function ue(P,F,re){if(P==null)return P;var Y=[],de=0;return ae(P,Y,"","",function(ke){return F.call(re,ke,de++)}),Y}function ge(P){if(P._status===-1){var F=P._result,re=F();re.then(function(Y){(P._status===0||P._status===-1)&&(P._status=1,P._result=Y,re.status===void 0&&(re.status="fulfilled",re.value=Y))},function(Y){(P._status===0||P._status===-1)&&(P._status=2,P._result=Y,re.status===void 0&&(re.status="rejected",re.reason=Y))}),P._status===-1&&(P._status=0,P._result=re)}if(P._status===1)return P._result.default;throw P._result}var Re=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)};function xe(P){var F=O.T,re={};re.types=F!==null?F.types:null,O.T=re;try{var Y=P(),de=O.S;de!==null&&de(re,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(j,Re)}catch(ke){Re(ke)}finally{F!==null&&re.types!==null&&(F.types=re.types),O.T=F}}function Ie(P){var F=O.T;if(F!==null){var re=F.types;re===null?F.types=[P]:re.indexOf(P)===-1&&re.push(P)}else xe(Ie.bind(null,P))}var Oe={map:ue,forEach:function(P,F,re){ue(P,function(){F.apply(this,arguments)},re)},count:function(P){var F=0;return ue(P,function(){F++}),F},toArray:function(P){return ue(P,function(F){return F})||[]},only:function(P){if(!ee(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return ht.Activity=g,ht.Children=Oe,ht.Component=T,ht.Fragment=n,ht.Profiler=r,ht.PureComponent=A,ht.StrictMode=i,ht.Suspense=d,ht.ViewTransition=v,ht.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,ht.__COMPILER_RUNTIME={__proto__:null,c:function(P){return O.H.useMemoCache(P)}},ht.addTransitionType=Ie,ht.cache=function(P){return function(){return P.apply(null,arguments)}},ht.cacheSignal=function(){return null},ht.cloneElement=function(P,F,re){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var Y=S({},P.props),de=P.key;if(F!=null)for(ke in F.key!==void 0&&(de=""+F.key),F)!L.call(F,ke)||ke==="key"||ke==="__self"||ke==="__source"||ke==="ref"&&F.ref===void 0||(Y[ke]=F[ke]);var ke=arguments.length-2;if(ke===1)Y.children=re;else if(1<ke){for(var Ae=Array(ke),Se=0;Se<ke;Se++)Ae[Se]=arguments[Se+2];Y.children=Ae}return B(P.type,de,Y)},ht.createContext=function(P){return P={$$typeof:l,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:o,_context:P},P},ht.createElement=function(P,F,re){var Y,de={},ke=null;if(F!=null)for(Y in F.key!==void 0&&(ke=""+F.key),F)L.call(F,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(de[Y]=F[Y]);var Ae=arguments.length-2;if(Ae===1)de.children=re;else if(1<Ae){for(var Se=Array(Ae),oe=0;oe<Ae;oe++)Se[oe]=arguments[oe+2];de.children=Se}if(P&&P.defaultProps)for(Y in Ae=P.defaultProps,Ae)de[Y]===void 0&&(de[Y]=Ae[Y]);return B(P,ke,de)},ht.createRef=function(){return{current:null}},ht.forwardRef=function(P){return{$$typeof:u,render:P}},ht.isValidElement=ee,ht.lazy=function(P){return{$$typeof:p,_payload:{_status:-1,_result:P},_init:ge}},ht.memo=function(P,F){return{$$typeof:f,type:P,compare:F===void 0?null:F}},ht.startTransition=xe,ht.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},ht.use=function(P){return O.H.use(P)},ht.useActionState=function(P,F,re){return O.H.useActionState(P,F,re)},ht.useCallback=function(P,F){return O.H.useCallback(P,F)},ht.useContext=function(P){return O.H.useContext(P)},ht.useDebugValue=function(){},ht.useDeferredValue=function(P,F){return O.H.useDeferredValue(P,F)},ht.useEffect=function(P,F){return O.H.useEffect(P,F)},ht.useEffectEvent=function(P){return O.H.useEffectEvent(P)},ht.useId=function(){return O.H.useId()},ht.useImperativeHandle=function(P,F,re){return O.H.useImperativeHandle(P,F,re)},ht.useInsertionEffect=function(P,F){return O.H.useInsertionEffect(P,F)},ht.useLayoutEffect=function(P,F){return O.H.useLayoutEffect(P,F)},ht.useMemo=function(P,F){return O.H.useMemo(P,F)},ht.useOptimistic=function(P,F){return O.H.useOptimistic(P,F)},ht.useReducer=function(P,F,re){return O.H.useReducer(P,F,re)},ht.useRef=function(P){return O.H.useRef(P)},ht.useState=function(P){return O.H.useState(P)},ht.useSyncExternalStore=function(P,F,re){return O.H.useSyncExternalStore(P,F,re)},ht.useTransition=function(){return O.H.useTransition()},ht.version="19.3.0",ht}var TP;function lC(){return TP||(TP=1,Ek.exports=nW()),Ek.exports}var M=lC();const Na=qD(M),iW=QZ({__proto__:null,default:Na},[M]);var Tk={exports:{}},dp={},Ck={exports:{}},Ok={};var CP;function rW(){return CP||(CP=1,(function(t){function e(Z,ae){var ue=Z.length;Z.push(ae);e:for(;0<ue;){var ge=ue-1>>>1,Re=Z[ge];if(0<r(Re,ae))Z[ge]=ae,Z[ue]=Re,ue=ge;else break e}}function n(Z){return Z.length===0?null:Z[0]}function i(Z){if(Z.length===0)return null;var ae=Z[0],ue=Z.pop();if(ue!==ae){Z[0]=ue;e:for(var ge=0,Re=Z.length,xe=Re>>>1;ge<xe;){var Ie=2*(ge+1)-1,Oe=Z[Ie],P=Ie+1,F=Z[P];if(0>r(Oe,ue))P<Re&&0>r(F,Oe)?(Z[ge]=F,Z[P]=ue,ge=P):(Z[ge]=Oe,Z[Ie]=ue,ge=Ie);else if(P<Re&&0>r(F,ue))Z[ge]=F,Z[P]=ue,ge=P;else break e}}return ae}function r(Z,ae){var ue=Z.sortIndex-ae.sortIndex;return ue!==0?ue:Z.id-ae.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();t.unstable_now=function(){return l.now()-u}}var d=[],f=[],p=1,g=null,v=3,y=!1,b=!1,x=!1,S=!1,k=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function A(Z){for(var ae=n(f);ae!==null;){if(ae.callback===null)i(f);else if(ae.startTime<=Z)i(f),ae.sortIndex=ae.expirationTime,e(d,ae);else break;ae=n(f)}}function $(Z){if(x=!1,A(Z),!b)if(n(d)!==null)b=!0,N||(N=!0,ee());else{var ae=n(f);ae!==null&&ce($,ae.startTime-Z)}}var N=!1,j=-1,O=5,L=-1;function B(){return S?!0:!(t.unstable_now()-L<O)}
vendor: 28,254 bytes, lines 1-8
1function V(){if(S=!1,N){var Z=t.unstable_now();L=Z;var ae=!0;try{e:{b=!1,x&&(x=!1,T(j),j=-1),y=!0;var ue=v;try{t:{for(A(Z),g=n(d);g!==null&&!(g.expirationTime>Z&&B());){var ge=g.callback;if(typeof ge=="function"){g.callback=null,v=g.priorityLevel;var Re=ge(g.expirationTime<=Z);if(Z=t.unstable_now(),typeof Re=="function"){g.callback=Re,A(Z),ae=!0;break t}g===n(d)&&i(d),A(Z)}else i(d);g=n(d)}if(g!==null)ae=!0;else{var xe=n(f);xe!==null&&ce($,xe.startTime-Z),ae=!1}}break e}finally{g=null,v=ue,y=!1}ae=void 0}}finally{ae?ee():N=!1}}}var ee;if(typeof C=="function")ee=function(){C(V)};else if(typeof MessageChannel<"u"){var me=new MessageChannel,ne=me.port2;me.port1.onmessage=V,ee=function(){ne.postMessage(null)}}else ee=function(){k(V,0)};function ce(Z,ae){j=k(function(){Z(t.unstable_now())},ae)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(Z){Z.callback=null},t.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<Z?Math.floor(1e3/Z):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_next=function(Z){switch(v){case 1:case 2:case 3:var ae=3;break;default:ae=v}var ue=v;v=ae;try{return Z()}finally{v=ue}},t.unstable_requestPaint=function(){S=!0},t.unstable_runWithPriority=function(Z,ae){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var ue=v;v=Z;try{return ae()}finally{v=ue}},t.unstable_scheduleCallback=function(Z,ae,ue){var ge=t.unstable_now();switch(typeof ue=="object"&&ue!==null?(ue=ue.delay,ue=typeof ue=="number"&&0<ue?ge+ue:ge):ue=ge,Z){case 1:var Re=-1;break;case 2:Re=250;break;case 5:Re=1073741823;break;case 4:Re=1e4;break;default:Re=5e3}return Re=ue+Re,Z={id:p++,callback:ae,priorityLevel:Z,startTime:ue,expirationTime:Re,sortIndex:-1},ue>ge?(Z.sortIndex=ue,e(f,Z),n(d)===null&&Z===n(f)&&(x?(T(j),j=-1):x=!0,ce($,ue-ge))):(Z.sortIndex=Re,e(d,Z),b||y||(b=!0,N||(N=!0,ee()))),Z},t.unstable_shouldYield=B,t.unstable_wrapCallback=function(Z){var ae=v;return function(){var ue=v;v=ae;try{return Z.apply(this,arguments)}finally{v=ue}}}})(Ok)),Ok}var OP;function sW(){return OP||(OP=1,Ck.exports=rW()),Ck.exports}var Rk={exports:{}},Zi={};var RP;function oW(){if(RP)return Zi;RP=1;var t=lC();function e(p){var g="https://react.dev/errors/"+p;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)g+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+p+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},r=Symbol.for("react.portal"),o=Symbol.for("react.recoverable"),l=Symbol.for("react.optimistic_key");function u(p,g,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:y==null?null:y===l?l:""+y,children:p,containerInfo:g,implementation:v}}var d=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(p,g){if(p==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return Zi.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Zi.browser=function(p){return{$$typeof:o,_reason:p}},Zi.createPortal=function(p,g){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(e(299));return u(p,g,null,v)},Zi.flushSync=function(p){var g=d.T,v=i.p;try{if(d.T=null,i.p=2,p)return p()}finally{d.T=g,i.p=v,i.d.f()}},Zi.preconnect=function(p,g){typeof p=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,i.d.C(p,g))},Zi.prefetchDNS=function(p){typeof p=="string"&&i.d.D(p)},Zi.preinit=function(p,g){if(typeof p=="string"&&g&&typeof g.as=="string"){var v=g.as,y=f(v,g.crossOrigin),b=typeof g.integrity=="string"?g.integrity:void 0,x=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;v==="style"?i.d.S(p,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:y,integrity:b,fetchPriority:x}):v==="script"&&i.d.X(p,{crossOrigin:y,integrity:b,fetchPriority:x,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},Zi.preinitModule=function(p,g){if(typeof p=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var v=f(g.as,g.crossOrigin);i.d.M(p,{crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0})}}else g==null&&i.d.M(p)},Zi.preload=function(p,g){if(typeof p=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var v=g.as,y=f(v,g.crossOrigin);i.d.L(p,v,{crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},Zi.preloadModule=function(p,g){if(typeof p=="string")if(g){var v=f(g.as,g.crossOrigin);i.d.m(p,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0})}else i.d.m(p)},Zi.requestFormReset=function(p){i.d.r(p)},Zi.unstable_batchedUpdates=function(p,g){return p(g)},Zi.useFormState=function(p,g,v){return d.H.useFormState(p,g,v)},Zi.useFormStatus=function(){return d.H.useHostTransitionStatus()},Zi.version="19.3.0",Zi}var $P;function VD(){if($P)return Rk.exports;$P=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Rk.exports=oW(),Rk.exports}var AP;function aW(){if(AP)return dp;AP=1;var t=sW(),e=lC(),n=VD();function i(s){var a="https://react.dev/errors/"+s;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)a+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+s+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function o(s){for(var a=s,c=a;c&&!c.alternate;)a=c,(a.flags&4098)!==0&&(s=a.return),c=a.return;for(;a.return;)a=a.return;return a.tag===3?s:null}function l(s){if(s.tag===13){var a=s.memoizedState;if(a===null&&(s=s.alternate,s!==null&&(a=s.memoizedState)),a!==null)return a.dehydrated}return null}function u(s){if(s.tag===31){var a=s.memoizedState;if(a===null&&(s=s.alternate,s!==null&&(a=s.memoizedState)),a!==null)return a.dehydrated}return null}function d(s){if(o(s)!==s)throw Error(i(188))}function f(s){var a=s.alternate;if(!a){if(a=o(s),a===null)throw Error(i(188));return a!==s?null:s}for(var c=s,h=a;;){var m=c.return;if(m===null)break;var _=m.alternate;if(_===null){if(h=m.return,h!==null){c=h;continue}break}if(m.child===_.child){for(_=m.child;_;){if(_===c)return d(m),s;if(_===h)return d(m),a;_=_.sibling}throw Error(i(188))}if(c.return!==h.return)c=m,h=_;else{for(var E=!1,R=m.child;R;){if(R===c){E=!0,c=m,h=_;break}if(R===h){E=!0,h=m,c=_;break}R=R.sibling}if(!E){for(R=_.child;R;){if(R===c){E=!0,c=_,h=m;break}if(R===h){E=!0,h=_,c=m;break}R=R.sibling}if(!E)throw Error(i(189))}}if(c.alternate!==h)throw Error(i(190))}if(c.tag!==3)throw Error(i(188));return c.stateNode.current===c?s:a}function p(s){var a=s.tag;if(a===5||a===26||a===27||a===6)return s;for(s=s.child;s!==null;){if(a=p(s),a!==null)return a;s=s.sibling}return null}function g(s,a,c,h,m,_){for(;s!==null;){if((s.tag===5||s.tag===27||s.tag===6)&&c(s,h,m,_)||(s.tag!==22||s.memoizedState===null)&&(a||s.tag!==5&&s.tag!==27)&&g(s.child,a,c,h,m,_))return!0;s=s.sibling}return!1}function v(s){for(s=s.return;s!==null;){if(s.tag===3||s.tag===5||s.tag===27)return s;s=s.return}return null}function y(s){var a=!1;for(s=s.return;s!==null&&(s.tag===4&&(a=!0),!(s.tag===3||s.tag===5||s.tag===27));)s=s.return;return a}function b(s){var a=[null,null],c=v(s);return c===null||x(a,s,c.child,{foundSelf:!1}),a}function x(s,a,c,h){for(;c!==null;){if(c===a)h.foundSelf=!0;else if(c.tag===5||c.tag===27||c.tag===6){if(h.foundSelf)return s[1]=c,!0;s[0]=c}else if((c.tag!==22||c.memoizedState===null)&&x(s,a,c.child,h))return!0;c=c.sibling}return!1}function S(s){switch(s.tag){case 5:case 27:case 6:return s.stateNode;case 3:return s.stateNode.containerInfo;default:throw Error(i(559))}}var k=null,T=null;function C(s,a,c){return s===c?!0:s===a?(k=s,!0):!1}function A(s,a,c){return s===c?(T=s,!1):s===a?(T!==null&&(k=s),!0):!1}function $(s){if(s===null)return null;do s=s===null?null:s.return;while(s&&s.tag!==5&&s.tag!==27&&s.tag!==3);return s||null}function N(s,a,c){for(var h=0,m=s;m;m=c(m))h++;m=0;for(var _=a;_;_=c(_))m++;for(;0<h-m;)s=c(s),h--;for(;0<m-h;)a=c(a),m--;for(;h--;){if(s===a||a!==null&&s===a.alternate)return s;s=c(s),a=c(a)}return null}var j=Object.assign,O=Symbol.for("react.element"),L=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),ee=Symbol.for("react.strict_mode"),me=Symbol.for("react.profiler"),ne=Symbol.for("react.consumer"),ce=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),ae=Symbol.for("react.suspense"),ue=Symbol.for("react.suspense_list"),ge=Symbol.for("react.memo"),Re=Symbol.for("react.lazy"),xe=Symbol.for("react.activity"),Ie=Symbol.for("react.legacy_hidden"),Oe=Symbol.for("react.memo_cache_sentinel"),P=Symbol.for("react.view_transition"),F=Symbol.for("react.recoverable"),re=Symbol.iterator;function Y(s){return s===null||typeof s!="object"?null:(s=re&&s[re]||s["@@iterator"],typeof s=="function"?s:null)}var de=Symbol.for("react.client.reference");function ke(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===de?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case V:return"Fragment";case me:return"Profiler";case ee:return"StrictMode";case ae:return"Suspense";case ue:return"SuspenseList";case xe:return"Activity";case P:return"ViewTransition"}if(typeof s=="object")switch(s.$$typeof){case B:return"Portal";case ce:return s.displayName||"Context";case ne:return(s._context.displayName||"Context")+".Consumer";case Z:var a=s.render;return s=s.displayName,s||(s=a.displayName||a.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case ge:return a=s.displayName||null,a!==null?a:ke(s.type)||"Memo";case Re:a=s._payload,s=s._init;try{return ke(s(a))}catch{}}return null}var Ae=Array.isArray,Se=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,je={pending:!1,data:null,method:null,action:null},$e=[],Le=-1;function Pe(s){return{current:s}}function ze(s){0>Le||(s.current=$e[Le],$e[Le]=null,Le--)}function Ge(s,a){Le++,$e[Le]=s.current,s.current=a}var vt=Pe(null),en=Pe(null),yt=Pe(null),Kt=Pe(null);function tn(s,a){switch(Ge(yt,a),Ge(en,s),Ge(vt,null),a.nodeType){case 9:case 11:s=(s=a.documentElement)&&(s=s.namespaceURI)?jj(s):0;break;default:if(s=a.tagName,a=a.namespaceURI)a=jj(a),s=Pj(a,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}ze(vt),Ge(vt,s)}function Xn(){ze(vt),ze(en),ze(yt)}function kt(s){var a=s.memoizedState;a!==null&&(Ad._currentValue=a.memoizedState,Ge(Kt,s)),a=vt.current;var c=Pj(a,s.type);a!==c&&(Ge(en,s),Ge(vt,c))}function bn(s){en.current===s&&(ze(vt),ze(en)),Kt.current===s&&(ze(Kt),Ad._currentValue=je)}var Kn,hr;function An(s){if(Kn===void 0)try{throw Error()}catch(c){var a=c.stack.trim().match(/\n( *(at )?)/);Kn=a&&a[1]||"",hr=-1<c.stack.indexOf(`
2    at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
3`+Kn+s+hr}var Si=!1;function Eo(s,a){if(!s||Si)return"";Si=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(a){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(De){var K=De}Reflect.construct(s,[],pe)}else{try{pe.call()}catch(De){K=De}pe=!1;try{var te=Object.getOwnPropertyDescriptor(s.prototype,"props");Object.defineProperty(s.prototype,"props",{configurable:!0,set:function(){throw Error()}}),pe=!0,new s}finally{pe&&(te!==void 0?Object.defineProperty(s.prototype,"props",te):delete s.prototype.props)}}}else{try{throw Error()}catch(De){K=De}(pe=s())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(De){if(De&&K&&typeof De.stack=="string")return[De.stack,K.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=h.DetermineComponentFrameRoot(),E=_[0],R=_[1];if(E&&R){var I=E.split(`
4`),q=R.split(`
5`);for(m=h=0;h<I.length&&!I[h].includes("DetermineComponentFrameRoot");)h++;for(;m<q.length&&!q[m].includes("DetermineComponentFrameRoot");)m++;if(h===I.length||m===q.length)for(h=I.length-1,m=q.length-1;1<=h&&0<=m&&I[h]!==q[m];)m--;for(;1<=h&&0<=m;h--,m--)if(I[h]!==q[m]){if(h!==1||m!==1)do if(h--,m--,0>m||I[h]!==q[m]){var se=`
6`+I[h].replace(" at new "," at ");return s.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",s.displayName)),se}while(1<=h&&0<=m);break}}}finally{Si=!1,Error.prepareStackTrace=c}return(c=s?s.displayName||s.name:"")?An(c):""}function Bs(s,a){switch(s.tag){case 26:case 27:case 5:return An(s.type);case 16:return An("Lazy");case 13:return s.child!==a&&a!==null?An("Suspense Fallback"):An("Suspense");case 19:return An("SuspenseList");case 0:case 15:return Eo(s.type,!1);case 11:return Eo(s.type.render,!1);case 1:return Eo(s.type,!0);case 31:return An("Activity");case 30:return An("ViewTransition");default:return""}}function ys(s){try{var a="",c=null;do a+=Bs(s,c),c=s,s=s.return;while(s);return a}catch(h){return`
7Error generating stack: `+h.message+`
8`+h.stack}}var ca=Object.prototype.hasOwnProperty,Mi=t.unstable_scheduleCallback,Gs=t.unstable_cancelCallback,el=t.unstable_shouldYield,Ii=t.unstable_requestPaint,ei=t.unstable_now,tl=t.unstable_getCurrentPriorityLevel,Gr=t.unstable_ImmediatePriority,To=t.unstable_UserBlockingPriority,_s=t.unstable_NormalPriority,nl=t.unstable_LowPriority,Js=t.unstable_IdlePriority,ua=t.log,Jr=t.unstable_setDisableYieldValue,fr=null,ti=null;function Rr(s){if(typeof ua=="function"&&Jr(s),ti&&typeof ti.setStrictMode=="function")try{ti.setStrictMode(fr,s)}catch{}}var ni=Math.clz32?Math.clz32:H,il=Math.log,D=Math.LN2;function H(s){return s>>>=0,s===0?32:31-(il(s)/D|0)|0}var ie=256,ve=262144,ye=4194304;function We(s){var a=s&42;if(a!==0)return a;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&-s;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Ke(s,a,c){var h=s.pendingLanes;if(h===0)return 0;var m=0,_=s.suspendedLanes,E=s.pingedLanes;s=s.warmLanes;var R=h&134217727;return R!==0?(h=R&~_,h!==0?m=We(h):(E&=R,E!==0?m=We(E):c||(c=R&~s,c!==0&&(m=We(c))))):(R=h&~_,R!==0?m=We(R):E!==0?m=We(E):c||(c=h&~s,c!==0&&(m=We(c)))),m===0?0:a!==0&&a!==m&&(a&_)===0&&(_=m&-m,c=a&-a,_>=c||_===32&&(c&4194048)!==0)?a:m}function Be(s,a){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&a)===0}function Ze(s,a){(a&8)!==0&&(a|=a&32);var c=s.entangledLanes;if(c!==0)for(s=s.entanglements,c&=a;0<c;){var h=31-ni(c),m=1<<h;a|=s[h],c&=~m}return a}function rt(s,a){switch(s){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Xe(){var s=ye;return ye<<=1,(ye&62914560)===0&&(ye=4194304),s}function dt(s){for(var a=[],c=0;31>c;c++)a.push(s);return a}function nt(s,a){s.pendingLanes|=a,a!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function Bt(s,a,c,h,m,_){var E=s.pendingLanes;s.pendingLanes=c,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=c,s.entangledLanes&=c,s.errorRecoveryDisabledLanes&=c,s.shellSuspendCounter=0;var R=s.entanglements,I=s.expirationTimes,q=s.hiddenUpdates;for(c=E&~c;0<c;){var se=31-ni(c),pe=1<<se;R[se]=0,I[se]=-1;var K=q[se];if(K!==null)for(q[se]=null,se=0;se<K.length;se++){var te=K[se];te!==null&&(te.lane&=-536870913)}c&=~pe}h!==0&&nn(s,h,0),_!==0&&m===0&&s.tag!==0&&(s.suspendedLanes|=_&~(E&~a))}function nn(s,a,c){s.pendingLanes|=a,s.suspendedLanes&=~a;var h=31-ni(a);s.entangledLanes|=a,s.entanglements[h]=s.entanglements[h]|1073741824|c&261930}function Bn(s,a){var c=s.entangledLanes|=a;for(s=s.entanglements;c;){var h=31-ni(c),m=1<<h;m&a|s[h]&a&&(s[h]|=a),c&=~m}}function Gt(s,a){var c=a&-a;return c=(c&42)!==0?1:Dt(c),(c&(s.suspendedLanes|a))!==0?0:c}function Dt(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function ki(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function zi(){var s=oe.p;return s!==0?s:(s=window.event,s===void 0?32:mP(s.type))}function rl(s,a){var c=oe.p;try{return oe.p=s,a()}finally{oe.p=c}}var Ei=Math.random().toString(36).slice(2),jn="__reactFiber$"+Ei,Zn="__reactProps$"+Ei,Di="__reactContainer$"+Ei,qu="__reactEvents$"+Ei,Co="__reactListeners$"+Ei,Vu="__reactHandles$"+Ei,yc="__reactResources$"+Ei,Oo="__reactMarker$"+Ei,Et="__reactLoad$"+Ei;function ci(s){delete s[jn],delete s[Zn],delete s[Co],delete s[Vu]}function Ti(s){var a;if(a=s[jn])return a;for(var c=s.parentNode;c;){if(a=c[Di]||c[jn]){if(c=a.alternate,a.child!==null||c!==null&&c.child!==null)for(s=Jj(s);s!==null;){if(c=s[jn])return c;s=Jj(s)}return a}s=c,c=s.parentNode}return null}function er(s){if(s=s[jn]||s[Di]){var a=s.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return s}return null}function sl(s){var a=s.tag;if(a===5||a===26||a===27||a===6)return s.stateNode;throw Error(i(33))}function Ro(s){var a=s[yc];return a||(a=s[yc]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function _t(s){s[Oo]=!0}function $o(s){s[Et]=void 0}var wf=new Set,yv={};function _c(s,a){Bu(s,a),Bu(s+"Capture",a)}function Bu(s,a){for(yv[s]=a,s=0;s<a.length;s++)wf.add(a[s])}var v8=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),mR={},vR={};function y8(s){return ca.call(vR,s)?!0:ca.call(mR,s)?!1:v8.test(s)?vR[s]=!0:(mR[s]=!0,!1)}var Jt=!1;function yR(){var s=Jt;return Jt=!1,s}function _v(s,a,c){if(y8(a))if(c===null)s.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":s.removeAttribute(a);return;case"boolean":var h=a.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){s.removeAttribute(a);return}}s.setAttribute(a,c)}}function bv(s,a,c){if(c===null)s.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(a);return}s.setAttribute(a,c)}}function da(s,a,c,h){if(h===null)s.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(c);return}s.setAttributeNS(a,c,h)}}function Xr(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function _R(s){var a=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function _8(s,a,c){var h=Object.getOwnPropertyDescriptor(s.constructor.prototype,a);if(!s.hasOwnProperty(a)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var m=h.get,_=h.set;return Object.defineProperty(s,a,{configurable:!0,get:function(){return m.call(this)},set:function(E){c=""+E,_.call(this,E)}}),Object.defineProperty(s,a,{enumerable:h.enumerable}),{getValue:function(){return c},setValue:function(E){c=""+E},stopTracking:function(){s._valueTracker=null,delete s[a]}}}}function ex(s){if(!s._valueTracker){var a=_R(s)?"checked":"value";s._valueTracker=_8(s,a,""+s[a])}}function bR(s){if(!s)return!1;var a=s._valueTracker;if(!a)return!0;var c=a.getValue(),h="";return s&&(h=_R(s)?s.checked?"true":"false":s.value),s=h,s!==c?(a.setValue(s),!0):!1}var b8=/[\n"\\]/g;function bs(s){return s.replace(b8,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function tx(s,a,c,h,m,_,E,R){s.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?s.type=E:s.removeAttribute("type"),a!=null?E==="number"?(a===0&&s.value===""||s.value!=a)&&(s.value=""+Xr(a)):s.value!==""+Xr(a)&&(s.value=""+Xr(a)):E!=="submit"&&E!=="reset"||s.removeAttribute("value"),a!=null?E==="number"&&s.value==a?nx(s,Xr(s.value)):nx(s,Xr(a)):c!=null?nx(s,Xr(c)):h!=null&&s.removeAttribute("value"),m==null&&_!=null&&(s.defaultChecked=!!_),m!=null&&(s.checked=m&&typeof m!="function"&&typeof m!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?s.name=""+Xr(R):s.removeAttribute("name")}function wR(s,a,c,h,m,_,E,R){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(s.type=_),a!=null||c!=null){if(!(_!=="submit"&&_!=="reset"||a!=null)){ex(s);return}c=c!=null?""+Xr(c):"",a=a!=null?""+Xr(a):c,R||a===s.value||(s.value=a),s.defaultValue=a}h=h??m,h=typeof h!="function"&&typeof h!="symbol"&&!!h,s.checked=R?s.checked:!!h,s.defaultChecked=!!h,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(s.name=E),ex(s)}function nx(s,a){s.defaultValue!==""+a&&(s.defaultValue=""+a)}function Gu(s,a,c,h){if(s=s.options,a){a={};for(var m=0;m<c.length;m++)a["$"+c[m]]=!0;for(c=0;c<s.length;c++)m=a.hasOwnProperty("$"+s[c].value),s[c].selected!==m&&(s[c].selected=m),m&&h&&(s[c].defaultSelected=!0)}else{for(c=""+Xr(c),a=null,m=0;m<s.length;m++){if(s[m].value===c){s[m].selected=!0,h&&(s[m].defaultSelected=!0);return}a!==null||s[m].disabled||(a=s[m])}a!==null&&(a.selected=!0)}}function xR(s,a,c){if(a!=null&&(a=""+Xr(a),a!==s.value&&(s.value=a),c==null)){s.defaultValue!==a&&(s.defaultValue=a);return}s.defaultValue=c!=null?""+Xr(c):""}function SR(s,a,c,h){if(a==null){if(h!=null){if(c!=null)throw Error(i(92));if(Ae(h)){if(1<h.length)throw Error(i(93));h=h[0]}c=h}c==null&&(c=""),a=c}c=Xr(a),s.defaultValue=c,h=s.textContent,h===c&&h!==""&&h!==null&&(s.value=h),ex(s)}function Ju(s,a){if(a){var c=s.firstChild;if(c&&c===s.lastChild&&c.nodeType===3){c.nodeValue=a;return}}s.textContent=a}var w8=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function kR(s,a,c){var h=a.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?h?s.setProperty(a,""):a==="float"?s.cssFloat="":s[a]="":h?s.setProperty(a,c):typeof c!="number"||c===0||w8.has(a)?a==="float"?s.cssFloat=c:s[a]=(""+c).trim():s[a]=c+"px"}function ER(s,a,c){if(a!=null&&typeof a!="object")throw Error(i(62));if(s=s.style,c!=null){for(var h in c)!c.hasOwnProperty(h)||a!=null&&a.hasOwnProperty(h)||(h.indexOf("--")===0?s.setProperty(h,""):h==="float"?s.cssFloat="":s[h]="",Jt=!0);for(var m in a)h=a[m],a.hasOwnProperty(m)&&c[m]!==h&&(kR(s,m,h),Jt=!0)}else for(var _ in a)a.hasOwnProperty(_)&&kR(s,_,a[_])}function ix(s){if(s.indexOf("-")===-1)return!1;switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var x8=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode
8-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),S8=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function wv(s){return S8.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Ao(){}var rx=null;function sx(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Xu=null,Yu=null;function TR(s){var a=er(s);if(a&&(s=a.stateNode)){var c=s[Zn]||null;e:switch(s=a.stateNode,a.type){case"input":if(tx(s,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),a=c.name,c.type==="radio"&&a!=null){for(c=s;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+bs(""+a)+'"][type="radio"]'),a=0;a<c.length;a++){var h=c[a];if(h!==s&&h.form===s.form){var m=h[Zn]||null;if(!m)throw Error(i(90));tx(h,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(a=0;a<c.length;a++)h=c[a],h.form===s.form&&bR(h)}break e;case"textarea":xR(s,c.value,c.defaultValue);break e;case"select":a=c.value,a!=null&&Gu(s,!!c.multiple,a,!1)}}}var ox=!1;function CR(s,a,c){if(ox)return s(a,c);ox=!0;try{var h=s(a);return h}finally{if(ox=!1,(Xu!==null||Yu!==null)&&(wy(),Xu&&(a=Xu,s=Yu,Yu=Xu=null,TR(a),s)))for(a=0;a<s.length;a++)TR(s[a])}}function xf(s,a){var c=s.stateNode;if(c===null)return null;var h=c[Zn]||null;if(h===null)return null;c=h[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(s=s.type,h=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!h;break e;default:s=!1}if(s)return null;if(c&&typeof c!="function")throw Error(i(231,a,typeof c));return c}var ha=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ax=!1;if(ha)try{var Sf={};Object.defineProperty(Sf,"passive",{get:function(){ax=!0}}),window.addEventListener("test",Sf,Sf),window.removeEventListener("test",Sf,Sf)}catch{ax=!1}var ol=null,lx=null,xv=null;function OR(){if(xv)return xv;var s,a=lx,c=a.length,h,m="value"in ol?ol.value:ol.textContent,_=m.length;for(s=0;s<c&&a[s]===m[s];s++);var E=c-s;for(h=1;h<=E&&a[c-h]===m[_-h];h++);return xv=m.slice(s,1<h?1-h:void 0)}function Sv(s){var a=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&a===13&&(s=13)):s=a,s===10&&(s=13),32<=s||s===13?s:0}function kv(){return!0}function RR(){return!1}function pr(s){function a(c,h,m,_,E){this._reactName=c,this._targetInst=m,this.type=h,this.nativeEvent=_,this.target=E,this.currentTarget=null;for(var R in s)s.hasOwnProperty(R)&&(c=s[R],this[R]=c?c(_):_[R]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?kv:RR,this.isPropagationStopped=RR,this}return j(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=kv)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=kv)},persist:function(){},isPersistent:kv}),a}var al={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ev=pr(al),kf=j({},al,{view:0,detail:0}),k8=pr(kf),cx,ux,Ef,Tv=j({},kf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hx,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Ef&&(Ef&&s.type==="mousemove"?(cx=s.screenX-Ef.screenX,ux=s.screenY-Ef.screenY):ux=cx=0,Ef=s),cx)},movementY:function(s){return"movementY"in s?s.movementY:ux}}),$R=pr(Tv),E8=j({},Tv,{dataTransfer:0}),T8=pr(E8),C8=j({},kf,{relatedTarget:0}),dx=pr(C8),O8=j({},al,{animationName:0,elapsedTime:0,pseudoElement:0}),R8=pr(O8),$8=j({},al,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),A8=pr($8),j8=j({},al,{data:0}),AR=pr(j8),P8={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},N8={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},M8={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function I8(s){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(s):(s=M8[s])?!!a[s]:!1}function hx(){return I8}var z8=j({},kf,{key:function(s){if(s.key){var a=P8[s.key]||s.key;if(a!=="Unidentified")return a}
vendor: 5,373 bytes, line 8
8return s.type==="keypress"?(s=Sv(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?N8[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hx,charCode:function(s){return s.type==="keypress"?Sv(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Sv(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),D8=pr(z8),L8=j({},Tv,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jR=pr(L8),U8=j({},al,{submitter:0}),F8=pr(U8),H8=j({},kf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hx}),K8=pr(H8),Z8=j({},al,{propertyName:0,elapsedTime:0,pseudoElement:0}),W8=pr(Z8),q8=j({},Tv,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),V8=pr(q8),B8=j({},al,{newState:0,oldState:0,source:0}),G8=pr(B8),J8=[9,13,27,32],fx=ha&&"CompositionEvent"in window,Tf=null;ha&&"documentMode"in document&&(Tf=document.documentMode);var X8=ha&&"TextEvent"in window&&!Tf,PR=ha&&(!fx||Tf&&8<Tf&&11>=Tf),NR=" ",MR=!1;function IR(s,a){switch(s){case"keyup":return J8.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zR(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Qu=!1;function Y8(s,a){switch(s){case"compositionend":return zR(a);case"keypress":return a.which!==32?null:(MR=!0,NR);case"textInput":return s=a.data,s===NR&&MR?null:s;default:return null}}function Q8(s,a){if(Qu)return s==="compositionend"||!fx&&IR(s,a)?(s=OR(),xv=lx=ol=null,Qu=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return PR&&a.locale!=="ko"?null:a.data;default:return null}}var eK={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function DR(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a==="input"?!!eK[s.type]:a==="textarea"}function LR(s,a,c,h){Xu?Yu?Yu.push(h):Yu=[h]:Xu=h,a=Cy(a,"onChange"),0<a.length&&(c=new Ev("onChange","change",null,c,h),s.push({event:c,listeners:a}))}var Cf=null,Of=null;function tK(s){Tj(s,0)}function Cv(s){var a=sl(s);if(bR(a))return s}function UR(s,a){if(s==="change")return a}var FR=!1;if(ha){var px;if(ha){var gx="oninput"in document;if(!gx){var HR=document.createElement("div");HR.setAttribute("oninput","return;"),gx=typeof HR.oninput=="function"}px=gx}else px=!1;FR=px&&(!document.documentMode||9<document.documentMode)}function KR(){Cf&&(Cf.detachEvent("onpropertychange",ZR),Of=Cf=null)}function ZR(s){if(s.propertyName==="value"&&Cv(Of)){var a=[];LR(a,Of,s,sx(s)),CR(tK,a)}}function nK(s,a,c){s==="focusin"?(KR(),Cf=a,Of=c,Cf.attachEvent("onpropertychange",ZR)):s==="focusout"&&KR()}function iK(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Cv(Of)}function rK(s,a){if(s==="click")return Cv(a)}function sK(s,a){if(s==="input"||s==="change")return Cv(a)}function oK(s,a){return s===a&&(s!==0||1/s===1/a)||s!==s&&a!==a}var Yr=typeof Object.is=="function"?Object.is:oK;function Rf(s,a){if(Yr(s,a))return!0;if(typeof s!="object"||s===null||typeof a!="object"||a===null)return!1;var c=Object.keys(s),h=Object.keys(a);if(c.length!==h.length)return!1;for(h=0;h<c.length;h++){var m=c[h];if(!ca.call(a,m)||!Yr(s[m],a[m]))return!1}return!0}function mx(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function WR(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function qR(s,a){var c=WR(s);s=0;for(var h;c;){if(c.nodeType===3){if(h=s+c.textContent.length,s<=a&&h>=a)return{node:c,offset:a-s};s=h}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=WR(c)}}function VR(s,a){return s&&a?s===a?!0:s&&s.nodeType===3?!1:a&&a.nodeType===3?VR(s,a.parentNode):"contains"in s?s.contains(a):s.compareDocumentPosition?!!(s.compareDocumentPosition(a)&16):!1:!1}function BR(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var a=mx(s.document);a instanceof s.HTMLIFrameElement;){try{var c=typeof a.contentWindow.location.href=="string"}catch{c=!1}if(c)s=a.contentWindow;else break;a=mx(s.document)}return a}function vx(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a&&(a==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||a==="textarea"||s.contentEditable==="true")}var aK=ha&&"documentMode"in document&&11>=document.documentMode,ed=null,yx=null,$f=null,_x=!1;function GR(s,a,c){var h=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;_x||ed==null||ed!==mx(h)||(h=ed,"selectionStart"in h&&vx(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focu
vendor: 111,912 bytes, line 8
8sNode:h.focusNode,focusOffset:h.focusOffset}),$f&&Rf($f,h)||($f=h,h=Cy(yx,"onSelect"),0<h.length&&(a=new Ev("onSelect","select",null,a,c),s.push({event:a,listeners:h}),a.target=ed)))}function bc(s,a){var c={};return c[s.toLowerCase()]=a.toLowerCase(),c["Webkit"+s]="webkit"+a,c["Moz"+s]="moz"+a,c}var td={animationend:bc("Animation","AnimationEnd"),animationiteration:bc("Animation","AnimationIteration"),animationstart:bc("Animation","AnimationStart"),transitionrun:bc("Transition","TransitionRun"),transitionstart:bc("Transition","TransitionStart"),transitioncancel:bc("Transition","TransitionCancel"),transitionend:bc("Transition","TransitionEnd")},bx={},JR={};ha&&(JR=document.createElement("div").style,"AnimationEvent"in window||(delete td.animationend.animation,delete td.animationiteration.animation,delete td.animationstart.animation),"TransitionEvent"in window||delete td.transitionend.transition);function wc(s){if(bx[s])return bx[s];if(!td[s])return s;var a=td[s],c;for(c in a)if(a.hasOwnProperty(c)&&c in JR)return bx[s]=a[c];return s}var XR=wc("animationend"),YR=wc("animationiteration"),QR=wc("animationstart"),lK=wc("transitionrun"),cK=wc("transitionstart"),uK=wc("transitioncancel"),e$=wc("transitionend"),t$=new Map,wx="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");wx.push("scrollEnd");function Xs(s,a){t$.set(s,a),_c(a,[s])}var dK=0;function fa(s,a){if(s.name!=null&&s.name!=="auto")return s.name;if(a.autoName!==null)return a.autoName;s=to.identifierPrefix;var c=dK++;return s="_"+s+"t_"+c.toString(32)+"_",a.autoName=s}function n$(s){if(s==null||typeof s=="string")return s;var a=null,c=wd;if(c!==null)for(var h=0;h<c.length;h++){var m=s[c[h]];if(m!=null){if(m==="none")return"none";a=a==null?m:a+(" "+m)}}return a??s.default}function pa(s,a){return s=n$(s),a=n$(a),a==null?s==="auto"?null:s:a==="auto"?null:a}var Ov=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},ws=[],nd=0,xx=0;function Rv(){for(var s=nd,a=xx=nd=0;a<s;){var c=ws[a];ws[a++]=null;var h=ws[a];ws[a++]=null;var m=ws[a];ws[a++]=null;var _=ws[a];if(ws[a++]=null,h!==null&&m!==null){var E=h.pending;E===null?m.next=m:(m.next=E.next,E.next=m),h.pending=m}_!==0&&i$(c,m,_)}}function $v(s,a,c,h){ws[nd++]=s,ws[nd++]=a,ws[nd++]=c,ws[nd++]=h,xx|=h,s.lanes|=h,s=s.alternate,s!==null&&(s.lanes|=h)}function Sx(s,a,c,h){return $v(s,a,c,h),Av(s)}function xc(s,a){return $v(s,null,null,a),Av(s)}function i$(s,a,c){s.lanes|=c;var h=s.alternate;h!==null&&(h.lanes|=c);for(var m=!1,_=s.return;_!==null;)_.childLanes|=c,h=_.alternate,h!==null&&(h.childLanes|=c),_.tag===22&&(s=_.stateNode,s===null||s._visibility&1||(m=!0)),s=_,_=_.return;return s.tag===3?(_=s.stateNode,m&&a!==null&&(m=31-ni(c),s=_.hiddenUpdates,h=s[m],h===null?s[m]=[a]:h.push(a),a.lane=c|536870912),_):null}function Av(s){if(50<Yf)throw Yf=0,by=null,Error(i(185));for(var a=s.return;a!==null;)s=a,a=s.return;return s.tag===3?s.stateNode:null}var id={};function hK(s,a,c,h){this.tag=s,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $r(s,a,c,h){return new hK(s,a,c,h)}function kx(s){return s=s.prototype,!(!s||!s.isReactComponent)}function ga(s,a){var c=s.alternate;return c===null?(c=$r(s.tag,a,s.key,s.mode),c.elementType=s.elementType,c.type=s.type,c.stateNode=s.stateNode,c.alternate=s,s.alternate=c):(c.pendingProps=a,c.type=s.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=s.flags&1206910976,c.childLanes=s.childLanes,c.lanes=s.lanes,c.child=s.child,c.memoizedProps=s.memoizedProps,c.memoizedState=s.memoizedState,c.updateQueue=s.updateQueue,a=s.dependencies,c.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},c.sibling=s.sibling,c.index=s.index,c.ref=s.ref,c.refCleanup=s.refCleanup,c}function r$(s,a){s.flags&=1206910978;var c=s.alternate;return c===null?(s.childLanes=0,s.lanes=a,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,a=c.dependencies,s.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),s}function jv(s,a,c,h,m,_){var E=0;if(h=s,typeof h=="function")kx(h)&&(E=1);else if(typeof h=="string")E=UZ(s,c,vt.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(h){case xe:return s=$r(31,c,a,m),s.elementType=xe,s.lanes=_,s;case V:return Sc(c.children,m,_,a);case ee:E=8,m|=24;break;case me:return s=$r(12,c,a,m|2),s.elementType=me,s.lanes=_,s;case ae:return s=$r(13,c,a,m),s.elementType=ae,s.lanes=_,s;case ue:return s=$r(19,c,a,m),s.elementType=ue,s.lanes=_,s;case Ie:case P:return s=m|32,s=$r(30,c,a,s),s.elementType=P,s.lanes=_,s.stateNode={autoName:null,paired:null,clones:null,ref:null},s;default:if(typeof h=="object"&&h!==null)switch(h.$$typeof){case ce:E=10;break e;case ne:E=9;break e;case Z:E=11;break e;case ge:E=14;break e;case Re:E=16,h=null;break e}E=29,c=Error(i(130,s===null?"null":typeof s,"")),h=null}return a=$r(E,c,a,m),a.elementType=s,a.type=h,a.lanes=_,a}function Sc(s,a,c,h){return s=$r(7,s,h,a),s.lanes=c,s}function Ex(s,a,c){return s=$r(6,s,null,a),s.lanes=c,s}function s$(s){var a=$r(18,null,null,0);return a.stateNode=s,a}function Tx(s,a,c){return a=$r(4,s.children!==null?s.children:[],s.key,a),a.lanes=c,a.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},a}var o$=new WeakMap;function xs(s,a){if(typeof s=="object"&&s!==null){var c=o$.get(s);return c!==void 0?c:(a={value:s,source:a,stack:ys(a)},o$.set(s,a),a)}return{value:s,source:a,stack:ys(a)}}var rd=[],sd=0,Pv=null,Af=0,Ss=[],ks=0,ll=null,jo=1,Po="";function ma(s,a){rd[sd++]=Af,rd[sd++]=Pv,Pv=s,Af=a}function a$(s,a,c){Ss[ks++]=jo,Ss[ks++]=Po,Ss[ks++]=ll,ll=s;var h=jo;s=Po;var m=32-ni(h)-1;h&=~(1<<m),c+=1;var _=32-ni(a)+m;if(30<_){var E=m-m%5;_=(h&(1<<E)-1).toString(32),h>>=E,m-=E,jo=1<<32-ni(a)+m|c<<m|h,Po=_+s}else jo=1<<_|c<<m|h,Po=s}function Nv(s){s.return!==null&&(ma(s,1),a$(s,1,0))}function Cx(s){for(;s===Pv;)Pv=rd[--sd],rd[sd]=null,Af=rd[--sd],rd[sd]=null;for(;s===ll;)ll=Ss[--ks],Ss[ks]=null,Po=Ss[--ks],Ss[ks]=null,jo=Ss[--ks],Ss[ks]=null}function l$(s,a){Ss[ks++]=jo,Ss[ks++]=Po,Ss[ks++]=ll,jo=a.id,Po=a.overflow,ll=s}var Ci=null,wn=null,Tt=!1,cl=null,Es=!1,Ox=Error(i(519));function ul(s){var a=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw jf(xs(a,s)),Ox}function c$(s){var a=s.stateNode,c=s.type,h=s.memoizedProps;switch(a[jn]=s,a[Zn]=h,c){case"dialog":$t("cancel",a),$t("close",a);break;case"iframe":case"object":case"embed":$t("load",a);break;case"video":case"audio":for(c=0;c<ep.length;c++)$t(ep[c],a);break;case"source":$t("error",a);break;case"img":case"image":case"link":$t("error",a),$t("load",a);break;case"details":$t("toggle",a);break;case"input":$t("invalid",a),wR(a,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":$t("invalid",a);break;case"textarea":$t("invalid",a),SR(a,h.value,h.defaultValue,h.children)}c=h.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||a.textContent===""+c||h.suppressHydrationWarning===!0||$j(a.textContent,c)?(h.popover!=null&&($t("beforetoggle",a),$t("toggle",a)),h.onScroll!=null&&$t("scroll",a),h.onScrollEnd!=null&&$t("scrollend",a),h.onClick!=null&&(a.onclick=Ao),a=!0):a=!1,a||ul(s,!0)}function Mv(s){for(Ci=s.return;Ci;)switch(Ci.tag){case 5:case 31:case 13:Es=!1;return;case 27:case 3:Es=!0;return;default:Ci=Ci.return}}function od(s){if(s!==Ci)return!1;if(!Tt)return Mv(s),Tt=!0,!1;var a=s.tag,c;if((c=a!==3&&a!==27)&&((c=a===5)&&(c=s.type,c=!(c!=="form"&&c!=="button")||rk(s.type,s.memoizedProps)),c=!c),c&&wn&&ul(s),Mv(s),a===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(317));wn=Gj(s)}else if(a===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(317));wn=Gj(s)}else a===27?(a=wn,Tl(s.type)?(s=fk,fk=null,wn=s):wn=a):wn=Ci?Cs(s.stateNode.nextSibling):null;return!0}function kc(){wn=Ci=null,Tt=!1}function Rx(){var s=cl;return s!==null&&(Pr===null?Pr=s:Pr.push.apply(Pr,s),cl=null),s}function jf(s){cl===null?cl=[s]:cl.push(s)}var $x=Pe(null),Ec=null,va=null;function dl(s,a,c){Ge($x,a._currentValue),a._currentValue=c}function ya(s){s._currentValue=$x.current,ze($x)}function Iv(s,a,c){for(;s!==null;){var h=s.alternate;if((s.childLanes&a)!==a?(s.childLanes|=a,h!==null&&(h.childLanes|=a)):h!==null&&(h.childLanes&a)!==a&&(h.childLanes|=a),s===c)break;s=s.return}}function Ax(s,a,c,h){var m=s.child;for(m!==null&&(m.return=s);m!==null;){var _=m.dependencies;if(_!==null){var E=m.child;_=_.firstContext;e:for(;_!==null;){var R=_;_=m;for(var I=0;I<a.length;I++)if(R.context===a[I]){_.lanes|=c,R=_.alternate,R!==null&&(R.lanes|=c),Iv(_.return,c,s),h||(E=null);break e}_=R.next}}else if(m.tag===18){if(E=m.return,E===null)throw Error(i(341));E.lanes|=c,_=E.alternate,_!==null&&(_.lanes|=c),Iv(E,c,s),E=null}else m.tag===13&&m.memoizedState!==null&&m.memoizedState.dehydrated===null?(m.lanes|=c,E=m.alternate,E!==null&&(E.lanes|=c),Iv(m.return,c,s),E=m.child,E=E!==null?E.sibling:null):E=m.child;if(E!==null)E.return=m;else for(E=m;E!==null;){if(E===s){E=null;break}if(m=E.sibling,m!==null){m.return=E.return,E=m;break}E=E.return}m=E}}function Tc(s,a,c,h){s=null;for(var m=a,_=!1;m!==null;){if(!_){if((m.flags&524288)!==0)_=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var E=m.alternate;if(E===null)throw Error(i(387));if(E=E.memoizedProps,E!==null){var R=m.type;Yr(m.pendingProps.value,E.value)||(s!==null?s.push(R):s=[R])}}else if(m===Kt.current){if(E=m.alternate,E===null)throw Error(i(387));E.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(s!==null?s.push(Ad):s=[Ad])}m=m.return}return s!==null&&Ax(a,s,c,h),a.flags|=262144,s!==null}function zv(s){for(s=s.firstContext;s!==null;){if(!Yr(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Cc(s){Ec=s,va=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Li(s){return u$(Ec,s)}function Dv(s,a){return Ec===null&&Cc(s),u$(s,a)}function u$(s,a){var c=a._currentValue;if(a={context:a,memoizedValue:c,next:null},va===null){if(s===null)throw Error(i(308));va=a,s.dependencies={lanes:0,firstContext:a},s.flags|=524288}else va=va.next=a;return c}var fK=typeof AbortController<"u"?AbortController:function(){var s=[],a=this.signal={aborted:!1,addEventListener:function(c,h){s.push(h)}};this.abort=function(){a.aborted=!0,s.forEach(function(c){return c()})}},pK=t.unstable_scheduleCallback,gK=t.unstable_NormalPriority,ii={$$typeof:ce,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function jx(){return{controller:new fK,data:new Map,refCount:0}}function Pf(s){s.refCount--,s.refCount===0&&pK(gK,function(){s.controller.abort()})}function d$(s,a){if((s.pendingLanes&4194048)!==0){var c=s.transitionTypes;for(c===null&&(c=s.transitionTypes=[]),s=0;s<a.length;s++){var h=a[s];c.indexOf(h)===-1&&c.push(h)}}}var Nf=null;function mK(s){var a=s.transitionTypes;return s.transitionTypes=null,a}var Mf=null,Px=0,Oc=0,ad=null;function vK(s,a){if(Mf===null){var c=Mf=[];Px=0,Oc=GS(),ad={status:"pending",value:void 0,then:function(h){c.push(h)}}}return Px++,a.then(h$,h$),a}function h$(){if(--Px===0&&(Nf=null,Mf!==null)){ad!==null&&(ad.status="fulfilled");var s=Mf;Mf=null,Oc=0,ad=null;for(var a=0;a<s.length;a++)(0,s[a])()}}function yK(s,a){var c=[],h={status:"pending",value:null,reason:null,then:function(m){c.push(m)}};return s.then(function(){h.status="fulfilled",h.value=a;for(var m=0;m<c.length;m++)(0,c[m])(a)},function(m){for(h.status="rejected",h.reason=m,m=0;m<c.length;m++)(0,c[m])(void 0)}),h}var f$=Se.S;Se.S=function(s,a){if(sj=ei(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&vK(s,a),Nf!==null)for(var c=Ed;c!==null;)d$(c,Nf),c=c.next;if(c=s.types,c!==null){for(var h=Ed;h!==null;)d$(h,c),h=h.next;if(Oc!==0){h=Nf,h===null&&(h=Nf=[]);for(var m=0;m<c.length;m++){var _=c[m];h.indexOf(_)===-1&&h.push(_)}}}f$!==null&&f$(s,a)};var Rc=Pe(null);function Nx(){var s=Rc.current;return s!==null?s:mn.pooledCache}function Lv(s,a){a===null?Ge(Rc,Rc.current):Ge(Rc,a.pool)}function p$(){var s=Nx();return s===null?null:{parent:ii._currentValue,pool:s}}var ld=Error(i(460)),Mx=Error(i(474)),Uv=Error(i(542)),Fv={then:function(){}};function g$(s){return s=s.status,s==="fulfilled"||s==="rejected"}function m$(s,a,c){switch(c=s[c],c===void 0?s.push(a):c!==a&&(a.then(Ao,Ao),a=c),a.status){case"fulfilled":return a.value;case"rejected":throw s=a.reason,y$(s),s===void 0&&!("reason"in a)?Error(i(600)):s;default:if(typeof a.status=="string")a.then(Ao,Ao);else{if(s=mn,s!==null&&100<s.shellSuspendCounter)throw Error(i(482));s=a,s.status="pending",s.then(function(h){if(a.status==="pending"){var m=a;m.status="fulfilled",m.value=h}},function(h){if(a.status==="pending"){var m=a;m.status="rejected",m.reason=h}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw s=a.reason,y$(s),s}throw Ac=a,ld}}function $c(s){try{var a=s._init;return a(s._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(Ac=c,ld):c}}var Ac=null;function v$(){if(Ac===null)throw Error(i(459));var s=Ac;return Ac=null,s}function y$(s){if(s===ld||s===Uv)throw Error(i(483))}var cd=null,If=0;function Hv(s){var a=If;return If+=1,cd===null&&(cd=[]),m$(cd,s,a)}function hl(s,a){a=a.props.ref,s.ref=a!==void 0?a:null}function Kv(s,a){throw a.$$typeof===O?Error(i(525)):(s=Object.prototype.toString.call(a),Error(i(31,s==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":s)))}function _$(s){function a(W,U){if(s){var Q=W.deletions;Q===null?(W.deletions=[U],W.flags|=16):Q.push(U)}}function c(W,U){if(!s)return null;for(;U!==null;)a(W,U),U=U.sibling;return null}function h(W){for(var U=new Map;W!==null;)W.key===null?U.set(W.index,W):U.set(W.key,W),W=W.sibling;return U}function m(W,U){return W=ga(W,U),W.index=0,W.sibling=null,W}function _(W,U,Q){return W.index=Q,s?(Q=W.alternate,Q!==null?(Q=Q.index,Q<U?(W.flags|=2,U):Q):(W.flags|=134217730,U)):(W.flags|=1048576,U)}function E(W){return s&&W.alternate===null&&(W.flags|=134217730),W}function R(W,U,Q,fe){return U===null||U.tag!==6?(U=Ex(Q,W.mode,fe),U.return=W,U):(U=m(U,Q),U.return=W,U)}function I(W,U,Q,fe){var He=Q.type;return He===V?(W=se(W,U,Q.props.children,fe,Q.key),hl(W,Q),W):U!==null&&(U.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===Re&&$c(He)===U.type)?(U=m(U,Q.props),hl(U,Q),U.return=W,U):(U=jv(Q.type,Q.key,Q.props,null,W.mode,fe),hl(U,Q),U.return=W,U)}function q(W,U,Q,fe){return U===null||U.tag!==4||U.stateNode.containerInfo!==Q.containerInfo||U.stateNode.implementation!==Q.implementation?(U=Tx(Q,W.mode,fe),U.return=W,U):(U=m(U,Q.children||[]),U.return=W,U)}function se(W,U,Q,fe,He){return U===null||U.tag!==7?(U=Sc(Q,W.mode,fe,He),U.return=W,U):(U=m(U,Q),U.return=W,U)}function pe(W,U,Q){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=Ex(""+U,W.mode,Q),U.return=W,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case L:return Q=jv(U.type,U.key,U.props,null,W.mode,Q),hl(Q,U),Q.return=W,Q;case B:return U=Tx(U,W.mode,Q),U.return=W,U;case Re:return U=$c(U),pe(W,U,Q)}if(Ae(U)||Y(U))return U=Sc(U,W.mode,Q,null),U.return=W,U;if(typeof U.then=="function")return pe(W,Hv(U),Q);if(U.$$typeof===ce)return pe(W,Dv(W,U),Q);Kv(W,U)}return null}function K(W,U,Q,fe){var He=U!==null?U.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return He!==null?null:R(W,U,""+Q,fe);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case L:return Q.key===He?I(W,U,Q,fe):null;case B:return Q.key===He?q(W,U,Q,fe):null;case Re:return Q=$c(Q),K(W,U,Q,fe)}if(Ae(Q)||Y(Q))return He!==null?null:se(W,U,Q,fe,null);if(typeof Q.then=="function")return K(W,U,Hv(Q),fe);if(Q.$$typeof===ce)return K(W,U,Dv(W,Q),fe);Kv(W,Q)}return null}function te(W,U,Q,fe,He){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return W=W.get(Q)||null,R(U,W,""+fe,He);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case L:return W=W.get(fe.key===null?Q:fe.key)||null,I(U,W,fe,He);case B:return W=W.get(fe.key===null?Q:fe.key)||null,q(U,W,fe,He);case Re:return fe=$c(fe),te(W,U,Q,fe,He)}if(Ae(fe)||Y(fe))return W=W.get(Q)||null,se(U,W,fe,He,null);if(typeof fe.then=="function")return te(W,U,Q,Hv(fe),He);if(fe.$$typeof===ce)return te(W,U,Q,Dv(U,fe),He);Kv(U,fe)}return null}function De(W,U,Q,fe){for(var He=null,jt=null,Ye=U,st=U=0,oi=null;Ye!==null&&st<Q.length;st++){Ye.index>st?(oi=Ye,Ye=null):oi=Ye.sibling;var Lt=K(W,Ye,Q[st],fe);if(Lt===null){Ye===null&&(Ye=oi);break}s&&Ye&&Lt.alternate===null&&a(W,Ye),U=_(Lt,U,st),jt===null?He=Lt:jt.sibling=Lt,jt=Lt,Ye=oi}if(st===Q.length)return c(W,Ye),Tt&&ma(W,st),He;if(Ye===null){for(;st<Q.length;st++)Ye=pe(W,Q[st],fe),Ye!==null&&(U=_(Ye,U,st),jt===null?He=Ye:jt.sibling=Ye,jt=Ye);return Tt&&ma(W,st),He}for(Ye=h(Ye);st<Q.length;st++)oi=te(Ye,W,st,Q[st],fe),oi!==null&&(s&&(Lt=oi.alternate,Lt!==null&&Ye.delete(Lt.key===null?st:Lt.key)),U=_(oi,U,st),jt===null?He=oi:jt.sibling=oi,jt=oi);return s&&Ye.forEach(function(Al){return a(W,Al)}),Tt&&ma(W,st),He}function Ve(W,U,Q,fe){if(Q==null)throw Error(i(151));for(var He=null,jt=null,Ye=U,st=U=0,oi=null,Lt=Q.next();Ye!==null&&!Lt.done;st++,Lt=Q.next()){Ye.index>st?(oi=Ye,Ye=null):oi=Ye.sibling;var Al=K(W,Ye,Lt.value,fe);if(Al===null){Ye===null&&(Ye=oi);break}s&&Ye&&Al.alternate===null&&a(W,Ye),U=_(Al,U,st),jt===null?He=Al:jt.sibling=Al,jt=Al,Ye=oi}if(Lt.done)return c(W,Ye),Tt&&ma(W,st),He;if(Ye===null){for(;!Lt.done;st++,Lt=Q.next())Lt=pe(W,Lt.value,fe),Lt!==null&&(U=_(Lt,U,st),jt===null?He=Lt:jt.sibling=Lt,jt=Lt);return Tt&&ma(W,st),He}for(Ye=h(Ye);!Lt.done;st++,Lt=Q.next())Lt=te(Ye,W,st,Lt.value,fe),Lt!==null&&(s&&(oi=Lt.alternate,oi!==null&&Ye.delete(oi.key===null?st:oi.key)),U=_(Lt,U,st),jt===null?He=Lt:jt.sibling=Lt,jt=Lt);return s&&Ye.forEach(function(YZ){return a(W,YZ)}),Tt&&ma(W,st),He}function wt(W,U,Q,fe){if(typeof Q=="object"&&Q!==null&&Q.type===V&&Q.key===null&&Q.props.ref===void 0&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case L:e:{for(var He=Q.key;U!==null;){if(U.key===He){if(He=Q.type,He===V){if(U.tag===7){c(W,U.sibling),fe=m(U,Q.props.children),hl(fe,Q),fe.return=W,W=fe;break e}}else if(U.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===Re&&$c(He)===U.type){c(W,U.sibling),fe=m(U,Q.props),hl(fe,Q),fe.return=W,W=fe;break e}c(W,U);break}else a(W,U);U=U.sibling}Q.type===V?(fe=Sc(Q.props.children,W.mode,fe,Q.key),hl(fe,Q),fe.return=W,W=fe):(fe=jv(Q.type,Q.key,Q.props,null,W.mode,fe),hl(fe,Q),fe.return=W,W=fe)}return E(W);case B:e:{for(He=Q.key;U!==null;){if(U.key===He)if(U.tag===4&&U.stateNode.containerInfo===Q.containerInfo&&U.stateNode.implementation===Q.implementation){c(W,U.sibling),fe=m(U,Q.children||[]),fe.return=W,W=fe;break e}else{c(W,U);break}else a(W,U);U=U.sibling}fe=Tx(Q,W.mode,fe),fe.return=W,W=fe}return E(W);case Re:return Q=$c(Q),wt(W,U,Q,fe)}if(Ae(Q))return De(W,U,Q,fe);if(Y(Q)){if(He=Y(Q),typeof He!="function")throw Error(i(150));return Q=He.call(Q),Ve(W,U,Q,fe)}if(typeof Q.then=="function")return wt(W,U,Hv(Q),fe);if(Q.$$typeof===ce)return wt(W,U,Dv(W,Q),fe);Kv(W,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,U!==null&&U.tag===6?(c(W,U.sibling),fe=m(U,Q),fe.return=W,W=fe):(c(W,U),fe=Ex(Q,W.mode,fe),fe.return=W,W=fe),E(W)):c(W,U)}return function(W,U,Q,fe){try{If=0;var He=wt(W,U,Q,fe);return cd=null,He}catch(Ye){if(Ye===ld||Ye===Uv)throw Ye;var jt=$r(29,Ye,null,W.mode);return jt.lanes=fe,jt.return=W,jt}}}var jc=_$(!0),b$=_$(!1),fl=!1;function Ix(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zx(s,a){s=s.updateQueue,a.updateQueue===s&&(a.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function pl(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function gl(s,a,c){var h=s.updateQueue;if(h===null)return null;if(h=h.shared,(Yt&2)!==0){var m=h.pending;return m===null?a.next=a:(a.next=m.next,m.next=a),h.pending=a,a=Av(s),i$(s,null,c),a}return $v(s,h,a,c),Av(s)}function zf(s,a,c){if(a=a.updateQueue,a!==null&&(a=a.shared,(c&4194048)!==0)){var h=a.lanes;h&=s.pendingLanes,c|=h,a.lanes=c,Bn(s,c)}}function Dx(s,a){var c=s.updateQueue,h=s.alternate;if(h!==null&&(h=h.updateQueue,c===h)){var m=null,_=null;if(c=c.firstBaseUpdate,c!==null){do{var E={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};_===null?m=_=E:_=_.next=E,c=c.next}while(c!==null);_===null?m=_=a:_=_.next=a}else m=_=a;c={baseState:h.baseState,firstBaseUpdate:m,lastBaseUpdate:_,shared:h.shared,callbacks:h.callbacks},s.updateQueue=c;return}s=c.lastBaseUpdate,s===null?c.firstBaseUpdate=a:s.next=a,c.lastBaseUpdate=a}var Lx=!1;function Df(){if(Lx){var s=ad;if(s!==null)throw s}}function Lf(s,a,c,h){Lx=!1;var m=s.updateQueue;fl=!1;var _=m.firstBaseUpdate,E=m.lastBaseUpdate,R=m.shared.pending;if(R!==null){m.shared.pending=null;var I=R,q=I.next;I.next=null,E===null?_=q:E.next=q,E=I;var se=s.alternate;se!==null&&(se=se.updateQueue,R=se.lastBaseUpdate,R!==E&&(R===null?se.firstBaseUpdate=q:R.next=q,se.lastBaseUpdate=I))}if(_!==null){var pe=m.baseState;E=0,se=q=I=null,R=_;do{var K=R.lane&-536870913,te=K!==R.lane;if(te?(At&K)===K:(h&K)===K){K!==0&&K===Oc&&(Lx=!0),se!==null&&(se=se.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var De=s,Ve=R;K=a;var wt=c;switch(Ve.tag){case 1:if(De=Ve.payload,typeof De=="function"){pe=De.call(wt,pe,K);break e}pe=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=Ve.payload,K=typeof De=="function"?De.call(wt,pe,K):De,K==null)break e;pe=j({},pe,K);break e;case 2:fl=!0}}K=R.callback,K!==null&&(s.flags|=64,te&&(s.flags|=8192),te=m.callbacks,te===null?m.callbacks=[K]:te.push(K))}else te={lane:K,tag:R.tag,payload:R.payload,callback:R.callback,next:null},se===null?(q=se=te,I=pe):se=se.next=te,E|=K;if(R=R.next,R===null){if(R=m.shared.pending,R===null)break;te=R,R=te.next,te.next=null,m.lastBaseUpdate=te,m.shared.pending=null}}while(!0);se===null&&(I=pe),m.baseState=I,m.firstBaseUpdate=q,m.lastBaseUpdate=se,_===null&&(m.shared.lanes=0),xl|=E,s.lanes=E,s.memoizedState=pe}}function w$(s,a){if(typeof s!="function")throw Error(i(191,s));s.call(a)}function x$(s,a){var c=s.callbacks;if(c!==null)for(s.callbacks=null,s=0;s<c.length;s++)w$(c[s],a)}var ml=Pe(null),Zv=Pe(0);function S$(s,a){s=Sa,Ge(Zv,s),Ge(ml,a),Sa=s|a.baseLanes}function Ux(){Ge(Zv,Sa),Ge(ml,ml.current)}function Fx(){Sa=Zv.current,ze(ml),ze(Zv)}var Ui=Pe(null),tr=null;function vl(s){var a=s.alternate;Ge(Fi,Fi.current&1),Ge(Ui,s),tr===null&&(a===null||ml.current!==null||a.memoizedState!==null)&&(tr=s)}function Hx(s){Ge(Fi,Fi.current),Ge(Ui,s),tr===null&&(tr=s)}function k$(s){s.tag===22?(Ge(Fi,Fi.current),Ge(Ui,s),tr===null&&(tr=s)):yl()}function yl(){Ge(Fi,Fi.current),Ge(Ui,Ui.current)}function Qr(s){ze(Ui),tr===s&&(tr=null),ze(Fi)}var Fi=Pe(0);function Uf(s,a){Ge(Ui,Ui.current),Ge(Fi,a)}function Kx(s){ze(Fi),ze(Ui),tr===s&&(tr=null)}function Wv(s){for(var a=s;a!==null;){if(a.tag===13){var c=a.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||dk(c)||hk(c)))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!=="independent"){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var _a=0,bt=null,fn=null,ri=null,qv=!1,ud=!1,Pc=!1,Vv=0,Ff=0,dd=null,_K=0;function Gn(){throw Error(i(321))}function Zx(s,a){if(a===null)return!1;for(var c=0;c<a.length&&c<s.length;c++)if(!Yr(s[c],a[c]))return!1;return!0}function Wx(s,a,c,h,m,_){return _a=_,bt=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,Se.H=s===null||s.memoizedState===null?aA:lA,Pc=!1,_=c(h,m),Pc=!1,ud&&(_=T$(a,c,h,m)),E$(s),_}function E$(s){Se.H=ey;var a=fn!==null&&fn.next!==null;if(_a=0,ri=fn=bt=null,qv=!1,Ff=0,dd=null,a)throw Error(i(300));s===null||si||(s=s.dependencies,s!==null&&zv(s)&&(si=!0))}function T$(s,a,c,h){bt=s;var m=0;do{if(ud&&(dd=null),Ff=0,ud=!1,25<=m)throw Error(i(301));if(m+=1,ri=fn=null,s.updateQueue!=null){var _=s.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}Se.H=CK,_=a(c,h)}while(ud);return _}function bK(){var s=Se.H,a=s.useState()[0];return a=typeof a.then=="function"?Hf(a):a,s=s.useState()[0],(fn!==null?fn.memoizedState:null)!==s&&(bt.flags|=1024),a}function qx(){var s=Vv!==0;return Vv=0,s}function Vx(s,a,c){a.updateQueue=s.updateQueue,a.flags&=-2053,s.lanes&=~c}function Bx(s){if(qv){for(s=s.memoizedState;s!==null;){var a=s.queue;a!==null&&(a.pending=null),s=s.next}qv=!1}_a=0,ri=fn=bt=null,ud=!1,Ff=Vv=0,dd=null}function gr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ri===null?bt.memoizedState=ri=s:ri=ri.next=s,ri}function Yn(){if(fn===null){var s=bt.alternate;s=s!==null?s.memoizedState:null}else s=fn.next;var a=ri===null?bt.memoizedState:ri.next;if(a!==null)ri=a,fn=s;else{if(s===null)throw bt.alternate===null?Error(i(467)):Error(i(310));fn=s,s={memoizedState:fn.memoizedState,baseState:fn.baseState,baseQueue:fn.baseQueue,queue:fn.queue,next:null},ri===null?bt.memoizedState=ri=s:ri=ri.next=s}return ri}function Bv(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Hf(s){var a=Ff;return Ff+=1,dd===null&&(dd=[]),s=m$(dd,s,a),a=bt,(ri===null?a.memoizedState:ri.next)===null&&(a=a.alternate,Se.H=a===null||a.memoizedState===null?aA:lA),s}function Gv(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Hf(s);if(s.$$typeof===F)return;if(s.$$typeof===ce)return Li(s)}throw Error(i(438,String(s)))}function Gx(s){var a=null,c=bt.updateQueue;if(c!==null&&(a=c.memoCache),a==null){var h=bt.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(a={data:h.data.map(function(m){return m.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),c===null&&(c=Bv(),bt.updateQueue=c),c.memoCache=a,c=a.data[a.index],c===void 0)for(c=a.data[a.index]=Array(s),h=0;h<s;h++)c[h]=Oe;return a.index++,c}function ba(s,a){return typeof a=="function"?a(s):a}function Jv(s){var a=Yn();return Jx(a,fn,s)}function Jx(s,a,c){var h=s.queue;if(h===null)throw Error(i(311));h.lastRenderedReducer=c;var m=s.baseQueue,_=h.pending;if(_!==null){if(m!==null){var E=m.next;m.next=_.next,_.next=E}a.baseQueue=m=_,h.pending=null}if(_=s.baseState,m===null)s.memoizedState=_;else{a=m.next;var R=E=null,I=null,q=a,se=!1;do{var pe=q.lane&-536870913;if(pe!==q.lane?(At&pe)===pe:(_a&pe)===pe){var K=q.revertLane;if(K===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null}),pe===Oc&&(se=!0);else if((_a&K)===K){q=q.next,K===Oc&&(se=!0);continue}else pe={lane:0,revertLane:q.revertLane,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},I===null?(R=I=pe,E=_):I=I.next=pe,bt.lanes|=K,xl|=K;pe=q.action,Pc&&c(_,pe),_=q.hasEagerState?q.eagerState:c(_,pe)}else K={lane:pe,revertLane:q.revertLane,gesture:q.gesture,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},I===null?(R=I=K,E=_):I=I.next=K,bt.lanes|=pe,xl|=pe;q=q.next}while(q!==null&&q!==a);if(I===null?E=_:I.next=R,!Yr(_,s.memoizedState)&&(si=!0,se&&(c=ad,c!==null)))throw c;s.memoizedState=_,s.baseState=E,s.baseQueue=I,h.lastRenderedState=_}return m===null&&(h.lanes=0),[s.memoizedState,h.dispatch]}function Xx(s){var a=Yn(),c=a.queue;if(c===null)throw Error(i(311));c.lastRenderedReducer=s;var h=c.dispatch,m=c.pending,_=a.memoizedState;if(m!==null){c.pending=null;var E=m=m.next;do _=s(_,E.action),E=E.next;while(E!==m);Yr(_,a.memoizedState)||(si=!0),a.memoizedState=_,a.baseQueue===null&&(a.baseState=_),c.lastRenderedState=_}return[_,h]}function C$(s,a,c){var h=bt,m=Yn(),_=Tt;if(_){if(c===void 0)throw Error(i(407));c=c()}else c=a();var E=!Yr((fn||m).memoizedState,c);if(E&&(m.memoizedState=c,si=!0),m=m.queue,eS($$.bind(null,h,m,s),[s]),s=m.getSnapshot!==a||E||ri!==null&&(ri.memoizedState.tag&1)!==0,hd(s?9:8,{destroy:void 0},R$.bind(null,h,m,c,a),null),s){if(h.flags|=2048,mn===null)throw Error(i(349));_||(_a&127)!==0||O$(h,a,c)}return c}function O$(s,a,c){s.flags|=16384,s={getSnapshot:a,value:c},a=bt.updateQueue,a===null?(a=Bv(),bt.updateQueue=a,a.stores=[s]):(c=a.stores,c===null?a.stores=[s]:c.push(s))}function R$(s,a,c,h){a.value=c,a.getSnapshot=h,A$(a)&&j$(s)}function $$(s,a,c){return c(function(){A$(a)&&j$(s)})}function A$(s){var a=s.getSnapshot;s=s.value;try{var c=a();return!Yr(s,c)}catch{return!0}}function j$(s){var a=xc(s,2);a!==null&&Nr(a,s,2)}function Yx(s){var a=gr();if(typeof s=="function"){var c=s;if(s=c(),Pc){Rr(!0);try{c()}finally{Rr(!1)}}}return a.memoizedState=a.baseState=s,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ba,lastRenderedState:s},a}function P$(s,a,c,h){return s.baseState=c,Jx(s,fn,typeof h=="function"?h:ba)}function wK(s,a,c,h,m){if(Qv(s))throw Error(i(485));if(s=a.action,s!==null){var _={payload:m,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){_.listeners.push(E)}};Se.T!==null?c(!0):_.isTransition=!1,h(_),c=a.pending,c===null?(_.next=a.pending=_,N$(a,_)):(_.next=c.next,a.pending=c.next=_)}}function N$(s,a){var c=a.action,h=a.payload,m=s.state;if(a.isTransition){var _=Se.T,E={};E.types=_!==null?_.types:null,Se.T=E;try{var R=c(m,h),I=Se.S;I!==null&&I(E,R),M$(s,a,R)}catch(q){Qx(s,a,q)}finally{_!==null&&E.types!==null&&(_.types=E.types),Se.T=_}}else try{_=c(m,h),M$(s,a,_)}catch(q){Qx(s,a,q)}}function M$(s,a,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(h){I$(s,a,h)},function(h){return Qx(s,a,h)}):I$(s,a,c)}function I$(s,a,c){a.status="fulfilled",a.value=c,z$(a),s.state=c,a=s.pending,a!==null&&(c=a.next,c===a?s.pending=null:(c=c.next,a.next=c,N$(s,c)))}function Qx(s,a,c){var h=s.pending;if(s.pending=null,h!==null){h=h.next;do a.status="rejected",a.reason=c,z$(a),a=a.next;while(a!==h)}s.action=null}function z$(s){s=s.listeners;for(var a=0;a<s.length;a++)(0,s[a])()}function D$(s,a){return a}function L$(s,a){if(Tt){var c=mn.formState;if(c!==null){e:{var h=bt;if(Tt){if(wn){t:{for(var m=wn,_=Es;m.nodeType!==8;){if(!_){m=null;break t}if(m=Cs(m.nextSibling),m===null){m=null;break t}}_=m.data,m=_==="F!"||_==="F"?m:null}if(m){wn=Cs(m.nextSibling),h=m.data==="F!";break e}}ul(h)}h=!1}h&&(a=c[0])}}return c=gr(),c.memoizedState=c.baseState=a,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:D$,lastRenderedState:a},c.queue=h,c=rA.bind(null,bt,h),h.dispatch=c,h=Yx(!1),_=sS.bind(null,bt,!1,h.queue),h=gr(),m={state:a,dispatch:null,action:s,pending:null},h.queue=m,c=wK.bind(null,bt,m,_,c),m.dispatch=c,h.memoizedState=s,[a,c,!1]}function U$(s){var a=Yn();return F$(a,fn,s)}function F$(s,a,c){if(a=Jx(s,a,D$)[0],s=Jv(ba)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var h=Hf(a)}catch(E){throw E===ld?Uv:E}else h=a;a=Yn();var m=a.queue,_=m.dispatch;return c!==a.memoizedState&&(bt.flags|=2048,hd(9,{destroy:void 0},xK.bind(null,m,c),null)),[h,_,s]}function xK(s,a){s.action=a}function H$(s){var a=Yn(),c=fn;if(c!==null)return F$(a,c,s);Yn(),a=a.memoizedState,c=Yn();var h=c.queue.dispatch;return c.memoizedState=s,[a,h,!1]}function hd(s,a,c,h){return s={tag:s,create:c,deps:h,inst:a,next:null},a=bt.updateQueue,a===null&&(a=Bv(),bt.updateQueue=a),c=a.lastEffect,c===null?a.lastEffect=s.next=s:(h=c.next,c.next=s,s.next=h,a.lastEffect=s),s}function K$(){return Yn().memoizedState}function Xv(s,a,c,h){var m=gr();bt.flags|=s,m.memoizedState=hd(1|a,{destroy:void 0},c,h===void 0?null:h)}function Yv(s,a,c,h){var m=Yn();h=h===void 0?null:h;var _=m.memoizedState.inst;fn!==null&&h!==null&&Zx(h,fn.memoizedState.deps)?m.memoizedState=hd(a,_,c,h):(bt.flags|=s,m.memoizedState=hd(1|a,_,c,h))}function Z$(s,a){Xv(8390656,8,s,a)}function eS(s,a){Yv(2048,8,s,a)}function SK(s){bt.flags|=4;var a=bt.updateQueue;if(a===null)a=Bv(),bt.updateQueue=a,a.events=[s];else{var c=a.events;c===null?a.events=[s]:c.push(s)}}function W$(s){var a=Yn().memoizedState;return SK({ref:a,nextImpl:s}),function(){if((Yt&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}function q$(s,a){return Yv(4,2,s,a)}function V$(s,a){return Yv(4,4,s,a)}function B$(s,a){if(typeof a=="function"){s=s();var c=a(s);return function(){typeof c=="function"?c():a(null)}}if(a!=null)return s=s(),a.current=s,function(){a.current=null}}function G$(s,a,c){c=c!=null?c.concat([s]):null,Yv(4,4,B$.bind(null,a,s),c)}function tS(){}function J$(s,a){var c=Yn();a=a===void 0?null:a;var h=c.memoizedState;return a!==null&&Zx(a,h[1])?h[0]:(c.memoizedState=[s,a],s)}function X$(s,a){var c=Yn();a=a===void 0?null:a;var h=c.memoizedState;if(a!==null&&Zx(a,h[1]))return h[0];if(h=s(),Pc){Rr(!0);try{s()}finally{Rr(!1)}}return c.memoizedState=[h,a],h}function nS(s,a,c){return c===void 0||(_a&1073741824)!==0&&(At&261930)===0?s.memoizedState=a:(s.memoizedState=c,s=aj(),bt.lanes|=s,xl|=s,c)}function Y$(s,a,c,h){return Yr(c,a)?c:ml.current!==null?(s=nS(s,c,h),Yr(s,a)||(si=!0),s):(_a&106)===0||(_a&1073741824)!==0&&(At&261930)===0?(si=!0,s.memoizedState=c):(s=aj(),bt.lanes|=s,xl|=s,a)}function Q$(s,a,c,h,m){var _=oe.p;oe.p=_!==0&&8>_?_:8;var E=Se.T,R={};R.types=E!==null?E.types:null,Se.T=R,sS(s,!1,a,c);try{var I=m(),q=Se.S;if(q!==null&&q(R,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var se=yK(I,h);Kf(s,a,se,is(s))}else Kf(s,a,h,is(s))}catch(pe){Kf(s,a,{then:function(){},status:"rejected",reason:pe},is())}finally{oe.p=_,E!==null&&R.types!==null&&(E.types=R.types),Se.T=E}}function kK(){}function iS(s,a,c,h){if(s.tag!==5)throw Error(i(476));var m=eA(s).queue;Q$(s,m,a,je,c===null?kK:function(){return tA(s),c(h)})}function eA(s){var a=s.memoizedState;if(a!==null)return a;a={memoizedState:je,baseState:je,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ba,lastRenderedState:je},next:null};var c={};return a.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ba,lastRenderedState:c},next:null},s.memoizedState=a,s=s.alternate,s!==null&&(s.memoizedState=a),a}function tA(s){var a=eA(s);a.next===null&&(a=s.alternate.memoizedState),Kf(s,a.next.queue,{},is())}function rS(){return Li(Ad)}function nA(){return Yn().memoizedState}function iA(){return Yn().memoizedState}function EK(s){for(var a=s.return;a!==null;){switch(a.tag){case 24:case 3:var c=is();s=pl(c);var h=gl(a,s,c);h!==null&&(Nr(h,a,c),zf(h,a,c)),a={cache:jx()},s.payload=a;return}a=a.return}}function TK(s,a,c){var h=is();c={lane:h,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Qv(s)?sA(a,c):(c=Sx(s,a,c,h),c!==null&&(Nr(c,s,h),oA(c,a,h)))}function rA(s,a,c){var h=is();Kf(s,a,c,h)}function Kf(s,a,c,h){var m={lane:h,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Qv(s))sA(a,m);else{var _=s.alternate;if(s.lanes===0&&(_===null||_.lanes===0)&&(_=a.lastRenderedReducer,_!==null))try{var E=a.lastRenderedState,R=_(E,c);if(m.hasEagerState=!0,m.eagerState=R,Yr(R,E))return $v(s,a,m,0),mn===null&&Rv(),!1}catch{}if(c=Sx(s,a,m,h),c!==null)return Nr(c,s,h),oA(c,a,h),!0}return!1}function sS(s,a,c,h){if(h={lane:2,revertLane:GS(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Qv(s)){if(a)throw Error(i(479))}else a=Sx(s,c,h,2),a!==null&&Nr(a,s,2)}function Qv(s){var a=s.alternate;return s===bt||a!==null&&a===bt}function sA(s,a){ud=qv=!0;var c=s.pending;c===null?a.next=a:(a.next=c.next,c.next=a),s.pending=a}function oA(s,a,c){if((c&4194048)!==0){var h=a.lanes;h&=s.pendingLanes,c|=h,a.lanes=c,Bn(s,c)}}var ey={readContext:Li,use:Gv,useCallback:Gn,useContext:Gn,useEffect:Gn,useImperativeHandle:Gn,useLayoutEffect:Gn,useInsertionEffect:Gn,useMemo:Gn,useReducer:Gn,useRef:Gn,useState:Gn,useDebugValue:Gn,useDeferredValue:Gn,useTransition:Gn,useSyncExternalStore:Gn,useId:Gn,useHostTransitionStatus:Gn,useFormState:Gn,useActionState:Gn,useOptimistic:Gn,useMemoCache:Gn,useCacheRefresh:Gn,useEffectEvent:Gn},aA={readContext:Li,use:Gv,useCallback:function(s,a){return gr().memoizedState=[s,a===void 0?null:a],s},useContext:Li,useEffect:Z$,useImperativeHandle:function(s,a,c){c=c!=null?c.concat([s]):null,Xv(4194308,4,B$.bind(null,a,s),c)},useLayoutEffect:function(s,a){return Xv(4194308,4,s,a)},useInsertionEffect:function(s,a){Xv(4,2,s,a)},useMemo:function(s,a){var c=gr();a=a===void 0?null:a;var h=s();if(Pc){Rr(!0);try{s()}finally{Rr(!1)}}return c.memoizedState=[h,a],h},useReducer:function(s,a,c){var h=gr();if(c!==void 0){var m=c(a);if(Pc){Rr(!0);try{c(a)}finally{Rr(!1)}}}else m=a;return h.memoizedState=h.baseState=m,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:m},h.queue=s,s=s.dispatch=TK.bind(null,bt,s),[h.memoizedState,s]},useRef:function(s){var a=gr();return s={current:s},a.memoizedState=s},useState:function(s){s=Yx(s);var a=s.queue,c=rA.bind(null,bt,a);return a.dispatch=c,[s.memoizedState,c]},useDebugValue:tS,useDeferredValue:function(s,a){var c=gr();return nS(c,s,a)},useTransition:function(){var s=Yx(!1);return s=Q$.bind(null,bt,s.queue,!0,!1),gr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,a,c){var h=bt,m=gr();if(Tt){if(c===void 0)throw Error(i(407));c=c()}else{if(c=a(),mn===null)throw Error(i(349));(At&127)!==0||O$(h,a,c)}m.memoizedState=c;var _={value:c,getSnapshot:a};return m.queue=_,Z$($$.bind(null,h,_,s),[s]),h.flags|=2048,hd(9,{destroy:void 0},R$.bind(null,h,_,c,a),null),c},useId:function(){var s=gr(),a=mn.identifierPrefix;if(Tt){var c=Po,h=jo;c=(h&~(1<<32-ni(h)-1)).toString(32)+c,a="_"+a+"R_"+c,c=Vv++,0<c&&(a+="H"+c.toString(32)),a+="_"}else c=_K++,a="_"+a+"r_"+c.toString(32)+"_";return s.memoizedState=a},useHostTransitionStatus:rS,useFormState:L$,useActionState:L$,useOptimistic:function(s){var a=gr();a.memoizedState=a.baseState=s;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=c,a=sS.bind(null,bt,!0,c),c.dispatch=a,[s,a]},useMemoCache:Gx,useCacheRefresh:function(){return gr().memoizedState=EK.bind(null,bt)},useEffectEvent:function(s){var a=gr(),c={impl:s};return a.memoizedState=c,function(){if((Yt&2)!==0)throw Error(i(440));return c.impl.apply(void 0,arguments)}}},lA={readContext:Li,use:Gv,useCallback:J$,useContext:Li,useEffect:eS,useImperativeHandle:G$,useInsertionEffect:q$,useLayoutEffect:V$,useMemo:X$,useReducer:Jv,useRef:K$,useState:function(){return Jv(ba)},useDebugValue:tS,useDeferredValue:function(s,a){var c=Yn();return Y$(c,fn.memoizedState,s,a)},useTransition:function(){var s=Jv(ba)[0],a=Yn().memoizedState;return[typeof s=="boolean"?s:Hf(s),a]},useSyncExternalStore:C$,useId:nA,useHostTransitionStatus:rS,useFormState:U$,useActionState:U$,useOptimistic:function(s,a){var c=Yn();return P$(c,fn,s,a)},useMemoCache:Gx,useCacheRefresh:iA,useEffectEvent:W$},CK={readContext:Li,use:Gv,useCallback:J$,useContext:Li,useEffect:eS,useImperativeHandle:G$,useInsertionEffect:q$,useLayoutEffect:V$,useMemo:X$,useReducer:Xx,useRef:K$,useState:function(){return Xx(ba)},useDebugValue:tS,useDeferredValue:function(s,a){var c=Yn();return fn===null?nS(c,s,a):Y$(c,fn.memoizedState,s,a)},useTransition:function(){var s=Xx(ba)[0],a=Yn().memoizedState;return[typeof s=="boolean"?s:Hf(s),a]},useSyncExternalStore:C$,useId:nA,useHostTransitionStatus:rS,useFormState:H$,useActionState:H$,useOptimistic:function(s,a){var c=Yn();return fn!==null?P$(c,fn,s,a):(c.baseState=s,[s,c.queue.dispatch])},useMemoCache:Gx,useCacheRefresh:iA,useEffectEvent:W$};function oS(s,a,c,h){a=s.memoizedState,c=c(h,a),c=c==null?a:j({},a,c),s.memoizedState=c,s.lanes===0&&(s.updateQueue.baseState=c)}var aS={enqueueSetState:function(s,a,c){s=s._reactInternals;var h=is(),m=pl(h);m.payload=a,c!=null&&(m.callback=c),a=gl(s,m,h),a!==null&&(Nr(a,s,h),zf(a,s,h))},enqueueReplaceState:function(s,a,c){s=s._reactInternals;var h=is(),m=pl(h);m.tag=1,m.payload=a,c!=null&&(m.callback=c),a=gl(s,m,h),a!==null&&(Nr(a,s,h),zf(a,s,h))},enqueueForceUpdate:function(s,a){s=s._reactInternals;var c=is(),h=pl(c);h.tag=2,a!=null&&(h.callback=a),a=gl(s,h,c),a!==null&&(Nr(a,s,c),zf(a,s,c))}};function cA(s,a,c,h,m,_,E){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(h,_,E):a.prototype&&a.prototype.isPureReactComponent?!Rf(c,h)||!Rf(m,_):!0}function uA(s,a,c,h){s=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(c,h),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(c,h),a.state!==s&&aS.enqueueReplaceState(a,a.state,null)}function Nc(s,a){var c=a;if("ref"in a){c={};for(var h in a)h!=="ref"&&(c[h]=a[h])}if(s=s.defaultProps){c===a&&(c=j({},c));for(var m in s)c[m]===void 0&&(c[m]=s[m])}return c}function dA(s){Ov(s)}function hA(s){console.error(s)}function fA(s){Ov(s)}function ty(s,a){try{var c=s.onUncaughtError;c(a.value,{componentStack:a.stack})}catch(h){setTimeout(function(){throw h})}}function pA(s,a,c){try{var h=s.onCaughtError;h(c.value,{componentStack:c.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function lS(s,a,c){return c=pl(c),c.tag=3,c.payload={element:null},c.callback=function(){ty(s,a)},c}function gA(s){return s=pl(s),s.tag=3,s}function mA(s,a,c,h){var m=c.type.getDerivedStateFromError;if(typeof m=="function"){var _=h.value;s.payload=function(){return m(_)},s.callback=function(){pA(a,c,h)}}var E=c.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(s.callback=function(){pA(a,c,h),typeof m!="function"&&(Sl===null?Sl=new Set([this]):Sl.add(this));var R=h.stack;this.componentDidCatch(h.value,{componentStack:R!==null?R:""})})}function OK(s,a,c,h,m){if(c.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(a=c.alternate,a!==null&&Tc(a,c,m,!0),c=Ui.current,c!==null){switch(c.tag){case 31:case 13:case 19:return tr===null?xy():c.alternate===null&&Jn===0&&(Jn=3),c.flags&=-257,c.flags|=65536,c.lanes=m,h===Fv?c.flags|=16384:(a=c.updateQueue,a===null?c.updateQueue=new Set([h]):a.add(h),qS(s,h,m)),!1;case 22:return c.flags|=65536,h===Fv?c.flags|=16384:(a=c.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([h])},c.updateQueue=a):(c=a.retryQueue,c===null?a.retryQueue=new Set([h]):c.add(h)),qS(s,h,m)),!1}throw Error(i(435,c.tag))}return qS(s,h,m),xy(),!1}if(Tt)return a=Ui.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=m,h!==Ox&&(s=Error(i(422),{cause:h}),jf(xs(s,c)))):(h!==Ox&&(a=Error(i(423),{cause:h}),jf(xs(a,c))),s=s.current.alternate,s.flags|=65536,m&=-m,s.lanes|=m,h=xs(h,c),m=lS(s.stateNode,h,m),Dx(s,m),Jn!==4&&(Jn=2)),!1;var _=Error(i(520),{cause:h});if(_=xs(_,c),Xf===null?Xf=[_]:Xf.push(_),Jn!==4&&(Jn=2),a===null)return!0;h=xs(h,c),c=a;do{switch(c.tag){case 3:return c.flags|=65536,s=m&-m,c.lanes|=s,s=lS(c.stateNode,h,s),Dx(c,s),!1;case 1:if(a=c.type,_=c.stateNode,(c.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(Sl===null||!Sl.has(_))))return c.flags|=65536,m&=-m,c.lanes|=m,m=gA(m),mA(m,s,c,h),Dx(c,m),!1;break;case 22:if(c.memoizedState!==null)return c.flags|=65536,!1}c=c.return}while(c!==null);return!1}var cS=Error(i(461)),si=!1;function ui(s,a,c,h){a.child=s===null?b$(a,null,c,h):jc(a,s.child,c,h)}function vA(s,a,c,h,m){c=c.render;var _=a.ref;if("ref"in h){var E={};for(var R in h)R!=="ref"&&(E[R]=h[R])}else E=h;return Cc(a),h=Wx(s,a,c,E,_,m),R=qx(),s!==null&&!si?(Vx(s,a,m),wa(s,a,m)):(Tt&&R&&Nv(a),a.flags|=1,ui(s,a,h,m),a.child)}function yA(s,a,c,h,m){if(s===null){var _=c.type;return typeof _=="function"&&!kx(_)&&_.defaultProps===void 0&&c.compare===null?(a.tag=15,a.type=_,_A(s,a,_,h,m)):(s=jv(c.type,null,h,a,a.mode,m),s.ref=a.ref,s.return=a,a.child=s)}if(_=s.child,!vS(s,m)){var E=_.memoizedProps;if(c=c.compare,c=c!==null?c:Rf,c(E,h)&&s.ref===a.ref)return wa(s,a,m)}return a.flags|=1,s=ga(_,h),s.ref=a.ref,s.return=a,a.child=s}function _A(s,a,c,h,m){if(s!==null){var _=s.memoizedProps;if(Rf(_,h)&&s.ref===a.ref)if(si=!1,a.pendingProps=h=_,vS(s,m))(s.flags&131072)!==0&&(si=!0);else return a.lanes=s.lanes,wa(s,a,m)}return uS(s,a,c,h,m)}function bA(s,a,c,h){var m=h.children,_=s!==null?s.memoizedState:null;if(s===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((a.flags&128)!==0){if(_=_!==null?_.baseLanes|c:c,s!==null){for(h=a.child=s.child,m=0;h!==null;)m=m|h.lanes|h.childLanes,h=h.sibling;h=m&~_}else h=0,a.child=null;return wA(s,a,_,c,h)}if((c&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},s!==null&&Lv(a,_!==null?_.cachePool:null),_!==null?S$(a,_):Ux(),k$(a);else return h=a.lanes=536870912,wA(s,a,_!==null?_.baseLanes|c:c,c,h)}else _!==null?(Lv(a,_.cachePool),S$(a,_),yl(),a.memoizedState=null):(s!==null&&Lv(a,null),Ux(),yl());return ui(s,a,m,c),a.child}function Zf(s,a){return s!==null&&s.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function wA(s,a,c,h,m){var _=Nx();return _=_===null?null:{parent:ii._currentValue,pool:_},a.memoizedState={baseLanes:c,cachePool:_},s!==null&&Lv(a,null),Ux(),k$(a),s!==null&&Tc(s,a,h,!0),a.childLanes=m,null}function ny(s,a){return a=iy({mode:a.mode,children:a.children},s.mode),a.ref=s.ref,s.child=a,a.return=s,a}function xA(s,a,c){return jc(a,s.child,null,c),s=ny(a,a.pendingProps),s.flags|=2,Qr(a),a.memoizedState=null,s}function RK(s,a,c){var h=a.pendingProps,m=(a.flags&128)!==0;if(a.flags&=-129,s===null){if(Tt){if(h.mode==="hidden")return s=ny(a,h),a.lanes=536870912,s.memoizedState={baseLanes:0,cachePool:null},Zf(null,s);if(Hx(a),(s=wn)?(s=Bj(s,Es),s=s!==null&&s.data==="&"?s:null,s!==null&&(a.memoizedState={dehydrated:s,treeContext:ll!==null?{id:jo,overflow:Po}:null,retryLane:536870912,hydrationErrors:null},c=s$(s),c.return=a,a.child=c,Ci=a,wn=null)):s=null,s===null)throw ul(a);return a.lanes=536870912,null}return ny(a,h)}var _=s.memoizedState;if(_!==null){var E=_.dehydrated;if(Hx(a),m)if(a.flags&256)a.flags&=-257,a=xA(s,a,c);else if(a.memoizedState!==null)a.child=s.child,a.flags|=128,a=null;else throw Error(i(558));else if(si||Tc(s,a,c,!1),m=(c&s.childLanes)!==0,si||m){if(ml.current===null){if(h=mn,h!==null&&(E=Gt(h,c),E!==0&&E!==_.retryLane))throw _.retryLane=E,xc(s,E),Nr(h,s,E),cS;xy()}a=xA(s,a,c)}else s=_.treeContext,wn=Cs(E.nextSibling),Ci=a,Tt=!0,cl=null,Es=!1,s!==null&&l$(a,s),a=ny(a,h),a.flags|=134221824;return a}return s=ga(s.child,{mode:h.mode,children:h.children}),s.ref=a.ref,a.child=s,s.return=a,s}function fd(s,a){var c=a.ref;if(c===null)s!==null&&s.ref!==null&&(a.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(i(284));(s===null||s.ref!==c)&&(a.flags|=4194816)}}function uS(s,a,c,h,m){return Cc(a),c=Wx(s,a,c,h,void 0,m),h=qx(),s!==null&&!si?(Vx(s,a,m),wa(s,a,m)):(Tt&&h&&Nv(a),a.flags|=1,ui(s,a,c,m),a.child)}function SA(s,a,c,h,m,_){return Cc(a),a.updateQueue=null,c=T$(a,h,c,m),E$(s),h=qx(),s!==null&&!si?(Vx(s,a,_),wa(s,a,_)):(Tt&&h&&Nv(a),a.flags|=1,ui(s,a,c,_),a.child)}function kA(s,a,c,h,m){if(Cc(a),a.stateNode===null){var _=id,E=c.contextType;typeof E=="object"&&E!==null&&(_=Li(E)),_=new c(h,_),a.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=aS,a.stateNode=_,_._reactInternals=a,_=a.stateNode,_.props=h,_.state=a.memoizedState,_.refs={},Ix(a),E=c.contextType,_.context=typeof E=="object"&&E!==null?Li(E):id,_.state=a.memoizedState,E=c.getDerivedStateFromProps,typeof E=="function"&&(oS(a,c,E,h),_.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(E=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),E!==_.state&&aS.enqueueReplaceState(_,_.state,null),Lf(a,h,_,m),Df(),_.state=a.memoizedState),typeof _.componentDidMount=="function"&&(a.flags|=4194308),h=!0}else if(s===null){_=a.stateNode;var R=a.memoizedProps,I=Nc(c,R);_.props=I;var q=_.context,se=c.contextType;E=id,typeof se=="object"&&se!==null&&(E=Li(se));var pe=c.getDerivedStateFromProps;se=typeof pe=="function"||typeof _.getSnapshotBeforeUpdate=="function",R=a.pendingProps!==R,se||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(R||q!==E)&&uA(a,_,h,E),fl=!1;var K=a.memoizedState;_.state=K,Lf(a,h,_,m),Df(),q=a.memoizedState,R||K!==q||fl?(typeof pe=="function"&&(oS(a,c,pe,h),q=a.memoizedState),(I=fl||cA(a,c,I,h,K,q,E))?(se||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(a.flags|=4194308)):(typeof _.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=h,a.memoizedState=q),_.props=h,_.state=q,_.context=E,h=I):(typeof _.componentDidMount=="function"&&(a.flags|=4194308),h=!1)}else{_=a.stateNode,zx(s,a),E=a.memoizedProps,se=Nc(c,E),_.props=se,pe=a.pendingProps,K=_.context,q=c.contextType,I=id,typeof q=="object"&&q!==null&&(I=Li(q)),R=c.getDerivedStateFromProps,(q=typeof R=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(E!==pe||K!==I)&&uA(a,_,h,I),fl=!1,K=a.memoizedState,_.state=K,Lf(a,h,_,m),Df();var te=a.memoizedState;E!==pe||K!==te||fl||s!==null&&s.dependencies!==null&&zv(s.dependencies)?(typeof R=="function"&&(oS(a,c,R,h),te=a.memoizedState),(se=fl||cA(a,c,se,h,K,te,I)||s!==null&&s.dependencies!==null&&zv(s.dependencies))?(q||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(h,te,I),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(h,te,I)),typeof _.componentDidUpdate=="function"&&(a.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof _.componentDidUpdate!="function"||E===s.memoizedProps&&K===s.memoizedState||(a.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||E===s.memoizedProps&&K===s.memoizedState||(a.flags|=1024),a.memoizedProps=h,a.memoizedState=te),_.props=h,_.state=te,_.context=I,h=se):(typeof _.componentDidUpdate!="function"||E===s.memoizedProps&&K===s.memoizedState||(a.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||E===s.memoizedProps&&K===s.memoizedState||(a.flags|=1024),h=!1)}return _=h,fd(s,a),h=(a.flags&128)!==0,_||h?(_=a.stateNode,c=h&&typeof c.getDerivedStateFromError!="function"?null:_.render(),a.flags|=1,s!==null&&h?(a.child=jc(a,s.child,null,m),a.child=jc(a,null,c,m)):ui(s,a,c,m),a.memoizedState=_.state,s=a.child):s=wa(s,a,m),s}function EA(s,a,c,h){return kc(),a.flags|=256,ui(s,a,c,h),a.child}var dS={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hS(s){return{baseLanes:s,cachePool:p$()}}function fS(s,a,c){return s=s!==null?s.childLanes&~c:0,a&&(s|=ns),s}function TA(s,a,c){var h=a.pendingProps,m=!1,_=(a.flags&128)!==0,E;if((E=_)||(E=s!==null&&s.memoizedState===null?!1:(Fi.current&2)!==0),E&&(m=!0,a.flags&=-129),E=(a.flags&32)!==0,a.flags&=-33,s===null){if(Tt){if(m?vl(a):yl(),(s=wn)?(s=Bj(s,Es),s=s!==null&&s.data!=="&"?s:null,s!==null&&(a.memoizedState={dehydrated:s,treeContext:ll!==null?{id:jo,overflow:Po}:null,retryLane:536870912,hydrationErrors:null},c=s$(s),c.return=a,a.child=c,Ci=a,wn=null)):s=null,s===null)throw ul(a);return hk(s)?a.lanes=32:a.lanes=536870912,null}return _=h.children,h=h.fallback,m?(yl(),m=a.mode,_=iy({mode:"hidden",children:_},m),h=Sc(h,m,c,null),_.return=a,h.return=a,_.sibling=h,a.child=_,h=a.child,h.memoizedState=hS(c),h.childLanes=fS(s,E,c),a.memoizedState=dS,Zf(null,h)):(vl(a),pS(a,_))}var R=s.memoizedState;if(R!==null){var I=R.dehydrated;if(I!==null)return $K(s,a,_,E,h,I,R,c)}return m?(yl(),m=h.fallback,_=a.mode,R=s.child,I=R.sibling,h=ga(R,{mode:"hidden",children:h.children}),h.subtreeFlags=R.subtreeFlags&1206910976,I!==null?m=ga(I,m):(m=Sc(m,_,c,null),m.flags|=2),m.return=a,h.return=a,h.sibling=m,a.child=h,Zf(null,h),h=a.child,m=s.child.memoizedState,m===null?m=hS(c):(_=m.cachePool,_!==null?(R=ii._currentValue,_=_.parent!==R?{parent:R,pool:R}:_):_=p$(),m={baseLanes:m.baseLanes|c,cachePool:_}),h.memoizedState=m,h.childLanes=fS(s,E,c),a.memoizedState=dS,Zf(s.child,h)):(vl(a),c=s.child,s=c.sibling,c=ga(c,{mode:"visible",children:h.children}),c.return=a,c.sibling=null,s!==null&&(E=a.deletions,E===null?(a.deletions=[s],a.flags|=16):E.push(s)),a.child=c,a.memoizedState=null,c)}function pS(s,a){return a=iy({mode:"visible",children:a},s.mode),a.return=s,s.child=a}function iy(s,a){return s=$r(22,s,null,a),s.lanes=0,s}function ry(s,a,c){return jc(a,s.child,null,c),s=pS(a,a.pendingProps.children),s.flags|=2,a.memoizedState=null,s}function $K(s,a,c,h,m,_,E,R){if(c)return a.flags&256?(vl(a),a.flags&=-257,ry(s,a,R)):a.memoizedState!==null?(yl(),a.child=s.child,a.flags|=128,null):(yl(),_=m.fallback,E=a.mode,m=iy({mode:"visible",children:m.children},E),_=Sc(_,E,R,null),_.flags|=2,m.return=a,_.return=a,m.sibling=_,a.child=m,jc(a,s.child,null,R),m=a.child,m.memoizedState=hS(R),m.childLanes=fS(s,h,R),a.memoizedState=dS,Zf(null,m));if(vl(a),hk(_)){if(h=_.nextSibling&&_.nextSibling.dataset,h)var I=h.dgst;return h=I,h!==""&&(m=Error(i(419)),m.stack="",m.digest=h,jf({value:m,source:null,stack:null})),ry(s,a,R)}if(si||Tc(s,a,R,!1),h=(R&s.childLanes)!==0,si||h){if(ml.current!==null)return ry(s,a,R);if(h=mn,h!==null&&(m=Gt(h,R),m!==0&&m!==E.retryLane))throw E.retryLane=m,xc(s,m),Nr(h,s,m),cS;return dk(_)||xy(),ry(s,a,R)}return dk(_)?(a.flags|=192,a.child=s.child,null):(s=E.treeContext,wn=Cs(_.nextSibling),Ci=a,Tt=!0,cl=null,Es=!1,s!==null&&l$(a,s),a=pS(a,m.children),a.flags|=134221824,a)}function CA(s,a,c){s.lanes|=a;var h=s.alternate;h!==null&&(h.lanes|=a),Iv(s.return,a,c)}function OA(s){for(var a=null;s!==null;){var c=s.alternate;c!==null&&Wv(c)===null&&(a=s),s=s.sibling}return a}function sy(s,a,c,h,m,_){var E=s.memoizedState;E===null?s.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:h,tail:c,tailMode:m,treeForkCount:_}:(E.isBackwards=a,E.rendering=null,E.renderingStartTime=0,E.last=h,E.tail=c,E.tailMode=m,E.treeForkCount=_)}function gS(s){var a=s.child;for(s.child=null;a!==null;){var c=a.sibling;a.sibling=s.child,s.child=a,a=c}}function mS(s,a,c){var h=a.pendingProps,m=h.revealOrder,_=h.tail;h=h.children;var E=Fi.current;if(a.flags&128)return Uf(a,E),null;var R=(E&2)!==0;if(R?(E=E&1|2,a.flags|=128):E&=1,Uf(a,E),m==="backwards"&&s!==null?(gS(s),ui(s,a,h,c),gS(s)):ui(s,a,h,c),h=Tt?Af:0,!R&&s!==null&&(s.flags&128)!==0)e:for(s=a.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&CA(s,c,a);else if(s.tag===19)CA(s,c,a);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break e;for(;s.sibling===null;){if(s.return===null||s.return===a)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(m){case"backwards":c=OA(a.child),c===null?(m=a.child,a.child=null):(m=c.sibling,c.sibling=null,gS(a)),sy(a,!0,m,null,_,h);break;case"unstable_legacy-backwards":for(c=null,m=a.child,a.child=null;m!==null;){if(s=m.alternate,s!==null&&Wv(s)===null){a.child=m;break}s=m.sibling,m.sibling=c,c=m,m=s}sy(a,!0,c,null,_,h);break;case"together":sy(a,!1,null,null,void 0,h);break;case"independent":a.memoizedState=null;break;default:c=OA(a.child),c===null?(m=a.child,a.child=null):(m=c.sibling,c.sibling=null),sy(a,!1,m,c,_,h)}return a.child}function RA(s,a,c){var h=a.pendingProps;return dl(a,a.type,h.value),ui(s,a,h.children,c),a.child}function wa(s,a,c){if(s!==null&&(a.dependencies=s.dependencies),xl|=a.lanes,(c&a.childLanes)===0)if(s!==null){if(Tc(s,a,c,!1),(c&a.childLanes)===0)return null}else return null;if(s!==null&&a.child!==s.child)throw Error(i(153));if(a.child!==null){for(s=a.child,c=ga(s,s.pendingProps),a.child=c,c.return=a;s.sibling!==null;)s=s.sibling,c=c.sibling=ga(s,s.pendingProps),c.return=a;c.sibling=null}return a.child}function vS(s,a){return(s.lanes&a)!==0?!0:(s=s.dependencies,!!(s!==null&&zv(s)))}function AK(s,a,c){switch(a.tag){case 3:tn(a,a.stateNode.containerInfo),dl(a,ii,s.memoizedState.cache),kc();break;case 27:case 5:kt(a);break;case 4:tn(a,a.stateNode.containerInfo);break;case 10:dl(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,Hx(a),null;break;case 13:var h=a.memoizedState;if(h!==null){if(h.dehydrated!==null)return vl(a),a.flags|=128,null;h=Tc(s,a,c,!1);var m=a.child.childLanes;return h||(c&m)!==0?TA(s,a,c):(vl(a),s=wa(s,a,c),s!==null?s.sibling:null)}vl(a);break;case 19:if(a.flags&128)return mS(s,a,c);if(m=(s.flags&128)!==0,h=(c&a.childLanes)!==0,h||(Tc(s,a,c,!1),h=(c&a.childLanes)!==0),m){if(h)return mS(s,a,c);a.flags|=128}if(m=a.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),Uf(a,Fi.current),h)break;return null;case 22:return a.lanes=0,bA(s,a,c,a.pendingProps);case 24:dl(a,ii,s.memoizedState.cache)}return wa(s,a,c)}function $A(s,a,c){if(s!==null)if(s.memoizedProps!==a.pendingProps)si=!0;else{if(!vS(s,c)&&(a.flags&128)===0)return si=!1,AK(s,a,c);si=(s.flags&131072)!==0}else si=!1,Tt&&(a.flags&1048576)!==0&&a$(a,Af,a.index);switch(a.lanes=0,a.tag){case 16:e:{var h=a.pendingProps;if(s=$c(a.elementType),a.type=s,typeof s=="function")kx(s)?(h=Nc(s,h),a.tag=1,a=kA(null,a,s,h,c)):(a.tag=0,a=uS(null,a,s,h,c));else{if(s!=null){var m=s.$$typeof;if(m===Z){a.tag=11,a=vA(null,a,s,h,c);break e}else if(m===ge){a.tag=14,a=yA(null,a,s,h,c);break e}else if(m===ce){a.tag=10,a.type=s,a=RA(null,a,c);break e}}throw a=ke(s)||s,Error(i(306,a,""))}}return a;case 0:return uS(s,a,a.type,a.pendingProps,c);case 1:return h=a.type,m=Nc(h,a.pendingProps),kA(s,a,h,m,c);case 3:e:{if(tn(a,a.stateNode.containerInfo),s===null)throw Error(i(387));h=a.pendingProps;var _=a.memoizedState;m=_.element,zx(s,a),Lf(a,h,null,c);var E=a.memoizedState;if(h=E.cache,dl(a,ii,h),h!==_.cache&&Ax(a,[ii],c,!0),Df(),h=E.element,_.isDehydrated)if(_={element:h,isDehydrated:!1,cache:E.cache},a.updateQueue.baseState=_,a.memoizedState=_,a.flags&256){a=EA(s,a,h,c);break e}else if(h!==m){m=xs(Error(i(424)),a),jf(m),a=EA(s,a,h,c);break e}else for(s=a.stateNode.containerInfo,s.nodeType===9?s=s.body:s=s.nodeName==="HTML"?s.ownerDocument.body:s,wn=Cs(s.firstChild),Ci=a,Tt=!0,cl=null,Es=!0,c=b$(a,null,h,c),a.child=c;c;)c.flags=c.flags&-3|134221824,c=c.sibling;else{if(kc(),h===m){a=wa(s,a,c);break e}ui(s,a,h,c)}a=a.child}return a;case 26:return fd(s,a),s===null?(c=tP(a.type,null,a.pendingProps,null))?a.memoizedState=c:Tt||(a.stateNode=Nj(a.type,a.pendingProps,yt.current,a)):a.memoizedState=tP(a.type,s.memoizedProps,a.pendingProps,s.memoizedState),null;case 27:return kt(a),s===null&&Tt&&(h=a.stateNode=Xj(a.type,a.pendingProps,yt.current),Ci=a,Es=!0,m=wn,Tl(a.type)?(fk=m,wn=Cs(h.firstChild)):wn=m),ui(s,a,a.pendingProps.children,c),fd(s,a),s===null&&(a.flags|=4194304),a.child;case 5:return s===null&&Tt&&((m=h=wn)&&(h=EZ(h,a.type,a.pendingProps,Es),h!==null?(a.stateNode=h,Ci=a,wn=Cs(h.firstChild),Es=!1,m=!0):m=!1),m||ul(a)),kt(a),m=a.type,_=a.pendingProps,E=s!==null?s.memoizedProps:null,h=_.children,rk(m,_)?h=null:E!==null&&rk(m,E)&&(a.flags|=32),a.memoizedState!==null&&(m=Wx(s,a,bK,null,null,c),Ad._currentValue=m),fd(s,a),ui(s,a,h,c),a.child;case 6:return s===null&&Tt&&((s=c=wn)&&(c=TZ(c,a.pendingProps,Es),c!==null?(a.stateNode=c,Ci=a,wn=null,s=!0):s=!1),s||ul(a)),null;case 13:return TA(s,a,c);case 4:return tn(a,a.stateNode.containerInfo),h=a.pendingProps,s===null?a.child=jc(a,null,h,c):ui(s,a,h,c),a.child;case 11:return vA(s,a,a.type,a.pendingProps,c);case 7:return h=a.pendingProps,fd(s,a),ui(s,a,h,c),a.child;case 8:return ui(s,a,a.pendingProps.children,c),a.child;case 12:return ui(s,a,a.pendingProps.children,c),a.child;case 10:return RA(s,a,c);case 9:return m=a.type._context,h=a.pendingProps.children,Cc(a),m=Li(m),h=h(m),a.flags|=1,ui(s,a,h,c),a.child;case 14:return yA(s,a,a.type,a.pendingProps,c);case 15:return _A(s,a,a.type,a.pendingProps,c);case 19:return mS(s,a,c);case 31:return RK(s,a,c);case 22:return bA(s,a,c,a.pendingProps);case 24:return Cc(a),h=Li(ii),s===null?(m=Nx(),m===null&&(m=mn,_=jx(),m.pooledCache=_,_.refCount++,_!==null&&(m.pooledCacheLanes|=c),m=_),a.memoizedState={parent:h,cache:m},Ix(a),dl(a,ii,m)):((s.lanes&c)!==0&&(zx(s,a),Lf(a,null,null,c),Df()),m=s.memoizedState,_=a.memoizedState,m.parent!==h?(m={parent:h,cache:h},a.memoizedState=m,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=m),dl(a,ii,h)):(h=_.cache,dl(a,ii,h),h!==m.cache&&Ax(a,[ii],c,!0))),ui(s,a,a.pendingProps.children,c),a.child;case 30:return a.stateNode===null&&(a.stateNode={autoName:null,paired:null,clones:null,ref:null}),h=a.pendingProps,h.name!=null&&h.name!=="auto"?a.flags|=s===null?18882560:18874368:Tt&&Nv(a),s!==null&&s.memoizedProps.name!==h.name?a.flags|=4194816:fd(s,a),ui(s,a,h.children,c),a.child;case 29:throw a.pendingProps}throw Error(i(156,a.tag))}function xa(s){s.flags|=4}function yS(s,a,c,h,m){var _;if((_=(s.mode&32)!==0)&&(_=c===null?sP(a,h):sP(a,h)&&(h.src!==c.src||h.srcSet!==c.srcSet)),_){if(s.flags|=16777216,(m&335544128)===m)if(s.stateNode.complete)s.flags|=8192;else if(dj())s.flags|=8192;else throw Ac=Fv,Mx}else s.flags&=-16777217}function AA(s,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!oP(a))if(dj())s.flags|=8192;else throw Ac=Fv,Mx}function oy(s,a){a!==null&&(s.flags|=4),s.flags&16384&&(a=s.tag!==22?Xe():536870912,s.lanes|=a,yd|=a)}function Wf(s,a){if(!Tt)switch(s.tailMode){case"visible":break;case"collapsed":for(var c=s.tail,h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?a||s.tail===null?s.tail=null:s.tail.sibling=null:h.sibling=null;break;default:for(a=s.tail,c=null;a!==null;)a.alternate!==null&&(c=a),a=a.sibling;c===null?s.tail=null:c.sibling=null}}function xn(s){var a=s.alternate!==null&&s.alternate.child===s.child,c=0,h=0;if(a)for(var m=s.child;m!==null;)c|=m.lanes|m.childLanes,h|=m.subtreeFlags&1206910976,h|=m.flags&1206910976,m.return=s,m=m.sibling;else for(m=s.child;m!==null;)c|=m.lanes|m.childLanes,h|=m.subtreeFlags,h|=m.flags,m.return=s,m=m.sibling;return s.subtreeFlags|=h,s.childLanes=c,a}function jK(s,a,c){var h=a.pendingProps;switch(Cx(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xn(a),null;case 1:return xn(a),null;case 3:return c=a.stateNode,h=null,s!==null&&(h=s.memoizedState.cache),a.memoizedState.cache!==h&&(a.flags|=2048),ya(ii),Xn(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(s===null||s.child===null)&&(od(a)?xa(a):s===null||s.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Rx())),xn(a),null;case 26:var m=a.type,_=a.memoizedState;return s===null?(xa(a),_!==null?(xn(a),AA(a,_)):(xn(a),yS(a,m,null,h,c))):_?_!==s.memoizedState?(xa(a),xn(a),AA(a,_)):(xn(a),a.flags&=-16777217):(s=s.memoizedProps,s!==h&&xa(a),xn(a),yS(a,m,s,h,c)),null;case 27:if(bn(a),c=yt.current,m=a.type,s!==null&&a.stateNode!=null)s.memoizedProps!==h&&xa(a);else{if(!h){if(a.stateNode===null)throw Error(i(166));return xn(a),a.subtreeFlags&=-33554433,null}s=vt.current,od(a)?c$(a):(s=Xj(m,h,c),a.stateNode=s,xa(a))}return xn(a),a.subtreeFlags&=-33554433,null;case 5:if(bn(a),m=a.type,s!==null&&a.stateNode!=null)s.memoizedProps!==h&&xa(a);else{if(!h){if(a.stateNode===null)throw Error(i(166));return xn(a),a.subtreeFlags&=-33554433,null}if(_=vt.current,od(a))c$(a);else{var E=np(yt.current);switch(_){case 1:_=E.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:_=E.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":_=E.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":_=E.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":_=E.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof h.is=="string"?E.createElement("select",{is:h.is}):E.createElement("select"),h.multiple?_.multiple=!0:h.size&&(_.size=h.size);break;default:_=typeof h.is=="string"?E.createElement(m,{is:h.is}):E.createElement(m)}}_[jn]=a,_[Zn]=h;e:for(E=a.child;E!==null;){if(E.tag===5||E.tag===6)_.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===a)break e;for(;E.sibling===null;){if(E.return===null||E.return===a)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}a.stateNode=_;e:switch(Ki(_,m,h),m){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&xa(a)}}return xn(a),a.subtreeFlags&=-33554433,yS(a,a.type,s===null?null:s.memoizedProps,a.pendingProps,c),null;case 6:if(s&&a.stateNode!=null)s.memoizedProps!==h&&xa(a);else{if(typeof h!="string"&&a.stateNode===null)throw Error(i(166));if(s=yt.current,od(a)){if(s=a.stateNode,c=a.memoizedProps,h=null,m=Ci,m!==null)switch(m.tag){case 27:case 5:h=m.memoizedProps}s[jn]=a,s=!!(s.nodeValue===c||h!==null&&h.suppressHydrationWarning===!0||$j(s.nodeValue,c)),s||ul(a,!0)}else s=np(s).createTextNode(h),s[jn]=a,a.stateNode=s}return xn(a),null;case 31:if(c=a.memoizedState,s===null||s.memoizedState!==null){if(h=od(a),c!==null){if(s===null){if(!h)throw Error(i(318));if(s=a.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(557));s[jn]=a}else kc(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;xn(a),s=!1}else c=Rx(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=c),s=!0;if(!s)return a.flags&256?(Qr(a),a):(Qr(a),null);if((a.flags&128)!==0)throw Error(i(558))}return xn(a),null;case 13:if(h=a.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(m=od(a),h!==null&&h.dehydrated!==null){if(s===null){if(!m)throw Error(i(318));if(m=a.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(i(317));m[jn]=a}else kc(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;xn(a),m=!1}else m=Rx(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=m),m=!0;if(!m)return a.flags&256?(Qr(a),a):(Qr(a),null)}return Qr(a),(a.flags&128)!==0?(a.lanes=c,a):(c=h!==null,s=s!==null&&s.memoizedState!==null,c&&(h=a.child,m=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(m=h.alternate.memoizedState.cachePool.pool),_=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(_=h.memoizedState.cachePool.pool),_!==m&&(h.flags|=2048)),c!==s&&c&&(a.child.flags|=8192),oy(a,a.updateQueue),xn(a),null);case 4:return Xn(),s===null&&QS(a.stateNode.containerInfo),a.flags|=67108864,xn(a),null;case 10:return ya(a.type),xn(a),null;case 19:if(Kx(a),h=a.memoizedState,h===null)return xn(a),null;if(m=(a.flags&128)!==0,_=h.rendering,_===null)if(m)Wf(h,!1);else{if(Jn!==0||s!==null&&(s.flags&128)!==0)for(s=a.child;s!==null;){if(_=Wv(s),_!==null){for(a.flags|=128,Wf(h,!1),s=_.updateQueue,a.updateQueue=s,oy(a,s),a.subtreeFlags=0,s=c,c=a.child;c!==null;)r$(c,s),c=c.sibling;return Uf(a,Fi.current&1|2),Tt&&ma(a,h.treeForkCount),a.child}s=s.sibling}h.tail!==null&&ei()>yy&&(a.flags|=128,m=!0,Wf(h,!1),a.lanes=4194304)}else{if(!m)if(s=Wv(_),s!==null){if(a.flags|=128,m=!0,s=s.updateQueue,a.updateQueue=s,oy(a,s),Wf(h,!0),h.tail===null&&h.tailMode!=="collapsed"&&h.tailMode!=="visible"&&!_.alternate&&!Tt)return xn(a),null}else 2*ei()-h.renderingStartTime>yy&&c!==536870912&&(a.flags|=128,m=!0,Wf(h,!1),a.lanes=4194304);h.isBackwards?(_.sibling=a.child,a.child=_):(s=h.last,s!==null?s.sibling=_:a.child=_,h.last=_)}if(h.tail!==null){s=h.tail;e:{for(c=s;c!==null;){if(c.alternate!==null){c=!1;break e}c=c.sibling}c=!0}return h.rendering=s,h.tail=s.sibling,h.renderingStartTime=ei(),s.sibling=null,_=Fi.current,_=m?_&1|2:_&1,h.tailMode==="visible"||h.tailMode==="collapsed"||!c||Tt?Uf(a,_):(c=_,Ge(Ui,a),Ge(Fi,c),tr===null&&(tr=a)),Tt&&ma(a,h.treeForkCount),s}return xn(a),null;case 22:case 23:return Qr(a),Fx(),h=a.memoizedState!==null,s!==null?s.memoizedState!==null!==h&&(a.flags|=8192):h&&(a.flags|=8192),h?(c&536870912)!==0&&(a.flags&128)===0&&(xn(a),a.subtreeFlags&6&&(a.flags|=8192)):xn(a),c=a.updateQueue,c!==null&&oy(a,c.retryQueue),c=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),h=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(h=a.memoizedState.cachePool.pool),h!==c&&(a.flags|=2048),s!==null&&ze(Rc),null;case 24:return c=null,s!==null&&(c=s.memoizedState.cache),a.memoizedState.cache!==c&&(a.flags|=2048),ya(ii),xn(a),null;case 25:return null;case 30:return a.flags|=33554432,xn(a),null}throw Error(i(156,a.tag))}function PK(s,a){switch(Cx(a),a.tag){case 1:return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 3:return ya(ii),Xn(),s=a.flags,(s&65536)!==0&&(s&128)===0?(a.flags=s&-65537|128,a):null;case 26:case 27:case 5:return bn(a),null;case 31:if(a.memoizedState!==null){if(Qr(a),a.alternate===null)throw Error(i(340));kc()}return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 13:if(Qr(a),s=a.memoizedState,s!==null&&s.dehydrated!==null){if(a.alternate===null)throw Error(i(340));kc()}return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 19:return Kx(a),s=a.flags,s&65536?(a.flags=s&-65537|128,s=a.memoizedState,s!==null&&(s.rendering=null,s.tail=null),a.flags|=4,a):null;case 4:return Xn(),null;case 10:return ya(a.type),null;case 22:case 23:return Qr(a),Fx(),s!==null&&ze(Rc),s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 24:return ya(ii),null;case 25:return null;default:return null}}function jA(s,a){switch(Cx(a),a.tag){case 3:ya(ii),Xn();break;case 26:case 27:case 5:bn(a);break;case 4:Xn();break;case 31:a.memoizedState!==null&&Qr(a);break;case 13:Qr(a);break;case 19:Kx(a);break;case 10:ya(a.type);break;case 22:case 23:Qr(a),Fx(),s!==null&&ze(Rc);break;case 24:ya(ii)}}function qf(s,a){try{var c=a.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var m=h.next;c=m;do{if((c.tag&s)===s){h=void 0;var _=c.create,E=c.inst;h=_(),E.destroy=h}c=c.next}while(c!==m)}}catch(R){cn(a,a.return,R)}}function _l(s,a,c){try{var h=a.updateQueue,m=h!==null?h.lastEffect:null;if(m!==null){var _=m.next;h=_;do{if((h.tag&s)===s){var E=h.inst,R=E.destroy;if(R!==void 0){E.destroy=void 0,m=a;var I=c,q=R;try{q()}catch(se){cn(m,I,se)}}}h=h.next}while(h!==_)}}catch(se){cn(a,a.return,se)}}function PA(s){var a=s.updateQueue;if(a!==null){var c=s.stateNode;try{x$(a,c)}catch(h){cn(s,s.return,h)}}}function NA(s,a,c){c.props=Nc(s.type,s.memoizedProps),c.state=s.memoizedState;try{c.componentWillUnmount()}catch(h){cn(s,a,h)}}function No(s,a){try{var c=s.ref;if(c!==null){switch(s.tag){case 26:case 27:case 5:var h=s.stateNode;break;case 30:var m=s.stateNode,_=fa(s.memoizedProps,m);(m.ref===null||m.ref.name!==_)&&(m.ref=Fj(_)),h=m.ref;break;case 7:if(s.stateNode===null){var E=new rs(s);g(s.child,!1,SZ,E,void 0,void 0),s.stateNode=E}h=s.stateNode;break;default:h=s.stateNode}typeof c=="function"?s.refCleanup=c(h):c.current=h}}catch(R){cn(s,a,R)}}function Hi(s,a){var c=s.ref,h=s.refCleanup;if(c!==null)if(typeof h=="function")try{h()}catch(m){cn(s,a,m)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(m){cn(s,a,m)}else c.current=null}function ay(s,a){if((s.tag===5||s.tag===27||s.tag===6)&&s.alternate===null&&a!==null)for(var c=0;c<a.length;c++)Vj(s.stateNode,a[c])}function MA(s){for(var a=s.return;a!==null&&(bS(a)&&Vj(s.stateNode,a.stateNode),!_S(a));)a=a.return}function Vf(s){for(var a=s.return;a!==null&&(bS(a)&&kZ(s.stateNode,a.stateNode),!_S(a));)a=a.return}function _S(s){return s.tag===5||s.tag===3||s.tag===27}function bS(s){return s&&s.tag===7&&s.stateNode!==null}function wS(s){var a=s.type,c=s.memoizedProps,h=s.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":c.autoFocus&&h.focus();break e;case"img":c.src?h.src=c.src:c.srcSet&&(h.srcset=c.srcSet)}}catch(m){cn(s,s.return,m)}}function xS(s,a,c){try{var h=s.stateNode;sZ(h,s.type,c,a),h[Zn]=a}catch(m){cn(s,s.return,m)}}function IA(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Tl(s.type)||s.tag===4}function SS(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||IA(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Tl(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function kS(s,a,c,h){var m=s.tag;if(m===5||m===6)m=s.stateNode,a?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(m,a):(a=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,a.appendChild(m),c=c._reactRootContainer,c!=null||a.onclick!==null||(a.onclick=Ao)),ay(s,h),Jt=!0;else if(m!==4&&(m===27&&(ay(s,h),h=null,Tl(s.type)&&(c=s.stateNode,a=null)),s=s.child,s!==null))for(kS(s,a,c,h),s=s.sibling;s!==null;)kS(s,a,c,h),s=s.sibling}function ly(s,a,c,h){var m=s.tag;if(m===5||m===6)m=s.stateNode,a?c.insertBefore(m,a):c.appendChild(m),ay(s,h),Jt=!0;else if(m!==4&&(m===27&&(ay(s,h),h=null,Tl(s.type)&&(c=s.stateNode)),s=s.child,s!==null))for(ly(s,a,c,h),s=s.sibling;s!==null;)ly(s,a,c,h),s=s.sibling}function zA(s){var a=s.stateNode,c=s.memoizedProps;try{for(var h=s.type,m=a.attributes;m.length;)a.removeAttributeNode(m[0]);Ki(a,h,c),a[jn]=s,a[Zn]=c}catch(_){cn(s,s.return,_)}}var cy=!1,es=null;function DA(s){(s.tag===30||(s.subtreeFlags&33554432)!==0)&&(cy=!0)}var Mo=null;function LA(){var s=Mo;return Mo=null,s}var Ar=0;function pd(s,a,c,h,m){return Ar=0,UA(s.child,a,c,h,m)}function UA(s,a,c,h,m){for(var _=!1;s!==null;){if(s.tag===5){var E=s.stateNode;if(h!==null){var R=ak(E);h.push(R),R.view&&(_=!0)}else _||ak(E).view&&(_=!0);cy=!0,Lj(E,Ar===0?a:a+"_"+Ar,c),Ar++}else(s.tag!==22||s.memoizedState===null)&&(s.tag===30&&m||UA(s.child,a,c,h,m)&&(_=!0));s=s.sibling}return _}function Io(s,a){for(;s!==null;)s.tag===5?Uj(s.stateNode,s.memoizedProps):(s.tag!==22||s.memoizedState===null)&&(s.tag===30&&a||Io(s.child,a)),s=s.sibling}function uy(s){if((s.subtreeFlags&18874368)!==0)for(s=s.child;s!==null;){if((s.tag!==22||s.memoizedState===null)&&(uy(s),s.tag===30&&(s.flags&18874368)!==0&&s.stateNode.paired)){var a=s.memoizedProps;if(a.name==null||a.name==="auto")throw Error(i(544));var c=a.name;a=pa(a.default,a.share),a!=="none"&&(pd(s,c,a,null,!1)||Io(s.child,!1))}s=s.sibling}}function ES(s,a){if(s.tag===30){var c=s.stateNode,h=s.memoizedProps,m=fa(h,c),_=pa(h.default,c.paired?h.share:h.enter);_!=="none"?pd(s,m,_,null,!1)?(uy(s),c.paired||a||xd(s,h.onEnter)):Io(s.child,!1):uy(s)}else if((s.subtreeFlags&33554432)!==0)for(s=s.child;s!==null;)ES(s,a),s=s.sibling;else uy(s)}function TS(s){if(es!==null&&es.size!==0){var a=es;if((s.subtreeFlags&18874368)!==0)for(s=s.child;s!==null;){if(s.tag!==22||s.memoizedState===null){if(s.tag===30&&(s.flags&18874368)!==0){var c=s.memoizedProps,h=c.name;if(h!=null&&h!=="auto"){var m=a.get(h);if(m!==void 0){var _=pa(c.default,c.share);if(_!=="none"&&(pd(s,h,_,null,!1)?(_=s.stateNode,m.paired=_,_.paired=m,xd(s,c.onShare)):Io(s.child,!1)),a.delete(h),a.size===0)break}}}TS(s)}s=s.sibling}}}function CS(s){if(s.tag===30){var a=s.memoizedProps,c=fa(a,s.stateNode),h=es!==null?es.get(c):void 0,m=pa(a.default,h!==void 0?a.share:a.exit);m!=="none"&&(pd(s,c,m,null,!1)?h!==void 0?(m=s.stateNode,h.paired=m,m.paired=h,es.delete(c),xd(s,a.onShare)):xd(s,a.onExit):Io(s.child,!1)),es!==null&&TS(s)}else if((s.subtreeFlags&33554432)!==0)for(s=s.child;s!==null;)CS(s),s=s.sibling;else es!==null&&TS(s)}function FA(s){for(s=s.child;s!==null;){if(s.tag===30){var a=s.memoizedProps,c=fa(a,s.stateNode);a=pa(a.default,a.update),s.flags&=-5,a!=="none"&&pd(s,c,a,s.memoizedState=[],!1)}else(s.subtreeFlags&33554432)!==0&&FA(s);s=s.sibling}}function OS(s){if((s.subtreeFlags&18874368)!==0)for(s=s.child;s!==null;){if(s.tag!==22||s.memoizedState===null){if(s.tag===30&&(s.flags&18874368)!==0){var a=s.stateNode;a.paired!==null&&(a.paired=null,Io(s.child,!1))}OS(s)}s=s.sibling}}function dy(s){if(s.tag===30)s.stateNode.paired=null,Io(s.child,!1),OS(s);else if((s.subtreeFlags&33554432)!==0)for(s=s.child;s!==null;)dy(s),s=s.sibling;else OS(s)}function HA(s){for(s=s.child;s!==null;)s.tag===30?Io(s.child,!1):(s.subtreeFlags&33554432)!==0&&HA(s),s=s.sibling}function RS(s,a,c,h,m,_,E){for(var R=!1;a!==null;){if(a.tag===5){var I=a.stateNode;if(_!==null&&Ar<_.length){var q=_[Ar],se=ak(I);(q.view||se.view)&&(R=!0);var pe;if(pe=(s.flags&4)===0)if(se.clip)pe=!0;else{pe=q.rect;var K=se.rect;pe=pe.y!==K.y||pe.x!==K.x||pe.height!==K.height||pe.width!==K.width}pe&&(s.flags|=4),se.abs?se=!q.abs:(q=q.rect,se=se.rect,se=q.height!==se.height||q.width!==se.width),se&&(s.flags|=32)}else s.flags|=32;(s.flags&4)!==0&&Lj(I,Ar===0?c:c+"_"+Ar,m),R&&(s.flags&4)!==0||(Mo===null&&(Mo=[]),Mo.push(I,Ar===0?h:h+"_"+Ar,a.memoizedProps)),Ar++}else(a.tag!==22||a.memoizedState===null)&&(a.tag===30&&E?s.flags|=a.flags&32:RS(s,a.child,c,h,m,_,E)&&(R=!0));a=a.sibling}return R}function KA(s,a){for(s=s.child;s!==null;){if(s.tag===30){var c=s.memoizedProps,h=s.stateNode,m=fa(c,h),_=pa(c.default,c.update),E;E=s.memoizedState,s.memoizedState=null,h=s;var R=s.child;Ar=0,m=RS(h,R,m,m,_,E,!1),(s.flags&4)!==0&&m&&xd(s,c.onUpdate)}else(s.subtreeFlags&33554432)!==0&&KA(s);s=s.sibling}}var Oi=!1,rn=!1,zo=!1,$S=!1,ZA=typeof WeakSet=="function"?WeakSet:Set,Ri=null,Do=!1,Bf=!1,hy=!1,AS=!1;function NK(s,a,c){if(s=s.containerInfo,nk=jd,s=BR(s),vx(s)){if("selectionStart"in s)var h={start:s.selectionStart,end:s.selectionEnd};else e:{h=(h=s.ownerDocument)&&h.defaultView||window;var m=h.getSelection&&h.getSelection();if(m&&m.rangeCount!==0){h=m.anchorNode;var _=m.anchorOffset,E=m.focusNode;m=m.focusOffset;try{h.nodeType,E.nodeType}catch{h=null;break e}var R=0,I=-1,q=-1,se=0,pe=0,K=s,te=null;t:for(;;){for(var De;K!==h||_!==0&&K.nodeType!==3||(I=R+_),K!==E||m!==0&&K.nodeType!==3||(q=R+m),K.nodeType===3&&(R+=K.nodeValue.length),(De=K.firstChild)!==null;)te=K,K=De;for(;;){if(K===s)break t;if(te===h&&++se===_&&(I=R),te===E&&++pe===m&&(q=R),(De=K.nextSibling)!==null)break;K=te,te=K.parentNode}K=De}h=I===-1||q===-1?null:{start:I,end:q}}else h=null}h=h||{start:0,end:0}}else h=null;for(ik={focusedElem:s,selectionRange:h},jd=!1,c=(c&335544064)===c,Ri=a,a=c?9270:1024;Ri!==null;){if(s=Ri,c&&(h=s.deletions,h!==null))for(_=0;_<h.length;_++)c&&CS(h[_]);if(s.alternate===null&&(s.flags&2)!==0)c&&DA(s),fy(c);else{if(s.tag===22){if(h=s.alternate,s.memoizedState!==null){h!==null&&h.memoizedState===null&&c&&CS(h),fy(c);continue}else if(h!==null&&h.memoizedState!==null){c&&DA(s),fy(c);continue}}h=s.child,(s.subtreeFlags&a)!==0&&h!==null?(h.return=s,Ri=h):(c&&FA(s),fy(c))}}es=null}function fy(s){for(;Ri!==null;){var a=Ri,c=s,h=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 15:break;case 1:if((m&1024)!==0&&h!==null){c=void 0,m=h.memoizedProps,h=h.memoizedState;var _=a.stateNode;try{var E=Nc(a.type,m);c=_.getSnapshotBeforeUpdate(E,h),_.__reactInternalSnapshotBeforeUpdate=c}catch(R){cn(a,a.return,R)}}break;case 3:if((m&1024)!==0){if(h=a.stateNode.containerInfo,c=h.nodeType,c===9)uk(h);else if(c===1)switch(h.nodeName){case"HEAD":case"HTML":case"BODY":uk(h);break;default:h.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:c&&h!==null&&(c=fa(h.memoizedProps,h.stateNode),m=a.memoizedProps,m=pa(m.default,m.update),m!=="none"&&pd(h,c,m,h.memoizedState=[],!0));break;default:if((m&1024)!==0)throw Error(i(163))}if(h=a.sibling,h!==null){h.return=a.return,Ri=h;break}Ri=a.return}}function WA(s,a,c){var h=c.flags;switch(c.tag){case 0:case 11:case 15:Lo(s,c),h&4&&qf(5,c);break;case 1:if(Lo(s,c),h&4)if(s=c.stateNode,a===null)try{s.componentDidMount()}catch(E){cn(c,c.return,E)}else{var m=Nc(c.type,a.memoizedProps);a=a.memoizedState;try{s.componentDidUpdate(m,a,s.__reactInternalSnapshotBeforeUpdate)}catch(E){cn(c,c.return,E)}}h&64&&PA(c),h&512&&No(c,c.return);break;case 3:if(Lo(s,c),h&64&&(s=c.updateQueue,s!==null)){if(a=null,c.child!==null)switch(c.child.tag){case 27:case 5:a=c.child.stateNode;break;case 1:a=c.child.stateNode}try{x$(s,a)}catch(E){cn(c,c.return,E)}}break;case 27:a===null&&h&4&&zA(c);case 26:case 5:Lo(s,c),a===null&&h&4&&wS(c),h&512&&No(c,c.return);break;case 12:Lo(s,c);break;case 31:Lo(s,c),h&4&&GA(s,c);break;case 13:Lo(s,c),h&4&&JA(s,c),h&64&&(s=c.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(c=qK.bind(null,c),CZ(s,c))));break;case 22:if(h=c.memoizedState!==null||Oi,!h){var _=a!==null&&a.memoizedState!==null||rn;a=Oi,m=rn,Oi=h,(rn=_)&&!m?(h=2,(c.subtreeFlags&8772)!==0&&(h|=1),eo(s,c,h)):Lo(s,c),Oi=a,rn=m}break;case 30:Lo(s,c),h&512&&No(c,c.return);break;case 7:h&512&&No(c,c.return);default:Lo(s,c)}}function jS(s,a){for(s=s.child;s!==null;)qA(s,a),s=s.sibling}function qA(s,a){switch(s.tag){case 5:case 26:try{var c=s.stateNode;if(a){var h=c.style;typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none"}else{var m=s.stateNode,_=s.memoizedProps.style,E=_!=null&&_.hasOwnProperty("display")?_.display:null;m.style.display=E==null||typeof E=="boolean"?"":(""+E).trim()}}catch(I){cn(s,s.return,I)}PS(s,a);break;case 6:try{s.stateNode.nodeValue=a?"":s.memoizedProps,Jt=!0}catch(I){cn(s,s.return,I)}break;case 18:try{var R=s.stateNode;a?Dj(R,!0):Dj(s.stateNode,!1)}catch(I){cn(s,s.return,I)}break;case 22:case 23:s.memoizedState===null&&jS(s,a);break;default:jS(s,a)}}function PS(s,a){if(s.subtreeFlags&67108864)for(s=s.child;s!==null;){e:{var c=s,h=a;switch(c.tag){case 4:qA(c,h);break e;case 22:c.memoizedState===null&&PS(c,h);break e;default:PS(c,h)}}s=s.sibling}}function VA(s){var a=s.alternate;a!==null&&(s.alternate=null,VA(a)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(a=s.stateNode,a!==null&&ci(a)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var Pn=null,jr=!1;function Ys(s,a,c){for(c=c.child;c!==null;)BA(s,a,c),c=c.sibling}function BA(s,a,c){if(ti&&typeof ti.onCommitFiberUnmount=="function")try{ti.onCommitFiberUnmount(fr,c)}catch{}switch(c.tag){case 26:rn||Hi(c,a),Ys(s,a,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&!rn&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:rn||Hi(c,a),Vf(c);var h=Pn,m=jr;Tl(c.type)&&(Pn=c.stateNode,jr=!1),Ys(s,a,c),Yj(c.stateNode,c.type,c.memoizedProps),Pn=h,jr=m;break;case 5:rn||Hi(c,a),Vf(c);case 6:if(c.tag===6&&Vf(c),h=Pn,m=jr,Pn=null,Ys(s,a,c),Pn=h,jr=m,Pn!==null)if(jr)try{(Pn.nodeType===9?Pn.body:Pn.nodeName==="HTML"?Pn.ownerDocument.body:Pn).removeChild(c.stateNode),Jt=!0}catch(_){cn(c,a,_)}else try{Pn.removeChild(c.stateNode),Jt=!0}catch(_){cn(c,a,_)}break;case 18:Pn!==null&&(jr?(s=Pn,zj(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,c.stateNode),Pd(s)):zj(Pn,c.stateNode));break;case 4:h=Pn,m=jr,Pn=c.stateNode.containerInfo,jr=!0,Ys(s,a,c),Pn=h,jr=m;break;case 0:case 11:case 14:case 15:_l(2,c,a),rn||_l(4,c,a),Ys(s,a,c);break;case 1:rn||(Hi(c,a),h=c.stateNode,typeof h.componentWillUnmount=="function"&&NA(c,a,h)),Ys(s,a,c);break;case 21:Ys(s,a,c);break;case 22:rn=(h=rn)||c.memoizedState!==null,Ys(s,a,c),rn=h;break;case 30:Hi(c,a),Ys(s,a,c);break;case 7:rn||Hi(c,a),Ys(s,a,c);break;default:Ys(s,a,c)}}function GA(s,a){if(a.memoizedState===null&&(s=a.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{Pd(s)}catch(c){cn(a,a.return,c)}}}function JA(s,a){if(a.memoizedState===null&&(s=a.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{Pd(s)}catch(c){cn(a,a.return,c)}}function MK(s){switch(s.tag){case 31:case 13:case 19:var a=s.stateNode;return a===null&&(a=s.stateNode=new ZA),a;case 22:return s=s.stateNode,a=s._retryCache,a===null&&(a=s._retryCache=new ZA),a;default:throw Error(i(435,s.tag))}}function py(s,a){var c=MK(s);a.forEach(function(h){if(!c.has(h)){c.add(h);var m=VK.bind(null,s,h);h.then(m,m)}})}function mr(s,a,c){var h=a.deletions;if(h!==null)for(var m=0;m<h.length;m++){var _=h[m],E=s,R=a,I=R;e:for(;I!==null;){switch(I.tag){case 27:if(Tl(I.type)){Pn=I.stateNode,jr=!1;break e}break;case 5:Pn=I.stateNode,jr=!1;break e;case 3:case 4:Pn=I.stateNode.containerInfo,jr=!0;break e}I=I.return}if(Pn===null)throw Error(i(160));BA(E,R,_),Pn=null,jr=!1,E=_.alternate,E!==null&&(E.return=null),_.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)XA(a,s,c),a=a.sibling}var Qs=null;function XA(s,a,c){var h=s.alternate,m=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(m&4&&(h=s.updateQueue,h=h!==null?h.events:null,h!==null))for(var _=0;_<h.length;_++){var E=h[_];E.ref.impl=E.nextImpl}mr(a,s,c),vr(s),m&4&&(_l(3,s,s.return),qf(3,s),_l(5,s,s.return));break;case 1:mr(a,s,c),vr(s),m&512&&(rn||h===null||Hi(h,h.return)),m&64&&Oi&&(s=s.updateQueue,s!==null&&(a=s.callbacks,a!==null&&(c=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=c===null?a:c.concat(a))));break;case 26:if(_=Qs,mr(a,s,c),vr(s),m&512&&(rn||h===null||Hi(h,h.return)),m&4)if(m=h!==null?h.memoizedState:null,c=s.memoizedState,h===null)if(c===null)if(s.stateNode===null)if(Oi)s.stateNode=Nj(s.type,s.memoizedProps,a.containerInfo,s);else{e:{a=s.type,c=s.memoizedProps,m=_.ownerDocument||_;t:switch(a){case"title":h=m.getElementsByTagName("title")[0],(!h||h[Oo]||h[jn]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=m.createElement(a),m.head.insertBefore(h,m.querySelector("head > title"))),Ki(h,a,c),h[jn]=s,_t(h),a=h;break e;case"link":if(_=rP("link","href",m).get(a+(c.href||""))){for(E=0;E<_.length;E++)if(h=_[E],h.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&h.getAttribute("rel")===(c.rel==null?null:c.rel)&&h.getAttribute("title")===(c.title==null?null:c.title)&&h.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){_.splice(E,1);break t}}h=m.createElement(a),Ki(h,a,c),m.head.appendChild(h);break;case"meta":if(_=rP("meta","content",m).get(a+(c.content||""))){for(E=0;E<_.length;E++)if(h=_[E],h.getAttribute("content")===(c.content==null?null:""+c.content)&&h.getAttribute("name")===(c.name==null?null:c.name)&&h.getAttribute("property")===(c.property==null?null:c.property)&&h.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&h.getAttribute("charset")===(c.charSet==null?null:c.charSet)){_.splice(E,1);break t}}h=m.createElement(a),Ki(h,a,c),m.head.appendChild(h);break;default:throw Error(i(468,a))}h[jn]=s,_t(h),a=h}s.stateNode=a}else Oi||vk(_,s.type,s.stateNode);else s.stateNode=iP(_,c,s.memoizedProps);else m!==c?(m===null?(a=h.stateNode,a===null||rn||a.parentNode.removeChild(a)):m.count--,c===null?Oi||vk(_,s.type,s.stateNode):iP(_,c,s.memoizedProps)):c===null&&s.stateNode!==null&&xS(s,s.memoizedProps,h.memoizedProps);break;case 27:mr(a,s,c),vr(s),m&512&&(rn||h===null||Hi(h,h.return)),h!==null&&m&4&&xS(s,s.memoizedProps,h.memoizedProps);break;case 5:if(_=zo,zo=!1,mr(a,s,c),zo=_,vr(s),m&512&&(rn||h===null||Hi(h,h.return)),s.flags&32){a=s.stateNode;try{Ju(a,""),Jt=!0}catch(se){cn(s,s.return,se)}}m&4&&s.stateNode!=null&&(a=s.memoizedProps,xS(s,a,h!==null?h.memoizedProps:a)),m&1024&&($S=!0);break;case 6:if(mr(a,s,c),vr(s),m&4){if(s.stateNode===null)throw Error(i(162));a=s.memoizedProps,c=s.stateNode;try{c.nodeValue=a,Jt=!0}catch(se){cn(s,s.return,se)}}break;case 3:if(Jt=!1,Ry=null,_=Qs,Qs=ip(a.containerInfo),mr(a,s,c),Qs=_,vr(s),m&4&&h!==null&&h.memoizedState.isDehydrated)try{Pd(a.containerInfo)}catch(se){cn(s,s.return,se)}$S&&($S=!1,YA(s)),Jt=!1;break;case 4:m=zo,zo=Oi,h=yR(),_=Qs,Qs=ip(s.stateNode.containerInfo),mr(a,s,c),vr(s),Qs=_,Jt&&Bf&&(hy=!0),Jt=h,zo=m;break;case 12:mr(a,s,c),vr(s);break;case 31:mr(a,s,c),vr(s),m&4&&(a=s.updateQueue,a!==null&&(s.updateQueue=null,py(s,a)));break;case 13:mr(a,s,c),vr(s),s.child.flags&8192&&s.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(vy=ei()),m&4&&(a=s.updateQueue,a!==null&&(s.updateQueue=null,py(s,a)));break;case 22:_=s.memoizedState!==null,E=h!==null&&h.memoizedState!==null;var R=Oi,I=rn,q=zo;Oi=R||_,zo=q||_,rn=I||E,mr(a,s,c),rn=I,zo=q,Oi=R,vr(s),m&8192&&(a=s.stateNode,a._visibility=_?a._visibility&-2:a._visibility|1,!_||h===null||E||Oi||rn||(a=E||rn,c=Oi,h=rn,Oi=_||Oi,rn=a,bl(s,2),Oi=c,rn=h),!_&&zo||jS(s,_)),m&4&&(a=s.updateQueue,a!==null&&(c=a.retryQueue,c!==null&&(a.retryQueue=null,py(s,c))));break;case 19:mr(a,s,c),vr(s),m&4&&(a=s.updateQueue,a!==null&&(s.updateQueue=null,py(s,a)));break;case 30:m&512&&(rn||h===null||Hi(h,h.return)),m=yR(),_=Bf,E=(c&335544064)===c,R=s.memoizedProps,Bf=E&&pa(R.default,R.update)!=="none",mr(a,s,c),vr(s),E&&h!==null&&Jt&&(s.flags|=4),Bf=_,Jt=m;break;case 21:break;case 7:m&512&&(rn||h===null||Hi(h,h.return)),h&&h.stateNode!==null&&(h.stateNode._fragmentFiber=s);default:mr(a,s,c),vr(s)}}function vr(s){var a=s.flags;if(a&2){try{for(var c,h=s.return;h!==null;){if(IA(h)){c=h;break}h=h.return}h=null;for(var m=s.return;m!==null;){if(bS(m)){var _=m.stateNode;h===null?h=[_]:h.push(_)}if(_S(m))break;m=m.return}var E=h;if(c==null)throw Error(i(160));switch(c.tag){case 27:var R=c.stateNode,I=SS(s);ly(s,I,R,E);break;case 5:var q=c.stateNode;c.flags&32&&(Ju(q,""),c.flags&=-33);var se=SS(s);ly(s,se,q,E);break;case 3:case 4:var pe=c.stateNode.containerInfo,K=SS(s);kS(s,K,pe,E);break;default:throw Error(i(161))}}catch(te){cn(s,s.return,te)}s.flags&=-3}a&4096&&(s.flags&=-4097)}function YA(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var a=s;YA(a),a.tag===5&&a.flags&1024&&(a=a.stateNode,jd=!0,a.reset(),jd=!1),s=s.sibling}}function gd(s,a){if(a.subtreeFlags&9270)for(a=a.child;a!==null;)QA(a,s),a=a.sibling;else KA(a)}function QA(s,a){var c=s.alternate;if(c===null)ES(s,!1);else switch(s.tag){case 3:if(AS=Do=!1,LA(),gd(a,s),!Do&&!hy){if(s=Mo,s!==null)for(var h=0;h<s.length;h+=3){c=s[h];var m=s[h+1];Uj(c,s[h+2]),c=c.ownerDocument.documentElement,c!==null&&c.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+m+")"})}s=a.containerInfo,s=s.nodeType===9?s.documentElement:s.ownerDocument.documentElement,s!==null&&s.style.viewTransitionName===""&&(s.style.viewTransitionName="none",s.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),s.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),AS=!0}Mo=null;break;case 5:gd(a,s);break;case 4:h=Do,Do=!1,gd(a,s),Do&&(hy=!0),Do=h;break;case 22:s.memoizedState===null&&(c.memoizedState!==null?ES(s,!1):gd(a,s));break;case 30:h=Do,m=LA(),Do=!1,gd(a,s),Do&&(s.flags|=4);var _=s.memoizedProps,E=s.stateNode;a=fa(_,E),E=fa(c.memoizedProps,E);var R=pa(_.default,_.update);R==="none"?a=!1:(_=c.memoizedState,c.memoizedState=null,c=s.child,Ar=0,a=RS(s,c,a,E,R,_,!0),Ar!==(_===null?0:_.length)&&(s.flags|=32)),(s.flags&4)!==0&&a?(xd(s,s.memoizedProps.onUpdate),Mo=m):m!==null&&(m.push.apply(m,Mo),Mo=m),Do=(s.flags&32)!==0?!0:h;break;default:gd(a,s)}}function Lo(s,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)WA(s,a.alternate,a),a=a.sibling}function bl(s,a){for(s=s.child;s!==null;){var c=s,h=a;switch(c.tag){case 0:case 11:case 14:case 15:_l(4,c,c.return),bl(c,h);break;case 1:Hi(c,c.return);var m=c.stateNode;typeof m.componentWillUnmount=="function"&&NA(c,c.return,m),bl(c,h);break;case 27:(h&2)!==0&&Yj(c.stateNode,c.type,c.memoizedProps);case 5:Hi(c,c.return),c.tag!==5&&c.tag!==27||Vf(c),bl(c,h);break;case 6:Vf(c);break;case 26:Hi(c,c.return),m=c.stateNode,c.memoizedState!==null||m===null||rn||m.parentNode.removeChild(m),bl(c,h);break;case 22:c.memoizedState===null&&bl(c,h);break;case 30:Hi(c,c.return),bl(c,h);break;case 7:Hi(c,c.return);default:bl(c,h)}s=s.sibling}}function eo(s,a,c){for(c=(a.subtreeFlags&8772)!==0?c:c&-2,a=a.child;a!==null;){var h=a.alternate,m=s,_=a,E=_.flags,R=(c&1)!==0;switch(_.tag){case 0:case 11:case 15:eo(m,_,c),qf(4,_);break;case 1:if(eo(m,_,c),h=_,m=h.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(se){cn(h,h.return,se)}if(h=_,m=h.updateQueue,m!==null){var I=h.stateNode;try{var q=m.shared.hiddenCallbacks;if(q!==null)for(m.shared.hiddenCallbacks=null,m=0;m<q.length;m++)w$(q[m],I)}catch(se){cn(h,h.return,se)}}R&&E&64&&PA(_),No(_,_.return);break;case 27:(c&2)!==0&&zA(_);case 5:_.tag!==5&&_.tag!==27||MA(_),eo(m,_,c),R&&h===null&&E&4&&wS(_),No(_,_.return);break;case 6:MA(_);break;case 26:I=_.stateNode,_.memoizedState!==null||I===null||Oi||vk(ip(I.ownerDocument),_.type,I),eo(m,_,c),R&&h===null&&E&4&&wS(_),No(_,_.return);break;case 12:eo(m,_,c);break;case 31:eo(m,_,c),R&&E&4&&GA(m,_);break;case 13:eo(m,_,c),R&&E&4&&JA(m,_);break;case 22:_.memoizedState===null&&eo(m,_,c),No(_,_.return);break;case 30:eo(m,_,c),No(_,_.return);break;case 7:No(_,_.return);default:eo(m,_,c)}a=a.sibling}}function NS(s,a){var c=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),s=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(s=a.memoizedState.cachePool.pool),s!==c&&(s!=null&&s.refCount++,c!=null&&Pf(c))}function MS(s,a){s=null,a.alternate!==null&&(s=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==s&&(a.refCount++,s!=null&&Pf(s))}function Ts(s,a,c,h){var m=(c&335544064)===c;if(a.subtreeFlags&(m?10262:10256))for(a=a.child;a!==null;)ej(s,a,c,h),a=a.sibling;else m&&HA(a)}function ej(s,a,c,h){var m=(c&335544064)===c;m&&a.alternate===null&&a.return!==null&&a.return.alternate!==null&&dy(a);var _=a.flags;switch(a.tag){case 0:case 11:case 15:Ts(s,a,c,h),_&2048&&qf(9,a);break;case 1:Ts(s,a,c,h);break;case 3:Ts(s,a,c,h),m&&AS&&(s=s.containerInfo,s=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,s.style.viewTransitionName==="root"&&(s.style.viewTransitionName=""),s=s.ownerDocument.documentElement,s!==null&&s.style.viewTransitionName==="none"&&(s.style.viewTransitionName="")),_&2048&&(_=null,a.alternate!==null&&(_=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==_&&(a.refCount++,_!=null&&Pf(_)));break;case 12:if(_&2048){Ts(s,a,c,h),_=a.stateNode;try{var E=a.memoizedProps,R=E.id,I=E.onPostCommit;typeof I=="function"&&I(R,a.alternate===null?"mount":"update",_.passiveEffectDuration,-0)}catch(q){cn(a,a.return,q)}}else Ts(s,a,c,h);break;case 31:Ts(s,a,c,h);break;case 13:Ts(s,a,c,h);break;case 23:break;case 22:E=a.stateNode,R=a.alternate,a.memoizedState!==null?(m&&R!==null&&R.memoizedState===null&&dy(R),E._visibility&2?Ts(s,a,c,h):Gf(s,a)):(m&&R!==null&&R.memoizedState!==null&&dy(a),E._visibility&2?Ts(s,a,c,h):(E._visibility|=2,md(s,a,c,h,(a.subtreeFlags&10256)!==0||!1))),_&2048&&NS(R,a);break;case 24:Ts(s,a,c,h),_&2048&&MS(a.alternate,a);break;case 30:m&&(_=a.alternate,_!==null&&(Io(_.child,!0),Io(a.child,!0))),Ts(s,a,c,h);break;default:Ts(s,a,c,h)}}function md(s,a,c,h,m){for(m=m&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var _=s,E=a,R=c,I=h,q=E.flags;switch(E.tag){case 0:case 11:case 15:md(_,E,R,I,m),qf(8,E);break;case 23:break;case 22:var se=E.stateNode;E.memoizedState!==null?se._visibility&2?md(_,E,R,I,m):Gf(_,E):(se._visibility|=2,md(_,E,R,I,m)),m&&q&2048&&NS(E.alternate,E);break;case 24:md(_,E,R,I,m),m&&q&2048&&MS(E.alternate,E);break;default:md(_,E,R,I,m)}a=a.sibling}}function Gf(s,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var c=s,h=a,m=h.flags;switch(h.tag){case 22:Gf(c,h),m&2048&&NS(h.alternate,h);break;case 24:Gf(c,h),m&2048&&MS(h.alternate,h);break;default:Gf(c,h)}a=a.sibling}}var Mc=8192;function Ic(s,a,c){if(s.subtreeFlags&Mc)for(s=s.child;s!==null;)tj(s,a,c),s=s.sibling}function tj(s,a,c){switch(s.tag){case 26:Ic(s,a,c),s.flags&Mc&&(s.memoizedState!==null?FZ(c,Qs,s.memoizedState,s.memoizedProps):(s=s.stateNode,(a&335544128)===a&&lP(c,s)));break;case 5:Ic(s,a,c),s.flags&Mc&&(s=s.stateNode,(a&335544128)===a&&lP(c,s));break;case 3:case 4:var h=Qs;Qs=ip(s.stateNode.containerInfo),Ic(s,a,c),Qs=h;break;case 22:s.memoizedState===null&&(h=s.alternate,h!==null&&h.memoizedState!==null?(h=Mc,Mc=16777216,Ic(s,a,c),Mc=h):Ic(s,a,c));break;case 30:if((s.flags&Mc)!==0&&(h=s.memoizedProps.name,h!=null&&h!=="auto")){var m=s.stateNode;m.paired=null,es===null&&(es=new Map),es.set(h,m)}Ic(s,a,c);break;default:Ic(s,a,c)}}function nj(s){var a=s.alternate;if(a!==null&&(s=a.child,s!==null)){a.child=null;do a=s.sibling,s.sibling=null,s=a;while(s!==null)}}function Jf(s){var a=s.deletions;if((s.flags&16)!==0){if(a!==null)for(var c=0;c<a.length;c++){var h=a[c];Ri=h,rj(h,s)}nj(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)ij(s),s=s.sibling}function ij(s){switch(s.tag){case 0:case 11:case 15:Jf(s),s.flags&2048&&_l(9,s,s.return);break;case 3:Jf(s);break;case 12:Jf(s);break;case 22:var a=s.stateNode;s.memoizedState!==null&&a._visibility&2&&(s.return===null||s.return.tag!==13)?(a._visibility&=-3,gy(s)):Jf(s);break;default:Jf(s)}}function gy(s){var a=s.deletions;if((s.flags&16)!==0){if(a!==null)for(var c=0;c<a.length;c++){var h=a[c];Ri=h,rj(h,s)}nj(s)}for(s=s.child;s!==null;){switch(a=s,a.tag){case 0:case 11:case 15:_l(8,a,a.return),gy(a);break;case 22:c=a.stateNode,c._visibility&2&&(c._visibility&=-3,gy(a));break;default:gy(a)}s=s.sibling}}function rj(s,a){for(;Ri!==null;){var c=Ri;switch(c.tag){case 0:case 11:case 15:_l(8,c,a);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var h=c.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:Pf(c.memoizedState.cache)}if(h=c.child,h!==null)h.return=c,Ri=h;else e:for(c=s;Ri!==null;){h=Ri;var m=h.sibling,_=h.return;if(VA(h),h===c){Ri=null;break e}if(m!==null){m.return=_,Ri=m;break e}Ri=_}}}var IK={getCacheForType:function(s){var a=Li(ii),c=a.data.get(s);return c===void 0&&(c=s(),a.data.set(s,c)),c},cacheSignal:function(){return Li(ii).controller.signal}},zK=typeof WeakMap=="function"?WeakMap:Map,Yt=0,mn=null,Rt=null,At=0,ln=0,ts=null,wl=!1,vd=!1,IS=!1,Sa=0,Jn=0,xl=0,zc=0,my=0,ns=0,yd=0,Xf=null,Pr=null,zS=!1,vy=0,sj=0,yy=1/0,_y=null,Sl=null,Wn=0,to=null,Dc=null,Uo=0,DS=0,LS=null,oj=null,_d=null,bd=null,wd=null,Yf=0,by=null;function is(){return(Yt&2)!==0&&At!==0?At&-At:Se.T!==null?GS():zi()}function aj(){if(ns===0)if((At&536870912)===0||Tt){var s=ve;ve<<=1,(ve&3932160)===0&&(ve=262144),ns=s}else ns=536870912;return s=Ui.current,s!==null&&(s.flags|=32),ns}function xd(s,a){if(a!=null){var c=s.stateNode,h=c.ref;h===null&&(h=c.ref=Fj(fa(s.memoizedProps,c))),bd===null&&(bd=[]),bd.push(a.bind(null,h))}}function Nr(s,a,c){(s===mn&&(ln===2||ln===9)||s.cancelPendingCommit!==null)&&(Sd(s,0),kl(s,At,ns,!1)),nt(s,c),((Yt&2)===0||s!==mn)&&(s===mn&&((Yt&2)===0&&(zc|=c),Jn===4&&kl(s,At,ns,!1)),Fo(s))}function lj(s,a,c){if((Yt&6)!==0)throw Error(i(327));var h=!c&&(a&127)===0&&(a&s.expiredLanes)===0||Be(s,a),m=h?UK(s,a):FS(s,a,!0),_=h;do{if(m===0){vd&&!h&&kl(s,a,0,!1);break}else{if(c=s.current.alternate,_&&!DK(c)){m=FS(s,a,!1),_=!1;continue}if(m===2){if(_=a,s.errorRecoveryDisabledLanes&_)var E=0;else E=s.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){a=E;e:{var R=s;m=Xf;var I=R.current.memoizedState.isDehydrated;if(I&&(Sd(R,E).flags|=256),E=FS(R,E,!1),E!==2&&E!==6){if(IS&&!I){R.errorRecoveryDisabledLanes|=_,zc|=_,m=4;break e}_=Pr,Pr=m,_!==null&&(Pr===null?Pr=_:Pr.push.apply(Pr,_))}m=E}if(_=!1,m!==2)continue}}if(m===1){Sd(s,0),kl(s,a,0,!0);break}e:{switch(h=s,_=m,_){case 0:case 1:throw Error(i(345));case 4:if((a&4194048)!==a&&(a&62914560)!==a)break;case 6:kl(h,a,ns,!wl);break e;case 2:Pr=null;break;case 3:case 5:break;default:throw Error(i(329))}if((a&62914560)===a&&(m=vy+300-ei(),10<m)){if(kl(h,a,ns,!wl),Ke(h,0,!0)!==0)break e;Uo=a,h.timeoutHandle=ok(cj.bind(null,h,c,Pr,_y,zS,a,ns,zc,yd,wl,_,"Throttled",-0,0),m);break e}cj(h,c,Pr,_y,zS,a,ns,zc,yd,wl,_,null,-0,0)}}break}while(!0);Fo(s)}function cj(s,a,c,h,m,_,E,R,I,q,se,pe,K,te){s.timeoutHandle=-1;var De=a.subtreeFlags,Ve=(_&335544064)===_;if(pe=null,(Ve||De&8192||(De&16785408)===16785408)&&(pe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ao},es=null,tj(a,_,pe),Ve&&(De=pe,Ve=s.containerInfo,Ve=(Ve.nodeType===9?Ve:Ve.ownerDocument).__reactViewTransition,Ve!=null&&(De.count++,De.waitingForViewTransition=!0,De=op.bind(De),Ve.finished.then(De,De))),De=(_&62914560)===_?vy-ei():(_&4194048)===_?sj-ei():0,De=HZ(pe,De),De!==null)){Uo=_,s.cancelPendingCommit=De(vj.bind(null,s,a,_,c,h,m,E,R,I,q,se,pe,null,K,te)),kl(s,_,E,!q);return}vj(s,a,_,c,h,m,E,R,I,q,se,pe)}function DK(s){for(var a=s;;){var c=a.tag;if((c===0||c===11||c===15)&&a.flags&16384&&(c=a.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var h=0;h<c.length;h++){var m=c[h],_=m.getSnapshot;m=m.value;try{if(!Yr(_(),m))return!1}catch{return!1}}if(c=a.child,a.subtreeFlags&16384&&c!==null)c.return=a,a=c;else{if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function kl(s,a,c,h){a=Ze(s,a),a&=~my,a&=~zc,s.suspendedLanes|=a,s.pingedLanes&=~a,h&&(s.warmLanes|=a),h=s.expirationTimes;for(var m=a;0<m;){var _=31-ni(m),E=1<<_;h[_]=-1,m&=~E}c!==0&&nn(s,c,a)}function wy(){return(Yt&6)===0?(Qf(0),!1):!0}function US(){if(Rt!==null){if(ln===0)var s=Rt.return;else s=Rt,va=Ec=null,Bx(s),cd=null,If=0,s=Rt;for(;s!==null;)jA(s.alternate,s),s=s.return;Rt=null}}function Sd(s,a){var c=s.timeoutHandle;return c!==-1&&(s.timeoutHandle=-1,lZ(c)),c=s.cancelPendingCommit,c!==null&&(s.cancelPendingCommit=null,c()),Uo=0,US(),mn=s,Rt=c=ga(s.current,null),At=a,ln=0,ts=null,wl=!1,vd=Be(s,a),IS=!1,yd=ns=my=zc=xl=Jn=0,Pr=Xf=null,zS=!1,Sa=Ze(s,a),Rv(),c}function uj(s,a){bt=null,Se.H=ey,a===ld||a===Uv?(a=v$(),ln=3):a===Mx?(a=v$(),ln=4):ln=a===cS?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,ts=a,Rt===null&&(Jn=1,ty(s,xs(a,s.current)))}function dj(){var s=Ui.current;return s===null?!0:(At&4194048)===At?tr===null:(At&62914560)===At||(At&536870912)!==0?s===tr:!1}function hj(){var s=Se.H;return Se.H=ey,s===null?ey:s}function fj(){var s=Se.A;return Se.A=IK,s}function xy(){Jn=4,wl||(At&4194048)!==At&&Ui.current!==null||(vd=!0),(xl&134217727)===0&&(zc&134217727)===0||mn===null||kl(mn,At,ns,!1)}function FS(s,a,c){var h=Yt;Yt|=2;var m=hj(),_=fj();(mn!==s||At!==a)&&(_y=null,Sd(s,a)),a=!1;var E=Jn;e:do try{if(ln!==0&&Rt!==null){var R=Rt,I=ts;switch(ln){case 8:US(),E=6;break e;case 3:case 2:case 9:case 6:Ui.current===null&&(a=!0);var q=ln;if(ln=0,ts=null,kd(s,R,I,q),c&&vd){E=0;break e}break;default:q=ln,ln=0,ts=null,kd(s,R,I,q)}}LK(),E=Jn;break}catch(se){uj(s,se)}while(!0);return a&&s.shellSuspendCounter++,va=Ec=null,Yt=h,Se.H=m,Se.A=_,Rt===null&&(mn=null,At=0,Rv()),E}function LK(){for(;Rt!==null;)pj(Rt)}function UK(s,a){var c=Yt;Yt|=2;var h=hj(),m=fj();mn!==s||At!==a?(_y=null,yy=ei()+500,Sd(s,a)):vd=Be(s,a);e:do try{if(ln!==0&&Rt!==null){a=Rt;var _=ts;t:switch(ln){case 1:ln=0,ts=null,kd(s,a,_,1);break;case 2:case 9:if(g$(_)){ln=0,ts=null,gj(a);break}a=function(){ln!==2&&ln!==9||mn!==s||(ln=7),Fo(s)},_.then(a,a);break e;case 3:ln=7;break e;case 4:ln=5;break e;case 7:g$(_)?(ln=0,ts=null,gj(a)):(ln=0,ts=null,kd(s,a,_,7));break;case 5:var E=null;switch(Rt.tag){case 26:E=Rt.memoizedState;case 5:case 27:var R=Rt;if(E?oP(E):R.stateNode.complete){ln=0,ts=null;var I=R.sibling;if(I!==null)Rt=I;else{var q=R.return;q!==null?(Rt=q,Sy(q)):Rt=null}break t}}ln=0,ts=null,kd(s,a,_,5);break;case 6:ln=0,ts=null,kd(s,a,_,6);break;case 8:US(),Jn=6;break e;default:throw Error(i(462))}}FK();break}catch(se){uj(s,se)}while(!0);return va=Ec=null,Se.H=h,Se.A=m,Yt=c,Rt!==null?0:(mn=null,At=0,Rv(),Jn)}function FK(){for(;Rt!==null&&!el();)pj(Rt)}function pj(s){var a=$A(s.alternate,s,Sa);s.memoizedProps=s.pendingProps,a===null?Sy(s):Rt=a}function gj(s){var a=s,c=a.alternate;switch(a.tag){case 15:case 0:a=SA(c,a,a.pendingProps,a.type,void 0,At);break;case 11:a=SA(c,a,a.pendingProps,a.type.render,a.ref,At);break;case 5:Bx(a);var h=a;h===Ci&&(Tt?(Mv(h),h.tag===5&&h.stateNode!=null&&(wn=h.stateNode)):(Mv(h),Tt=!0));default:jA(c,a),a=Rt=r$(a,Sa),a=$A(c,a,Sa)}s.memoizedProps=s.pendingProps,a===null?Sy(s):Rt=a}function kd(s,a,c,h){va=Ec=null,Bx(a),cd=null,If=0;var m=a.return;try{if(OK(s,m,a,c,At)){Jn=1,ty(s,xs(c,s.current)),Rt=null;return}}catch(_){if(m!==null)throw Rt=m,_;Jn=1,ty(s,xs(c,s.current)),Rt=null;return}a.flags&32768?(Tt||h===1?s=!0:vd||(At&536870912)!==0?s=!1:(wl=s=!0,(h===2||h===9||h===3||h===6)&&(h=Ui.current,h!==null&&h.tag===13&&(h.flags|=16384))),mj(a,s)):Sy(a)}function Sy(s){var a=s;do{if((a.flags&32768)!==0){mj(a,wl);return}s=a.return;var c=jK(a.alternate,a,Sa);if(c!==null){Rt=c;return}if(a=a.sibling,a!==null){Rt=a;return}Rt=a=s}while(a!==null);Jn===0&&(Jn=5)}function mj(s,a){do{var c=PK(s.alternate,s);if(c!==null){c.flags&=32767,Rt=c;return}if(c=s.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!a&&(s=s.sibling,s!==null)){Rt=s;return}Rt=s=c}while(s!==null);Jn=6,Rt=null}function vj(s,a,c,h,m,_,E,R,I,q,se,pe){s.cancelPendingCommit=null;do ky();while(Wn!==0);if((Yt&6)!==0)throw Error(i(327));if(a!==null){if(a===s.current)throw Error(i(177));s===mn&&(Rt=mn=null,At=0),Dc=a,to=s,Uo=c,LS=m,oj=h,HK(s,a,c,E,R,I,pe)}}function HK(s,a,c,h,m,_,E){var R=a.lanes|a.childLanes;if(DS=R,R|=xx,Bt(s,c,R,h,m,_),bd=null,(c&335544064)===c?(wd=mK(s),h=10262):(wd=null,h=10256),(a.subtreeFlags&h)!==0||(a.flags&h)!==0?(s.callbackNode=null,s.callbackPriority=0,BK(_s,function(){return WS(),null})):(s.callbackNode=null,s.callbackPriority=0),cy=!1,h=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||h){h=Se.T,Se.T=null,m=oe.p,oe.p=2,_=Yt,Yt|=4;try{NK(s,a,c)}finally{Yt=_,oe.p=m,Se.T=h}}Wn=1,cy?_d=pZ(E,s.containerInfo,wd,HS,KS,ZK,ZS,WS,KK):(HS(),KS(),ZS())}function KK(s){if(Wn!==0){var a=to.onRecoverableError;a(s,{componentStack:null})}}function ZK(){Wn===3&&(Wn=0,QA(Dc,to),Wn=4)}function HS(){if(Wn===1){Wn=0;var s=to,a=Dc,c=Uo,h=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||h){h=Se.T,Se.T=null;var m=oe.p;oe.p=2;var _=Yt;Yt|=4;try{Bf=hy=!1,XA(a,s,c),c=ik;var E=BR(s.containerInfo),R=c.focusedElem,I=c.selectionRange;if(E!==R&&R&&R.ownerDocument&&VR(R.ownerDocument.documentElement,R)){if(I!==null&&vx(R)){var q=I.start,se=I.end;if(se===void 0&&(se=q),"selectionStart"in R)R.selectionStart=q,R.selectionEnd=Math.min(se,R.value.length);else{var pe=R.ownerDocument||document,K=pe&&pe.defaultView||window;if(K.getSelection){var te=K.getSelection(),De=R.textContent.length,Ve=Math.min(I.start,De),wt=I.end===void 0?Ve:Math.min(I.end,De);!te.extend&&Ve>wt&&(E=wt,wt=Ve,Ve=E);var W=qR(R,Ve),U=qR(R,wt);if(W&&U&&(te.rangeCount!==1||te.anchorNode!==W.node||te.anchorOffset!==W.offset||te.focusNode!==U.node||te.focusOffset!==U.offset)){var Q=pe.createRange();Q.setStart(W.node,W.offset),te.removeAllRanges(),Ve>wt?(te.addRange(Q),te.extend(U.node,U.offset)):(Q.setEnd(U.node,U.offset),te.addRange(Q))}}}}for(pe=[],te=R;te=te.parentNode;)te.nodeType===1&&pe.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<pe.length;R++){var fe=pe[R];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}jd=!!nk,ik=nk=null}finally{Yt=_,oe.p=m,Se.T=h}}s.current=a,Wn=2}}function KS(){if(Wn===2){Wn=0;var s=to,a=Dc,c=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||c){c=Se.T,Se.T=null;var h=oe.p;oe.p=2;var m=Yt;Yt|=4;try{WA(s,a.alternate,a)}finally{Yt=m,oe.p=h,Se.T=c}}Wn=3}}function ZS(){if(Wn===4||Wn===3){Wn=0;var s=_d;_d=null,Ii();var a=to,c=Dc,h=Uo,m=oj,_=(h&335544064)===h?10262:10256;if((c.subtreeFlags&_)!==0||(c.flags&_)!==0?Wn=5:(Wn=0,Dc=to=null,yj(a,a.pendingLanes)),_=a.pendingLanes,_===0&&(Sl=null),ki(h),c=c.stateNode,ti&&typeof ti.onCommitFiberRoot=="function")try{ti.onCommitFiberRoot(fr,c,void 0,(c.current.flags&128)===128)}catch{}if(m!==null){c=Se.T,_=oe.p,oe.p=2,Se.T=null;try{for(var E=a.onRecoverableError,R=0;R<m.length;R++){var I=m[R];E(I.value,{componentStack:I.stack})}}finally{Se.T=c,oe.p=_}}if(m=bd,E=wd,wd=null,m!==null&&(bd=null,E===null&&(E=[]),s!==null))for(I=0;I<m.length;I++)c=(0,m[I])(E),c!==void 0&&s.finished.finally(c);(Uo&3)!==0&&ky(),Fo(a),_=a.pendingLanes,(h&261930)!==0&&(_&42)!==0?a===by?Yf++:(Yf=0,by=a):(Yf=0,by=null),Qf(0)}}function yj(s,a){(s.pooledCacheLanes&=a)===0&&(a=s.pooledCache,a!=null&&(s.pooledCache=null,Pf(a)))}function ky(){return _d!==null&&(_d.skipTransition(),_d=null),HS(),KS(),ZS(),WS()}function WS(){if(Wn!==5)return!1;var s=to,a=DS;DS=0;var c=ki(Uo),h=Se.T,m=oe.p;try{oe.p=32>c?32:c,Se.T=null,c=LS,LS=null;var _=to,E=Uo;if(Wn=0,Dc=to=null,Uo=0,(Yt&6)!==0)throw Error(i(331));var R=Yt;if(Yt|=4,ij(_.current),ej(_,_.current,E,c),Yt=R,Qf(0,!1),ti&&typeof ti.onPostCommitFiberRoot=="function")try{ti.onPostCommitFiberRoot(fr,_)}catch{}return!0}finally{oe.p=m,Se.T=h,yj(s,a)}}function _j(s,a,c){a=xs(c,a),a=lS(s.stateNode,a,2),s=gl(s,a,2),s!==null&&(nt(s,2),Fo(s))}function cn(s,a,c){if(s.tag===3)_j(s,s,c);else for(;a!==null;){if(a.tag===3){_j(a,s,c);break}else if(a.tag===1){var h=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Sl===null||!Sl.has(h))){s=xs(c,s),c=gA(2),h=gl(a,c,2),h!==null&&(mA(c,h,a,s),nt(h,2),Fo(h));break}}a=a.return}}function qS(s,a,c){var h=s.pingCache;if(h===null){h=s.pingCache=new zK;var m=new Set;h.set(a,m)}else m=h.get(a),m===void 0&&(m=new Set,h.set(a,m));m.has(c)||(IS=!0,m.add(c),s=WK.bind(null,s,a,c),a.then(s,s))}function WK(s,a,c){var h=s.pingCache;h!==null&&h.delete(a),s.pingedLanes|=s.suspendedLanes&c,s.warmLanes&=~c,mn===s&&(At&c)===c&&((Jn===4||Jn===3&&(At&62914560)===At&&300>ei()-vy)&&(Yt&2)===0?Sd(s,0):my|=c,yd===At&&(yd=0)),Fo(s)}function bj(s,a){a===0&&(a=Xe()),s=xc(s,a),s!==null&&(nt(s,a),Fo(s))}function qK(s){var a=s.memoizedState,c=0;a!==null&&(c=a.retryLane),bj(s,c)}function VK(s,a){var c=0;switch(s.tag){case 31:case 13:var h=s.stateNode,m=s.memoizedState;m!==null&&(c=m.retryLane);break;case 19:h=s.stateNode;break;case 22:h=s.stateNode._retryCache;break;default:throw Error(i(314))}h!==null&&h.delete(a),bj(s,c)}function BK(s,a){return Mi(s,a)}var Ed=null,Td=null,VS=!1,Ey=!1,BS=!1,El=0;function Fo(s){s!==Td&&s.next===null&&(Td===null?Ed=Td=s:Td=Td.next=s),Ey=!0,VS||(VS=!0,JK())}function Qf(s,a){if(!BS&&Ey){BS=!0;do for(var c=!1,h=Ed;h!==null;){if(s!==0){var m=h.pendingLanes;if(m===0)var _=0;else{var E=h.suspendedLanes,R=h.pingedLanes;_=(1<<31-ni(42|s)+1)-1,_&=m&~(E&~R),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(c=!0,kj(h,_))}
vendor: 5,303 bytes, line 8
8else _=At,_=Ke(h,h===mn?_:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(_&3)===0||Be(h,_)||(c=!0,kj(h,_));h=h.next}while(c);BS=!1}}function GK(){wj()}function wj(){Ey=VS=!1;var s=0;El!==0&&aZ()&&(s=El);for(var a=ei(),c=null,h=Ed;h!==null;){var m=h.next,_=xj(h,a);_===0?(h.next=null,c===null?Ed=m:c.next=m,m===null&&(Td=c)):(c=h,(s!==0||(_&3)!==0)&&(Ey=!0)),h=m}Wn!==0&&Wn!==5||Qf(s),El!==0&&(El=0)}function xj(s,a){for(var c=s.suspendedLanes,h=s.pingedLanes,m=s.expirationTimes,_=s.pendingLanes&-62914561;0<_;){var E=31-ni(_),R=1<<E,I=m[E];I===-1?((R&c)===0||(R&h)!==0)&&(m[E]=rt(R,a)):I<=a&&(s.expiredLanes|=R),_&=~R}if(a=mn,c=At,c=Ke(s,s===a?c:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),h=s.callbackNode,c===0||s===a&&(ln===2||ln===9)||s.cancelPendingCommit!==null)return h!==null&&h!==null&&Gs(h),s.callbackNode=null,s.callbackPriority=0;if((c&3)===0||Be(s,c)){if(a=c&-c,a===s.callbackPriority)return a;switch(h!==null&&Gs(h),ki(c)){case 2:case 8:c=To;break;case 32:c=_s;break;case 268435456:c=Js;break;default:c=_s}return h=Sj.bind(null,s),c=Mi(c,h),s.callbackPriority=a,s.callbackNode=c,a}return h!==null&&h!==null&&Gs(h),s.callbackPriority=2,s.callbackNode=null,2}function Sj(s,a){if(Wn!==0&&Wn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var c=s.callbackNode;if(ky()&&s.callbackNode!==c)return null;var h=At;return h=Ke(s,s===mn?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),h===0?null:(lj(s,h,a),xj(s,ei()),s.callbackNode!=null&&s.callbackNode===c?Sj.bind(null,s):null)}function kj(s,a){if(ky())return null;lj(s,a,!0)}function JK(){cZ(function(){(Yt&6)!==0?Mi(Gr,GK):wj()})}function GS(){if(El===0){var s=Oc;s===0&&(s=ie,ie<<=1,(ie&261888)===0&&(ie=256)),El=s}return El}function Ej(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:wv(s)}function XK(s,a,c,h,m){if(a==="submit"&&c&&c.stateNode===m){var _=Ej((m[Zn]||null).action),E=h.submitter;E&&(a=(a=E[Zn]||null)?Ej(a.formAction):E.getAttribute("formAction"),a!==null&&(_=a,E=null));var R=new Ev("action","action",null,h,m);s.push({event:R,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(El!==0){var I=new FormData(m,E);iS(c,{pending:!0,data:I,method:m.method,action:_},null,I)}}else typeof _=="function"&&(R.preventDefault(),I=new FormData(m,E),iS(c,{pending:!0,data:I,method:m.method,action:_},_,I))},currentTarget:m}]})}}for(var JS=0;JS<wx.length;JS++){var XS=wx[JS],YK=XS.toLowerCase(),QK=XS[0].toUpperCase()+XS.slice(1);Xs(YK,"on"+QK)}Xs(XR,"onAnimationEnd"),Xs(YR,"onAnimationIteration"),Xs(QR,"onAnimationStart"),Xs("dblclick","onDoubleClick"),Xs("focusin","onFocus"),Xs("focusout","onBlur"),Xs(lK,"onTransitionRun"),Xs(cK,"onTransitionStart"),Xs(uK,"onTransitionCancel"),Xs(e$,"onTransitionEnd"),Bu("onMouseEnter",["mouseout","mouseover"]),Bu("onMouseLeave",["mouseout","mouseover"]),Bu("onPointerEnter",["pointerout","pointerover"]),Bu("onPointerLeave",["pointerout","pointerover"]),_c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),_c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),_c("onBeforeInput",["compositionend","keypress","textInput","paste"]),_c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),_c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),_c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ep="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),eZ=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ep));function Tj(s,a){a=(a&4)!==0;for(var c=0;c<s.length;c++){var h=s[c],m=h.event;h=h.listeners;e:{var _=void 0;if(a)for(var E=h.length-1;0<=E;E--){var R=h[E],I=R.instance,q=R.currentTarget;if(R=R.listener,I!==_&&m.isPropagationStopped())break e;_=R,m.currentTarget=q;try{_(m)}catch(se){Ov(se)}m.currentTarget=null,_=I}else for(E=0;E<h.length;E++){if(R=h[E],I=R.instance,q=R.currentTarget,R=R.listener,I!==_&&m.isPropagationStopped())break e;_=R,m.currentTarget=q;try{_(m)}catch(se){Ov(se)}m.currentTarget=null,_=I}}}}function $t(s,a){var c=a[qu];c===void 0&&(c=a[qu]=new Set);var h=s+"__bubble";c.has(h)||(Cj(a,s,2,!1),c.add(h))}function YS(s,a,c){var h=0;a&&(h|=4),Cj(c,s,h,a)}var Ty="_reactListening"+Math.random().toString(36).slice(2);function QS(s){if(!s[Ty]){s[Ty]=!0,wf.forEach(function(c){c!=="selectionchange"&&(eZ.has(c)||YS(c,!1,s),YS(c,!0,s))});var a=s.nodeType===9?s:s.ownerDocument;a===null||a[Ty]||(a[Ty]=!0,YS("selectionchange",!1,a))}}function Cj(s,a,c,h){switch(mP(a)){case 2:var m=qZ;break;case 8:m=VZ;break;default:m=_k}c=m.bind(null,a,c,s),m=void 0,!ax||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(m=!0),h?m!==void 0?s.addEventListener(a,c,{capture:!0,passive:m}):s.addEventListener(a,c,!0):m!==void 0?s.addEventListener(a,c,{passive:m}):s.addEventListener(a,c,!1)}function ek(s,a,c,h,m){var _=h;if((a&1)===0&&(a&2)===0&&h!==null)e:for(;;){if(h===null)return;var E=h.tag;if(E===3||E===4){var R=h.stateNode.containerInfo;
vendor: 31,183 bytes, lines 8-9
8if(R===m)break;if(E===4)for(E=h.return;E!==null;){var I=E.tag;if((I===3||I===4)&&E.stateNode.containerInfo===m)return;E=E.return}for(;R!==null;){if(E=Ti(R),E===null)return;if(I=E.tag,I===5||I===6||I===26||I===27){h=_=E;continue e}R=R.parentNode}}h=h.return}CR(function(){var q=_,se=sx(c),pe=[];e:{var K=t$.get(s);if(K!==void 0){var te=Ev,De=s;switch(s){case"keypress":if(Sv(c)===0)break e;case"keydown":case"keyup":te=D8;break;case"focusin":De="focus",te=dx;break;case"focusout":De="blur",te=dx;break;case"beforeblur":case"afterblur":te=dx;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":te=$R;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=T8;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=K8;break;case XR:case YR:case QR:te=R8;break;case e$:te=W8;break;case"scroll":case"scrollend":te=k8;break;case"wheel":te=V8;break;case"copy":case"cut":case"paste":te=A8;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=jR;break;case"submit":te=F8;break;case"toggle":case"beforetoggle":te=G8}var Ve=(a&4)!==0,wt=!Ve&&(s==="scroll"||s==="scrollend"),W=Ve?K!==null?K+"Capture":null:K;Ve=[];for(var U=q,Q;U!==null;){var fe=U;if(Q=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||Q===null||W===null||(fe=xf(U,W),fe!=null&&Ve.push(tp(U,fe,Q))),wt)break;U=U.return}0<Ve.length&&(K=new te(K,De,null,c,se),pe.push({event:K,listeners:Ve}))}}if((a&7)===0){e:{if(te=s==="mouseover"||s==="pointerover",K=s==="mouseout"||s==="pointerout",te&&c!==rx&&(De=c.relatedTarget||c.fromElement)&&(Ti(De)||De[Di]))break e;(K||te)&&(De=se.window===se?se:(te=se.ownerDocument)?te.defaultView||te.parentWindow:window,K?(te=c.relatedTarget||c.toElement,K=q,te=te?Ti(te):null,te!==null&&(wt=o(te),Ve=te.tag,te!==wt||Ve!==5&&Ve!==27&&Ve!==6)&&(te=null)):(K=null,te=q),K!==te&&(Ve=$R,fe="onMouseLeave",W="onMouseEnter",U="mouse",(s==="pointerout"||s==="pointerover")&&(Ve=jR,fe="onPointerLeave",W="onPointerEnter",U="pointer"),wt=K==null?De:sl(K),Q=te==null?De:sl(te),De=new Ve(fe,U+"leave",K,c,se),De.target=wt,De.relatedTarget=Q,fe=null,Ti(se)===q&&(Ve=new Ve(W,U+"enter",te,c,se),Ve.target=Q,Ve.relatedTarget=wt,fe=Ve),wt=fe,Ve=K&&te?N(K,te,tZ):null,K!==null&&Oj(pe,De,K,Ve,!1),te!==null&&wt!==null&&Oj(pe,wt,te,Ve,!0)))}e:{if(K=q?sl(q):window,te=K.nodeName&&K.nodeName.toLowerCase(),te==="select"||te==="input"&&K.type==="file")var He=UR;else if(DR(K))if(FR)He=sK;else{He=iK;var jt=nK}else te=K.nodeName,!te||te.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?q&&ix(q.elementType)&&(He=UR):He=rK;if(He&&(He=He(s,q))){LR(pe,He,c,se);break e}jt&&jt(s,K,q)}switch(jt=q?sl(q):window,s){case"focusin":(DR(jt)||jt.contentEditable==="true")&&(ed=jt,yx=q,$f=null);break;case"focusout":$f=yx=ed=null;break;case"mousedown":_x=!0;break;case"contextmenu":case"mouseup":case"dragend":_x=!1,GR(pe,c,se);break;case"selectionchange":if(aK)break;case"keydown":case"keyup":GR(pe,c,se)}var Ye;if(fx)e:{switch(s){case"compositionstart":var st="onCompositionStart";break e;case"compositionend":st="onCompositionEnd";break e;case"compositionupdate":st="onCompositionUpdate";break e}st=void 0}else Qu?IR(s,c)&&(st="onCompositionEnd"):s==="keydown"&&c.keyCode===229&&(st="onCompositionStart");st&&(PR&&c.locale!=="ko"&&(Qu||st!=="onCompositionStart"?st==="onCompositionEnd"&&Qu&&(Ye=OR()):(ol=se,lx="value"in ol?ol.value:ol.textContent,Qu=!0)),jt=Cy(q,st),0<jt.length&&(st=new AR(st,s,null,c,se),pe.push({event:st,listeners:jt}),Ye?st.data=Ye:(Ye=zR(c),Ye!==null&&(st.data=Ye)))),(Ye=X8?Y8(s,c):Q8(s,c))&&(st=Cy(q,"onBeforeInput"),0<st.length&&(jt=new AR("onBeforeInput","beforeinput",null,c,se),pe.push({event:jt,listeners:st}),jt.data=Ye)),XK(pe,s,q,c,se)}Tj(pe,a)})}function tp(s,a,c){return{instance:s,listener:a,currentTarget:c}}function Cy(s,a){for(var c=a+"Capture",h=[];s!==null;){var m=s,_=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||_===null||(m=xf(s,c),m!=null&&h.unshift(tp(s,m,_)),m=xf(s,a),m!=null&&h.push(tp(s,m,_))),s.tag===3)return h;s=s.return}return[]}function tZ(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function Oj(s,a,c,h,m){for(var _=a._reactName,E=[];c!==null&&c!==h;){var R=c,I=R.alternate,q=R.stateNode;if(R=R.tag,I!==null&&I===h)break;R!==5&&R!==26&&R!==27||q===null||(I=q,m?(q=xf(c,_),q!=null&&E.unshift(tp(c,q,I))):m||(q=xf(c,_),q!=null&&E.push(tp(c,q,I)))),c=c.return}E.length!==0&&s.push({event:a,listeners:E})}var nZ=/\r\n?/g,iZ=/\u0000|\uFFFD/g;function Rj(s){return(typeof s=="string"?s:""+s).replace(nZ,`
9`).replace(iZ,"")}function $j(s,a){return a=Rj(a),Rj(s)===a}function un(s,a,c,h,m,_){switch(c){case"children":if(typeof h=="string")a==="body"||a==="textarea"&&h===""||Ju(s,h);else if(typeof h=="number"||typeof h=="bigint")a!=="body"&&Ju(s,""+h);else return;break;case"className":bv(s,"class",h);break;case"tabIndex":bv(s,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":bv(s,c,h);break;case"style":ER(s,h,_);return;case"data":if(a!=="object"){bv(s,"data",h);break}case"src":case"href":if(h===""&&(a!=="a"||c!=="href")){s.removeAttribute(c);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){s.removeAttribute(c);break}h=wv(h),s.setAttribute(c,h);break;case"action":case"formAction":if(typeof h=="function"){s.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof _=="function"&&(c==="formAction"?(a!=="input"&&un(s,a,"name",m.name,m,null),un(s,a,"formEncType",m.formEncType,m,null),un(s,a,"formMethod",m.formMethod,m,null),un(s,a,"formTarget",m.formTarget,m,null)):(un(s,a,"encType",m.encType,m,null),un(s,a,"method",m.method,m,null),un(s,a,"target",m.target,m,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){s.removeAttribute(c);break}h=wv(h),s.setAttribute(c,h);break;case"onClick":h!=null&&(s.onclick=Ao);return;case"onScroll":h!=null&&$t("scroll",s);return;case"onScrollEnd":h!=null&&$t("scrollend",s);return;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(i(61));if(c=h.__html,c!=null){if(m.children!=null)throw Error(i(60));_?.__html!==c&&(s.innerHTML=c)}}break;case"multiple":s.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":s.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){s.removeAttribute("xlink:href");break}c=wv(h),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(c,h):s.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(c,""):s.removeAttribute(c);break;case"capture":case"download":h===!0?s.setAttribute(c,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(c,h):s.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?s.setAttribute(c,h):s.removeAttribute(c);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?s.removeAttribute(c):s.setAttribute(c,h);break;case"popover":$t("beforetoggle",s),$t("toggle",s),_v(s,"popover",h);break;case"xlinkActuate":da(s,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":da(s,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":da(s,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":da(s,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":da(s,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":da(s,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":da(s,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":da(s,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":da(s,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":_v(s,"is",h);break;case"innerText":case"textContent":return;default:if(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")c=x8.get(c)||c,_v(s,c,h);else return}Jt=!0}function tk(s,a,c,h,m,_){switch(c){case"style":ER(s,h,_);return;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(i(61));if(c=h.__html,c!=null){if(m.children!=null)throw Error(i(60));_?.__html!==c&&(s.innerHTML=c)}}break;case"children":if(typeof h=="string")Ju(s,h);else if(typeof h=="number"||typeof h=="bigint")Ju(s,""+h);else return;break;case"onScroll":h!=null&&$t("scroll",s);return;case"onScrollEnd":h!=null&&$t("scrollend",s);return;case"onClick":h!=null&&(s.onclick=Ao);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!yv.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(m=c.endsWith("Capture"),_=c.slice(2,m?c.length-7:void 0),a=s[Zn]||null,a=a!=null?a[c]:null,typeof a=="function"&&s.removeEventListener(_,a,m),typeof h=="function")){typeof a!="function"&&a!==null&&(c in s?s[c]=null:s.hasAttribute(c)&&s.removeAttribute(c)),s.addEventListener(_,h,m);break e}Jt=!0,c in s?s[c]=h:h===!0?s.setAttribute(c,""):_v(s,c,h)}return}Jt=!0}function Ki(s,a,c){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":$t("error",s),$t("load",s);var h=!1,m=!1,_;for(_ in c)if(c.hasOwnProperty(_)){var E=c[_];if(E!=null)switch(_){case"src":h=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,a));default:un(s,a,_,E,c,null)}}m&&un(s,a,"srcSet",c.srcSet,c,null),h&&un(s,a,"src",c.src,c,null);return;case"input":$t("invalid",s);var R=_=E=m=null,I=null,q=null;for(h in c)if(c.hasOwnProperty(h)){var se=c[h];if(se!=null)switch(h){case"name":m=se;break;case"type":E=se;break;case"checked":I=se;break;case"defaultChecked":q=se;break;case"value":_=se;break;case"defaultValue":R=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(i(137,a));break;default:un(s,a,h,se,c,null)}}wR(s,_,R,I,q,E,m,!1);return;case"select":$t("invalid",s),h=E=_=null;for(m in c)if(c.hasOwnProperty(m)&&(R=c[m],R!=null))switch(m){case"value":_=R;break;case"defaultValue":E=R;break;case"multiple":h=R;default:un(s,a,m,R,c,null)}a=_,c=E,s.multiple=!!h,a!=null?Gu(s,!!h,a,!1):c!=null&&Gu(s,!!h,c,!0);return;case"textarea":$t("invalid",s),_=m=h=null;for(E in c)if(c.hasOwnProperty(E)&&(R=c[E],R!=null))switch(E){case"value":h=R;break;case"defaultValue":m=R;break;case"children":_=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(i(91));break;default:un(s,a,E,R,c,null)}SR(s,h,m,_);return;case"option":for(I in c)c.hasOwnProperty(I)&&(h=c[I],h!=null)&&(I==="selected"?s.selected=h&&typeof h!="function"&&typeof h!="symbol":un(s,a,I,h,c,null));return;case"dialog":$t("beforetoggle",s),$t("toggle",s),$t("cancel",s),$t("close",s);break;case"iframe":case"object":$t("load",s);break;case"video":case"audio":for(h=0;h<ep.length;h++)$t(ep[h],s);break;case"image":$t("error",s),$t("load",s);break;case"details":$t("toggle",s);break;case"embed":case"source":case"link":$t("error",s),$t("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(q in c)if(c.hasOwnProperty(q)&&(h=c[q],h!=null))switch(q){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,a));default:un(s,a,q,h,c,null)}return;default:if(ix(a)){for(se in c)c.hasOwnProperty(se)&&(h=c[se],h!==void 0&&tk(s,a,se,h,c,void 0));return}}for(R in c)c.hasOwnProperty(R)&&(h=c[R],h!=null&&un(s,a,R,h,c,null))}var rZ={};function sZ(s,a,c,h){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,_=null,E=null,R=null,I=null,q=null,se=null;for(te in c){var pe=c[te];if(c.hasOwnProperty(te)&&pe!=null)switch(te){case"checked":break;case"value":break;case"defaultValue":I=pe;default:h.hasOwnProperty(te)||un(s,a,te,null,h,pe)}}for(var K in h){var te=h[K];if(pe=c[K],h.hasOwnProperty(K)&&(te!=null||pe!=null))switch(K){case"type":te!==pe&&(Jt=!0),_=te;break;case"name":te!==pe&&(Jt=!0),m=te;break;case"checked":te!==pe&&(Jt=!0),q=te;break;case"defaultChecked":te!==pe&&(Jt=!0),se=te;break;case"value":te!==pe&&(Jt=!0),E=te;break;case"defaultValue":te!==pe&&(Jt=!0),R=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(i(137,a));break;default:te!==pe&&un(s,a,K,te,h,pe)}}tx(s,E,R,I,q,se,_,m);return;case"select":te=E=R=K=null;for(_ in c)if(I=c[_],c.hasOwnProperty(_)&&I!=null)switch(_){case"value":break;case"multiple":te=I;default:h.hasOwnProperty(_)||un(s,a,_,null,h,I)}for(m in h)if(_=h[m],I=c[m],h.hasOwnProperty(m)&&(_!=null||I!=null))switch(m){case"value":_!==I&&(Jt=!0),K=_;break;case"defaultValue":_!==I&&(Jt=!0),R=_;break;case"multiple":_!==I&&(Jt=!0),E=_;default:_!==I&&un(s,a,m,_,h,I)}a=R,c=E,h=te,K!=null?Gu(s,!!c,K,!1):!!h!=!!c&&(a!=null?Gu(s,!!c,a,!0):Gu(s,!!c,c?[]:"",!1));return;case"textarea":te=K=null;for(R in c)if(m=c[R],c.hasOwnProperty(R)&&m!=null&&!h.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:un(s,a,R,null,h,m)}for(E in h)if(m=h[E],_=c[E],h.hasOwnProperty(E)&&(m!=null||_!=null))switch(E){case"value":m!==_&&(Jt=!0),K=m;break;case"defaultValue":m!==_&&(Jt=!0),te=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(i(91));break;default:m!==_&&un(s,a,E,m,h,_)}xR(s,K,te);return;case"option":for(var De in c)K=c[De],c.hasOwnProperty(De)&&K!=null&&!h.hasOwnProperty(De)&&(De==="selected"?s.selected=!1:un(s,a,De,null,h,K));for(I in h)K=h[I],te=c[I],h.hasOwnProperty(I)&&K!==te&&(K!=null||te!=null)&&(I==="selected"?(K!==te&&(Jt=!0),s.selected=K&&typeof K!="function"&&typeof K!="symbol"):un(s,a,I,K,h,te));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ve in c)K=c[Ve],c.hasOwnProperty(Ve)&&K!=null&&!h.hasOwnProperty(Ve)&&un(s,a,Ve,null,h,K);for(q in h)if(K=h[q],te=c[q],h.hasOwnProperty(q)&&K!==te&&(K!=null||te!=null))switch(q){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(i(137,a));break;default:un(s,a,q,K,h,te)}return;default:if(ix(a)){for(var wt in c)K=c[wt],c.hasOwnProperty(wt)&&K!==void 0&&!h.hasOwnProperty(wt)&&tk(s,a,wt,void 0,h,K);for(se in h)K=h[se],te=c[se],!h.hasOwnProperty(se)||K===te||K===void 0&&te===void 0||tk(s,a,se,K,h,te);return}}for(var W in c)K=c[W],c.hasOwnProperty(W)&&K!=null&&!h.hasOwnProperty(W)&&un(s,a,W,null,h,K);for(pe in h)K=h[pe],te=c[pe],!h.hasOwnProperty(pe)||K===te||K==null&&te==null||un(s,a,pe,K,h,te)}function Aj(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function oZ(){if(typeof performance.getEntriesByType=="function"){for(var s=0,a=0,c=performance.getEntriesByType("resource"),h=0;h<c.length;h++){var m=c[h],_=m.transferSize,E=m.initiatorType,R=m.duration;if(_&&R&&Aj(E)){for(E=0,R=m.responseEnd,h+=1;h<c.length;h++){var I=c[h],q=I.startTime;if(q>R)break;var se=I.transferSize,pe=I.initiatorType;se&&Aj(pe)&&(I=I.responseEnd,E+=se*(I<R?1:(R-q)/(I-q)))}if(--h,a+=8*(_+E)/(m.duration/1e3),s++,10<s)break}}if(0<s)return a/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var nk=null,ik=null;function np(s){return s.nodeType===9?s:s.ownerDocument}function jj(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Pj(s,a){if(s===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&a==="foreignObject"?0:s}function Nj(s,a,c,h){return c=np(c).createElement(s),c[jn]=h,c[Zn]=a,Ki(c,s,a),_t(c),c}function rk(s,a){return s==="textarea"||s==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var sk=null;function aZ(){var s=window.event;return s&&s.type==="popstate"?s===sk?!1:(sk=s,!0):(sk=null,!1)}var ok=typeof setTimeout=="function"?setTimeout:void 0,lZ=typeof clearTimeout=="function"?clearTimeout:void 0,Mj=typeof Promise=="function"?Promise:void 0,Ij=typeof requestAnimationFrame=="function"?requestAnimationFrame:ok,cZ=typeof queueMicrotask=="function"?queueMicrotask:typeof Mj<"u"?function(s){return Mj.resolve(null).then(s).catch(uZ)}:ok;function uZ(s){setTimeout(function(){throw s})}function Tl(s){return s==="head"}function zj(s,a){var c=a,h=0;do{var m=c.nextSibling;if(s.removeChild(c),m&&m.nodeType===8)if(c=m.data,c==="/$"||c==="/&"){if(h===0){s.removeChild(m),Pd(a);return}h--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")h++;else if(c==="html")pk(s.ownerDocument.documentElement);else if(c==="head"){c=s.ownerDocument.head,pk(c);for(var _=c.firstChild;_;){var E=_.nextSibling,R=_.nodeName;_[Oo]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&_.rel.toLowerCase()==="stylesheet"||c.removeChild(_),_=E}}else c==="body"&&pk(s.ownerDocument.body);c=m}while(c);Pd(a)}function Dj(s,a){var c=s;s=0;do{var h=c.nextSibling;if(c.nodeType===1?a?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(a?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),h&&h.nodeType===8)if(c=h.data,c==="/$"){if(s===0)break;s--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||s++;c=h}while(c)}function Lj(s,a,c){if(a=CSS.escape(a)!==a?"r-"+btoa(a).replace(/=/g,""):a,s.style.viewTransitionName=a,c!=null&&(s.style.viewTransitionClass=c),c=getComputedStyle(s),c.display==="inline"){if(a=s.getClientRects(),a.length===1)var h=1;else for(var m=h=0;m<a.length;m++){var _=a[m];0<_.width&&0<_.height&&h++}h===1&&(s=s.style,s.display=a.length===1?"inline-block":"block",s.marginTop="-"+c.paddingTop,s.marginBottom="-"+c.paddingBottom)}}function Uj(s,a){s=s.style,a=a.style;var c=a!=null?a.hasOwnProperty("viewTransitionName")?a.viewTransitionName:a.hasOwnProperty("view-transition-name")?a["view-transition-name"]:null:null;s.viewTransitionName=c==null||typeof c=="boolean"?"":(""+c).trim(),c=a!=null?a.hasOwnProperty("viewTransitionClass")?a.viewTransitionClass:a.hasOwnProperty("view-transition-class")?a["view-transition-class"]:null:null,s.viewTransitionClass=c==null||typeof c=="boolean"?"":(""+c).trim(),s.display==="inline-block"&&(a==null?s.display=s.margin="":(c=a.display,s.display=c==null||typeof c=="boolean"?"":c,c=a.margin,c!=null?s.margin=c:(c=a.hasOwnProperty("marginTop")?a.marginTop:a["margin-top"],s.marginTop=c==null||typeof c=="boolean"?"":c,a=a.hasOwnProperty("marginBottom")?a.marginBottom:a["margin-bottom"],s.marginBottom=a==null||typeof a=="boolean"?"":a)))}function dZ(s,a,c){return c=c.ownerDocument.defaultView,{rect:s,abs:a.position==="absolute"||a.position==="fixed",clip:a.clipPath!=="none"||a.overflow!=="visible"||a.filter!=="none"||a.mask!=="none"||a.mask!=="none"||a.borderRadius!=="0px",view:0<=s.bottom&&0<=s.right&&s.top<=c.innerHeight&&s.left<=c.innerWidth}}function ak(s){var a=s.getBoundingClientRect(),c=getComputedStyle(s);return dZ(a,c,s)}function hZ(s){return s.documentElement.clientHeight}function fZ(s){this.addEventListener("load",s),this.addEventListener("error",s)}function pZ(s,a,c,h,m,_,E,R,I){var q=a.nodeType===9?a:a.ownerDocument;try{var se=q.startViewTransition({update:function(){var K=q.defaultView,te=K.navigation&&K.navigation.transition,De=q.fonts.status;h();var Ve=[];if(De==="loaded"&&(hZ(q),q.fonts.status==="loading"&&Ve.push(q.fonts.ready)),De=Ve.length,s!==null)for(var wt=s.suspenseyImages,W=0,U=0;U<wt.length;U++){var Q=wt[U];if(!Q.complete){var fe=Q.getBoundingClientRect();if(0<fe.bottom&&0<fe.right&&fe.top<K.innerHeight&&fe.left<K.innerWidth){if(W+=aP(Q),W>$y){Ve.length=De;break}Q=new Promise(fZ.bind(Q)),Ve.push(Q)}}}if(0<Ve.length)return K=Promise.race([Promise.all(Ve),new Promise(function(He){return setTimeout(He,500)})]).then(m,m),(te?Promise.allSettled([te.finished,K]):K).then(_,_);if(m(),te)return te.finished.then(_,_);_()},types:c});q.__reactViewTransition=se;var pe=[];return se.ready.then(function(){for(var K=q.documentElement.getAnimations({subtree:!0}),te=0;te<K.length;te++){var De=K[te],Ve=De.effect,wt=Ve.pseudoElement;if(wt!=null&&wt.startsWith("::view-transition")){pe.push(De),De=Ve.getKeyframes();for(var W=wt=void 0,U=!0,Q=0;Q<De.length;Q++){var fe=De[Q],He=fe.width;if(wt===void 0)wt=He;else if(wt!==He){U=!1;break}if(He=fe.height,W===void 0)W=He;else if(W!==He){U=!1;break}delete fe.width,delete fe.height,fe.transform==="none"&&delete fe.transform}U&&wt!==void 0&&W!==void 0&&(Ve.setKeyframes(De),U=getComputedStyle(Ve.target,Ve.pseudoElement),U.width!==wt||U.height!==W)&&(U=De[0],U.width=wt,U.height=W,U=De[De.length-1],U.width=wt,U.height=W,Ve.setKeyframes(De))}}E()},function(K){q.__reactViewTransition===se&&(q.__reactViewTransition=null);try{typeof K=="object"&&K!==null&&K.name==="InvalidStateError"&&(K.message==="View transition was skipped because document visibility state is hidden."||K.message==="Skipping view transition because document visibility state has become hidden."||K.message==="Skipping view transition because viewport size changed."||K.message==="Transition was aborted because of invalid state")&&(K=null),K!==null&&I(K)}finally{h(),m(),E()}}),se.finished.finally(function(){for(var K=0;K<pe.length;K++)pe[K].cancel();q.__reactViewTransition===se&&(q.__reactViewTransition=null),R()}),se}catch{return h(),m(),E(),null}}function Lc(s,a){this._scope=document.documentElement,this._selector="::view-transition-"+s+"("+a+")"}Lc.prototype.animate=function(s,a){return a=typeof a=="number"?{duration:a}:j({},a),a.pseudoElement=this._selector,this._scope.animate(s,a)},Lc.prototype.getAnimations=function(){for(var s=this._scope,a=this._selector,c=s.getAnimations({subtree:!0}),h=[],m=0;m<c.length;m++){var _=c[m].effect;_!==null&&_.target===s&&_.pseudoElement===a&&h.push(c[m])}return h},Lc.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Fj(s){return{name:s,group:new Lc("group",s),imagePair:new Lc("image-pair",s),old:new Lc("old",s),new:new Lc("new",s)}}function rs(s){this._fragmentFiber=s,this._observers=this._eventListeners=null}rs.prototype.addEventListener=function(s,a,c){var h=null,m=null;if(!(c!=null&&typeof c!="boolean"&&(h=c.signal||null,h!==null&&h.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var _=this._eventListeners;if(Kj(_,s,a,c)===-1){var E=this,R=a;c!=null&&typeof c!="boolean"&&c.once===!0&&(R=function(I){E.removeEventListener(s,a,c),typeof a=="function"?a.call(this,I):a.handleEvent(I)}),h!==null&&(m=E.removeEventListener.bind(E,s,a,c),h.addEventListener("abort",m,{once:!0}),m=h.removeEventListener.bind(h,"abort",m)),h=Cd(c),_.push({type:s,listener:a,optionsOrUseCapture:c,attachedListener:R,cleanup:m}),g(this._fragmentFiber.child,!1,gZ,s,R,h)}this._eventListeners=_}};function gZ(s,a,c,h){return S(s).addEventListener(a,c,h),!1}rs.prototype.removeEventListener=function(s,a,c){var h=this._eventListeners;if(h!==null&&(a=Kj(h,s,a,c),a!==-1)){var m=h[a];c=m.attachedListener;var _=m.cleanup;m=Cd(m.optionsOrUseCapture),g(this._fragmentFiber.child,!1,mZ,s,c,m),h.splice(a,1),_!==null&&_()}};function mZ(s,a,c,h){return S(s).removeEventListener(a,c,h),!1}function Cd(s){return s!=null&&typeof s!="boolean"&&(s.once===!0||s.signal instanceof AbortSignal)?{capture:s.capture,passive:s.passive}:s}function Hj(s){return s==null?"c=0":typeof s=="boolean"?"c="+(s?"1":"0"):"c="+(s.capture?"1":"0")}function Kj(s,a,c,h){if(s.length===0)return-1;h=Hj(h);for(var m=0;m<s.length;m++){var _=s[m];if(_.type===a&&_.listener===c&&Hj(_.optionsOrUseCapture)===h)return m}return-1}rs.prototype.dispatchEvent=function(s){var a=v(this._fragmentFiber);if(a===null)return!0;a=S(a);var c=this._eventListeners;if(c!==null&&0<c.length||!s.bubbles){var h=a.nodeType===9?a.createComment(""):document.createTextNode("");if(c)for(var m=0;m<c.length;m++){var _=c[m];h.addEventListener(_.type,_.attachedListener,Cd(_.optionsOrUseCapture))}if(a.appendChild(h),s=h.dispatchEvent(s),c)for(m=0;m<c.length;m++)_=c[m],h.removeEventListener(_.type,_.attachedListener,Cd(_.optionsOrUseCapture));return a.removeChild(h),s}return a.dispatchEvent(s)},rs.prototype.focus=function(s){g(this._fragmentFiber.child,!0,Zj,s,void 0,void 0)};function Zj(s,a){return s.tag===6?!1:(s=S(s),OZ(s,a))}rs.prototype.focusLast=function(s){var a=[];g(this._fragmentFiber.child,!0,lk,a,void 0,void 0);for(var c=a.length-1;0<=c&&!Zj(a[c],s);c--);};function lk(s,a){return a.push(s),!1}rs.prototype.blur=function(){var s=v(this._fragmentFiber);s!==null&&(s=S(s),s=np(s).activeElement,s!==null&&g(this._fragmentFiber.child,!1,vZ,s,void 0,void 0))};function vZ(s,a){return s.tag===6?!1:(s=S(s),s===a||s.contains(a)?(a.blur(),!0):!1)}rs.prototype.observeUsing=function(s){this._observers===null&&(this._observers=new Set),this._observers.add(s),g(this._fragmentFiber.child,!1,yZ,s,void 0,void 0)};function yZ(s,a){return s.tag===6||(s=S(s),a.observe(s)),!1}rs.prototype.unobserveUsing=function(s){var a=this._observers;if(a!==null&&a.has(s)){a.delete(s),g(this._fragmentFiber.child,!1,_Z,s,void 0,void 0);for(var c=a=0;c<no.length;c++){var h=no[c];h.fragmentInstance===this&&h.observer===s?s.unobserve(h.instance):no[a++]=h}no.length=a}};function _Z(s,a){return s.tag===6||(s=S(s),a.unobserve(s)),!1}var no=[],ck=!1;function bZ(s,a,c){no.push({fragmentInstance:s,observer:a,instance:c}),ck||(ck=!0,RZ(function(){ck=!1;var h=no;no=[];for(var m=0;m<h.length;m++){var _=h[m];_.observer.unobserve(_.instance)}}))}rs.prototype.getClientRects=function(){var s=[];return g(this._fragmentFiber.child,!1,wZ,s,void 0,void 0),s};function wZ(s,a){if(s.tag===6){s=s.stateNode;var c=s.ownerDocument.createRange();c.selectNodeContents(s),a.push.apply(a,c.getClientRects())}else s=S(s),a.push.apply(a,s.getClientRects());return!1}rs.prototype.getRootNode=function(s){var a=v(this._fragmentFiber);return a===null?this:S(a).getRootNode(s)},rs.prototype.compareDocumentPosition=function(s){var a=v(this._fragmentFiber);if(a===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var c=[];g(this._fragmentFiber.child,!1,lk,c,void 0,void 0);var h=S(a);if(c.length===0){if(c=h,y(this._fragmentFiber)){e:{for(a=this._fragmentFiber.return;a!==null;){if(a.tag===4){a=a.stateNode.containerInfo;break e}if(a.tag===3||a.tag===5||a.tag===27)break;a=a.return}a=null}a!=null&&(c=a)}a=this._fragmentFiber;var m=h=c.compareDocumentPosition(s);return c===s?m=Node.DOCUMENT_POSITION_CONTAINS:h&Node.DOCUMENT_POSITION_CONTAINED_BY&&(c=b(a)[1],c===null?m=Node.DOCUMENT_POSITION_PRECEDING:(s=S(c).compareDocumentPosition(s),m=s===0||s&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),m|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}a=S(c[0]),m=S(c[c.length-1]);var _=y(this._fragmentFiber)?a.parentElement:h;if(_==null)return Node.DOCUMENT_POSITION_DISCONNECTED;h=_.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY,_=_.compareDocumentPosition(m)&Node.DOCUMENT_POSITION_CONTAINED_BY;var E=a.compareDocumentPosition(s),R=m.compareDocumentPosition(s),I=E&Node.DOCUMENT_POSITION_CONTAINED_BY||R&Node.DOCUMENT_POSITION_CONTAINED_BY;return R=h&&_&&E&Node.DOCUMENT_POSITION_FOLLOWING&&R&Node.DOCUMENT_POSITION_PRECEDING,a=h&&a===s||_&&m===s||I||R?Node.DOCUMENT_POSITION_CONTAINED_BY:!h&&a===s||!_&&m===s?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:E,a&Node.DOCUMENT_POSITION_DISCONNECTED||a&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||xZ(a,this._fragmentFiber,c[0],c[c.length-1],s)?a:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function xZ(s,a,c,h,m){var _=Ti(m);if(s&Node.DOCUMENT_POSITION_CONTAINED_BY){if(c=!!_)e:{for(;_!==null;){if(_.tag===7&&(_===a||_.alternate===a)){c=!0;break e}_=_.return}c=!1}return c}if(s&Node.DOCUMENT_POSITION_CONTAINS){if(_===null)return _=m.ownerDocument,m===_||m===_.documentElement||m===_.body;e:{for(_=a,a=v(a);_!==null;){if(!(_.tag!==5&&_.tag!==3&&_.tag!==27||_!==a&&_.alternate!==a)){_=!0;break e}_=_.return}_=!1}return _}return s&Node.DOCUMENT_POSITION_PRECEDING?((a=!!_)&&!(a=_===c)&&(a=N(c,_,$),a===null?a=!1:(g(a,!0,C,_,c),_=k,k=null,a=_!==null)),a):s&Node.DOCUMENT_POSITION_FOLLOWING?((a=!!_)&&!(a=_===h)&&(a=N(h,_,$),a===null?a=!1:(g(a,!0,A,_,h),_=k,T=k=null,a=_!==null)),a):!1}function Wj(s,a){var c=s.ownerDocument.createRange();c.selectNodeContents(s),s=c.getBoundingClientRect(),window.scrollTo(window.scrollX+s.left,a?window.scrollY+s.top:window.scrollY+s.bottom-window.innerHeight)}rs.prototype.scrollIntoView=function(s){if(typeof s=="object")throw Error(i(566));var a=[];g(this._fragmentFiber.child,!1,lk,a,void 0,void 0);var c=s!==!1;if(a.length===0){var h=b(this._fragmentFiber);if(h=c?h[1]||h[0]||v(this._fragmentFiber):h[0]||h[1],h===null)return;if(h.tag===6){s=S(h),Wj(s,c);return}if(h=S(h),h.nodeType!==9){if(h.nodeType===11){c="host"in h?h.host:null,c!==null&&c.scrollIntoView(s);return}h.scrollIntoView(s)}}for(h=c?a.length-1:0;h!==(c?-1:a.length);){var m=a[h];m.tag===6?(m=S(m),Wj(m,c)):S(m).scrollIntoView(s),h+=c?-1:1}};function SZ(s,a){return s=S(s),qj(s,a),!1}function qj(s,a){s.reactFragments==null&&(s.reactFragments=new Set),s.reactFragments.add(a)}function Vj(s,a){var c=a._eventListeners;if(c!==null)for(var h=0;h<c.length;h++){var m=c[h];s.addEventListener(m.type,m.attachedListener,Cd(m.optionsOrUseCapture))}s.nodeType!==3&&(c=a._observers,c!==null&&c.forEach(function(_){for(var E=0,R=0;R<no.length;R++){var I=no[R];(I.fragmentInstance!==a||I.observer!==_||I.instance!==s)&&(no[E++]=I)}no.length=E,_.observe(s)}),qj(s,a))}function kZ(s,a){var c=a._eventListeners;if(c!==null)for(var h=0;h<c.length;h++){var m=c[h];s.removeEventListener(m.type,m.attachedListener,Cd(m.optionsOrUseCapture))}s.nodeType!==3&&(c=a._observers,c!==null&&c.forEach(function(_){typeof _.rootMargin=="str
9ing"?bZ(a,_,s):_.unobserve(s)}),s.reactFragments!=null&&s.reactFragments.delete(a))}function uk(s){var a=s.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var c=a;switch(a=a.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":uk(c),ci(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}s.removeChild(c)}}function EZ(s,a,c,h){for(;s.nodeType===1;){var m=c;if(s.nodeName.toLowerCase()!==a.toLowerCase()){if(!h&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(h){if(!s[Oo])switch(a){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(_=s.getAttribute("rel"),_==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(_!==m.rel||s.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||s.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||s.getAttribute("title")!==(m.title==null?null:m.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(_=s.getAttribute("src"),(_!==(m.src==null?null:m.src)||s.getAttribute("type")!==(m.type==null?null:m.type)||s.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&_&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(a==="input"&&s.type==="hidden"){var _=m.name==null?null:""+m.name;if(m.type==="hidden"&&s.getAttribute("name")===_)return s}else return s;if(s=Cs(s.nextSibling),s===null)break}return null}function TZ(s,a,c){if(a==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!c||(s=Cs(s.nextSibling),s===null))return null;return s}function Bj(s,a){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!a||(s=Cs(s.nextSibling),s===null))return null;return s}function dk(s){return s.data==="$?"||s.data==="$~"}function hk(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function CZ(s,a){var c=s.ownerDocument;if(s.data==="$~")s._reactRetry=a;else if(s.data!=="$?"||c.readyState!=="loading")a();else{var h=function(){a(),c.removeEventListener("DOMContentLoaded",h)};c.addEventListener("DOMContentLoaded",h),s._reactRetry=h}}function Cs(s){for(;s!=null;s=s.nextSibling){var a=s.nodeType;if(a===1||a===3)break;if(a===8){if(a=s.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return s}var fk=null;function Gj(s){s=s.nextSibling;for(var a=0;s;){if(s.nodeType===8){var c=s.data;if(c==="/$"||c==="/&"){if(a===0)return Cs(s.nextSibling);a--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||a++}s=s.nextSibling}return null}function Jj(s){s=s.previousSibling;for(var a=0;s;){if(s.nodeType===8){var c=s.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(a===0)return s;a--}else c!=="/$"&&c!=="/&"||a++}s=s.previousSibling}return null}function OZ(s,a){function c(){h=!0}if(s.ownerDocument.activeElement===s)return!0;var h=!1;try{s.ownerDocument.addEventListener("focus",c,!0),(s.focus||HTMLElement.prototype.focus).call(s,a)}finally{s.ownerDocument.removeEventListener("focus",c,!0)}return h}function RZ(s){Ij(function(){Ij(function(a){return s(a)})})}function Xj(s,a,c){switch(a=np(c),s){case"html":if(s=a.documentElement,!s)throw Error(i(452));return s;case"head":if(s=a.head,!s)throw Error(i(453));return s;case"body":if(s=a.body,!s)throw Error(i(454));return s;default:throw Error(i(451))}}function Yj(s,a,c){for(var h in c){var m=c[h];c.hasOwnProperty(h)&&m!=null&&un(s,a,h,null,rZ,m)}c.dangerouslySetInnerHTML!=null&&(s.textContent=""),s.onclick===Ao&&(s.onclick=null),ci(s)}function pk(s){for(var a=s.attributes;a.length;)s.removeAttributeNode(a[0]);ci(s)}var Os=new Map,Qj=new Set;function ip(s){if(typeof s.getRootNode=="function"){var a=s.getRootNode();if(a.nodeType===9||a.nodeType===11)return a}return s.nodeType===9?s:s.ownerDocument}var ka=oe.d;oe.d={f:$Z,r:AZ,D:jZ,C:PZ,L:NZ,m:MZ,X:zZ,S:IZ,M:DZ};function $Z(){var s=ka.f(),a=wy();return s||a}function AZ(s){var a=er(s);a!==null&&a.tag===5&&a.type==="form"?tA(a):ka.r(s)}var Od=typeof document>"u"?null:document;function eP(s,a,c){var h=Od;
vendor: 12,386 bytes, line 9
9if(h&&typeof a=="string"&&a){var m=bs(a);m='link[rel="'+s+'"][href="'+m+'"]',typeof c=="string"&&(m+='[crossorigin="'+c+'"]'),Qj.has(m)||(Qj.add(m),s={rel:s,crossOrigin:c,href:a},h.querySelector(m)===null&&(a=h.createElement("link"),Ki(a,"link",s),_t(a),h.head.appendChild(a)))}}function jZ(s){ka.D(s),eP("dns-prefetch",s,null)}function PZ(s,a){ka.C(s,a),eP("preconnect",s,a)}function NZ(s,a,c){ka.L(s,a,c);var h=Od;if(h&&s&&a){var m='link[rel="preload"][as="'+bs(a)+'"]';a==="image"&&c&&c.imageSrcSet?(m+='[imagesrcset="'+bs(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(m+='[imagesizes="'+bs(c.imageSizes)+'"]')):m+='[href="'+bs(s)+'"]';var _=m;switch(a){case"style":_=Rd(s);break;case"script":_=$d(s)}if(!(Os.has(_)||(s=j({rel:"preload",href:a==="image"&&c&&c.imageSrcSet?void 0:s,as:a},c),Os.set(_,s),h.querySelector(m)!==null||a==="style"&&h.querySelector(rp(_))||a==="script"&&h.querySelector(sp(_))))){var E=h.createElement("link");Ki(E,"link",s),a==="style"&&(E[Et]=!0,E.onload=E.onerror=function(){$o(E)}),_t(E),h.head.appendChild(E)}}}function MZ(s,a){ka.m(s,a);var c=Od;if(c&&s){var h=a&&typeof a.as=="string"?a.as:"script",m='link[rel="modulepreload"][as="'+bs(h)+'"][href="'+bs(s)+'"]',_=m;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=$d(s)}if(!Os.has(_)&&(s=j({rel:"modulepreload",href:s},a),Os.set(_,s),c.querySelector(m)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(sp(_)))return}h=c.createElement("link"),Ki(h,"link",s),_t(h),c.head.appendChild(h)}}}function IZ(s,a,c){ka.S(s,a,c);var h=Od;if(h&&s){var m=Ro(h).hoistableStyles,_=Rd(s);a=a||"default";var E=m.get(_);if(!E){var R={loading:0,preload:null};if(E=h.querySelector(rp(_)))R.loading=5;else{s=j({rel:"stylesheet",href:s,"data-precedence":a},c),(c=Os.get(_))&&gk(s,c);var I=E=h.createElement("link");_t(I),Ki(I,"link",s),I._p=new Promise(function(q,se){I.onload=q,I.onerror=se}),I.addEventListener("load",function(){R.loading|=1}),I.addEventListener("error",function(){R.loading|=2}),R.loading|=4,Oy(E,a,h)}E={type:"stylesheet",instance:E,count:1,state:R},m.set(_,E)}}}function zZ(s,a){ka.X(s,a);var c=Od;if(c&&s){var h=Ro(c).hoistableScripts,m=$d(s),_=h.get(m);_||(_=c.querySelector(sp(m)),_||(s=j({src:s,async:!0},a),(a=Os.get(m))&&mk(s,a),_=c.createElement("script"),_t(_),Ki(_,"link",s),c.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},h.set(m,_))}}function DZ(s,a){ka.M(s,a);var c=Od;if(c&&s){var h=Ro(c).hoistableScripts,m=$d(s),_=h.get(m);_||(_=c.querySelector(sp(m)),_||(s=j({src:s,async:!0,type:"module"},a),(a=Os.get(m))&&mk(s,a),_=c.createElement("script"),_t(_),Ki(_,"link",s),c.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},h.set(m,_))}}function tP(s,a,c,h){var m=(m=yt.current)?ip(m):null;if(!m)throw Error(i(446));switch(s){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(c=Rd(c.href),a=Ro(m).hoistableStyles,h=a.get(c),h||(h={type:"style",instance:null,count:0,state:null},a.set(c,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){s=Rd(c.href);var _=Ro(m).hoistableStyles,E=_.get(s);if(E||(m=m.ownerDocument||m,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(s,E),(_=m.querySelector(rp(s)))?_._p||(E.instance=_,E.state.loading=5):(_=Os.get(s),_||(_={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},Os.set(s,_)),LZ(m,s,_,E.state))),a&&h===null)throw Error(i(528,""));return E}if(a&&h!==null)throw Error(i(529,""));return null;case"script":return a=c.async,c=c.src,typeof c=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(c=$d(c),a=Ro(m).hoistableScripts,h=a.get(c),h||(h={type:"script",instance:null,count:0,state:null},a.set(c,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,s))}}function Rd(s){return'href="'+bs(s)+'"'}function rp(s){return'link[rel="stylesheet"]['+s+"]"}function nP(s){return j({},s,{"data-precedence":s.precedence,precedence:null})}function LZ(s,a,c,h){if(a=s.querySelector('link[rel="preload"][as="style"]['+a+"]")){if(a[Et]!==!0){h.loading=1;return}}else a=s.createElement("link"),a[Et]=!0,a.onload=a.onerror=$o.bind(null,a),Ki(a,"link",c),_t(a),s.head.appendChild(a);h.preload=a,a.addEventListener("load",function(){return h.loading|=1}),a.addEventListener("error",function(){return h.loading|=2})}function $d(s){return'[src="'+bs(s)+'"]'}function sp(s){return"script[async]"+s}function iP(s,a,c){if(a.count++,a.instance===null)switch(a.type){case"style":var h=s.querySelector('style[data-href~="'+bs(c.href)+'"]');if(h)return a.instance=h,_t(h),h;var m=j({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return h=(s.ownerDocument||s).createElement("style"),_t(h),Ki(h,"style",m),Oy(h,c.precedence,s),a.instance=h;case"stylesheet":m=Rd(c.href);var _=s.querySelector(rp(m));if(_)return a.state.loading|=4,a.instance=_,_t(_),_;h=nP(c),(m=Os.get(m))&&gk(h,m),_=(s.ownerDocument||s).createElement("link"),_t(_);var E=_;return E._p=new Promise(function(R,I){E.onload=R,E.onerror=I}),Ki(_,"link",h),a.state.loading|=4,Oy(_,c.precedence,s),a.instance=_;case"script":return _=$d(c.src),(m=s.querySelector(sp(_)))?(a.instance=m,_t(m),m):(h=c,(m=Os.get(_))&&(h=j({},c),mk(h,m)),s=s.ownerDocument||s,m=s.createElement("script"),_t(m),Ki(m,"link",h),s.head.appendChild(m),a.instance=m);case"void":return null;default:throw Error(i(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(h=a.instance,a.state.loading|=4,Oy(h,c.precedence,s));return a.instance}function Oy(s,a,c){for(var h=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=h.length?h[h.length-1]:null,_=m,E=0;E<h.length;E++){var R=h[E];if(R.dataset.precedence===a)_=R;else if(_!==m)break}_?_.parentNode.insertBefore(s,_.nextSibling):(a=c.nodeType===9?c.head:c,a.insertBefore(s,a.firstChild))}function gk(s,a){s.crossOrigin==null&&(s.crossOrigin=a.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=a.referrerPolicy),s.title==null&&(s.title=a.title)}function mk(s,a){s.crossOrigin==null&&(s.crossOrigin=a.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=a.referrerPolicy),s.integrity==null&&(s.integrity=a.integrity)}var Ry=null;function rP(s,a,c){if(Ry===null){var h=new Map,m=Ry=new Map;m.set(c,h)}else m=Ry,h=m.get(c),h||(h=new Map,m.set(c,h));if(h.has(s))return h;for(h.set(s,null),c=c.getElementsByTagName(s),m=0;m<c.length;m++){var _=c[m];if(!(_[Oo]||_[jn]||s==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var E=_.getAttribute(a)||"";E=s+E;var R=h.get(E);R?R.push(_):h.set(E,[_])}}return h}function vk(s,a,c){s=s.ownerDocument||s,s.head.insertBefore(c,a==="title"?s.querySelector("head > title"):null)}function UZ(s,a,c){if(c===1||a.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;return a.rel==="stylesheet"?(s=a.disabled,typeof a.precedence=="string"&&s==null):!0;case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function sP(s,a){return s==="img"&&a.src!=null&&a.src!==""&&a.onLoad==null&&a.loading!=="lazy"}function oP(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function aP(s){return(s.width||100)*(s.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function lP(s,a){typeof a.decode=="function"&&(s.imgCount++,a.complete||(s.imgBytes+=aP(a),s.suspenseyImages.push(a)),s=KZ.bind(s),a.decode().then(s,s))}function FZ(s,a,c,h){if(c.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var m=Rd(h.href),_=a.querySelector(rp(m));if(_){a=_._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(s.count++,s=op.bind(s),a.then(s,s)),c.state.loading|=4,c.instance=_,_t(_);return}_=a.ownerDocument||a,h=nP(h),(m=Os.get(m))&&gk(h,m),_=_.createElement("link"),_t(_);var E=_;E._p=new Promise(function(R,I){E.onload=R,E.onerror=I}),Ki(_,"link",h),c.instance=_}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(c,a),(a=c.state.preload)&&(c.state.loading&3)===0&&(s.count++,c=op.bind(s),a.addEventListener("load",c),a.addEventListener("error",c))}}var $y=0;function HZ(s,a){return s.stylesheets&&s.count===0&&jy(s,s.stylesheets),0<s.count||0<s.imgCount?function(c){var h=setTimeout(function(){if(s.stylesheets&&jy(s,s.stylesheets),s.unsuspend){var _=s.unsuspend;s.unsuspend=null,_()}},6e4+a);0<s.imgBytes&&$y===0&&($y=62500*oZ());var m=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&jy(s,s.stylesheets),s.unsuspend)){var _=s.unsuspend;s.unsuspend=null,_()}},(s.imgBytes>$y?50:800)+a);return s.unsuspend=c,function(){s.unsuspend=null,clearTimeout(h),clearTimeout(m)}}:null}function cP(s){if(s.count===0&&(s.imgCount===0||!s.waitingForImages)){if(s.stylesheets)jy(s,s.stylesheets);else if(s.unsuspend){var a=s.unsuspend;s.unsuspend=null,a()}}}function op(){this.count--,cP(this)}function KZ(){this.imgCount--,cP(this)}var Ay=null;function jy(s,a){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Ay=new Map,a.forEach(ZZ,s),Ay=null,op.call(s))}function ZZ(s,a){if(!(a.state.loading&4)){var c=Ay.get(s);if(c)var h=c.get(null);else{c=new Map,Ay.set(s,c);for(var m=s.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<m.length;_++){var E=m[_];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(c.set(E.dataset.precedence,E),h=E)}h&&c.set(null,h)}m=a.instance,E=m.getAttribute("data-precedence"),_=c.get(E)||h,_===h&&c.set(null,m),c.set(E,m),this.count++,h=op.bind(this),m.addEventListener("load",h),m.addEventListener("error",h),_?_.parentNode.insertBefore(m,_.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(m,s.firstChild)),a.state.loading|=4}}var Ad={$$typeof:ce,Provider:null,Consumer:null,_currentValue:je,_currentValue2:je,_threadCount:0};function WZ(s,a,c,h,m,_,E,R,I){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=dt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=dt(0),this.hiddenUpdates=dt(null),this.identifierPrefix=h,this.onUncaughtError=m,this.onCaughtError=_,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.transitionTypes=null,this.incompleteTransitions=new Map}function uP(s,a,c,h,m,_,E,R,I,q,se,pe){return s=new WZ(s,a,c,E,I,q,se,pe,R),a=1,_===!0&&(a|=24),_=$r(3,null,null,a),s.current=_,_.stateNode=s,a=jx(),a.refCount++,s.pooledCache=a,a.refCount++,_.memoizedState={element:h,isDehydrated:c,cache:a},Ix(_),s}function dP(s){return s?(s=id,s):id}function hP(s,a,c,h,m,_){m=dP(m),h.context===null?h.context=m:h.pendingContext=m,h=pl(a),h.payload={element:c},_=_===void 0?null:_,_!==null&&(h.callback=_),c=gl(s,h,a),c!==null&&(Nr(c,s,a),zf(c,s,a))}function fP(s,a){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var c=s.retryLane;s.retryLane=c!==0&&c<a?c:a}}function yk(s,a){fP(s,a),(s=s.alternate)&&fP(s,a)}function pP(s){if(s.tag===13||s.tag===31){var a=xc(s,67108864);a!==null&&Nr(a,s,67108864),yk(s,67108864)}}function gP(s){if(s.tag===13||s.tag===31){var a=is();a=Dt(a);var c=xc(s,a);c!==null&&Nr(c,s,a),yk(s,a)}}var jd=!0;function qZ(s,a,c,h){var m=Se.T;Se.T=null;var _=oe.p;try{oe.p=2,_k(s,a,c,h)}finally{oe.p=_,Se.T=m}}function VZ(s,a,c,h){var m=Se.T;Se.T=null;var _=oe.p;try{oe.p=8,_k(s,a,c,h)}finally{oe.p=_,Se.T=m}}function _k(s,a,c,h){if(jd){var m=bk(h);if(m===null)ek(s,a,h,Py,c),vP(s,h);else if(GZ(m,s,a,c,h))h.stopPropagation();else if(vP(s,h),a&4&&-1<BZ.indexOf(s)){for(;m!==null;){var _=er(m);
vendor: 7,187 bytes, line 9
9if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var E=We(_.pendingLanes);if(E!==0){var R=_;for(R.pendingLanes|=2,R.entangledLanes|=2;E;){var I=1<<31-ni(E);R.entanglements[1]|=I,E&=~I}Fo(_),(Yt&6)===0&&(yy=ei()+500,Qf(0))}}break;case 31:case 13:R=xc(_,2),R!==null&&Nr(R,_,2),wy(),yk(_,2)}if(_=bk(h),_===null&&ek(s,a,h,Py,c),_===m)break;m=_}m!==null&&h.stopPropagation()}else ek(s,a,h,null,c)}}function bk(s){return s=sx(s),wk(s)}var Py=null;function wk(s){if(Py=null,s=Ti(s),s!==null){var a=o(s);if(a===null)s=null;else{var c=a.tag;if(c===13){if(s=l(a),s!==null)return s;s=null}else if(c===31){if(s=u(a),s!==null)return s;s=null}else if(c===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;s=null}else a!==s&&(s=null)}}return Py=s,null}function mP(s){switch(s){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(tl()){case Gr:return 2;case To:return 8;case _s:case nl:return 32;case Js:return 268435456;default:return 32}default:return 32}}var xk=!1,Cl=null,Ol=null,Rl=null,ap=new Map,lp=new Map,$l=[],BZ="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function vP(s,a){switch(s){case"focusin":case"focusout":Cl=null;break;case"dragenter":case"dragleave":Ol=null;break;case"mouseover":case"mouseout":Rl=null;break;case"pointerover":case"pointerout":ap.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":lp.delete(a.pointerId)}}function cp(s,a,c,h,m,_){return s===null||s.nativeEvent!==_?(s={blockedOn:a,domEventName:c,eventSystemFlags:h,nativeEvent:_,targetContainers:[m]},a!==null&&(a=er(a),a!==null&&pP(a)),s):(s.eventSystemFlags|=h,a=s.targetContainers,m!==null&&a.indexOf(m)===-1&&a.push(m),s)}function GZ(s,a,c,h,m){switch(a){case"focusin":return Cl=cp(Cl,s,a,c,h,m),!0;case"dragenter":return Ol=cp(Ol,s,a,c,h,m),!0;case"mouseover":return Rl=cp(Rl,s,a,c,h,m),!0;case"pointerover":var _=m.pointerId;return ap.set(_,cp(ap.get(_)||null,s,a,c,h,m)),!0;case"gotpointercapture":return _=m.pointerId,lp.set(_,cp(lp.get(_)||null,s,a,c,h,m)),!0}return!1}function yP(s){var a=Ti(s.target);if(a!==null){var c=o(a);if(c!==null){if(a=c.tag,a===13){if(a=l(c),a!==null){s.blockedOn=a,rl(s.priority,function(){gP(c)});return}}else if(a===31){if(a=u(c),a!==null){s.blockedOn=a,rl(s.priority,function(){gP(c)});return}}else if(a===3&&c.stateNode.current.memoizedState.isDehydrated){s.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Ny(s){if(s.blockedOn!==null)return!1;for(var a=s.targetContainers;0<a.length;){var c=bk(s.nativeEvent);if(c===null){c=s.nativeEvent;var h=new c.constructor(c.type,c);rx=h,c.target.dispatchEvent(h),rx=null}else return a=er(c),a!==null&&pP(a),s.blockedOn=c,!1;a.shift()}return!0}function _P(s,a,c){Ny(s)&&c.delete(a)}function JZ(){xk=!1,Cl!==null&&Ny(Cl)&&(Cl=null),Ol!==null&&Ny(Ol)&&(Ol=null),Rl!==null&&Ny(Rl)&&(Rl=null),ap.forEach(_P),lp.forEach(_P)}function My(s,a){s.blockedOn===a&&(s.blockedOn=null,xk||(xk=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,JZ)))}var Iy=null;function bP(s){Iy!==s&&(Iy=s,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Iy===s&&(Iy=null);for(var a=0;a<s.length;a+=3){var c=s[a],h=s[a+1],m=s[a+2];if(typeof h!="function"){if(wk(h||c)===null)continue;break}var _=er(c);_!==null&&(s.splice(a,3),a-=3,iS(_,{pending:!0,data:m,method:c.method,action:h},h,m))}}))}function Pd(s){function a(I){return My(I,s)}Cl!==null&&My(Cl,s),Ol!==null&&My(Ol,s),Rl!==null&&My(Rl,s),ap.forEach(a),lp.forEach(a);for(var c=0;c<$l.length;c++){var h=$l[c];h.blockedOn===s&&(h.blockedOn=null)}for(;0<$l.length&&(c=$l[0],c.blockedOn===null);)yP(c),c.blockedOn===null&&$l.shift();if(c=(s.ownerDocument||s).$$reactFormReplay,c!=null)for(h=0;h<c.length;h+=3){var m=c[h],_=c[h+1],E=m[Zn]||null;if(typeof _=="function")E||bP(c);else if(E){var R=null;if(_&&_.hasAttribute("formAction")){if(m=_,E=_[Zn]||null)R=E.formAction;else if(wk(m)!==null)continue}else R=E.action;typeof R=="function"?c[h+1]=R:(c.splice(h,3),h-=3),bP(c)}}}function wP(){function s(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(E){return m=E})},focusReset:"manual",scroll:"manual"})}function a(){m!==null&&(m(),m=null),h||setTimeout(c,20)}function c(){if(!h&&!navigation.transition){var _=navigation.currentEntry;_&&_.url!=null&&navigation.navigate(_.url,{state:_.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,m=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(c,100),function(){h=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),m!==null&&(m(),m=null)}}}function Sk(s){this._internalRoot=s}zy.prototype.render=Sk.prototype.render=function(s){var a=this._internalRoot;if(a===null)throw Error(i(409));var c=a.current,h=is();hP(c,h,s,a,null,null)},zy.prototype.unmount=Sk.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var a=s.containerInfo;hP(s.current,2,null,s,null,null),wy(),a[Di]=null}};function zy(s){this._internalRoot=s}zy.prototype.unstable_scheduleHydration=function(s){if(s){var a=zi();s={blockedOn:null,target:s,priority:a};for(var c=0;c<$l.length&&a!==0&&a<$l[c].priority;c++);$l.splice(c,0,s),c===0&&yP(s)}};var xP=e.version;if(xP!=="19.3.0")throw Error(i(527,xP,"19.3.0"));oe.findDOMNode=function(s){var a=s._reactInternals;if(a===void 0)throw typeof s.render=="function"?Error(i(188)):(s=Object.keys(s).join(","),Error(i(268,s)));return s=f(a),s=s!==null?p(s):null,s=s===null?null:s.stateNode,s};var XZ={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:Se,reconcilerVersion:"19.3.0"};
9if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Dy=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Dy.isDisabled&&Dy.supportsFiber)try{fr=Dy.inject(XZ),ti=Dy}catch{}}return dp.createRoot=function(s,a){if(!r(s))throw Error(i(299));var c=!1,h="",m=dA,_=hA,E=fA;return a!=null&&(a.unstable_strictMode===!0&&(c=!0),a.identifierPrefix!==void 0&&(h=a.identifierPrefix),a.onUncaughtError!==void 0&&(m=a.onUncaughtError),a.onCaughtError!==void 0&&(_=a.onCaughtError),a.onRecoverableError!==void 0&&(E=a.onRecoverableError)),a=uP(s,1,!1,null,null,c,h,null,m,_,E,wP),s[Di]=a.current,QS(s),new Sk(a)},dp.hydrateRoot=function(s,a,c){if(!r(s))throw Error(i(299));var h=!1,m="",_=dA,E=hA,R=fA,I=null;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(m=c.identifierPrefix),c.onUncaughtError!==void 0&&(_=c.onUncaughtError),c.onCaughtError!==void 0&&(E=c.onCaughtError),c.onRecoverableError!==void 0&&(R=c.onRecoverableError),c.formState!==void 0&&(I=c.formState)),a=uP(s,1,!0,a,c??null,h,m,I,_,E,R,wP),a.context=dP(null),c=a.current,h=is(),h=Dt(h),m=pl(h),m.callback=null,gl(c,m,h),c=h,a.current.lanes=c,nt(a,c),Fo(a),s[Di]=a.current,QS(s),new zy(a)},dp.version="19.3.0",dp}var jP;function lW(){if(jP)return Tk.exports;jP=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Tk.exports=aW(),Tk.exports}var cW=lW();const uW=qD(cW);var BD=t=>{throw TypeError(t)},GD=(t,e,n)=>e.has(t)||BD("Cannot "+n),Ms=(t,e,n)=>(GD(t,e,"read from private field"),n?n.call(t):e.get(t)),sg=(t,e,n)=>e.has(t)?BD("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ho=(t,e,n,i)=>(GD(t,e,"write to private field"),e.set(t,n),n),aw=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,lw=/^[\\/]{2}/;function JD(t,e){return e+t.replace(/\\/g,"/")}var PP="popstate";function NP(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function dW(t={}){function e(i,r){let o=r.state?.masked,{pathname:l,search:u,hash:d}=o||i.location;return sm("",{pathname:l,search:u,hash:d},r.state&&r.state.usr||null,r.state&&r.state.key||"default",o?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function n(i,r){return typeof r=="string"?r:Hr(r)}return fW(e,n,null,t)}function St(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Qn(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function hW(){return Math.random().toString(36).substring(2,10)}function MP(t,e){return{usr:t.state,key:t.key,idx:e,masked:t.mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function sm(t,e,n=null,i,r){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?sa(e):e,state:n,key:e&&e.key||i||hW(),mask:r}}function Hr({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function sa(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let i=t.indexOf("?");i>=0&&(e.search=t.substring(i),t=t.substring(0,i)),t&&(e.pathname=t)}return e}function fW(t,e,n,i={}){let{window:r=document.defaultView,v5Compat:o=!1}=i,l=r.history,u="POP",d=null,f=p();f==null&&(f=0,l.replaceState({...l.state,idx:f},""));function p(){return(l.state||{idx:null}).idx}function g(){u="POP";let S=p(),k=S==null?null:S-f;f=S,d&&d({action:u,location:x.location,delta:k})}function v(S,k){u="PUSH";let T=NP(S)?S:sm(x.location,S,k);f=p()+1;let C=MP(T,f),A=x.createHref(T.mask||T);try{l.pushState(C,"",A)}catch($){if($ instanceof DOMException&&$.name==="DataCloneError")throw $;r.location.assign(A)}o&&d&&d({action:u,location:x.location,delta:1})}function y(S,k){u="REPLACE";let T=NP(S)?S:sm(x.location,S,k);f=p();let C=MP(T,f),A=x.createHref(T.mask||T);l.replaceState(C,"",A),o&&d&&d({action:u,location:x.location,delta:0})}function b(S){return XD(r,S)}let x={get action(){return u},get location(){return t(r,l)},listen(S){if(d)throw new Error("A history only accepts one active listener");return r.addEventListener(PP,g),d=S,()=>{r.removeEventListener(PP,g),d=null}},createHref(S){return e(r,S)},createURL:b,encodeLocation(S){let k=b(S);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:v,replace:y,go(S){return l.go(S)}};return x}function XD(t,e,n=!1){let i="http://localhost";t&&(i=t.location.origin!=="null"?t.location.origin:t.location.href),St(i,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Hr(e);return r=r.replace(/ $/,"%20"),!n&&lw.test(r)&&(r=i+r),new URL(r,i)}var og,IP=class{constructor(t){if(sg(this,og,new Map),t)for(let[e,n]of t)this.set(e,n)}get(t){if(Ms(this,og).has(t))return Ms(this,og).get(t);if(t.defaultValue!==void 0)return t.defaultValue;throw new Error("No value found for context")}set(t,e){Ms(this,og).set(t,e)}};og=new WeakMap;
9var pW=new Set(["lazy","caseSensitive","path","id","index","children"]);function gW(t){return pW.has(t)}var mW=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function vW(t){return mW.has(t)}function yW(t){return t.index===!0}function om(t,e,n=[],i={},r=!1){return t.map((o,l)=>{let u=[...n,String(l)],d=typeof o.id=="string"?o.id:u.join("-");if(St(o.index!==!0||!o.children,"Cannot specify children on an index route"),St(r||!i[d],`Found a route id collision on id "${d}".  Route id's must be globally unique within Data Router usages`),yW(o)){let f={...o,id:d};return i[d]=zP(f,e(f)),f}else{let f={...o,id:d,children:void 0};return i[d]=zP(f,e(f)),o.children&&(f.children=om(o.children,e,u,i,r)),f}})}function zP(t,e){return Object.assign(t,{...e,...typeof e.lazy=="object"&&e.lazy!=null?{lazy:{...t.lazy,...e.lazy}}:{}})}function YD(t,e,n="/"){return ao(t,e,n,!1)}function ao(t,e,n,i,r){let o=typeof e=="string"?sa(e):e,l=Us(o.pathname||"/",n);if(l==null)return null;let u=r??Y0(t),d=null,f=iL(l);for(let p=0;d==null&&p<u.length;++p)d=RW(u[p],f,i);return d}function _W(t,e){let{route:n,pathname:i,params:r}=t;return{id:n.id,pathname:i,params:r,data:e[n.id],loaderData:e[n.id],handle:n.handle}}function Y0(t){let e=QD(t);return bW(e),e}function QD(t,e=[],n=[],i="",r=!1){let o=(l,u,d=r,f)=>{let p={relativePath:f===void 0?l.path||"":f,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(i)&&d)return;St(p.relativePath.startsWith(i),`Absolute route path "${p.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(i.length)}let g=Ds([i,p.relativePath]),v=n.concat(p);l.children&&l.children.length>0&&(St(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),QD(l.children,e,v,g,d)),!(l.path==null&&!l.index)&&e.push({path:g,score:CW(g,l.index),routesMeta:v.map((y,b)=>{let[x,S]=nL(y.relativePath,y.caseSensitive,b===v.length-1);return{...y,matcher:x,compiledParams:S}})})};return t.forEach((l,u)=>{if(l.path===""||!l.path?.includes("?"))o(l,u);else for(let d of eL(l.path))o(l,u,!0,d)}),e}function eL(t){let e=t.split("/");if(e.length===0)return[];let[n,...i]=e,r=n.endsWith("?"),o=n.replace(/\?$/,"");if(i.length===0)return r?[o,""]:[o];let l=eL(i.join("/")),u=[];return u.push(...l.map(d=>d===""?o:[o,d].join("/"))),r&&u.push(...l),u.map(d=>t.startsWith("/")&&d===""?"/":d)}function bW(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:OW(e.routesMeta.map(i=>i.childrenIndex),n.routesMeta.map(i=>i.childrenIndex)))}var wW=/^:[\w-]+$/,xW=3,SW=2,kW=1,EW=10,TW=-2,DP=t=>t==="*";function CW(t,e){let n=t.split("/"),i=n.length;return n.some(DP)&&(i+=TW),e&&(i+=SW),n.filter(r=>!DP(r)).reduce((r,o)=>r+(wW.test(o)?xW:o===""?kW:EW),i)}function OW(t,e){return t.length===e.length&&t.slice(0,-1).every((i,r)=>i===e[r])?t[t.length-1]-e[e.length-1]:0}function RW(t,e,n=!1){let{routesMeta:i}=t,r={},o="/",l=[];for(let u=0;u<i.length;++u){let d=i[u],f=u===i.length-1,p=o==="/"?e:e.slice(o.length)||"/",g={path:d.relativePath,caseSensitive:d.caseSensitive,end:f},v=d.matcher&&d.compiledParams?tL(g,p,d.matcher,d.compiledParams):am(g,p),y=d.route;if(!v&&f&&n&&!i[i.length-1].route.index&&(v=am({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},p)),!v)return null;
9Object.assign(r,v.params),l.push({params:r,pathname:Ds([o,v.pathname]),pathnameBase:jW(Ds([o,v.pathnameBase])),route:y}),v.pathnameBase!=="/"&&(o=Ds([o,v.pathnameBase]))}return l}function am(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,i]=nL(t.path,t.caseSensitive,t.end);return tL(t,e,n,i)}function tL(t,e,n,i){let r=e.match(n);if(!r)return null;let o=r[0],l=Kh(o,1),u=r.slice(1);return{params:i.reduce((f,{paramName:p,isOptional:g},v)=>{if(p==="*"){let b=u[v]||"";l=Kh(o.slice(0,o.length-b.length),1)}const y=u[v];return g&&!y?f[p]=void 0:f[p]=(y||"").replace(/%2F/g,"/"),f},{}),pathname:o,pathnameBase:l,pattern:t}}function nL(t,e=!1,n=!0){Qn(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let i=[],r="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,d,f,p)=>{if(i.push({paramName:u,isOptional:d!=null}),d){let g=p.charAt(f+l.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(i.push({paramName:"*"}),r+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":t!==""&&t!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),i]}function iL(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Qn(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function Us(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,i=t.charAt(n);return i&&i!=="/"?null:t.slice(n)||"/"}function $W({basename:t,pathname:e}){return e==="/"?t:Ds([t,e])}var cC=t=>aw.test(t);function AW(t,e="/"){let{pathname:n,search:i="",hash:r=""}=typeof t=="string"?sa(t):t,o;return n?(n=dC(n),n.startsWith("/")||n.startsWith("\\")?o=LP(n.substring(1),"/"):o=LP(n,e)):o=e,{pathname:o,search:PW(i),hash:NW(r)}}function LP(t,e){let n=Kh(e).split("/");return t.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function $k(t,e,n,i){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(i)}].  Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function rL(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function uC(t){let e=rL(t);return e.map((n,i)=>i===e.length-1?n.pathname:n.pathnameBase)}function cw(t,e,n,i=!1){let r;typeof t=="string"?r=sa(t):(r={...t},St(!r.pathname||!r.pathname.includes("?"),$k("?","pathname","search",r)),St(!r.pathname||!r.pathname.includes("#"),$k("#","pathname","hash",r)),St(!r.search||!r.search.includes("#"),$k("#","search","hash",r)));let o=t===""||r.pathname==="",l=o?"/":r.pathname,u;if(l==null)u=n;else{let g=e.length-1;if(!i&&l.startsWith("..")){let v=l.split("/");for(;v[0]==="..";)v.shift(),g-=1;r.pathname=v.join("/")}u=g>=0?e[g]:"/"}let d=AW(r,u),f=l&&l!=="/"&&l.endsWith("/"),p=(o||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||p)&&(d.pathname+="/"),d}var dC=t=>t.replace(/[\\/]{2,}/g,"/"),Ds=t=>dC(t.join("/"));function Kh(t,e=0){let n=t.length;for(;n>e&&t.charCodeAt(n-1)===47;)n--;return n===t.length?t:t.slice(0,n)}var jW=t=>Kh(t).replace(/^\/*/,"/"),PW=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,NW=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,MW=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Fm=class{constructor(t,e,n,i=!1){this.status=t,this.statusText=e||"",this.internal=i,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function lm(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function Hm(t){let e=t.map(n=>
9n.route.path).filter(Boolean);return Ds(e)||"/"}var sL=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function oL(t,e){let n=t;if(typeof n!="string"||!aw.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let i=n,r=!1;if(sL)try{let o=new URL(window.location.href),l=lw.test(n)?new URL(JD(n,o.protocol)):new URL(n),u=Us(l.pathname,e);l.origin===o.origin&&u!=null?n=u+l.search+l.hash:r=!0}catch{Qn(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:r,to:n}}var Jl=Symbol("Uninstrumented");function IW(t,e){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};t.forEach(r=>r({id:e.id,index:e.index,path:e.path,instrument(o){let l=Object.keys(n);for(let u of l)o[u]&&n[u].push(o[u])}}));let i={};if(typeof e.lazy=="function"&&n.lazy.length>0){let r=gh(n.lazy,e.lazy,()=>{});r&&(i.lazy=r)}if(typeof e.lazy=="object"){let r=e.lazy;["middleware","loader","action"].forEach(o=>{let l=r[o],u=n[`lazy.${o}`];if(typeof l=="function"&&u.length>0){let d=gh(u,l,()=>{});d&&(i.lazy=Object.assign(i.lazy||{},{[o]:d}))}})}return["loader","action"].forEach(r=>{let o=e[r];if(typeof o=="function"&&n[r].length>0){let l=o[Jl]??o,u=gh(n[r],l,(...d)=>UP(d[0]));u&&(r==="loader"&&l.hydrate===!0&&(u.hydrate=!0),u[Jl]=l,i[r]=u)}}),e.middleware&&e.middleware.length>0&&n.middleware.length>0&&(i.middleware=e.middleware.map(r=>{let o=r[Jl]??r,l=gh(n.middleware,o,(...u)=>UP(u[0]));return l?(l[Jl]=o,l):r})),i}function zW(t,e){let n={navigate:[],fetch:[]};if(e.forEach(i=>i({instrument(r){let o=Object.keys(r);for(let l of o)r[l]&&n[l].push(r[l])}})),n.navigate.length>0){let i=t.navigate[Jl]??t.navigate,r=gh(n.navigate,i,(...o)=>{let[l,u]=o;return{to:typeof l=="number"||typeof l=="string"?l:l?Hr(l):".",...FP(t,u??{})}});r&&(r[Jl]=i,t.navigate=r)}if(n.fetch.length>0){let i=t.fetch[Jl]??t.fetch,r=gh(n.fetch,i,(...o)=>{let[l,,u,d]=o;return{href:u??".",fetcherKey:l,...FP(t,d??{})}});r&&(r[Jl]=i,t.fetch=r)}return t}function gh(t,e,n){return t.length===0?null:async(...i)=>{let r=await aL(t,n(...i),()=>e(...i),t.length-1);if(r.type==="error")throw r.value;return r.value}}async function aL(t,e,n,i){let r=t[i],o;if(r){let l,u=async()=>(l?console.error("You cannot call instrumented handlers more than once"):l=aL(t,e,n,i-1),o=await l,St(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await r(u,e)}catch(d){console.error("An instrumentation function threw an error:",d)}l||await u(),await l}else try{o={type:"success",value:await n()}}catch(l){o={type:"error",value:l}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function UP(t){let{request:e,context:n,params:i,pattern:r}=t;return{request:DW(e),params:{...i},pattern:r,context:LW(n)}}function FP(t,e){return{currentUrl:Hr(t.state.location),..."formMethod"in e?{formMethod:e.formMethod}:{},..."formEncType"in e?{formEncType:e.formEncType}:{},..."formData"in e?{formData:e.formData}:{},..."body"in e?{body:e.body}:{}}}function DW(t){return{method:t.method,url:t.url,headers:{get:(...e)=>t.headers.get(...e)}}}function LW(t){if(FW(t)){let e={...t};return Object.freeze(e),e}else return{get:e=>t.get(e)}}var UW=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function FW(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null||Object.getOwnPropertyNames(e).sort().join("\0")===UW}var HP=new URL("http://localhost");function lL(t){if(t.createURL)return t.createURL("/");try{return new URL(t.createHref("/"),HP)}catch{return HP}}function Ak(t,e){return t.origin===e.origin&&(t.origin!=="null"||t.protocol===e.protocol&&t.host===e.host)}function HW(t,e){if(t.startsWith("//"))return!0;let n=e.protocol.toLowerCase();return t.toLowerCase().startsWith(n)?e.host===""||t.slice(n.length).startsWith("//"):!1}function Tg(t,e,n,i){let r=null;try{r=t==null?null:new URL(t,n)}catch{}let o=new URL(e,n),l=r!=null&&!Ak(r,n),u=!Ak(o,n);if(i==="reject"){if(l||u)throw new Error("External navigation is not allowed")}else if(u&&(r==null||!HW(t,r)||!Ak(r,o)))throw new Error("External navigation is not allowed")}var cL=["POST","PUT","PATCH","DELETE"],KW=new Set(cL),ZW=["GET",...cL],WW=new Set(ZW),uL=new Set([301,302,303,307,308]),qW=new Set([307,308]),jk={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},VW={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},hp={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},BW=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),dL="remix-router-transitions",hL=Symbol("ResetLoaderData"),Xc,oh,zl,ah,GW=class{constructor(t){sg(this,Xc),sg(this,oh),sg(this,zl),sg(this,ah),Ho(this,Xc,t),Ho(this,oh,Y0(t))}get stableRoutes(){return Ms(this,Xc)}get activeRoutes(){return Ms(this,zl)??Ms(this,Xc)}get branches(){return Ms(this,ah)??Ms(this,oh)}get hasHMRRoutes(){return Ms(this,zl)!=null}setRoutes(t){Ho(this,Xc,t),Ho(this,oh,Y0(t))}setHmrRoutes(t){Ho(this,zl,t),Ho(this,ah,Y0(t))}commitHmrRoutes(){Ms(this,zl)&&(Ho(this,Xc,Ms(this,zl)),Ho(this,oh,Ms(this,ah)),Ho(this,zl,void 0),Ho(this,ah,void 0))}};Xc=new WeakMap;oh=new WeakMap;zl=new WeakMap;ah=new WeakMap;function JW(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u";St(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let i=t.hydrationRouteProperties||[],r=t.mapRouteProperties||BW,o=r;if(t.instrumentations){let D=t.instrumentations;o=H=>({...r(H),...IW(D.map(ie=>
9ie.route).filter(Boolean),H)})}let l={},u=new GW(om(t.routes,o,void 0,l)),d=t.basename||"/";d.startsWith("/")||(d=`/${d}`);let f=t.dataStrategy||tq,p={...t.future},g=null,v=new Set,y=null,b=null,x=null,S=null,k=t.hydrationData!=null,T=ao(u.activeRoutes,t.history.location,d,!1,u.branches),C=!1,A=null,$,N;if(T==null&&!t.patchRoutesOnNavigation){let D=Is(404,{pathname:t.history.location.pathname}),{matches:H,route:ie}=Ly(u.activeRoutes);$=!0,N=!$,T=H,A={[ie.id]:D}}else if(T&&!t.hydrationData&&fr(T,u.activeRoutes,t.history.location.pathname).active&&(T=null),T)if(T.some(D=>D.route.lazy))$=!1,N=!$;else if(!T.some(D=>hC(D.route)))$=!0,N=!$;else{let D=t.hydrationData?t.hydrationData.loaderData:null,H=t.hydrationData?t.hydrationData.errors:null,ie=T;if(H){let ve=T.findIndex(ye=>H[ye.route.id]!==void 0);ie=ie.slice(0,ve+1)}N=!1,$=!0,ie.forEach(ve=>{let ye=fL(ve.route,D,H);N=N||ye.renderFallback,$=$&&!ye.shouldLoad})}else{$=!1,N=!$,T=[];let D=fr(null,u.activeRoutes,t.history.location.pathname);D.active&&D.matches&&(C=!0,T=D.matches)}let j,O={historyAction:t.history.action,location:t.history.location,matches:T,initialized:$,renderFallback:N,navigation:jk,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||A,fetchers:new Map,blockers:new Map},L="POP",B=null,V=!1,ee,me=!1,ne=new Map,ce=null,Z=!1,ae=!1,ue=new Set,ge=new Map,Re=0,xe=-1,Ie=new Map,Oe=new Set,P=new Map,F=new Map,re=new Set,Y=new Map,de,ke=null;function Ae(){if(g=t.history.listen(({action:D,location:H,delta:ie})=>{if(de){de(),de=void 0;return}Qn(Y.size===0||ie!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs.  This can also happen if you are using createHashRouter and the user manually changes the URL.");let ve=To({currentLocation:O.location,nextLocation:H,historyAction:D});if(ve&&ie!=null){let ye=new Promise(We=>{de=We});t.history.go(ie*-1),Gr(ve,{state:"blocked",location:H,proceed(){Gr(ve,{state:"proceeding",proceed:void 0,reset:void 0,location:H}),ye.then(()=>t.history.go(ie))},reset(){let We=new Map(O.blockers);We.set(ve,hp),je({blockers:We})}}),B?.resolve(),B=null;return}return ze(D,H)}),n){bq(e,ne);let D=()=>wq(e,ne);e.addEventListener("pagehide",D),ce=()=>e.removeEventListener("pagehide",D)}return O.initialized||ze("POP",O.location,{initialHydration:!0}),j}function Se(){g&&g(),ce&&ce(),v.clear(),ee&&ee.abort(),O.fetchers.forEach((D,H)=>ys(O.fetchers,H)),O.blockers.forEach((D,H)=>tl(H))}function oe(D){if(v.add(D),y){let{newErrors:H}=y;y=null,D(O,{deletedFetchers:[],newErrors:H,viewTransitionOpts:void 0,flushSync:!1})}return()=>v.delete(D)}function je(D,H={}){D.matches&&(D.matches=D.matches.map(ye=>{let We=l[ye.route.id],Ke=ye.route;return Ke.element!==We.element||Ke.errorElement!==We.errorElement||Ke.hydrateFallbackElement!==We.hydrateFallbackElement?{...ye,route:We}:ye})),O={...O,...D};let ie=[],ve=[];O.fetchers.forEach((ye,We)=>{ye.state==="idle"&&(re.has(We)?ie.push(We):ve.push(We))}),re.forEach(ye=>{!O.fetchers.has(ye)&&!ge.has(ye)&&ie.push(ye)}),v.size===0&&(y={newErrors:D.errors??null}),[...v].forEach(ye=>ye(O,{deletedFetchers:ie,newErrors:D.errors??null,viewTransitionOpts:H.viewTransitionOpts,flushSync:H.flushSync===!0})),ie.forEach(ye=>ys(O.fetchers,ye)),ve.forEach(ye=>O.fetchers.delete(ye))}function $e(D,H,{flushSync:ie}={}){let ve=O.actionData!=null&&O.navigation.formMethod!=null&&nr(O.navigation.formMethod)&&O.navigation.state==="loading"&&D.state?._isRedirect!==!0,ye;H.actionData?Object.keys(H.actionData).length>0?ye=H.actionData:ye=null:ve?ye=O.actionData:ye=null;let We=H.loaderData?YP(O.loaderData,H.loaderData,H.matches||[],H.errors):O.loaderData,Ke=O.blockers;Ke.size>0&&(Ke=new Map(Ke),Ke.forEach((Xe,dt)=>Ke.set(dt,hp)));let Be=Z?!1:Jr(D,H.matches||O.matches),Ze=V===!0||O.navigation.formMethod!=null&&nr(O.navigation.formMethod)&&D.state?._isRedirect!==!0;u.commitHmrRoutes(),Z||L==="POP"||(L==="PUSH"?t.history.push(D,D.state):L==="REPLACE"&&t.history.replace(D,D.state));let rt;if(L==="POP"&&!Z&&D!==O.location){let Xe=ne.get(O.location.pathname);Xe&&Xe.has(D.pathname)?rt={currentLocation:O.location,nextLocation:D}:ne.has(D.pathname)&&(rt={currentLocation:D,nextLocation:O.location})}else if(me){let Xe=ne.get(O.location.pathname);Xe?Xe.add(D.pathname):(Xe=new Set([D.pathname]),ne.set(O.location.pathname,Xe)),rt={currentLocation:O.location,nextLocation:D}}je({...H,actionData:ye,loaderData:We,historyAction:L,location:D,initialized:!0,renderFallback:!1,navigation:jk,revalidation:"idle",restoreScrollPosition:Be,preventScrollReset:Ze,blockers:Ke},{viewTransitionOpts:rt,flushSync:ie===!0}),L="POP",V=!1,me=!1,Z=!1,ae=!1,B?.resolve(),B=null,ke?.resolve(),ke=null}async function Le(D,H){if(B?.resolve(),B=null,typeof D=="number"){B||(B=nN());let nn=B.promise;return t.history.go(D),nn}let ie=UE(O.location,O.matches,d,D,H?.fromRouteId,H?.relative),{path:ve,submission:ye,error:We}=KP(!1,ie,H),Ke;
9if(H?.mask){let nn=typeof H.mask=="string"?sa(H.mask):{...O.location.mask,...H.mask};if(Ke={pathname:nn.pathname??"",search:nn.search??"",hash:nn.hash??""},lw.test(Ke.pathname))throw new Error("External navigation is not allowed");Ke.pathname.startsWith("\\")&&(Ke.pathname=Ke.pathname.replace(/^\\+/,"/")),Tg(typeof H.mask=="string"?H.mask:Hr(H.mask),Hr(Ke),t.history.createURL("/"),"reject")}let Be=O.location,Ze=sm(Be,ve,H&&H.state,void 0,Ke);Ze={...Ze,...t.history.encodeLocation(Ze)},Tg(D==null?t.history.createHref(O.location):typeof D=="string"?D:Hr(D),t.history.createHref(Ze.mask||Ze),t.history.createURL("/"),"reject");let rt=H&&H.replace!=null?H.replace:void 0,Xe="PUSH";rt===!0?Xe="REPLACE":rt===!1||ye!=null&&nr(ye.formMethod)&&ye.formAction===O.location.pathname+O.location.search&&(Xe="REPLACE");let dt=H&&"preventScrollReset"in H?H.preventScrollReset===!0:void 0,nt=(H&&H.flushSync)===!0,Bt=To({currentLocation:Be,nextLocation:Ze,historyAction:Xe});if(Bt){Gr(Bt,{state:"blocked",location:Ze,proceed(){Gr(Bt,{state:"proceeding",proceed:void 0,reset:void 0,location:Ze}),Le(D,H)},reset(){let nn=new Map(O.blockers);nn.set(Bt,hp),je({blockers:nn})}});return}await ze(Xe,Ze,{submission:ye,pendingError:We,preventScrollReset:dt,replace:H&&H.replace,enableViewTransition:H&&H.viewTransition,flushSync:nt,callSiteDefaultShouldRevalidate:H&&H.defaultShouldRevalidate})}function Pe(){ke||(ke=nN()),hr(),je({revalidation:"loading"});let D=ke.promise;return O.navigation.state==="submitting"?D:O.navigation.state==="idle"?(ze(O.historyAction,O.location,{startUninterruptedRevalidation:!0}),D):(ze(L||O.historyAction,O.navigation.location,{overrideNavigation:O.navigation,enableViewTransition:me===!0}),D)}async function ze(D,H,ie){ee&&ee.abort(),ee=null,L=D,Z=(ie&&ie.startUninterruptedRevalidation)===!0,ua(O.location,O.matches),V=(ie&&ie.preventScrollReset)===!0,me=(ie&&ie.enableViewTransition)===!0;let ve=u.activeRoutes,ye=ie?.initialHydration&&O.matches&&O.matches.length>0&&!C?O.matches:ao(ve,H,d,!1,u.branches),We=(ie&&ie.flushSync)===!0;if(ye&&O.initialized&&!ae&&uq(O.location,H)&&!(ie&&ie.submission&&nr(ie.submission.formMethod))){$e(H,{matches:ye},{flushSync:We});return}let Ke=fr(ye,ve,H.pathname);if(Ke.active&&Ke.matches&&(ye=Ke.matches),!ye){let{error:Gt,notFoundMatches:Dt,route:ki}=_s(H.pathname);$e(H,{matches:Dt,loaderData:{},errors:{[ki.id]:Gt}},{flushSync:We});return}let Be=ie&&ie.overrideNavigation?{...ie.overrideNavigation,matches:ye,historyAction:D}:void 0;ee=new AbortController;let Ze=lh(t.history,H,ee.signal,ie&&ie.submission),rt=t.getContext?await t.getContext():new IP,Xe;if(ie&&ie.pendingError)Xe=[ql(ye).route.id,{type:"error",error:ie.pendingError}];else if(ie&&ie.submission&&nr(ie.submission.formMethod)){let Gt=await Ge(Ze,H,ie.submission,ye,D,rt,Ke.active,ie&&ie.initialHydration===!0,{replace:ie.replace,flushSync:We});if(Gt.shortCircuited)return;if(Gt.pendingActionResult){let[Dt,ki]=Gt.pendingActionResult;if(as(ki)&&lm(ki.error)&&ki.error.status===404){ee=null,$e(H,{matches:Gt.matches,loaderData:{},errors:{[Dt]:ki.error}});return}}ye=Gt.matches||ye,Xe=Gt.pendingActionResult,Be=Pk(H,ye,D,ie.submission),We=!1,Ke.active=!1,Ze=lh(t.history,Ze.url,Ze.signal)}let{shortCircuited:dt,matches:nt,loaderData:Bt,errors:nn,workingFetchers:Bn}=await vt(Ze,H,ye,D,rt,Ke.active,Be,ie&&ie.submission,ie&&ie.fetcherSubmission,ie&&ie.replace,ie&&ie.initialHydration===!0,We,Xe,ie&&ie.callSiteDefaultShouldRevalidate);dt||(ee=null,$e(H,{matches:nt||ye,...QP(Xe),loaderData:Bt,errors:nn,...Bn?{fetchers:Bn}:{}}))}async function Ge(D,H,ie,ve,ye,We,Ke,Be,Ze={}){hr();let rt=yq(H,ve,ye,ie);if(je({navigation:rt},{flushSync:Ze.flushSync===!0}),Ke){let nt=await ti(ve,H.pathname,D.signal);if(nt.type==="aborted")return{shortCircuited:!0};if(nt.type==="error"){if(nt.partialMatches.length===0){let{matches:nn,route:Bn}=Ly(u.activeRoutes);return{matches:nn,pendingActionResult:[Bn.id,{type:"error",error:nt.error}]}}let Bt=ql(nt.partialMatches).route.id;return{matches:nt.partialMatches,pendingActionResult:[Bt,{type:"error",error:nt.error}]}}else if(nt.matches)ve=nt.matches;else{let{notFoundMatches:Bt,error:nn,route:Bn}=_s(H.pathname);return{matches:Bt,pendingActionResult:[Bn.id,{type:"error",error:nn}]}}}
9let Xe,dt=Q0(ve,H);if(!dt.route.action&&!dt.route.lazy)Xe={type:"error",error:Is(405,{method:D.method,pathname:H.pathname,routeId:dt.route.id})};else{let nt=Rh(o,l,D,H,ve,dt,Be?[]:i,We),Bt=await bn(D,H,nt,We,null);if(Xe=Bt[dt.route.id],!Xe){for(let nn of ve)if(Bt[nn.route.id]){Xe=Bt[nn.route.id];break}}if(D.signal.aborted)return{shortCircuited:!0}}if(du(Xe)){let nt;return Ze&&Ze.replace!=null?nt=Ze.replace:nt=GP(Xe.response.headers.get("Location"),new URL(D.url),d,t.history)===O.location.pathname+O.location.search,await kt(D,Xe,!0,{submission:ie,replace:nt}),{shortCircuited:!0}}if(as(Xe)){let nt=ql(ve,dt.route.id);return(Ze&&Ze.replace)!==!0&&(L="PUSH"),{matches:ve,pendingActionResult:[nt.route.id,Xe,dt.route.id]}}return{matches:ve,pendingActionResult:[dt.route.id,Xe]}}async function vt(D,H,ie,ve,ye,We,Ke,Be,Ze,rt,Xe,dt,nt,Bt){let nn=Ke||Pk(H,ie,ve,Be),Bn=Be||Ze||tN(nn),Gt=!Z&&!Xe;if(We){if(Gt){let ci=en(nt);je({navigation:nn,...ci!==void 0?{actionData:ci}:{}},{flushSync:dt})}let Et=await ti(ie,H.pathname,D.signal);if(Et.type==="aborted")return{shortCircuited:!0};if(Et.type==="error"){if(Et.partialMatches.length===0){let{matches:Ti,route:er}=Ly(u.activeRoutes);return{matches:Ti,loaderData:{},errors:{[er.id]:Et.error}}}let ci=ql(Et.partialMatches).route.id;return{matches:Et.partialMatches,loaderData:{},errors:{[ci]:Et.error}}}else if(Et.matches)ie=Et.matches;else{let{error:ci,notFoundMatches:Ti,route:er}=_s(H.pathname);return{matches:Ti,loaderData:{},errors:{[er.id]:ci}}}}let Dt=u.activeRoutes,{dsMatches:ki,revalidatingFetchers:zi}=ZP(D,ye,o,l,t.history,O,ie,Bn,H,Xe?[]:i,Xe===!0,ae,ue,re,P,Oe,Dt,d,t.patchRoutesOnNavigation!=null,u.branches,nt,Bt);if(xe=++Re,!t.dataStrategy&&!ki.some(Et=>Et.shouldLoad)&&!ki.some(Et=>Et.route.middleware&&Et.route.middleware.length>0)&&zi.length===0){let Et=new Map(O.fetchers),ci=el(Et);return $e(H,{matches:ie,loaderData:{},errors:nt&&as(nt[1])?{[nt[0]]:nt[1].error}:null,...QP(nt),...ci?{fetchers:Et}:{}},{flushSync:dt}),{shortCircuited:!0}}if(Gt){let Et={};if(!We){Et.navigation=nn;let ci=en(nt);ci!==void 0&&(Et.actionData=ci)}zi.length>0&&(Et.fetchers=yt(zi)),je(Et,{flushSync:dt})}zi.forEach(Et=>{Mi(Et.key),Et.controller&&ge.set(Et.key,Et.controller)});let rl=()=>zi.forEach(Et=>Mi(Et.key));ee&&ee.signal.addEventListener("abort",rl);let{loaderResults:Ei,fetcherResults:jn}=await Kn(ki,zi,D,H,ye);if(D.signal.aborted)return{shortCircuited:!0};ee&&ee.signal.removeEventListener("abort",rl),zi.forEach(Et=>ge.delete(Et.key));let Zn=Uy(Ei);if(Zn)return await kt(D,Zn.result,!0,{replace:rt}),{shortCircuited:!0};if(Zn=Uy(jn),Zn)return Oe.add(Zn.key),await kt(D,Zn.result,!0,{replace:rt}),{shortCircuited:!0};let Di=new Map(O.fetchers),{loaderData:qu,errors:Co}=XP(O,ie,Ei,nt,zi,jn,Di);Xe&&O.errors&&(Co={...O.errors,...Co});let Vu=el(Di),yc=Ii(xe,Di),Oo=Vu||yc||zi.length>0;return{matches:ie,loaderData:qu,errors:Co,...Oo?{workingFetchers:Di}:{}}}function en(D){if(D&&!as(D[1]))return{[D[0]]:D[1].data};if(O.actionData)return Object.keys(O.actionData).length===0?null:O.actionData}function yt(D){let H=new Map(O.fetchers);return D.forEach(ie=>{let ve=H.get(ie.key),ye=fp(void 0,ve?ve.data:void 0);H.set(ie.key,ye)}),H}async function Kt(D,H,ie,ve){Mi(D);let ye=(ve&&ve.flushSync)===!0,We=u.activeRoutes,Ke=UE(O.location,O.matches,d,ie,H,ve?.relative),Be=ao(We,Ke,d,!1,u.branches),Ze=fr(Be,We,Ke);if(Ze.active&&Ze.matches&&(Be=Ze.matches),!Be){Si(D,H,Is(404,{pathname:Ke}),{flushSync:ye});return}let{path:rt,submission:Xe,error:dt}=KP(!0,Ke,ve);if(dt){Si(D,H,dt,{flushSync:ye});return}let nt=t.getContext?await t.getContext():new IP,Bt=(ve&&ve.preventScrollReset)===!0;if(Xe&&nr(Xe.formMethod)){await tn(D,H,rt,Be,nt,Ze.active,ye,Bt,Xe,ve&&ve.defaultShouldRevalidate);return}P.set(D,{routeId:H,path:rt}),await Xn(D,H,rt,Be,nt,Ze.active,ye,Bt,Xe)}async function tn(D,H,ie,ve,ye,We,Ke,Be,Ze,rt){hr(),P.delete(D);let Xe=O.fetchers.get(D);An(D,_q(Ze,Xe),{flushSync:Ke});let dt=new AbortController,nt=lh(t.history,ie,dt.signal,Ze);if(We){let _t=await ti(ve,new URL(nt.url).pathname,nt.signal,D);if(_t.type==="aborted")return;if(_t.type==="error"){Si(D,H,_t.error,{flushSync:Ke});return}else if(_t.matches)ve=_t.matches;else{Si(D,H,Is(404,{pathname:ie}),{flushSync:Ke});return}}let Bt=Q0(ve,ie);
9if(!Bt.route.action&&!Bt.route.lazy){let _t=Is(405,{method:Ze.formMethod,pathname:ie,routeId:H});Si(D,H,_t,{flushSync:Ke});return}ge.set(D,dt);let nn=Re,Bn=Rh(o,l,nt,ie,ve,Bt,i,ye),Gt=await bn(nt,ie,Bn,ye,D),Dt=Gt[Bt.route.id];if(!Dt){for(let _t of Bn)if(Gt[_t.route.id]){Dt=Gt[_t.route.id];break}}if(nt.signal.aborted){ge.get(D)===dt&&ge.delete(D);return}if(re.has(D)){if(du(Dt)||as(Dt)){An(D,Zo(void 0));return}}else{if(du(Dt))if(ge.delete(D),xe>nn){An(D,Zo(void 0));return}else return Oe.add(D),An(D,fp(Ze)),kt(nt,Dt,!1,{fetcherSubmission:Ze,preventScrollReset:Be});if(as(Dt)){Si(D,H,Dt.error);return}}let ki=O.navigation.location||O.location,zi=lh(t.history,ki,dt.signal),rl=u.activeRoutes,Ei=O.navigation.state!=="idle"?ao(rl,O.navigation.location,d,!1,u.branches):O.matches;St(Ei,"Didn't find any matches after fetcher action");let jn=++Re;Ie.set(D,jn);let{dsMatches:Zn,revalidatingFetchers:Di}=ZP(zi,ye,o,l,t.history,O,Ei,Ze,ki,i,!1,ae,ue,re,P,Oe,rl,d,t.patchRoutesOnNavigation!=null,u.branches,[Bt.route.id,Dt],rt),qu=fp(Ze,Dt.data),Co=new Map(O.fetchers);Co.set(D,qu),Di.filter(_t=>_t.key!==D).forEach(_t=>{let $o=_t.key,wf=Co.get($o),yv=fp(void 0,wf?wf.data:void 0);Co.set($o,yv),Mi($o),_t.controller&&ge.set($o,_t.controller)}),je({fetchers:Co});let Vu=()=>Di.forEach(_t=>Mi(_t.key));dt.signal.addEventListener("abort",Vu);let{loaderResults:yc,fetcherResults:Oo}=await Kn(Zn,Di,zi,ki,ye);if(dt.signal.aborted)return;dt.signal.removeEventListener("abort",Vu),Ie.delete(D),ge.delete(D),Di.forEach(_t=>ge.delete(_t.key));let Et=O.fetchers.has(D),ci=_t=>{if(!Et)return _t;let $o=new Map(_t.fetchers);return $o.set(D,Zo(Dt.data)),{..._t,fetchers:$o}},Ti=Uy(yc);if(Ti)return O=ci(O),kt(zi,Ti.result,!1,{preventScrollReset:Be});if(Ti=Uy(Oo),Ti)return Oe.add(Ti.key),O=ci(O),kt(zi,Ti.result,!1,{preventScrollReset:Be});let er=new Map(O.fetchers);Et&&er.set(D,Zo(Dt.data));let{loaderData:sl,errors:Ro}=XP(O,Ei,yc,void 0,Di,Oo,er);Ii(jn,er),O.navigation.state==="loading"&&jn>xe?(St(L,"Expected pending action"),ee&&ee.abort(),$e(O.navigation.location,{matches:Ei,loaderData:sl,errors:Ro,fetchers:er})):(je({errors:Ro,loaderData:YP(O.loaderData,sl,Ei,Ro),fetchers:er}),ae=!1)}async function Xn(D,H,ie,ve,ye,We,Ke,Be,Ze){let rt=O.fetchers.get(D);An(D,fp(Ze,rt?rt.data:void 0),{flushSync:Ke});let Xe=new AbortController,dt=lh(t.history,ie,Xe.signal);if(We){let Dt=await ti(ve,new URL(dt.url).pathname,dt.signal,D);if(Dt.type==="aborted")return;if(Dt.type==="error"){Si(D,H,Dt.error,{flushSync:Ke});return}else if(Dt.matches)ve=Dt.matches;else{Si(D,H,Is(404,{pathname:ie}),{flushSync:Ke});return}}let nt=Q0(ve,ie);ge.set(D,Xe);let Bt=Re,nn=Rh(o,l,dt,ie,ve,nt,i,ye),Bn=await bn(dt,ie,nn,ye,D),Gt=Bn[nt.route.id];if(!Gt){for(let Dt of ve)if(Bn[Dt.route.id]){Gt=Bn[Dt.route.id];break}}if(ge.get(D)===Xe&&ge.delete(D),!dt.signal.aborted){if(re.has(D)){An(D,Zo(void 0));return}if(du(Gt))if(xe>Bt){An(D,Zo(void 0));return}else{Oe.add(D),await kt(dt,Gt,!1,{preventScrollReset:Be});return}if(as(Gt)){Si(D,H,Gt.error);return}An(D,Zo(Gt.data))}}async function kt(D,H,ie,{submission:ve,fetcherSubmission:ye,preventScrollReset:We,replace:Ke}={}){ie||(B?.resolve(),B=null),H.response.headers.has("X-Remix-Revalidate")&&(ae=!0);let Be=H.response.headers.get("Location");St(Be,"Expected a Location header on the redirect Response");let Ze=Be,rt=new URL(D.url);Be=GP(Be,rt,d,t.history),Tg(Ze,Be,rt,"allow-explicit");let Xe=sm(O.location,Be,{_isRedirect:!0});if(n){let Gt=!1;if(H.response.headers.has("X-Remix-Reload-Document"))Gt=!0;else if(cC(Be)){const Dt=XD(e,Be,!0);Gt=Dt.origin!==e.location.origin||Us(Dt.pathname,d)==null}if(Gt){Ke?e.location.replace(Be):e.location.assign(Be);return}}ee=null;let dt=Ke===!0||H.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:nt,formAction:Bt,formEncType:nn}=O.navigation;!ve&&!ye&&nt&&Bt&&nn&&(ve=tN(O.navigation));let Bn=ve||ye;if(qW.has(H.response.status)&&Bn&&nr(Bn.formMethod))await ze(dt,Xe,{submission:{...Bn,formAction:Be},preventScrollReset:We||V,enableViewTransition:ie?me:void 0});else{let Gt=Pk(Xe,[],dt,ve);await ze(dt,Xe,{overrideNavigation:Gt,fetcherSubmission:ye,preventScrollReset:We||V,enableViewTransition:ie?me:void 0})}}async function bn(D,H,ie,ve,ye){let We,Ke={};try{We=await iq(f,D,H,ie,ye,ve,!1)}catch(Be){return ie.filter(Ze=>
9Ze.shouldLoad).forEach(Ze=>{Ke[Ze.route.id]={type:"error",error:Be}}),Ke}if(D.signal.aborted)return Ke;if(!nr(D.method))for(let Be of ie){if(We[Be.route.id]?.type==="error")break;!We.hasOwnProperty(Be.route.id)&&!O.loaderData.hasOwnProperty(Be.route.id)&&(!O.errors||!O.errors.hasOwnProperty(Be.route.id))&&Be.shouldCallHandler()&&(We[Be.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Be.route.id}`)})}for(let[Be,Ze]of Object.entries(We))if(pq(Ze)){let rt=Ze.result;Ke[Be]={type:"redirect",response:aq(rt,D,Be,ie,d)}}else Ke[Be]=await oq(Ze);return Ke}async function Kn(D,H,ie,ve,ye){let We=bn(ie,ve,D,ye,null),Ke=Promise.all(H.map(async rt=>{if(rt.matches&&rt.match&&rt.request&&rt.controller){let dt=(await bn(rt.request,rt.path,rt.matches,ye,rt.key))[rt.match.route.id];return{[rt.key]:dt}}else return Promise.resolve({[rt.key]:{type:"error",error:Is(404,{pathname:rt.path})}})})),Be=await We,Ze=(await Ke).reduce((rt,Xe)=>Object.assign(rt,Xe),{});return{loaderResults:Be,fetcherResults:Ze}}function hr(){ae=!0,P.forEach((D,H)=>{ge.has(H)&&ue.add(H),Mi(H)})}function An(D,H,ie={}){let ve=new Map(O.fetchers);ve.set(D,H),je({fetchers:ve},{flushSync:(ie&&ie.flushSync)===!0})}function Si(D,H,ie,ve={}){let ye=ql(O.matches,H),We=new Map(O.fetchers);ys(We,D),je({errors:{[ye.route.id]:ie},fetchers:We},{flushSync:(ve&&ve.flushSync)===!0})}function Eo(D){return F.set(D,(F.get(D)||0)+1),re.has(D)&&re.delete(D),O.fetchers.get(D)||VW}function Bs(D,H){Mi(D,H?.reason),An(D,Zo(null))}function ys(D,H){let ie=O.fetchers.get(H);ge.has(H)&&!(ie&&ie.state==="loading"&&Ie.has(H))&&Mi(H),P.delete(H),Ie.delete(H),Oe.delete(H),re.delete(H),ue.delete(H),D.delete(H)}function ca(D){let H=(F.get(D)||0)-1;H<=0?(F.delete(D),re.add(D)):F.set(D,H),je({fetchers:new Map(O.fetchers)})}function Mi(D,H){let ie=ge.get(D);ie&&(ie.abort(H),ge.delete(D))}function Gs(D,H){for(let ie of D){let ve=H.get(ie);St(ve,`Expected fetcher: ${ie}`);let ye=Zo(ve.data);H.set(ie,ye)}}function el(D){let H=[],ie=!1;for(let ve of Oe){let ye=D.get(ve);St(ye,`Expected fetcher: ${ve}`),ye.state==="loading"&&(Oe.delete(ve),H.push(ve),ie=!0)}return Gs(H,D),ie}function Ii(D,H){let ie=[];for(let[ve,ye]of Ie)if(ye<D){let We=H.get(ve);St(We,`Expected fetcher: ${ve}`),We.state==="loading"&&(Mi(ve),Ie.delete(ve),ie.push(ve))}return Gs(ie,H),ie.length>0}function ei(D,H){let ie=O.blockers.get(D)||hp;return Y.get(D)!==H&&Y.set(D,H),ie}function tl(D){O.blockers.delete(D),Y.delete(D)}function Gr(D,H){let ie=O.blockers.get(D)||hp;St(ie.state==="unblocked"&&H.state==="blocked"||ie.state==="blocked"&&H.state==="blocked"||ie.state==="blocked"&&H.state==="proceeding"||ie.state==="blocked"&&H.state==="unblocked"||ie.state==="proceeding"&&H.state==="unblocked",`Invalid blocker state transition: ${ie.state} -> ${H.state}`);let ve=new Map(O.blockers);ve.set(D,H),je({blockers:ve})}function To({currentLocation:D,nextLocation:H,historyAction:ie}){if(Y.size===0)return;Y.size>1&&Qn(!1,"A router only supports one blocker at a time");let ve=Array.from(Y.entries()),[ye,We]=ve[ve.length-1],Ke=O.blockers.get(ye);if(!(Ke&&Ke.state==="proceeding")&&We({currentLocation:D,nextLocation:H,historyAction:ie}))return ye}function _s(D){let H=Is(404,{pathname:D}),ie=u.activeRoutes,{matches:ve,route:ye}=Ly(ie);return{notFoundMatches:ve,route:ye,error:H}}function nl(D,H,ie){if(b=D,S=H,x=ie||null,!k&&O.navigation===jk){k=!0;let ve=Jr(O.location,O.matches);ve!=null&&je({restoreScrollPosition:ve})}return()=>{b=null,S=null,x=null}}function Js(D,H){return x&&x(D,H.map(ve=>_W(ve,O.loaderData)))||D.key}function ua(D,H){if(b&&S){let ie=Js(D,H);b[ie]=S()}}function Jr(D,H){if(b){let ie=Js(D,H),ve=b[ie];if(typeof ve=="number")return ve}return null}function fr(D,H,ie){if(t.patchRoutesOnNavigation){let ve=u.branches;if(D){if(Object.keys(D[0].params).length>0)return{active:!0,matches:ao(H,ie,d,!0,ve)}}else return{active:!0,matches:ao(H,ie,d,!0,ve)||[]}}return{active:!1,matches:null}}async function ti(D,H,ie,ve){if(!t.patchRoutesOnNavigation)return{type:"success",matches:D};let ye=D;for(;;){let We=l;try{await t.patchRoutesOnNavigation({signal:ie,path:H,matches:ye,fetcherKey:ve,patch:(rt,Xe)=>{ie.aborted||WP(rt,Xe,u,We,o,!1)}})}catch(rt){return{type:"error",error:rt,partialMatches:ye}}if(ie.aborted)return{type:"aborted"};let Ke=u.branches,Be=ao(u.activeRoutes,H,d,!1,Ke),Ze=null;if(Be){if(Object.keys(Be[0].params).length===0)return{type:"success",matches:Be};if(Ze=ao(u.activeRoutes,H,d,!0,Ke),!(Ze&&ye.length<Ze.length&&Rr(ye,Ze.slice(0,ye.length))))return{type:"success",matches:Be}}if(Ze||(Ze=ao(u.activeRoutes,H,d,!0,Ke)),!Ze||Rr(ye,Ze))return{type:"success",matches:null};ye=Ze}}function Rr(D,H){return D.length===H.length&&D.every((ie,ve)=>ie.route.id===H[ve].route.id)}function ni(D){l={},u.setHmrRoutes(om(D,o,void 0,l))}function il(D,H,ie=!1){WP(D,H,u,l,o,ie),u.hasHMRRoutes||je({})}return j={get basename(){return d},get future(){return p},get state(){return O},get routes(){return u.stableRoutes},get branches(){return u.branches},get manifest(){return l},get window(){return e}
9,initialize:Ae,subscribe:oe,enableScrollRestoration:nl,navigate:Le,fetch:Kt,revalidate:Pe,createHref:D=>t.history.createHref(D),createURL:D=>t.history.createURL(D),encodeLocation:D=>t.history.encodeLocation(D),getFetcher:Eo,resetFetcher:Bs,deleteFetcher:ca,dispose:Se,getBlocker:ei,deleteBlocker:tl,patchRoutes:il,_internalFetchControllers:ge,_internalSetRoutes:ni,_internalSetStateDoNotUseOrYouWillBreakYourApp(D){je(D)}},t.instrumentations&&(j=zW(j,t.instrumentations.map(D=>D.router).filter(Boolean))),j}function XW(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function UE(t,e,n,i,r,o){let l,u;if(r){l=[];for(let f of e)if(l.push(f),f.route.id===r){u=f;break}}else l=e,u=e[e.length-1];let d=cw(i||".",uC(l),Us(t.pathname,n)||t.pathname,o==="path");if(i==null&&(d.search=t.search,d.hash=t.hash),(i==null||i===""||i===".")&&u){let f=pC(d.search);if(u.route.index&&!f)d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&f){let p=new URLSearchParams(d.search),g=p.getAll("index");p.delete("index"),g.filter(y=>y).forEach(y=>p.append("index",y));let v=p.toString();d.search=v?`?${v}`:""}}return n!=="/"&&(d.pathname=$W({basename:n,pathname:d.pathname})),Hr(d)}function KP(t,e,n){if(!n||!XW(n))return{path:e};if(n.formMethod&&!vq(n.formMethod))return{path:e,error:Is(405,{method:n.formMethod})};let i=()=>({path:e,error:Is(400,{type:"invalid-body"})}),o=(n.formMethod||"get").toUpperCase(),l=bL(e);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!nr(o))return i();let g=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((v,[y,b])=>`${v}${y}=${b}
10`,""):String(n.body);return{path:e,submission:{formMethod:o,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:g}}}else if(n.formEncType==="application/json"){if(!nr(o))return i();try{let g=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:e,submission:{formMethod:o,formAction:l,formEncType:n.formEncType,formData:void 0,json:g,text:void 0}}}catch{return i()}}}St(typeof FormData=="function","FormData is not available in this environment");let u,d;if(n.formData)u=KE(n.formData),d=n.formData;else if(n.body instanceof FormData)u=KE(n.body),d=n.body;else if(n.body instanceof URLSearchParams)u=n.body,d=JP(u);else if(n.body==null)u=new URLSearchParams,d=new FormData;else try{u=new URLSearchParams(n.body),d=JP(u)}catch{return i()}let f={formMethod:o,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:d,json:void 0,text:void 0};if(nr(f.formMethod))return{path:e,submission:f};let p=sa(e);return t&&p.search&&pC(p.search)&&u.append("index",""),p.search=`?${u}`,{path:Hr(p),submission:f}}function ZP(t,e,n,i,r,o,l,u,d,f,p,g,v,y,b,x,S,k,T,C,A,$){let N=A?as(A[1])?A[1].error:A[1].data:void 0,j=r.createURL(o.location),O=r.createURL(d),L;if(p&&o.errors){let Z=Object.keys(o.errors)[0];L=l.findIndex(ae=>ae.route.id===Z)}else if(A&&as(A[1])){let Z=A[0];L=l.findIndex(ae=>ae.route.id===Z)-1}let B=A?A[1].statusCode:void 0,V=B&&B>=400,ee={currentUrl:j,currentParams:o.matches[0]?.params||{},nextUrl:O,nextParams:l[0].params,...u,actionResult:N,actionStatus:B},me=Hm(l),ne=l.map((Z,ae)=>{let{route:ue}=Z,ge=null;if(L!=null&&ae>L)ge=!1;else if(ue.lazy)ge=!0;else if(!hC(ue))ge=!1;else if(p){let{shouldLoad:Oe}=fL(ue,o.loaderData,o.errors);ge=Oe}else YW(o.loaderData,o.matches[ae],Z)&&(ge=!0);if(ge!==null)return FE(n,i,t,d,me,Z,f,e,ge);let Re=!1;typeof $=="boolean"?Re=$:V?Re=!1:(g||j.pathname+j.search===O.pathname+O.search||j.search!==O.search||QW(o.matches[ae],Z))&&(Re=!0);let xe={...ee,defaultShouldRevalidate:Re},Ie=Cg(Z,xe);return FE(n,i,t,d,me,Z,f,e,Ie,xe,$)}),ce=[];return b.forEach((Z,ae)=>{if(p||!l.some(F=>F.route.id===Z.routeId)||y.has(ae))return;let ue=o.fetchers.get(ae),ge=ue&&ue.state!=="idle"&&ue.data===void 0,Re=ao(S,Z.path,k??"/",!1,C);if(!Re){if(T&&ge)return;ce.push({key:ae,routeId:Z.routeId,path:Z.path,matches:null,match:null,request:null,controller:null});return}if(x.has(ae))return;let xe=Q0(Re,Z.path),Ie=new AbortController,Oe=lh(r,Z.path,Ie.signal),P=null;if(v.has(ae))v.delete(ae),P=Rh(n,i,Oe,Z.path,Re,xe,f,e);else if(ge)g&&(P=Rh(n,i,Oe,Z.path,Re,xe,f,e));else{let F;typeof $=="boolean"?F=$:V?F=!1:F=g;let re={...ee,defaultShouldRevalidate:F};Cg(xe,re)&&(P=Rh(n,i,Oe,Z.path,Re,xe,f,e,re))}P&&ce.push({key:ae,routeId:Z.routeId,path:Z.path,matches:P,match:xe,request:Oe,controller:Ie})}),{dsMatches:ne,revalidatingFetchers:ce}}function hC(t){return t.loader!=null||t.middleware!=null&&t.middleware.length>0}function fL(t,e,n){if(t.lazy)return{shouldLoad:!0,renderFallback:!0};if(!hC(t))return{shouldLoad:!1,renderFallback:!1};let i=e!=null&&t.id in e,r=n!=null&&n[t.id]!==void 0;if(!i&&r)return{shouldLoad:!1,renderFallback:!1};if(typeof t.loader=="function"&&t.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!i};let o=!i&&!r;return{shouldLoad:o,renderFallback:o}}function YW(t,e,n){let i=!e||n.route.id!==e.route.id,r=!t.hasOwnProperty(n.route.id);return i||r}function QW(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function Cg(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}function WP(t,e,n,i,r,o){let l;if(t){let f=i[t];St(f,`No route found to patch children into: routeId = ${t}`),f.children||(f.children=[]),l=f.children}else l=n.activeRoutes;let u=[],d=[];if(e.forEach(f=>{let p=l.find(g=>pL(f,g));p?d.push({existingRoute:p,newRoute:f}):u.push(f)}),u.length>0){let f=om(u,r,[t||"_","patch",String(l?.length||"0")],i);l.push(...f)}if(o&&d.length>0)for(let f=0;f<d.length;f++){let{existingRoute:p,newRoute:g}=d[f],v=p,[y]=om([g],r,[],{},!0);Object.assign(v,{element:y.element?y.element:v.element,errorElement:y.errorElement?y.errorElement:v.errorElement,hydrateFallbackElement:y.hydrateFallbackElement?y.hydrateFallbackElement:v.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function pL(t,e){return"id"in t&&"id"in e&&t.id===e.id?!0:t.index===e.index&&t.path===e.path&&t.caseSensitive===e.caseSensitive?(!t.children||t.children.length===0)&&(!e.children||e.children.length===0)?!0:t.children?.every((n,i)=>e.children?.some(r=>pL(n,r)))??!1:!1}var qP=new WeakMap,gL=({key:t,route:e,manifest:n,mapRouteProperties:i})=>{let r=n[e.id];if(St(r,"No route found in manifest"),!r.lazy||typeof r.lazy!="object")return;let o=r.lazy[t];if(!o)return;let l=qP.get(r);l||(l={},qP.set(r,l));let u=l[t];if(u)return u;let d=(async()=>{let f=gW(t),g=r[t]!==void 0&&t!=="hasErrorBoundary";if(f)Qn(!f,"Route property "+t+" is not a supported lazy route property. This property will be ignored."),l[t]=Prom
10ise.resolve();else if(g)Qn(!1,`Route "${r.id}" has a static property "${t}" defined. The lazy property will be ignored.`);else{let v=await o();v!=null&&(Object.assign(r,{[t]:v}),Object.assign(r,i(r)))}typeof r.lazy=="object"&&(r.lazy[t]=void 0,Object.values(r.lazy).every(v=>v===void 0)&&(r.lazy=void 0))})();return l[t]=d,d},VP=new WeakMap;function eq(t,e,n,i,r){let o=n[t.id];if(St(o,"No route found in manifest"),!t.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof t.lazy=="function"){let p=VP.get(o);if(p)return{lazyRoutePromise:p,lazyHandlerPromise:p};let g=(async()=>{St(typeof t.lazy=="function","No lazy route function found");let v=await t.lazy(),y={};for(let b in v){let x=v[b];if(x===void 0)continue;let S=vW(b),T=o[b]!==void 0&&b!=="hasErrorBoundary";S?Qn(!S,"Route property "+b+" is not a supported property to be returned from a lazy route function. This property will be ignored."):T?Qn(!T,`Route "${o.id}" has a static property "${b}" defined but its lazy function is also returning a value for this property. The lazy route property "${b}" will be ignored.`):y[b]=x}Object.assign(o,y),Object.assign(o,{...i(o),lazy:void 0})})();return VP.set(o,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let l=Object.keys(t.lazy),u=[],d;for(let p of l){if(r&&r.includes(p))continue;let g=gL({key:p,route:t,manifest:n,mapRouteProperties:i});g&&(u.push(g),p===e&&(d=g))}let f=u.length>0?Promise.all(u).then(()=>{}):void 0;return f?.catch(()=>{}),d?.catch(()=>{}),{lazyRoutePromise:f,lazyHandlerPromise:d}}async function BP(t){let e=t.matches.filter(r=>r.shouldLoad),n={};return(await Promise.all(e.map(r=>r.resolve()))).forEach((r,o)=>{n[e[o].route.id]=r}),n}async function tq(t){return t.matches.some(e=>e.route.middleware)?mL(t,()=>BP(t)):BP(t)}function mL(t,e){return nq(t,e,i=>{if(mq(i))throw i;return i},hq,n);function n(i,r,o){if(o)return Promise.resolve(Object.assign(o.value,{[r]:{type:"error",result:i}}));{let{matches:l}=t,u=Math.min(Math.max(l.findIndex(f=>f.route.id===r),0),Math.max(l.findIndex(f=>f.shouldCallHandler()),0)),d=ql(l,l[u].route.id).route.id;return Promise.resolve({[d]:{type:"error",result:i}})}}}async function nq(t,e,n,i,r){let{matches:o,...l}=t,u=o.flatMap(f=>f.route.middleware?f.route.middleware.map(p=>[f.route.id,p]):[]);return await vL(l,u,e,n,i,r)}async function vL(t,e,n,i,r,o,l=0){let{request:u}=t;if(u.signal.aborted)throw u.signal.reason??new Error(`Request aborted: ${u.method} ${u.url}`);let d=e[l];if(!d)return await n();let[f,p]=d,g,v=async()=>{if(g)throw new Error("You may only call `next()` once per middleware");try{return g={value:await vL(t,e,n,i,r,o,l+1)},g.value}catch(y){return g={value:await o(y,f,g)},g.value}};try{let y=await p(t,v),b=y!=null?i(y):void 0;return r(b)?b:g?b??g.value:(g={value:await v()},g.value)}catch(y){return await o(y,f,g)}}function yL(t,e,n,i,r){let o=gL({key:"middleware",route:i.route,manifest:e,mapRouteProperties:t}),l=eq(i.route,nr(n.method)?"action":"loader",e,t,r);return{middleware:o,route:l.lazyRoutePromise,handler:l.lazyHandlerPromise}}function FE(t,e,n,i,r,o,l,u,d,f=null,p){let g=!1,v=yL(t,e,n,o,l);return{...o,_lazyPromises:v,shouldLoad:d,shouldRevalidateArgs:f,shouldCallHandler(y){return g=!0,f?typeof p=="boolean"?Cg(o,{...f,defaultShouldRevalidate:p}):typeof y=="boolean"?Cg(o,{...f,defaultShouldRevalidate:y}):Cg(o,f):d},resolve(y){let{lazy:b,loader:x,middleware:S}=o.route,k=g||d||y&&!nr(n.method)&&(b||x),T=S&&S.length>0&&!x&&!b;return k&&(nr(n.method)||!T)?rq({request:n,path:i,pattern:r,match:o,lazyHandlerPromise:v?.handler,lazyRoutePromise:v?.route,handlerOverride:y,scopedContext:u}):Promise.resolve({type:"data",result:void 0})}}}function Rh(t,e,n,i,r,o,l,u,d=null){return r.map(f=>f.route.id!==o.route.id?{...f,shouldLoad:!1,shouldRevalidateArgs:d,shouldCallHandler:()=>!1,_lazyPromises:yL(t,e,n,f,l),resolve:()=>Promise.resolve({type:"data",result:void 0})}:FE(t,e,n,i,Hm(r),f,l,u,!0,d))}async function iq(t,e,n,i,r,o,l){i.some(p=>p._lazyPromises?.middleware)&&await Promise.all(i.map(p=>p._lazyPromises?.middleware));let u={request:e,url:_L(e,n),pattern:Hm(i),params:i[0].params,context:o,matches:i},f=await t({...u,fetcherKey:r,runClientMiddleware:p=>{let g=u;return mL(g,()=>p({...g,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(i.flatMap(p=>[p._lazyPromises?.handler,p._lazyPromises?.route]))}catch{}return f}async function rq({request:t,path:e,pattern:n,match:i,lazyHandlerPromise:r,lazyRoutePromise:o,handlerOverride:l,scopedContext:u}){let d,f,p=nr(t.method),g=p?"action":"loader",v=y=>{let b,x=new Promise((T,C)=>b=C);f=()=>b(),t.signal.addEventListener("abort",f);let S=T=>typeof y!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${g}" [routeId: ${i.route.id}]`)):y({request:t,url:_L(t,e),pattern:n,params:i.params,context:u}
10,...T!==void 0?[T]:[]),k=(async()=>{try{return{type:"data",result:await(l?l(C=>S(C)):S())}}catch(T){return{type:"error",result:T}}})();return Promise.race([k,x])};try{let y=p?i.route.action:i.route.loader;if(r||o)if(y){let b,[x]=await Promise.all([v(y).catch(S=>{b=S}),r,o]);if(b!==void 0)throw b;d=x}else{await r;let b=p?i.route.action:i.route.loader;if(b)[d]=await Promise.all([v(b),o]);else if(g==="action"){let x=new URL(t.url),S=x.pathname+x.search;throw Is(405,{method:t.method,pathname:S,routeId:i.route.id})}else return{type:"data",result:void 0}}else if(y)d=await v(y);else{let b=new URL(t.url),x=b.pathname+b.search;throw Is(404,{pathname:x})}}catch(y){return{type:"error",result:y}}finally{f&&t.signal.removeEventListener("abort",f)}return d}async function sq(t){let e=t.headers.get("Content-Type");return e&&/\bapplication\/json\b/.test(e)?t.body==null?null:t.json():t.text()}async function oq(t){let{result:e,type:n}=t;if(fC(e)){let i;try{i=await sq(e)}catch(r){return{type:"error",error:r}}return n==="error"?{type:"error",error:new Fm(e.status,e.statusText,i),statusCode:e.status,headers:e.headers}:{type:"data",data:i,statusCode:e.status,headers:e.headers}}return n==="error"?eN(e)?e.data instanceof Error?{type:"error",error:e.data,statusCode:e.init?.status,headers:e.init?.headers?new Headers(e.init.headers):void 0}:{type:"error",error:dq(e),statusCode:lm(e)?e.status:void 0,headers:e.init?.headers?new Headers(e.init.headers):void 0}:{type:"error",error:e,statusCode:lm(e)?e.status:void 0}:eN(e)?{type:"data",data:e.data,statusCode:e.init?.status,headers:e.init?.headers?new Headers(e.init.headers):void 0}:{type:"data",data:e}}function aq(t,e,n,i,r){let o=t.headers.get("Location");if(St(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!cC(o)){let l=i.slice(0,i.findIndex(u=>u.route.id===n)+1);o=UE(new URL(e.url),l,r,o),t.headers.set("Location",o)}return t}var lq=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function HE(t){try{return lq.includes(new URL(t).protocol)}catch{return!1}}function GP(t,e,n,i){if(cC(t)){let r=t,o=lw.test(r)?new URL(JD(r,e.protocol)):new URL(r);if(HE(o.toString()))throw new Error("Invalid redirect location");let l=Us(o.pathname,n)!=null;if(o.origin===e.origin&&l)return dC(o.pathname)+o.search+o.hash}try{let r=i.createURL(t);if(HE(r.toString()))throw new Error("Invalid redirect location")}catch{}return t}function lh(t,e,n,i){let r=t.createURL(bL(e)).toString(),o={signal:n};if(i&&nr(i.formMethod)){let{formMethod:l,formEncType:u}=i;o.method=l.toUpperCase(),u==="application/json"?(o.headers=new Headers({"Content-Type":u}),o.body=JSON.stringify(i.json)):u==="text/plain"?o.body=i.text:u==="application/x-www-form-urlencoded"&&i.formData?o.body=KE(i.formData):o.body=i.formData}return new Request(r,o)}function _L(t,e){let n=new URL(t.url),i=typeof e=="string"?sa(e):e;if(n.pathname=i.pathname||"/",i.search){let r=new URLSearchParams(i.search),o=r.getAll("index");r.delete("index");for(let l of o.filter(Boolean))r.append("index",l);n.search=r.size?`?${r.toString()}`:""}else n.search="";return n.hash=i.hash||"",n}function KE(t){let e=new URLSearchParams;for(let[n,i]of t.entries())e.append(n,typeof i=="string"?i:i.name);return e}function JP(t){let e=new FormData;for(let[n,i]of t.entries())e.append(n,i);return e}function cq(t,e,n,i=!1,r=!1){let o={},l=null,u,d=!1,f={},p=n&&as(n[1])?n[1].error:void 0;return t.forEach(g=>{if(!(g.route.id in e))return;let v=g.route.id,y=e[v];if(St(!du(y),"Cannot handle redirect results in processLoaderData"),as(y)){let b=y.error;if(p!==void 0&&(b=p,p=void 0),l=l||{},r)l[v]=b;else{let x=ql(t,v);l[x.route.id]==null&&(l[x.route.id]=b)}i||(o[v]=hL),d||(d=!0,u=lm(y.error)?y.error.status:500),y.headers&&(f[v]=y.headers)}else o[v]=y.data,y.statusCode&&y.statusCode!==200&&!d&&(u=y.statusCode),y.headers&&(f[v]=y.headers)}),p!==void 0&&n&&(l={[n[0]]:p},n[2]&&(o[n[2]]=void 0)),{loaderData:o,errors:l,statusCode:u||200,loaderHeaders:f}}function XP(t,e,n,i,r,o,l){let{loaderData:u,errors:d}=cq(e,n,i);return r.filter(f=>!f.matches||f.matches.some(p=>
10p.shouldLoad)).forEach(f=>{let{key:p,match:g,controller:v}=f;if(v&&v.signal.aborted)return;let y=o[p];if(St(y,"Did not find corresponding fetcher result"),as(y)){let b=ql(t.matches,g?.route.id);d&&d[b.route.id]||(d={...d,[b.route.id]:y.error}),l.delete(p)}else if(du(y))St(!1,"Unhandled fetcher revalidation redirect");else{let b=Zo(y.data);l.set(p,b)}}),{loaderData:u,errors:d}}function YP(t,e,n,i){let r=Object.entries(e).filter(([,o])=>o!==hL).reduce((o,[l,u])=>(o[l]=u,o),{});for(let o of n){let l=o.route.id;if(!e.hasOwnProperty(l)&&t.hasOwnProperty(l)&&o.route.loader&&(r[l]=t[l]),i&&i.hasOwnProperty(l))break}return r}function QP(t){return t?as(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function ql(t,e){return(e?t.slice(0,t.findIndex(i=>i.route.id===e)+1):[...t]).reverse().find(i=>i.route.hasErrorBoundary===!0)||t[0]}function Ly(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function Is(t,{pathname:e,routeId:n,method:i,type:r,message:o}={}){let l="Unknown Server Error",u="Unknown @remix-run/router error";return t===400?(l="Bad Request",i&&e&&n?u=`You made a ${i} request to "${e}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:r==="invalid-body"&&(u="Unable to encode submission body")):t===403?(l="Forbidden",u=`Route "${n}" does not match URL "${e}"`):t===404?(l="Not Found",u=`No route matches URL "${e}"`):t===405&&(l="Method Not Allowed",i&&e&&n?u=`You made a ${i.toUpperCase()} request to "${e}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:i&&(u=`Invalid request method "${i.toUpperCase()}"`)),new Fm(t||500,l,new Error(u),!0)}function Uy(t){let e=Object.entries(t);for(let n=e.length-1;n>=0;n--){let[i,r]=e[n];if(du(r))return{key:i,result:r}}}function bL(t){let e=typeof t=="string"?sa(t):t;return Hr({...e,hash:""})}function uq(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function dq(t){return new Fm(t.init?.status??500,t.init?.statusText??"Internal Server Error",t.data)}function hq(t){return t!=null&&typeof t=="object"&&Object.entries(t).every(([e,n])=>typeof e=="string"&&fq(n))}function fq(t){return t!=null&&typeof t=="object"&&"type"in t&&"result"in t&&(t.type==="data"||t.type==="error")}function pq(t){return fC(t.result)&&uL.has(t.result.status)}function as(t){return t.type==="error"}function du(t){return(t&&t.type)==="redirect"}function eN(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function fC(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function gq(t){return uL.has(t)}function mq(t){return fC(t)&&gq(t.status)&&t.headers.has("Location")}function vq(t){return WW.has(t.toUpperCase())}function nr(t){return KW.has(t.toUpperCase())}function pC(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function Q0(t,e){let n=typeof e=="string"?sa(e).search:e.search;if(t[t.length-1].route.index&&pC(n||""))return t[t.length-1];let i=rL(t);return i[i.length-1]}function tN(t){let{formMethod:e,formAction:n,formEncType:i,text:r,formData:o,json:l}=t;if(!(!e||!n||!i)){if(r!=null)return{formMethod:e,formAction:n,formEncType:i,formData:void 0,json:void 0,text:r};if(o!=null)return{formMethod:e,formAction:n,formEncType:i,formData:o,json:void 0,text:void 0};if(l!==void 0)return{formMethod:e,formAction:n,formEncType:i,formData:void 0,json:l,text:void 0}}}function Pk(t,e,n,i){return i?{state:"loading",location:t,matches:e,historyAction:n,formMethod:i.formMethod,formAction:i.formAction,formEncType:i.formEncType,formData:i.formData,json:i.json,text:i.text}:{state:"loading",location:t,matches:e,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function yq(t,e,n,i){return{state:"submitting",location:t,matches:e,historyAction:n,formMethod:i.formMethod,formAction:i.formAction,formEncType:i.formEncType,formData:i.formData,json:i.json,text:i.text}}function fp(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function _q(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function Zo(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function bq(t,e){try{let n=t.sessionStorage.getItem(dL);if(n){let i=JSON.parse(n);for(let[r,o]of Object.entries(i||{}))o&&Array.isArray(o)&&e.set(r,new Set(o||[]))}}catch{}}function wq(t,e){if(e.size>0){let n={};for(let[i,r]of e)n[i]=[...r];try{t.sessionStorage.setItem(dL,JSON.stringify(n))}catch(i){Qn(!1,`Failed to save applied view transitions in sessionStorage (${i}).`)}}}function nN(){let t,e,n=new Promise((i,r)=>{t=async o=>{i(o);try{await n}catch{}},e=async o=>{r(o);try{await n}catch{}}});return{promise:n,resolve:t,reject:e}}var Uu=M.createContext(null);Uu.displayName="DataRouter";var Km=M.createContext(null);Km.displayName="DataRouterState";var wL=M.createContext(!1);function xL(){return M.useContext(wL)}var gC=M.createContext({isTransitioning:!1});gC.displayName="ViewTransition";var SL=M.createContext(new Map);SL.displayName="Fetchers";var xq=M.createContext(null);xq.displayName="Await";var Zs=M.createContext(null);Zs.displayName="Navigation";var uw=M.createContext(null);uw.displayName="Location";var oa=M.createContext({outlet:null,matches:[],isDataRoute:!1});oa.displayName="Route";var mC=M.createContext(null);mC.displayName="RouteError";var kL="REACT_ROUTER_ERROR",Sq="REDIRECT",kq="ROUTE_ERROR_RESPONSE";function Eq(t){if(t.startsWith(`${kL}:${Sq}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="str
10ing"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function Tq(t){if(t.startsWith(`${kL}:${kq}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new Fm(e.status,e.statusText,e.data)}catch{}}function Cq(t,{relative:e}={}){St(lf(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:i}=M.useContext(Zs),{hash:r,pathname:o,search:l}=Wm(t,{relative:e}),u=o;return n!=="/"&&(u=o==="/"?n:Ds([n,o])),i.createHref({pathname:u,search:l,hash:r})}function lf(){return M.useContext(uw)!=null}function ms(){return St(lf(),"useLocation() may be used only in the context of a <Router> component."),M.useContext(uw).location}function iN(t){St(lf(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:e}=ms();return M.useMemo(()=>am(t,iL(e)),[e,t])}var EL="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function TL(t){M.useContext(Zs).static||M.useLayoutEffect(t)}function Zm(){let{isDataRoute:t}=M.useContext(oa);return t?Hq():Oq()}function Oq(){St(lf(),"useNavigate() may be used only in the context of a <Router> component.");let t=M.useContext(Uu),{basename:e,navigator:n}=M.useContext(Zs),{matches:i}=M.useContext(oa),{pathname:r}=ms(),o=JSON.stringify(uC(i)),l=M.useRef(!1);return TL(()=>{l.current=!0}),M.useCallback((d,f={})=>{if(Qn(l.current,EL),!l.current)return;if(typeof d=="number"){n.go(d);return}let p=cw(d,JSON.parse(o),r,f.relative==="path");t==null&&e!=="/"&&(p.pathname=p.pathname==="/"?e:Ds([e,p.pathname])),Tg(typeof d=="string"?d:Hr(d),n.createHref(p),lL(n),"reject"),(f.replace?n.replace:n.push)(p,f.state,f)},[e,n,o,r,t])}var Rq=M.createContext(null);function $q(t){let e=M.useContext(oa).outlet;return M.useMemo(()=>e&&M.createElement(Rq.Provider,{value:t},e),[e,t])}function Wm(t,{relative:e}={}){let{matches:n}=M.useContext(oa),{pathname:i}=ms(),r=JSON.stringify(uC(n));return M.useMemo(()=>cw(t,JSON.parse(r),i,e==="path"),[t,r,i,e])}function Aq(t,e,n){St(lf(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=M.useContext(Zs),{matches:r}=M.useContext(oa),o=r[r.length-1],l=o?o.params:{},u=o?o.pathname:"/",d=o?o.pathnameBase:"/",f=o&&o.route;{let S=f&&f.path||"";OL(u,!f||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${S}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
11
12Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let p=ms(),g;g=p;let v=g.pathname||"/",y=v;if(d!=="/"){let S=d.replace(/^\//,"").split("/");y="/"+v.replace(/^\//,"").split("/").slice(S.length).join("/")}let b=n&&n.state.matches.length?n.state.matches.map(S=>Object.assign(S,{route:n.manifest[S.route.id]||S.route})):YD(t,{pathname:y});return Qn(f||b!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Qn(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),Iq(b&&b.map(S=>Object.assign({},S,{params:Object.assign({},l,S.params),pathname:Ds([d,i.encodeLocation?i.encodeLocation(S.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?d:Ds([d,i.encodeLocation?i.encodeLocation(S.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),r,n)}function jq(){let t=Fq(),e=lm(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:i},o={padding:"2px 4px",backgroundColor:i},l=null;return console.error("Error handled by React Router default ErrorBoundary:",t),l=M.createElement(M.Fragment,null,M.createElement("p",null,"💿 Hey developer 👋"),M.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",M.createElement("code",{style:o},"ErrorBoundary")," or"," ",M.createElement("code",{style:o},"errorElement")," prop on your route.")),M.createElement(M.Fragment,null,M.createElement("h2",null,"Unexpected Application 
12Error!"),M.createElement("h3",{style:{fontStyle:"italic"}},e),n?M.createElement("pre",{style:r},n):null,l)}var Pq=M.createElement(jq,null),CL=class extends M.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=Tq(t.digest);n&&(t=n)}let e=t!==void 0?M.createElement(oa.Provider,{value:this.props.routeContext},M.createElement(mC.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?M.createElement(Nq,{error:t},e):e}};CL.contextType=wL;var Nk=new WeakMap;function Nq({children:t,error:e}){let{basename:n,navigator:i}=M.useContext(Zs);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=Eq(e.digest);if(r){let o=Nk.get(e);if(o)throw o;let l=oL(r.location,n),u=l.absoluteURL||l.to;if(Tg(r.location,u,lL(i),"allow-explicit"),HE(u))throw new Error("Invalid redirect location");if(sL&&!Nk.get(e))if(l.isExternal||r.reloadDocument)window.location.href=u;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:r.replace}));throw Nk.set(e,d),d}return M.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u}`})}}return t}function Mq({routeContext:t,match:e,children:n}){let i=M.useContext(Uu);return i&&i.static&&i.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=e.route.id),M.createElement(oa.Provider,{value:t},n)}function Iq(t,e=[],n){let i=n?.state;if(t==null){if(!i)return null;if(i.errors)t=i.matches;else if(e.length===0&&!i.initialized&&i.matches.length>0)t=i.matches;else return null}let r=t,o=i?.errors;if(o!=null){let p=r.findIndex(g=>g.route.id&&o?.[g.route.id]!==void 0);St(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),r=r.slice(0,Math.min(r.length,p+1))}let l=!1,u=-1;if(n&&i){l=i.renderFallback;for(let p=0;p<r.length;p++){let g=r[p];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(u=p),g.route.id){let{loaderData:v,errors:y}=i,b=g.route.loader&&!v.hasOwnProperty(g.route.id)&&(!y||y[g.route.id]===void 0);if(g.route.lazy||b){n.isStatic&&(l=!0),u>=0?r=r.slice(0,u+1):r=[r[0]];break}}}}let d=n?.onError,f=i&&d?(p,g)=>{d(p,{location:i.location,params:i.matches?.[0]?.params??{},pattern:Hm(i.matches),errorInfo:g})}:void 0;return r.reduceRight((p,g,v)=>{let y,b=!1,x=null,S=null;i&&(y=o&&g.route.id?o[g.route.id]:void 0,x=g.route.errorElement||Pq,l&&(u<0&&v===0?(OL("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,S=null):u===v&&(b=!0,S=g.route.hydrateFallbackElement||null)));let k=e.concat(r.slice(0,v+1)),T=()=>{let C;return y?C=x:b?C=S:g.route.Component?C=M.createElement(g.route.Component,null):g.route.element?C=g.route.element:C=p,M.createElement(Mq,{match:g,routeContext:{outlet:p,matches:k,isDataRoute:i!=null},children:C})};return i&&(g.route.ErrorBoundary||g.route.errorElement||v===0)?M.createElement(CL,{location:i.location,revalidation:i.revalidation,component:x,error:y,children:T(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:f}):T()},null)}function vC(t){return`${t} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function zq(t){let e=M.useContext(Uu);return St(e,vC(t)),e}function Dq(t){let e=M.useContext(Km);return St(e,vC(t)),e}function Lq(t){let e=M.useContext(oa);return St(e,vC(t)),e}function yC(t){let e=Lq(t),n=e.matches[e.matches.length-1];return St(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function Uq(){return yC("useRouteId")}function Fq(){let t=M.useContext(mC),e=Dq("useRouteError"),n=yC("useRouteError");return t!==void 0?t:e.errors?.[n]}function Hq(){let{router:t}=zq("useNavigate"),e=yC("useNavigate"),n=M.useRef(!1);return TL(()=>{n.current=!0}),M.useCallback(async(r,o={})=>{Qn(n.current,EL),n.current&&(typeof r=="number"?await t.navigate(r):await t.navigate(r,{fromRouteId:e,...o}))},[t,e])}var rN={};function OL(t,e,n){!e&&!rN[t]&&(rN[t]=!0,Qn(!1,n))}var sN={};function oN(t,e){!t&&!sN[e]&&(sN[e]=!0,console.warn(e))}var Kq="useOptimistic",aN=iW[Kq],Zq=()=>{};function Wq(t){return aN?aN(t):[t,Zq]}function qq(t){let e={hasErrorBoundary:t.hasErrorBoundary||t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&(t.element&&Qn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(e,{element:M.createElement(t.Component),Component:void 0})),t.HydrateFallback&&(t.hydrateFallbackElement&&Qn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(e,{hydrateFallbackElement:M.createElement(t.HydrateFallback),HydrateFallback:void 0})),t.ErrorBoundary&&(t.errorElement&&Qn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(e,{errorElement:M.createElement(t.ErrorBoundary),ErrorBoundary:void 0})),e}var Vq=["HydrateFallback","hydrateFallbackElement"],Bq=class{constructor(){this.status="pending",this.promise=new Promise((t,e)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",e(n))}})}};function Gq({router:t,flushSync:e,onError:n,useTransitions:i}){i=xL()||i;let[o,l]=M.useState(t.state),[u,d]=Wq(o),[f,p]=M.useState(),[g,v]=M.useState({isTransitioning:!1}
12),[y,b]=M.useState(),[x,S]=M.useState(),[k,T]=M.useState(),C=M.useRef(new Map),A=M.useCallback((O,{deletedFetchers:L,newErrors:B,flushSync:V,viewTransitionOpts:ee})=>{B&&n&&Object.values(B).forEach(ne=>n(ne,{location:O.location,params:O.matches[0]?.params??{},pattern:Hm(O.matches)})),O.fetchers.forEach((ne,ce)=>{ne.data!==void 0&&C.current.set(ce,ne.data)}),L.forEach(ne=>C.current.delete(ne)),oN(V===!1||e!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable.  Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let me=t.window!=null&&t.window.document!=null&&typeof t.window.document.startViewTransition=="function";if(oN(ee==null||me,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!ee||!me){e&&V?e(()=>l(O)):i===!1?l(O):M.startTransition(()=>{i===!0&&d(ne=>lN(ne,O)),l(O)});return}if(e&&V){e(()=>{x&&(y?.resolve(),x.skipTransition()),v({isTransitioning:!0,flushSync:!0,currentLocation:ee.currentLocation,nextLocation:ee.nextLocation})});let ne=t.window.document.startViewTransition(()=>{e(()=>l(O))});ne.finished.finally(()=>{e(()=>{b(void 0),S(void 0),p(void 0),v({isTransitioning:!1})})}),e(()=>S(ne));return}x?(y?.resolve(),x.skipTransition(),T({state:O,currentLocation:ee.currentLocation,nextLocation:ee.nextLocation})):(p(O),v({isTransitioning:!0,flushSync:!1,currentLocation:ee.currentLocation,nextLocation:ee.nextLocation}))},[t.window,e,x,y,i,d,n]);M.useLayoutEffect(()=>t.subscribe(A),[t,A]),M.useEffect(()=>{g.isTransitioning&&!g.flushSync&&b(new Bq)},[g]),M.useEffect(()=>{if(y&&f&&t.window){let O=f,L=y.promise,B=t.window.document.startViewTransition(async()=>{i===!1?l(O):M.startTransition(()=>{i===!0&&d(V=>lN(V,O)),l(O)}),await L});B.finished.finally(()=>{b(void 0),S(void 0),p(void 0),v({isTransitioning:!1})}),S(B)}},[f,y,t.window,i,d]),M.useEffect(()=>{y&&f&&u.location.key===f.location.key&&y.resolve()},[y,x,u.location,f]),M.useEffect(()=>{!g.isTransitioning&&k&&(p(k.state),v({isTransitioning:!0,flushSync:!1,currentLocation:k.currentLocation,nextLocation:k.nextLocation}),T(void 0))},[g.isTransitioning,k]);let $=M.useMemo(()=>({createHref:t.createHref,createURL:t.createURL,encodeLocation:t.encodeLocation,go:O=>t.navigate(O),push:(O,L,B)=>t.navigate(O,{state:L,preventScrollReset:B?.preventScrollReset}),replace:(O,L,B)=>t.navigate(O,{replace:!0,state:L,preventScrollReset:B?.preventScrollReset})}),[t]),N=t.basename||"/",j=M.useMemo(()=>({router:t,navigator:$,static:!1,basename:N,onError:n}),[t,$,N,n]);return M.createElement(M.Fragment,null,M.createElement(Uu.Provider,{value:j},M.createElement(Km.Provider,{value:u},M.createElement(SL.Provider,{value:C.current},M.createElement(gC.Provider,{value:g},M.createElement(Yq,{basename:N,location:u.location,navigationType:u.historyAction,navigator:$,useTransitions:i},M.createElement(Jq,{routes:t.routes,manifest:t.manifest,future:t.future,state:u,isStatic:!1,onError:n})))))),null)}function lN(t,e){return{...t,navigation:e.navigation.state!=="idle"?e.navigation:t.navigation,revalidation:e.revalidation!=="idle"?e.revalidation:t.revalidation,actionData:e.navigation.state!=="submitting"?e.actionData:t.actionData,fetchers:e.fetchers}}var Jq=M.memo(Xq);function Xq({routes:t,manifest:e,future:n,state:i,isStatic:r,onError:o}){return Aq(t,void 0,{manifest:e,state:i,isStatic:r,onError:o})}function RL(t){return $q(t.context)}function Yq({basename:t="/",children:e=null,location:n,navigationType:i="POP",navigator:r,static:o=!1,useTransitions:l}){St(!lf(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=t.replace(/^\/*/,"/"),d=M.useMemo(()=>({basename:u,navigator:r,static:o,useTransitions:l,future:{}}),[u,r,o,l]);typeof n=="string"&&(n=sa(n));let{pathname:f="/",search:p="",hash:g="",state:v=null,key:y="default",mask:b}=n,x=M.useMemo(()=>{let S=Us(f,u);return S==null?null:{location:{pathname:S,search:p,hash:g,state:v,key:y,mask:b},navigationType:i}},[u,f,p,g,v,y,i,b]);
12return Qn(x!=null,`<Router basename="${u}"> is not able to match the URL "${f}${p}${g}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:M.createElement(Zs.Provider,{value:d},M.createElement(uw.Provider,{children:e,value:x}))}var e_="get",t_="application/x-www-form-urlencoded";function dw(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function Qq(t){return dw(t)&&t.tagName.toLowerCase()==="button"}function eV(t){return dw(t)&&t.tagName.toLowerCase()==="form"}function tV(t){return dw(t)&&t.tagName.toLowerCase()==="input"}function nV(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function iV(t,e){return t.button===0&&(!e||e==="_self")&&!nV(t)}function ZE(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let i=t[n];return e.concat(Array.isArray(i)?i.map(r=>[n,r]):[[n,i]])},[]))}function rV(t,e){let n=ZE(t);return e&&e.forEach((i,r)=>{n.has(r)||e.getAll(r).forEach(o=>{n.append(r,o)})}),n}var Fy=null;function sV(){if(Fy===null)try{new FormData(document.createElement("form"),0),Fy=!1}catch{Fy=!0}return Fy}var oV=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Mk(t){return t!=null&&!oV.has(t)?(Qn(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${t_}"`),null):t}function aV(t,e){let n,i,r,o,l;if(eV(t)){let u=t.getAttribute("action");i=u?Us(u,e):null,n=t.getAttribute("method")||e_,r=Mk(t.getAttribute("enctype"))||t_,o=new FormData(t)}else if(Qq(t)||tV(t)&&(t.type==="submit"||t.type==="image")){let u=t.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=t.getAttribute("formaction")||u.getAttribute("action");if(i=d?Us(d,e):null,n=t.getAttribute("formmethod")||u.getAttribute("method")||e_,r=Mk(t.getAttribute("formenctype"))||Mk(u.getAttribute("enctype"))||t_,o=new FormData(u,t),!sV()){let{name:f,type:p,value:g}=t;if(p==="image"){let v=f?`${f}.`:"";o.append(`${v}x`,"0"),o.append(`${v}y`,"0")}else f&&o.append(f,g)}}else{if(dw(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=e_,i=null,r=t_,l=t}return o&&r==="text/plain"&&(l=o,o=void 0),{action:i,method:n.toLowerCase(),encType:r,formData:o,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function _C(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function $L(t,e,n,i){let r=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${i}`:r.pathname=`${r.pathname}.${i}`:r.pathname==="/"?r.pathname=`_root.${i}`:e&&Us(r.pathname,e)==="/"?r.pathname=`${Kh(e)}/_root.${i}`:r.pathname=`${Kh(r.pathname)}.${i}`,r}async function lV(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function cV(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function uV(t,e,n){let i=await Promise.all(t.map(async r=>{let o=e.routes[r.route.id];if(o){let l=await lV(o,n);return l.links?l.links():[]}return[]}));return pV(i.flat(1).filter(cV).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function cN(t,e,n,i,r,o){let l=(d,f)=>n[f]?d.route.id!==n[f].route.id:!0,u=(d,f)=>n[f].pathname!==d.pathname||n[f].route.path?.endsWith("*")&&n[f].params["*"]!==d.params["*"];return o==="assets"?e.filter((d,f)=>l(d,f)||u(d,f)):o==="data"?e.filter((d,f)=>{let p=i.routes[d.route.id];if(!p||!p.hasLoader)return!1;if(l(d,f)||u(d,f))return!0;if(d.route.shouldRevalidate){let g=d.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParam
12s:n[0]?.params||{},nextUrl:new URL(t,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function dV(t,e,{includeHydrateFallback:n}={}){return hV(t.map(i=>{let r=e.routes[i.route.id];if(!r)return[];let o=[r.module];return r.clientActionModule&&(o=o.concat(r.clientActionModule)),r.clientLoaderModule&&(o=o.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(o=o.concat(r.hydrateFallbackModule)),r.imports&&(o=o.concat(r.imports)),o}).flat(1))}function hV(t){return[...new Set(t)]}function fV(t){let e={},n=Object.keys(t).sort();for(let i of n)e[i]=t[i];return e}function pV(t,e){let n=new Set;return new Set(e),t.reduce((i,r)=>{let o=JSON.stringify(fV(r));return n.has(o)||(n.add(o),i.push({key:o,link:r})),i},[])}function bC(){let t=M.useContext(Uu);return _C(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function gV(){let t=M.useContext(Km);return _C(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var wC=M.createContext(void 0);wC.displayName="FrameworkContext";function hw(){let t=M.useContext(wC);return _C(t,"You must render this element inside a <HydratedRouter> element"),t}function mV(t,e){let n=M.useContext(wC),[i,r]=M.useState(!1),[o,l]=M.useState(!1),{onFocus:u,onBlur:d,onMouseEnter:f,onMouseLeave:p,onTouchStart:g}=e,v=M.useRef(null);M.useEffect(()=>{if(t==="render"&&l(!0),t==="viewport"){let x=k=>{k.forEach(T=>{l(T.isIntersecting)})},S=new IntersectionObserver(x,{threshold:.5});return v.current&&S.observe(v.current),()=>{S.disconnect()}}},[t]),M.useEffect(()=>{if(i){let x=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(x)}}},[i]);let y=()=>{r(!0)},b=()=>{r(!1),l(!1)};return n?t!=="intent"?[o,v,{}]:[o,v,{onFocus:pp(u,y),onBlur:pp(d,b),onMouseEnter:pp(f,y),onMouseLeave:pp(p,b),onTouchStart:pp(g,y)}]:[!1,v,{}]}function pp(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function vV({page:t,...e}){let n=xL(),{nonce:i}=hw(),{router:r}=bC(),o=M.useMemo(()=>YD(r.routes,t,r.basename),[r.routes,t,r.basename]);return o?(e.nonce==null&&i&&(e={...e,nonce:i}),n?M.createElement(_V,{page:t,matches:o,...e}):M.createElement(bV,{page:t,matches:o,...e})):null}function yV(t){let{manifest:e,routeModules:n}=hw(),[i,r]=M.useState([]);return M.useEffect(()=>{let o=!1;return uV(t,e,n).then(l=>{o||r(l)}),()=>{o=!0}},[t,e,n]),i}function _V({page:t,matches:e,...n}){let i=ms(),{future:r}=hw(),{basename:o}=bC(),l=M.useMemo(()=>{if(t===i.pathname+i.search+i.hash)return[];let u=$L(t,o,r.v8_trailingSlashAwareDataRequests,"rsc"),d=!1,f=[];for(let p of e)typeof p.route.shouldRevalidate=="function"?d=!0:f.push(p.route.id);return d&&f.length>0&&u.searchParams.set("_routes",f.join(",")),[u.pathname+u.search]},[o,r.v8_trailingSlashAwareDataRequests,t,i,e]);return M.createElement(M.Fragment,null,l.map(u=>M.createElement("link",{key:u,rel:"prefetch",as:"fetch",href:u,...n})))}function bV({page:t,matches:e,...n}){let i=ms(),{future:r,manifest:o,routeModules:l}=hw(),{basename:u}=bC(),{loaderData:d,matches:f}=gV(),p=M.useMemo(()=>cN(t,e,f,o,i,"data"),[t,e,f,o,i]),g=M.useMemo(()=>cN(t,e,f,o,i,"assets"),[t,e,f,o,i]),v=M.useMemo(()=>{if(t===i.pathname+i.search+i.hash)return[];let x=new Set,S=!1;if(e.forEach(T=>{let C=o.routes[T.route.id];!C||!C.hasLoader||(!p.some(A=>A.route.id===T.route.id)&&T.route.id in d&&l[T.route.id]?.shouldRevalidate||C.hasClientLoader?S=!0:x.add(T.route.id))}),x.size===0)return[];let k=$L(t,u,r.v8_trailingSlashAwareDataRequests,"data");return S&&x.size>0&&k.searchParams.set("_routes",e.filter(T=>x.has(T.route.id)).map(T=>T.route.id).join(",")),[k.pathname+k.search]},[u,r.v8_trailingSlashAwareDataRequests,d,i,o,p,e,t,l]),y=M.useMemo(()=>dV(g,o),[g,o]),b=yV(g);return M.createElement(M.Fragment,null,v.map(x=>M.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...n})),y.map(x=>M.createElement("link",{key:x,rel:"modulepreload",href:x,...n})),b.map(({key:x,link:S})=>M.createElement("link",{key:x,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function wV(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var xV=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{xV&&(window.__reactRouterVersion="7.18.4")}catch{}function SV(t,e){return JW({basename:e?.basename,getContext:e?.getContext,future:e?.future,history:dW({window:e?.window}),hydrationData:kV(),routes:t,mapRouteProperties:qq,hydrationRouteProperties:Vq,dataStrategy:e?.dataStrategy,patchRoutesOnNavigation:e?.patchRoutesOnNavigation,window:e?.window,instrumentations:e?.instrumentations}).initialize()}function kV(){let t=window?.__staticRouterHydrationData;return t&&t.errors&&(t={...t,errors:EV(t.errors)}),t}function EV(t){if(!t)return null;let e=Object.entries(t),n={};for(let[i,r]of e)if(r&&r.__type==="RouteErrorResponse")n[i]=new Fm(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type==="Error"){if(typeof r.__subType=="string"&&MW.includes(r.__subType)){let o=window[r.__subType];if(typeof o=="function")try{let l=new o(r.message);l.stack="",n[i]=l}catch{}}if(n[i]==null){let o=new Error(r.message);o.stack="",n[i]=o}}else n[i]=r;return n}var Xl=M.forwardRef(function({onClick:e,discover:n="render",prefetch:i="none",relative:r,reloadDocument:o,replace:l,mask:u,state:d,target:f,to:p,preventScrollReset:g,viewTransition:v,defaultShouldRevalidate:y,...b},x){let{basename:S,navigator:k,useTransitions:T}=M.useContext(Zs),C=typeof p=="string"&&aw.test(p),A=oL(p,S);p=A.to;let $=Cq(p,{relative:r}),N=ms(),j=null;if(u){let ce=cw(u,[],N.mask?N.mask.pathname:"/",!0);S!=="/"&&(ce.pathname=ce.pathname==="/"?S:Ds([S,ce.pathname])),j=k.createHref(ce)}let[O,L,B]=mV(i,b),V=RV(p,{replace:l,mask:u,state:d,target:f,preventScrollReset:g,relative:r,viewTransition:v,defaultShouldRevalidate:y,useTransitions:T});function ee(ce){e&&e(ce),ce.defaultPrevented||V(ce)}let me=!(A.isExternal||o),ne=M.createElement("a",{...b,...B,href:(me?j:void 0)||A.absoluteURL||$,onClick:me?ee:e,ref:wV(x,L),target:f,"data-discover":!C&&n==="render"?"true":void 0});
12return O&&!C?M.createElement(M.Fragment,null,ne,M.createElement(vV,{page:$})):ne});Xl.displayName="Link";var TV=M.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:i="",end:r=!1,style:o,to:l,viewTransition:u,children:d,...f},p){let g=Wm(l,{relative:f.relative}),v=ms(),y=M.useContext(Km),{navigator:b,basename:x}=M.useContext(Zs),S=y!=null&&MV(g)&&u===!0,k=b.encodeLocation?b.encodeLocation(g).pathname:g.pathname,T=v.pathname,C=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;n||(T=T.toLowerCase(),C=C?C.toLowerCase():null,k=k.toLowerCase()),C&&x&&(C=Us(C,x)||C);const A=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let $=T===k||!r&&T.startsWith(k)&&T.charAt(A)==="/",N=C!=null&&(C===k||!r&&C.startsWith(k)&&C.charAt(k.length)==="/"),j={isActive:$,isPending:N,isTransitioning:S},O=$?e:void 0,L;typeof i=="function"?L=i(j):L=[i,$?"active":null,N?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let B=typeof o=="function"?o(j):o;return M.createElement(Xl,{...f,"aria-current":O,className:L,ref:p,style:B,to:l,viewTransition:u},typeof d=="function"?d(j):d)});TV.displayName="NavLink";var CV=M.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:i,replace:r,state:o,method:l=e_,action:u,onSubmit:d,relative:f,preventScrollReset:p,viewTransition:g,defaultShouldRevalidate:v,...y},b)=>{let{useTransitions:x}=M.useContext(Zs),S=PV(),k=NV(u,{relative:f}),T=l.toLowerCase()==="get"?"get":"post",C=typeof u=="string"&&aw.test(u),A=$=>{if(d&&d($),$.defaultPrevented)return;$.preventDefault();let N=$.nativeEvent.submitter,j=N?.getAttribute("formmethod")||l,O=()=>S(N||$.currentTarget,{fetcherKey:e,method:j,navigate:n,replace:r,state:o,relative:f,preventScrollReset:p,viewTransition:g,defaultShouldRevalidate:v});x&&n!==!1?M.startTransition(()=>O()):O()};return M.createElement("form",{ref:b,method:T,action:k,onSubmit:i?d:A,...y,"data-discover":!C&&t==="render"?"true":void 0})});CV.displayName="Form";function OV(t){return`${t} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function AL(t){let e=M.useContext(Uu);return St(e,OV(t)),e}function RV(t,{target:e,replace:n,mask:i,state:r,preventScrollReset:o,relative:l,viewTransition:u,defaultShouldRevalidate:d,useTransitions:f}={}){let p=Zm(),g=ms(),v=Wm(t,{relative:l});return M.useCallback(y=>{if(iV(y,e)){y.preventDefault();let b=n!==void 0?n:Hr(g)===Hr(v),x=()=>p(t,{replace:b,mask:i,state:r,preventScrollReset:o,relative:l,viewTransition:u,defaultShouldRevalidate:d});f?M.startTransition(()=>x()):x()}},[g,p,v,n,i,r,e,t,o,l,u,d,f])}function $V(t){Qn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let e=M.useRef(ZE(t)),n=M.useRef(!1),i=ms(),r=M.useMemo(()=>rV(i.search,n.current?null:e.current),[i.search]),o=Zm(),l=M.useCallback((u,d)=>{const f=ZE(typeof u=="function"?u(new URLSearchParams(r)):u);n.current=!0,o("?"+f,d)},[o,r]);return[r,l]}var AV=0,jV=()=>`__${String(++AV)}__`;function PV(){let{router:t}=AL("useSubmit"),{basename:e}=M.useContext(Zs),n=Uq(),i=t.fetch,r=t.navigate;return M.useCallback(async(o,l={})=>{let{action:u,method:d,encType:f,formData:p,body:g}=aV(o,e);if(l.navigate===!1){let v=l.fetcherKey||jV();await i(v,n,l.action||u,{defaultShouldRevalidate:l.defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:p,body:g,formMethod:l.method||d,formEncType:l.encType||f,flushSync:l.flushSync})}else await r(l.action||u,{defaultShouldRevalidate:l.defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:p,body:g,formMethod:l.method||d,formEncType:l.encType||f,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[i,r,e,n])}function NV(t,{relative:e}={}){let{basename:n}=M.useContext(Zs),i=M.useContext(oa);St(i,"useFormAction must be used inside a RouteContext");let[r]=i.matches.slice(-1),o={...Wm(t||".",{relative:e})},l=ms();if(t==null){o.search=l.search;let u=new URLSearchParams(o.search),d=u.getAll("index");if(d.some(p=>p==="")){u.delete("index"),d.filter(g=>g).forEach(g=>u.append("index",g));let p=u.toString();o.search=p?`?${p}`:""}}return(!t||t===".")&&r.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Ds([n,o.pathname])),Hr(o)}function MV(t,{relative:e}={}){let n=M.useContext(gC);St(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=AL("useViewTransitionState"),r=Wm(t,{relative:e});if(!n.isTransitioning)return!1;let o=Us(n.currentLocation.pathname,i)||n.currentLocation.pathname,l=Us(n.nextLocation.pathname,i)||n.nextLocation.pathname;return am(r.pathname,l)!=null||am(r.pathname,o)!=null}var IV=VD();function zV(t){return M.createElement(Gq,{flushSync:IV.flushSync,...t})}
12var WE=function(t,e){return WE=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},WE(t,e)};function DV(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");WE(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var Pi=function(){return Pi=Object.assign||function(e){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Pi.apply(this,arguments)};function uN(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n}function io(t,e,n,i){function r(o){return o instanceof n?o:new n(function(l){l(o)})}return new(n||(n=Promise))(function(o,l){function u(p){try{f(i.next(p))}catch(g){l(g)}}function d(p){try{f(i.throw(p))}catch(g){l(g)}}function f(p){p.done?o(p.value):r(p.value).then(u,d)}f((i=i.apply(t,e||[])).next())})}function ro(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,l=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return l.next=u(0),l.throw=u(1),l.return=u(2),typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function u(f){return function(p){return d([f,p])}}function d(f){if(i)throw new TypeError("Generator is already executing.");for(;l&&(l=0,f[0]&&(n=0)),n;)try{if(i=1,r&&(o=f[0]&2?r.return:f[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,f[1])).done)return o;switch(r=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return n.label++,{value:f[1],done:!1};case 5:n.label++,r=f[1],f=[0];continue;case 7:f=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){n=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){n.label=f[1];break}if(f[0]===6&&n.label<o[1]){n.label=o[1],o=f;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(f);break}o[2]&&n.ops.pop(),n.trys.pop();continue}f=e.call(t,n)}catch(p){f=[6,p],r=0}finally{i=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function LV(t,e,n){for(var i=0,r=e.length,o;i<r;i++)(o||!(i in e))&&(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}function Mr(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n}function Uc(t,e,n,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(t):i?i.value:e.get(t)}function dN(t,e,n,i,r){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}function jL(t,e){this.v=t,this.k=e}function hN(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function Ne(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}function UV(t){return new jL(t,0)}function PL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function J(t,e){return t.get(Ne(t,e))}function ct(t,e,n){PL(t,e),e.set(t,n)}function ft(t,e,n){return t.set(Ne(t,e),n),n}function cf(t,e){PL(t,e),e.add(t)}function _e(t,e,n){return(e=(function(i){var r=(function(o,l){if(typeof o!="object"||!o)return o;var u=o[Symbol.toPrimitive];if(u!==void 0){var d=u.call(o,l);
12if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(l==="string"?String:Number)(o)})(i,"string");return typeof r=="symbol"?r:r+""})(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fN(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function Ee(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?fN(Object(n),!0).forEach(function(i){_e(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fN(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function pN(t,e){if(t==null)return{};var n,i,r=(function(l,u){if(l==null)return{};var d={};for(var f in l)if({}.hasOwnProperty.call(l,f)){if(u.indexOf(f)!==-1)continue;d[f]=l[f]}return d})(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function lr(t,e){return(function(n){if(Array.isArray(n))return n})(t)||(function(n,i){var r=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(r!=null){var o,l,u,d,f=[],p=!0,g=!1;try{if(u=(r=r.call(n)).next,i===0){if(Object(r)!==r)return;p=!1}else for(;!(p=(o=u.call(r)).done)&&(f.push(o.value),f.length!==i);p=!0);}catch(v){g=!0,l=v}finally{try{if(!p&&r.return!=null&&(d=r.return(),Object(d)!==d))return}finally{if(g)throw l}}return f}})(t,e)||(function(n,i){if(n){if(typeof n=="string")return hN(n,i);var r={}.toString.call(n).slice(8,-1);return r==="Object"&&n.constructor&&(r=n.constructor.name),r==="Map"||r==="Set"?Array.from(n):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?hN(n,i):void 0}})(t,e)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
13In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function NL(t){return function(){return new ag(t.apply(this,arguments))}}function ag(t){var e,n;function i(o,l){try{var u=t[o](l),d=u.value,f=d instanceof jL;Promise.resolve(f?d.v:d).then(function(p){if(f){var g=o==="return"&&d.k?o:"next";if(!d.k||p.done)return i(g,p);p=t[g](p).value}r(!!u.done,p)},function(p){i("throw",p)})}catch(p){r(2,p)}}function r(o,l){o===2?e.reject(l):e.resolve({value:l,done:o}),(e=e.next)?i(e.key,e.arg):n=null}this._invoke=function(o,l){return new Promise(function(u,d){var f={key:o,arg:l,resolve:u,reject:d,next:null};n?n=n.next=f:(e=n=f,i(o,l))})},typeof t.return!="function"&&(this.return=void 0)}typeof SuppressedError=="function"&&SuppressedError,ag.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},ag.prototype.next=function(t){return this._invoke("next",t)},ag.prototype.throw=function(t){return this._invoke("throw",t)},ag.prototype.return=function(t){return this._invoke("return",t)};const FV={timeoutInSeconds:60},qE=1e4,gN="memory",mN="Multifactor authentication required",ML="online_access",VE={name:"auth0-spa-js",version:"2.27.0"},IL=()=>Date.now(),Ai="default";let Qt=class BE extends Error{constructor(e,n){super(n),this.error=e,this.error_description=n,Object.setPrototypeOf(this,BE.prototype)}static fromPayload(e){let n=e.error,i=e.error_description;return new BE(n,i)}},vN=class zL extends Qt{constructor(e,n){super("invalid_configuration","".concat(e," ").concat(n)),this.suggestion=n,Object.setPrototypeOf(this,zL.prototype)}},HV=class DL extends Qt{constructor(e,n,i){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;super(e,n),this.state=i,this.appState=r,Object.setPrototypeOf(this,DL.prototype)}},KV=class LL extends Qt{constructor(e,n,i,r){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null;super(e,n),this.connection=i,this.state=r,this.appState=o,Object.setPrototypeOf(this,LL.prototype)}},fw=class UL extends Qt{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,UL.prototype)}},ZV=class FL extends fw{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,FL.prototype)}}
13,WV=class HL extends Qt{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,HL.prototype)}},qV=class KL extends Qt{constructor(){super("popup_open","Unable to open a popup for loginWithPopup - window.open returned `null`"),Object.setPrototypeOf(this,KL.prototype)}},GE=class ZL extends Qt{constructor(e,n,i,r){super(e,n),this.mfa_token=i,this.mfa_requirements=r,Object.setPrototypeOf(this,ZL.prototype)}},WL=class qL extends Qt{constructor(e,n){super("missing_refresh_token","Missing Refresh Token (audience: '".concat(X_(e,["default"]),"', scope: '").concat(X_(n),"')")),this.audience=e,this.scope=n,Object.setPrototypeOf(this,qL.prototype)}},VV=class VL extends Qt{constructor(e,n){super("missing_scopes","Missing requested scopes after refresh (audience: '".concat(X_(e,["default"]),"', missing scope: '").concat(X_(n),"')")),this.audience=e,this.scope=n,Object.setPrototypeOf(this,VL.prototype)}},BL=class GL extends Qt{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,GL.prototype)}};function X_(t){return t&&!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:[]).includes(t)?t:""}const Y_=()=>window.crypto,gp=()=>{const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let e="";for(;e.length<43;){const n=Y_().getRandomValues(new Uint8Array(43-e.length));for(const i of n)e.length<43&&i<198&&(e+=t[i%66])}return e},Ik=t=>btoa(t),BV=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],JE=function(t){let e=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return Object.keys(t).reduce((n,i)=>{if(e&&i==="env")return n;const r=BV.find(o=>o.key===i);return r&&r.type.includes(typeof t[i])&&(n[i]=t[i]),n},{})},lg=t=>{var e=t.clientId,n=Mr(t,["clientId"]);return new URLSearchParams((i=>Object.keys(i).filter(r=>i[r]!==void 0).reduce((r,o)=>Object.assign(Object.assign({},r),{[o]:i[o]}),{}))(Object.assign({client_id:e},n))).toString()},yN=async t=>await Y_().subtle.digest({name:"SHA-256"},new TextEncoder().encode(t)),_N=t=>(e=>decodeURIComponent(atob(e).split("").map(n=>"%"+("00"+n.charCodeAt(0).toString(16)).slice(-2)).join("")))(t.replace(/_/g,"/").replace(/-/g,"+")),bN=t=>{const e=new Uint8Array(t);return(n=>{const i={"+":"-","/":"_","=":""};return n.replace(/[+/=]/g,r=>i[r])})(window.btoa(String.fromCharCode(...Array.from(e))))};var Pu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},JL={},xC={};Object.defineProperty(xC,"__esModule",{value:!0});var GV=(function(){function t(){var e=this;this.locked=new Map,this.addToLocked=function(n,i){var r=e.locked.get(n);r===void 0?i===void 0?e.locked.set(n,[]):e.locked.set(n,[i]):i!==void 0&&(r.unshift(i),e.locked.set(n,r))},this.isLocked=function(n){return e.locked.has(n)},this.lock=function(n){return new Promise(function(i,r){e.isLocked(n)?e.addToLocked(n,i):(e.addToLocked(n),i())})},this.unlock=function(n){var i=e.locked.get(n);if(i!==void 0&&i.length!==0){var r=i.pop();e.locked.set(n,i),r!==void 0&&setTimeout(r,0)}else e.locked.delete(n)}}return t.getInstance=function(){return t.instance===void 0&&(t.instance=new t),t.instance},t})();xC.default=function(){return GV.getInstance()};var ho=Pu&&Pu.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,o){function l(f){try{d(i.next(f))}catch(p){o(p)}}function u(f){try{d(i.throw(f))}catch(p){o(p)}}function d(f){f.done?r(f.value):new n(function(p){p(f.value)}).then(l,u)}d((i=i.apply(t,e||[])).next())})},fo=Pu&&Pu.__generator||function(t,e){var n,i,r,o,l={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(d){return function(f){return(function(p){if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,i&&(r=2&p[0]?i.return:p[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,p[1])).done)return r;switch(i=0,r&&(p=[2&p[0],r.value]),p[0]){case 0:case 1:r=p;break;case 4:return l.label++,{value:p[1],done:!1};case 5:l.label++,i=p[1],p=[0];continue;case 7:p=l.ops.pop(),l.trys.pop();continue;default:if(r=l.trys,!((r=r.length>0&&r[r.length-1])||p[0]!==6&&p[0]!==2)){l=0;continue}if(p[0]===3&&(!r||p[1]>r[0]&&p[1]<r[3])){l.label=p[1];break}if(p[0]===6&&l.label<r[1]){l.label=r[1],r=p;break}if(r&&l.label<r[2]){l.label=r[2],l.ops.push(p);break}r[2]&&l.ops.pop(),l.trys.pop();continue}p=e.call(t,l)}catch(g){p=[6,g],i=0}finally{n=r=0}if(5&p[0])throw p[1];return{value:p[0]?p[1]:void 0,done:!0}})([d,f])}}},mp=Pu;
vendor: 4,099 bytes, line 13
13Object.defineProperty(JL,"__esModule",{value:!0});var Nd=xC,zk="browser-tabs-lock-key",Hy={key:function(t){return ho(mp,void 0,void 0,function(){return fo(this,function(e){throw new Error("Unsupported")})})},getItem:function(t){return ho(mp,void 0,void 0,function(){return fo(this,function(e){throw new Error("Unsupported")})})},clear:function(){return ho(mp,void 0,void 0,function(){return fo(this,function(t){return[2,window.localStorage.clear()]})})},removeItem:function(t){return ho(mp,void 0,void 0,function(){return fo(this,function(e){throw new Error("Unsupported")})})},setItem:function(t,e){return ho(mp,void 0,void 0,function(){return fo(this,function(n){throw new Error("Unsupported")})})},keySync:function(t){return window.localStorage.key(t)},getItemSync:function(t){return window.localStorage.getItem(t)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(t){return window.localStorage.removeItem(t)},setItemSync:function(t,e){return window.localStorage.setItem(t,e)}};function Dk(t){return new Promise(function(e){return setTimeout(e,t)})}function Lk(t){for(var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",n="",i=0;i<t;i++)n+=e[Math.floor(61*Math.random())];return n}var JV=(function(){function t(e){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+Lk(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=e,t.waiters===void 0&&(t.waiters=[])}return t.prototype.acquireLock=function(e,n){return n===void 0&&(n=5e3),ho(this,void 0,void 0,function(){var i,r,o,l,u,d,f;return fo(this,function(p){switch(p.label){case 0:i=Date.now()+Lk(4),r=Date.now()+n,o=zk+"-"+e,l=this.storageHandler===void 0?Hy:this.storageHandler,p.label=1;case 1:return Date.now()<r?[4,Dk(30)]:[3,8];case 2:return p.sent(),l.getItemSync(o)!==null?[3,5]:(u=this.id+"-"+e+"-"+i,[4,Dk(Math.floor(25*Math.random()))]);case 3:return p.sent(),l.setItemSync(o,JSON.stringify({id:this.id,iat:i,timeoutKey:u,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,Dk(30)];case 4:return p.sent(),(d=l.getItemSync(o))!==null&&(f=JSON.parse(d)).id===this.id&&f.iat===i?(this.acquiredIatSet.add(i),this.refreshLockWhileAcquired(o,i),[2,!0]):[3,7];case 5:return t.lockCorrector(this.storageHandler===void 0?Hy:this.storageHandler),[4,this.waitForSomethingToChange(r)];case 6:p.sent(),p.label=7;case 7:return i=Date.now()+Lk(4),[3,1];case 8:return[2,!1]}})})},t.prototype.refreshLockWhileAcquired=function(e,n){return ho(this,void 0,void 0,function(){var i=this;return fo(this,function(r){return setTimeout(function(){return ho(i,void 0,void 0,function(){var o,l,u;return fo(this,function(d){switch(d.label){case 0:return[4,Nd.default().lock(n)];case 1:return d.sent(),this.acquiredIatSet.has(n)?(o=this.storageHandler===void 0?Hy:this.storageHandler,(l=o.getItemSync(e))===null?(Nd.default().unlock(n),[2]):((u=JSON.parse(l)).timeRefreshed=Date.now(),o.setItemSync(e,JSON.stringify(u)),Nd.default().unlock(n),this.refreshLockWhileAcquired(e,n),[2])):(Nd.default().unlock(n),[2])}})})},1e3),[2]})})},t.prototype.waitForSomethingToChange=function(e){return ho(this,void 0,void 0,function(){return fo(this,function(n){switch(n.label){case 0:return[4,new Promise(function(i){var r=!1,o=Date.now(),l=!1;function u(){if(l||(window.removeEventListener("storage",u),t.removeFromWaiting(u),clearTimeout(d),l=!0),!r){r=!0;var f=50-(Date.now()-o);f>0?setTimeout(i,f):i(null)}}window.addEventListener("storage",u),t.addToWaiting(u);var d=setTimeout(u,Math.max(0,e-Date.now()))})];case 1:return n.sent(),[2]}})})},t.addToWaiting=function(e){this.removeFromWaiting(e),t.waiters!==void 0&&t.waiters.push(e)},t.removeFromWaiting=function(e){t.waiters!==void 0&&(t.waiters=t.waiters.filter(function(n){return n!==e}))},t.notifyWaiters=function(){t.waiters!==void 0&&t.waiters.slice().forEac
13h(function(e){return e()})},t.prototype.releaseLock=function(e){return ho(this,void 0,void 0,function(){return fo(this,function(n){switch(n.label){case 0:return[4,this.releaseLock__private__(e)];case 1:return[2,n.sent()]}})})},t.prototype.releaseLock__private__=function(e){return ho(this,void 0,void 0,function(){var n,i,r,o;return fo(this,function(l){switch(l.label){case 0:return n=this.storageHandler===void 0?Hy:this.storageHandler,i=zk+"-"+e,(r=n.getItemSync(i))===null?[2]:(o=JSON.parse(r)).id!==this.id?[3,2]:[4,Nd.default().lock(o.iat)];case 1:l.sent(),this.acquiredIatSet.delete(o.iat),n.removeItemSync(i),Nd.default().unlock(o.iat),t.notifyWaiters(),l.label=2;case 2:return[2]}})})},t.lockCorrector=function(e){for(var n=Date.now()-5e3,i=e,r=[],o=0;;){var l=i.keySync(o);if(l===null)break;r.push(l),o++}for(var u=!1,d=0;d<r.length;d++){var f=r[d];if(f.includes(zk)){var p=i.getItemSync(f);if(p!==null){var g=JSON.parse(p);(g.timeRefreshed===void 0&&g.timeAcquired<n||g.timeRefreshed!==void 0&&g.timeRefreshed<n)&&(i.removeItemSync(f),u=!0)}}}u&&t.notifyWaiters()},t.waiters=void 0,t})(),XV=JL.default=JV;let YV=class{async runWithLock(e,n,i){const r=new AbortController,o=setTimeout(()=>r.abort(),n);try{return await navigator.locks.request(e,{mode:"exclusive",signal:r.signal},async l=>{if(clearTimeout(o),!l)throw new Error("Lock not available");return await i()})}catch(l){throw clearTimeout(o),l?.name==="AbortError"?new fw:l}}},QV=class{constructor(){this.activeLocks=new Set,this.lock=new XV,this.pagehideHandler=()=>{this.activeLocks.forEach(e=>this.lock.releaseLock(e)),this.activeLocks.clear()}}async runWithLock(e,n,i){let r=!1;for(let o=0;o<10&&!r;o++)r=await this.lock.acquireLock(e,n);if(!r)throw new fw;this.activeLocks.add(e),this.activeLocks.size===1&&typeof window<"u"&&window.addEventListener("pagehide",this.pagehideHandler);try{return await i()}finally{this.activeLocks.delete(e),await this.lock.releaseLock(e),this.activeLocks.size===0&&typeof window<"u"&&window.removeEventListener("pagehide",this.pagehideHandler)}}};function eB(){return typeof navigator<"u"&&typeof((t=navigator.locks)===null||t===void 0?void 0:t.request)=="function"?new YV:new QV;var t}let Uk=null;function XL(){return Uk||(Uk=eB()),Uk}const tB=new TextEncoder,nB=new TextDecoder;function Og(t){return typeof t=="string"?tB.encode(t):nB.decode(t)}function wN(t){if(typeof t.modulusLength!="number"||t.modulusLength<2048)throw new rB(`${t.name} modulusLength must be at least 2048 bits`)}async function iB(t,e,n){if(n.usages.includes("sign")===!1)throw new TypeError('private CryptoKey instances used for signing assertions must include "sign" in their "usages"');const i=`${Rg(Og(JSON.stringify(t)))}.${Rg(Og(JSON.stringify(e)))}`;return`${i}.${Rg(await crypto.subtle.sign((function(r){switch(r.algorithm.name){case"ECDSA":return{name:r.algorithm.name,hash:"SHA-256"};case"RSA-PSS":return wN(r.algorithm),{name:r.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return wN(r.algorithm),{name:r.algorithm.name};case"Ed25519":return{name:r.algorithm.name}}throw new hu})(n),n,Og(i)))}`}let XE;Uint8Array.prototype.toBase64?XE=t=>(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t.toBase64({alphabet:"base64url",omitPadding:!0})):XE=e=>{e instanceof ArrayBuffer&&(e=new Uint8Array(e));const n=[];for(let i=0;i<e.byteLength;i+=32768)n.push(String.fromCharCode.apply(null,e.subarray(i,i+32768)));return btoa(n.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")};function Rg(t){return XE(t)}let hu=class extends Error{constructor(e){var n;super(e??"operation not supported"),this.name=this.constructor.name,(n=Error.captureStackTrace)===null||n===void 0||n.call(Error,this,this.constructor)}},rB=class extends Error{constructor(e){var n;super(e),this.name=this.constructor.name,(n=Error.captureStackTrace)===null||n===void 0||n.call(Error,this,this.constructor)}};function sB(t){switch(t.algorithm.name){case"RSA-PSS":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"PS256";throw new hu("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"RSASSA-PKCS1-v1_5":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"RS256";throw new hu("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"ECDSA":return(function(e){if(e.algorithm.namedCurve==="P-256")return"ES256";throw new hu("unsupported EcKeyAlgorithm namedCurve")})(t);case"Ed25519":return"Ed25519";default:throw new hu("unsupported CryptoKey algorithm name")}}function YL(t){return t instanceof CryptoKey}function QL(t){return YL(t)&&t.type==="public"}async function oB(t,e,n,i,r,o){const l=t?.privateKey,u=t?.publicKey;if(!YL(d=l)||d.type!=="private")throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var d;if(!QL(u))throw new TypeError('"keypair.publicKey" must be a public CryptoKey');if(u.extractable!==!0)throw new TypeError('"keypair.publicKey.extractable" must be true');
13if(typeof e!="string")throw new TypeError('"htu" must be a string');if(typeof n!="string")throw new TypeError('"htm" must be a string');if(i!==void 0&&typeof i!="string")throw new TypeError('"nonce" must be a string or undefined');if(r!==void 0&&typeof r!="string")throw new TypeError('"accessToken" must be a string or undefined');const f=Object.assign(Object.create(null),o,{iat:Math.floor(Date.now()/1e3),jti:crypto.randomUUID(),htm:n,nonce:i,htu:e,ath:r?Rg(await crypto.subtle.digest("SHA-256",Og(r))):void 0});return iB({alg:sB(l),typ:"dpop+jwt",jwk:await e5(u)},f,l)}async function e5(t){const{kty:e,e:n,n:i,x:r,y:o,crv:l}=await crypto.subtle.exportKey("jwk",t);return{kty:e,crv:l,e:n,n:i,x:r,y:o}}const t5="dpop-nonce",aB=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:token-exchange","urn:okta:params:oauth:grant-type:webauthn","http://auth0.com/oauth/grant-type/mfa-oob","http://auth0.com/oauth/grant-type/mfa-otp","http://auth0.com/oauth/grant-type/mfa-recovery-code"];function lB(){return(async function(t,e){var n;let i;if(t.length===0)throw new TypeError('"alg" must be a non-empty string');switch(t){case"PS256":i={name:"RSA-PSS",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"RS256":i={name:"RSASSA-PKCS1-v1_5",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"ES256":i={name:"ECDSA",namedCurve:"P-256"};break;case"Ed25519":i={name:"Ed25519"};break;default:throw new hu}return crypto.subtle.generateKey(i,(n=e?.extractable)!==null&&n!==void 0&&n,["sign","verify"])})("ES256",{extractable:!1})}function cB(t){return(async function(e){if(!QL(e))throw new TypeError('"publicKey" must be a public CryptoKey');if(e.extractable!==!0)throw new TypeError('"publicKey.extractable" must be true');const n=await e5(e);let i;switch(n.kty){case"EC":i={crv:n.crv,kty:n.kty,x:n.x,y:n.y};break;case"OKP":i={crv:n.crv,kty:n.kty,x:n.x};break;case"RSA":i={e:n.e,kty:n.kty,n:n.n};break;default:throw new hu("unsupported JWK kty")}return Rg(await crypto.subtle.digest({name:"SHA-256"},Og(JSON.stringify(i))))})(t.publicKey)}function uB(t){let e=t.keyPair,n=t.url,i=t.method,r=t.nonce,o=t.accessToken;const l=(function(u){const d=new URL(u);return d.search="",d.hash="",d.href})(n);return oB(e,l,i,r,o)}const YE=(t,e)=>new Promise(function(n,i){const r=new MessageChannel;r.port1.onmessage=function(o){o.data.error?i(new Error(o.data.error)):n(o.data),r.port1.close()},e.postMessage(t,[r.port2])}),n5=(t,e,n)=>{const i=new AbortController;let r;return e.signal=i.signal,Promise.race([fetch(t,e),new Promise((o,l)=>{r=setTimeout(()=>{i.abort(),l(new Error("Timeout when executing 'fetch'"))},n)})]).finally(()=>{clearTimeout(r)})},dB=async function(t,e,n,i,r,o){let l=arguments.length>6&&arguments[6]!==void 0?arguments[6]:qE;return r?(async(u,d,f,p,g,v,y,b,x,S)=>YE({type:"refresh",auth:{audience:d,scope:f},timeout:g,fetchUrl:u,fetchOptions:p,useFormData:y,useMrrt:b,skipTokenStorage:x,preserveRefreshToken:S},v))(t,e,n,i,l,r,o,arguments.length>7?arguments[7]:void 0,arguments.length>8?arguments[8]:void 0,arguments.length>9?arguments[9]:void 0):(async(u,d,f)=>{const p=await n5(u,d,f);return{ok:p.ok,json:await p.json(),headers:(g=p.headers,[...g].reduce((v,y)=>{let b=lr(y,2),x=b[0],S=b[1];return v[x]=S,v},{}))};var g})(t,i,l)};async function i5(t,e,n,i,r,o,l,u,d,f,p,g){if(d){const N=await d.generateProof({url:t,method:r.method||"GET",nonce:await d.getNonce()});r.headers=Object.assign(Object.assign({},r.headers),{dpop:N})}let v,y=null;for(let N=0;N<3;N++)try{v=await dB(t,n,i,r,o,l,e,u,p,g),y=null;break}catch(j){y=j}if(y)throw y;const b=v.json,x=b.error,S=b.error_description,k=Mr(b,["error","error_description"]),T=v,C=T.headers,A=T.ok;let $;if(d&&($=C[t5],$&&await d.setNonce($)),!A){const N=S||"HTTP error. Unable to fetch ".concat(t);if(x==="mfa_required")throw new GE(x,N,k.mfa_token,k.mfa_requirements);if(x==="missing_refresh_token")throw new WL(n,i);if(x==="use_dpop_nonce"){if(!d||!$||f)throw new BL($);return i5(t,e,n,i,r,o,l,u,d,!0,p,g)}throw new Qt(x||"request_error",N)}return k}async function xN(t,e,n){var i=t.baseUrl,r=t.timeout,o=t.audience,l=t.scope,u=t.auth0Client,d=t.useFormData,f=t.useMrrt,p=t.dpop,g=t.preserveRefreshToken,v=Mr(t,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop","preserveRefreshToken"]);const y=v.grant_type==="urn:ietf:params:oauth:grant-type:token-exchange",b=v.grant_type==="urn:okta:params:oauth:grant-type:webauthn",x=v.grant_type==="refresh_token"&&f,S=y||b||x,k=Object.assign(Object.assign(Object.assign({},v),S&&o&&{audience:o}),S&&l&&{scope:l}),T=b||!d,C=T?JSON.stringify(k):lg(k),A=($=v.grant_type,aB.includes($));var $;return await i5("".concat(i,"/oauth/token"),r,o||Ai,l,{method:"POST",body:C,headers:{"Content-Type":T?"application/json":"application/x-www-form-urlencoded","Auth0-Client":btoa(JSON.stringify(J
13E(u||VE)))}},e,d,f,A?p:void 0,void 0,n,g)}const n_=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return(i=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(i))).join(" ");var i},vp=(t,e,n)=>{let i;return n&&(i=t[n]),i||(i=t[Ai]),n_(i,e)},fu="@@auth0spajs@@",Yc="@@user@@";let Er=class QE{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fu,i=arguments.length>2?arguments[2]:void 0;this.prefix=n,this.suffix=i,this.clientId=e.clientId,this.scope=e.scope,this.audience=e.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(e){const n=lr(e.split("::"),4),i=n[0],r=n[1],o=n[2],l=n[3];return new QE({clientId:r,scope:l,audience:o},i)}static fromCacheEntry(e){const n=e.scope,i=e.audience,r=e.client_id;return new QE({scope:n,audience:i,clientId:r})}},hB=class{set(e,n){localStorage.setItem(e,JSON.stringify(n))}get(e){const n=window.localStorage.getItem(e);if(n)try{return JSON.parse(n)}catch{return}}remove(e){localStorage.removeItem(e)}allKeys(){return Object.keys(window.localStorage).filter(e=>e.startsWith(fu))}},r5=class{constructor(){this.enclosedCache=(function(){let e={};return{set(n,i){e[n]=i},get(n){const i=e[n];if(i)return i},remove(n){delete e[n]},allKeys:()=>Object.keys(e)}})()}},fB=class{constructor(e,n,i){this.cache=e,this.keyManifest=n,this.nowProvider=i||IL}async setIdToken(e,n,i){var r;const o=this.getIdTokenCacheKey(e);await this.cache.set(o,{id_token:n,decodedToken:i}),await((r=this.keyManifest)===null||r===void 0?void 0:r.add(o))}async getIdToken(e){const n=await this.cache.get(this.getIdTokenCacheKey(e.clientId));if(!n&&e.scope&&e.audience){const i=await this.get(e);return!i||!i.id_token||!i.decodedToken?void 0:{id_token:i.id_token,decodedToken:i.decodedToken}}if(n)return{id_token:n.id_token,decodedToken:n.decodedToken}}async get(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=arguments.length>3?arguments[3]:void 0;var o;let l=await this.cache.get(e.toKey()),u=e;if(!l){const p=await this.getCacheKeys();if(!p)return;const g=this.matchExistingCacheKey(e,p);if(g&&(l=await this.cache.get(g),u=Er.fromKey(g)),!l&&i&&r!=="cache-only")return this.getEntryWithRefreshToken(e,p)}if(!l)return;const d=await this.nowProvider(),f=Math.floor(d/1e3);return l.expiresAt-n<f?l.body.refresh_token?this.modifiedCachedEntry(l,u):(await this.cache.remove(u.toKey()),void await((o=this.keyManifest)===null||o===void 0?void 0:o.remove(u.toKey()))):l.body}async modifiedCachedEntry(e,n){const i={refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope},r={body:i,expiresAt:e.expiresAt};return await this.cache.set(n.toKey(),r),{refresh_token:i.refresh_token,audience:i.audience,scope:i.scope}}async set(e){var n;const i=new Er({clientId:e.client_id,scope:e.scope,audience:e.audience}),r=await this.wrapCacheEntry(e);await this.cache.set(i.toKey(),r),await((n=this.keyManifest)===null||n===void 0?void 0:n.add(i.toKey()))}async remove(e,n,i){const r=new Er({clientId:e,scope:i,audience:n});await this.cache.remove(r.toKey())}async stripRefreshToken(e){var n;const i=await this.getCacheKeys();if(i)for(const r of i){const o=await this.cache.get(r);((n=o?.body)===null||n===void 0?void 0:n.refresh_token)===e&&(delete o.body.refresh_token,await this.cache.set(r,o))}}async clear(e){var n;const i=await this.getCacheKeys();i&&(await i.filter(r=>!e||r.includes(e)).reduce(async(r,o)=>{await r,await this.cache.remove(o)},Promise.resolve()),await((n=this.keyManifest)===null||n===void 0?void 0:n.clear()))}async wrapCacheEntry(e){const n=await this.nowProvider();return{body:e,expiresAt:Math.floor(n/1e3)+e.expires_in}}async getCacheKeys(){var e;return this.keyManifest?(e=await this.keyManifest.get())===null||e===void 0?void 0:e.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(e){return new Er({clientId:e},fu,Yc).toKey()}matchExistingCacheKey(e,n){return n.filter(i=>{var r;const o=Er.fromKey(i),l=new Set(o.scope&&o.scope.split(" ")),u=((r=e.scope)===null||r===void 0?void 0:r.split(" "))||[],d=o.scope&&u.reduce((f,p)=>f&&l.has(p),!0);return o.prefix===fu&&o.clientId===e.clientId&&o.audience===e.audience&&d})[0]}async getEntryWithRefreshToken(e,n){var i;for(const r of n){const o=Er.fromKey(r);if(o.prefix===fu&&o.clientId===e.clientId){const l=await this.cache.get(r);if(!((i=l?.body)===null||i===void 0)&&i.refresh_token)return{refresh_token:l.body.refresh_token,audience:l.body.audience,scope:l.body.scope}}}}async getRefreshTokensByAudience(e,n){var i;const r=await this.getCacheKeys();if(!r)return[];const o=new Set;for(const l of r){const u=Er.fromKey(l);if(u.prefix===fu&&u.clientId===n&&u.audience===e){const d=await this.cache.get(l);!((i=d?.body)===null||i===void 0)&&i.refresh_token&&o.add(d.body.refresh_token)}}return Array.from(o)}async updateEntry(e,n,i){let r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];const o=await this.getCacheKeys();if(o)for(const l of o){if(Er.fromKey(l).clientId!==i)continue;const u=await this.cache.get(l);if(!u?.body)continue;const d=u.body.refresh_token;d&&(r||d===e)&&(u.body.refresh_token=n,await this.cache.set(l,u))}}},pB=class{constructor(e,n,i){this.storage=e,this.clientId=n,this.cookieDomain=i,this.storageKey="".concat("a0.spajs.txs",".").concat(this.clientId)}create(e){this.storage.save(this.storageKey,e,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}};const yp=t=>typeof t=="number",gB=["iss","aud","exp","nbf","iat","jti","azp","
13nonce","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"],mB=t=>{if(!t.id_token)throw new Error("ID token is required but missing");const e=(o=>{const l=o.split("."),u=lr(l,3),d=u[0],f=u[1],p=u[2];if(l.length!==3||!d||!f||!p)throw new Error("ID token could not be decoded");const g=JSON.parse(_N(f)),v={__raw:o},y={};return Object.keys(g).forEach(b=>{v[b]=g[b],gB.includes(b)||(y[b]=g[b])}),{encoded:{header:d,payload:f,signature:p},header:JSON.parse(_N(d)),claims:v,user:y}})(t.id_token);if(!e.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(e.claims.iss!==t.iss)throw new Error('Issuer (iss) claim mismatch in the ID token; expected "'.concat(t.iss,'", found "').concat(e.claims.iss,'"'));if(!e.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(e.header.alg!=="RS256")throw new Error('Signature algorithm of "'.concat(e.header.alg,'" is not supported. Expected the ID token to be signed with "RS256".'));if(!e.claims.aud||typeof e.claims.aud!="string"&&!Array.isArray(e.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(e.claims.aud)){if(!e.claims.aud.includes(t.aud))throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(t.aud,'" but was not one of "').concat(e.claims.aud.join(", "),'"'));if(e.claims.aud.length>1){if(!e.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(e.claims.azp!==t.aud)throw new Error('Authorized Party (azp) claim mismatch in the ID token; expected "'.concat(t.aud,'", found "').concat(e.claims.azp,'"'))}}else if(e.claims.aud!==t.aud)throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(t.aud,'" but found "').concat(e.claims.aud,'"'));if(t.nonce){if(!e.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(e.claims.nonce!==t.nonce)throw new Error('Nonce (nonce) claim mismatch in the ID token; expected "'.concat(t.nonce,'", found "').concat(e.claims.nonce,'"'))}if(t.max_age&&!yp(e.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(e.claims.exp==null||!yp(e.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!yp(e.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const n=t.leeway||60,i=new Date(t.now||Date.now()),r=new Date(0);if(r.setUTCSeconds(e.claims.exp+n),i>r)throw new Error("Expiration Time (exp) claim error in the ID token; current time (".concat(i,") is after expiration time (").concat(r,")"));if(e.claims.nbf!=null&&yp(e.claims.nbf)){const o=new Date(0);if(o.setUTCSeconds(e.claims.nbf-n),i<o)throw new Error("Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (".concat(i,") is before ").concat(o))}if(e.claims.auth_time!=null&&yp(e.claims.auth_time)){const o=new Date(0);if(o.setUTCSeconds(parseInt(e.claims.auth_time)+t.max_age+n),i>o)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 (".concat(i,") is after last auth at ").concat(o))}if(t.organization){const o=t.organization.trim();if(o.startsWith("org_")){const l=o;if(!e.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(l!==e.claims.org_id)throw new Error('Organization ID (org_id) claim mismatch in the ID token; expected "'.concat(l,'", found "').concat(e.claims.org_id,'"'))}else{const l=o.toLowerCase();if(!e.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(l!==e.claims.org_name)throw new Error('Organization Name (org_name) claim mismatch in the ID token; expected "'.concat(l,'", found "').concat(e.claims.org_name,'"'))}}return e};var cm=Pu&&Pu.__assign||function(){return cm=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},cm.apply(this,arguments)};function _p(t,e){if(!e)return"";var n="; "+t;return e===!0?n:n+"="+e}function vB(t,e,n){return encodeURIComponent(t).replace(/%(23|24|26|2B|5E|60|7C)/g,decode
13URIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(e).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+(function(i){if(typeof i.expires=="number"){var r=new Date;r.setMilliseconds(r.getMilliseconds()+864e5*i.expires),i.expires=r}return _p("Expires",i.expires?i.expires.toUTCString():"")+_p("Domain",i.domain)+_p("Path",i.path)+_p("Secure",i.secure)+_p("SameSite",i.sameSite)})(n)}function yB(){return(function(t){for(var e={},n=t?t.split("; "):[],i=/(%[\dA-F]{2})+/gi,r=0;r<n.length;r++){var o=n[r].split("="),l=o.slice(1).join("=");l.charAt(0)==='"'&&(l=l.slice(1,-1));try{e[o[0].replace(i,decodeURIComponent)]=l.replace(i,decodeURIComponent)}catch{}}return e})(document.cookie)}var _B=function(t){return yB()[t]};function s5(t,e,n){document.cookie=vB(t,e,cm({path:"/"},n))}var o5=s5,a5=function(t,e){s5(t,"",cm(cm({},e),{expires:-1}))};const ch={get(t){const e=_B(t);if(e!==void 0)return JSON.parse(e)},save(t,e,n){let i={};window.location.protocol==="https:"&&(i={secure:!0,sameSite:"none"}),n?.daysUntilExpire&&(i.expires=n.daysUntilExpire),n?.cookieDomain&&(i.domain=n.cookieDomain),o5(t,JSON.stringify(e),i)},remove(t,e){let n={};e?.cookieDomain&&(n.domain=e.cookieDomain),a5(t,n)}},Fk="_legacy_",bB={get(t){return ch.get(t)||ch.get("".concat(Fk).concat(t))},save(t,e,n){let i={};window.location.protocol==="https:"&&(i={secure:!0}),n?.daysUntilExpire&&(i.expires=n.daysUntilExpire),n?.cookieDomain&&(i.domain=n.cookieDomain),o5("".concat(Fk).concat(t),JSON.stringify(e),i),ch.save(t,e,n)},remove(t,e){let n={};e?.cookieDomain&&(n.domain=e.cookieDomain),a5(t,n),ch.remove(t,e),ch.remove("".concat(Fk).concat(t),e)}},wB={get(t){if(typeof sessionStorage>"u")return;const e=sessionStorage.getItem(t);return e!=null?JSON.parse(e):void 0},save(t,e){sessionStorage.setItem(t,JSON.stringify(e))},remove(t){sessionStorage.removeItem(t)}};var Vl;(function(t){t.Code="code",t.ConnectCode="connect_code"})(Vl||(Vl={}));function xB(t,e,n){var i=e===void 0?null:e,r=(function(d,f){var p=atob(d);if(f){for(var g=new Uint8Array(p.length),v=0,y=p.length;v<y;++v)g[v]=p.charCodeAt(v);return String.fromCharCode.apply(null,new Uint16Array(g.buffer))}return p})(t,n!==void 0&&n),o=r.indexOf(`
14`,10)+1,l=r.substring(o)+(i?"//# sourceMappingURL="+i:""),u=new Blob([l],{type:"application/javascript"});return URL.createObjectURL(u)}var SN,kN,EN,Hk,SB=(SN
vendor: 8,104 bytes, line 14
14="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7ZnVuY3Rpb24gZShlLHQpeyhudWxsPT10fHx0PmUubGVuZ3RoKSYmKHQ9ZS5sZW5ndGgpO2Zvcih2YXIgcj0wLG89QXJyYXkodCk7cjx0O3IrKylvW3JdPWVbcl07cmV0dXJuIG99ZnVuY3Rpb24gdCh0LHIpe3JldHVybiBmdW5jdGlvbihlKXtpZihBcnJheS5pc0FycmF5KGUpKXJldHVybiBlfSh0KXx8ZnVuY3Rpb24oZSx0KXt2YXIgcj1udWxsPT1lP251bGw6InVuZGVmaW5lZCIhPXR5cGVvZiBTeW1ib2wmJmVbU3ltYm9sLml0ZXJhdG9yXXx8ZVsiQEBpdGVyYXRvciJdO2lmKG51bGwhPXIpe3ZhciBvLG4scyxhLGk9W10sYz0hMCxsPSExO3RyeXtpZihzPShyPXIuY2FsbChlKSkubmV4dCwwPT09dCl7aWYoT2JqZWN0KHIpIT09cilyZXR1cm47Yz0hMX1lbHNlIGZvcig7IShjPShvPXMuY2FsbChyKSkuZG9uZSkmJihpLnB1c2goby52YWx1ZSksaS5sZW5ndGghPT10KTtjPSEwKTt9Y2F0Y2goZSl7bD0hMCxuPWV9ZmluYWxseXt0cnl7aWYoIWMmJm51bGwhPXIucmV0dXJuJiYoYT1yLnJldHVybigpLE9iamVjdChhKSE9PWEpKXJldHVybn1maW5hbGx5e2lmKGwpdGhyb3cgbn19cmV0dXJuIGl9fSh0LHIpfHxmdW5jdGlvbih0LHIpe2lmKHQpe2lmKCJzdHJpbmciPT10eXBlb2YgdClyZXR1cm4gZSh0LHIpO3ZhciBvPXt9LnRvU3RyaW5nLmNhbGwodCkuc2xpY2UoOCwtMSk7cmV0dXJuIk9iamVjdCI9PT1vJiZ0LmNvbnN0cnVjdG9yJiYobz10LmNvbnN0cnVjdG9yLm5hbWUpLCJNYXAiPT09b3x8IlNldCI9PT1vP0FycmF5LmZyb20odCk6IkFyZ3VtZW50cyI9PT1vfHwvXig/OlVpfEkpbnQoPzo4fDE2fDMyKSg/OkNsYW1wZWQpP0FycmF5JC8udGVzdChvKT9lKHQscik6dm9pZCAwfX0odCxyKXx8ZnVuY3Rpb24oKXt0aHJvdyBuZXcgVHlwZUVycm9yKCJJbnZhbGlkIGF0dGVtcHQgdG8gZGVzdHJ1Y3R1cmUgbm9uLWl0ZXJhYmxlIGluc3RhbmNlLlxuSW4gb3JkZXIgdG8gYmUgaXRlcmFibGUsIG5vbi1hcnJheSBvYmplY3RzIG11c3QgaGF2ZSBhIFtTeW1ib2wuaXRlcmF0b3JdKCkgbWV0aG9kLiIpfSgpfWNsYXNzIHIgZXh0ZW5kcyBFcnJvcntjb25zdHJ1Y3RvcihlLHQpe3N1cGVyKHQpLHRoaXMuZXJyb3I9ZSx0aGlzLmVycm9yX2Rlc2NyaXB0aW9uPXQsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsci5wcm90b3R5cGUpfXN0YXRpYyBmcm9tUGF5bG9hZChlKXtsZXQgdD1lLmVycm9yLG89ZS5lcnJvcl9kZXNjcmlwdGlvbjtyZXR1cm4gbmV3IHIodCxvKX19Y2xhc3MgbyBleHRlbmRzIHJ7Y29uc3RydWN0b3IoZSx0KXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIiwiTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyIuY29uY2F0KG4oZSxbImRlZmF1bHQiXSksIicsIHNjb3BlOiAnIikuY29uY2F0KG4odCksIicpIikpLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXQsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsby5wcm90b3R5cGUpfX1mdW5jdGlvbiBuKGUpe3JldHVybiBlJiYhKGFyZ3VtZW50cy5sZW5ndGg+MSYmdm9pZCAwIT09YXJndW1lbnRzWzFdP2FyZ3VtZW50c1sxXTpbXSkuaW5jbHVkZXMoZSk/ZToiIn0iZnVuY3Rpb24iPT10eXBlb2YgU3VwcHJlc3NlZEVycm9yJiZTdXBwcmVzc2VkRXJyb3I7Y29uc3Qgcz1lPT57dmFyIHQ9ZS5jbGllbnRJZCxyPWZ1bmN0aW9uKGUsdCl7dmFyIHI9e307Zm9yKHZhciBvIGluIGUpT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKGUsbykmJnQuaW5kZXhPZihvKTwwJiYocltvXT1lW29dKTtpZihudWxsIT1lJiYiZnVuY3Rpb24iPT10eXBlb2YgT2JqZWN0LmdldE93blByb3BlcnR5U3ltYm9scyl7dmFyIG49MDtmb3Iobz1PYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKGUpO248by5sZW5ndGg7bisrKXQuaW5kZXhPZihvW25dKTwwJiZPYmplY3QucHJvdG90eXBlLnByb3BlcnR5SXNFbnVtZXJhYmxlLmNhbGwoZSxvW25dKSYmKHJbb1tuXV09ZVtvW25dXSl9cmV0dXJuIHJ9KGUsWyJjbGllbnRJZCJdKTtyZXR1cm4gbmV3IFVSTFNlYXJjaFBhcmFtcygoZT0+T2JqZWN0LmtleXMoZSkuZmlsdGVyKHQ9PnZvaWQgMCE9PWVbdF0pLnJlZHVjZSgodCxyKT0+T2JqZWN0LmFzc2lnbihPYmplY3QuYXNzaWduKHt9LHQpLHtbcl06ZVtyXX0pLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IGE9e30saT1udWxsO2NvbnN0IGM9KGUsdCk9PiIiLmNvbmNhdChlLCJ8IikuY29uY2F0KHQpLGw9KGUsdCk9PnQuc3RhcnRzV2l0aCgiIi5jb25jYXQoZSwifCIpKSx1PShlLHQpPT5hW2MoZSx0KV0sZj1lPT57T2JqZWN0LmVudHJpZXMoYSkuZm9yRWFjaChyPT57bGV0IG89dChyLDIpLG49b1swXTtvWzFdPT09ZSYmZGVsZXRlIGFbbl19KX0saD1lPT57Y29uc3QgdD1uZXcgVVJMU2VhcmNoUGFyYW1zKGUpLHI9e307cmV0dXJuIHQuZm9yRWFjaCgoZSx0KT0+e3JbdF09ZX0pLHJ9LGQ9YXN5bmMgZT0+e2xldCByLG4saT1lLmRhdGEsZj1pLnRpbWVvdXQsZD1pLmF1dGgscD1pLmZldGNoVXJsLHk9aS5mZXRjaE9wdGlvbnMsZz1pLnVzZUZvcm1EYXRhLGI9aS51c2VNcnJ0LE89aS5za2lwVG9rZW5TdG9yYWdlLGs9aS5wcmVzZXJ2ZVJlZnJlc2hUb2tlbixtPXQoZS5wb3J0cywxKVswXSxqPXt9O2NvbnN0IHY9ZHx8e30sXz12LmF1ZGllbmNlLHc9di5zY29wZTt0cnl7Y29uc3QgZT1nP2goeS5ib2R5KTpKU09OLnBhcnNlKHkuYm9keSk7aWYoZS5yZWZyZXNoX3Rva2VufHwicmVmcmVzaF90b2tlbiIhPT1lLmdyYW50X3R5cGUpZS5tZmFfdG9rZW4mJihuPXUoXyx3KSwhbiYmYiYmKG49YS5sYXRlc3RfcmVmcmVzaF90b2tlbikpO2Vsc2V7aWYobj11KF8sdyksIW4mJmIpe2NvbnN0IGU9YS5sYXRlc3RfcmVmcmVzaF90b2tlbix0PSgoZSx0KT0+ISFPYmplY3Qua2V5cyhhKS5maW5kKHI9PntpZigibGF0ZXN0X3JlZnJlc2hfdG9rZW4iIT09cil7Y29uc3Qgbz1sKHQsciksbj1yLnNwbGl0KCJ8IilbMV0uc3BsaXQoIiAiKSxzPWUuc3BsaXQoIiAiKS5ldmVyeShlPT5uLmluY2x1ZGVzKGUpKTtyZXR1cm4gbyYmc319KSkodyxfKTtlJiYhdCYmKG49ZSl9aWYoIW4pdGhyb3cgbmV3IG8oXyx3KTt5LmJvZHk9Zz9zKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxlKSx7cmVmcmVzaF90b2tlbjpufSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxlKSx7cmVmcmVzaF90b2tlbjpufSkpfWxldCBpLGQ7ImZ1bmN0aW9uIj09dHlwZW9mIEFib3J0Q29udHJvbGxlciYmKGk9bmV3IEFib3J0Q29udHJvbGxlcix5LnNpZ25hbD1pLnNpZ25hbCk7dHJ5e2Q9YXdhaXQgUHJvbWlzZS5yYWNlKFsoUD1mLG5ldyBQcm9taXNlKGU9PnNldFRpbWVvdXQoZSxQKSkpLGZldGNoKHAsT2JqZWN0LmFzc2lnbih7fSx5KSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBtLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZClyZXR1cm4gaSYmaS5hYm9ydCgpLHZvaWQgbS5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtpZihVPWQuaGVhZGVycyxqPVsuLi5VXS5yZWR1Y2UoKGUscik9PntsZXQgbz10KHIsMiksbj1vWzBdLHM9b1sxXTtyZXR1cm4gZVtuXT1zLGV9LHt9KSxyPWF3YWl0IGQuanNvbigpLE8pcmV0dXJuIGRlbGV0ZSByLnJlZnJlc2hfdG9rZW4sdm9pZCBtLnBvc3RNZXNzYWdlKHtvazpkLm9rLGpzb246cixoZWFkZXJzOmp9KTtyLnJlZnJlc2hfdG9rZW4/KGImJihhLmxhdGVzdF9yZWZyZXNoX3Rva2VuPXIucmVmcmVzaF90b2tlbixTPW4sTT1yLnJlZnJlc2hfdG9rZW4sT2JqZWN0LmVudHJpZXMoYSkuZm9yRWFjaChlPT57bGV0IHI9dChlLDIpLG89clswXTtyWzFdPT09UyYmKGFbb109TSl9KSksKChlLHQscik9PnthW2ModCxyKV09ZX0pKHIucmVmcmVzaF90b2tlbixfLHcpLGRlbGV0ZSByLnJlZnJlc2hfdG9rZW4pOmt8fCgoZSx0KT0+e2RlbGV0ZSBhW2MoZSx0KV19KShfLHcpLG0ucG9zdE1lc3NhZ2Uoe29rOmQub2ssanNvbjpyLGhlYWRlcnM6an0pfWNhdGNoKGUpe20ucG9zdE1lc3NhZ2Uoe29rOiExLGpzb246e2Vycm9yOmUuZXJyb3IsZXJyb3JfZGVzY3JpcHRpb246ZS5tZXNzYWdlfSxoZWFkZXJzOmp9KX12YXIgUyxNLFUsUH0scD1hc3luYyBlPT57bGV0IHI9ZS5kYXRhLG89ci50aW1lb3V0LG49ci5hdXRoLGk9ci5mZXRjaFVybCxjPXIuZmV0Y2hPcHRpb25zLHU9ci51c2VGb3JtRGF0YSxkPXQoZS5wb3J0cywxKVswXTtjb25zdCBwPShufHx7fSkuYXVkaWVuY2U7dHJ5e2NvbnN0IGU9KGU9Pntjb25zdCByPW5ldyBTZXQ7cmV0dXJuIE9iamVjdC5lbnRyaWVzKGEpLmZvckVhY2gobz0+e2xldCBuPXQobywyKSxzPW5bMF0sYT1uWzFdO2woZSxzKSYmci5hZGQoYSl9KSxBcnJheS5mcm9tKHIpfSkocCk7aWYoMD09PWUubGVuZ3RoKXJldHVybiB2b2lkIGQucG9zdE1lc3NhZ2Uoe29rOiEwfSk7Y29uc3Qgcj11P2goYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7Zm9yKGNvbnN0IHQgb2YgZSl7Y29uc3QgZT11P3MoT2JqZWN0LmFzc2lnbihPYmplY3QuYXNzaWduKHt9LHIpLHt0b2tlbjp0fSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7dG9rZW46dH0pKTtsZXQgbixhLGwsaDsiZnVuY3Rpb24iPT10eXBlb2YgQWJvcnRDb250cm9sbGVyJiYobj1uZXcgQWJvcnRDb250cm9sbGVyLGE9bi5zaWduYWwpO3RyeXtoPWF3YWl0IFByb21pc2UucmFjZShbbmV3IFByb21pc2UoZT0+e2w9c2V0VGltZW91dChlLG8pfSksZmV0Y2goaSxPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sYykse2JvZHk6ZSxzaWduYWw6YX0pKV0pLmZpbmFsbHkoKCk9PmNsZWFyVGltZW91dChsKSl9Y2F0Y2goZSl7cmV0dXJuIHZvaWQgZC5wb3N0TWVzc2FnZSh7ZXJyb3I6ZS5tZXNzYWdlfSl9aWYoIWgpcmV0dXJuIG4mJm4uYWJvcnQoKSx2b2lkIGQucG9zdE1lc3NhZ2Uoe2Vycm9yOiJUaW1lb3V0IHdoZW4gZXhlY3V0aW5nICdmZXRjaCcifSk7aWYoIWgub2spe2xldCBlO3RyeXtjb25zdCB0PUpTT04ucGFyc2UoYXdhaXQgaC50ZXh0KCkpO2U9dC5lcnJvcl9kZXNjcmlwdGlvbn1jYXRjaChlKXt9cmV0dXJuIHZvaWQgZC5wb3N0TWVzc2FnZSh7ZXJyb3I6ZXx8IkhUVFAgZXJyb3IgIi5jb25jYXQoaC5zdGF0dXMpfSl9Zih0KX1kLnBvc3RNZXNzYWdlKHtvazohMH0pfWNhdGNoKGUpe2QucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZXx8IlVua25vd24gZXJyb3IgZHVyaW5nIHRva2VuIHJldm9jYXRpb24ifSl9fSx5PShlLHQpPT57aWYoIWkpcmV0dXJuITE7dHJ5e2NvbnN0IHI9bmV3IFVSTChpKS5vcmlnaW4sbz1uZXcgVVJMKGUuZmV0Y2hVcmwpO3JldHVybiBvLm9yaWdpbj09PXImJm8ucGF0aG5hbWU9PT10fWNhdGNoKGUpe3JldHVybiExfX07YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsZT0+e2NvbnN0IHI9ZS5kYXRhLG89dChlLnBvcnRzLDEpWzBdO2lmKCEoInR5cGUiaW4gcil8fCJpbml0IiE9PXIudHlwZSlyZXR1cm4idHlwZSJpbiByJiYiY2xlYXIiPT09ci50eXBlPyhhPXt9LHZvaWQobnVsbD09b3x8by5wb3N0TWVzc2FnZSh7b2s6ITB9KSkpOiJ0eXBlImluIHImJiJyZXZva2UiPT09ci50eXBlP3kociwiL29hdXRoL3Jldm9rZSIpP3ZvaWQgcChlKTp2b2lkKG51bGw9PW98fG8ucG9zdE1lc3NhZ2Uoe29rOiExLGpzb246e2Vycm9yOiJpbnZhbGlkX2ZldGNoX3VybCIsZXJyb3JfZGVzY3JpcHRpb246IlVuYXV0aG9yaXplZCBmZXRjaCBVUkwifSxoZWFkZXJzOnt9fSkpOnZvaWQoImZldGNoVXJsImluIHImJnkociwiL29hdXRoL3Rva2VuIik/ZChlKTpudWxsPT1vfHxvLnBvc3RNZXNzYWdlKHtvazohMSxqc29uOntlcnJvcjoiaW52YWxpZF9mZXRjaF91cmwiLGVycm9yX2Rlc2NyaXB0aW9uOiJVbmF1dGhvcml6ZWQgZmV0Y2ggVVJMIn0saGVhZGVyczp7fX0pKTtpZihudWxsPT09aSl0cnl7bmV3IFVSTChyLmFsbG93ZWRCYXNlVXJsKSxpPXIuYWxsb3dlZEJhc2VVcmx9Y2F0Y2goZSl7cmV0dXJufX0pfSgpOwoK",
14kN=null,EN=!1,function(t){return Hk=Hk||xB(SN,kN,EN),new Worker(Hk,t)});let kB=class{constructor(e,n){this.cache=e,this.clientId=n,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(e){var n;const i=new Set(((n=await this.cache.get(this.manifestKey))===null||n===void 0?void 0:n.keys)||[]);i.add(e),await this.cache.set(this.manifestKey,{keys:[...i]})}async remove(e){const n=await this.cache.get(this.manifestKey);if(n){const i=new Set(n.keys);return i.delete(e),i.size>0?await this.cache.set(this.manifestKey,{keys:[...i]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(e){return"".concat(fu,"::").concat(e)}};const TN="auth0.is.authenticated",EB={memory:()=>new r5().enclosedCache,localstorage:()=>new hB},CN=t=>EB[t],ON=t=>{const e=t.openUrl,n=t.onRedirect,i=Mr(t,["openUrl","onRedirect"]);return Object.assign(Object.assign({},i),{openUrl:e===!1||e?e:n})},TB=(t,e,n)=>{const i=t?.split(" ")||[],r=n?i.filter(l=>l!==ML):i,o=e?.split(" ")||[];return r.filter(l=>o.indexOf(l)==-1).join(",")},Fc={NONCE:"nonce",KEYPAIR:"keypair"};let CB=class{constructor(e){this.clientId=e}getVersion(){return 1}createDbHandle(){const e=window.indexedDB.open("auth0-spa-js",this.getVersion());return new Promise((n,i)=>{e.onupgradeneeded=()=>
14Object.values(Fc).forEach(r=>e.result.createObjectStore(r)),e.onerror=()=>i(e.error),e.onsuccess=()=>n(e.result)})}async getDbHandle(){return this.dbHandle||(this.dbHandle=await this.createDbHandle()),this.dbHandle}async executeDbRequest(e,n,i){const r=i((await this.getDbHandle()).transaction(e,n).objectStore(e));return new Promise((o,l)=>{r.onsuccess=()=>o(r.result),r.onerror=()=>l(r.error)})}buildKey(e){const n=e?"_".concat(e):"auth0";return"".concat(this.clientId,"::").concat(n)}setNonce(e,n){return this.save(Fc.NONCE,this.buildKey(n),e)}setKeyPair(e){return this.save(Fc.KEYPAIR,this.buildKey(),e)}async save(e,n,i){await this.executeDbRequest(e,"readwrite",r=>r.put(i,n))}findNonce(e){return this.find(Fc.NONCE,this.buildKey(e))}findKeyPair(){return this.find(Fc.KEYPAIR,this.buildKey())}find(e,n){return this.executeDbRequest(e,"readonly",i=>i.get(n))}async deleteBy(e,n){const i=await this.executeDbRequest(e,"readonly",r=>r.getAllKeys());await Promise.all(i?.filter(n).map(r=>this.executeDbRequest(e,"readwrite",o=>o.delete(r)))||[])}deleteByClientId(e,n){return this.deleteBy(e,i=>typeof i=="string"&&i.startsWith("".concat(n,"::")))}clearNonces(){return this.deleteByClientId(Fc.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId(Fc.KEYPAIR,this.clientId)}},OB=class{constructor(e){this.storage=new CB(e)}getNonce(e){return this.storage.findNonce(e)}setNonce(e,n){return this.storage.setNonce(e,n)}async getOrGenerateKeyPair(){let e=await this.storage.findKeyPair();return e||(e=await lB(),await this.storage.setKeyPair(e)),e}async generateProof(e){const n=await this.getOrGenerateKeyPair();return uB(Object.assign({keyPair:n},e))}async calculateThumbprint(){return cB(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}};var mh;(function(t){t.Bearer="Bearer",t.DPoP="DPoP"})(mh||(mh={}));let RB=class{constructor(e,n){this.hooks=n,this.config=Object.assign(Object.assign({},e),{fetch:e.fetch||(typeof window>"u"?fetch:window.fetch.bind(window))})}isAbsoluteUrl(e){return/^(https?:)?\/\//i.test(e)}buildUrl(e,n){if(n){if(this.isAbsoluteUrl(n))return n;if(e)return"".concat(e.replace(/\/?\/$/,""),"/").concat(n.replace(/^\/+/,""))}throw new TypeError("`url` must be absolute or `baseUrl` non-empty.")}getAccessToken(e){return this.config.getAccessToken?this.config.getAccessToken(e):this.hooks.getAccessToken(e)}extractUrl(e){return typeof e=="string"?e:e instanceof URL?e.href:e.url}buildBaseRequest(e,n){if(!this.config.baseUrl)return new Request(e,n);const i=this.buildUrl(this.config.baseUrl,this.extractUrl(e)),r=e instanceof Request?new Request(i,e):i;return new Request(r,n)}setAuthorizationHeader(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:mh.Bearer;e.headers.set("authorization","".concat(i," ").concat(n))}async setDpopProofHeader(e,n){if(!this.config.dpopNonceId)return;const i=await this.hooks.getDpopNonce(),r=await this.hooks.generateDpopProof({accessToken:n,method:e.method,nonce:i,url:e.url});e.headers.set("dpop",r)}async prepareRequest(e,n){const i=await this.getAccessToken(n);if(i===void 0)throw new Qt("missing_access_token","No access token available");let r,o;typeof i=="string"?(r=this.config.dpopNonceId?mh.DPoP:mh.Bearer,o=i):(r=i.token_type,o=i.access_token),this.setAuthorizationHeader(e,o,r),r===mh.DPoP&&await this.setDpopProofHeader(e,o)}getHeader(e,n){return Array.isArray(e)?new Headers(e).get(n)||"":typeof e.get=="function"?e.get(n)||"":e[n]||""}hasUseDpopNonceError(e){if(e.status!==401)return!1;const n=this.getHeader(e.headers,"www-authenticate");return n.includes("invalid_dpop_nonce")||n.includes("use_dpop_nonce")}async handleResponse(e,n){const i=this.getHeader(e.headers,t5);if(i&&await this.hooks.setDpopNonce(i),!this.hasUseDpopNonceError(e))return e;if(!i||!n.onUseDpopNonceError)throw new BL(i);return n.onUseDpopNonceError()}async internalFetchWithAuth(e,n,i,r){const o=this.buildBaseRequest(e,n);await this.prepareRequest(o,r);const l=await this.config.fetch(o);return this.handleResponse(l,i)}fetchWithAuth(e,n,i){const r={onUseDpopNonceError:()=>this.internalFetchWithAuth(e,n,Object.assign(Object.assign({},r),{onUseDpopNonceError:void 0}),i)};return this.internalFetchWithAuth(e,n,r,i)}},$B=class{constructor(e,n){this.myAccountFetcher=e,this.apiBase=n}async connectAccount(e){const n=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/connected-accounts/connect"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},{scope:["create:me:connected_accounts"]});return this._handleResponse(n)}async completeAccount(e){const n=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/connected-accounts/complete"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},{scope:["create:me:connected_accounts"]});return this._handleResponse(n)}async getFactors(){const e=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/factors"),{method:"GET"},{scope:["read:me:factors"]});return(await this._handleResponse(e)).factors}
vendor: 2,836 bytes, line 14
14async getAuthenticationMethods(e){const n=e?"?".concat(new URLSearchParams({type:e})):"",i=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods").concat(n),{method:"GET"},{scope:["read:me:authentication_methods"]});return(await this._handleResponse(i)).authentication_methods}async getAuthenticationMethod(e){const n=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods/").concat(encodeURIComponent(e)),{method:"GET"},{scope:["read:me:authentication_methods"]});return this._handleResponse(n)}async deleteAuthenticationMethod(e){const n=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods/").concat(encodeURIComponent(e)),{method:"DELETE"},{scope:["delete:me:authentication_methods"]});n.ok||await this._handleResponse(n)}async updateAuthenticationMethod(e,n){const i=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods/").concat(encodeURIComponent(e)),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)},{scope:["update:me:authentication_methods"]});return this._handleResponse(i)}async enrollmentChallenge(e){var n;const i=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},{scope:["create:me:authentication_methods"]}),r=await this._handleResponse(i),o=(n=i.headers.get("location"))!==null&&n!==void 0?n:"",l=decodeURIComponent(o.split("/").pop()||"");return Object.assign(Object.assign({},r),{id:l,location:o})}async enrollmentVerify(e){const n=e,i=n.location;n.type;const r=Mr(n,["location","type"]),o=await this.myAccountFetcher.fetchWithAuth("".concat(i,"/verify"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)},{scope:["create:me:authentication_methods"]});return this._handleResponse(o)}async _handleResponse(e){let n;try{n=await e.text(),n=JSON.parse(n)}catch(i){throw new RN({type:"invalid_json",status:e.status,title:"Invalid JSON response",detail:n||String(i)})}if(e.ok)return n;throw new RN(n)}},RN=class l5 extends Error{constructor(e){let n=e.type,i=e.status,r=e.title,o=e.detail,l=e.validation_errors;super(o),this.name="MyAccountApiError",this.type=n,this.status=i,this.title=r,this.detail=o,this.validation_errors=l,Object.setPrototypeOf(this,l5.prototype)}};const AB={otp:{authenticatorTypes:["otp"]},sms:{authenticatorTypes:["oob"],oobChannels:["sms"]},email:{authenticatorTypes:["oob"],oobChannels:["email"]},push:{authenticatorTypes:["oob"],oobChannels:["auth0"]},voice:{authenticatorTypes:["oob"],oobChannels:["voice"]}},jB="http://auth0.com/oauth/grant-type/mfa-otp",PB="http://auth0.com/oauth/grant-type/mfa-oob",NB="http://auth0.com/oauth/grant-type/mfa-rec
14overy-code";var Ky,Kk;let eT;(typeof navigator>"u"||(Ky=navigator.userAgent)===null||Ky===void 0||(Kk=Ky.startsWith)===null||Kk===void 0||!Kk.call(Ky,"Mozilla/5.0 "))&&(eT="".concat("oauth4webapi","/").concat("v3.8.6"));function Ga(t,e){if(t==null)return!1;try{return t instanceof e||Object.getPrototypeOf(t)[Symbol.toStringTag]===e.prototype[Symbol.toStringTag]}catch{return!1}}const cr="ERR_INVALID_ARG_VALUE",Vi="ERR_INVALID_ARG_TYPE";function qt(t,e,n){const i=new TypeError(t,{cause:n});return Object.assign(i,{code:e}),i}const Bi=Symbol(),Q_=Symbol(),tT=Symbol(),Vr=Symbol(),_o=Symbol(),MB=new TextEncoder,IB=new TextDecoder;function $h(t){return typeof t=="string"?MB.encode(t):IB.decode(t)}let nT,c5;Uint8Array.prototype.toBase64?nT=t=>(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t.toBase64({alphabet:"base64url",omitPadding:!0})):nT=e=>{e instanceof ArrayBuffer&&(e=new Uint8Array(e));const n=[];for(let i=0;i<e.byteLength;i+=32768)n.push(String.fromCharCode.apply(null,e.subarray(i,i+32768)));return btoa(n.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")};function wu(t){return typeof t=="string"?c5(t):nT(t)}c5=Uint8Array.fromBase64?t=>{try{return Uint8Array.fromBase64(t,{alphabet:"base64url"})}catch(e){throw qt("The input to be decoded is not correctly encoded.",cr,e)}}:t=>{try{const e=atob(t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"")),n=new Uint8Array(e.length);for(let i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return n}catch(e){throw qt("The input to be decoded is not correctly encoded.",cr,e)}};let fs=class extends Error{constructor(e,n){var i;super(e,n),_e(this,"code",void 0),this.name=this.constructor.name,this.code=rT,(i=Error.captureStackTrace)===null||i===void 0||i.call(Error,this,this.constructor)}},SC=class extends Error{constructor(e,n){var i;super(e,n),_e(this,"code",void 0),this.name=this.constructor.name,n!=null&&n.code&&(this.code=n?.code),(i=Error.captureStackTrace)===null||i===void 0||i.call(Error,this,this.constructor)}};function ot(t,e,n){return new SC(t,{code:e,cause:n})}function zB(t,e){if((function(n,i){if(!(n instanceof CryptoKey))throw qt("".concat(i," must be a CryptoKey"),Vi)})(t,e),t.type!=="private")throw qt("".concat(e," must be a private CryptoKey"),cr)}function eb(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Nu(t){Ga(t,Headers)&&(t=Object.fromEntries(t.entries()));const e=new Headers(t??{});if(eT&&!e.has("user-agent")&&e.set("user-agent",eT),e.has("authorization"))throw qt('"options.headers" must not include the "authorization" header name',cr);return e}function kC(t,e){if(e!==void 0){if(typeof e=="function"&&(e=e(t.href)),!(e instanceof AbortSignal))throw qt('"options.signal" must return or be an instance of AbortSignal',Vi);return e}}function $N(t){return t.includes("//")?t.replace("//","/"):t}async function DB(t,e){return(async function(n,i,r,o){if(!(n instanceof URL))throw qt('"'.concat(i,'" must be an instance of URL'),Vi);pw(n,o?.[Bi]!==!0);const l=r(new URL(n.href)),u=Nu(o?.headers);return u.set("accept","application/json"),(o?.[Vr]||fetch)(l.href,{body:void 0,headers:Object.fromEntries(u.entries()),method:"GET",redirect:"manual",signal:kC(l,o?.signal)})})(t,"issuerIdentifier",n=>{switch(e?.algorithm){case void 0:case"oidc":(function(i,r){i.pathname=$N("".concat(i.pathname,"/").concat(r))})(n,".well-known/openid-configuration");break;case"oauth2":(function(i,r){let o=arguments.length>2&&arguments[2]!==void 0&&arguments[2];i.pathname==="/"?i.pathname=r:i.pathname=$N("".concat(r,"/").concat(o?i.pathname:i.pathname.replace(/(\/)$/,"")))})(n,".well-known/oauth-authorization-server");break;default:throw qt('"options.algorithm" must be "oidc" (default), or "oauth2"',cr)}return n},e)}function ic(t,e,n,i,r){try{if(typeof t!="number"||!Number.isFinite(t))throw qt("".concat(n," must be a number"),Vi,r);if(t>0)return;if(e){if(t!==0)throw qt("".concat(n," must be a non-negative number"),cr,r);return}throw qt("".concat(n," must be a positive number"),cr,r)}catch(o){throw i?ot(o.message,i,r):o}}function Ln(t,e,n,i){try{if(typeof t!="string")throw qt("".concat(e," must be a string"),Vi,i);if(t.length===0)throw qt("".concat(e," must not be empty"),cr,i)}catch(r){throw n?ot(r.message,n,i):r}}function u5(t){(function(e,n){if(vw(e)!==n)throw(function(i){let r='"response" content-type must be ';for(var o=arguments.length,l=new Array(o>1?o-1:0),u=1;u<o;u++)l[u-1]=arguments[u];if(l.length>2){const d=l.pop();r+="".concat(l.join(", "),", or ").concat(d)}else l.length===2?r+="".concat(l[0]," or ").concat(l[1]):r+=l[0];return ot(r,_5,i)})(e,n)})(t,"application/json")}function d5(){return wu(crypto.getRandomValues(new Uint8Array(32)))}function LB(t){switch(t.algorithm.name){case"RSA-PSS":return(function(e){switch(e.algorithm.hash.name){case"SHA-256":return"PS256";case"SHA-384":return"PS384";case"SHA-512":return"PS512";default:throw new fs("unsupported RsaHashedKeyAlgorithm hash name",{cause:e})}})(t);case"RSASSA-PKCS1-v1_5":return(function(e){switch(e.algorithm.hash.name){case"SHA-256":return"RS256";case"SHA-384":return"RS384";case"SHA-512":return"RS512";default:throw new fs("unsupported RsaHashedKeyAlgorithm hash name",{cause:e})}})(t);case"ECDSA":return(function(e){switch(e.algorithm.namedCurve){case"P-256":return"ES256";case"P-384":return"ES384";case"P-521":return"ES512";default:throw new fs("unsupported EcKeyAlgorithm namedCurve",{cause:e})}})(t);case"Ed25519":case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return t.algorithm.name;case"EdDSA":return"Ed25519";default:throw new fs("unsupported CryptoKey algorithm name",{cause:t})}}function Zh(t){const e=t?.[Q_];return typeof e=="number"&&Number.isFinite(e)?e:0}function tb(t){const e=t?.[tT];return typeof e=="number"&&Number.isFinite(e)&&Math.sign(e)!==-1?e:30}function nb(){return Math.floor(Date.now()/1e3)}function Kr(t){if(typeof t!="object"||t===null)throw qt('"as" must be an object',Vi);Ln(t.issuer,'"as.issuer"')}function Zr(t){if(typeof t!="object"||t===null)throw qt('"client" must be an object',Vi);Ln(t.client_id,'"client.client_id"')}function AN(t){return Ln(t,'"clientSecret"'),(e,n,i,r)=>{i.set("client_id",n.client_id),i.set("client_secret",t)}}function UB(t,e){const n=(o=t)instanceof CryptoKey?{key:o}:o?.key instanceof CryptoKey?(o.kid!==void 0&&Ln(o.kid,'"kid"'),{key:o.key,kid:o.kid}):{},i=n.key,r=n.kid;var o;return zB(i,'"clientPrivateKey.key"'),async(l,u,d,f)=>
14{const p={alg:LB(i),kid:r},g=(function(v,y){const b=nb()+Zh(y);return{jti:d5(),aud:v.issuer,exp:b+60,iat:b,nbf:b,iss:y.client_id,sub:y.client_id}})(l,u);d.set("client_id",u.client_id),d.set("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),d.set("client_assertion",await(async function(v,y,b){if(!b.usages.includes("sign"))throw qt('CryptoKey instances used for signing assertions must include "sign" in their "usages"',cr);const x="".concat(wu($h(JSON.stringify(v))),".").concat(wu($h(JSON.stringify(y)))),S=wu(await crypto.subtle.sign((function(k){switch(k.algorithm.name){case"ECDSA":return{name:k.algorithm.name,hash:lG(k)};case"RSA-PSS":switch(NN(k),k.algorithm.hash.name){case"SHA-256":case"SHA-384":case"SHA-512":return{name:k.algorithm.name,saltLength:parseInt(k.algorithm.hash.name.slice(-3),10)>>3};default:throw new fs("unsupported RSA-PSS hash name",{cause:k})}case"RSASSA-PKCS1-v1_5":return NN(k),k.algorithm.name;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":case"Ed25519":return k.algorithm.name}throw new fs("unsupported CryptoKey algorithm name",{cause:k})})(b),b,$h(x)));return"".concat(x,".").concat(S)})(p,g,i))}}const FB=URL.parse?(t,e)=>URL.parse(t,e):(t,e)=>{try{return new URL(t,e)}catch{return null}};function pw(t,e){if(e&&t.protocol!=="https:")throw ot("only requests to HTTPS are allowed",b5,t);if(t.protocol!=="https:"&&t.protocol!=="http:")throw ot("only HTTP and HTTPS requests are allowed",w5,t)}function jN(t,e,n,i){let r;if(typeof t!="string"||!(r=FB(t)))throw ot("authorization server metadata does not contain a valid ".concat(n?'"as.mtls_endpoint_aliases.'.concat(e,'"'):'"as.'.concat(e,'"')),t===void 0?sG:oG,{attribute:n?"mtls_endpoint_aliases.".concat(e):e});return pw(r,i),r}function Fu(t,e,n,i){return n&&t.mtls_endpoint_aliases&&e in t.mtls_endpoint_aliases?jN(t.mtls_endpoint_aliases[e],e,n,i):jN(t[e],e,n,i)}let gw=class extends Error{constructor(e,n){var i;super(e,n),_e(this,"cause",void 0),_e(this,"code",void 0),_e(this,"error",void 0),_e(this,"status",void 0),_e(this,"error_description",void 0),_e(this,"response",void 0),this.name=this.constructor.name,this.code=nG,this.cause=n.cause,this.error=n.cause.error,this.status=n.response.status,this.error_description=n.cause.error_description,Object.defineProperty(this,"response",{enumerable:!1,value:n.response}),(i=Error.captureStackTrace)===null||i===void 0||i.call(Error,this,this.constructor)}},h5=class extends Error{constructor(e,n){var i,r;super(e,n),_e(this,"cause",void 0),_e(this,"code",void 0),_e(this,"error",void 0),_e(this,"error_description",void 0),this.name=this.constructor.name,this.code=iG,this.cause=n.cause,this.error=n.cause.get("error"),this.error_description=(i=n.cause.get("error_description"))!==null&&i!==void 0?i:void 0,(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,this.constructor)}},EC=class extends Error{constructor(e,n){var i;super(e,n),_e(this,"cause",void 0),_e(this,"code",void 0),_e(this,"response",void 0),_e(this,"status",void 0),this.name=this.constructor.name,this.code=tG,this.cause=n.cause,this.status=n.response.status,this.response=n.response,Object.defineProperty(this,"response",{enumerable:!1}),(i=Error.captureStackTrace)===null||i===void 0||i.call(Error,this,this.constructor)}};const ib="[a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+",HB="("+ib+')\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"',KB="("+ib+")\\s*=\\s*("+ib+")",ZB=new RegExp("^[,\\s]*("+ib+")"),WB=new RegExp("^[,\\s]*"+HB+"[,\\s]*(.*)"),qB=new RegExp("^[,\\s]*"+KB+"[,\\s]*(.*)"),VB=new RegExp("^([a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2})(?:$|[,\\s])(.*)");async function mw(t,e,n){if(t.status!==e){let r;var i;throw m5(t),(r=await(async function(o){if(o.status>399&&o.status<500){uf(o),u5(o);try{const l=await o.clone().json();if(eb(l)&&typeof l.error=="string"&&l.error.length)return l}catch{}}})(t))?(await((i=t.body)===null||i===void 0?void 0:i.cancel()),new gw("server responded with an error in the response body",{cause:r,response:t})):ot('"response" is not a conform '.concat(n," response (unexpected HTTP status code)"),_w,t)}}function TC(t){if(!CC.has(t))throw qt('"options.DPoP" is not a valid DPoPHandle',cr)}async function BB(t,e,n,i){Kr(t),Zr(e);const r=Fu(t,"userinfo_endpoint",e.use_mtls_endpoint_aliases,i?.[Bi]!==!0),o=Nu(i?.headers);return e.userinfo_signed_response_alg?o.set("accept","application/jwt"):(o.set("accept","application/json"),o.append("accept","application/jwt")),(async function(l,u,d,f,p,g){var v;if(Ln(l,'"accessToken"'),!(d instanceof URL))throw qt('"url" must be an instance of URL',Vi);pw(d,g?.[Bi]!==!0),f=Nu(f),g!=null&&g.DPoP&&(TC(g.DPoP),await g.DPoP.addProof(d,f,u.toUpperCase(),l)),f.set("authorization","".concat(f.has("dpop")?"DPoP":"Bearer"," ").concat(l));const y=await(g?.[Vr]||fetch)(d.href,{duplex:Ga(p,ReadableStream)?"half":void 0,body:p,headers:Object.fromEntries(f.entries()),method:u,redirect:"manual",signal:kC(d,g?.signal)}
14);return g==null||(v=g.DPoP)===null||v===void 0||v.cacheNonce(y,d),y})(n,"GET",r,o,null,Ee(Ee({},i),{},{[Q_]:Zh(e)}))}const f5=Symbol();function vw(t){var e;return(e=t.headers.get("content-type"))===null||e===void 0?void 0:e.split(";")[0]}async function GB(t,e,n,i,r){if(Kr(t),Zr(e),!Ga(i,Response))throw qt('"response" must be an instance of Response',Vi);if(m5(i),i.status!==200)throw ot('"response" is not a conform UserInfo Endpoint response (unexpected HTTP status code)',_w,i);let o;if(uf(i),vw(i)==="application/jwt"){const l=await x5(await i.text(),S5.bind(void 0,e.userinfo_signed_response_alg,t.userinfo_signing_alg_values_supported,void 0),Zh(e),tb(e),r?.[_o]).then(JB.bind(void 0,e.client_id)).then(XB.bind(void 0,t)),u=l.claims,d=l.jwt;g5.set(i,d),o=u}else{if(e.userinfo_signed_response_alg)throw ot("JWT UserInfo Response expected",rG,i);o=await Vm(i)}if(Ln(o.sub,'"response" body "sub" property',Pt,{body:o}),n!==f5){if(Ln(n,'"expectedSubject"'),o.sub!==n)throw ot('unexpected "response" body "sub" property value',sb,{expected:n,body:o,attribute:"sub"})}return o}async function yw(t,e,n,i,r,o,l){return await n(t,e,r,o),o.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),(l?.[Vr]||fetch)(i.href,{body:r,headers:Object.fromEntries(o.entries()),method:"POST",redirect:"manual",signal:kC(i,l?.signal)})}async function qm(t,e,n,i,r,o){var l;const u=Fu(t,"token_endpoint",e.use_mtls_endpoint_aliases,o?.[Bi]!==!0);r.set("grant_type",i);const d=Nu(o?.headers);d.set("accept","application/json"),o?.DPoP!==void 0&&(TC(o.DPoP),await o.DPoP.addProof(u,d,"POST"));const f=await yw(t,e,n,u,r,d,o);return o==null||(l=o.DPoP)===null||l===void 0||l.cacheNonce(f,u),f}const p5=new WeakMap,g5=new WeakMap;function iT(t){if(!t.id_token)return;const e=p5.get(t);if(!e)throw qt('"ref" was already garbage collected or did not resolve from the proper sources',cr);return e}async function Wh(t,e,n,i,r,o){if(Kr(t),Zr(e),!Ga(n,Response))throw qt('"response" must be an instance of Response',Vi);await mw(n,200,"Token Endpoint"),uf(n);const l=await Vm(n);if(Ln(l.access_token,'"response" body "access_token" property',Pt,{body:l}),Ln(l.token_type,'"response" body "token_type" property',Pt,{body:l}),l.token_type=l.token_type.toLowerCase(),l.expires_in!==void 0){let u=typeof l.expires_in!="number"?parseFloat(l.expires_in):l.expires_in;ic(u,!0,'"response" body "expires_in" property',Pt,{body:l}),l.expires_in=u}if(l.refresh_token!==void 0&&Ln(l.refresh_token,'"response" body "refresh_token" property',Pt,{body:l}),l.scope!==void 0&&typeof l.scope!="string")throw ot('"response" body "scope" property must be a string',Pt,{body:l});if(l.id_token!==void 0){Ln(l.id_token,'"response" body "id_token" property',Pt,{body:l});const u=["aud","exp","iat","iss","sub"];e.require_auth_time===!0&&u.push("auth_time"),e.default_max_age!==void 0&&(ic(e.default_max_age,!0,'"client.default_max_age"'),u.push("auth_time")),i!=null&&i.length&&u.push(...i);const d=await x5(l.id_token,S5.bind(void 0,e.id_token_signed_response_alg,t.id_token_signing_alg_values_supported,"RS256"),Zh(e),tb(e),r).then(QB.bind(void 0,u)).then(y5.bind(void 0,t)).then(v5.bind(void 0,e.client_id)),f=d.claims,p=d.jwt;if(Array.isArray(f.aud)&&f.aud.length!==1){if(f.azp===void 0)throw ot('ID Token "aud" (audience) claim includes additional untrusted audiences',Ha,{claims:f,claim:"aud"});if(f.azp!==e.client_id)throw ot('unexpected ID Token "azp" (authorized party) claim value',Ha,{expected:e.client_id,claims:f,claim:"azp"})}f.auth_time!==void 0&&ic(f.auth_time,!0,'ID Token "auth_time" (authentication time)',Pt,{claims:f}),g5.set(n,p),p5.set(l,f)}
14if(o?.[l.token_type]!==void 0)o[l.token_type](n,l);else if(l.token_type!=="dpop"&&l.token_type!=="bearer")throw new fs("unsupported `token_type` value",{cause:{body:l}});return l}function m5(t){let e;if(e=(function(n){if(!Ga(n,Response))throw qt('"response" must be an instance of Response',Vi);const i=n.headers.get("www-authenticate");if(i===null)return;const r=[];let o=i;for(;o;){var l;let p=o.match(ZB);const g=(l=p)===null||l===void 0?void 0:l[1].toLowerCase();if(!g)return;const v=o.substring(p[0].length);if(v&&!v.match(/^[\s,]/))return;const y=v.match(/^\s+(.*)$/),b=!!y;o=y?y[1]:void 0;const x={};let S;if(b)for(;o;){let T,C;if(p=o.match(WB)){var u=lr(p,4);if(T=u[1],C=u[2],o=u[3],C.includes("\\"))try{C=JSON.parse('"'.concat(C,'"'))}catch{}x[T.toLowerCase()]=C}else{if(!(p=o.match(qB))){if(p=o.match(VB)){if(Object.keys(x).length)break;var d=lr(p,3);S=d[1],o=d[2];break}return}var f=lr(p,4);T=f[1],C=f[2],o=f[3],x[T.toLowerCase()]=C}}else o=v||void 0;const k={scheme:g,parameters:x};S&&(k.token68=S),r.push(k)}return r.length?r:void 0})(t))throw new EC("server responded with a challenge in the WWW-Authenticate HTTP Header",{cause:e,response:t})}function JB(t,e){return e.claims.aud!==void 0?v5(t,e):e}function v5(t,e){if(Array.isArray(e.claims.aud)){if(!e.claims.aud.includes(t))throw ot('unexpected JWT "aud" (audience) claim value',Ha,{expected:t,claims:e.claims,claim:"aud"})}else if(e.claims.aud!==t)throw ot('unexpected JWT "aud" (audience) claim value',Ha,{expected:t,claims:e.claims,claim:"aud"});return e}function XB(t,e){return e.claims.iss!==void 0?y5(t,e):e}function y5(t,e){var n,i;const r=(n=(i=t[k5])===null||i===void 0?void 0:i.call(t,e))!==null&&n!==void 0?n:t.issuer;if(e.claims.iss!==r)throw ot('unexpected JWT "iss" (issuer) claim value',Ha,{expected:r,claims:e.claims,claim:"iss"});return e}const CC=new WeakSet,PN=Symbol(),YB={aud:"audience",c_hash:"code hash",client_id:"client id",exp:"expiration time",iat:"issued at",iss:"issuer",jti:"jwt id",nonce:"nonce",s_hash:"state hash",sub:"subject",ath:"access token hash",htm:"http method",htu:"http uri",cnf:"confirmation",auth_time:"authentication time"};function QB(t,e){for(const n of t)if(e.claims[n]===void 0)throw ot('JWT "'.concat(n,'" (').concat(YB[n],") claim missing"),Pt,{claims:e.claims});return e}const Zk=Symbol(),Wk=Symbol();async function eG(t,e,n,i){return typeof i?.expectedNonce=="string"||typeof i?.maxAge=="number"||i!=null&&i.requireIdToken?(async function(r,o,l,u,d,f,p){const g=[];switch(u){case void 0:u=Zk;break;case Zk:break;default:Ln(u,'"expectedNonce" argument'),g.push("nonce")}switch(d!=null||(d=o.default_max_age),d){case void 0:d=Wk;break;case Wk:break;default:ic(d,!0,'"maxAge" argument'),g.push("auth_time")}const v=await Wh(r,o,l,g,f,p);Ln(v.id_token,'"response" body "id_token" property',Pt,{body:v});const y=iT(v);if(d!==Wk){const b=nb()+Zh(o),x=tb(o);if(y.auth_time+d<b-x)throw ot("too much time has elapsed since the last End-User authentication",um,{claims:y,now:b,tolerance:x,claim:"auth_time"})}if(u===Zk){if(y.nonce!==void 0)throw ot('unexpected ID Token "nonce" claim value',Ha,{expected:void 0,claims:y,claim:"nonce"})}else if(y.nonce!==u)throw ot('unexpected ID Token "nonce" claim value',Ha,{expected:u,claims:y,claim:"nonce"});return v})(t,e,n,i.expectedNonce,i.maxAge,i[_o],i.recognizedTokenTypes):(async function(r,o,l,u,d){const f=await Wh(r,o,l,void 0,u,d),p=iT(f);if(p){if(o.default_max_age!==void 0){ic(o.default_max_age,!0,'"client.default_max_age"');const g=nb()+Zh(o),v=tb(o);if(p.auth_time+o.default_max_age<g-v)throw ot("too much time has elapsed since the last End-User authentication",um,{claims:p,now:g,tolerance:v,claim:"auth_time"})}if(p.nonce!==void 0)throw ot('unexpected ID Token "nonce" claim value',Ha,{expected:void 0,claims:p,claim:"nonce"})}return f})(t,e,n,i?.[_o],i?.recognizedTokenTypes)}const tG="OAUTH_WWW_AUTHENTICATE_CHALLENGE",nG="OAUTH_RESPONSE_BODY_ERROR",rT="OAUTH_UNSUPPORTED_OPERATION",iG="OAUTH_AUTHORIZATION_RESPONSE_ERROR",rG="OAUTH_JWT_USERINFO_EXPECTED",rb="OAUTH_PARSE_ERROR",Pt="OAUTH_INVALID_RESPONSE",_5="OAUTH_RESPONSE_IS_NOT_JSON",_w="OAUTH_RESPONSE_IS_NOT_CONFORM",b5="OAUTH_HTTP_REQUEST_FORB
14IDDEN",w5="OAUTH_REQUEST_PROTOCOL_FORBIDDEN",um="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",Ha="OAUTH_JWT_CLAIM_COMPARISON_FAILED",sb="OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED",sG="OAUTH_MISSING_SERVER_METADATA",oG="OAUTH_INVALID_SERVER_METADATA";async function aG(t){if(!Ga(t,Response))throw qt('"response" must be an instance of Response',Vi);await mw(t,200,"Revocation Endpoint")}function uf(t){if(t.bodyUsed)throw qt('"response" body has been used already',cr)}function NN(t){const e=t.algorithm;if(typeof e.modulusLength!="number"||e.modulusLength<2048)throw new fs("unsupported ".concat(e.name," modulusLength"),{cause:t})}function lG(t){switch(t.algorithm.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new fs("unsupported ECDSA namedCurve",{cause:t})}}async function x5(t,e,n,i,r){let o,l,u=t.split("."),d=u[0],f=u[1],p=u.length;if(p===5){if(r===void 0)throw new fs("JWE decryption is not configured",{cause:t});var g=(t=await r(t)).split(".");d=g[0],f=g[1],p=g.length}if(p!==3)throw ot("Invalid JWT",Pt,t);try{o=JSON.parse($h(wu(d)))}catch(y){throw ot("failed to parse JWT Header body as base64url encoded JSON",rb,y)}if(!eb(o))throw ot("JWT Header must be a top level object",Pt,t);if(e(o),o.crit!==void 0)throw new fs('no JWT "crit" header parameter extensions are supported',{cause:{header:o}});try{l=JSON.parse($h(wu(f)))}catch(y){throw ot("failed to parse JWT Payload body as base64url encoded JSON",rb,y)}if(!eb(l))throw ot("JWT Payload must be a top level object",Pt,t);const v=nb()+n;if(l.exp!==void 0){if(typeof l.exp!="number")throw ot('unexpected JWT "exp" (expiration time) claim type',Pt,{claims:l});if(l.exp<=v-i)throw ot('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',um,{claims:l,now:v,tolerance:i,claim:"exp"})}if(l.iat!==void 0&&typeof l.iat!="number")throw ot('unexpected JWT "iat" (issued at) claim type',Pt,{claims:l});if(l.iss!==void 0&&typeof l.iss!="string")throw ot('unexpected JWT "iss" (issuer) claim type',Pt,{claims:l});if(l.nbf!==void 0){if(typeof l.nbf!="number")throw ot('unexpected JWT "nbf" (not before) claim type',Pt,{claims:l});if(l.nbf>v+i)throw ot('unexpected JWT "nbf" (not before) claim value',um,{claims:l,now:v,tolerance:i,claim:"nbf"})}if(l.aud!==void 0&&typeof l.aud!="string"&&!Array.isArray(l.aud))throw ot('unexpected JWT "aud" (audience) claim type',Pt,{claims:l});return{header:o,claims:l,jwt:t}}async function cG(t){if(t.method!=="POST")throw qt("form_post responses are expected to use the POST method",cr,{cause:t});if(vw(t)!=="application/x-www-form-urlencoded")throw qt("form_post responses are expected to use the application/x-www-form-urlencoded content-type",cr,{cause:t});return(async function(e){if(e.bodyUsed)throw qt("form_post Request instances must contain a readable body",cr,{cause:e});return e.text()})(t)}function S5(t,e,n,i){if(t===void 0)if(Array.isArray(e)){if(!e.includes(i.alg))throw ot('unexpected JWT "alg" header parameter',Pt,{header:i,expected:e,reason:"authorization server metadata"})}else{if(n===void 0)throw ot('missing client or server configuration to verify used JWT "alg" header parameter',void 0,{client:t,issuer:e,fallback:n});if(typeof n=="string"?i.alg!==n:typeof n=="function"?!n(i.alg):!n.includes(i.alg))throw ot('unexpected JWT "alg" header parameter',Pt,{header:i,expected:n,reason:"default value"})}else if(typeof t=="string"?i.alg!==t:!t.includes(i.alg))throw ot('unexpected JWT "alg" header parameter',Pt,{header:i,expected:t,reason:"client configuration"})}function Qc(t,e){const n=t.getAll(e),i=n[0];if(n.length>1)throw ot('"'.concat(e,'" parameter must be provided only once'),Pt);return i}const uG=Symbol(),dG=Symbol();function hG(t,e,n,i){if(Kr(t),Zr(e),n instanceof URL&&(n=n.searchParams),!(n instanceof URLSearchParams))throw qt('"parameters" must be an instance of URLSearchParams, or URL',Vi);if(Qc(n,"response"))throw ot('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()',Pt,{parameters:n});const r=Qc(n,"iss"),o=Qc(n,"state");if(!r&&t.authorization_response_iss_parameter_supported)throw ot('response parameter "iss" (issuer) missing',Pt,{parameters:n});if(r&&r!==t.issuer)throw ot('unexpected "iss" (issuer) response parameter value',Pt,{expected:t.issuer,parameters:n});switch(i){case void 0:case dG:if(o!==void 0)throw ot('unexpected "state" response parameter encountered',Pt,{expected:void 0,parameters:n});break;case uG:break;default:if(Ln(i,'"expectedState" argument'),o!==i)throw ot(o===void 0?'response parameter "state" missing':'unexpected "state" response parameter value',Pt,{expected:i,parameters:n})}if(Qc(n,"error"))throw new h5("authorization response from the server is an error",{cause:n});const l=Qc(n,"id_token"),u=Qc(n,"token");if(l!==void 0||u!==void 0)throw new fs("implicit and hybrid flows are not supported");return d=new URLSearchParams(n),CC.add(d),d;var d}async function Vm(t){let e,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u5;try{e=await t.json()}catch(i){throw n(t),ot('failed to parse "response" body as JSON',rb,i)}if(!eb(e))throw ot('"response" body must be a top level object',Pt,{body:e});return e}const qk=Symbol(),k5=Symbol(),E5=new TextEncoder,sT=new TextDecoder,OC=new TextDecoder("utf-8",{fatal:!0});function T5(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const i=e.reduce((l,u)=>
14l+u.length,0),r=new Uint8Array(i);let o=0;for(const l of e)r.set(l,o),o+=l.length;return r}function xu(t){const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++){const i=t.charCodeAt(n);if(i>127)throw new TypeError("non-ASCII string encountered in encode()");e[n]=i}return e}const Zy=function(t){return new TypeError("CryptoKey does not support this operation, its ".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"algorithm.name"," must be ").concat(t))};function fG(t,e,n){var i;const r=t.algorithm;if(r.name!==e.name)throw Zy(e.name);if(e.hash&&((i=r.hash)===null||i===void 0?void 0:i.name)!==e.hash)throw Zy(e.hash,"algorithm.hash");if(e.namedCurve&&r.namedCurve!==e.namedCurve)throw Zy(e.namedCurve,"algorithm.namedCurve");if(e.length!==void 0&&r.length!==e.length)throw Zy(e.length,"algorithm.length");(function(o,l){if(l&&!o.usages.includes(l))throw new TypeError("CryptoKey does not support this operation, its usages must include ".concat(l,"."))})(t,n)}const Wy=function(t,e){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return(function(o,l){for(var u=arguments.length,d=new Array(u>2?u-2:0),f=2;f<u;f++)d[f-2]=arguments[f];if(d.length>2){const g=d.pop();o+="one of type ".concat(d.join(", "),", or ").concat(g,".")}else d.length===2?o+="one of type ".concat(d[0]," or ").concat(d[1],"."):o+="of type ".concat(d[0],".");if(l==null)o+=" Received ".concat(l);else if(typeof l=="function"&&l.name)o+=" Received function ".concat(l.name);else if(typeof l=="object"&&l!=null){var p;(p=l.constructor)!==null&&p!==void 0&&p.name&&(o+=" Received an instance of ".concat(l.constructor.name))}return o})("Key for the ".concat(t," algorithm must be "),e,...i)};let Gi=class extends Error{constructor(e,n){var i;super(e,n),_e(this,"code","ERR_JOSE_GENERIC"),this.name=this.constructor.name,(i=Error.captureStackTrace)===null||i===void 0||i.call(Error,this,this.constructor)}};_e(Gi,"code","ERR_JOSE_GENERIC");let pu=class extends Gi{constructor(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"unspecified",r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unspecified";super(e,{cause:{claim:i,reason:r,payload:n}}),_e(this,"code","ERR_JWT_CLAIM_VALIDATION_FAILED"),_e(this,"claim",void 0),_e(this,"reason",void 0),_e(this,"payload",void 0),this.claim=i,this.reason=r,this.payload=n}};_e(pu,"code","ERR_JWT_CLAIM_VALIDATION_FAILED");let oT=class extends Gi{constructor(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"unspecified",r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unspecified";super(e,{cause:{claim:i,reason:r,payload:n}}),_e(this,"code","ERR_JWT_EXPIRED"),_e(this,"claim",void 0),_e(this,"reason",void 0),_e(this,"payload",void 0),this.claim=i,this.reason=r,this.payload=n}};
14_e(oT,"code","ERR_JWT_EXPIRED");let C5=class extends Gi{constructor(){super(...arguments),_e(this,"code","ERR_JOSE_ALG_NOT_ALLOWED")}};_e(C5,"code","ERR_JOSE_ALG_NOT_ALLOWED");let Za=class extends Gi{constructor(){super(...arguments),_e(this,"code","ERR_JOSE_NOT_SUPPORTED")}};_e(Za,"code","ERR_JOSE_NOT_SUPPORTED");_e(class extends Gi{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"decryption operation failed",arguments.length>1?arguments[1]:void 0),_e(this,"code","ERR_JWE_DECRYPTION_FAILED")}},"code","ERR_JWE_DECRYPTION_FAILED");_e(class extends Gi{constructor(){super(...arguments),_e(this,"code","ERR_JWE_INVALID")}},"code","ERR_JWE_INVALID");let sr=class extends Gi{constructor(){super(...arguments),_e(this,"code","ERR_JWS_INVALID")}};_e(sr,"code","ERR_JWS_INVALID");let lo=class extends Gi{constructor(){super(...arguments),_e(this,"code","ERR_JWT_INVALID")}};_e(lo,"code","ERR_JWT_INVALID");_e(class extends Gi{constructor(){super(...arguments),_e(this,"code","ERR_JWK_INVALID")}},"code","ERR_JWK_INVALID");let RC=class extends Gi{constructor(){super(...arguments),_e(this,"code","ERR_JWKS_INVALID")}};_e(RC,"code","ERR_JWKS_INVALID");let $C=class extends Gi{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"no applicable key found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),_e(this,"code","ERR_JWKS_NO_MATCHING_KEY")}};_e($C,"code","ERR_JWKS_NO_MATCHING_KEY");let O5=class extends Gi{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"multiple matching keys found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),_e(this,Symbol.asyncIterator,NL(function*(){})),_e(this,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS")}};_e(O5,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS");let R5=class extends Gi{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"request timed out",arguments.length>1?arguments[1]:void 0),_e(this,"code","ERR_JWKS_TIMEOUT")}};_e(R5,"code","ERR_JWKS_TIMEOUT");let $5=class extends Gi{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"signature verification failed",arguments.length>1?arguments[1]:void 0),_e(this,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED")}};_e($5,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED");const A5=t=>{if(t?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return t instanceof CryptoKey}catch{return!1}},pG=t=>A5(t)||(e=>e?.[Symbol.toStringTag]==="KeyObject")(t);function j5(t){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(t);const e=atob(t),n=new Uint8Array(e.length);for(let i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return n}const Vk="The input to be decoded is not correctly encoded.";function bw(t){if(Uint8Array.fromBase64)try{return Uint8Array.fromBase64(typeof t=="string"?t:sT.decode(t),{alphabet:"base64url"})}catch(n){throw new TypeError(Vk,{cause:n})}let e=t;if(e instanceof Uint8Array&&(e=sT.decode(e)),e.includes("+")||e.includes("/"))throw new TypeError(Vk);e=e.replace(/-/g,"+").replace(/_/g,"/");try{return j5(e)}catch{throw new TypeError(Vk)}}function AC(t){let e=t;return typeof e=="string"&&(e=E5.encode(e)),Uint8Array.prototype.toBase64?e.toBase64({alphabet:"base64url",omitPadding:!0}):(function(n){if(Uint8Array.prototype.toBase64)return n.toBase64();const i=[];for(let r=0;r<n.length;r+=32768)i.push(String.fromCharCode.apply(null,n.subarray(r,r+32768)));return btoa(i.join(""))})(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function lc(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||Object.getPrototypeOf(e)===null}function P5(t){return lc(t)&&Array.isArray(t.keys)&&Array.from(t.keys).every(lc)}function MN(t,e,n){try{return bw(t)}catch{throw new n("Failed to base64url decode the ".concat(e))}}async function N5(t,e){var n,i,r,o;if(e.kty==="RSA"&&"oth"in e&&e.oth!==void 0)throw new Za('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');if(!t.kty.includes(e.kty))throw new Za('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');const l=(n=(i=t.resolve)===null||i===void 0?void 0:i.call(t,{kty:e.kty,crv:e.crv}))!==null&&n!==void 0?n:t.subtle,u=!(!e.d&&!e.priv),d=Ee({},e);return d.kty!=="AKP"&&delete d.alg,delete d.use,crypto.subtle.importKey("jwk",d,l,(r=e.ext)!==null&&r!==void 0?r:!u,(o=e.key_ops)!==null&&o!==void 0?o:t.usages[u?1:0])}function M5(t){return Ee({__proto__:null},t)}const Bk=t=>t[Symbol.toStringTag];function gG(t,e,n){const i=t.alg,r=t.secret,o=n==="decrypt"||n==="sign";if(r&&e instanceof Uint8Array)return[I5,e];if(lc(e)){const l=(function(u){const d=M5(u);if(d.ext!==void 0&&typeof d.ext!="boolean")throw new TypeError('"ext" (Extractable) Parameter must be a boolean');if(d.key_ops!==void 0){const f=d.key_ops,p=Array.isArray(f)?[...f]:void 0;if(!p||p.some(g=>typeof g!="string")||new Set(p).size!==p.length)throw new TypeError('"key_ops" (Key Operations) Parameter must be an array of unique strings');d.key_ops=p}return d})(e);
14if(typeof l.kty!="string")throw new TypeError(r?Wy(i,e,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"):Wy(i,e,"CryptoKey","KeyObject","JSON Web Key"));if(!(r?l.kty==="oct"&&typeof l.k=="string":l.kty!=="oct"&&(o?l.kty==="AKP"&&typeof l.priv=="string"||typeof l.d=="string":l.d===void 0&&l.priv===void 0)))throw new TypeError(r?'JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present':"JSON Web Key for this operation must be a ".concat(o?"private":"public"," JWK"));return((u,d,f)=>{const p=u.alg;if(d.use!==void 0){const v=f==="sign"||f==="verify"?"sig":"enc";if(d.use!==v)throw new TypeError('Invalid key for this operation, its "use" must be "'.concat(v,'" when present'))}if(d.alg!==void 0&&d.alg!==p)throw new TypeError('Invalid key for this operation, its "alg" must be "'.concat(p,'" when present'));if(Array.isArray(d.key_ops)){var g;const v=f==="encrypt"||f==="decrypt"?(g=u.ops)===null||g===void 0?void 0:g[f==="encrypt"?0:1]:f;if(v&&!d.key_ops.includes(v))throw new TypeError('Invalid key for this operation, its "key_ops" must include "'.concat(v,'" when present'))}})(t,l,n),[L5,e,l]}if(!pG(e))throw new TypeError(r?Wy(i,e,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"):Wy(i,e,"CryptoKey","KeyObject","JSON Web Key"));if(r){if(e.type!=="secret")throw new TypeError("".concat(Bk(e),' instances for symmetric algorithms must be of type "secret"'))}else{if(e.type==="secret")throw new TypeError("".concat(Bk(e),' instances for asymmetric algorithms must not be of type "secret"'));const l=o?"private":"public";if((e.type==="public"||e.type==="private")&&e.type!==l){const u=n==="sign"?"signing":n==="verify"?"verifying":"".concat(n.slice(0,-1),"tion");throw new TypeError("".concat(Bk(e)," instances for asymmetric algorithm ").concat(u,' must be of type "').concat(l,'"'))}}return A5(e)?[z5,e]:[D5,e]}const I5=0,z5=1,D5=2,L5=3;let qy;const mG={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"};function ob(t,e,n){qy||(qy=new WeakMap);const i=qy.get(t);return n&&(i?i[e]=n:qy.set(t,{[e]:n})),n??i?.[e]}const IN=async(t,e,n)=>{var i;return(i=ob(t,n.alg))!==null&&i!==void 0?i:ob(t,n.alg,await N5(n,Ee(Ee({},e),{},{alg:n.alg})))};async function U5(t,e,n){const i=gG(t,e,n);switch(i[0]){case I5:case z5:return i[1];case L5:{const r=i[1],o=i[2];if(o.kty==="oct")return bw(o.k);if(!Object.isFrozen(r)){const l=r.key_ops;Array.isArray(l)&&Object.freeze(l),Object.freeze(r)}return IN(r,o,t)}case D5:{const r=i[1];return r.type==="secret"?r.export():"toCryptoKey"in r&&typeof r.toCryptoKey=="function"?((o,l)=>{var u,d,f;
14const p=ob(o,l.alg);if(p)return p;const g=o.type==="public",v=l.usages[g?0:1],y=o.asymmetricKeyType,b=mG[(u=o.asymmetricKeyDetails)===null||u===void 0?void 0:u.namedCurve],x=(d=(f=l.resolve)===null||f===void 0?void 0:f.call(l,{crv:b,asymmetricKeyType:y}))!==null&&d!==void 0?d:l.subtle;return ob(o,l.alg,o.toCryptoKey(x,g,v))})(r,t):IN(r,r.export({format:"jwk"}),t)}}}function jC(t){const e={__proto__:null};for(const n in t)e[n]=Ee(Ee({},t[n]),{},{alg:n});return e}const vG=[["encrypt","wrapKey"],["decrypt","unwrapKey"]],yG=[[],["deriveBits"]],ww=[[],[]];function Vy(t){return{kty:["RSA"],subtle:{name:"RSA-OAEP",hash:"SHA-".concat(t)},usages:vG,ops:["wrapKey","unwrapKey"]}}function By(){return{kty:["EC","OKP"],subtle:{name:"ECDH"},resolve:t=>{let e=t.kty,n=t.crv,i=t.asymmetricKeyType;if(n==="X25519"||i==="x25519")return{name:"X25519"};if(e==="OKP")throw new Za('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');return{name:"ECDH",namedCurve:n}},usages:yG,ops:[void 0,"deriveBits"]}}function Md(t){let e=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return{kty:["oct"],secret:!0,subtle:{name:e?"AES-GCM":"AES-KW",length:t},usages:ww,ops:e?["encrypt","decrypt"]:["wrapKey","unwrapKey"]}}function Gk(){return{kty:["oct"],secret:!0,subtle:{name:"PBKDF2"},usages:ww,ops:["deriveBits","deriveBits"]}}const _G=jC({dir:{kty:["oct"],secret:!0,subtle:{name:"AES-GCM"},usages:ww,ops:["encrypt","decrypt"]},"RSA-OAEP":Vy(1),"RSA-OAEP-256":Vy(256),"RSA-OAEP-384":Vy(384),"RSA-OAEP-512":Vy(512),"ECDH-ES":By(),"ECDH-ES+A128KW":By(),"ECDH-ES+A192KW":By(),"ECDH-ES+A256KW":By(),A128KW:Md(128),A192KW:Md(192),A256KW:Md(256),A128GCMKW:Md(128,!0),A192GCMKW:Md(192,!0),A256GCMKW:Md(256,!0),"PBES2-HS256+A128KW":Gk(),"PBES2-HS384+A192KW":Gk(),"PBES2-HS512+A256KW":Gk()}),bG=["encrypt","decrypt"];function Id(t){let e=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return{kty:["oct"],secret:!0,subtle:{name:e?"AES-CBC":"AES-GCM",length:t},usages:ww,ops:bG,cekBits:t,ivBits:e?128:96,cbc:e}}jC({A128GCM:Id(128),A192GCM:Id(192),A256GCM:Id(256),"A128CBC-HS256":Id(256,!0),"A192CBC-HS384":Id(384,!0),"A256CBC-HS512":Id(512,!0)});const F5={__proto__:null,b64:!0};function wG(t,e){if(e!==void 0&&(!Array.isArray(e)||e.some(n=>typeof n!="string")))throw new TypeError('"'.concat(t,'" option must be an array of strings'));if(e)return new Set(e)}function H5(t,e,n,i,r){if(r.crit!==void 0&&i?.crit===void 0)throw new t('"crit" (Critical) Header Parameter MUST be integrity protected');if(!i||i.crit===void 0)return[];if(!Array.isArray(i.crit)||i.crit.length===0||i.crit.some(l=>typeof l!="string"||l.length===0))throw new t('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');const o=n===void 0?e:Ee(Ee({__proto__:null},n),e);for(const l of i.crit){if(!(l in o))throw new Za('Extension Header Parameter "'.concat(l,'" is not recognized'));if(!Object.hasOwn(r,l)||r[l]===void 0)throw new t('Extension Header Parameter "'.concat(l,'" is missing'));if(o[l]&&(!Object.hasOwn(i,l)||i[l]===void 0))throw new t('Extension Header Parameter "'.concat(l,'" MUST be integrity protected'))}return i.crit}function K5(t,e){if(e.includes("b64")){const n=t.b64;if(typeof n!="boolean")throw new sr('The "b64" (base64url-encode payload) Header Parameter must be a boolean');return n}return!0}var Gy,Jk;let Fs,zN;(typeof navigator>"u"||(Gy=navigator.userAgent)===null||Gy===void 0||(Jk=Gy.startsWith)===null||Jk===void 0||!Jk.call(Gy,"Mozilla/5.0 "))&&(zN="".concat("openid-client","/").concat("v6.8.4"),Fs={"user-agent":zN});const gi=t=>i_.get(t);let i_,Jy;function Z5(t){return t!==void 0?AN(t):(Jy||(Jy=new WeakMap),(e,n,i,r)=>{let o;return(o=Jy.get(n))||((function(l,u){if(typeof l!="string")throw ea("".concat(u," must be a string"),Gm);if(l.length===0)throw ea("".concat(u," must not be empty"),Bm)})(n.client_secret,'"metadata.client_secret"'),o=AN(n.client_secret),Jy.set(n,o)),o(e,n,i,r)})}const xG=f5,Mt=Vr,Bm="ERR_INVALID_ARG_VALUE",Gm="ERR_INVALID_ARG_TYPE";function ea(t,e,n){const i=new TypeError(t,{cause:n});return Object.assign(i,{code:e}),i}function SG(t){return(async function(e){return Ln(e,"codeVerifier"),wu(await crypto.subtle.digest("SHA-256",$h(e)))})(t)}function kG(){return d5()}
14let ab=class extends Error{constructor(e,n){var i;super(e,n),_e(this,"code",void 0),this.name=this.constructor.name,this.code=n?.code,(i=Error.captureStackTrace)===null||i===void 0||i.call(Error,this,this.constructor)}};function yr(t,e,n){return new ab(t,{cause:e,code:n})}function _i(t){if(t instanceof TypeError||t instanceof ab||t instanceof gw||t instanceof h5||t instanceof EC)throw t;if(t instanceof SC)switch(t.code){case b5:throw yr("only requests to HTTPS are allowed",t,t.code);case w5:throw yr("only requests to HTTP or HTTPS are allowed",t,t.code);case _w:throw yr("unexpected HTTP response status code",t.cause,t.code);case _5:throw yr("unexpected response content-type",t.cause,t.code);case rb:throw yr("parsing error occured",t,t.code);case Pt:throw yr("invalid response encountered",t,t.code);case Ha:throw yr("unexpected JWT claim value encountered",t,t.code);case sb:throw yr("unexpected JSON attribute value encountered",t,t.code);case um:throw yr("JWT timestamp claim value failed validation",t,t.code);default:throw yr(t.message,t,t.code)}if(t instanceof fs)throw yr("unsupported operation",t,t.code);if(t instanceof DOMException)switch(t.name){case"OperationError":throw yr("runtime operation error",t,rT);case"NotSupportedError":throw yr("runtime unsupported operation",t,rT);case"TimeoutError":throw yr("operation timed out",t,"OAUTH_TIMEOUT");case"AbortError":throw yr("operation aborted",t,"OAUTH_ABORT")}throw new ab("something went wrong",{cause:t})}async function EG(t,e,n,i,r){const o=await(async function(d,f){var p,g;if(!(d instanceof URL))throw ea('"server" must be an instance of URL',Gm);const v=!d.href.includes("/.well-known/"),y=(p=f?.timeout)!==null&&p!==void 0?p:30,b=AbortSignal.timeout(1e3*y),x=await(v?DB(d,{algorithm:f?.algorithm,[Vr]:f?.[Mt],[Bi]:f==null||(g=f.execute)===null||g===void 0?void 0:g.includes(LN),signal:b,headers:new Headers(Fs)}):(f?.[Mt]||fetch)((pw(d,f==null||(S=f.execute)===null||S===void 0||!S.includes(LN)),d.href),{headers:Object.fromEntries(new Headers(Ee({accept:"application/json"},Fs)).entries()),body:void 0,method:"GET",redirect:"manual",signal:b})).then(k=>(async function(T,C){const A=T;if(!(A instanceof URL)&&A!==qk)throw qt('"expectedIssuerIdentifier" must be an instance of URL',Vi);if(!Ga(C,Response))throw qt('"response" must be an instance of Response',Vi);if(C.status!==200)throw ot('"response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)',_w,C);uf(C);const $=await Vm(C);if(Ln($.issuer,'"response" body "issuer" property',Pt,{body:$}),A!==qk&&new URL($.issuer).href!==A.href)throw ot('"response" body "issuer" property does not match the expected value',sb,{expected:A.href,body:$,attribute:"issuer"});return $})(qk,k)).catch(_i);var S;return v&&new URL(x.issuer).href!==d.href&&((function(k,T,C){return!(k.origin!=="https://login.microsoftonline.com"||C!=null&&C.algorithm&&C.algorithm!=="oidc"||(T[W5]=!0,0))})(d,x,f)||(function(k,T){return!(!k.hostname.endsWith(".b2clogin.com")||T!=null&&T.algorithm&&T.algorithm!=="oidc")})(d,f)||(()=>{throw new ab("discovered metadata issuer does not match the expected issuer",{code:sb,cause:{expected:d.href,body:x,attribute:"issuer"}})})()),x})(t,r),l=new qh(o,e,n,i);let u=gi(l);if(r!=null&&r[Mt]&&(u.fetch=r[Mt]),r!=null&&r.timeout&&(u.timeout=r.timeout),r!=null&&r.execute)for(const d of r.execute)d(l);return l}new TextDecoder;const W5=Symbol();let qh=class{constructor(e,n,i,r){var o,l,u,d,f;if(typeof n!="string"||!n.length)throw ea('"clientId" must be a non-empty string',Gm);if(typeof i=="string"&&(i={client_secret:i}),((o=i)===null||o===void 0?void 0:o.client_id)!==void 0&&n!==i.client_id)throw ea('"clientId" and "metadata.client_id" must be the same',Bm);const p=Ee(Ee({},structuredClone(i)),{},{client_id:n});let g;p[Q_]=(l=(u=i)===null||u===void 0?void 0:u[Q_])!==null&&l!==void 0?l:0,p[tT]=(d=(f=i)===null||f===void 0?void 0:f[tT])!==null&&d!==void 0?d:30,g=r||(typeof p.client_secret=="string"&&p.client_secret.length?Z5(p.client_secret):(x,S,k,T)=>{k.set("client_id",S.client_id)});let v=Object.freeze(p);const y=structuredClone(e);W5 in e&&(y[k5]=x=>{let S=x.claims.tid;return e.issuer.replace("{tenantid}",S)});let b=Object.freeze(y);i_||(i_=new WeakMap),i_.set(this,{__proto__:null,as:b,c:v,auth:g,tlsOnly:!0,jwksCache:{}})}serverMetadata(){const e=structuredClone(gi(this).as);return(function(n){Object.defineProperties(n,(function(i){return{supportsPKCE:{__proto__:null,value(){var r;let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"S256";return((r=i.code_challenge_methods_supported)===null||r===void 0?void 0:r.includes(o))===!0}}}})(n))})(e),e}clientMetadata(){return structuredClone(gi(this).c)}get timeout(){return gi(this).timeout}set timeout(e){gi(this).timeout=e}get[Mt](){return gi(this).fetch}set[Mt](e){gi(this).fetch=e}};function Jm(t){Object.defineProperties(t,(function(e){let n;if(e.expires_in!==void 0){const i=new Date;i.setSeconds(i.getSeconds()+e.expires_in),n=i.getTime()}
14return{expiresIn:{__proto__:null,value(){if(n){const i=Date.now();return n>i?Math.floor((n-i)/1e3):0}}},claims:{__proto__:null,value(){try{return iT(this)}catch{return}}}}})(t))}async function DN(t,e,n){var i;let r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];const o=(i=t.headers.get("retry-after"))===null||i===void 0?void 0:i.trim();if(o===void 0)return;let l;if(/^\d+$/.test(o))l=parseInt(o,10);else{const u=new Date(o);if(Number.isFinite(u.getTime())){const d=new Date,f=u.getTime()-d.getTime();f>0&&(l=Math.ceil(f/1e3))}}if(r&&!Number.isFinite(l))throw new SC("invalid Retry-After header value",{cause:t});l>e&&await q5(l-e,n)}function q5(t,e){return new Promise((n,i)=>{const r=o=>{try{e.throwIfAborted()}catch(u){return void i(u)}if(o<=0)return void n();const l=Math.min(o,5);setTimeout(()=>r(o-l),1e3*l)};r(t)})}async function Xk(t,e){wo(t);const n=gi(t),i=n.as,r=n.c,o=n.auth,l=n.fetch,u=n.tlsOnly,d=n.timeout;return(async function(f,p,g,v,y){Kr(f),Zr(p);const b=Fu(f,"backchannel_authentication_endpoint",p.use_mtls_endpoint_aliases,y?.[Bi]!==!0),x=new URLSearchParams(v);x.set("client_id",p.client_id);const S=Nu(y?.headers);return S.set("accept","application/json"),yw(f,p,g,b,x,S,y)})(i,r,o,e,{[Vr]:l,[Bi]:!u,headers:new Headers(Fs),signal:Ja(d)}).then(f=>(async function(p,g,v){if(Kr(p),Zr(g),!Ga(v,Response))throw qt('"response" must be an instance of Response',Vi);await mw(v,200,"Backchannel Authentication Endpoint"),uf(v);const y=await Vm(v);Ln(y.auth_req_id,'"response" body "auth_req_id" property',Pt,{body:y});let b=typeof y.expires_in!="number"?parseFloat(y.expires_in):y.expires_in;return ic(b,!0,'"response" body "expires_in" property',Pt,{body:y}),y.expires_in=b,y.interval!==void 0&&ic(y.interval,!1,'"response" body "interval" property',Pt,{body:y}),y})(i,r,f)).catch(_i)}async function aT(t,e,n,i){var r,o;wo(t),n=new URLSearchParams(n);let l=(r=e.interval)!==null&&r!==void 0?r:5;const u=(o=i?.signal)!==null&&o!==void 0?o:AbortSignal.timeout(1e3*e.expires_in);try{await q5(l,u)}catch(j){_i(j)}const d=gi(t),f=d.as,p=d.c,g=d.auth,v=d.fetch,y=d.tlsOnly,b=d.nonRepudiation,x=d.timeout,S=d.decrypt,k=(j,O)=>aT(t,Ee(Ee({},e),{},{interval:j}),n,Ee(Ee({},i),{},{signal:u,flag:O})),T=(function(j,O){const L=Ja(O);if(!L)return{signal:j,cleanup(){}};const B=new AbortController,V=ee=>{const me=ee.target;B.abort(me.reason)};return j.aborted?B.abort(j.reason):L.aborted?B.abort(L.reason):(j.addEventListener("abort",V,{once:!0}),L.addEventListener("abort",V,{once:!0})),{signal:B.signal,cleanup(){j.removeEventListener("abort",V),L.removeEventListener("abort",V)}}})(u,x),C=await(async function(j,O,L,B,V){Kr(j),Zr(O),Ln(B,'"authReqId"');const ee=new URLSearchParams(V?.additionalParameters);return ee.set("auth_req_id",B),qm(j,O,L,"urn:openid:params:grant-type:ciba",ee,V)})(f,p,g,e.auth_req_id,{[Vr]:v,[Bi]:!y,additionalParameters:n,DPoP:i?.DPoP,headers:new Headers(Fs),signal:T.signal}).catch(_i).finally(T.cleanup);var A;if(C.status===503&&C.headers.has("retry-after"))return await DN(C,l,u,!0),await((A=C.body)===null||A===void 0?void 0:A.cancel()),k(l);const $=(async function(j,O,L,B){return Wh(j,O,L,void 0,B?.[_o],B?.recognizedTokenTypes)})(f,p,C,{[_o]:S});let N;try{N=await $}catch(j){if(Hu(j,i))return k(l,Yo);if(j instanceof gw)switch(j.error){case"slow_down":l+=5;case"authorization_pending":return await DN(j.response,l,u),k(l)}_i(j)}return N.id_token&&await b?.(C),Jm(N),N}function LN(t){gi(t).tlsOnly=!1}async function cg(t,e,n,i,r){if(wo(t),!(r?.flag===Yo||e instanceof URL||(function(j,O){try{return Object.getPrototypeOf(j)[Symbol.toStringTag]===O}catch{return!1}})(e,"Request")))throw ea('"currentUrl" must be an instance of URL, or Request',Gm);let o,l;const u=gi(t),d=u.as,f=u.c,p=u.auth,g=u.fetch,v=u.tlsOnly,y=u.jarm,b=u.hybrid,x=u.nonRepudiation,S=u.timeout,k=u.decrypt,T=u.implicit;if(r?.flag===Yo)o=r.authResponse,l=r.redirectUri;else{if(!(e instanceof URL)){const j=e;switch(e=new URL(e.url),j.method){case"GET":break;case"POST":const O=new URLSearchParams(await cG(j));if(b)e.hash=O.toString();else for(const L of O.entries()){var C=lr(L,2);const B=C[0],V=C[1];e.searchParams.append(B,V)}break;default:throw ea("unexpected Request HTTP method",Bm)}}switch(l=(function(j){return(j=new URL(j)).search="",j.hash="",j.href})(e),!0){case!!y:o=await y(e,n?.expectedState);break;case!!b:o=await b(e,n?.expectedNonce,n?.expectedState,n?.maxAge);break;case!!T:throw new TypeError("authorizationCodeGrant() cannot be used by response_type=id_token clients");default:try{o=hG(d,f,e.searchParams,n?.expectedState)}catch(j){_i(j)}}}const A=await(async function(j,O,L,B,V,ee,me){if(Kr(j),Zr(O),!CC.has(B))throw qt('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()',cr);Ln(V,'"redirectUri"');const ne=Qc(B,"code");if(!ne)throw ot('no authorization code in "callbackParameters"',Pt);const ce=new URLSearchParams(me?.additionalParameters);return ce.set("redirect_uri",V),ce.set("code",ne),ee!==PN&&(Ln(ee,'"codeVerifier"'),ce.set("code_verifier",ee)),qm(j,O,L,"authorization_code",ce,me)})(d,f,p,o,l,n?.pkceCodeVerifier||PN,{additionalParameters:i,[Vr]:g,[Bi]:!v,DPoP:r?.DPoP,headers:new Headers(Fs),signal:Ja(S)}).catch(_i);typeof n?.expectedNonce!="string"&&typeof n?.maxAge!="number"||(n.idTokenExpected=!0);const $=eG(d,f,A,{expectedNonce:n?.expectedNonce,maxAge:n?.maxAge,requireIdToken:n?.idTokenExpected,[_o]:k});let N;try{N=await $}catch(j){if(Hu(j,r))return cg(t,void 0,n,i,Ee(Ee({},r),{},{flag:Yo,authResponse:o,redirectUri:l}));_i(j)}return N.id_token&&await x?.(A),Jm(N),N}async function lT(t,e,n,i){wo(t),n=new URLSearchParams(n);const r=gi(t),o=r.as,l=r.c,u=r.auth,d=r.fetch,f=r.tlsOnly,p=r.nonRepudiation,g=r.timeout,v=r.decrypt,y=await(async function(S,k,T,C,A){Kr(S),Zr(k),Ln(C,'"refreshToken"');const $=new URLSearchParams(A?.additionalParameters);return $.set("refresh_token",C),qm(S,k,T,"refresh_token",$,A)})(o,l,u,e,{[Vr]:d,[Bi]:!f,additionalParameters:n,DPoP:i?.DPoP,headers:new Headers(Fs),signal:Ja(g)}
14).catch(_i),b=(async function(S,k,T,C){return Wh(S,k,T,void 0,C?.[_o],C?.recognizedTokenTypes)})(o,l,y,{[_o]:v});let x;try{x=await b}catch(S){if(Hu(S,i))return lT(t,e,n,Ee(Ee({},i),{},{flag:Yo}));_i(S)}return x.id_token&&await p?.(y),Jm(x),x}async function cT(t,e,n){wo(t),e=new URLSearchParams(e);const i=gi(t),r=i.as,o=i.c,l=i.auth,u=i.fetch,d=i.tlsOnly,f=i.timeout,p=await(async function(y,b,x,S,k){return Kr(y),Zr(b),qm(y,b,x,"client_credentials",new URLSearchParams(S),k)})(r,o,l,e,{[Vr]:u,[Bi]:!d,DPoP:n?.DPoP,headers:new Headers(Fs),signal:Ja(f)}).catch(_i),g=(async function(y,b,x,S){return Wh(y,b,x,void 0,void 0,void 0)})(r,o,p);let v;try{v=await g}catch(y){if(Hu(y,n))return cT(t,e,Ee(Ee({},n),{},{flag:Yo}));_i(y)}return Jm(v),v}function uT(t,e){wo(t);const n=gi(t),i=n.as,r=n.c,o=n.tlsOnly,l=n.hybrid,u=n.jarm,d=n.implicit,f=Fu(i,"authorization_endpoint",!1,o);if((e=new URLSearchParams(e)).has("client_id")||e.set("client_id",r.client_id),!e.has("request_uri")&&!e.has("request")){if(e.has("response_type")||e.set("response_type",l?"code id_token":d?"id_token":"code"),d&&!e.has("nonce"))throw ea("response_type=id_token clients must provide a nonce parameter in their authorization request parameters",Bm);u&&e.set("response_mode","jwt")}for(const g of e.entries()){var p=lr(g,2);const v=p[0],y=p[1];f.searchParams.append(v,y)}return f}async function V5(t,e,n){wo(t);const i=uT(t,e),r=gi(t),o=r.as,l=r.c,u=r.auth,d=r.fetch,f=r.tlsOnly,p=r.timeout,g=await(async function(b,x,S,k,T){var C;Kr(b),Zr(x);const A=Fu(b,"pushed_authorization_request_endpoint",x.use_mtls_endpoint_aliases,T?.[Bi]!==!0),$=new URLSearchParams(k);$.set("client_id",x.client_id);const N=Nu(T?.headers);N.set("accept","application/json"),T?.DPoP!==void 0&&(TC(T.DPoP),await T.DPoP.addProof(A,N,"POST"));const j=await yw(b,x,S,A,$,N,T);return T==null||(C=T.DPoP)===null||C===void 0||C.cacheNonce(j,A),j})(o,l,u,i.searchParams,{[Vr]:d,[Bi]:!f,DPoP:n?.DPoP,headers:new Headers(Fs),signal:Ja(p)}).catch(_i),v=(async function(b,x,S){if(Kr(b),Zr(x),!Ga(S,Response))throw qt('"response" must be an instance of Response',Vi);await mw(S,201,"Pushed Authorization Request Endpoint"),uf(S);const k=await Vm(S);Ln(k.request_uri,'"response" body "request_uri" property',Pt,{body:k});let T=typeof k.expires_in!="number"?parseFloat(k.expires_in):k.expires_in;return ic(T,!0,'"response" body "expires_in" property',Pt,{body:k}),k.expires_in=T,k})(o,l,g);let y;try{y=await v}catch(b){if(Hu(b,n))return V5(t,e,Ee(Ee({},n),{},{flag:Yo}));_i(b)}return uT(t,{request_uri:y.request_uri})}function wo(t){if(!(t instanceof qh))throw ea('"config" must be an instance of Configuration',Gm);if(Object.getPrototypeOf(t)!==qh.prototype)throw ea("subclassing Configuration is not allowed",Bm)}function Ja(t){return t?AbortSignal.timeout(1e3*t):void 0}async function B5(t,e,n,i){wo(t);const r=gi(t),o=r.as,l=r.c,u=r.fetch,d=r.tlsOnly,f=r.nonRepudiation,p=r.timeout,g=r.decrypt,v=await BB(o,l,e,{[Vr]:u,[Bi]:!d,DPoP:i?.DPoP,headers:new Headers(Fs),signal:Ja(p)}).catch(_i);let y,b=GB(o,l,n,v,{[_o]:g});try{y=await b}catch(x){if(Hu(x,i))return B5(t,e,n,Ee(Ee({},i),{},{flag:Yo}));_i(x)}return vw(v)==="application/jwt"&&await f?.(v),y}function Hu(t,e){return!(e==null||!e.DPoP||e.flag===Yo)&&(function(n){if(n instanceof EC){const i=n.cause,r=i[0];return i.length===1&&r.scheme==="dpop"&&r.parameters.error==="use_dpop_nonce"}return n instanceof gw&&n.error==="use_dpop_nonce"})(t)}Object.freeze(qh.prototype);const Yo=Symbol();async function ir(t,e,n,i){wo(t);const r=gi(t),o=r.as,l=r.c,u=r.auth,d=r.fetch,f=r.tlsOnly,p=r.timeout,g=r.decrypt,v=r.nonRepudiation,y=await(async function(k,T,C,A,$,N){return Kr(k),Zr(T),Ln(A,'"grantType"'),qm(k,T,C,A,new URLSearchParams($),N)})(o,l,u,e,new URLSearchParams(n),{[Vr]:d,[Bi]:!f,DPoP:i?.DPoP,headers:new Headers(Fs),signal:Ja(p)}).catch(_i);let b;e==="urn:ietf:params:oauth:grant-type:token-exchange"&&(b={n_a:()=>{}});const x=(async function(k,T,C,A){return Wh(k,T,C,void 0,A?.[_o],A?.recognizedTokenTypes)})(o,l,y,{[_o]:g,recognizedTokenTypes:b});let S;try{S=await x}catch(k){if(Hu(k,i))return ir(t,e,n,Ee(Ee({},i),{},{flag:Yo}));_i(k)}return S.id_token&&await v?.(y),Jm(S),S}async function TG(t,e,n){wo(t);const i=gi(t),r=i.as,o=i.c,l=i.auth,u=i.fetch,d=i.tlsOnly,f=i.timeout;return(async function(p,g,v,y,b){Kr(p),Zr(g),Ln(y,'"token"');const x=Fu(p,"revocation_endpoint",g.use_mtls_endpoint_aliases,b?.[Bi]!==!0),S=new URLSearchParams(b?.additionalParameters);S.set("token",y);const k=Nu(b?.headers);return k.delete("accept"),yw(p,g,v,x,S,k,b)})(r,o,l,e,{[Vr]:u,[Bi]:!d,additionalParameters:new URLSearchParams(n),headers:new Headers(Fs),signal:Ja(f)}).then(aG).catch(_i)}async function G5(t,e,n){return e instanceof Uint8Array?crypto.subtle.importKey("raw",e,t.subtle,!1,[n]):(fG(e,t.subtle,n),t.minRsaBits&&(function(i,r){const o=r.algorithm.modulusLength;if(typeof o!="number"||o<2048)throw new TypeError("".concat(i," requires ke
14y modulusLength to be 2048 bits or larger"))})(t.alg,e),e)}const Xm=[["verify"],["sign"]];function Yk(t){const e={name:"HMAC",hash:"SHA-".concat(t)};return{kty:["oct"],secret:!0,subtle:e,signing:e,usages:Xm}}function zd(t,e){const n={name:e?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(t)};return{kty:["RSA"],subtle:n,signing:e?Ee(Ee({},n),{},{saltLength:e}):n,usages:Xm,minRsaBits:2048}}function Qk(t,e){return{kty:["EC"],crv:t,subtle:{name:"ECDSA",namedCurve:t},signing:{name:"ECDSA",hash:"SHA-".concat(e)},usages:Xm}}function UN(){const t={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle:t,signing:t,usages:Xm}}function e1(t){const e={name:"ML-DSA-".concat(t)};return{kty:["AKP"],subtle:e,signing:e,usages:Xm}}const PC=jC({HS256:Yk(256),HS384:Yk(384),HS512:Yk(512),RS256:zd(256),RS384:zd(384),RS512:zd(512),PS256:zd(256,32),PS384:zd(384,48),PS512:zd(512,64),ES256:Qk("P-256",256),ES384:Qk("P-384",384),ES512:Qk("P-521",512),EdDSA:UN(),Ed25519:UN(),"ML-DSA-44":e1(44),"ML-DSA-65":e1(65),"ML-DSA-87":e1(87)});function J5(t){const e=typeof t=="string"?PC[t]:void 0;if(!e)throw new Za("alg ".concat(t," is not supported either by JOSE or your javascript runtime"));return e}function CG(t){return arguments.length>1&&arguments[1]!==void 0?arguments[1]:t===void 0?{}:(function(n,i,r){let o;try{o=JSON.parse(OC.decode(bw(n)))}catch{throw new i(r)}if(!lc(o))throw new i(r);return o})(t,sr,"JWS Protected Header is invalid")}async function OG(t,e,n,i,r,o,l){var u;let d=!1;typeof n=="function"&&(n=await n(r,t),d=!0);const f=typeof l=="string",p=J5(o),g=T5(i!==void 0?xu(i):new Uint8Array,xu("."),f?(u=e[2])!==null&&u!==void 0?u:e[2]=(function(b,x,S){try{return xu(b)}catch{throw new S("The ".concat(x," is not a valid base64url string"))}})(l,"payload",sr):l),v=MN(t.signature,"signature",sr),y=await U5(p,n,"verify");if(!await(async function(b,x,S,k){const T=await G5(b,x,"verify");try{return await crypto.subtle.verify(b.signing,T,S,k)}catch{return!1}})(p,y,v,g))throw new $5;return[f?MN(l,"payload",sr):l,r,f,y,d]}async function RG(t,e,n){if(t instanceof Uint8Array&&(t=sT.decode(t)),typeof t!="string")throw new sr("Compact JWS must be a string or Uint8Array");const i=t.split("."),r=i[0],o=i[1],l=i[2];if(i.length!==3)throw new sr("Invalid Compact JWS");const u={payload:o,protected:r,signature:l},d=CG(r),f=(function(b,x,S){const k=K5(b,H5(sr,F5,S[1],b,x)),T=x.alg;if(typeof T!="string"||!T)throw new sr('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(S[0]&&!S[0].has(T))throw new C5('"alg" (Algorithm) Header Parameter value not allowed');return[k,T]})(d,d,e),p=lr(f,2),g=p[0],v=p[1],y=g?o:(function(b){try{return xu(b)}catch{throw new sr("JWS Compact Serialization payload must use only ASCII characters")}})(o);return OG(u,e,n,r,d,v,y)}const dm=t=>Math.floor(t.getTime()/1e3),$G={s:1,m:60,h:3600,d:86400,w:604800,y:31557600},AG=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,uh="check_failed";function t1(){throw new TypeError("Invalid time period format")}function lb(t){typeof t!="string"&&t1();const e=AG.exec(t);(!e||e[4]&&e[1])&&t1();const n=parseFloat(e[2]),i=Math.round(n*$G[e[3][0].toLowerCase()]);return Number.isFinite(i)||t1(),e[1]==="-"||e[4]==="ago"?-i:i}function Ah(t,e){if(!Number.isFinite(e))throw new TypeError("Invalid ".concat(t," input"));return e}function n1(t,e){if(typeof e!="string")throw new TypeError('"'.concat(t,'" claim must be a string'))}function i1(t,e){return typeof t=="number"?Ah(e,t):t instanceof Date?Ah(e,dm(t)):dm(new Date)+lb(t)}const FN=t=>{const e=t.toLowerCase();return t.includes("/")?e:"application/".concat(e)};function r1(t,e){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const i=t[e];if(i!==void 0||n){if(typeof i!="number")throw new pu('"'.concat(e,'" claim must be a number'),t,e,"invalid");return i}}function s1(t,e){throw new pu('unexpected "'.concat(e,'" claim value'),t,e,uh)}function jG(t,e){let n,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};try{n=JSON.parse(OC.decode(e))}catch{}if(!lc(n))throw new lo("JWT Claims Set must be a top-level JSON object");const r=i.typ;
14if(r!==void 0&&(typeof t.typ!="string"||FN(t.typ)!==FN(r)))throw new pu('unexpected "typ" JWT header value',n,"typ",uh);const o=i.requiredClaims,l=o===void 0?[]:o,u=i.issuer,d=i.subject,f=i.audience,p=i.maxTokenAge,g=[...l];p!==void 0&&g.push("iat"),f!==void 0&&g.push("aud"),d!==void 0&&g.push("sub"),u!==void 0&&g.push("iss");for(const $ of new Set(g.reverse()))if(!Object.hasOwn(n,$))throw new pu('missing required "'.concat($,'" claim'),n,$,"missing");var v,y;u===void 0||(Array.isArray(u)?u:[u]).includes(n.iss)||s1(n,"iss"),d!==void 0&&n.sub!==d&&s1(n,"sub"),f===void 0||(v=n.aud,y=typeof f=="string"?[f]:f,typeof v=="string"?y.includes(v):Array.isArray(v)&&y.some($=>v.includes($)))||s1(n,"aud");const b=i.clockTolerance;let x=0;if(typeof b=="string")x=lb(b);else if(b!==void 0){if(typeof b!="number")throw new TypeError("Invalid clockTolerance option type");x=b}Ah("clockTolerance option",x);const S=i.currentDate,k=Ah("currentDate option",dm(S===void 0?new Date:S)),T=r1(n,"iat",p!==void 0),C=r1(n,"nbf");if(C!==void 0&&C>k+x)throw new pu('"nbf" claim timestamp check failed',n,"nbf",uh);const A=r1(n,"exp");if(A!==void 0&&A<=k-x)throw new oT('"exp" claim timestamp check failed',n,"exp",uh);if(p!==void 0){const $=k-T;if($-x>Ah("maxTokenAge option",typeof p=="number"?p:lb(p)))throw new oT('"iat" claim timestamp check failed (too far in the past)',n,"iat",uh);if($<-x)throw new pu('"iat" claim timestamp check failed (it should be in the past)',n,"iat",uh)}return n}let dT;function Dl(t){return dT.get(t)}async function PG(t,e,n){const i=await RG(t,(function(o){return[o&&wG("algorithms",o.algorithms),o?.crit]})(n),e);if(!i[2])throw new lo("JWTs MUST NOT use unencoded payload");const r={payload:jG(i[1],i[0],n),protectedHeader:i[1]};return typeof e=="function"?Ee(Ee({},r),{},{key:i[3]}):r}function NG(t){if(t===void 0)return[void 0,""];const e=(function(n,i){let r,o;try{r=JSON.stringify(i),o=JSON.parse(r)}catch(l){throw new n("JOSE Header is not valid JSON",{cause:l})}if(!lc(o))throw new n("JOSE Header is not a JSON object");return[o,r]})(sr,t);return[e[0],AC(e[1])]}function MG(t,e,n){return(function(i,r){const o=(r??{}).crit;if(Array.isArray(o)&&new Set(o).size!==o.length)throw new i('"crit" (Critical) Header Parameter MUST NOT contain duplicate values')})(sr,t),K5(t,H5(sr,F5,n,t,e))}async function IG(t,e,n,i){const r=T5(xu(t),xu("."),e),o=await U5(n,i,"sign");return AC(await(async function(l,u,d){const f=await G5(l,u,"sign"),p=await crypto.subtle.sign(l.signing,f,d);return new Uint8Array(p)})(n,o,r))}async function zG(t,e,n,i,r){const o=lr(NG(e),2),l=o[0],u=o[1];if(!l)throw new sr("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");MG(l,l,n)||r();const d=(function(g){const v=g.alg;if(typeof v!="string"||!v)throw new sr('JWS "alg" (Algorithm) Header Parameter missing or invalid');return J5(v)})(l),f=AC(t),p=await IG(u,xu(f),d,i);return"".concat(u,".").concat(f,".").concat(p)}const DG=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!lc(e))throw new TypeError("JWT Claims Set MUST be an object");(dT||(dT=new WeakMap)).set(this,structuredClone(e))}setIssuer(e){return n1("iss",e),Dl(this).iss=e,this}setSubject(e){return n1("sub",e),Dl(this).sub=e,this}setAudience(e){return(function(n){if(typeof n!="string"&&(!Array.isArray(n)||Array.from(n).some(i=>typeof i!="string")))throw new TypeError('"aud" claim must be a string or an array of strings')})(e),Dl(this).aud=e,this}setJti(e){return n1("jti",e),Dl(this).jti=e,this}setNotBefore(e){return Dl(this).nbf=i1(e,"setNotBefore"),this}setExpirationTime(e){return Dl(this).exp=i1(e,"setExpirationTime"),this}setIssuedAt(e){const n=Dl(this);return n.iat=e===void 0?dm(new Date):typeof e=="string"?Ah("setIssuedAt",dm(new Date)+lb(e)):i1(e,"setIssuedAt"),this}};var Xy=new WeakMap;let X5=class extends DG{constructor(){super(...arguments),ct(this,Xy,void 0)}setProtectedHeader(e){return(function(n,i){if(n!==void 0)throw new TypeError("".concat(i," can only be called once"))})(J(Xy,this),"setProtectedHeader"),ft(Xy,this,e),this}
14async sign(e,n){return zG((function(i){const r=Dl(i);for(const o of["iat","nbf","exp"]){const l=r[o];if(typeof l=="number"&&!Number.isFinite(l))throw new TypeError('"'.concat(o,'" claim must be a finite number'))}return E5.encode(JSON.stringify(r))})(this),J(Xy,this),n?.crit,e,()=>{throw new lo("JWTs MUST NOT use unencoded payload")})}};const HN='"alg" (Algorithm)';function KN(){throw new Za("Invalid or unsupported ".concat(arguments.length>0&&arguments[0]!==void 0?arguments[0]:'JWK "alg" (Algorithm) Parameter'," value"))}const bp=(t,e)=>{if(t.byteLength!==e.length)return!1;for(let n=0;n<t.byteLength;n++)if(t[n]!==e[n])return!1;return!0},hT=t=>{const e=t.data[t.pos++];if(e===void 0)throw new Error("Unexpected end of ASN.1 input");return e},$g=t=>{const e=hT(t);if(128&e){const n=127&e;let i=0;for(let r=0;r<n;r++)i=i<<8|hT(t);return i}return e},Ag=(t,e,n)=>{if(hT(t)!==e)throw new Error(n)},ZN=(t,e)=>{if(e<0||t.pos+e>t.data.length)throw new Error("Unexpected end of ASN.1 input");const n=t.data.subarray(t.pos,t.pos+e);return t.pos+=e,n},LG=t=>{const e=(r=>{Ag(r,6,"Expected algorithm OID");const o=$g(r);return ZN(r,o)})(t);if(bp(e,[43,101,110]))return"X25519";if(!bp(e,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");Ag(t,6,"Expected curve OID");const n=$g(t),i=ZN(t,n);if(bp(i,[42,134,72,206,61,3,1,7]))return"P-256";if(bp(i,[43,129,4,0,34]))return"P-384";if(bp(i,[43,129,4,0,35]))return"P-521";throw new Error("Unsupported named curve")},UG=async(t,e,n,i)=>{const r=(function(u,d){var f,p;return(f=typeof u=="string"?(p=PC[u])!==null&&p!==void 0?p:_G[u]:void 0)!==null&&f!==void 0?f:KN(d)})(n,HN);r.secret&&KN(HN);const o=t==="spki";let l;if(r.resolve)try{const u={data:e,pos:0};(function(d,f){if(Ag(d,48,"Invalid ".concat(f==="spki"?"SPKI":"PKCS#8"," structure")),$g(d),f==="pkcs8"){Ag(d,2,"Expected version field");const p=$g(d);d.pos+=p}Ag(d,48,"Expected algorithm identifier"),$g(d)})(u,t),l=r.resolve({crv:LG(u)})}catch{throw new Za("Invalid or unsupported key format")}else l=r.subtle;return crypto.subtle.importKey(t,e,l,o,r.usages[1])},FG=(t,e,n)=>{const i=((r,o)=>j5(r.replace(o,"")))(t,/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g);return UG("pkcs8",i,e)};async function WN(t,e,n){const i=t.get(e)||t.set(e,{}).get(e),r=n.alg;if(i[r]===void 0){const o=await N5(n,Ee(Ee({},e),{},{alg:r,ext:!0}));if(o.type!=="public")throw new RC("JSON Web Key Set members must be public keys");i[r]=o}return i[r]}function qN(t){let e;try{e=structuredClone(t)}catch{}if(!P5(e))throw new RC("JSON Web Key Set malformed");const n=new WeakMap;return Object.defineProperty(async(i,r)=>{const o=Ee(Ee({},i),r?.header),l=o.alg,u=o.kid,d=typeof l=="string"?PC[l]:void 0;if(!d||d.secret)throw new Za('Unsupported "alg" value for a JSON Web Key Set');const f=e.keys.filter(v=>(function(y,b,x,S){const k=M5(y),T=k.kty,C=k.key_ops,A=k.ext,$=k.kid,N=k.alg,j=k.use,O=k.crv,L=Array.isArray(C)?[...C]:C;return(A===void 0||typeof A=="boolean")&&(L===void 0||Array.isArray(L)&&L.every((B,V)=>typeof B=="string"&&L.indexOf(B)===V)&&L.includes("verify"))&&b.kty.includes(T)&&(S===void 0||typeof S=="string"&&S===$)&&(N===void 0?T!=="AKP":x===N)&&(j===void 0||j==="sig")&&(!b.crv||O===b.crv)})(v,d,l,u)),p=f[0],g=f.length;if(!g)throw new $C;if(g!==1){const v=new O5;throw v[Symbol.asyncIterator]=NL(function*(){for(const y of f)try{yield yield UV(WN(n,y,d))}catch{}}),v}return WN(n,p,d)},"jwks",{value:()=>structuredClone(e)})}var Yy,o1;let fT;(typeof navigator>"u"||(Yy=navigator.userAgent)===null||Yy===void 0||(o1=Yy.startsWith)===null||o1===void 0||!o1.call(Yy,"Mozilla/5.0 "))&&(fT="".concat("jose","/").concat("v6.2.10"));const Y5=Symbol(),Q5=Symbol();function wp(t,e){return Number.isFinite(t)&&Date.now()<t+e}function VN(t,e,n){if(Number.isNaN(t))throw new TypeError('"'.concat(n,'" option must not be NaN'));return typeof t=="number"?t:e}function HG(t,e){if(!(t instanceof URL))throw new TypeError("url must be an instance of URL");const n=new URL(t.href).href,i=e??{},r=i.timeoutDuration;if(typeof r=="number"&&(!Number.isInteger(r)||r<0))throw new TypeError('"timeoutDuration" option must be a non-negative integer');const o=typeof r=="number"?r:5e3,l=VN(i.cooldownDuration,3e4,"cooldownDuration"),u=VN(i.cacheMaxAge,6e5,"cacheMaxAge"),d=new Headers(i.headers);fT&&!d.has("User-Agent")&&d.set("User-Agent",fT),d.has("accept")||d.set("accept","application/json, application/jwk-set+json");const f=i[Y5],p=i[Q5];let g,v,y,b=0,x=0;if(p&&typeof p=="object"){const k=p.uat,T=p.jwks;wp(k,u)&&P5(T)&&(g=k,y=qN(T))}const S=async()=>
14{if(v&&(typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel")&&(v=void 0),!v){const k=++b,T=v=(async function(C,A,$){const j=await(arguments.length>3&&arguments[3]!==void 0?arguments[3]:fetch)(C,{method:"GET",signal:$,redirect:"manual",headers:A}).catch(O=>{throw O.name==="TimeoutError"?new R5:O});if(j.status!==200)throw new Gi("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await j.json()}catch{throw new Gi("Failed to parse the JSON Web Key Set HTTP response as JSON")}})(n,d,AbortSignal.timeout(o),f).then(C=>{const A=qN(C);if(k<=x)return;y=A;const $=Date.now();p&&(p.uat=$,p.jwks=C),g=$,x=k}).finally(()=>{v===T&&(v=void 0)})}await v};return Object.defineProperties(async(k,T)=>{y&&wp(g,u)||await S();try{return await y(k,T)}catch(C){if(C instanceof $C&&!wp(g,l))return await S(),y(k,T);throw C}},{coolingDown:{get:()=>wp(g,l),enumerable:!0},fresh:{get:()=>wp(g,u),enumerable:!0},reload:{value:S,enumerable:!0},reloading:{get:()=>!!v,enumerable:!0},jwks:{value:()=>{var k;return(k=y)===null||k===void 0?void 0:k.jwks()},enumerable:!0}})}async function NC(t,e,n){if(typeof t!="string"||t.indexOf("-----BEGIN PRIVATE KEY-----")!==0)throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return FG(t,e)}const KG=["mfaToken"],ZG=["mfaToken"];var Hc,Qy,xp,r_,s_,Dd,Sp,Ld,kp,Ep,Tp,o_,a_,e0,Ud,jg,Pg,Su,l_,c_,Ng,Cp,Hl,u_,Op,d_,h_,t0,f_,ug,au,p_,g_,m_,v_,dg,hg,Rs,n0,i0,cb,ub,hm,vh,et,Ut,Oa,Rp,Mg,jh,r0,Ue;function Ym(t){if(typeof t!="object"||t===null)return{};const e=t;return{statusCode:typeof e.statusCode=="number"?e.statusCode:void 0,headers:e.headers instanceof Headers?e.headers:void 0,body:typeof e.body=="string"?e.body:void 0}}function di(t){var e,n;if(typeof t!="object"||t===null)return{error:"unknown_error",error_description:String(t)};const i=t;let r;if(i.response instanceof Response)try{r=new Headers(i.response.headers),r.delete("set-cookie")}catch{r=void 0}const o={error:(e=i.error)!==null&&e!==void 0?e:"",error_description:(n=i.error_description)!==null&&n!==void 0?n:"",message:i.message,statusCode:typeof i.status=="number"?i.status:void 0,headers:r};if(i.error==="mfa_required"&&i.cause){o.mfa_token=typeof i.cause.mfa_token=="string"?i.cause.mfa_token:void 0;const l=i.cause.mfa_requirements;typeof l=="object"&&l!==null&&(o.mfa_requirements=l)}return o}var BN=class extends Error{constructor(e,n){super(n),_e(this,"code",void 0),this.name="NotSupportedError",this.code=e}},Ws=class extends Error{constructor(e,n,i){super(n),_e(this,"cause",void 0),_e(this,"code",void 0),_e(this,"statusCode",void 0),_e(this,"headers",void 0),_e(this,"body",void 0),this.code=e,this.cause=i&&{error:i.error,error_description:i.error_description,message:i.message,mfa_token:i.mfa_token,mfa_requirements:i.mfa_requirements};const r=Ym(i);this.statusCode=r.statusCode,this.headers=r.headers,this.body=r.body}},s0=class extends Ws{constructor(e,n){super("token_by_code_error",e,n),this.name="TokenByCodeError"}},GN=class extends Ws{constructor(e,n){super("token_by_client_credentials_error",e,n),this.name="TokenByClientCredentialsError"}},JN=class extends Ws{constructor(e,n){super("token_by_refresh_token_error",e,n),this.name="TokenByRefreshTokenError"}},XN=class extends Ws{constructor(e,n){super("token_by_password_error",e,n),this.name="TokenByPasswordError"}},a1=class extends Ws{constructor(e,n){super("token_for_connection_error",e,n),this.name="TokenForConnectionErrorCode"}},ls=class extends Ws{constructor(e,n){super("token_exchange_error",e,n),this.name="TokenExchangeError"}},WG=class extends Ws{constructor(e,n){super("token_revocation_error",e,n),this.name="TokenRevocationError"}},qG=class extends Ws{constructor(e,n){super("user_info_error",e,n),this.name="UserInfoError"}},jl=class extends Error{constructor(e){super(e),_e(this,"code","verify_logout_token_error"),this.name="VerifyLogoutTokenError"}},o0=class extends Ws{constructor(e){super("backchannel_authentication_error","There was an error when trying to use Client-Initiated Backchannel Authentication.",e),_e(this,"code","backchannel_authentication_error"),this.name="BackchannelAuthenticationError"}},VG=class extends Ws{constructor(e){super("build_authorization_url_error","There was an error when trying to build the authorization URL.",e),this.name="BuildAuthorizationUrlError"}},BG=class extends Ws{constructor(e){super("build_link_user_url_error","There was an error when trying to build the Link User URL.",e),this.name="BuildLinkUserUrlError"}},GG=class extends Ws{constructor(e){super("build_unlink_user_url_error","There was an error when trying to build the Unlink User URL.",e),this.name="BuildUnlinkUserUrlError"}}
14,e4=class extends Error{constructor(){super("The client secret or client assertion signing key must be provided."),_e(this,"code","missing_client_auth_error"),this.name="MissingClientAuthError"}},fg=class extends Error{constructor(e){super(e),_e(this,"code","organization_validation_error"),this.name="OrganizationValidationError"}},In=class extends Error{constructor(e){super(e||"fullResponse: true requested but no HTTP Response was captured. This is a bug in CapturingFetch."),_e(this,"code","missing_captured_response_error"),this.name="MissingCapturedResponseError"}};function on(t){try{const e=new Headers(t);return e.delete("set-cookie"),e}catch{return new Headers}}function Ph(t,e,n){var i;const r=typeof e=="object"&&e!==null?e:void 0,o=(i=r?.response)!==null&&i!==void 0?i:n,l=typeof r?.status=="number"?r.status:o?.status;typeof l=="number"&&(t.statusCode=l),o!=null&&o.headers&&(t.headers=on(o.headers))}function pT(t){return Object.entries(t).filter(e=>lr(e,2)[1]!==void 0).reduce((e,n)=>Ee(Ee({},e),{},{[n[0]]:n[1]}),{})}function MC(t){if(!t.trim())throw new fg("organization must not be blank")}function fm(t,e){if(!t)return;const n=e.trim();if(n.startsWith("org_")){const i=t.org_id;if(typeof i!="string")throw new fg("Organization Id (org_id) claim must be a string present in the ID token");if(i!==n)throw new fg('Organization Id (org_id) claim value mismatch in the ID token; expected "'.concat(n,'", found "').concat(i,'"'))}else{const i=t.org_name;if(typeof i!="string")throw new fg("Organization Name (org_name) claim must be a string present in the ID token");if(i.toLowerCase()!==n.toLowerCase())throw new fg('Organization Name (org_name) claim value mismatch in the ID token; expected "'.concat(n,'", found "').concat(i,'"'))}}var Qm=class extends Error{constructor(e,n,i){super(n),_e(this,"cause",void 0),_e(this,"code",void 0),_e(this,"statusCode",void 0),_e(this,"headers",void 0),_e(this,"body",void 0),this.code=e,this.cause=i&&{error:i.error,error_description:i.error_description,message:i.message};const r=Ym(i);this.statusCode=r.statusCode,this.headers=r.headers,this.body=r.body}},gT=class extends Qm{constructor(e,n){super("mfa_list_authenticators_error",e,n),this.name="MfaListAuthenticatorsError"}},mT=class extends Qm{constructor(e,n){super("mfa_enrollment_error",e,n),this.name="MfaEnrollmentError"}},YN=class extends Qm{constructor(e,n){super("mfa_delete_authenticator_error",e,n),this.name="MfaDeleteAuthenticatorError"}},vT=class extends Qm{constructor(e,n){super("mfa_challenge_error",e,n),this.name="MfaChallengeError"}},a0=class extends Qm{constructor(e,n){super("mfa_verify_error",e,n),this.name="MfaVerifyError"}};function JG(t){return{id:t.id,authenticatorType:t.authenticator_type,active:t.active,name:t.name,oobChannels:t.oob_channels,type:t.type}}var Sn=class t4{constructor(e,n,i,r,o,l,u){_e(this,"accessToken",void 0),_e(this,"idToken",void 0),_e(this,"refreshToken",void 0),_e(this,"expiresAt",void 0),_e(this,"scope",void 0),_e(this,"claims",void 0),_e(this,"authorizationDetails",void 0),_e(this,"tokenType",void 0),_e(this,"issuedTokenType",void 0),_e(this,"recoveryCode",void 0),_e(this,"act",void 0),this.accessToken=e,this.idToken=i,this.refreshToken=r,this.expiresAt=n,this.scope=o,this.claims=l,this.authorizationDetails=u}static fromTokenEndpointResponse(e){const n=e.id_token?e.claims():void 0,i=new t4(e.access_token,Math.floor(Date.now()/1e3)+Number(e.expires_in),e.id_token,e.refresh_token,e.scope,n,e.authorization_details);return i.tokenType=e.token_type,i.issuedTokenType=e.issued_token_type,i}};function n4(t,e){if(e.enabled===!1)return t;const n={name:e.name,version:e.version},i=btoa(JSON.stringify(n));return async(r,o)=>{const l=r instanceof Request?new Headers(r.headers):new Headers;return o!=null&&o.headers&&new Headers(o.headers).forEach((u,d)=>{l.set(d,u)}),l.set("Auth0-Client",i),t(r,Ee(Ee({},o),{},{headers:l}))}}function ev(t){var e,n;return t?.enabled===!1?t:{enabled:!0,name:(e=t?.name)!==null&&e!==void 0?e:"@auth0/auth0-auth-js",version:(n=t?.version)!==null&&n!==void 0?n:"1.15.0"}}function Nn(t){let e;const n=async(i,r)=>{const o=await t(i,r);return e=o.clone(),o};return n.getCapturedResponse=()=>e,n}function tv(t,e,n){if(!e)return t;const i=e.signal,r=e.headers,o=e.customFetch,l=o?n4(o,n):t;return i||r?async(u,d)=>{const f=r?new Headers(u instanceof Request?u.headers:void 0):void 0;
14if(f&&d!=null&&d.headers&&new Headers(d.headers).forEach((y,b)=>f.set(b,y)),r)for(const y of Object.entries(r)){var p=lr(y,2);const b=p[0],x=p[1],S=b.toLowerCase();S!=="authorization"&&S!=="auth0-client"&&f.set(b,x)}const g=(function(y,b){if(!y)return{signal:b??void 0};if(!b)return{signal:y};if(typeof AbortSignal<"u"&&typeof AbortSignal.any=="function")return{signal:AbortSignal.any([y,b])};const x=new AbortController,S=[y,b],k=S.find(A=>A.aborted);if(k)return x.abort(k.reason),{signal:x.signal};const T=[],C=()=>{S.forEach((A,$)=>{const N=T[$];N&&A.removeEventListener("abort",N)})};return S.forEach((A,$)=>{const N=()=>{C(),x.abort(A.reason)};T[$]=N,A.addEventListener("abort",N,{once:!0})}),{signal:x.signal,cleanup:C}})(i,d?.signal);try{return await l(u,Ee(Ee(Ee({},d),f&&{headers:f}),{},{signal:g.signal}))}finally{var v;(v=g.cleanup)===null||v===void 0||v.call(g)}}:l}var QN={otp:"http://auth0.com/oauth/grant-type/mfa-otp",oob:"http://auth0.com/oauth/grant-type/mfa-oob","recovery-code":"http://auth0.com/oauth/grant-type/mfa-rec
14overy-code"},XG=(Hc=new WeakMap,Qy=new WeakMap,xp=new WeakMap,r_=new WeakMap,s_=new WeakMap,Dd=new WeakMap,Sp=new WeakMap,Ld=new WeakSet,class{constructor(t){var e,n;cf(this,Ld),ct(this,Hc,void 0),ct(this,Qy,void 0),ct(this,xp,void 0),ct(this,r_,void 0),ct(this,s_,void 0),ct(this,Dd,void 0),ct(this,Sp,void 0),ft(Hc,this,"https://".concat(t.domain)),ft(Qy,this,t.clientId),ft(xp,this,t.clientSecret),ft(r_,this,(e=t.customFetch)!==null&&e!==void 0?e:function(){return fetch(...arguments)}),ft(s_,this,(n=t.telemetryConfig)!==null&&n!==void 0?n:ev()),ft(Dd,this,t.getConfiguration),ft(Sp,this,t.createCaptureConfiguration)}async listAuthenticators(t,e){const n="".concat(J(Hc,this),"/mfa/authenticators"),i=t.mfaToken,r=await Ne(Ld,this,l0).call(this,e)(n,{method:"GET",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"}});if(!r.ok){const o=await r.clone().text(),l=r.status,u=on(r.headers);let d;try{d=JSON.parse(o)}catch{throw new gT("Failed to list authenticators",{error:"unknown_error",error_description:"Failed to list authenticators",statusCode:l,headers:u,body:o})}throw new gT(d.error_description||"Failed to list authenticators",Ee(Ee({},d),{},{statusCode:l,headers:u,body:o}))}return(await r.json()).map(JG)}async enrollAuthenticator(t,e){const n="".concat(J(Hc,this),"/mfa/associate"),i=t.mfaToken,r=pN(t,KG),o={authenticator_types:r.authenticatorTypes};"oobChannels"in r&&(o.oob_channels=r.oobChannels),"phoneNumber"in r&&r.phoneNumber&&(o.phone_number=r.phoneNumber),"email"in r&&r.email&&(o.email=r.email);const l=await Ne(Ld,this,l0).call(this,e)(n,{method:"POST",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!l.ok){const u=await l.clone().text(),d=l.status,f=on(l.headers);let p;try{p=JSON.parse(u)}catch{throw new mT("Failed to enroll authenticator",{error:"unknown_error",error_description:"Failed to enroll authenticator",statusCode:d,headers:f,body:u})}throw new mT(p.error_description||"Failed to enroll authenticator",Ee(Ee({},p),{},{statusCode:d,headers:f,body:u}))}return(function(u){if(u.authenticator_type==="otp")return{authenticatorType:"otp",secret:u.secret,barcodeUri:u.barcode_uri,recoveryCodes:u.recovery_codes,id:u.id};if(u.authenticator_type==="oob")return{authenticatorType:"oob",oobChannel:u.oob_channel,oobCode:u.oob_code,bindingMethod:u.binding_method,id:u.id,barcodeUri:u.barcode_uri,recoveryCodes:u.recovery_codes};throw new Error("Unexpected authenticator type: ".concat(u.authenticator_type))})(await l.json())}async deleteAuthenticator(t,e){const n=t.authenticatorId,i=t.mfaToken,r="".concat(J(Hc,this),"/mfa/authenticators/").concat(encodeURIComponent(n)),o=await Ne(Ld,this,l0).call(this,e)(r,{method:"DELETE",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"}});if(!o.ok){const l=await o.clone().text(),u=o.status,d=on(o.headers);let f;try{f=JSON.parse(l)}catch{throw new YN("Failed to delete authenticator",{error:"unknown_error",error_description:"Failed to delete authenticator",statusCode:u,headers:d,body:l})}throw new YN(f.error_description||"Failed to delete authenticator",Ee(Ee({},f),{},{statusCode:u,headers:d,body:l}))}}async challengeAuthenticator(t,e){const n="".concat(J(Hc,this),"/mfa/challenge"),i=t.mfaToken,r=pN(t,ZG),o={mfa_token:i,client_id:J(Qy,this),challenge_type:r.challengeType};J(xp,this)&&(o.client_secret=J(xp,this)),r.authenticatorId&&(o.authenticator_id=r.authenticatorId);const l=await Ne(Ld,this,l0).call(this,e)(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(!l.ok){const u=await l.clone().text(),d=l.status,f=on(l.headers);let p;try{p=JSON.parse(u)}catch{throw new vT("Failed to challenge authenticator",{error:"unknown_error",error_description:"Failed to challenge authenticator",statusCode:d,headers:f,body:u})}throw new vT(p.error_description||"Failed to challenge authenticator",Ee(Ee({},p),{},{statusCode:d,headers:f,body:u}))}return(function(u){const d={challengeType:u.challenge_type};return u.oob_code!==void 0&&(d.oobCode=u.oob_code),u.binding_method!==void 0&&(d.bindingMethod=u.binding_method),d})(await l.json())}async verify(t,e){if(!J(Dd,this))throw new Error("MFA verify requires a configuration provider (getConfiguration was not set)");const n={mfa_token:t.mfaToken};
14if(t.audience&&(n.audience=t.audience),t.factorType==="otp"?n.otp=t.otp:t.factorType==="oob"?(n.oob_code=t.oobCode,t.bindingCode&&(n.binding_code=t.bindingCode)):t.factorType==="recovery-code"&&(n.recovery_code=t.recoveryCode),t.fullResponse){var i;if(!J(Sp,this))throw new Error("MFA verify fullResponse requires a capture-config factory (createCaptureConfiguration was not set)");const g=Nn((i=(await J(Dd,this).call(this,e))[Mt])!==null&&i!==void 0?i:fetch),v=await J(Sp,this).call(this,g);try{const y=await ir(v,QN[t.factorType],n),b=Sn.fromTokenEndpointResponse(y);y.recovery_code&&(b.recoveryCode=y.recovery_code);const x=g.getCapturedResponse();if(!x)throw new In;return{data:b,response:x}}catch(y){var r,o,l;if(y instanceof In||y instanceof a0)throw y;const b=y,x=new a0(b.error_description||b.message||"Failed to verify MFA challenge",{error:(r=b.error)!==null&&r!==void 0?r:"mfa_verify_error",error_description:(o=(l=b.error_description)!==null&&l!==void 0?l:b.message)!==null&&o!==void 0?o:"Failed to verify MFA challenge"});throw Ph(x,y,g.getCapturedResponse()),x}}const u=await J(Dd,this).call(this,e);try{const g=await ir(u,QN[t.factorType],n),v=Sn.fromTokenEndpointResponse(g);return g.recovery_code&&(v.recoveryCode=g.recovery_code),v}catch(g){var d,f,p;if(g instanceof a0)throw g;const v=g,y=new a0(v.error_description||v.message||"Failed to verify MFA challenge",{error:(d=v.error)!==null&&d!==void 0?d:"mfa_verify_error",error_description:(f=(p=v.error_description)!==null&&p!==void 0?p:v.message)!==null&&f!==void 0?f:"Failed to verify MFA challenge"});throw Ph(y,g),y}}});function l0(t){return tv(J(r_,this),t,J(s_,this))}var IC=class extends Error{constructor(e,n,i){super(n),_e(this,"cause",void 0),_e(this,"code",void 0),_e(this,"statusCode",void 0),_e(this,"headers",void 0),_e(this,"body",void 0),this.code=e,this.cause=i&&{error:i.error,error_description:i.error_description,message:i.message};const r=Ym(i);this.statusCode=r.statusCode,this.headers=r.headers,this.body=r.body}},YG=class extends IC{constructor(e,n){super("passkey_register_error",e,n),this.name="PasskeyRegisterError"}},QG=class extends IC{constructor(e,n){super("passkey_challenge_error",e,n),this.name="PasskeyChallengeError"}},eJ=class extends IC{constructor(e,n){super("passkey_get_token_error",e,n),this.name="PasskeyGetTokenError",this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message,mfa_token:n.mfa_token,mfa_requirements:n.mfa_requirements}}};function eM(t){return t.useMtls?{}:t.clientSecret?{client_secret:t.clientSecret}:{}}var i4="urn:okta:params:oauth:grant-type:webauthn",tJ=(kp=new WeakMap,Ep=new WeakMap,Tp=new WeakMap,o_=new WeakMap,a_=new WeakMap,e0=new WeakMap,Ud=new WeakSet,class{constructor(t){var e,n;cf(this,Ud),ct(this,kp,void 0),ct(this,Ep,void 0),ct(this,Tp,void 0),ct(this,o_,void 0),ct(this,a_,void 0),ct(this,e0,void 0),ft(kp,this,"https://".concat(t.domain)),ft(Ep,this,t.clientId),ft(Tp,this,{clientSecret:t.clientSecret,useMtls:t.useMtls}),ft(o_,this,(e=t.customFetch)!==null&&e!==void 0?e:function(){return fetch(...arguments)}),ft(a_,this,(n=t.telemetryConfig)!==null&&n!==void 0?n:ev()),ft(e0,this,t.grantRequest)}async register(t,e){const n="".concat(J(kp,this),"/passkey/register"),i=Ee(Ee(Ee(Ee(Ee(Ee(Ee(Ee({},t.email&&{email:t.email}),t.name&&{name:t.name}),t.phoneNumber&&{phone_number:t.phoneNumber}),t.username&&{username:t.username}),t.givenName&&{given_name:t.givenName}),t.familyName&&{family_name:t.familyName}),t.nickname&&{nickname:t.nickname}),t.picture&&{picture:t.picture}),r=Ee(Ee({client_id:J(Ep,this)},eM(J(Tp,this))),{},{user_profile:i});t.realm&&(r.realm=t.realm),t.organization&&(r.organization=t.organization),t.userMetadata&&(r.user_metadata=t.userMetadata);const o=await Ne(Ud,this,tM).call(this,e)(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!o.ok){const d=await Ne(Ud,this,nM).call(this,o),f=new YG(d.error_description||"Failed to request signup challenge",d);throw f.statusCode=o.status,f.headers=on(o.headers),f}return{authSession:(u=await o.json()).auth_session,authnParamsPublicKey:Ee({},u.authn_params_public_key)};var u}async challenge(t,e){const n="".concat(J(kp,this),"/passkey/challenge"),i=Ee({client_id:J(Ep,this)},eM(J(Tp,this)));t!=null&&t.realm&&(i.realm=t.realm),t!=null&&t.organization&&(i.organization=t.organization);const r=await Ne(Ud,this,tM).call(this,e)(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});
14if(!r.ok){const u=await Ne(Ud,this,nM).call(this,r),d=new QG(u.error_description||"Failed to request login challenge",u);throw d.statusCode=r.status,d.headers=on(r.headers),d}return{authSession:(l=await r.json()).auth_session,authnParamsPublicKey:Ee({},l.authn_params_public_key)};var l}async getTokenByPasskey(t,e){t.organization!==void 0&&MC(t.organization);const n=new URLSearchParams({auth_session:t.authSession,authn_response:JSON.stringify(t.credential)});let i;t.realm&&n.append("realm",t.realm),t.scope&&n.append("scope",t.scope),t.audience&&n.append("audience",t.audience),t.organization&&n.append("organization",t.organization);try{i=await J(e0,this).call(this,i4,n,e,t.fullResponse)}catch(o){if(o instanceof In)throw o;const l=di(o),u=new eJ(l.error_description||"Failed to exchange passkey credential for tokens.",l);throw Ph(u,o),u}if(t.fullResponse){const o=i;return t.organization&&fm(o.data.claims,t.organization),o}const r=i;return t.organization&&fm(r.claims,t.organization),r}});function tM(t){return tv(J(o_,this),t,J(a_,this))}async function nM(t){const e=await t.clone().text();try{return Ee(Ee({},JSON.parse(e)),{},{statusCode:t.status,headers:t.headers,body:e})}catch{return{error:"unknown_error",error_description:"HTTP ".concat(t.status," ").concat(t.statusText),statusCode:t.status,headers:t.headers,body:e}}}var xw=class extends Error{constructor(e,n,i){super(n),_e(this,"cause",void 0),_e(this,"code",void 0),_e(this,"statusCode",void 0),_e(this,"headers",void 0),_e(this,"body",void 0),Object.setPrototypeOf(this,new.target.prototype),this.code=e,this.cause=i&&(i.error||i.error_description)?{error:i.error,error_description:i.error_description,message:i.message,mfa_token:i.mfa_token,mfa_requirements:i.mfa_requirements}:void 0;const r=Ym(i);this.statusCode=r.statusCode,this.headers=r.headers,this.body=r.body}},yT=class extends xw{constructor(e,n){super("passwordless_start_error",e,n),this.name="PasswordlessStartError"}},_T=class extends xw{constructor(e,n){super("passwordless_verify_error",e,n),this.name="PasswordlessVerifyError"}},iM=class extends xw{constructor(e,n){super("passwordless_db_get_token_error",e,n),this.name="PasswordlessDbGetTokenError"}},y_=class extends xw{constructor(e,n,i,r,o){super("passwordless_challenge_error",e,i),_e(this,"statusCode",void 0),_e(this,"validationErrors",void 0),this.name="PasswordlessChallengeError",this.statusCode=n,this.validationErrors=r,this.headers=o??this.headers}};function bT(t){return/^\+[1-9]\d{1,14}$/.test(t)}async function r4(t,e,n){if(t.useMtls)return{};if(t.clientAssertionSigningKey){var i;const r=(i=t.clientAssertionSigningAlg)!==null&&i!==void 0?i:"RS256",o=t.clientAssertionSigningKey instanceof CryptoKey?t.clientAssertionSigningKey:await NC(t.clientAssertionSigningKey,r);return{client_assertion:await new X5({}).setProtectedHeader({alg:r}).setIssuer(e).setSubject(e).setAudience("https://".concat(n,"/")).setJti(crypto.randomUUID()).setIssuedAt().setExpirationTime("".concat(120,"s")).sign(o),client_assertion_type:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"}}if(t.clientSecret)return{client_secret:t.clientSecret};throw new e4}var nJ=(jg=new WeakMap,Pg=new WeakMap,Su=new WeakMap,l_=new WeakMap,c_=new WeakMap,Ng=new WeakMap,Cp=new WeakMap,Hl=new WeakSet,class{constructor(t){var e,n;cf(this,Hl),ct(this,jg,void 0),ct(this,Pg,void 0),ct(this,Su,void 0),ct(this,l_,void 0),ct(this,c_,void 0),ct(this,Ng,void 0),ct(this,Cp,void 0),ft(Pg,this,t.domain),ft(jg,this,"https://".concat(t.domain)),ft(Su,this,t.clientId),ft(l_,this,(e=t.customFetch)!==null&&e!==void 0?e:function(){return fetch(...arguments)}),ft(c_,this,(n=t.telemetryConfig)!==null&&n!==void 0?n:ev()),ft(Ng,this,{clientSecret:t.clientSecret,clientAssertionSigningKey:t.clientAssertionSigningKey,clientAssertionSigningAlg:t.clientAssertionSigningAlg,useMtls:t.useMtls}),ft(Cp,this,t.grantRequest)}async sendEmail(t,e){const n=await Ne(Hl,this,rM).call(this,(function(i){var r;const o=(r=i.send)!==null&&r!==void 0?r:"code",l={email:i.email,connection:"email",send:o};return o==="link"&&i.authParams&&(l.authParams=i.authParams),l})(t),"Failed to send passwordless email",t.language,e);if(t.fullResponse)return{data:void 0,response:n}}async sendSms(t,e){if(!bT(t.phoneNumber))throw new yT("Phone number must be in E.164 format (e.g. +14155550100).");const n=await Ne(Hl,this,rM).call(this,(function(i){return{phone_number:i.phoneNumber,connection:"sms"}})(t),"Failed to send passwordless SMS",t.language,e);if(t.fullResponse)return{data:void 0,response:n}}async challengeWithEmail(t,e){const n=(function(i){var r;return{email:i.email,connection:i.connection,allow_signup:(r=i.allowSignup)!==null&&r!==void 0&&r}})(t);
14return Ne(Hl,this,sM).call(this,n,"Failed to request email OTP challenge",e)}async challengeWithPhoneNumber(t,e){if(!bT(t.phoneNumber))throw new y_("Phone number must be in E.164 format (e.g. +14155550100).",0,void 0,void 0);const n=(function(i){var r;const o={phone_number:i.phoneNumber,connection:i.connection,allow_signup:(r=i.allowSignup)!==null&&r!==void 0&&r};return i.deliveryMethod&&(o.delivery_method=i.deliveryMethod),o})(t);return Ne(Hl,this,sM).call(this,n,"Failed to request phone OTP challenge",e)}async getTokenByPasswordlessDbConnection(t,e){const n=new URLSearchParams({auth_session:t.authSession,otp:t.otp});if(t.scope&&n.append("scope",t.scope),t.audience&&n.append("audience",t.audience),!J(Cp,this))throw new iM("Missing grant request delegate.",di(new Error("missing grantRequest")));try{return await J(Cp,this).call(this,"http://auth0.com/oauth/grant-type/passwordless/otp",n,e,t.fullResponse)}catch(i){if(i instanceof In)throw i;const r=new iM("There was an error while trying to request a token.",di(i)),o=i;throw r.statusCode=o._statusCode,r.headers=o._headers,r}}});function s4(t){return tv(J(l_,this),t,J(c_,this))}async function rM(t,e,n,i){var r;const o=await r4(J(Ng,this),J(Su,this),J(Pg,this)),l=Ee(Ee({client_id:J(Su,this)},t),o);let u;try{u=await Ne(Hl,this,s4).call(this,i)("".concat(J(jg,this),"/passwordless/start"),{method:"POST",headers:Ee({"Content-Type":"application/json"},n?{"x-request-language":n}:{}),body:JSON.stringify(l)})}catch{throw new yT("".concat(e,": a network error occurred."))}if(u.ok)return u;const d=await u.clone().text();let f;if(u.status!==204)try{f=JSON.parse(d)}catch{f=void 0}const p=new yT(((r=f)===null||r===void 0?void 0:r.error_description)||e,f);throw p.statusCode=u.status,p.headers=on(u.headers),p.body=d,p}async function sM(t,e,n){var i,r;const o=await r4(J(Ng,this),J(Su,this),J(Pg,this)),l=Ee(Ee({client_id:J(Su,this)},t),o);let u;try{u=await Ne(Hl,this,s4).call(this,n)("".concat(J(jg,this),"/otp/challenge"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)})}catch{throw new y_("challenge error: a network error occurred.",0,void 0,void 0)}if(u.ok){let g;try{g=await u.json()}catch{throw new y_("".concat(e,": could not parse the response body."),u.status,void 0,void 0,on(u.headers))}return{authSession:g.auth_session}}const d=await u.clone().text();let f;try{f=JSON.parse(d)}catch{f=void 0}const p=f?Ee(Ee({},f),{},{statusCode:u.status,headers:u.headers,body:d}):{error:"",error_description:"",statusCode:u.status,headers:u.headers,body:d};throw new y_(((i=f)===null||i===void 0?void 0:i.error_description)||e,u.status,p,(r=f)===null||r===void 0?void 0:r.validation_errors,on(u.headers))}var o4=class extends Error{constructor(e,n,i){super(n),_e(this,"cause",void 0),_e(this,"code",void 0),_e(this,"statusCode",void 0),_e(this,"headers",void 0),_e(this,"body",void 0),Object.setPrototypeOf(this,new.target.prototype),this.code=e,this.cause=i&&{error:i.error,error_description:i.error_description,message:i.message};const r=Ym(i);this.statusCode=r.statusCode,this.headers=r.headers,this.body=r.body}},oM=class extends o4{constructor(e,n){super("signup_error",e,n),this.name="SignUpError"}},l1=class extends o4{constructor(e,n){super("change_password_error",e,n),this.name="ChangePasswordError"}};function aM(t,e,n){for(const i of e)if(t[i]===null||t[i]===void 0||t[i]==="")throw new n('Required parameter "'.concat(String(i),'" was null, undefined, or empty.'))}function lM(t){var e,n;return{id:(e=(n=t._id)!==null&&n!==void 0?n:t.user_id)!==null&&e!==void 0?e:t.id,email:typeof t.email=="string"?t.email:"",emailVerified:!!t.email_verified,username:t.username,givenName:t.given_name,familyName:t.family_name,name:t.name,nickname:t.nickname,picture:t.picture,userMetadata:t.user_metadata}}var iJ=(u_=new WeakMap,Op=new WeakMap,d_=new WeakMap,h_=new WeakMap,t0=new WeakSet,class{constructor(t){var e,n;cf(this,t0),ct(this,u_,void 0),ct(this,Op,void 0),ct(this,d_,void 0),ct(this,h_,void 0),ft(u_,this,"https://".concat(t.domain)),ft(Op,this,t.clientId),ft(d_,this,(e=t.customFetch)!==null&&e!==void 0?e:function(){return fetch(...arguments)}),ft(h_,this,(n=t.telemetryConfig)!==null&&n!==void 0?n:ev())}async signUp(t,e){var n;aM(t,["email","password","connection"],oM);const i=Ee({client_id:(n=t.clientId)!==null&&n!==void 0?n:J(Op,this)},(function(o){const l={email:o.email,password:o.password,connection:o.connection};return o.username!==void 0&&(l.username=o.username),o.givenName!==void 0&&(l.given_name=o.givenName),o.familyName!==void 0&&(l.family_name=o.familyName),o.name!==void 0&&(l.name=o.name),o.nickname!==void 0&&(l.nickname=o.nickname),o.picture!==void 0&&(l.picture=o.picture),o.userMetadata!==void 0&&(l.user_metadata=o.userMetadata),l})(t)),r=await Ne(t0,this,cM).call(this,"/dbconnections/signup",i,oM,"Failed to sign up",e);if(t.fullResponse){const o=r.clone();return{data:lM(await r.json()),response:o}}return lM(await r.json())}async changePassword(t,e){var n;if(aM(t,["connection"],l1),!t.email&&!t.username)throw new l1('Either "email" or "username" is required.');const i=Ee({client_id:(n=t.clientId)!==null&&n!==void 0?n:J(Op,this)},(function(o){const l={connection:o.connection};return o.email!==void 0&&(l.email=o.email),o.username!==void 0&&(l.username=o.username),o.organization!==void 0&&(l.organization=o.organization),l})(t)),r=await Ne(t0,this,cM).call(this,"/dbconnections/change_password",i,l1,"Failed to request a password change",e);if(t.fullResponse){const o=r.clone();return{data:await r.text(),response:o}}return r.text()}});async function cM(t,e,n,i,r){const o=tv(J(d_,this),r,J(h_,this));let l;try{l=await o("".concat(J(u_,this)).concat(t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch{throw new n("".concat(i,": a network error occurred."))}if(l.ok)return l;const u=await l.clone().text(),d=await(async function(p){let g;
14try{g=await p.json()}catch{return}return typeof g.error=="string"?g:typeof g.code=="string"?{error:g.code,error_description:typeof g.description=="string"?g.description:""}:void 0})(l.clone()),f=new n(d?.error_description||i,d??{error:"unknown_error",error_description:i});throw f.statusCode=l.status,f.headers=on(l.headers),f.body=u,f}var gu=class extends Error{constructor(e,n,i){super(n),_e(this,"code",void 0),_e(this,"cause",void 0),this.name="AnonymousSessionError",this.code=e,this.cause=i&&{error:i.error,error_description:i.error_description,message:i.message}}},rJ=new Set(["session_expired","invalid_session_token"]);async function a4(t){const e="Request failed with status ".concat(t.status);let n={};try{n=await t.json()}catch{}return{error:typeof n.error=="string"?n.error:"server_error",error_description:typeof n.error_description=="string"?n.error_description:e}}var sJ=(f_=new WeakMap,ug=new WeakMap,au=new WeakMap,p_=new WeakMap,g_=new WeakMap,m_=new WeakMap,v_=new WeakMap,dg=new WeakMap,hg=new WeakSet,class{constructor(t){var e;cf(this,hg),ct(this,f_,void 0),ct(this,ug,void 0),ct(this,au,void 0),ct(this,p_,void 0),ct(this,g_,void 0),ct(this,m_,void 0),ct(this,v_,void 0),ct(this,dg,void 0),ft(f_,this,t.domain),ft(ug,this,"https://".concat(t.domain)),ft(au,this,t.clientId),ft(p_,this,t.clientSecret),ft(g_,this,t.clientAssertionSigningKey),ft(m_,this,t.clientAssertionSigningAlg),ft(v_,this,t.useMtls),ft(dg,this,(e=t.customFetch)!==null&&e!==void 0?e:function(){return fetch(...arguments)})}async createSession(t){const e={client_id:J(au,this)};t!=null&&t.audience&&(e.audience=t.audience),t!=null&&t.scope&&(e.scope=t.scope),t!=null&&t.metadata&&(e.metadata=t.metadata);const n=await Ne(hg,this,l4).call(this,e);if(!n.sessionToken)throw new gu("server_error","session_token missing from create session response");return{sessionToken:n.sessionToken,accessToken:n.accessToken,expiresAt:n.expiresAt,sessionTokenExpiresAt:n.sessionTokenExpiresAt,scope:n.scope}}async getAccessToken(t){if(t==null||!t.sessionToken)return this.createSession({audience:t?.audience,scope:t?.scope});try{return await Ne(hg,this,oJ).call(this,t.sessionToken,t)}catch(e){if(e instanceof gu&&rJ.has(e.code))return Ee(Ee({},await this.createSession({audience:t?.audience,scope:t?.scope})),{},{sessionReplaced:!0});throw e}}async logout(){const t="".concat(J(ug,this),"/anonymous/logout"),e={client_id:J(au,this)},n=await J(dg,this).call(this,t,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",redirect:"error",body:JSON.stringify(e)});if(!n.ok){const i=await a4(n);throw new gu(i.error,i.error_description||"Failed to end anonymous session",i)}}});async function oJ(t,e){const n={client_id:J(au,this),session_token:t};e!=null&&e.audience&&(n.audience=e.audience),e!=null&&e.scope&&(n.scope=e.scope);const i=await Ne(hg,this,l4).call(this,n);return{sessionToken:t,accessToken:i.accessToken,expiresAt:i.expiresAt,sessionTokenExpiresAt:i.sessionTokenExpiresAt,scope:i.scope,sessionReplaced:!1}}async function l4(t){const e="".concat(J(ug,this),"/anonymous/token"),n=await(async function(o,l,u){if(o.useMtls)return{};if(o.clientAssertionSigningKey){var d;const f=(d=o.clientAssertionSigningAlg)!==null&&d!==void 0?d:"RS256",p=o.clientAssertionSigningKey instanceof CryptoKey?o.clientAssertionSigningKey:await NC(o.clientAssertionSigningKey,f);return{client_assertion:await new X5({}).setProtectedHeader({alg:f}).setIssuer(l).setSubject(l).setAudience("https://".concat(u,"/")).setJti(crypto.randomUUID()).setIssuedAt().setExpirationTime("".concat(120,"s")).sign(p),client_assertion_type:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"}}return o.clientSecret?{client_secret:o.clientSecret}:{}})({clientSecret:J(p_,this),clientAssertionSigningKey:J(g_,this),clientAssertionSigningAlg:J(m_,this),useMtls:J(v_,this)},J(au,this),J(f_,this));Object.assign(t,n);const i=await J(dg,this).call(this,e,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",redirect:"error",body:JSON.stringify(t)});if(!i.ok){const o=await a4(i);throw new gu(o.error,o.error_description||"Anonymous token request failed",o)}let r;try{r=await i.json()}catch{throw new gu("server_error","Invalid response from anonymous token endpoint")}return(function(o){const l=Math.floor(Date.now()/1e3);if(typeof o.access_token!="string"||!o.access_token)throw new gu("server_error","access_token missing or invalid in anonymous token response");const u=o.expires_in;if(typeof u!="number"||!Number.isFinite(u))throw new gu("server_error","expires_in missing or invalid in anonymous token response");return{accessToken:o.access_token,expiresAt:l+u,scope:o.scope,sessionToken:o.session_token,sessionTokenExpiresAt:typeof o.session_expires_in=="number"&&Number.isFinite(o.session_expires_in)?l+o.session_expires_in:void 0}})(r)}var c4=(Rs=new WeakMap,n0=new WeakMap,i0=new WeakMap,class{constructor(t,e){ct(this,Rs,new Map),ct(this,n0,void 0),ct(this,i0,void 0),ft(i0,this,Math.max(1,Math.floor(t))),ft(n0,this,Math.max(0,Math.floor(e)))}get(t){const e=J(Rs,this).get(t);if(e){if(!(Date.now()>=e.expiresAt))return J(Rs,this).delete(t),J(Rs,this).set(t,e),e.value;J(Rs,this).delete(t)}}set(t,e,n){J(Rs,this).has(t)&&J(Rs,this).delete(t);const i=n!=null&&Number.isFinite(n)&&n>0?n:J(n0,this);for(J(Rs,this).set(t,{value:e,expiresAt:Date.now()+i});J(Rs,this).size>J(i0,this);){const r=J(Rs,this).keys().next().value;if(r===void 0)break;J(Rs,this).delete(r)}}}),uM=new Map;function dM(t){return{ttlMs:1e3*(typeof t?.ttl=="number"?t.ttl:600),maxEntries:typeof t?.maxEntries=="number"&&t.maxEntries>0?t.maxEntries:100}}var hM=class{static createDiscoveryCache(e){const n=(i=e.maxEntries,r=e.ttlMs,"".concat(i,":").concat(r));var i,r;let o=(l=n,uM.get(l));var l;return o||(o=new c4(e.maxEntries,e.ttlMs),uM.set(n,o)),o}static createJwksCache(){return{}}},wT="openid profile email offline_access",aJ=Object.freeze(new Set(["grant_type","client_id","client_secret","client_assertion","client_assertion_type","subject_token","subject_token_type","requested_token_type","actor_token","actor_token_type","audience","aud","resource","resources","resource_indicator","scope","connection","login_hint","organization","assertion"]));function u4(t){if(t==null)throw new ls("subject_token is required");if(typeof t!="string")throw new ls("subject_token must be a string");if(t.trim().length===0)throw new ls("subject_token cannot be blank or whitespace");if(t!==t.trim())throw new ls("subject_token must not include leading or trailing whitespace");if(/^bearer\s+/i.test(t))throw new ls("subject_token must not include the 'Bearer ' prefix")}function d4(t,e){if(e)for(const i of Object.entries(e)){var n=lr(i,2);const r=n[0],o=n[1];if(!aJ.has(r))if(Array.isArray(o)){if(o.length>20)throw new ls("Parameter '".concat(r,"' exceeds maximum array size of ").concat(20));o.forEach(l=>{t.append(r,l)})}else t.append(r,o)}}var fM="urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",pM="urn:ietf:params:oauth:grant-type:token-exchange",h4="urn:ietf:params:oauth:token-type:access_token";function gM(t,e){return(n,i)=>{const r=i?.body;if(e!==i4||!(r instanceof URLSearchParams))return t(n,i);const o={};for(const d of r){var l=lr(d,2);const f=l[0],p=l[1];o[f]=f==="authn_response"?JSON.parse(p):p}const u=new Headers(i?.headers);return u.set("Content-Type","application/json"),t(n,Ee(Ee({},i),{},{headers:u,body:JSON.stringify(o)}))}}var lJ=(cb=new WeakMap,ub=new WeakMap,hm=new WeakMap,vh=new WeakMap,et=new WeakMap,Ut=ne
vendor: 4,827 bytes, line 14
14w WeakMap,Oa=new WeakMap,Rp=new WeakMap,Mg=new WeakMap,jh=new WeakMap,r0=new WeakMap,Ue=new WeakSet,class{constructor(t){var e;if(cf(this,Ue),ct(this,cb,void 0),ct(this,ub,void 0),ct(this,hm,void 0),ct(this,vh,void 0),ct(this,et,void 0),ct(this,Ut,void 0),ct(this,Oa,void 0),ct(this,Rp,void 0),ct(this,Mg,void 0),ct(this,jh,void 0),ct(this,r0,void 0),_e(this,"mfa",void 0),_e(this,"passkey",void 0),_e(this,"passwordless",void 0),_e(this,"database",void 0),_e(this,"anonymous",void 0),ft(et,this,t),t.useMtls&&!t.customFetch)throw new BN("mtls_without_custom_fetch_not_supported","Using mTLS without a custom fetch implementation is not supported");ft(Oa,this,ev(t.telemetry)),ft(Ut,this,n4((e=t.customFetch)!==null&&e!==void 0?e:function(){return fetch(...arguments)},J(Oa,this)));const n=dM(t.discoveryCache);ft(Mg,this,hM.createDiscoveryCache(n)),ft(jh,this,new Map),ft(r0,this,hM.createJwksCache()),this.mfa=new XG({domain:J(et,this).domain,clientId:J(et,this).clientId,clientSecret:J(et,this).clientSecret,customFetch:J(Ut,this),telemetryConfig:J(Oa,this),getConfiguration:async i=>(await Ne(Ue,this,xr).call(this,i)).configuration,createCaptureConfiguration:async i=>{const r=(await Ne(Ue,this,Kl).call(this)).serverMetadata;return Ne(Ue,this,vn).call(this,r,i)}}),this.passkey=new tJ({domain:J(et,this).domain,clientId:J(et,this).clientId,clientSecret:J(et,this).clientSecret,useMtls:J(et,this).useMtls,customFetch:J(Ut,this),telemetryConfig:J(Oa,this),grantRequest:async(i,r,o,l)=>{const u=(await Ne(Ue,this,Kl).call(this)).serverMetadata,d=Ne(Ue,this,f4).call(this,o);if(l){const g=Nn(d),v=await Ne(Ue,this,vn).call(this,u,g);v[Mt]=gM(g,i);const y=await ir(v,i,r),b=Sn.fromTokenEndpointResponse(y),x=g.getCapturedResponse();if(!x)throw new In;return{data:b,response:x}}const f=await Ne(Ue,this,vn).call(this,u);f[Mt]=gM(d,i);const p=await ir(f,i,r);return Sn.fromTokenEndpointResponse(p)}}),this.passwordless=new nJ({domain:J(et,this).domain,clientId:J(et,this).clientId,customFetch:J(Ut,this),telemetryConfig:J(Oa,this),clientSecret:J(et,this).clientSecret,clientAssertionSigningKey:J(et,this).clientAssertionSigningKey,clientAssertionSigningAlg:J(et,this).clientAssertionSigningAlg,useMtls:J(et,this).useMtls,grantRequest:async(i,r,o,l)=>{const u=(await Ne(Ue,this,xr).call(this,o)).configuration;if(l){var d;const f=Nn((d=u[Mt])!==null&&d!==void 0?d:J(Ut,this)),p=await Ne(Ue,this,vn).call(this,u.serverMetadata(),f),g=await ir(p,i,r),v=Sn.fromTokenEndpointResponse(g),y=f.getCapturedResponse();if(!y)throw new In;return{data:v,response:y}}try{const f=await ir(u,i,r);return Sn.fromTokenEndpointResponse(f)}catch(f){const p=f,g={};throw Ph(g,f),p._statusCode=g.statusCode,p._headers=g.headers,f}}}),this.database=new iJ({domain:J(et,this).domain,clientId:J(et,this).clientId,customFetch:J(Ut,this),telemetryConfig:J(Oa,this)}),this.anonymous=new sJ({domain:J(et,this).domain,clientId:J(et,this).clientId,clientSecret:J(et,this).clientSecret,clientAssertionSigningKey:J(et,this).clientAssertionSigningKey,clientAssertionSigningAlg:J(et,this).clientAssertionSigningAlg,useMtls:J(et,this).useMtls,customFetch:J(Ut,this)})}async getServerMetadata(){return(await Ne(Ue,this,Kl).call(this)).serverMetadata}async buildAuthorizationUrl(t){const e=(await Ne(Ue,this,Kl).call(this)).serverMetadata;if(t!=null&&t.pushedAuthorizationRequests&&!e.pushed_authorization_request_endpoint)throw new BN("par_not_supported_error","The Auth0 tenant does not have pushed authorization requests enabled. Learn how to enable it here: https://auth0.com/docs/get-started/applications/configure-par");try{return await Ne(Ue,this,u1).call(this,t)}catch(n){throw new VG(n)}}async buildLinkUserUrl(t){try{const e=await Ne(Ue,this,u1).call(this,{authorizationParams:Ee(Ee({},t.authorizationParams),{},{requested_connection:t.connection,requested_connection_scope:t.connectionScope,scope:"openid link_account offline_access",id_token_hint:t.idToken})});return{linkUserUrl:e.authorizationUrl,codeVerifier:e.codeVerifier}}catch(e){throw new BG(e)}}async buildUnlinkUserUrl(t){try{const e=await Ne(Ue,this,u1).call(this,{authorizationParams:Ee(Ee({},t.authorizationParams),{},{requested_connection:t.connection,scope:"openid unlink_account",id_token_hint:t.idToken})});return{unlinkUserUrl:e.authorizationUrl,codeVerifier:e.codeVerifier}}catch(e){throw new GG(e)}}async backchannelAuthentication(t,e){var n;const i=await Ne(Ue,this,xr).call(this,e),r=i.configuration,o=i.serverMetadata,l=pT(Ee(Ee({},J(et,this).authorizationParams),t?.authorizationParams)),u=new URLSearchParams(Ee(Ee({scope:wT},l),{},{client_id:J(et,this).clientId,binding_message:t.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:o.issuer,sub:t.loginHint.sub})}));if(t.requestedExpiry&&u.append("requested_expiry",t.requestedExpiry.toString()),t.authorizationDetail
14s&&u.append("authorization_details",JSON.stringify(t.authorizationDetails)),t.fullResponse){var d;const g=Nn((d=r[Mt])!==null&&d!==void 0?d:J(Ut,this)),v=await Ne(Ue,this,vn).call(this,r.serverMetadata(),g);try{const y=await Xk(r,u),b=await aT(v,y),x=g.getCapturedResponse();if(!x)throw new In;return{data:Sn.fromTokenEndpointResponse(b),response:x}}catch(y){if(y instanceof In)throw y;const b=new o0(y);throw Ph(b,y,g.getCapturedResponse()),b}}const f=Nn((n=r[Mt])!==null&&n!==void 0?n:J(Ut,this)),p=await Ne(Ue,this,vn).call(this,r.serverMetadata(),f);try{const g=await Xk(r,u),v=await aT(p,g);return Sn.fromTokenEndpointResponse(v)}catch(g){const v=new o0(g);throw Ph(v,g,f.getCapturedResponse()),v}}async initiateBackchannelAuthentication(t,e){var n;const i=await Ne(Ue,this,xr).call(this,e),r=i.configuration,o=i.serverMetadata,l=pT(Ee(Ee({},J(et,this).authorizationParams),t?.authorizationParams)),u=new URLSearchParams(Ee(Ee({scope:wT},l),{},{client_id:J(et,this).clientId,binding_message:t.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:o.issuer,sub:t.loginHint.sub})}));t.requestedExpiry&&u.append("requested_expiry",t.requestedExpiry.toString()),t.authorizationDetails&&u.append("authorization_details",JSON.stringify(t.authorizationDetails));const d=Nn((n=r[Mt])!==null&&n!==void 0?n:J(Ut,this)),f=await Ne(Ue,this,vn).call(this,r.serverMetadata(),d);try{const p=await Xk(f,u);return{authReqId:p.auth_req_id,expiresIn:p.expires_in,interval:p.interval}}catch(p){const g=new o0(p),v=d.getCapturedResponse();throw g.statusCode=v?.status,g.headers=v?on(v.headers):void 0,g}}async backchannelAuthenticationGrant(t,e){var n;let i=t.authReqId;const r=(await Ne(Ue,this,xr).call(this,e)).configuration,o=new URLSearchParams({auth_req_id:i}),l=Nn((n=r[Mt])!==null&&n!==void 0?n:J(Ut,this)),u=await Ne(Ue,this,vn).call(this,r.serverMetadata(),l);try{const d=await ir(u,"urn:openid:params:grant-type:ciba",o);return Sn.fromTokenEndpointResponse(d)}catch(d){const f=new o0(d),p=l.getCapturedResponse();throw f.statusCode=p?.status,f.headers=p?on(p.headers):void 0,f}}async getTokenForConnection(t,e){var n;if(t.refreshToken&&t.accessToken)throw new a1("Either a refresh or access token should be specified, but not both.");const i=(n=t.accessToken)!==null&&n!==void 0?n:t.refreshToken;if(!i)throw new a1("Either a refresh or access token must be specified.");try{return await this.exchangeToken(Ee({connection:t.connection,subjectToken:i,subjectTokenType:t.accessToken?h4:"urn:ietf:params:oauth:token-type:refresh_token",loginHint:t.loginHint},t.fullResponse?{fullResponse:!0}:{}),e)}catch(r){if(r instanceof ls){const o=new a1(r.message,r.cause);throw o.statusCode=r.statusCode,o.headers=r.headers,o}throw r}}async exchangeToken(t,e){return t.fullResponse?"connection"in t?Ne(Ue,this,mM).call(this,t,e,!0):Ne(Ue,this,yM).call(this,t,e,!0):"connection"in t?Ne(Ue,this,mM).call(this,t,e):Ne(Ue,this,yM).call(this,t,e)}async getTokenByCode(t,e,n){var i;const r=(await Ne(Ue,this,xr).call(this,n)).configuration;if(e.organization!==void 0&&MC(e.organization),e.fullResponse){var o;const f=Nn((o=r[Mt])!==null&&o!==void 0?o:J(Ut,this)),p=await Ne(Ue,this,vn).call(this,r.serverMetadata(),f);let g,v;try{const y=await cg(p,t,{pkceCodeVerifier:e.codeVerifier});if(g=Sn.fromTokenEndpointResponse(y),v=f.getCapturedResponse(),!v)throw new In}catch(y){if(y instanceof In)throw y;const b=new s0("There was an error while trying to request a token.",di(y)),x=f.getCapturedResponse();throw b.statusCode=x?.status,b.headers=x?on(x.headers):void 0,b}return e.organization&&fm(g.claims,e.organization),{data:g,response:v}}const l=Nn((i=r[Mt])!==null&&i!==void 0?i:J(Ut,this)),u=await Ne(Ue,this,vn).call(this,r.serverMetadata(),l);let d;try{const f=await cg(u,t,{pkceCodeVerifier:e.codeVerifier});d=Sn.fromTokenEndpointResponse(f)}catch(f){const p=new s0("There was an error while trying to request a token.",di(f)),g=l.getCapturedResponse();throw p.statusCode=g?.status,p.headers=g?on(g.headers):void 0,p}return e.organization&&fm(d.claims,e.organization),d}async getTokenByMagicLinkCode(t,e,n){var i;const r=(await Ne(Ue,this,xr).call(this,n)).configuration;if(e!=null&&e.fullResponse){var o;const d=Nn((o=r[Mt])!==null&&o!==void 0?o:J(Ut,this)),f=await Ne(Ue,this,vn).call(this,r.serverMetadata(),d);try{const p=await cg(f,t,{expectedState:e?.expectedState}),g=Sn.fromTokenEndpointResponse(p),v=d.getCapturedResponse();if(!v)throw new In;return{data:g,response:v}}catch(p){if(p instanceof In)throw p;const g=p instanceof Error&&p.message?p.message:"There was an error while trying to request a token.",v=new s0(g,p),y=d.getCapturedResponse();throw v.statusCode=y?.status,v.headers=y?on(y.headers):void 0,v}}const l=Nn((i=r[Mt])!==null&&i!==void 0?i:J(Ut,this)),u=await Ne(Ue,this,vn).call(this,r.serverMetadata(),l);try{const d=await cg(u,t,{expectedState:e?.expectedState});return Sn.fromTokenEndpointResponse(d)}catch(d){const f=d instanceof Error&&d.message?d.message:"There was an error while trying to request a token.",p=new s0(f,d),g=l.getCapturedResponse();throw p.statusCode=g?.status,p.headers=g?on(g.headers):void 0,p}}async getTokenByRefreshToken(t,e){var n;const i=(await Ne(Ue,this,xr).call(this,e)).configuration,r=new URLSearchParams;
14if(t.audience&&r.append("audience",t.audience),t.scope&&r.append("scope",t.scope),t.fullResponse){var o;const d=Nn((o=i[Mt])!==null&&o!==void 0?o:J(Ut,this)),f=await Ne(Ue,this,vn).call(this,i.serverMetadata(),d);try{const p=await lT(f,t.refreshToken,r),g=Sn.fromTokenEndpointResponse(p),v=d.getCapturedResponse();if(!v)throw new In;return{data:g,response:v}}catch(p){if(p instanceof In)throw p;const g=new JN("The access token has expired and there was an error while trying to refresh it.",di(p)),v=d.getCapturedResponse();throw g.statusCode=v?.status,g.headers=v?on(v.headers):void 0,g}}const l=Nn((n=i[Mt])!==null&&n!==void 0?n:J(Ut,this)),u=await Ne(Ue,this,vn).call(this,i.serverMetadata(),l);try{const d=await lT(u,t.refreshToken,r);return Sn.fromTokenEndpointResponse(d)}catch(d){const f=new JN("The access token has expired and there was an error while trying to refresh it.",di(d)),p=l.getCapturedResponse();throw f.statusCode=p?.status,f.headers=p?on(p.headers):void 0,f}}async revokeToken(t,e){var n;const i=(await Ne(Ue,this,xr).call(this,e)).configuration,r={};t.tokenTypeHint&&(r.token_type_hint=t.tokenTypeHint);const o=Nn((n=i[Mt])!==null&&n!==void 0?n:J(Ut,this)),l=await Ne(Ue,this,vn).call(this,i.serverMetadata(),o);try{await TG(l,t.token,r)}catch(u){const d=new WG("An error occurred while trying to revoke the token.",di(u)),f=o.getCapturedResponse();throw d.statusCode=f?.status,d.headers=f?on(f.headers):void 0,d}}async getUserInfo(t,e){const n=(await Ne(Ue,this,xr).call(this,e,!0)).configuration;try{var i;return await B5(n,t.accessToken,(i=t.expectedSubject)!==null&&i!==void 0?i:xG)}catch(r){throw new qG("There was an error while trying to retrieve the user info.",di(r))}}async getTokenByPassword(t,e){var n;const i=(await Ne(Ue,this,xr).call(this,e)).configuration,r=new URLSearchParams({username:t.username,password:t.password});t.audience&&r.append("audience",t.audience),t.scope&&r.append("scope",t.scope),t.realm&&r.append("realm",t.realm);let o=i;if(t.auth0ForwardedFor){const f=await Ne(Ue,this,zC).call(this);o=new qh(i.serverMetadata(),J(et,this).clientId,{client_secret:J(et,this).clientSecret,use_mtls_endpoint_aliases:J(et,this).useMtls},f);const p=i[Mt];o[Mt]=(g,v)=>p(g,Ee(Ee({},v),{},{headers:Ee(Ee({},v.headers),{},{"auth0-forwarded-for":t.auth0ForwardedFor})}))}if(t.fullResponse){var l;const f=Nn((l=o[Mt])!==null&&l!==void 0?l:J(Ut,this)),p=await Ne(Ue,this,vn).call(this,o.serverMetadata(),f);try{const g=await ir(p,"password",r),v=Sn.fromTokenEndpointResponse(g),y=f.getCapturedResponse();if(!y)throw new In;return{data:v,response:y}}catch(g){if(g instanceof In)throw g;const v=new XN("There was an error while trying to request a token.",di(g)),y=f.getCapturedResponse();throw v.statusCode=y?.status,v.headers=y?on(y.headers):void 0,v}}const u=Nn((n=o[Mt])!==null&&n!==void 0?n:J(Ut,this)),d=await Ne(Ue,this,vn).call(this,o.serverMetadata(),u);try{const f=await ir(d,"password",r);return Sn.fromTokenEndpointResponse(f)}catch(f){const p=new XN("There was an error while trying to request a token.",di(f)),g=u.getCapturedResponse();throw p.statusCode=g?.status,p.headers=g?on(g.headers):void 0,p}}async getTokenByPasswordlessEmail(t,e){const n=new URLSearchParams({username:t.email,otp:t.code,realm:"email"});return t.audience&&n.append("audience",t.audience),t.scope&&n.append("scope",t.scope),Ne(Ue,this,_M).call(this,n,e,t.fullResponse)}async getTokenByPasswordlessSms(t,e){if(!bT(t.phoneNumber))throw new _T("Phone number must be in E.164 format (e.g. +14155550100).");const n=new URLSearchParams({username:t.phoneNumber,otp:t.code,realm:"sms"});return t.audience&&n.append("audience",t.audience),t.scope&&n.append("scope",t.scope),Ne(Ue,this,_M).call(this,n,e,t.fullResponse)}async getTokenByClientCredentials(t,e){var n;const i=(await Ne(Ue,this,xr).call(this,e)).configuration;if(t.fullResponse){var r;const u=Nn((r=i[Mt])!==null&&r!==void 0?r:J(Ut,this)),d=await Ne(Ue,this,vn).call(this,i.serverMetadata(),u),f=new URLSearchParams({audience:t.audience});t.organization&&f.append("organization",t.organization);try{const p=await cT(d,f),g=Sn.fromTokenEndpointResponse(p),v=u.getCapturedResponse();if(!v)throw new In;return{data:g,response:v}}catch(p){if(p instanceof In)throw p;const g=new GN("There was an error while trying to request a token.",di(p)),v=u.getCapturedResponse();throw g.statusCode=v?.status,g.headers=v?on(v.headers):void 0,g}}const o=Nn((n=i[Mt])!==null&&n!==void 0?n:J(Ut,this)),l=await Ne(Ue,this,vn).call(this,i.serverMetadata(),o);
14try{const u=new URLSearchParams({audience:t.audience});t.organization&&u.append("organization",t.organization);const d=await cT(l,u);return Sn.fromTokenEndpointResponse(d)}catch(u){const d=new GN("There was an error while trying to request a token.",di(u)),f=o.getCapturedResponse();throw d.statusCode=f?.status,d.headers=f?on(f.headers):void 0,d}}async buildLogoutUrl(t){const e=await Ne(Ue,this,Kl).call(this),n=e.configuration;if(!e.serverMetadata.end_session_endpoint){const r=new URL("https://".concat(J(et,this).domain,"/v2/logout"));return r.searchParams.set("returnTo",t.returnTo),r.searchParams.set("client_id",J(et,this).clientId),t.federated&&r.searchParams.set("federated",""),r}const i={post_logout_redirect_uri:t.returnTo};return t.federated&&(i.federated=""),(function(r,o){wo(r);const l=gi(r),u=l.as,d=l.c,f=Fu(u,"end_session_endpoint",!1,l.tlsOnly);(o=new URLSearchParams(o)).has("client_id")||o.set("client_id",d.client_id);for(const g of o.entries()){var p=lr(g,2);const v=p[0],y=p[1];f.searchParams.append(v,y)}return f})(n,i)}async verifyLogoutToken(t){const e=(await Ne(Ue,this,Kl).call(this)).serverMetadata,n=dM(J(et,this).discoveryCache),i=e.jwks_uri;J(Rp,this)||ft(Rp,this,HG(new URL(i),{cacheMaxAge:n.ttlMs,[Y5]:J(Ut,this),[Q5]:J(r0,this)}));const r=(await PG(t.logoutToken,J(Rp,this),{issuer:e.issuer,audience:J(et,this).clientId,algorithms:["RS256"],requiredClaims:["iat"]})).payload;if(!("sid"in r)&&!("sub"in r))throw new jl('either "sid" or "sub" (or both) claims must be present');if("sid"in r&&typeof r.sid!="string")throw new jl('"sid" claim must be a string');if("sub"in r&&typeof r.sub!="string")throw new jl('"sub" claim must be a string');if("nonce"in r)throw new jl('"nonce" claim is prohibited');if(!("events"in r))throw new jl('"events" claim is missing');if(typeof r.events!="object"||r.events===null)throw new jl('"events" claim must be an object');if(!("http://schemas.openid.net/event/backchannel-logout"in r.events))throw new jl('"http://schemas.openid.net/event/backchannel-logout" member is missing in the "events" claim');if(typeof r.events["http://schemas.openid.net/event/backchannel-logout"]!="object")throw new jl('"http://schemas.openid.net/event/backchannel-logout" member in the "events" claim must be an object');return{sid:r.sid,sub:r.sub}}});function cJ(){const t=J(et,this).domain.toLowerCase();return"".concat(t,"|mtls:").concat(J(et,this).useMtls?"1":"0")}async function vn(t,e){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const i=await Ne(Ue,this,zC).call(this,n),r=new qh(t,J(et,this).clientId,{client_secret:J(et,this).clientSecret,use_mtls_endpoint_aliases:J(et,this).useMtls},i);return r[Mt]=e??J(Ut,this),r}function f4(t){return tv(J(Ut,this),t,J(Oa,this))}async function xr(t){let e=arguments.length>1&&arguments[1]!==void 0&&arguments[1];const n=await Ne(Ue,this,Kl).call(this,e),i=n.configuration,r=n.serverMetadata;if(!t)return{configuration:i,serverMetadata:r};const o=Ne(Ue,this,f4).call(this,t);return{configuration:await Ne(Ue,this,vn).call(this,r,o,e),serverMetadata:r}}async function Kl(){let t=arguments.length>0&&arguments[0]!==void 0&&arguments[0];const e=J(t?ub:cb,this);if(e&&J(hm,this))return{configuration:e,serverMetadata:J(hm,this)};const n=Ne(Ue,this,cJ).call(this);t||await Ne(Ue,this,zC).call(this,!1);const i=J(Mg,this).get(n);if(i)return Ne(Ue,this,c1).call(this,i.serverMetadata,t);const r=J(jh,this).get(n);if(r){const l=await r;return Ne(Ue,this,c1).call(this,l.serverMetadata,t)}const o=(async()=>{const l=(await EG(new URL("https://".concat(J(et,this).domain)),J(et,this).clientId,{use_mtls_endpoint_aliases:J(et,this).useMtls},(u,d,f,p)=>{f.set("client_id",d.client_id)},{[Mt]:J(Ut,this)})).serverMetadata();return J(Mg,this).set(n,{serverMetadata:l}),{serverMetadata:l}})();o.catch(()=>{}),J(jh,this).set(n,o);try{const l=(await o).serverMetadata;return Ne(Ue,this,c1).call(this,l,t)}finally{J(jh,this).delete(n)}}async function c1(t,e){const n=await Ne(Ue,this,vn).call(this,t,void 0,e);return ft(hm,this,t),ft(e?ub:cb,this,n),{configuration:n,serverMetadata:t}}async function mM(t,e,n){var i,r,o;const l=(await Ne(Ue,this,xr).call(this,e)).configuration;if("audience"in t||"resource"in t)throw new ls("audience and resource parameters are not supported for Token Vault exchanges");u4(t.subjectToken);const u=new URLSearchParams({connection:t.connection,subject_token:t.subjectToken,subject_token_type:(i=t.subjectTokenType)!==null&&i!==void 0?i:h4,requested_token_type:(r=t.requestedTokenType)!==null&&r!==void 0?r:"http://auth0.com/oauth/token-type/federated-connection-access-token"});if(t.loginHint&&u.append("login_hint",t.loginHint),t.scope&&u.append("scope",t.scope),d4(u,t.extra),n){var d;const g=Nn((d=l[Mt])!==null&&d!==void 0?d:J(Ut,this)),v=await Ne(Ue,this,vn).call(this,l.serverMetadata(),g);try{const y=await ir(v,fM,u),b=Sn.fromTokenEndpointResponse(y),x=g.getCapturedResponse();if(!x)throw new In;return{data:b,response:x}}catch(y){if(y instanceof In)throw y;const b=new ls("Failed to exchange token for connection '".concat(t.connection,"'."),di(y)),x=g.getCapturedResponse();throw b.statusCode=x?.status,b.headers=x?on(x.headers):void 0,b}}const f=Nn((o=l[Mt])!==null&&o!==void 0?o:J(Ut,this)),p=await Ne(Ue,this,vn).call(this,l.serverMetadata(),f);try{const g=await ir(p,fM,u);return Sn.fromTokenEndpointResponse(g)}catch(g){const v=new ls("Failed to exchange token for connection '".concat(t.connection,"'."),di(g)),y=f.getCapturedResponse();throw v.statusCode=y?.status,v.headers=y?on(y.headers):void 0,v}}function vM(t,e,n){var i;if(n.organization&&fm(t.claims,n.organization),n.actorToken)if((i=t.claims)!==null&&i!==void 0&&i.act)t.act=t.claims.act;else try{t.act=(function(r){if(typeof r!="string")throw new lo("JWTs must use Compact JWS serialization, JWT must be a string");const o=r.split("."),l=o[1],u=o.length;if(u===5)throw new lo("Only JWTs using Compact JWS serialization can be decoded");
14if(u!==3)throw new lo("Invalid JWT");if(!l)throw new lo("JWTs must contain a payload");let d,f;try{d=bw(l)}catch{throw new lo("Failed to base64url decode the payload")}try{f=JSON.parse(OC.decode(d))}catch{throw new lo("Failed to parse the decoded payload as JSON")}if(!lc(f))throw new lo("Invalid JWT Claims Set");return f})(e.access_token).act}catch{}return t}async function yM(t,e,n){var i;const r=(await Ne(Ue,this,xr).call(this,e)).configuration;if(u4(t.subjectToken),t.organization!==void 0&&MC(t.organization),t.actorToken!==void 0&&t.actorTokenType===void 0)throw new ls("actorTokenType is required when actorToken is provided");const o=new URLSearchParams({subject_token_type:t.subjectTokenType,subject_token:t.subjectToken});if(t.audience&&o.append("audience",t.audience),t.scope&&o.append("scope",t.scope),t.requestedTokenType&&o.append("requested_token_type",t.requestedTokenType),t.organization&&o.append("organization",t.organization),t.actorToken&&o.append("actor_token",t.actorToken),t.actorTokenType&&o.append("actor_token_type",t.actorTokenType),d4(o,t.extra),n){var l;const g=Nn((l=r[Mt])!==null&&l!==void 0?l:J(Ut,this)),v=await Ne(Ue,this,vn).call(this,r.serverMetadata(),g);let y,b,x;try{if(b=await ir(v,pM,o),y=Sn.fromTokenEndpointResponse(b),x=g.getCapturedResponse(),!x)throw new In}catch(S){if(S instanceof In)throw S;const k=new ls("Failed to exchange token of type '".concat(t.subjectTokenType,"'").concat(t.audience?" for audience '".concat(t.audience,"'"):"","."),di(S)),T=g.getCapturedResponse();throw k.statusCode=T?.status,k.headers=T?on(T.headers):void 0,k}return Ne(Ue,this,vM).call(this,y,b,t),{data:y,response:x}}const u=Nn((i=r[Mt])!==null&&i!==void 0?i:J(Ut,this)),d=await Ne(Ue,this,vn).call(this,r.serverMetadata(),u);let f,p;try{p=await ir(d,pM,o),f=Sn.fromTokenEndpointResponse(p)}catch(g){const v=new ls("Failed to exchange token of type '".concat(t.subjectTokenType,"'").concat(t.audience?" for audience '".concat(t.audience,"'"):"","."),di(g)),y=u.getCapturedResponse();throw v.statusCode=y?.status,v.headers=y?on(y.headers):void 0,v}return Ne(Ue,this,vM).call(this,f,p,t),f}async function _M(t,e,n){var i;const r=(await Ne(Ue,this,xr).call(this,e)).configuration;if(n){var o;const d=Nn((o=r[Mt])!==null&&o!==void 0?o:J(Ut,this)),f=await Ne(Ue,this,vn).call(this,r.serverMetadata(),d);try{const p=await ir(f,"http://auth0.com/oauth/grant-type/passwordless/otp",t),g=Sn.fromTokenEndpointResponse(p),v=d.getCapturedResponse();if(!v)throw new In;return{data:g,response:v}}catch(p){if(p instanceof In)throw p;const g=new _T("There was an error while trying to request a token.",di(p)),v=d.getCapturedResponse();throw g.statusCode=v?.status,g.headers=v?on(v.headers):void 0,g}}const l=Nn((i=r[Mt])!==null&&i!==void 0?i:J(Ut,this)),u=await Ne(Ue,this,vn).call(this,r.serverMetadata(),l);try{const d=await ir(u,"http://auth0.com/oauth/grant-type/passwordless/otp",t);return Sn.fromTokenEndpointResponse(d)}catch(d){const f=new _T("There was an error while trying to request a token.",di(d)),p=l.getCapturedResponse();throw f.statusCode=p?.status,f.headers=p?on(p.headers):void 0,f}}async function zC(){let t=arguments.length>0&&arguments[0]!==void 0&&arguments[0];const e=!!J(et,this).clientSecret||!!J(et,this).clientAssertionSigningKey||!!J(et,this).useMtls;return t&&!e?(n,i,r,o)=>{r.set("client_id",i.client_id)}:(J(vh,this)||ft(vh,this,(async()=>{if(!J(et,this).clientSecret&&!J(et,this).clientAssertionSigningKey&&!J(et,this).useMtls)throw new e4;if(J(et,this).useMtls)return(i,r,o,l)=>{o.set("client_id",r.client_id)};let n=J(et,this).clientAssertionSigningKey;return!n||n instanceof CryptoKey||(n=await NC(n,J(et,this).clientAssertionSigningAlg||"RS256")),n?(function(i,r){return UB(i)})(n):Z5(J(et,this).clientSecret)})().catch(n=>{throw ft(vh,this,void 0),n})),J(vh,this))}async function u1(t){const e=(await Ne(Ue,this,Kl).call(this)).configuration,n=kG(),i=await SG(n),r=pT(Ee(Ee({},J(et,this).authorizationParams),t?.authorizationParams)),o=new URLSearchParams(Ee(Ee({scope:wT},r),{},{client_id:J(et,this).clientId,code_challenge:i,code_challenge_method:"S256"}));return{authorizationUrl:t!=null&&t.pushedAuthorizationRequests?await V5(e,o):await uT(e,o),codeVerifier:n}}new c4(1e3,6e4);let nv=class xT extends Qt{constructor(e,n){super(e,n),Object.setPrototypeOf(this,xT.prototype)}static fromPayload(e){let n=e.error,i=e.error_description;return new xT(n,i)}},bM=class p4 extends nv{constructor(e,n){super(e,n),Object.setPrototypeOf(this,p4.prototype)}},uJ=class g4 extends nv{constructor(e,n){super(e,n),Object.setPrototypeOf(this,g4.prototype)}},dJ=class m4 extends nv{constructor(e,n){super(e,n),Object.setPrototypeOf(this,m4.prototype)}},c0=class v4 extends nv{constructor(e,n){super(e,n),Object.setPrototypeOf(this,v4.prototype)}},hJ=class y4 extends nv{constructor(e,n){super(e,n),Object.setPrototypeOf(this,y4.prototype)}},fJ=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:6e5;this.contexts=new Map,this.ttlMs=e}set(e,n){this.cleanup(),this.contexts.set(e,Object.assign(Object.assign({}
14,n),{createdAt:Date.now()}))}get(e){const n=this.contexts.get(e);if(n){if(!(Date.now()-n.createdAt>this.ttlMs))return n;this.contexts.delete(e)}}remove(e){this.contexts.delete(e)}cleanup(){const e=Date.now();for(const i of this.contexts){var n=lr(i,2);const r=n[0];e-n[1].createdAt>this.ttlMs&&this.contexts.delete(r)}}get size(){return this.contexts.size}},pJ=class{constructor(e,n){this.authJsMfaClient=e,this.auth0Client=n,this.contextManager=new fJ}setMFAAuthDetails(e,n,i,r){this.contextManager.set(e,{scope:n,audience:i,mfaRequirements:r})}async getAuthenticators(e){var n,i,r;const o=this.contextManager.get(e);if(!o)throw new bM("invalid_request","MFA context not found for this MFA token");const l=(i=(n=o.mfaRequirements)===null||n===void 0?void 0:n.challenge)===null||i===void 0?void 0:i.map(u=>u.type);try{const u=await this.authJsMfaClient.listAuthenticators({mfaToken:e});return l&&l.length!==0?u.filter(d=>!!d.type&&l.includes(d.type)):u}catch(u){throw u instanceof gT?new bM((r=u.cause)===null||r===void 0?void 0:r.error,u.message):u}}async enroll(e){var n;const i=(function(r){const o=AB[r.factorType];return Object.assign(Object.assign(Object.assign({mfaToken:r.mfaToken,authenticatorTypes:o.authenticatorTypes},o.oobChannels&&{oobChannels:o.oobChannels}),"phoneNumber"in r&&{phoneNumber:r.phoneNumber}),"email"in r&&{email:r.email})})(e);try{return await this.authJsMfaClient.enrollAuthenticator(i)}catch(r){throw r instanceof mT?new uJ((n=r.cause)===null||n===void 0?void 0:n.error,r.message):r}}async challenge(e){var n;try{const i={challengeType:e.challengeType,mfaToken:e.mfaToken};return e.authenticatorId&&(i.authenticatorId=e.authenticatorId),await this.authJsMfaClient.challengeAuthenticator(i)}catch(i){throw i instanceof vT?new dJ((n=i.cause)===null||n===void 0?void 0:n.error,i.message):i}}async getEnrollmentFactors(e){const n=this.contextManager.get(e);if(!n||!n.mfaRequirements)throw new hJ("mfa_context_not_found","MFA context not found for this MFA token. Please retry the original request to get a new MFA token.");return n.mfaRequirements.enroll&&n.mfaRequirements.enroll.length!==0?n.mfaRequirements.enroll:[]}async verify(e){const n=this.contextManager.get(e.mfaToken);if(!n)throw new c0("mfa_context_not_found","MFA context not found for this MFA token. Please retry the original request to get a new MFA token.");const i=(function(l){return"otp"in l&&l.otp?jB:"oobCode"in l&&l.oobCode?PB:"recoveryCode"in l&&l.recoveryCode?NB:void 0})(e);if(!i)throw new c0("invalid_request","Unable to determine grant type. Provide one of: otp, oobCode, or recoveryCode.");const r=n.scope,o=n.audience;try{const l=await this.auth0Client._requestTokenForMfa({grant_type:i,mfaToken:e.mfaToken,scope:r,audience:o,otp:e.otp,oob_code:e.oobCode,binding_code:e.bindingCode,recovery_code:e.recoveryCode});return this.contextManager.remove(e.mfaToken),l}catch(l){throw l instanceof c0?new c0(l.error,l.error_description):l}}},Pl=class _4 extends Error{constructor(e,n,i){super(n),this.name="PasskeyError",this.code=e,this.cause=i,Object.setPrototypeOf(this,_4.prototype)}};var eu,dh;let gJ=class{constructor(e,n){eu.set(this,void 0),dh.set(this,void 0),dN(this,eu,e),dN(this,dh,n)}async signup(e){if(!window.PublicKeyCredential)throw new Pl("passkey_not_supported","WebAuthn is not supported in this browser.");const n=e.scope,i=e.audience,r=Mr(e,["scope","audience"]),o=await Uc(this,eu,"f").register(r),l=wM(o.authnParamsPublicKey),u=await navigator.credentials.create({publicKey:l});if(!u)throw new Pl("passkey_cancelled","Passkey creation was cancelled or no credential was returned.");const d=SM(u);return Uc(this,dh,"f")._requestTokenForPasskey({authSession:o.authSession,credential:d,realm:r.realm,organization:r.organization,scope:n,audience:i})}async login(e){if(!window.PublicKeyCredential)throw new Pl("passkey_not_supported","WebAuthn is not supported in this browser.");const n=e||{},i=n.scope,r=n.audience,o=Mr(n,["scope","audience"]),l=await Uc(this,eu,"f").challenge(Object.keys(o).length>0?o:void 0),u=xM(l.authnParamsPublicKey),d=await navigator.credentials.get({publicKey:u});if(!d)throw new Pl("passkey_cancelled","Passkey authentication was cancelled or no credential was returned.");const f=kM(d);return Uc(this,dh,"f")._requestTokenForPasskey({authSession:l.authSession,credential:f,realm:o.realm,organization:o.organization,scope:i,audience:r})}async getSignupChallenge(e){if(!window.PublicKeyCredential)throw new Pl("passkey_not_supported","WebAuthn is not supported in this browser.");const n=await Uc(this,eu,"f").register(e);return{authSession:n.authSession,publicKey:wM(n.authnParamsPublicKey)}}async getLoginChallenge(e){if(!window.PublicKeyCredential)throw new Pl("passkey_not_supported","WebAuthn is not supported in this browser.");const n=await Uc(this,eu,"f").challenge(e);return{authSession:n.authSession,publicKey:xM(n.authnParamsPublicKey)}}async getTokenWithPasskey(e){if(!window.PublicKeyCredential)throw new Pl("passkey_not_supported","WebAuthn is not supported in this browser.");const n=e.authSession,i=e.credential,r=e.realm,o=e.organization,l=e.scope,u=e.audience,d=i.response;let f;if(d instanceof AuthenticatorAttestationResponse)f=SM(i);else{if(!(d instanceof AuthenticatorAssertionResponse))throw new Pl("passkey_invalid_credential","The provided credential is not a valid attestation or assertion response.");f=kM(i)}return Uc(this,dh,"f")._requestTokenForPasskey({authSession:n,credential:f,realm:r,organization:o,scope:l,audience:u})}};function Bl(t){const e=new Uint8Array(t),n=Array.from(e,i=>String.fromCharCode(i)).join("");return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function ST(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),n=e+"=".repeat((4-e.length%4)%4),i=atob(n),r=new 
14Uint8Array(i.length);for(let o=0;o<i.length;o++)r[o]=i.charCodeAt(o);return r.buffer}function wM(t){return Object.assign(Object.assign({},t),{challenge:ST(t.challenge),user:Object.assign(Object.assign({},t.user),{id:ST(t.user.id)}),pubKeyCredParams:t.pubKeyCredParams,authenticatorSelection:t.authenticatorSelection})}function xM(t){return Object.assign(Object.assign({},t),{challenge:ST(t.challenge)})}function SM(t){var e;const n=t.response;return{id:t.id,rawId:Bl(t.rawId),type:t.type,authenticatorAttachment:(e=t.authenticatorAttachment)!==null&&e!==void 0?e:void 0,response:{clientDataJSON:Bl(n.clientDataJSON),attestationObject:Bl(n.attestationObject)},clientExtensionResults:t.getClientExtensionResults()}}function kM(t){var e;const n=t.response;return{id:t.id,rawId:Bl(t.rawId),type:t.type,authenticatorAttachment:(e=t.authenticatorAttachment)!==null&&e!==void 0?e:void 0,response:{clientDataJSON:Bl(n.clientDataJSON),authenticatorData:Bl(n.authenticatorData),signature:Bl(n.signature),userHandle:n.userHandle?Bl(n.userHandle):void 0},clientExtensionResults:t.getClientExtensionResults()}}eu=new WeakMap,dh=new WeakMap;function EM(t){return{get(){try{const e=window.localStorage.getItem(t);return e?JSON.parse(e):null}catch{return null}},set(e){try{window.localStorage.setItem(t,JSON.stringify(e))}catch{}},remove(){try{window.localStorage.removeItem(t)}catch{}}}}function TM(){let t=null;return{get:()=>t,set:e=>{t=e},remove:()=>{t=null}}}let mJ=class{constructor(e,n){this.slots=new Map,this.baseKey="".concat("@@auth0spajs@@","::").concat(e,"::anonymous"),this.useLocalStorage=n==="localStorage"&&typeof window<"u"&&!!window.localStorage,this.sessionKey="".concat(this.baseKey,"::").concat("session"),this.sessionStore=this.useLocalStorage?EM(this.sessionKey):TM()}getStore(e,n){const i="".concat(this.baseKey,"::").concat(JSON.stringify([e??"",n??""]));return this.slots.has(i)||this.slots.set(i,this.useLocalStorage?EM(i):TM()),this.slots.get(i)}getSessionToken(){return this.sessionStore.get()}setSessionToken(e){this.sessionStore.set(e)}removeAll(){if(this.sessionStore.remove(),this.slots.forEach(e=>e.remove()),this.slots.clear(),this.useLocalStorage)try{const e=this.baseKey+"::",n=[];for(let i=0;i<window.localStorage.length;i++){const r=window.localStorage.key(i);r?.startsWith(e)&&n.push(r)}n.forEach(i=>window.localStorage.removeItem(i))}catch{}}},vJ=class{constructor(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"localStorage",r=arguments.length>3?arguments[3]:void 0;this.authJsClient=e,this.clientId=n,this.cache=new mJ(n,i),this.lockManager=r??XL()}async createSession(e){const n=await this.authJsClient.createSession(e);return this.cache.setSessionToken(Object.assign({sessionToken:n.sessionToken},n.sessionTokenExpiresAt!==void 0&&{sessionTokenExpiresAt:n.sessionTokenExpiresAt})),this.cache.getStore(e?.audience,e?.scope).set(Object.assign({accessToken:n.accessToken,expiresAt:n.expiresAt},n.scope!==void 0&&{scope:n.scope})),n}async getTokenSilently(e){const n=this.cache.getStore(e?.audience,e?.scope),i=n.get();return i&&i.expiresAt-60>Date.now()/1e3?i:this.lockManager.runWithLock("anonymous::".concat(this.clientId),5e3,async()=>{var r;const o=n.get();if(o&&o.expiresAt-60>Date.now()/1e3)return o;const l=(r=this.cache.getSessionToken())===null||r===void 0?void 0:r.sessionToken,u=await this.authJsClient.getAccessToken(Object.assign(Object.assign({},e),{sessionToken:l}));return this.cache.getStore(e?.audience,e?.scope).set(Object.assign({accessToken:u.accessToken,expiresAt:u.expiresAt},u.scope!==void 0&&{scope:u.scope})),!u.sessionReplaced&&this.cache.getSessionToken()||this.cache.setSessionToken(Object.assign({sessionToken:u.sessionToken},u.sessionTokenExpiresAt!==void 0&&{sessionTokenExpiresAt:u.sessionTokenExpiresAt})),Object.assign({accessToken:u.accessToken,expiresAt:u.expiresAt},u.scope!==void 0&&{scope:u.scope})})}async logout(){await this.authJsClient.logout(),this.cache.removeAll()}hasSession(){var e;return!!(!((e=this.cache.getSessionToken())===null||e===void 0)&&e.sessionToken)}getClaims(){return null}},yJ=class{resolveOnlineAccess(e){if(e.refreshTokenMode!=="online")return!1;if(e.useRefreshTokens!==!0)throw new vN('`refreshTokenMode: "online"` requires the refresh-token grant.',"Set `useRefreshTokens: true`.");if(e.useDpop!==!0)throw new vN('`refreshTokenMode: "online"` requires DPoP, which is missing or disabled.',"Set `useDpop: true` (DPoP is mandatory for online access).");return!0}warnEnterpriseConnectConfig(e){var n,i;if(e.enterpriseConnect!==!0)return;const r=(n=e.authorizationParams)===null||n===void 0?void 0:n.scope;(e.useRefreshTokens===!0||typeof r=="string"&&r.includes("offline_access"))&&console.warn("Enterprise Connect issues no refresh token; `useRefreshTokens` and `offline_access` in `scope` have no effect."),!((i=e.authorizationParams)===null||i===void 0)&&i.organization&&console.warn("Enterprise Connect resolves the organization from the email domain (Home Realm Discovery); a static `organization` breaks multi-customer setups.")}constructor(e){let n,i;if(this.userCache=new r5().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0,refreshTokenMode:"offline",anonymousSessionsCacheMode:"localStorage"},this.onlineAccess=this.resolveOnlineAccess(e),this.warnEnterpriseConnectConfig(e),this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),e),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),e.authorizationParams)}),typeof window<"u"&&(()=>{if(!Y_())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(Y_().subtle===void 0)throw new Error(`
15      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.
16    `)})(),this.lockManager=XL(),e.cache&&e.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),e.cache)i=e.cache;
16else{if(n=e.cacheLocation||gN,!CN(n))throw new Error('Invalid cache location "'.concat(n,'"'));i=CN(n)()}var r;this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:qE,this.cookieStorage=e.legacySameSiteCookie===!1?ch:bB,this.orgHintCookieName=(r=this.options.clientId,"auth0.".concat(r,".organization_hint")),this.isAuthenticatedCookieName=(p=>"auth0.".concat(p,".is.authenticated"))(this.options.clientId),this.sessionCheckExpiryDays=e.sessionCheckExpiryDays||1;const o=e.useCookiesForTransactions?this.cookieStorage:wB;let l="";var u;this.onlineAccess?l=ML:this.options.useRefreshTokens&&(l="offline_access"),this.scope=(function(p,g){for(var v=arguments.length,y=new Array(v>2?v-2:0),b=2;b<v;b++)y[b-2]=arguments[b];if(typeof p!="object")return{[Ai]:n_(g,p,...y)};let x={[Ai]:n_(g,...y)};return Object.keys(p).forEach(S=>{const k=p[S];x[S]=n_(g,k,...y)}),x})(this.options.authorizationParams.scope,"openid",l),this.transactionManager=new pB(o,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||IL,this.cacheManager=new fB(i,i.allKeys?void 0:new kB(i,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new OB(this.options.clientId):void 0,this.domainUrl=(u=this.options.domain,/^https?:\/\//.test(u)?u:"https://".concat(u)),this.tokenIssuer=((p,g)=>p?p.startsWith("https://")?p:"https://".concat(p,"/"):"".concat(g,"/"))(this.options.issuer,this.domainUrl);const d="".concat(this.domainUrl,"/me/"),f=this.createFetcher(Object.assign(Object.assign({},this.options.useDpop&&{dpopNonceId:"__auth0_my_account_api__"}),{getAccessToken:p=>{var g;return this.getTokenSilently({authorizationParams:{scope:(g=p?.scope)===null||g===void 0?void 0:g.join(" "),audience:d},detailedResponse:!0})}}));this.myAccount=new $B(f,d),this.authJsClient=new lJ({domain:this.options.domain,clientId:this.options.clientId}),this.mfa=new pJ(this.authJsClient.mfa,this),this.anonymous=new vJ(this.authJsClient.anonymous,this.options.clientId,this.options.anonymousSessionsCacheMode,this.lockManager),this.passkey=new gJ(this.authJsClient.passkey,this),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&n===gN&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new SB,this.worker.postMessage({type:"init",allowedBaseUrl:this.domainUrl}))}getConfiguration(){return Object.freeze({domain:this.options.domain,clientId:this.options.clientId})}_url(e){const n=this.options.auth0Client||VE,i=JE(n,!0),r=encodeURIComponent(btoa(JSON.stringify(i)));return"".concat(this.domainUrl).concat(e,"&auth0Client=").concat(r)}_authorizeUrl(e){return this._url("/authorize?".concat(lg(e)))}async _verifyIdToken(e,n,i){const r=await this.nowProvider();return mB({iss:this.tokenIssuer,aud:this.options.clientId,id_token:e,nonce:n,organization:i,leeway:this.options.leeway,max_age:(o=this.options.authorizationParams.max_age,typeof o!="string"?o:parseInt(o,10)||void 0),now:r});var o}_processOrgHint(e){e?this.cookieStorage.save(this.orgHintCookieName,e,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}_extractSessionTransferToken(e){return new URLSearchParams(window.location.search).get(e)||void 0}_clearSessionTransferTokenFromUrl(e){try{const n=new URL(window.location.href);n.searchParams.has(e)&&(n.searchParams.delete(e),window.history.replaceState({},"",n.toString()))}catch{}}_applySessionTransferToken(e){const n=this.options.sessionTransferTokenQueryParamName;if(!n||e.session_transfer_token)return e;const i=this._extractSessionTransferToken(n);return i?(this._clearSessionTransferTokenFromUrl(n),Object.assign(Object.assign({},e),{session_transfer_token:i})):e}async _prepareAuthorizeUrl(e,n,i){var r;const o=Ik(gp()),l=Ik(gp()),u=gp(),d=await yN(u),f=bN(d),p=await((r=this.dpop)===null||r===void 0?void 0:r.calculateThumbprint()),g=((y,b,x,S,k,T,C,A,$)=>Object.assign(Object.assign(Object.assign({client_id:y.clientId},y.authorizationParams),x),{scope:vp(b,x.scope,x.audience),response_type:"code",response_mode:A||"query",state:S,nonce:k,redirect_uri:C||y.authorizationParams.redirect_uri,code_challenge:T,code_challenge_method:"S256",dpop_jkt:$}))(this.options,this.scope,e,o,l,f,e.redirect_uri||this.options.authorizationParams.redirect_uri||i,n?.response_mode,p),v=this._authorizeUrl(g);
16return{nonce:l,code_verifier:u,scope:g.scope,audience:g.audience||Ai,redirect_uri:g.redirect_uri,state:o,url:v}}async loginWithPopup(e,n){var i;if(e=e||{},!(n=n||{}).popup&&(n.popup=(d=>{const f=window.screenX+(window.innerWidth-400)/2,p=window.screenY+(window.innerHeight-600)/2;return window.open(d,"auth0:authorize:popup","left=".concat(f,",top=").concat(p,",width=").concat(400,",height=").concat(600,",resizable,scrollbars=yes,status=1"))})(""),!n.popup))throw new qV;const r=this._applySessionTransferToken(e.authorizationParams||{}),o=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);n.popup.location.href=o.url;const l=await((d,f)=>new Promise((p,g)=>{let v;const y=setInterval(()=>{d.popup&&d.popup.closed&&(clearInterval(y),clearTimeout(b),window.removeEventListener("message",v,!1),g(new WV(d.popup)))},1e3),b=setTimeout(()=>{clearInterval(y),g(new ZV(d.popup)),window.removeEventListener("message",v,!1)},1e3*(d.timeoutInSeconds||60));v=function(x){if(x.origin===f&&x.data&&x.data.type==="authorization_response"){if(clearTimeout(b),clearInterval(y),window.removeEventListener("message",v,!1),d.closePopup!==!1&&d.popup.close(),x.data.response.error)return g(Qt.fromPayload(x.data.response));p(x.data.response)}},window.addEventListener("message",v)}))(Object.assign(Object.assign({},n),{timeoutInSeconds:n.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}),new URL(o.url).origin);if(o.state!==l.state)throw new Qt("state_mismatch","Invalid state");const u=((i=e.authorizationParams)===null||i===void 0?void 0:i.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:o.audience,scope:o.scope,code_verifier:o.code_verifier,grant_type:"authorization_code",code:l.code,redirect_uri:o.redirect_uri},{nonceIn:o.nonce,organization:u})}async getUser(){var e;if(await this._isSessionCeilingReached())return;const n=await this._getIdTokenFromCache();return(e=n?.decodedToken)===null||e===void 0?void 0:e.user}async getIdTokenClaims(){var e;if(await this._isSessionCeilingReached())return;const n=await this._getIdTokenFromCache();return(e=n?.decodedToken)===null||e===void 0?void 0:e.claims}async loginWithRedirect(){var e;const n=ON(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),i=n.openUrl,r=n.fragment,o=n.appState,l=Mr(n,["openUrl","fragment","appState"]),u=((e=l.authorizationParams)===null||e===void 0?void 0:e.organization)||this.options.authorizationParams.organization,d=this._applySessionTransferToken(l.authorizationParams||{}),f=await this._prepareAuthorizeUrl(d),p=f.url,g=Mr(f,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},g),{appState:o,response_type:Vl.Code}),u&&{organization:u}));const v=r?"".concat(p,"#").concat(r):p;i?await i(v):window.location.assign(v)}async handleRedirectCallback(){const e=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.location.href).split("?").slice(1);if(e.length===0)throw new Error("There are no query params available for parsing.");const n=this.transactionManager.get();if(!n)throw new Qt("missing_transaction","Invalid state");this.transactionManager.remove();const i=(r=>{r.indexOf("#")>-1&&(r=r.substring(0,r.indexOf("#")));const o=new URLSearchParams(r);return{state:o.get("state"),code:o.get("code")||void 0,connect_code:o.get("connect_code")||void 0,error:o.get("error")||void 0,error_description:o.get("error_description")||void 0}})(e.join(""));return n.response_type===Vl.ConnectCode?this._handleConnectAccountRedirectCallback(i,n):this._handleLoginRedirectCallback(i,n)}async _handleLoginRedirectCallback(e,n){const i=e.code,r=e.state,o=e.error,l=e.error_description;if(o)throw new HV(o,l||o,r,n.appState);if(!n.code_verifier||n.state&&n.state!==r)throw new Qt("state_mismatch","Invalid state");const u=n.organization,d=n.nonce,f=n.redirect_uri;return await this._requestToken(Object.assign({audience:n.audience,scope:n.scope,code_verifier:n.code_verifier,grant_type:"authorization_code",code:i},f?{redirect_uri:f}:{}),{nonceIn:d,organization:u}),{appState:n.appState,response_type:Vl.Code}}async _handleConnectAccountRedirectCallback(e,n){const i=e.connect_code,r=e.state,o=e.error,l=e.error_description;if(o)throw new KV(o,l||o,n.connection,r,n.appState);if(!i)throw new Qt("missing_connect_code","Missing connect code");if(!(n.code_verifier&&n.state&&n.auth_session&&n.redirect_uri&&n.state===r))throw new Qt("state_mismatch","Invalid state");const u=await this.myAccount.completeAccount({auth_session:n.auth_session,connect_code:i,redirect_uri:n.redirect_uri,code_verifier:n.code_verifier});return Object.assign(Object.assign({},u),{appState:n.appState,response_type:Vl.ConnectCode})}async _maybeCreateAnonymousSession(){if(this.options.createAnonymousSessionOnFailedSilentAuth){if(this.anonymous.hasSe
16ssion())return;try{await this.anonymous.getTokenSilently()}catch(e){console.debug("[auth0-spa-js] Anonymous session creation failed",e)}}}async checkSession(e){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get(TN))return void await this._maybeCreateAnonymousSession();this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(TN)}try{await this.getTokenSilently(e)}catch(n){n instanceof Qt&&n.error==="login_required"&&n.error_description!==mN&&await this._maybeCreateAnonymousSession()}}async getTokenSilently(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var n,i;const r=Object.assign(Object.assign({cacheMode:"on"},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:vp(this.scope,(n=e.authorizationParams)===null||n===void 0?void 0:n.scope,((i=e.authorizationParams)===null||i===void 0?void 0:i.audience)||this.options.authorizationParams.audience)})}),o=await this._getTokenSilently(r);return e.detailedResponse?o:o?.access_token}async _getTokenSilently(e){const n=e.cacheMode,i=Mr(e,["cacheMode"]);if(await this._isSessionCeilingReached())return;if(n!=="off"){const u=await this._getEntryFromCache({scope:i.authorizationParams.scope,audience:i.authorizationParams.audience||Ai,clientId:this.options.clientId,cacheMode:n});if(u)return u}if(n==="cache-only")return;const r=(o=this.options.clientId,l=i.authorizationParams.audience||"default","".concat("auth0.lock.getTokenSilently",".").concat(o,".").concat(l));var o,l;try{return await this.lockManager.runWithLock(r,5e3,async()=>{if(n!=="off"){const y=await this._getEntryFromCache({scope:i.authorizationParams.scope,audience:i.authorizationParams.audience||Ai,clientId:this.options.clientId});if(y)return y}const u=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(i):await this._getTokenFromIFrame(i),d=u.id_token,f=u.token_type,p=u.access_token,g=u.oauthTokenScope,v=u.expires_in;return Object.assign(Object.assign({id_token:d,token_type:f,access_token:p},g?{scope:g}:null),{expires_in:v})})}catch(u){if(this._isInteractiveError(u)&&this.options.interactiveErrorHandler==="popup")return await this._handleInteractiveErrorWithPopup(i);throw u}}_isInteractiveError(e){return e instanceof GE||e instanceof Qt&&this._isIframeMfaError(e)}_isIframeMfaError(e){return e.error==="login_required"&&e.error_description===mN}async _handleInteractiveErrorWithPopup(e){try{await this.loginWithPopup({authorizationParams:e.authorizationParams});const n=await this._getEntryFromCache({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||Ai,clientId:this.options.clientId});if(!n)throw new Qt("interactive_handler_cache_miss","Token not found in cache after interactive authentication");return n}catch(n){throw n}}async getTokenWithPopup(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var i,r;const o=Object.assign(Object.assign({},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:vp(this.scope,(i=e.authorizationParams)===null||i===void 0?void 0:i.scope,((r=e.authorizationParams)===null||r===void 0?void 0:r.audience)||this.options.authorizationParams.audience)})});return n=Object.assign(Object.assign({},FV),n),await this.loginWithPopup(o,n),(await this.cacheManager.get(new Er({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||Ai,clientId:this.options.clientId}),void 0,this.options.useMrrt)).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(e){e.clientId!==null?e.clientId=e.clientId||this.options.clientId:delete e.clientId;const n=e.logoutParams||{},i=n.federated,r=Mr(n,["federated"]),o=i?"&federated":"";return this._url("/v2/logout?".concat(lg(Object.assign({clientId:e.clientId},r))))+o}async revokeRefreshToken(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.options.useRefreshTokens)return;const n=e.audience||this.options.authorizationParams.audience||Ai,i=await this.cacheManager.getRefreshTokensByAudience(n,this.options.clientId);await(async function(r,o){let l=r.baseUrl,u=r.timeout,d=r.auth0Client,f=r.useFormData,p=r.refreshTokens,g=r.audience,v=r.client_id,y=r.onRefreshTokenRevoked;const b=u||qE,x="refresh_token",S="".concat(l,"/oauth/revoke"),k={"Content-Type":f?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(J
16E(d||VE)))};if(o){const C={client_id:v,token_type_hint:x},A=f?lg(C):JSON.stringify(C);try{return await YE({type:"revoke",timeout:b,fetchUrl:S,fetchOptions:{method:"POST",body:A,headers:k},useFormData:f,auth:{audience:g??Ai}},o)}catch($){throw new Qt("revoke_error",$.message)}}for(const C of p){const A={client_id:v,token_type_hint:x,token:C},$=f?lg(A):JSON.stringify(A),N=await n5(S,{method:"POST",body:$,headers:k},b);if(!N.ok){let j,O;try{var T=JSON.parse(await N.text());j=T.error,O=T.error_description}catch{}throw new Qt(j||"revoke_error",O||"HTTP error ".concat(N.status))}await y?.(C)}})({baseUrl:this.domainUrl,timeout:this.httpTimeoutMs,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,client_id:this.options.clientId,refreshTokens:i,audience:n,onRefreshTokenRevoked:r=>this.cacheManager.stripRefreshToken(r)},this.worker),this.onlineAccess&&await this._clearLocalSession()}async logout(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var n;this.options.enterpriseConnect&&((n=e.logoutParams)===null||n===void 0?void 0:n.federated)!==!0&&console.warn("Enterprise Connect logout without `federated: true` leaves the enterprise IdP session alive; the next login may silently reuse the previous user.");const i=ON(e),r=i.openUrl,o=Mr(i,["openUrl"]);await this._clearLocalSession(e.clientId);const l=this._buildLogoutUrl(o);r?await r(l):r!==!1&&window.location.assign(l)}async _getTokenFromIFrame(e){const n=(i=this.options.clientId,"".concat("auth0.lock.getTokenFromIFrame",".").concat(i));var i;try{return await this.lockManager.runWithLock(n,5e3,async()=>{const r=Object.assign(Object.assign({},e.authorizationParams),{prompt:"none"}),o=this.cookieStorage.get(this.orgHintCookieName);o&&!r.organization&&(r.organization=o);const l=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin),u=l.url,d=l.state,f=l.nonce,p=l.code_verifier,g=l.redirect_uri,v=l.scope,y=l.audience;if(window.crossOriginIsolated)throw new Qt("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const b=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let x;try{x=new URL(this.domainUrl).origin}catch{x=this.domainUrl}const S=await(function(T,C){let A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:60;return new Promise(($,N)=>{const j=window.document.createElement("iframe");j.setAttribute("width","0"),j.setAttribute("height","0"),j.style.display="none";const O=()=>{window.document.body.contains(j)&&(window.document.body.removeChild(j),window.removeEventListener("message",L,!1))};let L;const B=setTimeout(()=>{N(new fw),O()},1e3*A);L=function(V){if(V.origin!=C||!V.data||V.data.type!=="authorization_response")return;const ee=V.source;ee&&ee.close(),V.data.response.error?N(Qt.fromPayload(V.data.response)):$(V.data.response),clearTimeout(B),window.removeEventListener("message",L,!1),setTimeout(O,2e3)},window.addEventListener("message",L,!1),window.document.body.appendChild(j),j.setAttribute("src",T)})})(u,x,b);if(d!==S.state)throw new Qt("state_mismatch","Invalid state");const k=await this._requestToken(Object.assign(Object.assign({},e.authorizationParams),{code_verifier:p,code:S.code,grant_type:"authorization_code",redirect_uri:g,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:f,organization:r.organization});return Object.assign(Object.assign({},k),{scope:v,oauthTokenScope:k.scope,audience:y})})}catch(r){throw r.error==="login_required"&&(r instanceof Qt&&this._isIframeMfaError(r)&&this.options.interactiveErrorHandler==="popup"||this.logout({openUrl:!1})),r}}async _getTokenUsingRefreshToken(e){const n=await this.cacheManager.get(new Er({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||Ai,clientId:this.options.clientId}),void 0,this.options.useMrrt);if(!(n&&n.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw new WL(e.authorizationParams.audience||Ai,e.authorizationParams.scope)}const i=e.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,r=typeof e.timeoutInSeconds=="number"?1e3*e.timeoutInSeconds:null,o=((p,g,v,y)=>{var b;
16if(p&&v&&y){if(g.audience!==v)return g.scope;const x=y.split(" "),S=((b=g.scope)===null||b===void 0?void 0:b.split(" "))||[],k=S.every(T=>x.includes(T));return x.length>=S.length&&k?y:g.scope}return g.scope})(this.options.useMrrt,e.authorizationParams,n?.audience,n?.scope);try{const p=await this._requestToken(Object.assign(Object.assign(Object.assign({},e.authorizationParams),{grant_type:"refresh_token",refresh_token:n&&n.refresh_token,redirect_uri:i}),r&&{timeout:r}),{scopesToRequest:o});if(await this._propagateRotatedRefreshToken(n?.refresh_token,p.refresh_token),this.options.useMrrt&&(l=n?.audience,u=n?.scope,d=e.authorizationParams.audience,f=e.authorizationParams.scope,l!==d||!((g,v)=>{const y=v?.split(" ")||[];return(g?.split(" ")||[]).every(b=>y.includes(b))})(f,u))){const g=TB(o,p.scope,this.onlineAccess);if(g){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw await this.cacheManager.remove(this.options.clientId,e.authorizationParams.audience,e.authorizationParams.scope),new VV(e.authorizationParams.audience||"default",g)}}return Object.assign(Object.assign({},p),{scope:e.authorizationParams.scope,oauthTokenScope:p.scope,audience:e.authorizationParams.audience||Ai})}catch(p){if(p.message){if(p.message.includes("user is blocked"))throw await this.logout({openUrl:!1}),p;if((p.message.includes("Missing Refresh Token")||p.message.includes("invalid refresh token"))&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e)}throw p}var l,u,d,f}async _propagateRotatedRefreshToken(e,n){!this.onlineAccess&&n&&e&&await this.cacheManager.updateEntry(e,n,this.options.clientId,this.options.useMrrt)}async _saveEntryInCache(e){const n=e.decodedToken.claims,i=n.session_expiry,r=n.iat;if(i!==void 0){if(typeof i!="number")throw new Qt("invalid_token","Invalid session_expiry: value must be a number.");if(i>=1e10)throw new Qt("invalid_token","Invalid session_expiry: value appears to be in milliseconds; expected a Unix timestamp in seconds.");if(r===void 0||i<=r)throw new Qt("invalid_token","Invalid session_expiry: session ceiling is before or at the token issue time.")}const o=e.id_token,l=e.decodedToken,u=Mr(e,["id_token","decodedToken"]);this.userCache.set(Yc,{id_token:o,decodedToken:l}),await this.cacheManager.setIdToken(this.options.clientId,e.id_token,e.decodedToken),await this.cacheManager.set(u)}async _clearLocalSession(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.clientId;var n;e===null?await this.cacheManager.clear():await this.cacheManager.clear(e),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove(Yc);try{await((n=this.dpop)===null||n===void 0?void 0:n.clear())}catch{}if(this.worker)try{await YE({type:"clear"},this.worker)}catch{}}async _isSessionCeilingReached(){var e,n;const i=this.userCache.get(Yc),r=i??await this.cacheManager.getIdToken(new Er({clientId:this.options.clientId})),o=(n=(e=r?.decodedToken)===null||e===void 0?void 0:e.claims)===null||n===void 0?void 0:n.session_expiry;if(o===void 0)return!1;const l=await this.nowProvider();return Math.floor(l/1e3)>=o-30&&(await this._clearLocalSession(),!0)}async _getIdTokenFromCache(){const e=this.options.authorizationParams.audience||Ai,n=this.scope[e],i=await this.cacheManager.getIdToken(new Er({clientId:this.options.clientId,audience:e,scope:n})),r=this.userCache.get(Yc);return i&&i.id_token===r?.id_token?r:(this.userCache.set(Yc,i),i)}async _getEntryFromCache(e){let n=e.scope,i=e.audience,r=e.clientId,o=e.cacheMode;const l=await this.cacheManager.get(new Er({scope:n,audience:i,clientId:r}),60,this.options.useMrrt,o);if(l&&l.access_token){const u=l.token_type,d=l.access_token,f=l.oauthTokenScope,p=l.expires_in,g=await this._getIdTokenFromCache();return g&&Object.assign(Object.assign({id_token:g.id_token,token_type:u||"Bearer",access_token:d},f?{scope:f}:null),{expires_in:p})}}_storeMfaContext(e,n,i){e instanceof GE&&this.mfa.setMFAAuthDetail
16s(e.mfa_token,n,i,e.mfa_requirements)}async _requestToken(e,n){var i,r,o,l,u,d;const f=n||{},p=f.nonceIn,g=f.organization,v=f.scopesToRequest;try{const y=await xN(Object.assign(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,useMrrt:this.options.useMrrt,dpop:this.dpop,preserveRefreshToken:this.onlineAccess},e),{scope:v||e.scope}),this.worker);let b=await this._verifyIdToken(y.id_token,p,g);if(e.grant_type==="authorization_code"){const x=await this._getIdTokenFromCache();!((r=(i=x?.decodedToken)===null||i===void 0?void 0:i.claims)===null||r===void 0)&&r.sub&&x.decodedToken.claims.sub!==b.claims.sub&&(await this.cacheManager.clear(this.options.clientId),this.userCache.remove(Yc))}if(e.grant_type!=="authorization_code"){const x=await this._getIdTokenFromCache(),S=(l=(o=x?.decodedToken)===null||o===void 0?void 0:o.claims)===null||l===void 0?void 0:l.session_expiry;S!==void 0&&(b=Object.assign(Object.assign({},b),{claims:Object.assign(Object.assign({},b.claims),{session_expiry:S})}))}return!y.refresh_token&&this.onlineAccess&&(y.refresh_token=(u=e.refresh_token)!==null&&u!==void 0?u:(d=await this.cacheManager.get(new Er({scope:v||e.scope,audience:e.audience||Ai,clientId:this.options.clientId}),void 0,this.options.useMrrt))===null||d===void 0?void 0:d.refresh_token),await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},y),{decodedToken:b,scope:e.scope,audience:e.audience||Ai}),y.scope?{oauthTokenScope:y.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(g||b.claims.org_id),Object.assign(Object.assign({},y),{decodedToken:b})}catch(y){throw e.grant_type!=="authorization_code"&&this._storeMfaContext(y,v||e.scope,e.audie
16nce),y}}_buildTokenExchangeParams(e){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e),{grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",subject_token:e.subject_token,subject_token_type:e.subject_token_type}),e.actor_token&&{actor_token:e.actor_token}),e.actor_token_type&&{actor_token_type:e.actor_token_type}),{scope:vp(this.scope,e.scope,e.audience||this.options.authorizationParams.audience),audience:e.audience||this.options.authorizationParams.audience,organization:e.organization||this.options.authorizationParams.organization})}async loginWithCustomTokenExchange(e){return this._requestToken(this._buildTokenExchangeParams(e))}async customTokenExchange(e){const n=this._buildTokenExchangeParams(e);try{const i=await xN(Object.assign(Object.assign({},n),{baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,dpop:this.dpop}),this.worker,!0);return i.id_token&&await this._verifyIdToken(i.id_token,void 0,e.organization),i}catch(i){throw this._storeMfaContext(i,n.scope,n.audience),i}}async exchangeToken(e){return this.loginWithCustomTokenExchange(e)}_assertDpop(e){if(!e)throw new Error("`useDpop` option must be enabled before using DPoP.")}getDpopNonce(e){return this._assertDpop(this.dpop),this.dpop.getNonce(e)}setDpopNonce(e,n){return this._assertDpop(this.dpop),this.dpop.setNonce(e,n)}generateDpopProof(e){return this._assertDpop(this.dpop),this.dpop.generateProof(e)}createFetcher(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new RB(e,{isDpopEnabled:()=>!!this.options.useDpop,getAccessToken:n=>{var i;return this.getTokenSilently({authorizationParams:{scope:(i=n?.scope)===null||i===void 0?void 0:i.join(" "),audience:n?.audience},detailedResponse:!0})},getDpopNonce:()=>this.getDpopNonce(e.dpopNonceId),setDpopNonce:n=>this.setDpopNonce(n,e.dpopNonceId),generateDpopProof:n=>this.generateDpopProof(n)})}async connectAccountWithRedirect(e){const n=e.openUrl,i=e.appState,r=e.connection,o=e.scopes,l=e.authorization_params,u=e.redirectUri,d=u===void 0?this.options.authorizationParams.redirect_uri||window.location.origin:u;if(!r)throw new Error("connection is required");const f=Ik(gp()),p=gp(),g=await yN(p),v=bN(g),y=await this.myAccount.connectAccount({connection:r,scopes:o,redirect_uri:d,state:f,code_challenge:v,code_challenge_method:"S256",authorization_params:l}),b=y.connect_uri,x=y.connect_params,S=y.auth_session;this.transactionManager.create({state:f,code_verifier:p,auth_session:S,redirect_uri:d,appState:i,connection:r,response_type:Vl.ConnectCode});const k=new URL(b);k.searchParams.set("ticket",x.ticket),n?await n(k.toString()):window.location.assign(k)}async _requestTokenForPasskey(e){const n=e.audience||this.options.authorizationParams.audience,i=e.organization||this.options.authorizationParams.organization;return this._requestToken(Object.assign(Object.assign(Object.assign({grant_type:"urn:okta:params:oauth:grant-type:webauthn",auth_session:e.authSession,authn_response:e.credential},e.realm&&{realm:e.realm}),i&&{organization:i}),{scope:vp(this.scope,e.scope,n),audience:n}))}async _requestTokenForMfa(e,n){const i=e.mfaToken,r=Mr(e,["mfaToken"]),o=await this.cacheManager.get(new Er({scope:r.scope,audience:r.audience||Ai,clientId:this.options.clientId}),void 0,this.options.useMrrt),l=await this._requestToken(Object.assign(Object.assign({},r),{mfa_token:i}),n);return await this._propagateRotatedRefreshToken(o?.refresh_token,l.refresh_token),l}};var b4={isAuthenticated:!1,isLoading:!0,error:void 0,user:void 0},Ct=function(){throw new Error("You forgot to wrap your component in <Auth0Provider>.")},_J=Pi(Pi({},b4),{buildAuthorizeUrl:Ct,buildLogoutUrl:Ct,getAccessTokenSilently:Ct,getAccessTokenWithPopup:Ct,getIdTokenClaims:Ct,loginWithCustomTokenExchange:Ct,customTokenExchange:Ct,exchangeToken:Ct,loginWithRedirect:Ct,loginWithPopup:Ct,connectAccountWithRedirect:Ct,logout:Ct,revokeRefreshToken:Ct,handleRedirectCallback:Ct,getDpopNonce:Ct,setDpopNonce:Ct,generateDpopProof:Ct,createFetcher:Ct,getConfiguration:Ct,mfa:{getAuthenticators:Ct,enroll:Ct,challenge:Ct,verify:Ct,getEnrollmentFactors:Ct},passkey:{signup:Ct,login:Ct},myAccount:{getFactors:Ct,getAuthenticationMethods:Ct,getAuthenticationMethod:Ct,updateAuthenticationMethod:Ct,deleteAuthenticationMethod:Ct,enrollmentChallenge:Ct,enrollmentVerify:Ct},anonymous:{createSession:Ct,getTokenSilently:Ct,logout:Ct,hasSession:Ct,getClaims:Ct}}),w4=M.createContext(_J),CM=(function(t){DV(e,t);function e(n,i){var r=t.call(this,i??n)||this;return r.error=n,r.error_description=i,Object.setPrototypeOf(r,e.prototype),r}return e})(Error),bJ=/[?&](?:connect_)?code=[^&]+/,wJ=/[?&]state=[^&]+/,xJ=/[?&]error=[^&]+/,SJ=function(t){return t===void 0&&(t=window.location.search),(bJ.test(t)||xJ.test(t))&&wJ.test(t)},x4=function(t){return function(e){if(e instanceof Error)return e;if(e!==null&&typeof e=="object"&&"error"in e&&typeof e.error=="string"){if("error_description"in e&&typeof e.error_description=="str
16ing"){var n=e;return new CM(n.error,n.error_description)}var i=e;return new CM(i.error)}return new Error(t)}},OM=x4("Login failed"),Fd=x4("Get access token failed"),S4=function(t){var e,n;t?.redirectUri&&(console.warn("Using `redirectUri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `redirectUri` will be no longer supported in a future version"),t.authorizationParams=(e=t.authorizationParams)!==null&&e!==void 0?e:{},t.authorizationParams.redirect_uri=t.redirectUri,delete t.redirectUri),!((n=t?.authorizationParams)===null||n===void 0)&&n.redirectUri&&(console.warn("Using `authorizationParams.redirectUri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `authorizationParams.redirectUri` will be removed in a future version"),t.authorizationParams.redirect_uri=t.authorizationParams.redirectUri,delete t.authorizationParams.redirectUri)},kJ=function(t,e){switch(e.type){case"LOGIN_POPUP_STARTED":return Pi(Pi({},t),{isLoading:!0});case"LOGIN_POPUP_COMPLETE":case"INITIALISED":return Pi(Pi({},t),{isAuthenticated:!!e.user,user:e.user,isLoading:!1,error:void 0});case"HANDLE_REDIRECT_COMPLETE":case"GET_ACCESS_TOKEN_COMPLETE":case"SYNC_USER":return t.user===e.user?t:Pi(Pi({},t),{isAuthenticated:!!e.user,user:e.user});case"LOGOUT":return Pi(Pi({},t),{isAuthenticated:!1,user:void 0});case"ERROR":return Pi(Pi({},t),{isLoading:!1,error:e.error})}},EJ=function(t){return S4(t),Pi(Pi({},t),{auth0Client:{name:"auth0-react",version:"2.27.0"}})},TJ=function(t){var e;window.history.replaceState({},document.title,(e=t.returnTo)!==null&&e!==void 0?e:window.location.pathname)},RM=function(){var t,e,n=new Promise(function(i,r){t=i,e=r});return n.catch(function(){}),{promise:n,resolve:t,reject:e}},CJ=function(t){var e=t,n=e.children,i=e.skipRedirectCallback,r=e.onRedirectCallback,o=r===void 0?TJ:r,l=e.context,u=l===void 0?w4:l,d=e.client,f=uN(e,["children","skipRedirectCallback","onRedirectCallback","context","client"]);d&&(f.domain||f.clientId)&&console.warn("Auth0Provider: the `client` prop takes precedence over `domain`/`clientId` and other configuration options. Remove `domain`, `clientId`, and any other Auth0Client configuration props when using the `client` prop.");var p=M.useState(function(){return d??new yJ(EJ(f))})[0],g=M.useReducer(kJ,b4),v=g[0],y=g[1],b=M.useState(RM),x=b[0],S=b[1],k=M.useState(!1),T=k[0],C=k[1],A=M.useRef(!1),$=M.useRef(!1),N=M.useCallback(function(oe){return y({type:"ERROR",error:oe}),oe},[]),j=M.useCallback(function(oe,je){return io(void 0,void 0,void 0,function(){var $e,Le,Pe,ze,Ge,vt,en,yt;return ro(this,function(Kt){switch(Kt.label){case 0:return Kt.trys.push([0,7,,8]),$e=void 0,je&&SJ()&&!i?[4,p.handleRedirectCallback()]:[3,3];case 1:return Le=Kt.sent(),Pe=Le.appState,ze=Pe===void 0?{}:Pe,Ge=Le.response_type,vt=uN(Le,["appState","response_type"]),[4,p.getUser()];case 2:return $e=Kt.sent(),ze.response_type=Ge,Ge===Vl.ConnectCode&&(ze.connectedAccount=vt),o(ze,$e),[3,6];case 3:return[4,p.checkSession()];case 4:return Kt.sent(),[4,p.getUser()];case 5:$e=Kt.sent(),Kt.label=6;case 6:return y({type:"INITIALISED",user:$e}),oe.resolve(),[3,8];case 7:return en=Kt.sent(),yt=OM(en),N(yt),C(!0),oe.reject(yt),[3,8];case 8:return[2]}})})},[p,o,i,N]);M.useEffect(function(){$.current||($.current=!0,j(x,!0))},[j,x]),M.useEffect(function(){if(!(!T||A.current||!v.isAuthenticated)){A.current=!0;var oe=RM();S(oe),j(oe,!1)}},[T,v.isAuthenticated,j]);var O=M.useCallback(function(oe){return S4(oe),p.loginWithRedirect(oe)},[p]),L=M.useCallback(function(oe,je){return io(void 0,void 0,void 0,function(){var $e,Le;return ro(this,function(Pe){switch(Pe.label){case 0:y({type:"LOGIN_POPUP_STARTED"}),Pe.label=1;case 1:return Pe.trys.push([1,3,,4]),[4,p.loginWithPopup(oe,je)];case 2:return Pe.sent(),[3,4];case 3:return $e=Pe.sent(),N(OM($e)),[2];case 4:return[4,p.getUser()];case 5:return Le=Pe.sent(),y({type:"LOGIN_POPUP_COMPLETE",user:Le}),[2]}})})},[p,N]),B=M.useCallback(function(){for(var oe=[],je=0;je<arguments.length;je++)oe[je]=arguments[je];return io(void 0,LV([],oe),void 0,function($e){return $e===void 0&&($e={}),ro(this,function(Le){switch(Le.label){case 0:return[4,p.logout($e)];case 1:return Le.sent(),($e.openUrl||$e.openUrl===!1)&&y({type:"LOGOUT"}),[2]}})})},[p]),V=M.useCallback(function(oe){return io(void 0,void 0,void 0,function(){var je,$e;return ro(this,function(Le){switch(Le.label){case 0:return Le.trys.push([0,,2,4]),[4,p.revokeRefreshToken(oe)];case 1:return Le.sent(),[3,4];case 2:return je=y,$e={type:"SYNC_USER"},[4,p.getUser()];case 3:return je.apply(void 0,[($e.user=Le.sent(),$e)]),[7];case 4:return[2]}})})},[p]),ee=M.useCallback(function(oe){return io(void 0,void 0,void 0,function(){var je,$e,Le,Pe;return ro(this,function(ze){switch(ze.label){case 0:return ze.trys.push([0,2,3,5]),[4,p.getTokenSilently(oe)];case 1:return je=ze.sent(),[3,5];case 2:throw $e=ze.sent(),Fd($e);case 3:return Le=y,Pe={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,p.getUser()];case 4:return Le.apply(void 0,[(Pe.user=ze.sent(),Pe)]),[7];case 5:return[2,je]}})})},[p]),me=M.useCallback(function(oe,je){return io(void 0,void 0,void 0,function(){var $e,Le,Pe,ze;return ro(this,function(Ge){switch(Ge.label){case 0:return Ge.trys.push([0,2,3,5]),[4,p.getTokenWithPopup(oe,je)];case 1:return $e=Ge.sent(),[3,5];case 2:throw Le=Ge.sent(),Fd(Le);case 3:return Pe=y,ze={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,p.getUser()];case 4:return Pe.apply(void 0,[(ze.user=Ge.sent(),ze)]),[7];case 5:return[2,$e]}})})},[p]),ne=M.useCallback(function(oe){return p.connectAccountWithRedirect(oe)},[p]),ce=M.useCallback(function(){return p.getIdTokenClaims()},[p]),Z=M.useCallback(function(oe){return io(void 0,void 0,void 0,function(){var je,$e,Le,Pe;return ro(this,function(ze){switch(ze.label){case 0:return ze.trys.push([0,2,3,5]),[4,p.loginWithCustomTokenExchange(oe)];case 1:return je=ze.sent(),[3,5];case 2:throw $e=ze.sent(),Fd($e);case 3:return Le=y,Pe={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,p.getUser()];case 4:return Le.apply(void 0,[(Pe.user=ze.sent(),Pe)]),[7];case 5:return[2,je]}})})},[p]),ae=M.useCallback(function(oe){return p.customTokenExchange(oe)},[p]),ue=M.useCallback(function(oe){return io(void 0,void 0,void 0,function(){return ro(this,function(je){return[2,Z(oe)]})})},[Z]),ge=M.useCallback(function(oe){return io(void 0,void 0,void 0,function(){var je,$e,Le;return ro(this,function(Pe){switch(Pe.label){case 0:return Pe.trys.push([0,2,3,5]),[4,p.handleRedirectCallback(oe)];case 1:return[2,Pe.sent()];case 2:throw je=Pe.sent(),Fd(je);case 3:return $e=y,Le={type:"HANDLE_REDIRECT_COMPLETE"},[4,p.getUser()];case 4:return $e.apply(void 0,[(Le.user=Pe.sent(),Le)]),[7];case 5:return[2]}})})},[p]),Re=M.useCallback(function(oe){return p.getDpopNonce(oe)},[p]),xe=M.useCallback(function(oe,je){return p.setDpopNonce(oe,je)},[p]),Ie=M.useCallback(function(oe){return p.generateDpopProof(oe)},[p]),Oe=M.useCallback(function(oe){return p.createFetcher(oe)},[p]),P=M.useCallback(function(){return p.getConfiguration()},[p]),F=M.useMemo(function(){return p.mfa},[p]),re=M.useMemo(function(){return p.myAccount},[p]),Y=M.useMemo(function(){return p.anonymous}
16,[p]),de=M.useCallback(function(oe){return io(void 0,void 0,void 0,function(){var je,$e,Le,Pe;return ro(this,function(ze){switch(ze.label){case 0:return ze.trys.push([0,2,3,5]),[4,p.passkey.signup(oe)];case 1:return je=ze.sent(),[3,5];case 2:throw $e=ze.sent(),Fd($e);case 3:return Le=y,Pe={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,p.getUser()];case 4:return Le.apply(void 0,[(Pe.user=ze.sent(),Pe)]),[7];case 5:return[2,je]}})})},[p]),ke=M.useCallback(function(oe){return io(void 0,void 0,void 0,function(){var je,$e,Le,Pe;return ro(this,function(ze){switch(ze.label){case 0:return ze.trys.push([0,2,3,5]),[4,p.passkey.login(oe)];case 1:return je=ze.sent(),[3,5];case 2:throw $e=ze.sent(),Fd($e);case 3:return Le=y,Pe={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,p.getUser()];case 4:return Le.apply(void 0,[(Pe.user=ze.sent(),Pe)]),[7];case 5:return[2,je]}})})},[p]),Ae=M.useMemo(function(){return{signup:de,login:ke}},[de,ke]),Se=M.useMemo(function(){return Pi(Pi({},v),{getAccessTokenSilently:ee,getAccessTokenWithPopup:me,getIdTokenClaims:ce,loginWithCustomTokenExchange:Z,customTokenExchange:ae,exchangeToken:ue,loginWithRedirect:O,loginWithPopup:L,connectAccountWithRedirect:ne,logout:B,revokeRefreshToken:V,handleRedirectCallback:ge,getDpopNonce:Re,setDpopNonce:xe,generateDpopProof:Ie,createFetcher:Oe,getConfiguration:P,mfa:F,passkey:Ae,myAccount:re,anonymous:Y,_initPromise:x.promise})},[v,ee,me,ce,Z,ae,ue,O,L,ne,B,V,ge,Re,xe,Ie,Oe,P,F,Ae,re,Y,x]);return Na.createElement(u.Provider,{value:Se},n)},OJ=function(t){return t===void 0&&(t=w4),M.useContext(t)};const G="u">typeof window?window:void 0,ar="u">typeof globalThis?globalThis:G,mi=ar?.navigator,he=ar?.document,Cn=ar?.location,pm=ar?.fetch,DC=ar?.XMLHttpRequest&&"withCredentials"in new ar.XMLHttpRequest?ar.XMLHttpRequest:void 0,$M=ar?.AbortController,RJ=ar?.CompressionStream,kr=mi?.userAgent;function k4(){return!(!G||G.navigator.onLine===!1)}const $p=typeof globalThis<"u"?globalThis:G;$p&&typeof self>"u"&&($p.self=$p),$p&&typeof File>"u"&&($p.File=function(){});const qe=G??{},$J="0.9.0",La={DEBUG:!1,LIB_VERSION:$J,LIB_NAME:"browser-common"};var Vo=(function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.AiCaptureQueue="ai_capture_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.PushRegistered="push_registered",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysInProgress="surveys_in_progress",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t})({}),kT=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});const AJ=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],jJ=["token"];function Qe(t,e){return t.indexOf(e)!==-1}const Sw=function(t){return t.trim()},ET=function(t){return t.replace(/^\$/,"")};function E4(t){var e;const n=[];return(e=JSON.stringify(t,function(i,r){if(typeof r=="bigint")return r.toString();if(typeof r!="function"&&typeof r!="symbol"){if(r instanceof Error)return{name:r.name,message:r.message,stack:r.stack};if(r&&typeof r=="object"){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(r))return"[Circular]";n.push(r)}return r}}))!==null&&e!==void 0?e:"null"}const T4=Object.prototype,LC=T4.hasOwnProperty,kw=T4.toString,Je=Array.isArray||function(t){return kw.call(t)==="[object Array]"},pi=t=>typeof t=="function",xt=t=>t===Object(t)&&!Je(t),zr=t=>{if(xt(t)){for(const e in t)if(LC.call(t,e))return!1;return!0}return!1},le=t=>t===void 0,mt=t=>kw.call(t)=="[object String]",Ig=t=>mt(t)&&t.trim().length===0,On=t=>t===null,it=t=>le(t)||On(t),Fn=t=>kw.call(t)=="[object Number]"&&t==t,Ra=t=>Fn(t)&&t>0,Or=t=>kw.call(t)==="[object Boolean]",PJ=t=>Qe(AJ,t),NJ=t=>Qe(jJ,t);function C4(t){return t===null||typeof t!="object"}function db(t,e){return{}.toString.call(t)===`[object ${e}]`}function df(t){switch({}
vendor: 7,643 bytes, line 16
16.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return O4(t,Error)}}function UC(t){return"u">typeof Event&&O4(t,Event)}function O4(t,e){try{return t instanceof e}catch{return!1}}const MJ=[!0,"true",1,"1","yes"],d1=t=>Qe(MJ,t),IJ=[!1,"false",0,"0","no"];function AM(t,e,n,i,r,o,l){try{var u=t[o](l),d=u.value}catch(f){return void n(f)}u.done?e(d):Promise.resolve(d).then(i,r)}function _n(t){return function(){var e=this,n=arguments;return new Promise(function(i,r){var o=t.apply(e,n);function l(d){AM(o,i,r,l,u,"next",d)}function u(d){AM(o,i,r,l,u,"throw",d)}l(void 0)})}}const zJ=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],jM=function(t,e=[]){if(!t)return!1;const n=t.toLowerCase();return zJ.concat(e).some(i=>{const r=i.toLowerCase();return n.indexOf(r)!==-1})};function Jo(t,e,n,i,r){return e>n&&(i.warn("min cannot be greater than max."),e=n),Fn(t)?t>n?(i.warn(" cannot be  greater than max: "+n+". Using max value instead."),n):e>t?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+r),Jo(r??n,e,n,i))}var DJ=class{constructor(e){this.C={},this.I=e.I,this.R=Jo(e.bucketSize,0,100,e.$),this.A=Jo(e.refillRate,0,this.R,e.$),this.O=Jo(e.refillInterval,0,864e5,e.$)}F(e,n){const i=Math.floor((n-e.lastAccess)/this.O);i>0&&(e.tokens=Math.min(e.tokens+i*this.A,this.R),e.lastAccess=e.lastAccess+i*this.O)}consumeRateLimit(e){var n;const i=Date.now(),r=String(e);let o=this.C[r];return o?this.F(o,i):(o={tokens:this.R,lastAccess:i},this.C[r]=o),o.tokens===0||(o.tokens--,o.tokens===0&&((n=this.I)===null||n===void 0||n.call(this,e)),o.tokens===0)}stop(){this.C={}}};const Vh="Mobile",gm="Android",hb="Tablet",R4="Android Tablet",$4="iPad",A4="Apple Watch",__="Safari",Ew="BlackBerry",j4="Samsung Internet",b_="Chrome",P4="Chrome iOS",N4="Internet Explorer",M4="Internet Explorer Mobile",I4="Opera",z4="Microsoft Edge",w_="Firefox",D4="Firefox iOS",fb="Nintendo",pb="PlayStation",Tw="Xbox",L4="Android Mobile",U4="Mobile Safari",h1="Windows",F4="Windows Phone",PM="Nokia",TT="Ouya",LJ="Generic "+Vh.toLowerCase(),H4="Generic "+hb.toLowerCase(),CT="Konqueror",K4="Oculus Browser",Z4="Vivaldi",W4="Yandex",q4="Whale",V4="DuckDuckGo",B4="Pale Moon",G4="Waterfox",OT="Brave",J4="Claude",X4="Codex",Y4="ChatGPT",Q4="Google Search App",f1=new RegExp("Version/(\\d+(\\.\\d+)?)"),p1=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),UJ=new RegExp(Tw,"i"),FJ=new RegExp("PlayStation \\w+","i"),HJ=new RegExp("Nintendo \\w+","i"),FC=new RegExp("BlackBerry|PlayBook|BB10","i"),KJ={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},eU=function(t,e,n,i){return e=e||"",(function(o){return o?.brave?OT:null})(n)||(i?.detectGoogleSearchApp&&Qe(t,"GSA/")?Q4:Qe(t," OPR/")&&Qe(t,"Mini")?"Opera Mini":Qe(t," OPR/")?I4:FC.test(t)?Ew:Qe(t,"IEMobile")||Qe(t,"WPDesktop")?M4:Qe(t,"OculusBrowser")?K4:Qe(t,"SamsungBrowser")?j4:Qe(t,"Edge")||Qe(t,"Edg/")?z4:Qe(t,"Vivaldi/")?Z4:Qe(t,"YaBrowser/")?W4:Qe(t,"Whale/")?q4:Qe(t,"DuckDuckGo/")||Qe(t,"Ddg/")?V4:Qe(t,"Claude/")?J4:Qe(t,"Codex/")?X4:Qe(t,"ChatGPT/")?Y4:Qe(t,"FBIOS")?"Facebook Mobile":Qe(t,"UCWEB")||Qe(t,"UCBrowser")?"UC Browser":Qe(t,"CriOS")?P4:Qe(t,"CrMo")||Qe(t,b_)?b_:Qe(t,gm)&&Qe(t,__)?L4:Qe(t,"FxiOS")?D4:Qe(t.toLowerCase(),CT.toLowerCase())?CT:Qe(t,"Brave/")?OT:((o,l)=>l&&Qe(l,"Apple")||(function(u){return Qe(u,__)&&!Qe(u,b_)&&!Qe(u,gm)})(o))(t,e)?Qe(t,Vh)?U4:__:Qe(t,"PaleMoon/")?B4:Qe(t,"Waterfox/")?G4:Qe(t,w_)?w_:Qe(t,"MSIE")||Qe(t,"Trident/")?N4:Qe(t,"Gecko")?w_:"")},ZJ={[M4]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[z4]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[b_]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[P4]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[__]:[f1],[U4]:[f1],[I4]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[w_]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[D4]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[CT]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[Ew]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),f1],[L4]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[j4]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[K4]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[Z4]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[W4]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[q4]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[OT]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[J4]:[p1],[X4]:[p1],[Y4]:[p1],[V4]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[B4]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[G4]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[Q4]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[N4]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},WJ=function(t,e,n,i){const r=eU(t,e,n,i),o=ZJ[r];if(le(o))return null;for(let l=0;o.length>l;l++){const u=t.match(o[l]);if(u)return parseFloat(u[u.length-2])}return null},NM=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),t=>[Tw,t&&t[1]||""]],[new RegExp(fb,"i"),[fb,""]],[new RegExp(pb,"i"),[pb,""]],[FC,[Ew,""]],[new RegExp(h1,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[F4,""];if(new RegExp(Vh).test(e)&&!/IEMobile\b/.test(e))return["Windows Mobile",""];const n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){let i=KJ[n[1]]||"";return/arm/i.test(e)&&(i="RT"),[h1,i]}return[h1,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?["iOS",[t[3],t[4],t[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{let e="";return t&&t.length>=3&&(e=le(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),t=>t&&t[2]?[gm,[t[2],t[3],t[4]||"0"].join(".")]:[gm,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{const e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],tU=function(t){for(let e=0;NM.length>e;e++){const[n,i]=NM[e],r=n.exec(t),o=r&&(pi(i)?i(r,t):i);if(o)return o}return["",""]},nU=function(t){return HJ.test(t)?fb:FJ.test(t)?pb:UJ.test(t)?Tw:new RegExp(TT,"i").test(t)?TT:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?F4:/iPad/.test(t)?$4:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?A4:FC.test(t)?Ew:/(kobo)\s(ereader|touch)/i.test(t)?"K
16obo":new RegExp(PM,"i").test(t)?PM:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(Vh).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?gm:R4:new RegExp("(pda|Mobile)","i").test(t)?LJ:new RegExp(hb,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?H4:""},qJ=function(t,e){var n;const i=nU(t);return i===$4||i===R4||i==="Kobo"||i==="Kindle Fire"||i===H4?hb:i===fb||i===Tw||i===pb||i===TT?"Console":i===A4?"Wearable":i?Vh:e?.userAgentDataPlatform==="Android"&&((n=e?.maxTouchPoints)!==null&&n!==void 0?n:0)>0?600>Math.min((r=e?.screenWidth)!==null&&r!==void 0?r:0,(o=e?.screenHeight)!==null&&o!==void 0?o:0)/((l=e?.devicePixelRatio)!==null&&l!==void 0?l:1)?Vh:hb:"Desktop";var r,o,l},g1=/\bFBAV\/(\d+(?:\.\d+)*)/i,MM=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",g1],[/\bFBAN\/EMA\b/i,"Facebook Lite",g1],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",g1],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],RT="[Truncated]",iv="[Unserializable]";function Nh(t){let e="";for(let n=0;t.length>n;n++){const i=t.charCodeAt(n);if(55296>i||i>56319)e+=56320>i||i>57343?t[n]:"�";else{const r=t.charCodeAt(n+1);56320>r||r>57343?e+="�":(e+=t[n]+t[n+1],n++)}}return e}function iU(t,e){if(!e)return t;let n=[];try{n=Object.keys(e)}catch{n=[]}for(const i of n){let r;try{r=e[i]}catch{r=iv}Object.defineProperty(t,i,{value:r,enumerable:!0,writable:!0,configurable:!0})}return t}const x_=3e5;var rU=class{record(e){if(e.kind==="too-large")return;if(e.kind!=="retry-later")return void this.reset();if(!e.retryAfterMs)return;const n=this.isOpen(),i=Date.now(),r=Math.min(e.retryAfterMs,x_);if(!n)return this.ts=i,void(this.es=i+r);this.es=Math.max(this.es,Math.min(i+r,this.ts+x_))}remainingMs(){const e=Date.now();if(this.ts-5e3>e)return this.reset(),0;const n=Math.min(x_,Math.max(0,this.es-e));return n===0&&this.reset(),n}isOpen(){return this.remainingMs()>0}reset(){this.es=0,this.ts=0}constructor(){this.es=0,this.ts=0}};const VJ=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function IM(t,e){return typeof(n=t)=="string"&&VJ.test(n)?t:e();var n}function sU(t,e){const n=new Error(e);try{Object.defineProperty(n,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch{}return n}function cc(t){return t&&t.split("#")[0]}function zM(t){try{return t()}catch{return}}function oU(t,e){const n=setTimeout(t,e);return n!=null&&n.unref&&n?.unref(),n}function DM(t,e,n){return aU.apply(this,arguments)}function aU(){return(aU=_n(function*(t,e,n){let i;try{return yield Promise.race([t,new Promise((r,o)=>{i=oU(()=>{try{n?.(),r()}catch(l){o(l)}},e)})])}finally{clearTimeout(i)}})).apply(this,arguments)}let u0,LM,m1;function BJ(t){const e=globalThis._posthogChunkIds;if(!e)return;const n=Object.keys(e);return m1&&n.length===LM||(LM=n.length,m1=n.reduce((i,r)=>{u0||(u0={});const o=u0[r];if(o)i[o[0]]=o[1];else{const l=t(r);for(let u=l.length-1;u>=0;u--){const d=l[u],f=d?.filename,p=e[r];if(f&&p){i[f]=p,u0[r]=[f,p];break}}}return i},{})),m1}function zg(t){return zg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zg(t)}
16function GJ(t,e,n){return(e=(function(i){var r=(function(o){if(zg(o)!="object"||!o)return o;var l=o[Symbol.toPrimitive];if(l!==void 0){var u=l.call(o,"string");if(zg(u)!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(o)})(i);return zg(r)=="symbol"?r:r+""})(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function UM(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function z(t){for(var e=1;arguments.length>e;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?UM(Object(n),!0).forEach(function(i){GJ(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):UM(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}var JJ=class{constructor(e,n,i=[]){this.coercers=e,this.stackParser=n,this.modifiers=i}buildFromUnknown(e,n={}){const i=n&&n.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,n,0).apply(e),o=this.buildParsingContext(n),l=this.parseStacktrace(r,o);return{$exception_list:this.convertToExceptionList(l,i),$exception_level:"error"}}modifyFrames(e){var n=this;return _n(function*(){for(const i of e)i.stacktrace&&i.stacktrace.frames&&Je(i.stacktrace.frames)&&(i.stacktrace.frames=yield n.applyModifiers(i.stacktrace.frames));return e})()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var i;let r,o;if(e.cause!=null&&(r=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null)try{o=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?n.skipFirstLines:0),n.chunkIdMap)}catch{}return z(z({},e),{},{cause:r,stack:o,errors:(i=e.errors)===null||i===void 0?void 0:i.map(l=>this.parseStacktrace(l,n))})}applyChunkIds(e,n){return e.map(i=>(i.filename&&n&&(i.chunk_id=n[i.filename]),i))}applyCoercers(e,n){for(const i of this.coercers)if(i.match(e))return i.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return _n(function*(){let i=e;for(const r of n.modifiers)i=yield r(i);return i})()}convertToExceptionList(e,n){const i=[],r=(o,l,u)=>{var d;const f=i.length,p=l===void 0?z(z({type:typeof n.type=="string"&&n.type.length>0?n.type:"generic"},typeof n.handled=="boolean"?{handled:n.handled}:n.handled===void 0?{handled:!0}:{}),{},{synthetic:typeof n.synthetic=="boolean"?n.synthetic:o.synthetic,exception_id:f}):{type:"chained",source:u,synthetic:o.synthetic,exception_id:f,parent_id:l},g={type:o.type,value:o.value,mechanism:p};o.stack&&(g.stacktrace={type:"raw",frames:o.stack}),i.push(g),o.cause&&r(o.cause,f,"cause");for(const v of(d=o.errors)!==null&&d!==void 0?d:[])r(v,f,"member")};return r(e),i}buildParsingContext(e){var n;return{chunkIdMap:BJ(this.stackParser),skipFirstLines:(n=e.skipFirstLines)!==null&&n!==void 0?n:1}}getAggregateErrors(e){try{if(df(e)){let i=Object.getPrototypeOf(e);for(let r=0;i&&100>r;r++){var n;const o=(n=Object.getOwnPropertyDescriptor(i,"constructor"))===null||n===void 0?void 0:n.value;if(typeof o=="function"&&o.name==="AggregateError"){const l=e.errors;return Je(l)?l:void 0}i=Object.getPrototypeOf(i)}}}catch{}}buildCoercingContext(e,n,i=0){let r=0,o=0,l=!1;const u=new Set,d=[],f={},p=(y,b,x=0)=>{const S=g(b,x),k=S.apply;if(S.apply=j=>{d.push(y);try{return k(j)}finally{d.pop()}},x>4||x>0&&d.indexOf(y)!==-1)return this.coerceFallback(S);const T=typeof y=="object"&&y!==null||typeof y=="function";if(x===0&&r>=50||T&&u.has(y))return;T&&u.add(y),x===0&&r++;const C=this.getAggregateErrors(y);let A,$;l||(l=!!C);try{if(A=this.applyCoercers(y,S),!A)throw f}catch(j){if(j===f)return void(x===0&&r--);if(!l)throw j;A=this.coerceFallback(S)}if(!C||r>=50)return A;try{$=C.length}catch{return A}if(!Number.isInteger($)||0>$||$>4294967295)return A;const N=[];for(let j=0;50>r&&1e3>o&&$>j;j++){let O;o++;try{O=S.next(C[j])}catch{r++,O=this.coerceFallback(g(b+1))}O&&N.push(O)}return z(z({},A),{},{errors:N})},g=(y,b=0)=>z(z({},n),{},{syntheticException:y==0?n.syntheticException:void 0,mechanism:y==0?e:{},apply(x){const S=p(x,y,b+1);if(!S)throw f;return S},next:x=>p(x,y+1)}),v=g(i);return z(z({},v),{},{apply:y=>{var b;return(b=p(y,i))!==null&&b!==void 0?b:this.coerceFallback(v)}})}};const XJ=/^([a-z][a-z0-9.+-]+):/i,YJ=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function QJ(t){if(!t||t==="<anonymous>")return!1;const e=XJ.exec(t);return!e||YJ.includes(e[1].toLowerCase())}function $T(t,e,n,i,r){const o={platform:t,filename:e,function:n==="<anonymous>"?"?":n,in_app:QJ(e)};return le(i)||(o.lineno=i),le(r)||(o.colno=r),o}const lU=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,i=t.indexOf("safari-web-extension")!==-1;return n||i?[t.indexOf("@")!==-1?t.split("@")[0]:"?",n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]}
16,eX=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tX=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,nX=/\((\S*)(?::(\d+))(?::(\d+))\)/,iX=(t,e)=>{const n=eX.exec(t);if(n){const[,r,o,l]=n;return $T(e,r,"?",+o,+l)}const i=tX.exec(t);if(i){if(i[2]&&i[2].indexOf("eval")===0){const l=nX.exec(i[2]);l&&(i[2]=l[1],i[3]=l[2],i[4]=l[3])}const[r,o]=lU(i[1]||"?",i[2]);return $T(e,o,r,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},rX=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,sX=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,oX=(t,e)=>{const n=rX.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const o=sX.exec(n[3]);o&&(n[1]=n[1]||"eval",n[3]=o[1],n[4]=o[2],n[5]="")}let i=n[3],r=n[1]||"?";return[r,i]=lU(r,i),$T(e,i,r,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},FM=/\(error: (.*)\)/;function HC(t,e){return t.filename===e.filename&&t.function===e.function&&t.module===e.module&&t.lineno===e.lineno&&t.colno===e.colno}function aX(t){for(let e=1;10>=e;e++){const n=t.length-2*e;if(0>n)break;let i=!0;for(let r=0;e>r;r++)if(!HC(t[n+r],t[n+e+r])){i=!1;break}if(i){for(let r=0;e>r;r++)t[n+r]=t[n+e+r];return t.length=n+e,{start:n,length:e}}}}function lX(t,e){const n=e.start+e.length,i=uU(t,e);i&&t.splice(n+i===t.length?n:e.start,i)}function cU(t,e){let n=e.start;for(;n>0&&HC(t[n-1],t[n-1+e.length]);)n--;return e.start-n}function uU(t,e){const n=e.start+e.length;let i=n;for(;t.length>i&&HC(t[i],t[i-e.length]);)i++;return i-n}function cX(t,e){const n=e[0];let i=t.length-(n?cU(t,n):0);for(const r of e)i-=uU(t,r);return i}function uX(t,e,n){for(let i=0;t.length>i;i++){const r=t[(e+i)%t.length],o=t[(n+i)%t.length];if(r!==o)return o>r}return!1}var dX=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){const i=mt(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?e.stack:void 0,cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){const n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?`${n}: ${e.message}`:n}isDOMException(e){return db(e,"DOMException")}isDOMError(e){return db(e,"DOMError")}},hX=class{match(e){return df(e)}coerce(e,n){var i;const r=this.getStack(e),o=r===void 0?(i=n.syntheticException)===null||i===void 0?void 0:i.stack:void 0,l=!!o;return{type:this.getType(e),value:this.getMessage(e,n),stack:r??o,cause:e.cause?n.next(e.cause):void 0,synthetic:l}}getType(e){return e.name||e.constructor.name}getMessage(e,n){const i=e.message;return String(i.error&&typeof i.error.message=="string"?i.error.message:i)}getStack(e){try{const n=e.stacktrace;if(typeof n=="string"&&n.length>0)return n;const i=e.stack;return typeof i=="string"&&i.length>0?i:void 0}catch{return}}},fX=class{match(e){return!!db(e,"ErrorEvent")&&(e.error!=null||this.ur(e))}coerce(e,n){var i;if(e.error!=null)return n.apply(e.error);const r=n.apply(e.message);return z(z({},r),{},{stack:(i=this.cr(e))!==null&&i!==void 0?i:r.stack,synthetic:!0})}ur(e){return mt(e.message)&&e.message.length>0}cr(e){var n,i;const r=e,o=(n=r.lineno)!==null&&n!==void 0?n:0,l=(i=r.colno)!==null&&i!==void 0?i:0;if(mt(r.filename)&&r.filename.length!==0&&o!==0)return`Error
17    at ${r.filename}:${o}:${l}`}};const pX=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var gX=class{match(e){return typeof e=="string"}coerce(e,n){var i;const[r,o]=this.getInfos(e);return{type:r??"Error",value:o??e,stack:(i=n.syntheticException)===null||i===void 0?void 0:i.stack,synthetic:!0}}getInfos(e){let n="Error",i=e;const r=e.match(pX);return r&&(n=r[1],i=r[2]),[n,i]}};const mX=["fatal","error","warning","log","info","debug"];function dU(t,e=40){const n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(let i=n.length;i>0;i--){const r=n.slice(0,i).join(", ");if(e>=r.length)return i===n.length?r:r.length>e?`${r.slice(0,e)}...`:r}return""}var vX=class{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var i,r;const o=this.getErrorPropertyFromObject(e);return o?n.apply(o):{type:this.getType(e),value:this.getValue(e),stack:(i=this.getStack(e))!==null&&i!==void 0?i:(r=n.syntheticException)===null||r===void 0?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(UC(e))return e.constructor.name;const n="name"in e?e.name:void 0;return mt(n)&&!Ig(n)?n:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){let i=`'${e.name}' captured as exception`;return"message"in e&&typeof e.message=="string"&&(i+=` with message: '${e.message}'`),i}if("message"in e&&typeof e.message=="string")return e.message;const n=this.getObjectClassName(e);return`${n&&n!=="Object"?`'${n}'`:"Object"} captured as exception with keys: ${dU(e)}`}isSeverityLevel(e){return mt(e)&&!Ig(e)&&mX.indexOf(e)>=0}getStack(e){try{return mt(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:mt(e.stack)&&e.stack.length>0?e.stack:void 0}catch{return}}getErrorPropertyFromObject(e){for(const n in e)if({}.hasOwnProperty.call(e,n)){const i=e[n];if(df(i))return i}}getObjectClassName(e){try{const n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}},yX=class{match(e){return UC(e)}coerce(e,n){var i;const r=e.constructor.name;return{type:r,value:`${r} captured as exception with keys: ${dU(e)}`,stack:(i=n.syntheticException)===null||i===void 0?void 0:i.stack,synthetic:!0}}},_X=class{match(e){return C4(e)}coerce(e,n){var i;return{type:"Error",value:`Primitive value captured as exception: ${String(e)}`,stack:(i=n.syntheticException)===null||i===void 0?void 0:i.stack,synthetic:!0}}},bX=class{match(e){return db(e,"PromiseRejectionEvent")||this.isCu
17stomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!UC(e))return!1;try{const n=e.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(e,n){var i;const r=this.getUnhandledRejectionReason(e);return C4(r)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(r)}`,stack:(i=n.syntheticException)===null||i===void 0?void 0:i.stack,synthetic:!0}:n.apply(r)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&e.detail!=null&&typeof e.detail=="object"&&"reason"in e.detail)return e.detail.reason}catch{}return e}};const gb="$message",mb="$timestamp",wX=new Set([gb,mb]),v1={enabled:!0,max_bytes:32768};function vb(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:v1.enabled,max_bytes:SX(t.max_bytes,v1.max_bytes)}:z({},v1)}var xX=class{constructor(e){this.ns=[],this.ss=0,this.Rr=vb(e)}setConfig(e){this.Rr=vb(e),this.rs()}add(e){const n=(function(r){let o;try{o=E4(r)}catch{return}try{const l=JSON.parse(o);if(!xt(l))return;const u=l,d=u[gb],f=u[mb];return!mt(d)||d.trim().length===0||!mt(f)&&!Fn(f)?void 0:{step:u,json:o}}catch{return}})(e);if(!n)return;const i=(function(r){if("u">typeof TextEncoder)return new TextEncoder().encode(r).length;const o=encodeURIComponent(r);let l=0;for(let u=0;o.length>u;u++)o[u]==="%"?(l+=1,u+=2):l+=1;return l})(n.json);i>this.Rr.max_bytes||(this.ns.push({step:n.step,bytes:i}),this.ss+=i,this.rs())}getAttachable(){return this.ns.map(e=>e.step)}clear(){this.ns=[],this.ss=0}size(){return this.ns.length}rs(){for(;this.ss>this.Rr.max_bytes&&this.ns.length>0;){const e=this.ns.shift();e&&(this.ss-=e.bytes)}}};function SX(t,e){if(!Fn(t)||t===1/0||t===-1/0)return e;const n=Math.floor(t);return 0>n?e:n}const HM=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function KM(t){return typeof t=="string"||t}function ZM(t){return typeof t=="string"?t:void 0}const kX=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],hU="NativeGzipValidationError",AT=t=>t.length>=2&&t[0]===31&&t[1]===139,WM=(t,e)=>t===kT.GZipJS||e===kT.GZipJS||e==="gzip",qM=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError";let Ap;const d0=t=>{throw sU(hU,`Native gzip produced invalid output: ${t}`)},EX=(VM=_n(function*(t,e){18>t.size&&d0("too-short");const n=new Uint8Array(yield t.slice(0,10).arrayBuffer());AT(n)&&n[2]===8||d0("invalid-header");const i=new DataView(yield t.slice(t.size-8).arrayBuffer());i.getUint32(0,!0)!==(o=>{const l=(()=>{if(Ap)return Ap;Ap=[];for(let d=0;256>d;d++){let f=d;for(let p=0;8>p;p++)f=1&f?3988292384^f>>>1:f>>>1;Ap[d]=f>>>0}return Ap})();let u=4294967295;for(let d=0;o.length>d;d++)u=l[255&(u^o[d])]^u>>>8;return(4294967295^u)>>>0})(e)&&d0("invalid-crc");const r=e.length>>>0;i.getUint32(4,!0)!==r&&d0("invalid-size")}),function(t,e){return VM.apply(this,arguments)});var VM;function jT(){return jT=_n(function*(t,e=!0,n){try{const r=new TextEncoder().encode(t),o=new globalThis.CompressionStream("gzip"),l=o.writable.getWriter(),u=l.write(r).then(()=>l.close()).catch((i=_n(function*(p){try{yield l.abort(p)}catch{}throw p}),function(p){return i.apply(this,arguments)})),d=new Response(o.readable).blob(),[f]=yield Promise.all([d,u]);return yield EX(f,r),f}catch(r){if(n?.rethrow)throw r;return e&&console.error("Failed to gzip compress data",r),null}var i}),jT.apply(this,arguments)}function fU(t,e){if(t==null)return{};var n,i,r=(function(l,u){if(l==null)return{};var d={};for(var f in l)if({}.hasOwnProperty.call(l,f)){if(u.includes(f))continue;d[f]=l[f]}return d})(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;o.length>i;i++)e.includes(n=o[i])||{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}const TX={}.propertyIsEnumerable;function yb(t,e){try{return pU(t,e,{ancestors:new WeakSet,remainingNodes:1e4}
17,0)}catch{return[]}}function KC(t,e,n,i){if(0>=n.remainingNodes)return{stringValue:RT};if(n.remainingNodes--,Or(t))return{boolValue:t};if(typeof t=="bigint")return(function(r,o){const l=r.toString(),u=BigInt("9223372036854775808");return r>=u||-u>r?(o?.debug(`Attribute ${l} is outside the int64 range; encoding it as a string`),{stringValue:l}):{intValue:l}})(t,e);if(typeof t=="number"){if(!Number.isFinite(t))return{stringValue:String(t)};if(Number.isInteger(t)){if(Number.isSafeInteger(t))return{intValue:String(t)};if(typeof BigInt>"u")return{stringValue:String(t)};const r=BigInt(t).toString();return t>=9223372036854776e3||-9223372036854776e3>t?(e?.debug(`Attribute ${r} is outside the int64 range; encoding it as a string`),{stringValue:r}):{intValue:r}}return{doubleValue:t}}if(typeof t=="string")return{stringValue:Nh(t)};if(typeof t=="function")return{stringValue:"[Function]"};if(typeof t=="symbol")return{stringValue:String(t)};if(typeof t=="object"&&t!==null){if(n.ancestors.has(t))return{stringValue:"[Circular]"};if(i>=20)return{stringValue:RT};if(t instanceof Date){const r=t.getTime(),o=Number.isFinite(r)?t.toISOString():String(t);return{stringValue:typeof o=="string"?Nh(o):String(o)}}n.ancestors.add(t);try{try{const r=t.toJSON;if(typeof r=="function")return KC(r.call(t),e,n,i+1)}catch{}return Je(t)?{arrayValue:{values:CX(t,e,n,i+1)}}:{kvlistValue:{values:pU(t,e,n,i+1)}}}finally{n.ancestors.delete(t)}}return{stringValue:Nh(String(t))}}function CX(t,e,n,i){const r=[],o=Math.min(t.length,1e3);let l=0;for(;o>l&&n.remainingNodes>0;l++)try{const u=l in t?t[l]:void 0;if(it(u))continue;r.push(KC(u,e,n,i))}catch{r.push({stringValue:iv})}return t.length>l&&r.push({stringValue:RT}),r}function pU(t,e,n,i){const r=[];for(const o in t)if(TX.call(t,o)){if(!o){e?.debug("Dropping an attribute with an empty key");continue}if(r.length>=1e3||0>=n.remainingNodes){e?.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{const l=t[o];if(On(l)||le(l))continue;r.push({key:Nh(o),value:KC(l,e,n,i)})}catch{r.push({key:Nh(o),value:{stringValue:iv}})}}return r}function gU(t,e,n){return z(z(z(z({},iU({},t.resourceAttributes)),{},{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment}),t.serviceVersion&&{"service.version":t.serviceVersion}),{},{"telemetry.sdk.name":e,"telemetry.sdk.version":n})}const OX=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function mU(t,e){const n=iU({},t),i={};for(const r of OX)({}).hasOwnProperty.call(n,r)&&(i[r]=n[r],delete n[r]);return[...yb(n,e),...yb(i,e)]}const BM={darwin:"macOS",win32:"Windows",cygwin:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",netbsd:"NetBSD",sunos:"SunOS",aix:"AIX",haiku:"Haiku","Mac OS X":"macOS"},vU={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},RX=vU.info;function $X(t){try{return Nh(String(t))}catch{return iv}}function AX(t,e,n,i){const r=t.level||"info",{text:o,number:l}=vU[r]||RX,u=(function(v=Date.now()){return String(v)+"000000"})(Fn(i)?i:void 0),d={};e.distinctId&&(d.posthogDistinctId=e.distinctId),e.sessionId&&(d.sessionId=e.sessionId),e.windowId&&(d["window.id"]=e.windowId),it(e.sessionStartTimestamp)||(d.sessionStartTimestamp=String(e.sessionStartTimestamp)),it(e.lastActivityTimestamp)||(d.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(d["url.full"]=e.currentUrl),e.screenName&&(d["screen.name"]=e.screenName),e.appState&&(d["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(d.feature_flags=e.activeFeatureFlags);const f=z({},d),p=t.attributes;if(p){let v=[];try{v=Object.keys(p)}catch{v=[]}for(const y of v){let b;try{b=p[y]}catch{b=iv}Object.defineProperty(f,y,{value:b,enumerable:!0,writable:!0,configurable:!0})}}const g={timeUnixNano:u,observedTimeUnixNano:u,severityNumber:l,severityText:o,body:{stringValue:$X(t.body)},attributes:yb(f,n)};return t.trace_id&&(g.traceId=t.trace_id),t.span_id&&(g.spanId=t.span_id),le(t.trace_flags)||(g.flags=t.trace_flags),g}function yU(t,e,n){return gU(t,e,n)}function _U(t,e,n,i){return{resourceLogs:[{resource:{attributes:mU(e)},scopeLogs:[{scope:{name:n,version:i},logRecords:t}]}]}}var bU=class{constructor(e){this.ls=e,this.us=0}get pending(){return!!this.hs}arm(e){this.clear(),this.us=Date.now()+e,this.hs=oU(()=>{this.hs=void 0,this.ls()},e)}armNoEarlierThan(e){this.hs&&Date.now()+e<=this.us||this.arm(e)}clear(){this.hs&&(clearTimeout(this.hs),this.hs=void 0)}};function wU(){return .75+.5*Math.random()}function xU(t,e,n,i){const r=Math.min(Math.max(0,e-1),6),o=t*Math.pow(2,r);return Math.round(Math.min(o,Math.max(i,t))*n)}var jX=class{constructor(e,n,i,r,o,l=()=>Promise.resolve(),u){var d;this._instance=e,this.Rr=n,this.$=i,this.cs=r,this.ds=o,this.vs=l,this.fs=u,this.ps=new bU(()=>this.gs()),this.ys=null,this.bs=0,this._s=0,this.ws=new rU,this.ks=0,this.Ss=1,this.xs=0,this.Cs=0,this.$s=!1,this.Ts=n.maxBufferSize,this.Is=Math.max((d=n.maxQueueSize)!==null&&d!==void 0?d:n.maxBufferSize,n.maxBufferSize),this.Ms=n.flushIntervalMs,this.Es=n.maxBatchRecordsPerPost,this.Ps=n.rateCapWindowMs,this.Rs=n.maxLogsPerInterval}clearQueue(){this._s++,this._instance.setPersistedProperty(Vo.LogsQueue,[])}reset(){this.ps.clear(),this.xs=0,this.Cs=0,this.$s=!1,this.ks=0,this.Ss=1,this.ws.reset(),this.Es=this.Rr.maxBatchRecordsPerPost}onReconnect(){this.ks=0,this.Ss=1,this.ws.isOpen()?this.As()&&this.Fs():this.gs()}captureLog(e,n){var i;if(this._instance.isDisabled||this._instance.optedOut||!e?.body)return;const r=this.Os(e);if(r===null)return;if(!r.body)return void this.$.info("Log was rejected in beforeSend function");if(!this.Ds())return;const o={record:AX(r,(i=n?.context)!==null&&i!==void 0?i:this.cs(),this.$,n?.occurredAtMs)};this.ds(()=>this.Ls(o))}Os(e){const n=this.Rr.beforeSend;if(!n)return e;const i=Je(n)?n:[n];let r=e;for(const o of i)try{const l=o(r);if(!l)return this.$.info("Log was rejected in beforeSend function"),null;r=l}catch(l){return this.$.error("Error in beforeSend function for log:",l),null}return r}Ds(){if(this.Rs===void 0)return!0;const e=Date.now(),n=e-this.xs;return this.Ps>n&&n>=0||(this.xs=e,this.Cs=0,this.$s=!1),this.Rs>this.Cs?(this.Cs++,!0):(this.$s||(this.$.warn(`captureLog dropping logs: exceeded ${this.Rs} logs per ${this.Ps}ms`),this.$s=!0),!1)}flush(){var e=this;return _n(function*(){if(!e._instance.isDisabled)return e.ys||(e.ys=e.Ns().finally(()=>{e.ys=null})),e.ys})()}Ns(){var e=this;return _n(function*(){var n;e.ps.clear();let i=(n=e._instance.getPersistedProperty(Vo.LogsQueue))!==null&&n!==void 0?n:[];if(i.length===0)return;const r=i.length;let o=0;for(;i.length>0&&r>o;){var l,u;const d=e._s;e.bs=0;const f=Math.min(i.length,e.Es),p=i.slice(0,f),g=_U(p.map(y=>y.record),e.qs(),(l=e.fs)!==null&&l!==void 0?l:e._instance.getLibraryId(),e._instance.getLibraryVersion()),v=yield e._instance.js(g);if(e._s!==d)return;if(v.kind==="too-large"&&p.length>1)e.Es=Math.max(1,Math.floor(p.length/2)),e.$.warn(`Logs batch of size ${p.length} was too large for the ingestion endpoint, reducing batch size to ${e.Es}`);else if(e.ws.record(v),e.ps.pending&&e.ps.arm(Math.max(e.Ms,e.ws.remainingMs())),v.kind==="retry-later"||(v.kind==="too-large"?e.$.warn("Dropping a single log record with batch size 1 — the record 
17is larger than the server cap and cannot be split further."):v.kind==="ok"&&e.Rr.maxBatchRecordsPerPost>e.Es&&(e.Es=Math.min(e.Rr.maxBatchRecordsPerPost,e.Es+1)),yield e.Bs(p.length),i=(u=e._instance.getPersistedProperty(Vo.LogsQueue))!==null&&u!==void 0?u:[],o+=p.length,v.kind==="fatal"))throw v.error}})()}Bs(e){var n=this;return _n(function*(){var i;const r=Math.max(0,e-n.bs),o=(i=n._instance.getPersistedProperty(Vo.LogsQueue))!==null&&i!==void 0?i:[];n._instance.setPersistedProperty(Vo.LogsQueue,o.slice(r)),yield n.vs()})()}qs(){return yU(this.Rr,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ls(e){var n;if(this._instance.optedOut)return;const i=(n=this._instance.getPersistedProperty(Vo.LogsQueue))!==null&&n!==void 0?n:[];this.Is>i.length||(i.shift(),this.bs++,this.$.info("Logs queue is full, dropping oldest record.")),i.push(e),this._instance.setPersistedProperty(Vo.LogsQueue,i),this.Ts>i.length||this.ws.isOpen()?this.Fs():this.gs()}Fs(){this.ps.pending||this.ps.arm(Math.max(this.Ms,this.ws.remainingMs()))}Hs(){return Math.max(xU(this.Ms,this.ks,this.Ss,3e4),this.ws.remainingMs())}As(){const e=this._instance.getPersistedProperty(Vo.LogsQueue);return!!e&&e.length>0}shutdown(e){var n=this;return _n(function*(){n.ps.clear();const i=n.flush().catch(()=>{});e!==void 0?yield DM(i,e):yield i})()}flushWithTimeout(e){var n=this;return _n(function*(){const i=n.flush();yield DM(i,e,()=>{i.catch(()=>{})})})()}gs(){this.flush().then(()=>{this.ks=0,this.Ss=1},e=>{this.ks++,this.Ss=wU(),this.$.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.As()&&this.ps.armNoEarlierThan(this.Hs())})}};const y1=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function GM(t){return String(t)+"000000"}function JM(t,e,n,i){let r="";return i&&(r=Object.keys(i).sort().map(o=>`${JSON.stringify(o)}:${JSON.stringify(i[o])}`).join(",")),`${t}\0${e}\0${n??""}\0${r}`}var PX=class{constructor(e,n,i){this._instance=e,this.Rr=n,this.$=i,this.zs=new Map,this.ps=new bU(()=>this.flush().catch(r=>{this.$.error("Metrics flush failed:",r)})),this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.ws=new rU,this.ks=0,this.Ss=1,this.Gs=0}count(e,n=1,i){this.Zs({name:e,type:"count",value:n,unit:i?.unit,attributes:i?.attributes})}gauge(e,n,i){this.Zs({name:e,type:"gauge",value:n,unit:i?.unit,attributes:i?.attributes})}histogram(e,n,i){this.Zs({name:e,type:"histogram",value:n,unit:i?.unit,attributes:i?.attributes})}flush(){var e=this;const n=this.ys,i=(function(){var r=_n(function*(){n&&(yield n.catch(()=>{})),yield e.Qs()});return function(){return r.apply(this,arguments)}})()().finally(()=>{this.ys===i&&(this.ys=null)});return this.ys=i,i}drainWindow(){if(this.zs.size===0)return null;const e=this.zs;return this.zs=new Map,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.Js(e)}reset(){this.Gs++,this.ws.reset(),this.ks=0,this.Ss=1,this.ps.clear(),this.zs=new Map,this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set}Zs(e){if(this._instance.isDisabled||this._instance.optedOut)return;const n=this.Os(e);if(n===null)return;if(!n.name||typeof n.name!="string")return void this.$.warn("Dropping metric with empty name");if(typeof n.value!="number"||!Number.isFinite(n.value))return void this.$.warn(`Dropping metric '${n.name}': value must be a finite number`);if(n.type==="count"&&0>n.value)return void this.$.warn(`Dropping count '${n.name}': counters are monotonic, value must be >= 0`);let i,r;try{i=n.attributes?z({},n.attributes):void 0,r=JM(n.type,n.name,n.unit,i)}catch(u){return void this.$.warn(`Dropping metric '${n.name}': attributes could not be serialized`,u)}let o=this.zs.get(r);if(!o){if(!this.Ks())return;o={name:n.name,type:n.type,unit:n.unit,attributes:i,windowStartMs:Date.now()},this.zs.set(r,o)}const l=this.Ws.get(n.name);l===void 0?this.Ws.set(n.name,n.type):l===n.type||this.Vs.has(n.name)||(this.Vs.add(n.name),this.$.warn(`Metric name '${n.name}' is already used as a ${l}; recording it as a ${n.type} too will blend both series in charts. Use a distinct name.`)),this.Xs(o,n.value),this.Fs()}Ks(){return this.Rr.maxSeriesPerFlush>this.zs.size||(this.Us||(this.Us=!0,this.$.warn(`Metric series cap reached (${this.Rr.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}Xs(e,n){switch(e.type){case"count":var i;e.total=((i=e.total)!==null&&i!==void 0?i:0)+n;break;case"gauge":e.last=n;break;case"histogram":{e.hist||(e.hist={count:0,sum:0,min:n,max:n,bucketCounts:new Array(y1.length+1).fill(0)});const r=e.hist;r.count+=1,r.sum+=n,r.min=Math.min(r.min,n),r.max=Math.max(r.max,n),r.bucketCounts[(function(o,l){for(let u=0;l.length>u;u++)if(l[u]>=o)return u;return l.length})(n,y1)]+=1;break}}}Os(e){const n=this.Rr.beforeSend;if(!n)return e;const i=Je(n)?n:[n];let r=e;for(const o of i)try{const l=o(r);if(!l)return this.$.info("Metric was rejected in beforeSend function"),null;r=l}catch(l){return this.$.error("Error in beforeSend function for metric:",l),null}return r}Fs(){this.ps.pending||this.ps.arm(this.Hs())}Hs(){return Math.max(xU(this.Rr.flushIntervalMs,this.ks,this.Ss,3e4),this.ws.remainingMs())}Qs(){var e=this;return _n(function*(){if(e.ps.clear(),e.zs.size===0)return;const n=e.zs;e.zs=new Map,e.Us=!1,e.Ws=new Map,e.Vs=new Set;const i=e.Gs,r=yield e._instance.Ys(e.Js(n));if(i===e.Gs)switch(e.ws.record(r),r.kind==="retry-later"?(e.ks++,e.Ss=wU()):(e.ks=0,e.Ss=1),e.ps.pending&&e.ps.arm(e.Hs()),r.kind){case"ok":return;case"retry-later":return e.ho(n),void e.ps.armNoEarlierThan(e.Hs());case"too-large":return void e.$.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.$.error("Failed to send metrics batch:",r.error)}})()}Js(e){return n=this.vo(e),i=(function(l,u,d){return gU(l,u,d)})(this.Rr,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r
17=this._instance.getLibraryId(),o=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:mU(i)},scopeMetrics:[{scope:{name:r,version:o},metrics:n}]}]};var n,i,r,o}vo(e){const n=GM(Date.now()),i=new Map;for(const u of e.values()){var r;const d=JM(u.type,u.name,u.unit,void 0);let f=i.get(d);f||(f=z({name:u.name},u.unit&&{unit:u.unit}),u.type==="count"?f.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:u.type==="gauge"?f.gauge={dataPoints:[]}:f.histogram={aggregationTemporality:1,dataPoints:[]},i.set(d,f));const p=yb((r=u.attributes)!==null&&r!==void 0?r:{},this.$),g=GM(u.windowStartMs);if(u.type==="count"){var o;const v={attributes:p,startTimeUnixNano:g,timeUnixNano:n,asDouble:(o=u.total)!==null&&o!==void 0?o:0};f.sum.dataPoints.push(v)}else if(u.type==="gauge"){var l;const v={attributes:p,timeUnixNano:n,asDouble:(l=u.last)!==null&&l!==void 0?l:0};f.gauge.dataPoints.push(v)}else u.hist&&f.histogram.dataPoints.push({attributes:p,startTimeUnixNano:g,timeUnixNano:n,count:u.hist.count,sum:u.hist.sum,min:u.hist.min,max:u.hist.max,bucketCounts:u.hist.bucketCounts,explicitBounds:y1})}return Array.from(i.values())}ho(e){for(const[r,o]of e){const l=this.zs.get(r);if(l)switch(l.windowStartMs=Math.min(l.windowStartMs,o.windowStartMs),l.type){case"count":var n,i;l.total=((n=l.total)!==null&&n!==void 0?n:0)+((i=o.total)!==null&&i!==void 0?i:0);break;case"gauge":break;case"histogram":if(o.hist)if(l.hist){l.hist.count+=o.hist.count,l.hist.sum+=o.hist.sum,l.hist.min=Math.min(l.hist.min,o.hist.min),l.hist.max=Math.max(l.hist.max,o.hist.max);for(let u=0;l.hist.bucketCounts.length>u;u++)l.hist.bucketCounts[u]+=o.hist.bucketCounts[u]}else l.hist=o.hist}else this.Ks()&&this.zs.set(r,o)}}};const SU=(t,{debugEnabled:e}={})=>{const n={N(i,...r){G&&(La.DEBUG||G.POSTHOG_DEBUG||e)&&!le(G.console)&&G.console&&("__rrweb_original__"in G.console[i]?G.console[i].__rrweb_original__:G.console[i])(t,...r)},debug(...i){n.N("debug",...i)},info(...i){n.N("log",...i)},warn(...i){n.N("warn",...i)},error(...i){n.N("error",...i)},critical(...i){console.error(t,...i)},uninitializedWarning(i){n.error(`You must initialize PostHog before calling ${i}`)},createLogger:(i,r)=>SU(`${t} ${i}`,r)};return n},Ce=SU("[PostHog.js]"),$n=Ce.createLogger,NX=$n("[ExternalScriptsLoader]"),_b=t=>{const e=he?.querySelectorAll("script");if(e){for(let n=0;e.length>n;n++)if(e[n].src===t||e[n].getAttribute("src")===t)return e[n]}},tu=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return NX.warn(`${e} was requested but loading of external scripts is disabled.`),n("Loading of external scripts is disabled");const i=_b(e);if(i){if(i.__posthog_loading_callback_fired)return n();const o=i.__posthog_loading_error;return o?n(o):(i.addEventListener("load",l=>{i.__posthog_loading_callback_fired=!0,n(void 0,l)}),void i.addEventListener("error",l=>{i.__posthog_loading_error=l,n(l)}))}const r=()=>{if(!he)return n("document not found");if(_b(e))return tu(t,e,n);let o=he.createElement("script");if(o.type="text/javascript",o.crossOrigin="anonymous",o.src=e,o.onload=u=>{o.__posthog_loading_callback_fired=!0,n(void 0,u)},o.onerror=u=>{o.__posthog_loading_error=u,n(u)},t.config.prepare_external_dependency_script&&(o=t.config.prepare_external_dependency_script(o)),!o)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")he.head.appendChild(o);else{const u=he.querySelectorAll("body > script");var l;u.length>0?(l=u[0].parentNode)===null||l===void 0||l.insertBefore(o,u[0]):he.body.appendChild(o)}};he?.body?r():he?.addEventListener("DOMContentLoaded",r)},_1={},XM=(t,e)=>{let n=`/static/${e}.js?v=${t.version}`;return e==="toolbar"&&(n=`${n}&t=${Math.floor(Date.now()/3e5)*3e5}`),t.requestRouter.endpointFor("assets",n)};qe.__PosthogExtensions__=qe.__PosthogExtensions__||{},qe.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e==="remote-config"){const r=t.requestRouter.endpointFor("assets",`/array/${t.config.token}/config.js`);return void tu(t,r,n)}const i=t.config.strict_script_versioning;if(i){const r=t.requestRouter.endpointFor("assets",`/static/${t.version}/${e}.js`),o=_1[r];if(i==="fallback"&&o){if(_b(o))return void tu(t,o,n);delete _1[r]}return void tu(t,r,i==="fallback"?(l,u)=>{if(l)if(typeof l=="string")n(l);else{var d;const f=XM(t,e);_1[r]=f;const p=_b(r);p==null||(d=p.parentNode)===null||d===void 0||d.removeChild(p),tu(t,f,n)}else n(void 0,u)}:n)}tu(t,XM(t,e),n)},qe.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{const i=t.requestRouter.endpointFor("api",e);tu(t,i,n)},La.DEBUG=!1,La.LIB_VERSION="1.434.16",La.LIB_NAME="web";var li=La;
17const MX="$people_distinct_id",oo="distinct_id",ZC="$device_id",b1="$device_model",bb="__alias",IX="__cmpns",YM="$fbc",Mh="$fbc_persistence",QM="$fbp",Dg="$fbp_persistence",PT="__timers",kU="$autocapture_disabled_server_side",NT="$heatmaps_enabled_server_side",MT="$exception_capture_enabled_server_side",EU="$error_tracking_suppression_rules",IT="$error_tracking_capture_extension_exceptions",zT="$web_vitals_enabled_server_side",WC="$dead_clicks_enabled_server_side",qC="$product_tours_enabled_server_side",TU="$logs_capture_enabled_server_side",CU="$web_vitals_allowed_metrics",Lg="$session_recording_remote_config",zX="$session_recording_enabled_server_side",DX="$replay_sample_rate",LX="$replay_override_sampling",UX="$replay_override_linked_flag",FX="$replay_override_url_trigger",HX="$replay_override_event_trigger",yh="$sesid",OU="$session_is_sampled",KX="$session_past_minimum_duration",ZX="$session_recording_url_trigger_activated_session",WX="$session_recording_event_trigger_activated_session",qX="$debug_first_full_snapshot_timestamp",VX="$sess_rec_flush_size",co="$enabled_feature_flags",Ma="$active_feature_flags",DT="$early_access_features",ku="$feature_flag_details",Yl="$feature_flag_payloads",Eu="$feature_flag_request_id",Ug="$minimal_flag_called_events",Wo="$override_feature_flags",nu="$override_feature_flag_payloads",Ql="$stored_person_properties",ec="$stored_group_properties",RU="$groups",LT="$surveys",wb="$surveys_loaded_at",$U="$surveys_activated",AU="$surveys_activated_session",jU="$surveys_activated_timestamps",UT="ph_product_tours",BX="$product_tours_activated",GX="$product_tours_activated_session",JX="$conversations_widget_session_id",XX="$conversations_ticket_id",YX="$conversations_widget_state",QX="$conversations_user_traits",tc="$flag_call_reported",pg="$flag_call_reported_session_id",mm="$feature_flag_errors",rc="$feature_flag_evaluated_at",Cr="$user_state",FT="$client_session_props",eY="$capture_rate_limit",PU="$initial_campaign_params",NU="$initial_referrer_info",_h="$initial_person_info",VC="$epp",w1="$posthog_cookieless",MU="$cookieless_mode",IU="$sdk_debug_extensions_init_method",zU="$sdk_debug_extensions_init_time_ms",DU="$sdk_debug_recording_script_not_loaded",LU="$sdk_debug_replay_stale_config",tY="$sdk_debug_replay_event_trigger_status",nY="$sdk_debug_replay_linked_flag_trigger_status",iY="$sdk_debug_replay_matched_recording_trigger_groups",rY="$sdk_debug_replay_pen
17ding_trigger_conditions",sY="$sdk_debug_replay_remote_trigger_matching_config",oY="$sdk_debug_replay_trigger_groups_count",aY="$sdk_debug_replay_url_trigger_status",lY="$session_recording_start_reason",BC="PostHog loadExternalDependency extension not found.",Ia="anonymous",S_="identified",UU="identified_only",vm="visibilitychange",xb="beforeunload",GC="$pageview",eI="$pageleave",FU="$identify",tI="$groupidentify";function bh(t,e){Je(t)&&t.forEach(e)}function Wt(t,e){if(!it(t))if(Je(t))t.forEach(e);else if((n=>n instanceof FormData)(t))t.forEach((n,i)=>e(n,i));else for(const n in t)LC.call(t,n)&&e(t[n],n)}const pn=function(t,...e){for(const n of e)for(const i in n)n[i]!==void 0&&(t[i]=n[i]);return t};function k_(t){const e=Object.keys(t);let n=e.length;const i=new Array(n);for(;n--;)i[n]=[e[n],t[e[n]]];return i}const cY=function(t){return function(...e){try{return t.apply(this,e)}catch(n){Ce.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Ce.critical(n)}}},JC=function(t){const e={};return Wt(t,function(n,i){(mt(n)&&n.length>0||Fn(n))&&(e[i]=n)}),e};function HU(t){const e=z({},t);for(const n of["name","message","stack","cause","errors"])try{n in t&&(e[n]=t[n])}catch{}return e}const uY=["herokuapp.com","vercel.app","netlify.app"];function dY(t){const e=t?.hostname;if(!mt(e))return!1;const n=e.split(".").slice(-2).join(".");for(const i of uY)if(n===i)return!1;return!0}function Ht(t,e,n,i){const{capture:r=!1,passive:o=!0}=i??{};t?.addEventListener(e,n,{capture:r,passive:o})}function HT(t){return t.name==="ph_toolbar_internal"}const Fg=t=>{if(he){try{const e=t+"=",n=he.cookie.split(";").filter(i=>i.length);for(let i=0;n.length>i;i++){let r=n[i];for(;r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return decodeURIComponent(r.substring(e.length,r.length))}}catch{}return null}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Fn(t)&&isFinite(t)&&Math.floor(t)===t});var hY=class KT{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,i,r){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(i)||!Number.isInteger(r)||0>e||0>n||0>i||0>r||e>0xffffffffffff||n>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");const o=new Uint8Array(16);return o[0]=e/Math.pow(2,40),o[1]=e/Math.pow(2,32),o[2]=e/Math.pow(2,24),o[3]=e/Math.pow(2,16),o[4]=e/256,o[5]=e,o[6]=112|n>>>8,o[7]=n,o[8]=128|i>>>24,o[9]=i>>>16,o[10]=i>>>8,o[11]=i,o[12]=r>>>24,o[13]=r>>>16,o[14]=r>>>8,o[15]=r,new KT(o)}toString(){let e="";for(let n=0;this.bytes.length>n;n++)e=e+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new KT(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(let n=0;16>n;n++){const i=this.bytes[n]-e.bytes[n];if(i!==0)return Math.sign(i)}return 0}},fY=class{generate(){const e=this.generateOrAbort();if(!le(e))return e;{this.Ct=0;const n=this.generateOrAbort();if(le(n))throw new Error("Could not generate UUID after timestamp reset");return n}}generateOrAbort(){const e=(()=>{const n=Date.now();return Fn(n)&&isFinite(n)?Math.min(Math.max(Math.floor(n),0),0xffffffffffff):0})();if(e>this.Ct)this.Ct=e,this.Mt();else{if(this.Ct>=e+1e4)return;this.It++,this.It>4398046511103&&(this.Ct++,this.Mt())}return hY.fromFieldsV7(this.Ct,Math.trunc(this.It/Math.pow(2,30)),this.It&Math.pow(2,30)-1,this.Tt.nextUint32())}Mt(){this.It=1024*this.Tt.nextUint32()+(1023&this.Tt.nextUint32())}constructor(){this.Ct=0,this.It=0,this.Tt=new pY}};let KU=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};G&&!le(G.crypto)&&crypto.getRandomValues&&(KU=t=>crypto.getRandomValues(t));var pY=class{nextUint32(){return this.Rt.length>this.$t||(KU(this.Rt),this.$t=0),this.Rt[this.$t++]}constructor(){this.Rt=new Uint32Array(8),this.$t=1/0}};let nI;const po=()=>gY().toString(),gY=()=>(nI||(nI=new fY)).generate();let jp="";const mY=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;let Hd=null;
17const kn={Et(){if(!On(Hd))return Hd;if(Hd=!1,he)try{const t=`__ph_cookie_support_${po()}`;kn.At(t,"xyz"),Hd=Fg(t)==='"xyz"',kn.Lt(t)}catch{Hd=!1}return Hd},Pt(t){Ce.error("cookieStore error: "+t)},Ot:Fg,Dt(t){let e;try{e=JSON.parse(kn.Ot(t))||{}}catch{}return e},At(t,e,n,i,r){if(!he)return!1;try{let o="",l="";const u=(function(f,p){if(p){let g=(function(v,y=he){if(jp)return jp;if(!y||["localhost","127.0.0.1"].includes(v))return"";const b=v.split(".");let x=Math.min(b.length,8);const S="dmn_chk_"+po();for(;!jp&&x--;){const k=b.slice(x).join("."),T=S+"=1;domain=."+k+";path=/";y.cookie=T+";max-age=3",y.cookie.includes(S)&&(y.cookie=T+";max-age=0",jp=k)}return jp})(f);if(!g){const v=(y=>{const b=y.match(mY);return b?b[0]:""})(f);v!==g&&Ce.info("Warning: cookie subdomain discovery mismatch",v,g),g=v}return g?"; domain=."+g:""}return""})(he.location.hostname,i);if(n){const f=new Date;f.setTime(f.getTime()+864e5*n),o="; expires="+f.toUTCString()}r&&(l="; secure");const d=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+u+l;return d.length>3686.4&&Ce.warn("cookieStore warning: large cookie, len="+d.length),he.cookie=d,!0}catch{return!1}},Lt(t,e){if(he?.cookie&&(!e||!On(Fg(t))))try{kn.At(t,"",-1,e)}catch{return}}};let x1=null;const Ot={Et(){if(!On(x1))return x1;let t=!0;if(le(G))t=!1;else try{const e="__mplssupport__";Ot.At(e,"xyz"),Ot.Ot(e)!=='"xyz"'&&(t=!1),Ot.Lt(e)}catch{t=!1}return t||Ce.error("localStorage unsupported; falling back to cookie store"),x1=t,t},Pt(t){Ce.error("localStorage error: "+t)},Ot(t){try{return G?.localStorage.getItem(t)}catch(e){Ot.Pt(e)}return null},Dt(t){try{return JSON.parse(Ot.Ot(t))||{}}catch{}return null},At(t,e){try{return G?.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){Ot.Pt(n)}return!1},Lt(t){try{G?.localStorage.removeItem(t)}catch(e){Ot.Pt(e)}}},S1=[Ql,Ma,co,ku,Yl,Eu,rc,mm,tc],iu=[ZC,oo,yh,OU,VC,_h,Mh,Cr],Sb=t=>t+"_cpm",vY=["__proto__","constructor","prototype"],k1=t=>{if(!xt(t))return{};const e={};return Object.keys(t).forEach(n=>{vY.indexOf(n)===-1&&(e[n]=t[n])}),e},E1=(t,e=[])=>{const n={};return[...iu,...e].forEach(i=>{const r=t[i];le(r)||On(r)||r===""||(n[i]=r)}),n},ZU=t=>{let e=5381,n=2166136261;for(let i=0;t.length>i;i++){const r=t.charCodeAt(i);e=33*e^r,n=Math.imul(n^r,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(n>>>0).toString(36)},iI=(t,e)=>({p:e,f:ZU(JSON.stringify(t))}),rI=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{const n=kn.Dt(Sb(t)),i=n?.f===ZU(e)&&Je(n.p);return{properties:i?n.p:[],isValid:i}}catch{return{properties:[],isValid:!1}}},T1=(t,e)=>e+"|"+(kn.Ot(Sb(t))||""),Kd={},ZT={Et:()=>!0,Pt(t){Ce.error("memoryStorage error: "+t)},Ot:t=>t in Kd?Kd[t]:null,Dt:t=>t in Kd?Kd[t]:null,At:(t,e)=>(Kd[t]=e,!0),Lt(t){delete Kd[t]}};let Kc=null;const dn={Et(){if(!On(Kc))return Kc;if(Kc=!0,le(G))Kc=!1;else try{const t="__support__";dn.At(t,"xyz"),dn.Ot(t)!=='"xyz"'&&(Kc=!1),dn.Lt(t)}catch{Kc=!1}return Kc},Pt(t){Ce.error("sessionStorage error: ",t)},Ot(t){try{return G?.sessionStorage.getItem(t)}catch(e){dn.Pt(e)}return null},Dt(t){try{return JSON.parse(dn.Ot(t))||null}catch{}return null},At(t,e){try{return G?.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){dn.Pt(n)}return!1},Lt(t){try{G?.sessionStorage.removeItem(t)}catch(e){dn.Pt(e)}}};var yY=class{constructor(e){this._instance=e}get Rr(){return this._instance.config}get consent(){return this.Lo()?0:this.No}isOptedOut(){return this.Rr.cookieless_mode==="always"||this.isRejected()||this.consent===-1&&this.Rr.cookieless_mode==="on_reject"}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Rr.opt_out_capturing_by_default}optInOut(e){this.qo.At(this.jo,e?1:0,this.Rr.cookie_expiration,this.Rr.cross_subdomain_cookie,this.Rr.secure_cookie)}reset(){this.qo.Lt(this.jo,this.Rr.cross_subdomain_cookie)}get jo(){const{token:e,opt_out_capturing_cookie_prefix:n,consent_persistence_name:i}=this._instance.config;return i||(n?n+e:"__ph_opt_in_out_"+e)}get No(){const e=this.qo.Ot(this.jo);return d1(e)?1:Qe(IJ,e)?0:-1}get qo(){const e=this.Rr.opt_out_capturing_persistence_type,n=e==="localStorage"?Ot:kn,i=n.Et()?n:ZT;if(!this.Bo||this.Bo!==i){this.Bo=i;const r=e==="localStorage"?kn:Ot;r.Ot(this.jo)&&(this.Bo.Ot(this.jo)||this.optInOut(d1(r.Ot(this.jo))),r.Lt(this.jo,this.Rr.cross_subdomain_cookie))}return this.Bo}Lo(){return!!this.Rr.respect_dnt&&[mi?.doNotTrack,mi?.msDoNotTrack,qe.doNotTrack,mi?.globalPrivacyControl].some(e=>d1(e))}};function WU(t,e){var n;const i=t==null||(n=t.config)===null||n===void 0?void 0:n.get_current_url;
17if(!pi(i))return e;try{const r=i(e);return mt(r)&&r?r:e}catch(r){return Ce.error("Error in get_current_url, falling back to window.location.href",r),e}}function sI(t){var e;return t instanceof Element&&(t.id==="__POSTHOG_TOOLBAR__"||!!(!((e=t.closest)===null||e===void 0)&&e.call(t,".toolbar-global-fade-container")))}function ta(t){return!!t&&t.nodeType===1}function qi(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function qU(t){return!!t&&t.nodeType===3}function XC(t){return!!t&&t.nodeType===11&&ta(t.host)}function YC(t){return t?Sw(t).split(/\s+/):[]}function oI(t,e){const n=(function(i){var r;const o=G==null||(r=G.location)===null||r===void 0?void 0:r.href;return le(o)?void 0:WU(i,o)})(e);return!!(n&&t&&t.some(i=>n.match(i)))}function Bh(t){let e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return YC(e)}function VU(t){return it(t)?null:Sw(t).split(/(\s+)/).filter(e=>Kg(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ym(t){let e="";return Ih(t)&&!_m(t)&&t.childNodes&&t.childNodes.length&&Wt(t.childNodes,function(n){var i;qU(n)&&n.textContent&&(e+=(i=VU(n.textContent))!==null&&i!==void 0?i:"")}),Sw(e)}function Hg(t){var e;return le(t.target)?t.srcElement||null:!((e=t.target)===null||e===void 0)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}const QC=["a","button","form","input","select","textarea","label"];function WT(t,e){const n=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!n&&n.call(t,e)}catch{return!1}}function qT(t,e){if(le(e))return!0;for(const n of t)if(e.some(i=>WT(n,i)))return!0;return!1}function BU(t){const e=t.parentNode;return!(!e||!ta(e))&&e}const C1=[".ph-no-autocapture","[data-ph-no-autocapture]"],GU=["next","previous","prev",">","<"],_Y=[...GU,"+","-","−","–"],aI=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,lI=[".ph-no-rageclick",".ph-no-capture"],bY=["","text","search","email","password","url","tel","number"];function JU(t,e){if(!G||eO(t))return!1;let n,i,r;var o,l;if(Or(e)?(n=!!e&&lI,i=void 0,r=!1):(n=(o=e?.css_selector_ignorelist)!==null&&o!==void 0?o:lI,i=e?.content_ignorelist,r=(l=e?.ignore_text_selection)!==null&&l!==void 0&&l),n===!1||r&&(function(d){return!(!d||!ta(d))&&(!!qi(d,"textarea")||(qi(d,"input")?Qe(bY,(d.getAttribute("type")||"").toLowerCase()):(function(f){var p;if(f.isContentEditable)return!0;const g=(p=f.getAttribute)===null||p===void 0?void 0:p.call(f,"contenteditable");return g==="true"||g===""})(d)))})(t))return!1;const{targetElementList:u}=XU(t,!1);return!(function(d,f){if(d===!1||le(d))return!1;let p;if(d===!0)p=GU;else{if(!Je(d))return!1;if(d.length>10)return Ce.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;p=d.map(g=>g.toLowerCase())}return f.some(({safeText:g,ariaLabel:v})=>p.some(y=>aI(g,y)||aI(v,y)))})(i,u.map(d=>{var f;return{safeText:ym(d).toLowerCase(),ariaLabel:((f=d.getAttribute("aria-label"))===null||f===void 0?void 0:f.toLowerCase().trim())||""}}))&&!qT(u,n)}const eO=t=>!t||qi(t,"html")||!ta(t),XU=(t,e)=>{if(!G||eO(t))return{parentIsUsefulElement:!1,targetElementList:[]};let n=!1;const i=[t];let r=t;for(;r.parentNode&&!qi(r,"body");){if(XC(r.parentNode)){i.push(r.parentNode.host),r=r.parentNode.host;continue}const o=BU(r);if(!o)break;if(e||QC.indexOf(o.tagName.toLowerCase())>-1)n=!0;else try{const l=G.getComputedStyle(o);l&&l.getPropertyValue("cursor")==="pointer"&&(n=!0)}catch{}i.push(o),r=o}return{parentIsUsefulElement:n,targetElementList:i}};function Ih(t){const e=new Set;let n=0;for(let o=t;o.parentNode&&!qi(o,"body");o=o.parentNode){if(n++>=1e3||e.has(o))return!1;e.add(o);const l=Bh(o);if(Qe(l,"ph-sensitive")||Qe(l,"ph-no-capture"))return!1}if(Qe(Bh(t),"ph-include"))return!0;const i=t.type||"";if(mt(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}const r=t.name||t.id||"";return!mt(r)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,""))}function _m(t){return!!(qi(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||qi(t,"select")||qi(t,"textarea")||t.getAttribute("contenteditable")==="true")}const cI=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11}
17)|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),uI=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,wY=[16,15,14,13],xY=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),dI=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),hI=/[0-9A-Za-z_]/;function SY(t){let e=0,n=!1;for(let i=t.length-1;i>=0;i--){let r=t.charCodeAt(i)-48;n&&(r*=2,r>9&&(r-=9)),e+=r,n=!n}return e%10==0}function Kg(t,e=!0){return!(it(t)||mt(t)&&(t=Sw(t),(e?cI.test((t||"").replace(/[- ]/g,"")):(function(n){let i;for(uI.lastIndex=0;i=uI.exec(n);){const r=i[2];if(!r)continue;const o=r.replace(/[- ]/g,"");for(let l=0;o.length>l;l++)for(const u of wY){const d=l+u;if(o.length>=d){const f=o.slice(l,d);if(cI.test(f)&&SY(f))return!0}}}return!1})(t))||(e?xY.test(t):(function(n){let i;for(dI.lastIndex=0;i=dI.exec(n);){const r=i[1],o=i[3];if(!(r&&o&&hI.test(r)&&hI.test(o)))return!0}return!1})(t))))}function fI(t){let e=ym(t);return e=`${e} ${YU(t)}`.trim(),Kg(e)?e:""}function YU(t){let e="";return t&&t.childNodes&&t.childNodes.length&&Wt(t.childNodes,function(n){var i;if(n&&((i=n.tagName)===null||i===void 0?void 0:i.toLowerCase())==="span")try{const r=ym(n);e=`${e} ${r}`.trim(),n.childNodes&&n.childNodes.length&&(e=`${e} ${YU(n)}`.trim())}catch(r){Ce.error("[AutoCapture]",r)}}),e}function pI(t){return t.replace(/"|\\"/g,'\\"')}function kY(t){const e=t.attr__class;if(e)return Je(e)?e:YC(e)}const h0=$n("[Dead Clicks]"),EY=()=>!0,TY=t=>{var e;const n=!!(!((e=t.instance.persistence)===null||e===void 0)&&e.get_property(WC)),i=t.instance.config.capture_dead_clicks;return Or(i)?i:!!xt(i)||n};var gI=class{get lazyLoadedDeadClicksAutocapture(){return this.Ho}constructor(e,n,i){this.instance=e,this.isEnabled=n,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(e){if(!e.ok)return;const n=e.config;"captureDeadClicks"in n&&(this.instance.persistence&&this.instance.persistence.register({[WC]:n.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.zo(()=>{this.Uo()}):this.stop()}zo(e){var n,i,r;!((n=qe.__PosthogExtensions__)===null||n===void 0)&&n.initDeadClicksAutocapture?e():(i=qe.__PosthogExtensions__)===null||i===void 0||(r=i.loadExternalDependency)===null||r===void 0||r.call(i,this.instance,"dead-clicks-autocapture",o=>{o?h0.error("failed to load script",o):e()})}Uo(){var e;if(he){if(!this.Ho&&(!((e=qe.__PosthogExtensions__)===null||e===void 0)&&e.initDeadClicksAutocapture)){const n=xt(this.instance.config.capture_dead_clicks)?z({},this.instance.config.capture_dead_clicks):{};n.__onCapture=this.onCapture,this.onCapture&&(n.capture_dead_swipes=!1),this.Ho=qe.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.Ho.start(he),h0.info("starting...")}}else h0.error("`document` not found. Cannot start.")}stop(){this.Ho&&(this.Ho.stop(),this.Ho=void 0,h0.info("stopping..."))}};const Pp=$n("[SegmentIntegration]");function mI(t,e,n=!0){const i=t.config.segment;if(!i)return e();const{analytics:r,filterProperties:o}=(u=>pi(u.register))(l=i)?{analytics:l}:l;var l;(function(u,d,f,p){const g=y=>{const b=()=>y.anonymousId()||po();u.config.get_device_id=b,p&&y.id()&&(u.register({distinct_id:y.id(),$device_id:b()}),u.persistence.set_property(Cr,S_)),f(p?void 0:y.anonymousId()||void 0)},v=d.user();"then"in v&&pi(v.then)?v.then(g):g(v)})(t,r,u=>{r.register(((d,f,{filterProperties:p}={})=>{typeof Promise<"u"&&Promise.resolve||Pp.warn("This browser does not have Promise support, and can not use the segment integration");const g=(v,y)=>{if(!y)return v;const b=!!f&&v.event.anonymousId===f&&!v.event.userId;b||v.event.userId||v.event.anonymousId===d.get_distinct_id()||(Pp.info("No userId set, resetting PostHog"),d.reset()),b||(f=void 0),v.event.userId&&v.event.userId!==d.get_distinct_id()&&(Pp.info("UserId set, identifying with PostHog"),d.identify(v.event.userId));let x=d.calculateEventProperties(y,v.event.properties);if(!it(p)){const S=v.event.properties||{},k={};for(const C of Object.keys(x))LC.call(S,C)||(k[C]=x[C]);const T=((C,A)=>{const $=Je(C)?C:[C];let N=z({},A);for(const j of $)try{if(N=j(N),it(N))return null}catch(O){return Pp.error("Error in Segment filterProperties:",O),null}return N})(p,k);if(it(T))return v;x=T}return v.event.properties=Object.assign({},x,v.event.properties),v};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(v){return g(v,v.event.event)},page(v){return g(v,GC)},identify(v){return g(v,FU)},screen(v){return g(v,"$screen")}}})(t,u,{filterProperties:o})).then(()=>{e()},d=>{Pp.error("Failed to register the Segment integration",d),e()})},n)}const QU="posthog-js";function e6(t,{organization:e,projectId:n,prefix:i,severityAllowList:r=["error"],sendExceptionsToPostHog:o=!0}={}){return l=>{var u,d,f,p,g;if(r!=="*"&&!r.includes(l.level)||!t.__loaded)return l;l.tags||(l.tags={});const v=t.requestRouter.endpointFor("ui",`/project/${t.config.token}/person/${t.get_distinct_id()}`);l.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(l.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));const y=((u=l.exception)===null||u===void 0?void 0:u.values)||[],b=y.map(k=>z(z({},k),{},{stacktrace:k.stacktrace?z(z({},k.stacktrace),{},{type:"raw",frames:(k.stacktrace.frames||[]).map(T=>z(z({},T),{},{platform:"web:javascript"}))}):void 0})),x={$exception_message:((d=y[0])===null||d===void 0?void 0:d.value)||l.message,$exception_type:(f=y[0])===null||f===void 0?void 0:f.type,$exception_level:l.level,$exception_list:b,$sentry_event_id:l.event_id,$sentry_exception:l.exception,$sentry_exception_message:((p=y[0])===null||p===void 0?void 0:p.value)||l.message,$sentry_exception_type:(g=y[0])===null||g===void 0?void 0:g.type,$sentry_tags:l.tags};var S;return e&&n&&(x.$sentry_url=(i||"https://sentry.io/organizations/")+e+"/issues/?project="+n+"&query="+l.event_id),o&&((S=t.exceptions)===null||S===void 0||S.sendExceptionEvent(x)),l}}var CY=class{constructor(e,n,i,r,o,l){this.name=QU,this.setupOnce=function(u){u(e6(e,{organization:n,projectId:i,prefix:r,severityAllowList:o,sendExceptionsToPostHog:l==null||l}))}}},vI=class{constructor(e){this.Wo=(n,i,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(Ce.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:r}),this.Vo=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Go()}Go(){var e;this.Zo=(e=this._instance.sessionManager)===null||e===void 0?void 0:e.onSessionId(this.Wo)}destroy(){var e;(e=this.Zo)===null||e===void 0||e.call(this),this.Zo=void 0}doPageView(e,n){var i;
17const r=this.Qo(e,n);return this.Vo={pathname:(i=G?.location.pathname)!==null&&i!==void 0?i:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var n;return this.Qo(e,(n=this.Vo)===null||n===void 0?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Vo)===null||e===void 0?void 0:e.pageViewId}}Qo(e,n){const i=this.Vo;if(!i)return{$pageview_id:n};let r={$pageview_id:n,$prev_pageview_id:i.pageViewId};const o=this._instance.scrollManager.getContext();if(o&&!this._instance.config.disable_scroll_properties){let{maxScrollHeight:l,lastScrollY:u,maxScrollY:d,maxContentHeight:f,lastContentY:p,maxContentY:g}=o;if(!(le(l)||le(u)||le(d)||le(f)||le(p)||le(g))){l=Math.ceil(l),u=Math.ceil(u),d=Math.ceil(d),f=Math.ceil(f),p=Math.ceil(p),g=Math.ceil(g);const v=l>1?Jo(u/l,0,1,Ce):1,y=l>1?Jo(d/l,0,1,Ce):1,b=f>1?Jo(p/f,0,1,Ce):1,x=f>1?Jo(g/f,0,1,Ce):1;r=pn(r,{$prev_pageview_last_scroll:u,$prev_pageview_last_scroll_percentage:v,$prev_pageview_max_scroll:d,$prev_pageview_max_scroll_percentage:y,$prev_pageview_last_content:p,$prev_pageview_last_content_percentage:b,$prev_pageview_max_content:g,$prev_pageview_max_content_percentage:x})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),r}};const Np=["flags","surveys"],OY={[MX]:{exposure:"hidden"},[bb]:{exposure:"hidden"},[IX]:{exposure:"hidden"},[PT]:{exposure:"hidden"},[Mh]:{exposure:"hidden"},[Dg]:{exposure:"hidden"},[kU]:{exposure:"event"},[NT]:{exposure:"hidden"},[TU]:{exposure:"hidden"},[MT]:{exposure:"event"},[EU]:{exposure:"hidden"},[IT]:{exposure:"event"},[zT]:{exposure:"event"},[WC]:{exposure:"event"},[qC]:{exposure:"hidden"},[CU]:{exposure:"event"},[Lg]:{exposure:"hidden"},[zX]:{exposure:"hidden"},[yh]:{exposure:"hidden"},[OU]:{exposure:"event"},[DX]:{exposure:"event",shouldSkipFromEventProperties:t=>On(t)},[KX]:{exposure:"event"},[ZX]:{exposure:"event"},[WX]:{exposure:"event"},[qX]:{exposure:"event"},[VX]:{exposure:"hidden"},[co]:{exposure:"hidden",storageGroup:"flags"},[Ma]:{exposure:"hidden",storageGroup:"flags"},[DT]:{exposure:"hidden"},[ku]:{exposure:"hidden",storageGroup:"flags"},[Yl]:{exposure:"hidden",storageGroup:"flags"},[Eu]:{exposure:"hidden",storageGroup:"flags",volatile:!0}
17,[Ug]:{exposure:"hidden",storageGroup:"flags"},[Wo]:{exposure:"hidden"},[nu]:{exposure:"hidden"},[Ql]:{exposure:"hidden"},[ec]:{exposure:"hidden"},[LT]:{exposure:"hidden",storageGroup:"surveys"},[wb]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[$U]:{exposure:"event"},[AU]:{exposure:"hidden"},[jU]:{exposure:"hidden"},[UT]:{exposure:"hidden"},[BX]:{exposure:"hidden"},[GX]:{exposure:"hidden"},[JX]:{exposure:"event"},[XX]:{exposure:"event"},[YX]:{exposure:"event"},[QX]:{exposure:"event"},[tc]:{exposure:"hidden"},[pg]:{exposure:"hidden"},[RU]:{exposure:"event"},[mm]:{exposure:"hidden"},[rc]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Cr]:{exposure:"hidden"},[FT]:{exposure:"hidden"},[eY]:{exposure:"hidden"},[PU]:{exposure:"hidden"},[NU]:{exposure:"hidden"},[_h]:{exposure:"hidden"},[VC]:{exposure:"hidden"},[LX]:{exposure:"event"},[UX]:{exposure:"event"},[FX]:{exposure:"event"},[HX]:{exposure:"event"},[IU]:{exposure:"event"},[zU]:{exposure:"event"},[DU]:{exposure:"event"},[LU]:{exposure:"event"},[tY]:{exposure:"event"},[nY]:{exposure:"event"},[iY]:{exposure:"event"},[rY]:{exposure:"event"},[sY]:{exposure:"event"},[oY]:{exposure:"event"},[aY]:{exposure:"event"},[lY]:{exposure:"event"}},RY=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],$i=t=>{const e=OY[t];if(e)return e;for(const[n,i]of RY)if(t.indexOf(n)===0)return i},wh=(t,e)=>{try{let n;return JSON.stringify(t,(i,r)=>{var o;return df(r)?((o=n)!==null&&o!==void 0||(n=new WeakMap),n.has(r)||n.set(r,HU(r)),n.get(r)):typeof r=="bigint"?r.toString():r},e)}catch{return E4(t)}},Wa=t=>{const e=he?.createElement("a");return le(e)?null:(e.href=t,e)},Gh=function(t,e){const n=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&");let i;for(let r=0;n.length>r;r++){const o=n[r].split("=");if(o[0]===e){i=o;break}}if(!Je(i)||2>i.length)return"";{let r=i[1];try{r=decodeURIComponent(r)}catch{Ce.error("Skipping decoding for malformed query param: "+r)}return r.replace(/\+/g," ")}},bm=function(t,e,n){if(!t||!e||!e.length)return t;const i=t.split("#"),r=i[1],o=(i[0]||"").split("?"),l=o[1],u=o[0],d=(l||"").split("&"),f=[];for(let g=0;d.length>g;g++){const v=d[g].split("=");Je(v)&&(e.includes(v[0])?f.push(v[0]+"="+n):f.push(d[g]))}let p=u;return l!=null&&(p+="?"+f.join("&")),r!=null&&(p+="#"+r),p},kb=function(t,e){const n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},t6=(t,e)=>t>=e&&k4(),n6=(t,e,n,i)=>{if(t===0){if(k4()){const r=e+1;return r===n&&i(),r}return e}return 0},Jh=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],$Y=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Jh],wm="<masked>",AY=["li_fat_id"];function i6(t,e,n){if(!he)return{};const i=e?[...Jh,...n||[]]:[],r=r6(bm(he.URL,i,wm),t),o=(function(){const l={};return Wt(AY,function(u){const d=Fg(u);l[u]=d||null}),l})();return pn(o,r)}function r6(t,e){const n=$Y.concat(e||[]),i={};return Wt(n,function(r){const o=Gh(t,r);i[r]=o||null}),i}function s6(t){const e=(function(r){return r?r.search("https?://(.*)google.([^/?]*)")===0?"google":r.search("https?://(.*)bing.com")===0?"bing":r.search("https?://(.*)yahoo.com")===0?"yahoo":r.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",i={};if(!On(e)){i.$search_engine=e;const r=he?Gh(he.referrer,n):"";r.length&&(i.ph_keyword=r)}return i}function o6(){return navigator.language||navigator.userLanguage}function jY(){const t=o6();return typeof t=="string"?t.split("-")[0]:void 0}const Eb="$direct";function a6(){return he?.referrer||Eb}function l6(t,e,n=!1){const i=t?[...Jh,...e||[]]:[],r=n?cc(Cn?.href):Cn?.href,o=r?.substring(0,1e3);return{r:a6().substring(0,1e3),u:o?bm(o,i,wm):void 0}}function c6(t,e=!1){var n;const{r:i,u:r}=t,o=e?cc(r):r,l={$referrer:i,$referring_domain:i==null?void 0:i==Eb?Eb:(n=Wa(i))===null||n===void 0?void 0:n.host};
17if(o){l.$current_url=o;const u=Wa(o);l.$host=u?.host,l.$pathname=u?.pathname;const d=r6(o);pn(l,d)}if(i){const u=s6(i);pn(l,u)}return l}function u6(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function PY(){try{return new Date().getTimezoneOffset()}catch{return}}const NY={flags:rc,surveys:wb},MY=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],f0=t=>`${t}_cookie_identity_change_pending`,p0=t=>{let e="",n=0;for(const i of t){const r=encodeURIComponent(JSON.stringify(i).slice(1,-1)).length;if(n+r>1e3)break;e+=i,n+=r}return e},ai="main",$a=[co,Ma,ku,Yl,Eu,rc,Ug,Ql],O1=t=>$a.indexOf(t)!==-1,d6=[Mh,Dg],yI=t=>d6.indexOf(t)!==-1,Nl=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch{return t===e}},Zd=t=>{if(!t)return{};const e=JSON.parse(t);return xt(e)?e:{}},_I=(t,e)=>{Wt(t,(n,i)=>{const r=$i(i);r&&r.exposure!=="event"||{}.hasOwnProperty.call(e,i)||delete t[i]})};var R1=class{constructor(t,e,n=!0){if(this.Jo={},this.Ko=!1,this.Xo=!1,this.Yo=!1,this.ta=!1,this.ea=!1,this.ia=new Map,this.na=!1,this.sa=!1,this.ra=!1,this.oa=new Set,this.aa=new Set,this.Rr=t,this.la=n,this.props={},this.ua=void 0,this.ha=(i=>{let r="";return i.token&&(r=i.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),i.persistence_name?"ph_"+i.persistence_name:"ph_"+r+"_posthog"})(t),this.qo=this.ca(t),this.Yo=this.da(t),this.load(),this.va(),t.debug&&Ce.info("Persistence loaded",t.persistence,z({},this.props)),this.update_config(t,t,e),this.save(),G){const i=()=>this.flush();Ht(G,"beforeunload",i,{capture:!1}),Ht(G,"pagehide",i,{capture:!1}),this.fa=r=>{if(this.Ko&&(!r.storageArea||r.storageArea===G?.localStorage)&&r.key)if(r.key!==this.ha){if(this.Yo){const o=Np.find(l=>r.key===this.pa(l));o&&this.ga(r.key,o)}}else this.ga(r.key,ai)},Ht(G,"storage",this.fa)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach(([e,n])=>{const i=this.ia.get(e);if(!O1(e)||i===!0)return;if(n===!0)return void this.ma(e,!0);const r=new Set(i||[]);n.forEach(o=>r.add(o)),r.size&&this.ma(e,r)})}onCrossTabFeatureFlagChange(t){return this.aa.add(t),()=>this.aa.delete(t)}destroy(){this.fa&&G&&(G.removeEventListener("storage",this.fa),this.fa=void 0),this.aa.clear()}ga(t,e,n=!0){if(this.mi)return!1;let i,r;try{if(r=Ot.Ot(t),On(r)){const u=this.ya(e);return u.storageValue=null,e!==ai&&(u.persisted=!1),!1}i=Zd(r)}catch{return!1}const o=e===ai?i:Ot.Dt(this.ha);if(o&&this.ba(o))return!1;const l=this._a(i,e,n);return e===ai&&this.Yo&&!Nl(this.wa().main,i)||this.ka(i,e,!0,r),l}ba(t){const e=this.props[oo],n=t[oo];return!le(e)&&!le(n)&&e!==n}ka(t,e,n,i){const r=this.ya(e);r.storageValue=i,e!==ai&&(r.persisted=n);try{r.fingerprint=this.Sa(t,e)}catch{r.fingerprint=void 0}}_a(t,e,n){let i=!1;return $a.forEach(r=>{var o;const l=(o=$i(r))===null||o===void 0?void 0:o.storageGroup;if(e===ai&&this.Yo&&l||e!==ai&&l!==e)return;const u=r in t,d=this.xa(r,u?t[r]:void 0),f=this.ia.has(r)?r in this.props:u;f===r in this.props&&Nl(d,this.props[r])||(f?this.Ca(r,d,!1):this.$a(r,!1),i=!0)}),i&&n&&this.aa.forEach(r=>r()),i}Ta(){if(!this.Ko)return!1;try{this.ra=!1;const t=Ot.Ot(this.ha),e=this.ya(ai);let n,i=!1,r=!1;if(t!==e.storageValue)if(On(t))e.storageValue=null;else{if(n=Zd(t),this.ra=!this.sa&&this.ba(n),this.ra)return!1;r=this._a(n,ai,!1),!this.Yo||Nl(this.wa().main,n)?this.ka(n,ai,!0,t):e.storageValue=t,i=!0}
17return this.Yo&&Np.forEach(o=>{const l=Ot.Ot(this.pa(o)),u=this.ya(o),d=n||{},f=i&&$a.some(g=>{var v;return((v=$i(g))===null||v===void 0?void 0:v.storageGroup)===o&&g in d});if(l===u.storageValue&&!f)return;if(On(l))return u.storageValue=null,u.persisted=!1,void(f&&(r=this._a(d,o,!1)||r));const p=Zd(l);r=this._a(p,o,!1)||r,this.ka(p,o,!0,l)}),r}catch{return!1}}ma(t,e){this.ia.set(t,e);const n=$i(t);n?.volatile||(this.ya((this.Yo?n?.storageGroup:void 0)||ai).fingerprint=void 0,this.Ia(t))}Ma(){$a.forEach(t=>this.ia.set(t,!0))}va(){if(this.Ko)try{const t=Ot.Ot(this.ha),e=Zd(t);this.ya(ai).storageValue=t,$a.forEach(n=>{var i;const r=this.Yo?(i=$i(n))===null||i===void 0?void 0:i.storageGroup:void 0,o=r?Ot.Ot(this.pa(r)):null;if(r){const u=this.ya(r);u.storageValue=o,u.persisted=!On(o)}const l=r&&!On(o)?Zd(o):e;n in this.props?this.Ea(n,l[n],this.props[n]):n in l&&this.ma(n,!0)})}catch{}}xa(t,e){const n=this.ia.get(t);if(!n)return e;if(n===!0)return this.props[t];if(t==="$active_feature_flags"){const o=new Set(Je(e)?e:[]),l=new Set(Je(this.props[t])?this.props[t]:[]);return n.forEach(u=>l.has(u)?o.add(u):o.delete(u)),Array.from(o)}const i=xt(e)?z({},e):{},r=xt(this.props[t])?this.props[t]:{};return n.forEach(o=>{o in r?i[o]=r[o]:delete i[o]}),i}Ea(t,e,n){if(!O1(t))return;const i=this.ia.get(t);if(i===!0)return;let r=e;if(this.Ko)try{var o;const u=this.Yo?(o=$i(t))===null||o===void 0?void 0:o.storageGroup:void 0,d=u?this.pa(u):this.ha;r=Zd(Ot.Ot(d))[t]}catch{}const l=new Set(i||[]);if(t==="$active_feature_flags"){if(!le(e)&&!Je(e)||!le(r)&&!Je(r)||!Je(n))return void this.ma(t,!0);const u=new Set(e||[]),d=new Set(r||[]),f=new Set(n);new Set([...u,...f]).forEach(p=>{u.has(p)!==f.has(p)&&l.add(p)}),l.forEach(p=>{d.has(p)===f.has(p)&&l.delete(p)})}else{if(!xt(n))return void(Nl(r,n)?this.ia.delete(t):this.ma(t,!0));{if(!le(e)&&!xt(e)||le(e)&&zr(n)&&le(r))return void this.ma(t,!0);const u=xt(e)?e:{},d=xt(r)?r:{};new Set([...Object.keys(u),...Object.keys(n)]).forEach(f=>{f in u==f in n&&Nl(u[f],n[f])||l.add(f)}),l.forEach(f=>{f in d==f in n&&Nl(d[f],n[f])&&l.delete(f)})}}l.size?this.ma(t,l):this.ia.delete(t)}Pa(){var t;const e=(t=this.Rr)===null||t===void 0?void 0:t.persistence_save_debounce_ms;return Fn(e)&&e>0?e:0}Ra(t){if(this.Rr.cookieWinsOnConflict&&this.Rr.persistence.toLowerCase()==="localstorage+cookie")if(t)try{const e=E1(t,this.Rr.cookie_persisted_properties||[]),n=iI(e,this.Rr.cookie_persisted_properties||[]),i=JSON.stringify(e)+"|"+JSON.stringify(n),r=kn.Ot(this.ha)||void 0;r&&T1(this.ha,r)===i&&(this.Aa=i,this.Fa=r)}catch{}else try{const e=kn.Ot(this.ha)||void 0;this.Aa=e?T1(this.ha,e):void 0,this.Fa=e}catch{}}syncCookieProperties(){return this.Oa(this.Rr)}Oa(t,e=!1){if(this.mi&&!e||this.ea||!t.cookieWinsOnConflict||t.persistence.toLowerCase()!=="localstorage+cookie")return!1;let n;try{n=kn.Ot(this.ha)||void 0}catch{}if(!n||n===this.Fa)return!1;const i=T1(this.ha,n);let r;try{r=k1(JSON.parse(n))}catch{return!1}if((kn.Ot(this.ha)||void 0)!==n)return!1;this.Aa=i,this.Fa=n;const o=rI(this.ha,n),l=[...iu,...o.properties],u={};if(Object.keys(r).forEach(x=>{const S=r[x];(le(S)||On(S)||S===""||x==="$user_state"&&S!=="anonymous"&&S!=="identified")&&(u[x]=!0,delete r[x])}),zr(r))return!1;const d="distinct_id"in r||r.$user_state==="anonymous"||r.$user_state==="identified",f=this.props,p=f[oo],g=f[Cr],v=pn({},f);[...iu,...t.cookie_persisted_properties||[]].forEach(x=>{if(l.indexOf(x)!==-1&&!(x in r)&&!u[x]&&(d||x!=="distinct_id"&&x!=="$user_state")){const S=v[x];(o.isValid||iu.indexOf(x)===-1||S!==!1&&S!==0)&&delete v[x]}}),this.props=pn(v,r),$a.forEach(x=>{const S=x in this.props;x in f===S&&Nl(f[x],this.props[x])||(S?this.Ea(x,f[x],this.props[x]):this.ma(x,!0))}),!d||"$user_state"in r||"$user_state"in this.props||this.Ca(Cr,Ia);const y=this.props[oo],b=this.props[Cr];return!d||y===p&&b===g||(this.sa=!0,this.ta=!0,dn.At(f0(this.ha),!0),this.$a(Ql),this.$a(Ma),this.$a(co),this.$a(ku),this.$a(Yl),this.$a(Eu),this.$a(rc),this.$a(mm),this.$a(tc),b!=="anonymous"||g!=="identified"&&r.$user_state!=="anonymous"&&(le(p)||y===p)||(_I(this.props,r),this.$a(ec)
17),b==="identified"?this.props.$user_id=y:delete this.props.$user_id,this.$a(bb)),!0}consumeCookieIdentityChange(){const t=f0(this.ha),e=this.ta||!!dn.Ot(t);return this.ta=!1,e&&dn.Lt(t),e}Da(t=!1){return!(this.ea||this.mi&&!t||!this.Rr.cookieWinsOnConflict||this.Rr.persistence.toLowerCase()!=="localstorage+cookie"||(this.ea=!0,0))}La(){this.ea&&(le(this.Na)||(clearTimeout(this.Na),this.Na=void 0),delete this.Jo[ai],this.qa(!0))}ja(t=!0){if(this.ea)try{t?this.La():le(this.Na)||(clearTimeout(this.Na),this.Na=void 0)}finally{this.ea=!1}}isDisabled(){return!!this.mi}ca(t){MY.indexOf(t.persistence.toLowerCase())===-1&&(Ce.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");const e=((l=[],u=!1)=>{const d=[...iu,...l];return z(z({},Ot),{},{Dt(f){try{let g,v={};try{g=kn.Ot(f)||void 0,v=g?k1(JSON.parse(g)):{}}catch{}const y=JSON.parse(Ot.Ot(f)||"{}");let b;if(u){const x=rI(f,g),S=[...iu,...x.properties],k={};Object.keys(v).forEach(C=>{const A=v[C];On(A)||A===""||C==="$user_state"&&A!=="anonymous"&&A!=="identified"||(k[C]=A)});const T="distinct_id"in k||k.$user_state==="anonymous"||k.$user_state==="identified";if(Object.keys(k).length>0){var p;const C=y[oo],A=(p=y.$user_state)!==null&&p!==void 0?p:Ia;d.forEach($=>{if(S.indexOf($)!==-1&&!($ in v)&&(T||$!=="distinct_id"&&$!=="$user_state")){const N=y[$];(x.isValid||iu.indexOf($)===-1||N!==!1&&N!==0)&&delete y[$]}}),!T||"$user_state"in v||"$user_state"in y||(y[Cr]=Ia),!T||("distinct_id"in k?k[oo]:y[oo])===C&&("$user_state"in k?k[Cr]:y[Cr])===A||(S1.forEach($=>delete y[$]),k.$user_state==="identified"&&"distinct_id"in k?y.$user_id=k[oo]:delete y.$user_id,k.$user_state!=="identified"&&(delete y[RU],delete y[ec]),delete y.__alias)}b=pn(y,k)}else b=pn(v,y);return Ot.At(f,b),b}catch{}return null},At(f,p,g,v,y,b){const x=Ot.At(f,p,void 0,void 0,b);try{const S=E1(p,l);if(Object.keys(S).length){if(u){const k=Sb(f),T=iI(S,l);if(kn.At(k,T,g,v,y,b),kn.Ot(k)!==JSON.stringify(T)){kn.Lt(k,v);const C=E1(p);return kn.At(f,C,g,v,y,b),x}}kn.At(f,S,g,v,y,b)}}catch(S){Ot.Pt(S)}return x},Lt(f,p){try{G?.localStorage.removeItem(f),kn.Lt(f,p),kn.Lt(Sb(f),p)}catch(g){Ot.Pt(g)}}})})(t.cookie_persisted_properties||[],t.cookieWinsOnConflict);let n,i=!1,r=!1;const o=t.persistence.toLowerCase();return o==="localstorage"&&Ot.Et()?(n=Ot,r=!0):o==="localstorage+cookie"&&e.Et()?(n=e,r=!0,i=!0):o==="sessionstorage"&&dn.Et()?n=dn:o==="memory"?n=ZT:o==="cookie"&&kn.Et()?(n=kn,i=!0):e.Et()?(n=e,r=!0,i=!0):kn.Et()?(n=kn,i=!0):n=ZT,this.Ko=r,this.Xo=i,n}pa(t){return`${this.ha}__${t}`}da(t){return this.Ko&&!!t.split_storage}properties(){const t={};return Wt(this.props,(e,n)=>{const i=$i(n);if(!i||i.exposure==="event"){var r;if(!(i==null||(r=i.shouldSkipFromEventProperties)===null||r===void 0)&&r.call(i,e))return;t[n]=e}}),t}load(t=!1){if(this.mi&&!t)return;const e=this.Rr.cookieWinsOnConflict&&this.Rr.persistence.toLowerCase()==="localstorage+cookie",n=e?Ot.Dt(this.ha):null;let i={};if(e)try{i=k1(kn.Dt(this.ha)),Wt(i,(u,d)=>{(le(u)||On(u)||u==="")&&delete i[d]})}catch{}const r=this.qo.Dt(this.ha);if(r&&(this.props=pn({},r)),this.Yo&&this.Ba(),e&&r){var o,l;const u=n?.[oo],d=(o=n?.$user_state)!==null&&o!==void 0?o:Ia,f=r[oo],p=(l=r.$user_state)!==null&&l!==void 0?l:Ia;if(f!==u||p!==d){this.ta=!0,dn.At(f0(this.ha),!0);const g=pn({},this.props);S1.forEach(y=>delete g[y]),p!=="anonymous"||d!=="identified"&&i.$user_state!=="anonymous"&&(le(u)||f===u)||(_I(g,i),delete g[ec]),this.props=g;const v=new Set;S1.forEach(y=>{var b;const x=(b=$i(y))===null||b===void 0?void 0:b.storageGroup;x&&v.add(x)}),v.forEach(y=>{const b={};Wt(this.props,(x,S)=>{var k;((k=$i(S))===null||k===void 0?void 0:k.storageGroup)===y&&(b[S]=x)}),zr(b)?(Ot.Lt(this.pa(y)),this.Jo[y]={}):Ot.At(this.pa(y),b)&&(this.Jo[y]={persisted:!0,fingerprint:this.Sa(b,y)})})}}dn.Ot(f0(this.ha))&&(this.ta=!0)}Ba(){for(const t of Np){const e=Ot.Dt(this.pa(t));if(e&&!zr(e)){const n=this.ya(t);n.persisted=!0,this.Ha(t)||(n.fingerprint=this.Sa(e,t)),this.za(t,e)||pn(this.props,e)}}}Ha(t){return Object.keys(this.props).some(e=>{var n;return((n=$i(e))===null||n===void 0?void 0:n.storageGroup)===t})}za(t,e){const n=NY[t];if(!n)return!1;const i=e[n],r=this.props[n];return Fn(i)&&Fn(r)&&r>i}refreshKey(t){var e;if(this.mi||this.oa.has(t))return;const n=this.Yo?(e=$i(t))===null||e===void 0?void 0:e.storageGroup:void 0,i=n?Ot.Dt(this.pa(n)):this.qo.Dt(this.ha);if(i&&t in i)this.Ca(t,i[t],!1);else{if(n){const r=this.qo.Dt(this.ha);if(r&&t in r)return void this.Ca(t,r[t],!1)}this.$a(t,!1)}}save(){if(this.mi)return;const t=this.Pa();t>0?le(this.Na)&&(this.Na=setTimeout(()=>{this.Na=void 0,this.qa()},t)):this.qa()}flush(){le(this.Na)||(clearTimeout(this.Na),this.Na=void 0,this.qa())}qa(t=!1){if(this.mi||this.ea&&!t)return;t||(this.syncCookieProperties(),this.Rr.cookieWinsOnConflict&&this.Rr.persistence.toLowerCase()==="localstorage+cookie"||d6.forEach(r=>this.refreshKey(r)));const e=!t&&!this.na;e||(this.ra=!1);const n=!!e&&this.Ta();if(this.ra)return void(this.Rr.debug&&Ce.warn("skipping persistence write because storage belongs to a different distinct ID"));
17if(this.Yo)return this.Ua(),void(n&&this.aa.forEach(r=>r()));const i=this.Wa(this.qo,this.ha,this.props,ai);i==="written"&&this.Ra(this.props),i!=="failed"&&(this.ia.clear(),this.sa=!1,this.oa.clear()),n&&this.aa.forEach(r=>r())}Ua(){const{main:t,groups:e}=this.wa(),n=this.Wa(this.qo,this.ha,t,ai);n==="written"&&this.Ra(t),n!=="failed"&&(this.sa=!1,this.oa.clear(),$a.forEach(r=>{var o;!((o=$i(r))===null||o===void 0)&&o.storageGroup||this.ia.delete(r)}));for(const r of Np){var i;const o=e[r];if(zr(o)&&!(!((i=this.Jo[r])===null||i===void 0)&&i.persisted)){$a.forEach(u=>{var d;((d=$i(u))===null||d===void 0?void 0:d.storageGroup)===r&&this.ia.delete(u)});continue}const l=this.Wa(Ot,this.pa(r),o,r);l!=="failed"&&$a.forEach(u=>{const d=$i(u);d?.storageGroup!==r||l!=="written"&&d.volatile||this.ia.delete(u)})}}wa(){const t={},e={flags:{},surveys:{}};return Wt(this.props,(n,i)=>{var r;const o=(r=$i(i))===null||r===void 0?void 0:r.storageGroup;o?e[o][i]=n:t[i]=n}),{main:t,groups:e}}Sa(t,e){if(e===ai)return JSON.stringify(t)+"|"+this.Va+"|"+this.Ga+"|"+this.Za;const n={};return Wt(t,(i,r)=>{var o;n[r]=!((o=$i(r))===null||o===void 0)&&o.volatile?"__volatile__":i}),JSON.stringify(n)}Wa(t,e,n,i){const r=this.ya(i);if(i!==ai&&!r.dirty&&!le(r.fingerprint))return"skipped";let o;try{if(o=this.Sa(n,i),o===r.fingerprint)return r.dirty=!1,"skipped"}catch{o=void 0}return t.At(e,n,this.Va,this.Ga,this.Za,this.Rr.debug)?(r.dirty=!1,i!==ai&&(r.persisted=!0),le(o)||(r.fingerprint=o),this.Ko&&(r.storageValue=Ot.Ot(e)),"written"):(this.Rr.debug&&Ce.warn(`failed to persist storage entry "${e}"; will retry on next save`),"failed")}remove({keepGroupEntries:t=!1}={}){if(this.Ma(),le(this.Na)||(clearTimeout(this.Na),this.Na=void 0),this.qo.Lt(this.ha,!1),this.qo.Lt(this.ha,!0),!t&&this.la)for(const e of Np)Ot.Lt(this.pa(e));t?delete this.Jo[ai]:this.Jo={},this.Aa=void 0,this.Fa=void 0}clear(){this.remove(),this.props={}}register_once(t,e,n){if(xt(t)){this.syncCookieProperties(),le(e)&&(e="None"),this.Va=le(n)?this.Qa:n;let i=!1;if(Wt(t,(r,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==e||(this.Ca(o,r),i=!0)}),i)return this.save(),!0}return!1}register(t,e){if(xt(t)){this.syncCookieProperties(),this.Va=le(e)?this.Qa:e;let n=!1;if(Wt(t,(i,r)=>{t.hasOwnProperty(r)&&(this.props[r]!==i||xt(i)||Je(i))&&(this.Ca(r,i),n=!0)}),n)return this.save(),!0}return!1}unregister(t){this.syncCookieProperties();const e=typeof t=="string"?[t]:t;let n=!1;for(const i of e)i in this.props&&(this.$a(i),n=!0);n&&this.save()}update_campaign_params(){const t=he?.URL;if(t===this.ua)return;const e=i6(this.Rr.custom_campaign_params,this.Rr.mask_personal_data_properties,this.Rr.custom_personal_data_properties),n=!zr(JC(e));return n&&this.register(e),this.ua=t,n?e:void 0}update_search_keyword(){this.register((function(){const t=he?.referrer;return t?s6(t):{}})())}update_referrer_info(){var t;this.register_once({$referrer:a6(),$referring_domain:he?.referrer&&((t=Wa(he.referrer))===null||t===void 0?void 0:t.host)||Eb},void 0)}set_initial_person_info(){if(this.props.$initial_campaign_params||this.props.$initial_referrer_info)return;const t=l6(this.Rr.mask_personal_data_properties,this.Rr.custom_personal_data_properties,this.Rr.disable_capture_url_hashes);this.register_once({[_h]:this.Xo?{r:p0(t.r),u:t.u?p0(t.u):void 0}:t},void 0)}get_initial_props(){const t={};Wt([NU,PU],n=>{const i=this.props[n];i&&Wt(i,function(r,o){t["$initial_"+ET(o)]=r})});const e=this.props[_h];if(e){const n=(function(i,r=!1){const o=c6(i,r),l={};return Wt(o,function(u,d){l[`$initial_${ET(d)}`]=u}),l})(e,this.Rr.disable_capture_url_hashes);pn(t,n)}return t}
17safe_merge(t){return Wt(this.props,function(e,n){n in t||(t[n]=e)}),t}update_config(t,e,n){const i=t.persistence!==e.persistence,r=!((y,b)=>{if(y.length!==b.length)return!1;const x=[...y].sort(),S=[...b].sort();return x.every((k,T)=>k===S[T])})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),o=i||r,l=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,u=t.disable_persistence||!!n,d=!!this.mi&&!u;u||this.Oa(e,d),this.Rr=t,!u&&(i||r||l)&&(this.Aa=void 0,this.Fa=void 0,this.Oa(z(z({},t),{},{cookie_persisted_properties:e.cookie_persisted_properties}),d));const f=o||l?this.ca(t):this.qo;this.Ja();const p=this.da(t),g=o||p!==this.Yo,v=!u&&(g||t.cross_subdomain_cookie!==this.Ga||t.secure_cookie!==this.Za)&&this.Da(d);this.na=g;try{if(this.Qa=this.Va=t.cookie_expiration,this.set_disabled(u),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),g){const y=this.props;this.clear(),this.qo=f,this.Yo=p,this.props=y,this.save()}else l&&(this.qo=f,u||(delete this.Jo[ai],this.qa()))}finally{this.na=!1,v&&this.ja()}}Ja(){const t=this.props[_h];if(!this.Xo||!xt(t)||typeof t.r!="string")return;const e=p0(t.r),n=typeof t.u=="string"?p0(t.u):t.u;e===t.r&&n===t.u||this.Ca(_h,z(z({},t),{},{r:e,u:n}))}set_disabled(t){this.mi=t,this.mi?this.remove():this.save()}set_cross_subdomain(t){t!==this.Ga&&(this.Ga=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.Za&&(this.Za=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){const n=this.props.__timers||{};n[t]=e,this.Ca(PT,n),this.save()}remove_event_timer(t){const e=this.props.__timers||{},n=e[t];return le(n)||(delete e[t],this.Ca(PT,e),this.save()),n}get_property(t){return this.props[t]}set_property(t,e){this.Ca(t,e),this.save()}Ca(t,e,n=!0){var i;const r=this.props[t];this.props[t]=e,n&&(t!=="distinct_id"&&t!=="$user_state"||r===e||(this.sa=!0),yI(t)&&!Nl(r,e)&&this.oa.add(t),this.Ea(t,r,e),!((i=$i(t))===null||i===void 0)&&i.volatile||this.Ia(t))}$a(t,e=!0){delete this.props[t],e&&(O1(t)&&this.ma(t,!0),yI(t)&&this.oa.add(t),this.Ia(t))}Ia(t){var e;const n=(e=$i(t))===null||e===void 0?void 0:e.storageGroup;n&&(this.ya(n).dirty=!0)}ya(t){return this.Jo[t]||(this.Jo[t]={})}};const cs={GZipJS:"gzip-js",Base64:"base64"},Mp={Activation:"events",Cancellation:"cancelEvents"},$1={Popover:"popover",API:"api",Widget:"widget"},za={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},A1={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},VT={Popover:"popover",Inline:"inline"};function g0(t){let e=!0;return{dispose(){if(e){e=!1;const n=t();n&&pi(n.then)&&n.then(void 0,()=>{})}}}}const IY={SHOWN:"product tour shown"},bI={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},wI=$n("[RateLimiter]");var zY=class{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{const n=e.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach(i=>{wI.info(`${i||"events"} is quota limited.`),this.serverLimits[i]=new Date().getTime()+6e4})}catch(i){return void wI.warn(`could not rate limit - continuing. Error: "${i?.message}"`,{text:n})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return((t=this.instance.config.rate_limiting)===null||t===void 0?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max(((t=this.instance.config.rate_limiting)===null||t===void 0?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t=!1){var e,n,i;const{captureEventsBurstLimit:r,captureEventsPerSecond:o}=this,l=new Date().getTime(),u=(e=(n=this.instance.persistence)===null||n===void 0?void 0:n.get_property("$capture_rate_limit"))!==null&&e!==void 0?e:{tokens:r,last:l};u.tokens+=(l-u.last)/1e3*o,u.last=l,u.tokens>r&&(u.tokens=r);const d=1>u.tokens;if(d||t||(u.tokens=Math.max(0,u.tokens-1)),d&&!t){const f=(Fn(u.dropped)?u.dropped:0)+1;u.dropped=f,!this.lastEventRateLimited&&this.Ka(f)&&(u.dropped=0)}return this.lastEventRateLimited=d,(i=this.instance.persistence)===null||i===void 0||i.set_property("$capture_rate_limit",u),{isRateLimited:d,remainingTokens:u.tokens}
17}Xa(t){const e=this.instance.config.property_denylist;return!Je(e)||!e.includes(t)}Ya(){var t;if(this.Xa("$current_url")&&this.Xa("$pathname")&&Cn?.pathname)return`${(t=Cn.origin)!==null&&t!==void 0?t:""}${Cn.pathname}`}Ka(t){var e,n;const{captureEventsBurstLimit:i,captureEventsPerSecond:r}=this,o=this.Ya(),l=this.Xa("$session_id")?(e=(n=this.instance).get_session_id)===null||e===void 0?void 0:e.call(n):void 0,u=[`${t} event(s) dropped since the last warning`,o?`triggered on ${o}`:void 0,l?`session ${l}`:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:`posthog-js client rate limited: ${u}. Config is set to ${r} events per second and ${i} events burst limit.`},{skip_client_rate_limiting:!0})}isServerRateLimited(t){const e=this.serverLimits[t||"events"]||!1;return e!==!1&&new Date().getTime()<e}};const Ml=$n("[RemoteConfig]");var h6=class{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=qe._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(t=t[this._instance.config.token])===null||t===void 0?void 0:t.config}tl(t){var e,n,i;!((e=qe.__PosthogExtensions__)===null||e===void 0)&&e.loadExternalDependency?(n=qe.__PosthogExtensions__)===null||n===void 0||(i=n.loadExternalDependency)===null||i===void 0||i.call(n,this._instance,"remote-config",()=>t(this.remoteConfig)):t()}el(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets",`/array/${this._instance.config.token}/config`),callback:t})}load(){try{if(this.remoteConfig)return Ml.info("Using preloaded remote config",this.remoteConfig),void this.il(this.remoteConfig);if(this._instance.nl())return void Ml.warn("Remote config is disabled. Falling back to local config.");this.tl(t=>{if(!t)return Ml.info("No config found after loading remote JS config. Falling back to JSON."),void this.el(e=>{this.il(e.json,e)});this.il(t)})}catch(t){Ml.error("Error loading remote config",t),this.il()}}il(t,e){!t&&e&&(e.statusCode===0?e.error||Ml.warn("Failed to fetch remote config from PostHog."):Ml.error("Failed to fetch remote config from PostHog."));try{this._instance.il(t?{ok:!0,config:t}:{ok:!1})}catch(i){Ml.error("Error applying remote config",i)}if(t?.hasFeatureFlags!==!1&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var n;(n=this._instance.featureFlags)===null||n===void 0||n.ensureFlagsLoaded()}catch(i){Ml.error("Error loading feature flags",i)}}},Ls=Uint8Array,Ur=Uint16Array,Xh=Uint32Array,tO=new Ls([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),nO=new Ls([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),xI=new Ls([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),f6=function(t,e){for(var n=new Ur(31),i=0;31>i;++i)n[i]=e+=1<<t[i-1];var r=new Xh(n[30]);for(i=1;30>i;++i)for(var o=n[i];n[i+1]>o;++o)r[o]=o-n[i]<<5|i;return[n,r]},p6=f6(tO,2),BT=p6[1];p6[0][28]=258,BT[258]=28;for(var SI=f6(nO,0)[1],g6=new Ur(32768),Rn=0;32768>Rn;++Rn){var Wd=(43690&Rn)>>>1|(21845&Rn)<<1;g6[Rn]=((65280&(Wd=(61680&(Wd=(52428&Wd)>>>2|(13107&Wd)<<2))>>>4|(3855&Wd)<<4))>>>8|(255&Wd)<<8)>>>1}var Zg=function(t,e,n){for(var i=t.length,r=0,o=new Ur(e);i>r;++r)++o[t[r]-1];var l,u=new Ur(e);for(r=0;e>r;++r)u[r]=u[r-1]+o[r-1]<<1;for(l=new Ur(i),r=0;i>r;++r)l[r]=g6[u[t[r]-1]++]>>>15-t[r];return l},Mu=new Ls(288);for(Rn=0;144>Rn;++Rn)Mu[Rn]=8;for(Rn=144;256>Rn;++Rn)Mu[Rn]=9;for(Rn=256;280>Rn;++Rn)Mu[Rn]=7;for(Rn=280;288>Rn;++Rn)Mu[Rn]=8;var Tb=new Ls(32);for(Rn=0;32>Rn;++Rn)Tb[Rn]=5;var DY=Zg(Mu,9),LY=Zg(Tb,5),m6=function(t){return(t/8|0)+(7&t&&1)},v6=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var i=new(t instanceof Ur?Ur:t instanceof Xh?Xh:Ls)(n-e);return i.set(t.subarray(e,n)),i},Ea=function(t,e,n){var i=e/8|0;t[i]|=n<<=7&e,t[i+1]|=n>>>8},Ip=function(t,e,n){var i=e/8|0;t[i]|=n<<=7&e,t[i+1]|=n>>>8,t[i+2]|=n>>>16},j1=function(t,e){for(var n=[],i=0;t.length>i;++i)t[i]&&n.push({s:i,f:t[i]});var r=n.length,o=n.slice();if(!r)return[new Ls(0),0];if(r==1){var l=new Ls(n[0].s+1);return l[n[0].s]=1,[l,1]}n.sort(function($,N){return $.f-N.f}),n.push({s:-1,f:25001});var u=n[0],d=n[1],f=0,p=1,g=2;for(n[0]={s:-1,f:u.f+d.f,l:u,r:d};p!=r-1;)u=n[n[g].f>n[f].f?f++:g++],d=n[f!=p&&n[g].f>n[f].f?f++:g++],n[p++]={s:-1,f:u.f+d.f,l:u,r:d};var v=o[0].s;for(i=1;r>i;++i)o[i].s>v&&(v=o[i].s);var y=new Ur(v+1),b=GT(n[p-1],y,0);if(b>e){i=0;var x=0,S=b-e,k=1<<S;for(o.sort(function($,N){return y[N.s]-y[$.s]||$.f-N.f});r>i;++i){var T=o[i].s;if(e>=y[T])break;x+=k-(1<<b-y[T]),y[T]=e}for(x>>>=S;x>0;
17){var C=o[i].s;e>y[C]?x-=1<<e-y[C]++-1:++i}for(;i>=0&&x;--i){var A=o[i].s;y[A]==e&&(--y[A],++x)}b=e}return[new Ls(y),b]},GT=function(t,e,n){return t.s==-1?Math.max(GT(t.l,e,n+1),GT(t.r,e,n+1)):e[t.s]=n},kI=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Ur(++e),i=0,r=t[0],o=1,l=function(d){n[i++]=d},u=1;e>=u;++u)if(t[u]==r&&u!=e)++o;else{if(!r&&o>2){for(;o>138;o-=138)l(32754);o>2&&(l(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(l(r),--o;o>6;o-=6)l(8304);o>2&&(l(o-3<<5|8208),o=0)}for(;o--;)l(r);o=1,r=t[u]}return[n.subarray(0,i),e]},zp=function(t,e){for(var n=0,i=0;e.length>i;++i)n+=t[i]*e[i];return n},JT=function(t,e,n){var i=n.length,r=m6(e+2);t[r]=255&i,t[r+1]=i>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var o=0;i>o;++o)t[r+o+4]=n[o];return 8*(r+4+i)},EI=function(t,e,n,i,r,o,l,u,d,f,p){Ea(e,p++,n),++r[256];for(var g=j1(r,15),v=g[0],y=g[1],b=j1(o,15),x=b[0],S=b[1],k=kI(v),T=k[0],C=k[1],A=kI(x),$=A[0],N=A[1],j=new Ur(19),O=0;T.length>O;++O)j[31&T[O]]++;for(O=0;$.length>O;++O)j[31&$[O]]++;for(var L=j1(j,7),B=L[0],V=L[1],ee=19;ee>4&&!B[xI[ee-1]];--ee);var me,ne,ce,Z,ae=f+5<<3,ue=zp(r,Mu)+zp(o,Tb)+l,ge=zp(r,v)+zp(o,x)+l+14+3*ee+zp(j,B)+(2*j[16]+3*j[17]+7*j[18]);if(ue>=ae&&ge>=ae)return JT(e,p,t.subarray(d,d+f));if(Ea(e,p,1+(ue>ge)),p+=2,ue>ge){me=Zg(v,y),ne=v,ce=Zg(x,S),Z=x;var Re=Zg(B,V);for(Ea(e,p,C-257),Ea(e,p+5,N-1),Ea(e,p+10,ee-4),p+=14,O=0;ee>O;++O)Ea(e,p+3*O,B[xI[O]]);p+=3*ee;for(var xe=[T,$],Ie=0;2>Ie;++Ie){var Oe=xe[Ie];for(O=0;Oe.length>O;++O)Ea(e,p,Re[P=31&Oe[O]]),p+=B[P],P>15&&(Ea(e,p,Oe[O]>>>5&127),p+=Oe[O]>>>12)}}else me=DY,ne=Mu,ce=LY,Z=Tb;for(O=0;u>O;++O)if(i[O]>255){var P;Ip(e,p,me[257+(P=i[O]>>>18&31)]),p+=ne[P+257],P>7&&(Ea(e,p,i[O]>>>23&31),p+=tO[P]);var F=31&i[O];Ip(e,p,ce[F]),p+=Z[F],F>3&&(Ip(e,p,i[O]>>>5&8191),p+=nO[F])}else Ip(e,p,me[i[O]]),p+=ne[i[O]];return Ip(e,p,me[256]),p+ne[256]},UY=new Xh([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),FY=(function(){for(var t=new Xh(256),e=0;256>e;++e){for(var n=e,i=9;--i;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),P1=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function HY(t,e){e===void 0&&(e={});var n=(function(){var g=4294967295;return{p(v){for(var y=g,b=0;v.length>b;++b)y=FY[255&y^v[b]]^y>>>8;g=y},d(){return 4294967295^g}}})(),i=t.length;n.p(t);var r,o,l,u,d,f=(u=10+((r=e).filename&&r.filename.length+1||0),d=8,(function(g,v,y,b,x,S){var k=g.length,T=new Ls(b+k+5*(1+Math.floor(k/7e3))+x),C=T.subarray(b,T.length-x),A=0;if(!v||8>k)for(var $=0;k>=$;$+=65535){var N=$+65535;k>N?A=JT(C,A,g.subarray($,N)):(C[$]=S,A=JT(C,A,g.subarray($,k)))}else{for(var j=UY[v-1],O=j>>>13,L=8191&j,B=(1<<y)-1,V=new Ur(32768),ee=new Ur(B+1),me=Math.ceil(y/3),ne=2*me,ce=function(tn){return(g[tn]^g[tn+1]<<me^g[tn+2]<<ne)&B},Z=new Xh(25e3),ae=new Ur(288),ue=new Ur(32),ge=0,Re=0,xe=($=0,0),Ie=0,Oe=0;k>$;++$){var P=ce($),F=32767&$,re=ee[P];if(V[F]=re,ee[P]=F,$>=Ie){var Y=k-$;if((ge>7e3||xe>24576)&&Y>423){A=EI(g,C,0,Z,ae,ue,Re,xe,Oe,$-Oe,A),xe=ge=Re=0,Oe=$;for(var de=0;286>de;++de)ae[de]=0;for(de=0;30>de;++de)ue[de]=0}var ke=2,Ae=0,Se=L,oe=F-re&32767;if(Y>2&&P==ce($-oe))for(var je=Math.min(O,Y)-1,$e=Math.min(32767,$),Le=Math.min(258,Y);$e>=oe&&--Se&&F!=re;){if(g[$+ke]==g[$+ke-oe]){for(var Pe=0;Le>Pe&&g[$+Pe]==g[$+Pe-oe];++Pe);if(Pe>ke){if(ke=Pe,Ae=oe,Pe>je)break;var ze=Math.min(oe,Pe-2),Ge=0;for(de=0;ze>de;++de){var vt=$-oe+de+32768&32767,en=vt-V[vt]+32768&32767;en>Ge&&(Ge=en,re=vt)}}}oe+=(F=re)-(re=V[F])+32768&32767}if(Ae){Z[xe++]=268435456|BT[ke]<<18|SI[Ae];var yt=31&BT[ke],Kt=31&SI[Ae];Re+=tO[yt]+nO[Kt],++ae[257+yt],++ue[Kt],Ie=$+ke,++ge}else Z[xe++]=g[$],++ae[g[$]]}}A=EI(g,C,S,Z,ae,ue,Re,xe,Oe,$-Oe,A)}return v6(T,0,b+m6(A)+x)})(o=t,(l=e).level==null?6:l.level,l.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(o.length)))):12+l.mem,u,d,!0)),p=f.length;return(function(g,v){var y=v.filename;if(g[0]=31,g[1]=139,g[2]=8,g[8]=2>v.level?4:v.level==9?2:0,g[9]=3,v.mtime!=0&&P1(g,4,Math.floor(new Date(v.mtime||Date.now())/1e3)),y){g[3]=8;for(var b=0;y.length>=b;++b)g[b+10]=y.charCodeAt(b)}})(f,e),P1(f,p-8,n.d()),P1(f,p-4,i),f}const KY=!!DC||!!pm,y6=new WeakMap,_6="text/plain";let N1=0,E_=!1;const b6=(t,e)=>{const[n,i]=t.split("#"),[r,o]=n.split("?");if(!o)return t;const l=o.split("&").filter(u=>u.split("=")[0]!==e).join("&");return`${r}${l?`?${l}`:""}${i?`#${i}`:""}`},rv=(t,e,n=!0)=>{var i;const[r,o]=t.split("?"),l=z({},e),u=(i=o?.split("&").map(f=>{var p;const[g,v]=f.split("="),y=n&&(p=l[g])!==null&&p!==void 0?p:v;return delete l[g],`${g}=${y}`}))!==null&&i!==void 0?i:[],d=(function(f,p="&"){let g,v;const y=[];return Wt(f,function(b,x){le(b)||le(x)||x==="undefined"||(g=encodeURIComponent((S=>S instanceof File)(b)?b.name:b.toString()),v=encodeURIComponent(x),y[y.length]=v+"="+g)}),y.join(p)})(l);return d&&u.push(d),u.length>0?`${r}?${u.join("&")}`:r},M1=t=>{if(t.sl)return t.sl;const{data:e,compression:n}=t;if(!e)return;if(n===cs.GZipJS){const r=HY((function(o){var l=o.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(o);for(var u=new Ls(o.length+(o.length>>>1)),d=0,f=function(y){u[d++]=y},p=0;l>p;++p){if(d+5>u.length){var g=new Ls(d+8+(l-p<<1));g.set(u),u=g}
17var v=o.charCodeAt(p);128>v?f(v):2048>v?(f(192|v>>>6),f(128|63&v)):v>55295&&57344>v?(f(240|(v=65536+(1047552&v)|1023&o.charCodeAt(++p))>>>18),f(128|v>>>12&63),f(128|v>>>6&63),f(128|63&v)):(f(224|v>>>12),f(128|v>>>6&63),f(128|63&v))}return v6(u,0,d)})(wh(e)),{mtime:0});return{contentType:_6,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===cs.Base64){const r=(function(l){return l&&btoa(encodeURIComponent(l).replace(/%([0-9A-F]{2})/g,(u,d)=>String.fromCharCode(parseInt(d,16))))})(wh(e)),o=(l=>"data="+encodeURIComponent(typeof l=="string"?l:wh(l)))(r);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}const i=wh(e);return{contentType:"application/json",body:i,estimatedSize:new Blob([i]).size}},w6=t=>{const e=()=>t.transport==="sendBeacon"?{url:rv(t.url,{compression:cs.Base64}),encodedBody:M1(z(z({},t),{},{compression:cs.Base64,sl:void 0}))}:{url:b6(t.url,"compression"),encodedBody:M1(z(z({},t),{},{compression:void 0,sl:void 0}))};let n;try{n=M1(t)}catch(r){if(WM(t.compression,Gh(t.url,"compression")))return Ce.error("Failed to gzip request body, sending uncompressed payload",r),e();throw r}return n&&WM(t.compression,Gh(t.url,"compression"))&&!((i=n.body)instanceof ArrayBuffer?AT(new Uint8Array(i)):ArrayBuffer.isView(i)&&AT(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(E_=!0,e()):{url:t.url,encodedBody:n};var i},x6=t=>{try{return w6(t)}catch(n){var e;return Ce.error(n),void((e=t.callback)===null||e===void 0||e.call(t,{statusCode:0,error:n}))}},ZY=(function(){var t=_n(function*(e){const n=yield(function(r){return jT.apply(this,arguments)})(wh(e.data),li.DEBUG,{rethrow:!0});if(!n)return e;const i=yield n.arrayBuffer();return z(z({},e),{},{sl:{contentType:_6,body:i,estimatedSize:i.byteLength}})});return function(e){return t.apply(this,arguments)}})(),WY=/Failed to fetch|NetworkError|Load failed/i,S6=t=>t?.name==="TypeError"&&WY.test(t?.message||""),k6=t=>{try{const e=(function(n,i=Date.now()){if(typeof n!="string"||!n)return;const r=n.trim(),o=/^\d+\s*,/.test(r)?r.slice(0,r.indexOf(",")).trim():r;if(/^\d+$/.test(o)){const d=1e3*Math.min(Number(o),300);return d>0?d:void 0}if(!/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(o))return;const l=/^\w{3} \w{3} /.test(o)?o+" GMT":o,u=Date.parse(l)-i;return Number.isFinite(u)&&u>0?Math.min(u,x_):void 0})(t());return le(e)?void 0:Math.min(e,3e4)}catch{return}},E6=t=>{const e=x6(t);if(!e)return;const n=new DC;y6.set(n,!0);const{url:i,encodedBody:r}=e;n.open(t.method||"GET",i,!0);const{contentType:o,body:l}=r??{};Wt(t.headers,function(u,d){n.setRequestHeader(d,u)}),o&&n.setRequestHeader("Content-Type",o),t.timeout&&(n.timeout=t.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var u;const d={statusCode:n.status,text:n.responseText};if(n.status===200)try{d.json=JSON.parse(n.responseText)}catch{}(u=t.callback)===null||u===void 0||u.call(t,d,k6(()=>n.getResponseHeader("Retry-After")))}},n.send(l)},T6=t=>{const e=x6(t);if(!e)return;const{url:n,encodedBody:i}=e,{contentType:r,body:o,estimatedSize:l}=i??{},u=new Headers;Wt(t.headers,function(b,x){u.append(x,b)}),r&&u.append("Content-Type",r);let d=null,f=!1;if($M){const b=new $M;d={signal:b.signal,timeout:setTimeout(()=>{f=!0;try{b.abort(sU("AbortError","PostHog request timed out"+((x=t.timeout)?` after ${x}ms`:"")))}catch(S){g(S)}var x},t.timeout)}}let p=!1;const g=b=>{var x;p||(p=!0,f&&b?.name==="AbortError"||S6(b)?Ce.warn(b):Ce.error(b),(x=t.callback)===null||x===void 0||x.call(t,{statusCode:0,error:b}))};let v=0;const y=()=>{N1-=v,v=0,d&&clearTimeout(d.timeout)};try{const b=z({method:t?.method||"GET",headers:u,referrerPolicy:"strict-origin",body:o,signal:d?.signal},t.fetchOptions),x=l??(le(o)?0:void 0);b.keepalive=b.method==="POST"&&!t.rl&&b.keepalive!==!1&&b.body===o&&!le(x)&&x>=0&&52428.8>N1+x,b.keepalive&&(v=x,N1+=v),pm(n,b).then(S=>S.text().then(k=>{var T;if(p)return;const C={statusCode:S.status,text:k};if(S.status===200)try{C.json=JSON.parse(k)}catch(A){Ce.error(A)}p=!0,y(),(T=t.callback)===null||T===void 0||T.call(t,C,k6(()=>S.headers.get("Retry-After")))})).catch(S=>{y(),g(S)}).finally(y)}catch(b){y(),g(b)}},XT=t=>{try{var e;const{url:n,encodedBody:i}=w6(t),{contentType:r,body:o,estimatedSize:l}=i??{};if(!o)return;const u=o instanceof Blob?o:new Blob([o],{type:r});if(mi.sendBeacon(n,u))return;const d=Je(t.data)?t.data:(e=t.data)===null||e===void 0?void 0:e.batch;if(Je(d)&&d.length>1&&(l??0)>16384){const f=Math.ceil(d.length/2),p=g=>
17Je(t.data)?g:z(z({},t.data),{},{batch:g});return XT(z(z({},t),{},{data:p(d.slice(0,f))})),void XT(z(z({},t),{},{data:p(d.slice(f))}))}Ce.warn(`Beacon of ~${l??0} bytes was rejected by the browser, falling back to ${pm?"fetch":"XHR"}`),pm?T6(z(z({},t),{},{rl:!0})):E6(t)}catch(n){Ce.warn("Beacon send failed",n)}},TI=(t,e,n,i)=>{const r=i==="query"?e==="POST"?"sent_at":"_":void 0;return rv(n===cs.GZipJS?b6(t,"compression"):t,z(z({},r?{[r]:Date.now().toString()}:{}),n===cs.GZipJS?{}:{compression:n}))},qY=(()=>{const t=[];return pm&&t.push({transport:"fetch",method:T6}),DC&&t.push({transport:"XHR",method:E6}),mi?.sendBeacon&&t.push({transport:"sendBeacon",method:XT}),t})();let C6=!KY&&kr?.indexOf("MSIE")===-1&&kr?.indexOf("Mozilla")===-1;function O6(t,e,n){var i,r,o;n&&(e=z(z({},e),{},{callback:l=>n(l)})),t.__loaded?C6?t.__request_queue.push(e):t.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&((r=e.callback)===null||r===void 0||r.call(e,{statusCode:429})):(e.transport=e.transport||t.config.api_transport,e.headers=z(z({},t.config.request_headers),e.headers),e.compression=e.compression==="best-available"?(i=t.compression)!==null&&i!==void 0?i:e.compressionFallback:e.compression,(le(t.config.disable_beacon)?t.config.__preview_disable_beacon:t.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||t.config.fetch_options,((l,u)=>{var d,f,p;const g=z(z({},l),{},{callback:u??(S=>{var k;return(k=l.callback)===null||k===void 0?void 0:k.call(l,S)})});g.timeout=g.timeout||6e4;const v=(d=g.transport)!==null&&d!==void 0?d:"fetch";v==="sendBeacon"&&le(g.compression)&&g.data&&(g.compression=cs.Base64),g.method==="POST"&&g.data&&(g.timestampMode==="capture-body"?g.data=(S=>{var k,T;const C=(Je(S)?S:[S]).map($=>z(z({},$),$.timestamp instanceof Date&&!isNaN($.timestamp.getTime())?{timestamp:$.timestamp.toISOString()}:{})),A=C[0];return{api_key:(k=A==null||(T=A.properties)===null||T===void 0?void 0:T.token)!==null&&k!==void 0?k:A?.token,batch:C,sent_at:new Date().toISOString()}})(g.data):g.timestampMode==="body"&&(g.data=((S,k=new Date().toISOString())=>Je(S)?S.map(T=>z(z({},T),{},{sent_at:k})):z(z({},S),{},{sent_at:k}))(g.data))),g.url=TI(g.url,g.method,g.compression,g.timestampMode);const y=qY.filter(S=>!g.disableTransport||!S.transport||!g.disableTransport.includes(S.transport)),b=(f=(p=(function(S,k){for(let T=0;S.length>T;T++)if(k(S[T]))return S[T]})(y,S=>S.transport===v))===null||p===void 0?void 0:p.method)!==null&&f!==void 0?f:y[0].method;if(!b)throw new Error("No available transport method");const x=S=>{try{b(S)}catch(T){var k;S6(T)?Ce.warn(T):Ce.error(T),(k=g.callback)===null||k===void 0||k.call(g,{statusCode:0,error:T})}};v!=="sendBeacon"&&!g.preferSyncCompression&&g.data&&g.compression===cs.GZipJS&&RJ&&typeof Promise<"u"&&!E_?ZY(g).then(S=>{x(S)}).catch(S=>{if(qM(S))return E_=!0,void x(z(z({},g),{}
17,{compression:void 0,url:TI(l.url,l.method,void 0,l.timestampMode)}));(k=>{if(!k||typeof k!="object")return!1;const T="name"in k?String(k.name):"";return qM(k)||T===hU})(S)&&(E_=!0),x(g)}):x(g)})(e,(l,u)=>{var d,f,p;t.rateLimiter.checkForLimiting(l),400>l.statusCode||(d=(f=t.config).on_request_error)===null||d===void 0||d.call(f,l),n?n(l,u):(p=e.callback)===null||p===void 0||p.call(e,l)})):e.fireCallbackOnDrop&&((o=e.callback)===null||o===void 0||o.call(e,{statusCode:0}))}var VY=class{constructor(e,n){this.ol=!0,this.al=[],this.ll=Jo(n?.flush_interval_ms||3e3,250,5e3,Ce.createLogger("flush interval"),3e3),this.ul=e}enqueue(e){this.al.push(e),this.hl||this.cl()}unload(){this.dl();const e=this.al.length>0?this.vl():{},n=Object.values(e);[...n.filter(i=>i.url.indexOf("/e")===0),...n.filter(i=>i.url.indexOf("/e")!==0)].map(i=>{this.fl(i,"sendBeacon")})}enable(){this.ol=!1,this.cl()}cl(){this.ol||(this.hl=setTimeout(()=>{if(this.dl(),this.al.length>0){const e=this.vl();for(const n in e)this.fl(e[n])}},this.ll))}fl(e,n){try{this.ul(e,n)}catch(i){Ce.error(i)}}dl(){clearTimeout(this.hl),this.hl=void 0}vl(){const e={};return Wt(this.al,n=>{var i;const r=n,o=((r?r.batchKey:null)||r.url)+(r.batchGroup?`:${r.batchGroup}`:"");le(e[o])&&(e[o]=z(z({},r),{},{data:[]})),(i=e[o].data)===null||i===void 0||i.push(r.data)}),this.al=[],e}};const BY=["retriesPerformedSoFar"];var GY=class{constructor(e){this._instance=e,this.pl=!1,this.gl=3e3,this.al=[],this.al=[],this.ml=!0,this.resume()}resume(){if(!le(G)&&"onLine"in G.navigator){if(this.ml=G.navigator.onLine,this.yl)return;this.yl=()=>{this.ml=!0,this.bl()},this._l=()=>{this.ml=!1},Ht(G,"online",this.yl),Ht(G,"offline",this._l)}}get length(){return this.al.length}retriableRequest(e,n){let{retriesPerformedSoFar:i}=e,r=fU(e,BY);Ra(i)&&(r.url=rv(r.url,{retry_count:i})),O6(this._instance,n?z(z({},r),{},{transport:n}):r,(o,l)=>{var u;if(o.statusCode!==200&&(400>o.statusCode||o.statusCode>=500)){if((o.statusCode===0?3:10)>(i??0))return void this.Ls(z({retriesPerformedSoFar:i},r),l);o.statusCode===0&&Ce.warn(`Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after ${i??0} retries.`)}(u=r.callback)===null||u===void 0||u.call(r,o)})}Ls(e,n){const i=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=i+1;const r=Math.max((function(u){const d=3e3*Math.pow(2,u),f=d/2,p=Math.min(18e5,d),g=(Math.random()-.5)*(p-f);return Math.ceil(p+g)})(i),n??0),o=Date.now()+r;this.al.push({retryAt:o,requestOptions:e});let l=`Enqueued failed request for retry in ${r}`;navigator.onLine||(l+=" (Browser is offline)"),Ce.warn(l),this.pl||(this.pl=!0,this.wl())}wl(){if(this.kl&&clearTimeout(this.kl),this.al.length===0)return this.pl=!1,void(this.kl=void 0);this.kl=setTimeout(()=>{this.ml&&this.al.length>0&&this.bl(),this.wl()},this.gl)}bl(){const e=Date.now(),n=[],i=this.al.filter(r=>e>r.retryAt||(n.push(r),!1));if(this.al=n,i.length>0)for(const{requestOptions:r}of i)this.retriableRequest(r)}unload(){this.kl&&(clearTimeout(this.kl),this.kl=void 0),this.pl=!1,le(G)||(this.yl&&(G.removeEventListener("online",this.yl),this.yl=void 0),this._l&&(G.removeEventListener("offline",this._l),this._l=void 0));for(const{requestOptions:e}of this.al)try{this._instance._send_request(z(z({},e),{},{transport:"sendBeacon"}))}catch(n){Ce.error(n)}this.al=[]}},JY=class{constructor(e){this._instance=e,this.Sl=()=>{var n,i,r,o;this.xl||(this.xl={});const l=this.scrollElement(),u=this.scrollY(),d=l?Math.max(0,l.scrollHeight-l.clientHeight):0,f=u+(l?.clientHeight||0),p=l?.scrollHeight||0;this.xl.lastScrollY=Math.ceil(u),this.xl.maxScrollY=Math.max(u,(n=this.xl.maxScrollY)!==null&&n!==void 0?n:0),this.xl.maxScrollHeight=Math.max(d,(i=this.xl.maxScrollHeight)!==null&&i!==void 0?i:0),this.xl.lastContentY=f,this.xl.maxContentY=Math.max(f,(r=this.xl.maxContentY)!==null&&r!==void 0?r:0),this.xl.maxContentHeight=Math.max(p,(o=this.xl.maxContentHeight)!==null&&o!==void 0?o:0)}}get Cl(){return this._instance.config.scroll_root_selector}getContext(){return this.xl}resetContext(){const e=this.xl;return this.xl=void 0,setTimeout(this.Sl,0),e}startMeasuringScrollPosition(){Ht(G,"scroll",this.Sl,{capture:!0}),Ht(G,"scrollend",this.Sl,{capture:!0}),Ht(G,"resize",this.Sl)}scrollElement(){if(this.Cl){const i=Je(this.Cl)?this.Cl:[this.Cl];for(const r of i){var e;const o=G==null||(e=G.document)===null||e===void 0?void 0:e.querySelector(r);if(o)return o}return}var n;return G==null||(n=G.document)===null||n===void 0?void 0:n.documentElement}$l(e){var n,i;const r=e==="y"?"scrollTop":"scrollLeft";if(this.Cl){const o=this.scrollElement();return o&&o[r]||0}return G?e==="y"?G.scrollY||G.pageYOffset||((n=G.document)===null||n===void 0||(n=n.documentElement)===null||n===void 0?void 0:n.scrollTop)||0:G.scrollX||G.pageXOffset||((i=G.document)===null||i===void 0||(i=i.documentElement)===null||i===void 0?void 0:i.scrollLeft)||0:0}scrollY(){return this.$l("y")}scrollX(){return this.$l("x")}};const XY=t=>l6(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties,t?.config.disable_capture_url_hashes
17);var CI=class{constructor(e,n,i,r){this.Be=o=>{const l=this.Tl();if(l&&l.sessionId===o)return;const u={sessionId:o,props:this.Il(this._instance)};this.Ml.register({[FT]:u})},this._instance=e,this.El=n,this.Ml=i,this.Il=r||XY,this.El.onSessionId(this.Be)}Tl(){return this.Ml.props[FT]}getSetOnceProps(){var e;const n=(e=this.Tl())===null||e===void 0?void 0:e.props;return n?"r"in n?c6(n,this._instance.config.disable_capture_url_hashes):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){const e={};return Wt(JC(this.getSetOnceProps()),(n,i)=>{i==="$current_url"&&(i="url"),e[`$session_entry_${ET(i)}`]=n}),e}},Cb=class{on(e,n){return this.Pl[e]||(this.Pl[e]=[]),this.Pl[e].push(n),()=>{this.Pl[e]=this.Pl[e].filter(i=>i!==n)}}emit(e,n){for(const i of this.Pl[e]||[])i(n);for(const i of this.Pl["*"]||[])i(e,n)}constructor(){this.Pl={}}};const qd=$n("[SessionId]"),OI=864e5;var RI=class{on(e,n){return this.Rl.on(e,n)}constructor(e,n,i){var r;if(this.Al=null,this.Fl=null,this.Ol=[],this.Dl=void 0,this.Ll=!1,this.Rl=new Cb,this.Nl=(l,u)=>!(!Ra(l)||!Ra(u))&&Math.abs(l-u)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Rr=e.config,this.Ml=e.persistence,this.He=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.ql=void 0,this._sessionActivityTimestamp=null,this.jl=n||po,this.Bl=i||po;const o=this.Rr.persistence_name||this.Rr.token;if(this._sessionTimeoutMs=1e3*Jo(this.Rr.session_idle_timeout_seconds||1800,60,36e3,qd.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Hl(),this.zl="ph_"+o+"_window_id",this.Ul="ph_"+o+"_primary_window_exists",this.Wl()){const l=dn.Dt(this.zl),u=dn.Dt(this.Ul);l&&!u?this.He=l:dn.Lt(this.zl),dn.At(this.Ul,!0)}!((r=this.Rr.bootstrap)===null||r===void 0)&&r.sessionID&&this.setBootstrapSessionId(this.Rr.bootstrap.sessionID),this.Vl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return le(this.Ol)&&(this.Ol=[]),this.Ol.push(e),this.Xt&&e(this.Xt,this.He),()=>{this.Ol=this.Ol.filter(n=>n!==e)}}Wl(){return this.Rr.persistence!=="memory"&&!this.Ml.mi&&dn.Et()}Gl(e){e!==this.He&&(this.He=e,this.Wl()&&dn.At(this.zl,e))}Zl(){return this.He?this.He:this.Wl()?dn.Dt(this.zl):null}Ql(e){const n=this.Al;return!On(n)&&!On(e)&&5e3>Math.abs(e-n)}Jl(e,n,i){const r=n!==this._sessionActivityTimestamp,o=!(e!==this.Xt||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=n,this.Xt=e,o&&!r||o&&this.Ql(n)||(this.Al=n,this.Ml.register({[yh]:[n,e,i]}))}Kl(){var e;const n=(e=this.Rr)===null||e===void 0?void 0:e.persistence_save_debounce_ms;return Ra(n)&&n>0}Xl(){this.Kl()?this.Ml.refreshKey(yh):(this.Ml.flush(),this.Ml.load())}Yl(){var e;if(On(this._sessionActivityTimestamp)||this._sessionActivityTimestamp===this.Al)return;this.Xl();const[,n,i]=this.tu();n===this.Xt&&i===this._sessionStartTimestamp&&(this.Al=this._sessionActivityTimestamp,this.Ml.register({[yh]:[this._sessionActivityTimestamp,(e=this.Xt)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.Ml.flush())}eu(){const[e]=this.tu(),n=Ra(e)?e:0,i=Ra(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(n,i)}iu(e){return this.Xl(),this.Nl(e,this.eu())}tu(){const e=this.Ml.props[yh];return Je(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Al=null,this.ql=void 0,clearTimeout(this.nu),this.nu=void 0,this.Jl(null,null,null)}setBootstrapSessionId(e,n=!1){const i=((r,o=new Date().getTime())=>{try{const l=(u=>{const d=u.replace(/-/g,"");if(d.length!==32)throw new Error("Not a valid UUID");if(d[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(d.substring(0,12),16)})(r);return l>o+6e4?void qd.error("Bootstrap sessionID cannot be in the future"):l}catch(l){return void qd.error("Invalid sessionID in bootstrap",l)}})(e);
17return!le(i)&&(n?this.ql={sessionId:e,sessionStartTimestamp:i}:this.Jl(e,new Date().getTime(),i),!0)}destroy(){this.Ll=!0,this.Yl(),clearTimeout(this.nu),this.nu=void 0,this.Dl&&G&&(G.removeEventListener(xb,this.Dl,{capture:!1}),this.Dl=void 0),this.Ol=[]}Vl(){this.Dl=()=>{this.Yl(),this.Wl()&&dn.Lt(this.Ul)},Ht(G,xb,this.Dl,{capture:!1})}checkAndGetSessionAndWindowId(e=!1,n=null,i=!1){if(this.Rr.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');const r=n||new Date().getTime(),o=this.Xt;if(i)this.Fl=r;else if(On(this.Fl)||this.Fl>r||r-this.Fl>=1e3){var l,u;(l=(u=this.Ml).syncCookieProperties)===null||l===void 0||l.call(u),this.Fl=r}let[,d,f]=this.tu();const p=!le(o)&&d!==o,g=this.eu();let v=this.Zl();const y=this.ql,b=!!y&&(y.sessionStartTimestamp>r+6e4||r-y.sessionStartTimestamp>OI),x=y?b:Ra(f)&&Math.abs(r-f)>OI;let S=!1,k=p,T=!d||!!y;const C=d;let A=!T&&!e&&this.Nl(r,g);if(A&&(A=this.iu(r),A||qd.info("cross-tab refresh kept the session alive",{sessionId:d}),[,d,f]=this.tu(),A||(T=!d||!!y)),T||A||x){k=!1;const O=y&&!b;d=O?y.sessionId:this.jl(),v=this.Bl(),qd.info("new session ID assigned",{sessionId:d,windowId:v,bootstrapped:!!O,changeReason:{noSessionId:T,activityTimeout:A,sessionPastMaximumLength:x}}),f=O?y.sessionStartTimestamp:r,this.ql=void 0,S=!0}else v||(v=this.Bl(),S=!0),k=k||d!==C,k&&(qd.info("adopted cross-tab session id",{sessionId:d,windowId:v}),S=!0);const $=Ra(g)&&e&&!x?g:r,N=Ra(f)?f:new Date().getTime();this.Gl(v),this.Jl(d,$,N),e||this.Hl();const j={noSessionId:T,activityTimeout:A,sessionPastMaximumLength:x,crossTabAdoption:k};return S&&this.Ol.forEach(O=>O(d,v,j)),{sessionId:d,windowId:v,sessionStartTimestamp:N,changeReason:S?j:void 0,lastActivityTimestamp:g}}Hl(){this.Ll||(clearTimeout(this.nu),this.nu=setTimeout(()=>{if(!this.Ll)if(this.iu(new Date().getTime())){const e=this.Xt;this.resetSessionId(),this.Rl.emit("forcedIdleReset",{idleSessionId:e})}else this.Hl()},1.1*this.sessionTimeoutMs))}};const R6=function(t,e){if(!t)return!1;const n=t.userAgent;if(n&&jM(n,e))return!0;try{const i=t?.userAgentData;if(i?.brands&&i.brands.some(r=>jM(r?.brand,e)))return!0}catch{}return!!t.webdriver};function $6(){return($6=_n(function*(){const t=mi?.userAgentData;if(t?.getHighEntropyValues)try{const e=yield t.getHighEntropyValues(["model"]),n=e?.model;return mt(n)&&n.length>0?n:void 0}catch(e){return void Ce.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}function YY(t,e){let n=`$survey_${e}/${t.id}`;return t.current_iteration&&t.current_iteration>0&&(n=`$survey_${e}/${t.id}/${t.current_iteration}`),n}function A6(t){var e;return!!(!((e=t.conditions)===null||e===void 0||(e=e.events)===null||e===void 0||(e=e.values)===null||e===void 0)&&e.length)}const Ob=(t,e)=>{if(!(n=>{try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}},m0=t=>t.toLowerCase(),j6={exact:(t,e)=>e.some(n=>t.some(i=>n===i)),is_not:(t,e)=>e.every(n=>t.every(i=>n!==i)),regex:(t,e)=>e.some(n=>t.some(i=>Ob(n,i))),not_regex:(t,e)=>e.every(n=>t.every(i=>!Ob(n,i))),icontains:(t,e)=>e.map(m0).some(n=>t.map(m0).some(i=>n.includes(i))),not_icontains:(t,e)=>e.map(m0).every(n=>t.map(m0).every(i=>!n.includes(i))),gt:(t,e)=>e.some(n=>{const i=parseFloat(n);return!isNaN(i)&&t.some(r=>i>parseFloat(r))}),lt:(t,e)=>e.some(n=>{const i=parseFloat(n);return!isNaN(i)&&t.some(r=>i<parseFloat(r))})};function P6(t,e){return!t||Object.entries(t).every(([n,i])=>{const r=e?.[n];if(r==null)return!1;const o=j6[i.operator];return!!o&&o(i.values.map(String),[String(r)])})}function I1(t,e,n){return wh({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}const YT="custom",$I="i.posthog.com",QY=/^\/static\//,e7=["/s/","/e/","/i/"];var t7=class{constructor(e){this.su={},this.instance=e}get apiHost(){const e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){const e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e;let n=(e=this.instance.config.ui_host)===null||e===void 0?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace(`.${$I}`,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}
17get region(){return this.su[this.apiHost]||(this.su[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":YT),this.su[this.apiHost]}ru(e){if(!QY.test(e))return;const n=this.instance.config.asset_host;return typeof n=="string"&&n.trim().replace(/\/$/,"")||void 0}ou(e){const n=Wa(e);return n?n.protocol+"//"+n.host+n.pathname:void 0}au(e,n,i){if(e==="ui")return i;let r=i;const o=this.instance.config.rewriteRequestPath;if(o){var l;const u=((l=Wa(i))===null||l===void 0?void 0:l.href)||i;r=o(new URL(u)).toString()}if(o&&e==="api"&&e7.some(u=>n.indexOf(u)===0)){const u=this.ou(r);if(u){const d=this.apiHost;let f=this.lu;f?.apiHost===d&&f.rewriteRequestPath===o||(f={apiHost:d,rewriteRequestPath:o,urls:new Set},this.lu=f),f.urls.add(u)}}return r}isIngestionEndpoint(e){const n=this.lu,i=this.ou(e);return n?.apiHost===this.apiHost&&n.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&n.urls.has(i)}endpointFor(e,n=""){if(n&&(n=n[0]==="/"?n:`/${n}`),e==="ui")return this.au(e,n,this.uiHost+n);if(e==="flags")return this.au(e,n,this.flagsApiHost+n);if(e==="assets"){const r=this.ru(n);if(r)return this.au(e,n,`${r}${n}`)}if(this.region===YT)return this.au(e,n,this.apiHost+n);const i=$I+n;switch(e){case"assets":return this.au(e,n,`https://${this.region}-assets.${i}`);case"api":return this.au(e,n,`https://${this.region}.${i}`)}}};const Zt=$n("[Surveys]"),N6=t=>{try{const e=(n=>((i,r)=>`seenSurvey_${(function(o){return o.current_iteration&&o.current_iteration>0?`${o.id}_${o.current_iteration}`:o.id})(r)}`)(0,n))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(e){Zt.error("Failed to persist survey seen state",e)}},n7=[$1.Popover,$1.Widget,$1.API],i7={ignoreConditions:!1,ignoreDelay:!1,displayType:VT.Popover},r7=$n("[PostHog ExternalIntegrations]"),s7={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};var o7=class{constructor(e){this._instance=e}zo(e,n){var i,r;(i=qe.__PosthogExtensions__)===null||i===void 0||(r=i.loadExternalDependency)===null||r===void 0||r.call(i,this._instance,e,o=>{if(o)return r7.error("failed to load script",o);n()})}startIfEnabledOrStop(){var e;for(const[o,l]of Object.entries((e=this._instance.config.integrations)!==null&&e!==void 0?e:{})){var n,i,r;l&&!(!((n=qe.__PosthogExtensions__)===null||n===void 0||(n=n.integrations)===null||n===void 0)&&n[o])&&this.zo(s7[o],()=>{var u;(u=qe.__PosthogExtensions__)===null||u===void 0||(u=u.integrations)===null||u===void 0||(u=u[o])===null||u===void 0||u.start(this._instance)}),!l&&(!((i=qe.__PosthogExtensions__)===null||i===void 0||(i=i.integrations)===null||i===void 0)&&i[o])&&((r=qe.__PosthogExtensions__)===null||r===void 0||(r=r.integrations)===null||r===void 0||(r=r[o])===null||r===void 0||r.stop())}}},a7=class{constructor(e,n){this.$=e,this.wo=n,this.uu=new Map,this.Io=!1}add(e){var n=this;return _n(function*(){if(n.Io)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(n.uu.has(e.name))throw new Error(`Browser extension "${e.name}" is already registered`);n.uu.set(e.name,e);try{const i=e.setup(n.wo);i&&(yield i)}catch(i){const r=n.uu.get(e.name)===e;r&&n.uu.delete(e.name),n.$.error(`Failed to set up browser extension "${e.name}"`,i),r&&n.hu(e)}})()}getExtension(e){return this.uu.get(e)}dispose(){if(this.Io)return;this.Io=!0;const e=Array.from(this.uu.values()).reverse();this.uu.clear();for(const n of e)this.hu(n)}hu(e){try{var n;const i=(n=e.dispose)===null||n===void 0?void 0:n.call(e);i&&pi(i.then)&&i.then(void 0,r=>{this.$.error(`Failed to dispose browser extension "${e.name}"`,r)})}catch(i){this.$.error(`Failed to dispose browser extension "${e.name}"`,i)}}},l7=class{constructor(e){this._instance=e}initialize(){}get(e){const n=this._instance.persistence;if(typeof e=="string")return n?.get_property(e);const i={};for(const r of e){const o=n?.get_property(r);le(o)||(i[r]=o)}return i}set(e,n){var i;(i=this._instance.persistence)===null||i===void 0||i.register(typeof e=="string"?{[e]:n}:e)}remove(e){var n;(n=this._instance.persistence)===null||n===void 0||n.unregister(e)}};const AI="extensionsRemoteConfig";var c7=class{constructor(e){this.instance=e,this.Io=!1,this.$=Ce,this.cu=e.du,this.kv=new l7(e),this.onEvent=n=>g0(this.instance.on("eventCaptured",i=>{try{n({event:i.event,properties:i.properties})}catch(r){this.$.error("Browser extension event listener failed",r)}})),this.onRemoteConfig=n=>{if(this.Io)return g0(()=>{});const i=o=>{try{n(o)}catch(l){this.$.error("Browser extension remote config listener failed",l)}},r=this.instance.vu.on(AI,i);return this.cu&&i(this.cu),g0(r)},this.fu=new a7(Ce.createLogger("[BrowserExtensions]"),this)}get logger(){return this.$}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return(e=this.instance.get_property("$device_id"))!==null&&e!==void 0?e:this.distinctId}get deviceId(){const e=this.instance.get_property(ZC);return typeof e=="string"?e:void 0}get library(){return{name:li.LIB_NAME,version:li.LIB_VERSION}}get initialPersonProperties(){var e,n;return(e=(n=this.instance.persistence)===null||n===void 0?void 0:n.get_initial_props())!==null&&e!==void 0?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,n,i,r;const o=(e=this.instance.sessionManager)===null||e===void 0?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:(n=o?.sessionId)!==null&&n!==void 0?n:"",windowId:(i=o?.windowId)!==null&&i!==void 0?i:"",sessionStartTimestamp:(r=o?.sessionStartTimestamp)!==null&&r!==void 0?r:0}}catch{return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(e){return this.fu.add(e)}getExtension(e){return this.fu.getExtension(e)}capture(e,n,i){i?this.instance.capture(e,n,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):this.instance.capture(e,n)}registerDynamicEventProperties(e){return g0(this.instance.pu(e))}handleRemoteConfig(e){this.Io||(this.cu=e,this.instance.vu.emit(AI,e))}sendRequest(e){var n=this;return _n(function*(i,r={}){var o;const l=n.instance.requestRouter.endpointFor((o=r.target)!==null&&o!==void 0?o:"api",i),u={method:r.method,url:r.query?rv(l,r.query):l,data:r.body,headers:r.headers,timeout:r.timeoutMs,fireCallbackOnDrop:!0,transport:r.transport,compression:r.compression,compressionFallback:r.target==="flags"&&r.compression==="best-available"?kT.Base64:void 0,timestampMode:r.sentAt};return r.transport==="sendBeacon"?(n.instance._send_request(u),{statusCode:202}):new Promise(d=>{u.callback=d,n.instance._send_request(u)})}).apply(this,arguments)}dispose(){this.Io||(this.Io=!0,this.fu.dispose())}};const Wg={};let z1=0;const qg=()=>{}
17,jI='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Dp="Surveys module not available",PI="sanitize_properties is deprecated. Use before_send instead",M6="Invalid value for property_denylist config: ",u7=/^[A-Za-z0-9_-]{1,400}$/,NI=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,MI=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,d7=["token","distinct_id",MU],gg="posthog",h7=t=>{const e={};return t&&t!=="unset"&&("2025-11-30">t||(e.strictMinimumDuration=!0),"2026-05-30">t||(e.canvasCapture={resolutionScale:.6}),"2026-06-25">t||(e.streamNetworkBody=!0),"2026-08-30">t||(e.captureJsonLd=!0)),e},D1=t=>{var e;return z({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:dY(he?.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:qg,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:Cn&&mt(Cn?.search)&&Cn.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:(G==null||(e=G.location)===null||e===void 0?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,feature_flag_request_max_retries:1,surveys_request_timeout_ms:1e4,on_request_error(n){Ce.error("Bad HTTP status: "+n.statusCode+" "+n.text)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:UU,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:qg},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:_Y,ignore_text_selection:!0}
17:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:h7(n),external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:n&&n>="2026-05-30"?250:0,split_storage:!(!n||"2026-05-30">n),detect_google_search_app:!(!n||"2026-05-30">n),disable_capture_url_hashes:!(!n||"2026-06-25">n),cookieWinsOnConflict:!(!n||n==="unset"||"2026-08-29">n)}))(t))},f7=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],II=t=>{const e={};for(const[r,o]of f7)le(t[r])||(e[o]=t[r]);const n=pn({},e,t),i=t.__preview_external_dependency_versioned_paths;return le(i)||(le(t.strict_script_versioning)&&(n.strict_script_versioning=!!i),mt(i)&&le(t.asset_host)&&(n.asset_host=i)),Je(t.property_blacklist)&&(le(t.property_denylist)?n.property_denylist=t.property_blacklist:Je(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:Ce.error(M6+t.property_denylist)),n};var p7=class{constructor(){this.__forceAllowLocalhost=!1}get gu(){return this.__forceAllowLocalhost}set gu(e){Ce.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},Vg=class Ll{mu(e){if(!e)return;const n=this.uu.indexOf(e);n!==-1&&this.uu.splice(n,1)}yu(e,n){var i;return this.mu(e),this.uu.push(n),(i=n.initialize)===null||i===void 0||i.call(n),n}bu(){return this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isRejected()}_u(){if(this.wu||this.config.reuseAnonymousId||this.config.segment||this.bu())return;const e=this.config.persistence==="memory"||this.config.persistence==="sessionStorage";if(!e&&!this.config.disable_persistence||this.ku)return;let n,i,r;e?(n=`persistence is set to '${this.config.persistence}'`,i=this.config.persistence==="memory"?"on every page load":"for every new browser tab or window",r="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(n="persistence is disabled (disable_persistence is true)",i="on every page load",r="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.wu=!0,console.warn("[PostHog.js]",`${n} but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID ${i}, so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. ${r}`)}Su(){if(this.bu()||this.get_distinct_id()!=="$posthog_cookieless")return;const e=this.persistence;if(!e)return;this.xu()||e.load(!0);const n=this.get_distinct_id();if(!n||n==="$posthog_cookieless"){const i=this.config.get_device_id(po());this.register({distinct_id:i,$device_id:i}),e.set_property(Cr,Ia)}this.Cu()}get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.$u=!1,this.Tu=!1,this.webPerformance=new p7,this.Iu=!1,this.version=li.LIB_VERSION,this.Mu=new Set,this.Eu="",this.vu=new Cb,this.uu=[],this.Pu=[],this.ku=!1,this.wu=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=D1(),this.SentryIntegration=CY,this.sentryIntegration=i=>(function(r,o){const l=e6(r,o);return{name:QU,processEvent:u=>l(u)}})(this,i),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Ru=!1,this.Au=null,this.Fu=null,this.Ou=null,this.scrollManager=new JY(this),this.pageViewM
17anager=new vI(this),this.rateLimiter=new zY(this),this.requestRouter=new t7(this),this.consent=new yY(this),this.externalIntegrations=new o7(this);const n=(e=Ll.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.metrics=n.metrics&&new n.metrics(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(i,r,o)=>{const l=mt(i)?{[i]:r}:i;this.setPersonProperties(l),o?.({})},set_once:(i,r,o)=>{const l=mt(i)?{[i]:r}:i;this.setPersonProperties(void 0,l),o?.({})}},this.on("eventCaptured",i=>Ce.info(`send "${i?.event}"`,i))}init(e,n,i){if(i&&i!==gg){var r;const o=(r=Wg[i])!==null&&r!==void 0?r:new Ll;return o._init(e,n,i),Wg[i]=o,Wg[gg][i]=o,o}return this._init(e,n,i)}_init(e,n={},i){var r,o,l;const u=mt(e)?e.trim():"";if(!u)return Ce.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;var d;if(this.__loaded)return u!==((d=this.config)===null||d===void 0?void 0:d.token)?console.warn("[PostHog.js]",`You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('${u}', { ... }, 'project2')`):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=D1(n.defaults),n.debug=this.Du(n.debug),this.Lu=n,this.Nu=[],n.person_profiles?this.Fu=n.person_profiles:n.process_person&&(this.Fu=n.process_person);const f=D1(n.defaults),p=II(n),g=pn({},f,p,{name:i,token:u});xt(f.rageclick)&&xt(p.rageclick)&&(g.rageclick=pn({},f.rageclick,p.rageclick)),xt(f.session_recording)&&xt(p.session_recording)&&(g.session_recording=pn({},f.session_recording,p.session_recording)),this.set_config(g),this.config.on_xhr_error&&Ce.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:cs.GZipJS;const v=this.xu();if(this.persistence=new R1(this.config,v),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new R1(z(z({},this.config),{},{persistence:"sessionStorage"}),v,!1),this.Eu="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties",this.config.persistence!=="memory"&&!v&&dn.Et()){const k=dn.Dt(this.Eu);Je(k)&&k.forEach(T=>{mt(T)&&this.Mu.add(T)})}else dn.Lt(this.Eu);const y=z({},this.persistence.props),b=z({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.qu=new VY((k,T)=>this.ju(k,T),this.config.request_queue_config),this.Bu=new GY(this),this.__request_queue=[];const x=this.bu();x||(this.sessionManager=new RI(this),this.sessionPropsManager=new CI(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((k,T,C)=>{(C?.activityTimeout||C?.sessionPastMaximumLength||C?.crossTabAdoption)&&this.Hu()})),this.zu(),this.config.__preview_deferred_init_extensions?(Ce.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Uu(x)},0)):(Ce.info("Initializing extensions synchronously"),this.Uu(x)),li.DEBUG=li.DEBUG||this.config.debug,li.DEBUG&&Ce.info("Starting in debug mode",{this:this,config:n,thisC:z({},this.config),p:y,s:b}),this.config.identity_distinct_id&&!(!((r=n.bootstrap)===null||r===void 0)&&r.distinctID)&&(n.bootstrap=z(z({},n.bootstrap),{},{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));const S=(o=n.bootstrap)===null||o===void 0?void 0:o.distinctID;if(this.ku=!!S&&!Ig(S),(l=n.bootstrap)===null||l===void 0?void 0:l.distinctID){const k=n.bootstrap.distinctID,T=this.get_distinct_id(),C=this.persistence.get_property(Cr);if(n.bootstrap.isIdentifiedID&&T!=null&&T!==k&&C==="anonymous")this.identify(k);else if(n.bootstrap.isIdentifiedID&&T!=null&&T!==k&&C==="identified")Ce.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{const A=this.config.get_device_id(po()),$=n.bootstrap.isIdentifiedID?A:k;this.persistence.set_property(Cr,n.bootstrap.isIdentifiedID?S_:Ia),this.register({distinct_id:k,$device_id:$})}}if(x)this.register_once({distinct_id:w1,$device_id:null},"");else if(!this.get_distinct_id()){const k=this.config.get_device_id(po());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(Cr,Ia)}return Ht(G,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),Ht(G,"pageshow",()=>{var k;this.$u=!1,this.Tu||(k=this.Bu)===null||k===void 0||k.resume()}),n.segment?mI(this,()=>this.Wu()):this.Wu(),pi(this.config._onCapture)&&this.config._onCapture!==qg&&(Ce.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",k=>this.config._onCapture(k.event,k))),this.config.ip&&Ce.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||(function(){return $6.apply(this,arguments)})().then(k=>{k&&this.register({[b1]:k})}).catch(qg),this}Vu(e){const n=e;return mt(n.name)&&pi(n.setup)}Gu(e,n){this.Vu(e)?n.push(()=>{this.Zu().add(e).catch(()=>{var i;return(i=e.dispose)===null||i===void 0?void 0:i.call(e)}).catch(i=>{Ce.error(`Failed to dispose browser extension "${e.name}"`,i)})}):this.uu.push(e)}zu(){var e,n,i;const r=(e=(n=this.config.__extensionClasses)===null||n===void 0?void 0:n.featureFlags)!==null&&e!==void 0?e:(i=Ll.__defaultExtensionClasses)===null||i===void 0?void 0:i.featureFlags;var o,l,u;r&&(this.featureFlags&&this.featureFlags instanceof r||((o=this.Qu)===null||o===void 0||o.call(this),this.Qu=void 0,this.featureFlags=new r(this)),pi(this.featureFlags.onReloading)&&pi(this.featureFlags.setup)?this.Qu||(this.Qu=this.featureFlags.onReloading(()=>{this.vu.emit("featureFlagsReloading",!0)}),this.Zu().add(this.featureFlags)):(l=(u=this.featureFlags).initialize)===null||l===void 0||l.call(u))}Uu(e){const n=performance.now(),i=z(z({},Ll.__defaultExtensionClasses),this.config.__extensionClasses),r=[];var o,l,u,d,f,p,g;i.exceptions&&this.uu.push(this.exceptions=(o=this.exceptions)!==null&&o!==void 0?o:new i.exceptions(this)),i.historyAutocapture&&this.uu.push(this.historyAutocapture=new i.historyAutocapture(this)),i.tracingHeaders&&this.uu.push(this.tracingHeaders=new i.tracingHeaders(this)),i.siteApps&&this.uu.push(this.siteApps=new i.siteApps(this)),i.sessionRecording&&!e&&this.uu.push(this.sessionRecording=new i.sessionRecording(this)),this.config.disable_scroll_properties||r.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),i.autocapture&&this.Gu(this.autocapture=new i.autocapture(this),r),i.surveys&&this.Gu(this.surveys=(l=this.surveys)!==null&&l!==void 0?l:new i.surveys(this),r),i.logs&&this.Gu(this.logs=(u=this.logs)!==null&&u!==void 0?u:new i.logs(this),r),i.metrics&&this.uu.push(this.metrics=(d=this.metrics)!==null&&d!==void 0?d:new i.metrics(this)),i.conversations&&this.uu.push(this.conversations=(f=this.conversations)!==null&&f!==void 0?f:new i.conversations(this)),i.productTours&&this.uu.push(this.productTours=new i.productTours(this)),i.heatmaps&&this.uu.push(this.heatmaps=new i.heatmaps(this)),i.webVitalsAutocapture&&this.uu.push(this.webVitalsAutocapture=new i.webVitalsAutocapture(this)),i.exceptionObserver&&this.uu.push(this.exceptionObserver=new i.exceptionObserver(this)),i.deadClicksAutocapture&&this.uu.push(this.deadClicksAutocapture=new i.deadClicksAutocapture(this,TY)),i.toolbar&&this.uu.push(this.toolbar=(p=this.toolbar)!==null&&p!==void 0?p:new i.toolbar(this)),i.experiments&&this.uu.push(this.experiments=(g=this.experiments)!==null&&g!==void 0?g:new i.experiments(this)),this.uu.forEach(v=>{v.initialize&&r.push(()=>{var y;(y=v.initialize)===null||y===void 0||y.call(v)})}),r.push(()=>
17{if(this.Ju){const v=this.Ju;this.Ju=void 0,this.uu.forEach(y=>{var b;return(b=y.onRemoteConfig)===null||b===void 0?void 0:b.call(y,v)})}}),this.Ku(r,n)}Ku(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout(()=>{this.Ku(e,n)},0);const r=e.shift();if(r)try{r()}catch(o){Ce.error("Error initializing extension:",o)}}const i=Math.round(performance.now()-n);this.register_for_session({[IU]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[zU]:i}),this.config.__preview_deferred_init_extensions&&Ce.info(`PostHog extensions initialized (${i}ms)`)}il(e){var n;if(!he||!he.body)return Ce.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.il(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.Ju=e),this.du=e,this.compression=void 0,e.ok){var i;const r=e.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=Qe(r.supportedCompression,cs.GZipJS)?cs.GZipJS:Qe(r.supportedCompression,cs.Base64)?cs.Base64:void 0),!((i=r.analytics)===null||i===void 0)&&i.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.Fu?this.Fu:UU}),(n=this.Xu)===null||n===void 0||n.handleRemoteConfig(e),this.uu.forEach(r=>{var o;return(o=r.onRemoteConfig)===null||o===void 0?void 0:o.call(r,e)})}Wu(){try{this.config.loaded(this)}catch(e){Ce.critical("`loaded` function failed",e)}if(this.Yu(),this.config.internal_or_test_user_hostname&&Cn?.hostname){const e=Cn.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?e===n:n.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.bu())&&this.th()},1),this.eh=new h6(this),this.eh.load()}Yu(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.qu)===null||e===void 0||e.enable())}_dom_loaded(){this.is_capturing()&&bh(this.__request_queue,e=>this.ju(e)),this.__request_queue=[],this.Yu()}_handle_unload(){var e,n,i,r,o,l;this.$u=!0,(e=this.surveys)===null||e===void 0||(n=e.handlePageUnload)===null||n===void 0||n.call(e),(i=this.metrics)===null||i===void 0||i.flush("sendBeacon"),this.config.request_batching?(this.ih()&&this.capture(eI),(r=this.logs)===null||r===void 0||r.flushLogs("sendBeacon"),(o=this.qu)===null||o===void 0||o.unload(),(l=this.Bu)===null||l===void 0||l.unload()):this.ih()&&this.capture(eI,null,{transport:"sendBeacon"})}_send_request(e){O6(this,e)}ju(e,n){this.Bu?this.Bu.retriableRequest(e,n):this._send_request(n?z(z({},e),{},{transport:n}):e)}_execute_array(e){z1++;try{let n;const i=[],r=[],o=[];bh(e,u=>{if(u)if(n=u[0],Je(n))o.push(u);else if(pi(u))try{u.call(this)}catch(d){Ce.error("Error executing queued PostHog call",u,d)}else Je(u)&&n==="alias"?i.push(u):Je(u)&&n.indexOf("capture")!==-1&&pi(this[n])?o.push(u):r.push(u)});const l=function(u,d){bh(u,function(f){try{if(Je(f[0])){let p=d;Wt(f,function(g){p=p[g[0]].apply(p,g.slice(1))})}else d[f[0]].apply(d,f.slice(1))}catch(p){Ce.error("Error executing queued PostHog call",f,p)}})};l(i,this),l(r,this),l(o,this)}finally{z1--}}push(e){if(z1>0&&Je(e)&&mt(e[0])){const n=Ll.prototype[e[0]];return void(pi(n)&&n.apply(this,e.slice(1)))}this._execute_array([e])}get nh(){return{property:YM,persistenceKey:Mh,cookieName:"_fbc",pattern:NI,register:(e,n)=>{var i;return(i=this.persistence)===null||i===void 0?void 0:i.register({[Mh]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(Mh)}}}get sh(){return{property:QM,persistenceKey:Dg,cookieName:"_fbp",pattern:MI,register:(e,n)=>{var i;return(i=this.persistence)===null||i===void 0?void 0:i.register({[Dg]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(Dg)}}}rh(e){var n;const i=(n=this.persistence)===null||n===void 0?void 0:n.get_property(e.persistenceKey);return mt(i)&&e.pattern.test(i)?{value:i,delivered:!1}:xt(i)&&mt(i.value)&&e.pattern.test(i.value)?{value:i.value,delivered:i.delivered===!0}:void 0}oh(e,n,i){return n===i?.value?{value:n,pending:!i.delivered}:(e.register(n,!1),{value:n,pending:!0})}ah(e){if(!this.config.save_campaign_params||this.bu())return;const n=Fg(e.cookieName);return mt(n)&&e.pattern.test(n)?n:void 0}uh(e,n,i,r){if(!this.persistence)return;const o=this.nh;this.persistence.refreshKey(o.persistenceKey);const l=this.rh(o);if(r)return void o.unregister();if(i)return mt(n)&&NI.test(n)?this.oh(o,n,l):void o.unregister();const u=mt(e)&&u7.test(e)?e:void 0,d=this.ah(o);return d&&((f,p,g)=>{const v=f.split(".");if(p)return v[3]===p;if(!g)return!0;const y=g.value.split(".");return v[3]===y[3]||Number(v[2])>Number(y[2])})(d,u,l)?this.oh(o,d,l):u?l?.value.split(".")[3]===u?{value:l.value,pending:!l.delivered}:this.oh(o,`fb.1.${Date.now()}.${u}`,l):l?{value:l.value,pending:!l.delivered}:void 0}hh(e,n,i){if(!this.persistence)return;const r=this.sh;this.persistence.refreshKey(r.persistenceKey);const o=this.rh(r);if(i)return void r.unregister();if(n)return mt(e)&&MI.test(e)?this.oh(r,e,o):void r.unregister();const l=this.ah(r);return l?this.oh(r,l,o):o?{value:o.value,pending:!o.delivered}:void 0}dh(e,n){if(!this.persistence)return;this.persistence.refreshKey(e.persistenceKey);const i=this.rh(e);i?.value!==n||i.delivered||e.register(n,!0)}capture(e,n,i){var r,o;
17if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this.qu))return void Ce.uninitializedWarning("posthog.capture");if(!this.is_capturing())return;if(le(e)||!mt(e))return void Ce.error("No event name provided to posthog.capture");this.Su();const l=!this.config.opt_out_useragent_filter&&this._is_bot();if(l&&!this.config.__preview_capture_bot_pageviews)return;const u=i?.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(u?.isRateLimited)return void Ce.critical("This capture call is ignored due to client rate limiting.");let d;n?.$current_url&&!mt(n?.$current_url)&&(Ce.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),e!=="$exception"||i?.fh||Ce.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&(d=this.sessionPersistence.update_campaign_params()),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();const f=new Date,p=i?.timestamp||f,g=IM(i?.uuid,po);let v={uuid:g,event:e,properties:this.calculateEventProperties(e,n||{},p,g)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&l&&(v.event="$bot_pageview",v.properties.$browser_type="bot"),u&&(v.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens);const y=e==="$feature_flag_called"&&v.properties.$feature_flag_has_experiment===!1&&this.get_property("$minimal_flag_called_events")===!0;i?.$set&&!y&&(v.$set=i?.$set);const b=xt(n?.$set)?n.$set:void 0,x=Je(n?.$unset)?n.$unset:[],S=i?.$unset||[],k=ne=>{var ce;const Z=!!i?.$set&&ne in i.$set;return{hasProvided:Z||!!b&&ne in b,provided:Z?i==null||(ce=i.$set)===null||ce===void 0?void 0:ce[ne]:b?.[ne],unset:x.indexOf(ne)!==-1||S.indexOf(ne)!==-1}},T=k(YM),C=k(QM),A=[{channel:this.nh,hasProvided:T.hasProvided,update:this.uh(d?.fbclid,T.provided,T.hasProvided,T.unset)},{channel:this.sh,hasProvided:C.hasProvided,update:this.hh(C.provided,C.hasProvided,C.unset)}];for(const{channel:ne,hasProvided:ce,update:Z}of A)Z&&v.properties.$process_person_profile===!0&&Z.pending&&!ce&&!y&&(v.$set=z({[ne.property]:Z.value},v.$set));const $=i?.$unset;$&&(v.$unset=$);const N=y?void 0:this.ph(i?.$set_once,e!==tI,e===FU);if(N&&(v.$set_once=N),i?._noTruncate||(j=this.config.properties_string_max_length,v=(function(ne,ce){const Z=new Set;return(function ae(ue,ge){if(ue!==Object(ue))return ce?ce(ue):ue;if(Z.has(ue))return;let Re;if(Z.add(ue),Je(ue))Re=[],bh(ue,xe=>{Re.push(ae(xe))});else{const xe={};Wt(df(ue)?HU(ue):ue,(Ie,Oe)=>{Z.has(Ie)||(xe[Oe]=ae(Ie))}),Re=xe}return Re})(ne)})(v,ne=>mt(ne)?ne.slice(0,j):ne)),v.timestamp=p,le(i?.timestamp)||(v.properties.$event_time_override_provided=!0,v.properties.$event_time_override_system_time=f),y&&(v.properties=((ne,ce=[])=>{const Z={},ae=ue=>{ne[ue]!==void 0&&(Z[ue]=ne[ue])};return kX.forEach(ae),ce.forEach(ae),Z})(v.properties,d7)),e===za.DISMISSED||e===za.SENT){const ne=n?.[A1.SURVEY_ID],ce=n?.[A1.SURVEY_ITERATION];N6({id:ne,current_iteration:ce}),v.$set=z(z({},v.$set),{},{[YY({id:ne,current_iteration:ce},e===za.SENT?"responded":"dismissed")]:!0})}else e===za.SHOWN&&(v.$set=z(z({},v.$set),{},{[A1.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var j;if(e===IY.SHOWN){const ne=n?.[bI.TOUR_TYPE];ne&&(v.$set=z(z({},v.$set),{},{[`${bI.TOUR_LAST_SEEN_DATE}/${ne}`]:new Date().toISOString()}))}const O=z(z({},v.properties.$set),v.$set);if(zr(O)||this.setPersonPropertiesForFlags(O),!it(this.config.before_send)){const ne=this.Os(v);if(!ne)return;v=ne,v.uuid=IM(v.uuid,po)}const L=A.filter(({channel:ne,update:ce})=>{var Z,ae,ue;const ge=(Z=(ae=v.$set)===null||ae===void 0?void 0:ae[ne.property])!==null&&Z!==void 0?Z:xt((ue=v.properties)===null||ue===void 0?void 0:ue.$set)?v.properties.$set[ne.property]:void 0;
17return ce?.pending&&ge===ce.value});this.vu.emit("eventCaptured",v);const B=(r=i?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),V=i?._batchKey==="recordings"||/\/s\/(?:\?|$)/.test(B),ee=z(z(z({method:"POST",url:B,data:v,compression:"best-available",preferSyncCompression:i?.send_instantly,timestampMode:V?"body":"capture-body",batchKey:i?._batchKey},V&&(!((o=v.properties)===null||o===void 0)&&o.$session_id)?{batchGroup:v.properties.$session_id+(v.properties.$window_id?`-${v.properties.$window_id}`:"")}:{}),i?.transport?{transport:i.transport}:{}),L.length?{fireCallbackOnDrop:!0,callback:ne=>{if(ne.statusCode>=200&&300>ne.statusCode)for(const{channel:ce,update:Z}of L)this.dh(ce,Z.value)}}:{});if(!this.config.request_batching||i&&!i?._batchKey||i?.send_instantly||L.length){var me;let ne;!ee.transport&&!ee.callback&&zr((me=this.config.request_headers)!==null&&me!==void 0?me:{})&&this.$u&&(ne="sendBeacon"),this.ju(ee,ne)}else this.qu.enqueue(ee);return v}_addCaptureHook(e){return this.on("eventCaptured",n=>e(n.event,n))}getExtension(e){var n;return(n=this.Xu)===null||n===void 0?void 0:n.getExtension(e)}Zu(){var e;return(e=this.Xu)!==null&&e!==void 0?e:this.Xu=new c7(this)}pu(e){this.Pu.push(e);let n=!0;return()=>{if(!n)return;n=!1;const i=this.Pu.indexOf(e);i!==-1&&this.Pu.splice(i,1)}}gh(e=!0){var n,i,r;return!!(!((n=this.persistence)===null||n===void 0)&&n.consumeCookieIdentityChange())&&(this.Ou=null,this.persistence.get_property("$user_state")==="anonymous"&&((r=this.sessionPersistence)===null||r===void 0||r.clear(),this.Mu.clear(),this.mh()),(i=this.featureFlags)===null||i===void 0||i.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,n,i,r,o){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return n;this.persistence.syncCookieProperties(),this.gh();const l=o?void 0:this.persistence.remove_event_timer(e);let u=z({},n);if(u.token=this.config.token,u.$config_defaults=this.config.defaults,this.bu()&&(u[MU]=!0),e==="$snapshot"){const T=z(z({},this.persistence.properties()),this.sessionPersistence.properties());return u.distinct_id=T.distinct_id,(!mt(u.distinct_id)&&!Fn(u.distinct_id)||Ig(u.distinct_id))&&Ce.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),u}const d=(function(T,C,A,$=!1){var N,j,O,L;if(!kr)return{};const B=T?[...Jh,...C||[]]:[],[V,ee]=tU(kr),[me,ne]=(function(P){for(let F=0;MM.length>F;F++){const[re,Y,de]=MM[F],ke=P.match(re);if(ke){const Ae=de&&P.match(de)||ke;return[Y,Ae?.[1]||""]}}return["",""]})(kr),ce=(function(){const P="u">typeof navigator?navigator:void 0;return P?.brave?{brave:!0}:{}})(),Z={};le(A)||(Z.detectGoogleSearchApp=A);const ae={},ue=(N=navigator)===null||N===void 0||(N=N.userAgentData)===null||N===void 0?void 0:N.platform,ge=(j=navigator)===null||j===void 0?void 0:j.maxTouchPoints,Re=G==null||(O=G.screen)===null||O===void 0?void 0:O.width,xe=G==null||(L=G.screen)===null||L===void 0?void 0:L.height,Ie=G?.devicePixelRatio;le(ue)||(ae.userAgentDataPlatform=ue),le(ge)||(ae.maxTouchPoints=ge),le(Re)||(ae.screenWidth=Re),le(xe)||(ae.screenHeight=xe),le(Ie)||(ae.devicePixelRatio=Ie);const Oe=pn(JC({$os:V,$os_version:ee,$browser:eU(kr,navigator.vendor,ce,Z),$webview_app:me,$webview_app_version:ne,$device:nU(kr),$device_type:qJ(kr,ae),$timezone:u6(),$timezone_offset:PY()}),{$current_url:bm($?cc(Cn?.href):Cn?.href,B,wm),$host:Cn?.host,$pathname:Cn?.pathname,$raw_user_agent:kr.length>1e3?kr.substring(0,997)+"...":kr,$browser_version:WJ(kr,navigator.vendor,ce,Z),$browser_language:o6(),$browser_language_prefix:jY(),$screen_height:G?.screen.height,$screen_width:G?.screen.width,$viewport_height:G?.innerHeight,$viewport_width:G?.innerWidth,$lib:La.LIB_NAME,$lib_version:La.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return La.SDK_DIST_CHANNEL&&(Oe.$sdk_dist_channel=La.SDK_DIST_CHANNEL),Oe})(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes
17);if(this.sessionManager){const{sessionId:T,windowId:C}=this.sessionManager.checkAndGetSessionAndWindowId(o,i.getTime(),!0);u.$session_id=T,u.$window_id=C}this.sessionPropsManager&&pn(u,this.sessionPropsManager.getSessionProps());try{var f;this.sessionRecording&&pn(u,this.sessionRecording.sdkDebugProperties),u.$sdk_debug_retry_queue_size=(f=this.Bu)===null||f===void 0?void 0:f.length}catch(T){u.$sdk_debug_error_capturing_properties=String(T)}let p;if(this.requestRouter.region===YT&&(u.$lib_custom_api_host=this.config.api_host),p=e!=="$pageview"||o?e!=="$pageleave"||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),u=pn(u,p),e==="$pageview"&&he&&(u.title=he.title),!le(l)){const T=i.getTime()-l;u.$duration=parseFloat((T/1e3).toFixed(3))}kr&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?"bot":"browser");const g=this.persistence.properties(),v=this.sessionPersistence.properties(),y=u.$groups,b=g.$groups;xt(y)&&!zr(y)&&(u.$groups=z(z({},xt(b)?b:{}),y)),Wt(["$referrer","$referring_domain"],T=>{T in g&&delete v[T]});const x={};if(this.Pu.length>0)for(const T of this.Pu.slice())try{pn(x,T())}catch(C){Ce.error("Failed to produce browser extension event properties",C)}u=pn({},d,g,v,z(z({},x),u)),u.$is_identified=this._isIdentified(),Je(this.config.property_denylist)?Wt(this.config.property_denylist,function(T){delete u[T]}):Ce.error(M6+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);const S=this.config.sanitize_properties;S&&(Ce.error(PI),u=S(u,e));const k=this.yh();return u.$process_person_profile=k,k&&!o&&this.bh("_calculate_event_properties"),u}ph(e,n=!0,i=!1){var r;if(!this.persistence||!this.yh()||this.Iu&&!i)return e;const o=this.persistence.get_initial_props(),l=(r=this.sessionPropsManager)===null||r===void 0?void 0:r.getSetOnceProps();let u=pn({},o,l||{},e||{});const d=this.config.sanitize_properties;return d&&(Ce.error(PI),u=d(u,"$set_once")),n&&(this.Iu=!0),zr(u)?void 0:u}register(e,n){var i;(i=this.persistence)===null||i===void 0||i.register(e,n)}register_once(e,n,i){var r;(r=this.persistence)===null||r===void 0||r.register_once(e,n,i)}register_for_session(e){var n,i;(n=this.persistence)===null||n===void 0||n.syncCookieProperties(),this.gh(),(i=this.sessionPersistence)===null||i===void 0||i.register(e),Object.keys(e).forEach(r=>this.Mu.add(r)),this.mh()}unregister(e){var n;(n=this.persistence)===null||n===void 0||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(e),this.Mu.delete(e),this.mh()}_h(e,n){this.register({[e]:n})}Hu(){this.Mu.forEach(e=>{var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(e)}),this.Mu.clear(),this.mh()}mh(){var e;if(!this.Eu)return;if(this.config.persistence==="memory"||!((e=this.sessionPersistence)===null||e===void 0)&&e.mi||!dn.Et())return void dn.Lt(this.Eu);const n=[];this.Mu.forEach(i=>n.push(i)),n.length>0?dn.At(this.Eu,n):dn.Lt(this.Eu)}getFeatureFlag(e,n){var i;return(i=this.featureFlags)===null||i===void 0?void 0:i.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n;return(n=this.featureFlags)===null||n===void 0?void 0:n.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){var i;return(i=this.featureFlags)===null||i===void 0?void 0:i.getFeatureFlagResult(e,n)}getAllFeatureFlags(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,n){var i,r;return(i=(r=this.featureFlags)===null||r===void 0?void 0:r.isFeatureEnabled(e,n))!==null&&i!==void 0?i:n?.defaultValue}reloadFeatureFlags(){var e;(e=this.featureFlags)===null||e===void 0||e.reloadFeatureFlags()}updateFlags(e,n,i){var r;(r=this.featureFlags)===null||r===void 0||r.updateFlags(e,n,i)}updateEarlyAccessFeatureEnrollment(e,n,i){var r;(r=this.featureFlags)===null||r===void 0||r.updateEarlyAccessFeatureEnrollment(e,n,i)}getEarlyAccessFeatures(e,n=!1,i){var r;return(r=this.featureFlags)===null||r===void 0?void 0:r.getEarlyAccessFeatures(e,n,i)}on(e,n){return this.vu.on(e,n)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:Dp}),()=>{})}onSessionId(e){var n,i;return(n=(i=this.sessionManager)===null||i===void 0?void 0:i.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n=!1){this.surveys?this.surveys.getSurveys(e,n):e([],{isLoaded:!1,error:Dp})}getActiveMatchingSurveys(e,n=!1){this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:Dp})}renderSurvey(e,n){var i;(i=this.surveys)===null||i===void 0||i.renderSurvey(e,n)}displaySurvey(e,n=i7){var i;(i=this.surveys)===null||i===void 0||i.displaySurvey(e,n)}cancelPendingSurvey(e){var n;(n=this.surveys)===null||n===void 0||n.cancelPendingSurvey(e)}canRenderSurvey(e){var n,i;return(n=(i=this.surveys)===null||i===void 0?void 0:i.canRenderSurvey(e))!==null&&n!==void 0?n:{visible:!1,disabledReason:Dp}}canRenderSurveyAsync(e,n=!1){var i,r;return(i=(r=this.surveys)===null||r===void 0?void 0:r.canRenderSurveyAsync(e,n))!==null&&i!==void 0?i:Promise.resolve({visible:!1,disabledReason:Dp})}wh(e){return!e||Ig(e)?(Ce.critical("Unique user id has not been set in posthog.identify"),!1):e==="$posthog_cookieless"?(Ce.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(Ce.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
17ot a hardcoded string.`),!1)}identify(e,n,i){if(!this.__loaded||!this.persistence)return Ce.uninitializedWarning("posthog.identify");if(Fn(e)&&(e=e.toString(),Ce.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!this.wh(e)||!this.bh("posthog.identify"))return;this.Su();const r=this.get_distinct_id(),o=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,l=this.gh(!1),u=this.persistence.Da();let d=!1;try{const p=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:p},""),e!==p&&e!==this.get_property("__alias")&&(this.unregister(bb),this.register({distinct_id:e}));const g=(this.persistence.get_property("$user_state")||"anonymous")===Ia,v=e!==p,y=!v&&g;if(v&&g){var f;const b=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:p};this.persistence.set_property(Cr,S_),this.setPersonPropertiesForFlags({$set:n||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.La(),this.capture("$identify",b,{$set:n||{},$set_once:i||{}})&&(this.Ou=I1(e,n,i)),(f=this.featureFlags)===null||f===void 0||f.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:p)}else if(y){this.persistence.set_property(Cr,S_);const b=n||{},x=i||{};this.setPersonPropertiesForFlags({$set:b,$set_once:x},!1),this.config.cookieWinsOnConflict&&this.persistence.La(),this.capture("$set",{$set:b,$set_once:x})&&(this.Ou=I1(e,n,i))}else(n||i)&&this.setPersonProperties(n,i);v||o||l?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(tc)):y&&(n||i)&&this.reloadFeatureFlags(),d=!0}finally{u&&this.persistence.ja(d)}}setPersonProperties(e,n){if(!e&&!n||!this.bh("posthog.setPersonProperties"))return;const i=I1(this.get_distinct_id(),e,n);this.Ou!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}})&&(this.Ou=i)):Ce.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}unsetPersonProperties(e){var n;const i=(Je(e)?e:[e]).filter(r=>mt(r)&&r.length>0);i.length!==0&&this.bh("posthog.unsetPersonProperties")&&((n=this.featureFlags)===null||n===void 0||n.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.Ou=null)}group(e,n,i){var r;if(!e||!n)return void Ce.error("posthog.group requires a group type and group key");(r=this.persistence)===null||r===void 0||r.syncCookieProperties(),this.gh();const o=this.getGroups(),l=o[e]!==n;if(l&&this.resetGroupPropertiesForFlags(e),this.register({$groups:z(z({},o),{},{[e]:n})}),(l||i)&&this.yh()){const u={$group_type:e,$group_key:n};i&&(u.$group_set=i),this.capture(tI,u)}i&&this.setGroupPropertiesForFlags({[e]:i}),l&&!i&&this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n=!0){var i;(i=this.featureFlags)===null||i===void 0||i.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(e=!0){var n;(n=this.featureFlags)===null||n===void 0||n.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,n=!0){var i;this.bh("posthog.setGroupPropertiesForFlags")&&((i=this.featureFlags)===null||i===void 0||i.setGroupPropertiesForFlags(e,n))}resetGroupPropertiesForFlags(e){var n;(n=this.featureFlags)===null||n===void 0||n.resetGroupPropertiesForFlags(e)}reset(e){const n=Or(e)?e:e?.resetDeviceID,i=Or(e)||e==null?void 0:e.bootstrap;this.kh(n,!1,i)}kh(e,n=!1,i){var r,o,l,u,d,f;if(Ce.info("reset"),!this.__loaded)return Ce.uninitializedWarning("posthog.reset");const p=i?.sessionID;this.config.bootstrap=i||((r=this.Lu)===null||r===void 0?void 0:r.bootstrap)||{},(o=this.featureFlags)===null||o===void 0||(l=o.updateConfig)===null||l===void 0||l.call(o,this.config,this.nl());const g=this.get_property(ZC),v=this.get_property(b1),y=this.get_property(Lg);(u=this.sessionRecording)===null||u===void 0||u.flushBeforeIdentityReset();const b=this.is_capturing();this.consent.reset(),n||!b||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");const x=(d=this.persistence)===null||d===void 0||(f=d.Da)===null||f===void 0?void 0:f.call(d);let S=!1;try{var k,T,C,A,$,N,j,O,L,B,V,ee,me;if((k=this.persistence)===null||k===void 0||k.clear(),(T=this.sessionPersistence)===null||T===void 0||T.clear(),this.Mu.clear(),this.mh(),le(y)||(B=this.persistence)===null||B===void 0||B.register({$session_recording_remote_config:y}),(C=this.surveys)===null||C===void 0||C.reset(),(A=this.featureFlags)===null||A===void 0||A.reset(),($=this.conversations)===null||$===void 0||$.reset(),(N=this.logs)===null||N===void 0||N.reset(),(j=this.metrics)===null||j===void 0||j.reset(),(O=this.persistence)===null||O===void 0||O.set_property("$user_state","anonymous"),(L=this.sessionManager)===null||L===void 0||L.resetSessionId(),this.Ou=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:w1,$device_id:null},"");else{const Z=this.config.get_device_id(po());this.register_once({distinct_id:Z,$device_id:e?Z:g},""),e||le(v)||this.register({[b1]:v})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),i&&(i.distinctID&&!this.bu()&&((me=this.persistence)===null||me===void 0||me.set_property("$user_state",i.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:i.distinctID})),(V=this.featureFlags)===null||V===void 0||V.initialize(),!it(p)&&!(!((ee=this.sessionManager)===null||ee===void 0)&&ee.setBootstrapSessionId(p,!0)))){const Z=z({},i);delete Z.sessionID,this.config.bootstrap=Z}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,S=!0}finally{var ne,ce;
17x&&((ne=this.persistence)===null||ne===void 0||(ce=ne.ja)===null||ce===void 0||ce.call(ne,S))}this.reloadFeatureFlags()}shutdown(e){var n=this;return _n(function*(){var i,r,o,l,u,d,f,p;if(n.__loaded){n.Tu=!0,n.Zu().dispose(),(i=n.sessionRecording)===null||i===void 0||i.dispose(),(r=n.logs)===null||r===void 0||r.flushLogs("sendBeacon"),(o=n.metrics)===null||o===void 0||o.flush("sendBeacon"),(l=n.metrics)===null||l===void 0||l.dispose(),(u=n.qu)===null||u===void 0||u.unload(),(d=n.Bu)===null||d===void 0||d.unload();try{var g;(g=n.featureFlags)===null||g===void 0||g.destroy()}catch(v){Ce.error("Error while destroying feature flags",v)}(f=n.persistence)===null||f===void 0||f.destroy(),(p=n.sessionPersistence)===null||p===void 0||p.destroy()}else Ce.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,n){var i;delete this.config.identity_claims,this.config.identity_distinct_id=e,this.config.identity_hash=n,this.alias(e),(i=this.conversations)===null||i===void 0||i.Sh()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,(e=this.conversations)===null||e===void 0||e.xh()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";const{sessionId:n,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0);let r=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${n}`);if(e?.withTimestamp&&i){var o;const l=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!i)return r;r+=`?t=${Math.max(Math.floor((new Date().getTime()-i)/1e3)-l,0)}`}return r}alias(e,n){return e===this.get_property("$people_distinct_id")?(Ce.critical("Attempting to create alias for existing People user - aborting."),-2):this.bh("posthog.alias")?(le(n)&&(n=this.get_distinct_id()),e!==n?(this._h(bb,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(Ce.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){const n=z({},this.config);if(xt(e)){var i,r,o,l,u,d,f,p,g,v,y,b,x,S;pn(this.config,II(e));const T=this.xu();(i=this.persistence)===null||i===void 0||i.update_config(this.config,n,T),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new R1(z(z({},this.config),{},{persistence:"sessionStorage"}),T,!1);const C=this.Du(this.config.debug);var k;Or(C)&&(this.config.debug=C),Or(this.config.debug)&&(this.config.debug?(li.DEBUG=!0,Ot.Et()&&Ot.At("ph_debug",!0),Ce.info("set_config",{config:e,oldConfig:n,newConfig:z({},this.config)})):(li.DEBUG=!1,Ot.Et()&&Ot.Lt("ph_debug"))),(r=this.featureFlags)===null||r===void 0||(o=r.updateConfig)===null||o===void 0||o.call(r,this.config,this.nl()),(l=this.exceptionObserver)===null||l===void 0||l.onConfigChange(),(u=this.exceptions)===null||u===void 0||u.onConfigChange(),(d=this.metrics)===null||d===void 0||d.onConfigChange(),(f=this.sessionRecording)===null||f===void 0||f.startIfEnabledOrStop(),(p=this.tracingHeaders)===null||p===void 0||p.startIfEnabledOrStop(),(g=this.autocapture)===null||g===void 0||g.startIfEnabled(),(v=this.heatmaps)===null||v===void 0||v.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&((k=this.historyAutocapture)===null||k===void 0||k.startIfEnabledOrStop()),(y=this.exceptionObserver)===null||y===void 0||y.startIfEnabledOrStop(),(b=this.deadClicksAutocapture)===null||b===void 0||b.startIfEnabledOrStop(),(x=this.surveys)===null||x===void 0||x.loadIfEnabled(),this.Cu(),(S=this.externalIntegrations)===null||S===void 0||S.startIfEnabledOrStop(),!n.segment&&this.config.segment&&this.persistence&&mI(this,qg,!1)}}_overrideSDKInfo(e,n){li.LIB_NAME=e,li.LIB_VERSION=n}startSessionRecording(e){const n=e===!0,i={sampling:n||!!e?.sampling,linked_flag:n||!!e?.linked_flag,url_trigger:n||!!e?.url_trigger,event_trigger:n||!!e?.event_trigger};var r,o,l,u,d;Object.values(i).some(Boolean)&&((r=this.sessionManager)===null||r===void 0||r.checkAndGetSessionAndWindowId(),i.sampling&&((o=this.sessionRecording)===null||o===void 0||o.overrideSampling()),i.linked_flag&&((l=this.sessionRecording)===null||l===void 0||l.overrideLinkedFlag()),i.url_trigger&&((u=this.sessionRecording)===null||u===void 0||u.overrideTrigger("url")),i.event_trigger&&((d=this.sessionRecording)===null||d===void 0||d.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!!(!((e=this.sessionRecording)===null||e===void 0)&&e.started)}captureException(e,n){try{if(!this.exceptions)return;const i=this.exceptions.buildProperties(e,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(z(z({},i),n))}catch{return}}addExceptionStep(e,n){var i;(i=this.exceptions)===null||i===void 0||i.addExceptionStep(e,n)}captureLog(e){var n;(n=this.logs)===null||n===void 0||n.captureLog(e)}get logger(){var e,n;return(e=(n=this.logs)===null||n===void 0?void 0:n.logger)!==null&&e!==void 0?e:Ll.Ch}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var n,i;return(n=(i=this.toolbar)===null||i===void 0?void 0:i.loadToolbar(e))!==null&&n!==void 0&&n}get_property(e){var n;return(n=this.persistence)===null||n===void 0?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)===null||n===void 0?void 0:n.props[e]}toString(){var e;let n=(e=this.config.name)!==null&&e!==void 0?e:gg;return n!==gg&&(n="posthog."+n),n}_isIdentified(){var e,n;return((e=this.persistence)===null||e===void 0?void 0:e.get_property("$user_state"))==="identified"||((n=this.sessionPersistence)===null||n===void 0?void 0:n.get_property("$user_state"))==="identified"}yh(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&zr(this.getGroups())&&!(!((e=this.persistence)===null||e===void 0||(e=e.props)===null||e===void 0)&&e.__alias)&&
17!(!((n=this.persistence)===null||n===void 0||(n=n.props)===null||n===void 0)&&n.$epp))}ih(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&!!this.config.capture_pageview}createPersonProfile(){this.yh()||this.bh("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.bh("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}bh(e){return this.config.person_profiles==="never"?(Ce.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._u(),this._h(VC,!0),!0)}xu(){if(this.config.cookieless_mode==="always")return!0;const e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!=="on_reject")}Cu(){var e,n;const i=this.xu();var r,o,l;return this.is_capturing()||(r=this.logs)===null||r===void 0||r.$h(),((e=this.persistence)===null||e===void 0?void 0:e.mi)!==i&&((o=this.persistence)===null||o===void 0||o.set_disabled(i)),((n=this.sessionPersistence)===null||n===void 0?void 0:n.mi)!==i&&((l=this.sessionPersistence)===null||l===void 0||l.set_disabled(i)),i&&(this.Mu.clear(),this.mh()),i}opt_in_capturing(e){var n;if(this.config.cookieless_mode!=="always"){if(this.bu()){var i,r,o,l,u,d;(i=this.sessionRecording)===null||i===void 0||i.dispose({discardBufferedEvents:!0}),this.kh(!0,!0),(r=this.sessionManager)===null||r===void 0||r.destroy(),(o=this.pageViewManager)===null||o===void 0||o.destroy(),this.sessionManager=new RI(this),this.pageViewManager=new vI(this),this.persistence&&(this.sessionPropsManager=new CI(this,this.sessionManager,this.persistence));const y=(l=(u=this.config.__extensionClasses)===null||u===void 0?void 0:u.sessionRecording)!==null&&l!==void 0?l:(d=Ll.__defaultExtensionClasses)===null||d===void 0?void 0:d.sessionRecording;var f,p;y&&(this.sessionRecording=this.yu(this.sessionRecording,new y(this)),this.du&&((f=this.sessionRecording)===null||f===void 0||(p=f.onRemoteConfig)===null||p===void 0||p.call(f,this.du)))}var g,v;this.consent.optInOut(!0),this.Cu(),this.Yu(),(n=this.sessionRecording)===null||n===void 0||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&((g=this.surveys)===null||g===void 0||g.loadIfEnabled()),(le(e?.captureEventName)||e?.captureEventName)&&this.capture((v=e?.captureEventName)!==null&&v!==void 0?v:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.th()}else Ce.warn(jI)}opt_out_capturing(){if(this.config.cookieless_mode==="always")return void Ce.warn(jI);const e=this.config.cookieless_mode==="on_reject"?this.sessionRecording:void 0;var n,i;e?.dispose({discardBufferedEvents:!0}),this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.kh(!0,!0),this.consent.optInOut(!1),this.Cu(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:w1,$device_id:null}),this.mu(e),this.sessionRecording=void 0,(n=this.sessionManager)===null||n===void 0||n.destroy(),(i=this.pageViewManager)===null||i===void 0||i.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.th(),this.Yu())}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){const e=this.consent.consent;return e===1?"granted":e===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Cu()}_is_bot(){return mi?R6(mi,this.config.custom_blocked_useragents):void 0}th(){he&&(he.visibilityState==="visible"?this.Ru||(this.Ru=!0,this.capture(GC,{title:he.title},{send_instantly:!0}),this.Au&&(he.removeEventListener(vm,this.Au),this.Au=null)):this.Au||(this.Au=this.th.bind(this),Ht(he,vm,this.Au)))}debug(e){e===!1?(G?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(G?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}nl(){const e=this.Lu||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(Ce.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(function(n,i,r,o,l){const u=i in n&&!it(n[i]),d=r in n&&!it(n[r]);return u?n[i]:!!d&&(l&&l.warn(`Config field '${r}' is deprecated. Please use '${i}' instead. The old field will be removed in a future major version.`),n[r])})(e,"advanced_disable_flags","advanced_disable_decide",0,Ce)}Os(e){var n;if(it(this.config.before_send))return e;const i=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(NJ),r=Je(this.config.before_send)?this.config.before_send:[this.config.before_send];let o=e;for(const l of r)try{if(o=l(o),it(o)){const u=`Event '${e.event}' was rejected in beforeSend function`;return PJ(e.event)?Ce.warn(`${u}. This can cause unexpected behavior.`):Ce.info(u),null}o.properties&&!zr(o.properties)||Ce.warn(`Event '${e.event}' has no properties after beforeSend function, this is likely an error.`)}catch(u){return Ce.error(`Error in beforeSend function for event '${e.event}':`,u),null}for(const l of i)if(o.properties&&it(o.properties[l]))return Ce.warn(`Event '${e.event}' had its '${l}' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped.`),null;return o}getPageViewId(){var e;
17return(e=this.pageViewManager.Vo)===null||e===void 0?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(i)})}Du(e){const n=Or(e)&&!e,i=Ot.Et()&&Ot.Ot("ph_debug")==="true";return!n&&(!!i||e)}};Vg.__defaultExtensionClasses={},Vg.Ch=(()=>{const t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),(function(t,e){for(let n=0;e.length>n;n++)t.prototype[e[n]]=cY(t.prototype[e[n]])})(Vg,["identify"]);var I6=class{constructor(e){this.disabled=e===!1;const n=xt(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,i){if(this.disabled)return!1;const r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(n-r.y)<this.thresholdPx&&this.timeoutMs>i-r.timestamp){if(this.clicks.push({x:e,y:n,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:i}];return!1}};const L1="$copy_autocapture",U1=$n("[AutoCapture]");function F1(t,e){return e.length>t?e.slice(0,t)+"...":e}function g7(t){if(t.previousElementSibling)return t.previousElementSibling;let e=t;do e=e.previousSibling;while(e&&!ta(e));return e}function m7(t,{e,maskAllElementAttributes:n,maskAllText:i,elementAttributeIgnoreList:r,elementsChainAsString:o,disableCaptureUrlHashes:l}){var u,d;if(!ta(t))return{props:{}};const f=[t],p=new Set([t]);let g=t;for(;g.parentNode&&!qi(g,"body")&&1e3>f.length;){if(XC(g.parentNode)){const N=g.parentNode.host;if(p.has(N))break;p.add(N),f.push(N),g=N;continue}if(!ta(g.parentNode)||p.has(g.parentNode))break;p.add(g.parentNode),f.push(g.parentNode),g=g.parentNode}const v=e.type==="click"&&t.namespaceURI==="http://www.w3.org/2000/svg"?f.findIndex(N=>qi(N,"button")||qi(N,"a")):-1;v>0&&(i=i||f.slice(0,v+1).some(N=>!Ih(N)||_m(N)));const y=[],b={};let x,S=!1,k=!1;if(Wt(f,N=>{const j=Ih(N);if(qi(N,"a")&&!n&&!r?.includes("href")){const O=N.getAttribute("href");S=!!(j&&O&&Kg(O))&&(l?cc(O):O)}Qe(Bh(N),"ph-no-capture")&&(k=!0),y.push((function(O,L,B,V,ee=!1){const me=O.tagName.toLowerCase(),ne={tag_name:me};QC.indexOf(me)>-1&&!B&&(ne.$el_text=me.toLowerCase()==="a"||me.toLowerCase()==="button"?F1(1024,fI(O)):F1(1024,ym(O)));const ce=Bh(O);L||V?.includes("class")||0>=ce.length||(ne.classes=ce.filter(function(ge){return ge!==""})),Wt(O.attributes,function(ge){var Re;if((!_m(O)||["name","id","class","aria-label"].indexOf(ge.name)!==-1)&&!V?.includes(ge.name)&&!L&&Kg(ge.value)&&(!mt(Re=ge.name)||Re.substring(0,10)!=="_ngcontent"&&Re.substring(0,7)!=="_nghost")){let xe=ge.value;ge.name==="class"&&(xe=YC(xe).join(" ")),ne["attr__"+ge.name]=F1(1024,ge.name==="href"&&ee?cc(xe):xe)}});let Z=1,ae=1,ue=O;for(;ue=g7(ue);)Z++,ue.tagName===O.tagName&&ae++;return ne.nth_child=Z,ne.nth_of_type=ae,ne})(N,n,i,r,l)),Wt((function(O){if(!Ih(O))return{};const L={};return Wt(O.attributes,function(B){if(B.name&&B.name.indexOf("data-ph-capture-attribute")===0){const V=B.name.replace("data-ph-capture-attribute-",""),ee=B.value;V&&ee&&Kg(ee)&&(L[V]=ee)}}),L})(N),(O,L)=>{({}).hasOwnProperty.call(b,L)||(b[L]=O)})}),k)return{props:{},explicitNoCapture:k};if(v>0&&(t=f[v],y.splice(0,v)),i||(y[0].$el_text=qi(t,"a")||qi(t,"button")?fI(t):ym(t)),S){var T,C;y[0].attr__href=S;const N=(T=Wa(S))===null||T===void 0?void 0:T.host,j=G==null||(C=G.location)===null||C===void 0?void 0:C.host;N&&j&&N!==j&&(x=S)}return{props:pn(($=e.type,{$event_type:$,$ce_version:1}),o?{}:{$elements:y},{$elements_chain:(A=y,Je(A)?(function(N){return N.map(j=>{var O,L;let B="";if(j.tag_name&&(B+=j.tag_name),j.attr_class){j.attr_class.sort();for(const me of j.attr_class)B+=`.${me.replace(/"/g,"")}`}const V=z(z(z(z({},j.text?{text:j.text}:{}),{},{"nth-child":(O=j.nth_child)!==null&&O!==void 0?O:0,"nth-of-type":(L=j.nth_of_type)!==null&&L!==void 0?L:0},j.href?{href:j.href}:{}),j.attr_id?{attr_id:j.attr_id}:{}),j.attributes),ee={};return k_(V).sort(([me],[ne])=>(function(ce,Z){return Z>ce?-1:ce>Z?1:0}
17)(me,ne)).forEach(([me,ne])=>ee[pI(me.toString())]=pI(ne.toString())),B+=":",B+=k_(ee).map(([me,ne])=>`${me}="${ne}"`).join(""),B}).join(";")})((function(N){return N.map(j=>{var O,L;const B={text:(O=j.$el_text)===null||O===void 0?void 0:O.slice(0,400),tag_name:j.tag_name,href:(L=j.attr__href)===null||L===void 0?void 0:L.slice(0,2048),attr_class:kY(j),attr_id:j.attr__id,nth_child:j.nth_child,nth_of_type:j.nth_of_type,attributes:{}};return k_(j).filter(([V])=>V.indexOf("attr__")===0).forEach(([V,ee])=>B.attributes[V]=ee),B})})(A)):"")},!((u=y[0])===null||u===void 0)&&u.$el_text?{$el_text:(d=y[0])===null||d===void 0?void 0:d.$el_text}:{},x&&e.type==="click"?{$external_click_url:x}:{},b),target:t};var A,$}var v7=class{fo(){this.po=void 0,clearTimeout(this.mo),this.mo=void 0}yo(e){var n;if(!Ih(e))return!0;const i=(n=this.bo().css_selector_ignorelist)!==null&&n!==void 0?n:C1,r=new Set;let o=e;for(;o;){if(r.size>=1e3||r.has(o))return!0;r.add(o);const l=o,u=Bh(l);if(Qe(u,"ph-no-capture")||Qe(u,"ph-sensitive")||_m(l)||i.some(f=>WT(l,f)))return!0;const d=o.parentNode;o=XC(d)?d.host:d&&ta(d)?d:null}return!1}_o(e){if(!this.isEnabled||e.type==="pointercancel")return void this.fo();if(e.type==="pointerdown"){this.fo();const r=Hg(e);var n;return void(e.isPrimary&&e.button===0&&!e.ctrlKey&&r&&ta(r)&&(this.po={target:r,excluded:this.yo(r),id:e.pointerId,x:e.clientX,y:e.clientY,released:!1,distinctId:(n=this.wo)===null||n===void 0?void 0:n.distinctId}))}const i=this.po;i&&(e.pointerId!==i.id||Math.abs(e.clientX-i.x)>5||Math.abs(e.clientY-i.y)>5?this.fo():e.type==="pointerup"&&(i.released=!0,this.mo=setTimeout(()=>this.fo(),0)))}ko(e){var n;const i=this.po;this.fo();const r=Hg(e);if(i?.released&&i.target.isConnected&&i.distinctId===((n=this.wo)===null||n===void 0?void 0:n.distinctId)&&e.pointerId===i.id&&(e.detail>0||e.pointerType==="touch"||e.pointerType==="pen")&&e.button===0&&5>=Math.abs(e.clientX-i.x)&&5>=Math.abs(e.clientY-i.y)&&r&&(qi(r,"html")||qi(r,"body"))){var o;if(i.excluded)return null;const l=(o=this.bo().css_selector_ignorelist)!==null&&o!==void 0?o:C1;return[r,he?.documentElement,he?.body].some(u=>{if(!u)return!1;const d=Bh(u);return Qe(d,"ph-no-capture")||Qe(d,"ph-sensitive")||!Ih(u)||_m(u)||l.some(f=>WT(u,f))})?null:i.target}}constructor(e){this.So=e,this.name="autocapture",this.xo=!1,this.Co=null,this.$o=!1,this.To=!1,this.Rr={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Io=!1,this.So.refresh(this.Rr),this.rageclicks=new I6(this.Rr.rageclick),this.Mo=null}setup(e){this.Eo(),this.wo=e;const n=e.onRemoteConfig(this.onRemoteConfig.bind(this));this.Io?n.dispose():(this.Po=n,this.startIfEnabled())}dispose(){var e;this.Io||(this.Io=!0,this.wo=void 0,(e=this.Po)===null||e===void 0||e.dispose(),this.Po=void 0,this.Ro())}bo(){return this.So.refresh(this.Rr),this.Rr}Eo(){var e,n;return this.bo(),this.Rr.url_allowlist=(e=this.Rr.url_allowlist)===null||e===void 0?void 0:e.map(i=>new RegExp(i)),this.Rr.url_ignorelist=(n=this.Rr.url_ignorelist)===null||n===void 0?void 0:n.map(i=>new RegExp(i)),this.Rr}Ao(){if(!this.isBrowserSupported())return void U1.info("Disabling Automatic Event Collection because this browser is not supported");if(!G||!he)return;const e=this.Fo=n=>{n=n||G?.event;try{if(n.type==="blur")return void this.fo();if(n.type.indexOf("pointer")===0)return void this._o(n);const i=n.type==="click"?this.ko(n):void 0;if(On(i))return;this.Oo(n,"$autocapture",i)}catch(i){U1.error("Failed to capture event",i)}};if(Ht(G,"blur",e),Ht(he,"submit",e,{capture:!0}),Ht(he,"change",e,{capture:!0}),Ht(he,"click",e,{capture:!0}),Wt(["pointerdown","pointermove","pointerup","pointercancel"],n=>{Ht(he,n,e,{capture:!0})}),this.bo().capture_copied_text){const n=this.Do=i=>{i=i||G?.event;try{this.Oo(i,L1)}catch(r){U1.error("Failed to capture clipboard event",r)}};Ht(he,"copy",n,{capture:!0}),Ht(he,"cut",n,{capture:!0}),Ht(he,"paste",n,{capture:!0})}}Ro(){this.fo(),this.Fo&&(G?.removeEventListener("blur",this.Fo),Wt(["pointerdown","pointermove","pointerup","pointercancel"],e=>{he?.removeEventListener(e,this.Fo,!0)}),he?.removeEventListener("submit",this.Fo,!0),he?.removeEventListener("change",this.Fo,!0),he?.removeEventListener("click",this.Fo,!0),this.Fo=void 0),this.Do&&(he?.removeEventListener("copy",this.Do,!0),he?.removeEventListener("cut",this.Do,!0),he?.removeEventListener("paste",this.Do,!0),this.Do=void 0),this.xo=!1}startIfEnabled(){this.isEnabled||this.fo(),!this.Io&&this.wo&&this.isEnabled&&!this.xo&&(this.Ao(),this.xo=!0)}onRemoteConfig(e){if(this.Io)return;if(this.$o=!0,!e.ok)return void this.startIfEnabled();const n=e.config;
17n.elementsChainAsString&&(this.To=n.elementsChainAsString);const i=n.autocapture_opt_out;var r;Or(i)&&((r=this.wo)===null||r===void 0||r.kv.set("$autocapture_disabled_server_side",i),this.Co=i),this.startIfEnabled()}setElementSelectors(e){this.Mo=e}getElementSelectors(e,n){var i;const r=[];return(i=this.Mo)===null||i===void 0||i.forEach(o=>{const l=he?.querySelectorAll(o);l?.forEach(u=>{e!==u&&n!==u||Qe(r,o)||r.push(o)})}),r}get isEnabled(){var e,n;if(this.Io)return!1;const i=(e=this.wo)===null||e===void 0?void 0:e.kv.get(kU),r=this.Co,o=this.bo();if(!o.remoteRequestsDisabled&&!this.$o)return!1;const l=o.remoteRequestsDisabled&&!this.$o;if(On(r)&&!Or(i)&&!l)return!1;const u=(n=this.Co)!==null&&n!==void 0?n:!!i;return!!o.enabled&&!u}Oo(e,n="$autocapture",i){if(!this.isEnabled)return void this.fo();let r=i||Hg(e);qU(r)&&(r=r.parentNode||null);const o=this.Eo();var l;n==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&o.rageclick&&(!((l=this.rageclicks)===null||l===void 0)&&l.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime()))&&JU(r,o.rageclick)&&this.Oo(e,"$rageclick",i);const u=n===L1,d=u?z(z({},o),{},{dom_event_allowlist:void 0}):o;if(r&&(function(v,y,b,x,S,k){var T;if(!G||eO(v)||b?.url_allowlist&&!oI(b.url_allowlist,k)||b?.url_ignorelist&&oI(b.url_ignorelist,k))return!1;if(b?.dom_event_allowlist){const N=b.dom_event_allowlist;if(N&&!N.some(j=>y.type===j))return!1}const{parentIsUsefulElement:C,targetElementList:A}=XU(v,x);if(!(function(N,j){const O=j?.element_allowlist;if(le(O))return!0;for(const L of N)if(O.some(B=>L.tagName.toLowerCase()===B))return!0;return!1})(A,b)||!qT(A,b?.css_selector_allowlist)||qT(A,(T=b?.css_selector_ignorelist)!==null&&T!==void 0?T:C1))return!1;try{const N=G.getComputedStyle(v);if(N&&N.getPropertyValue("cursor")==="pointer"&&y.type==="click")return!0}catch{}const $=v.tagName.toLowerCase();switch($){case"html":return!1;case"form":return(S||["submit"]).indexOf(y.type)>=0;case"input":case"select":case"textarea":return(S||["change","click"]).indexOf(y.type)>=0;default:return C?(S||["click"]).indexOf(y.type)>=0:(S||["click"]).indexOf(y.type)>=0&&(QC.indexOf($)>-1||v.getAttribute("contenteditable")==="true")}})(r,e,d,u,u?["copy","cut","paste"]:void 0,{config:{get_current_url:o.getCurrentUrl}})){var f;const{props:v,explicitNoCapture:y,target:b}=m7(r,{e,maskAllElementAttributes:o.maskAllElementAttributes,maskAllText:o.maskAllText,elementAttributeIgnoreList:o.element_attribute_ignorelist,elementsChainAsString:this.To,disableCaptureUrlHashes:o.disableCaptureUrlHashes});if(y)return!1;const x=this.getElementSelectors(r,b);if(x&&x.length>0&&(v.$element_selectors=x),n===L1){const S=e.type||"clipboard";if(S!=="paste"){var p,g;const k=G==null||(p=G.getSelection())===null||p===void 0?void 0:p.toString(),T=VU(k);if(!T)return!1;v.$selected_content=T,v.$clipboard_text_length=(g=k?.length)!==null&&g!==void 0?g:0}v.$copy_type=S}return(f=this.wo)===null||f===void 0||f.capture(n,v),!0}}isBrowserSupported(){return pi(he?.querySelectorAll)}},y7=class{constructor(e){this._instance=e}refresh(e){const n=this._instance.config,i=xt(n.autocapture)?n.autocapture:void 0;e.enabled=!!n.autocapture,e.rageclick=n.rageclick,e.maskAllElementAttributes=n.mask_all_element_attributes,e.maskAllText=n.mask_all_text,e.disableCaptureUrlHashes=n.disable_capture_url_hashes,e.getCurrentUrl=n.get_current_url,e.remoteRequestsDisabled=this._instance.nl(),e.url_allowlist=i?.url_allowlist,e.url_ignorelist=i?.url_ignorelist,e.dom_event_allowlist=i?.dom_event_allowlist,e.element_allowlist=i?.element_allowlist,e.css_selector_allowlist=i?.css_selector_allowlist,e.css_selector_ignorelist=i?.css_selector_ignorelist,e.element_attribute_ignorelist=i?.element_attribute_ignorelist,e.capture_copied_text=i?.capture_copied_text}};const Lp=$n("[ExceptionAutocapture]"),zI=()=>{},DI=t=>{var e;if(pi(t))return(e=t.__posthog_layer__)!==null&&e!==void 0?e:t.__rrweb_layer__};function xm(t,e,n){try{if(!(e in t))return zI;const i={next:t[e]},r=n(function(...o){return i.next.apply(this,o)});return pi(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}}
17)),t[e]=r,()=>{if(t[e]===r)return void(t[e]=i.next);let o=t[e],l=DI(o);for(;l;){if(l.next===r)return void(l.next=i.next);o=l.next,l=DI(o)}}}catch{return zI}}const _7=$n("[TracingHeaders]"),Zc=$n("[Web Vitals]"),LI=9e5,UI=["CLS","FCP","INP","LCP"],b7=["INP","LCP"],w7=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],H1="disabled",FI="lazy_loading",Ta=$n("[SessionRecording]"),x7=$n("[Heatmaps]");function K1(t){return xt(t)&&"clientX"in t&&"clientY"in t&&Fn(t.clientX)&&Fn(t.clientY)}const v0=$n("[Product Tours]"),Z1=t=>{var e;return!t.config.disable_product_tours&&!!(!((e=t.persistence)===null||e===void 0)&&e.get_property(qC))},S7=["$set_once","$set"],Ko=$n("[SiteApps]"),HI="Error while initializing PostHog app with config id ",z6=(t,e)=>t?.then?t.then(e):e(t),Vd="SDK is not enabled or survey functionality is not yet loaded",KI="Disabled. Not loading surveys.";var k7=class{constructor(t,e){this.So=t,this.Th=e,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Ih=!1,this.Mh=[],this.Eh=null,this.Ph=null,this.Io=!1,this.Rh=new Set,this.onRemoteConfig=n=>{if(this.Io||this.Rr.disableSurveys)return;if(!n.ok)return Zt.warn("Remote config unavailable. Not loading surveys.");const i=n.config.surveys;if(it(i))return Zt.warn("Flags not loaded yet. Not loading surveys.");this.Ah=Or(i)?i:i.length>0,Zt.info(`flags response received, isSurveysEnabled: ${this.Ah}`),this.loadIfEnabled()}}setup(t){if(!this.Io)return this.Fh=t,z6(t.kv.initialize(),()=>{if(this.Fh!==t||this.Io)return;this.Fh=void 0,this.wo=t;const e=t.onRemoteConfig(this.onRemoteConfig);this.Io?e.dispose():(this.Po=e,this.loadIfEnabled())})}dispose(){var t,e,n,i;this.Io||(this.Io=!0,this.Fh=void 0,this.wo=void 0,(t=this.Po)===null||t===void 0||t.dispose(),this.Po=void 0,(e=this._surveyEventReceiver)===null||e===void 0||e.dispose(),this._surveyEventReceiver=null,(n=this._surveyManager)===null||n===void 0||(i=n.dispose)===null||i===void 0||i.call(n),this._surveyManager=null,this.Mh=[],this.Eh=null,this.Rh.forEach(r=>clearTimeout(r)),this.Rh.clear())}get Rr(){return this.So.get()}initialize(){this.loadIfEnabled()}reset(){var t,e;(t=this._surveyManager)===null||t===void 0||(e=t.clearInMemoryInProgressSurveyState)===null||e===void 0||e.call(t);try{var n;(n=this._surveyEventReceiver)===null||n===void 0||n.reset(),localStorage.removeItem("lastSeenSurveyDate");const i=[];for(let r=0;r<localStorage.length;r++){const o=localStorage.key(r);(o?.startsWith("seenSurvey_")||o?.startsWith("inProgressSurvey_"))&&i.push(o)}i.forEach(r=>localStorage.removeItem(r))}catch{}}loadIfEnabled(){if(this.Io||!this.wo)return;const t=this.Rr;if(this._surveyManager)return;if(this.Ih)return void Zt.info("Already initializing surveys, skipping...");if(t.disableSurveys)return void Zt.info(KI);if(t.cookielessMode&&this.So.isOptedOut())return void Zt.info("Not loading surveys in cookieless mode without consent.");const e=this.So.getExtensions();if(!e)return void Zt.error("PostHog Extensions not found.");if(le(this.Ah)&&!t.advancedEnableSurveys)return;const n=this.Ah||t.advancedEnableSurveys;this.Ih=!0;try{const i=e.generateSurveys;if(i)return this.Oh(i,n),void(this.Ih=!1);const r=e.loadExternalDependency;if(!r)return this.Dh(BC),void(this.Ih=!1);r(o=>{try{if(this.Io)return;const l=this.So.getExtensions();o||!l?.generateSurveys?this.Dh("Could not load surveys script",o):this.Oh(l.generateSurveys,n)}finally{this.Ih=!1}})}catch(i){throw this.Ih=!1,this.Dh("Error initializing surveys",i),i}}Oh(t,e){this.Io||(this._surveyManager=t(e),this._surveyEventReceiver=this.So.createEventReceiver(),Zt.info("Surveys loaded successfully"),this.Lh({isLoaded:!0}))}Dh(t,e){Zt.error(t,e),this.Lh({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Mh.push(t),this._surveyManager&&this.Lh({isLoaded:!0}),()=>{this.Mh=this.Mh.filter(e=>e!==t)}}getSurveys(t,e=!1){var n;const i=(n=this.wo)!==null&&n!==void 0?n:this.Th;if(!i||this.Io)return;if(this.Rr.disableSurveys)return Zt.info(KI),t([]);const r=i.kv.get(LT);if(r&&!e)return t(r,{isLoaded:!0}
17),void(this.Nh()&&this.getSurveys(()=>{},!0));if(this.Eh)return void this.Eh.then(({surveys:u,context:d})=>{this.Io||t(u,d)}).catch(u=>Zt.error("Error in survey callback",u));const o=this.qh("/api/surveys/",{method:"GET",query:{token:i.projectToken},sentAt:"query",timeoutMs:this.Rr.requestTimeoutMs}).then(u=>{try{return this.jh(i,u)}catch(d){return Zt.error("Error processing surveys response",d),this.jh(i,{statusCode:0,error:d})}},u=>this.jh(i,{statusCode:0,error:u}));this.Eh=o;const l=()=>{this.Eh===o&&(this.Eh=null)};o.then(u=>{l(),this.Io||t(u.surveys,u.context)},l).catch(u=>Zt.error("Error in survey callback",u))}qh(t,e){const n=this.wo;return n?n.sendRequest(t,e):new Promise(i=>i({statusCode:0,error:new Error(Vd)}))}jh(t,e){if(this.Io)return{surveys:[],context:{isLoaded:!1,error:Vd}};const n=e.statusCode;if(n!==200||!e.json){const l=`Surveys API could not be loaded, status: ${n}`;return n!==0?Zt.error(l):e.error||Zt.warn(l),this.Ph=Date.now(),{surveys:[],context:{isLoaded:!1,error:l}}}this.Ph=null;const i=e.json.surveys||[],r=i.filter(l=>(function(u){return!(!u.start_date||u.end_date)})(l)&&(A6(l)||(function(u){var d;return!!(!((d=u.conditions)===null||d===void 0||(d=d.actions)===null||d===void 0||(d=d.values)===null||d===void 0)&&d.length)})(l)));var o;return r.length>0&&((o=this._surveyEventReceiver)===null||o===void 0||o.register(r)),t.kv.set({[LT]:i,[wb]:Date.now()}),{surveys:i,context:{isLoaded:!0}}}Nh(){return this.Bh()&&!this.Eh&&!this.Hh()}Bh(){var t,e;const n=(t=(e=this.wo)!==null&&e!==void 0?e:this.Th)===null||t===void 0?void 0:t.kv.get(wb);return Fn(n)&&Date.now()-n>3e5}Hh(){return Fn(this.Ph)&&3e5>Date.now()-this.Ph}markSurveyAsSeen(t,e){var n;const i={id:t,current_iteration:(n=e?.iteration)!==null&&n!==void 0?n:null};N6(i);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}Lh(t){for(const e of this.Mh)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(n){Zt.error("Error in survey callback",n)}}getActiveMatchingSurveys(t,e=!1){if(!it(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Zt.warn("init was not called")}zh(t){let e=null;return this.getSurveys(n=>{var i;e=(i=n.find(r=>r.id===t))!==null&&i!==void 0?i:null}),e}Uh(t){if(it(this._surveyManager))return{eligible:!1,reason:Vd};const e=typeof t=="string"?this.zh(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}Wh(t){if(!this.So.isCapturing())return{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"};if(it(this._surveyManager))return{eligible:!1,reason:Vd};const e=typeof t=="string"?this.zh(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(it(this._surveyManager))return Zt.warn("init was not called"),{visible:!1,disabledReason:Vd};const e=this.Wh(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return it(this._surveyManager)?(Zt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Vd})):new Promise(n=>{this.getSurveys(i=>{var r;const o=(r=i.find(l=>l.id===t))!==null&&r!==void 0?r:null;if(o){const l=this.Wh(o);n({visible:l.eligible,disabledReason:l.reason})}else n({visible:!1,disabledReason:"Survey not found"})},e)})}renderSurvey(t,e,n){var i;if(!this.So.isCapturing())return;if(it(this._surveyManager))return void Zt.warn("init was not called");const r=typeof t=="string"?this.zh(t):t;if(!r?.id)return void Zt.warn("Survey not found");if(!n7.includes(r.type))return void Zt.warn(`Surveys of type ${r.type} cannot be rendered in the app`);const o=he?.querySelector(e);if(o){if(!((i=r.appearance)===null||i===void 0)&&i.surveyPopupDelaySeconds){Zt.info(`Rendering survey ${r.id} with delay of ${r.appearance.surveyPopupDelaySeconds} seconds`);const l=setTimeout(()=>{var u,d;this.Rh.delete(l),!this.Io&&this.So.isCapturing()&&(Zt.info(`Rendering survey ${r.id} with delay of ${(u=r.appearance)===null||u===void 0?void 0:u.surveyPopupDelaySeconds} seconds`),(d=this._surveyManager)===null||d===void 0||d.renderSurvey(r,o,n),Zt.info(`Survey ${r.id} rendered`))},1e3*r.appearance.surveyPopupDelaySeconds);return void this.Rh.add(l)}this._surveyManager.renderSurvey(r,o,n)}else Zt.warn("Survey element not found")}displaySurvey(t,e){var n;if(!this.So.isCapturing())return;if(it(this._surveyManager))return void Zt.warn("init was not called");const i=this.zh(t);if(!i)return void Zt.warn("Survey not found");let r=i;if(!((n=i.appearance)===null||n===void 0)&&n.surveyPopupDelaySeconds&&e.ignoreDelay&&(r=z(z({},i),{},{appearance:z(z({},i.appearance),{},{surveyPopupDelaySeconds:0})}
17)),e.displayType!==VT.Popover&&e.initialResponses&&Zt.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){const o=this.Uh(i);if(!o.eligible)return void Zt.warn("Survey is not eligible to be displayed: ",o.reason)}e.displayType!==VT.Inline?this._surveyManager.handlePopoverSurvey(r,e):this.renderSurvey(r,e.selector,e.properties)}cancelPendingSurvey(t){it(this._surveyManager)?Zt.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t,e;(t=this._surveyManager)===null||t===void 0||(e=t.handlePageUnload)===null||e===void 0||e.call(t)}};function Bd(t,e,n){if(it(t))return!1;switch(n){case"exact":return t===e;case"contains":{const i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(t)}case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}var E7=class{constructor(t){this._instance=t,this.Vh=new Set,this.Gh=new Set,this.Zh=new Cb,this.Qh=(e,n)=>this.Jh(e,n)&&this.Kh(e,n)&&this.Xh(e,n)&&this.Yh(e,n),this.Jh=(e,n)=>!n?.event||e?.event===n?.event}init(){var t,e;le((t=this._instance)===null||t===void 0?void 0:t._addCaptureHook)||(this.tc=(e=this._instance)===null||e===void 0?void 0:e._addCaptureHook((n,i)=>{this.on(n,i)}))}dispose(){var t;(t=this.tc)===null||t===void 0||t.call(this),this.tc=void 0,this.Zh=new Cb}register(t){var e,n;if(!le((e=this._instance)===null||e===void 0?void 0:e._addCaptureHook)&&(t.forEach(i=>{var r;this.Vh.add(i),(r=i.steps)===null||r===void 0||r.forEach(o=>{this.Gh.add(o?.event||"")})}),(n=this._instance)===null||n===void 0?void 0:n.autocapture)){const i=new Set;this.Vh.forEach(r=>{var o;(o=r.steps)===null||o===void 0||o.forEach(l=>{l?.selector&&i.add(l.selector)})}),this._instance.autocapture.setElementSelectors(i)}}replace(t){this.Vh.clear(),this.Gh.clear(),this.register(t)}on(t,e){e!=null&&t.length!=0&&(this.Gh.has(t)||this.Gh.has(e.event))&&this.Vh.forEach(n=>{this.ec(e,n)&&this.Zh.emit("actionCaptured",n.name)})}nc(t){this.onAction("actionCaptured",e=>t(e))}ec(t,e){if(e?.steps==null)return!1;for(const n of e.steps)if(this.Qh(t,n))return!0;return!1}onAction(t,e){return this.Zh.on(t,e)}Kh(t,e){if(e?.url){var n;const i=t==null||(n=t.properties)===null||n===void 0?void 0:n.$current_url;if(!i||typeof i!="string"||!Bd(i,e.url,e.url_matching||"contains"))return!1}return!0}Xh(t,e){return!!this.sc(t,e)&&!!this.rc(t,e)&&!!this.oc(t,e)}sc(t,e){var n;if(!e?.href)return!0;const i=this.ac(t);if(i.length>0)return i.some(o=>Bd(o.href,e.href,e.href_matching||"exact"));const r=(t==null||(n=t.properties)===null||n===void 0?void 0:n.$elements_chain)||"";return!!r&&Bd((function(o){const l=o.match(/(?::|")href="(.*?)"/);return l?l[1]:""})(r),e.href,e.href_matching||"exact")}rc(t,e){var n;if(!e?.text)return!0;const i=this.ac(t);if(i.length>0)return i.some(d=>Bd(d.text,e.text,e.text_matching||"exact")||Bd(d.$el_text,e.text,e.text_matching||"exact"));const r=(t==null||(n=t.properties)===null||n===void 0?void 0:n.$elements_chain)||"";return!!r&&(o=(function(d){const f=[],p=/(?::|")text="(.*?)"/g;let g;for(;!it(g=p.exec(d));)f.includes(g[1])||f.push(g[1]);return f})(r),l=e.text,u=e.text_matching||"exact",o.some(d=>Bd(d,l,u)));var o,l,u}oc(t,e){var n,i;if(!e?.selector)return!0;const r=t==null||(n=t.properties)===null||n===void 0?void 0:n.$element_selectors;if(r?.includes(e.selector))return!0;const o=(t==null||(i=t.properties)===null||i===void 0?void 0:i.$elements_chain)||"";if(e.selector_regex&&o)try{return new RegExp(e.selector_regex).test(o)}catch{return!1}return!1}ac(t){var e;return(t==null||(e=t.properties)===null||e===void 0?void 0:e.$elements)==null?[]:t?.properties.$elements}Yh(t,e){return!e?.properties||e.properties.length===0||P6(e.properties.reduce((n,i)=>{const r=Je(i.value)?i.value.map(String):i.value!=null?[String(i.value)]:[];return n[i.key]={values:r,operator:i.operator||"exact"},n},{}),t?.properties)}},T7=class{constructor(t){var e,n;this.lc=[],this._instance=t,this.uc=new Map,this.hc=new Map,this.cc=new Map,this.dc=(e=this._instance)===null||e===void 0||(n=e.onSessionId)===null||n===void 0?void 0:n.call(e,i=>this.vc(i))}fc(t){return!1}gc(){return null}mc(t){}yc(){}bc(t,e){return!!t&&P6(t.propertyFilters,e?.properties)}_c(t,e){const n=new Map;return t.forEach(i=>
17{var r;(r=i.conditions)===null||r===void 0||(r=r[e])===null||r===void 0||(r=r.values)===null||r===void 0||r.forEach(o=>{if(o?.name){const l=n.get(o.name)||[];l.push(i.id),n.set(o.name,l)}})}),n}wc(t,e,n){const i=(n===Mp.Activation?this.uc:this.hc).get(t);let r=[];return this.kc(o=>{r=o.filter(l=>i?.includes(l.id))}),r.filter(o=>{var l;const u=(l=o.conditions)===null||l===void 0||(l=l[n])===null||l===void 0||(l=l.values)===null||l===void 0?void 0:l.find(d=>d.name===t);return this.bc(u,e)})}register(t){this.Sc(t,!1)}replace(t){this.Sc(t,!0)}Sc(t,e){var n;le((n=this._instance)===null||n===void 0?void 0:n._addCaptureHook)||(this.xc(t,e),this.Cc(t,e))}Cc(t,e){const n=t.filter(o=>{var l;return(l=o.conditions)===null||l===void 0||(l=l.actions)===null||l===void 0||(l=l.values)===null||l===void 0?void 0:l.length});var i;if(e&&this.cc.clear(),n.length===0)return void(e&&((i=this.$c)===null||i===void 0||i.replace([])));this.$c||(this.$c=new E7(this._instance),this.$c.init(),this.$c.nc(o=>this.onAction(o)));const r=[];n.forEach(o=>{var l;(l=o.conditions)===null||l===void 0||(l=l.actions)===null||l===void 0||l.values.forEach(u=>{if(r.push(u),u.name){var d;const f=(d=this.cc.get(u.name))!==null&&d!==void 0?d:[];f.includes(o.id)||f.push(o.id),this.cc.set(u.name,f)}})}),e?this.$c.replace(r):this.$c.register(r)}Tc(t,e){e.forEach((n,i)=>{var r;const o=(r=t.get(i))!==null&&r!==void 0?r:[];n.forEach(l=>{o.includes(l)||o.push(l)}),t.set(i,o)})}xc(t,e){var n,i;const r=t.filter(d=>{var f,p;return((f=d.conditions)===null||f===void 0?void 0:f.events)&&((p=d.conditions)===null||p===void 0||(p=p.events)===null||p===void 0||(p=p.values)===null||p===void 0?void 0:p.length)>0}),o=t.filter(d=>{var f,p;return((f=d.conditions)===null||f===void 0?void 0:f.cancelEvents)&&((p=d.conditions)===null||p===void 0||(p=p.cancelEvents)===null||p===void 0||(p=p.values)===null||p===void 0?void 0:p.length)>0}),l=this._c(t,Mp.Activation),u=this._c(t,Mp.Cancellation);e?(this.uc=l,this.hc=u):(this.Tc(this.uc,l),this.Tc(this.hc,u)),(r.length!==0||o.length!==0)&&((n=this.tc)!==null&&n!==void 0||(this.tc=(i=this._instance)===null||i===void 0?void 0:i._addCaptureHook((d,f)=>{this.onEvent(d,f)})))}onEvent(t,e){var n,i;const r=this.Ic(),o=(e==null||(n=e.properties)===null||n===void 0?void 0:n.$survey_id)||(e==null||(i=e.properties)===null||i===void 0?void 0:i.$product_tour_id);if(o&&this.getActivatedIds().includes(o)){const u=this.Mc(t,o);if(u==="consume")return r.info("event consumed activated item, removing it",{event:t,itemId:o}),void this.Ec([o]);if(u==="persist")return r.info("shown item promoted to persisted activation",{event:t,itemId:o}),this.Pc(o),void this.Rc([o])}if(this.hc.has(t)){const u=this.wc(t,e,Mp.Cancellation);u.length>0&&(r.info("cancel event matched, cancelling items",{event:t,itemsToCancel:u.map(d=>d.id)}),this.Ec(u.map(d=>d.id)),u.forEach(d=>this.Ac(d.id)))}if(!this.uc.has(t))return;r.info("event name matched",{event:t,eventPayload:e,items:this.uc.get(t)});const l=this.wc(t,e,Mp.Activation);this.Fc(l.map(u=>u.id))}onAction(t){this.cc.has(t)&&this.Fc(this.cc.get(t)||[])}Fc(t){var e,n;if(t.length===0)return;const i=!!(!((e=this._instance)===null||e===void 0||(n=e.get_session_id)===null||n===void 0)&&n.call(e)),r=[];for(const o of t)i&&this.fc(o)?this.Pc(o)&&this.Oc(o):r.push(o);r.length>0&&(this.lc=[...new Set([...this.lc,...r])]),this.Ic().info("updating activated items",{activatedItems:this.getActivatedIds()})}Pc(t){this.lc=this.lc.filter(n=>n!==t);const e=this.Dc();return!e.includes(t)&&(this.Lc([...e,t]),this.Nc(),!0)}Ec(t){const e=new Set(t);this.lc=this.lc.filter(r=>!e.has(r));const n=this.qc(),i=n.filter(r=>!e.has(r));i.length!==n.length&&(this.Lc(i),i.length===0&&this.jc()),this.Rc(t)}Bc(){var t;const e=this.gc();if(!e)return{};const n=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.props[e];return n&&typeof n=="object"?n:{}}Oc(t){if(!this.gc())return;const e=this.Bc();this.mc(z(z({},e),{},{[t]:Date.now()}))}Rc(t){if(!this.gc())return;const e=this.Bc(),n={};let i=!1;for(const[r,o]of Object.entries(e))t.includes(r)?i=!0:n[r]=o;i&&(zr(n)?this.yc():this.mc(n))}Hc(){this.gc()&&this.yc()}getActivationTimestamp(t){if(!this.Dc().includes(t))return;const e=this.Bc()[t];return Fn(e)?e:void 0}qc(){var t;const e=this.zc();return((t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.props[e])||[]}Dc(){var t,e,n;const i=this.qc();if(i.length===0)return[];const r=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.props[this.Uc()],o=(e=this._instance)===null||e===void 0||(n=e.get_session_id)===null||n===void 0?void 0:n.call(e);return o&&r===o?i:[]}Nc(){var t,e;const n=(t=this._instance)===null||t===void 0||(e=t.get_session_id)===null||e===void 0?void 0:e.call(t);n&&this.Wc(n)}jc(){this.Vc()}vc(t){var e;const n=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.props[this.Uc()];if(n&&n!==t){const i=this.qc(),r=this.Bc();i.length>0&&(this.Lc([]),i.filter(o=>
17Fn(r[o])).forEach(o=>this.Ac(o))),this.jc(),this.Hc()}}getActivatedIds(){return[...new Set([...this.Dc(),...this.lc])].filter(t=>!this.Gc(t))}dispose(){var t,e,n;(t=this.dc)===null||t===void 0||t.call(this),this.dc=void 0,(e=this.tc)===null||e===void 0||e.call(this),this.tc=void 0,(n=this.$c)===null||n===void 0||n.dispose(),this.$c=void 0}reset(){this.lc=[],this.qc().length>0&&this.Lc([]),this.jc(),this.Hc()}getEventToItemsMap(){return this.uc}Zc(){return this.$c}},C7=class extends T7{constructor(t){super(t)}zc(){return $U}Uc(){return AU}gc(){return jU}mc(t){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.register({$surveys_activated_timestamps:t})}yc(){var t;(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||t.unregister("$surveys_activated_timestamps")}fc(t){var e;let n;this.kc(r=>{n=r.find(o=>o.id===t)});const i=n==null||(e=n.appearance)===null||e===void 0?void 0:e.surveyPopupDelaySeconds;return Fn(i)&&i>0}Qc(){return za.SHOWN}kc(t){var e;(e=this._instance)===null||e===void 0||e.getSurveys(t)}Ac(t){var e;(e=this._instance)===null||e===void 0||e.cancelPendingSurvey(t)}Ic(){return Zt}Lc(t){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.register({$surveys_activated:t})}Wc(t){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.register({$surveys_activated_session:t})}Vc(){var t;(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||t.unregister("$surveys_activated_session")}Gc(){return!1}Mc(t,e){let n;return this.kc(i=>{n=i.find(r=>r.id===e)}),!n||(function(i){var r;return A6(i)&&!!(!((r=i.conditions)===null||r===void 0||(r=r.events)===null||r===void 0)&&r.repeatedActivation)||i.schedule==="always"})(n)?t===za.SHOWN?"consume":"ignore":t===za.SHOWN?"persist":t===za.DISMISSED||t===za.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},O7=class{constructor(t){this._instance=t}initialize(){}get(t){if(typeof t=="string")return this._instance.get_property(t);const e={};for(const n of t){const i=this._instance.get_property(n);le(i)||(e[n]=i)}return e}set(t,e){this._instance.register(typeof t=="string"?{[t]:e}:t)}remove(t){typeof t!="string"?t.forEach(e=>this._instance.unregister(e)):this._instance.unregister(t)}},R7=class{constructor(t){this._instance=t}get(){const t=this._instance.config;return{disableSurveys:t.disable_surveys,cookielessMode:!!t.cookieless_mode,advancedEnableSurveys:t.advanced_enable_surveys,requestTimeoutMs:t.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}isCapturing(){return this._instance.is_capturing()}getExtensions(){const t=qe?.__PosthogExtensions__;if(!t)return;const{generateSurveys:e,loadExternalDependency:n}=t;return{generateSurveys:e?i=>e(this._instance,i):void 0,loadExternalDependency:n?i=>n(this._instance,"surveys",i):void 0}}createEventReceiver(){return new C7(this._instance)}};const $7=G?.location?kb(G.location.hash,"__posthog")||kb(location.hash,"state"):null,ZI="_postHogToolbarParams",WI=$n("[Toolbar]"),qI=$n("[FeatureFlags]");var A7=class{constructor(t,e=!1){this.Jc=!1,this.update(t,e)}update(t,e){this.Kc=((n,i)=>{var r,o,l,u,d,f,p,g;return{bootstrap:{featureFlags:(r=(o=n.bootstrap)===null||o===void 0?void 0:o.featureFlags)!==null&&r!==void 0?r:void 0,featureFlagPayloads:(l=(u=n.bootstrap)===null||u===void 0?void 0:u.featureFlagPayloads)!==null&&l!==void 0?l:void 0},remoteRequestsDisabled:i,featureFlagsDisabled:!!n.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!n.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!n.advanced_feature_flags_dedup_per_session,cacheTtlMs:n.feature_flag_cache_ttl_ms,refreshIntervalMs:(d=n.remote_config_refresh_interval_ms)!==null&&d!==void 0?d:3e5,idleRefreshBackoff:le(n.remote_config_refresh_interval_ms),requestTimeoutMs:n.feature_flag_request_timeout_ms,requestMaxRetries:Math.max(0,(f=n.feature_flag_request_max_retries)!==null&&f!==void 0?f:1),compression:n.disable_compression?void 0:"best-available",evaluationContexts:(p=(g=n.evaluation_contexts)!==null&&g!==void 0?g:n.evaluation_environments)!==null&&p!==void 0?p:[],flagKeys:Je(n.flag_keys)?n.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.Jc||(qI.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Jc=!0),le(t.flag_keys)||Je(t.flag_keys)||qI.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.Kc}};const VI=$n("[FeatureFlags]"),Wc=$n("[FeatureFlags]",{debugEnabled:!0}),W1=`" failed. Feature flags didn't load in time.`,j7=[502,504],BI=["click","keydown","wheel","touchstart","pointerdown"],GI="connection_error",JI=t=>{const e={};for(let n=0;t.length>n;n++)e[t[n]]=!0;return e},XI=t=>{const e={};for(const[n,i]of k_(t||{}))i&&(e[n]=i);return e},YI=t=>df(t)&&(t.name==="RangeError"&&t.message.indexOf("Maximum call stack size exceeded")===0||t.name==="InternalError"&&t.message==="too much recursion"),so=$n("[Error tracking]"),QT="webkit-masked-url:",P7=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],N7=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",QT],M7=["__firefox__","__gCrWeb"],QI="Refusing to render web experiment since the viewer is a likely bot",I7={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>Ob(e,t),not_regex:(t,e)=>!Ob(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t},$s=$n("[Conversations]"),qc="Conversations not available yet.";function ez(t,e){var n,i,r,o,l,u,d;const f=(n=t?.flushIntervalMs)!==null&&n!==void 0?n:3e3,p=(i=t?.maxBufferSize)!==null&&i!==void 0?i:100,g=e?.consoleCapture?void 0:(r=t?.maxLogsPerInterval)!==null&&r!==void 0?r:1e3,v=le(g)?Math.max(p,2048):Math.max(p,g),y=z(z({},(function(){let b="",x="";try{const S=mi?.userAgent;S&&([b,x]=tU(S))}catch{}return(function(S,k){const T=(function(C){if(C)return{}.hasOwnProperty.call(BM,C)?BM[C]:C})(S);return z(z({},T?{"os.name":T}:{}),k?{"os.version":k}:{})})(b,x)})()),t?.resourceAttributes);return{serviceName:(o=(l=y?.["service.name"])!==null&&l!==void 0?l:t?.serviceName)!==null&&o!==void 0?o:e?.serviceNameDefault,serviceVersion:(u=y?.["service.version"])!==null&&u!==void 0?u:t?.serviceVersion,environment:(d=y?.["deployment.environment"])!==null&&d!==void 0?d:t?.environment,resourceAttributes:y,beforeSend:t?.beforeSend,flushIntervalMs:f,maxBufferSize:p,maxQueueSize:v,maxBatchRecordsPerPost:100,rateCapWindowMs:f,maxLogsPerInterval:g,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}
17const z7=["debug","log","warn","error","info"],D7=t=>{for(;t?.__rrweb_original__;)t=t.__rrweb_original__;return t},tz="console",D6="__posthogHandledLogsRequestError",q1=(t,e)=>{const n=t instanceof Error?t:new Error(e);return n[D6]=!0,n},nz=t=>!!t&&typeof t=="object"&&t[D6]===!0,Rb=$n("[NetworkMetrics]"),iO=()=>{var t;return!(G==null||(t=G.performance)===null||t===void 0)&&t.now?G.performance.now():Date.now()},L7={"http:":80,"https:":443},U7=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),L6=(t,e)=>{var n;const i=String(e);return{method:String(t).toUpperCase(),url:((n=Wa(i))===null||n===void 0?void 0:n.href)||i}},e2=(t,e,n,i,r,o,l=!1)=>{try{var u,d;const f=r();if(!f)return;const p=n||void 0,g=iO()-i,v=Wa(e.url);if(v&&v.protocol!=="http:"&&v.protocol!=="https:")return;const y={url:v?.href||e.url,method:e.method},b=pi(f.name)?f.name(y):mt(f.name)?f.name:"http.client.request.duration";if(!b)return;const x=l&&!p?void 0:((k,T)=>k?400>k?void 0:String(k):T?.name||"_OTHER")(p,o),S=z(z(z(z(z({},(k=>{const T=U7.has(k)?k:"_OTHER";return z({"http.request.method":T},T==="_OTHER"&&k!==T?{"http.request.method_original":k}:{})})(y.method)),v?(k=>{return{"server.address":k.hostname.startsWith("[")&&k.hostname.endsWith("]")?k.hostname.slice(1,-1):k.hostname,"server.port":Number(k.port)||L7[k.protocol],"url.scheme":k.protocol.slice(0,-1),"url.template":(T=k.pathname,T.split("/").map(C=>(A=>/^\d+$/.test(A)||A.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(A))(C)?":id":C).join("/"))};var T})(v):{}),p?{"http.response.status_code":p}:{}),x?{"error.type":x}:{}),(u=f.attributes)===null||u===void 0?void 0:u.call(f,y,{status:p,durationMs:g}));(d=t.metrics)===null||d===void 0||d.histogram(b,g,{unit:"ms",attributes:S})}catch(f){Rb.error("Failed to record network metric",f)}},U6=()=>{},F7=(t,e)=>pi(G?.fetch)?xm(G,"fetch",n=>function(...i){const r=iO(),o=n.apply(this,i);if(!e())return o;try{var l,u,d;const[f,p]=i,g=L6((l=(u=p?.method)!==null&&u!==void 0?u:f?.method)!==null&&l!==void 0?l:"GET",(d=f?.url)!==null&&d!==void 0?d:f);return o.then(v=>(e2(t,g,v?.status,r,e,void 0,!0),v),v=>{throw e2(t,g,void 0,r,e,v),v})}catch(f){return Rb.error("Failed to observe fetch",f),o}}):U6,H7=(t,e)=>{var n;const i=G==null||(n=G.XMLHttpRequest)===null||n===void 0?void 0:n.prototype;if(!i)return U6;const r=new WeakMap,o=xm(i,"open",u=>function(...d){try{y6.has(this)||r.set(this,L6(d[0],d[1]))}catch(f){Rb.error("Failed to observe XHR open",f)}return u.apply(this,d)}),l=xm(i,"send",u=>function(...d){let f;try{const p=r.get(this);if(p&&e()){const g=iO();f=()=>{this.removeEventListener("loadend",f),e2(t,p,this.status,g,e)},Ht(this,"loadend",f)}}catch(p){Rb.error("Failed to observe XHR send",p)}try{return u.apply(this,d)}catch(p){throw f&&this.removeEventListener("loadend",f),p}});return()=>{o(),l()}},Cw={featureFlags:class{constructor(t){this.name="featureFlags",this.Xc=!1,this.featureFlagEventHandlers=[],this.$=VI,this.Yc={},this.td={},this.ed=[],this.nd=!1,this.sd=!1,this.rd=0,this.od=!1,this.ad=!1,this.ld=!1,this.ud=!1,this.hd=0,this.dd=!1,this.an=()=>{const e=this.vd();this.hd=0,e&&this.reloadFeatureFlags()},this.fd=()=>{var e,n;const i=this.pd,r=(e=this.gd)!==null&&e!==void 0?e:i;le(i)||le(r)||this.Rr.remoteRequestsDisabled||!he||he.visibilityState==="hidden"||Date.now()-((n=this.md)!==null&&n!==void 0?n:0)<r||(this.gd=this.dd||!this.Rr.idleRefreshBackoff?i:Math.min(2*r,36e5),this.dd=!1,this.reloadFeatureFlags(),this.yd())},this.bd=()=>{this.dd&&this.gd===this.pd||this._d()},this.ln=()=>{he?.visibilityState==="visible"&&this._d()},"get"in t?this.So=t:(this._instance=t,this.wd=new A7(t.config,t.nl()),this.So=this.wd)}updateConfig(t,e){var n;(n=this.wd)===null||n===void 0||n.update(t,e),this.wo&&this.kd()}setup(t){return this.Fh=t,this.$=t.logger.createLogger("[FeatureFlags]"),z6(t.kv.initialize(),()=>{this.Fh===t&&(this.Fh=void 0,this.wo=t,this.Sd(t))})}Sd(t){var e;if(this.wo===t)return G&&Ht(G,"online",this.an),this.kd(),this.xd=t.registerDynamicEventProperties(()=>this.Cd()?this.Yc:this.td),this.$d=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.onCrossTabFeatureFlagChange(()=>{this.Td(),this.Id(),this.Md()}),this.Id(),this.initialize()}_d(){this.dd=!0,this.gd=this.pd,this.fd()}kd(){const t=this.Rr.refreshIntervalMs,e=!this.Rr.remoteRequestsDisabled&&he&&!le(t)&&t>0?t:void 0;this.Rr.idleRefreshBackoff||(this.gd=e),e!==this.pd&&(this.Ed(),le(e)||(this.pd=e,this.gd=e,this.yd(),he?.addEventListener&&(Ht(he,vm,this.ln),bh(BI,n=>{Ht(he,n,this.bd,{capture:!0})}
17))))}yd(){le(this.pd)||(le(this.Pd)||clearInterval(this.Pd),this.md=Date.now(),this.Pd=setInterval(this.fd,this.pd))}Ed(){var t;le(this.Pd)||(clearInterval(this.Pd),this.Pd=void 0,he==null||(t=he.removeEventListener)===null||t===void 0||t.call(he,"visibilitychange",this.ln),bh(BI,e=>{var n;he==null||(n=he.removeEventListener)===null||n===void 0||n.call(he,e,this.bd,{capture:!0})})),this.pd=void 0,this.gd=void 0,this.dd=!1,this.md=void 0}destroy(){this.Rd()}dispose(){this.Rd()}Rd(){var t,e;this.Ed(),this.rd++,this.ad=!1,this.Fh=void 0,this.wo&&(this.Ad(),(t=this.xd)===null||t===void 0||t.dispose(),this.xd=void 0,(e=this.$d)===null||e===void 0||e.call(this),this.$d=void 0,this.ed=[],G?.removeEventListener("online",this.an),this.wo=void 0)}get Rr(){return this.So.get()}Fd(t){var e;return this.Od&&t in this.Od?this.Od[t]:(e=this.wo)===null||e===void 0?void 0:e.kv.get(t)}Td(){return!!this.Od&&(this.Od=void 0,!0)}Dd(){var t;return!le((t=this.wo)===null||t===void 0?void 0:t.kv.get("$enabled_feature_flags"))&&this.Td()}At(t){this.Ld(()=>{var e;return(e=this.wo)===null||e===void 0?void 0:e.kv.set(t)})}Nd(t,e,n){var i;if(!(!((i=this._instance)===null||i===void 0)&&i.persistence)||!t.$enabled_feature_flags)return;const r=this.Fd("$enabled_feature_flags")||{},o=t.$enabled_feature_flags||{},l=e.flags||e.featureFlags,u=e.flags?Object.entries(e.flags).filter(([,k])=>!k?.failed).map(([k])=>k):[],d=!!e.errorsWhileComputingFlags&&!!e.flags,f=d?u:n&&!Je(l)?Object.keys(l||{}):Array.from(new Set([...Object.keys(r),...Object.keys(o)])),p=this.Fd("$feature_flag_payloads")||{},g=t.$feature_flag_payloads||{},v=d||n?f:Array.from(new Set([...Object.keys(p),...Object.keys(g)])),y=!d&&!n,b=!!y||f,x=!!y||v,S={[Ma]:b,[co]:b,[Yl]:x};t.$feature_flag_details&&(S[ku]=b);for(const k of[Eu,rc,Ug])le(t[k])||(S[k]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(S)}Lt(t){this.Ld(()=>{var e;return(e=this.wo)===null||e===void 0?void 0:e.kv.remove(t)})}Ld(t){try{t()}catch(e){this.$.error("Failed to update feature flag persistence",e)}}Id(){const t={};for(const i of[Ma,Yl,Eu,Wo]){const r=this.Fd(i);le(r)||(t[i]=r)}this.Yc=t;const e=z({},t),n=this.Fd(co);if(n)for(const[i,r]of Object.entries(n))e[`$feature/${i}`]=r;this.td=e}Cd(){const t=this.Rr.cacheTtlMs;if(!t||0>=t)return!1;const e=this.Fd(rc);return typeof e!="number"||Date.now()-e>t}qd(){return!!this.Cd()&&(this.ud||this.sd||(this.ud=!0,this.$.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}jd(){const t=this.Rr.evaluationContexts;return t?.length?t.filter(e=>{const n=e&&typeof e=="string"&&e.trim().length>0;return n||this.$.error("Invalid evaluation context found:",e,"Expected non-empty string"),n}):[]}Bd(){const t=this.Rr.flagKeys;if(!le(t))return t.filter(e=>{const n=e&&typeof e=="string"&&e.trim().length>0;return n||this.$.error("Invalid flag key found:",e,"Expected non-empty string"),n})}initialize(){var t,e;const n=this.Rr,i=(t=(e=n.bootstrap)===null||e===void 0?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(i).length){var r,o;const l=(r=(o=n.bootstrap)===null||o===void 0?void 0:o.featureFlagPayloads)!==null&&r!==void 0?r:{},u=Object.keys(i).filter(f=>!le(i[f])).reduce((f,p)=>(f[p]=i[p],f),{}),d=Object.keys(l).filter(f=>u[f]).reduce((f,p)=>(f[p]=l[p],f),{});return this.Hd({featureFlags:u,featureFlagPayloads:d},void 0,{persist:!1})}}updateFlags(t,e,n){var i,r;const o=n?.merge&&(i=this.Fd("$enabled_feature_flags"))!==null&&i!==void 0?i:{},l=n?.merge&&(r=this.Fd("$feature_flag_payloads"))!==null&&r!==void 0?r:{},u=z(z({},o),t),d=z(z({},l),e),f={};for(const[p,g]of Object.entries(u))f[p]={key:p,enabled:KM(g),variant:ZM(g),reason:void 0,metadata:le(d?.[p])?void 0:{id:0,version:void 0,description:void 0,payload:d[p]}};this.Hd({flags:f})}get hasLoadedFlags(){return this.nd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){const t=this.Fd(ku),e=this.Fd(Wo),n=this.Fd(nu);if(!n&&!e)return t||{};const i=pn({},t||{}),r=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(const u of r){var o;const d=i[u],f=e?.[u],p=le(f)?(o=d?.enabled)!==null&&o!==void 0&&o:!!f,g=le(f)?d?.variant:typeof f=="string"?f:void 0,v=n?.[u],y=z(z({},d),{},{enabled:p,variant:p?g??d?.variant:void 0});var l;p!==d?.enabled&&(y.original_enabled=d?.enabled),g!==d?.variant&&(y.original_variant=d?.variant),v&&(y.metadata=z(z({},d?.metadata),{},{payload:v,original_payload:d==null||(l=d.metadata)===null||l===void 0?void 0:l.payload})),i[u]=y}return this.Xc||(this.$.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:i}
17),this.Xc=!0),i}getAllFeatureFlags(){const t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map(n=>{const i=t[n];return{key:n,enabled:KM(i),variant:ZM(i),payload:HM(e[n])}})}getFlagVariants(){const t=this.Fd(co),e=this.Fd(Wo);if(!e)return t||{};const n=pn({},t||{}),i=Object.keys(e);for(let r=0;i.length>r;r++)n[i[r]]=e[i[r]];return this.Xc||(this.$.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.Xc=!0),n}getFlagPayloads(){const t=this.Fd(Yl),e=this.Fd(nu);if(!e)return t||{};const n=pn({},t||{}),i=Object.keys(e);for(let r=0;i.length>r;r++)n[i[r]]=e[i[r]];return this.Xc||(this.$.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.Xc=!0),n}reloadFeatureFlags(){this.od||this.Rr.featureFlagsDisabled||this.vd()||(this.sd&&(this.ad=!0),this.zd||(this.ed.slice().forEach(t=>{try{t()}catch(e){this.$.error("Error while running feature flags reloading callback",e)}}),this.zd=setTimeout(()=>{this.Ud()},5)))}Ad(){clearTimeout(this.zd),this.zd=void 0}onReloading(t){return this.ed.push(t),()=>{this.ed=this.ed.filter(e=>e!==t)}}ensureFlagsLoaded(){this.nd||this.sd||this.zd||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.od=t}resetFlagCallReported(){this.Lt(tc)}Ud(t){this.Ad();const e=this.wo;if(!e||this.Rr.remoteRequestsDisabled||this.vd())return;if(this.sd)return void(this.ad=!0);const n={token:e.projectToken,distinct_id:e.distinctId,groups:e.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:z(z(z({},e.initialPersonProperties),this.Fd("$stored_person_properties")||{}),{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Fd(ec),timezone:u6()};le(e.deviceId)||(n.$device_id=e.deviceId),(t?.disableFlags||this.Rr.featureFlagsDisabled)&&(n.disable_flags=!0);const i=this.jd();i.length&&(n.evaluation_contexts=i);const r=this.Bd();le(r)||(n.flag_keys=r);const o=this.Rr.onlyEvaluateSurveyFeatureFlags,l="/flags/?v=2"+(o?"&only_evaluate_survey_feature_flags=true":""),u=this.rd;this.sd=!0;const d=()=>{this.ad&&(this.ad=!1,this.Ud())},f=b=>{var x,S;const k=(x=b.json)!==null&&x!==void 0?x:{},T=b.statusCode!==200;if(this.sd=!1,u!==this.rd)return void d();if(this.Wd(b.statusCode),T||this.ad||(this.$anon_distinct_id=void 0),n.disable_flags&&!this.ad)return;this.ld=!T;const C=[];b.error?C.push(b.error instanceof Error&&b.error.name==="AbortError"?"timeout":b.error instanceof Error?GI:"unknown_error"):b.statusCode!==200&&C.push(`api_error_${b.statusCode}`),k.errorsWhileComputingFlags&&C.push("errors_while_computing_flags");const A=!!(!((S=k.quotaLimited)===null||S===void 0)&&S.includes("feature_flags"));A&&C.push("quota_limited"),this.At({[mm]:C}),A?this.$.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset.  Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):n.disable_flags||this.Hd(k,T,{partialResponse:o}),d()},p=b=>{this.sd=!1,u===this.rd&&(this.At({[mm]:[GI]}),this.$.error("Feature flag request failed",b),this.Dd()&&this.Md(!0)),d()};let g=this.Rr.requestMaxRetries;const v=()=>g>0&&u===this.rd,y=()=>{if(u!==this.rd||!this.wo||this.Rr.remoteRequestsDisabled)return this.sd=!1,void d();try{e.sendRequest(l,{target:"flags",method:"POST",body:n,compression:this.Rr.compression,sentAt:"body",timeoutMs:this.Rr.requestTimeoutMs}).then(b=>{if((x=>j7.includes(x.statusCode)||(S=>S.statusCode===0&&S.error instanceof Error&&S.error.name==="AbortError")(x))(b)&&v())return g--,void setTimeout(y,500);f(b)}).catch(p)}catch(b){p(b)}};y()}vd(){return t6(this.hd,3)}Wd(t){this.hd=n6(t,this.hd,3,()=>this.$.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(t,e={}){var n;if(e.fresh&&!this.ld)return;if(!(this.nd||this.getFlags()&&this.getFlags().length>0))return void this.$.warn('getFeatureFlag for key "'+t+W1);if(this.qd())return;const i=this.getFeatureFlagResult(t,e);return(n=i?.variant)!==null&&n!==void 0?n:i?.enabled}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){const e=this.getFeatureFlagResult(t,{send_event:!1});return e?.payload}getFeatureFlagResult(t,e={}){if(e.fresh&&!this.ld)return;if(!(this.nd||this.getFlags()&&this.getFlags().length>0))return void this.$.warn('getFeatureFlagResult for key "'+t+W1);if(this.qd())return;const n=this.getFlagVariants(),i=t in n,r=n[t],o=this.getFlagPayloads()[t],l=String(r),u=this.Fd("$feature_flag_request_id")||void 0,d=this.Fd("$feature_flag_evaluated_at")||void 0;let f,p=this.Fd("$flag_call_reported")||{};if(this.Rr.deduplicateCallsPerSession){var g;const L=(g=this.wo)===null||g===void 0?void 0:g.session.sessionId,B=this.Fd(pg);L&&L!==B&&(p={},f=L)}if(e.send_event||!("send_event"in e))if(t in p&&p[t].includes(l))f&&this.At({[tc]:p,[pg]:f});
17else{var v,y,b,x,S,k,T,C,A,$,N,j;Je(p[t])?p[t].push(l):p[t]=[l],this.At(z({[tc]:p},f?{[pg]:f}:{}));const L=this.getFeatureFlagDetails(t),B=[...(v=this.Fd("$feature_flag_errors"))!==null&&v!==void 0?v:[]];le(r)&&B.push("flag_missing");const V={$feature_flag:t,$feature_flag_response:r,$feature_flag_payload:o??null,$feature_flag_request_id:u,$feature_flag_evaluated_at:d,$feature_flag_bootstrapped_response:(y=(b=this.Rr.bootstrap)===null||b===void 0||(b=b.featureFlags)===null||b===void 0?void 0:b[t])!==null&&y!==void 0?y:null,$feature_flag_bootstrapped_payload:(x=(S=this.Rr.bootstrap)===null||S===void 0||(S=S.featureFlagPayloads)===null||S===void 0?void 0:S[t])!==null&&x!==void 0?x:null,$used_bootstrap_value:!this.ld};le(L==null||(k=L.metadata)===null||k===void 0?void 0:k.has_experiment)||(V.$feature_flag_has_experiment=L.metadata.has_experiment),le(L==null||(T=L.metadata)===null||T===void 0?void 0:T.version)||(V.$feature_flag_version=L.metadata.version);const ee=(C=L==null||(A=L.reason)===null||A===void 0?void 0:A.description)!==null&&C!==void 0?C:L==null||($=L.reason)===null||$===void 0?void 0:$.code;var O;ee&&(V.$feature_flag_reason=ee),!(L==null||(N=L.metadata)===null||N===void 0)&&N.id&&(V.$feature_flag_id=L.metadata.id),le(L?.original_variant)&&le(L?.original_enabled)||(V.$feature_flag_original_response=le(L.original_variant)?L.original_enabled:L.original_variant),!(L==null||(j=L.metadata)===null||j===void 0)&&j.original_payload&&(V.$feature_flag_original_payload=L==null||(O=L.metadata)===null||O===void 0?void 0:O.original_payload),B.length&&(V.$feature_flag_error=B.join(",")),this.Vd(V)}else f&&this.At({[tc]:p,[pg]:f});return i?{key:t,enabled:!!r,variant:typeof r=="string"?r:void 0,payload:HM(o)}:void 0}Vd(t){try{var e;(e=this.wo)===null||e===void 0||e.capture("$feature_flag_called",t)}catch(n){this.$.error("Failed to capture feature flag call",n)}}getRemoteConfigPayload(t,e){this.Gd(t,e)}Gd(t,e){var n=this;return _n(function*(){const i=n.wo;if(!i)return;const r={distinct_id:i.distinctId,token:i.projectToken,person_properties:{$lib:i.library.name,$lib_version:i.library.version}},o=n.jd();o.length&&(r.evaluation_contexts=o);const l=n.Bd();let u;le(l)||(r.flag_keys=l);try{var d;const f=(d=(yield i.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:r,compression:n.Rr.compression,sentAt:"body",timeoutMs:n.Rr.requestTimeoutMs})).json)===null||d===void 0?void 0:d.featureFlagPayloads;u=f?.[t]||void 0}catch(f){return void n.$.error("Remote config feature flag request failed",f)}try{e(u)}catch(f){n.$.error("Remote config feature flag callback failed",f)}})()}isFeatureEnabled(t,e={}){if(e.fresh&&!this.ld)return e.defaultValue;if(!(this.nd||this.getFlags()&&this.getFlags().length>0))return this.$.warn('isFeatureEnabled for key "'+t+W1),e.defaultValue;const n=this.getFeatureFlag(t,e);return le(n)?e.defaultValue:!!n}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(e=>e!==t)}receivedFeatureFlags(t,e,n){this.Hd(t,e,n)}Hd(t,e,n){if(!this.wo)return;this.nd=!0;const i=((r,o={},l={},u={},d,f=VI)=>{const p=((C,A)=>{const $=C.flags;if($){const N=Object.fromEntries(Object.keys($).map(O=>{var L;return[O,(L=$[O].variant)!==null&&L!==void 0?L:$[O].enabled]})),j=Object.fromEntries(Object.keys($).filter(O=>$[O].enabled).filter(O=>{var L;return!le((L=$[O].metadata)===null||L===void 0?void 0:L.payload)}).map(O=>{var L;return[O,(L=$[O].metadata)===null||L===void 0?void 0:L.payload]}));return z(z({},C),{},{featureFlags:N,featureFlagPayloads:j})}return C.featureFlags&&A.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),C})(r,f),g=p.flags,v=p.featureFlags,y=p.featureFlagPayloads;if(!v)return;const b=r.requestId,x=r.evaluatedAt;if(Je(v)){f.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");const C={};if(v)for(let A=0;v.length>A;A++)C[v[A]]=!0;return{[Ma]:v,[co]:C,[Ug]:!1}}let S=v,k=y,T=g;if(d?.partialResponse){const C=Object.keys(S),A=k||{};S=z(z({},o),S),k=z(z({}
17,l),A),C.forEach($=>{$ in A||k==null||delete k[$]}),T=z(z({},u),T)}else if(r.errorsWhileComputingFlags)if(g){const C=new Set(Object.keys(g).filter($=>{var N;return!(!((N=g[$])===null||N===void 0)&&N.failed)}));S=z(z({},o),Object.fromEntries(Object.entries(S).filter(([$])=>C.has($))));const A=Object.fromEntries(Object.entries(k||{}).filter(([$])=>C.has($)));k=z(z({},l),A),C.forEach($=>{$ in A||k==null||delete k[$]}),T=z(z({},u),Object.fromEntries(Object.entries(T||{}).filter(([$])=>C.has($))))}else S=z(z({},o),S),k=z(z({},l),k),T=z(z({},u),T);return z(z({[Ma]:Object.keys(XI(S)),[co]:S||{},[Yl]:k||{},[ku]:T||{},[Ug]:r.minimalFlagCalledEvents===!0},b?{[Eu]:b}:{}),x?{[rc]:x}:{})})(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this.$);if(i)if(n?.persist===!1){const r=!le(this.wo.kv.get(co));this.Od=i,r||this.At(i)}else this.Td(),this.Nd(i,t,!!n?.partialResponse),this.At(i);else e&&this.Dd();e||(this.ud=!1),this.Md(e)}override(t,e=!1){this.$.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.Zd(t)}Zd(t){if(this.wo){if(t===!1)return this.Lt([Wo,nu]),this.Md(),void Wc.info("All overrides cleared");if(Je(t))return this.At({[Wo]:JI(t)}),this.Md(),void Wc.info("Flag overrides set",{flags:t});if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var e;const n=t;this.Xc=!!((e=n.suppressWarning)!==null&&e!==void 0&&e);const i={},r=n.flags,o=n.payloads;
17return r&&(i[Wo]=Je(r)?JI(r):r),o&&(i[nu]=o),Object.keys(i).length&&this.At(i),r===!1&&o===!1?this.Lt([Wo,nu]):r===!1?this.Lt(Wo):o===!1&&this.Lt(nu),this.Md(),r===!1?Wc.info("Flag overrides cleared"):r&&Wc.info("Flag overrides set",{flags:r}),void(o===!1?Wc.info("Payload overrides cleared"):o&&Wc.info("Payload overrides set",{payloads:o}))}if(t&&typeof t=="object")return this.At({[Wo]:t}),this.Md(),void Wc.info("Flag overrides set",{flags:t});this.$.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.$.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.nd){const{flags:e,flagVariants:n}=this.Qd();try{t(e,n)}catch(i){this.$.error("Error while running feature flags callback",i)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var i;const r=(this.Fd("$early_access_features")||[]).find(f=>f.flagKey===t),o={[`$feature_enrollment/${t}`]:e},l={$feature_flag:t,$feature_enrollment:e,$set:o};r&&(l.$early_access_feature_name=r.name),n&&(l.$feature_enrollment_stage=n);const u=z(z({},this.getFlagVariants()),{},{[t]:e});(i=this._instance)===null||i===void 0||(i=i.persistence)===null||i===void 0||i.markCrossTabFeatureFlagChanges({$active_feature_flags:[t],$enabled_feature_flags:[t],$stored_person_properties:Object.keys(o)}),this.At({[Ma]:Object.keys(XI(u)),[co]:u,[Ql]:z(z({},this.Fd("$stored_person_properties")||{}),o)}),this.Md();try{var d;(d=this.wo)===null||d===void 0||d.capture("$feature_enrollment_update",l)}catch(f){this.$.error("Failed to capture early access feature enrollment",f)}}getEarlyAccessFeatures(t,e=!1,n){const i=this.Fd(DT);!i||e?this.Jd(t,n):t(i)}Jd(t,e){var n=this;return _n(function*(){const i=n.wo;if(!i)return;const r=e?`&${e.map(l=>`stage=${l}`).join("&")}`:"";let o;try{const l=yield i.sendRequest(`/api/early_access_features/?token=${i.projectToken}${r}`,{target:"api",method:"GET",sentAt:"query"});if(!l.json)return;o=l.json.earlyAccessFeatures,n.At({[DT]:o})}catch(l){return void n.$.error("Early access feature request failed",l)}try{t(o)}catch(l){n.$.error("Early access feature callback failed",l)}})()}Qd(){const t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter(n=>e[n]),flagVariants:Object.keys(e).filter(n=>e[n]).reduce((n,i)=>(n[i]=e[i],n),{})}}Md(t){this.Id();const{flags:e,flagVariants:n}=this.Qd();this.featureFlagEventHandlers.forEach(i=>{try{i(e,n,{errorsLoading:t})}catch(r){this.$.error("Error while running feature flags callback",r)}})}setPersonPropertiesForFlags(t,e=!0){this.Kd(t,e)}Kd(t,e=!0){const n=this.Fd("$stored_person_properties")||{},i=t?.$set||(t?.$set_once?{}:t),r=t?.$set_once,o={};if(r)for(const l in r)({}).hasOwnProperty.call(r,l)&&(l in n||(o[l]=r[l]));this.At({[Ql]:z(z(z({},n),o),i)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e=!0){const n=z({},this.Fd("$stored_person_properties")||{});t.forEach(i=>{delete n[i]}),this.At({[Ql]:n}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t=!0){this.Lt(Ql),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e=!0){const n=this.Fd("$stored_group_properties")||{},i=z({},n);for(const r of Object.keys(t))i[r]=z(z({},n[r]),t[r]);this.At({[ec]:i}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){const e=this.Fd("$stored_group_properties")||{};this.At({[ec]:z(z({},e),{},{[t]:{}})})}else this.Lt(ec)}reset(){this.rd++,this.ad=!1,this.Yc={},this.td={},this.Od=void 0,this.nd=!1,this.od=!1,this.ld=!1,this.$anon_distinct_id=void 0,this.Ad(),this.Xc=!1,this.hd=0}}},K7={sessionRecording:class{get Rr(){return this._instance.config}get Ml(){return this._instance.persistence}get started(){var t;return!!(!((t=this.Xd)===null||t===void 0)&&t.isStarted)}get status(){var t,e;return this.Yd==="awaiting_config"||this.Yd==="missing_config"?this.Yd:(t=(e=this.Xd)===null||e===void 0?void 0:e.status)!==null&&t!==void 0?t:this.Yd}constructor(t){if(this._instance=t,this._forceAllowLocalhostNetworkCapture=!1,this.Yd=H1,this.tv=void 0,this.ev=!1,this.Xe=(()=>{var e,n;if(!he?.visibilityState||he.visibilityState==="visible")return!0;const i=G==null||(e=G.performance)===null||e===void 0||(n=e.getEntriesByType)===null||n===void 0?void 0:n.call(e,"visibility-state");return!i?.length||i.some(r=>r.name==="visible")})(),this.ln=()=>{var e,n;he?.visibilityState==="visible"&&(this.Xe=!0,(e=this.Xd)===null||e===void 0||(n=e.setDocumentWasEverVisible)===null||n===void 0||n.call(e,!0))},!this._instance.sessionManager)throw Ta.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if(this.Rr.cookieless_mode==="always")throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');he?.addEventListener&&Ht(he,"visibilitychange",this.ln)}initialize(){this.startIfEnabledOrStop()}dispose({discardBufferedEvents:t=!1}={}){var e;this.ev=!0,he==null||(e=he.removeEventListener)===null||e===void 0||e.call(he,"visibilitychange",this.ln),t?this.iv(!0):this.stopRecording()}get nv(){var t;const e=!!(!((t=this._instance.get_property("$session_recording_remote_config"))===null||t===void 0)&&t.enabled),n=!this.Rr.disable_session_recording,i=this.Rr.disable_session_recording||this._instance.consent.isOptedOut();return G&&e&&n&&!i}startIfEnabledOrStop(t){var e;if(this.ev||this.nv&&(!((e=this.Xd)===null||e===void 0)&&e.isStarted))return;const n=!le(Object.assign)&&!le(Array.from);this.nv&&n?(this.sv(t),Ta.info("starting")):(this.Yd=H1,this.stopRecording())}sv(t){var e,n;if(this.nv)if(this.Yd!=="awaiting_config"&&this.Yd!=="missing_config"&&(this.Yd=FI),(qe==null||(e=qe.__PosthogExtensions__)===null||e===void 0||(e=e.rrweb)===null||e===void 0?void 0:e.record)&&((n=qe.__PosthogExtensions__)===null||n===void 0?void 0:n.initSessionRecording))this.rv(t);else{var i,r;const o=this._instance.sessionManager;(i=qe.__PosthogExtensions__)===null||i===void 0||(r=i.loadExternalDependency)===null||r===void 0||r.call(i,this._instance,this.ov,l=>{if(!this.ev&&this.nv&&this._instance.sessionManager===o)return l?(this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0}),Ta.error("could not load recorder",l)):void this.rv(t);this.Yd="disabled"})}}stopRecording(){var t,e;(t=this.tv)===null||t===void 0||t.call(this),this.tv=void 0,(e=this.Xd)===null||e===void 0||e.stop()}iv(t=!1){var e,n;(e=this.tv)===null||e===void 0||e.call(this),this.tv=void 0,(n=this.Xd)===null||n===void 0||n.discard({discardProducerEvents:t})}av(){var t,e;(t=this.Ml)===null||t===void 0||t.unregister("$session_is_sampled"),(e=this.Ml)===null||e===void 0||e.unregister("$replay_sample_rate")}lv(t,e){if(it(t))return null;const n=Fn(t)?t:parseFloat(t);return typeof(i=n)!="number"||!Number.isFinite(i)||0>i||i>1?(Ta.warn(`${e} must be between 0 and 1. Ignoring invalid value:`,t),null):n;var i}uv(t){if(this.Ml){var e,n;const i=this.Ml,r=()=>{var o;const l=t.sessionRecording===!1?void 0:t.sessionRecording,u=this.lv((o=this.Rr.session_recording)===null||o===void 0?void 0:o.sampleRate,"session_recording.sampleRate"),d=this.lv(l?.sampleRate,"remote config sampleRate"),f=u??d;
17it(f)&&this.av();const p=l?.minimumDurationMilliseconds;i.register({[Lg]:z(z({cache_timestamp:Date.now(),enabled:!!l},l),{},{networkPayloadCapture:z({capturePerformance:t.capturePerformance},l?.networkPayloadCapture),canvasRecording:{enabled:l?.recordCanvas,fps:l?.canvasFps,quality:l?.canvasQuality},sampleRate:f,minimumDurationMilliseconds:le(p)?null:p,endpoint:l?.endpoint,triggerMatchType:l?.triggerMatchType,masking:l?.masking,urlTriggers:l?.urlTriggers,version:l?.version,triggerGroups:l?.triggerGroups})})};r(),(e=this.tv)===null||e===void 0||e.call(this),this.tv=(n=this._instance.sessionManager)===null||n===void 0?void 0:n.onSessionId(r)}}onRemoteConfig(t){const e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?e.sessionRecording===!1?(this.uv(e),void this.iv()):(this.uv(e),void this.startIfEnabledOrStop()):(this.Yd==="awaiting_config"&&(this.Yd="missing_config",this._instance.register_for_session({[LU]:!0}),Ta.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e="log"){var n;!((n=this.Xd)===null||n===void 0)&&n.log?this.Xd.log(t,e):Ta.warn("log called before recorder was ready")}get ov(){var t,e;const n=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.get_property(Lg);return(n==null||(e=n.scriptConfig)===null||e===void 0?void 0:e.script)||"lazy-recorder"}hv(){const t=this._instance.get_property(Lg);if(!t)return!1;let e;try{e=typeof t=="object"?t:JSON.parse(t)}catch(n){return Ta.warn("persisted remote config for session recording is invalid and will be ignored",n),!1}return!it(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}rv(t){var e,n,i;if(!this.ev&&this.nv&&this._instance.sessionManager){if(!(!((e=qe.__PosthogExtensions__)===null||e===void 0)&&e.initSessionRecording))return Ta.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[DU]:!0});var r;if(this.Xd||(this.Xd=(r=qe.__PosthogExtensions__)===null||r===void 0?void 0:r.initSessionRecording(this._instance,this.Xe),this.Xd._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.hv())return this.Yd==="missing_config"||this.Yd==="awaiting_config"?void 0:(this.Yd="awaiting_config",Ta.info("persisted remote config is stale, requesting fresh config before starting"),void new h6(this._instance).load());this.Yd=FI,(n=(i=this.Xd).setDocumentWasEverVisible)===null||n===void 0||n.call(i,this.Xe),this.Xd.start(t)}else this.Yd=H1}onRRwebEmit(t){var e,n;(e=this.Xd)===null||e===void 0||(n=e.onRRwebEmit)===null||n===void 0||n.call(e,t)}overrideLinkedFlag(){var t,e;this.Xd||(e=this.Ml)===null||e===void 0||e.register({$replay_override_linked_flag:!0}),(t=this.Xd)===null||t===void 0||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Xd||(e=this.Ml)===null||e===void 0||e.register({$replay_override_sampling:!0}),(t=this.Xd)===null||t===void 0||t.overrideSampling()}overrideTrigger(t){var e,n;this.Xd||(n=this.Ml)===null||n===void 0||n.register({[t==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(e=this.Xd)===null||e===void 0||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.Xd)===null||t===void 0?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var n;return!!(!((n=this.Xd)===null||n===void 0)&&n.tryAddCustomEvent(t,e))}flushBeforeIdentityReset(){var t,e;(t=this.Xd)===null||t===void 0||(e=t.flushBeforeIdentityReset)===null||e===void 0||e.call(t)}}},Z7={autocapture:class extends v7{constructor(t){super(new y7(t)),this.instance=t}},historyAutocapture:class{constructor(t){this.dv=!1,this._instance=t,this.vv=this.fv()}initialize(){this.startIfEnabled()}get isEnabled(){const t=this.pv();return!!(t.path||t.search||this.gv(t))}startIfEnabled(){this.isEnabled&&(Ce.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.vv=this.fv(),this.startIfEnabled()}stop(){this.mv&&this.mv(),this.mv=void 0,this.yv&&this.yv(),this.yv=void 0,Ce.info("History API monitoring stopped")}monitorHistoryChanges(){G&&G.history&&(this.bv("pushState"),this.bv("replaceState"),this._v(),this.gv()&&this.wv())}bv(t){var e;if(!G||!((e=G.history[t])===null||e===void 0)&&e.__posthog_wrapped__)return;const n=this;xm(G.history,t,i=>function(r,o,l){var u;n.Sv(l)&&n.xv(),i.call(this,r,o,l),n.Cv(t,!n.dv&&(G==null||(u=G.event)===null||u===void 0?void 0:u.type)!=="popstate")})}fv(){const t=G?.location;if(t?.pathname)return{pathname:t.pathname,search:t.search,hash:t.hash}}pv(){const t=this._instance.config.capture_pageview;return t==="history_change"?{path:!0}:xt(t)?t:{}}gv(t=this.pv()){return!!t.hash&&!this._instance.config.disable_capture_url_hashes}$v(t){const e=this.pv(),n=this.vv;return!(!n||!(e.path&&t.pathname!==n.pathname||e.search&&t.search!==n.search||this.gv(e)&&t.hash!==n.hash))}Cv(t,e=!1){try{e||this.xv();const n=this.fv();if(!n)return;if(this.$v(n)){const i=()=>this._instance.capture(GC,{navigation_type:t});e?(this.Tv=i,Promise.resolve().then(()=>this.xv())):i()}this.vv=n}catch(n){Ce.error(`Error capturing ${t} pageview`,n)}}Sv(t){var e,n;return!(it(t)||!G)&&((e=Wa(String(t)))===null||e===void 0?void 0:e.href)!==((n=G.location)===null||n===void 0?void 0:n.href)}xv(){const t=this.Tv;if(t){this.Tv=void 0,this.dv=!0;try{t()}catch(e){Ce.error("Error capturing deferred pageview",e)}finally{this.dv=!1}this.vv=this.fv()}}_v(){if(this.mv)return;const t=()=>{this.Cv("popstate")};Ht(G,"popstate",t),this.mv=()=>{G&&G.removeEventListener("popstate",t)}}wv(){if(this.yv)return;const t=()=>{this.Cv("hashchange")};Ht(G,"hashchange",t),this.yv=()=>{G&&G.removeEventListener("hashchange",t)}}},heatmaps:class{get Rr(){return this.instance.config}constructor(t){var e;this.Iv=!1,this.xo=!1,this.Mv=null,this.instance=t,this.Iv=!!(!((e=this.instance.persistence)===null||e===void 0)&&e.props[NT]),this.rageclicks=new I6(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){let t=5e3;return xt(this.Rr.capture_heatmaps)&&this.Rr.capture_heatmaps.flush_interval_milliseconds&&(t=this.Rr.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return it(this.Rr.capture_heatmaps)?it(this.Rr.enable_heatmaps)?this.Iv:this.Rr.enable_heatmaps:this.Rr.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.xo)return;x7.info("starting..."),this.Ev(),this.ln()}else{var t;clearInterval((t=this.Mv)!==null&&t!==void 0?t:void 0),this.Pv(),this.getAndClearBuffer()}}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if(!("heatmaps"in e))return;const n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[NT]:n}),this.Iv=n,this.startIfEnabled()}getAndClearBuffer(){const t=this.Rt;return this.Rt=void 0,t}Rv(t){K1(t.originalEvent)&&this.Tr(t.originalEvent,"deadclick")}ln(){this.Mv&&clearInterval(this.Mv),this.Mv=he?.visibilityState==="visible"?setInterval(this.bl.bind(this),this.flushIntervalMilliseconds):null}Ev(){G&&he&&(this.Av=this.bl.bind(this),Ht(G,xb,this.Av),this.Fv
17=t=>this.Tr(t||G?.event),Ht(he,"click",this.Fv,{capture:!0}),this.Ov=t=>this.Dv(t||G?.event),Ht(he,"mousemove",this.Ov,{capture:!0}),this.Lv=new gI(this.instance,EY,this.Rv.bind(this)),this.Lv.startIfEnabledOrStop(),this.Nv=this.ln.bind(this),Ht(he,vm,this.Nv),this.xo=!0)}Pv(){var t;G&&he&&(this.Av&&G.removeEventListener(xb,this.Av),this.Fv&&he.removeEventListener("click",this.Fv,{capture:!0}),this.Ov&&he.removeEventListener("mousemove",this.Ov,{capture:!0}),this.Nv&&he.removeEventListener(vm,this.Nv),clearTimeout(this.qv),(t=this.Lv)===null||t===void 0||t.stop(),this.xo=!1)}jv(t,e){const n=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),r=this.instance.scrollManager.scrollElement(),o=(function(l,u,d){let f=l;for(;f&&ta(f)&&!qi(f,"body");){if(f===d)return!1;let y;try{var p,g,v;y=(p=(g=(v=f.ownerDocument)===null||v===void 0?void 0:v.defaultView)!==null&&g!==void 0?g:G)===null||p===void 0?void 0:p.getComputedStyle(f).position}catch{return!1}if(Qe(u,y))return!0;f=BU(f)}return!1})(Hg(t),["fixed","sticky"],r);return{x:t.clientX+(o?0:i),y:t.clientY+(o?0:n),target_fixed:o,type:e}}Tr(t,e="click"){var n;if(sI(t.target)||!K1(t))return;const i=this.jv(t,e);!((n=this.rageclicks)===null||n===void 0)&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&JU(Hg(t),this.instance.config.rageclick)&&this.Zs(z(z({},i),{},{type:"rageclick"})),this.Zs(i)}Dv(t){!sI(t.target)&&K1(t)&&(clearTimeout(this.qv),this.qv=setTimeout(()=>{this.Zs(this.jv(t,"mousemove"))},500))}Zs(t){if(!G)return;const e=this.Rr.disable_capture_url_hashes?cc(G.location.href):G.location.href,n=this.Rr.custom_personal_data_properties,i=this.Rr.mask_personal_data_properties?[...Jh,...n||[]]:[],r=bm(e,i,wm);this.Rt=this.Rt||{},this.Rt[r]||(this.Rt[r]=[]),this.Rt[r].push(t)}bl(){this.Rt&&!zr(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:gI,webVitalsAutocapture:class{constructor(t){var e;this._instance=t,this.Iv=!1,this.xo=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Bv=()=>{clearTimeout(this.Hv),this.Hv=void 0,this.Rt.metrics.length!==0&&(this._instance.capture("$web_vitals",z({$current_url:this.Rt.url},this.Rt.metrics.reduce((n,i)=>z(z({},n),{},{[`$web_vitals_${i.name}_event`]:z({},i),[`$web_vitals_${i.name}_value`]:i.value}),{}))),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.zv=n=>{var i;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},it(n?.name)||it(n?.value))return void Zc.error("Invalid metric received",n);const r=typeof n.navigationURL=="string"?n.navigationURL:void 0,o=this.Uv(r);if(le(o))return;const l=Fn(n.navigationId)||typeof n.navigationId=="string"?`navigation:${n.navigationId}`:`url:${o}`;if(this.Wv&&n.value>=this.Wv)return void Zc.error("Ignoring metric with value >= "+this.Wv,n);this.Rt.navigationKey!==l&&(this.Bv(),this.Hv=setTimeout(this.Bv,this.flushToCaptureTimeoutMs)),le(this.Rt.navigationKey)&&(this.Rt.navigationKey=l,this.Rt.url=o),this.Rt.firstMetricTimestamp=le(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;const u=(i=this._instance.sessionManager)===null||i===void 0?void 0:i.checkAndGetSessionAndWindowId(!0),d=z(z(z({},n),r?{navigationURL:o}:{}),{},{$current_url:o,timestamp:Date.now()});if(delete d.entries,xt(n.attribution)&&this.attributionMetrics.indexOf(n.name)>-1){const f={};for(const p of w7){const g=p==="url"&&typeof n.attribution[p]=="string"?this.Uv(n.attribution[p]):n.attribution[p];le(g)||(f[p]=g)}d.attribution=f}else delete d.attribution;le(u)||(d.$session_id=u.sessionId,d.$window_id=u.windowId),this.Rt.metrics.push(d),this.Rt.metrics.length===this.allowedMetrics.length&&this.Bv()},this.Vv=()=>{if(this.xo)return;let n,i,r,o,l=!1;const u=qe.__PosthogExtensions__,d=u?.postHogWebVitalsCallbacksByFlavor,f=d?.[this.Gv]||(this.Gv==="web-vitals"&&le(d)?u?.postHogWebVitalsCallbacks:void 0);if(!le(f)){const v=f.withoutAttribution,y=this.attributionMetrics;l=!le(v),n=y.indexOf("LCP")>-1?f.onLCP:v?.onLCP||f.onLCP,i=y.indexOf("CLS")>-1?f.onCLS:v?.onCLS||f.onCLS,r=y.indexOf("FCP")>-1?f.onFCP:v?.onFCP||f.onFCP,o=y.indexOf("INP")>-1?f.onINP:v?.onINP||f.onINP}if(!(n&&i&&r&&o))return void Zc.error("web vitals callbacks not loaded - not starting");const p={reportSoftNavs:this.useSoftNavs},g=l&&this.attributionMetrics.indexOf("INP")>-1?z(z({},p),{},{includeProcessedEventEntries:!1}):p;this.allowedMetrics.indexOf("LCP")>-1&&n(this.zv.bind(this),p),this.allowedMetrics.indexOf("CLS")>-1&&i(this.zv.bind(this),p),this.allowedMetrics.indexOf("FCP")>-1&&r(this.zv.bind(this),p),this.allowedMetrics.indexOf("INP")>-1&&o(this.zv.bind(this),g),this.xo=!0},this.Iv=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[zT]),this.startIfEnabled()}get Zv(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e;const n=xt(this.Zv)?(t=this.Zv)===null||t===void 0?void 0:t.web_vitals_allowed_metrics:void 0;return it(n)?((e=this._instance.persistence)===null||e===void 0?void 0:e.props.$web_vitals_allowed_metrics)||UI:n}get flushToCaptureTimeoutMs(){return(xt(this.Zv)?this.Zv.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){const t=xt(this.Zv)?this.Zv.web_vitals_attribution:void 0;return Or(t)?t?UI:[]:Je(t)?t:b7}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){const t=xt(this.Zv)?this.Zv.__preview_web_vitals_soft_navs:void 0;return t!=null&&t}get Wv(){const t=xt(this.Zv)&&Fn(this.Zv.__web_vitals_max_value)?this.Zv.__web_vitals_max_value:LI;return t>0&&6e4>=t?LI:t}get isEnabled(){const t=Cn?.protocol;if(t!=="http:"&&t!=="https:")return Zc.info("Web Vitals are disabled on non-http/https protocols"),!1;const e=xt(this.Zv)?this.Zv.web_vitals:Or(this.Zv)?this.Zv:void 0;return Or(e)?e:this.Iv}startIfEnabled(){this.isEnabled&&!this.xo&&(Zc.info("enabled, starting..."),this.zo(this.Vv))}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if(!("capturePerformance"in e))return;const n=xt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=xt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[zT]:n}),this._instance.persistence.register({[CU]:i})),this.Iv=n,this.startIfEnabled()}get Gv(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}zo(t){var e;
17const n=qe.__PosthogExtensions__,i=this.Gv,r=n?.postHogWebVitalsCallbacksByFlavor;r?.[i]||i==="web-vitals"&&le(r)&&n?.postHogWebVitalsCallbacks?t():n==null||(e=n.loadExternalDependency)===null||e===void 0||e.call(n,this._instance,i,o=>{o?Zc.error("failed to load script",o):t()})}Uv(t){const e=t||G?.location.href;if(!e)return void Zc.error("Could not determine current URL");const n=this._instance.config.disable_capture_url_hashes?cc(e):e,i=this._instance.config.custom_personal_data_properties,r=this._instance.config.mask_personal_data_properties?[...Jh,...i||[]]:[];return bm(n,r,wm)}}},W7={exceptionObserver:class{constructor(t){var e;this.Vv=()=>{var n;if(!G||!this.isEnabled||!(!((n=qe.__PosthogExtensions__)===null||n===void 0)&&n.errorWrappingFunctions))return;const i=qe.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=qe.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,o=qe.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Qv&&this.Rr.capture_unhandled_errors&&(this.Qv=i(this.captureException.bind(this))),!this.Jv&&this.Rr.capture_unhandled_rejections&&(this.Jv=r(this.captureException.bind(this))),!this.Kv&&this.Rr.capture_console_errors&&(this.Kv=o(this.captureException.bind(this)))}catch(l){Lp.error("failed to start",l),this.Xv()}},this._instance=t,this.Yv=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[MT]),this.wt=new DJ(z(z({},(function(n={}){var i,r,o,l;return{refillRate:(i=(r=n.exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:n.__exceptionRateLimiterRefillRate)!==null&&i!==void 0?i:1,bucketSize:(o=(l=n.exceptionRateLimiterBucketSize)!==null&&l!==void 0?l:n.__exceptionRateLimiterBucketSize)!==null&&o!==void 0?o:10}})(this._instance.config.error_tracking)),{},{refillInterval:1e4,$:Lp})),this.Rr=this.tf(),this.startIfEnabledOrStop()}tf(){const t=this._instance.config.capture_exceptions;let e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return xt(t)?e=z(z({},e),t):(le(t)?this.Yv:t)&&(e=z(z({},e),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Rr.capture_console_errors||this.Rr.capture_unhandled_errors||this.Rr.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Lp.info("enabled"),this.Xv(),this.zo(this.Vv)):this.Xv()}zo(t){var e,n,i;!((e=qe.__PosthogExtensions__)===null||e===void 0)&&e.errorWrappingFunctions?t():(n=qe.__PosthogExtensions__)===null||n===void 0||(i=n.loadExternalDependency)===null||i===void 0||i.call(n,this._instance,"exception-autocapture",r=>{if(r)return Lp.error("failed to load script",r);t()})}Xv(){var t,e,n;(t=this.Qv)===null||t===void 0||t.call(this),this.Qv=void 0,(e=this.Jv)===null||e===void 0||e.call(this),this.Jv=void 0,(n=this.Kv)===null||n===void 0||n.call(this),this.Kv=void 0}onRemoteConfig(t){if(!t.ok)return;const e=t.config;"autocaptureExceptions"in e&&(this.Yv=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[MT]:this.Yv}),this.Rr=this.tf(),this.startIfEnabledOrStop())}onConfigChange(){this.Rr=this.tf()}captureException(t){try{var e,n,i;const r=(e=t==null||(n=t.$exception_list)===null||n===void 0||(n=n[0])===null||n===void 0?void 0:n.type)!==null&&e!==void 0?e:"Exception";if(this.wt.consumeRateLimit(r))return void Lp.info("Skipping exception capture because of client rate limiting.",{exception:r});(i=this._instance.exceptions)===null||i===void 0||i.sendExceptionEvent(t)}catch{}}},exceptions:class{constructor(t){var e,n;this.ef=[],this.if=new JJ([new dX,new bX,new fX,new hX,new yX,new vX,new gX,new _X],(function(i,...r){return(o,l=0)=>{const u=[],d=o.split(`
18`),f=Math.min(d.length,l+1e3),p=[];for(let y=l;f>y;y++){const b=d[y];if(b.length>1024)continue;const x=FM.test(b)?b.replace(FM,"$1"):b;if(!x.match(/\S*Error: /)){for(const S of r){const k=S(x,i);if(k){u.push(k);const T=aX(u);if(T){for(let C=p.length-1;C>=0;C--){const A=p[C];if(T.start>=A.start+A.length)break;p.pop()}p.push(T)}break}}if(cX(u,p)>=50)break}}const g=[...p].sort((y,b)=>b.start-y.start),v=g[g.length-1];if(v){const y=cU(u,v);u.splice(v.start-y,y);for(const b of g)b.start-=y}for(const y of g)lX(u,y);return p.some(y=>y.start===0&&u.length===y.length)&&(function(y){const b=y.map(S=>`${S.function}|${S.filename}|${S.lineno}|${S.colno}|${S.module}`);let x=0;for(let S=1;b.length>S;S++)uX(b,S,x)&&(x=S);y.push(...y.splice(0,x))})(u),(function(y){if(!y.length)return[];const b=Array.from(y);return b.reverse(),b.slice(0,50).map(x=>{return z(z({},x),{},{filename:x.filename||(S=b,S[S.length-1]||{}).filename,function:x.function||"?"});var S})})(u)}})("web:javascript",iX,oX)),this._instance=t,this.ef=(e=(n=this._instance.persistence)===null||n===void 0?void 0:n.get_property("$error_tracking_suppression_rules"))!==null&&e!==void 0?e:[],this.nf=vb(this.sf()),this.rf=new xX(this.nf)}onConfigChange(){this.nf=vb(this.sf()),this.rf.setConfig(this.nf)}onRemoteConfig(t){var e,n,i;if(!t.ok)return;const r=t.config;if(!("errorTracking"in r))return;const o=(e=(n=r.errorTracking)===null||n===void 0?void 0:n.suppressionRules)!==null&&e!==void 0?e:[],l=(i=r.errorTracking)===null||i===void 0?void 0:i.captureExtensionExceptions;this.ef=o,this._instance.persistence&&this._instance.persistence.register({[EU]:this.ef,[IT]:l})}get af(){var t;const e=!!this._instance.get_property(IT),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.if.buildFromUnknown(t,{syntheticException:e?.syntheticException,mechanism:{handled:e?.handled}})}addExceptionStep(t,e){if(this.nf.enabled)try{if(!mt(t)||t.trim().length===0)return void so.warn("Ignoring exception step because message must be a non-empty string");const{sanitizedProperties:n,droppedKeys:i}=(function(r){if(!r)return{sanitizedProperties:{},droppedKeys:[]};const o=[];return{sanitizedProperties:Object.keys(r).reduce((l,u)=>wX.has(u)?(o.push(u),l):(l[u]=r[u],l),{}),droppedKeys:o}})(this.lf(e));i.length>0&&so.warn("Ignoring reserved exception step fields",{droppedKeys:i}),this.rf.add(z({[gb]:t,[mb]:new Date().toISOString()},n))}catch(n){so.error("Failed to add exception step. Ignoring breadcrumb.",n)}}sendExceptionEvent(t){try{const e=t.$exception_list;if(this.uf(e)){if(this.hf(e))return this.cf("Exception dropped: matched a suppression rule"),void so.info("Skipping exception capture because a suppression rule matched");if(!this.af&&this.df(e))return this.cf("Exception dropped: thrown by a browser extension"),void so.info("Skipping exception capture because it was thrown by an extension");if(!this.af&&this.vf(e))return this.cf("Exception dropped: thrown by an injected browser script"),void so.info("Skipping exception capture because it was thrown by an injected browser script");
18if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ff(e))return this.cf("Exception dropped: thrown by the PostHog SDK"),void so.info("Skipping exception capture because it was thrown by the PostHog SDK")}const n=this.nf.enabled&&it(t.$exception_steps)?this.pf(t):t,i=(function(){const r=globalThis._posthogReleaseId;return typeof r=="string"&&r.length>0?r:void 0})();i&&(n.$release_id=i);try{const r=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",fh:!0});return r&&this.rf.clear(),r}catch(r){return YI(r)||so.error("Failed to capture exception event. Dropping this exception.",r),void this.rf.clear()}}catch(e){return void(YI(e)||so.error("Failed to process exception event. Ignoring this exception.",e))}}pf(t){try{const e=this.rf.getAttachable();return e.length===0?t:z(z({},t),{},{$exception_steps:e})}catch(e){return so.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}cf(t){this.nf.enabled&&this.rf.add({[gb]:t,[mb]:new Date().toISOString()})}lf(t){return xt(t)?z({},t):{}}sf(){var t,e;return(t=(e=this._instance.config.error_tracking)===null||e===void 0?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}hf(t){if(t.length===0)return!1;try{const e=t.reduce((n,{type:i,value:r})=>(mt(i)&&i.length>0&&n.$exception_types.push(i),mt(r)&&r.length>0&&n.$exception_values.push(r),n),{$exception_types:[],$exception_values:[]});return this.ef.some(n=>{const i=n.values.map(r=>{const o=j6[r.operator],l=e[r.key];if(!o||!l)return!1;const u=Je(r.value)?r.value:[r.value];return u.length>0&&o(u,l)});return n.type==="OR"?i.some(Boolean):i.every(Boolean)})}catch(e){return so.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}df(t){const e=t.flatMap(i=>{var r,o;return(r=(o=i.stacktrace)===null||o===void 0?void 0:o.frames)!==null&&r!==void 0?r:[]}),n=e.filter(({filename:i})=>!!i&&N7.some(r=>i.startsWith(r)));return n.length!==0&&(!n.every(({filename:i})=>!!i&&i.startsWith(QT))||t.some(({type:i,value:r})=>i==="NoResponse"||mt(r)&&P7.some(({value:o,exact:l})=>l?r===o:r.includes(o)))&&!e.some(({in_app:i,filename:r})=>i&&!r?.startsWith(QT)))}vf(t){return t.some(({value:e})=>mt(e)&&M7.some(n=>e.includes(n)))}ff(t){if(t.length>0){var e,n,i,r;const o=(e=(n=t[0].stacktrace)===null||n===void 0?void 0:n.frames)!==null&&e!==void 0?e:[],l=o[o.length-1];return(i=l==null||(r=l.filename)===null||r===void 0?void 0:r.includes("posthog.com/static"))!==null&&i!==void 0&&i}return!1}uf(t){return!it(t)&&Je(t)}}},q7=z({productTours:class{get Ml(){return this._instance.persistence}constructor(t){this.gf=null,this.mf=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if("productTours"in e){var n,i;if(this.Ml&&this.Ml.register({[qC]:!!e.productTours}),!Z1(this._instance))return!this.gf&&it((n=this.Ml)===null||n===void 0?void 0:n.props.ph_product_tours)||v0.info("product tours disabled; stopping and clearing cached tours"),(i=this.gf)===null||i===void 0||i.stop(),this.gf=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.gf&&Z1(this._instance)&&this.zo(()=>this.yf())}zo(t){var e,n,i;!((e=qe.__PosthogExtensions__)===null||e===void 0)&&e.generateProductTours?t():(n=qe.__PosthogExtensions__)===null||n===void 0||(i=n.loadExternalDependency)===null||i===void 0||i.call(n,this._instance,"product-tours",r=>{r?v0.error("Could not load product tours script",r):t()})}yf(){var t;!this.gf&&(!((t=qe.__PosthogExtensions__)===null||t===void 0)&&t.generateProductTours)&&(this.gf=qe.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e=!1){if(Je(this.mf)&&!e)return void t(this.mf,{isLoaded:!0});const n=this.Ml;if(n){const i=n.props[UT];if(Je(i)&&!e)return this.mf=i,void t(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/product_tours/?token=${this._instance.config.token}`),method:"GET",timestampMode:"query",callback:i=>{if(!Z1(this._instance))return void t([],{isLoaded:!0});const r=i.statusCode;if(r!==200||!i.json){const l=`Product Tours API could not be loaded, status: ${r}`;return r===0?i.error||v0.warn(l):v0.error(l),void t([],{isLoaded:!1,error:l})}const o=Je(i.json.product_tours)?i.json.product_tours:[];this.mf=o,n&&n.register({[UT]:o}),t(o,{isLoaded:!0})}})}getActiveProductTours(t){it(this.gf)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.gf.getActiveProductTours(t)}showProductTour(t){var e;(e=this.gf)===null||e===void 0||e.showTourById(t)}previewTour(t){this.gf?this.gf.previewTour(t):this.zo(()=>{var e;this.yf(),(e=this.gf)===null||e===void 0||e.previewTour(t)})}dismissProductTour(){var t;(t=this.gf)===null||t===void 0||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.gf)===null||t===void 0||t.nextStep()}previousStep(){var t;(t=this.gf)===null||t===void 0||t.previousStep()}clearCache(){var t;this.mf=null,(t=this.Ml)===null||t===void 0||t.unregister("ph_product_tours")}resetTour(t){var e;(e=this.gf)===null||e===void 0||e.resetTour(t)}resetAllTours(){var t;(t=this.gf)===null||t===void 0||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.gf)===null||e===void 0||e.cancelPendingTour(t)}}},Cw),V7={siteApps:class{constructor(t){this._instance=t,this.bf=0,this._f=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}wf(t,e){if(!e)return;const n=this.globalsForEvent(e);
18this._f.push(n),this._f.length>1e3&&(this._f=this._f.slice(10))}get siteAppLoaders(){var t;return(t=qe._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(t=t[this._instance.config.token])===null||t===void 0?void 0:t.siteApps}initialize(){if(this.isEnabled){const t=this._instance._addCaptureHook(this.wf.bind(this));this.kf=()=>{t(),this._f=[],this.kf=void 0}}}globalsForEvent(t){var e,n,i,r,o,l,u;if(!t)throw new Error("Event payload is required");const d={},f=this._instance.get_property("$groups")||[],p=this._instance.get_property("$stored_group_properties")||{};for(const[y,b]of Object.entries(p))d[y]={id:f[y],type:y,properties:b};const{$set_once:g,$set:v}=t;return{event:z(z({},fU(t,S7)),{},{properties:z(z(z({},t.properties),v?{$set:z(z({},(e=(n=t.properties)===null||n===void 0?void 0:n.$set)!==null&&e!==void 0?e:{}),v)}:{}),g?{$set_once:z(z({},(i=(r=t.properties)===null||r===void 0?void 0:r.$set_once)!==null&&i!==void 0?i:{}),g)}:{}),elements_chain:(o=(l=t.properties)===null||l===void 0?void 0:l.$elements_chain)!==null&&o!==void 0?o:"",distinct_id:(u=t.properties)===null||u===void 0?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:d}}Sf(t){var e;const n=(e=t.tagName)===null||e===void 0?void 0:e.toLowerCase();return n==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(Ko.error("prepare_external_dependency_stylesheet returned null"),null):n==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||(Ko.error("prepare_external_dependency_script returned null"),null):t}xf(){var t,e,n,i,r,o,l,u;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};const d=he?.defaultView,f=d==null||(t=d.Node)===null||t===void 0?void 0:t.prototype;if(!d||!f)return()=>{};if(this.bf++,this.Cf)return this.$f();const p=[],g=this,v=new WeakSet,y=(S,k,T)=>{if(!S?.[k])return;const C=S[k];S[k]=T(C),p.push(()=>{S[k]=C})},b=S=>{if(v.has(S))return S;const k=g.Sf(S);return k&&v.add(k),k},x=S=>S.map(k=>typeof k=="string"?k:b(k)).filter(k=>!On(k));return y(f,"appendChild",S=>function(k){const T=b(k);return T?S.call(this,T):k}),y(f,"insertBefore",S=>function(k,T){const C=b(k);return C?S.call(this,C,T):k}),y(f,"replaceChild",S=>function(k,T){const C=b(k);return C?S.call(this,C,T):T}),[(e=d.Element)===null||e===void 0?void 0:e.prototype,(n=d.Document)===null||n===void 0?void 0:n.prototype,(i=d.DocumentFragment)===null||i===void 0?void 0:i.prototype].forEach(S=>{y(S,"append",k=>function(...T){return k.apply(this,x(T))}),y(S,"prepend",k=>function(...T){return k.apply(this,x(T))})}),[(r=d.Element)===null||r===void 0?void 0:r.prototype,(o=d.CharacterData)===null||o===void 0?void 0:o.prototype,(l=d.DocumentType)===null||l===void 0?void 0:l.prototype].forEach(S=>{y(S,"before",k=>function(...T){return k.apply(this,x(T))}),y(S,"after",k=>function(...T){return k.apply(this,x(T))}),y(S,"replaceWith",k=>function(...T){const C=x(T);return T.length&&!C.length?void 0:k.apply(this,C)})}),y((u=d.Element)===null||u===void 0?void 0:u.prototype,"insertAdjacentElement",S=>function(k,T){const C=b(T);return C?S.call(this,k,C):null}),this.Cf=()=>{p.forEach(S=>S()),this.Cf=void 0},this.$f()}$f(){let t=!1;return()=>{var e;t||(t=!0,this.bf--,this.bf===0&&((e=this.Cf)===null||e===void 0||e.call(this)))}}Tf(t,e=!0){const n=this.xf();try{const i=t(n);return e&&n(),i}catch(i){throw n(),i}}setupSiteApp(t){const e=this.apps[t.id],n=()=>{var o;!e.errored&&this._f.length&&(Ko.info(`Processing ${this._f.length} events for site app with id ${t.id}`),this._f.forEach(l=>this.Tf(()=>{var u;return(u=e.processEvent)===null||u===void 0?void 0:u.call(e,l)})),e.processedBuffer=!0),Object.values(this.apps).every(l=>l.processedBuffer||l.errored)&&((o=this.kf)===null||o===void 0||o.call(this))};let i=!1;const r=o=>{e.errored=!o,e.loaded=!0,Ko.info(`Site app with id ${t.id} ${o?"loaded":"errored"}`),i&&n()};try{const{processEvent:o}=this.Tf(l=>t.init({posthog:this._instance,callback(u){l(),r(u)}}),!1);o&&(e.processEvent=o),i=!0}catch(o){Ko.error(HI+t.id,o),r(!1)}if(i&&e.loaded)try{n()}catch(o){Ko.error(`Error while processing buffered events PostHog app with config id ${t.id}`,o),e.errored=!0}}If(){const t=this.siteAppLoaders||[];for(const e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(const e of t)this.setupSiteApp(e)}Mf(t){if(Object.keys(this.apps).length===0)return;const e=this.globalsForEvent(t);for(const n of Object.values(this.apps))try{this.Tf(()=>{var i;return(i=n.processEvent)===null||i===void 0?void 0:i.call(n,e)})}catch(i){Ko.error(`Error while processing event ${t.event} for site app ${n.id}`,i)}}onRemoteConfig(t){var e,n,i;if(!((e=this.siteAppLoaders)===null||e===void 0)&&e.length)return this.isEnabled?(this.If(),void this._instance.on("eventCaptured",u=>this.Mf(u))):void Ko.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.kf)===null||n===void 0||n.call(this),!t.ok)return;const r=t.config;if(!((i=r.siteApps)===null||i===void 0)&&i.length)if(this.isEnabled)for(const{id:u,url:d}of r.siteApps){var o,l;qe[`__$$ph_site_app_${u}`]=this._instance,(o=qe.__PosthogExtensions__)===null||o===void 0||(l=o.loadSiteApp)===null||l===void 0||l.call(o,this._instance,d,f=>{if(f)return Ko.error(HI+u,f)})}else Ko.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},B7={tracingHeaders:class{constructor(t){this._instance=t,this.Ef=void 0,this.Pf=void 0,this.Rf=void 0,this.Vv=()=>{const e=this.Af();var n,i;e?(le(this.Ef)&&(this.Ef=(n=qe.__PosthogExtensions__)===null||n===void 0||(n=n.tracingHeadersPatchFns)===null||n===void 0?void 0:n._patchXHR(e,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),le(this.Pf)&&(this.Pf=(i=qe.__PosthogExtensions__)===null||i===void 0||(i=i.tracingHeadersPatchFns)===null||i===void 0?void 0:i._patchFetch(e,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.Xv()}}initialize(){this.startIfEnabledOrStop()}zo(t){var e,n,i;!((e=qe.__PosthogExtensions__)===null||e===void 0)&&e.tracingHeadersPatchFns?t():(n=qe.__PosthogExtensions__)===null||n===void 0||(i=n.loadExternalDependency)===null||i===void 0||i.call(n,this._instance,"tracing-headers",r=>{if(r)return _7.error("failed to load script",r);t()})}Ff(){var t,e;return(t=(e=this._instance.config.tracing_headers)!==null&&e!==void 0?e:this._instance.config.addTracingHeaders)!==null&&t!==void 0?t:this._instance.config.__add_tracing_headers}Af(){const t=this.Ff();return Je(t)?(Je(this.Rf)?this.Rf.splice(0,this.Rf.length,...t):this.Rf=[...t],t.length>0?this.Rf:void 0):(Je(this.Rf)&&this.Rf.splice(0),this.Rf=t||void 0,this.Rf)}Xv(){var t,e;(t=this.Ef)===null||t===void 0||t.call(this),(e=this.Pf)===null||e===void 0||e.call(this),this.Ef=void 0,this.Pf=void 0}startIfEnabledOrStop(){this.Af()?this.zo(this.Vv):this.Xv()}}},G7=z({surveys:class extends k7{constructor(t){var e;super(new R7(t),(e=t,{get projectToken(){return e.config.token},kv:new O7(e)})),this._instance=t}qh(t,e){const n=e.query?rv(t,e.query):t;return new Promise(i=>{var r;this._instance._send_request({method:e.method,url:this._instance.requestRouter.endpointFor((r=e.target)!==null&&r!==void 0?r:"api",n),data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,timestampMode:e.sentAt,callback:i})})}}},Cw),J7={toolbar:class{constructor(t){this.instance=t}Of(t){qe.ph_toolbar_state=t}Df(){var t;return(t=qe.ph_toolbar_state)!==null&&t!==void 0?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t=void 0,e=void 0,n=void 0){var i,r;if(HT(this.instance.config)||!G||!he)return!1;t=(i=t)!==null&&i!==void 0?i:G.location,n=(r=n)!==null&&r!==void 0?r:G.history;try{if(!e){try{G.localStorage.setItem("test","test"),G.localStorage.removeItem("test")}catch{return!1}e=G?.localStorage}const o=$7||kb(t.hash,"__posthog")||kb(t.hash,"state");let l;const u=o?zM(()=>JSON.parse(atob(decodeURIComponent(o))))||zM(()=>JSON.parse(decodeURIComponent(o))):null;return u&&u.action==="ph_authorize"?(l=u,l.source="url",l&&Object.keys(l).length>0&&(u.desiredHash?t.hash=u.desiredHash:n?n.replaceState(n.state,"",t.pathname+t.search):t.hash="")):(l=JSON.parse(e.getItem(ZI)||"{}"),l.source="localstorage",delete l.userIntent),!(!l.token||this.instance.config.token!==l.token||(this.loadToolbar(l),0))}catch{return!1}}Lf(t){const e=qe.ph_load_toolbar||qe.ph_load_editor;!it(e)&&pi(e)?e(t,this.instance):WI.warn("No toolbar load function found")}loadToolbar(t){const e=!!he?.getElementById("__POSTHOG_TOOLBAR__");
18if(!G||e)return!1;const n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,i=z(z({token:this.instance.config.token},t),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(G.localStorage.setItem(ZI,JSON.stringify(z(z({},i),{},{source:void 0}))),this.Df()===2)this.Lf(i);else if(this.Df()===0){var r,o;this.Of(1),(r=qe.__PosthogExtensions__)===null||r===void 0||(o=r.loadExternalDependency)===null||o===void 0||o.call(r,this.instance,"toolbar",l=>{if(l)return WI.error("[Toolbar] Failed to load",l),void this.Of(0);this.Of(2),this.Lf(i)}),Ht(G,"turbolinks:load",()=>{this.Of(0),this.loadToolbar(i)})}return!0}Nf(t){return this.loadToolbar(t)}maybeLoadEditor(t=void 0,e=void 0,n=void 0){return this.maybeLoadToolbar(t,e,n)}}},X7=z({experiments:class br{get Rr(){return this._instance.config}constructor(e){this._instance=e,this.getWebExperimentsAndEvaluateDisplayLogic=(n=!1)=>{this.getWebExperiments(i=>{br.qf("retrieved web experiments from the server"),this.jf=new Map,i.forEach(r=>{if(r.feature_flag_key){var o;this.jf&&(br.qf("setting flag key ",r.feature_flag_key," to web experiment ",r),(o=this.jf)===null||o===void 0||o.set(r.feature_flag_key,r));const l=this._instance.getFeatureFlag(r.feature_flag_key);mt(l)&&r.variants[l]&&this.Bf(r.name,l,r.variants[l].transforms)}else if(r.variants)for(const l in r.variants){const u=r.variants[l];br.Hf(u,this._instance)&&this.Bf(r.name,l,u.transforms)}})},n)},this._instance.onFeatureFlags(n=>{this.onFeatureFlags(n)})}initialize(){}onFeatureFlags(e){if(this._is_bot())br.qf(QI);else if(!this.Rr.disable_web_experiments){if(it(this.jf))return this.jf=new Map,this.loadIfEnabled(),void this.previewWebExperiment();br.qf("applying feature flags",e),e.forEach(n=>{var i;if(this.jf&&(!((i=this.jf)===null||i===void 0)&&i.has(n))){var r;const o=this._instance.getFeatureFlag(n),l=(r=this.jf)===null||r===void 0?void 0:r.get(n);o&&l?.variants[o]&&this.Bf(l.name,o,l.variants[o].transforms)}})}}previewWebExperiment(){const e=br.getWindowLocation();if(e?.search){const n=Gh(e?.search,"__experiment_id"),i=Gh(e?.search,"__experiment_variant");n&&i&&(br.qf(`previewing web experiments ${n} && ${i}`),this.getWebExperiments(r=>{this.zf(parseInt(n),i,r)},!1,!0))}}loadIfEnabled(){this.Rr.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,i){if(this.Rr.disable_web_experiments&&!i)return e([]);const r=this._instance.get_property("$web_experiments");if(r&&!n)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.Rr.token}`),method:"GET",timestampMode:"query",callback:o=>e(o.statusCode===200&&o.json&&o.json.experiments||[])})}zf(e,n,i){const r=i.filter(o=>o.id===e);r&&r.length>0&&(br.qf(`Previewing web experiment [${r[0].name}] with variant [${n}]`),this.Bf(r[0].name,n,r[0].variants[n].transforms))}static Hf(e,n){return!it(e.conditions)&&br.Uf(e,n)&&br.Wf(e)}static Uf(e,n){var i;if(it(e.conditions)||it((i=e.conditions)===null||i===void 0?void 0:i.url))return!0;const r=br.getWindowLocation();if(r){var o,l,u;const d=WU(n,r.href);return!(!((o=e.conditions)===null||o===void 0)&&o.url)||I7[(l=(u=e.conditions)===null||u===void 0?void 0:u.urlMatchType)!==null&&l!==void 0?l:"icontains"](e.conditions.url,d)}return!1}
18static getWindowLocation(){return G?.location}static Wf(e){var n;if(it(e.conditions)||it((n=e.conditions)===null||n===void 0?void 0:n.utm))return!0;const i=i6();if(i.utm_source){var r,o,l,u,d,f,p,g;const v=!(!((r=e.conditions)===null||r===void 0||(r=r.utm)===null||r===void 0)&&r.utm_campaign)||((o=e.conditions)===null||o===void 0||(o=o.utm)===null||o===void 0?void 0:o.utm_campaign)==i.utm_campaign,y=!(!((l=e.conditions)===null||l===void 0||(l=l.utm)===null||l===void 0)&&l.utm_source)||((u=e.conditions)===null||u===void 0||(u=u.utm)===null||u===void 0?void 0:u.utm_source)==i.utm_source,b=!(!((d=e.conditions)===null||d===void 0||(d=d.utm)===null||d===void 0)&&d.utm_medium)||((f=e.conditions)===null||f===void 0||(f=f.utm)===null||f===void 0?void 0:f.utm_medium)==i.utm_medium,x=!(!((p=e.conditions)===null||p===void 0||(p=p.utm)===null||p===void 0)&&p.utm_term)||((g=e.conditions)===null||g===void 0||(g=g.utm)===null||g===void 0?void 0:g.utm_term)==i.utm_term;return v&&b&&x&&y}return!1}static qf(e,...n){Ce.info(`[WebExperiments] ${e}`,n)}Bf(e,n,i){this._is_bot()?br.qf(QI):n!=="control"?i.forEach(r=>{if(r.selector){var o;br.qf(`applying transform of variant ${n} for experiment ${e} `,r);const l=(o=document)===null||o===void 0?void 0:o.querySelectorAll(r.selector);l?.forEach(u=>{const d=u;r.html&&(d.innerHTML=r.html),r.css&&d.setAttribute("style",r.css)})}}):br.qf("Control variants leave the page unmodified.")}_is_bot(){return mi&&this._instance?R6(mi,this.Rr.custom_blocked_useragents):void 0}}},Cw),Y7={conversations:class{constructor(t){this._instance=t,this.Vf=void 0,this._conversationsManager=null,this.Gf=!1,this.ne=null,this.Zf=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(this._instance.config.disable_conversations||(this.Qf=t.ok,!t.ok))return;const e=t.config.conversations;it(e)||(Or(e)?this.Vf=e:(this.Vf=e.enabled,this.ne=e),this.loadIfEnabled())}reset(){var t;(t=this._conversationsManager)===null||t===void 0||t.reset(),this._conversationsManager=null,this.Vf=void 0,this.ne=null,this.Qf=void 0,this.Zf=!1}loadIfEnabled(){if(this._conversationsManager||this.Gf||this._instance.config.disable_conversations||HT(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())return;const t=qe?.__PosthogExtensions__;if(t&&!le(this.Vf)&&this.Vf)if(this.ne&&this.ne.token){this.Gf=!0;try{const e=t.initConversations;if(e)return this.Jf(e),void(this.Gf=!1);const n=t.loadExternalDependency;if(!n)return void this.Kf(BC);n(this._instance,"conversations",i=>{i||!t.initConversations?this.Kf("Could not load conversations script",i):this.Jf(t.initConversations),this.Gf=!1})}catch(e){this.Kf("Error initializing conversations",e),this.Gf=!1}}else $s.error("Conversations enabled but missing token in remote config.")}Jf(t){if(this.ne)try{this._conversationsManager=t(this.ne,this._instance),this.Zf=!1,$s.info("Conversations loaded successfully")}catch(e){this.Kf("Error completing conversations initialization",e)}else $s.error("Cannot complete initialization: remote config is null")}Kf(t,e){$s.error(t,e),this._conversationsManager=null,this.Gf=!1,this.Zf=!0}show(){this._conversationsManager?this._conversationsManager.show():$s.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Vf===!0&&!On(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":HT(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.Qf===!1?"remote_config_failed":le(this.Vf)?this.Qf?"disabled_in_project":"remote_config_pending":this.Vf?it(this.ne)||!this.ne.token?"missing_token":qe?.__PosthogExtensions__?this.Gf?"initializing":this.Zf?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,n){var i=this;return _n(function*(){return i._conversationsManager?i._conversationsManager.sendMessage(t,e,n):($s.warn(qc),null)})()}getMessages(t,e){var n=this;return _n(function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):($s.warn(qc),null)})()}markAsRead(t){var e=this;return _n(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):($s.warn(qc),null)})()}getTickets(t){var e=this;return _n(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):($s.warn(qc),null)})()}requestRestoreLink(t){var e=this;return _n(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):($s.warn(qc),null)})()}restoreFromToken(t){var e=this;return _n(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):($s.warn(qc),null)})()}restoreFromUrlToken(){var t=this;return _n(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():($s.warn(qc),null)})()}getCurrentTicketId(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.getWidgetSessionId())!==null&&t!==void 0?t:null}Sh(){var t;(t=this._conversationsManager)===null||t===void 0||t.setIdentity()}xh(){var t;(t=this._conversationsManager)===null||t===void 0||t.clearIdentity()}}},Q7={logs:class{constructor(t){var e;this._instance=t,this.name="logs",this.Xf=!1,this.Yf=!1,this.tp=!1,this.$=$n("[logs]"),this.ep=z(z({},this.$),{},{error:(...n)=>{n.some(nz)||this.$.error(...n)}}),this.al=[],this.np=[],this.hd=0,this.Io=!1,this.sp=[],this.rp=[],this.op=!1,this.ap=!1,this.lp=()=>{var n,i;this.Io||(this.hd=0,(n=this.up)===null||n===void 0||n.onReconnect(),(i=this.hp)===null||i===void 0||i.onReconnect())},this._instance&&(!((e=this._instance.config.logs)===null||e===void 0)&&e.captureConsoleLogs)&&(this.Xf=!0),G&&Ht(G,"online",this.lp)}cp(t,e,n,i){var r;const o=ez((r=this._instance)===null||r===void 0||(r=r.config)===null||r===void 0?void 0:r.logs,n);return[new jX(this.dp(t,e),o,this.ep,()=>this.vp(),l=>l(),void 0,i),o]}fp(){var t;const e=(t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.logs;var n;return this.up&&this.pp===e||((n=this.up)===null||n===void 0||n.reset(),this.pp=e,[this.up,this.gp]=this.cp(()=>this.al,i=>{this.al=i})),this.up}mp(){var t;const e=(t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.logs;var n;return this.hp&&this.yp===e||((n=this.hp)===null||n===void 0||n.reset(),this.yp=e,[this.hp,this.bp]=this.cp(()=>this.np,i=>{this.np=i},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},tz)),this.hp}setup(t){var e;if(this.Io)return;this.wo=t,!((e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0||(e=e.logs)===null||e===void 0)&&e.captureConsoleLogs&&(this.Xf=!0),(this.Xf||this._p()&&this.wp())&&this.kp();let n=!1;const i=t.onRemoteConfig(r=>{var o;n=r.ok&&((o=r.config.logs)===null||o===void 0?void 0:o.captureConsoleLogs)===!0,this.onRemoteConfig(r)});this.Io?i.dispose():(this.Po=i,n||this.loadIfEnabled())}dispose(){var t,e,n,i;this.Io||(this.Io=!0,this.Sp(),(t=this.Po)===null||t===void 0||t.dispose(),this.Po=void 0,this.wo=void 0,this.tp=!1,G?.removeEventListener("online",this.lp),(e=this.xp)===null||e===void 0||e.call(this),this.xp=void 0,(n=this.up)===null||n===void 0||n.reset(),(i=this.hp)===null||i===void 0||i.reset())}onRemoteConfig(t){var e,n;if(this.Io)return;const i=t.ok?(e=t.config.logs)===null||e===void 0?void 0:e.captureConsoleLogs:void 0;it(i)?this.Cp():((n=this._instance)===null||n===void 0||(n=n.persistence)===null||n===void 0||n.register({$logs_capture_enabled_server_side:!!i}
18),i?(this.Xf=!0,this.Yf||this.kp(),this.loadIfEnabled()):this.Cp())}reset(){var t,e,n,i;this.Sp(),(t=this.up)===null||t===void 0||t.clearQueue(),this.al=[],(e=this.up)===null||e===void 0||e.reset(),(n=this.hp)===null||n===void 0||n.clearQueue(),this.np=[],(i=this.hp)===null||i===void 0||i.reset(),this.hd=0}captureLog(t){this.Io||this.fp().captureLog(t)}captureConsoleLog(t){this.Io||this.mp().captureLog(t)}captureBufferedConsoleLog(t,e,n){this.Io||this.mp().captureLog(t,{context:e,occurredAtMs:n})}wp(){var t;return!!(!((t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||(t=t.props)===null||t===void 0)&&t[TU])}_p(){var t,e,n;return!(!((t=this._instance)===null||t===void 0||(e=t.nl)===null||e===void 0)&&e.call(t))||!!(!((n=qe._POSTHOG_REMOTE_CONFIG)===null||n===void 0||(n=n[this._instance.config.token])===null||n===void 0)&&n.config)}$h(){var t;this.Sp(),(t=this.hp)===null||t===void 0||t.clearQueue(),this.np=[]}Cp(){this.Xf||this.Sp()}kp(){var t;if(this.op||!qe?.console)return;const e=ez((t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.logs).maxBufferSize;let n=!0;this.rp.push(()=>{n=!1});for(const i of z7){let r;try{r=D7(qe.console[i])}catch{continue}r&&this.rp.push(xm(qe.console,i,o=>{const l=(...u)=>{try{n&&this.$p(i,u,e)}catch{}return o.apply(qe.console,u)};return l.__rrweb_original__=r,l}))}this.op=!0,this.Tp=setTimeout(()=>{this.Sp()},3e4)}$p(t,e,n){var i;if(this.op&&!this.ap&&e.length!==0)if(!((i=this._instance)===null||i===void 0)&&i.is_capturing()){if(n>this.sp.length){this.ap=!0;try{this.sp.push({level:t,args:e,occurredAtMs:Date.now(),context:this.vp()})}finally{this.ap=!1}}}else this.Sp()}Sp(){if(this.sp=[],this.op){this.op=!1,this.Tp&&(clearTimeout(this.Tp),this.Tp=void 0);for(const t of this.rp)t();this.rp=[]}}Ip(){const t=this.sp;return this.Sp(),t}get logger(){return this.Mp||(this.Mp={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.Mp}flushLogs(t){t?this.Ep(t):(this.up&&this.up.flush().catch(e=>this.Pp(e)),this.hp&&this.hp.flush().catch(e=>this.Pp(e)))}Pp(t){nz(t)||this.$.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(this.Io||!this.Xf||this.Yf||this.tp)return;const t=qe?.__PosthogExtensions__;if(!t)return this.$.error("PostHog Extensions not found."),void this.Sp();const e=t.loadExternalDependency;if(!e)return this.$.error(BC),void this.Sp();this.tp=!0;try{e(this._instance,"logs",n=>{if(this.tp=!1,this.Io||!this.Xf)return;const i=t.logs;if(n||!i?.initializeLogs)this.$.error("Could not load logs script",n),this.Sp();else{var r;const u=this.Ip();var o,l;this.xp=i.initializeLogs((r=this.wo)!==null&&r!==void 0?r:this._instance),this.Yf=!0,u.length>0&&((o=i.replayConsoleBuffer)===null||o===void 0||o.call(i,(l=this.wo)!==null&&l!==void 0?l:this._instance,u))}})}catch(n){throw this.tp=!1,n}}dp(t,e){const n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:i=>i===Vo.LogsQueue?t():void 0,setPersistedProperty(i,r){var o;i===Vo.LogsQueue&&e((o=r)!==null&&o!==void 0?o:[])},js:i=>this.js(i),getLibraryId:()=>li.LIB_NAME,getLibraryVersion:()=>li.LIB_VERSION}}js(t){return new Promise(e=>{if(t6(this.hd,3))return void e({kind:"fatal",error:q1(void 0,"logs endpoint is unreachable, dropping batch")});let n=!1;const i=o=>{n||(n=!0,clearTimeout(r),e(o))},r=setTimeout(()=>{this.$.warn("Logs request timed out before receiving a response"),i({kind:"retry-later",error:q1(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.Rp(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:o=>{const l=o.statusCode;if(this.Ap(l),l>=200&&300>l)i({kind:"ok"});else if(l===413)i({kind:"too-large"});else if(l!==0&&l!==408&&l!==429&&500>l)i({kind:"fatal",error:new Error(`logs request failed with status ${l}`)});else{var u;l===0?(o.error||this.$.warn("Logs request failed before receiving an HTTP response"),i({kind:"retry-later",error:q1(o.error,"logs request failed before receiving an HTTP response")})):i({kind:"retry-later",error:(u=o.error)!==null&&u!==void 0?u:new Error(`logs request failed with status ${l}`)})}}})})}Ap(t){(t!==0||this._instance.__loaded)&&(this.hd=n6(t,this.hd,3,()=>this.$.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}Ep(t){this.al.length>0&&this.Fp(t,this.al,this.gp,li.LIB_NAME,e=>{this.al=e}),this.np.length>0&&this.Fp(t,this.np,this.bp,tz,e=>{this.np=e})}Fp(t,e,n,i,r){if(e.length===0)return;const o=e.map(u=>u.record);r([]);const l=_U(o,yU(n,li.LIB_NAME,li.LIB_VERSION),i,li.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Rp(),data:l,compression:"best-available",batchKey:"logs",transport:t})}Rp(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}vp(){var t;const e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){const{sessionId:n,windowId:i,sessionStartTimestamp:r,lastActivityTimestamp:o}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);e.sessionId=n,e.windowId=i,it(r)||(e.sessionStartTimestamp=r),it(o)||(e.lastActivityTimestamp=o)}if(!(qe==null||(t=qe.location)===null||t===void 0)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?cc(qe.location.href):qe.location.href),this._instance.featureFlags){const n=this._instance.featureFlags.getFlags();n&&n.length>0&&(e.activeFeatureFlags=n)}return e}}},eQ={metrics:class{constructor(t){this._instance=t,this.$=$n("[metrics]"),this.Io=!1}initialize(){this.onConfigChange()}onConfigChange(){var t;if(this.Io)return;const e=!!(!((t=this._instance.config.metrics)===null||t===void 0)&&t.network);e&&!this.Op?this.Op=(n=>{let i=!0;const r=()=>i?(u=>{var d;const f=(d=u.config.metrics)===null||d===void 0?void 0:d.network;return f===!0?{}:f||void 0})(n):void 0,o=F7(n,r),l=H7(n,r);return()=>{i=!1,o(),l()}})(this._instance):!e&&this.Op&&(this.Op(),this.Op=void 0)}fp(){var t;const e=(t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.metrics;var n;return this.up&&this.pp===e||((n=this.up)===null||n===void 0||n.reset(),this.pp=e,this.up=new PX(this.dp(),(function(i){var r,o,l,u,d;const f=i?.resourceAttributes;return{serviceName:(r=f?.["service.name"])!==null&&r!==void 0?r:i?.serviceName,serviceVersion:(o=f?.["service.version"])!==null&&o!==void 0?o:i?.serviceVersion,environment:(l=f?.["deployment.environment"])!==null&&l!==void 0?l:i?.environment,resourceAttributes:f,beforeSend:i?.beforeSend,flushIntervalMs:(u=i?.flushIntervalMs)!==null&&u!==void 0?u:1e4,maxSeriesPerFlush:(d=i?.maxSeriesPerFlush)!==null&&d!==void 0?d:1e3}})(e),this.$)),this.up}
18count(t,e=1,n){this.fp().count(t,e,n)}gauge(t,e,n){this.fp().gauge(t,e,n)}histogram(t,e,n){this.fp().histogram(t,e,n)}flush(t){if(!this.up)return Promise.resolve();if(t){const e=this.up.drainWindow();return e&&this.Ys(e,t),Promise.resolve()}return this.up.flush().catch(e=>this.$.error("PostHog metrics flush failed:",e))}reset(){var t;(t=this.up)===null||t===void 0||t.reset()}dispose(){var t,e;this.Io=!0,(t=this.Op)===null||t===void 0||t.call(this),this.Op=void 0,(e=this.up)===null||e===void 0||e.reset()}dp(){const t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Ys:n=>e.Ys(n),getLibraryId:()=>li.LIB_NAME,getLibraryVersion:()=>li.LIB_VERSION}}Ys(t,e){return new Promise(n=>{let i=!1;const r=l=>{i||(i=!0,clearTimeout(o),n(l))},o=setTimeout(()=>r({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(z(z({method:"POST",url:this.Dp(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e}),{},{fireCallbackOnDrop:!0,callback(l){const u=l.statusCode;if(u>=200&&300>u)r({kind:"ok"});else if(u===413)r({kind:"too-large"});else if(u!==0&&u!==408&&u!==429&&500>u)r({kind:"fatal",error:new Error(`metrics request failed with status ${u}`)});else{var d;r({kind:"retry-later",error:(d=l.error)!==null&&d!==void 0?d:new Error(`metrics request failed with status ${u}`)})}}}))})}Dp(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}};Vg.__defaultExtensionClasses=z({},z(z(z(z(z(z(z(z(z(z(z(z(z({},Cw),K7),Z7),W7),q7),V7),G7),B7),J7),X7),Y7),Q7),eQ));const tQ=(function(){li.SDK_DIST_CHANNEL="npm";const t=Wg[gg]=new Vg;return(function(){function e(){e.done||(e.done=!0,C6=!1,Wt(Wg,function(n){n._dom_loaded()}))}he?.addEventListener?he.readyState==="complete"?e():Ht(he,"DOMContentLoaded",e,{capture:!1}):G&&Ce.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})();var sn=tQ,nQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(i[o]=r[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function i(){this.constructor=e}e.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}})();var iQ=function(t,e,n){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:n?"".concat(n," ",e):e})},y0,iz="__POSTHOG_REACT_SHARED_STATE__",rz=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},Sm;try{Sm=rz[iz]=rz[iz]||new WeakMap}catch{Sm=new WeakMap}Sm.has(M.createContext)||Sm.set(M.createContext,{});var Tu=Sm.get(M.createContext),t2;function rQ(t){(!Tu.defaultPostHogInstance||Tu.defaultPostHogInstance===t2)&&(Tu.defaultPostHogInstance=t),t2=t}function n2(){return t2}Tu.context||(Tu.context=M.createContext({get client(){return n2()||Tu.defaultPostHogInstance},bootstrap:void 0}));var F6=Tu.context;function H6(t,e,n){if(n===void 0&&(n=new WeakMap),t===e)return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(n.has(t)&&n.get(t)===e)return!0;n.set(t,e);var i=Object.keys(t),r=Object.keys(e);if(i.length!==r.length)return!1;for(var o=0,l=i;o<l.length;o++){var u=l[o];if(!r.includes(u)||!H6(t[u],e[u],n))return!1}return!0}function sQ(t){var e,n,i=t.children,r=t.client,o=t.apiKey,l=t.options,u=M.useRef(null),d=M.useMemo(function(){if(r)return o&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),l&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),r;var f=n2();return o||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),f},[r,o,JSON.stringify(l)]);return M.useEffect(function(){if(!(r||!o)){var f=n2(),p=u.current;p?(o!==p.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),l&&!H6(l,p.options)&&f.set_config(l),u.current={apiKey:o,options:l??{}}):(f.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),f.init(o,l),u.current={apiKey:o,options:l??{}})}},[r,o,JSON.stringify(l)]),Na.createElement(F6.Provider,{value:{client:d,bootstrap:(e=l?.bootstrap)!==null&&e!==void 0?e:(n=r?.config)===null||n===void 0?void 0:n.bootstrap}},i)}var V1=function(t){return typeof t=="function"},oQ=function(t){return t===void 0},T_=function(t){var e=Object.prototype.toString.call(t);
18return t instanceof Error||e==="[object Error]"||e==="[object Exception]"||e==="[object DOMException]"||e==="[object DOMError]"},aQ=function(t,e){try{Object.defineProperty(t,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch{}},lQ=function(t,e){for(var n=new WeakSet,i=t;!n.has(i);){if(n.add(i),!T_(i.cause)){oQ(i.cause)||(e.cause=i.cause),i.cause=e;return}i=i.cause}},cQ=function(t,e){if(!e)return t;var n=new Error(T_(t)?t.message:"Primitive value captured as exception: ".concat(String(t)));return aQ(n,"React ErrorBoundary ".concat(T_(t)?t.name:"Error")),n.stack=e,T_(t)?(lQ(t,n),t):n},sz={componentStack:null,exceptionEvent:null,error:null},uQ={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."};y0=(function(t){nQ(e,t);function e(n){var i=t.call(this,n)||this;return i._resetError=function(){i.setState(sz)},i.state=sz,i}return e.prototype.componentDidCatch=function(n,i){var r=this.props.additionalProperties,o;V1(r)?o=r(n,i):typeof r=="object"&&(o=r);var l=this.context.client,u=i.componentStack,d=l.captureException(cQ(n,u),o);this.setState({error:n,componentStack:u??null,exceptionEvent:d})},e.prototype.render=function(){var n=this.props,i=n.children,r=n.fallback,o=this.state;if(o.componentStack==null)return V1(i)?i():i;var l=V1(r)?Na.createElement(r,{error:o.error,componentStack:o.componentStack,exceptionEvent:o.exceptionEvent,resetError:this._resetError}):r;return Na.isValidElement(l)?l:(console.warn(uQ.INVALID_FALLBACK),Na.createElement(Na.Fragment,null))},e})(Na.Component),iQ(y0,"PostHogErrorBoundary"),(function(){y0.contextType=F6})();rQ(sn);const os=(t,e)=>{const{o:n,i,u:r}=t;let o=n,l;const u=(p,g)=>{const v=o,y=p,b=g||(i?!i(v,y):v!==y);return(b||r)&&(o=y,l=v),[o,b,l]};return[e?p=>u(e(o,l),p):u,p=>[o,!!p,l]]},dQ=typeof window<"u"&&typeof HTMLElement<"u"&&!!window.document,Fr=dQ?window:{},K6=Math.max,hQ=Math.min,i2=Math.round,nc=Math.abs,oz=Math.sign,Z6=Fr.cancelAnimationFrame,rO=Fr.requestAnimationFrame,sO=Fr.setTimeout,W6=Fr.clearTimeout,Ow=t=>typeof Fr[t]<"u"?Fr[t]:void 0,fQ=Ow("MutationObserver"),az=Ow("IntersectionObserver"),xh=Ow("ResizeObserver"),mg=Ow("ScrollTimeline"),oO=t=>t===void 0,Rw=t=>t===null,sc=t=>typeof t=="number",hf=t=>typeof t=="string",$w=t=>typeof t=="boolean",xo=t=>typeof t=="function",Hs=t=>Array.isArray(t),$b=t=>typeof t=="object"&&!Hs(t)&&!Rw(t),aO=t=>{const e=!!t&&t.length,n=sc(e)&&e>-1&&e%1==0;return Hs(t)||!xo(t)&&n?e>0&&$b(t)?e-1 in t:!0:!1},km=t=>!!t&&t.constructor===Object,Ab=t=>t instanceof HTMLElement,Aw=t=>t instanceof Element;function gn(t,e){if(aO(t))for(let n=0;n<t.length&&e(t[n],n,t)!==!1;n++);else t&&gn(Object.keys(t),(n=>e(t[n],n,t)));return t}const q6=(t,e)=>t.indexOf(e)>=0,Yh=(t,e)=>t.concat(e),qn=(t,e,n)=>(!hf(e)&&aO(e)?Array.prototype.push.apply(t,e):t.push(e),t),pc=t=>Array.from(t||[]),lO=t=>Hs(t)?t:!hf(t)&&aO(t)?pc(t):[t],jb=t=>!!t&&!t.length,Pb=t=>pc(new Set(t)),gs=(t,e,n)=>{gn(t,r=>r?r.apply(void 0,e||[]):!0),n||(t.length=0)},V6="paddingTop",B6="paddingRight",G6="paddingLeft",J6="paddingBottom",X6="marginLeft",Y6="marginRight",Q6="marginBottom",cO="overflowX",uO="overflowY",jw="width",Pw="height",Da="visible",vo="hidden",Cu="scroll",pQ=t=>{const e=String(t||"");return e?e[0].toUpperCase()+e.slice(1):""},Nw=(t,e,n,i)=>{if(t&&e){let r=!0;return gn(n,(o=>{const l=t[o],u=e[o];l!==u&&(r=!1)})),r}return!1},eF=(t,e)=>Nw(t,e,["w","h"]),C_=(t,e)=>Nw(t,e,["x","y"]),gQ=(t,e)=>Nw(t,e,["t","r","b","l"]),lt=(t,...e)=>t.bind(0,...e),Sh=t=>{let e;const n=t?sO:rO,i=t?W6:Z6;return[r=>{i(e),e=n((()=>r()),xo(t)?t():t)},()=>i(e)]},lz=t=>{const e=xo(t)?t():t;if(sc(e)){const n=e?sO:rO,i=e?W6:Z6;return r=>{const o=n((()=>r()),e);return()=>{i(o)}}}return e&&e._},tF=(t,e)=>{const{p:n,v:i,S:r,m:o}=e||{};let l,u,d,f;const p=function(x){u&&u(),l&&l(),f=u=l=d=void 0,t.apply(this,x)},g=b=>o&&d?o(d,b):b,v=()=>{u&&d&&p(g(d)||d)},y=function(){const x=pc(arguments),S=lz(n);if(S){const k=typeof r=="function"?r():r,T=lz(i),A=g(x)||x,$=p.bind(0,A);u&&u(),k&&!f?($(),f=!0,u=S((()=>f=void 0))):(u=S($),T&&!l&&(l=T(v))),d=A}else p(x)};return y.O=v,y},nF=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Dr=t=>t?Object.keys(t):[],Xt=(t,e,n,i,r,o,l)=>{const u=[e,n,i,r,o,l];return(typeof t!="object"||Rw(t))&&!xo(t)&&(t={}),gn(u,(d=>{gn(d,((f,p)=>{const g=d[p];if(t===g)return!0;const v=Hs(g);if(g&&km(g)){const y=t[p];let b=y;v&&!Hs(y)?b=[]:!v&&!km(y)&&(b={}),t[p]=Xt(b,g)}else t[p]=v?g.slice():g}))})),t},iF=(t,e)=>gn(Xt({}
18,t),((n,i,r)=>{n===void 0?delete r[i]:n&&km(n)&&(r[i]=iF(n))})),dO=t=>!Dr(t).length,Em=()=>{},rF=(t,e,n)=>K6(t,hQ(e,n)),Ou=t=>Pb((Hs(t)?t:(t||"").split(" ")).filter((e=>e))),hO=(t,e)=>t&&t.getAttribute(e),cz=(t,e)=>t&&t.hasAttribute(e),ja=(t,e,n)=>{gn(Ou(e),(i=>{t&&t.setAttribute(i,String(n||""))}))},qo=(t,e)=>{gn(Ou(e),(n=>t&&t.removeAttribute(n)))},Mw=(t,e)=>{const n=Ou(hO(t,e)),i=lt(ja,t,e),r=(o,l)=>{const u=new Set(n);return gn(Ou(o),(d=>{u[l](d)})),pc(u).join(" ")};return{C:o=>i(r(o,"delete")),$:o=>i(r(o,"add")),H:o=>{const l=Ou(o);return l.reduce(((u,d)=>u&&n.includes(d)),l.length>0)}}},sF=(t,e,n)=>(Mw(t,e).C(n),lt(fO,t,e,n)),fO=(t,e,n)=>(Mw(t,e).$(n),lt(sF,t,e,n)),Nb=(t,e,n,i)=>(i?fO:sF)(t,e,n),pO=(t,e,n)=>Mw(t,e).H(n),oF=t=>Mw(t,"class"),aF=(t,e)=>{oF(t).C(e)},gO=(t,e)=>(oF(t).$(e),lt(aF,t,e)),lF=(t,e)=>{const n=e?Aw(e)&&e:document;return n?pc(n.querySelectorAll(t)):[]},mQ=(t,e)=>{const n=e?Aw(e)&&e:document;return n&&n.querySelector(t)},r2=(t,e)=>Aw(t)&&t.matches(e),cF=t=>r2(t,"body"),s2=t=>t?pc(t.childNodes):[],Tm=t=>t&&t.parentElement,kh=(t,e)=>Aw(t)&&t.closest(e),o2=t=>document.activeElement,vQ=(t,e,n)=>{const i=kh(t,e),r=t&&mQ(n,i),o=kh(r,e)===i;return i&&r?i===t||r===t||o&&kh(kh(t,n),e)!==i:!1},Qh=t=>{gn(lO(t),(e=>{const n=Tm(e);e&&n&&n.removeChild(e)}))},Lr=(t,e)=>lt(Qh,t&&e&&gn(lO(e),(n=>{n&&t.appendChild(n)})));let uF;const yQ=()=>uF,_Q=t=>{uF=t},zh=t=>{const e=document.createElement("div");return ja(e,"class",t),e},dF=t=>{const e=zh(),n=yQ(),i=t.trim();return e.innerHTML=n?n.createHTML(i):i,gn(s2(e),(r=>Qh(r)))},uz=(t,e)=>t.getPropertyValue(e)||t[e]||"",hF=t=>{const e=t||0;return isFinite(e)?e:0},_0=t=>hF(parseFloat(t||"")),a2=t=>Math.round(t*1e4)/1e4,fF=t=>`${a2(hF(t))}px`;function Cm(t,e){t&&e&&gn(e,((n,i)=>{try{const r=t.style,o=Rw(n)||$w(n)?"":sc(n)?fF(n):n;i.indexOf("--")===0?r.setProperty(i,o):r[i]=o}catch{}}))}function na(t,e,n){const i=hf(e);let r=i?"":{};if(t){const o=Fr.getComputedStyle(t,n)||t.style;r=i?uz(o,e):pc(e).reduce(((l,u)=>(l[u]=uz(o,u),l)),r)}return r}const dz=(t,e,n)=>{const i=e?`${e}-`:"",r=n?`-${n}`:"",o=`${i}top${r}`,l=`${i}right${r}`,u=`${i}bottom${r}`,d=`${i}left${r}`,f=na(t,[o,l,u,d]);return{t:_0(f[o]),r:_0(f[l]),b:_0(f[u]),l:_0(f[d])}},B1=(t,e)=>`translate${$b(t)?`(${t.x},${t.y})`:`${e?"X":"Y"}(${t})`}`,bQ=t=>!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length),wQ={w:0,h:0},Iw=(t,e)=>e?{w:e[`${t}Width`],h:e[`${t}Height`]}:wQ,xQ=t=>Iw("inner",t||Fr),Dh=lt(Iw,"offset"),pF=lt(Iw,"client"),Mb=lt(Iw,"scroll"),mO=t=>{const e=parseFloat(na(t,jw))||0,n=parseFloat(na(t,Pw))||0;return{w:e-i2(e),h:n-i2(n)}},G1=t=>t.getBoundingClientRect(),SQ=t=>!!t&&bQ(t),l2=t=>!!(t&&(t[Pw]||t[jw])),gF=(t,e)=>{const n=l2(t);return!l2(e)&&n},hz=(t,e,n,i)=>{gn(Ou(e),(r=>{t&&t.removeEventListener(r,n,i)}))},Tn=(t,e,n,i)=>{var r;const o=(r=i&&i.D)!=null?r:!0,l=i&&i.I||!1,u=i&&i.A||!1,d={passive:o,capture:l};return lt(gs,Ou(e).map((f=>{const p=u?g=>{hz(t,f,p,l),n&&n(g)}:n;return t&&t.addEventListener(f,p,d),lt(hz,t,f,p,l)})))},mF=t=>t.stopPropagation(),c2=t=>t.preventDefault(),vF=t=>mF(t)||c2(t),Xo=(t,e)=>{const{x:n,y:i}=sc(e)?{x:e,y:e}:e||{};sc(n)&&(t.scrollLeft=n),sc(i)&&(t.scrollTop=i)},us=t=>({x:t.scrollLeft,y:t.scrollTop}),yF=()=>({T:{x:0,y:0},k:{x:0,y:0}}),kQ=(t,e)=>{const{T:n,k:i}=t,{w:r,h:o}=e,l=(g,v,y)=>{let b=oz(g)*y,x=oz(v)*y;if(b===x){const S=nc(g),k=nc(v);x=S>k?0:x,b=S<k?0:b}return b=b===x?0:b,[b+0,x+0]},[u,d]=l(n.x,i.x,r),[f,p]=l(n.y,i.y,o);return{T:{x:u,y:f},k:{x:d,y:p}}},J1=({T:t,k:e})=>{const n=(i,r)=>i===0&&i<=r;return{x:n(t.x,e.x),y:n(t.y,e.y)}},fz=({T:t,k:e},n)=>{const i=(r,o,l)=>rF(0,1,(r-l)/(r-o)||0);return{x:i(t.x,e.x,n.x),y:i(t.y,e.y,n.y)}},u2=t=>{t&&t.focus&&t.focus({preventScroll:!0,focusVisible:!1})},pz=(t,e)=>{gn(lO(e),t)},d2=t=>{const e=new Map,n=(o,l)=>{if(o){const u=e.get(o);pz((d=>{u&&u[d?"delete":"clear"](d)}),l)}else e.forEach((u=>{u.clear()})),e.clear()},i=(o,l)=>{if(hf(o)){const f=e.get(o)||new Set;return e.set(o,f),pz((p=>{xo(p)&&f.add(p)}),l),lt(n,o,l)}$w(l)&&l&&n();const u=Dr(o),d=[];return gn(u,(f=>{const p=o[f];p&&qn(d,i(f,p))})),lt(gs,d)},r=(o,l)=>{gn(pc(e.get(o)),(u=>{l&&!jb(l)?u.apply(0,l):u()}))};return i(t||{}),[i,n,r]},_F={},bF={},EQ=t=>{gn(t,(e=>gn(e,((n,i)=>{_F[i]=e[i]}))))},wF=(t,e,n)=>Dr(t).map((i=>{const{static:r,instance:o}=t[i],[l,u,d]=n||[],f=n?o:r;if(f){const p=n?f(l,u,e):f(e);return(d||bF)[i]=p}})),TQ=(t,e)=>t[e],ff=t=>TQ(bF,t),CQ="__osOptionsValidationPlugin",pf="data-overlayscrollbars",O_="os-environment",b0=`${O_}-scrollbar-hidden`,X1=`${pf}-initialize`,R_="noClipping",gz=`${pf}-body`,oc=pf,OQ="host",Pa=`${pf}-viewport`,RQ=cO,$Q=uO,AQ="arrange",xF="measuring",jQ="scrolling",SF="scrollbarHidden",PQ="noContent",h2=`${pf}-padding`,mz=`${pf}-content`,vO="os-size-observer",NQ=`${vO}-appear`,MQ=`${vO}-listener`,IQ="os-trinsic-observer",zQ="os-theme-none",vs="os-scrollbar",DQ=`${vs}-rtl`,LQ=`${vs}-horizontal`,UQ=`${vs}-vertical`,kF=`${vs}-track`,yO=`${vs}-handle`,FQ=`${vs}-visible`,HQ=`${vs}-cornerless`,vz=`${vs}-interaction`,yz=`${vs}-unusable`,f2=`${vs}-auto-hide`,KQ=`${f2}-hidden`,_z=`${vs}-wheel`,ZQ=`${kF}-interactive`,WQ=`${yO}-interactive`,qQ="__osSizeObserverPlugin",VQ=(t,e)=>{const{M:n}=e,[i,r]=t("showNativeOverlaidScrollbars");return[i&&n.x&&n.y,r]},Eh=t=>t.indexOf(Da)===0,BQ=t=>t.replace(`${Da}-`,""),p2=(t,e)=>{if(t==="auto")return e?Cu:vo;const n=t||vo;return[vo,Cu,Da].includes(n)?n:vo},GQ=(t,e)=>{const{overflowX:n,overflowY:i}=na(t,[cO,uO]);return{x:p2(n,e.x),y:p2(i,e.y)}},_O="__osScrollbarsHidingPlugin",JQ="__osClickScrollPlugin",bz=t=>JSON.stringify(t,((e,n)=>{if(xo(n))throw 0;return n})),wz=(t,e)=>t?`${e}`.split(".").reduce(((n,i)=>n&&nF(n,i)?n[i]:void 0),t):void 0,XQ=[0,33],EF=[33,99],TF=[222,666,!0],YQ={paddingAbsolute:!1,showNativeOverlaidScrollbars:!1,update:{elementEvents:[["img","load"]],debounce:{mutation:XQ,resize:null,event:EF,env:TF},attributes:null,ignoreMutation:null,flowDirectionStyles:null},overflow:{x:"scroll",y:"scroll"},scrollbars:{theme:"os-theme-dark",visibility:"auto",autoHide:"never",autoHideDelay:1300,autoHideSuspend:!1,dragScroll:!0,
18clickScroll:!1,pointers:["mouse","touch","pen"]}},CF=(t,e)=>{const n={},i=Yh(Dr(e),Dr(t));return gn(i,(r=>{const o=t[r],l=e[r];if($b(o)&&$b(l))Xt(n[r]={},CF(o,l)),dO(n[r])&&delete n[r];else if(nF(e,r)&&l!==o){let u=!0;if(Hs(o)||Hs(l))try{bz(o)===bz(l)&&(u=!1)}catch{}u&&(n[r]=l)}})),n},Y1=(t,e,n)=>i=>[wz(t,i),n||wz(e,i)!==void 0];let OF;const QQ=()=>OF,eee=t=>{OF=t};let Q1;const tee=()=>{const t=(A,$,N)=>{Lr(document.body,A),Lr(document.body,A);const j=pF(A),O=Dh(A),L=mO($);return N&&Qh(A),{x:O.h-j.h+L.h,y:O.w-j.w+L.w}},e=A=>{let $=!1;const N=gO(A,b0);try{$=na(A,"scrollbar-width")==="none"||na(A,"display","::-webkit-scrollbar")==="none"}catch{}return N(),$},n=`.${O_}{scroll-behavior:auto!important;position:fixed;opacity:0;visibility:hidden;overflow:scroll;height:200px;width:200px;z-index:-1}.${O_} div{width:200%;height:200%;margin:10px 0}.${b0}{scrollbar-width:none!important}.${b0}::-webkit-scrollbar,.${b0}::-webkit-scrollbar-corner{appearance:none!important;display:none!important;width:0!important;height:0!important}`,r=dF(`<div class="${O_}"><div></div><style>${n}</style></div>`)[0],o=r.firstChild,l=r.lastChild,u=QQ();u&&(l.nonce=u);const[d,,f]=d2(),[p,g]=os({o:t(r,o),i:C_},lt(t,r,o,!0)),[v]=g(),y=e(r),b={x:v.x===0,y:v.y===0},x={elements:{host:null,padding:!y,viewport:A=>y&&cF(A)&&A,content:!1},scrollbars:{slot:!0},cancel:{nativeScrollbarsOverlaid:!1,body:null}},S=Xt({},YQ),k=lt(Xt,{},S),T=lt(Xt,{},x),C={U:v,M:b,P:y,J:!!mg,G:lt(d,"r"),K:T,Z:A=>Xt(x,A)&&T(),tt:k,nt:A=>Xt(S,A)&&k(),ot:Xt({},x),st:Xt({},S)};if(qo(r,"style"),Qh(r),Tn(Fr,"resize",(()=>{f("r",[])})),xo(Fr.matchMedia)&&!y&&(!b.x||!b.y)){const A=$=>{const N=Fr.matchMedia(`(resolution: ${Fr.devicePixelRatio}dppx)`);Tn(N,"change",(()=>{$(),A($)}),{A:!0})};A((()=>{const[$,N]=p();Xt(C.U,$),f("r",[N])}))}return C},aa=()=>(Q1||(Q1=tee()),Q1),nee=(t,e,n)=>{let i=!1;const r=n?new WeakMap:!1,o=()=>{i=!0},l=u=>{if(r&&n){const d=n.map((f=>{const[p,g]=f||[];return[g&&p?(u||lF)(p,t):[],g]}));gn(d,(f=>gn(f[0],(p=>{const g=f[1],v=r.get(p)||[];if(t.contains(p)&&g){const b=Tn(p,g,(x=>{i?(b(),r.delete(p)):e(x)}));r.set(p,qn(v,b))}else gs(v),r.delete(p)}))))}};return l(),[o,l]},xz=(t,e,n,i)=>{let r=!1;const{et:o,ct:l,rt:u,it:d,lt:f,ut:p}=i||{},[g,v]=nee(t,(()=>r&&n(!0)),u),y=o||[],b=l||[],x=Yh(y,b),S=(T,C)=>{if(!jb(C)){const A=f||Em,$=p||Em,N=[],j=[];let O=!1,L=!1;if(gn(C,(B=>{const{attributeName:V,target:ee,type:me,oldValue:ne,addedNodes:ce,removedNodes:Z}=B,ae=me==="attributes",ue=me==="childList",ge=t===ee,Re=ae&&V,xe=Re&&hO(ee,V||""),Ie=hf(xe)?xe:null,Oe=Re&&ne!==Ie,P=q6(b,V)&&Oe;if(e&&(ue||!ge)){const F=ae&&Oe,re=F&&d&&r2(ee,d),de=(re?!A(ee,V,ne,Ie):!ae||F)&&!$(B,!!re,t,i);gn(ce,(ke=>qn(N,ke))),gn(Z,(ke=>qn(N,ke))),L=L||de}!e&&ge&&Oe&&!A(ee,V,ne,Ie)&&(qn(j,V),O=O||P)})),v((B=>Pb(N).reduce(((V,ee)=>(qn(V,lF(B,ee)),r2(ee,B)?qn(V,ee):V)),[]))),e)return!T&&L&&n(!1),[!1];if(!jb(j)||O){const B=[Pb(j),O];return T||n.apply(0,B),B}}},k=new fQ(lt(S,!1));return[()=>(k.observe(t,{attributes:!0,attributeOldValue:!0,attributeFilter:x,subtree:e,childList:e,characterData:e}),r=!0,()=>{r&&(g(),k.disconnect(),r=!1)}),()=>{if(r)return S(!0,k.takeRecords())}]};let Vc=null;const RF=(t,e,n)=>{const{ft:i}=n||{},r=ff(qQ),[o]=os({o:!1,u:!0});return()=>{const l=[],d=dF(`<div class="${vO}"><div class="${MQ}"></div></div>`)[0],f=d.firstChild,p=g=>{const v=Hs(g)&&!jb(g);let y=!1,b=!1;if(v){const x=g[0],[S,,k]=o(x.contentRect),T=l2(S);b=gF(S,k),y=!b&&!T}else b=g===!0;y||e({_t:!0,ft:b})};if(xh){if(!$w(Vc)){const b=new xh(Em);b.observe(t,{get box(){Vc=!0}}),Vc=Vc||!1,b.disconnect()}const g=tF(p,{p:0,v:0}),v=b=>g(b),y=new xh(v);if(y.observe(Vc?t:f),qn(l,[()=>{y.disconnect()},!Vc&&Lr(t,d)]),Vc){const b=new xh(v);b.observe(t,{box:"border-box"}),qn(l,(()=>b.disconnect()))}}else if(r){const[g,v]=r(f,p,i);qn(l,Yh([gO(d,NQ),Tn(d,"animationstart",g),Lr(t,d)],v))}else return Em;return lt(gs,l)}},iee=(t,e)=>{let n;const i=d=>d.h===0||d.isIntersecting||d.intersectionRatio>0,r=zh(IQ),[o]=os({o:!1}),l=(d,f)=>{if(d){const p=o(i(d)),[,g]=p;return g&&!f&&e(p)&&[p]}},u=(d,f)=>l(f.pop(),d);return[()=>{const d=[];if(az)n=new az(lt(u,!1),{root:t}),n.observe(r),qn(d,(()=>{n.disconnect()}));else{const f=()=>{const p=Dh(r);l(p)};qn(d,RF(r,f)()),f()}return lt(gs,qn(d,Lr(t,r)))},()=>n&&u(!0,n.takeRecords())]},ree=(t,e,n,i)=>{let r,o,l,u,d,f,p,g;const v=`[${oc}]`,y=`[${Pa}]`,b=["id","class","style","open","wrap","cols","rows"],{dt:x,vt:S,L:k,gt:T,ht:C,V:A,bt:$,yt:N,wt:j,St:O}=t,L=Y=>na(Y,"direction")==="rtl",B=()=>{let Y,de,ke;const Ae=tF(i,{p:()=>Y,v:()=>de,S:()=>ke,m(oe,je){const[$e]=oe,[Le]=je;return[Yh(Dr($e),Dr(Le)).reduce(((Pe,ze)=>(Pe[ze]=$e[ze]||Le[ze],Pe)),{})]}}),Se=(oe,je)=>{if(Hs(je)){const[$e,Le,Pe]=je;Y=$e,de=Le,ke=Pe}else sc(je)?(Y=je,de=!1,ke=!1):(Y=!1,de=!1,ke=!1);Ae(oe)};return Se.O=Ae.O,Se},V={Ot:!1,B:L(x)},ee=aa(),me=ff(_O),[ne]=os({i:eF,o:{w:0,h:0}},(()=>{const Y=me&&me.R(t,e,V,ee,n).Y,ke=!($&&A)&&pO(S,oc,R_),Ae=!A&&N(AQ),Se=Ae&&us(T),oe=Se&&O(),je=j(xF,ke),$e=Ae&&Y&&Y(),Le=Mb(k),Pe=mO(k);return $e&&$e(),Xo(T,Se),oe&&oe(),ke&&je(),{w:Le.w+Pe.w,h:Le.h+Pe.h}})),ce=B(),Z=Y=>{const de=L(x);Xt(Y,{Ct:g!==de}),Xt(V,{B:de}),g=de},ae=(Y,de)=>
18{const[ke,Ae]=Y,Se={$t:Ae};return Xt(V,{Ot:ke}),de||i(Se),Se},ue=({_t:Y,ft:de})=>{const ke=de?i:ce,Ae={_t:Y||de,ft:de};Z(Ae),ke(Ae,o)},ge=(Y,de)=>{const[,ke]=ne(),Ae={xt:ke};return Z(Ae),ke&&!de&&ce(Ae,Y?l:r),Ae},Re=(Y,de,ke)=>{const Ae={Ht:de};return Z(Ae),de&&!ke&&ce(Ae,r),Ae},[xe,Ie]=C?iee(S,ae):[],Oe=!A&&RF(S,ue,{ft:!0}),[P,F]=xz(S,!1,Re,{ct:b,et:b}),re=A&&xh&&new xh((Y=>{const de=Y[Y.length-1].contentRect;ue({_t:!0,ft:gF(de,p)}),p=de}));return[()=>{re&&re.observe(S);const Y=Oe&&Oe(),de=xe&&xe(),ke=P(),Ae=ee.G((Se=>{const[,oe]=ne();ce({Et:Se,xt:oe,_t:$},u)}));return()=>{re&&re.disconnect(),Y&&Y(),de&&de(),f&&f(),ke(),Ae()}},({Dt:Y,zt:de,It:ke})=>{const Ae={},[Se]=Y("update.ignoreMutation"),[oe,je]=Y("update.attributes"),[$e,Le]=Y("update.elementEvents"),[Pe,ze]=Y("update.debounce"),Ge=Le||je,vt=de||ke,en=yt=>xo(Se)&&!!Se(yt);if(Ge){d&&d(),f&&f();const[yt,Kt]=xz(C||k,!0,ge,{et:Yh(b,oe||[]),rt:$e,it:v,ut:(tn,Xn)=>{const{target:kt,attributeName:bn}=tn;return(!Xn&&bn&&!A?vQ(kt,v,y):!1)||!!kh(kt,`.${vs}`)||en(tn)}});f=yt(),d=Kt}if(ze&&(ce.O(),Hs(Pe)||sc(Pe)?(r=Pe,o=!1,l=EF,u=TF):km(Pe)?(r=Pe.mutation,o=Pe.resize,l=Pe.event,u=Pe.env):(r=!1,o=!1,l=!1,u=!1)),vt){const yt=F(),Kt=Ie&&Ie(),tn=d&&d();yt&&Xt(Ae,Re(yt[0],yt[1],vt)),Kt&&Xt(Ae,ae(Kt[0],vt)),tn&&Xt(Ae,ge(tn[0],vt))}return Z(Ae),Ae},V]},$F=(t,e)=>xo(e)?e.apply(0,t):e,see=(t,e,n,i)=>{const r=oO(i)?n:i;return $F(t,r)||e.apply(0,t)},AF=(t,e,n,i)=>{const r=oO(i)?n:i,o=$F(t,r);return!!o&&(Ab(o)?o:e.apply(0,t))},oee=(t,e)=>{const{nativeScrollbarsOverlaid:n,body:i}=e||{},{M:r,P:o,K:l}=aa(),{nativeScrollbarsOverlaid:u,body:d}=l().cancel,f=n??u,p=oO(i)?d:i,g=(r.x||r.y)&&f,v=t&&(Rw(p)?!o:p);return!!g||!!v},aee=(t,e,n,i)=>{const r="--os-viewport-percent",o="--os-scroll-percent",l="--os-scroll-direction",{K:u}=aa(),{scrollbars:d}=u(),{slot:f}=d,{dt:p,vt:g,L:v,At:y,gt:b,bt:x,V:S}=e,{scrollbars:k}=y?{}:t,{slot:T}=k||{},C=[],A=[],$=[],N=AF([p,g,v],(()=>S&&x?p:g),f,T),j=xe=>{if(mg){let Ie=null,Oe=[];const P=new mg({source:b,axis:xe}),F=()=>{Ie&&Ie.cancel(),Ie=null};return{Mt:Y=>{const{Tt:de}=n,ke=J1(de)[xe],Ae=xe==="x",Se=[B1(0,Ae),B1(`calc(-100% + 100cq${Ae?"w":"h"})`,Ae)],oe=ke?Se:Se.reverse();return Oe[0]===oe[0]&&Oe[1]===oe[1]||(Oe=oe,F(),Ie=Y.kt.animate({clear:["left"],transform:oe},{timeline:P})),F}}}},O={x:j("x"),y:j("y")},L=()=>{const{Rt:xe,Vt:Ie}=n,Oe=(P,F)=>rF(0,1,P/(P+F)||0);return{x:Oe(Ie.x,xe.x),y:Oe(Ie.y,xe.y)}},B=(xe,Ie,Oe)=>{const P=Oe?gO:aF;gn(xe,(F=>{P(F.Lt,Ie)}))},V=(xe,Ie)=>{gn(xe,(Oe=>{const[P,F]=Ie(Oe);Cm(P,F)}))},ee=(xe,Ie,Oe)=>{const P=$w(Oe),F=P?Oe:!0,re=P?!Oe:!0;F&&B(A,xe,Ie),re&&B($,xe,Ie)},me=()=>{const xe=L(),Ie=Oe=>P=>[P.Lt,{[r]:a2(Oe)+""}];V(A,Ie(xe.x)),V($,Ie(xe.y))},ne=()=>{if(!mg){const{Tt:xe}=n,Ie=fz(xe,us(b)),Oe=P=>F=>[F.Lt,{[o]:a2(P)+""}];V(A,Oe(Ie.x)),V($,Oe(Ie.y))}},ce=()=>{const{Tt:xe}=n,Ie=J1(xe),Oe=P=>F=>[F.Lt,{[l]:P?"0":"1"}];V(A,Oe(Ie.x)),V($,Oe(Ie.y)),mg&&(A.forEach(O.x.Mt),$.forEach(O.y.Mt))},Z=()=>{if(S&&!x){const{Rt:xe,Tt:Ie}=n,Oe=J1(Ie),P=fz(Ie,us(b)),F=re=>{const{Lt:Y}=re,de=Tm(Y)===v&&Y,ke=(Ae,Se,oe)=>{const je=Se*Ae;return fF(oe?je:-je)};return[de,de&&{transform:B1({x:ke(P.x,xe.x,Oe.x),y:ke(P.y,xe.y,Oe.y)})}]};V(A,F),V($,F)}},ae=xe=>{const Ie=xe?"x":"y",P=zh(`${vs} ${xe?LQ:UQ}`),F=zh(kF),re=zh(yO),Y={Lt:P,Pt:F,kt:re},de=O[Ie];return qn(xe?A:$,Y),qn(C,[Lr(P,F),Lr(F,re),lt(Qh,P),de&&de.Mt(Y),i(Y,ee,xe)]),Y},ue=lt(ae,!0),ge=lt(ae,!1),Re=()=>(Lr(N,A[0].Lt),Lr(N,$[0].Lt),lt(gs,C));return ue(),ge(),[{Ut:me,Nt:ne,qt:ce,Bt:Z,Ft:ee,jt:{Xt:A,Yt:ue,Wt:lt(V,A)},Jt:{Xt:$,Yt:ge,Wt:lt(V,$)}},Re]},lee=(t,e,n,i,r)=>(o,l,u)=>{const{vt:d,L:f,V:p,gt:g,Gt:v,St:y}=e,{Lt:b,Pt:x,kt:S}=o,[k,T]=Sh(333),[C,A]=Sh(444),$=O=>{xo(g.scrollBy)&&g.scrollBy({behavior:"smooth",left:O.x,top:O.y})},N=()=>{const O="pointerup pointercancel lostpointercapture",L=`client${u?"X":"Y"}`,B=u?jw:Pw,V=u?"left":"top",ee=u?"w":"h",me=u?"x":"y",ne=[];return Tn(x,"pointerdown",i((ce=>{const Z=kh(ce.target,`.${yO}`)===S,ae=Z?S:x,ue=t.scrollbars,ge=ue[Z?"dragScroll":"clickScroll"],{button:Re,isPrimary:xe,pointerType:Ie}=ce,{pointers:Oe}=ue;if(Re===0&&xe&&ge&&(Oe||[]).includes(Ie)){gs(ne),A();const F=!Z&&(ce.shiftKey||ge==="instant"),re=lt(G1,S),Y=lt(G1,x),de=(kt,bn)=>(kt||re())[V]-(bn||Y())[V],ke=i2(G1(g)[B])/Dh(g)[ee]||1,Ae=us(g)[me],Se=kt=>{Xo(g,{[me]:Ae+kt})},oe=kt=>{const{Rt:bn}=n,Kn=Dh(x)[ee]-Dh(S)[ee],hr=1/ke*kt/Kn;Se(hr*bn[me])},je=ce[L],$e=re(),Le=Y(),Pe=$e[B],ze=de($e,Le)+Pe/2,vt=je-Le[V]-ze,en=Z?0:vt,yt=kt=>{gs(Xn),ae.releasePointerCapture(kt.pointerId)},Kt=Z||F,tn=y(),Xn=[Tn(v,O,yt),Tn(v,"selectstart",(kt=>c2(kt)),{D:!1}),Tn(x,O,yt),Kt&&Tn(x,"pointermove",(kt=>oe(en+kt[L]-je))),Kt&&(()=>{const kt=us(g);tn();const bn=us(g),Kn={x:bn.x-kt.x,y:bn.y-kt.y};(nc(Kn.x)>3||nc(Kn.y)>3)&&(y(),Xo(g,kt),$(Kn),C(tn))})];if(ae.setPointerCapture(ce.pointerId),F)oe(vt);else if(!Z){const kt=ff(JQ);if(kt){const{Vt:bn}=n,Kn=kt(Se,oe,lt(de),vt,bn[me],ge,!!u,(hr=>{hr?tn():qn(Xn,tn)}));qn(Xn,Kn),qn(ne,lt(Kn,!0))}}}})))};let j=!0;return lt(gs,[Tn(S,"pointermove pointerleave",i(r)),Tn(b,"pointerenter",i((()=>
18{l(vz,!0)}))),Tn(b,"pointerleave pointercancel",i((()=>{l(vz,!1)}))),Tn(b,"wheel",i((O=>{const{deltaX:L,deltaY:B,deltaMode:V}=O;j&&V===0&&Tm(b)===d&&$({x:L,y:B}),j=!1,l(_z,!0),k((()=>{j=!0,l(_z)})),c2(O)})),{D:!1,I:!0}),!p&&Tn(b,"mousedown",i((()=>{const O=o2();(cz(O,Pa)||cz(O,oc)||O===document.body)&&sO(lt(u2,f),25)}))),Tn(b,"pointerdown",(()=>{const O=Tn(v,"click",(B=>{L(),vF(B)}),{A:!0,I:!0,D:!1}),L=Tn(v,"pointerup pointercancel",(()=>{L(),setTimeout(O,150)}),{I:!0,D:!0})}),{I:!0,D:!0}),N(),T,A])},cee=(t,e,n,i,r,o,l)=>{let u,d,f,p,g,v=Em,y=0;const b=["mouse","pen"],x=re=>Y=>{n.Kt||re(Y)},S=re=>b.includes(re.pointerType),[k,T]=Sh(),[C,A]=Sh(100),[$,N]=Sh(50),[j,O]=Sh((()=>y)),[L,B]=aee(t,o,r,lee(e,o,r,x,(re=>S(re)&&Re()))),{vt:V,Qt:ee,bt:me}=o,{Ft:ne,Ut:ce,Nt:Z,qt:ae,Bt:ue}=L,ge=(re,Y)=>{O();const de=ke=>{n.Kt||ne(KQ,ke)};if(re)de();else{const ke=f?!u:!0;y>0&&!Y?j(lt(de,ke)):de(ke)}},Re=()=>{(f?!u:!p)&&(ge(!0),C((()=>{ge(!1)})))},xe=re=>{S(re)&&(u=!0,!n.Kt&&f&&ge(!0))},Ie=re=>{S(re)&&(u=!1,!n.Kt&&f&&ge(!1))},Oe=re=>{ne(f2,re,!0),ne(f2,re,!1)},P=[O,A,N,T,()=>v(),Tn(V,"pointerover",xe,{A:!0}),Tn(V,"pointerenter",xe),Tn(V,"pointerleave",Ie),Tn(V,"pointermove",x((re=>{S(re)&&d&&Re()}))),Tn(ee,"scroll",x((re=>{k((()=>{Z(),Re()})),l(re),ue()})))],F=ff(_O);return[()=>lt(gs,qn(P,B())),({Dt:re,It:Y,Zt:de,tn:ke})=>{const{nn:Ae,sn:Se,en:oe,cn:je}=ke||{},{Ct:$e,ft:Le}=de||{},{B:Pe}=i,{M:ze,P:Ge}=aa(),{rn:vt,j:en}=r,[yt,Kt]=re("showNativeOverlaidScrollbars"),[tn,Xn]=re("scrollbars.theme"),[kt,bn]=re("scrollbars.visibility"),[Kn,hr]=re("scrollbars.autoHide"),[An,Si]=re("scrollbars.autoHideSuspend"),[Eo]=re("scrollbars.autoHideDelay"),[Bs,ys]=re("scrollbars.dragScroll"),[ca,Mi]=re("scrollbars.clickScroll"),[Gs,el]=re("overflow"),Ii=Le&&!Y,ei=Ae||Se||je||$e||Y,tl=oe||bn||el,Gr=yt&&ze.x&&ze.y,To=!Ge&&!F,_s=Gr||To,nl=(Js,ua,Jr)=>{const fr=Js.includes(Cu)&&(kt===Da||kt==="auto"&&ua===Cu);return ne(FQ,fr,Jr),fr};if(y=Eo,(Kt||To)&&ne(zQ,_s),Xn&&(ne(g),ne(tn,!0),g=tn),(Si||Ii)&&(Oe(!An),Ii&&An&&(en.x||en.y?(v(),$((()=>{v=Tn(ee,Cu,x(lt(Oe,!0)),{A:!0})}))):Oe(!0))),hr&&(d=Kn==="move",f=Kn==="leave",p=Kn==="never",ge(p,!0)),ys&&ne(WQ,Bs),Mi&&ne(ZQ,!!ca),tl){const Js=nl(Gs.x,vt.x,!0),ua=nl(Gs.y,vt.y,!1);ne(HQ,!(Js&&ua))}ei&&(Z(),ce(),ue(),je&&ae(),ne(yz,!en.x,!0),ne(yz,!en.y,!1),ne(DQ,Pe&&!me))},{},L]},uee=t=>{const e=aa(),{K:n,P:i}=e,{elements:r}=n(),{padding:o,viewport:l,content:u}=r,d=Ab(t),f=d?{}:t,{elements:p}=f,{padding:g,viewport:v,content:y}=p||{},b=d?t:f.target,x=cF(b),S=b.ownerDocument,k=S.documentElement,T=()=>S.defaultView||Fr,C=lt(see,[b]),A=lt(AF,[b]),$=lt(zh,""),N=lt(C,$,l),j=lt(A,$,u),O=$e=>{const Le=Dh($e),Pe=Mb($e),ze=na($e,cO),Ge=na($e,uO);return Pe.w-Le.w>0&&!Eh(ze)||Pe.h-Le.h>0&&!Eh(Ge)}
vendor: 4,894 bytes, line 18
18,L=N(v),B=L===b,V=B&&x,ee=!B&&j(y),me=!B&&L===ee,ne=V?k:L,ce=V?ne:b,Z=!B&&A($,o,g),ae=!me&&ee,ue=[ae,ne,Z,ce].map(($e=>Ab($e)&&!Tm($e)&&$e)),ge=$e=>$e&&q6(ue,$e),Re=!ge(ne)&&O(ne)?ne:b,xe=V?k:ne,Oe={dt:b,vt:ce,L:ne,ln:Z,ht:ae,gt:xe,Qt:V?S:ne,an:x?k:Re,Gt:S,bt:x,At:d,V:B,un:T,yt:$e=>pO(ne,Pa,$e),wt:($e,Le)=>Nb(ne,Pa,$e,Le),St:()=>Nb(xe,Pa,jQ,!0)},{dt:P,vt:F,ln:re,L:Y,ht:de}=Oe,ke=[()=>{qo(F,[oc,X1]),qo(P,X1),x&&qo(k,[X1,oc])}];let Ae=s2([de,Y,re,F,P].find(($e=>$e&&!ge($e))));const Se=V?P:de||Y,oe=lt(gs,ke);return[Oe,()=>{const $e=T(),Le=o2(),Pe=yt=>{Lr(Tm(yt),s2(yt)),Qh(yt)},ze=yt=>Tn(yt,"focusin focusout focus blur",vF,{I:!0,D:!1}),Ge="tabindex",vt=hO(Y,Ge),en=ze(Le);return ja(F,oc,B?"":OQ),ja(re,h2,""),ja(Y,Pa,""),ja(de,mz,""),B||(ja(Y,Ge,vt||"-1"),x&&ja(k,gz,"")),Lr(Se,Ae),Lr(F,re),Lr(re||F,!B&&Y),Lr(Y,de),qn(ke,[en,()=>{const yt=o2(),Kt=ge(Y),tn=Kt&&yt===Y?P:yt,Xn=ze(tn);qo(re,h2),qo(de,mz),qo(Y,Pa),x&&qo(k,gz),vt?ja(Y,Ge,vt):qo(Y,Ge),ge(de)&&Pe(de),Kt&&Pe(Y),ge(re)&&Pe(re),u2(tn),Xn()}]),i&&!B&&(fO(Y,Pa,SF),qn(ke,lt(qo,Y,Pa))),u2(!B&&x&&Le===P&&$e.top===$e?Y:Le),en(),Ae=0,oe},oe]},dee=({ht:t})=>({Zt:e,fn:n,It:i})=>{const{$t:r}=e||{},{Ot:o}=n;t&&(r||i)&&Cm(t,{[Pw]:o&&"100%"})},hee=({vt:t,ln:e,L:n,V:i},r)=>{const[o,l]=os({i:gQ,o:dz()},lt(dz,t,"padding",""));return({Dt:u,Zt:d,fn:f,It:p})=>{let[g,v]=l(p);const{P:y}=aa(),{_t:b,xt:x,Ct:S}=d||{},{B:k}=f,[T,C]=u("paddingAbsolute");(b||v||(p||x))&&([g,v]=o(p));const $=!i&&(C||S||v);if($){const N=!T||!e&&!y,j=g.r+g.l,O=g.t+g.b,L={[Y6]:N&&!k?-j:0,[Q6]:N?-O:0,[X6]:N&&k?-j:0,top:N?-g.t:0,right:N?k?-g.r:"auto":0,left:N?k?"auto":-g.l:0,[jw]:N&&`calc(100% + ${j}px)`},B={[V6]:N?g.t:0,[B6]:N?g.r:0,[J6]:N?g.b:0,[G6]:N?g.l:0};Cm(e||n,L),Cm(n,B),Xt(r,{ln:g,_n:!N,F:e?B:Xt({},L,B)})}return{dn:$}}},fee=(t,e)=>{const n=aa(),{vt:i,ln:r,L:o,V:l,Qt:u,gt:d,bt:f,wt:p,un:g}=t,{P:v}=n,y=f&&l,b=lt(K6,0),x={display:()=>!1,direction:P=>P!=="ltr",flexDirection:P=>P.endsWith("-reverse"),writingMode:P=>P!=="horizontal-tb"},S=Dr(x),k={i:eF,o:{w:0,h:0}},T={i:C_,o:{}},C=P=>{p(xF,!y&&P)},A=()=>na(o,S),$=(P,F)=>{const re=!Dr(P).length,Y=F?!0:S.some((Ge=>{const vt=P[Ge];return hf(vt)&&x[Ge](vt)}));if(re||!Y||!SQ(o))return{T:{x:0,y:0},k:{x:1,y:1}};C(!0);const de=us(d),ke=Tn(u,Cu,(Ge=>{const vt=us(d);Ge.isTrusted&&vt.x===de.x&&vt.y===de.y&&mF(Ge)}),{I:!0,A:!0}),Ae=p(PQ,!0);Xo(d,{x:0,y:0}),Ae();const Se=us(d),oe=Mb(d);Xo(d,{x:oe.w,y:oe.h});const je=us(d),$e={x:je.x-Se.x,y:je.y-Se.y};Xo(d,{x:-oe.w,y:-oe.h});const Le=us(d),Pe={x:Le.x-Se.x,y:Le.y-Se.y},ze={x:nc($e.x)>=nc(Pe.x)?je.x:Le.x,y:nc($e.y)>=nc(Pe.y)?je.y:Le.y};return Xo(d,de),rO((()=>ke())),{T:Se,k:ze}},N=(P,F)=>{const re=Fr.devicePixelRatio%1!==0?1:0,Y={w:b(P.w-F.w),h:b(P.h-F.h)};return{w:Y.w>re?Y.w:0,h:Y.h>re?Y.h:0}},j=(P,F)=>{const re=(Y,de,ke,Ae)=>{const Se=Y===Da?vo:BQ(Y),oe=Eh(Y),je=Eh(ke);return!de&&!Ae?vo:oe&&je?Da:oe?de&&Ae?Se:de?Da:vo:de?Se:je&&Ae?Da:vo};return{x:re(F.x,P.x,F.y,P.y),y:re(F.y,P.y,F.x,P.x)}},O=P=>{const F=Y=>[Da,vo,Cu].map((de=>Oe(p2(de),Y))),re=F(!0).concat(F()).join(" ");p(re),p(Dr(P).map((Y=>Oe(P[Y],Y==="x"))).join(" "),!0)},[L,B]=os(k,lt(mO,o)),[V,ee]=os(k,lt(Mb,o)),[me,ne]=os(k),[ce]=os(T),[Z,ae]=os(k),[ue]=os(T),[ge]=os({i:(P,F)=>Nw(P,F,Pb(Yh(Dr(P),Dr(F)))),o:{}}),[Re,xe]=os({i:(P,F)=>C_(P.T,F.T)&&C_(P.k,F.k),o:yF()}),Ie=ff(_O),Oe=(P,F)=>`${F?RQ:$Q}${pQ(P)}`;return({Dt:P,Zt:F,fn:re,It:Y},{dn:de})=>{const{_t:ke,Ht:Ae,xt:Se,Ct:oe,ft:je,Et:$e}=F||{},Le=Ie&&Ie.R(t,e,re,n,P),{X:Pe,Y:ze,W:Ge}=Le||{},[vt,en]=VQ(P,n),[yt,Kt]=P("overflow"),tn=Eh(yt.x),Xn=Eh(yt.y),kt=ke||de||Se||oe||$e||en;let bn=B(Y),Kn=ee(Y),hr=ne(Y),An=ae(Y);if(en&&v&&p(SF,!vt),kt){pO(i,oc,R_)&&C(!0);const Rr=ze&&ze(),[ni]=bn=L(Y),[il]=Kn=V(Y),D=pF(o),H=y&&xQ(g()),ie={w:b(il.w+ni.w),h:b(il.h+ni.h)},ve={w:b((H?H.w:D.w+b(D.w-il.w))+ni.w),h:b((H?H.h:D.h+b(D.h-il.h))+ni.h)};Rr&&Rr(),An=Z(ve),hr=me(N(ie,ve),Y)}const[Si,Eo]=An,[Bs,ys]=hr,[ca,Mi]=Kn,[Gs,el]=bn,[Ii]=ce({x:Bs.w>0,y:Bs.h>0}),ei=tn&&Xn&&(Ii.x||Ii.y)||tn&&Ii.x&&!Ii.y||Xn&&Ii.y&&!Ii.x,tl=de||oe||$e||el||Mi||Eo||ys||Kt||en||kt||Ae&&y,[Gr]=P("update.flowDirectionStyles"),[To,_s]=ge(Gr?Gr(o)||{}:A(),Y),nl=oe||je||_s||Y,[Js,ua]=nl?Re($(To,!!Gr),Y):xe();let Jr=j(Ii,yt);C(!1),tl&&(O(Jr),Jr=GQ(o,Ii),Ge&&Pe&&(Pe(Jr,ca,Gs),Cm(o,Ge(Jr))));const[fr,ti]=ue(Jr);return Nb(i,oc,R_,ei),Nb(r,h2,R_,ei),Xt(e,{rn:fr,Vt:{x:Si.w,y:Si.h},Rt:{x:Bs.w,y:Bs.h},j:Ii,Tt:kQ(Js,Bs)}),{en:ti,nn:Eo,sn:ys,cn:ua||ys}}},pee=t=>{const[e,n,i]=uee(t),r={ln:{t:0,r:0,b:0,l:0},_n:!1,F:{[Y6]:0,[Q6]:0,[X6]:0,[V6]:0,[B6]:0,[J6]:0,[G6]:0},Vt:{x:0,y:0},Rt:{x:0,y:0},rn:{x:vo,y:vo},j:{x:!1,y:!1},Tt:yF()},{dt:o,gt:l,V:u,St:d}=e,{P:f,M:p}=aa(),g=!f&&(p.x||p.y),v=[dee(e),hee(e,r),fee(e,r)];return[n,y=>{const b={},S=g&&us(l),k=S&&d();return gn(v,(T=>{Xt(b,T(y,b)||{})})),Xo(l,S),k&&k(),u||Xo(o,0),b},r,e,i]},gee=(t,e,n,i)=>{let r=!1;const o={Kt:!1,pn:!1},l=Y1(e,{}),[u,d,f,p,g]=pee(t),[v,y,b]=ree(p,f,l,(A=>{C({},A)})),[x,S,,k]=cee(t,e,o,b,f,p,i),T=A=>
18Dr(A).some(($=>!!A[$])),C=(A,$)=>{const{Kt:N,pn:j}=o;if(j||N&&r)return!1;const{vn:O,It:L,zt:B}=A,V=O||{},ee=!!L||!r,me={Dt:Y1(e,V,ee),vn:V,It:ee},ne=$||y(Xt({},me,{zt:B})),ce=d(Xt({},me,{fn:b,Zt:ne}));S(Xt({},me,{Zt:ne,tn:ce}));const Z=T(ne),ae=T(ce),ue=Z||ae||!dO(V)||ee;return r=!0,ue&&n(A,{Zt:ne,tn:ce}),ue};return[()=>{const{an:A,gt:$,St:N}=p,j=us(A),O=[v(),u(),x(),()=>{o.pn=!0}],L=N();return Xo($,j),L(),lt(gs,O)},C,A=>{const $=o.Kt;o.Kt=A,!A&&$!==A&&C({It:!0,zt:!0})},()=>{S({Dt:Y1(e,{},!1),vn:{},It:!1})},()=>({gn:o,hn:b,bn:f}),{yn:p,wn:k},g]},bO=new WeakMap,mee=(t,e)=>{bO.set(t,e)},vee=t=>{bO.delete(t)},jF=t=>bO.get(t),uc=(t,e,n)=>{const{tt:i}=aa(),r=Ab(t),o=r?t:t.target,l=jF(o);if(e&&!l){const u=[],d={},f=ee=>{const me=iF(ee),ne=ff(CQ);return ne?ne(me,!0):me},p=Xt({},i(),f(e)),[g,v,y]=d2(),[b,x,S]=d2(n),k=(ee,me)=>{S(ee,me),y(ee,me)},[T,C,A,$,N,j,O]=gee(t,p,(({vn:ee,It:me},{Zt:ne,tn:ce})=>{const{_t:Z,Ct:ae,$t:ue,xt:ge,Ht:Re,ft:xe}=ne,{nn:Ie,sn:Oe,en:P,cn:F}=ce;k("updated",[V,{updateHints:{sizeChanged:!!Z,directionChanged:!!ae,heightIntrinsicChanged:!!ue,overflowEdgeChanged:!!Ie,overflowAmountChanged:!!Oe,overflowStyleChanged:!!P,scrollCoordinatesChanged:!!F,contentMutation:!!ge,hostMutation:!!Re,appear:!!xe},changedOptions:ee||{},force:!!me}])}),(ee=>k("scroll",[V,ee]))),L=ee=>{const{gn:me}=N(),{pn:ne}=me;ne||(vee(o),gs(u),k("destroyed",[V,ee]),v(),x())},V={options(ee,me){if(ee){const ne=me?i():{},ce=CF(p,Xt(ne,f(ee)));dO(ce)||(Xt(p,ce),C({vn:ce}))}return Xt({},p)},on:b,off:(ee,me)=>{ee&&me&&x(ee,me)},state(){const{gn:ee,hn:me,bn:ne}=N(),{pn:ce,Kt:Z}=ee,{B:ae}=me,{Vt:ue,Rt:ge,rn:Re,j:xe,ln:Ie,_n:Oe,Tt:P}=ne;return Xt({},{overflowEdge:ue,overflowAmount:ge,overflowStyle:Re,hasOverflow:xe,scrollCoordinates:{start:P.T,end:P.k},padding:Ie,paddingAbsolute:Oe,directionRTL:ae,sleeping:Z,destroyed:ce})},elements(){const{dt:ee,vt:me,ln:ne,L:ce,ht:Z,gt:ae,Qt:ue}=j.yn,{jt:ge,Jt:Re}=j.wn,xe=Oe=>{const{kt:P,Pt:F,Lt:re}=Oe;return{scrollbar:re,track:F,handle:P}},Ie=Oe=>{const{Xt:P,Yt:F}=Oe,re=xe(P[0]);return Xt({},re,{clone:()=>{const Y=xe(F());return $(),Y}})};return Xt({},{target:ee,host:me,padding:ne||ce,viewport:ce,content:Z||ce,scrollOffsetElement:ae,scrollEventElement:ue,scrollbarHorizontal:Ie(ge),scrollbarVertical:Ie(Re)})},update:ee=>C({It:ee,zt:!0}),destroy:lt(L,!1),sleep:A,plugin:ee=>d[Dr(ee)[0]]};return qn(u,[O]),mee(o,V),wF(_F,uc,[V,g,d]),oee(j.yn.bt,!r&&t.cancel)?(L(!0),V):(qn(u,T()),k("initialized",[V]),V.update(),V)}return l};uc.plugin=t=>{const e=Hs(t),n=e?t:[t],i=n.map((r=>wF(r,uc)[0]));return EQ(n),e?i:i[0]};uc.valid=t=>{const e=t&&t.elements,n=xo(e)&&e();return km(n)&&!!jF(n.target)};uc.env=()=>{const{U:t,M:e,P:n,J:i,ot:r,st:o,K:l,Z:u,tt:d,nt:f}=aa();return Xt({},{scrollbarsSize:t,scrollbarsOverlaid:e,scrollbarsHiding:n,scrollTimeline:i,staticDefaultInitialization:r,staticDefaultOptions:o,getDefaultInitialization:l,setDefaultInitialization:u,getDefaultOptions:d,setDefaultOptions:f})};uc.nonce=eee;uc.trustedTypePolicy=_Q;function Ir(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n}function Bc(t,e,n,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(t):i?i.value:e.get(t)}function Sz(t,e,n,i,r){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}function PF(t,e){this.v=t,this.k=e}function kz(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function Me(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}function yee(t){return new PF(t,0)}function NF(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function X(t,e){return t.get(Me(t,e))}function ut(t,e,n){NF(t,e),e.set(t,n)}function pt(t,e,n){return t.set(Me(t,e),n),n}function gf(t,e){NF(t,e),e.add(t)}function be(t,e,n){return(e=(function(i){var r=(function(o,l){if(typeof o!="object"||!o)return o;var u=o[Symbol.toPrimitive];if(u!==void 0){var d=u.call(o,l);
18if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(l==="string"?String:Number)(o)})(i,"string");return typeof r=="symbol"?r:r+""})(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ez(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function Te(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Ez(Object(n),!0).forEach(function(i){be(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ez(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function Tz(t,e){if(t==null)return{};var n,i,r=(function(l,u){if(l==null)return{};var d={};for(var f in l)if({}.hasOwnProperty.call(l,f)){if(u.indexOf(f)!==-1)continue;d[f]=l[f]}return d})(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function ur(t,e){return(function(n){if(Array.isArray(n))return n})(t)||(function(n,i){var r=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(r!=null){var o,l,u,d,f=[],p=!0,g=!1;try{if(u=(r=r.call(n)).next,i===0){if(Object(r)!==r)return;p=!1}else for(;!(p=(o=u.call(r)).done)&&(f.push(o.value),f.length!==i);p=!0);}catch(v){g=!0,l=v}finally{try{if(!p&&r.return!=null&&(d=r.return(),Object(d)!==d))return}finally{if(g)throw l}}return f}})(t,e)||(function(n,i){if(n){if(typeof n=="string")return kz(n,i);var r={}.toString.call(n).slice(8,-1);return r==="Object"&&n.constructor&&(r=n.constructor.name),r==="Map"||r==="Set"?Array.from(n):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?kz(n,i):void 0}})(t,e)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
19In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function MF(t){return function(){return new vg(t.apply(this,arguments))}}function vg(t){var e,n;function i(o,l){try{var u=t[o](l),d=u.value,f=d instanceof PF;Promise.resolve(f?d.v:d).then(function(p){if(f){var g=o==="return"&&d.k?o:"next";if(!d.k||p.done)return i(g,p);p=t[g](p).value}r(!!u.done,p)},function(p){i("throw",p)})}catch(p){r(2,p)}}function r(o,l){o===2?e.reject(l):e.resolve({value:l,done:o}),(e=e.next)?i(e.key,e.arg):n=null}this._invoke=function(o,l){return new Promise(function(u,d){var f={key:o,arg:l,resolve:u,reject:d,next:null};n?n=n.next=f:(e=n=f,i(o,l))})},typeof t.return!="function"&&(this.return=void 0)}typeof SuppressedError=="function"&&SuppressedError,vg.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},vg.prototype.next=function(t){return this._invoke("next",t)},vg.prototype.throw=function(t){return this._invoke("throw",t)},vg.prototype.return=function(t){return this._invoke("return",t)};const _ee={timeoutInSeconds:60},g2=1e4,Cz="memory",Oz="Multifactor authentication required",IF="online_access",m2={name:"auth0-spa-js",version:"2.27.0"},zF=()=>Date.now(),ji="default";class zt extends Error{constructor(e,n){super(n),this.error=e,this.error_description=n,Object.setPrototypeOf(this,zt.prototype)}static fromPayload(e){let n=e.error,i=e.error_description;return new zt(n,i)}}class Ib extends zt{constructor(e,n){super("invalid_configuration","".concat(e," ").concat(n)),this.suggestion=n,Object.setPrototypeOf(this,Ib.prototype)}}class wO extends zt{constructor(e,n,i){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;super(e,n),this.state=i,this.appState=r,Object.setPrototypeOf(this,wO.prototype)}}class xO extends zt{constructor(e,n,i,r){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null;super(e,n),this.connection=i,this.state=r,this.appState=o,Object.setPrototypeOf(this,xO.prototype)}}class mf extends zt{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,mf.prototype)}}class SO extends mf{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,SO.prototype)}}let bee=class DF extends zt{constructor(e){super("cancelled","Po
19pup closed"),this.popup=e,Object.setPrototypeOf(this,DF.prototype)}};class kO extends zt{constructor(){super("popup_open","Unable to open a popup for loginWithPopup - window.open returned `null`"),Object.setPrototypeOf(this,kO.prototype)}}class Om extends zt{constructor(e,n,i,r){super(e,n),this.mfa_token=i,this.mfa_requirements=r,Object.setPrototypeOf(this,Om.prototype)}}class zw extends zt{constructor(e,n){super("missing_refresh_token","Missing Refresh Token (audience: '".concat(zb(e,["default"]),"', scope: '").concat(zb(n),"')")),this.audience=e,this.scope=n,Object.setPrototypeOf(this,zw.prototype)}}class EO extends zt{constructor(e,n){super("missing_scopes","Missing requested scopes after refresh (audience: '".concat(zb(e,["default"]),"', missing scope: '").concat(zb(n),"')")),this.audience=e,this.scope=n,Object.setPrototypeOf(this,EO.prototype)}}class Dw extends zt{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,Dw.prototype)}}function zb(t){return t&&!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:[]).includes(t)?t:""}const Db=()=>window.crypto,Up=()=>{const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let e="";for(;e.length<43;){const n=Db().getRandomValues(new Uint8Array(43-e.length));for(const i of n)e.length<43&&i<198&&(e+=t[i%66])}return e},eE=t=>btoa(t),wee=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],v2=function(t){let e=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return Object.keys(t).reduce((n,i)=>{if(e&&i==="env")return n;const r=wee.find(o=>o.key===i);return r&&r.type.includes(typeof t[i])&&(n[i]=t[i]),n},{})},yg=t=>{var e=t.clientId,n=Ir(t,["clientId"]);return new URLSearchParams((i=>Object.keys(i).filter(r=>i[r]!==void 0).reduce((r,o)=>Object.assign(Object.assign({},r),{[o]:i[o]}),{}))(Object.assign({client_id:e},n))).toString()},Rz=async t=>await Db().subtle.digest({name:"SHA-256"},new TextEncoder().encode(t)),$z=t=>(e=>decodeURIComponent(atob(e).split("").map(n=>"%"+("00"+n.charCodeAt(0).toString(16)).slice(-2)).join("")))(t.replace(/_/g,"/").replace(/-/g,"+")),Az=t=>{const e=new Uint8Array(t);return(n=>{const i={"+":"-","/":"_","=":""};return n.replace(/[+/=]/g,r=>i[r])})(window.btoa(String.fromCharCode(...Array.from(e))))};var Iu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},LF={},TO={};Object.defineProperty(TO,"__esModule",{value:!0});var xee=(function(){function t(){var e=this;this.locked=new Map,this.addToLocked=function(n,i){var r=e.locked.get(n);r===void 0?i===void 0?e.locked.set(n,[]):e.locked.set(n,[i]):i!==void 0&&(r.unshift(i),e.locked.set(n,r))},this.isLocked=function(n){return e.locked.has(n)},this.lock=function(n){return new Promise(function(i,r){e.isLocked(n)?e.addToLocked(n,i):(e.addToLocked(n),i())})},this.unlock=function(n){var i=e.locked.get(n);if(i!==void 0&&i.length!==0){var r=i.pop();e.locked.set(n,i),r!==void 0&&setTimeout(r,0)}else e.locked.delete(n)}}return t.getInstance=function(){return t.instance===void 0&&(t.instance=new t),t.instance},t})();TO.default=function(){return xee.getInstance()};var go=Iu&&Iu.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,o){function l(f){try{d(i.next(f))}catch(p){o(p)}}function u(f){try{d(i.throw(f))}catch(p){o(p)}}function d(f){f.done?r(f.value):new n(function(p){p(f.value)}).then(l,u)}d((i=i.apply(t,e||[])).next())})},mo=Iu&&Iu.__generator||function(t,e){var n,i,r,o,l={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(d){return function(f){return(function(p){if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,i&&(r=2&p[0]?i.return:p[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,p[1])).done)return r;switch(i=0,r&&(p=[2&p[0],r.value]),p[0]){case 0:case 1:r=p;break;case 4:return l.label++,{value:p[1],done:!1};case 5:l.label++,i=p[1],p=[0];continue;case 7:p=l.ops.pop(),l.trys.pop();continue;default:if(r=l.trys,!((r=r.length>0&&r[r.length-1])||p[0]!==6&&p[0]!==2)){l=0;continue}if(p[0]===3&&(!r||p[1]>r[0]&&p[1]<r[3])){l.label=p[1];break}if(p[0]===6&&l.label<r[1]){l.label=r[1],r=p;break}if(r&&l.label<r[2]){l.label=r[2],l.ops.push(p);break}r[2]&&l.ops.pop(),l.trys.pop();continue}p=e.call(t,l)}catch(g){p=[6,g],i=0}finally{n=r=0}if(5&p[0])throw p[1];return{value:p[0]?p[1]:void 0,done:!0}})([d,f])}}},Fp=Iu;Object.defineProperty(LF,"__esModule",{value:!0});
vendor: 5,584 bytes, line 19
19var Gd=TO,tE="browser-tabs-lock-key",w0={key:function(t){return go(Fp,void 0,void 0,function(){return mo(this,function(e){throw new Error("Unsupported")})})},getItem:function(t){return go(Fp,void 0,void 0,function(){return mo(this,function(e){throw new Error("Unsupported")})})},clear:function(){return go(Fp,void 0,void 0,function(){return mo(this,function(t){return[2,window.localStorage.clear()]})})},removeItem:function(t){return go(Fp,void 0,void 0,function(){return mo(this,function(e){throw new Error("Unsupported")})})},setItem:function(t,e){return go(Fp,void 0,void 0,function(){return mo(this,function(n){throw new Error("Unsupported")})})},keySync:function(t){return window.localStorage.key(t)},getItemSync:function(t){return window.localStorage.getItem(t)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(t){return window.localStorage.removeItem(t)},setItemSync:function(t,e){return window.localStorage.setItem(t,e)}};function nE(t){return new Promise(function(e){return setTimeout(e,t)})}function iE(t){for(var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",n="",i=0;i<t;i++)n+=e[Math.floor(61*Math.random())];return n}var See=(function(){function t(e){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+iE(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=e,t.waiters===void 0&&(t.waiters=[])}return t.prototype.acquireLock=function(e,n){return n===void 0&&(n=5e3),go(this,void 0,void 0,function(){var i,r,o,l,u,d,f;return mo(this,function(p){switch(p.label){case 0:i=Date.now()+iE(4),r=Date.now()+n,o=tE+"-"+e,l=this.storageHandler===void 0?w0:this.storageHandler,p.label=1;case 1:return Date.now()<r?[4,nE(30)]:[3,8];case 2:return p.sent(),l.getItemSync(o)!==null?[3,5]:(u=this.id+"-"+e+"-"+i,[4,nE(Math.floor(25*Math.random()))]);case 3:return p.sent(),l.setItemSync(o,JSON.stringify({id:this.id,iat:i,timeoutKey:u,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,nE(30)];case 4:return p.sent(),(d=l.getItemSync(o))!==null&&(f=JSON.parse(d)).id===this.id&&f.iat===i?(this.acquiredIatSet.add(i),this.refreshLockWhileAcquired(o,i),[2,!0]):[3,7];case 5:return t.lockCorrector(this.storageHandler===void 0?w0:this.storageHandler),[4,this.waitForSomethingToChange(r)];case 6:p.sent(),p.label=7;case 7:return i=Date.now()+iE(4),[3,1];case 8:return[2,!1]}})})},t.prototype.refreshLockWhileAcquired=function(e,n){return go(this,void 0,void 0,function(){var i=this;return mo(this,function(r){return setTimeout(function(){return go(i,void 0,void 0,function(){var o,l,u;return mo(this,function(d){switch(d.label){case 0:return[4,Gd.default().lock(n)];case 1:return d.sent(),this.acquiredIatSet.has(n)?(o=this.storageHandler===void 0?w0:this.storageHandler,(l=o.getItemSync(e))===null?(Gd.default().unlock(n),[2]):((u=JSON.parse(l)).timeRefreshed=Date.now(),o.setItemSync(e,JSON.stringify(u)),Gd.default().unlock(n),this.refreshLockWhileAcquired(e,n),[2])):(Gd.default().unlock(n),[2])}})})},1e3),[2]})})},t.prototype.waitForSomethingToChange=function(e){return go(this,void 0,void 0,function(){return mo(this,function(n){switch(n.label){case 0:return[4,new Promise(function(i){var r=!1,o=Date.now(),l=!1;function u(){if(l||(window.removeEventListener("storage",u),t.removeFromWaiting(u),clearTimeout(d),l=!0),!r){r=!0;var f=50-(Date.now()-o);f>0?setTimeout(i,f):i(null)}}window.addEventListener("storage",u),t.addToWaiting(u);var d=setTimeout(u,Math.max(0,e-Date.now()))})];case 1:return n.sent(),[2]}})})},t.addToWaiting=function(e){this.removeFromWaiting(e),t.waiters!==void 0&&t.waiters.push(e)},t.removeFromWaiting=function(e){t.waiters!==void 0&&(t.waiters=t.waiters.filter(function(n){return n!==e}))},t.notifyWaiters=function(){t.waiters!==void 0&&t.waiters.slice().forEach(function(e){return e()})},t.prototype.releaseLock=function(e){return go(this,void 0,void 0,function(){return mo(this,function(n){switch(n.label){case 0:return[4,this.releaseLock__private__(e)];case 1:return[2,n.sent()]}})})},t.prototype.releaseLock__private__=function(e){return go(this,void 0,void 0,function(){var n,i,r,o;return mo(this,function(l){switch(l.label){case 0:return n=this.storageHandler===void 0?w0:this.storageHandler,i=tE+"-"+e,(r=n.getItemSync(i))===null?[2]:(o=JSON.parse(r)).id!==this.id?[3,2]:[4,Gd.default().lock(o.iat)];case 1:l.sent(),this.acquiredIatSet.delete(o.iat),n.removeItemSync(i),Gd.default().unlock(o.iat),t.notifyWaiters(),l.label=2;case 2:return[2]}})})},t.lockCorrector=function(e){for(var n=Date.now()-5e3,i=e,r=[],o=0;;){var l=i.keySync(o);if(l===null)break;r.push(l),o++}for(var u=!1,d=0;d<r.length;d++){var f=r[d];if(f.includes(tE)){var p=i.getItemSync(f);if(p!==null){var g=JSON.parse(p);(g.timeRefreshed===void 0&&g.timeAcquired<n||g.timeRefreshed!==void 0&&g.timeRefreshed<n)&&(i.removeItemSync(f),u=!0)}}}u&&t.notifyWaiters()},t.waiters=void 0,t})(),kee=LF.default=See;class Eee{async runWithLock(e,n,i){const r=new AbortController,o=setTimeout(()=>r.abort(),n);try{return await navigator.locks.request(e,{mode:"exclusive",signal:r.signal},async l=>{if(clearTimeout(o),!l)throw new Error("Lock not available");return await i()})}catch(l){throw clearTimeout(o),l?.name==="AbortError"?new mf:l}}}class Tee{constructor(){this.activeLocks=new Set,this.lock=new kee,this.pagehideHandler=()=>
19{this.activeLocks.forEach(e=>this.lock.releaseLock(e)),this.activeLocks.clear()}}async runWithLock(e,n,i){let r=!1;for(let o=0;o<10&&!r;o++)r=await this.lock.acquireLock(e,n);if(!r)throw new mf;this.activeLocks.add(e),this.activeLocks.size===1&&typeof window<"u"&&window.addEventListener("pagehide",this.pagehideHandler);try{return await i()}finally{this.activeLocks.delete(e),await this.lock.releaseLock(e),this.activeLocks.size===0&&typeof window<"u"&&window.removeEventListener("pagehide",this.pagehideHandler)}}}function Cee(){return typeof navigator<"u"&&typeof((t=navigator.locks)===null||t===void 0?void 0:t.request)=="function"?new Eee:new Tee;var t}let rE=null;function UF(){return rE||(rE=Cee()),rE}const Oee=new TextEncoder,Ree=new TextDecoder;function Bg(t){return typeof t=="string"?Oee.encode(t):Ree.decode(t)}function jz(t){if(typeof t.modulusLength!="number"||t.modulusLength<2048)throw new Aee(`${t.name} modulusLength must be at least 2048 bits`)}async function $ee(t,e,n){if(n.usages.includes("sign")===!1)throw new TypeError('private CryptoKey instances used for signing assertions must include "sign" in their "usages"');const i=`${Gg(Bg(JSON.stringify(t)))}.${Gg(Bg(JSON.stringify(e)))}`;return`${i}.${Gg(await crypto.subtle.sign((function(r){switch(r.algorithm.name){case"ECDSA":return{name:r.algorithm.name,hash:"SHA-256"};case"RSA-PSS":return jz(r.algorithm),{name:r.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return jz(r.algorithm),{name:r.algorithm.name};case"Ed25519":return{name:r.algorithm.name}}throw new mu})(n),n,Bg(i)))}`}let y2;Uint8Array.prototype.toBase64?y2=t=>(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t.toBase64({alphabet:"base64url",omitPadding:!0})):y2=e=>{e instanceof ArrayBuffer&&(e=new Uint8Array(e));const n=[];for(let i=0;i<e.byteLength;i+=32768)n.push(String.fromCharCode.apply(null,e.subarray(i,i+32768)));return btoa(n.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")};function Gg(t){return y2(t)}class mu extends Error{constructor(e){var n;super(e??"operation not supported"),this.name=this.constructor.name,(n=Error.captureStackTrace)===null||n===void 0||n.call(Error,this,this.constructor)}}class Aee extends Error{constructor(e){var n;super(e),this.name=this.constructor.name,(n=Error.captureStackTrace)===null||n===void 0||n.call(Error,this,this.constructor)}}function jee(t){switch(t.algorithm.name){case"RSA-PSS":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"PS256";throw new mu("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"RSASSA-PKCS1-v1_5":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"RS256";throw new mu("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"ECDSA":return(function(e){if(e.algorithm.namedCurve==="P-256")return"ES256";throw new mu("unsupported EcKeyAlgorithm namedCurve")})(t);case"Ed25519":return"Ed25519";default:throw new mu("unsupported CryptoKey algorithm name")}}function FF(t){return t instanceof CryptoKey}function HF(t){return FF(t)&&t.type==="public"}async function Pee(t,e,n,i,r,o){const l=t?.privateKey,u=t?.publicKey;if(!FF(d=l)||d.type!=="private")throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var d;if(!HF(u))throw new TypeError('"keypair.publicKey" must be a public CryptoKey');if(u.extractable!==!0)throw new TypeError('"keypair.publicKey.extractable" must be true');if(typeof e!="string")throw new TypeError('"htu" must be a string');if(typeof n!="string")throw new TypeError('"htm" must be a string');if(i!==void 0&&typeof i!="string")throw new TypeError('"nonce" must be a string or undefined');if(r!==void 0&&typeof r!="string")throw new TypeError('"accessToken" must be a string or undefined');const f=Object.assign(Object.create(null),o,{iat:Math.floor(Date.now()/1e3),jti:crypto.randomUUID(),htm:n,nonce:i,htu:e,ath:r?Gg(await crypto.subtle.digest("SHA-256",Bg(r))):void 0});return $ee({alg:jee(l),typ:"dpop+jwt",jwk:await KF(u)},f,l)}async function KF(t){const{kty:e,e:n,n:i,x:r,y:o,crv:l}=await crypto.subtle.exportKey("jwk",t);return{kty:e,crv:l,e:n,n:i,x:r,y:o}}const ZF="dpop-nonce",Nee=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:token-exchange","urn:okta:params:oauth:grant-type:webauthn","http://auth0.com/oauth/grant-type/mfa-oob","http://auth0.com/oauth/grant-type/mfa-otp","http://auth0.com/oauth/grant-type/mfa-rec
19overy-code"];function Mee(){return(async function(t,e){var n;let i;if(t.length===0)throw new TypeError('"alg" must be a non-empty string');switch(t){case"PS256":i={name:"RSA-PSS",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"RS256":i={name:"RSASSA-PKCS1-v1_5",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"ES256":i={name:"ECDSA",namedCurve:"P-256"};break;case"Ed25519":i={name:"Ed25519"};break;default:throw new mu}return crypto.subtle.generateKey(i,(n=e?.extractable)!==null&&n!==void 0&&n,["sign","verify"])})("ES256",{extractable:!1})}function Iee(t){return(async function(e){if(!HF(e))throw new TypeError('"publicKey" must be a public CryptoKey');if(e.extractable!==!0)throw new TypeError('"publicKey.extractable" must be true');const n=await KF(e);let i;switch(n.kty){case"EC":i={crv:n.crv,kty:n.kty,x:n.x,y:n.y};break;case"OKP":i={crv:n.crv,kty:n.kty,x:n.x};break;case"RSA":i={e:n.e,kty:n.kty,n:n.n};break;default:throw new mu("unsupported JWK kty")}return Gg(await crypto.subtle.digest({name:"SHA-256"},Bg(JSON.stringify(i))))})(t.publicKey)}function zee(t){let e=t.keyPair,n=t.url,i=t.method,r=t.nonce,o=t.accessToken;const l=(function(u){const d=new URL(u);return d.search="",d.hash="",d.href})(n);return Pee(e,l,i,r,o)}const _2=(t,e)=>new Promise(function(n,i){const r=new MessageChannel;r.port1.onmessage=function(o){o.data.error?i(new Error(o.data.error)):n(o.data),r.port1.close()},e.postMessage(t,[r.port2])}),WF=(t,e,n)=>{const i=new AbortController;let r;return e.signal=i.signal,Promise.race([fetch(t,e),new Promise((o,l)=>{r=setTimeout(()=>{i.abort(),l(new Error("Timeout when executing 'fetch'"))},n)})]).finally(()=>{clearTimeout(r)})},Dee=async function(t,e,n,i,r,o){let l=arguments.length>6&&arguments[6]!==void 0?arguments[6]:g2;return r?(async(u,d,f,p,g,v,y,b,x,S)=>_2({type:"refresh",auth:{audience:d,scope:f},timeout:g,fetchUrl:u,fetchOptions:p,useFormData:y,useMrrt:b,skipTokenStorage:x,preserveRefreshToken:S},v))(t,e,n,i,l,r,o,arguments.length>7?arguments[7]:void 0,arguments.length>8?arguments[8]:void 0,arguments.length>9?arguments[9]:void 0):(async(u,d,f)=>{const p=await WF(u,d,f);return{ok:p.ok,json:await p.json(),headers:(g=p.headers,[...g].reduce((v,y)=>{let b=ur(y,2),x=b[0],S=b[1];return v[x]=S,v},{}))};var g})(t,i,l)};async function qF(t,e,n,i,r,o,l,u,d,f,p,g){if(d){const N=await d.generateProof({url:t,method:r.method||"GET",nonce:await d.getNonce()});r.headers=Object.assign(Object.assign({},r.headers),{dpop:N})}let v,y=null;for(let N=0;N<3;N++)try{v=await Dee(t,n,i,r,o,l,e,u,p,g),y=null;break}catch(j){y=j}if(y)throw y;const b=v.json,x=b.error,S=b.error_description,k=Ir(b,["error","error_description"]),T=v,C=T.headers,A=T.ok;let $;if(d&&($=C[ZF],$&&await d.setNonce($)),!A){const N=S||"HTTP error. Unable to fetch ".concat(t);if(x==="mfa_required")throw new Om(x,N,k.mfa_token,k.mfa_requirements);if(x==="missing_refresh_token")throw new zw(n,i);if(x==="use_dpop_nonce"){if(!d||!$||f)throw new Dw($);return qF(t,e,n,i,r,o,l,u,d,!0,p,g)}throw new zt(x||"request_error",N)}return k}async function Pz(t,e,n){var i=t.baseUrl,r=t.timeout,o=t.audience,l=t.scope,u=t.auth0Client,d=t.useFormData,f=t.useMrrt,p=t.dpop,g=t.preserveRefreshToken,v=Ir(t,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop","preserveRefreshToken"]);const y=v.grant_type==="urn:ietf:params:oauth:grant-type:token-exchange",b=v.grant_type==="urn:okta:params:oauth:grant-type:webauthn",x=v.grant_type==="refresh_token"&&f,S=y||b||x,k=Object.assign(Object.assign(Object.assign({},v),S&&o&&{audience:o}),S&&l&&{scope:l}),T=b||!d,C=T?JSON.stringify(k):yg(k),A=($=v.grant_type,Nee.includes($));var $;return await qF("".concat(i,"/oauth/token"),r,o||ji,l,{method:"POST",body:C,headers:{"Content-Type":T?"application/json":"application/x-www-form-urlencoded","Auth0-Client":btoa(JSON.stringify(v2(u||m2)))}},e,d,f,A?p:void 0,void 0,n,g)}const $_=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return(i=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(i))).join(" ");var i},Hp=(t,e,n)=>{let i;return n&&(i=t[n]),i||(i=t[ji]),$_(i,e)},vu="@@auth0spajs@@",ru="@@user@@";class Ni{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:vu,i=arguments.length>2?arguments[2]:void 0;this.prefix=n,this.suffix=i,this.clientId=e.clientId,this.scope=e.scope,this.audience=e.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(
19Boolean).join("::")}static fromKey(e){const n=ur(e.split("::"),4),i=n[0],r=n[1],o=n[2],l=n[3];return new Ni({clientId:r,scope:l,audience:o},i)}static fromCacheEntry(e){const n=e.scope,i=e.audience,r=e.client_id;return new Ni({scope:n,audience:i,clientId:r})}}class Lee{set(e,n){localStorage.setItem(e,JSON.stringify(n))}get(e){const n=window.localStorage.getItem(e);if(n)try{return JSON.parse(n)}catch{return}}remove(e){localStorage.removeItem(e)}allKeys(){return Object.keys(window.localStorage).filter(e=>e.startsWith(vu))}}class VF{constructor(){this.enclosedCache=(function(){let e={};return{set(n,i){e[n]=i},get(n){const i=e[n];if(i)return i},remove(n){delete e[n]},allKeys:()=>Object.keys(e)}})()}}class Uee{constructor(e,n,i){this.cache=e,this.keyManifest=n,this.nowProvider=i||zF}async setIdToken(e,n,i){var r;const o=this.getIdTokenCacheKey(e);await this.cache.set(o,{id_token:n,decodedToken:i}),await((r=this.keyManifest)===null||r===void 0?void 0:r.add(o))}async getIdToken(e){const n=await this.cache.get(this.getIdTokenCacheKey(e.clientId));if(!n&&e.scope&&e.audience){const i=await this.get(e);return!i||!i.id_token||!i.decodedToken?void 0:{id_token:i.id_token,decodedToken:i.decodedToken}}if(n)return{id_token:n.id_token,decodedToken:n.decodedToken}}async get(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=arguments.length>3?arguments[3]:void 0;var o;let l=await this.cache.get(e.toKey()),u=e;if(!l){const p=await this.getCacheKeys();if(!p)return;const g=this.matchExistingCacheKey(e,p);if(g&&(l=await this.cache.get(g),u=Ni.fromKey(g)),!l&&i&&r!=="cache-only")return this.getEntryWithRefreshToken(e,p)}if(!l)return;const d=await this.nowProvider(),f=Math.floor(d/1e3);return l.expiresAt-n<f?l.body.refresh_token?this.modifiedCachedEntry(l,u):(await this.cache.remove(u.toKey()),void await((o=this.keyManifest)===null||o===void 0?void 0:o.remove(u.toKey()))):l.body}async modifiedCachedEntry(e,n){const i={refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope},r={body:i,expiresAt:e.expiresAt};return await this.cache.set(n.toKey(),r),{refresh_token:i.refresh_token,audience:i.audience,scope:i.scope}}async set(e){var n;const i=new Ni({clientId:e.client_id,scope:e.scope,audience:e.audience}),r=await this.wrapCacheEntry(e);await this.cache.set(i.toKey(),r),await((n=this.keyManifest)===null||n===void 0?void 0:n.add(i.toKey()))}async remove(e,n,i){const r=new Ni({clientId:e,scope:i,audience:n});await this.cache.remove(r.toKey())}async stripRefreshToken(e){var n;const i=await this.getCacheKeys();if(i)for(const r of i){const o=await this.cache.get(r);((n=o?.body)===null||n===void 0?void 0:n.refresh_token)===e&&(delete o.body.refresh_token,await this.cache.set(r,o))}}async clear(e){var n;const i=await this.getCacheKeys();i&&(await i.filter(r=>!e||r.includes(e)).reduce(async(r,o)=>{await r,await this.cache.remove(o)},Promise.resolve()),await((n=this.keyManifest)===null||n===void 0?void 0:n.clear()))}async wrapCacheEntry(e){const n=await this.nowProvider();return{body:e,expiresAt:Math.floor(n/1e3)+e.expires_in}}async getCacheKeys(){var e;return this.keyManifest?(e=await this.keyManifest.get())===null||e===void 0?void 0:e.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(e){return new Ni({clientId:e},vu,ru).toKey()}matchExistingCacheKey(e,n){return n.filter(i=>{var r;const o=Ni.fromKey(i),l=new Set(o.scope&&o.scope.split(" ")),u=((r=e.scope)===null||r===void 0?void 0:r.split(" "))||[],d=o.scope&&u.reduce((f,p)=>f&&l.has(p),!0);return o.prefix===vu&&o.clientId===e.clientId&&o.audience===e.audience&&d})[0]}async getEntryWithRefreshToken(e,n){var i;for(const r of n){const o=Ni.fromKey(r);if(o.prefix===vu&&o.clientId===e.clientId){const l=await this.cache.get(r);if(!((i=l?.body)===null||i===void 0)&&i.refresh_token)return{refresh_token:l.body.refresh_token,audience:l.body.audience,scope:l.body.scope}}}}async getRefreshTokensByAudience(e,n){var i;const r=await this.getCacheKeys();if(!r)return[];const o=new Set;for(const l of r){const u=Ni.fromKey(l);if(u.prefix===vu&&u.clientId===n&&u.audience===e){const d=await this.cache.get(l);!((i=d?.body)===null||i===void 0)&&i.refresh_token&&o.add(d.body.refresh_token)}}return Array.from(o)}async updateEntry(e,n,i){let r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];const o=await this.getCacheKeys();if(o)for(const l of o){if(Ni.fromKey(l).clientId!==i)continue;const u=await this.cache.get(l);if(!u?.body)continue;const d=u.body.refresh_token;d&&(r||d===e)&&(u.body.refresh_token=n,await this.cache.set(l,u))}}}class Fee{constructor(e,n,i){this.storage=e,this.clientId=n,this.cookieDomain=i,this.storageKey="".concat("a0.spajs.txs",".").concat(this.clientId)}create(e){this.storage.save(this.storageKey,e,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}}const Kp=t=>typeof t=="number",Hee=["iss","aud","exp","nbf","iat","jti","azp","
19nonce","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"],Kee=t=>{if(!t.id_token)throw new Error("ID token is required but missing");const e=(o=>{const l=o.split("."),u=ur(l,3),d=u[0],f=u[1],p=u[2];if(l.length!==3||!d||!f||!p)throw new Error("ID token could not be decoded");const g=JSON.parse($z(f)),v={__raw:o},y={};return Object.keys(g).forEach(b=>{v[b]=g[b],Hee.includes(b)||(y[b]=g[b])}),{encoded:{header:d,payload:f,signature:p},header:JSON.parse($z(d)),claims:v,user:y}})(t.id_token);if(!e.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(e.claims.iss!==t.iss)throw new Error('Issuer (iss) claim mismatch in the ID token; expected "'.concat(t.iss,'", found "').concat(e.claims.iss,'"'));if(!e.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(e.header.alg!=="RS256")throw new Error('Signature algorithm of "'.concat(e.header.alg,'" is not supported. Expected the ID token to be signed with "RS256".'));if(!e.claims.aud||typeof e.claims.aud!="string"&&!Array.isArray(e.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(e.claims.aud)){if(!e.claims.aud.includes(t.aud))throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(t.aud,'" but was not one of "').concat(e.claims.aud.join(", "),'"'));if(e.claims.aud.length>1){if(!e.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(e.claims.azp!==t.aud)throw new Error('Authorized Party (azp) claim mismatch in the ID token; expected "'.concat(t.aud,'", found "').concat(e.claims.azp,'"'))}}else if(e.claims.aud!==t.aud)throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(t.aud,'" but found "').concat(e.claims.aud,'"'));if(t.nonce){if(!e.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(e.claims.nonce!==t.nonce)throw new Error('Nonce (nonce) claim mismatch in the ID token; expected "'.concat(t.nonce,'", found "').concat(e.claims.nonce,'"'))}if(t.max_age&&!Kp(e.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(e.claims.exp==null||!Kp(e.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Kp(e.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const n=t.leeway||60,i=new Date(t.now||Date.now()),r=new Date(0);if(r.setUTCSeconds(e.claims.exp+n),i>r)throw new Error("Expiration Time (exp) claim error in the ID token; current time (".concat(i,") is after expiration time (").concat(r,")"));if(e.claims.nbf!=null&&Kp(e.claims.nbf)){const o=new Date(0);if(o.setUTCSeconds(e.claims.nbf-n),i<o)throw new Error("Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (".concat(i,") is before ").concat(o))}if(e.claims.auth_time!=null&&Kp(e.claims.auth_time)){const o=new Date(0);if(o.setUTCSeconds(parseInt(e.claims.auth_time)+t.max_age+n),i>o)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 (".concat(i,") is after last auth at ").concat(o))}if(t.organization){const o=t.organization.trim();if(o.startsWith("org_")){const l=o;if(!e.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(l!==e.claims.org_id)throw new Error('Organization ID (org_id) claim mismatch in the ID token; expected "'.concat(l,'", found "').concat(e.claims.org_id,'"'))}else{const l=o.toLowerCase();if(!e.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(l!==e.claims.org_name)throw new Error('Organization Name (org_name) claim mismatch in the ID token; expected "'.concat(l,'", found "').concat(e.claims.org_name,'"'))}}return e};var Rm=Iu&&Iu.__assign||function(){return Rm=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Rm.apply(this,arguments)};function Zp(t,e){if(!e)return"";var n="; "+t;return e===!0?n:n+"="+e}function Zee(t,e,n){return encodeURIComponent(t).replace(/%(23|24|26|2B|5E|60|7C)/g,decode
19URIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(e).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+(function(i){if(typeof i.expires=="number"){var r=new Date;r.setMilliseconds(r.getMilliseconds()+864e5*i.expires),i.expires=r}return Zp("Expires",i.expires?i.expires.toUTCString():"")+Zp("Domain",i.domain)+Zp("Path",i.path)+Zp("Secure",i.secure)+Zp("SameSite",i.sameSite)})(n)}function Wee(){return(function(t){for(var e={},n=t?t.split("; "):[],i=/(%[\dA-F]{2})+/gi,r=0;r<n.length;r++){var o=n[r].split("="),l=o.slice(1).join("=");l.charAt(0)==='"'&&(l=l.slice(1,-1));try{e[o[0].replace(i,decodeURIComponent)]=l.replace(i,decodeURIComponent)}catch{}}return e})(document.cookie)}var qee=function(t){return Wee()[t]};function BF(t,e,n){document.cookie=Zee(t,e,Rm({path:"/"},n))}var GF=BF,JF=function(t,e){BF(t,"",Rm(Rm({},e),{expires:-1}))};const hh={get(t){const e=qee(t);if(e!==void 0)return JSON.parse(e)},save(t,e,n){let i={};window.location.protocol==="https:"&&(i={secure:!0,sameSite:"none"}),n?.daysUntilExpire&&(i.expires=n.daysUntilExpire),n?.cookieDomain&&(i.domain=n.cookieDomain),GF(t,JSON.stringify(e),i)},remove(t,e){let n={};e?.cookieDomain&&(n.domain=e.cookieDomain),JF(t,n)}},sE="_legacy_",Vee={get(t){return hh.get(t)||hh.get("".concat(sE).concat(t))},save(t,e,n){let i={};window.location.protocol==="https:"&&(i={secure:!0}),n?.daysUntilExpire&&(i.expires=n.daysUntilExpire),n?.cookieDomain&&(i.domain=n.cookieDomain),GF("".concat(sE).concat(t),JSON.stringify(e),i),hh.save(t,e,n)},remove(t,e){let n={};e?.cookieDomain&&(n.domain=e.cookieDomain),JF(t,n),hh.remove(t,e),hh.remove("".concat(sE).concat(t),e)}},Bee={get(t){if(typeof sessionStorage>"u")return;const e=sessionStorage.getItem(t);return e!=null?JSON.parse(e):void 0},save(t,e){sessionStorage.setItem(t,JSON.stringify(e))},remove(t){sessionStorage.removeItem(t)}};var lu;(function(t){t.Code="code",t.ConnectCode="connect_code"})(lu||(lu={}));function Gee(t,e,n){var i=e===void 0?null:e,r=(function(d,f){var p=atob(d);if(f){for(var g=new Uint8Array(p.length),v=0,y=p.length;v<y;++v)g[v]=p.charCodeAt(v);return String.fromCharCode.apply(null,new Uint16Array(g.buffer))}return p})(t,n!==void 0&&n),o=r.indexOf(`
20`,10)+1,l=r.substring(o)+(i?"//# sourceMappingURL="+i:""),u=new Blob([l],{type:"application/javascript"});return URL.createObjectURL(u)}var Nz,Mz,Iz,oE,Jee=(Nz
vendor: 8,104 bytes, line 20
20="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7ZnVuY3Rpb24gZShlLHQpeyhudWxsPT10fHx0PmUubGVuZ3RoKSYmKHQ9ZS5sZW5ndGgpO2Zvcih2YXIgcj0wLG89QXJyYXkodCk7cjx0O3IrKylvW3JdPWVbcl07cmV0dXJuIG99ZnVuY3Rpb24gdCh0LHIpe3JldHVybiBmdW5jdGlvbihlKXtpZihBcnJheS5pc0FycmF5KGUpKXJldHVybiBlfSh0KXx8ZnVuY3Rpb24oZSx0KXt2YXIgcj1udWxsPT1lP251bGw6InVuZGVmaW5lZCIhPXR5cGVvZiBTeW1ib2wmJmVbU3ltYm9sLml0ZXJhdG9yXXx8ZVsiQEBpdGVyYXRvciJdO2lmKG51bGwhPXIpe3ZhciBvLG4scyxhLGk9W10sYz0hMCxsPSExO3RyeXtpZihzPShyPXIuY2FsbChlKSkubmV4dCwwPT09dCl7aWYoT2JqZWN0KHIpIT09cilyZXR1cm47Yz0hMX1lbHNlIGZvcig7IShjPShvPXMuY2FsbChyKSkuZG9uZSkmJihpLnB1c2goby52YWx1ZSksaS5sZW5ndGghPT10KTtjPSEwKTt9Y2F0Y2goZSl7bD0hMCxuPWV9ZmluYWxseXt0cnl7aWYoIWMmJm51bGwhPXIucmV0dXJuJiYoYT1yLnJldHVybigpLE9iamVjdChhKSE9PWEpKXJldHVybn1maW5hbGx5e2lmKGwpdGhyb3cgbn19cmV0dXJuIGl9fSh0LHIpfHxmdW5jdGlvbih0LHIpe2lmKHQpe2lmKCJzdHJpbmciPT10eXBlb2YgdClyZXR1cm4gZSh0LHIpO3ZhciBvPXt9LnRvU3RyaW5nLmNhbGwodCkuc2xpY2UoOCwtMSk7cmV0dXJuIk9iamVjdCI9PT1vJiZ0LmNvbnN0cnVjdG9yJiYobz10LmNvbnN0cnVjdG9yLm5hbWUpLCJNYXAiPT09b3x8IlNldCI9PT1vP0FycmF5LmZyb20odCk6IkFyZ3VtZW50cyI9PT1vfHwvXig/OlVpfEkpbnQoPzo4fDE2fDMyKSg/OkNsYW1wZWQpP0FycmF5JC8udGVzdChvKT9lKHQscik6dm9pZCAwfX0odCxyKXx8ZnVuY3Rpb24oKXt0aHJvdyBuZXcgVHlwZUVycm9yKCJJbnZhbGlkIGF0dGVtcHQgdG8gZGVzdHJ1Y3R1cmUgbm9uLWl0ZXJhYmxlIGluc3RhbmNlLlxuSW4gb3JkZXIgdG8gYmUgaXRlcmFibGUsIG5vbi1hcnJheSBvYmplY3RzIG11c3QgaGF2ZSBhIFtTeW1ib2wuaXRlcmF0b3JdKCkgbWV0aG9kLiIpfSgpfWNsYXNzIHIgZXh0ZW5kcyBFcnJvcntjb25zdHJ1Y3RvcihlLHQpe3N1cGVyKHQpLHRoaXMuZXJyb3I9ZSx0aGlzLmVycm9yX2Rlc2NyaXB0aW9uPXQsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsci5wcm90b3R5cGUpfXN0YXRpYyBmcm9tUGF5bG9hZChlKXtsZXQgdD1lLmVycm9yLG89ZS5lcnJvcl9kZXNjcmlwdGlvbjtyZXR1cm4gbmV3IHIodCxvKX19Y2xhc3MgbyBleHRlbmRzIHJ7Y29uc3RydWN0b3IoZSx0KXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIiwiTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyIuY29uY2F0KG4oZSxbImRlZmF1bHQiXSksIicsIHNjb3BlOiAnIikuY29uY2F0KG4odCksIicpIikpLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXQsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsby5wcm90b3R5cGUpfX1mdW5jdGlvbiBuKGUpe3JldHVybiBlJiYhKGFyZ3VtZW50cy5sZW5ndGg+MSYmdm9pZCAwIT09YXJndW1lbnRzWzFdP2FyZ3VtZW50c1sxXTpbXSkuaW5jbHVkZXMoZSk/ZToiIn0iZnVuY3Rpb24iPT10eXBlb2YgU3VwcHJlc3NlZEVycm9yJiZTdXBwcmVzc2VkRXJyb3I7Y29uc3Qgcz1lPT57dmFyIHQ9ZS5jbGllbnRJZCxyPWZ1bmN0aW9uKGUsdCl7dmFyIHI9e307Zm9yKHZhciBvIGluIGUpT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKGUsbykmJnQuaW5kZXhPZihvKTwwJiYocltvXT1lW29dKTtpZihudWxsIT1lJiYiZnVuY3Rpb24iPT10eXBlb2YgT2JqZWN0LmdldE93blByb3BlcnR5U3ltYm9scyl7dmFyIG49MDtmb3Iobz1PYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKGUpO248by5sZW5ndGg7bisrKXQuaW5kZXhPZihvW25dKTwwJiZPYmplY3QucHJvdG90eXBlLnByb3BlcnR5SXNFbnVtZXJhYmxlLmNhbGwoZSxvW25dKSYmKHJbb1tuXV09ZVtvW25dXSl9cmV0dXJuIHJ9KGUsWyJjbGllbnRJZCJdKTtyZXR1cm4gbmV3IFVSTFNlYXJjaFBhcmFtcygoZT0+T2JqZWN0LmtleXMoZSkuZmlsdGVyKHQ9PnZvaWQgMCE9PWVbdF0pLnJlZHVjZSgodCxyKT0+T2JqZWN0LmFzc2lnbihPYmplY3QuYXNzaWduKHt9LHQpLHtbcl06ZVtyXX0pLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IGE9e30saT1udWxsO2NvbnN0IGM9KGUsdCk9PiIiLmNvbmNhdChlLCJ8IikuY29uY2F0KHQpLGw9KGUsdCk9PnQuc3RhcnRzV2l0aCgiIi5jb25jYXQoZSwifCIpKSx1PShlLHQpPT5hW2MoZSx0KV0sZj1lPT57T2JqZWN0LmVudHJpZXMoYSkuZm9yRWFjaChyPT57bGV0IG89dChyLDIpLG49b1swXTtvWzFdPT09ZSYmZGVsZXRlIGFbbl19KX0saD1lPT57Y29uc3QgdD1uZXcgVVJMU2VhcmNoUGFyYW1zKGUpLHI9e307cmV0dXJuIHQuZm9yRWFjaCgoZSx0KT0+e3JbdF09ZX0pLHJ9LGQ9YXN5bmMgZT0+e2xldCByLG4saT1lLmRhdGEsZj1pLnRpbWVvdXQsZD1pLmF1dGgscD1pLmZldGNoVXJsLHk9aS5mZXRjaE9wdGlvbnMsZz1pLnVzZUZvcm1EYXRhLGI9aS51c2VNcnJ0LE89aS5za2lwVG9rZW5TdG9yYWdlLGs9aS5wcmVzZXJ2ZVJlZnJlc2hUb2tlbixtPXQoZS5wb3J0cywxKVswXSxqPXt9O2NvbnN0IHY9ZHx8e30sXz12LmF1ZGllbmNlLHc9di5zY29wZTt0cnl7Y29uc3QgZT1nP2goeS5ib2R5KTpKU09OLnBhcnNlKHkuYm9keSk7aWYoZS5yZWZyZXNoX3Rva2VufHwicmVmcmVzaF90b2tlbiIhPT1lLmdyYW50X3R5cGUpZS5tZmFfdG9rZW4mJihuPXUoXyx3KSwhbiYmYiYmKG49YS5sYXRlc3RfcmVmcmVzaF90b2tlbikpO2Vsc2V7aWYobj11KF8sdyksIW4mJmIpe2NvbnN0IGU9YS5sYXRlc3RfcmVmcmVzaF90b2tlbix0PSgoZSx0KT0+ISFPYmplY3Qua2V5cyhhKS5maW5kKHI9PntpZigibGF0ZXN0X3JlZnJlc2hfdG9rZW4iIT09cil7Y29uc3Qgbz1sKHQsciksbj1yLnNwbGl0KCJ8IilbMV0uc3BsaXQoIiAiKSxzPWUuc3BsaXQoIiAiKS5ldmVyeShlPT5uLmluY2x1ZGVzKGUpKTtyZXR1cm4gbyYmc319KSkodyxfKTtlJiYhdCYmKG49ZSl9aWYoIW4pdGhyb3cgbmV3IG8oXyx3KTt5LmJvZHk9Zz9zKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxlKSx7cmVmcmVzaF90b2tlbjpufSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxlKSx7cmVmcmVzaF90b2tlbjpufSkpfWxldCBpLGQ7ImZ1bmN0aW9uIj09dHlwZW9mIEFib3J0Q29udHJvbGxlciYmKGk9bmV3IEFib3J0Q29udHJvbGxlcix5LnNpZ25hbD1pLnNpZ25hbCk7dHJ5e2Q9YXdhaXQgUHJvbWlzZS5yYWNlKFsoUD1mLG5ldyBQcm9taXNlKGU9PnNldFRpbWVvdXQoZSxQKSkpLGZldGNoKHAsT2JqZWN0LmFzc2lnbih7fSx5KSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBtLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZClyZXR1cm4gaSYmaS5hYm9ydCgpLHZvaWQgbS5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtpZihVPWQuaGVhZGVycyxqPVsuLi5VXS5yZWR1Y2UoKGUscik9PntsZXQgbz10KHIsMiksbj1vWzBdLHM9b1sxXTtyZXR1cm4gZVtuXT1zLGV9LHt9KSxyPWF3YWl0IGQuanNvbigpLE8pcmV0dXJuIGRlbGV0ZSByLnJlZnJlc2hfdG9rZW4sdm9pZCBtLnBvc3RNZXNzYWdlKHtvazpkLm9rLGpzb246cixoZWFkZXJzOmp9KTtyLnJlZnJlc2hfdG9rZW4/KGImJihhLmxhdGVzdF9yZWZyZXNoX3Rva2VuPXIucmVmcmVzaF90b2tlbixTPW4sTT1yLnJlZnJlc2hfdG9rZW4sT2JqZWN0LmVudHJpZXMoYSkuZm9yRWFjaChlPT57bGV0IHI9dChlLDIpLG89clswXTtyWzFdPT09UyYmKGFbb109TSl9KSksKChlLHQscik9PnthW2ModCxyKV09ZX0pKHIucmVmcmVzaF90b2tlbixfLHcpLGRlbGV0ZSByLnJlZnJlc2hfdG9rZW4pOmt8fCgoZSx0KT0+e2RlbGV0ZSBhW2MoZSx0KV19KShfLHcpLG0ucG9zdE1lc3NhZ2Uoe29rOmQub2ssanNvbjpyLGhlYWRlcnM6an0pfWNhdGNoKGUpe20ucG9zdE1lc3NhZ2Uoe29rOiExLGpzb246e2Vycm9yOmUuZXJyb3IsZXJyb3JfZGVzY3JpcHRpb246ZS5tZXNzYWdlfSxoZWFkZXJzOmp9KX12YXIgUyxNLFUsUH0scD1hc3luYyBlPT57bGV0IHI9ZS5kYXRhLG89ci50aW1lb3V0LG49ci5hdXRoLGk9ci5mZXRjaFVybCxjPXIuZmV0Y2hPcHRpb25zLHU9ci51c2VGb3JtRGF0YSxkPXQoZS5wb3J0cywxKVswXTtjb25zdCBwPShufHx7fSkuYXVkaWVuY2U7dHJ5e2NvbnN0IGU9KGU9Pntjb25zdCByPW5ldyBTZXQ7cmV0dXJuIE9iamVjdC5lbnRyaWVzKGEpLmZvckVhY2gobz0+e2xldCBuPXQobywyKSxzPW5bMF0sYT1uWzFdO2woZSxzKSYmci5hZGQoYSl9KSxBcnJheS5mcm9tKHIpfSkocCk7aWYoMD09PWUubGVuZ3RoKXJldHVybiB2b2lkIGQucG9zdE1lc3NhZ2Uoe29rOiEwfSk7Y29uc3Qgcj11P2goYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7Zm9yKGNvbnN0IHQgb2YgZSl7Y29uc3QgZT11P3MoT2JqZWN0LmFzc2lnbihPYmplY3QuYXNzaWduKHt9LHIpLHt0b2tlbjp0fSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7dG9rZW46dH0pKTtsZXQgbixhLGwsaDsiZnVuY3Rpb24iPT10eXBlb2YgQWJvcnRDb250cm9sbGVyJiYobj1uZXcgQWJvcnRDb250cm9sbGVyLGE9bi5zaWduYWwpO3RyeXtoPWF3YWl0IFByb21pc2UucmFjZShbbmV3IFByb21pc2UoZT0+e2w9c2V0VGltZW91dChlLG8pfSksZmV0Y2goaSxPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sYykse2JvZHk6ZSxzaWduYWw6YX0pKV0pLmZpbmFsbHkoKCk9PmNsZWFyVGltZW91dChsKSl9Y2F0Y2goZSl7cmV0dXJuIHZvaWQgZC5wb3N0TWVzc2FnZSh7ZXJyb3I6ZS5tZXNzYWdlfSl9aWYoIWgpcmV0dXJuIG4mJm4uYWJvcnQoKSx2b2lkIGQucG9zdE1lc3NhZ2Uoe2Vycm9yOiJUaW1lb3V0IHdoZW4gZXhlY3V0aW5nICdmZXRjaCcifSk7aWYoIWgub2spe2xldCBlO3RyeXtjb25zdCB0PUpTT04ucGFyc2UoYXdhaXQgaC50ZXh0KCkpO2U9dC5lcnJvcl9kZXNjcmlwdGlvbn1jYXRjaChlKXt9cmV0dXJuIHZvaWQgZC5wb3N0TWVzc2FnZSh7ZXJyb3I6ZXx8IkhUVFAgZXJyb3IgIi5jb25jYXQoaC5zdGF0dXMpfSl9Zih0KX1kLnBvc3RNZXNzYWdlKHtvazohMH0pfWNhdGNoKGUpe2QucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZXx8IlVua25vd24gZXJyb3IgZHVyaW5nIHRva2VuIHJldm9jYXRpb24ifSl9fSx5PShlLHQpPT57aWYoIWkpcmV0dXJuITE7dHJ5e2NvbnN0IHI9bmV3IFVSTChpKS5vcmlnaW4sbz1uZXcgVVJMKGUuZmV0Y2hVcmwpO3JldHVybiBvLm9yaWdpbj09PXImJm8ucGF0aG5hbWU9PT10fWNhdGNoKGUpe3JldHVybiExfX07YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsZT0+e2NvbnN0IHI9ZS5kYXRhLG89dChlLnBvcnRzLDEpWzBdO2lmKCEoInR5cGUiaW4gcil8fCJpbml0IiE9PXIudHlwZSlyZXR1cm4idHlwZSJpbiByJiYiY2xlYXIiPT09ci50eXBlPyhhPXt9LHZvaWQobnVsbD09b3x8by5wb3N0TWVzc2FnZSh7b2s6ITB9KSkpOiJ0eXBlImluIHImJiJyZXZva2UiPT09ci50eXBlP3kociwiL29hdXRoL3Jldm9rZSIpP3ZvaWQgcChlKTp2b2lkKG51bGw9PW98fG8ucG9zdE1lc3NhZ2Uoe29rOiExLGpzb246e2Vycm9yOiJpbnZhbGlkX2ZldGNoX3VybCIsZXJyb3JfZGVzY3JpcHRpb246IlVuYXV0aG9yaXplZCBmZXRjaCBVUkwifSxoZWFkZXJzOnt9fSkpOnZvaWQoImZldGNoVXJsImluIHImJnkociwiL29hdXRoL3Rva2VuIik/ZChlKTpudWxsPT1vfHxvLnBvc3RNZXNzYWdlKHtvazohMSxqc29uOntlcnJvcjoiaW52YWxpZF9mZXRjaF91cmwiLGVycm9yX2Rlc2NyaXB0aW9uOiJVbmF1dGhvcml6ZWQgZmV0Y2ggVVJMIn0saGVhZGVyczp7fX0pKTtpZihudWxsPT09aSl0cnl7bmV3IFVSTChyLmFsbG93ZWRCYXNlVXJsKSxpPXIuYWxsb3dlZEJhc2VVcmx9Y2F0Y2goZSl7cmV0dXJufX0pfSgpOwoK",
20Mz=null,Iz=!1,function(t){return oE=oE||Gee(Nz,Mz,Iz),new Worker(oE,t)});class Xee{constructor(e,n){this.cache=e,this.clientId=n,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(e){var n;const i=new Set(((n=await this.cache.get(this.manifestKey))===null||n===void 0?void 0:n.keys)||[]);i.add(e),await this.cache.set(this.manifestKey,{keys:[...i]})}async remove(e){const n=await this.cache.get(this.manifestKey);if(n){const i=new Set(n.keys);return i.delete(e),i.size>0?await this.cache.set(this.manifestKey,{keys:[...i]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(e){return"".concat(vu,"::").concat(e)}}const zz="auth0.is.authenticated",Yee={memory:()=>new VF().enclosedCache,localstorage:()=>new Lee},Dz=t=>Yee[t],Lz=t=>{const e=t.openUrl,n=t.onRedirect,i=Ir(t,["openUrl","onRedirect"]);return Object.assign(Object.assign({},i),{openUrl:e===!1||e?e:n})},Qee=(t,e,n)=>{const i=t?.split(" ")||[],r=n?i.filter(l=>l!==IF):i,o=e?.split(" ")||[];return r.filter(l=>o.indexOf(l)==-1).join(",")},Gc={NONCE:"nonce",KEYPAIR:"keypair"};class ete{constructor(e){this.clientId=e}getVersion(){return 1}createDbHandle(){const e=window.indexedDB.open("auth0-spa-js",this.getVersion());return new Promise((n,i)=>{e.onupgradeneeded=()=>Object.values(Gc).forEach(r=>e.result.createObjectStore(r)),e.onerror=()=>i(e.error),e.onsuccess=()=>n(e.result)})}async getDbHandle(){return this.dbHandle||(this.dbHandle=await this.createDbHandle()),this.dbHandle}async executeDbRequest(e,n,i){const r=i((await this.getDbHandle()).transaction(e,n).objectStore(e));return new Promise((o,l)=>{r.onsuccess=()=>o(r.result),r.onerror=()=>l(r.error)})}buildKey(e){const n=e?"_".concat(e):"auth0";return"".concat(this.clientId,"::").concat(n)}setNonce(e,n){return this.save(Gc.NONCE,this.buildKey(n),e)}setKeyPair(e){return this.save(Gc.KEYPAIR,this.buildKey(),e)}async save(e,n,i){await this.executeDbRequest(e,"readwrite",r=>r.put(i,n))}findNonce(e){return this.find(Gc.NONCE,this.buildKey(e))}findKeyPair(){return this.find(Gc.KEYPAIR,this.buildKey())}find(e,n){return this.executeDbRequest(e,"readonly",i=>i.get(n))}async deleteBy(e,n){const i=await this.executeDbRequest(e,"readonly",r=>r.getAllKeys());await Promise.all(i?.filter(n).map(r=>this.executeDbRequest(e,"readwrite",o=>o.delete(r)))||[])}deleteByClientId(e,n){return this.deleteBy(e,i=>typeof i=="string"&&i.startsWith("".concat(n,"::")))}clearNonces(){return this.deleteByClientId(Gc.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId(Gc.KEYPAIR,this.clientId)}}class tte{constructor(e){this.storage=new ete(e)}getNonce(e){return this.storage.findNonce(e)}setNonce(e,n){return this.storage.setNonce(e,n)}async getOrGenerateKeyPair(){let e=await this.storage.findKeyPair();return e||(e=await Mee(),await this.storage.setKeyPair(e)),e}async generateProof(e){const n=await this.getOrGenerateKeyPair();return zee(Object.assign({keyPair:n},e))}async calculateThumbprint(){return Iee(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}}var Th;(function(t){t.Bearer="Bearer",t.DPoP="DPoP"})(Th||(Th={}));class nte{constructor(e,n){this.hooks=n,this.config=Object.assign(Object.assign({},e),{fetch:e.fetch||(typeof window>"u"?fetch:window.fetch.bind(window))})}isAbsoluteUrl(e){return/^(https?:)?\/\//i.test(e)}buildUrl(e,n){if(n){if(this.isAbsoluteUrl(n))return n;if(e)return"".concat(e.replace(/\/?\/$/,""),"/").concat(n.replace(/^\/+/,""))}throw new TypeError("`url` must be absolute or `baseUrl` non-empty.")}getAccessToken(e){return this.config.getAccessToken?this.config.getAccessToken(e):this.hooks.getAccessToken(e)}extractUrl(e){return typeof e=="string"?e:e instanceof URL?e.href:e.url}buildBaseRequest(e,n){if(!this.config.baseUrl)return new Request(e,n);const i=this.buildUrl(this.config.baseUrl,this.extractUrl(e)),r=e instanceof Request?new Request(i,e):i;return new Request(r,n)}setAuthorizationHeader(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Th.Bearer;e.headers.set("authorization","".concat(i," ").concat(n))}async setDpopProofHeader(e,n){if(!this.config.dpopNonceId)return;const i=await this.hooks.getDpopNonce(),r=await this.hooks.generateDpopProof({accessToken:n,method:e.method,nonce:i,url:e.url});e.headers.set("dpop",r)}
20async prepareRequest(e,n){const i=await this.getAccessToken(n);if(i===void 0)throw new zt("missing_access_token","No access token available");let r,o;typeof i=="string"?(r=this.config.dpopNonceId?Th.DPoP:Th.Bearer,o=i):(r=i.token_type,o=i.access_token),this.setAuthorizationHeader(e,o,r),r===Th.DPoP&&await this.setDpopProofHeader(e,o)}getHeader(e,n){return Array.isArray(e)?new Headers(e).get(n)||"":typeof e.get=="function"?e.get(n)||"":e[n]||""}hasUseDpopNonceError(e){if(e.status!==401)return!1;const n=this.getHeader(e.headers,"www-authenticate");return n.includes("invalid_dpop_nonce")||n.includes("use_dpop_nonce")}async handleResponse(e,n){const i=this.getHeader(e.headers,ZF);if(i&&await this.hooks.setDpopNonce(i),!this.hasUseDpopNonceError(e))return e;if(!i||!n.onUseDpopNonceError)throw new Dw(i);return n.onUseDpopNonceError()}async internalFetchWithAuth(e,n,i,r){const o=this.buildBaseRequest(e,n);await this.prepareRequest(o,r);const l=await this.config.fetch(o);return this.handleResponse(l,i)}fetchWithAuth(e,n,i){const r={onUseDpopNonceError:()=>this.internalFetchWithAuth(e,n,Object.assign(Object.assign({},r),{onUseDpopNonceError:void 0}),i)};return this.internalFetchWithAuth(e,n,r,i)}}class ite{constructor(e,n){this.myAccountFetcher=e,this.apiBase=n}async connectAccount(e){const n=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/connected-accounts/connect"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},{scope:["create:me:connected_accounts"]});return this._handleResponse(n)}async completeAccount(e){const n=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/connected-accounts/complete"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},{scope:["create:me:connected_accounts"]});return this._handleResponse(n)}async getFactors(){const e=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/factors"),{method:"GET"},{scope:["read:me:factors"]});return(await this._handleResponse(e)).factors}
vendor: 2,835 bytes, line 20
20async getAuthenticationMethods(e){const n=e?"?".concat(new URLSearchParams({type:e})):"",i=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods").concat(n),{method:"GET"},{scope:["read:me:authentication_methods"]});return(await this._handleResponse(i)).authentication_methods}async getAuthenticationMethod(e){const n=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods/").concat(encodeURIComponent(e)),{method:"GET"},{scope:["read:me:authentication_methods"]});return this._handleResponse(n)}async deleteAuthenticationMethod(e){const n=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods/").concat(encodeURIComponent(e)),{method:"DELETE"},{scope:["delete:me:authentication_methods"]});n.ok||await this._handleResponse(n)}async updateAuthenticationMethod(e,n){const i=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods/").concat(encodeURIComponent(e)),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)},{scope:["update:me:authentication_methods"]});return this._handleResponse(i)}async enrollmentChallenge(e){var n;const i=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},{scope:["create:me:authentication_methods"]}),r=await this._handleResponse(i),o=(n=i.headers.get("location"))!==null&&n!==void 0?n:"",l=decodeURIComponent(o.split("/").pop()||"");return Object.assign(Object.assign({},r),{id:l,location:o})}async enrollmentVerify(e){const n=e,i=n.location;n.type;const r=Ir(n,["location","type"]),o=await this.myAccountFetcher.fetchWithAuth("".concat(i,"/verify"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)},{scope:["create:me:authentication_methods"]});return this._handleResponse(o)}async _handleResponse(e){let n;try{n=await e.text(),n=JSON.parse(n)}catch(i){throw new Lb({type:"invalid_json",status:e.status,title:"Invalid JSON response",detail:n||String(i)})}if(e.ok)return n;throw new Lb(n)}}class Lb extends Error{constructor(e){let n=e.type,i=e.status,r=e.title,o=e.detail,l=e.validation_errors;super(o),this.name="MyAccountApiError",this.type=n,this.status=i,this.title=r,this.detail=o,this.validation_errors=l,Object.setPrototypeOf(this,Lb.prototype)}}const rte={otp:{authenticatorTypes:["otp"]},sms:{authenticatorTypes:["oob"],oobChannels:["sms"]},email:{authenticatorTypes:["oob"],oobChannels:["email"]},push:{authenticatorTypes:["oob"],oobChannels:["auth0"]},voice:{authenticatorTypes:["oob"],oobChannels:["voice"]}},ste="http://auth0.com/oauth/grant-type/mfa-otp",ote="http://auth0.com/oauth/grant-type/mfa-oob",ate="http://auth0.com/oauth/grant-type/mfa-rec
20overy-code";var x0,aE;let b2;(typeof navigator>"u"||(x0=navigator.userAgent)===null||x0===void 0||(aE=x0.startsWith)===null||aE===void 0||!aE.call(x0,"Mozilla/5.0 "))&&(b2="".concat("oauth4webapi","/").concat("v3.8.6"));function Xa(t,e){if(t==null)return!1;try{return t instanceof e||Object.getPrototypeOf(t)[Symbol.toStringTag]===e.prototype[Symbol.toStringTag]}catch{return!1}}const dr="ERR_INVALID_ARG_VALUE",Ji="ERR_INVALID_ARG_TYPE";function Vt(t,e,n){const i=new TypeError(t,{cause:n});return Object.assign(i,{code:e}),i}const Xi=Symbol(),Ub=Symbol(),w2=Symbol(),Br=Symbol(),bo=Symbol(),lte=new TextEncoder,cte=new TextDecoder;function Lh(t){return typeof t=="string"?lte.encode(t):cte.decode(t)}let x2,XF;Uint8Array.prototype.toBase64?x2=t=>(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t.toBase64({alphabet:"base64url",omitPadding:!0})):x2=e=>{e instanceof ArrayBuffer&&(e=new Uint8Array(e));const n=[];for(let i=0;i<e.byteLength;i+=32768)n.push(String.fromCharCode.apply(null,e.subarray(i,i+32768)));return btoa(n.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")};function Ru(t){return typeof t=="string"?XF(t):x2(t)}XF=Uint8Array.fromBase64?t=>{try{return Uint8Array.fromBase64(t,{alphabet:"base64url"})}catch(e){throw Vt("The input to be decoded is not correctly encoded.",dr,e)}}:t=>{try{const e=atob(t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"")),n=new Uint8Array(e.length);for(let i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return n}catch(e){throw Vt("The input to be decoded is not correctly encoded.",dr,e)}};class ps extends Error{constructor(e,n){var i;super(e,n),be(this,"code",void 0),this.name=this.constructor.name,this.code=k2,(i=Error.captureStackTrace)===null||i===void 0||i.call(Error,this,this.constructor)}}let CO=class extends Error{constructor(e,n){var i;super(e,n),be(this,"code",void 0),this.name=this.constructor.name,n!=null&&n.code&&(this.code=n?.code),(i=Error.captureStackTrace)===null||i===void 0||i.call(Error,this,this.constructor)}};function at(t,e,n){return new CO(t,{code:e,cause:n})}function ute(t,e){if((function(n,i){if(!(n instanceof CryptoKey))throw Vt("".concat(i," must be a CryptoKey"),Ji)})(t,e),t.type!=="private")throw Vt("".concat(e," must be a private CryptoKey"),dr)}function Fb(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function zu(t){Xa(t,Headers)&&(t=Object.fromEntries(t.entries()));const e=new Headers(t??{});if(b2&&!e.has("user-agent")&&e.set("user-agent",b2),e.has("authorization"))throw Vt('"options.headers" must not include the "authorization" header name',dr);return e}function OO(t,e){if(e!==void 0){if(typeof e=="function"&&(e=e(t.href)),!(e instanceof AbortSignal))throw Vt('"options.signal" must return or be an instance of AbortSignal',Ji);return e}}function Uz(t){return t.includes("//")?t.replace("//","/"):t}async function dte(t,e){return(async function(n,i,r,o){if(!(n instanceof URL))throw Vt('"'.concat(i,'" must be an instance of URL'),Ji);Lw(n,o?.[Xi]!==!0);const l=r(new URL(n.href)),u=zu(o?.headers);return u.set("accept","application/json"),(o?.[Br]||fetch)(l.href,{body:void 0,headers:Object.fromEntries(u.entries()),method:"GET",redirect:"manual",signal:OO(l,o?.signal)})})(t,"issuerIdentifier",n=>{switch(e?.algorithm){case void 0:case"oidc":(function(i,r){i.pathname=Uz("".concat(i.pathname,"/").concat(r))})(n,".well-known/openid-configuration");break;case"oauth2":(function(i,r){let o=arguments.length>2&&arguments[2]!==void 0&&arguments[2];i.pathname==="/"?i.pathname=r:i.pathname=Uz("".concat(r,"/").concat(o?i.pathname:i.pathname.replace(/(\/)$/,"")))})(n,".well-known/oauth-authorization-server");break;default:throw Vt('"options.algorithm" must be "oidc" (default), or "oauth2"',dr)}return n},e)}function ac(t,e,n,i,r){try{if(typeof t!="number"||!Number.isFinite(t))throw Vt("".concat(n," must be a number"),Ji,r);if(t>0)return;if(e){if(t!==0)throw Vt("".concat(n," must be a non-negative number"),dr,r);return}throw Vt("".concat(n," must be a positive number"),dr,r)}catch(o){throw i?at(o.message,i,r):o}}function Un(t,e,n,i){try{if(typeof t!="string")throw Vt("".concat(e," must be a string"),Ji,i);if(t.length===0)throw Vt("".concat(e," must not be empty"),dr,i)}catch(r){throw n?at(r.message,n,i):r}}function YF(t){(function(e,n){if(Hw(e)!==n)throw(function(i){let r='"response" content-type must be ';for(var o=arguments.length,l=new Array(o>1?o-1:0),u=1;u<o;u++)l[u-1]=arguments[u];if(l.length>2){const d=l.pop();r+="".concat(l.join(", "),", or ").concat(d)}else l.length===2?r+="".concat(l[0]," or ").concat(l[1]):r+=l[0];return at(r,aH,i)})(e,n)})(t,"application/json")}function QF(){return Ru(crypto.getRandomValues(new Uint8Array(32)))}function hte(t){switch(t.algorithm.name){case"RSA-PSS":return(function(e){switch(e.algorithm.hash.name){case"SHA-256":return"PS256";case"SHA-384":return"PS384";case"SHA-512":return"PS512";default:throw new ps("unsupported RsaHashedKeyAlgorithm hash name",{cause:e})}})(t);case"RSASSA-PKCS1-v1_5":return(function(e){switch(e.algorithm.hash.name){case"SHA-256":return"RS256";case"SHA-384":return"RS384";case"SHA-512":return"RS512";default:throw new ps("unsupported RsaHashedKeyAlgorithm hash name",{cause:e})}})(t);case"ECDSA":return(function(e){switch(e.algorithm.namedCurve){case"P-256":return"ES256";case"P-384":return"ES384";case"P-521":return"ES512";default:throw new ps("unsupported EcKeyAlgorithm namedCurve",{cause:e})}})(t);case"Ed25519":case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return t.algorithm.name;case"EdDSA":return"Ed25519";default:throw new ps("unsupported CryptoKey algorithm name",{cause:t})}}function ef(t){const e=t?.[Ub];return typeof e=="number"&&Number.isFinite(e)?e:0}function Hb(t){const e=t?.[w2];return typeof e=="number"&&Number.isFinite(e)&&Math.sign(e)!==-1?e:30}function Kb(){return Math.floor(Date.now()/1e3)}function Wr(t){if(typeof t!="object"||t===null)throw Vt('"as" must be an object',Ji);Un(t.issuer,'"as.issuer"')}function qr(t){if(typeof t!="object"||t===null)throw Vt('"client" must be an object',Ji);Un(t.client_id,'"client.client_id"')}function Fz(t){return Un(t,'"clientSecret"'),(e,n,i,r)=>{i.set("client_id",n.client_id),i.set("client_secret",t)}}function fte(t,e){const n=(o=t)instanceof CryptoKey?{key:o}:o?.key instanceof CryptoKey?(o.kid!==void 0&&Un(o.kid,'"kid"'),{key:o.key,kid:o.kid}):{},i=n.key,r=n.kid;var o;return ute(i,'"clientPrivateKey.key"'),async(l,u,d,f)=>{const p={alg:hte(i),kid:r}
20,g=(function(v,y){const b=Kb()+ef(y);return{jti:QF(),aud:v.issuer,exp:b+60,iat:b,nbf:b,iss:y.client_id,sub:y.client_id}})(l,u);d.set("client_id",u.client_id),d.set("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),d.set("client_assertion",await(async function(v,y,b){if(!b.usages.includes("sign"))throw Vt('CryptoKey instances used for signing assertions must include "sign" in their "usages"',dr);const x="".concat(Ru(Lh(JSON.stringify(v))),".").concat(Ru(Lh(JSON.stringify(y)))),S=Ru(await crypto.subtle.sign((function(k){switch(k.algorithm.name){case"ECDSA":return{name:k.algorithm.name,hash:Mte(k)};case"RSA-PSS":switch(Zz(k),k.algorithm.hash.name){case"SHA-256":case"SHA-384":case"SHA-512":return{name:k.algorithm.name,saltLength:parseInt(k.algorithm.hash.name.slice(-3),10)>>3};default:throw new ps("unsupported RSA-PSS hash name",{cause:k})}case"RSASSA-PKCS1-v1_5":return Zz(k),k.algorithm.name;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":case"Ed25519":return k.algorithm.name}throw new ps("unsupported CryptoKey algorithm name",{cause:k})})(b),b,Lh(x)));return"".concat(x,".").concat(S)})(p,g,i))}}const pte=URL.parse?(t,e)=>URL.parse(t,e):(t,e)=>{try{return new URL(t,e)}catch{return null}};function Lw(t,e){if(e&&t.protocol!=="https:")throw at("only requests to HTTPS are allowed",lH,t);if(t.protocol!=="https:"&&t.protocol!=="http:")throw at("only HTTP and HTTPS requests are allowed",cH,t)}function Hz(t,e,n,i){let r;if(typeof t!="string"||!(r=pte(t)))throw at("authorization server metadata does not contain a valid ".concat(n?'"as.mtls_endpoint_aliases.'.concat(e,'"'):'"as.'.concat(e,'"')),t===void 0?jte:Pte,{attribute:n?"mtls_endpoint_aliases.".concat(e):e});return Lw(r,i),r}function Ku(t,e,n,i){return n&&t.mtls_endpoint_aliases&&e in t.mtls_endpoint_aliases?Hz(t.mtls_endpoint_aliases[e],e,n,i):Hz(t[e],e,n,i)}
20class Uw extends Error{constructor(e,n){var i;super(e,n),be(this,"cause",void 0),be(this,"code",void 0),be(this,"error",void 0),be(this,"status",void 0),be(this,"error_description",void 0),be(this,"response",void 0),this.name=this.constructor.name,this.code=Rte,this.cause=n.cause,this.error=n.cause.error,this.status=n.response.status,this.error_description=n.cause.error_description,Object.defineProperty(this,"response",{enumerable:!1,value:n.response}),(i=Error.captureStackTrace)===null||i===void 0||i.call(Error,this,this.constructor)}}class eH extends Error{constructor(e,n){var i,r;super(e,n),be(this,"cause",void 0),be(this,"code",void 0),be(this,"error",void 0),be(this,"error_description",void 0),this.name=this.constructor.name,this.code=$te,this.cause=n.cause,this.error=n.cause.get("error"),this.error_description=(i=n.cause.get("error_description"))!==null&&i!==void 0?i:void 0,(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,this.constructor)}}class RO extends Error{constructor(e,n){var i;super(e,n),be(this,"cause",void 0),be(this,"code",void 0),be(this,"response",void 0),be(this,"status",void 0),this.name=this.constructor.name,this.code=Ote,this.cause=n.cause,this.status=n.response.status,this.response=n.response,Object.defineProperty(this,"response",{enumerable:!1}),(i=Error.captureStackTrace)===null||i===void 0||i.call(Error,this,this.constructor)}}const Zb="[a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+",gte="("+Zb+')\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"',mte="("+Zb+")\\s*=\\s*("+Zb+")",vte=new RegExp("^[,\\s]*("+Zb+")"),yte=new RegExp("^[,\\s]*"+gte+"[,\\s]*(.*)"),_te=new RegExp("^[,\\s]*"+mte+"[,\\s]*(.*)"),bte=new RegExp("^([a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2})(?:$|[,\\s])(.*)");async function Fw(t,e,n){if(t.status!==e){let r;var i;throw rH(t),(r=await(async function(o){if(o.status>399&&o.status<500){vf(o),YF(o);try{const l=await o.clone().json();if(Fb(l)&&typeof l.error=="string"&&l.error.length)return l}catch{}}})(t))?(await((i=t.body)===null||i===void 0?void 0:i.cancel()),new Uw("server responded with an error in the response body",{cause:r,response:t})):at('"response" is not a conform '.concat(n," response (unexpected HTTP status code)"),Zw,t)}}function $O(t){if(!AO.has(t))throw Vt('"options.DPoP" is not a valid DPoPHandle',dr)}async function wte(t,e,n,i){Wr(t),qr(e);const r=Ku(t,"userinfo_endpoint",e.use_mtls_endpoint_aliases,i?.[Xi]!==!0),o=zu(i?.headers);return e.userinfo_signed_response_alg?o.set("accept","application/jwt"):(o.set("accept","application/json"),o.append("accept","application/jwt")),(async function(l,u,d,f,p,g){var v;if(Un(l,'"accessToken"'),!(d instanceof URL))throw Vt('"url" must be an instance of URL',Ji);Lw(d,g?.[Xi]!==!0),f=zu(f),g!=null&&g.DPoP&&($O(g.DPoP),await g.DPoP.addProof(d,f,u.toUpperCase(),l)),f.set("authorization","".concat(f.has("dpop")?"DPoP":"Bearer"," ").concat(l));const y=await(g?.[Br]||fetch)(d.href,{duplex:Xa(p,ReadableStream)?"half":void 0,body:p,headers:Object.fromEntries(f.entries()),method:u,redirect:"manual",signal:OO(d,g?.signal)}
20);return g==null||(v=g.DPoP)===null||v===void 0||v.cacheNonce(y,d),y})(n,"GET",r,o,null,Te(Te({},i),{},{[Ub]:ef(e)}))}const tH=Symbol();function Hw(t){var e;return(e=t.headers.get("content-type"))===null||e===void 0?void 0:e.split(";")[0]}async function xte(t,e,n,i,r){if(Wr(t),qr(e),!Xa(i,Response))throw Vt('"response" must be an instance of Response',Ji);if(rH(i),i.status!==200)throw at('"response" is not a conform UserInfo Endpoint response (unexpected HTTP status code)',Zw,i);let o;if(vf(i),Hw(i)==="application/jwt"){const l=await uH(await i.text(),dH.bind(void 0,e.userinfo_signed_response_alg,t.userinfo_signing_alg_values_supported,void 0),ef(e),Hb(e),r?.[bo]).then(Ste.bind(void 0,e.client_id)).then(kte.bind(void 0,t)),u=l.claims,d=l.jwt;iH.set(i,d),o=u}else{if(e.userinfo_signed_response_alg)throw at("JWT UserInfo Response expected",Ate,i);o=await ov(i)}if(Un(o.sub,'"response" body "sub" property',Nt,{body:o}),n!==tH){if(Un(n,'"expectedSubject"'),o.sub!==n)throw at('unexpected "response" body "sub" property value',qb,{expected:n,body:o,attribute:"sub"})}return o}async function Kw(t,e,n,i,r,o,l){return await n(t,e,r,o),o.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),(l?.[Br]||fetch)(i.href,{body:r,headers:Object.fromEntries(o.entries()),method:"POST",redirect:"manual",signal:OO(i,l?.signal)})}async function sv(t,e,n,i,r,o){var l;const u=Ku(t,"token_endpoint",e.use_mtls_endpoint_aliases,o?.[Xi]!==!0);r.set("grant_type",i);const d=zu(o?.headers);d.set("accept","application/json"),o?.DPoP!==void 0&&($O(o.DPoP),await o.DPoP.addProof(u,d,"POST"));const f=await Kw(t,e,n,u,r,d,o);return o==null||(l=o.DPoP)===null||l===void 0||l.cacheNonce(f,u),f}const nH=new WeakMap,iH=new WeakMap;function S2(t){if(!t.id_token)return;const e=nH.get(t);if(!e)throw Vt('"ref" was already garbage collected or did not resolve from the proper sources',dr);return e}async function tf(t,e,n,i,r,o){if(Wr(t),qr(e),!Xa(n,Response))throw Vt('"response" must be an instance of Response',Ji);await Fw(n,200,"Token Endpoint"),vf(n);const l=await ov(n);if(Un(l.access_token,'"response" body "access_token" property',Nt,{body:l}),Un(l.token_type,'"response" body "token_type" property',Nt,{body:l}),l.token_type=l.token_type.toLowerCase(),l.expires_in!==void 0){let u=typeof l.expires_in!="number"?parseFloat(l.expires_in):l.expires_in;ac(u,!0,'"response" body "expires_in" property',Nt,{body:l}),l.expires_in=u}if(l.refresh_token!==void 0&&Un(l.refresh_token,'"response" body "refresh_token" property',Nt,{body:l}),l.scope!==void 0&&typeof l.scope!="string")throw at('"response" body "scope" property must be a string',Nt,{body:l});if(l.id_token!==void 0){Un(l.id_token,'"response" body "id_token" property',Nt,{body:l});const u=["aud","exp","iat","iss","sub"];e.require_auth_time===!0&&u.push("auth_time"),e.default_max_age!==void 0&&(ac(e.default_max_age,!0,'"client.default_max_age"'),u.push("auth_time")),i!=null&&i.length&&u.push(...i);const d=await uH(l.id_token,dH.bind(void 0,e.id_token_signed_response_alg,t.id_token_signing_alg_values_supported,"RS256"),ef(e),Hb(e),r).then(Tte.bind(void 0,u)).then(oH.bind(void 0,t)).then(sH.bind(void 0,e.client_id)),f=d.claims,p=d.jwt;if(Array.isArray(f.aud)&&f.aud.length!==1){if(f.azp===void 0)throw at('ID Token "aud" (audience) claim includes additional untrusted audiences',Ka,{claims:f,claim:"aud"});if(f.azp!==e.client_id)throw at('unexpected ID Token "azp" (authorized party) claim value',Ka,{expected:e.client_id,claims:f,claim:"azp"})}f.auth_time!==void 0&&ac(f.auth_time,!0,'ID Token "auth_time" (authentication time)',Nt,{claims:f}),iH.set(n,p),nH.set(l,f)}
20if(o?.[l.token_type]!==void 0)o[l.token_type](n,l);else if(l.token_type!=="dpop"&&l.token_type!=="bearer")throw new ps("unsupported `token_type` value",{cause:{body:l}});return l}function rH(t){let e;if(e=(function(n){if(!Xa(n,Response))throw Vt('"response" must be an instance of Response',Ji);const i=n.headers.get("www-authenticate");if(i===null)return;const r=[];let o=i;for(;o;){var l;let p=o.match(vte);const g=(l=p)===null||l===void 0?void 0:l[1].toLowerCase();if(!g)return;const v=o.substring(p[0].length);if(v&&!v.match(/^[\s,]/))return;const y=v.match(/^\s+(.*)$/),b=!!y;o=y?y[1]:void 0;const x={};let S;if(b)for(;o;){let T,C;if(p=o.match(yte)){var u=ur(p,4);if(T=u[1],C=u[2],o=u[3],C.includes("\\"))try{C=JSON.parse('"'.concat(C,'"'))}catch{}x[T.toLowerCase()]=C}else{if(!(p=o.match(_te))){if(p=o.match(bte)){if(Object.keys(x).length)break;var d=ur(p,3);S=d[1],o=d[2];break}return}var f=ur(p,4);T=f[1],C=f[2],o=f[3],x[T.toLowerCase()]=C}}else o=v||void 0;const k={scheme:g,parameters:x};S&&(k.token68=S),r.push(k)}return r.length?r:void 0})(t))throw new RO("server responded with a challenge in the WWW-Authenticate HTTP Header",{cause:e,response:t})}function Ste(t,e){return e.claims.aud!==void 0?sH(t,e):e}function sH(t,e){if(Array.isArray(e.claims.aud)){if(!e.claims.aud.includes(t))throw at('unexpected JWT "aud" (audience) claim value',Ka,{expected:t,claims:e.claims,claim:"aud"})}else if(e.claims.aud!==t)throw at('unexpected JWT "aud" (audience) claim value',Ka,{expected:t,claims:e.claims,claim:"aud"});return e}function kte(t,e){return e.claims.iss!==void 0?oH(t,e):e}function oH(t,e){var n,i;const r=(n=(i=t[hH])===null||i===void 0?void 0:i.call(t,e))!==null&&n!==void 0?n:t.issuer;if(e.claims.iss!==r)throw at('unexpected JWT "iss" (issuer) claim value',Ka,{expected:r,claims:e.claims,claim:"iss"});return e}const AO=new WeakSet,Kz=Symbol(),Ete={aud:"audience",c_hash:"code hash",client_id:"client id",exp:"expiration time",iat:"issued at",iss:"issuer",jti:"jwt id",nonce:"nonce",s_hash:"state hash",sub:"subject",ath:"access token hash",htm:"http method",htu:"http uri",cnf:"confirmation",auth_time:"authentication time"};function Tte(t,e){for(const n of t)if(e.claims[n]===void 0)throw at('JWT "'.concat(n,'" (').concat(Ete[n],") claim missing"),Nt,{claims:e.claims});return e}const lE=Symbol(),cE=Symbol();async function Cte(t,e,n,i){return typeof i?.expectedNonce=="string"||typeof i?.maxAge=="number"||i!=null&&i.requireIdToken?(async function(r,o,l,u,d,f,p){const g=[];switch(u){case void 0:u=lE;break;case lE:break;default:Un(u,'"expectedNonce" argument'),g.push("nonce")}switch(d!=null||(d=o.default_max_age),d){case void 0:d=cE;break;case cE:break;default:ac(d,!0,'"maxAge" argument'),g.push("auth_time")}const v=await tf(r,o,l,g,f,p);Un(v.id_token,'"response" body "id_token" property',Nt,{body:v});const y=S2(v);if(d!==cE){const b=Kb()+ef(o),x=Hb(o);if(y.auth_time+d<b-x)throw at("too much time has elapsed since the last End-User authentication",$m,{claims:y,now:b,tolerance:x,claim:"auth_time"})}if(u===lE){if(y.nonce!==void 0)throw at('unexpected ID Token "nonce" claim value',Ka,{expected:void 0,claims:y,claim:"nonce"})}else if(y.nonce!==u)throw at('unexpected ID Token "nonce" claim value',Ka,{expected:u,claims:y,claim:"nonce"});return v})(t,e,n,i.expectedNonce,i.maxAge,i[bo],i.recognizedTokenTypes):(async function(r,o,l,u,d){const f=await tf(r,o,l,void 0,u,d),p=S2(f);if(p){if(o.default_max_age!==void 0){ac(o.default_max_age,!0,'"client.default_max_age"');const g=Kb()+ef(o),v=Hb(o);if(p.auth_time+o.default_max_age<g-v)throw at("too much time has elapsed since the last End-User authentication",$m,{claims:p,now:g,tolerance:v,claim:"auth_time"})}if(p.nonce!==void 0)throw at('unexpected ID Token "nonce" claim value',Ka,{expected:void 0,claims:p,claim:"nonce"})}return f})(t,e,n,i?.[bo],i?.recognizedTokenTypes)}const Ote="OAUTH_WWW_AUTHENTICATE_CHALLENGE",Rte="OAUTH_RESPONSE_BODY_ERROR",k2="OAUTH_UNSUPPORTED_OPERATION",$te="OAUTH_AUTHORIZATION_RESPONSE_ERROR",Ate="OAUTH_JWT_USERINFO_EXPECTED",Wb="OAUTH_PARSE_ERROR",Nt="OAUTH_INVALID_RESPONSE",aH="OAUTH_RESPONSE_IS_NOT_JSON",Zw="OAUTH_RESPONSE_IS_NOT_CONFORM",lH="OAUTH_HTTP_REQUEST_FORB
20IDDEN",cH="OAUTH_REQUEST_PROTOCOL_FORBIDDEN",$m="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",Ka="OAUTH_JWT_CLAIM_COMPARISON_FAILED",qb="OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED",jte="OAUTH_MISSING_SERVER_METADATA",Pte="OAUTH_INVALID_SERVER_METADATA";async function Nte(t){if(!Xa(t,Response))throw Vt('"response" must be an instance of Response',Ji);await Fw(t,200,"Revocation Endpoint")}function vf(t){if(t.bodyUsed)throw Vt('"response" body has been used already',dr)}function Zz(t){const e=t.algorithm;if(typeof e.modulusLength!="number"||e.modulusLength<2048)throw new ps("unsupported ".concat(e.name," modulusLength"),{cause:t})}function Mte(t){switch(t.algorithm.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new ps("unsupported ECDSA namedCurve",{cause:t})}}async function uH(t,e,n,i,r){let o,l,u=t.split("."),d=u[0],f=u[1],p=u.length;if(p===5){if(r===void 0)throw new ps("JWE decryption is not configured",{cause:t});var g=(t=await r(t)).split(".");d=g[0],f=g[1],p=g.length}if(p!==3)throw at("Invalid JWT",Nt,t);try{o=JSON.parse(Lh(Ru(d)))}catch(y){throw at("failed to parse JWT Header body as base64url encoded JSON",Wb,y)}if(!Fb(o))throw at("JWT Header must be a top level object",Nt,t);if(e(o),o.crit!==void 0)throw new ps('no JWT "crit" header parameter extensions are supported',{cause:{header:o}});try{l=JSON.parse(Lh(Ru(f)))}catch(y){throw at("failed to parse JWT Payload body as base64url encoded JSON",Wb,y)}if(!Fb(l))throw at("JWT Payload must be a top level object",Nt,t);const v=Kb()+n;if(l.exp!==void 0){if(typeof l.exp!="number")throw at('unexpected JWT "exp" (expiration time) claim type',Nt,{claims:l});if(l.exp<=v-i)throw at('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',$m,{claims:l,now:v,tolerance:i,claim:"exp"})}if(l.iat!==void 0&&typeof l.iat!="number")throw at('unexpected JWT "iat" (issued at) claim type',Nt,{claims:l});if(l.iss!==void 0&&typeof l.iss!="string")throw at('unexpected JWT "iss" (issuer) claim type',Nt,{claims:l});if(l.nbf!==void 0){if(typeof l.nbf!="number")throw at('unexpected JWT "nbf" (not before) claim type',Nt,{claims:l});if(l.nbf>v+i)throw at('unexpected JWT "nbf" (not before) claim value',$m,{claims:l,now:v,tolerance:i,claim:"nbf"})}if(l.aud!==void 0&&typeof l.aud!="string"&&!Array.isArray(l.aud))throw at('unexpected JWT "aud" (audience) claim type',Nt,{claims:l});return{header:o,claims:l,jwt:t}}async function Ite(t){if(t.method!=="POST")throw Vt("form_post responses are expected to use the POST method",dr,{cause:t});if(Hw(t)!=="application/x-www-form-urlencoded")throw Vt("form_post responses are expected to use the application/x-www-form-urlencoded content-type",dr,{cause:t});return(async function(e){if(e.bodyUsed)throw Vt("form_post Request instances must contain a readable body",dr,{cause:e});return e.text()})(t)}function dH(t,e,n,i){if(t===void 0)if(Array.isArray(e)){if(!e.includes(i.alg))throw at('unexpected JWT "alg" header parameter',Nt,{header:i,expected:e,reason:"authorization server metadata"})}else{if(n===void 0)throw at('missing client or server configuration to verify used JWT "alg" header parameter',void 0,{client:t,issuer:e,fallback:n});if(typeof n=="string"?i.alg!==n:typeof n=="function"?!n(i.alg):!n.includes(i.alg))throw at('unexpected JWT "alg" header parameter',Nt,{header:i,expected:n,reason:"default value"})}else if(typeof t=="string"?i.alg!==t:!t.includes(i.alg))throw at('unexpected JWT "alg" header parameter',Nt,{header:i,expected:t,reason:"client configuration"})}function su(t,e){const n=t.getAll(e),i=n[0];if(n.length>1)throw at('"'.concat(e,'" parameter must be provided only once'),Nt);return i}const zte=Symbol(),Dte=Symbol();function Lte(t,e,n,i){if(Wr(t),qr(e),n instanceof URL&&(n=n.searchParams),!(n instanceof URLSearchParams))throw Vt('"parameters" must be an instance of URLSearchParams, or URL',Ji);if(su(n,"response"))throw at('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()',Nt,{parameters:n});const r=su(n,"iss"),o=su(n,"state");if(!r&&t.authorization_response_iss_parameter_supported)throw at('response parameter "iss" (issuer) missing',Nt,{parameters:n});if(r&&r!==t.issuer)throw at('unexpected "iss" (issuer) response parameter value',Nt,{expected:t.issuer,parameters:n});switch(i){case void 0:case Dte:if(o!==void 0)throw at('unexpected "state" response parameter encountered',Nt,{expected:void 0,parameters:n});break;case zte:break;default:if(Un(i,'"expectedState" argument'),o!==i)throw at(o===void 0?'response parameter "state" missing':'unexpected "state" response parameter value',Nt,{expected:i,parameters:n})}if(su(n,"error"))throw new eH("authorization response from the server is an error",{cause:n});const l=su(n,"id_token"),u=su(n,"token");if(l!==void 0||u!==void 0)throw new ps("implicit and hybrid flows are not supported");return d=new URLSearchParams(n),AO.add(d),d;var d}async function ov(t){let e,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:YF;try{e=await t.json()}catch(i){throw n(t),at('failed to parse "response" body as JSON',Wb,i)}if(!Fb(e))throw at('"response" body must be a top level object',Nt,{body:e});return e}const uE=Symbol(),hH=Symbol(),fH=new TextEncoder,E2=new TextDecoder,jO=new TextDecoder("utf-8",{fatal:!0});function pH(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const i=e.reduce((l,u)=>
20l+u.length,0),r=new Uint8Array(i);let o=0;for(const l of e)r.set(l,o),o+=l.length;return r}function $u(t){const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++){const i=t.charCodeAt(n);if(i>127)throw new TypeError("non-ASCII string encountered in encode()");e[n]=i}return e}const S0=function(t){return new TypeError("CryptoKey does not support this operation, its ".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"algorithm.name"," must be ").concat(t))};function Ute(t,e,n){var i;const r=t.algorithm;if(r.name!==e.name)throw S0(e.name);if(e.hash&&((i=r.hash)===null||i===void 0?void 0:i.name)!==e.hash)throw S0(e.hash,"algorithm.hash");if(e.namedCurve&&r.namedCurve!==e.namedCurve)throw S0(e.namedCurve,"algorithm.namedCurve");if(e.length!==void 0&&r.length!==e.length)throw S0(e.length,"algorithm.length");(function(o,l){if(l&&!o.usages.includes(l))throw new TypeError("CryptoKey does not support this operation, its usages must include ".concat(l,"."))})(t,n)}const k0=function(t,e){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return(function(o,l){for(var u=arguments.length,d=new Array(u>2?u-2:0),f=2;f<u;f++)d[f-2]=arguments[f];if(d.length>2){const g=d.pop();o+="one of type ".concat(d.join(", "),", or ").concat(g,".")}else d.length===2?o+="one of type ".concat(d[0]," or ").concat(d[1],"."):o+="of type ".concat(d[0],".");if(l==null)o+=" Received ".concat(l);else if(typeof l=="function"&&l.name)o+=" Received function ".concat(l.name);else if(typeof l=="object"&&l!=null){var p;(p=l.constructor)!==null&&p!==void 0&&p.name&&(o+=" Received an instance of ".concat(l.constructor.name))}return o})("Key for the ".concat(t," algorithm must be "),e,...i)};class Yi extends Error{constructor(e,n){var i;super(e,n),be(this,"code","ERR_JOSE_GENERIC"),this.name=this.constructor.name,(i=Error.captureStackTrace)===null||i===void 0||i.call(Error,this,this.constructor)}}be(Yi,"code","ERR_JOSE_GENERIC");class yu extends Yi{constructor(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"unspecified",r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unspecified";super(e,{cause:{claim:i,reason:r,payload:n}}),be(this,"code","ERR_JWT_CLAIM_VALIDATION_FAILED"),be(this,"claim",void 0),be(this,"reason",void 0),be(this,"payload",void 0),this.claim=i,this.reason=r,this.payload=n}}be(yu,"code","ERR_JWT_CLAIM_VALIDATION_FAILED");class T2 extends Yi{constructor(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"unspecified",r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unspecified";super(e,{cause:{claim:i,reason:r,payload:n}}),be(this,"code","ERR_JWT_EXPIRED"),be(this,"claim",void 0),be(this,"reason",void 0),be(this,"payload",void 0),this.claim=i,this.reason=r,this.payload=n}}be(T2,"code","ERR_JWT_EXPIRED");class gH extends Yi{constructor(){super(...arguments),be(this,"code","ERR_JOSE_ALG_NOT_ALLOWED")}}be(gH,"code","ERR_JOSE_ALG_NOT_ALLOWED");class qa extends Yi{constructor(){super(...arguments),be(this,"code","ERR_JOSE_NOT_SUPPORTED")}}be(qa,"code","ERR_JOSE_NOT_SUPPORTED");be(class extends Yi{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"decryption operation failed",arguments.length>1?arguments[1]:void 0),be(this,"code","ERR_JWE_DECRYPTION_FAILED")}},"code","ERR_JWE_DECRYPTION_FAILED");be(class extends Yi{constructor(){super(...arguments),be(this,"code","ERR_JWE_INVALID")}},"code","ERR_JWE_INVALID");class or extends Yi{constructor(){super(...arguments),be(this,"code","ERR_JWS_INVALID")}}be(or,"code","ERR_JWS_INVALID");class uo extends Yi{constructor(){super(...arguments),be(this,"code","ERR_JWT_INVALID")}}be(uo,"code","ERR_JWT_INVALID");be(class extends Yi{constructor(){super(...arguments),be(this,"code","ERR_JWK_INVALID")}},"code","ERR_JWK_INVALID");class PO extends Yi{constructor(){super(...arguments),be(this,"code","ERR_JWKS_INVALID")}}be(PO,"code","ERR_JWKS_INVALID");class NO extends Yi{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"no applicable key found in the JSON Web Key Set",arguments.length>
201?arguments[1]:void 0),be(this,"code","ERR_JWKS_NO_MATCHING_KEY")}}be(NO,"code","ERR_JWKS_NO_MATCHING_KEY");class mH extends Yi{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"multiple matching keys found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),be(this,Symbol.asyncIterator,MF(function*(){})),be(this,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS")}}be(mH,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS");class vH extends Yi{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"request timed out",arguments.length>1?arguments[1]:void 0),be(this,"code","ERR_JWKS_TIMEOUT")}}be(vH,"code","ERR_JWKS_TIMEOUT");class yH extends Yi{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"signature verification failed",arguments.length>1?arguments[1]:void 0),be(this,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED")}}be(yH,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED");const _H=t=>{if(t?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return t instanceof CryptoKey}catch{return!1}},Fte=t=>_H(t)||(e=>e?.[Symbol.toStringTag]==="KeyObject")(t);function bH(t){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(t);const e=atob(t),n=new Uint8Array(e.length);for(let i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return n}const dE="The input to be decoded is not correctly encoded.";function Ww(t){if(Uint8Array.fromBase64)try{return Uint8Array.fromBase64(typeof t=="string"?t:E2.decode(t),{alphabet:"base64url"})}catch(n){throw new TypeError(dE,{cause:n})}let e=t;if(e instanceof Uint8Array&&(e=E2.decode(e)),e.includes("+")||e.includes("/"))throw new TypeError(dE);e=e.replace(/-/g,"+").replace(/_/g,"/");try{return bH(e)}catch{throw new TypeError(dE)}}function MO(t){let e=t;return typeof e=="string"&&(e=fH.encode(e)),Uint8Array.prototype.toBase64?e.toBase64({alphabet:"base64url",omitPadding:!0}):(function(n){if(Uint8Array.prototype.toBase64)return n.toBase64();const i=[];for(let r=0;r<n.length;r+=32768)i.push(String.fromCharCode.apply(null,n.subarray(r,r+32768)));return btoa(i.join(""))})(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function dc(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||Object.getPrototypeOf(e)===null}function wH(t){return dc(t)&&Array.isArray(t.keys)&&Array.from(t.keys).every(dc)}function Wz(t,e,n){try{return Ww(t)}catch{throw new n("Failed to base64url decode the ".concat(e))}}async function xH(t,e){var n,i,r,o;if(e.kty==="RSA"&&"oth"in e&&e.oth!==void 0)throw new qa('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');if(!t.kty.includes(e.kty))throw new qa('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');const l=(n=(i=t.resolve)===null||i===void 0?void 0:i.call(t,{kty:e.kty,crv:e.crv}))!==null&&n!==void 0?n:t.subtle,u=!(!e.d&&!e.priv),d=Te({},e);return d.kty!=="AKP"&&delete d.alg,delete d.use,crypto.subtle.importKey("jwk",d,l,(r=e.ext)!==null&&r!==void 0?r:!u,(o=e.key_ops)!==null&&o!==void 0?o:t.usages[u?1:0])}function SH(t){return Te({__proto__:null},t)}const hE=t=>t[Symbol.toStringTag];function Hte(t,e,n){const i=t.alg,r=t.secret,o=n==="decrypt"||n==="sign";if(r&&e instanceof Uint8Array)return[kH,e];if(dc(e)){const l=(function(u){const d=SH(u);if(d.ext!==void 0&&typeof d.ext!="boolean")throw new TypeError('"ext" (Extractable) Parameter must be a boolean');if(d.key_ops!==void 0){const f=d.key_ops,p=Array.isArray(f)?[...f]:void 0;if(!p||p.some(g=>typeof g!="string")||new Set(p).size!==p.length)throw new TypeError('"key_ops" (Key Operations) Parameter must be an array of unique strings');d.key_ops=p}return d})(e);if(typeof l.kty!="string")throw new TypeError(r?k0(i,e,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"):k0(i,e,"CryptoKey","KeyObject","JSON Web Key"));if(!(r?l.kty==="oct"&&typeof l.k=="string":l.kty!=="oct"&&(o?l.kty==="AKP"&&typeof l.priv=="string"||typeof l.d=="string":l.d===void 0&&l.priv===void 0)))throw new TypeError(r?'JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present':"JSON Web Key for this operation must be a ".concat(o?"private":"public"," JWK"));return((u,d,f)=>{const p=u.alg;if(d.use!==void 0){const v=f==="sign"||f==="verify"?"sig":"enc";if(d.use!==v)throw new TypeError('Invalid key for this operation, its "use" must be "'.concat(v,'" when present'))}if(d.alg!==void 0&&d.alg!==p)throw new TypeError('Invalid key for this operation, its "alg" must be "'.concat(p,'" when present'));if(Array.isArray(d.key_ops)){var g;const v=f==="encrypt"||f==="decrypt"?(g=u.ops)===null||g===void 0?void 0:g[f==="encrypt"?0:1]:f;if(v&&!d.key_ops.includes(v))throw new TypeError('Invalid key for this operation, its "key_ops" must include "'.concat(v,'" when present'))}})(t,l,n),[CH,e,l]}if(!Fte(e))throw new TypeError(r?k0(i,e,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"):k0(i,e,"CryptoKey","KeyObject","JSON Web Key"));if(r){if(e.type!=="secret")throw new TypeError("".concat(hE(e),' instances for symmetric algorithms must be of type "secret"'))}else{if(e.type==="secret")throw new TypeError("".concat(hE(e),' instances for asymmetric algorithms must not be of type "secret"'));const l=o?"private":"public";if((e.type==="public"||e.type==="private")&&e.type!==l){const u=n==="sign"?"signing":n==="verify"?"verifying":"".concat(n.slice(0,-1),"tion");throw new TypeError("".concat(hE(e)," instances for asymmetric algorithm ").concat(u,' must be of type "').concat(l,'"'))}}return _H(e)?[EH,e]:[TH,e]}const kH=0,EH=1,TH=2,CH=3;let E0;const Kte={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"};function Vb(t,e,n){E0||(E0=new WeakMap);const i=E0.get(t);return n&&(i?i[e]=n:E0.set(t,{[e]:n})),n??i?.[e]}
20const qz=async(t,e,n)=>{var i;return(i=Vb(t,n.alg))!==null&&i!==void 0?i:Vb(t,n.alg,await xH(n,Te(Te({},e),{},{alg:n.alg})))};async function OH(t,e,n){const i=Hte(t,e,n);switch(i[0]){case kH:case EH:return i[1];case CH:{const r=i[1],o=i[2];if(o.kty==="oct")return Ww(o.k);if(!Object.isFrozen(r)){const l=r.key_ops;Array.isArray(l)&&Object.freeze(l),Object.freeze(r)}return qz(r,o,t)}case TH:{const r=i[1];return r.type==="secret"?r.export():"toCryptoKey"in r&&typeof r.toCryptoKey=="function"?((o,l)=>{var u,d,f;const p=Vb(o,l.alg);if(p)return p;const g=o.type==="public",v=l.usages[g?0:1],y=o.asymmetricKeyType,b=Kte[(u=o.asymmetricKeyDetails)===null||u===void 0?void 0:u.namedCurve],x=(d=(f=l.resolve)===null||f===void 0?void 0:f.call(l,{crv:b,asymmetricKeyType:y}))!==null&&d!==void 0?d:l.subtle;return Vb(o,l.alg,o.toCryptoKey(x,g,v))})(r,t):qz(r,r.export({format:"jwk"}),t)}}}function IO(t){const e={__proto__:null};for(const n in t)e[n]=Te(Te({},t[n]),{},{alg:n});return e}const Zte=[["encrypt","wrapKey"],["decrypt","unwrapKey"]],Wte=[[],["deriveBits"]],qw=[[],[]];function T0(t){return{kty:["RSA"],subtle:{name:"RSA-OAEP",hash:"SHA-".concat(t)},usages:Zte,ops:["wrapKey","unwrapKey"]}}function C0(){return{kty:["EC","OKP"],subtle:{name:"ECDH"},resolve:t=>{let e=t.kty,n=t.crv,i=t.asymmetricKeyType;if(n==="X25519"||i==="x25519")return{name:"X25519"};if(e==="OKP")throw new qa('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');return{name:"ECDH",namedCurve:n}},usages:Wte,ops:[void 0,"deriveBits"]}}function Jd(t){let e=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return{kty:["oct"],secret:!0,subtle:{name:e?"AES-GCM":"AES-KW",length:t},usages:qw,ops:e?["encrypt","decrypt"]:["wrapKey","unwrapKey"]}}function fE(){return{kty:["oct"],secret:!0,subtle:{name:"PBKDF2"},usages:qw,ops:["deriveBits","deriveBits"]}}const qte=IO({dir:{kty:["oct"],secret:!0,subtle:{name:"AES-GCM"},usages:qw,ops:["encrypt","decrypt"]},"RSA-OAEP":T0(1),"RSA-OAEP-256":T0(256),"RSA-OAEP-384":T0(384),"RSA-OAEP-512":T0(512),"ECDH-ES":C0(),"ECDH-ES+A128KW":C0(),"ECDH-ES+A192KW":C0(),"ECDH-ES+A256KW":C0(),A128KW:Jd(128),A192KW:Jd(192),A256KW:Jd(256),A128GCMKW:Jd(128,!0),A192GCMKW:Jd(192,!0),A256GCMKW:Jd(256,!0),"PBES2-HS256+A128KW":fE(),"PBES2-HS384+A192KW":fE(),"PBES2-HS512+A256KW":fE()}),Vte=["encrypt","decrypt"];function Xd(t){let e=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return{kty:["oct"],secret:!0,subtle:{name:e?"AES-CBC":"AES-GCM",length:t},usages:qw,ops:Vte,cekBits:t,ivBits:e?128:96,cbc:e}}IO({A128GCM:Xd(128),A192GCM:Xd(192),A256GCM:Xd(256),"A128CBC-HS256":Xd(256,!0),"A192CBC-HS384":Xd(384,!0),"A256CBC-HS512":Xd(512,!0)});const RH={__proto__:null,b64:!0};function Bte(t,e){if(e!==void 0&&(!Array.isArray(e)||e.some(n=>typeof n!="string")))throw new TypeError('"'.concat(t,'" option must be an array of strings'));if(e)return new Set(e)}function $H(t,e,n,i,r){if(r.crit!==void 0&&i?.crit===void 0)throw new t('"crit" (Critical) Header Parameter MUST be integrity protected');if(!i||i.crit===void 0)return[];if(!Array.isArray(i.crit)||i.crit.length===0||i.crit.some(l=>typeof l!="string"||l.length===0))throw new t('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');const o=n===void 0?e:Te(Te({__proto__:null},n),e);for(const l of i.crit){if(!(l in o))throw new qa('Extension Header Parameter "'.concat(l,'" is not recognized'));if(!Object.hasOwn(r,l)||r[l]===void 0)throw new t('Extension Header Parameter "'.concat(l,'" is missing'));if(o[l]&&(!Object.hasOwn(i,l)||i[l]===void 0))throw new t('Extension Header Parameter "'.concat(l,'" MUST be integrity protected'))}return i.crit}function AH(t,e){if(e.includes("b64")){const n=t.b64;if(typeof n!="boolean")throw new or('The "b64" (base64url-encode payload) Header Parameter must be a boolean');return n}return!0}var O0,pE;let Ks,Vz;(typeof navigator>"u"||(O0=navigator.userAgent)===null||O0===void 0||(pE=O0.startsWith)===null||pE===void 0||!pE.call(O0,"Mozilla/5.0 "))&&(Vz="".concat("openid-client","/").concat("v6.8.4"),Ks={"user-agent":Vz});const vi=t=>A_.get(t);let A_,R0;function jH(t){return t!==void 0?Fz(t):(R0||(R0=new WeakMap),(e,n,i,r)=>{let o;return(o=R0.get(n))||((function(l,u){if(typeof l!="string")throw ia("".concat(u," must be a string"),lv);if(l.length===0)throw ia("".concat(u," must not be empty"),av)})(n.client_secret,'"metadata.client_secret"'),o=Fz(n.client_secret),R0.set(n,o)),o(e,n,i,r)})}const Gte=tH,It=Br,av="ERR_INVALID_ARG_VALUE",lv="ERR_INVALID_ARG_TYPE";function ia(t,e,n){const i=new TypeError(t,{cause:n});return Object.assign(i,{code:e}),i}function Jte(t){return(async function(e){return Un(e,"codeVerifier"),Ru(await crypto.subtle.digest("SHA-256",Lh(e)))})(t)}function Xte(){return QF()}
20class Bb extends Error{constructor(e,n){var i;super(e,n),be(this,"code",void 0),this.name=this.constructor.name,this.code=n?.code,(i=Error.captureStackTrace)===null||i===void 0||i.call(Error,this,this.constructor)}}function _r(t,e,n){return new Bb(t,{cause:e,code:n})}function bi(t){if(t instanceof TypeError||t instanceof Bb||t instanceof Uw||t instanceof eH||t instanceof RO)throw t;if(t instanceof CO)switch(t.code){case lH:throw _r("only requests to HTTPS are allowed",t,t.code);case cH:throw _r("only requests to HTTP or HTTPS are allowed",t,t.code);case Zw:throw _r("unexpected HTTP response status code",t.cause,t.code);case aH:throw _r("unexpected response content-type",t.cause,t.code);case Wb:throw _r("parsing error occured",t,t.code);case Nt:throw _r("invalid response encountered",t,t.code);case Ka:throw _r("unexpected JWT claim value encountered",t,t.code);case qb:throw _r("unexpected JSON attribute value encountered",t,t.code);case $m:throw _r("JWT timestamp claim value failed validation",t,t.code);default:throw _r(t.message,t,t.code)}if(t instanceof ps)throw _r("unsupported operation",t,t.code);if(t instanceof DOMException)switch(t.name){case"OperationError":throw _r("runtime operation error",t,k2);case"NotSupportedError":throw _r("runtime unsupported operation",t,k2);case"TimeoutError":throw _r("operation timed out",t,"OAUTH_TIMEOUT");case"AbortError":throw _r("operation aborted",t,"OAUTH_ABORT")}throw new Bb("something went wrong",{cause:t})}async function Yte(t,e,n,i,r){const o=await(async function(d,f){var p,g;if(!(d instanceof URL))throw ia('"server" must be an instance of URL',lv);const v=!d.href.includes("/.well-known/"),y=(p=f?.timeout)!==null&&p!==void 0?p:30,b=AbortSignal.timeout(1e3*y),x=await(v?dte(d,{algorithm:f?.algorithm,[Br]:f?.[It],[Xi]:f==null||(g=f.execute)===null||g===void 0?void 0:g.includes(Gz),signal:b,headers:new Headers(Ks)}):(f?.[It]||fetch)((Lw(d,f==null||(S=f.execute)===null||S===void 0||!S.includes(Gz)),d.href),{headers:Object.fromEntries(new Headers(Te({accept:"application/json"},Ks)).entries()),body:void 0,method:"GET",redirect:"manual",signal:b})).then(k=>(async function(T,C){const A=T;if(!(A instanceof URL)&&A!==uE)throw Vt('"expectedIssuerIdentifier" must be an instance of URL',Ji);if(!Xa(C,Response))throw Vt('"response" must be an instance of Response',Ji);if(C.status!==200)throw at('"response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)',Zw,C);vf(C);const $=await ov(C);if(Un($.issuer,'"response" body "issuer" property',Nt,{body:$}),A!==uE&&new URL($.issuer).href!==A.href)throw at('"response" body "issuer" property does not match the expected value',qb,{expected:A.href,body:$,attribute:"issuer"});return $})(uE,k)).catch(bi);var S;return v&&new URL(x.issuer).href!==d.href&&((function(k,T,C){return!(k.origin!=="https://login.microsoftonline.com"||C!=null&&C.algorithm&&C.algorithm!=="oidc"||(T[PH]=!0,0))})(d,x,f)||(function(k,T){return!(!k.hostname.endsWith(".b2clogin.com")||T!=null&&T.algorithm&&T.algorithm!=="oidc")})(d,f)||(()=>{throw new Bb("discovered metadata issuer does not match the expected issuer",{code:qb,cause:{expected:d.href,body:x,attribute:"issuer"}})})()),x})(t,r),l=new nf(o,e,n,i);let u=vi(l);if(r!=null&&r[It]&&(u.fetch=r[It]),r!=null&&r.timeout&&(u.timeout=r.timeout),r!=null&&r.execute)for(const d of r.execute)d(l);return l}new TextDecoder;const PH=Symbol();
20class nf{constructor(e,n,i,r){var o,l,u,d,f;if(typeof n!="string"||!n.length)throw ia('"clientId" must be a non-empty string',lv);if(typeof i=="string"&&(i={client_secret:i}),((o=i)===null||o===void 0?void 0:o.client_id)!==void 0&&n!==i.client_id)throw ia('"clientId" and "metadata.client_id" must be the same',av);const p=Te(Te({},structuredClone(i)),{},{client_id:n});let g;p[Ub]=(l=(u=i)===null||u===void 0?void 0:u[Ub])!==null&&l!==void 0?l:0,p[w2]=(d=(f=i)===null||f===void 0?void 0:f[w2])!==null&&d!==void 0?d:30,g=r||(typeof p.client_secret=="string"&&p.client_secret.length?jH(p.client_secret):(x,S,k,T)=>{k.set("client_id",S.client_id)});let v=Object.freeze(p);const y=structuredClone(e);PH in e&&(y[hH]=x=>{let S=x.claims.tid;return e.issuer.replace("{tenantid}",S)});let b=Object.freeze(y);A_||(A_=new WeakMap),A_.set(this,{__proto__:null,as:b,c:v,auth:g,tlsOnly:!0,jwksCache:{}})}serverMetadata(){const e=structuredClone(vi(this).as);return(function(n){Object.defineProperties(n,(function(i){return{supportsPKCE:{__proto__:null,value(){var r;let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"S256";return((r=i.code_challenge_methods_supported)===null||r===void 0?void 0:r.includes(o))===!0}}}})(n))})(e),e}clientMetadata(){return structuredClone(vi(this).c)}get timeout(){return vi(this).timeout}set timeout(e){vi(this).timeout=e}get[It](){return vi(this).fetch}set[It](e){vi(this).fetch=e}}function cv(t){Object.defineProperties(t,(function(e){let n;if(e.expires_in!==void 0){const i=new Date;i.setSeconds(i.getSeconds()+e.expires_in),n=i.getTime()}
20return{expiresIn:{__proto__:null,value(){if(n){const i=Date.now();return n>i?Math.floor((n-i)/1e3):0}}},claims:{__proto__:null,value(){try{return S2(this)}catch{return}}}}})(t))}async function Bz(t,e,n){var i;let r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];const o=(i=t.headers.get("retry-after"))===null||i===void 0?void 0:i.trim();if(o===void 0)return;let l;if(/^\d+$/.test(o))l=parseInt(o,10);else{const u=new Date(o);if(Number.isFinite(u.getTime())){const d=new Date,f=u.getTime()-d.getTime();f>0&&(l=Math.ceil(f/1e3))}}if(r&&!Number.isFinite(l))throw new CO("invalid Retry-After header value",{cause:t});l>e&&await NH(l-e,n)}function NH(t,e){return new Promise((n,i)=>{const r=o=>{try{e.throwIfAborted()}catch(u){return void i(u)}if(o<=0)return void n();const l=Math.min(o,5);setTimeout(()=>r(o-l),1e3*l)};r(t)})}async function gE(t,e){So(t);const n=vi(t),i=n.as,r=n.c,o=n.auth,l=n.fetch,u=n.tlsOnly,d=n.timeout;return(async function(f,p,g,v,y){Wr(f),qr(p);const b=Ku(f,"backchannel_authentication_endpoint",p.use_mtls_endpoint_aliases,y?.[Xi]!==!0),x=new URLSearchParams(v);x.set("client_id",p.client_id);const S=zu(y?.headers);return S.set("accept","application/json"),Kw(f,p,g,b,x,S,y)})(i,r,o,e,{[Br]:l,[Xi]:!u,headers:new Headers(Ks),signal:Ya(d)}).then(f=>(async function(p,g,v){if(Wr(p),qr(g),!Xa(v,Response))throw Vt('"response" must be an instance of Response',Ji);await Fw(v,200,"Backchannel Authentication Endpoint"),vf(v);const y=await ov(v);Un(y.auth_req_id,'"response" body "auth_req_id" property',Nt,{body:y});let b=typeof y.expires_in!="number"?parseFloat(y.expires_in):y.expires_in;return ac(b,!0,'"response" body "expires_in" property',Nt,{body:y}),y.expires_in=b,y.interval!==void 0&&ac(y.interval,!1,'"response" body "interval" property',Nt,{body:y}),y})(i,r,f)).catch(bi)}async function C2(t,e,n,i){var r,o;So(t),n=new URLSearchParams(n);let l=(r=e.interval)!==null&&r!==void 0?r:5;const u=(o=i?.signal)!==null&&o!==void 0?o:AbortSignal.timeout(1e3*e.expires_in);try{await NH(l,u)}catch(j){bi(j)}const d=vi(t),f=d.as,p=d.c,g=d.auth,v=d.fetch,y=d.tlsOnly,b=d.nonRepudiation,x=d.timeout,S=d.decrypt,k=(j,O)=>C2(t,Te(Te({},e),{},{interval:j}),n,Te(Te({},i),{},{signal:u,flag:O})),T=(function(j,O){const L=Ya(O);if(!L)return{signal:j,cleanup(){}};const B=new AbortController,V=ee=>{const me=ee.target;B.abort(me.reason)};return j.aborted?B.abort(j.reason):L.aborted?B.abort(L.reason):(j.addEventListener("abort",V,{once:!0}),L.addEventListener("abort",V,{once:!0})),{signal:B.signal,cleanup(){j.removeEventListener("abort",V),L.removeEventListener("abort",V)}}})(u,x),C=await(async function(j,O,L,B,V){Wr(j),qr(O),Un(B,'"authReqId"');const ee=new URLSearchParams(V?.additionalParameters);return ee.set("auth_req_id",B),sv(j,O,L,"urn:openid:params:grant-type:ciba",ee,V)})(f,p,g,e.auth_req_id,{[Br]:v,[Xi]:!y,additionalParameters:n,DPoP:i?.DPoP,headers:new Headers(Ks),signal:T.signal}).catch(bi).finally(T.cleanup);var A;if(C.status===503&&C.headers.has("retry-after"))return await Bz(C,l,u,!0),await((A=C.body)===null||A===void 0?void 0:A.cancel()),k(l);const $=(async function(j,O,L,B){return tf(j,O,L,void 0,B?.[bo],B?.recognizedTokenTypes)})(f,p,C,{[bo]:S});let N;try{N=await $}catch(j){if(Zu(j,i))return k(l,Qo);if(j instanceof Uw)switch(j.error){case"slow_down":l+=5;case"authorization_pending":return await Bz(j.response,l,u),k(l)}bi(j)}return N.id_token&&await b?.(C),cv(N),N}function Gz(t){vi(t).tlsOnly=!1}async function _g(t,e,n,i,r){if(So(t),!(r?.flag===Qo||e instanceof URL||(function(j,O){try{return Object.getPrototypeOf(j)[Symbol.toStringTag]===O}catch{return!1}})(e,"Request")))throw ia('"currentUrl" must be an instance of URL, or Request',lv);let o,l;const u=vi(t),d=u.as,f=u.c,p=u.auth,g=u.fetch,v=u.tlsOnly,y=u.jarm,b=u.hybrid,x=u.nonRepudiation,S=u.timeout,k=u.decrypt,T=u.implicit;if(r?.flag===Qo)o=r.authResponse,l=r.redirectUri;else{if(!(e instanceof URL)){const j=e;switch(e=new URL(e.url),j.method){case"GET":break;case"POST":const O=new URLSearchParams(await Ite(j));if(b)e.hash=O.toString();else for(const L of O.entries()){var C=ur(L,2);const B=C[0],V=C[1];e.searchParams.append(B,V)}break;default:throw ia("unexpected Request HTTP method",av)}}switch(l=(function(j){return(j=new URL(j)).search="",j.hash="",j.href})(e),!0){case!!y:o=await y(e,n?.expectedState);break;case!!b:o=await b(e,n?.expectedNonce,n?.expectedState,n?.maxAge);break;case!!T:throw new TypeError("authorizationCodeGrant() cannot be used by response_type=id_token clients");default:try{o=Lte(d,f,e.searchParams,n?.expectedState)}catch(j){bi(j)}}}const A=await(async function(j,O,L,B,V,ee,me){if(Wr(j),qr(O),!AO.has(B))throw Vt('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()',dr);Un(V,'"redirectUri"');const ne=su(B,"code");if(!ne)throw at('no authorization code in "callbackParameters"',Nt);const ce=new URLSearchParams(me?.additionalParameters);return ce.set("redirect_uri",V),ce.set("code",ne),ee!==Kz&&(Un(ee,'"codeVerifier"'),ce.set("code_verifier",ee)),sv(j,O,L,"authorization_code",ce,me)})(d,f,p,o,l,n?.pkceCodeVerifier||Kz,{additionalParameters:i,[Br]:g,[Xi]:!v,DPoP:r?.DPoP,headers:new Headers(Ks),signal:Ya(S)}).catch(bi);typeof n?.expectedNonce!="string"&&typeof n?.maxAge!="number"||(n.idTokenExpected=!0);const $=Cte(d,f,A,{expectedNonce:n?.expectedNonce,maxAge:n?.maxAge,requireIdToken:n?.idTokenExpected,[bo]:k});let N;try{N=await $}catch(j){if(Zu(j,r))return _g(t,void 0,n,i,Te(Te({},r),{},{flag:Qo,authResponse:o,redirectUri:l}));bi(j)}return N.id_token&&await x?.(A),cv(N),N}async function O2(t,e,n,i){So(t),n=new URLSearchParams(n);const r=vi(t),o=r.as,l=r.c,u=r.auth,d=r.fetch,f=r.tlsOnly,p=r.nonRepudiation,g=r.timeout,v=r.decrypt,y=await(async function(S,k,T,C,A){Wr(S),qr(k),Un(C,'"refreshToken"');const $=new URLSearchParams(A?.additionalParameters);return $.set("refresh_token",C),sv(S,k,T,"refresh_token",$,A)})(o,l,u,e,{[Br]:d,[Xi]:!f,additionalParameters:n,DPoP:i?.DPoP,headers:new Headers(Ks),signal:Ya(g)}
20).catch(bi),b=(async function(S,k,T,C){return tf(S,k,T,void 0,C?.[bo],C?.recognizedTokenTypes)})(o,l,y,{[bo]:v});let x;try{x=await b}catch(S){if(Zu(S,i))return O2(t,e,n,Te(Te({},i),{},{flag:Qo}));bi(S)}return x.id_token&&await p?.(y),cv(x),x}async function R2(t,e,n){So(t),e=new URLSearchParams(e);const i=vi(t),r=i.as,o=i.c,l=i.auth,u=i.fetch,d=i.tlsOnly,f=i.timeout,p=await(async function(y,b,x,S,k){return Wr(y),qr(b),sv(y,b,x,"client_credentials",new URLSearchParams(S),k)})(r,o,l,e,{[Br]:u,[Xi]:!d,DPoP:n?.DPoP,headers:new Headers(Ks),signal:Ya(f)}).catch(bi),g=(async function(y,b,x,S){return tf(y,b,x,void 0,void 0,void 0)})(r,o,p);let v;try{v=await g}catch(y){if(Zu(y,n))return R2(t,e,Te(Te({},n),{},{flag:Qo}));bi(y)}return cv(v),v}function $2(t,e){So(t);const n=vi(t),i=n.as,r=n.c,o=n.tlsOnly,l=n.hybrid,u=n.jarm,d=n.implicit,f=Ku(i,"authorization_endpoint",!1,o);if((e=new URLSearchParams(e)).has("client_id")||e.set("client_id",r.client_id),!e.has("request_uri")&&!e.has("request")){if(e.has("response_type")||e.set("response_type",l?"code id_token":d?"id_token":"code"),d&&!e.has("nonce"))throw ia("response_type=id_token clients must provide a nonce parameter in their authorization request parameters",av);u&&e.set("response_mode","jwt")}for(const g of e.entries()){var p=ur(g,2);const v=p[0],y=p[1];f.searchParams.append(v,y)}return f}async function MH(t,e,n){So(t);const i=$2(t,e),r=vi(t),o=r.as,l=r.c,u=r.auth,d=r.fetch,f=r.tlsOnly,p=r.timeout,g=await(async function(b,x,S,k,T){var C;Wr(b),qr(x);const A=Ku(b,"pushed_authorization_request_endpoint",x.use_mtls_endpoint_aliases,T?.[Xi]!==!0),$=new URLSearchParams(k);$.set("client_id",x.client_id);const N=zu(T?.headers);N.set("accept","application/json"),T?.DPoP!==void 0&&($O(T.DPoP),await T.DPoP.addProof(A,N,"POST"));const j=await Kw(b,x,S,A,$,N,T);return T==null||(C=T.DPoP)===null||C===void 0||C.cacheNonce(j,A),j})(o,l,u,i.searchParams,{[Br]:d,[Xi]:!f,DPoP:n?.DPoP,headers:new Headers(Ks),signal:Ya(p)}).catch(bi),v=(async function(b,x,S){if(Wr(b),qr(x),!Xa(S,Response))throw Vt('"response" must be an instance of Response',Ji);await Fw(S,201,"Pushed Authorization Request Endpoint"),vf(S);const k=await ov(S);Un(k.request_uri,'"response" body "request_uri" property',Nt,{body:k});let T=typeof k.expires_in!="number"?parseFloat(k.expires_in):k.expires_in;return ac(T,!0,'"response" body "expires_in" property',Nt,{body:k}),k.expires_in=T,k})(o,l,g);let y;try{y=await v}catch(b){if(Zu(b,n))return MH(t,e,Te(Te({},n),{},{flag:Qo}));bi(b)}return $2(t,{request_uri:y.request_uri})}function So(t){if(!(t instanceof nf))throw ia('"config" must be an instance of Configuration',lv);if(Object.getPrototypeOf(t)!==nf.prototype)throw ia("subclassing Configuration is not allowed",av)}function Ya(t){return t?AbortSignal.timeout(1e3*t):void 0}async function IH(t,e,n,i){So(t);const r=vi(t),o=r.as,l=r.c,u=r.fetch,d=r.tlsOnly,f=r.nonRepudiation,p=r.timeout,g=r.decrypt,v=await wte(o,l,e,{[Br]:u,[Xi]:!d,DPoP:i?.DPoP,headers:new Headers(Ks),signal:Ya(p)}).catch(bi);let y,b=xte(o,l,n,v,{[bo]:g});try{y=await b}catch(x){if(Zu(x,i))return IH(t,e,n,Te(Te({},i),{},{flag:Qo}));bi(x)}return Hw(v)==="application/jwt"&&await f?.(v),y}function Zu(t,e){return!(e==null||!e.DPoP||e.flag===Qo)&&(function(n){if(n instanceof RO){const i=n.cause,r=i[0];return i.length===1&&r.scheme==="dpop"&&r.parameters.error==="use_dpop_nonce"}return n instanceof Uw&&n.error==="use_dpop_nonce"})(t)}Object.freeze(nf.prototype);const Qo=Symbol();async function rr(t,e,n,i){So(t);const r=vi(t),o=r.as,l=r.c,u=r.auth,d=r.fetch,f=r.tlsOnly,p=r.timeout,g=r.decrypt,v=r.nonRepudiation,y=await(async function(k,T,C,A,$,N){return Wr(k),qr(T),Un(A,'"grantType"'),sv(k,T,C,A,new URLSearchParams($),N)})(o,l,u,e,new URLSearchParams(n),{[Br]:d,[Xi]:!f,DPoP:i?.DPoP,headers:new Headers(Ks),signal:Ya(p)}).catch(bi);let b;e==="urn:ietf:params:oauth:grant-type:token-exchange"&&(b={n_a:()=>{}});const x=(async function(k,T,C,A){return tf(k,T,C,void 0,A?.[bo],A?.recognizedTokenTypes)})(o,l,y,{[bo]:g,recognizedTokenTypes:b});let S;try{S=await x}catch(k){if(Zu(k,i))return rr(t,e,n,Te(Te({},i),{},{flag:Qo}));bi(k)}return S.id_token&&await v?.(y),cv(S),S}async function Qte(t,e,n){So(t);const i=vi(t),r=i.as,o=i.c,l=i.auth,u=i.fetch,d=i.tlsOnly,f=i.timeout;return(async function(p,g,v,y,b){Wr(p),qr(g),Un(y,'"token"');const x=Ku(p,"revocation_endpoint",g.use_mtls_endpoint_aliases,b?.[Xi]!==!0),S=new URLSearchParams(b?.additionalParameters);S.set("token",y);const k=zu(b?.headers);return k.delete("accept"),Kw(p,g,v,x,S,k,b)})(r,o,l,e,{[Br]:u,[Xi]:!d,additionalParameters:new URLSearchParams(n),headers:new Headers(Ks),signal:Ya(f)}).then(Nte).catch(bi)}async function zH(t,e,n){return e instanceof Uint8Array?crypto.subtle.importKey("raw",e,t.subtle,!1,[n]):(Ute(e,t.subtle,n),t.minRsaBits&&(function(i,r){const o=r.algorithm.modulusLength;if(typeof o!="number"||o<2048)throw new TypeError("".concat(i," requires ke
20y modulusLength to be 2048 bits or larger"))})(t.alg,e),e)}const uv=[["verify"],["sign"]];function mE(t){const e={name:"HMAC",hash:"SHA-".concat(t)};return{kty:["oct"],secret:!0,subtle:e,signing:e,usages:uv}}function Yd(t,e){const n={name:e?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(t)};return{kty:["RSA"],subtle:n,signing:e?Te(Te({},n),{},{saltLength:e}):n,usages:uv,minRsaBits:2048}}function vE(t,e){return{kty:["EC"],crv:t,subtle:{name:"ECDSA",namedCurve:t},signing:{name:"ECDSA",hash:"SHA-".concat(e)},usages:uv}}function Jz(){const t={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle:t,signing:t,usages:uv}}function yE(t){const e={name:"ML-DSA-".concat(t)};return{kty:["AKP"],subtle:e,signing:e,usages:uv}}const zO=IO({HS256:mE(256),HS384:mE(384),HS512:mE(512),RS256:Yd(256),RS384:Yd(384),RS512:Yd(512),PS256:Yd(256,32),PS384:Yd(384,48),PS512:Yd(512,64),ES256:vE("P-256",256),ES384:vE("P-384",384),ES512:vE("P-521",512),EdDSA:Jz(),Ed25519:Jz(),"ML-DSA-44":yE(44),"ML-DSA-65":yE(65),"ML-DSA-87":yE(87)});function DH(t){const e=typeof t=="string"?zO[t]:void 0;if(!e)throw new qa("alg ".concat(t," is not supported either by JOSE or your javascript runtime"));return e}function ene(t){return arguments.length>1&&arguments[1]!==void 0?arguments[1]:t===void 0?{}:(function(n,i,r){let o;try{o=JSON.parse(jO.decode(Ww(n)))}catch{throw new i(r)}if(!dc(o))throw new i(r);return o})(t,or,"JWS Protected Header is invalid")}async function tne(t,e,n,i,r,o,l){var u;let d=!1;typeof n=="function"&&(n=await n(r,t),d=!0);const f=typeof l=="string",p=DH(o),g=pH(i!==void 0?$u(i):new Uint8Array,$u("."),f?(u=e[2])!==null&&u!==void 0?u:e[2]=(function(b,x,S){try{return $u(b)}catch{throw new S("The ".concat(x," is not a valid base64url string"))}})(l,"payload",or):l),v=Wz(t.signature,"signature",or),y=await OH(p,n,"verify");if(!await(async function(b,x,S,k){const T=await zH(b,x,"verify");try{return await crypto.subtle.verify(b.signing,T,S,k)}catch{return!1}})(p,y,v,g))throw new yH;return[f?Wz(l,"payload",or):l,r,f,y,d]}async function nne(t,e,n){if(t instanceof Uint8Array&&(t=E2.decode(t)),typeof t!="string")throw new or("Compact JWS must be a string or Uint8Array");const i=t.split("."),r=i[0],o=i[1],l=i[2];if(i.length!==3)throw new or("Invalid Compact JWS");const u={payload:o,protected:r,signature:l},d=ene(r),f=(function(b,x,S){const k=AH(b,$H(or,RH,S[1],b,x)),T=x.alg;if(typeof T!="string"||!T)throw new or('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(S[0]&&!S[0].has(T))throw new gH('"alg" (Algorithm) Header Parameter value not allowed');return[k,T]})(d,d,e),p=ur(f,2),g=p[0],v=p[1],y=g?o:(function(b){try{return $u(b)}catch{throw new or("JWS Compact Serialization payload must use only ASCII characters")}})(o);return tne(u,e,n,r,d,v,y)}const Am=t=>Math.floor(t.getTime()/1e3),ine={s:1,m:60,h:3600,d:86400,w:604800,y:31557600},rne=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,fh="check_failed";function _E(){throw new TypeError("Invalid time period format")}function Gb(t){typeof t!="string"&&_E();const e=rne.exec(t);(!e||e[4]&&e[1])&&_E();const n=parseFloat(e[2]),i=Math.round(n*ine[e[3][0].toLowerCase()]);return Number.isFinite(i)||_E(),e[1]==="-"||e[4]==="ago"?-i:i}function Uh(t,e){if(!Number.isFinite(e))throw new TypeError("Invalid ".concat(t," input"));return e}function bE(t,e){if(typeof e!="string")throw new TypeError('"'.concat(t,'" claim must be a string'))}function wE(t,e){return typeof t=="number"?Uh(e,t):t instanceof Date?Uh(e,Am(t)):Am(new Date)+Gb(t)}const Xz=t=>{const e=t.toLowerCase();return t.includes("/")?e:"application/".concat(e)};function xE(t,e){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const i=t[e];if(i!==void 0||n){if(typeof i!="number")throw new yu('"'.concat(e,'" claim must be a number'),t,e,"invalid");return i}}function SE(t,e){throw new yu('unexpected "'.concat(e,'" claim value'),t,e,fh)}function sne(t,e){let n,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};try{n=JSON.parse(jO.decode(e))}catch{}if(!dc(n))throw new uo("JWT Claims Set must be a top-level JSON object");const r=i.typ;
20if(r!==void 0&&(typeof t.typ!="string"||Xz(t.typ)!==Xz(r)))throw new yu('unexpected "typ" JWT header value',n,"typ",fh);const o=i.requiredClaims,l=o===void 0?[]:o,u=i.issuer,d=i.subject,f=i.audience,p=i.maxTokenAge,g=[...l];p!==void 0&&g.push("iat"),f!==void 0&&g.push("aud"),d!==void 0&&g.push("sub"),u!==void 0&&g.push("iss");for(const $ of new Set(g.reverse()))if(!Object.hasOwn(n,$))throw new yu('missing required "'.concat($,'" claim'),n,$,"missing");var v,y;u===void 0||(Array.isArray(u)?u:[u]).includes(n.iss)||SE(n,"iss"),d!==void 0&&n.sub!==d&&SE(n,"sub"),f===void 0||(v=n.aud,y=typeof f=="string"?[f]:f,typeof v=="string"?y.includes(v):Array.isArray(v)&&y.some($=>v.includes($)))||SE(n,"aud");const b=i.clockTolerance;let x=0;if(typeof b=="string")x=Gb(b);else if(b!==void 0){if(typeof b!="number")throw new TypeError("Invalid clockTolerance option type");x=b}Uh("clockTolerance option",x);const S=i.currentDate,k=Uh("currentDate option",Am(S===void 0?new Date:S)),T=xE(n,"iat",p!==void 0),C=xE(n,"nbf");if(C!==void 0&&C>k+x)throw new yu('"nbf" claim timestamp check failed',n,"nbf",fh);const A=xE(n,"exp");if(A!==void 0&&A<=k-x)throw new T2('"exp" claim timestamp check failed',n,"exp",fh);if(p!==void 0){const $=k-T;if($-x>Uh("maxTokenAge option",typeof p=="number"?p:Gb(p)))throw new T2('"iat" claim timestamp check failed (too far in the past)',n,"iat",fh);if($<-x)throw new yu('"iat" claim timestamp check failed (it should be in the past)',n,"iat",fh)}return n}let A2;function Ul(t){return A2.get(t)}async function one(t,e,n){const i=await nne(t,(function(o){return[o&&Bte("algorithms",o.algorithms),o?.crit]})(n),e);if(!i[2])throw new uo("JWTs MUST NOT use unencoded payload");const r={payload:sne(i[1],i[0],n),protectedHeader:i[1]};return typeof e=="function"?Te(Te({},r),{},{key:i[3]}):r}function ane(t){if(t===void 0)return[void 0,""];const e=(function(n,i){let r,o;try{r=JSON.stringify(i),o=JSON.parse(r)}catch(l){throw new n("JOSE Header is not valid JSON",{cause:l})}if(!dc(o))throw new n("JOSE Header is not a JSON object");return[o,r]})(or,t);return[e[0],MO(e[1])]}function lne(t,e,n){return(function(i,r){const o=(r??{}).crit;if(Array.isArray(o)&&new Set(o).size!==o.length)throw new i('"crit" (Critical) Header Parameter MUST NOT contain duplicate values')})(or,t),AH(t,$H(or,RH,n,t,e))}async function cne(t,e,n,i){const r=pH($u(t),$u("."),e),o=await OH(n,i,"sign");return MO(await(async function(l,u,d){const f=await zH(l,u,"sign"),p=await crypto.subtle.sign(l.signing,f,d);return new Uint8Array(p)})(n,o,r))}async function une(t,e,n,i,r){const o=ur(ane(e),2),l=o[0],u=o[1];if(!l)throw new or("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");lne(l,l,n)||r();const d=(function(g){const v=g.alg;if(typeof v!="string"||!v)throw new or('JWS "alg" (Algorithm) Header Parameter missing or invalid');return DH(v)})(l),f=MO(t),p=await cne(u,$u(f),d,i);return"".concat(u,".").concat(f,".").concat(p)}const dne=class{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!dc(t))throw new TypeError("JWT Claims Set MUST be an object");(A2||(A2=new WeakMap)).set(this,structuredClone(t))}setIssuer(t){return bE("iss",t),Ul(this).iss=t,this}setSubject(t){return bE("sub",t),Ul(this).sub=t,this}setAudience(t){return(function(e){if(typeof e!="string"&&(!Array.isArray(e)||Array.from(e).some(n=>typeof n!="string")))throw new TypeError('"aud" claim must be a string or an array of strings')})(t),Ul(this).aud=t,this}setJti(t){return bE("jti",t),Ul(this).jti=t,this}setNotBefore(t){return Ul(this).nbf=wE(t,"setNotBefore"),this}setExpirationTime(t){return Ul(this).exp=wE(t,"setExpirationTime"),this}setIssuedAt(t){const e=Ul(this);return e.iat=t===void 0?Am(new Date):typeof t=="string"?Uh("setIssuedAt",Am(new Date)+Gb(t)):wE(t,"setIssuedAt"),this}};var $0=new WeakMap;class LH extends dne{constructor(){super(...arguments),ut(this,$0,void 0)}setProtectedHeader(e){return(function(n,i){if(n!==void 0)throw new TypeError("".concat(i," can only be called once"))})(X($0,this),"setProtectedHeader"),pt($0,this,e),this}
20async sign(e,n){return une((function(i){const r=Ul(i);for(const o of["iat","nbf","exp"]){const l=r[o];if(typeof l=="number"&&!Number.isFinite(l))throw new TypeError('"'.concat(o,'" claim must be a finite number'))}return fH.encode(JSON.stringify(r))})(this),X($0,this),n?.crit,e,()=>{throw new uo("JWTs MUST NOT use unencoded payload")})}}const Yz='"alg" (Algorithm)';function Qz(){throw new qa("Invalid or unsupported ".concat(arguments.length>0&&arguments[0]!==void 0?arguments[0]:'JWK "alg" (Algorithm) Parameter'," value"))}const Wp=(t,e)=>{if(t.byteLength!==e.length)return!1;for(let n=0;n<t.byteLength;n++)if(t[n]!==e[n])return!1;return!0},j2=t=>{const e=t.data[t.pos++];if(e===void 0)throw new Error("Unexpected end of ASN.1 input");return e},Jg=t=>{const e=j2(t);if(128&e){const n=127&e;let i=0;for(let r=0;r<n;r++)i=i<<8|j2(t);return i}return e},Xg=(t,e,n)=>{if(j2(t)!==e)throw new Error(n)},e3=(t,e)=>{if(e<0||t.pos+e>t.data.length)throw new Error("Unexpected end of ASN.1 input");const n=t.data.subarray(t.pos,t.pos+e);return t.pos+=e,n},hne=t=>{const e=(r=>{Xg(r,6,"Expected algorithm OID");const o=Jg(r);return e3(r,o)})(t);if(Wp(e,[43,101,110]))return"X25519";if(!Wp(e,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");Xg(t,6,"Expected curve OID");const n=Jg(t),i=e3(t,n);if(Wp(i,[42,134,72,206,61,3,1,7]))return"P-256";if(Wp(i,[43,129,4,0,34]))return"P-384";if(Wp(i,[43,129,4,0,35]))return"P-521";throw new Error("Unsupported named curve")},fne=async(t,e,n,i)=>{const r=(function(u,d){var f,p;return(f=typeof u=="string"?(p=zO[u])!==null&&p!==void 0?p:qte[u]:void 0)!==null&&f!==void 0?f:Qz(d)})(n,Yz);r.secret&&Qz(Yz);const o=t==="spki";let l;if(r.resolve)try{const u={data:e,pos:0};(function(d,f){if(Xg(d,48,"Invalid ".concat(f==="spki"?"SPKI":"PKCS#8"," structure")),Jg(d),f==="pkcs8"){Xg(d,2,"Expected version field");const p=Jg(d);d.pos+=p}Xg(d,48,"Expected algorithm identifier"),Jg(d)})(u,t),l=r.resolve({crv:hne(u)})}catch{throw new qa("Invalid or unsupported key format")}else l=r.subtle;return crypto.subtle.importKey(t,e,l,o,r.usages[1])}
20,pne=(t,e,n)=>{const i=((r,o)=>bH(r.replace(o,"")))(t,/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g);return fne("pkcs8",i,e)};async function t3(t,e,n){const i=t.get(e)||t.set(e,{}).get(e),r=n.alg;if(i[r]===void 0){const o=await xH(n,Te(Te({},e),{},{alg:r,ext:!0}));if(o.type!=="public")throw new PO("JSON Web Key Set members must be public keys");i[r]=o}return i[r]}function n3(t){let e;try{e=structuredClone(t)}catch{}if(!wH(e))throw new PO("JSON Web Key Set malformed");const n=new WeakMap;return Object.defineProperty(async(i,r)=>{const o=Te(Te({},i),r?.header),l=o.alg,u=o.kid,d=typeof l=="string"?zO[l]:void 0;if(!d||d.secret)throw new qa('Unsupported "alg" value for a JSON Web Key Set');const f=e.keys.filter(v=>(function(y,b,x,S){const k=SH(y),T=k.kty,C=k.key_ops,A=k.ext,$=k.kid,N=k.alg,j=k.use,O=k.crv,L=Array.isArray(C)?[...C]:C;return(A===void 0||typeof A=="boolean")&&(L===void 0||Array.isArray(L)&&L.every((B,V)=>typeof B=="string"&&L.indexOf(B)===V)&&L.includes("verify"))&&b.kty.includes(T)&&(S===void 0||typeof S=="string"&&S===$)&&(N===void 0?T!=="AKP":x===N)&&(j===void 0||j==="sig")&&(!b.crv||O===b.crv)})(v,d,l,u)),p=f[0],g=f.length;if(!g)throw new NO;if(g!==1){const v=new mH;throw v[Symbol.asyncIterator]=MF(function*(){for(const y of f)try{yield yield yee(t3(n,y,d))}catch{}}),v}return t3(n,p,d)},"jwks",{value:()=>structuredClone(e)})}var A0,kE;let P2;(typeof navigator>"u"||(A0=navigator.userAgent)===null||A0===void 0||(kE=A0.startsWith)===null||kE===void 0||!kE.call(A0,"Mozilla/5.0 "))&&(P2="".concat("jose","/").concat("v6.2.10"));const UH=Symbol(),FH=Symbol();function qp(t,e){return Number.isFinite(t)&&Date.now()<t+e}function i3(t,e,n){if(Number.isNaN(t))throw new TypeError('"'.concat(n,'" option must not be NaN'));return typeof t=="number"?t:e}function gne(t,e){if(!(t instanceof URL))throw new TypeError("url must be an instance of URL");const n=new URL(t.href).href,i=e??{},r=i.timeoutDuration;if(typeof r=="number"&&(!Number.isInteger(r)||r<0))throw new TypeError('"timeoutDuration" option must be a non-negative integer');const o=typeof r=="number"?r:5e3,l=i3(i.cooldownDuration,3e4,"cooldownDuration"),u=i3(i.cacheMaxAge,6e5,"cacheMaxAge"),d=new Headers(i.headers);P2&&!d.has("User-Agent")&&d.set("User-Agent",P2),d.has("accept")||d.set("accept","application/json, application/jwk-set+json");const f=i[UH],p=i[FH];let g,v,y,b=0,x=0;if(p&&typeof p=="object"){const k=p.uat,T=p.jwks;qp(k,u)&&wH(T)&&(g=k,y=n3(T))}const S=async()=>{if(v&&(typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel")&&(v=void 0),!v){const k=++b,T=v=(async function(C,A,$){const j=await(arguments.length>3&&arguments[3]!==void 0?arguments[3]:fetch)(C,{method:"GET",signal:$,redirect:"manual",headers:A}).catch(O=>{throw O.name==="TimeoutError"?new vH:O});if(j.status!==200)throw new Yi("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await j.json()}catch{throw new Yi("Failed to parse the JSON Web Key Set HTTP response as JSON")}})(n,d,AbortSignal.timeout(o),f).then(C=>{const A=n3(C);if(k<=x)return;y=A;const $=Date.now();p&&(p.uat=$,p.jwks=C),g=$,x=k}).finally(()=>{v===T&&(v=void 0)})}await v};return Object.defineProperties(async(k,T)=>{y&&qp(g,u)||await S();try{return await y(k,T)}catch(C){if(C instanceof NO&&!qp(g,l))return await S(),y(k,T);throw C}},{coolingDown:{get:()=>qp(g,l),enumerable:!0},fresh:{get:()=>qp(g,u),enumerable:!0},reload:{value:S,enumerable:!0},reloading:{get:()=>!!v,enumerable:!0},jwks:{value:()=>{var k;return(k=y)===null||k===void 0?void 0:k.jwks()},enumerable:!0}})}async function DO(t,e,n){if(typeof t!="string"||t.indexOf("-----BEGIN PRIVATE KEY-----")!==0)throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return pne(t,e)}const mne=["mfaToken"],vne=["mfaToken"];var Jc,j0,Vp,j_,P_,Qd,Bp,eh,Gp,Jp,Xp,N_,M_,P0,th,Yg,Qg,Au,I_,z_,em,Yp,Zl,D_,Qp,L_,U_,N0,F_,bg,cu,H_,K_,Z_,W_,wg,xg,As,M0,I0,Jb,Xb,jm,Ch,tt,Ft,Aa,eg,tm,Fh,z0,Fe;function dv(t){if(typeof t!="object"||t===null)return{};const e=t;return{statusCode:typeof e.statusCode=="number"?e.statusCode:void 0,headers:e.headers instanceof Headers?e.headers:void 0,body:typeof e.body=="str
20ing"?e.body:void 0}}function hi(t){var e,n;if(typeof t!="object"||t===null)return{error:"unknown_error",error_description:String(t)};const i=t;let r;if(i.response instanceof Response)try{r=new Headers(i.response.headers),r.delete("set-cookie")}catch{r=void 0}const o={error:(e=i.error)!==null&&e!==void 0?e:"",error_description:(n=i.error_description)!==null&&n!==void 0?n:"",message:i.message,statusCode:typeof i.status=="number"?i.status:void 0,headers:r};if(i.error==="mfa_required"&&i.cause){o.mfa_token=typeof i.cause.mfa_token=="string"?i.cause.mfa_token:void 0;const l=i.cause.mfa_requirements;typeof l=="object"&&l!==null&&(o.mfa_requirements=l)}return o}var r3=class extends Error{constructor(t,e){super(e),be(this,"code",void 0),this.name="NotSupportedError",this.code=t}},qs=class extends Error{constructor(t,e,n){super(e),be(this,"cause",void 0),be(this,"code",void 0),be(this,"statusCode",void 0),be(this,"headers",void 0),be(this,"body",void 0),this.code=t,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message,mfa_token:n.mfa_token,mfa_requirements:n.mfa_requirements};const i=dv(n);this.statusCode=i.statusCode,this.headers=i.headers,this.body=i.body}},D0=class extends qs{constructor(t,e){super("token_by_code_error",t,e),this.name="TokenByCodeError"}},s3=class extends qs{constructor(t,e){super("token_by_client_credentials_error",t,e),this.name="TokenByClientCredentialsError"}},o3=class extends qs{constructor(t,e){super("token_by_refresh_token_error",t,e),this.name="TokenByRefreshTokenError"}},a3=class extends qs{constructor(t,e){super("token_by_password_error",t,e),this.name="TokenByPasswordError"}},EE=class extends qs{constructor(t,e){super("token_for_connection_error",t,e),this.name="TokenForConnectionErrorCode"}},ds=class extends qs{constructor(t,e){super("token_exchange_error",t,e),this.name="TokenExchangeError"}},yne=class extends qs{constructor(t,e){super("token_revocation_error",t,e),this.name="TokenRevocationError"}},_ne=class extends qs{constructor(t,e){super("user_info_error",t,e),this.name="UserInfoError"}},Il=class extends Error{constructor(t){super(t),be(this,"code","verify_logout_token_error"),this.name="VerifyLogoutTokenError"}},L0=class extends qs{constructor(t){super("backchannel_authentication_error","There was an error when trying to use Client-Initiated Backchannel Authentication.",t),be(this,"code","backchannel_authentication_error"),this.name="BackchannelAuthenticationError"}},bne=class extends qs{constructor(t){super("build_authorization_url_error","There was an error when trying to build the authorization URL.",t),this.name="BuildAuthorizationUrlError"}},wne=class extends qs{constructor(t){super("build_link_user_url_error","There was an error when trying to build the Link User URL.",t),this.name="BuildLinkUserUrlError"}},xne=class extends qs{constructor(t){super("build_unlink_user_url_error","There was an error when trying to build the Unlink User URL.",t),this.name="BuildUnlinkUserUrlError"}},HH=class extends Error{constructor(){super("The client secret or client assertion signing key must be provided."),be(this,"code","missing_client_auth_error"),this.name="MissingClientAuthError"}},Sg=class extends Error{constructor(t){super(t),be(this,"code","organization_validation_error"),this.name="OrganizationValidationError"}},zn=class extends Error{constructor(t){super(t||"fullResponse: true requested but no HTTP Response was captured. This is a bug in CapturingFetch."),be(this,"code","missing_captured_response_error"),this.name="MissingCapturedResponseError"}};function an(t){try{const e=new Headers(t);return e.delete("set-cookie"),e}catch{return new Headers}}function Hh(t,e,n){var i;const r=typeof e=="object"&&e!==null?e:void 0,o=(i=r?.response)!==null&&i!==void 0?i:n,l=typeof r?.status=="number"?r.status:o?.status;typeof l=="number"&&(t.statusCode=l),o!=null&&o.headers&&(t.headers=an(o.headers))}function N2(t){return Object.entries(t).filter(e=>ur(e,2)[1]!==void 0).reduce((e,n)=>Te(Te({},e),{},{[n[0]]:n[1]}),{})}function LO(t){if(!t.trim())throw new Sg("organization must not be blank")}function Pm(t,e){if(!t)return;const n=e.trim();if(n.startsWith("org_")){const i=t.org_id;
20if(typeof i!="string")throw new Sg("Organization Id (org_id) claim must be a string present in the ID token");if(i!==n)throw new Sg('Organization Id (org_id) claim value mismatch in the ID token; expected "'.concat(n,'", found "').concat(i,'"'))}else{const i=t.org_name;if(typeof i!="string")throw new Sg("Organization Name (org_name) claim must be a string present in the ID token");if(i.toLowerCase()!==n.toLowerCase())throw new Sg('Organization Name (org_name) claim value mismatch in the ID token; expected "'.concat(n,'", found "').concat(i,'"'))}}var hv=class extends Error{constructor(t,e,n){super(e),be(this,"cause",void 0),be(this,"code",void 0),be(this,"statusCode",void 0),be(this,"headers",void 0),be(this,"body",void 0),this.code=t,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message};const i=dv(n);this.statusCode=i.statusCode,this.headers=i.headers,this.body=i.body}},M2=class extends hv{constructor(t,e){super("mfa_list_authenticators_error",t,e),this.name="MfaListAuthenticatorsError"}},I2=class extends hv{constructor(t,e){super("mfa_enrollment_error",t,e),this.name="MfaEnrollmentError"}},l3=class extends hv{constructor(t,e){super("mfa_delete_authenticator_error",t,e),this.name="MfaDeleteAuthenticatorError"}},z2=class extends hv{constructor(t,e){super("mfa_challenge_error",t,e),this.name="MfaChallengeError"}},U0=class extends hv{constructor(t,e){super("mfa_verify_error",t,e),this.name="MfaVerifyError"}};function Sne(t){return{id:t.id,authenticatorType:t.authenticator_type,active:t.active,name:t.name,oobChannels:t.oob_channels,type:t.type}}var En=class KH{constructor(e,n,i,r,o,l,u){be(this,"accessToken",void 0),be(this,"idToken",void 0),be(this,"refreshToken",void 0),be(this,"expiresAt",void 0),be(this,"scope",void 0),be(this,"claims",void 0),be(this,"authorizationDetails",void 0),be(this,"tokenType",void 0),be(this,"issuedTokenType",void 0),be(this,"recoveryCode",void 0),be(this,"act",void 0),this.accessToken=e,this.idToken=i,this.refreshToken=r,this.expiresAt=n,this.scope=o,this.claims=l,this.authorizationDetails=u}static fromTokenEndpointResponse(e){const n=e.id_token?e.claims():void 0,i=new KH(e.access_token,Math.floor(Date.now()/1e3)+Number(e.expires_in),e.id_token,e.refresh_token,e.scope,n,e.authorization_details);return i.tokenType=e.token_type,i.issuedTokenType=e.issued_token_type,i}};function ZH(t,e){if(e.enabled===!1)return t;const n={name:e.name,version:e.version},i=btoa(JSON.stringify(n));return async(r,o)=>{const l=r instanceof Request?new Headers(r.headers):new Headers;return o!=null&&o.headers&&new Headers(o.headers).forEach((u,d)=>{l.set(d,u)}),l.set("Auth0-Client",i),t(r,Te(Te({},o),{},{headers:l}))}}function fv(t){var e,n;return t?.enabled===!1?t:{enabled:!0,name:(e=t?.name)!==null&&e!==void 0?e:"@auth0/auth0-auth-js",version:(n=t?.version)!==null&&n!==void 0?n:"1.15.0"}}function Mn(t){let e;const n=async(i,r)=>{const o=await t(i,r);return e=o.clone(),o};return n.getCapturedResponse=()=>e,n}function pv(t,e,n){if(!e)return t;const i=e.signal,r=e.headers,o=e.customFetch,l=o?ZH(o,n):t;return i||r?async(u,d)=>{const f=r?new Headers(u instanceof Request?u.headers:void 0):void 0;if(f&&d!=null&&d.headers&&new Headers(d.headers).forEach((y,b)=>f.set(b,y)),r)for(const y of Object.entries(r)){var p=ur(y,2);const b=p[0],x=p[1],S=b.toLowerCase();S!=="authorization"&&S!=="auth0-client"&&f.set(b,x)}const g=(function(y,b){if(!y)return{signal:b??void 0};if(!b)return{signal:y};if(typeof AbortSignal<"u"&&typeof AbortSignal.any=="function")return{signal:AbortSignal.any([y,b])};const x=new AbortController,S=[y,b],k=S.find(A=>A.aborted);if(k)return x.abort(k.reason),{signal:x.signal};const T=[],C=()=>{S.forEach((A,$)=>{const N=T[$];N&&A.removeEventListener("abort",N)})};return S.forEach((A,$)=>{const N=()=>{C(),x.abort(A.reason)};T[$]=N,A.addEventListener("abort",N,{once:!0})}),{signal:x.signal,cleanup:C}})(i,d?.signal);try{return await l(u,Te(Te(Te({},d),f&&{headers:f}),{},{signal:g.signal}))}finally{var v;(v=g.cleanup)===null||v===void 0||v.call(g)}}:l}var c3={otp:"http://auth0.com/oauth/grant-type/mfa-otp",oob:"http://auth0.com/oauth/grant-type/mfa-oob","recovery-code":"http://auth0.com/oauth/grant-type/mfa-rec
20overy-code"},kne=(Jc=new WeakMap,j0=new WeakMap,Vp=new WeakMap,j_=new WeakMap,P_=new WeakMap,Qd=new WeakMap,Bp=new WeakMap,eh=new WeakSet,class{constructor(t){var e,n;gf(this,eh),ut(this,Jc,void 0),ut(this,j0,void 0),ut(this,Vp,void 0),ut(this,j_,void 0),ut(this,P_,void 0),ut(this,Qd,void 0),ut(this,Bp,void 0),pt(Jc,this,"https://".concat(t.domain)),pt(j0,this,t.clientId),pt(Vp,this,t.clientSecret),pt(j_,this,(e=t.customFetch)!==null&&e!==void 0?e:function(){return fetch(...arguments)}),pt(P_,this,(n=t.telemetryConfig)!==null&&n!==void 0?n:fv()),pt(Qd,this,t.getConfiguration),pt(Bp,this,t.createCaptureConfiguration)}async listAuthenticators(t,e){const n="".concat(X(Jc,this),"/mfa/authenticators"),i=t.mfaToken,r=await Me(eh,this,F0).call(this,e)(n,{method:"GET",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"}});if(!r.ok){const o=await r.clone().text(),l=r.status,u=an(r.headers);let d;try{d=JSON.parse(o)}catch{throw new M2("Failed to list authenticators",{error:"unknown_error",error_description:"Failed to list authenticators",statusCode:l,headers:u,body:o})}throw new M2(d.error_description||"Failed to list authenticators",Te(Te({},d),{},{statusCode:l,headers:u,body:o}))}return(await r.json()).map(Sne)}async enrollAuthenticator(t,e){const n="".concat(X(Jc,this),"/mfa/associate"),i=t.mfaToken,r=Tz(t,mne),o={authenticator_types:r.authenticatorTypes};"oobChannels"in r&&(o.oob_channels=r.oobChannels),"phoneNumber"in r&&r.phoneNumber&&(o.phone_number=r.phoneNumber),"email"in r&&r.email&&(o.email=r.email);const l=await Me(eh,this,F0).call(this,e)(n,{method:"POST",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!l.ok){const u=await l.clone().text(),d=l.status,f=an(l.headers);let p;try{p=JSON.parse(u)}catch{throw new I2("Failed to enroll authenticator",{error:"unknown_error",error_description:"Failed to enroll authenticator",statusCode:d,headers:f,body:u})}throw new I2(p.error_description||"Failed to enroll authenticator",Te(Te({},p),{},{statusCode:d,headers:f,body:u}))}return(function(u){if(u.authenticator_type==="otp")return{authenticatorType:"otp",secret:u.secret,barcodeUri:u.barcode_uri,recoveryCodes:u.recovery_codes,id:u.id};if(u.authenticator_type==="oob")return{authenticatorType:"oob",oobChannel:u.oob_channel,oobCode:u.oob_code,bindingMethod:u.binding_method,id:u.id,barcodeUri:u.barcode_uri,recoveryCodes:u.recovery_codes};throw new Error("Unexpected authenticator type: ".concat(u.authenticator_type))})(await l.json())}async deleteAuthenticator(t,e){const n=t.authenticatorId,i=t.mfaToken,r="".concat(X(Jc,this),"/mfa/authenticators/").concat(encodeURIComponent(n)),o=await Me(eh,this,F0).call(this,e)(r,{method:"DELETE",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"}});if(!o.ok){const l=await o.clone().text(),u=o.status,d=an(o.headers);let f;try{f=JSON.parse(l)}catch{throw new l3("Failed to delete authenticator",{error:"unknown_error",error_description:"Failed to delete authenticator",statusCode:u,headers:d,body:l})}throw new l3(f.error_description||"Failed to delete authenticator",Te(Te({},f),{},{statusCode:u,headers:d,body:l}))}}async challengeAuthenticator(t,e){const n="".concat(X(Jc,this),"/mfa/challenge"),i=t.mfaToken,r=Tz(t,vne),o={mfa_token:i,client_id:X(j0,this),challenge_type:r.challengeType};X(Vp,this)&&(o.client_secret=X(Vp,this)),r.authenticatorId&&(o.authenticator_id=r.authenticatorId);const l=await Me(eh,this,F0).call(this,e)(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(!l.ok){const u=await l.clone().text(),d=l.status,f=an(l.headers);let p;try{p=JSON.parse(u)}catch{throw new z2("Failed to challenge authenticator",{error:"unknown_error",error_description:"Failed to challenge authenticator",statusCode:d,headers:f,body:u})}throw new z2(p.error_description||"Failed to challenge authenticator",Te(Te({},p),{},{statusCode:d,headers:f,body:u}))}return(function(u){const d={challengeType:u.challenge_type};return u.oob_code!==void 0&&(d.oobCode=u.oob_code),u.binding_method!==void 0&&(d.bindingMethod=u.binding_method),d})(await l.json())}async verify(t,e){if(!X(Qd,this))throw new Error("MFA verify requires a configuration provider (getConfiguration was not set)");const n={mfa_token:t.mfaToken};
20if(t.audience&&(n.audience=t.audience),t.factorType==="otp"?n.otp=t.otp:t.factorType==="oob"?(n.oob_code=t.oobCode,t.bindingCode&&(n.binding_code=t.bindingCode)):t.factorType==="recovery-code"&&(n.recovery_code=t.recoveryCode),t.fullResponse){var i;if(!X(Bp,this))throw new Error("MFA verify fullResponse requires a capture-config factory (createCaptureConfiguration was not set)");const g=Mn((i=(await X(Qd,this).call(this,e))[It])!==null&&i!==void 0?i:fetch),v=await X(Bp,this).call(this,g);try{const y=await rr(v,c3[t.factorType],n),b=En.fromTokenEndpointResponse(y);y.recovery_code&&(b.recoveryCode=y.recovery_code);const x=g.getCapturedResponse();if(!x)throw new zn;return{data:b,response:x}}catch(y){var r,o,l;if(y instanceof zn||y instanceof U0)throw y;const b=y,x=new U0(b.error_description||b.message||"Failed to verify MFA challenge",{error:(r=b.error)!==null&&r!==void 0?r:"mfa_verify_error",error_description:(o=(l=b.error_description)!==null&&l!==void 0?l:b.message)!==null&&o!==void 0?o:"Failed to verify MFA challenge"});throw Hh(x,y,g.getCapturedResponse()),x}}const u=await X(Qd,this).call(this,e);try{const g=await rr(u,c3[t.factorType],n),v=En.fromTokenEndpointResponse(g);return g.recovery_code&&(v.recoveryCode=g.recovery_code),v}catch(g){var d,f,p;if(g instanceof U0)throw g;const v=g,y=new U0(v.error_description||v.message||"Failed to verify MFA challenge",{error:(d=v.error)!==null&&d!==void 0?d:"mfa_verify_error",error_description:(f=(p=v.error_description)!==null&&p!==void 0?p:v.message)!==null&&f!==void 0?f:"Failed to verify MFA challenge"});throw Hh(y,g),y}}});function F0(t){return pv(X(j_,this),t,X(P_,this))}var UO=class extends Error{constructor(t,e,n){super(e),be(this,"cause",void 0),be(this,"code",void 0),be(this,"statusCode",void 0),be(this,"headers",void 0),be(this,"body",void 0),this.code=t,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message};const i=dv(n);this.statusCode=i.statusCode,this.headers=i.headers,this.body=i.body}},Ene=class extends UO{constructor(t,e){super("passkey_register_error",t,e),this.name="PasskeyRegisterError"}},Tne=class extends UO{constructor(t,e){super("passkey_challenge_error",t,e),this.name="PasskeyChallengeError"}},Cne=class extends UO{constructor(t,e){super("passkey_get_token_error",t,e),this.name="PasskeyGetTokenError",this.cause=e&&{error:e.error,error_description:e.error_description,message:e.message,mfa_token:e.mfa_token,mfa_requirements:e.mfa_requirements}}};function u3(t){return t.useMtls?{}:t.clientSecret?{client_secret:t.clientSecret}:{}}var WH="urn:okta:params:oauth:grant-type:webauthn",One=(Gp=new WeakMap,Jp=new WeakMap,Xp=new WeakMap,N_=new WeakMap,M_=new WeakMap,P0=new WeakMap,th=new WeakSet,class{constructor(t){var e,n;gf(this,th),ut(this,Gp,void 0),ut(this,Jp,void 0),ut(this,Xp,void 0),ut(this,N_,void 0),ut(this,M_,void 0),ut(this,P0,void 0),pt(Gp,this,"https://".concat(t.domain)),pt(Jp,this,t.clientId),pt(Xp,this,{clientSecret:t.clientSecret,useMtls:t.useMtls}),pt(N_,this,(e=t.customFetch)!==null&&e!==void 0?e:function(){return fetch(...arguments)}),pt(M_,this,(n=t.telemetryConfig)!==null&&n!==void 0?n:fv()),pt(P0,this,t.grantRequest)}async register(t,e){const n="".concat(X(Gp,this),"/passkey/register"),i=Te(Te(Te(Te(Te(Te(Te(Te({},t.email&&{email:t.email}),t.name&&{name:t.name}),t.phoneNumber&&{phone_number:t.phoneNumber}),t.username&&{username:t.username}),t.givenName&&{given_name:t.givenName}),t.familyName&&{family_name:t.familyName}),t.nickname&&{nickname:t.nickname}),t.picture&&{picture:t.picture}),r=Te(Te({client_id:X(Jp,this)},u3(X(Xp,this))),{},{user_profile:i});t.realm&&(r.realm=t.realm),t.organization&&(r.organization=t.organization),t.userMetadata&&(r.user_metadata=t.userMetadata);const o=await Me(th,this,d3).call(this,e)(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!o.ok){const d=await Me(th,this,h3).call(this,o),f=new Ene(d.error_description||"Failed to request signup challenge",d);throw f.statusCode=o.status,f.headers=an(o.headers),f}return{authSession:(u=await o.json()).auth_session,authnParamsPublicKey:Te({},u.authn_params_public_key)};var u}async challenge(t,e){const n="".concat(X(Gp,this),"/passkey/challenge"),i=Te({client_id:X(Jp,this)},u3(X(Xp,this)));t!=null&&t.realm&&(i.realm=t.realm),t!=null&&t.organization&&(i.organization=t.organization);const r=await Me(th,this,d3).call(this,e)(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!r.ok){const u=await Me(th,this,h3).call(this,r),d=new Tne(u.error_description||"Failed to request login challenge",u);throw d.statusCode=r.status,d.headers=an(r.headers),d}return{authSession:(l=await r.json()).auth_session,authnParamsPublicKey:Te({},l.authn_params_public_key)};var l}async getTokenByPasskey(t,e){t.organization!==void 0&&LO(t.organization);const n=new URLSearchParams({auth_session:t.authSession,authn_response:JSON.stringify(t.credential)});let i;t.realm&&n.append("realm",t.realm),t.scope&&n.append("scope",t.scope),t.audience&&n.append("audience",t.audience),t.organization&&n.append("organization",t.organization);try{i=await X(P0,this).call(this,WH,n,e,t.fullResponse)}catch(o){if(o instanceof zn)throw o;const l=hi(o),u=new Cne(l.error_description||"Failed to exchange passkey credential for tokens.",l);throw Hh(u,o),u}if(t.fullResponse){const o=i;return t.organization&&Pm(o.data.claims,t.organization),o}const r=i;return t.organization&&Pm(r.claims,t.organization),r}});function d3(t){return pv(X(N_,this),t,X(M_,this))}async function h3(t){const e=await t.clone().text();try{return Te(Te({},JSON.parse(e)),{},{statusCode:t.status,headers:t.headers,body:e})}catch{return{error:"unknown_error",error_description:"HTTP ".concat(t.status," ").concat(t.statusText),statusCode:t.status,headers:t.headers,body:e}}}
20var Vw=class extends Error{constructor(t,e,n){super(e),be(this,"cause",void 0),be(this,"code",void 0),be(this,"statusCode",void 0),be(this,"headers",void 0),be(this,"body",void 0),Object.setPrototypeOf(this,new.target.prototype),this.code=t,this.cause=n&&(n.error||n.error_description)?{error:n.error,error_description:n.error_description,message:n.message,mfa_token:n.mfa_token,mfa_requirements:n.mfa_requirements}:void 0;const i=dv(n);this.statusCode=i.statusCode,this.headers=i.headers,this.body=i.body}},D2=class extends Vw{constructor(t,e){super("passwordless_start_error",t,e),this.name="PasswordlessStartError"}},L2=class extends Vw{constructor(t,e){super("passwordless_verify_error",t,e),this.name="PasswordlessVerifyError"}},f3=class extends Vw{constructor(t,e){super("passwordless_db_get_token_error",t,e),this.name="PasswordlessDbGetTokenError"}},q_=class extends Vw{constructor(t,e,n,i,r){super("passwordless_challenge_error",t,n),be(this,"statusCode",void 0),be(this,"validationErrors",void 0),this.name="PasswordlessChallengeError",this.statusCode=e,this.validationErrors=i,this.headers=r??this.headers}};function U2(t){return/^\+[1-9]\d{1,14}$/.test(t)}async function qH(t,e,n){if(t.useMtls)return{};if(t.clientAssertionSigningKey){var i;const r=(i=t.clientAssertionSigningAlg)!==null&&i!==void 0?i:"RS256",o=t.clientAssertionSigningKey instanceof CryptoKey?t.clientAssertionSigningKey:await DO(t.clientAssertionSigningKey,r);return{client_assertion:await new LH({}).setProtectedHeader({alg:r}).setIssuer(e).setSubject(e).setAudience("https://".concat(n,"/")).setJti(crypto.randomUUID()).setIssuedAt().setExpirationTime("".concat(120,"s")).sign(o),client_assertion_type:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"}}if(t.clientSecret)return{client_secret:t.clientSecret};throw new HH}var Rne=(Yg=new WeakMap,Qg=new WeakMap,Au=new WeakMap,I_=new WeakMap,z_=new WeakMap,em=new WeakMap,Yp=new WeakMap,Zl=new WeakSet,class{constructor(t){var e,n;gf(this,Zl),ut(this,Yg,void 0),ut(this,Qg,void 0),ut(this,Au,void 0),ut(this,I_,void 0),ut(this,z_,void 0),ut(this,em,void 0),ut(this,Yp,void 0),pt(Qg,this,t.domain),pt(Yg,this,"https://".concat(t.domain)),pt(Au,this,t.clientId),pt(I_,this,(e=t.customFetch)!==null&&e!==void 0?e:function(){return fetch(...arguments)}),pt(z_,this,(n=t.telemetryConfig)!==null&&n!==void 0?n:fv()),pt(em,this,{clientSecret:t.clientSecret,clientAssertionSigningKey:t.clientAssertionSigningKey,clientAssertionSigningAlg:t.clientAssertionSigningAlg,useMtls:t.useMtls}),pt(Yp,this,t.grantRequest)}async sendEmail(t,e){const n=await Me(Zl,this,p3).call(this,(function(i){var r;const o=(r=i.send)!==null&&r!==void 0?r:"code",l={email:i.email,connection:"email",send:o};return o==="link"&&i.authParams&&(l.authParams=i.authParams),l})(t),"Failed to send passwordless email",t.language,e);if(t.fullResponse)return{data:void 0,response:n}}async sendSms(t,e){if(!U2(t.phoneNumber))throw new D2("Phone number must be in E.164 format (e.g. +14155550100).");const n=await Me(Zl,this,p3).call(this,(function(i){return{phone_number:i.phoneNumber,connection:"sms"}})(t),"Failed to send passwordless SMS",t.language,e);if(t.fullResponse)return{data:void 0,response:n}}async challengeWithEmail(t,e){const n=(function(i){var r;return{email:i.email,connection:i.connection,allow_signup:(r=i.allowSignup)!==null&&r!==void 0&&r}})(t);return Me(Zl,this,g3).call(this,n,"Failed to request email OTP challenge",e)}async challengeWithPhoneNumber(t,e){if(!U2(t.phoneNumber))throw new q_("Phone number must be in E.164 format (e.g. +14155550100).",0,void 0,void 0);const n=(function(i){var r;const o={phone_number:i.phoneNumber,connection:i.connection,allow_signup:(r=i.allowSignup)!==null&&r!==void 0&&r};return i.deliveryMethod&&(o.delivery_method=i.deliveryMethod),o})(t);return Me(Zl,this,g3).call(this,n,"Failed to request phone OTP challenge",e)}async getTokenByPasswordlessDbConnection(t,e){const n=new URLSearchParams({auth_session:t.authSession,otp:t.otp});if(t.scope&&n.append("scope",t.scope),t.audience&&n.append("audience",t.audience),!X(Yp,this))throw new f3("Missing grant request delegate.",hi(new Error("missing grantRequest")));try{return await X(Yp,this).call(this,"http://auth0.com/oauth/grant-type/passwordless/otp",n,e,t.fullResponse)}catch(i){if(i instanceof zn)throw i;const r=new f3("There was an error while trying to request a token.",hi(i)),o=i;throw r.statusCode=o._statusCode,r.headers=o._headers,r}}});function VH(t){return pv(X(I_,this),t,X(z_,this))}async function p3(t,e,n,i){var r;const o=await qH(X(em,this),X(Au,this),X(Qg,this)),l=Te(Te({client_id:X(Au,this)},t),o);let u;
20try{u=await Me(Zl,this,VH).call(this,i)("".concat(X(Yg,this),"/passwordless/start"),{method:"POST",headers:Te({"Content-Type":"application/json"},n?{"x-request-language":n}:{}),body:JSON.stringify(l)})}catch{throw new D2("".concat(e,": a network error occurred."))}if(u.ok)return u;const d=await u.clone().text();let f;if(u.status!==204)try{f=JSON.parse(d)}catch{f=void 0}const p=new D2(((r=f)===null||r===void 0?void 0:r.error_description)||e,f);throw p.statusCode=u.status,p.headers=an(u.headers),p.body=d,p}async function g3(t,e,n){var i,r;const o=await qH(X(em,this),X(Au,this),X(Qg,this)),l=Te(Te({client_id:X(Au,this)},t),o);let u;try{u=await Me(Zl,this,VH).call(this,n)("".concat(X(Yg,this),"/otp/challenge"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)})}catch{throw new q_("challenge error: a network error occurred.",0,void 0,void 0)}if(u.ok){let g;try{g=await u.json()}catch{throw new q_("".concat(e,": could not parse the response body."),u.status,void 0,void 0,an(u.headers))}return{authSession:g.auth_session}}const d=await u.clone().text();let f;try{f=JSON.parse(d)}catch{f=void 0}const p=f?Te(Te({},f),{},{statusCode:u.status,headers:u.headers,body:d}):{error:"",error_description:"",statusCode:u.status,headers:u.headers,body:d};throw new q_(((i=f)===null||i===void 0?void 0:i.error_description)||e,u.status,p,(r=f)===null||r===void 0?void 0:r.validation_errors,an(u.headers))}var BH=class extends Error{constructor(t,e,n){super(e),be(this,"cause",void 0),be(this,"code",void 0),be(this,"statusCode",void 0),be(this,"headers",void 0),be(this,"body",void 0),Object.setPrototypeOf(this,new.target.prototype),this.code=t,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message};const i=dv(n);this.statusCode=i.statusCode,this.headers=i.headers,this.body=i.body}},m3=class extends BH{constructor(t,e){super("signup_error",t,e),this.name="SignUpError"}},TE=class extends BH{constructor(t,e){super("change_password_error",t,e),this.name="ChangePasswordError"}};function v3(t,e,n){for(const i of e)if(t[i]===null||t[i]===void 0||t[i]==="")throw new n('Required parameter "'.concat(String(i),'" was null, undefined, or empty.'))}function y3(t){var e,n;return{id:(e=(n=t._id)!==null&&n!==void 0?n:t.user_id)!==null&&e!==void 0?e:t.id,email:typeof t.email=="string"?t.email:"",emailVerified:!!t.email_verified,username:t.username,givenName:t.given_name,familyName:t.family_name,name:t.name,nickname:t.nickname,picture:t.picture,userMetadata:t.user_metadata}}var $ne=(D_=new WeakMap,Qp=new WeakMap,L_=new WeakMap,U_=new WeakMap,N0=new WeakSet,class{constructor(t){var e,n;gf(this,N0),ut(this,D_,void 0),ut(this,Qp,void 0),ut(this,L_,void 0),ut(this,U_,void 0),pt(D_,this,"https://".concat(t.domain)),pt(Qp,this,t.clientId),pt(L_,this,(e=t.customFetch)!==null&&e!==void 0?e:function(){return fetch(...arguments)}),pt(U_,this,(n=t.telemetryConfig)!==null&&n!==void 0?n:fv())}async signUp(t,e){var n;v3(t,["email","password","connection"],m3);const i=Te({client_id:(n=t.clientId)!==null&&n!==void 0?n:X(Qp,this)},(function(o){const l={email:o.email,password:o.password,connection:o.connection};return o.username!==void 0&&(l.username=o.username),o.givenName!==void 0&&(l.given_name=o.givenName),o.familyName!==void 0&&(l.family_name=o.familyName),o.name!==void 0&&(l.name=o.name),o.nickname!==void 0&&(l.nickname=o.nickname),o.picture!==void 0&&(l.picture=o.picture),o.userMetadata!==void 0&&(l.user_metadata=o.userMetadata),l})(t)),r=await Me(N0,this,_3).call(this,"/dbconnections/signup",i,m3,"Failed to sign up",e);if(t.fullResponse){const o=r.clone();return{data:y3(await r.json()),response:o}}return y3(await r.json())}async changePassword(t,e){var n;if(v3(t,["connection"],TE),!t.email&&!t.username)throw new TE('Either "email" or "username" is required.');const i=Te({client_id:(n=t.clientId)!==null&&n!==void 0?n:X(Qp,this)},(function(o){const l={connection:o.connection};return o.email!==void 0&&(l.email=o.email),o.username!==void 0&&(l.username=o.username),o.organization!==void 0&&(l.organization=o.organization),l})(t)),r=await Me(N0,this,_3).call(this,"/dbconnections/change_password",i,TE,"Failed to request a password change",e);if(t.fullResponse){const o=r.clone();return{data:await r.text(),response:o}}return r.text()}});async function _3(t,e,n,i,r){const o=pv(X(L_,this),r,X(U_,this));let l;try{l=await o("".concat(X(D_,this)).concat(t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch{throw new n("".concat(i,": a network error occurred."))}if(l.ok)return l;const u=await l.clone().text(),d=await(async function(p){let g;
20try{g=await p.json()}catch{return}return typeof g.error=="string"?g:typeof g.code=="string"?{error:g.code,error_description:typeof g.description=="string"?g.description:""}:void 0})(l.clone()),f=new n(d?.error_description||i,d??{error:"unknown_error",error_description:i});throw f.statusCode=l.status,f.headers=an(l.headers),f.body=u,f}var _u=class extends Error{constructor(t,e,n){super(e),be(this,"code",void 0),be(this,"cause",void 0),this.name="AnonymousSessionError",this.code=t,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},Ane=new Set(["session_expired","invalid_session_token"]);async function GH(t){const e="Request failed with status ".concat(t.status);let n={};try{n=await t.json()}catch{}return{error:typeof n.error=="string"?n.error:"server_error",error_description:typeof n.error_description=="string"?n.error_description:e}}var jne=(F_=new WeakMap,bg=new WeakMap,cu=new WeakMap,H_=new WeakMap,K_=new WeakMap,Z_=new WeakMap,W_=new WeakMap,wg=new WeakMap,xg=new WeakSet,class{constructor(t){var e;gf(this,xg),ut(this,F_,void 0),ut(this,bg,void 0),ut(this,cu,void 0),ut(this,H_,void 0),ut(this,K_,void 0),ut(this,Z_,void 0),ut(this,W_,void 0),ut(this,wg,void 0),pt(F_,this,t.domain),pt(bg,this,"https://".concat(t.domain)),pt(cu,this,t.clientId),pt(H_,this,t.clientSecret),pt(K_,this,t.clientAssertionSigningKey),pt(Z_,this,t.clientAssertionSigningAlg),pt(W_,this,t.useMtls),pt(wg,this,(e=t.customFetch)!==null&&e!==void 0?e:function(){return fetch(...arguments)})}async createSession(t){const e={client_id:X(cu,this)};t!=null&&t.audience&&(e.audience=t.audience),t!=null&&t.scope&&(e.scope=t.scope),t!=null&&t.metadata&&(e.metadata=t.metadata);const n=await Me(xg,this,JH).call(this,e);if(!n.sessionToken)throw new _u("server_error","session_token missing from create session response");return{sessionToken:n.sessionToken,accessToken:n.accessToken,expiresAt:n.expiresAt,sessionTokenExpiresAt:n.sessionTokenExpiresAt,scope:n.scope}}async getAccessToken(t){if(t==null||!t.sessionToken)return this.createSession({audience:t?.audience,scope:t?.scope});try{return await Me(xg,this,Pne).call(this,t.sessionToken,t)}catch(e){if(e instanceof _u&&Ane.has(e.code))return Te(Te({},await this.createSession({audience:t?.audience,scope:t?.scope})),{},{sessionReplaced:!0});throw e}}async logout(){const t="".concat(X(bg,this),"/anonymous/logout"),e={client_id:X(cu,this)},n=await X(wg,this).call(this,t,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",redirect:"error",body:JSON.stringify(e)});if(!n.ok){const i=await GH(n);throw new _u(i.error,i.error_description||"Failed to end anonymous session",i)}}});async function Pne(t,e){const n={client_id:X(cu,this),session_token:t};e!=null&&e.audience&&(n.audience=e.audience),e!=null&&e.scope&&(n.scope=e.scope);const i=await Me(xg,this,JH).call(this,n);return{sessionToken:t,accessToken:i.accessToken,expiresAt:i.expiresAt,sessionTokenExpiresAt:i.sessionTokenExpiresAt,scope:i.scope,sessionReplaced:!1}}async function JH(t){const e="".concat(X(bg,this),"/anonymous/token"),n=await(async function(o,l,u){if(o.useMtls)return{};if(o.clientAssertionSigningKey){var d;const f=(d=o.clientAssertionSigningAlg)!==null&&d!==void 0?d:"RS256",p=o.clientAssertionSigningKey instanceof CryptoKey?o.clientAssertionSigningKey:await DO(o.clientAssertionSigningKey,f);return{client_assertion:await new LH({}).setProtectedHeader({alg:f}).setIssuer(l).setSubject(l).setAudience("https://".concat(u,"/")).setJti(crypto.randomUUID()).setIssuedAt().setExpirationTime("".concat(120,"s")).sign(p),client_assertion_type:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"}}return o.clientSecret?{client_secret:o.clientSecret}:{}})({clientSecret:X(H_,this),clientAssertionSigningKey:X(K_,this),clientAssertionSigningAlg:X(Z_,this),useMtls:X(W_,this)},X(cu,this),X(F_,this));Object.assign(t,n);const i=await X(wg,this).call(this,e,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",redirect:"error",body:JSON.stringify(t)});if(!i.ok){const o=await GH(i);throw new _u(o.error,o.error_description||"Anonymous token request failed",o)}let r;try{r=await i.json()}catch{throw new _u("server_error","Invalid response from anonymous token endpoint")}return(function(o){const l=Math.floor(Date.now()/1e3);if(typeof o.access_token!="string"||!o.access_token)throw new _u("server_error","access_token missing or invalid in anonymous token response");const u=o.expires_in;if(typeof u!="number"||!Number.isFinite(u))throw new _u("server_error","expires_in missing or invalid in anonymous token response");return{accessToken:o.access_token,expiresAt:l+u,scope:o.scope,sessionToken:o.session_token,sessionTokenExpiresAt:typeof o.session_expires_in=="number"&&Number.isFinite(o.session_expires_in)?l+o.session_expires_in:void 0}})(r)}var XH=(As=new WeakMap,M0=new WeakMap,I0=new WeakMap,class{constructor(t,e){ut(this,As,new Map),ut(this,M0,void 0),ut(this,I0,void 0),pt(I0,this,Math.max(1,Math.floor(t))),pt(M0,this,Math.max(0,Math.floor(e)))}get(t){const e=X(As,this).get(t);if(e){if(!(Date.now()>=e.expiresAt))return X(As,this).delete(t),X(As,this).set(t,e),e.value;X(As,this).delete(t)}}set(t,e,n){X(As,this).has(t)&&X(As,this).delete(t);const i=n!=null&&Number.isFinite(n)&&n>0?n:X(M0,this);for(X(As,this).set(t,{value:e,expiresAt:Date.now()+i});X(As,this).size>X(I0,this);){const r=X(As,this).keys().next().value;if(r===void 0)break;X(As,this).delete(r)}}}),b3=new Map;function w3(t){return{ttlMs:1e3*(typeof t?.ttl=="number"?t.ttl:600),maxEntries:typeof t?.maxEntries=="number"&&t.maxEntries>0?t.maxEntries:100}}var x3=class{static createDiscoveryCache(t){const e=(n=t.maxEntries,i=t.ttlMs,"".concat(n,":").concat(i));var n,i;let r=(o=e,b3.get(o));var o;return r||(r=new XH(t.maxEntries,t.ttlMs),b3.set(e,r)),r}static createJwksCache(){return{}}},F2="openid profile email offline_access",Nne=Object.freeze(new Set(["grant_type","client_id","client_secret","client_assertion","client_assertion_type","subject_token","subject_token_type","requested_token_type","actor_token","actor_token_type","audience","aud","resource","resources","resource_indicator","scope","connection","login_hint","organization","assertion"]));function YH(t){if(t==null)throw new ds("subject_token is required");if(typeof t!="string")throw new ds("subject_token must be a string");if(t.trim().length===0)throw new ds("subject_token cannot be blank or whitespace");if(t!==t.trim())throw new ds("subject_token must not include leading or trailing whitespace");if(/^bearer\s+/i.test(t))throw new ds("subject_token must not include the 'Bearer ' prefix")}function QH(t,e){if(e)for(const i of Object.entries(e)){var n=ur(i,2);const r=n[0],o=n[1];if(!Nne.has(r))if(Array.isArray(o)){if(o.length>20)throw new ds("Parameter '".concat(r,"' exceeds maximum array size of ").concat(20));o.forEach(l=>{t.append(r,l)})}else t.append(r,o)}}var S3="urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",k3="urn:ietf:params:oauth:grant-type:token-exchange",e9="urn:ietf:params:oauth:token-type:access_token";function E3(t,e){return(n,i)=>{const r=i?.body;if(e!==WH||!(r instanceof URLSearchParams))return t(n,i);const o={};for(const d of r){var l=ur(d,2);const f=l[0],p=l[1];o[f]=f==="authn_response"?JSON.parse(p):p}const u=new Headers(i?.headers);return u.set("Content-Type","application/json"),t(n,Te(Te({},i),{},{headers:u,body:JSON.stringify(o)}))}}
vendor: 4,924 bytes, line 20
20var Mne=(Jb=new WeakMap,Xb=new WeakMap,jm=new WeakMap,Ch=new WeakMap,tt=new WeakMap,Ft=new WeakMap,Aa=new WeakMap,eg=new WeakMap,tm=new WeakMap,Fh=new WeakMap,z0=new WeakMap,Fe=new WeakSet,class{constructor(t){var e;if(gf(this,Fe),ut(this,Jb,void 0),ut(this,Xb,void 0),ut(this,jm,void 0),ut(this,Ch,void 0),ut(this,tt,void 0),ut(this,Ft,void 0),ut(this,Aa,void 0),ut(this,eg,void 0),ut(this,tm,void 0),ut(this,Fh,void 0),ut(this,z0,void 0),be(this,"mfa",void 0),be(this,"passkey",void 0),be(this,"passwordless",void 0),be(this,"database",void 0),be(this,"anonymous",void 0),pt(tt,this,t),t.useMtls&&!t.customFetch)throw new r3("mtls_without_custom_fetch_not_supported","Using mTLS without a custom fetch implementation is not supported");pt(Aa,this,fv(t.telemetry)),pt(Ft,this,ZH((e=t.customFetch)!==null&&e!==void 0?e:function(){return fetch(...arguments)},X(Aa,this)));const n=w3(t.discoveryCache);pt(tm,this,x3.createDiscoveryCache(n)),pt(Fh,this,new Map),pt(z0,this,x3.createJwksCache()),this.mfa=new kne({domain:X(tt,this).domain,clientId:X(tt,this).clientId,clientSecret:X(tt,this).clientSecret,customFetch:X(Ft,this),telemetryConfig:X(Aa,this),getConfiguration:async i=>(await Me(Fe,this,Sr).call(this,i)).configuration,createCaptureConfiguration:async i=>{const r=(await Me(Fe,this,Wl).call(this)).serverMetadata;return Me(Fe,this,yn).call(this,r,i)}}),this.passkey=new One({domain:X(tt,this).domain,clientId:X(tt,this).clientId,clientSecret:X(tt,this).clientSecret,useMtls:X(tt,this).useMtls,customFetch:X(Ft,this),telemetryConfig:X(Aa,this),grantRequest:async(i,r,o,l)=>{const u=(await Me(Fe,this,Wl).call(this)).serverMetadata,d=Me(Fe,this,t9).call(this,o);if(l){const g=Mn(d),v=await Me(Fe,this,yn).call(this,u,g);v[It]=E3(g,i);const y=await rr(v,i,r),b=En.fromTokenEndpointResponse(y),x=g.getCapturedResponse();if(!x)throw new zn;return{data:b,response:x}}const f=await Me(Fe,this,yn).call(this,u);f[It]=E3(d,i);const p=await rr(f,i,r);return En.fromTokenEndpointResponse(p)}}),this.passwordless=new Rne({domain:X(tt,this).domain,clientId:X(tt,this).clientId,customFetch:X(Ft,this),telemetryConfig:X(Aa,this),clientSecret:X(tt,this).clientSecret,clientAssertionSigningKey:X(tt,this).clientAssertionSigningKey,clientAssertionSigningAlg:X(tt,this).clientAssertionSigningAlg,useMtls:X(tt,this).useMtls,grantRequest:async(i,r,o,l)=>{const u=(await Me(Fe,this,Sr).call(this,o)).configuration;if(l){var d;const f=Mn((d=u[It])!==null&&d!==void 0?d:X(Ft,this)),p=await Me(Fe,this,yn).call(this,u.serverMetadata(),f),g=await rr(p,i,r),v=En.fromTokenEndpointResponse(g),y=f.getCapturedResponse();if(!y)throw new zn;return{data:v,response:y}}try{const f=await rr(u,i,r);return En.fromTokenEndpointResponse(f)}catch(f){const p=f,g={};throw Hh(g,f),p._statusCode=g.statusCode,p._headers=g.headers,f}}}),this.database=new $ne({domain:X(tt,this).domain,clientId:X(tt,this).clientId,customFetch:X(Ft,this),telemetryConfig:X(Aa,this)}),this.anonymous=new jne({domain:X(tt,this).domain,clientId:X(tt,this).clientId,clientSecret:X(tt,this).clientSecret,clientAssertionSigningKey:X(tt,this).clientAssertionSigningKey,clientAssertionSigningAlg:X(tt,this).clientAssertionSigningAlg,useMtls:X(tt,this).useMtls,customFetch:X(Ft,this)})}async getServerMetadata(){return(await Me(Fe,this,Wl).call(this)).serverMetadata}async buildAuthorizationUrl(t){const e=(await Me(Fe,this,Wl).call(this)).serverMetadata;if(t!=null&&t.pushedAuthorizationRequests&&!e.pushed_authorization_request_endpoint)throw new r3("par_not_supported_error","The Auth0 tenant does not have pushed authorization requests enabled. Learn how to enable it here: https://auth0.com/docs/get-started/applications/configure-par");try{return await Me(Fe,this,OE).call(this,t)}catch(n){throw new bne(n)}}async buildLinkUserUrl(t){try{const e=await Me(Fe,this,OE).call(this,{authorizationParams:Te(Te({},t.authorizationParams),{},{requested_connection:t.connection,requested_connection_scope:t.connectionScope,scope:"openid link_account offline_access",id_token_hint:t.idToken})});return{linkUserUrl:e.authorizationUrl,codeVerifier:e.codeVerifier}}catch(e){throw new wne(e)}}async buildUnlinkUserUrl(t){try{const e=await Me(Fe,this,OE).call(this,{authorizationParams:Te(Te({},t.authorizationParams),{},{requested_connection:t.connection,scope:"openid unlink_account",id_token_hint:t.idToken})});return{unlinkUserUrl:e.authorizationUrl,codeVerifier:e.codeVerifier}}catch(e){throw new xne(e)}}async backchannelAuthentication(t,e){var n;const i=await Me(Fe,this,Sr).call(this,e),r=i.configuration,o=i.serverMetadata,l=N2(Te(Te({},X(tt,this).authorizationParams),t?.authorizationParams)),u=new URLSearchParams(Te(Te({scope:F2},l),{},{client_id:X(tt,this).clientId,binding_message:t.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:o.issuer,sub:t.loginHint.sub})}));if(t.requestedExpiry&&u.append("requested_expiry",t.requestedExpiry.toString()),t.authorizationDetail
20s&&u.append("authorization_details",JSON.stringify(t.authorizationDetails)),t.fullResponse){var d;const g=Mn((d=r[It])!==null&&d!==void 0?d:X(Ft,this)),v=await Me(Fe,this,yn).call(this,r.serverMetadata(),g);try{const y=await gE(r,u),b=await C2(v,y),x=g.getCapturedResponse();if(!x)throw new zn;return{data:En.fromTokenEndpointResponse(b),response:x}}catch(y){if(y instanceof zn)throw y;const b=new L0(y);throw Hh(b,y,g.getCapturedResponse()),b}}const f=Mn((n=r[It])!==null&&n!==void 0?n:X(Ft,this)),p=await Me(Fe,this,yn).call(this,r.serverMetadata(),f);try{const g=await gE(r,u),v=await C2(p,g);return En.fromTokenEndpointResponse(v)}catch(g){const v=new L0(g);throw Hh(v,g,f.getCapturedResponse()),v}}async initiateBackchannelAuthentication(t,e){var n;const i=await Me(Fe,this,Sr).call(this,e),r=i.configuration,o=i.serverMetadata,l=N2(Te(Te({},X(tt,this).authorizationParams),t?.authorizationParams)),u=new URLSearchParams(Te(Te({scope:F2},l),{},{client_id:X(tt,this).clientId,binding_message:t.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:o.issuer,sub:t.loginHint.sub})}));t.requestedExpiry&&u.append("requested_expiry",t.requestedExpiry.toString()),t.authorizationDetails&&u.append("authorization_details",JSON.stringify(t.authorizationDetails));const d=Mn((n=r[It])!==null&&n!==void 0?n:X(Ft,this)),f=await Me(Fe,this,yn).call(this,r.serverMetadata(),d);try{const p=await gE(f,u);return{authReqId:p.auth_req_id,expiresIn:p.expires_in,interval:p.interval}}catch(p){const g=new L0(p),v=d.getCapturedResponse();throw g.statusCode=v?.status,g.headers=v?an(v.headers):void 0,g}}async backchannelAuthenticationGrant(t,e){var n;let i=t.authReqId;const r=(await Me(Fe,this,Sr).call(this,e)).configuration,o=new URLSearchParams({auth_req_id:i}),l=Mn((n=r[It])!==null&&n!==void 0?n:X(Ft,this)),u=await Me(Fe,this,yn).call(this,r.serverMetadata(),l);try{const d=await rr(u,"urn:openid:params:grant-type:ciba",o);return En.fromTokenEndpointResponse(d)}catch(d){const f=new L0(d),p=l.getCapturedResponse();throw f.statusCode=p?.status,f.headers=p?an(p.headers):void 0,f}}async getTokenForConnection(t,e){var n;if(t.refreshToken&&t.accessToken)throw new EE("Either a refresh or access token should be specified, but not both.");const i=(n=t.accessToken)!==null&&n!==void 0?n:t.refreshToken;if(!i)throw new EE("Either a refresh or access token must be specified.");try{return await this.exchangeToken(Te({connection:t.connection,subjectToken:i,subjectTokenType:t.accessToken?e9:"urn:ietf:params:oauth:token-type:refresh_token",loginHint:t.loginHint},t.fullResponse?{fullResponse:!0}:{}),e)}catch(r){if(r instanceof ds){const o=new EE(r.message,r.cause);throw o.statusCode=r.statusCode,o.headers=r.headers,o}throw r}}async exchangeToken(t,e){return t.fullResponse?"connection"in t?Me(Fe,this,T3).call(this,t,e,!0):Me(Fe,this,O3).call(this,t,e,!0):"connection"in t?Me(Fe,this,T3).call(this,t,e):Me(Fe,this,O3).call(this,t,e)}async getTokenByCode(t,e,n){var i;const r=(await Me(Fe,this,Sr).call(this,n)).configuration;if(e.organization!==void 0&&LO(e.organization),e.fullResponse){var o;const f=Mn((o=r[It])!==null&&o!==void 0?o:X(Ft,this)),p=await Me(Fe,this,yn).call(this,r.serverMetadata(),f);let g,v;try{const y=await _g(p,t,{pkceCodeVerifier:e.codeVerifier});if(g=En.fromTokenEndpointResponse(y),v=f.getCapturedResponse(),!v)throw new zn}catch(y){if(y instanceof zn)throw y;const b=new D0("There was an error while trying to request a token.",hi(y)),x=f.getCapturedResponse();throw b.statusCode=x?.status,b.headers=x?an(x.headers):void 0,b}return e.organization&&Pm(g.claims,e.organization),{data:g,response:v}}const l=Mn((i=r[It])!==null&&i!==void 0?i:X(Ft,this)),u=await Me(Fe,this,yn).call(this,r.serverMetadata(),l);let d;try{const f=await _g(u,t,{pkceCodeVerifier:e.codeVerifier});d=En.fromTokenEndpointResponse(f)}catch(f){const p=new D0("There was an error while trying to request a token.",hi(f)),g=l.getCapturedResponse();throw p.statusCode=g?.status,p.headers=g?an(g.headers):void 0,p}return e.organization&&Pm(d.claims,e.organization),d}async getTokenByMagicLinkCode(t,e,n){var i;const r=(await Me(Fe,this,Sr).call(this,n)).configuration;if(e!=null&&e.fullResponse){var o;const d=Mn((o=r[It])!==null&&o!==void 0?o:X(Ft,this)),f=await Me(Fe,this,yn).call(this,r.serverMetadata(),d);try{const p=await _g(f,t,{expectedState:e?.expectedState}),g=En.fromTokenEndpointResponse(p),v=d.getCapturedResponse();if(!v)throw new zn;return{data:g,response:v}}catch(p){if(p instanceof zn)throw p;const g=p instanceof Error&&p.message?p.message:"There was an error while trying to request a token.",v=new D0(g,p),y=d.getCapturedResponse();throw v.statusCode=y?.status,v.headers=y?an(y.headers):void 0,v}}const l=Mn((i=r[It])!==null&&i!==void 0?i:X(Ft,this)),u=await Me(Fe,this,yn).call(this,r.serverMetadata(),l);try{const d=await _g(u,t,{expectedState:e?.expectedState});return En.fromTokenEndpointResponse(d)}catch(d){const f=d instanceof Error&&d.message?d.message:"There was an error while trying to request a token.",p=new D0(f,d),g=l.getCapturedResponse();throw p.statusCode=g?.status,p.headers=g?an(g.headers):void 0,p}}async getTokenByRefreshToken(t,e){var n;const i=(await Me(Fe,this,Sr).call(this,e)).configuration,r=new URLSearchParams;
20if(t.audience&&r.append("audience",t.audience),t.scope&&r.append("scope",t.scope),t.fullResponse){var o;const d=Mn((o=i[It])!==null&&o!==void 0?o:X(Ft,this)),f=await Me(Fe,this,yn).call(this,i.serverMetadata(),d);try{const p=await O2(f,t.refreshToken,r),g=En.fromTokenEndpointResponse(p),v=d.getCapturedResponse();if(!v)throw new zn;return{data:g,response:v}}catch(p){if(p instanceof zn)throw p;const g=new o3("The access token has expired and there was an error while trying to refresh it.",hi(p)),v=d.getCapturedResponse();throw g.statusCode=v?.status,g.headers=v?an(v.headers):void 0,g}}const l=Mn((n=i[It])!==null&&n!==void 0?n:X(Ft,this)),u=await Me(Fe,this,yn).call(this,i.serverMetadata(),l);try{const d=await O2(u,t.refreshToken,r);return En.fromTokenEndpointResponse(d)}catch(d){const f=new o3("The access token has expired and there was an error while trying to refresh it.",hi(d)),p=l.getCapturedResponse();throw f.statusCode=p?.status,f.headers=p?an(p.headers):void 0,f}}async revokeToken(t,e){var n;const i=(await Me(Fe,this,Sr).call(this,e)).configuration,r={};t.tokenTypeHint&&(r.token_type_hint=t.tokenTypeHint);const o=Mn((n=i[It])!==null&&n!==void 0?n:X(Ft,this)),l=await Me(Fe,this,yn).call(this,i.serverMetadata(),o);try{await Qte(l,t.token,r)}catch(u){const d=new yne("An error occurred while trying to revoke the token.",hi(u)),f=o.getCapturedResponse();throw d.statusCode=f?.status,d.headers=f?an(f.headers):void 0,d}}async getUserInfo(t,e){const n=(await Me(Fe,this,Sr).call(this,e,!0)).configuration;try{var i;return await IH(n,t.accessToken,(i=t.expectedSubject)!==null&&i!==void 0?i:Gte)}catch(r){throw new _ne("There was an error while trying to retrieve the user info.",hi(r))}}async getTokenByPassword(t,e){var n;const i=(await Me(Fe,this,Sr).call(this,e)).configuration,r=new URLSearchParams({username:t.username,password:t.password});t.audience&&r.append("audience",t.audience),t.scope&&r.append("scope",t.scope),t.realm&&r.append("realm",t.realm);let o=i;if(t.auth0ForwardedFor){const f=await Me(Fe,this,FO).call(this);o=new nf(i.serverMetadata(),X(tt,this).clientId,{client_secret:X(tt,this).clientSecret,use_mtls_endpoint_aliases:X(tt,this).useMtls},f);const p=i[It];o[It]=(g,v)=>p(g,Te(Te({},v),{},{headers:Te(Te({},v.headers),{},{"auth0-forwarded-for":t.auth0ForwardedFor})}))}if(t.fullResponse){var l;const f=Mn((l=o[It])!==null&&l!==void 0?l:X(Ft,this)),p=await Me(Fe,this,yn).call(this,o.serverMetadata(),f);try{const g=await rr(p,"password",r),v=En.fromTokenEndpointResponse(g),y=f.getCapturedResponse();if(!y)throw new zn;return{data:v,response:y}}catch(g){if(g instanceof zn)throw g;const v=new a3("There was an error while trying to request a token.",hi(g)),y=f.getCapturedResponse();throw v.statusCode=y?.status,v.headers=y?an(y.headers):void 0,v}}const u=Mn((n=o[It])!==null&&n!==void 0?n:X(Ft,this)),d=await Me(Fe,this,yn).call(this,o.serverMetadata(),u);try{const f=await rr(d,"password",r);return En.fromTokenEndpointResponse(f)}catch(f){const p=new a3("There was an error while trying to request a token.",hi(f)),g=u.getCapturedResponse();throw p.statusCode=g?.status,p.headers=g?an(g.headers):void 0,p}}async getTokenByPasswordlessEmail(t,e){const n=new URLSearchParams({username:t.email,otp:t.code,realm:"email"});return t.audience&&n.append("audience",t.audience),t.scope&&n.append("scope",t.scope),Me(Fe,this,R3).call(this,n,e,t.fullResponse)}async getTokenByPasswordlessSms(t,e){if(!U2(t.phoneNumber))throw new L2("Phone number must be in E.164 format (e.g. +14155550100).");const n=new URLSearchParams({username:t.phoneNumber,otp:t.code,realm:"sms"});return t.audience&&n.append("audience",t.audience),t.scope&&n.append("scope",t.scope),Me(Fe,this,R3).call(this,n,e,t.fullResponse)}async getTokenByClientCredentials(t,e){var n;const i=(await Me(Fe,this,Sr).call(this,e)).configuration;if(t.fullResponse){var r;const u=Mn((r=i[It])!==null&&r!==void 0?r:X(Ft,this)),d=await Me(Fe,this,yn).call(this,i.serverMetadata(),u),f=new URLSearchParams({audience:t.audience});t.organization&&f.append("organization",t.organization);try{const p=await R2(d,f),g=En.fromTokenEndpointResponse(p),v=u.getCapturedResponse();if(!v)throw new zn;return{data:g,response:v}}catch(p){if(p instanceof zn)throw p;const g=new s3("There was an error while trying to request a token.",hi(p)),v=u.getCapturedResponse();throw g.statusCode=v?.status,g.headers=v?an(v.headers):void 0,g}}const o=Mn((n=i[It])!==null&&n!==void 0?n:X(Ft,this)),l=await Me(Fe,this,yn).call(this,i.serverMetadata(),o);
20try{const u=new URLSearchParams({audience:t.audience});t.organization&&u.append("organization",t.organization);const d=await R2(l,u);return En.fromTokenEndpointResponse(d)}catch(u){const d=new s3("There was an error while trying to request a token.",hi(u)),f=o.getCapturedResponse();throw d.statusCode=f?.status,d.headers=f?an(f.headers):void 0,d}}async buildLogoutUrl(t){const e=await Me(Fe,this,Wl).call(this),n=e.configuration;if(!e.serverMetadata.end_session_endpoint){const r=new URL("https://".concat(X(tt,this).domain,"/v2/logout"));return r.searchParams.set("returnTo",t.returnTo),r.searchParams.set("client_id",X(tt,this).clientId),t.federated&&r.searchParams.set("federated",""),r}const i={post_logout_redirect_uri:t.returnTo};return t.federated&&(i.federated=""),(function(r,o){So(r);const l=vi(r),u=l.as,d=l.c,f=Ku(u,"end_session_endpoint",!1,l.tlsOnly);(o=new URLSearchParams(o)).has("client_id")||o.set("client_id",d.client_id);for(const g of o.entries()){var p=ur(g,2);const v=p[0],y=p[1];f.searchParams.append(v,y)}return f})(n,i)}async verifyLogoutToken(t){const e=(await Me(Fe,this,Wl).call(this)).serverMetadata,n=w3(X(tt,this).discoveryCache),i=e.jwks_uri;X(eg,this)||pt(eg,this,gne(new URL(i),{cacheMaxAge:n.ttlMs,[UH]:X(Ft,this),[FH]:X(z0,this)}));const r=(await one(t.logoutToken,X(eg,this),{issuer:e.issuer,audience:X(tt,this).clientId,algorithms:["RS256"],requiredClaims:["iat"]})).payload;if(!("sid"in r)&&!("sub"in r))throw new Il('either "sid" or "sub" (or both) claims must be present');if("sid"in r&&typeof r.sid!="string")throw new Il('"sid" claim must be a string');if("sub"in r&&typeof r.sub!="string")throw new Il('"sub" claim must be a string');if("nonce"in r)throw new Il('"nonce" claim is prohibited');if(!("events"in r))throw new Il('"events" claim is missing');if(typeof r.events!="object"||r.events===null)throw new Il('"events" claim must be an object');if(!("http://schemas.openid.net/event/backchannel-logout"in r.events))throw new Il('"http://schemas.openid.net/event/backchannel-logout" member is missing in the "events" claim');if(typeof r.events["http://schemas.openid.net/event/backchannel-logout"]!="object")throw new Il('"http://schemas.openid.net/event/backchannel-logout" member in the "events" claim must be an object');return{sid:r.sid,sub:r.sub}}});function Ine(){const t=X(tt,this).domain.toLowerCase();return"".concat(t,"|mtls:").concat(X(tt,this).useMtls?"1":"0")}async function yn(t,e){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];const i=await Me(Fe,this,FO).call(this,n),r=new nf(t,X(tt,this).clientId,{client_secret:X(tt,this).clientSecret,use_mtls_endpoint_aliases:X(tt,this).useMtls},i);return r[It]=e??X(Ft,this),r}function t9(t){return pv(X(Ft,this),t,X(Aa,this))}async function Sr(t){let e=arguments.length>1&&arguments[1]!==void 0&&arguments[1];const n=await Me(Fe,this,Wl).call(this,e),i=n.configuration,r=n.serverMetadata;if(!t)return{configuration:i,serverMetadata:r};const o=Me(Fe,this,t9).call(this,t);return{configuration:await Me(Fe,this,yn).call(this,r,o,e),serverMetadata:r}}async function Wl(){let t=arguments.length>0&&arguments[0]!==void 0&&arguments[0];const e=X(t?Xb:Jb,this);if(e&&X(jm,this))return{configuration:e,serverMetadata:X(jm,this)};const n=Me(Fe,this,Ine).call(this);t||await Me(Fe,this,FO).call(this,!1);const i=X(tm,this).get(n);if(i)return Me(Fe,this,CE).call(this,i.serverMetadata,t);const r=X(Fh,this).get(n);if(r){const l=await r;return Me(Fe,this,CE).call(this,l.serverMetadata,t)}const o=(async()=>{const l=(await Yte(new URL("https://".concat(X(tt,this).domain)),X(tt,this).clientId,{use_mtls_endpoint_aliases:X(tt,this).useMtls},(u,d,f,p)=>{f.set("client_id",d.client_id)},{[It]:X(Ft,this)})).serverMetadata();return X(tm,this).set(n,{serverMetadata:l}),{serverMetadata:l}})();o.catch(()=>{}),X(Fh,this).set(n,o);try{const l=(await o).serverMetadata;return Me(Fe,this,CE).call(this,l,t)}finally{X(Fh,this).delete(n)}}async function CE(t,e){const n=await Me(Fe,this,yn).call(this,t,void 0,e);return pt(jm,this,t),pt(e?Xb:Jb,this,n),{configuration:n,serverMetadata:t}}async function T3(t,e,n){var i,r,o;const l=(await Me(Fe,this,Sr).call(this,e)).configuration;if("audience"in t||"resource"in t)throw new ds("audience and resource parameters are not supported for Token Vault exchanges");YH(t.subjectToken);const u=new URLSearchParams({connection:t.connection,subject_token:t.subjectToken,subject_token_type:(i=t.subjectTokenType)!==null&&i!==void 0?i:e9,requested_token_type:(r=t.requestedTokenType)!==null&&r!==void 0?r:"http://auth0.com/oauth/token-type/federated-connection-access-token"});if(t.loginHint&&u.append("login_hint",t.loginHint),t.scope&&u.append("scope",t.scope),QH(u,t.extra),n){var d;const g=Mn((d=l[It])!==null&&d!==void 0?d:X(Ft,this)),v=await Me(Fe,this,yn).call(this,l.serverMetadata(),g);try{const y=await rr(v,S3,u),b=En.fromTokenEndpointResponse(y),x=g.getCapturedResponse();if(!x)throw new zn;return{data:b,response:x}}catch(y){if(y instanceof zn)throw y;const b=new ds("Failed to exchange token for connection '".concat(t.connection,"'."),hi(y)),x=g.getCapturedResponse();throw b.statusCode=x?.status,b.headers=x?an(x.headers):void 0,b}}const f=Mn((o=l[It])!==null&&o!==void 0?o:X(Ft,this)),p=await Me(Fe,this,yn).call(this,l.serverMetadata(),f);try{const g=await rr(p,S3,u);return En.fromTokenEndpointResponse(g)}catch(g){const v=new ds("Failed to exchange token for connection '".concat(t.connection,"'."),hi(g)),y=f.getCapturedResponse();throw v.statusCode=y?.status,v.headers=y?an(y.headers):void 0,v}}function C3(t,e,n){var i;if(n.organization&&Pm(t.claims,n.organization),n.actorToken)if((i=t.claims)!==null&&i!==void 0&&i.act)t.act=t.claims.act;else try{t.act=(function(r){if(typeof r!="string")throw new uo("JWTs must use Compact JWS serialization, JWT must be a string");const o=r.split("."),l=o[1],u=o.length;if(u===5)throw new uo("Only JWTs using Compact JWS serialization can be decoded");
20if(u!==3)throw new uo("Invalid JWT");if(!l)throw new uo("JWTs must contain a payload");let d,f;try{d=Ww(l)}catch{throw new uo("Failed to base64url decode the payload")}try{f=JSON.parse(jO.decode(d))}catch{throw new uo("Failed to parse the decoded payload as JSON")}if(!dc(f))throw new uo("Invalid JWT Claims Set");return f})(e.access_token).act}catch{}return t}async function O3(t,e,n){var i;const r=(await Me(Fe,this,Sr).call(this,e)).configuration;if(YH(t.subjectToken),t.organization!==void 0&&LO(t.organization),t.actorToken!==void 0&&t.actorTokenType===void 0)throw new ds("actorTokenType is required when actorToken is provided");const o=new URLSearchParams({subject_token_type:t.subjectTokenType,subject_token:t.subjectToken});if(t.audience&&o.append("audience",t.audience),t.scope&&o.append("scope",t.scope),t.requestedTokenType&&o.append("requested_token_type",t.requestedTokenType),t.organization&&o.append("organization",t.organization),t.actorToken&&o.append("actor_token",t.actorToken),t.actorTokenType&&o.append("actor_token_type",t.actorTokenType),QH(o,t.extra),n){var l;const g=Mn((l=r[It])!==null&&l!==void 0?l:X(Ft,this)),v=await Me(Fe,this,yn).call(this,r.serverMetadata(),g);let y,b,x;try{if(b=await rr(v,k3,o),y=En.fromTokenEndpointResponse(b),x=g.getCapturedResponse(),!x)throw new zn}catch(S){if(S instanceof zn)throw S;const k=new ds("Failed to exchange token of type '".concat(t.subjectTokenType,"'").concat(t.audience?" for audience '".concat(t.audience,"'"):"","."),hi(S)),T=g.getCapturedResponse();throw k.statusCode=T?.status,k.headers=T?an(T.headers):void 0,k}return Me(Fe,this,C3).call(this,y,b,t),{data:y,response:x}}const u=Mn((i=r[It])!==null&&i!==void 0?i:X(Ft,this)),d=await Me(Fe,this,yn).call(this,r.serverMetadata(),u);let f,p;try{p=await rr(d,k3,o),f=En.fromTokenEndpointResponse(p)}catch(g){const v=new ds("Failed to exchange token of type '".concat(t.subjectTokenType,"'").concat(t.audience?" for audience '".concat(t.audience,"'"):"","."),hi(g)),y=u.getCapturedResponse();throw v.statusCode=y?.status,v.headers=y?an(y.headers):void 0,v}return Me(Fe,this,C3).call(this,f,p,t),f}async function R3(t,e,n){var i;const r=(await Me(Fe,this,Sr).call(this,e)).configuration;if(n){var o;const d=Mn((o=r[It])!==null&&o!==void 0?o:X(Ft,this)),f=await Me(Fe,this,yn).call(this,r.serverMetadata(),d);try{const p=await rr(f,"http://auth0.com/oauth/grant-type/passwordless/otp",t),g=En.fromTokenEndpointResponse(p),v=d.getCapturedResponse();if(!v)throw new zn;return{data:g,response:v}}catch(p){if(p instanceof zn)throw p;const g=new L2("There was an error while trying to request a token.",hi(p)),v=d.getCapturedResponse();throw g.statusCode=v?.status,g.headers=v?an(v.headers):void 0,g}}const l=Mn((i=r[It])!==null&&i!==void 0?i:X(Ft,this)),u=await Me(Fe,this,yn).call(this,r.serverMetadata(),l);try{const d=await rr(u,"http://auth0.com/oauth/grant-type/passwordless/otp",t);return En.fromTokenEndpointResponse(d)}catch(d){const f=new L2("There was an error while trying to request a token.",hi(d)),p=l.getCapturedResponse();throw f.statusCode=p?.status,f.headers=p?an(p.headers):void 0,f}}async function FO(){let t=arguments.length>0&&arguments[0]!==void 0&&arguments[0];const e=!!X(tt,this).clientSecret||!!X(tt,this).clientAssertionSigningKey||!!X(tt,this).useMtls;return t&&!e?(n,i,r,o)=>{r.set("client_id",i.client_id)}:(X(Ch,this)||pt(Ch,this,(async()=>{if(!X(tt,this).clientSecret&&!X(tt,this).clientAssertionSigningKey&&!X(tt,this).useMtls)throw new HH;if(X(tt,this).useMtls)return(i,r,o,l)=>{o.set("client_id",r.client_id)};let n=X(tt,this).clientAssertionSigningKey;return!n||n instanceof CryptoKey||(n=await DO(n,X(tt,this).clientAssertionSigningAlg||"RS256")),n?(function(i,r){return fte(i)})(n):jH(X(tt,this).clientSecret)})().catch(n=>{throw pt(Ch,this,void 0),n})),X(Ch,this))}async function OE(t){const e=(await Me(Fe,this,Wl).call(this)).configuration,n=Xte(),i=await Jte(n),r=N2(Te(Te({},X(tt,this).authorizationParams),t?.authorizationParams)),o=new URLSearchParams(Te(Te({scope:F2},r),{},{client_id:X(tt,this).clientId,code_challenge:i,code_challenge_method:"S256"}));return{authorizationUrl:t!=null&&t.pushedAuthorizationRequests?await MH(e,o):await $2(e,o),codeVerifier:n}}new XH(1e3,6e4);class hc extends zt{constructor(e,n){super(e,n),Object.setPrototypeOf(this,hc.prototype)}static fromPayload(e){let n=e.error,i=e.error_description;return new hc(n,i)}}class Yb extends hc{constructor(e,n){super(e,n),Object.setPrototypeOf(this,Yb.prototype)}}class HO extends hc{constructor(e,n){super(e,n),Object.setPrototypeOf(this,HO.prototype)}}class KO extends hc{constructor(e,n){super(e,n),Object.setPrototypeOf(this,KO.prototype)}}class Oh extends hc{constructor(e,n){super(e,n),Object.setPrototypeOf(this,Oh.prototype)}}class ZO extends hc{constructor(e,n){super(e,n),Object.setPrototypeOf(this,ZO.prototype)}}class zne{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:6e5;this.contexts=new Map,this.ttlMs=e}set(e,n){this.cleanup(),this.contexts.set(e,Object.assign(Object.assign({}
20,n),{createdAt:Date.now()}))}get(e){const n=this.contexts.get(e);if(n){if(!(Date.now()-n.createdAt>this.ttlMs))return n;this.contexts.delete(e)}}remove(e){this.contexts.delete(e)}cleanup(){const e=Date.now();for(const i of this.contexts){var n=ur(i,2);const r=n[0];e-n[1].createdAt>this.ttlMs&&this.contexts.delete(r)}}get size(){return this.contexts.size}}class Dne{constructor(e,n){this.authJsMfaClient=e,this.auth0Client=n,this.contextManager=new zne}setMFAAuthDetails(e,n,i,r){this.contextManager.set(e,{scope:n,audience:i,mfaRequirements:r})}async getAuthenticators(e){var n,i,r;const o=this.contextManager.get(e);if(!o)throw new Yb("invalid_request","MFA context not found for this MFA token");const l=(i=(n=o.mfaRequirements)===null||n===void 0?void 0:n.challenge)===null||i===void 0?void 0:i.map(u=>u.type);try{const u=await this.authJsMfaClient.listAuthenticators({mfaToken:e});return l&&l.length!==0?u.filter(d=>!!d.type&&l.includes(d.type)):u}catch(u){throw u instanceof M2?new Yb((r=u.cause)===null||r===void 0?void 0:r.error,u.message):u}}async enroll(e){var n;const i=(function(r){const o=rte[r.factorType];return Object.assign(Object.assign(Object.assign({mfaToken:r.mfaToken,authenticatorTypes:o.authenticatorTypes},o.oobChannels&&{oobChannels:o.oobChannels}),"phoneNumber"in r&&{phoneNumber:r.phoneNumber}),"email"in r&&{email:r.email})})(e);try{return await this.authJsMfaClient.enrollAuthenticator(i)}catch(r){throw r instanceof I2?new HO((n=r.cause)===null||n===void 0?void 0:n.error,r.message):r}}async challenge(e){var n;try{const i={challengeType:e.challengeType,mfaToken:e.mfaToken};return e.authenticatorId&&(i.authenticatorId=e.authenticatorId),await this.authJsMfaClient.challengeAuthenticator(i)}catch(i){throw i instanceof z2?new KO((n=i.cause)===null||n===void 0?void 0:n.error,i.message):i}}async getEnrollmentFactors(e){const n=this.contextManager.get(e);if(!n||!n.mfaRequirements)throw new ZO("mfa_context_not_found","MFA context not found for this MFA token. Please retry the original request to get a new MFA token.");return n.mfaRequirements.enroll&&n.mfaRequirements.enroll.length!==0?n.mfaRequirements.enroll:[]}async verify(e){const n=this.contextManager.get(e.mfaToken);if(!n)throw new Oh("mfa_context_not_found","MFA context not found for this MFA token. Please retry the original request to get a new MFA token.");const i=(function(l){return"otp"in l&&l.otp?ste:"oobCode"in l&&l.oobCode?ote:"recoveryCode"in l&&l.recoveryCode?ate:void 0})(e);if(!i)throw new Oh("invalid_request","Unable to determine grant type. Provide one of: otp, oobCode, or recoveryCode.");const r=n.scope,o=n.audience;try{const l=await this.auth0Client._requestTokenForMfa({grant_type:i,mfaToken:e.mfaToken,scope:r,audience:o,otp:e.otp,oob_code:e.oobCode,binding_code:e.bindingCode,recovery_code:e.recoveryCode});return this.contextManager.remove(e.mfaToken),l}catch(l){throw l instanceof Oh?new Oh(l.error,l.error_description):l}}}class Bo extends Error{constructor(e,n,i){super(n),this.name="PasskeyError",this.code=e,this.cause=i,Object.setPrototypeOf(this,Bo.prototype)}}var ou,ph;class Lne{constructor(e,n){ou.set(this,void 0),ph.set(this,void 0),Sz(this,ou,e),Sz(this,ph,n)}async signup(e){if(!window.PublicKeyCredential)throw new Bo("passkey_not_supported","WebAuthn is not supported in this browser.");const n=e.scope,i=e.audience,r=Ir(e,["scope","audience"]),o=await Bc(this,ou,"f").register(r),l=$3(o.authnParamsPublicKey),u=await navigator.credentials.create({publicKey:l});if(!u)throw new Bo("passkey_cancelled","Passkey creation was cancelled or no credential was returned.");const d=j3(u);return Bc(this,ph,"f")._requestTokenForPasskey({authSession:o.authSession,credential:d,realm:r.realm,organization:r.organization,scope:n,audience:i})}async login(e){if(!window.PublicKeyCredential)throw new Bo("passkey_not_supported","WebAuthn is not supported in this browser.");const n=e||{},i=n.scope,r=n.audience,o=Ir(n,["scope","audience"]),l=await Bc(this,ou,"f").challenge(Object.keys(o).length>0?o:void 0),u=A3(l.authnParamsPublicKey),d=await navigator.credentials.get({publicKey:u});if(!d)throw new Bo("passkey_cancelled","Passkey authentication was cancelled or no credential was returned.");const f=P3(d);return Bc(this,ph,"f")._requestTokenForPasskey({authSession:l.authSession,credential:f,realm:o.realm,organization:o.organization,scope:i,audience:r})}async getSignupChallenge(e){if(!window.PublicKeyCredential)throw new Bo("passkey_not_supported","WebAuthn is not supported in this browser.");const n=await Bc(this,ou,"f").register(e);return{authSession:n.authSession,publicKey:$3(n.authnParamsPublicKey)}}async getLoginChallenge(e){if(!window.PublicKeyCredential)throw new Bo("passkey_not_supported","WebAuthn is not supported in this browser.");const n=await Bc(this,ou,"f").challenge(e);return{authSession:n.authSession,publicKey:A3(n.authnParamsPublicKey)}}async getTokenWithPasskey(e){if(!window.PublicKeyCredential)throw new Bo("passkey_not_supported","WebAuthn is not supported in this browser.");const n=e.authSession,i=e.credential,r=e.realm,o=e.organization,l=e.scope,u=e.audience,d=i.response;let f;if(d instanceof AuthenticatorAttestationResponse)f=j3(i);else{if(!(d instanceof AuthenticatorAssertionResponse))throw new Bo("passkey_invalid_credential","The provided credential is not a valid attestation or assertion response.");f=P3(i)}return Bc(this,ph,"f")._requestTokenForPasskey({authSession:n,credential:f,realm:r,organization:o,scope:l,audience:u})}}function Gl(t){const e=new Uint8Array(t),n=Array.from(e,i=>String.fromCharCode(i)).join("");return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function H2(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),n=e+"=".repeat((4-e.length%4)%4),i=atob(n),r=new 
20Uint8Array(i.length);for(let o=0;o<i.length;o++)r[o]=i.charCodeAt(o);return r.buffer}function $3(t){return Object.assign(Object.assign({},t),{challenge:H2(t.challenge),user:Object.assign(Object.assign({},t.user),{id:H2(t.user.id)}),pubKeyCredParams:t.pubKeyCredParams,authenticatorSelection:t.authenticatorSelection})}function A3(t){return Object.assign(Object.assign({},t),{challenge:H2(t.challenge)})}function j3(t){var e;const n=t.response;return{id:t.id,rawId:Gl(t.rawId),type:t.type,authenticatorAttachment:(e=t.authenticatorAttachment)!==null&&e!==void 0?e:void 0,response:{clientDataJSON:Gl(n.clientDataJSON),attestationObject:Gl(n.attestationObject)},clientExtensionResults:t.getClientExtensionResults()}}function P3(t){var e;const n=t.response;return{id:t.id,rawId:Gl(t.rawId),type:t.type,authenticatorAttachment:(e=t.authenticatorAttachment)!==null&&e!==void 0?e:void 0,response:{clientDataJSON:Gl(n.clientDataJSON),authenticatorData:Gl(n.authenticatorData),signature:Gl(n.signature),userHandle:n.userHandle?Gl(n.userHandle):void 0},clientExtensionResults:t.getClientExtensionResults()}}ou=new WeakMap,ph=new WeakMap;function N3(t){return{get(){try{const e=window.localStorage.getItem(t);return e?JSON.parse(e):null}catch{return null}},set(e){try{window.localStorage.setItem(t,JSON.stringify(e))}catch{}},remove(){try{window.localStorage.removeItem(t)}catch{}}}}function M3(){let t=null;return{get:()=>t,set:e=>{t=e},remove:()=>{t=null}}}class Une{constructor(e,n){this.slots=new Map,this.baseKey="".concat("@@auth0spajs@@","::").concat(e,"::anonymous"),this.useLocalStorage=n==="localStorage"&&typeof window<"u"&&!!window.localStorage,this.sessionKey="".concat(this.baseKey,"::").concat("session"),this.sessionStore=this.useLocalStorage?N3(this.sessionKey):M3()}getStore(e,n){const i="".concat(this.baseKey,"::").concat(JSON.stringify([e??"",n??""]));return this.slots.has(i)||this.slots.set(i,this.useLocalStorage?N3(i):M3()),this.slots.get(i)}getSessionToken(){return this.sessionStore.get()}setSessionToken(e){this.sessionStore.set(e)}removeAll(){if(this.sessionStore.remove(),this.slots.forEach(e=>e.remove()),this.slots.clear(),this.useLocalStorage)try{const e=this.baseKey+"::",n=[];for(let i=0;i<window.localStorage.length;i++){const r=window.localStorage.key(i);r?.startsWith(e)&&n.push(r)}n.forEach(i=>window.localStorage.removeItem(i))}catch{}}}class Fne{constructor(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"localStorage",r=arguments.length>3?arguments[3]:void 0;this.authJsClient=e,this.clientId=n,this.cache=new Une(n,i),this.lockManager=r??UF()}async createSession(e){const n=await this.authJsClient.createSession(e);return this.cache.setSessionToken(Object.assign({sessionToken:n.sessionToken},n.sessionTokenExpiresAt!==void 0&&{sessionTokenExpiresAt:n.sessionTokenExpiresAt})),this.cache.getStore(e?.audience,e?.scope).set(Object.assign({accessToken:n.accessToken,expiresAt:n.expiresAt},n.scope!==void 0&&{scope:n.scope})),n}async getTokenSilently(e){const n=this.cache.getStore(e?.audience,e?.scope),i=n.get();return i&&i.expiresAt-60>Date.now()/1e3?i:this.lockManager.runWithLock("anonymous::".concat(this.clientId),5e3,async()=>{var r;const o=n.get();if(o&&o.expiresAt-60>Date.now()/1e3)return o;const l=(r=this.cache.getSessionToken())===null||r===void 0?void 0:r.sessionToken,u=await this.authJsClient.getAccessToken(Object.assign(Object.assign({},e),{sessionToken:l}));return this.cache.getStore(e?.audience,e?.scope).set(Object.assign({accessToken:u.accessToken,expiresAt:u.expiresAt},u.scope!==void 0&&{scope:u.scope})),!u.sessionReplaced&&this.cache.getSessionToken()||this.cache.setSessionToken(Object.assign({sessionToken:u.sessionToken},u.sessionTokenExpiresAt!==void 0&&{sessionTokenExpiresAt:u.sessionTokenExpiresAt})),Object.assign({accessToken:u.accessToken,expiresAt:u.expiresAt},u.scope!==void 0&&{scope:u.scope})})}async logout(){await this.authJsClient.logout(),this.cache.removeAll()}hasSession(){var e;return!!(!((e=this.cache.getSessionToken())===null||e===void 0)&&e.sessionToken)}getClaims(){return null}}class Hne{resolveOnlineAccess(e){if(e.refreshTokenMode!=="online")return!1;if(e.useRefreshTokens!==!0)throw new Ib('`refreshTokenMode: "online"` requires the refresh-token grant.',"Set `useRefreshTokens: true`.");if(e.useDpop!==!0)throw new Ib('`refreshTokenMode: "online"` requires DPoP, which is missing or disabled.',"Set `useDpop: true` (DPoP is mandatory for online access).");return!0}warnEnterpriseConnectConfig(e){var n,i;if(e.enterpriseConnect!==!0)return;const r=(n=e.authorizationParams)===null||n===void 0?void 0:n.scope;(e.useRefreshTokens===!0||typeof r=="string"&&r.includes("offline_access"))&&console.warn("Enterprise Connect issues no refresh token; `useRefreshTokens` and `offline_access` in `scope` have no effect."),!((i=e.authorizationParams)===null||i===void 0)&&i.organization&&console.warn("Enterprise Connect resolves the organization from the email domain (Home Realm Discovery); a static `organization` breaks multi-customer setups.")}constructor(e){let n,i;if(this.userCache=new VF().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0,refreshTokenMode:"offline",anonymousSessionsCacheMode:"localStorage"},this.onlineAccess=this.resolveOnlineAccess(e),this.warnEnterpriseConnectConfig(e),this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),e),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),e.authorizationParams)}),typeof window<"u"&&(()=>{if(!Db())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(Db().subtle===void 0)throw new Error(`
21      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.
22    `)})(),this.lockManager=UF(),e.cache&&e.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),e.cache)i=e.cache;else{if(n=e.cacheLocation||Cz,!Dz(n))throw new Error('Invalid cac
22he location "'.concat(n,'"'));i=Dz(n)()}var r;this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:g2,this.cookieStorage=e.legacySameSiteCookie===!1?hh:Vee,this.orgHintCookieName=(r=this.options.clientId,"auth0.".concat(r,".organization_hint")),this.isAuthenticatedCookieName=(p=>"auth0.".concat(p,".is.authenticated"))(this.options.clientId),this.sessionCheckExpiryDays=e.sessionCheckExpiryDays||1;const o=e.useCookiesForTransactions?this.cookieStorage:Bee;let l="";var u;this.onlineAccess?l=IF:this.options.useRefreshTokens&&(l="offline_access"),this.scope=(function(p,g){for(var v=arguments.length,y=new Array(v>2?v-2:0),b=2;b<v;b++)y[b-2]=arguments[b];if(typeof p!="object")return{[ji]:$_(g,p,...y)};let x={[ji]:$_(g,...y)};return Object.keys(p).forEach(S=>{const k=p[S];x[S]=$_(g,k,...y)}),x})(this.options.authorizationParams.scope,"openid",l),this.transactionManager=new Fee(o,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||zF,this.cacheManager=new Uee(i,i.allKeys?void 0:new Xee(i,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new tte(this.options.clientId):void 0,this.domainUrl=(u=this.options.domain,/^https?:\/\//.test(u)?u:"https://".concat(u)),this.tokenIssuer=((p,g)=>p?p.startsWith("https://")?p:"https://".concat(p,"/"):"".concat(g,"/"))(this.options.issuer,this.domainUrl);const d="".concat(this.domainUrl,"/me/"),f=this.createFetcher(Object.assign(Object.assign({},this.options.useDpop&&{dpopNonceId:"__auth0_my_account_api__"}),{getAccessToken:p=>{var g;return this.getTokenSilently({authorizationParams:{scope:(g=p?.scope)===null||g===void 0?void 0:g.join(" "),audience:d},detailedResponse:!0})}}));this.myAccount=new ite(f,d),this.authJsClient=new Mne({domain:this.options.domain,clientId:this.options.clientId}),this.mfa=new Dne(this.authJsClient.mfa,this),this.anonymous=new Fne(this.authJsClient.anonymous,this.options.clientId,this.options.anonymousSessionsCacheMode,this.lockManager),this.passkey=new Lne(this.authJsClient.passkey,this),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&n===Cz&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new Jee,this.worker.postMessage({type:"init",allowedBaseUrl:this.domainUrl}))}getConfiguration(){return Object.freeze({domain:this.options.domain,clientId:this.options.clientId})}_url(e){const n=this.options.auth0Client||m2,i=v2(n,!0),r=encodeURIComponent(btoa(JSON.stringify(i)));return"".concat(this.domainUrl).concat(e,"&auth0Client=").concat(r)}_authorizeUrl(e){return this._url("/authorize?".concat(yg(e)))}async _verifyIdToken(e,n,i){const r=await this.nowProvider();return Kee({iss:this.tokenIssuer,aud:this.options.clientId,id_token:e,nonce:n,organization:i,leeway:this.options.leeway,max_age:(o=this.options.authorizationParams.max_age,typeof o!="string"?o:parseInt(o,10)||void 0),now:r});var o}_processOrgHint(e){e?this.cookieStorage.save(this.orgHintCookieName,e,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}_extractSessionTransferToken(e){return new URLSearchParams(window.location.search).get(e)||void 0}_clearSessionTransferTokenFromUrl(e){try{const n=new URL(window.location.href);n.searchParams.has(e)&&(n.searchParams.delete(e),window.history.replaceState({},"",n.toString()))}catch{}}_applySessionTransferToken(e){const n=this.options.sessionTransferTokenQueryParamName;if(!n||e.session_transfer_token)return e;const i=this._extractSessionTransferToken(n);return i?(this._clearSessionTransferTokenFromUrl(n),Object.assign(Object.assign({},e),{session_transfer_token:i})):e}async _prepareAuthorizeUrl(e,n,i){var r;const o=eE(Up()),l=eE(Up()),u=Up(),d=await Rz(u),f=Az(d),p=await((r=this.dpop)===null||r===void 0?void 0:r.calculateThumbprint()),g=((y,b,x,S,k,T,C,A,$)=>Object.assign(Object.assign(Object.assign({client_id:y.clientId},y.authorizationParams),x),{scope:Hp(b,x.scope,x.audience),response_type:"code",response_mode:A||"query",state:S,nonce:k,redirect_uri:C||y.authorizationParams.redirect_uri,code_challenge:T,code_challenge_method:"S256",dpop_jkt:$}))(this.options,this.scope,e,o,l,f,e.redirect_uri||this.options.authorizationParams.redirect_uri||i,n?.response_mode,p),v=this._authorizeUrl(g);
22return{nonce:l,code_verifier:u,scope:g.scope,audience:g.audience||ji,redirect_uri:g.redirect_uri,state:o,url:v}}async loginWithPopup(e,n){var i;if(e=e||{},!(n=n||{}).popup&&(n.popup=(d=>{const f=window.screenX+(window.innerWidth-400)/2,p=window.screenY+(window.innerHeight-600)/2;return window.open(d,"auth0:authorize:popup","left=".concat(f,",top=").concat(p,",width=").concat(400,",height=").concat(600,",resizable,scrollbars=yes,status=1"))})(""),!n.popup))throw new kO;const r=this._applySessionTransferToken(e.authorizationParams||{}),o=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);n.popup.location.href=o.url;const l=await((d,f)=>new Promise((p,g)=>{let v;const y=setInterval(()=>{d.popup&&d.popup.closed&&(clearInterval(y),clearTimeout(b),window.removeEventListener("message",v,!1),g(new bee(d.popup)))},1e3),b=setTimeout(()=>{clearInterval(y),g(new SO(d.popup)),window.removeEventListener("message",v,!1)},1e3*(d.timeoutInSeconds||60));v=function(x){if(x.origin===f&&x.data&&x.data.type==="authorization_response"){if(clearTimeout(b),clearInterval(y),window.removeEventListener("message",v,!1),d.closePopup!==!1&&d.popup.close(),x.data.response.error)return g(zt.fromPayload(x.data.response));p(x.data.response)}},window.addEventListener("message",v)}))(Object.assign(Object.assign({},n),{timeoutInSeconds:n.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}),new URL(o.url).origin);if(o.state!==l.state)throw new zt("state_mismatch","Invalid state");const u=((i=e.authorizationParams)===null||i===void 0?void 0:i.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:o.audience,scope:o.scope,code_verifier:o.code_verifier,grant_type:"authorization_code",code:l.code,redirect_uri:o.redirect_uri},{nonceIn:o.nonce,organization:u})}async getUser(){var e;if(await this._isSessionCeilingReached())return;const n=await this._getIdTokenFromCache();return(e=n?.decodedToken)===null||e===void 0?void 0:e.user}async getIdTokenClaims(){var e;if(await this._isSessionCeilingReached())return;const n=await this._getIdTokenFromCache();return(e=n?.decodedToken)===null||e===void 0?void 0:e.claims}async loginWithRedirect(){var e;const n=Lz(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),i=n.openUrl,r=n.fragment,o=n.appState,l=Ir(n,["openUrl","fragment","appState"]),u=((e=l.authorizationParams)===null||e===void 0?void 0:e.organization)||this.options.authorizationParams.organization,d=this._applySessionTransferToken(l.authorizationParams||{}),f=await this._prepareAuthorizeUrl(d),p=f.url,g=Ir(f,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},g),{appState:o,response_type:lu.Code}),u&&{organization:u}));const v=r?"".concat(p,"#").concat(r):p;i?await i(v):window.location.assign(v)}async handleRedirectCallback(){const e=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.location.href).split("?").slice(1);if(e.length===0)throw new Error("There are no query params available for parsing.");const n=this.transactionManager.get();if(!n)throw new zt("missing_transaction","Invalid state");this.transactionManager.remove();const i=(r=>{r.indexOf("#")>-1&&(r=r.substring(0,r.indexOf("#")));const o=new URLSearchParams(r);return{state:o.get("state"),code:o.get("code")||void 0,connect_code:o.get("connect_code")||void 0,error:o.get("error")||void 0,error_description:o.get("error_description")||void 0}})(e.join(""));return n.response_type===lu.ConnectCode?this._handleConnectAccountRedirectCallback(i,n):this._handleLoginRedirectCallback(i,n)}async _handleLoginRedirectCallback(e,n){const i=e.code,r=e.state,o=e.error,l=e.error_description;if(o)throw new wO(o,l||o,r,n.appState);if(!n.code_verifier||n.state&&n.state!==r)throw new zt("state_mismatch","Invalid state");const u=n.organization,d=n.nonce,f=n.redirect_uri;return await this._requestToken(Object.assign({audience:n.audience,scope:n.scope,code_verifier:n.code_verifier,grant_type:"authorization_code",code:i},f?{redirect_uri:f}:{}),{nonceIn:d,organization:u}),{appState:n.appState,response_type:lu.Code}}async _handleConnectAccountRedirectCallback(e,n){const i=e.connect_code,r=e.state,o=e.error,l=e.error_description;if(o)throw new xO(o,l||o,n.connection,r,n.appState);if(!i)throw new zt("missing_connect_code","Missing connect code");if(!(n.code_verifier&&n.state&&n.auth_session&&n.redirect_uri&&n.state===r))throw new zt("state_mismatch","Invalid state");const u=await this.myAccount.completeAccount({auth_session:n.auth_session,connect_code:i,redirect_uri:n.redirect_uri,code_verifier:n.code_verifier});return Object.assign(Object.assign({},u),{appState:n.appState,response_type:lu.ConnectCode})}async _maybeCreateAnonymousSession(){if(this.options.createAnonymousSessionOnFailedSilentAuth){if(this.anonymous.hasSe
22ssion())return;try{await this.anonymous.getTokenSilently()}catch(e){console.debug("[auth0-spa-js] Anonymous session creation failed",e)}}}async checkSession(e){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get(zz))return void await this._maybeCreateAnonymousSession();this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(zz)}try{await this.getTokenSilently(e)}catch(n){n instanceof zt&&n.error==="login_required"&&n.error_description!==Oz&&await this._maybeCreateAnonymousSession()}}async getTokenSilently(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var n,i;const r=Object.assign(Object.assign({cacheMode:"on"},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:Hp(this.scope,(n=e.authorizationParams)===null||n===void 0?void 0:n.scope,((i=e.authorizationParams)===null||i===void 0?void 0:i.audience)||this.options.authorizationParams.audience)})}),o=await this._getTokenSilently(r);return e.detailedResponse?o:o?.access_token}async _getTokenSilently(e){const n=e.cacheMode,i=Ir(e,["cacheMode"]);if(await this._isSessionCeilingReached())return;if(n!=="off"){const u=await this._getEntryFromCache({scope:i.authorizationParams.scope,audience:i.authorizationParams.audience||ji,clientId:this.options.clientId,cacheMode:n});if(u)return u}if(n==="cache-only")return;const r=(o=this.options.clientId,l=i.authorizationParams.audience||"default","".concat("auth0.lock.getTokenSilently",".").concat(o,".").concat(l));var o,l;try{return await this.lockManager.runWithLock(r,5e3,async()=>{if(n!=="off"){const y=await this._getEntryFromCache({scope:i.authorizationParams.scope,audience:i.authorizationParams.audience||ji,clientId:this.options.clientId});if(y)return y}const u=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(i):await this._getTokenFromIFrame(i),d=u.id_token,f=u.token_type,p=u.access_token,g=u.oauthTokenScope,v=u.expires_in;return Object.assign(Object.assign({id_token:d,token_type:f,access_token:p},g?{scope:g}:null),{expires_in:v})})}catch(u){if(this._isInteractiveError(u)&&this.options.interactiveErrorHandler==="popup")return await this._handleInteractiveErrorWithPopup(i);throw u}}_isInteractiveError(e){return e instanceof Om||e instanceof zt&&this._isIframeMfaError(e)}_isIframeMfaError(e){return e.error==="login_required"&&e.error_description===Oz}async _handleInteractiveErrorWithPopup(e){try{await this.loginWithPopup({authorizationParams:e.authorizationParams});const n=await this._getEntryFromCache({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||ji,clientId:this.options.clientId});if(!n)throw new zt("interactive_handler_cache_miss","Token not found in cache after interactive authentication");return n}catch(n){throw n}}async getTokenWithPopup(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var i,r;const o=Object.assign(Object.assign({},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:Hp(this.scope,(i=e.authorizationParams)===null||i===void 0?void 0:i.scope,((r=e.authorizationParams)===null||r===void 0?void 0:r.audience)||this.options.authorizationParams.audience)})});return n=Object.assign(Object.assign({},_ee),n),await this.loginWithPopup(o,n),(await this.cacheManager.get(new Ni({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||ji,clientId:this.options.clientId}),void 0,this.options.useMrrt)).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(e){e.clientId!==null?e.clientId=e.clientId||this.options.clientId:delete e.clientId;const n=e.logoutParams||{},i=n.federated,r=Ir(n,["federated"]),o=i?"&federated":"";return this._url("/v2/logout?".concat(yg(Object.assign({clientId:e.clientId},r))))+o}async revokeRefreshToken(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.options.useRefreshTokens)return;const n=e.audience||this.options.authorizationParams.audience||ji,i=await this.cacheManager.getRefreshTokensByAudience(n,this.options.clientId);await(async function(r,o){let l=r.baseUrl,u=r.timeout,d=r.auth0Client,f=r.useFormData,p=r.refreshTokens,g=r.audience,v=r.client_id,y=r.onRefreshTokenRevoked;const b=u||g2,x="refresh_token",S="".concat(l,"/oauth/revoke"),k={"Content-Type":f?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(v2(d||m2)))};if(o){const C={client_id:v,token_type_hint:x},A=f?yg(C):JSON.stringify(C);try{return await _2({type:"revoke",timeout:b,fetchUrl:S,fetchOptions:{method:"POST",body:A,headers:k},useFormData:f,auth:{audience:g??ji}},o)}catch($){throw new zt("revoke_error",$.message)}}for(const C of p){const A={client_id:v,token_type_hint:x,token:C},$=f?yg(A):JSON.stringify(A),N=await WF(S,{method:"POST",body:$,headers:k},b);if(!N.ok){let j,O;try{var T=JSON.parse(await N.text());j=T.error,O=T.error_description}catch{}throw new zt(j||"revoke_error",O||"HTTP error ".concat(N.status))}await y?.(C)}})({baseUrl:this.domainUrl,timeout:this.httpTimeoutMs,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,client_id:this.options.clientId,refreshTokens:i,audience:n,onRefreshTokenRevoked:r=>this.cacheManager.stripRefreshToken(r)},this.worker),this.onlineAccess&&await this._clearLocalSession()}async logout(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var n;this.options.enterpriseConnect&&((n=e.logoutParams)===null||n===void 0?void 0:n.federated)!==!0&&console.warn("Enterprise Connect logout without `federated: true` leaves the enterprise IdP session alive; the next login may silently reuse the previous user.");const i=Lz(e),r=i.openUrl,o=Ir(i,["openUrl"]);await this._clearLocalSession(e.clientId);const l=this._buildLogoutUrl(o);r?await r(l):r!==!1&&window.location.assign(l)}async _getTokenFromIFrame(e){const n=(i=this.options.clientId,"".concat("auth0.lock.getTokenFromIFrame",".").concat(i));var i;try{return await this.lockManager.runWithLock(n,5e3,async()=>{const r=Object.assign(Object.assign({},e.authorizationParams),{prompt:"none"}),o=this.cookieStorage.get(this.orgHintCookieName);o&&!r.organization&&(r.organization=o);const l=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin),u=l.url,d=l.state,f=l.nonce,p=l.code_verifier,g=l.redirect_uri,v=l.scope,y=l.audience;if(window.crossOriginIsolated)throw new zt("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const b=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let x;try{x=new URL(this.domainUrl).origin}catch{x=this.domainUrl}const S=await(function(T,C){let A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:60;return new Promise(($,N)=>{const j=window.document.createElement("iframe");j.setAttribute("width","0"),j.setAttribute("height","0"),j.style.display="none";const O=()=>{window.document.body.contains(j)&&(window.document.body.removeChild(j),window.removeEventListener("message",L,!1))};let L;const B=setTimeout(()=>{N(new mf),O()},1e3*A);
22L=function(V){if(V.origin!=C||!V.data||V.data.type!=="authorization_response")return;const ee=V.source;ee&&ee.close(),V.data.response.error?N(zt.fromPayload(V.data.response)):$(V.data.response),clearTimeout(B),window.removeEventListener("message",L,!1),setTimeout(O,2e3)},window.addEventListener("message",L,!1),window.document.body.appendChild(j),j.setAttribute("src",T)})})(u,x,b);if(d!==S.state)throw new zt("state_mismatch","Invalid state");const k=await this._requestToken(Object.assign(Object.assign({},e.authorizationParams),{code_verifier:p,code:S.code,grant_type:"authorization_code",redirect_uri:g,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:f,organization:r.organization});return Object.assign(Object.assign({},k),{scope:v,oauthTokenScope:k.scope,audience:y})})}catch(r){throw r.error==="login_required"&&(r instanceof zt&&this._isIframeMfaError(r)&&this.options.interactiveErrorHandler==="popup"||this.logout({openUrl:!1})),r}}async _getTokenUsingRefreshToken(e){const n=await this.cacheManager.get(new Ni({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||ji,clientId:this.options.clientId}),void 0,this.options.useMrrt);if(!(n&&n.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw new zw(e.authorizationParams.audience||ji,e.authorizationParams.scope)}const i=e.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,r=typeof e.timeoutInSeconds=="number"?1e3*e.timeoutInSeconds:null,o=((p,g,v,y)=>{var b;if(p&&v&&y){if(g.audience!==v)return g.scope;const x=y.split(" "),S=((b=g.scope)===null||b===void 0?void 0:b.split(" "))||[],k=S.every(T=>x.includes(T));return x.length>=S.length&&k?y:g.scope}return g.scope})(this.options.useMrrt,e.authorizationParams,n?.audience,n?.scope);try{const p=await this._requestToken(Object.assign(Object.assign(Object.assign({},e.authorizationParams),{grant_type:"refresh_token",refresh_token:n&&n.refresh_token,redirect_uri:i}),r&&{timeout:r}),{scopesToRequest:o});if(await this._propagateRotatedRefreshToken(n?.refresh_token,p.refresh_token),this.options.useMrrt&&(l=n?.audience,u=n?.scope,d=e.authorizationParams.audience,f=e.authorizationParams.scope,l!==d||!((g,v)=>{const y=v?.split(" ")||[];return(g?.split(" ")||[]).every(b=>y.includes(b))})(f,u))){const g=Qee(o,p.scope,this.onlineAccess);if(g){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw await this.cacheManager.remove(this.options.clientId,e.authorizationParams.audience,e.authorizationParams.scope),new EO(e.authorizationParams.audience||"default",g)}}return Object.assign(Object.assign({},p),{scope:e.authorizationParams.scope,oauthTokenScope:p.scope,audience:e.authorizationParams.audience||ji})}catch(p){if(p.message){if(p.message.includes("user is blocked"))throw await this.logout({openUrl:!1}),p;if((p.message.includes("Missing Refresh Token")||p.message.includes("invalid refresh token"))&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e)}throw p}var l,u,d,f}async _propagateRotatedRefreshToken(e,n){!this.onlineAccess&&n&&e&&await this.cacheManager.updateEntry(e,n,this.options.clientId,this.options.useMrrt)}async _saveEntryInCache(e){const n=e.decodedToken.claims,i=n.session_expiry,r=n.iat;if(i!==void 0){if(typeof i!="number")throw new zt("invalid_token","Invalid session_expiry: value must be a number.");if(i>=1e10)throw new zt("invalid_token","Invalid session_expiry: value appears to be in milliseconds; expected a Unix timestamp in seconds.");if(r===void 0||i<=r)throw new zt("invalid_token","Invalid session_expiry: session ceiling is before or at the token issue time.")}const o=e.id_token,l=e.decodedToken,u=Ir(e,["id_token","decodedToken"]);this.userCache.set(ru,{id_token:o,decodedToken:l}),await this.cacheManager.setIdToken(this.options.clientId,e.id_token,e.decodedToken),await this.cacheManager.set(u)}async _clearLocalSession(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.clientId;var n;e===null?await this.cacheManager.clear():await this.cacheManager.clear(e),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove(ru);try{await((n=this.dpop)===null||n===void 0?void 0:n.clear())}catch{}if(this.worker)try{await _2({type:"clear"},this.worker)}catch{}}async _isSessionCeilingReached(){var e,n;const i=this.userCache.get(ru),r=i??await this.cacheManager.getIdToken(new Ni({clientId:this.options.clientId})),o=(n=(e=r?.decodedToken)===null||e===void 0?void 0:e.claims)===null||n===void 0?void 0:n.session_expiry;if(o===void 0)return!1;const l=await this.nowProvider();return Math.floor(l/1e3)>=o-30&&(await this._clearLocalSession(),!0)}async _getIdTokenFromCache(){const e=this.options.authorizationParams.audience||ji,n=this.scope[e],i=await this.cacheManager.getIdToken(new Ni({clientId:this.options.clientId,audience:e,scope:n})),r=this.userCache.get(ru);return i&&i.id_token===r?.id_token?r:(this.userCache.set(ru,i),i)}async _getEntryFromCache(e){let n=e.scope,i=e.audience,r=e.clientId,o=e.cacheMode;const l=await this.cacheManager.get(new Ni({scope:n,audience:i,clientId:r}),60,this.options.useMrrt,o);if(l&&l.access_token){const u=l.token_type,d=l.access_token,f=l.oauthTokenScope,p=l.expires_in,g=await this._getIdTokenFromCache();return g&&Object.assign(Object.assign({id_token:g.id_token,token_type:u||"Bearer",access_token:d},f?{scope:f}:null),{expires_in:p})}}_storeMfaContext(e,n,i){e instanceof Om&&this.mfa.setMFAAuthDetail
22s(e.mfa_token,n,i,e.mfa_requirements)}async _requestToken(e,n){var i,r,o,l,u,d;const f=n||{},p=f.nonceIn,g=f.organization,v=f.scopesToRequest;try{const y=await Pz(Object.assign(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,useMrrt:this.options.useMrrt,dpop:this.dpop,preserveRefreshToken:this.onlineAccess},e),{scope:v||e.scope}),this.worker);let b=await this._verifyIdToken(y.id_token,p,g);if(e.grant_type==="authorization_code"){const x=await this._getIdTokenFromCache();!((r=(i=x?.decodedToken)===null||i===void 0?void 0:i.claims)===null||r===void 0)&&r.sub&&x.decodedToken.claims.sub!==b.claims.sub&&(await this.cacheManager.clear(this.options.clientId),this.userCache.remove(ru))}if(e.grant_type!=="authorization_code"){const x=await this._getIdTokenFromCache(),S=(l=(o=x?.decodedToken)===null||o===void 0?void 0:o.claims)===null||l===void 0?void 0:l.session_expiry;S!==void 0&&(b=Object.assign(Object.assign({},b),{claims:Object.assign(Object.assign({},b.claims),{session_expiry:S})}))}return!y.refresh_token&&this.onlineAccess&&(y.refresh_token=(u=e.refresh_token)!==null&&u!==void 0?u:(d=await this.cacheManager.get(new Ni({scope:v||e.scope,audience:e.audience||ji,clientId:this.options.clientId}),void 0,this.options.useMrrt))===null||d===void 0?void 0:d.refresh_token),await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},y),{decodedToken:b,scope:e.scope,audience:e.audience||ji}),y.scope?{oauthTokenScope:y.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(g||b.claims.org_id),Object.assign(Object.assign({},y),{decodedToken:b})}catch(y){throw e.grant_type!=="authorization_code"&&this._storeMfaContext(y,v||e.scope,e.audie
22nce),y}}_buildTokenExchangeParams(e){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e),{grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",subject_token:e.subject_token,subject_token_type:e.subject_token_type}),e.actor_token&&{actor_token:e.actor_token}),e.actor_token_type&&{actor_token_type:e.actor_token_type}),{scope:Hp(this.scope,e.scope,e.audience||this.options.authorizationParams.audience),audience:e.audience||this.options.authorizationParams.audience,organization:e.organization||this.options.authorizationParams.organization})}async loginWithCustomTokenExchange(e){return this._requestToken(this._buildTokenExchangeParams(e))}async customTokenExchange(e){const n=this._buildTokenExchangeParams(e);try{const i=await Pz(Object.assign(Object.assign({},n),{baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,dpop:this.dpop}),this.worker,!0);return i.id_token&&await this._verifyIdToken(i.id_token,void 0,e.organization),i}catch(i){throw this._storeMfaContext(i,n.scope,n.audience),i}}async exchangeToken(e){return this.loginWithCustomTokenExchange(e)}_assertDpop(e){if(!e)throw new Error("`useDpop` option must be enabled before using DPoP.")}getDpopNonce(e){return this._assertDpop(this.dpop),this.dpop.getNonce(e)}setDpopNonce(e,n){return this._assertDpop(this.dpop),this.dpop.setNonce(e,n)}generateDpopProof(e){return this._assertDpop(this.dpop),this.dpop.generateProof(e)}createFetcher(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new nte(e,{isDpopEnabled:()=>!!this.options.useDpop,getAccessToken:n=>{var i;return this.getTokenSilently({authorizationParams:{scope:(i=n?.scope)===null||i===void 0?void 0:i.join(" "),audience:n?.audience},detailedResponse:!0})},getDpopNonce:()=>this.getDpopNonce(e.dpopNonceId),setDpopNonce:n=>this.setDpopNonce(n,e.dpopNonceId),generateDpopProof:n=>this.generateDpopProof(n)})}async connectAccountWithRedirect(e){const n=e.openUrl,i=e.appState,r=e.connection,o=e.scopes,l=e.authorization_params,u=e.redirectUri,d=u===void 0?this.options.authorizationParams.redirect_uri||window.location.origin:u;if(!r)throw new Error("connection is required");const f=eE(Up()),p=Up(),g=await Rz(p),v=Az(g),y=await this.myAccount.connectAccount({connection:r,scopes:o,redirect_uri:d,state:f,code_challenge:v,code_challenge_method:"S256",authorization_params:l}),b=y.connect_uri,x=y.connect_params,S=y.auth_session;this.transactionManager.create({state:f,code_verifier:p,auth_session:S,redirect_uri:d,appState:i,connection:r,response_type:lu.ConnectCode});const k=new URL(b);k.searchParams.set("ticket",x.ticket),n?await n(k.toString()):window.location.assign(k)}async _requestTokenForPasskey(e){const n=e.audience||this.options.authorizationParams.audience,i=e.organization||this.options.authorizationParams.organization;return this._requestToken(Object.assign(Object.assign(Object.assign({grant_type:"urn:okta:params:oauth:grant-type:webauthn",auth_session:e.authSession,authn_response:e.credential},e.realm&&{realm:e.realm}),i&&{organization:i}),{scope:Hp(this.scope,e.scope,n),audience:n}))}async _requestTokenForMfa(e,n){const i=e.mfaToken,r=Ir(e,["mfaToken"]),o=await this.cacheManager.get(new Ni({scope:r.scope,audience:r.audience||ji,clientId:this.options.clientId}),void 0,this.options.useMrrt),l=await this._requestToken(Object.assign(Object.assign({},r),{mfa_token:i}),n);return await this._propagateRotatedRefreshToken(o?.refresh_token,l.refresh_token),l}}const Kne="https://api.lyster.io",WO={domain:"auth.lyster.io",clientId:"98enCI4qYjZBIqZ0CfHWqop81fWiJX8n",cacheLocation:"localstorage",useRefreshTokens:!0,authorizationParams:{get redirect_uri(){return window.location.origin},audience:"https://api.lyster.io/",scope:"openid profile email offline_access"}},K2={organizations:"https://lyster.io/organizations",licenses:"https://lyster.io/licenses"},Go={admin:"admin",editor:"editor",viewer:"viewer",desktopUser:"desktop_user",desktopTrial:"desktop_trial"},RE={admin:[Go.admin],editor:[Go.editor,Go.admin],viewer:[Go.viewer,Go.editor,Go.admin]},$E="lyster:orgId";
22class n9 extends Error{constructor(e,n){super(e.message??e.error??"Unknown error"),this.body=e,this.name="ApiError",this.status=n}get isNotFound(){return this.status===404}}class Ua{static requireToken(e){if(e===void 0)throw new zt("login_required","Session expired");return e}static decodeToken(e){const n=e.split(".")[1],i=JSON.parse(atob(n));return{...i,permissions:i.permissions??[],organizations:i[K2.organizations]??[],licenses:i[K2.licenses]??[]}}static hasAdmin(e){return RE.admin.some(n=>e.includes(n))}static hasEditor(e){return RE.editor.some(n=>e.includes(n))}static hasViewer(e){return RE.viewer.some(n=>e.includes(n))}static clearCache(){Object.keys(localStorage).filter(e=>e.startsWith("@@auth0spajs@@")).forEach(e=>localStorage.removeItem(e))}static installWorkaround(){const e=["login_required","consent_required","invalid_grant"],n=window.fetch;window.fetch=async(...i)=>{const r=await n(...i);if(!(i[0]instanceof Request?i[0].url:String(i[0])).includes("/oauth/token"))return r;let l=r.status===403;if(!l&&!r.ok){const u=await r.clone().json().catch(()=>null);l=e.includes(u?.error)}return l&&(Ua.clearCache(),window.location.reload()),r}}}const Zne=["login_required","consent_required","invalid_grant"];class i9{constructor(){this.auth0Client=new Hne(WO)}async getAccessToken(){try{return Ua.requireToken(await this.auth0Client.getTokenSilently({timeoutInSeconds:10}))}catch(e){const n=e?.error;throw n!==void 0&&Zne.includes(n)&&(Ua.clearCache(),window.location.reload()),e}}async request(e,n,i){const r=await this.getAccessToken(),o=`${Kne}${n}`,l=await fetch(o,{method:e,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},...i!==void 0&&{body:JSON.stringify(i)}});if(!l.ok){const d=await l.json().catch(()=>({message:`Request failed: ${e} ${n}`}));return{success:!1,error:new n9(d,l.status)}}return{success:!0,data:await l.json().catch(()=>{})}}}const uu=class uu extends i9{constructor(){super()}static get instance(){return uu._instance||(uu._instance=new uu),uu._instance}async getDesktopReleases(){return this.request("GET","/v1/desktop/releases")}async getOffers(){return this.request("GET","/v1/offers")}async postOffer(e){return this.request("POST","/v1/offers",e)}};uu._instance=null;let Nm=uu;const ss=class ss extends i9{constructor(){super()}static encodeQuery(e){const n=new URLSearchParams;for(const[r,o]of Object.entries(e))o!==void 0&&n.set(r,String(o));const i=n.toString();return i?`?${i}`:""}static get instance(){return ss._instance||(ss._instance=new ss),ss._instance}async getOrgId(){const n=(await this.getAccessToken()).split(".")[1],r=JSON.parse(atob(n))[K2.organizations]??[];if(r.length===0)throw new Error("No organization found in access token");if(r.length===1)return r[0];const o=localStorage.getItem($E);return o&&r.includes(o)?o:(localStorage.setItem($E,r[0]),r[0])}setOrgId(e){localStorage.setItem($E,e)}async postAuth(){return this.request("POST","/v2/auth")}async getOrgs(){return this.request("GET","/v2/orgs")}async getOrg(e){return this.request("GET",`/v2/orgs/${e}`)}async getDrafts(e){const n=await this.getOrgId(),i=new URLSearchParams(Object.entries(e).map(([r,o])=>[r,String(o)]));return this.request("GET",`/v2/orgs/${n}/drafts?${i}`)}async getDraft(e){const n=await this.getOrgId();return this.request("GET",`/v2/orgs/${n}/drafts/${e}`)}async postDraft(e){const n=await this.getOrgId();return this.request("POST",`/v2/orgs/${n}/drafts`,e)}async patchDraft(e){const n=await this.getOrgId();return this.request("PATCH",`/v2/orgs/${n}/drafts`,e)}async deleteDraft(e){const n=await this.getOrgId();return this.request("DELETE",`/v2/orgs/${n}/drafts/${e}`)}async getDraftDiff(e){const n=await this.getOrgId();return this.request("GET",`/v2/orgs/${n}/drafts/${e}/diff`)}async getStandards(e){const n=await this.getOrgId();return this.request("GET",`/v2/orgs/${n}/standards${ss.encodeQuery({...e})}`)}async getStandard(e){const n=await this.getOrgId();return this.request("GET",`/v2/orgs/${n}/standards/${e}`)}async postStandards(e){const n=await this.getOrgId();return this.request("POST",`/v2/orgs/${n}/standards`,e)}async deleteStandard(e){const n=await this.getOrgId();return this.request("DELETE",`/v2/orgs/${n}/standards/${e}`)}async getCategories(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/standards/${e}/categories${ss.encodeQuery({...n})}`)}
22async getCategory(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/standards/${e}/categories/${n}`)}async postCategories(e,n){const i=await this.getOrgId();return this.request("POST",`/v2/orgs/${i}/standards/${e}/categories`,n)}async deleteCategory(e,n){const i=await this.getOrgId();return this.request("DELETE",`/v2/orgs/${i}/standards/${e}/categories/${n}`)}async getElementType(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/standards/${e}/element-types/${n}`)}async postElementTypes(e,n){const i=await this.getOrgId();return this.request("POST",`/v2/orgs/${i}/standards/${e}/element-types`,n)}async deleteElementType(e,n){const i=await this.getOrgId();return this.request("DELETE",`/v2/orgs/${i}/standards/${e}/element-types/${n}`)}async getElementTypes(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/standards/${e}/element-types${ss.encodeQuery({...n})}`)}async getConstraint(e,n,i){const r=await this.getOrgId();return this.request("GET",`/v2/orgs/${r}/standards/${e}/constraints/${n}/${i}`)}async getConstraints(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/standards/${e}/constraints/${n}`)}async postConstraints(e,n){const i=await this.getOrgId();return this.request("POST",`/v2/orgs/${i}/standards/${e}/constraints`,n)}async deleteConstraint(e,n,i,r){const o=await this.getOrgId();return this.request("DELETE",`/v2/orgs/${o}/standards/${e}/constraints/${n}/${i}/${r}`)}async getRelationType(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/standards/${e}/relation-types/${n}`)}async getRelationTypes(e){const n=await this.getOrgId();return this.request("GET",`/v2/orgs/${n}/standards/${e}/relation-types`)}async getUser(e){const n=await this.getOrgId();return this.request("GET",`/v2/orgs/${n}/users/${e}`)}async getUsers(e){const n=await this.getOrgId(),i=new URLSearchParams(Object.entries(e).map(([r,o])=>[r,String(o)]));return this.request("GET",`/v2/orgs/${n}/users?${i}`)}async patchSelf(e){const n=await this.getOrgId();return this.request("PATCH",`/v2/orgs/${n}/users/self`,e)}async patchUser(e,n){const i=await this.getOrgId();return this.request("PATCH",`/v2/orgs/${i}/users/${e}`,n)}async getVersion(e){const n=await this.getOrgId();return this.request("GET",`/v2/orgs/${n}/versions/${e}`)}async getVersions(e){const n=await this.getOrgId(),i=new URLSearchParams(Object.entries(e).map(([r,o])=>[r,String(o)]));return this.request("GET",`/v2/orgs/${n}/versions?${i}`)}async exportVersion(e,n){const i=await this.getOrgId();return this.request("POST",`/v2/orgs/${i}/versions/${e}/exports`,n)}async getExport(e){const n=await this.getOrgId();return this.request("GET",`/v2/orgs/${n}/exports/${e}`)}async postReview(e){const n=await this.getOrgId();return this.request("POST",`/v2/orgs/${n}/reviews`,e)}async getReview(e){const n=await this.getOrgId();return this.request("GET",`/v2/orgs/${n}/reviews/${e}`)}async getReviews(e){const n=await this.getOrgId();return this.request("GET",`/v2/orgs/${n}/reviews?draftId=${encodeURIComponent(e.draftId)}`)}async postImport(e){const n=await this.getOrgId();return this.request("POST",`/v2/orgs/${n}/imports`,e)}async getImport(e){const n=await this.getOrgId();return this.request("GET",`/v2/orgs/${n}/imports/${e}`)}async getFolder(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/versions/${e}/folders/${n}`)}async getFolderSubfolders(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/versions/${e}/folders/${n}/folders`)}async getFolderContents(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/versions/${e}/folders/${n}/views`)}async getFolderPropertyValues(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/versions/${e}/folders/${n}/property-values`)}async getViews(e){const n=await this.getOrgId();return this.request("GET",`/v2/orgs/${n}/versions/${e}/views`)}async getView(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/versions/${e}/views/${n}`)}async getViewNodes(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/versions/${e}/views/${n}/nodes`)}
22async getViewEdges(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/versions/${e}/views/${n}/edges`)}async getViewElements(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/versions/${e}/views/${n}/elements`)}async getViewPropertyValues(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/versions/${e}/views/${n}/property-values`)}async getSharing(e){const n=await this.getOrgId();return this.request("GET",`/v2/orgs/${n}/sharing/${e}`)}async putSharing(e,n){const i=await this.getOrgId();return this.request("PUT",`/v2/orgs/${i}/sharing/${e}`,n)}async getApiKey(){const e=await this.getOrgId();return this.request("GET",`/v2/orgs/${e}/api-keys`)}async putApiKey(){const e=await this.getOrgId();return this.request("PUT",`/v2/orgs/${e}/api-keys`)}async deleteApiKey(){const e=await this.getOrgId();return this.request("DELETE",`/v2/orgs/${e}/api-keys`)}async getNode(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/versions/${e}/nodes/${n}`)}async getEdge(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/versions/${e}/edges/${n}`)}async getElements(e,n){const i=await this.getOrgId(),r=new URLSearchParams(Object.entries(n).map(([o,l])=>[o,String(l)]));return this.request("GET",`/v2/orgs/${i}/versions/${e}/elements?${r}`)}async getElement(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/versions/${e}/elements/${n}`)}async getElementViews(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/versions/${e}/elements/${n}/views`)}async getElementRelations(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/versions/${e}/elements/${n}/relations`)}async getElementTargets(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/versions/${e}/elements/${n}/targets`)}async getElementSources(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/versions/${e}/elements/${n}/sources`)}async getElementPropertyValues(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/versions/${e}/elements/${n}/property-values`)}async getRelations(e,n){const i=await this.getOrgId(),r=new URLSearchParams(Object.entries(n).map(([o,l])=>[o,String(l)]));return this.request("GET",`/v2/orgs/${i}/versions/${e}/relations?${r}`)}async getRelation(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/versions/${e}/relations/${n}`)}async getRelationViews(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/versions/${e}/relations/${n}/views`)}async getRelationPropertyValues(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/versions/${e}/relations/${n}/property-values`)}async getPropertyKey(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/versions/${e}/property-keys/${n}`)}async getPropertyKeys(e){const n=await this.getOrgId();return this.request("GET",`/v2/orgs/${n}/versions/${e}/property-keys`)}async getPropertyKeyValues(e,n,i){const r=await this.getOrgId(),o=new URLSearchParams(Object.entries(i).map(([l,u])=>[l,String(u)]));return this.request("GET",`/v2/orgs/${r}/versions/${e}/property-keys/${n}/values?${o}`)}async getPropertyValue(e,n,i){const r=await this.getOrgId();return this.request("GET",`/v2/orgs/${r}/versions/${e}/property-values/${n}/${i}`)}async getPropertyValues(e,n){const i=await this.getOrgId();return this.request("GET",`/v2/orgs/${i}/versions/${e}/property-values/${n}`)}async search(e,n){const i=await this.getOrgId();return this.request("POST",`/v2/orgs/${i}/versions/${e}/search`,n)}async getStandardTemplates(e={}){return this.request("GET",`/v2/templates${ss.encodeQuery(e)}`)}async getCategoryTemplates(e,n={}){return this.request("GET",`/v2/templates/${encodeURIComponent(e)}/categories${ss.encodeQuery(n)}`)}async getElementTypeTemplates(e,n={}){return this.request("GET",`/v2/templates/${encodeURIComponent(e)}/element-types${ss.encodeQuery(n)}`)}};ss._instance=null;let I3=ss;function Z2(t){const e=Object.values(t).filter(i=>typeof i=="number");return Object.entries(t).filter(([i,r])=>e.indexOf(+i)===-1).map(([i,r])=>r)}function z3(t,e="|"){return t.map(n=>c9(n)).join(e)}function W2(t,e){return typeof e=="bigint"?e.toString():e}class Wne{constructor(e){this._getter=e,this._value=void 0}get value(){const e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}}function qO(t){return new Wne(t)}function qne(t){return t==null}function VO(t){const e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}function Wu(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}function r9(t){const e=Object.getOwnPropertyDescriptor(t,"shape");return e?.get?e.get.raw:e?.value}function Va(t){return r9(t._zod.def)??t._zod.def.shape}function s9(t,e,n){Object.defineProperty(t,e,{get(){const i=n();return Wu(this,e,i),i},enumerable:!0,configurable:!0})}function o9(t,e,n){e in t?Wu(t,e,n):t[e]=n}function Du(t,e,n,i){const r=Va(e);for(const o of n){const l=Object.getOwnPropertyDescriptor(r,o);l.enumerable&&(l.get?s9(t,o,()=>{const u=e._zod.def.shape[o];return i?i(u,o):u}):o9(t,o,i?i(l.value,o):l.value))}}function Vne(t,e){for(const n of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,n);i.enumerable&&(i.get?s9(t,n,()=>
22e[n]):o9(t,n,i.value))}}function hs(...t){const e={};for(const n of t){const i=Object.getOwnPropertyDescriptors(n);Object.assign(e,i)}return Object.defineProperties({},e)}function Bne(t){return JSON.stringify(t)}function Gne(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const a9="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Qb(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}const Jne=qO(()=>{if(ra.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Mm(t){if(Qb(t)===!1)return!1;const e=t.constructor;if(e===void 0||typeof e!="function")return!0;const n=e.prototype;return!(Qb(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function l9(t){return Mm(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}const Xne=new Set(["string","number","symbol"]);function Bw(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function gc(t,e,n){const i=new t._zod.constr(e??t._zod.def);return(!e||n?.parent)&&(i._zod.parent=t),i}function gt(t){const e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function c9(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function Yne(t){return Object.keys(t).filter(e=>t[e]._zod.optin!==void 0&&t[e]._zod.optout==="optional")}const Qne={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},eie={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function tie(t,e){const n=t._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o={};return Du(o,t,Gw(t,e)),gc(t,hs(n,{shape:o,checks:[]}))}function Gw(t,e){const n=Va(t),i=[];for(const r of Reflect.ownKeys(e)){if(!Object.getOwnPropertyDescriptor(n,r)?.enumerable)throw new Error(`Unrecognized key: "${String(r)}"`);e[r]&&i.push(r)}return i}function nie(t,e){const n=t._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=new Set(Gw(t,e)),l={};return Du(l,t,Reflect.ownKeys(Va(t)).filter(u=>!o.has(u))),gc(t,hs(n,{shape:l,checks:[]}))}function iie(t,e){if(!Mm(e))throw new Error("Invalid input to extend: expected a plain object");const n=t._zod.def.checks;if(n&&n.length>0){const r=Va(t);for(const o of Reflect.ownKeys(e))if(Object.getOwnPropertyDescriptor(r,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return gc(t,hs(t._zod.def,{shape:u9(t,e)}))}function u9(t,e){const n={};return Du(n,t,Reflect.ownKeys(Va(t))),Vne(n,e),n}function rie(t,e){if(!Mm(e))throw new Error("Invalid input to safeExtend: expected a plain object");return gc(t,hs(t._zod.def,{shape:u9(t,e)}))}function sie(t,e){if(!e?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n={};Du(n,t,Reflect.ownKeys(Va(t))),Du(n,e,Reflect.ownKeys(Va(e)));const i=hs(t._zod.def,{shape:n,get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return gc(t,i)}function D3(t,e,n,i="partial"){const o=e._zod.def.checks;if(o&&o.length>0)throw new Error(`.${i}() cannot be used on object schemas containing refinements`);const u=n?new Set(Gw(e,n)):void 0,d={};return Du(d,e,Reflect.ownKeys(Va(e)),t&&((f,p)=>u&&!u.has(p)?f:new t({type:"optional",innerType:f}))),gc(e,hs(e._zod.def,{shape:d,checks:[]}))}function oie(t,e,n){const i=n?new Set(Gw(e,n)):void 0,r={};return Du(r,e,Reflect.ownKeys(Va(e)),(o,l)=>i&&!i.has(l)?o:new t({type:"nonoptional",innerType:o})),gc(e,hs(e._zod.def,{shape:r}))}function Fa(t,e=0){if(t.aborted===!0)return!0;for(let n=e;n<t.issues.length;n++)if(t.issues[n]?.continue!==!0)return!0;return!1}function aie(t,e=0){if(t.aborted===!0)return!0;for(let n=e;n<t.issues.length;n++)if(t.issues[n]?.continue===!1)return!0;return!1}function d9(t,e){return e.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(t),n})}function tg(t){return typeof t=="string"?t:t?.message}function L3(t,e,n){var i;for(let r=e;r<t.length;r++)(i=t[r]).schema??(i.schema=n)}function yf(t,e,n){var i;const r=t.inst?._zod?.traits;r?.has("$ZodType")&&(r.has("$ZodCheck")?(i=t).schema??(i.schema=t.inst):t.schema=t.inst);const o=t.schema!==t.inst?t.schema?._zod.def?.error:void 0,l=t.message?t.message:tg(t.inst?._zod.def?.error?.(t))??tg(o?.(t))??tg(e?.error?.(t))??tg(n.customError?.(t))??tg(n.localeError?.(t))??"Invalid input",u={};for(const d of Object.keys(t))d==="inst"||d==="schema"||d==="continue"||d==="input"||d==="__proto__"||(u[d]=t[d]);return u.path??(u.path=[]),u.message=l,e?.reportInput&&(u.input=t.input),u}const lie=/[\uD800-\uDBFF]/;function BO(t){const e=t.length;if(!lie.test(t))return e;let n=e;for(let i=0;i<e-1;
22i++)(t.charCodeAt(i)&64512)===55296&&(t.charCodeAt(i+1)&64512)===56320&&(n--,i++);return n}function GO(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function cie(t){const e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";const n=t;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return e}function Im(...t){const[e,n,i]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:i}:{...e}}function uie(t,e){for(const n in e){const i=Object.getOwnPropertyDescriptor(e,n);i.get?Object.defineProperty(t,n,{...i,enumerable:!1}):hie(t,n,i.value)}}function fc(t,e,n,i=!0){return Object.defineProperty(t,e,{configurable:!0,writable:!0,enumerable:i,value:n}),n}function h9(t,e,n){return fc(t,e,n,!1)}function die(t,e){for(const n in t){const i=t[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!0,get(){return fc(this,n,i(this))},set(r){fc(this,n,r)}})}return e}function hie(t,e,n){Object.defineProperty(t,e,{configurable:!0,get(){return this==null?n:fc(this,e,n.bind(this))},set(i){fc(this,e,i)}})}function fie(t,e){const n=Object.getPrototypeOf(t);return e in n?void 0:n}let AE,Fl=!1;const pie={configurable:!0,get(){Fl=!0}};function hn(t,e,n){const i=Object.getPrototypeOf(t._zod);if(e in i&&AE!==t._zod){AE=void 0;return}AE=t._zod,Object.defineProperty(i,e,{configurable:!0,get(){Object.defineProperty(this,e,pie);const r=Fl;Fl=!1;try{const o=n(this);return Fl?delete this[e]:Object.defineProperty(this,e,{configurable:!0,writable:!0,value:o}),Fl=Fl||r,o}catch(o){throw delete this[e],Fl=Fl||r,o}},set(r){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:r})}})}function gie(t,e,n,i){const r=fie(t,e);r&&Object.defineProperty(r,e,{configurable:!0,get(){const o={configurable:!0,writable:!0,enumerable:i,value:void 0};return Object.defineProperty(this,e,o),o.value=n(this),Object.defineProperty(this,e,o),o.value},set(o){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:i,value:o})}})}const mie="~constantCatch";function vie(t){const e=()=>t;return e[mie]=!0,e}var U3;const jE={value:void 0,enumerable:!1};let F3="captureStackTrace"in Error?Error:null;function yie(t){const e=F3;if(e){const n=e.stackTraceLimit;if(typeof n=="number"){try{e.stackTraceLimit=0}catch{return F3=null,new t}try{return new t}finally{e.stackTraceLimit=n}}}return new t}function we(t,e,n,i){const r={};function o(v){this.def=v,this.constr=g,this.traits=new Set}o.prototype=r;const l=n,u=l&&new WeakSet;function d(v,y){if(v._zod){if(v._zod.traits.has(t))return}else{jE.value=new o(y);try{Object.defineProperty(v,"_zod",jE)}finally{jE.value=void 0}}if(v._zod.traits.add(t),e(v,y),u){const x=Object.getPrototypeOf(v),S=v._zod.constr.prototype;let k=x;for(;k&&k!==S;)k=Object.getPrototypeOf(k);const T=k??x;u.has(T)||(u.add(T),uie(T,l))}const b=g.prototype;for(const x in b)Object.prototype.hasOwnProperty.call(b,x)&&(x in v||(v[x]=b[x].bind(v)))}const f=i?.Parent??Object;class p extends f{}Object.defineProperty(p,"name",{value:t});function g(v){const y=i?.Parent?yie(p):this;d(y,v);const b=y._zod.deferred;if(b){for(const S of b)S();y._zod.deferred=void 0}const x=globalThis.__zod_globalConfig?.postProcessor;return x&&x(y),y}return Object.defineProperty(g,"init",{value:d}),Object.defineProperty(g,Symbol.hasInstance,{value:v=>i?.Parent&&v instanceof i.Parent?!0:v?._zod?.traits?.has(t)}),Object.defineProperty(g,"name",{value:t}),g}class ju extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class f9 extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(U3=globalThis).__zod_globalConfig??(U3.__zod_globalConfig={});const ra=globalThis.__zod_globalConfig;function mc(t){return t&&Object.assign(ra,t),ra}function _ie(){const t=this._zod;return t.message??(t.message=JSON.stringify(t.def,W2,2)),t.message}function bie(t){this._zod.message=t}const wie={get:_ie,set:bie,enumerable:!0,configurable:!0},PE={value:void 0,enumerable:!1},H3=new WeakSet([Object.prototype,Error.prototype]),xie=(t,e)=>{t.name="$ZodError",PE.value=e,Object.defineProperty(t,"issues",PE),PE.value=void 0,Object.defineProperty(t,"message",wie);const n=Object.getPrototypeOf(t);
22H3.has(n)||(H3.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){const i=()=>this.message;return Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0})}}))},Sie=we("$ZodError",xie);function kie(t,e,n){return Object.prototype.hasOwnProperty.call(t,e)||(e==="__proto__"?Object.defineProperty(t,e,{value:n(),writable:!0,enumerable:!0,configurable:!0}):t[e]=n()),t[e]}function Eie(t,e=n=>n.message){const n={},i=[];for(const r of t.issues)r.path.length>0?kie(n,r.path[0],()=>[]).push(e(r)):i.push(e(r));return{formErrors:i,fieldErrors:n}}function Tie(t,e=n=>n.message){const n={_errors:[]},i=(r,o=[])=>{for(const l of r.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(u=>i({issues:u},[...o,...l.path]));else if(l.code==="invalid_key")i({issues:l.issues},[...o,...l.path]);else if(l.code==="invalid_element")i({issues:l.issues},[...o,...l.path]);else{const u=[...o,...l.path];if(u.length===0)n._errors.push(e(l));else{let d=n,f=0;for(;f<u.length;){const p=u[f],g=f===u.length-1;if(p==="_errors"){g&&d._errors.push(e(l)),f++;continue}Object.prototype.hasOwnProperty.call(d,p)||Object.defineProperty(d,p,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});const v=d[p];g&&v._errors.push(e(l)),d=v,f++}}}};return i(t),n}function Jw(t,e){return{callee:e?.callee??t,Err:e?.Err}}const JO=t=>{const e=(n,i,r,o)=>{const l=r?{...r,async:!1}:{async:!1},u=n._zod.run({value:i,issues:[]},l);if(u instanceof Promise)throw new ju;if(u.issues.length){const d=new(o?.Err??t)(u.issues.map(f=>yf(f,l,mc())));throw a9(d,o?.callee??e),d}return u.value};return e},XO=t=>{const e=async(n,i,r,o)=>{const l=r?{...r,async:!0}:{async:!0};let u=n._zod.run({value:i,issues:[]},l);if(u instanceof Promise&&(u=await u),u.issues.length){const d=new(o?.Err??t)(u.issues.map(f=>yf(f,l,mc())));throw a9(d,o?.callee??e),d}return u.value};return e},YO=t=>(e,n,i)=>{const r=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:n,issues:[]},r);if(o instanceof Promise)throw new ju;return o.issues.length?p9(t,o.issues,r):{success:!0,data:o.value}};function p9(t,e,n){let i;return{success:!1,get error(){return i||(i=new t(e.map(r=>yf(r,n,mc()))),e=void 0,n=void 0),i},set error(r){i=r,e=void 0,n=void 0}}}const QO=t=>async(e,n,i)=>{const r=i?{...i,async:!0}:{async:!0};let o=e._zod.run({value:n,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length?p9(t,o.issues,r):{success:!0,data:o.value}},Cie=Symbol.for("zod.compile.invalid"),Oie=Symbol.for("zod.compile.fallback"),Rie=((t,e,n)=>{const i=t._zod.bag.validator;if(i!==void 0){if(i(e)!==Cie)return!0;if(i.definite===!0&&n===void 0)return!1}return $ie(t,e,n)});function $ie(t,e,n){const i=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},r=t._zod.bag.fallbackRun;let o;if(r?(i[Oie]=!0,o=r({value:e,issues:[]},i)):o=t._zod.run({value:e,issues:[]},i),o instanceof Promise)throw new ju;return o.issues.length===0}const Aie=async(t,e,n)=>{const i=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let r=t._zod.run({value:e,issues:[]},i);return r instanceof Promise&&(r=await r),r.issues.length===0},jie=t=>{const e=JO(t),n=(i,r,o,l)=>{const u=o?{...o,direction:"backward"}:{direction:"backward"};return e(i,r,u,Jw(n,l))};return n},Pie=t=>{const e=JO(t),n=(i,r,o,l)=>e(i,r,o,Jw(n,l));return n},Nie=t=>{const e=XO(t),n=async(i,r,o,l)=>{const u=o?{...o,direction:"backward"}:{direction:"backward"};return await e(i,r,u,Jw(n,l))};return n},Mie=t=>{const e=XO(t),n=async(i,r,o,l)=>await e(i,r,o,Jw(n,l));return n},Iie=t=>(e,n,i)=>{const r=i?{...i,direction:"backward"}:{direction:"backward"};return YO(t)(e,n,r)},zie=t=>(e,n,i)=>YO(t)(e,n,i),Die=t=>async(e,n,i)=>{const r=i?{...i,direction:"backward"}:{direction:"backward"};return QO(t)(e,n,r)},Lie=t=>async(e,n,i)=>QO(t)(e,n,i),Uie=/^[cC][0-9a-z]{6,}$/,Fie=/^[0-9a-z]+$/,Hie=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Kie=/^[0-9a-vA-V]{20}$/,Zie=/^[A-Za-z0-9]{27}$/,Wie=/^[a-zA-Z0-9_-]{21}$/;function qie(t){return new RegExp(`^[a-zA-Z0-9_-]{${t}}$`)}const Vie=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Bie=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,K3=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Gie=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Jie="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Xie(){return new RegExp(Jie,"u")}const Yie=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}
22(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Qie=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,ere=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,tre=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,nre=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ire=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,rre=/^https?$/,sre=/^\+[1-9]\d{6,14}$/,g9="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function ore(t){return new RegExp(`^${t}$`)}const are=ore(g9);function q2(t){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:t.seconds?`${e}:[0-5]\\d(?:\\.\\d+)?`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function lre(t){return new RegExp(`^${q2(t)}$`)}function cre(t){const e=["Z"];t.offset&&e.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${q2({precision:t.precision,seconds:!0})}(?:${e.join("|")})`,i=t.local?`${n}|${q2({precision:t.precision})}`:n;return new RegExp(`^${g9}T(?:${i})$`)}const ure=/^[\s\S]{0,}$/,dre=/^[^A-Z]*$/,hre=/^[^a-z]*$/,la=we("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),eR=t=>{const e=t.value;return!qne(e)&&e.length!==void 0},fre=we("$ZodCheckMaxLength",(t,e)=>{var n;la.init(t,e),(n=t._zod.def).when??(n.when=eR),t._zod.check=i=>{const r=i.value,o=r.length;if((typeof r=="string"&&o>e.maximum?BO(r):o)<=e.maximum)return;const u=GO(r);i.issues.push({origin:u,code:"too_big",maximum:e.maximum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),pre=we("$ZodCheckMinLength",(t,e)=>{var n;la.init(t,e),(n=t._zod.def).when??(n.when=eR),t._zod.check=i=>{const r=i.value,o=r.length;if((typeof r=="string"&&o>=e.minimum&&o<e.minimum*2?BO(r):o)>=e.minimum)return;const u=GO(r);i.issues.push({origin:u,code:"too_small",minimum:e.minimum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),gre=we("$ZodCheckLengthEquals",(t,e)=>{var n;la.init(t,e),(n=t._zod.def).when??(n.when=eR),t._zod.check=i=>{const r=i.value,o=r.length,l=typeof r=="string"&&o>=e.length&&o<=e.length*2?BO(r):o;if(l===e.length)return;const u=GO(r),d=l>e.length;i.issues.push({origin:u,...d?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),Xw=we("$ZodCheckStringFormat",(t,e)=>{var n,i;la.init(t,e),e.pattern?(n=t._zod).check??(n.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:e.format,input:r.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(i=t._zod).check??(i.check=()=>{})}),mre=we("$ZodCheckRegex",(t,e)=>{Xw.init(t,e),t._zod.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),vre=we("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=dre),Xw.init(t,e)}),yre=we("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=hre),Xw.init(t,e)}),_re=we("$ZodCheckIncludes",(t,e)=>{la.init(t,e);const n=Bw(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position},}${n}`:n);e.pattern=i,t._zod.check=r=>{r.value.includes(e.includes,e.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input
22:r.value,inst:t,continue:!e.abort})}}),bre=we("$ZodCheckStartsWith",(t,e)=>{la.init(t,e);const n=new RegExp(`^${Bw(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:t,continue:!e.abort})}}),wre=we("$ZodCheckEndsWith",(t,e)=>{la.init(t,e);const n=new RegExp(`.*${Bw(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:t,continue:!e.abort})}}),xre=we("$ZodCheckOverwrite",(t,e)=>{la.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}});class Sre{constructor(e=[],n={}){this.content=[],this.indent=0,this.args=e,this.closed=n}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const i=e.split(`
23`).filter(l=>l),r=Math.min(...i.map(l=>l.length-l.trimStart().length)),o=i.map(l=>l.slice(r)).map(l=>" ".repeat(this.indent*2)+l);for(const l of o)this.content.push(l)}compile(){const e=Function,n=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
24${n.join(`
25`)}
26};`)(...Object.values(this.closed))}}const kre={major:4,minor:6,patch:5},wi=we("$ZodType",(t,e)=>{var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=kre;const i=t._zod.def.checks,r=t._zod.traits.has("$ZodCheck")?[t,...i??[]]:i?.length?[...i]:[];for(const o of r)for(const l of o._zod.onattach)l(t);if(r.length===0)(n=t._zod).deferred??(n.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{const o=(u,d,f)=>{if(u.memo)return u;let p=Fa(u),g;for(const v of d){if(v._zod.def.when){if(aie(u)||!v._zod.def.when(u))continue}else if(p)continue;const y=u.issues.length,b=v._zod.check(u);if(b instanceof Promise&&f?.async===!1)throw new ju;if(g||b instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await b,u.issues.length!==y&&(L3(u.issues,y,t),p||(p=Fa(u,y)))});else{if(u.issues.length===y)continue;L3(u.issues,y,t),p||(p=Fa(u,y))}}return g?g.then(()=>u):u},l=(u,d,f)=>{if(Fa(u))return u.aborted=!0,u;const p=o(d,r,f);if(p instanceof Promise){if(f.async===!1)throw new ju;return p.then(g=>t._zod.parse(g,f))}return t._zod.parse(p,f)};t._zod.run=(u,d)=>{if(d.skipChecks)return t._zod.parse(u,d);if(d.direction==="backward"){const p=t._zod.parse({value:u.value,issues:[]},{...d,skipChecks:!0});return p instanceof Promise?p.then(g=>l(g,u,d)):l(p,u,d)}const f=t._zod.parse(u,d);if(f instanceof Promise){if(d.async===!1)throw new ju;return f.then(p=>o(p,r,d))}return o(f,r,d)}}},{get"~standard"(){return h9(this,"~standard",v9(this))},set"~standard"(t){fc(this,"~standard",t)}}),m9=(t,e)=>t.issues.length?{issues:t.issues.map(n=>yf(n,e,mc()))}:{value:t.value};async function Ere(t,e){const n={async:!0};return m9(await t._zod.run({value:e,issues:[]},n),n)}function v9(t){return{validate:e=>{const n={async:!1};try{const i=t._zod.run({value:e,issues:[]},n);if(!(i instanceof Promise))return m9(i,n)}catch{}return Ere(t,e)},vendor:"zod",version:1}}const tR=we("$ZodString",(t,e)=>{wi.init(t,e),t._zod.pattern=e.pattern??ure,t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),Hn=we("$ZodStringFormat",(t,e)=>{Xw.init(t,e),tR.init(t,e)}),Tre=we("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Bie),Hn.init(t,e)}),Cre=we("$ZodUUID",(t,e)=>{if(e.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=K3(i))}else e.pattern??(e.pattern=K3());Hn.init(t,e)}),Ore=we("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Gie),Hn.init(t,e)}),y9=1,ew=2;function _9(t){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(t):(new URL(t),!0)}catch{return!1}}function Rre(t,e){return!("normalize"in e)&&!("hostname"in e)&&!("protocol"in e)?_9(t)||ew:$re(t,e)}function $re(t,e){if(!e.normalize&&e.protocol?.source===rre.source&&!/^https?:\/\//i.test(t))return y9;try{if(typeof URL<"u"){const n=URL;if(typeof n.parse=="function")return n.parse(t)??ew}return new URL(t)}catch{return ew}}const Are=/[\t\n\r]/g;function Z3(t){return t.replace(Are,"")}function jre(t,e){return e.lastIndex=0,e.test(t.hostname)}function Pre(t,e){return e.lastIndex=0,e.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol)}const Nre=we("$ZodURL",(t,e)=>{Hn.init(t,e),t._zod.check=n=>
26{try{const i=n.value.trim(),r=Rre(i,e);if(r===y9){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:t,continue:!e.abort});return}if(r===ew){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort});return}if(r===!0){n.value=Z3(i);return}e.hostname&&!jre(r,e.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:n.value,inst:t,continue:!e.abort}),e.protocol&&!Pre(r,e.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:n.value,inst:t,continue:!e.abort}),n.value=e.normalize?r.href:Z3(i);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort})}}}),Mre=we("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Xie()),Hn.init(t,e)}),Ire=we("$ZodNanoID",(t,e)=>{if(e.length!==void 0&&(!Number.isInteger(e.length)||e.length<1))throw new Error(`Invalid nanoid length: ${e.length}`);e.pattern??(e.pattern=e.length===void 0?Wie:qie(e.length)),Hn.init(t,e)}),zre=we("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Uie),Hn.init(t,e)}),Dre=we("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Fie),Hn.init(t,e)}),Lre=we("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Hie),Hn.init(t,e)}),Ure=we("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Kie),Hn.init(t,e)}),Fre=we("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Zie),Hn.init(t,e)}),Hre=we("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=cre(e)),Hn.init(t,e)}),Kre=we("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=are),Hn.init(t,e)}),Zre=we("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=lre(e)),Hn.init(t,e)}),Wre=we("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Vie),Hn.init(t,e)}),qre=we("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Yie),Hn.init(t,e)}),Vre=/^[0-9a-fA-F:.]+$/;function b9(t){return Vre.test(t)?_9(`http://[${t}]`):!1}const Bre=we("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Qie),Hn.init(t,e),t._zod.check=n=>{b9(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!e.abort})}}),Gre=we("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=ere),Hn.init(t,e)});function Jre(t){const e=t.split("/");if(e.length!==2)return!1;const[n,i]=e;if(!i)return!1;const r=Number(i);return`${r}`!==i||r<0||r>128?!1:b9(n)}const Xre=we("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=tre),Hn.init(t,e),t._zod.check=n=>{Jre(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!e.abort})}});function w9(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const x9=/^[0-9a-zA-Z+/]*={0,2}$/,Yre=we("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=x9),Hn.init(t,e),t._zod.check=n=>{w9(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!e.abort})}}),nR=/^[A-Za-z0-9_-]*$/;function Qre(t){if(!nR.test(t))return!1;const e=t.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return w9(n)}const ese=we("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=nR),Hn.init(t,e),t._zod.check=n=>{Qre(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!e.abort})}}),tse=we("$ZodE164",(t,e)=>{e.pattern??(e.pattern=sre),Hn.init(t,e)});function nse(t,e=null){try{const n=t.split(".");if(n.length!==3)return!1;const[i]=n;if(!i)return!1;const r=JSON.parse(atob(i));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||e&&(!("alg"in r)||r.alg!==e))}catch{return!1}}const ise=we("$ZodJWT",(t,e)=>{Hn.init(t,e),t._zod.check=n=>{nse(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}}),rse=we("$ZodUnknown",(t,e)=>{wi.init(t,e),t._zod.parse=n=>n}),sse=we("$ZodNever",(t,e)=>{wi.init(t,e),t._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)});function W3(t,e,n){t.issues.length&&e.issues.push(...d9(n,t.issues)),e.value[n]=t.value}const ose=we("$ZodArray",(t,e)=>{wi.init(t,e);const n=ra.memoizer;n?.attach(t),t._zod.parse=(i,r)=>{const o=i.value;if(!Array.isArray(o))return i.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),i;i.value=n?n.alloc(t,i,Array(o.length),r):Array(o.length);const l=[],u=r?.abortEarly;for(let d=0;d<o.length;d++){const f=o[d],p=e.element._zod.run({value:f,issues:[]},r);if(p instanceof Promise)l.push(p.then(g=>W3(g,i,d)));else if(W3(p,i,d),u&&p.issues.length!==0&&Fa(p))break}return l.length?Promise.all(l).then(()=>i):i}});function tw(t,e,n,i,r,o){const l=n in i,u=o==="optional";if(!(!l&&u&&r==="optional")){if(t.issues.length){if(r!==void 0&&u&&!l)return;e.issues.push(...d9(n,t.issues))}if(!l&&r===void 0){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}t.value===void 0?(l||r==="defaulted"&&!u)&&(e.value[n]=void 0):e.value[n]=t.value}}const ase=[];function S9(t){const e=Object.keys(t.shape),n=Object.getOwnPropertySymbols(t.shape),i=n.length?n:ase,r=i.length?[...e,...i]:e;for(const l of r)if(!t.shape?.[l]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(l)}": expected a Zod schema`);const o=Yne(t.shape);
26return{...t,allKeys:r,symbolKeys:i,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(o)}}function k9(t,e,n,i,r,o,l){const u=[],d=r.keySet,f=r.catchall._zod,p=f.def.type,g=f.optin,v=f.optout;let y=0;for(const b in e){if(l&&n.issues.length!==y){if(Fa(n,y))break;y=n.issues.length}if(d.has(b))continue;if(b==="__proto__"){p==="never"&&u.push(b);continue}if(p==="never"){u.push(b);continue}const x=f.run({value:e[b],issues:[]},i);x instanceof Promise?t.push(x.then(S=>tw(S,n,b,e,g,v))):tw(x,n,b,e,g,v)}return u.length&&n.issues.push({code:"unrecognized_keys",keys:u,input:e,inst:o,continue:!0}),t.length?Promise.all(t).then(()=>n):n}const lse=we("$ZodObject",(t,e)=>{wi.init(t,e);const n=Object.getOwnPropertyDescriptor(e,"shape"),i=n?.get?n.get.raw:e.shape??{};if(i){const f=()=>{const p={...i};return Object.defineProperty(e,"shape",{value:p}),f.raw=p,p};f.raw=i,Object.defineProperty(e,"shape",{get:f})}const r=qO(()=>S9(e));hn(t,"propValues",f=>{const p=f.def.shape,g={};for(const v in p){const y=p[v]._zod;if(y.values){Object.prototype.hasOwnProperty.call(g,v)||Wu(g,v,new Set);for(const b of y.values)g[v].add(b);y.optin!==void 0&&g[v].add(void 0)}}return g});const o=Qb,l=e.catchall;let u;const d=ra.memoizer;d?.attach(t),t._zod.parse=(f,p)=>{u??(u=r.value);const g=f.value;if(!o(g))return f.issues.push({expected:"object",code:"invalid_type",input:g,inst:t}),f;f.value=d?d.alloc(t,f,{},p):{};
26const v=[],y=u.shape,b=p?.abortEarly;let x=f.issues.length;for(const S of u.allKeys){if(b&&f.issues.length!==x){if(Fa(f,x))break;x=f.issues.length}if(S==="__proto__")continue;const k=y[S],T=k._zod.optin,C=k._zod.optout,A=k._zod.run({value:g[S],issues:[]},p);A instanceof Promise?v.push(A.then($=>tw($,f,S,g,T,C))):tw(A,f,S,g,T,C)}return l?k9(v,g,f,p,r.value,t,b===!0):v.length?Promise.all(v).then(()=>f):f}}),cse=we("$ZodObjectJIT",(t,e)=>{lse.init(t,e);const n=t._zod.parse,i=qO(()=>S9(e)),r=ra.memoizer,o=y=>{const b=i.value,x=b.symbolKeys,S=new Sre(["payload","ctx"],{shape:y,inst:t,memo:r,syms:x}),k=$=>`shape[${$}]._zod.run({ value: input[${$}], issues: [] }, ctx)`,T=($,N)=>`
27          let ${$}_ab = false;
28          for (let i = 0; i < ${$}.issues.length; i++) {
29            const iss = ${$}.issues[i];
30            iss.path = iss.path ? [${N}, ...iss.path] : [${N}];
31            payload.issues.push(iss);
32            if (iss.continue !== true) ${$}_ab = true;
33          }
34          if (${$}_ab && ctx && ctx.abortEarly) {
35            payload.value = newResult;
36            return payload;
37          }`;S.write("const input = payload.value;");const C=Object.create(null);let A=0;for(const $ of b.allKeys)C[$]=`key_${A++}`;S.write(r?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const $ of b.allKeys){if($==="__proto__")continue;const N=C[$],j=typeof $=="symbol"?`syms[${x.indexOf($)}]`:Bne($),O=`${j} in input`,L=y[$],B=L?._zod?.optin,V=B!==void 0,ee=L?._zod?.optout==="optional";if(S.write(`const ${N} = ${k(j)};`),V&&ee){const me=B==="optional"?`${N}_present`:`${N}.value !== undefined || ${N}_present`;S.write(`
38        const ${N}_present = ${O};
39        if (!${N}.issues.length || ${N}_present) {
40          if (${N}.issues.length) {${T(N,j)}
41          }
42
43          if (${me}) {
44            newResult[${j}] = ${N}.value;
45          }
46        }
47
48      `)}else V?(S.write(`
49        if (${N}.issues.length) {${T(N,j)}
50        }
51      `),B==="defaulted"?S.write(`newResult[${j}] = ${N}.value;`):S.write(`
52        if (${N}.value !== undefined || ${O}) {
53          newResult[${j}] = ${N}.value;
54        }
55      `)):S.write(`
56        const ${N}_present = ${O};
57        if (${N}.issues.length) {${T(N,j)}
58        }
59        if (!${N}_present && !${N}.issues.length) {
60          payload.issues.push({
61            code: "invalid_type",
62            expected: "nonoptional",
63            input: undefined,
64            path: [${j}]
65          });
66          if (ctx && ctx.abortEarly) {
67            payload.value = newResult;
68            return payload;
69          }
70        }
71
72        if (${N}_present) {
73          newResult[${j}] = ${N}.value;
74        }
75
76      `)}return S.write("payload.value = newResult;"),S.write("return payload;"),S.compile()};let l;const u=Qb,d=!ra.jitless,p=d&&Jne.value,g=e.catchall;let v;t._zod.parse=(y,b)=>{v??(v=i.value);const x=y.value;return u(x)?d&&p&&b?.async===!1&&b.jitless!==!0?(l||(l=o(e.shape)),y=l(y,b),g?k9([],x,y,b,v,t,b?.abortEarly===!0):y):n(y,b):(y.issues.push({expected:"object",code:"invalid_type",input:x,inst:t}),y)}});function q3(t,e,n,i){for(const o of t)if(o.issues.length===0)return e.value=o.value,e;const r=t.filter(o=>!Fa(o));return r.length===1?(e.value=r[0].value,r[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(o=>o.issues.map(l=>yf(l,i,mc())))}),e)}const use=we("$ZodUnion",(t,e)=>{wi.init(t,e),hn(t,"optin",i=>i.def.options.some(r=>r._zod.optin==="defaulted")?"defaulted":i.def.options.some(r=>r._zod.optin!==void 0)?"optional":void 0),hn(t,"optout",i=>i.def.options.some(r=>r._zod.optout==="optional")?"optional":void 0),hn(t,"values",i=>{if(i.def.options.every(r=>r._zod.values))return new Set(i.def.options.flatMap(r=>Array.from(r._zod.values)))}),hn(t,"pattern",i=>{if(i.def.options.every(r=>r._zod.pattern)){const r=i.def.options.map(o=>o._zod.pattern);return new RegExp(`^(${r.map(o=>VO(o.source)).join("|")})$`)}});const n=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1;const l=[];for(const u of e.options){const d=u._zod.run({value:i.value,issues:[]},r);if(d instanceof Promise)l.push(d),o=!0;else{if(d.issues.length===0)return d;l.push(d)}}return o?Promise.all(l).then(u=>q3(u,i,t,r)):q3(l,i,t,r)}}),dse=we("$ZodIntersection",(t,e)=>{wi.init(t,e),t._zod.parse=(n,i)=>{const r=n.value,o=e.left._zod.run({value:r,issues:[]},i),l=e.right._zod.run({value:r,issues:[]},i);return o instanceof Promise||l instanceof Promise?Promise.all([o,l]).then(([d,f])=>V3(n,d,f)):V3(n,o,l)}});function V2(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(Mm(t)&&Mm(e)){const n=Object.keys(e),i=Object.keys(t).filter(o=>n.indexOf(o)!==-1),r={...t,...e};Object.prototype.hasOwnProperty.call(r,"__proto__")&&delete r.__proto__;for(const o of i){if(o==="__proto__")continue;const l=V2(t[o],e[o]);if(!l.valid)return{valid:!1,mergeErrorPath:[o,...l.mergeErrorPath]};r[o]=l.data}return{valid:!0,data:r}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;i<t.length;i++){const r=t[i],o=e[i],l=V2(r,o);if(!l.valid)return{valid:!1,mergeErrorPath:[i,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function V3(t,e,n){const i=new Map;let r;const o=new Map,l=(f,p)=>{let g;if(f.code==="unrecognized_keys"&&!f.path?.length)r??(r=f),g=f.keys;else if(f.code==="invalid_key"&&f.origin==="record"&&f.path?.length===1){const v=String(f.path[0]);o.has(v)||o.set(v,f),g=[v]}else return!1;for(const v of g)i.has(v)||i.set(v,{}),i.get(v)[p]=!0;return!0};for(const f of e.issues)l(f,"l")||t.issues.push(f);for(const f of n.issues)l(f,"r")||t.issues.push(f);const u=[...i].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(u.length){const f=r?u.filter(p=>r.keys.includes(p)):[];f.length&&t.issues.push({...r,keys:f});for(const p of u)!f.includes(p)&&o.has(p)&&t.issues.push(o.get(p))}const d=V2(e.value,n.value);if(!d.valid){if(Fa(t))return t;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(d.mergeErrorPath)}`)}return t.value=d.data,t}const hse=we("$ZodEnum",(t,e)=>{wi.init(t,e);const n=Z2(e.entries),i=new Set(n);t._zod.values=i,hn(t,"pattern",r=>{const o=Z2(r.def.entries).filter(l=>Xne.has(typeof l));return new RegExp(o.length?`^(${o.map(l=>Bw(l.toString())).join("|")})$`:"^[^\\s\\S]$")}),t._zod.parse=(r,o)=>{const l=r.value;return i.has(l)||r.issues.push({code:"invalid_value",values:n,input:l,inst:t}),r}}),fse=we("$ZodTransform",(t,e)=>{wi.init(t,e),t._zod.optin="optional",ra.memoizer?.guard(t),t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new f9(t.constructor.name);
vendor: 4,549 bytes, line 76
76const r=e.transform(n.value,n);if(i.async)return(r instanceof Promise?r:Promise.resolve(r)).then(l=>(n.value=l,n));if(r instanceof Promise)throw new ju;return n.value=r,n}});function B3(t,e){return t.value=e.issues.length?void 0:e.value,t}const E9=we("$ZodOptional",(t,e)=>{wi.init(t,e),hn(t,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),t._zod.optout="optional",hn(t,"values",n=>{const i=n.def.innerType._zod.values;return i?new Set([...i,void 0]):void 0}),hn(t,"pattern",n=>{const i=n.def.innerType._zod.pattern;return i?new RegExp(`^(${VO(i.source)})?$`):void 0}),t._zod.parse=(n,i)=>{if(n.value===void 0){if(e.innerType._zod.optin!=="defaulted")return n;const r=e.innerType._zod.run({value:n.value,issues:[]},i);return r instanceof Promise?r.then(o=>B3(n,o)):B3(n,r)}return e.innerType._zod.run(n,i)}}),pse=we("$ZodExactOptional",(t,e)=>{E9.init(t,e),hn(t,"values",n=>n.def.innerType._zod.values),hn(t,"pattern",n=>n.def.innerType._zod.pattern),t._zod.parse=(n,i)=>e.innerType._zod.run(n,i)}),gse=we("$ZodNullable",(t,e)=>{wi.init(t,e),hn(t,"optin",n=>n.def.innerType._zod.optin),hn(t,"optout",n=>n.def.innerType._zod.optout),hn(t,"pattern",n=>{const i=n.def.innerType._zod.pattern;return i?new RegExp(`^(${VO(i.source)}|null)$`):void 0}),hn(t,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),t._zod.parse=(n,i)=>n.value===null?n:e.innerType._zod.run(n,i)}),mse=we("$ZodDefault",(t,e)=>{wi.init(t,e),t._zod.optin="defaulted",hn(t,"values",n=>n.def.innerType._zod.values),t._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);if(n.value===void 0)return n.value=e.defaultValue,n;const r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>G3(o,e)):G3(r,e)}});function G3(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const vse=we("$ZodPrefault",(t,e)=>{wi.init(t,e),t._zod.optin="defaulted",hn(t,"values",n=>n.def.innerType._zod.values),t._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=e.defaultValue),e.innerType._zod.run(n,i))}),yse=we("$ZodNonOptional",(t,e)=>{wi.init(t,e),hn(t,"values",n=>{const i=n.def.innerType._zod.values;return i?new Set([...i].filter(r=>r!==void 0)):void 0}),t._zod.parse=(n,i)=>{const r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>J3(o,t)):J3(r,t)}});function J3(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}function X3(t,e,n,i){return e.issues.length?(t.value=n.catchValue({...e,value:t.value,error:{issues:e.issues.map(r=>yf(r,i,mc()))},input:t.value}),t):(t.value=e.value,e.memo&&(t.memo=!0),t)}const _se=we("$ZodCatch",(t,e)=>{wi.init(t,e),hn(t,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),hn(t,"optout",n=>n.def.innerType._zod.optout),hn(t,"values",n=>n.def.innerType._zod.values),t._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);const r=e.innerType._zod.run({value:n.value,issues:[]},i);return r instanceof Promise?r.then(o=>X3(n,o,e,i)):X3(n,r,e,i)}}),bse=we("$ZodPipe",(t,e)=>{wi.init(t,e),hn(t,"values",n=>n.def.in._zod.values),hn(t,"optin",n=>n.def.in._zod.optin),hn(t,"optout",n=>n.def.out._zod.optout),hn(t,"propValues",n=>n.def.in._zod.propValues),t._zod.parse=(n,i)=>{if(i.direction==="backward"){const o=e.out._zod.run(n,i);return o instanceof Promise?o.then(l=>H0(l,e.in,i)):H0(o,e.in,i)}const r=e.in._zod.run(n,i);return r instanceof Promise?r.then(o=>H0(o,e.out,i)):H0(r,e.out,i)}});function H0(t,e,n){return t.issues.some(i=>i.code!=="unrecognized_keys")?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},n)}const wse=we("$ZodReadonly",(t,e)=>{wi.init(t,e),hn(t,"propValues",n=>n.def.innerType._zod.propValues),hn(t,"values",n=>n.def.innerType._zod.values),hn(t,"optin",n=>n.def.innerType?._zod?.optin),hn(t,"optout",n=>n.def.innerType?._zod?.optout),t._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);const r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(Y3):Y3(r)}});function Y3(t){return t.memo||(t.value=Object.freeze(t.value)),t}const xse=we("$ZodCustom",(t,e)=>{la.init(t,e),wi.init(t,e),t._zod.parse=(n,i)=>n,t._zod.check=n=>{const i=n.value,r=e.fn(i);if(r instanceof Promise)return r.then(o=>Q3(o,n,i,t));Q3(r,n,i,t)}});function Q3(t,e,n,i){if(!t){const r={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(r.params=i._zod.def.params),e.issues.push(Im(r))}}
76class Sse extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const B2="~memo",eD=[];function T9(t){return t!==null&&typeof t=="object"}function NE(t){return t.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}const C9=new WeakMap,kg=0,V_=1,nm=2;function B_(t,e,n){const i=C9.get(t);if(i!==void 0)return i?nm:kg;if(e.has(t))return nm;e.add(t);let r=kg;const o=p=>{if(r!==nm&&p?._zod){const g=B_(p,e);g>r&&(r=g)}},l=(p,g)=>{let v=kg;for(const y of Reflect.ownKeys(p)){const b=Object.getOwnPropertyDescriptor(p,y);if(!b.enumerable)continue;const x=b.get?V_:b.value?._zod?B_(b.value,e):kg;x>v&&(v=x)}return v},u=p=>{p>r&&(r=p)},d=t._zod.def;switch(d.type){case"object":{const p=r9(d);u(p?l(p):V_),o(d.catchall);break}case"array":o(d.element);break;case"tuple":for(const p of d.items)o(p);o(d.rest);break;case"record":case"map":o(d.keyType),o(d.valueType);break;case"set":o(d.valueType);break;case"union":for(const p of d.options)o(p);break;case"intersection":o(d.left),o(d.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":o(d.innerType);break;case"pipe":o(d.in),o(d.out);break;case"function":o(d.input),o(d.output);break;case"lazy":{const p=d._cachedInner??void 0;u(p?B_(p,e):V_);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const p in d){const g=Object.getOwnPropertyDescriptor(d,p);if(!g||g.get)continue;const v=g.value;if(!(!v||typeof v!="object")){if(v._zod)o(v);else if(Array.isArray(v))for(const y of v)o(y)}}}return e.delete(t),kse(t,r)}function kse(t,e){return e!==V_&&C9.set(t,e===nm),e}function Ese(t,e){let n=t.buckets.get(e);return n||(n=new WeakMap,t.buckets.set(e,n)),n}let K0;const Z0=[],Tse={alloc(t,e,n){const i=K0;if(!i)return n;K0=void 0;const r={value:n,issues:null};return i.set(e.value,r),Z0.push(r),n},guard(t){var e;(e=t._zod).deferred??(e.deferred=[]),t._zod.deferred.push(()=>{const n=t._zod.parse,i=(r,o)=>{if(o.direction!=="backward"&&Ose(o,r.value))throw new Sse;return n(r,o)};t._zod.parse=i,t._zod.run===n&&(t._zod.run=i)})},attach(t){var e;let n,i=!1,r,o;(e=t._zod).deferred??(e.deferred=[]),t._zod.deferred.push(()=>{const l=t._zod.parse,u=(d,f)=>{if(n===void 0){const k=B_(t,new Set);if(k===kg)return t._zod.parse=l,t._zod.run===u&&(t._zod.run=l),l(d,f);k===nm||i?n=!0:i=!0}const p=d.value;if(!T9(p))return l(d,f);let g=f[B2];g||(g={buckets:new WeakMap,backEdges:void 0},f[B2]=g);let v;r===f?v=o:(v=Ese(g,t),r=f,o=v);const y=v.get(p);if(y)return d.value=y.value,y.issues?y.issues.length&&d.issues.push(...NE(y.issues)):(d.memo=!0,g.backEdges??(g.backEdges=new WeakSet),g.backEdges.add(y.value)),d;K0=v;const b=Z0.length,x=l(d,f);K0=void 0;const S=Z0.length>b?Z0.pop():void 0;return x instanceof Promise?x.then(k=>(S&&(S.issues=k.issues.length?NE(k.issues):eD),k)):(S&&(S.issues=x.issues.length?NE(x.issues):eD),x)};t._zod.parse=u,t._zod.run===l&&(t._zod.run=u)})}};function Cse(){return Tse}function Ose(t,e){const n=t[B2]?.backEdges;return n!==void 0&&T9(e)&&n.has(e)}const Rse=()=>{const t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(o){return t[o]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"}
76,i={nan:"NaN"};function r(o,l){return o==="number"&&typeof l=="number"&&!Number.isFinite(l)?String(l):i[o]??o}return o=>{switch(o.code){case"invalid_type":{const l=r(o.expected),u=cie(o.input),d=r(u,o.input);return`Invalid input: expected ${l}, received ${d}`}case"invalid_value":return o.values.length===1?`Invalid input: expected ${c9(o.values[0])}`:`Invalid option: expected one of ${z3(o.values,"|")}`;case"too_big":{const l=o.exact?"exactly ":o.inclusive?"<=":"<",u=e(o.origin);return u?`Too big: expected ${o.origin??"value"} to have ${l}${o.maximum.toString()} ${u.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${l}${o.maximum.toString()}`}case"too_small":{const l=o.exact?"exactly ":o.inclusive?">=":">",u=e(o.origin);return u?`Too small: expected ${o.origin} to have ${l}${o.minimum.toString()} ${u.unit}`:`Too small: expected ${o.origin} to be ${l}${o.minimum.toString()}`}case"invalid_format":{const l=o;return l.format==="starts_with"?`Invalid string: must start with "${l.prefix}"`:l.format==="ends_with"?`Invalid string: must end with "${l.suffix}"`:l.format==="includes"?`Invalid string: must include "${l.includes}"`:l.format==="regex"?`Invalid string: must match pattern ${l.pattern}`:`Invalid ${n[l.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${z3(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return o.options&&Array.isArray(o.options)&&o.options.length>0?`Invalid discriminator value. Expected ${o.options.map(u=>`'${u}'`).join(" | ")}`:o.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function $se(){return{localeError:Rse()}}var tD;class Ase{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...n){const i=n[0];return this._map.set(e,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const n=this._map.get(e);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){const n=e._zod.parent;if(n){const i={...this.get(n)??{}};delete i.id;const r={...i,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function jse(){return new Ase}(tD=globalThis).__zod_globalRegistry??(tD.__zod_globalRegistry=jse());const Eg=globalThis.__zod_globalRegistry;function Pse(t){return t.checks&&(t.checks=[...t.checks]),t}function Nse(t,e){return new t(Pse({type:"string",...gt(e)}))}function Mse(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...gt(e)})}function Ise(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...gt(e)})}function zse(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...gt(e)})}function Dse(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...gt(e)})}function Lse(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...gt(e)})}function Use(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...gt(e)})}function Fse(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...gt(e)})}function Hse(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...gt(e)})}function Kse(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...gt(e)})}function Zse(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...gt(e)})}function Wse(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...gt(e)})}function qse(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...gt(e)})}function Vse(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...gt(e)})}function Bse(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...gt(e)})}function Gse(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...gt(e)})}function Jse(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...gt(e)})}function Xse(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...gt(e)})}function Yse(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...gt(e)})}function Qse(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...gt(e)})}function eoe(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...gt(e)})}function toe(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...gt(e)})}function noe(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...gt(e)})}function ioe(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...gt(e)})}function roe(t,e){return new t({type:"string",format:"date",check:"string_format",...gt(e)})}function soe(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...gt(e)})}function ooe(t,e){return new t({type:"string",format:"duration",check:"string_format",...gt(e)})}function aoe(t){return new t({type:"unknown"})}function loe(t,e){return new t({type:"never",...gt(e)})}function O9(t,e){return new fre({check:"max_length",...gt(e),maximum:t})}function nw(t,e){return new pre({check:"min_length",...gt(e),minimum:t})}function R9(t,e){return new gre({check:"length_equals",...gt(e),length:t})}function coe(t,e){return new mre({check:"string_format",format:"regex",...gt(e),pattern:t})}function uoe(t){return new vre({check:"string_format",format:"lowercase",...gt(t)})}function doe(t){return new yre({check:"string_format",format:"up
76percase",...gt(t)})}function hoe(t,e){return new _re({check:"string_format",format:"includes",...gt(e),includes:t})}function foe(t,e){return new bre({check:"string_format",format:"starts_with",...gt(e),prefix:t})}function poe(t,e){return new wre({check:"string_format",format:"ends_with",...gt(e),suffix:t})}function _f(t){return new xre({check:"overwrite",tx:t})}function goe(t){return _f(e=>e.normalize(t))}function moe(){return _f(t=>t.trim())}function voe(){return _f(t=>t.toLowerCase())}function yoe(){return _f(t=>t.toUpperCase())}function _oe(){return _f(t=>Gne(t))}function boe(t,e,n){return new t({type:"array",element:e,...gt(n)})}function woe(t,e,n){return new t({type:"custom",check:"custom",fn:e,...gt(n)})}function xoe(t,e){const n=Soe(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(Im(r,i.value,n._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),"input"in o||(o.input=i.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),i.issues.push(Im(o))}},t(i.value,i)),e);return n}function Soe(t,e){const n=new la({check:"custom",...gt(e)});return n._zod.check=t,n}function im(t,...e){for(const n of e)for(const i of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,i)&&Wu(t,i,n[i]);return t}function $9(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??Eg,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:t?.cycles??"ref",reused:t?.reused??"inline",intersections:[],deferred:[],external:t?.external??void 0}}function gv(t,e,n,i,r){const o=typeof e.unrepresentable=="function"?e.unrepresentable({zodSchema:t,path:i.path,message:r}):e.unrepresentable;if(o==="any")return!1;if(o===void 0||o==="throw")throw new Error(r);return Object.assign(n,o),!0}function Qi(t,e,n={path:[],schemaPath:[]}){var i;const r=t._zod.def,o=e.seen.get(t);if(o)return o.count++,n.schemaPath.includes(t)&&(o.cycle=n.path),o.schema;const l={schema:{},count:1,cycle:void 0,path:n.path};e.seen.set(t,l),e.sharedDefsExtractedFor=void 0,e.sharedEmitDoneFor=void 0;const u=t._zod.toJSONSchema?.();if(u)l.schema=u;else{const p={...n,schemaPath:[...n.schemaPath,t],path:n.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,l.schema,p);else{const v=l.schema,y=e.processors[r.type];if(!y)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);y(t,e,v,p)}const g=t._zod.parent;g&&(l.ref||(l.ref=g),Qi(g,e,p),e.seen.get(g).isParent=!0)}const d=e.metadataRegistry.get(t);return d&&im(l.schema,d),e.io==="input"&&wr(t)&&(delete l.schema.examples,delete l.schema.default),e.io==="input"&&"_prefault"in l.schema&&((i=l.schema).default??(i.default=l.schema._prefault)),delete l.schema._prefault,e.seen.get(t).schema}function nD(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}function A9(t,e){const n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(t.external&&t.sharedDefsExtractedFor===t.external)return;const i=new Map;for(const l of t.seen.entries()){const u=t.metadataRegistry.get(l[0])?.id;if(u){const d=i.get(u);if(d&&d!==l[0])throw new Error(`Duplicate schema id "${u}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(u,l[0])}}const r=l=>{const u=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){const g=t.external.registry.get(l[0])?.id,v=t.external.uri??(b=>b);if(g)return{ref:v(g)};const y=l[1].defId??l[1].schema.id??`schema${t.counter++}`;return l[1].defId=y,{defId:y,ref:`${v("__shared")}#/${u}/${nD(y)}`}}const d="#",f=`${d}/${u}/`;if(l[1]===n&&!l[1].schema.id)return{ref:d};const p=l[1].schema.id??`__schema${t.counter++}`;return{defId:p,ref:f+nD(p)}},o=l=>{if(l[1].schema.$ref)return;const u=l[1],{ref:d,defId:f}=r(l);u.def={...u.schema},f&&(u.defId=f);const p=u.schema;for(const g in p)delete p[g];p.$ref=d};if(t.cycles==="throw")for(const l of t.seen.entries()){const u=l[1];if(u.cycle)throw new Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
77
78Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of t.seen.entries()){const u=l[1];if(e===l[0]){o(l);continue}if(t.external){const f=t.external.registry.get(l[0])?.id;if(e!==l[0]&&f){o(l);continue}}if(t.metadataRegistry.get(l[0])?.id){o(l);continue}if(u.cycle){o(l);continue}u.count>1&&t.reused==="ref"&&o(l)}t.external&&(t.sharedDefsExtractedFor=t.external)}function j9(t){const e=t.anyOf;if(!Array.isArray(e)||e.length===0||t.type!==void 0)return;const n=[];for(const i of e){if(!i||typeof i!="object")return;j9(i);const r=Object.keys(i);if(r.length!==1||r[0]!=="type")return;const o=i.type;for(const l of Array.isArray(o)?o:[o]){if(typeof l!="string")return;n.includes(l)||n.push(l)}}delete t.anyOf,t.type=n.length===1?n[0]:n}const P9=new Set(["type","properties","required","additionalProperties"]),iD=["oneOf","anyOf"];function rD(t){const e=t.additionalProperties;return e===void 0||e===!1||typeof e!="object"||e===null?null:Object.keys(e).length?e:null}function G2(t){const e=[];for(const o of t){if(typeof o!="object"||o.type!=="object")return null;for(const l in o)if(!P9.has(l))return null;e.push(o)}const n={},i=new Set;for(const o of e){for(const l in o.properties){if(Object.prototype.hasOwnProperty.call(n,l))continue;const u=[];for(const f of e){const p=f.properties?.[l]??rD(f);p!=null&&(u.some(g=>JSON.stringify(g)===JSON.stringify(p))||u.push(p))}const d=u.length===1?u[0]:G2(u)??{allOf:u};Wu(n,l,d)}for(const l of o.required??[])i.add(l)}const r={type:"object",properties:n};if(i.size&&(r.required=[...i]),e.every(o=>o.additionalProperties===!1))r.additionalProperties=!1;else{const o=[];for(const l of e){const u=rD(l);u&&!o.some(d=>JSON.stringify(d)===JSON.stringify(u))&&o.push(u)}o.length===1?r.additionalProperties=o[0]:o.length>1&&(r.additionalProperties={allOf:o})}return r}function koe(t){const e=t.allOf;if(!Array.isArray(e)||e.length<2)return;for(const r of P9)if(r in t)return;const n=e.filter(r=>iD.some(o=>Array.isArray(r[o])));let i=null;if(!n.length)i=G2(e);else{const r=n[0],o=iD.find(d=>Array.isArray(r[d]));if(Object.keys(r).length!==1)return;const l=e.filter(d=>
78d!==r),u=r[o].map(d=>G2([...l,d]));if(u.some(d=>!d))return;i={[o]:u}}i&&(delete t.allOf,im(t,i))}function N9(t,e){const n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=u=>{const d=t.seen.get(u);if(d.ref===null)return;const f=d.def??d.schema,p={...f},g=d.ref;if(d.ref=null,g){i(g);const y=t.seen.get(g),b=y.schema;if(b.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(f.allOf=f.allOf??[],f.allOf.push(b)):im(f,b),im(f,p),u._zod.parent===g)for(const S in f)S==="$ref"||S==="allOf"||S in p||delete f[S];if(b.$ref&&y.def)for(const S in f)S==="$ref"||S==="allOf"||S in y.def&&JSON.stringify(f[S])===JSON.stringify(y.def[S])&&delete f[S]}const v=u._zod.parent;if(v&&v!==g){i(v);const y=t.seen.get(v);if(y?.schema.$ref&&(f.$ref=y.schema.$ref,y.def))for(const b in f)b==="$ref"||b==="allOf"||b in y.def&&JSON.stringify(f[b])===JSON.stringify(y.def[b])&&delete f[b]}t.override({zodSchema:u,jsonSchema:f,path:d.path??[]})};if(!t.external||t.sharedEmitDoneFor!==t.external){for(const u of[...t.seen.entries()].reverse())i(u[0]);if(t.target!=="openapi-3.0")for(const u of t.seen.entries())j9(u[1].def??u[1].schema);for(const u of t.deferred)u();if(t.intersections.length){const u=new Map;for(const d of t.seen.values())for(const f of[d.schema,d.def]){const p=f?.allOf;if(!Array.isArray(p))continue;const g=u.get(p);g?g.push(f):u.set(p,[f])}for(const d of t.intersections)for(const f of u.get(d)??[])koe(f)}}const r={};if(t.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){const u=t.external.registry.get(e)?.id;if(!u)throw new Error("Schema is missing an `id` property");r.$id=t.external.uri(u)}im(r,n.defId?n.schema:n.def??n.schema);const o=t.metadataRegistry.get(e)?.id;o!==void 0&&r.id===o&&delete r.id;const l=t.external?.defs??{};if(!t.external||t.sharedEmitDoneFor!==t.external)for(const u of t.seen.entries()){const d=u[1];d.def&&d.defId&&(d.def.id===d.defId&&delete d.def.id,Wu(l,d.defId,d.def))}t.external&&(t.sharedEmitDoneFor=t.external),t.external||Object.keys(l).length>0&&(t.target==="draft-2020-12"?r.$defs=l:r.definitions=l);try{const u=JSON.parse(JSON.stringify(r));return Object.defineProperty(u,"~standard",{value:{...e["~standard"],jsonSchema:{input:iw(e,"input",t.processors),output:iw(e,"output",t.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function wr(t,e){const n=e??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);const i=t._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return wr(i.element,n);if(i.type==="set")return wr(i.valueType,n);if(i.type==="lazy")return wr(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault"||i.type==="catch")return wr(i.innerType,n);if(i.type==="intersection")return wr(i.left,n)||wr(i.right,n);if(i.type==="record"||i.type==="map")return wr(i.keyType,n)||wr(i.valueType,n);if(i.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:wr(i.in,n)||wr(i.out,n);if(i.type==="object"){for(const r in i.shape)if(wr(i.shape[r],n))return!0;return!1}if(i.type==="union"){for(const r of i.options)if(wr(r,n))return!0;return!1}if(i.type==="tuple"){for(const r of i.items)if(wr(r,n))return!0;return!!(i.rest&&wr(i.rest,n))}return!1}const Eoe=(t,e={})=>n=>{const i=$9({...n,processors:e});return Qi(t,i),A9(i,t),N9(i,t)},iw=(t,e,n={})=>i=>{const{libraryOptions:r,target:o}=i??{},l=$9({...r??{},target:o,io:e,processors:n});return Qi(t,l),A9(l,t),N9(l,t)},rf=(t,e,n)=>{(t[e]===void 0||n>t[e])&&(t[e]=n)},sf=(t,e,n)=>{(t[e]===void 0||n<t[e])&&(t[e]=n)},sD=(t,e)=>{rf(t,"minimum",e),sf(t,"maximum",e)},M9=(t,e)=>{t.multipleOf??(t.multipleOf=[]),t.multipleOf.includes(e)||t.multipleOf.push(e)},I9=(t,e)=>{t.patterns??(t.patterns=new Set),t.patterns.add(e)},z9=(t,e)=>{t.mime=t.mime?t.mime.filter(n=>e.includes(n)):[...e]},D9=(t,e)=>{t.format=e,e.includes("int")&&(t.isInt=!0)},oD=(t,e)=>rf(t,"minimum",e.minimum),aD=(t,e)=>sf(t,"maximum",e.maximum),lD=t=>(e,n)=>{D9(e,n.format);const[i,r]=t[n.format];
78rf(e,"minimum",i),sf(e,"maximum",r)},Toe={greater_than:(t,e)=>rf(t,e.inclusive?"minimum":"exclusiveMinimum",e.value),less_than:(t,e)=>sf(t,e.inclusive?"maximum":"exclusiveMaximum",e.value),multiple_of:(t,e)=>M9(t,e.value),number_format:lD(Qne),bigint_format:lD(eie),min_length:oD,max_length:aD,length_equals:(t,e)=>sD(t,e.length),min_size:oD,max_size:aD,size_equals:(t,e)=>sD(t,e.size),string_format:(t,e)=>{D9(t,e.format),e.pattern&&I9(t,e.pattern),(e.format==="base64"||e.format==="base64url")&&(t.contentEncoding=e.format),(e.local||e.precision===-1)&&(t.laxFormat=!0)},mime_type:(t,e)=>z9(t,e.mime)};function rm(t){const e={},n=t._zod.def,i=t._zod.traits.has("$ZodCheck")?[t,...n.checks??[]]:n.checks??[];for(const o of i)Toe[o._zod.def.check]?.(e,o._zod.def);const r=t._zod.bag;r.minimum!==void 0&&rf(e,"minimum",r.minimum),r.exclusiveMinimum!==void 0&&rf(e,"exclusiveMinimum",r.exclusiveMinimum),r.maximum!==void 0&&sf(e,"maximum",r.maximum),r.exclusiveMaximum!==void 0&&sf(e,"exclusiveMaximum",r.exclusiveMaximum),r.multipleOf!==void 0&&M9(e,r.multipleOf),r.format!==void 0&&(e.format??(e.format=r.format),r.format.includes("int")&&(e.isInt=!0)),r.mime&&z9(e,r.mime);for(const o of r.patterns??[])I9(e,o);return e}const Coe={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ooe=new Map([[x9,nre],[nR,ire]]),Roe=t=>Ooe.get(t)??t,$oe=(t,e,n,i)=>{const r=n;r.type="string";const{minimum:o,maximum:l,format:u,patterns:d,contentEncoding:f,laxFormat:p}=rm(t);if(typeof o=="number"&&(r.minLength=o),typeof l=="number"&&(r.maxLength=l),u&&(r.format=Coe[u]??u,r.format===""&&delete r.format,(u==="time"||p)&&delete r.format),f&&(r.contentEncoding=f),d&&d.size>0){const g=[...d].map(Roe);g.length===1?r.pattern=g[0].source:g.length>1&&(r.allOf=[...g.map(v=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},Aoe=(t,e,n,i)=>{n.not={}},joe=(t,e,n,i)=>{},Poe=(t,e,n,i)=>{const r=t._zod.def,o=Z2(r.entries);if(o.length===0){n.not={};return}o.every(l=>typeof l=="number")&&(n.type="number"),o.every(l=>typeof l=="string")&&(n.type="string"),n.enum=o},Noe=(t,e,n,i)=>{gv(t,e,n,i,"Custom types cannot be represented in JSON Schema")},Moe=(t,e,n,i)=>{gv(t,e,n,i,"Transforms cannot be represented in JSON Schema")},Ioe=(t,e,n,i)=>{const r=n,o=t._zod.def,{minimum:l,maximum:u}=rm(t);typeof l=="number"&&(r.minItems=l),typeof u=="number"&&(r.maxItems=u),r.type="array",r.items=Qi(o.element,e,{...i,path:[...i.path,"items"]})};function J2(t){const e=t._zod.def;return e.type==="pipe"&&e.in._zod.traits.has("$ZodTransform")?J2(e.out):e.type==="catch"?J2(e.innerType):t._zod.optin}const zoe=(t,e,n,i)=>{const r=n,o=t._zod.def,l=o.shape;if(Object.getOwnPropertySymbols(l).length&&gv(t,e,r,i,"Symbol keys cannot be represented in JSON Schema"))return;r.type="object",r.properties={};for(const f in l)Wu(r.properties,f,Qi(l[f],e,{...i,path:[...i.path,"properties",f]}));const d=[];for(const f of Object.keys(l)){const p=o.shape[f];(e.io==="input"?J2(p)===void 0:p._zod.optout===void 0)&&d.push(f)}
vendor: 4,784 bytes, line 78
78d.length>0&&(r.required=d),o.catchall?._zod.def.type==="never"?r.additionalProperties=!1:o.catchall?o.catchall&&(r.additionalProperties=Qi(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(r.additionalProperties=!1)},Doe=(t,e,n,i)=>{const r=t._zod.def,o=r.inclusive===!1,l=r.options.map((u,d)=>Qi(u,e,{...i,path:[...i.path,o?"oneOf":"anyOf",d]}));o?n.oneOf=l:n.anyOf=l},Loe=(t,e,n,i)=>{const r=t._zod.def,o=Qi(r.left,e,{...i,path:[...i.path,"allOf",0]}),l=Qi(r.right,e,{...i,path:[...i.path,"allOf",1]}),u=f=>"allOf"in f&&Object.keys(f).length===1,d=[...u(o)?o.allOf:[o],...u(l)?l.allOf:[l]];n.allOf=d,e.intersections.push(d)},Uoe=(t,e,n,i)=>{const r=t._zod.def,o=Qi(r.innerType,e,i),l=e.seen.get(t);e.target==="openapi-3.0"?(l.ref=r.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},Foe=(t,e,n,i)=>{const r=t._zod.def;Qi(r.innerType,e,i);const o=e.seen.get(t);o.ref=r.innerType},iR=Symbol();function L9(t,e,n,i,r){let o=!1;const l=JSON.stringify(t,(u,d)=>typeof d!="bigint"?d:(o=!0,null));return o?(gv(e,n,i,r,"BigInt defaults cannot be represented in JSON Schema"),iR):JSON.parse(l)}const Hoe=(t,e,n,i)=>{const r=t._zod.def;Qi(r.innerType,e,i);const o=e.seen.get(t);o.ref=r.innerType;const l=L9(r.defaultValue,t,e,n,i);l!==iR&&(n.default=l)},Koe=(t,e,n,i)=>{const r=t._zod.def;Qi(r.innerType,e,i);const o=e.seen.get(t);if(o.ref=r.innerType,e.io!=="input")return;const l=L9(r.defaultValue,t,e,n,i);l!==iR&&(n._prefault=l)},Zoe=(t,e,n,i)=>{const r=t._zod.def;Qi(r.innerType,e,i);const o=e.seen.get(t);o.ref=r.innerType;let l;try{l=r.catchValue(void 0)}catch{gv(t,e,n,i,"Dynamic catch values are not supported in JSON Schema");return}n.default=l},Woe=(t,e,n,i)=>{const r=t._zod.def,o=r.in._zod.traits.has("$ZodTransform"),l=e.io==="input"?o?r.out:r.in:r.out;Qi(l,e,i);const u=e.seen.get(t);u.ref=l},qoe=(t,e,n,i)=>{const r=t._zod.def;Qi(r.innerType,e,i);const o=e.seen.get(t);o.ref=r.innerType,n.readOnly=!0},U9=(t,e,n,i)=>{const r=t._zod.def;Qi(r.innerType,e,i);const o=e.seen.get(t);o.ref=r.innerType},cD=new WeakSet([Object.prototype,Error.prototype]);function W0(t,e,n){Object.defineProperty(t,e,{configurable:!0,enumerable:!1,get(){const i=n(this);return Object.defineProperty(this,e,{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,e,{value:i,configurable:!0,writable:!0})}})}const Voe=(t,e)=>{Sie.init(t,e),t.name="ZodError";const n=Object.getPrototypeOf(t);cD.has(n)||(cD.add(n),W0(n,"format",i=>r=>Tie(i,r)),W0(n,"flatten",i=>r=>Eie(i,r)),W0(n,"addIssue",i=>r=>{i.issues.push(r),i.message=JSON.stringify(i.issues,W2,2)}),W0(n,"addIssues",i=>r=>{i.issues.push(...r),i.message=JSON.stringify(i.issues,W2,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Vs=we("ZodError",Voe,void 0,{Parent:Error}),Boe=JO(Vs),Goe=XO(Vs),Joe=YO(Vs),Xoe=QO(Vs),Yoe=jie(Vs),Qoe=Pie(Vs),eae=Nie(Vs),tae=Mie(Vs),nae=Iie(Vs),iae=zie(Vs),rae=Die(Vs),sae=Lie(Vs);function oae(){ra.localeError||mc($se())}function rR(){ra.memoizer||mc({memoizer:Cse()})}const xi=we("ZodType",(t,e)=>(oae(),wi.init(t,e),t.def=e,t.type=e.type,t),{check(...t){const e=this.def;return this.clone(hs(e,{checks:[...e.checks??[],...t.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...t){return this.check(...t)},clone(t,e){return gc(this,t,e)},brand(){return this},register(t,e){return t.add(this,e),this},refine(t,e){return this.check(rle(t,e))},superRefine(t,e){return this.check(sle(t,e))},overwrite(t){return this.check(_f(t))},optional(){return dD(this)},exactOptional(){return Wae(this)},nullable(){return hD(this)},nullish(){return dD(hD(this))},nonoptional(t){return Xae(this,t)},array(){return Mae(this)},or(t){return Lae([this,t])},and(t){return Fae(this,t)},transform(t){return fD(this,Zae(t))},default(t){return Bae(this,t)},prefault(t){return Jae(this,t)},catch(t){return Qae(this,t)},pipe(t){return fD(this,t)},readonly(){return nle(this)},describe(t){const e=this.clone();return Eg.add(e,{description:t}),e},meta(...t){if(t.length===0)return Eg.get(this);const e=this.clone();return Eg.add(e,t[0]),e},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(t,...e){return e.length===0?t(this):t(this,...e)},get"~standard"(){return h9(this,"~standard",{...v9(this),jsonSchema:{input:iw(this,"input"),output:iw(this,"output")}})},set"~standard"(t){fc(this,"~standard",t)},parse:function t(e,n){return Boe(this,e,n,{callee:t})},parseAsync:async function t(e,n){return await Goe(this,e,n,{callee:t})},safeParse(t,e){return Joe(this,t,e)},async safeParseAsync(t,e){return Xoe(this,t,e)},get spa(){return this?.safeParseAsync},set spa(t){fc(this,"spa",t)},validate(t,e){return Rie(this,t,e)}
78,validateAsync(t,e){return Aie(this,t,e)},encode:function t(e,n){return Yoe(this,e,n,{callee:t})},decode:function t(e,n){return Qoe(this,e,n,{callee:t})},encodeAsync:async function t(e,n){return await eae(this,e,n,{callee:t})},decodeAsync:async function t(e,n){return await tae(this,e,n,{callee:t})},safeEncode(t,e){return nae(this,t,e)},safeDecode(t,e){return iae(this,t,e)},async safeEncodeAsync(t,e){return rae(this,t,e)},async safeDecodeAsync(t,e){return sae(this,t,e)},toJSONSchema(t){return Eoe(this,{})(t)},get description(){return Eg.get(this)?.description},get _def(){return this._zod.def}}),F9=we("_ZodString",(t,e)=>{tR.init(t,e),xi.init(t,e),t._zod.processJSONSchema=(n,i,r)=>$oe(t,n,i)},die({format:t=>rm(t).format??null,minLength:t=>rm(t).minimum??null,maxLength:t=>rm(t).maximum??null},{regex(...t){return this.check(coe(...t))},includes(...t){return this.check(hoe(...t))},startsWith(...t){return this.check(foe(...t))},endsWith(...t){return this.check(poe(...t))},min(...t){return this.check(nw(...t))},max(...t){return this.check(O9(...t))},length(...t){return this.check(R9(...t))},nonempty(...t){return this.check(nw(1,...t))},lowercase(t){return this.check(uoe(t))},uppercase(t){return this.check(doe(t))},trim(){return this.check(moe())},normalize(...t){return this.check(goe(...t))},toLowerCase(){return this.check(voe())},toUpperCase(){return this.check(yoe())},slugify(){return this.check(_oe())}})),aae=we("ZodString",(t,e)=>{tR.init(t,e),F9.init(t,e)},{email(t){return this.check(Mse(fae,t))},url(t){return this.check(Fse(gae,t))},jwt(t){return this.check(noe($ae,t))},emoji(t){return this.check(Hse(mae,t))},guid(t){return this.check(Ise(pae,t))},uuid(t){return this.check(zse(q0,t))},uuidv4(t){return this.check(Dse(q0,t))},uuidv6(t){return this.check(Lse(q0,t))},uuidv7(t){return this.check(Use(q0,t))},nanoid(t){return this.check(Kse(vae,t))},cuid(t){return this.check(Zse(yae,t))},cuid2(t){return this.check(Wse(_ae,t))},ulid(t){return this.check(qse(bae,t))},base64(t){return this.check(Qse(Cae,t))},base64url(t){return this.check(eoe(Oae,t))},xid(t){return this.check(Vse(wae,t))},ksuid(t){return this.check(Bse(xae,t))},ipv4(t){return this.check(Gse(Sae,t))},ipv6(t){return this.check(Jse(kae,t))},cidrv4(t){return this.check(Xse(Eae,t))},cidrv6(t){return this.check(Yse(Tae,t))},e164(t){return this.check(toe(Rae,t))},datetime(t){return this.check(ioe(cae,t))},date(t){return this.check(roe(uae,t))},time(t){return this.check(soe(dae,t))},duration(t){return this.check(ooe(hae,t))}});function lae(t){return Nse(aae,t)}const Vn=we("ZodStringFormat",(t,e)=>{Hn.init(t,e),F9.init(t,e)}),cae=we("ZodISODateTime",(t,e)=>{Hre.init(t,e),Vn.init(t,e)}),uae=we("ZodISODate",(t,e)=>{Kre.init(t,e),Vn.init(t,e)}),dae=we("ZodISOTime",(t,e)=>{Zre.init(t,e),Vn.init(t,e)}),hae=we("ZodISODuration",(t,e)=>{Wre.init(t,e),Vn.init(t,e)}),fae=we("ZodEmail",(t,e)=>{Ore.init(t,e),Vn.init(t,e)}),pae=we("ZodGUID",(t,e)=>{Tre.init(t,e),Vn.init(t,e)}),q0=we("ZodUUID",(t,e)=>{Cre.init(t,e),Vn.init(t,e)}),gae=we("ZodURL",(t,e)=>{Nre.init(t,e),Vn.init(t,e)}),mae=we("ZodEmoji",(t,e)=>{Mre.init(t,e),Vn.init(t,e)}),vae=we("ZodNanoID",(t,e)=>{Ire.init(t,e),Vn.init(t,e)}),yae=we("ZodCUID",(t,e)=>{zre.init(t,e),Vn.init(t,e)}),_ae=we("ZodCUID2",(t,e)=>{Dre.init(t,e),Vn.init(t,e)}),bae=we("ZodULID",(t,e)=>{Lre.init(t,e),Vn.init(t,e)}),wae=we("ZodXID",(t,e)=>{Ure.init(t,e),Vn.init(t,e)}),xae=we("ZodKSUID",(t,e)=>{Fre.init(t,e),Vn.init(t,e)}),Sae=we("ZodIPv4",(t,e)=>{qre.init(t,e),Vn.init(t,e)}),kae=we("ZodIPv6",(t,e)=>{Bre.init(t,e),Vn.init(t,e)}),Eae=we("ZodCIDRv4",(t,e)=>{Gre.init(t,e),Vn.init(t,e)}),Tae=we("ZodCIDRv6",(t,e)=>{Xre.init(t,e),Vn.init(t,e)}),Cae=we("ZodBase64",(t,e)=>{Yre.init(t,e),Vn.init(t,e)}),Oae=we("ZodBase64URL",(t,e)=>{ese.init(t,e),Vn.init(t,e)}),Rae=we("ZodE164",(t,e)=>{tse.init(t,e),Vn.init(t,e)}),$ae=we("ZodJWT",(t,e)=>{ise.init(t,e),Vn.init(t,e)}),Aae=we("ZodUnknown",(t,e)=>{rse.init(t,e),xi.init(t,e),t._zod.processJSONSchema=(n,i,r)=>joe()});function uD(){return aoe(Aae)}const jae=we("ZodNever",(t,e)=>{sse.init(t,e),xi.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Aoe(t,n,i)});function Pae(t){return loe(jae,t)}const Nae=we("ZodArray",(t,e)=>{rR(),ose.init(t,e),xi.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ioe(t,n,i,r),t.element=e.element},{min(t,e){return this.check(nw(t,e))},nonempty(t){return this.check(nw(1,t))},max(t,e){return this.check(O9(t,e))},length(t,e){return this.check(R9(t,e))},unwrap(){return this.element}});function Mae(t,e){return boe(Nae,t,e)}const Iae=we("ZodObject",(t,e)=>{rR(),cse.init(t,e),xi.init(t,e),t._zod.processJSONSchema=(n,i,r)=>zoe(t,n,i,r),gie(t,"shape",n=>n._zod.def.shape,!1)},{keyof(){return Hae(Object.keys(this._zod.def.shape))},catchall(t){return this.clone(hs(this._zod.def,{catchall:t}))},passthrough(){return this.clone(hs(this._zod.def,{catchall:uD()}))},loose(){return this.clone(hs(this._zod.def,{catchall:uD()}))},strict(){return this.clone(hs(this._zod.def,{catchall:Pae()}))},strip(){return this.clone(hs(this._zod.def,{catchall:void 0}))},extend(t){return iie(this,t)},safeExtend(t){return rie(this,t)},merge(t){return sie(this,t)},pick(t){return tie(this,t)},omit(t){return nie(this,t)},partial(...t){return D3(H9,this,t[0])},exactPartial(...t){return D3(K9,this,t[0],"exactPartial")},required(...t){return oie(Z9,this,t[0])}});function zae(t,e){const n={type:"object",shape:t??{},...gt(e)};return new Iae(n)}const Dae=we("ZodUnion",(t,e)=>{use.init(t,e),xi.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Doe(t,n,i,r),t.options=e.options});function Lae(t,e){return new Dae({type:"union",options:t,...gt(e)})}const Uae=we("ZodIntersection",(t,e)=>{dse.init(t,e),xi.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Loe(t,n,i,r)});function Fae(t,e){return new Uae({type:"intersection",left:t,right:e})}const X2=we("ZodEnum",(t,e)=>{hse.init(t,e),xi.init(t,e),t._zod.processJSONSchema=(i,r,o)=>
78Poe(t,i,r),t.enum=e.entries,t.options=[...t._zod.values];const n=new Set(Object.keys(e.entries));t.extract=(i,r)=>{const o={};for(const l of i)if(n.has(l))o[l]=e.entries[l];else throw new Error(`Key ${l} not found in enum`);return new X2({...e,checks:[],...gt(r),entries:o})},t.exclude=(i,r)=>{const o={...e.entries};for(const l of i)if(n.has(l))delete o[l];else throw new Error(`Key ${l} not found in enum`);return new X2({...e,checks:[],...gt(r),entries:o})}});function Hae(t,e){const n=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new X2({type:"enum",entries:n,...gt(e)})}const Kae=we("ZodTransform",(t,e)=>{rR(),fse.init(t,e),xi.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Moe(t,n,i,r),t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new f9(t.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(Im(o,n.value,e));else{const l=o;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),"input"in l||(l.input=n.value),l.inst??(l.inst=t),n.issues.push(Im(l))}};const r=e.transform(n.value,n);return r instanceof Promise?r.then(o=>(n.value=o,n)):(n.value=r,n)}});function Zae(t){return new Kae({type:"transform",transform:t})}const H9=we("ZodOptional",(t,e)=>{E9.init(t,e),xi.init(t,e),t._zod.processJSONSchema=(n,i,r)=>U9(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function dD(t){return new H9({type:"optional",innerType:t})}const K9=we("ZodExactOptional",(t,e)=>{pse.init(t,e),xi.init(t,e),t._zod.processJSONSchema=(n,i,r)=>U9(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function Wae(t){return new K9({type:"optional",innerType:t})}const qae=we("ZodNullable",(t,e)=>{gse.init(t,e),xi.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Uoe(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function hD(t){return new qae({type:"nullable",innerType:t})}const Vae=we("ZodDefault",(t,e)=>{mse.init(t,e),xi.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Hoe(t,n,i,r),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function Bae(t,e){return new Vae({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():l9(e)}})}const Gae=we("ZodPrefault",(t,e)=>{vse.init(t,e),xi.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Koe(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function Jae(t,e){return new Gae({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():l9(e)}})}const Z9=we("ZodNonOptional",(t,e)=>{yse.init(t,e),xi.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Foe(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function Xae(t,e){return new Z9({type:"nonoptional",innerType:t,...gt(e)})}const Yae=we("ZodCatch",(t,e)=>{_se.init(t,e),xi.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Zoe(t,n,i,r),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function Qae(t,e){return new Yae({type:"catch",innerType:t,catchValue:typeof e=="function"?e:vie(e)})}const ele=we("ZodPipe",(t,e)=>{bse.init(t,e),xi.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Woe(t,n,i,r),t.in=e.in,t.out=e.out});function fD(t,e){return new ele({type:"pipe",in:t,out:e})}const tle=we("ZodReadonly",(t,e)=>{wse.init(t,e),xi.init(t,e),t._zod.processJSONSchema=(n,i,r)=>qoe(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function nle(t){return new tle({type:"readonly",innerType:t})}const ile=we("ZodCustom",(t,e)=>{xse.init(t,e),xi.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Noe(t,n,i,r)});function rle(t,e={}){return woe(ile,t,e)}function sle(t,e){return xoe(t,e)}zae({version:lae()});class ole extends M.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,n){console.error("ErrorBoundary caught an error:",e,n),this.props.onError?.(e,n)}componentDidUpdate(e){this.state.hasError&&this.props.resetKeys&&e.resetKeys&&this.props.resetKeys.some((n,i)=>n!==e.resetKeys?.[i])&&this.reset()}
78reset=()=>{this.setState({hasError:!1,error:null})};render(){return this.state.hasError?this.props.fallback?this.props.fallback:w.jsx("div",{className:"flex items-center justify-center h-full w-full p-8",children:w.jsxs("div",{className:"max-w-md w-full bg-red-50 border border-red-200 rounded-lg p-6",children:[w.jsx("h2",{className:"text-xl font-semibold text-red-800 mb-2",children:"Something went wrong"}),w.jsx("p",{className:"text-red-600 mb-4",children:this.state.error?.message||"An unexpected error occurred"}),w.jsx("button",{onClick:this.reset,className:"px-4 py-2 bg-red-600 text-white rounded hover:bg-red-700 transition-colors",children:"Try Again"})]})}):this.props.children}}const W9=M.createContext(void 0),sR=t=>{const e=M.useContext(W9);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},ale=({client:t,children:e})=>(M.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),w.jsx(W9.Provider,{value:t,children:e})),lle={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)};var cle=class{#e=lle;#t=!1;setTimeoutProvider(t){this.#e=t}setTimeout(t,e){return this.#e.setTimeout(t,e)}clearTimeout(t){this.#e.clearTimeout(t)}setInterval(t,e){return this.#e.setInterval(t,e)}clearInterval(t){this.#e.clearInterval(t)}};const bu=new cle;function ule(t){setTimeout(t,0)}const dle=typeof window>"u"||"Deno"in globalThis;function Tr(){}function hle(t,e){return typeof t=="function"?t(e):t}function q9(t){return typeof t=="number"&&t>=0&&t!==1/0}function V9(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Dn(t,e){return typeof t=="function"?t(e):t}function pD(t,e){const{type:n="all",exact:i,fetchStatus:r,predicate:o,queryKey:l,stale:u}=t;if(l){if(i){if(e.queryHash!==oR(l,e.options))return!1}else if(!of(e.queryKey,l))return!1}if(n!=="all"){const d=e.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof u=="boolean"&&e.isStale()!==u||r&&r!==e.state.fetchStatus||o&&!o(e))}function gD(t,e){const{exact:n,status:i,predicate:r,mutationKey:o}=t;if(o){if(!e.options.mutationKey)return!1;if(n){if(Lu(e.options.mutationKey)!==Lu(o))return!1}else if(!of(e.options.mutationKey,o))return!1}return!(i&&e.state.status!==i||r&&!r(e))}function oR(t,e){return(e?.queryKeyHashFn||Lu)(t)}function Lu(t){return JSON.stringify(t,(e,n)=>Y2(n)?Object.keys(n).sort().reduce((i,r)=>(i[r]=n[r],i),{}):n)}function of(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(Array.isArray(t)&&Array.isArray(e)){if(e.length>t.length)return!1;for(let i=0;i<e.length;i++)if(!of(t[i],e[i]))return!1;return!0}const n=Object.keys(e);for(const i of n)if(!of(t[i],e[i]))return!1;return!0}return!1}const fle=Object.prototype.hasOwnProperty;function B9(t,e,n=0){if(t===e)return t;if(n>500)return e;const i=mD(t)&&mD(e);if(!i&&!(Y2(t)&&Y2(e)))return e;const r=(i?t:Object.keys(t)).length,o=i?e:Object.keys(e),l=o.length,u=i?new Array(l):{};let d=0;for(let f=0;f<l;f++){const p=i?f:o[f],g=t[p],v=e[p];if(g===v){u[p]=g,(i?f<r:fle.call(t,p))&&d++;continue}if(g===null||v===null||typeof g!="object"||typeof v!="object"){u[p]=v;continue}const y=B9(g,v,n+1);u[p]=y,y===g&&d++}return r===l&&d===r?t:u}function G_(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function mD(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Y2(t){if(!vD(t))return!1;const e=Object.getPrototypeOf(t),n=e?.constructor;if(n===void 0)return!0;if(typeof n!="function")return!1;const i=n.prototype;return!(!vD(i)||!i.hasOwnProperty("isPrototypeOf")||e!==Object.prototype)}function vD(t){return Object.prototype.toString.call(t)==="[object Object]"}function ple(t){return new Promise(e=>{bu.setTimeout(e,t)})}function Q2(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?B9(t,e):e}function gle(t,e,n=0){const i=[...t,e];return n&&i.length>n?i.slice(1):i}function mle(t,e,n=0){const i=[e,...t];return n&&i.length>n?i.slice(0,-1):i}const aR=Symbol();function G9(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===aR?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function lR(t,e){return typeof t=="function"?t(...e):!!t}function vle(t,e,n){let i=!1,r;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(r??=e(),i||(i=!0,r.aborted?n():r.addEventListener("abort",n,{once:!0})),r)}),t}let yle=()=>dle;const cR=()=>yle();var bf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},_le=class extends bf{#e;#t;#n;constructor(){super(),this.#n=t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();
78this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}};const uR=new _le,ble=ule;function wle(){let t=[],e=0,n=u=>{u()},i=u=>{u()},r=ble;const o=u=>{e?t.push(u):r(()=>{n(u)})},l=()=>{const u=t;t=[],u.length&&r(()=>{i(()=>{u.forEach(d=>{n(d)})})})};return{batch:u=>{let d;e++;try{d=u()}finally{e--,e||l()}return d},batchCalls:u=>(...d)=>{o(()=>{u(...d)})},schedule:o,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{i=u},setScheduler:u=>{r=u}}}const yi=wle();var xle=class extends bf{#e=!0;#t;#n;constructor(){super(),this.#n=t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(e=>{e(t)}))}isOnline(){return this.#e}};const rw=new xle;function Sle(t){return Math.min(1e3*2**t,3e4)}function J9(t){return(t??"online")==="online"?rw.isOnline():!0}var eC=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function X9(t){let e=!1,n=0,i,r="pending",o,l;const u=new Promise((T,C)=>{o=T,l=C});u.catch(Tr);const d=()=>r!=="pending",f=T=>{if(!d()){const C=new eC(T);x(C),t.onCancel?.(C)}},p=()=>{e=!0},g=()=>{e=!1},v=()=>uR.isFocused()&&(t.networkMode==="always"||rw.isOnline())&&t.canRun(),y=()=>J9(t.networkMode)&&t.canRun(),b=T=>{d()||(i?.(),r="resolved",o(T))},x=T=>{d()||(i?.(),r="rejected",l(T))},S=()=>new Promise(T=>{i=C=>{(d()||v())&&T(C)},t.onPause?.()}).then(()=>{i=void 0,d()||t.onContinue?.()}),k=()=>{if(d())return;let T;const C=n===0?t.initialPromise:void 0;try{T=C??t.fn()}catch(A){T=Promise.reject(A)}Promise.resolve(T).then(b).catch(A=>{if(d())return;const $=t.retry??(cR()?0:3),N=t.retryDelay??Sle,j=typeof N=="function"?N(n,A):N,O=$===!0||typeof $=="number"&&n<$||typeof $=="function"&&$(n,A);if(e||!O){x(A);return}n++,t.onFail?.(n,A),ple(j).then(()=>v()?void 0:S()).then(()=>{e?x(A):k()})})};return{promise:u,status:()=>r,cancel:f,continue:()=>(i?.(),u),cancelRetry:p,continueRetry:g,canStart:y,start:()=>(y()?k():S().then(k),u)}}var Y9=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),q9(this.gcTime)&&(this.#e=bu.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(cR()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(bu.clearTimeout(this.#e),this.#e=void 0)}};function kle(t){return{onFetch:(e,n)=>{const i=e.options,r=e.fetchOptions?.meta?.fetchMore?.direction,o=e.state.data?.pages||[],l=e.state.data?.pageParams||[];let u={pages:[],pageParams:[]},d=0;const f=async()=>{let p=!1;const g=b=>{vle(b,()=>e.signal,()=>p=!0)},v=G9(e.options,e.fetchOptions),y=async(b,x,S)=>{if(p)return Promise.reject(e.signal.reason);if(x==null&&b.pages.length)return Promise.resolve(b);const T=(()=>{const N={client:e.client,queryKey:e.queryKey,pageParam:x,direction:S?"backward":"forward",meta:e.options.meta};return g(N),N})(),C=await v(T),{maxPages:A}=e.options,$=S?mle:gle;return{pages:$(b.pages,C,A),pageParams:$(b.pageParams,x,A)}};if(r&&o.length){const b=r==="backward",x=b?Ele:yD,S={pages:o,pageParams:l};u=await y(S,x(i,S),b)}else{const b=t??o.length;do{const x=d===0?l[0]??i.initialPageParam:yD(i,u);if(d>0&&x==null)break;u=await y(u,x),d++}while(d<b)}return u};e.options.persister?e.fetchFn=()=>e.options.persister?.(f,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n):e.fetchFn=f}}}function yD(t,{pages:e,pageParams:n}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,n[i],n):void 0}function Ele(t,{pages:e,pageParams:n}){return e.length>0?t.getPreviousPageParam?.(e[0],e,n[0],n):void 0}var Tle=class extends Y9{#e;#t;#n;#i;#s;#r;#o;#l;constructor(t){super(),this.#l=!1,this.#o=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#s=t.client,this.#i=this.#s.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#t=bD(this.options),this.state=t.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#r?.promise}setOptions(t){if(this.options={...this.#o,...t},t?._type&&(this.#e=t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=bD(this.options);e.data!==void 0&&(this.setState(_D(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#i.remove(this)}setData(t,e){const n=Q2(this.state.data,t,this.options);return this.#a({data:n,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),n}setState(t){this.#a({type:"setState",state:t})}cancel(t){const e=this.#r?.promise;return this.#r?.cancel(t),e?e.then(Tr).catch(Tr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Dn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===aR||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdate
vendor: 4,711 bytes, line 78
78Count>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Dn(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!V9(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#i.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){const e=this.observers.indexOf(t);e!==-1&&(this.observers.splice(e,1),this.observers.length||(this.#r&&(this.#l||this.state.fetchStatus==="paused"&&this.state.status==="pending"?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#i.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#a({type:"invalidate"})}async fetch(t,e){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(f=>f.options.queryFn);d&&this.setOptions(d.options)}const n=new AbortController,i=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(this.#l=!0,n.signal)})},r=()=>{const d=G9(this.options,e),p=(()=>{const g={client:this.#s,queryKey:this.queryKey,meta:this.meta};return i(g),g})();return this.#l=!1,this.options.persister?this.options.persister(d,p,this):d(p)},l=(()=>{const d={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:r};return i(d),d})();(this.#e==="infinite"?kle(this.options.pages):this.options.behavior)?.onFetch(l,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#a({type:"fetch",meta:l.fetchOptions?.meta});const u=this.#r=X9({initialPromise:e?.initialPromise,fn:l.fetchFn,onCancel:d=>{d instanceof eC&&d.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(d,f)=>{this.#a({type:"failed",failureCount:d,error:f})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{const d=await u.start();if(d===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(d),this.#i.config.onSuccess?.(d,this),this.#i.config.onSettled?.(d,this.state.error,this),d}catch(d){if(d instanceof eC){if(d.silent)return this.#r.promise;if(d.revert){if(this.state.data===void 0)throw d;return this.state.data}}throw this.#a({type:"error",error:d}),this.#i.config.onError?.(d,this),this.#i.config.onSettled?.(this.state.data,d,this),d}finally{this.#r===u&&(this.#r=void 0),this.scheduleGc()}}#a(t){const e=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Q9(n.data,this.options),fetchMeta:t.meta??null};case"success":const i={...n,..._D(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=t.manual?i:void 0,i;case"error":const r=t.error;return{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=e(this.state),yi.batch(()=>{this.observers.slice().forEach(n=>{n.onQueryUpdate()}),this.#i.notify({query:this,type:"updated",action:t})})}};function Q9(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:J9(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function _D(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function bD(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,i=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdate
78Count:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Cle=class extends bf{#e;#t=void 0;#n=void 0;#i=void 0;#s;#r;#o;#l;#a;#f;#u;#d;#c;#p=new Set;constructor(t,e){super(),this.options=e,this.#e=t,this.#o=null,this.bindMethods(),this.setOptions(e)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),wD(this.#t,this.options)?this.#h():this.updateResult(),this.#_())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return tC(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return tC(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#w(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Dn(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#x(),this.#t.setOptions(this.options),e._defaulted&&!G_(this.options,e)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&xD(this.#t,n,this.options,e)&&this.#h(),this.updateResult(),i&&(this.#t!==n||Dn(this.options.enabled,this.#t)!==Dn(e.enabled,this.#t)||Dn(this.options.staleTime,this.#t)!==Dn(e.staleTime,this.#t))&&this.#m();const r=this.#v();i&&(this.#t!==n||Dn(this.options.enabled,this.#t)!==Dn(e.enabled,this.#t)||r!==this.#c)&&this.#y(r)}getOptimisticResult(t){const e=this.#e.getQueryCache().build(this.#e,t),n=this.createResult(e,t);return G_(this.getCurrentResult(),n)||(this.#i=n,this.#r=this.options,this.#s=this.#t.state),n}getCurrentResult(){return this.#i}trackResult(t,e){return new Proxy(t,{get:(n,i)=>(this.trackProp(i),e?.(i),Reflect.get(n,i))})}trackProp(t){this.#p.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#e.defaultQueryOptions(t),n=this.#e.getQueryCache().build(this.#e,e);let i=()=>{},r;const o=new Promise(l=>{r=l,i=this.#e.getQueryCache().subscribe(u=>{u.type==="updated"&&u.query.queryHash===n.queryHash&&n.state.data!==void 0&&(i(),l(this.createResult(n,e)))})});return Promise.race([n.fetch().then(()=>{const l=this.createResult(n,e);return r?.(l),l}).finally(()=>{i()}),o])}fetch(t){return this.#h({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#h(t){this.#x();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(Tr)),e}#g(t){return!cR()&&Dn(this.options.enabled,this.#t)!==!1&&q9(t)}#m(){this.#b();const t=Dn(this.options.staleTime,this.#t);if(this.#i.isStale||!this.#g(t))return;const e=V9(this.#i.dataUpdatedAt,t)+1;this.#u=bu.setTimeout(()=>{this.#i.isStale||this.updateResult()},e)}#v(){return Dn(this.options.refetchInterval,this.#t)??!1}#y(t){this.#w(),this.#c=t,!(this.#c===0||!this.#g(this.#c))&&(this.#d=bu.setInterval(()=>{(this.options.refetchIntervalInBackground||uR.isFocused())&&this.#h()},this.#c))}#_(){this.#m(),this.#y(this.#v())}#b(){this.#u!==void 0&&(bu.clearTimeout(this.#u),this.#u=void 0)}#w(){this.#d!==void 0&&(bu.clearInterval(this.#d),this.#d=void 0)}createResult(t,e){const n=this.#t,i=this.options,r=this.#i,o=this.#s,l=this.#r,u=t!==n?t.state:this.#n,{state:d}=t;let f={...d},p=!1,g;if(e._optimisticResults){const $=this.hasListeners(),N=!$&&wD(t,e),j=$&&xD(t,n,e,i);(N||j)&&(f={...f,...Q9(d.data,t.options)}),e._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:v,errorUpdatedAt:y,status:b}=f;g=f.data;let x=!1;if(e.placeholderData!==void 0&&g===void 0&&b==="pending"){let $;r?.isPlaceholderData&&e.placeholderData===l?.placeholderData?($=r.data,x=!0):$=typeof e.placeholderData=="function"?e.placeholderData(this.#f?.state.data,this.#f):e.placeholderData,$!==void 0&&(b="success",g=Q2(r?.data,$,e),p=!0)}if(e.select&&g!==void 0&&!x)if(r&&g===o?.data&&e.select===this.#l)g=this.#a;else try{this.#l=e.select,g=e.select(g),g=Q2(r?.data,g,e),this.#a=g,this.#o=null}catch($){this.#o=$}else g===void 0&&(this.#o=null);this.#o&&(v=this.#o,g=this.#a,y=Date.now(),b="error",p=!1);const S=f.fetchStatus==="fetching",k=b==="pending",T=b==="error",C=k&&S,A=g!==void 0;return{status:b,fetchStatus:f.fetchStatus,isPending:k,isSuccess:b==="success",isError:T,isInitialLoading:C,isLoading:C,data:g,dataUpdatedAt:f.dataUpdatedAt,error:v,errorUpdatedAt:y,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdate
78Count:f.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:S,isRefetching:S&&!k,isLoadingError:T&&!A,isPaused:f.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:T&&A,isStale:dR(t,e),refetch:this.refetch,isEnabled:Dn(e.enabled,t)!==!1}}updateResult(){const t=this.#i,e=this.createResult(this.#t,this.options);if(this.#s=this.#t.state,this.#r=this.options,this.#s.data!==void 0&&(this.#f=this.#t),G_(e,t))return;this.#i=e;const i=(()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,o=typeof r=="function"?r():r;if(o==="all"||!o&&!this.#p.size)return!0;const l=new Set(o??this.#p);return this.options.throwOnError&&l.add("error"),Object.keys(this.#i).some(u=>{const d=u;return this.#i[d]!==t[d]&&l.has(d)})})();yi.batch(()=>{i&&this.listeners.forEach(r=>{r(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}#x(){const t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#n=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#_()}};function Ole(t,e){return Dn(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&Dn(e.retryOnMount,t)===!1)}function wD(t,e){return Ole(t,e)||t.state.data!==void 0&&tC(t,e,e.refetchOnMount)}function tC(t,e,n){if(Dn(e.enabled,t)!==!1&&Dn(e.staleTime,t)!=="static"){const i=Dn(n,t);return i==="always"||i!==!1&&dR(t,e)}return!1}function xD(t,e,n,i){return(t!==e||Dn(i.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&dR(t,n)}function dR(t,e){return Dn(e.enabled,t)!==!1&&t.isStaleByTime(Dn(e.staleTime,t))}var Rle=class extends Y9{#e;#t;#n;#i;constructor(t){super(),this.#e=t.client,this.mutationId=t.mutationId,this.#n=t.mutationCache,this.#t=[],this.state=t.state||e8(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#t.includes(t)||(this.#t.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#t=this.#t.filter(e=>e!==t),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(t){const e=()=>{this.#s({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},i=this.#i=X9({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(l,u)=>{this.#s({type:"failed",failureCount:l,error:u})},onPause:()=>{this.#s({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),r=this.state.status==="pending",o=!i.canStart();try{if(r)e();else{this.#s({type:"pending",variables:t,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(t,this,n);const u=await this.options.onMutate?.(t,n);u!==this.state.context&&this.#s({type:"pending",context:u,variables:t,isPaused:o})}const l=await i.start();return await this.#n.config.onSuccess?.(l,t,this.state.context,this,n),await this.options.onSuccess?.(l,t,this.state.context,n),await this.#n.config.onSettled?.(l,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(l,null,t,this.state.context,n),this.#s({type:"success",data:l}),l}catch(l){try{await this.#n.config.onError?.(l,t,this.state.context,this,n)}catch(u){Promise.reject(u)}try{await this.options.onError?.(l,t,this.state.context,n)}catch(u){Promise.reject(u)}try{await this.#n.config.onSettled?.(void 0,l,this.state.variables,this.state.context,this,n)}catch(u){Promise.reject(u)}try{await this.options.onSettled?.(void 0,l,t,this.state.context,n)}catch(u){Promise.reject(u)}throw this.#s({type:"error",error:l}),l}finally{this.#i===i&&(this.#i=void 0),this.#n.runNext(this)}}#s(t){const e=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};
vendor: 2,048 bytes, line 78
78case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),yi.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(t)}),this.#n.notify({mutation:this,type:"updated",action:t})})}};function e8(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $le=class extends bf{#e;#t;#n;constructor(t={}){super(),this.config=t,this.#e=new Set,this.#t=new Map,this.#n=0}build(t,e,n){const i=new Rle({client:t,mutationCache:this,mutationId:++this.#n,options:t.defaultMutationOptions(e),state:n});return this.add(i),i}add(t){this.#e.add(t);const e=V0(t);if(typeof e=="string"){const n=this.#t.get(e);n?n.push(t):this.#t.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){const e=V0(t);if(typeof e=="string"){const n=this.#t.get(e);if(n)if(n.length>1){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}else n[0]===t&&this.#t.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=V0(t);if(typeof e=="string"){const n=this.#t.get(e)?.find(i=>i.state.status==="pending");return!n||n===t}else return!0}runNext(t){const e=V0(t);return typeof e=="string"?this.#t.get(e)?.find(n=>n!==t&&n.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){yi.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(t){const e={exact:!0,...t};return this.getAll().find(n=>gD(e,n))}findAll(t={}){return this.getAll().filter(e=>gD(t,e))}notify(t){yi.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>
78e.state.isPaused);return yi.batch(()=>Promise.all(t.map(e=>e.continue().catch(Tr))))}};function V0(t){return t.options.scope?.id}var Ale=class extends bf{#e;#t=void 0;#n;#i;constructor(e,n){super(),this.#e=e,this.setOptions(n),this.bindMethods(),this.#s()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const n=this.options;this.options=this.#e.defaultMutationOptions(e),G_(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Lu(n.mutationKey)!==Lu(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#s())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#s(),this.#r(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#s(),this.#r()}mutate(e,n){return this.#i=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#s(){const e=this.#n?.state??e8();this.#t={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#r(e){yi.batch(()=>{if(this.#i&&this.hasListeners()){const n=this.#t.variables,i=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#i.onSuccess?.(e.data,n,i,r)}catch(o){Promise.reject(o)}try{this.#i.onSettled?.(e.data,null,n,i,r)}catch(o){Promise.reject(o)}}else if(e?.type==="error"){try{this.#i.onError?.(e.error,n,i,r)}catch(o){Promise.reject(o)}try{this.#i.onSettled?.(void 0,e.error,n,i,r)}catch(o){Promise.reject(o)}}}this.listeners.forEach(n=>{n(this.#t)})})}},jle=class extends bf{#e;constructor(t={}){super(),this.config=t,this.#e=new Map}build(t,e,n){const i=e.queryKey,r=e.queryHash??oR(i,e);let o=this.get(r);return o||(o=new Tle({client:t,queryKey:i,queryHash:r,options:t.defaultQueryOptions(e),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){this.#e.has(t.queryHash)||(this.#e.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){this.#e.get(t.queryHash)===t&&(t.destroy(),this.#e.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){yi.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#e.get(t)}getAll(){return[...this.#e.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(n=>pD(e,n))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(n=>pD(t,n)):e}notify(t){yi.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){yi.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){yi.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ple=class{#e;#t;#n;#i;#s;#r;#o;#l;constructor(t={}){this.#e=t.queryCache||new jle,this.#t=t.mutationCache||new $le,this.#n=t.defaultOptions||{},this.#i=new Map,this.#s=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#o=uR.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#l=rw.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#o?.(),this.#o=void 0,this.#l?.(),this.#l=void 0)}isFetching(t){return this.#e.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#t.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=this.#e.build(this,e),i=n.state.data;return i===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Dn(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return this.#e.findAll(t).map(({queryKey:e,state:n})=>[e,n.data])}setQueryData(t,e,n){const i=this.defaultQueryOptions({queryKey:t}),r=this.#e.get(i.queryHash)?.state.data,o=hle(e,r);if(o!==void 0)return this.#e.build(this,i).setData(o,{...n,manual:!0})}
78setQueriesData(t,e,n){return yi.batch(()=>this.#e.findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,e,n)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state}removeQueries(t){const e=this.#e;yi.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=this.#e;return yi.batch(()=>{const i=n.findAll(t),r=new Set(i);return i.forEach(o=>{o.reset()}),this.refetchQueries({type:"active",predicate:o=>r.has(o)},e)})}cancelQueries(t,e={}){const n={revert:!0,...e},i=yi.batch(()=>this.#e.findAll(t).map(r=>r.cancel(n)));return Promise.all(i).then(Tr).catch(Tr)}invalidateQueries(t,e={}){return yi.batch(()=>(this.#e.findAll(t).forEach(n=>{n.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},i=yi.batch(()=>this.#e.findAll(t).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let o=r.fetch(void 0,n);return n.throwOnError||(o=o.catch(Tr)),r.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(i).then(Tr)}async query(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=this.#e.build(this,e),i=n.isStaleByTime(Dn(e.staleTime,n))?await n.fetch(e):n.state.data,r=e.select;return r?r(i):i}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=this.#e.build(this,e);return n.isStaleByTime(Dn(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Tr).catch(Tr)}infiniteQuery(t){return t._type="infinite",this.query(t)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Tr).catch(Tr)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return rw.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(t){this.#n=t}setQueryDefaults(t,e){this.#i.set(Lu(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#i.values()],n={};return e.forEach(i=>{of(t,i.queryKey)&&Object.assign(n,i.defaultOptions)}),n}setMutationDefaults(t,e){this.#s.set(Lu(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#s.values()],n={};return e.forEach(i=>{of(t,i.mutationKey)&&Object.assign(n,i.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#n.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=oR(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===aR&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#n.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};const t8=M.createContext(!1),Nle=()=>M.useContext(t8);t8.Provider;function Mle(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const Ile=M.createContext(Mle()),zle=()=>M.useContext(Ile),Dle=(t,e,n)=>{const i=n?.state.error&&typeof t.throwOnError=="function"?lR(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||i)&&(e.isReset()||(t.retryOnMount=!1))},Lle=t=>{M.useEffect(()=>{t.clearReset()},[t])},Ule=({result:t,errorResetBoundary:e,throwOnError:n,query:i,suspense:r})=>t.isError&&!e.isReset()&&!t.isFetching&&i&&(r&&t.data===void 0||lR(n,[t.error,i])),Fle=t=>{if(t.suspense){const n=r=>r==="static"?r:Math.max(r??1e3,1e3),i=t.staleTime;t.staleTime=typeof i=="function"?(...r)=>n(i(...r)):n(i),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},Hle=(t,e)=>t?.suspense&&e.isPending,Kle=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function Zle(t,e,n){const i=Nle(),r=zle(),o=sR(),l=o.defaultQueryOptions(t),u=o.getQueryCache().get(l.queryHash),d=t.subscribed!==!1;l._optimisticResults=i?"isRestoring":d?"optimistic":void 0,Fle(l),Dle(l,r,u),Lle(r);
78const[f]=M.useState(()=>new e(o,l)),p=f.getOptimisticResult(l),g=!i&&d;if(M.useSyncExternalStore(M.useCallback(v=>{const y=g?f.subscribe(yi.batchCalls(v)):Tr;return f.updateResult(),y},[f,g]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),M.useEffect(()=>{f.setOptions(l)},[l,f]),Hle(l,p))throw Kle(l,f,r);if(Ule({result:p,errorResetBoundary:r,throwOnError:l.throwOnError,query:u,suspense:l.suspense}))throw p.error;return l.notifyOnChangeProps?p:f.trackResult(p)}function n8(t,e){return Zle(t,Cle)}function Wle(t,e){const n=sR(),[i]=M.useState(()=>new Ale(n,t));M.useEffect(()=>{i.setOptions(t)},[i,t]);const r=M.useSyncExternalStore(M.useCallback(l=>i.subscribe(yi.batchCalls(l)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),o=M.useCallback((...l)=>{i.mutate(l[0],l[1]).catch(Tr)},[i]);if(r.error&&lR(i.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:o,mutateAsync:r.mutate}}const qle=new Ple({defaultOptions:{queries:{staleTime:1e3*60*5,refetchOnWindowFocus:!1,retry:(t,e)=>e instanceof n9&&e.status<500?!1:t<3}}}),Vle=({children:t})=>w.jsx(ale,{client:qle,children:t}),Ble="https://flow.lyster.io",Gle=new Set(["$pageview","$pageleave"]),Jle=["$set","$set_once","$user_id","$device_id"];let J_="undecided";function Xle(t){if(!Gle.has(t.event))return null;const e={...t.properties??{}};for(const n of Jle)delete e[n];return e.$current_url=SD(e.$current_url),e.$referrer=SD(e.$referrer),{...t,properties:e}}function SD(t){if(typeof t!="string"||t==="")return t;const e=t.search(/[?#]/);return e===-1?t:t.slice(0,e)}function Yle({consentStatus:t,features:e={}}){const n=t==="yes";return J_=t,{api_host:Ble,persistence:n?"localStorage+cookie":"memory",ip:!0,advanced_disable_flags:!0,disable_external_dependency_loading:!0,disable_surveys:!0,disable_web_experiments:!0,autocapture:n&&!!e.autocapture,capture_pageview:!0,capture_pageleave:!0,capture_heatmaps:n&&!!e.heatmaps,disable_session_recording:!(n&&e.sessionRecording),session_recording:{maskAllInputs:!0,maskTextContent:!0},before_send:i=>i?J_==="yes"?i:J_==="no"?null:Xle(i):null,loaded:i=>{i.register({consent_status:t,initial_consent_status:t})}}}function i8(t,e={}){const n=t==="yes";J_=t,sn.set_config({persistence:n?"localStorage+cookie":"memory",autocapture:n&&!!e.autocapture,capture_pageview:!0,capture_pageleave:!0,capture_heatmaps:n&&!!e.heatmaps}),n&&e.sessionRecording?sn.startSessionRecording():sn.stopSessionRecording(),n||sn.reset(),sn.register({consent_status:t}),n&&sn.capture("$pageview")}const nh="cookie_consent",Qle=3600*24*180;function kD(){const{hostname:t}=window.location;if(t==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(t))return null;const e=t.split(".");return e.length>=2?`.${e.slice(-2).join(".")}`:null}class zm{static getConsentStatus(){const e=document.cookie.match(new RegExp(`(?:^|; )${nh}=([^;]*)`));if(e)return decodeURIComponent(e[1]);const n=localStorage.getItem(nh);return n||"undecided"}static setConsentStatus(e){const n=kD();n?document.cookie=`${nh}=${e}; path=/; max-age=${Qle}; domain=${n}; SameSite=Lax; Secure`:localStorage.setItem(nh,e)}static clearConsentStatus(){const e=kD();e&&(document.cookie=`${nh}=; path=/; max-age=0; domain=${e}; SameSite=Lax; Secure`),localStorage.removeItem(nh)}}const nC=new Set;function ece(t){return nC.add(t),()=>nC.delete(t)}function r8(){nC.forEach(t=>t())}function s8(){zm.clearConsentStatus(),i8("undecided"),r8()}function tce(t={}){const e=M.useSyncExternalStore(ece,()=>zm.getConsentStatus(),()=>"undecided"),n=M.useCallback(o=>{const l=o==="accept"?"yes":"no";zm.setConsentStatus(l),i8(l,t),o==="accept"&&sn.capture("consent_decision",{decision:o}),r8()},[t]),i=M.useCallback(()=>n("accept"),[n]),r=M.useCallback(()=>n("decline"),[n]);return{consentStatus:e,acceptCookies:i,declineCookies:r,reopenConsent:s8,hasConsent:e==="yes",hasDecided:e!=="undecided"}}function nce(t){return t.sessionRecording?"We use cookies and record your session (clicks and navigation, with typed text masked) to improve our website.":"We use cookies to understand how this site is used. Please accept to help us improve!"}function ice({features:t={},policyLink:e,renderActions:n,className:i}){const{hasDecided:r,acceptCookies:o,declineCookies:l}=tce(t);return r?null:w.jsx("div",{role:"dialog","aria-label":"Cookie consent",className:i??"fixed bg-white bottom-0 left-0 right-0 z-50 border-t border-gray-300",children:w.jsx("div",{className:"max-w-7xl mx-auto",children:w.jsx("div",{className:"bg-white/95 backdrop-blur-sm px-6 py-4",children:w.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[w.jsx("div",{className:"flex-1",children:w.jsxs("p",{className:"text-gray-900 text-md text-center md:text-left leading-relaxed",children:[nce(t),e?w.jsxs(w.Fragment,{children:[" ",e]}):null]})}),w.jsx("div",{className:"flex items-center sm:space-x-3 flex-shrink-0 w-full sm:w-auto",children:n?n({accept:o,decline:l}):w.jsxs(w.Fragment,{children:[w.jsx("button",{type:"button",onClick:l,className:"mx-2 w-1/2 sm:w-auto px-4 py-2 rounded-lg border border-gray-300 text-gray-950 cursor-pointer hover:bg-gray-100",children:"Decline"}),w.jsx("button",{type:"button",onClick:o,className:"mx-2 w-1/2 sm:w-auto px-4 py-2 rounded-lg bg-blue-600 text-white font-semibold cursor-pointer hover:bg-blue-700",children:"Accept"})]})})]})})})})}const o8={autocapture:!0,sessionRecording:!1,heatmaps:!0}
78;function ko(){const{isAuthenticated:t,isLoading:e,user:n,loginWithRedirect:i,logout:r,getAccessTokenSilently:o}=OJ(),[l,u]=M.useState(null);M.useEffect(()=>{if(!t||e){u(null);return}let y=!1;return(async()=>{try{const x=Ua.requireToken(await o()),S=Ua.decodeToken(x),k=n?.email_verified??!1;y||u({hasDesktopAccess:S.licenses.includes(Go.desktopUser)||S.licenses.includes(Go.desktopTrial),hasEnterpriseAgreement:S.organizations.length>0,hasVerifiedEmail:k})}catch(x){console.error("Error decoding token:",x),y||u({hasDesktopAccess:!1,hasEnterpriseAgreement:!1,hasVerifiedEmail:!1})}})(),()=>{y=!0}},[t,e,n,o]);const d=M.useCallback(()=>{i({authorizationParams:{redirect_uri:`${window.location.origin}/desktop`},appState:{posthog:{sessionId:sn.get_session_id(),distinctId:sn.get_distinct_id(),loginType:"login"}}})},[i]),f=M.useCallback(()=>{i({authorizationParams:{screen_hint:"signup",redirect_uri:`${window.location.origin}/desktop`},appState:{posthog:{sessionId:sn.get_session_id(),distinctId:sn.get_distinct_id(),loginType:"signup"}}})},[i]),p=M.useCallback(()=>{r({logoutParams:{returnTo:window.location.origin}})},[r]),g=M.useCallback(async()=>{await o({cacheMode:"off"})},[o]),v=M.useCallback(async y=>{const b=Ua.requireToken(await o({cacheMode:y?.ignoreCache?"off":void 0}));if(y?.ignoreCache){const x=Ua.decodeToken(b);u({hasDesktopAccess:x.licenses.includes(Go.desktopUser)||x.licenses.includes(Go.desktopTrial),hasEnterpriseAgreement:x.organizations.length>0,hasVerifiedEmail:n?.email_verified??!1})}return b},[o,n]);return{isAuthenticated:t,isLoading:e||t&&l===null,user:n,login:d,signup:f,logout:p,hasVerifiedEmail:l?.hasVerifiedEmail??!1,hasDesktopAccess:l?.hasDesktopAccess??!1,hasEnterpriseAgreement:l?.hasEnterpriseAgreement??!1,getAccessToken:v,refreshSession:g}}const rce=`@@auth0spajs@@::${WO.clientId}::`,sce=()=>{try{for(let t=0;t<window.localStorage.length;t+=1)if(window.localStorage.key(t)?.startsWith(rce))return!0}catch{}return!1},Yw=()=>{const{isAuthenticated:t,isLoading:e}=ko(),[n]=M.useState(sce);return e?n:t},oce={primary:"bg-blue-600 hover:bg-blue-700 text-white font-semibold",secondary:"bg-white hover:bg-gray-100 border border-gray-300 text-blue-950",ghost:"bg-transparent hover:bg-gray-100 text-blue-950",gradient:"bg-gradient-to-br from-blue-500 to-blue-600 text-white hover:shadow-xl hover:scale-105 font-semibold"},ace={sm:"px-3 py-1.5 text-sm",md:"px-4 py-2 text-base",lg:"px-6 py-3 text-lg"},ED=({variant:t="primary",size:e="md",fullWidth:n=!1,loading:i=!1,disabled:r,className:o="",children:l,...u})=>{const d="rounded-lg transition-all duration-150 flex items-center justify-center cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",f=n?"w-full":"";return w.jsx("button",{className:`${d} ${oce[t]} ${ace[e]} ${f} ${o}`,disabled:r||i,...u,children:i?w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-current mr-2"}),"Loading..."]}):l})},lce={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"},cce=({size:t="md",className:e=""})=>w.jsx("div",{className:`animate-spin rounded-full border-b-2 border-blue-600 ${lce[t]} ${e}`,role:"status","aria-label":"Loading"}),Dm=({className:t=""})=>w.jsx("div",{"aria-hidden":"true",className:`bg-gray-200 rounded-lg animate-pulse select-none ${t}`,children:w.jsx("span",{className:"invisible",children:"​"})}),ih=({icon:t,iconColor:e,iconBgColor:n,iconBorderColor:i,title:r,message:o,children:l})=>w.jsx("div",{className:"w-full max-w-lg",children:w.jsx("div",{className:"bg-white border border-gray-300 rounded-lg shadow-lg p-8",children:w.jsxs("div",{className:"text-center",children:[w.jsx("div",{className:`w-16 h-16 ${n} border ${i} rounded-full flex items-center justify-center mx-auto mb-4`,children:w.jsx("i",{className:`${t} ${e} text-2xl`,"aria-hidden":"true"})}),w.jsx("h3",{className:"text-2xl font-display text-blue-950 mb-2",children:r}),w.jsx("div",{className:"text-gray-600 text-sm",children:typeof o=="string"?w.jsx("p",{children:o}):o}),l&&w.jsx("div",{className:"mt-4",children:l})]})})});function Qa(){const t=M.useCallback(()=>zm.getConsentStatus(),[]),e=M.useCallback((y,b)=>{sn.capture("funnel_meeting_cta_clicked",{source:y,cta_text:b,page_url:window.location.href,consent_status:t(),timestamp:new Date().toISOString()})},[t]),n=M.useCallback(()=>{sn.capture("funnel_meeting_modal_opened",{page_url:window.location.href,consent_status:t(),timestamp:new Date().toISOString()})},[t]),i=M.useCallback(y=>{sn.capture("funnel_meeting_booking_completed",{event_type:y?.eventType,duration_minutes:y?.duration,scheduled_date:y?.scheduledDate,timezone:y?.timezone,page_url:window.location.href,consent_status:t(),timestamp:new Date().toISOString()}),sn.setPersonProperties({meeting_booked_at:new Date().toISOString(),last_booking_event_type:y?.eventType,last_booking_duration:y?.duration})},[t]),r=M.useCallback(y=>{sn.capture("funnel_meeting_booking_abandoned",{abandonment_stage:y,page_url:window.location.href,consent_status:t(),timestamp:new Date().toISOString()})},[t]),o=M.useCallback(y=>{sn.capture("signup_initiated",{source:y,page_url:window.location.href,consent_status:t(),timestamp:new Date().toISOString()})},[t]),l=M.useCallback(y=>{sn.capture("login_initiated",{source:y,page_url:window.location.href,consent_status:t(),timestamp:new Date().toISOString()})},[t]),u=M.useCallback(y=>{const b=sessionStorage.getItem("posthog_pre_auth");let x=null;if(b)try{x=JSON.parse(b),sessionStorage.removeItem("posthog_pre_auth")}catch(S){console.error("Failed to parse pre-auth PostHog data:",S)}y.auth0Id&&(sn.identify(y.auth0Id,{auth0_id:y.auth0Id,email_verified:y.emailVerified,last_login_at:new Date().toISOString(),auth_method:y.authMethod}),x?.distinctId&&sn.alias(y.auth0Id,x.distinctId)),sn.capture("login_completed",{email_verified:y.emailVerified,auth_method:y.authMethod||"unknown",user_email_domain:y.email?y.email.split("@")[1]:void 0,login_type:x?.loginType||"unknown",consent_status:t(),timestamp:new Date().toISOString(),...x&&{pre_auth_session_id:x.sessionId,pre_auth_distinct_id:x.distinctId,auth_redirect_duration_ms:Date.now()-new Date(x.timestamp).getTime()}})},[t]),d=M.useCallback(()=>{sn.capture("email_verification_required",{page_url:window.location.href,consent_status:t(),timestamp:new Date().toISOString()})},[t]),f=M.useCallback(()=>{sn.capture("email_verification_completed",{page_url:window.location.href,consent_status:t(),timestamp:new Date().toISOString()}),sn.setPersonProperties({email_verified:!0,email_verified_at:new Date().toISOString()})},[t]),p=M.useCallback(y=>{sn.capture("download_initiated",{platform:y,page_url:window.location.href,consent_status:t(),timestamp:new Date().toISOString()}),sn.setPersonProperties({downloaded_platform:y,download_initiated_at:new Date().toISOString()})},[t]),g=M.useCallback(()=>{sn.capture("funnel_form_thank_you_viewed",{page_url:window.location.href,consent_status:t(),timestamp:new Date().toISOString()})},[t]),v=M.useCallback(()=>{sn.capture("navigated_to_desktop",{page_url:window.location.href,consent_status:t(),timestamp:new Date().toISOString()})},[t]);return{trackMeetingCtaClicked:e,trackMeetingModalOpened:n,trackMeetingBookingCompleted:i,trackMeetingBookingAbandoned:r,trackSignupInitiated:o,trackLoginInitiated:l,trackLoginCompleted:u,trackEmailVerificationRequired:d,trackEmailVerificationCompleted:f,trackDownloadInitiated:p,trackFormThankYouViewed:g,trackNavigatedToDesktop:v,getConsentStatus:t}}const uce=()=>{const{login:t}=ko(),{trackLoginInitiated:e}=Qa(),n=()=>{e("header"),t()};return w.jsx("button",{onClick:n,className:"bg-gradient-to-br from-blue-500 to-blue-600 hover:from-blue-400 hover:to-blue-500 text-white font-bold px-4 py-2 text-base rounded-lg transition-colors duration-150 flex items-center justify-center cursor-pointer",children:"Log In"})},dce=()=>{const{logout:t}=ko();return w.jsx("button",{type:"button",onClick:t,className:"text-gray-700 hover:text-blue-600 transition-colors cursor-pointer",children:"Log Out"})},TD=()=>w.jsx("a",{href:"https://docs.lyster.io/",target:"_blank",rel:"noopener noreferrer",className:"bg-white hover:bg-gray-100 border border-gray-300 text-blue-950 px-4 py-2 rounded-lg text-base flex items-center justify-center transition-all duration-150",children:"Docs"}),hce="https://cdn.lyster.io/branding/logo_2000px.svg";function fce(){const{isAuthenticated:t,isLoading:e,login:n}=ko(),i=Zm();return M.useEffect(()=>{e||(t?i("/"):n())},[t,e,n,i]),w.jsx("div",{className:"flex-1 flex items-center justify-center bg-blue-50",children:w.jsxs("div",{className:"text-center",children:[w.jsx("img",{src:hce,alt:"Lyster Logo",className:"w-32 h-32 mx-auto mb-8"}),w.jsx("h1",{className:"text-2xl font-semibold text-blue-950 mb-2",children:"Redirecting to login..."}),w.jsx("p",{className:"text-gray-600",children:"Please wait while we redirect you to the login page."})]})})}const CD="https://cdn.lyster.io/branding/logo_2000px.svg";function pce(){const e=ms().search,n=`lyster://auth/callback${e}`;return M.useEffect(()=>{e&&(window.location.href=n)},[n,e]),e?w.jsx("div",{className:"flex-1 flex items-center justify-center bg-blue-50",children:w.jsxs("div",{className:"text-center",children:[w.jsx("img",{src:CD,alt:"Lyster Logo",className:"w-32 h-32 mx-auto mb-8"}),w.jsx("h1",{className:"text-2xl font-semibold text-blue-950 mb-2",children:"Redirecting to Lyster Classic..."}),w.jsx("p",{className:"text-gray-600",children:"If your browser prompts you to open the Lyster app, please accept. Then, you may close this window."}),w.jsxs("p",{className:"text-gray-600",children:["If you are not automatically redirected,"," ",w.jsx("a",{href:n,className:"text-blue-600 hover:text-blue-500 underline",children:"click here"}),"."]})]})}):w.jsx("div",{className:"flex-1 flex items-center justify-center bg-blue-50",children:w.jsxs("div",{className:"text-center",children:[w.jsx("img",{src:CD,alt:"Lyster Logo",className:"w-32 h-32 mx-auto mb-8"}),w.jsx("h1",{className:"text-2xl font-semibold text-blue-950 mb-2",children:"Missing sign-in details"}),w.jsx("p",{className:"text-gray-600",children:"This page was opened without sign-in details. Please start the sign-in again from the Lyster Classic desktop app."})]})})}const gce="https://cdn.lyster.io/branding/logo_2000px.svg",mce="https://app.lyster.io",vce="https://docs.lyster.io",yce=({brandText:t,rightSlot:e,variant:n})=>{const{isAuthenticated:i,isLoading:r,logout:o}=ko(),l=Yw(),u=iN("/desktop"),d=iN("/"),f=n??(u?"desktop":d?"landing":"other"),g=(t??(f==="desktop"?"Lyster Classic":"Lyster")).replace(/^Lyster\s*/,""),v=e||(f==="other"?null:f==="landing"?w.jsxs("div",{className:"flex items-center space-x-4",children:[l&&w.jsx("button",{type:"button",onClick:o,className:"hidden sm:block text-gray-700 hover:text-blue-600 transition-colors cursor-pointer",children:"Log Out"}),w.jsx("a",{href:vce,target:"_blank",rel:"noopener noreferrer",className:"bg-white hover:bg-gray-100 border border-gray-300 text-blue-950 px-4 py-2 text-base rounded-lg transition-all duration-150 flex items-center justify-center",children:"Docs"}),w.jsx("a",{href:mce,className:"hidden sm:flex bg-gradient-to-br from-blue-500 to-blue-600 hover:from-blue-400 hover:to-blue-500 text-white font-bold px-4 py-2 text-base rounded-lg transition-colors duration-150 items-center justify-center",children:l?"Go To App":"Log In"})]}):r?w.jsxs("div",{className:"flex items-center space-x-4",children:[w.jsx(Dm,{className:"hidden sm:block text-base w-16"}),w.jsx(Dm,{className:"px-4 py-2 text-base w-16 border border-transparent"})]}):i?w.jsxs("div",{className:"flex items-center space-x-4",children:[w.jsx("div",{className:"hidden sm:block",children:w.jsx(dce,{})}),w.jsx(TD,{})]}):w.jsxs("div",{className:"flex items-center space-x-4",children:[w.jsx(TD,{}),w.jsx("div",{className:"hidden sm:block",children:w.jsx(uce,{})})]}));return w.jsx("header",{className:"fixed top-0 left-0 right-0 z-50 border-b border-gray-300",children:w.jsx("div",{className:"max-w-7xl mx-auto",children:w.jsx("nav",{className:"bg-white/95 backdrop-blur-sm border-x border-gray-300 pl-6 pr-3 sm:px-6 h-16 flex items-center",children:w.jsxs("div",{className:"flex justify-between items-center w-full",children:[w.jsxs("div",{className:"flex items-center space-x-6",children:[w.jsxs(Xl,{to:"/",className:"flex items-center space-x-2","aria-label":"Lyster home",children:[w.jsx("img",{src:gce,alt:"",className:"h-10 w-auto object-contain"}),w.jsx("span",{className:"font-display text-3xl leading-none text-blue-950 select-none",children:"Lyster"})]}),g&&w.jsx("span",{className:"-ml-1 text-sm leading-none uppercase tracking-wider text-gray-500 select-none translate-y-0.5",children:g})]}),w.jsx("div",{className:"flex items-center min-h-[40px]",children:v})]})})})})},fi=({children:t,id:e,className:n="",containerClassName:i="",borderColor:r="border-gray-300"})=>w.jsx("div",{className:`w-full text-blue-950 border-b ${r} ${n}`,children:w.jsx("div",{className:"flex justify-center",children:w.jsx("div",{id:e,className:`max-w-7xl w-full border-x ${r} ${i}`,children:t})})});function a8(){return w.jsx(ice,{features:o8,renderActions:({accept:t,decline:e})=>w.jsxs(w.Fragment,{children:[w.jsx(ED,{variant:"secondary",onClick:e,className:"mx-2 w-1/2 sm:w-auto",children:"Decline"}),w.jsx(ED,{variant:"primary",onClick:t,className:"mx-2 w-1/2 sm:w-auto",children:"Accept Cookies"})]}),policyLink:w.jsxs(w.Fragment,{children:["Learn more in our"," ",w.jsx(Xl,{to:"/legal/cookies",className:"text-blue-600 hover:text-blue-800 font-semibold underline",children:"Cookie Policy"}),"."]})})}const _ce="https://app.cal.com/embed/embed.js";function bce(t=_ce){(function(e,n,i){let r=function(l,u){l.q.push(u)},o=e.document;e.Cal=e.Cal||function(){let l=e.Cal,u=arguments;if(l.loaded||(l.ns={},l.q=l.q||[],o.head.appendChild(o.createElement("script")).src=n,l.loaded=!0),u[0]===i){const d=function(){r(d,arguments)},f=u[1];d.q=d.q||[],typeof f=="string"?(l.ns[f]=l.ns[f]||d,r(l.ns[f],u),r(l,["initNamespace",f])):r(l,u);return}r(l,u)}})(window,t,"init");return window.Cal}function wce(t){const e=typeof t=="string"?{embedJsUrl:t}:t??{},{namespace:n="",embedJsUrl:i}=e;return new Promise(function r(o){const l=bce(i);l("init",n);const u=n?l.ns[n]:l;if(!u){setTimeout(()=>{r(o)},50);return}o(u)})}const OD=new Set,mv=t=>{const{trackMeetingModalOpened:e,trackMeetingBookingCompleted:n,trackMeetingBookingAbandoned:i}=Qa(),r=t.join(",");M.useEffect(()=>{let o=!1;return(async()=>{for(const l of r.split(",")){if(OD.has(l))continue;const u=await wce({namespace:l});if(o)return;OD.add(l),u("ui",{cssVarsPerTheme:{light:{"cal-brand":"#2563eb"},dark:{"cal-brand":"#2563eb"}},hideEventTypeDetails:!1,layout:"month_view"}),u("on",{action:"linkReady",callback:()=>e()}),u("on",{action:"bookingSuccessfulV2",callback:d=>{n({eventType:d.detail.data.title,scheduledDate:d.detail.data.startTime})}}),u("on",{action:"linkClosed",callback:d=>{d.detail?.data?.bookingSuccessful||i("modal_closed")}})}})(),()=>{o=!0}},[r,e,n,i])},hR="reque",l8="forms/4ab34caf-df73-4ae1-9f26-b1efe9f6ed45",yo='{"layout":"month_view","useSlotsViewOnSmallScreen":"true"}',Ba="demo",vv="team/lyster/demo",af="support",fR="team/lyster/support",RD="stude",xce="forms/f0e93724-7e5a-4ef5-9138-ce314ef4d454",Sce="https://cdn.lyster.io/branding/logo_2000px.svg",kce="https://app.lyster.io",js="hover:text-blue-600 transition-colors cursor-pointer",B0="text-[11px] uppercase tracking-[0.12em] text-blue-950 font-semibold mb-2 sm:mb-5",G0="flex flex-col gap-2 sm:gap-3 text-[14px] text-blue-950",Ece=()=>(mv([Ba,RD,af]),w.jsx(fi,{containerClassName:"bg-white px-6 sm:px-10 lg:px-16 pt-8 pb-6 sm:pt-16 sm:pb-12",children:w.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-12 gap-y-6 sm:gap-y-10 gap-x-6",children:[w.jsxs("div",{className:"col-span-2 md:col-span-4",children:[w.jsxs("div",{className:"flex items-center gap-2 mb-3 sm:mb-6",children:[w.jsx(Xl,{to:"/",className:"flex items-center","aria-label":"Lyster home",children:w.jsx("img",{src:Sce,alt:"",className:"h-10 w-auto object-contain"})}),w.jsx("span",{className:"font-display text-3xl leading-none text-blue-950 select-none",children:"Lyster"})]}),w.jsx("div",{className:"text-[12px] sm:text-[13px] text-blue-950 leading-snug sm:leading-relaxed",children:"Built in Swede
78n. Org.nr 559524-2438"}),w.jsx("div",{className:"text-[12px] sm:text-[13px] text-blue-950 leading-snug sm:leading-relaxed",children:"© 2026 Lyster AB. All rights reserved."}),w.jsxs("div",{className:"text-[11px] text-blue-950 leading-snug sm:leading-relaxed mt-2 sm:mt-3 max-w-xs",children:["ArchiMate® is a registered trademark of"," ",w.jsx("a",{href:"https://www.opengroup.org/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-blue-600 transition-colors",children:"The Open Group"}),", of which Lyster is a member."]})]}),w.jsxs("div",{className:"col-span-1 md:col-span-2",children:[w.jsx("div",{className:B0,children:"Lyster"}),w.jsxs("ul",{className:G0,children:[w.jsx("li",{children:w.jsx(Xl,{to:"/",className:js,children:"Home Page"})}),w.jsx("li",{children:w.jsx("a",{href:kce,className:js,children:"Go To App"})}),w.jsx("li",{children:w.jsx("a",{href:"https://docs.lyster.io/",target:"_blank",rel:"noopener noreferrer",className:js,children:"Documentation"})})]})]}),w.jsxs("div",{className:"col-span-1 md:col-span-2",children:[w.jsx("div",{className:B0,children:"Lyster Classic"}),w.jsxs("ul",{className:G0,children:[w.jsx("li",{children:w.jsx(Xl,{to:"/desktop",className:js,children:"Download"})}),w.jsx("li",{children:w.jsx("button",{type:"button","data-cal-namespace":RD,"data-cal-link":xce,"data-cal-config":yo,className:js,children:"Student License"})})]})]}),w.jsxs("div",{className:"col-span-1 md:col-span-2",children:[w.jsx("div",{className:B0,children:"Contact"}),w.jsxs("ul",{className:G0,children:[w.jsx("li",{children:w.jsx("button",{type:"button","data-cal-namespace":Ba,"data-cal-link":vv,"data-cal-config":yo,className:js,children:"Book A Demo"})}),w.jsx("li",{children:w.jsx("button",{type:"button","data-cal-namespace":af,"data-cal-link":fR,"data-cal-config":yo,className:js,children:"Call Support"})}),w.jsx("li",{children:w.jsxs("a",{href:"https://www.linkedin.com/company/lyster-ab/",target:"_blank",rel:"noopener noreferrer",className:`flex w-fit items-center gap-2 leading-normal ${js}`,children:[w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"w-4 h-4","aria-hidden":"true",children:w.jsx("path",{d:"M20.45 20.45h-3.55v-5.57c0-1.33-.03-3.04-1.85-3.04-1.85 0-2.13 1.45-2.13 2.94v5.67H9.36V9h3.41v1.56h.05c.47-.89 1.62-1.85 3.33-1.85 3.56 0 4.22 2.34 4.22 5.39v6.35zM5.34 7.43a2.06 2.06 0 1 1 0-4.13 2.06 2.06 0 0 1 0 4.13zM7.12 20.45H3.56V9h3.56v11.45zM22.23 0H1.77C.79 0 0 .77 0 1.72v20.56C0 23.23.79 24 1.77 24h20.45c.98 0 1.78-.77 1.78-1.72V1.72C24 .77 23.21 0 22.22 0h.01z"})}),"LinkedIn"]})})]})]}),w.jsxs("div",{className:"col-span-1 md:col-span-2",children:[w.jsx("div",{className:B0,children:"Legal"}),w.jsxs("ul",{className:G0,children:[w.jsx("li",{children:w.jsx("a",{href:"https://cdn.lyster.io/legal/privacy-policy.pdf",target:"_blank",rel:"noopener noreferrer",className:js,children:"Privacy"})}),w.jsx("li",{children:w.jsx(Xl,{to:"/legal/cookies",className:js,children:"Cookie Policy"})}),w.jsx("li",{children:w.jsx("button",{type:"button",onClick:s8,className:js,children:"Cookie Settings"})}),w.jsx("li",{children:w.jsx("a",{href:"https://cdn.lyster.io/legal/terms-and-conditions.pdf",target:"_blank",rel:"noopener noreferrer",className:js,children:"Terms"})})]})]})]})})),zs=({height:t="h-24",className:e="",containerClassName:n=""})=>w.jsx(fi,{className:e,containerClassName:n,children:w.jsx("div",{className:t})}),c8=()=>{const{pathname:t,hash:e}=ms();return M.useEffect(()=>{e||window.scrollTo(0,0)},[t,e]),null},Tce=()=>{const{isAuthenticated:t,isLoading:e,user:n,hasVerifiedEmail:i,getAccessToken:r}=ko(),{trackLoginCompleted:o,trackEmailVerificationCompleted:l}=Qa(),u=M.useRef(!1);M.useEffect(()=>{!t||e||!n||u.current||(u.current=!0,o({auth0Id:n.sub,email:n.email,emailVerified:n.email_verified??!1,authMethod:n.sub?.split("|")[0]}),n.email_verified&&l())},[t,e,n,o,l]);const d=M.useRef(!1);return M.useEffect(()=>{i&&!d.current&&(d.current=!0,u.current&&l())},[i,l]),M.useEffect(()=>{if(!t||e||i)return;const f=()=>{document.visibilityState==="visible"&&r({ignoreCache:!0}).catch(()=>{})};return document.addEventListener("visibilitychange",f),()=>document.removeEventListener("visibilitychange",f)},[t,e,i,r]),w.jsxs("div",{className:"flex flex-col",children:[w.jsx(c8,{}),w.jsx(yce,{}),w.jsxs("main",{className:"flex-1 flex flex-col min-h-[calc(100vh-4rem)]",style:{backgroundColor:"#ffffff",backgroundImage:"radial-gradient(circle,rgb(218, 224, 232) 1.35px, transparent 1px)",backgroundSize:"24px 24px"},children:[w.jsx(RL,{}),w.jsx(Ece,{})]}),w.jsx(a8,{})]})},Cce=()=>w.jsxs("div",{className:"min-h-screen flex flex-col",children:[w.jsx(c8,{}),w.jsx("main",{className:"flex-1 flex flex-col",style:{backgroundColor:"#ffffff",backgroundImage:"radial-gradient(circle,rgb(218, 224, 232) 1.35px, transparent 1px)",backgroundSize:"24px 24px"},children:w.jsx(RL,{})}),w.jsx(a8,{})]}),Oce="https://cdn.lyster.io/branding/logo_2000px.svg",ME=()=>{const t=Zm();return mv([af]),w.jsxs("div",{className:"min-h-screen flex flex-col items-center overflow-hidden",style:{backgroundColor:"#ffffff",backgroundImage:"radial-gradient(circle,rgb(218, 224, 232) 1.35px, transparent 1px)",backgroundSize:"24px 24px"},children:[w.jsx("div",{className:"flex-1"}),w.jsx("div",{className:"w-full max-w-7xl bg-white panel-borders relative z-10",children:w.jsx("div",{className:"flex items-center justify-center w-full px-8 lg:px-12 py-8 lg:py-20",children:w.jsxs("div",{className:"text-center",children:[w.jsx("img",{src:Oce,alt:"Lyster Logo",className:"w-32 h-32 mx-auto mb-8"}),w.jsx("h1",{className:"text-2xl font-semibold text-blue-950 mb-2",children:"Oops! Something went wrong."}),w.jsx("p",{className:"text-gray-600 mb-6",children:"If this issue persists, please contact support."}),w.jsxs("div",{className:"flex items-center justify-center gap-4",children:[w.jsx("button",{"data-cal-namespace":af,"data-cal-link":fR,"data-cal-config":yo,className:"text-blue-600 underline hover:text-blue-800 transition-colors cursor-pointer",children:"Contact Support"}),w.jsx("button",{onClick:()=>t("/"),className:"bg-white hover:bg-gray-100 border border-gray-300 text-blue-950 px-6 py-2 rounded-lg text-base transition-all duration-150 cursor-pointer",children:"Go Home"})]})]})})}),w.jsx("div",{className:"flex-1"})]})},Rce="https://cdn.lyster.io/branding/logo_2000px.svg",$ce=()=>{const t=Zm();return w.jsxs("div",{className:"flex-1 flex flex-col items-center overflow-hidden",children:[w.jsx("div",{className:"flex-1"}),w.jsx("div",{className:"w-full max-w-7xl bg-white panel-borders relative z-10",children:w.jsx("div",{className:"flex items-center justify-center w-full px-8 lg:px-12 py-8 lg:py-20",children:w.jsxs("div",{className:"text-center",children:[w.jsx("img",{src:Rce,alt:"Lyster Logo",className:"w-32 h-32 mx-auto mb-8"}
78),w.jsx("h1",{className:"text-6xl font-bold text-gray-800 mb-2",children:"404"}),w.jsx("h2",{className:"text-2xl font-semibold text-blue-950 mb-2",children:"Page Not Found"}),w.jsx("p",{className:"text-gray-600 mb-6",children:"The page you're looking for doesn't exist."}),w.jsx("button",{onClick:()=>t("/"),className:"bg-gradient-to-br from-blue-500 to-blue-600 text-white px-6 py-2 rounded-lg font-semibold text-base transition-all duration-150 hover:shadow-xl hover:scale-105 cursor-pointer",children:"Go Home"})]})})}),w.jsx("div",{className:"flex-1"})]})},J0=({videoSrc:t,title:e,description:n,videoOnRight:i=!0})=>w.jsx("div",{className:"bg-white/80 backdrop-blur-sm overflow-hidden py-12 lg:py-0",children:w.jsxs("div",{className:`flex flex-col lg:flex-row ${i?"lg:flex-row-reverse":""}`,children:[w.jsx("div",{className:"w-full lg:w-1/2 order-2 lg:order-none",children:w.jsx("div",{className:`relative h-full overflow-hidden border-gray-300 p-6 md:p-10 lg:p-0 ${i?"lg:border-l":""}`,children:w.jsxs("video",{className:"w-full h-full border-gray-300 border rounded-lg shadow-md lg:shadow-none lg:rounded-none lg:border-none",style:{objectFit:"cover"},autoPlay:!0,muted:!0,loop:!0,playsInline:!0,children:[w.jsx("source",{src:t,type:"video/mp4"}),"Your browser does not support the video tag."]})})}),w.jsxs("div",{className:`w-full lg:w-1/2 px-6 pt-4 pb-2 md:p-16 md:pt-4 md:pb-2 lg:p-8 flex flex-col justify-center order-1 lg:order-none border-gray-300 ${i?"":"lg:border-l"}`,children:[w.jsx("h3",{className:"text-2xl sm:text-3xl font-display text-blue-950 mb-4",children:e}),w.jsx("p",{className:"text-base/7 text-blue-950 lg:text-lg",children:n})]})]})}),IE=[{name:"Your Data Stays With You",lyster:!0,archi:!0,preLinkText:"Your model data stays with you and will never be uploaded to our servers.",link:null,icon:"fas fa-shield-alt"},{name:"CoArchi Interoperability",lyster:!0,archi:!0,preLinkText:"Import, export and edit ArchiMate models in the ",linkText:"coArchi XML format",postLinkText:" and collaborate with others via built-in Git menus.",link:"https://www.archimatetool.com/plugins/",icon:"fab fa-git-alt"},{name:"Standard ArchiMate XML",lyster:!0,archi:!0,preLinkText:"Import, export and edit models in the standardized ",linkText:"ArchiMate Model Exchange File",postLinkText:" format from The Open Group®.",link:"https://www.opengroup.org/open-group-archimate-model-exchange-file-format",icon:"fas fa-file-code"},{name:"Runs On Windows",lyster:!0,archi:!0,preLinkText:"Lyster Classic supports Windows 11 or later.",link:null,icon:"fab fa-windows"},{name:"Runs On macOS",lyster:!0,archi:!0,preLinkText:"Lyster Classic supports macOS 14 (Sonoma) or later.",link:null,icon:"fab fa-apple"},{name:"Navigation History",lyster:!0,archi:!1,preLinkText:"Browse ArchiMate models just like you would browse a website with forward and back navigation.",link:null,icon:"fas fa-history"},{name:"View Templating",lyster:!0,archi:!1,preLinkText:"Create new views from pre-defined templates to maintain consistency as your models grow.",link:null,icon:"fas fa-copy"},{name:"Dynamic Legend",lyster:!0,archi:!1,preLinkText:"Check the definition of any ArchiMate symbol in a view with a simple mouse hover. Perfect for novices and experts alike.",link:null,icon:"fas fa-memo-circle-info"},{name:"Table View",lyster:!0,archi:!1,preLinkText:"Keep track of metadata as the model scales using table view, as easy as using a spreadsheet.",link:null,icon:"fas fa-table"},{name:"Automatic Updates",lyster:!0,archi:!1,preLinkText:"Lyster Classic is continuously improving. We welcome customer feedback and feature requests.",link:null,icon:"fas fa-cloud-arrow-down"}],Ace=()=>w.jsxs("div",{className:"w-full h-full p-6 md:px-16 lg:px-32 bg-white",children:[w.jsx("div",{className:"hidden md:block",children:w.jsx("div",{className:"overflow-x-auto",style:{overflow:"visible"},children:w.jsxs("div",{className:"inline-block min-w-full relative",style:{overflow:"visible",paddingBottom:"30px"},children:[w.jsx("div",{className:"absolute pointer-events-none",style:{right:"140px",width:"140px",top:"8px",bottom:"30px",zIndex:0},children:w.jsx("div",{className:"w-full h-full bg-blue-600 rounded-lg shadow-2xl drop-shadow-2xl transform translate-y-1"})}),w.jsxs("table",{className:"w-full bg-transparent relative z-10",style:{borderCollapse:"separate",borderSpacing:"0",overflow:"visible"},children:[w.jsx("thead",{children:w.jsxs("tr",{className:"bg-transparent",style:{overflow:"visible"},children:[w.jsx("th",{className:"px-6 pt-6 pb-4 text-left font-medium text-blue-950 bg-transparent",style:{overflow:"visible"}}),w.jsx("th",{className:"px-6 pt-6 pb-4 text-center lg:text-lg font-display text-white bg-transparent roun
78ded-t-lg relative z-20",style:{overflow:"visible",width:"140px"},children:"Lyster Classic"}),w.jsx("th",{className:"px-6 pt-6 pb-4 text-center lg:text-lg font-display text-blue-950 bg-transparent",style:{overflow:"visible",width:"140px"},children:"Archi"})]})}),w.jsx("tbody",{children:IE.map((t,e)=>w.jsxs("tr",{style:{overflow:"visible"},children:[w.jsx("td",{className:"px-6 py-2 text-sm text-blue-950 bg-transparent align-middle",style:{overflow:"visible",height:"100px"},children:w.jsxs("div",{className:"flex items-center h-full",children:[w.jsx("div",{className:"flex justify-center mr-6 min-w-[30px] lg:min-w-[40px] text-lg lg:text-xl",children:t.icon&&w.jsx("i",{className:t.icon+" text-gray-600","aria-label":t.name})}),w.jsxs("div",{className:"mr-6",children:[w.jsx("div",{className:"lg:text-lg font-display text-blue-950 mb-1",children:t.name}),w.jsxs("div",{className:"text-xs lg:text-sm text-gray-600",children:[t.preLinkText,t.link&&t.linkText&&w.jsxs(w.Fragment,{children:[w.jsx("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 underline",children:t.linkText}),t.postLinkText]})]})]})]})}),w.jsx("td",{className:`px-6 py-4 text-center bg-transparent text-white relative z-20 align-middle ${e===IE.length-1?"rounded-b-lg":""}`,style:{overflow:"visible",height:"100px",width:"140px"},children:t.lyster&&w.jsx("i",{className:"fas fa-check-circle text-white text-lg","aria-label":"Supported"})}),w.jsx("td",{className:"px-6 py-4 text-center bg-transparent align-middle",style:{overflow:"visible",height:"100px",width:"140px"},children:t.archi&&w.jsx("i",{className:"fal fa-check-circle text-gray-600 text-lg","aria-label":"Supported"})})]},e))})]})]})})}),w.jsx("div",{className:"md:hidden space-y-4",children:IE.map((t,e)=>w.jsx("div",{className:"bg-blue-50 shadow-md rounded-lg border border-gray-300 overflow-hidden",children:w.jsxs("div",{className:"flex",children:[w.jsx("div",{className:"w-16 bg-blue-600 flex justify-center items-center py-6 border-r border-gray-300",children:t.icon&&w.jsx("i",{className:t.icon+" text-white text-lg","aria-label":t.name})}),w.jsxs("div",{className:"flex-1 p-4",children:[w.jsx("h4",{className:"font-medium text-blue-950 mb-2",children:t.name}),w.jsxs("div",{className:"text-sm text-gray-600 leading-relaxed",children:[t.preLinkText,t.link&&t.linkText&&w.jsxs(w.Fragment,{children:[w.jsx("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 underline",children:t.linkText}),t.postLinkText]})]})]})]})},e))}),w.jsx("div",{className:"text-xs text-gray-500 leading-relaxed mt-6",children:"Archi is a registered trademark of its respective owner. Lyster is not affiliated with, endorsed by, or sponsored by Archi. Lyster Classic is not yet certified for ArchiMate standard compliance by The Open Group."})]}),jce=[{name:"Student",price:"Free",description:"For students and anyone currently pursuing an ArchiMate certification.",features:["Full editor experience"]},{name:"Individual",price:"€20",priceSuffix:"/ month",description:"For independent practitioners and consultants.",features:["Everything in Student","Priority support"]},{name:"Enterprise",price:"€40",priceSuffix:"/ user / month",description:"For organizations that need centralized identity and access management.",features:["Everything in Individual","SSO & SCIM provisioning","SLA"]}],Pce=()=>w.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 p-6 md:p-10",children:jce.map(t=>w.jsxs("div",{className:"flex flex-col rounded-xl border border-gray-300 p-8 bg-white shadow-lg",children:[w.jsx("h3",{className:"text-2xl font-display text-blue-950 mb-2",children:t.name}),w.jsxs("div",{className:"flex items-baseline gap-2 mb-4",children:[w.jsx("span",{className:"text-4xl font-display text-blue-950",children:t.price}),t.priceSuffix&&w.jsx("span",{className:"text-gray-600",children:t.priceSuffix})]}),w.jsx("p",{className:"text-gray-600 mb-6",children:t.description}),w.jsx("ul",{className:"space-y-2 text-gray-700",children:t.features.map(e=>w.jsxs("li",{className:"flex items-baseline gap-2",children:[w.jsx("span",{className:"text-blue-600",children:"✓"}),w.jsx("span",{children:e})]},e))})]},t.name))});function Nce(){const{isAuthenticated:t,hasDesktopAccess:e}=ko(),{trackDownloadInitiated:n}=Qa(),{data:i,error:r,isLoading:o}=n8({queryKey:["downloads"],queryFn:async()=>{const u=await Nm.instance.getDesktopReleases();if(!u.success)throw u.error;return u.data},enabled:t&&e,staleTime:1e3*60*10}),l=M.useCallback((u,d)=>{n(u);const f=document.createElement("a");f.href=d,f.download="",document.body.appendChild(f),f.click(),document.body.removeChild(f)},[n]);return{downloadData:i??null,downloadError:r?r.message:null,isLoading:o,download:l}}const u8="desktopTrial";async function d8(){const t=await Nm.instance.getOffers();if(!t.success)throw t.error;return t.data}const Mce=()=>{const{getAccessToken:t}=ko(),e=sR();return Wle({mutationFn:async(n=u8)=>{const i=await Nm.instance.postOffer({offerId:n});if(i.success)return i.data;if(i.error.status===409){await t({ignoreCache:!0});
78const o=(await d8()).find(l=>l.offerId===n);if(o)return o}throw i.error},onSuccess:async()=>{await t({ignoreCache:!0}),e.invalidateQueries({queryKey:["offers"]})}})},Ice=(t=!0)=>{const{isAuthenticated:e,isLoading:n}=ko(),i=n8({queryKey:["offers"],queryFn:d8,enabled:!!(e&&!n&&t),staleTime:1e3*60,retry:!1});return{offer:i.data?.find(o=>o.offerId===u8),isLoading:i.isLoading,error:i.error,refetch:i.refetch}},ng=({trialExpiresAt:t,loading:e=!1,loadingSubtitle:n})=>{const{downloadData:i,downloadError:r,isLoading:o,download:l}=Nce(),u=e||o,f=e?n??"Select your operating system.":t?`Your free trial ends on ${(p=>{const g=new Date(p),v={year:"numeric",month:"long",day:"numeric"};return g.toLocaleDateString("en-US",v)})(t)}.`:"Select your operating system.";return w.jsx("div",{className:"w-full max-w-md",children:w.jsxs("div",{className:"bg-white border border-gray-300 rounded-lg shadow-lg p-8",children:[w.jsxs("div",{className:"text-center mb-6",children:[w.jsx("div",{className:"w-16 h-16 bg-blue-100 border border-blue-200 rounded-full flex items-center justify-center mx-auto mb-4",children:w.jsx("i",{className:"fas fa-cloud-arrow-down text-blue-600 text-2xl","aria-label":"Download"})}),w.jsx("h3",{className:"text-3xl font-display text-blue-950 mb-2",children:"Lyster Classic"}),w.jsx("p",{className:"text-gray-600",children:f})]}),w.jsx("div",{className:"space-y-3",children:u?w.jsxs(w.Fragment,{children:[w.jsx(Dm,{className:"w-full px-6 py-3 border border-transparent"}),w.jsx(Dm,{className:"w-full px-6 py-3 border border-transparent"})]}):w.jsxs(w.Fragment,{children:[w.jsxs("button",{onClick:()=>i?.windows?.url&&l("windows",i.windows.url),disabled:!i?.windows?.url||!!r,className:"w-full bg-white hover:bg-gray-100 border border-gray-300 text-blue-950 px-6 py-3 rounded-lg font-semibold transition-colors duration-200 flex items-center justify-center cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",children:[w.jsx("i",{className:"fab fa-windows text-blue-950 text-2xl mr-4","aria-label":"Windows"}),i?.windows?.url?"Download for Windows":"Download Unavailable"]}),w.jsxs("button",{onClick:()=>i?.mac?.url&&l("mac",i.mac.url),disabled:!i?.mac?.url||!!r,className:"w-full bg-white hover:bg-gray-100 border border-gray-300 text-blue-950 px-6 py-3 rounded-lg font-semibold transition-colors duration-200 flex items-center justify-center cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",children:[w.jsx("i",{className:"fab fa-apple text-blue-950 text-2xl mr-4","aria-label":"macOS"}),i?.mac?.url?"Download for macOS":"Download Unavailable"]})]})}),!u&&r&&w.jsx("div",{className:"mt-4 bg-red-50 border border-red-200 p-3 rounded-lg text-red-700 text-sm",children:r})]})})},zce=()=>{const{isAuthenticated:t,isLoading:e,hasVerifiedEmail:n,hasDesktopAccess:i,hasEnterpriseAgreement:r}=ko(),{trackEmailVerificationRequired:o}=Qa(),{offer:l,isLoading:u,error:d}=Ice(!r&&n),f=Mce();return M.useEffect(()=>{t&&!e&&!n&&o()},[t,e,n,o]),M.useEffect(()=>{l&&!l.expiresAt&&!f.isPending&&f.mutate(l.offerId)},[l?.offerId,l?.expiresAt]),e?w.jsx(ng,{loading:!0}):t?n?r&&i?w.jsx(ng,{}):r&&!i?w.jsx(ih,{icon:"fas fa-exclamation-triangle",iconColor:"text-yellow-600",iconBgColor:"bg-yellow-50",iconBorderColor:"border-yellow-600",title:"License Unavailable",message:"All licenses in your enterprise agreement have been allocated. Please contact support to request additional seats."}):u?w.jsx(ng,{loading:!0,loadingSubtitle:"Loading your free trial information..."}):d?w.jsx(ih,{icon:"fas fa-exclamation-circle",iconColor:"text-red-600",iconBgColor:"bg-red-50",iconBorderColor:"border-red-600",title:"Unable to Load Offers",message:"We encountered an error while checking for available trials. Please try refreshing the page or contact support if the issue persists."}):l&&l.expiresAt?new Date(l.expiresAt)<new Date?w.jsx(ih,{icon:"fas fa-clock",iconColor:"text-orange-600",iconBgColor:"bg-orange-50",iconBorderColor:"border-orange-600",title:"Trial Expired",message:"Your free trial has expired. To continue using Lyster Classic, please contact our sales team to discuss licensing options."}):w.jsx(ng,{trialExpiresAt:l.expiresAt}):l&&!l.expiresAt?f.isError?w.jsx(ih,{icon:"fas fa-exclamation-circle",iconColor:"text-red-600",iconBgColor:"bg-red-50",iconBorderColor:"border-red-600",title:"Trial Activation Failed",message:"We encountered an error while activating your free trial due to a server error. Please try refreshing the page or contact support if the issue persists.",children:w.jsx("button",{onClick:()=>f.mutate(l.offerId),className:"inline-block mt-4 px-6 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors cursor-pointer",children:"Try Again"})}):w.jsx(ng,{loading:!0,loadingSubtitle:"Starting your free trial..."}):w.jsx(ih,{icon:"fas fa-info-circle",iconColor:"text-gray-600",iconBgColor:"bg-blue-50",iconBorderColor:"border-blue-600",title:"Trial Not Available",message:"There are currently no trial offers available for your account. Please contact our sales team to discu
78ss access options."}):w.jsx(ih,{icon:"far fa-envelope",iconColor:"text-blue-600",iconBgColor:"bg-blue-50",iconBorderColor:"border-blue-600",title:"Verify Your Email",message:"Check you inbox for a verification link. If you do not receive the link within a few minutes, please contact support."}):null},Dce="/assets/hero-banner-video-C0HsLBjg.mp4",Lce="/assets/lyster-search-demo-C0j9-NQz.mp4",Uce="/assets/lyster-navigation-demo-XhP2C1Y8.mp4",Fce="/assets/lyster-arrow-creation-demo-X1wiFEbX.mp4",Hce="/assets/lyster-table-demo-DtQiJC37.mp4",Kce=()=>{const{isAuthenticated:t,isLoading:e,refreshSession:n,hasEnterpriseAgreement:i,hasVerifiedEmail:r}=ko(),{trackMeetingCtaClicked:o}=Qa();mv([Ba,af]),M.useEffect(()=>{!t||new URLSearchParams(window.location.search).get("success")!=="true"||n().finally(()=>{window.history.replaceState({},document.title,window.location.pathname)})},[t,n]);const l=Yw();return w.jsxs(w.Fragment,{children:[w.jsx(zs,{height:"h-16 sm:h-32"}),w.jsx(fi,{children:w.jsxs("div",{className:"flex flex-col gap-8 lg:flex-row items-center justify-between w-full px-8 lg:px-12 py-12 lg:py-24 bg-white",children:[w.jsxs("div",{className:"w-full lg:w-[45%] text-center lg:text-left",children:[w.jsxs("h1",{className:"text-6xl md:text-7xl text-blue-950 mb-6 font-display",children:[w.jsx("span",{className:"text-gray-800",children:"ArchiMate"}),w.jsx("span",{className:"text-gray-700 text-4xl align-super",children:"® "}),w.jsx("br",{}),w.jsx("span",{className:"text-blue-600 leading-tight",children:"Simplified."})]}),w.jsx("p",{className:"text-lg max-w-[420px] m-auto lg:m-0 text-blue-950",children:"Create professional enterprise architecture models with Lyster Classic. Easy onboarding for beginners. Powerful features for experts."}),w.jsx("div",{className:"flex flex-col gap-2 mt-8 items-center lg:items-start",children:e&&l?w.jsx(Dm,{className:"px-4 py-2 text-base w-40"}):!l||i||r?w.jsx("button",{"data-cal-namespace":Ba,"data-cal-link":vv,"data-cal-config":yo,className:"bg-gradient-to-br from-blue-500 to-blue-600 hover:from-blue-400 hover:to-blue-500 text-white px-4 py-2 text-base rounded-lg font-bold transition-all duration-150 text-center hover:shadow-xl hover:scale-105 cursor-pointer",onClick:()=>o("hero_cta","Book A Demo"),children:"Book A Demo"}):w.jsx("button",{"data-cal-namespace":af,"data-cal-link":fR,"data-cal-config":yo,className:"bg-white hover:bg-gray-100 border border-gray-300 text-blue-950 px-4 py-2 text-base rounded-lg transition-all duration-150 text-center cursor-pointer",onClick:()=>o("hero_cta","Contact Support"),children:"Contact Support"})})]}),w.jsx("div",{className:"w-full lg:w-[55%] flex justify-center items-center",style:{perspective:"1000px"},children:l?w.jsx(zce,{}):w.jsx("div",{className:"relative w-full",children:w.jsxs("div",{className:"bg-white shadow-md lg:shadow-2xl border border-gray-200 rounded-lg overflow-hidden",children:[w.jsxs("div",{className:"bg-gray-100 px-3 py-1.5 border-b border-gray-200 flex items-center relative",children:[w.jsxs("div",{className:"flex items-center space-x-1.5",children:[w.jsx("div",{className:"w-2.5 h-2.5 bg-red-500 rounded-full"}),w.jsx("div",{className:"w-2.5 h-2.5 bg-yellow-500 rounded-full"}),w.jsx("div",{className:"w-2.5 h-2.5 bg-green-500 rounded-full"})]}),w.jsx("div",{className:"absolute left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2",children:w.jsx("span",{className:"text-xs text-gray-600 font-medium",children:"Lyster Classic"})})]}),w.jsx("div",{className:"relative bg-white",children:w.jsx("video",{src:Dce,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"w-full h-auto",style:{aspectRatio:"16/9"}})})]})})})]})}),w.jsx(zs,{height:"h-16"}),w.jsx(fi,{containerClassName:"backdrop-blur-[1.5px]",children:w.jsxs("div",{id:"pricing",className:"text-center py-12 p-6 scroll-mt-24",children:[w.jsx("h2",{className:"text-4xl md:text-5xl font-display text-gray-800 mb-4",children:"Simple, transparent pricing."}),w.jsx("p",{className:"text-lg text-blue-950 max-w-2xl mx-auto",children:"Free for students and certification candidates. Flexible plans for professionals."})]})}),w.jsx(fi,{children:w.jsx(Pce,{})}),w.jsx(zs,{}),w.jsx(fi,{containerClassName:"backdrop-blur-[1.5px]",children:w.jsxs("div",{className:"text-center py-12 p-6",children:[w.jsx("h2",{className:"text-4xl md:text-5xl font-display text-gray-800 mb
78-4",children:"Frictionless editing."}),w.jsx("p",{className:"text-lg text-blue-950 max-w-2xl mx-auto",children:"ArchiMate has never been smoother."})]})}),w.jsx(fi,{children:w.jsx(J0,{videoSrc:Uce,title:"Navigates like a web browser.",description:"Browser-inspired navigation controls keep you from getting lost in your most interconnected models.",videoOnRight:!0})}),w.jsx(fi,{children:w.jsx(J0,{videoSrc:Fce,title:"Draws like a whiteboard.",description:"Create relationships with a simple drag and drop. Smart arrow routing makes grid-aligned path creation a breeze.",videoOnRight:!1})}),w.jsx(fi,{children:w.jsx(J0,{videoSrc:Hce,title:"Organizes like a spreadsheet.",description:"Switching between diagram and table layouts brings the best of both worlds: rich metadata and intuitive visualizations.",videoOnRight:!0})}),w.jsx(fi,{children:w.jsx(J0,{videoSrc:Lce,title:"Searches like a database.",description:"Find any element, view or folder with string matching and layer-based filtering.",videoOnRight:!1})}),w.jsx(zs,{}),w.jsx(fi,{containerClassName:"backdrop-blur-[1.5px]",children:w.jsxs("div",{className:"text-center py-12 p-6",children:[w.jsx("h2",{className:"text-4xl md:text-5xl font-display text-gray-800 mb-4",children:"Interoperable with Archi®."}),w.jsx("p",{className:"text-lg text-blue-950 max-w-2xl mx-auto",children:"Lyster Classic is built from the ground up to enable seamless collaboration with Archi users via Git version control."})]})}),w.jsx(fi,{children:w.jsx(Ace,{})}),w.jsx(zs,{})]})},Zce=["ArchiMate® Models","BPMN Diagrams","EDGY Designs","AWS Architectures","Capability Maps","App Portfolios","C4/UML Models","Network Diagrams","Org Charts"],$D=({color:t,borderColor:e})=>w.jsx("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{fill:t,stroke:e,strokeWidth:"1",strokeLinejoin:"round",d:"M5.65376 12.3673H5.46026L5.31717 12.4976L0.500002 16.8829L0.500002 1.19841L11.7841 12.3673H5.65376Z"})});function Wce(t,e=2500,n=350){const[i,r]=M.useState(()=>t[0]),[o,l]=M.useState(""),[u,d]=M.useState(!1),f=M.useRef(!1),p=M.useRef(0),g=M.useRef(null);f.current=u;const v=M.useCallback(()=>{if(f.current)return;g.current&&(clearTimeout(g.current),g.current=null);const b=(p.current+1)%t.length;p.current=b,l(t[b]),d(!0)},[t]),y=M.useCallback(()=>{f.current&&(r(t[p.current]),l(""),d(!1),g.current=setTimeout(v,e))},[t,e,v]);return M.useEffect(()=>(g.current=setTimeout(v,e),()=>{g.current&&clearTimeout(g.current),g.current=null}),[v,e]),{current:i,next:o,sliding:u,transitionDuration:n,flipNext:v,onSlideEnd:y}}const qce=()=>w.jsx("div",{className:"relative w-full rounded-lg md:rounded-2xl overflow-hidden",style:{aspectRatio:"16/9",boxShadow:"0 20px 40px -10px rgba(0,0,0,0.12)"},children:w.jsx("video",{className:"absolute inset-0 w-full h-full object-contain",src:"https://cdn.lyster.io/marketing/teaser_loop_1920px_1080px.mp4",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"auto","aria-label":"Teaser of Lyster, a collaborative architecture editor"})}),AD="bg-gradient-to-br from-blue-500 to-blue-600 hover:from-blue-400 hover:to-blue-500 text-white px-4 py-2 text-base rounded-lg font-bold transition-all duration-150 text-center hover:shadow-xl hover:scale-105 cursor-pointer",Vce=()=>{const{current:t,next:e,sliding:n,transitionDuration:i,flipNext:r,onSlideEnd:o}=Wce(Zce),{trackMeetingCtaClicked:l}=Qa(),u=Yw();return w.jsx("div",{className:"w-full max-w-7xl bg-white relative z-10 mx-auto",children:w.jsxs("div",{className:"flex flex-col gap-10 lg:flex-row items-center justify-between w-full px-8 lg:px-12 py-12 lg:py-24",children:[w.jsxs("div",{className:"w-full lg:w-[480px] lg:shrink-0 text-center lg:text-left relative",children:[w.jsxs("h1",{className:"text-4xl md:text-5xl text-blue-950 mb-6 font-display leading-snug",children:[w.jsx("span",{className:"text-blue-950",children:"Collaborate On"}),w.jsx("br",{}),w.jsxs("span",{className:"relative block select-none cursor-default",style:{lineHeight:"1.2em"},onClick:r,children:[w.jsx("span",{className:"inline-block overflow-hidden align-bottom",style:{height:"1.2em"},children:w.jsxs("span",{className:"inline-block text-blue-600",onTransitionEnd:d=>{d.propertyName==="transform"&&o()},style:{transform:n?"translateY(-50%)":"translateY(0)",transition:`transform ${i}ms ease-in-out`},children:[w.jsx("span",{className:"block",style:{height:"1.2em",lineHeight:"1.2em"},children:t}),w.jsx("span",{className:"block",style:{height:"1.2em",lineHeight:"1.2em"},children:e})]},t)}),w.jsx("span",{className:"absolute top-0 bottom-0 -left-3 -right-3 lg:-left-3 lg:right-8 rounded-xl border border-blue-200/60 pointer-events-none",style:{background:"linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 50%, rgba(219,234,254,0.15) 100%)",boxShadow:"inset 0 1px 2px rgba(255,255,255,0.5), 0 1px 3px rgba(59,130,246,0.1)"}})]}),w.jsx("span",{className:"text-blue-950",children:"In Real Time"})]}),w.jsx("p",{className:"text-lg max-w-[460px] m-auto lg:m-0 text-blue-950",children:"Your systems are all connected, so why aren't your diagrams? Turn your scattered drawings into one living source of truth with Lyster."}),w.jsxs("div",{className:"flex flex-col gap-2 mt-8 items-center lg:items-start relative",children:[w.jsx("div",{className:"absolute left-1/2 -top-4 -translate-x-48 lg:translate-x-0 lg:-top-[22rem] lg:left-auto lg:right-8 pointer-events-none",style:{filter:"drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.1))"},children:w.jsx("div",{className:"rotate-[140deg] lg:-rotate-90",children:w.jsx($D,{color:"#3b82f6",borderColor:"#2563eb"})})}
78),u?w.jsx("button",{"data-cal-namespace":Ba,"data-cal-link":vv,"data-cal-config":yo,onClick:()=>l("landing_hero","Book A Demo"),className:AD,children:"Book A Demo"}):w.jsx("button",{"data-cal-namespace":hR,"data-cal-link":l8,"data-cal-config":yo,onClick:()=>l("landing_hero","Start Your 14-Day Free Trial"),className:AD,children:"Start Your 14-Day Free Trial"}),!u&&w.jsx("p",{className:"text-sm text-blue-950",children:"No credit card required."}),w.jsx("div",{className:"absolute left-1/2 top-4 translate-x-36 lg:translate-x-0 lg:left-auto lg:right-24 lg:top-0 pointer-events-none",style:{filter:"drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.1))"},children:w.jsx("div",{style:{transform:"rotate(-5deg)"},children:w.jsx($D,{color:"#facc15",borderColor:"#ca8a04"})})})]})]}),w.jsx("div",{className:"w-full lg:flex-1 flex justify-center items-center",children:w.jsx("div",{className:"relative w-full",children:w.jsx(qce,{})})})]})})},Bce="https://cdn.lyster.io/marketing/launch_demo_without_zoom_4k.mp4",Gce="16 / 9",Jce=()=>{const t=M.useRef(null),[e,n]=M.useState(!1),[i,r]=M.useState(null),[o,l]=M.useState(null),u=M.useCallback(()=>n(!0),[]),d=M.useCallback(()=>{const p=t.current;!p?.videoWidth||!p.videoHeight||l(`${p.videoWidth} / ${p.videoHeight}`)},[]),f=M.useCallback(()=>{const p=t.current;if(!p||!p.duration||!Number.isFinite(p.duration))return;const{buffered:g}=p;if(g.length===0)return;const v=g.end(g.length-1)/p.duration;r(Math.min(100,Math.round(v*100)))},[]);return M.useEffect(()=>{const p=t.current;p&&(p.readyState>=1&&d(),p.readyState>=3&&n(!0))},[d]),w.jsxs("div",{className:"px-6 sm:px-10 lg:px-16 py-12 lg:py-16",children:[w.jsx("div",{className:"max-w-5xl mx-auto text-center mb-8 lg:mb-10",children:w.jsx("h2",{className:"text-4xl md:text-5xl font-display text-blue-950 leading-[1.1]",children:"Your map for navigating a world of complexity."})}),w.jsx("div",{className:"max-w-6xl mx-auto",children:w.jsxs("div",{className:"relative w-[100%] mx-auto rounded-md lg:rounded-md overflow-hidden bg-blue-50 border border-zinc-300",style:{aspectRatio:o??Gce,boxShadow:"0 18px 60px -20px rgba(15, 23, 42, 0.5), 0 6px 20px -10px rgba(15,23,42,0.08)"},children:[w.jsx("video",{ref:t,className:`block w-full h-full object-contain transition-opacity duration-500 ${e?"opacity-100":"opacity-0"}`,src:Bce,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"metadata","aria-label":"Lyster screen recording",onLoadedMetadata:d,onCanPlay:u,onPlaying:u,onProgress:f}),!e&&w.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 bg-blue-50","aria-hidden":"true",children:[w.jsx(cce,{size:"lg"}),w.jsx("span",{className:"text-sm text-gray-500 tabular-nums",children:i===null?"Loading demo…":`Loading demo… ${i}%`})]})]})})]})};function h8(t){const[e,n]=M.useState(()=>typeof window<"u"&&window.matchMedia(t).matches);return M.useEffect(()=>{const i=window.matchMedia(t),r=()=>n(i.matches);return r(),i.addEventListener("change",r),()=>i.removeEventListener("change",r)},[t]),e}const Xce="https://cdn.lyster.io/branding/logo_2000px.svg",Yce={gray:["#eef2f7","#9aa5b4","#cdd5df"]};function Qce({cx:t,cy:e,s:n,opacity:i=1}){const[r,o,l]=Yce.gray,u=n*.866,d=`${t},${e-n}`,f=`${t+u},${e-n/2}`,p=`${t+u},${e+n/2}`,g=`${t},${e+n}`,v=`${t-u},${e+n/2}`,y=`${t-u},${e-n/2}`,b=`${t},${e}`;return w.jsxs("g",{opacity:i,children:[w.jsx("polygon",{points:`${d} ${f} ${b} ${y}`,fill:r}),w.jsx("polygon",{points:`${f} ${p} ${g} ${b}`,fill:l}),w.jsx("polygon",{points:`${y} ${b} ${g} ${v}`,fill:o}),w.jsx("polygon",{points:`${d} ${f} ${p} ${g} ${v} ${y}`,fill:"none",stroke:"rgba(15,23,42,0.06)",strokeWidth:"0.5"})]})}function eue({cx:t,cy:e,size:n}){return w.jsxs("g",{children:[w.jsxs("circle",{cx:t,cy:e,r:n*.95,fill:"url(#brandHalo)",opacity:.55,children:[w.jsx("animate",{attributeName:"r",values:`${n*.85};${n*1.05};${n*.85}`,dur:"6s",repeatCount:"indefinite"}),w.jsx("animate",{attributeName:"opacity",values:"0.4;0.7;0.4",dur:"6s",repeatCount:"indefinite"})]}),w.jsx("circle",{cx:t,cy:e,r:n*1.4,fill:"url(#brandHalo)",opacity:.18,children:w.jsx("animate",{attributeName:"r",values:`${n*1.3};${n*1.55};${n*1.3}
78`,dur:"9s",repeatCount:"indefinite"})}),w.jsx("image",{href:Xce,x:t-n,y:e-n,width:n*2,height:n*2,style:{filter:"drop-shadow(0 12px 28px rgba(15,23,42,0.18))"}})]})}function tue(){const t={x:800,y:540},n=[{id:"ne",angle:50,r:215,s:18,anchor:"topRight"},{id:"n",angle:88,r:175,s:14,anchor:null},{id:"nw1",angle:130,r:195,s:17,anchor:"topLeft"},{id:"w",angle:180,r:205,s:14,anchor:"midLeft"},{id:"sw",angle:215,r:215,s:19,anchor:"botLeft"},{id:"s",angle:270,r:195,s:13,anchor:null},{id:"se",angle:325,r:215,s:19,anchor:"botRight"},{id:"e",angle:0,r:200,s:16,anchor:"midRight"},{id:"i1",angle:25,r:105,s:12,anchor:null},{id:"i2",angle:115,r:100,s:12,anchor:null},{id:"i3",angle:205,r:110,s:12,anchor:null},{id:"i4",angle:295,r:100,s:12,anchor:null}].map(l=>{const u=l.angle*Math.PI/180;return{...l,x:t.x+Math.cos(u)*l.r,y:t.y-Math.sin(u)*l.r}}),i=[["ne","n"],["n","nw1"],["nw1","w"],["w","sw"],["sw","s"],["s","se"],["se","e"],["e","ne"],["ne","i1"],["nw1","i2"],["sw","i3"],["se","i4"],["i1","i2"],["i2","i3"],["i3","i4"],["i4","i1"],["n","i1"],["n","i2"],["s","i3"],["s","i4"],["w","i2"],["w","i3"],["e","i1"],["e","i4"]],r=Object.fromEntries(n.map(l=>[l.id,l])),o=i.map(([l,u],d)=>({id:`e${d}`,a:r[l],b:r[u]}));return{center:t,nodes:n,edges:o,byId:r}}function nue(t,e,{attack:n=.45,decay:i=1.6,scale:r=1}={}){const o=[[-n,0],[-n*.65,.12],[-n*.35,.45],[-n*.12,.85],[0,1],[i*.1,.92],[i*.25,.7],[i*.45,.42],[i*.65,.2],[i*.85,.06],[i,0]],l=[],u=(f,p)=>{f=Math.max(0,Math.min(e,f)),!(l.length&&Math.abs(l[l.length-1].t-f)<1e-4)&&l.push({t:f,v:p})};u(0,0);const d=[...t].filter(f=>f>=0&&f<=e).sort((f,p)=>f-p);for(const f of d)for(const[p,g]of o)u(f+p,g*r);return l[l.length-1].t<e&&u(e,0),{values:l.map(f=>f.v.toFixed(3)).join(";"),keyTimes:l.map(f=>Math.min(1,f.t/e).toFixed(5)).join(";")}}function iue({cx:t,cy:e,s:n,color:i,faces:r,cycle:o,times:l}){const u=n*.866,d=`${t},${e-n}`,f=`${t+u},${e-n/2}`,p=`${t+u},${e+n/2}`,g=`${t},${e+n}`,v=`${t-u},${e+n/2}`,y=`${t-u},${e-n/2}`,b=`${t},${e}`,x=nue(l,o,{attack:.5,decay:1.6});return w.jsxs("g",{style:{pointerEvents:"none"},opacity:"0",children:[w.jsx("polygon",{points:`${d} ${f} ${b} ${y}`,fill:r[0]}),w.jsx("polygon",{points:`${f} ${p} ${g} ${b}`,fill:r[2]}),w.jsx("polygon",{points:`${y} ${b} ${g} ${v}`,fill:r[1]}),w.jsx("polygon",{points:`${d} ${f} ${p} ${g} ${v} ${y}`,fill:"none",stroke:i,strokeWidth:"0.4",opacity:"0.6"}),w.jsx("animate",{attributeName:"opacity",values:x.values,keyTimes:x.keyTimes,dur:`${o}s`,repeatCount:"indefinite"})]})}const rue=({w:t,h:e,mono:n})=>{const i=n?{net:"#94a3b8",compute:"#94a3b8",db:"#94a3b8",storage:"#94a3b8",monitor:"#94a3b8",line:"#cbd5e1",group:"#cbd5e1",groupInner:"#cbd5e1"}:{net:"#7c3aed",compute:"#f97316",db:"#2563eb",storage:"#16a34a",monitor:"#dc2626",line:"#94a3b8",group:"#818cf8",groupInner:"#818cf8"},r={x:30,y:56},o={x:96,y:56},l={x:180,y:56},u={x:246,y:56},d={x:180,y:122},f={x:246,y:122},p=22,g=A=>({left:A.x,right:A.x+p,top:A.y,bot:A.y+p,mx:A.x+p/2,my:A.y+p/2}),v=g(r),y=g(o),b=g(l),x=g(u),S=g(d),k=g(f),T=({d:A})=>w.jsx("path",{d:A,fill:"none",stroke:i.line,strokeWidth:"1.1",strokeLinecap:"round",strokeLinejoin:"round"}),C=({n:A,fill:$,glyph:N})=>w.jsxs("g",{children:[w.jsx("rect",{x:A.x,y:A.y,width:p,height:p,rx:"3",fill:$}),N]});return w.jsxs("svg",{viewBox:"10 30 300 138",width:t,height:e,style:{display:"block"},children:[w.jsx("rect",{x:"14",y:"34",width:"290",height:"130",rx:"6",fill:"none",stroke:i.group,strokeWidth:"1",strokeDasharray:"4 3",opacity:"0.75"}),w.jsx("rect",{x:"150",y:"46",width:"148",height:"106",rx:"4",fill:"none",stroke:i.groupInner,strokeWidth:"0.8",opacity:"0.55"}),w.jsx(C,{n:r,fill:i.net,glyph:w.jsxs("g",{children:[w.jsx("circle",{cx:v.mx,cy:v.my,r:"6",fill:"none",stroke:"#fff",strokeWidth:"1.2"}),w.jsx("path",{d:`M ${v.mx-6} ${v.my} Q ${v.mx} ${v.my-4} ${v.mx+6} ${v.my}`,fill:"none",stroke:"#fff",strokeWidth:"1"}),w.jsx("path",{d:`M ${v.mx-6} ${v.my} Q ${v.mx} ${v.my+4} ${v.mx+6} ${v.my}`,fill:"none",stroke:"#fff",strokeWidth:"1"}),w.jsx("line",{x1:v.mx,y1:v.my-6,x2:v.mx,y2:v.my+6,stroke:"#fff",strokeWidth:"1"})]})}),w.jsx(C,{n:o,fill:i.net,glyph:w.jsxs("g",{children:[w.jsx("polygon",{points:`${y.mx},${y.my-6} ${y.mx+6},${y.my} ${y.mx},${y.my+6} ${y.mx-6},${y.my}
78`,fill:"none",stroke:"#fff",strokeWidth:"1.2"}),w.jsx("circle",{cx:y.mx,cy:y.my,r:"1.6",fill:"#fff"})]})}),w.jsx(C,{n:l,fill:i.compute,glyph:w.jsx("text",{x:b.mx,y:b.my+4,fontSize:"13",fontWeight:"700",fill:"#fff",textAnchor:"middle",fontFamily:"Inter, sans-serif",children:"λ"})}),w.jsx(C,{n:u,fill:i.db,glyph:w.jsxs("g",{children:[w.jsx("ellipse",{cx:x.mx,cy:x.my-4,rx:"6",ry:"2",fill:"none",stroke:"#fff",strokeWidth:"1.1"}),w.jsx("line",{x1:x.mx-6,y1:x.my-4,x2:x.mx-6,y2:x.my+4,stroke:"#fff",strokeWidth:"1.1"}),w.jsx("line",{x1:x.mx+6,y1:x.my-4,x2:x.mx+6,y2:x.my+4,stroke:"#fff",strokeWidth:"1.1"}),w.jsx("ellipse",{cx:x.mx,cy:x.my+4,rx:"6",ry:"2",fill:"none",stroke:"#fff",strokeWidth:"1.1"})]})}),w.jsx(C,{n:d,fill:i.storage,glyph:w.jsxs("g",{children:[w.jsx("path",{d:`M ${S.mx-6} ${S.my-4} L ${S.mx-5} ${S.my+5} L ${S.mx+5} ${S.my+5} L ${S.mx+6} ${S.my-4} Z`,fill:"none",stroke:"#fff",strokeWidth:"1.1",strokeLinejoin:"round"}),w.jsx("line",{x1:S.mx-6,y1:S.my-4,x2:S.mx+6,y2:S.my-4,stroke:"#fff",strokeWidth:"1.1"})]})}),w.jsx(C,{n:f,fill:i.monitor,glyph:w.jsxs("g",{children:[w.jsx("circle",{cx:k.mx,cy:k.my,r:"6",fill:"none",stroke:"#fff",strokeWidth:"1.2"}),w.jsx("line",{x1:k.mx,y1:k.my,x2:k.mx,y2:k.my-4,stroke:"#fff",strokeWidth:"1.1"}),w.jsx("line",{x1:k.mx,y1:k.my,x2:k.mx+3,y2:k.my+2,stroke:"#fff",strokeWidth:"1.1"})]})}),w.jsx(T,{d:`M ${v.right} ${v.my} L ${y.left} ${y.my}`}),w.jsx("polygon",{points:`${y.left},${y.my} ${y.left-4},${y.my-2} ${y.left-4},${y.my+2}`,fill:i.line}),w.jsx(T,{d:`M ${y.right} ${y.my} L ${b.left} ${b.my}`}),w.jsx("polygon",{points:`${b.left},${b.my} ${b.left-4},${b.my-2} ${b.left-4},${b.my+2}`,fill:i.line}),w.jsx(T,{d:`M ${b.right} ${b.my} L ${x.left} ${x.my}`}),w.jsx("polygon",{points:`${x.left},${x.my} ${x.left-4},${x.my-2} ${x.left-4},${x.my+2}`,fill:i.line}),w.jsx(T,{d:`M ${b.mx} ${b.bot} L ${b.mx} ${S.top}`}),w.jsx("polygon",{points:`${S.mx},${S.top} ${S.mx-2},${S.top-4} ${S.mx+2},${S.top-4}`,fill:i.line}),w.jsx(T,{d:`M ${S.right} ${S.my} L ${k.left} ${k.my}`}),w.jsx("polygon",{points:`${k.left},${k.my} ${k.left-4},${k.my-2} ${k.left-4},${k.my+2}`,fill:i.line}),w.jsx(T,{d:`M ${x.mx} ${x.bot} L ${k.mx} ${k.top}`}),w.jsx("polygon",{points:`${k.mx},${k.top} ${k.mx-2},${k.top-4} ${k.mx+2},${k.top-4}`,fill:i.line})]})},sue=({w:t,h:e,mono:n})=>{const i=n?{lane:"#f1f5f9",blue:"#cbd5e1",node:"#e2e8f0",line:"#cbd5e1",border:"#e2e8f0"}:{lane:"#eff6ff",blue:"#60a5fa",node:"#dbeafe",line:"#93c5fd",border:"#bfdbfe"};return w.jsxs("svg",{viewBox:"0 0 300 180",width:t,height:e,style:{display:"block"},children:[w.jsx("rect",{x:"22",y:"14",width:"266",height:"50",fill:i.lane,stroke:i.border,strokeWidth:"0.8"}),w.jsx("rect",{x:"22",y:"64",width:"266",height:"50",fill:"#fff",stroke:i.border,strokeWidth:"0.8"}),w.jsx("rect",{x:"22",y:"114",width:"266",height:"50",fill:i.lane,stroke:i.border,strokeWidth:"0.8"}),w.jsx("rect",{x:"22",y:"14",width:"20",height:"150",fill:i.blue,opacity:"0.18"}),w.jsx("circle",{cx:"32",cy:"39",r:"5",fill:i.blue,opacity:"0.6"}),w.jsx("circle",{cx:"32",cy:"89",r:"5",fill:i.blue,opacity:"0.6"}),w.jsx("circle",{cx:"32",cy:"139",r:"5",fill:i.blue,opacity:"0.6"}),w.jsx("circle",{cx:"62",cy:"89",r:"9",fill:"none",stroke:i.blue,strokeWidth:"1.6"}),w.jsx("line",{x1:"71",y1:"89",x2:"92",y2:"89",stroke:i.line,strokeWidth:"1.2"}),w.jsx("polygon",{points:"92,89 88,87 88,91",fill:i.line}),w.jsx("rect",{x:"92",y:"78",width:"44",height:"22",rx:"3",fill:i.node,stroke:i.blue,strokeWidth:"1"}),w.jsx("line",{x1:"136",y1:"89",x2:"168",y2:"89",stroke:i.line,strokeWidth:"1.2"}),w.jsx("polygon",{points:"168,89 164,87 164,91",fill:i.line}),w.jsx("polygon",{points:"168,89 180,77 192,89 180,101",fill:"#fff",stroke:i.blue,strokeWidth:"1.4"}),w.jsx("path",{d:"M 180 77 L 180 39 L 200 39",fill:"none",stroke:i.line,strokeWidth:"1.2"}),w.jsx("polygon",{points:"200,39 196,37 196,41",fill:i.line}),w.jsx("rect",{x:"200",y:"28",width:"44",height:"22",rx:"3",fill:i.node,stroke:i.blue,strokeWidth:"1"}),w.jsx("path",{d:"M 180 101 L 180 139 L 262 139",fill:"none",stroke:i.line,strokeWidth:"1.2"}),w.jsx("polygon",{points:"262,139 258,137 258,141",fill:i.line}
78),w.jsx("circle",{cx:"270",cy:"139",r:"8",fill:"none",stroke:i.blue,strokeWidth:"2"})]})},oue=({w:t,h:e,mono:n})=>{const i=n?{box:"#e2e8f0",border:"#cbd5e1",line:"#cbd5e1"}:{box:"#e9d5ff",border:"#c4b5fd",line:"#c4b5fd"};return w.jsxs("svg",{viewBox:"0 0 320 180",width:t,height:e,style:{display:"block"},children:[w.jsx("circle",{cx:"40",cy:"30",r:"10",fill:"none",stroke:i.border,strokeWidth:"1.6"}),w.jsx("line",{x1:"40",y1:"40",x2:"40",y2:"60",stroke:i.line,strokeWidth:"1.2"}),w.jsx("polygon",{points:"40,60 38,56 42,56",fill:i.line}),w.jsx("rect",{x:"20",y:"60",width:"280",height:"80",rx:"6",fill:"#fff",stroke:i.border,strokeWidth:"1"}),w.jsx("rect",{x:"40",y:"76",width:"80",height:"22",rx:"3",fill:i.box}),w.jsx("rect",{x:"140",y:"76",width:"80",height:"22",rx:"3",fill:i.box}),w.jsx("rect",{x:"240",y:"76",width:"50",height:"22",rx:"3",fill:i.box}),w.jsx("line",{x1:"120",y1:"87",x2:"140",y2:"87",stroke:i.line,strokeWidth:"1.2"}),w.jsx("polygon",{points:"140,87 136,85 136,89",fill:i.line}),w.jsx("line",{x1:"220",y1:"87",x2:"240",y2:"87",stroke:i.line,strokeWidth:"1.2"}),w.jsx("polygon",{points:"240,87 236,85 236,89",fill:i.line}),w.jsx("rect",{x:"100",y:"108",width:"120",height:"22",rx:"3",fill:i.box}),w.jsx("line",{x1:"80",y1:"98",x2:"80",y2:"119",stroke:i.line,strokeWidth:"1.2"}),w.jsx("line",{x1:"80",y1:"119",x2:"100",y2:"119",stroke:i.line,strokeWidth:"1.2"}),w.jsx("polygon",{points:"100,119 96,117 96,121",fill:i.line}),w.jsx("polygon",{points:"160,148 174,162 160,176 146,162",fill:"none",stroke:i.border,strokeWidth:"1.6"}),w.jsx("line",{x1:"160",y1:"130",x2:"160",y2:"148",stroke:i.line,strokeWidth:"1.2"}),w.jsx("polygon",{points:"160,148 158,144 162,144",fill:i.line}),w.jsx("circle",{cx:"220",cy:"162",r:"8",fill:"none",stroke:i.border,strokeWidth:"2"}),w.jsx("line",{x1:"174",y1:"162",x2:"212",y2:"162",stroke:i.line,strokeWidth:"1.2"}),w.jsx("polygon",{points:"212,162 208,160 208,164",fill:i.line})]})},aue=({w:t,h:e,mono:n})=>{const i=n?{border:"#cbd5e1",line:"#cbd5e1",person:"#94a3b8"}:{border:"#86efac",line:"#86efac",person:"#16a34a"},r=({x:o,y:l})=>w.jsxs("g",{transform:`translate(${o},${l})`,children:[w.jsx("rect",{x:"0",y:"0",width:"44",height:"28",rx:"3",fill:"#fff",stroke:i.border,strokeWidth:"1"}),w.jsx("circle",{cx:"22",cy:"11",r:"4",fill:i.person}),w.jsx("path",{d:"M 14 22 Q 22 16 30 22",fill:i.person})]});return w.jsxs("svg",{viewBox:"10 9 291 164",width:t,height:e,style:{display:"block"},children:[w.jsx(r,{x:138,y:18}),w.jsx("line",{x1:"160",y1:"46",x2:"160",y2:"62",stroke:i.line,strokeWidth:"1.2"}),w.jsx("line",{x1:"60",y1:"62",x2:"260",y2:"62",stroke:i.line,strokeWidth:"1.2"}),w.jsx("line",{x1:"60",y1:"62",x2:"60",y2:"78",stroke:i.line,strokeWidth:"1.2"}),w.jsx("line",{x1:"160",y1:"62",x2:"160",y2:"78",stroke:i.line,strokeWidth:"1.2"}),w.jsx("line",{x1:"260",y1:"62",x2:"260",y2:"78",stroke:i.line,strokeWidth:"1.2"}),w.jsx(r,{x:38,y:78}),w.jsx(r,{x:138,y:78}),w.jsx(r,{x:238,y:78}),w.jsx("line",{x1:"60",y1:"106",x2:"60",y2:"122",stroke:i.line,strokeWidth:"1.2"}),w.jsx("line",{x1:"34",y1:"122",x2:"82",y2:"122",stroke:i.line,strokeWidth:"1.2"}),w.jsx("line",{x1:"34",y1:"122",x2:"34",y2:"138",stroke:i.line,strokeWidth:"1.2"}),w.jsx("line",{x1:"82",y1:"122",x2:"82",y2:"138",stroke:i.line,strokeWidth:"1.2"}),w.jsx(r,{x:12,y:138}),w.jsx(r,{x:60,y:138}),w.jsx("line",{x1:"160",y1:"106",x2:"160",y2:"122",stroke:i.line,strokeWidth:"1.2"}),w.jsx("line",{x1:"134",y1:"122",x2:"182",y2:"122",stroke:i.line,strokeWidth:"1.2"}),w.jsx("line",{x1:"134",y1:"122",x2:"134",y2:"138",stroke:i.line,strokeWidth:"1.2"}),w.jsx("line",{x1:"182",y1:"122",x2:"182",y2:"138",stroke:i.line,strokeWidth:"1.2"}),w.jsx(r,{x:112,y:138}),w.jsx(r,{x:160,y:138}),w.jsx("line",{x1:"260",y1:"106",x2:"260",y2:"138",stroke:i.line,strokeWidth:"1.2"}),w.jsx(r,{x:238,y:138})]})},lue=({w:t,h:e,mono:n})=>{const i=n?{grp:"#f1f5f9",grpStroke:"#cbd5e1",cap:"#ffffff",capStroke:"#cbd5e1",glyph:"#94a3b8"}:{grp:"#fef3c7",grpStroke:"#fbbf24",cap:"#fef9c3",capStroke:"#f59e0b",glyph:"#b45309"},r=({x:u,y:d})=>w.jsxs("g",{opacity:"0.55",children:[w.jsx("rect",{x:u,y:d,width:"5",height:"2.5",fill:"none",stroke:i.glyph,strokeWidth:"0.5"}),w.jsx("rect",{x:u-1,y:d+1,width:"5",height:"2.5",fill:"none",stroke:i.glyph,strokeWidth:"0.5"})]}),o=({x:u,y:d,w:f,h:p})=>w.jsxs("g",{children:[w.jsx("rect",{x:u,y:d,width:f,height:p,rx:"2.5",fill:i.cap,stroke:i.capStroke,strokeWidth:"0.7"}),w.jsx(r,{x:u+f-7,y:d+2})]}),l=({x:u,y:d,w:f,h:p,children:g})=>w.jsxs("g",{children:[w.jsx("rect",{x:u,y:d,width:f,height:p,rx:"3",fill:i.grp,stroke:i.grpStroke,strokeWidth:"0.8"}),w.jsx(r,{x:u+f-8,y:d+2.5}),g]});return w.jsxs("svg",{viewBox:"0 0 300 180",width:t,height:e,style:{display:"block"},children:[w.jsxs(l,{x:6,y:6,w:288,h:36,children:[w.jsx(o,{x:12,y:20,w:62,h:18}),w.jsx(o,{x:80,y:20,w:62,h:18}),w.jsx(o,{x:148,y:20,w:62,h:18}),w.jsx(o,{x:216,y:20,w:72,h:18})]}),w.jsxs(l,{x:6,y:50,w:92,h:74,children:[w.jsx(o,{x:12,y:66,w:80,h:20}),w.jsx(o,{x:12,y:94,w:80,h:20})]}),w.jsxs(l,{x:104,y:50,w:92,h:74,children:[w.jsx(o,{x:110,y:66,w:80,h:20}),w.jsx(o,{x:110,y:94,w:80,h:20})]}),w.jsxs(l,{x:202,y:50,w:92,h:74,children:[w.jsx(o,{x:208,y:66,w:80,h:20}),w.jsx(o,{x:208,y:94,w:80,h:20})]}),w.jsxs(l,{x:6,y:132,w:288,h:42,children:[w.jsx(o,{x:12,y:148,w:48,h:20}),w.jsx(o,{x:66,y:148,w:48,h:20}),w.jsx(o,{x:120,y:148,w:56,h:20}),w.jsx(o,{x:182,y:148,w:48,h:20}),w.jsx(o,{x:236,y:148,w:52,h:20})]})]})},cue=({w:t,h:e,mono:n})=>{const i=n?{head:"#cbd5e1",row:"#e2e8f0",line:"#cbd5e1"}:{head:"#fb923c",row:"#fed7aa",line:"#fb923c"},r=11,o=({x:l,y:u,rows:d=3})=>w.jsxs("g",{transform:`translate(${l},${u})`,children:[w.jsx("rect",{x:"0",y:"0",width:"64",height:10+d*r+3,rx:"2",fill:"#fff",stroke:i.head,strokeWidth:"0.8"}),w.jsx("rect",{x:"0",y:"0",width:"64",height:"10",rx:"2",fill:i.head}),Array.from({length:d}).map((f,p)=>w.jsx("rect",{x:"4",y:12+p*r,width:"56",height:"8",rx:"1",fill:i.row,opacity:"0.7"},p))]});return w.jsxs("svg",{viewBox:"0 0 320 180",width:t,height:e,style:{display:"block"},children:[w.jsx(o,{x:22,y:12,rows:3}),w.jsx(o,{x:130,y:12,rows:4}),w.jsx(o,{x:238,y:12,rows:3}),w.jsx(o,{x:22,y:112,rows:3}),w.jsx(o,{x:130,y:112,rows:3}),w.jsx(o,{x:238,y:112,rows:4}),w.jsx("line",{x1:"86",y1:"30",x2:"130",y2:"30",stroke:i.line,strokeWidth:"1"}),w.jsx("line",{x1:"194",y1:"30",x2:"238",y2:"30",stroke:i.line,strokeWidth:"1"}),w.jsx("line",{x1:"54",y1:"58",x2:"54",y2:"112",stroke:i.line,strokeWidth:"1",strokeDasharray:"2 2"}),w.jsx("line",{x1:"86",y1:"130",x2:"130",y2:"130",stroke:i.line,strokeWidth:"1"}),w.jsx("line",{x1:"194",y1:"130",x2:"238",y2:"130",stroke:i.line,strokeWidth:"1"}),w.jsx("line",{x1:"162",y1:"69",x2:"162",y2:"112",stroke:i.line,strokeWidth:"1",strokeDasharray:"2 2"})]})},uue={AWS:rue,BPMN:sue,FLOW:oue,ORG:aue,CAPMAP:lue,ERD:cue},Lm=.8,due=[{id:"topLeft",x:70,y:70,w:340,h:200,kind:"AWS",label:"Network Architecture",anchor:"nw1",color:"#8b5cf6",glow:["#ede9fe","#8b5cf6","#7c3aed"],float:0},{id:"midLeft",x:30,y:420,w:320,h:200,kind:"BPMN",label:"Business Processes",anchor:"w",color:"#06b6d4",glow:["#cffafe","#06b6d4","#0891b2"],float:1.2},{id:"botLeft",x:70,y:790,w:340,h:220,kind:"FLOW",label:"Sequence Diagrams",anchor:"sw",color:"#a85
785f7",glow:["#f3e8ff","#a855f7","#9333ea"],float:2.4},{id:"topRight",x:1190,y:70,w:340,h:200,kind:"ORG",label:"Org Chart",anchor:"ne",color:"#16a34a",glow:["#dcfce7","#16a34a","#15803d"],float:.6},{id:"midRight",x:1250,y:420,w:320,h:200,kind:"CAPMAP",label:"Application Portfolio",anchor:"e",color:"#f59e0b",glow:["#fef3c7","#f59e0b","#d97706"],float:1.8},{id:"botRight",x:1190,y:790,w:340,h:220,kind:"ERD",label:"Data Model",anchor:"se",color:"#f97316",glow:["#ffedd5","#f97316","#ea580c"],float:3}];function hue(t){const n=5.2*(1/Lm),i=t*.85%n,r=(t*.85+n/2)%n,o=((n-i)%n+n)%n,l=((n-r)%n+n)%n;return{cycle:n,times:[o,l]}}function fue(t,e){const n=t.x+t.w/2,i=t.y+t.h/2,r=e.x-n,o=e.y-i;return Math.abs(r)>Math.abs(o)?{x:r>0?t.x+t.w:t.x,y:i}:{x:n,y:o>0?t.y+t.h:t.y}}function pue(t,e){const n=(t.x+e.x)/2,i=(t.y+e.y)/2,r=e.x-t.x,o=e.y-t.y,l=Math.hypot(r,o),u=-o/l,d=r/l,f=Math.min(40,l*.12),p=n+u*f,g=i+d*f;return{d:`M ${t.x} ${t.y} Q ${p} ${g} ${e.x} ${e.y}`}}const gue=({card:t})=>{const e=uue[t.kind],n=18,i=30,r=t.w-n*2,o=t.h-n*2-i;return w.jsxs("g",{style:{animation:`card-float-${t.id} ${8+t.float*.7}s ease-in-out infinite`,animationDelay:`${t.float*-.6}s`,transformOrigin:`${t.x+t.w/2}px ${t.y+t.h/2}px`,transformBox:"fill-box"},children:[w.jsx("defs",{children:w.jsxs("filter",{id:`s1-shadow-${t.id}`,x:"-20%",y:"-20%",width:"140%",height:"140%",children:[w.jsx("feGaussianBlur",{in:"SourceAlpha",stdDeviation:"6"}),w.jsx("feOffset",{dx:"0",dy:"4"}),w.jsx("feComponentTransfer",{children:w.jsx("feFuncA",{type:"linear",slope:"0.12"})}),w.jsxs("feMerge",{children:[w.jsx("feMergeNode",{}),w.jsx("feMergeNode",{in:"SourceGraphic"})]})]})}),w.jsx("rect",{x:t.x,y:t.y,width:t.w,height:t.h,rx:"10",fill:"#ffffff",stroke:"#d1d5db",strokeWidth:"1",filter:`url(#s1-shadow-${t.id})`}),w.jsx("g",{transform:`translate(${t.x+n}, ${t.y+n+i})`,children:w.jsx(e,{w:r,h:o,mono:!1})}),w.jsx("g",{children:w.jsx("text",{x:t.x+t.w/2,y:t.y+36,fontSize:"22",fontFamily:"Inter, sans-serif",fontWeight:"500",fill:"#4b5563",letterSpacing:"0.01em",textAnchor:"middle",children:t.label})})]})},mue=({from:t,to:e,color:n,idx:i})=>{const r=pue(t,e),o=1/Lm,l=5.2*o,u=i*.85%l,d=(i*.85+l/2)%l;return w.jsxs("g",{children:[w.jsx("path",{id:`s1-path-${i}`,d:r.d,fill:"none",stroke:n,strokeOpacity:"0.42",strokeWidth:"1.4",strokeDasharray:"4 5",strokeLinecap:"round",children:w.jsx("animate",{attributeName:"stroke-dashoffset",values:"18;0",dur:`${3.2*o}s`,repeatCount:"indefinite"})}),w.jsx("circle",{cx:t.x,cy:t.y,r:"3.2",fill:n}),w.jsxs("circle",{cx:t.x,cy:t.y,r:"3.2",fill:n,opacity:"0.4",children:[w.jsx("animate",{attributeName:"r",values:"3.2;6;3.2",dur:`${2.8*o}s`,repeatCount:"indefinite"}),w.jsx("animate",{attributeName:"opacity",values:"0.4;0;0.4",dur:`${2.8*o}s`,repeatCount:"indefinite"})]}),w.jsx("circle",{cx:e.x,cy:e.y,r:"3.2",fill:n}),w.jsxs("circle",{r:"3.5",fill:n,children:[w.jsx("animateMotion",{dur:`${l}s`,repeatCount:"indefinite",begin:`-${u}s`,keyPoints:"0;1",keyTimes:"0;1",calcMode:"linear",children:w.jsx("mpath",{href:`#s1-path-${i}`})}),w.jsx("animate",{attributeName:"opacity",values:"0;1;1;1;0",dur:`${l}s`,begin:`-${u}s`,repeatCount:"indefinite",keyTimes:"0;0.1;0.5;0.9;1"})]}),w.jsxs("circle",{r:"3.5",fill:n,children:[w.jsx("animateMotion",{dur:`${l}s`,repeatCount:"indefinite",begin:`-${d}s`,keyPoints:"1;0",keyTimes:"0;1",calcMode:"linear",children:w.jsx("mpath",{href:`#s1-path-${i}`})}),w.jsx("animate",{attributeName:"opacity",values:"0;1;1;1;0",dur:`${l}s`,begin:`-${d}s`,repeatCount:"indefinite",keyTimes:"0;0.1;0.5;0.9;1"})]})]})},vue=({a:t,b:e,idx:n})=>{const i=1/Lm,r=e.x-t.x,o=e.y-t.y,l=Math.hypot(r,o),u=r/l,d=o/l,f=t.x+u*t.s*.7,p=t.y+d*t.s*.7,g=e.x-u*e.s*.7,v=e.y-d*e.s*.7;return w.jsxs("g",{children:[w.jsx("line",{x1:f,y1:p,x2:g,y2:v,stroke:"#cbd5e1",strokeWidth:"1",strokeOpacity:"0.7",strokeLinecap:"round"}),n%3===0&&w.jsx("line",{x1:f,y1:p,x2:g,y2:v,stroke:"#2563eb",strokeWidth:"1.8",strokeOpacity:"0",strokeLinecap:"round",children:w.jsx("animate",{attributeName:"stroke-opacity",values:"0;0.55;0",dur:`${3.6*i}s`,begin:`${n*.55}s`,repeatCount:"indefinite"})})]})},yue="(min-width: 768px)",jD=340,PD=300,rh={x:800-jD,y:540-PD,w:jD*2,h:PD*2},ND={full:380,compact:300},MD={full:{from:180,to:420},compact:{from:165,to:320}},_ue=()=>{const t=h8(yue),e=t?MD.full:MD.compact,{center:n,nodes:i,edges:r,byId:o}=M.useMemo(()=>tue(),[]),l=M.useMemo(()=>due.map(u=>{const d=o[u.anchor];return{...u,from:fue(u,{x:d.x,y:d.y}),to:{x:d.x,y:d.y}}}),[o]);return w.jsx("div",{className:"relative w-full",style:{aspectRatio:t?"1600/1080":`${rh.w}/${rh.h}`},children:w.jsxs("svg",{viewBox:t?"0 0 1600 1080":`${rh.x} ${rh.y} ${rh.w} ${rh.h}`,preserveAspectRatio:"xMidYMid meet",className:"absolute inset-0 w-full h-full select-none",children:[w.jsx("defs",{children:w.jsxs("radialGradient",{id:"brandHalo",cx:"0.5",cy:"0.5",r:"0.5",children:[w.jsx("stop",{offset:"0%",stopColor:"#fef3c7",stopOpacity:"0.9"}),w.jsx("stop",{offset:"35%",stopColor:"#fca5a5",stopOpacity:"0.6"}),w.jsx("stop",{offset:"65%",stopColor:"#c4b5fd",stopOpacity:"0.5"}),w.jsx("stop",{offset:"100%",stopColor:"#93c5fd",stopOpacity:"0"})]})}),w.jsx("circle",{cx:n.x,cy:n.y,r:t?ND.full:ND.compact,fill:"url(#brandHalo)",opacity:.22}),[0,1,2].map(u=>w.jsxs("circle",{cx:n.x,cy:n.y,r:e.from,fill:"none",stroke:"#2563eb",strokeOpacity:"0",strokeWidth:"1",children:[w.jsx("animate",{attributeName:"r",values:`${e.from};${e.to}`,dur:`${6/Lm}s`,begin:`${u*2}
78s`,repeatCount:"indefinite"}),w.jsx("animate",{attributeName:"stroke-opacity",values:"0.18;0",dur:`${6/Lm}s`,begin:`${u*2}s`,repeatCount:"indefinite"})]},u)),t&&l.map((u,d)=>w.jsx(mue,{from:u.from,to:u.to,color:u.color,idx:d},u.id)),r.map((u,d)=>w.jsx(vue,{a:u.a,b:u.b,idx:d},u.id)),i.map(u=>w.jsx(Qce,{cx:u.x,cy:u.y,s:u.s},u.id)),l.map((u,d)=>{const f=o[u.anchor],p=hue(d);return w.jsx(iue,{cx:f.x,cy:f.y,s:f.s,color:u.color,faces:u.glow,cycle:p.cycle,times:p.times},`f-${u.id}`)}),w.jsx(eue,{cx:n.x,cy:n.y,size:70}),t&&l.map(u=>w.jsx(gue,{card:u},u.id))]})})},bue=()=>w.jsxs("div",{className:"px-6 sm:px-10 lg:px-16 pt-8 md:pt-12 lg:pt-16 pb-3 md:pb-4 lg:pb-6",children:[w.jsxs("div",{className:"max-w-3xl mx-auto text-center mb-2 md:mb-4 lg:mb-6",children:[w.jsxs("h2",{className:"text-4xl md:text-5xl font-display text-blue-950 mb-5 leading-[1.1]",children:["Many perspectives. ",w.jsx("br",{className:"hidden md:inline"}),"One knowledge graph."]}),w.jsx("p",{className:"text-lg text-blue-950 max-w-2xl mx-auto",children:"Draw your way, whether you're a technician, an architect or a visionary. Connect your ideas across domains and let Lyster remember the dependencies."})]}),w.jsx("div",{className:"relative w-full md:w-[90%] mx-auto",children:w.jsx(_ue,{})})]}),wue="(min-width: 768px)",xue=16,Sue=20,kue=1.5,Wi=15,f8=10,sw=60,ow=710,Ps=150,ig=230,rg=310,X0=390,vc=60;function zE(t,e,n){const i=vc;return`M ${t} ${e} C ${t+i*.6} ${e}, ${t+i*.4} ${n}, ${t+i} ${n}`}function ID(t,e,n){const i=vc;return`M ${t-i} ${n} C ${t-i*.4} ${n}, ${t-i*.6} ${e}, ${t} ${e}`}const p8=sw,Qw=210,pR=450,g8=630,zD=[{x:p8,label:"v0"},{x:Qw,label:"v1"},{x:pR,label:"v2"},{x:g8,label:"v3"}],iC=Qw,rC=Qw,sC=pR,oC=pR,aC=g8,DD=iC+vc,LD=sC-vc,UD=rC+vc,FD=aC-vc,HD=oC+vc,KD=ow;function Ns(t){const e=(t-sw)/(ow-sw);return Math.max(0,Math.min(1,e))*f8*.95}const Ca=({d:t,t0:e,color:n,dur:i=.55,width:r=2.2})=>{const l=Math.max(0,e/Wi).toFixed(4),u=Math.min(.98,(e+i)/Wi).toFixed(4);return w.jsxs("path",{d:t,pathLength:100,fill:"none",stroke:n,strokeWidth:r,strokeLinecap:"round",strokeDasharray:"100 100",strokeDashoffset:100,visibility:"hidden",children:[w.jsx("animate",{attributeName:"stroke-dashoffset",values:"100;100;0;0;100",keyTimes:`0;${l};${u};0.985;1`,dur:`${Wi}s`,begin:"0s",repeatCount:"indefinite"}),w.jsx("animate",{attributeName:"visibility",values:"hidden;visible;visible",keyTimes:`0;${l};1`,dur:`${Wi}s`,begin:"0s",repeatCount:"indefinite"})]})},DE=({x:t,y:e,label:n,color:i,t:r,scale:o})=>{const l=(r/Wi).toFixed(4),u=Math.max(0,(r-.05)/Wi).toFixed(4);return w.jsxs("text",{x:t,y:e,fontSize:xue*o,fontFamily:"Inter, sans-serif",fontWeight:"600",fill:i,letterSpacing:"0.01em",opacity:"0",children:[n,w.jsx("animate",{attributeName:"opacity",values:"0;0;1;1;0",keyTimes:`0;${u};${l};0.985;1`,dur:`${Wi}s`,begin:"0s",repeatCount:"indefinite"})]})},Eue=()=>{const t=h8(wue)?1:kue,e=[],n=zD.map(x=>x.x);for(let x=0;x<n.length-1;x++)e.push({x0:n[x],x1:n[x+1]});e.push({x0:n[n.length-1],x1:ow});const i=vc*f8*.95/(ow-sw),r=Ns(iC),o=Ns(rC),l=Ns(oC),u=Ns(LD),d=Ns(sC),f=Ns(FD),p=Ns(aC),g=u,v=f,y=Ns(KD),b={v0:Ns(p8),v1:Ns(Qw),v2:d,v3:p};return w.jsxs("svg",{viewBox:"0 100 800 300",className:"w-full h-auto block select-none",children:[w.jsx("defs",{children:w.jsxs("linearGradient",{id:"s2-sweepGrad",x1:"0",y1:"0",x2:"1",y2:"0",children:[w.jsx("stop",{offset:"0%",stopColor:"#2563eb",stopOpacity:"0"}),w.jsx("stop",{offset:"50%",stopColor:"#2563eb",stopOpacity:"0.10"}),w.jsx("stop",{offset:"100%",stopColor:"#2563eb",stopOpacity:"0"})]})}),w.jsx(DE,{x:DD+4,y:ig-12,label:"TEAM 1",color:"#dc2626",t:r+i,scale:t}),w.jsx(DE,{x:UD+4,y:rg-12,label:"TEAM 2",color:"#2563eb",t:o+i,scale:t}),w.jsx(DE,{x:HD+4,y:X0-12,label:"TEAM 3",color:"#16a34a",t:l+i,scale:t}),e.map((x,S)=>{const k=Ns(x.x0),T=Ns(x.x1),C=Math.max(.05,T-k);return w.jsx(Ca,{d:`M ${x.x0} ${Ps} L ${x.x1} ${Ps}`,t0:k,dur:C,color:"#172554",width:2.4},`trunk-${S}`)}),w.jsx(Ca,{d:zE(iC,Ps,ig),t0:r,dur:i,color:"#dc2626"}),w.jsx(Ca,{d:`M ${DD} ${ig} L ${LD} ${ig}`,t0:r+i,dur:g-(r+i),color:"#dc2626"}),w.jsx(Ca,{d:ID(sC,Ps,ig),t0:u,dur:d-u,color:"#dc2626"}),w.jsx(Ca,{d:zE(rC,Ps,rg),t0:o,dur:i,color:"#2563eb"}),w.jsx(Ca,{d:`M ${UD} ${rg} L ${FD} ${rg}`,t0:o+i,dur:v-(o+i),color:"#2563eb"}),w.jsx(Ca,{d:ID(aC,Ps,rg),t0:f,dur:p-f,color:"#2563eb"}),w.jsx(Ca,{d:zE(oC,Ps,X0),t0:l,dur:i,color:"#16a34a"}),w.jsx(Ca,{d:`M ${HD} ${X0} L ${KD} ${X0}`,t0:l+i,dur:y-(l+i),color:"#16a34a"}),zD.map(x=>{const S=b[x.label],k=(S/Wi).toFixed(4),T=Math.max(0,(S-.05)/Wi).toFixed(4),C=Math.min(.985,(S+.25)/Wi).toFixed(4);return w.jsxs("g",{visibility:"hidden",children:[w.jsx("animate",{attributeName:"visibility",values:"hidden;visible;visible",keyTimes:`0;${T};1`,dur:`${Wi}
78s`,begin:"0s",repeatCount:"indefinite"}),w.jsxs("circle",{cx:x.x,cy:Ps,r:"14",fill:"#172554",opacity:"0",children:[w.jsx("animate",{attributeName:"opacity",values:"0;0;0.18;0;0",keyTimes:`0;${T};${k};${C};1`,dur:`${Wi}s`,begin:"0s",repeatCount:"indefinite"}),w.jsx("animate",{attributeName:"r",values:"6;6;20;20;6",keyTimes:`0;${T};${k};${C};1`,dur:`${Wi}s`,begin:"0s",repeatCount:"indefinite"})]}),w.jsx("circle",{cx:x.x,cy:Ps,r:"7",fill:"#ffffff",stroke:"#172554",strokeWidth:"2",opacity:"0",children:w.jsx("animate",{attributeName:"opacity",values:"0;0;1;1;0",keyTimes:`0;${T};${k};0.985;1`,dur:`${Wi}s`,begin:"0s",repeatCount:"indefinite"})}),w.jsx("circle",{cx:x.x,cy:Ps,r:"3",fill:"#172554",opacity:"0",children:w.jsx("animate",{attributeName:"opacity",values:"0;0;1;1;0",keyTimes:`0;${T};${k};0.985;1`,dur:`${Wi}s`,begin:"0s",repeatCount:"indefinite"})}),w.jsx("rect",{x:x.x-22*t,y:Ps-30-12*t,width:44*t,height:24*t,rx:5*t,fill:"#ffffff",stroke:"#d1d5db",strokeWidth:"1",opacity:"0",children:w.jsx("animate",{attributeName:"opacity",values:"0;0;1;1;0",keyTimes:`0;${T};${k};0.985;1`,dur:`${Wi}s`,begin:"0s",repeatCount:"indefinite"})}),w.jsxs("text",{x:x.x,y:Ps-30,fontSize:Sue*t,fontWeight:"400",fontFamily:"Inter, sans-serif",fill:"#172554",textAnchor:"middle",dominantBaseline:"central",opacity:"0",children:[x.label,w.jsx("animate",{attributeName:"opacity",values:"0;0;1;1;0",keyTimes:`0;${T};${k};0.985;1`,dur:`${Wi}s`,begin:"0s",repeatCount:"indefinite"})]})]},x.label)})]})},Tue=()=>w.jsxs("div",{className:"flex flex-col lg:flex-row bg-white",children:[w.jsxs("div",{className:"w-full lg:w-[44%] px-6 sm:px-10 lg:px-14 py-14 lg:py-20 flex flex-col justify-center text-center lg:text-left",children:[w.jsx("h2",{className:"text-4xl md:text-5xl font-display text-blue-950 mb-5 leading-[1.1]",children:"Branch, merge & approve."}),w.jsx("p",{className:"text-lg text-blue-950",children:"Draft in parallel just like you would with Git, but without the merge conflicts. Breeze through your next audit with custom approval flows and fully traceable decision records."})]}),w.jsx("div",{className:"w-full lg:w-[56%] border-t lg:border-t-0 lg:border-l border-gray-300 bg-white flex items-center justify-center p-8 lg:p-10",children:w.jsx("div",{className:"w-full max-w-[760px]",children:w.jsx(Eue,{})})})]}),Cue="https://cdn.lyster.io/icons/misc",m8=[{name:"Confluence",slug:"confluence"},{name:"Coda",slug:"coda"},{name:"GitBook",slug:"gitbook"},{name:"Notion",slug:"notion"},{name:"Outline",slug:"outline"},{name:"SharePoint",slug:"sharepoint"}],Oue=()=>w.jsx(w.Fragment,{children:[0,1].map(t=>w.jsx("div",{className:"flex shrink-0 items-center gap-4 pr-4 sm:gap-8 sm:pr-8",children:m8.map(e=>w.jsx("img",{src:`${Cue}/${e.slug}.svg`,alt:"",className:"h-5 w-10 shrink-0 object-contain sm:h-10 sm:w-20 md:h-12"},e.slug))},t))}),Rue=()=>w.jsxs("div",{className:"flex flex-col lg:flex-row bg-white",children:[w.jsx("div",{className:"order-2 lg:order-none w-full lg:w-[56%] bg-white flex items-center justify-center p-8 lg:p-10",children:w.jsxs("div",{className:"relative w-full max-w-[760px] overflow-hidden",style:{maskImage:"linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%)",WebkitMaskImage:"linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%)"},children:[w.jsx("div",{className:"marquee-track flex w-max items-center","aria-hidden":"true",children:w.jsx(Oue,{})}),w.jsxs("span",{className:"sr-only",children:["Embeddable in ",m8.map(t=>t.name).join(", "),", and more."]})]})}),w.jsxs("div",{className:"order-1 lg:order-none w-full lg:w-[44%] border-b lg:border-b-0 lg:border-l border-gray-300 px-6 sm:px-10 lg:px-14 py-14 lg:py-20 flex flex-col justify-center text-center lg:text-left",children:[w.jsx("h2",{className:"text-4xl md:text-5xl font-display text-blue-950 mb-5 leading-[1.1]",children:"Diagrams that never go stale."}),w.jsx("p",{className:"text-lg text-blue-950",children:"Embed views into your intranet pages. They always show the latest version, so your docs don't drift."})]})]}),Um=[{question:"Are we ready for an ISO 27001 audit?",answer:["Not yet. 3 of 14 in-scope systems have gaps:","· Billing API — no owner recorded (A.5.9)","· Reporting DB — no retention policy (A.5.33)","· 
78Legacy CRM — authenticates outside SSO (A.5.16)","The other 11 systems document all three."]},{question:"Are we overpaying for our ERP system?",answer:["Likely. Two out of six services look questionable:",'· Reporting Replica — tagged "decommissioned" on March 19, still billed at €4,800/mo',"· Payroll — €61/seat/mo, above the €35-45 typical of comparable mid-market ERP tiers","Worth confirming both against your latest invoice."]},{question:"Explain our network security policy.",answer:["Defense in depth across three trust zones, each reachable only from the one above it:","· Internet → Green — public apps, via NAT gateways on 443/tcp","· Green → Yellow — internal apps, on named service ports only","· Yellow → Red — databases, from app subnets only. Red never initiates outbound.","Two standing exceptions, both past review date — including Legacy CRM, which routes Green → Red."]}],$ue=34,Aue=700,jue=9,Pue=3600;function gR(t){return t.answer.join(`
79`).length}function Nue(){const t=[];return Um.forEach((e,n)=>{for(let i=1;i<=e.question.length;i++)t.push({kind:"type",exchange:n,chars:i});t.push({kind:"think",exchange:n});for(let i=1;i<=gR(e);i++)t.push({kind:"answer",exchange:n,answerChars:i});t.push({kind:"read",exchange:n})}),t}const LE=Nue();function Mue(t){switch(t.kind){case"type":return $ue;case"think":return Aue;case"answer":return jue;case"read":return Pue}}function Iue(t){const e=t.exchange,n=Um[e].question.length;switch(t.kind){case"type":return{exchange:e,chars:t.chars,answerChars:0};case"think":return{exchange:e,chars:n,answerChars:0};case"answer":return{exchange:e,chars:n,answerChars:t.answerChars};case"read":return{exchange:e,chars:n,answerChars:gR(Um[e])}}}const zue=({line:t})=>{const e=t.startsWith("·");return w.jsx("div",{className:`min-h-[1.5em] text-zinc-300 ${e?"pl-3":""}`,children:t})},Due=({on:t=!0})=>w.jsx("span",{className:`caret-blink ml-px inline-block h-[1.1em] w-[0.6em] translate-y-[0.2em] bg-zinc-400 ${t?"":"invisible"}`,"aria-hidden":"true"}),Lue=()=>w.jsx("span",{className:"shrink-0 text-orange-400","aria-hidden":"true",children:">"}),ZD=({exchange:t,chars:e,answerChars:n,showCaret:i=!1})=>{const r=t.answer.join(`
80`).slice(0,n),o=r.length>0?r.split(`
81`):[];return w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"flex gap-2",children:[w.jsx(Lue,{}),w.jsxs("span",{className:"text-zinc-100",children:[t.question.slice(0,e),w.jsx(Due,{on:i})]})]}),w.jsx("div",{className:"mt-1.5 whitespace-pre-wrap",children:o.map((l,u)=>w.jsx(zue,{line:l},u))})]})},Uue=()=>{const[t,e]=M.useState(0),n=M.useRef(null),[i,r]=M.useState(!0);M.useEffect(()=>{const d=n.current;if(!d||typeof IntersectionObserver>"u")return;const f=new IntersectionObserver(p=>p.forEach(g=>r(g.isIntersecting)),{rootMargin:"0px"});return f.observe(d),()=>f.disconnect()},[]),M.useEffect(()=>{if(!i)return;const d=window.setTimeout(()=>e(f=>(f+1)%LE.length),Mue(LE[t]));return()=>window.clearTimeout(d)},[t,i]);const o=LE[t],l=Iue(o),u=Um[l.exchange];return w.jsxs("div",{className:"w-full max-w-[760px] overflow-hidden rounded-xl bg-zinc-800 shadow-xl ring-1 ring-black/10",children:[w.jsxs("div",{className:"flex items-center gap-2 border-b border-white/5 bg-zinc-700/40 px-4 py-2.5",children:[w.jsx("span",{className:"h-3 w-3 rounded-full bg-red-400/90"}),w.jsx("span",{className:"h-3 w-3 rounded-full bg-amber-400/90"}),w.jsx("span",{className:"h-3 w-3 rounded-full bg-green-400/90"})]}),w.jsxs("div",{ref:n,className:"grid min-h-[13rem] content-start px-4 py-4 font-mono text-[11px] leading-relaxed sm:min-h-[15rem] sm:px-5 sm:py-5 sm:text-[13px]",children:[Um.map(d=>w.jsx("div",{className:"invisible [grid-area:1/1]",children:w.jsx(ZD,{exchange:d,chars:d.question.length,answerChars:gR(d)})},d.question)),w.jsx("div",{className:"[grid-area:1/1]","aria-hidden":"true","data-testid":"ask-your-model-transcript",children:w.jsx(ZD,{exchange:u,chars:l.chars,answerChars:l.answerChars,showCaret:o.kind==="type"},l.exchange)})]})]})},Fue=()=>w.jsxs("div",{className:"flex flex-col lg:flex-row bg-white",children:[w.jsxs("div",{className:"w-full lg:w-[44%] px-6 sm:px-10 lg:px-14 py-14 lg:py-20 flex flex-col justify-center text-center lg:text-left",children:[w.jsx("h2",{className:"text-4xl md:text-5xl font-display text-blue-950 mb-5 leading-[1.1]",children:"The business context layer for AI."}),w.jsx("p",{className:"text-lg text-blue-950",children:"Connect any agent to Lyster's MCP server to give it the context it's been missing — from grand strategies to legacy migration plans."})]}),w.jsx("div",{className:"w-full lg:w-[56%] border-t lg:border-t-0 lg:border-l border-gray-300 bg-white flex items-center justify-center p-8 lg:p-10",children:w.jsx(Uue,{})})]}),WD="bg-gradient-to-br from-blue-500 to-blue-600 hover:from-blue-400 hover:to-blue-500 text-white px-4 py-2 text-base rounded-lg sm:px-8 sm:py-4 sm:text-xl sm:rounded-xl font-bold transition-all duration-150 hover:shadow-xl hover:scale-105 cursor-pointer inline-flex items-center justify-center",Hue=()=>{const{trackMeetingCtaClicked:t}=Qa(),e=Yw(),n=24,i=M.useRef(null),[r,o]=M.useState(0);return M.useEffect(()=>{const l=()=>{const d=i.current;if(!d)return;const p=(-(d.getBoundingClientRect().top+window.scrollY)%n+n)%n;o(p)};l();const u=new ResizeObserver(l);return u.observe(document.body),window.addEventListener("resize",l),()=>{u.disconnect(),window.removeEventListener("resize",l)}},[]),w.jsxs("div",{ref:i,id:"cta",className:"relative w-full text-blue-950 border-b border-gray-300",children:[w.jsx("div",{"aria-hidden":"true",className:"absolute inset-0 pointer-events-none",style:{background:"linear-gradient(135deg, #fde68a 0%, #fca5a5 28%, #c4b5fd 56%, #93c5fd 82%, #86efac 100%)"}}),w.jsx("div",{"aria-hidden":"true",className:"absolute inset-0 pointer-events-none",style:{backgroundImage:"radial-gradient(circle, rgba(255,255,255,0.55) 1.35px, transparent 1px)",backgroundSize:`${n}px ${n}px`,backgroundPosition:`0px ${r}px`}}),w.jsx("div",{className:"relative flex justify-center",children:w.jsx("div",{className:"max-w-7xl w-full bg-white/70 px-6 sm:px-10 lg:px-16 py-20 lg:py-28 border-x border-gray-300",children:w.jsxs("div",{className:"max-w-3xl mx-auto 
81sm:mx-0 text-center sm:text-left",children:[w.jsx("h2",{className:"text-5xl md:text-6xl lg:text-7xl font-display leading-[1.02] mb-10 text-blue-950 tracking-tight",children:"Let's collaborate."}),w.jsx("div",{className:"flex flex-col sm:flex-row items-center sm:items-start md:items-center gap-4",children:e?w.jsx("button",{"data-cal-namespace":Ba,"data-cal-link":vv,"data-cal-config":yo,onClick:()=>t("landing_closing_cta","Book A Demo"),className:WD,children:"Book A Demo"}):w.jsx("button",{"data-cal-namespace":hR,"data-cal-link":l8,"data-cal-config":yo,onClick:()=>t("landing_closing_cta","Start Your 14-Day Free Trial"),className:WD,children:"Start Your 14-Day Free Trial"})})]})})})]})},sh="bg-white",Kue=()=>(mv([hR,Ba]),w.jsxs("div",{className:"flex flex-col w-full overflow-x-hidden",children:[w.jsx(zs,{height:"h-16 sm:h-32"}),w.jsx(fi,{id:"hero",containerClassName:sh,children:w.jsx(Vce,{})}),w.jsx(zs,{height:"h-16"}),w.jsx(fi,{id:"many-perspectives",containerClassName:sh,children:w.jsx(bue,{})}),w.jsx(zs,{height:"h-16"}),w.jsx(fi,{id:"product-demo",containerClassName:sh,children:w.jsx(Jce,{})}),w.jsx(zs,{height:"h-16"}),w.jsx(fi,{id:"version-control",containerClassName:sh,children:w.jsx(Tue,{})}),w.jsx(zs,{height:"h-16"}),w.jsx(fi,{id:"embed-anywhere",containerClassName:sh,children:w.jsx(Rue,{})}),w.jsx(zs,{height:"h-16"}),w.jsx(fi,{id:"ask-your-model",containerClassName:sh,children:w.jsx(Fue,{})}),w.jsx(zs,{height:"h-16"}),w.jsx(Hue,{})]})),Zue="https://cdn.lyster.io/branding/logo_2000px.svg",Wue=()=>{const[t]=$V(),{trackFormThankYouViewed:e}=Qa();mv([Ba]);const i=t.get("name")?.split(" ")[0];return M.useEffect(()=>{document.title="Thank You | Lyster",e()},[e]),w.jsxs("div",{className:"flex-1 flex flex-col items-center overflow-hidden",children:[w.jsx("div",{className:"flex-1"}),w.jsx("div",{className:"w-full max-w-7xl bg-white panel-borders relative z-10",children:w.jsx("div",{className:"flex items-center justify-center w-full px-8 lg:px-12 py-8 lg:py-20",children:w.jsxs("div",{className:"max-w-lg text-center",children:[w.jsx("img",{src:Zue,alt:"Lyster Logo",className:"w-32 h-32 mx-auto mb-8"}),w.jsx("h1",{className:"text-4xl md:text-5xl font-display text-blue-950 mb-6",children:i?w.jsxs(w.Fragment,{children:["Thanks for reaching out, ",w.jsx("span",{className:"text-blue-600",children:i}),"!"]}):"Thanks for reaching out!"}),w.jsx("p",{className:"text-lg text-blue-950 mb-4",children:"We'll provision your free trial and get back to you within two business days."}),w.jsx("button",{"data-cal-namespace":Ba,"data-cal-link":vv,"data-cal-config":yo,className:"mt-8 inline-block bg-gradient-to-br from-blue-500 to-blue-600 text-white px-4 py-2 rounded-lg font-semibold text-base transition-all duration-150 hover:shadow-xl hover:scale-105 cursor-pointer",children:"Book A Demo"})]})})}),w.jsx("div",{className:"flex-1"})]})},que=()=>{const[t,e]=M.useState(!1),n=()=>{localStorage.removeItem("cookie_consent"),sn.reset(),e(!0),setTimeout(()=>{window.location.reload()},1500)};return w.jsx("div",{style:{backgroundColor:"#ffffff",backgroundImage:"radial-gradient(circle,rgb(218, 224, 232) 1.35px, transparent 1px)",backgroundSize:"24px 24px"},children:w.jsx(fi,{children:w.jsx("div",{className:"bg-white py-12 px-4 sm:px-6 lg:px-8 mt-[-60px] pt-40 min-h-screen",children:w.jsxs("div",{className:"max-w-4xl mx-auto",children:[w.jsx("h1",{className:"text-4xl font-display text-blue-950 mb-8",children:"Cookie Policy"}),w.jsxs("div",{className:"mb-8 p-6 bg-blue-50 border border-blue-200 rounded-lg",children:[w.jsx("h2",{className:"text-xl font-display text-blue-950 mb-3",children:"Manage Your Cookie Preferences"}),w.jsx("p",{className:"text-gray-700 mb-4",children:"You can change your cookie consent at any time. Click the button below to reset your preferences and see the consent banner again."}),w.jsx("button",{onClick:n,disabled:t,className:`${t?"bg-green-600 cursor-not-allowed":"bg-blue-600 hover:bg-blue-700 cursor-pointer"} text-white px-6 py-3 rounded-lg font-semibold transition-all duration-150 inline-flex items-center shadow-md`,children:t?w.jsxs(w.Fragment,{children:[w.jsx("i",{className:"fas fa-check mr-2"}),"Reset Successful! Reloading..."]}):w.jsxs(w.Fragment,{children:[w.jsx("i",{className:"fas fa-redo mr-2"}),"Reset Cookie Preferences"]})})]}),w.jsx("div",{className:"my-8 border border-gray-300 rounded-lg overflow-hidden shadow-lg",children:w.jsx("iframe",{src:"https://cdn.lyster.io/legal/cookie-policy.pdf",className:"w-full",style:{height:"800px"},title:"Cookie Policy PDF"})}),w.jsxs("div",{className:"mt-6 p-4 bg-blue-50 rounded-lg border border-blue-200",children:[w.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"If the document doesn't display above, you can download it directly:"}),w.jsxs("a",{href:"https://cdn.lyster.io/legal/cookie-policy.pdf",download:!0,className:"text-blue-600 hover:text-blue-800 font-semibold inline-flex items-center",children:[w.jsx("i",{className:"fas fa-download mr-2"}),"Download Cookie Policy (PDF)"]})]})]})})})})},Vue=SV([{element:w.jsx(Cce,{}),errorElement:w.jsx(ME,{}),children:[{path:"/form",element:w.jsx(Wue,{})},{path:"/login",element:w.jsx(fce,{})},{path:"/auth/callback",element:w.jsx(pce,{})},{path:"/error",element:w.jsx(ME,{})},{path:"*",element:w.jsx($ce,{})}]},{element:w.jsx(Tce,{}),errorElement:w.jsx(ME,{}),children:[{path:"/",element:w.jsx(Kue,{})},{path:"/desktop",element:w.jsx(Kce,{})},{path:"/legal/cookies",element:w.jsx(que,{})}]}]);
81Ua.installWorkaround();uc(document.body,{scrollbars:{autoHide:"leave",autoHideDelay:600,theme:"os-theme-site"}});const Bue="phc_qO43bzvNmfat1PnghFkLFQdVGpJKxYw1ymxTDMpqlnb",Gue=zm.getConsentStatus(),Jue=Yle({consentStatus:Gue,features:o8}),Xue=t=>{t?.posthog&&sessionStorage.setItem("posthog_pre_auth",JSON.stringify({sessionId:t.posthog.sessionId,distinctId:t.posthog.distinctId,loginType:t.posthog.loginType,timestamp:new Date().toISOString()})),window.history.replaceState({},document.title,window.location.pathname)};uW.createRoot(document.getElementById("root")).render(w.jsx(Na.StrictMode,{children:w.jsx(ole,{children:w.jsx(sQ,{apiKey:Bue,options:Jue,children:w.jsx(CJ,{...WO,onRedirectCallback:Xue,children:w.jsx(Vle,{children:w.jsx(zV,{router:Vue})})})})})}));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.