PageSourceSearch

https://app.memnar.ai/assets/index-O_T_ntd1.js

js memnar.ai collected 2026-10-02 01:11:33 UTC 884,278 bytes, 305 lines download raw bytes

vendor: 5,197 bytes, lines 1-10
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Connect-Dio-nekN.js","assets/ReferralShare-CHBbtQnE.js","assets/copy-5hswUtsW.js","assets/circle-alert-CmT1BvwA.js","assets/terminal-BuHvzt0_.js","assets/loader-circle-C-NGwhUt.js","assets/Start-CE_2iqca.js","assets/sparkles-wa0nCb2s.js","assets/Build-CMB8E6sK.js","assets/useUploads-w97aKs0w.js","assets/checkout-fytYzmhN.js","assets/functionError-kQK6O4OH.js","assets/waitAnswers-p9x8s6hv.js","assets/lock-Bw9Fp6cq.js","assets/nl-eeE85VyX.js","assets/trash-2-CRfGbBNz.js","assets/Journey-CM_3tNvz.js","assets/useJourney-DhHsVdTX.js","assets/ModulePage-BM2joiE8.js","assets/download-DTOGYTlj.js","assets/AiIk-B9kLalhD.js","assets/generatePackage-DpJpxYl0.js","assets/pencil-BeedMPtv.js","assets/useMindFilePatterns-C2X5055C.js","assets/useCaptureSettings-CL-s5Thc.js","assets/PageHeader-RbrTOHXZ.js","assets/quote-B2leGDdq.js","assets/RepoViewer-aKVCL8qZ.js","assets/Patterns-Bzq-3niD.js","assets/textarea-BxKz9yeI.js","assets/Use-BiMBQGPY.js","assets/useMcpConnections-DkWXNIq0.js","assets/index-Clu3-o3G.js","assets/Settings-CPCJgcJM.js","assets/switch-GEQsN4cF.js","assets/index-BNYDqDYc.js","assets/Choose-C6C8ocKM.js","assets/transfer-B29y-Fj_.js","assets/Team-C9rc8Ym4.js","assets/useOrgMembers-BZSoyo7k.js","assets/select-CNOH1uL-.js","assets/Overdracht-PJ6rhXtr.js","assets/OverdrachtBron-CsUDlvF7.js","assets/alert-dialog-BoGf1-42.js","assets/OverdrachtGesprek-dBeyM9PQ.js","assets/Pricing-jlr_YyDB.js","assets/TakeItWithYou-DaAxlPdX.js","assets/FAQ-BU8i60jN.js","assets/Privacy-rdxbtzRJ.js","assets/Unsubscribe-3XXSTML6.js"])))=>i.map(i=>d[i]);
2var qy=t=>{throw TypeError(t)};var Zh=(t,e,r)=>e.has(t)||qy("Cannot "+r);var E=(t,e,r)=>(Zh(t,e,"read from private field"),r?r.call(t):e.get(t)),re=(t,e,r)=>e.has(t)?qy("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),K=(t,e,r,n)=>(Zh(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),de=(t,e,r)=>(Zh(t,e,"access private method"),r);var Fu=(t,e,r,n)=>({set _(s){K(t,e,s,r)},get _(){return E(t,e,n)}});function vP(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in t)){const i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>n[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(s){if(s.ep)return;s.ep=!0;const i=r(s);fetch(s.href,i)}})();var F5=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ex(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var tx={exports:{}},ph={},rx={exports:{}},pe={};/**
3 * @license React
4 * react.production.min.js
5 *
6 * Copyright (c) Facebook, Inc. and its affiliates.
7 *
8 * This source code is licensed under the MIT license found in the
9 * LICENSE file in the root directory of this source tree.
10 */var Pu=Symbol.for("react.element"),yP=Symbol.for("react.portal"),_P=Symbol.for("react.fragment"),wP=Symbol.for("react.strict_mode"),bP=Symbol.for("react.profiler"),xP=Symbol.for("react.provider"),kP=Symbol.for("react.context"),SP=Symbol.for("react.forward_ref"),EP=Symbol.for("react.suspense"),CP=Symbol.for("react.memo"),TP=Symbol.for("react.lazy"),Vy=Symbol.iterator;function PP(t){return t===null||typeof t!="object"?null:(t=Vy&&t[Vy]||t["@@iterator"],typeof t=="function"?t:null)}var nx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},sx=Object.assign,ix={};function wa(t,e,r){this.props=t,this.context=e,this.refs=ix,this.updater=r||nx}wa.prototype.isReactComponent={};wa.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};wa.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function ox(){}ox.prototype=wa.prototype;function qm(t,e,r){this.props=t,this.context=e,this.refs=ix,this.updater=r||nx}var Vm=qm.prototype=new ox;Vm.constructor=qm;sx(Vm,wa.prototype);Vm.isPureReactComponent=!0;var Ky=Array.isArray,ax=Object.prototype.hasOwnProperty,Km={current:null},lx={key:!0,ref:!0,__self:!0,__source:!0};function ux(t,e,r){var n,s={},i=null,o=null;if(e!=null)for(n in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(i=""+e.key),e)ax.c
vendor: 6,408 bytes, lines 10-26
10all(e,n)&&!lx.hasOwnProperty(n)&&(s[n]=e[n]);var a=arguments.length-2;if(a===1)s.children=r;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];s.children=l}if(t&&t.defaultProps)for(n in a=t.defaultProps,a)s[n]===void 0&&(s[n]=a[n]);return{$$typeof:Pu,type:t,key:i,ref:o,props:s,_owner:Km.current}}function RP(t,e){return{$$typeof:Pu,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Gm(t){return typeof t=="object"&&t!==null&&t.$$typeof===Pu}function AP(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var Gy=/\/+/g;function ef(t,e){return typeof t=="object"&&t!==null&&t.key!=null?AP(""+t.key):e.toString(36)}function Ac(t,e,r,n,s){var i=typeof t;(i==="undefined"||i==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case Pu:case yP:o=!0}}if(o)return o=t,s=s(o),t=n===""?"."+ef(o,0):n,Ky(s)?(r="",t!=null&&(r=t.replace(Gy,"$&/")+"/"),Ac(s,e,r,"",function(u){return u})):s!=null&&(Gm(s)&&(s=RP(s,r+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(Gy,"$&/")+"/")+t)),e.push(s)),1;if(o=0,n=n===""?".":n+":",Ky(t))for(var a=0;a<t.length;a++){i=t[a];var l=n+ef(i,a);o+=Ac(i,e,r,l,s)}else if(l=PP(t),typeof l=="function")for(t=l.call(t),a=0;!(i=t.next()).done;)i=i.value,l=n+ef(i,a++),o+=Ac(i,e,r,l,s);else if(i==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function Uu(t,e,r){if(t==null)return t;var n=[],s=0;return Ac(t,n,"","",function(i){return e.call(r,i,s++)}),n}function OP(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(r){(t._status===0||t._status===-1)&&(t._status=1,t._result=r)},function(r){(t._status===0||t._status===-1)&&(t._status=2,t._result=r)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var Dt={current:null},Oc={transition:null},jP={ReactCurrentDispatcher:Dt,ReactCurrentBatchConfig:Oc,ReactCurrentOwner:Km};function cx(){throw Error("act(...) is not supported in production builds of React.")}pe.Children={map:Uu,forEach:function(t,e,r){Uu(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return Uu(t,function(){e++}),e},toArray:function(t){return Uu(t,function(e){return e})||[]},only:function(t){if(!Gm(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};pe.Component=wa;pe.Fragment=_P;pe.Profiler=bP;pe.PureComponent=qm;pe.StrictMode=wP;pe.Suspense=EP;pe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=jP;pe.act=cx;pe.cloneElement=function(t,e,r){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var n=sx({},t.props),s=t.key,i=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(i=e.ref,o=Km.current),e.key!==void 0&&(s=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)ax.call(e,l)&&!lx.hasOwnProperty(l)&&(n[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)n.children=r;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];n.children=a}return{$$typeof:Pu,type:t.type,key:s,ref:i,props:n,_owner:o}};pe.createContext=function(t){return t={$$typeof:kP,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:xP,_context:t},t.Consumer=t};pe.createElement=ux;pe.createFactory=function(t){var e=ux.bind(null,t);return e.type=t,e};pe.createRef=function(){return{current:null}};pe.forwardRef=function(t){return{$$typeof:SP,render:t}};pe.isValidElement=Gm;pe.lazy=function(t){return{$$typeof:TP,_payload:{_status:-1,_result:t},_init:OP}};pe.memo=function(t,e){return{$$typeof:CP,type:t,compare:e===void 0?null:e}};pe.startTransition=function(t){var e=Oc.transition;Oc.transition={};try{t()}finally{Oc.transition=e}};pe.unstable_act=cx;pe.useCallback=function(t,e){return Dt.current.useCallback(t,e)};pe.useContext=function(t){return Dt.current.useContext(t)};pe.useDebugValue=function(){};pe.useDeferredValue=function(t){return Dt.current.useDeferredValue(t)};pe.useEffect=function(t,e){return Dt.current.useEffect(t,e)};pe.useId=function(){return Dt.current.useId()};pe.useImperativeHandle=function(t,e,r){return Dt.current.useImperativeHandle(t,e,r)};pe.useInsertionEffect=function(t,e){return Dt.current.useInsertionEffect(t,e)};pe.useLayoutEffect=function(t,e){return Dt.current.useLayoutEffect(t,e)};pe.useMemo=function(t,e){return Dt.current.useMemo(t,e)};pe.useReducer=function(t,e,r){return Dt.current.useReducer(t,e,r)};pe.useRef=function(t){return Dt.current.useRef(t)};pe.useState=function(t){return Dt.current.useState(t)};pe.useSyncExternalStore=function(t,e,r){return Dt.current.useSyncExternalStore(t,e,r)};pe.useTransition=function(){return Dt.current.useTransition()};pe.version="18.3.1";rx.exports=pe;var w=rx.exports;const z=ex(w),Ym=vP({__proto__:null,default:z},[w]);/**
11 * @license React
12 * react-jsx-runtime.production.min.js
13 *
14 * Copyright (c) Facebook, Inc. and its affiliates.
15 *
16 * This source code is licensed under the MIT license found in the
17 * LICENSE file in the root directory of this source tree.
18 */var NP=w,IP=Symbol.for("react.element"),$P=Symbol.for("react.fragment"),LP=Object.prototype.hasOwnProperty,MP=NP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,DP={key:!0,ref:!0,__self:!0,__source:!0};function dx(t,e,r){var n,s={},i=null,o=null;r!==void 0&&(i=""+r),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(o=e.ref);for(n in e)LP.call(e,n)&&!DP.hasOwnProperty(n)&&(s[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)s[n]===void 0&&(s[n]=e[n]);return{$$typeof:IP,type:t,key:i,ref:o,props:s,_owner:MP.current}}ph.Fragment=$P;ph.jsx=dx;ph.jsxs=dx;tx.exports=ph;var m=tx.exports,hx={exports:{}},cr={},fx={exports:{}},px={};/**
19 * @license React
20 * scheduler.production.min.js
21 *
22 * Copyright (c) Facebook, Inc. and its affiliates.
23 *
24 * This source code is licensed under the MIT license found in the
25 * LICENSE file in the root directory of this source tree.
26 */(function(t){function e(j,A){var M=j.length;j.push(A);e:for(;0<M;){var G=M-1>>>1,V=j[G];if(0<s(V,A))j[G]=A,j[M]=V,M=G;else break e}}function r(j){return j.length===0?null:j[0]}
vendor: 3,268 bytes, line 26
26function n(j){if(j.length===0)return null;var A=j[0],M=j.pop();if(M!==A){j[0]=M;e:for(var G=0,V=j.length,Q=V>>>1;G<Q;){var Z=2*(G+1)-1,oe=j[Z],ve=Z+1,ie=j[ve];if(0>s(oe,M))ve<V&&0>s(ie,oe)?(j[G]=ie,j[ve]=M,G=ve):(j[G]=oe,j[Z]=M,G=Z);else if(ve<V&&0>s(ie,M))j[G]=ie,j[ve]=M,G=ve;else break e}}return A}function s(j,A){var M=j.sortIndex-A.sortIndex;return M!==0?M:j.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],u=[],c=1,d=null,h=3,f=!1,g=!1,p=!1,b=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(j){for(var A=r(u);A!==null;){if(A.callback===null)n(u);else if(A.startTime<=j)n(u),A.sortIndex=A.expirationTime,e(l,A);else break;A=r(u)}}function x(j){if(p=!1,_(j),!g)if(r(l)!==null)g=!0,$(k);else{var A=r(u);A!==null&&W(x,A.startTime-j)}}function k(j,A){g=!1,p&&(p=!1,v(S),S=-1),f=!0;var M=h;try{for(_(A),d=r(l);d!==null&&(!(d.expirationTime>A)||j&&!I());){var G=d.callback;if(typeof G=="function"){d.callback=null,h=d.priorityLevel;var V=G(d.expirationTime<=A);A=t.unstable_now(),typeof V=="function"?d.callback=V:d===r(l)&&n(l),_(A)}else n(l);d=r(l)}if(d!==null)var Q=!0;else{var Z=r(u);Z!==null&&W(x,Z.startTime-A),Q=!1}return Q}finally{d=null,h=M,f=!1}}var C=!1,T=null,S=-1,P=5,R=-1;function I(){return!(t.unstable_now()-R<P)}function N(){if(T!==null){var j=t.unstable_now();R=j;var A=!0;try{A=T(!0,j)}finally{A?B():(C=!1,T=null)}}else C=!1}var B;if(typeof y=="function")B=function(){y(N)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,ee=q.port2;q.port1.onmessage=N,B=function(){ee.postMessage(null)}}else B=function(){b(N,0)};function $(j){T=j,C||(C=!0,B())}function W(j,A){S=b(function(){j(t.unstable_now())},A)}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(j){j.callback=null},t.unstable_continueExecution=function(){g||f||(g=!0,$(k))},t.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<j?Math.floor(1e3/j):5},t.unstable_getCurrentPriorityLevel=function(){return h},t.unstable_getFirstCallbackNode=function(){return r(l)},t.unstable_next=function(j){switch(h){case 1:case 2:case 3:var A=3;break;default:A=h}var M=h;h=A;try{return j()}finally{h=M}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(j,A){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var M=h;h=j;try{return A()}finally{h=M}},t.unstable_scheduleCallback=function(j,A,M){var G=t.unstable_now();switch(typeof M=="object"&&M!==null?(M=M.delay,M=typeof M=="number"&&0<M?G+M:G):M=G,j){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}
vendor: 4,614 bytes, lines 26-34
26return V=M+V,j={id:c++,callback:A,priorityLevel:j,startTime:M,expirationTime:V,sortIndex:-1},M>G?(j.sortIndex=M,e(u,j),r(l)===null&&j===r(u)&&(p?(v(S),S=-1):p=!0,W(x,M-G))):(j.sortIndex=V,e(l,j),g||f||(g=!0,$(k))),j},t.unstable_shouldYield=I,t.unstable_wrapCallback=function(j){var A=h;return function(){var M=h;h=A;try{return j.apply(this,arguments)}finally{h=M}}}})(px);fx.exports=px;var FP=fx.exports;/**
27 * @license React
28 * react-dom.production.min.js
29 *
30 * Copyright (c) Facebook, Inc. and its affiliates.
31 *
32 * This source code is licensed under the MIT license found in the
33 * LICENSE file in the root directory of this source tree.
34 */var UP=w,ur=FP;function D(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r<arguments.length;r++)e+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var gx=new Set,Fl={};function Fi(t,e){sa(t,e),sa(t+"Capture",e)}function sa(t,e){for(Fl[t]=e,t=0;t<e.length;t++)gx.add(e[t])}var Hn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_p=Object.prototype.hasOwnProperty,BP=/^[: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]*$/,Yy={},Jy={};function zP(t){return _p.call(Jy,t)?!0:_p.call(Yy,t)?!1:BP.test(t)?Jy[t]=!0:(Yy[t]=!0,!1)}function HP(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function WP(t,e,r,n){if(e===null||typeof e>"u"||HP(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Ft(t,e,r,n,s,i,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=o}var mt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){mt[t]=new Ft(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];mt[e]=new Ft(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){mt[t]=new Ft(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){mt[t]=new Ft(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){mt[t]=new Ft(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){mt[t]=new Ft(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){mt[t]=new Ft(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){mt[t]=new Ft(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){mt[t]=new Ft(t,5,!1,t.toLowerCase(),null,!1,!1)});var Jm=/[\-:]([a-z])/g;function Qm(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode
34-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(Jm,Qm);mt[e]=new Ft(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Jm,Qm);mt[e]=new Ft(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Jm,Qm);mt[e]=new Ft(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){mt[t]=new Ft(t,1,!1,t.toLowerCase(),null,!1,!1)});mt.xlinkHref=new Ft("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){mt[t]=new Ft(t,1,!1,t.toLowerCase(),null,!0,!0)});function Xm(t,e,r,n){var s=mt.hasOwnProperty(e)?mt[e]:null;(s!==null?s.type!==0:n||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(WP(e,r,s,n)&&(r=null),n||s===null?zP(e)&&(r===null?t.removeAttribute(e):t.setAttribute(e,""+r)):s.mustUseProperty?t[s.propertyName]=r===null?s.type===3?!1:"":r:(e=s.attributeName,n=s.attributeNamespace,r===null?t.removeAttribute(e):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,n?t.setAttributeNS(n,e,r):t.setAttribute(e,r))))}var Jn=UP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Bu=Symbol.for("react.element"),yo=Symbol.for("react.portal"),_o=Symbol.for("react.fragment"),Zm=Symbol.for("react.strict_mode"),wp=Symbol.for("react.profiler"),mx=Symbol.for("react.provider"),vx=Symbol.for("react.context"),ev=Symbol.for("react.forward_ref"),bp=Symbol.for("react.suspense"),xp=Symbol.for("react.suspense_list"),tv=Symbol.for("react.memo"),ls=Symbol.for("react.lazy"),yx=Symbol.for("react.offscreen"),Qy=Symbol.iterator;function Da(t){return t===null||typeof t!="object"?null:(t=Qy&&t[Qy]||t["@@iterator"],typeof t=="function"?t:null)}var We=Object.assign,tf;function ol(t){if(tf===void 0)try{throw Error()}catch(r){var e=r.stack.trim().match(/\n( *(at )?)/);tf=e&&e[1]||""}return`
35`+tf+t}var rf=!1;function nf(t,e){if(!t||rf)return"";rf=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(u){var n=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){n=u}t.call(e.prototype)}else{try{throw Error()}catch(u){n=u}t()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var s=u.stack.split(`
36`),i=n.stack.split(`
37`),o=s.length-1,a=i.length-1;1<=o&&0<=a&&s[o]!==i[a];)a--;for(;1<=o&&0<=a;o--,a--)if(s[o]!==i[a]){if(o!==1||a!==1)do if(o--,a--,0>a||s[o]!==i[a]){var l=`
38`+s[o].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=o&&0<=a);break}}}finally{rf=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?ol(t):""}function qP(t){switch(t.tag){case 5:return ol(t.type);case 16:return ol("Lazy");case 13:return ol("Suspense");case 19:return ol("SuspenseList");case 0:case 2:case 15:return t=nf(t.type,!1),t;case 11:return t=nf(t.type.render,!1),t;case 1:return t=nf(t.type,!0),t;default:return""}}function kp(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case _o:return"Fragment";case yo:return"Portal";case wp:return"Profiler";case Zm:return"StrictMode";case bp:return"Suspense";case xp:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case vx:return(t.displayName||"Context")+".Consumer";case mx:return(t._context.displayName||"Context")+".Provider";case ev:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case tv:return e=t.displayName||null,e!==null?e:kp(t.type)||"Memo";case ls:e=t._payload,t=t._init;try{return kp(t(e))}catch{}}return null}function VP(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return kp(e);case 8:return e===Zm?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Ds(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function _x(t){var e=t.type;
vendor: 14,286 bytes, line 38
38return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function KP(t){var e=_x(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,i=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return s.call(this)},set:function(o){n=""+o,i.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function zu(t){t._valueTracker||(t._valueTracker=KP(t))}function wx(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=_x(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function ed(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Sp(t,e){var r=e.checked;return We({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function Xy(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=Ds(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function bx(t,e){e=e.checked,e!=null&&Xm(t,"checked",e,!1)}function Ep(t,e){bx(t,e);var r=Ds(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Cp(t,e.type,r):e.hasOwnProperty("defaultValue")&&Cp(t,e.type,Ds(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Zy(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function Cp(t,e,r){(e!=="number"||ed(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var al=Array.isArray;function Io(t,e,r,n){if(t=t.options,e){e={};for(var s=0;s<r.length;s++)e["$"+r[s]]=!0;for(r=0;r<t.length;r++)s=e.hasOwnProperty("$"+t[r].value),t[r].selected!==s&&(t[r].selected=s),s&&n&&(t[r].defaultSelected=!0)}else{for(r=""+Ds(r),e=null,s=0;s<t.length;s++){if(t[s].value===r){t[s].selected=!0,n&&(t[s].defaultSelected=!0);return}e!==null||t[s].disabled||(e=t[s])}e!==null&&(e.selected=!0)}}function Tp(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(D(91));return We({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function e_(t,e){var r=e.value;if(r==null){if(r=e.children,e=e.defaultValue,r!=null){if(e!=null)throw Error(D(92));if(al(r)){if(1<r.length)throw Error(D(93));r=r[0]}e=r}e==null&&(e=""),r=e}t._wrapperState={initialValue:Ds(r)}}function xx(t,e){var r=Ds(e.value),n=Ds(e.defaultValue);r!=null&&(r=""+r,r!==t.value&&(t.value=r),e.defaultValue==null&&t.defaultValue!==r&&(t.defaultValue=r)),n!=null&&(t.defaultValue=""+n)}function t_(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function kx(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Pp(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?kx(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Hu,Sx=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,r,n,s){MSApp.execUnsafeLocalFunction(function(){return t(e,r,n,s)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(Hu=Hu||document.createElement("div"),Hu.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Hu.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Ul(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var bl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},GP=["Webkit","ms","Moz","O"];Object.keys(bl).forEach(function(t){GP.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),bl[e]=bl[t]})});function Ex(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||bl.hasOwnProperty(t)&&bl[t]?(""+e).trim():e+"px"}function Cx(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=Ex(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,s):t[r]=s}}var YP=We({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Rp(t,e){if(e){if(YP[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(D(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(D(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(D(61))}if(e.style!=null&&typeof e.style!="object")throw Error(D(62))}}function Ap(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 Op=null;function rv(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var jp=null,$o=null,Lo=null;function r_(t){if(t=Ou(t)){if(typeof jp!="function")throw Error(D(280));var e=t.stateNode;e&&(e=_h(e),jp(t.stateNode,t.type,e))}}function Tx(t){$o?Lo?Lo.push(t):Lo=[t]:$o=t}function Px(){if($o){var t=$o,e=Lo;if(Lo=$o=null,r_(t),e)for(t=0;t<e.length;t++)r_(e[t])}}function Rx(t,e){return t(e)}function Ax(){}var sf=!1;function Ox(t,e,r){if(sf)return t(e,r);sf=!0;try{return Rx(t,e,r)}finally{sf=!1,($o!==null||Lo!==null)&&(Ax(),Px())}}function Bl(t,e){var r=t.stateNode;if(r===null)return null;var n=_h(r);if(n===null)return null;r=n[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(t=t.type,n=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!n;break e;default:t=!1}if(t)return null;if(r&&typeof r!="function")throw Error(D(231,e,typeof r));return r}var Np=!1;if(Hn)try{var Fa={};Object.defineProperty(Fa,"passive",{get:function(){Np=!0}}),window.addEventListener("test",Fa,Fa),window.removeEventListener("test",Fa,Fa)}catch{Np=!1}function JP(t,e,r,n,s,i,o,a,l){var u=Array.prototype.slice.call(arguments,3);try{e.apply(r,u)}catch(c){this.onError(c)}}var xl=!1,td=null,rd=!1,Ip=null,QP={onError:function(t){xl=!0,td=t}};function XP(t,e,r,n,s,i,o,a,l){xl=!1,td=null,JP.apply(QP,arguments)}function ZP(t,e,r,n,s,i,o,a,l){if(XP.apply(this,arguments),xl){if(xl){var u=td;xl=!1,td=null}else throw Error(D(198));rd||(rd=!0,Ip=u)}}function Ui(t){var e=t,r=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(r=e.return),t=e.return;while(t)}return e.tag===3?r:null}function jx(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function n_(t){if(Ui(t)!==t)throw Error(D(188))}function eR(t){var e=t.alternate;if(!e){if(e=Ui(t),e===null)throw Error(D(188));return e!==t?null:t}for(var r=t,n=e;;){var s=r.return;if(s===null)break;var i=s.alternate;if(i===null){if(n=s.return,n!==null){r=n;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===r)return n_(s),t;if(i===n)return n_(s),e;i=i.sibling}throw Error(D(188))}if(r.return!==n.return)r=s,n=i;else{for(var o=!1,a=s.child;a;){if(a===r){o=!0,r=s,n=i;break}if(a===n){o=!0,n=s,r=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===r){o=!0,r=i,n=s;break}if(a===n){o=!0,n=i,r=s;break}a=a.sibling}if(!o)throw Error(D(189))}}if(r.alternate!==n)throw Error(D(190))}if(r.tag!==3)throw Error(D(188));return r.stateNode.current===r?t:e}function Nx(t){return t=eR(t),t!==null?Ix(t):null}function Ix(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=Ix(t);if(e!==null)return e;t=t.sibling}return null}var $x=ur.unstable_scheduleCallback,s_=ur.unstable_cancelCallback,tR=ur.unstable_shouldYield,rR=ur.unstable_requestPaint,Ze=ur.unstable_now,nR=ur.unstable_getCurrentPriorityLevel,nv=ur.unstable_ImmediatePriority,Lx=ur.unstable_UserBlockingPriority,nd=ur.unstable_NormalPriority,sR=ur.unstable_LowPriority,Mx=ur.unstable_IdlePriority,gh=null,pn=null;function iR(t){if(pn&&typeof pn.onCommitFiberRoot=="function")try{pn.onCommitFiberRoot(gh,t,void 0,(t.current.flags&128)===128)}catch{}}var Hr=Math.clz32?Math.clz32:lR,oR=Math.log,aR=Math.LN2;function lR(t){return t>>>=0,t===0?32:31-(oR(t)/aR|0)|0}var Wu=64,qu=4194304;function ll(t){switch(t&-t){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: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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function sd(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,s=t.suspendedLanes,i=t.pingedLanes,o=r&268435455;if(o!==0){var a=o&~s;a!==0?n=ll(a):(i&=o,i!==0&&(n=ll(i)))}else o=r&~s,o!==0?n=ll(o):i!==0&&(n=ll(i));if(n===0)return 0;if(e!==0&&e!==n&&!(e&s)&&(s=n&-n,i=e&-e,s>=i||s===16&&(i&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0<e;)r=31-Hr(e),s=1<<r,n|=t[r],e&=~s;return n}function uR(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64: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 e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function cR(t,e){for(var r=t.suspendedLanes,n=t.pingedLanes,s=t.expirationTimes,i=t.pendingLanes;0<i;){var o=31-Hr(i),a=1<<o,l=s[o];l===-1?(!(a&r)||a&n)&&(s[o]=uR(a,e)):l<=e&&(t.expiredLanes|=a),i&=~a}}function $p(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Dx(){var t=Wu;return Wu<<=1,!(Wu&4194240)&&(Wu=64),t}function of(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function Ru(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Hr(e),t[e]=r}function dR(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0<r;){var s=31-Hr(r),i=1<<s;e[s]=0,n[s]=-1,t[s]=-1,r&=~i}}function sv(t,e){var r=t.entangledLanes|=e;for(t=t.entanglements;r;){var n=31-Hr(r),s=1<<n;s&e|t[n]&e&&(t[n]|=e),r&=~s}}var we=0;function Fx(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var Ux,iv,Bx,zx,Hx,Lp=!1,Vu=[],Ps=null,Rs=null,As=null,zl=new Map,Hl=new Map,cs=[],hR="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 submit".split(" ");function i_(t,e){switch(t){case"focusin":case"focusout":Ps=null;break;case"dragenter":case"dragleave":Rs=null;break;case"mouseover":case"mouseout":As=null;break;case"pointerover":case"pointerout":zl.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Hl.delete(e.pointerId)}}function Ua(t,e,r,n,s,i){return t===null||t.nativeEvent!==i?(t={blockedOn:e,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[s]},e!==null&&(e=Ou(e),e!==null&&iv(e)),t):(t.eventSystemFlags|=n,e=t.targetContainers,s!==null&&e.indexOf(s)===-1&&e.push(s),t)}function fR(t,e,r,n,s){switch(e){case"focusin":return Ps=Ua(Ps,t,e,r,n,s),!0;case"dragenter":return Rs=Ua(Rs,t,e,r,n,s),!0;case"mouseover":return As=Ua(As,t,e,r,n,s),!0;case"pointerover":var i=s.pointerId;return zl.set(i,Ua(zl.get(i)||null,t,e,r,n,s)),!0;case"gotpointercapture":return i=s.pointerId,Hl.set(i,Ua(Hl.get(i)||null,t,e,r,n,s)),!0}return!1}function Wx(t){var e=hi(t.target);if(e!==null){var r=Ui(e);if(r!==null){if(e=r.tag,e===13){if(e=jx(r),e!==null){t.blockedOn=e,Hx(t.priority,function(){Bx(r)});return}}else if(e===3&&r.stateNode.current.memoizedState.isDehydrated){t.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}t.blockedOn=null}function jc(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var r=Mp(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(r===null){r=t.nativeEvent;var n=new r.constructor(r.type,r);Op=n,r.target.dispatchEvent(n),Op=null}else return e=Ou(r),e!==null&&iv(e),t.blockedOn=r,!1;e.shift()}return!0}function o_(t,e,r){jc(t)&&r.delete(e)}function pR(){Lp=!1,Ps!==null&&jc(Ps)&&(Ps=null),Rs!==null&&jc(Rs)&&(Rs=null),As!==null&&jc(As)&&
vendor: 11,860 bytes, line 38
38(As=null),zl.forEach(o_),Hl.forEach(o_)}function Ba(t,e){t.blockedOn===e&&(t.blockedOn=null,Lp||(Lp=!0,ur.unstable_scheduleCallback(ur.unstable_NormalPriority,pR)))}function Wl(t){function e(s){return Ba(s,t)}if(0<Vu.length){Ba(Vu[0],t);for(var r=1;r<Vu.length;r++){var n=Vu[r];n.blockedOn===t&&(n.blockedOn=null)}}for(Ps!==null&&Ba(Ps,t),Rs!==null&&Ba(Rs,t),As!==null&&Ba(As,t),zl.forEach(e),Hl.forEach(e),r=0;r<cs.length;r++)n=cs[r],n.blockedOn===t&&(n.blockedOn=null);for(;0<cs.length&&(r=cs[0],r.blockedOn===null);)Wx(r),r.blockedOn===null&&cs.shift()}var Mo=Jn.ReactCurrentBatchConfig,id=!0;function gR(t,e,r,n){var s=we,i=Mo.transition;Mo.transition=null;try{we=1,ov(t,e,r,n)}finally{we=s,Mo.transition=i}}function mR(t,e,r,n){var s=we,i=Mo.transition;Mo.transition=null;try{we=4,ov(t,e,r,n)}finally{we=s,Mo.transition=i}}function ov(t,e,r,n){if(id){var s=Mp(t,e,r,n);if(s===null)mf(t,e,n,od,r),i_(t,n);else if(fR(s,t,e,r,n))n.stopPropagation();else if(i_(t,n),e&4&&-1<hR.indexOf(t)){for(;s!==null;){var i=Ou(s);if(i!==null&&Ux(i),i=Mp(t,e,r,n),i===null&&mf(t,e,n,od,r),i===s)break;s=i}s!==null&&n.stopPropagation()}else mf(t,e,n,null,r)}}var od=null;function Mp(t,e,r,n){if(od=null,t=rv(n),t=hi(t),t!==null)if(e=Ui(t),e===null)t=null;else if(r=e.tag,r===13){if(t=jx(e),t!==null)return t;t=null}else if(r===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return od=t,null}function qx(t){switch(t){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"resize":case"seeked":case"submit":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"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(nR()){case nv:return 1;case Lx:return 4;case nd:case sR:return 16;case Mx:return 536870912;default:return 16}default:return 16}}var Ss=null,av=null,Nc=null;function Vx(){if(Nc)return Nc;var t,e=av,r=e.length,n,s="value"in Ss?Ss.value:Ss.textContent,i=s.length;for(t=0;t<r&&e[t]===s[t];t++);var o=r-t;for(n=1;n<=o&&e[r-n]===s[i-n];n++);return Nc=s.slice(t,1<n?1-n:void 0)}function Ic(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Ku(){return!0}function a_(){return!1}function dr(t){function e(r,n,s,i,o){this._reactName=r,this._targetInst=s,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var a in t)t.hasOwnProperty(a)&&(r=t[a],this[a]=r?r(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Ku:a_,this.isPropagationStopped=a_,this}return We(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Ku)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Ku)},persist:function(){},isPersistent:Ku}),e}var ba={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lv=dr(ba),Au=We({},ba,{view:0,detail:0}),vR=dr(Au),af,lf,za,mh=We({},Au,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:uv,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==za&&(za&&t.type==="mousemove"?(af=t.screenX-za.screenX,lf=t.screenY-za.screenY):lf=af=0,za=t),af)},movementY:function(t){return"movementY"in t?t.movementY:lf}}),l_=dr(mh),yR=We({},mh,{dataTransfer:0}),_R=dr(yR),wR=We({},Au,{relatedTarget:0}),uf=dr(wR),bR=We({},ba,{animationName:0,elapsedTime:0,pseudoElement:0}),xR=dr(bR),kR=We({},ba,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),SR=dr(kR),ER=We({},ba,{data:0}),u_=dr(ER),CR={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},TR={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"},PR={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function RR(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=PR[t])?!!e[t]:!1}function uv(){return RR}var AR=We({},Au,{key:function(t){if(t.key){var e=CR[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Ic(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?TR[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:uv,charCode:function(t){return t.type==="keypress"?Ic(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Ic(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),OR=dr(AR),jR=We({},mh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),c_=dr(jR),NR=We({},Au,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:uv}),IR=dr(NR),$R=We({},ba,{propertyName:0,elapsedTime:0,pseudoElement:0}),LR=dr($R),MR=We({},mh,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),DR=dr(MR),FR=[9,13,27,32],cv=Hn&&"CompositionEvent"in window,kl=null;Hn&&"documentMode"in document&&(kl=document.documentMode);var UR=Hn&&"TextEvent"in window&&!kl,Kx=Hn&&(!cv||kl&&8<kl&&11>=kl),d_=" ",h_=!1;function Gx(t,e){switch(t){case"keyup":return FR.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yx(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var wo=!1;function BR(t,e){switch(t){case"compositionend":return Yx(e);case"keypress":return e.which!==32?null:(h_=!0,d_);case"textInput":return t=e.data,t===d_&&h_?null:t;default:return null}}function zR(t,e){if(wo)return t==="compositionend"||!cv&&Gx(t,e)?(t=Vx(),Nc=av=Ss=null,wo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return Kx&&e.locale!=="ko"?null:e.data;default:return null}}var HR={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 f_(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!HR[t.type]:e==="textarea"}function Jx(t,e,r,n){Tx(n),e=ad(e,"onChange"),0<e.length&&(r=new lv("onChange","change",null,r,n),t.push({event:r,listeners:e}))}var Sl=null,ql=null;function WR(t){ak(t,0)}function vh(t){var e=ko(t);if(wx(e))return t}function qR(t,e){if(t==="change")return e}var Qx=!1;if(Hn){var cf;if(Hn){var df="oninput"in document;if(!df){var p_=document.createElement("div");p_.setAttribute("oninput","return;"),df=typeof p_.oninput=="function"}cf=df}else cf=!1;Qx=cf&&(!document.documentMode||9<document.documentMode)}function g_(){Sl&&(Sl.detachEvent("onpropertychange",Xx),ql=Sl=null)}function Xx(t){if(t.propertyName==="value"&&vh(ql)){var e=[];Jx(e,ql,t,rv(t)),Ox(WR,e)}}function VR(t,e,r){t==="focusin"?(g_(),Sl=e,ql=r,Sl.attachEvent("onpropertychange",Xx)):t==="focusout"&&g_()}function KR(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return vh(ql)}function GR(t,e){if(t==="click")return vh(e)}function YR(t,e){if(t==="input"||t==="change")return vh(e)}function JR(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var qr=typeof Object.is=="function"?Object.is:JR;function Vl(t,e){if(qr(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var s=r[n];if(!_p.call(e,s)||!qr(t[s],e[s]))return!1}return!0}function m_(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function v_(t,e){var r=m_(t);t=0;for(var n;r;){if(r.nodeType===3){if(n=t+r.textContent.length,t<=e&&n>=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=m_(r)}}function Zx(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Zx(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function ek(){for(var t=window,e=ed();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=ed(t.document)}return e}function dv(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function QR(t){var e=ek(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&Zx(r.ownerDocument.documentElement,r)){if(n!==null&&dv(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var s=r.textContent.length,i=Math.min(n.start,s);n=n.end===void 0?i:Math.min(n.end,s),!t.extend&&i>n&&(s=n,n=i,i=s),s=v_(r,i);var o=v_(r,n);s&&o&&(t.rangeCount!==1||t.anchorNode!==s.node||t.anchorOffset!==s.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),t.removeAllRanges(),i>n?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<e.length;r++)t=e[r],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var XR=Hn&&"documentMode"in document&&11>=document.documentMode,bo=null,Dp=null,El=null,Fp=!1;function y_(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Fp||bo==null||bo!==ed(n)||(n=bo,"selectionStart"in n&&dv(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focu
vendor: 4,383 bytes, line 38
38sNode:n.focusNode,focusOffset:n.focusOffset}),El&&Vl(El,n)||(El=n,n=ad(Dp,"onSelect"),0<n.length&&(e=new lv("onSelect","select",null,e,r),t.push({event:e,listeners:n}),e.target=bo)))}function Gu(t,e){var r={};return r[t.toLowerCase()]=e.toLowerCase(),r["Webkit"+t]="webkit"+e,r["Moz"+t]="moz"+e,r}var xo={animationend:Gu("Animation","AnimationEnd"),animationiteration:Gu("Animation","AnimationIteration"),animationstart:Gu("Animation","AnimationStart"),transitionend:Gu("Transition","TransitionEnd")},hf={},tk={};Hn&&(tk=document.createElement("div").style,"AnimationEvent"in window||(delete xo.animationend.animation,delete xo.animationiteration.animation,delete xo.animationstart.animation),"TransitionEvent"in window||delete xo.transitionend.transition);function yh(t){if(hf[t])return hf[t];if(!xo[t])return t;var e=xo[t],r;for(r in e)if(e.hasOwnProperty(r)&&r in tk)return hf[t]=e[r];return t}var rk=yh("animationend"),nk=yh("animationiteration"),sk=yh("animationstart"),ik=yh("transitionend"),ok=new Map,__="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error 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(" ");function qs(t,e){ok.set(t,e),Fi(e,[t])}for(var ff=0;ff<__.length;ff++){var pf=__[ff],ZR=pf.toLowerCase(),eA=pf[0].toUpperCase()+pf.slice(1);qs(ZR,"on"+eA)}qs(rk,"onAnimationEnd");qs(nk,"onAnimationIteration");qs(sk,"onAnimationStart");qs("dblclick","onDoubleClick");qs("focusin","onFocus");qs("focusout","onBlur");qs(ik,"onTransitionEnd");sa("onMouseEnter",["mouseout","mouseover"]);sa("onMouseLeave",["mouseout","mouseover"]);sa("onPointerEnter",["pointerout","pointerover"]);sa("onPointerLeave",["pointerout","pointerover"]);Fi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Fi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Fi("onBeforeInput",["compositionend","keypress","textInput","paste"]);Fi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Fi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Fi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ul="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(" "),tA=new Set("cancel close invalid load scroll toggle".split(" ").concat(ul));function w_(t,e,r){var n=t.type||"unknown-event";t.currentTarget=r,ZP(n,e,void 0,t),t.currentTarget=null}function ak(t,e){e=(e&4)!==0;for(var r=0;r<t.length;r++){var n=t[r],s=n.event;n=n.listeners;e:{var i=void 0;if(e)for(var o=n.length-1;0<=o;o--){var a=n[o],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==i&&s.isPropagationStopped())break e;w_(s,a,u),i=l}else for(o=0;o<n.length;o++){if(a=n[o],l=a.instance,u=a.currentTarget,a=a.listener,l!==i&&s.isPropagationStopped())break e;w_(s,a,u),i=l}}}if(rd)throw t=Ip,rd=!1,Ip=null,t}function Oe(t,e){var r=e[Wp];r===void 0&&(r=e[Wp]=new Set);var n=t+"__bubble";r.has(n)||(lk(e,t,2,!1),r.add(n))}function gf(t,e,r){var n=0;e&&(n|=4),lk(r,t,n,e)}var Yu="_reactListening"+Math.random().toString(36).slice(2);function Kl(t){if(!t[Yu]){t[Yu]=!0,gx.forEach(function(r){r!=="selectionchange"&&(tA.has(r)||gf(r,!1,t),gf(r,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Yu]||(e[Yu]=!0,gf("selectionchange",!1,e))}}function lk(t,e,r,n){switch(qx(e)){case 1:var s=gR;break;case 4:s=mR;break;default:s=ov}r=s.bind(null,e,r,t),s=void 0,!Np||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(s=!0),n?s!==void 0?t.addEventListener(e,r,{capture:!0,passive:s}):t.addEventListener(e,r,!0):s!==void 0?t.addEventListener(e,r,{passive:s}):t.addEventListener(e,r,!1)}function mf(t,e,r,n,s){var i=n;
vendor: 5,434 bytes, lines 38-39
38if(!(e&1)&&!(e&2)&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var a=n.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(o===4)for(o=n.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===s||l.nodeType===8&&l.parentNode===s))return;o=o.return}for(;a!==null;){if(o=hi(a),o===null)return;if(l=o.tag,l===5||l===6){n=i=o;continue e}a=a.parentNode}}n=n.return}Ox(function(){var u=i,c=rv(r),d=[];e:{var h=ok.get(t);if(h!==void 0){var f=lv,g=t;switch(t){case"keypress":if(Ic(r)===0)break e;case"keydown":case"keyup":f=OR;break;case"focusin":g="focus",f=uf;break;case"focusout":g="blur",f=uf;break;case"beforeblur":case"afterblur":f=uf;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":f=l_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=_R;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=IR;break;case rk:case nk:case sk:f=xR;break;case ik:f=LR;break;case"scroll":f=vR;break;case"wheel":f=DR;break;case"copy":case"cut":case"paste":f=SR;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=c_}var p=(e&4)!==0,b=!p&&t==="scroll",v=p?h!==null?h+"Capture":null:h;p=[];for(var y=u,_;y!==null;){_=y;var x=_.stateNode;if(_.tag===5&&x!==null&&(_=x,v!==null&&(x=Bl(y,v),x!=null&&p.push(Gl(y,x,_)))),b)break;y=y.return}0<p.length&&(h=new f(h,g,null,r,c),d.push({event:h,listeners:p}))}}if(!(e&7)){e:{if(h=t==="mouseover"||t==="pointerover",f=t==="mouseout"||t==="pointerout",h&&r!==Op&&(g=r.relatedTarget||r.fromElement)&&(hi(g)||g[Wn]))break e;if((f||h)&&(h=c.window===c?c:(h=c.ownerDocument)?h.defaultView||h.parentWindow:window,f?(g=r.relatedTarget||r.toElement,f=u,g=g?hi(g):null,g!==null&&(b=Ui(g),g!==b||g.tag!==5&&g.tag!==6)&&(g=null)):(f=null,g=u),f!==g)){if(p=l_,x="onMouseLeave",v="onMouseEnter",y="mouse",(t==="pointerout"||t==="pointerover")&&(p=c_,x="onPointerLeave",v="onPointerEnter",y="pointer"),b=f==null?h:ko(f),_=g==null?h:ko(g),h=new p(x,y+"leave",f,r,c),h.target=b,h.relatedTarget=_,x=null,hi(c)===u&&(p=new p(v,y+"enter",g,r,c),p.target=_,p.relatedTarget=b,x=p),b=x,f&&g)t:{for(p=f,v=g,y=0,_=p;_;_=Gi(_))y++;for(_=0,x=v;x;x=Gi(x))_++;for(;0<y-_;)p=Gi(p),y--;for(;0<_-y;)v=Gi(v),_--;for(;y--;){if(p===v||v!==null&&p===v.alternate)break t;p=Gi(p),v=Gi(v)}p=null}else p=null;f!==null&&b_(d,h,f,p,!1),g!==null&&b!==null&&b_(d,b,g,p,!0)}}e:{if(h=u?ko(u):window,f=h.nodeName&&h.nodeName.toLowerCase(),f==="select"||f==="input"&&h.type==="file")var k=qR;else if(f_(h))if(Qx)k=YR;else{k=KR;var C=VR}else(f=h.nodeName)&&f.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(k=GR);if(k&&(k=k(t,u))){Jx(d,k,r,c);break e}C&&C(t,h,u),t==="focusout"&&(C=h._wrapperState)&&C.controlled&&h.type==="number"&&Cp(h,"number",h.value)}switch(C=u?ko(u):window,t){case"focusin":(f_(C)||C.contentEditable==="true")&&(bo=C,Dp=u,El=null);break;case"focusout":El=Dp=bo=null;break;case"mousedown":Fp=!0;break;case"contextmenu":case"mouseup":case"dragend":Fp=!1,y_(d,r,c);break;case"selectionchange":if(XR)break;case"keydown":case"keyup":y_(d,r,c)}var T;if(cv)e:{switch(t){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else wo?Gx(t,r)&&(S="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(S="onCompositionStart");S&&(Kx&&r.locale!=="ko"&&(wo||S!=="onCompositionStart"?S==="onCompositionEnd"&&wo&&(T=Vx()):(Ss=c,av="value"in Ss?Ss.value:Ss.textContent,wo=!0)),C=ad(u,S),0<C.length&&(S=new u_(S,t,null,r,c),d.push({event:S,listeners:C}),T?S.data=T:(T=Yx(r),T!==null&&(S.data=T)))),(T=UR?BR(t,r):zR(t,r))&&(u=ad(u,"onBeforeInput"),0<u.length&&(c=new u_("onBeforeInput","beforeinput",null,r,c),d.push({event:c,listeners:u}),c.data=T))}ak(d,e)})}function Gl(t,e,r){return{instance:t,listener:e,currentTarget:r}}function ad(t,e){for(var r=e+"Capture",n=[];t!==null;){var s=t,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=Bl(t,r),i!=null&&n.unshift(Gl(t,i,s)),i=Bl(t,e),i!=null&&n.push(Gl(t,i,s))),t=t.return}return n}function Gi(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function b_(t,e,r,n,s){for(var i=e._reactName,o=[];r!==null&&r!==n;){var a=r,l=a.alternate,u=a.stateNode;if(l!==null&&l===n)break;a.tag===5&&u!==null&&(a=u,s?(l=Bl(r,i),l!=null&&o.unshift(Gl(r,l,a))):s||(l=Bl(r,i),l!=null&&o.push(Gl(r,l,a)))),r=r.return}o.length!==0&&t.push({event:e,listeners:o})}var rA=/\r\n?/g,nA=/\u0000|\uFFFD/g;function x_(t){return(typeof t=="string"?t:""+t).replace(rA,`
39`).replace(nA,"")}function Ju(t,e,r){if(e=x_(e),x_(t)!==e&&r)throw Error(D(425))}function ld(){}var Up=null,Bp=null;function zp(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Hp=typeof setTimeout=="function"?setTimeout:void 0,sA=typeof clearTimeout=="function"?clearTimeout:void 0,k_=typeof Promise=="function"?Promise:void 0,iA=typeof queueMicrotask=="function"?queueMicrotask:typeof k_<"u"?function(t){return k_.resolve(null).then(t).cat
vendor: 4,205 bytes, line 39
39ch(oA)}:Hp;function oA(t){setTimeout(function(){throw t})}function vf(t,e){var r=e,n=0;do{var s=r.nextSibling;if(t.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(n===0){t.removeChild(s),Wl(e);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=s}while(r);Wl(e)}function Os(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function S_(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="$"||r==="$!"||r==="$?"){if(e===0)return t;e--}else r==="/$"&&e++}t=t.previousSibling}return null}var xa=Math.random().toString(36).slice(2),un="__reactFiber$"+xa,Yl="__reactProps$"+xa,Wn="__reactContainer$"+xa,Wp="__reactEvents$"+xa,aA="__reactListeners$"+xa,lA="__reactHandles$"+xa;function hi(t){var e=t[un];if(e)return e;for(var r=t.parentNode;r;){if(e=r[Wn]||r[un]){if(r=e.alternate,e.child!==null||r!==null&&r.child!==null)for(t=S_(t);t!==null;){if(r=t[un])return r;t=S_(t)}return e}t=r,r=t.parentNode}return null}function Ou(t){return t=t[un]||t[Wn],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function ko(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(D(33))}function _h(t){return t[Yl]||null}var qp=[],So=-1;function Vs(t){return{current:t}}function Ie(t){0>So||(t.current=qp[So],qp[So]=null,So--)}function Re(t,e){So++,qp[So]=t.current,t.current=e}var Fs={},Et=Vs(Fs),Yt=Vs(!1),Ai=Fs;function ia(t,e){var r=t.type.contextTypes;if(!r)return Fs;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in r)s[i]=e[i];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=s),s}function Jt(t){return t=t.childContextTypes,t!=null}function ud(){Ie(Yt),Ie(Et)}function E_(t,e,r){if(Et.current!==Fs)throw Error(D(168));Re(Et,e),Re(Yt,r)}function uk(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in e))throw Error(D(108,VP(t)||"Unknown",s));return We({},r,n)}function cd(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Fs,Ai=Et.current,Re(Et,t),Re(Yt,Yt.current),!0}function C_(t,e,r){var n=t.stateNode;if(!n)throw Error(D(169));r?(t=uk(t,e,Ai),n.__reactInternalMemoizedMergedChildContext=t,Ie(Yt),Ie(Et),Re(Et,t)):Ie(Yt),Re(Yt,r)}var jn=null,wh=!1,yf=!1;function ck(t){jn===null?jn=[t]:jn.push(t)}function uA(t){wh=!0,ck(t)}function Ks(){if(!yf&&jn!==null){yf=!0;var t=0,e=we;try{var r=jn;for(we=1;t<r.length;t++){var n=r[t];do n=n(!0);while(n!==null)}jn=null,wh=!1}catch(s){throw jn!==null&&(jn=jn.slice(t+1)),$x(nv,Ks),s}finally{we=e,yf=!1}}return null}var Eo=[],Co=0,dd=null,hd=0,vr=[],yr=0,Oi=null,Dn=1,Fn="";function si(t,e){Eo[Co++]=hd,Eo[Co++]=dd,dd=t,hd=e}function dk(t,e,r){vr[yr++]=Dn,vr[yr++]=Fn,vr[yr++]=Oi,Oi=t;var n=Dn;t=Fn;var s=32-Hr(n)-1;n&=~(1<<s),r+=1;var i=32-Hr(e)+s;if(30<i){var o=s-s%5;i=(n&(1<<o)-1).toString(32),n>>=o,s-=o,Dn=1<<32-Hr(e)+s|r<<s|n,Fn=i+t}else Dn=1<<i|r<<s|n,Fn=t}function hv(t){t.return!==null&&(si(t,1),dk(t,1,0))}function fv(t){for(;t===dd;)dd=Eo[--Co],Eo[Co]=null,hd=Eo[--Co],Eo[Co]=null;for(;t===Oi;)Oi=vr[--yr],vr[yr]=null,Fn=vr[--yr],vr[yr]=null,Dn=vr[--yr],vr[yr]=null}var or=null,sr=null,Be=!1,Ur=null;function hk(t,e){var r=wr(5,null,null,0);r.elementType="DELETED",r.stateNode=e,r.return=t,e=t.deletions,e===null?(t.deletions=[r],t.flags|=16):e.push(r)}function T_(t,e){switch(t.tag){case 5:var r=t.type;return e=e.nodeType!==1||r.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,or=t,sr=Os(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,or=t,sr=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(r=Oi!==null?{id:Dn,overflow:Fn}:null,t.memoizedState={dehydrated:e,treeContext:r,retryLane:1073741824},r=wr(18,null,null,0),r.stateNode=e,r.return=t,t.child=r,or=t,sr=null,!0):!1;default:return!1}}function Vp(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Kp(t){if(Be){var e=sr;if(e){var r=e;if(!T_(t,e)){if(Vp(t))throw Error(D(418));
vendor: 10,898 bytes, line 39
39e=Os(r.nextSibling);var n=or;e&&T_(t,e)?hk(n,r):(t.flags=t.flags&-4097|2,Be=!1,or=t)}}else{if(Vp(t))throw Error(D(418));t.flags=t.flags&-4097|2,Be=!1,or=t}}}function P_(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;or=t}function Qu(t){if(t!==or)return!1;if(!Be)return P_(t),Be=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!zp(t.type,t.memoizedProps)),e&&(e=sr)){if(Vp(t))throw fk(),Error(D(418));for(;e;)hk(t,e),e=Os(e.nextSibling)}if(P_(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(D(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="/$"){if(e===0){sr=Os(t.nextSibling);break e}e--}else r!=="$"&&r!=="$!"&&r!=="$?"||e++}t=t.nextSibling}sr=null}}else sr=or?Os(t.stateNode.nextSibling):null;return!0}function fk(){for(var t=sr;t;)t=Os(t.nextSibling)}function oa(){sr=or=null,Be=!1}function pv(t){Ur===null?Ur=[t]:Ur.push(t)}var cA=Jn.ReactCurrentBatchConfig;function Ha(t,e,r){if(t=r.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(D(309));var n=r.stateNode}if(!n)throw Error(D(147,t));var s=n,i=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===i?e.ref:(e=function(o){var a=s.refs;o===null?delete a[i]:a[i]=o},e._stringRef=i,e)}if(typeof t!="string")throw Error(D(284));if(!r._owner)throw Error(D(290,t))}return t}function Xu(t,e){throw t=Object.prototype.toString.call(e),Error(D(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function R_(t){var e=t._init;return e(t._payload)}function pk(t){function e(v,y){if(t){var _=v.deletions;_===null?(v.deletions=[y],v.flags|=16):_.push(y)}}function r(v,y){if(!t)return null;for(;y!==null;)e(v,y),y=y.sibling;return null}function n(v,y){for(v=new Map;y!==null;)y.key!==null?v.set(y.key,y):v.set(y.index,y),y=y.sibling;return v}function s(v,y){return v=$s(v,y),v.index=0,v.sibling=null,v}function i(v,y,_){return v.index=_,t?(_=v.alternate,_!==null?(_=_.index,_<y?(v.flags|=2,y):_):(v.flags|=2,y)):(v.flags|=1048576,y)}function o(v){return t&&v.alternate===null&&(v.flags|=2),v}function a(v,y,_,x){return y===null||y.tag!==6?(y=Ef(_,v.mode,x),y.return=v,y):(y=s(y,_),y.return=v,y)}function l(v,y,_,x){var k=_.type;return k===_o?c(v,y,_.props.children,x,_.key):y!==null&&(y.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===ls&&R_(k)===y.type)?(x=s(y,_.props),x.ref=Ha(v,y,_),x.return=v,x):(x=Bc(_.type,_.key,_.props,null,v.mode,x),x.ref=Ha(v,y,_),x.return=v,x)}function u(v,y,_,x){return y===null||y.tag!==4||y.stateNode.containerInfo!==_.containerInfo||y.stateNode.implementation!==_.implementation?(y=Cf(_,v.mode,x),y.return=v,y):(y=s(y,_.children||[]),y.return=v,y)}function c(v,y,_,x,k){return y===null||y.tag!==7?(y=Ti(_,v.mode,x,k),y.return=v,y):(y=s(y,_),y.return=v,y)}function d(v,y,_){if(typeof y=="string"&&y!==""||typeof y=="number")return y=Ef(""+y,v.mode,_),y.return=v,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Bu:return _=Bc(y.type,y.key,y.props,null,v.mode,_),_.ref=Ha(v,null,y),_.return=v,_;case yo:return y=Cf(y,v.mode,_),y.return=v,y;case ls:var x=y._init;return d(v,x(y._payload),_)}if(al(y)||Da(y))return y=Ti(y,v.mode,_,null),y.return=v,y;Xu(v,y)}return null}function h(v,y,_,x){var k=y!==null?y.key:null;if(typeof _=="string"&&_!==""||typeof _=="number")return k!==null?null:a(v,y,""+_,x);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Bu:return _.key===k?l(v,y,_,x):null;case yo:return _.key===k?u(v,y,_,x):null;case ls:return k=_._init,h(v,y,k(_._payload),x)}if(al(_)||Da(_))return k!==null?null:c(v,y,_,x,null);Xu(v,_)}return null}function f(v,y,_,x,k){if(typeof x=="string"&&x!==""||typeof x=="number")return v=v.get(_)||null,a(y,v,""+x,k);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Bu:return v=v.get(x.key===null?_:x.key)||null,l(y,v,x,k);case yo:return v=v.get(x.key===null?_:x.key)||null,u(y,v,x,k);case ls:var C=x._init;return f(v,y,_,C(x._payload),k)}if(al(x)||Da(x))return v=v.get(_)||null,c(y,v,x,k,null);Xu(y,x)}return null}function g(v,y,_,x){for(var k=null,C=null,T=y,S=y=0,P=null;T!==null&&S<_.length;S++){T.index>S?(P=T,T=null):P=T.sibling;var R=h(v,T,_[S],x);if(R===null){T===null&&(T=P);break}t&&T&&R.alternate===null&&e(v,T),y=i(R,y,S),C===null?k=R:C.sibling=R,C=R,T=P}if(S===_.length)return r(v,T),Be&&si(v,S),k;if(T===null){for(;S<_.length;S++)T=d(v,_[S],x),T!==null&&(y=i(T,y,S),C===null?k=T:C.sibling=T,C=T);return Be&&si(v,S),k}for(T=n(v,T);S<_.length;S++)P=f(T,v,S,_[S],x),P!==null&&(t&&P.alternate!==null&&T.delete(P.key===null?S:P.key),y=i(P,y,S),C===null?k=P:C.sibling=P,C=P);return t&&T.forEach(function(I){return e(v,I)}),Be&&si(v,S),k}function p(v,y,_,x){var k=Da(_);if(typeof k!="function")throw Error(D(150));if(_=k.call(_),_==null)throw Error(D(151));for(var C=k=null,T=y,S=y=0,P=null,R=_.next();T!==null&&!R.done;S++,R=_.next()){T.index>S?(P=T,T=null):P=T.sibling;var I=h(v,T,R.value,x);if(I===null){T===null&&(T=P);break}t&&T&&I.alternate===null&&e(v,T),y=i(I,y,S),C===null?k=I:C.sibling=I,C=I,T=P}if(R.done)return r(v,T),Be&&si(v,S),k;if(T===null){for(;!R.done;S++,R=_.next())R=d(v,R.value,x),R!==null&&(y=i(R,y,S),C===null?k=R:C.sibling=R,C=R);return Be&&si(v,S),k}for(T=n(v,T);!R.done;S++,R=_.next())R=f(T,v,S,R.value,x),R!==null&&(t&&R.alternate!==null&&T.delete(R.key===null?S:R.key),y=i(R,y,S),C===null?k=R:C.sibling=R,C=R);return t&&T.forEach(function(N){return e(v,N)}),Be&&si(v,S),k}function b(v,y,_,x){if(typeof _=="object"&&_!==null&&_.type===_o&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Bu:e:{for(var k=_.key,C=y;C!==null;){if(C.key===k){if(k=_.type,k===_o){if(C.tag===7){r(v,C.sibling),y=s(C,_.props.children),y.return=v,v=y;break e}}else if(C.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===ls&&R_(k)===C.type){r(v,C.sibling),y=s(C,_.props),y.ref=Ha(v,C,_),y.return=v,v=y;break e}r(v,C);break}else e(v,C);C=C.sibling}_.type===_o?(y=Ti(_.props.children,v.mode,x,_.key),y.return=v,v=y):(x=Bc(_.type,_.key,_.props,null,v.mode,x),x.ref=Ha(v,y,_),x.return=v,v=x)}return o(v);case yo:e:{for(C=_.key;y!==null;){if(y.key===C)if(y.tag===4&&y.stateNode.containerInfo===_.containerInfo&&y.stateNode.implementation===_.implementation){r(v,y.sibling),y=s(y,_.children||[]),y.return=v,v=y;break e}else{r(v,y);break}else e(v,y);y=y.sibling}y=Cf(_,v.mode,x),y.return=v,v=y}return o(v);case ls:return C=_._init,b(v,y,C(_._payload),x)}if(al(_))return g(v,y,_,x);if(Da(_))return p(v,y,_,x);Xu(v,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,y!==null&&y.tag===6?(r(v,y.sibling),y=s(y,_),y.return=v,v=y):(r(v,y),y=Ef(_,v.mode,x),y.return=v,v=y),o(v)):r(v,y)}return b}var aa=pk(!0),gk=pk(!1),fd=Vs(null),pd=null,To=null,gv=null;function mv(){gv=To=pd=null}function vv(t){var e=fd.current;Ie(fd),t._currentValue=e}function Gp(t,e,r){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===r)break;t=t.return}}function Do(t,e){pd=t,gv=To=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Kt=!0),t.firstContext=null)}function Sr(t){var e=t._currentValue;if(gv!==t)if(t={context:t,memoizedValue:e,next:null},To===null){if(pd===null)throw Error(D(308));To=t,pd.dependencies={lanes:0,firstContext:t}}else To=To.next=t;return e}var fi=null;function yv(t){fi===null?fi=[t]:fi.push(t)}function mk(t,e,r,n){var s=e.interleaved;return s===null?(r.next=r,yv(e)):(r.next=s.next,s.next=r),e.interleaved=r,qn(t,n)}function qn(t,e){t.lanes|=e;var r=t.alternate;for(r!==null&&(r.lanes|=e),r=t,t=t.return;t!==null;)t.childLanes|=e,r=t.alternate,r!==null&&(r.childLanes|=e),r=t,t=t.return;return r.tag===3?r.stateNode:null}var us=!1;function _v(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function vk(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Bn(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function js(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,ye&2){var s=n.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),n.pending=e,qn(t,r)}return s=n.interleaved,s===null?(e.next=e,yv(n)):(e.next=s.next,s.next=e),n.interleaved=e,qn(t,r)}function $c(t,e,r){if(e=e.updateQueue,e!==null&&(e=e.shared,(r&4194240)!==0)){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,sv(t,r)}}function A_(t,e){var r=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?s=i=o:i=i.next=o,r=r.next}while(r!==null);i===null?s=i=e:i=i.next=e}else s=i=e;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:n.shared,effects:n.effects},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}function gd(t,e,r,n){var s=t.updateQueue;us=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?i=u:o.next=u,o=l;var c=t.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==o&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(i!==null){var d=s.baseState;o=0,c=u=l=null,a=i;do{var h=a.lane,f=a.eventTime;if((n&h)===h){c!==null&&(c=c.next={eventTime:f,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=t,p=a;switch(h=e,f=r,p.tag){case 1:if(g=p.payload,typeof g=="function"){d=g.call(f,d,h);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=p.payload,h=typeof g=="function"?g.call(f,d,h):g,h==null)break e;d=We({},d,h);break e;case 2:us=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,h=s.effects,h===null?s.effects=[a]:h.push(a))}else f={eventTime:f,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=f,l=d):c=c.next=f,o|=h;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;h=a,a=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(c===null&&(l=d),s.baseState=l,s.firstBaseUpdate=u,s.lastBaseUpdate=c,e=s.shared.interleaved,e!==null){s=e;do o|=s.lane,s=s.next;while(s!==e)}else i===null&&(s.shared.lanes=0);Ni|=o,t.lanes=o,t.memoizedState=d}}function O_(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var n=t[e],s=n.callback;if(s!==null){if(n.callback=null,n=r,typeof s!="function")throw Error(D(191,s));s.call(n)}}}var ju={},gn=Vs(ju),Jl=Vs(ju),Ql=Vs(ju);function pi(t){if(t===ju)throw Error(D(174));return t}function wv(t,e){switch(Re(Ql,e),Re(Jl,t),Re(gn,ju),t=e.nodeType,t){case 9:case 11:e=(e
vendor: 6,847 bytes, line 39
39=e.documentElement)?e.namespaceURI:Pp(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Pp(e,t)}Ie(gn),Re(gn,e)}function la(){Ie(gn),Ie(Jl),Ie(Ql)}function yk(t){pi(Ql.current);var e=pi(gn.current),r=Pp(e,t.type);e!==r&&(Re(Jl,t),Re(gn,r))}function bv(t){Jl.current===t&&(Ie(gn),Ie(Jl))}var ze=Vs(0);function md(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var _f=[];function xv(){for(var t=0;t<_f.length;t++)_f[t]._workInProgressVersionPrimary=null;_f.length=0}var Lc=Jn.ReactCurrentDispatcher,wf=Jn.ReactCurrentBatchConfig,ji=0,He=null,st=null,lt=null,vd=!1,Cl=!1,Xl=0,dA=0;function _t(){throw Error(D(321))}function kv(t,e){if(e===null)return!1;for(var r=0;r<e.length&&r<t.length;r++)if(!qr(t[r],e[r]))return!1;return!0}function Sv(t,e,r,n,s,i){if(ji=i,He=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Lc.current=t===null||t.memoizedState===null?gA:mA,t=r(n,s),Cl){i=0;do{if(Cl=!1,Xl=0,25<=i)throw Error(D(301));i+=1,lt=st=null,e.updateQueue=null,Lc.current=vA,t=r(n,s)}while(Cl)}if(Lc.current=yd,e=st!==null&&st.next!==null,ji=0,lt=st=He=null,vd=!1,e)throw Error(D(300));return t}function Ev(){var t=Xl!==0;return Xl=0,t}function rn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lt===null?He.memoizedState=lt=t:lt=lt.next=t,lt}function Er(){if(st===null){var t=He.alternate;t=t!==null?t.memoizedState:null}else t=st.next;var e=lt===null?He.memoizedState:lt.next;if(e!==null)lt=e,st=t;else{if(t===null)throw Error(D(310));st=t,t={memoizedState:st.memoizedState,baseState:st.baseState,baseQueue:st.baseQueue,queue:st.queue,next:null},lt===null?He.memoizedState=lt=t:lt=lt.next=t}return lt}function Zl(t,e){return typeof e=="function"?e(t):e}function bf(t){var e=Er(),r=e.queue;if(r===null)throw Error(D(311));r.lastRenderedReducer=t;var n=st,s=n.baseQueue,i=r.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}n.baseQueue=s=i,r.pending=null}if(s!==null){i=s.next,n=n.baseState;var a=o=null,l=null,u=i;do{var c=u.lane;if((ji&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:t(n,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=d,o=n):l=l.next=d,He.lanes|=c,Ni|=c}u=u.next}while(u!==null&&u!==i);l===null?o=n:l.next=a,qr(n,e.memoizedState)||(Kt=!0),e.memoizedState=n,e.baseState=o,e.baseQueue=l,r.lastRenderedState=n}if(t=r.interleaved,t!==null){s=t;do i=s.lane,He.lanes|=i,Ni|=i,s=s.next;while(s!==t)}else s===null&&(r.lanes=0);return[e.memoizedState,r.dispatch]}function xf(t){var e=Er(),r=e.queue;if(r===null)throw Error(D(311));r.lastRenderedReducer=t;var n=r.dispatch,s=r.pending,i=e.memoizedState;if(s!==null){r.pending=null;var o=s=s.next;do i=t(i,o.action),o=o.next;while(o!==s);qr(i,e.memoizedState)||(Kt=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),r.lastRenderedState=i}return[i,n]}function _k(){}function wk(t,e){var r=He,n=Er(),s=e(),i=!qr(n.memoizedState,s);if(i&&(n.memoizedState=s,Kt=!0),n=n.queue,Cv(kk.bind(null,r,n,t),[t]),n.getSnapshot!==e||i||lt!==null&&lt.memoizedState.tag&1){if(r.flags|=2048,eu(9,xk.bind(null,r,n,s,e),void 0,null),ut===null)throw Error(D(349));ji&30||bk(r,e,s)}return s}function bk(t,e,r){t.flags|=16384,t={getSnapshot:e,value:r},e=He.updateQueue,e===null?(e={lastEffect:null,stores:null},He.updateQueue=e,e.stores=[t]):(r=e.stores,r===null?e.stores=[t]:r.push(t))}function xk(t,e,r,n){e.value=r,e.getSnapshot=n,Sk(e)&&Ek(t)}function kk(t,e,r){return r(function(){Sk(e)&&Ek(t)})}function Sk(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!qr(t,r)}catch{return!0}}function Ek(t){var e=qn(t,1);e!==null&&Wr(e,t,1,-1)}function j_(t){var e=rn();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Zl,lastRenderedState:t},e.queue=t,t=t.dispatch=pA.bind(null,He,t),[e.memoizedState,t]}function eu(t,e,r,n){return t={tag:t,create:e,destroy:r,deps:n,next:null},e=He.updateQueue,e===null?(e={lastEffect:null,stores:null},He.updateQueue=e,e.lastEffect=t.next=t):(r=e.lastEffect,r===null?e.lastEffect=t.next=t:(n=r.next,r.next=t,t.next=n,e.lastEffect=t)),t}function Ck(){return Er().memoizedState}function Mc(t,e,r,n){var s=rn();He.flags|=t,s.memoizedState=eu(1|e,r,void 0,n===void 0?null:n)}function bh(t,e,r,n){var s=Er();n=n===void 0?null:n;var i=void 0;if(st!==null){var o=st.memoizedState;if(i=o.destroy,n!==null&&kv(n,o.deps)){s.memoizedState=eu(e,r,i,n);return}}He.flags|=t,s.memoizedState=eu(1|e,r,i,n)}function N_(t,e){return Mc(8390656,8,t,e)}function Cv(t,e){return bh(2048,8,t,e)}function Tk(t,e){return bh(4,2,t,e)}function Pk(t,e){return bh(4,4,t,e)}function Rk(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function Ak(t,e,r){return r=r!=null?r.concat([t]):null,bh(4,4,Rk.bind(null,e,t),r)}function Tv(){}function Ok(t,e){var r=Er();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&kv(e,n[1])?n[0]:(r.memoizedState=[t,e],t)}function jk(t,e){var r=Er();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&kv(e,n[1])?n[0]:(t=t(),r.memoizedState=[t,e],t)}function Nk(t,e,r){return ji&21?(qr(r,e)||(r=Dx(),He.lanes|=r,Ni|=r,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,Kt=!0),t.memoizedState=r)}function hA(t,e){var r=we;we=r!==0&&4>r?r:4,t(!0);var n=wf.transition;wf.transition={};try{t(!1),e()}finally{we=r,wf.transition=n}}function Ik(){return Er().memoizedState}function fA(t,e,r){var n=Is(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},$k(t))Lk(e,r);else if(r=mk(t,e,r,n),r!==null){var s=Lt();Wr(r,t,n,s),Mk(r,e,n)}}function pA(t,e,r){var n=Is(t),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if($k(t))Lk(e,s);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var o=e.lastRenderedState,a=i(o,r);if(s.hasEagerState=!0,s.eagerState=a,qr(a,o)){var l=e.interleaved;l===null?(s.next=s,yv(e)):(s.next=l.next,l.next=s),e.interleaved=s;return}}catch{}finally{}r=mk(t,e,s,n),r!==null&&(s=Lt(),Wr(r,t,n,s),Mk(r,e,n))}}function $k(t){var e=t.alternate;return t===He||e!==null&&e===He}function Lk(t,e){Cl=vd=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function Mk(t,e,r){if(r&4194240){var n=e.lanes;
vendor: 11,458 bytes, lines 39-41
39n&=t.pendingLanes,r|=n,e.lanes=r,sv(t,r)}}var yd={readContext:Sr,useCallback:_t,useContext:_t,useEffect:_t,useImperativeHandle:_t,useInsertionEffect:_t,useLayoutEffect:_t,useMemo:_t,useReducer:_t,useRef:_t,useState:_t,useDebugValue:_t,useDeferredValue:_t,useTransition:_t,useMutableSource:_t,useSyncExternalStore:_t,useId:_t,unstable_isNewReconciler:!1},gA={readContext:Sr,useCallback:function(t,e){return rn().memoizedState=[t,e===void 0?null:e],t},useContext:Sr,useEffect:N_,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,Mc(4194308,4,Rk.bind(null,e,t),r)},useLayoutEffect:function(t,e){return Mc(4194308,4,t,e)},useInsertionEffect:function(t,e){return Mc(4,2,t,e)},useMemo:function(t,e){var r=rn();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=rn();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=fA.bind(null,He,t),[n.memoizedState,t]},useRef:function(t){var e=rn();return t={current:t},e.memoizedState=t},useState:j_,useDebugValue:Tv,useDeferredValue:function(t){return rn().memoizedState=t},useTransition:function(){var t=j_(!1),e=t[0];return t=hA.bind(null,t[1]),rn().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=He,s=rn();if(Be){if(r===void 0)throw Error(D(407));r=r()}else{if(r=e(),ut===null)throw Error(D(349));ji&30||bk(n,e,r)}s.memoizedState=r;var i={value:r,getSnapshot:e};return s.queue=i,N_(kk.bind(null,n,i,t),[t]),n.flags|=2048,eu(9,xk.bind(null,n,i,r,e),void 0,null),r},useId:function(){var t=rn(),e=ut.identifierPrefix;if(Be){var r=Fn,n=Dn;r=(n&~(1<<32-Hr(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=Xl++,0<r&&(e+="H"+r.toString(32)),e+=":"}else r=dA++,e=":"+e+"r"+r.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},mA={readContext:Sr,useCallback:Ok,useContext:Sr,useEffect:Cv,useImperativeHandle:Ak,useInsertionEffect:Tk,useLayoutEffect:Pk,useMemo:jk,useReducer:bf,useRef:Ck,useState:function(){return bf(Zl)},useDebugValue:Tv,useDeferredValue:function(t){var e=Er();return Nk(e,st.memoizedState,t)},useTransition:function(){var t=bf(Zl)[0],e=Er().memoizedState;return[t,e]},useMutableSource:_k,useSyncExternalStore:wk,useId:Ik,unstable_isNewReconciler:!1},vA={readContext:Sr,useCallback:Ok,useContext:Sr,useEffect:Cv,useImperativeHandle:Ak,useInsertionEffect:Tk,useLayoutEffect:Pk,useMemo:jk,useReducer:xf,useRef:Ck,useState:function(){return xf(Zl)},useDebugValue:Tv,useDeferredValue:function(t){var e=Er();return st===null?e.memoizedState=t:Nk(e,st.memoizedState,t)},useTransition:function(){var t=xf(Zl)[0],e=Er().memoizedState;return[t,e]},useMutableSource:_k,useSyncExternalStore:wk,useId:Ik,unstable_isNewReconciler:!1};function $r(t,e){if(t&&t.defaultProps){e=We({},e),t=t.defaultProps;for(var r in t)e[r]===void 0&&(e[r]=t[r]);return e}return e}function Yp(t,e,r,n){e=t.memoizedState,r=r(n,e),r=r==null?e:We({},e,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var xh={isMounted:function(t){return(t=t._reactInternals)?Ui(t)===t:!1},enqueueSetState:function(t,e,r){t=t._reactInternals;var n=Lt(),s=Is(t),i=Bn(n,s);i.payload=e,r!=null&&(i.callback=r),e=js(t,i,s),e!==null&&(Wr(e,t,s,n),$c(e,t,s))},enqueueReplaceState:function(t,e,r){t=t._reactInternals;var n=Lt(),s=Is(t),i=Bn(n,s);i.tag=1,i.payload=e,r!=null&&(i.callback=r),e=js(t,i,s),e!==null&&(Wr(e,t,s,n),$c(e,t,s))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var r=Lt(),n=Is(t),s=Bn(r,n);s.tag=2,e!=null&&(s.callback=e),e=js(t,s,n),e!==null&&(Wr(e,t,n,r),$c(e,t,n))}};function I_(t,e,r,n,s,i,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(n,i,o):e.prototype&&e.prototype.isPureReactComponent?!Vl(r,n)||!Vl(s,i):!0}function Dk(t,e,r){var n=!1,s=Fs,i=e.contextType;return typeof i=="object"&&i!==null?i=Sr(i):(s=Jt(e)?Ai:Et.current,n=e.contextTypes,i=(n=n!=null)?ia(t,s):Fs),e=new e(r,i),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=xh,t.stateNode=e,e._reactInternals=t,n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=s,t.__reactInternalMemoizedMaskedChildContext=i),e}function $_(t,e,r,n){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(r,n),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(r,n),e.state!==t&&xh.enqueueReplaceState(e,e.state,null)}function Jp(t,e,r,n){var s=t.stateNode;s.props=r,s.state=t.memoizedState,s.refs={},_v(t);var i=e.contextType;typeof i=="object"&&i!==null?s.context=Sr(i):(i=Jt(e)?Ai:Et.current,s.context=ia(t,i)),s.state=t.memoizedState,i=e.getDerivedStateFromProps,typeof i=="function"&&(Yp(t,e,i,r),s.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(e=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),e!==s.state&&xh.enqueueReplaceState(s,s.state,null),gd(t,r,s,n),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308)}function ua(t,e){try{var r="",n=e;do r+=qP(n),n=n.return;while(n);var s=r}catch(i){s=`
40Error generating stack: `+i.message+`
41`+i.stack}return{value:t,source:e,stack:s,digest:null}}function kf(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function Qp(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var yA=typeof WeakMap=="function"?WeakMap:Map;function Fk(t,e,r){r=Bn(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){wd||(wd=!0,ag=n),Qp(t,e)},r}function Uk(t,e,r){r=Bn(-1,r),r.tag=3;var n=t.type.getDerivedStateFromError;if(typeof n=="function"){var s=e.value;r.payload=function(){return n(s)},r.callback=function(){Qp(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){Qp(t,e),typeof n!="function"&&(Ns===null?Ns=new Set([this]):Ns.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),r}function L_(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new yA;var s=new Set;n.set(e,s)}else s=n.get(e),s===void 0&&(s=new Set,n.set(e,s));s.has(r)||(s.add(r),t=jA.bind(null,t,e,r),e.then(t,t))}function M_(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function D_(t,e,r,n,s){return t.mode&1?(t.flags|=65536,t.lanes=s,t):(t===e?t.flags|=65536:(t.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(e=Bn(-1,1),e.tag=2,js(r,e,1))),r.lanes|=1),t)}var _A=Jn.ReactCurrentOwner,Kt=!1;function Ot(t,e,r,n){e.child=t===null?gk(e,null,r,n):aa(e,t.child,r,n)}function F_(t,e,r,n,s){r=r.render;var i=e.ref;return Do(e,s),n=Sv(t,e,r,n,i,s),r=Ev(),t!==null&&!Kt?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,Vn(t,e,s)):(Be&&r&&hv(e),e.flags|=1,Ot(t,e,n,s),e.child)}function U_(t,e,r,n,s){if(t===null){var i=r.type;return typeof i=="function"&&!$v(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=i,Bk(t,e,i,n,s)):(t=Bc(r.type,null,n,e,e.mode,s),t.ref=e.ref,t.return=e,e.child=t)}if(i=t.child,!(t.lanes&s)){var o=i.memoizedProps;if(r=r.compare,r=r!==null?r:Vl,r(o,n)&&t.ref===e.ref)return Vn(t,e,s)}return e.flags|=1,t=$s(i,n),t.ref=e.ref,t.return=e,e.child=t}function Bk(t,e,r,n,s){if(t!==null){var i=t.memoizedProps;if(Vl(i,n)&&t.ref===e.ref)if(Kt=!1,e.pendingProps=n=i,(t.lanes&s)!==0)t.flags&131072&&(Kt=!0);else return e.lanes=t.lanes,Vn(t,e,s)}return Xp(t,e,r,n,s)}function zk(t,e,r){var n=e.pendingProps,s=n.children,i=t!==null?t.memoizedState:null;if(n.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Re(Ro,tr),tr|=r;else{if(!(r&1073741824))return t=i!==null?i.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,Re(Ro,tr),tr|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,Re(Ro,tr),tr|=n}else i!==null?(n=i.baseLanes|r,e.memoizedState=null):n=r,Re(Ro,tr),tr|=n;return Ot(t,e,s,r),e.child}function Hk(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function Xp(t,e,r,n,s){var i=Jt(r)?Ai:Et.current;return i=ia(e,i),Do(e,s),r=Sv(t,e,r,n,i,s),n=Ev(),t!==null&&!Kt?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,Vn(t,e,s)):(Be&&n&&hv(e),e.flags|=1,Ot(t,e,r,s),e.child)}function B_(t,e,r,n,s){if(Jt(r)){var i=!0;cd(e)}else i=!1;if(Do(e,s),e.stateNode===null)Dc(t,e),Dk(e,r,n),Jp(e,r,n,s),n=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,u=r.contextType;typeof u=="object"&&u!==null?u=Sr(u):(u=Jt(r)?Ai:Et.current,u=ia(e,u));var c=r.getDerivedStateFromProps,d=typeof c=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==n||l!==u)&&$_(e,o,n,u),us=!1;var h=e.memoizedState;o.state=h,gd(e,n,o,s),l=e.memoizedState,a!==n||h!==l||Yt.current||us?(typeof c=="function"&&(Yp(e,r,c,n),l=e.memoizedState),(a=us||I_(e,r,a,n,h,l,u))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=l),o.props=n,o.state=l,o.context=u,n=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{o=e.stateNode,vk(t,e),a=e.memoizedProps,u=e.type===e.elementType?a:$r(e.type,a),o.props=u,d=e.pendingProps,h=o.context,l=r.contextType,typeof l=="object"&&l!==null?l=Sr(l):(l=Jt(r)?Ai:Et.current,l=ia(e,l));var f=r.getDerivedStateFromProps;(c=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||h!==l)&&$_(e,o,n,l),us=!1,h=e.memoizedState,o.state=h,gd(e,n,o,s);var g=e.memoizedState;a!==d||h!==g||Yt.current||us?(typeof f=="function"&&(Yp(e,r,f,n),g=e.memoizedState),(u=us||I_(e,r,u,n,h,g,l)||!1)?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,g,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,g,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=g),o.props=n,o.state=g,o.context=l,n=u):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),n=!1)}return Zp(t,e,r,n,i,s)}function Zp(t,e,r,n,s,i){Hk(t,e);var o=(e.flags&128)!==0;
vendor: 5,033 bytes, line 41
41if(!n&&!o)return s&&C_(e,r,!1),Vn(t,e,i);n=e.stateNode,_A.current=e;var a=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&o?(e.child=aa(e,t.child,null,i),e.child=aa(e,null,a,i)):Ot(t,e,a,i),e.memoizedState=n.state,s&&C_(e,r,!0),e.child}function Wk(t){var e=t.stateNode;e.pendingContext?E_(t,e.pendingContext,e.pendingContext!==e.context):e.context&&E_(t,e.context,!1),wv(t,e.containerInfo)}function z_(t,e,r,n,s){return oa(),pv(s),e.flags|=256,Ot(t,e,r,n),e.child}var eg={dehydrated:null,treeContext:null,retryLane:0};function tg(t){return{baseLanes:t,cachePool:null,transitions:null}}function qk(t,e,r){var n=e.pendingProps,s=ze.current,i=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(s&2)!==0),a?(i=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(s|=1),Re(ze,s&1),t===null)return Kp(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=n.children,t=n.fallback,i?(n=e.mode,i=e.child,o={mode:"hidden",children:o},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=Eh(o,n,0,null),t=Ti(t,n,r,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=tg(r),e.memoizedState=eg,t):Pv(e,o));if(s=t.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return wA(t,e,o,n,a,s,r);if(i){i=n.fallback,o=e.mode,s=t.child,a=s.sibling;var l={mode:"hidden",children:n.children};return!(o&1)&&e.child!==s?(n=e.child,n.childLanes=0,n.pendingProps=l,e.deletions=null):(n=$s(s,l),n.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=$s(a,i):(i=Ti(i,o,r,null),i.flags|=2),i.return=e,n.return=e,n.sibling=i,e.child=n,n=i,i=e.child,o=t.child.memoizedState,o=o===null?tg(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=t.childLanes&~r,e.memoizedState=eg,n}return i=t.child,t=i.sibling,n=$s(i,{mode:"visible",children:n.children}),!(e.mode&1)&&(n.lanes=r),n.return=e,n.sibling=null,t!==null&&(r=e.deletions,r===null?(e.deletions=[t],e.flags|=16):r.push(t)),e.child=n,e.memoizedState=null,n}function Pv(t,e){return e=Eh({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Zu(t,e,r,n){return n!==null&&pv(n),aa(e,t.child,null,r),t=Pv(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function wA(t,e,r,n,s,i,o){if(r)return e.flags&256?(e.flags&=-257,n=kf(Error(D(422))),Zu(t,e,o,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=n.fallback,s=e.mode,n=Eh({mode:"visible",children:n.children},s,0,null),i=Ti(i,s,o,null),i.flags|=2,n.return=e,i.return=e,n.sibling=i,e.child=n,e.mode&1&&aa(e,t.child,null,o),e.child.memoizedState=tg(o),e.memoizedState=eg,i);if(!(e.mode&1))return Zu(t,e,o,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var a=n.dgst;return n=a,i=Error(D(419)),n=kf(i,n,void 0),Zu(t,e,o,n)}if(a=(o&t.childLanes)!==0,Kt||a){if(n=ut,n!==null){switch(o&-o){case 4:s=2;break;case 16:s=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(n.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,qn(t,s),Wr(n,t,s,-1))}return Iv(),n=kf(Error(D(421))),Zu(t,e,o,n)}return s.data==="$?"?(e.flags|=128,e.child=t.child,e=NA.bind(null,t),s._reactRetry=e,null):(t=i.treeContext,sr=Os(s.nextSibling),or=e,Be=!0,Ur=null,t!==null&&(vr[yr++]=Dn,vr[yr++]=Fn,vr[yr++]=Oi,Dn=t.id,Fn=t.overflow,Oi=e),e=Pv(e,n.children),e.flags|=4096,e)}function H_(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),Gp(t.return,e,r)}function Sf(t,e,r,n,s){var i=t.memoizedState;i===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=s)}function Vk(t,e,r){var n=e.pendingProps,s=n.revealOrder,i=n.tail;if(Ot(t,e,n.children,r),n=ze.current,n&2)n=n&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&H_(t,r,e);else if(t.tag===19)H_(t,r,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}if(Re(ze,n),!(e.mode&1))e.memoizedState=null;else switch(s){case"forwards":for(r=e.child,s=null;r!==null;)t=r.alternate,t!==null&&md(t)===null&&(s=r),r=r.sibling;r=s,r===null?(s=e.child,e.child=null):(s=r.sibling,r.sibling=null),Sf(e,!1,s,r,i);break;case"backwards":for(r=null,s=e.child,e.child=null;s!==null;){if(t=s.alternate,t!==null&&md(t)===null){e.child=s;break}t=s.sibling,s.sibling=r,r=s,s=t}Sf(e,!0,r,null,i);break;case"together":Sf(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Dc(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}
vendor: 4,903 bytes, line 41
41function Vn(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),Ni|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(D(153));if(e.child!==null){for(t=e.child,r=$s(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=$s(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function bA(t,e,r){switch(e.tag){case 3:Wk(e),oa();break;case 5:yk(e);break;case 1:Jt(e.type)&&cd(e);break;case 4:wv(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,s=e.memoizedProps.value;Re(fd,n._currentValue),n._currentValue=s;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(Re(ze,ze.current&1),e.flags|=128,null):r&e.child.childLanes?qk(t,e,r):(Re(ze,ze.current&1),t=Vn(t,e,r),t!==null?t.sibling:null);Re(ze,ze.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&128){if(n)return Vk(t,e,r);e.flags|=128}if(s=e.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Re(ze,ze.current),n)break;return null;case 22:case 23:return e.lanes=0,zk(t,e,r)}return Vn(t,e,r)}var Kk,rg,Gk,Yk;Kk=function(t,e){for(var r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};rg=function(){};Gk=function(t,e,r,n){var s=t.memoizedProps;if(s!==n){t=e.stateNode,pi(gn.current);var i=null;switch(r){case"input":s=Sp(t,s),n=Sp(t,n),i=[];break;case"select":s=We({},s,{value:void 0}),n=We({},n,{value:void 0}),i=[];break;case"textarea":s=Tp(t,s),n=Tp(t,n),i=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=ld)}Rp(r,n);var o;r=null;for(u in s)if(!n.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var a=s[u];for(o in a)a.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Fl.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in n){var l=n[u];if(a=s!=null?s[u]:void 0,n.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(r||(r={}),r[o]=l[o])}else r||(i||(i=[]),i.push(u,r)),r=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Fl.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Oe("scroll",t),i||a===l||(i=[])):(i=i||[]).push(u,l))}r&&(i=i||[]).push("style",r);var u=i;(e.updateQueue=u)&&(e.flags|=4)}};Yk=function(t,e,r,n){r!==n&&(e.flags|=4)};function Wa(t,e){if(!Be)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;e!==null;)e.alternate!==null&&(r=e),e=e.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null}}function wt(t){var e=t.alternate!==null&&t.alternate.child===t.child,r=0,n=0;if(e)for(var s=t.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=t,s=s.sibling;else for(s=t.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=t,s=s.sibling;return t.subtreeFlags|=n,t.childLanes=r,e}function xA(t,e,r){var n=e.pendingProps;switch(fv(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wt(e),null;case 1:return Jt(e.type)&&ud(),wt(e),null;case 3:return n=e.stateNode,la(),Ie(Yt),Ie(Et),xv(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(Qu(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Ur!==null&&(cg(Ur),Ur=null))),rg(t,e),wt(e),null;case 5:bv(e);var s=pi(Ql.current);if(r=e.type,t!==null&&e.stateNode!=null)Gk(t,e,r,n,s),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(D(166));return wt(e),null}if(t=pi(gn.current),Qu(e)){n=e.stateNode,r=e.type;var i=e.memoizedProps;switch(n[un]=e,n[Yl]=i,t=(e.mode&1)!==0,r){case"dialog":Oe("cancel",n),Oe("close",n);break;case"iframe":case"object":case"embed":Oe("load",n);break;case"video":case"audio":for(s=0;s<ul.length;s++)Oe(ul[s],n);break;case"source":Oe("error",n);break;case"img":case"image":case"link":Oe("error",n),Oe("load",n);break;case"details":Oe("toggle",n);break;case"input":Xy(n,i),Oe("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},Oe("invalid",n);break;case"textarea":e_(n,i),Oe("invalid",n)}Rp(r,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];
vendor: 27,825 bytes, line 41
41o==="children"?typeof a=="string"?n.textContent!==a&&(i.suppressHydrationWarning!==!0&&Ju(n.textContent,a,t),s=["children",a]):typeof a=="number"&&n.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Ju(n.textContent,a,t),s=["children",""+a]):Fl.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Oe("scroll",n)}switch(r){case"input":zu(n),Zy(n,i,!0);break;case"textarea":zu(n),t_(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=ld)}n=s,e.updateQueue=n,n!==null&&(e.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=kx(r)),t==="http://www.w3.org/1999/xhtml"?r==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=o.createElement(r,{is:n.is}):(t=o.createElement(r),r==="select"&&(o=t,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):t=o.createElementNS(t,r),t[un]=e,t[Yl]=n,Kk(t,e,!1,!1),e.stateNode=t;e:{switch(o=Ap(r,n),r){case"dialog":Oe("cancel",t),Oe("close",t),s=n;break;case"iframe":case"object":case"embed":Oe("load",t),s=n;break;case"video":case"audio":for(s=0;s<ul.length;s++)Oe(ul[s],t);s=n;break;case"source":Oe("error",t),s=n;break;case"img":case"image":case"link":Oe("error",t),Oe("load",t),s=n;break;case"details":Oe("toggle",t),s=n;break;case"input":Xy(t,n),s=Sp(t,n),Oe("invalid",t);break;case"option":s=n;break;case"select":t._wrapperState={wasMultiple:!!n.multiple},s=We({},n,{value:void 0}),Oe("invalid",t);break;case"textarea":e_(t,n),s=Tp(t,n),Oe("invalid",t);break;default:s=n}Rp(r,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?Cx(t,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Sx(t,l)):i==="children"?typeof l=="string"?(r!=="textarea"||l!=="")&&Ul(t,l):typeof l=="number"&&Ul(t,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Fl.hasOwnProperty(i)?l!=null&&i==="onScroll"&&Oe("scroll",t):l!=null&&Xm(t,i,l,o))}switch(r){case"input":zu(t),Zy(t,n,!1);break;case"textarea":zu(t),t_(t);break;case"option":n.value!=null&&t.setAttribute("value",""+Ds(n.value));break;case"select":t.multiple=!!n.multiple,i=n.value,i!=null?Io(t,!!n.multiple,i,!1):n.defaultValue!=null&&Io(t,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(t.onclick=ld)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return wt(e),null;case 6:if(t&&e.stateNode!=null)Yk(t,e,t.memoizedProps,n);else{if(typeof n!="string"&&e.stateNode===null)throw Error(D(166));if(r=pi(Ql.current),pi(gn.current),Qu(e)){if(n=e.stateNode,r=e.memoizedProps,n[un]=e,(i=n.nodeValue!==r)&&(t=or,t!==null))switch(t.tag){case 3:Ju(n.nodeValue,r,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Ju(n.nodeValue,r,(t.mode&1)!==0)}i&&(e.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[un]=e,e.stateNode=n}return wt(e),null;case 13:if(Ie(ze),n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Be&&sr!==null&&e.mode&1&&!(e.flags&128))fk(),oa(),e.flags|=98560,i=!1;else if(i=Qu(e),n!==null&&n.dehydrated!==null){if(t===null){if(!i)throw Error(D(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(D(317));i[un]=e}else oa(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;wt(e),i=!1}else Ur!==null&&(cg(Ur),Ur=null),i=!0;if(!i)return e.flags&65536?e:null}return e.flags&128?(e.lanes=r,e):(n=n!==null,n!==(t!==null&&t.memoizedState!==null)&&n&&(e.child.flags|=8192,e.mode&1&&(t===null||ze.current&1?ot===0&&(ot=3):Iv())),e.updateQueue!==null&&(e.flags|=4),wt(e),null);case 4:return la(),rg(t,e),t===null&&Kl(e.stateNode.containerInfo),wt(e),null;case 10:return vv(e.type._context),wt(e),null;case 17:return Jt(e.type)&&ud(),wt(e),null;case 19:if(Ie(ze),i=e.memoizedState,i===null)return wt(e),null;if(n=(e.flags&128)!==0,o=i.rendering,o===null)if(n)Wa(i,!1);else{if(ot!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=md(t),o!==null){for(e.flags|=128,Wa(i,!1),n=o.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),e.subtreeFlags=0,n=r,r=e.child;r!==null;)i=r,t=n,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=t,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,t=o.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),r=r.sibling;return Re(ze,ze.current&1|2),e.child}t=t.sibling}i.tail!==null&&Ze()>ca&&(e.flags|=128,n=!0,Wa(i,!1),e.lanes=4194304)}else{if(!n)if(t=md(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),Wa(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Be)return wt(e),null}else 2*Ze()-i.renderingStartTime>ca&&r!==1073741824&&(e.flags|=128,n=!0,Wa(i,!1),e.lanes=4194304);i.isBackwards?(o.sibling=e.child,e.child=o):(r=i.last,r!==null?r.sibling=o:e.child=o,i.last=o)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Ze(),e.sibling=null,r=ze.current,Re(ze,n?r&1|2:r&1),e):(wt(e),null);case 22:case 23:return Nv(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?tr&1073741824&&(wt(e),e.subtreeFlags&6&&(e.flags|=8192)):wt(e),null;case 24:return null;case 25:return null}throw Error(D(156,e.tag))}function kA(t,e){switch(fv(e),e.tag){case 1:return Jt(e.type)&&ud(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return la(),Ie(Yt),Ie(Et),xv(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return bv(e),null;case 13:if(Ie(ze),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(D(340));oa()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Ie(ze),null;case 4:return la(),null;case 10:return vv(e.type._context),null;case 22:case 23:return Nv(),null;case 24:return null;default:return null}}var ec=!1,kt=!1,SA=typeof WeakSet=="function"?WeakSet:Set,Y=null;function Po(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Ge(t,e,n)}else r.current=null}function ng(t,e,r){try{r()}catch(n){Ge(t,e,n)}}var W_=!1;function EA(t,e){if(Up=id,t=ek(),dv(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var o=0,a=-1,l=-1,u=0,c=0,d=t,h=null;t:for(;;){for(var f;d!==r||s!==0&&d.nodeType!==3||(a=o+s),d!==i||n!==0&&d.nodeType!==3||(l=o+n),d.nodeType===3&&(o+=d.nodeValue.length),(f=d.firstChild)!==null;)h=d,d=f;for(;;){if(d===t)break t;if(h===r&&++u===s&&(a=o),h===i&&++c===n&&(l=o),(f=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=f}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(Bp={focusedElem:t,selectionRange:r},id=!1,Y=e;Y!==null;)if(e=Y,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Y=t;else for(;Y!==null;){e=Y;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var p=g.memoizedProps,b=g.memoizedState,v=e.stateNode,y=v.getSnapshotBeforeUpdate(e.elementType===e.type?p:$r(e.type,p),b);v.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var _=e.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(D(163))}}catch(x){Ge(e,e.return,x)}if(t=e.sibling,t!==null){t.return=e.return,Y=t;break}Y=e.return}return g=W_,W_=!1,g}function Tl(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&t)===t){var i=s.destroy;s.destroy=void 0,i!==void 0&&ng(e,r,i)}s=s.next}while(s!==n)}}function kh(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function sg(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function Jk(t){var e=t.alternate;e!==null&&(t.alternate=null,Jk(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[un],delete e[Yl],delete e[Wp],delete e[aA],delete e[lA])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Qk(t){return t.tag===5||t.tag===3||t.tag===4}function q_(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Qk(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function ig(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=ld));else if(n!==4&&(t=t.child,t!==null))for(ig(t,e,r),t=t.sibling;t!==null;)ig(t,e,r),t=t.sibling}function og(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(og(t,e,r),t=t.sibling;t!==null;)og(t,e,r),t=t.sibling}var ht=null,Fr=!1;function ns(t,e,r){for(r=r.child;r!==null;)Xk(t,e,r),r=r.sibling}function Xk(t,e,r){if(pn&&typeof pn.onCommitFiberUnmount=="function")try{pn.onCommitFiberUnmount(gh,r)}catch{}switch(r.tag){case 5:kt||Po(r,e);case 6:var n=ht,s=Fr;ht=null,ns(t,e,r),ht=n,Fr=s,ht!==null&&(Fr?(t=ht,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):ht.removeChild(r.stateNode));break;case 18:ht!==null&&(Fr?(t=ht,r=r.stateNode,t.nodeType===8?vf(t.parentNode,r):t.nodeType===1&&vf(t,r),Wl(t)):vf(ht,r.stateNode));break;case 4:n=ht,s=Fr,ht=r.stateNode.containerInfo,Fr=!0,ns(t,e,r),ht=n,Fr=s;break;case 0:case 11:case 14:case 15:if(!kt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&ng(r,e,o),s=s.next}while(s!==n)}ns(t,e,r);break;case 1:if(!kt&&(Po(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){Ge(r,e,a)}ns(t,e,r);break;case 21:ns(t,e,r);break;case 22:r.mode&1?(kt=(n=kt)||r.memoizedState!==null,ns(t,e,r),kt=n):ns(t,e,r);break;default:ns(t,e,r)}}function V_(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new SA),e.forEach(function(n){var s=IA.bind(null,t,n);r.has(n)||(r.add(n),n.then(s,s))})}}function Ar(t,e){var r=e.deletions;if(r!==null)for(var n=0;n<r.length;n++){var s=r[n];try{var i=t,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:ht=a.stateNode,Fr=!1;break e;case 3:ht=a.stateNode.containerInfo,Fr=!0;break e;case 4:ht=a.stateNode.containerInfo,Fr=!0;break e}a=a.return}if(ht===null)throw Error(D(160));Xk(i,o,s),ht=null,Fr=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(u){Ge(s,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)Zk(e,t),e=e.sibling}function Zk(t,e){var r=t.alternate,n=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Ar(e,t),Zr(t),n&4){try{Tl(3,t,t.return),kh(3,t)}catch(p){Ge(t,t.return,p)}try{Tl(5,t,t.return)}catch(p){Ge(t,t.return,p)}}break;case 1:Ar(e,t),Zr(t),n&512&&r!==null&&Po(r,r.return);break;case 5:if(Ar(e,t),Zr(t),n&512&&r!==null&&Po(r,r.return),t.flags&32){var s=t.stateNode;try{Ul(s,"")}catch(p){Ge(t,t.return,p)}}if(n&4&&(s=t.stateNode,s!=null)){var i=t.memoizedProps,o=r!==null?r.memoizedProps:i,a=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&bx(s,i),Ap(a,o);var u=Ap(a,i);for(o=0;o<l.length;o+=2){var c=l[o],d=l[o+1];c==="style"?Cx(s,d):c==="dangerouslySetInnerHTML"?Sx(s,d):c==="children"?Ul(s,d):Xm(s,c,d,u)}switch(a){case"input":Ep(s,i);break;case"textarea":xx(s,i);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var f=i.value;f!=null?Io(s,!!i.multiple,f,!1):h!==!!i.multiple&&(i.defaultValue!=null?Io(s,!!i.multiple,i.defaultValue,!0):Io(s,!!i.multiple,i.multiple?[]:"",!1))}s[Yl]=i}catch(p){Ge(t,t.return,p)}}break;case 6:if(Ar(e,t),Zr(t),n&4){if(t.stateNode===null)throw Error(D(162));s=t.stateNode,i=t.memoizedProps;try{s.nodeValue=i}catch(p){Ge(t,t.return,p)}}break;case 3:if(Ar(e,t),Zr(t),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Wl(e.containerInfo)}catch(p){Ge(t,t.return,p)}break;case 4:Ar(e,t),Zr(t);break;case 13:Ar(e,t),Zr(t),s=t.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(Ov=Ze())),n&4&&V_(t);break;case 22:if(c=r!==null&&r.memoizedState!==null,t.mode&1?(kt=(u=kt)||c,Ar(e,t),kt=u):Ar(e,t),Zr(t),n&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!c&&t.mode&1)for(Y=t,c=t.child;c!==null;){for(d=Y=c;Y!==null;){switch(h=Y,f=h.child,h.tag){case 0:case 11:case 14:case 15:Tl(4,h,h.return);break;case 1:Po(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){n=h,r=h.return;try{e=n,g.props=e.memoizedProps,g.state=e.memoizedState,g.componentWillUnmount()}catch(p){Ge(n,r,p)}}break;case 5:Po(h,h.return);break;case 22:if(h.memoizedState!==null){G_(d);continue}}f!==null?(f.return=h,Y=f):G_(d)}c=c.sibling}e:for(c=null,d=t;;){if(d.tag===5){if(c===null){c=d;try{s=d.stateNode,u?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=d.stateNode,l=d.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Ex("display",o))}catch(p){Ge(t,t.return,p)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(p){Ge(t,t.return,p)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===t)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Ar(e,t),Zr(t),n&4&&V_(t);break;case 21:break;default:Ar(e,t),Zr(t)}}function Zr(t){var e=t.flags;if(e&2){try{e:{for(var r=t.return;r!==null;){if(Qk(r)){var n=r;break e}r=r.return}throw Error(D(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(Ul(s,""),n.flags&=-33);var i=q_(t);og(t,i,s);break;case 3:case 4:var o=n.stateNode.containerInfo,a=q_(t);ig(t,a,o);break;default:throw Error(D(161))}}catch(l){Ge(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function CA(t,e,r){Y=t,eS(t)}function eS(t,e,r){for(var n=(t.mode&1)!==0;Y!==null;){var s=Y,i=s.child;if(s.tag===22&&n){var o=s.memoizedState!==null||ec;if(!o){var a=s.alternate,l=a!==null&&a.memoizedState!==null||kt;a=ec;var u=kt;if(ec=o,(kt=l)&&!u)for(Y=s;Y!==null;)o=Y,l=o.child,o.tag===22&&o.memoizedState!==null?Y_(s):l!==null?(l.return=o,Y=l):Y_(s);for(;i!==null;)Y=i,eS(i),i=i.sibling;Y=s,ec=a,kt=u}K_(t)}else s.subtreeFlags&8772&&i!==null?(i.return=s,Y=i):K_(t)}}function K_(t){for(;Y!==null;){var e=Y;if(e.flags&8772){var r=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:kt||kh(5,e);break;case 1:var n=e.stateNode;if(e.flags&4&&!kt)if(r===null)n.componentDidMount();else{var s=e.elementType===e.type?r.memoizedProps:$r(e.type,r.memoizedProps);n.componentDidUpdate(s,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=e.updateQueue;i!==null&&O_(e,i,n);break;case 3:var o=e.updateQueue;if(o!==null){if(r=null,e.child!==null)switch(e.child.tag){case 5:r=e.child.stateNode;break;case 1:r=e.child.stateNode}O_(e,o,r)}break;case 5:var a=e.stateNode;if(r===null&&e.flags&4){r=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&r.focus();break;case"img":l.src&&(r.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var u=e.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&Wl(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(D(163))}kt||e.flags&512&&sg(e)}catch(h){Ge(e,e.return,h)}}if(e===t){Y=null;break}if(r=e.sibling,r!==null){r.return=e.return,Y=r;break}Y=e.return}}function G_(t){for(;Y!==null;){var e=Y;if(e===t){Y=null;break}var r=e.sibling;if(r!==null){r.return=e.return,Y=r;break}Y=e.return}}function Y_(t){for(;Y!==null;){var e=Y;try{switch(e.tag){case 0:case 11:case 15:var r=e.return;try{kh(4,e)}catch(l){Ge(e,r,l)}break;case 1:var n=e.stateNode;if(typeof n.componentDidMount=="function"){var s=e.return;try{n.componentDidMount()}catch(l){Ge(e,s,l)}}var i=e.return;try{sg(e)}catch(l){Ge(e,i,l)}break;case 5:var o=e.return;try{sg(e)}catch(l){Ge(e,o,l)}}}catch(l){Ge(e,e.return,l)}if(e===t){Y=null;break}var a=e.sibling;if(a!==null){a.return=e.return,Y=a;break}Y=e.return}}var TA=Math.ceil,_d=Jn.ReactCurrentDispatcher,Rv=Jn.ReactCurrentOwner,br=Jn.ReactCurrentBatchConfig,ye=0,ut=null,nt=null,pt=0,tr=0,Ro=Vs(0),ot=0,tu=null,Ni=0,Sh=0,Av=0,Pl=null,Vt=null,Ov=0,ca=1/0,Pn=null,wd=!1,ag=null,Ns=null,tc=!1,Es=null,bd=0,Rl=0,lg=null,Fc=-1,Uc=0;function Lt(){return ye&6?Ze():Fc!==-1?Fc:Fc=Ze()}function Is(t){return t.mode&1?ye&2&&pt!==0?pt&-pt:cA.transition!==null?(Uc===0&&(Uc=Dx()),Uc):(t=we,t!==0||(t=window.event,t=t===void 0?16:qx(t.type)),t):1}function Wr(t,e,r,n){if(50<Rl)throw Rl=0,lg=null,Error(D(185));Ru(t,r,n),(!(ye&2)||t!==ut)&&(t===ut&&(!(ye&2)&&(Sh|=r),ot===4&&ds(t,pt)),Qt(t,n),r===1&&ye===0&&!(e.mode&1)&&(ca=Ze()+500,wh&&Ks()))}function Qt(t,e){var r=t.callbackNode;cR(t,e);var n=sd(t,t===ut?pt:0);if(n===0)r!==null&&s_(r),t.callbackNode=null,t.callbackPriority=0;else if(e=n&-n,t.callbackPriority!==e){if(r!=null&&s_(r),e===1)t.tag===0?uA(J_.bind(null,t)):ck(J_.bind(null,t)),iA(function(){!(ye&6)&&Ks()}),r=null;else{switch(Fx(n)){case 1:r=nv;break;case 4:r=Lx;break;case 16:r=nd;break;case 536870912:r=Mx;break;default:r=nd}r=lS(r,tS.bind(null,t))}t.callbackPriority=e,t.callbackNode=r}}function tS(t,e){if(Fc=-1,Uc=0,ye&6)throw Error(D(327));var r=t.callbackNode;if(Fo()&&t.callbackNode!==r)return null;var n=sd(t,t===ut?pt:0);if(n===0)return null;if(n&30||n&t.expiredLanes||e)e=xd(t,n);else{e=n;var s=ye;ye|=2;var i=nS();(ut!==t||pt!==e)&&(Pn=null,ca=Ze()+500,Ci(t,e));do try{AA();break}catch(a){rS(t,a)}while(!0);mv(),_d.current=i,ye=s,nt!==null?e=0:(ut=null,pt=0,e=ot)}if(e!==0){if(e===2&&(s=$p(t),s!==0&&(n=s,e=ug(t,s))),e===1)throw r=tu,Ci(t,0),ds(t,n),Qt(t,Ze()),r;if(e===6)ds(t,n);else{if(s=t.current.alternate,!(n&30)&&!PA(s)&&(e=xd(t,n),e===2&&(i=$p(t),i!==0&&(n=i,e=ug(t,i))),e===1))throw r=tu,Ci(t,0),ds(t,n),Qt(t,Ze()),r;switch(t.finishedWork=s,t.finishedLanes=n,e){case 0:case 1:throw Error(D(345));case 2:ii(t,Vt,Pn);break;case 3:if(ds(t,n),(n&130023424)===n&&(e=Ov+500-Ze(),10<e)){if(sd(t,0)!==0)break;if(s=t.suspendedLanes,(s&n)!==n){Lt(),t.pingedLanes|=t.suspendedLanes&s;break}t.timeoutHandle=Hp(ii.bind(null,t,Vt,Pn),e);break}ii(t,Vt,Pn);break;case 4:if(ds(t,n),(n&4194240)===n)break;for(e=t.eventTimes,s=-1;0<n;){var o=31-Hr(n);i=1<<o,o=e[o],o>s&&(s=o),n&=~i}if(n=s,n=Ze()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*TA(n/1960))-n,10<n){t.timeoutHandle=Hp(ii.bind(null,t,Vt,Pn),n);break}ii(t,Vt,Pn);break;case 5:ii(t,Vt,Pn);break;default:throw Error(D(329))}}}return Qt(t,Ze()),t.callbackNode===r?tS.bind(null,t):null}function ug(t,e){var r=Pl;return t.current.memoizedState.isDehydrated&&(Ci(t,e).flags|=256),t=xd(t,e),t!==2&&(e=Vt,Vt=r,e!==null&&cg(e)),t}function cg(t){Vt===null?Vt=t:Vt.push.apply(Vt,t)}function PA(t){for(var e=t;;){if(e.flags&16384){var r=e.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var s=r[n],i=s.getSnapshot;s=s.value;try{if(!qr(i(),s))return!1}catch{return!1}}}if(r=e.child,e.subtreeFlags&16384&&r!==null)r.return=e,e=r;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function ds(t,e){for(e&=~Av,e&=~Sh,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var r=31-Hr(e),n=1<<r;t[r]=-1,e&=~n}}function J_(t){if(ye&6)throw Error(D(327));Fo();var e=sd(t,0);if(!(e&1))return Qt(t,Ze()),null;var r=xd(t,e);if(t.tag!==0&&r===2){var n=$p(t);n!==0&&(e=n,r=ug(t,n))}if(r===1)throw r=tu,Ci(t,0),ds(t,e),Qt(t,Ze()),r;if(r===6)throw Error(D(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,ii(t,Vt,Pn),Qt(t,Ze()),null}function jv(t,e){var r=ye;ye|=1;try{return t(e)}finally{ye=r,ye===0&&(ca=Ze()+500,wh&&Ks())}}function Ii(t){Es!==null&&Es.tag===0&&!(ye&6)&&Fo();var e=ye;ye|=1;var r=br.transition,n=we;try{if(br.transition=null,we=1,t)return t()}finally{we=n,br.transition=r,ye=e,!(ye&6)&&Ks()}}function Nv(){tr=Ro.current,Ie(Ro)}function Ci(t,e){t.finishedWork=null,t.finishedLanes=0;var r=t.timeoutHandle;if(r!==-1&&(t.timeoutHandle=-1,sA(r)),nt!==null)for(r=nt.return;r!==null;){var n=r;switch(fv(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&ud();break;case 3:la(),Ie(Yt),Ie(Et),xv();break;case 5:bv(n);break;case 4:la();break;case 13:Ie(ze);break;case 19:Ie(ze);break;case 10:vv(n.type._context);break;case 22:case 23:Nv()}r=r.return}if(ut=t,nt=t=$s(t.current,null),pt=tr=e,ot=0,tu=null,Av=Sh=Ni=0,Vt=Pl=null,fi!==null){for(e=0;e<fi.length;e++)if(r=fi[e],n=r.interleaved,n!==null){r.interleaved=null;var s=n.next,i=r.pending;if(i!==null){var o=i.next;i.next=s,n.next=o}r.pending=n}fi=null}return t}function rS(t,e){do{var r=nt;try{if(mv(),Lc.current=yd,vd){for(var n=He.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}vd=!1}if(ji=0,lt=st=He=null,Cl=!1,Xl=0,Rv.current=null,r===null||r.return===null){ot=1,tu=e,nt=null;break}e:{var i=t,o=r.return,a=r,l=e;if(e=pt,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=a,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var h=c.alternate;h?(c.updateQueue=h.updateQueue,c.memoizedState=h.memoizedState,c.lanes=h.lanes):(c.updateQueue=null,c.memoizedState=null)}var f=M_(o);if(f!==null){f.flags&=-257,D_(f,o,a,i,e),f.mode&1&&L_(i,u,e),e=f,l=u;var g=e.updateQueue;if(g===null){var p=new Set;p.add(l),e.updateQueue=p}else g.add(l);break e}else{if(!(e&1)){L_(i,u,e),Iv();break e}l=Error(D(426))}}else if(Be&&a.mode&1){var b=M_(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),D_(b,o,a,i,e),pv(ua(l,a));break e}}i=l=ua(l,a),ot!==4&&(ot=2),Pl===null?Pl=[i]:Pl.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,e&=-e,i.lanes|=e;var v=Fk(i,l,e);A_(i,v);break e;case 1:a=l;var y=i.type,_=i.stateNode;if(!(i.flags&128)&&(typeof y.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(Ns===null||!Ns.has(_)))){i.flags|=65536,e&=-e,i.lanes|=e;var x=Uk(i,a,e);A_(i,x);break e}}i=i.return}while(i!==null)}iS(r)}catch(k){e=k,nt===r&&r!==null&&(nt=r=r.return);continue}break}while(!0)}function nS(){var t=_d.current;return _d.current=yd,t===null?yd:t}function Iv(){(ot===0||ot===3||ot===2)&&(ot=4),ut===null||!(Ni&268435455)&&!(Sh&268435455)||ds(ut,pt)}function xd(t,e){var r=ye;ye|=2;var n=nS();(ut!==t||pt!==e)&&(Pn=null,Ci(t,e));do try{RA();break}catch(s){rS(t,s)}while(!0);if(mv(),ye=r,_d.current=n,nt!==null)throw Error(D(261));return ut=null,pt=0,ot}function RA(){for(;nt!==null;)sS(nt)}function AA(){for(;nt!==null&&!tR();)sS(nt)}function sS(t){var e=aS(t.alternate,t,tr);t.memoizedProps=t.pendingProps,e===null?iS(t):nt=e,Rv.current=null}function iS(t){var e=t;do{var r=e.alternate;if(t=e.return,e.flags&32768){if(r=kA(r,e),r!==null){r.flags&=32767,nt=r;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{ot=6,nt=null;return}}else if(r=xA(r,e,tr),r!==null){nt=r;return}if(e=e.sibling,e!==null){nt=e;return}nt=e=t}while(e!==null);ot===0&&(ot=5)}function ii(t,e,r){var n=we,s=br.transition;try{br.transition=null,we=1,OA(t,e,r,n)}finally{br.transition=s,we=n}return null}function OA(t,e,r,n){do Fo();while(Es!==null);if(ye&6)throw Error(D(327));r=t.finishedWork;var s=t.finishedLanes;if(r===null)return null;if(t.finishedWork=null,t.finishedLanes=0,r===t.current)throw Error(D(177));t.callbackNode=null,t.callbackPriority=0;var i=r.lanes|r.childLanes;if(dR(t,i),t===ut&&(nt=ut=null,pt=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||tc||(tc=!0,lS(nd,function(){return Fo(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=br.transition,br.transition=null;var o=we;we=1;var a=ye;ye|=4,Rv.current=null,EA(t,r),Zk(r,t),QR(Bp),id=!!Up,Bp=Up=null,t.current=r,CA(r),rR(),ye=a,we=o,br.transition=i}else t.current=r;if(tc&&(tc=!1,Es=t,bd=s),i=t.pendingLanes,i===0&&(Ns=null),iR(r.stateNode),Qt(t,Ze()),e!==null)for(n=t.onRecoverableError,r=0;r<e.length;r++)s=e[r],n(s.value,{componentStack:s.stack,digest:s.digest});if(wd)throw wd=!1,t=ag,ag=null,t;return bd&1&&t.tag!==0&&Fo(),i=t.pendingLanes,i&1?t===lg?Rl++:(Rl=0,lg=t):Rl=0,Ks(),null}function Fo(){if(Es!==null){var t=Fx(bd),e=br.transition,r=we;try{if(br.transition=null,we=16>t?16:t,Es===null)var n=!1;else{if(t=Es,Es=null,bd=0,ye&6)throw Error(D(331));var s=ye;for(ye|=4,Y=t.current;Y!==null;){var i=Y,o=i.child;if(Y.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(Y=u;Y!==null;){var c=Y;switch(c.tag){case 0:case 11:case 15:Tl(8,c,i)}var d=c.child;if(d!==null)d.return=c,Y=d;else for(;Y!==null;){c=Y;var h=c.sibling,f=c.return;if(Jk(c),c===u){Y=null;break}if(h!==null){h.return=f,Y=h;break}Y=f}}}var g=i.alternate;if(g!==null){var p=g.child;if(p!==null){g.child=null;do{var b=p.sibling;p.sibling=null,p=b}while(p!==null)}}Y=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,Y=o;else e:for(;Y!==null;){if(i=Y,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Tl(9,i,i.return)}var v=i.sibling;if(v!==null){v.return=i.return,Y=v;break e}Y=i.return}}var y=t.current;for(Y=y;Y!==null;){o=Y;var _=o.child;if(o.subtreeFlags&2064&&_!==null)_.return=o,Y=_;else e:for(o=y;Y!==null;){if(a=Y,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:kh(9,a)}}catch(k){Ge(a,a.return,k)}if(a===o){Y=null;break e}var x=a.sibling;if(x!==null){x.return=a.return,Y=x;break e}Y=a.return}}if(ye=s,Ks(),pn&&typeof pn.onPostCommitFiberRoot=="function")try{pn.onPostCommitFiberRoot(gh,t)}catch{}n=!0}return n}finally{we=r,br.transition=e}}return!1}function Q_(t,e,r){e=ua(r,e),e=Fk(t,e,1),t=js(t,e,1),e=Lt(),t!==null&&(Ru(t,1,e),Qt(t,e))}function Ge(t,e,r){if(t.tag===3)Q_(t,t,r);else for(;e!==null;){if(e.tag===3){Q_(e,t,r);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Ns===null||!Ns.has(n))){t=ua(r,t),t=Uk(e,t,1),e=js(e,t,1),t=Lt(),e!==null&&(Ru(e,1,t),Qt(e,t));break}}e=e.return}}function jA(t,e,r){var n=t.pingCache;n!==null&&n.delete(e),e=Lt(),t.pingedLanes|=t.suspendedLanes&r,ut===t&&(pt&r)===r&&(ot===4||ot===3&&(pt&130023424)===pt&&500>Ze()-Ov?Ci(t,0):Av|=r),Qt(t,e)}function oS(t,e){e===0&&(t.mode&1?(e=qu,qu<<=1,!(qu&130023424)&&(qu=4194304)):e=1);var r=Lt();t=qn(t,e),t!==null&&(Ru(t,e,r),Qt(t,r))}function NA(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),oS(t,r)}function IA(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,s=t.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(D(314))}n!==null&&n.delete(e),oS(t,r)}var aS;aS=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Yt.current)Kt=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return Kt=!1,bA(t,e,r);Kt=!!(t.flags&131072)}
vendor: 6,845 bytes, line 41
41else Kt=!1,Be&&e.flags&1048576&&dk(e,hd,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;Dc(t,e),t=e.pendingProps;var s=ia(e,Et.current);Do(e,r),s=Sv(null,e,n,t,s,r);var i=Ev();return e.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Jt(n)?(i=!0,cd(e)):i=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,_v(e),s.updater=xh,e.stateNode=s,s._reactInternals=e,Jp(e,n,t,r),e=Zp(null,e,n,!0,i,r)):(e.tag=0,Be&&i&&hv(e),Ot(null,e,s,r),e=e.child),e;case 16:n=e.elementType;e:{switch(Dc(t,e),t=e.pendingProps,s=n._init,n=s(n._payload),e.type=n,s=e.tag=LA(n),t=$r(n,t),s){case 0:e=Xp(null,e,n,t,r);break e;case 1:e=B_(null,e,n,t,r);break e;case 11:e=F_(null,e,n,t,r);break e;case 14:e=U_(null,e,n,$r(n.type,t),r);break e}throw Error(D(306,n,""))}return e;case 0:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:$r(n,s),Xp(t,e,n,s,r);case 1:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:$r(n,s),B_(t,e,n,s,r);case 3:e:{if(Wk(e),t===null)throw Error(D(387));n=e.pendingProps,i=e.memoizedState,s=i.element,vk(t,e),gd(e,n,null,r);var o=e.memoizedState;if(n=o.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){s=ua(Error(D(423)),e),e=z_(t,e,n,r,s);break e}else if(n!==s){s=ua(Error(D(424)),e),e=z_(t,e,n,r,s);break e}else for(sr=Os(e.stateNode.containerInfo.firstChild),or=e,Be=!0,Ur=null,r=gk(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(oa(),n===s){e=Vn(t,e,r);break e}Ot(t,e,n,r)}e=e.child}return e;case 5:return yk(e),t===null&&Kp(e),n=e.type,s=e.pendingProps,i=t!==null?t.memoizedProps:null,o=s.children,zp(n,s)?o=null:i!==null&&zp(n,i)&&(e.flags|=32),Hk(t,e),Ot(t,e,o,r),e.child;case 6:return t===null&&Kp(e),null;case 13:return qk(t,e,r);case 4:return wv(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=aa(e,null,n,r):Ot(t,e,n,r),e.child;case 11:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:$r(n,s),F_(t,e,n,s,r);case 7:return Ot(t,e,e.pendingProps,r),e.child;case 8:return Ot(t,e,e.pendingProps.children,r),e.child;case 12:return Ot(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,s=e.pendingProps,i=e.memoizedProps,o=s.value,Re(fd,n._currentValue),n._currentValue=o,i!==null)if(qr(i.value,o)){if(i.children===s.children&&!Yt.current){e=Vn(t,e,r);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(i.tag===1){l=Bn(-1,r&-r),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),Gp(i.return,r,e),a.lanes|=r;break}l=l.next}}else if(i.tag===10)o=i.type===e.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(D(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),Gp(o,r,e),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}Ot(t,e,s.children,r),e=e.child}return e;case 9:return s=e.type,n=e.pendingProps.children,Do(e,r),s=Sr(s),n=n(s),e.flags|=1,Ot(t,e,n,r),e.child;case 14:return n=e.type,s=$r(n,e.pendingProps),s=$r(n.type,s),U_(t,e,n,s,r);case 15:return Bk(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:$r(n,s),Dc(t,e),e.tag=1,Jt(n)?(t=!0,cd(e)):t=!1,Do(e,r),Dk(e,n,s),Jp(e,n,s,r),Zp(null,e,n,!0,t,r);case 19:return Vk(t,e,r);case 22:return zk(t,e,r)}throw Error(D(156,e.tag))};function lS(t,e){return $x(t,e)}function $A(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wr(t,e,r,n){return new $A(t,e,r,n)}function $v(t){return t=t.prototype,!(!t||!t.isReactComponent)}function LA(t){if(typeof t=="function")return $v(t)?1:0;if(t!=null){if(t=t.$$typeof,t===ev)return 11;if(t===tv)return 14}return 2}function $s(t,e){var r=t.alternate;return r===null?(r=wr(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function Bc(t,e,r,n,s,i){var o=2;if(n=t,typeof t=="function")$v(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case _o:return Ti(r.children,s,i,e);case Zm:o=8,s|=8;break;case wp:return t=wr(12,r,e,s|2),t.elementType=wp,t.lanes=i,t;case bp:return t=wr(13,r,e,s),t.elementType=bp,t.lanes=i,t;case xp:return t=wr(19,r,e,s),t.elementType=xp,t.lanes=i,t;case yx:return Eh(r,s,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case mx:o=10;break e;case vx:o=9;break e;case ev:o=11;break e;case tv:o=14;break e;case ls:o=16,n=null;break e}throw Error(D(130,t==null?t:typeof t,""))}return e=wr(o,r,e,s),e.elementType=t,e.type=n,e.lanes=i,e}function Ti(t,e,r,n){return t=wr(7,t,n,e),t.lanes=r,t}function Eh(t,e,r,n){return t=wr(22,t,n,e),t.elementType=yx,t.lanes=r,t.stateNode={isHidden:!1},t}function Ef(t,e,r){return t=wr(6,t,null,e),t.lanes=r,t}function Cf(t,e,r){return e=wr(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function MA(t,e,r,n,s){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=of(0),this.expirationTimes=of(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=of(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Lv(t,e,r,n,s,i,o,a,l){return t=new MA(t,e,r,a,l),e===1?(e=1,i===!0&&(e|=8)):e=0,i=wr(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},_v(i),t}function DA(t,e,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;
vendor: 4,591 bytes, line 41
41return{$$typeof:yo,key:n==null?null:""+n,children:t,containerInfo:e,implementation:r}}function uS(t){if(!t)return Fs;t=t._reactInternals;e:{if(Ui(t)!==t||t.tag!==1)throw Error(D(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Jt(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(D(171))}if(t.tag===1){var r=t.type;if(Jt(r))return uk(t,r,e)}return e}function cS(t,e,r,n,s,i,o,a,l){return t=Lv(r,n,!0,t,s,i,o,a,l),t.context=uS(null),r=t.current,n=Lt(),s=Is(r),i=Bn(n,s),i.callback=e??null,js(r,i,s),t.current.lanes=s,Ru(t,s,n),Qt(t,n),t}function Ch(t,e,r,n){var s=e.current,i=Lt(),o=Is(s);return r=uS(r),e.context===null?e.context=r:e.pendingContext=r,e=Bn(i,o),e.payload={element:t},n=n===void 0?null:n,n!==null&&(e.callback=n),t=js(s,e,o),t!==null&&(Wr(t,s,o,i),$c(t,s,o)),o}function kd(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function X_(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<e?r:e}}function Mv(t,e){X_(t,e),(t=t.alternate)&&X_(t,e)}function FA(){return null}var dS=typeof reportError=="function"?reportError:function(t){console.error(t)};function Dv(t){this._internalRoot=t}Th.prototype.render=Dv.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(D(409));Ch(t,e,null,null)};Th.prototype.unmount=Dv.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Ii(function(){Ch(null,t,null,null)}),e[Wn]=null}};function Th(t){this._internalRoot=t}Th.prototype.unstable_scheduleHydration=function(t){if(t){var e=zx();t={blockedOn:null,target:t,priority:e};for(var r=0;r<cs.length&&e!==0&&e<cs[r].priority;r++);cs.splice(r,0,t),r===0&&Wx(t)}};function Fv(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Ph(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function Z_(){}function UA(t,e,r,n,s){if(s){if(typeof n=="function"){var i=n;n=function(){var u=kd(o);i.call(u)}}var o=cS(e,n,t,0,null,!1,!1,"",Z_);return t._reactRootContainer=o,t[Wn]=o.current,Kl(t.nodeType===8?t.parentNode:t),Ii(),o}for(;s=t.lastChild;)t.removeChild(s);if(typeof n=="function"){var a=n;n=function(){var u=kd(l);a.call(u)}}var l=Lv(t,0,!1,null,null,!1,!1,"",Z_);return t._reactRootContainer=l,t[Wn]=l.current,Kl(t.nodeType===8?t.parentNode:t),Ii(function(){Ch(e,l,r,n)}),l}function Rh(t,e,r,n,s){var i=r._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var a=s;s=function(){var l=kd(o);a.call(l)}}Ch(e,o,t,s)}else o=UA(r,e,t,s,n);return kd(o)}Ux=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var r=ll(e.pendingLanes);r!==0&&(sv(e,r|1),Qt(e,Ze()),!(ye&6)&&(ca=Ze()+500,Ks()))}break;case 13:Ii(function(){var n=qn(t,1);if(n!==null){var s=Lt();Wr(n,t,1,s)}}),Mv(t,1)}};iv=function(t){if(t.tag===13){var e=qn(t,134217728);if(e!==null){var r=Lt();Wr(e,t,134217728,r)}Mv(t,134217728)}};Bx=function(t){if(t.tag===13){var e=Is(t),r=qn(t,e);if(r!==null){var n=Lt();Wr(r,t,e,n)}Mv(t,e)}};zx=function(){return we};Hx=function(t,e){var r=we;try{return we=t,e()}finally{we=r}};jp=function(t,e,r){switch(e){case"input":if(Ep(t,r),e=r.name,r.type==="radio"&&e!=null){for(r=t;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<r.length;e++){var n=r[e];if(n!==t&&n.form===t.form){var s=_h(n);if(!s)throw Error(D(90));wx(n),Ep(n,s)}}}break;case"textarea":xx(t,r);break;case"select":e=r.value,e!=null&&Io(t,!!r.multiple,e,!1)}};Rx=jv;Ax=Ii;var BA={usingClientEntryPoint:!1,Events:[Ou,ko,_h,Tx,Px,jv]},qa={findFiberByHostInstance:hi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},zA={bundleType:qa.bundleType,version:qa.version,rendererPackageName:qa.rendererPackageName,rendererConfig:qa.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Jn.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Nx(t),t===null?null:t.stateNode},findFiberByHostInstance:qa.findFiberByHostInstance||FA,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
41if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var rc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rc.isDisabled&&rc.supportsFiber)try{gh=rc.inject(zA),pn=rc}catch{}}cr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=BA;cr.createPortal=function(t,e){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Fv(e))throw Error(D(200));return DA(t,e,null,r)};cr.createRoot=function(t,e){if(!Fv(t))throw Error(D(299));var r=!1,n="",s=dS;return e!=null&&(e.unstable_strictMode===!0&&(r=!0),e.identifierPrefix!==void 0&&(n=e.identifierPrefix),e.onRecoverableError!==void 0&&(s=e.onRecoverableError)),e=Lv(t,1,!1,null,null,r,!1,n,s),t[Wn]=e.current,Kl(t.nodeType===8?t.parentNode:t),new Dv(e)};cr.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(D(188)):(t=Object.keys(t).join(","),Error(D(268,t)));return t=Nx(e),t=t===null?null:t.stateNode,t};cr.flushSync=function(t){return Ii(t)};cr.hydrate=function(t,e,r){if(!Ph(e))throw Error(D(200));return Rh(null,t,e,!0,r)};cr.hydrateRoot=function(t,e,r){if(!Fv(t))throw Error(D(405));var n=r!=null&&r.hydratedSources||null,s=!1,i="",o=dS;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),e=cS(e,null,t,1,r??null,s,!1,i,o),t[Wn]=e.current,Kl(t),n)for(t=0;t<n.length;t++)r=n[t],s=r._getVersion,s=s(r._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[r,s]:e.mutableSourceEagerHydrationData.push(r,s);return new Th(e)};cr.render=function(t,e,r){if(!Ph(e))throw Error(D(200));return Rh(null,t,e,!1,r)};cr.unmountComponentAtNode=function(t){if(!Ph(t))throw Error(D(40));return t._reactRootContainer?(Ii(function(){Rh(null,null,t,!1,function(){t._reactRootContainer=null,t[Wn]=null})}),!0):!1};cr.unstable_batchedUpdates=jv;cr.unstable_renderSubtreeIntoContainer=function(t,e,r,n){if(!Ph(r))throw Error(D(200));if(t==null||t._reactInternals===void 0)throw Error(D(38));return Rh(t,e,r,!1,n)};cr.version="18.3.1-next-f1338f8080-20240426";function hS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(hS)}catch(t){console.error(t)}}hS(),hx.exports=cr;var Ah=hx.exports;const fS=ex(Ah);var pS,ew=Ah;pS=ew.createRoot,ew.hydrateRoot;const HA="modulepreload",WA=function(t){return"/"+t},tw={},Qe=function(e,r,n){let s=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(r.map(l=>{if(l=WA(l),l in tw)return;tw[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":HA,u||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),u)return new Promise((h,f)=>{d.addEventListener("load",h),d.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return e().catch(i)})};var ka=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(){}},$i=typeof window>"u"||"Deno"in globalThis;function jt(){}function qA(t,e){return typeof t=="function"?t(e):t}function dg(t){return typeof t=="number"&&t>=0&&t!==1/0}function gS(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Ls(t,e){return typeof t=="function"?t(e):t}function mr(t,e){return typeof t=="function"?t(e):t}function rw(t,e){const{type:r="all",exact:n,fetchStatus:s,predicate:i,queryKey:o,stale:a}=t;if(o){if(n){if(e.queryHash!==Uv(o,e.options))return!1}else if(!ru(e.queryKey,o))return!1}if(r!=="all"){const l=e.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||s&&s!==e.state.fetchStatus||i&&!i(e))}function nw(t,e){const{exact:r,status:n,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(r){if(Li(e.options.mutationKey)!==Li(i))return!1}else if(!ru(e.options.mutationKey,i))return!1}return!(n&&e.state.status!==n||s&&!s(e))}function Uv(t,e){return((e==null?void 0:e.queryKeyHashFn)||Li)(t)}function Li(t){return JSON.stringify(t,(e,r)=>hg(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function ru(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(r=>ru(t[r],e[r])):!1}function mS(t,e){if(t===e)return t;const r=sw(t)&&sw(e);if(r||hg(t)&&hg(e)){const n=r?t:Object.keys(t),s=n.length,i=r?e:Object.keys(e),o=i.length,a=r?[]:{},l=new Set(n);let u=0;for(let c=0;c<o;c++){const d=r?c:i[c];(!r&&l.has(d)||r)&&t[d]===void 0&&e[d]===void 0?(a[d]=void 0,u++):(a[d]=mS(t[d],e[d]),a[d]===t[d]&&t[d]!==void 0&&u++)}return s===o&&u===s?t:a}return e}function Sd(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const r in t)if(t[r]!==e[r])return!1;return!0}function sw(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function hg(t){if(!iw(t))return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return!(!iw(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function iw(t){return Object.prototype.toString.call(t)==="[object Object]"}function VA(t){return new Promise(e=>{setTimeout(e,t)})}function fg(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?mS(t,e):e}function KA(t,e,r=0){const n=[...t,e];return r&&n.length>r?n.slice(1):n}function GA(t,e,r=0){const n=[e,...t];return r&&n.length>r?n.slice(0,-1):n}var Bv=Symbol();function vS(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Bv?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function yS(t,e){return typeof t=="function"?t(...e):!!t}var vi,ps,Vo,Wb,YA=(Wb=class extends ka{constructor(){super();re(this,vi);re(this,ps);re(this,Vo);K(this,Vo,e=>{if(!$i&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){E(this,ps)||this.setEventListener(E(this,Vo))}onUnsubscribe(){var e;this.hasListeners()||((e=E(this,ps))==null||e.call(this),K(this,ps,void 0))}setEventListener(e){var r;K(this,Vo,e),(r=E(this,ps))==null||r.call(this),K(this,ps,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){E(this,vi)!==e&&(K(this,vi,e),this.onFocus())}onFocus(){const e=this.isFocused();
vendor: 14,111 bytes, line 41
41this.listeners.forEach(r=>{r(e)})}isFocused(){var e;return typeof E(this,vi)=="boolean"?E(this,vi):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},vi=new WeakMap,ps=new WeakMap,Vo=new WeakMap,Wb),zv=new YA,Ko,gs,Go,qb,JA=(qb=class extends ka{constructor(){super();re(this,Ko,!0);re(this,gs);re(this,Go);K(this,Go,e=>{if(!$i&&window.addEventListener){const r=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){E(this,gs)||this.setEventListener(E(this,Go))}onUnsubscribe(){var e;this.hasListeners()||((e=E(this,gs))==null||e.call(this),K(this,gs,void 0))}setEventListener(e){var r;K(this,Go,e),(r=E(this,gs))==null||r.call(this),K(this,gs,e(this.setOnline.bind(this)))}setOnline(e){E(this,Ko)!==e&&(K(this,Ko,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return E(this,Ko)}},Ko=new WeakMap,gs=new WeakMap,Go=new WeakMap,qb),Ed=new JA;function pg(){let t,e;const r=new Promise((s,i)=>{t=s,e=i});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),t(s)},r.reject=s=>{n({status:"rejected",reason:s}),e(s)},r}function QA(t){return Math.min(1e3*2**t,3e4)}function _S(t){return(t??"online")==="online"?Ed.isOnline():!0}var wS=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function Tf(t){return t instanceof wS}function bS(t){let e=!1,r=0,n=!1,s;const i=pg(),o=p=>{var b;n||(h(new wS(p)),(b=t.abort)==null||b.call(t))},a=()=>{e=!0},l=()=>{e=!1},u=()=>zv.isFocused()&&(t.networkMode==="always"||Ed.isOnline())&&t.canRun(),c=()=>_S(t.networkMode)&&t.canRun(),d=p=>{var b;n||(n=!0,(b=t.onSuccess)==null||b.call(t,p),s==null||s(),i.resolve(p))},h=p=>{var b;n||(n=!0,(b=t.onError)==null||b.call(t,p),s==null||s(),i.reject(p))},f=()=>new Promise(p=>{var b;s=v=>{(n||u())&&p(v)},(b=t.onPause)==null||b.call(t)}).then(()=>{var p;s=void 0,n||(p=t.onContinue)==null||p.call(t)}),g=()=>{if(n)return;let p;const b=r===0?t.initialPromise:void 0;try{p=b??t.fn()}catch(v){p=Promise.reject(v)}Promise.resolve(p).then(d).catch(v=>{var C;if(n)return;const y=t.retry??($i?0:3),_=t.retryDelay??QA,x=typeof _=="function"?_(r,v):_,k=y===!0||typeof y=="number"&&r<y||typeof y=="function"&&y(r,v);if(e||!k){h(v);return}r++,(C=t.onFail)==null||C.call(t,r,v),VA(x).then(()=>u()?void 0:f()).then(()=>{e?h(v):g()})})};return{promise:i,cancel:o,continue:()=>(s==null||s(),i),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?g():f().then(g),i)}}var XA=t=>setTimeout(t,0);function ZA(){let t=[],e=0,r=a=>{a()},n=a=>{a()},s=XA;const i=a=>{e?t.push(a):s(()=>{r(a)})},o=()=>{const a=t;t=[],a.length&&s(()=>{n(()=>{a.forEach(l=>{r(l)})})})};return{batch:a=>{let l;e++;try{l=a()}finally{e--,e||o()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{s=a}}}var it=ZA(),yi,Vb,xS=(Vb=class{constructor(){re(this,yi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),dg(this.gcTime)&&K(this,yi,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??($i?1/0:5*60*1e3))}clearGcTimeout(){E(this,yi)&&(clearTimeout(E(this,yi)),K(this,yi,void 0))}},yi=new WeakMap,Vb),Yo,_i,gr,wi,xt,Su,bi,Mr,En,Kb,eO=(Kb=class extends xS{constructor(e){super();re(this,Mr);re(this,Yo);re(this,_i);re(this,gr);re(this,wi);re(this,xt);re(this,Su);re(this,bi);K(this,bi,!1),K(this,Su,e.defaultOptions),this.setOptions(e.options),this.observers=[],K(this,wi,e.client),K(this,gr,E(this,wi).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,K(this,Yo,tO(this.options)),this.state=e.state??E(this,Yo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=E(this,xt))==null?void 0:e.promise}setOptions(e){this.options={...E(this,Su),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&E(this,gr).remove(this)}setData(e,r){const n=fg(this.state.data,e,this.options);return de(this,Mr,En).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(e,r){de(this,Mr,En).call(this,{type:"setState",state:e,setStateOptions:r})}cancel(e){var n,s;const r=(n=E(this,xt))==null?void 0:n.promise;return(s=E(this,xt))==null||s.cancel(e),r?r.then(jt).catch(jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(E(this,Yo))}isActive(){return this.observers.some(e=>mr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Bv||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ls(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!gS(this.state.dataUpdatedAt,e)}onFocus(){var r;const e=this.observers.find(n=>n.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(r=E(this,xt))==null||r.continue()}onOnline(){var r;const e=this.observers.find(n=>n.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(r=E(this,xt))==null||r.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),E(this,gr).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(r=>r!==e),this.observers.length||(E(this,xt)&&(E(this,bi)?E(this,xt).cancel({revert:!0}):E(this,xt).cancelRetry()),this.scheduleGc()),E(this,gr).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||de(this,Mr,En).call(this,{type:"invalidate"})}fetch(e,r){var u,c,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(E(this,xt))return E(this,xt).continueRetry(),E(this,xt).promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(f=>f.options.queryFn);h&&this.setOptions(h.options)}const n=new AbortController,s=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(K(this,bi,!0),n.signal)})},i=()=>{const h=vS(this.options,r),g=(()=>{const p={client:E(this,wi),queryKey:this.queryKey,meta:this.meta};return s(p),p})();return K(this,bi,!1),this.options.persister?this.options.persister(h,g,this):h(g)},a=(()=>{const h={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:E(this,wi),state:this.state,fetchFn:i};return s(h),h})();(u=this.options.behavior)==null||u.onFetch(a,this),K(this,_i,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&de(this,Mr,En).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta});const l=h=>{var f,g,p,b;Tf(h)&&h.silent||de(this,Mr,En).call(this,{type:"error",error:h}),Tf(h)||((g=(f=E(this,gr).config).onError)==null||g.call(f,h,this),(b=(p=E(this,gr).config).onSettled)==null||b.call(p,this.state.data,h,this)),this.scheduleGc()};return K(this,xt,bS({initialPromise:r==null?void 0:r.initialPromise,fn:a.fetchFn,abort:n.abort.bind(n),onSuccess:h=>{var f,g,p,b;if(h===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(v){l(v);return}(g=(f=E(this,gr).config).onSuccess)==null||g.call(f,h,this),(b=(p=E(this,gr).config).onSettled)==null||b.call(p,h,this.state.error,this),this.scheduleGc()},onError:l,onFail:(h,f)=>{de(this,Mr,En).call(this,{type:"failed",failureCount:h,error:f})},onPause:()=>{de(this,Mr,En).call(this,{type:"pause"})},onContinue:()=>{de(this,Mr,En).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),E(this,xt).start()}},Yo=new WeakMap,_i=new WeakMap,gr=new WeakMap,wi=new WeakMap,xt=new WeakMap,Su=new WeakMap,bi=new WeakMap,Mr=new WeakSet,En=function(e){const r=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...kS(n.data,this.options),fetchMeta:e.meta??null};case"success":return K(this,_i,void 0),{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=e.error;return Tf(s)&&s.revert&&E(this,_i)?{...E(this,_i),fetchStatus:"idle"}:{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=r(this.state),it.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),E(this,gr).notify({query:this,type:"updated",action:e})})},Kb);function kS(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_S(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function tO(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=e!==void 0,n=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var sn,Gb,rO=(Gb=class extends ka{constructor(e={}){super();re(this,sn);this.config=e,K(this,sn,new Map)}build(e,r,n){const s=r.queryKey,i=r.queryHash??Uv(s,r);let o=this.get(i);return o||(o=new eO({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(r),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){E(this,sn).has(e.queryHash)||(E(this,sn).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const r=E(this,sn).get(e.queryHash);r&&(e.destroy(),r===e&&E(this,sn).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){it.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return E(this,sn).get(e)}getAll(){return[...E(this,sn).values()]}find(e){const r={exact:!0,...e};return this.getAll().find(n=>rw(r,n))}findAll(e={}){const r=this.getAll();return Object.keys(e).length>0?r.filter(n=>rw(e,n)):r}notify(e){it.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){it.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){it.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},sn=new WeakMap,Gb),on,Rt,xi,an,os,Yb,nO=(Yb=class extends xS{constructor(e){super();re(this,an);re(this,on);re(this,Rt);re(this,xi);this.mutationId=e.mutationId,K(this,Rt,e.mutationCache),K(this,on,[]),this.state=e.state||SS(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){E(this,on).includes(e)||(E(this,on).push(e),this.clearGcTimeout(),E(this,Rt).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){K(this,on,E(this,on).filter(r=>r!==e)),this.scheduleGc(),E(this,Rt).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){E(this,on).length||(this.state.status==="pending"?this.scheduleGc():E(this,Rt).remove(this))}continue(){var e;return((e=E(this,xi))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,o,a,l,u,c,d,h,f,g,p,b,v,y,_,x,k,C,T,S;const r=()=>{de(this,an,os).call(this,{type:"continue"})};K(this,xi,bS({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(P,R)=>{de(this,an,os).call(this,{type:"failed",failureCount:P,error:R})},onPause:()=>{de(this,an,os).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>E(this,Rt).canRun(this)}));const n=this.state.status==="pending",s=!E(this,xi).canStart();try{if(n)r();else{de(this,an,os).call(this,{type:"pending",variables:e,isPaused:s}),await((o=(i=E(this,Rt).config).onMutate)==null?void 0:o.call(i,e,this));const R=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,e));R!==this.state.context&&de(this,an,os).call(this,{type:"pending",context:R,variables:e,isPaused:s})}const P=await E(this,xi).start();return await((c=(u=E(this,Rt).config).onSuccess)==null?void 0:c.call(u,P,e,this.state.context,this)),await((h=(d=this.options).onSuccess)==null?void 0:h.call(d,P,e,this.state.context)),await((g=(f=E(this,Rt).config).onSettled)==null?void 0:g.call(f,P,null,this.state.variables,this.state.context,this)),await((b=(p=this.options).onSettled)==null?void 0:b.call(p,P,null,e,this.state.context)),de(this,an,os).call(this,{type:"success",data:P}),P}catch(P){try{throw await((y=(v=E(this,Rt).config).onError)==null?void 0:y.call(v,P,e,this.state.context,this)),await((x=(_=this.options).onError)==null?void 0:x.call(_,P,e,this.state.context)),await((C=(k=E(this,Rt).config).onSettled)==null?void 0:C.call(k,void 0,P,this.state.variables,this.state.context,this)),await((S=(T=this.options).onSettled)==null?void 0:S.call(T,void 0,P,e,this.state.context)),P}finally{de(this,an,os).call(this,{type:"error",error:P})}}finally{E(this,Rt).runNext(this)}}},on=new WeakMap,Rt=new WeakMap,xi=new WeakMap,an=new WeakSet,os=function(e){const r=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};
41case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=r(this.state),it.batch(()=>{E(this,on).forEach(n=>{n.onMutationUpdate(e)}),E(this,Rt).notify({mutation:this,type:"updated",action:e})})},Yb);function SS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var In,Dr,Eu,Jb,sO=(Jb=class extends ka{constructor(e={}){super();re(this,In);re(this,Dr);re(this,Eu);this.config=e,K(this,In,new Set),K(this,Dr,new Map),K(this,Eu,0)}build(e,r,n){const s=new nO({mutationCache:this,mutationId:++Fu(this,Eu)._,options:e.defaultMutationOptions(r),state:n});return this.add(s),s}add(e){E(this,In).add(e);const r=nc(e);if(typeof r=="string"){const n=E(this,Dr).get(r);n?n.push(e):E(this,Dr).set(r,[e])}this.notify({type:"added",mutation:e})}remove(e){if(E(this,In).delete(e)){const r=nc(e);if(typeof r=="string"){const n=E(this,Dr).get(r);if(n)if(n.length>1){const s=n.indexOf(e);s!==-1&&n.splice(s,1)}else n[0]===e&&E(this,Dr).delete(r)}}this.notify({type:"removed",mutation:e})}canRun(e){const r=nc(e);if(typeof r=="string"){const n=E(this,Dr).get(r),s=n==null?void 0:n.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var n;const r=nc(e);if(typeof r=="string"){const s=(n=E(this,Dr).get(r))==null?void 0:n.find(i=>i!==e&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){it.batch(()=>
vendor: 9,659 bytes, line 41
41{E(this,In).forEach(e=>{this.notify({type:"removed",mutation:e})}),E(this,In).clear(),E(this,Dr).clear()})}getAll(){return Array.from(E(this,In))}find(e){const r={exact:!0,...e};return this.getAll().find(n=>nw(r,n))}findAll(e={}){return this.getAll().filter(r=>nw(e,r))}notify(e){it.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){const e=this.getAll().filter(r=>r.state.isPaused);return it.batch(()=>Promise.all(e.map(r=>r.continue().catch(jt))))}},In=new WeakMap,Dr=new WeakMap,Eu=new WeakMap,Jb);function nc(t){var e;return(e=t.options.scope)==null?void 0:e.id}function ow(t){return{onFetch:(e,r)=>{var c,d,h,f,g;const n=e.options,s=(h=(d=(c=e.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,i=((f=e.state.data)==null?void 0:f.pages)||[],o=((g=e.state.data)==null?void 0:g.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let p=!1;const b=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(e.signal.aborted?p=!0:e.signal.addEventListener("abort",()=>{p=!0}),e.signal)})},v=vS(e.options,e.fetchOptions),y=async(_,x,k)=>{if(p)return Promise.reject();if(x==null&&_.pages.length)return Promise.resolve(_);const T=(()=>{const I={client:e.client,queryKey:e.queryKey,pageParam:x,direction:k?"backward":"forward",meta:e.options.meta};return b(I),I})(),S=await v(T),{maxPages:P}=e.options,R=k?GA:KA;return{pages:R(_.pages,S,P),pageParams:R(_.pageParams,x,P)}};if(s&&i.length){const _=s==="backward",x=_?iO:aw,k={pages:i,pageParams:o},C=x(n,k);a=await y(k,C,_)}else{const _=t??i.length;do{const x=l===0?o[0]??n.initialPageParam:aw(n,a);if(l>0&&x==null)break;a=await y(a,x),l++}while(l<_)}return a};e.options.persister?e.fetchFn=()=>{var p,b;return(b=(p=e.options).persister)==null?void 0:b.call(p,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r)}:e.fetchFn=u}}}function aw(t,{pages:e,pageParams:r}){const n=e.length-1;return e.length>0?t.getNextPageParam(e[n],e,r[n],r):void 0}function iO(t,{pages:e,pageParams:r}){var n;return e.length>0?(n=t.getPreviousPageParam)==null?void 0:n.call(t,e[0],e,r[0],r):void 0}var Ve,ms,vs,Jo,Qo,ys,Xo,Zo,Qb,oO=(Qb=class{constructor(t={}){re(this,Ve);re(this,ms);re(this,vs);re(this,Jo);re(this,Qo);re(this,ys);re(this,Xo);re(this,Zo);K(this,Ve,t.queryCache||new rO),K(this,ms,t.mutationCache||new sO),K(this,vs,t.defaultOptions||{}),K(this,Jo,new Map),K(this,Qo,new Map),K(this,ys,0)}mount(){Fu(this,ys)._++,E(this,ys)===1&&(K(this,Xo,zv.subscribe(async t=>{t&&(await this.resumePausedMutations(),E(this,Ve).onFocus())})),K(this,Zo,Ed.subscribe(async t=>{t&&(await this.resumePausedMutations(),E(this,Ve).onOnline())})))}unmount(){var t,e;Fu(this,ys)._--,E(this,ys)===0&&((t=E(this,Xo))==null||t.call(this),K(this,Xo,void 0),(e=E(this,Zo))==null||e.call(this),K(this,Zo,void 0))}isFetching(t){return E(this,Ve).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return E(this,ms).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=E(this,Ve).get(e.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),r=E(this,Ve).build(this,e),n=r.state.data;return n===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(Ls(e.staleTime,r))&&this.prefetchQuery(e),Promise.resolve(n))}getQueriesData(t){return E(this,Ve).findAll(t).map(({queryKey:e,state:r})=>{const n=r.data;return[e,n]})}setQueryData(t,e,r){const n=this.defaultQueryOptions({queryKey:t}),s=E(this,Ve).get(n.queryHash),i=s==null?void 0:s.state.data,o=qA(e,i);if(o!==void 0)return E(this,Ve).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(t,e,r){return it.batch(()=>E(this,Ve).findAll(t).map(({queryKey:n})=>[n,this.setQueryData(n,e,r)]))}getQueryState(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=E(this,Ve).get(e.queryHash))==null?void 0:r.state}removeQueries(t){const e=E(this,Ve);it.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){const r=E(this,Ve);return it.batch(()=>(r.findAll(t).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const r={revert:!0,...e},n=it.batch(()=>E(this,Ve).findAll(t).map(s=>s.cancel(r)));return Promise.all(n).then(jt).catch(jt)}invalidateQueries(t,e={}){return it.batch(()=>(E(this,Ve).findAll(t).forEach(r=>{r.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const r={...e,cancelRefetch:e.cancelRefetch??!0},n=it.batch(()=>E(this,Ve).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,r);return r.throwOnError||(i=i.catch(jt)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(jt)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const r=E(this,Ve).build(this,e);return r.isStaleByTime(Ls(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(jt).catch(jt)}fetchInfiniteQuery(t){return t.behavior=ow(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(jt).catch(jt)}ensureInfiniteQueryData(t){return t.behavior=ow(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Ed.isOnline()?E(this,ms).resumePausedMutations():Promise.resolve()}getQueryCache(){return E(this,Ve)}getMutationCache(){return E(this,ms)}getDefaultOptions(){return E(this,vs)}setDefaultOptions(t){K(this,vs,t)}setQueryDefaults(t,e){E(this,Jo).set(Li(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...E(this,Jo).values()],r={};return e.forEach(n=>{ru(t,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(t,e){E(this,Qo).set(Li(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...E(this,Qo).values()],r={};return e.forEach(n=>{ru(t,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;const e={...E(this,vs).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Uv(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===Bv&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...E(this,vs).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){E(this,Ve).clear(),E(this,ms).clear()}},Ve=new WeakMap,ms=new WeakMap,vs=new WeakMap,Jo=new WeakMap,Qo=new WeakMap,ys=new WeakMap,Xo=new WeakMap,Zo=new WeakMap,Qb),zt,me,Cu,At,ki,ea,_s,ws,Tu,ta,ra,Si,Ei,bs,na,_e,cl,gg,mg,vg,yg,_g,wg,bg,ES,Xb,aO=(Xb=class extends ka{constructor(e,r){super();re(this,_e);re(this,zt);re(this,me);re(this,Cu);re(this,At);re(this,ki);re(this,ea);re(this,_s);re(this,ws);re(this,Tu);re(this,ta);re(this,ra);re(this,Si);re(this,Ei);re(this,bs);re(this,na,new Set);this.options=r,K(this,zt,e),K(this,ws,null),K(this,_s,pg()),this.options.experimental_prefetchInRender||E(this,_s).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(E(this,me).addObserver(this),lw(E(this,me),this.options)?de(this,_e,cl).call(this):this.updateResult(),de(this,_e,yg).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return xg(E(this,me),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return xg(E(this,me),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,de(this,_e,_g).call(this),de(this,_e,wg).call(this),E(this,me).removeObserver(this)}setOptions(e){const r=this.options,n=E(this,me);if(this.options=E(this,zt).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof mr(this.options.enabled,E(this,me))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");de(this,_e,bg).call(this),E(this,me).setOptions(this.options),r._defaulted&&!Sd(this.options,r)&&E(this,zt).getQueryCache().notify({type:"observerOptionsUpdated",query:E(this,me),observer:this});const s=this.hasListeners();s&&uw(E(this,me),n,this.options,r)&&de(this,_e,cl).call(this),this.updateResult(),s&&(E(this,me)!==n||mr(this.options.enabled,E(this,me))!==mr(r.enabled,E(this,me))||Ls(this.options.staleTime,E(this,me))!==Ls(r.staleTime,E(this,me)))&&de(this,_e,gg).call(this);const i=de(this,_e,mg).call(this);s&&(E(this,me)!==n||mr(this.options.enabled,E(this,me))!==mr(r.enabled,E(this,me))||i!==E(this,bs))&&de(this,_e,vg).call(this,i)}getOptimisticResult(e){const r=E(this,zt).getQueryCache().build(E(this,zt),e),n=this.createResult(r,e);return uO(this,n)&&(K(this,At,n),K(this,ea,this.options),K(this,ki,E(this,me).state)),n}getCurrentResult(){return E(this,At)}trackResult(e,r){return new Proxy(e,{get:(n,s)=>(this.trackProp(s),r==null||r(s),Reflect.get(n,s))})}trackProp(e){E(this,na).add(e)}getCurrentQuery(){return E(this,me)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const r=E(this,zt).defaultQueryOptions(e),n=E(this,zt).getQueryCache().build(E(this,zt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(e){return de(this,_e,cl).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),E(this,At)))}createResult(e,r){var P;
vendor: 2,376 bytes, line 41
41const n=E(this,me),s=this.options,i=E(this,At),o=E(this,ki),a=E(this,ea),u=e!==n?e.state:E(this,Cu),{state:c}=e;let d={...c},h=!1,f;if(r._optimisticResults){const R=this.hasListeners(),I=!R&&lw(e,r),N=R&&uw(e,n,r,s);(I||N)&&(d={...d,...kS(c.data,e.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:g,errorUpdatedAt:p,status:b}=d;f=d.data;let v=!1;if(r.placeholderData!==void 0&&f===void 0&&b==="pending"){let R;i!=null&&i.isPlaceholderData&&r.placeholderData===(a==null?void 0:a.placeholderData)?(R=i.data,v=!0):R=typeof r.placeholderData=="function"?r.placeholderData((P=E(this,ra))==null?void 0:P.state.data,E(this,ra)):r.placeholderData,R!==void 0&&(b="success",f=fg(i==null?void 0:i.data,R,r),h=!0)}if(r.select&&f!==void 0&&!v)if(i&&f===(o==null?void 0:o.data)&&r.select===E(this,Tu))f=E(this,ta);else try{K(this,Tu,r.select),f=r.select(f),f=fg(i==null?void 0:i.data,f,r),K(this,ta,f),K(this,ws,null)}catch(R){K(this,ws,R)}E(this,ws)&&(g=E(this,ws),f=E(this,ta),p=Date.now(),b="error");const y=d.fetchStatus==="fetching",_=b==="pending",x=b==="error",k=_&&y,C=f!==void 0,S={status:b,fetchStatus:d.fetchStatus,isPending:_,isSuccess:b==="success",isError:x,isInitialLoading:k,isLoading:k,data:f,dataUpdatedAt:d.dataUpdatedAt,error:g,errorUpdatedAt:p,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:y,isRefetching:y&&!_,isLoadingError:x&&!C,isPaused:d.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:x&&C,isStale:Hv(e,r),refetch:this.refetch,promise:E(this,_s),isEnabled:mr(r.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const R=B=>{S.status==="error"?B.reject(S.error):S.data!==void 0&&B.resolve(S.data)},I=()=>{const B=K(this,_s,S.promise=pg());R(B)},N=E(this,_s);switch(N.status){case"pending":e.queryHash===n.queryHash&&R(N);break;case"fulfilled":(S.status==="error"||S.data!==N.value)&&I();break;case"rejected":(S.status!=="error"||S.error!==N.reason)&&I();break}}return S}updateResult(){const e=E(this,At),r=this.createResult(E(this,me),this.options);if(K(this,ki,E(this,me).state),K(this,ea,this.options),E(this,ki).data!==void 0&&K(this,ra,E(this,me)),Sd(r,e))return;K(this,At,r);const n=()=>
vendor: 4,379 bytes, line 41
41{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!E(this,na).size)return!0;const o=new Set(i??E(this,na));return this.options.throwOnError&&o.add("error"),Object.keys(E(this,At)).some(a=>{const l=a;return E(this,At)[l]!==e[l]&&o.has(l)})};de(this,_e,ES).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&de(this,_e,yg).call(this)}},zt=new WeakMap,me=new WeakMap,Cu=new WeakMap,At=new WeakMap,ki=new WeakMap,ea=new WeakMap,_s=new WeakMap,ws=new WeakMap,Tu=new WeakMap,ta=new WeakMap,ra=new WeakMap,Si=new WeakMap,Ei=new WeakMap,bs=new WeakMap,na=new WeakMap,_e=new WeakSet,cl=function(e){de(this,_e,bg).call(this);let r=E(this,me).fetch(this.options,e);return e!=null&&e.throwOnError||(r=r.catch(jt)),r},gg=function(){de(this,_e,_g).call(this);const e=Ls(this.options.staleTime,E(this,me));if($i||E(this,At).isStale||!dg(e))return;const n=gS(E(this,At).dataUpdatedAt,e)+1;K(this,Si,setTimeout(()=>{E(this,At).isStale||this.updateResult()},n))},mg=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(E(this,me)):this.options.refetchInterval)??!1},vg=function(e){de(this,_e,wg).call(this),K(this,bs,e),!($i||mr(this.options.enabled,E(this,me))===!1||!dg(E(this,bs))||E(this,bs)===0)&&K(this,Ei,setInterval(()=>{(this.options.refetchIntervalInBackground||zv.isFocused())&&de(this,_e,cl).call(this)},E(this,bs)))},yg=function(){de(this,_e,gg).call(this),de(this,_e,vg).call(this,de(this,_e,mg).call(this))},_g=function(){E(this,Si)&&(clearTimeout(E(this,Si)),K(this,Si,void 0))},wg=function(){E(this,Ei)&&(clearInterval(E(this,Ei)),K(this,Ei,void 0))},bg=function(){const e=E(this,zt).getQueryCache().build(E(this,zt),this.options);if(e===E(this,me))return;const r=E(this,me);K(this,me,e),K(this,Cu,e.state),this.hasListeners()&&(r==null||r.removeObserver(this),e.addObserver(this))},ES=function(e){it.batch(()=>{e.listeners&&this.listeners.forEach(r=>{r(E(this,At))}),E(this,zt).getQueryCache().notify({query:E(this,me),type:"observerResultsUpdated"})})},Xb);function lO(t,e){return mr(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function lw(t,e){return lO(t,e)||t.state.data!==void 0&&xg(t,e,e.refetchOnMount)}function xg(t,e,r){if(mr(e.enabled,t)!==!1&&Ls(e.staleTime,t)!=="static"){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&Hv(t,e)}return!1}function uw(t,e,r,n){return(t!==e||mr(n.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&Hv(t,r)}function Hv(t,e){return mr(e.enabled,t)!==!1&&t.isStaleByTime(Ls(e.staleTime,t))}function uO(t,e){return!Sd(t.getCurrentResult(),e)}var xs,ks,Ht,$n,zn,zc,kg,Zb,cO=(Zb=class extends ka{constructor(r,n){super();re(this,zn);re(this,xs);re(this,ks);re(this,Ht);re(this,$n);K(this,xs,r),this.setOptions(n),this.bindMethods(),de(this,zn,zc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var s;const n=this.options;this.options=E(this,xs).defaultMutationOptions(r),Sd(this.options,n)||E(this,xs).getMutationCache().notify({type:"observerOptionsUpdated",mutation:E(this,Ht),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Li(n.mutationKey)!==Li(this.options.mutationKey)?this.reset():((s=E(this,Ht))==null?void 0:s.state.status)==="pending"&&E(this,Ht).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=E(this,Ht))==null||r.removeObserver(this)}onMutationUpdate(r){de(this,zn,zc).call(this),de(this,zn,kg).call(this,r)}getCurrentResult(){return E(this,ks)}reset(){var r;(r=E(this,Ht))==null||r.removeObserver(this),K(this,Ht,void 0),de(this,zn,zc).call(this),de(this,zn,kg).call(this)}mutate(r,n){var s;return K(this,$n,n),(s=E(this,Ht))==null||s.removeObserver(this),K(this,Ht,E(this,xs).getMutationCache().build(E(this,xs),this.options)),E(this,Ht).addObserver(this),E(this,Ht).execute(r)}},xs=new WeakMap,ks=new WeakMap,Ht=new WeakMap,$n=new WeakMap,zn=new WeakSet,zc=function(){var n;const r=((n=E(this,Ht))==null?void 0:n.state)??SS();K(this,ks,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},kg=function(r){it.batch(()=>{var n,s,i,o,a,l,u,c;if(E(this,$n)&&this.hasListeners()){const d=E(this,ks).variables,h=E(this,ks).c
41ontext;(r==null?void 0:r.type)==="success"?((s=(n=E(this,$n)).onSuccess)==null||s.call(n,r.data,d,h),(o=(i=E(this,$n)).onSettled)==null||o.call(i,r.data,null,d,h)):(r==null?void 0:r.type)==="error"&&((l=(a=E(this,$n)).onError)==null||l.call(a,r.error,d,h),(c=(u=E(this,$n)).onSettled)==null||c.call(u,void 0,r.error,d,h))}this.listeners.forEach(d=>{d(E(this,ks))})})},Zb),CS=w.createContext(void 0),Gs=t=>{const e=w.useContext(CS);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},dO=({client:t,children:e})=>(w.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),m.jsx(CS.Provider,{value:t,children:e})),TS=w.createContext(!1),hO=()=>w.useContext(TS);TS.Provider;function fO(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var pO=w.createContext(fO()),gO=()=>w.useContext(pO),mO=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},vO=t=>{w.useEffect(()=>{t.clearReset()},[t])},yO=({result:t,errorResetBoundary:e,throwOnError:r,query:n,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&n&&(s&&t.data===void 0||yS(r,[t.error,n])),_O=t=>{if(t.suspense){const e=n=>n==="static"?n:Math.max(n??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...n)=>e(r(...n)):e(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},wO=(t,e)=>t.isLoading&&t.isFetching&&!e,bO=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,cw=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});function xO(t,e,r){var d,h,f,g,p;const n=hO(),s=gO(),i=Gs(),o=i.defaultQueryOptions(t);(h=(d=i.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||h.call(d,o),o._optimisticResults=n?"isRestoring":"optimistic",_O(o),mO(o,s),vO(s);const a=!i.getQueryCache().get(o.queryHash),[l]=w.useState(()=>new e(i,o)),u=l.getOptimisticResult(o),c=!n&&t.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(b=>{const v=c?l.subscribe(it.batchCalls(b)):jt;return l.updateResult(),v},[l,c]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),w.useEffect(()=>{l.setOptions(o)},[o,l]),bO(o,u))throw cw(o,l,s);if(yO({result:u,errorResetBoundary:s,throwOnError:o.throwOnError,query:i.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;if((g=(f=i.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||g.call(f,o,u),o.experimental_prefetchInRender&&!$i&&wO(u,n)){const b=a?cw(o,l,s):(p=i.getQueryCache().get(o.queryHash))==null?void 0:p.promise;b==null||b.catch(jt).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?u:l.trackResult(u)}function hr(t,e){return xO(t,aO)}function kO(t,e){const r=Gs(),[n]=w.useState(()=>new cO(r,t));w.useEffect(()=>{n.setOptions(t)},[n,t]);const s=w.useSyncExternalStore(w.useCallback(o=>n.subscribe(it.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),i=w.useCallback((o,a)=>{n.mutate(o,a).catch(jt)},[n]);if(s.error&&yS(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}/**
42 * @remix-run/router v1.23.4
43 *
44 * Copyright (c) Remix Software Inc.
45 *
46 * This source code is licensed under the MIT license found in the
47 * LICENSE.md file in the root directory of this source tree.
48 *
49 * @license MIT
50 */function nu(){return nu=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},nu.apply(null,arguments)}var Cs;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(Cs||(Cs={}));const dw="popstate";function SO(t){t===void 0&&(t={});function e(n,s){let{pathname:i,search:o,hash:a}=n.location;return Sg("",{pathname:i,search:o,hash:a},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function r(n,s){return typeof s=="string"?s:Cd(s)}return CO(e,r,null,t)}function et(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function PS(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function EO(){return Math.random().toString(36).substr(2,8)}function hw(t,e){return{usr:t.state,key:t.key,idx:e}}function Sg(t,e,r,n){return r===void 0&&(r=null),nu({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Sa(e):e,{state:r,key:e&&e.key||n||EO()})}function Cd(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Sa(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function CO(t,e,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:i=!1}=n,o=s.history,a=Cs.Pop,l=null,u=c();u==null&&(u=0,o.replaceState(nu({},o.state,{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function d(){a=Cs.Pop;let b=c(),v=b==null?null:b-u;u=b,l&&l({action:a,location:p.location,delta:v})}function h(b,v){a=Cs.Push;let y=Sg(p.location,b,v);u=c()+1;let _=hw(y,u),x=p.createHref(y);try{o.pushState(_,"",x)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;s.location.assign(x)}i&&l&&l({action:a,location:p.location,delta:1})}function f(b,v){a=Cs.Replace;let y=Sg(p.location,b,v);u=c();let _=hw(y,u),x=p.createHref(y);o.replaceState(_,"",x),i&&l&&l({action:a,location:p.location,delta:0})}function g(b){let v=s.location.origin!=="null"?s.location.origin:s.location.href,y=typeof b=="string"?b:Cd(b);return y=y.replace(/ $/,"%20"),et(v,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,v)}let p={get action(){return a},get location(){return t(s,o)},listen(b){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(dw,d),l=b,()=>{s.removeEventListener(dw,d),l=null}},createHref(b){return e(s,b)},createURL:g,encodeLocation(b){let v=g(b);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:f,go(b){return o.go(b)}};return p}var fw;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(fw||(fw={}));function TO(t,e,r){return r===void 0&&(r="/"),PO(t,e,r)}function PO(t,e,r,n){let s=typeof e=="string"?Sa(e):e,i=Wv(s.pathname||"/",r);if(i==null)return null;let o=RS(t);RO(o);let a=null,l=BO(i);for(let u=0;a==null&&u<o.length;
vendor: 6,096 bytes, lines 50-59
50++u)a=DO(o[u],l);return a}function RS(t,e,r,n){e===void 0&&(e=[]),r===void 0&&(r=[]),n===void 0&&(n="");let s=(i,o,a)=>{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};l.relativePath.startsWith("/")&&(et(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=Ms([n,l.relativePath]),c=r.concat(l);i.children&&i.children.length>0&&(et(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),RS(i.children,e,c,u)),!(i.path==null&&!i.index)&&e.push({path:u,score:LO(u,i.index),routesMeta:c})};return t.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))s(i,o);else for(let l of AS(i.path))s(i,o,l)}),e}function AS(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,s=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return s?[i,""]:[i];let o=AS(n.join("/")),a=[];return a.push(...o.map(l=>l===""?i:[i,l].join("/"))),s&&a.push(...o),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function RO(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:MO(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const AO=/^:[\w-]+$/,OO=3,jO=2,NO=1,IO=10,$O=-2,pw=t=>t==="*";function LO(t,e){let r=t.split("/"),n=r.length;return r.some(pw)&&(n+=$O),e&&(n+=jO),r.filter(s=>!pw(s)).reduce((s,i)=>s+(AO.test(i)?OO:i===""?NO:IO),n)}function MO(t,e){return t.length===e.length&&t.slice(0,-1).every((n,s)=>n===e[s])?t[t.length-1]-e[e.length-1]:0}function DO(t,e,r){let{routesMeta:n}=t,s={},i="/",o=[];for(let a=0;a<n.length;++a){let l=n[a],u=a===n.length-1,c=i==="/"?e:e.slice(i.length)||"/",d=FO({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},c),h=l.route;if(!d)return null;Object.assign(s,d.params),o.push({params:s,pathname:Ms([i,d.pathname]),pathnameBase:WO(Ms([i,d.pathnameBase])),route:h}),d.pathnameBase!=="/"&&(i=Ms([i,d.pathnameBase]))}return o}function FO(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,n]=UO(t.path,t.caseSensitive,t.end),s=e.match(r);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),a=s.slice(1);return{params:n.reduce((u,c,d)=>{let{paramName:h,isOptional:f}=c;if(h==="*"){let p=a[d]||"";o=i.slice(0,i.length-p.length).replace(/(.)\/+$/,"$1")}const g=a[d];return f&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:t}}function UO(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),PS(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 n=[],s="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(n.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(n.push({paramName:"*"}),s+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":t!==""&&t!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),n]}function BO(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return PS(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function Wv(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}function zO(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:s=""}=typeof t=="string"?Sa(t):t,i;return r?(r=OS(r),r.startsWith("/")?i=gw(r.substring(1),"/"):i=gw(r,e)):i=e,{pathname:i,search:qO(n),hash:VO(s)}}function gw(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(s=>{s===".."?r.length>1&&r.pop():s!=="."&&r.push(s)}),r.length>1?r.join("/"):"/"}function Pf(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function HO(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function qv(t,e){let r=HO(t);return e?r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Vv(t,e,r,n){n===void 0&&(n=!1);let s;typeof t=="string"?s=Sa(t):(s=nu({},t),et(!s.pathname||!s.pathname.includes("?"),Pf("?","pathname","search",s)),et(!s.pathname||!s.pathname.includes("#"),Pf("#","pathname","hash",s)),et(!s.search||!s.search.includes("#"),Pf("#","search","hash",s)));let i=t===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=r;else{let d=e.length-1;if(!n&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),d-=1;s.pathname=h.join("/")}a=d>=0?e[d]:"/"}let l=zO(s,a),u=o&&o!=="/"&&o.endsWith("/"),c=(i||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const OS=t=>t.replace(/\/\/+/g,"/"),Ms=t=>OS(t.join("/")),WO=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),qO=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,VO=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function KO(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const jS=["post","put","patch","delete"];new Set(jS);const GO=["get",...jS];new Set(GO);/**
51 * React Router v6.30.6
52 *
53 * Copyright (c) Remix Software Inc.
54 *
55 * This source code is licensed under the MIT license found in the
56 * LICENSE.md file in the root directory of this source tree.
57 *
58 * @license MIT
59 */function su(){return su=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}
vendor: 5,301 bytes, line 59
59).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},su.apply(null,arguments)}const Kv=w.createContext(null),YO=w.createContext(null),Ys=w.createContext(null),Oh=w.createContext(null),_n=w.createContext({outlet:null,matches:[],isDataRoute:!1}),NS=w.createContext(null);function JO(t,e){let{relative:r}=e===void 0?{}:e;Ea()||et(!1);let{basename:n,navigator:s}=w.useContext(Ys),{hash:i,pathname:o,search:a}=$S(t,{relative:r}),l=o;return n!=="/"&&(l=o==="/"?n:Ms([n,o])),s.createHref({pathname:l,search:a,hash:i})}function Ea(){return w.useContext(Oh)!=null}function Gr(){return Ea()||et(!1),w.useContext(Oh).location}function IS(t){w.useContext(Ys).static||w.useLayoutEffect(t)}function Bi(){let{isDataRoute:t}=w.useContext(_n);return t?dj():QO()}function QO(){Ea()||et(!1);let t=w.useContext(Kv),{basename:e,future:r,navigator:n}=w.useContext(Ys),{matches:s}=w.useContext(_n),{pathname:i}=Gr(),o=JSON.stringify(qv(s,r.v7_relativeSplatPath)),a=w.useRef(!1);return IS(()=>{a.current=!0}),w.useCallback(function(u,c){if(c===void 0&&(c={}),!a.current)return;if(typeof u=="number"){n.go(u);return}let d=Vv(u,JSON.parse(o),i,c.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:Ms([e,d.pathname])),(c.replace?n.replace:n.push)(d,c.state,c)},[e,n,o,i,t])}const XO=w.createContext(null);function ZO(t){let e=w.useContext(_n).outlet;return e&&w.createElement(XO.Provider,{value:t},e)}function B5(){let{matches:t}=w.useContext(_n),e=t[t.length-1];return e?e.params:{}}function $S(t,e){let{relative:r}=e===void 0?{}:e,{future:n}=w.useContext(Ys),{matches:s}=w.useContext(_n),{pathname:i}=Gr(),o=JSON.stringify(qv(s,n.v7_relativeSplatPath));return w.useMemo(()=>Vv(t,JSON.parse(o),i,r==="path"),[t,o,i,r])}function ej(t,e){return tj(t,e)}function tj(t,e,r,n){Ea()||et(!1);let{navigator:s}=w.useContext(Ys),{matches:i}=w.useContext(_n),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=Gr(),c;if(e){var d;let b=typeof e=="string"?Sa(e):e;l==="/"||(d=b.pathname)!=null&&d.startsWith(l)||et(!1),c=b}else c=u;let h=c.pathname||"/",f=h;if(l!=="/"){let b=l.replace(/^\//,"").split("/");f="/"+h.replace(/^\//,"").split("/").slice(b.length).join("/")}let g=TO(t,{pathname:f}),p=oj(g&&g.map(b=>Object.assign({},b,{params:Object.assign({},a,b.params),pathname:Ms([l,s.encodeLocation?s.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?l:Ms([l,s.encodeLocation?s.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),i,r,n);return e&&p?w.createElement(Oh.Provider,{value:{location:su({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Cs.Pop}},p):p}function rj(){let t=cj(),e=KO(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},e),r?w.createElement("pre",{style:s},r):null,null)}const nj=w.createElement(rj,null);class sj extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error!==void 0?w.createElement(_n.Provider,{value:this.props.routeContext},w.createElement(NS.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ij(t){let{routeContext:e,match:r,children:n}=t,s=w.useContext(Kv);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),w.createElement(_n.Provider,{value:e},n)}function oj(t,e,r,n){var s;if(e===void 0&&(e=[]),r===void 0&&(r=null),n===void 0&&(n=null),t==null){var i;if(!r)return null;if(r.errors)t=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let o=t,a=(s=r)==null?void 0:s.errors;if(a!=null){let c=o.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);c>=0||et(!1),o=o.slice(0,Math.min(o.length,c+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let c=0;c<o.length;c++){let d=o[c];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=c),d.route.id){let{loaderData:h,errors:f}=r,g=d.route.loader&&h[d.route.id]===void 0&&(!f||f[d.route.id]===void 0);if(d.route.lazy||g){l=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((c,d,h)=>{let f,g=!1,p=null,b=null;r&&(f=a&&d.route.id?a[d.route.id]:void 0,p=d.route.errorElement||nj,l&&(u<0&&h===0?(hj("route-fallback"),g=!0,b=null):u===h&&(g=!0,b=d.route.hydrateFallbackElement||null)));let v=e.concat(o.slice(0,h+1)),y=()=>{let _;return f?_=p:g?_=b:d.route.Component?_=w.createElement(d.route.Component,null):d.route.element?_=d.route.element:_=c,w.createElement(ij,{match:d,routeC
59ontext:{outlet:c,matches:v,isDataRoute:r!=null},children:_})};return r&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?w.createElement(sj,{location:r.location,revalidation:r.revalidation,component:p,error:f,children:y(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):y()},null)}var LS=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(LS||{}),MS=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(MS||{});function aj(t){let e=w.useContext(Kv);return e||et(!1),e}function lj(t){let e=w.useContext(YO);return e||et(!1),e}function uj(t){let e=w.useContext(_n);return e||et(!1),e}function DS(t){let e=uj(),r=e.matches[e.matches.length-1];return r.route.id||et(!1),r.route.id}function cj(){var t;let e=w.useContext(NS),r=lj(),n=DS();return e!==void 0?e:(t=r.errors)==null?void 0:t[n]}function dj(){let{router:t}=aj(LS.UseNavigateStable),e=DS(MS.UseNavigateStable),r=w.useRef(!1);return IS(()=>{r.current=!0}),w.useCallback(function(s,i){i===void 0&&(i={}),r.current&&(typeof s=="number"?t.navigate(s):t.navigate(s,su({fromRouteId:e},i)))},[t,e])}const mw={};function hj(t,e,r){mw[t]||(mw[t]=!0)}function fj(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function Nr(t){let{to:e,replace:r,state:n,relative:s}=t;Ea()||et(!1);let{future:i,static:o}=w.useContext(Ys),{matches:a}=w.useContext(_n),{pathname:l}=Gr(),u=Bi(),c=Vv(e,qv(a,i.v7_relativeSplatPath),l,s==="path"),d=JSON.stringify(c);return w.useEffect(()=>u(JSON.parse(d),{replace:r,state:n,relative:s}),[u,d,s,r,n]),null}function pj(t){return ZO(t.context)}function ge(t){et(!1)}function gj(t){let{basename:e="/",children:r=null,location:n,navigationType:s=Cs.Pop,navigator:i,static:o=!1,future:a}=t;Ea()&&et(!1);let l=e.replace(/^\/*/,"/"),u=w.useMemo(()=>({basename:l,navigator:i,static:o,future:su({v7_relativeSplatPath:!1},a)}),[l,a,i,o]);typeof n=="string"&&(n=Sa(n));let{pathname:c="/",search:d="",hash:h="",state:f=null,key:g="default"}=n,p=w.useMemo(()=>{let b=Wv(c,l);return b==null?null:{location:{pathname:b,search:d,hash:h,state:f,key:g},navigationType:s}},[l,c,d,h,f,g,s]);return p==null?null:w.createElement(Ys.Provider,{value:u},w.createElement(Oh.Provider,{children:r,value:p}))}function mj(t){let{children:e,location:r}=t;return ej(Eg(e),r)}new Promise(()=>{});function Eg(t,e){e===void 0&&(e=[]);let r=[];return w.Children.forEach(t,(n,s)=>{if(!w.isValidElement(n))return;let i=[...e,s];if(n.type===w.Fragment){r.push.apply(r,Eg(n.props.children,i));return}n.type!==ge&&et(!1),!n.props.index||!n.props.children||et(!1);let o={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=Eg(n.props.children,i)),r.push(o)}),r}/**
60 * React Router DOM v6.30.6
61 *
62 * Copyright (c) Remix Software Inc.
63 *
64 * This source code is licensed under the MIT license found in the
65 * LICENSE.md file in the root directory of this source tree.
66 *
67 * @license MIT
68 */function Cg(){return Cg=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Cg.apply(null,arguments)}function vj(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function yj(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function _j(t,e){return t.button===0&&(!e||e==="_self")&&!yj(t)}function Tg(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,r)=>{let n=t[r];return e.concat(Array.isArray(n)?n.map(s=>[r,s]):[[r,n]])},[]))}function wj(t,e){let r=Tg(t);return e&&e.forEach((n,s)=>
68{r.has(s)||e.getAll(s).forEach(i=>{r.append(s,i)})}),r}const bj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],xj="6";try{window.__reactRouterVersion=xj}catch{}const kj="startTransition",vw=Ym[kj];function Sj(t){let{basename:e,children:r,future:n,window:s}=t,i=w.useRef();i.current==null&&(i.current=SO({window:s,v5Compat:!0}));let o=i.current,[a,l]=w.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},c=w.useCallback(d=>{u&&vw?vw(()=>l(d)):l(d)},[l,u]);return w.useLayoutEffect(()=>o.listen(c),[o,c]),w.useEffect(()=>fj(n),[n]),w.createElement(gj,{basename:e,children:r,location:a.location,navigationType:a.action,navigator:o,future:n})}const Ej=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Cj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,It=w.forwardRef(function(e,r){let{onClick:n,relative:s,reloadDocument:i,replace:o,state:a,target:l,to:u,preventScrollReset:c,viewTransition:d}=e,h=vj(e,bj),{basename:f}=w.useContext(Ys),g,p=!1;if(typeof u=="string"&&Cj.test(u)&&(g=u,Ej))try{let _=new URL(window.location.href),x=u.startsWith("//")?new URL(_.protocol+u):new URL(u),k=Wv(x.pathname,f);x.origin===_.origin&&k!=null?u=k+x.search+x.hash:p=!0}catch{}let b=JO(u,{relative:s}),v=Tj(u,{replace:o,state:a,target:l,preventScrollReset:c,relative:s,viewTransition:d});function y(_){n&&n(_),_.defaultPrevented||v(_)}return w.createElement("a",Cg({},h,{href:g||b,onClick:p||i?n:y,ref:r,target:l}))});var yw;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(yw||(yw={}));var _w;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(_w||(_w={}));function Tj(t,e){let{target:r,replace:n,state:s,preventScrollReset:i,relative:o,viewTransition:a}=e===void 0?{}:e,l=Bi(),u=Gr(),c=$S(t,{relative:o});return w.useCallback(d=>{if(_j(d,r)){d.preventDefault();let h=n!==void 0?n:Cd(u)===Cd(c);l(t,{replace:h,state:s,preventScrollReset:i,relative:o,viewTransition:a})}},[u,l,c,n,s,r,t,i,o,a])}function Pj(t){let e=w.useRef(Tg(t)),r=w.useRef(!1),n=Gr(),s=w.useMemo(()=>wj(n.search,r.current?null:e.current),[n.search]),i=Bi(),o=w.useCallback((a,l)=>{const u=Tg(typeof a=="function"?a(s):a);r.current=!0,i("?"+u,l)},[i,s]);return[s,o]}var ww=["light","dark"],Rj="(prefers-color-scheme: dark)",Aj=w.createContext(void 0),Oj={setTheme:t=>{},themes:[]},jj=()=>{var t;return(t=w.useContext(Aj))!=null?t:Oj};w.memo(({forcedTheme:t,storageKey:e,attribute:r,enableSystem:n,enableColorScheme:s,defaultTheme:i,value:o,attrs:a,nonce:l})=>{let u=i==="system",c=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(g=>`'${g}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,d=s?ww.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=(g,p=!1,b=!0)=>{let v=o?o[g]:g,y=p?g+"|| ''":`'${v}'`,_="";return s&&b&&!p&&ww.includes(g)&&(_+=`d.style.colorScheme = '${g}';`),r==="class"?p||v?_+=`c.add(${y})`:_+="null":v&&(_+=`d[s](n,${y})`),_},f=t?`!function(){${c}${h(t)}}()`:n?`!function(){try{${c}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${u})){var t='${Rj}',m=window.matchMedia(t);if(m.media!==t||m.matches){${h("dark")}}else{${h("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${h(o?"x[e]":"e",!0)}}${u?"":"else{"+h(i,!1,!1)+"}"}${d}}catch(e){}}()`:`!function(){try{${c}var e=localStorage.getItem('${e}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${h(o?"x[e]":"e",!0)}}else{${h(i,!1,!1)};}${d}}catch(t){}}();`;return w.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:f}})});var Nj=t=>{switch(t){case"success":return Lj;case"info":return Dj;case"warning":return Mj;case"error":return Fj;default:return null}},Ij=Array(12).fill(0),$j=({visible:t,className:e})=>z.createElement("div",{className:["sonner-loading-wrapper",e].filter(
68Boolean).join(" "),"data-visible":t},z.createElement("div",{className:"sonner-spinner"},Ij.map((r,n)=>z.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Lj=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},z.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Mj=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},z.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Dj=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Fj=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Uj=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},z.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),z.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Bj=()=>{let[t,e]=z.useState(document.hidden);return z.useEffect(()=>{let r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t},Pg=1,zj=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let r=this.subscribers.indexOf(e);this.subscribers.splice(r,1)}),this.publish=e=>{this.subscribers.forEach(r=>r(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var r;let{message:n,...s}=e,i=typeof(e==null?void 0:e.id)=="number"||((r=e.id)==null?void 0:r.length)>0?e.id:Pg++,o=this.toasts.find(l=>l.id===i),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(l=>l.id===i?(this.publish({...l,...e,id:i,title:n}),{...l,...e,id:i,dismissible:a,title:n}):l):this.addToast({title:n,...s,dismissible:a,id:i}),i},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),this.subscribers.forEach(r=>r({id:e,dismiss:!0})),e),this.message=(e,r)=>this.create({...r,message:e}),this.error=(e,r)=>this.create({...r,message:e,type:"error"}),this.success=(e,r)=>this.create({...r,type:"success",message:e}),this.info=(e,r)=>this.create({...r,type:"info",message:e}),this.warning=(e,r)=>this.create({...r,type:"warning",message:e}),this.loading=(e,r)=>this.create({...r,type:"loading",message:e}),this.promise=(e,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:e,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));let s=e instanceof Promise?e:e(),i=n!==void 0,o,a=s.then(async u=>{if(o=["resolve",u],z.isValidElement(u))i=!1,this.create({id:n,type:"default",message:u});else if(Wj(u)&&!u.ok){i=!1;let c=typeof r.error=="function"?await r.error(`HTTP error! status: ${u.status}`):r.error,d=typeof r.description=="function"?await r.description(`HTTP error! status: ${u.status}`):r.description;this.create({id:n,type:"error",message:c,description:d})}else if(r.success!==void 0){i=!1;let c=typeof r.success=="function"?await r.success(u):r.success,d=typeof r.description=="function"?await r.description(u):r.description;this.create({id:n,type:"success",message:c,description:d})}}).catch(async u=>
68{if(o=["reject",u],r.error!==void 0){i=!1;let c=typeof r.error=="function"?await r.error(u):r.error,d=typeof r.description=="function"?await r.description(u):r.description;this.create({id:n,type:"error",message:c,description:d})}}).finally(()=>{var u;i&&(this.dismiss(n),n=void 0),(u=r.finally)==null||u.call(r)}),l=()=>new Promise((u,c)=>a.then(()=>o[0]==="reject"?c(o[1]):u(o[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(e,r)=>{let n=(r==null?void 0:r.id)||Pg++;return this.create({jsx:e(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},qt=new zj,Hj=(t,e)=>{let r=(e==null?void 0:e.id)||Pg++;return qt.addToast({title:t,...e,id:r}),r},Wj=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",qj=Hj,Vj=()=>qt.toasts,Kj=()=>qt.getActiveToasts(),Je=Object.assign(qj,{success:qt.success,info:qt.info,warning:qt.warning,error:qt.error,custom:qt.custom,message:qt.message,promise:qt.promise,dismiss:qt.dismiss,loading:qt.loading},{getHistory:Vj,getToasts:Kj});function Gj(t,{insertAt:e}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}Gj(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
68left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
68:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
68--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
69`);function sc(t){return t.label!==void 0}var Yj=3,Jj="32px",Qj="16px",bw=4e3,Xj=356,Zj=14,eN=20,tN=200;function Or(...t){return t.filter(Boolean).join(" ")}function rN(t){let[e,r]=t.split("-"),n=[];return e&&n.push(e),r&&n.push(r),n}var nN=t=>{var e,r,n,s,i,o,a,l,u,c,d;let{invert:h,toast:f,unstyled:g,interacting:p,setHeights:b,visibleToasts:v,heights:y,index:_,toasts:x,expanded:k,removeToast:C,defaultRichColors:T,closeButton:S,style:P,cancelButtonStyle:R,actionButtonStyle:I,className:N="",descriptionClassName:B="",duration:q,position:ee,gap:$,loadingIcon:W,expandByDefault:j,classNames:A,icons:M,closeButtonAriaLabel:G="Close toast",pauseWhenPageIsHidden:V}=t,[Q,Z]=z.useState(null),[oe,ve]=z.useState(null),[ie,Le]=z.useState(!1),[Ce,Tt]=z.useState(!1),[Jr,Pt]=z.useState(!1),[Qr,Wi]=z.useState(!1),[Ia,Zt]=z.useState(!1),[$a,Xn]=z.useState(0),[Xr,La]=z.useState(0),Zn=z.useRef(f.duration||q||bw),Ma=z.useRef(null),Cr=z.useRef(null),lP=_===0,uP=_+1<=v,fr=f.type,qi=f.dismissible!==!1,cP=f.className||"",dP=f.descriptionClassName||"",Du=z.useMemo(()=>y.findIndex(ae=>ae.toastId===f.id)||0,[y,f.id]),hP=z.useMemo(()=>{var ae;return(ae=f.closeButton)!=null?ae:S},[f.closeButton,S]),By=z.useMemo(()=>f.duration||q||bw,[f.duration,q]),Qh=z.useRef(0),Vi=z.useRef(0),zy=z.useRef(0),Ki=z.useRef(null),[fP,pP]=ee.split("-"),Hy=z.useMemo(()=>y.reduce((ae,be,Me)=>
69Me>=Du?ae:ae+be.height,0),[y,Du]),Wy=Bj(),gP=f.invert||h,Xh=fr==="loading";Vi.current=z.useMemo(()=>Du*$+Hy,[Du,Hy]),z.useEffect(()=>{Zn.current=By},[By]),z.useEffect(()=>{Le(!0)},[]),z.useEffect(()=>{let ae=Cr.current;if(ae){let be=ae.getBoundingClientRect().height;return La(be),b(Me=>[{toastId:f.id,height:be,position:f.position},...Me]),()=>b(Me=>Me.filter(Tr=>Tr.toastId!==f.id))}},[b,f.id]),z.useLayoutEffect(()=>{if(!ie)return;let ae=Cr.current,be=ae.style.height;ae.style.height="auto";let Me=ae.getBoundingClientRect().height;ae.style.height=be,La(Me),b(Tr=>Tr.find(Pr=>Pr.toastId===f.id)?Tr.map(Pr=>Pr.toastId===f.id?{...Pr,height:Me}:Pr):[{toastId:f.id,height:Me,position:f.position},...Tr])},[ie,f.title,f.description,b,f.id]);let es=z.useCallback(()=>{Tt(!0),Xn(Vi.current),b(ae=>ae.filter(be=>be.toastId!==f.id)),setTimeout(()=>{C(f)},tN)},[f,C,b,Vi]);z.useEffect(()=>{if(f.promise&&fr==="loading"||f.duration===1/0||f.type==="loading")return;let ae;return k||p||V&&Wy?(()=>{if(zy.current<Qh.current){let be=new Date().getTime()-Qh.current;Zn.current=Zn.current-be}zy.current=new Date().getTime()})():Zn.current!==1/0&&(Qh.current=new Date().getTime(),ae=setTimeout(()=>{var be;(be=f.onAutoClose)==null||be.call(f,f),es()},Zn.current)),()=>clearTimeout(ae)},[k,p,f,fr,V,Wy,es]),z.useEffect(()=>{f.delete&&es()},[es,f.delete]);function mP(){var ae,be,Me;return M!=null&&M.loading?z.createElement("div",{className:Or(A==null?void 0:A.loader,(ae=f==null?void 0:f.classNames)==null?void 0:ae.loader,"sonner-loader"),"data-visible":fr==="loading"},M.loading):W?z.createElement("div",{className:Or(A==null?void 0:A.loader,(be=f==null?void 0:f.classNames)==null?void 0:be.loader,"sonner-loader"),"data-visible":fr==="loading"},W):z.createElement($j,{className:Or(A==null?void 0:A.loader,(Me=f==null?void 0:f.classNames)==null?void 0:Me.loader),visible:fr==="loading"})}return z.createElement("li",{tabIndex:0,ref:Cr,className:Or(N,cP,A==null?void 0:A.toast,(e=f==null?void 0:f.classNames)==null?void 0:e.toast,A==null?void 0:A.default,A==null?void 0:A[fr],(r=f==null?void 0:f.classNames)==null?void 0:r[fr]),"data-sonner-toast":"","data-rich-colors":(n=f.richColors)!=null?n:T,"data-styled":!(f.jsx||f.unstyled||g),"data-mounted":ie,"data-promise":!!f.promise,"data-swiped":Ia,"data-removed":Ce,"data-visible":uP,"data-y-position":fP,"data-x-position":pP,"data-index":_,"data-front":lP,"data-swiping":Jr,"data-dismissible":qi,"data-type":fr,"data-invert":gP,"data-swipe-out":Qr,"data-swipe-direction":oe,"data-expanded":!!(k||j&&ie),style:{"--index":_,"--toasts-before":_,"--z-index":x.length-_,"--offset":`${Ce?$a:Vi.current}px`,"--initial-height":j?"auto":`${Xr}px`,...P,...f.style},onDragEnd:()=>{Pt(!1),Z(null),Ki.current=null},onPointerDown:ae=>{Xh||!qi||(Ma.current=new Date,Xn(Vi.current),ae.target.setPointerCapture(ae.pointerId),ae.target.tagName!=="BUTTON"&&(Pt(!0),Ki.current={x:ae.clientX,y:ae.clientY}))},onPointerUp:()=>{var ae,be,Me,Tr;if(Qr||!qi)return;Ki.current=null;let Pr=Number(((ae=Cr.current)==null?void 0:ae.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ts=Number(((be=Cr.current)==null?void 0:be.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Js=new Date().getTime()-((Me=Ma.current)==null?void 0:Me.getTime()),Rr=Q==="x"?Pr:ts,rs=Math.abs(Rr)/Js;if(Math.abs(Rr)>=eN||rs>.11){Xn(Vi.current),(Tr=f.onDismiss)==null||Tr.call(f,f),ve(Q==="x"?Pr>0?"right":"left":ts>0?"down":"up"),es(),Wi(!0),Zt(!1);return}Pt(!1),Z(null)},onPointerMove:ae=>{var be,Me,Tr,Pr;if(!Ki.current||!qi||((be=window.getSelection())==null?void 0:be.toString().length)>0)return;let ts=ae.clientY-Ki.current.y,Js=ae.clientX-Ki.current.x,Rr=(Me=t.swipeDirections)!=null?Me:rN(ee);!Q&&(Math.abs(Js)>1||Math.abs(ts)>1)&&Z(Math.abs(Js)>Math.abs(ts)?"x":"y");let rs={x:0,y:0};Q==="y"?(Rr.includes("top")||Rr.includes("bottom"))&&(Rr.includes("top")&&ts<0||Rr.includes("bottom")&&ts>0)&&(rs.y=ts):Q==="x"&&(Rr.includes("left")||Rr.includes("right"))&&(Rr.includes("left")&&Js<0||Rr.includes("right")&&Js>0)&&(rs.x=Js),(Math.abs(rs.x)>0||Math.abs(rs.y)>0)&&Zt(!0),(Tr=Cr.current)==null||Tr.style.setProperty("--swipe-amount-x",`${rs.x}px`),(Pr=Cr.current)==null||Pr.style.setProperty("--swipe-amount-y",`${rs.y}px`)}},hP&&!f.jsx?z.createElement("button",{"aria-label":G,"data-disabled":Xh,"data-close-button":!0,onClick:Xh||!qi?()=>{}:()=>{var ae;es(),(ae=f.onDismiss)==null||ae.call(f,f)},className:Or(A==null?void 0:A.closeButton,(s=f==null?void 0:f.classNames)==null?void 0:s.closeButton)},(i=M==null?void 0:M.close)!=null?i:Uj):null,f.jsx||w.isValidElement(f.title)?f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title:z.createElement(z.Fragment,null,fr||f.icon||f.promise?z.createElement("div",{"data-icon":"",className:Or(A==null?void 0:A.icon,(o=f==null?void 0:f.classNames)==null?void 0:o.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||mP():null,f.type!=="loading"?f.icon||(M==null?void 0:M[fr])||Nj(fr):null):null,z.createElement("div",{"data-content":"",className:Or(A==null?void 0:A.content,(a=f==null?void 0:f.classNames)==null?void 0:a.content)},z.createElement("div",{"data-title":"",className:Or(A==null?void 0:A.title,(l=f==null?void 0:f.classNames)==null?void 0:l.title)},typeof f.title=="function"?f.title():f.title),f.description?z.createElement("div",{"data-description":"",className:Or(B,dP,A==null?void 0:A.description,(u=f==null?void 0:f.classNames)==null?void 0:u.description)},typeof f.description=="function"?f.description():f.description):null),w.isValidElement(f.cancel)?f.cancel:f.cancel&&sc(f.cancel)?z.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||R,onClick:ae=>{var be,Me;sc(f.cancel)&&qi&&((Me=(be=f.cancel).onClick)==null||Me.call(be,ae),es())},className:Or(A==null?void 0:A.cancelButton,(c=f==null?void 0:f.classNames)==null?void 0:c.cancelButton)},f.cancel.label):null,w.isValidElement(f.action)?f.action:f.action&&sc(f.action)?z.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||I,onClick:ae=>{var be,Me;sc(f.action)&&((Me=(be=f.action).onClick)==null||Me.call(be,ae),!ae.defaultPrevented&&es())},className:Or(A==null?void 0:A.actionButton,(d=f==null?void 0:f.classNames)==null?void 0:d.actionButton)},f.action.label):null))};function xw(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function sN(t,e){let r={};return[t,e].forEach((n,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",a=i?Qj:Jj;function l(u){["top","right","bottom","left"].forEach(c=>{r[`${o}-${c}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?l(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${o}-${u}`]=a:r[`${o}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):l(a)}),r}var iN=w.forwardRef(function(t,e){let{invert:r,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:o,className:a,offset:l,mobileOffset:u,theme:c="light",richColors:d,duration:h,style:f,visibleToasts:g=Yj,toastOptions:p,dir:b=xw(),gap:v=Zj,loadingIcon:y,icons:_,containerAriaLabel:x="Notifications",pauseWhenPageIsHidden:k}=t,[C,T]=z.useState([]),S=z.useMemo(()=>Array.from(new Set([n].concat(C.filter(V=>V.position).map(V=>V.position)))),[C,n]),[P,R]=z.useState([]),[I,N]=z.useState(!1),[B,q]=z.useState(!1),[ee,$]=z.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dar
69k":"light"),W=z.useRef(null),j=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),A=z.useRef(null),M=z.useRef(!1),G=z.useCallback(V=>{T(Q=>{var Z;return(Z=Q.find(oe=>oe.id===V.id))!=null&&Z.delete||qt.dismiss(V.id),Q.filter(({id:oe})=>oe!==V.id)})},[]);return z.useEffect(()=>qt.subscribe(V=>{if(V.dismiss){T(Q=>Q.map(Z=>Z.id===V.id?{...Z,delete:!0}:Z));return}setTimeout(()=>{fS.flushSync(()=>{T(Q=>{let Z=Q.findIndex(oe=>oe.id===V.id);return Z!==-1?[...Q.slice(0,Z),{...Q[Z],...V},...Q.slice(Z+1)]:[V,...Q]})})})}),[]),z.useEffect(()=>{if(c!=="system"){$(c);return}if(c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?$("dark"):$("light")),typeof window>"u")return;let V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:Q})=>{$(Q?"dark":"light")})}catch{V.addListener(({matches:Z})=>{try{$(Z?"dark":"light")}catch(oe){console.error(oe)}})}},[c]),z.useEffect(()=>{C.length<=1&&N(!1)},[C]),z.useEffect(()=>{let V=Q=>{var Z,oe;s.every(ve=>Q[ve]||Q.code===ve)&&(N(!0),(Z=W.current)==null||Z.focus()),Q.code==="Escape"&&(document.activeElement===W.current||(oe=W.current)!=null&&oe.contains(document.activeElement))&&N(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[s]),z.useEffect(()=>{if(W.current)return()=>{A.current&&(A.current.focus({preventScroll:!0}),A.current=null,M.current=!1)}},[W.current]),z.createElement("section",{ref:e,"aria-label":`${x} ${j}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},S.map((V,Q)=>{var Z;let[oe,ve]=V.split("-");return C.length?z.createElement("ol",{key:V,dir:b==="auto"?xw():b,tabIndex:-1,ref:W,className:a,"data-sonner-toaster":!0,"data-theme":ee,"data-y-position":oe,"data-lifted":I&&C.length>1&&!i,"data-x-position":ve,style:{"--front-toast-height":`${((Z=P[0])==null?void 0:Z.height)||0}px`,"--width":`${Xj}px`,"--gap":`${v}px`,...f,...sN(l,u)},onBlur:ie=>{M.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(M.current=!1,A.current&&(A.current.focus({preventScroll:!0}),A.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||M.current||(M.current=!0,A.current=ie.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{B||N(!1)},onDragEnd:()=>N(!1),onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||q(!0)},onPointerUp:()=>q(!1)},C.filter(ie=>!ie.position&&Q===0||ie.position===V).map((ie,Le)=>{var Ce,Tt;return z.createElement(nN,{key:ie.id,icons:_,index:Le,toast:ie,defaultRichColors:d,duration:(Ce=p==null?void 0:p.duration)!=null?Ce:h,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:r,visibleToasts:g,closeButton:(Tt=p==null?void 0:p.closeButton)!=null?Tt:o,interacting:B,position:V,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:G,toasts:C.filter(Jr=>Jr.position==ie.position),heights:P.filter(Jr=>Jr.position==ie.position),setHeights:R,expandByDefault:i,gap:v,loadingIcon:y,expanded:I,pauseWhenPageIsHidden:k,swipeDirections:t.swipeDirections})})):null}))});const oN=({...t})=>{const{theme:e="system"}=jj();return m.jsx(iN,{theme:e,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})};function he(t,e,{checkForDefaultPrevented:r=!0}={}){return function(s){if(t==null||t(s),r===!1||!s.defaultPrevented)return e==null?void 0:e(s)}}function kw(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function jh(...t){return e=>{let r=!1;const n=t.map(s=>{const i=kw(s,e);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let s=0;s<n.length;s++){const i=n[s];typeof i=="function"?i():kw(t[s],null)}}}}function Ct(...t){return w.useCallback(jh(...t),t)}function H5(t,e){const r=w.createContext(e),n=i=>{const{children:o,...a}=i,l=w.useMemo(()=>a,Object.values(a));return m.jsx(r.Provider,{value:l,children:o})};n.displayName=t+"Provider";function s(i){const o=w.useContext(r);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[n,s]}function Ca(t,e=[]){let r=[];function n(i,o){const a=w.createContext(o),l=r.length;r=[...r,o];const u=d=>{var v;const{scope:h,children:f,...g}=d,p=((v=h==null?void 0:h[t])==null?void 0:v[l])||a,b=w.useMemo(()=>g,Object.values(g));return m.jsx(p.Provider,{value:b,children:f})};u.displayName=i+"Provider";function c(d,h){var p;const f=((p=h==null?void 0:h[t])==null?void 0:p[l])||a,g=w.useContext(f);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,c]}const s=()=>{const i=r.map(o=>w.createContext(o));return function(a){const l=(a==null?void 0:a[t])||i;return w.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return s.scopeName=t,[n,aN(s,...e)]}function aN(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=n.reduce((a,{useScope:l,scopeName:u})=>{const d=l(i)[`__scope${u}`];return{...a,...d}},{});return w.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}function iu(t){const e=uN(t),r=w.forwardRef((n,s)=>{const{children:i,...o}=n,a=w.Children.toArray(i),l=a.find(dN);if(l){const u=l.props.children,c=a.map(d=>d===l?w.Children.count(u)>1?w.Children.only(null):w.isValidElement(u)?u.props.children:null:d);return m.jsx(e,{...o,ref:s,children:w.isValidElement(u)?w.cloneElement(u,void 0,c):null})}return m.jsx(e,{...o,ref:s,children:i})});return r.displayName=`${t}.Slot`,r}var lN=iu("Slot");function uN(t){const e=w.forwardRef((r,n)=>{const{children:s,...i}=r;if(w.isValidElement(s)){const o=fN(s),a=hN(i,s.props);return s.type!==w.Fragment&&(a.ref=n?jh(n,o):o),w.cloneElement(s,a)}return w.Children.count(s)>1?w.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var FS=Symbol("radix.slottable");function cN(t){const e=({children:r})=>m.jsx(m.Fragment,{children:r});return e.displayName=`${t}.Slottable`,e.__radixId=FS,e}function dN(t){return w.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===FS}function hN(t,e){const r={...e};for(const n in e){const s=t[n],i=e[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}
vendor: 4,871 bytes, line 69
69:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...t,...r}}function fN(t){var n,s;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var pN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],vt=pN.reduce((t,e)=>{const r=iu(`Primitive.${e}`),n=w.forwardRef((s,i)=>{const{asChild:o,...a}=s,l=o?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(l,{...a,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function US(t,e){t&&Ah.flushSync(()=>t.dispatchEvent(e))}function Kn(t){const e=w.useRef(t);return w.useEffect(()=>{e.current=t}),w.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}function gN(t,e=globalThis==null?void 0:globalThis.document){const r=Kn(t);w.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return e.addEventListener("keydown",n,{capture:!0}),()=>e.removeEventListener("keydown",n,{capture:!0})},[r,e])}var mN="DismissableLayer",Rg="dismissableLayer.update",vN="dismissableLayer.pointerDownOutside",yN="dismissableLayer.focusOutside",Sw,BS=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Gv=w.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...l}=t,u=w.useContext(BS),[c,d]=w.useState(null),h=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=w.useState({}),g=Ct(e,T=>d(T)),p=Array.from(u.layers),[b]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=p.indexOf(b),y=c?p.indexOf(c):-1,_=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,k=bN(T=>{const S=T.target,P=[...u.branches].some(R=>R.contains(S));!x||P||(s==null||s(T),o==null||o(T),T.defaultPrevented||a==null||a())},h),C=xN(T=>{const S=T.target;[...u.branches].some(R=>R.contains(S))||(i==null||i(T),o==null||o(T),T.defaultPrevented||a==null||a())},h);return gN(T=>{y===u.layers.size-1&&(n==null||n(T),!T.defaultPrevented&&a&&(T.preventDefault(),a()))},h),w.useEffect(()=>{if(c)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Sw=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),Ew(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Sw)}},[c,h,r,u]),w.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),Ew())},[c,u]),w.useEffect(()=>{const T=()=>f({});return document.addEventListener(Rg,T),()=>document.removeEventListener(Rg,T)},[]),m.jsx(vt.div,{...l,ref:g,style:{pointerEvents:_?x?"auto":"none":void 0,...t.style},onFocusCapture:he(t.onFocusCapture,C.onFocusCapture),onBlurCapture:he(t.onBlurCapture,C.onBlurCapture),onPointerDownCapture:he(t.onPointerDownCapture,k.onPointerDownCapture)})});Gv.displayName=mN;var _N="DismissableLayerBranch",wN=w.forwardRef((t,e)=>{const r=w.useContext(BS),n=w.useRef(null),s=Ct(e,n);return w.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),m.jsx(vt.div,{...t,ref:s})});wN.displayName=_N;function bN(t,e=globalThis==null?void 0:globalThis.document){const r=Kn(t),n=w.useRef(!1),s=w.useRef(()=>{});return w.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let l=function(){zS(vN,r,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=l,e.addEventListener("click",s.current,{once:!0})):l()}else e.removeEventListener("click",s.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function xN(t,e=globalThis==null?void 0:globalThis.document){const r=Kn(t),n=w.useRef(!1);return w.useEffect(()=>{const s=i=>{i.target&&!n.current&&zS(yN,r,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Ew(){const t=new CustomEvent(Rg);document.dispatchEvent(t)}function zS(t,e,r,{discrete:n}){const s=r.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&s.addEventListener(t,e,{once:!0}),n?US(s,i):s.dispatchEvent(i)}var Us=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},kN=Ym[" useId ".trim().toString()]||(()=>{}),SN=0;function Ag(t){const[e,r]=w.useState(kN());return Us(()=>{r(n=>n??String(SN++))},[t]),e?`radix-${e}
69`:""}const EN=["top","right","bottom","left"],Bs=Math.min,rr=Math.max,Td=Math.round,ic=Math.floor,mn=t=>({x:t,y:t}),CN={left:"right",right:"left",bottom:"top",top:"bottom"},TN={start:"end",end:"start"};function Og(t,e,r){return rr(t,Bs(e,r))}function Gn(t,e){return typeof t=="function"?t(e):t}function Yn(t){return t.split("-")[0]}function Ta(t){return t.split("-")[1]}function Yv(t){return t==="x"?"y":"x"}function Jv(t){return t==="y"?"height":"width"}const PN=new Set(["top","bottom"]);function hn(t){return PN.has(Yn(t))?"y":"x"}function Qv(t){return Yv(hn(t))}function RN(t,e,r){r===void 0&&(r=!1);const n=Ta(t),s=Qv(t),i=Jv(s);let o=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=Pd(o)),[o,Pd(o)]}function AN(t){const e=Pd(t);return[jg(t),e,jg(e)]}function jg(t){return t.replace(/start|end/g,e=>TN[e])}const Cw=["left","right"],Tw=["right","left"],ON=["top","bottom"],jN=["bottom","top"];function NN(t,e,r){switch(t){case"top":case"bottom":return r?e?Tw:Cw:e?Cw:Tw;case"left":case"right":return e?ON:jN;default:return[]}}function IN(t,e,r,n){const s=Ta(t);let i=NN(Yn(t),r==="start",n);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(jg)))),i}function Pd(t){return t.replace(/left|right|bottom|top/g,e=>CN[e])}function $N(t){return{top:0,right:0,bottom:0,left:0,...t}}function HS(t){return typeof t!="number"?$N(t):{top:t,right:t,bottom:t,left:t}}function Rd(t){const{x:e,y:r,width:n,height:s}=t;return{width:n,height:s,top:r,left:e,right:e+n,bottom:r+s,x:e,y:r}}function Pw(t,e,r){let{reference:n,floating:s}=t;const i=hn(e),o=Qv(e),a=Jv(o),l=Yn(e),u=i==="y",c=n.x+n.width/2-s.width/2,d=n.y+n.height/2-s.height/2,h=n[a]/2-s[a]/2;let f;switch(l){case"top":f={x:c,y:n.y-s.height};break;case"bottom":f={x:c,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:d};break;case"left":f={x:n.x-s.width,y:d};break;default:f={x:n.x,y:n.y}}switch(Ta(e)){case"start":f[o]-=h*(r&&u?-1:1);break;case"end":f[o]+=h*(r&&u?-1:1);break}return f}const LN=async(t,e,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:i=[],platform:o}=r,a=i.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:s}),{x:c,y:d}=Pw(u,n,l),h=n,f={},g=0;for(let p=0;p<a.length;p++){const{name:b,fn:v}=a[p],{x:y,y:_,data:x,reset:k}=await v({x:c,y:d,initialPlacement:n,placement:h,strategy:s,middlewareData:f,re
vendor: 9,616 bytes, line 69
69cts:u,platform:o,elements:{reference:t,floating:e}});c=y??c,d=_??d,f={...f,[b]:{...f[b],...x}},k&&g<=50&&(g++,typeof k=="object"&&(k.placement&&(h=k.placement),k.rects&&(u=k.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:s}):k.rects),{x:c,y:d}=Pw(u,h,l)),p=-1)}return{x:c,y:d,placement:h,strategy:s,middlewareData:f}};async function ou(t,e){var r;e===void 0&&(e={});const{x:n,y:s,platform:i,rects:o,elements:a,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=Gn(e,t),g=HS(f),b=a[h?d==="floating"?"reference":"floating":d],v=Rd(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(b)))==null||r?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),y=d==="floating"?{x:n,y:s,width:o.floating.width,height:o.floating.height}:o.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),x=await(i.isElement==null?void 0:i.isElement(_))?await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1}:{x:1,y:1},k=Rd(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:_,strategy:l}):y);return{top:(v.top-k.top+g.top)/x.y,bottom:(k.bottom-v.bottom+g.bottom)/x.y,left:(v.left-k.left+g.left)/x.x,right:(k.right-v.right+g.right)/x.x}}const MN=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:s,rects:i,platform:o,elements:a,middlewareData:l}=e,{element:u,padding:c=0}=Gn(t,e)||{};if(u==null)return{};const d=HS(c),h={x:r,y:n},f=Qv(s),g=Jv(f),p=await o.getDimensions(u),b=f==="y",v=b?"top":"left",y=b?"bottom":"right",_=b?"clientHeight":"clientWidth",x=i.reference[g]+i.reference[f]-h[f]-i.floating[g],k=h[f]-i.reference[f],C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let T=C?C[_]:0;(!T||!await(o.isElement==null?void 0:o.isElement(C)))&&(T=a.floating[_]||i.floating[g]);const S=x/2-k/2,P=T/2-p[g]/2-1,R=Bs(d[v],P),I=Bs(d[y],P),N=R,B=T-p[g]-I,q=T/2-p[g]/2+S,ee=Og(N,q,B),$=!l.arrow&&Ta(s)!=null&&q!==ee&&i.reference[g]/2-(q<N?R:I)-p[g]/2<0,W=$?q<N?q-N:q-B:0;return{[f]:h[f]+W,data:{[f]:ee,centerOffset:q-ee-W,...$&&{alignmentOffset:W}},reset:$}}}),DN=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;const{placement:s,middlewareData:i,rects:o,initialPlacement:a,platform:l,elements:u}=e,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...b}=Gn(t,e);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const v=Yn(s),y=hn(a),_=Yn(a)===a,x=await(l.isRTL==null?void 0:l.isRTL(u.floating)),k=h||(_||!p?[Pd(a)]:AN(a)),C=g!=="none";!h&&C&&k.push(...IN(a,p,g,x));const T=[a,...k],S=await ou(e,b),P=[];let R=((n=i.flip)==null?void 0:n.overflows)||[];if(c&&P.push(S[v]),d){const q=RN(s,o,x);P.push(S[q[0]],S[q[1]])}if(R=[...R,{placement:s,overflows:P}],!P.every(q=>q<=0)){var I,N;const q=(((I=i.flip)==null?void 0:I.index)||0)+1,ee=T[q];if(ee&&(!(d==="alignment"?y!==hn(ee):!1)||R.every(j=>j.overflows[0]>0&&hn(j.placement)===y)))return{data:{index:q,overflows:R},reset:{placement:ee}};let $=(N=R.filter(W=>W.overflows[0]<=0).sort((W,j)=>W.overflows[1]-j.overflows[1])[0])==null?void 0:N.placement;if(!$)switch(f){case"bestFit":{var B;const W=(B=R.filter(j=>{if(C){const A=hn(j.placement);return A===y||A==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(A=>A>0).reduce((A,M)=>A+M,0)]).sort((j,A)=>j[1]-A[1])[0])==null?void 0:B[0];W&&($=W);break}case"initialPlacement":$=a;break}if(s!==$)return{reset:{placement:$}}}return{}}}};function Rw(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Aw(t){return EN.some(e=>t[e]>=0)}const FN=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...s}=Gn(t,e);switch(n){case"referenceHidden":{const i=await ou(e,{...s,elementContext:"reference"}),o=Rw(i,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Aw(o)}}}case"escaped":{const i=await ou(e,{...s,altBoundary:!0}),o=Rw(i,r.floating);return{data:{escapedOffsets:o,escaped:Aw(o)}}}default:return{}}}}},WS=new Set(["left","top"]);async function UN(t,e){const{placement:r,platform:n,elements:s}=t,i=await(n.isRTL==null?void 0:n.isRTL(s.floating)),o=Yn(r),a=Ta(r),l=hn(r)==="y",u=WS.has(o)?-1:1,c=i&&l?-1:1,d=Gn(e,t);let{mainAxis:h,crossAxis:f,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(f=a==="end"?g*-1:g),l?{x:f*c,y:h*u}:{x:h*u,y:f*c}}const BN=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:s,y:i,placement:o,middlewareData:a}=e,l=await UN(e,t);return o===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:s+l.x,y:i+l.y,data:{...l,placement:o}}}}},zN=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:s}=e,{mainAxis:i=!0,crossAxis:o=!1,limiter:a={fn:b=>{let{x:v,y}=b;return{x:v,y}}},...l}=Gn(t,e),u={x:r,y:n},c=await ou(e,l),d=hn(Yn(s)),h=Yv(d);let f=u[h],g=u[d];if(i){const b=h==="y"?"top":"left",v=h==="y"?"bottom":"right",y=f+c[b],_=f-c[v];f=Og(y,f,_)}if(o){const b=d==="y"?"top":"left",v=d==="y"?"bottom":"right",y=g+c[b],_=g-c[v];g=Og(y,g,_)}const p=a.fn({...e,[h]:f,[d]:g});return{...p,data:{x:p.x-r,y:p.y-n,enabled:{[h]:i,[d]:o}}}}}},HN=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:s,rects:i,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Gn(t,e),c={x:r,y:n},d=hn(s),h=Yv(d);let f=c[h],g=c[d];const p=Gn(a,e),b=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const _=h==="y"?"height":"width",x=i.reference[h]-i.floating[_]+b.mainAxis,k=i.reference[h]+i.reference[_]-b.mainAxis;f<x?f=x:f>k&&(f=k)}if(u){var v,y;const _=h==="y"?"width":"height",x=WS.has(Yn(s)),k=i.reference[d]-i.floating[_]+(x&&((v=o.offset)==null?void 0:v[d])||0)+(x?0:b.crossAxis),C=i.reference[d]+i.reference[_]+(x?0:((y=o.offset)==null?void 0:y[d])||0)-(x?b.crossAxis:0);g<k?g=k:g>C&&(g=C)}return{[h]:f,[d]:g}}}},WN=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,n;const{placement:s,rects:i,platform:o,elements:a}=e,{apply:l=()=>{},...u}=Gn(t,e),c=await ou(e,u),d=Yn(s),h=Ta(s),f=hn(s)==="y",{width:g,height:p}=i.floating;let b,v;d==="top"||d==="bottom"?(b=d,v=h===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,b=h==="end"?"top":"bottom");const y=p-c.top-c.bottom,_=g-c.left-c.right,x=Bs(p-c[b],y),k=Bs(g-c[v],_),C=!e.middlewareData.shift;let T=x,S=k;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(S=_),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(T=y),C&&!h){const R=rr(c.left,0),I=rr(c.right,0),N=rr(c.top,0),B=rr(c.bottom,0);f?S=g-2*(R!==0||I!==0?R+I:rr(c.left,c.right)):T=p-2*(N!==0||B!==0?N+B:rr(c.top,c.bottom))}await l({...e,availableWidth:S,availableHeight:T});const P=await o.getDimensions(a.floating);return g!==P.width||p!==P.height?{reset:{rects:!0}}:{}}}};function Nh(){return typeof window<"u"}function Pa(t){return qS(t)?(t.nodeName||"").toLowerCase():"#document"}function ar(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function wn(t){var e;return(e=(qS(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function qS(t){return Nh()?t instanceof Node||t instanceof ar(t).Node:!1}function Vr(t){return Nh()?t instanceof Element||t instanceof ar(t).Element:!1}function yn(t){return Nh()?t instanceof HTMLElement||t instanceof ar(t).HTMLElement:!1}function Ow(t){return!Nh()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ar(t).ShadowRoot}const qN=new Set(["inline","contents"]);function Nu(t){const{overflow:e,overflowX:r,overflowY:n,display:s}=Kr(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!qN.has(s)}const VN=new Set(["table","td","th"]);function KN(t){return VN.has(Pa(t))}const GN=[":popover-open",":modal"];function Ih(t){return GN.some(e=>{try{return t.matches(e)}catch{return!1}})}const YN=["transform","translate","scale","rotate","perspective"],JN=["transform","translate","scale","rotate","perspective","filter"],QN=["paint","layout","strict","content"];function Xv(t){const e=Zv(),r=Vr(t)?Kr(t):t;return YN.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||JN.some(n=>(r.willChange||"").includes(n))||QN.some(n=>(r.contain||"").includes(n))}function XN(t){let e=zs(t);for(;yn(e)&&!da(e);){if(Xv(e))return e;if(Ih(e))return null;e=zs(e)}return null}function Zv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ZN=new Set(["html","body","#document"]);function da(t){return ZN.has(Pa(t))}function Kr(t){return ar(t).getComputedStyle(t)}function $h(t){return Vr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function zs(t){if(Pa(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Ow(t)&&t.host||wn(t);return Ow(e)?e.host:e}function VS(t){const e=zs(t);return da(e)?t.ownerDocument?t.ownerDocument.body:t.body:yn(e)&&Nu(e)?e:VS(e)}function au(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const s=VS(t),i=s===((n=t.ownerDocument)==null?void 0:n.body),o=ar(s);if(i){const a=Ng(o);
vendor: 6,504 bytes, line 69
69return e.concat(o,o.visualViewport||[],Nu(s)?s:[],a&&r?au(a):[])}return e.concat(s,au(s,[],r))}function Ng(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function KS(t){const e=Kr(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const s=yn(t),i=s?t.offsetWidth:r,o=s?t.offsetHeight:n,a=Td(r)!==i||Td(n)!==o;return a&&(r=i,n=o),{width:r,height:n,$:a}}function ey(t){return Vr(t)?t:t.contextElement}function Uo(t){const e=ey(t);if(!yn(e))return mn(1);const r=e.getBoundingClientRect(),{width:n,height:s,$:i}=KS(e);let o=(i?Td(r.width):r.width)/n,a=(i?Td(r.height):r.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const eI=mn(0);function GS(t){const e=ar(t);return!Zv()||!e.visualViewport?eI:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function tI(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==ar(t)?!1:e}function Mi(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const s=t.getBoundingClientRect(),i=ey(t);let o=mn(1);e&&(n?Vr(n)&&(o=Uo(n)):o=Uo(t));const a=tI(i,r,n)?GS(i):mn(0);let l=(s.left+a.x)/o.x,u=(s.top+a.y)/o.y,c=s.width/o.x,d=s.height/o.y;if(i){const h=ar(i),f=n&&Vr(n)?ar(n):n;let g=h,p=Ng(g);for(;p&&n&&f!==g;){const b=Uo(p),v=p.getBoundingClientRect(),y=Kr(p),_=v.left+(p.clientLeft+parseFloat(y.paddingLeft))*b.x,x=v.top+(p.clientTop+parseFloat(y.paddingTop))*b.y;l*=b.x,u*=b.y,c*=b.x,d*=b.y,l+=_,u+=x,g=ar(p),p=Ng(g)}}return Rd({width:c,height:d,x:l,y:u})}function ty(t,e){const r=$h(t).scrollLeft;return e?e.left+r:Mi(wn(t)).left+r}function YS(t,e,r){r===void 0&&(r=!1);const n=t.getBoundingClientRect(),s=n.left+e.scrollLeft-(r?0:ty(t,n)),i=n.top+e.scrollTop;return{x:s,y:i}}function rI(t){let{elements:e,rect:r,offsetParent:n,strategy:s}=t;const i=s==="fixed",o=wn(n),a=e?Ih(e.floating):!1;if(n===o||a&&i)return r;let l={scrollLeft:0,scrollTop:0},u=mn(1);const c=mn(0),d=yn(n);if((d||!d&&!i)&&((Pa(n)!=="body"||Nu(o))&&(l=$h(n)),yn(n))){const f=Mi(n);u=Uo(n),c.x=f.x+n.clientLeft,c.y=f.y+n.clientTop}const h=o&&!d&&!i?YS(o,l,!0):mn(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:r.y*u.y-l.scrollTop*u.y+c.y+h.y}}function nI(t){return Array.from(t.getClientRects())}function sI(t){const e=wn(t),r=$h(t),n=t.ownerDocument.body,s=rr(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=rr(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+ty(t);const a=-r.scrollTop;return Kr(n).direction==="rtl"&&(o+=rr(e.clientWidth,n.clientWidth)-s),{width:s,height:i,x:o,y:a}}function iI(t,e){const r=ar(t),n=wn(t),s=r.visualViewport;let i=n.clientWidth,o=n.clientHeight,a=0,l=0;if(s){i=s.width,o=s.height;const u=Zv();(!u||u&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:i,height:o,x:a,y:l}}const oI=new Set(["absolute","fixed"]);function aI(t,e){const r=Mi(t,!0,e==="fixed"),n=r.top+t.clientTop,s=r.left+t.clientLeft,i=yn(t)?Uo(t):mn(1),o=t.clientWidth*i.x,a=t.clientHeight*i.y,l=s*i.x,u=n*i.y;return{width:o,height:a,x:l,y:u}}function jw(t,e,r){let n;if(e==="viewport")n=iI(t,r);else if(e==="document")n=sI(wn(t));else if(Vr(e))n=aI(e,r);else{const s=GS(t);n={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return Rd(n)}function JS(t,e){const r=zs(t);return r===e||!Vr(r)||da(r)?!1:Kr(r).position==="fixed"||JS(r,e)}function lI(t,e){const r=e.get(t);if(r)return r;let n=au(t,[],!1).filter(a=>Vr(a)&&Pa(a)!=="body"),s=null;const i=Kr(t).position==="fixed";let o=i?zs(t):t;for(;Vr(o)&&!da(o);){const a=Kr(o),l=Xv(o);!l&&a.position==="fixed"&&(s=null),(i?!l&&!s:!l&&a.position==="static"&&!!s&&oI.has(s.position)||Nu(o)&&!l&&JS(t,o))?n=n.filter(c=>c!==o):s=a,o=zs(o)}return e.set(t,n),n}function uI(t){let{element:e,boundary:r,rootBoundary:n,strategy:s}=t;const o=[...r==="clippingAncestors"?Ih(e)?[]:lI(e,this._c):[].concat(r),n],a=o[0],l=o.reduce((u,c)=>{const d=jw(e,c,s);return u.top=rr(d.top,u.top),u.right=Bs(d.right,u.right),u.bottom=Bs(d.bottom,u.bottom),u.left=rr(d.left,u.left),u},jw(e,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function cI(t){const{width:e,height:r}=KS(t);return{width:e,height:r}}function dI(t,e,r){const n=yn(e),s=wn(e),i=r==="fixed",o=Mi(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const l=mn(0);function u(){l.x=ty(s)}if(n||!n&&!i)if((Pa(e)!=="body"||Nu(s))&&(a=$h(e)),n){const f=Mi(e,!0,i,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else s&&u();i&&!n&&s&&u();const c=s&&!n&&!i?YS(s,a):mn(0),d=o.left+a.scrollLeft-l.x-c.x,h=o.top+a.scrollTop-l.y-c.y;return{x:d,y:h,width:o.width,height:o.height}}function Rf(t){return Kr(t).position==="static"}function Nw(t,e){if(!yn(t)||Kr(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return wn(t)===r&&(r=r.ownerDocument.body),r}function QS(t,e){const r=ar(t);if(Ih(t))return r;if(!yn(t)){let s=zs(t);for(;s&&!da(s);){if(Vr(s)&&!Rf(s))return s;s=zs(s)}return r}let n=Nw(t,e);for(;n&&KN(n)&&Rf(n);)n=Nw(n,e);return n&&da(n)&&Rf(n)&&!Xv(n)?r:n||XN(t)||r}const hI=async function(t){const e=this.getOffsetParent||QS,r=this.getDimensions,n=await r(t.floating);return{reference:dI(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function fI(t){return Kr(t).direction==="rtl"}const pI={convertOffsetParentRelativeRectToViewportRelativeRect:rI,getDocumentElement:wn,getClippingRect:uI,getOffsetParent:QS,getElementRects:hI,getClientRects:nI,getDimensions:cI,getScale:Uo,isElement:Vr,isRTL:fI};function XS(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function gI(t,e){let r=null,n;const s=wn(t);function i(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const u=t.getBoundingClientRect(),{left:c,top:d,width:h,height:f}=u;if(a||e(),!h||!f)return;const g=ic(d),p=ic(s.clientWidth-(c+h)),b=ic(s.clientHeight-(d+f)),v=ic(c),_={rootMargin:-g+"px "+-p+"px "+-b+"px "+-v+"px",threshold:rr(0,Bs(1,l))||1};let x=!0;function k(C){const T=C[0].intersectionRatio;if(T!==l){if(!x)return o();T?o(!1,T):n=setTimeout(()=>{o(!1,1e-7)},1e3)}T===1&&!XS(u,t.getBoundingClientRect())&&o(),x=!1}try{r=new IntersectionObserver(k,{..._,root:s.ownerDocument})}catch{r=new IntersectionObserver(k,_)}r.observe(t)}return o(!0),i}function mI(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=ey(t),c=s||i?[...u?au(u):[],...au(e)]:[];
vendor: 9,228 bytes, line 69
69c.forEach(v=>{s&&v.addEventListener("scroll",r,{passive:!0}),i&&v.addEventListener("resize",r)});const d=u&&a?gI(u,r):null;let h=-1,f=null;o&&(f=new ResizeObserver(v=>{let[y]=v;y&&y.target===u&&f&&(f.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var _;(_=f)==null||_.observe(e)})),r()}),u&&!l&&f.observe(u),f.observe(e));let g,p=l?Mi(t):null;l&&b();function b(){const v=Mi(t);p&&!XS(p,v)&&r(),p=v,g=requestAnimationFrame(b)}return r(),()=>{var v;c.forEach(y=>{s&&y.removeEventListener("scroll",r),i&&y.removeEventListener("resize",r)}),d==null||d(),(v=f)==null||v.disconnect(),f=null,l&&cancelAnimationFrame(g)}}const vI=BN,yI=zN,_I=DN,wI=WN,bI=FN,Iw=MN,xI=HN,kI=(t,e,r)=>{const n=new Map,s={platform:pI,...r},i={...s.platform,_c:n};return LN(t,e,{...s,platform:i})};var SI=typeof document<"u",EI=function(){},Hc=SI?w.useLayoutEffect:EI;function Ad(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!Ad(t[n],e[n]))return!1;return!0}if(s=Object.keys(t),r=s.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,s[n]))return!1;for(n=r;n--!==0;){const i=s[n];if(!(i==="_owner"&&t.$$typeof)&&!Ad(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function ZS(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function $w(t,e){const r=ZS(t);return Math.round(e*r)/r}function Af(t){const e=w.useRef(t);return Hc(()=>{e.current=t}),e}function CI(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:i,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=t,[c,d]=w.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[h,f]=w.useState(n);Ad(h,n)||f(n);const[g,p]=w.useState(null),[b,v]=w.useState(null),y=w.useCallback(j=>{j!==C.current&&(C.current=j,p(j))},[]),_=w.useCallback(j=>{j!==T.current&&(T.current=j,v(j))},[]),x=i||g,k=o||b,C=w.useRef(null),T=w.useRef(null),S=w.useRef(c),P=l!=null,R=Af(l),I=Af(s),N=Af(u),B=w.useCallback(()=>{if(!C.current||!T.current)return;const j={placement:e,strategy:r,middleware:h};I.current&&(j.platform=I.current),kI(C.current,T.current,j).then(A=>{const M={...A,isPositioned:N.current!==!1};q.current&&!Ad(S.current,M)&&(S.current=M,Ah.flushSync(()=>{d(M)}))})},[h,e,r,I,N]);Hc(()=>{u===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,d(j=>({...j,isPositioned:!1})))},[u]);const q=w.useRef(!1);Hc(()=>(q.current=!0,()=>{q.current=!1}),[]),Hc(()=>{if(x&&(C.current=x),k&&(T.current=k),x&&k){if(R.current)return R.current(x,k,B);B()}},[x,k,B,R,P]);const ee=w.useMemo(()=>({reference:C,floating:T,setReference:y,setFloating:_}),[y,_]),$=w.useMemo(()=>({reference:x,floating:k}),[x,k]),W=w.useMemo(()=>{const j={position:r,left:0,top:0};if(!$.floating)return j;const A=$w($.floating,c.x),M=$w($.floating,c.y);return a?{...j,transform:"translate("+A+"px, "+M+"px)",...ZS($.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:A,top:M}},[r,a,$.floating,c.x,c.y]);return w.useMemo(()=>({...c,update:B,refs:ee,elements:$,floatingStyles:W}),[c,B,ee,$,W])}const TI=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:s}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?Iw({element:n.current,padding:s}).fn(r):{}:n?Iw({element:n,padding:s}).fn(r):{}}}},PI=(t,e)=>({...vI(t),options:[t,e]}),RI=(t,e)=>({...yI(t),options:[t,e]}),AI=(t,e)=>({...xI(t),options:[t,e]}),OI=(t,e)=>({..._I(t),options:[t,e]}),jI=(t,e)=>({...wI(t),options:[t,e]}),NI=(t,e)=>({...bI(t),options:[t,e]}),II=(t,e)=>({...TI(t),options:[t,e]});var $I="Arrow",eE=w.forwardRef((t,e)=>{const{children:r,width:n=10,height:s=5,...i}=t;return m.jsx(vt.svg,{...i,ref:e,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:m.jsx("polygon",{points:"0,0 30,0 15,10"})})});eE.displayName=$I;var LI=eE;function MI(t){const[e,r]=w.useState(void 0);return Us(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,a;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,a=u.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}var ry="Popper",[tE,Lh]=Ca(ry),[DI,rE]=tE(ry),nE=t=>{const{__scopePopper:e,children:r}=t,[n,s]=w.useState(null);return m.jsx(DI,{scope:e,anchor:n,onAnchorChange:s,children:r})};nE.displayName=ry;var sE="PopperAnchor",iE=w.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...s}=t,i=rE(sE,r),o=w.useRef(null),a=Ct(e,o);return w.useEffect(()=>{i.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:m.jsx(vt.div,{...s,ref:a})});iE.displayName=sE;var ny="PopperContent",[FI,UI]=tE(ny),oE=w.forwardRef((t,e)=>{var ie,Le,Ce,Tt,Jr,Pt;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:f="optimized",onPlaced:g,...p}=t,b=rE(ny,r),[v,y]=w.useState(null),_=Ct(e,Qr=>y(Qr)),[x,k]=w.useState(null),C=MI(x),T=(C==null?void 0:C.width)??0,S=(C==null?void 0:C.height)??0,P=n+(i!=="center"?"-"+i:""),R=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},I=Array.isArray(u)?u:[u],N=I.length>0,B={padding:R,boundary:I.filter(zI),altBoundary:N},{refs:q,floatingStyles:ee,placement:$,isPositioned:W,middlewareData:j}=CI({strategy:"fixed",placement:P,whileElementsMounted:(...Qr)=>mI(...Qr,{animationFrame:f==="always"}),elements:{reference:b.anchor},middleware:[PI({mainAxis:s+S,alignmentAxis:o}),l&&RI({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?AI():void 0,...B}),l&&OI({...B}),jI({...B,apply:({elements:Qr,rects:Wi,availableWidth:Ia,availableHeight:Zt})=>{const{width:$a,height:Xn}=Wi.reference,Xr=Qr.floating.style;Xr.setProperty("--radix-popper-available-width",`${Ia}px`),Xr.setProperty("--radix-popper-available-height",`${Zt}px`),Xr.setProperty("--radix-popper-anchor-width",`${$a}px`),Xr.setProperty("--radix-popper-anchor-height",`${Xn}px`)}}),x&&II({element:x,padding:a}),HI({arrowWidth:T,arrowHeight:S}),h&&NI({strategy:"referenceHidden",...B})]}),[A,M]=uE($),G=Kn(g);Us(()=>{W&&(G==null||G())},[W,G]);const V=(ie=j.arrow)==null?void 0:ie.x,Q=(Le=j.arrow)==null?void 0:Le.y,Z=((Ce=j.arrow)==null?void 0:Ce.centerOffset)!==0,[oe,ve]=w.useState();return Us(()=>{v&&ve(window.getComputedStyle(v).zIndex)},[v]),m.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...ee,transform:W?ee.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[(Tt=j.transformOrigin)==null?void 0:Tt.x,(Jr=j.transformOrigin)==null?void 0:Jr.y].join(" "),...((Pt=j.hide)==null?void 0:Pt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:m.jsx(FI,{scope:r,placedSide:A,onArrowChange:k,arrowX:V,arrowY:Q,shouldHideArrow:Z,children:m.jsx(vt.div,{"data-side":A,"data-align":M,...p,ref:_,style:{...p.style,animation:W?void 0:"none"}})})})});oE.displayName=ny;var aE="PopperArrow",BI={top:"bottom",right:"left",bottom:"top",left:"right"},lE=w.forwardRef(function(e,r){const{__scopePopper:n,...s}=e,i=UI(aE,n),o=BI[i.placedSide];return m.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:m.jsx(LI,{...s,ref:r,style:{...s.style,display:"block"}})})});lE.displayName=aE;function zI(t){return t!==null}var HI=t=>({name:"transformOrigin",options:t,fn(e){var b,v,y;const{placement:r,rects:n,middlewareData:s}=e,o=((b=s.arrow)==null?void 0:b.centerOffset)!==0,a=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[u,c]=uE(r),d={start:"0%",center:"50%",end:"100%"}[c],h=(((v=s.arrow)==null?void 0:v.x)??0)+a/2,f=(((y=s.arrow)==null?void 0:y.y)??0)+l/2;let g="",p="";return u==="bottom"?(g=o?d:`${h}px`,p=`${-l}px`):u==="top"?(g=o?d:`${h}px`,p=`${n.floating.height+l}px`):u==="right"?(g=`${-l}px`,p=o?d:`${f}px`):u==="left"&&(g=`${n.floating.width+l}px`,p=o?d:`${f}px`),{data:{x:g,y:p}}}});function uE(t){const[e,r="center"]=t.split("-");return[e,r]}var WI=nE,cE=iE,dE=oE,hE=lE,qI="Portal",fE=w.forwardRef((t,e)=>{var a;const{container:r,...n}=t,[s,i]=w.useState(!1);Us(()=>i(!0),[]);const o=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?fS.createPortal(m.jsx(vt.div,{...n,ref:e}),o):null});fE.displayName=qI;function VI(t,e){return w.useReducer((r,n)=>e[r][n]??r,t)}var Ra=t=>{const{present:e,children:r}=t,n=KI(e),s=typeof r=="function"?r({present:n.isPresent}):w.Children.only(r),i=Ct(n.ref,GI(s));return typeof r=="function"||n.isPresent?w.cloneElement(s,{ref:i}
vendor: 5,349 bytes, line 69
69):null};Ra.displayName="Presence";function KI(t){const[e,r]=w.useState(),n=w.useRef(null),s=w.useRef(t),i=w.useRef("none"),o=t?"mounted":"unmounted",[a,l]=VI(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const u=oc(n.current);i.current=a==="mounted"?u:"none"},[a]),Us(()=>{const u=n.current,c=s.current;if(c!==t){const h=i.current,f=oc(u);t?l("MOUNT"):f==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&h!==f?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,l]),Us(()=>{if(e){let u;const c=e.ownerDocument.defaultView??window,d=f=>{const p=oc(n.current).includes(f.animationName);if(f.target===e&&p&&(l("ANIMATION_END"),!s.current)){const b=e.style.animationFillMode;e.style.animationFillMode="forwards",u=c.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=b)})}},h=f=>{f.target===e&&(i.current=oc(n.current))};return e.addEventListener("animationstart",h),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{c.clearTimeout(u),e.removeEventListener("animationstart",h),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:w.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function oc(t){return(t==null?void 0:t.animationName)||"none"}function GI(t){var n,s;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var YI=Ym[" useInsertionEffect ".trim().toString()]||Us;function pE({prop:t,defaultProp:e,onChange:r=()=>{},caller:n}){const[s,i,o]=JI({defaultProp:e,onChange:r}),a=t!==void 0,l=a?t:s;{const c=w.useRef(t!==void 0);w.useEffect(()=>{const d=c.current;d!==a&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),c.current=a},[a,n])}const u=w.useCallback(c=>{var d;if(a){const h=QI(c)?c(t):c;h!==t&&((d=o.current)==null||d.call(o,h))}else i(c)},[a,t,i,o]);return[l,u]}function JI({defaultProp:t,onChange:e}){const[r,n]=w.useState(t),s=w.useRef(r),i=w.useRef(e);return YI(()=>{i.current=e},[e]),w.useEffect(()=>{var o;s.current!==r&&((o=i.current)==null||o.call(i,r),s.current=r)},[r,s]),[r,n,i]}function QI(t){return typeof t=="function"}var XI=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ZI="VisuallyHidden",gE=w.forwardRef((t,e)=>m.jsx(vt.span,{...t,ref:e,style:{...XI,...t.style}}));gE.displayName=ZI;var e2=gE,[Mh]=Ca("Tooltip",[Lh]),sy=Lh(),mE="TooltipProvider",t2=700,Lw="tooltip.open",[r2,vE]=Mh(mE),yE=t=>{const{__scopeTooltip:e,delayDuration:r=t2,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:i}=t,o=w.useRef(!0),a=w.useRef(!1),l=w.useRef(0);return w.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),m.jsx(r2,{scope:e,isOpenDelayedRef:o,delayDuration:r,onOpen:w.useCallback(()=>{window.clearTimeout(l.current),o.current=!1},[]),onClose:w.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:w.useCallback(u=>{a.current=u},[]),disableHoverableContent:s,children:i})};yE.displayName=mE;var _E="Tooltip",[W5,Dh]=Mh(_E),Ig="TooltipTrigger",n2=w.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,s=Dh(Ig,r),i=vE(Ig,r),o=sy(r),a=w.useRef(null),l=Ct(e,a,s.onTriggerChange),u=w.useRef(!1),c=w.useRef(!1),d=w.useCallback(()=>u.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),m.jsx(cE,{asChild:!0,...o,children:m.jsx(vt.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:l,onPointerMove:he(t.onPointerMove,h=>{h.pointerType!=="touch"&&!c.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),c.current=!0)}),onPointerLeave:he(t.onPointerLeave,()=>{s.onTriggerLeave(),c.current=!1}),onPointerDown:he(t.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:he(t.onFocus,()=>{u.current||s.onOpen()}),onBlur:he(t.onBlur,s.onClose),onClick:he(t.onClick,s.onClose)})})});n2.displayName=Ig;var s2="TooltipPortal",[q5,i2]=Mh(s2,{forceMount:void 0}),ha="TooltipContent",wE=w.forwardRef((t,e)=>{const r=i2(ha,t.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...i}=t,o=Dh(ha,t.__scopeTooltip);return m.jsx(Ra,{present:n||o.open,children:o.disableHoverableContent?m.jsx(bE,{side:s,...i,ref:e}):m.jsx(o2,{side:s,...i,ref:e})})}),o2=w.forwardRef((t,e)=>{const r=Dh(ha,t.__scopeTooltip),n=vE(ha,t.__scopeTooltip),s=w.useRef(null),i=Ct(e,s),[o,a]=w.useState(null),{trigger:l,onClose:u}=r,c=s.current,{onPointerInTransitChange:d}=n,h=w.useCallback(()=>{a(null),d(!1)},[d]),f=w.useCallback((g,p)=>{const b=g.currentTarget,v={x:g.clientX,y:g.clientY}
vendor: 4,234 bytes, line 69
69,y=d2(v,b.getBoundingClientRect()),_=h2(v,y),x=f2(p.getBoundingClientRect()),k=g2([..._,...x]);a(k),d(!0)},[d]);return w.useEffect(()=>()=>h(),[h]),w.useEffect(()=>{if(l&&c){const g=b=>f(b,c),p=b=>f(b,l);return l.addEventListener("pointerleave",g),c.addEventListener("pointerleave",p),()=>{l.removeEventListener("pointerleave",g),c.removeEventListener("pointerleave",p)}}},[l,c,f,h]),w.useEffect(()=>{if(o){const g=p=>{const b=p.target,v={x:p.clientX,y:p.clientY},y=(l==null?void 0:l.contains(b))||(c==null?void 0:c.contains(b)),_=!p2(v,o);y?h():_&&(h(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,c,o,u,h]),m.jsx(bE,{...t,ref:i})}),[a2,l2]=Mh(_E,{isInside:!1}),u2=cN("TooltipContent"),bE=w.forwardRef((t,e)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=t,l=Dh(ha,r),u=sy(r),{onClose:c}=l;return w.useEffect(()=>(document.addEventListener(Lw,c),()=>document.removeEventListener(Lw,c)),[c]),w.useEffect(()=>{if(l.trigger){const d=h=>{const f=h.target;f!=null&&f.contains(l.trigger)&&c()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,c]),m.jsx(Gv,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:m.jsxs(dE,{"data-state":l.stateAttribute,...u,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[m.jsx(u2,{children:n}),m.jsx(a2,{scope:r,isInside:!0,children:m.jsx(e2,{id:l.contentId,role:"tooltip",children:s||n})})]})})});wE.displayName=ha;var xE="TooltipArrow",c2=w.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,s=sy(r);return l2(xE,r).isInside?null:m.jsx(hE,{...s,...n,ref:e})});c2.displayName=xE;function d2(t,e){const r=Math.abs(e.top-t.y),n=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(r,n,s,i)){case i:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function h2(t,e,r=5){const n=[];switch(e){case"top":n.push({x:t.x-r,y:t.y+r},{x:t.x+r,y:t.y+r});break;case"bottom":n.push({x:t.x-r,y:t.y-r},{x:t.x+r,y:t.y-r});break;case"left":n.push({x:t.x+r,y:t.y-r},{x:t.x+r,y:t.y+r});break;case"right":n.push({x:t.x-r,y:t.y-r},{x:t.x-r,y:t.y+r});break}return n}function f2(t){const{top:e,right:r,bottom:n,left:s}=t;return[{x:s,y:e},{x:r,y:e},{x:r,y:n},{x:s,y:n}]}function p2(t,e){const{x:r,y:n}=t;let s=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const a=e[i],l=e[o],u=a.x,c=a.y,d=l.x,h=l.y;c>n!=h>n&&r<(d-u)*(n-c)/(h-c)+u&&(s=!s)}return s}function g2(t){const e=t.slice();return e.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),m2(e)}function m2(t){if(t.length<=1)return t.slice();const e=[];for(let n=0;n<t.length;n++){const s=t[n];for(;e.length>=2;){const i=e[e.length-1],o=e[e.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))e.pop();else break}e.push(s)}e.pop();const r=[];for(let n=t.length-1;n>=0;n--){const s=t[n];for(;r.length>=2;){const i=r[r.length-1],o=r[r.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))r.pop();else break}r.push(s)}return r.pop(),e.length===1&&r.length===1&&e[0].x===r[0].x&&e[0].y===r[0].y?e:e.concat(r)}var v2=yE,kE=wE;function SE(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(r=SE(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function EE(){for(var t,e,r=0,n="",s=arguments.length;r<s;r++)(t=arguments[r])&&(e=SE(t))&&(n&&(n+=" "),n+=e);return n}const iy="-",y2=t=>{const e=w2(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:o=>{const a=o.split(iy);return a[0]===""&&a.length!==1&&a.shift(),CE(a,e)||_2(o)},getConflictingClassGroupIds:(o,a)=>
vendor: 11,986 bytes, line 69
69{const l=r[o]||[];return a&&n[o]?[...l,...n[o]]:l}}},CE=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const r=t[0],n=e.nextPart.get(r),s=n?CE(t.slice(1),n):void 0;if(s)return s;if(e.validators.length===0)return;const i=t.join(iy);return(o=e.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},Mw=/^\[(.+)\]$/,_2=t=>{if(Mw.test(t)){const e=Mw.exec(t)[1],r=e==null?void 0:e.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},w2=t=>{const{theme:e,prefix:r}=t,n={nextPart:new Map,validators:[]};return x2(Object.entries(t.classGroups),r).forEach(([i,o])=>{$g(o,n,i,e)}),n},$g=(t,e,r,n)=>{t.forEach(s=>{if(typeof s=="string"){const i=s===""?e:Dw(e,s);i.classGroupId=r;return}if(typeof s=="function"){if(b2(s)){$g(s(n),e,r,n);return}e.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,o])=>{$g(o,Dw(e,i),r,n)})})},Dw=(t,e)=>{let r=t;return e.split(iy).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},b2=t=>t.isThemeGetter,x2=(t,e)=>e?t.map(([r,n])=>{const s=n.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[e+o,a])):i);return[r,s]}):t,k2=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,n=new Map;const s=(i,o)=>{r.set(i,o),e++,e>t&&(e=0,n=r,r=new Map)};return{get(i){let o=r.get(i);if(o!==void 0)return o;if((o=n.get(i))!==void 0)return s(i,o),o},set(i,o){r.has(i)?r.set(i,o):s(i,o)}}},TE="!",S2=t=>{const{separator:e,experimentalParseClassName:r}=t,n=e.length===1,s=e[0],i=e.length,o=a=>{const l=[];let u=0,c=0,d;for(let b=0;b<a.length;b++){let v=a[b];if(u===0){if(v===s&&(n||a.slice(b,b+i)===e)){l.push(a.slice(c,b)),c=b+i;continue}if(v==="/"){d=b;continue}}v==="["?u++:v==="]"&&u--}const h=l.length===0?a:a.substring(c),f=h.startsWith(TE),g=f?h.substring(1):h,p=d&&d>c?d-c:void 0;return{modifiers:l,hasImportantModifier:f,baseClassName:g,maybePostfixModifierPosition:p}};return r?a=>r({className:a,parseClassName:o}):o},E2=t=>{if(t.length<=1)return t;const e=[];let r=[];return t.forEach(n=>{n[0]==="["?(e.push(...r.sort(),n),r=[]):r.push(n)}),e.push(...r.sort()),e},C2=t=>({cache:k2(t.cacheSize),parseClassName:S2(t),...y2(t)}),T2=/\s+/,P2=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=e,i=[],o=t.trim().split(T2);let a="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:c,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:f}=r(u);let g=!!f,p=n(g?h.substring(0,f):h);if(!p){if(!g){a=u+(a.length>0?" "+a:a);continue}if(p=n(h),!p){a=u+(a.length>0?" "+a:a);continue}g=!1}const b=E2(c).join(":"),v=d?b+TE:b,y=v+p;if(i.includes(y))continue;i.push(y);const _=s(p,g);for(let x=0;x<_.length;++x){const k=_[x];i.push(v+k)}a=u+(a.length>0?" "+a:a)}return a};function R2(){let t=0,e,r,n="";for(;t<arguments.length;)(e=arguments[t++])&&(r=PE(e))&&(n&&(n+=" "),n+=r);return n}const PE=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=PE(t[n]))&&(r&&(r+=" "),r+=e);return r};function A2(t,...e){let r,n,s,i=o;function o(l){const u=e.reduce((c,d)=>d(c),t());return r=C2(u),n=r.cache.get,s=r.cache.set,i=a,a(l)}function a(l){const u=n(l);if(u)return u;const c=P2(l,r);return s(l,c),c}return function(){return i(R2.apply(null,arguments))}}const Ae=t=>{const e=r=>r[t]||[];return e.isThemeGetter=!0,e},RE=/^\[(?:([a-z-]+):)?(.+)\]$/i,O2=/^\d+\/\d+$/,j2=new Set(["px","full","screen"]),N2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,I2=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,$2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,L2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,M2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,bn=t=>Bo(t)||j2.has(t)||O2.test(t),ss=t=>Aa(t,"length",q2),Bo=t=>!!t&&!Number.isNaN(Number(t)),Of=t=>Aa(t,"number",Bo),Va=t=>!!t&&Number.isInteger(Number(t)),D2=t=>t.endsWith("%")&&Bo(t.slice(0,-1)),ue=t=>RE.test(t),is=t=>N2.test(t),F2=new Set(["length","size","percentage"]),U2=t=>Aa(t,F2,AE),B2=t=>Aa(t,"position",AE),z2=new Set(["image","url"]),H2=t=>Aa(t,z2,K2),W2=t=>Aa(t,"",V2),Ka=()=>!0,Aa=(t,e,r)=>{const n=RE.exec(t);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):r(n[2]):!1},q2=t=>I2.test(t)&&!$2.test(t),AE=()=>!1,V2=t=>L2.test(t),K2=t=>M2.test(t),G2=()=>{const t=Ae("colors"),e=Ae("spacing"),r=Ae("blur"),n=Ae("brightness"),s=Ae("borderColor"),i=Ae("borderRadius"),o=Ae("borderSpacing"),a=Ae("borderWidth"),l=Ae("contrast"),u=Ae("grayscale"),c=Ae("hueRotate"),d=Ae("invert"),h=Ae("gap"),f=Ae("gradientColorStops"),g=Ae("gradientColorStopPositions"),p=Ae("inset"),b=Ae("margin"),v=Ae("opacity"),y=Ae("padding"),_=Ae("saturate"),x=Ae("scale"),k=Ae("sepia"),C=Ae("skew"),T=Ae("space"),S=Ae("translate"),P=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",ue,e],N=()=>[ue,e],B=()=>["",bn,ss],q=()=>["auto",Bo,ue],ee=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],j=()=>["start","end","center","between","around","evenly","stretch"],A=()=>["","0",ue],M=()=>["auto","avoid","all","avoid-page","page","left","right","column"],G=()=>[Bo,ue];return{cacheSize:500,separator:":",theme:{colors:[Ka],spacing:[bn,ss],blur:["none","",is,ue],brightness:G(),borderColor:[t],borderRadius:["none","","full",is,ue],borderSpacing:N(),borderWidth:B(),contrast:G(),grayscale:A(),hueRotate:G(),invert:A(),gap:N(),gradientColorStops:[t],gradientColorStopPositions:[D2,ss],inset:I(),margin:I(),opacity:G(),padding:N(),saturate:G(),scale:G(),sepia:A(),skew:G(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",ue]}],container:["container"],columns:[{columns:[is]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ee(),ue]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Va,ue]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ue]}],grow:[{grow:A()}],shrink:[{shrink:A()}],order:[{order:["first","last","none",Va,ue]}],"grid-cols":[{"grid-cols":[Ka]}],"col-start-end":[{col:["auto",{span:["full",Va,ue]},ue]}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":[Ka]}],"row-start-end":[{row:["auto",{span:[Va,ue]},ue]}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ue]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ue]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...j()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...j(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...j(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ue,e]}],"min-w":[{"min-w":[ue,e,"min","max","fit"]}],"max-w":[{"max-w":[ue,e,"none","full","min","max","fit","prose",{screen:[is]},is]}],h:[{h:[ue,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ue,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ue,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ue,e,"auto","min","max","fit"]}],"font-size":[{text:["base",is,ss]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Of]}],"font-family":[{font:[Ka]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ue]}],"line-clamp":[{"line-clamp":["none",Bo,Of]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",bn,ue]}],"list-image":[{"list-image":["none",ue]}],"list-style-type":[{list:["none","disc","decimal",ue]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",bn,ss]}],"underline-offset":[{"underline-offset":["auto",bn,ue]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ue]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ee(),B2]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",U2]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},H2]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[g]}
vendor: 5,180 bytes, line 69
69],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...$(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:$()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[bn,ue]}],"outline-w":[{outline:[bn,ss]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[bn,ss]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",is,W2]}],"shadow-color":[{shadow:[Ka]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",is,ue]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[_]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ue]}],duration:[{duration:G()}],ease:[{ease:["linear","in","out","in-out",ue]}],delay:[{delay:G()}],animate:[{animate:["none","spin","ping","pulse","bounce",ue]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Va,ue]}],"translate-x":[{"translate-x":[S]}],"translate-y":[{"translate-y":[S]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ue]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ue]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
69],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ue]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[bn,ss,Of]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Y2=A2(G2);function Yr(...t){return Y2(EE(t))}const J2=v2,Q2=w.forwardRef(({className:t,sideOffset:e=4,...r},n)=>m.jsx(kE,{ref:n,sideOffset:e,className:Yr("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r}));Q2.displayName=kE.displayName;var cn=function(){return cn=Object.assign||function(e){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},cn.apply(this,arguments)};function Oa(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]]);return r}function X2(t,e,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function a(c){try{u(n.next(c))}catch(d){o(d)}}function l(c){try{u(n.throw(c))}catch(d){o(d)}}function u(c){c.done?i(c.value):s(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})}function Z2(t,e,r){if(r||arguments.length===2)for(var n=0,s=e.length,i;n<s;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))}const e$=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);
69class oy extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class t$ extends oy{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class Fw extends oy{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class Uw extends oy{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var Lg;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(Lg||(Lg={}));class r${constructor(e,{headers:r={},customFetch:n,region:s=Lg.Any}={}){this.url=e,this.headers=r,this.region=s,this.fetch=e$(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return X2(this,arguments,void 0,function*(r,n={}){var s;let i,o;try{const{headers:a,method:l,body:u,signal:c,timeout:d}=n;let h={},{region:f}=n;f||(f=this.region);const g=new URL(`${this.url}/${r}`);f&&f!=="any"&&(h["x-region"]=f,g.searchParams.set("forceFunctionRegion",f));let p;u&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(h["Content-Type"]="application/octet-stream",p=u):typeof u=="string"?(h["Content-Type"]="text/plain",p=u):typeof FormData<"u"&&u instanceof FormData?p=u:(h["Content-Type"]="application/json",p=JSON.stringify(u)):u&&typeof u!="string"&&!(typeof Blob<"u"&&u instanceof Blob)&&!(u instanceof ArrayBuffer)&&!(typeof FormData<"u"&&u instanceof FormData)?p=JSON.stringify(u):p=u;let b=c;d&&(o=new AbortController,i=setTimeout(()=>o.abort(),d),c?(b=o.signal,c.addEventListener("abort",()=>o.abort())):b=o.signal);const v=yield this.fetch(g.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},h),this.headers),a),body:p,signal:b}).catch(k=>{throw new t$(k)}),y=v.headers.get("x-relay-error");if(y&&y==="true")throw new Fw(v);if(!v.ok)throw new Uw(v);let _=((s=v.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),x;return _==="application/json"?x=yield v.json():_==="application/octet-stream"||_==="application/pdf"?x=yield v.blob():_==="text/event-stream"?x=v:_==="multipart/form-data"?x=yield v.formData():x=yield v.text(),{data:x,error:null,response:v}}catch(a){return{data:null,error:a,response:a instanceof Uw||a instanceof Fw?a.context:void 0}}finally{i&&clearTimeout(i)}})}}const OE=3,Bw=t=>Math.min(1e3*2**t,3e4),n$=[520,503],jE=["GET","HEAD","OPTIONS"];var s$=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.co
69de=t.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function zw(t,e){return new Promise(r=>{if(e!=null&&e.aborted){r();return}const n=setTimeout(()=>{e==null||e.removeEventListener("abort",s),r()},t);function s(){clearTimeout(n),r()}e==null||e.addEventListener("abort",s)})}function i$(t,e,r,n){return!(!n||r>=OE||!jE.includes(t)||!n$.includes(e))}var o$=class{constructor(t){var e,r,n,s,i;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(e=t.shouldThrowOnError)!==null&&e!==void 0?e:!1,this.signal=t.signal,this.isMaybeSingle=(r=t.isMaybeSingle)!==null&&r!==void 0?r:!1,this.shouldStripNulls=(n=t.shouldStripNulls)!==null&&n!==void 0?n:!1,this.urlLengthLimit=(s=t.urlLengthLimit)!==null&&s!==void 0?s:8e3,this.retryEnabled=(i=t.retry)!==null&&i!==void 0?i:!0,t.fetch?this.fetch=t.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(t,e){return this.headers=new Headers(this.headers),this.headers.set(t,e),this}retry(t){return this.retryEnabled=t,this}then(t,e){var r=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const o=this.headers.get("Accept");o==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!o||o==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const n=this.fetch;let i=(async()=>{let o=0;for(;;){const u=new Headers(r.headers);o>0&&u.set("X-Retry-Count",String(o));let c;try{c=await n(r.url.toString(),{method:r.method,headers:u,body:JSON.stringify(r.body),signal:r.signal})}catch(d){if((d==null?void 0:d.name)==="AbortError"||(d==null?void 0:d.code)==="ABORT_ERR"||!jE.includes(r.method))throw d;if(r.retryEnabled&&o<OE){const h=Bw(o);o++,await zw(h,r.signal);continue}throw d}if(i$(r.method,c.status,o,r.retryEnabled)){var a,l;const d=(a=(l=c.headers)===null||l===void 0?void 0:l.get("Retry-After"))!==null&&a!==void 0?a:null,h=d!==null?Math.max(0,parseInt(d,10)||0)*1e3:Bw(o);await c.text(),o++,await zw(h,r.signal);continue}return await r.processResponse(c)}})();return this.shouldThrowOnError||(i=i.catch(o=>{var a;let l="",u="",c="";const d=o==null?void 0:o.cause;if(d){var h,f,g,p;const y=(h=d==null?void 0:d.message)!==null&&h!==void 0?h:"",_=(f=d==null?void 0:d.code)!==null&&f!==void 0?f:"";l=`${(g=o==null?void 0:o.name)!==null&&g!==void 0?g:"FetchError"}: ${o==null?void 0:o.message}`,l+=`
70
71Caused by: ${(p=d==null?void 0:d.name)!==null&&p!==void 0?p:"Error"}: ${y}`,_&&(l+=` (${_})`),d!=null&&d.stack&&(l+=`
72${d.stack}`)}else{var b;l=(b=o==null?void 0:o.stack)!==null&&b!==void 0?b:""}const v=this.url.toString().length;return(o==null?void 0:o.name)==="AbortError"||(o==null?void 0:o.code)==="ABORT_ERR"?(c="",u="Request was aborted (timeout or manual cancellation)",v>this.urlLengthLimit&&(u+=`. Note: Your request URL is ${v} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((d==null?void 0:d.name)==="HeadersOverflowError"||(d==null?void 0:d.code)==="UND_ERR_HEADERS_OVERFLOW")&&(c="",u="HTTP headers exceeded server limits (typically 16KB)",v>this.urlLengthLimit&&(u+=`. Your request URL is ${v} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(a=o==null?void 0:o.name)!==null&&a!==void 0?a:"FetchError"}: ${o==null?void 0:o.message}`,details:l,hint:u,code:c},data:null,count:null,status:0,statusText:""}}
72)),i.then(t,e)}async processResponse(t){var e=this;let r=null,n=null,s=null,i=t.status,o=t.statusText;if(t.ok){var a,l;if(e.method!=="HEAD"){var u;const h=await t.text();h===""||(e.headers.get("Accept")==="text/csv"||e.headers.get("Accept")&&(!((u=e.headers.get("Accept"))===null||u===void 0)&&u.includes("application/vnd.pgrst.plan+text"))?n=h:n=JSON.parse(h))}const c=(a=e.headers.get("Prefer"))===null||a===void 0?void 0:a.match(/count=(exact|planned|estimated)/),d=(l=t.headers.get("content-range"))===null||l===void 0?void 0:l.split("/");c&&d&&d.length>1&&(s=parseInt(d[1])),e.isMaybeSingle&&Array.isArray(n)&&(n.length>1?(r={code:"PGRST116",details:`Results contain ${n.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},n=null,s=null,i=406,o="Not Acceptable"):n.length===1?n=n[0]:n=null)}else{const c=await t.text();try{r=JSON.parse(c),Array.isArray(r)&&t.status===404&&(n=[],r=null,i=200,o="OK")}catch{t.status===404&&c===""?(i=204,o="No Content"):r={message:c}}if(r&&e.shouldThrowOnError)throw new s$(r)}return{success:r===null,error:r,data:n,count:s,status:i,statusText:o}}returns(){return this}overrideTypes(){return this}},a$=class extends o${select(t){let e=!1;const r=(t??"*").split("").map(n=>/\s/.test(n)&&!e?"":(n==='"'&&(e=!e),n)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:e=!0,nullsFirst:r,foreignTable:n,referencedTable:s=n}={}){const i=s?`${s}.order`:"order",o=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${o?`${o},`:""}${t}.${e?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:e,referencedTable:r=e}={}){const n=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${t}`),this}range(t,e,{foreignTable:r,referencedTable:n=r}={}){const s=typeof n>"u"?"offset":`${n}.offset`,i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(s,`${t}`),this.url.searchParams.set(i,`${e-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:t=!1,verbose:e=!1,settings:r=!1,buffers:n=!1,wal:s=!1,format:i="text"}={}){var o;const a=[t?"analyze":null,e?"verbose":null,r?"settings":null,n?"buffers":null,s?"wal":null].filter(Boolean).join("|"),l=(o=this.headers.get("Accept"))!==null&&o!==void 0?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${l}"; options=${a};`),i==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}};const Hw=new RegExp("[,()]");var co=class extends a${eq(t,e){return this.url.searchParams.append(t,`eq.${e}`),this}neq(t,e){return this.url.searchParams.append(t,`neq.${e}`),this}gt(t,e){return this.url.searchParams.append(t,`gt.${e}`),this}gte(t,e){return this.url.searchParams.append(t,`gte.${e}`),this}lt(t,e){return this.url.searchParams.append(t,`lt.${e}`),this}lte(t,e){return this.url.searchParams.append(t,`lte.${e}`),this}like(t,e){return this.url.searchParams.append(t,`like.${e}`),this}likeAllOf(t,e){return this.url.searchParams.append(t,`like(all).{${e.join(",")}}`),this}likeAnyOf(t,e){return this.url.searchParams.append(t,`like(any).{${e.join(",")}}`),this}ilike(t,e){return this.url.searchParams.append(t,`ilike.${e}`),this}ilikeAllOf(t,e){return this.url.searchParams.append(t,`ilike(all).{${e.join(",")}}`),this}ilikeAnyOf(t,e){return this.url.searchParams.append(t,`ilike(any).{${e.join(",")}}`),this}regexMatch(t,e){return this.url.searchParams.append(t,`match.${e}`),this}regexIMatch(t,e){return this.url.searchParams.append(t,`imatch.${e}`),this}is(t,e){return this.url.searchParams.append(t,`is.${e}`),this}isDistinct(t,e){return this.url.searchParams.append(t,`isdistinct.${e}`),this}in(t,e){const r=Array.from(new Set(e)).map(n=>typeof n=="string"&&Hw.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(t,`in.(${r})`),this}notIn(t,e){const r=Array.from(new Set(e)).map(n=>typeof n=="string"&&Hw.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(t,`not.in.(${r})`),this}contains(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cs.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cs.{${e.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(e)}`),this}containedBy(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cd.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cd.{${e.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(e)}`),this}rangeGt(t,e){return this.url.searchParams.append(t,`sr.${e}`),this}rangeGte(t,e){return this.url.searchParams.append(t,`nxl.${e}`),this}rangeLt(t,e){return this.url.searchParams.append(t,`sl.${e}`),this}rangeLte(t,e){return this.url.searchParams.append(t,`nxr.${e}`),this}rangeAdjacent(t,e){return this.url.searchParams.append(t,`adj.${e}`),this}overlaps(t,e){return typeof e=="string"?this.url.searchParams.append(t,`ov.${e}`):this.url.searchParams.append(t,`ov.{${e.join(",")}}`),this}textSearch(t,e,{config:r,type:n}={}){let s="";n==="plain"?s="pl":n==="phrase"?s="ph":n==="websearch"&&(s="w");const i=r===void 0?"":`(${r})`;return this.url.searchParams.append(t,`${s}fts${i}.${e}`),this}match(t){return Object.entries(t).filter(([e,r])=>
72r!==void 0).forEach(([e,r])=>{this.url.searchParams.append(e,`eq.${r}`)}),this}not(t,e,r){return this.url.searchParams.append(t,`not.${e}.${r}`),this}or(t,{foreignTable:e,referencedTable:r=e}={}){const n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${t})`),this}filter(t,e,r){return this.url.searchParams.append(t,`${e}.${r}`),this}},l$=class{constructor(t,{headers:e={},schema:r,fetch:n,urlLengthLimit:s=8e3,retry:i}){this.url=t,this.headers=new Headers(e),this.schema=r,this.fetch=n,this.urlLengthLimit=s,this.retry=i}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(t,e){const{head:r=!1,count:n}=e??{},s=r?"HEAD":"GET";let i=!1;const o=(t??"*").split("").map(u=>/\s/.test(u)&&!i?"":(u==='"'&&(i=!i),u)).join(""),{url:a,headers:l}=this.cloneRequestState();return a.searchParams.set("select",o),n&&l.append("Prefer",`count=${n}`),new co({method:s,url:a,headers:l,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(t,{count:e,defaultToNull:r=!0}={}){var n;const s="POST",{url:i,headers:o}=this.cloneRequestState();if(e&&o.append("Prefer",`count=${e}`),r||o.append("Prefer","missing=default"),Array.isArray(t)){const a=t.reduce((l,u)=>l.concat(Object.keys(u)),[]);if(a.length>
720){const l=[...new Set(a)].map(u=>`"${u}"`);i.searchParams.set("columns",l.join(","))}}return new co({method:s,url:i,headers:o,schema:this.schema,body:t,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(t,{onConflict:e,ignoreDuplicates:r=!1,count:n,defaultToNull:s=!0}={}){var i;const o="POST",{url:a,headers:l}=this.cloneRequestState();if(l.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),e!==void 0&&a.searchParams.set("on_conflict",e),n&&l.append("Prefer",`count=${n}`),s||l.append("Prefer","missing=default"),Array.isArray(t)){const u=t.reduce((c,d)=>c.concat(Object.keys(d)),[]);if(u.length>0){const c=[...new Set(u)].map(d=>`"${d}"`);a.searchParams.set("columns",c.join(","))}}return new co({method:o,url:a,headers:l,schema:this.schema,body:t,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(t,{count:e}={}){var r;const n="PATCH",{url:s,headers:i}=this.cloneRequestState();return e&&i.append("Prefer",`count=${e}`),new co({method:n,url:s,headers:i,schema:this.schema,body:t,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:t}={}){var e;const r="DELETE",{url:n,headers:s}=this.cloneRequestState();return t&&s.append("Prefer",`count=${t}`),new co({method:r,url:n,headers:s,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function lu(t){"@babel/helpers - typeof";return lu=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},lu(t)}function u$(t,e){if(lu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(lu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function c$(t){var e=u$(t,"string");return lu(e)=="symbol"?e:e+""}function d$(t,e,r){return(e=c$(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ww(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function ac(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ww(Object(r),!0).forEach(function(n){d$(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ww(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var h$=class NE{constructor(e,{headers:r={},schema:n,fetch:s,timeout:i,urlLengthLimit:o=8e3,retry:a}={}){this.url=e,this.headers=new Headers(r),this.schemaName=n,this.urlLengthLimit=o;const l=s??globalThis.fetch;i!==void 0&&i>0?this.fetch=(u,c)=>{const d=new AbortController,h=setTimeout(()=>d.abort(),i),f=c==null?void 0:c.signal;if(f){if(f.aborted)return clearTimeout(h),l(u,c);const g=()=>{clearTimeout(h),d.abort()};return f.addEventListener("abort",g,{once:!0}),l(u,ac(ac({},c),{},{signal:d.signal})).finally(()=>{clearTimeout(h),f.removeEventListener("abort",g)})}return l(u,ac(ac({},c),{},{signal:d.signal})).finally(()=>clearTimeout(h))}:this.fetch=l,this.retry=a}from(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new l$(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(e){return new NE(this.url,{headers:this.headers,schema:e,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,r={},{head:n=!1,get:s=!1,count:i}={}){var o;let a;const l=new URL(`${this.url}/rpc/${e}`);let u;const c=f=>f!==null&&typeof f=="object"&&(!Array.isArray(f)||f.some(c)),d=n&&Object.values(r).some(c);d?(a="POST",u=r):n||s?(a=n?"HEAD":"GET",Object.entries(r).filter(([f,g])=>g!==void 0).map(([f,g])=>[f,Array.isArray(g)?`{${g.join(",")}}`:`${g}
72`]).forEach(([f,g])=>{l.searchParams.append(f,g)})):(a="POST",u=r);const h=new Headers(this.headers);return d?h.set("Prefer",i?`count=${i},return=minimal`:"return=minimal"):i&&h.set("Prefer",`count=${i}`),new co({method:a,url:l,headers:h,schema:this.schemaName,body:u,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class f${constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const r=globalThis.process;if(r){const n=r.versions;if(n&&n.node){const s=n.node,i=parseInt(s.replace(/^v/,"").split(".")[0]);return i>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${i} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${i} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
73import ws from "ws"
74new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.constructor)return e.constructor;let r=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(r+=`
75
76Suggested solution: ${e.workaround}`),new Error(r)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const p$="2.103.0",g$=`realtime-js/${p$}`,m$="1.0.0",IE="2.0.0",v$=IE,y$=1e4,_$=100,hs={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},$E={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},Mg={connecting:"connecting",closing:"closing",closed:"closed"};class w${constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,r){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(e));let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return r(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(e){var r;return this._isArrayBuffer((r=e.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var r,n;const s=(n=(r=e.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(e){var r,n;const s=(n=(r=e.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:{},o=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,o)}_encodeUserBroadcastPush(e,r,n){var s,i;const o=e.topic,a=(s=e.ref)!==null&&s!==void 0?s:"",l=(i=e.join_ref)!==null&&i!==void 0?i:"",u=e.payload.event,c=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},d=Object.keys(c).length===0?"":JSON.stringify(c);if(l.length>255)throw new Error(`joinRef length ${l.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`ref length ${a.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`topic length ${o.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`metadata length ${d.length} exceeds maximum of 255`);const h=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+a.length+o.length+u.length+d.length,f=new ArrayBuffer(this.HEADER_LENGTH+h);let g=new DataView(f),p=0;g.setUint8(p++,this.KINDS.userBroadcastPush),g.setUint8(p++,l.length),g.setUint8(p++,a.length),g.setUint8(p++,o.length),g.setUint8(p++,u.length),g.setUint8(p++,d.length),g.setUint8(p++,r),Array.from(l,v=>g.setUint8(p++,v.charCodeAt(0))),Array.from(a,v=>g.setUint8(p++,v.charCodeAt(0))),Array.from(o,v=>g.setUint8(p++,v.charCodeAt(0))),Array.from(u,v=>g.setUint8(p++,v.charCodeAt(0))),Array.from(d,v=>g.setUint8(p++,v.charCodeAt(0)));var b=new Uint8Array(f.byteLength+n.byteLength);return b.set(new Uint8Array(f),0),b.set(new Uint8Array(n),f.byteLength),b.buffer}decode(e,r){if(this._isArrayBuffer(e)){let n=this._binaryDecode(e);return r(n)}if(typeof e=="string"){const n=JSON.parse(e),[s,i,o,a,l]=n;return r({join_ref:s,ref:i,topic:o,event:a,payload:l})}return r({})}_binaryDecode(e){const r=new DataView(e),n=r.getUint8(0),s=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,r,s)}}_decodeUserBroadcast(e,r,n){const s=r.getUint8(1),i=r.getUint8(2),o=r.getUint8(3),a=r.getUint8(4);let l=this.HEADER_LENGTH+4;const u=n.decode(e.slice(l,l+s));l=l+s;const c=n.decode(e.slice(l,l+i));l=l+i;
vendor: 10,889 bytes, line 76
76const d=n.decode(e.slice(l,l+o));l=l+o;const h=e.slice(l,e.byteLength),f=a===this.JSON_ENCODING?JSON.parse(n.decode(h)):h,g={type:this.BROADCAST_EVENT,event:c,payload:f};return o>0&&(g.meta=JSON.parse(d)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:g}}_isArrayBuffer(e){var r;return e instanceof ArrayBuffer||((r=e==null?void 0:e.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(e,r){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([n])=>r.includes(n)))}}var Te;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.tsrange="tsrange",t.tstzrange="tstzrange"})(Te||(Te={}));const qw=(t,e,r={})=>{var n;const s=(n=r.skipTypes)!==null&&n!==void 0?n:[];return e?Object.keys(e).reduce((i,o)=>(i[o]=b$(o,t,e,s),i),{}):{}},b$=(t,e,r,n)=>{const s=e.find(a=>a.name===t),i=s==null?void 0:s.type,o=r[t];return i&&!n.includes(i)?LE(i,o):Dg(o)},LE=(t,e)=>{if(t.charAt(0)==="_"){const r=t.slice(1,t.length);return E$(e,r)}switch(t){case Te.bool:return x$(e);case Te.float4:case Te.float8:case Te.int2:case Te.int4:case Te.int8:case Te.numeric:case Te.oid:return k$(e);case Te.json:case Te.jsonb:return S$(e);case Te.timestamp:return C$(e);case Te.abstime:case Te.date:case Te.daterange:case Te.int4range:case Te.int8range:case Te.money:case Te.reltime:case Te.text:case Te.time:case Te.timestamptz:case Te.timetz:case Te.tsrange:case Te.tstzrange:return Dg(e);default:return Dg(e)}},Dg=t=>t,x$=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},k$=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},S$=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t},E$=(t,e)=>{if(typeof t!="string")return t;const r=t.length-1,n=t[r];if(t[0]==="{"&&n==="}"){let i;const o=t.slice(1,r);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(a=>LE(e,a))}return t},C$=t=>typeof t=="string"?t.replace(" ","T"):t,ME=t=>{const e=new URL(t);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};var Al=t=>typeof t=="function"?t:function(){return t},T$=typeof self<"u"?self:null,ho=typeof window<"u"?window:null,nn=T$||ho||globalThis,P$="2.0.0",R$=1e4,A$=1e3,ln={connecting:0,open:1,closing:2,closed:3},Bt={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Rn={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},Fg={longpoll:"longpoll",websocket:"websocket"},O$={complete:4},Ug="base64url.bearer.phx.",lc=class{constructor(t,e,r,n){this.channel=t,this.event=e,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(t){this.timeout=t,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(t,e){return this.hasReceived(t)&&e(this.receivedResp.response),this.recHooks.push({status:t,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:t,response:e,_ref:r}){this.recHooks.filter(n=>n.status===t).forEach(n=>n.callback(e))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,t=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=t,this.matchReceive(t)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}trigger(t,e){this.channel.trigger(this.refEvent,{status:t,response:e})}},DE=class{constructor(t,e){this.callback=t,this.timerCalc=e,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},j$=class{constructor(t,e,r){this.state=Bt.closed,this.topic=t,this.params=Al(e||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new lc(this,Rn.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new DE(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=Bt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(n=>n.send()),this.pushBuffer=[]}),this.joinPush.receive("error",n=>{this.state=Bt.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=Bt.closed,this.socket.remove(this)}),this.onError(n=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.isJoining()&&this.joinPush.reset(),this.state=Bt.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new lc(this,Rn.leave,Al({}),this.timeout).send(),this.state=Bt.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(Rn.reply,(n,s)=>{this.trigger(this.replyEventName(s),n)})}join(t=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=t,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Bt.closed,this.bindings=[]}onClose(t){this.on(Rn.close,t)}onError(t){return this.on(Rn.error,e=>t(e))}on(t,e){let r=this.bindingRef++;return this.bindings.push({event:t,ref:r,callback:e}),r}off(t,e){this.bindings=this.bindings.filter(r=>!(r.event===t&&(typeof e>"u"||e===r.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(t,e,r=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${t}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new lc(this,t,function(){return e},r);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(t=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Bt.leaving;let e=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Rn.close,"leave")},r=new lc(this,Rn.leave,Al({}),t);return r.receive("ok",()=>e()).receive("timeout",()=>e()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(t,e,r){return e}filterBindings(t,e,r){return!0}isMember(t,e,r,n){return this.topic!==t?!1:n&&n!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:t,event:e,payload:r,joinRef:n}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(t=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Bt.joining,this.joinPush.resend(t))}trigger(t,e,r,n){let s=this.onMessage(t,e,r,n);if(e&&!s)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let i=this.bindings.filter(o=>o.event===t&&this.filterBindings(o,e,r));for(let o=0;o<i.length;o++)i[o].callback(s,r,n||this.joinRef())}replyEventName(t){return`chan_reply_${t}`}isClosed(){return this.state===Bt.closed}isErrored(){return this.state===Bt.errored}isJoined(){return this.state===Bt.joined}isJoining(){return this.state===Bt.joining}isLeaving(){return this.state===Bt.leaving}},Od=class{static request(t,e,r,n,s,i,o){if(nn.XDomainRequest){let a=new nn.XDomainRequest;return this.xdomainRequest(a,t,e,n,s,i,o)}else if(nn.XMLHttpRequest){let a=new nn.XMLHttpRequest;return this.xhrRequest(a,t,e,r,n,s,i,o)}else{if(nn.fetch&&nn.AbortController)return this.fetchRequest(t,e,r,n,s,i,o);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(t,e,r,n,s,i,o){let a={method:t,headers:r,body:n},l=null;return s&&(l=new AbortController,setTimeout(()=>l.abort(),s),a.signal=l.signal),nn.fetch(e,a).then(u=>u.text()).then(u=>this.parseJSON(u)).then(u=>o&&o(u)).catch(u=>{u.name==="AbortError"&&i?i():o&&o(null)}),l}static xdomainRequest(t,e,r,n,s,i,o){return t.timeout=s,t.open(e,r),t.onload=()=>{let a=this.parseJSON(t.responseText);o&&o(a)},i&&(t.ontimeout=i),t.onprogress=()=>{},t.send(n),t}static xhrRequest(t,e,r,n,s,i,o,a){t.open(e,r,!0),t.timeout=i;for(let[l,u]of Object.entries(n))t.setRequestHeader(l,u);return t.onerror=()=>a&&a(null),t.onreadystatechange=()=>{if(t.readyState===O$.complete&&a){let l=this.parseJSON(t.responseText);a(l)}},o&&(t.ontimeout=o),t.send(s),t}static parseJSON(t){if(!t||t==="")return null;try{return JSON.parse(t)}catch{return console&&console.log("failed to parse JSON response",t),null}}static serialize(t,e){let r=[];for(var n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let s=e?`${e}[${n}]`:n,i=t[n];typeof i=="object"?r.push(this.serialize(i,s)):r.push(encodeURIComponent(s)+"="+encodeURIComponent(i))}return r.join("&")}static appendParams(t,e){if(Object.keys(e).length===0)return t;let r=t.match(/\?/)?"&":"?";return`${t}${r}${this.serialize(e)}`}},N$=t=>{let e="",r=new Uint8Array(t),n=r.byteLength;for(let s=0;s<n;s++)e+=String.fromCharCode(r[s]);return btoa(e)},Yi=class{constructor(t,e){e&&e.length===2&&e[1].startsWith(Ug)&&(this.authToken=atob(e[1].slice(Ug.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){}
vendor: 14,031 bytes, lines 76-77
76,this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=ln.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+Fg.websocket),"$1/"+Fg.longpoll)}endpointURL(){return Od.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(t,e,r){this.close(t,e,r),this.readyState=ln.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===ln.open||this.readyState===ln.connecting}poll(){const t={Accept:"application/json"};this.authToken&&(t["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",t,null,()=>this.ontimeout(),e=>{if(e){var{status:r,token:n,messages:s}=e;if(r===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=n}else r=0;switch(r){case 200:s.forEach(i=>{setTimeout(()=>this.onmessage({data:i}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=ln.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${r}`)}})}send(t){typeof t!="string"&&(t=N$(t)),this.currentBatch?this.currentBatch.push(t):this.awaitingBatchAck?this.batchBuffer.push(t):(this.currentBatch=[t],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(t){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},t.join(`
77`),()=>this.onerror("timeout"),e=>{this.awaitingBatchAck=!1,!e||e.status!==200?(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(t,e,r){for(let s of this.reqs)s.abort();this.readyState=ln.closed;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:t,reason:e,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(t,e,r,n,s){let i,o=()=>{this.reqs.delete(i),n()};i=Od.request(t,this.endpointURL(),e,r,this.timeout,o,a=>{this.reqs.delete(i),this.isActive()&&s(a)}),this.reqs.add(i)}},I$=class dl{constructor(e,r={}){let n=r.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=e,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(n.state,s=>{let{onJoin:i,onLeave:o,onSync:a}=this.caller;this.joinRef=this.channel.joinRef(),this.state=dl.syncState(this.state,s,i,o),this.pendingDiffs.forEach(l=>{this.state=dl.syncDiff(this.state,l,i,o)}),this.pendingDiffs=[],a()}),this.channel.on(n.diff,s=>{let{onJoin:i,onLeave:o,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=dl.syncDiff(this.state,s,i,o),a())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(e){return dl.list(this.state,e)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,r,n,s){let i=this.clone(e),o={},a={};return this.map(i,(l,u)=>{r[l]||(a[l]=u)}),this.map(r,(l,u)=>{let c=i[l];if(c){let d=u.metas.map(p=>p.phx_ref),h=c.metas.map(p=>p.phx_ref),f=u.metas.filter(p=>h.indexOf(p.phx_ref)<0),g=c.metas.filter(p=>d.indexOf(p.phx_ref)<0);f.length>0&&(o[l]=u,o[l].metas=f),g.length>0&&(a[l]=this.clone(c),a[l].metas=g)}else o[l]=u}),this.syncDiff(i,{joins:o,leaves:a},n,s)}static syncDiff(e,r,n,s){let{joins:i,leaves:o}=this.clone(r);return n||(n=function(){}),s||(s=function(){}),this.map(i,(a,l)=>{let u=e[a];if(e[a]=this.clone(l),u){let c=e[a].metas.map(h=>h.phx_ref),d=u.metas.filter(h=>c.indexOf(h.phx_ref)<0);e[a].metas.unshift(...d)}n(a,u,l)}),this.map(o,(a,l)=>{let u=e[a];if(!u)return;let c=l.metas.map(d=>d.phx_ref);u.metas=u.metas.filter(d=>c.indexOf(d.phx_ref)<0),s(a,u,l),u.metas.length===0&&delete e[a]}),e}static list(e,r){return r||(r=function(n,s){return s}),this.map(e,(n,s)=>r(n,s))}static map(e,r){return Object.getOwnPropertyNames(e).map(n=>r(n,e[n]))}static clone(e){return JSON.parse(JSON.stringify(e))}},uc={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(t,e){if(t.payload.constructor===ArrayBuffer)return e(this.binaryEncode(t));{let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return e(JSON.stringify(r))}},decode(t,e){if(t.constructor===ArrayBuffer)return e(this.binaryDecode(t));{let[r,n,s,i,o]=JSON.parse(t);return e({join_ref:r,ref:n,topic:s,event:i,payload:o})}},binaryEncode(t){let{join_ref:e,ref:r,event:n,topic:s,payload:i}=t,o=this.META_LENGTH+e.length+r.length+s.length+n.length,a=new ArrayBuffer(this.HEADER_LENGTH+o),l=new DataView(a),u=0;l.setUint8(u++,this.KINDS.push),l.setUint8(u++,e.length),l.setUint8(u++,r.length),l.setUint8(u++,s.length),l.setUint8(u++,n.length),Array.from(e,d=>l.setUint8(u++,d.charCodeAt(0))),Array.from(r,d=>l.setUint8(u++,d.charCodeAt(0))),Array.from(s,d=>l.setUint8(u++,d.charCodeAt(0))),Array.from(n,d=>l.setUint8(u++,d.charCodeAt(0)));var c=new Uint8Array(a.byteLength+i.byteLength);return c.set(new Uint8Array(a),0),c.set(new Uint8Array(i),a.byteLength),c.buffer},binaryDecode(t){let e=new DataView(t),r=e.getUint8(0),n=new TextDecoder;switch(r){case this.KINDS.push:return this.decodePush(t,e,n);case this.KINDS.reply:return this.decodeReply(t,e,n);case this.KINDS.broadcast:return this.decodeBroadcast(t,e,n)}},decodePush(t,e,r){let n=e.getUint8(1),s=e.getUint8(2),i=e.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,a=r.decode(t.slice(o,o+n));o=o+n;let l=r.decode(t.slice(o,o+s));o=o+s;let u=r.decode(t.slice(o,o+i));o=o+i;let c=t.slice(o,t.byteLength);return{join_ref:a,ref:null,topic:l,event:u,payload:c}},decodeReply(t,e,r){let n=e.getUint8(1),s=e.getUint8(2),i=e.getUint8(3),o=e.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,l=r.decode(t.slice(a,a+n));a=a+n;let u=r.decode(t.slice(a,a+s));a=a+s;let c=r.decode(t.slice(a,a+i));a=a+i;let d=r.decode(t.slice(a,a+o));a=a+o;let h=t.slice(a,t.byteLength),f={status:d,response:h};return{join_ref:l,ref:u,topic:c,event:Rn.reply,payload:f}},decodeBroadcast(t,e,r){let n=e.getUint8(1),s=e.getUint8(2),i=this.HEADER_LENGTH+2,o=r.decode(t.slice(i,i+n));i=i+n;let a=r.decode(t.slice(i,i+s));i=i+s;let l=t.slice(i,t.byteLength);return{join_ref:null,ref:null,topic:o,event:a,payload:l}}},$$=class{constructor(t,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=e.timeout||R$,this.transport=e.transport||nn.WebSocket||Yi,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=e.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=e.sessionStorage||nn&&nn.sessionStorage,this.establishedConnections=0,this.defaultEncoder=uc.encode.bind(uc),this.defaultDecoder=uc.decode.bind(uc),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=e.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Yi?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let r=null;ho&&ho.addEventListener&&(ho.addEventListener("pagehide",n=>{this.conn&&(this.disconnect(),r=this.connectClock)}),ho.addEventListener("pageshow",n=>{r===this.connectClock&&(r=null,this.connect())}),ho.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=e.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=e.autoSendHeartbeat??!0,this.heartbeatCallback=e.heartbeatCallback??(()=>{}),this.rejoinAfterMs=n=>e.rejoinAfterMs?e.rejoinAfterMs(n):[1e3,2e3,5e3][n-1]||1e4,this.reconnectAfterMs=n=>e.reconnectAfterMs?e.reconnectAfterMs(n):[10,50,100,150,200,250,500,1e3,2e3][n-1]||5e3,this.logger=e.logger||null,!this.logger&&e.debug&&(this.logger=(n,s,i)=>{console.log(`${n}: ${s}`,i)}),this.longpollerTimeout=e.longpollerTimeout||2e4,this.params=Al(e.params||{}),this.endPoint=`${t}/${Fg.websocket}`,this.vsn=e.vsn||P$,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new DE(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{e.beforeReconnect&&await e.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=e.authToken}getLongPollTransport(){return Yi}replaceTransport(t){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=t}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let t=Od.appendParams(Od.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return t.charAt(0)!=="/"?t:t.charAt(1)==="/"?`${this.protocol()}:${t}`:`${this.protocol()}://${location.host}${t}`}disconnect(t,e,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,t&&t()},e,r)}connect(t){t&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=Al(t)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Yi?this.connectWithFallback(Yi,this.longPollFallbackMs):this.transportConnect())}log(t,e,r){this.logger&&this.logger(t,e,r)}hasLogger(){return this.logger!==null}onOpen(t){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,t]),e}onClose(t){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,t]),e}onError(t){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,t]),e}onMessage(t){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,t]),e}onHeartbeat(t){this.heartbeatCallback=t}ping(t){if(!this.isConnected())return!1;let e=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:e});let n=this.onMessage(s=>{s.ref===e&&(this.off([n]),t(Date.now()-r))});return!0}transportName(t){switch(t){case Yi:return"LongPoll";default:return t.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let t;this.authToken&&(t=["phoenix",`${Ug}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),t),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(t){return this.sessionStore&&this.sessionStore.getItem(t)}storeSession(t,e){this.sessionStore&&this.sessionStore.setItem(t,e)}connectWithFallback(t,e=2500){clearTimeout(this.fallbackTimer);let r=!1,n=!0,s,i,o=this.transportName(t),a=l=>{this.log("transport",`falling back to ${o}...`,l),this.off([s,i]),n=!1,this.replaceTransport(t),this.transportConnect()};if(this.getSession(`phx:fallback:${o}`))return a("memorized");this.fallbackTimer=setTimeout(a,e),i=this.onError(l=>{this.log("transport","error",l),n&&!r&&(clearTimeout(this.fallbackTimer),a(l))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(r=!0,!n){let l=this.transportName(t);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${l}`,"true"),this.log("transport",`established ${l} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(a,e),this.ping(l=>{this.log("transport","connected to primary after",l),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(t){this.log("error","error in heartbeat callback",t)}this.triggerChanError(),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),A$,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(t,e,r){if(!this.conn)return t&&t();const n=this.conn;this.waitForBufferDone(n,()=>{e?n.close(e,r||""):n.close(),this.waitForSocketClosed(n,()=>{this.conn===n&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),t&&t()})})}waitForBufferDone(t,e,r=1){if(r===5||!t.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(t,e,r+1)},150*r)}waitForSocketClosed(t,e,r=1){if(r===5||t.readyState===ln.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(t,e,r+1)},150*r)}onConnClose(t){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",t),this.triggerChanError(),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",t)}onConnError(t){this.hasLogger()&&this.log("transport",t);let e=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",t,e,r),(e===this.transport||r>0)&&this.triggerChanError()}
77triggerChanError(){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(Rn.error)})}connectionState(){switch(this.conn&&this.conn.readyState){case ln.connecting:return"connecting";case ln.open:return"open";case ln.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(t){this.off(t.stateChangeRefs),this.channels=this.channels.filter(e=>e!==t)}off(t){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([r])=>t.indexOf(r)===-1)}channel(t,e={}){let r=new j$(t,e,this);return this.channels.push(r),r}push(t){if(this.hasLogger()){let{topic:e,event:r,payload:n,ref:s,join_ref:i}=t;this.log("push",`${e} ${r} (${i}, ${s})`,n)}this.isConnected()?this.encode(t,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(t,e=>this.conn.send(e)))}makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(t){this.log("error","error in heartbeat callback",t)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(t){this.log("error","error in heartbeat callback",t)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}onConnMessage(t){this.decode(t.data,e=>{let{topic:r,event:n,payload:s,ref:i,join_ref:o}=e;if(i&&i===this.pendingHeartbeatRef){const a=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(s.status==="ok"?"ok":"error",a)}catch(l){this.log("error","error in heartbeat callback",l)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${s.status||""} ${r} ${n} ${i&&"("+i+")"||""}`.trim(),s);for(let a=0;a<this.channels.length;a++){const l=this.channels[a];l.isMember(r,n,s,o)&&l.trigger(n,s,i,o)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(t,...e){try{this.stateChangeCallbacks[t].forEach(([r,n])=>{try{n(...e)}catch(s){this.log("error",`error in ${t} callback`,s)}})}catch(r){this.log("error",`error triggering ${t} callbacks`,r)}}leaveOpenTopic(t){let e=this.channels.find(r=>r.topic===t&&(r.isJoined()||r.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${t}"`),e.leave())}};class Ol{constructor(e,r){const n=M$(r);this.presence=new I$(e.getChannel(),n),this.presence.onJoin((s,i,o)=>{const a=Ol.onJoinPayload(s,i,o);e.getChannel().trigger("presence",a)}),this.presence.onLeave((s,i,o)=>{const a=Ol.onLeavePayload(s,i,o);e.getChannel().trigger("presence",a)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return Ol.transformState(this.presence.state)}static transformState(e){return e=L$(e),Object.getOwnPropertyNames(e).reduce((r,n)=>{const s=e[n];return r[n]=Wc(s),r},{})}static onJoinPayload(e,r,n){const s=Vw(r),i=Wc(n);return{event:"join",key:e,currentPresences:s,newPresences:i}}static onLeavePayload(e,r,n){const s=Vw(r),i=Wc(n);return{event:"leave",key:e,currentPresences:s,leftPresences:i}}}function Wc(t){return t.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function L$(t){return JSON.parse(JSON.stringify(t))}function M$(t){return(t==null?void 0:t.events)&&{events:t.events}}function Vw(t){return t!=null&&t.metas?Wc(t):[]}var Kw;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(Kw||(Kw={}));class D${get state(){return this.presenceAdapter.state}constructor(e,r){this.channel=e,this.presenceAdapter=new Ol(this.channel.channelAdapter,r)}}class F${constructor(e,r,n){const s=U$(n);this.channel=e.getSocket().channel(r,s),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,r){return this.channel.on(e,r)}off(e,r){this.channel.off(e,r)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,r,n){let s;try{s=this.channel.push(e,r,n)}catch{throw`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`}if(this.channel.pushBuffer.length>_$){const i=this.channel.pushBuffer.shift();i.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${i.event}`,i.payload())}return s}updateJoinPayload(e){const r=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},r),e)}canPush(){return this.socket.isConnected()&&this.state===hs.joined}isJoined(){return this.state===hs.joined}isJoining(){return this.state===hs.joining}isClosed(){return this.state===hs.closed}isLeaving(){return this.state===hs.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}function U$(t){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config)}}var Gw;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELET
77E="DELETE"})(Gw||(Gw={}));var Ao;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(Ao||(Ao={}));var An;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(An||(An={}));class jl{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,r={config:{}},n){var s,i;if(this.topic=e,this.params=r,this.socket=n,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.channelAdapter=new F$(this.socket.socketAdapter,e,this.params),this.presence=new D$(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=ME(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((i=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||i===void 0)&&i.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(e,r=this.timeout){var n,s,i;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:o,presence:a,private:l}}=this.params,u=(s=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(f=>f.filter))!==null&&s!==void 0?s:[],c=!!this.bindings[Ao.PRESENCE]&&this.bindings[Ao.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,d={},h={broadcast:o,presence:Object.assign(Object.assign({},a),{enabled:c}),postgres_changes:u,private:l};this.socket.accessTokenValue&&(d.access_token=this.socket.accessTokenValue),this._onError(f=>{e==null||e(An.CHANNEL_ERROR,f)}),this._onClose(()=>e==null?void 0:e(An.CLOSED)),this.updateJoinPayload(Object.assign({config:h},d)),this._updateFilterMessage(),this.channelAdapter.subscribe(r).receive("ok",async({postgres_changes:f})=>{if(this.socket._isManualToken()||this.socket.setAuth(),f===void 0){e==null||e(An.SUBSCRIBED);return}this._updatePostgresBindings(f,e)}).receive("error",f=>{this.state=hs.errored,e==null||e(An.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(f).join(", ")||"error")))}).receive("timeout",()=>{e==null||e(An.TIMED_OUT)})}return this}_updatePostgresBindings(e,r){var n;const s=this.bindings.postgres_changes,i=(n=s==null?void 0:s.length)!==null&&n!==void 0?n:0,o=[];for(let a=0;a<i;a++){const l=s[a],{filter:{event:u,schema:c,table:d,filter:h}}=l,f=e&&e[a];if(f&&f.event===u&&jl.isFilterValueEqual(f.schema,c)&&jl.isFilterValueEqual(f.table,d)&&jl.isFilterValueEqual(f.filter,h))o.push(Object.assign(Object.assign({},l),{id:f.id}));else{this.unsubscribe(),this.state=hs.errored,r==null||r(An.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=o,this.state!=hs.errored&&r&&r(An.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,r={}){return await this.send({type:"presence",event:"track",payload:e},r.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,r,n){const s=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),i=e===Ao.PRESENCE||e===Ao.POSTGRES_CHANGES;if(s&&i)throw this.socket.log("channel",`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,r,n)}async httpSend(e,r,n={}){var s;if(r==null)return Promise.reject("Payload is required for httpSend()");const i={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);const o={method:"POST",headers:i,body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:r,private:this.private}]})},a=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(s=n.timeout)!==null&&s!==void 0?s:this.timeout);if(a.status===202)return{success:!0};let l=a.statusText;
77try{const u=await a.json();l=u.error||u.message||l}catch{}return Promise.reject(new Error(l))}async send(e,r={}){var n,s;if(!this.channelAdapter.canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:i,payload:o}=e,a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);const l={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((s=u.body)===null||s===void 0?void 0:s.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,a,l;const u=this.channelAdapter.push(e.type,e,r.timeout||this.timeout);e.type==="broadcast"&&!(!((l=(a=(o=this.params)===null||o===void 0?void 0:o.config)===null||a===void 0?void 0:a.broadcast)===null||l===void 0)&&l.ack)&&i("ok"),u.receive("ok",()=>i("ok")),u.receive("error",()=>i("error")),u.receive("timeout",()=>i("timed out"))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(r=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>r("ok")).receive("timeout",()=>r("timed out")).receive("error",()=>r("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,r,n){const s=new AbortController,i=setTimeout(()=>s.abort(),n),o=await this.socket.fetch(e,Object.assign(Object.assign({},r),{signal:s.signal}));return clearTimeout(i),o}_on(e,r,n){const s=e.toLocaleLowerCase(),i=this.channelAdapter.on(e,n),o={type:s,filter:r,callback:n,ref:i};return this.bindings[s]?this.bindings[s].push(o):this.bindings[s]=[o],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,r,n)=>{var s,i,o,a,l,u,c;const d=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(d,n))return!1;const h=(s=this.bindings[d])===null||s===void 0?void 0:s.find(f=>f.ref===e.ref);if(!h)return!0;if(["broadcast","presence","postgres_changes"].includes(d))if("id"in h){const f=h.id,g=(i=
77h.filter)===null||i===void 0?void 0:i.event;return f&&((o=r.ids)===null||o===void 0?void 0:o.includes(f))&&(g==="*"||(g==null?void 0:g.toLocaleLowerCase())===((a=r.data)===null||a===void 0?void 0:a.type.toLocaleLowerCase()))}else{const f=(u=(l=h==null?void 0:h.filter)===null||l===void 0?void 0:l.event)===null||u===void 0?void 0:u.toLocaleLowerCase();return f==="*"||f===((c=r==null?void 0:r.event)===null||c===void 0?void 0:c.toLocaleLowerCase())}else return h.type.toLocaleLowerCase()===d})}_notThisChannelEvent(e,r){const{close:n,error:s,leave:i,join:o}=$E;return r&&[n,s,i,o].includes(e)&&r!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,r,n)=>{if(typeof r=="object"&&"ids"in r){const s=r.data,{schema:i,table:o,commit_timestamp:a,type:l,errors:u}=s;return Object.assign(Object.assign({},{schema:i,table:o,commit_timestamp:a,eventType:l,new:{},old:{},errors:u}),this._getPayloadRecords(s))}return r})}copyBindings(e){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const r in e.bindings)for(const n of e.bindings[r])this._on(n.type,n.filter,n.callback)}static isFilterValueEqual(e,r){return(e??void 0)===(r??void 0)}_getPayloadRecords(e){const r={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(r.new=qw(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(r.old=qw(e.columns,e.old_record)),r}}class B${constructor(e,r){this.socket=new $$(e,r)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,r,n,s=1e4){return new Promise(i=>{setTimeout(()=>i("timeout"),s),this.socket.disconnect(()=>{e(),i("ok")},r,n)})}push(e){this.socket.push(e)}log(e,r,n){this.socket.log(e,r,n)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Mg.connecting}isDisconnecting(){return this.socket.connectionState()==Mg.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const z$={HEARTBEAT_INTERVAL:25e3},H$=[1e3,2e3,5e3,1e4],W$=1e4,q$=`
78  addEventListener("message", (e) => {
79    if (e.data.event === "start") {
80      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
81    }
82  });`;class V${get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,r){var n;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={}
82,this.ref=0,this.serializer=new w$,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._resolveFetch=i=>i?(...o)=>i(...o):(...o)=>fetch(...o),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey;const s=this._initializeOptions(r);this.socketAdapter=new B$(e,s),this.httpEndpoint=ME(e),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){const r=e.message;throw r.includes("Node.js")?new Error(`${r}
83
84To use Realtime in Node.js, you need to provide a WebSocket implementation:
85
86Option 1: Use Node.js 22+ which has native WebSocket support
87Option 2: Install and provide the "ws" package:
88
89  npm install ws
90
91  import ws from "ws"
92  const client = new RealtimeClient(url, {
93    ...options,
94    transport: ws
95  })`):new Error(`WebSocket not available: ${r}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,r){return this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,r)}getChannels(){return this.channels}async removeChannel(e){const r=await e.unsubscribe();return r==="ok"&&e.teardown(),this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const e=this.channels.map(async n=>{const s=await n.unsubscribe();return n.teardown(),s}),r=await Promise.all(e);return this.disconnect(),r}log(e,r,n){this.socketAdapter.log(e,r,n)}connectionState(){return this.socketAdapter.connectionState()||Mg.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,r={config:{}}){const n=`realtime:${e}`,s=this.getChannels().find(i=>i.topic===n);if(s)return s;{const i=new jl(`realtime:${e}`,r,this);return this.channels.push(i),i}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(r=>r.topic!==e.topic)}async _performAuth(e=null){let r,n=!1;if(e)r=e,n=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(s){this.log("error","Error fetching access token from callback",s),r=this.accessTokenValue}else r=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(s=>{const i={access_token:r,version:g$};r&&s.updateJoinPayload(i),s.joinedOnce&&s.channelAdapter.isJoined()&&s.channelAdapter.push($E.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${e}`,r)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(r=>{this.log("error","error waiting for auth on connect",r)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(r,n)=>{r=="sent"&&this._setAuthSafely(),e&&e(r,n)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(e){let r;if(e)r=e;else{const n=new Blob([q$],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_initializeOptions(e){var r,n,s,i,o,a,l,u,c;this.worker=(r=e==null?void 0:e.worker)!==null&&r!==void 0?r:!1,this.accessToken=(n=e==null?void 0:e.accessToken)!==null&&n!==void 0?n:null;const d={};
95d.timeout=(s=e==null?void 0:e.timeout)!==null&&s!==void 0?s:y$,d.heartbeatIntervalMs=(i=e==null?void 0:e.heartbeatIntervalMs)!==null&&i!==void 0?i:z$.HEARTBEAT_INTERVAL,d.transport=(o=e==null?void 0:e.transport)!==null&&o!==void 0?o:f$.getWebSocketConstructor(),d.params=e==null?void 0:e.params,d.logger=e==null?void 0:e.logger,d.heartbeatCallback=this._wrapHeartbeatCallback(e==null?void 0:e.heartbeatCallback),d.reconnectAfterMs=(a=e==null?void 0:e.reconnectAfterMs)!==null&&a!==void 0?a:p=>H$[p-1]||W$;let h,f;const g=(l=e==null?void 0:e.vsn)!==null&&l!==void 0?l:v$;switch(g){case m$:h=(p,b)=>b(JSON.stringify(p)),f=(p,b)=>b(JSON.parse(p));break;case IE:h=this.serializer.encode.bind(this.serializer),f=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${d.vsn}`)}if(d.vsn=g,d.encode=(u=e==null?void 0:e.encode)!==null&&u!==void 0?u:h,d.decode=(c=e==null?void 0:e.decode)!==null&&c!==void 0?c:f,d.beforeReconnect=this._reconnectAuth.bind(this),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,d.params=Object.assign(Object.assign({},d.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl,d.autoSendHeartbeat=!this.worker}return d}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var uu=class extends Error{constructor(t,e){var r;super(t),this.name="IcebergError",this.status=e.status,this.icebergType=e.icebergType,this.icebergCode=e.icebergCode,this.details=e.details,this.isCommitStateUnknown=e.icebergType==="CommitStateUnknownException"||[500,502,504].includes(e.status)&&((r=e.icebergType)==null?void 0:r.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function K$(t,e,r){const n=new URL(e,t);if(r)for(const[s,i]of Object.entries(r))i!==void 0&&n.searchParams.set(s,i);return n.toString()}async function G$(t){return!t||t.type==="none"?{}:t.type==="bearer"?{Authorization:`Bearer ${t.token}`}:t.type==="header"?{[t.name]:t.value}:t.type==="custom"?await t.getHeaders():{}}function Y$(t){const e=t.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:s,body:i,headers:o}){const a=K$(t.baseUrl,n,s),l=await G$(t.auth),u=await e(a,{method:r,headers:{...i?{"Content-Type":"application/json"}:{},...l,...o},body:i?JSON.stringify(i):void 0}),c=await u.text(),d=(u.headers.get("content-type")||"").includes("application/json"),h=d&&c?JSON.parse(c):c;if(!u.ok){const f=d?h:void 0,g=f==null?void 0:f.error;throw new uu((g==null?void 0:g.message)??`Request failed with status ${u.status}`,{status:u.status,icebergType:g==null?void 0:g.type,icebergCode:g==null?void 0:g.code,details:f})}return{status:u.status,headers:u.headers,data:h}}}}function cc(t){return t.join("�")}var J$=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){const e=t?{parent:cc(t.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(t,e){const r={namespace:t.namespace,properties:e==null?void 0:e.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${cc(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${cc(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${cc(t.namespace)}`}),!0}catch(e){if(e instanceof uu&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(r){if(r instanceof uu&&r.status===409)return;throw r}}};function Ji(t){return t.join("�")}var Q$=class{constructor(t,e="",r){this.client=t,this.prefix=e,this.accessDelegation=r}async listTables(t){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Ji(t.namespace)}/tables`})).data.identifiers}async createTable(t,e){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Ji(t.namespace)}/tables`,body:e,headers:r})).data.metadata}async updateTable(t,e){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Ji(t.namespace)}
95/tables/${t.name}`,body:e});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(t,e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Ji(t.namespace)}/tables/${t.name}`,query:{purgeRequested:String((e==null?void 0:e.purge)??!1)}})}async loadTable(t){const e={};return this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Ji(t.namespace)}/tables/${t.name}`,headers:e})).data.metadata}async tableExists(t){const e={};this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Ji(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(r){if(r instanceof uu&&r.status===404)return!1;throw r}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(r){if(r instanceof uu&&r.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw r}}},X$=class{constructor(t){var n;let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);const r=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=Y$({baseUrl:r,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=(n=t.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new J$(this.client,e),this.tableOps=new Q$(this.client,e,this.accessDelegation)}async listNamespaces(t){return this.namespaceOps.listNamespaces(t)}async createNamespace(t,e){return this.namespaceOps.createNamespace(t,e)}async dropNamespace(t){await this.namespaceOps.dropNamespace(t)}async loadNamespaceMetadata(t){return this.namespaceOps.loadNamespaceMetadata(t)}async listTables(t){return this.tableOps.listTables(t)}async createTable(t,e){return this.tableOps.createTable(t,e)}async updateTable(t,e){return this.tableOps.updateTable(t,e)}async dropTable(t,e){await this.tableOps.dropTable(t,e)}async loadTable(t){return this.tableOps.loadTable(t)}async namespaceExists(t){return this.namespaceOps.namespaceExists(t)}async tableExists(t){return this.tableOps.tableExists(t)}async createNamespaceIfNotExists(t,e){return this.namespaceOps.createNamespaceIfNotExists(t,e)}async createTableIfNotExists(t,e){return this.tableOps.createTableIfNotExists(t,e)}},Fh=class extends Error{constructor(t,e="storage",r,n){super(t),this.__isStorageError=!0,this.namespace=e,this.name=e==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=n}};function Uh(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var Bg=class extends Fh{constructor(t,e,r,n="storage"){super(t,n,e,r),this.name=n==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=e,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},FE=class extends Fh{constructor(t,e,r="storage"){super(t,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};const Z$=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),eL=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},zg=t=>{if(Array.isArray(t))return t.map(r=>zg(r));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([r,n])=>{const s=r.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));e[s]=zg(n)}),e},tL=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t);function cu(t){"@babel/helpers - typeof";return cu=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},cu(t)}function rL(t,e){if(cu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(cu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function nL(t){var e=rL(t,"string");return cu(e)=="symbol"?e:e+""}function sL(t,e,r){return(e=nL(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Yw(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function ne(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};
95e%2?Yw(Object(r),!0).forEach(function(n){sL(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Yw(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}const Jw=t=>{var e;return t.msg||t.message||t.error_description||(typeof t.error=="string"?t.error:(e=t.error)===null||e===void 0?void 0:e.message)||JSON.stringify(t)},iL=async(t,e,r,n)=>{if(t!==null&&typeof t=="object"&&typeof t.json=="function"){const s=t;let i=parseInt(s.status,10);Number.isFinite(i)||(i=500),s.json().then(o=>{const a=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||i+"";e(new Bg(Jw(o),i,a,n))}).catch(()=>{const o=i+"";e(new Bg(s.statusText||`HTTP ${i} error`,i,o,n))})}else e(new FE(Jw(t),t,n))},oL=(t,e,r,n)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};if(t==="GET"||t==="HEAD"||!n)return ne(ne({},s),r);if(eL(n)){var i;const o=(e==null?void 0:e.headers)||{};let a;for(const[l,u]of Object.entries(o))l.toLowerCase()==="content-type"&&(a=u);s.headers=aL(o,"Content-Type",(i=a)!==null&&i!==void 0?i:"application/json"),s.body=JSON.stringify(n)}else s.body=n;return e!=null&&e.duplex&&(s.duplex=e.duplex),ne(ne({},s),r)};function aL(t,e,r){const n=ne({},t);for(const s of Object.keys(n))s.toLowerCase()===e.toLowerCase()&&delete n[s];return n[e]=r,n}async function Ga(t,e,r,n,s,i,o){return new Promise((a,l)=>{t(r,oL(e,n,s,i)).then(u=>{if(!u.ok)throw u;if(n!=null&&n.noResolveJson)return u;if(o==="vectors"){const c=u.headers.get("content-type");if(u.headers.get("content-length")==="0"||u.status===204)return{};if(!c||!c.includes("application/json"))return{}}return u.json()}).then(u=>a(u)).catch(u=>iL(u,l,n,o))})}function UE(t="storage"){return{get:async(e,r,n,s)=>Ga(e,"GET",r,n,s,void 0,t),post:async(e,r,n,s,i)=>Ga(e,"POST",r,s,i,n,t),put:async(e,r,n,s,i)=>Ga(e,"PUT",r,s,i,n,t),head:async(e,r,n,s)=>Ga(e,"HEAD",r,ne(ne({},n),{},{noResolveJson:!0}),s,void 0,t),remove:async(e,r,n,s,i)=>Ga(e,"DELETE",r,s,i,n,t)}}const lL=UE("storage"),{get:du,post:Lr,put:Hg,head:uL,remove:ay}=lL,nr=UE("vectors");var ja=class{constructor(t,e={},r,n="storage"){this.shouldThrowOnError=!1,this.url=t,this.headers=Object.fromEntries(Object.entries(e).map(([s,i])=>[s.toLowerCase(),i])),this.fetch=Z$(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=ne(ne({},this.headers),{},{[t.toLowerCase()]:e}),this}async handleOperation(t){var e=this;try{return{data:await t(),error:null}}catch(r){if(e.shouldThrowOnError)throw r;if(Uh(r))return{data:null,error:r};throw r}}},cL=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e}then(t,e){return this.execute().then(t,e)}async execute(){var t=this;try{return{data:(await t.downloadFn()).body,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(Uh(e))return{data:null,error:e};throw e}}};let BE;BE=Symbol.toStringTag;var dL=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[BE]="BlobDownloadBuilder",this.promise=null}asStream(){return new cL(this.downloadFn,this.shouldThrowOnError)}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:await(await t.downloadFn()).blob(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(Uh(e))return{data:null,error:e};throw e}}};const hL={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Qw={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var fL=class extends ja{constructor(t,e={},r,n){super(t,e,n,"storage"),this.bucketId=r}async uploadOrUpdate(t,e,r,n){var s=this;return s.handleOperation(async()=>{let i;const o=ne(ne({},Qw),n);let a=ne(ne({},s.headers),t==="POST"&&{"x-upsert":String(o.upsert)});const l=o.metadata;typeof Blob<"u"&&r instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),l&&i.append("metadata",s.encodeMetadata(l)),i.append("",r)):typeof FormData<"u"&&r instanceof FormData?(i=r,i.has("cacheControl")||i.append("cacheControl",o.cacheControl),l&&!i.has("metadata")&&i.append("metadata",s.encodeMetadata(l))):(i=r,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType,l&&(a["x-metadata"]=s.toBase64(s.encodeMetadata(l))),(typeof ReadableStream<"u"&&i instanceof ReadableStream||i&&typeof i=="object"&&"pipe"in i&&typeof i.pipe=="function")&&!o.duplex&&(o.duplex="half")),n!=null&&n.headers&&(a=ne(ne({},a),n.headers));const u=s._removeEmptyFolders(e),c=s._getFinalPath(u),d=await(t=="PUT"?Hg:Lr)(s.fetch,`${s.url}/object/${c}`,i,ne({headers:a},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{path:u,id:d.Id,fullPath:d.Key}})}async upload(t,e,r){return this.uploadOrUpdate("POST",t,e,r)}
95async uploadToSignedUrl(t,e,r,n){var s=this;const i=s._removeEmptyFolders(t),o=s._getFinalPath(i),a=new URL(s.url+`/object/upload/sign/${o}`);return a.searchParams.set("token",e),s.handleOperation(async()=>{let l;const u=ne(ne({},Qw),n),c=ne(ne({},s.headers),{"x-upsert":String(u.upsert)});return typeof Blob<"u"&&r instanceof Blob?(l=new FormData,l.append("cacheControl",u.cacheControl),l.append("",r)):typeof FormData<"u"&&r instanceof FormData?(l=r,l.append("cacheControl",u.cacheControl)):(l=r,c["cache-control"]=`max-age=${u.cacheControl}`,c["content-type"]=u.contentType),{path:i,fullPath:(await Hg(s.fetch,a.toString(),l,{headers:c})).Key}})}async createSignedUploadUrl(t,e){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(t);const s=ne({},r.headers);e!=null&&e.upsert&&(s["x-upsert"]="true");const i=await Lr(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:s}),o=new URL(r.url+i.url),a=o.searchParams.get("token");if(!a)throw new Fh("No token returned by API");return{signedUrl:o.toString(),path:t,token:a}})}async update(t,e,r){return this.uploadOrUpdate("PUT",t,e,r)}async move(t,e,r){var n=this;return n.handleOperation(async()=>await Lr(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers}))}async copy(t,e,r){var n=this;return n.handleOperation(async()=>({path:(await Lr(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers})).Key}))}async createSignedUrl(t,e,r){var n=this;return n.handleOperation(async()=>{let s=n._getFinalPath(t);const i=typeof(r==null?void 0:r.transform)=="object"&&r.transform!==null&&Object.keys(r.transform).length>0;let o=await Lr(n.fetch,`${n.url}/object/sign/${s}`,ne({expiresIn:e},i?{transform:r.transform}:{}),{headers:n.headers});const a=new URLSearchParams;r!=null&&r.download&&a.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&a.set("cacheNonce",String(r.cacheNonce));const l=a.toString(),u=i&&o.signedURL.includes("/object/sign/")?o.signedURL.replace("/object/sign/","/render/image/sign/"):o.signedURL;return{signedUrl:encodeURI(`${n.url}${u}${l?`&${l}`:""}`)}})}async createSignedUrls(t,e,r){var n=this;return n.handleOperation(async()=>{const s=await Lr(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:e,paths:t},{headers:n.headers}),i=new URLSearchParams;r!=null&&r.download&&i.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&i.set("cacheNonce",String(r.cacheNonce));const o=i.toString();return s.map(a=>ne(ne({},a),{},{signedUrl:a.signedURL?encodeURI(`${n.url}${a.signedURL}${o?`&${o}`:""}`):null}))})}download(t,e,r){const n=typeof(e==null?void 0:e.transform)<"u"?"render/image/authenticated":"object",s=new URLSearchParams;e!=null&&e.transform&&this.applyTransformOptsToQuery(s,e.transform),(e==null?void 0:e.cacheNonce)!=null&&s.set("cacheNonce",String(e.cacheNonce));const i=s.toString(),o=this._getFinalPath(t),a=()=>du(this.fetch,`${this.url}/${n}/${o}${i?`?${i}`:""}`,{headers:this.headers,noResolveJson:!0},r);return new dL(a,this.shouldThrowOnError)}async info(t){var e=this;const r=e._getFinalPath(t);return e.handleOperation(async()=>zg(await du(e.fetch,`${e.url}/object/info/${r}`,{headers:e.headers})))}async exists(t){var e=this;const r=e._getFinalPath(t);try{return await uL(e.fetch,`${e.url}/object/${r}`,{headers:e.headers}),{data:!0,error:null}}catch(s){if(e.shouldThrowOnError)throw s;if(Uh(s)){var n;const i=s instanceof Bg?s.status:s instanceof FE?(n=s.originalError)===null||n===void 0?void 0:n.status:void 0;if(i!==void 0&&[400,404].includes(i))return{data:!1,error:s}}throw s}}getPublicUrl(t,e){const r=this._getFinalPath(t),n=new URLSearchParams;e!=null&&e.download&&n.set("download",e.download===!0?"":e.download),e!=null&&e.transform&&this.applyTransformOptsToQuery(n,e.transform),(e==null?void 0:e.cacheNonce)!=null&&n.set("cacheNonce",String(e.cacheNonce));const s=n.toString(),i=typeof(e==null?void 0:e.transform)<"u"?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${i}/public/${r}`)+(s?`?${s}`:"")}}}async remove(t){var e=this;return e.handleOperation(async()=>await ay(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:t},{headers:e.headers}))}async list(t,e,r){var n=this;return n.handleOperation(async()=>{const s=ne(ne(ne({},hL),e),{},{prefix:t||""});return await Lr(n.fetch,`${n.url}/object/list/${n.bucketId}`,s,{headers:n.headers},r)})}async listV2(t,e){var r=this;return r.handleOperation(async()=>{const n=ne({},t);return await Lr(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},e)})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(t,e){return e.width&&t.set("width",e.width.toString()),e.height&&t.set("height",e.height.toString()),e.resize&&t.set("resize",e.resize),e.format&&t.set("format",e.format),e.quality&&t.set("qual
95ity",e.quality.toString()),t}};const pL="2.103.0",Iu={"X-Client-Info":`storage-js/${pL}`};var gL=class extends ja{constructor(t,e={},r,n){const s=new URL(t);n!=null&&n.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase."));const i=s.href.replace(/\/$/,""),o=ne(ne({},Iu),e);super(i,o,r,"storage")}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const r=e.listBucketOptionsToQueryString(t);return await du(e.fetch,`${e.url}/bucket${r}`,{headers:e.headers})})}async getBucket(t){var e=this;return e.handleOperation(async()=>await du(e.fetch,`${e.url}/bucket/${t}`,{headers:e.headers}))}async createBucket(t,e={public:!1}){var r=this;return r.handleOperation(async()=>await Lr(r.fetch,`${r.url}/bucket`,{id:t,name:t,type:e.type,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:r.headers}))}async updateBucket(t,e){var r=this;return r.handleOperation(async()=>await Hg(r.fetch,`${r.url}/bucket/${t}`,{id:t,name:t,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(t){var e=this;return e.handleOperation(async()=>await Lr(e.fetch,`${e.url}/bucket/${t}/empty`,{},{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await ay(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}listBucketOptionsToQueryString(t){const e={};return t&&("limit"in t&&(e.limit=String(t.limit)),"offset"in t&&(e.offset=String(t.offset)),t.search&&(e.search=t.search),t.sortColumn&&(e.sortColumn=t.sortColumn),t.sortOrder&&(e.sortOrder=t.sortOrder)),Object.keys(e).length>0?"?"+new URLSearchParams(e).toString():""}},mL=class extends ja{constructor(t,e={},r){const n=t.replace(/\/$/,""),s=ne(ne({},Iu),e);super(n,s,r,"storage")}async createBucket(t){var e=this;return e.handleOperation(async()=>await Lr(e.fetch,`${e.url}/bucket`,{name:t},{headers:e.headers}))}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const r=new URLSearchParams;(t==null?void 0:t.limit)!==void 0&&r.set("limit",t.limit.toString()),(t==null?void 0:t.offset)!==void 0&&r.set("offset",t.offset.toString()),t!=null&&t.sortColumn&&r.set("sortColumn",t.sortColumn),t!=null&&t.sortOrder&&r.set("sortOrder",t.sortOrder),t!=null&&t.search&&r.set("search",t.search);const n=r.toString(),s=n?`${e.url}/bucket?${n}`:`${e.url}/bucket`;return await du(e.fetch,s,{headers:e.headers})})}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await ay(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}from(t){var e=this;if(!tL(t))throw new Fh("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const r=new X$({baseUrl:this.url,catalogName:t,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(s,i){const o=s[i];return typeof o!="function"?o:async(...a)=>{try{return{data:await o.apply(s,a),error:null}}catch(l){if(n)throw l;return{data:null,error:l}}}}})}},vL=class extends ja{constructor(t,e={},r){const n=t.replace(/\/$/,""),s=ne(ne({},Iu),{},{"Content-Type":"application/json"},e);super(n,s,r,"vectors")}async createIndex(t){var e=this;return e.handleOperation(async()=>await nr.post(e.fetch,`${e.url}/CreateIndex`,t,{headers:e.headers})||{})}async getIndex(t,e){var r=this;return r.handleOperation(async()=>await nr.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers}))}async listIndexes(t){var e=this;return e.handleOperation(async()=>await nr.post(e.fetch,`${e.url}/ListIndexes`,t,{headers:e.headers}))}async deleteIndex(t,e){var r=this;return r.handleOperation(async()=>await nr.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers})||{})}},yL=class extends ja{constructor(t,e={},r){const n=t.replace(/\/$/,""),s=ne(ne({},Iu),{},{"Content-Type":"application/json"},e);super(n,s,r,"vectors")}async putVectors(t){var e=this;if(t.vectors.length<1||t.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return e.handleOperation(async()=>await nr.post(e.fetch,`${e.url}/PutVectors`,t,{headers:e.headers})||{})}async getVectors(t){var e=this;return e.handleOperation(async()=>await nr.post(e.fetch,`${e.url}/GetVectors`,t,{headers:e.headers}))}async listVectors(t){var e=this;if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");
95if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return e.handleOperation(async()=>await nr.post(e.fetch,`${e.url}/ListVectors`,t,{headers:e.headers}))}async queryVectors(t){var e=this;return e.handleOperation(async()=>await nr.post(e.fetch,`${e.url}/QueryVectors`,t,{headers:e.headers}))}async deleteVectors(t){var e=this;if(t.keys.length<1||t.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return e.handleOperation(async()=>await nr.post(e.fetch,`${e.url}/DeleteVectors`,t,{headers:e.headers})||{})}},_L=class extends ja{constructor(t,e={},r){const n=t.replace(/\/$/,""),s=ne(ne({},Iu),{},{"Content-Type":"application/json"},e);super(n,s,r,"vectors")}async createBucket(t){var e=this;return e.handleOperation(async()=>await nr.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}async getBucket(t){var e=this;return e.handleOperation(async()=>await nr.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:t},{headers:e.headers}))}async listBuckets(t={}){var e=this;return e.handleOperation(async()=>await nr.post(e.fetch,`${e.url}/ListVectorBuckets`,t,{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await nr.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}},wL=class extends _L{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new bL(this.url,this.headers,t,this.fetch)}async createBucket(t){var e=()=>super.createBucket,r=this;return e().call(r,t)}async getBucket(t){var e=()=>super.getBucket,r=this;return e().call(r,t)}async listBuckets(t={}){var e=()=>super.listBuckets,r=this;return e().call(r,t)}async deleteBucket(t){var e=()=>super.deleteBucket,r=this;return e().call(r,t)}},bL=class extends vL{constructor(t,e,r,n){super(t,e,n),this.vectorBucketName=r}async createIndex(t){var e=()=>super.createIndex,r=this;return e().call(r,ne(ne({},t),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(t={}){var e=()=>super.listIndexes,r=this;return e().call(r,ne(ne({},t),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(t){var e=()=>super.getIndex,r=this;return e().call(r,r.vectorBucketName,t)}async deleteIndex(t){var e=()=>super.deleteIndex,r=this;return e().call(r,r.vectorBucketName,t)}index(t){return new xL(this.url,this.headers,this.vectorBucketName,t,this.fetch)}},xL=class extends yL{constructor(t,e,r,n,s){super(t,e,s),this.vectorBucketName=r,this.indexName=n}async putVectors(t){var e=()=>super.putVectors,r=this;return e().call(r,ne(ne({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(t){var e=()=>super.getVectors,r=this;return e().call(r,ne(ne({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(t={}){var e=()=>super.listVectors,r=this;return e().call(r,ne(ne({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(t){var e=()=>super.queryVectors,r=this;return e().call(r,ne(ne({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(t){var e=()=>super.deleteVectors,r=this;return e().call(r,ne(ne({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},kL=class extends gL{constructor(t,e={},r,n){super(t,e,r,n)}from(t){return new fL(this.url,this.headers,t,this.fetch)}get vectors(){return new wL(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new mL(this.url+"/iceberg",this.headers,this.fetch)}};const zE="2.103.0",fo=30*1e3,Wg=3,jf=Wg*fo,SL="http://localhost:9999",EL="supabase.auth.token",CL={"X-Client-Info":`gotrue-js/${zE}`},qg="X-Supabase-Api-Version",HE={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},TL=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,PL=10*60*1e3;class hu extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}}function J(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class RL extends hu{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.co
95de=n}}function AL(t){return J(t)&&t.name==="AuthApiError"}class ci extends hu{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}}class Qn extends hu{constructor(e,r,n,s){super(e,n,s),this.name=r,this.status=n}}class er extends Qn{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function dc(t){return J(t)&&t.name==="AuthSessionMissingError"}class Qi extends Qn{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class hc extends Qn{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class fc extends Qn{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function OL(t){return J(t)&&t.name==="AuthImplicitGrantRedirectError"}class Xw extends Qn{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class jL extends Qn{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class Vg extends Qn{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}}function Nf(t){return J(t)&&t.name==="AuthRetryableFetchError"}class Zw extends Qn{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}}class Kg extends Qn{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const jd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),e0=` 	
96\r=`.split(""),NL=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<e0.length;e+=1)t[e0[e].charCodeAt(0)]=-2;for(let e=0;e<jd.length;e+=1)t[jd[e].charCodeAt(0)]=e;return t})();function t0(t,e,r){if(t!==null)for(e.queue=e.queue<<8|t,e.queuedBits+=8;e.queuedBits>=6;){const n=e.queue>>e.queuedBits-6&63;r(jd[n]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const n=e.queue>>e.queuedBits-6&63;r(jd[n]),e.queuedBits-=6}}function WE(t,e,r){const n=NL[t];if(n>-1)for(e.queue=e.queue<<6|n,e.queuedBits+=6;e.queuedBits>=8;)r(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function r0(t){const e=[],r=o=>{e.push(String.fromCodePoint(o))},n={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=o=>{LL(o,n,r)};for(let o=0;o<t.length;o+=1)WE(t.charCodeAt(o),s,i);return e.join("")}function IL(t,e){if(t<=127){e(t);return}else if(t<=2047){e(192|t>>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function $L(t,e){for(let r=0;r<t.length;r+=1){let n=t.charCodeAt(r);if(n>55295&&n<=56319){const s=(n-55296)*1024&65535;n=(t.charCodeAt(r+1)-56320&65535|s)+65536,r+=1}IL(n,e)}}function LL(t,e,r){if(e.utf8seq===0){if(t<=127){r(t);return}for(let n=1;n<6;n+=1)if(!(t>>7-n&1)){e.utf8seq=n;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&r(e.codepoint)}}function zo(t){const e=[],r={queue:0,queuedBits:0},n=s=>{e.push(s)};for(let s=0;s<t.length;s+=1)WE(t.charCodeAt(s),r,n);return new Uint8Array(e)}function ML(t){const e=[];return $L(t,r=>e.push(r)),new Uint8Array(e)}function gi(t){const e=[],r={queue:0,queuedBits:0},n=s=>{e.push(s)};return t.forEach(s=>t0(s,r,n)),t0(null,r,n),e.join("")}function DL(t){return Math.round(Date.now()/1e3)+t}function FL(){return Symbol("auth-callback")}const dt=()=>typeof window<"u"&&typeof document<"u",Qs={tested:!1,writable:!1},qE=()=>
96{if(!dt())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Qs.tested)return Qs.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),Qs.tested=!0,Qs.writable=!0}catch{Qs.tested=!0,Qs.writable=!1}return Qs.writable};function UL(t){const e={},r=new URL(t);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((s,i)=>{e[i]=s})}catch{}return r.searchParams.forEach((n,s)=>{e[s]=n}),e}const VE=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),BL=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",po=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))},Xs=async(t,e)=>{const r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return r}},ct=async(t,e)=>{await t.removeItem(e)};class Bh{constructor(){this.promise=new Bh.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}}Bh.promiseConstructor=Promise;function pc(t){const e=t.split(".");if(e.length!==3)throw new Kg("Invalid JWT structure");for(let n=0;n<e.length;n++)if(!TL.test(e[n]))throw new Kg("JWT not in base64url format");return{header:JSON.parse(r0(e[0])),payload:JSON.parse(r0(e[1])),signature:zo(e[2]),raw:{header:e[0],payload:e[1]}}}async function zL(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function HL(t,e){return new Promise((n,s)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await t(i);if(!e(i,null,o)){n(o);return}}catch(o){if(!e(i,o)){s(o);return}}})()})}function WL(t){return("0"+t.toString(16)).substr(-2)}function qL(){const e=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let s="";for(let i=0;i<56;i++)s+=r.charAt(Math.floor(Math.random()*n));return s}return crypto.getRandomValues(e),Array.from(e,WL).join("")}async function VL(t){const r=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",r),s=new Uint8Array(n);return Array.from(s).map(i=>String.fromCharCode(i)).join("")}async function KL(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;const r=await VL(t);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Xi(t,e,r=!1){const n=qL();let s=n;r&&(s+="/PASSWORD_RECOVERY"),await po(t,`${e}-code-verifier`,s);const i=await KL(n);return[i,n===i?"plain":"s256"]}const GL=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function YL(t){const e=t.headers.get(qg);if(!e||!e.match(GL))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function JL(t){if(!t)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error("JWT has expired")}function QL(t){switch(t){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const XL=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Zi(t){if(!XL.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function If(){const t={};return new Proxy(t,{get:(e,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function ZL(t,e){return new Proxy(t,{get:(r,n,s)=>{if(n==="__isInsecureUserWarningProxy")return!0;
96if(typeof n=="symbol"){const i=n.toString();if(i==="Symbol(Symbol.toPrimitive)"||i==="Symbol(Symbol.toStringTag)"||i==="Symbol(util.inspect.custom)"||i==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,n,s)}return!e.value&&typeof n=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),e.value=!0),Reflect.get(r,n,s)}})}function n0(t){return JSON.parse(JSON.stringify(t))}const oi=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),eM=[502,503,504];async function s0(t){var e;if(!BL(t))throw new Vg(oi(t),0);if(eM.includes(t.status))throw new Vg(oi(t),t.status);let r;try{r=await t.json()}catch(i){throw new ci(oi(i),i)}let n;const s=YL(t);if(s&&s.getTime()>=HE["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new Zw(oi(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new er}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((i,o)=>i&&typeof o=="string",!0))throw new Zw(oi(r),t.status,r.weak_password.reasons);throw new RL(oi(r),t.status||500,n)}const tM=(t,e,r,n)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),s.body=JSON.stringify(n),Object.assign(Object.assign({},s),r))};async function te(t,e,r,n){var s;const i=Object.assign({},n==null?void 0:n.headers);i[qg]||(i[qg]=HE["2024-01-01"].name),n!=null&&n.jwt&&(i.Authorization=`Bearer ${n.jwt}`);const o=(s=n==null?void 0:n.query)!==null&&s!==void 0?s:{};n!=null&&n.redirectTo&&(o.redirect_to=n.redirectTo);const a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",l=await rM(t,e,r+a,{headers:i,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(l):{data:Object.assign({},l),error:null}}async function rM(t,e,r,n,s,i){const o=tM(e,n,s,i);let a;try{a=await t(r,Object.assign({},o))}catch(l){throw console.error(l),new Vg(oi(l),0)}if(a.ok||await s0(a),n!=null&&n.noResolveJson)return a;try{return await a.json()}catch(l){await s0(l)}}function jr(t){var e;let r=null;iM(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=DL(t.expires_in)));const n=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:r,user:n},error:null}}function i0(t){const e=jr(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(e.data.weak_password=t.weak_password),e}function fs(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function nM(t){return{data:t,error:null}}function sM(t){const{action_link:e,email_otp:r,hashed_token:n,redirect_to:s,verification_type:i}=t,o=Oa(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:e,email_otp:r,hashed_token:n,redirect_to:s,verification_type:i},l=Object.assign({},o);return{data:{properties:a,user:l},error:null}}function o0(t){return t}function iM(t){return t.access_token&&t.refresh_token&&t.expires_in}const $f=["global","local","others"];class oM{constructor({url:e="",headers:r={},fetch:n}){this.url=e,this.headers=r,this.fetch=VE(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)}}async signOut(e,r=$f[0]){if($f.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${$f.join(", ")}`);try{return await te(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if(J(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await te(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:fs})}catch(n){if(J(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{const{options:r}=e,n=Oa(e,["options"]),s=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(s.new_email=n==null?void 0:n.newEmail,delete s.newEmail),await te(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:sM,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(J(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await te(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:fs})}catch(r){if(J(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,s,i,o,a,l;try{const u={nextPage:null,lastPage:0,total:0},c=await te(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e==null?void 0:e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(i=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:o0});if(c.error)throw c.error;const d=await c.json(),h=(o=c.headers.get("x-total-count"))!==null&&o!==void 0?o:0,f=(l=(a=c.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return f.length>0&&(f.forEach(g=>{const p=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(g.split(";")[1].split("=")[1]);u[`${b}Page`]=p}),u.total=parseInt(h)),{data:Object.assign(Object.assign({},d),u),error:null}}catch(u){if(J(u))return{data:{users:[]},error:u};throw u}}async getUserById(e){Zi(e);try{return await te(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:fs})}catch(r){if(J(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){Zi(e);try{return await te(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:fs})}catch(n){if(J(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){Zi(e);
96try{return await te(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:fs})}catch(n){if(J(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){Zi(e.userId);try{const{data:r,error:n}=await te(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:r,error:n}}catch(r){if(J(r))return{data:null,error:r};throw r}}async _deleteFactor(e){Zi(e.userId),Zi(e.id);try{return{data:await te(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if(J(r))return{data:null,error:r};throw r}}async _listOAuthClients(e){var r,n,s,i,o,a,l;try{const u={nextPage:null,lastPage:0,total:0},c=await te(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e==null?void 0:e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(i=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:o0});if(c.error)throw c.error;const d=await c.json(),h=(o=c.headers.get("x-total-count"))!==null&&o!==void 0?o:0,f=(l=(a=c.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return f.length>0&&(f.forEach(g=>{const p=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(g.split(";")[1].split("=")[1]);u[`${b}Page`]=p}),u.total=parseInt(h)),{data:Object.assign(Object.assign({},d),u),error:null}}catch(u){if(J(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(e){try{return await te(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(J(r))return{data:null,error:r};throw r}}async _getOAuthClient(e){try{return await te(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(J(r))return{data:null,error:r};throw r}}async _updateOAuthClient(e,r){try{return await te(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(J(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(e){try{return await te(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(J(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(e){try{return await te(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(J(r))return{data:null,error:r};throw r}}async _listCustomProviders(e){try{const r={};return e!=null&&e.type&&(r.type=e.type),await te(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:r,xform:n=>{var s;return{data:{providers:(s=n==null?void 0:n.providers)!==null&&s!==void 0?s:[]},error:null}}})}catch(r){if(J(r))return{data:{providers:[]},error:r};throw r}}async _createCustomProvider(e){try{return await te(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(J(r))return{data:null,error:r};throw r}}async _getCustomProvider(e){try{return await te(this.fetch,"GET",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(J(r))return{data:null,error:r};throw r}}async _updateCustomProvider(e,r){try{return await te(this.fetch,"PUT",`${this.url}/admin/custom-providers/${e}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(J(n))return{data:null,error:n};throw n}}async _deleteCustomProvider(e){try{return await te(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(J(r))return{data:null,error:r};throw r}}}function a0(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}const en={debug:!!(globalThis&&qE()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};
96class KE extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class l0 extends KE{}async function aM(t,e,r){en.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const n=new globalThis.AbortController;let s;e>0&&(s=setTimeout(()=>{n.abort(),en.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e)),await Promise.resolve();try{return await globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async i=>{if(i){clearTimeout(s),en.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await r()}finally{en.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw en.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new l0(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(en.debug)try{const o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null,"  "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),clearTimeout(s),await r()}})}catch(i){if(e>0&&clearTimeout(s),(i==null?void 0:i.name)==="AbortError"&&e>0){if(n.signal.aborted)return en.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",t),console.warn(`@supabase/gotrue-js: Lock "${t}" was not released within ${e}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,{mode:"exclusive",steal:!0},async o=>{if(o){en.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",t,o.name);try{return await r()}finally{en.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",t,o.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await r()}));throw en.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",t),new l0(`Lock "${t}" was released because another request stole it`)}throw i}}function lM(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function GE(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function uM(t){return parseInt(t,16)}function cM(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,n=>n.toString(16).padStart(2,"0")).join("")}function dM(t){var e;const{chainId:r,domain:n,expirationTime:s,issuedAt:i=new Date,nonce:o,notBefore:a,requestId:l,resources:u,scheme:c,uri:d,version:h}=t;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!d)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(h!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${h}`);if(!((e=t.statement)===null||e===void 0)&&e.includes(`
97`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const f=GE(t.address),g=c?`${c}://${n}`:n,p=t.statement?`${t.statement}
98`:"",b=`${g} wants you to sign in with your Ethereum account:
99${f}
100
101${p}`;let v=`URI: ${d}
102Version: ${h}
103Chain ID: ${r}${o?`
104Nonce: ${o}`:""}
105Issued At: ${i.toISOString()}`;if(s&&(v+=`
106Expiration Time: ${s.toISOString()}`),a&&(v+=`
107Not Before: ${a.toISOString()}`),l&&(v+=`
108Request ID: ${l}`),u){let y=`
109Resources:`;for(const _ of u){if(!_||typeof _!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${_}`);y+=`
110- ${_}`}v+=y}return`${b}
111${v}`}
111class rt extends Error{constructor({message:e,code:r,cause:n,name:s}){var i;super(e,{cause:n}),this.__isWebAuthnError=!0,this.name=(i=s??(n instanceof Error?n.name:void 0))!==null&&i!==void 0?i:"Unknown Error",this.code=r}}class Nd extends rt{constructor(e,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:e}),this.name="WebAuthnUnknownError",this.originalError=r}}function hM({error:t,options:e}){var r,n,s;const{publicKey:i}=e;if(!i)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new rt({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((r=i.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new rt({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&((n=i.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new rt({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((s=i.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new rt({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new rt({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new rt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return i.pubKeyCredParams.filter(a=>a.type==="public-key").length===0?new rt({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new rt({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const o=window.location.hostname;if(YE(o)){if(i.rp.id!==o)return new rt({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new rt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new rt({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new rt({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new rt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function fM({error:t,options:e}){const{publicKey:r}=e;if(!r)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new rt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new rt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const n=window.location.hostname;if(YE(n)){if(r.rpId!==n)return new rt({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new rt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new rt({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new rt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class pM{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const gM=new pM;function mM(t){if(!t)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(t);const{challenge:e,user:r,excludeCredentials:n}=t,s=Oa(t,["challenge","user","excludeCredentials"]),i=zo(e).buffer,o=Object.assign(Object.assign({},r),{id:zo(r.id).buffer}),a=Object.assign(Object.assign({}
111,s),{challenge:i,user:o});if(n&&n.length>0){a.excludeCredentials=new Array(n.length);for(let l=0;l<n.length;l++){const u=n[l];a.excludeCredentials[l]=Object.assign(Object.assign({},u),{id:zo(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return a}function vM(t){if(!t)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(t);const{challenge:e,allowCredentials:r}=t,n=Oa(t,["challenge","allowCredentials"]),s=zo(e).buffer,i=Object.assign(Object.assign({},n),{challenge:s});if(r&&r.length>0){i.allowCredentials=new Array(r.length);for(let o=0;o<r.length;o++){const a=r[o];i.allowCredentials[o]=Object.assign(Object.assign({},a),{id:zo(a.id).buffer,type:a.type||"public-key",transports:a.transports})}}return i}function yM(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const r=t;return{id:t.id,rawId:t.id,response:{attestationObject:gi(new Uint8Array(t.response.attestationObject)),clientDataJSON:gi(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function _M(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const r=t,n=t.getClientExtensionResults(),s=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:gi(new Uint8Array(s.authenticatorData)),clientDataJSON:gi(new Uint8Array(s.clientDataJSON)),signature:gi(new Uint8Array(s.signature)),userHandle:s.userHandle?gi(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function YE(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function u0(){var t,e;return!!(dt()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.create)=="function"&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.get)=="function")}async function wM(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Nd("Browser returned unexpected credential type",e)}:{data:null,error:new Nd("Empty credential response",e)}}catch(e){return{data:null,error:hM({error:e,options:t})}}}async function bM(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Nd("Browser returned unexpected credential type",e)}:{data:null,error:new Nd("Empty credential response",e)}}catch(e){return{data:null,error:fM({error:e,options:t})}}}const xM={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},kM={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Id(...t){const e=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),r=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),n={};for(const s of t)if(s)for(const i in s){const o=s[i];if(o!==void 0)if(Array.isArray(o))n[i]=o;else if(r(o))n[i]=o;else if(e(o)){const a=n[i];e(a)?n[i]=Id(a,o):n[i]=Id(o)}else n[i]=o}return n}function SM(t,e){return Id(xM,t,e||{})}function EM(t,e){return Id(kM,t,e||{})}class CM{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:r,friendlyName:n,signal:s},i){var o;try{const{data:a,error:l}=await this.client.mfa.challenge({factorId:e,webauthn:r});if(!a)return{data:null,error:l};const u=s??gM.createNewAbortSignal();if(a.webauthn.type==="create"){const{user:c}=a.webauthn.credential_options.publicKey;if(!c.name){const d=n;if(d)c.name=`${c.id}:${d}`;else{const f=(await this.client.getUser()).data.user,g=((o=f==null?void 0:f.user_metadata)===null||o===void 0?void 0:o.name)||(f==null?void 0:f.email)||(f==null?void 0:f.id)||"User";c.name=`${c.id}:${g}`}}c.displayName||(c.displayName=c.name)}switch(a.webauthn.type){case"create":{const c=SM(a.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:d,error:h}=await wM({publicKey:c,signal:u});return d?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:d}},error:null}:{data:null,error:h}}case"request":{const c=EM(a.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:d,error:h}=await bM(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:c,signal:u}));return d?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:d}},error:null}:{data:null,error:h}}}}catch(a){return J(a)?{data:null,error:a}:{data:null,error:new ci("Unexpected error in challenge",a)}}}async _verify({challengeId:e,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:e,webauthn:n})}async _authenticate({factorId:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},i){if(!r)return{data:null,error:new hu("rpId is required for WebAuthn authentication")};try{if(!u0())return{data:null,error:new ci("Browser does not support WebAuthn",null)};const{data:o,error:a}=await this.challenge({factorId:e,webauthn:{rpId:r,rpOrigins:n},signal:s},{request:i});if(!o)return{data:null,error:a};const{webauthn:l}=o;return this._verify({factorId:e,challengeId:o.challengeId,webauthn:{type:l.type,rpId:r,rpOrigins:n,credential_response:l.credential_response}})}catch(o){return J(o)?{data:null,error:o}:{data:null,error:new ci("Unexpected error in authenticate",o)}}}async _register({friendlyName:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},i){if(!r)return{data:null,error:new hu("rpId is required for WebAuthn registration")};try{if(!u0())return{data:null,error:new ci("Browser does not support WebAuthn",null)};const{data:o,error:a}=await this._enroll({friendlyName:e});if(!o)return await this.client.mfa.listFactors().then(c=>{var d;return(d=c.data)===null||d===void 0?void 0:d.all.find(h=>h.factor_type==="webauthn"&&h.friendly_name===e&&h.status!=="unverified")}).then(c=>c?this.client.mfa.unenroll({factorId:c==null?void 0:c.id}):void 0),{data:null,error:a};const{data:l,error:u}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:s},{create:i});return l?this._verify({factorId:o.id,challengeId:l.challengeId,webauthn:{rpId:r,rpOrigins:n,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:u}}catch(o){return J(o)?{data:null,error:o}:{data:null,error:new ci("Unexpected error in register",o)}}}}lM();const TM={url:SL,storageKey:EL,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:CL,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1};async function c0(t,e,r){return await r()}const eo={};class fu{get jwks(){var e,r;return(r=(e=eo[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(e){eo[this.storageKey]=Object.assign(Object.assign({},eo[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,r;return(r=(e=eo[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){eo[this.storageKey]=Object.assign(Object.assign({},eo[this.storageKey]),{cachedAt:e})}constructor(e){var r,n,s;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const i=Object.assign(Object.assign({},TM),e);if(this.storageKey=i.storageKey,this.instanceID=(r=fu.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,fu.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.instanceID>0&&dt()){const o=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(o),this.logDebugMessages&&console.trace(o)}if(this.persistSession=i.persistSession,this.autoRefreshToken=i.autoRefreshToken,this.admin=new oM({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=VE(i.fetch),this.lock=i.lock||c0,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,this.throwOnError=i.throwOnError,this.lockAcquireTimeout=i.lockAcquireTimeout,i.lock?this.lock=i.lock:this.persistSession&&dt()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=aM:this.lock=c0,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new CM(this)}
111,this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(i.storage?this.storage=i.storage:qE()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=a0(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=a0(this.memoryStorage)),dt()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o);try{await this._notifyAllSubscribers(o.data.event,o.data.session,!1)}catch(a){this._debug("#broadcastChannel","error",a)}})}i.skipAutoInitialize||this.initialize().catch(o=>{this._debug("#initialize()","error",o)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${zE}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{let r={},n="none";if(dt()&&(r=UL(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),dt()&&this.detectSessionInUrl&&n!=="none"){const{data:s,error:i}=await this._getSessionFromURL(r,n);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),OL(i)){const l=(e=i.details)===null||e===void 0?void 0:e.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:i}}return{error:i}}const{session:o,redirectType:a}=s;return this._debug("#_initialize()","detected session in URL",o,"redirect type",a),await this._saveSession(o),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return J(r)?this._returnResult({error:r}):this._returnResult({error:new ci("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,s;try{const i=await te(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(s=e==null?void 0:e.options)===null||s===void 0?void 0:s.captchaToken}},xform:jr}),{data:o,error:a}=i;if(a||!o)return this._returnResult({data:{user:null,session:null},error:a});const l=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(i){if(J(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signUp(e){var r,n,s;try{let i;if("email"in e){const{email:c,password:d,options:h}=e;let f=null,g=null;this.flowType==="pkce"&&([f,g]=await Xi(this.storage,this.storageKey)),i=await te(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h==null?void 0:h.emailRedirectTo,body:{email:c,password:d,data:(r=h==null?void 0:h.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken},code_challenge:f,code_challenge_method:g},xform:jr})}else if("phone"in e){const{phone:c,password:d,options:h}=e;i=await te(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:c,password:d,data:(n=h==null?void 0:h.data)!==null&&n!==void 0?n:{},channel:(s=h==null?void 0:h.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken}},xform:jr})}else throw new hc("You must provide either an email or phone number and a password");const{data:o,error:a}=i;if(a||!o)return await ct(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:a});const l=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(i){if(await ct(this.storage,`${this.storageKey}-code-verifier`),J(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithPassword(e){try{let r;if("email"in e){const{email:i,password:o,options:a}=e;r=await te(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:i0})}else if("phone"in e){const{phone:i,password:o,options:a}=e;r=await te(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:i0})}else throw new hc("You must provide either an email or phone number and a password");const{data:n,error:s}=r;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!n||!n.session||!n.user){const i=new Qi;return this._returnResult({data:{user:null,session:null},error:i})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:s})}catch(r){if(J(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(e){var r,n,s,i;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=e.options)===null||n===void 0?void 0:n.scopes,queryParams:(s=e.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(i=e.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:r}=e;switch(r){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(e){var r,n,s,i,o,a,l,u,c,d,h;let f,g;if("message"in e)f=e.message,g=e.signature;else{const{chain:p,wallet:b,statement:v,options:y}=e;let _;if(dt())if(typeof b=="object")_=b;else{const P=window;if("ethereum"in P&&typeof P.ethereum=="object"&&"request"in P.ethereum&&typeof P.ethereum.request=="function")_=P.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof b!="object"||!(y!=null&&y.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");_=b}const x=new URL((r=y==null?void 0:y.url)!==null&&r!==void 0?r:window.location.href),k=await _.request({method:"eth_requestAccounts"}).then(P=>P).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!k||k.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const C=GE(k[0]);let T=(n=y==null?void 0:y.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!T){const P=await _.request({method:"eth_chainId"});T=uM(P)}const S={domain:x.host,address:C,statement:v,uri:x.href,version:"1",chainId:T,nonce:(s=y==null?void 0:y.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(o=(i=y==null?void 0:y.signInWithEthereum)===null||i===void 0?void 0:i.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(a=y==null?void 0:y.signInWithEthereum)===null||a===void 0?void 0:a.expirationTime,notBefore:(l=y==null?void 0:y.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(u=y==null?void 0:y.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(c=y==null?void 0:y.signInWithEthereum)===null||c===void 0?void 0:c.resources};f=dM(S),g=await _.request({method:"personal_sign",params:[cM(f),C]})}try{const{data:p,error:b}=await te(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:f,signature:g},!((d=e.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(h=e.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:jr});if(b)throw b;if(!p||!p.session||!p.user){const v=new Qi;return this._returnResult({data:{user:null,session:null},error:v})}return p.session&&(await this._saveSession(p.session),await this._notifyAllSubscribers("SIGNED_IN",p.session)),this._returnResult({data:Object.assign({},p),error:b})}catch(p){if(J(p))return this._returnResult({data:{user:null,session:null},error:p});throw p}}async signInWithSolana(e){var r,n,s,i,o,a,l,u,c,d,h,f;let g,p;if("message"in e)g=e.message,p=e.signature;else{const{chain:b,wallet:v,statement:y,options:_}=e;let x;if(dt())if(typeof v=="object")x=v;else{const C=window;if("solana"in C&&typeof C.solana=="object"&&("signIn"in C.solana&&typeof C.solana.signIn=="function"||"signMessage"in C.solana&&typeof C.solana.signMessage=="function"))x=C.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof v!="object"||!(_!=null&&_.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");x=v}const k=new URL((r=_==null?void 0:_.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in x&&x.signIn){const C=await x.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},_==null?void 0:_.signInWithSolana),{version:"1",domain:k.host,uri:k.href}),y?{statement:y}:null));let T;if(Array.isArray(C)&&C[0]&&typeof C[0]=="object")T=C[0];else if(C&&typeof C=="object"&&"signedMessage"in C&&"signature"in C)T=C;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in T&&"signature"in T&&(typeof T.signedMessage=="string"||T.signedMessage instanceof Uint8Array)&&T.signature instanceof Uint8Array)g=typeof T.signedMessage=="string"?T.signedMessage:new TextDecoder().decode(T.signedMessage),p=T.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in x)||typeof x.signMessage!="function"||!("publicKey"in x)||typeof x!="object"||!x.publicKey||!("toBase58"in x.publicKey)||typeof x.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");g=[`${k.host} wants you to sign in with your Solana account:`,x.publicKey.toBase58(),...y?["",y,""]:[""],"Version: 1",`URI: ${k.href}`,`Issued At: ${(s=(n=_==null?void 0:_.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((i=_==null?void 0:_.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${_.signInWithSolana.notBefore}`]:[],...!((o=_==null?void 0:_.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${_.signInWithSolana.expirationTime}`]:[],...!((a=_==null?void 0:_.signInWithSolana)===null||a===void 0)&&a.chainId?[`Chain ID: ${_.signInWithSolana.chainId}`]:[],...!((l=_==null?void 0:_.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${_.signInWithSolana.nonce}`]:[],...!((u=_==null?void 0:_.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${_.signInWithSolana.requestId}`]:[],...!((d=(c=_==null?void 0:_.signInWithSolana)===null||c===void 0?void 0:c.resources)===null||d===void 0)&&d.length?["Resources",..._.signInWithSolana.resources.map(T=>`- ${T}`)]:[]].join(`
112`);const C=await x.signMessage(new TextEncoder().encode(g),"utf8");if(!C||!(C instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");p=C}}try{const{data:b,error:v}=await te(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:g,signature:gi(p)}
112,!((h=e.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(f=e.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:jr});if(v)throw v;if(!b||!b.session||!b.user){const y=new Qi;return this._returnResult({data:{user:null,session:null},error:y})}return b.session&&(await this._saveSession(b.session),await this._notifyAllSubscribers("SIGNED_IN",b.session)),this._returnResult({data:Object.assign({},b),error:v})}catch(b){if(J(b))return this._returnResult({data:{user:null,session:null},error:b});throw b}}async _exchangeCodeForSession(e){const r=await Xs(this.storage,`${this.storageKey}-code-verifier`),[n,s]=(r??"").split("/");try{if(!n&&this.flowType==="pkce")throw new jL;const{data:i,error:o}=await te(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:jr});if(await ct(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!i||!i.session||!i.user){const a=new Qi;return this._returnResult({data:{user:null,session:null,redirectType:null},error:a})}return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),this._returnResult({data:Object.assign(Object.assign({},i),{redirectType:s??null}),error:o})}catch(i){if(await ct(this.storage,`${this.storageKey}-code-verifier`),J(i))return this._returnResult({data:{user:null,session:null,redirectType:null},error:i});throw i}}async signInWithIdToken(e){try{const{options:r,provider:n,token:s,access_token:i,nonce:o}=e,a=await te(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:s,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:jr}),{data:l,error:u}=a;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!l||!l.session||!l.user){const c=new Qi;return this._returnResult({data:{user:null,session:null},error:c})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:l,error:u})}catch(r){if(J(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(e){var r,n,s,i,o;try{if("email"in e){const{email:a,options:l}=e;let u=null,c=null;this.flowType==="pkce"&&([u,c]=await Xi(this.storage,this.storageKey));const{error:d}=await te(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(r=l==null?void 0:l.data)!==null&&r!==void 0?r:{},create_user:(n=l==null?void 0:l.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:u,code_challenge_method:c},redirectTo:l==null?void 0:l.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:d})}if("phone"in e){const{phone:a,options:l}=e,{data:u,error:c}=await te(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(s=l==null?void 0:l.data)!==null&&s!==void 0?s:{},create_user:(i=l==null?void 0:l.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(o=l==null?void 0:l.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:c})}throw new hc("You must provide either an email or phone number.")}catch(a){if(await ct(this.storage,`${this.storageKey}-code-verifier`),J(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async verifyOtp(e){var r,n;try{let s,i;"options"in e&&(s=(r=e.options)===null||r===void 0?void 0:r.redirectTo,i=(n=e.options)===null||n===void 0?void 0:n.captchaToken);const{data:o,error:a}=await te(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:s,xform:jr});if(a)throw a;if(!o)throw new Error("An error occurred on token verification.");const l=o.session,u=o.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(s){if(J(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(e){var r,n,s,i,o;try{let a=null,l=null;this.flowType==="pkce"&&([a,l]=await Xi(this.storage,this.storageKey));const u=await te(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(n=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((s=e==null?void 0:e.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:a,code_challenge_method:l}),headers:this.headers,xform:nM});return!((i=u.data)===null||i===void 0)&&i.url&&dt()&&!(!((o=e.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(a){if(await ct(this.storage,`${this.storageKey}-code-verifier`),J(a))return this._returnResult({data:null,error:a});throw a}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;if(n)throw n;if(!r)throw new er;const{error:s}=await te(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(e){if(J(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const r=`${this.url}/resend`;if("email"in e){const{email:n,type:s,options:i}=e,{error:o}=await te(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},redirectTo:i==null?void 0:i.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}else if("phone"in e){const{phone:n,type:s,options:i}=e,{data:o,error:a}=await te(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:a})}throw new hc("You must provide either an email or phone number and a type")}catch(r){if(J(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async r=>r))}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const r=await Xs(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not val
112id"),await this._removeSession())),!e)return{data:{session:null},error:null};const n=e.expires_at?e.expires_at*1e3-Date.now()<jf:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.userStorage){const o=await Xs(this.userStorage,this.storageKey+"-user");o!=null&&o.user?e.user=o.user:e.user=If()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};e.user=ZL(e.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:s,error:i}=await this._callRefreshToken(e.refresh_token);return i?this._returnResult({data:{session:null},error:i}):this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;const r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(e){try{return e?await te(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:fs}):await this._useSession(async r=>{var n,s,i;const{data:o,error:a}=r;if(a)throw a;return!(!((n=o.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new er}:await te(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(s=o.session)===null||s===void 0?void 0:s.access_token)!==null&&i!==void 0?i:void 0,xform:fs})})}catch(r){if(J(r))return dc(r)&&(await this._removeSession(),await ct(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(e,r={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,r))}async _updateUser(e,r={}){try{return await this._useSession(async n=>{const{data:s,error:i}=n;if(i)throw i;if(!s.session)throw new er;const o=s.session;let a=null,l=null;this.flowType==="pkce"&&e.email!=null&&([a,l]=await Xi(this.storage,this.storageKey));const{data:u,error:c}=await te(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:l}),jwt:o.access_token,xform:fs});if(c)throw c;return o.user=u.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(n){if(await ct(this.storage,`${this.storageKey}-code-verifier`),J(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new er;const r=Date.now()/1e3;let n=r,s=!0,i=null;const{payload:o}=pc(e.access_token);if(o.exp&&(n=o.exp,s=n<=r),s){const{data:a,error:l}=await this._callRefreshToken(e.refresh_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!a)return{data:{user:null,session:null},error:null};i=a}else{const{data:a,error:l}=await this._getUser(e.access_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});i={access_token:e.access_token,refresh_token:e.refresh_token,user:a.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(r){if(J(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){const{data:o,error:a}=r;if(a)throw a;e=(n=o.session)!==null&&n!==void 0?n:void 0}if(!(e!=null&&e.refresh_token))throw new er;const{data:s,error:i}=await this._callRefreshToken(e.refresh_token);return i?this._returnResult({data:{user:null,session:null},error:i}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(J(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(e,r){try{if(!dt())throw new fc("No browser detected.");
112if(e.error||e.error_description||e.error_code)throw new fc(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new Xw("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new fc("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new Xw("No code detected.");const{data:y,error:_}=await this._exchangeCodeForSession(e.code);if(_)throw _;const x=new URL(window.location.href);return x.searchParams.delete("code"),window.history.replaceState(window.history.state,"",x.toString()),{data:{session:y.session,redirectType:null},error:null}}const{provider_token:n,provider_refresh_token:s,access_token:i,refresh_token:o,expires_in:a,expires_at:l,token_type:u}=e;if(!i||!a||!o||!u)throw new fc("No session defined in URL");const c=Math.round(Date.now()/1e3),d=parseInt(a);let h=c+d;l&&(h=parseInt(l));const f=h-c;f*1e3<=fo&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${f}s, should have been closer to ${d}s`);const g=h-d;c-g>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",g,h,c):c-g<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",g,h,c);const{data:p,error:b}=await this._getUser(i);if(b)throw b;const v={provider_token:n,provider_refresh_token:s,access_token:i,expires_in:d,expires_at:h,refresh_token:o,token_type:u,user:p.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:v,redirectType:e.type},error:null})}catch(n){if(J(n))return this._returnResult({data:{session:null,redirectType:null},error:n});throw n}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error_description)}async _isPKCECallback(e){const r=await Xs(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:s,error:i}=r;if(i&&!dc(i))return this._returnResult({error:i});const o=(n=s.session)===null||n===void 0?void 0:n.access_token;if(o){const{error:a}=await this.admin.signOut(o,e);if(a&&!(AL(a)&&(a.status===404||a.status===401||a.status===403)||dc(a)))return this._returnResult({error:a})}return e!=="others"&&(await this._removeSession(),await ct(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const r=FL(),n={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async r=>{var n,s;try{const{data:{session:i},error:o}=r;if(o)throw o;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",e,"session",i)}catch(i){await((s=this.stateChangeEmitters.get(e))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",i),dc(i)?console.warn(i):console.error(i)}})}async resetPasswordForEmail(e,r={}){let n=null,s=null;this.flowType==="pkce"&&([n,s]=await Xi(this.storage,this.storageKey,!0));try{return await te(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:s,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(i){if(await ct(this.storage,`${this.storageKey}-code-verifier`),J(i))return this._returnResult({data:null,error:i});throw i}}async getUserIdentities(){var e;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(r){if(J(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var r;try{const{data:n,error:s}=await this._useSession(async i=>{var o,a,l,u,c;const{data:d,error:h}=i;if(h)throw h;const f=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(o=e.options)===null||o===void 0?void 0:o.redirectTo,scopes:(a=e.options)===null||a===void 0?void 0:a.scopes,queryParams:(l=e.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await te(this.fetch,"GET",f,{headers:this.headers,jwt:(c=(u=d.session)===null||u===void 0?void 0:u.access_token)!==null&&c!==void 0?c:void 0})});if(s)throw s;return dt()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:e.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(J(n))return this._returnResult({data:{provider:e.provider,url:null},error:n});throw n}}async linkIdentityIdToken(e){return await this._useSession(async r=>{var n;try{const{error:s,data:{session:i}}=r;if(s)throw s;const{options:o,provider:a,token:l,access_token:u,nonce:c}=e,d=await te(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=i==null?void 0:i.access_token)!==null&&n!==void 0?n:void 0,body:{provider:a,id_token:l,access_token:u,nonce:c,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:jr}),{data:h,error:f}=d;return f?this._returnResult({data:{user:null,session:null},error:f}):!h||!h.session||!h.user?this._returnResult({data:{user:null,session:null},error:new Qi}):(h.session&&(await this._saveSession(h.session),await this._notifyAllSubscribers("USER_UPDATED",h.session)),this._returnResult({data:h,error:f}))}catch(s){if(await ct(this.storage,`${this.storageKey}-code-verifier`),J(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(e){try{return await this._useSession(async r=>{var n,s;const{data:i,error:o}=r;if(o)throw o;
112return await te(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(s=(n=i.session)===null||n===void 0?void 0:n.access_token)!==null&&s!==void 0?s:void 0})})}catch(r){if(J(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(e){const r=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{const n=Date.now();return await HL(async s=>(s>0&&await zL(200*Math.pow(2,s-1)),this._debug(r,"refreshing attempt",s),await te(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:jr})),(s,i)=>{const o=200*Math.pow(2,s);return i&&Nf(i)&&Date.now()+o-n<fo})}catch(n){if(this._debug(r,"error",n),J(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){const n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",n),dt()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e,r;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const s=await Xs(this.storage,this.storageKey);if(s&&this.userStorage){let o=await Xs(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:s.user},await po(this.userStorage,this.storageKey+"-user",o)),s.user=(e=o==null?void 0:o.user)!==null&&e!==void 0?e:If()}else if(s&&!s.user&&!s.user){const o=await Xs(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(s.user=o.user,await ct(this.storage,this.storageKey+"-user"),await po(this.storage,this.storageKey,s)):s.user=If()}if(this._debug(n,"session from storage",s),!this._isValidSession(s)){this._debug(n,"session is not valid"),s!==null&&await this._removeSession();return}const i=((r=s.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<jf;if(this._debug(n,`session has${i?"":" not"} expired with margin of ${jf}s`),i){if(this.autoRefreshToken&&s.refresh_token){const{error:o}=await this._callRefreshToken(s.refresh_token);o&&(console.error(o),Nf(o)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:a}=await this._getUser(s.access_token);!a&&(o!=null&&o.user)?(s.user=o.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(n,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(n,"error",s),console.error(s);return}finally{this._debug(n,"end")}}async _callRefreshToken(e){var r,n;if(!e)throw new er;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new Bh;const{data:i,error:o}=await this._refreshAccessToken(e);if(o)throw o;if(!i.session)throw new er;await this._saveSession(i.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const a={data:i.session,error:null};return this.refreshingDeferred.resolve(a),a}catch(i){if(this._debug(s,"error",i),J(i)){const o={data:null,error:i};return Nf(i)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(o),o}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(i),i}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(e,r,n=!0){const s=`#_notifyAllSubscribers(${e})`;this._debug(s,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:r});const i=[],o=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(e,r)}catch(l){i.push(l)}});if(await Promise.all(o),i.length>0){for(let a=0;a<i.length;a+=1)console.error(i[a]);throw i[0]}}finally{this._debug(s,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await ct(this.storage,`${this.storageKey}-code-verifier`);const r=Object.assign({},e),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await po(this.userStorage,this.storageKey+"-user",{user:r.user});const s=Object.assign({},r);delete s.user;const i=n0(s);await po(this.storage,this.storageKey,i)}else{const s=n0(r);await po(this.storage,this.storageKey,s)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await ct(this.storage,this.storageKey),await ct(this.storage,this.storageKey+"-code-verifier"),await ct(this.storage,this.storageKey+"-user"),this.userStorage&&await ct(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&dt()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}
112catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),fo);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e);const r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);const r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((n.expires_at*1e3-e)/fo);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${fo}ms, refresh threshold is ${Wg} ticks`),s<=Wg&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof KE)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!dt()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug("#visibilityChangedCallback","error",e)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const r=`#_onVisibilityChanged(${e})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,n){const s=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&s.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&s.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[i,o]=await Xi(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});s.push(a.toString())}if(n!=null&&n.queryParams){const i=new URLSearchParams(n.queryParams);s.push(i.toString())}return n!=null&&n.skipBrowserRedirect&&s.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${s.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var n;const{data:s,error:i}=r;return i?this._returnResult({data:null,error:i}):await te(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(J(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(e){try{return await this._useSession(async r=>{var n,s;const{data:i,error:o}=r;if(o)return this._returnResult({data:null,error:o});const a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:l,error:u}=await te(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});return u?this._returnResult({data:null,error:u}):(e.factorType==="totp"&&l.type==="totp"&&(!((s=l==null?void 0:l.totp)===null||s===void 0)&&s.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),this._returnResult({data:l,error:null}))})}catch(r){if(J(r))return this._returnResult({data:null,error:r});throw r}}async _verify(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:i}=r;if(i)return this._returnResult({data:null,error:i});const o=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?yM(e.webauthn.credential_response):_M(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:l}=await te(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:o,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});return l?this._returnResult({data:null,error:l}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",a),this._returnResult({data:a,error:l}))})}catch(r){if(J(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:i}=r;if(i)return this._returnResult({data:null,error:i});const o=await te(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});if(o.error)return o;const{data:a}=o;if(a.type!=="webauthn")return{data:a,error:null};switch(a.webauthn.type){case"create":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:mM(a.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:vM(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(J(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(e){const{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){var e;const{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};const s={all:[],phone:[],totp:[],webauthn:[]};for(const i of(e=r==null?void 0:r.factors)!==null&&e!==void 0?e:[])s.all.push(i),i.status==="verified"&&s[i.factor_type].push(i);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(e){var r,n,s,i;if(e)try{const{payload:f}=pc(e);let g=null;f.aal&&(g=f.aal);let p=g;const{data:{user:b},error:v}=await this.getUser(e);if(v)return this._returnResult({data:null,error:v});((n=(r=b==null?void 0:b.factors)===null||r===void 0?void 0:r.filter(x=>x.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(p="aal2");const _=f.amr||[];return{data:{currentLevel:g,nextLevel:p,currentAuthenticationMethods:_},error:null}}catch(f){if(J(f))return this._returnResult({data:null,error:f});throw f}const{data:{session:o},error:a}
112=await this.getSession();if(a)return this._returnResult({data:null,error:a});if(!o)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:l}=pc(o.access_token);let u=null;l.aal&&(u=l.aal);let c=u;((i=(s=o.user.factors)===null||s===void 0?void 0:s.filter(f=>f.status==="verified"))!==null&&i!==void 0?i:[]).length>0&&(c="aal2");const h=l.amr||[];return{data:{currentLevel:u,nextLevel:c,currentAuthenticationMethods:h},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?await te(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new er})})}catch(r){if(J(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(e,r){try{return await this._useSession(async n=>{const{data:{session:s},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new er});const o=await te(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:a=>({data:a,error:null})});return o.data&&o.data.redirect_url&&dt()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(J(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(e,r){try{return await this._useSession(async n=>{const{data:{session:s},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new er});const o=await te(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:a=>({data:a,error:null})});return o.data&&o.data.redirect_url&&dt()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(J(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;return n?this._returnResult({data:null,error:n}):r?await te(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new er})})}catch(e){if(J(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?(await te(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new er})})}catch(r){if(J(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(e,r={keys:[]}){let n=r.keys.find(a=>a.kid===e);if(n)return n;const s=Date.now();if(n=this.jwks.keys.find(a=>a.kid===e),n&&this.jwks_cached_at+PL>s)return n;const{data:i,error:o}=await te(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=s,n=i.keys.find(a=>a.kid===e),!n)?null:n}async getClaims(e,r={}){try{let n=e;if(!n){const{data:f,error:g}
112=await this.getSession();if(g||!f.session)return this._returnResult({data:null,error:g});n=f.session.access_token}const{header:s,payload:i,signature:o,raw:{header:a,payload:l}}=pc(n);r!=null&&r.allowExpired||JL(i.exp);const u=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!u){const{error:f}=await this.getUser(n);if(f)throw f;return{data:{claims:i,header:s,signature:o},error:null}}const c=QL(s.alg),d=await crypto.subtle.importKey("jwk",u,c,!0,["verify"]);if(!await crypto.subtle.verify(c,d,o,ML(`${a}.${l}`)))throw new Kg("Invalid JWT signature");return{data:{claims:i,header:s,signature:o},error:null}}catch(n){if(J(n))return this._returnResult({data:null,error:n});throw n}}}fu.nextInstanceID={};const PM=fu,RM="2.103.0";let hl="";typeof Deno<"u"?hl="deno":typeof document<"u"?hl="web":typeof navigator<"u"&&navigator.product==="ReactNative"?hl="react-native":hl="node";const AM={"X-Client-Info":`supabase-js-${hl}/${RM}`},OM={headers:AM},jM={schema:"public"},NM={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},IM={};function pu(t){"@babel/helpers - typeof";return pu=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},pu(t)}function $M(t,e){if(pu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(pu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function LM(t){var e=$M(t,"string");return pu(e)=="symbol"?e:e+""}function MM(t,e,r){return(e=LM(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function d0(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function Ke(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?d0(Object(r),!0).forEach(function(n){MM(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):d0(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}const DM=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),FM=()=>Headers,UM=(t,e,r)=>{const n=DM(r),s=FM();return async(i,o)=>{var a;const l=(a=await e())!==null&&a!==void 0?a:t;let u=new s(o==null?void 0:o.headers);return u.has("apikey")||u.set("apikey",t),u.has("Authorization")||u.set("Authorization",`Bearer ${l}`),n(i,Ke(Ke({},o),{},{headers:u}))}};function BM(t){return t.endsWith("/")?t:t+"/"}function zM(t,e){var r,n;const{db:s,auth:i,realtime:o,global:a}=t,{db:l,auth:u,realtime:c,global:d}=e,h={db:Ke(Ke({},l),s),auth:Ke(Ke({},u),i),realtime:Ke(Ke({},c),o),storage:{},global:Ke(Ke(Ke({},d),a),{},{headers:Ke(Ke({},(r=d==null?void 0:d.headers)!==null&&r!==void 0?r:{}),(n=a==null?void 0:a.headers)!==null&&n!==void 0?n:{})}),accessToken:async()=>""};return t.accessToken?h.accessToken=t.accessToken:delete h.accessToken,h}function HM(t){const e=t==null?void 0:t.trim();if(!e)throw new Error("supabaseUrl is required.");if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(BM(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var WM=class extends PM{constructor(t){super(t)}},qM=class{constructor(t,e,r){var n,s;this.supabaseUrl=t,this.supabaseKey=e;const i=HM(t);if(!e)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",i),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",i),this.storageUrl=new URL("storage/v1",i),this.functionsUrl=new URL("functions/v1",i);const o=`sb-${i.hostname.split(".")[0]}-auth-token`,a={db:jM,realtime:IM,auth:Ke(Ke({},NM),{},{storageKey:o}),global:OM},l=zM(r??{},a);if(this.storageKey=(n=l.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(s=l.global.headers)!==null&&s!==void 0?s:{},l.accessToken)this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(c,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=l.auth)!==null&&u!==void 0?u:{},this.headers,l.global.fetch)}this.fetch=UM(e,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Ke({headers:this.headers,accessToken:this._getAccessToken.bind(this)},l.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(c=>this.realtime.setAuth(c)).catch(c=>console.warn("Failed to set initial Realtime auth token:",c)),this.rest=new h$(new URL("rest/v1",i).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch,timeout:l.db.timeout,urlLengthLimit:l.db.urlLengthLimit}),this.storage=new kL(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new r$(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,e={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,e,r)}channel(t,e={config:{}}){return this.realtime.channel(t,e)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var t=this,e,r;if(t.accessToken)return await t.accessToken();const{data:n}=await t.auth.getSession();return(e=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&e!==void 0?e:t.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:n,userStorage:s,storageKey:i,flowType:o,lock:a,debug:l,throwOnError:u},c,d){const h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new WM({url:this.authUrl.href,headers:Ke(Ke({},h),c),storageKey:i,autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:n,userStorage:s,flowType:o,lock:a,debug:l,throwOnError:u,fetch:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(f=>f.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new V$(this.realtimeUrl.href,Ke(Ke({},t),{},{params:Ke(Ke({},{apikey:this.supabaseKey}),t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,e)=>{this._handleTokenChanged(t,"CLIENT",e==null?void 0:e.access_token)})}_handleTokenChanged(t,e,r){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),e=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const VM=(t,e,r)=>new qM(t,e,r);function KM(){if(typeof window<"u")return!1;const t=globalThis.process;if(!t)return!1;const e=t.version;if(e==null)return!1;const r=e.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=18:!1}KM()&&console.warn("⚠️  Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to N
112ode.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const GM="https://kvrwtxjayijgkamfnavy.supabase.co",YM="sb_publishable_SBJEnASHDeH9N3yqsUSL5Q_YNTps6Yc",fe=VM(GM,YM,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}}),$d="memnar_signup_source",JM=32;function QM(){try{const t=new URLSearchParams(window.location.search).get("src");if(!t)return;const e=t.toLowerCase().replace(/[^a-z0-9_-]/g,"").slice(0,JM);e&&!localStorage.getItem($d)&&localStorage.setItem($d,e)}catch{}}async function XM(t){try{const e=localStorage.getItem($d);if(!e)return;const{error:r}=await fe.from("profiles").update({signup_source:e}).eq("id",t).is("signup_source",null);r||localStorage.removeItem($d)}catch{}}const Ld="memnar_referral_code",ZM=16;function eD(){try{const t=new URLSearchParams(window.location.search).get("ref");if(!t)return;const e=t.toLowerCase().replace(/[^a-z0-9]/g,"").slice(0,ZM);e&&!localStorage.getItem(Ld)&&localStorage.setItem(Ld,e)}catch{}}async function tD(){try{const t=localStorage.getItem(Ld);if(!t)return;const{error:e}=await fe.rpc("redeem_referral",{p_code:t});e||localStorage.removeItem(Ld)}catch{}}const Md="memnar_email_optin",rD=60*60*1e3;function nD(t,e){try{t&&e?localStorage.setItem(Md,JSON.stringify({email:e.trim().toLowerCase(),at:Date.now()})):localStorage.removeItem(Md)}catch{}}async function sD(t,e){try{const r=localStorage.getItem(Md);if(!r)return;localStorage.removeItem(Md);const n=JSON.parse(r);if(!n.email||n.email!==(e==null?void 0:e.trim().toLowerCase())||!n.at||Date.now()-n.at>rD)return;await fe.from("email_prefs").upsert({user_id:t,product_news:!0},{onConflict:"user_id"})}catch{}}var O=typeof window<"u"?window:void 0,at=typeof globalThis<"u"?globalThis:O;typeof self>"u"&&(at.self=at),typeof File>"u"&&(at.File=function(){});var $t=at==null?void 0:at.navigator,H=at==null?void 0:at.document,Xe=at==null?void 0:at.location,ly=at==null?void 0:at.fetch,Gg=at!=null&&at.XMLHttpRequest&&"withCredentials"in new at.XMLHttpRequest?at.XMLHttpRequest:void 0,h0=at==null?void 0:at.AbortController,iD=at==null?void 0:at.CompressionStream,Wt=$t==null?void 0:$t.userAgent,X=O??{};function JE(){return!(!O||O.navigator.onLine===!1)}var f0="1.404.0",Fe={DEBUG:!1,LIB_VERSION:f0,LIB_NAME:"web",JS_SDK_VERSION:f0};function p0(t,e,r,n,s,i,o){try{var a=t[i](o),l=a.value}catch(u){return void r(u)}a.done?e(l):Promise.resolve(l).then(n,s)}function Ye(t){return function(){var e=this,r=arguments;return new Promise(function(n,s){var i=t.apply(e,r);function o(l){p0(i,n,s,o,a,"next",l)}function a(l){p0(i,n,s,o,a,"throw",l)}o(void 0)})}}function L(){return L=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},L.apply(null,arguments)}function QE(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}var g0=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function m0(t){return typeof t=="string"||t}function v0(t){return typeof t=="string"?t:void 0}var Ya,On=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.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.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.
112SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t}({}),y0=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),oD=["$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"],aD=["token"],XE="NativeGzipValidationError",Yg=t=>t.length>=2&&t[0]===31&&t[1]===139,_0=(t,e)=>t===y0.GZipJS||e===y0.GZipJS||e==="gzip",w0=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError",gc=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=XE,e},lD=function(){var t=Ye(function*(e,r){18>e.size&&gc("too-short");var n=new Uint8Array(yield e.slice(0,10).arrayBuffer());Yg(n)&&n[2]===8||gc("invalid-header");var s=new DataView(yield e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(o=>{for(var a=(()=>{if(Ya)return Ya;Ya=[];for(var c=0;256>c;c++){for(var d=c,h=0;8>h;h++)d=1&d?3988292384^d>>>1:d>>>1;Ya[c]=d>>>0}return Ya})(),l=4294967295,u=0;o.length>u;u++)l=a[255&(l^o[u])]^l>>>8;return(4294967295^l)>>>0})(r)&&gc("invalid-crc");var i=r.length>>>0;s.getUint32(4,!0)!==i&&gc("invalid-size")});return function(e,r){return t.apply(this,arguments)}}();function Jg(){return Jg=Ye(function*(t,e,r){e===void 0&&(e=!0);try{var n=new TextEncoder().encode(t),s=new globalThis.CompressionStream("gzip"),i=s.writable.getWriter(),o=i.write(n).then(()=>i.close()).catch(function(){var u=Ye(function*(c){try{yield i.abort(c)}catch{}throw c});return function(c){return u.apply(this,arguments)}}()),a=new Response(s.readable).blob(),l=(yield Promise.all([a,o]))[0];return yield lD(l,n),l}catch(u){if(r!=null&&r.rethrow)throw u;return e&&console.error("Failed to gzip compress data",u),null}}),Jg.apply(this,arguments)}var uD=["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","pinterest","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"],b0=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var r=t.toLowerCase();return uD.concat(e).some(n=>{var s=n.toLowerCase();return r.indexOf(s)!==-1})};function se(t,e){return t.indexOf(e)!==-1}var zh=function(t){return t.trim()},Qg=function(t){return t.replace(/^\$/,"")};function ZE(t){var e,r=[];return(e=JSON.stringify(t,function(n,s){if(typeof s=="bigint")return s.toString();if(typeof s!="function"&&typeof s!="symbol"){if(s instanceof Error)return{name:s.name,message:s.message,stack:s.stack};if(s&&typeof s=="object"){for(;r.length>0&&r[r.length-1]!==this;)r.pop();if(r.includes(s))return"[Circular]";r.push(s)}return s}}))!==null&&e!==void 0?e:"null"}var e1=Object.prototype,t1=e1.hasOwnProperty,Hh=e1.toString,ce=Array.isArray||function(t){return Hh.call(t)==="[object Array]"},Br=t=>typeof t=="function",je=t=>t===Object(t)&&!ce(t),Ts=t=>{if(je(t)){for(var e in t)if(t1.call(t,e))return!1;return!0}return!1},U=t=>t===void 0,ke=t=>Hh.call(t)=="[object String]",Xg=t=>ke(t)&&t.trim().length===0,Mt=t=>t===null,le=t=>U(t)||Mt(t),gt=t=>Hh.call(t)=="[object Number]"&&t==t,Cn=t=>gt(t)&&t>0,vn=t=>Hh.call(t)==="[object Boolean]",cD=t=>t instanceof FormData,dD=t=>se(oD,t),hD=t=>se(aD,t);function r1(t){return t===null||typeof t!="object"}function Dd(t,e){return{}.toString.call(t)==="[object "+e+"]"}function uy(t){return typeof Event<"u"&&function(e,r){try{return e instanceof r}catch{return!1}}(t,Event)}var fD=[!0,"true",1,"1","yes"],Lf=t=>se(fD,t),pD=[!1,"false",0,"0","no"];function fn(t,e,r,n,s){return e>r&&(n.warn("min cannot be greater than max."),e=r),gt(t)?t>r?(n.warn(" cannot be  greater than max: "+r+". Using max value instead."),r):e>t?(n.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(n.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+s),fn(s||r,e,r,n))}class gD{constructor(e){this.tt={},this.et=e.et,this.rt=fn(e.bucketSize,0,100,e.it),this.nt=fn(e.refillRate,0,this.rt,e.it),this.st=fn(e.refillInterval,0,864e5,e.it)}ot(e,r){var n=Math.floor((r-e.lastAccess)/this.st);n>0&&(e.tokens=Math.min(e.tokens+n*this.nt,this.rt),e.lastAccess=e.lastAccess+n*this.st)}consumeRateLimit(e){var r,n=Date.now(),s=String(e),i=this.tt[s];return i?this.ot(i,n):this.tt[s]=i={tokens:this.rt,lastAccess:n},i.tokens===0||(i.tokens--,i.tokens===0&&((r=this.et)==null||r.call(this,e)),i.tokens===0)}stop(){this.tt={}}}var lr="Mobile",Fd="iOS",Un="Android",fa="Tablet",n1=Un+" "+fa,s1="iPad",i1="Apple",o1=i1+" Watch",Nl="Safari",pa="BlackBerry",a1="Samsung",l1=a1+"Browser",u1=a1+" Internet",Pi="Chrome",mD=Pi+" OS",c1=Pi+" "+Fd,cy="Internet Explorer",d1=cy+" "+lr,dy="Opera",vD=dy+" Mini",hy="Edge",h1="Microsoft "+hy,Ho="Firefox",f1=Ho+" "+Fd,gu="Nintendo",mu="PlayStation",Wo="Xbox",p1=Un+" "+lr,g1=lr+" "+Nl,fl="Windows",Zg=fl+" Phone",x0="Nokia",em="Ouya",m1="Generic",yD=m1+" "+lr.toLowerCase(),v1=m1+" "+fa.toLowerCase(),tm="Konqueror",y1="Oculus Browser",Ud="Vivaldi",_1="Yandex",Bd="Whale",rm="DuckDuckGo",w1="Pale Moon",zd="Waterfox",Il="Brave",b1="Google Search App",De="(\\d+(\\.\\d+)?)",Mf=new RegExp("Version/"+De),_D=new RegExp(Wo,"i"),wD=new RegExp(mu+" \\w+","i"),bD=new RegExp(gu+" \\w+","i"),fy=new RegExp(pa+"|PlayBook|BB10","i"),xD={"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"},x1=function(t,e,r,n){e=e||"";var s=function(i){return i!=null&&i.brave?Il:null}(r);return s||(n!=null&&n.detectGoogleSearchApp&&se(t,"GSA/")?b1:se(t," OPR/")&&se(t,"Mini")?vD:se(t," OPR/")?dy:fy.test(t)?pa:se(t,"IE"+lr)||se(t,"WPDesktop")?d1:se(t,"OculusBrowser")?y1:se(t,l1)?u1:se(t,hy)||se(t,"Edg/")?h1:se(t,Ud+"/")?Ud:se(t,"YaBrowser/")?_1:se(t,Bd+"/")?Bd:se(t,rm+"/")||se(t,"Ddg/")?rm:se(t,"FBIOS")?"Facebook "+lr:se(t,"UCWEB")||se(t,"UCBrowser")?"UC Browser":se(t,"CriOS")?c1:se(t,"CrMo")||se(t,Pi)?Pi:se(t,Un)&&se(t,Nl)?p1:se(t,"FxiOS")?f1:se(t.toLowerCase(),tm.toLowerCase())?tm:se(t,Il+"/")?Il:((i,o)=>o&&se(o,i1)||function(a){return se(a,Nl)&&!se(a,Pi)&&!se(a,Un)}(i))(t,e)?se(t,lr)?g1:Nl:se(t,"PaleMoon/")?w1:se(t,zd+"/")?zd:se(t,Ho)?Ho:se(t,"MSIE")||se(t,"Trident/")?cy:se(t,"Gecko")?Ho:"")},kD={[d1]:[new RegExp("rv:"+De)],[h1]:[new RegExp(hy+"?\\/"+De)],[Pi]:[new RegExp("("+Pi+"|CrMo)\\/"+De)],[c1]:[new RegExp("CriOS\\/"+De)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+De)],[Nl]:[Mf],[g1]:[Mf],[dy]:[new RegExp("(Opera|OPR)\\/"+De)],[Ho]:[new RegExp(Ho+"\\/"+De)],[f1]:[new RegExp("FxiOS\\/"+De)],[tm]:[new RegExp("Konqueror[:/]?"+De,"i")],[pa]:[new RegExp(pa+" "+De),Mf],[p1]:[new RegExp("android\\s"+De,"i")],[u1]:[new RegExp(l1+"\\/"+De)],[y1]:[new RegExp("OculusBrowser\\/"+De)],[Ud]:[new RegExp(Ud+"\\/"+De)],[_1]:[new RegExp("YaBrowser\\/"+De)],[Bd]:[new RegExp(Bd+"\\/"+De)],[Il]:[new RegExp(Il+"\\/"+De)],[rm]:[new RegExp("(DuckDuckGo|Ddg)\\/"+De)],[w1]:[new RegExp("PaleMoon\\/"+De)],[zd]:[new RegExp(zd+"\\/"+De)],[b1]:[new RegExp("GSA\\/"+De)],[cy]:[new RegExp("(rv:|MSIE )"+De)],Mozilla:[new RegExp("rv:"+De)]},SD=function(t,e,r,n){var s=x1(t,e,r,n),i=kD[s];if(U(i))return null;for(var o=0;i.length>o;o++){var a=t.match(i[o]);if(a)return parseFloat(a[a.length-2])}return null},k0=[[new RegExp(Wo+"; "+Wo+" (.*?)[);]","i"),t=>[Wo,t&&t[1]||""]],[new RegExp(gu,"i"),[gu,""]],[new RegExp(mu,"i"),[mu,""]],[fy,[pa,""]],[new RegExp(fl,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Zg,""];if(new RegExp(lr).test(e)&&!/IEMobile\b/.test(e))return[fl+" "+lr,""];
112var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var n=xD[r[1]]||"";return/arm/i.test(e)&&(n="RT"),[fl,n]}return[fl,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[Fd,[t[3],t[4],t[5]||"0"].join(".")]:[Fd,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=U(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Un+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Un+")","i"),t=>t&&t[2]?[Un,[t[2],t[3],t[4]||"0"].join(".")]:[Un,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var 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/,[mD,""]],[/Linux|debian/i,["Linux",""]]],S0=function(t){return bD.test(t)?gu:wD.test(t)?mu:_D.test(t)?Wo:new RegExp(em,"i").test(t)?em:new RegExp("("+Zg+"|WPDesktop)","i").test(t)?Zg:/iPad/.test(t)?s1:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?o1:fy.test(t)?pa:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(x0,"i").test(t)?x0:/(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(lr).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)?Un:n1:new RegExp("(pda|"+lr+")","i").test(t)?yD:new RegExp(fa,"i").test(t)&&!new RegExp(fa+" pc","i").test(t)?v1:""},ED=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function E0(t,e){return typeof(r=t)=="string"&&ED.test(r)?t:e();var r}function Hs(t){return t&&t.split("#")[0]}function qc(t,e){var r=setTimeout(t,e);return r!=null&&r.unref&&(r==null||r.unref()),r}var CD=t=>t instanceof Error,k1={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}},TD=k1.info;function S1(t){if(vn(t))return{boolValue:t};if(typeof t=="number")return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if(typeof t=="string")return{stringValue:t};if(ce(t))return{arrayValue:{values:t.map(e=>S1(e))}};try{return{stringValue:JSON.stringify(t)}}catch{return{stringValue:String(t)}}}function Hd(t){var e=[];for(var r in t){var n=t[r];Mt(n)||U(n)||e.push({key:r,value:S1(n)})}return e}function PD(t,e){var r=k1[t.level||"info"]||TD,n=r.text,s=r.number,i=String(Date.now())+"000000",o={};e.distinctId&&(o.posthogDistinctId=e.distinctId),e.sessionId&&(o.sessionId=e.sessionId),e.windowId&&(o["window.id"]=e.windowId),le(e.sessionStartTimestamp)||(o.sessionStartTimestamp=String(e.sessionStartTimestamp)),le(e.lastActivityTimestamp)||(o.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(o["url.full"]=e.currentUrl),e.screenName&&(o["screen.name"]=e.screenName),e.appState&&(o["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(o.feature_flags=e.activeFeatureFlags);var a=L({},o,t.attributes||{}),l={timeUnixNano:i,observedTimeUnixNano:i,severityNumber:s,severityText:n,body:{stringValue:t.body},attributes:Hd(a)};return t.trace_id&&(l.traceId=t.trace_id),t.span_id&&(l.spanId=t.span_id),U(t.trace_flags)||(l.flags=t.trace_flags),l}function E1(t,e,r){return L({},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":r})}function C1(t,e,r,n){return{resourceLogs:[{resource:{attributes:Hd(e)},scopeLogs:[{scope:{name:r,version:n},logRecords:t}]}]}}let RD=class{constructor(t,e,r,n,s,i,o){var a;i===void 0&&(i=()=>Promise.resolve()),this._instance=t,this.Te=e,this.it=r,this.ut=n,this.ht=s,this.dt=i,this.ct=o,this.vt=null,this.ft=0,this.yt=0,this.bt=0,this._t=0,this.wt=!1,this.xt=e.maxBufferSize,this.kt=Math.max((a=e.maxQueueSize)!==null&&a!==void 0?a:e.maxBufferSize,e.maxBufferSize),this.St=e.flushIntervalMs,this.Ct=e.max
112BatchRecordsPerPost,this.It=e.rateCapWindowMs,this.Tt=e.maxLogsPerInterval}reset(){this.Mt(),this.vt=null,this.bt=0,this._t=0,this.wt=!1,this.ft=0,this.yt=0,this.Ct=this.Te.maxBatchRecordsPerPost}onReconnect(){this.yt=0,this.Et()}captureLog(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&t!=null&&t.body){var e=this.Rt(t);if(e!==null)if(e.body){if(this.Pt()){var r={record:PD(e,this.ut())};this.ht(()=>this.Ot(r))}}else this.it.info("Log was rejected in beforeSend function")}}Rt(t){var e=this.Te.beforeSend;if(!e)return t;var r=ce(e)?e:[e],n=t;for(var s of r)try{var i=s(n);if(!i)return this.it.info("Log was rejected in beforeSend function"),null;n=i}catch(o){return this.it.error("Error in beforeSend function for log:",o),null}return n}Pt(){if(this.Tt===void 0)return!0;var t=Date.now(),e=t-this.bt;return this.It>e&&e>=0||(this.bt=t,this._t=0,this.wt=!1),this.Tt>this._t?(this._t++,!0):(this.wt||(this.it.warn("captureLog dropping logs: exceeded "+this.Tt+" logs per "+this.It+"ms"),this.wt=!0),!1)}flush(){var t=this;return Ye(function*(){if(!t._instance.isDisabled)return t.vt||(t.vt=t.Ft().finally(()=>{t.vt=null})),t.vt})()}Ft(){var t=this;return Ye(function*(){var e;t.Mt();var r=(e=t._instance.getPersistedProperty(On.LogsQueue))!==null&&e!==void 0?e:[];if(r.length!==0)for(var n=r.length,s=0;r.length>0&&n>s;){var i,o;t.ft=0;var a=Math.min(r.length,t.Ct),l=r.slice(0,a),u=C1(l.map(d=>d.record),t.Lt(),(i=t.ct)!==null&&i!==void 0?i:t._instance.getLibraryId(),t._instance.getLibraryVersion()),c=yield t._instance.At(u);if(c.kind==="too-large"&&l.length>1)t.Ct=Math.max(1,Math.floor(l.length/2)),t.it.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+t.Ct);else if(c.kind==="retry-later"||(c.kind==="too-large"?t.it.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):c.kind==="ok"&&t.Te.maxBatchRecordsPerPost>t.Ct&&(t.Ct=Math.min(t.Te.maxBatchRecordsPerPost,t.Ct+1)),yield t.$t(l.length),r=(o=t._instance.getPersistedProperty(On.LogsQueue))!==null&&o!==void 0?o:[],s+=l.length,c.kind==="fatal"))throw c.error}})()}$t(t){var e=this;return Ye(function*(){var r,n=Math.max(0,t-e.ft),s=(r=e._instance.getPersistedProperty(On.LogsQueue))!==null&&r!==void 0?r:[];e._instance.setPersistedProperty(On.LogsQueue,s.slice(n)),yield e.dt()})()}Lt(){return E1(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ot(t){var e;if(!this._instance.optedOut){var r=(e=this._instance.getPersistedProperty(On.LogsQueue))!==null&&e!==void 0?e:[];this.kt>r.length||(r.shift(),this.ft++,this.it.info("Logs queue is full, dropping oldest record.")),r.push(t),this._instance.setPersistedProperty(On.LogsQueue,r),this.xt>r.length?this.Nt():this.Et()}}Nt(t){t===void 0&&(t=this.St),this.Dt||(this.Dt=qc(()=>{this.Dt=void 0,this.Et()},t))}qt(){var t=Math.min(Math.max(0,this.yt-1),6);return this.St*Math.pow(2,t)}jt(){var t=this._instance.getPersistedProperty(On.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return Ye(function*(){e.Mt();var r=e.flush().catch(()=>{});t!==void 0?yield Promise.race([r,new Promise(n=>qc(n,t))]):yield r})()}flushWithTimeout(t){var e=this;return Ye(function*(){var r=!1,n=e.flush(),s=new Promise(i=>qc(()=>{r=!0,i()},t));try{yield Promise.race([n,s])}finally{r&&n.catch(()=>{})}})()}Et(){this.flush().then(()=>{this.yt=0},t=>{this.yt++,this.it.error("PostHog logs flush failed:",t)}).finally(()=>{!this._instance.isDisabled&&this.jt()&&this.Nt(this.qt())})}Mt(){this.Dt&&(clearTimeout(this.Dt),this.Dt=void 0)}};var Df=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function C0(t){return String(t)+"000000"}function T0(t,e,r,n){var s="";return n&&(s=Object.keys(n).sort().map(i=>JSON.stringify(i)+":"+JSON.stringify(n[i])).join(",")),t+"\0"+e+"\0"+(r??"")+"\0"+s}let AD=class{constructor(t,e,r){this._instance=t,this.Te=e,this.it=r,this.Ht=new Map,this.vt=null,this.Bt=!1,this.Ut=new Map,this.zt=new Set,this.Vt=0}count(t,e,r){e===void 0&&(e=1),this.Wt({name:t,type:"count",value:e,unit:r==null?void 0:r.unit,attributes:r==null?void 0:r.attributes})}
112gauge(t,e,r){this.Wt({name:t,type:"gauge",value:e,unit:r==null?void 0:r.unit,attributes:r==null?void 0:r.attributes})}histogram(t,e,r){this.Wt({name:t,type:"histogram",value:e,unit:r==null?void 0:r.unit,attributes:r==null?void 0:r.attributes})}flush(){var t=this,e=this.vt,r=function(){var s=Ye(function*(){e&&(yield e.catch(()=>{})),yield t.Zt()});return function(){return s.apply(this,arguments)}}(),n=r().finally(()=>{this.vt===n&&(this.vt=null)});return this.vt=n,n}drainWindow(){if(this.Ht.size===0)return null;var t=this.Ht;return this.Ht=new Map,this.Bt=!1,this.Ut=new Map,this.zt=new Set,this.Gt(t)}reset(){this.Vt++,this.Mt(),this.Ht=new Map,this.vt=null,this.Bt=!1,this.Ut=new Map,this.zt=new Set}Wt(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.Rt(t);if(e!==null)if(e.name&&typeof e.name=="string")if(typeof e.value=="number"&&Number.isFinite(e.value))if(e.type==="count"&&0>e.value)this.it.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var r,n;try{r=e.attributes?L({},e.attributes):void 0,n=T0(e.type,e.name,e.unit,r)}catch(o){return void this.it.warn("Dropping metric '"+e.name+"': attributes could not be serialized",o)}var s=this.Ht.get(n);if(!s){if(!this.Qt())return;s={name:e.name,type:e.type,unit:e.unit,attributes:r,windowStartMs:Date.now()},this.Ht.set(n,s)}var i=this.Ut.get(e.name);i===void 0?this.Ut.set(e.name,e.type):i===e.type||this.zt.has(e.name)||(this.zt.add(e.name),this.it.warn("Metric name '"+e.name+"' is already used as a "+i+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Jt(s,e.value),this.Nt()}else this.it.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.it.warn("Dropping metric with empty name")}}Qt(){return this.Te.maxSeriesPerFlush>this.Ht.size||(this.Bt||(this.Bt=!0,this.it.warn("Metric series cap reached ("+this.Te.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Jt(t,e){var r;switch(t.type){case"count":t.total=((r=t.total)!==null&&r!==void 0?r:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(Df.length+1).fill(0)});var n=t.hist;n.count+=1,n.sum+=e,n.min=Math.min(n.min,e),n.max=Math.max(n.max,e),n.bucketCounts[function(s,i){for(var o=0;i.length>o;o++)if(i[o]>=s)return o;return i.length}(e,Df)]+=1}}Rt(t){var e=this.Te.beforeSend;if(!e)return t;var r=ce(e)?e:[e],n=t;for(var s of r)try{var i=s(n);if(!i)return this.it.info("Metric was rejected in beforeSend function"),null;n=i}catch(o){return this.it.error("Error in beforeSend function for metric:",o),null}return n}Nt(){this.Dt||(this.Dt=qc(()=>{this.Dt=void 0,this.flush().catch(t=>{this.it.error("Metrics flush failed:",t)})},this.Te.flushIntervalMs))}Mt(){this.Dt&&(clearTimeout(this.Dt),this.Dt=void 0)}Zt(){var t=this;return Ye(function*(){if(t.Ht.size!==0){var e=t.Ht;t.Ht=new Map,t.Bt=!1,t.Ut=new Map,t.zt=new Set;var r=t.Vt,n=yield t._instance.Kt(t.Gt(e));if(r===t.Vt)switch(n.kind){case"ok":return;case"retry-later":return t.Yt(e),void t.Nt();case"too-large":return void t.it.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.it.error("Failed to send metrics batch:",n.error)}}})()}Gt(t){return function(s,i,o,a){return{resourceMetrics:[{resource:{attributes:Hd(i)},scopeMetrics:[{scope:{name:o,version:a},metrics:s}]}]}}(this.Xt(t),(e=this.Te,r=this._instance.getLibraryId(),n=this._instance.getLibraryVersion(),L({},e.resourceAttributes,{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":r,"telemetry.sdk.version":n})),this._instance.getLibraryId(),this._instance.getLibraryVersion());var e,r,n}Xt(t){var e=C0(Date.now()),r=new Map;for(var n of t.values()){var s,i=T0(n.type,n.name,n.unit,void 0),o=r.get(i);o||(o=L({name:n.name},n.unit&&{unit:n.unit}),n.type==="count"?o.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:n.type==="gauge"?o.gauge={dataPoints:[]}:o.histogram={aggregationTemporality:1,dataPoints:[]},r.set(i,o));var a=Hd((s=n.attributes)!==null&&s!==void 0?s:{}),l=C0(n.windowStartMs);if(n.type==="count"){var u,c={attributes:a,startTimeUnixNano:l,timeUnixNano:e,asDouble:(u=n.total)!==null&&u!==void 0?u:0};o.sum.dataPoints.push(c)}else if(n.type==="gauge"){var d,h={attributes:a,timeUnixNano:e,asDouble:(d=n.last)!==null&&d!==void 0?d:0};o.gauge.dataPoints.push(h)}else n.hist&&o.histogram.dataPoints.push({attributes:a,startTimeUnixNano:l,timeUnixNano:e,count:n.hist.count,sum:n.hist.sum,min:n.hist.min,max:n.hist.max,bucketCounts:n.hist.bucketCounts,explicitBounds:Df})}return Array.from(r.values())}Yt(t){var e,r;for(var n of t){var s=n[0],i=n[1],o=this.Ht.get(s);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,i.windowStartMs),o.type){case"count":o.total=((e=o.total)!==null&&e!==void 0?e:0)+((r=i.total)!==null&&r!==void 0?r:0);break;case"gauge":break;case"histogram":if(i.hist)if(o.hist){o.hist.count+=i.hist.count,o.hist.sum+=i.hist.sum,o.hist.min=Math.min(o.hist.min,i.hist.min),o.hist.max=Math.max(o.hist.max,i.hist.max);for(var a=0;o.hist.bucketCounts.length>a;a++)o.hist.bucketCounts[a]+=i.hist.bucketCounts[a]}else o.hist=i.hist}else this.Qt()&&this.Ht.set(s,i)}}};var mc,P0,Ff;function OD(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return Ff&&r.length===P0||(P0=r.length,Ff=r.reduce((n,s)=>{mc||(mc={});var i=mc[s];if(i)n[i[0]]=i[1];else for(var o=t(s),a=o.length-1;a>=0;a--){var l=o[a],u=l==null?void 0:l.filename,c=e[s];if(u&&c){n[u]=c,mc[s]=[u,c];break}}return n},{})),Ff}}class jD{constructor(e,r,n){n===void 0&&(n=[]),this.coercers=e,this.stackParser=r,this.modifiers=n}buildFromUnknown(e,r){r===void 0&&(r={});var n=r&&r.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(n,r,0).apply(e),i=this.buildParsingContext(r),o=this.parseStacktrace(s,i);return{$exception_list:this.convertToExceptionList(o,n),$exception_level:"error"}}modifyFrames(e){var r=this;return Ye(function*(){for(var n of e)n.stacktrace&&n.stacktrace.frames&&ce(n.stacktrace.frames)&&(n.stacktrace.frames=yield r.applyModifiers(n.stacktrace.frames));return e})()}coerceFallback(e){var r;return{type:"Error",value:"Unknown error",stack:(r=e.syntheticException)==null?void 0:r.stack,synthetic:!0}}parseStacktrace(e,r){var n,s;return e.cause!=null&&(n=this.parseStacktrace(e.cause,r)),e.stack!=""&&e.stack!=null&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?r.skipFirstLines:0),r.chunkIdMap)),L({},e,{cause:n,stack:s})}applyChunkIds(e,r){return e.map(n=>(n.filename&&r&&(n.chunk_id=r[n.filename]),n))}applyCoercers(e,r){for(var n of this.coercers)if(n.match(e))return n.coerce(e,r);return this.coerceFallback(r)}applyModifiers(e){var r=this;return Ye(function*(){var n=e;for(var s of r.modifiers)n=yield s(n);return n})()}convertToExceptionList(e,r){var n,s,i,o={type:e.type,value:e.value,mechanism:{type:(n=r.type)!==null&&n!==void 0?n:"generic",handled:(s=r.handled)===null||s===void 0||s,synthetic:(i=e.synthetic)!==null&&i!==void 0&&i}};e.stack&&(o.stacktrace={type:"raw",frames:e.stack});var a=[o];return e.cause!=null&&a.push(...this.convertToExceptionList(e.cause,L({},r,{handled:!0}))),a}buildParsingContext(e){var r;return{chunkIdMap:OD(this.stackParser),skipFirstLines:(r=e.skipFirstLines)!==null&&r!==void 0?r:1}}buildCoercingContext(e,r,n){n===void 0&&(n=0);var s=(i,o)=>
112{if(4>=o){var a=this.buildCoercingContext(e,r,o);return this.applyCoercers(i,a)}};return L({},r,{syntheticException:n==0?r.syntheticException:void 0,mechanism:e,apply:i=>s(i,n),next:i=>s(i,n+1)})}}var ga="?";function nm(t,e,r,n,s){var i={platform:t,filename:e,function:r==="<anonymous>"?ga:r,in_app:!0};return U(n)||(i.lineno=n),U(s)||(i.colno=s),i}var T1=(t,e)=>{var r=t.indexOf("safari-extension")!==-1,n=t.indexOf("safari-web-extension")!==-1;return r||n?[t.indexOf("@")!==-1?t.split("@")[0]:ga,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},ND=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ID=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,$D=/\((\S*)(?::(\d+))(?::(\d+))\)/,LD=(t,e)=>{var r=ND.exec(t);if(r)return nm(e,r[1],ga,+r[2],+r[3]);var n=ID.exec(t);if(n){if(n[2]&&n[2].indexOf("eval")===0){var s=$D.exec(n[2]);s&&(n[2]=s[1],n[3]=s[2],n[4]=s[3])}var i=T1(n[1]||ga,n[2]);return nm(e,i[1],i[0],n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},MD=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,DD=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,FD=(t,e)=>{var r=MD.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var n=DD.exec(r[3]);n&&(r[1]=r[1]||"eval",r[3]=n[1],r[4]=n[2],r[5]="")}var s=r[3],i=r[1]||ga,o=T1(i,s);return nm(e,s=o[1],i=o[0],r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},R0=/\(error: (.*)\)/;class UD{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,r){var n=ke(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:n?e.stack:void 0,cause:e.cause?r.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var r=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?r+": "+e.message:r}isDOMException(e){return Dd(e,"DOMException")}isDOMError(e){return Dd(e,"DOMError")}}class BD{match(e){return(r=>r instanceof Error)(e)}coerce(e,r){return{type:this.getType(e),value:this.getMessage(e,r),stack:this.getStack(e),cause:e.cause?r.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,r){var n=e.message;return String(n.error&&typeof n.error.message=="string"?n.error.message:n)}getStack(e){return e.stacktrace||e.stack||void 0}}class zD{constructor(){}match(e){return Dd(e,"ErrorEvent")&&e.error!=null}coerce(e,r){var n;return r.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:(n=r.syntheticException)==null?void 0:n.stack,synthetic:!0}}}var HD=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class WD{match(e){return typeof e=="string"}coerce(e,r){var n,s=this.getInfos(e),i=s[0],o=s[1];return{type:i??"Error",value:o??e,stack:(n=r.syntheticException)==null?void 0:n.stack,synthetic:!0}}getInfos(e){var r="Error",n=e,s=e.match(HD);return s&&(r=s[1],n=s[2]),[r,n]}}var qD=["fatal","error","warning","log","info","debug"];function P1(t,e){e===void 0&&(e=40);var r=Object.keys(t);if(r.sort(),!r.length)return"[object has no keys]";for(var n=r.length;n>0;n--){var s=r.slice(0,n).join(", ");if(e>=s.length)return n===r.length?s:s.length>e?s.slice(0,e)+"...":s}return""}class VD{match(e){return typeof e=="object"&&e!==null}coerce(e,r){var n,s=this.getErrorPropertyFromObject(e);return s?r.apply(s):{type:this.getType(e),value:this.getValue(e),stack:(n=r.syntheticException)==null?void 0:n.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return uy(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var r="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(r+=" with message: '"+e.message+"'"),r}if("message"in e&&typeof e.message=="string")return e.message;var n=this.getObjectClassName(e);return(n&&n!=="Object"?"'"+n+"'":"Object")+" captured as exception with keys: "+P1(e)}isSeverityLevel(e){return ke(e)&&!Xg(e)&&qD.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var r in e)if({}.hasOwnProperty.call(e,r)){var n=e[r];if(CD(n))return n}}getObjectClassName(e){try{var r=Object.getPrototypeOf(e);return r?r.constructor.name:void 0}catch{return}}}class KD{match(e){return uy(e)}coerce(e,r){var n,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+P1(e),stack:(n=r.syntheticException)==null?void 0:n.stack,synthetic:!0}}}class GD{match(e){return r1(e)}coerce(e,r){var n;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(n=r.syntheticException)==null?void 0:n.stack,synthetic:!0}}}class YD{match(e){return Dd(e,"PromiseRejectionEvent")||this.isCu
112stomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!uy(e))return!1;try{var r=e.detail;return r!=null&&typeof r=="object"&&"reason"in r}catch{return!1}}coerce(e,r){var n,s=this.getUnhandledRejectionReason(e);return r1(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:(n=r.syntheticException)==null?void 0:n.stack,synthetic:!0}:r.apply(s)}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}}var Wd="$message",qd="$timestamp",JD=new Set([Wd,qd]),Uf={enabled:!0,max_bytes:32768};function Vd(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:Uf.enabled,max_bytes:XD(t.max_bytes,Uf.max_bytes)}:L({},Uf)}class QD{constructor(e){this.$e=[],this.ze=0,this.Te=Vd(e)}setConfig(e){this.Te=Vd(e),this.Ze()}add(e){var r=function(s){var i;try{i=ZE(s)}catch{return}try{var o=JSON.parse(i);if(!je(o))return;var a=o,l=a[Wd],u=a[qd];return!ke(l)||l.trim().length===0||!ke(u)&&!gt(u)?void 0:{step:a,json:i}}catch{return}}(e);if(r){var n=function(s){if(typeof TextEncoder<"u")return new TextEncoder().encode(s).length;for(var i=encodeURIComponent(s),o=0,a=0;i.length>a;a++)i[a]==="%"?(o+=1,a+=2):o+=1;return o}(r.json);n>this.Te.max_bytes||(this.$e.push({step:r.step,bytes:n}),this.ze+=n,this.Ze())}}getAttachable(){return this.$e.map(e=>e.step)}clear(){this.$e=[],this.ze=0}size(){return this.$e.length}Ze(){for(;this.ze>this.Te.max_bytes&&this.$e.length>0;){var e=this.$e.shift();e&&(this.ze-=e.bytes)}}}function XD(t,e){if(!gt(t)||t===1/0||t===-1/0)return e;var r=Math.floor(t);return 0>r?e:r}var R1=function(t,e){var r=(e===void 0?{}:e).debugEnabled,n={k(s){if(O&&(Fe.DEBUG||X.POSTHOG_DEBUG||r)&&!U(O.console)&&O.console){for(var i=("__rrweb_original__"in O.console[s])?O.console[s].__rrweb_original__:O.console[s],o=arguments.length,a=new Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];i(t,...a)}},debug(){for(var s=arguments.length,i=new Array(s),o=0;s>o;o++)i[o]=arguments[o];n.k("debug",...i)},info(){for(var s=arguments.length,i=new Array(s),o=0;s>o;o++)i[o]=arguments[o];n.k("log",...i)},warn(){for(var s=arguments.length,i=new Array(s),o=0;s>o;o++)i[o]=arguments[o];n.k("warn",...i)},error(){for(var s=arguments.length,i=new Array(s),o=0;s>o;o++)i[o]=arguments[o];n.k("error",...i)},critical(){for(var s=arguments.length,i=new Array(s),o=0;s>o;o++)i[o]=arguments[o];console.error(t,...i)},uninitializedWarning(s){n.error("You must initialize PostHog before calling "+s)},createLogger:(s,i)=>R1(t+" "+s,i)};return n},F=R1("[PostHog.js]"),$e=F.createLogger,ZD=$e("[ExternalScriptsLoader]"),Bf=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return ZD.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var n=H==null?void 0:H.querySelectorAll("script");if(n){for(var s,i=function(){if(n[o].src===e){var l=n[o];return l.__posthog_loading_callback_fired?{v:r()}:(l.addEventListener("load",u=>{l.__posthog_loading_callback_fired=!0,r(void 0,u)}),l.onerror=u=>r(u),{v:void 0})}},o=0;n.length>o;o++)if(s=i())return s.v}var a=()=>{if(!H)return r("document not found");var l=H.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=d=>{l.__posthog_loading_callback_fired=!0,r(void 0,d)},l.onerror=d=>r(d),t.config.prepare_external_dependency_script&&(l=t.config.prepare_external_dependency_script(l)),!l)return r("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")H.head.appendChild(l);else{var u,c=H.querySelectorAll("body > script");c.length>0?(u=c[0].parentNode)==null||u.insertBefore(l,c[0]):H.body.appendChild(l)}};H!=null&&H.body?a():H==null||H.addEventListener("DOMContentLoaded",a)};X.__PosthogExtensions__=X.__PosthogExtensions__||{},X.__PosthogExtensions__.loadExternalDependency=(t,e,r)=>{if(e!=="remote-config"){var n;if(t.config.strict_script_versioning)n=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js");else{var s="/static/"+e+".js?v="+t.version;if(e==="toolbar"){var i=3e5;
112s=s+"&t="+Math.floor(Date.now()/i)*i}n=t.requestRouter.endpointFor("assets",s)}Bf(t,n,r)}else{var o=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");Bf(t,o,r)}},X.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var n=t.requestRouter.endpointFor("api",e);Bf(t,n,r)};var A1="$people_distinct_id",Kd="$device_id",zf="$device_model",pl="__alias",gl="__timers",sm="$autocapture_disabled_server_side",im="$heatmaps_enabled_server_side",om="$exception_capture_enabled_server_side",am="$error_tracking_suppression_rules",lm="$error_tracking_capture_extension_exceptions",um="$web_vitals_enabled_server_side",py="$dead_clicks_enabled_server_side",gy="$product_tours_enabled_server_side",cm="$web_vitals_allowed_metrics",mi="$session_recording_remote_config",O1="$replay_sample_rate",j1="$replay_override_sampling",N1="$replay_override_linked_flag",I1="$replay_override_url_trigger",$1="$replay_override_event_trigger",Oo="$sesid",my="$session_is_sampled",di="$enabled_feature_flags",Vc="$active_feature_flags",ml="$early_access_features",dm="$feature_flag_details",Kc="$feature_flag_payloads",hm="$feature_flag_request_id",Tn="$override_feature_flags",go="$override_feature_flag_payloads",ai="$stored_person_properties",li="$stored_group_properties",fm="$surveys",Gd="$surveys_loaded_at",pm="$surveys_activated",vl="ph_product_tours",$l="$flag_call_reported",gm="$flag_call_reported_session_id",mm="$feature_flag_errors",vu="$feature_flag_evaluated_at",Ir="$user_state",vm="$client_session_props",ym="$capture_rate_limit",_m="$initial_campaign_params",wm="$initial_referrer_info",Yd="$initial_person_info",Jd="$epp",L1="__POSTHOG_TOOLBAR__",vc="$posthog_cookieless",M1="$sdk_debug_extensions_init_method",D1="$sdk_debug_extensions_init_time_ms",F1="$sdk_debug_recording_script_not_loaded",vy="PostHog loadExternalDependency extension not found.",ui="on_reject",Ln="always",to="anonymous",ro="identified",bm="identified_only",Qd="visibilitychange",Xd="beforeunload",mo="$pageview",Hf="$pageleave",Wf="$identify",A0="$groupidentify";function yc(t,e){ce(t)&&t.forEach(e)}function Ee(t,e){if(!le(t))if(ce(t))t.forEach(e);else if(cD(t))t.forEach((n,s)=>e(n,s));else for(var r in t)t1.call(t,r)&&e(t[r],r)}var Pe=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;e>n;n++)r[n-1]=arguments[n];for(var s of r)for(var i in s)s[i]!==void 0&&(t[i]=s[i]);return t};function Gc(t){for(var e=Object.keys(t),r=e.length,n=new Array(r);r--;)n[r]=[e[r],t[e[r]]];return n}var O0=function(t){try{return t()}catch{return}},eF=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),n=0;e>n;n++)r[n]=arguments[n];return t.apply(this,r)}catch(s){F.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),F.critical(s)}}},yy=function(t){var e={};return Ee(t,function(r,n){(ke(r)&&r.length>0||gt(r))&&(e[n]=r)}),e},tF=["herokuapp.com","vercel.app","netlify.app"];function rF(t){var e=t==null?void 0:t.hostname;if(!ke(e))return!1;var r=e.split(".").slice(-2).join(".");for(var n of tF)if(r===n)return!1;return!0}function Ue(t,e,r,n){var s=n??{},i=s.capture,o=s.passive;t==null||t.addEventListener(e,r,{capture:i!==void 0&&i,passive:o===void 0||o})}function U1(t){return t.name==="ph_toolbar_internal"}Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return gt(t)&&isFinite(t)&&Math.floor(t)===t});class Zd{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,r,n,s){if(!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(n)||!Number.isInteger(s)||0>e||0>r||0>n||0>s||e>0xffffffffffff||r>4095||n>1073741823||s>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/Math.pow(2,8),i[5]=e,i[6]=112|r>>>8,i[7]=r,i[8]=128|n>>>24,i[9]=n>>>16,i[10]=n>>>8,i[11]=n,i[12]=s>>>24,i[13]=s>>>16,i[14]=s>>>8,i[15]=s,new Zd(i)}toString(){for(var e="",r=0;this.bytes.length>r;r++)e=e+(this.bytes[r]>>>4).toString(16)+(15&this.bytes[r]).toString(16),r!==3&&r!==5&&r!==7&&r!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Zd(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var r=0;16>r;r++){var n=this.bytes[r]-e.bytes[r];if(n!==0)return Math.sign(n)}return 0}}class nF{constructor(){this.S=0,this.C=0,this.I=new sF}generate(){var e=this.generateOrAbort();if(U(e)){this.S=0;var r=this.generateOrAbort();if(U(r))throw new Error("Could not generate UUID after timestamp reset");return r}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.M();else{if(this.S>=e+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.M())}return Zd.fromFieldsV7(this.S,Math.trunc(this.C/Math.pow(2,30)),this.C&Math.pow(2,30)-1,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var j0,B1=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};O&&!U(O.crypto)&&crypto.getRandomValues&&(B1=t=>crypto.getRandomValues(t));class sF{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(B1(this.R),this.O=0),this.R[this.O++]}}var Nn=()=>iF().toString(),iF=()=>(j0||(j0=new nF)).generate(),Ja="",oF=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,dn={N:()=>!!H,D(t){F.error("cookieStore error: "+t)},A(t){if(H){try{for(var e=t+"=",r=H.cookie.split(";").filter(i=>i.length),n=0;r.length>n;n++){for(var s=r[n];s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}}catch{}return null}},F(t){var e;try{e=JSON.parse(dn.A(t))||{}}catch{}return e},q(t,e,r,n,s){if(!H)return!1;try{var i="",o="",a=function(c,d){if(d){var h=function(g,p){if(p===void 0&&(p=H),Ja)return Ja;if(!p||["localhost","127.0.0.1"].includes(g))return"";for(var b=g.split("."),v=Math.min(b.length,8),y="dmn_chk_"+Nn();!Ja&&v--;){var _=b.slice(v).join("."),x=y+"=1;domain=."+_+";path=/";p.cookie=x+";max-age=3",p.cookie.includes(y)&&(p.cookie=x+";max-age=0",Ja=_)}return Ja}(c);if(!h){var f=(g=>{var p=g.match(oF);return p?p[0]:""})(c);f!==h&&F.info("Warning: cookie subdomain discovery mismatch",f,h),h=f}return h?"; domain=."+h:""}return""}(H.location.hostname,n);if(r){var l=new Date;l.setTime(l.getTime()+864e5*r),i="; expires="+l.toUTCString()}s&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&F.warn("cookieStore warning: large cookie, len="+u.length),H.cookie=u,!0}catch{return!1}},P(t,e){if(H!=null&&H.cookie)try{dn.q(t,"",-1,e)}catch{return}}},qf=null,Se={N(){if(!Mt(qf))return qf;var t=!0;if(U(O))t=!1;else try{var e="__mplssupport__";Se.q(e,"xyz"),Se.A(e)!=='"xyz"'&&(t=!1),Se.P(e)}catch{t=!1}return t||F.error("localStorage unsupported; falling back to cookie store"),qf=t,t},D(t){F.error("localStorage error: "+t)},A(t){try{return O==null?void 0:O.localStorage.getItem(t)}catch(e){Se.D(e)}return null},F(t){try{return JSON.parse(Se.A(t))||{}}catch{}return null},q(t,e){try{return O==null||O.localStorage.setItem(t,JSON.stringify(e)),!0}catch(r){Se.D(r)}return!1},P(t){try{O==null||O.localStorage.removeItem(t)}catch(e){Se.D(e)}}},aF=[Kd,"distinct_id",Oo,my,Jd,Yd,Ir],_c={},lF={N:()=>!0,D(t){F.error("memoryStorage error: "+t)},A:t=>_c[t]||null,F:t=>_c[t]||null,q:(t,e)=>(_c[t]=e,!0),P(t){delete _c[t]}},Zs=null,ft={N(){if(!Mt(Zs))return Zs;if(Zs=!0,U(O))Zs=!1;else try{var t="__support__";ft.q(t,"xyz"),ft.A(t)!=='"xyz"'&&(Zs=!1),ft.P(t)}catch{Zs=!1}return Zs},D(t){F.error("sessionStorage error: ",t)},A(t){try{return O==null?void 0:O.sessionStorage.getItem(t)}catch(e){ft.D(e)}return null},F(t){try{return JSON.parse(ft.A(t))||null}catch{}return null},q(t,e){try{return O==null||O.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(r){ft.D(r)}return!1},P(t){try{O==null||O.sessionStorage.removeItem(t)}catch(e){ft.D(e)}}};class uF{constructor(e){this._instance=e}get Te(){return this._instance.config}get consent(){return this.Je()?0:this.Ke}isOptedOut(){return this.Te.cookieless_mode===Ln||this.isRejected()||this.consent===-1&&this.Te.cookieless_mode===ui}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Te.opt_out_capturing_by_default}optInOut(e){this.Ye.q(this.Xe,e?1:0,this.Te.cookie_expiration,this.Te.cross_subdomain_cookie,this.Te.secure_cookie)}reset(){this.Ye.P(this.Xe,this.Te.cross_subdomain_cookie)}get Xe(){var e=this._instance.config,r=e.token,n=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(n?n+r:"__ph_opt_in_out_"+r)}get Ke(){var e=this.Ye.A(this.Xe);return Lf(e)?1:se(pD,e)?0:-1}get Ye(){var e=this.Te.opt_out_capturing_persistence_type,r=e==="localStorage"?Se:dn;if(!this.tr||this.tr!==r){this.tr=r;var n=e==="localStorage"?dn:Se;n.A(this.Xe)&&(this.tr.A(this.Xe)||this.optInOut(Lf(n.A(this.Xe))),n.P(this.
112Xe,this.Te.cross_subdomain_cookie))}return this.tr}Je(){return!!this.Te.respect_dnt&&[$t==null?void 0:$t.doNotTrack,$t==null?void 0:$t.msDoNotTrack,X.doNotTrack].some(e=>Lf(e))}}function z1(t,e){var r,n=t==null||(r=t.config)==null?void 0:r.get_current_url;if(!Br(n))return e;try{var s=n(e);return ke(s)&&s?s:e}catch(i){return F.error("Error in get_current_url, falling back to window.location.href",i),e}}var cF=1,dF=3,hF=11;function N0(t){return t instanceof Element&&(t.id===L1||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Ws(t){return!!t&&t.nodeType===cF}function ir(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function H1(t){return!!t&&t.nodeType===dF}function W1(t){return!!t&&t.nodeType===hF&&Ws(t.host)}var q1=1e3;function _y(t){return t?zh(t).split(/\s+/):[]}function I0(t,e){var r=function(n){var s,i=O==null||(s=O.location)==null?void 0:s.href;return U(i)?void 0:z1(n,i)}(e);return!!(r&&t&&t.some(n=>r.match(n)))}function eh(t){var 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 _y(e)}function V1(t){return le(t)?null:zh(t).split(/(\s+)/).filter(e=>Ll(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function yu(t){var e="";return km(t)&&!J1(t)&&t.childNodes&&t.childNodes.length&&Ee(t.childNodes,function(r){var n;H1(r)&&r.textContent&&(e+=(n=V1(r.textContent))!==null&&n!==void 0?n:"")}),zh(e)}function Vf(t){return U(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var wy=["a","button","form","input","select","textarea","label"];function xm(t,e){if(U(e))return!0;var r,n=function(i){if(e.some(o=>function(a,l){var u=a.matches||a.matchesSelector||a.msMatchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.oMatchesSelector;try{return!!u&&u.call(a,l)}catch{return!1}}(i,o)))return{v:!0}};for(var s of t)if(r=n(s))return r.v;return!1}function K1(t){var e=t.parentNode;return!(!e||!Ws(e))&&e}var fF=[".ph-no-autocapture","[data-ph-no-autocapture]"],G1=["next","previous","prev",">","<"],pF=[...G1,"+","-","−","–"],$0=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,L0=[".ph-no-rageclick",".ph-no-capture"],gF=["","text","search","email","password","url","tel","number"];function M0(t,e){if(!O||by(t))return!1;var r,n,s,i,o;if(vn(e)?(r=!!e&&L0,n=void 0,s=!1):(r=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:L0,n=e==null?void 0:e.content_ignorelist,s=(o=e==null?void 0:e.ignore_text_selection)!==null&&o!==void 0&&o),r===!1||s&&function(l){return!(!l||!Ws(l))&&(!!ir(l,"textarea")||(ir(l,"input")?se(gF,(l.getAttribute("type")||"").toLowerCase()):function(u){if(u.isContentEditable)return!0;var c=u.getAttribute==null?void 0:u.getAttribute("contenteditable");return c==="true"||c===""}(l)))}(t))return!1;var a=Y1(t,!1).targetElementList;return!function(l,u){if(l===!1||U(l))return!1;var c;if(l===!0)c=G1;else{if(!ce(l))return!1;if(l.length>10)return F.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;c=l.map(d=>d.toLowerCase())}return u.some(d=>{var h=d.safeText,f=d.ariaLabel;return c.some(g=>$0(h,g)||$0(f,g))})}(n,a.map(l=>{var u;return{safeText:yu(l).toLowerCase(),ariaLabel:((u=l.getAttribute("aria-label"))==null?void 0:u.toLowerCase().trim())||""}}))&&!xm(a,r)}var by=t=>!t||ir(t,"html")||!Ws(t),Y1=(t,e)=>{if(!O||by(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,n=[t],s=t;s.parentNode&&!ir(s,"body");)if(W1(s.parentNode))n.push(s.parentNode.host),s=s.parentNode.host;else{var i=K1(s);if(!i)break;if(e||wy.indexOf(i.tagName.toLowerCase())>-1)r=!0;else try{var o=O.getComputedStyle(i);o&&o.getPropertyValue("cursor")==="pointer"&&(r=!0)}catch{}n.push(i),s=i}return{parentIsUsefulElement:r,targetElementList:n}};function km(t){for(var e=new Set,r=0,n=t;n.parentNode&&!ir(n,"body");n=n.parentNode){if(r++>=q1||e.has(n))return!1;e.add(n);var s=eh(n);if(se(s,"ph-sensitive")||se(s,"ph-no-capture"))return!1}if(se(eh(t),"ph-include"))return!0;var i=t.type||"";if(ke(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var o=t.name||t.id||"";return!ke(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function J1(t){return!!(ir(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||ir(t,"select")||ir(t,"textarea")||t.getAttribute("contenteditable")==="true")}var Q1="(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}
112)|((?:2131|1800|35[0-9]{3})[0-9]{11})",mF=new RegExp("^(?:"+Q1+")$"),vF=new RegExp(Q1),X1="\\d{3}-?\\d{2}-?\\d{4}",yF=new RegExp("^("+X1+")$"),_F=new RegExp("("+X1+")");function Ll(t,e){return e===void 0&&(e=!0),!(le(t)||ke(t)&&(t=zh(t),(e?mF:vF).test((t||"").replace(/[- ]/g,""))||(e?yF:_F).test(t)))}function D0(t){var e=yu(t);return Ll(e=(e+" "+Z1(t)).trim())?e:""}function Z1(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Ee(t.childNodes,function(r){var n;if(r&&((n=r.tagName)==null?void 0:n.toLowerCase())==="span")try{var s=yu(r);e=(e+" "+s).trim(),r.childNodes&&r.childNodes.length&&(e=(e+" "+Z1(r)).trim())}catch(i){F.error("[AutoCapture]",i)}}),e}function F0(t){return t.replace(/"|\\"/g,'\\"')}function wF(t){var e=t.attr__class;return e?ce(e)?e:_y(e):void 0}var wc=$e("[Dead Clicks]"),bF=()=>!0,xF=t=>{var e,r=!((e=t.instance.persistence)==null||!e.get_property(py)),n=t.instance.config.capture_dead_clicks;return vn(n)?n:!!je(n)||r};class U0{get lazyLoadedDeadClicksAutocapture(){return this.er}constructor(e,r,n){this.instance=e,this.isEnabled=r,this.onCapture=n,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[py]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.rr(()=>{this.ir()}):this.stop()}rr(e){var r,n;(r=X.__PosthogExtensions__)!=null&&r.initDeadClicksAutocapture?e():(n=X.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,"dead-clicks-autocapture",s=>{s?wc.error("failed to load script",s):e()})}ir(){var e;if(H){if(!this.er&&(e=X.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var r=je(this.instance.config.capture_dead_clicks)?L({},this.instance.config.capture_dead_clicks):{};r.__onCapture=this.onCapture,this.onCapture&&(r.capture_dead_swipes=!1),this.er=X.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,r),this.er.start(H),wc.info("starting...")}}else wc.error("`document` not found. Cannot start.")}stop(){this.er&&(this.er.stop(),this.er=void 0,wc.info("stopping..."))}}var Kf=$e("[SegmentIntegration]"),eC="posthog-js";function tC(t,e){var r=e===void 0?{}:e,n=r.organization,s=r.projectId,i=r.prefix,o=r.severityAllowList,a=o===void 0?["error"]:o,l=r.sendExceptionsToPostHog,u=l===void 0||l;return c=>{var d,h,f,g,p;if(a!=="*"&&!a.includes(c.level)||!t.__loaded)return c;c.tags||(c.tags={});var b=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());c.tags["PostHog Person URL"]=b,t.sessionRecordingStarted()&&(c.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var v,y=((d=c.exception)==null?void 0:d.values)||[],_=y.map(k=>L({},k,{stacktrace:k.stacktrace?L({},k.stacktrace,{type:"raw",frames:(k.stacktrace.frames||[]).map(C=>L({},C,{platform:"web:javascript"}))}):void 0})),x={$exception_message:((h=y[0])==null?void 0:h.value)||c.message,$exception_type:(f=y[0])==null?void 0:f.type,$exception_level:c.level,$exception_list:_,$sentry_event_id:c.event_id,$sentry_exception:c.exception,$sentry_exception_message:((g=y[0])==null?void 0:g.value)||c.message,$sentry_exception_type:(p=y[0])==null?void 0:p.type,$sentry_tags:c.tags};return n&&s&&(x.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+s+"&query="+c.event_id),u&&((v=t.exceptions)==null||v.sendExceptionEvent(x)),c}}class kF{constructor(e,r,n,s,i,o){this.name=eC,this.setupOnce=function(a){a(tC(e,{organization:r,projectId:n,prefix:s,severityAllowList:i,sendExceptionsToPostHog:o==null||o}))}}}class B0{constructor(e){this.nr=(r,n,s)=>{s&&(s.noSessionId||s.activityTimeout||s.sessionPastMaximumLength||s.crossTabAdoption)&&(F.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:r,changeReason:s}),this.sr=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.ar()}ar(){var e;this.lr=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.nr)}destroy(){var e;(e=this.lr)==null||e.call(this),this.lr=void 0}doPageView(e,r){var n,s=this.ur(e,r);return this.sr={pathname:(n=O==null?void 0:O.location.pathname)!==null&&n!==void 0?n:"",pageViewId:r,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var r;return this.ur(e,(r=this.sr)==null?void 0:r.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.sr)==null?void 0:e.pageViewId}}ur(e,r){var n=this.sr;if(!n)return{$pageview_id:r};var s={$pageview_id:r,$prev_pageview_id:n.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var o=i.maxScrollHeight,a=i.lastScrollY,l=i.maxScrollY,u=i.maxContentHeight,c=i.lastContentY,d=i.maxContentY;if(!(U(o)||U(a)||U(l)||U(u)||U(c)||U(d))){o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c),d=Math.ceil(d);var h=o>1?fn(a/o,0,1,F):1,f=o>1?fn(l/o,0,1,F):1,g=u>1?fn(c/u,0,1,F):1,p=u>1?fn(d/u,0,1,F):1;s=Pe(s,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:f,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:g,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:p})}}return n.pathname&&(s.$prev_pageview_pathname=n.pathname),n.timestamp&&(s.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),s}}var bc=["flags","surveys"],SF={[A1]:{exposure:"hidden"},[pl]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[gl]:{exposure:"hidden"},[sm]:{exposure:"event"},[im]:{exposure:"hidden"},[om]:{exposure:"event"},[am]:{exposure:"hidden"},[lm]:{exposure:"event"},[um]:{exposure:"event"},[py]:{exposure:"event"},[gy]:{exposure:"hidden"},[cm]:{exposure:"event"}
112,[mi]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Oo]:{exposure:"hidden"},[my]:{exposure:"event"},[O1]:{exposure:"event",shouldSkipFromEventProperties:t=>Mt(t)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[di]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!je(t))return{};for(var e={},r=Object.keys(t),n=0;r.length>n;n++)e["$feature/"+r[n]]=t[r[n]];return e}},[Vc]:{exposure:"event",storageGroup:"flags"},[ml]:{exposure:"hidden"},[dm]:{exposure:"hidden",storageGroup:"flags"},[Kc]:{exposure:"event",storageGroup:"flags"},[hm]:{exposure:"event",storageGroup:"flags",volatile:!0},[Tn]:{exposure:"event"},[go]:{exposure:"hidden"},[ai]:{exposure:"hidden"},[li]:{exposure:"hidden"},[fm]:{exposure:"hidden",storageGroup:"surveys"},[Gd]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[pm]:{exposure:"event"},[vl]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[$l]:{exposure:"hidden"},[gm]:{exposure:"hidden"},[mm]:{exposure:"hidden"},[vu]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Ir]:{exposure:"hidden"},[vm]:{exposure:"hidden"},[ym]:{exposure:"hidden"},[_m]:{exposure:"hidden"},[wm]:{exposure:"hidden"},[Yd]:{exposure:"hidden"},[Jd]:{exposure:"hidden"},[j1]:{exposure:"event"},[N1]:{exposure:"event"},[I1]:{exposure:"event"},[$1]:{exposure:"event"},[M1]:{exposure:"event"},[D1]:{exposure:"event"},[F1]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},EF=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],ei=t=>{var e=SF[t];if(e)return e;for(var r of EF){var n=r[1];if(t.indexOf(r[0])===0)return n}},_u=t=>{var e=H==null?void 0:H.createElement("a");return U(e)?null:(e.href=t,e)},ma=function(t,e){for(var r,n=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;n.length>s;s++){var i=n[s].split("=");if(i[0]===e){r=i;break}}if(!ce(r)||2>r.length)return"";var o=r[1];try{o=decodeURIComponent(o)}catch{F.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},wu=function(t,e,r){if(!t||!e||!e.length)return t;for(var n=t.split("#"),s=n[1],i=(n[0]||"").split("?"),o=i[1],a=i[0],l=(o||"").split("&"),u=[],c=0;l.length>c;c++){var d=l[c].split("=");ce(d)&&(e.includes(d[0])?u.push(d[0]+"="+r):u.push(l[c]))}var h=a;return o!=null&&(h+="?"+u.join("&")),s!=null&&(h+="#"+s),h},th=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null},rC=(t,e)=>t>=e&&JE(),nC=(t,e,r,n)=>{if(t===0){if(JE()){var s=e+1;return s===r&&n(),s}return e}return 0},xc="https?://(.*)",va=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],CF=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...va],bu="<masked>",TF=["li_fat_id"];function sC(t,e,r){if(!H)return{};var n,s=e?[...va,...r||[]]:[],i=iC(wu(H.URL,s,bu),t),o=(n={},Ee(TF,function(a){var l=dn.A(a);n[a]=l||null}),n);return Pe(o,i)}function iC(t,e){var r=CF.concat(e||[]),n={};return Ee(r,function(s){var i=ma(t,s);n[s]=i||null}),n}function oC(t){var e=function(i){return i?i.search(xc+"google.([^/?]*)")===0?"google":i.search(xc+"bing.com")===0?"bing":i.search(xc+"yahoo.com")===0?"yahoo":i.search(xc+"duckduckgo.com")===0?"duckduckgo":null:null}(t),r=e!="yahoo"?"q":"p",n={};if(!Mt(e)){n.$search_engine=e;var s=H?ma(H.referrer,r):"";s.length&&(n.ph_keyword=s)}return n}function z0(){return navigator.language||navigator.userLanguage}var rh="$direct";function aC(){return(H==null?void 0:H.referrer)||rh}function lC(t,e,r){r===void 0&&(r=!1);var n=t?[...va,...e||[]]:[],s=r?Hs(Xe==null?void 0:Xe.href):Xe==null?void 0:Xe.href,i=s==null?void 0:s.substring(0,1e3);return{r:aC().substring(0,1e3),u:i?wu(i,n,bu):void 0}}function uC(t,e){var r;e===void 0&&(e=!1);var n=t.r,s=t.u,i=e?Hs(s):s,o={$referrer:n,$referring_domain:n==null?void 0:n==rh?rh:(r=_u(n))==null?void 0:r.host};
112if(i){o.$current_url=i;var a=_u(i);o.$host=a==null?void 0:a.host,o.$pathname=a==null?void 0:a.pathname;var l=iC(i);Pe(o,l)}if(n){var u=oC(n);Pe(o,u)}return o}function cC(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function PF(){try{return new Date().getTimezoneOffset()}catch{return}}var RF={flags:vu,surveys:Gd},AF=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],no="main";class Gf{constructor(e,r,n){if(n===void 0&&(n=!0),this.hr={},this.dr=!1,this.cr=!1,this.Te=e,this.vr=n,this.props={},this.pr=!1,this.gr=(i=>{var o="";return i.token&&(o=i.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),i.persistence_name?"ph_"+i.persistence_name:"ph_"+o+"_posthog"})(e),this.Ye=this.mr(e),this.cr=this.yr(e),this.load(),e.debug&&F.info("Persistence loaded",e.persistence,L({},this.props)),this.update_config(e,e,r),this.save(),O){var s=()=>this.flush();Ue(O,"beforeunload",s,{capture:!1}),Ue(O,"pagehide",s,{capture:!1})}}br(){var e,r=(e=this.Te)==null?void 0:e.persistence_save_debounce_ms;return gt(r)&&r>0?r:0}isDisabled(){return!!this._r}mr(e){AF.indexOf(e.persistence.toLowerCase())===-1&&(F.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var r,n=function(o,a){o===void 0&&(o=[]),a===void 0&&(a=!1);var l=[...aF,...o];return L({},Se,{F(u){try{var c={};try{c=dn.F(u)||{}}catch{}var d,h=JSON.parse(Se.A(u)||"{}");if(a){var f={};for(var g in c){var p=c[g];Mt(p)||p===""||(f[g]=p)}d=Pe(h,f)}else d=Pe(c,h);return Se.q(u,d),d}catch{}return null},q(u,c,d,h,f,g){var p=Se.q(u,c,void 0,void 0,g);try{var b={};l.forEach(v=>{c[v]&&(b[v]=c[v])}),Object.keys(b).length&&dn.q(u,b,d,h,f,g)}catch(v){Se.D(v)}return p},P(u,c){try{O==null||O.localStorage.removeItem(u),dn.P(u,c)}catch(d){Se.D(d)}}})}(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),s=!1,i=e.persistence.toLowerCase();return i==="localstorage"&&Se.N()?(r=Se,s=!0):i==="localstorage+cookie"&&n.N()?(r=n,s=!0):i==="sessionstorage"&&ft.N()?r=ft:i==="memory"?r=lF:i==="cookie"?r=dn:n.N()?(r=n,s=!0):r=dn,this.dr=s,r}wr(e){return this.gr+"__"+e}yr(e){return this.dr&&!!e.split_storage}kr(e){var r=e??this.Te.feature_flag_cache_ttl_ms;if(!r||0>=r)return!1;var n=this.props[vu];return!n||typeof n!="number"||Date.now()-n>r}properties(){var e={};return Ee(this.props,(r,n)=>{var s=ei(n);if((s==null?void 0:s.exposure)==="derived"){if(s.shouldSkipFromEventProperties!=null&&s.shouldSkipFromEventProperties(r,n===di?()=>this.kr():()=>!1))return;s.transformToEventProperties&&Pe(e,s.transformToEventProperties(r))}else if(!s||s.exposure==="event"){if(s!=null&&s.shouldSkipFromEventProperties!=null&&s.shouldSkipFromEventProperties(r,()=>!1))return;e[n]=r}}),e}load(){if(!this._r){var e=this.Ye.F(this.gr);e&&(this.props=Pe({},e)),this.cr&&this.Sr()}}Sr(){for(var e of bc){var r=Se.F(this.wr(e));if(r&&!Ts(r)){var n=this.Cr(e);n.persisted=!0,this.Ir(e)||(n.fingerprint=this.Tr(r,e)),this.Mr(e,r)||Pe(this.props,r)}}}Ir(e){return Object.keys(this.props).some(r=>{var n;return((n=ei(r))==null?void 0:n.storageGroup)===e})}Mr(e,r){var n=RF[e];if(!n)return!1;var s=r[n],i=this.props[n];return gt(s)&&gt(i)&&i>s}refreshKey(e){var r;if(!this._r){var n=this.cr?(r=ei(e))==null?void 0:r.storageGroup:void 0,s=n?Se.F(this.wr(n)):this.Ye.F(this.gr);if(s&&e in s)this.Er(e,s[e]);else{if(n){var i=this.Ye.F(this.gr);if(i&&e in i)return void this.Er(e,i[e])}this.Rr(e)}}}save(){if(!this._r){var e=this.br();e>0?U(this.Pr)&&(this.Pr=setTimeout(()=>{this.Pr=void 0,this.Or()},e)):this.Or()}}flush(){U(this.Pr)||(clearTimeout(this.Pr),this.Pr=void 0,this.Or())}Or(){this._r||(this.cr?this.Fr():this.Lr(this.Ye,this.gr,this.props,no))}Fr(){var e=this.Ar(),r=e.main,n=e.groups;for(var s of(this.Lr(this.Ye,this.gr,r,no),bc)){var i,o=n[s];(!Ts(o)||(i=this.hr[s])!=null&&i.persisted)&&this.Lr(Se,this.wr(s),o,s)}}Ar(){var e={},r={};for(var n of bc)r[n]={};return Ee(this.props,(s,i)=>{var o,a=(o=ei(i))==null?void 0:o.storageGroup;a?r[a][i]=s:e[i]=s}),{main:e,groups:r}}Tr(e,r){if(r===no)return JSON.stringify(e)+"|"+this.$r+"|"+this.Nr+"|"+this.Dr;var n={};return Ee(e,(s,i)=>{var o;n[i]=(o=ei(i))!=null&&o.volatile?"__volatile__":s}),JSON.stringify(n)}Lr(e,r,n,s){var i=this.Cr(s);if(s===no||i.dirty||U(i.fingerprint)){var o;try{if((o=this.Tr(n,s))===i.fingerprint)return void(i.dirty=!1)}catch{o=void 0}e.q(r,n,this.$r,this.Nr,this.Dr,this.Te.debug)?(i.dirty=!1,s!==no&&(i.persisted=!0),U(o)||(i.fingerprint=o)):this.Te.debug&&F.warn('failed to persist storage entry "'+r
112+'"; will retry on next save')}}remove(e){var r=(e===void 0?{}:e).keepGroupEntries,n=r!==void 0&&r;if(U(this.Pr)||(clearTimeout(this.Pr),this.Pr=void 0),this.Ye.P(this.gr,!1),this.Ye.P(this.gr,!0),!n&&this.vr)for(var s of bc)Se.P(this.wr(s));n?delete this.hr[no]:this.hr={}}clear(){this.remove(),this.props={}}register_once(e,r,n){if(je(e)){U(r)&&(r="None"),this.$r=U(n)?this.qr:n;var s=!1;if(Ee(e,(i,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==r||(this.Er(o,i),s=!0)}),s)return this.save(),!0}return!1}register(e,r){if(je(e)){this.$r=U(r)?this.qr:r;var n=!1;if(Ee(e,(s,i)=>{e.hasOwnProperty(i)&&this.props[i]!==s&&(this.Er(i,s),n=!0)}),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Rr(e),this.save())}update_campaign_params(){if(!this.pr){var e=sC(this.Te.custom_campaign_params,this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties);Ts(yy(e))||this.register(e),this.pr=!0}}update_search_keyword(){var e;this.register((e=H==null?void 0:H.referrer)?oC(e):{})}update_referrer_info(){var e;this.register_once({$referrer:aC(),$referring_domain:H!=null&&H.referrer&&((e=_u(H.referrer))==null?void 0:e.host)||rh},void 0)}set_initial_person_info(){this.props[_m]||this.props[wm]||this.register_once({[Yd]:lC(this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties,this.Te.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};Ee([wm,_m],s=>{var i=this.props[s];i&&Ee(i,function(o,a){e["$initial_"+Qg(a)]=o})});var r=this.props[Yd];if(r){var n=function(s,i){i===void 0&&(i=!1);var o=uC(s,i),a={};return Ee(o,function(l,u){a["$initial_"+Qg(u)]=l}),a}(r,this.Te.disable_capture_url_hashes);Pe(e,n)}return e}safe_merge(e){return Ee(this.props,function(r,n){n in e||(e[n]=r)}),e}update_config(e,r,n){this.qr=this.$r=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!n),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var s=e.persistence!==r.persistence||!((l,u)=>{if(l.length!==u.length)return!1;var c=[...l].sort(),d=[...u].sort();return c.every((h,f)=>h===d[f])})(e.cookie_persisted_properties||[],r.cookie_persisted_properties||[]),i=s?this.mr(e):this.Ye,o=this.yr(e);if(s||o!==this.cr){var a=this.props;this.clear(),this.Ye=i,this.cr=o,this.props=a,this.save()}}set_disabled(e){this._r=e,this._r?this.remove():this.save()}set_cross_subdomain(e){e!==this.Nr&&(this.Nr=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Dr&&(this.Dr=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,r){var n=this.props[gl]||{};n[e]=r,this.Er(gl,n),this.save()}remove_event_timer(e){var r=this.props[gl]||{},n=r[e];return U(n)||(delete r[e],this.Er(gl,r),this.save()),n}get_property(e){return this.props[e]}set_property(e,r){this.Er(e,r),this.save()}Er(e,r){var n;this.props[e]=r,(n=ei(e))!=null&&n.volatile||this.jr(e)}Rr(e){delete this.props[e],this.jr(e)}jr(e){var r,n=(r=ei(e))==null?void 0:r.storageGroup;n&&(this.Cr(n).dirty=!0)}Cr(e){return this.hr[e]||(this.hr[e]={})}}var Qa={Activation:"events",Cancellation:"cancelEvents"},Yf={Popover:"popover",API:"api",Widget:"widget"},Mn={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},Jf={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},Sm={Popover:"popover",Inline:"inline"},OF={SHOWN:"product tour shown"},H0={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},W0=$e("[RateLimiter]");class jF{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=r=>{var n=r.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach(s=>{W0.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4})}catch(s){return void W0.warn('could not rate limit - continuing. Error: "'+(s==null?void 0:s.message)+'"',{text:n})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var r,n,s;e===void 0&&(e=!1);var i=this.captureEventsBurstLimit,o=this.captureEventsPerSecond,a=new Date().getTime(),l=(r=(n=this.instance.persistence)==null?void 0:n.get_property(ym))!==null&&r!==void 0?r:{tokens:i,last:a};l.tokens+=(a-l.last)/1e3*o,l.last=a,l.tokens>i&&(l.tokens=i);var u=1>l.tokens;return u||e||(l.tokens=Math.max(0,l.tokens-1)),!u||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+o+" events per second and "+i+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,(s=this.instance.persistence)==null||s.set_property(ym,l),{isRateLimited:u,remainingTokens:l.tokens}
112}isServerRateLimited(e){var r=this.serverLimits[e||"events"]||!1;return r!==!1&&new Date().getTime()<r}}var Xa=$e("[RemoteConfig]");class dC{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=X._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Hr(e){var r,n;(r=X.__PosthogExtensions__)!=null&&r.loadExternalDependency?(n=X.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}Br(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(r){e(r.json)}})}load(){try{if(this.remoteConfig)return Xa.info("Using preloaded remote config",this.remoteConfig),this.Ur(this.remoteConfig),void this.zr();if(this._instance.Vr())return void Xa.warn("Remote config is disabled. Falling back to local config.");this.Hr(e=>{if(!e)return Xa.info("No config found after loading remote JS config. Falling back to JSON."),void this.Br(r=>{this.Ur(r),this.zr()});this.Ur(e),this.zr()})}catch(e){Xa.error("Error loading remote config",e)}}stop(){this.Wr&&(clearInterval(this.Wr),this.Wr=void 0)}refresh(){!this._instance.Vr()&&H&&H.visibilityState!=="hidden"&&this._instance.reloadFeatureFlags()}zr(){var e;if(!this.Wr){var r=(e=this._instance.config.remote_config_refresh_interval_ms)!==null&&e!==void 0?e:3e5;r!==0&&(this.Wr=setInterval(()=>{this.refresh()},r))}}Ur(e){var r;e||Xa.error("Failed to fetch remote config from PostHog."),this._instance.Ur(e??{}),(e==null?void 0:e.hasFeatureFlags)!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(r=this._instance.featureFlags)==null||r.ensureFlagsLoaded())}}var Nt={GZipJS:"gzip-js",Base64:"base64"},xr=Uint8Array,Gt=Uint16Array,ya=Uint32Array,xy=new xr([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]),ky=new xr([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]),q0=new xr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),hC=function(t,e){for(var r=new Gt(31),n=0;31>n;++n)r[n]=e+=1<<t[n-1];var s=new ya(r[30]);for(n=1;30>n;++n)for(var i=r[n];r[n+1]>i;++i)s[i]=i-r[n]<<5|n;return[r,s]},fC=hC(xy,2),Em=fC[1];fC[0][28]=258,Em[258]=28;for(var V0=hC(ky,0)[1],pC=new Gt(32768),Ne=0;32768>Ne;++Ne){var so=(43690&Ne)>>>1|(21845&Ne)<<1;pC[Ne]=((65280&(so=(61680&(so=(52428&so)>>>2|(13107&so)<<2))>>>4|(3855&so)<<4))>>>8|(255&so)<<8)>>>1}var Ml=function(t,e,r){for(var n=t.length,s=0,i=new Gt(e);n>s;++s)++i[t[s]-1];var o,a=new Gt(e);for(s=0;e>s;++s)a[s]=a[s-1]+i[s-1]<<1;for(o=new Gt(n),s=0;n>s;++s)o[s]=pC[a[t[s]-1]++]>>>15-t[s];return o},Di=new xr(288);for(Ne=0;144>Ne;++Ne)Di[Ne]=8;for(Ne=144;256>Ne;++Ne)Di[Ne]=9;for(Ne=256;280>Ne;++Ne)Di[Ne]=7;for(Ne=280;288>Ne;++Ne)Di[Ne]=8;var nh=new xr(32);for(Ne=0;32>Ne;++Ne)nh[Ne]=5;var NF=Ml(Di,9),IF=Ml(nh,5),gC=function(t){return(t/8>>0)+(7&t&&1)},mC=function(t,e,r){(r==null||r>t.length)&&(r=t.length);var n=new(t instanceof Gt?Gt:t instanceof ya?ya:xr)(r-e);return n.set(t.subarray(e,r)),n},xn=function(t,e,r){var n=e/8>>0;t[n]|=r<<=7&e,t[n+1]|=r>>>8},Za=function(t,e,r){var n=e/8>>0;t[n]|=r<<=7&e,t[n+1]|=r>>>8,t[n+2]|=r>>>16},Qf=function(t,e){for(var r=[],n=0;t.length>n;++n)t[n]&&r.push({s:n,f:t[n]});var s=r.length,i=r.slice();if(!s)return[new xr(0),0];if(s==1){var o=new xr(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort(function(k,C){return k.f-C.f}),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,c=1,d=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=s-1;)a=r[r[d].f>r[u].f?u++:d++],l=r[u!=c&&r[d].f>r[u].f?u++:d++],r[c++]={s:-1,f:a.f+l.f,l:a,r:l};var h=i[0].s;for(n=1;s>n;++n)i[n].s>h&&(h=i[n].s);var f=new Gt(h+1),g=Cm(r[c-1],f,0);if(g>e){n=0;var p=0,b=g-e,v=1<<b;for(i.sort(function(k,C){return f[C.s]-f[k.s]||k.f-C.f});s>n;++n){var y=i[n].s;if(e>=f[y])break;p+=v-(1<<g-f[y]),f[y]=e}for(p>>>=b;p>0;){var _=i[n].s;e>f[_]?p-=1<<e-f[_]++-1:++n}for(;n>=0&&p;--n){var x=i[n].s;f[x]==e&&(--f[x],++p)}g=e}return[new xr(f),g]},Cm=function(t,e,r){return t.s==-1?Math.max(Cm(t.l,e,r+1),Cm(t.r,e,r+1)):e[t.s]=r},K0=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new Gt(++e),n=0,s=t[0],i=1,o=function(l){r[n++]=l},a=1;e>=a;++a)if(t[a]==s&&a!=e)++i;else{if(!s&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(s),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(s);i=1,s=t[a]}return[r.subarray(0,n),e]},el=function(t,e){for(var r=0,n=0;e.length>n;++n)r+=t[n]*e[n];return r},Tm=function(t,e,r){var n=r.length,s=gC(e+2);t[s]=255&n,t[s+1]=n>>>8,t[s+2]=255^t[s],t[s+3]=255^t[s+1];for(var i=0;n>i;++i)t[s+i+4]=r[i];return 8*(s+4+n)},G0=function(t,e,r,n,s,i,o,a,l,u,c){xn(e,c++,r),++s[256];for(var d=Qf(s,15),h=d[0],f=d[1],g=Qf(i,15),p=g[0],b=g[1],v=K0(h),y=v[0],_=v[1],x=K0(p
vendor: 4,239 bytes, line 112
112),k=x[0],C=x[1],T=new Gt(19),S=0;y.length>S;++S)T[31&y[S]]++;for(S=0;k.length>S;++S)T[31&k[S]]++;for(var P=Qf(T,7),R=P[0],I=P[1],N=19;N>4&&!R[q0[N-1]];--N);var B,q,ee,$,W=u+5<<3,j=el(s,Di)+el(i,nh)+o,A=el(s,h)+el(i,p)+o+14+3*N+el(T,R)+(2*T[16]+3*T[17]+7*T[18]);if(j>=W&&A>=W)return Tm(e,c,t.subarray(l,l+u));if(xn(e,c,1+(j>A)),c+=2,j>A){B=Ml(h,f),q=h,ee=Ml(p,b),$=p;var M=Ml(R,I);for(xn(e,c,_-257),xn(e,c+5,C-1),xn(e,c+10,N-4),c+=14,S=0;N>S;++S)xn(e,c+3*S,R[q0[S]]);c+=3*N;for(var G=[y,k],V=0;2>V;++V){var Q=G[V];for(S=0;Q.length>S;++S)xn(e,c,M[Z=31&Q[S]]),c+=R[Z],Z>15&&(xn(e,c,Q[S]>>>5&127),c+=Q[S]>>>12)}}else B=NF,q=Di,ee=IF,$=nh;for(S=0;a>S;++S)if(n[S]>255){var Z;Za(e,c,B[257+(Z=n[S]>>>18&31)]),c+=q[Z+257],Z>7&&(xn(e,c,n[S]>>>23&31),c+=xy[Z]);var oe=31&n[S];Za(e,c,ee[oe]),c+=$[oe],oe>3&&(Za(e,c,n[S]>>>5&8191),c+=ky[oe])}else Za(e,c,B[n[S]]),c+=q[n[S]];return Za(e,c,B[256]),c+q[256]},$F=new ya([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),LF=function(){for(var t=new ya(256),e=0;256>e;++e){for(var r=e,n=9;--n;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Xf=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function MF(t,e){e===void 0&&(e={});var r=function(){var d=4294967295;return{p(h){for(var f=d,g=0;h.length>g;++g)f=LF[255&f^h[g]]^f>>>8;d=f},d(){return 4294967295^d}}}(),n=t.length;r.p(t);var s,i,o,a,l,u=(a=10+((s=e).filename&&s.filename.length+1||0),l=8,function(d,h,f,g,p,b){var v=d.length,y=new xr(g+v+5*(1+Math.floor(v/7e3))+p),_=y.subarray(g,y.length-p),x=0;if(!h||8>v)for(var k=0;v>=k;k+=65535){var C=k+65535;v>C?x=Tm(_,x,d.subarray(k,C)):(_[k]=!0,x=Tm(_,x,d.subarray(k,v)))}else{for(var T=$F[h-1],S=T>>>13,P=8191&T,R=(1<<f)-1,I=new Gt(32768),N=new Gt(R+1),B=Math.ceil(f/3),q=2*B,ee=function(Cr){return(d[Cr]^d[Cr+1]<<B^d[Cr+2]<<q)&R},$=new ya(25e3),W=new Gt(288),j=new Gt(32),A=0,M=0,G=(k=0,0),V=0,Q=0;v>k;++k){var Z=ee(k),oe=32767&k,ve=N[Z];if(I[oe]=ve,N[Z]=oe,k>=V){var ie=v-k;if((A>7e3||G>24576)&&ie>423){x=G0(d,_,0,$,W,j,M,G,Q,k-Q,x),G=A=M=0,Q=k;for(var Le=0;286>Le;++Le)W[Le]=0;for(Le=0;30>Le;++Le)j[Le]=0}var Ce=2,Tt=0,Jr=P,Pt=oe-ve&32767;if(ie>2&&Z==ee(k-Pt))for(var Qr=Math.min(S,ie)-1,Wi=Math.min(32767,k),Ia=Math.min(258,ie);Wi>=Pt&&--Jr&&oe!=ve;){if(d[k+Ce]==d[k+Ce-Pt]){for(var Zt=0;Ia>Zt&&d[k+Zt]==d[k+Zt-Pt];++Zt);if(Zt>Ce){if(Ce=Zt,Tt=Pt,Zt>Qr)break;var $a=Math.min(Pt,Zt-2),Xn=0;for(Le=0;$a>Le;++Le){var Xr=k-Pt+Le+32768&32767,La=Xr-I[Xr]+32768&32767;La>Xn&&(Xn=La,ve=Xr)}}}Pt+=(oe=ve)-(ve=I[oe])+32768&32767}if(Tt){$[G++]=268435456|Em[Ce]<<18|V0[Tt];var Zn=31&Em[Ce],Ma=31&V0[Tt];M+=xy[Zn]+ky[Ma],++W[257+Zn],++j[Ma],V=k+Ce,++A}else $[G++]=d[k],++W[d[k]]}}x=G0(d,_,!0,$,W,j,M,G,Q,k-Q,x)}return mC(y,0,g+gC(x)+p)}(i=t,(o=e).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+o.mem,a,l)),c=u.length;return function(d,h){var f=h.filename;if(d[0]=31,d[1]=139,d[2]=8,d[8]=2>h.level?4:h.level==9?2:0,d[9]=3,h.mtime!=0&&Xf(d,4,Math.floor(new Date(h.mtime||Date.now())/1e3)),f){d[3]=8;for(var g=0;f.length>=g;++g)d[g+10]=f.charCodeAt(g)}}(u,e),Xf(u,c-8,r.d()),Xf(u,c-4,n),u}var DF=!!Gg||!!ly,vC="text/plain",Yc=!1,Pm=(t,e)=>{var r=t.split("#"),n=r[1],s=r[0].split("?"),i=s[0],o=s[1];if(!o)return t;var a=o.split("&").filter(l=>l.split("=")[0]!==e).join("&");return i+(a?"?"+a:"")+(n?"#"+n:"")},Sy=function(t,e,r){var n;r===void 0&&(r=!0);var s=t.split("?"),i=s[0],o=s[1],a=L({},e),l=(n=o==null?void 0:o.split("&").map(c=>{var d,h=c.split("="),f=h[0],g=r&&(d=a[f])!==null&&d!==void 0?d:h[1];return delete a[f],f+"="+g}))!==null&&n!==void 0?n:[],u=function(c,d){var h,f;d===void 0&&(d="&");var g=[];return Ee(c,function(p,b){U(p)||U(b)||b==="undefined"||(h=encodeURIComponent((v=>v instanceof File)(p)?p.name:p.toString()),f=encodeURIComponent(b),g[g.length]=f+"="+h)}),g.join(d)}(a);return u&&l.push(u),i+"?"+l.join("&")},jo=(t,e)=>{try{return JSON.stringify(t,(r,n)=>typeof n=="bigint"?n.toString():n,e)}catch{return ZE(t)}},Zf=t=>{if(t.Ge)return t.Ge;var e=t.data,r=t.compression;if(e){if(r===Nt.GZipJS){var n=MF(function(a,l){var u=a.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(a);for(var c=new xr(a.length+(a.length>>>1)),d=0,h=function(b){c[d++]=b},f=0;u>f;++f){if(d+5>c.length){var g=new xr(d+8+(u-f<<1));g.set(c),c=g}
112var p=a.charCodeAt(f);128>p?h(p):2048>p?(h(192|p>>>6),h(128|63&p)):p>55295&&57344>p?(h(240|(p=65536+(1047552&p)|1023&a.charCodeAt(++f))>>>18),h(128|p>>>12&63),h(128|p>>>6&63),h(128|63&p)):(h(224|p>>>12),h(128|p>>>6&63),h(128|63&p))}return mC(c,0,d)}(jo(e)),{mtime:0});return{contentType:vC,body:n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength),estimatedSize:n.byteLength}}if(r===Nt.Base64){var s=function(a){return a&&btoa(encodeURIComponent(a).replace(/%([0-9A-F]{2})/g,(l,u)=>String.fromCharCode(parseInt(u,16))))}(jo(e)),i=(a=>"data="+encodeURIComponent(typeof a=="string"?a:jo(a)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var o=jo(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},yC=t=>{var e,r,n=()=>t.transport==="sendBeacon"?{url:Sy(t.url,{compression:Nt.Base64}),encodedBody:Zf(L({},t,{compression:Nt.Base64,Ge:void 0}))}:{url:Pm(t.url,"compression"),encodedBody:Zf(L({},t,{compression:void 0,Ge:void 0}))};try{e=Zf(t)}catch(s){if(_0(t.compression,ma(t.url,"compression")))return F.error("Failed to gzip request body, sending uncompressed payload",s),n();throw s}return e&&_0(t.compression,ma(t.url,"compression"))&&!((r=e.body)instanceof ArrayBuffer?Yg(new Uint8Array(r)):ArrayBuffer.isView(r)&&Yg(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)))?(Yc=!0,n()):{url:t.url,encodedBody:e}},_C=t=>{try{return yC(t)}catch(e){return F.error(e),void(t.callback==null||t.callback({statusCode:0,error:e}))}},FF=function(){var t=Ye(function*(e){var r=jo(e.data),n=yield function(i,o,a){return Jg.apply(this,arguments)}(r,Fe.DEBUG,{rethrow:!0});if(!n)return e;var s=yield n.arrayBuffer();return L({},e,{Ge:{contentType:vC,body:s,estimatedSize:s.byteLength}})});return function(e){return t.apply(this,arguments)}}(),UF=/Failed to fetch|NetworkError|Load failed/i,wC=t=>{var e=_C(t);if(e){var r=e.url,n=e.encodedBody,s=n??{},i=s.contentType,o=s.body,a=s.estimatedSize,l=new Headers;Ee(t.headers,function(g,p){l.append(p,g)}),i&&l.append("Content-Type",i);var u=null,c=!1;if(h0){var d=new h0;u={signal:d.signal,timeout:setTimeout(()=>{var g,p;c=!0,d.abort((g=t.timeout,(p=new Error("PostHog request timed out"+(g?" after "+g+"ms":""))).name="AbortError",p))},t.timeout)}}var h=g=>{c&&(g==null?void 0:g.name)==="AbortError"||(p=>(p==null?void 0:p.name)==="TypeError"&&UF.test((p==null?void 0:p.message)||""))(g)?F.warn(g):F.error(g),t.callback==null||t.callback({statusCode:0,error:g})};try{var f;ly(r,L({method:(t==null?void 0:t.method)||"GET",headers:l,keepalive:t.method==="POST"&&!t.Qe&&52428.8>(a||0),body:o,signal:(f=u)==null?void 0:f.signal},t.fetchOptions)).then(g=>g.text().then(p=>{var b={statusCode:g.status,text:p};if(g.status===200)try{b.json=JSON.parse(p)}catch(v){F.error(v)}t.callback==null||t.callback(b)})).catch(h).finally(()=>u?clearTimeout(u.timeout):null)}catch(g){u&&clearTimeout(u.timeout),h(g)}}},Rm=t=>{try{var e=yC(t),r=e.url,n=e.encodedBody,s=n??{},i=s.body,o=s.estimatedSize;if(!i)return;var a=i instanceof Blob?i:new Blob([i],{type:s.contentType});if($t.sendBeacon(r,a))return;if(ce(t.data)&&t.data.length>1&&(o??0)>16384){var l=Math.ceil(t.data.length/2);return Rm(L({},t,{data:t.data.slice(0,l)})),void Rm(L({},t,{data:t.data.slice(l)}))}F.warn("Beacon of ~"+(o??0)+" bytes was rejected by the browser, falling back to fetch"),wC(L({},t,{Qe:!0}))}catch(u){F.warn("Beacon send failed",u)}},BF=["/e/","/s/"],Y0=(t,e)=>{var r=(s=>{var i=(o=>{var a=_u(o),l=(a==null?void 0:a.pathname)||o.split(/[?#]/)[0];return l?l[0]==="/"?l:"/"+l:"/"})(s);return BF.some(o=>((a,l)=>a.slice(a.length-l.length)===l)(i,o))})(t),n=r?Pm(t,"ver"):t;return Sy(e===Nt.GZipJS?Pm(n,"compression"):n,L({_:new Date().getTime().toString()},r?{}:{ver:Fe.JS_SDK_VERSION},e===Nt.GZipJS?{}:{compression:e}))},Jc=[];ly&&Jc.push({transport:"fetch",method:wC}),Gg&&Jc.push({transport:"XHR",method(t){var e=_C(t);if(e){var r=new Gg,n=e.encodedBody;r.open(t.method||"GET",e.url,!0);var s=n??{},i=s.contentType,o=s.body;Ee(t.headers,function(a,l){r.setRequestHeader(l,a)}),i&&r.setRequestHeader("Content-Type",i),t.timeout&&(r.timeout=t.timeout),r.onreadystatechange=()=>{if(r.readyState===4){var a={statusCode:r.status,text:r.responseText};if(r.status===200)try{a.json=JSON.parse(r.responseText)}catch{}t.callback==null||t.callback(a)}},r.send(o)}}}),$t!=null&&$t.sendBeacon&&Jc.push({transport:"sendBeacon",method:Rm});var Am=3e3;class zF{constructor(e,r){this.Zr=!0,this.Gr=[],this.Qr=fn((r==null?void 0:r.flush_interval_ms)||Am,250,5e3,F.createLogger("flush interval"),Am),this.Jr=e}enqueue(e){this.Gr.push(e),this.Kr||this.Yr()}
112unload(){this.Xr();var e=this.Gr.length>0?this.ti():{},r=Object.values(e);[...r.filter(n=>n.url.indexOf("/e")===0),...r.filter(n=>n.url.indexOf("/e")!==0)].map(n=>{this.ei(L({},n,{transport:"sendBeacon"}))})}enable(){this.Zr=!1,this.Yr()}Yr(){var e=this;this.Zr||(this.Kr=setTimeout(()=>{if(this.Xr(),this.Gr.length>0){var r=this.ti(),n=function(){var i=r[s],o=new Date().getTime();i.data&&ce(i.data)&&Ee(i.data,a=>{a.offset=Math.abs(a.timestamp-o),delete a.timestamp}),e.ei(i)};for(var s in r)n()}},this.Qr))}ei(e){try{this.Jr(e)}catch(r){F.error(r)}}Xr(){clearTimeout(this.Kr),this.Kr=void 0}ti(){var e={};return Ee(this.Gr,r=>{var n,s=r,i=(s?s.batchKey:null)||s.url;U(e[i])&&(e[i]=L({},s,{data:[]})),(n=e[i].data)==null||n.push(s.data)}),this.Gr=[],e}}var HF=["retriesPerformedSoFar"];class WF{constructor(e){this.ri=!1,this.ii=3e3,this.Gr=[],this._instance=e,this.Gr=[],this.ni=!0,!U(O)&&"onLine"in O.navigator&&(this.ni=O.navigator.onLine,this.si=()=>{this.ni=!0,this.oi()},this.ai=()=>{this.ni=!1},Ue(O,"online",this.si),Ue(O,"offline",this.ai))}get length(){return this.Gr.length}retriableRequest(e){var r=e.retriesPerformedSoFar,n=QE(e,HF);Cn(r)&&(n.url=Sy(n.url,{retry_count:r})),this._instance._send_request(L({},n,{callback:s=>{if(s.statusCode!==200&&(400>s.statusCode||s.statusCode>=500)){if((s.statusCode===0?3:10)>(r??0))return void this.Ot(L({retriesPerformedSoFar:r},n));s.statusCode===0&&F.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(r??0)+" retries.")}n.callback==null||n.callback(s)}}))}Ot(e){var r=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=r+1;var n=function(o){var a=3e3*Math.pow(2,o),l=a/2,u=Math.min(18e5,a),c=Math.random()-.5;return Math.ceil(u+c*(u-l))}(r),s=Date.now()+n;this.Gr.push({retryAt:s,requestOptions:e});var i="Enqueued failed request for retry in "+n;navigator.onLine||(i+=" (Browser is offline)"),F.warn(i),this.ri||(this.ri=!0,this.li())}li(){if(this.ui&&clearTimeout(this.ui),this.Gr.length===0)return this.ri=!1,void(this.ui=void 0);this.ui=setTimeout(()=>{this.ni&&this.Gr.length>0&&this.oi(),this.li()},this.ii)}oi(){var e=Date.now(),r=[],n=this.Gr.filter(i=>e>i.retryAt||(r.push(i),!1));if(this.Gr=r,n.length>0)for(var s of n)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this.ui&&(clearTimeout(this.ui),this.ui=void 0),this.ri=!1,U(O)||(this.si&&(O.removeEventListener("online",this.si),this.si=void 0),this.ai&&(O.removeEventListener("offline",this.ai),this.ai=void 0)),this.Gr)){var r=e.requestOptions;try{this._instance._send_request(L({},r,{transport:"sendBeacon"}))}catch(n){F.error(n)}}this.Gr=[]}}class qF{constructor(e){this.hi=()=>{var r,n,s,i;this.di||(this.di={});var o=this.scrollElement(),a=this.scrollY(),l=o?Math.max(0,o.scrollHeight-o.clientHeight):0,u=a+((o==null?void 0:o.clientHeight)||0),c=(o==null?void 0:o.scrollHeight)||0;this.di.lastScrollY=Math.ceil(a),this.di.maxScrollY=Math.max(a,(r=this.di.maxScrollY)!==null&&r!==void 0?r:0),this.di.maxScrollHeight=Math.max(l,(n=this.di.maxScrollHeight)!==null&&n!==void 0?n:0),this.di.lastContentY=u,this.di.maxContentY=Math.max(u,(s=this.di.maxContentY)!==null&&s!==void 0?s:0),this.di.maxContentHeight=Math.max(c,(i=this.di.maxContentHeight)!==null&&i!==void 0?i:0)},this._instance=e}get ci(){return this._instance.config.scroll_root_selector}getContext(){return this.di}resetContext(){var e=this.di;return setTimeout(this.hi,0),e}startMeasuringScrollPosition(){Ue(O,"scroll",this.hi,{capture:!0}),Ue(O,"scrollend",this.hi,{capture:!0}),Ue(O,"resize",this.hi)}scrollElement(){if(!this.ci)return O==null?void 0:O.document.documentElement;var e=ce(this.ci)?this.ci:[this.ci];for(var r of e){var n=O==null?void 0:O.document.querySelector(r);if(n)return n}}vi(e){var r=e==="y"?"scrollTop":"scrollLeft";if(this.ci){var n=this.scrollElement();return n&&n[r]||0}return O?e==="y"?O.scrollY||O.pageYOffset||O.document.documentElement.scrollTop||0:O.scrollX||O.pageXOffset||O.document.documentElement.scrollLeft||0:0}scrollY(){return this.vi("y")}scrollX(){return this.vi("x")}}var VF=t=>lC(t==null?void 0:t.config.mask_personal_data_properties,t==null?void 0:t.config.custom_personal_data_properties,t==null?void 0:t.config.disable_capture_url_hashes
112);class J0{constructor(e,r,n,s){this.fi=i=>{var o=this.pi();if(!o||o.sessionId!==i){var a={sessionId:i,props:this.gi(this._instance)};this.mi.register({[vm]:a})}},this._instance=e,this.yi=r,this.mi=n,this.gi=s||VF,this.yi.onSessionId(this.fi)}pi(){return this.mi.props[vm]}getSetOnceProps(){var e,r=(e=this.pi())==null?void 0:e.props;return r?"r"in r?uC(r,this._instance.config.disable_capture_url_hashes):{$referring_domain:r.referringDomain,$pathname:r.initialPathName,utm_source:r.utm_source,utm_campaign:r.utm_campaign,utm_medium:r.utm_medium,utm_content:r.utm_content,utm_term:r.utm_term}:{}}getSessionProps(){var e={};return Ee(yy(this.getSetOnceProps()),(r,n)=>{n==="$current_url"&&(n="url"),e["$session_entry_"+Qg(n)]=r}),e}}class Ey{constructor(){this.bi={}}on(e,r){return this.bi[e]||(this.bi[e]=[]),this.bi[e].push(r),()=>{this.bi[e]=this.bi[e].filter(n=>n!==r)}}emit(e,r){for(var n of this.bi[e]||[])n(r);for(var s of this.bi["*"]||[])s(e,r)}}var tl=$e("[SessionId]");class Q0{on(e,r){return this.wi.on(e,r)}constructor(e,r,n){var s;if(this.xi=null,this.ki=[],this.Si=void 0,this.Ci=!1,this.wi=new Ey,this.Ii=(u,c)=>!(!Cn(u)||!Cn(c))&&Math.abs(u-c)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===Ln)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Te=e.config,this.mi=e.persistence,this.Ti=void 0,this.Mi=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ei=r||Nn,this.Ri=n||Nn;var i=this.Te.persistence_name||this.Te.token;if(this._sessionTimeoutMs=1e3*fn(this.Te.session_idle_timeout_seconds||1800,60,36e3,tl.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Pi(),this.Oi="ph_"+i+"_window_id",this.Fi="ph_"+i+"_primary_window_exists",this.Li()){var o=ft.F(this.Oi),a=ft.F(this.Fi);o&&!a?this.Ti=o:ft.P(this.Oi),ft.q(this.Fi,!0)}if((s=this.Te.bootstrap)!=null&&s.sessionID)try{var l=(u=>{var c=this.Te.bootstrap.sessionID.replace(/-/g,"");if(c.length!==32)throw new Error("Not a valid UUID");if(c[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(c.substring(0,12),16)})();this.Ai(this.Te.bootstrap.sessionID,new Date().getTime(),l)}catch(u){tl.error("Invalid sessionID in bootstrap",u)}this.$i()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return U(this.ki)&&(this.ki=[]),this.ki.push(e),this.Mi&&e(this.Mi,this.Ti),()=>{this.ki=this.ki.filter(r=>r!==e)}}Li(){return this.Te.persistence!=="memory"&&!this.mi._r&&ft.N()}Ni(e){e!==this.Ti&&(this.Ti=e,this.Li()&&ft.q(this.Oi,e))}Di(){return this.Ti?this.Ti:this.Li()?ft.F(this.Oi):null}qi(e){var r=this.xi;return!Mt(r)&&!Mt(e)&&5e3>Math.abs(e-r)}Ai(e,r,n){var s=r!==this._sessionActivityTimestamp,i=!(e!==this.Mi||n!==this._sessionStartTimestamp);this._sessionStartTimestamp=n,this._sessionActivityTimestamp=r,this.Mi=e,i&&!s||i&&this.qi(r)||(this.xi=r,this.mi.register({[Oo]:[r,e,n]}))}ji(){var e,r=(e=this.Te)==null?void 0:e.persistence_save_debounce_ms;return Cn(r)&&r>0}Hi(){this.ji()?this.mi.refreshKey(Oo):(this.mi.flush(),this.mi.load())}Bi(){var e;if(!Mt(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.xi){this.Hi();var r=this.Ui();r[1]===this.Mi&&r[2]===this._sessionStartTimestamp&&(this.xi=this._sessionActivityTimestamp,this.mi.register({[Oo]:[this._sessionActivityTimestamp,(e=this.Mi)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.mi.flush())}}zi(){var e=this.Ui()[0],r=Cn(e)?e:0,n=Cn(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(r,n)}Vi(e){return this.Hi(),this.Ii(e,this.zi())}Ui(){var e=this.mi.props[Oo];return ce(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.xi=null,clearTimeout(this.Wi),this.Wi=void 0,this.Ai(null,null,null)}destroy(){this.Ci=!0,this.Bi(),clearTimeout(this.Wi),this.Wi=void 0,this.Si&&O&&(O.removeEventListener(Xd,this.Si,{capture:!1}),this.Si=void 0),this.ki=[]}$i(){this.Si=()=>{this.Bi(),this.Li()&&ft.P(this.Fi)},Ue(O,Xd,this.Si,{capture:!1})}
112checkAndGetSessionAndWindowId(e,r){if(e===void 0&&(e=!1),r===void 0&&(r=null),this.Te.cookieless_mode===Ln)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var n=r||new Date().getTime(),s=this.Ui(),i=s[1],o=s[2],a=this.zi(),l=this.Di(),u=Cn(o)&&Math.abs(n-o)>864e5,c=!1,d=!1,h=!i,f=i,g=!h&&!e&&this.Ii(n,a);if(g){(g=this.Vi(n))||tl.info("cross-tab refresh kept the session alive",{sessionId:i});var p=this.Ui();i=p[1],o=p[2]}h||g||u?(i=this.Ei(),l=this.Ri(),tl.info("new session ID generated",{sessionId:i,windowId:l,changeReason:{noSessionId:h,activityTimeout:g,sessionPastMaximumLength:u}}),o=n,c=!0):(l||(l=this.Ri(),c=!0),(d=i!==f)&&(tl.info("adopted cross-tab session id",{sessionId:i,windowId:l}),c=!0));var b=Cn(a)&&e&&!u?a:n,v=Cn(o)?o:new Date().getTime();this.Ni(l),this.Ai(i,b,v),e||this.Pi();var y={noSessionId:h,activityTimeout:g,sessionPastMaximumLength:u,crossTabAdoption:d};return c&&this.ki.forEach(_=>_(i,l,y)),{sessionId:i,windowId:l,sessionStartTimestamp:v,changeReason:c?y:void 0,lastActivityTimestamp:a}}Pi(){this.Ci||(clearTimeout(this.Wi),this.Wi=setTimeout(()=>{if(!this.Ci)if(this.Vi(new Date().getTime())){var e=this.Mi;this.resetSessionId(),this.wi.emit("forcedIdleReset",{idleSessionId:e})}else this.Pi()},1.1*this.sessionTimeoutMs))}}var bC=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&b0(r,e))return!0;try{var n=t==null?void 0:t.userAgentData;if(n!=null&&n.brands&&n.brands.some(s=>b0(s==null?void 0:s.brand,e)))return!0}catch{}return!!t.webdriver};function xC(){return(xC=Ye(function*(){var t=$t==null?void 0:$t.userAgentData;if(t!=null&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),r=e==null?void 0:e.model;return ke(r)&&r.length>0?r:void 0}catch(n){return void F.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",n)}})).apply(this,arguments)}var sh=function(t,e){if(!function(r){try{new RegExp(r)}catch{return!1}return!0}(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function X0(t,e,r){return jo({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var kC={exact:(t,e)=>e.some(r=>t.some(n=>r===n)),is_not:(t,e)=>e.every(r=>t.every(n=>r!==n)),regex:(t,e)=>e.some(r=>t.some(n=>sh(r,n))),not_regex:(t,e)=>e.every(r=>t.every(n=>!sh(r,n))),icontains:(t,e)=>e.map(kc).some(r=>t.map(kc).some(n=>r.includes(n))),not_icontains:(t,e)=>e.map(kc).every(r=>t.map(kc).every(n=>!r.includes(n))),gt:(t,e)=>e.some(r=>{var n=parseFloat(r);return!isNaN(n)&&t.some(s=>n>parseFloat(s))}),lt:(t,e)=>e.some(r=>{var n=parseFloat(r);return!isNaN(n)&&t.some(s=>n<parseFloat(s))})},kc=t=>t.toLowerCase();function SC(t,e){return!t||Object.entries(t).every(r=>{var n=r[1],s=e==null?void 0:e[r[0]];if(U(s)||Mt(s))return!1;var i=[String(s)],o=kC[n.operator];return!!o&&o(n.values,i)})}var Om="custom",Z0="i.posthog.com",KF=/^\/static\//;class GF{constructor(e){this.Zi={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,r=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return r||(r=this.apiHost.replace("."+Z0,".posthog.com")),r==="https://app.posthog.com"?"https://us.posthog.com":r}get region(){return this.Zi[this.apiHost]||(this.Zi[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":Om),this.Zi[this.apiHost]}Gi(e){if(KF.test(e)){var r=this.instance.config.asset_host;if(typeof r=="string")return r.trim().replace(/\/$/,"")||void 0}}endpointFor(e,r){if(r===void 0&&(r=""),r&&(r=r[0]==="/"?r:"/"+r),e==="ui")return this.uiHost+r;if(e==="flags")return this.flagsApiHost+r;if(e==="assets"){var n=this.Gi(r);if(n)return""+n+r}if(this.region===Om)return this.apiHost+r;var s=Z0+r;switch(e){case"assets":return"https://"+this.region+"-assets."+s;case"api":return"https://"+this.region+"."+s}}}function EC(t){var e;return!((e=t.conditions)==null||(e=e.events)==null||(e=e.values)==null||!e.length)}var xe=$e("[Surveys]"),CC="seenSurvey_",TC=t=>{try{var e=(r=>((n,s)=>""+CC+function(i){return i.current_iteration&&i.current_iteration>0?i.id+"_"+i.current_iteration:i.id}(s))(0,r))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(r){xe.error("Failed to persist survey seen state",r)}},YF=[Yf.Popover,Yf.Widget,Yf.API],JF={ignoreConditions:!1,ignoreDelay:!1,displayType:Sm.Popover}
112,QF=$e("[PostHog ExternalIntegrations]"),XF={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class ZF{constructor(e){this._instance=e}rr(e,r){var n;(n=X.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,e,s=>{if(s)return QF.error("failed to load script",s);r()})}startIfEnabledOrStop(){var e=this,r=function(){var i,o,a,l=n[0],u=n[1];!u||(i=X.__PosthogExtensions__)!=null&&(i=i.integrations)!=null&&i[l]||e.rr(XF[l],()=>{var c;(c=X.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[l])==null||c.start(e._instance)}),!u&&(o=X.__PosthogExtensions__)!=null&&(o=o.integrations)!=null&&o[l]&&((a=X.__PosthogExtensions__)==null||(a=a.integrations)==null||(a=a[l])==null||a.stop())};for(var n of Object.entries((s=this._instance.config.integrations)!==null&&s!==void 0?s:{})){var s;r()}}}var Dl={},ep=0,ih=()=>{},eb='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',rl="Surveys module not available",tb="sanitize_properties is deprecated. Use before_send instead",PC="Invalid value for property_denylist config: ",vo="posthog",RC=!DF&&(Wt==null?void 0:Wt.indexOf("MSIE"))===-1&&(Wt==null?void 0:Wt.indexOf("Mozilla"))===-1,rb=t=>{var e;return L({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:rF(H==null?void 0:H.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:ih,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:Xe&&ke(Xe==null?void 0:Xe.search)&&Xe.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,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:(O==null||(e=O.location)==null?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,surveys_request_timeout_ms:1e4,on_request_error(r){F.error("Bad HTTP status: "+r.statusCode+" "+r.text)},get_device_id:r=>r,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:bm,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Am},error_tracking:{},_onCapture:ih},(r=>({rageclick:r&&r>="2026-05-30"?{content_ignorelist:pF,ignore_text_selection:!0}
112:!r||"2025-11-30">r||{content_ignorelist:!0},capture_pageview:!r||"2025-05-24">r||"history_change",session_recording:r&&r>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:r&&r>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:r&&r>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:r&&r>="2026-01-30"?"head":"body",internal_or_test_user_hostname:r&&r>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:r&&r>="2026-05-30"?250:0,split_storage:!(!r||"2026-05-30">r),detect_google_search_app:!(!r||"2026-05-30">r),disable_capture_url_hashes:!(!r||"2026-06-25">r)}))(t))},eU=[["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"]],nb=t=>{var e={};for(var r of eU){var n=r[0],s=r[1];U(t[n])||(e[s]=t[n])}var i=Pe({},e,t),o=t.__preview_external_dependency_versioned_paths;return U(o)||(U(t.strict_script_versioning)&&(i.strict_script_versioning=!!o),ke(o)&&U(t.asset_host)&&(i.asset_host=o)),ce(t.property_blacklist)&&(U(t.property_denylist)?i.property_denylist=t.property_blacklist:ce(t.property_denylist)?i.property_denylist=[...t.property_blacklist,...t.property_denylist]:F.error(PC+t.property_denylist)),i};class tU{constructor(){this.__forceAllowLocalhost=!1}get Qi(){return this.__forceAllowLocalhost}set Qi(e){F.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class _r{Ji(e,r){if(e){var n=this.Ki.indexOf(e);n!==-1&&this.Ki.splice(n,1)}return this.Ki.push(r),r.initialize==null||r.initialize(),r}Yi(){return this.config.cookieless_mode===Ln||this.config.cookieless_mode===ui&&this.consent.isRejected()}get decideEndpointWasHit(){var e,r;return(e=(r=this.featureFlags)==null?void 0:r.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,r;return(e=(r=this.featureFlags)==null?void 0:r.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.webPerformance=new tU,this.Xi=!1,this.version=Fe.LIB_VERSION,this.tn=new Ey,this.Ki=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=rb(),this.SentryIntegration=kF,this.sentryIntegration=n=>function(s,i){var o=tC(s,i);return{name:eC,processEvent:a=>o(a)}}(this,n),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.en=!1,this.rn=null,this.nn=null,this.sn=null,this.scrollManager=new qF(this),this.pageViewManager=new B0(this),this.rateLimiter=new jF(this),this.requestRouter=new GF(this),this.consent=new uF(this),this.externalIntegrations=new ZF(this);var r=(e=_r.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.featureFlags=r.featureFlags&&new r.featureFlags(this),this.toolbar=r.toolbar&&new r.toolbar(this),this.surveys=r.surveys&&new r.surveys(this),this.conversations=r.conversations&&new r.conversations(this),this.logs=r.logs&&new r.logs(this),this.metrics=r.metrics&&new r.metrics(this),this.experiments=r.experiments&&new r.experiments(this),this.exceptions=r.exceptions&&new r.exceptions(this),this.people={set:(n,s,i)=>{var o=ke(n)?{[n]:s}:n;this.setPersonProperties(o),i==null||i({})},set_once:(n,s,i)=>{var o=ke(n)?{[n]:s}:n;this.setPersonProperties(void 0,o),i==null||i({})}},this.on("eventCaptured",n=>F.info('send "'+(n==null?void 0:n.event)+'"',n))}init(e,r,n){if(n&&n!==vo){var s,i=(s=Dl[n])!==null&&s!==void 0?s:new _r;return i._init(e,r,n),Dl[n]=i,Dl[vo][n]=i,i}return this._init(e,r,n)}_init(e,r,n){var s,i;r===void 0&&(r={});var o=ke(e)?e.trim():"";if(!o)return F.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},r.debug=this.an(r.debug),this.ln=r,this.un=[],r.person_profiles?this.nn=r.person_profiles:r.process_person&&(this.nn=r.process_person);var a=rb(r.defaults),l=nb(r),u=Pe({},a,l,{name:n,token:o});je(a.rageclick)&&je(l.rageclick)&&(u.rageclick=Pe({},a.rageclick,l.rageclick)),je(a.session_recording)&&je(l.session_recording)&&(u.session_recording=Pe({},a.session_recording,l.session_recording)),this.set_config(u),this.config.on_xhr_error&&F.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=r.disable_compression?void 0:Nt.GZipJS;var c=this.hn();this.persistence=new Gf(this.config,c),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Gf(L({},this.config,{persistence:"sessionStorage"}),c,!1);var d=L({},this.persistence.props),h=L({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.dn=new zF(x=>this.cn(x),this.config.request_queue_config),this.vn=new WF(this),this.__request_queue=[];var f=this.Yi();if(f||(this.sessionManager=new Q0(this),this.sessionPropsManager=new J0(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(F.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.fn(f)},0)):(F.info("Initializing extensions synchronously"),this.fn(f)),Fe.DEBUG=Fe.DEBUG||this.config.debug,Fe.DEBUG&&F.info("Starting in debug mode",{this:this,config:r,thisC:L({},this.config),p:d,s:h}),!this.config.identity_distinct_id||(s=r.bootstrap)!=null&&s.distinctID||(r.bootstrap=L({},r.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((i=r.bootstrap)==null?void 0:i.distinctID)!==void 0){var g=r.bootstrap.distinctID,p=this.get_distinct_id(),b=this.persistence.get_property(Ir);if(r.bootstrap.isIdentifiedID&&p!=null&&p!==g&&b===to)this.identify(g);else if(r.bootstrap.isIdentifiedID&&p!=null&&p!==g&&b===ro)F.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{var v=this.config.get_device_id(Nn()),y=r.bootstrap.isIdentifiedID?v:g;this.persistence.set_property(Ir,r.bootstrap.isIdentifiedID?ro:to),this.register({distinct_id:g,$device_id:y})}}if(f)this.register_once({distinct_id:vc,$device_id:null},"");else if(!this.get_distinct_id()){var _=this.config.get_device_id(Nn());this.register_once({distinct_id:_,$device_id:_},""),this.persistence.set_property(Ir,to)}return Ue(O,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),r.segment?function(x,k){var C=x.config.segment;if(!C)return k();(function(T,S){var P=T.config.segment;if(!P)return S();var R=N=>{var B=()=>N.anonymousId()||Nn();T.config.get_device_id=B,N.id()&&(T.register({distinct_id:N.id(),$device_id:B()}),T.persistence.set_property(Ir,ro)),S()},I=P.user();"then"in I&&Br(I.then)?I.then(R):R(I)})(x,()=>{C.register((T=>{typeof Promise<"u"&&Promise.resolve||Kf.warn("This browser does not have Promise support, and can not use the segment integration");var S=(P,R)=>{if(!R)return P;P.event.userId||P.event.anonymousId===T.get_distinct_id()||(Kf.info("No userId set, resetting PostHog"),T.reset()),P.event.userId&&P.event.userId!==T.get_distinct_id()&&(Kf.info("UserId set, identifying with PostHog"),T.identify(P.event.userId)
112);var I=T.calculateEventProperties(R,P.event.properties);return P.event.properties=Object.assign({},I,P.event.properties),P};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:P=>S(P,P.event.event),page:P=>S(P,mo),identify:P=>S(P,Wf),screen:P=>S(P,"$screen")}})(x)).then(()=>{k()})})}(this,()=>this.pn()):this.pn(),Br(this.config._onCapture)&&this.config._onCapture!==ih&&(F.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",x=>this.config._onCapture(x.event,x))),this.config.ip&&F.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 xC.apply(this,arguments)}().then(x=>{x&&this.register({[zf]:x})}).catch(ih),this}fn(e){var r,n,s,i,o,a,l,u,c=performance.now(),d=L({},_r.__defaultExtensionClasses,this.config.__extensionClasses),h=[];d.featureFlags&&this.Ki.push(this.featureFlags=(r=this.featureFlags)!==null&&r!==void 0?r:new d.featureFlags(this)),d.exceptions&&this.Ki.push(this.exceptions=(n=this.exceptions)!==null&&n!==void 0?n:new d.exceptions(this)),d.historyAutocapture&&this.Ki.push(this.historyAutocapture=new d.historyAutocapture(this)),d.tracingHeaders&&this.Ki.push(this.tracingHeaders=new d.tracingHeaders(this)),d.siteApps&&this.Ki.push(this.siteApps=new d.siteApps(this)),d.sessionRecording&&!e&&this.Ki.push(this.sessionRecording=new d.sessionRecording(this)),this.config.disable_scroll_properties||h.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),d.autocapture&&this.Ki.push(this.autocapture=new d.autocapture(this)),d.surveys&&this.Ki.push(this.surveys=(s=this.surveys)!==null&&s!==void 0?s:new d.surveys(this)),d.logs&&this.Ki.push(this.logs=(i=this.logs)!==null&&i!==void 0?i:new d.logs(this)),d.metrics&&this.Ki.push(this.metrics=(o=this.metrics)!==null&&o!==void 0?o:new d.metrics(this)),d.conversations&&this.Ki.push(this.conversations=(a=this.conversations)!==null&&a!==void 0?a:new d.conversations(this)),d.productTours&&this.Ki.push(this.productTours=new d.productTours(this)),d.heatmaps&&this.Ki.push(this.heatmaps=new d.heatmaps(this)),d.webVitalsAutocapture&&this.Ki.push(this.webVitalsAutocapture=new d.webVitalsAutocapture(this)),d.exceptionObserver&&this.Ki.push(this.exceptionObserver=new d.exceptionObserver(this)),d.deadClicksAutocapture&&this.Ki.push(this.deadClicksAutocapture=new d.deadClicksAutocapture(this,xF)),d.toolbar&&this.Ki.push(this.toolbar=(l=this.toolbar)!==null&&l!==void 0?l:new d.toolbar(this)),d.experiments&&this.Ki.push(this.experiments=(u=this.experiments)!==null&&u!==void 0?u:new d.experiments(this)),this.Ki.forEach(f=>{f.initialize&&h.push(()=>{f.initialize==null||f.initialize()})}),h.push(()=>{if(this.gn){var f=this.gn;this.gn=void 0,this.Ur(f)}}),this.mn(h,c)}mn(e,r){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-r>=30&&e.length>0)return void setTimeout(()=>{this.mn(e,r)},0);var n=e.shift();if(n)try{n()}catch(i){F.error("Error initializing extension:",i)}}var s=Math.round(performance.now()-r);this.register_for_session({[M1]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[D1]:s}),this.config.__preview_deferred_init_extensions&&F.info("PostHog extensions initialized ("+s+"ms)")}Ur(e){var r;if(!H||!H.body)return F.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Ur(e)},500);this.config.__preview_deferred_init_extensions&&(this.gn=e),this.yn=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=se(e.supportedCompression,Nt.GZipJS)?Nt.GZipJS:se(e.supportedCompression,Nt.Base64)?Nt.Base64:void 0),(r=e.analytics)!=null&&r.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.nn?this.nn:bm}),this.Ki.forEach(n=>n.onRemoteConfig==null?void 0:n.onRemoteConfig(e))}pn(){try{this.config.loaded(this)}catch(n){F.critical("`loaded` function failed",n)}if(this.bn(),this.config.internal_or_test_user_hostname&&Xe!=null&&Xe.hostname){var e=Xe.hostname,r=this.config.internal_or_test_user_hostname;(typeof r=="string"?e===r:r.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.Yi())&&this._n()},1),this.wn=new dC(this),this.wn.load()}bn(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.dn)==null||e.enable())}_dom_loaded(){this.is_capturing()&&yc(this.__request_queue,e=>this.cn(e)),this.__request_queue=[],this.bn()}_handle_unload(){var e,r,n,s,i;(e=this.surveys)==null||e.handlePageUnload==null||e.handlePageUnload(),(r=this.metrics)==null||r.flush("sendBeacon"),this.config.request_batching?(this.xn()&&this.capture(Hf),(n=this.logs)==null||n.flushLogs("sendBeacon"),(s=this.dn)==null||s.unload(),(i=this.vn)==null||i.unload()):this.xn()&&this.capture(Hf,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?RC?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=L({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(U(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,
112(r=>{var n,s,i,o=L({},r);o.timeout=o.timeout||6e4;var a=(n=o.transport)!==null&&n!==void 0?n:"fetch";a==="sendBeacon"&&U(o.compression)&&o.data&&(o.compression=Nt.Base64),o.url=Y0(o.url,o.compression);var l=Jc.filter(c=>!o.disableTransport||!c.transport||!o.disableTransport.includes(c.transport)),u=(s=(i=function(c,d){for(var h=0;c.length>h;h++)if(c[h].transport===a)return c[h]}(l))==null?void 0:i.method)!==null&&s!==void 0?s:l[0].method;if(!u)throw new Error("No available transport method");a!=="sendBeacon"&&o.data&&o.compression===Nt.GZipJS&&iD&&typeof Promise<"u"&&!Yc?FF(o).then(c=>{u(c)}).catch(c=>{if(w0(c))return Yc=!0,void u(L({},o,{compression:void 0,url:Y0(r.url,void 0)}));(d=>{if(!d||typeof d!="object")return!1;var h="name"in d?String(d.name):"";return w0(d)||h===XE})(c)&&(Yc=!0),u(o)}):u(o)})(L({},e,{callback:r=>{var n,s;this.rateLimiter.checkForLimiting(r),400>r.statusCode||(n=(s=this.config).on_request_error)==null||n.call(s,r),e.callback==null||e.callback(r)}}))):e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:0}))}
112cn(e){this.vn?this.vn.retriableRequest(e):this._send_request(e)}_execute_array(e){ep++;try{var r,n=[],s=[],i=[];yc(e,a=>{if(a)if(ce(r=a[0]))i.push(a);else if(Br(a))try{a.call(this)}catch(l){F.error("Error executing queued PostHog call",a,l)}else ce(a)&&r==="alias"?n.push(a):ce(a)&&r.indexOf("capture")!==-1&&Br(this[r])?i.push(a):s.push(a)});var o=function(a,l){yc(a,function(u){try{if(ce(u[0])){var c=l;Ee(u,function(d){c=c[d[0]].apply(c,d.slice(1))})}else l[u[0]].apply(l,u.slice(1))}catch(d){F.error("Error executing queued PostHog call",u,d)}})};o(n,this),o(s,this),o(i,this)}finally{ep--}}push(e){if(ep>0&&ce(e)&&ke(e[0])){var r=_r.prototype[e[0]];Br(r)&&r.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,r,n){var s,i,o,a,l;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.dn){if(this.is_capturing())if(!U(e)&&ke(e)){var u=!this.config.opt_out_useragent_filter&&this._is_bot();if(!u||this.config.__preview_capture_bot_pageviews){var c=n!=null&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(c==null||!c.isRateLimited){r!=null&&r.$current_url&&!ke(r==null?void 0:r.$current_url)&&(F.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),r==null||delete r.$current_url),e!=="$exception"||n!=null&&n.kn||F.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&&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();var d=new Date,h=(n==null?void 0:n.timestamp)||d,f=E0(n==null?void 0:n.uuid,Nn),g={uuid:f,event:e,properties:this.calculateEventProperties(e,r||{},h,f)};e===mo&&this.config.__preview_capture_bot_pageviews&&u&&(g.event="$bot_pageview",g.properties.$browser_type="bot"),c&&(g.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens),n!=null&&n.$set&&(g.$set=n==null?void 0:n.$set);var p=n==null?void 0:n.$unset;p&&(g.$unset=p);var b,v,y,_=this.Sn(n==null?void 0:n.$set_once,e!==A0,e===Wf);if(_&&(g.$set_once=_),n!=null&&n._noTruncate||(i=this.config.properties_string_max_length,o=g,a=R=>ke(R)?R.slice(0,i):R,l=new Set,g=function R(I,N){return I!==Object(I)?a?a(I):I:l.has(I)?void 0:(l.add(I),ce(I)?(B=[],yc(I,q=>{B.push(R(q))})):(B={},Ee(I,(q,ee)=>{l.has(q)||(B[ee]=R(q))})),B);var B}(o)),g.timestamp=h,U(n==null?void 0:n.timestamp)||(g.properties.$event_time_override_provided=!0,g.properties.$event_time_override_system_time=d),e===Mn.DISMISSED||e===Mn.SENT){var x=r==null?void 0:r[Jf.SURVEY_ID],k=r==null?void 0:r[Jf.SURVEY_ITERATION];TC({id:x,current_iteration:k}),g.$set=L({},g.$set,{[(b={id:x,current_iteration:k},v=e===Mn.SENT?"responded":"dismissed",y="$survey_"+v+"/"+b.id,b.current_iteration&&b.current_iteration>0&&(y="$survey_"+v+"/"+b.id+"/"+b.current_iteration),y)]:!0})}else e===Mn.SHOWN&&(g.$set=L({},g.$set,{[Jf.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===OF.SHOWN){var C=r==null?void 0:r[H0.TOUR_TYPE];C&&(g.$set=L({},g.$set,{[H0.TOUR_LAST_SEEN_DATE+"/"+C]:new Date().toISOString()}))}var T=L({},g.properties.$set,g.$set);if(Ts(T)||this.setPersonPropertiesForFlags(T),!le(this.config.before_send)){var S=this.Rt(g);if(!S)return;(g=S).uuid=E0(g.uuid,Nn)}this.tn.emit("eventCaptured",g);var P={method:"POST",url:(s=n==null?void 0:n._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:g,compression:"best-available",batchKey:n==null?void 0:n._batchKey,transport:n==null?void 0:n.transport};return!this.config.request_batching||n&&(n==null||!n._batchKey)||n!=null&&n.send_instantly?this.cn(P):this.dn.enqueue(P),g}F.critical("This capture call is ignored due to client rate limiting.")}}else F.error("No event name provided to posthog.capture")}else F.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",r=>e(r.event,r))}calculateEventProperties(e,r,n,s,i){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return r;var o=i?void 0:this.persistence.remove_event_timer(e),a=L({},r);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.Yi()&&(a.$cookieless_mode=!0),e==="$snapshot"){var l=L({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!ke(a.distinct_id)&&!gt(a.distinct_id)||Xg(a.distinct_id))&&F.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}
112var u,c=function(v,y,_,x){var k,C,T,S;if(x===void 0&&(x=!1),!Wt)return{};var P,R,I,N,B,q,ee,$,W,j=v?[...va,...y||[]]:[],A=function(Q){for(var Z=0;k0.length>Z;Z++){var oe=k0[Z],ve=oe[1],ie=oe[0].exec(Q),Le=ie&&(Br(ve)?ve(ie,Q):ve);if(Le)return Le}return["",""]}(Wt),M=(P=typeof navigator<"u"?navigator:void 0)!=null&&P.brave?{brave:!0}:{},G={detectGoogleSearchApp:_},V=Pe(yy({$os:A[0],$os_version:A[1],$browser:x1(Wt,navigator.vendor,M,G),$device:S0(Wt),$device_type:(I=Wt,N={userAgentDataPlatform:(k=navigator)==null||(k=k.userAgentData)==null?void 0:k.platform,maxTouchPoints:(C=navigator)==null?void 0:C.maxTouchPoints,screenWidth:O==null||(T=O.screen)==null?void 0:T.width,screenHeight:O==null||(S=O.screen)==null?void 0:S.height,devicePixelRatio:O==null?void 0:O.devicePixelRatio},W=S0(I),W===s1||W===n1||W==="Kobo"||W==="Kindle Fire"||W===v1?fa:W===gu||W===Wo||W===mu||W===em?"Console":W===o1?"Wearable":W?lr:(N==null?void 0:N.userAgentDataPlatform)==="Android"&&((B=N==null?void 0:N.maxTouchPoints)!==null&&B!==void 0?B:0)>0?600>Math.min((q=N==null?void 0:N.screenWidth)!==null&&q!==void 0?q:0,(ee=N==null?void 0:N.screenHeight)!==null&&ee!==void 0?ee:0)/(($=N==null?void 0:N.devicePixelRatio)!==null&&$!==void 0?$:1)?lr:fa:"Desktop"),$timezone:cC(),$timezone_offset:PF()}),{$current_url:wu(x?Hs(Xe==null?void 0:Xe.href):Xe==null?void 0:Xe.href,j,bu),$host:Xe==null?void 0:Xe.host,$pathname:Xe==null?void 0:Xe.pathname,$raw_user_agent:Wt.length>1e3?Wt.substring(0,997)+"...":Wt,$browser_version:SD(Wt,navigator.vendor,M,G),$browser_language:z0(),$browser_language_prefix:(R=z0(),typeof R=="string"?R.split("-")[0]:void 0),$screen_height:O==null?void 0:O.screen.height,$screen_width:O==null?void 0:O.screen.width,$viewport_height:O==null?void 0:O.innerHeight,$viewport_width:O==null?void 0:O.innerWidth,$lib:Fe.LIB_NAME,$lib_version:Fe.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Fe.SDK_DIST_CHANNEL&&(V.$sdk_dist_channel=Fe.SDK_DIST_CHANNEL),V}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var d=this.sessionManager.checkAndGetSessionAndWindowId(i,n.getTime()),h=d.windowId;a.$session_id=d.sessionId,a.$window_id=h}this.sessionPropsManager&&Pe(a,this.sessionPropsManager.getSessionProps());try{var f;this.sessionRecording&&Pe(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=(f=this.vn)==null?void 0:f.length}catch(v){a.$sdk_debug_error_capturing_properties=String(v)}if(this.requestRouter.region===Om&&(a.$lib_custom_api_host=this.config.api_host),u=e!==mo||i?e!==Hf||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,s),a=Pe(a,u),e===mo&&H&&(a.title=H.title),!U(o)){var g=n.getTime()-o;a.$duration=parseFloat((g/1e3).toFixed(3))}Wt&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=Pe({},c,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),ce(this.config.property_denylist)?Ee(this.config.property_denylist,function(v){delete a[v]}):F.error(PC+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(F.error(tb),a=p(a,e));var b=this.Cn();return a.$process_person_profile=b,b&&!i&&this.In("_calculate_event_properties"),a}Sn(e,r,n){var s;if(r===void 0&&(r=!0),n===void 0&&(n=!1),!this.persistence||!this.Cn()||this.Xi&&!n)return e;var i=this.persistence.get_initial_props(),o=(s=this.sessionPropsManager)==null?void 0:s.getSetOnceProps(),a=Pe({},i,o||{},e||{}),l=this.config.sanitize_properties;return l&&(F.error(tb),a=l(a,"$set_once")),r&&(this.Xi=!0),Ts(a)?void 0:a}register(e,r){var n;(n=this.persistence)==null||n.register(e,r)}register_once(e,r,n){var s;(s=this.persistence)==null||s.register_once(e,r,n)}register_for_session(e){var r;(r=this.sessionPersistence)==null||r.register(e)}unregister(e){var r;(r=this.persistence)==null||r.unregister(e)}unregister_for_session(e){var r;(r=this.sessionPersistence)==null||r.unregister(e)}Tn(e,r){this.register({[e]:r})}getFeatureFlag(e,r){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlag(e,r)}getFeatureFlagPayload(e){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagPayload(e)}getFeatureFlagResult(e,r){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagResult(e,r)}getAllFeatureFlags(){var e,r;return(e=(r=this.featureFlags)==null?void 0:r.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,r){var n;return(n=this.featureFlags)==null?void 0:n.isFeatureEnabled(e,r)}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,r,n){var s;(s=this.featureFlags)==null||s.updateFlags(e,r,n)}updateEarlyAccessFeatureEnrollment(e,r,n){var s;(s=this.featureFlags)==null||s.updateEarlyAccessFeatureEnrollment(e,r,n)}getEarlyAccessFeatures(e,r,n){var s;return r===void 0&&(r=!1),(s=this.featureFlags)==null?void 0:s.getEarlyAccessFeatures(e,r,n)}on(e,r){return this.tn.on(e,r)}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:rl}),()=>{})}onSessionId(e){var r,n;return(r=(n=this.sessionManager)==null?void 0:n.onSessionId(e))!==null&&r!==void 0?r:()=>{}}getSurveys(e,r){r===void 0&&(r=!1),this.surveys?this.surveys.getSurveys(e,r):e([],{isLoaded:!1,error:rl})}getActiveMatchingSurveys(e,r){r===void 0&&(r=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,r):e([],{isLoaded:!1,error:rl})}renderSurvey(e,r){var n;(n=this.surveys)==null||n.renderSurvey(e,r)}displaySurvey(e,r){var n;r===void 0&&(r=JF),(n=this.surveys)==null||n.displaySurvey(e,r)}cancelPendingSurvey(e){var r;(r=this.surveys)==null||r.cancelPendingSurvey(e)}canRenderSurvey(e){var r,n;return(r=(n=this.surveys)==null?void 0:n.canRenderSurvey(e))!==null&&r!==void 0?r:{visible:!1,disabledReason:rl}}canRenderSurveyAsync(e,r){var n,s;return r===void 0&&(r=!1),(n=(s=this.surveys)==null?void 0:s.canRenderSurveyAsync(e,r))!==null&&n!==void 0?n:Promise.resolve({visible:!1,disabledReason:rl})}Mn(e){return!e||Xg(e)?(F.critical("Unique user id has not been set in posthog.identify"),!1):e===vc?(F.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())||(F.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
112ot a hardcoded string.'),!1)}identify(e,r,n){if(!this.__loaded||!this.persistence)return F.uninitializedWarning("posthog.identify");if(gt(e)&&(e=e.toString(),F.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Mn(e)&&this.In("posthog.identify")){var s=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Kd)||this.register_once({$had_persisted_distinct_id:!0,$device_id:s},""),e!==s&&e!==this.get_property(pl)&&(this.unregister(pl),this.register({distinct_id:e}));var i,o=(this.persistence.get_property(Ir)||to)===to;e!==s&&o?(this.persistence.set_property(Ir,ro),this.setPersonPropertiesForFlags({$set:r||{},$set_once:n||{}},!1),this.capture(Wf,{distinct_id:e,$anon_distinct_id:s},{$set:r||{},$set_once:n||{}}),this.sn=X0(e,r,n),(i=this.featureFlags)==null||i.setAnonymousDistinctId(s)):(r||n)&&this.setPersonProperties(r,n),e!==s&&(this.reloadFeatureFlags(),this.unregister($l))}}setPersonProperties(e,r){if((e||r)&&this.In("posthog.setPersonProperties")){var n=X0(this.get_distinct_id(),e,r);this.sn!==n?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:r||{}},!0),this.capture("$set",{$set:e||{},$set_once:r||{}}),this.sn=n):F.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var r,n=(ce(e)?e:[e]).filter(s=>ke(s)&&s.length>0);n.length!==0&&this.In("posthog.unsetPersonProperties")&&((r=this.featureFlags)==null||r.unsetPersonPropertiesForFlags(n,!0),this.capture("$set",{$unset:n}),this.sn=null)}group(e,r,n){if(e&&r){var s=this.getGroups(),i=s[e]!==r;if(i&&this.resetGroupPropertiesForFlags(e),this.register({$groups:L({},s,{[e]:r})}),i||n){var o={$group_type:e,$group_key:r};n&&(o.$group_set=n),this.capture(A0,o)}n&&this.setGroupPropertiesForFlags({[e]:n}),i&&!n&&this.reloadFeatureFlags()}else F.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,r){var n;r===void 0&&(r=!0),(n=this.featureFlags)==null||n.setPersonPropertiesForFlags(e,r)}resetPersonPropertiesForFlags(e){var r;e===void 0&&(e=!0),(r=this.featureFlags)==null||r.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,r){var n;r===void 0&&(r=!0),this.In("posthog.setGroupPropertiesForFlags")&&((n=this.featureFlags)==null||n.setGroupPropertiesForFlags(e,r))}resetGroupPropertiesForFlags(e){var r;(r=this.featureFlags)==null||r.resetGroupPropertiesForFlags(e)}reset(e){var r,n,s,i,o,a,l,u,c,d;if(F.info("reset"),!this.__loaded)return F.uninitializedWarning("posthog.reset");var h,f=this.get_property(Kd),g=this.get_property(zf),p=this.get_property(m
112i);if(this.consent.reset(),(r=this.persistence)==null||r.clear(),(n=this.sessionPersistence)==null||n.clear(),U(p)||(h=this.persistence)==null||h.register({[mi]:p}),(s=this.surveys)==null||s.reset(),(i=this.wn)==null||i.stop(),(o=this.featureFlags)==null||o.reset(),(a=this.conversations)==null||a.reset(),(l=this.logs)==null||l.reset(),(u=this.metrics)==null||u.reset(),(c=this.persistence)==null||c.set_property(Ir,to),(d=this.sessionManager)==null||d.resetSessionId(),this.sn=null,this.config.cookieless_mode===Ln)this.register_once({distinct_id:vc,$device_id:null},"");else{var b=this.config.get_device_id(Nn());this.register_once({distinct_id:b,$device_id:e?b:f},""),e||U(g)||this.register({[zf]:g})}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var r=this;return Ye(function*(){var n,s,i,o,a;r.__loaded?((n=r.logs)==null||n.flushLogs("sendBeacon"),(s=r.metrics)==null||s.flush("sendBeacon"),(i=r.dn)==null||i.unload(),(o=r.vn)==null||o.unload(),(a=r.featureFlags)==null||a.destroy()):F.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,r){var n;this.config.identity_distinct_id=e,this.config.identity_hash=r,this.alias(e),(n=this.conversations)==null||n.En()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.Rn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,r;return(e=(r=this.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var r=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=r.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+r.sessionId);if(e!=null&&e.withTimestamp&&n){var i,o=(i=e.timestampLookBack)!==null&&i!==void 0?i:10;if(!n)return s;s+="?t="+Math.max(Math.floor((new Date().getTime()-n)/1e3)-o,0)}return s}alias(e,r){return e===this.get_property(A1)?(F.critical("Attempting to create alias for existing People user - aborting."),-2):this.In("posthog.alias")?(U(r)&&(r=this.get_distinct_id()),e!==r?(this.Tn(pl,e),this.capture("$create_alias",{alias:e,distinct_id:r}
112)):(F.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var r=L({},this.config);if(je(e)){var n,s,i,o,a,l,u,c,d,h,f;Pe(this.config,nb(e));var g=this.hn();(n=this.persistence)==null||n.update_config(this.config,r,g),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Gf(L({},this.config,{persistence:"sessionStorage"}),g,!1);var p=this.an(this.config.debug);vn(p)&&(this.config.debug=p),vn(this.config.debug)&&(this.config.debug?(Fe.DEBUG=!0,Se.N()&&Se.q("ph_debug",!0),F.info("set_config",{config:e,oldConfig:r,newConfig:L({},this.config)})):(Fe.DEBUG=!1,Se.N()&&Se.P("ph_debug"))),(s=this.exceptionObserver)==null||s.onConfigChange(),(i=this.exceptions)==null||i.onConfigChange(),(o=this.sessionRecording)==null||o.startIfEnabledOrStop(),(a=this.tracingHeaders)==null||a.startIfEnabledOrStop(),(l=this.autocapture)==null||l.startIfEnabled(),(u=this.heatmaps)==null||u.startIfEnabled(),(c=this.exceptionObserver)==null||c.startIfEnabledOrStop(),(d=this.deadClicksAutocapture)==null||d.startIfEnabledOrStop(),(h=this.surveys)==null||h.loadIfEnabled(),this.Pn(),(f=this.externalIntegrations)==null||f.startIfEnabledOrStop()}}_overrideSDKInfo(e,r){Fe.LIB_NAME=e,Fe.LIB_VERSION=r}startSessionRecording(e){var r,n,s,i,o,a=e===!0,l={sampling:a||!(e==null||!e.sampling),linked_flag:a||!(e==null||!e.linked_flag),url_trigger:a||!(e==null||!e.url_trigger),event_trigger:a||!(e==null||!e.event_trigger)};Object.values(l).some(Boolean)&&((r=this.sessionManager)==null||r.checkAndGetSessionAndWindowId(),l.sampling&&((n=this.sessionRecording)==null||n.overrideSampling()),l.linked_flag&&((s=this.sessionRecording)==null||s.overrideLinkedFlag()),l.url_trigger&&((i=this.sessionRecording)==null||i.overrideTrigger("url")),l.event_trigger&&((o=this.sessionRecording)==null||o.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.started)}captureException(e,r){if(this.exceptions){var n=new Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:n});return this.exceptions.sendExceptionEvent(L({},s,r))}}addExceptionStep(e,r){var n;(n=this.exceptions)==null||n.addExceptionStep(e,r)}captureLog(e){var r;(r=this.logs)==null||r.captureLog(e)}get logger(){var e,r;return(e=(r=this.logs)==null?void 0:r.logger)!==null&&e!==void 0?e:_r.On}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var r,n;return(r=(n=this.toolbar)==null?void 0:n.loadToolbar(e))!==null&&r!==void 0&&r}get_property(e){var r;return(r=this.persistence)==null?void 0:r.props[e]}getSessionProperty(e){var r;return(r=this.sessionPersistence)==null?void 0:r.props[e]}toString(){var e,r=(e=this.config.name)!==null&&e!==void 0?e:vo;return r!==vo&&(r=vo+"."+r),r}_isIdentified(){var e,r;return((e=this.persistence)==null?void 0:e.get_property(Ir))===ro||((r=this.sessionPersistence)==null?void 0:r.get_property(Ir))===ro}Cn(){var e,r;return!(this.config.person_profiles==="never"||this.config.person_profiles===bm&&!this._isIdentified()&&Ts(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[pl])&&((r=this.persistence)==null||(r=r.props)==null||!r[Jd]))}xn(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Cn()||this.In("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.In("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}In(e){return this.config.person_profiles==="never"?(F.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Tn(Jd,!0),!0)}hn(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==ui)}Pn(){var e,r,n,s,i=this.hn();return((e=this.persistence)==null?void 0:e._r)!==i&&((n=this.persistence)==null||n.set_disabled(i)),((r=this.sessionPersistence)==null?void 0:r._r)!==i&&((s=this.sessionPersistence)==null||s.set_disabled(i)),i}opt_in_capturing(e){var r;if(this.config.cookieless_mode!==Ln){if(this.Yi()){var n,s,i,o,a;this.reset(!0),(n=this.sessionManager)==null||n.destroy(),(s=this.pageViewM
112anager)==null||s.destroy(),this.sessionManager=new Q0(this),this.pageViewManager=new B0(this),this.persistence&&(this.sessionPropsManager=new J0(this,this.sessionManager,this.persistence));var l,u=(i=(o=this.config.__extensionClasses)==null?void 0:o.sessionRecording)!==null&&i!==void 0?i:(a=_r.__defaultExtensionClasses)==null?void 0:a.sessionRecording;u&&(this.sessionRecording=this.Ji(this.sessionRecording,new u(this)),this.yn&&((l=this.sessionRecording)==null||l.onRemoteConfig==null||l.onRemoteConfig(this.yn)))}var c,d;this.consent.optInOut(!0),this.Pn(),this.bn(),(r=this.sessionRecording)==null||r.startIfEnabledOrStop(),this.config.cookieless_mode==ui&&((c=this.surveys)==null||c.loadIfEnabled()),(U(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((d=e==null?void 0:e.captureEventName)!==null&&d!==void 0?d:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._n()}else F.warn(eb)}opt_out_capturing(){var e,r,n;this.config.cookieless_mode!==Ln?(this.config.cookieless_mode===ui&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Pn(),this.config.cookieless_mode===ui&&(this.register({distinct_id:vc,$device_id:null}),(e=this.sessionRecording)==null||e.stopRecording(),this.sessionRecording=void 0,(r=this.sessionManager)==null||r.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this._n(),this.bn())):F.warn(eb)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===1?"granted":e===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===Ln||(this.config.cookieless_mode===ui?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Pn()}_is_bot(){return $t?bC($t,this.config.custom_blocked_useragents):void 0}_n(){H&&(H.visibilityState==="visible"?this.en||(this.en=!0,this.capture(mo,{title:H.title},{send_instantly:!0}),this.rn&&(H.removeEventListener(Qd,this.rn),this.rn=null)):this.rn||(this.rn=this._n.bind(this),Ue(H,Qd,this.rn)))}debug(e){e===!1?(O==null||O.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(O==null||O.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}))}Vr(){var e,r,n,s,i,o,a=this.ln||{};return"advanced_disable_flags"in a?!!a.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(F.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):(n="advanced_disable_decide",s=F,i=(r="advanced_disable_flags")in(e=a)&&!le(e[r]),o=n in e&&!le(e[n]),i?e[r]:!!o&&(s&&s.warn("Config field '"+n+"' is deprecated. Please use '"+r+"' instead. The old field will be removed in a future major version."),e[n]))}Rt(e){var r;if(le(this.config.before_send))return e;var n=Object.keys((r=e.properties)!==null&&r!==void 0?r:{}).filter(hD),s=ce(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var o of s){if(i=o(i),le(i)){var a="Event '"+e.event+"' was rejected in beforeSend function";return dD(e.event)?F.warn(a+". This can cause unexpected behavior."):F.info(a),null}i.properties&&!Ts(i.properties)||F.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var l of n)if(i.properties&&le(i.properties[l]))return F.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 i}getPageViewId(){var e;return(e=this.pageViewManager.sr)==null?void 0:e.pageViewId}captureTraceFeedback(e,r){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:r})}captureTraceMetric(e,r,n){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:r,$ai_metric_value:String(n)})}an(e){var r=vn(e)&&!e,n=Se.N()&&Se.A("ph_debug")==="true";return!r&&(!!n||e)}}_r.__defaultExtensionClasses={},_r.On=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),function(t,e){for(var r=0;e.length>r;r++)t.prototype[e[r]]=eF(t.prototype[e[r]])}(_r,["identify"]);class sb{constructor(e){this.disabled=e===!1;var r=je(e)?e:{};this.thresholdPx=r.threshold_px||30,this.timeoutMs=r.timeout_ms||1e3,this.clickCount=r.click_count||3,this.clicks=[]}isRageClick(e,r,n){if(this.disabled)return!1;var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(r-s.y)<this.thresholdPx&&this.timeoutMs>n-s.timestamp){if(this.clicks.push({x:e,y:r,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:r,timestamp:n}];return!1}}var tp="$copy_autocapture",rp=$e("[AutoCapture]");function np(t,e){return e.length>t?e.slice(0,t)+"...":e}function rU(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Ws(e));return e}function nU(t,e){var r,n,s=e.e,i=e.maskAllElementAttributes,o=e.maskAllText,a=e.elementAttributeIgnoreList,l=e.elementsC
112hainAsString,u=e.disableCaptureUrlHashes;if(!Ws(t))return{props:{}};for(var c=[t],d=new Set([t]),h=t;h.parentNode&&!ir(h,"body")&&q1>c.length;)if(W1(h.parentNode)){var f=h.parentNode.host;if(d.has(f))break;d.add(f),c.push(f),h=f}else{if(!Ws(h.parentNode)||d.has(h.parentNode))break;d.add(h.parentNode),c.push(h.parentNode),h=h.parentNode}var g,p,b=[],v={},y=!1,_=!1;if(Ee(c,S=>{var P=km(S);if(ir(S,"a")){var R=S.getAttribute("href");y=!!(P&&R&&Ll(R))&&(u?Hs(R):R)}se(eh(S),"ph-no-capture")&&(_=!0),b.push(function(N,B,q,ee,$){$===void 0&&($=!1);var W=N.tagName.toLowerCase(),j={tag_name:W};wy.indexOf(W)>-1&&!q&&(j.$el_text=W.toLowerCase()==="a"||W.toLowerCase()==="button"?np(1024,D0(N)):np(1024,yu(N)));var A=eh(N);A.length>0&&(j.classes=A.filter(function(Q){return Q!==""})),Ee(N.attributes,function(Q){var Z;if((!J1(N)||["name","id","class","aria-label"].indexOf(Q.name)!==-1)&&(ee==null||!ee.includes(Q.name))&&!B&&Ll(Q.value)&&(!ke(Z=Q.name)||Z.substring(0,10)!=="_ngcontent"&&Z.substring(0,7)!=="_nghost")){var oe=Q.value;Q.name==="class"&&(oe=_y(oe).join(" ")),j["attr__"+Q.name]=np(1024,Q.name==="href"&&$?Hs(oe):oe)}});for(var M=1,G=1,V=N;V=rU(V);)M++,V.tagName===N.tagName&&G++;return j.nth_child=M,j.nth_of_type=G,j}(S,i,o,a,u));var I=function(N){if(!km(N))return{};var B={};return Ee(N.attributes,function(q){if(q.name&&q.name.indexOf("data-ph-capture-attribute")===0){var ee=q.name.replace("data-ph-capture-attribute-",""),$=q.value;ee&&$&&Ll($)&&(B[ee]=$)}}),B}(S);Pe(v,I)}),_)return{props:{},explicitNoCapture:_};if(o||(b[0].$el_text=ir(t,"a")||ir(t,"button")?D0(t):yu(t)),y){var x,k;b[0].attr__href=y;var C=(x=_u(y))==null?void 0:x.host,T=O==null||(k=O.location)==null?void 0:k.host;C&&T&&C!==T&&(g=y)}return{props:Pe({$event_type:s.type,$ce_version:1},l?{}:{$elements:b},{$elements_chain:(p=b,function(S){return S.map(P=>{var R,I,N="";if(P.tag_name&&(N+=P.tag_name),P.attr_class)for(var B of(P.attr_class.sort(),P.attr_class))N+="."+B.replace(/"/g,"");var q=L({},P.text?{text:P.text}:{},{"nth-child":(R=P.nth_child)!==null&&R!==void 0?R:0,"nth-of-type":(I=P.nth_of_type)!==null&&I!==void 0?I:0},P.href?{href:P.href}:{},P.attr_id?{attr_id:P.attr_id}:{},P.attributes),ee={};return Gc(q).sort(($,W)=>$[0].localeCompare(W[0])).forEach($=>{var W=$[1];return ee[F0($[0].toString())]=F0(W.toString())}),(N+=":")+Gc(ee).map($=>$[0]+'="'+$[1]+'"').join("")}).join(";")}(function(S){return S.map(P=>{var R,I,N={text:(R=P.$el_text)==null?void 0:R.slice(0,400),tag_name:P.tag_name,href:(I=P.attr__href)==null?void 0:I.slice(0,2048),attr_class:wF(P),attr_id:P.attr__id,nth_child:P.nth_child,nth_of_type:P.nth_of_type,attributes:{}};return Gc(P).filter(B=>B[0].indexOf("attr__")===0).forEach(B=>N.attributes[B[0]]=B[1]),N})}(p)))},(r=b[0])!=null&&r.$el_text?{$el_text:(n=b[0])==null?void 0:n.$el_text}:{},g&&s.type==="click"?{$external_click_url:g}:{},v)}}var nl=$e("[ExceptionAutocapture]"),ib=()=>{},sU=$e("[TracingHeaders]"),ti=$e("[Web Vitals]"),ob=9e5,ab="disabled",lb="lazy_loading",sl="awaiting_config",Sc="missing_config";$e("[SessionRecording]"),$e("[SessionRecording]");var jm="[SessionRecording]",kn=$e(jm),iU=$e("[Heatmaps]");function sp(t){return je(t)&&"clientX"in t&&"clientY"in t&&gt(t.clientX)&&gt(t.clientY)}var ip=$e("[Product Tours]"),op=t=>{var e;return!t.config.disable_product_tours&&!((e=t.persistence)==null||!e.get_property(gy))},oU=["$set_once","$set"],tn=$e("[SiteApps]"),ub="Error while initializing PostHog app with config id ";function io(t,e,r){if(le(t))return!1;switch(r){case"exact":return t===e;case"contains":var n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(n,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}class aU{constructor(e){this.Fn=new Ey,this.Ln=(r,n)=>this.An(r,n)&&this.$n(r,n)&&this.Nn(r,n)&&this.Dn(r,n),this.An=(r,n)=>n==null||!n.event||(r==null?void 0:r.event)===(n==null?void 0:n.event),this._instance=e,this.qn=new Set,this.jn=new Set}init(){var e,r;U((e=this._instance)==null?void 0:e._addCaptureHook)||(r=this._instance)==null||r._addCaptureHook((n,s)=>{this.on(n,s)})}register(e){var r,n;if(!U((r=this._instance)==null?void 0:r._addCaptureHook)&&(e.forEach(o=>{var a,l;(a=this.jn)==null||a.add(o),(l=o.steps)==null||l.forEach(u=>{var c;(c=this.qn)==null||c.add((u==null?void 0:u.event)||"")})}),(n=this._instance)!=null&&n.autocapture)){var s,i=new Set;e.forEach(o=>{var a;(a=o.steps)==null||a.forEach(l=>{l!=null&&l.selector&&i.add(l==null?void 0:l.selector)})}),(s=this._instance)==null||s.autocapture.setElementSelectors(i)}}on(e,r){var n;r!=null&&e.length!=0&&(this.qn.has(e)||this.qn.has(r==null?void 0:r.event))&&this.jn&&((n=this.jn)==null?void 0:n.size)>0&&this.jn.forEach(s=>
vendor: 3,381 bytes, line 112
112{this.Hn(r,s)&&this.Fn.emit("actionCaptured",s.name)})}Bn(e){this.onAction("actionCaptured",r=>e(r))}Hn(e,r){if((r==null?void 0:r.steps)==null)return!1;for(var n of r.steps)if(this.Ln(e,n))return!0;return!1}onAction(e,r){return this.Fn.on(e,r)}$n(e,r){if(r!=null&&r.url){var n,s=e==null||(n=e.properties)==null?void 0:n.$current_url;if(!s||typeof s!="string"||!io(s,r.url,r.url_matching||"contains"))return!1}return!0}Nn(e,r){return!!this.Un(e,r)&&!!this.zn(e,r)&&!!this.Vn(e,r)}Un(e,r){var n;if(r==null||!r.href)return!0;var s=this.Wn(e);if(s.length>0)return s.some(a=>io(a.href,r.href,r.href_matching||"exact"));var i,o=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||"";return!!o&&io((i=o.match(/(?::|")href="(.*?)"/))?i[1]:"",r.href,r.href_matching||"exact")}zn(e,r){var n;if(r==null||!r.text)return!0;var s=this.Wn(e);if(s.length>0)return s.some(u=>io(u.text,r.text,r.text_matching||"exact")||io(u.$el_text,r.text,r.text_matching||"exact"));var i,o,a,l=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||"";return!!l&&(i=function(u){for(var c,d=[],h=/(?::|")text="(.*?)"/g;!le(c=h.exec(u));)d.includes(c[1])||d.push(c[1]);return d}(l),o=r.text,a=r.text_matching||"exact",i.some(u=>io(u,o,a)))}Vn(e,r){var n,s;if(r==null||!r.selector)return!0;var i=e==null||(n=e.properties)==null?void 0:n.$element_selectors;if(i!=null&&i.includes(r.selector))return!0;var o=(e==null||(s=e.properties)==null?void 0:s.$elements_chain)||"";if(r.selector_regex&&o)try{return new RegExp(r.selector_regex).test(o)}catch{return!1}return!1}Wn(e){var r;return(e==null||(r=e.properties)==null?void 0:r.$elements)==null?[]:e==null?void 0:e.properties.$elements}Dn(e,r){return r==null||!r.properties||r.properties.length===0||SC(r.properties.reduce((n,s)=>{var i=ce(s.value)?s.value.map(String):s.value!=null?[String(s.value)]:[];return n[s.key]={values:i,operator:s.operator||"exact"},n},{}),e==null?void 0:e.properties)}}class lU{constructor(e){this.Zn=[],this._instance=e,this.Gn=new Map,this.Qn=new Map,this.Jn=new Map}Kn(e,r){return!!e&&SC(e.propertyFilters,r==null?void 0:r.properties)}Yn(e,r){var n=new Map;return e.forEach(s=>{var i;(i=s.conditions)==null||(i=i[r])==null||(i=i.values)==null||i.forEach(o=>{if(o!=null&&o.name){var a=n.get(o.name)||[];a.push(s.id),n.set(o.name,a)}})}),n}Xn(e,r,n){var s=(n===Qa.Activation?this.Gn:this.Qn).get(e),i=[];return this.ts(o=>{i=o.filter(a=>s==null?void 0:s.includes(a.id))}),i.filter(o=>{var a,l=(a=o.conditions)==null||(a=a[n])==null||(a=a.values)==null?void 0:a.find(u=>u.name===e);return this.Kn(l,r)})}register(e){var r;U((r=this._instance)==null?void 0:r._addCaptureHook)||(this.es(e),this.rs(e))}rs(e){var r=e.filter(n=>{var s,i;return((s=n.conditions)==null?void 0:s.actions)&&((i=n.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0});r.length!==0&&(this.ns==null&&(this.ns=new aU(this._instance),this.ns.init(),this.ns.Bn(n=>{this.onAction(n)})),r.forEach(n=>{var s,i,o,a,l;n.conditions&&(s=n.conditions)!=null&&s.actions&&(i=n.conditions)!=null&&(i=i.actions)!=null&&i.values&&((o=n.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0&&((a=this.ns)==null||a.register(n.conditions.actions.values),(l=n.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach(u=>{if(u&&u.name){var c=this.Jn.get(u.name);c&&c.push(n.id),this.Jn.set(u.name,c||[n.id])}}))}))}
112es(e){var r,n=e.filter(i=>{var o,a;return((o=i.conditions)==null?void 0:o.events)&&((a=i.conditions)==null||(a=a.events)==null||(a=a.values)==null?void 0:a.length)>0}),s=e.filter(i=>{var o,a;return((o=i.conditions)==null?void 0:o.cancelEvents)&&((a=i.conditions)==null||(a=a.cancelEvents)==null||(a=a.values)==null?void 0:a.length)>0});n.length===0&&s.length===0||((r=this._instance)==null||r._addCaptureHook((i,o)=>{this.onEvent(i,o)}),this.Gn=this.Yn(e,Qa.Activation),this.Qn=this.Yn(e,Qa.Cancellation))}onEvent(e,r){var n,s,i=this.ss(),o=(r==null||(n=r.properties)==null?void 0:n.$survey_id)||(r==null||(s=r.properties)==null?void 0:s.$product_tour_id);if(o&&this.getActivatedIds().includes(o)){var a=this.os(e,o);if(a==="consume")return i.info("event consumed activated item, removing it",{event:e,itemId:o}),void this.ls([o]);if(a==="persist")return i.info("shown item promoted to persisted activation",{event:e,itemId:o}),void this.us(o)}if(this.Qn.has(e)){var l=this.Xn(e,r,Qa.Cancellation);l.length>0&&(i.info("cancel event matched, cancelling items",{event:e,itemsToCancel:l.map(c=>c.id)}),this.ls(l.map(c=>c.id)),l.forEach(c=>this.hs(c.id)))}if(this.Gn.has(e)){i.info("event name matched",{event:e,eventPayload:r,items:this.Gn.get(e)});var u=this.Xn(e,r,Qa.Activation);this.ds(u.map(c=>c.id))}}onAction(e){this.Jn.has(e)&&this.ds(this.Jn.get(e)||[])}ds(e){e.length!==0&&(this.Zn=[...new Set([...this.Zn,...e])],this.ss().info("updating activated items",{activatedItems:this.getActivatedIds()}))}us(e){this.Zn=this.Zn.filter(n=>n!==e);var r=this.cs();r.includes(e)||this.vs([...r,e])}ls(e){var r=new Set(e);this.Zn=this.Zn.filter(i=>!r.has(i));var n=this.cs(),s=n.filter(i=>!r.has(i));s.length!==n.length&&this.vs(s)}cs(){var e,r=this.fs();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[r])||[]}getActivatedIds(){return[...new Set([...this.cs(),...this.Zn])].filter(e=>!this.ps(e))}reset(){this.Zn=[],this.cs().length>0&&this.vs([])}getEventToItemsMap(){return this.Gn}gs(){return this.ns}}class uU extends lU{constructor(e){super(e)}fs(){return pm}ys(){return Mn.SHOWN}ts(e){var r;(r=this._instance)==null||r.getSurveys(e)}hs(e){var r;(r=this._instance)==null||r.cancelPendingSurvey(e)}ss(){return xe}vs(e){var r;(r=this._instance)==null||(r=r.persistence)==null||r.register({[pm]:e})}ps(){return!1}os(e,r){var n;this.ts(i=>{n=i.find(o=>o.id===r)});var s=!n||function(i){var o;return EC(i)&&!((o=i.conditions)==null||(o=o.events)==null||!o.repeatedActivation)||i.schedule==="always"}(n);return s?e===Mn.SHOWN?"consume":"ignore":e===Mn.SHOWN?"persist":e===Mn.DISMISSED||e===Mn.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var ap="SDK is not enabled or survey functionality is not yet loaded",cb="Disabled. Not loading surveys.",cU=O!=null&&O.location?th(O.location.hash,"__posthog")||th(location.hash,"state"):null,db="_postHogToolbarParams",hb=$e("[Toolbar]"),tt=$e("[FeatureFlags]"),ri=$e("[FeatureFlags]",{debugEnabled:!0}),lp=`" failed. Feature flags didn't load in time.`,fb=t=>{for(var e={},r=0;t.length>r;r++)e[t[r]]=!0;return e},pb=t=>{var e={};for(var r of Gc(t||{})){var n=r[1];n&&(e[r[0]]=n)}return e},Sn=$e("[Error tracking]"),gb="Refusing to render web experiment since the viewer is a likely bot",dU={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>sh(e,t),not_regex:(t,e)=>!sh(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class bt{get Te(){return this._instance.config}constructor(e){var r=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(n){n===void 0&&(n=!1),r.getWebExperiments(s=>{bt.bs("retrieved web experiments from the server"),r._s=new Map,s.forEac
112h(i=>{if(i.feature_flag_key){var o;r._s&&(bt.bs("setting flag key ",i.feature_flag_key," to web experiment ",i),(o=r._s)==null||o.set(i.feature_flag_key,i));var a=r._instance.getFeatureFlag(i.feature_flag_key);ke(a)&&i.variants[a]&&r.ws(i.name,a,i.variants[a].transforms)}else if(i.variants)for(var l in i.variants){var u=i.variants[l];bt.xs(u,r._instance)&&r.ws(i.name,l,u.transforms)}})},n)},this._instance=e,this._instance.onFeatureFlags(n=>{this.onFeatureFlags(n)})}initialize(){}onFeatureFlags(e){if(this._is_bot())bt.bs(gb);else if(!this.Te.disable_web_experiments){if(le(this._s))return this._s=new Map,this.loadIfEnabled(),void this.previewWebExperiment();bt.bs("applying feature flags",e),e.forEach(r=>{var n;if(this._s&&(n=this._s)!=null&&n.has(r)){var s,i=this._instance.getFeatureFlag(r),o=(s=this._s)==null?void 0:s.get(r);i&&o!=null&&o.variants[i]&&this.ws(o.name,i,o.variants[i].transforms)}})}}previewWebExperiment(){var e=bt.getWindowLocation();if(e!=null&&e.search){var r=ma(e==null?void 0:e.search,"__experiment_id"),n=ma(e==null?void 0:e.search,"__experiment_variant");r&&n&&(bt.bs("previewing web experiments "+r+" && "+n),this.getWebExperiments(s=>{this.ks(parseInt(r),n,s)},!1,!0))}}loadIfEnabled(){this.Te.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,r,n){if(this.Te.disable_web_experiments&&!n)return e([]);var s=this._instance.get_property("$web_experiments");if(s&&!r)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Te.token),method:"GET",callback:i=>e(i.statusCode===200&&i.json&&i.json.experiments||[])})}ks(e,r,n){var s=n.filter(i=>i.id===e);s&&s.length>0&&(bt.bs("Previewing web experiment ["+s[0].name+"] with variant ["+r+"]"),this.ws(s[0].name,r,s[0].variants[r].transforms))}static xs(e,r){return!le(e.conditions)&&bt.Ss(e,r)&&bt.Cs(e)}static Ss(e,r){var n;if(le(e.conditions)||le((n=e.conditions)==null?void 0:n.url))return!0;var s=bt.getWindowLocation();if(s){var i,o,a,l=z1(r,s.href);return(i=e.conditions)==null||!i.url||dU[(o=(a=e.conditions)==null?void 0:a.urlMatchType)!==null&&o!==void 0?o:"icontains"](e.conditions.url,l)}return!1}
112static getWindowLocation(){return O==null?void 0:O.location}static Cs(e){var r;if(le(e.conditions)||le((r=e.conditions)==null?void 0:r.utm))return!0;var n=sC();if(n.utm_source){var s,i,o,a,l,u,c,d,h=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_campaign||((i=e.conditions)==null||(i=i.utm)==null?void 0:i.utm_campaign)==n.utm_campaign,f=(o=e.conditions)==null||(o=o.utm)==null||!o.utm_source||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==n.utm_source,g=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==n.utm_medium,p=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==n.utm_term;return h&&g&&p&&f}return!1}static bs(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;r>s;s++)n[s-1]=arguments[s];F.info("[WebExperiments] "+e,n)}ws(e,r,n){this._is_bot()?bt.bs(gb):r!=="control"?n.forEach(s=>{if(s.selector){var i;bt.bs("applying transform of variant "+r+" for experiment "+e+" ",s);var o=(i=document)==null?void 0:i.querySelectorAll(s.selector);o==null||o.forEach(a=>{var l=a;s.html&&(l.innerHTML=s.html),s.css&&l.setAttribute("style",s.css)})}}):bt.bs("Control variants leave the page unmodified.")}_is_bot(){return $t&&this._instance?bC($t,this.Te.custom_blocked_useragents):void 0}}var pr=$e("[Conversations]"),ni="Conversations not available yet.",mb="console",Wh={featureFlags:class{constructor(t){this.Is=!1,this.Ts=!1,this.Ms=!1,this.Es=!1,this.Rs=!1,this.Ps=!1,this.Os=!1,this.Fs=!1,this.Ls=0,this.As=()=>{var e=this.$s();this.Ls=0,e&&this.reloadFeatureFlags()},this._instance=t,this.featureFlagEventHandlers=[],O&&Ue(O,"online",this.As)}destroy(){O==null||O.removeEventListener("online",this.As)}get Te(){return this._instance.config}get mi(){return this._instance.persistence}Ns(t){return this._instance.get_property(t)}Ds(){var t,e;return(t=(e=this.mi)==null?void 0:e.kr(this.Te.feature_flag_cache_ttl_ms))!==null&&t!==void 0&&t}qs(){return!!this.Ds()&&(this.Fs||this.Ms||(this.Fs=!0,tt.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}js(){var t,e=(t=this.Te.evaluation_contexts)!==null&&t!==void 0?t:this.Te.evaluation_environments;return!this.Te.evaluation_environments||this.Te.evaluation_contexts||this.Os||(tt.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Os=!0),e!=null&&e.length?e.filter(r=>{var n=r&&typeof r=="string"&&r.trim().length>0;return n||tt.error("Invalid evaluation context found:",r,"Expected non-empty string"),n}):[]}Hs(){return this.js().length>0}Bs(){var t=this.Te.flag_keys;if(!U(t)){if(ce(t))return t.filter(e=>{var r=e&&typeof e=="string"&&e.trim().length>0;return r||tt.error("Invalid flag key found:",e,"Expected non-empty string"),r});tt.error("Invalid flag_keys found:",t,"Expected array of non-empty strings")}}initialize(){var t,e,r=this._instance.config,n=(t=(e=r.bootstrap)==null?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(n).length){var s,i,o=(s=(i=r.bootstrap)==null?void 0:i.featureFlagPayloads)!==null&&s!==void 0?s:{},a=Object.keys(n).filter(u=>!!n[u]).reduce((u,c)=>(u[c]=n[c]||!1,u),{}),l=Object.keys(o).filter(u=>a[u]).reduce((u,c)=>(o[c]&&(u[c]=o[c]),u),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:l})}}updateFlags(t,e,r){var n,s,i=r!=null&&r.merge&&(n=this.Ns(di))!==null&&n!==void 0?n:{},o=r!=null&&r.merge&&(s=this.Ns(Kc))!==null&&s!==void 0?s:{},a=L({},i,t),l=L({},o,e),u={};for(var c of Object.entries(a)){var d=c[0],h=c[1];u[d]={key:d,enabled:m0(h),variant:v0(h),reason:void 0,metadata:U(l==null?void 0:l[d])?void 0:{id:0,version:void 0,description:void 0,payload:l[d]}}}this.receivedFeatureFlags({flags:u})}get hasLoadedFlags(){return this.Ts}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Ns(dm),e=this.Ns(Tn),r=this.Ns(go);if(!r&&!e)return t||{};var n=Pe({},t||{}),s=[...new Set([...Object.keys(r||{}),...Object.keys(e||{})])];for(var i of s){var o,a,l=n[i],u=e==null?void 0:e[i],c=U(u)?(o=l==null?void 0:l.enabled)!==null&&o!==void 0&&o:!!u,d=U(u)?l.variant:typeof u=="string"?u:void 0,h=r==null?void 0:r[i],f=L({},l,{enabled:c,variant:c?d??(l==null?void 0:l.variant):void 0});c!==(l==null?void 0:l.enabled)&&(f.original_enabled=l==null?void 0:l.enabled),d!==(l==null?void 0:l.variant)&&(f.original_variant=l==null?void 0:l.variant),h&&(f.metadata=L({},l==null?void 0:l.metadata,{payload:h,original_payload:l==null||(a=l.metadata)==null?void 0:a.payload})),n[i]=f}return this.Is||(tt.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:r,finalDetails:n}),this.Is=!0),n}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map(r=>{var n=t[r];return{key:r,enabled:m0(n),variant:v0(n),payload:g0(e[r])}})}getFlagVariants(){var t=this.Ns(di),e=this.Ns(Tn);if(!e)return t||{};for(var r=Pe({},t),n=Object.keys(e),s=0;n.length>s;s++)r[n[s]]=e[n[s]];return this.Is||(tt.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.Is=!0),r}getFlagPayloads(){var t=this.Ns(Kc),e=this.Ns(go);if(!e)return t||{};for(var r=Pe({},t||{}),n=Object.keys(e),s=0;n.length>s;s++)r[n[s]]=e[n[s]];return this.Is||(tt.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:r}),this.Is=!0),r}reloadFeatureFlags(){this.Es||this.Te.advanced_disable_feature_flags||this.$s()||this.Us||(this._instance.tn.emit("featureFlagsReloading",!0),this.Us=setTimeout(()=>{this.zs()},5))}Vs(){clearTimeout(this.Us),this.Us=void 0}ensureFlagsLoaded(){this.Ts||this.Ms||this.Us||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Es=t}zs(t){var e;if(this.Vs(),!this._instance.Vr()&&!this.$s())if(this.Ms)this.Rs=!0;else{var r=this.Te.token,n=this.Ns(Kd),s={token:r,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:L({},((e=this.mi)==null?void 0:e.get_initial_props())||{},this.Ns(ai)||{}),group_properties:this.Ns(li),timezone:cC()};Mt(n)||U(n)||(s.$device_id=n),(t!=null&&t.disableFlags||this.Te.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.Hs()&&(s.evaluation_contexts=this.js());var i=this.Bs();U(i)||(s.flag_keys=i);var o=!!this.Te.advanced_only_evaluate_survey_feature_flags,a=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Te.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Ms=!0,this._instance._send_request({method:"POST",url:a,data:s,compression:this.Te.disable_compression?void 0:Nt.Base64,timeout:this.Te.feature_flag_request_timeout_ms,callback:l=>{var u,c,d,h=!0;if(this.Ws(l.statusCode),l.statusCode===200&&(this.Rs||(this.$anon_distinct_id=void 0),h=!1),this.Ms=!1,!s.disable_flags||this.Rs){this.Ps=!h;var f=[];l.error?l.error instanceof Error?f.push(l.error.name==="AbortError"?"timeout":"connection_error"):f.push("unknown_error"):l.statusCode!==200&&f.push("api_error_"+l.statusCode),(u=l.json)!=null&&u.errorsWhileComputingFlags&&f.push("errors_while_computing_flags");var g,p=!((c=l.json)==null||(c=c.quotaLimited)==null||!c.includes("feature_flags"));p&&f.push("quota_limited"),(d=this.mi)==null||d.register({[mm]:f}),p?tt.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."):(s.disable_flags||this.receivedFeatureFlags((g=l.json)!==null&&g!==void 0?g:{},h,{partialResponse:o}),this.Rs&&(this.Rs=!1,this.zs()))}}})}}$s(){return rC(this.Ls,3)}Ws(t){this.Ls=nC(t,this.Ls,3,()=>tt.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 r;if(e===void 0&&(e={}),!e.fresh||this.Ps)if(this.Ts||this.getFlags()&&this.getFlags().length>0){if(!this.qs()){var n=this.getFeatureFlagResult(t,e);return(r=n==null?void 0:n.variant)!==null&&r!==void 0?r:n==null?void 0:n.enabled}}else tt.warn('getFeatureFlag for key "'+t+lp)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return e==null?void 0:e.payload}getFeatureFlagResult(t,e){if(e===void 0&&(e={}),!e.fresh||this.Ps)if(this.Ts||this.getFlags()&&this.getFlags().length>0){if(!this.qs()){var r=this.getFlagVariants(),n=t in r,s=r[t],i=this.getFlagPayloads()[t],o=String(s),a=this.Ns(hm)||void 0,l=this.Ns(vu)||void 0,u=this.Ns($l)||{};if(this.Te.advanced_feature_flags_dedup_per_session){var c,d=this._instance.get_session_id(),h=this.Ns(gm);d&&d!==h&&(u={},(c=this.mi)==null||c.register({[$l]:u,[gm]:d}))}if((e.send_event||!("send_event"in e))&&(!(t in u)||!u[t].includes(o))){var f,g,p,b,v,y,_,x,k,C,T;ce(u[t])?u[t].push(o):u[t]=[o],(f=this.mi)==null||f.register({[$l]:u});var S=this.getFeatureFlagDetails(t),P=[...(g=this.Ns(mm))!==null&&g!==void 0?g:[]];
112U(s)&&P.push("flag_missing");var R={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:i||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:((p=this.Te.bootstrap)==null||(p=p.featureFlags)==null?void 0:p[t])||null,$feature_flag_bootstrapped_payload:((b=this.Te.bootstrap)==null||(b=b.featureFlagPayloads)==null?void 0:b[t])||null,$used_bootstrap_value:!this.Ps};U(S==null||(v=S.metadata)==null?void 0:v.has_experiment)||(R.$feature_flag_has_experiment=S.metadata.has_experiment),U(S==null||(y=S.metadata)==null?void 0:y.version)||(R.$feature_flag_version=S.metadata.version);var I,N=(_=S==null||(x=S.reason)==null?void 0:x.description)!==null&&_!==void 0?_:S==null||(k=S.reason)==null?void 0:k.code;N&&(R.$feature_flag_reason=N),S!=null&&(C=S.metadata)!=null&&C.id&&(R.$feature_flag_id=S.metadata.id),U(S==null?void 0:S.original_variant)&&U(S==null?void 0:S.original_enabled)||(R.$feature_flag_original_response=U(S.original_variant)?S.original_enabled:S.original_variant),S!=null&&(T=S.metadata)!=null&&T.original_payload&&(R.$feature_flag_original_payload=S==null||(I=S.metadata)==null?void 0:I.original_payload),P.length&&(R.$feature_flag_error=P.join(",")),this._instance.capture("$feature_flag_called",R)}if(n)return{key:t,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:g0(i)}}}else tt.warn('getFeatureFlagResult for key "'+t+lp)}getRemoteConfigPayload(t,e){var r=this.Te.token,n={distinct_id:this._instance.get_distinct_id(),token:r};this.Hs()&&(n.evaluation_contexts=this.js());var s=this.Bs();U(s)||(n.flag_keys=s),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:n,compression:this.Te.disable_compression?void 0:Nt.Base64,timeout:this.Te.feature_flag_request_timeout_ms,callback(i){var o,a=(o=i.json)==null?void 0:o.featureFlagPayloads;e((a==null?void 0:a[t])||void 0)}})}isFeatureEnabled(t,e){if(e===void 0&&(e={}),!e.fresh||this.Ps){if(this.Ts||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(t,e);return U(r)?void 0:!!r}tt.warn('isFeatureEnabled for key "'+t+lp)}}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(e=>e!==t)}receivedFeatureFlags(t,e,r){if(this.mi){this.Ts=!0;var n=this.getFlagVariants(),s=this.getFlagPayloads(),i=this.getFlagsWithDetails();(function(o,a,l,u,c,d){l===void 0&&(l={}),u===void 0&&(u={}),c===void 0&&(c={});var h=(S=>{var P=S.flags;return P?(S.featureFlags=Object.fromEntries(Object.keys(P).map(R=>{var I;return[R,(I=P[R].variant)!==null&&I!==void 0?I:P[R].enabled]})),S.featureFlagPayloads=Object.fromEntries(Object.keys(P).filter(R=>P[R].enabled).filter(R=>{var I;return(I=P[R].metadata)==null?void 0:I.payload}).map(R=>{var I;return[R,(I=P[R].metadata)==null?void 0:I.payload]}))):S.featureFlags&&tt.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),S})(o),f=h.flags,g=h.featureFlags,p=h.featureFlagPayloads;if(g){var b=o.requestId,v=o.evaluatedAt;if(ce(g)){tt.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var y={};if(g)for(var _=0;g.length>_;_++)y[g[_]]=!0;a&&a.register({[Vc]:g,[di]:y})}else{var x=g,k=p,C=f;if(d!=null&&d.partialResponse)x=L({},l,x),k=L({},u,k),C=L({},c,C);else if(o.errorsWhileComputingFlags)if(f){var T=new Set(Object.keys(f).filter(S=>{var P;return!((P=f[S])!=null&&P.failed)}));x=L({},l,Object.fromEntries(Object.entries(x).filter(S=>T.has(S[0])))),k=L({},u,Object.fromEntries(Object.entries(k||{}).filter(S=>T.has(S[0])))),C=L({},c,Object.fromEntries(Object.entries(C||{}).filter(S=>T.has(S[0]))))}else x=L({},l,x),k=L({},u,k),C=L({},c,C);a&&a.register(L({[Vc]:Object.keys(pb(x)),[di]:x||{},[Kc]:k||{},[dm]:C||{}},b?{[hm]:b}:{},v?{[vu]:v}:{}))}}})(t,this.mi,n,s,i,r),e||(this.Fs=!1),this.Zs(e)}}override(t,e){e===void 0&&(e=!1),tt.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.mi)return tt.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this.mi.unregister(Tn),this.mi.unregister(go),this.Zs(),ri.info("All overrides cleared");if(ce(t)){var e=fb(t);return this.mi.register({[Tn]:e}),this.Zs(),ri.info("Flag overrides set",{flags:t})}if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var r,n=t;if(this.Is=!!((r=n.suppressWarning)!==null&&r!==void 0&&r),"flags"in n){if(n.flags===!1)this.mi.unregister(Tn),ri.info("Flag overrides cleared");else if(n.flags){if(ce(n.flags)){var s=fb(n.flags);this.mi.register({[Tn]:s})}else this.mi.register({[Tn]:n.flags});ri.info("Flag overrides set",{flags:n.flags})}}return"payloads"in n&&(n.payloads===!1?(this.mi.unregister(go),ri.info("Payload overrides cleared")):n.payloads&&(this.mi.register({[go]:n.payloads}),ri.info("Payload overrides set",{payloads:n.payloads}))),void this.Zs()}if(t&&typeof t=="object")return this.mi.register({[Tn]:t}),this.Zs(),ri.info("Flag overrides set",{flags:t});tt.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Ts){var e=this.Gs(),r=e.flags,n=e.flagVariants;try{t(r,n)}catch(s){tt.error("Error while running feature flags callback",s)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,r){var n,s=(this.Ns(ml)||[]).find(l=>l.flagKey===t),i={["$feature_enrollment/"+t]:e},o={$feature_flag:t,$feature_enrollment:e,$set:i};s&&(o.$early_access_feature_name=s.name),r&&(o.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(i,!1);var a=L({},this.getFlagVariants(),{[t]:e});(n=this.mi)==null||n.register({[Vc]:Object.keys(pb(a)),[di]:a}),this.Zs()}getEarlyAccessFeatures(t,e,r){e===void 0&&(e=!1);var n=this.Ns(ml),s=r?"&"+r.map(i=>"stage="+i).join("&"):"";if(n&&!e)return t(n);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Te.token+s),method:"GET",callback:i=>{var o,a;if(i.json){var l=i.json.earlyAccessFeatures;return(o=this.mi)==null||o.unregister(ml),(a=this.mi)==null||a.register({[ml]:l}),t(l)}}})}Gs(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter(r=>e[r]),flagVariants:Object.keys(e).filter(r=>e[r]).reduce((r,n)=>(r[n]=e[n],r),{})}}Zs(t){var e=this.Gs(),r=e.flags,n=e.flagVariants;
112this.featureFlagEventHandlers.forEach(s=>{try{s(r,n,{errorsLoading:t})}catch(i){tt.error("Error while running feature flags callback",i)}})}setPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var r=this.Ns(ai)||{},n=(t==null?void 0:t.$set)||(t!=null&&t.$set_once?{}:t),s=t==null?void 0:t.$set_once,i={};if(s)for(var o in s)({}).hasOwnProperty.call(s,o)&&(o in r||(i[o]=s[o]));this._instance.register({[ai]:L({},r,i,n)}),e&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var r=L({},this.Ns(ai)||{});t.forEach(n=>{delete r[n]}),this._instance.register({[ai]:r}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){t===void 0&&(t=!0),this._instance.unregister(ai),t&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){e===void 0&&(e=!0);var r=this.Ns(li)||{};Object.keys(r).length!==0&&Object.keys(r).forEach(n=>{r[n]=L({},r[n],t[n]),delete t[n]}),this._instance.register({[li]:L({},r,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Ns(li)||{};this._instance.register({[li]:L({},e,{[t]:{}})})}else this._instance.unregister(li)}reset(){this.Ts=!1,this.Ms=!1,this.Es=!1,this.Rs=!1,this.Ps=!1,this.$anon_distinct_id=void 0,this.Vs(),this.Is=!1,this.Ls=0}}},hU={sessionRecording:class{get Te(){return this._instance.config}get mi(){return this._instance.persistence}get started(){var t;return!((t=this.Qs)==null||!t.isStarted)}get status(){var t,e;return this.Js===sl||this.Js===Sc?this.Js:(t=(e=this.Qs)==null?void 0:e.status)!==null&&t!==void 0?t:this.Js}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.Js=ab,this.Ks=void 0,this._instance=t,!this._instance.sessionManager)throw kn.error("started without valid sessionManager"),new Error(jm+" started without valid sessionManager. This is a bug.");if(this.Te.cookieless_mode===Ln)throw new Error(jm+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}
112get Ys(){var t,e=!((t=this._instance.get_property(mi))==null||!t.enabled),r=!this.Te.disable_session_recording,n=this.Te.disable_session_recording||this._instance.consent.isOptedOut();return O&&e&&r&&!n}startIfEnabledOrStop(t){var e;if(!this.Ys||(e=this.Qs)==null||!e.isStarted){var r=!U(Object.assign)&&!U(Array.from);this.Ys&&r?(this.Xs(t),kn.info("starting")):(this.Js=ab,this.stopRecording())}}Xs(t){var e,r,n;this.Ys&&(this.Js!==sl&&this.Js!==Sc&&(this.Js=lb),X!=null&&(e=X.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(r=X.__PosthogExtensions__)!=null&&r.initSessionRecording?this.eo(t):(n=X.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.ro,s=>{if(s)return kn.error("could not load recorder",s);this.eo(t)}))}stopRecording(){var t,e;(t=this.Ks)==null||t.call(this),this.Ks=void 0,(e=this.Qs)==null||e.stop()}io(){var t,e;(t=this.Ks)==null||t.call(this),this.Ks=void 0,(e=this.Qs)==null||e.discard()}no(){var t,e;(t=this.mi)==null||t.unregister(my),(e=this.mi)==null||e.unregister(O1)}so(t,e){if(le(t))return null;var r,n=gt(t)?t:parseFloat(t);return typeof(r=n)!="number"||!Number.isFinite(r)||0>r||r>1?(kn.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):n}oo(t){if(this.mi){var e,r,n=this.mi,s=()=>{var i,o=t.sessionRecording===!1?void 0:t.sessionRecording,a=this.so((i=this.Te.session_recording)==null?void 0:i.sampleRate,"session_recording.sampleRate"),l=this.so(o==null?void 0:o.sampleRate,"remote config sampleRate"),u=a??l;le(u)&&this.no();var c=o==null?void 0:o.minimumDurationMilliseconds;n.register({[mi]:L({cache_timestamp:Date.now(),enabled:!!o},o,{networkPayloadCapture:L({capturePerformance:t.capturePerformance},o==null?void 0:o.networkPayloadCapture),canvasRecording:{enabled:o==null?void 0:o.recordCanvas,fps:o==null?void 0:o.canvasFps,quality:o==null?void 0:o.canvasQuality},sampleRate:u,minimumDurationMilliseconds:U(c)?null:c,endpoint:o==null?void 0:o.endpoint,triggerMatchType:o==null?void 0:o.triggerMatchType,masking:o==null?void 0:o.masking,urlTriggers:o==null?void 0:o.urlTriggers,version:o==null?void 0:o.version,triggerGroups:o==null?void 0:o.triggerGroups})})};s(),(e=this.Ks)==null||e.call(this),this.Ks=(r=this._instance.sessionManager)==null?void 0:r.onSessionId(s)}}onRemoteConfig(t){return"sessionRecording"in t?t.sessionRecording===!1?(this.oo(t),void this.io()):(this.oo(t),void this.startIfEnabledOrStop()):(this.Js===sl&&(this.Js=Sc,kn.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var r;e===void 0&&(e="log"),(r=this.Qs)!=null&&r.log?this.Qs.log(t,e):kn.warn("log called before recorder was ready")}get ro(){var t,e,r=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.get_property(m
112i);return(r==null||(e=r.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}ao(){var t,e,r=this._instance.get_property(mi);if(!r)return!1;try{e=typeof r=="object"?r:JSON.parse(r)}catch(s){return kn.warn("persisted remote config for session recording is invalid and will be ignored",s),!1}var n=(t=e.cache_timestamp)!==null&&t!==void 0?t:Date.now();return 36e5>=Date.now()-n}eo(t){var e,r;if((e=X.__PosthogExtensions__)==null||!e.initSessionRecording)return kn.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[F1]:!0});if(this.Qs||(this.Qs=(r=X.__PosthogExtensions__)==null?void 0:r.initSessionRecording(this._instance),this.Qs._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.ao())return this.Js===Sc||this.Js===sl?void 0:(this.Js=sl,kn.info("persisted remote config is stale, requesting fresh config before starting"),void new dC(this._instance).load());this.Js=lb,this.Qs.start(t)}onRRwebEmit(t){var e;(e=this.Qs)==null||e.onRRwebEmit==null||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.Qs||(e=this.mi)==null||e.register({[N1]:!0}),(t=this.Qs)==null||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Qs||(e=this.mi)==null||e.register({[j1]:!0}),(t=this.Qs)==null||t.overrideSampling()}overrideTrigger(t){var e,r;this.Qs||(r=this.mi)==null||r.register({[t==="url"?I1:$1]:!0}),(e=this.Qs)==null||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.Qs)==null?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!((r=this.Qs)==null||!r.tryAddCustomEvent(t,e))}}},fU={autocapture:class{constructor(t){this.lo=!1,this.uo=null,this.ho=!1,this.instance=t,this.rageclicks=new sb(t.config.rageclick),this.do=null}initialize(){this.startIfEnabled()}get Te(){var t,e,r=je(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=(t=r.url_allowlist)==null?void 0:t.map(n=>new RegExp(n)),r.url_ignorelist=(e=r.url_ignorelist)==null?void 0:e.map(n=>new RegExp(n)),r}co(){if(this.isBrowserSupported()){if(O&&H){var t=r=>{r=r||(O==null?void 0:O.event);try{this.vo(r)}catch(n){rp.error("Failed to capture event",n)}};if(Ue(H,"submit",t,{capture:!0}),Ue(H,"change",t,{capture:!0}),Ue(H,"click",t,{capture:!0}),this.Te.capture_copied_text){var e=r=>{r=r||(O==null?void 0:O.event);try{this.vo(r,tp)}catch(n){rp.error("Failed to capture copy/cut event",n)}};Ue(H,"copy",e,{capture:!0}),Ue(H,"cut",e,{capture:!0})}}}else rp.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.lo&&(this.co(),this.lo=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.ho=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[sm]:!!t.autocapture_opt_out}),this.uo=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.do=t}getElementSelectors(t){var e,r=[];return(e=this.do)==null||e.forEach(n=>{var s=H==null?void 0:H.querySelectorAll(n);s==null||s.forEach(i=>{t===i&&r.push(n)})}),r}get isEnabled(){var t,e,r=(t=this.instance.persistence)==null?void 0:t.props[sm];if(Mt(this.uo)&&!vn(r)&&!this.instance.Vr())return!1;var n=(e=this.uo)!==null&&e!==void 0?e:!!r;return!!this.instance.config.autocapture&&!n}vo(t,e){if(e===void 0&&(e="$autocapture"),this.isEnabled){var r,n=Vf(t);H1(n)&&(n=n.parentNode||null),e==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!=null&&r.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime())&&M0(n,this.instance.config.rageclick)&&this.vo(t,"$rageclick");var s=e===tp;if(n&&function(d,h,f,g,p,b){var v,y,_,x,k,C;if(f===void 0&&(f=void 0),!O||by(d)||(v=f)!=null&&v.url_allowlist&&!I0(f.url_allowlist,b)||(y=f)!=null&&y.url_ignorelist&&I0(f.url_ignorelist,b))return!1;if((_=f)!=null&&_.dom_event_allowlist){var T=f.dom_event_allowlist;if(T&&!T.some(B=>h.type===B))return!1}var S=Y1(d,g),P=S.parentIsUsefulElement,R=S.targetElementList;if(!function(B,q){var ee=q==null?void 0:q.element_allowlist;if(U(ee))return!0;var $,W=function(A){if(ee.some(M=>A.tagName.toLowerCase()===M))return{v:!0}};for(var j of B)if($=W(j))return $.v;return!1}(R,f)||!xm(R,(x=f)==null?void 0:x.css_selector_allowlist)||xm(R,(k=(C=f)==null?void 0:C.css_selector_ignorelist)!==null&&k!==void 0?k:fF))return!1;try{var I=O.getComputedStyle(d);if(I&&I.getPropertyValue("cursor")==="pointer"&&h.type==="click")return!0}catch{}var N=d.tagName.toLowerCase();switch(N){case"html":return!1;case"form":return(p||["submit"]).indexOf(h.type)>=0;case"input":case"select":case"textarea":return(p||["change","click"]).indexOf(h.type)>=0;default:return P?(p||["click"]).indexOf(h.type)>=0:(p||["click"]).indexOf(h.type)>=0&&(wy.indexOf(N)>-1||d.getAttribute("contenteditable")==="true")}}(n,t,this.Te,s,s?["copy","cut"]:void 0,this.instance)){var i=nU(n,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Te.element_attribute_ignorelist,elementsC
112hainAsString:this.ho,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),o=i.props;if(i.explicitNoCapture)return!1;var a=this.getElementSelectors(n);if(a&&a.length>0&&(o.$element_selectors=a),e===tp){var l,u=V1(O==null||(l=O.getSelection())==null?void 0:l.toString()),c=t.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=c}return this.instance.capture(e,o),!0}}}isBrowserSupported(){return Br(H==null?void 0:H.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.fo=(O==null||(e=O.location)==null?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(F.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.po&&this.po(),this.po=void 0,F.info("History API monitoring stopped")}monitorHistoryChanges(){O&&O.history&&(this.mo("pushState"),this.mo("replaceState"),this.yo())}mo(t){var e;if(O&&((e=O.history[t])==null||!e.__posthog_wrapped__)){var r=this;(function(n,s,i){try{if(!(s in n))return ib;var o={next:n[s]},a=i(function(){for(var l=arguments.length,u=new Array(l),c=0;l>c;c++)u[c]=arguments[c];return o.next.apply(this,u)});return Br(a)&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:o}})),n[s]=a,()=>{if(n[s]!==a)for(var l=n[s];Br(l)&&l.__posthog_layer__;){var u=l.__posthog_layer__;if(u.next===a)return void(u.next=o.next);l=u.next}else n[s]=o.next}}catch{return ib}})(O.history,t,n=>function(s,i,o){n.call(this,s,i,o),r.bo(t)})}}bo(t){try{var e,r=O==null||(e=O.location)==null?void 0:e.pathname;if(!r)return;r!==this.fo&&this.isEnabled&&this._instance.capture(mo,{navigation_type:t}),this.fo=r}catch(n){F.error("Error capturing "+t+" pageview",n)}}yo(){if(!this.po){var t=()=>{this.bo("popstate")};Ue(O,"popstate",t),this.po=()=>{O&&O.removeEventListener("popstate",t)}}}},heatmaps:class{get Te(){return this.instance.config}constructor(t){var e;this._o=!1,this.lo=!1,this.wo=null,this.instance=t,this._o=!((e=this.instance.persistence)==null||!e.props[im]),this.rageclicks=new sb(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return je(this.Te.capture_heatmaps)&&this.Te.capture_heatmaps.flush_interval_milliseconds&&(t=this.Te.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return le(this.Te.capture_heatmaps)?le(this.Te.enable_heatmaps)?this._o:this.Te.enable_heatmaps:this.Te.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.lo)return;iU.info("starting..."),this.xo(),this.ke()}else{var t;clearInterval((t=this.wo)!==null&&t!==void 0?t:void 0),this.ko(),this.getAndClearBuffer()}}onRemoteConfig(t){if("heatmaps"in t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[im]:e}),this._o=e,this.startIfEnabled()}}getAndClearBuffer(){var t=this.R;return this.R=void 0,t}So(t){sp(t.originalEvent)&&this.pe(t.originalEvent,"deadclick")}ke(){this.wo&&clearInterval(this.wo),this.wo=(H==null?void 0:H.visibilityState)==="visible"?setInterval(this.oi.bind(this),this.flushIntervalMilliseconds):null}xo(){O&&H&&(this.Co=this.oi.bind(this),Ue(O,Xd,this.Co),this.Io=t=>this.pe(t||(O==null?void 0:O.event)),Ue(H,"click",this.Io,{capture:!0}),this.To=t=>this.Mo(t||(O==null?void 0:O.event)),Ue(H,"mousemove",this.To,{capture:!0}),this.Eo=new U0(this.instance,bF,this.So.bind(this)),this.Eo.startIfEnabledOrStop(),this.Ro=this.ke.bind(this),Ue(H,Qd,this.Ro),this.lo=!0)}ko(){var t;O&&H&&(this.Co&&O.removeEventListener(Xd,this.Co),this.Io&&H.removeEventListener("click",this.Io,{capture:!0}),this.To&&H.removeEventListener("mousemove",this.To,{capture:!0}),this.Ro&&H.removeEventListener(Qd,this.Ro),clearTimeout(this.Po),(t=this.Eo)==null||t.stop(),this.lo=!1)}Oo(t,e){var r=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),i=function(o,a,l){for(var u=o;u&&Ws(u)&&!ir(u,"body");){if(u===l)return!1;var c=void 0;try{var d,h,f;c=(d=(h=(f=u.ownerDocument)==null?void 0:f.defaultView)!==null&&h!==void 0?h:O)==null?void 0:d.getComputedStyle(u).position}catch{return!1}if(se(a,c))return!0;u=K1(u)}return!1}(Vf(t),["fixed","sticky"],s);return{x:t.clientX+(i?0:n),y:t.clientY+(i?0:r),target_fixed:i,type:e}}pe(t,e){var r;if(e===void 0&&(e="click"),!N0(t.target)&&sp(t)){var n=this.Oo(t,e);(r=this.rageclicks)!=null&&r.isRageClick(t.clientX,t.clientY,new Date().getTime())&&M0(Vf(t),this.instance.config.rageclick)&&this.Wt(L({},n,{type:"rageclick"})),this.Wt(n)}}Mo(t){!N0(t.target)&&sp(t)&&(clearTimeout(this.Po),this.Po=setTimeout(()=>{this.Wt(this.Oo(t,"mousemove"))},500))}Wt(t){if(O){var e=this.Te.disable_capture_url_hashes?Hs(O.location.href):O.location.href,r=this.Te.custom_personal_data_properties,n=this.Te.mask_personal_data_properties?[...va,...r||[]]:[],s=wu(e,n,bu);this.R=this.R||{},this.R[s]||(this.R[s]=[]),this.R[s].push(t)}}oi(){this.R&&!Ts(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:U0,webVitalsAutocapture:class{constructor(t){var e;this._o=!1,this.lo=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Fo=()=>{clearTimeout(this.Lo),this.R.metrics.length!==0&&(this._instance.capture("$web_vitals",this.R.metrics.reduce((r,n)=>L({},r,{["$web_vitals_"+n.name+"_event"]:L({},n),["$web_vitals_"+n.name+"_value"]:n.value}),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Ao=r=>{var n;this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.$o();if(!U(s))if(le(r==null?void 0:r.name)||le(r==null?void 0:r.value))ti.error("Invalid metric received",r);else if(!this.No||this.No>r.value){this.R.url!==s&&(this.Fo(),this.Lo=setTimeout(this.Fo,this.flushToCaptureTimeoutMs)),U(this.R.url)&&(this.R.url=s),this.R.firstMetricTimestamp=U(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0);var i=(n=this._instance.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0),o=L({},r,{$current_url:s,timestamp:Date.now()});U(i)||(o.$session_id=i.sessionId,o.$window_id=i.windowId),this.R.metrics.push(o),this.R.metrics.length===this.allowedMetrics.length&&this.Fo()}else ti.error("Ignoring metric with value >= "+this.No,r)},this.Do=()=>
112{if(!this.lo){var r,n,s,i,o=X.__PosthogExtensions__;if(!U(o)&&!U(o.postHogWebVitalsCallbacks)){var a=o.postHogWebVitalsCallbacks;r=a.onLCP,n=a.onCLS,s=a.onFCP,i=a.onINP}r&&n&&s&&i?(this.allowedMetrics.indexOf("LCP")>-1&&r(this.Ao.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&n(this.Ao.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this.Ao.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.Ao.bind(this)),this.lo=!0):ti.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this._o=!((e=this._instance.persistence)==null||!e.props[um]),this.startIfEnabled()}get qo(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,r=je(this.qo)?(t=this.qo)==null?void 0:t.web_vitals_allowed_metrics:void 0;return le(r)?((e=this._instance.persistence)==null?void 0:e.props[cm])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(je(this.qo)?this.qo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=je(this.qo)?this.qo.web_vitals_attribution:void 0;return t!=null&&t}get No(){var t=je(this.qo)&&gt(this.qo.__web_vitals_max_value)?this.qo.__web_vitals_max_value:ob;return t>0&&6e4>=t?ob:t}get isEnabled(){var t=Xe==null?void 0:Xe.protocol;if(t!=="http:"&&t!=="https:")return ti.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=je(this.qo)?this.qo.web_vitals:vn(this.qo)?this.qo:void 0;return vn(e)?e:this._o}startIfEnabled(){this.isEnabled&&!this.lo&&(ti.info("enabled, starting..."),this.rr(this.Do))}onRemoteConfig(t){if("capturePerformance"in t){var e=je(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=je(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[um]:e}),this._instance.persistence.register({[cm]:r})),this._o=e,this.startIfEnabled()}}rr(t){var e,r;(e=X.__PosthogExtensions__)!=null&&e.postHogWebVitalsCallbacks?t():(r=X.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",n=>{n?ti.error("failed to load script",n):t()})}$o(){var t=O?this._instance.config.disable_capture_url_hashes?Hs(O.location.href):O.location.href:void 0;if(t){var e=this._instance.config.custom_personal_data_properties,r=this._instance.config.mask_personal_data_properties?[...va,...e||[]]:[];return wu(t,r,bu)}ti.error("Could not determine current URL")}}},pU={exceptionObserver:class{constructor(t){var e,r,n,s,i,o;this.Do=()=>{var a;if(O&&this.isEnabled&&(a=X.__PosthogExtensions__)!=null&&a.errorWrappingFunctions){var l=X.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,u=X.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,c=X.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.jo&&this.Te.capture_unhandled_errors&&(this.jo=l(this.captureException.bind(this))),!this.Ho&&this.Te.capture_unhandled_rejections&&(this.Ho=u(this.captureException.bind(this))),!this.Bo&&this.Te.capture_console_errors&&(this.Bo=c(this.captureException.bind(this)))}catch(d){nl.error("failed to start",d),this.Uo()}}},this._instance=t,this.zo=!((e=this._instance.persistence)==null||!e.props[om]),this.Vo=new gD(L({},((r=this._instance.config.error_tracking)===void 0&&(r={}),{refillRate:(n=(s=r.exceptionRateLimiterRefillRate)!==null&&s!==void 0?s:r.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(i=(o=r.exceptionRateLimiterBucketSize)!==null&&o!==void 0?o:r.__exceptionRateLimiterBucketSize)!==null&&i!==void 0?i:10}),{refillInterval:1e4,it:nl})),this.Te=this.Wo(),this.startIfEnabledOrStop()}Wo(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return je(t)?e=L({},e,t):(U(t)?this.zo:t)&&(e=L({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Te.capture_console_errors||this.Te.capture_unhandled_errors||this.Te.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(nl.info("enabled"),this.Uo(),this.rr(this.Do)):this.Uo()}rr(t){var e,r;(e=X.__PosthogExtensions__)!=null&&e.errorWrappingFunctions?t():(r=X.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"exception-autocapture",n=>{if(n)return nl.error("failed to load script",n);t()})}Uo(){var t,e,r;(t=this.jo)==null||t.call(this),this.jo=void 0,(e=this.Ho)==null||e.call(this),this.Ho=void 0,(r=this.Bo)==null||r.call(this),this.Bo=void 0}onRemoteConfig(t){"autocaptureExceptions"in t&&(this.zo=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[om]:this.zo}),this.Te=this.Wo(),this.startIfEnabledOrStop())}onConfigChange(){this.Te=this.Wo()}captureException(t){var e,r,n,s=(e=t==null||(r=t.$exception_list)==null||(r=r[0])==null?void 0:r.type)!==null&&e!==void 0?e:"Exception";this.Vo.consumeRateLimit(s)?nl.info("Skipping exception capture because of client rate limiting.",{exception:s}):(n=this._instance.exceptions)==null||n.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,r;this.Zo=[],this.Go=new jD([new UD,new YD,new zD,new BD,new KD,new VD,new WD,new GD],function(n){for(var s=arguments.length,i=new Array(s>1?s-1:0),o=1;s>o;o++)i[o-1]=arguments[o];return function(a,l){l===void 0&&(l=0);for(var u=[],c=a.split(`
113`),d=l;c.length>d;d++){var h=c[d];if(1024>=h.length){var f=R0.test(h)?h.replace(R0,"$1"):h;if(!f.match(/\S*Error: /)){for(var g of i){var p=g(f,n);if(p){u.push(p);break}}if(u.length>=50)break}}}return function(b){if(!b.length)return[];var v=Array.from(b);return v.reverse(),v.slice(0,50).map(y=>{return L({},y,{filename:y.filename||(_=v,_[_.length-1]||{}).filename,function:y.function||ga});var _})}(u)}}("web:javascript",LD,FD)),this._instance=t,this.Zo=(e=(r=this._instance.persistence)==null?void 0:r.get_property(am))!==null&&e!==void 0?e:[],this.Qo=Vd(this.Jo()),this.Ko=new QD(this.Qo)}onConfigChange(){this.Qo=Vd(this.Jo()),this.Ko.setConfig(this.Qo)}onRemoteConfig(t){var e,r,n;if("errorTracking"in t){var s=(e=(r=t.errorTracking)==null?void 0:r.suppressionRules)!==null&&e!==void 0?e:[],i=(n=t.errorTracking)==null?void 0:n.captureExtensionExceptions;this.Zo=s,this._instance.persistence&&this._instance.persistence.register({[am]:this.Zo,[lm]:i})}}get Yo(){var t,e=!!this._instance.get_property(lm),r=this._instance.config.error_tracking.captureExtensionExceptions;return(t=r??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.Go.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.Qo.enabled)try{if(!ke(t)||t.trim().length===0)return void Sn.warn("Ignoring exception step because message must be a non-empty string");var r=function(i){if(!i)return{sanitizedProperties:{},droppedKeys:[]};var o=[];return{sanitizedProperties:Object.keys(i).reduce((a,l)=>JD.has(l)?(o.push(l),a):(a[l]=i[l],a),{}),droppedKeys:o}}(this.Xo(e)),n=r.sanitizedProperties,s=r.droppedKeys;s.length>0&&Sn.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.Ko.add(L({[Wd]:t,[qd]:new Date().toISOString()},n))}catch(i){Sn.error("Failed to add exception step. Ignoring breadcrumb.",i)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.ta(e)){if(this.ea(e))return this.ra("Exception dropped: matched a suppression rule"),void Sn.info("Skipping exception capture because a suppression rule matched");if(!this.Yo&&this.ia(e))return this.ra("Exception dropped: thrown by a browser extension"),void Sn.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.na(e))return this.ra("Exception dropped: thrown by the PostHog SDK"),void Sn.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this.Qo.enabled&&le(t.$exception_steps)?this.sa(t):t;try{var n=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",kn:!0});return n&&this.Ko.clear(),n}catch(s){return Sn.error("Failed to capture exception event. Dropping this exception.",s),void this.Ko.clear()}}catch(s){return void Sn.error("Failed to process exception event. Ignoring this exception.",s)}}sa(t){try{var e=this.Ko.getAttachable();return e.length===0?t:L({},t,{$exception_steps:e})}catch(r){return Sn.error("Failed to read buffered exception steps. Capturing exception without steps.",r),t}}ra(t){this.Qo.enabled&&this.Ko.add({[Wd]:t,[qd]:new Date().toISOString()})}Xo(t){return je(t)?L({},t):{}}Jo(){var t,e;return(t=(e=this._instance.config.error_tracking)==null?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}ea(t){if(t.length===0)return!1;var e=t.reduce((r,n)=>{var s=n.type,i=n.value;return ke(s)&&s.length>0&&r.$exception_types.push(s),ke(i)&&i.length>0&&r.$exception_values.push(i),r},{$exception_types:[],$exception_values:[]});return this.Zo.some(r=>{var n=r.values.map(s=>{var i,o=kC[s.operator],a=ce(s.value)?s.value:[s.value],l=(i=e[s.key])!==null&&i!==void 0?i:[];return a.length>0&&o(a,l)});return r.type==="OR"?n.some(Boolean):n.every(Boolean)})}ia(t){return t.flatMap(e=>{var r,n;return(r=(n=e.stacktrace)==null?void 0:n.frames)!==null&&r!==void 0?r:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}na(t){if(t.length>0){var e,r,n,s,i=(e=(r=t[0].stacktrace)==null?void 0:r.frames)!==null&&e!==void 0?e:[],o=i[i.length-1];return(n=o==null||(s=o.filename)==null?void 0:s.includes("posthog.com/static"))!==null&&n!==void 0&&n}return!1}
113ta(t){return!le(t)&&ce(t)}}},gU=L({productTours:class{get mi(){return this._instance.persistence}constructor(t){this.oa=null,this.aa=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if("productTours"in t){var e,r;if(this.mi&&this.mi.register({[gy]:!!t.productTours}),!op(this._instance))return!this.oa&&le((e=this.mi)==null?void 0:e.props[vl])||ip.info("product tours disabled; stopping and clearing cached tours"),(r=this.oa)==null||r.stop(),this.oa=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.oa&&op(this._instance)&&this.rr(()=>this.la())}rr(t){var e,r;(e=X.__PosthogExtensions__)!=null&&e.generateProductTours?t():(r=X.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"product-tours",n=>{n?ip.error("Could not load product tours script",n):t()})}la(){var t;!this.oa&&(t=X.__PosthogExtensions__)!=null&&t.generateProductTours&&(this.oa=X.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(e===void 0&&(e=!1),!ce(this.aa)||e){var r=this.mi;if(r){var n=r.props[vl];if(ce(n)&&!e)return this.aa=n,void t(n,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:s=>{if(op(this._instance)){var i=s.statusCode;if(i!==200||!s.json){var o="Product Tours API could not be loaded, status: "+i;return ip.error(o),void t([],{isLoaded:!1,error:o})}var a=ce(s.json.product_tours)?s.json.product_tours:[];this.aa=a,r&&r.register({[vl]:a}),t(a,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.aa,{isLoaded:!0})}getActiveProductTours(t){le(this.oa)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.oa.getActiveProductTours(t)}showProductTour(t){var e;(e=this.oa)==null||e.showTourById(t)}previewTour(t){this.oa?this.oa.previewTour(t):this.rr(()=>{var e;this.la(),(e=this.oa)==null||e.previewTour(t)})}dismissProductTour(){var t;(t=this.oa)==null||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.oa)==null||t.nextStep()}previousStep(){var t;(t=this.oa)==null||t.previousStep()}clearCache(){var t;this.aa=null,(t=this.mi)==null||t.unregister(vl)}resetTour(t){var e;(e=this.oa)==null||e.resetTour(t)}resetAllTours(){var t;(t=this.oa)==null||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.oa)==null||e.cancelPendingTour(t)}}},Wh),mU={siteApps:class{constructor(t){this.ua=0,this._instance=t,this.ha=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}da(t,e){if(e){var r=this.globalsForEvent(e);this.ha.push(r),this.ha.length>1e3&&(this.ha=this.ha.slice(10))}}get siteAppLoaders(){var t;return(t=X._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.da.bind(this));this.ca=()=>{t(),this.ha=[],this.ca=void 0}}}globalsForEvent(t){var e,r,n,s,i,o,a;if(!t)throw new Error("Event payload is required");var l={},u=this._instance.get_property("$groups")||[],c=this._instance.get_property("$stored_group_properties")||{};for(var d of Object.entries(c)){var h=d[0];l[h]={id:u[h],type:h,properties:d[1]}}var f=t.$set_once,g=t.$set;return{event:L({},QE(t,oU),{properties:L({},t.properties,g?{$set:L({},(e=(r=t.properties)==null?void 0:r.$set)!==null&&e!==void 0?e:{},g)}:{},f?{$set_once:L({},(n=(s=t.properties)==null?void 0:s.$set_once)!==null&&n!==void 0?n:{},f)}:{}),elements_chain:(i=(o=t.properties)==null?void 0:o.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(a=t.properties)==null?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}va(t){var e,r=(e=t.tagName)==null?void 0:e.toLowerCase();return r==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(tn.error("prepare_external_dependency_stylesheet returned null"),null):r==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||(tn.error("prepare_external_dependency_script returned null"),null):t}fa(){var t,e,r,n,s,i,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var l=H==null?void 0:H.defaultView,u=l==null||(t=l.Node)==null?void 0:t.prototype;if(!l||!u)return()=>{};if(this.ua++,this.pa)return this.ga();var c=[],d=this,h=new WeakSet,f=(b,v,y)=>{if(b!=null&&b[v]){var _=b[v];b[v]=y(_),c.push(()=>{b[v]=_})}},g=b=>{if(h.has(b))return b;var v=d.va(b);return v&&h.add(v),v},p=b=>b.map(v=>typeof v=="string"?v:g(v)).filter(v=>!Mt(v));return f(u,"appendChild",b=>function(v){var y=g(v);return y?b.call(this,y):v}),f(u,"insertBefore",b=>function(v,y){var _=g(v);return _?b.call(this,_,y):v}),f(u,"replaceChild",b=>function(v,y){var _=g(v);return _?b.call(this,_,y):y}),[(e=l.Element)==null?void 0:e.prototype,(r=l.Document)==null?void 0:r.prototype,(n=l.DocumentFragment)==null?void 0:n.prototype].forEach(b=>{f(b,"append",v=>function(){for(var y=arguments.length,_=new Array(y),x=0;y>x;x++)_[x]=arguments[x];return v.apply(this,p(_))}
113),f(b,"prepend",v=>function(){for(var y=arguments.length,_=new Array(y),x=0;y>x;x++)_[x]=arguments[x];return v.apply(this,p(_))})}),[(s=l.Element)==null?void 0:s.prototype,(i=l.CharacterData)==null?void 0:i.prototype,(o=l.DocumentType)==null?void 0:o.prototype].forEach(b=>{f(b,"before",v=>function(){for(var y=arguments.length,_=new Array(y),x=0;y>x;x++)_[x]=arguments[x];return v.apply(this,p(_))}),f(b,"after",v=>function(){for(var y=arguments.length,_=new Array(y),x=0;y>x;x++)_[x]=arguments[x];return v.apply(this,p(_))}),f(b,"replaceWith",v=>function(){for(var y=arguments.length,_=new Array(y),x=0;y>x;x++)_[x]=arguments[x];var k=p(_);return _.length&&!k.length?void 0:v.apply(this,k)})}),f((a=l.Element)==null?void 0:a.prototype,"insertAdjacentElement",b=>function(v,y){var _=g(y);return _?b.call(this,v,_):null}),this.pa=()=>{c.forEach(b=>b()),this.pa=void 0},this.ga()}ga(){var t=!1;return()=>{var e;t||(t=!0,this.ua--,this.ua===0&&((e=this.pa)==null||e.call(this)))}}ma(t,e){e===void 0&&(e=!0);var r=this.fa();try{var n=t(r);return e&&r(),n}catch(s){throw r(),s}}setupSiteApp(t){var e=this.apps[t.id],r=()=>{var o;!e.errored&&this.ha.length&&(tn.info("Processing "+this.ha.length+" events for site app with id "+t.id),this.ha.forEac
113h(a=>this.ma(()=>e.processEvent==null?void 0:e.processEvent(a))),e.processedBuffer=!0),Object.values(this.apps).every(a=>a.processedBuffer||a.errored)&&((o=this.ca)==null||o.call(this))},n=!1,s=o=>{e.errored=!o,e.loaded=!0,tn.info("Site app with id "+t.id+" "+(o?"loaded":"errored")),n&&r()};try{var i=this.ma(o=>t.init({posthog:this._instance,callback(a){o(),s(a)}}),!1).processEvent;i&&(e.processEvent=i),n=!0}catch(o){tn.error(ub+t.id,o),s(!1)}if(n&&e.loaded)try{r()}catch(o){tn.error("Error while processing buffered events PostHog app with config id "+t.id,o),e.errored=!0}}ya(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of t)this.setupSiteApp(r)}ba(t){var e=this;if(Object.keys(this.apps).length!==0){var r=this.globalsForEvent(t),n=function(i){try{e.ma(()=>i.processEvent==null?void 0:i.processEvent(r))}catch(o){tn.error("Error while processing event "+t.event+" for site app "+i.id,o)}};for(var s of Object.values(this.apps))n(s)}}onRemoteConfig(t){var e,r,n,s=this;if((e=this.siteAppLoaders)!=null&&e.length)return this.isEnabled?(this.ya(),void this._instance.on("eventCaptured",a=>this.ba(a))):void tn.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.ca)==null||r.call(this),(n=t.siteApps)!=null&&n.length)if(this.isEnabled){var i=function(){var a,l=o.id,u=o.url;X["__$$ph_site_app_"+l]=s._instance,(a=X.__PosthogExtensions__)==null||a.loadSiteApp==null||a.loadSiteApp(s._instance,u,c=>{if(c)return tn.error(ub+l,c)})};for(var o of t.siteApps)i()}else tn.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},vU={tracingHeaders:class{constructor(t){this._a=void 0,this.wa=void 0,this.xa=void 0,this.Do=()=>{var e,r,n=this.ka();n?(U(this._a)&&(this._a=(e=X.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(n,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),U(this.wa)&&(this.wa=(r=X.__PosthogExtensions__)==null||(r=r.tracingHeadersPatchFns)==null?void 0:r._patchFetch(n,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.Uo()},this._instance=t}initialize(){this.startIfEnabledOrStop()}rr(t){var e,r;(e=X.__PosthogExtensions__)!=null&&e.tracingHeadersPatchFns?t():(r=X.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"tracing-headers",n=>{if(n)return sU.error("failed to load script",n);t()})}Sa(){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}ka(){var t=this.Sa();return ce(t)?(ce(this.xa)?this.xa.splice(0,this.xa.length,...t):this.xa=[...t],t.length>0?this.xa:void 0):(ce(this.xa)&&this.xa.splice(0),this.xa=t||void 0,this.xa)}Uo(){var t,e;(t=this._a)==null||t.call(this),(e=this.wa)==null||e.call(this),this._a=void 0,this.wa=void 0}startIfEnabledOrStop(){this.ka()?this.rr(this.Do):this.Uo()}}},yU=L({surveys:class{get Te(){return this._instance.config}constructor(t){this.Ca=void 0,this._surveyManager=null,this.Ia=!1,this.Ta=[],this.Ma=null,this.Ea=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.Te.disable_surveys){var e=t.surveys;if(le(e))return xe.warn("Flags not loaded yet. Not loading surveys.");var r=ce(e);this.Ca=r?e.length>0:e,xe.info("flags response received, isSurveysEnabled: "+this.Ca),this.loadIfEnabled()}}reset(){try{var t;(t=this._surveyEventReceiver)==null||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],r=0;r<localStorage.length;r++){var n=localStorage.key(r);(n!=null&&n.startsWith(CC)||n!=null&&n.startsWith("inProgressSurvey_"))&&e.push(n)}e.forEach(s=>localStorage.removeItem(s))}catch{}}loadIfEnabled(){if(!this._surveyManager)if(this.Ia)xe.info("Already initializing surveys, skipping...");else if(this.Te.disable_surveys)xe.info(cb);else if(this.Te.cookieless_mode&&this._instance.consent.isOptedOut())xe.info("Not loading surveys in cookieless mode without consent.");else{var t=X==null?void 0:X.__PosthogExtensions__;if(t){if(!U(this.Ca)||this.Te.advanced_enable_surveys){var e=this.Ca||this.Te.advanced_enable_surveys;this.Ia=!0;try{var r=t.generateSurveys;if(r)return void this.Ra(r,e);var n=t.loadExternalDependency;if(!n)return void this.Pa(vy);n(this._instance,"surveys",s=>{s||!t.generateSurveys?this.Pa("Could not load surveys script",s):this.Ra(t.generateSurveys,e)})}catch(s){throw this.Pa("Error initializing surveys",s),s}finally{this.Ia=!1}}}else xe.error("PostHog Extensions not found.")}}Ra(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new uU(this._instance),xe.info("Surveys loaded successfully"),this.Oa({isLoaded:!0})}Pa(t,e){xe.error(t,e),this.Oa({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Ta.push(t),this._surveyManager&&this.Oa({isLoaded:!0}),()=>{this.Ta=this.Ta.filter(e=>e!==t)}}getSurveys(t,e){if(e===void 0&&(e=!1),this.Te.disable_surveys)return xe.info(cb),t([]);var r,n=this._instance.get_property(fm);if(n&&!e)return t(n,{isLoaded:!0}
113),void(this.Fa()&&this.getSurveys(()=>{},!0));typeof Promise<"u"&&this.Ma?this.Ma.then(s=>t(s.surveys,s.context)):(typeof Promise<"u"&&(this.Ma=new Promise(s=>{r=s})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Te.token),method:"GET",timeout:this.Te.surveys_request_timeout_ms,callback:s=>{var i;this.Ma=null;var o=s.statusCode;if(o!==200||!s.json){var a="Surveys API could not be loaded, status: "+o;xe.error(a),this.Ea=Date.now();var l={isLoaded:!1,error:a};return t([],l),void(r==null||r({surveys:[],context:l}))}this.Ea=null;var u,c=s.json.surveys||[],d=c.filter(f=>function(g){return!(!g.start_date||g.end_date)}(f)&&(EC(f)||function(g){var p;return!((p=g.conditions)==null||(p=p.actions)==null||(p=p.values)==null||!p.length)}(f)));d.length>0&&((u=this._surveyEventReceiver)==null||u.register(d)),(i=this._instance.persistence)==null||i.register({[fm]:c,[Gd]:Date.now()});var h={isLoaded:!0};t(c,h),r==null||r({surveys:c,context:h})}}))}Fa(){return this.La()&&!this.Ma&&!this.Aa()}La(){var t=this._instance.get_property(Gd);return gt(t)&&Date.now()-t>3e5}Aa(){return gt(this.Ea)&&3e5>Date.now()-this.Ea}markSurveyAsSeen(t,e){var r,n={id:t,current_iteration:(r=e==null?void 0:e.iteration)!==null&&r!==void 0?r:null};TC(n);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}Oa(t){for(var e of this.Ta)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(r){xe.error("Error in survey callback",r)}}getActiveMatchingSurveys(t,e){if(e===void 0&&(e=!1),!le(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);xe.warn("init was not called")}$a(t){var e=null;return this.getSurveys(r=>{var n;e=(n=r.find(s=>s.id===t))!==null&&n!==void 0?n:null}),e}Na(t){if(le(this._surveyManager))return{eligible:!1,reason:ap};var e=typeof t=="string"?this.$a(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(le(this._surveyManager))return xe.warn("init was not called"),{visible:!1,disabledReason:ap};var e=this.Na(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return le(this._surveyManager)?(xe.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:ap})):new Promise(r=>{this.getSurveys(n=>{var s,i=(s=n.find(a=>a.id===t))!==null&&s!==void 0?s:null;if(i){var o=this.Na(i);r({visible:o.eligible,disabledReason:o.reason})}else r({visible:!1,disabledReason:"Survey not found"})},e)})}renderSurvey(t,e,r){var n;if(le(this._surveyManager))xe.warn("init was not called");else{var s=typeof t=="string"?this.$a(t):t;if(s!=null&&s.id)if(YF.includes(s.type)){var i=H==null?void 0:H.querySelector(e);if(i)return(n=s.appearance)!=null&&n.surveyPopupDelaySeconds?(xe.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var o,a;xe.info("Rendering survey "+s.id+" with delay of "+((o=s.appearance)==null?void 0:o.surveyPopupDelaySeconds)+" seconds"),(a=this._surveyManager)==null||a.renderSurvey(s,i,r),xe.info("Survey "+s.id+" rendered")},1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,i,r);xe.warn("Survey element not found")}else xe.warn("Surveys of type "+s.type+" cannot be rendered in the app");else xe.warn("Survey not found")}}displaySurvey(t,e){var r;if(le(this._surveyManager))xe.warn("init was not called");else{var n=this.$a(t);if(n){var s=n;if((r=n.appearance)!=null&&r.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=L({},n,{appearance:L({},n.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==Sm.Popover&&e.initialResponses&&xe.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){var i=this.canRenderSurvey(n);if(!i.visible)return void xe.warn("Survey is not eligible to be displayed: ",i.disabledReason)}e.displayType!==Sm.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else xe.warn("Survey not found")}}cancelPendingSurvey(t){le(this._surveyManager)?xe.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;(t=this._surveyManager)==null||t.handlePageUnload==null||t.handlePageUnload()}}},Wh),_U={toolbar:class{constructor(t){this.instance=t}Da(t){X.ph_toolbar_state=t}qa(){var t;return(t=X.ph_toolbar_state)!==null&&t!==void 0?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,r){if(t===void 0&&(t=void 0),e===void 0&&(e=void 0),r===void 0&&(r=void 0),U1(this.instance.config)||!O||!H)return!1;t=t??O.location,r=r??O.history;try{if(!e){try{O.localStorage.setItem("test","test"),O.localStorage.removeItem("test")}catch{return!1}e=O==null?void 0:O.localStorage}var n,s=cU||th(t.hash,"__posthog")||th(t.hash,"state"),i=s?O0(()=>JSON.parse(atob(decodeURIComponent(s))))||O0(()=>JSON.parse(decodeURIComponent(s))):null;return i&&i.action==="ph_authorize"?((n=i).source="url",n&&Object.keys(n).length>0&&(i.desiredHash?t.hash=i.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((n=JSON.parse(e.getItem(db)||"{}")).source="localstorage",delete n.userIntent),!(!n.token||this.instance.config.token!==n.token||(this.loadToolbar(n),0))}catch{return!1}}ja(t){var e=X.ph_load_toolbar||X.ph_load_editor;!le(e)&&Br(e)?e(t,this.instance):hb.warn("No toolbar load function found")}loadToolbar(t){var e=!(H==null||!H.getElementById(L1));if(!O||e)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,n=L({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(O.localStorage.setItem(db,JSON.stringify(L({},n,{source:void 0}))),this.qa()===2)this.ja(n);else if(this.qa()===0){var s;this.Da(1),(s=X.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"toolbar",i=>{if(i)return hb.error("[Toolbar] Failed to load",i),void this.Da(0);this.Da(2),this.ja(n)}),Ue(O,"turbolinks:load",()=>{this.Da(0),this.loadToolbar(n)})}return!0}Ha(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,r){return t===void 0&&(t=void 0),e===void 0&&(e=void 0),r===void 0&&(r=void 0),this.maybeLoadToolbar(t,e,r)}}},wU=L({experiments:bt},Wh),bU={conversations:class{constructor(t){this.Ba=void 0,this._conversationsManager=null,this.Ua=!1,this.za=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var e=t.conversations;le(e)||(vn(e)?this.Ba=e:(this.Ba=e.enabled,this.za=e),this.loadIfEnabled())}}reset(){var t;(t=this._conversationsManager)==null||t.reset(),this._conversationsManager=null,this.Ba=void 0,this.za=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ua||this._instance.config.disable_conversations||U1(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=X==null?void 0:X.__PosthogExtensions__;if(t&&!U(this.Ba)&&this.Ba)if(this.za&&this.za.token){this.Ua=!0;try{var e=t.initConversations;if(e)return this.Va(e),void(this.Ua=!1);var r=t.loadExternalDependency;if(!r)return void this.Wa(vy);r(this._instance,"conversations",n=>{n||!t.initConversations?this.Wa("Could not load conversations script",n):this.Va(t.initConversations),this.Ua=!1})}catch(n){this.Wa("Error initializing conversations",n),this.Ua=!1}}else pr.error("Conversations enabled but missing token in remote config.")}}Va(t){if(this.za)try{this._conversationsManager=t(this.za,this._instance),pr.info("Conversations loaded successfully")}catch(e){this.Wa("Error completing conversations initialization",e)}else pr.error("Cannot complete initialization: remote config is null")}Wa(t,e){pr.error(t,e),this._conversationsManager=null,this.Ua=!1}show(){this._conversationsManager?this._conversationsManager.show():pr.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Ba===!0&&!Mt(this._conversationsManager)}isVisible(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,r){var n=this;return Ye(function*(){return n._conversationsManager?n._conversationsManager.sendMessage(t,e,r):(pr.warn(ni),null)})()}getMessages(t,e){var r=this;return Ye(function*(){return r._conversationsManager?r._conversationsManager.getMessages(t,e):(pr.warn(ni),null)})()}markAsRead(t){var e=this;return Ye(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(pr.warn(ni),null)})()}getTickets(t){var e=this;return Ye(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(pr.warn(ni),null)})()}requestRestoreLink(t){var e=this;return Ye(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(pr.warn(ni),null)})()}restoreFromToken(t){var e=this;return Ye(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(pr.warn(ni),null)})()}restoreFromUrlToken(){var t=this;return Ye(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(pr.warn(ni),null)})()}getCurrentTicketId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getWidgetSessionId())!==null&&t!==void 0?t:null}En(){var t;(t=this._conversationsManager)==null||t.setIdentity()}Rn(){var t;(t=this._conversationsManager)==null||t.clearIdentity()}}},xU={logs:class{constructor(t){var e;this.Za=!1,this.Ga=!1,this.it=$e("[logs]"),this.Gr=[],this.Qa=[],this.Ls=0,this.Ja=()=>{var r,n;this.Ls=0,(r=this.Ka)==null||r.onReconnect(),(n=this.Ya)==null||n.onReconnect()},this._instance=t,this._instance&&(e=this._instance.config.logs)!=null&&e.captureConsoleLogs&&(this.Za=!0),O&&Ue(O,"online",this.Ja)}Xa(t,e,r,n){var s,i=function(o,a){var l,u,c,d,h,f,g,p=(l=o==null?void 0:o.flushIntervalMs)!==null&&l!==void 0?l:3e3,b=(u=o==null?void 0:o.maxBufferSize)!==null&&u!==void 0?u:100,v=a!=null&&a.consoleCapture?void 0:(c=o==null?void 0:o.maxLogsPerInterval)!==null&&c!==void 0?c:1e3,y=U(v)?Math.max(b,2048):Math.max(b,v),_=o==null?void 0:o.resourceAttributes;return{serviceName:(d=(h=_==null?void 0:_["service.name"])!==null&&h!==void 0?h:o==null?void 0:o.serviceName)!==null&&d!==void 0?d:a==null?void 0:a.serviceNameDefault,serviceVersion:(f=_==null?void 0:_["service.version"])!==null&&f!==void 0?f:o==null?void 0:o.serviceVersion,environment:(g=_==null?void 0:_["deployment.environment"])!==null&&g!==void 0?g:o==null?void 0:o.environment,resourceAttributes:_,beforeSend:o==null?void 0:o.beforeSend,flushIntervalMs:p,maxBufferSize:b,maxQueueSize:y,maxBatchRecordsPerPost:100,rateCapWindowMs:p,maxLogsPerInterval:v,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}((s=this._instance)==null||(s=s.config)==null?void 0:s.logs,r);return[new RD(this.tl(t,e),i,this.it,()=>this.el(),o=>o(),void 0,n),i]}rl(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.Ka||this.il!==e){var r;(r=this.Ka)==null||r.reset(),this.il=e;var n=this.Xa(()=>this.Gr,s=>{this.Gr=s});this.Ka=n[0],this.nl=n[1]}return this.Ka}sl(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.Ya||this.ol!==e){var r;(r=this.Ya)==null||r.reset(),this.ol=e;var n=this.Xa(()=>this.Qa,s=>{this.Qa=s},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},mb);this.Ya=n[0],this.al=n[1]}return this.Ya}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e,r=(e=t.logs)==null?void 0:e.captureConsoleLogs;!le(r)&&r&&(this.Za=!0,this.loadIfEnabled())}reset(){var t,e;this.Gr=[],(t=this.Ka)==null||t.reset(),this.Qa=[],(e=this.Ya)==null||e.reset(),this.Ls=0}captureLog(t){this.rl().captureLog(t)}le(t){this.sl().captureLog(t)}get logger(){return this.ll||(this.ll={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.ll}flushLogs(t){t?this.ul(t):(this.Ka&&this.Ka.flush().catch(e=>this.it.error("PostHog logs flush failed:",e)),this.Ya&&this.Ya.flush().catch(e=>this.it.error("PostHog logs flush failed:",e)))}loadIfEnabled(){if(this.Za&&!this.Ga){var t=X==null?void 0:X.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",r=>{var n;r||(n=t.logs)==null||!n.initializeLogs?this.it.error("Could not load logs script",r):(t.logs.initializeLogs(this._instance),this.Ga=!0)}):this.it.error(vy)}else this.it.error("PostHog Extensions not found.")}}tl(t,e){var r=this._instance;return{get isDisabled(){return!1},get optedOut(){return!r.is_capturing()},getPersistedProperty:n=>n===On.LogsQueue?t():void 0,setPersistedProperty(n,s){var i;n===On.LogsQueue&&e((i=s)!==null&&i!==void 0?i:[])},At:n=>this.At(n),getLibraryId:()=>Fe.LIB_NAME,getLibraryVersion:()=>Fe.LIB_VERSION}}At(t){return new Promise(e=>{if(rC(this.Ls,3))e({kind:"fatal",error:new Error("logs endpoint is unreachable, dropping batch")});else{var r=!1,n=i=>{r||(r=!0,clearTimeout(s),e(i))},s=setTimeout(()=>n({kind:"retry-later",error:new Error("logs request timed out")}),9e4);this._instance._send_request({method:"POST",url:this.hl(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:i=>{var o=i.statusCode;if(this.dl(o),o>=200&&300>o)n({kind:"ok"});else if(o===413)n({kind:"too-large"});else if(o!==0&&o!==429&&500>o)n({kind:"fatal",error:new Error("logs request failed with status "+o)});else{var a;n({kind:"retry-later",error:(a=i.error)!==null&&a!==void 0?a:new Error("logs request failed with status "+o)})}}})}})}dl(t){(t!==0||this._instance.__loaded)&&(this.Ls=nC(t,this.Ls,3,()=>this.it.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.")))}ul(t){this.Gr.length>0&&this.cl(t,this.Gr,this.nl,Fe.LIB_NAME,e=>{this.Gr=e}),this.Qa.length>0&&this.cl(t,this.Qa,this.al,mb,e=>{this.Qa=e})}cl(t,e,r,n,s){if(e.length!==0){var i=e.map(a=>a.record);s([]);var o=C1(i,E1(r,Fe.LIB_NAME,Fe.LIB_VERSION),n,Fe.LIB_VERSION);this._instance._send_request({method:"POST",url:this.hl(),data:o,compression:"best-available",batchKey:"logs",transport:t})}}hl(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}el(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var r=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),n=r.windowId,s=r.sessionStartTimestamp,i=r.lastActivityTimestamp;e.sessionId=r.sessionId,e.windowId=n,le(s)||(e.sessionStartTimestamp=s),le(i)||(e.lastActivityTimestamp=i)}if(X!=null&&(t=X.location)!=null&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?Hs(X.location.href):X.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(e.activeFeatureFlags=o)}return e}}},kU={metrics:class{constructor(t){this.it=$e("[metrics]"),this._instance=t}initialize(){}rl(){var t,e,r,n,s,i,o,a,l,u=(t=this._instance)==null||(t=t.config)==null?void 0:t.metrics;return this.Ka&&this.il===u||((e=this.Ka)==null||e.reset(),this.il=u,this.Ka=new AD(this.tl(),{serviceName:(n=(l=(r=u)==null?void 0:r.resourceAttributes)==null?void 0:l["service.name"])!==null&&n!==void 0?n:r==null?void 0:r.serviceName,serviceVersion:(s=l==null?void 0:l["service.version"])!==null&&s!==void 0?s:r==null?void 0:r.serviceVersion,environment:(i=l==null?void 0:l["deployment.environment"])!==null&&i!==void 0?i:r==null?void 0:r.environment,resourceAttributes:l,beforeSend:r==null?void 0:r.beforeSend,flushIntervalMs:(o=r==null?void 0:r.flushIntervalMs)!==null&&o!==void 0?o:1e4,maxSeriesPerFlush:(a=r==null?void 0:r.maxSeriesPerFlush)!==null&&a!==void 0?a:1e3},this.it)),this.Ka}count(t,e,r){e===void 0&&(e=1),this.rl().count(t,e,r)}gauge(t,e,r){this.rl().gauge(t,e,r)}histogram(t,e,r){this.rl().histogram(t,e,r)}flush(t
113){if(!this.Ka)return Promise.resolve();if(t){var e=this.Ka.drainWindow();return e&&this.Kt(e,t),Promise.resolve()}return this.Ka.flush().catch(r=>this.it.error("PostHog metrics flush failed:",r))}reset(){var t;(t=this.Ka)==null||t.reset()}tl(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Kt:r=>e.Kt(r),getLibraryId:()=>Fe.LIB_NAME,getLibraryVersion:()=>Fe.LIB_VERSION}}Kt(t,e){return new Promise(r=>{var n=!1,s=o=>{n||(n=!0,clearTimeout(i),r(o))},i=setTimeout(()=>s({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(L({method:"POST",url:this.vl(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(o){var a=o.statusCode;if(a>=200&&300>a)s({kind:"ok"});else if(a===413)s({kind:"too-large"});else if(a!==0&&a!==429&&500>a)s({kind:"fatal",error:new Error("metrics request failed with status "+a)});else{var l;s({kind:"retry-later",error:(l=o.error)!==null&&l!==void 0?l:new Error("metrics request failed with status "+a)})}}}))})}vl(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},SU=L({},Wh,hU,fU,pU,gU,mU,yU,vU,_U,wU,bU,xU,kU);_r.__defaultExtensionClasses=L({},SU);var zr=function(){Fe.SDK_DIST_CHANNEL="npm";var t=Dl[vo]=new _r;return function(){function e(){e.done||(e.done=!0,RC=!1,Ee(Dl,function(r){r._dom_loaded()}))}H!=null&&H.addEventListener?H.readyState==="complete"?e():Ue(H,"DOMContentLoaded",e,{capture:!1}):O&&F.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),t}();const vb="phc_wbVUAEUHU44YYozSnV2Rw4WGM2PYdgUWzbUZ67wDTP9U",EU="https://eu.i.posthog.com",Nm="memnar_analytics_opt_out";let _a=!1,oh=null;function CU(){try{return localStorage.getItem(Nm)==="1"}catch{return!1}}const TU=/[^\s@]+@[^\s@]+\.[^\s@]+/g;function AC(t){if(typeof t!="string")return t;const e=t.search(/[?#]/);return e===-1?t:t.slice(0,e)}function PU(t){return Array.isArray(t)?t.map(e=>{if(!e||typeof e!="object")return e;const r=e,n={...r};typeof r.value=="string"&&(n.value=r.value.replace(TU,"[email]"));const s=r.stacktrace;return s&&Array.isArray(s.frames)&&(n.stacktrace={...s,frames:s.frames.map(i=>{if(!i||typeof i!="object")return i;const o=i;return{...o,filename:AC(o.filename)}})}),n}):t}function RU(t){const e={...t};for(const r of["$current_url","$referrer","$pathname","$initial_current_url"])r in e&&(e[r]=AC(e[r]));return"$exception_list"in e&&(e.$exception_list=PU(e.$exception_list)),e}const AU={api_host:EU,capture_pageview:"history_change",autocapture:!1,persistence:"localStorage",capture_exceptions:{capture_unhandled_errors:!0,capture_unhandled_rejections:!0,capture_console_errors:!1},disable_session_recording:!1,session_recording:{maskAllInputs:!0,maskTextSelector:"*",blockSelector:"[data-ph-block]",recordHeaders:!1,recordBody:!1,streamNetworkBody:!1,recordCrossOriginIframes:!1,captureCanvas:{recordCanvas:!1}},enable_recording_console_log:!1,capture_performance:!1,capture_dead_clicks:!1,capture_heatmaps:!1,rageclick:!1,before_send:t=>t&&{...t,properties:RU(t.properties??{})}};function OU(){_a||!vb||CU()||(zr.init(vb,AU),_a=!0)}function jU(t){try{t?localStorage.setItem(Nm,"1"):localStorage.removeItem(Nm)}catch{}_a&&(t?(zr.opt_out_capturing(),zr.stopSessionRecording()):zr.opt_in_capturing())}function NU(t){!_a||oh===t||(oh=t,zr.identify(t),IU(t))}async function IU(t){try{const{data:e}=await fe.rpc("analytics_opt_out_for_me");if(e){jU(!0);return}const{data:r}=await fe.from("profiles").select("is_test, plan, signup_source, signed_up_at").eq("id",t).single();if(!r)return;r.is_test&&(zr.register({is_test:!0}),zr.setPersonProperties({is_test:!0})),r.plan&&zr.setPersonProperties({plan:r.plan}),r.signup_source&&zr.setPersonProperties({signup_source:r.signup_source}),await $U(t,r.signed_up_at,r.signup_source)}catch{}}async function $U(t,e,r){if(e!==null)return;const{data:n}=await fe.from("profiles").update({signed_up_at:new Date().toISOString()}).eq("id",t).is("signed_up_at",null).select("id");n&&n.length>0&&Ri("signed_up",{source:r??null})}function LU(){!_a||oh===null||(oh=null,zr.reset())}function Ri(t,e={}){if(_a)try{zr.capture(t,e)}catch{}}const OC=w.createContext({session:null,user:null,loading:!0,signOut:async()=>{}}),yt=()=>w.useContext(OC),MU=({children:t})=>{const[e,r]=w.useState(null),[n,s]=w.useState(null),[i,o]=w.useState(!0);w.useEffect(()=>{QM(),eD();const{data:{subscription:l}}=fe.auth.onAuthStateChange((u,c)=>{r(c),s((c==null?void 0:c.user)??null),o(!1),c!=null&&c.user?(XM(c.user.id),tD(),sD(c.user.id,c.user.email),NU(c.user.id)):LU()});return fe.auth.getSession().then(({data:{session:u}})=>{r(u),s((u==null?void 0:u.user)??null),o(!1)}),()=>l.unsubscribe()},[]);const a=async()=>{await fe.auth.signOut()};return m.jsx(OC.Provider,{value:{session:e,user:n,loading:i,signOut:a},children:t})},DU=[{code:"nl",name:"Nederlands"},{code:"en",name:"English"}],jC="memnar-ui-language";function ah(t){return t==="en"||t==="nl"}function FU(t){for(const e of t??[]){const r=e.toLowerCase().split("-")[0];if(ah(r))return r}return"en"}function Cy(t){return ah(t.profile)?t.profile:ah(t.stored)?t.stored:FU(t.device)}function Ty(){try{const t=localStorage.getItem(jC);return ah(t)?t:null}catch{return null}}function Im(t){try{localStorage.setItem(jC,t)}catch{}}function Py(){var t;return typeof navigator>"u"?[]:(t=navigator.languages)!=null&&t.length?navigator.languages:[navigator.language].filter(
113Boolean)}function V5(t){return t==="nl"?"nl-NL":"en-GB"}function K5(t){return t}const UU={en:{updated:"Profile updated",failed:"Failed to update profile"},nl:{updated:"Profiel bijgewerkt",failed:"Profiel bijwerken mislukt"}};function qh(){const{user:t}=yt();return hr({queryKey:["profile",t==null?void 0:t.id],queryFn:async()=>{if(!t)return null;const{data:r,error:n}=await fe.from("profiles").select("*").eq("id",t.id).single();if(n)throw n;return r},enabled:!!t})}function G5(){const{user:t}=yt(),e=Gs(),r=Xt(UU);return kO({mutationFn:async n=>{if(!t)throw new Error("Not authenticated");const s={display_name:n.display_name,updated_at:new Date().toISOString()};"primary_tool"in n&&(s.primary_tool=n.primary_tool),"content_language"in n&&(s.content_language=n.content_language),"autonomy"in n&&(s.autonomy=n.autonomy);const{data:i,error:o}=await fe.from("profiles").update(s).eq("id",t.id).select().single();if(o)throw o;return i},onSuccess:()=>{e.invalidateQueries({queryKey:["profile",t==null?void 0:t.id]}),Je.success(r.updated)},onError:n=>{Je.error(`${r.failed}: ${n.message}`)}})}const Ry=w.createContext(void 0),BU=({children:t})=>{const{user:e}=yt(),{data:r}=qh(),n=Gs(),[s,i]=w.useState(()=>Ty()),o=e?r==null?void 0:r.ui_language:null,a=Cy({profile:o,stored:s,device:Py()});w.useEffect(()=>{(o==="en"||o==="nl")&&(Im(o),i(o))},[o]),w.useEffect(()=>{document.documentElement.lang=a},[a]);const l=w.useCallback(async c=>{if(Im(c),i(c),!e)return;n.setQueryData(["profile",e.id],h=>h&&{...h,ui_language:c});const{error:d}=await fe.from("profiles").update({ui_language:c,updated_at:new Date().toISOString()}).eq("id",e.id);d&&(console.warn("Could not save the app language to the profile",d.message),await n.invalidateQueries({queryKey:["profile",e.id]}))},[e,n]),u=w.useMemo(()=>({language:a,setLanguage:l}),[a,l]);return m.jsx(Ry.Provider,{value:u,children:t})},Y5=({language:t,children:e})=>{const r=Na(),n=w.useMemo(()=>({language:t,setLanguage:r.setLanguage}),[t,r.setLanguage]);return m.jsx(Ry.Provider,{value:n,children:e})},Na=()=>{const t=w.useContext(Ry);return t||{language:Cy({stored:Ty(),device:Py()}),setLanguage:async e=>Im(e)}};function Xt(t){const{language:e}=Na();return t[e]}const NC="memnar-theme",zU=["system","light","dark"];function HU(t){return typeof t=="string"&&zU.includes(t)}function yb(){try{const t=localStorage.getItem(NC);return HU(t)?t:"system"}catch{return"system"}}function WU(t){try{localStorage.setItem(NC,t)}catch{}}function qU(){try{return window.matchMedia("(prefers-color-scheme: light)").matches}catch{return!1}}function up(t){return t==="light"||t==="dark"?t:qU()?"light":"dark"}function _b(t){document.documentElement.dataset.theme=t}const IC=w.createContext(void 0),VU=({children:t})=>{const[e,r]=w.useState(()=>yb()),[n,s]=w.useState(()=>up(yb()));w.useEffect(()=>{const a=up(e);s(a),_b(a)},[e]),w.useEffect(()=>{if(e!=="system")return;const a=window.matchMedia("(prefers-color-scheme: light)"),l=()=>{const u=up("system");s(u),_b(u)};return a.addEventListener("change",l),()=>a.removeEventListener("change",l)},[e]);const i=w.useCallback(a=>{WU(a),r(a)},[]),o=w.useMemo(()=>({choice:e,theme:n,setChoice:i}),[e,n,i]);return m.jsx(IC.Provider,{value:o,children:t})},$C=()=>{const t=w.useContext(IC);if(!t)throw new Error("useTheme must be used inside a ThemeProvider");return t};/**
114 * @license lucide-react v0.462.0 - ISC
115 *
116 * This source code is licensed under the ISC license.
117 * See the LICENSE file in the root directory of this source tree.
118 */const KU=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),LC=(...t)=>t.filter((e,r,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===r).join(" ").trim();/**
119 * @license lucide-react v0.462.0 - ISC
120 *
121 * This source code is licensed under the ISC license.
122 * See the LICENSE file in the root directory of this source tree.
123 */var GU={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
124 * @license lucide-react v0.462.0 - ISC
125 *
126 * This source code is licensed under the ISC license.
127 * See the LICENSE file in the root directory of this source tree.
128 */const YU=w.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:i,iconNode:o,...a},l)=>w.createElement("svg",{ref:l,...GU,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:LC("lucide",s),...a},[...o.map(([u,c])=>w.createElement(u,c)),...Array.isArray(i)?i:[i]]));/**
129 * @license lucide-react v0.462.0 - ISC
130 *
131 * This source code is licensed under the ISC license.
132 * See the LICENSE file in the root directory of this source tree.
133 */const qe=(t,e)=>{const r=w.forwardRef(({className:n,...s},i)=>w.createElement(YU,{ref:i,iconNode:e,className:LC(`lucide-${KU(t)}`,n),...s}));return r.displayName=`${t}`,r};/**
134 * @license lucide-react v0.462.0 - ISC
135 *
136 * This source code is licensed under the ISC license.
137 * See the LICENSE file in the root directory of this source tree.
138 */const JU=qe("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
139 * @license lucide-react v0.462.0 - ISC
140 *
141 * This source code is licensed under the ISC license.
142 * See the LICENSE file in the root directory of this source tree.
143 */const lh=qe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
144 * @license lucide-react v0.462.0 - ISC
145 *
146 * This source code is licensed under the ISC license.
147 * See the LICENSE file in the root directory of this source tree.
148 */const MC=qe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
149 * @license lucide-react v0.462.0 - ISC
150 *
151 * This source code is licensed under the ISC license.
152 * See the LICENSE file in the root directory of this source tree.
153 */const QU=qe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
154 * @license lucide-react v0.462.0 - ISC
155 *
156 * This source code is licensed under the ISC license.
157 * See the LICENSE file in the root directory of this source tree.
158 */const XU=qe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
159 * @license lucide-react v0.462.0 - ISC
160 *
161 * This source code is licensed under the ISC license.
162 * See the LICENSE file in the root directory of this source tree.
163 */const ZU=qe("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
164 * @license lucide-react v0.462.0 - ISC
165 *
166 * This source code is licensed under the ISC license.
167 * See the LICENSE file in the root directory of this source tree.
168 */const $m=qe("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
169 * @license lucide-react v0.462.0 - ISC
170 *
171 * This source code is licensed under the ISC license.
172 * See the LICENSE file in the root directory of this source tree.
173 */const e3=qe("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
174 * @license lucide-react v0.462.0 - ISC
175 *
176 * This source code is licensed under the ISC license.
177 * See the LICENSE file in the root directory of this source tree.
178 */const t3=qe("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
179 * @license lucide-react v0.462.0 - ISC
180 *
181 * This source code is licensed under the ISC license.
182 * See the LICENSE file in the root directory of this source tree.
183 */const r3=qe("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
184 * @license lucide-react v0.462.0 - ISC
185 *
186 * This source code is licensed under the ISC license.
187 * See the LICENSE file in the root directory of this source tree.
188 */const wb=qe("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
189 * @license lucide-react v0.462.0 - ISC
190 *
191 * This source code is licensed under the ISC license.
192 * See the LICENSE file in the root directory of this source tree.
193 */const bb=qe("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
194 * @license lucide-react v0.462.0 - ISC
195 *
196 * This source code is licensed under the ISC license.
197 * See the LICENSE file in the root directory of this source tree.
198 */const n3=qe("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
199 * @license lucide-react v0.462.0 - ISC
200 *
201 * This source code is licensed under the ISC license.
202 * See the LICENSE file in the root directory of this source tree.
203 */const s3=qe("MessageSquareQuote",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M8 12a2 2 0 0 0 2-2V8H8",key:"1jfesj"}],["path",{d:"M14 12a2 2 0 0 0 2-2V8h-2",key:"1dq9mh"}]]);/**
204 * @license lucide-react v0.462.0 - ISC
205 *
206 * This source code is licensed under the ISC license.
207 * See the LICENSE file in the root directory of this source tree.
208 */const i3=qe("MessagesSquare",[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]]);/**
209 * @license lucide-react v0.462.0 - ISC
210 *
211 * This source code is licensed under the ISC license.
212 * See the LICENSE file in the root directory of this source tree.
213 */const o3=qe("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
214 * @license lucide-react v0.462.0 - ISC
215 *
216 * This source code is licensed under the ISC license.
217 * See the LICENSE file in the root directory of this source tree.
218 */const a3=qe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
219 * @license lucide-react v0.462.0 - ISC
220 *
221 * This source code is licensed under the ISC license.
222 * See the LICENSE file in the root directory of this source tree.
223 */const l3=qe("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}
223],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
224 * @license lucide-react v0.462.0 - ISC
225 *
226 * This source code is licensed under the ISC license.
227 * See the LICENSE file in the root directory of this source tree.
228 */const u3=qe("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
229 * @license lucide-react v0.462.0 - ISC
230 *
231 * This source code is licensed under the ISC license.
232 * See the LICENSE file in the root directory of this source tree.
233 */const c3=qe("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
234 * @license lucide-react v0.462.0 - ISC
235 *
236 * This source code is licensed under the ISC license.
237 * See the LICENSE file in the root directory of this source tree.
238 */const d3=qe("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
239 * @license lucide-react v0.462.0 - ISC
240 *
241 * This source code is licensed under the ISC license.
242 * See the LICENSE file in the root directory of this source tree.
243 */const h3=qe("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
244 * @license lucide-react v0.462.0 - ISC
245 *
246 * This source code is licensed under the ISC license.
247 * See the LICENSE file in the root directory of this source tree.
248 */const f3=qe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),p3={en:{group:"Theme",option:t=>`Theme: ${t}`,system:"System",light:"Light",dark:"Dark"},nl:{group:"Thema",option:t=>`Thema: ${t}`,system:"Systeem",light:"Licht",dark:"Donker"}},g3=[{value:"system",Icon:o3},{value:"light",Icon:d3},{value:"dark",Icon:a3}],m3=()=>{const{choice:t,setChoice:e}=$C(),r=Xt(p3);return m.jsx("div",{role:"radiogroup","aria-label":r.group,className:"glass fixed bottom-4 right-4 z-40 flex gap-0.5 rounded-full p-1 print:hidden",children:g3.map(({value:n,Icon:s})=>{const i=t===n,o=r.option(r[n]);return m.jsx("button",{type:"button",role:"radio","aria-checked":i,title:o,"aria-label":o,onClick:()=>e(n),className:`grid h-8 w-8 place-items-center rounded-full transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background ${i?"bg-surface-high text-on-surface":"text-on-surface-muted hover:text-on-surface"}`,children:m.jsx(s,{className:"h-4 w-4","aria-hidden":"true"})},n)})})},xb=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,kb=EE,v3=(t,e)=>r=>{var n;if((e==null?void 0:e.variants)==null)return kb(t,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:i}=e,o=Object.keys(s).map(u=>{const c=r==null?void 0:r[u],d=i==null?void 0:i[u];if(c===null)return null;const h=xb(c)||xb(d);return s[u][h]}),a=r&&Object.entries(r).reduce((u,c)=>{let[d,h]=c;return h===void 0||(u[d]=h),u},{}),l=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((u,c)=>{let{class:d,className:h,...f}=c;return Object.entries(f).every(g=>{let[p,b]=g;return Array.isArray(b)?b.includes({...i,...a}[p]):{...i,...a}[p]===b})?[...u,d,h]:u},[]);return kb(t,o,l,r==null?void 0:r.class,r==null?void 0:r.className)},y3=v3("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl text-sm font-medium font-body transition-all duration-200 ease-[
248cubic-bezier(0.4,0,0.2,1)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"lit-glass-primary btn-primary font-semibold",secondary:"btn-secondary bg-surface-high text-on-surface hover:bg-surface-highest",outline:"btn-outline bg-transparent text-on-surface border border-outline-mf/20 hover:bg-surface-high",ghost:"bg-transparent text-on-surface-variant hover:bg-surface-high",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-11 px-6 py-0 text-sm",sm:"h-9 rounded-lg px-4 py-0 text-[13px]",lg:"h-14 px-10 py-0 text-base font-semibold",xl:"h-14 px-10 py-4 text-lg",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),St=w.forwardRef(({className:t,variant:e,size:r,asChild:n=!1,...s},i)=>{const o=n?lN:"button";return m.jsx(o,{className:Yr(y3({variant:e,size:r,className:t})),ref:i,...s})});St.displayName="Button";const Sb="memnar:chunk-reload-ts",_3=15e3;function DC(){let t=0;try{t=Number(sessionStorage.getItem(Sb)||0)}catch{}const e=Date.now();if(e-t<_3)return!1;try{sessionStorage.setItem(Sb,String(e))}catch{}return window.location.reload(),!0}function w3(t){const e=t instanceof Error?`${t.name} ${t.message}`:String(t??"");return/failed to fetch dynamically imported module/i.test(e)||/error loading dynamically imported module/i.test(e)||/importing a module script failed/i.test(e)||/ChunkLoadError/i.test(e)||/Loading chunk [\d]+ failed/i.test(e)}const b3={en:{title:"Something went wrong",body:"An unexpected error occurred. Please try refreshing the page.",home:"Return Home"},nl:{title:"Er ging iets mis",body:"Er ging onverwacht iets fout. Ververs de pagina en probeer het opnieuw.",home:"Naar de startpagina"}};class x3 extends w.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){w3(e)?DC():Ri("app_error",{message:e instanceof Error?e.message:String(e)})}render(){if(this.state.hasError){const e=b3[Cy({stored:Ty(),device:Py()})];return m.jsx("div",{className:"min-h-screen bg-surface flex items-center justify-center px-6",children:m.jsxs("div",{className:"text-center max-w-md",children:[m.jsx("div",{className:"w-16 h-16 rounded-2xl bg-error-mf/10 flex items-center justify-center mx-auto mb-6",children:m.jsx("span",{className:"text-3xl",children:"!"})}),m.jsx("h1",{className:"font-headline text-2xl text-on-surface mb-3",children:e.title}),m.jsx("p",{className:"text-on-surface/60 font-body mb-6",children:e.body}),m.jsx(St,{onClick:()=>{this.setState({hasError:!1}),window.location.href="/"},children:e.home})]})})}return this.props.children}}const Lm="memnar_return_to",k3=60*60*1e3;function FC(t){return typeof t=="string"&&t.startsWith("/")&&!t.startsWith("//")}function S3(t){if(!(!FC(t)||t==="/"))try{localStorage.setItem(Lm,JSON.stringify({path:t,at:Date.now()}))}catch{}}function uh(){try{const t=localStorage.getItem(Lm);if(!t)return null;localStorage.removeItem(Lm);const{path:e,at:r}=JSON.parse(t);return!FC(e)||typeof r!="number"||Date.now()-r>k3?null:e}catch{return null}}const E3={en:{loading:"Loading..."},nl:{loading:"Laden..."}},Ec=({children:t})=>{const{session:e,loading:r}=yt(),n=Gr(),s=Xt(E3);return r?m.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface",children:m.jsx("div",{className:"animate-soft-pulse font-headline text-2xl text-lavender",children:s.loading})}):e?m.jsx(m.Fragment,{children:t}):(S3(n.pathname+n.search),m.jsx(Nr,{to:"/login",replace:!0}))};function UC(t){const e=t+"CollectionProvider",[r,n]=Ca(e),[s,i]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:b,children:v}=p,y=z.useRef(null),_=z.useRef(new Map).current;return m.jsx(s,{scope:b,itemMap:_,collectionRef:y,children:v})};o.displayName=e;const a=t+"CollectionSlot",l=iu(a),u=z.forwardRef((p,b)=>{const{scope:v,children:y}=p,_=i(a,v),x=Ct(b,_.collectionRef);return m.jsx(l,{ref:x,children:y})});u.displayName=a;const c=t+"CollectionItemSlot",d="data-radix-collection-item",h=iu(c),f=z.forwardRef((p,b)=>{const{scope:v,children:y,..._}=p,x=z.useRef(null),k=Ct(b,x),C=i(c,v);return z.useEffect(()=>(C.itemMap.set(x,{ref:x,..._}),()=>void C.itemMap.delete(x))),m.jsx(h,{[d]:"",ref:k,children:y})});f.displayName=c;function g(p){const b=i(t+"CollectionConsumer",p);return z.useCallback(()=>{const y=b.collectionRef.current;if(!y)return[];const _=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((C,T)=>_.indexOf(C.ref.current)-_.indexOf(T.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:o,Slot:u,ItemSlot:f},g,n]}var C3=w.createContext(void 0);function BC(t){const e=w.useContext(C3);return t||e||"ltr"}var cp=0;function T3(){w.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Eb()),document.body.insertAdjacentElement("beforeend",t[1]??Eb()),cp++,()=>{cp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e
vendor: 4,913 bytes, line 248
248=>e.remove()),cp--}},[])}function Eb(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var dp="focusScope.autoFocusOnMount",hp="focusScope.autoFocusOnUnmount",Cb={bubbles:!1,cancelable:!0},P3="FocusScope",zC=w.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=t,[a,l]=w.useState(null),u=Kn(s),c=Kn(i),d=w.useRef(null),h=Ct(e,p=>l(p)),f=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(n){let p=function(_){if(f.paused||!a)return;const x=_.target;a.contains(x)?d.current=x:as(d.current,{select:!0})},b=function(_){if(f.paused||!a)return;const x=_.relatedTarget;x!==null&&(a.contains(x)||as(d.current,{select:!0}))},v=function(_){if(document.activeElement===document.body)for(const k of _)k.removedNodes.length>0&&as(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",b);const y=new MutationObserver(v);return a&&y.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",b),y.disconnect()}}},[n,a,f.paused]),w.useEffect(()=>{if(a){Pb.add(f);const p=document.activeElement;if(!a.contains(p)){const v=new CustomEvent(dp,Cb);a.addEventListener(dp,u),a.dispatchEvent(v),v.defaultPrevented||(R3(I3(HC(a)),{select:!0}),document.activeElement===p&&as(a))}return()=>{a.removeEventListener(dp,u),setTimeout(()=>{const v=new CustomEvent(hp,Cb);a.addEventListener(hp,c),a.dispatchEvent(v),v.defaultPrevented||as(p??document.body,{select:!0}),a.removeEventListener(hp,c),Pb.remove(f)},0)}}},[a,u,c,f]);const g=w.useCallback(p=>{if(!r&&!n||f.paused)return;const b=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,v=document.activeElement;if(b&&v){const y=p.currentTarget,[_,x]=A3(y);_&&x?!p.shiftKey&&v===x?(p.preventDefault(),r&&as(_,{select:!0})):p.shiftKey&&v===_&&(p.preventDefault(),r&&as(x,{select:!0})):v===y&&p.preventDefault()}},[r,n,f.paused]);return m.jsx(vt.div,{tabIndex:-1,...o,ref:h,onKeyDown:g})});zC.displayName=P3;function R3(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(as(n,{select:e}),document.activeElement!==r)return}function A3(t){const e=HC(t),r=Tb(e,t),n=Tb(e.reverse(),t);return[r,n]}function HC(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function Tb(t,e){for(const r of t)if(!O3(r,{upTo:e}))return r}function O3(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function j3(t){return t instanceof HTMLInputElement&&"select"in t}function as(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&j3(t)&&e&&t.select()}}var Pb=N3();function N3(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=Rb(t,e),t.unshift(e)},remove(e){var r;t=Rb(t,e),(r=t[0])==null||r.resume()}}}function Rb(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function I3(t){return t.filter(e=>e.tagName!=="A")}var fp="rovingFocusGroup.onEntryFocus",$3={bubbles:!1,cancelable:!0},$u="RovingFocusGroup",[Mm,WC,L3]=UC($u),[M3,qC]=Ca($u,[L3]),[D3,F3]=M3($u),VC=w.forwardRef((t,e)=>m.jsx(Mm.Provider,{scope:t.__scopeRovingFocusGroup,children:m.jsx(Mm.Slot,{scope:t.__scopeRovingFocusGroup,children:m.jsx(U3,{...t,ref:e})})}));VC.displayName=$u;var U3=w.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...d}=t,h=w.useRef(null),f=Ct(e,h),g=BC(i),[p,b]=pE({prop:o,defaultProp:a??null,onChange:l,caller:$u}),[v,y]=w.useState(!1),_=Kn(u),x=WC(r),k=w.useRef(!1),[C,T]=w.useState(0);return w.useEffect(()=>{const S=h.current;if(S)return S.addEventListener(fp,_),()=>S.removeEventListener(fp,_)},[_]),m.jsx(D3,{scope:r,orientation:n,dir:g,loop:s,currentTabStopId:p,onItemFocus:w.useCallback(S=>b(S),[b]),onItemShiftTab:w.useCallback(()=>y(!0),[]),onFocusableItemAdd:w.useCallback(()=>T(S=>S+1),[]),onFocusableItemRemove:w.useCallback(()=>T(S=>S-1),[]),children:m.jsx(vt.div,{tabIndex:v||C===0?-1:0,"data-orientation":n,...d,ref:f,style:{outline:"none",...t.style},onMouseDown:he(t.onMouseDown,()=>{k.current=!0}),onFocus:he(t.onFocus,S=>{const P=!k.current;if(S.target===S.currentTarget&&P&&!v){const R=new CustomEvent(fp,$3);if(S.currentTarget.dispatchEvent(R),!R.defaultPrevented){const I=x().filter($=>$.focusable),N=I.find($=>$.active),B=I.find($=>
vendor: 4,709 bytes, line 248
248$.id===p),ee=[N,B,...I].filter(Boolean).map($=>$.ref.current);YC(ee,c)}}k.current=!1}),onBlur:he(t.onBlur,()=>y(!1))})})}),KC="RovingFocusGroupItem",GC=w.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:i,children:o,...a}=t,l=Ag(),u=i||l,c=F3(KC,r),d=c.currentTabStopId===u,h=WC(r),{onFocusableItemAdd:f,onFocusableItemRemove:g,currentTabStopId:p}=c;return w.useEffect(()=>{if(n)return f(),()=>g()},[n,f,g]),m.jsx(Mm.ItemSlot,{scope:r,id:u,focusable:n,active:s,children:m.jsx(vt.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:e,onMouseDown:he(t.onMouseDown,b=>{n?c.onItemFocus(u):b.preventDefault()}),onFocus:he(t.onFocus,()=>c.onItemFocus(u)),onKeyDown:he(t.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){c.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const v=H3(b,c.orientation,c.dir);if(v!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let _=h().filter(x=>x.focusable).map(x=>x.ref.current);if(v==="last")_.reverse();else if(v==="prev"||v==="next"){v==="prev"&&_.reverse();const x=_.indexOf(b.currentTarget);_=c.loop?W3(_,x+1):_.slice(x+1)}setTimeout(()=>YC(_))}}),children:typeof o=="function"?o({isCurrentTabStop:d,hasTabStop:p!=null}):o})})});GC.displayName=KC;var B3={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function z3(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function H3(t,e,r){const n=z3(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return B3[n]}function YC(t,e=!1){const r=document.activeElement;for(const n of t)if(n===r||(n.focus({preventScroll:e}),document.activeElement!==r))return}function W3(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var q3=VC,V3=GC,K3=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},oo=new WeakMap,Cc=new WeakMap,Tc={},pp=0,JC=function(t){return t&&(t.host||JC(t.parentNode))},G3=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=JC(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},Y3=function(t,e,r,n){var s=G3(e,Array.isArray(t)?t:[t]);Tc[r]||(Tc[r]=new WeakMap);var i=Tc[r],o=[],a=new Set,l=new Set(s),u=function(d){!d||a.has(d)||(a.add(d),u(d.parentNode))};s.forEach(u);var c=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(h){if(a.has(h))c(h);else try{var f=h.getAttribute(n),g=f!==null&&f!=="false",p=(oo.get(h)||0)+1,b=(i.get(h)||0)+1;oo.set(h,p),i.set(h,b),o.push(h),p===1&&g&&Cc.set(h,!0),b===1&&h.setAttribute(r,"true"),g||h.setAttribute(n,"true")}catch(v){console.error("aria-hidden: cannot operate on ",h,v)}})};return c(e),a.clear(),pp++,function(){o.forEach(function(d){var h=oo.get(d)-1,f=i.get(d)-1;oo.set(d,h),i.set(d,f),h||(Cc.has(d)||d.removeAttribute(n),Cc.delete(d)),f||d.removeAttribute(r)}),pp--,pp||(oo=new WeakMap,oo=new WeakMap,Cc=new WeakMap,Tc={})}},J3=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),s=K3(t);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),Y3(n,s,r,"aria-hidden")):function(){return null}},Qc="right-scroll-bar-position",Xc="width-before-scroll-bar",Q3="with-scroll-bars-hidden",X3="--removed-body-scroll-bar-size";function gp(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function Z3(t,e){var r=w.useState(function(){return{value:t,callback:e,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=e,r.facade}var e4=typeof window<"u"?w.useLayoutEffect:w.useEffect,Ab=new WeakMap;function t4(t,e){var r=Z3(null,function(n){return t.forEach(function(s){return gp(s,n)})});return e4(function(){var n=Ab.get(r);if(n){var s=new Set(n),i=new Set(t),o=r.current;s.forEach(function(a){i.has(a)||gp(a,null)}),i.forEach(function(a){s.has(a)||gp(a,o)})}Ab.set(r,t)},[t]),r}function r4(t){return t}function n4(t,e){e===void 0&&(e=r4);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:t},useMedium:function(i){var o=e(i,n);return r.push(o),function(){r=r.filter(function(a){return a!==o})}},assignSyncMedium:function(i){for(n=!0;r.length;){var o=r;r=[],o.forEach(i)}r={push:function(a){return i(a)},filter:function(){return r}}},assignMedium:function(i){n=!0;var o=[];if(r.length){var a=r;r=[],a.forEach(i),o=r}var l=function(){var c=o;
vendor: 4,400 bytes, lines 248-285
248o=[],c.forEach(i)},u=function(){return Promise.resolve().then(l)};u(),r={push:function(c){o.push(c),u()},filter:function(c){return o=o.filter(c),r}}}};return s}function s4(t){t===void 0&&(t={});var e=n4(null);return e.options=cn({async:!0,ssr:!1},t),e}var QC=function(t){var e=t.sideCar,r=Oa(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=e.read();if(!n)throw new Error("Sidecar medium not found");return w.createElement(n,cn({},r))};QC.isSideCarExport=!0;function i4(t,e){return t.useMedium(e),QC}var XC=s4(),mp=function(){},Vh=w.forwardRef(function(t,e){var r=w.useRef(null),n=w.useState({onScrollCapture:mp,onWheelCapture:mp,onTouchMoveCapture:mp}),s=n[0],i=n[1],o=t.forwardProps,a=t.children,l=t.className,u=t.removeScrollBar,c=t.enabled,d=t.shards,h=t.sideCar,f=t.noRelative,g=t.noIsolation,p=t.inert,b=t.allowPinchZoom,v=t.as,y=v===void 0?"div":v,_=t.gapMode,x=Oa(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=h,C=t4([r,e]),T=cn(cn({},x),s);return w.createElement(w.Fragment,null,c&&w.createElement(k,{sideCar:XC,removeScrollBar:u,shards:d,noRelative:f,noIsolation:g,inert:p,setCallbacks:i,allowPinchZoom:!!b,lockRef:r,gapMode:_}),o?w.cloneElement(w.Children.only(a),cn(cn({},T),{ref:C})):w.createElement(y,cn({},T,{className:l,ref:C}),a))});Vh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Vh.classNames={fullWidth:Xc,zeroRight:Qc};var o4=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function a4(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=o4();return e&&t.setAttribute("nonce",e),t}function l4(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function u4(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var c4=function(){var t=0,e=null;return{add:function(r){t==0&&(e=a4())&&(l4(e,r),u4(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},d4=function(){var t=c4();return function(e,r){w.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&r])}},ZC=function(){var t=d4(),e=function(r){var n=r.styles,s=r.dynamic;return t(n,s),null};return e},h4={left:0,top:0,right:0,gap:0},vp=function(t){return parseInt(t||"",10)||0},f4=function(t){var e=window.getComputedStyle(document.body),r=e[t==="padding"?"paddingLeft":"marginLeft"],n=e[t==="padding"?"paddingTop":"marginTop"],s=e[t==="padding"?"paddingRight":"marginRight"];return[vp(r),vp(n),vp(s)]},p4=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return h4;var e=f4(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},g4=ZC(),qo="data-scroll-locked",m4=function(t,e,r,n){var s=t.left,i=t.top,o=t.right,a=t.gap;return r===void 0&&(r="margin"),`
249  .`.concat(Q3,` {
250   overflow: hidden `).concat(n,`;
251   padding-right: `).concat(a,"px ").concat(n,`;
252  }
253  body[`).concat(qo,`] {
254    overflow: hidden `).concat(n,`;
255    overscroll-behavior: contain;
256    `).concat([e&&"position: relative ".concat(n,";"),r==="margin"&&`
257    padding-left: `.concat(s,`px;
258    padding-top: `).concat(i,`px;
259    padding-right: `).concat(o,`px;
260    margin-left:0;
261    margin-top:0;
262    margin-right: `).concat(a,"px ").concat(n,`;
263    `),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),`
264  }
265  
266  .`).concat(Qc,` {
267    right: `).concat(a,"px ").concat(n,`;
268  }
269  
270  .`).concat(Xc,` {
271    margin-right: `).concat(a,"px ").concat(n,`;
272  }
273  
274  .`).concat(Qc," .").concat(Qc,` {
275    right: 0 `).concat(n,`;
276  }
277  
278  .`).concat(Xc," .").concat(Xc,` {
279    margin-right: 0 `).concat(n,`;
280  }
281  
282  body[`).concat(qo,`] {
283    `).concat(X3,": ").concat(a,`px;
284  }
285`)},Ob=function(){var t=parseInt(document.body.getAttribute(qo)||"0",10);return isFinite(t)?t:0},v4=function(){w.useEffect(function(){return document.body.setAttribute(qo,(Ob()+1).toString()),function(){var t=Ob()-1;t<=0?document.body.removeAttribute(qo):document.body.setAttribute(qo,t.toString())}},[])},y4=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,s=n===void 0?"margin":n;v4();var i=w.useMemo(function(){return p4(s)},[s]);return w.createElement(g4,{styles:m4(i,!e,s,r?"":"!important")})}
vendor: 19,875 bytes, lines 285-288
285,Dm=!1;if(typeof window<"u")try{var Pc=Object.defineProperty({},"passive",{get:function(){return Dm=!0,!0}});window.addEventListener("test",Pc,Pc),window.removeEventListener("test",Pc,Pc)}catch{Dm=!1}var ao=Dm?{passive:!1}:!1,_4=function(t){return t.tagName==="TEXTAREA"},eT=function(t,e){if(!(t instanceof Element))return!1;var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!_4(t)&&r[e]==="visible")},w4=function(t){return eT(t,"overflowY")},b4=function(t){return eT(t,"overflowX")},jb=function(t,e){var r=e.ownerDocument,n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=tT(t,n);if(s){var i=rT(t,n),o=i[1],a=i[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},x4=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},k4=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},tT=function(t,e){return t==="v"?w4(e):b4(e)},rT=function(t,e){return t==="v"?x4(e):k4(e)},S4=function(t,e){return t==="h"&&e==="rtl"?-1:1},E4=function(t,e,r,n,s){var i=S4(t,window.getComputedStyle(e).direction),o=i*n,a=r.target,l=e.contains(a),u=!1,c=o>0,d=0,h=0;do{if(!a)break;var f=rT(t,a),g=f[0],p=f[1],b=f[2],v=p-b-i*g;(g||v)&&tT(t,a)&&(d+=v,h+=g);var y=a.parentNode;a=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(c&&Math.abs(d)<1||!c&&Math.abs(h)<1)&&(u=!0),u},Rc=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Nb=function(t){return[t.deltaX,t.deltaY]},Ib=function(t){return t&&"current"in t?t.current:t},C4=function(t,e){return t[0]===e[0]&&t[1]===e[1]},T4=function(t){return`
286  .block-interactivity-`.concat(t,` {pointer-events: none;}
287  .allow-interactivity-`).concat(t,` {pointer-events: all;}
288`)},P4=0,lo=[];function R4(t){var e=w.useRef([]),r=w.useRef([0,0]),n=w.useRef(),s=w.useState(P4++)[0],i=w.useState(ZC)[0],o=w.useRef(t);w.useEffect(function(){o.current=t},[t]),w.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var p=Z2([t.lockRef.current],(t.shards||[]).map(Ib),!0).filter(Boolean);return p.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),p.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var a=w.useCallback(function(p,b){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!o.current.allowPinchZoom;var v=Rc(p),y=r.current,_="deltaX"in p?p.deltaX:y[0]-v[0],x="deltaY"in p?p.deltaY:y[1]-v[1],k,C=p.target,T=Math.abs(_)>Math.abs(x)?"h":"v";if("touches"in p&&T==="h"&&C.type==="range")return!1;var S=jb(T,C);if(!S)return!0;if(S?k=T:(k=T==="v"?"h":"v",S=jb(T,C)),!S)return!1;if(!n.current&&"changedTouches"in p&&(_||x)&&(n.current=k),!k)return!0;var P=n.current||k;return E4(P,b,p,P==="h"?_:x)},[]),l=w.useCallback(function(p){var b=p;if(!(!lo.length||lo[lo.length-1]!==i)){var v="deltaY"in b?Nb(b):Rc(b),y=e.current.filter(function(k){return k.name===b.type&&(k.target===b.target||b.target===k.shadowParent)&&C4(k.delta,v)})[0];if(y&&y.should){b.cancelable&&b.preventDefault();return}if(!y){var _=(o.current.shards||[]).map(Ib).filter(Boolean).filter(function(k){return k.contains(b.target)}),x=_.length>0?a(b,_[0]):!o.current.noIsolation;x&&b.cancelable&&b.preventDefault()}}},[]),u=w.useCallback(function(p,b,v,y){var _={name:p,delta:b,target:v,should:y,shadowParent:A4(v)};e.current.push(_),setTimeout(function(){e.current=e.current.filter(function(x){return x!==_})},1)},[]),c=w.useCallback(function(p){r.current=Rc(p),n.current=void 0},[]),d=w.useCallback(function(p){u(p.type,Nb(p),p.target,a(p,t.lockRef.current))},[]),h=w.useCallback(function(p){u(p.type,Rc(p),p.target,a(p,t.lockRef.current))},[]);w.useEffect(function(){return lo.push(i),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,ao),document.addEventListener("touchmove",l,ao),document.addEventListener("touchstart",c,ao),function(){lo=lo.filter(function(p){return p!==i}),document.removeEventListener("wheel",l,ao),document.removeEventListener("touchmove",l,ao),document.removeEventListener("touchstart",c,ao)}},[]);var f=t.removeScrollBar,g=t.inert;return w.createElement(w.Fragment,null,g?w.createElement(i,{styles:T4(s)}):null,f?w.createElement(y4,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function A4(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const O4=i4(XC,R4);var nT=w.forwardRef(function(t,e){return w.createElement(Vh,cn({},t,{ref:e,sideCar:O4}))});nT.classNames=Vh.classNames;var Fm=["Enter"," "],j4=["ArrowDown","PageUp","Home"],sT=["ArrowUp","PageDown","End"],N4=[...j4,...sT],I4={ltr:[...Fm,"ArrowRight"],rtl:[...Fm,"ArrowLeft"]},$4={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Lu="Menu",[xu,L4,M4]=UC(Lu),[zi,iT]=Ca(Lu,[M4,Lh,qC]),Kh=Lh(),oT=qC(),[D4,Hi]=zi(Lu),[F4,Mu]=zi(Lu),aT=t=>{const{__scopeMenu:e,open:r=!1,children:n,dir:s,onOpenChange:i,modal:o=!0}=t,a=Kh(e),[l,u]=w.useState(null),c=w.useRef(!1),d=Kn(i),h=BC(s);return w.useEffect(()=>{const f=()=>{c.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>c.current=!1;return document.addEventListener("keydown",f,{capture:!0}),()=>{document.removeEventListener("keydown",f,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),m.jsx(WI,{...a,children:m.jsx(D4,{scope:e,open:r,onOpenChange:d,content:l,onContentChange:u,children:m.jsx(F4,{scope:e,onClose:w.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:c,dir:h,modal:o,children:n})})})};aT.displayName=Lu;var U4="MenuAnchor",Ay=w.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,s=Kh(r);return m.jsx(cE,{...s,...n,ref:e})});Ay.displayName=U4;var Oy="MenuPortal",[B4,lT]=zi(Oy,{forceMount:void 0}),uT=t=>{const{__scopeMenu:e,forceMount:r,children:n,container:s}=t,i=Hi(Oy,e);return m.jsx(B4,{scope:e,forceMount:r,children:m.jsx(Ra,{present:r||i.open,children:m.jsx(fE,{asChild:!0,container:s,children:n})})})};uT.displayName=Oy;var kr="MenuContent",[z4,jy]=zi(kr),cT=w.forwardRef((t,e)=>{const r=lT(kr,t.__scopeMenu),{forceMount:n=r.forceMount,...s}=t,i=Hi(kr,t.__scopeMenu),o=Mu(kr,t.__scopeMenu);return m.jsx(xu.Provider,{scope:t.__scopeMenu,children:m.jsx(Ra,{present:n||i.open,children:m.jsx(xu.Slot,{scope:t.__scopeMenu,children:o.modal?m.jsx(H4,{...s,ref:e}):m.jsx(W4,{...s,ref:e})})})})}),H4=w.forwardRef((t,e)=>{const r=Hi(kr,t.__scopeMenu),n=w.useRef(null),s=Ct(e,n);return w.useEffect(()=>{const i=n.current;if(i)return J3(i)},[]),m.jsx(Ny,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:he(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),W4=w.forwardRef((t,e)=>{const r=Hi(kr,t.__scopeMenu);return m.jsx(Ny,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),q4=iu("MenuContent.ScrollLock"),Ny=w.forwardRef((t,e)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,onDismiss:f,disableOutsideScroll:g,...p}=t,b=Hi(kr,r),v=Mu(kr,r),y=Kh(r),_=oT(r),x=L4(r),[k,C]=w.useState(null),T=w.useRef(null),S=Ct(e,T,b.onContentChange),P=w.useRef(0),R=w.useRef(""),I=w.useRef(0),N=w.useRef(null),B=w.useRef("right"),q=w.useRef(0),ee=g?nT:w.Fragment,$=g?{as:q4,allowPinchZoom:!0}:void 0,W=A=>{var ie,Le;const M=R.current+A,G=x().filter(Ce=>!Ce.disabled),V=document.activeElement,Q=(ie=G.find(Ce=>Ce.ref.current===V))==null?void 0:ie.textValue,Z=G.map(Ce=>Ce.textValue),oe=nB(Z,M,Q),ve=(Le=G.find(Ce=>Ce.textValue===oe))==null?void 0:Le.ref.current;(function Ce(Tt){R.current=Tt,window.clearTimeout(P.current),Tt!==""&&(P.current=window.setTimeout(()=>Ce(""),1e3))})(M),ve&&setTimeout(()=>ve.focus())};w.useEffect(()=>()=>window.clearTimeout(P.current),[]),T3();const j=w.useCallback(A=>{var G,V;return B.current===((G=N.current)==null?void 0:G.side)&&iB(A,(V=N.current)==null?void 0:V.area)},[]);return m.jsx(z4,{scope:r,searchRef:R,onItemEnter:w.useCallback(A=>{j(A)&&A.preventDefault()},[j]),onItemLeave:w.useCallback(A=>{var M;j(A)||((M=T.current)==null||M.focus(),C(null))},[j]),onTriggerLeave:w.useCallback(A=>{j(A)&&A.preventDefault()},[j]),pointerGraceTimerRef:I,onPointerGraceIntentChange:w.useCallback(A=>{N.current=A},[]),children:m.jsx(ee,{...$,children:m.jsx(zC,{asChild:!0,trapped:s,onMountAutoFocus:he(i,A=>{var M;A.preventDefault(),(M=T.current)==null||M.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:m.jsx(Gv,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,onDismiss:f,children:m.jsx(q3,{asChild:!0,..._,dir:v.dir,orientation:"vertical",loop:n,currentTabStopId:k,onCurrentTabStopIdChange:C,onEntryFocus:he(l,A=>{v.isUsingKeyboardRef.current||A.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(dE,{role:"menu","aria-orientation":"vertical","data-state":CT(b.open),"data-radix-menu-content":"",dir:v.dir,...y,...p,ref:S,style:{outline:"none",...p.style},onKeyDown:he(p.onKeyDown,A=>{const G=A.target.closest("[data-radix-menu-content]")===A.currentTarget,V=A.ctrlKey||A.altKey||A.metaKey,Q=A.key.length===1;G&&(A.key==="Tab"&&A.preventDefault(),!V&&Q&&W(A.key));const Z=T.current;if(A.target!==Z||!N4.includes(A.key))return;A.preventDefault();const ve=x().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);sT.includes(A.key)&&ve.reverse(),tB(ve)}),onBlur:he(t.onBlur,A=>{A.currentTarget.contains(A.target)||(window.clearTimeout(P.current),R.current="")}),onPointerMove:he(t.onPointerMove,ku(A=>{const M=A.target,G=q.current!==A.clientX;if(A.currentTarget.contains(M)&&G){const V=A.clientX>q.current?"right":"left";B.current=V,q.current=A.clientX}}))})})})})})})});cT.displayName=kr;var V4="MenuGroup",Iy=w.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return m.jsx(vt.div,{role:"group",...n,ref:e})});Iy.displayName=V4;var K4="MenuLabel",dT=w.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return m.jsx(vt.div,{...n,ref:e})});dT.displayName=K4;var ch="MenuItem",$b="menu.itemSelect",Gh=w.forwardRef((t,e)=>{const{disabled:r=!1,onSelect:n,...s}=t,i=w.useRef(null),o=Mu(ch,t.__scopeMenu),a=jy(ch,t.__scopeMenu),l=Ct(e,i),u=w.useRef(!1),c=()=>{const d=i.current;if(!r&&d){const h=new CustomEvent($b,{bubbles:!0,cancelable:!0});d.addEventListener($b,f=>n==null?void 0:n(f),{once:!0}),US(d,h),h.defaultPrevented?u.current=!1:o.onClose()}};return m.jsx(hT,{...s,ref:l,disabled:r,onClick:he(t.onClick,c),onPointerDown:d=>{var h;(h=t.onPointerDown)==null||h.call(t,d),u.current=!0},onPointerUp:he(t.onPointerUp,d=>{var h;u.current||(h=d.currentTarget)==null||h.click()}),onKeyDown:he(t.onKeyDown,d=>{const h=a.searchRef.current!=="";r||h&&d.key===" "||Fm.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Gh.displayName=ch;var hT=w.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:n=!1,textValue:s,...i}=t,o=jy(ch,r),a=oT(r),l=w.useRef(null),u=Ct(e,l),[c,d]=w.useState(!1),[h,f]=w.useState("");return w.useEffect(()=>{const g=l.current;g&&f((g.textContent??"").trim())},[i.children]),m.jsx(xu.ItemSlot,{scope:r,disabled:n,textValue:s??h,children:m.jsx(V3,{asChild:!0,...a,focusable:!n,children:m.jsx(vt.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...i,ref:u,onPointerMove:he(t.onPointerMove,ku(g=>{n?o.onItemLeave(g):(o.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:he(t.onPointerLeave,ku(g=>o.onItemLeave(g))),onFocus:he(t.onFocus,()=>d(!0)),onBlur:he(t.onBlur,()=>d(!1))})})})}),G4="MenuCheckboxItem",fT=w.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:n,...s}=t;return m.jsx(yT,{scope:t.__scopeMenu,checked:r,children:m.jsx(Gh,{role:"menuitemcheckbox","aria-checked":dh(r)?"mixed":r,...s,ref:e,"data-state":Ly(r),onSelect:he(s.onSelect,()=>n==null?void 0:n(dh(r)?!0:!r),{checkForDefaultPrevented:!1})})})});fT.displayName=G4;var pT="MenuRadioGroup",[Y4,J4]=zi(pT,{value:void 0,onValueChange:()=>{}}),gT=w.forwardRef((t,e)=>{const{value:r,onValueChange:n,...s}=t,i=Kn(n);return m.jsx(Y4,{scope:t.__scopeMenu,value:r,onValueChange:i,children:m.jsx(Iy,{...s,ref:e})})});gT.displayName=pT;var mT="MenuRadioItem",vT=w.forwardRef((t,e)=>{const{value:r,...n}=t,s=J4(mT,t.__scopeMenu),i=r===s.value;return m.jsx(yT,{scope:t.__scopeMenu,checked:i,children:m.jsx(Gh,{role:"menuitemradio","aria-checked":i,...n,ref:e,"data-state":Ly(i),onSelect:he(n.onSelect,()=>{var o;return(o=s.onValueChange)==null?void 0:o.call(s,r)},{checkForDefaultPrevented:!1})})})});vT.displayName=mT;var $y="MenuItemIndicator",[yT,Q4]=zi($y,{checked:!1}),_T=w.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:n,...s}=t,i=Q4($y,r);return m.jsx(Ra,{present:n||dh(i.checked)||i.checked===!0,children:m.jsx(vt.span,{...s,ref:e,"data-state":Ly(i.checked)})})});_T.displayName=$y;var X4="MenuSeparator",wT=w.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return m.jsx(vt.div,{role:"separator","aria-orientation":"horizontal",...n,ref:e})});wT.displayName=X4;var Z4="MenuArrow",bT=w.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,s=Kh(r);return m.jsx(hE,{...s,...n,ref:e})});bT.displayName=Z4;var eB="MenuSub",[J5,xT]=zi(eB),yl="MenuSubTrigger",kT=w.forwardRef((t,e)=>{const r=Hi(yl,t.__scopeMenu),n=Mu(yl,t.__scopeMenu),s=xT(yl,t.__scopeMenu),i=jy(yl,t.__scopeMenu),o=w.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,u={__scopeMenu:t.__scopeMenu},c=w.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return w.useEffect(()=>c,[c]),w.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),m.jsx(Ay,{asChild:!0,...u,children:m.jsx(hT,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":CT(r.open),...t,ref:jh(e,s.onTriggerChange),onClick:d=>{var h;(h=t.onClick)==null||h.call(t,d),!(t.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:he(t.onPointerMove,ku(d=>{i.onItemEnter(d),!d.defaultPrevented&&!t.disabled&&!r.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{r.onOpenChange(!0),c()},100))})),onPointerLeave:he(t.onPointerLeave,ku(d=>{var f,g;c();const h=(f=r.content)==null?void 0:f.getBoundingClientRect();if(h){const p=(g=r.content)==null?void 0:g.dataset.side,b=p==="right",v=b?-5:5,y=h[b?"left":"right"],_=h[b?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+v,y:d.clientY},{x:y,y:h.top},{x:_,y:h.top},{x:_,y:h.bottom},{x:y,y:h.bottom}],side:p}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:he(t.onKeyDown,d=>{var f;const h=i.searchRef.current!=="";t.disabled||h&&d.key===" "||I4[n.dir].includes(d.key)&&(r.onOpenChange(!0),(f=r.content)==null||f.focus(),d.preventDefault())})})})});kT.displayName=yl;var ST="MenuSubContent",ET=w.forwardRef((t,e)=>{const r=lT(kr,t.__scopeMenu),{forceMount:n=r.forceMount,...s}=t,i=Hi(kr,t.__scopeMenu),o=Mu(kr,t.__scopeMenu),a=xT(ST,t.__scopeMenu),l=w.useRef(null),u=Ct(e,l);return m.jsx(xu.Provider,{scope:t.__scopeMenu,children:m.jsx(Ra,{present:n||i.open,children:m.jsx(xu.Slot,{scope:t.__scopeMenu,children:m.jsx(Ny,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:c=>{var d;o.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),c.preventDefault()},onCloseAutoFocus:c=>c.preventDefault(),onFocusOutside:he(t.onFocusOutside,c=>{c.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:he(t.onEscapeKeyDown,c=>{o.onClose(),c.preventDefault()}),onKeyDown:he(t.onKeyDown,c=>{var f;const d=c.currentTarget.contains(c.target),h=$4[o.dir].includes(c.key);d&&h&&(i.onOpenChange(!1),(f=a.trigger)==null||f.focus(),c.preventDefault())})})})})})});ET.displayName=ST;function CT(t){return t?"open":"closed"}function dh(t){return t==="indeterminate"}function Ly(t){return dh(t)?"indeterminate":t?"checked":"unchecked"}function tB(t){const e=document.activeElement;for(const r of t)if(r===e||(r.focus(),document.activeElement!==e))return}function rB(t,e){return t.map((r,n)=>t[(e+n)%t.length])}function nB(t,e,r){const s=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=r?t.indexOf(r):-1;let o=rB(t,Math.max(i,0));s.length===1&&(o=o.filter(u=>u!==r));const l=o.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return l!==r?l:void 0}function sB(t,e){const{x:r,y:n}=t;let s=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const a=e[i],l=e[o],u=a.x,c=a.y,d=l.x,h=l.y;c>n!=h>n&&r<(d-u)*(n-c)/(h-c)+u&&(s=!s)}return s}function iB(t,e){if(!e)return!1;const r={x:t.clientX,y:t.clientY};return sB(r,e)}function ku(t){return e=>e.pointerType==="mouse"?t(e):void 0}var oB=aT,aB=Ay,lB=uT,uB=cT,cB=Iy,dB=dT,hB=Gh,fB=fT,pB=gT,gB=vT,mB=_T,vB=wT,yB=bT,_B=kT,wB=ET,Yh="DropdownMenu",[bB]=Ca(Yh,[iT]),Ut=iT(),[xB,TT]=bB(Yh),PT=t=>{const{__scopeDropdownMenu:e,children:r,dir:n,open:s,defaultOpen:i,onOpenChange:o,modal:a=!0}=t,l=Ut(e),u=w.useRef(null),[c,d]=pE({prop:s,defaultProp:i??!1,onChange:o,caller:Yh});return m.jsx(xB,{scope:e,triggerId:Ag(),triggerRef:u,contentId:Ag(),open:c,onOpenChange:d,onOpenToggle:w.useCallback(()=>d(h=>!h),[d]),modal:a,children:m.jsx(oB,{...l,open:c,onOpenChange:d,dir:n,modal:a,children:r})})};PT.displayName=Yh;var RT="DropdownMenuTrigger",AT=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...s}=t,i=TT(RT,r),o=Ut(r);return m.jsx(aB,{asChild:!0,...o,children:m.jsx(vt.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...s,ref:jh(e,i.triggerRef),onPointerDown:he(t.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:he(t.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});AT.displayName=RT;var kB="DropdownMenuPortal",OT=t=>{const{__scopeDropdownMenu:e,...r}=t,n=Ut(e);return m.jsx(lB,{...n,...r})};OT.displayName=kB;var jT="DropdownMenuContent",NT=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=TT(jT,r),i=Ut(r),o=w.useRef(!1);return m.jsx(uB,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...n,ref:e,onCloseAutoFocus:he(t.onCloseAutoFocus,a=>{var l;o.current||(l=s.triggerRef.current)==null||l.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:he(t.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,c=l.button===2||u;(!s.modal||c)&&(o.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});NT.displayName=jT;var SB="DropdownMenuGroup",EB=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Ut(r);return m.jsx(cB,{...s,...n,ref:e})});EB.displayName=SB;
288var CB="DropdownMenuLabel",IT=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Ut(r);return m.jsx(dB,{...s,...n,ref:e})});IT.displayName=CB;var TB="DropdownMenuItem",$T=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Ut(r);return m.jsx(hB,{...s,...n,ref:e})});$T.displayName=TB;var PB="DropdownMenuCheckboxItem",LT=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Ut(r);return m.jsx(fB,{...s,...n,ref:e})});LT.displayName=PB;var RB="DropdownMenuRadioGroup",AB=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Ut(r);return m.jsx(pB,{...s,...n,ref:e})});AB.displayName=RB;var OB="DropdownMenuRadioItem",MT=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Ut(r);return m.jsx(gB,{...s,...n,ref:e})});MT.displayName=OB;var jB="DropdownMenuItemIndicator",DT=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Ut(r);return m.jsx(mB,{...s,...n,ref:e})});DT.displayName=jB;var NB="DropdownMenuSeparator",FT=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Ut(r);return m.jsx(vB,{...s,...n,ref:e})});FT.displayName=NB;var IB="DropdownMenuArrow",$B=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Ut(r);return m.jsx(yB,{...s,...n,ref:e})});$B.displayName=IB;var LB="DropdownMenuSubTrigger",UT=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Ut(r);return m.jsx(_B,{...s,...n,ref:e})});UT.displayName=LB;var MB="DropdownMenuSubContent",BT=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,s=Ut(r);return m.jsx(wB,{...s,...n,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});BT.displayName=MB;var DB=PT,FB=AT,UB=OT,zT=NT,HT=IT,WT=$T,qT=LT,VT=MT,KT=DT,GT=FT,YT=UT,JT=BT;const Lb=DB,Mb=FB,BB=w.forwardRef(({className:t,inset:e,children:r,...n},s)=>m.jsxs(YT,{ref:s,className:Yr("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",e&&"pl-8",t),...n,children:[r,m.jsx(XU,{className:"ml-auto h-4 w-4"})]}));BB.displayName=YT.displayName;const zB=w.forwardRef(({className:t,...e},r)=>m.jsx(JT,{ref:r,className:Yr("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));zB.displayName=JT.displayName;const Um=w.forwardRef(({className:t,sideOffset:e=4,...r},n)=>m.jsx(UB,{children:m.jsx(zT,{ref:n,sideOffset:e,className:Yr("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));Um.displayName=zT.displayName;const _l=w.forwardRef(({className:t,inset:e,...r},n)=>m.jsx(WT,{ref:n,className:Yr("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e&&"pl-8",t),...r}));_l.displayName=WT.displayName;const HB=w.forwardRef(({className:t,children:e,checked:r,...n},s)=>m.jsxs(qT,{ref:s,className:Yr("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t),checked:r,...n,children:[m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(KT,{children:m.jsx(MC,{className:"h-4 w-4"})})}),e]}));HB.displayName=qT.displayName;const WB=w.forwardRef(({className:t,children:e,...r},n)=>m.jsxs(VT,{ref:n,className:Yr("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t),...r,children:[m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(KT,{children:m.jsx(ZU,{className:"h-2 w-2 fill-current"})})}),e]}));WB.displayName=VT.displayName;const QT=w.forwardRef(({className:t,inset:e,...r},n)=>m.jsx(HT,{ref:n,className:Yr("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...r}));QT.displayName=HT.displayName;const Bm=w.forwardRef(({className:t,...e},r)=>m.jsx(GT,{ref:r,className:Yr("-mx-1 my-1 h-px bg-muted",t),...e}));Bm.displayName=GT.displayName;const Jh="/assets/memnar-icon-ikNo5V7z.png",qB=!1;function VB(){const{user:t}=yt(),e=hr({queryKey:["team-membership",t==null?void 0:t.id],queryFn:async()=>
288{if(!t)return!1;const{data:r,error:n}=await fe.from("org_members").select("id").eq("user_id",t.id).eq("status","active").limit(1);if(n)throw n;return(r??[]).length>0},enabled:!!t});return{isActiveTeamMember:!!e.data,isLoading:e.isLoading}}const KB=t=>t==="owner"||t==="curator"?t:"member",GB={en:"Untitled team",nl:"Team zonder naam"};function YB(){const{user:t}=yt(),{language:e}=Na();return hr({queryKey:["my-orgs",t==null?void 0:t.id,e],queryFn:async()=>{if(!t)return[];const{data:r,error:n}=await fe.from("org_members").select("org_id, role, organizations(name, seats, plan_status, comped, current_period_end)").eq("user_id",t.id).eq("status","active");if(n)throw n;return(r??[]).map(s=>{const i=Array.isArray(s.organizations)?s.organizations[0]:s.organizations;return{org_id:s.org_id,role:KB(s.role),name:(i==null?void 0:i.name)??GB[e],seats:Number(i==null?void 0:i.seats)||0,plan_status:(i==null?void 0:i.plan_status)??null,comped:!!(i!=null&&i.comped),current_period_end:(i==null?void 0:i.current_period_end)??null}})},enabled:!!t})}const XT=[{no:1,slug:"claude-md",triptych:"Fundament",title:"Master instructions",compassMove:"Delegate",techLabel:"CLAUDE.md + memory",learn:"Master instructions are the first thing your AI reads. They give it a personality and tell it what to hand off to you and what to do itself.",capability:"Your CLAUDE.md, generated from your AI-self, ready to export.",free:!0,handoff:!1},{no:2,slug:"knowledge-rules",triptych:"Fundament",title:"Your knowledge & rules",compassMove:"Describe",techLabel:"knowledge base + rules",learn:"Your knowledge base is the background your AI looks things up in: your notes, your work, the details you'd otherwise retype every time. Your rules tell it how to behave: what it may use, what to keep private, what stays yours.",capability:"A structured knowledge pack and an editable rules file with the five safety habits.",free:!0,handoff:!1},{no:3,slug:"skills",triptych:"Automatiseren",title:"Reusable workflows",compassMove:"Describe",techLabel:"skills / slash-commands",learn:"Slash-commands that run a whole workflow. Capture the task you keep repeating once, then call it by name.",capability:"Skill templates you install into your own Claude Code via Connect.",free:!1,handoff:!0,asset:"skill"},{no:4,slug:"hooks",triptych:"Automatiseren",title:"Things it does by itself",compassMove:"Delegate",techLabel:"hooks + automation",learn:"Triggers that fire on their own: load your context at the start of every session, or run a check after every change. The system works without you babysitting it.",capability:"Automation recipes, handed off into your setup.",free:!1,handoff:!0,asset:"hook"},{no:5,slug:"mcp-agents",triptych:"Uitbreiden",title:"Connect your tools",compassMove:"Discern",techLabel:"MCP + agents",learn:"Connections to your tools and specialised assistants that take on a slice of the work and report back. You stay at the wheel and judge the output.",capability:"A connector catalog and one agent definition, ready to install.",free:!1,handoff:!0,asset:"agent"},{no:6,slug:"health",triptych:"Uitbreiden",title:"Health & upkeep",compassMove:"Diligence",techLabel:"health + maintenance",learn:"A brain that is never tended goes stale. A light health check and a review rhythm keep your system useful as your work moves on.",capability:"A health score and a maintenance rhythm to keep your system current.",free:!1,handoff:!0,asset:"health"}],Q5=[{name:"Fundament",blurb:"Your context, made portable",modules:[1,2]},{name:"Automatiseren",blurb:"It runs without you",modules:[3,4]},{name:"Uitbreiden",blurb:"Reach and upkeep",modules:[5,6]}];function X5(t){return XT.find(e=>e.slug===t)}const JB=["individual","individual_legacy","tester","full_access","auto_refresh","team"],My={modules:Object.fromEntries(XT.map(t=>[t.no,{title:t.title,techLabel:t.techLabel,learn:t.learn,capability:t.capability}])),triptychLabel:{Fundament:"Foundation",Automatiseren:"Automate",Uitbreiden:"Extend"},triptychBlurb:{Fundament:"Your context, made portable",Automatiseren:"It runs without you",Uitbreiden:"Reach and upkeep"},assets:{skill:{heading:"Your write-as-me skill",intro:"A ready-made slash-command that drafts in your voice, built from your Memnar. Install it in Claude Code and call /write-as-me any time.",buttonLabel:"Generate my skill",installTitle:"Install it",installHint:"Save it as ~/.claude/skills/write-as-me/SKILL.md, then call /write-as-me in any session."},hook:{heading:"Your context hook",intro:"A SessionStart hook that loads your master instructions at the start of every Claude Code session, so it begins already knowing you, no copy-
288paste.",buttonLabel:"Generate my hook",installTitle:"Install it",installHint:"Add this SessionStart entry to the hooks object in your existing ~/.claude/settings.json, do not replace the whole file. It then runs at the start of every session."},agent:{heading:"Your editor agent",intro:"A subagent that reviews and tightens drafts so they sound like you and follow your rules. Hand it any draft and it returns a clean rewrite in your voice.",buttonLabel:"Generate my agent",installTitle:"Install it",installHint:"Save it as ~/.claude/agents/my-editor.md, then ask Claude Code to use the my-editor agent."},health:{heading:"Your maintenance routine",intro:"A light rhythm that keeps your Memnar useful as your work moves on, so your system never goes stale.",buttonLabel:"Get my routine",installTitle:"Keep it close",installHint:"Save it as ~/.claude/mindfile-health.md and run through it every few weeks."}}},QB={modules:{1:{title:"Hoofdinstructies",techLabel:"CLAUDE.md + geheugen",learn:"Hoofdinstructies zijn het eerste wat je AI leest. Ze geven hem een karakter en vertellen wat hij aan jou overlaat en wat hij zelf doet.",capability:"Je CLAUDE.md, gemaakt uit je AI-ik, klaar om te exporteren."},2:{title:"Je kennis en regels",techLabel:"kennisbank + regels",learn:"Je kennisbank is de achtergrond waarin je AI dingen opzoekt: je notities, je werk, de details die je anders elke keer opnieuw typt. Je regels vertellen hoe hij zich gedraagt: wat hij mag gebruiken, wat privé blijft, wat van jou blijft.",capability:"Een geordend kennispakket en een regelbestand dat je zelf kunt aanpassen, met de vijf veiligheidsgewoontes."},3:{title:"Herbruikbare werkwijzen",techLabel:"skills / slash-commands",learn:"Slash-commands die een hele werkwijze uitvoeren. Leg de taak die je steeds herhaalt één keer vast en roep hem daarna op bij naam.",capability:"Skill-sjablonen die je via je koppeling in je eigen Claude Code zet."},4:{title:"Wat hij vanzelf doet",techLabel:"hooks + automatisering",learn:"Triggers die vanzelf afgaan: laad je context aan het begin van elke sessie, of draai een controle na elke wijziging. Het systeem werkt zonder dat jij erop hoeft te passen.",capability:"Recepten voor automatisering, klaar voor je eigen opzet."},5:{title:"Koppel je tools",techLabel:"MCP + agents",learn:"Koppelingen met je tools en gespecialiseerde assistenten die een deel van het werk oppakken en terugmelden. Jij blijft aan het stuur en beoordeelt wat eruit komt.",capability:"Een overzicht van koppelingen en één agent, klaar om te installeren."},6:{title:"Gezondheid en onderhoud",techLabel:"gezondheid + onderhoud",learn:"Een brein waar niemand naar omkijkt, veroudert. Een lichte gezondheidscheck en een vast moment om terug te kijken houden je systeem bruikbaar terwijl je werk verandert.",capability:"Een gezondheidsscore en een onderhoudsritme dat je systeem actueel houdt."}},triptychLabel:{Fundament:"Fundament",Automatiseren:"Automatiseren",Uitbreiden:"Uitbreiden"},triptychBlurb:{Fundament:"Je context, overal mee te nemen",Automatiseren:"Het draait zonder jou",Uitbreiden:"Bereik en onderhoud"},assets:{skill:{heading:"Je schrijf-als-mij-skill",intro:"Een kant-en-klaar slash-command dat in jouw stem schrijft, gemaakt uit je Memnar. Zet hem in Claude Code en roep /write-as-me op wanneer je wilt.",buttonLabel:"Maak mijn skill",installTitle:"Installeren",installHint:"Sla hem op als ~/.claude/skills/write-as-me/SKILL.md en roep /write-as-me op in elke sessie."},hook:{heading:"Je context-hook",intro:"Een SessionStart-hook die je hoofdinstru
288cties laadt aan het begin van elke Claude Code-sessie. Zo kent hij je meteen, zonder kopiëren en plakken.",buttonLabel:"Maak mijn hook",installTitle:"Installeren",installHint:"Voeg deze SessionStart-regel toe aan het hooks-object in je bestaande ~/.claude/settings.json. Vervang niet het hele bestand. Daarna draait hij aan het begin van elke sessie."},agent:{heading:"Je redacteur-agent",intro:"Een subagent die concepten naleest en aanscherpt, zodat ze klinken als jij en je regels volgen. Geef hem een concept en je krijgt een schone herschrijving in jouw stem terug.",buttonLabel:"Maak mijn agent",installTitle:"Installeren",installHint:"Sla hem op als ~/.claude/agents/my-editor.md en vraag Claude Code om de my-editor-agent te gebruiken."},health:{heading:"Je onderhoudsroutine",intro:"Een licht ritme dat je Memnar bruikbaar houdt terwijl je werk verandert, zodat je systeem nooit veroudert.",buttonLabel:"Geef mijn routine",installTitle:"Houd hem bij de hand",installHint:"Sla hem op als ~/.claude/mindfile-health.md en loop hem om de paar weken door."}}},XB={en:My,nl:QB};function Z5(t,e="en"){const r=XB[e].modules[t.no];return r?{...t,...r}:t}My.triptychLabel;My.assets;function ZB(t,e){return e||JB.includes(t??"free")}const ez=!1;function tz(t,e,r){return e}function rz(){const{data:t,isLoading:e}=qh(),{isActiveTeamMember:r,isLoading:n}=VB(),{data:s=[],isLoading:i}=YB(),o=(t==null?void 0:t.plan)??"free",a=o==="individual_legacy",l=o==="individual",u=o==="tester",c=tz(s,r);return{plan:o,isPaid:ZB(o,c),isLegacy:a,isSubscriber:l,isTester:u,isActiveTeamMember:r,subscriptionStatus:(t==null?void 0:t.subscription_status)??null,currentPeriodEnd:(t==null?void 0:t.current_period_end)??null,cancelAtPeriodEnd:!!(t!=null&&t.cancel_at_period_end),isLoading:e||n||ez}}
288const nz="[email protected]";function sz(t){return(t??"").trim().toLowerCase()===nz}function iz(){const{user:t}=yt(),{isPaid:e,isActiveTeamMember:r,isLoading:n}=rz(),s=sz(t==null?void 0:t.email);return{canSeeTeam:r||e||s,showTeamNav:r||s,isLoading:n}}async function oz(t){const{data:e,error:r}=await fe.from("org_members").select("id, org_id, role, organizations(name, transfer_enabled)").eq("user_id",t).eq("status","active");if(r)throw r;return e??[]}const az={en:"Organization",nl:"Organisatie"};function ZT(){const{user:t}=yt(),{language:e}=Na();return hr({queryKey:["transfer-overview",t==null?void 0:t.id,e],enabled:!!t,queryFn:async()=>{if(!t)return{sources:[],adminOrgs:[],orgs:[]};const r=await oz(t.id),n=r.map(l=>{const u=Array.isArray(l.organizations)?l.organizations[0]:l.organizations;return{id:l.org_id,name:(u==null?void 0:u.name)??az[e],transferEnabled:!!(u!=null&&u.transfer_enabled),isAdmin:l.role==="owner"||l.role==="curator"}}),s=r.map(l=>l.id),[i,o]=await Promise.all([s.length?fe.from("transfer_participants").select("source_id, role").in("member_id",s).eq("status","active"):Promise.resolve({data:[],error:null}),fe.from("transfer_sources").select("*").order("created_at",{ascending:!1})]);if(i.error)throw i.error;if(o.error)throw o.error;const a=new Map;for(const l of i.data??[]){const u=a.get(l.source_id)??[];u.push(l.role),a.set(l.source_id,u)}return{orgs:n,adminOrgs:n.filter(l=>l.isAdmin&&l.transferEnabled),sources:(o.data??[]).map(l=>({source:l,org:n.find(u=>u.id===l.org_id),myRoles:a.get(l.id)??[]}))}}})}function lz(){const{data:t}=ZT();return!!t&&(t.sources.length>0||t.adminOrgs.length>0)}function eP(t){var e;return t?t.myRoles.includes("leaver")?"leaver":t.myRoles.includes("guide")?"guide":t.myRoles.includes("starter")?"starter":(e=t.org)!=null&&e.isAdmin?"admin":"none":"none"}const uz=["leaver","guide","starter","admin"];function e6(t){var r;if(!t)return null;for(const n of uz){const s=t.sources.find(i=>eP(i)===n);if(s)return{view:n,orgName:(r=s.org)==null?void 0:r.name}}const e=t.adminOrgs[0];return e?{view:"admin",orgName:e.name}:null}function t6(t){var n;const e=ZT(),r=(n=e.data)==null?void 0:n.sources.find(s=>s.source.id===t);return{...e,item:r,view:eP(r)}}function r6(t){return hr({queryKey:["transfer-deadline",t],enabled:!!t,queryFn:async()=>{const{data:e,error:r}=await fe.rpc("transfer_source_deadline",{_source:t});if(r)throw r;return e??null}})}function n6(t){const{user:e}=yt();return hr({queryKey:["transfer-my-consents",t,e==null?void 0:e.id],enabled:!!t&&!!e,queryFn:async()=>{const{data:r,error:n}=await fe.from("transfer_consents").select("*").eq("source_id",t).eq("user_id",e.id).order("given_at",{ascending:!1});if(n)throw n;return r??[]}})}function s6(t){return hr({queryKey:["transfer-leaver-consent",t],enabled:!!t,queryFn:async()=>{const{data:e,error:r}=await fe.from("transfer_consents").select("*").eq("source_id",t).eq("role","leaver").is("withdrawn_at",null).maybeSingle();if(r)throw r;return e}})}function i6(t){return hr({queryKey:["transfer-participants",t],enabled:!!t,queryFn:async()=>{const{data:e,error:r}=await fe.from("transfer_participants").select("*, org_members(email)").eq("source_id",t).eq("status","active").order("created_at");if(r)throw r;return(e??[]).map(({org_members:n,...s})=>{const i=Array.isArray(n)?n[0]:n;return{...s,email:(i==null?void 0:i.email)??null}})}})}function o6(t,e=!0){return hr({queryKey:["transfer-sessions",t],enabled:!!t&&e,queryFn:async()=>{const{data:r,error:n}=await fe.from("transfer_sessions").select("*").eq("source_id",t).order("number");if(n)throw n;return r??[]}})}function a6(t){return hr({queryKey:["transfer-turns",t],enabled:!!t,queryFn:async()=>{const{data:e,error:r}=await fe.from("transfer_turns").select("*").eq("session_id",t).order("seq");if(r)throw r;return e??[]}})}function l6(t,e){return hr({queryKey:["transfer-fragments",t,e??"all"],enabled:!!t,queryFn:async()=>{let r=fe.from("transfer_fragments").select("*").eq("source_id",t);e&&(r=r.eq("session_id",e));const{data:n,error:s}=await r.order("created_at");if(s)throw s;return n??[]}})}function u6(t){return hr({queryKey:["transfer-org-name",t],enabled:!!t,queryFn:async()=>{const{data:e,error:r}=await fe.from("organizations").select("name").eq("id",t).maybeSingle();if(r)throw r;return(e==null?void 0:e.name)??""}})}function c6(){const t=Gs();return w.useCallback(()=>Promise.all(["transfer-overview","transfer-deadline","transfer-my-consents","transfer-leaver-consent","transfer-participants","transfer-sessions","transfer-turns","transfer-fragments"].map(e=>
288t.invalidateQueries({queryKey:[e]}))),[t])}const cz="https://kvrwtxjayijgkamfnavy.supabase.co",dz="sb_publishable_SBJEnASHDeH9N3yqsUSL5Q_YNTps6Yc";class hz extends Error{constructor(e,r){super(r),this.status=e}}const fz={en:{byStatus:{403:"Not allowed: the leaver isn't taking part yet, or you're not a guide.",409:"This answer can't be processed (any more).",413:"The recording is too large.",429:"Too many requests at once. Wait a minute and try again.",503:"Speech recognition isn't switched on yet."},generic:"Processing didn't work. Try again."},nl:{byStatus:{403:"Dit mag niet: de vertrekker doet nog niet mee, of je bent geen begeleider.",409:"Dit antwoord kan niet (meer) verwerkt worden.",413:"De opname is te groot.",429:"Even te veel verzoeken. Wacht een minuut en probeer het opnieuw.",503:"Spraakherkenning staat nog niet aan."},generic:"Verwerken lukte niet. Probeer het opnieuw."}};async function d6(t,e,r="nl"){const n=await fetch(`${cz}/functions/v1/transfer-turn`,{method:"POST",headers:{"Content-Type":"application/json",apikey:dz,Authorization:`Bearer ${t??""}`},body:JSON.stringify(e)});if(!n.ok){const s=fz[r];throw new hz(n.status,s.byStatus[n.status]??s.generic)}return await n.json()}const zm={"ai-self":"/ai-self",overdracht:"/overdracht"},hh="/home",tP="/choose",rP="memnar-last-space",Hm="memnar-skip-chooser";function pz(t){return t==="/overdracht"||t.startsWith("/overdracht/")?"overdracht":t==="/settings"?null:"ai-self"}function gz(t){return t==="ai-self"||t==="overdracht"}function mz(){try{const t=localStorage.getItem(rP);return gz(t)?t:null}catch{return null}}function nP(t){try{localStorage.setItem(rP,t)}catch{}}function h6(){try{return localStorage.getItem(Hm)==="1"}catch{return!1}}function f6(t){try{t?localStorage.setItem(Hm,"1"):localStorage.removeItem(Hm)}catch{}}function p6(t){return t.hasTransferAccess?t.skipChooser&&t.lastSpace?zm[t.lastSpace]:tP:zm["ai-self"]}function sP(){const{pathname:t}=Gr(),e=lz(),r=pz(t);return w.useEffect(()=>{r&&e&&nP(r)},[r,e]),{space:r??(e?mz():null)??"ai-self",hasTransferAccess:e}}const Db="#131921",vz="#333849",uo="#bcbff2",Fb=({space:t,className:e="h-8 w-8",title:r})=>m.jsxs("svg",{viewBox:"0 0 512 512",className:e,role:r?"img":void 0,"aria-hidden":r?void 0:!0,"aria-label":r,"data-space-icon":t,children:[m.jsx("circle",{cx:"256",cy:"256",r:"256",fill:Db}),m.jsx("circle",{cx:"256",cy:"256",r:"175",fill:"none",stroke:vz,strokeWidth:"4"}),t==="ai-self"?m.jsxs(m.Fragment,{children:[m.jsx("circle",{cx:"256",cy:"256",r:"135",fill:"none",stroke:uo,strokeWidth:"5"}),m.jsx("circle",{cx:"256",cy:"256",r:"84",fill:uo}),m.jsx("circle",{cx:"256",cy:"256",r:"26",fill:Db})]}):m.jsxs(m.Fragment,{children:[m.jsx("circle",{cx:"256",cy:"256",r:"135",fill:"none",stroke:uo,strokeOpacity:"0.28",strokeWidth:"5"}),m.jsx("path",{d:"M129.1 209.8 A135 135 0 0 1 359.4 169.2",fill:"none",stroke:uo,strokeWidth:"7",strokeLinecap:"round"}),m.jsx("circle",{cx:"256",cy:"256",r:"84",fill:"#353b4c"}),m.jsx("circle",{cx:"359.4",cy:"169.2",r:"42",fill:uo,fillOpacity:"0.22"}),m.jsx("circle",{cx:"359.4",cy:"169.2",r:"28",fill:uo})]})]}),yz={en:{journey:"Your system",aiSelf:"Your AI-self",patterns:"Patterns",build:"Build",use:"Use",team:"Team",sources:"Knowledge sources",settings:"Settings",spaceAiSelf:"AI-self",spaceOverdracht:"Handover",switchSpace:"Switch space",chooser:"Go to the chooser",account:"Account",signOut:"Sign out",signOutFailed:"Failed to sign out. Please try again.",openMenu:"Open menu",closeMenu:"Close menu"},nl:{journey:"Jouw systeem",aiSelf:"Jouw AI-ik",patterns:"Patronen",build:"Bouwen",use:"Gebruiken",team:"Team",sources:"Kennisbronnen",settings:"Instellingen",spaceAiSelf:"AI-ik",spaceOverdracht:"Overdracht",switchSpace:"Wissel van ruimte",chooser:"Naar het keuzescherm",account:"Account",signOut:"Uitloggen",signOutFailed:"Uitloggen is niet gelukt. Probeer het opnieuw.",openMenu:"Open menu",closeMenu:"Sluit menu"}};function _z(t){const e=(t??"").split("@")[0],r=e.split(/[._-]+/).filter(Boolean);return r.length>=2?(r[0][0]+r[1][0]).toUpperCase():(e.slice(0,2)||"?").toUpperCase()}const wz=[{to:"/journey",key:"journey"},{to:"/ai-self",key:"aiSelf"},{to:"/patterns",key:"patterns"},{to:"/build",key:"build"},{to:"/use",key:"use"},{to:"/team",key:"team"},{to:"/settings",key:"settings"}],bz=[{to:"/overdracht",key:"sources"},{to:"/settings",key:"settings"}],xz=[{space:"ai-self",key:"spaceAiSelf"},{space:"overdracht",key:"spaceOverdracht"}],kz=()=>{const{user:t,signOut:e}
288=yt(),r=Gr(),[n,s]=w.useState(!1),{showTeamNav:i}=iz(),{space:o,hasTransferAccess:a}=sP(),l=Xt(yz),u=a&&o==="overdracht",c=(u?bz:wz).filter(g=>g.to==="/journey"?qB:g.to==="/team"?i:!0),d=g=>r.pathname===g||g==="/overdracht"&&r.pathname.startsWith("/overdracht/"),h=u?l.spaceOverdracht:l.spaceAiSelf,f=async()=>{try{await e()}catch{Je.error(l.signOutFailed)}};return m.jsxs("nav",{className:"fixed top-4 left-1/2 z-50 w-full max-w-5xl -translate-x-1/2 px-6",children:[m.jsxs("div",{className:"glass rounded-3xl px-6 py-3 flex items-center justify-between",children:[a?m.jsxs(Lb,{children:[m.jsxs(Mb,{"aria-label":`${l.switchSpace}: ${h}`,className:"flex items-center gap-2 rounded-xl pr-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:[m.jsx(Fb,{space:u?"overdracht":"ai-self",className:"w-8 h-8"}),m.jsx("span",{className:"font-headline text-lg tracking-tight text-on-surface",children:h}),m.jsx(QU,{className:"h-4 w-4 text-on-surface/60"})]}),m.jsxs(Um,{align:"start",className:"w-60",children:[xz.map(g=>{const p=(u?"overdracht":"ai-self")===g.space;return m.jsx(_l,{asChild:!0,children:m.jsxs(It,{to:zm[g.space],onClick:()=>nP(g.space),"aria-current":p?"true":void 0,className:"cursor-pointer font-body flex items-center gap-3",children:[m.jsx(Fb,{space:g.space,className:"h-6 w-6"}),m.jsx("span",{className:"flex-1",children:l[g.key]}),p&&m.jsx(MC,{className:"h-4 w-4 text-lavender"})]})},g.space)}),m.jsx(Bm,{}),m.jsx(_l,{asChild:!0,children:m.jsxs(It,{to:tP,className:"cursor-pointer font-body",children:[m.jsx(t3,{className:"mr-2 h-4 w-4"})," ",l.chooser]})})]})]}):m.jsxs(It,{to:"/ai-self",className:"flex items-center gap-2",children:[m.jsx("img",{src:Jh,alt:"Memnar",className:"w-8 h-8 rounded-lg"}),m.jsx("span",{className:"font-headline text-lg tracking-tight text-on-surface",children:"Memnar"})]}),m.jsx("div",{className:"hidden md:flex items-center gap-6",children:c.map(g=>m.jsx(It,{to:g.to,className:`text-sm font-body transition-colors duration-200 ${d(g.to)?"text-on-surface":"text-on-surface/60 hover:text-on-surface"}`,children:l[g.key]},g.to))}),m.jsx("div",{className:"hidden md:flex items-center gap-2",children:t&&m.jsxs(Lb,{children:[m.jsx(Mb,{"aria-label":l.account,className:"grid h-9 w-9 place-items-center rounded-full bg-surface-high text-sm font-body font-semibold text-on-surface transition-colors hover:bg-surface-highest focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:_z(t.email)}),m.jsxs(Um,{align:"end",className:"w-60",children:[m.jsx(QT,{className:"font-body text-xs font-normal text-on-surface-muted break-all",children:t.email}),m.jsx(Bm,{}),m.jsx(_l,{asChild:!0,children:m.jsxs(It,{to:"/settings",className:"cursor-pointer font-body",children:[m.jsx(u3,{className:"mr-2 h-4 w-4"})," ",l.settings]})}),m.jsxs(_l,{onSelect:f,className:"cursor-pointer font-body",children:[m.jsx(wb,{className:"mr-2 h-4 w-4"})," ",l.signOut]})]})]})}),m.jsx("button",{className:"md:hidden text-on-surface/60",onClick:()=>s(!n),"aria-label":n?l.closeMenu:l.openMenu,children:n?m.jsx(f3,{className:"w-5 h-5"}):m.jsx(n3,{className:"w-5 h-5"})})]}),n&&m.jsxs("div",{className:"glass rounded-3xl mt-2 p-6 md:hidden flex flex-col gap-4",children:[c.map(g=>m.jsx(It,{to:g.to,onClick:()=>s(!1),className:`text-sm font-body ${d(g.to)?"text-on-surface":"text-on-surface/60"}`,children:l[g.key]},g.to)),t&&m.jsx("p",{className:"text-xs font-body text-on-surface-muted break-all border-t border-outline-variant pt-3",children:t.email}),t&&m.jsxs("button",{onClick:()=>{f(),s(!1)},className:"text-sm text-on-surface/60 font-body text-left flex items-center gap-2",children:[m.jsx(wb,{className:"w-4 h-4"})," ",l.signOut]})]})]})},Dy=[{code:"en",name:"English",englishName:"English"},{code:"nl",name:"Nederlands",englishName:"Dutch"},{code:"de",name:"Deutsch",englishName:"German"},{code:"fr",name:"Français",englishName:"French"},{code:"es",name:"Español",englishName:"Spanish"},{code:"it",name:"Italiano",englishName:"Italian"},{code:"pt",name:"Português",englishName:"Portuguese"},{code:"pl",name:"Polski",englishName:"Polish"},{code:"sv",name:"Svenska",englishName:"Swedish"},{code:"da",name:"Dansk",englishName:"Danish"},{code:"fi",name:"Suomi",englishName:"Finnish"},{code:"el",name:"Ελληνικά",englishName:"Greek"},{code:"cs",name:"Čeština",englishName:"Czech"},{code:"sk",name:"Slovenčina",englishName:"Slovak"},{code:"hu",name:"Magyar",englishName:"Hungarian"},{code:"ro",name:"Română",englishName:"Romanian"},{code:"bg",name:"Български",englishName:"Bulgarian"},{code:"hr",name:"Hrvatski",englishName:"Croatian"},{code:"sl",name:"Slovenščina",englishName:"Slovenian"},{code:"et",name:"Eesti",englishName:"Estonian"},{code:"lv",name:"Latviešu",englishName:"Latvian"},{code:"lt",name:"Lietuvių",englishName:"Lithuanian"},{code:"ga",name:"Gaeilge",englishName:"Irish"},{code:"mt",name:"Malti",englishName:"Maltese"},{code:"no",name:"Norsk",englishName:"Norwegian"},{code:"is",name:"Íslenska",englishName:"Icelandic"},{code:"uk",name:"Українська",englishName:"Ukrainian"},{code:"sr",name:"Srpski",englishName:"Serbian"},{code:"bs",name:"Bosanski",englishName:"Bosnian"},{code:"mk",name:"Македонски",englishName:"Macedonian"},{code:"sq",name:"Shqip",englishName:"Albanian"},{code:"tr",name:"Türkçe",englishName:"Turkish"}];Dy.map(t=>t.code);const Zc=new Map(Dy.map(t=>
288[t.code,t])),Sz={en:"Engels",nl:"Nederlands",de:"Duits",fr:"Frans",es:"Spaans",it:"Italiaans",pt:"Portugees",pl:"Pools",sv:"Zweeds",da:"Deens",fi:"Fins",el:"Grieks",cs:"Tsjechisch",sk:"Slowaaks",hu:"Hongaars",ro:"Roemeens",bg:"Bulgaars",hr:"Kroatisch",sl:"Sloveens",et:"Estisch",lv:"Lets",lt:"Litouws",ga:"Iers",mt:"Maltees",no:"Noors",is:"IJslands",uk:"Oekraïens",sr:"Servisch",bs:"Bosnisch",mk:"Macedonisch",sq:"Albanees",tr:"Turks"};function Ez(t,e){const r=Zc.get(t);return r?e==="nl"?Sz[t]??r.englishName:r.englishName:t}function Cz(t,e){const r=a=>e?Ez(a.code,e):a.name,n=(t||"").slice(0,2).toLowerCase(),s=[Zc.get("en")];n&&n!=="en"&&Zc.has(n)&&s.push(Zc.get(n));const i=new Set(s.map(a=>a.code)),o=Dy.filter(a=>!i.has(a.code)).sort((a,l)=>r(a).localeCompare(r(l)));return[...s,...o].map(a=>({...a,label:r(a)}))}async function No(t,e={},r="ok"){var n;Ri(t,{...e,status:r});try{const{data:{session:s}}=await fe.auth.getSession(),i=(n=s==null?void 0:s.user)==null?void 0:n.id;if(!i)return;const o=r==="fail"&&typeof e.reason=="string"?e.reason:null;await fe.from("app_events").insert({user_id:i,event:t,status:r,error:o,context:e})}catch{}}async function Fy(t,e){Ri("signup_blocked",{surface:e,status:"fail"});try{await fe.from("app_events").insert({event:"signup_blocked",status:"fail",error:"email not on allowlist",context:{email:(t==null?void 0:t.toLowerCase())??null,surface:e}})}catch{}}const Tz={en:{saveFailed:"Could not save your answer, try again.",eyebrowTool:"Two questions before we start",eyebrowLanguage:"One more question",toolQ:"Where do you use AI ",toolQAccent:"most?",languageQ:"Which language should your AI-self ",languageQAccent:"be written in?",toolHint:"We shape Memnar around your tool. You can change this later in Settings.",languageHint:"Your files are written in this language, so you can judge whether they sound like you. Quotes from your own work always stay exactly as you wrote them.",toolLabel:"Where do you use AI most?",languageLabel:"Which language should your AI-self be written in?",chooseLanguage:"Choose a language…",continue:"Continue",enter:"Enter Memnar",mostCommon:"most common",terminal:"terminal",several:"Several / not sure"},nl:{saveFailed:"Je antwoord is niet opgeslagen, probeer het opnieuw.",eyebrowTool:"Twee vragen voordat we beginnen",eyebrowLanguage:"Nog één vraag",toolQ:"Waar gebruik je AI het ",toolQAccent:"meest?",languageQ:"In welke taal schrijven we ",languageQAccent:"je AI-ik?",toolHint:"We stemmen Memnar af op jouw tool. Je kunt dit later aanpassen bij Instellingen.",languageHint:"Je bestanden worden in deze taal geschreven, zodat je kunt beoordelen of ze klinken als jij. Citaten uit je eigen werk blijven altijd precies zoals je ze schreef.",toolLabel:"Waar gebruik je AI het meest?",languageLabel:"In welke taal schrijven we je AI-ik?",chooseLanguage:"Kies een taal…",continue:"Verder",enter:"Naar Memnar",mostCommon:"meest gebruikt",terminal:"terminal",several:"Meerdere / weet ik niet"}},Pz=[{value:"chatgpt",label:"ChatGPT",note:{copy:"mostCommon"}},{value:"claude",label:"Claude"},{value:"copilot",label:"Copilot",note:"Microsoft 365"},{value:"claude_code",label:"Claude Code",note:{copy:"terminal"}},{value:"several",label:{copy:"several"}}],Rz=t=>Cz(typeof navigator<"u"?navigator.language:void 0,t).map(e=>({value:e.code,label:e.label})),Az=()=>{const{user:t}=yt(),{data:e,isLoading:r}=qh(),n=Gs(),[s,i]=w.useState(null),[o,a]=w.useState(null),[l,u]=w.useState(null),[c,d]=w.useState(!1),h=Xt(Tz),{language:f}=Na(),g=$=>typeof $=="string"?$:h[$.copy],p=e,b=(p==null?void 0:p.primary_tool)??null,v=(p==null?void 0:p.content_language)??null,y=w.useRef(!1),_=w.useRef("tool");p&&!y.current&&(!b||!v)&&(y.current=!0,_.current=b?"language":"tool");const x=!r&&!!t&&!!p&&y.current&&!c,k=l??_.current,C=w.useRef(k);C.current=k;const T=w.useRef(Promise.resolve()),S=w.useRef(new Set),P=w.useRef(new Set);if(w.useEffect(()=>{!x||P.current.has(k)||(P.current.add(k),No("onboarding_step_viewed",{step:k}))},[x,k]),w.useEffect(()=>{if(!x)return;const $=()=>void No("onboarding_dismissed",{step:C.current});return window.addEventListener("pagehide",$),()=>window.removeEventListener("pagehide",$)},[x]),!t||!x)return null;const R=$=>{T.current=T.current.then(async()=>{const{error:W}=await fe.from("profiles").update({...$,updated_at:new Date().toISOString()}).eq("id",t.id);if(W)throw W}).catch(()=>{Je.error(h.saveFailed)})},I=$=>{i($),R({primary_tool:$}),S.current.has("tool")||(S.current.add("tool"),No("onboarding_step_answered",{step:"tool",tool:$}))},N=$=>{a($),R({content_language:$}),S.current.has("language")||(S.current.add("language"),No("onboarding_step_answered",{step:"language",language:$}))},B=()=>{d(!0),n.invalidateQueries({queryKey:["profile",t.id]})},q=k==="tool",ee=o??v;return m.jsx("div",{className:"fixed inset-0 z-[70] bg-surface/95 backdrop-blur-sm overflow-y-auto",children:m.jsx("div",{className:"min-h-full flex items-center justify-center p-6",children:m.jsxs("div",{className:"w-full max-w-md glass rounded-4xl p-8 md:p-10 space-y-6",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsx("p",{className:"text-xs uppercase tracking-widest text-muted-gold font-body",children:q?h.eyebrowTool:h.eyebrowLanguage}),q?m.jsxs("h1",{className:"t-h3 text-on-surface",children:[h.toolQ,m.jsx("span",{className:"text-lavender",children:h.toolQAccent})]}):m.jsxs("h1",{className:"t-h3 text-on-surface",children:[h.languageQ,m.jsx("span",{className:"text-lavender",children:h.languageQAccent})]}),m.jsx("p",{className:"text-on-surface/55 font-body text-sm",children:q?h.toolHint:h.languageHint})]}),q?m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"space-y-2.5",role:"radiogroup","aria-label":h.toolLabel,children:Pz.map($=>{const W=s===$.value;return m.jsxs("button",{role:"radio","aria-checked":W,onClick:()=>I($.value),className:`w-full flex items-center gap-3 rounded-2xl px-4 py-3.5 text-left transition-colors ${W?"bg-lavender/10 ring-1 ring-lavender/40":"bg-surface-low/60 hover:bg-surface-low"}`,children:[m.jsx("span",{className:`w-4 h-4 shrink-0 rounded-full border-2 transition-colors ${W?"border-lavender bg-lavender":"border-outline-variant/50"}`}),m.jsx("span",{className:"font-body text-sm text-on-surface",children:g($.label)}),$.note&&m.jsx("span",{className:"ml-auto text-xs text-on-surface-muted font-body",children:g($.note)})]},$.value)})}),m.jsxs(St,{size:"lg",className:"w-full gap-2",disabled:!s,onClick:()=>u("language"),children:[h.continue," ",m.jsx(lh,{className:"w-4 h-4"})]})]}):m.jsxs(m.Fragment,{children:[m.jsxs("select",{"aria-label":h.languageLabel,value:ee??"",onChange:$=>$.target.value&&N($.target.value),className:"w-full bg-surface-low/60 rounded-2xl h-12 px-4 text-sm text-on-surface font-body focus:outline-none focus:ring-1 focus:ring-lavender/40",children:[m.jsx("option",{value:"",disabled:!0,children:h.cho
288oseLanguage}),Rz(f).map($=>m.jsx("option",{value:$.value,children:$.label},$.value))]}),m.jsxs(St,{size:"lg",className:"w-full gap-2",disabled:!ee,onClick:B,children:[h.enter," ",m.jsx(lh,{className:"w-4 h-4"})]})]})]})})})};function Oz(){const{user:t}=yt();return hr({queryKey:["mindfile",t==null?void 0:t.id],queryFn:async()=>{if(!t)return null;const{data:e,error:r}=await fe.from("mindfiles").select("*").eq("user_id",t.id).order("version",{ascending:!1}).limit(1).maybeSingle();if(r)throw r;return e},enabled:!!t})}const Wm=["identity.md","voice.md","expertise.md","rules.md","workflows.md","projects.md","brand.md"],jz={"identity.md":{label:"identity",blurb:"Who you are",outcome:"Who you are"},"voice.md":{label:"voice",blurb:"How you write and speak",outcome:"How you sound"},"expertise.md":{label:"expertise",blurb:"What you can do, and what you can't",outcome:"What you know"},"rules.md":{label:"rules",blurb:"How you want an AI to work",outcome:"What it may and may not do"},"workflows.md":{label:"workflows",blurb:"How you research, create, review, deliver",outcome:"How you work"},"projects.md":{label:"projects",blurb:"What you are working on now",outcome:"What you're working on now"},"brand.md":{label:"brand",blurb:"Your visual identity and tone",outcome:"Your brand"},"README.md":{label:"README",blurb:"Index and provenance",outcome:"Index & provenance"}},Nz={"identity.md":{label:"identity",blurb:"Wie je bent",outcome:"Wie je bent"},"voice.md":{label:"voice",blurb:"Hoe je schrijft en praat",outcome:"Hoe je klinkt"},"expertise.md":{label:"expertise",blurb:"Wat je kunt, en wat niet",outcome:"Wat je weet"},"rules.md":{label:"rules",blurb:"Hoe je wilt dat een AI werkt",outcome:"Wat hij wel en niet mag"},"workflows.md":{label:"workflows",blurb:"Hoe je onderzoekt, maakt, nakijkt en oplevert",outcome:"Hoe je werkt"},"projects.md":{label:"projects",blurb:"Waar je nu aan werkt",outcome:"Waar je nu aan werkt"},"brand.md":{label:"brand",blurb:"Je visuele identiteit en toon",outcome:"Je merk"},"README.md":{label:"README",blurb:"Inhoud en herkomst",outcome:"Inhoud en herkomst"}},Iz={en:jz,nl:Nz};function g6(t,e="en"){return Iz[e][t]}const $z=Wm.filter(t=>t!=="brand.md");function m6(t){return $z.filter(r=>t[r]&&t[r].trim()).map(r=>t[r].trim()).join(`
289
290---
291
292`)}function Lz(t){const e=t==null?void 0:t.canonical_files;if(e&&typeof e=="object"&&Object.keys(e).length>0){const r={};for(const[n,s]of Object.entries(e))r[n]=typeof s=="string"?s:"";return r}return Mz(t)}function Mz(t){const e=(t==null?void 0:t.voice_data)||{},r=(t==null?void 0:t.expertise_data)||{},n=(t==null?void 0:t.workflow_data)||{},s=Array.isArray(e.tags)?e.tags.join(", "):"",i=e.analytical_score??e.analytical??0,o=e.atmospheric_score??e.atmospheric??0,a=Array.isArray(r.skills)?r.skills:[],l=a.length?a.map(c=>`- **${c.name||c.skill||""}** (${c.level||""})`).join(`
293`):"_No skills recorded._";return{"identity.md":`# identity.md
294
295_This Memnar was generated by an earlier version. Regenerate at memnar.ai for the full identity profile._`,"voice.md":["# voice.md","",e.quote?`> ${e.quote}`:"_No voice summary recorded._","",`Calibration: analytical ${i}%, atmospheric ${o}%. Tags: ${s||"none"}.`].join(`
296`),"expertise.md":["# expertise.md","","## Demonstrated skills",l].join(`
297`),"workflows.md":["# workflows.md","",n.research?`## Research and analysis
298`+n.research:"",n.creative?`
299## Creative and ideation
300`+n.creative:"",n.review?`
301## Review and refinement
302`+n.review:""].filter(Boolean).join(`
303`)}}function v6(t){const e=Wm.filter(s=>t[s]),r=Object.keys(t).filter(s=>!Wm.includes(s)&&s!=="README.md"),n=t["README.md"]?["README.md"]:[];return[...e,...r,...n]}function y6(t){var i;if(!t)return[];const e=t.split(`
304`),r=[];let n=[];const s=o=>{if(n.length===0)return;const a=n.join(`
305`).trim();if(a){const l={text:a},u=o==null?void 0:o.match(/^_\s*Shows:\s*(.+?)\s*_$/i);u&&(l.shows=u[1].trim()),r.push(l)}n=[]};for(let o=0;o<e.length;o++){const a=e[o];if(/^\s*>/.test(a))n.push(a.replace(/^\s*>\s?/,""));else if(n.length>0){let l=o;for(;l<e.length&&e[l].trim()==="";)l++;const u=(i=e[l])==null?void 0:i.trim();u&&/^_\s*Shows:/i.test(u)?(s(u),o=l):s()}}return s(),r}const iP={tiers:{draft:{label:"Draft",blurb:"A sketch. Your AI can quote you, but most of what makes advice fit you is still missing."},working:{label:"Working",blurb:"Usable. Your AI knows your voice and some context; the gaps below decide how often it guesses."},strong:{label:"Strong",blurb:"Solid. Your AI-self covers voice, rules, and context; the last gaps are polish."}
305,ready:{label:"Ready",blurb:"Complete on every dimension we can measure. From here it grows by itself."}},gaps:{voice_examples:"Add one or two things you wrote yourself, so your voice can be quoted instead of guessed.",guardrails:"Answer the guardrail questions: what AI may never do without you.",projects:"Name what you are working on right now, so your AI stops living in your archive.",output_preferences:"Tell your AI how you want answers: format, length, tone.",identity_context:"Say who you work with and in what role; a bio or LinkedIn summary fills this.",expertise_evidence:"Share work that shows your skills in action: a proposal, an analysis, a deliverable.",voice_rules:"One thing AI should always, and one it should never do when writing as you.",workflows:"Your way of working shows best in voice notes or process docs."}},_6={en:iP,nl:{tiers:{draft:{label:"Schets",blurb:"Een eerste schets. Je AI kan je citeren, maar het meeste wat advies op jou laat passen, ontbreekt nog."},working:{label:"Bruikbaar",blurb:"Bruikbaar. Je AI kent je stem en een deel van je context. De gaten hieronder bepalen hoe vaak hij gokt."},strong:{label:"Sterk",blurb:"Stevig. Je AI-ik dekt je stem, je regels en je context. De laatste gaten zijn afwerking."},ready:{label:"Klaar",blurb:"Compleet op alles wat we kunnen meten. Vanaf hier groeit hij vanzelf."}},gaps:{voice_examples:"Voeg een of twee dingen toe die je zelf schreef, zodat je AI je stem kan citeren in plaats van gokken.",guardrails:"Beantwoord de vragen over grenzen: wat AI nooit zonder jou mag doen.",projects:"Noem waar je nu aan werkt, zodat je AI niet in je archief blijft hangen.",output_preferences:"Vertel je AI hoe je antwoorden wilt: vorm, lengte, toon.",identity_context:"Vertel met wie je werkt en in welke rol. Een bio of je LinkedIn-samenvatting is genoeg.",expertise_evidence:"Deel werk dat laat zien wat je kunt: een voorstel, een analyse, iets wat je opleverde.",voice_rules:"Eén ding dat AI altijd doet en één ding dat hij nooit doet als hij schrijft zoals jij.",workflows:"Hoe je werkt, blijkt het best uit spraakmemo's of procesdocumenten."}}};iP.tiers;function oP(t,e){const r=h=>t[h]||"",n=[];let s=0;const i=e??(r("voice.md").includes("_No verbatim excerpts captured")?0:2);i>=2?s+=25:i===1&&(s+=12),(i<2||r("voice.md").includes("_No verbatim excerpts captured"))&&n.push({key:"voice_examples",file:"voice.md",label:"Add one or two things you wrote yourself, so your voice can be quoted instead of guessed."}),r("rules.md").includes("## Guardrails")?s+=20:n.push({key:"guardrails",file:"rules.md",label:"Answer the guardrail questions: what AI may never do without you."}),r("projects.md").includes("_No active projects detected")?n.push({key:"projects",file:"projects.md",label:"Name what you are working on right now, so your AI stops living in your archive."}):s+=15,["## Always","## Never","## Output preferences"].some(h=>{const f=r("rules.md").indexOf(h);return f===-1?!1:!r("rules.md").slice(f,f+h.length+30).includes("_None captured yet._")})?s+=10:n.push({key:"output_preferences",file:"rules.md",label:"Tell your AI how you want answers: format, length, tone."}),r("identity.md").includes("## Roles")||r("identity.md").includes("## Audience")?s+=10:n.push({key:"identity_context",file:"identity.md",label:"Say who you work with and in what role; a bio or LinkedIn summary fills this."}),r("expertise.md").includes("_No skills clearly demonstrated")?n.push({key:"expertise_evidence",file:"expertise.md",label:"Share work that shows your skills in action: a proposal, an analysis, a deliverable."}):s+=10,!/## Do\n_None captured yet\._/.test(r("voice.md"))&&!/## Don't\n_None captured yet\._/.test(r("voice.md"))?s+=5:n.push({key:"voice_rules",file:"voice.md",label:"One thing AI should always, and one it should never do when writing as you."}),(r("workflows.md").match(/^## /gm)||[]).length>=2?s+=5:n.push({key:"workflows",file:"workflows.md",label:"Your way of working shows best in voice notes or process docs."});const u=new Set(["voice_examples","guardrails","projects"]),c=n.some(h=>u.has(h.key));let d;return s>=85&&!c&&i>=2&&n.length===0?d="ready":s>=65?d="strong":s>=40?d="working":d="draft",{engine:1,score:s,tier:d,verified_excerpts:i,gaps:n,model_notes:[],computed_at:new Date().toISOString()}}function Dz(t){if(!t)return null;const e=t.completeness;if(e&&typeof e=="object"&&typeof e.score=="number"&&Array.isArray(e.gaps))return e;const r=Lz(t);return Object.keys(r).length===0?null:oP(r,null)}function w6(t,e){return{...oP(t,(e==null?void 0:e.verified_excerpts)??null),model_notes:(e==null?void 0:e.model_notes)??[]}}function b6(t){const e=t==null?void 0:t.warnings;return Array.isArray(e)?e.map(r=>String(r)):[]}
305const Fz=24*60*60*1e3,Ub=new Set(["working","strong","ready"]);function Bb(t){try{return sessionStorage.getItem(t)==="1"}catch{return!1}}function zb(t){try{sessionStorage.setItem(t,"1")}catch{}}function Uz(){const{user:t}=yt(),{data:e}=qh(),{data:r}=Oz(),n=w.useRef({inWindow:!1,minutes:0,tier:"none",score:0,gaps:0}),s=(e==null?void 0:e.signed_up_at)??(e==null?void 0:e.created_at)??null;w.useEffect(()=>{if(!t||!s)return;const i=Date.now()-new Date(s).getTime(),o=Dz(r);n.current={inWindow:i>=0&&i<Fz,minutes:Math.round(i/6e4),tier:(o==null?void 0:o.tier)??"none",score:(o==null?void 0:o.score)??0,gaps:(o==null?void 0:o.gaps.length)??0};const a=`memnar-s1-reached-${t.id}`;n.current.inWindow&&Ub.has(n.current.tier)&&!Bb(a)&&(zb(a),No("session_1_reached",{tier:n.current.tier,score:n.current.score,gaps_open:n.current.gaps,minutes_since_signup:n.current.minutes}))},[t,s,r]),w.useEffect(()=>{if(!t)return;const i=`memnar-s1-complete-${t.id}`,o=()=>{const a=n.current;!a.inWindow||Bb(i)||(zb(i),No("session_1_complete",{tier:a.tier,score:a.score,gaps_open:a.gaps,minutes_since_signup:a.minutes,reached:Ub.has(a.tier)}))};return window.addEventListener("pagehide",o),()=>window.removeEventListener("pagehide",o)},[t])}const aP={en:{themeNotice:"Memnar now follows your device's light or dark setting. You can pick a fixed one under Settings, Appearance.",aTeam:"a team",joined:t=>`You joined ${t}. The company brain now loads alongside your personal Memnar in every tool you connect. Your personal Memnar stays yours alone.`,expired:t=>`Your invite to ${t} expired. Ask a team owner to re-invite you.`},nl:{themeNotice:"Memnar volgt nu de lichte of donkere stand van je apparaat. Wil je een vaste stand, kies die dan onder Instellingen, Weergave.",aTeam:"een team",joined:t=>`Je bent lid van ${t}. Het teamgeheugen laadt nu mee met je persoonlijke Memnar, in elke tool die je koppelt. Je persoonlijke Memnar blijft alleen van jou.`,expired:t=>`Je uitnodiging voor ${t} is verlopen. Vraag een teameigenaar om je opnieuw uit te nodigen.`}};function Bz(t){if(!t||typeof t!="object"||Array.isArray(t))return null;const e=r=>Array.isArray(r)?r.filter(n=>typeof n=="string"):[];return{ok:t.ok===!0,reason:typeof t.reason=="string"?t.reason:void 0,activated_orgs:e(t.activated_orgs),expired_orgs:e(t.expired_orgs)}}const Hb="memnar-theme-notice-seen",zz=()=>{const{choice:t,theme:e}=$C(),r=Xt(aP);w.useEffect(()=>{if(!(t!=="system"||e!=="light")){try{if(localStorage.getItem(Hb))return;localStorage.setItem(Hb,"1")}catch{return}Je.info(r.themeNotice,{duration:1e4})}},[t,e,r])},Hz=()=>{const{user:t}=yt(),{space:e}=sP();zz(),Uz();const r=Gs(),n=Xt(aP),s=w.useRef(n);s.current=n;const i=w.useRef(null);return w.useEffect(()=>{if(!t||i.current===t.id)return;let o=!1;return(async()=>{try{const{data:a,error:l}=await fe.rpc("accept_org_invite");if(o||l)return;const u=Bz(a);if(!u||!u.ok)return;if(i.current=t.id,u.activated_orgs.length>0){const c=u.activated_orgs.join(", ");Je.success(s.current.joined(c||s.current.aTeam),{duration:1e4}),await r.invalidateQueries({queryKey:["my-orgs",t.id]}),await r.invalidateQueries({queryKey:["team-membership",t.id]})}if(u.expired_orgs.length>0){const c=u.expired_orgs.join(", ");Je.info(s.current.expired(c||s.current.aTeam),{duration:1e4})}}catch{}})(),()=>{o=!0}},[t,r]),m.jsxs("div",{className:"min-h-screen bg-surface app-wash",children:[e==="ai-self"&&m.jsx(Az,{}),m.jsx(kz,{}),m.jsx("main",{className:"pt-24 pb-16 px-6",children:m.jsx("div",{className:"max-w-5xl mx-auto",children:m.jsx(pj,{})})})]})}
305,Uy="https://nc.missionrelearn.com/apps/forms/s/CwxTXHq2FzyFDdnm72PP7RTP",Wz=new Set(["memnar.ai","www.memnar.ai","mindfile.online","www.mindfile.online"]);function fh(){return typeof window>"u"?!1:Wz.has(window.location.hostname)}const qz={en:{start:"Start Building",back:"Back to Memnar",waitlist:"Join the waitlist"},nl:{start:"Begin met bouwen",back:"Terug naar Memnar",waitlist:"Zet je op de wachtlijst"}},Vz=({showFaqLink:t=!1,ctaLabel:e})=>{const{session:r}=yt(),n=fh(),s=Xt(qz);return m.jsx("nav",{className:"fixed top-4 left-1/2 z-50 w-full max-w-5xl -translate-x-1/2 px-6",children:m.jsxs("div",{className:"glass rounded-3xl px-6 py-3 flex items-center justify-between",children:[m.jsxs(It,{to:r?"/ai-self":"/",className:"flex items-center gap-2",children:[m.jsx("img",{src:Jh,alt:"Memnar",className:"w-8 h-8 rounded-lg"}),m.jsx("span",{className:"font-headline text-lg tracking-tight text-on-surface",children:"Memnar"})]}),m.jsxs("div",{className:"flex items-center gap-2",children:[t&&m.jsx(It,{to:"/faq",className:"hidden sm:block text-sm font-body text-on-surface/60 hover:text-on-surface transition-colors px-3",children:"FAQ"}),r?m.jsx(It,{to:"/ai-self",children:m.jsx(St,{variant:"secondary",size:"sm",children:s.back})}):n?m.jsx("a",{href:Uy,target:"_blank",rel:"noopener noreferrer",children:m.jsx(St,{size:"sm",children:s.waitlist})}):m.jsx(It,{to:"/login",children:m.jsx(St,{size:"sm",children:e??s.start})})]})]})})},Kz={en:{waitlistCta:"Join the waitlist",startCta:"Start building",signIn:"Sign in",heroEyebrow:"One source, many adapters",heroTitleA:"Your AI-self, in files ",heroTitleB:"you own",heroBody:"Memnar reads your own documents, voice notes, and work, then writes a small set of markdown files that sound like you because they quote you. Not an interview, not your chat history. Files you keep, hosted in the EU, working in any AI tool.",waitlistNote:"Memnar is in private beta. We'll reach out as soon as there's a spot for you.",secureNote:"Your files are processed securely.",step1Title:"Build it from your own work",step1Body:"Upload documents, voice notes, and work samples. We read them and write a small set of markdown files that are unmistakably you.",step2Title:"One source of truth",step2Body:"Your voice, expertise, rules, and workflows as plain files you can read, edit, and keep. No scores, no theatre, just you on a page.",step3Title:"Use it in any tool",step3Body:"The same files, dressed for Claude Code, ChatGPT, Cursor, or anything else. Build once, take it everywhere.",fileIdentity:"who you are",fileVoice:"how you write and speak",fileExpertise:"what you can do",fileRules:"how you want an AI to work",fileWorkflows:"how you get things done",fileProjects:"what you're working on",getTitle:"What you actually get",getBody:"Not a dashboard of scores. A folder of readable files, each one a part of you, ready to drop into the tools you already use.",voiceEyebrow:"The part no template can fake",voiceTitle:"Your voice file quotes you, word for word",voiceBody:"No personality-test summary. Real passages, lifted straight from what you wrote. Open it and the first thing you feel is, that's me.",example:"example",quote1:`"I'd rather ship a small thing that works on Tuesday than a perfect thing that maybe lands next quarter. Send me the rough version and I'll tell you which half to keep."`,shows1:"Shows: direct, concrete, allergic to hedging",quote2:`"Can we lose the jargon here? If my mum can't follow the first paragraph, neither can the client."`,shows2:"Shows: plain language as a hard rule",verified:"Every excerpt is verified against your uploads before it lands in the file.",methodTitle:"Built from your work, not a quiz about it",methodBody:"Three ways to give an AI a you. Two of them produce a summary of what you said about yourself. One reads what you actually made.",interviewTitle:"Interview tools",interviewBody:"Answer a hundred questions. Get back a synthesized profile of how you describe yourself, which is rarely how you sound.",memoryTitle:"Built-in chat memory",memoryBody:"Claude, ChatGPT, and Gemini distill a profile from your chat history and keep it inside their walls. Importing your past is easy. Getting it out is not.",memnarBody:"Reads the documents, recordings, and work samples you already have. Quotes you word for word. Writes plain files that you own and every tool can use.",ownTitle:"Owned by you, at home in the EU",ownBody:"The big assistants happily import your history and never quite let it leave. That is the lock-in Memnar ends: your AI-self as files you can read, edit, and take anywhere.",noLockTitle:"Yours, with no lock-in",noLockBody:"Pay nothing to keep using what you made. Copy a file, download the set, edit it by hand. Plain markdown in your hands, not a profile buried in a vendor's hidden mailbox.",roadmap:"Roadmap",repoTitle:"A repo you own, in the EU",repoBo
305dy:"Next: your AI-self as a private repository you own, EU-hosted on Forgejo, the same platform the Dutch government chose for its code. Every update a saved version you can undo, read live by your tools over MCP. The files stay the single source.",footerTitle:"Build your AI-self once.",footerTag:"Memnar, a Mission Relearn product.",pricing:"Pricing",faq:"FAQ",privacy:"Privacy",terms:"Terms"},nl:{waitlistCta:"Zet je op de wachtlijst",startCta:"Begin met bouwen",signIn:"Inloggen",heroEyebrow:"Eén bron, elke tool",heroTitleA:"Je AI-ik, in bestanden ",heroTitleB:"die van jou zijn",heroBody:"Memnar leest je eigen documenten, spraakmemo's en werk, en schrijft daaruit een paar markdown-bestanden die klinken als jij, omdat ze jou citeren. Geen interview, niet je chatgeschiedenis. Bestanden die je houdt, gehost in de EU, en die werken in elke AI-tool.",waitlistNote:"Memnar zit in een besloten bèta. We laten van ons horen zodra er plek voor je is.",secureNote:"We verwerken je bestanden veilig.",step1Title:"Bouw het uit je eigen werk",step1Body:"Upload documenten, spraakmemo's en voorbeelden van je werk. Wij lezen ze en schrijven een paar markdown-bestanden die onmiskenbaar jou zijn.",step2Title:"Eén bron",step2Body:"Je stem, kennis, regels en werkwijzen als gewone bestanden die je kunt lezen, aanpassen en houden. Geen scores, geen toneel, gewoon jij op papier.",step3Title:"Gebruik het in elke tool",step3Body:"Dezelfde bestanden, klaargezet voor Claude Code, ChatGPT, Cursor of iets anders. Eén keer bouwen, overal meenemen.",fileIdentity:"wie je bent",fileVoice:"hoe je schrijft en praat",fileExpertise:"wat je kunt",fileRules:"hoe een AI voor je moet werken",fileWorkflows:"hoe je dingen gedaan krijgt",fileProjects:"waar je aan werkt",getTitle:"Wat je echt krijgt",getBody:"Geen dashboard vol scores. Een map met leesbare bestanden, elk een stukje van jou, klaar voor de tools die je al gebruikt.",voiceEyebrow:"Wat geen sjabloon kan nadoen",voiceTitle:"Je stembestand citeert je, woord voor woord",voiceBody:"Geen samenvatting uit een persoonlijkheidstest. Echte stukken tekst, rechtstreeks uit wat je schreef. Open het en je denkt meteen: dat ben ik.",example:"voorbeeld",quote1:'"Ik lever liever dinsdag iets kleins dat werkt dan iets perfects dat misschien volgend kwartaal komt. Stuur me de ruwe versie, dan zeg ik welke helft we houden."',shows1:"Laat zien: direct, concreet, houdt niet van vaagheid",quote2:'"Kan het jargon eruit? Als mijn moeder de eerste alinea niet snapt, snapt de klant hem ook niet."',shows2:"Laat zien: gewone taal als harde regel",verified:"Elk citaat checken we tegen je bestanden voordat het in het bestand komt.",methodTitle:"Gebouwd uit je werk, niet uit een vragenlijst",methodBody:"Er zijn drie manieren om een AI te laten weten wie je bent. Twee maken een samenvatting van wat je over jezelf zei. Eén leest wat je echt hebt gemaakt.",interviewTitle:"Interviewtools",interviewBody:"Je beantwoordt honderd vragen. Je krijgt een profiel terug van hoe je jezelf beschrijft, en zo klink je zelden.",memoryTitle:"Ingebouwd chatgeheugen",memoryBody:"Claude, ChatGPT en Gemini halen een profiel uit je chatgeschiedenis en houden het binnen hun eigen muren. Je verleden erin zetten is makkelijk. Het eruit halen niet.",memnarBody:"Leest de documenten, opnames en voorbeelden van je werk die je al hebt. Citeert je woord voor woord. Schrijft gewone bestanden die van jou zijn en die elke tool kan gebruiken.",ownTitle:"Van jou, thuis in de EU",ownBody:"De grote assistenten nemen je geschiedenis graag over en laten die nooit helemaal los. Memnar maakt een eind aan die lock-in: je AI-ik als bestanden die je kunt lezen, aanpassen en overal mee naartoe neemt.",noLockTitle:"Van jou, zonder lock-in",noLockBody:"Je betaalt niets om te blijven gebruiken wat je hebt gemaakt. Kopieer een bestand, download de hele set, pas het zelf aan. Gewone markdown in jouw handen, geen profiel dat ergens verstopt zit bij een leverancier.",roadmap:"Gepland",repoTitle:"Een repo van jou, in de EU",repoBody:"Hierna: je AI-ik als privé-repository van jou, gehost in de EU op Forgejo, hetzelfde platform dat de Nederlandse overheid koos voor haar code. Elke update is een opgeslagen versie die je kunt terugdraaien, en je tools lezen hem live via MCP. De bestanden blijven de enige bron.",footerTitle:"Bouw je AI-ik één keer.",footerTag:"Memnar, een product van Mission Relearn.",pricing:"Prijzen",faq:"Vragen",privacy:"Privacy",terms:"Voorwaarden"}},Gz=[{icon:h3,title:"step1Title",body:"step1Body"},{icon:$m,title:"step2Title",body:"step2Body"},{icon:l3,title:"step3Title",body:"step3Body"}],Yz=[{name:"identity.md",blurb:"fileIdentity"},{name:"voice.md",blurb:"fileVoice"},{name:"expertise.md",blurb:"fileExpertise"},{name:"rules.md",blurb:"fileRules"},{name:"workflows.md",blurb:"fileWorkflows"},{name:"projects.md",blurb:"fileProjects"}],Jz=()=>{const t=fh(),e=Xt(Kz),r=t?m.jsx("a",{href:Uy,target:"_blank",rel:"noopener noreferrer",children:m.jsxs(St,{size:"lg",className:"gap-2",children:[e.waitlistCta," ",m.jsx(lh,{className:"w-4 h-4"})]})}):m.jsx(It,{to:"/login",children:m.jsxs(St,{size:"lg",className:"gap-2",children:[e.startCta," ",m.jsx(lh,{className:"w-4 h-4"})]})});return m.jsxs("div",{className:"min-h-screen bg-surface relative overflow-hidden",children:[m.jsx("div",{className:"absolute top-[10%] left-[25%] w-[500px] h-[500px] rounded-full bg-lavender/[0.06] blur-[150px] pointer-events-none"}),m.jsx("div",{className:"absolute top-[55%] right-[15%] w-[420px] h-[420px] rounded-full bg-sage/[0.04] blur-[120px] pointer-events-none"}),m.jsx(Vz,{showFaqLink:!0,ctaLabel:e.signIn}),m.jsxs("header",{className:"relative z-10 max-w-5xl mx-auto px-6 pt-40 pb-20 text-center",children:[m.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-muted-gold font-body mb-5",children:e.heroEyebrow}),m.jsxs("h1",{className:"t-display text-on-surface font-medium max-w-4xl mx-auto mb-6",children:[e.heroTitleA,m.jsx("span",{className:"text-lavender",children:e.heroTitleB}),"."]}),m.jsx("p",{className:"text-on-surface/60 font-body text-lg md:text-xl max-w-2xl mx-auto mb-10 leading-relaxed",children:e.heroBody}),m.jsx("div",{className:"flex items-center justify-center gap-3",children:r}),m.jsx("p",{className:"text-on-surface-muted text-sm font-body mt-8",children:t?e.waitlistNote:e.secureNote})]}),m.jsx("section",{className:"relative z-10 max-w-5xl mx-auto px-6 pb-8",children:m.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-5",children:Gz.map(n=>{const s=n.icon;return m.jsxs("div",{className:"bg-surface-low rounded-3xl p-7",children:[m.jsx("div",{className:"w-11 h-11 rounded-xl bg-lavender/10 flex items-center justify-center mb-5",children:m.jsx(s,{className:"w-5 h-5 text-lavender"})}),m.jsx("h2",{className:"font-headline text-xl text-on-surface mb-2",children:e[n.title]}),m.jsx("p",{className:"text-on-surface/55 font-body text-sm leading-relaxed",children:e[n.body]})]},n.title)})})}),m.jsxs("section",{className:"relative z-10 max-w-5xl mx-auto px-6 py-16",children:[m.jsxs("div",{className:"text-center max-w-2xl mx-auto mb-10",children:[m.jsx("h2",{className:"t-h3 text-on-surface mb-3",children:e.getTitle}),m.jsx("p",{className:"text-on-surface/55 font-body leading-relaxed",children:e.getBody})]}),m.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:Yz.map(n=>m.jsxs("div",{className:"bg-surface-low/60 rounded-2xl px-5 py-4 flex items-center gap-3",children:[m.jsx($m,{className:"w-4 h-4 text-lavender/70 shrink-0"}),m.jsxs("div",{className:"min-w-0",children:[m.jsx("p",{className:"font-mono text-sm text-on-surface truncate",children:n.name}),m.jsx("p",{className:"text-xs font-body text-on-surface-muted truncate",children:e[n.blurb]})]})]},n.name))})]}),m.jsxs("section",{className:"relative z-10 max-w-4xl mx-auto px-6 py-12",children:[m.jsxs("div",{className:"text-center max-w-2xl mx-auto mb-8",children:[m.jsx("p",{className:"text-xs uppercase tracking-widest text-muted-gold font-body mb-3",children:e.voiceEyebrow}),m.jsx("h2",{className:"t-h3 text-on-surface mb-3",children:e.voiceTitle}),m.jsx("p",{className:"text-on-surface/55 font-body leading-relaxed",children:e.voiceBody})]}),m.jsxs("div",{className:"bg-surface-low rounded-3xl overflow-hidden border border-on-surface/5",children:[m.jsxs("div",{className:"flex items-center gap-2 px-5 py-3 border-b border-on-surface/5 bg-surface-mid/50",children:[m.jsx($m,{className:"w-4 h-4 text-lavender/70"}),m.jsx("span",{className:"font-mono text-sm text-on-surface/80",children:"voice.md"}),m.jsx("span",{className:"ml-auto text-xs font-body text-on-surface-muted",children:e.example})]}),m.jsxs("div",{className:"px-6 py-6 space-y-6",children:[m.jsxs("figure",{children:[m.jsx("blockquote",{className:"border-l-2 border-lavender/60 pl-4 font-body text-on-surface/85 leading-relaxed",children:e.quote1}),m.jsx("figcaption",{className:"pl-4 mt-2 text-xs font-body text-on-surface-muted",children:e.shows1})]}),m.jsxs("figure",{children:[m.jsx("blockquote",{className:"border-l-2 border-lavender/60 pl-4 font-body text-on-surface/85 leading-relaxed",children:e.quote2}),m.jsx("figcaption",{className:"pl-4 mt-2 text-xs font-body text-on-surface-muted",children:e.shows2})]})]})]}),m.jsx("p",{className:"text-center text-on-surface-muted font-body text-sm mt-4",children:e.verified})]}),m.jsxs("section",{className:"relative z-10 max-w-5xl mx-auto px-6 py-12",children:[m.jsxs("div",{className:"text-center max-w-2xl mx-auto mb-10",children:[m.jsx("h2",{className:"t-h3 text-on-surface mb-3",children:e.methodTitle}),m.jsx("p",{className:"text-on-surface/55 font-body leading-relaxed",children:e.methodBody})]}),m.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-5",children:[m.jsxs("div",{className:"bg-surface-low/60 rounded-3xl p-7",children:[m.jsx("div",{className:"w-11 h-11 rounded-xl bg-on-surface/5 flex items-center justify-center mb-5",children:m.jsx(r3,{className:"w-5 h-5 text-on-surface-muted"})}),m.jsx("h3",{className:"font-headline text-lg text-on-surface/80 mb-2",children:e.interviewTitle}),m.jsx("p",{className:"text-on-surface-muted font-body text-sm leading-relaxed",children:e.interviewBody})]}),m.jsxs("div",{className:"bg-surface-low/60 rounded-3xl p-7",children:[m.jsx("div",{className:"w-11 h-11 rounded-xl bg-on-surface/5 flex items-center justify-center mb-5",children:m.jsx(i3,{className:"w-5 h-5 text-on-surface-muted"})}),m.jsx("h3",{className:"font-headline text-lg text-on-surface/80 mb-2",children:e.memoryTitle}),m.jsx("p",{className:"text-on-surface-muted font-body text-sm leading-relaxed",children:e.memoryBody})]}),m.jsxs("div",{className:"bg-surface-mid rounded-3xl p-7 border border-lavender/20",children:[m.jsx("div",{className:"w-11 h-11 rounded-xl bg-lavender/10 flex items-center justify-center mb-5",children:m.jsx(s3,{className:"w-5 h-5 text-lavender"})}),m.jsx("h3",{className:"font-headline text-lg text-on-surface mb-2",children:"Memnar"}),m.jsx("p",{className:"text-on-surface/55 font-body text-sm leading-relaxed",children:e.memnarBody})]})]})]}),m.jsxs("section",{className:"relative z-10 max-w-5xl mx-auto px-6 py-12",children:[m.jsxs("div",{className:"text-center max-w-2xl mx-auto mb-10",children:[m.jsx("h2",{className:"t-h3 text-on-surface mb-3",children:e.ownTitle}),m.jsx("p",{className:"text-on-surface/55 font-body leading-relaxed",children:e.ownBody})]}),m.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:[m.jsxs("div",{className:"bg-surface-mid rounded-3xl p-7 space-y-2",children:[m.jsx(c3,{className:"w-6 h-6 text-sage mb-2"}),m.jsx("h3",{className:"font-headline text-lg text-on-surface",children:e.noLockTitle}),m.jsx("p",{className:"text-on-surface/55 font-body text-sm leading-relaxed",children:e.noLockBody})]}),m.jsxs("div",{className:"bg-surface-mid rounded-3xl p-7 space-y-2 relative overflow-hidden",children:[m.jsx("span",{className:"absolute right-5 top-5 text-[0.65rem] uppercase tracking-widest text-muted-gold font-body",children:e.roadmap}),m.jsx(e3,{className:"w-6 h-6 text-lavender mb-2"}),m.jsx("h3",{className:"font-headline text-lg text-on-surface",children:e.repoTitle}),m.jsx("p",{className:"text-on-surface/55 font-body text-sm leading-relaxed",children:e.repoBody})]})]})]}),m.jsxs("section",{className:"relative z-10 max-w-3xl mx-auto px-6 py-20 text-center",children:[m.jsx("h2",{className:"t-h2 text-on-surface mb-6",children:e.footerTitle}),m.jsx("div",{className:"flex items-center justify-center",children:r})]}),m.jsx("footer",{className:"relative z-10 border-t border-on-surface/5 py-8",children:m.jsxs("div",{className:"max-w-5xl mx-auto px-6 flex flex-col sm:flex-row items-center justify-between gap-3",children:[m.jsx("span",{className:"font-body text-sm text-on-surface-muted",children:e.footerTag}),m.jsxs("div",{className:"flex items-center gap-5 text-sm font-body text-on-surface-muted",children:[m.jsx(It,{to:"/pricing",className:"hover:text-on-surface transition-colors",children:e.pricing}),m.jsx(It,{to:"/faq",className:"hover:text-on-surface transition-colors",children:e.faq}),m.jsx(It,{to:"/privacy",className:"hover:text-on-surface transition-colors",children:e.privacy}),m.jsx(It,{to:"/terms",className:"hover:text-on-surface transition-colors",children:e.terms})]})]})})]})},wl=w.forwardRef(({className:t,type:e,...r},n)=>m.jsx("input",{type:e,className:Yr("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:n,...r}));
305wl.displayName="Input";const il=["google"],Qz={google:"Google",azure:"Microsoft"},Xz={en:{google:"Continue with Google",azure:"Continue with Microsoft"},nl:{google:"Verder met Google",azure:"Verder met Microsoft"}},Zz=({className:t=""})=>{const{language:e,setLanguage:r}=Na();return m.jsx("div",{role:"radiogroup","aria-label":"Taal van de app / App language",className:`inline-flex rounded-xl bg-surface-mid p-1 gap-1 ${t}`,children:DU.map(({code:n,name:s})=>{const i=e===n;return m.jsx("button",{type:"button",role:"radio","aria-checked":i,lang:n,onClick:()=>void r(n),className:`rounded-lg px-3 h-9 text-sm font-body transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-low ${i?"bg-surface-high text-on-surface":"text-on-surface/60 hover:text-on-surface"}`,children:s},n)})})},e5={en:{linkSent:"Check your email for the magic link!",codeFailed:"That code didn't work. Check the digits, or request a new link.",welcomeBack:"Welcome back.",or:"or",title:"Welcome back.",subtitle:"No passwords. Just your email.",goBack:"Go back",notAllowedTitle:"This email isn't on the tester list yet.",notAllowedBody:"Memnar is in private testing.",joinWaitlist:"Join the waitlist →",tryOther:"Try a different email",checkInbox:"Check your inbox",sentTo:"We sent a magic link to ",orCode:"Or enter the 6-digit code from the email",checking:"Checking...",signInWithCode:"Sign in with code",newestEmail:"Always use the newest email: requesting a new one stops the older codes from working.",safeSendersA:"Work mail filters (Microsoft 365 especially) often quarantine first-time senders. If nothing arrives, add ",safeSendersB:" to your safe senders.",noMailTitle:"Still no email? It's probably stuck in a filter.",noMailSpam:'Search your spam or junk for "Memnar".',noMailOAuth:t=>`Skip email entirely: go back and sign in with ${t}.`,orJoin:" or ",noMailContactA:"Or email ",noMailContactB:" and we'll get you in another way.",backToOptions:"← Back to sign-in options",emailPlaceholder:"Enter your email",codePlaceholder:"6-digit code from the email",magicInstead:"Send me a magic link instead",sending:"Sending...",sendLink:"Send magic link →",optIn:"Send me product tips while I get set up (optional, unsubscribe anytime)",haveCode:"Already have a code?"},nl:{linkSent:"Check je e-mail voor de inloglink!",codeFailed:"Die code werkt niet. Controleer de cijfers, of vraag een nieuwe link aan.",welcomeBack:"Welkom terug.",or:"of",title:"Welkom terug.",subtitle:"Geen wachtwoord. Alleen je e-mailadres.",goBack:"Terug",notAllowedTitle:"Dit e-mailadres staat nog niet op de testerslijst.",notAllowedBody:"Memnar is in een besloten testfase.",joinWaitlist:"Zet je op de wachtlijst →",tryOther:"Probeer een ander e-mailadres",checkInbox:"Check je inbox",sentTo:"We hebben een inloglink gestuurd naar ",orCode:"Of vul de 6-cijferige code uit de e-mail in",checking:"Controleren...",signInWithCode:"Log in met code",newestEmail:"Gebruik altijd de nieuwste e-mail: vraag je een nieuwe aan, dan werken de oude codes niet meer.",safeSendersA:"Werkmail-filters (vooral Microsoft 365) houden een eerste mail van een onbekende afzender vaak tegen. Komt er niets binnen? Zet ",safeSendersB:" dan bij je veilige afzenders.",noMailTitle:"Nog steeds geen e-mail? Dan zit hij waarschijnlijk vast in een filter.",noMailSpam:'Zoek in je spam of ongewenste mail naar "Memnar".',noMailOAuth:t=>`Sla e-mail helemaal over: ga terug en log in met ${t}.`,orJoin:" of ",noMailContactA:"Of mail ",noMailContactB:", dan helpen we je op een andere manier binnen.",backToOptions:"← Terug naar de inlogopties",emailPlaceholder:"Vul je e-mailadres in",codePlaceholder:"6-cijferige code uit de e-mail",magicInstead:"Stuur me liever een inloglink",sending:"Versturen...",sendLink:"Stuur inloglink →",optIn:"Stuur me producttips terwijl ik begin (niet verplicht, je kunt je altijd afmelden)",haveCode:"Heb je al een code?"}},t5=["signups not allowed","otp_disabled","invite","allowlist","not allowed"],r5=(t,e)=>{if(e===422)return!0;
305if(!t)return!1;const r=t.toLowerCase();return t5.some(n=>r.includes(n))},n5=new Set(["gmail.com","googlemail.com","outlook.com","hotmail.com","live.com","yahoo.com","proton.me","protonmail.com","icloud.com","me.com"]),s5=t=>{const e=t.lastIndexOf("@");if(e<1)return!1;const r=t.slice(e+1).trim().toLowerCase();return r.includes(".")&&!n5.has(r)},i5=()=>{const[t,e]=w.useState(""),[r,n]=w.useState(!1),[s,i]=w.useState(!1),[o,a]=w.useState(""),[l,u]=w.useState(!1),[c,d]=w.useState(!1),[h,f]=w.useState(!1),[g,p]=w.useState(!1),[b,v]=w.useState(!1),{session:y}=yt(),_=Bi(),x=Gr(),k=Xt(e5),C=Xt(Xz);if(w.useEffect(()=>{fh()&&window.location.replace(Uy)},[]),w.useEffect(()=>{if(!s){v(!1);return}const I=window.setTimeout(()=>v(!0),6e4);return()=>window.clearTimeout(I)},[s]),w.useEffect(()=>{const I=x.state;I!=null&&I.notAllowed&&(p(!0),window.history.replaceState({},""))},[x.state]),fh())return null;if(y)return m.jsx(Nr,{to:uh()??hh,replace:!0});const T=async I=>{I.preventDefault(),n(!0),p(!1);const{error:N}=await fe.auth.signInWithOtp({email:t,options:{emailRedirectTo:window.location.origin+"/auth/callback"}});n(!1),N?r5(N.message,N.status)?(p(!0),Fy(t,"login")):Je.error(N.message):(nD(h,t),Ri("magic_link_sent"),i(!0),Je.success(k.linkSent))},S=async I=>{Ri("oauth_login_clicked",{provider:I});const{error:N}=await fe.auth.signInWithOAuth({provider:I,options:{redirectTo:window.location.origin+"/auth/callback"}});N&&Je.error(N.message)},P=il.length>0&&m.jsxs("div",{className:"space-y-3",children:[m.jsxs("div",{className:"flex items-center gap-3 text-on-surface-muted text-xs font-body",children:[m.jsx("span",{className:"h-px flex-1 bg-on-surface/10"}),k.or,m.jsx("span",{className:"h-px flex-1 bg-on-surface/10"})]}),il.map(I=>m.jsx(St,{type:"button",variant:"outline",size:"lg",className:"w-full",onClick:()=>S(I),children:C[I]},I))]}),R=async I=>{I.preventDefault(),u(!0);const{error:N}=await fe.auth.verifyOtp({email:t,token:o.trim(),type:"email"});u(!1),N?Je.error(k.codeFailed):(Ri("otp_verified"),Je.success(k.welcomeBack),_(uh()??hh,{replace:!0}))};return m.jsxs("div",{className:"min-h-screen bg-surface flex items-center justify-center px-6 relative overflow-hidden",children:[m.jsx("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 rounded-full bg-lavender/5 blur-[120px]"}),m.jsx("div",{className:"absolute bottom-1/4 right-1/4 w-80 h-80 rounded-full bg-sage/5 blur-[100px]"}),m.jsxs("div",{className:"w-full max-w-md relative z-10",children:[m.jsxs("div",{className:"text-center mb-10",children:[m.jsx("div",{className:"flex items-center justify-center gap-2 mb-8",children:m.jsx("img",{src:Jh,alt:"Memnar",className:"w-10 h-10 rounded-lg"})}),m.jsx("h1",{className:"t-h2 text-on-surface mb-3",children:k.title}),m.jsx("p",{className:"text-on-surface/60 font-body",children:k.subtitle})]}),m.jsxs("div",{className:"glass rounded-3xl p-8",children:[m.jsxs("button",{onClick:()=>_(-1),className:"flex items-center gap-1.5 text-on-surface-muted hover:text-on-surface transition-colors mb-6 text-sm font-body",children:[m.jsx(JU,{className:"w-4 h-4"}),k.goBack]}),g?m.jsxs("div",{className:"text-center py-2",children:[m.jsx(bb,{className:"w-12 h-12 text-lavender mx-auto mb-4"}),m.jsx("h2",{className:"font-headline text-xl text-on-surface mb-2",children:k.notAllowedTitle}),m.jsx("p",{className:"text-on-surface/60 font-body text-sm mb-6",children:k.notAllowedBody}),m.jsx(St,{asChild:!0,size:"lg",className:"w-full",children:m.jsx("a",{href:"https://memnar.ai",target:"_blank",rel:"noopener noreferrer",children:k.joinWaitlist})}),m.jsx("button",{onClick:()=>{p(!1),e("")},className:"mt-4 text-sm text-on-surface-muted hover:text-lavender font-body transition-colors",children:k.tryOther})]}):s?m.jsxs("div",{className:"text-center py-4",children:[m.jsx(bb,{className:"w-12 h-12 text-lavender mx-auto mb-4"}),m.jsx("h2",{className:"font-headline text-xl text-on-surface mb-2",children:k.checkInbox}),m.jsxs("p",{className:"text-on-surface/60 font-body text-sm mb-6",children:[k.sentTo,m.jsx("span",{className:"text-lavender",children:t})]}),m.jsx("p",{className:"text-on-surface-muted font-body text-xs mb-3",children:k.orCode}),m.jsxs("form",{onSubmit:R,className:"space-y-3",children:[m.jsx(wl,{type:"text",inputMode:"numeric",autoComplete:"one-time-code",maxLength:6,placeholder:"123456",value:o,onChange:I=>a(I.target.value.replace(/\D/g,"")),className:"bg-surface-low border-0 rounded-xl h-12 text-on-surface text-center tracking-[0.4em] placeholder:text-on-surface-muted placeholder:tracking-[0.4em] focus:bg-surface-high focus:ring-1 focus:ring-lavender/30"}),m.jsx(St,{type:"submit",size:"lg",className:"w-full",disabled:l||o.length!==6,children:l?k.checking:k.signInWithCode})]}),m.jsx("p",{className:"text-on-surface-muted font-body text-xs mt-4",children:k.newestEmail}),s5(t)&&m.jsxs("p",{className:"text-on-surface-muted font-body text-xs mt-2",children:[k.safeSendersA,m.jsx("span",{className:"text-on-surface/60",children:"[email protected]"}),k.safeSendersB]}),b&&m.jsxs("div",{className:"mt-4 rounded-xl bg-surface-low p-4 text-left",children:[m.jsx("p",{className:"text-on-surface/70 font-body text-xs mb-2",children:k.noMailTitle}),m.jsxs("ul",{className:"text-on-surface-muted font-body text-xs space-y-1 list-disc pl-4",children:[m.jsx("li",{children:k.noMailSpam}),il.length>0&&m.jsx("li",{children:k.noMailOAuth(il.map(I=>Qz[I]).join(k.orJoin))}),m.jsxs("li",{children:[k.noMailContactA,m.jsx("a",{href:"mailto:[email protected]",className:"text-lavender hover:underline",children:"[email protected]"}),k.noMailContactB]})]}),il.length>0&&m.jsx("button",{type:"button",onClick:()=>i(!1),className:"mt-3 text-xs text-on-surface-muted hover:text-lavender font-body transition-colors",children:k.backToOptions})]})]}):c?m.jsxs("form",{onSubmit:R,className:"space-y-4",children:[m.jsx(wl,{type:"email",placeholder:k.emailPlaceholder,value:t,onChange:I=>e(I.target.value),required:!0,className:"bg-surface-low border-0 rounded-xl h-12 text-on-surface placeholder:text-on-surface-muted focus:bg-surface-high focus:ring-1 focus:ring-lavender/30"}),m.jsx(wl,{type:"text",inputMode:"numeric",autoComplete:"one-time-code",maxLength:6,placeholder:k.codePlaceholder,value:o,onChange:I=>a(I.target.value.replace(/\D/g,"")),className:"bg-surface-low border-0 rounded-xl h-12 text-on-surface text-center placeholder:text-on-surface-muted focus:bg-surface-high focus:ring-1 focus:ring-lavender/30"}),m.jsx(St,{type:"submit",size:"lg",className:"w-full",disabled:l||!t||o.length!==6,children:l?k.checking:k.signInWithCode}),m.jsx("button",{type:"button",onClick:()=>d(!1),className:"w-full text-sm text-on-surface-muted hover:text-lavender font-body transition-colors",children:k.magicInstead})]}):m.jsxs("form",{onSubmit:T,className:"space-y-4",children:[m.jsx(wl,{type:"email",placeholder:k.emailPlaceholder,value:t,onChange:I=>e(I.target.value),required:!0,className:"bg-surface-low border-0 rounded-xl h-12 text-on-surface placeholder:text-on-surface-muted focus:bg-surface-high focus:ring-1 focus:ring-lavender/30"}),m.jsx(St,{type:"submit",size:"lg",className:"w-full",disabled:r,children:r?k.sending:k.sendLink}),m.jsxs("label",{className:"flex items-start gap-2.5 text-xs text-on-surface-muted font-body cursor-pointer select-none",children:[m.jsx("input",{type:"checkbox",checked:h,onChange:I=>f(I.target.checked),className:"mt-0.5 accent-[#c1c1fe]"}),m.jsx("span",{children:k.optIn})]}),m.jsx("button",{type:"button",onClick:()=>d(!0),className:"w-full text-sm text-on-surface-muted hover:text-lavender font-body transition-colors",children:k.haveCode}),P]})]}),m.jsx("div",{className:"mt-6 flex justify-center",children:m.jsx(Zz,{})})]})]})},o5={en:{failed:"Sign in failed. Please try again.",welcomeBack:"Welcome back.",signingIn:"Signing you in..."},nl:{failed:"Inloggen is niet gelukt. Probeer het opnieuw.",welcomeBack:"Welkom terug.",signingIn:"Je wordt ingelogd..."}},a5=["database error","invite","allowlist","not allowed","signups"],yp=t=>{if(!t)return!1;const e=t.toLowerCase();return a5.some(r=>e.includes(r))},l5=()=>{const t=Bi(),e=Xt(o5),r=w.useRef(e);return r.current=e,w.useEffect(()=>{(async()=>{const s=()=>{Fy(null,"oauth_callback"),t("/login",{replace:!0,state:{notAllowed:!0}})};try{const i=new URL(window.location.href),o=i.searchParams.get("code"),a=i.searchParams.get("error_description")||new URLSearchParams(i.hash.replace(/^#/,"")).get("error_description");if(a){const c=decodeURIComponent(a);if(yp(c)){s();return}Je.error(c),t("/login",{replace:!0});return}if(o){const{error:c}=await fe.auth.exchangeCodeForSession(window.location.href);if(c){if(yp(c.message)){s();return}Je.error(c.message||r.current.failed),t("/login",{replace:!0});return}}const{data:l,error:u}=await fe.auth.getSession();if(u||!l.session){if(yp(u==null?void 0:u.message)){s();return}Je.error(r.current.failed),t("/login",{replace:!0});return}Je.success(r.current.welcomeBack),t(uh()??hh,{replace:!0})}catch{Je.error(r.current.failed),t("/login",{replace:!0})}})()},[t]),m.jsx("div",{className:"min-h-screen bg-surface flex items-center justify-center",children:m.jsx("div",{className:"animate-soft-pulse font-headline text-2xl text-lavender",children:e.signingIn})})},u5={en:{welcomeBack:"Welcome back.",expiredTitle:"That link has expired.",title:"One tap to 
305sign in.",expiredBody:"Links work once and expire after 60 minutes.",body:"Confirm it's you and we'll open your account.",requestNewBody:"Request a new link, and use the newest email we send you. Older codes and links stop working as soon as a new one arrives.",requestNew:"Request a new link",signingIn:"Signing you in...",signIn:"Sign in to Memnar"},nl:{welcomeBack:"Welkom terug.",expiredTitle:"Deze link is verlopen.",title:"Eén tik en je bent binnen.",expiredBody:"Een link werkt één keer en verloopt na 60 minuten.",body:"Bevestig dat jij het bent, dan openen we je account.",requestNewBody:"Vraag een nieuwe link aan en gebruik de nieuwste e-mail die we sturen. Oudere codes en links werken niet meer zodra er een nieuwe binnenkomt.",requestNew:"Vraag een nieuwe link aan",signingIn:"Je wordt ingelogd...",signIn:"Log in bij Memnar"}},c5=["database error","invite","allowlist","not allowed","signups"],d5=t=>{if(!t)return!1;const e=t.toLowerCase();return c5.some(r=>e.includes(r))},h5=()=>{const[t]=Pj(),e=Bi(),[r,n]=w.useState(!1),[s,i]=w.useState(!1),o=Xt(u5),a=t.get("token_hash"),l=t.get("type")||"email",u=async()=>{if(!a)return;n(!0);const{error:c}=await fe.auth.verifyOtp({type:l,token_hash:a});if(n(!1),c){if(d5(c.message)){Fy(null,"auth_confirm"),e("/login",{replace:!0,state:{notAllowed:!0}});return}i(!0)}else Je.success(o.welcomeBack),e(uh()??hh,{replace:!0})};return m.jsxs("div",{className:"min-h-screen bg-surface flex items-center justify-center px-6 relative overflow-hidden",children:[m.jsx("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 rounded-full bg-lavender/5 blur-[120px]"}),m.jsx("div",{className:"absolute bottom-1/4 right-1/4 w-80 h-80 rounded-full bg-sage/5 blur-[100px]"}),m.jsxs("div",{className:"w-full max-w-md relative z-10",children:[m.jsxs("div",{className:"text-center mb-10",children:[m.jsx("div",{className:"flex items-center justify-center gap-2 mb-8",children:m.jsx("img",{src:Jh,alt:"Memnar",className:"w-10 h-10 rounded-lg"})}),m.jsx("h1",{className:"t-h2 text-on-surface mb-3",children:s?o.expiredTitle:o.title}),m.jsx("p",{className:"text-on-surface/60 font-body",children:s?o.expiredBody:o.body})]}),m.jsx("div",{className:"glass rounded-3xl p-8 text-center",children:!a||s?m.jsxs("div",{className:"space-y-4",children:[m.jsx("p",{className:"text-on-surface/60 font-body text-sm",children:o.requestNewBody}),m.jsx(St,{size:"lg",className:"w-full",onClick:()=>e("/login",{replace:!0}),children:o.requestNew})]}):m.jsx(St,{size:"lg",className:"w-full",disabled:r,onClick:u,children:r?o.signingIn:o.signIn})})]})]})},f5={en:{missingSession:"Missing checkout session. Please contact support if you were charged.",confirming:"Thanks, confirming your upgrade…",notConfirmed:"We could not confirm the payment yet. Please refresh in a moment.",confirmed:"Payment confirmed: Individual is unlocked."},nl:{missingSession:"We missen de gegevens van je betaling. Is er geld afgeschreven? Neem dan contact met ons op.",confirming:"Dank je, we bevestigen je upgrade…",notConfirmed:"We kunnen de betaling nog niet bevestigen. Ververs de pagina over een paar tellen.",confirmed:"Betaling bevestigd: Indiv
305idual staat voor je aan."}},p5=()=>{const{user:t}=yt(),e=Gs(),r=Gr(),n=Bi(),s=w.useRef(null),i=Xt(f5),o=async a=>{await Promise.all([e.invalidateQueries({queryKey:["profile",a]}),e.invalidateQueries({queryKey:["profile-plan",a]})])};return w.useEffect(()=>{if(!t){s.current=null;return}if(new URLSearchParams(r.search).get("checkout")==="success")return;const l=t.id;s.current!==l&&(s.current=l,(async()=>{const{error:u}=await fe.functions.invoke("check-subscription",{});if(u){console.error("Plan verification failed",u);return}await o(t.id)})())},[t==null?void 0:t.id,r.search]),w.useEffect(()=>{const a=new URLSearchParams(r.search);if(a.get("checkout")!=="success"||!t)return;const l=a.get("session_id");if(!l){Je.error(i.missingSession),a.delete("checkout"),n({pathname:r.pathname,search:a.toString()},{replace:!0});return}let u=!1;return Je.success(i.confirming),(async()=>{const{data:c,error:d}=await fe.functions.invoke("check-subscription",{body:{session_id:l}});if(!u){if(d||!(c!=null&&c.isPaid)){console.error("Checkout verification failed",d??c),Je.error(i.notConfirmed);return}await o(t.id),Je.success(i.confirmed),a.delete("checkout"),a.delete("session_id"),n({pathname:r.pathname,search:a.toString()},{replace:!0})}})(),()=>{u=!0}},[r.search,t==null?void 0:t.id]),null},g5=w.lazy(()=>Qe(()=>import("./Connect-Dio-nekN.js"),__vite__mapDeps([0,1,2,3,4,5]))),m5=w.lazy(()=>Qe(()=>import("./Start-CE_2iqca.js"),__vite__mapDeps([6,4,2,7]))),v5=w.lazy(()=>Qe(()=>import("./Build-CMB8E6sK.js"),__vite__mapDeps([8,9,5,10,11,12,13,3,14,15,7])));w.lazy(()=>Qe(()=>import("./Journey-CM_3tNvz.js"),__vite__mapDeps([16,17,7,13])));w.lazy(()=>Qe(()=>import("./ModulePage-BM2joiE8.js"),__vite__mapDeps([18,13,7,2,19,17])));const y5=w.lazy(()=>Qe(()=>import("./AiIk-B9kLalhD.js"),__vite__mapDeps([20,7,21,22,23,24,12,5,25,19,26,27,2]))),_5=w.lazy(()=>Qe(()=>import("./Patterns-Bzq-3niD.js"),__vite__mapDeps([28,23,7,29,11,5,3,25,22]))),w5=w.lazy(()=>Qe(()=>import("./Use-BiMBQGPY.js"),__vite__mapDeps([30,21,31,7,4,32,5,19,2,14,25]))),b5=w.lazy(()=>Qe(()=>import("./Settings-CPCJgcJM.js"),__vite__mapDeps([33,34,35,24,31,7,4,1,2,5,25,14,19,15]))),x5=w.lazy(()=>Qe(()=>import("./Choose-C6C8ocKM.js"),__vite__mapDeps([36,35,37]))),k5=w.lazy(()=>Qe(()=>import("./Choose-C6C8ocKM.js"),__vite__mapDeps([36,35,37])).then(t=>({default:t.SpaceEntry}))),S5=w.lazy(()=>Qe(()=>import("./Team-C9rc8Ym4.js"),__vite__mapDeps([38,11,39,9,27,26,22,2,7,5,15,29,40,35]))),E5=w.lazy(()=>Qe(()=>import("./Overdracht-PJ6rhXtr.js"),__vite__mapDeps([41,25,40,35,37,5]))),C5=w.lazy(()=>Qe(()=>import("./OverdrachtBron-CsUDlvF7.js"),__vite__mapDeps([42,25,40,35,37,5,39,43,29,26,32]))),T5=w.lazy(()=>Qe(()=>import("./OverdrachtGesprek-dBeyM9PQ.js"),__vite__mapDeps([44,29,43,37,26,32,5,7]))),P5=w.lazy(()=>Qe(()=>import("./Pricing-jlr_YyDB.js"),__vite__mapDeps([45,10,11,46,2,19,5]))),R5=w.lazy(()=>Qe(()=>import("./FAQ-BU8i60jN.js"),__vite__mapDeps([47,46,2,19]))),A5=w.lazy(()=>Qe(()=>import("./Privacy-rdxbtzRJ.js"),__vite__mapDeps([48,46,2,19]))),O5=w.lazy(()=>Qe(()=>import("./Terms-DHaxSoT7.js"),[])),j5=w.lazy(()=>Qe(()=>import("./Unsubscribe-3XXSTML6.js"),__vite__mapDeps([49,34,35]))),N5=w.lazy(()=>Qe(()=>import("./AdminMonitor-B8CdcqIh.js"),[])),I5=w.lazy(()=>Qe(()=>import("./NotFound-BqzZw2dz.js"),[])),$5=new oO,L5=()=>m.jsx("div",{className:"min-h-screen bg-surface flex items-center justify-center",children:m.jsx("div",{className:"animate-soft-pulse h-10 w-40 bg-surface-low rounded-xl"})}),M5=()=>m.jsx(x3,{children:m.jsx(VU,{children:m.jsx(dO,{client:$5,children:m.jsxs(J2,{children:[m.jsx(oN,{}),m.jsx(m3,{}),m.jsx(Sj,{children:m.jsx(MU,{children:m.jsxs(BU,{children:[m.jsx(p5,{}),m.jsx(w.Suspense,{fallback:m.jsx(L5,{}),children:m.jsxs(mj,{children:[m.jsx(ge,{path:"/",element:m.jsx(Jz,{})}),m.jsx(ge,{path:"/login",element:m.jsx(i5,{})}),m.jsx(ge,{path:"/auth/callback",element:m.jsx(l5,{})}),m.jsx(ge,{path:"/auth/confirm",element:m.jsx(h5,{})}),m.jsx(ge,{path:"/connect",element:m.jsx(g5,{})}),m.jsx(ge,{path:"/start",element:m.jsx(m5,{})}),m.jsx(ge,{path:"/pricing",element:m.jsx(P5,{})}),m.jsx(ge,{path:"/faq",element:m.jsx(R5,{})}),m.jsx(ge,{path:"/privacy",element:m.jsx(A5,{})}),m.jsx(ge,{path:"/terms",element:m.jsx(O5,{})}),m.jsx(ge,{path:"/unsubscribe",element:m.jsx(j5,{})}),m.jsx(ge,{path:"/home",element:m.jsx(Ec,{children:m.jsx(k5,{})})}),m.jsx(ge,{path:"/choose",element:m.jsx(Ec,{children:m.jsx(x5,{})})}),m.jsxs(ge,{element:m.jsx(Ec,{children:m.jsx(Hz,{})}),children:[m.jsx(ge,{path:"/journey",element:m.jsx(Nr,{to:"/ai-self",replace:!0})}),m.jsx(ge,{path:"/journey/:slug",element:m.jsx(Nr,{to:"/ai-self",replace:!0})}),m.jsx(ge,{path:"/ai-self",element:m.jsx(y5,{})}),m.jsx(ge,{path:"/patterns",element:m.jsx(_5,{})}),m.jsx(ge,{path:"/build",element:m.jsx(v5,{})}),m.jsx(ge,{path:"/use",element:m.jsx(w5,{})}),m.jsx(ge,{path:"/settings",element:m.jsx(b5,{})}),m.jsx(ge,{path:"/team",element:m.jsx(S5,{})}),m.jsx(ge,{path:"/overdracht",element:m.jsx(E5,{})}),m.jsx(ge,{path:"/overdracht/:sourceId",element:m.jsx(C5,{})}),m.jsx(ge,{path:"/overdracht/:sourceId/gesprek/:sessionId",element:m.jsx(T5,{})})]}),m.jsx(ge,{path:"/admin/monitor",element:m.jsx(Ec,{children:m.jsx(N5,{})})}),m.jsx(ge,{path:"/ai-ik",element:m.jsx(Nr,{to:"/ai-self",replace:!0})}),m.jsx(ge,{path:"/dashboard",element:m.jsx(Nr,{to:"/ai-self",replace:!0})}),m.jsx(ge,{path:"/upload",element:m.jsx(Nr,{to:"/build",replace:!0})}),m.jsx(ge,{path:"/preview",element:m.jsx(Nr,{to:"/ai-self",replace:!0})}),m.jsx(ge,{path:"/preview/:id",element:m.jsx(Nr,{to:"/ai-self",replace:!0})}),m.jsx(ge,{path:"/export",element:m.jsx(Nr,{to:"/use",replace:!0})}),m.jsx(ge,{path:"/export/:id",element:m.jsx(Nr,{to:"/use",replace:!0})}),m.jsx(ge,{path:"*",element:m.jsx(I5,{})})]})})]})})})]})})})});(()=>{const{hash:t,search:e,pathname:r}=window.location;if(r!=="/")return;(/[#&](access_token|refresh_token|error|error_description)=/.test(t)||/[?&]code=/.test(e))&&window.history.replaceState(null,"",`/auth/callback${e}${t}`)})();window.addEventListener("vite:preloadError",t=>{t.preventDefault(),DC()});OU();pS(document.getElementById("root")).render(m.jsx(M5,{}));export{b6 as $,lh as A,St as B,MC as C,v6 as D,XU as E,$m as F,B5 as G,X5 as H,wl as I,XB as J,VB as K,It as L,XT as M,Nr as N,ZB as O,y6 as P,l3 as Q,Wm as R,c3 as S,Q5 as T,g6 as U,QU as V,h3 as W,f3 as X,_6 as Y,e3 as Z,Dz as _,yt as a,Gv as a$,w6 as a0,Yr as a1,YB as a2,ex as a3,F5 as a4,jz as a5,jU as a6,$C as a7,o3 as a8,d3 as a9,c6 as aA,eP as aB,s6 as aC,r6 as aD,o6 as aE,i6 as aF,l6 as aG,t6 as aH,u6 as aI,Y5 as aJ,n6 as aK,KB as aL,BC as aM,WI as aN,Ag as aO,Us as aP,Lh as aQ,UC as aR,XI as aS,cE as aT,fE as aU,Ah as aV,Kn as aW,J3 as aX,T3 as aY,nT as aZ,zC as a_,a3 as aa,G5 as ab,lz as ac,nz as ad,Zz as ae,bb as af,t3 as ag,Ra as ah,vt as ai,pE as aj,Ct as ak,he as al,MI as am,Ca as an,ZT as ao,p6 as ap,mz as aq,h6 as ar,zm as as,e6 as at,Jh as au,f6 as av,Fb as aw,nP as ax,iz as ay,ez as az,qh as b,iu as b0,dE as b1,hE as b2,a6 as b3,d6 as b4,hz as b5,cN as b6,y3 as b7,H5 as b8,fh as b9,Vz as ba,Uy as bb,Uw as bc,z as bd,sz as be,qe as c,Oz as d,Xt as e,K5 as f,Je as g,hr as h,Gs as i,m as j,kO as k,Bi as l,Na as m,Ri as n,Cz as o,V5 as p,rz as q,w as r,fe as s,No as t,Pj as u,Lz as v,Z5 as w,JU as x,m6 as y,Iz as z};

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.