PageSourceSearch

https://www.signalfit.ai/assets/index-V_3T4Mvu.js

js signalfit.ai collected 2026-10-05 16:56:30 UTC 1,332,501 bytes, 293 lines download raw bytes

vendor: 6,329 bytes, lines 1-17
1function p4(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in t)){const o=Object.getOwnPropertyDescriptor(r,s);o&&Object.defineProperty(t,s,o.get?o:{enumerable:!0,get:()=>r[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"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function m4(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ay={exports:{}},Eu={};/**
2 * @license React
3 * react-jsx-runtime.production.js
4 *
5 * Copyright (c) Meta Platforms, Inc. and affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var gE;function g4(){if(gE)return Eu;gE=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,s,o){var l=null;if(o!==void 0&&(l=""+o),s.key!==void 0&&(l=""+s.key),"key"in s){o={};for(var d in s)d!=="key"&&(o[d]=s[d])}else o=s;return s=o.ref,{$$typeof:t,type:r,key:l,ref:s!==void 0?s:null,props:o}}return Eu.Fragment=e,Eu.jsx=n,Eu.jsxs=n,Eu}var vE;function v4(){return vE||(vE=1,ay.exports=g4()),ay.exports}var u=v4(),oy={exports:{}},et={};/**
10 * @license React
11 * react.production.js
12 *
13 * Copyright (c) Meta Platforms, Inc. and affiliates.
14 *
15 * This source code is licensed under the MIT license found in the
16 * LICENSE file in the root directory of this source tree.
17 */var yE;function y4(){if(yE)return et;yE=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),y=Symbol.iterator;function b(A){return A===null||typeof A!="object"?null:(A=y&&A[y]||A["@@iterator"],typeof A=="function"?A:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,S={};function E(A,$,P){this.props=A,this.context=$,this.refs=S,this.updater=P||_}E.prototype.isReactComponent={},E.prototype.setState=function(A,$){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,$,"setState")},E.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function k(){}k.prototype=E.prototype;function j(A,$,P){this.props=A,this.context=$,this.refs=S,this.updater=P||_}var N=j.prototype=new k;N.constructor=j,w(N,E.prototype),N.isPureReactComponent=!0;var O=Array.isArray;function D(){}var F={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function B(A,$,P){var q=P.ref;return{$$typeof:t,type:A,key:$,ref:q!==void 0?q:null,props:P}}function M(A,$){return B(A.type,$,A.props)}function V(A){return typeof A=="object"&&A!==null&&A.$$typeof===t}function W(A){var $={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(P){return $[P]})}var Q=/\/+/g;function K(A,$){return typeof A=="object"&&A!==null&&A.key!=null?W(""+A.key):$.toString(36)}function te(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(D,D):(A.status="pending",A.then(function($){A.status==="pending"&&(A.status="fulfilled",A.value=$)},function($){A.status==="pending"&&(A.status="rejected",A.reason=$)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function I(A,$,P,q,z){var X=typeof A;(X==="undefined"||X==="boolean")&&(A=null);var se=!1;if(A===null)se=!0;else switch(X){case"bigint":case"string":case"number":se=!0;break;case"object":switch(A.$$typeof){case t:case e:se=!0;break;case g:return se=A._init,I(se(A._payload),$,P,q,z)}}if(se)return z=z(A),se=q===""?"."+K(A,0):q,O(z)?(P="",se!=null&&(P=se.replace(Q,"$&/")+"/"),I(z,$,P,"",function(fe){return fe})):z!=null&&(V(z)&&(z=M(z,P+(z.key==null||A&&A.key===z.key?"":(""+z.key).replace(Q,"$&/")+"/")+se)),$.push(z)),1;se=0;var ne=q===""?".":q+":";if(O(A))for(var ie=0;ie<A.length;ie++)q=A[ie],X=ne+K(q,ie),se+=I(q,$,P,X,z);else if(ie=b(A),typeof ie=="function")for(A=ie.call(A),ie=0;!(q=A.next()).done;)q=q.value,X=ne+K(q,ie++),se+=I(q,$,P,X,z);else if(X==="object"){if(typeof A.then=="function")return I(te(A),$,P,q,z);throw $=String(A),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return se}function H(A,$,P){if(A==null)return A;var q=[],z=0;return I(A,q,"","",function(X){return $.call(P,X,z++)}),q}function G(A){if(A._status===-1){var $=A._result;$=$(),$.then(function(P){(A._status===0||A._status===-1)&&(A._status=1,A._result=P)},function(P){(A._status===0||A._status===-1)&&(A._status=2,A._result=P)}),A._status===-1&&(A._status=0,A._result=$)}if(A._status===1)return A._result.default;throw A._result}var re=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)}
vendor: 4,207 bytes, lines 17-25
17,U={map:H,forEach:function(A,$,P){H(A,function(){$.apply(this,arguments)},P)},count:function(A){var $=0;return H(A,function(){$++}),$},toArray:function(A){return H(A,function($){return $})||[]},only:function(A){if(!V(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return et.Activity=m,et.Children=U,et.Component=E,et.Fragment=n,et.Profiler=s,et.PureComponent=j,et.StrictMode=r,et.Suspense=h,et.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,et.__COMPILER_RUNTIME={__proto__:null,c:function(A){return F.H.useMemoCache(A)}},et.cache=function(A){return function(){return A.apply(null,arguments)}},et.cacheSignal=function(){return null},et.cloneElement=function(A,$,P){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var q=w({},A.props),z=A.key;if($!=null)for(X in $.key!==void 0&&(z=""+$.key),$)!R.call($,X)||X==="key"||X==="__self"||X==="__source"||X==="ref"&&$.ref===void 0||(q[X]=$[X]);var X=arguments.length-2;if(X===1)q.children=P;else if(1<X){for(var se=Array(X),ne=0;ne<X;ne++)se[ne]=arguments[ne+2];q.children=se}return B(A.type,z,q)},et.createContext=function(A){return A={$$typeof:l,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:o,_context:A},A},et.createElement=function(A,$,P){var q,z={},X=null;if($!=null)for(q in $.key!==void 0&&(X=""+$.key),$)R.call($,q)&&q!=="key"&&q!=="__self"&&q!=="__source"&&(z[q]=$[q]);var se=arguments.length-2;if(se===1)z.children=P;else if(1<se){for(var ne=Array(se),ie=0;ie<se;ie++)ne[ie]=arguments[ie+2];z.children=ne}if(A&&A.defaultProps)for(q in se=A.defaultProps,se)z[q]===void 0&&(z[q]=se[q]);return B(A,X,z)},et.createRef=function(){return{current:null}},et.forwardRef=function(A){return{$$typeof:d,render:A}},et.isValidElement=V,et.lazy=function(A){return{$$typeof:g,_payload:{_status:-1,_result:A},_init:G}},et.memo=function(A,$){return{$$typeof:p,type:A,compare:$===void 0?null:$}},et.startTransition=function(A){var $=F.T,P={};F.T=P;try{var q=A(),z=F.S;z!==null&&z(P,q),typeof q=="object"&&q!==null&&typeof q.then=="function"&&q.then(D,re)}catch(X){re(X)}finally{$!==null&&P.types!==null&&($.types=P.types),F.T=$}},et.unstable_useCacheRefresh=function(){return F.H.useCacheRefresh()},et.use=function(A){return F.H.use(A)},et.useActionState=function(A,$,P){return F.H.useActionState(A,$,P)},et.useCallback=function(A,$){return F.H.useCallback(A,$)},et.useContext=function(A){return F.H.useContext(A)},et.useDebugValue=function(){},et.useDeferredValue=function(A,$){return F.H.useDeferredValue(A,$)},et.useEffect=function(A,$){return F.H.useEffect(A,$)},et.useEffectEvent=function(A){return F.H.useEffectEvent(A)},et.useId=function(){return F.H.useId()},et.useImperativeHandle=function(A,$,P){return F.H.useImperativeHandle(A,$,P)},et.useInsertionEffect=function(A,$){return F.H.useInsertionEffect(A,$)},et.useLayoutEffect=function(A,$){return F.H.useLayoutEffect(A,$)},et.useMemo=function(A,$){return F.H.useMemo(A,$)},et.useOptimistic=function(A,$){return F.H.useOptimistic(A,$)},et.useReducer=function(A,$,P){return F.H.useReducer(A,$,P)},et.useRef=function(A){return F.H.useRef(A)},et.useState=function(A){return F.H.useState(A)},et.useSyncExternalStore=function(A,$,P){return F.H.useSyncExternalStore(A,$,P)},et.useTransition=function(){return F.H.useTransition()},et.version="19.2.6",et}var bE;function km(){return bE||(bE=1,oy.exports=y4()),oy.exports}var T=km();const Ut=m4(T),b4=p4({__proto__:null,default:Ut},[T]);var ly={exports:{}},ku={},cy={exports:{}},uy={};/**
18 * @license React
19 * scheduler.production.js
20 *
21 * Copyright (c) Meta Platforms, Inc. and affiliates.
22 *
23 * This source code is licensed under the MIT license found in the
24 * LICENSE file in the root directory of this source tree.
25 */var xE;function x4(){return xE||(xE=1,(function(t){function e(I,H){var G=I.length;I.push(H);e:for(;0<G;){var re=G-1>>>1,U=I[re];if(0<s(U,H))I[re]=H,I[G]=U,G=re;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var H=I[0],G=I.pop();if(G!==H){I[0]=G;e:for(var re=0,U=I.length,A=U>>>1;re<A;){var $=2*(re+1)-1,P=I[$],q=$+1,z=I[q];
vendor: 10,773 bytes, lines 25-41
25if(0>s(P,G))q<U&&0>s(z,P)?(I[re]=z,I[q]=G,re=q):(I[re]=P,I[$]=G,re=$);else if(q<U&&0>s(z,G))I[re]=z,I[q]=G,re=q;else break e}}return H}function s(I,H){var G=I.sortIndex-H.sortIndex;return G!==0?G:I.id-H.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var l=Date,d=l.now();t.unstable_now=function(){return l.now()-d}}var h=[],p=[],g=1,m=null,y=3,b=!1,_=!1,w=!1,S=!1,E=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function N(I){for(var H=n(p);H!==null;){if(H.callback===null)r(p);else if(H.startTime<=I)r(p),H.sortIndex=H.expirationTime,e(h,H);else break;H=n(p)}}function O(I){if(w=!1,N(I),!_)if(n(h)!==null)_=!0,D||(D=!0,W());else{var H=n(p);H!==null&&te(O,H.startTime-I)}}var D=!1,F=-1,R=5,B=-1;function M(){return S?!0:!(t.unstable_now()-B<R)}function V(){if(S=!1,D){var I=t.unstable_now();B=I;var H=!0;try{e:{_=!1,w&&(w=!1,k(F),F=-1),b=!0;var G=y;try{t:{for(N(I),m=n(h);m!==null&&!(m.expirationTime>I&&M());){var re=m.callback;if(typeof re=="function"){m.callback=null,y=m.priorityLevel;var U=re(m.expirationTime<=I);if(I=t.unstable_now(),typeof U=="function"){m.callback=U,N(I),H=!0;break t}m===n(h)&&r(h),N(I)}else r(h);m=n(h)}if(m!==null)H=!0;else{var A=n(p);A!==null&&te(O,A.startTime-I),H=!1}}break e}finally{m=null,y=G,b=!1}H=void 0}}finally{H?W():D=!1}}}var W;if(typeof j=="function")W=function(){j(V)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,K=Q.port2;Q.port1.onmessage=V,W=function(){K.postMessage(null)}}else W=function(){E(V,0)};function te(I,H){F=E(function(){I(t.unstable_now())},H)}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(I){I.callback=null},t.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<I?Math.floor(1e3/I):5},t.unstable_getCurrentPriorityLevel=function(){return y},t.unstable_next=function(I){switch(y){case 1:case 2:case 3:var H=3;break;default:H=y}var G=y;y=H;try{return I()}finally{y=G}},t.unstable_requestPaint=function(){S=!0},t.unstable_runWithPriority=function(I,H){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var G=y;y=I;try{return H()}finally{y=G}},t.unstable_scheduleCallback=function(I,H,G){var re=t.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?re+G:re):G=re,I){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=G+U,I={id:g++,callback:H,priorityLevel:I,startTime:G,expirationTime:U,sortIndex:-1},G>re?(I.sortIndex=G,e(p,I),n(h)===null&&I===n(p)&&(w?(k(F),F=-1):w=!0,te(O,G-re))):(I.sortIndex=U,e(h,I),_||b||(_=!0,D||(D=!0,W()))),I},t.unstable_shouldYield=M,t.unstable_wrapCallback=function(I){var H=y;return function(){var G=y;y=H;try{return I.apply(this,arguments)}finally{y=G}}}})(uy)),uy}var _E;function _4(){return _E||(_E=1,cy.exports=x4()),cy.exports}var dy={exports:{}},ir={};/**
26 * @license React
27 * react-dom.production.js
28 *
29 * Copyright (c) Meta Platforms, Inc. and affiliates.
30 *
31 * This source code is licensed under the MIT license found in the
32 * LICENSE file in the root directory of this source tree.
33 */var wE;function w4(){if(wE)return ir;wE=1;var t=km();function e(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)p+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+h+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function o(h,p,g){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:m==null?null:""+m,children:h,containerInfo:p,implementation:g}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,p){if(h==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return ir.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,ir.createPortal=function(h,p){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(e(299));return o(h,p,null,g)},ir.flushSync=function(h){var p=l.T,g=r.p;try{if(l.T=null,r.p=2,h)return h()}finally{l.T=p,r.p=g,r.d.f()}},ir.preconnect=function(h,p){typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,r.d.C(h,p))},ir.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},ir.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var g=p.as,m=d(g,p.crossOrigin),y=typeof p.integrity=="string"?p.integrity:void 0,b=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;g==="style"?r.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:m,integrity:y,fetchPriority:b}):g==="script"&&r.d.X(h,{crossOrigin:m,integrity:y,fetchPriority:b,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},ir.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var g=d(p.as,p.crossOrigin);r.d.M(h,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&r.d.M(h)},ir.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var g=p.as,m=d(g,p.crossOrigin);r.d.L(h,g,{crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},ir.preloadModule=function(h,p){if(typeof h=="string")if(p){var g=d(p.as,p.crossOrigin);r.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else r.d.m(h)},ir.requestFormReset=function(h){r.d.r(h)},ir.unstable_batchedUpdates=function(h,p){return h(p)},ir.useFormState=function(h,p,g){return l.H.useFormState(h,p,g)},ir.useFormStatus=function(){return l.H.useHostTransitionStatus()},ir.version="19.2.6",ir}var SE;function $2(){if(SE)return dy.exports;SE=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),dy.exports=w4(),dy.exports}/**
34 * @license React
35 * react-dom-client.production.js
36 *
37 * Copyright (c) Meta Platforms, Inc. and affiliates.
38 *
39 * This source code is licensed under the MIT license found in the
40 * LICENSE file in the root directory of this source tree.
41 */var EE;function S4(){if(EE)return ku;EE=1;var t=_4(),e=km(),n=$2();function r(i){var a="https://react.dev/errors/"+i;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)a+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+i+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function o(i){var a=i,c=i;if(i.alternate)for(;a.return;)a=a.return;else{i=a;do a=i,(a.flags&4098)!==0&&(c=a.return),i=a.return;while(i)}return a.tag===3?c:null}function l(i){if(i.tag===13){var a=i.memoizedState;if(a===null&&(i=i.alternate,i!==null&&(a=i.memoizedState)),a!==null)return a.dehydrated}return null}function d(i){if(i.tag===31){var a=i.memoizedState;if(a===null&&(i=i.alternate,i!==null&&(a=i.memoizedState)),a!==null)return a.dehydrated}return null}function h(i){if(o(i)!==i)throw Error(r(188))}function p(i){var a=i.alternate;if(!a){if(a=o(i),a===null)throw Error(r(188));return a!==i?null:i}for(var c=i,f=a;;){var v=c.return;if(v===null)break;var x=v.alternate;if(x===null){if(f=v.return,f!==null){c=f;continue}break}if(v.child===x.child){for(x=v.child;x;){if(x===c)return h(v),i;if(x===f)return h(v),a;x=x.sibling}throw Error(r(188))}if(c.return!==f.return)c=v,f=x;else{for(var C=!1,L=v.child;L;){if(L===c){C=!0,c=v,f=x;break}if(L===f){C=!0,f=v,c=x;break}L=L.sibling}if(!C){for(L=x.child;L;){if(L===c){C=!0,c=x,f=v;break}if(L===f){C=!0,f=x,c=v;break}L=L.sibling}if(!C)throw Error(r(189))}}if(c.alternate!==f)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?i:a}function g(i){var a=i.tag;if(a===5||a===26||a===27||a===6)return i;for(i=i.child;i!==null;){if(a=g(i),a!==null)return a;i=i.sibling}return null}var m=Object.assign,y=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),j=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),M=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function W(i){return i===null||typeof i!="object"?null:(i=V&&i[V]||i["@@iterator"],typeof i=="function"?i:null)}var Q=Symbol.for("react.client.reference");function K(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===Q?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case w:return"Fragment";case E:return"Profiler";case S:return"StrictMode";case O:return"Suspense";case D:return"SuspenseList";case B:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case _:return"Portal";case j:return i.displayName||"Context";case k:return(i._context.displayName||"Context")+".Consumer";case N:var a=i.render;return i=i.displayName,i||(i=a.displayName||a.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case F:return a=i.displayName||null,a!==null?a:K(i.type)||"Memo";case R:a=i._payload,i=i._init;try{return K(i(a))}catch{}}return null}var te=Array.isArray,I=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pen
vendor: 4,220 bytes, lines 41-48
41ding:!1,data:null,method:null,action:null},re=[],U=-1;function A(i){return{current:i}}function $(i){0>U||(i.current=re[U],re[U]=null,U--)}function P(i,a){U++,re[U]=i.current,i.current=a}var q=A(null),z=A(null),X=A(null),se=A(null);function ne(i,a){switch(P(X,a),P(z,i),P(q,null),a.nodeType){case 9:case 11:i=(i=a.documentElement)&&(i=i.namespaceURI)?$S(i):0;break;default:if(i=a.tagName,a=a.namespaceURI)a=$S(a),i=US(a,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}$(q),P(q,i)}function ie(){$(q),$(z),$(X)}function fe(i){i.memoizedState!==null&&P(se,i);var a=q.current,c=US(a,i.type);a!==c&&(P(z,i),P(q,c))}function _e(i){z.current===i&&($(q),$(z)),se.current===i&&($(se),xu._currentValue=G)}var Te,Oe;function xe(i){if(Te===void 0)try{throw Error()}catch(c){var a=c.stack.trim().match(/\n( *(at )?)/);Te=a&&a[1]||"",Oe=-1<c.stack.indexOf(`
42    at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
43`+Te+i+Oe}var Ge=!1;function Le(i,a){if(!i||Ge)return"";Ge=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(a){var be=function(){throw Error()};if(Object.defineProperty(be.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(be,[])}catch(he){var ue=he}Reflect.construct(i,[],be)}else{try{be.call()}catch(he){ue=he}i.call(be.prototype)}}else{try{throw Error()}catch(he){ue=he}(be=i())&&typeof be.catch=="function"&&be.catch(function(){})}}catch(he){if(he&&ue&&typeof he.stack=="string")return[he.stack,ue.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=f.DetermineComponentFrameRoot(),C=x[0],L=x[1];if(C&&L){var J=C.split(`
44`),ce=L.split(`
45`);for(v=f=0;f<J.length&&!J[f].includes("DetermineComponentFrameRoot");)f++;for(;v<ce.length&&!ce[v].includes("DetermineComponentFrameRoot");)v++;if(f===J.length||v===ce.length)for(f=J.length-1,v=ce.length-1;1<=f&&0<=v&&J[f]!==ce[v];)v--;for(;1<=f&&0<=v;f--,v--)if(J[f]!==ce[v]){if(f!==1||v!==1)do if(f--,v--,0>v||J[f]!==ce[v]){var me=`
46`+J[f].replace(" at new "," at ");return i.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",i.displayName)),me}while(1<=f&&0<=v);break}}}finally{Ge=!1,Error.prepareStackTrace=c}return(c=i?i.displayName||i.name:"")?xe(c):""}function mt(i,a){switch(i.tag){case 26:case 27:case 5:return xe(i.type);case 16:return xe("Lazy");case 13:return i.child!==a&&a!==null?xe("Suspense Fallback"):xe("Suspense");case 19:return xe("SuspenseList");case 0:case 15:return Le(i.type,!1);case 11:return Le(i.type.render,!1);case 1:return Le(i.type,!0);case 31:return xe("Activity");default:return""}}function Et(i){try{var a="",c=null;do a+=mt(i,c),c=i,i=i.return;while(i);return a}catch(f){return`
47Error generating stack: `+f.message+`
48`+f.stack}}var Jt=Object.prototype.hasOwnProperty,wt=t.unstable_scheduleCallback,Xt=t.unstable_cancelCallback,ur=t.unstable_shouldYield,jn=t.unstable_requestPaint,Zt=t.unstable_now,nr=t.unstable_getCurrentPriorityLevel,dr=t.unstable_ImmediatePriority,rr=t.unstable_UserBlockingPriority,Mn=t.unstable_NormalPriority,on=t.unstable_LowPriority,zt=t.unstable_IdlePriority,Ln=t.log,hr=t.unstable_setDisableYieldValue,fr=null,Pn=null;function Nt(i){if(typeof Ln=="function"&&hr(i),Pn&&typeof Pn.setStrictMode=="function")try{Pn.setStrictMode(fr,i)}catch{}}var yn=Math.clz32?Math.clz32:sa,ei=Math.log,cs=Math.LN2;function sa(i){return i>>>=0,i===0?32:31-(ei(i)/cs|0)|0}var Ei=256,Pr=262144,pe=4194304;function Ue(i){var a=i&42;if(a!==0)return a;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;
vendor: 5,038 bytes, line 48
48case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function He(i,a,c){var f=i.pendingLanes;if(f===0)return 0;var v=0,x=i.suspendedLanes,C=i.pingedLanes;i=i.warmLanes;var L=f&134217727;return L!==0?(f=L&~x,f!==0?v=Ue(f):(C&=L,C!==0?v=Ue(C):c||(c=L&~i,c!==0&&(v=Ue(c))))):(L=f&~x,L!==0?v=Ue(L):C!==0?v=Ue(C):c||(c=f&~i,c!==0&&(v=Ue(c)))),v===0?0:a!==0&&a!==v&&(a&x)===0&&(x=v&-v,c=a&-a,x>=c||x===32&&(c&4194048)!==0)?a:v}function Bt(i,a){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&a)===0}function Fn(i,a){switch(i){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function bn(){var i=pe;return pe<<=1,(pe&62914560)===0&&(pe=4194304),i}function dn(i){for(var a=[],c=0;31>c;c++)a.push(i);return a}function dt(i,a){i.pendingLanes|=a,a!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function kt(i,a,c,f,v,x){var C=i.pendingLanes;i.pendingLanes=c,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=c,i.entangledLanes&=c,i.errorRecoveryDisabledLanes&=c,i.shellSuspendCounter=0;var L=i.entanglements,J=i.expirationTimes,ce=i.hiddenUpdates;for(c=C&~c;0<c;){var me=31-yn(c),be=1<<me;L[me]=0,J[me]=-1;var ue=ce[me];if(ue!==null)for(ce[me]=null,me=0;me<ue.length;me++){var he=ue[me];he!==null&&(he.lane&=-536870913)}c&=~be}f!==0&&$n(i,f,0),x!==0&&v===0&&i.tag!==0&&(i.suspendedLanes|=x&~(C&~a))}function $n(i,a,c){i.pendingLanes|=a,i.suspendedLanes&=~a;var f=31-yn(a);i.entangledLanes|=a,i.entanglements[f]=i.entanglements[f]|1073741824|c&261930}function xn(i,a){var c=i.entangledLanes|=a;for(i=i.entanglements;c;){var f=31-yn(c),v=1<<f;v&a|i[f]&a&&(i[f]|=a),c&=~v}}function Y(i,a){var c=a&-a;return c=(c&42)!==0?1:Z(c),(c&(i.suspendedLanes|a))!==0?0:c}function Z(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function oe(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function ge(){var i=H.p;return i!==0?i:(i=window.event,i===void 0?32:cE(i.type))}function ye(i,a){var c=H.p;try{return H.p=i,a()}finally{H.p=c}}var Ce=Math.random().toString(36).slice(2),Se="__reactFiber$"+Ce,De="__reactProps$"+Ce,Ne="__reactContainer$"+Ce,Pe="__reactEvents$"+Ce,Ve="__reactListeners$"+Ce,Ze="__reactHandles$"+Ce,ze="__reactResources$"+Ce,at="__reactMarker$"+Ce;function bt(i){delete i[Se],delete i[De],delete i[Pe],delete i[Ve],delete i[Ze]}function Qt(i){var a=i[Se];if(a)return a;for(var c=i.parentNode;c;){if(a=c[Ne]||c[Se]){if(c=a.alternate,a.child!==null||c!==null&&c.child!==null)for(i=WS(i);i!==null;){if(c=i[Se])return c;i=WS(i)}return a}i=c,c=i.parentNode}return null}function jt(i){if(i=i[Se]||i[Ne]){var a=i.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return i}return null}function gt(i){var a=i.tag;if(a===5||a===26||a===27||a===6)return i.stateNode;throw Error(r(33))}function _n(i){var a=i[ze];return a||(a=i[ze]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function vt(i){i[at]=!0}var aa=new Set,ki={};function Sr(i,a){pr(i,a),pr(i+"Capture",a)}function pr(i,a){for(ki[i]=a,i=0;i<a.length;i++)aa.add(a[i])}var ti=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Yo={},ji={};function Ko(i){return Jt.call(ji,i)?!0:Jt.call(Yo,i)?!1:ti.test(i)?ji[i]=!0:(Yo[i]=!0,!1)}function us(i,a,c){if(Ko(a))if(c===null)i.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":i.removeAttribute(a);return;case"boolean":var f=a.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){i.removeAttribute(a);return}}i.setAttribute(a,""+c)}}function ds(i,a,c){if(c===null)i.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(a);return}i.setAttribute(a,""+c)}}function Qe(i,a,c,f){if(f===null)i.removeAttribute(c);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(c);return}i.setAttributeNS(a,c,""+f)}}function Ht(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}
vendor: 5,521 bytes, line 48
48function Fr(i){var a=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Ti(i,a,c){var f=Object.getOwnPropertyDescriptor(i.constructor.prototype,a);if(!i.hasOwnProperty(a)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var v=f.get,x=f.set;return Object.defineProperty(i,a,{configurable:!0,get:function(){return v.call(this)},set:function(C){c=""+C,x.call(this,C)}}),Object.defineProperty(i,a,{enumerable:f.enumerable}),{getValue:function(){return c},setValue:function(C){c=""+C},stopTracking:function(){i._valueTracker=null,delete i[a]}}}}function Jo(i){if(!i._valueTracker){var a=Fr(i)?"checked":"value";i._valueTracker=Ti(i,a,""+i[a])}}function Xo(i){if(!i)return!1;var a=i._valueTracker;if(!a)return!0;var c=a.getValue(),f="";return i&&(f=Fr(i)?i.checked?"true":"false":i.value),i=f,i!==c?(a.setValue(i),!0):!1}function At(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var hs=/[\n"\\]/g;function mr(i){return i.replace(hs,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Lc(i,a,c,f,v,x,C,L){i.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?i.type=C:i.removeAttribute("type"),a!=null?C==="number"?(a===0&&i.value===""||i.value!=a)&&(i.value=""+Ht(a)):i.value!==""+Ht(a)&&(i.value=""+Ht(a)):C!=="submit"&&C!=="reset"||i.removeAttribute("value"),a!=null?tg(i,C,Ht(a)):c!=null?tg(i,C,Ht(c)):f!=null&&i.removeAttribute("value"),v==null&&x!=null&&(i.defaultChecked=!!x),v!=null&&(i.checked=v&&typeof v!="function"&&typeof v!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?i.name=""+Ht(L):i.removeAttribute("name")}function D_(i,a,c,f,v,x,C,L){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(i.type=x),a!=null||c!=null){if(!(x!=="submit"&&x!=="reset"||a!=null)){Jo(i);return}c=c!=null?""+Ht(c):"",a=a!=null?""+Ht(a):c,L||a===i.value||(i.value=a),i.defaultValue=a}f=f??v,f=typeof f!="function"&&typeof f!="symbol"&&!!f,i.checked=L?i.checked:!!f,i.defaultChecked=!!f,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(i.name=C),Jo(i)}function tg(i,a,c){a==="number"&&At(i.ownerDocument)===i||i.defaultValue===""+c||(i.defaultValue=""+c)}function Zo(i,a,c,f){if(i=i.options,a){a={};for(var v=0;v<c.length;v++)a["$"+c[v]]=!0;for(c=0;c<i.length;c++)v=a.hasOwnProperty("$"+i[c].value),i[c].selected!==v&&(i[c].selected=v),v&&f&&(i[c].defaultSelected=!0)}else{for(c=""+Ht(c),a=null,v=0;v<i.length;v++){if(i[v].value===c){i[v].selected=!0,f&&(i[v].defaultSelected=!0);return}a!==null||i[v].disabled||(a=i[v])}a!==null&&(a.selected=!0)}}function I_(i,a,c){if(a!=null&&(a=""+Ht(a),a!==i.value&&(i.value=a),c==null)){i.defaultValue!==a&&(i.defaultValue=a);return}i.defaultValue=c!=null?""+Ht(c):""}function M_(i,a,c,f){if(a==null){if(f!=null){if(c!=null)throw Error(r(92));if(te(f)){if(1<f.length)throw Error(r(93));f=f[0]}c=f}c==null&&(c=""),a=c}c=Ht(a),i.defaultValue=c,f=i.textContent,f===c&&f!==""&&f!==null&&(i.value=f),Jo(i)}function Qo(i,a){if(a){var c=i.firstChild;if(c&&c===i.lastChild&&c.nodeType===3){c.nodeValue=a;return}}i.textContent=a}var c5=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function L_(i,a,c){var f=a.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?f?i.setProperty(a,""):a==="float"?i.cssFloat="":i[a]="":f?i.setProperty(a,c):typeof c!="number"||c===0||c5.has(a)?a==="float"?i.cssFloat=c:i[a]=(""+c).trim():i[a]=c+"px"}function P_(i,a,c){if(a!=null&&typeof a!="object")throw Error(r(62));if(i=i.style,c!=null){for(var f in c)!c.hasOwnProperty(f)||a!=null&&a.hasOwnProperty(f)||(f.indexOf("--")===0?i.setProperty(f,""):f==="float"?i.cssFloat="":i[f]="");for(var v in a)f=a[v],a.hasOwnProperty(v)&&c[v]!==f&&L_(i,v,f)}else for(var x in a)a.hasOwnProperty(x)&&L_(i,x,a[x])}function ng(i){if(i.indexOf("-")===-1)return!1;switch(i){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 u5=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRen
48dering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),d5=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function wh(i){return d5.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function fs(){}var rg=null;function ig(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var el=null,tl=null;function F_(i){var a=jt(i);if(a&&(i=a.stateNode)){var c=i[De]||null;e:switch(i=a.stateNode,a.type){case"input":if(Lc(i,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),a=c.name,c.type==="radio"&&a!=null){for(c=i;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+mr(""+a)+'"][type="radio"]'),a=0;a<c.length;a++){var f=c[a];if(f!==i&&f.form===i.form){var v=f[De]||null;if(!v)throw Error(r(90));Lc(f,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(a=0;a<c.length;a++)f=c[a],f.form===i.form&&Xo(f)}break e;case"textarea":I_(i,c.value,c.defaultValue);break e;case"select":a=c.value,a!=null&&Zo(i,!!c.multiple,a,!1)}}}var sg=!1;function $_(i,a,c){if(sg)return i(a,c);sg=!0;try{var f=i(a);return f}finally{if(sg=!1,(el!==null||tl!==null)&&(uf(),el&&(a=el,i=tl,tl=el=null,F_(a),i)))for(a=0;a<i.length;a++)F_(i[a])}}function Pc(i,a){var c=i.stateNode;if(c===null)return null;var f=c[De]||null;if(f===null)return null;c=f[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(i=i.type,f=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!f;break e;default:i=!1}if(i)return null;if(c&&typeof c!="function")throw Error(r(231,a,typeof c));return c}var ps=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ag=!1;if(ps)try{var Fc={};Object.defineProperty(Fc,"passive",{get:function(){ag=!0}}),window.addEventListener("test",Fc,Fc),window.removeEventListener("test",Fc,Fc)}catch{ag=!1}var oa=null,og=null,Sh=null;function U_(){if(Sh)return Sh;var i,a=og,c=a.length,f,v="value"in oa?oa.value:oa.textContent,x=v.length;for(i=0;i<c&&a[i]===v[i];i++);var C=c-i;for(f=1;f<=C&&a[c-f]===v[x-f];f++);return Sh=v.slice(i,1<f?1-f:void 0)}function Eh(i){var a=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&a===13&&(i=13)):i=a,i===10&&(i=13),32<=i||i===13?i:0}function kh(){return!0}function z_(){return!1}function Er(i){function a(c,f,v,x,C){this._reactName=c,this._targetInst=v,this.type=f,this.nativeEvent=x,this.target=C,this.currentTarget=null;for(var L in i)i.hasOwnProperty(L)&&(c=i[L],this[L]=c?c(x):x[L]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?kh:z_,this.isPropagationStopped=z_,this}return m(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=kh)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=kh)},persist:function(){},isPersistent:kh}),a}var Ja={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jh=Er(Ja),$c=m({},Ja,{view:0,detail:0}),h5=Er($c),lg,cg,Uc,Th=m({},$c,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:dg,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Uc&&(Uc&&i.type==="mousemove"?(lg=i.screenX-Uc.screenX,cg=i.screenY-Uc.screenY):cg=lg=0,Uc=i),lg)},movementY:function(i){return"movementY"in i?i.movementY:cg}}
vendor: 1,300 bytes, line 48
48),B_=Er(Th),f5=m({},Th,{dataTransfer:0}),p5=Er(f5),m5=m({},$c,{relatedTarget:0}),ug=Er(m5),g5=m({},Ja,{animationName:0,elapsedTime:0,pseudoElement:0}),v5=Er(g5),y5=m({},Ja,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),b5=Er(y5),x5=m({},Ja,{data:0}),H_=Er(x5),_5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},w5={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"},S5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function E5(i){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(i):(i=S5[i])?!!a[i]:!1}function dg(){return E5}var k5=m({},$c,{key:function(i){if(i.key){var a=_5[i.key]||i.key;if(a!=="Unidentified")return a}return i.type==="keypress"?(i=Eh(i),i===13?"Enter":String.fromCharCode(i)):i.type==="
48keydown"||i.type==="keyup"?w5[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:dg,charCode:function(i){return i.type==="keypress"?Eh(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Eh(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),j5=Er(k5),T5=m({},Th,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),q_=Er(T5),N5=m({},$c,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:dg}),A5=Er(N5),C5=m({},Ja,{propertyName:0,elapsedTime:0,pseudoElement:0}),R5=Er(C5),O5=m({},Th,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),D5=Er(O5),I5=m({},Ja,{newState:0,oldState:0}),M5=Er(I5),L5=[9,13,27,32],hg=ps&&"CompositionEvent"in window,zc=null;ps&&"documentMode"in document&&(zc=document.documentMode);var P5=ps&&"TextEvent"in window&&!zc,G_=ps&&(!hg||zc&&8<zc&&11>=zc),V_=" ",W_=!1;function Y_(i,a){switch(i){case"keyup":return L5.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function K_(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var nl=!1;function F5(i,a){switch(i){case"compositionend":return K_(a);case"keypress":return a.which!==32?null:(W_=!0,V_);case"textInput":return i=a.data,i===V_&&W_?null:i;default:return null}}function $5(i,a){if(nl)return i==="compositionend"||!hg&&Y_(i,a)?(i=U_(),Sh=og=oa=null,nl=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return G_&&a.locale!=="ko"?null:a.data;default:return null}}var U5={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 J_(i){var a=i&&i.nodeName&&i.nodeName.toLowerCase();return a==="input"?!!U5[i.type]:a==="textarea"}function X_(i,a,c,f){el?tl?tl.push(f):tl=[f]:el=f,a=vf(a,"onChange"),0<a.length&&(c=new jh("onChange","change",null,c,f),i.push({event:c,listeners:a}))}var Bc=null,Hc=null;function z5(i){DS(i,0)}function Nh(i){var a=gt(i);if(Xo(a))return i}function Z_(i,a){if(i==="change")return a}var Q_=!1;if(ps){var fg;if(ps){var pg="oninput"in document;if(!pg){var ew=document.createElement("div");ew.setAttribute("oninput","return;"),pg=typeof ew.oninput=="function"}fg=pg}else fg=!1;Q_=fg&&(!document.documentMode||9<document.documentMode)}function tw(){Bc&&(Bc.detachEvent("onpropertychange",nw),Hc=Bc=null)}function nw(i){if(i.propertyName==="value"&&Nh(Hc)){var a=[];X_(a,Hc,i,ig(i)),$_(z5,a)}}function B5(i,a,c){i==="focusin"?(tw(),Bc=a,Hc=c,Bc.attachEvent("onpropertychange",nw)):i==="focusout"&&tw()}function H5(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Nh(Hc)}function q5(i,a){if(i==="click")return Nh(a)}function G5(i,a){if(i==="input"||i==="change")return Nh(a)}function V5(i,a){return i===a&&(i!==0||1/i===1/a)||i!==i&&a!==a}var $r=typeof Object.is=="function"?Object.is:V5;function qc(i,a){if($r(i,a))return!0;if(typeof i!="object"||i===null||typeof a!="object"||a===null)return!1;var c=Object.keys(i),f=Object.keys(a);if(c.length!==f.length)return!1;for(f=0;f<c.length;f++){var v=c[f];if(!Jt.call(a,v)||!$r(i[v],a[v]))return!1}return!0}function rw(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function iw(i,a){var c=rw(i);i=0;for(var f;c;){if(c.nodeType===3){if(f=i+c.textContent.length,i<=a&&f>=a)return{node:c,offset:a-i};i=f}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=rw(c)}}function sw(i,a){return i&&a?i===a?!0:i&&i.nodeType===3?!1:a&&a.nodeType===3?sw(i,a.parentNode):"contains"in i?i.contains(a):i.compareDocumentPosition?!!(i.compareDocumentPosition(a)&16):!1:!1}function aw(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var a=At(i.document);a instanceof i.HTMLIFrameElement;){try{var c=typeof a.contentWindow.location.href=="string"}catch{c=!1}if(c)i=a.contentWindow;else break;a=At(i.document)}return a}function mg(i){var a=i&&i.nodeName&&i.nodeName.toLowerCase();return a&&(a==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||a==="textarea"||i.contentEditable==="true")}var W5=ps&&"documentMode"in document&&11>=document.documentMode,rl=null,gg=null,Gc=null,vg=!1;function ow(i,a,c){var f=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;vg||rl==null||rl!==At(f)||(f=rl,"selectionStart"in f&&mg(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focu
vendor: 20,478 bytes, line 48
48sNode:f.focusNode,focusOffset:f.focusOffset}),Gc&&qc(Gc,f)||(Gc=f,f=vf(gg,"onSelect"),0<f.length&&(a=new jh("onSelect","select",null,a,c),i.push({event:a,listeners:f}),a.target=rl)))}function Xa(i,a){var c={};return c[i.toLowerCase()]=a.toLowerCase(),c["Webkit"+i]="webkit"+a,c["Moz"+i]="moz"+a,c}var il={animationend:Xa("Animation","AnimationEnd"),animationiteration:Xa("Animation","AnimationIteration"),animationstart:Xa("Animation","AnimationStart"),transitionrun:Xa("Transition","TransitionRun"),transitionstart:Xa("Transition","TransitionStart"),transitioncancel:Xa("Transition","TransitionCancel"),transitionend:Xa("Transition","TransitionEnd")},yg={},lw={};ps&&(lw=document.createElement("div").style,"AnimationEvent"in window||(delete il.animationend.animation,delete il.animationiteration.animation,delete il.animationstart.animation),"TransitionEvent"in window||delete il.transitionend.transition);function Za(i){if(yg[i])return yg[i];if(!il[i])return i;var a=il[i],c;for(c in a)if(a.hasOwnProperty(c)&&c in lw)return yg[i]=a[c];return i}var cw=Za("animationend"),uw=Za("animationiteration"),dw=Za("animationstart"),Y5=Za("transitionrun"),K5=Za("transitionstart"),J5=Za("transitioncancel"),hw=Za("transitionend"),fw=new Map,bg="abort auxClick beforeToggle 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(" ");bg.push("scrollEnd");function Ni(i,a){fw.set(i,a),Sr(a,[i])}var Ah=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},ni=[],sl=0,xg=0;function Ch(){for(var i=sl,a=xg=sl=0;a<i;){var c=ni[a];ni[a++]=null;var f=ni[a];ni[a++]=null;var v=ni[a];ni[a++]=null;var x=ni[a];if(ni[a++]=null,f!==null&&v!==null){var C=f.pending;C===null?v.next=v:(v.next=C.next,C.next=v),f.pending=v}x!==0&&pw(c,v,x)}}function Rh(i,a,c,f){ni[sl++]=i,ni[sl++]=a,ni[sl++]=c,ni[sl++]=f,xg|=f,i.lanes|=f,i=i.alternate,i!==null&&(i.lanes|=f)}function _g(i,a,c,f){return Rh(i,a,c,f),Oh(i)}function Qa(i,a){return Rh(i,null,null,a),Oh(i)}function pw(i,a,c){i.lanes|=c;var f=i.alternate;f!==null&&(f.lanes|=c);for(var v=!1,x=i.return;x!==null;)x.childLanes|=c,f=x.alternate,f!==null&&(f.childLanes|=c),x.tag===22&&(i=x.stateNode,i===null||i._visibility&1||(v=!0)),i=x,x=x.return;return i.tag===3?(x=i.stateNode,v&&a!==null&&(v=31-yn(c),i=x.hiddenUpdates,f=i[v],f===null?i[v]=[a]:f.push(a),a.lane=c|536870912),x):null}function Oh(i){if(50<fu)throw fu=0,Cv=null,Error(r(185));for(var a=i.return;a!==null;)i=a,a=i.return;return i.tag===3?i.stateNode:null}var al={};function X5(i,a,c,f){this.tag=i,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ur(i,a,c,f){return new X5(i,a,c,f)}function wg(i){return i=i.prototype,!(!i||!i.isReactComponent)}function ms(i,a){var c=i.alternate;return c===null?(c=Ur(i.tag,a,i.key,i.mode),c.elementType=i.elementType,c.type=i.type,c.stateNode=i.stateNode,c.alternate=i,i.alternate=c):(c.pendingProps=a,c.type=i.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=i.flags&65011712,c.childLanes=i.childLanes,c.lanes=i.lanes,c.child=i.child,c.memoizedProps=i.memoizedProps,c.memoizedState=i.memoizedState,c.updateQueue=i.updateQueue,a=i.dependencies,c.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},c.sibling=i.sibling,c.index=i.index,c.ref=i.ref,c.refCleanup=i.refCleanup,c}function mw(i,a){i.flags&=65011714;var c=i.alternate;return c===null?(i.childLanes=0,i.lanes=a,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=c.childLanes,i.lanes=c.lanes,i.child=c.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=c.memoizedProps,i.memoizedState=c.memoizedState,i.updateQueue=c.updateQueue,i.type=c.type,a=c.dependencies,i.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),i}function Dh(i,a,c,f,v,x){var C=0;if(f=i,typeof i=="function")wg(i)&&(C=1);else if(typeof i=="string")C=n4(i,c,q.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case B:return i=Ur(31,c,a,v),i.elementType=B,i.lanes=x,i;case w:return eo(c.children,v,x,a);case S:C=8,v|=24;break;case E:return i=Ur(12,c,a,v|2),i.elementType=E,i.lanes=x,i;case O:return i=Ur(13,c,a,v),i.elementType=O,i.lanes=x,i;case D:return i=Ur(19,c,a,v),i.elementType=D,i.lanes=x,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case j:C=10;break e;case k:C=9;break e;case N:C=11;break e;case F:C=14;break e;case R:C=16,f=null;break e}C=29,c=Error(r(130,i===null?"null":typeof i,"")),f=null}return a=Ur(C,c,a,v),a.elementType=i,a.type=f,a.lanes=x,a}function eo(i,a,c,f){return i=Ur(7,i,f,a),i.lanes=c,i}function Sg(i,a,c){return i=Ur(6,i,null,a),i.lanes=c,i}function gw(i){var a=Ur(18,null,null,0);return a.stateNode=i,a}function Eg(i,a,c){return a=Ur(4,i.children!==null?i.children:[],i.key,a),a.lanes=c,a.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},a}var vw=new WeakMap;function ri(i,a){if(typeof i=="object"&&i!==null){var c=vw.get(i);return c!==void 0?c:(a={value:i,source:a,stack:Et(a)},vw.set(i,a),a)}return{value:i,source:a,stack:Et(a)}}var ol=[],ll=0,Ih=null,Vc=0,ii=[],si=0,la=null,qi=1,Gi="";function gs(i,a){ol[ll++]=Vc,ol[ll++]=Ih,Ih=i,Vc=a}function yw(i,a,c){ii[si++]=qi,ii[si++]=Gi,ii[si++]=la,la=i;var f=qi;i=Gi;var v=32-yn(f)-1;f&=~(1<<v),c+=1;var x=32-yn(a)+v;if(30<x){var C=v-v%5;x=(f&(1<<C)-1).toString(32),f>>=C,v-=C,qi=1<<32-yn(a)+v|c<<v|f,Gi=x+i}else qi=1<<x|c<<v|f,Gi=i}function kg(i){i.return!==null&&(gs(i,1),yw(i,1,0))}function jg(i){for(;i===Ih;)Ih=ol[--ll],ol[ll]=null,Vc=ol[--ll],ol[ll]=null;for(;i===la;)la=ii[--si],ii[si]=null,Gi=ii[--si],ii[si]=null,qi=ii[--si],ii[si]=null}function bw(i,a){ii[si++]=qi,ii[si++]=Gi,ii[si++]=la,qi=a.id,Gi=a.overflow,la=i}var Wn=null,en=null,pt=!1,ca=null,ai=!1,Tg=Error(r(519));function ua(i){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Wc(ri(a,i)),Tg}function xw(i){var a=i.stateNode,c=i.type,f=i.memoizedProps;switch(a[Se]=i,a[De]=f,c){case"dialog":ct("cancel",a),ct("close",a);break;case"iframe":case"object":case"embed":ct("load",a);break;case"video":case"audio":for(c=0;c<mu.length;c++)ct(mu[c],a);break;case"source":ct("error",a);break;case"img":case"image":case"link":ct("error",a),ct("load",a);break;case"details":ct("toggle",a);break;case"input":ct("invalid",a),D_(a,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":ct("invalid",a);break;case"textarea":ct("invalid",a),M_(a,f.value,f.defaultValue,f.children)}c=f.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||a.textContent===""+c||f.suppressHydrationWarning===!0||PS(a.textContent,c)?(f.popover!=null&&(ct("beforetoggle",a),ct("toggle",a)),f.onScroll!=null&&ct("scroll",a),f.onScrollEnd!=null&&ct("scrollend",a),f.onClick!=null&&(a.onclick=fs),a=!0):a=!1,a||ua(i,!0)}function _w(i){for(Wn=i.return;Wn;)switch(Wn.tag){case 5:case 31:case 13:ai=!1;return;case 27:case 3:ai=!0;return;default:Wn=Wn.return}}function cl(i){if(i!==Wn)return!1;if(!pt)return _w(i),pt=!0,!1;var a=i.tag,c;if((c=a!==3&&a!==27)&&((c=a===5)&&(c=i.type,c=!(c!=="form"&&c!=="button")||Gv(i.type,i.memoizedProps)),c=!c),c&&en&&ua(i),_w(i),a===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));en=VS(i)}else if(a===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));en=VS(i)}else a===27?(a=en,Ea(i.type)?(i=Jv,Jv=null,en=i):en=a):en=Wn?li(i.stateNode.nextSibling):null;return!0}function to(){en=Wn=null,pt=!1}function Ng(){var i=ca;return i!==null&&(Nr===null?Nr=i:Nr.push.apply(Nr,i),ca=null),i}function Wc(i){ca===null?ca=[i]:ca.push(i)}var Ag=A(null),no=null,vs=null;function da(i,a,c){P(Ag,a._currentValue),a._currentValue=c}function ys(i){i._currentValue=Ag.current,$(Ag)}function Cg(i,a,c){for(;i!==null;){var f=i.alternate;if((i.childLanes&a)!==a?(i.childLanes|=a,f!==null&&(f.childLanes|=a)):f!==null&&(f.childLanes&a)!==a&&(f.childLanes|=a),i===c)break;i=i.return}}function Rg(i,a,c,f){var v=i.child;for(v!==null&&(v.return=i);v!==null;){var x=v.dependencies;if(x!==null){var C=v.child;x=x.firstContext;e:for(;x!==null;){var L=x;x=v;for(var J=0;J<a.length;J++)if(L.context===a[J]){x.lanes|=c,L=x.alternate,L!==null&&(L.lanes|=c),Cg(x.return,c,i),f||(C=null);break e}x=L.next}}else if(v.tag===18){if(C=v.return,C===null)throw Error(r(341));C.lanes|=c,x=C.alternate,x!==null&&(x.lanes|=c),Cg(C,c,i),C=null}else C=v.child;if(C!==null)C.return=v;else for(C=v;C!==null;){if(C===i){C=null;break}if(v=C.sibling,v!==null){v.return=C.return,C=v;break}C=C.return}v=C}}function ul(i,a,c,f){i=null;for(var v=a,x=!1;v!==null;){if(!x){if((v.flags&524288)!==0)x=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var C=v.alternate;if(C===null)throw Error(r(387));if(C=C.memoizedProps,C!==null){var L=v.type;$r(v.pendingProps.value,C.value)||(i!==null?i.push(L):i=[L])}}else if(v===se.current){if(C=v.alternate,C===null)throw Error(r(387));C.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(i!==null?i.push(xu):i=[xu])}v=v.return}i!==null&&Rg(a,i,c,f),a.flags|=262144}function Mh(i){for(i=i.firstContext;i!==null;){if(!$r(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function ro(i){no=i,vs=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Yn(i){return ww(no,i)}function Lh(i,a){return no===null&&ro(i),ww(i,a)}function ww(i,a){var c=a._currentValue;if(a={context:a,memoizedValue:c,next:null},vs===null){if(i===null)throw Error(r(308));vs=a,i.dependencies={lanes:0,firstContext:a},i.flags|=524288}else vs=vs.next=a;return c}var Z5=typeof AbortController<"u"?AbortController:function(){var i=[],a=this.signal={aborted:!1,addEventListener:function(c,f){i.push(f)}};this.abort=function(){a.aborted=!0,i.forEach(function(c){return c()})}},Q5=t.unstable_scheduleCallback,eD=t.unstable_NormalPriority,Tn={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Og(){return{controller:new Z5,data:new Map,refCount:0}}function Yc(i){i.refCount--,i.refCount===0&&Q5(eD,function(){i.controller.abort()})}var Kc=null,Dg=0,dl=0,hl=null;function tD(i,a){if(Kc===null){var c=Kc=[];Dg=0,dl=Lv(),hl={status:"pending",value:void 0,then:function(f){c.push(f)}}}return Dg++,a.then(Sw,Sw),a}function Sw(){if(--Dg===0&&Kc!==null){hl!==null&&(hl.status="fulfilled");var i=Kc;Kc=null,dl=0,hl=null;for(var a=0;a<i.length;a++)(0,i[a])()}}function nD(i,a){var c=[],f={status:"pending",value:null,reason:null,then:function(v){c.push(v)}};return i.then(function(){f.status="fulfilled",f.value=a;for(var v=0;v<c.length;v++)(0,c[v])(a)},function(v){for(f.status="rejected",f.reason=v,v=0;v<c.length;v++)(0,c[v])(void 0)}),f}var Ew=I.S;I.S=function(i,a){oS=Zt(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&tD(i,a),Ew!==null&&Ew(i,a)};var io=A(null);function Ig(){var i=io.current;return i!==null?i:qt.pooledCache}function Ph(i,a){a===null?P(io,io.current):P(io,a.pool)}function kw(){var i=Ig();return i===null?null:{parent:Tn._currentValue,pool:i}}var fl=Error(r(460)),Mg=Error(r(474)),Fh=Error(r(542)),$h={then:function(){}};function jw(i){return i=i.status,i==="fulfilled"||i==="rejected"}function Tw(i,a,c){switch(c=i[c],c===void 0?i.push(a):c!==a&&(a.then(fs,fs),a=c),a.status){case"fulfilled":return a.value;case"rejected":throw i=a.reason,Aw(i),i;default:if(typeof a.status=="string")a.then(fs,fs);else{if(i=qt,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=a,i.status="pending",i.then(function(f){if(a.status==="pending"){var v=a;v.status="fulfilled",v.value=f}},function(f){if(a.status==="pending"){var v=a;v.status="rejected",v.reason=f}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw i=a.reason,Aw(i),i}throw ao=a,fl}}function so(i){try{var a=i._init;return a(i._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(ao=c,fl):c}}var ao=null;function Nw(){if(ao===null)throw Error(r(459));var i=ao;return ao=null,i}function Aw(i){if(i===fl||i===Fh)throw Error(r(483))}var pl=null,Jc=0;function Uh(i){var a=Jc;return Jc+=1,pl===null&&(pl=[]),Tw(pl,i,a)}function Xc(i,a){a=a.props.ref,i.ref=a!==void 0?a:null}function zh(i,a){throw a.$$typeof===y?Error(r(525)):(i=Object.prototype.toString.call(a),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":i)))}function Cw(i){function a(ae,ee){if(i){var le=ae.deletions;le===null?(ae.deletions=[ee],ae.flags|=16):le.push(ee)}}function c(ae,ee){if(!i)return null;for(;ee!==null;)a(ae,ee),ee=ee.sibling;return null}function f(ae){for(var ee=new Map;ae!==null;)ae.key!==null?ee.set(ae.key,ae):ee.set(ae.index,ae),ae=ae.sibling;return ee}function v(ae,ee){return ae=ms(ae,ee),ae.index=0,ae.sibling=null,ae}function x(ae,ee,le){return ae.index=le,i?(le=ae.alternate,le!==null?(le=le.index,le<ee?(ae.flags|=67108866,ee):le):(ae.flags|=67108866,ee)):(ae.flags|=1048576,ee)}function C(ae){return i&&ae.alternate===null&&(ae.flags|=67108866),ae}function L(ae,ee,le,ve){return ee===null||ee.tag!==6?(ee=Sg(le,ae.mode,ve),ee.return=ae,ee):(ee=v(ee,le),ee.return=ae,ee)}function J(ae,ee,le,ve){var qe=le.type;return qe===w?me(ae,ee,le.props.children,ve,le.key):ee!==null&&(ee.elementType===qe||typeof qe=="object"&&qe!==null&&qe.$$typeof===R&&so(qe)===ee.type)?(ee=v(ee,le.props),Xc(ee,le),ee.return=ae,ee):(ee=Dh(le.type,le.key,le.props,null,ae.mode,ve),Xc(ee,le),ee.return=ae,ee)}function ce(ae,ee,le,ve){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==le.containerInfo||ee.stateNode.implementation!==le.implementation?(ee=Eg(le,ae.mode,ve),ee.return=ae,ee):(ee=v(ee,le.children||[]),ee.return=ae,ee)}function me(ae,ee,le,ve,qe){return ee===null||ee.tag!==7?(ee=eo(le,ae.mode,ve,qe),ee.return=ae,ee):(ee=v(ee,le),ee.return=ae,ee)}function be(ae,ee,le){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=Sg(""+ee,ae.mode,le),ee.return=ae,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:return le=Dh(ee.type,ee.key,ee.props,null,ae.mode,le),Xc(le,ee),le.return=ae,le;case _:return ee=Eg(ee,ae.mode,le),ee.return=ae,ee;case R:return ee=so(ee),be(ae,ee,le)}if(te(ee)||W(ee))return ee=eo(ee,ae.mode,le,null),ee.return=ae,ee;if(typeof ee.then=="function")return be(ae,Uh(ee),le);if(ee.$$typeof===j)return be(ae,Lh(ae,ee),le);zh(ae,ee)}return null}function ue(ae,ee,le,ve){var qe=ee!==null?ee.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return qe!==null?null:L(ae,ee,""+le,ve);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case b:return le.key===qe?J(ae,ee,le,ve):null;case _:return le.key===qe?ce(ae,ee,le,ve):null;case R:return le=so(le),ue(ae,ee,le,ve)}if(te(le)||W(le))return qe!==null?null:me(ae,ee,le,ve,null);if(typeof le.then=="function")return ue(ae,ee,Uh(le),ve);if(le.$$typeof===j)return ue(ae,ee,Lh(ae,le),ve);zh(ae,le)}return null}function he(ae,ee,le,ve,qe){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return ae=ae.get(le)||null,L(ee,ae,""+ve,qe);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case b:return ae=ae.get(ve.key===null?le:ve.key)||null,J(ee,ae,ve,qe);case _:return ae=ae.get(ve.key===null?le:ve.key)||null,ce(ee,ae,ve,qe);case R:return ve=so(ve),he(ae,ee,le,ve,qe)}if(te(ve)||W(ve))return ae=ae.get(le)||null,me(ee,ae,ve,qe,null);if(typeof ve.then=="function")return he(ae,ee,le,Uh(ve),qe);if(ve.$$typeof===j)return he(ae,ee,le,Lh(ee,ve),qe);zh(ee,ve)}return null}function Ie(ae,ee,le,ve){for(var qe=null,xt=null,Fe=ee,st=ee=0,ft=null;Fe!==null&&st<le.length;st++){Fe.index>st?(ft=Fe,Fe=null):ft=Fe.sibling;var _t=ue(ae,Fe,le[st],ve);if(_t===null){Fe===null&&(Fe=ft);break}i&&Fe&&_t.alternate===null&&a(ae,Fe),ee=x(_t,ee,st),xt===null?qe=_t:xt.sibling=_t,xt=_t,Fe=ft}if(st===le.length)return c(ae,Fe),pt&&gs(ae,st),qe;if(Fe===null){for(;st<le.length;st++)Fe=be(ae,le[st],ve),Fe!==null&&(ee=x(Fe,ee,st),xt===null?qe=Fe:xt.sibling=Fe,xt=Fe);return pt&&gs(ae,st),qe}for(Fe=f(Fe);st<le.length;st++)ft=he(Fe,ae,st,le[st],ve),ft!==null&&(i&&ft.alternate!==null&&Fe.delete(ft.key===null?st:ft.key),ee=x(ft,ee,st),xt===null?qe=ft:xt.sibling=ft,xt=ft);return i&&Fe.forEach(function(Aa){return a(ae,Aa)}),pt&&gs(ae,st),qe}function We(ae,ee,le,ve){if(le==null)throw Error(r(151));for(var qe=null,xt=null,Fe=ee,st=ee=0,ft=null,_t=le.next();Fe!==null&&!_t.done;st++,_t=le.next()){Fe.index>st?(ft=Fe,Fe=null):ft=Fe.sibling;var Aa=ue(ae,Fe,_t.value,ve);if(Aa===null){Fe===null&&(Fe=ft);break}i&&Fe&&Aa.alternate===null&&a(ae,Fe),ee=x(Aa,ee,st),xt===null?qe=Aa:xt.sibling=Aa,xt=Aa,Fe=ft}if(_t.done)return c(ae,Fe),pt&&gs(ae,st),qe;if(Fe===null){for(;!_t.done;st++,_t=le.next())_t=be(ae,_t.value,ve),_t!==null&&(ee=x(_t,ee,st),xt===null?qe=_t:xt.sibling=_t,xt=_t);return pt&&gs(ae,st),qe}for(Fe=f(Fe);!_t.done;st++,_t=le.next())_t=he(Fe,ae,st,_t.value,ve),_t!==null&&(i&&_t.alternate!==null&&Fe.delete(_t.key===null?st:_t.key),ee=x(_t,ee,st),xt===null?qe=_t:xt.sibling=_t,xt=_t);return i&&Fe.forEach(function(f4){return a(ae,f4)}),pt&&gs(ae,st),qe}function Lt(ae,ee,le,ve){if(typeof le=="object"&&le!==null&&le.type===w&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case b:e:{for(var qe=le.key;ee!==null;){if(ee.key===qe){if(qe=le.type,qe===w){if(ee.tag===7){c(ae,ee.sibling),ve=v(ee,le.props.children),ve.return=ae,ae=ve;break e}}else if(ee.elementType===qe||typeof qe=="object"&&qe!==null&&qe.$$typeof===R&&so(qe)===ee.type){c(ae,ee.sibling),ve=v(ee,le.props),Xc(ve,le),ve.return=ae,ae=ve;break e}c(ae,ee);break}else a(ae,ee);ee=ee.sibling}le.type===w?(ve=eo(le.props.children,ae.mode,ve,le.key),ve.return=ae,ae=ve):(ve=Dh(le.type,le.key,le.props,null,ae.mode,ve),Xc(ve,le),ve.return=ae,ae=ve)}return C(ae);case _:e:{for(qe=le.key;ee!==null;){if(ee.key===qe)if(ee.tag===4&&ee.stateNode.containerInfo===le.containerInfo&&ee.stateNode.implementation===le.implementation){c(ae,ee.sibling),ve=v(ee,le.children||[]),ve.return=ae,ae=ve;break e}else{c(ae,ee);break}else a(ae,ee);ee=ee.sibling}ve=Eg(le,ae.mode,ve),ve.return=ae,ae=ve}return C(ae);case R:return le=so(le),Lt(ae,ee,le,ve)}if(te(le))return Ie(ae,ee,le,ve);if(W(le)){if(qe=W(le),typeof qe!="function")throw Error(r(150));return le=qe.call(le),We(ae,ee,le,ve)}if(typeof le.then=="function")return Lt(ae,ee,Uh(le),ve);if(le.$$typeof===j)return Lt(ae,ee,Lh(ae,le),ve);zh(ae,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,ee!==null&&ee.tag===6?(c(ae,ee.sibling),ve=v(ee,le),ve.return=ae,ae=ve):(c(ae,ee),ve=Sg(le,ae.mode,ve),ve.return=ae,ae=ve),C(ae)):c(ae,ee)}return function(ae,ee,le,ve){try{Jc=0;var qe=Lt(ae,ee,le,ve);return pl=null,qe}catch(Fe){if(Fe===fl||Fe===Fh)throw Fe;var xt=Ur(29,Fe,null,ae.mode);return xt.lanes=ve,xt.return=ae,xt}finally{}}}var oo=Cw(!0),Rw=Cw(!1),ha=!1;function Lg(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Pg(i,a){i=i.updateQueue,a.updateQueue===i&&(a.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function fa(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function pa(i,a,c){var f=i.updateQueue;if(f===null)return null;
vendor: 8,040 bytes, line 48
48if(f=f.shared,(St&2)!==0){var v=f.pending;return v===null?a.next=a:(a.next=v.next,v.next=a),f.pending=a,a=Oh(i),pw(i,null,c),a}return Rh(i,f,a,c),Oh(i)}function Zc(i,a,c){if(a=a.updateQueue,a!==null&&(a=a.shared,(c&4194048)!==0)){var f=a.lanes;f&=i.pendingLanes,c|=f,a.lanes=c,xn(i,c)}}function Fg(i,a){var c=i.updateQueue,f=i.alternate;if(f!==null&&(f=f.updateQueue,c===f)){var v=null,x=null;if(c=c.firstBaseUpdate,c!==null){do{var C={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};x===null?v=x=C:x=x.next=C,c=c.next}while(c!==null);x===null?v=x=a:x=x.next=a}else v=x=a;c={baseState:f.baseState,firstBaseUpdate:v,lastBaseUpdate:x,shared:f.shared,callbacks:f.callbacks},i.updateQueue=c;return}i=c.lastBaseUpdate,i===null?c.firstBaseUpdate=a:i.next=a,c.lastBaseUpdate=a}var $g=!1;function Qc(){if($g){var i=hl;if(i!==null)throw i}}function eu(i,a,c,f){$g=!1;var v=i.updateQueue;ha=!1;var x=v.firstBaseUpdate,C=v.lastBaseUpdate,L=v.shared.pending;if(L!==null){v.shared.pending=null;var J=L,ce=J.next;J.next=null,C===null?x=ce:C.next=ce,C=J;var me=i.alternate;me!==null&&(me=me.updateQueue,L=me.lastBaseUpdate,L!==C&&(L===null?me.firstBaseUpdate=ce:L.next=ce,me.lastBaseUpdate=J))}if(x!==null){var be=v.baseState;C=0,me=ce=J=null,L=x;do{var ue=L.lane&-536870913,he=ue!==L.lane;if(he?(ht&ue)===ue:(f&ue)===ue){ue!==0&&ue===dl&&($g=!0),me!==null&&(me=me.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var Ie=i,We=L;ue=a;var Lt=c;switch(We.tag){case 1:if(Ie=We.payload,typeof Ie=="function"){be=Ie.call(Lt,be,ue);break e}be=Ie;break e;case 3:Ie.flags=Ie.flags&-65537|128;case 0:if(Ie=We.payload,ue=typeof Ie=="function"?Ie.call(Lt,be,ue):Ie,ue==null)break e;be=m({},be,ue);break e;case 2:ha=!0}}ue=L.callback,ue!==null&&(i.flags|=64,he&&(i.flags|=8192),he=v.callbacks,he===null?v.callbacks=[ue]:he.push(ue))}else he={lane:ue,tag:L.tag,payload:L.payload,callback:L.callback,next:null},me===null?(ce=me=he,J=be):me=me.next=he,C|=ue;if(L=L.next,L===null){if(L=v.shared.pending,L===null)break;he=L,L=he.next,he.next=null,v.lastBaseUpdate=he,v.shared.pending=null}}while(!0);me===null&&(J=be),v.baseState=J,v.firstBaseUpdate=ce,v.lastBaseUpdate=me,x===null&&(v.shared.lanes=0),ba|=C,i.lanes=C,i.memoizedState=be}}function Ow(i,a){if(typeof i!="function")throw Error(r(191,i));i.call(a)}function Dw(i,a){var c=i.callbacks;if(c!==null)for(i.callbacks=null,i=0;i<c.length;i++)Ow(c[i],a)}var ml=A(null),Bh=A(0);function Iw(i,a){i=Ts,P(Bh,i),P(ml,a),Ts=i|a.baseLanes}function Ug(){P(Bh,Ts),P(ml,ml.current)}function zg(){Ts=Bh.current,$(ml),$(Bh)}var zr=A(null),oi=null;function ma(i){var a=i.alternate;P(wn,wn.current&1),P(zr,i),oi===null&&(a===null||ml.current!==null||a.memoizedState!==null)&&(oi=i)}function Bg(i){P(wn,wn.current),P(zr,i),oi===null&&(oi=i)}function Mw(i){i.tag===22?(P(wn,wn.current),P(zr,i),oi===null&&(oi=i)):ga()}function ga(){P(wn,wn.current),P(zr,zr.current)}function Br(i){$(zr),oi===i&&(oi=null),$(wn)}var wn=A(0);function Hh(i){for(var a=i;a!==null;){if(a.tag===13){var c=a.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Yv(c)||Kv(c)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break;for(;a.sibling===null;){if(a.return===null||a.return===i)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var bs=0,rt=null,It=null,Nn=null,qh=!1,gl=!1,lo=!1,Gh=0,tu=0,vl=null,rD=0;function fn(){throw Error(r(321))}function Hg(i,a){if(a===null)return!1;for(var c=0;c<a.length&&c<i.length;c++)if(!$r(i[c],a[c]))return!1;return!0}function qg(i,a,c,f,v,x){return bs=x,rt=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,I.H=i===null||i.memoizedState===null?y1:sv,lo=!1,x=c(f,v),lo=!1,gl&&(x=Pw(a,c,f,v)),Lw(i),x}function Lw(i){I.H=iu;var a=It!==null&&It.next!==null;if(bs=0,Nn=It=rt=null,qh=!1,tu=0,vl=null,a)throw Error(r(300));i===null||An||(i=i.dependencies,i!==null&&Mh(i)&&(An=!0))}function Pw(i,a,c,f){rt=i;var v=0;do{if(gl&&(vl=null),tu=0,gl=!1,25<=v)throw Error(r(301));if(v+=1,Nn=It=null,i.updateQueue!=null){var x=i.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}I.H=b1,x=a(c,f)}while(gl);return x}function iD(){var i=I.H,a=i.useState()[0];return a=typeof a.then=="function"?nu(a):a,i=i.useState()[0],(It!==null?It.memoizedState:null)!==i&&(rt.flags|=1024),a}function Gg(){var i=Gh!==0;return Gh=0,i}function Vg(i,a,c){a.updateQueue=i.updateQueue,a.flags&=-2053,i.lanes&=~c}function Wg(i){if(qh){for(i=i.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}qh=!1}bs=0,Nn=It=rt=null,gl=!1,tu=Gh=0,vl=null}function gr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nn===null?rt.memoizedState=Nn=i:Nn=Nn.next=i,Nn}function Sn(){if(It===null){var i=rt.alternate;i=i!==null?i.memoizedState:null}else i=It.next;var a=Nn===null?rt.memoizedState:Nn.next;if(a!==null)Nn=a,It=i;else{if(i===null)throw rt.alternate===null?Error(r(467)):Error(r(310));It=i,i={memoizedState:It.memoizedState,baseState:It.baseState,baseQueue:It.baseQueue,queue:It.queue,next:null},Nn===null?rt.memoizedState=Nn=i:Nn=Nn.next=i}return Nn}function Vh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function nu(i){var a=tu;return tu+=1,vl===null&&(vl=[]),i=Tw(vl,i,a),a=rt,(Nn===null?a.memoizedState:Nn.next)===null&&(a=a.alternate,I.H=a===null||a.memoizedState===null?y1:sv),i}function Wh(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return nu(i);if(i.$$typeof===j)return Yn(i)}throw Error(r(438,String(i)))}function Yg(i){var a=null,c=rt.updateQueue;if(c!==null&&(a=c.memoCache),a==null){var f=rt.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(a={data:f.data.map(function(v){return v.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),c===null&&(c=Vh(),rt.updateQueue=c),c.memoCache=a,c=a.data[a.index],c===void 0)for(c=a.data[a.index]=Array(i),f=0;f<i;f++)c[f]=M;return a.index++,c}function xs(i,a){return typeof a=="function"?a(i):a}function Yh(i){var a=Sn();return Kg(a,It,i)}function Kg(i,a,c){var f=i.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=c;var v=i.baseQueue,x=f.pending;if(x!==null){if(v!==null){var C=v.next;v.next=x.next,x.next=C}a.baseQueue=v=x,f.pending=null}if(x=i.baseState,v===null)i.memoizedState=x;else{a=v.next;var L=C=null,J=null,ce=a,me=!1;do{var be=ce.lane&-536870913;if(be!==ce.lane?(ht&be)===be:(bs&be)===be){var ue=ce.revertLane;if(ue===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),be===dl&&(me=!0);else if((bs&ue)===ue){ce=ce.next,ue===dl&&(me=!0);continue}else be={lane:0,revertLane:ce.revertLane,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},J===null?(L=J=be,C=x):J=J.next=be,rt.lanes|=ue,ba|=ue;be=ce.action,lo&&c(x,be),x=ce.hasEagerState?ce.eagerState:c(x,be)}else ue={lane:be,revertLane:ce.revertLane,gesture:ce.gesture,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},J===null?(L=J=ue,C=x):J=J.next=ue,rt.lanes|=be,ba|=be;ce=ce.next}while(ce!==null&&ce!==a);if(J===null?C=x:J.next=L,!$r(x,i.memoizedState)&&(An=!0,me&&(c=hl,c!==null)))throw c;i.memoizedState=x,i.baseState=C,i.baseQueue=J,f.lastRenderedState=x}return v===null&&(f.lanes=0),[i.memoizedState,f.dispatch]}function Jg(i){var a=Sn(),c=a.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=i;var f=c.dispatch,v=c.pending,x=a.memoizedState;if(v!==null){c.pending=null;var C=v=v.next;do x=i(x,C.action),C=C.next;while(C!==v);$r(x,a.memoizedState)||(An=!0),a.memoizedState=x,a.baseQueue===null&&(a.baseState=x),c.lastRenderedState=x}return[x,f]}function Fw(i,a,c){var f=rt,v=Sn(),x=pt;if(x){if(c===void 0)throw Error(r(407));c=c()}else c=a();
vendor: 14,739 bytes, line 48
48var C=!$r((It||v).memoizedState,c);if(C&&(v.memoizedState=c,An=!0),v=v.queue,Qg(zw.bind(null,f,v,i),[i]),v.getSnapshot!==a||C||Nn!==null&&Nn.memoizedState.tag&1){if(f.flags|=2048,yl(9,{destroy:void 0},Uw.bind(null,f,v,c,a),null),qt===null)throw Error(r(349));x||(bs&127)!==0||$w(f,a,c)}return c}function $w(i,a,c){i.flags|=16384,i={getSnapshot:a,value:c},a=rt.updateQueue,a===null?(a=Vh(),rt.updateQueue=a,a.stores=[i]):(c=a.stores,c===null?a.stores=[i]:c.push(i))}function Uw(i,a,c,f){a.value=c,a.getSnapshot=f,Bw(a)&&Hw(i)}function zw(i,a,c){return c(function(){Bw(a)&&Hw(i)})}function Bw(i){var a=i.getSnapshot;i=i.value;try{var c=a();return!$r(i,c)}catch{return!0}}function Hw(i){var a=Qa(i,2);a!==null&&Ar(a,i,2)}function Xg(i){var a=gr();if(typeof i=="function"){var c=i;if(i=c(),lo){Nt(!0);try{c()}finally{Nt(!1)}}}return a.memoizedState=a.baseState=i,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xs,lastRenderedState:i},a}function qw(i,a,c,f){return i.baseState=c,Kg(i,It,typeof f=="function"?f:xs)}function sD(i,a,c,f,v){if(Xh(i))throw Error(r(485));if(i=a.action,i!==null){var x={payload:v,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){x.listeners.push(C)}};I.T!==null?c(!0):x.isTransition=!1,f(x),c=a.pending,c===null?(x.next=a.pending=x,Gw(a,x)):(x.next=c.next,a.pending=c.next=x)}}function Gw(i,a){var c=a.action,f=a.payload,v=i.state;if(a.isTransition){var x=I.T,C={};I.T=C;try{var L=c(v,f),J=I.S;J!==null&&J(C,L),Vw(i,a,L)}catch(ce){Zg(i,a,ce)}finally{x!==null&&C.types!==null&&(x.types=C.types),I.T=x}}else try{x=c(v,f),Vw(i,a,x)}catch(ce){Zg(i,a,ce)}}function Vw(i,a,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(f){Ww(i,a,f)},function(f){return Zg(i,a,f)}):Ww(i,a,c)}function Ww(i,a,c){a.status="fulfilled",a.value=c,Yw(a),i.state=c,a=i.pending,a!==null&&(c=a.next,c===a?i.pending=null:(c=c.next,a.next=c,Gw(i,c)))}function Zg(i,a,c){var f=i.pending;if(i.pending=null,f!==null){f=f.next;do a.status="rejected",a.reason=c,Yw(a),a=a.next;while(a!==f)}i.action=null}function Yw(i){i=i.listeners;for(var a=0;a<i.length;a++)(0,i[a])()}function Kw(i,a){return a}function Jw(i,a){if(pt){var c=qt.formState;if(c!==null){e:{var f=rt;if(pt){if(en){t:{for(var v=en,x=ai;v.nodeType!==8;){if(!x){v=null;break t}if(v=li(v.nextSibling),v===null){v=null;break t}}x=v.data,v=x==="F!"||x==="F"?v:null}if(v){en=li(v.nextSibling),f=v.data==="F!";break e}}ua(f)}f=!1}f&&(a=c[0])}}return c=gr(),c.memoizedState=c.baseState=a,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kw,lastRenderedState:a},c.queue=f,c=m1.bind(null,rt,f),f.dispatch=c,f=Xg(!1),x=iv.bind(null,rt,!1,f.queue),f=gr(),v={state:a,dispatch:null,action:i,pending:null},f.queue=v,c=sD.bind(null,rt,v,x,c),v.dispatch=c,f.memoizedState=i,[a,c,!1]}function Xw(i){var a=Sn();return Zw(a,It,i)}function Zw(i,a,c){if(a=Kg(i,a,Kw)[0],i=Yh(xs)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var f=nu(a)}catch(C){throw C===fl?Fh:C}else f=a;a=Sn();var v=a.queue,x=v.dispatch;return c!==a.memoizedState&&(rt.flags|=2048,yl(9,{destroy:void 0},aD.bind(null,v,c),null)),[f,x,i]}function aD(i,a){i.action=a}function Qw(i){var a=Sn(),c=It;if(c!==null)return Zw(a,c,i);Sn(),a=a.memoizedState,c=Sn();var f=c.queue.dispatch;return c.memoizedState=i,[a,f,!1]}function yl(i,a,c,f){return i={tag:i,create:c,deps:f,inst:a,next:null},a=rt.updateQueue,a===null&&(a=Vh(),rt.updateQueue=a),c=a.lastEffect,c===null?a.lastEffect=i.next=i:(f=c.next,c.next=i,i.next=f,a.lastEffect=i),i}function e1(){return Sn().memoizedState}function Kh(i,a,c,f){var v=gr();rt.flags|=i,v.memoizedState=yl(1|a,{destroy:void 0},c,f===void 0?null:f)}function Jh(i,a,c,f){var v=Sn();f=f===void 0?null:f;var x=v.memoizedState.inst;It!==null&&f!==null&&Hg(f,It.memoizedState.deps)?v.memoizedState=yl(a,x,c,f):(rt.flags|=i,v.memoizedState=yl(1|a,x,c,f))}function t1(i,a){Kh(8390656,8,i,a)}function Qg(i,a){Jh(2048,8,i,a)}function oD(i){rt.flags|=4;var a=rt.updateQueue;if(a===null)a=Vh(),rt.updateQueue=a,a.events=[i];else{var c=a.events;c===null?a.events=[i]:c.push(i)}}function n1(i){var a=Sn().memoizedState;return oD({ref:a,nextImpl:i}),function(){if((St&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function r1(i,a){return Jh(4,2,i,a)}function i1(i,a){return Jh(4,4,i,a)}function s1(i,a){if(typeof a=="function"){i=i();var c=a(i);return function(){typeof c=="function"?c():a(null)}}if(a!=null)return i=i(),a.current=i,function(){a.current=null}}function a1(i,a,c){c=c!=null?c.concat([i]):null,Jh(4,4,s1.bind(null,a,i),c)}function ev(){}function o1(i,a){var c=Sn();a=a===void 0?null:a;var f=c.memoizedState;return a!==null&&Hg(a,f[1])?f[0]:(c.memoizedState=[i,a],i)}function l1(i,a){var c=Sn();a=a===void 0?null:a;var f=c.memoizedState;if(a!==null&&Hg(a,f[1]))return f[0];if(f=i(),lo){Nt(!0);try{i()}finally{Nt(!1)}}return c.memoizedState=[f,a],f}function tv(i,a,c){return c===void 0||(bs&1073741824)!==0&&(ht&261930)===0?i.memoizedState=a:(i.memoizedState=c,i=cS(),rt.lanes|=i,ba|=i,c)}function c1(i,a,c,f){return $r(c,a)?c:ml.current!==null?(i=tv(i,c,f),$r(i,a)||(An=!0),i):(bs&42)===0||(bs&1073741824)!==0&&(ht&261930)===0?(An=!0,i.memoizedState=c):(i=cS(),rt.lanes|=i,ba|=i,a)}function u1(i,a,c,f,v){var x=H.p;H.p=x!==0&&8>x?x:8;var C=I.T,L={};I.T=L,iv(i,!1,a,c);try{var J=v(),ce=I.S;if(ce!==null&&ce(L,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var me=nD(J,f);ru(i,a,me,Gr(i))}else ru(i,a,f,Gr(i))}catch(be){ru(i,a,{then:function(){},status:"rejected",reason:be},Gr())}finally{H.p=x,C!==null&&L.types!==null&&(C.types=L.types),I.T=C}}function lD(){}function nv(i,a,c,f){if(i.tag!==5)throw Error(r(476));var v=d1(i).queue;u1(i,v,a,G,c===null?lD:function(){return h1(i),c(f)})}function d1(i){var a=i.memoizedState;if(a!==null)return a;a={memoizedState:G,baseState:G,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xs,lastRenderedState:G},next:null};var c={};return a.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xs,lastRenderedState:c},next:null},i.memoizedState=a,i=i.alternate,i!==null&&(i.memoizedState=a),a}function h1(i){var a=d1(i);a.next===null&&(a=i.alternate.memoizedState),ru(i,a.next.queue,{},Gr())}function rv(){return Yn(xu)}function f1(){return Sn().memoizedState}function p1(){return Sn().memoizedState}function cD(i){for(var a=i.return;a!==null;){switch(a.tag){case 24:case 3:var c=Gr();i=fa(c);var f=pa(a,i,c);f!==null&&(Ar(f,a,c),Zc(f,a,c)),a={cache:Og()},i.payload=a;return}a=a.return}}function uD(i,a,c){var f=Gr();c={lane:f,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Xh(i)?g1(a,c):(c=_g(i,a,c,f),c!==null&&(Ar(c,i,f),v1(c,a,f)))}function m1(i,a,c){var f=Gr();ru(i,a,c,f)}function ru(i,a,c,f){var v={lane:f,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Xh(i))g1(a,v);else{var x=i.alternate;if(i.lanes===0&&(x===null||x.lanes===0)&&(x=a.lastRenderedReducer,x!==null))try{var C=a.lastRenderedState,L=x(C,c);if(v.hasEagerState=!0,v.eagerState=L,$r(L,C))return Rh(i,a,v,0),qt===null&&Ch(),!1}catch{}finally{}if(c=_g(i,a,v,f),c!==null)return Ar(c,i,f),v1(c,a,f),!0}return!1}function iv(i,a,c,f){if(f={lane:2,revertLane:Lv(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Xh(i)){if(a)throw Error(r(479))}else a=_g(i,c,f,2),a!==null&&Ar(a,i,2)}function Xh(i){var a=i.alternate;return i===rt||a!==null&&a===rt}function g1(i,a){gl=qh=!0;var c=i.pending;c===null?a.next=a:(a.next=c.next,c.next=a),i.pending=a}function v1(i,a,c){if((c&4194048)!==0){var f=a.lanes;f&=i.pendingLanes,c|=f,a.lanes=c,xn(i,c)}}var iu={readContext:Yn,use:Wh,useCallback:fn,useContext:fn,useEffect:fn,useImperativeHandle:fn,useLayoutEffect:fn,useInsertionEffect:fn,useMemo:fn,useReducer:fn,useRef:fn,useState:fn,useDebugValue:fn,useDeferredValue:fn,useTransition:fn,useSyncExternalStore:fn,useId:fn,useHostTransitionStatus:fn,useFormState:fn,useActionState:fn,useOptimistic:fn,useMemoCache:fn,useCacheRefresh:fn};iu.useEffectEvent=fn;var y1={readContext:Yn,use:Wh,useCallback:function(i,a){return gr().memoizedState=[i,a===void 0?null:a],i},useContext:Yn,useEffect:t1,useImperativeHandle:function(i,a,c){c=c!=null?c.concat([i]):null,Kh(4194308,4,s1.bind(null,a,i),c)},useLayoutEffect:function(i,a){return Kh(4194308,4,i,a)},useInsertionEffect:function(i,a){Kh(4,2,i,a)},useMemo:function(i,a){var c=gr();a=a===void 0?null:a;var f=i();if(lo){Nt(!0);try{i()}finally{Nt(!1)}}return c.memoizedState=[f,a],f},useReducer:function(i,a,c){var f=gr();if(c!==void 0){var v=c(a);if(lo){Nt(!0);try{c(a)}finally{Nt(!1)}}}else v=a;return f.memoizedState=f.baseState=v,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:v},f.queue=i,i=i.dispatch=uD.bind(null,rt,i),[f.memoizedState,i]},useRef:function(i){var a=gr();return i={current:i},a.memoizedState=i},useState:function(i){i=Xg(i);var a=i.queue,c=m1.bind(null,rt,a);return a.dispatch=c,[i.memoizedState,c]},useDebugValue:ev,useDeferredValue:function(i,a){var c=gr();return tv(c,i,a)},useTransition:function(){var i=Xg(!1);return i=u1.bind(null,rt,i.queue,!0,!1),gr().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,a,c){var f=rt,v=gr();if(pt){if(c===void 0)throw Error(r(407));c=c()}else{if(c=a(),qt===null)throw Error(r(349));(ht&127)!==0||$w(f,a,c)}v.memoizedState=c;var x={value:c,getSnapshot:a};return v.queue=x,t1(zw.bind(null,f,x,i),[i]),f.flags|=2048,yl(9,{destroy:void 0},Uw.bind(null,f,x,c,a),null),c},useId:function(){var i=gr(),a=qt.identifierPrefix;if(pt){var c=Gi,f=qi;c=(f&~(1<<32-yn(f)-1)).toString(32)+c,a="_"+a+"R_"+c,c=Gh++,0<c&&(a+="H"+c.toString(32)),a+="_"}else c=rD++,a="_"+a+"r_"+c.toString(32)+"_";return i.memoizedState=a},useHostTransitionStatus:rv,useFormState:Jw,useActionState:Jw,useOptimistic:function(i){var a=gr();a.memoizedState=a.baseState=i;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=c,a=iv.bind(null,rt,!0,c),c.dispatch=a,[i,a]},useMemoCache:Yg,useCacheRefresh:function(){return gr().memoizedState=cD.bind(null,rt)},useEffectEvent:function(i){var a=gr(),c={impl:i};return a.memoizedState=c,function(){if((St&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}},sv={readContext:Yn,use:Wh,useCallback:o1,useContext:Yn,useEffect:Qg,useImperativeHandle:a1,useInsertionEffect:r1,useLayoutEffect:i1,useMemo:l1,useReducer:Yh,useRef:e1,useState:function(){return Yh(xs)},useDebugValue:ev,useDeferredValue:function(i,a){var c=Sn();return c1(c,It.memoizedState,i,a)},useTransition:function(){var i=Yh(xs)[0],a=Sn().memoizedState;return[typeof i=="boolean"?i:nu(i),a]},useSyncExternalStore:Fw,useId:f1,useHostTransitionStatus:rv,useFormState:Xw,useActionState:Xw,useOptimistic:function(i,a){var c=Sn();return qw(c,It,i,a)},useMemoCache:Yg,useCacheRefresh:p1};sv.useEffectEvent=n1;var b1={readContext:Yn,use:Wh,useCallback:o1,useContext:Yn,useEffect:Qg,useImperativeHandle:a1,useInsertionEffect:r1,useLayoutEffect:i1,useMemo:l1,useReducer:Jg,useRef:e1,useState:function(){return Jg(xs)},useDebugValue:ev,useDeferredValue:function(i,a){var c=Sn();return It===null?tv(c,i,a):c1(c,It.memoizedState,i,a)},useTransition:function(){var i=Jg(xs)[0],a=Sn().memoizedState;return[typeof i=="boolean"?i:nu(i),a]},useSyncExternalStore:Fw,useId:f1,useHostTransitionStatus:rv,useFormState:Qw,useActionState:Qw,useOptimistic:function(i,a){var c=Sn();return It!==null?qw(c,It,i,a):(c.baseState=i,[i,c.queue.dispatch])},useMemoCache:Yg,useCacheRefresh:p1};b1.useEffectEvent=n1;function av(i,a,c,f){a=i.memoizedState,c=c(f,a),c=c==null?a:m({},a,c),i.memoizedState=c,i.lanes===0&&(i.updateQueue.baseState=c)}var ov={enqueueSetState:function(i,a,c){i=i._reactInternals;var f=Gr(),v=fa(f);v.payload=a,c!=null&&(v.callback=c),a=pa(i,v,f),a!==null&&(Ar(a,i,f),Zc(a,i,f))},enqueueReplaceState:function(i,a,c){i=i._reactInternals;var f=Gr(),v=fa(f);v.tag=1,v.payload=a,c!=null&&(v.callback=c),a=pa(i,v,f),a!==null&&(Ar(a,i,f),Zc(a,i,f))},enqueueForceUpdate:function(i,a){i=i._reactInternals;var c=Gr(),f=fa(c);f.tag=2,a!=null&&(f.callback=a),a=pa(i,f,c),a!==null&&(Ar(a,i,c),Zc(a,i,c))}};function x1(i,a,c,f,v,x,C){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(f,x,C):a.prototype&&a.prototype.isPureReactComponent?!qc(c,f)||!qc(v,x):!0}function _1(i,a,c,f){i=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(c,f),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(c,f),a.state!==i&&ov.enqueueReplaceState(a,a.state,null)}function co(i,a){var c=a;if("ref"in a){c={};for(var f in a)f!=="ref"&&(c[f]=a[f])}if(i=i.defaultProps){c===a&&(c=m({},c));for(var v in i)c[v]===void 0&&(c[v]=i[v])}return c}function w1(i){Ah(i)}function S1(i){console.error(i)}function E1(i){Ah(i)}function Zh(i,a){try{var c=i.onUncaughtError;c(a.value,{componentStack:a.stack})}catch(f){setTimeout(function(){throw f})}}function k1(i,a,c){try{var f=i.onCaughtError;f(c.value,{componentStack:c.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function lv(i,a,c){return c=fa(c),c.tag=3,c.payload={element:null},c.callback=function(){Zh(i,a)},c}function j1(i){return i=fa(i),i.tag=3,i}function T1(i,a,c,f){var v=c.type.getDerivedStateFromError;if(typeof v=="function"){var x=f.value;i.payload=function(){return v(x)},i.callback=function(){k1(a,c,f)}}var C=c.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(i.callback=function(){k1(a,c,f),typeof v!="function"&&(xa===null?xa=new Set([this]):xa.add(this));var L=f.stack;this.componentDidCatch(f.value,{componentStack:L!==null?L:""})})}function dD(i,a,c,f,v){if(c.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(a=c.alternate,a!==null&&ul(a,c,v,!0),c=zr.current,c!==null){switch(c.tag){case 31:case 13:return oi===null?df():c.alternate===null&&pn===0&&(pn=3),c.flags&=-257,c.flags|=65536,c.lanes=v,f===$h?c.flags|=16384:(a=c.updateQueue,a===null?c.updateQueue=new Set([f]):a.add(f),Dv(i,f,v)),!1;case 22:return c.flags|=65536,f===$h?c.flags|=16384:(a=c.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([f])},c.updateQueue=a):(c=a.retryQueue,c===null?a.retryQueue=new Set([f]):c.add(f)),Dv(i,f,v)),!1}throw Error(r(435,c.tag))}return Dv(i,f,v),df(),!1}if(pt)return a=zr.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=v,f!==Tg&&(i=Error(r(422),{cause:f}),Wc(ri(i,c)))):(f!==Tg&&(a=Error(r(423),{cause:f}),Wc(ri(a,c))),i=i.current.alternate,i.flags|=65536,v&=-v,i.lanes|=v,f=ri(f,c),v=lv(i.stateNode,f,v),Fg(i,v),pn!==4&&(pn=2)),!1;var x=Error(r(520),{cause:f});
vendor: 10,709 bytes, line 48
48if(x=ri(x,c),hu===null?hu=[x]:hu.push(x),pn!==4&&(pn=2),a===null)return!0;f=ri(f,c),c=a;do{switch(c.tag){case 3:return c.flags|=65536,i=v&-v,c.lanes|=i,i=lv(c.stateNode,f,i),Fg(c,i),!1;case 1:if(a=c.type,x=c.stateNode,(c.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(xa===null||!xa.has(x))))return c.flags|=65536,v&=-v,c.lanes|=v,v=j1(v),T1(v,i,c,f),Fg(c,v),!1}c=c.return}while(c!==null);return!1}var cv=Error(r(461)),An=!1;function Kn(i,a,c,f){a.child=i===null?Rw(a,null,c,f):oo(a,i.child,c,f)}function N1(i,a,c,f,v){c=c.render;var x=a.ref;if("ref"in f){var C={};for(var L in f)L!=="ref"&&(C[L]=f[L])}else C=f;return ro(a),f=qg(i,a,c,C,x,v),L=Gg(),i!==null&&!An?(Vg(i,a,v),_s(i,a,v)):(pt&&L&&kg(a),a.flags|=1,Kn(i,a,f,v),a.child)}function A1(i,a,c,f,v){if(i===null){var x=c.type;return typeof x=="function"&&!wg(x)&&x.defaultProps===void 0&&c.compare===null?(a.tag=15,a.type=x,C1(i,a,x,f,v)):(i=Dh(c.type,null,f,a,a.mode,v),i.ref=a.ref,i.return=a,a.child=i)}if(x=i.child,!vv(i,v)){var C=x.memoizedProps;if(c=c.compare,c=c!==null?c:qc,c(C,f)&&i.ref===a.ref)return _s(i,a,v)}return a.flags|=1,i=ms(x,f),i.ref=a.ref,i.return=a,a.child=i}function C1(i,a,c,f,v){if(i!==null){var x=i.memoizedProps;if(qc(x,f)&&i.ref===a.ref)if(An=!1,a.pendingProps=f=x,vv(i,v))(i.flags&131072)!==0&&(An=!0);else return a.lanes=i.lanes,_s(i,a,v)}return uv(i,a,c,f,v)}function R1(i,a,c,f){var v=f.children,x=i!==null?i.memoizedState:null;if(i===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((a.flags&128)!==0){if(x=x!==null?x.baseLanes|c:c,i!==null){for(f=a.child=i.child,v=0;f!==null;)v=v|f.lanes|f.childLanes,f=f.sibling;f=v&~x}else f=0,a.child=null;return O1(i,a,x,c,f)}if((c&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},i!==null&&Ph(a,x!==null?x.cachePool:null),x!==null?Iw(a,x):Ug(),Mw(a);else return f=a.lanes=536870912,O1(i,a,x!==null?x.baseLanes|c:c,c,f)}else x!==null?(Ph(a,x.cachePool),Iw(a,x),ga(),a.memoizedState=null):(i!==null&&Ph(a,null),Ug(),ga());return Kn(i,a,v,c),a.child}function su(i,a){return i!==null&&i.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function O1(i,a,c,f,v){var x=Ig();return x=x===null?null:{parent:Tn._currentValue,pool:x},a.memoizedState={baseLanes:c,cachePool:x},i!==null&&Ph(a,null),Ug(),Mw(a),i!==null&&ul(i,a,f,!0),a.childLanes=v,null}function Qh(i,a){return a=tf({mode:a.mode,children:a.children},i.mode),a.ref=i.ref,i.child=a,a.return=i,a}function D1(i,a,c){return oo(a,i.child,null,c),i=Qh(a,a.pendingProps),i.flags|=2,Br(a),a.memoizedState=null,i}function hD(i,a,c){var f=a.pendingProps,v=(a.flags&128)!==0;if(a.flags&=-129,i===null){if(pt){if(f.mode==="hidden")return i=Qh(a,f),a.lanes=536870912,su(null,i);if(Bg(a),(i=en)?(i=GS(i,ai),i=i!==null&&i.data==="&"?i:null,i!==null&&(a.memoizedState={dehydrated:i,treeContext:la!==null?{id:qi,overflow:Gi}:null,retryLane:536870912,hydrationErrors:null},c=gw(i),c.return=a,a.child=c,Wn=a,en=null)):i=null,i===null)throw ua(a);return a.lanes=536870912,null}return Qh(a,f)}var x=i.memoizedState;if(x!==null){var C=x.dehydrated;if(Bg(a),v)if(a.flags&256)a.flags&=-257,a=D1(i,a,c);else if(a.memoizedState!==null)a.child=i.child,a.flags|=128,a=null;else throw Error(r(558));else if(An||ul(i,a,c,!1),v=(c&i.childLanes)!==0,An||v){if(f=qt,f!==null&&(C=Y(f,c),C!==0&&C!==x.retryLane))throw x.retryLane=C,Qa(i,C),Ar(f,i,C),cv;df(),a=D1(i,a,c)}else i=x.treeContext,en=li(C.nextSibling),Wn=a,pt=!0,ca=null,ai=!1,i!==null&&bw(a,i),a=Qh(a,f),a.flags|=4096;return a}return i=ms(i.child,{mode:f.mode,children:f.children}),i.ref=a.ref,a.child=i,i.return=a,i}function ef(i,a){var c=a.ref;if(c===null)i!==null&&i.ref!==null&&(a.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(r(284));(i===null||i.ref!==c)&&(a.flags|=4194816)}}function uv(i,a,c,f,v){return ro(a),c=qg(i,a,c,f,void 0,v),f=Gg(),i!==null&&!An?(Vg(i,a,v),_s(i,a,v)):(pt&&f&&kg(a),a.flags|=1,Kn(i,a,c,v),a.child)}function I1(i,a,c,f,v,x){return ro(a),a.updateQueue=null,c=Pw(a,f,c,v),Lw(i),f=Gg(),i!==null&&!An?(Vg(i,a,x),_s(i,a,x)):(pt&&f&&kg(a),a.flags|=1,Kn(i,a,c,x),a.child)}function M1(i,a,c,f,v){if(ro(a),a.stateNode===null){var x=al,C=c.contextType;typeof C=="object"&&C!==null&&(x=Yn(C)),x=new c(f,x),a.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=ov,a.stateNode=x,x._reactInternals=a,x=a.stateNode,x.props=f,x.state=a.memoizedState,x.refs={},Lg(a),C=c.contextType,x.context=typeof C=="object"&&C!==null?Yn(C):al,x.state=a.memoizedState,C=c.getDerivedStateFromProps,typeof C=="function"&&(av(a,c,C,f),x.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(C=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),C!==x.state&&ov.enqueueReplaceState(x,x.state,null),eu(a,f,x,v),Qc(),x.state=a.memoizedState),typeof x.componentDidMount=="function"&&(a.flags|=4194308),f=!0}else if(i===null){x=a.stateNode;var L=a.memoizedProps,J=co(c,L);x.props=J;var ce=x.context,me=c.contextType;C=al,typeof me=="object"&&me!==null&&(C=Yn(me));var be=c.getDerivedStateFromProps;me=typeof be=="function"||typeof x.getSnapshotBeforeUpdate=="function",L=a.pendingProps!==L,me||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(L||ce!==C)&&_1(a,x,f,C),ha=!1;var ue=a.memoizedState;x.state=ue,eu(a,f,x,v),Qc(),ce=a.memoizedState,L||ue!==ce||ha?(typeof be=="function"&&(av(a,c,be,f),ce=a.memoizedState),(J=ha||x1(a,c,J,f,ue,ce,C))?(me||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(a.flags|=4194308)):(typeof x.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=f,a.memoizedState=ce),x.props=f,x.state=ce,x.context=C,f=J):(typeof x.componentDidMount=="function"&&(a.flags|=4194308),f=!1)}else{x=a.stateNode,Pg(i,a),C=a.memoizedProps,me=co(c,C),x.props=me,be=a.pendingProps,ue=x.context,ce=c.contextType,J=al,typeof ce=="object"&&ce!==null&&(J=Yn(ce)),L=c.getDerivedStateFromProps,(ce=typeof L=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(C!==be||ue!==J)&&_1(a,x,f,J),ha=!1,ue=a.memoizedState,x.state=ue,eu(a,f,x,v),Qc();var he=a.memoizedState;C!==be||ue!==he||ha||i!==null&&i.dependencies!==null&&Mh(i.dependencies)?(typeof L=="function"&&(av(a,c,L,f),he=a.memoizedState),(me=ha||x1(a,c,me,f,ue,he,J)||i!==null&&i.dependencies!==null&&Mh(i.dependencies))?(ce||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(f,he,J),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(f,he,J)),typeof x.componentDidUpdate=="function"&&(a.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof x.componentDidUpdate!="function"||C===i.memoizedProps&&ue===i.memoizedState||(a.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||C===i.memoizedProps&&ue===i.memoizedState||(a.flags|=1024),a.memoizedProps=f,a.memoizedState=he),x.props=f,x.state=he,x.context=J,f=me):(typeof x.componentDidUpdate!="function"||C===i.memoizedProps&&ue===i.memoizedState||(a.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||C===i.memoizedProps&&ue===i.memoizedState||(a.flags|=1024),f=!1)}return x=f,ef(i,a),f=(a.flags&128)!==0,x||f?(x=a.stateNode,c=f&&typeof c.getDerivedStateFromError!="function"?null:x.render(),a.flags|=1,i!==null&&f?(a.child=oo(a,i.child,null,v),a.child=oo(a,null,c,v)):Kn(i,a,c,v),a.memoizedState=x.state,i=a.child):i=_s(i,a,v),i}function L1(i,a,c,f){return to(),a.flags|=256,Kn(i,a,c,f),a.child}var dv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hv(i){return{baseLanes:i,cachePool:kw()}}function fv(i,a,c){return i=i!==null?i.childLanes&~c:0,a&&(i|=qr),i}function P1(i,a,c){var f=a.pendingProps,v=!1,x=(a.flags&128)!==0,C;if((C=x)||(C=i!==null&&i.memoizedState===null?!1:(wn.current&2)!==0),C&&(v=!0,a.flags&=-129),C=(a.flags&32)!==0,a.flags&=-33,i===null){if(pt){if(v?ma(a):ga(),(i=en)?(i=GS(i,ai),i=i!==null&&i.data!=="&"?i:null,i!==null&&(a.memoizedState={dehydrated:i,treeContext:la!==null?{id:qi,overflow:Gi}:null,retryLane:536870912,hydrationErrors:null},c=gw(i),c.return=a,a.child=c,Wn=a,en=null)):i=null,i===null)throw ua(a);return Kv(i)?a.lanes=32:a.lanes=536870912,null}var L=f.children;return f=f.fallback,v?(ga(),v=a.mode,L=tf({mode:"hidden",children:L},v),f=eo(f,v,c,null),L.return=a,f.return=a,L.sibling=f,a.child=L,f=a.child,f.memoizedState=hv(c),f.childLanes=fv(i,C,c),a.memoizedState=dv,su(null,f)):(ma(a),pv(a,L))}var J=i.memoizedState;if(J!==null&&(L=J.dehydrated,L!==null)){if(x)a.flags&256?(ma(a),a.flags&=-257,a=mv(i,a,c)):a.memoizedState!==null?(ga(),a.child=i.child,a.flags|=128,a=null):(ga(),L=f.fallback,v=a.mode,f=tf({mode:"visible",children:f.children},v),L=eo(L,v,c,null),L.flags|=2,f.return=a,L.return=a,f.sibling=L,a.child=f,oo(a,i.child,null,c),f=a.child,f.memoizedState=hv(c),f.childLanes=fv(i,C,c),a.memoizedState=dv,a=su(null,f));else if(ma(a),Kv(L)){if(C=L.nextSibling&&L.nextSibling.dataset,C)var ce=C.dgst;C=ce,f=Error(r(419)),f.stack="",f.digest=C,Wc({value:f,source:null,stack:null}),a=mv(i,a,c)}else if(An||ul(i,a,c,!1),C=(c&i.childLanes)!==0,An||C){if(C=qt,C!==null&&(f=Y(C,c),f!==0&&f!==J.retryLane))throw J.retryLane=f,Qa(i,f),Ar(C,i,f),cv;Yv(L)||df(),a=mv(i,a,c)}else Yv(L)?(a.flags|=192,a.child=i.child,a=null):(i=J.treeContext,en=li(L.nextSibling),Wn=a,pt=!0,ca=null,ai=!1,i!==null&&bw(a,i),a=pv(a,f.children),a.flags|=4096);return a}return v?(ga(),L=f.fallback,v=a.mode,J=i.child,ce=J.sibling,f=ms(J,{mode:"hidden",children:f.children}),f.subtreeFlags=J.subtreeFlags&65011712,ce!==null?L=ms(ce,L):(L=eo(L,v,c,null),L.flags|=2),L.return=a,f.return=a,f.sibling=L,a.child=f,su(null,f),f=a.child,L=i.child.memoizedState,L===null?L=hv(c):(v=L.cachePool,v!==null?(J=Tn._currentValue,v=v.parent!==J?{parent:J,pool:J}:v):v=kw(),L={baseLanes:L.baseLanes|c,cachePool:v}),f.memoizedState=L,f.childLanes=fv(i,C,c),a.memoizedState=dv,su(i.child,f)):(ma(a),c=i.child,i=c.sibling,c=ms(c,{mode:"visible",children:f.children}
vendor: 5,205 bytes, line 48
48),c.return=a,c.sibling=null,i!==null&&(C=a.deletions,C===null?(a.deletions=[i],a.flags|=16):C.push(i)),a.child=c,a.memoizedState=null,c)}function pv(i,a){return a=tf({mode:"visible",children:a},i.mode),a.return=i,i.child=a}function tf(i,a){return i=Ur(22,i,null,a),i.lanes=0,i}function mv(i,a,c){return oo(a,i.child,null,c),i=pv(a,a.pendingProps.children),i.flags|=2,a.memoizedState=null,i}function F1(i,a,c){i.lanes|=a;var f=i.alternate;f!==null&&(f.lanes|=a),Cg(i.return,a,c)}function gv(i,a,c,f,v,x){var C=i.memoizedState;C===null?i.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:f,tail:c,tailMode:v,treeForkCount:x}:(C.isBackwards=a,C.rendering=null,C.renderingStartTime=0,C.last=f,C.tail=c,C.tailMode=v,C.treeForkCount=x)}function $1(i,a,c){var f=a.pendingProps,v=f.revealOrder,x=f.tail;f=f.children;var C=wn.current,L=(C&2)!==0;if(L?(C=C&1|2,a.flags|=128):C&=1,P(wn,C),Kn(i,a,f,c),f=pt?Vc:0,!L&&i!==null&&(i.flags&128)!==0)e:for(i=a.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&F1(i,c,a);else if(i.tag===19)F1(i,c,a);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break e;for(;i.sibling===null;){if(i.return===null||i.return===a)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(v){case"forwards":for(c=a.child,v=null;c!==null;)i=c.alternate,i!==null&&Hh(i)===null&&(v=c),c=c.sibling;c=v,c===null?(v=a.child,a.child=null):(v=c.sibling,c.sibling=null),gv(a,!1,v,c,x,f);break;case"backwards":case"unstable_legacy-backwards":for(c=null,v=a.child,a.child=null;v!==null;){if(i=v.alternate,i!==null&&Hh(i)===null){a.child=v;break}i=v.sibling,v.sibling=c,c=v,v=i}gv(a,!0,c,null,x,f);break;case"together":gv(a,!1,null,null,void 0,f);break;default:a.memoizedState=null}return a.child}function _s(i,a,c){if(i!==null&&(a.dependencies=i.dependencies),ba|=a.lanes,(c&a.childLanes)===0)if(i!==null){if(ul(i,a,c,!1),(c&a.childLanes)===0)return null}else return null;if(i!==null&&a.child!==i.child)throw Error(r(153));if(a.child!==null){for(i=a.child,c=ms(i,i.pendingProps),a.child=c,c.return=a;i.sibling!==null;)i=i.sibling,c=c.sibling=ms(i,i.pendingProps),c.return=a;c.sibling=null}return a.child}function vv(i,a){return(i.lanes&a)!==0?!0:(i=i.dependencies,!!(i!==null&&Mh(i)))}function fD(i,a,c){switch(a.tag){case 3:ne(a,a.stateNode.containerInfo),da(a,Tn,i.memoizedState.cache),to();break;case 27:case 5:fe(a);break;case 4:ne(a,a.stateNode.containerInfo);break;case 10:da(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,Bg(a),null;break;case 13:var f=a.memoizedState;if(f!==null)return f.dehydrated!==null?(ma(a),a.flags|=128,null):(c&a.child.childLanes)!==0?P1(i,a,c):(ma(a),i=_s(i,a,c),i!==null?i.sibling:null);ma(a);break;case 19:var v=(i.flags&128)!==0;if(f=(c&a.childLanes)!==0,f||(ul(i,a,c,!1),f=(c&a.childLanes)!==0),v){if(f)return $1(i,a,c);a.flags|=128}if(v=a.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),P(wn,wn.current),f)break;return null;case 22:return a.lanes=0,R1(i,a,c,a.pendingProps);case 24:da(a,Tn,i.memoizedState.cache)}return _s(i,a,c)}function U1(i,a,c){if(i!==null)if(i.memoizedProps!==a.pendingProps)An=!0;else{if(!vv(i,c)&&(a.flags&128)===0)return An=!1,fD(i,a,c);An=(i.flags&131072)!==0}else An=!1,pt&&(a.flags&1048576)!==0&&yw(a,Vc,a.index);switch(a.lanes=0,a.tag){case 16:e:{var f=a.pendingProps;if(i=so(a.elementType),a.type=i,typeof i=="function")wg(i)?(f=co(i,f),a.tag=1,a=M1(null,a,i,f,c)):(a.tag=0,a=uv(null,a,i,f,c));else{if(i!=null){var v=i.$$typeof;if(v===N){a.tag=11,a=N1(null,a,i,f,c);break e}else if(v===F){a.tag=14,a=A1(null,a,i,f,c);break e}}throw a=K(i)||i,Error(r(306,a,""))}}return a;case 0:return uv(i,a,a.type,a.pendingProps,c);case 1:return f=a.type,v=co(f,a.pendingProps),M1(i,a,f,v,c);case 3:e:{if(ne(a,a.stateNode.containerInfo),i===null)throw Error(r(387));f=a.pendingProps;var x=a.memoizedState;v=x.element,Pg(i,a),eu(a,f,null,c);var C=a.memoizedState;if(f=C.cache,da(a,Tn,f),f!==x.cache&&Rg(a,[Tn],c,!0),Qc(),f=C.element,x.isDehydrated)if(x={element:f,isDehydrated:!1,cache:C.cache},a.updateQueue.baseState=x,a.memoizedState=x,a.flags&256){a=L1(i,a,f,c);break e}else if(f!==v){v=ri(Error(r(424)),a),Wc(v),a=L1(i,a,f,c);break e}else{switch(i=a.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(en=li(i.firstChild),Wn=a,pt=!0,ca=null,ai=!0,c=Rw(a,null,f,c),a.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(to(),f===v){a=_s(i,a,c);break e}Kn(i,a,f,c)}a=a.child}return a;case 26:return ef(i,a),i===null?(c=XS(a.type,null,a.pendingProps,null))?a.memoizedState=c:pt||(c=a.type,i=a.pendingProps,f=yf(X.current).createElement(c),f[Se]=a,f[De]=i,Jn(f,c,i),vt(f),a.stateNode=f):a.memoizedState=XS(a.type,i.memoizedProps,a.pendingProps,i.memoizedState),null;case 27:return fe(a),i===null&&pt&&(f=a.stateNode=YS(a.type,a.pendingProps,X.current),Wn=a,ai=!0,v=en,Ea(a.type)?(Jv=v,en=li(f.firstChild)):en=v),Kn(i,a,a.pendingProps.children,c),ef(i,a),i===null&&(a.flags|=4194304),a.child;case 5:return i===null&&pt&&((v=f=en)&&(f=HD(f,a.type,a.pendingProps,ai),f!==null?(a.stateNode=f,Wn=a,en=li(f.firstChild),ai=!1,v=!0):v=!1),v||ua(a)),fe(a),v=a.type,x=a.pe
vendor: 4,386 bytes, line 48
48ndingProps,C=i!==null?i.memoizedProps:null,f=x.children,Gv(v,x)?f=null:C!==null&&Gv(v,C)&&(a.flags|=32),a.memoizedState!==null&&(v=qg(i,a,iD,null,null,c),xu._currentValue=v),ef(i,a),Kn(i,a,f,c),a.child;case 6:return i===null&&pt&&((i=c=en)&&(c=qD(c,a.pendingProps,ai),c!==null?(a.stateNode=c,Wn=a,en=null,i=!0):i=!1),i||ua(a)),null;case 13:return P1(i,a,c);case 4:return ne(a,a.stateNode.containerInfo),f=a.pendingProps,i===null?a.child=oo(a,null,f,c):Kn(i,a,f,c),a.child;case 11:return N1(i,a,a.type,a.pendingProps,c);case 7:return Kn(i,a,a.pendingProps,c),a.child;case 8:return Kn(i,a,a.pendingProps.children,c),a.child;case 12:return Kn(i,a,a.pendingProps.children,c),a.child;case 10:return f=a.pendingProps,da(a,a.type,f.value),Kn(i,a,f.children,c),a.child;case 9:return v=a.type._context,f=a.pendingProps.children,ro(a),v=Yn(v),f=f(v),a.flags|=1,Kn(i,a,f,c),a.child;case 14:return A1(i,a,a.type,a.pendingProps,c);case 15:return C1(i,a,a.type,a.pendingProps,c);case 19:return $1(i,a,c);case 31:return hD(i,a,c);case 22:return R1(i,a,c,a.pendingProps);case 24:return ro(a),f=Yn(Tn),i===null?(v=Ig(),v===null&&(v=qt,x=Og(),v.pooledCache=x,x.refCount++,x!==null&&(v.pooledCacheLanes|=c),v=x),a.memoizedState={parent:f,cache:v},Lg(a),da(a,Tn,v)):((i.lanes&c)!==0&&(Pg(i,a),eu(a,null,null,c),Qc()),v=i.memoizedState,x=a.memoizedState,v.parent!==f?(v={parent:f,cache:f},a.memoizedState=v,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=v),da(a,Tn,f)):(f=x.cache,da(a,Tn,f),f!==v.cache&&Rg(a,[Tn],c,!0))),Kn(i,a,a.pendingProps.children,c),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function ws(i){i.flags|=4}function yv(i,a,c,f,v){if((a=(i.mode&32)!==0)&&(a=!1),a){if(i.flags|=16777216,(v&335544128)===v)if(i.stateNode.complete)i.flags|=8192;else if(fS())i.flags|=8192;else throw ao=$h,Mg}else i.flags&=-16777217}function z1(i,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!nE(a))if(fS())i.flags|=8192;else throw ao=$h,Mg}function nf(i,a){a!==null&&(i.flags|=4),i.flags&16384&&(a=i.tag!==22?bn():536870912,i.lanes|=a,wl|=a)}function au(i,a){if(!pt)switch(i.tailMode){case"hidden":a=i.tail;for(var c=null;a!==null;)a.alternate!==null&&(c=a),a=a.sibling;c===null?i.tail=null:c.sibling=null;break;case"collapsed":c=i.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?a||i.tail===null?i.tail=null:i.tail.sibling=null:f.sibling=null}}function tn(i){var a=i.alternate!==null&&i.alternate.child===i.child,c=0,f=0;if(a)for(var v=i.child;v!==null;)c|=v.lanes|v.childLanes,f|=v.subtreeFlags&65011712,f|=v.flags&65011712,v.return=i,v=v.sibling;else for(v=i.child;v!==null;)c|=v.lanes|v.childLanes,f|=v.subtreeFlags,f|=v.flags,v.return=i,v=v.sibling;return i.subtreeFlags|=f,i.childLanes=c,a}function pD(i,a,c){var f=a.pendingProps;switch(jg(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tn(a),null;case 1:return tn(a),null;case 3:return c=a.stateNode,f=null,i!==null&&(f=i.memoizedState.cache),a.memoizedState.cache!==f&&(a.flags|=2048),ys(Tn),ie(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(i===null||i.child===null)&&(cl(a)?ws(a):i===null||i.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Ng())),tn(a),null;case 26:var v=a.type,x=a.memoizedState;return i===null?(ws(a),x!==null?(tn(a),z1(a,x)):(tn(a),yv(a,v,null,f,c))):x?x!==i.memoizedState?(ws(a),tn(a),z1(a,x)):(tn(a),a.flags&=-16777217):(i=i.memoizedProps,i!==f&&ws(a),tn(a),yv(a,v,i,f,c)),null;case 27:if(_e(a),c=X.current,v=a.type,i!==null&&a.stateNode!=null)i.memoizedProps!==f&&ws(a);else{if(!f){if(a.stateNode===null)throw Error(r(166));return tn(a),null}i=q.current,cl(a)?xw(a):(i=YS(v,f,c),a.stateNode=i,ws(a))}return tn(a),null;case 5:if(_e(a),v=a.type,i!==null&&a.stateNode!=null)i.memoizedProps!==f&&ws(a);else{if(!f){if(a.stateNode===null)throw Error(r(166));return tn(a),null}if(x=q.current,cl(a))xw(a);else{var C=yf(X.current);switch(x){case 1:x=C.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:x=C.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":x=C.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":x=C.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":x=C.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;
vendor: 24,277 bytes, line 48
48case"select":x=typeof f.is=="string"?C.createElement("select",{is:f.is}):C.createElement("select"),f.multiple?x.multiple=!0:f.size&&(x.size=f.size);break;default:x=typeof f.is=="string"?C.createElement(v,{is:f.is}):C.createElement(v)}}x[Se]=a,x[De]=f;e:for(C=a.child;C!==null;){if(C.tag===5||C.tag===6)x.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===a)break e;for(;C.sibling===null;){if(C.return===null||C.return===a)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}a.stateNode=x;e:switch(Jn(x,v,f),v){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&ws(a)}}return tn(a),yv(a,a.type,i===null?null:i.memoizedProps,a.pendingProps,c),null;case 6:if(i&&a.stateNode!=null)i.memoizedProps!==f&&ws(a);else{if(typeof f!="string"&&a.stateNode===null)throw Error(r(166));if(i=X.current,cl(a)){if(i=a.stateNode,c=a.memoizedProps,f=null,v=Wn,v!==null)switch(v.tag){case 27:case 5:f=v.memoizedProps}i[Se]=a,i=!!(i.nodeValue===c||f!==null&&f.suppressHydrationWarning===!0||PS(i.nodeValue,c)),i||ua(a,!0)}else i=yf(i).createTextNode(f),i[Se]=a,a.stateNode=i}return tn(a),null;case 31:if(c=a.memoizedState,i===null||i.memoizedState!==null){if(f=cl(a),c!==null){if(i===null){if(!f)throw Error(r(318));if(i=a.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Se]=a}else to(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;tn(a),i=!1}else c=Ng(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=c),i=!0;if(!i)return a.flags&256?(Br(a),a):(Br(a),null);if((a.flags&128)!==0)throw Error(r(558))}return tn(a),null;case 13:if(f=a.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(v=cl(a),f!==null&&f.dehydrated!==null){if(i===null){if(!v)throw Error(r(318));if(v=a.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(r(317));v[Se]=a}else to(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;tn(a),v=!1}else v=Ng(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=v),v=!0;if(!v)return a.flags&256?(Br(a),a):(Br(a),null)}return Br(a),(a.flags&128)!==0?(a.lanes=c,a):(c=f!==null,i=i!==null&&i.memoizedState!==null,c&&(f=a.child,v=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(v=f.alternate.memoizedState.cachePool.pool),x=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(x=f.memoizedState.cachePool.pool),x!==v&&(f.flags|=2048)),c!==i&&c&&(a.child.flags|=8192),nf(a,a.updateQueue),tn(a),null);case 4:return ie(),i===null&&Uv(a.stateNode.containerInfo),tn(a),null;case 10:return ys(a.type),tn(a),null;case 19:if($(wn),f=a.memoizedState,f===null)return tn(a),null;if(v=(a.flags&128)!==0,x=f.rendering,x===null)if(v)au(f,!1);else{if(pn!==0||i!==null&&(i.flags&128)!==0)for(i=a.child;i!==null;){if(x=Hh(i),x!==null){for(a.flags|=128,au(f,!1),i=x.updateQueue,a.updateQueue=i,nf(a,i),a.subtreeFlags=0,i=c,c=a.child;c!==null;)mw(c,i),c=c.sibling;return P(wn,wn.current&1|2),pt&&gs(a,f.treeForkCount),a.child}i=i.sibling}f.tail!==null&&Zt()>lf&&(a.flags|=128,v=!0,au(f,!1),a.lanes=4194304)}else{if(!v)if(i=Hh(x),i!==null){if(a.flags|=128,v=!0,i=i.updateQueue,a.updateQueue=i,nf(a,i),au(f,!0),f.tail===null&&f.tailMode==="hidden"&&!x.alternate&&!pt)return tn(a),null}else 2*Zt()-f.renderingStartTime>lf&&c!==536870912&&(a.flags|=128,v=!0,au(f,!1),a.lanes=4194304);f.isBackwards?(x.sibling=a.child,a.child=x):(i=f.last,i!==null?i.sibling=x:a.child=x,f.last=x)}return f.tail!==null?(i=f.tail,f.rendering=i,f.tail=i.sibling,f.renderingStartTime=Zt(),i.sibling=null,c=wn.current,P(wn,v?c&1|2:c&1),pt&&gs(a,f.treeForkCount),i):(tn(a),null);case 22:case 23:return Br(a),zg(),f=a.memoizedState!==null,i!==null?i.memoizedState!==null!==f&&(a.flags|=8192):f&&(a.flags|=8192),f?(c&536870912)!==0&&(a.flags&128)===0&&(tn(a),a.subtreeFlags&6&&(a.flags|=8192)):tn(a),c=a.updateQueue,c!==null&&nf(a,c.retryQueue),c=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),f=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),f!==c&&(a.flags|=2048),i!==null&&$(io),null;case 24:return c=null,i!==null&&(c=i.memoizedState.cache),a.memoizedState.cache!==c&&(a.flags|=2048),ys(Tn),tn(a),null;case 25:return null;case 30:return null}throw Error(r(156,a.tag))}function mD(i,a){switch(jg(a),a.tag){case 1:return i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 3:return ys(Tn),ie(),i=a.flags,(i&65536)!==0&&(i&128)===0?(a.flags=i&-65537|128,a):null;case 26:case 27:case 5:return _e(a),null;case 31:if(a.memoizedState!==null){if(Br(a),a.alternate===null)throw Error(r(340));to()}return i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 13:if(Br(a),i=a.memoizedState,i!==null&&i.dehydrated!==null){if(a.alternate===null)throw Error(r(340));to()}return i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 19:return $(wn),null;case 4:return ie(),null;case 10:return ys(a.type),null;case 22:case 23:return Br(a),zg(),i!==null&&$(io),i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 24:return ys(Tn),null;case 25:return null;default:return null}}function B1(i,a){switch(jg(a),a.tag){case 3:ys(Tn),ie();break;case 26:case 27:case 5:_e(a);break;case 4:ie();break;case 31:a.memoizedState!==null&&Br(a);break;case 13:Br(a);break;case 19:$(wn);break;case 10:ys(a.type);break;case 22:case 23:Br(a),zg(),i!==null&&$(io);break;case 24:ys(Tn)}}function ou(i,a){try{var c=a.updateQueue,f=c!==null?c.lastEffect:null;if(f!==null){var v=f.next;c=v;do{if((c.tag&i)===i){f=void 0;var x=c.create,C=c.inst;f=x(),C.destroy=f}c=c.next}while(c!==v)}}catch(L){Rt(a,a.return,L)}}function va(i,a,c){try{var f=a.updateQueue,v=f!==null?f.lastEffect:null;if(v!==null){var x=v.next;f=x;do{if((f.tag&i)===i){var C=f.inst,L=C.destroy;if(L!==void 0){C.destroy=void 0,v=a;var J=c,ce=L;try{ce()}catch(me){Rt(v,J,me)}}}f=f.next}while(f!==x)}}catch(me){Rt(a,a.return,me)}}function H1(i){var a=i.updateQueue;if(a!==null){var c=i.stateNode;try{Dw(a,c)}catch(f){Rt(i,i.return,f)}}}function q1(i,a,c){c.props=co(i.type,i.memoizedProps),c.state=i.memoizedState;try{c.componentWillUnmount()}catch(f){Rt(i,a,f)}}function lu(i,a){try{var c=i.ref;if(c!==null){switch(i.tag){case 26:case 27:case 5:var f=i.stateNode;break;case 30:f=i.stateNode;break;default:f=i.stateNode}typeof c=="function"?i.refCleanup=c(f):c.current=f}}catch(v){Rt(i,a,v)}}function Vi(i,a){var c=i.ref,f=i.refCleanup;if(c!==null)if(typeof f=="function")try{f()}catch(v){Rt(i,a,v)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(v){Rt(i,a,v)}else c.current=null}function G1(i){var a=i.type,c=i.memoizedProps,f=i.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":c.autoFocus&&f.focus();break e;case"img":c.src?f.src=c.src:c.srcSet&&(f.srcset=c.srcSet)}}catch(v){Rt(i,i.return,v)}}function bv(i,a,c){try{var f=i.stateNode;PD(f,i.type,c,a),f[De]=a}catch(v){Rt(i,i.return,v)}}function V1(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Ea(i.type)||i.tag===4}function xv(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||V1(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Ea(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function _v(i,a,c){var f=i.tag;if(f===5||f===6)i=i.stateNode,a?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(i,a):(a=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,a.appendChild(i),c=c._reactRootContainer,c!=null||a.onclick!==null||(a.onclick=fs));else if(f!==4&&(f===27&&Ea(i.type)&&(c=i.stateNode,a=null),i=i.child,i!==null))for(_v(i,a,c),i=i.sibling;i!==null;)_v(i,a,c),i=i.sibling}function rf(i,a,c){var f=i.tag;if(f===5||f===6)i=i.stateNode,a?c.insertBefore(i,a):c.appendChild(i);else if(f!==4&&(f===27&&Ea(i.type)&&(c=i.stateNode),i=i.child,i!==null))for(rf(i,a,c),i=i.sibling;i!==null;)rf(i,a,c),i=i.sibling}function W1(i){var a=i.stateNode,c=i.memoizedProps;try{for(var f=i.type,v=a.attributes;v.length;)a.removeAttributeNode(v[0]);Jn(a,f,c),a[Se]=i,a[De]=c}catch(x){Rt(i,i.return,x)}}var Ss=!1,Cn=!1,wv=!1,Y1=typeof WeakSet=="function"?WeakSet:Set,Hn=null;function gD(i,a){if(i=i.containerInfo,Hv=kf,i=aw(i),mg(i)){if("selectionStart"in i)var c={start:i.selectionStart,end:i.selectionEnd};else e:{c=(c=i.ownerDocument)&&c.defaultView||window;var f=c.getSelection&&c.getSelection();if(f&&f.rangeCount!==0){c=f.anchorNode;var v=f.anchorOffset,x=f.focusNode;f=f.focusOffset;try{c.nodeType,x.nodeType}catch{c=null;break e}var C=0,L=-1,J=-1,ce=0,me=0,be=i,ue=null;t:for(;;){for(var he;be!==c||v!==0&&be.nodeType!==3||(L=C+v),be!==x||f!==0&&be.nodeType!==3||(J=C+f),be.nodeType===3&&(C+=be.nodeValue.length),(he=be.firstChild)!==null;)ue=be,be=he;for(;;){if(be===i)break t;if(ue===c&&++ce===v&&(L=C),ue===x&&++me===f&&(J=C),(he=be.nextSibling)!==null)break;be=ue,ue=be.parentNode}be=he}c=L===-1||J===-1?null:{start:L,end:J}}else c=null}c=c||{start:0,end:0}}else c=null;for(qv={focusedElem:i,selectionRange:c},kf=!1,Hn=a;Hn!==null;)if(a=Hn,i=a.child,(a.subtreeFlags&1028)!==0&&i!==null)i.return=a,Hn=i;else for(;Hn!==null;){switch(a=Hn,x=a.alternate,i=a.flags,a.tag){case 0:if((i&4)!==0&&(i=a.updateQueue,i=i!==null?i.events:null,i!==null))for(c=0;c<i.length;c++)v=i[c],v.ref.impl=v.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&x!==null){i=void 0,c=a,v=x.memoizedProps,x=x.memoizedState,f=c.stateNode;try{var Ie=co(c.type,v);i=f.getSnapshotBeforeUpdate(Ie,x),f.__reactInternalSnapshotBeforeUpdate=i}catch(We){Rt(c,c.return,We)}}break;case 3:if((i&1024)!==0){if(i=a.stateNode.containerInfo,c=i.nodeType,c===9)Wv(i);else if(c===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Wv(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=a.sibling,i!==null){i.return=a.return,Hn=i;break}Hn=a.return}}function K1(i,a,c){var f=c.flags;switch(c.tag){case 0:case 11:case 15:ks(i,c),f&4&&ou(5,c);break;case 1:if(ks(i,c),f&4)if(i=c.stateNode,a===null)try{i.componentDidMount()}catch(C){Rt(c,c.return,C)}else{var v=co(c.type,a.memoizedProps);a=a.memoizedState;try{i.componentDidUpdate(v,a,i.__reactInternalSnapshotBeforeUpdate)}catch(C){Rt(c,c.return,C)}}f&64&&H1(c),f&512&&lu(c,c.return);break;case 3:if(ks(i,c),f&64&&(i=c.updateQueue,i!==null)){if(a=null,c.child!==null)switch(c.child.tag){case 27:case 5:a=c.child.stateNode;break;case 1:a=c.child.stateNode}try{Dw(i,a)}catch(C){Rt(c,c.return,C)}}break;case 27:a===null&&f&4&&W1(c);case 26:case 5:ks(i,c),a===null&&f&4&&G1(c),f&512&&lu(c,c.return);break;case 12:ks(i,c);break;case 31:ks(i,c),f&4&&Z1(i,c);break;case 13:ks(i,c),f&4&&Q1(i,c),f&64&&(i=c.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(c=kD.bind(null,c),GD(i,c))));break;case 22:if(f=c.memoizedState!==null||Ss,!f){a=a!==null&&a.memoizedState!==null||Cn,v=Ss;var x=Cn;Ss=f,(Cn=a)&&!x?js(i,c,(c.subtreeFlags&8772)!==0):ks(i,c),Ss=v,Cn=x}break;case 30:break;default:ks(i,c)}}function J1(i){var a=i.alternate;a!==null&&(i.alternate=null,J1(a)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(a=i.stateNode,a!==null&&bt(a)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var ln=null,kr=!1;function Es(i,a,c){for(c=c.child;c!==null;)X1(i,a,c),c=c.sibling}function X1(i,a,c){if(Pn&&typeof Pn.onCommitFiberUnmount=="function")try{Pn.onCommitFiberUnmount(fr,c)}catch{}switch(c.tag){case 26:Cn||Vi(c,a),Es(i,a,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:Cn||Vi(c,a);var f=ln,v=kr;Ea(c.type)&&(ln=c.stateNode,kr=!1),Es(i,a,c),vu(c.stateNode),ln=f,kr=v;break;case 5:Cn||Vi(c,a);case 6:if(f=ln,v=kr,ln=null,Es(i,a,c),ln=f,kr=v,ln!==null)if(kr)try{(ln.nodeType===9?ln.body:ln.nodeName==="HTML"?ln.ownerDocument.body:ln).removeChild(c.stateNode)}catch(x){Rt(c,a,x)}else try{ln.removeChild(c.stateNode)}catch(x){Rt(c,a,x)}break;case 18:ln!==null&&(kr?(i=ln,HS(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,c.stateNode),Cl(i)):HS(ln,c.stateNode));break;case 4:f=ln,v=kr,ln=c.stateNode.containerInfo,kr=!0,Es(i,a,c),ln=f,kr=v;break;case 0:case 11:case 14:case 15:va(2,c,a),Cn||va(4,c,a),Es(i,a,c);break;case 1:Cn||(Vi(c,a),f=c.stateNode,typeof f.componentWillUnmount=="function"&&q1(c,a,f)),Es(i,a,c);break;case 21:Es(i,a,c);break;case 22:Cn=(f=Cn)||c.memoizedState!==null,Es(i,a,c),Cn=f;break;default:Es(i,a,c)}}function Z1(i,a){if(a.memoizedState===null&&(i=a.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Cl(i)}catch(c){Rt(a,a.return,c)}}}function Q1(i,a){if(a.memoizedState===null&&(i=a.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Cl(i)}catch(c){Rt(a,a.return,c)}}function vD(i){switch(i.tag){case 31:case 13:case 19:var a=i.stateNode;return a===null&&(a=i.stateNode=new Y1),a;case 22:return i=i.stateNode,a=i._retryCache,a===null&&(a=i._retryCache=new Y1),a;default:throw Error(r(435,i.tag))}}function sf(i,a){var c=vD(i);a.forEach(function(f){if(!c.has(f)){c.add(f);var v=jD.bind(null,i,f);f.then(v,v)}})}function jr(i,a){var c=a.deletions;if(c!==null)for(var f=0;f<c.length;f++){var v=c[f],x=i,C=a,L=C;e:for(;L!==null;){switch(L.tag){case 27:if(Ea(L.type)){ln=L.stateNode,kr=!1;break e}break;case 5:ln=L.stateNode,kr=!1;break e;case 3:case 4:ln=L.stateNode.containerInfo,kr=!0;break e}L=L.return}if(ln===null)throw Error(r(160));X1(x,C,v),ln=null,kr=!1,x=v.alternate,x!==null&&(x.return=null),v.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)eS(a,i),a=a.sibling}var Ai=null;function eS(i,a){var c=i.alternate,f=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:jr(a,i),Tr(i),f&4&&(va(3,i,i.return),ou(3,i),va(5,i,i.return));break;case 1:jr(a,i),Tr(i),f&512&&(Cn||c===null||Vi(c,c.return)),f&64&&Ss&&(i=i.updateQueue,i!==null&&(f=i.callbacks,f!==null&&(c=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=c===null?f:c.concat(f))));break;case 26:var v=Ai;if(jr(a,i),Tr(i),f&512&&(Cn||c===null||Vi(c,c.return)),f&4){var x=c!==null?c.memoizedState:null;if(f=i.memoizedState,c===null)if(f===null)if(i.stateNode===null){e:{f=i.type,c=i.memoizedProps,v=v.ownerDocument||v;t:switch(f){case"title":x=v.getElementsByTagName("title")[0],(!x||x[at]||x[Se]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=v.createElement(f),v.head.insertBefore(x,v.querySelector("head > title"))),Jn(x,f,c),x[Se]=i,vt(x),f=x;break e;case"link":var C=eE("link","href",v).get(f+(c.href||""));if(C){for(var L=0;L<C.length;L++)if(x=C[L],x.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&x.getAttribute("rel")===(c.rel==null?null:c.rel)&&x.getAttribute("title")===(c.title==null?null:c.title)&&x.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){C.splice(L,1);break t}}x=v.createElement(f),Jn(x,f,c),v.head.appendChild(x);break;case"meta":if(C=eE("meta","content",v).get(f+(c.content||""))){for(L=0;L<C.length;L++)if(x=C[L],x.getAttribute("content")===(c.content==null?null:""+c.content)&&x.getAttribute("name")===(c.name==null?null:c.name)&&x.getAttribute("property")===(c.property==null?null:c.property)&&x.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&x.getAttribute("charset")===(c.charSet==null?null:c.charSet)){C.splice(L,1);break t}}x=v.createElement(f),Jn(x,f,c),v.head.appendChild(x);break;default:throw Error(r(468,f))}x[Se]=i,vt(x),f=x}i.stateNode=f}else tE(v,i.type,i.stateNode);else i.stateNode=QS(v,f,i.memoizedProps);else x!==f?(x===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):x.count--,f===null?tE(v,i.type,i.stateNode):QS(v,f,i.memoizedProps)):f===null&&i.stateNode!==null&&bv(i,i.memoizedProps,c.memoizedProps)}break;case 27:jr(a,i),Tr(i),f&512&&(Cn||c===null||Vi(c,c.return)),c!==null&&f&4&&bv(i,i.memoizedProps,c.memoizedProps);break;case 5:if(jr(a,i),Tr(i),f&512&&(Cn||c===null||Vi(c,c.return)),i.flags&32){v=i.stateNode;try{Qo(v,"")}catch(Ie){Rt(i,i.return,Ie)}}f&4&&i.stateNode!=null&&(v=i.memoizedProps,bv(i,v,c!==null?c.memoizedProps:v)),f&1024&&(wv=!0);break;case 6:if(jr(a,i),Tr(i),f&4){if(i.stateNode===null)throw Error(r(162));f=i.memoizedProps,c=i.stateNode;try{c.nodeValue=f}catch(Ie){Rt(i,i.return,Ie)}}break;case 3:if(_f=null,v=Ai,Ai=bf(a.containerInfo),jr(a,i),Ai=v,Tr(i),f&4&&c!==null&&c.memoizedState.isDehydrated)try{Cl(a.containerInfo)}catch(Ie){Rt(i,i.return,Ie)}wv&&(wv=!1,tS(i));break;case 4:f=Ai,Ai=bf(i.stateNode.containerInfo),jr(a,i),Tr(i),Ai=f;break;case 12:jr(a,i),Tr(i);break;case 31:jr(a,i),Tr(i),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,sf(i,f)));break;case 13:jr(a,i),Tr(i),i.child.flags&8192&&i.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(of=Zt()),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,sf(i,f)));break;case 22:v=i.memoizedState!==null;var J=c!==null&&c.memoizedState!==null,ce=Ss,me=Cn;if(Ss=ce||v,Cn=me||J,jr(a,i),Cn=me,Ss=ce,Tr(i),f&8192)e:for(a=i.stateNode,a._visibility=v?a._visibility&-2:a._visibility|1,v&&(c===null||J||Ss||Cn||uo(i)),c=null,a=i;;){if(a.tag===5||a.tag===26){if(c===null){J=c=a;try{if(x=J.stateNode,v)C=x.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{L=J.stateNode;var be=J.memoizedProps.style,ue=be!=null&&be.hasOwnProperty("display")?be.display:null;L.style.display=ue==null||typeof ue=="boolean"?"":(""+ue).trim()}}catch(Ie){Rt(J,J.return,Ie)}}}else if(a.tag===6){if(c===null){J=a;try{J.stateNode.nodeValue=v?"":J.memoizedProps}catch(Ie){Rt(J,J.return,Ie)}}}else if(a.tag===18){if(c===null){J=a;try{var he=J.stateNode;v?qS(he,!0):qS(J.stateNode,!1)}catch(Ie){Rt(J,J.return,Ie)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===i)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break e;for(;a.sibling===null;){if(a.return===null||a.return===i)break e;c===a&&(c=null),a=a.return}c===a&&(c=null),a.sibling.return=a.return,a=a.sibling}f&4&&(f=i.updateQueue,f!==null&&(c=f.retryQueue,c!==null&&(f.retryQueue=null,sf(i,c))));break;case 19:jr(a,i),Tr(i),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,sf(i,f)));break;case 30:break;case 21:break;default:jr(a,i),Tr(i)}}function Tr(i){var a=i.flags;if(a&2){try{for(var c,f=i.return;f!==null;){if(V1(f)){c=f;break}f=f.return}if(c==null)throw Error(r(160));switch(c.tag){case 27:var v=c.stateNode,x=xv(i);rf(i,x,v);break;case 5:var C=c.stateNode;c.flags&32&&(Qo(C,""),c.flags&=-33);var L=xv(i);rf(i,L,C);break;case 3:case 4:var J=c.stateNode.containerInfo,ce=xv(i);_v(i,ce,J);break;default:throw Error(r(161))}}catch(me){Rt(i,i.return,me)}i.flags&=-3}a&4096&&(i.flags&=-4097)}function tS(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var a=i;tS(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),i=i.sibling}}function ks(i,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)K1(i,a.alternate,a),a=a.sibling}function uo(i){for(i=i.child;i!==null;){var a=i;switch(a.tag){case 0:case 11:case 14:case 15:va(4,a,a.return),uo(a);break;case 1:Vi(a,a.return);var c=a.stateNode;typeof c.componentWillUnmount=="function"&&q1(a,a.return,c),uo(a);break;case 27:vu(a.stateNode);case 26:case 5:Vi(a,a.return),uo(a);break;case 22:a.memoizedState===null&&uo(a);break;case 30:uo(a);break;default:uo(a)}i=i.sibling}}function js(i,a,c){for(c=c&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var f=a.alternate,v=i,x=a,C=x.flags;switch(x.tag){case 0:case 11:case 15:js(v,x,c),ou(4,x);break;case 1:if(js(v,x,c),f=x,v=f.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(ce){Rt(f,f.return,ce)}if(f=x,v=f.updateQueue,v!==null){var L=f.stateNode;try{var J=v.shared.hiddenCallbacks;if(J!==null)for(v.shared.hiddenCallbacks=null,v=0;v<J.length;v++)Ow(J[v],L)}catch(ce){Rt(f,f.return,ce)}}c&&C&64&&H1(x),lu(x,x.return);break;case 27:W1(x);case 26:case 5:js(v,x,c),c&&f===null&&C&4&&G1(x),lu(x,x.return);break;case 12:js(v,x,c);break;case 31:js(v,x,c),c&&C&4&&Z1(v,x);break;case 13:js(v,x,c),c&&C&4&&Q1(v,x);break;case 22:x.memoizedState===null&&js(v,x,c),lu(x,x.return);break;case 30:break;default:js(v,x,c)}a=a.sibling}}function Sv(i,a){var c=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),i=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(i=a.memoizedState.cachePool.pool),i!==c&&(i!=null&&i.refCount++,c!=null&&Yc(c))}function Ev(i,a){i=null,a.alternate!==null&&(i=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==i&&(a.refCount++,i!=null&&Yc(i))}function Ci(i,a,c,f){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)nS(i,a,c,f),a=a.sibling}function nS(i,a,c,f){var v=a.flags;switch(a.tag){case 0:case 11:case 15:Ci(i,a,c,f),v&2048&&ou(9,a);break;case 1:Ci(i,a,c,f);break;case 3:Ci(i,a,c,f),v&2048&&(i=null,a.alternate!==null&&(i=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==i&&(a.refCount++,i!=null&&Yc(i)));break;case 12:if(v&2048){Ci(i,a,c,f),i=a.stateNode;try{var x=a.memoizedProps,C=x.id,L=x.onPostCommit;typeof L=="function"&&L(C,a.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(J){Rt(a,a.return,J)}}else Ci(i,a,c,f);break;case 31:Ci(i,a,c,f);break;case 13:Ci(i,a,c,f);break;case 23:break;case 22:x=a.stateNode,C=a.alternate,a.memoizedState!==null?x._visibility&2?Ci(i,a,c,f):cu(i,a):x._visibility&2?Ci(i,a,c,f):(x._visibility|=2,bl(i,a,c,f,(a.subtreeFlags&10256)!==0||!1)),v&2048&&Sv(C,a);break;case 24:Ci(i,a,c,f),v&2048&&Ev(a.alternate,a);break;default:Ci(i,a,c,f)}}function bl(i,a,c,f,v){for(v=v&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var x=i,C=a,L=c,J=f,ce=C.flags;switch(C.tag){case 0:case 11:case 15:bl(x,C,L,J,v),ou(8,C);break;case 23:break;case 22:var me=C.stateNode;C.memoizedState!==null?me._visibility&2?bl(x,C,L,J,v):cu(x,C):(me._visibility|=2,bl(x,C,L,J,v)),v&&ce&2048&&Sv(C.alternate,C);break;case 24:bl(x,C,L,J,v),v&&ce&2048&&Ev(C.alternate,C);break;default:bl(x,C,L,J,v)}a=a.sibling}}function cu(i,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var c=i,f=a,v=f.flags;switch(f.tag){case 22:cu(c,f),v&2048&&Sv(f.alternate,f);break;case 24:cu(c,f),v&2048&&Ev(f.alternate,f);break;default:cu(c,f)}a=a.sibling}}var uu=8192;function xl(i,a,c){if(i.subtreeFlags&uu)for(i=i.child;i!==null;)rS(i,a,c),i=i.sibling}function rS(i,a,c){switch(i.tag){case 26:xl(i,a,c),i.flags&uu&&i.memoizedState!==null&&r4(c,Ai,i.memoizedState,i.memoizedProps);break;case 5:xl(i,a,c);break;case 3:case 4:var f=Ai;Ai=bf(i.stateNode.containerInfo),xl(i,a,c),Ai=f;break;case 22:i.memoizedState===null&&(f=i.alternate,f!==null&&f.memoizedState!==null?(f=uu,uu=16777216,xl(i,a,c),uu=f):xl(i,a,c));break;default:xl(i,a,c)}}function iS(i){var a=i.alternate;if(a!==null&&(i=a.child,i!==null)){a.child=null;do a=i.sibling,i.sibling=null,i=a;while(i!==null)}}function du(i){var a=i.deletions;if((i.flags&16)!==0){if(a!==null)for(var c=0;c<a.length;c++){var f=a[c];Hn=f,aS(f,i)}iS(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)sS(i),i=i.sibling}function sS(i){switch(i.tag){case 0:case 11:case 15:du(i),i.flags&2048&&va(9,i,i.return);break;case 3:du(i);break;case 12:du(i);break;case 22:var a=i.stateNode;i.memoizedState!==null&&a._visibility&2&&(i.return===null||i.return.tag!==13)?(a._visibility&=-3,af(i)):du(i);break;default:du(i)}}function af(i){var a=i.deletions;if((i.flags&16)!==0){if(a!==null)for(var c=0;c<a.length;c++){var f=a[c];Hn=f,aS(f,i)}iS(i)}for(i=i.child;i!==null;){switch(a=i,a.tag){case 0:case 11:case 15:va(8,a,a.return),af(a);break;case 22:c=a.stateNode,c._visibility&2&&(c._visibility&=-3,af(a));break;default:af(a)}i=i.sibling}}function aS(i,a){for(;Hn!==null;){var c=Hn;switch(c.tag){case 0:case 11:case 15:va(8,c,a);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var f=c.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:Yc(c.memoizedState.cache)}if(f=c.child,f!==null)f.return=c,Hn=f;else e:for(c=i;Hn!==null;){f=Hn;var v=f.sibling,x=f.return;if(J1(f),f===c){Hn=null;break e}if(v!==null){v.return=x,Hn=v;break e}Hn=x}}}
vendor: 4,918 bytes, line 48
48var yD={getCacheForType:function(i){var a=Yn(Tn),c=a.data.get(i);return c===void 0&&(c=i(),a.data.set(i,c)),c},cacheSignal:function(){return Yn(Tn).controller.signal}},bD=typeof WeakMap=="function"?WeakMap:Map,St=0,qt=null,lt=null,ht=0,Ct=0,Hr=null,ya=!1,_l=!1,kv=!1,Ts=0,pn=0,ba=0,ho=0,jv=0,qr=0,wl=0,hu=null,Nr=null,Tv=!1,of=0,oS=0,lf=1/0,cf=null,xa=null,Un=0,_a=null,Sl=null,Ns=0,Nv=0,Av=null,lS=null,fu=0,Cv=null;function Gr(){return(St&2)!==0&&ht!==0?ht&-ht:I.T!==null?Lv():ge()}function cS(){if(qr===0)if((ht&536870912)===0||pt){var i=Pr;Pr<<=1,(Pr&3932160)===0&&(Pr=262144),qr=i}else qr=536870912;return i=zr.current,i!==null&&(i.flags|=32),qr}function Ar(i,a,c){(i===qt&&(Ct===2||Ct===9)||i.cancelPendingCommit!==null)&&(El(i,0),wa(i,ht,qr,!1)),dt(i,c),((St&2)===0||i!==qt)&&(i===qt&&((St&2)===0&&(ho|=c),pn===4&&wa(i,ht,qr,!1)),Wi(i))}function uS(i,a,c){if((St&6)!==0)throw Error(r(327));var f=!c&&(a&127)===0&&(a&i.expiredLanes)===0||Bt(i,a),v=f?wD(i,a):Ov(i,a,!0),x=f;do{if(v===0){_l&&!f&&wa(i,a,0,!1);break}else{if(c=i.current.alternate,x&&!xD(c)){v=Ov(i,a,!1),x=!1;continue}if(v===2){if(x=a,i.errorRecoveryDisabledLanes&x)var C=0;else C=i.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){a=C;e:{var L=i;v=hu;var J=L.current.memoizedState.isDehydrated;if(J&&(El(L,C).flags|=256),C=Ov(L,C,!1),C!==2){if(kv&&!J){L.errorRecoveryDisabledLanes|=x,ho|=x,v=4;break e}x=Nr,Nr=v,x!==null&&(Nr===null?Nr=x:Nr.push.apply(Nr,x))}v=C}if(x=!1,v!==2)continue}}if(v===1){El(i,0),wa(i,a,0,!0);break}e:{switch(f=i,x=v,x){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a)break;case 6:wa(f,a,qr,!ya);break e;case 2:Nr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(v=of+300-Zt(),10<v)){if(wa(f,a,qr,!ya),He(f,0,!0)!==0)break e;Ns=a,f.timeoutHandle=zS(dS.bind(null,f,c,Nr,cf,Tv,a,qr,ho,wl,ya,x,"Throttled",-0,0),v);break e}dS(f,c,Nr,cf,Tv,a,qr,ho,wl,ya,x,null,-0,0)}}break}while(!0);Wi(i)}function dS(i,a,c,f,v,x,C,L,J,ce,me,be,ue,he){if(i.timeoutHandle=-1,be=a.subtreeFlags,be&8192||(be&16785408)===16785408){be={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:fs},rS(a,x,be);var Ie=(x&62914560)===x?of-Zt():(x&4194048)===x?oS-Zt():0;if(Ie=i4(be,Ie),Ie!==null){Ns=x,i.cancelPendingCommit=Ie(bS.bind(null,i,a,x,c,f,v,C,L,J,me,be,null,ue,he)),wa(i,x,C,!ce);return}}bS(i,a,x,c,f,v,C,L,J)}function xD(i){for(var a=i;;){var c=a.tag;if((c===0||c===11||c===15)&&a.flags&16384&&(c=a.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var f=0;f<c.length;f++){var v=c[f],x=v.getSnapshot;v=v.value;try{if(!$r(x(),v))return!1}catch{return!1}}if(c=a.child,a.subtreeFlags&16384&&c!==null)c.return=a,a=c;else{if(a===i)break;for(;a.sibling===null;){if(a.return===null||a.return===i)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function wa(i,a,c,f){a&=~jv,a&=~ho,i.suspendedLanes|=a,i.pingedLanes&=~a,f&&(i.warmLanes|=a),f=i.expirationTimes;for(var v=a;0<v;){var x=31-yn(v),C=1<<x;f[x]=-1,v&=~C}c!==0&&$n(i,c,a)}function uf(){return(St&6)===0?(pu(0),!1):!0}function Rv(){if(lt!==null){if(Ct===0)var i=lt.return;else i=lt,vs=no=null,Wg(i),pl=null,Jc=0,i=lt;for(;i!==null;)B1(i.alternate,i),i=i.return;lt=null}}function El(i,a){var c=i.timeoutHandle;c!==-1&&(i.timeoutHandle=-1,UD(c)),c=i.cancelPendingCommit,c!==null&&(i.cancelPendingCommit=null,c()),Ns=0,Rv(),qt=i,lt=c=ms(i.current,null),ht=a,Ct=0,Hr=null,ya=!1,_l=Bt(i,a),kv=!1,wl=qr=jv=ho=ba=pn=0,Nr=hu=null,Tv=!1,(a&8)!==0&&(a|=a&32);var f=i.entangledLanes;if(f!==0)for(i=i.entanglements,f&=a;0<f;){var v=31-yn(f),x=1<<v;a|=i[v],f&=~x}return Ts=a,Ch(),c}function hS(i,a){rt=null,I.H=iu,a===fl||a===Fh?(a=Nw(),Ct=3):a===Mg?(a=Nw(),Ct=4):Ct=a===cv?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,Hr=a,lt===null&&(pn=1,Zh(i,ri(a,i.current)))}function fS(){var i=zr.current;return i===null?!0:(ht&4194048)===ht?oi===null:(ht&62914560)===ht||(ht&536870912)!==0?i===oi:!1}function pS(){var i=I.H;return I.H=iu,i===null?iu:i}function mS(){var i=I.A;return I.A=yD,i}function df(){pn=4,ya||(ht&4194048)!==ht&&zr.current!==null||(_l=!0),(ba&134217727)===0&&(ho&134217727)===0||qt===null||wa(qt,ht,qr,!1)}function Ov(i,a,c){var f=St;St|=2;var v=pS(),x=mS();(qt!==i||ht!==a)&&(cf=null,El(i,a)),a=!1;var C=pn;e:do try{if(Ct!==0&&lt!==null){var L=lt,J=Hr;switch(Ct){case 8:Rv(),C=6;break e;case 3:case 2:case 9:case 6:zr.current===null&&(a=!0);var ce=Ct;if(Ct=0,Hr=null,kl(i,L,J,ce),c&&_l){C=0;break e}break;default:ce=Ct,Ct=0,Hr=null,kl(i,L,J,ce)}}_D(),C=pn;break}catch(me){hS(i,me)}while(!0);return a&&i.shellSuspendCounter++,vs=no=null,St=f,I.H=v,I.A=x,lt===null&&(qt=null,ht=0,Ch()),C}function _D(){for(;lt!==null;)gS(lt)}function wD(i,a){var c=St;St|=2;var f=pS(),v=mS();qt!==i||ht!==a?(cf=null,lf=Zt()+500,El(i,a)):_l=Bt(i,a);e:do try{if(Ct!==0&&lt!==null){a=lt;var x=Hr;t:switch(Ct){case 1:Ct=0,Hr=null,kl(i,a,x,1);break;
vendor: 1,834 bytes, line 48
48case 2:case 9:if(jw(x)){Ct=0,Hr=null,vS(a);break}a=function(){Ct!==2&&Ct!==9||qt!==i||(Ct=7),Wi(i)},x.then(a,a);break e;case 3:Ct=7;break e;case 4:Ct=5;break e;case 7:jw(x)?(Ct=0,Hr=null,vS(a)):(Ct=0,Hr=null,kl(i,a,x,7));break;case 5:var C=null;switch(lt.tag){case 26:C=lt.memoizedState;case 5:case 27:var L=lt;if(C?nE(C):L.stateNode.complete){Ct=0,Hr=null;var J=L.sibling;if(J!==null)lt=J;else{var ce=L.return;ce!==null?(lt=ce,hf(ce)):lt=null}break t}}Ct=0,Hr=null,kl(i,a,x,5);break;case 6:Ct=0,Hr=null,kl(i,a,x,6);break;case 8:Rv(),pn=6;break e;default:throw Error(r(462))}}SD();break}catch(me){hS(i,me)}while(!0);return vs=no=null,I.H=f,I.A=v,St=c,lt!==null?0:(qt=null,ht=0,Ch(),pn)}function SD(){for(;lt!==null&&!ur();)gS(lt)}function gS(i){var a=U1(i.alternate,i,Ts);i.memoizedProps=i.pendingProps,a===null?hf(i):lt=a}function vS(i){var a=i,c=a.alternate;switch(a.tag){case 15:case 0:a=I1(c,a,a.pendingProps,a.type,void 0,ht);break;case 11:a=I1(c,a,a.pendingProps,a.type.render,a.ref,ht);break;case 5:Wg(a);default:B1(c,a),a=lt=mw(a,Ts),a=U1(c,a,Ts)}i.memoizedProps=i.pendingProps,a===null?hf(i):lt=a}function kl(i,a,c,f){vs=no=null,Wg(a),pl=null,Jc=0;var v=a.return;try{if(dD(i,v,a,c,ht)){pn=1,Zh(i,ri(c,i.current)),lt=null;return}}catch(x){if(v!==null)throw lt=v,x;pn=1,Zh(i,ri(c,i.current)),lt=null;return}a.flags&32768?(pt||f===1?i=!0:_l||(ht&536870912)!==0?i=!1:(ya=i=!0,(f===2||f===9||f===3||f===6)&&(f=zr.current,f!==null&&f.tag===13&&(f.flags|=16384))),yS(a,i)):hf(a)}function hf(i){var a=i;do{if((a.flags&32768)!==0){yS(a,ya);return}i=a.return;var c=pD(a.alternate,a,Ts);if(c!==null){lt=c;return}if(a=a.sibling,a!==null){lt=a;return}lt=a=i}while(a!==null);pn===0&&(pn=5)}function yS(i,a){do{var c=mD(i.alternate,i);if(c!==null){c.flags&=32767,lt=c;return}if(c=i.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deleti
vendor: 14,317 bytes, line 48
48ons=null),!a&&(i=i.sibling,i!==null)){lt=i;return}lt=i=c}while(i!==null);pn=6,lt=null}function bS(i,a,c,f,v,x,C,L,J){i.cancelPendingCommit=null;do ff();while(Un!==0);if((St&6)!==0)throw Error(r(327));if(a!==null){if(a===i.current)throw Error(r(177));if(x=a.lanes|a.childLanes,x|=xg,kt(i,c,x,C,L,J),i===qt&&(lt=qt=null,ht=0),Sl=a,_a=i,Ns=c,Nv=x,Av=v,lS=f,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,TD(Mn,function(){return ES(),null})):(i.callbackNode=null,i.callbackPriority=0),f=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||f){f=I.T,I.T=null,v=H.p,H.p=2,C=St,St|=4;try{gD(i,a,c)}finally{St=C,H.p=v,I.T=f}}Un=1,xS(),_S(),wS()}}function xS(){if(Un===1){Un=0;var i=_a,a=Sl,c=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||c){c=I.T,I.T=null;var f=H.p;H.p=2;var v=St;St|=4;try{eS(a,i);var x=qv,C=aw(i.containerInfo),L=x.focusedElem,J=x.selectionRange;if(C!==L&&L&&L.ownerDocument&&sw(L.ownerDocument.documentElement,L)){if(J!==null&&mg(L)){var ce=J.start,me=J.end;if(me===void 0&&(me=ce),"selectionStart"in L)L.selectionStart=ce,L.selectionEnd=Math.min(me,L.value.length);else{var be=L.ownerDocument||document,ue=be&&be.defaultView||window;if(ue.getSelection){var he=ue.getSelection(),Ie=L.textContent.length,We=Math.min(J.start,Ie),Lt=J.end===void 0?We:Math.min(J.end,Ie);!he.extend&&We>Lt&&(C=Lt,Lt=We,We=C);var ae=iw(L,We),ee=iw(L,Lt);if(ae&&ee&&(he.rangeCount!==1||he.anchorNode!==ae.node||he.anchorOffset!==ae.offset||he.focusNode!==ee.node||he.focusOffset!==ee.offset)){var le=be.createRange();le.setStart(ae.node,ae.offset),he.removeAllRanges(),We>Lt?(he.addRange(le),he.extend(ee.node,ee.offset)):(le.setEnd(ee.node,ee.offset),he.addRange(le))}}}}for(be=[],he=L;he=he.parentNode;)he.nodeType===1&&be.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<be.length;L++){var ve=be[L];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}kf=!!Hv,qv=Hv=null}finally{St=v,H.p=f,I.T=c}}i.current=a,Un=2}}function _S(){if(Un===2){Un=0;var i=_a,a=Sl,c=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||c){c=I.T,I.T=null;var f=H.p;H.p=2;var v=St;St|=4;try{K1(i,a.alternate,a)}finally{St=v,H.p=f,I.T=c}}Un=3}}function wS(){if(Un===4||Un===3){Un=0,jn();var i=_a,a=Sl,c=Ns,f=lS;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?Un=5:(Un=0,Sl=_a=null,SS(i,i.pendingLanes));var v=i.pendingLanes;if(v===0&&(xa=null),oe(c),a=a.stateNode,Pn&&typeof Pn.onCommitFiberRoot=="function")try{Pn.onCommitFiberRoot(fr,a,void 0,(a.current.flags&128)===128)}catch{}if(f!==null){a=I.T,v=H.p,H.p=2,I.T=null;try{for(var x=i.onRecoverableError,C=0;C<f.length;C++){var L=f[C];x(L.value,{componentStack:L.stack})}}finally{I.T=a,H.p=v}}(Ns&3)!==0&&ff(),Wi(i),v=i.pendingLanes,(c&261930)!==0&&(v&42)!==0?i===Cv?fu++:(fu=0,Cv=i):fu=0,pu(0)}}function SS(i,a){(i.pooledCacheLanes&=a)===0&&(a=i.pooledCache,a!=null&&(i.pooledCache=null,Yc(a)))}function ff(){return xS(),_S(),wS(),ES()}function ES(){if(Un!==5)return!1;var i=_a,a=Nv;Nv=0;var c=oe(Ns),f=I.T,v=H.p;try{H.p=32>c?32:c,I.T=null,c=Av,Av=null;var x=_a,C=Ns;if(Un=0,Sl=_a=null,Ns=0,(St&6)!==0)throw Error(r(331));var L=St;if(St|=4,sS(x.current),nS(x,x.current,C,c),St=L,pu(0,!1),Pn&&typeof Pn.onPostCommitFiberRoot=="function")try{Pn.onPostCommitFiberRoot(fr,x)}catch{}return!0}finally{H.p=v,I.T=f,SS(i,a)}}function kS(i,a,c){a=ri(c,a),a=lv(i.stateNode,a,2),i=pa(i,a,2),i!==null&&(dt(i,2),Wi(i))}function Rt(i,a,c){if(i.tag===3)kS(i,i,c);else for(;a!==null;){if(a.tag===3){kS(a,i,c);break}else if(a.tag===1){var f=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(xa===null||!xa.has(f))){i=ri(c,i),c=j1(2),f=pa(a,c,2),f!==null&&(T1(c,f,a,i),dt(f,2),Wi(f));break}}a=a.return}}function Dv(i,a,c){var f=i.pingCache;if(f===null){f=i.pingCache=new bD;var v=new Set;f.set(a,v)}else v=f.get(a),v===void 0&&(v=new Set,f.set(a,v));v.has(c)||(kv=!0,v.add(c),i=ED.bind(null,i,a,c),a.then(i,i))}function ED(i,a,c){var f=i.pingCache;f!==null&&f.delete(a),i.pingedLanes|=i.suspendedLanes&c,i.warmLanes&=~c,qt===i&&(ht&c)===c&&(pn===4||pn===3&&(ht&62914560)===ht&&300>Zt()-of?(St&2)===0&&El(i,0):jv|=c,wl===ht&&(wl=0)),Wi(i)}function jS(i,a){a===0&&(a=bn()),i=Qa(i,a),i!==null&&(dt(i,a),Wi(i))}function kD(i){var a=i.memoizedState,c=0;a!==null&&(c=a.retryLane),jS(i,c)}function jD(i,a){var c=0;switch(i.tag){case 31:case 13:var f=i.stateNode,v=i.memoizedState;v!==null&&(c=v.retryLane);break;case 19:f=i.stateNode;break;case 22:f=i.stateNode._retryCache;break;default:throw Error(r(314))}f!==null&&f.delete(a),jS(i,c)}function TD(i,a){return wt(i,a)}var pf=null,jl=null,Iv=!1,mf=!1,Mv=!1,Sa=0;function Wi(i){i!==jl&&i.next===null&&(jl===null?pf=jl=i:jl=jl.next=i),mf=!0,Iv||(Iv=!0,AD())}function pu(i,a){if(!Mv&&mf){Mv=!0;do for(var c=!1,f=pf;f!==null;){if(i!==0){var v=f.pendingLanes;if(v===0)var x=0;else{var C=f.suspendedLanes,L=f.pingedLanes;x=(1<<31-yn(42|i)+1)-1,x&=v&~(C&~L),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(c=!0,CS(f,x))}else x=ht,x=He(f,f===qt?x:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(x&3)===0||Bt(f,x)||(c=!0,CS(f,x));f=f.next}while(c);Mv=!1}}function ND(){TS()}function TS(){mf=Iv=!1;var i=0;Sa!==0&&$D()&&(i=Sa);for(var a=Zt(),c=null,f=pf;f!==null;){var v=f.next,x=NS(f,a);x===0?(f.next=null,c===null?pf=v:c.next=v,v===null&&(jl=c)):(c=f,(i!==0||(x&3)!==0)&&(mf=!0)),f=v}Un!==0&&Un!==5||pu(i),Sa!==0&&(Sa=0)}function NS(i,a){for(var c=i.suspendedLanes,f=i.pingedLanes,v=i.expirationTimes,x=i.pendingLanes&-62914561;0<x;){var C=31-yn(x),L=1<<C,J=v[C];J===-1?((L&c)===0||(L&f)!==0)&&(v[C]=Fn(L,a)):J<=a&&(i.expiredLanes|=L),x&=~L}if(a=qt,c=ht,c=He(i,i===a?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),f=i.callbackNode,c===0||i===a&&(Ct===2||Ct===9)||i.cancelPendingCommit!==null)return f!==null&&f!==null&&Xt(f),i.callbackNode=null,i.callbackPriority=0;if((c&3)===0||Bt(i,c)){if(a=c&-c,a===i.callbackPriority)return a;switch(f!==null&&Xt(f),oe(c)){case 2:case 8:c=rr;break;case 32:c=Mn;break;case 268435456:c=zt;break;default:c=Mn}return f=AS.bind(null,i),c=wt(c,f),i.callbackPriority=a,i.callbackNode=c,a}return f!==null&&f!==null&&Xt(f),i.callbackPriority=2,i.callbackNode=null,2}function AS(i,a){if(Un!==0&&Un!==5)return i.callbackNode=null,i.callbackPriority=0,null;var c=i.callbackNode;if(ff()&&i.callbackNode!==c)return null;var f=ht;return f=He(i,i===qt?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),f===0?null:(uS(i,f,a),NS(i,Zt()),i.callbackNode!=null&&i.callbackNode===c?AS.bind(null,i):null)}function CS(i,a){if(ff())return null;uS(i,a,!0)}function AD(){zD(function(){(St&6)!==0?wt(dr,ND):TS()})}function Lv(){if(Sa===0){var i=dl;i===0&&(i=Ei,Ei<<=1,(Ei&261888)===0&&(Ei=256)),Sa=i}return Sa}function RS(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:wh(""+i)}function OS(i,a){var c=a.ownerDocument.createElement("input");return c.name=a.name,c.value=a.value,i.id&&c.setAttribute("form",i.id),a.parentNode.insertBefore(c,a),i=new FormData(i),c.parentNode.removeChild(c),i}function CD(i,a,c,f,v){if(a==="submit"&&c&&c.stateNode===v){var x=RS((v[De]||null).action),C=f.submitter;C&&(a=(a=C[De]||null)?RS(a.formAction):C.getAttribute("formAction"),a!==null&&(x=a,C=null));var L=new jh("action","action",null,f,v);i.push({event:L,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(Sa!==0){var J=C?OS(v,C):new FormData(v);nv(c,{pending:!0,data:J,method:v.method,action:x},null,J)}}else typeof x=="function"&&(L.preventDefault(),J=C?OS(v,C):new FormData(v),nv(c,{pending:!0,data:J,method:v.method,action:x},x,J))},currentTarget:v}]})}}for(var Pv=0;Pv<bg.length;Pv++){var Fv=bg[Pv],RD=Fv.toLowerCase(),OD=Fv[0].toUpperCase()+Fv.slice(1);Ni(RD,"on"+OD)}Ni(cw,"onAnimationEnd"),Ni(uw,"onAnimationIteration"),Ni(dw,"onAnimationStart"),Ni("dblclick","onDoubleClick"),Ni("focusin","onFocus"),Ni("focusout","onBlur"),Ni(Y5,"onTransitionRun"),Ni(K5,"onTransitionStart"),Ni(J5,"onTransitionCancel"),Ni(hw,"onTransitionEnd"),pr("onMouseEnter",["mouseout","mouseover"]),pr("onMouseLeave",["mouseout","mouseover"]),pr("onPointerEnter",["pointerout","pointerover"]),pr("onPointerLeave",["pointerout","pointerover"]),Sr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Sr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Sr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Sr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Sr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Sr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var mu="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(" "),DD=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(mu));function DS(i,a){a=(a&4)!==0;for(var c=0;c<i.length;c++){var f=i[c],v=f.event;f=f.listeners;e:{var x=void 0;if(a)for(var C=f.length-1;0<=C;C--){var L=f[C],J=L.instance,ce=L.currentTarget;if(L=L.listener,J!==x&&v.isPropagationStopped())break e;x=L,v.currentTarget=ce;try{x(v)}catch(me){Ah(me)}v.currentTarget=null,x=J}else for(C=0;C<f.length;C++){if(L=f[C],J=L.instance,ce=L.currentTarget,L=L.listener,J!==x&&v.isPropagationStopped())break e;x=L,v.currentTarget=ce;try{x(v)}catch(me){Ah(me)}v.currentTarget=null,x=J}}}}function ct(i,a){var c=a[Pe];c===void 0&&(c=a[Pe]=new Set);var f=i+"__bubble";c.has(f)||(IS(a,i,2,!1),c.add(f))}function $v(i,a,c){var f=0;a&&(f|=4),IS(c,i,f,a)}var gf="_reactListening"+Math.random().toString(36).slice(2);function Uv(i){if(!i[gf]){i[gf]=!0,aa.forEach(function(c){c!=="selectionchange"&&(DD.has(c)||$v(c,!1,i),$v(c,!0,i))});var a=i.nodeType===9?i:i.ownerDocument;a===null||a[gf]||(a[gf]=!0,$v("selectionchange",!1,a))}}function IS(i,a,c,f){switch(cE(a)){case 2:var v=o4;break;case 8:v=l4;break;default:v=ty}c=v.bind(null,a,c,i),v=void 0,!ag||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(v=!0),f?v!==void 0?i.addEventListener(a,c,{capture:!0,passive:v}):i.addEventListener(a,c,!0):v!==void 0?i.addEventListener(a,c,{passive:v}):i.addEventListener(a,c,!1)}function zv(i,a,c,f,v){var x=f;if((a&1)===0&&(a&2)===0&&f!==null)e:for(;;){if(f===null)return;var C=f.tag;if(C===3||C===4){var L=f.stateNode.containerInfo;if(L===v)break;if(C===4)for(C=f.return;C!==null;){var J=C.tag;if((J===3||J===4)&&C.stateNode.containerInfo===v)return;C=C.return}for(;L!==null;){if(C=Qt(L),C===null)return;if(J=C.tag,J===5||J===6||J===26||J===27){f=x=C;continue e}L=L.parentNode}}f=f.return}$_(function(){var ce=x,me=ig(c),be=[];e:{var ue=fw.get(i);if(ue!==void 0){var he=jh,Ie=i;switch(i){case"keypress":if(Eh(c)===0)break e;case"keydown":case"keyup":he=j5;break;case"focusin":Ie="focus",he=ug;break;case"focusout":Ie="blur",he=ug;break;case"beforeblur":case"afterblur":he=ug;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":he=B_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=p5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=A5;break;case cw:case uw:case dw:he=v5;break;case hw:he=R5;break;case"scroll":case"scrollend":he=h5;break;case"wheel":he=D5;break;case"copy":case"cut":case"paste":he=b5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=q_;break;case"toggle":case"beforetoggle":he=M5}var We=(a&4)!==0,Lt=!We&&(i==="scroll"||i==="scrollend"),ae=We?ue!==null?ue+"Capture":null:ue;We=[];for(var ee=ce,le;ee!==null;){var ve=ee;if(le=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||le===null||ae===null||(ve=Pc(ee,ae),ve!=null&&We.push(gu(ee,ve,le))),Lt)break;ee=ee.return}0<We.length&&(ue=new he(ue,Ie,null,c,me),be.push({event:ue,listeners:We}))}}if((a&7)===0){e:{if(ue=i==="mouseover"||i==="pointerover",he=i==="mouseout"||i==="pointerout",ue&&c!==rg&&(Ie=c.relatedTarget||c.fromElement)&&(Qt(Ie)||Ie[Ne]))break e;if((he||ue)&&(ue=me.window===me?me:(ue=me.ownerDocument)?ue.defaultView||ue.parentWindow:window,he?(Ie=c.relatedTarget||c.toElement,he=ce,Ie=Ie?Qt(Ie):null,Ie!==null&&(Lt=o(Ie),We=Ie.tag,Ie!==Lt||We!==5&&We!==27&&We!==6)&&(Ie=null)):(he=null,Ie=ce),he!==Ie)){if(We=B_,ve="onMouseLeave",ae="onMouseEnter",ee="mouse",(i==="pointerout"||i==="pointerover")&&(We=q_,ve="onPointerLeave",ae="onPointerEnter",ee="pointer"),Lt=he==null?ue:gt(he),le=Ie==null?ue:gt(Ie),ue=new We(ve,ee+"leave",he,c,me),ue.target=Lt,ue.relatedTarget=le,ve=null,Qt(me)===ce&&(We=new We(ae,ee+"enter",Ie,c,me),We.target=le,We.relatedTarget=Lt,ve=We),Lt=ve,he&&Ie)t:{for(We=ID,ae=he,ee=Ie,le=0,ve=ae;ve;ve=We(ve))le++;ve=0;for(var qe=ee;qe;qe=We(qe))ve++;for(;0<le-ve;)ae=We(ae),le--;for(;0<ve-le;)ee=We(ee),ve--;for(;le--;){if(ae===ee||ee!==null&&ae===ee.alternate){We=ae;break t}ae=We(ae),ee=We(ee)}We=null}else We=null;he!==null&&MS(be,ue,he,We,!1),Ie!==null&&Lt!==null&&MS(be,Lt,Ie,We,!0)}}e:{if(ue=ce?gt(ce):window,he=ue.nodeName&&ue.nodeName.toLowerCase(),he==="select"||he==="input"&&ue.type==="file")var xt=Z_;else if(J_(ue))if(Q_)xt=G5;else{xt=H5;var Fe=B5}else he=ue.nodeName,!he||he.toLowerCase()!=="input"||ue.type!=="checkbox"&&ue.type!=="radio"?ce&&ng(ce.elementType)&&(xt=Z_):xt=q5;if(xt&&(xt=xt(i,ce))){X_(be,xt,c,me);break e}Fe&&Fe(i,ue,ce),i==="focusout"&&ce&&ue.type==="number"&&ce.memoizedProps.value!=null&&tg(ue,"number",ue.value)}switch(Fe=ce?gt(ce):window,i){case"focusin":(J_(Fe)||Fe.contentEditable==="true")&&(rl=Fe,gg=ce,Gc=null);break;case"focusout":Gc=gg=rl=null;break;case"mousedown":vg=!0;break;case"contextmenu":case"mouseup":case"dragend":vg=!1,ow(be,c,me);break;case"selectionchange":if(W5)break;case"keydown":case"keyup":ow(be,c,me)}var st;if(hg)e:{switch(i){case"compositionstart":var ft="onCompositionStart";break e;case"compositionend":ft="onCompositionEnd";break e;case"compositionupdate":ft="onCompositionUpdate";break e}ft=void 0}
vendor: 4,266 bytes, lines 48-49
48else nl?Y_(i,c)&&(ft="onCompositionEnd"):i==="keydown"&&c.keyCode===229&&(ft="onCompositionStart");ft&&(G_&&c.locale!=="ko"&&(nl||ft!=="onCompositionStart"?ft==="onCompositionEnd"&&nl&&(st=U_()):(oa=me,og="value"in oa?oa.value:oa.textContent,nl=!0)),Fe=vf(ce,ft),0<Fe.length&&(ft=new H_(ft,i,null,c,me),be.push({event:ft,listeners:Fe}),st?ft.data=st:(st=K_(c),st!==null&&(ft.data=st)))),(st=P5?F5(i,c):$5(i,c))&&(ft=vf(ce,"onBeforeInput"),0<ft.length&&(Fe=new H_("onBeforeInput","beforeinput",null,c,me),be.push({event:Fe,listeners:ft}),Fe.data=st)),CD(be,i,ce,c,me)}DS(be,a)})}function gu(i,a,c){return{instance:i,listener:a,currentTarget:c}}function vf(i,a){for(var c=a+"Capture",f=[];i!==null;){var v=i,x=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||x===null||(v=Pc(i,c),v!=null&&f.unshift(gu(i,v,x)),v=Pc(i,a),v!=null&&f.push(gu(i,v,x))),i.tag===3)return f;i=i.return}return[]}function ID(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function MS(i,a,c,f,v){for(var x=a._reactName,C=[];c!==null&&c!==f;){var L=c,J=L.alternate,ce=L.stateNode;if(L=L.tag,J!==null&&J===f)break;L!==5&&L!==26&&L!==27||ce===null||(J=ce,v?(ce=Pc(c,x),ce!=null&&C.unshift(gu(c,ce,J))):v||(ce=Pc(c,x),ce!=null&&C.push(gu(c,ce,J)))),c=c.return}C.length!==0&&i.push({event:a,listeners:C})}var MD=/\r\n?/g,LD=/\u0000|\uFFFD/g;function LS(i){return(typeof i=="string"?i:""+i).replace(MD,`
49`).replace(LD,"")}function PS(i,a){return a=LS(a),LS(i)===a}function Mt(i,a,c,f,v,x){switch(c){case"children":typeof f=="string"?a==="body"||a==="textarea"&&f===""||Qo(i,f):(typeof f=="number"||typeof f=="bigint")&&a!=="body"&&Qo(i,""+f);break;case"className":ds(i,"class",f);break;case"tabIndex":ds(i,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":ds(i,c,f);break;case"style":P_(i,f,x);break;case"data":if(a!=="object"){ds(i,"data",f);break}case"src":case"href":if(f===""&&(a!=="a"||c!=="href")){i.removeAttribute(c);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){i.removeAttribute(c);break}f=wh(""+f),i.setAttribute(c,f);break;case"action":case"formAction":if(typeof f=="function"){i.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof x=="function"&&(c==="formAction"?(a!=="input"&&Mt(i,a,"name",v.name,v,null),Mt(i,a,"formEncType",v.formEncType,v,null),Mt(i,a,"formMethod",v.formMethod,v,null),Mt(i,a,"formTarget",v.formTarget,v,null)):(Mt(i,a,"encType",v.encType,v,null),Mt(i,a,"method",v.method,v,null),Mt(i,a,"target",v.target,v,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){i.removeAttribute(c);break}f=wh(""+f),i.setAttribute(c,f);break;case"onClick":f!=null&&(i.onclick=fs);break;case"onScroll":f!=null&&ct("scroll",i);break;case"onScrollEnd":f!=null&&ct("scrollend",i);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(c=f.__html,c!=null){if(v.children!=null)throw Error(r(60));i.innerHTML=c}}break;case"multiple":i.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":i.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){i.removeAttribute("xlink:href");break}c=wh(""+f),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(c,""+f):i.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInl
49ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":f&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(c,""):i.removeAttribute(c);break;case"capture":case"download":f===!0?i.setAttribute(c,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(c,f):i.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?i.setAttribute(c,f):i.removeAttribute(c);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?i.removeAttribute(c):i.setAttribute(c,f);break;case"popover":ct("beforetoggle",i),ct("toggle",i),us(i,"popover",f);break;case"xlinkActuate":Qe(i,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":Qe(i,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":Qe(i,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":Qe(i,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":Qe(i,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":Qe(i,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":Qe(i,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":Qe(i,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":Qe(i,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":us(i,"is",f);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=u5.get(c)||c,us(i,c,f))}}function Bv(i,a,c,f,v,x){switch(c){case"style":P_(i,f,x);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(c=f.__html,c!=null){if(v.children!=null)throw Error(r(60));i.innerHTML=c}}break;case"children":typeof f=="string"?Qo(i,f):(typeof f=="number"||typeof f=="bigint")&&Qo(i,""+f);break;case"onScroll":f!=null&&ct("scroll",i);break;case"onScrollEnd":f!=null&&ct("scrollend",i);break;case"onClick":f!=null&&(i.onclick=fs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ki.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(v=c.endsWith("Capture"),a=c.slice(2,v?c.length-7:void 0),x=i[De]||null,x=x!=null?x[c]:null,typeof x=="function"&&i.removeEventListener(a,x,v),typeof f=="function")){typeof x!="function"&&x!==null&&(c in i?i[c]=null:i.hasAttribute(c)&&i.removeAttribute(c)),i.addEventListener(a,f,v);break e}c in i?i[c]=f:f===!0?i.setAttribute(c,""):us(i,c,f)}}}function Jn(i,a,c){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ct("error",i),ct("load",i);var f=!1,v=!1,x;for(x in c)if(c.hasOwnProperty(x)){var C=c[x];if(C!=null)switch(x){case"src":f=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Mt(i,a,x,C,c,null)}}v&&Mt(i,a,"srcSet",c.srcSet,c,null),f&&Mt(i,a,"src",c.src,c,null);return;case"input":ct("invalid",i);var L=x=C=v=null,J=null,ce=null;for(f in c)if(c.hasOwnProperty(f)){var me=c[f];if(me!=null)switch(f){case"name":v=me;break;case"type":C=me;break;case"checked":J=me;break;case"defaultChecked":ce=me;break;case"value":x=me;break;case"defaultValue":L=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,a));break;default:Mt(i,a,f,me,c,null)}}D_(i,x,L,J,ce,C,v,!1);return;case"select":ct("invalid",i),f=C=x=null;for(v in c)if(c.hasOwnProperty(v)&&(L=c[v],L!=null))switch(v){case"value":x=L;break;case"defaultValue":C=L;break;case"multiple":f=L;default:Mt(i,a,v,L,c,null)}a=x,c=C,i.multiple=!!f,a!=null?Zo(i,!!f,a,!1):c!=null&&Zo(i,!!f,c,!0);return;case"textarea":ct("invalid",i),x=v=f=null;for(C in c)if(c.hasOwnProperty(C)&&(L=c[C],L!=null))switch(C){case"value":f=L;break;case"defaultValue":v=L;break;case"children":x=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(91));break;default:Mt(i,a,C,L,c,null)}M_(i,f,v,x);return;case"option":for(J in c)if(c.hasOwnProperty(J)&&(f=c[J],f!=null))switch(J){case"selected":i.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:Mt(i,a,J,f,c,null)}return;case"dialog":ct("beforetoggle",i),ct("toggle",i),ct("cancel",i),ct("close",i);break;case"iframe":case"object":ct("load",i);break;case"video":case"audio":for(f=0;f<mu.length;f++)ct(mu[f],i);break;case"image":ct("error",i),ct("load",i);break;case"details":ct("toggle",i);break;case"embed":case"source":case"link":ct("error",i),ct("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ce in c)if(c.hasOwnProperty(ce)&&(f=c[ce],f!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Mt(i,a,ce,f,c,null)}return;default:if(ng(a)){for(me in c)c.hasOwnProperty(me)&&(f=c[me],f!==void 0&&Bv(i,a,me,f,c,void 0));return}}for(L in c)c.hasOwnProperty(L)&&(f=c[L],f!=null&&Mt(i,a,L,f,c,null))}function PD(i,a,c,f){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var v=null,x=null,C=null,L=null,J=null,ce=null,me=null;for(he in c){var be=c[he];if(c.hasOwnProperty(he)&&be!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":J=be;default:f.hasOwnProperty(he)||Mt(i,a,he,null,f,be)}}for(var ue in f){var he=f[ue];if(be=c[ue],f.hasOwnProperty(ue)&&(he!=null||be!=null))switch(ue){case"type":x=he;break;case"name":v=he;break;case"checked":ce=he;break;case"defaultChecked":me=he;break;case"value":C=he;break;case"defaultValue":L=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,a));break;default:he!==be&&Mt(i,a,ue,he,f,be)}}Lc(i,C,L,J,ce,me,x,v);return;case"select":he=C=L=ue=null;for(x in c)if(J=c[x],c.hasOwnProperty(x)&&J!=null)switch(x){case"value":break;case"multiple":he=J;default:f.hasOwnProperty(x)||Mt(i,a,x,null,f,J)}for(v in f)if(x=f[v],J=c[v],f.hasOwnProperty(v)&&(x!=null||J!=null))switch(v){case"value":ue=x;break;case"defaultValue":L=x;break;case"multiple":C=x;default:x!==J&&Mt(i,a,v,x,f,J)}a=L,c=C,f=he,ue!=null?Zo(i,!!c,ue,!1):!!f!=!!c&&(a!=null?Zo(i,!!c,a,!0):Zo(i,!!c,c?[]:"",!1));return;case"textarea":he=ue=null;for(L in c)if(v=c[L],c.hasOwnProperty(L)&&v!=null&&!f.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:Mt(i,a,L,null,f,v)}for(C in f)if(v=f[C],x=c[C],f.hasOwnProperty(C)&&(v!=null||x!=null))switch(C){case"value":ue=v;break;case"defaultValue":he=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(r(91));break;default:v!==x&&Mt(i,a,C,v,f,x)}I_(i,ue,he);return;case"option":for(var Ie in c)if(ue=c[Ie],c.hasOwnProperty(Ie)&&ue!=null&&!f.hasOwnProperty(Ie))switch(Ie){case"selected":i.selected=!1;break;default:Mt(i,a,Ie,null,f,ue)}for(J in f)if(ue=f[J],he=c[J],f.hasOwnProperty(J)&&ue!==he&&(ue!=null||he!=null))switch(J){case"selected":i.selected=ue&&typeof ue!="function"&&typeof ue!="symbol";break;default:Mt(i,a,J,ue,f,he)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var We in c)ue=c[We],c.hasOwnProperty(We)&&ue!=null&&!f.hasOwnProperty(We)&&Mt(i,a,We,null,f,ue);for(ce in f)if(ue=f[ce],he=c[ce],f.hasOwnProperty(ce)&&ue!==he&&(ue!=null||he!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,a));break;default:Mt(i,a,ce,ue,f,he)}return;default:if(ng(a)){for(var Lt in c)ue=c[Lt],c.hasOwnProperty(Lt)&&ue!==void 0&&!f.hasOwnProperty(Lt)&&Bv(i,a,Lt,void 0,f,ue);for(me in f)ue=f[me],he=c[me],!f.hasOwnProperty(me)||ue===he||ue===void 0&&he===void 0||Bv(i,a,me,ue,f,he);return}}for(var ae in c)ue=c[ae],c.hasOwnProperty(ae)&&ue!=null&&!f.hasOwnProperty(ae)&&Mt(i,a,ae,null,f,ue);for(be in f)ue=f[be],he=c[be],!f.hasOwnProperty(be)||ue===he||ue==null&&he==null||Mt(i,a,be,ue,f,he)}function FS(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function FD(){if(typeof performance.getEntriesByType=="function"){for(var i=0,a=0,c=performance.getEntriesByType("resource"),f=0;f<c.length;f++){var v=c[f],x=v.transferSize,C=v.initiatorType,L=v.duration;if(x&&L&&FS(C)){for(C=0,L=v.responseEnd,f+=1;f<c.length;f++){var J=c[f],ce=J.startTime;if(ce>L)break;var me=J.transferSize,be=J.initiatorType;me&&FS(be)&&(J=J.responseEnd,C+=me*(J<L?1:(L-ce)/(J-ce)))}if(--f,a+=8*(x+C)/(v.duration/1e3),i++,10<i)break}}if(0<i)return a/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Hv=null,qv=null;function yf(i){return i.nodeType===9?i:i.ownerDocument}function $S(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function US(i,a){if(i===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&a==="foreignObject"?0:i}function Gv(i,a){return i==="textarea"||i==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var Vv=null;function $D(){var i=window.event;return i&&i.type==="popstate"?i===Vv?!1:(Vv=i,!0):(Vv=null,!1)}var zS=typeof setTimeout=="function"?setTimeout:void 0,UD=typeof clearTimeout=="function"?clearTimeout:void 0,BS=typeof Promise=="function"?Promise:void 0,zD=typeof queueMicrotask=="function"?queueMicrotask:typeof BS<"u"?function(i){return BS.resolve(null).then(i).catch(BD)}:zS;function BD(i){setTimeout(function(){throw i})}function Ea(i){return i==="head"}function HS(i,a){var c=a,f=0;do{var v=c.nextSibling;if(i.removeChild(c),v&&v.nodeType===8)if(c=v.data,c==="/$"||c==="/&"){if(f===0){i.removeChild(v),Cl(a);return}f--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")f++;else if(c==="html")vu(i.ownerDocument.documentElement);else if(c==="head"){c=i.ownerDocument.head,vu(c);for(var x=c.firstChild;x;
vendor: 14,983 bytes, line 49
49){var C=x.nextSibling,L=x.nodeName;x[at]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&x.rel.toLowerCase()==="stylesheet"||c.removeChild(x),x=C}}else c==="body"&&vu(i.ownerDocument.body);c=v}while(c);Cl(a)}function qS(i,a){var c=i;i=0;do{var f=c.nextSibling;if(c.nodeType===1?a?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(a?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),f&&f.nodeType===8)if(c=f.data,c==="/$"){if(i===0)break;i--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||i++;c=f}while(c)}function Wv(i){var a=i.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var c=a;switch(a=a.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Wv(c),bt(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}i.removeChild(c)}}function HD(i,a,c,f){for(;i.nodeType===1;){var v=c;if(i.nodeName.toLowerCase()!==a.toLowerCase()){if(!f&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(f){if(!i[at])switch(a){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(x=i.getAttribute("rel"),x==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(x!==v.rel||i.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||i.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||i.getAttribute("title")!==(v.title==null?null:v.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(x=i.getAttribute("src"),(x!==(v.src==null?null:v.src)||i.getAttribute("type")!==(v.type==null?null:v.type)||i.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&x&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(a==="input"&&i.type==="hidden"){var x=v.name==null?null:""+v.name;if(v.type==="hidden"&&i.getAttribute("name")===x)return i}else return i;if(i=li(i.nextSibling),i===null)break}return null}function qD(i,a,c){if(a==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!c||(i=li(i.nextSibling),i===null))return null;return i}function GS(i,a){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!a||(i=li(i.nextSibling),i===null))return null;return i}function Yv(i){return i.data==="$?"||i.data==="$~"}function Kv(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function GD(i,a){var c=i.ownerDocument;if(i.data==="$~")i._reactRetry=a;else if(i.data!=="$?"||c.readyState!=="loading")a();else{var f=function(){a(),c.removeEventListener("DOMContentLoaded",f)};c.addEventListener("DOMContentLoaded",f),i._reactRetry=f}}function li(i){for(;i!=null;i=i.nextSibling){var a=i.nodeType;if(a===1||a===3)break;if(a===8){if(a=i.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return i}var Jv=null;function VS(i){i=i.nextSibling;for(var a=0;i;){if(i.nodeType===8){var c=i.data;if(c==="/$"||c==="/&"){if(a===0)return li(i.nextSibling);a--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||a++}i=i.nextSibling}return null}function WS(i){i=i.previousSibling;for(var a=0;i;){if(i.nodeType===8){var c=i.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(a===0)return i;a--}else c!=="/$"&&c!=="/&"||a++}i=i.previousSibling}return null}function YS(i,a,c){switch(a=yf(c),i){case"html":if(i=a.documentElement,!i)throw Error(r(452));return i;case"head":if(i=a.head,!i)throw Error(r(453));return i;case"body":if(i=a.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function vu(i){for(var a=i.attributes;a.length;)i.removeAttributeNode(a[0]);bt(i)}var ci=new Map,KS=new Set;function bf(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var As=H.d;H.d={f:VD,r:WD,D:YD,C:KD,L:JD,m:XD,X:QD,S:ZD,M:e4};function VD(){var i=As.f(),a=uf();return i||a}function WD(i){var a=jt(i);a!==null&&a.tag===5&&a.type==="form"?h1(a):As.r(i)}var Tl=typeof document>"u"?null:document;function JS(i,a,c){var f=Tl;if(f&&typeof a=="string"&&a){var v=mr(a);v='link[rel="'+i+'"][href="'+v+'"]',typeof c=="string"&&(v+='[crossorigin="'+c+'"]'),KS.has(v)||(KS.add(v),i={rel:i,crossOrigin:c,href:a},f.querySelector(v)===null&&(a=f.createElement("link"),Jn(a,"link",i),vt(a),f.head.appendChild(a)))}}function YD(i){As.D(i),JS("dns-prefetch",i,null)}function KD(i,a){As.C(i,a),JS("preconnect",i,a)}function JD(i,a,c){As.L(i,a,c);var f=Tl;if(f&&i&&a){var v='link[rel="preload"][as="'+mr(a)+'"]';a==="image"&&c&&c.imageSrcSet?(v+='[imagesrcset="'+mr(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(v+='[imagesizes="'+mr(c.imageSizes)+'"]')):v+='[href="'+mr(i)+'"]';var x=v;switch(a){case"style":x=Nl(i);break;case"script":x=Al(i)}ci.has(x)||(i=m({rel:"preload",href:a==="image"&&c&&c.imageSrcSet?void 0:i,as:a},c),ci.set(x,i),f.querySelector(v)!==null||a==="style"&&f.querySelector(yu(x))||a==="script"&&f.querySelector(bu(x))||(a=f.createElement("link"),Jn(a,"link",i),vt(a),f.head.appendChild(a)))}}function XD(i,a){As.m(i,a);var c=Tl;if(c&&i){var f=a&&typeof a.as=="string"?a.as:"script",v='link[rel="modulepreload"][as="'+mr(f)+'"][href="'+mr(i)+'"]',x=v;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Al(i)}if(!ci.has(x)&&(i=m({rel:"modulepreload",href:i},a),ci.set(x,i),c.querySelector(v)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(bu(x)))return}f=c.createElement("link"),Jn(f,"link",i),vt(f),c.head.appendChild(f)}}}function ZD(i,a,c){As.S(i,a,c);var f=Tl;if(f&&i){var v=_n(f).hoistableStyles,x=Nl(i);a=a||"default";var C=v.get(x);if(!C){var L={loading:0,preload:null};if(C=f.querySelector(yu(x)))L.loading=5;else{i=m({rel:"stylesheet",href:i,"data-precedence":a},c),(c=ci.get(x))&&Xv(i,c);var J=C=f.createElement("link");vt(J),Jn(J,"link",i),J._p=new Promise(function(ce,me){J.onload=ce,J.onerror=me}),J.addEventListener("load",function(){L.loading|=1}),J.addEventListener("error",function(){L.loading|=2}),L.loading|=4,xf(C,a,f)}C={type:"stylesheet",instance:C,count:1,state:L},v.set(x,C)}}}function QD(i,a){As.X(i,a);var c=Tl;if(c&&i){var f=_n(c).hoistableScripts,v=Al(i),x=f.get(v);x||(x=c.querySelector(bu(v)),x||(i=m({src:i,async:!0},a),(a=ci.get(v))&&Zv(i,a),x=c.createElement("script"),vt(x),Jn(x,"link",i),c.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},f.set(v,x))}}function e4(i,a){As.M(i,a);var c=Tl;if(c&&i){var f=_n(c).hoistableScripts,v=Al(i),x=f.get(v);x||(x=c.querySelector(bu(v)),x||(i=m({src:i,async:!0,type:"module"},a),(a=ci.get(v))&&Zv(i,a),x=c.createElement("script"),vt(x),Jn(x,"link",i),c.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},f.set(v,x))}}function XS(i,a,c,f){var v=(v=X.current)?bf(v):null;if(!v)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(a=Nl(c.href),c=_n(v).hoistableStyles,f=c.get(a),f||(f={type:"style",instance:null,count:0,state:null},c.set(a,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){i=Nl(c.href);var x=_n(v).hoistableStyles,C=x.get(i);if(C||(v=v.ownerDocument||v,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(i,C),(x=v.querySelector(yu(i)))&&!x._p&&(C.instance=x,C.state.loading=5),ci.has(i)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},ci.set(i,c),x||t4(v,i,c,C.state))),a&&f===null)throw Error(r(528,""));return C}if(a&&f!==null)throw Error(r(529,""));return null;case"script":return a=c.async,c=c.src,typeof c=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=Al(c),c=_n(v).hoistableScripts,f=c.get(a),f||(f={type:"script",instance:null,count:0,state:null},c.set(a,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Nl(i){return'href="'+mr(i)+'"'}function yu(i){return'link[rel="stylesheet"]['+i+"]"}function ZS(i){return m({},i,{"data-precedence":i.precedence,precedence:null})}function t4(i,a,c,f){i.querySelector('link[rel="preload"][as="style"]['+a+"]")?f.loading=1:(a=i.createElement("link"),f.preload=a,a.addEventListener("load",function(){return f.loading|=1}),a.addEventListener("error",function(){return f.loading|=2}),Jn(a,"link",c),vt(a),i.head.appendChild(a))}function Al(i){return'[src="'+mr(i)+'"]'}function bu(i){return"script[async]"+i}function QS(i,a,c){if(a.count++,a.instance===null)switch(a.type){case"style":var f=i.querySelector('style[data-href~="'+mr(c.href)+'"]');if(f)return a.instance=f,vt(f),f;var v=m({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return f=(i.ownerDocument||i).createElement("style"),vt(f),Jn(f,"style",v),xf(f,c.precedence,i),a.instance=f;case"stylesheet":v=Nl(c.href);var x=i.querySelector(yu(v));if(x)return a.state.loading|=4,a.instance=x,vt(x),x;f=ZS(c),(v=ci.get(v))&&Xv(f,v),x=(i.ownerDocument||i).createElement("link"),vt(x);var C=x;return C._p=new Promise(function(L,J){C.onload=L,C.onerror=J}),Jn(x,"link",f),a.state.loading|=4,xf(x,c.precedence,i),a.instance=x;case"script":return x=Al(c.src),(v=i.querySelector(bu(x)))?(a.instance=v,vt(v),v):(f=c,(v=ci.get(x))&&(f=m({},c),Zv(f,v)),i=i.ownerDocument||i,v=i.createElement("script"),vt(v),Jn(v,"link",f),i.head.appendChild(v),a.instance=v);case"void":return null;default:throw Error(r(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(f=a.instance,a.state.loading|=4,xf(f,c.precedence,i));return a.instance}function xf(i,a,c){for(var f=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=f.length?f[f.length-1]:null,x=v,C=0;C<f.length;C++){var L=f[C];if(L.dataset.precedence===a)x=L;else if(x!==v)break}x?x.parentNode.insertBefore(i,x.nextSibling):(a=c.nodeType===9?c.head:c,a.insertBefore(i,a.firstChild))}function Xv(i,a){i.crossOrigin==null&&(i.crossOrigin=a.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=a.referrerPolicy),i.title==null&&(i.title=a.title)}function Zv(i,a){i.crossOrigin==null&&(i.crossOrigin=a.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=a.referrerPolicy),i.integrity==null&&(i.integrity=a.integrity)}var _f=null;function eE(i,a,c){if(_f===null){var f=new Map,v=_f=new Map;v.set(c,f)}else v=_f,f=v.get(c),f||(f=new Map,v.set(c,f));if(f.has(i))return f;for(f.set(i,null),c=c.getElementsByTagName(i),v=0;v<c.length;v++){var x=c[v];if(!(x[at]||x[Se]||i==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var C=x.getAttribute(a)||"";C=i+C;var L=f.get(C);L?L.push(x):f.set(C,[x])}}return f}function tE(i,a,c){i=i.ownerDocument||i,i.head.insertBefore(c,a==="title"?i.querySelector("head > title"):null)}function n4(i,a,c){if(c===1||a.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return i=a.disabled,typeof a.precedence=="string"&&i==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function nE(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function r4(i,a,c,f){if(c.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var v=Nl(f.href),x=a.querySelector(yu(v));if(x){a=x._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(i.count++,i=wf.bind(i),a.then(i,i)),c.state.loading|=4,c.instance=x,vt(x);return}x=a.ownerDocument||a,f=ZS(f),(v=ci.get(v))&&Xv(f,v),x=x.createElement("link"),vt(x);var C=x;C._p=new Promise(function(L,J){C.onload=L,C.onerror=J}),Jn(x,"link",f),c.instance=x}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(c,a),(a=c.state.preload)&&(c.state.loading&3)===0&&(i.count++,c=wf.bind(i),a.addEventListener("load",c),a.addEventListener("error",c))}}var Qv=0;function i4(i,a){return i.stylesheets&&i.count===0&&Ef(i,i.stylesheets),0<i.count||0<i.imgCount?function(c){var f=setTimeout(function(){if(i.stylesheets&&Ef(i,i.stylesheets),i.unsuspend){var x=i.unsuspend;i.unsuspend=null,x()}},6e4+a);0<i.imgBytes&&Qv===0&&(Qv=62500*FD());var v=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Ef(i,i.stylesheets),i.unsuspend)){var x=i.unsuspend;i.unsuspend=null,x()}},(i.imgBytes>Qv?50:800)+a);return i.unsuspend=c,function(){i.unsuspend=null,clearTimeout(f),clearTimeout(v)}}:null}function wf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ef(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Sf=null;function Ef(i,a){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Sf=new Map,a.forEach(s4,i),Sf=null,wf.call(i))}function s4(i,a){if(!(a.state.loading&4)){var c=Sf.get(i);if(c)var f=c.get(null);else{c=new Map,Sf.set(i,c);for(var v=i.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<v.length;x++){var C=v[x];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(c.set(C.dataset.precedence,C),f=C)}f&&c.set(null,f)}v=a.instance,C=v.getAttribute("data-precedence"),x=c.get(C)||f,x===f&&c.set(null,v),c.set(C,v),this.count++,f=wf.bind(this),v.addEventListener("load",f),v.addEventListener("error",f),x?x.parentNode.insertBefore(v,x.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(v,i.firstChild)),a.state.loading|=4}}var xu={$$typeof:j,Provider:null,Consumer:null,_currentValue:G,_currentValue2:G,_threadCount:0};function a4(i,a,c,f,v,x,C,L,J){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=dn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=dn(0),this.hiddenUpdates=dn(null),this.identifierPrefix=f,this.onUncaughtError=v,this.onCaughtError=x,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.incompleteTransitions=new Map}function rE(i,a,c,f,v,x,C,L,J,ce,me,be){return i=new a4(i,a,c,C,J,ce,me,be,L),a=1,x===!0&&(a|=24),x=Ur(3,null,null,a),i.current=x,x.stateNode=i,a=Og(),a.refCount++,i.pooledCache=a,a.refCount++,x.memoizedState={element:f,isDehydrated:c,cache:a}
vendor: 5,682 bytes, line 49
49,Lg(x),i}function iE(i){return i?(i=al,i):al}function sE(i,a,c,f,v,x){v=iE(v),f.context===null?f.context=v:f.pendingContext=v,f=fa(a),f.payload={element:c},x=x===void 0?null:x,x!==null&&(f.callback=x),c=pa(i,f,a),c!==null&&(Ar(c,i,a),Zc(c,i,a))}function aE(i,a){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var c=i.retryLane;i.retryLane=c!==0&&c<a?c:a}}function ey(i,a){aE(i,a),(i=i.alternate)&&aE(i,a)}function oE(i){if(i.tag===13||i.tag===31){var a=Qa(i,67108864);a!==null&&Ar(a,i,67108864),ey(i,67108864)}}function lE(i){if(i.tag===13||i.tag===31){var a=Gr();a=Z(a);var c=Qa(i,a);c!==null&&Ar(c,i,a),ey(i,a)}}var kf=!0;function o4(i,a,c,f){var v=I.T;I.T=null;var x=H.p;try{H.p=2,ty(i,a,c,f)}finally{H.p=x,I.T=v}}function l4(i,a,c,f){var v=I.T;I.T=null;var x=H.p;try{H.p=8,ty(i,a,c,f)}finally{H.p=x,I.T=v}}function ty(i,a,c,f){if(kf){var v=ny(f);if(v===null)zv(i,a,f,jf,c),uE(i,f);else if(u4(v,i,a,c,f))f.stopPropagation();else if(uE(i,f),a&4&&-1<c4.indexOf(i)){for(;v!==null;){var x=jt(v);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var C=Ue(x.pendingLanes);if(C!==0){var L=x;for(L.pendingLanes|=2,L.entangledLanes|=2;C;){var J=1<<31-yn(C);L.entanglements[1]|=J,C&=~J}Wi(x),(St&6)===0&&(lf=Zt()+500,pu(0))}}break;case 31:case 13:L=Qa(x,2),L!==null&&Ar(L,x,2),uf(),ey(x,2)}if(x=ny(f),x===null&&zv(i,a,f,jf,c),x===v)break;v=x}v!==null&&f.stopPropagation()}else zv(i,a,f,null,c)}}function ny(i){return i=ig(i),ry(i)}var jf=null;function ry(i){if(jf=null,i=Qt(i),i!==null){var a=o(i);if(a===null)i=null;else{var c=a.tag;if(c===13){if(i=l(a),i!==null)return i;i=null}else if(c===31){if(i=d(a),i!==null)return i;i=null}else if(c===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;i=null}else a!==i&&(i=null)}}return jf=i,null}function cE(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(nr()){case dr:return 2;case rr:return 8;case Mn:case on:return 32;case zt:return 268435456;default:return 32}default:return 32}}var iy=!1,ka=null,ja=null,Ta=null,_u=new Map,wu=new Map,Na=[],c4="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function uE(i,a){switch(i){case"focusin":case"focusout":ka=null;break;case"dragenter":case"dragleave":ja=null;break;case"mouseover":case"mouseout":Ta=null;break;case"pointerover":case"pointerout":_u.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":wu.delete(a.pointerId)}}function Su(i,a,c,f,v,x){return i===null||i.nativeEvent!==x?(i={blockedOn:a,domEventName:c,eventSystemFlags:f,nativeEvent:x,targetContainers:[v]},a!==null&&(a=jt(a),a!==null&&oE(a)),i):(i.eventSystemFlags|=f,a=i.targetContainers,v!==null&&a.indexOf(v)===-1&&a.push(v),i)}function u4(i,a,c,f,v){switch(a){case"focusin":return ka=Su(ka,i,a,c,f,v),!0;case"dragenter":return ja=Su(ja,i,a,c,f,v),!0;case"mouseover":return Ta=Su(Ta,i,a,c,f,v),!0;case"pointerover":var x=v.pointerId;return _u.set(x,Su(_u.get(x)||null,i,a,c,f,v)),!0;case"gotpointercapture":return x=v.pointerId,wu.set(x,Su(wu.get(x)||null,i,a,c,f,v)),!0}return!1}function dE(i){var a=Qt(i.target);if(a!==null){var c=o(a);if(c!==null){if(a=c.tag,a===13){if(a=l(c),a!==null){i.blockedOn=a,ye(i.priority,function(){lE(c)});return}}else if(a===31){if(a=d(c),a!==null){i.blockedOn=a,ye(i.priority,function(){lE(c)});return}}else if(a===3&&c.stateNode.current.memoizedState.isDehydrated){i.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Tf(i){if(i.blockedOn!==null)return!1;for(var a=i.targetContainers;0<a.length;){var c=ny(i.nativeEvent);if(c===null){c=i.nativeEvent;var f=new c.constructor(c.type,c);rg=f,c.target.dispatchEvent(f),rg=null}else return a=jt(c),a!==null&&oE(a),i.blockedOn=c,!1;a.shift()}return!0}function hE(i,a,c){Tf(i)&&c.delete(a)}function d4(){iy=!1,ka!==null&&Tf(ka)&&(ka=null),ja!==null&&Tf(ja)&&(ja=null),Ta!==null&&Tf(Ta)&&(Ta=null),_u.forEach(hE),wu.forEach(hE)}function Nf(i,a){i.blockedOn===a&&(i.blockedOn=null,iy||(iy=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,d4)))}var Af=null;function fE(i){Af!==i&&(Af=i,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Af===i&&(Af=null);for(var a=0;a<i.length;a+=3){var c=i[a],f=i[a+1],v=i[a+2];if(typeof f!="function"){if(ry(f||c)===null)continue;break}var x=jt(c);x!==null&&(i.splice(a,3),a-=3,nv(x,{pending:!0,data:v,method:c.method,action:f},f,v))}}))}
49function Cl(i){function a(J){return Nf(J,i)}ka!==null&&Nf(ka,i),ja!==null&&Nf(ja,i),Ta!==null&&Nf(Ta,i),_u.forEach(a),wu.forEach(a);for(var c=0;c<Na.length;c++){var f=Na[c];f.blockedOn===i&&(f.blockedOn=null)}for(;0<Na.length&&(c=Na[0],c.blockedOn===null);)dE(c),c.blockedOn===null&&Na.shift();if(c=(i.ownerDocument||i).$$reactFormReplay,c!=null)for(f=0;f<c.length;f+=3){var v=c[f],x=c[f+1],C=v[De]||null;if(typeof x=="function")C||fE(c);else if(C){var L=null;if(x&&x.hasAttribute("formAction")){if(v=x,C=x[De]||null)L=C.formAction;else if(ry(v)!==null)continue}else L=C.action;typeof L=="function"?c[f+1]=L:(c.splice(f,3),f-=3),fE(c)}}}function pE(){function i(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(C){return v=C})},focusReset:"manual",scroll:"manual"})}function a(){v!==null&&(v(),v=null),f||setTimeout(c,20)}function c(){if(!f&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var f=!1,v=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(c,100),function(){f=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),v!==null&&(v(),v=null)}}}function sy(i){this._internalRoot=i}Cf.prototype.render=sy.prototype.render=function(i){var a=this._internalRoot;if(a===null)throw Error(r(409));var c=a.current,f=Gr();sE(c,f,i,a,null,null)},Cf.prototype.unmount=sy.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var a=i.containerInfo;sE(i.current,2,null,i,null,null),uf(),a[Ne]=null}};function Cf(i){this._internalRoot=i}Cf.prototype.unstable_scheduleHydration=function(i){if(i){var a=ge();i={blockedOn:null,target:i,priority:a};for(var c=0;c<Na.length&&a!==0&&a<Na[c].priority;c++);Na.splice(c,0,i),c===0&&dE(i)}};var mE=e.version;if(mE!=="19.2.6")throw Error(r(527,mE,"19.2.6"));H.findDOMNode=function(i){var a=i._reactInternals;if(a===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=p(a),i=i!==null?g(i):null,i=i===null?null:i.stateNode,i};var h4={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Rf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rf.isDisabled&&Rf.supportsFiber)try{fr=Rf.inject(h4),Pn=Rf}catch{}}return ku.createRoot=function(i,a){if(!s(i))throw Error(r(299));var c=!1,f="",v=w1,x=S1,C=E1;return a!=null&&(a.unstable_strictMode===!0&&(c=!0),a.identifierPrefix!==void 0&&(f=a.identifierPrefix),a.onUncaughtError!==void 0&&(v=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(C=a.onRecoverableError)),a=rE(i,1,!1,null,null,c,f,null,v,x,C,pE),i[Ne]=a.current,Uv(i),new sy(a)},ku.hydrateRoot=function(i,a,c){if(!s(i))throw Error(r(299));var f=!1,v="",x=w1,C=S1,L=E1,J=null;return c!=null&&(c.unstable_strictMode===!0&&(f=!0),c.identifierPrefix!==void 0&&(v=c.identifierPrefix),c.onUncaughtError!==void 0&&(x=c.onUncaughtError),c.onCaughtError!==void 0&&(C=c.onCaughtError),c.onRecoverableError!==void 0&&(L=c.onRecoverableError),c.formState!==void 0&&(J=c.formState)),a=rE(i,1,!0,a,c??null,f,v,J,x,C,L,pE),a.context=iE(null),c=a.current,f=Gr(),f=Z(f),v=fa(f),v.callback=null,pa(c,v,f),c=f,a.current.lanes=c,dt(a,c),Wi(a),i[Ne]=a.current,Uv(i),new Cf(a)},ku.version="19.2.6",ku}var kE;function E4(){if(kE)return ly.exports;kE=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),ly.exports=S4(),ly.exports}var k4=E4();/**
50 * react-router v7.15.1
51 *
52 * Copyright (c) Remix Software Inc.
53 *
54 * This source code is licensed under the MIT license found in the
55 * LICENSE.md file in the root directory of this source tree.
56 *
57 * @license MIT
58 */var U2=t=>{throw TypeError(t)},z2=(t,e,n)=>e.has(t)||U2("Cannot "+n),fi=(t,e,n)=>(z2(t,e,"read from private field"),n?n.call(t):e.get(t)),qu=(t,e,n)=>e.has(t)?U2("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Yi=(t,e,n,r)=>(z2(t,e,"write to private field"),e.set(t,n),n),jE="popstate";function TE(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function j4(t={}){function e(r,s){var p;let o=(p=s.state)==null?void 0:p.masked,{pathname:l,search:d,hash:h}=o||r.location;return gd("",{pathname:l,search:d,hash:h},s.state&&s.state.usr||null,s.state&&s.state.key||"default",o?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,s){return typeof s=="string"?s:is(s)}return N4(e,n,null,t)}function ot(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function vn(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function T4(){return Math.random().toString(36).substring(2,10)}function NE(t,e){return{usr:t.state,key:t.key,idx:e,masked:t.mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function gd(t,e,n=null,r,s){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?ls(e):e,state:n,key:e&&e.key||r||T4(),mask:s}}function is({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function ls(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substring(r),t=t.substring(0,r)),t&&(e.pathname=t)}return e}function N4(t,e,n,r={}){let{window:s=document.defaultView,v5Compat:o=!1}=r,l=s.history,d="POP",h=null,p=g();p==null&&(p=0,l.replaceState({...l.state,idx:p},""));function g(){return(l.state||{idx:null}).idx}function m(){d="POP";
58let S=g(),E=S==null?null:S-p;p=S,h&&h({action:d,location:w.location,delta:E})}function y(S,E){d="PUSH";let k=TE(S)?S:gd(w.location,S,E);p=g()+1;let j=NE(k,p),N=w.createHref(k.mask||k);try{l.pushState(j,"",N)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;s.location.assign(N)}o&&h&&h({action:d,location:w.location,delta:1})}function b(S,E){d="REPLACE";let k=TE(S)?S:gd(w.location,S,E);p=g();let j=NE(k,p),N=w.createHref(k.mask||k);l.replaceState(j,"",N),o&&h&&h({action:d,location:w.location,delta:0})}function _(S){return B2(S)}let w={get action(){return d},get location(){return t(s,l)},listen(S){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener(jE,m),h=S,()=>{s.removeEventListener(jE,m),h=null}},createHref(S){return e(s,S)},createURL:_,encodeLocation(S){let E=_(S);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:y,replace:b,go(S){return l.go(S)}};return w}function B2(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),ot(n,"No window.location.(origin|href) available to create URL");let r=typeof t=="string"?t:is(t);return r=r.replace(/ $/,"%20"),!e&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Gu,AE=class{constructor(t){if(qu(this,Gu,new Map),t)for(let[e,n]of t)this.set(e,n)}get(t){if(fi(this,Gu).has(t))return fi(this,Gu).get(t);if(t.defaultValue!==void 0)return t.defaultValue;throw new Error("No value found for context")}set(t,e){fi(this,Gu).set(t,e)}};Gu=new WeakMap;var A4=new Set(["lazy","caseSensitive","path","id","index","children"]);function C4(t){return A4.has(t)}var R4=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function O4(t){return R4.has(t)}function D4(t){return t.index===!0}function vd(t,e,n=[],r={},s=!1){return t.map((o,l)=>{let d=[...n,String(l)],h=typeof o.id=="string"?o.id:d.join("-");if(ot(o.index!==!0||!o.children,"Cannot specify children on an index route"),ot(s||!r[h],`Found a route id collision on i
58d "${h}".  Route id's must be globally unique within Data Router usages`),D4(o)){let p={...o,id:h};return r[h]=CE(p,e(p)),p}else{let p={...o,id:h,children:void 0};return r[h]=CE(p,e(p)),o.children&&(p.children=vd(o.children,e,d,r,s)),p}})}function CE(t,e){return Object.assign(t,{...e,...typeof e.lazy=="object"&&e.lazy!=null?{lazy:{...t.lazy,...e.lazy}}:{}})}function H2(t,e,n="/"){return Oi(t,e,n,!1)}function Oi(t,e,n,r,s){let o=typeof e=="string"?ls(e):e,l=wi(o.pathname||"/",n);if(l==null)return null;let d=s??lp(t),h=null,p=V4(l);for(let g=0;h==null&&g<d.length;++g)h=q4(d[g],p,r);return h}function I4(t,e){let{route:n,pathname:r,params:s}=t;return{id:n.id,pathname:r,params:s,data:e[n.id],loaderData:e[n.id],handle:n.handle}}function lp(t){let e=q2(t);return M4(e),e}function q2(t,e=[],n=[],r="",s=!1){let o=(l,d,h=s,p)=>{let g={relativePath:p===void 0?l.path||"":p,caseSensitive:l.caseSensitive===!0,childrenIndex:d,route:l};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(r)&&h)return;ot(g.relativePath.startsWith(r),`Absolute route path "${g.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(r.length)}let m=vi([r,g.relativePath]),y=n.concat(g);l.children&&l.children.length>0&&(ot(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),q2(l.children,e,y,m,h)),!(l.path==null&&!l.index)&&e.push({path:m,score:B4(m,l.index),routesMeta:y})};return t.forEach((l,d)=>{var h;if(l.path===""||!((h=l.path)!=null&&h.includes("?")))o(l,d);else for(let p of G2(l.path))o(l,d,!0,p)}),e}function G2(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return s?[o,""]:[o];let l=G2(r.join("/")),d=[];return d.push(...l.map(h=>h===""?o:[o,h].join("/"))),s&&d.push(...l),d.map(h=>t.startsWith("/")&&h===""?"/":h)}function M4(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:H4(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var L4=/^:[\w-]+$/,P4=3,F4=2,$4=1,U4=10,z4=-2,RE=t=>t==="*";function B4(t,e){let n=t.split("/"),r=n.length;return n.some(RE)&&(r+=z4),e&&(r+=F4),n.filter(s=>!RE(s)).reduce((s,o)=>s+(L4.test(o)?P4:o===""?$4:U4),r)}function H4(t,e){return t.length===e.length&&t.slice(0,-1).every((r,s)=>r===e[s])?t[t.length-1]-e[e.length-1]:0}function q4(t,e,n=!1){let{routesMeta:r}=t,s={},o="/",l=[];for(let d=0;d<r.length;++d){let h=r[d],p=d===r.length-1,g=o==="/"?e:e.slice(o.length)||"/",m=Cp({path:h.relativePath,caseSensitive:h.caseSensitive,end:p},g),y=h.route;if(!m&&p&&n&&!r[r.length-1].route.index&&(m=Cp({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},g)),!m)return null;
58Object.assign(s,m.params),l.push({params:s,pathname:vi([o,m.pathname]),pathnameBase:K4(vi([o,m.pathnameBase])),route:y}),m.pathnameBase!=="/"&&(o=vi([o,m.pathnameBase]))}return l}function Cp(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=G4(t.path,t.caseSensitive,t.end),s=e.match(n);if(!s)return null;let o=s[0],l=o.replace(/(.)\/+$/,"$1"),d=s.slice(1);return{params:r.reduce((p,{paramName:g,isOptional:m},y)=>{if(g==="*"){let _=d[y]||"";l=o.slice(0,o.length-_.length).replace(/(.)\/+$/,"$1")}const b=d[y];return m&&!b?p[g]=void 0:p[g]=(b||"").replace(/%2F/g,"/"),p},{}),pathname:o,pathnameBase:l,pattern:t}}function G4(t,e=!1,n=!0){vn(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 r=[],s="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,d,h,p,g)=>{if(r.push({paramName:d,isOptional:h!=null}),h){let m=g.charAt(p+l.length);return m&&m!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(r.push({paramName:"*"}),s+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":t!==""&&t!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),r]}function V4(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return vn(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function wi(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function W4({basename:t,pathname:e}){return e==="/"?t:vi([t,e])}var V2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,dx=t=>V2.test(t);function Y4(t,e="/"){let{pathname:n,search:r="",hash:s=""}=typeof t=="string"?ls(t):t,o;return n?(n=hx(n),n.startsWith("/")?o=OE(n.substring(1),"/"):o=OE(n,e)):o=e,{pathname:o,search:J4(r),hash:X4(s)}}function OE(t,e){let n=Rp(e).split("/");return t.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function hy(t,e,n,r){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(r)}].  Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function W2(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function jm(t){let e=W2(t);return e.map((n,r)=>r===e.length-1?n.pathname:n.pathnameBase)}function Yd(t,e,n,r=!1){let s;typeof t=="string"?s=ls(t):(s={...t},ot(!s.pathname||!s.pathname.includes("?"),hy("?","pathname","search",s)),ot(!s.pathname||!s.pathname.includes("#"),hy("#","pathname","hash",s)),ot(!s.search||!s.search.includes("#"),hy("#","search","hash",s)));let o=t===""||s.pathname==="",l=o?"/":s.pathname,d;if(l==null)d=n;else{let m=e.length-1;if(!r&&l.startsWith("..")){let y=l.split("/");for(;y[0]==="..";)y.shift(),m-=1;s.pathname=y.join("/")}d=m>=0?e[m]:"/"}let h=Y4(s,d),p=l&&l!=="/"&&l.endsWith("/"),g=(o||l===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(p||g)&&(h.pathname+="/"),h}var hx=t=>t.replace(/\/\/+/g,"/"),vi=t=>hx(t.join("/")),Rp=t=>t.replace(/\/+$/,""),K4=t=>Rp(t).replace(/^\/*/,"/"),J4=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,X4=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,Kd=class{constructor(t,e,n,r=!1){this.status=t,this.statusText=e||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function yd(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function Jd(t){let e=t.map(n=>n.route.path).filter(Boolean);return vi(e)||"/"}var Y2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function K2(t,e){let n=t;
58if(typeof n!="string"||!V2.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,s=!1;if(Y2)try{let o=new URL(window.location.href),l=n.startsWith("//")?new URL(o.protocol+n):new URL(n),d=wi(l.pathname,e);l.origin===o.origin&&d!=null?n=d+l.search+l.hash:s=!0}catch{vn(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:s,to:n}}var La=Symbol("Uninstrumented");function Z4(t,e){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};t.forEach(s=>s({id:e.id,index:e.index,path:e.path,instrument(o){let l=Object.keys(n);for(let d of l)o[d]&&n[d].push(o[d])}}));let r={};if(typeof e.lazy=="function"&&n.lazy.length>0){let s=ec(n.lazy,e.lazy,()=>{});s&&(r.lazy=s)}if(typeof e.lazy=="object"){let s=e.lazy;["middleware","loader","action"].forEach(o=>{let l=s[o],d=n[`lazy.${o}`];if(typeof l=="function"&&d.length>0){let h=ec(d,l,()=>{});h&&(r.lazy=Object.assign(r.lazy||{},{[o]:h}))}})}return["loader","action"].forEach(s=>{let o=e[s];if(typeof o=="function"&&n[s].length>0){let l=o[La]??o,d=ec(n[s],l,(...h)=>DE(h[0]));d&&(s==="loader"&&l.hydrate===!0&&(d.hydrate=!0),d[La]=l,r[s]=d)}}),e.middleware&&e.middleware.length>0&&n.middleware.length>0&&(r.middleware=e.middleware.map(s=>{let o=s[La]??s,l=ec(n.middleware,o,(...d)=>DE(d[0]));return l?(l[La]=o,l):s})),r}function Q4(t,e){let n={navigate:[],fetch:[]};if(e.forEach(r=>r({instrument(s){let o=Object.keys(s);for(let l of o)s[l]&&n[l].push(s[l])}})),n.navigate.length>0){let r=t.navigate[La]??t.navigate,s=ec(n.navigate,r,(...o)=>{let[l,d]=o;return{to:typeof l=="number"||typeof l=="string"?l:l?is(l):".",...IE(t,d??{})}});s&&(s[La]=r,t.navigate=s)}if(n.fetch.length>0){let r=t.fetch[La]??t.fetch,s=ec(n.fetch,r,(...o)=>{let[l,,d,h]=o;return{href:d??".",fetcherKey:l,...IE(t,h??{})}});s&&(s[La]=r,t.fetch=s)}return t}function ec(t,e,n){return t.length===0?null:async(...r)=>{let s=await J2(t,n(...r),()=>e(...r),t.length-1);if(s.type==="error")throw s.value;return s.value}}async function J2(t,e,n,r){let s=t[r],o;if(s){let l,d=async()=>(l?console.error("You cannot call instrumented handlers more than once"):l=J2(t,e,n,r-1),o=await l,ot(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await s(d,e)}catch(h){console.error("An instrumentation function threw an error:",h)}l||await d(),await l}else try{o={type:"success",value:await n()}}catch(l){o={type:"error",value:l}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function DE(t){let{request:e,context:n,params:r,pattern:s}=t;return{request:eI(e),params:{...r},pattern:s,context:tI(n)}}function IE(t,e){return{currentUrl:is(t.state.location),..."formMethod"in e?{formMethod:e.formMethod}:{},..."formEncType"in e?{formEncType:e.formEncType}:{},..."formData"in e?{formData:e.formData}:{},..."body"in e?{body:e.body}:{}}}function eI(t){return{method:t.method,url:t.url,headers:{get:(...e)=>t.headers.get(...e)}}}function tI(t){if(rI(t)){let e={...t};return Object.freeze(e),e}else return{get:e=>t.get(e)}}var nI=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function rI(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null||Object.getOwnPropertyNames(e).sort().join("\0")===nI}var X2=["POST","PUT","PATCH","DELETE"],iI=new Set(X2),sI=["GET",...X2],aI=new Set(sI),Z2=new Set([301,302,303,307,308]),oI=new Set([307,308]),fy={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},lI={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ju={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},cI=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),Q2="remix-router-transitions",eN=Symbol("ResetLoaderData"),_o,ql,Ra,Gl,uI=class{constructor(t){qu(this,_o),qu(this,ql),qu(this,Ra),qu(this,Gl),Yi(this,_o,t),Yi(this,ql,lp(t))}get stableRoutes(){return fi(this,_o)}get activeRoutes(){return fi(this,Ra)??fi(this,_o)}get branches(){return fi(this,Gl)??fi(this,ql)}get hasHMRRoutes(){return fi(this,Ra)!=null}setRoutes(t){Yi(this,_o,t),Yi(this,ql,lp(t))}setHmrRoutes(t){Yi(this,Ra,t),Yi(this,Gl,lp(t))}commitHmrRoutes(){fi(this,Ra)&&(Yi(this,_o,fi(this,Ra)),Yi(this,ql,fi(this,Gl)),Yi(this,Ra,void 0),Yi(this,Gl,void 0))}};_o=new WeakMap;ql=new WeakMap;Ra=new WeakMap;Gl=new WeakMap;function dI(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u";ot(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=t.hydrationRouteProperties||[],s=t.mapRouteProperties||cI,o=s;if(t.instrumentations){let Y=t.instrumentations;o=Z=>({...s(Z),...Z4(Y.map(oe=>
58oe.route).filter(Boolean),Z)})}let l={},d=new uI(vd(t.routes,o,void 0,l)),h=t.basename||"/";h.startsWith("/")||(h=`/${h}`);let p=t.dataStrategy||gI,g={...t.future},m=null,y=new Set,b=null,_=null,w=null,S=null,E=t.hydrationData!=null,k=Oi(d.activeRoutes,t.history.location,h,!1,d.branches),j=!1,N=null,O,D;if(k==null&&!t.patchRoutesOnNavigation){let Y=pi(404,{pathname:t.history.location.pathname}),{matches:Z,route:oe}=Of(d.activeRoutes);O=!0,D=!O,k=Z,N={[oe.id]:Y}}else if(k&&!t.hydrationData&&dn(k,d.activeRoutes,t.history.location.pathname).active&&(k=null),k)if(k.some(Y=>Y.route.lazy))O=!1,D=!O;else if(!k.some(Y=>fx(Y.route)))O=!0,D=!O;else{let Y=t.hydrationData?t.hydrationData.loaderData:null,Z=t.hydrationData?t.hydrationData.errors:null,oe=k;if(Z){let ge=k.findIndex(ye=>Z[ye.route.id]!==void 0);oe=oe.slice(0,ge+1)}D=!1,O=!0,oe.forEach(ge=>{let ye=tN(ge.route,Y,Z);D=D||ye.renderFallback,O=O&&!ye.shouldLoad})}else{O=!1,D=!O,k=[];let Y=dn(null,d.activeRoutes,t.history.location.pathname);Y.active&&Y.matches&&(j=!0,k=Y.matches)}let F,R={historyAction:t.history.action,location:t.history.location,matches:k,initialized:O,renderFallback:D,navigation:fy,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||N,fetchers:new Map,blockers:new Map},B="POP",M=null,V=!1,W,Q=!1,K=new Map,te=null,I=!1,H=!1,G=new Set,re=new Map,U=0,A=-1,$=new Map,P=new Set,q=new Map,z=new Map,X=new Set,se=new Map,ne,ie=null;function fe(){if(m=t.history.listen(({action:Y,location:Z,delta:oe})=>
58{if(ne){ne(),ne=void 0;return}vn(se.size===0||oe!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs.  This can also happen if you are using createHashRouter and the user manually changes the URL.");let ge=pe({currentLocation:R.location,nextLocation:Z,historyAction:Y});if(ge&&oe!=null){let ye=new Promise(Ce=>{ne=Ce});t.history.go(oe*-1),Pr(ge,{state:"blocked",location:Z,proceed(){Pr(ge,{state:"proceeding",proceed:void 0,reset:void 0,location:Z}),ye.then(()=>t.history.go(oe))},reset(){let Ce=new Map(R.blockers);Ce.set(ge,ju),Oe({blockers:Ce})}}),M==null||M.resolve(),M=null;return}return mt(Y,Z)}),n){II(e,K);let Y=()=>MI(e,K);e.addEventListener("pagehide",Y),te=()=>e.removeEventListener("pagehide",Y)}return R.initialized||mt("POP",R.location,{initialHydration:!0}),F}function _e(){m&&m(),te&&te(),y.clear(),W&&W.abort(),R.fetchers.forEach((Y,Z)=>fr(R.fetchers,Z)),R.blockers.forEach((Y,Z)=>Ei(Z))}function Te(Y){if(y.add(Y),b){let{newErrors:Z}=b;b=null,Y(R,{deletedFetchers:[],newErrors:Z,viewTransitionOpts:void 0,flushSync:!1})}return()=>y.delete(Y)}function Oe(Y,Z={}){Y.matches&&(Y.matches=Y.matches.map(ye=>{let Ce=l[ye.route.id],Se=ye.route;return Se.element!==Ce.element||Se.errorElement!==Ce.errorElement||Se.hydrateFallbackElement!==Ce.hydrateFallbackElement?{...ye,route:Ce}:ye})),R={...R,...Y};let oe=[],ge=[];R.fetchers.forEach((ye,Ce)=>{ye.state==="idle"&&(X.has(Ce)?oe.push(Ce):ge.push(Ce))}),X.forEach(ye=>{!R.fetchers.has(ye)&&!re.has(ye)&&oe.push(ye)}),y.size===0&&(b={newErrors:Y.errors??null}),[...y].forEach(ye=>ye(R,{deletedFetchers:oe,newErrors:Y.errors??null,viewTransitionOpts:Z.viewTransitionOpts,flushSync:Z.flushSync===!0})),oe.forEach(ye=>fr(R.fetchers,ye)),ge.forEach(ye=>R.fetchers.delete(ye))}function xe(Y,Z,{flushSync:oe}={}){var Ve,Ze;let ge=R.actionData!=null&&R.navigation.formMethod!=null&&ar(R.navigation.formMethod)&&R.navigation.state==="loading"&&((Ve=Y.state)==null?void 0:Ve._isRedirect)!==!0,ye;Z.actionData?Object.keys(Z.actionData).length>0?ye=Z.actionData:ye=null:ge?ye=R.actionData:ye=null;let Ce=Z.loaderData?GE(R.loaderData,Z.loaderData,Z.matches||[],Z.errors):R.loaderData,Se=R.blockers;Se.size>0&&(Se=new Map(Se),Se.forEach((ze,at)=>Se.set(at,ju)));let De=I?!1:bn(Y,Z.matches||R.matches),Ne=V===!0||R.navigation.formMethod!=null&&ar(R.navigation.formMethod)&&((Ze=Y.state)==null?void 0:Ze._isRedirect)!==!0;d.commitHmrRoutes(),I||B==="POP"||(B==="PUSH"?t.history.push(Y,Y.state):B==="REPLACE"&&t.history.replace(Y,Y.state));let Pe;if(B==="POP"){let ze=K.get(R.location.pathname);ze&&ze.has(Y.pathname)?Pe={currentLocation:R.location,nextLocation:Y}:K.has(Y.pathname)&&(Pe={currentLocation:Y,nextLocation:R.location})}else if(Q){let ze=K.get(R.location.pathname);ze?ze.add(Y.pathname):(ze=new Set([Y.pathname]),K.set(R.location.pathname,ze)),Pe={currentLocation:R.location,nextLocation:Y}}Oe({...Z,actionData:ye,loaderData:Ce,historyAction:B,location:Y,initialized:!0,renderFallback:!1,navigation:fy,revalidation:"idle",restoreScrollPosition:De,preventScrollReset:Ne,blockers:Se},{viewTransitionOpts:Pe,flushSync:oe===!0}),B="POP",V=!1,Q=!1,I=!1,H=!1,M==null||M.resolve(),M=null,ie==null||ie.resolve(),ie=null}async function Ge(Y,Z){if(M==null||M.resolve(),M=null,typeof Y=="number"){M||(M=KE());let bt=M.promise;return t.history.go(Y),bt}let oe=R0(R.location,R.matches,h,Y,Z==null?void 0:Z.fromRouteId,Z==null?void 0:Z.relative),{path:ge,submission:ye,error:Ce}=ME(!1,oe,Z),Se;Z!=null&&Z.mask&&(Se={pathname:"",search:"",hash:"",...typeof Z.mask=="string"?ls(Z.mask):{...R.location.mask,...Z.mask}});let De=R.location,Ne=gd(De,ge,Z&&Z.state,void 0,Se);Ne={...Ne,...t.history.encodeLocation(Ne)};let Pe=Z&&Z.replace!=null?Z.replace:void 0,Ve="PUSH";Pe===!0?Ve="REPLACE":Pe===!1||ye!=null&&ar(ye.formMethod)&&ye.formAction===R.location.pathname+R.location.search&&(Ve="REPLACE");let Ze=Z&&"preventScrollReset"in Z?Z.preventScrollReset===!0:void 0,ze=(Z&&Z.flushSync)===!0,at=pe({currentLocation:De,nextLocation:Ne,historyAction:Ve});if(at){Pr(at,{state:"blocked",location:Ne,proceed(){Pr(at,{state:"proceeding",proceed:void 0,reset:void 0,location:Ne}),Ge(Y,Z)},reset(){let bt=new Map(R.blockers);bt.set(at,ju),Oe({blockers:bt})}});return}await mt(Ve,Ne,{submission:ye,pendingError:Ce,preventScrollReset:Ze,replace:Z&&Z.replace,enableViewTransition:Z&&Z.viewTransition,flushSync:ze,callSiteDefaultShouldRevalidate:Z&&Z.defaultShouldRevalidate})}function Le(){ie||(ie=KE()),Mn(),Oe({revalidation:"loading"});let Y=ie.promise;return R.navigation.state==="submitting"?Y:R.navigation.state==="idle"?(mt(R.historyAction,R.location,{startUninterruptedRevalidation:!0}
58),Y):(mt(B||R.historyAction,R.navigation.location,{overrideNavigation:R.navigation,enableViewTransition:Q===!0}),Y)}async function mt(Y,Z,oe){W&&W.abort(),W=null,B=Y,I=(oe&&oe.startUninterruptedRevalidation)===!0,Fn(R.location,R.matches),V=(oe&&oe.preventScrollReset)===!0,Q=(oe&&oe.enableViewTransition)===!0;let ge=d.activeRoutes,ye=oe!=null&&oe.initialHydration&&R.matches&&R.matches.length>0&&!j?R.matches:Oi(ge,Z,h,!1,d.branches),Ce=(oe&&oe.flushSync)===!0;if(ye&&R.initialized&&!H&&EI(R.location,Z)&&!(oe&&oe.submission&&ar(oe.submission.formMethod))){xe(Z,{matches:ye},{flushSync:Ce});return}let Se=dn(ye,ge,Z.pathname);if(Se.active&&Se.matches&&(ye=Se.matches),!ye){let{error:jt,notFoundMatches:gt,route:_n}=Ue(Z.pathname);xe(Z,{matches:gt,loaderData:{},errors:{[_n.id]:jt}},{flushSync:Ce});return}let De=oe&&oe.overrideNavigation?{...oe.overrideNavigation,matches:ye,historyAction:Y}:void 0;W=new AbortController;let Ne=Vl(t.history,Z,W.signal,oe&&oe.submission),Pe=t.getContext?await t.getContext():new AE,Ve;if(oe&&oe.pendingError)Ve=[Da(ye).route.id,{type:"error",error:oe.pendingError}];else if(oe&&oe.submission&&ar(oe.submission.formMethod)){let jt=await Et(Ne,Z,oe.submission,ye,Y,Pe,Se.active,oe&&oe.initialHydration===!0,{replace:oe.replace,flushSync:Ce});if(jt.shortCircuited)return;if(jt.pendingActionResult){let[gt,_n]=jt.pendingActionResult;if(Vr(_n)&&yd(_n.error)&&_n.error.status===404){W=null,xe(Z,{matches:jt.matches,loaderData:{},errors:{[gt]:_n.error}});return}}ye=jt.matches||ye,Ve=jt.pendingActionResult,De=py(Z,ye,Y,oe.submission),Ce=!1,Se.active=!1,Ne=Vl(t.history,Ne.url,Ne.signal)}let{shortCircuited:Ze,matches:ze,loaderData:at,errors:bt,workingFetchers:Qt}=await Jt(Ne,Z,ye,Y,Pe,Se.active,De,oe&&oe.submission,oe&&oe.fetcherSubmission,oe&&oe.replace,oe&&oe.initialHydration===!0,Ce,Ve,oe&&oe.callSiteDefaultShouldRevalidate);Ze||(W=null,xe(Z,{matches:ze||ye,...VE(Ve),loaderData:at,errors:bt,...Qt?{fetchers:Qt}:{}}))}async function Et(Y,Z,oe,ge,ye,Ce,Se,De,Ne={}){Mn();let Pe=OI(Z,ge,ye,oe);if(Oe({navigation:Pe},{flushSync:Ne.flushSync===!0}),Se){let ze=await dt(ge,Z.pathname,Y.signal);if(ze.type==="aborted")return{shortCircuited:!0};if(ze.type==="error"){if(ze.partialMatches.length===0){let{matches:bt,route:Qt}=Of(d.activeRoutes);return{matches:bt,pendingActionResult:[Qt.id,{type:"error",error:ze.error}]}}let at=Da(ze.partialMatches).route.id;return{matches:ze.partialMatches,pendingActionResult:[at,{type:"error",error:ze.error}]}}else if(ze.matches)ge=ze.matches;else{let{notFoundMatches:at,error:bt,route:Qt}=Ue(Z.pathname);return{matches:at,pendingActionResult:[Qt.id,{type:"error",error:bt}]}}}let Ve,Ze=cp(ge,Z);if(!Ze.route.action&&!Ze.route.lazy)Ve={type:"error",error:pi(405,{method:Y.method,pathname:Z.pathname,routeId:Ze.route.id})};else{let ze=lc(o,l,Y,Z,ge,Ze,De?[]:r,Ce),at=await dr(Y,Z,ze,Ce,null);if(Ve=at[Ze.route.id],!Ve){for(let bt of ge)if(at[bt.route.id]){Ve=at[bt.route.id];break}}if(Y.signal.aborted)return{shortCircuited:!0}}if(No(Ve)){let ze;return Ne&&Ne.replace!=null?ze=Ne.replace:ze=BE(Ve.response.headers.get("Location"),new URL(Y.url),h,t.history)===R.location.pathname+R.location.search,await nr(Y,Ve,!0,{submission:oe,replace:ze}),{shortCircuited:!0}}if(Vr(Ve)){let ze=Da(ge,Ze.route.id);
58return(Ne&&Ne.replace)!==!0&&(B="PUSH"),{matches:ge,pendingActionResult:[ze.route.id,Ve,Ze.route.id]}}return{matches:ge,pendingActionResult:[Ze.route.id,Ve]}}async function Jt(Y,Z,oe,ge,ye,Ce,Se,De,Ne,Pe,Ve,Ze,ze,at){let bt=Se||py(Z,oe,ge,De),Qt=De||Ne||YE(bt),jt=!I&&!Ve;if(Ce){if(jt){let Ht=wt(ze);Oe({navigation:bt,...Ht!==void 0?{actionData:Ht}:{}},{flushSync:Ze})}let Qe=await dt(oe,Z.pathname,Y.signal);if(Qe.type==="aborted")return{shortCircuited:!0};if(Qe.type==="error"){if(Qe.partialMatches.length===0){let{matches:Fr,route:Ti}=Of(d.activeRoutes);return{matches:Fr,loaderData:{},errors:{[Ti.id]:Qe.error}}}let Ht=Da(Qe.partialMatches).route.id;return{matches:Qe.partialMatches,loaderData:{},errors:{[Ht]:Qe.error}}}else if(Qe.matches)oe=Qe.matches;else{let{error:Ht,notFoundMatches:Fr,route:Ti}=Ue(Z.pathname);return{matches:Fr,loaderData:{},errors:{[Ti.id]:Ht}}}}let gt=d.activeRoutes,{dsMatches:_n,revalidatingFetchers:vt}=LE(Y,ye,o,l,t.history,R,oe,Qt,Z,Ve?[]:r,Ve===!0,H,G,X,q,P,gt,h,t.patchRoutesOnNavigation!=null,d.branches,ze,at);if(A=++U,!t.dataStrategy&&!_n.some(Qe=>Qe.shouldLoad)&&!_n.some(Qe=>Qe.route.middleware&&Qe.route.middleware.length>0)&&vt.length===0){let Qe=new Map(R.fetchers),Ht=ei(Qe);return xe(Z,{matches:oe,loaderData:{},errors:ze&&Vr(ze[1])?{[ze[0]]:ze[1].error}:null,...VE(ze),...Ht?{fetchers:Qe}:{}},{flushSync:Ze}),{shortCircuited:!0}}if(jt){let Qe={};if(!Ce){Qe.navigation=bt;let Ht=wt(ze);Ht!==void 0&&(Qe.actionData=Ht)}vt.length>0&&(Qe.fetchers=Xt(vt)),Oe(Qe,{flushSync:Ze})}vt.forEach(Qe=>{Nt(Qe.key),Qe.controller&&re.set(Qe.key,Qe.controller)});let aa=()=>vt.forEach(Qe=>Nt(Qe.key));W&&W.signal.addEventListener("abort",aa);let{loaderResults:ki,fetcherResults:Sr}=await rr(_n,vt,Y,Z,ye);if(Y.signal.aborted)return{shortCircuited:!0};W&&W.signal.removeEventListener("abort",aa),vt.forEach(Qe=>re.delete(Qe.key));let pr=Df(ki);if(pr)return await nr(Y,pr.result,!0,{replace:Pe}),{shortCircuited:!0};if(pr=Df(Sr),pr)return P.add(pr.key),await nr(Y,pr.result,!0,{replace:Pe}),{shortCircuited:!0};let ti=new Map(R.fetchers),{loaderData:Yo,errors:ji}=qE(R,oe,ki,ze,vt,Sr,ti);Ve&&R.errors&&(ji={...R.errors,...ji});let Ko=ei(ti),us=cs(A,ti),ds=Ko||us||vt.length>0;return{matches:oe,loaderData:Yo,errors:ji,...ds?{workingFetchers:ti}:{}}}function wt(Y){if(Y&&!Vr(Y[1]))return{[Y[0]]:Y[1].data};if(R.actionData)return Object.keys(R.actionData).length===0?null:R.actionData}function Xt(Y){let Z=new Map(R.fetchers);return Y.forEach(oe=>{let ge=Z.get(oe.key),ye=Tu(void 0,ge?ge.data:void 0);Z.set(oe.key,ye)}),Z}async function ur(Y,Z,oe,ge){Nt(Y);let ye=(ge&&ge.flushSync)===!0,Ce=d.activeRoutes,Se=R0(R.location,R.matches,h,oe,Z,ge==null?void 0:ge.relative),De=Oi(Ce,Se,h,!1,d.branches),Ne=dn(De,Ce,Se);if(Ne.active&&Ne.matches&&(De=Ne.matches),!De){zt(Y,Z,pi(404,{pathname:Se}),{flushSync:ye});return}let{path:Pe,submission:Ve,error:Ze}=ME(!0,Se,ge);if(Ze){zt(Y,Z,Ze,{flushSync:ye});return}let ze=t.getContext?await t.getContext():new AE,at=(ge&&ge.preventScrollReset)===!0;if(Ve&&ar(Ve.formMethod)){await jn(Y,Z,Pe,De,ze,Ne.active,ye,at,Ve,ge&&ge.defaultShouldRevalidate);return}q.set(Y,{routeId:Z,path:Pe}),await Zt(Y,Z,Pe,De,ze,Ne.active,ye,at,Ve)}async function jn(Y,Z,oe,ge,ye,Ce,Se,De,Ne,Pe){Mn(),q.delete(Y);let Ve=R.fetchers.get(Y);on(Y,DI(Ne,Ve),{flushSync:Se});let Ze=new AbortController,ze=Vl(t.history,oe,Ze.signal,Ne);if(Ce){let At=await dt(ge,new URL(ze.url).pathname,ze.signal,Y);if(At.type==="aborted")return;if(At.type==="error"){zt(Y,Z,At.error,{flushSync:Se});return}else if(At.matches)ge=At.matches;else{zt(Y,Z,pi(404,{pathname:oe}),{flushSync:Se});return}}let at=cp(ge,oe);if(!at.route.action&&!at.route.lazy){let At=pi(405,{method:Ne.formMethod,pathname:oe,routeId:Z});zt(Y,Z,At,{flushSync:Se});return}re.set(Y,Ze);let bt=U,Qt=lc(o,l,ze,oe,ge,at,r,ye),jt=await dr(ze,oe,Qt,ye,Y),gt=jt[at.route.id];if(!gt){for(let At of Qt)if(jt[At.route.id]){gt=jt[At.route.id];break}}if(ze.signal.aborted){re.get(Y)===Ze&&re.delete(Y);return}if(X.has(Y)){if(No(gt)||Vr(gt)){on(Y,Zi(void 0));return}}else{if(No(gt))if(re.delete(Y),A>bt){on(Y,Zi(void 0));return}else return P.add(Y),on(Y,Tu(Ne)),nr(ze,gt,!1,{fetcherSubmission:Ne,preventScrollReset:De});if(Vr(gt)){zt(Y,Z,gt.error);return}}let _n=R.navigation.location||R.location,vt=Vl(t.history,_n,Ze.signal),aa=d.activeRoutes,ki=R.navigation.state!=="idle"?Oi(aa,R.navigation.location,h,!1,d.branches):R.matches;ot(ki,"Didn't find any matches after fetcher action");let Sr=++U;$.set(Y,Sr);let{dsMatches:pr,revalidatingFetchers:ti}=LE(vt,ye,o,l,t.history,R,ki,Ne,_n,r,!1,H,G,X,q,P,aa,h,t.patchRoutesOnNavigation!=null,d.branches,[at.route.id,gt],Pe),Yo=Tu(Ne,gt.data),ji=new Map(R.fetchers);ji.set(Y,Yo),ti.filter(At=>At.key!==Y).forEach(At=>{let hs=At.key,mr=ji.get(hs),Lc=Tu(void 0,mr?mr.data:void 0);ji.set(hs,Lc),Nt(hs),At.controller&&re.set(hs,At.controller)}),Oe({fetchers:ji});let Ko=()=>
58ti.forEach(At=>Nt(At.key));Ze.signal.addEventListener("abort",Ko);let{loaderResults:us,fetcherResults:ds}=await rr(pr,ti,vt,_n,ye);if(Ze.signal.aborted)return;Ze.signal.removeEventListener("abort",Ko),$.delete(Y),re.delete(Y),ti.forEach(At=>re.delete(At.key));let Qe=R.fetchers.has(Y),Ht=At=>{if(!Qe)return At;let hs=new Map(At.fetchers);return hs.set(Y,Zi(gt.data)),{...At,fetchers:hs}},Fr=Df(us);if(Fr)return R=Ht(R),nr(vt,Fr.result,!1,{preventScrollReset:De});if(Fr=Df(ds),Fr)return P.add(Fr.key),R=Ht(R),nr(vt,Fr.result,!1,{preventScrollReset:De});let Ti=new Map(R.fetchers);Qe&&Ti.set(Y,Zi(gt.data));let{loaderData:Jo,errors:Xo}=qE(R,ki,us,void 0,ti,ds,Ti);cs(Sr,Ti),R.navigation.state==="loading"&&Sr>A?(ot(B,"Expected pending action"),W&&W.abort(),xe(R.navigation.location,{matches:ki,loaderData:Jo,errors:Xo,fetchers:Ti})):(Oe({errors:Xo,loaderData:GE(R.loaderData,Jo,ki,Xo),fetchers:Ti}),H=!1)}async function Zt(Y,Z,oe,ge,ye,Ce,Se,De,Ne){let Pe=R.fetchers.get(Y);on(Y,Tu(Ne,Pe?Pe.data:void 0),{flushSync:Se});let Ve=new AbortController,Ze=Vl(t.history,oe,Ve.signal);if(Ce){let gt=await dt(ge,new URL(Ze.url).pathname,Ze.signal,Y);if(gt.type==="aborted")return;if(gt.type==="error"){zt(Y,Z,gt.error,{flushSync:Se});return}else if(gt.matches)ge=gt.matches;else{zt(Y,Z,pi(404,{pathname:oe}),{flushSync:Se});return}}let ze=cp(ge,oe);re.set(Y,Ve);let at=U,bt=lc(o,l,Ze,oe,ge,ze,r,ye),Qt=await dr(Ze,oe,bt,ye,Y),jt=Qt[ze.route.id];if(!jt){for(let gt of ge)if(Qt[gt.route.id]){jt=Qt[gt.route.id];break}}if(re.get(Y)===Ve&&re.delete(Y),!Ze.signal.aborted){if(X.has(Y)){on(Y,Zi(void 0));return}if(No(jt))if(A>at){on(Y,Zi(void 0));return}else{P.add(Y),await nr(Ze,jt,!1,{preventScrollReset:De});return}if(Vr(jt)){zt(Y,Z,jt.error);return}on(Y,Zi(jt.data))}}async function nr(Y,Z,oe,{submission:ge,fetcherSubmission:ye,preventScrollReset:Ce,replace:Se}={}){oe||(M==null||M.resolve(),M=null),Z.response.headers.has("X-Remix-Revalidate")&&(H=!0);let De=Z.response.headers.get("Location");ot(De,"Expected a Location header on the redirect Response"),De=BE(De,new URL(Y.url),h,t.history);let Ne=gd(R.location,De,{_isRedirect:!0});if(n){let bt=!1;if(Z.response.headers.has("X-Remix-Reload-Document"))bt=!0;else if(dx(De)){const Qt=B2(De,!0);bt=Qt.origin!==e.location.origin||wi(Qt.pathname,h)==null}if(bt){Se?e.location.replace(De):e.location.assign(De);return}}W=null;let Pe=Se===!0||Z.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ve,formAction:Ze,formEncType:ze}=R.navigation;!ge&&!ye&&Ve&&Ze&&ze&&(ge=YE(R.navigation));let at=ge||ye;if(oI.has(Z.response.status)&&at&&ar(at.formMethod))await mt(Pe,Ne,{submission:{...at,formAction:De},preventScrollReset:Ce||V,enableViewTransition:oe?Q:void 0});else{let bt=py(Ne,[],Pe,ge);await mt(Pe,Ne,{overrideNavigation:bt,fetcherSubmission:ye,preventScrollReset:Ce||V,enableViewTransition:oe?Q:void 0})}}async function dr(Y,Z,oe,ge,ye){var De;let Ce,Se={};try{Ce=await yI(p,Y,Z,oe,ye,ge,!1)}catch(Ne){return oe.filter(Pe=>Pe.shouldLoad).forEach(Pe=>{Se[Pe.route.id]={type:"error",error:Ne}}),Se}if(Y.signal.aborted)return Se;if(!ar(Y.method))for(let Ne of oe){if(((De=Ce[Ne.route.id])==null?void 0:De.type)==="error")break;!Ce.hasOwnProperty(Ne.route.id)&&!R.loaderData.hasOwnProperty(Ne.route.id)&&(!R.errors||!R.errors.hasOwnProperty(Ne.route.id))&&Ne.shouldCallHandler()&&(Ce[Ne.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Ne.route.id}`)})}for(let[Ne,Pe]of Object.entries(Ce))if(NI(Pe)){let Ve=Pe.result;Se[Ne]={type:"redirect",response:wI(Ve,Y,Ne,oe,h)}}else Se[Ne]=await _I(Pe);return Se}async function rr(Y,Z,oe,ge,ye){let Ce=dr(oe,ge,Y,ye,null),Se=Promise.all(Z.map(async Pe=>{if(Pe.matches&&Pe.match&&Pe.request&&Pe.controller){let Ze=(await dr(Pe.request,Pe.path,Pe.matches,ye,Pe.key))[Pe.match.route.id];return{[Pe.key]:Ze}}else return Promise.resolve({[Pe.key]:{type:"error",error:pi(404,{pathname:Pe.path})}})})),De=await Ce,Ne=(await Se).reduce((Pe,Ve)=>Object.assign(Pe,Ve),{});return{loaderResults:De,fetcherResults:Ne}}function Mn(){H=!0,q.forEach((Y,Z)=>{re.has(Z)&&G.add(Z),Nt(Z)})}function on(Y,Z,oe={}){let ge=new Map(R.fetchers);ge.set(Y,Z),Oe({fetchers:ge},{flushSync:(oe&&oe.flushSync)===!0})}function zt(Y,Z,oe,ge={}){let ye=Da(R.matches,Z),Ce=new Map(R.fetchers);fr(Ce,Y),Oe({errors:{[ye.route.id]:oe},fetchers:Ce},{flushSync:(ge&&ge.flushSync)===!0})}
58function Ln(Y){return z.set(Y,(z.get(Y)||0)+1),X.has(Y)&&X.delete(Y),R.fetchers.get(Y)||lI}function hr(Y,Z){Nt(Y,Z==null?void 0:Z.reason),on(Y,Zi(null))}function fr(Y,Z){let oe=R.fetchers.get(Z);re.has(Z)&&!(oe&&oe.state==="loading"&&$.has(Z))&&Nt(Z),q.delete(Z),$.delete(Z),P.delete(Z),X.delete(Z),G.delete(Z),Y.delete(Z)}function Pn(Y){let Z=(z.get(Y)||0)-1;Z<=0?(z.delete(Y),X.add(Y)):z.set(Y,Z),Oe({fetchers:new Map(R.fetchers)})}function Nt(Y,Z){let oe=re.get(Y);oe&&(oe.abort(Z),re.delete(Y))}function yn(Y,Z){for(let oe of Y){let ge=Z.get(oe);ot(ge,`Expected fetcher: ${oe}`);let ye=Zi(ge.data);Z.set(oe,ye)}}function ei(Y){let Z=[],oe=!1;for(let ge of P){let ye=Y.get(ge);ot(ye,`Expected fetcher: ${ge}`),ye.state==="loading"&&(P.delete(ge),Z.push(ge),oe=!0)}return yn(Z,Y),oe}function cs(Y,Z){let oe=[];for(let[ge,ye]of $)if(ye<Y){let Ce=Z.get(ge);ot(Ce,`Expected fetcher: ${ge}`),Ce.state==="loading"&&(Nt(ge),$.delete(ge),oe.push(ge))}return yn(oe,Z),oe.length>0}function sa(Y,Z){let oe=R.blockers.get(Y)||ju;return se.get(Y)!==Z&&se.set(Y,Z),oe}function Ei(Y){R.blockers.delete(Y),se.delete(Y)}function Pr(Y,Z){let oe=R.blockers.get(Y)||ju;ot(oe.state==="unblocked"&&Z.state==="blocked"||oe.state==="blocked"&&Z.state==="blocked"||oe.state==="blocked"&&Z.state==="proceeding"||oe.state==="blocked"&&Z.state==="unblocked"||oe.state==="proceeding"&&Z.state==="unblocked",`Invalid blocker state transition: ${oe.state} -> ${Z.state}`);let ge=new Map(R.blockers);ge.set(Y,Z),Oe({blockers:ge})}function pe({currentLocation:Y,nextLocation:Z,historyAction:oe}){if(se.size===0)return;se.size>1&&vn(!1,"A router only supports one blocker at a time");let ge=Array.from(se.entries()),[ye,Ce]=ge[ge.length-1],Se=R.blockers.get(ye);if(!(Se&&Se.state==="proceeding")&&Ce({currentLocation:Y,nextLocation:Z,historyAction:oe}))return ye}function Ue(Y){let Z=pi(404,{pathname:Y}),oe=d.activeRoutes,{matches:ge,route:ye}=Of(oe);return{notFoundMatches:ge,route:ye,error:Z}}function He(Y,Z,oe){if(_=Y,S=Z,w=oe||null,!E&&R.navigation===fy){E=!0;let ge=bn(R.location,R.matches);ge!=null&&Oe({restoreScrollPosition:ge})}return()=>{_=null,S=null,w=null}}function Bt(Y,Z){return w&&w(Y,Z.map(ge=>I4(ge,R.loaderData)))||Y.key}function Fn(Y,Z){if(_&&S){let oe=Bt(Y,Z);_[oe]=S()}}function bn(Y,Z){if(_){let oe=Bt(Y,Z),ge=_[oe];if(typeof ge=="number")return ge}return null}function dn(Y,Z,oe){if(t.patchRoutesOnNavigation){let ge=d.branches;if(Y){if(Object.keys(Y[0].params).length>0)return{active:!0,matches:Oi(Z,oe,h,!0,ge)}}else return{active:!0,matches:Oi(Z,oe,h,!0,ge)||[]}}return{active:!1,matches:null}}async function dt(Y,Z,oe,ge){if(!t.patchRoutesOnNavigation)return{type:"success",matches:Y};let ye=Y;for(;;){let Ce=l;try{await t.patchRoutesOnNavigation({signal:oe,path:Z,matches:ye,fetcherKey:ge,patch:(Pe,Ve)=>{oe.aborted||PE(Pe,Ve,d,Ce,o,!1)}})}catch(Pe){return{type:"error",error:Pe,partialMatches:ye}}if(oe.aborted)return{type:"aborted"};let Se=d.branches,De=Oi(d.activeRoutes,Z,h,!1,Se),Ne=null;if(De){if(Object.keys(De[0].params).length===0)return{type:"success",matches:De};if(Ne=Oi(d.activeRoutes,Z,h,!0,Se),!(Ne&&ye.length<Ne.length&&kt(ye,Ne.slice(0,ye.length))))return{type:"success",matches:De}}if(Ne||(Ne=Oi(d.activeRoutes,Z,h,!0,Se)),!Ne||kt(ye,Ne))return{type:"success",matches:null};ye=Ne}}function kt(Y,Z){return Y.length===Z.length&&Y.every((oe,ge)=>oe.route.id===Z[ge].route.id)}function $n(Y){l={},d.setHmrRoutes(vd(Y,o,void 0,l))}function xn(Y,Z,oe=!1){PE(Y,Z,d,l,o,oe),d.hasHMRRoutes||Oe({})}return F={get basename(){return h},get future(){return g},get state(){return R},get routes(){return d.stableRoutes},get branches(){return d.branches},get manifest(){return l},get window(){return e},initialize:fe,subscribe:Te,enableScrollRestoration:He,navigate:Ge,fetch:ur,revalidate:Le,createHref:Y=>t.history.createHref(Y),encodeLocation:Y=>t.history.encodeLocation(Y),getFetcher:Ln,resetFetcher:hr,deleteFetcher:Pn,dispose:_e,getBlocker:sa,deleteBlocker:Ei,patchRoutes:xn,_internalFetchControllers:re,_internalSetRoutes:$n,_internalSetStateDoNotUseOrYouWillBreakYourApp(Y){Oe(Y)}},t.instrumentations&&(F=Q4(F,t.instrumentations.map(Y=>
58Y.router).filter(Boolean))),F}function hI(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function R0(t,e,n,r,s,o){let l,d;if(s){l=[];for(let p of e)if(l.push(p),p.route.id===s){d=p;break}}else l=e,d=e[e.length-1];let h=Yd(r||".",jm(l),wi(t.pathname,n)||t.pathname,o==="path");if(r==null&&(h.search=t.search,h.hash=t.hash),(r==null||r===""||r===".")&&d){let p=mx(h.search);if(d.route.index&&!p)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&p){let g=new URLSearchParams(h.search),m=g.getAll("index");g.delete("index"),m.filter(b=>b).forEach(b=>g.append("index",b));let y=g.toString();h.search=y?`?${y}`:""}}return n!=="/"&&(h.pathname=W4({basename:n,pathname:h.pathname})),is(h)}function ME(t,e,n){if(!n||!hI(n))return{path:e};if(n.formMethod&&!RI(n.formMethod))return{path:e,error:pi(405,{method:n.formMethod})};let r=()=>({path:e,error:pi(400,{type:"invalid-body"})}),o=(n.formMethod||"get").toUpperCase(),l=lN(e);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!ar(o))return r();let m=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((y,[b,_])=>`${y}${b}=${_}
59`,""):String(n.body);return{path:e,submission:{formMethod:o,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:m}}}else if(n.formEncType==="application/json"){if(!ar(o))return r();try{let m=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:e,submission:{formMethod:o,formAction:l,formEncType:n.formEncType,formData:void 0,json:m,text:void 0}}}catch{return r()}}}ot(typeof FormData=="function","FormData is not available in this environment");let d,h;if(n.formData)d=D0(n.formData),h=n.formData;else if(n.body instanceof FormData)d=D0(n.body),h=n.body;else if(n.body instanceof URLSearchParams)d=n.body,h=HE(d);else if(n.body==null)d=new URLSearchParams,h=new FormData;else try{d=new URLSearchParams(n.body),h=HE(d)}catch{return r()}let p={formMethod:o,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:h,json:void 0,text:void 0};if(ar(p.formMethod))return{path:e,submission:p};let g=ls(e);return t&&g.search&&mx(g.search)&&d.append("index",""),g.search=`?${d}`,{path:is(g),submission:p}}function LE(t,e,n,r,s,o,l,d,h,p,g,m,y,b,_,w,S,E,k,j,N,O){var I;let D=N?Vr(N[1])?N[1].error:N[1].data:void 0,F=s.createURL(o.location),R=s.createURL(h),B;if(g&&o.errors){let H=Object.keys(o.errors)[0];B=l.findIndex(G=>G.route.id===H)}else if(N&&Vr(N[1])){let H=N[0];B=l.findIndex(G=>G.route.id===H)-1}let M=N?N[1].statusCode:void 0,V=M&&M>=400,W={currentUrl:F,currentParams:((I=o.matches[0])==null?void 0:I.params)||{},nextUrl:R,nextParams:l[0].params,...d,actionResult:D,actionStatus:M},Q=Jd(l),K=l.map((H,G)=>{let{route:re}=H,U=null;if(B!=null&&G>B)U=!1;else if(re.lazy)U=!0;else if(!fx(re))U=!1;else if(g){let{shouldLoad:q}=tN(re,o.loaderData,o.errors);U=q}else fI(o.loaderData,o.matches[G],H)&&(U=!0);if(U!==null)return O0(n,r,t,h,Q,H,p,e,U);let A=!1;typeof O=="boolean"?A=O:V?A=!1:(m||F.pathname+F.search===R.pathname+R.search||F.search!==R.search||pI(o.matches[G],H))&&(A=!0);let $={...W,defaultShouldRevalidate:A},P=ed(H,$);return O0(n,r,t,h,Q,H,p,e,P,$,O)}),te=[];return _.forEach((H,G)=>{if(g||!l.some(X=>X.route.id===H.routeId)||b.has(G))return;let re=o.fetchers.get(G),U=re&&re.state!=="idle"&&re.data===void 0,A=Oi(S,H.path,E??"/",!1,j);if(!A){if(k&&U)return;te.push({key:G,routeId:H.routeId,path:H.path,matches:null,match:null,request:null,controller:null});return}if(w.has(G))return;let $=cp(A,H.path),P=new AbortController,q=Vl(s,H.path,P.signal),z=null;if(y.has(G))y.delete(G),z=lc(n,r,q,H.path,A,$,p,e);else if(U)m&&(z=lc(n,r,q,H.path,A,$,p,e));else{let X;typeof O=="boolean"?X=O:V?X=!1:X=m;let se={...W,defaultShouldRevalidate:X};ed($,se)&&(z=lc(n,r,q,H.path,A,$,p,e,se))}z&&te.push({key:G,routeId:H.routeId,path:H.path,matches:z,match:$,request:q,controller:P})}),{dsMatches:K,revalidatingFetchers:te}}function fx(t){return t.loader!=null||t.middleware!=null&&t.middleware.length>0}function tN(t,e,n){if(t.lazy)return{shouldLoad:!0,renderFallback:!0};if(!fx(t))return{shouldLoad:!1,renderFallback:!1};let r=e!=null&&t.id in e,s=n!=null&&n[t.id]!==void 0;if(!r&&s)return{shouldLoad:!1,renderFallback:!1};if(typeof t.loader=="function"&&t.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let o=!r&&!s;return{shouldLoad:o,renderFallback:o}}function fI(t,e,n){let r=!e||n.route.id!==e.route.id,s=!t.hasOwnProperty(n.route.id);return r||s}function pI(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function ed(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}function PE(t,e,n,r,s,o){let l;if(t){let p=r[t];ot(p,`No route found to patch children into: routeId = ${t}`),p.children||(p.children=[]),l=p.children}else l=n.activeRoutes;let d=[],h=[];if(e.forEach(p=>{let g=l.find(m=>nN(p,m));g?h.push({existingRoute:g,newRoute:p}):d.push(p)}),d.length>0){let p=vd(d,s,[t||"_","patch",String((l==null?void 0:l.length)||"0")],r);l.push(...p)}if(o&&h.length>0)for(let p=0;p<h.length;p++){let{existingRoute:g,newRoute:m}=h[p],y=g,[b]=vd([m],s,[],{},!0);Object.assign(y,{element:b.element?b.element:y.element,errorElement:b.errorElement?b.errorElement:y.errorElement,hydrateFallbackElement:b.hydrateFallbackElement?b.hydrateFallbackElement:y.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function nN(t,e){var n;return"id"in t&&"id"in e&&t.id===e.id?!0:t.index===e.index&&t.path===e.path&&t.caseSensitive===e.caseSensitive?(!t.children||t.children.length===0)&&(!e.children||e.children.length===0)?!0:((n=t.children)==null?void 0:n.every((r,s)=>{var o;return(o=e.children)==null?void 0:o.some(l=>nN(r,l))}))??!1:!1}var FE=new WeakMap,rN=({key:t,route:e,manifest:n,mapRouteProperties:r})=>{let s=n[e.id];if(ot(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let o=s.lazy[t];if(!o)return;let l=FE.get(s);l||(l={},FE.set(s,l));let d=l[t];if(d)return d;let h=(async()=>{let p=C4(t),m=s[t]!==void 0&&t!=="hasErrorBoundary";if(p)vn(!p,"Route property "+t+" is not a supported lazy route property. This property will be ignored."),l[t]=Prom
59ise.resolve();else if(m)vn(!1,`Route "${s.id}" has a static property "${t}" defined. The lazy property will be ignored.`);else{let y=await o();y!=null&&(Object.assign(s,{[t]:y}),Object.assign(s,r(s)))}typeof s.lazy=="object"&&(s.lazy[t]=void 0,Object.values(s.lazy).every(y=>y===void 0)&&(s.lazy=void 0))})();return l[t]=h,h},$E=new WeakMap;function mI(t,e,n,r,s){let o=n[t.id];if(ot(o,"No route found in manifest"),!t.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof t.lazy=="function"){let g=$E.get(o);if(g)return{lazyRoutePromise:g,lazyHandlerPromise:g};let m=(async()=>{ot(typeof t.lazy=="function","No lazy route function found");let y=await t.lazy(),b={};for(let _ in y){let w=y[_];if(w===void 0)continue;let S=O4(_),k=o[_]!==void 0&&_!=="hasErrorBoundary";S?vn(!S,"Route property "+_+" is not a supported property to be returned from a lazy route function. This property will be ignored."):k?vn(!k,`Route "${o.id}" has a static property "${_}" defined but its lazy function is also returning a value for this property. The lazy route property "${_}" will be ignored.`):b[_]=w}Object.assign(o,b),Object.assign(o,{...r(o),lazy:void 0})})();return $E.set(o,m),m.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:m}}let l=Object.keys(t.lazy),d=[],h;for(let g of l){if(s&&s.includes(g))continue;let m=rN({key:g,route:t,manifest:n,mapRouteProperties:r});m&&(d.push(m),g===e&&(h=m))}let p=d.length>0?Promise.all(d).then(()=>{}):void 0;return p==null||p.catch(()=>{}),h==null||h.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:h}}async function UE(t){let e=t.matches.filter(s=>s.shouldLoad),n={};return(await Promise.all(e.map(s=>s.resolve()))).forEach((s,o)=>{n[e[o].route.id]=s}),n}async function gI(t){return t.matches.some(e=>e.route.middleware)?iN(t,()=>UE(t)):UE(t)}function iN(t,e){return vI(t,e,r=>{if(CI(r))throw r;return r},jI,n);function n(r,s,o){if(o)return Promise.resolve(Object.assign(o.value,{[s]:{type:"error",result:r}}));{let{matches:l}=t,d=Math.min(Math.max(l.findIndex(p=>p.route.id===s),0),Math.max(l.findIndex(p=>p.shouldCallHandler()),0)),h=Da(l,l[d].route.id).route.id;return Promise.resolve({[h]:{type:"error",result:r}})}}}async function vI(t,e,n,r,s){let{matches:o,...l}=t,d=o.flatMap(p=>p.route.middleware?p.route.middleware.map(g=>[p.route.id,g]):[]);return await sN(l,d,e,n,r,s)}async function sN(t,e,n,r,s,o,l=0){let{request:d}=t;if(d.signal.aborted)throw d.signal.reason??new Error(`Request aborted: ${d.method} ${d.url}`);let h=e[l];if(!h)return await n();let[p,g]=h,m,y=async()=>{if(m)throw new Error("You may only call `next()` once per middleware");try{return m={value:await sN(t,e,n,r,s,o,l+1)},m.value}catch(b){return m={value:await o(b,p,m)},m.value}};try{let b=await g(t,y),_=b!=null?r(b):void 0;return s(_)?_:m?_??m.value:(m={value:await y()},m.value)}catch(b){return await o(b,p,m)}}function aN(t,e,n,r,s){let o=rN({key:"middleware",route:r.route,manifest:e,mapRouteProperties:t}),l=mI(r.route,ar(n.method)?"action":"loader",e,t,s);return{middleware:o,route:l.lazyRoutePromise,handler:l.lazyHandlerPromise}}function O0(t,e,n,r,s,o,l,d,h,p=null,g){let m=!1,y=aN(t,e,n,o,l);return{...o,_lazyPromises:y,shouldLoad:h,shouldRevalidateArgs:p,shouldCallHandler(b){return m=!0,p?typeof g=="boolean"?ed(o,{...p,defaultShouldRevalidate:g}):typeof b=="boolean"?ed(o,{...p,defaultShouldRevalidate:b}):ed(o,p):h},resolve(b){let{lazy:_,loader:w,middleware:S}=o.route,E=m||h||b&&!ar(n.method)&&(_||w),k=S&&S.length>0&&!w&&!_;return E&&(ar(n.method)||!k)?bI({request:n,path:r,pattern:s,match:o,lazyHandlerPromise:y==null?void 0:y.handler,lazyRoutePromise:y==null?void 0:y.route,handlerOverride:b,scopedContext:d}):Promise.resolve({type:"data",result:void 0})}}}function lc(t,e,n,r,s,o,l,d,h=null){return s.map(p=>p.route.id!==o.route.id?{...p,shouldLoad:!1,shouldRevalidateArgs:h,shouldCallHandler:()=>!1,_lazyPromises:aN(t,e,n,p,l),resolve:()=>Promise.resolve({type:"data",result:void 0})}:O0(t,e,n,r,Jd(s),p,l,d,!0,h))}async function yI(t,e,n,r,s,o,l){r.some(g=>{var m;return(m=g._lazyPromises)==null?void 0:m.middleware})&&await Promise.all(r.map(g=>{var m;return(m=g._lazyPromises)==null?void 0:m.middleware}));let d={request:e,url:oN(e,n),pattern:Jd(r),params:r[0].params,context:o,matches:r},p=await t({...d,fetcherKey:s,runClientMiddleware:g=>{let m=d;return iN(m,()=>g({...m,fetcherKey:s,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(g=>{var m,y;return[(m=g._lazyPromises)==null?void 0:m.handler,(y=g._lazyPromises)==null?void 0:y.route]}))}catch{}return p}async function bI({request:t,path:e,pattern:n,match:r,lazyHandlerPromise:s,lazyRoutePromise:o,handlerOverride:l,scopedContext:d}){let h,p,g=ar(t.method),m=g?"action":"loader",y=b=>{let _,w=new Promise((k,j)=>_=j);p=()=>_(),t.signal.addEventListener("abort",p);let S=k=>typeof b!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${r.route.id}]`)):b({request:t,url:oN(t,e),pattern:n,params:r.params,context:d},...k!==void 0?[k]:[]),E=(async()=>{try{return{type:"data",result:await(l?l(j=>S(j)):S())}}catch(k){return{type:"error",result:k}}})();return Promise.race([E,w])};try{let b=g?r.route.action:r.route.loader;if(s||o)if(b){let _,[w]=await Promise.all([y(b).catch(S=>{_=S}),s,o]);if(_!==void 0)throw _;h=w}else{await s;let _=g?r.route.action:r.route.loader;if(_)[h]=await Promise.all([y(_),o]);else if(m==="action"){let w=new URL(t.url),S=w.pathname+w.search;throw pi(405,{method:t.method,pathname:S,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(b)h=await y(b);else{let _=new URL(t.url),w=_.pathname+_.search;throw pi(404,{pathname:w})}}catch(b){return{type:"error",result:b}}finally{p&&t.signal.removeEventListener("abort",p)}return h}async function xI(t){let e=t.headers.get("Content-Type");return e&&/\bapplication\/json\b/.test(e)?t.body==null?null:t.json():t.text()}async function _I(t){var r,s,o,l,d;let{result:e,type:n}=t;if(px(e)){let h;try{h=await xI(e)}catch(p){return{type:"error",error:p}}return n==="error"?{type:"error",error:new Kd(e.status,e.statusText,h),statusCode:e.status,headers:e.headers}:{type:"data",data:h,statusCode:e.status,headers:e.headers}}return n==="error"?WE(e)?e.data instanceof Error?{type:"error",error:e.data,statusCode:(r=e.init)==null?void 0:r.status,headers:(s=e.init)!=null&&s.headers?new Headers(e.init.headers):void 0}:{type:"error",error:kI(e),statusCode:yd(e)?e.status:void 0,headers:(o=e.init)!=null&&o.headers?new Headers(e.init.headers):void 0}:{type:"error",error:e,statusCode:yd(e)?e.status:void 0}:WE(e)?{type:"data",data:e.data,statusCode:(l=e.init)==null?void 0:l.status,headers:(d=e.init)!=null&&d.headers?new Headers(e.init.headers):void 0}:{type:"data",data:e}}function wI(t,e,n,r,s){let o=t.headers.get("Location");if(ot(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!dx(o)){let l=r.slice(0,r.findIndex(d=>d.route.id===n)+1);o=R0(new URL(e.url),l,s,o),t.headers.set("Location",o)}return t}var zE=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function BE(t,e,n,r){if(dx(t)){let s=t,o=s.startsWith("//")?new URL(e.protocol+s):new URL(s);if(zE.includes(o.protocol))throw new Error("Invalid redirect location");let l=wi(o.pathname,n)!=null;if(o.origin===e.origin&&l)return hx(o.pathname)+o.search+o.hash}try{let s=r.createURL(t);
59if(zE.includes(s.protocol))throw new Error("Invalid redirect location")}catch{}return t}function Vl(t,e,n,r){let s=t.createURL(lN(e)).toString(),o={signal:n};if(r&&ar(r.formMethod)){let{formMethod:l,formEncType:d}=r;o.method=l.toUpperCase(),d==="application/json"?(o.headers=new Headers({"Content-Type":d}),o.body=JSON.stringify(r.json)):d==="text/plain"?o.body=r.text:d==="application/x-www-form-urlencoded"&&r.formData?o.body=D0(r.formData):o.body=r.formData}return new Request(s,o)}function oN(t,e){let n=new URL(t.url),r=typeof e=="string"?ls(e):e;if(n.pathname=r.pathname||"/",r.search){let s=new URLSearchParams(r.search),o=s.getAll("index");s.delete("index");for(let l of o.filter(Boolean))s.append("index",l);n.search=s.size?`?${s.toString()}`:""}else n.search="";return n.hash=r.hash||"",n}function D0(t){let e=new URLSearchParams;for(let[n,r]of t.entries())e.append(n,typeof r=="string"?r:r.name);return e}function HE(t){let e=new FormData;for(let[n,r]of t.entries())e.append(n,r);return e}function SI(t,e,n,r=!1,s=!1){let o={},l=null,d,h=!1,p={},g=n&&Vr(n[1])?n[1].error:void 0;return t.forEach(m=>{if(!(m.route.id in e))return;let y=m.route.id,b=e[y];if(ot(!No(b),"Cannot handle redirect results in processLoaderData"),Vr(b)){let _=b.error;if(g!==void 0&&(_=g,g=void 0),l=l||{},s)l[y]=_;else{let w=Da(t,y);l[w.route.id]==null&&(l[w.route.id]=_)}r||(o[y]=eN),h||(h=!0,d=yd(b.error)?b.error.status:500),b.headers&&(p[y]=b.headers)}else o[y]=b.data,b.statusCode&&b.statusCode!==200&&!h&&(d=b.statusCode),b.headers&&(p[y]=b.headers)}),g!==void 0&&n&&(l={[n[0]]:g},n[2]&&(o[n[2]]=void 0)),{loaderData:o,errors:l,statusCode:d||200,loaderHeaders:p}}function qE(t,e,n,r,s,o,l){let{loaderData:d,errors:h}=SI(e,n,r);return s.filter(p=>!p.matches||p.matches.some(g=>g.shouldLoad)).forEach(p=>{let{key:g,match:m,controller:y}=p;if(y&&y.signal.aborted)return;let b=o[g];if(ot(b,"Did not find corresponding fetcher result"),Vr(b)){let _=Da(t.matches,m==null?void 0:m.route.id);h&&h[_.route.id]||(h={...h,[_.route.id]:b.error}),l.delete(g)}else if(No(b))ot(!1,"Unhandled fetcher revalidation redirect");else{let _=Zi(b.data);l.set(g,_)}}),{loaderData:d,errors:h}}function GE(t,e,n,r){let s=Object.entries(e).filter(([,o])=>o!==eN).reduce((o,[l,d])=>(o[l]=d,o),{});for(let o of n){let l=o.route.id;if(!e.hasOwnProperty(l)&&t.hasOwnProperty(l)&&o.route.loader&&(s[l]=t[l]),r&&r.hasOwnProperty(l))break}return s}function VE(t){return t?Vr(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function Da(t,e){return(e?t.slice(0,t.findIndex(r=>r.route.id===e)+1):[...t]).reverse().find(r=>r.route.hasErrorBoundary===!0)||t[0]}function Of(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function pi(t,{pathname:e,routeId:n,method:r,type:s,message:o}={}){let l="Unknown Server Error",d="Unknown @remix-run/router error";return t===400?(l="Bad Request",r&&e&&n?d=`You made a ${r} request to "${e}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:s==="invalid-body"&&(d="Unable to encode submission body")):t===403?(l="Forbidden",d=`Route "${n}" does not match URL "${e}"`):t===404?(l="Not Found",d=`No route matches URL "${e}"`):t===405&&(l="Method Not Allowed",r&&e&&n?d=`You made a ${r.toUpperCase()} request to "${e}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(d=`Invalid request method "${r.toUpperCase()}"`)),new Kd(t||500,l,new Error(d),!0)}function Df(t){let e=Object.entries(t);for(let n=e.length-1;n>=0;n--){let[r,s]=e[n];if(No(s))return{key:r,result:s}}}function lN(t){let e=typeof t=="string"?ls(t):t;return is({...e,hash:""})}function EI(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function kI(t){var e,n;return new Kd(((e=t.init)==null?void 0:e.status)??500,((n=t.init)==null?void 0:n.statusText)??"Internal Server Error",t.data)}function jI(t){return t!=null&&typeof t=="object"&&Object.entries(t).every(([e,n])=>typeof e=="string"&&TI(n))}function TI(t){return t!=null&&typeof t=="object"&&"type"in t&&"result"in t&&(t.type==="data"||t.type==="error")}function NI(t){return px(t.result)&&Z2.has(t.result.status)}function Vr(t){return t.type==="error"}function No(t){return(t&&t.type)==="redirect"}function WE(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function px(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function AI(t){return Z2.has(t)}function CI(t){return px(t)&&AI(t.status)&&t.headers.has("Location")}function RI(t){return aI.has(t.toUpperCase())}function ar(t){return iI.has(t.toUpperCase())}function mx(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function cp(t,e){let n=typeof e=="string"?ls(e).search:e.search;if(t[t.length-1].route.index&&mx(n||""))return t[t.length-1];let r=W2(t);return r[r.length-1]}function YE(t){let{formMethod:e,formAction:n,formEncType:r,text:s,formData:o,json:l}=t;if(!(!e||!n||!r)){if(s!=null)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:void 0,text:s};if(o!=null)return{formMethod:e,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(l!==void 0)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:l,text:void 0}}}function py(t,e,n,r){return r?{state:"loading",location:t,matches:e,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:"loading",location:t,matches:e,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function OI(t,e,n,r){return{state:"submitting",location:t,matches:e,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function Tu(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function DI(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function Zi(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function II(t,e){try{let n=t.sessionStorage.getItem(Q2);if(n){let r=JSON.parse(n);for(let[s,o]of Object.entries(r||{}))o&&Array.isArray(o)&&e.set(s,new Set(o||[]))}}catch{}}function MI(t,e){if(e.size>0){let n={};for(let[r,s]of e)n[r]=[...s];try{t.sessionStorage.setItem(Q2,JSON.stringify(n))}catch(r){vn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function KE(){let t,e,n=new Promise((r,s)=>{t=async o=>{r(o);try{await n}catch{}},e=async o=>{s(o);try{await n}catch{}}});return{promise:n,resolve:t,reject:e}}var Uo=T.createContext(null);Uo.displayName="DataRouter";var Xd=T.createContext(null);Xd.displayName="DataRouterState";var cN=T.createContext(!1);function uN(){return T.useContext(cN)}var gx=T.createContext({isTransitioning:!1});gx.displayName="ViewTransition";var dN=T.createContext(new Map);dN.displayName="Fetchers";var LI=T.createContext(null);LI.displayName="Await";var Zr=T.createContext(null);Zr.displayName="Navigation";var Tm=T.createContext(null);Tm.displayName="Location";var Bi=T.createContext({outlet:null,matches:[],isDataRoute:!1});Bi.displayName="Route";var vx=T.createContext(null);vx.displayName="RouteError";var hN="REACT_ROUTER_ERROR",PI="REDIRECT",FI="ROUTE_ERROR_RESPONSE";function $I(t){if(t.startsWith(`${hN}:${PI}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="str
59ing"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function UI(t){if(t.startsWith(`${hN}:${FI}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new Kd(e.status,e.statusText,e.data)}catch{}}function zI(t,{relative:e}={}){ot(jc(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=T.useContext(Zr),{hash:s,pathname:o,search:l}=Zd(t,{relative:e}),d=o;return n!=="/"&&(d=o==="/"?n:vi([n,o])),r.createHref({pathname:d,search:l,hash:s})}function jc(){return T.useContext(Tm)!=null}function Mr(){return ot(jc(),"useLocation() may be used only in the context of a <Router> component."),T.useContext(Tm).location}var fN="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function pN(t){T.useContext(Zr).static||T.useLayoutEffect(t)}function Lr(){let{isDataRoute:t}=T.useContext(Bi);return t?tM():BI()}function BI(){ot(jc(),"useNavigate() may be used only in the context of a <Router> component.");let t=T.useContext(Uo),{basename:e,navigator:n}=T.useContext(Zr),{matches:r}=T.useContext(Bi),{pathname:s}=Mr(),o=JSON.stringify(jm(r)),l=T.useRef(!1);return pN(()=>{l.current=!0}),T.useCallback((h,p={})=>
59{if(vn(l.current,fN),!l.current)return;if(typeof h=="number"){n.go(h);return}let g=Yd(h,JSON.parse(o),s,p.relative==="path");t==null&&e!=="/"&&(g.pathname=g.pathname==="/"?e:vi([e,g.pathname])),(p.replace?n.replace:n.push)(g,p.state,p)},[e,n,o,s,t])}var HI=T.createContext(null);function qI(t){let e=T.useContext(Bi).outlet;return T.useMemo(()=>e&&T.createElement(HI.Provider,{value:t},e),[e,t])}function Zd(t,{relative:e}={}){let{matches:n}=T.useContext(Bi),{pathname:r}=Mr(),s=JSON.stringify(jm(n));return T.useMemo(()=>Yd(t,JSON.parse(s),r,e==="path"),[t,s,r,e])}function GI(t,e,n){ot(jc(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=T.useContext(Zr),{matches:s}=T.useContext(Bi),o=s[s.length-1],l=o?o.params:{},d=o?o.pathname:"/",h=o?o.pathnameBase:"/",p=o&&o.route;{let S=p&&p.path||"";vN(d,!p||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${S}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
60
61Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let g=Mr(),m;m=g;let y=m.pathname||"/",b=y;if(h!=="/"){let S=h.replace(/^\//,"").split("/");b="/"+y.replace(/^\//,"").split("/").slice(S.length).join("/")}let _=n&&n.state.matches.length?n.state.matches.map(S=>Object.assign(S,{route:n.manifest[S.route.id]||S.route})):H2(t,{pathname:b});return vn(p||_!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),vn(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),JI(_&&_.map(S=>Object.assign({},S,{params:Object.assign({},l,S.params),pathname:vi([h,r.encodeLocation?r.encodeLocation(S.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?h:vi([h,r.encodeLocation?r.encodeLocation(S.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),s,n)}function VI(){let t=gN(),e=yd(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",t),l=T.createElement(T.Fragment,null,T.createElement("p",null,"💿 Hey developer 👋"),T.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",T.createElement("code",{style:o},"ErrorBoundary")," or"," ",T.createElement("code",{style:o},"errorElement")," prop on your route.")),T.createElement(T.Fragment,null,T.createElement("h2",null,"Unexpected Application Error!"),T.createElement("h3",{style:{fontStyle:"italic"}},e),n?T.createElement("pre",{style:s},n):null,l)}var WI=T.createElement(VI,null),mN=class extends T.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=UI(t.digest);n&&(t=n)}let e=t!==void 0?T.createElement(Bi.Provider,{value:this.props.routeContext},T.createElement(vx.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?T.createElement(YI,{error:t},e):e}};mN.contextType=cN;var my=new WeakMap;function YI({children:t,error:e}){let{basename:n}=T.useContext(Zr);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=$I(e.digest);if(r){let s=my.get(e);if(s)throw s;let o=K2(r.location,n);if(Y2&&!my.get(e))if(o.isExternal||r.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:r.replace}));throw my.set(e,l),l}return T.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return t}function KI({routeContext:t,match:e,children:n}){let r=T.useContext(Uo);return r&&r.static&&r.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=e.route.id),T.createElement(Bi.Provider,{value:t},n)}function JI(t,e=[],n){let r=n==null?void 0:n.state;if(t==null){if(!r)return null;if(r.errors)t=r.matches;else if(e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let s=t,o=r==null?void 0:r.errors;if(o!=null){let g=s.findIndex(m=>m.route.id&&(o==null?void 0:o[m.route.id])!==void 0);ot(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),s=s.slice(0,Math.min(s.length,g+1))}let l=!1,d=-1;if(n&&r){l=r.renderFallback;for(let g=0;g<s.length;g++){let m=s[g];
61if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(d=g),m.route.id){let{loaderData:y,errors:b}=r,_=m.route.loader&&!y.hasOwnProperty(m.route.id)&&(!b||b[m.route.id]===void 0);if(m.route.lazy||_){n.isStatic&&(l=!0),d>=0?s=s.slice(0,d+1):s=[s[0]];break}}}}let h=n==null?void 0:n.onError,p=r&&h?(g,m)=>{var y,b;h(g,{location:r.location,params:((b=(y=r.matches)==null?void 0:y[0])==null?void 0:b.params)??{},pattern:Jd(r.matches),errorInfo:m})}:void 0;return s.reduceRight((g,m,y)=>{let b,_=!1,w=null,S=null;r&&(b=o&&m.route.id?o[m.route.id]:void 0,w=m.route.errorElement||WI,l&&(d<0&&y===0?(vN("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),_=!0,S=null):d===y&&(_=!0,S=m.route.hydrateFallbackElement||null)));let E=e.concat(s.slice(0,y+1)),k=()=>{let j;return b?j=w:_?j=S:m.route.Component?j=T.createElement(m.route.Component,null):m.route.element?j=m.route.element:j=g,T.createElement(KI,{match:m,routeContext:{outlet:g,matches:E,isDataRoute:r!=null},children:j})};return r&&(m.route.ErrorBoundary||m.route.errorElement||y===0)?T.createElement(mN,{location:r.location,revalidation:r.revalidation,component:w,error:b,children:k(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:p}):k()},null)}function yx(t){return`${t} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function XI(t){let e=T.useContext(Uo);return ot(e,yx(t)),e}function ZI(t){let e=T.useContext(Xd);return ot(e,yx(t)),e}function QI(t){let e=T.useContext(Bi);return ot(e,yx(t)),e}function bx(t){let e=QI(t),n=e.matches[e.matches.length-1];return ot(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function eM(){return bx("useRouteId")}function gN(){var r;let t=T.useContext(vx),e=ZI("useRouteError"),n=bx("useRouteError");return t!==void 0?t:(r=e.errors)==null?void 0:r[n]}function tM(){let{router:t}=XI("useNavigate"),e=bx("useNavigate"),n=T.useRef(!1);return pN(()=>{n.current=!0}),T.useCallback(async(s,o={})=>{vn(n.current,fN),n.current&&(typeof s=="number"?await t.navigate(s):await t.navigate(s,{fromRouteId:e,...o}))},[t,e])}var JE={};function vN(t,e,n){!e&&!JE[t]&&(JE[t]=!0,vn(!1,n))}var XE={};function ZE(t,e){!t&&!XE[e]&&(XE[e]=!0,console.warn(e))}var nM="useOptimistic",QE=b4[nM],rM=()=>{};function iM(t){return QE?QE(t):[t,rM]}function sM(t){let e={hasErrorBoundary:t.hasErrorBoundary||t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&(t.element&&vn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(e,{element:T.createElement(t.Component),Component:void 0})),t.HydrateFallback&&(t.hydrateFallbackElement&&vn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(e,{hydrateFallbackElement:T.createElement(t.HydrateFallback),HydrateFallback:void 0})),t.ErrorBoundary&&(t.errorElement&&vn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(e,{errorElement:T.createElement(t.ErrorBoundary),ErrorBoundary:void 0})),e}var aM=["HydrateFallback","hydrateFallbackElement"],oM=class{constructor(){this.status="pending",this.promise=new Promise((e,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}};function lM({router:t,flushSync:e,onError:n,useTransitions:r}){r=uN()||r;let[o,l]=T.useState(t.state),[d,h]=iM(o),[p,g]=T.useState(),[m,y]=T.useState({isTransitioning:!1}),[b,_]=T.useState(),[w,S]=T.useState(),[E,k]=T.useState(),j=T.useRef(new Map),N=T.useCallback((R,{deletedFetchers:B,newErrors:M,flushSync:V,viewTransitionOpts:W})=>{M&&n&&Object.values(M).forEach(K=>{var te;return n(K,{location:R.location,params:((te=R.matches[0])==null?void 0:te.params)??{},pattern:Jd(R.matches)})}),R.fetchers.forEach((K,te)=>{K.data!==void 0&&j.current.set(te,K.data)}),B.forEach(K=>j.current.delete(K)),ZE(V===!1||e!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable.  Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let Q=t.window!=null&&t.window.document!=null&&typeof t.window.document.startViewTransition=="function";if(ZE(W==null||Q,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!W||!Q){e&&V?e(()=>l(R)):r===!1?l(R):T.startTransition(()=>{r===!0&&h(K=>ek(K,R)),l(R)});return}if(e&&V){e(()=>{w&&(b==null||b.resolve(),w.skipTransition()),y({isTransitioning:!0,flushSync:!0,currentLocation:W.currentLocation,nextLocation:W.nextLocation})});
61let K=t.window.document.startViewTransition(()=>{e(()=>l(R))});K.finished.finally(()=>{e(()=>{_(void 0),S(void 0),g(void 0),y({isTransitioning:!1})})}),e(()=>S(K));return}w?(b==null||b.resolve(),w.skipTransition(),k({state:R,currentLocation:W.currentLocation,nextLocation:W.nextLocation})):(g(R),y({isTransitioning:!0,flushSync:!1,currentLocation:W.currentLocation,nextLocation:W.nextLocation}))},[t.window,e,w,b,r,h,n]);T.useLayoutEffect(()=>t.subscribe(N),[t,N]),T.useEffect(()=>{m.isTransitioning&&!m.flushSync&&_(new oM)},[m]),T.useEffect(()=>{if(b&&p&&t.window){let R=p,B=b.promise,M=t.window.document.startViewTransition(async()=>{r===!1?l(R):T.startTransition(()=>{r===!0&&h(V=>ek(V,R)),l(R)}),await B});M.finished.finally(()=>{_(void 0),S(void 0),g(void 0),y({isTransitioning:!1})}),S(M)}},[p,b,t.window,r,h]),T.useEffect(()=>{b&&p&&d.location.key===p.location.key&&b.resolve()},[b,w,d.location,p]),T.useEffect(()=>{!m.isTransitioning&&E&&(g(E.state),y({isTransitioning:!0,flushSync:!1,currentLocation:E.currentLocation,nextLocation:E.nextLocation}),k(void 0))},[m.isTransitioning,E]);let O=T.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:R=>t.navigate(R),push:(R,B,M)=>t.navigate(R,{state:B,preventScrollReset:M==null?void 0:M.preventScrollReset}),replace:(R,B,M)=>t.navigate(R,{replace:!0,state:B,preventScrollReset:M==null?void 0:M.preventScrollReset})}),[t]),D=t.basename||"/",F=T.useMemo(()=>({router:t,navigator:O,static:!1,basename:D,onError:n}),[t,O,D,n]);return T.createElement(T.Fragment,null,T.createElement(Uo.Provider,{value:F},T.createElement(Xd.Provider,{value:d},T.createElement(dN.Provider,{value:j.current},T.createElement(gx.Provider,{value:m},T.createElement(dM,{basename:D,location:d.location,navigationType:d.historyAction,navigator:O,useTransitions:r},T.createElement(cM,{routes:t.routes,manifest:t.manifest,future:t.future,state:d,isStatic:!1,onError:n})))))),null)}function ek(t,e){return{...t,navigation:e.navigation.state!=="idle"?e.navigation:t.navigation,revalidation:e.revalidation!=="idle"?e.revalidation:t.revalidation,actionData:e.navigation.state!=="submitting"?e.actionData:t.actionData,fetchers:e.fetchers}}var cM=T.memo(uM);function uM({routes:t,manifest:e,future:n,state:r,isStatic:s,onError:o}){return GI(t,void 0,{manifest:e,state:r,isStatic:s,onError:o})}function Qd({to:t,replace:e,state:n,relative:r}){ot(jc(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=T.useContext(Zr);vn(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=T.useContext(Bi),{pathname:l}=Mr(),d=Lr(),h=Yd(t,jm(o),l,r==="path"),p=JSON.stringify(h);return T.useEffect(()=>{d(JSON.parse(p),{replace:e,state:n,relative:r})},[d,p,r,e,n]),null}function yN(t){return qI(t.context)}function dM({basename:t="/",children:e=null,location:n,navigationType:r="POP",navigator:s,static:o=!1,useTransitions:l}){ot(!jc(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=t.replace(/^\/*/,"/"),h=T.useMemo(()=>({basename:d,navigator:s,static:o,useTransitions:l,future:{}}),[d,s,o,l]);typeof n=="string"&&(n=ls(n));let{pathname:p="/",search:g="",hash:m="",state:y=null,key:b="default",mask:_}=n,w=T.useMemo(()=>{let S=wi(p,d);return S==null?null:{location:{pathname:S,search:g,hash:m,state:y,key:b,mask:_},navigationType:r}},[d,p,g,m,y,b,r,_]);return vn(w!=null,`<Router basename="${d}"> is not able to match the URL "${p}${g}${m}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:T.createElement(Zr.Provider,{value:h},T.createElement(Tm.Provider,{children:e,value:w}))}var up="get",dp="application/x-www-form-urlencoded";function Nm(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function hM(t){return Nm(t)&&t.tagName.toLowerCase()==="button"}function fM(t){return Nm(t)&&t.tagName.toLowerCase()==="form"}function pM(t){return Nm(t)&&t.tagName.toLowerCase()==="input"}function mM(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function gM(t,e){return t.button===0&&(!e||e==="_self")&&!mM(t)}function I0(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function vM(t,e){let n=I0(t);return e&&e.forEach((r,s)=>
61{n.has(s)||e.getAll(s).forEach(o=>{n.append(s,o)})}),n}var If=null;function yM(){if(If===null)try{new FormData(document.createElement("form"),0),If=!1}catch{If=!0}return If}var bM=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function gy(t){return t!=null&&!bM.has(t)?(vn(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${dp}"`),null):t}function xM(t,e){let n,r,s,o,l;if(fM(t)){let d=t.getAttribute("action");r=d?wi(d,e):null,n=t.getAttribute("method")||up,s=gy(t.getAttribute("enctype"))||dp,o=new FormData(t)}else if(hM(t)||pM(t)&&(t.type==="submit"||t.type==="image")){let d=t.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=t.getAttribute("formaction")||d.getAttribute("action");if(r=h?wi(h,e):null,n=t.getAttribute("formmethod")||d.getAttribute("method")||up,s=gy(t.getAttribute("formenctype"))||gy(d.getAttribute("enctype"))||dp,o=new FormData(d,t),!yM()){let{name:p,type:g,value:m}=t;if(g==="image"){let y=p?`${p}.`:"";o.append(`${y}x`,"0"),o.append(`${y}y`,"0")}else p&&o.append(p,m)}}else{if(Nm(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=up,r=null,s=dp,l=t}return o&&s==="text/plain"&&(l=o,o=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:o,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function xx(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function bN(t,e,n,r){let s=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${r}`:s.pathname=`${s.pathname}.${r}`:s.pathname==="/"?s.pathname=`_root.${r}`:e&&wi(s.pathname,e)==="/"?s.pathname=`${Rp(e)}/_root.${r}`:s.pathname=`${Rp(s.pathname)}.${r}`,s}async function _M(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function wM(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function SM(t,e,n){let r=await Promise.all(t.map(async s=>{let o=e.routes[s.route.id];if(o){let l=await _M(o,n);return l.links?l.links():[]}return[]}));return TM(r.flat(1).filter(wM).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function tk(t,e,n,r,s,o){let l=(h,p)=>n[p]?h.route.id!==n[p].route.id:!0,d=(h,p)=>{var g;return n[p].pathname!==h.pathname||((g=n[p].route.path)==null?void 0:g.endsWith("*"))&&n[p].params["*"]!==h.params["*"]};return o==="assets"?e.filter((h,p)=>l(h,p)||d(h,p)):o==="data"?e.filter((h,p)=>{var m;let g=r.routes[h.route.id];if(!g||!g.hasLoader)return!1;if(l(h,p)||d(h,p))return!0;if(h.route.shouldRevalidate){let y=h.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((m=n[0])==null?void 0:m.params)||{},nextUrl:new URL(t,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function EM(t,e,{includeHydrateFallback:n}={}){return kM(t.map(r=>{let s=e.routes[r.route.id];if(!s)return[];let o=[s.module];return s.clientActionModule&&(o=o.concat(s.clientActionModule)),s.clientLoaderModule&&(o=o.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(o=o.concat(s.hydrateFallbackModule)),s.imports&&(o=o.concat(s.imports)),o}).flat(1))}function kM(t){return[...new Set(t)]}function jM(t){let e={},n=Object.keys(t).sort();for(let r of n)e[r]=t[r];return e}function TM(t,e){let n=new Set;return new Set(e),t.reduce((r,s)=>{let o=JSON.stringify(jM(s));return n.has(o)||(n.add(o),r.push({key:o,link:s})),r},[])}function _x(){let t=T.useContext(Uo);return xx(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function NM(){let t=T.useContext(Xd);return xx(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var wx=T.createContext(void 0);wx.displayName="FrameworkContext";function Sx(){let t=T.useContext(wx);return xx(t,"You must render this element inside a <HydratedRouter> element"),t}function AM(t,e){let n=T.useContext(wx),[r,s]=T.useState(!1),[o,l]=T.useState(!1),{onFocus:d,onBlur:h,onMouseEnter:p,onMouseLeave:g,onTouchStart:m}=e,y=T.useRef(null);T.useEffect(()=>{if(t==="render"&&l(!0),t==="viewport"){let w=E=>
61{E.forEach(k=>{l(k.isIntersecting)})},S=new IntersectionObserver(w,{threshold:.5});return y.current&&S.observe(y.current),()=>{S.disconnect()}}},[t]),T.useEffect(()=>{if(r){let w=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(w)}}},[r]);let b=()=>{s(!0)},_=()=>{s(!1),l(!1)};return n?t!=="intent"?[o,y,{}]:[o,y,{onFocus:Nu(d,b),onBlur:Nu(h,_),onMouseEnter:Nu(p,b),onMouseLeave:Nu(g,_),onTouchStart:Nu(m,b)}]:[!1,y,{}]}function Nu(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function CM({page:t,...e}){let n=uN(),{router:r}=_x(),s=T.useMemo(()=>H2(r.routes,t,r.basename),[r.routes,t,r.basename]);return s?n?T.createElement(OM,{page:t,matches:s,...e}):T.createElement(DM,{page:t,matches:s,...e}):null}function RM(t){let{manifest:e,routeModules:n}=Sx(),[r,s]=T.useState([]);return T.useEffect(()=>{let o=!1;return SM(t,e,n).then(l=>{o||s(l)}),()=>{o=!0}},[t,e,n]),r}function OM({page:t,matches:e,...n}){let r=Mr(),{future:s}=Sx(),{basename:o}=_x(),l=T.useMemo(()=>{if(t===r.pathname+r.search+r.hash)return[];let d=bN(t,o,s.unstable_trailingSlashAwareDataRequests,"rsc"),h=!1,p=[];for(let g of e)typeof g.route.shouldRevalidate=="function"?h=!0:p.push(g.route.id);return h&&p.length>0&&d.searchParams.set("_routes",p.join(",")),[d.pathname+d.search]},[o,s.unstable_trailingSlashAwareDataRequests,t,r,e]);return T.createElement(T.Fragment,null,l.map(d=>T.createElement("link",{key:d,rel:"prefetch",as:"fetch",href:d,...n})))}function DM({page:t,matches:e,...n}){let r=Mr(),{future:s,manifest:o,routeModules:l}=Sx(),{basename:d}=_x(),{loaderData:h,matches:p}=NM(),g=T.useMemo(()=>tk(t,e,p,o,r,"data"),[t,e,p,o,r]),m=T.useMemo(()=>tk(t,e,p,o,r,"assets"),[t,e,p,o,r]),y=T.useMemo(()=>{if(t===r.pathname+r.search+r.hash)return[];let w=new Set,S=!1;if(e.forEach(k=>{var N;let j=o.routes[k.route.id];!j||!j.hasLoader||(!g.some(O=>O.route.id===k.route.id)&&k.route.id in h&&((N=l[k.route.id])!=null&&N.shouldRevalidate)||j.hasClientLoader?S=!0:w.add(k.route.id))}),w.size===0)return[];let E=bN(t,d,s.unstable_trailingSlashAwareDataRequests,"data");return S&&w.size>0&&E.searchParams.set("_routes",e.filter(k=>w.has(k.route.id)).map(k=>k.route.id).join(",")),[E.pathname+E.search]},[d,s.unstable_trailingSlashAwareDataRequests,h,r,o,g,e,t,l]),b=T.useMemo(()=>EM(m,o),[m,o]),_=RM(m);return T.createElement(T.Fragment,null,y.map(w=>T.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),b.map(w=>T.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),_.map(({key:w,link:S})=>T.createElement("link",{key:w,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function IM(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var MM=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{MM&&(window.__reactRouterVersion="7.15.1")}catch{}function LM(t,e){return dI({basename:e==null?void 0:e.basename,getContext:e==null?void 0:e.getContext,future:e==null?void 0:e.future,history:j4({window:e==null?void 0:e.window}),hydrationData:PM(),routes:t,mapRouteProperties:sM,hydrationRouteProperties:aM,dataStrategy:e==null?void 0:e.dataStrategy,patchRoutesOnNavigation:e==null?void 0:e.patchRoutesOnNavigation,window:e==null?void 0:e.window,instrumentations:e==null?void 0:e.instrumentations}).initialize()}function PM(){let t=window==null?void 0:window.__staticRouterHydrationData;return t&&t.errors&&(t={...t,errors:FM(t.errors)}),t}function FM(t){if(!t)return null;let e=Object.entries(t),n={};for(let[r,s]of e)if(s&&s.__type==="RouteErrorResponse")n[r]=new Kd(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let o=window[s.__subType];if(typeof o=="function")try{let l=new o(s.message);l.stack="",n[r]=l}catch{}}if(n[r]==null){let o=new Error(s.message);o.stack="",n[r]=o}}else n[r]=s;return n}var xN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Kt=T.forwardRef(function({onClick:e,discover:n="render",prefetch:r="none",relative:s,reloadDocument:o,replace:l,mask:d,state:h,target:p,to:g,preventScrollReset:m,viewTransition:y,defaultShouldRevalidate:b,..._},w){let{basename:S,navigator:E,useTransitions:k}=T.useContext(Zr),j=typeof g=="string"&&xN.test(g),N=K2(g,S);g=N.to;let O=zI(g,{relative:s}),D=Mr(),F=null;if(d){let te=Yd(d,[],D.mask?D.mask.pathname:"/",!0);S!=="/"&&(te.pathname=te.pathname==="/"?S:vi([S,te.pathname])),F=E.createHref(te)}let[R,B,M]=AM(r,_),V=zM(g,{replace:l,mask:d,state:h,target:p,preventScrollReset:m,relative:s,viewTransition:y,defaultShouldRevalidate:b,useTransitions:k});function W(te){e&&e(te),te.defaultPrevented||V(te)}let Q=!(N.isExternal||o),K=T.createElement("a",{..._,...M,href:(Q?F:void 0)||N.absoluteURL||O,onClick:Q?W:e,ref:IM(w,B),target:p,"data-discover":!j&&n==="render"?"true":void 0});return R&&!j?T.createElement(T.Fragment,null,K,T.createElement(CM,{page:O})):K});Kt.displayName="Link";var Ri=T.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:r="",end:s=!1,style:o,to:l,viewTransition:d,children:h,...p},g){let m=Zd(l,{relative:p.relative}),y=Mr(),b=T.useContext(Xd),{navigator:_,basename:w}=T.useContext(Zr),S=b!=null&&VM(m)&&d===!0,E=_.encodeLocation?_.encodeLocation(m).pathname:m.pathname,k=y.pathname,j=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(k=k.toLowerCase(),j=j?j.toLowerCase():null,E=E.toLowerCase()),j&&w&&(j=wi(j,w)||j);const N=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let O=k===E||!s&&k.startsWith(E)&&k.charAt(N)==="/",D=j!=null&&(j===E||!s&&j.startsWith(E)&&j.charAt(E.length)==="/"),F={isActive:O,isPending:D,isTransitioning:S},R=O?e:void 0,B;typeof r=="function"?B=r(F):B=[r,O?"active":null,D?"pending":null,S?"transitioning":null].filter(
61Boolean).join(" ");let M=typeof o=="function"?o(F):o;return T.createElement(Kt,{...p,"aria-current":R,className:B,ref:g,style:M,to:l,viewTransition:d},typeof h=="function"?h(F):h)});Ri.displayName="NavLink";var $M=T.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:r,replace:s,state:o,method:l=up,action:d,onSubmit:h,relative:p,preventScrollReset:g,viewTransition:m,defaultShouldRevalidate:y,...b},_)=>{let{useTransitions:w}=T.useContext(Zr),S=qM(),E=GM(d,{relative:p}),k=l.toLowerCase()==="get"?"get":"post",j=typeof d=="string"&&xN.test(d),N=O=>{if(h&&h(O),O.defaultPrevented)return;O.preventDefault();let D=O.nativeEvent.submitter,F=(D==null?void 0:D.getAttribute("formmethod"))||l,R=()=>S(D||O.currentTarget,{fetcherKey:e,method:F,navigate:n,replace:s,state:o,relative:p,preventScrollReset:g,viewTransition:m,defaultShouldRevalidate:y});w&&n!==!1?T.startTransition(()=>R()):R()};return T.createElement("form",{ref:_,method:k,action:E,onSubmit:r?h:N,...b,"data-discover":!j&&t==="render"?"true":void 0})});$M.displayName="Form";function UM(t){return`${t} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function _N(t){let e=T.useContext(Uo);return ot(e,UM(t)),e}function zM(t,{target:e,replace:n,mask:r,state:s,preventScrollReset:o,relative:l,viewTransition:d,defaultShouldRevalidate:h,useTransitions:p}={}){let g=Lr(),m=Mr(),y=Zd(t,{relative:l});return T.useCallback(b=>{if(gM(b,e)){b.preventDefault();let _=n!==void 0?n:is(m)===is(y),w=()=>g(t,{replace:_,mask:r,state:s,preventScrollReset:o,relative:l,viewTransition:d,defaultShouldRevalidate:h});p?T.startTransition(()=>w()):w()}},[m,g,y,n,r,s,e,t,o,l,d,h,p])}function wN(t){vn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let e=T.useRef(I0(t)),n=T.useRef(!1),r=Mr(),s=T.useMemo(()=>vM(r.search,n.current?null:e.current),[r.search]),o=Lr(),l=T.useCallback((d,h)=>{const p=I0(typeof d=="function"?d(new URLSearchParams(s)):d);n.current=!0,o("?"+p,h)},[o,s]);return[s,l]}var BM=0,HM=()=>`__${String(++BM)}__`;function qM(){let{router:t}=_N("useSubmit"),{basename:e}=T.useContext(Zr),n=eM(),r=t.fetch,s=t.navigate;return T.useCallback(async(o,l={})=>{let{action:d,method:h,encType:p,formData:g,body:m}=xM(o,e);if(l.navigate===!1){let y=l.fetcherKey||HM();await r(y,n,l.action||d,{defaultShouldRevalidate:l.defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:g,body:m,formMethod:l.method||h,formEncType:l.encType||p,flushSync:l.flushSync})}else await s(l.action||d,{defaultShouldRevalidate:l.defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:g,body:m,formMethod:l.method||h,formEncType:l.encType||p,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,s,e,n])}function GM(t,{relative:e}={}){let{basename:n}=T.useContext(Zr),r=T.useContext(Bi);ot(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),o={...Zd(t||".",{relative:e})},l=Mr();if(t==null){o.search=l.search;let d=new URLSearchParams(o.search),h=d.getAll("index");if(h.some(g=>g==="")){d.delete("index"),h.filter(m=>m).forEach(m=>d.append("index",m));let g=d.toString();o.search=g?`?${g}`:""}}return(!t||t===".")&&s.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:vi([n,o.pathname])),is(o)}function VM(t,{relative:e}={}){let n=T.useContext(gx);ot(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=_N("useViewTransitionState"),s=Zd(t,{relative:e});if(!n.isTransitioning)return!1;let o=wi(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=wi(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Cp(s.pathname,l)!=null||Cp(s.pathname,o)!=null}var tc=$2();function WM(t){return T.createElement(lM,{flushSync:tc.flushSync,...t})}function Am(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n}function YM(t,e,n,r){function s(o){return o instanceof n?o:new n(function(l){l(o)})}
61return new(n||(n=Promise))(function(o,l){function d(g){try{p(r.next(g))}catch(m){l(m)}}function h(g){try{p(r.throw(g))}catch(m){l(m)}}function p(g){g.done?o(g.value):s(g.value).then(d,h)}p((r=r.apply(t,e||[])).next())})}const KM=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);class Ex extends Error{constructor(e,n="FunctionsError",r){super(e),this.name=n,this.context=r}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class JM extends Ex{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class nk extends Ex{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class rk extends Ex{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var M0;(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"})(M0||(M0={}));class XM{constructor(e,{headers:n={},customFetch:r,region:s=M0.Any}={}){this.url=e,this.headers=n,this.region=s,this.fetch=KM(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return YM(this,arguments,void 0,function*(n,r={}){var s;let o,l;try{const{headers:d,method:h,body:p,signal:g,timeout:m}=r;let y={},{region:b}=r;b||(b=this.region);const _=new URL(`${this.url}/${n}`);b&&b!=="any"&&(y["x-region"]=b,_.searchParams.set("forceFunctionRegion",b));let w;p&&(d&&!Object.prototype.hasOwnProperty.call(d,"Content-Type")||!d)?typeof Blob<"u"&&p instanceof Blob||p instanceof ArrayBuffer?(y["Content-Type"]="application/octet-stream",w=p):typeof p=="string"?(y["Content-Type"]="text/plain",w=p):typeof FormData<"u"&&p instanceof FormData?w=p:(y["Content-Type"]="application/json",w=JSON.stringify(p)):p&&typeof p!="string"&&!(typeof Blob<"u"&&p instanceof Blob)&&!(p instanceof ArrayBuffer)&&!(typeof FormData<"u"&&p instanceof FormData)?w=JSON.stringify(p):w=p;let S=g;m&&(l=new AbortController,o=setTimeout(()=>l.abort(),m),g?(S=l.signal,g.addEventListener("abort",()=>l.abort())):S=l.signal);const E=yield this.fetch(_.toString(),{method:h||"POST",headers:Object.assign(Object.assign(Object.assign({},y),this.headers),d),body:w,signal:S}).catch(O=>{throw new JM(O)}),k=E.headers.get("x-relay-error");if(k&&k==="true")throw new nk(E);if(!E.ok)throw new rk(E);let j=((s=E.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),N;return j==="application/json"?N=yield E.json():j==="application/octet-stream"||j==="application/pdf"?N=yield E.blob():j==="text/event-stream"?N=E:j==="multipart/form-data"?N=yield E.formData():N=yield E.text(),{data:N,error:null,response:E}}catch(d){return{data:null,error:d,response:d instanceof rk||d instanceof nk?d.context:void 0}}finally{o&&clearTimeout(o)}})}}const SN=3,ik=t=>Math.min(1e3*2**t,3e4),ZM=[520,503],EN=["GET","HEAD","OPTIONS"];var QM=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.co
61de=t.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function sk(t,e){return new Promise(n=>{if(e!=null&&e.aborted){n();return}const r=setTimeout(()=>{e==null||e.removeEventListener("abort",s),n()},t);function s(){clearTimeout(r),n()}e==null||e.addEventListener("abort",s)})}function e3(t,e,n,r){return!(!r||n>=SN||!EN.includes(t)||!ZM.includes(e))}var t3=class{constructor(t){var e,n,r,s,o;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=(n=t.isMaybeSingle)!==null&&n!==void 0?n:!1,this.shouldStripNulls=(r=t.shouldStripNulls)!==null&&r!==void 0?r:!1,this.urlLengthLimit=(s=t.urlLengthLimit)!==null&&s!==void 0?s:8e3,this.retryEnabled=(o=t.retry)!==null&&o!==void 0?o:!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 n=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 l=this.headers.get("Accept");l==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!l||l==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const r=this.fetch;let o=(async()=>{let l=0;for(;;){const p=new Headers(n.headers);l>0&&p.set("X-Retry-Count",String(l));let g;try{g=await r(n.url.toString(),{method:n.method,headers:p,body:JSON.stringify(n.body,(m,y)=>typeof y=="bigint"?y.toString():y),signal:n.signal})}catch(m){if((m==null?void 0:m.name)==="AbortError"||(m==null?void 0:m.code)==="ABORT_ERR"||!EN.includes(n.method))throw m;if(n.retryEnabled&&l<SN){const y=ik(l);l++,await sk(y,n.signal);continue}throw m}if(e3(n.method,g.status,l,n.retryEnabled)){var d,h;const m=(d=(h=g.headers)===null||h===void 0?void 0:h.get("Retry-After"))!==null&&d!==void 0?d:null,y=m!==null?Math.max(0,parseInt(m,10)||0)*1e3:ik(l);await g.text(),l++,await sk(y,n.signal);continue}return await n.processResponse(g)}})();return this.shouldThrowOnError||(o=o.catch(l=>{var d;let h="",p="",g="";const m=l==null?void 0:l.cause;if(m){var y,b,_,w;const k=(y=m==null?void 0:m.message)!==null&&y!==void 0?y:"",j=(b=m==null?void 0:m.code)!==null&&b!==void 0?b:"";h=`${(_=l==null?void 0:l.name)!==null&&_!==void 0?_:"FetchError"}: ${l==null?void 0:l.message}`,h+=`
62
63Caused by: ${(w=m==null?void 0:m.name)!==null&&w!==void 0?w:"Error"}: ${k}`,j&&(h+=` (${j})`),m!=null&&m.stack&&(h+=`
64${m.stack}`)}else{var S;h=(S=l==null?void 0:l.stack)!==null&&S!==void 0?S:""}const E=this.url.toString().length;return(l==null?void 0:l.name)==="AbortError"||(l==null?void 0:l.code)==="ABORT_ERR"?(g="",p="Request was aborted (timeout or manual cancellation)",E>this.urlLengthLimit&&(p+=`. Note: Your request URL is ${E} 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.`)):((m==null?void 0:m.name)==="HeadersOverflowError"||(m==null?void 0:m.code)==="UND_ERR_HEADERS_OVERFLOW")&&(g="",p="HTTP headers exceeded server limits (typically 16KB)",E>this.urlLengthLimit&&(p+=`. Your request URL is ${E} 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:`${(d=l==null?void 0:l.name)!==null&&d!==void 0?d:"FetchError"}: ${l==null?void 0:l.message}`,details:h,hint:p,code:g},data:null,count:null,status:0,statusText:""}}
64)),o.then(t,e)}async processResponse(t){var e=this;let n=null,r=null,s=null,o=t.status,l=t.statusText;if(t.ok){var d,h;if(e.method!=="HEAD"){var p;const y=await t.text();y===""||(e.headers.get("Accept")==="text/csv"||e.headers.get("Accept")&&(!((p=e.headers.get("Accept"))===null||p===void 0)&&p.includes("application/vnd.pgrst.plan+text"))?r=y:r=JSON.parse(y))}const g=(d=e.headers.get("Prefer"))===null||d===void 0?void 0:d.match(/count=(exact|planned|estimated)/),m=(h=t.headers.get("content-range"))===null||h===void 0?void 0:h.split("/");g&&m&&m.length>1&&(s=parseInt(m[1])),e.isMaybeSingle&&Array.isArray(r)&&(r.length>1?(n={code:"PGRST116",details:`Results contain ${r.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},r=null,s=null,o=406,l="Not Acceptable"):r.length===1?r=r[0]:r=null)}else{const g=await t.text();try{n=JSON.parse(g),Array.isArray(n)&&t.status===404&&(r=[],n=null,o=200,l="OK")}catch{t.status===404&&g===""?(o=204,l="No Content"):n={message:g}}if(n&&e.shouldThrowOnError)throw new QM(n)}return{success:n===null,error:n,data:r,count:s,status:o,statusText:l}}returns(){return this}overrideTypes(){return this}},n3=class extends t3{select(t){let e=!1;const n=(t??"*").split("").map(r=>/\s/.test(r)&&!e?"":(r==='"'&&(e=!e),r)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:e=!0,nullsFirst:n,foreignTable:r,referencedTable:s=r}={}){const o=s?`${s}.order`:"order",l=this.url.searchParams.get(o);return this.url.searchParams.set(o,`${l?`${l},`:""}${t}.${e?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:e,referencedTable:n=e}={}){const r=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(r,`${t}`),this}range(t,e,{foreignTable:n,referencedTable:r=n}={}){const s=typeof r>"u"?"offset":`${r}.offset`,o=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(s,`${t}`),this.url.searchParams.set(o,`${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:n=!1,buffers:r=!1,wal:s=!1,format:o="text"}={}){var l;const d=[t?"analyze":null,e?"verbose":null,n?"settings":null,r?"buffers":null,s?"wal":null].filter(Boolean).join("|"),h=(l=this.headers.get("Accept"))!==null&&l!==void 0?l:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${o}; for="${h}"; options=${d};`),o==="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 ak=new RegExp("[,()]");var Wl=class extends n3{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 n=Array.from(new Set(e)).map(r=>typeof r=="string"&&ak.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(t,`in.(${n})`),this}notIn(t,e){const n=Array.from(new Set(e)).map(r=>typeof r=="string"&&ak.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(t,`not.in.(${n})`),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:n,type:r}={}){let s="";r==="plain"?s="pl":r==="phrase"?s="ph":r==="websearch"&&(s="w");const o=n===void 0?"":`(${n})`;return this.url.searchParams.append(t,`${s}fts${o}.${e}`),this}match(t){return Object.entries(t).filter(([e,n])=>
64n!==void 0).forEach(([e,n])=>{this.url.searchParams.append(e,`eq.${n}`)}),this}not(t,e,n){return this.url.searchParams.append(t,`not.${e}.${n}`),this}or(t,{foreignTable:e,referencedTable:n=e}={}){const r=n?`${n}.or`:"or";return this.url.searchParams.append(r,`(${t})`),this}filter(t,e,n){return this.url.searchParams.append(t,`${e}.${n}`),this}},r3=class{constructor(t,{headers:e={},schema:n,fetch:r,urlLengthLimit:s=8e3,retry:o}){this.url=t,this.headers=new Headers(e),this.schema=n,this.fetch=r,this.urlLengthLimit=s,this.retry=o}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(t,e){const{head:n=!1,count:r}=e??{},s=n?"HEAD":"GET";let o=!1;const l=(t??"*").split("").map(p=>/\s/.test(p)&&!o?"":(p==='"'&&(o=!o),p)).join(""),{url:d,headers:h}=this.cloneRequestState();return d.searchParams.set("select",l),r&&h.append("Prefer",`count=${r}`),new Wl({method:s,url:d,headers:h,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(t,{count:e,defaultToNull:n=!0}={}){var r;const s="POST",{url:o,headers:l}=this.cloneRequestState();if(e&&l.append("Prefer",`count=${e}`),n||l.append("Prefer","missing=default"),Array.isArray(t)){const d=t.reduce((h,p)=>h.concat(Object.keys(p)),[]);if(d.length>0){const h=[...new Set(d)].map(p=>`"${p}"`);o.searchParams.set("columns",h.join(","))}}return new Wl({method:s,url:o,headers:l,schema:this.schema,body:t,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(t,{onConflict:e,ignoreDuplicates:n=!1,count:r,defaultToNull:s=!0}={}){var o;const l="POST",{url:d,headers:h}=this.cloneRequestState();if(h.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),e!==void 0&&d.searchParams.set("on_conflict",e),r&&h.append("Prefer",`count=${r}`),s||h.append("Prefer","missing=default"),Array.isArray(t)){const p=t.reduce((g,m)=>g.concat(Object.keys(m)),[]);if(p.length>0){const g=[...new Set(p)].map(m=>`"${m}"`);d.searchParams.set("columns",g.join(","))}}return new Wl({method:l,url:d,headers:h,schema:this.schema,body:t,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(t,{count:e}={}){var n;const r="PATCH",{url:s,headers:o}=this.cloneRequestState();return e&&o.append("Prefer",`count=${e}`),new Wl({method:r,url:s,headers:o,schema:this.schema,body:t,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:t}={}){var e;const n="DELETE",{url:r,headers:s}=this.cloneRequestState();return t&&s.append("Prefer",`count=${t}`),new Wl({method:n,url:r,headers:s,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function bd(t){"@babel/helpers - typeof";return bd=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},bd(t)}function i3(t,e){if(bd(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(bd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function s3(t){var e=i3(t,"string");return bd(e)=="symbol"?e:e+""}function a3(t,e,n){return(e=s3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ok(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function Mf(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ok(Object(n),!0).forEach(function(r){a3(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ok(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var o3=class kN{constructor(e,{headers:n={},schema:r,fetch:s,timeout:o,urlLengthLimit:l=8e3,retry:d}={}){this.url=e,this.headers=new Headers(n),this.schemaName=r,this.urlLengthLimit=l;const h=s??globalThis.fetch;o!==void 0&&o>0?this.fetch=(p,g)=>{const m=new AbortController,y=setTimeout(()=>m.abort(),o),b=g==null?void 0:g.signal;if(b){if(b.aborted)return clearTimeout(y),h(p,g);const _=()=>{clearTimeout(y),m.abort()};return b.addEventListener("abort",_,{once:!0}),h(p,Mf(Mf({},g),{},{signal:m.signal})).finally(()=>{clearTimeout(y),b.removeEventListener("abort",_)})}return h(p,Mf(Mf({},g),{},{signal:m.signal})).finally(()=>clearTimeout(y))}:this.fetch=h,this.retry=d}from(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new r3(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 kN(this.url,{headers:this.headers,schema:e,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,n={},{head:r=!1,get:s=!1,count:o}={}){var l;let d;const h=new URL(`${this.url}/rpc/${e}`);let p;const g=b=>b!==null&&typeof b=="object"&&(!Array.isArray(b)||b.some(g)),m=r&&Object.values(n).some(g);m?(d="POST",p=n):r||s?(d=r?"HEAD":"GET",Object.entries(n).filter(([b,_])=>_!==void 0).map(([b,_])=>[b,Array.isArray(_)?`{${_.join(",")}}`:`${_}
64`]).forEach(([b,_])=>{h.searchParams.append(b,_)})):(d="POST",p=n);const y=new Headers(this.headers);return m?y.set("Prefer",o?`count=${o},return=minimal`:"return=minimal"):o&&y.set("Prefer",`count=${o}`),new Wl({method:d,url:h,headers:y,schema:this.schemaName,body:p,fetch:(l=this.fetch)!==null&&l!==void 0?l:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class l3{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const n=globalThis;if(typeof globalThis<"u"&&typeof n.WebSocket<"u")return{type:"native",wsConstructor:n.WebSocket};const r=typeof global<"u"?global:void 0;if(r&&typeof r.WebSocket<"u")return{type:"native",wsConstructor:r.WebSocket};if(typeof globalThis<"u"&&typeof n.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"&&n.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 s=globalThis.process;if(s){const o=s.versions;if(o&&o.node){const l=o.node,d=parseInt(l.replace(/^v/,"").split(".")[0]);return d>=22?typeof globalThis.WebSocket<"u"?{type:"native",wsConstructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${d} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${d} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
65import ws from "ws"
66new 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.wsConstructor)return e.wsConstructor;let n=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(n+=`
67
68Suggested solution: ${e.workaround}`),new Error(n)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const c3="2.106.2",u3=`realtime-js/${c3}`,d3="1.0.0",jN="2.0.0",h3=jN,f3=1e4,p3=100,Ia={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},TN={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},L0={connecting:"connecting",closing:"closing",closed:"closed"};class m3{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,n){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return n(this._binaryEncodeUserBroadcastPush(e));let r=[e.join_ref,e.ref,e.topic,e.event,e.payload];return n(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(e){var n;return this._isArrayBuffer((n=e.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var n,r;const s=(r=(n=e.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(e){var n,r;const s=(r=(n=e.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:{},l=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,l)}_encodeUserBroadcastPush(e,n,r){var s,o;const l=e.topic,d=(s=e.ref)!==null&&s!==void 0?s:"",h=(o=e.join_ref)!==null&&o!==void 0?o:"",p=e.payload.event,g=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},m=Object.keys(g).length===0?"":JSON.stringify(g);if(h.length>255)throw new Error(`joinRef length ${h.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`ref length ${d.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`topic length ${l.length} exceeds maximum of 255`);if(p.length>255)throw new Error(`userEvent length ${p.length} exceeds maximum of 255`);if(m.length>255)throw new Error(`metadata length ${m.length} exceeds maximum of 255`);const y=this.USER_BROADCAST_PUSH_META_LENGTH+h.length+d.length+l.length+p.length+m.length,b=new ArrayBuffer(this.HEADER_LENGTH+y);let _=new DataView(b),w=0;_.setUint8(w++,this.KINDS.userBroadcastPush),_.setUint8(w++,h.length),_.setUint8(w++,d.length),_.setUint8(w++,l.length),_.setUint8(w++,p.length),_.setUint8(w++,m.length),_.setUint8(w++,n),Array.from(h,E=>
68_.setUint8(w++,E.charCodeAt(0))),Array.from(d,E=>_.setUint8(w++,E.charCodeAt(0))),Array.from(l,E=>_.setUint8(w++,E.charCodeAt(0))),Array.from(p,E=>_.setUint8(w++,E.charCodeAt(0))),Array.from(m,E=>_.setUint8(w++,E.charCodeAt(0)));var S=new Uint8Array(b.byteLength+r.byteLength);return S.set(new Uint8Array(b),0),S.set(new Uint8Array(r),b.byteLength),S.buffer}decode(e,n){if(this._isArrayBuffer(e)){let r=this._binaryDecode(e);return n(r)}if(typeof e=="string"){const r=JSON.parse(e),[s,o,l,d,h]=r;return n({join_ref:s,ref:o,topic:l,event:d,payload:h})}return n({})}_binaryDecode(e){const n=new DataView(e),r=n.getUint8(0),s=new TextDecoder;switch(r){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,n,s)}}_decodeUserBroadcast(e,n,r){const s=n.getUint8(1),o=n.getUint8(2),l=n.getUint8(3),d=n.getUint8(4);let h=this.HEADER_LENGTH+4;const p=r.decode(e.slice(h,h+s));h=h+s;const g=r.decode(e.slice(h,h+o));h=h+o;const m=r.decode(e.slice(h,h+l));h=h+l;const y=e.slice(h,e.byteLength),b=d===this.JSON_ENCODING?JSON.parse(r.decode(y)):y,_={type:this.BROADCAST_EVENT,event:g,payload:b};return l>0&&(_.meta=JSON.parse(m)),{join_ref:null,ref:null,topic:p,event:this.BROADCAST_EVENT,payload:_}}_isArrayBuffer(e){var n;return e instanceof ArrayBuffer||((n=e==null?void 0:e.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}_pick(e,n){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([r])=>n.includes(r)))}}var Wt;(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"})(Wt||(Wt={}));const lk=(t,e,n={})=>{var r;const s=(r=n.skipTypes)!==null&&r!==void 0?r:[];return e?Object.keys(e).reduce((o,l)=>(o[l]=g3(l,t,e,s),o),{}):{}},g3=(t,e,n,r)=>{const s=e.find(d=>d.name===t),o=s==null?void 0:s.type,l=n[t];return o&&!r.includes(o)?NN(o,l):P0(l)},NN=(t,e)=>{if(t.charAt(0)==="_"){const n=t.slice(1,t.length);return x3(e,n)}switch(t){case Wt.bool:return v3(e);case Wt.float4:case Wt.float8:case Wt.int2:case Wt.int4:case Wt.int8:case Wt.numeric:case Wt.oid:return y3(e);case Wt.json:case Wt.jsonb:return b3(e);case Wt.timestamp:return _3(e);case Wt.abstime:case Wt.date:case Wt.daterange:case Wt.int4range:case Wt.int8range:case Wt.money:case Wt.reltime:case Wt.text:case Wt.time:case Wt.timestamptz:case Wt.timetz:case Wt.tsrange:case Wt.tstzrange:return P0(e);default:return P0(e)}},P0=t=>t,v3=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},y3=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},b3=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t},x3=(t,e)=>{if(typeof t!="string")return t;const n=t.length-1,r=t[n];if(t[0]==="{"&&r==="}"){let o;const l=t.slice(1,n);try{o=JSON.parse("["+l+"]")}catch{o=l?l.split(","):[]}return o.map(d=>NN(e,d))}return t},_3=t=>typeof t=="string"?t.replace(" ","T"):t,AN=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 td=t=>typeof t=="function"?t:function(){return t},w3=typeof self<"u"?self:null,Yl=typeof window<"u"?window:null,Qi=w3||Yl||globalThis,S3="2.0.0",E3=1e4,k3=1e3,es={connecting:0,open:1,closing:2,closed:3},Cr={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Fs={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},F0={longpoll:"longpoll",websocket:"websocket"},j3={complete:4},$0="base64url.bearer.phx.",Lf=class{constructor(t,e,n,r){this.channel=t,this.event=e,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHo
vendor: 21,724 bytes, lines 68-69
68oks=[],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:n}){this.recHooks.filter(r=>r.status===t).forEach(r=>r.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})}},CN=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))}},T3=class{constructor(t,e,n){this.state=Cr.closed,this.topic=t,this.params=td(e||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Lf(this,Fs.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new CN(()=>{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=Cr.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(r=>r.send()),this.pushBuffer=[]}),this.joinPush.receive("error",r=>{this.state=Cr.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=Cr.closed,this.socket.remove(this)}),this.onError(r=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.isJoining()&&this.joinPush.reset(),this.state=Cr.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 Lf(this,Fs.leave,td({}),this.timeout).send(),this.state=Cr.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(Fs.reply,(r,s)=>{this.trigger(this.replyEventName(s),r)})}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=Cr.closed,this.bindings=[]}onClose(t){this.on(Fs.close,t)}onError(t){return this.on(Fs.error,e=>t(e))}on(t,e){let n=this.bindingRef++;return this.bindings.push({event:t,ref:n,callback:e}),n}off(t,e){this.bindings=this.bindings.filter(n=>!(n.event===t&&(typeof e>"u"||e===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(t,e,n=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 r=new Lf(this,t,function(){return e},n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(t=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Cr.leaving;let e=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Fs.close,"leave")},n=new Lf(this,Fs.leave,td({}),t);return n.receive("ok",()=>e()).receive("timeout",()=>e()),n.send(),this.canPush()||n.trigger("ok",{}),n}onMessage(t,e,n){return e}filterBindings(t,e,n){return!0}isMember(t,e,n,r){return this.topic!==t?!1:r&&r!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:t,event:e,payload:n,joinRef:r}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(t=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Cr.joining,this.joinPush.resend(t))}trigger(t,e,n,r){let s=this.onMessage(t,e,n,r);if(e&&!s)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let o=this.bindings.filter(l=>l.event===t&&this.filterBindings(l,e,n));for(let l=0;l<o.length;l++)o[l].callback(s,n,r||this.joinRef())}replyEventName(t){return`chan_reply_${t}`}isClosed(){return this.state===Cr.closed}isErrored(){return this.state===Cr.errored}isJoined(){return this.state===Cr.joined}isJoining(){return this.state===Cr.joining}isLeaving(){return this.state===Cr.leaving}},Op=class{static request(t,e,n,r,s,o,l){if(Qi.XDomainRequest){let d=new Qi.XDomainRequest;return this.xdomainRequest(d,t,e,r,s,o,l)}else if(Qi.XMLHttpRequest){let d=new Qi.XMLHttpRequest;return this.xhrRequest(d,t,e,n,r,s,o,l)}else{if(Qi.fetch&&Qi.AbortController)return this.fetchRequest(t,e,n,r,s,o,l);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(t,e,n,r,s,o,l){let d={method:t,headers:n,body:r},h=null;return s&&(h=new AbortController,setTimeout(()=>h.abort(),s),d.signal=h.signal),Qi.fetch(e,d).then(p=>p.text()).then(p=>this.parseJSON(p)).then(p=>l&&l(p)).catch(p=>{p.name==="AbortError"&&o?o():l&&l(null)}),h}static xdomainRequest(t,e,n,r,s,o,l){return t.timeout=s,t.open(e,n),t.onload=()=>{let d=this.parseJSON(t.responseText);l&&l(d)},o&&(t.ontimeout=o),t.onprogress=()=>{},t.send(r),t}static xhrRequest(t,e,n,r,s,o,l,d){t.open(e,n,!0),t.timeout=o;for(let[h,p]of Object.entries(r))t.setRequestHeader(h,p);return t.onerror=()=>d&&d(null),t.onreadystatechange=()=>{if(t.readyState===j3.complete&&d){let h=this.parseJSON(t.responseText);d(h)}},l&&(t.ontimeout=l),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 n=[];for(var r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let s=e?`${e}[${r}]`:r,o=t[r];typeof o=="object"?n.push(this.serialize(o,s)):n.push(encodeURIComponent(s)+"="+encodeURIComponent(o))}return n.join("&")}static appendParams(t,e){if(Object.keys(e).length===0)return t;let n=t.match(/\?/)?"&":"?";return`${t}${n}${this.serialize(e)}`}},N3=t=>{let e="",n=new Uint8Array(t),r=n.byteLength;for(let s=0;s<r;s++)e+=String.fromCharCode(n[s]);return btoa(e)},Rl=class{constructor(t,e){e&&e.length===2&&e[1].startsWith($0)&&(this.authToken=atob(e[1].slice($0.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(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=es.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+F0.websocket),"$1/"+F0.longpoll)}endpointURL(){return Op.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(t,e,n){this.close(t,e,n),this.readyState=es.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===es.open||this.readyState===es.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:n,token:r,messages:s}=e;if(n===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=r}else n=0;switch(n){case 200:s.forEach(o=>{setTimeout(()=>this.onmessage({data:o}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=es.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 ${n}`)}})}send(t){typeof t!="string"&&(t=N3(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(`
69`),()=>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,n){for(let s of this.reqs)s.abort();this.readyState=es.closed;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:t,reason:e,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",r)):this.onclose(r)}ajax(t,e,n,r,s){let o,l=()=>{this.reqs.delete(o),r()};o=Op.request(t,this.endpointURL(),e,n,this.timeout,l,d=>{this.reqs.delete(o),this.isActive()&&s(d)}),this.reqs.add(o)}},A3=class Vu{constructor(e,n={}){let r=n.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(r.state,s=>{let{onJoin:o,onLeave:l,onSync:d}=this.caller;this.joinRef=this.channel.joinRef(),this.state=Vu.syncState(this.state,s,o,l),this.pendingDiffs.forEach(h=>{this.state=Vu.syncDiff(this.state,h,o,l)}),this.pendingDiffs=[],d()}),this.channel.on(r.diff,s=>{let{onJoin:o,onLeave:l,onSync:d}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=Vu.syncDiff(this.state,s,o,l),d())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(e){return Vu.list(this.state,e)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,n,r,s){let o=this.clone(e),l={},d={};return this.map(o,(h,p)=>{n[h]||(d[h]=p)}),this.map(n,(h,p)=>{let g=o[h];if(g){let m=p.metas.map(w=>w.phx_ref),y=g.metas.map(w=>w.phx_ref),b=p.metas.filter(w=>y.indexOf(w.phx_ref)<0),_=g.metas.filter(w=>m.indexOf(w.phx_ref)<0);b.length>0&&(l[h]=p,l[h].metas=b),_.length>0&&(d[h]=this.clone(g),d[h].metas=_)}else l[h]=p}),this.syncDiff(o,{joins:l,leaves:d},r,s)}static syncDiff(e,n,r,s){let{joins:o,leaves:l}=this.clone(n);return r||(r=function(){}),s||(s=function(){}),this.map(o,(d,h)=>{let p=e[d];if(e[d]=this.clone(h),p){let g=e[d].metas.map(y=>y.phx_ref),m=p.metas.filter(y=>g.indexOf(y.phx_ref)<0);e[d].metas.unshift(...m)}r(d,p,h)}),this.map(l,(d,h)=>{let p=e[d];if(!p)return;let g=h.metas.map(m=>m.phx_ref);p.metas=p.metas.filter(m=>g.indexOf(m.phx_ref)<0),s(d,p,h),p.metas.length===0&&delete e[d]}),e}static list(e,n){return n||(n=function(r,s){return s}),this.map(e,(r,s)=>n(r,s))}static map(e,n){return Object.getOwnPropertyNames(e).map(r=>n(r,e[r]))}static clone(e){return JSON.parse(JSON.stringify(e))}},Pf={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 n=[t.join_ref,t.ref,t.topic,t.event,t.payload];return e(JSON.stringify(n))}},decode(t,e){if(t.constructor===ArrayBuffer)return e(this.binaryDecode(t));{let[n,r,s,o,l]=JSON.parse(t);return e({join_ref:n,ref:r,topic:s,event:o,payload:l})}},binaryEncode(t){let{join_ref:e,ref:n,event:r,topic:s,payload:o}=t,l=this.META_LENGTH+e.length+n.length+s.length+r.length,d=new ArrayBuffer(this.HEADER_LENGTH+l),h=new DataView(d),p=0;h.setUint8(p++,this.KINDS.push),h.setUint8(p++,e.length),h.setUint8(p++,n.length),h.setUint8(p++,s.length),h.setUint8(p++,r.length),Array.from(e,m=>h.setUint8(p++,m.charCodeAt(0))),Array.from(n,m=>h.setUint8(p++,m.charCodeAt(0))),Array.from(s,m=>h.setUint8(p++,m.charCodeAt(0))),Array.from(r,m=>h.setUint8(p++,m.charCodeAt(0)));var g=new Uint8Array(d.byteLength+o.byteLength);return g.set(new Uint8Array(d),0),g.set(new Uint8Array(o),d.byteLength),g.buffer},binaryDecode(t){let e=new DataView(t),n=e.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(t,e,r);case this.KINDS.reply:return this.decodeReply(t,e,r);case this.KINDS.broadcast:return this.decodeBroadcast(t,e,r)}},decodePush(t,e,n){let r=e.getUint8(1),s=e.getUint8(2),o=e.getUint8(3),l=this.HEADER_LENGTH+this.META_LENGTH-1,d=n.decode(t.slice(l,l+r));l=l+r;let h=n.decode(t.slice(l,l+s));l=l+s;let p=n.decode(t.slice(l,l+o));l=l+o;let g=t.slice(l,t.byteLength);return{join_ref:d,ref:null,topic:h,event:p,payload:g}},decodeReply(t,e,n){let r=e.getUint8(1),s=e.getUint8(2),o=e.getUint8(3),l=e.getUint8(4),d=this.HEADER_LENGTH+this.META_LENGTH,h=n.decode(t.slice(d,d+r));d=d+r;let p=n.decode(t.slice(d,d+s));d=d+s;let g=n.decode(t.slice(d,d+o));d=d+o;let m=n.decode(t.slice(d,d+l));d=d+l;let y=t.slice(d,t.byteLength),b={status:m,response:y};return{join_ref:h,ref:p,topic:g,event:Fs.reply,payload:b}},decodeBroadcast(t,e,n){let r=e.getUint8(1),s=e.getUint8(2),o=this.HEADER_LENGTH+2,l=n.decode(t.slice(o,o+r));o=o+r;let d=n.decode(t.slice(o,o+s));o=o+s;let h=t.slice(o,t.byteLength);return{join_ref:null,ref:null,topic:l,event:d,payload:h}}},C3=class{constructor(t,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=e.timeout||E3,this.transport=e.transport||Qi.WebSocket||Rl,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=e.longPollFallbackMs,this.fallbackTimer=null;let n=null;try{n=Qi&&Qi.sessionStorage}catch{}this.sessionStore=e.sessionStorage||n,this.establishedConnections=0,this.defaultEncoder=Pf.encode.bind(Pf),this.defaultDecoder=Pf.decode.bind(Pf),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!==Rl?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let r=null;Yl&&Yl.addEventListener&&(Yl.addEventListener("pagehide",s=>{this.conn&&(this.disconnect(),r=this.connectClock)}),Yl.addEventListener("pageshow",s=>{r===this.connectClock&&(r=null,this.connect())}),Yl.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=s=>e.rejoinAfterMs?e.rejoinAfterMs(s):[1e3,2e3,5e3][s-1]||1e4,this.reconnectAfterMs=s=>e.reconnectAfterMs?e.reconnectAfterMs(s):[10,50,100,150,200,250,500,1e3,2e3][s-1]||5e3,this.logger=e.logger||null,!this.logger&&e.debug&&(this.logger=(s,o,l)=>{console.log(`${s}: ${o}`,l)}),this.longpollerTimeout=e.longpollerTimeout||2e4,this.params=td(e.params||{}),this.endPoint=`${t}/${F0.websocket}`,this.vsn=e.vsn||S3,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new CN(()=>{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 Rl}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=Op.appendParams(Op.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,n){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,t&&t()},e,n)}connect(t){t&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=td(t)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Rl?this.connectWithFallback(Rl,this.longPollFallbackMs):this.transportConnect())}log(t,e,n){this.logger&&this.logger(t,e,n)}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(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:e});let r=this.onMessage(s=>{s.ref===e&&(this.off([r]),t(Date.now()-n))});return!0}transportName(t){switch(t){case Rl:return"LongPoll";default:return t.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let t;this.authToken&&(t=["phoenix",`${$0}${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 n=!1,r=!0,s,o,l=this.transportName(t),d=h=>{this.log("transport",`falling back to ${l}...`,h),this.off([s,o]),r=!1,this.replaceTransport(t),this.transportConnect()};if(this.getSession(`phx:fallback:${l}`))return d("memorized");this.fallbackTimer=setTimeout(d,e),o=this.onError(h=>{this.log("transport","error",h),r&&!n&&(clearTimeout(this.fallbackTimer),d(h))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(n=!0,!r){let h=this.transportName(t);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${h}`,"true"),this.log("transport",`established ${h} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(d,e),this.ping(h=>{this.log("transport","connected to primary after",h),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(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),k3,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(t,e,n){if(!this.conn)return t&&t();const r=this.conn;this.waitForBufferDone(r,()=>{e?r.close(e,n||""):r.close(),this.waitForSocketClosed(r,()=>{this.conn===r&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),t&&t()})})}waitForBufferDone(t,e,n=1){if(n===5||!t.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(t,e,n+1)},150*n)}waitForSocketClosed(t,e,n=1){if(n===5||t.readyState===es.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(t,e,n+1)},150*n)}onConnClose(t){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",t),this.triggerChanError(t),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",t)}onConnError(t){this.hasLogger()&&this.log("transport","error",t);let e=this.transport,n=this.establishedConnections;this.triggerStateCallbacks("error",t,e,n),(e===this.transport||n>0)&&this.triggerChanError(t)}
69triggerChanError(t){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(Fs.error,t)})}connectionState(){switch(this.conn&&this.conn.readyState){case es.connecting:return"connecting";case es.open:return"open";case es.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(([n])=>t.indexOf(n)===-1)}channel(t,e={}){let n=new T3(t,e,this);return this.channels.push(n),n}push(t){if(this.hasLogger()){let{topic:e,event:n,payload:r,ref:s,join_ref:o}=t;this.log("push",`${e} ${n} (${o}, ${s})`,r)}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:n,event:r,payload:s,ref:o,join_ref:l}=e;if(o&&o===this.pendingHeartbeatRef){const d=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(s.status==="ok"?"ok":"error",d)}catch(h){this.log("error","error in heartbeat callback",h)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${s.status||""} ${n} ${r} ${o&&"("+o+")"||""}`.trim(),s);for(let d=0;d<this.channels.length;d++){const h=this.channels[d];h.isMember(n,r,s,l)&&h.trigger(r,s,o,l)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(t,...e){try{this.stateChangeCallbacks[t].forEach(([n,r])=>{try{r(...e)}catch(s){this.log("error",`error in ${t} callback`,s)}})}catch(n){this.log("error",`error triggering ${t} callbacks`,n)}}leaveOpenTopic(t){let e=this.channels.find(n=>n.topic===t&&(n.isJoined()||n.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${t}"`),e.leave())}};class nd{constructor(e,n){const r=O3(n);this.presence=new A3(e.getChannel(),r),this.presence.onJoin((s,o,l)=>{const d=nd.onJoinPayload(s,o,l);e.getChannel().trigger("presence",d)}),this.presence.onLeave((s,o,l)=>{const d=nd.onLeavePayload(s,o,l);e.getChannel().trigger("presence",d)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return nd.transformState(this.presence.state)}static transformState(e){return e=R3(e),Object.getOwnPropertyNames(e).reduce((n,r)=>{const s=e[r];return n[r]=hp(s),n},{})}static onJoinPayload(e,n,r){const s=ck(n),o=hp(r);return{event:"join",key:e,currentPresences:s,newPresences:o}}static onLeavePayload(e,n,r){const s=ck(n),o=hp(r);return{event:"leave",key:e,currentPresences:s,leftPresences:o}}}function hp(t){return t.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function R3(t){return JSON.parse(JSON.stringify(t))}function O3(t){return(t==null?void 0:t.events)&&{events:t.events}}function ck(t){return t!=null&&t.metas?hp(t):[]}var uk;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(uk||(uk={}));class D3{get state(){return this.presenceAdapter.state}constructor(e,n){this.channel=e,this.presenceAdapter=new nd(this.channel.channelAdapter,n)}}function I3(t){if(t instanceof Error)return t;if(typeof t=="string")return new Error(t);if(t&&typeof t=="object"){const e=t;
69if(typeof e.code=="number"){const n=typeof e.reason=="string"&&e.reason?` (${e.reason})`:"";return new Error(`socket closed: ${e.code}${n}`,{cause:t})}return new Error("channel error: transport failure",{cause:t})}return new Error("channel error: connection lost")}class M3{constructor(e,n,r){const s=L3(r);this.channel=e.getSocket().channel(n,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,n){return this.channel.on(e,n)}off(e,n){this.channel.off(e,n)}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,n,r){let s;try{s=this.channel.push(e,n,r)}catch{throw new Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>p3){const o=this.channel.pushBuffer.shift();o.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${o.event}`,o.payload())}return s}updateJoinPayload(e){const n=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},n),e)}canPush(){return this.socket.isConnected()&&this.state===Ia.joined}isJoined(){return this.state===Ia.joined}isJoining(){return this.state===Ia.joining}isClosed(){return this.state===Ia.closed}isLeaving(){return this.state===Ia.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}function L3(t){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config)}}var dk;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(dk||(dk={}));var nc;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(nc||(nc={}));var $s;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})($s||($s={}));class rd{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,n={config:{}},r){var s,o;if(this.topic=e,this.params=n,this.socket=r,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.channelAdapter=new M3(this.socket.socketAdapter,e,this.params),this.presence=new D3(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=AN(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((o=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||o===void 0)&&o.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,n=this.timeout){var r,s,o;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:l,presence:d,private:h}}=this.params,p=(s=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(b=>b.filter))!==null&&s!==void 0?s:[],g=!!this.bindings[nc.PRESENCE]&&this.bindings[nc.PRESENCE].length>0||((o=this.params.config.presence)===null||o===void 0?void 0:o.enabled)===!0,m={},y={broadcast:l,presence:Object.assign(Object.assign({},d),{enabled:g}),postgres_changes:p,private:h};this.socket.accessTokenValue&&(m.access_token=this.socket.accessTokenValue),this._onError(b=>{e==null||e($s.CHANNEL_ERROR,I3(b))}),this._onClose(()=>e==null?void 0:e($s.CLOSED)),this.updateJoinPayload(Object.assign({config:y},m)),this._updateFilterMessage(),this.channelAdapter.subscribe(n).receive("ok",async({postgres_changes:b})=>{if(this.socket._isManualToken()||this.socket.setAuth(),b===void 0){e==null||e($s.SUBSCRIBED);return}this._updatePostgresBindings(b,e)}).receive("error",b=>{this.state=Ia.errored;const _=Object.values(b).join(", ")||"error";e==null||e($s.CHANNEL_ERROR,new Error(_,{cause:b}))}).receive("timeout",()=>{e==null||e($s.TIMED_OUT)})}return this}_updatePostgresBindings(e,n){var r;const s=this.bindings.postgres_changes,o=(r=s==null?void 0:s.length)!==null&&r!==void 0?r:0,l=[];for(let d=0;d<o;d++){const h=s[d],{filter:{event:p,schema:g,table:m,filter:y}}=h,b=e&&e[d];if(b&&b.event===p&&rd.isFilterValueEqual(b.schema,g)&&rd.isFilterValueEqual(b.table,m)&&rd.isFilterValueEqual(b.filter,y))l.push(Object.assign(Object.assign({},h),{id:b.id}));
69else{this.unsubscribe(),this.state=Ia.errored,n==null||n($s.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=l,this.state!=Ia.errored&&n&&n($s.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,n={}){return await this.send({type:"presence",event:"track",payload:e},n.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,n,r){const s=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),o=e===nc.PRESENCE||e===nc.POSTGRES_CHANGES;if(s&&o)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,n,r)}async httpSend(e,n,r={}){var s;if(n==null)return Promise.reject(new Error("Payload is required for httpSend()"));const o={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(o.Authorization=`Bearer ${this.socket.accessTokenValue}`);const l={method:"POST",headers:o,body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:n,private:this.private}]})},d=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(s=r.timeout)!==null&&s!==void 0?s:this.timeout);if(d.status===202)return{success:!0};let h=d.statusText;try{const p=await d.json();h=p.error||p.message||h}catch{}return Promise.reject(new Error(h))}async send(e,n={}){var r,s;if(!this.channelAdapter.canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated 
69in the future. Please use httpSend() explicitly for REST delivery.");const{event:o,payload:l}=e,d={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(d.Authorization=`Bearer ${this.socket.accessTokenValue}`);const h={method:"POST",headers:d,body:JSON.stringify({messages:[{topic:this.subTopic,event:o,payload:l,private:this.private}]})};try{const p=await this._fetchWithTimeout(this.broadcastEndpointURL,h,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((s=p.body)===null||s===void 0?void 0:s.cancel()),p.ok?"ok":"error"}catch(p){return p instanceof Error&&p.name==="AbortError"?"timed out":"error"}}else return new Promise(o=>{var l,d,h;const p=this.channelAdapter.push(e.type,e,n.timeout||this.timeout);e.type==="broadcast"&&!(!((h=(d=(l=this.params)===null||l===void 0?void 0:l.config)===null||d===void 0?void 0:d.broadcast)===null||h===void 0)&&h.ack)&&o("ok"),p.receive("ok",()=>o("ok")),p.receive("error",()=>o("error")),p.receive("timeout",()=>o("timed out"))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(n=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>n("ok")).receive("timeout",()=>n("timed out")).receive("error",()=>n("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,n,r){const s=new AbortController,o=setTimeout(()=>s.abort(),r),l=await this.socket.fetch(e,Object.assign(Object.assign({},n),{signal:s.signal}));return clearTimeout(o),l}_on(e,n,r){const s=e.toLocaleLowerCase(),o=this.channelAdapter.on(e,r),l={type:s,filter:n,callback:r,ref:o};return this.bindings[s]?this.bindings[s].push(l):this.bindings[s]=[l],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,n,r)=>{var s,o,l,d,h,p,g;const m=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(m,r))return!1;const y=(s=this.bindings[m])===null||s===void 0?void 0:s.find(b=>b.ref===e.ref);if(!y)return!0;if(["broadcast","presence","postgres_changes"].includes(m))if("id"in y){const b=y.id,_=(o=y.filter)===null||o===void 0?void 0:o.event;return b&&((l=n.ids)===null||l===void 0?void 0:l.includes(b))&&(_==="*"||(_==null?void 0:_.toLocaleLowerCase())===((d=n.data)===null||d===void 0?void 0:d.type.toLocaleLowerCase()))}else{const b=(p=(h=y==null?void 0:y.filter)===null||h===void 0?void 0:h.event)===null||p===void 0?void 0:p.toLocaleLowerCase();return b==="*"||b===((g=n==null?void 0:n.event)===null||g===void 0?void 0:g.toLocaleLowerCase())}else return y.type.toLocaleLowerCase()===m})}_notThisChannelEvent(e,n){const{close:r,error:s,leave:o,join:l}=TN;return n&&[r,s,o,l].includes(e)&&n!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,n,r)=>{if(typeof n=="object"&&"ids"in n){const s=n.data,{schema:o,table:l,commit_timestamp:d,type:h,errors:p}=s;return Object.assign(Object.assign({},{schema:o,table:l,commit_timestamp:d,eventType:h,new:{},old:{},errors:p}),this._getPayloadRecords(s))}return n})}copyBindings(e){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const n in e.bindings)for(const r of e.bindings[n])this._on(r.type,r.filter,r.callback)}static isFilterValueEqual(e,n){return(e??void 0)===(n??void 0)}_getPayloadRecords(e){const n={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(n.new=lk(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(n.old=lk(e.columns,e.old_record)),n}}class P3{constructor(e,n){this.socket=new C3(e,n)}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,n,r,s=1e4){return new Promise(o=>{setTimeout(()=>
69o("timeout"),s),this.socket.disconnect(()=>{e(),o("ok")},n,r)})}push(e){this.socket.push(e)}log(e,n,r){this.socket.log(e,n,r)}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()==L0.connecting}isDisconnecting(){return this.socket.connectionState()==L0.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const hk={HEARTBEAT_INTERVAL:25e3},F3=[1e3,2e3,5e3,1e4],$3=1e4;function U3(){const t=new Map;return{get length(){return t.size},clear(){t.clear()},getItem(e){return t.has(e)?t.get(e):null},key(e){var n;return(n=Array.from(t.keys())[e])!==null&&n!==void 0?n:null},removeItem(e){t.delete(e)},setItem(e,n){t.set(e,String(n))}}}function z3(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return U3()}const B3=`
70  addEventListener("message", (e) => {
71    if (e.data.event === "start") {
72      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
73    }
74  });`;class H3{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,n){var r;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new m3,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=o=>o?(...l)=>o(...l):(...l)=>fetch(...l),!(!((r=n==null?void 0:n.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey;const s=this._initializeOptions(n);this.socketAdapter=new P3(e,s),this.httpEndpoint=AN(e),this.fetch=this._resolveFetch(n==null?void 0:n.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 n=e.message;throw n.includes("Node.js")?new Error(`${n}
75
76To use Realtime in Node.js, you need to provide a WebSocket implementation:
77
78Option 1: Use Node.js 22+ which has native WebSocket support
79Option 2: Install and provide the "ws" package:
80
81  npm install ws
82
83  import ws from "ws"
84  const client = new RealtimeClient(url, {
85    ...options,
86    transport: ws
87  })`):new Error(`WebSocket not available: ${n}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,n){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,n)}getChannels(){return this.channels}async removeChannel(e){const n=await e.unsubscribe();return n==="ok"&&e.teardown(),n}async removeAllChannels(){const e=this.channels.map(async r=>{const s=await r.unsubscribe();return r.teardown(),s}),n=await Promise.all(e);return await this.disconnect(),n}log(e,n,r){this.socketAdapter.log(e,n,r)}connectionState(){return this.socketAdapter.connectionState()||L0.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,n={config:{}}){const r=`realtime:${e}`,s=this.getChannels().find(o=>o.topic===r);if(s)return s;{const o=new rd(`realtime:${e}`,n,this);return this._cancelPendingDisconnect(),this.channels.push(o),o}}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(n=>n.topic!==e.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}
87this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(e=null){let n,r=!1;if(e)n=e,r=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(s){this.log("error","Error fetching access token from callback",s),n=this.accessTokenValue}else n=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(s=>{const o={access_token:n,version:u3};n&&s.updateJoinPayload(o),s.joinedOnce&&s.channelAdapter.isJoined()&&s.channelAdapter.push(TN.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(n=>{this.log("error",`Error setting auth in ${e}`,n)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(n=>{this.log("error","error waiting for auth on connect",n)}),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(n,r)=>{n=="sent"&&this._setAuthSafely(),e&&e(n,r)}}_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=n=>{this.log("worker","worker error",n.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=n=>{n.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 n;if(e)n=e;else{const r=new Blob([B3],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_initializeOptions(e){var n,r,s,o,l,d,h,p,g,m,y,b;this.worker=(n=e==null?void 0:e.worker)!==null&&n!==void 0?n:!1,this.accessToken=(r=e==null?void 0:e.accessToken)!==null&&r!==void 0?r:null;const _={};_.timeout=(s=e==null?void 0:e.timeout)!==null&&s!==void 0?s:f3,_.heartbeatIntervalMs=(o=e==null?void 0:e.heartbeatIntervalMs)!==null&&o!==void 0?o:hk.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(l=e==null?void 0:e.disconnectOnEmptyChannelsAfterMs)!==null&&l!==void 0?l:2*((d=e==null?void 0:e.heartbeatIntervalMs)!==null&&d!==void 0?d:hk.HEARTBEAT_INTERVAL),_.transport=(h=e==null?void 0:e.transport)!==null&&h!==void 0?h:l3.getWebSocketConstructor(),_.params=e==null?void 0:e.params,_.logger=e==null?void 0:e.logger,_.heartbeatCallback=this._wrapHeartbeatCallback(e==null?void 0:e.heartbeatCallback),_.sessionStorage=(p=e==null?void 0:e.sessionStorage)!==null&&p!==void 0?p:z3(),_.reconnectAfterMs=(g=e==null?void 0:e.reconnectAfterMs)!==null&&g!==void 0?g:(k=>F3[k-1]||$3);let w,S;const E=(m=e==null?void 0:e.vsn)!==null&&m!==void 0?m:h3;switch(E){case d3:w=(k,j)=>j(JSON.stringify(k)),S=(k,j)=>j(JSON.parse(k));break;case jN:w=this.serializer.encode.bind(this.serializer),S=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${_.vsn}`)}if(_.vsn=E,_.encode=(y=e==null?void 0:e.encode)!==null&&y!==void 0?y:w,_.decode=(b=e==null?void 0:e.decode)!==null&&b!==void 0?b:S,_.beforeReconnect=this._reconnectAuth.bind(this),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,_.params=Object.assign(Object.assign({},_.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,_.autoSendHeartbeat=!this.worker}return _}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}
87var xd=class extends Error{constructor(t,e){var n;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)&&((n=e.icebergType)==null?void 0:n.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function q3(t,e,n){const r=new URL(e,t);if(n)for(const[s,o]of Object.entries(n))o!==void 0&&r.searchParams.set(s,o);return r.toString()}async function G3(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 V3(t){const e=t.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:s,body:o,headers:l}){const d=q3(t.baseUrl,r,s),h=await G3(t.auth),p=await e(d,{method:n,headers:{...o?{"Content-Type":"application/json"}:{},...h,...l},body:o?JSON.stringify(o):void 0}),g=await p.text(),m=(p.headers.get("content-type")||"").includes("application/json"),y=m&&g?JSON.parse(g):g;if(!p.ok){const b=m?y:void 0,_=b==null?void 0:b.error;throw new xd((_==null?void 0:_.message)??`Request failed with status ${p.status}`,{status:p.status,icebergType:_==null?void 0:_.type,icebergCode:_==null?void 0:_.code,details:b})}return{status:p.status,headers:p.headers,data:y}}}}function Ff(t){return t.join("�")}var W3=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){const e=t?{parent:Ff(t.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(r=>({namespace:r}))}async createNamespace(t,e){const n={namespace:t.namespace,properties:e==null?void 0:e.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Ff(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Ff(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Ff(t.namespace)}`}),!0}catch(e){if(e instanceof xd&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(n){if(n instanceof xd&&n.status===409)return;throw n}}};function Ol(t){return t.join("�")}var Y3=class{constructor(t,e="",n){this.client=t,this.prefix=e,this.accessDelegation=n}async listTables(t){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Ol(t.namespace)}/tables`})).data.identifiers}async createTable(t,e){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Ol(t.namespace)}/tables`,body:e,headers:n})).data.metadata}async updateTable(t,e){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Ol(t.namespace)}/tables/${t.name}`,body:e});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(t,e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Ol(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/${Ol(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/${Ol(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(n){if(n instanceof xd&&n.status===404)return!1;throw n}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(n){if(n instanceof xd&&n.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw n}}},K3=class{constructor(t){var r;let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);const n=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=V3({baseUrl:n,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=(r=t.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new W3(this.client,e),this.tableOps=new Y3(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)}
87async 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)}};function _d(t){"@babel/helpers - typeof";return _d=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},_d(t)}function J3(t,e){if(_d(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(_d(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function X3(t){var e=J3(t,"string");return _d(e)=="symbol"?e:e+""}function Z3(t,e,n){return(e=X3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fk(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function Ke(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?fk(Object(n),!0).forEach(function(r){Z3(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fk(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var Cm=class extends Error{constructor(t,e="storage",n,r){super(t),this.__isStorageError=!0,this.namespace=e,this.name=e==="vectors"?"StorageVectorsError":"StorageError",this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function Rm(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var U0=class extends Cm{constructor(t,e,n,r="storage"){super(t,r,e,n),this.name=r==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=e,this.statusCode=n}toJSON(){return Ke({},super.toJSON())}},RN=class extends Cm{constructor(t,e,n="storage"){super(t,n),this.name=n==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};function Dp(t,e,n){const r=Ke({},t),s=e.toLowerCase();for(const o of Object.keys(r))o.toLowerCase()===s&&delete r[o];return r[s]=n,r}function Q3(t){const e={};for(const[n,r]of Object.entries(t))e[n.toLowerCase()]=r;return e}const eL=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),tL=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)},z0=t=>{if(Array.isArray(t))return t.map(n=>z0(n));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([n,r])=>{const s=n.replace(/([-_][a-z])/gi,o=>o.toUpperCase().replace(/[-_]/g,""));e[s]=z0(r)}),e},nL=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t),pk=t=>{if(typeof t=="object"&&t!==null){const e=t;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error;if(typeof e.error=="object"&&e.error!==null){const n=e.error;if(typeof n.message=="string")return n.message}}return JSON.stringify(t)},rL=async(t,e,n,r)=>{if(t!==null&&typeof t=="object"&&"json"in t&&typeof t.json=="function"){const s=t;let o=parseInt(String(s.status),10);Number.isFinite(o)||(o=500),s.json().then(l=>{const d=(l==null?void 0:l.statusCode)||(l==null?void 0:l.code)||o+"";e(new U0(pk(l),o,d,r))}).catch(()=>{const l=o+"";e(new U0(s.statusText||`HTTP ${o} error`,o,l,r))})}else e(new RN(pk(t),t,r))},iL=(t,e,n,r)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};if(t==="GET"||t==="HEAD"||!r)return Ke(Ke({},s),n);if(tL(r)){var o;const l=(e==null?void 0:e.headers)||{};let d;for(const[h,p]of Object.entries(l))h.toLowerCase()==="content-type"&&(d=p);s.headers=Dp(l,"Content-Type",(o=d)!==null&&o!==void 0?o:"application/json"),s.body=JSON.stringify(r)}else s.body=r;return e!=null&&e.duplex&&(s.duplex=e.duplex),Ke(Ke({},s),n)};async function Au(t,e,n,r,s,o,l){return new Promise((d,h)=>{t(n,iL(e,r,s,o)).then(p=>{if(!p.ok)throw p;if(r!=null&&r.noResolveJson)return p;if(l==="vectors"){const g=p.headers.get("content-type");if(p.headers.get("content-length")==="0"||p.status===204)return{};if(!g||!g.includes("application/json"))return{}}return p.json()}).then(p=>
87d(p)).catch(p=>rL(p,h,r,l))})}function ON(t="storage"){return{get:async(e,n,r,s)=>Au(e,"GET",n,r,s,void 0,t),post:async(e,n,r,s,o)=>Au(e,"POST",n,s,o,r,t),put:async(e,n,r,s,o)=>Au(e,"PUT",n,s,o,r,t),head:async(e,n,r,s)=>Au(e,"HEAD",n,Ke(Ke({},r),{},{noResolveJson:!0}),s,void 0,t),remove:async(e,n,r,s,o)=>Au(e,"DELETE",n,s,o,r,t)}}const sL=ON("storage"),{get:wd,post:Mi,put:B0,head:aL,remove:kx}=sL,Wr=ON("vectors");var Tc=class{constructor(t,e={},n,r="storage"){this.shouldThrowOnError=!1,this.url=t,this.headers=Q3(e),this.fetch=eL(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=Dp(this.headers,t,e),this}async handleOperation(t){var e=this;try{return{data:await t(),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(Rm(n))return{data:null,error:n};throw n}}};let DN;DN=Symbol.toStringTag;var oL=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[DN]="StreamDownloadBuilder",this.promise=null}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 t.downloadFn()).body,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(Rm(e))return{data:null,error:e};throw e}}};let IN;IN=Symbol.toStringTag;var lL=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[IN]="BlobDownloadBuilder",this.promise=null}asStream(){return new oL(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(Rm(e))return{data:null,error:e};throw e}}};const cL={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},mk={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var uL=class extends Tc{constructor(t,e={},n,r){super(t,e,r,"storage"),this.bucketId=n}async uploadOrUpdate(t,e,n,r){var s=this;return s.handleOperation(async()=>{let o;const l=Ke(Ke({},mk),r);let d=Ke(Ke({},s.headers),t==="POST"&&{"x-upsert":String(l.upsert)});const h=l.metadata;if(typeof Blob<"u"&&n instanceof Blob?(o=new FormData,o.append("cacheControl",l.cacheControl),h&&o.append("metadata",s.encodeMetadata(h)),o.append("",n)):typeof FormData<"u"&&n instanceof FormData?(o=n,o.has("cacheControl")||o.append("cacheControl",l.cacheControl),h&&!o.has("metadata")&&o.append("metadata",s.encodeMetadata(h))):(o=n,d["cache-control"]=`max-age=${l.cacheControl}`,d["content-type"]=l.contentType,h&&(d["x-metadata"]=s.toBase64(s.encodeMetadata(h))),(typeof ReadableStream<"u"&&o instanceof ReadableStream||o&&typeof o=="object"&&"pipe"in o&&typeof o.pipe=="function")&&!l.duplex&&(l.duplex="half")),r!=null&&r.headers)for(const[y,b]of Object.entries(r.headers))d=Dp(d,y,b);const p=s._removeEmptyFolders(e),g=s._getFinalPath(p),m=await(t=="PUT"?B0:Mi)(s.fetch,`${s.url}/object/${g}`,o,Ke({headers:d},l!=null&&l.duplex?{duplex:l.duplex}:{}));return{path:p,id:m.Id,fullPath:m.Key}})}async upload(t,e,n){return this.uploadOrUpdate("POST",t,e,n)}async uploadToSignedUrl(t,e,n,r){var s=this;const o=s._removeEmptyFolders(t),l=s._getFinalPath(o),d=new URL(s.url+`/object/upload/sign/${l}`);return d.searchParams.set("token",e),s.handleOperation(async()=>{let h;const p=Ke(Ke({},mk),r);let g=Ke(Ke({},s.headers),{"x-upsert":String(p.upsert)});const m=p.metadata;if(typeof Blob<"u"&&n instanceof Blob?(h=new FormData,h.append("cacheControl",p.cacheControl),m&&h.append("metadata",s.encodeMetadata(m)),h.append("",n)):typeof FormData<"u"&&n instanceof FormData?(h=n,h.has("cacheControl")||h.append("cacheControl",p.cacheControl),m&&!h.has("metadata")&&h.append("metadata",s.encodeMetadata(m))):(h=n,g["cache-control"]=`max-age=${p.cacheControl}`,g["content-type"]=p.contentType,m&&(g["x-metadata"]=s.toBase64(s.encodeMetadata(m))),(typeof ReadableStream<"u"&&h instanceof ReadableStream||h&&typeof h=="object"&&"pipe"in h&&typeof h.pipe=="function")&&!p.duplex&&(p.duplex="half")),r!=null&&r.headers)for(const[y,b]of Object.entries(r.headers))g=Dp(g,y,b);return{path:o,fullPath:(await B0(s.fetch,d.toString(),h,Ke({headers:g},p!=null&&p.duplex?{duplex:p.duplex}:{}))).Key}})}async createSignedUploadUrl(t,e){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(t);const s=Ke({},n.headers);e!=null&&e.upsert&&(s["x-upsert"]="true");const o=await Mi(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:s}),l=new URL(n.url+o.url),d=l.searchParams.get("token");if(!d)throw new Cm("No token returned by API");return{signedUrl:l.toString(),path:t,token:d}})}async update(t,e,n){return this.uploadOrUpdate("PUT",t,e,n)}async move(t,e,n){var r=this;return r.handleOperation(async()=>await Mi(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:t,destinationKey:e,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers}))}async copy(t,e,n){var r=this;return r.handleOperation(async()=>({path:(await Mi(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:t,destinationKey:e,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(t,e,n){var r=this;return r.handleOperation(async()=>{let s=r._getFinalPath(t);const o=typeof(n==null?void 0:n.transform)=="object"&&n.transform!==null&&Object.keys(n.transform).length>0;let l=await Mi(r.fetch,`${r.url}/object/sign/${s}
87`,Ke({expiresIn:e},o?{transform:n.transform}:{}),{headers:r.headers});const d=new URLSearchParams;n!=null&&n.download&&d.set("download",n.download===!0?"":n.download),(n==null?void 0:n.cacheNonce)!=null&&d.set("cacheNonce",String(n.cacheNonce));const h=d.toString();return{signedUrl:encodeURI(`${r.url}${l.signedURL}${h?`&${h}`:""}`)}})}async createSignedUrls(t,e,n){var r=this;return r.handleOperation(async()=>{const s=await Mi(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:e,paths:t},{headers:r.headers}),o=new URLSearchParams;n!=null&&n.download&&o.set("download",n.download===!0?"":n.download),(n==null?void 0:n.cacheNonce)!=null&&o.set("cacheNonce",String(n.cacheNonce));const l=o.toString();return s.map(d=>Ke(Ke({},d),{},{signedUrl:d.signedURL?encodeURI(`${r.url}${d.signedURL}${l?`&${l}`:""}`):null}))})}download(t,e,n){const r=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"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 o=s.toString(),l=this._getFinalPath(t),d=()=>wd(this.fetch,`${this.url}/${r}/${l}${o?`?${o}`:""}`,{headers:this.headers,noResolveJson:!0},n);return new lL(d,this.shouldThrowOnError)}async info(t){var e=this;const n=e._getFinalPath(t);return e.handleOperation(async()=>z0(await wd(e.fetch,`${e.url}/object/info/${n}`,{headers:e.headers})))}async exists(t){var e=this;const n=e._getFinalPath(t);try{return await aL(e.fetch,`${e.url}/object/${n}`,{headers:e.headers}),{data:!0,error:null}}catch(s){if(e.shouldThrowOnError)throw s;if(Rm(s)){var r;const o=s instanceof U0?s.status:s instanceof RN?(r=s.originalError)===null||r===void 0?void 0:r.status:void 0;if(o!==void 0&&[400,404].includes(o))return{data:!1,error:s}}throw s}}getPublicUrl(t,e){const n=this._getFinalPath(t),r=new URLSearchParams;e!=null&&e.download&&r.set("download",e.download===!0?"":e.download),e!=null&&e.transform&&this.applyTransformOptsToQuery(r,e.transform),(e==null?void 0:e.cacheNonce)!=null&&r.set("cacheNonce",String(e.cacheNonce));const s=r.toString(),o=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${o}/public/${n}`)+(s?`?${s}`:"")}}}async remove(t){var e=this;return e.handleOperation(async()=>await kx(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:t},{headers:e.headers}))}async list(t,e,n){var r=this;return r.handleOperation(async()=>{const s=Ke(Ke(Ke({},cL),e),{},{prefix:t||""});return await Mi(r.fetch,`${r.url}/object/list/${r.bucketId}`,s,{headers:r.headers},n)})}async listV2(t,e){var n=this;return n.handleOperation(async()=>{const r=Ke({},t);return await Mi(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.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("quality",e.quality.toString()),t}};const dL="2.106.2",eh={"X-Client-Info":`storage-js/${dL}`};var hL=class extends Tc{constructor(t,e={},n,r){const s=new URL(t);r!=null&&r.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase."));const o=s.href.replace(/\/$/,""),l=Ke(Ke({},eh),e);super(o,l,n,"storage")}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const n=e.listBucketOptionsToQueryString(t);return await wd(e.fetch,`${e.url}/bucket${n}`,{headers:e.headers})})}async getBucket(t){var e=this;return e.handleOperation(async()=>await wd(e.fetch,`${e.url}/bucket/${t}`,{headers:e.headers}))}async createBucket(t,e={public:!1}){var n=this;return n.handleOperation(async()=>await Mi(n.fetch,`${n.url}/bucket`,{id:t,name:t,type:e.type,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:n.headers}))}async updateBucket(t,e){var n=this;return n.handleOperation(async()=>await B0(n.fetch,`${n.url}/bucket/${t}`,{id:t,name:t,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(t){var e=this;return e.handleOperation(async()=>await Mi(e.fetch,`${e.url}/bucket/${t}/empty`,{},{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await kx(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():""}},fL=class extends Tc{constructor(t,e={},n){const r=t.replace(/\/$/,""),s=Ke(Ke({},eh),e);super(r,s,n,"storage")}async createBucket(t){var e=this;return e.handleOperation(async()=>await Mi(e.fetch,`${e.url}/bucket`,{name:t},{headers:e.headers}))}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const n=new URLSearchParams;(t==null?void 0:t.limit)!==void 0&&n.set("limit",t.limit.toString()),(t==null?void 0:t.offset)!==void 0&&n.set("offset",t.offset.toString()),t!=null&&t.sortColumn&&n.set("sortColumn",t.sortColumn),t!=null&&t.sortOrder&&n.set("sortOrder",t.sortOrder),t!=null&&t.search&&n.set("search",t.search);const r=n.toString(),s=r?`${e.url}/bucket?${r}`:`${e.url}/bucket`;return await wd(e.fetch,s,{headers:e.headers})})}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await kx(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}from(t){var e=this;if(!nL(t))throw new Cm("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 n=new K3({baseUrl:this.url,catalogName:t,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}
87),r=this.shouldThrowOnError;return new Proxy(n,{get(s,o){const l=s[o];return typeof l!="function"?l:async(...d)=>{try{return{data:await l.apply(s,d),error:null}}catch(h){if(r)throw h;return{data:null,error:h}}}}})}},pL=class extends Tc{constructor(t,e={},n){const r=t.replace(/\/$/,""),s=Ke(Ke({},eh),{},{"Content-Type":"application/json"},e);super(r,s,n,"vectors")}async createIndex(t){var e=this;return e.handleOperation(async()=>await Wr.post(e.fetch,`${e.url}/CreateIndex`,t,{headers:e.headers})||{})}async getIndex(t,e){var n=this;return n.handleOperation(async()=>await Wr.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:t,indexName:e},{headers:n.headers}))}async listIndexes(t){var e=this;return e.handleOperation(async()=>await Wr.post(e.fetch,`${e.url}/ListIndexes`,t,{headers:e.headers}))}async deleteIndex(t,e){var n=this;return n.handleOperation(async()=>await Wr.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:t,indexName:e},{headers:n.headers})||{})}},mL=class extends Tc{constructor(t,e={},n){const r=t.replace(/\/$/,""),s=Ke(Ke({},eh),{},{"Content-Type":"application/json"},e);super(r,s,n,"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 Wr.post(e.fetch,`${e.url}/PutVectors`,t,{headers:e.headers})||{})}async getVectors(t){var e=this;return e.handleOperation(async()=>await Wr.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");if(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 Wr.post(e.fetch,`${e.url}/ListVectors`,t,{headers:e.headers}))}async queryVectors(t){var e=this;return e.handleOperation(async()=>await Wr.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 Wr.post(e.fetch,`${e.url}/DeleteVectors`,t,{headers:e.headers})||{})}},gL=class extends Tc{constructor(t,e={},n){const r=t.replace(/\/$/,""),s=Ke(Ke({},eh),{},{"Content-Type":"application/json"},e);super(r,s,n,"vectors")}async createBucket(t){var e=this;return e.handleOperation(async()=>await Wr.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}async getBucket(t){var e=this;return e.handleOperation(async()=>await Wr.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:t},{headers:e.headers}))}async listBuckets(t={}){var e=this;return e.handleOperation(async()=>await Wr.post(e.fetch,`${e.url}/ListVectorBuckets`,t,{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await Wr.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}},vL=class extends gL{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new yL(this.url,this.headers,t,this.fetch)}async createBucket(t){var e=()=>super.createBucket,n=this;return e().call(n,t)}async getBucket(t){var e=()=>super.getBucket,n=this;return e().call(n,t)}async listBuckets(t={}){var e=()=>super.listBuckets,n=this;return e().call(n,t)}async deleteBucket(t){var e=()=>super.deleteBucket,n=this;return e().call(n,t)}},yL=class extends pL{constructor(t,e,n,r){super(t,e,r),this.vectorBucketName=n}async createIndex(t){var e=()=>super.createIndex,n=this;return e().call(n,Ke(Ke({},t),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(t={}){var e=()=>super.listIndexes,n=this;return e().call(n,Ke(Ke({},t),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(t){var e=()=>super.getIndex,n=this;return e().call(n,n.vectorBucketName,t)}async deleteIndex(t){var e=()=>super.deleteIndex,n=this;return e().call(n,n.vectorBucketName,t)}index(t){return new bL(this.url,this.headers,this.vectorBucketName,t,this.fetch)}},bL=class extends mL{constructor(t,e,n,r,s){super(t,e,s),this.vectorBucketName=n,this.indexName=r}async putVectors(t){var e=()=>super.putVectors,n=this;return e().call(n,Ke(Ke({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(t){var e=()=>super.getVectors,n=this;return e().call(n,Ke(Ke({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(t={}){var e=()=>super.listVectors,n=this;return e().call(n,Ke(Ke({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(t){var e=()=>super.queryVectors,n=this;return e().call(n,Ke(Ke({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(t){var e=()=>super.deleteVectors,n=this;return e().call(n,Ke(Ke({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},xL=class extends hL{constructor(t,e={},n,r){super(t,e,n,r)}from(t){return new uL(this.url,this.headers,t,this.fetch)}get vectors(){return new vL(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new fL(this.url+"/iceberg",this.headers,this.fetch)}};const MN="2.106.2",Kl=30*1e3,H0=3,vy=H0*Kl,_L="http://localhost:9999",wL="supabase.auth.token",SL={"X-Client-Info":`gotrue-js/${MN}`},q0="X-Supabase-Api-Version",LN={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},EL=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,kL=600*1e3;
87class mc extends Error{constructor(e,n,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function Re(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class jL extends mc{constructor(e,n,r){super(e,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function TL(t){return Re(t)&&t.name==="AuthApiError"}class Pi extends mc{constructor(e,n){super(e),this.name="AuthUnknownError",this.originalError=n}}class ra extends mc{constructor(e,n,r,s){super(e,r,s),this.name=n,this.status=r}}class qn extends ra{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function $f(t){return Re(t)&&t.name==="AuthSessionMissingError"}class Dl extends ra{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class Uf extends ra{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class zf extends ra{constructor(e,n=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function NL(t){return Re(t)&&t.name==="AuthImplicitGrantRedirectError"}class gk extends ra{constructor(e,n=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class AL extends ra{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 G0 extends ra{constructor(e,n){super(e,"AuthRetryableFetchError",n,void 0)}}function yy(t){return Re(t)&&t.name==="AuthRetryableFetchError"}class vk extends ra{constructor(e,n,r){super(e,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class V0 extends ra{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const Ip="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),yk=` 	
88\r=`.split(""),CL=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<yk.length;e+=1)t[yk[e].charCodeAt(0)]=-2;for(let e=0;e<Ip.length;e+=1)t[Ip[e].charCodeAt(0)]=e;return t})();function bk(t,e,n){if(t!==null)for(e.queue=e.queue<<8|t,e.queuedBits+=8;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;n(Ip[r]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;n(Ip[r]),e.queuedBits-=6}}function PN(t,e,n){const r=CL[t];if(r>-1)for(e.queue=e.queue<<6|r,e.queuedBits+=6;e.queuedBits>=8;)n(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function xk(t){const e=[],n=l=>{e.push(String.fromCodePoint(l))},r={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},o=l=>{DL(l,r,n)};for(let l=0;l<t.length;l+=1)PN(t.charCodeAt(l),s,o);return e.join("")}function RL(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 OL(t,e){for(let n=0;n<t.length;n+=1){let r=t.charCodeAt(n);if(r>55295&&r<=56319){const s=(r-55296)*1024&65535;r=(t.charCodeAt(n+1)-56320&65535|s)+65536,n+=1}RL(r,e)}}function DL(t,e,n){if(e.utf8seq===0){if(t<=127){n(t);return}for(let r=1;r<6;r+=1)if((t>>7-r&1)===0){e.utf8seq=r;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&&n(e.codepoint)}}function cc(t){const e=[],n={queue:0,queuedBits:0},r=s=>{e.push(s)};for(let s=0;s<t.length;s+=1)PN(t.charCodeAt(s),n,r);return new Uint8Array(e)}function IL(t){const e=[];return OL(t,n=>e.push(n)),new Uint8Array(e)}function Ao(t){const e=[],n={queue:0,queuedBits:0},r=s=>{e.push(s)};return t.forEach(s=>bk(s,n,r)),bk(null,n,r),e.join("")}function ML(t){return Math.round(Date.now()/1e3)+t}function LL(){return Symbol("auth-callback")}const Zn=()=>typeof window<"u"&&typeof document<"u",fo={tested:!1,writable:!1},FN=()=>
88{if(!Zn())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(fo.tested)return fo.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),fo.tested=!0,fo.writable=!0}catch{fo.tested=!0,fo.writable=!1}return fo.writable};function PL(t){const e={},n=new URL(t);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((s,o)=>{e[o]=s})}catch{}return n.searchParams.forEach((r,s)=>{e[s]=r}),e}const $N=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),FL=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",Jl=async(t,e,n)=>{await t.setItem(e,JSON.stringify(n))},po=async(t,e)=>{const n=await t.getItem(e);if(!n)return null;try{return JSON.parse(n)}catch{return null}},Xn=async(t,e)=>{await t.removeItem(e)};class Om{constructor(){this.promise=new Om.promiseConstructor((e,n)=>{this.resolve=e,this.reject=n})}}Om.promiseConstructor=Promise;function Bf(t){const e=t.split(".");if(e.length!==3)throw new V0("Invalid JWT structure");for(let r=0;r<e.length;r++)if(!EL.test(e[r]))throw new V0("JWT not in base64url format");return{header:JSON.parse(xk(e[0])),payload:JSON.parse(xk(e[1])),signature:cc(e[2]),raw:{header:e[0],payload:e[1]}}}async function $L(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function UL(t,e){return new Promise((r,s)=>{(async()=>{for(let o=0;o<1/0;o++)try{const l=await t(o);if(!e(o,null,l)){r(l);return}}catch(l){if(!e(o,l)){s(l);return}}})()})}function zL(t){return("0"+t.toString(16)).substr(-2)}function BL(){const e=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let s="";for(let o=0;o<56;o++)s+=n.charAt(Math.floor(Math.random()*r));return s}return crypto.getRandomValues(e),Array.from(e,zL).join("")}async function HL(t){const n=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-256",n),s=new Uint8Array(r);return Array.from(s).map(o=>String.fromCharCode(o)).join("")}async function qL(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 n=await HL(t);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Il(t,e,n=!1){const r=BL();let s=r;n&&(s+="/recovery"),await Jl(t,`${e}-code-verifier`,s);const o=await qL(r);return[o,r===o?"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 VL(t){const e=t.headers.get(q0);if(!e||!e.match(GL))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function WL(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 YL(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 KL=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Cs(t){if(!KL.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Di(t){if(!t.passkey)throw new Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function by(){const t={};return new Proxy(t,{get:(e,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const r=n.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="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 "${n}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function JL(t,e){return new Proxy(t,{get:(n,r,s)=>{if(r==="__isInsecureUserWarningProxy")return!0;
88if(typeof r=="symbol"){const o=r.toString();if(o==="Symbol(Symbol.toPrimitive)"||o==="Symbol(Symbol.toStringTag)"||o==="Symbol(util.inspect.custom)"||o==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,r,s)}return!e.value&&typeof r=="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(n,r,s)}})}function _k(t){return JSON.parse(JSON.stringify(t))}const wo=t=>{if(typeof t=="object"&&t!==null){const e=t;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error}return JSON.stringify(t)},XL=[502,503,504,520,521,522,523,524,530];async function wk(t){var e;if(!FL(t))throw new G0(wo(t),0);if(XL.includes(t.status))throw new G0(wo(t),t.status);let n;try{n=await t.json()}catch(o){throw new Pi(wo(o),o)}let r;const s=VL(t);if(s&&s.getTime()>=LN["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?r=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(r=n.error_code),r){if(r==="weak_password")throw new vk(wo(n),t.status,((e=n.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(r==="session_not_found")throw new qn}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((o,l)=>o&&typeof l=="string",!0))throw new vk(wo(n),t.status,n.weak_password.reasons);throw new jL(wo(n),t.status||500,r)}const ZL=(t,e,n,r)=>{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(r),Object.assign(Object.assign({},s),n))};async function Me(t,e,n,r){var s;const o=Object.assign({},r==null?void 0:r.headers);o[q0]||(o[q0]=LN["2024-01-01"].name),r!=null&&r.jwt&&(o.Authorization=`Bearer ${r.jwt}`);const l=(s=r==null?void 0:r.query)!==null&&s!==void 0?s:{};r!=null&&r.redirectTo&&(l.redirect_to=r.redirectTo);const d=Object.keys(l).length?"?"+new URLSearchParams(l).toString():"",h=await QL(t,e,n+d,{headers:o,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(h):{data:Object.assign({},h),error:null}}async function QL(t,e,n,r,s,o){const l=ZL(e,r,s,o);let d;try{d=await t(n,Object.assign({},l))}catch(h){throw console.error(h),new G0(wo(h),0)}if(d.ok||await wk(d),r!=null&&r.noResolveJson)return d;try{return await d.json()}catch(h){await wk(h)}}function hi(t){var e;let n=null;nP(t)&&(n=Object.assign({},t),t.expires_at||(n.expires_at=ML(t.expires_in)));const r=(e=t.user)!==null&&e!==void 0?e:typeof(t==null?void 0:t.id)=="string"?t:null;return{data:{session:n,user:r},error:null}}function Sk(t){const e=hi(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((n,r)=>n&&typeof r=="string",!0)&&(e.data.weak_password=t.weak_password),e}function Ma(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function eP(t){return{data:t,error:null}}function tP(t){const{action_link:e,email_otp:n,hashed_token:r,redirect_to:s,verification_type:o}=t,l=Am(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),d={action_link:e,email_otp:n,hashed_token:r,redirect_to:s,verification_type:o},h=Object.assign({},l);return{data:{properties:d,user:h},error:null}}function Ek(t){return t}function nP(t){return!!t.access_token&&!!t.refresh_token&&!!t.expires_in}const xy=["global","local","others"];class rP{_encodePathSegment(e){if(e==="."||e==="..")throw new mc("Invalid path segment");return encodeURIComponent(e)}constructor({url:e="",headers:n={},fetch:r,experimental:s}){this.url=e,this.headers=n,this.fetch=$N(r),this.experimental=s??{},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)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(e,n=xy[0]){if(xy.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${xy.join(", ")}`);try{return await Me(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Re(r))return{data:null,error:r};throw r}}async inviteUserByEmail(e,n={}){try{return await Me(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:Ma})}catch(r){if(Re(r))return{data:{user:null},error:r};throw r}}async generateLink(e){try{const{options:n}=e,r=Am(e,["options"]),s=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(s.new_email=r==null?void 0:r.newEmail,delete s.newEmail),await Me(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:tP,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(Re(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(e){try{return await Me(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Ma})}catch(n){if(Re(n))return{data:{user:null},error:n};throw n}}async listUsers(e){var n,r,s,o,l,d,h;try{const p={nextPage:null,lastPage:0,total:0},g=await Me(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=e==null?void 0:e.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(o=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&o!==void 0?o:""},xform:Ek});if(g.error)throw g.error;const m=await g.json(),y=(l=g.headers.get("x-total-count"))!==null&&l!==void 0?l:0,b=(h=(d=g.headers.get("link"))===null||d===void 0?void 0:d.split(","))!==null&&h!==void 0?h:[];return b.length>0&&(b.forEach(_=>{const w=parseInt(_.split(";")[0].split("=")[1].substring(0,1)),S=JSON.parse(_.split(";")[1].split("=")[1]);p[`${S}Page`]=w}),p.total=parseInt(y)),{data:Object.assign(Object.assign({},m),p),error:null}}catch(p){if(Re(p))return{data:{users:[]},error:p};throw p}}async getUserById(e){Cs(e);try{return await Me(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Ma})}catch(n){if(Re(n))return{data:{user:null},error:n};throw n}}async updateUserById(e,n){Cs(e);try{return await Me(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:n,headers:this.headers,xform:Ma})}catch(r){if(Re(r))return{data:{user:null},error:r};throw r}}async deleteUser(e,n=!1){Cs(e);
88try{return await Me(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:n},xform:Ma})}catch(r){if(Re(r))return{data:{user:null},error:r};throw r}}async _listFactors(e){Cs(e.userId);try{const{data:n,error:r}=await Me(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:n,error:r}}catch(n){if(Re(n))return{data:null,error:n};throw n}}async _deleteFactor(e){Cs(e.userId),Cs(e.id);try{return{data:await Me(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(n){if(Re(n))return{data:null,error:n};throw n}}async _listOAuthClients(e){var n,r,s,o,l,d,h;try{const p={nextPage:null,lastPage:0,total:0},g=await Me(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=e==null?void 0:e.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(o=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&o!==void 0?o:""},xform:Ek});if(g.error)throw g.error;const m=await g.json(),y=(l=g.headers.get("x-total-count"))!==null&&l!==void 0?l:0,b=(h=(d=g.headers.get("link"))===null||d===void 0?void 0:d.split(","))!==null&&h!==void 0?h:[];return b.length>0&&(b.forEach(_=>{const w=parseInt(_.split(";")[0].split("=")[1].substring(0,1)),S=JSON.parse(_.split(";")[1].split("=")[1]);p[`${S}Page`]=w}),p.total=parseInt(y)),{data:Object.assign(Object.assign({},m),p),error:null}}catch(p){if(Re(p))return{data:{clients:[]},error:p};throw p}}async _createOAuthClient(e){try{return await Me(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Re(n))return{data:null,error:n};throw n}}async _getOAuthClient(e){try{const n=this._encodePathSegment(e);return await Me(this.fetch,"GET",`${this.url}/admin/oauth/clients/${n}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(n){if(Re(n))return{data:null,error:n};throw n}}async _updateOAuthClient(e,n){try{const r=this._encodePathSegment(e);return await Me(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${r}`,{body:n,headers:this.headers,xform:s=>({data:s,error:null})})}catch(r){if(Re(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(e){try{const n=this._encodePathSegment(e);return await Me(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${n}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(Re(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(e){try{const n=this._encodePathSegment(e);return await Me(this.fetch,"POST",`${this.url}/admin/oauth/clients/${n}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(n){if(Re(n))return{data:null,error:n};throw n}}async _listCustomProviders(e){try{const n={};return e!=null&&e.type&&(n.type=e.type),await Me(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:n,xform:r=>{var s;return{data:{providers:(s=r==null?void 0:r.providers)!==null&&s!==void 0?s:[]},error:null}}})}catch(n){if(Re(n))return{data:{providers:[]},error:n};throw n}}async _createCustomProvider(e){try{return await Me(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Re(n))return{data:null,error:n};throw n}}async _getCustomProvider(e){try{const n=this._encodePathSegment(e);return await Me(this.fetch,"GET",`${this.url}/admin/custom-providers/${n}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(n){if(Re(n))return{data:null,error:n};throw n}}async _updateCustomProvider(e,n){try{const r=this._encodePathSegment(e);return await Me(this.fetch,"PUT",`${this.url}/admin/custom-providers/${r}`,{body:n,headers:this.headers,xform:s=>({data:s,error:null})})}catch(r){if(Re(r))return{data:null,error:r};throw r}}async _deleteCustomProvider(e){try{const n=this._encodePathSegment(e);return await Me(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${n}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(Re(n))return{data:null,error:n};throw n}}async _adminListPasskeys(e){Di(this.experimental),Cs(e.userId);try{return await Me(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Re(n))return{data:null,error:n};throw n}}async _adminDeletePasskey(e){Di(this.experimental),Cs(e.userId),Cs(e.passkeyId);
88try{return await Me(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(Re(n))return{data:null,error:n};throw n}}}function kk(t={}){return{getItem:e=>t[e]||null,setItem:(e,n)=>{t[e]=n},removeItem:e=>{delete t[e]}}}const Ki={debug:!!(globalThis&&FN()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class UN extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class jk extends UN{}async function iP(t,e,n){Ki.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const r=new globalThis.AbortController;let s;e>0&&(s=setTimeout(()=>{r.abort(),Ki.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:r.signal},async o=>{if(o){clearTimeout(s),Ki.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,o.name);try{return await n()}finally{Ki.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,o.name)}}else{if(e===0)throw Ki.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new jk(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(Ki.debug)try{const l=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(l,null,"  "))}catch(l){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",l)}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 n()}})}catch(o){if(e>0&&clearTimeout(s),o!==null&&typeof o=="object"&&"name"in o&&o.name==="AbortError"&&e>0){if(r.signal.aborted)return Ki.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 l=>{if(l){Ki.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",t,l.name);try{return await n()}finally{Ki.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",t,l.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await n()}));throw Ki.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",t),new jk(`Lock "${t}" was released because another request stole it`)}throw o}}function sP(){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 zN(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function aP(t){return parseInt(t,16)}function oP(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,r=>r.toString(16).padStart(2,"0")).join("")}function lP(t){var e;const{chainId:n,domain:r,expirationTime:s,issuedAt:o=new Date,nonce:l,notBefore:d,requestId:h,resources:p,scheme:g,uri:m,version:y}=t;{if(!Number.isInteger(n))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${n}`);if(!r)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(l&&l.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${l}`);if(!m)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(y!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${y}`);if(!((e=t.statement)===null||e===void 0)&&e.includes(`
89`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const b=zN(t.address),_=g?`${g}://${r}`:r,w=t.statement?`${t.statement}
90`:"",S=`${_} wants you to sign in with your Ethereum account:
91${b}
92
93${w}`;let E=`URI: ${m}
94Version: ${y}
95Chain ID: ${n}${l?`
96Nonce: ${l}`:""}
97Issued At: ${o.toISOString()}`;if(s&&(E+=`
98Expiration Time: ${s.toISOString()}`),d&&(E+=`
99Not Before: ${d.toISOString()}`),h&&(E+=`
100Request ID: ${h}`),p){let k=`
101Resources:`;
101for(const j of p){if(!j||typeof j!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${j}`);k+=`
102- ${j}`}E+=k}return`${S}
103${E}`}class On extends Error{constructor({message:e,code:n,cause:r,name:s}){var o;super(e,{cause:r}),this.__isWebAuthnError=!0,this.name=(o=s??(r instanceof Error?r.name:void 0))!==null&&o!==void 0?o:"Unknown Error",this.code=n}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class Mp extends On{constructor(e,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:e}),this.name="WebAuthnUnknownError",this.originalError=n}}function cP({error:t,options:e}){var n,r,s;const{publicKey:o}=e;if(!o)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new On({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((n=o.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new On({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&((r=o.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new On({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=o.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new On({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 On({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new On({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return o.pubKeyCredParams.filter(d=>d.type==="public-key").length===0?new On({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new On({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 l=window.location.hostname;if(BN(l)){if(o.rp.id!==l)return new On({message:`The RP ID "${o.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new On({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(o.user.id.byteLength<1||o.user.id.byteLength>64)return new On({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 On({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 On({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function uP({error:t,options:e}){const{publicKey:n}=e;if(!n)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new On({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new On({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const r=window.location.hostname;if(BN(r)){if(n.rpId!==r)return new On({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new On({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new On({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ER
103ROR",cause:t})}return new On({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class dP{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}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 W0=new dP;function Tk(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:n,excludeCredentials:r}=t,s=Am(t,["challenge","user","excludeCredentials"]),o=cc(e).buffer,l=Object.assign(Object.assign({},n),{id:cc(n.id).buffer}),d=Object.assign(Object.assign({},s),{challenge:o,user:l});if(r&&r.length>0){d.excludeCredentials=new Array(r.length);for(let h=0;h<r.length;h++){const p=r[h];d.excludeCredentials[h]=Object.assign(Object.assign({},p),{id:cc(p.id).buffer,type:p.type||"public-key",transports:p.transports})}}return d}function Nk(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:n}=t,r=Am(t,["challenge","allowCredentials"]),s=cc(e).buffer,o=Object.assign(Object.assign({},r),{challenge:s});if(n&&n.length>0){o.allowCredentials=new Array(n.length);for(let l=0;l<n.length;l++){const d=n[l];o.allowCredentials[l]=Object.assign(Object.assign({},d),{id:cc(d.id).buffer,type:d.type||"public-key",transports:d.transports})}}return o}function Ak(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const n=t;return{id:t.id,rawId:t.id,response:{attestationObject:Ao(new Uint8Array(t.response.attestationObject)),clientDataJSON:Ao(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function Ck(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const n=t,r=t.getClientExtensionResults(),s=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:Ao(new Uint8Array(s.authenticatorData)),clientDataJSON:Ao(new Uint8Array(s.clientDataJSON)),signature:Ao(new Uint8Array(s.signature)),userHandle:s.userHandle?Ao(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function BN(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function Lp(){var t,e;return!!(Zn()&&"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 HN(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Mp("Browser returned unexpected credential type",e)}:{data:null,error:new Mp("Empty credential response",e)}}catch(e){return{data:null,error:cP({error:e,options:t})}}}async function qN(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Mp("Browser returned unexpected credential type",e)}:{data:null,error:new Mp("Empty credential response",e)}}catch(e){return{data:null,error:uP({error:e,options:t})}}}const hP={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},fP={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Pp(...t){const e=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),n=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),r={};for(const s of t)if(s)for(const o in s){const l=s[o];if(l!==void 0)if(Array.isArray(l))r[o]=l;else if(n(l))r[o]=l;else if(e(l)){const d=r[o];e(d)?r[o]=Pp(d,l):r[o]=Pp(l)}else r[o]=l}return r}function pP(t,e){return Pp(hP,t,e||{})}function mP(t,e){return Pp(fP,t,e||{})}class gP{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:n,friendlyName:r,signal:s},o){var l;try{const{data:d,error:h}=await this.client.mfa.challenge({factorId:e,webauthn:n});if(!d)return{data:null,error:h};const p=s??W0.createNewAbortSignal();if(d.webauthn.type==="create"){const{user:g}=d.webauthn.credential_options.publicKey;if(!g.name){const m=r;if(m)g.name=`${g.id}:${m}`;else{const b=(await this.client.getUser()).data.user,_=((l=b==null?void 0:b.user_metadata)===null||l===void 0?void 0:l.name)||(b==null?void 0:b.email)||(b==null?void 0:b.id)||"User";g.name=`${g.id}:${_}`}}g.displayName||(g.displayName=g.name)}switch(d.webauthn.type){case"create":{const g=pP(d.webauthn.credential_options.publicKey,o==null?void 0:o.create),{data:m,error:y}=await HN({publicKey:g,signal:p});return m?{data:{factorId:e,challengeId:d.id,webauthn:{type:d.webauthn.type,credential_response:m}},error:null}:{data:null,error:y}}case"request":{const g=mP(d.webauthn.credential_options.publicKey,o==null?void 0:o.request),{data:m,error:y}=await qN(Object.assign(Object.assign({},d.webauthn.credential_options),{publicKey:g,signal:p}));return m?{data:{factorId:e,challengeId:d.id,webauthn:{type:d.webauthn.type,credential_response:m}},error:null}:{data:null,error:y}}}}catch(d){return Re(d)?{data:null,error:d}:{data:null,error:new Pi("Unexpected error in challenge",d)}}}async _verify({challengeId:e,factorId:n,webauthn:r}){return this.client.mfa.verify({factorId:n,challengeId:e,webauthn:r})}async _authenticate({factorId:e,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},o){if(!n)return{data:null,error:new mc("rpId is required for WebAuthn authentication")};try{if(!Lp())return{data:null,error:new Pi("Browser does not support WebAuthn",null)};const{data:l,error:d}=await this.challenge({factorId:e,webauthn:{rpId:n,rpOrigins:r},signal:s},{request:o});if(!l)return{data:null,error:d};const{webauthn:h}=l;return this._verify({factorId:e,challengeId:l.challengeId,webauthn:{type:h.type,rpId:n,rpOrigins:r,credential_response:h.credential_response}})}catch(l){return Re(l)?{data:null,error:l}:{data:null,error:new Pi("Unexpected error in authenticate",l)}
103}}async _register({friendlyName:e,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},o){if(!n)return{data:null,error:new mc("rpId is required for WebAuthn registration")};try{if(!Lp())return{data:null,error:new Pi("Browser does not support WebAuthn",null)};const{data:l,error:d}=await this._enroll({friendlyName:e});if(!l)return await this.client.mfa.listFactors().then(g=>{var m;return(m=g.data)===null||m===void 0?void 0:m.all.find(y=>y.factor_type==="webauthn"&&y.friendly_name===e&&y.status!=="unverified")}).then(g=>g?this.client.mfa.unenroll({factorId:g==null?void 0:g.id}):void 0),{data:null,error:d};const{data:h,error:p}=await this._challenge({factorId:l.id,friendlyName:l.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:s},{create:o});return h?this._verify({factorId:l.id,challengeId:h.challengeId,webauthn:{rpId:n,rpOrigins:r,type:h.webauthn.type,credential_response:h.webauthn.credential_response}}):{data:null,error:p}}catch(l){return Re(l)?{data:null,error:l}:{data:null,error:new Pi("Unexpected error in register",l)}}}}sP();const vP={url:_L,storageKey:wL,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:SL,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}};async function Rk(t,e,n){return await n()}const Ml={};class Sd{get jwks(){var e,n;return(n=(e=Ml[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(e){Ml[this.storageKey]=Object.assign(Object.assign({},Ml[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,n;return(n=(e=Ml[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){Ml[this.storageKey]=Object.assign(Object.assign({},Ml[this.storageKey]),{cachedAt:e})}constructor(e){var n,r,s,o;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 l=Object.assign(Object.assign({},vP),e);if(this.storageKey=l.storageKey,this.instanceID=(n=Sd.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,Sd.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!l.debug,typeof l.debug=="function"&&(this.logger=l.debug),this.instanceID>0&&Zn()){const d=`${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(d),this.logDebugMessages&&console.trace(d)}if(this.persistSession=l.persistSession,this.autoRefreshToken=l.autoRefreshToken,this.experimental=(r=l.experimental)!==null&&r!==void 0?r:{},this.admin=new rP({url:l.url,headers:l.headers,fetch:l.fetch,experimental:this.experimental}),this.url=l.url,this.headers=l.headers,this.fetch=$N(l.fetch),this.lock=l.lock||Rk,this.detectSessionInUrl=l.detectSessionInUrl,this.flowType=l.flowType,this.hasCustomAuthorizationHeader=l.hasCustomAuthorizationHeader,this.throwOnError=l.throwOnError,this.lockAcquireTimeout=l.lockAcquireTimeout,l.lock?this.lock=l.lock:this.persistSession&&Zn()&&(!((s=globalThis==null?void 0:globalThis.navigator)===null||s===void 0)&&s.locks)?this.lock=iP:this.lock=Rk,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 gP(this)}
103,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.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(l.storage?this.storage=l.storage:FN()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=kk(this.memoryStorage)),l.userStorage&&(this.userStorage=l.userStorage)):(this.memoryStorage={},this.storage=kk(this.memoryStorage)),Zn()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(d){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",d)}(o=this.broadcastChannel)===null||o===void 0||o.addEventListener("message",async d=>{this._debug("received broadcast notification from other tab or client",d);try{await this._notifyAllSubscribers(d.data.event,d.data.session,!1)}catch(h){this._debug("#broadcastChannel","error",h)}})}l.skipAutoInitialize||this.initialize().catch(d=>{this._debug("#initialize()","error",d)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${MN}) ${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 n={},r="none";if(Zn()&&(n=PL(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),Zn()&&this.detectSessionInUrl&&r!=="none"){const{data:s,error:o}=await this._getSessionFromURL(n,r);if(o){if(this._debug("#_initialize()","error detecting session from URL",o),NL(o)){const h=(e=o.details)===null||e===void 0?void 0:e.code;if(h==="identity_already_exists"||h==="identity_not_found"||h==="single_identity_not_deletable")return{error:o}}return{error:o}}const{session:l,redirectType:d}=s;return this._debug("#_initialize()","detected session in URL",l,"redirect type",d),await this._saveSession(l),setTimeout(async()=>{d==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",l):await this._notifyAllSubscribers("SIGNED_IN",l)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return Re(n)?this._returnResult({error:n}):this._returnResult({error:new Pi("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var n,r,s;try{const o=await Me(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(s=e==null?void 0:e.options)===null||s===void 0?void 0:s.captchaToken}},xform:hi}),{data:l,error:d}=o;if(d||!l)return this._returnResult({data:{user:null,session:null},error:d});const h=l.session,p=l.user;return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",h)),this._returnResult({data:{user:p,session:h},error:null})}catch(o){if(Re(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signUp(e){var n,r,s;try{let o;if("email"in e){const{email:g,password:m,options:y}=e;let b=null,_=null;this.flowType==="pkce"&&([b,_]=await Il(this.storage,this.storageKey)),o=await Me(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:y==null?void 0:y.emailRedirectTo,body:{email:g,password:m,data:(n=y==null?void 0:y.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:y==null?void 0:y.captchaToken},code_challenge:b,code_challenge_method:_},xform:hi})}else if("phone"in e){const{phone:g,password:m,options:y}=e;o=await Me(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:g,password:m,data:(r=y==null?void 0:y.data)!==null&&r!==void 0?r:{},channel:(s=y==null?void 0:y.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:y==null?void 0:y.captchaToken}},xform:hi})}else throw new Uf("You must provide either an email or phone number and a password");const{data:l,error:d}=o;if(d||!l)return await Xn(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:d});const h=l.session,p=l.user;return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",h)),this._returnResult({data:{user:p,session:h},error:null})}catch(o){if(await Xn(this.storage,`${this.storageKey}-code-verifier`),Re(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signInWithPassword(e){try{let n;if("email"in e){const{email:o,password:l,options:d}=e;n=await Me(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:o,password:l,gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken}},xform:Sk})}else if("phone"in e){const{phone:o,password:l,options:d}=e;n=await Me(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:o,password:l,gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken}},xform:Sk})}else throw new Uf("You must provide either an email or phone number and a password");const{data:r,error:s}=n;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!r||!r.session||!r.user){const o=new Dl;return this._returnResult({data:{user:null,session:null},error:o})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:s})}catch(n){if(Re(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(e){var n,r,s,o;return await this._handleProviderSignIn(e.provider,{redirectTo:(n=e.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=e.options)===null||r===void 0?void 0:r.scopes,queryParams:(s=e.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(o=e.options)===null||o===void 0?void 0:o.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:n}=e;switch(n){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(e){var n,r,s,o,l,d,h,p,g,m,y;let b,_;if("message"in e)b=e.message,_=e.signature;else{const{chain:w,wallet:S,statement:E,options:k}=e;let j;if(Zn())if(typeof S=="object")j=S;else{const B=window;if("ethereum"in B&&typeof B.ethereum=="object"&&"request"in B.ethereum&&typeof B.ethereum.request=="function")j=B.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 S!="object"||!(k!=null&&k.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");j=S}const N=new URL((n=k==null?void 0:k.url)!==null&&n!==void 0?n:window.location.href),O=await j.request({method:"eth_requestAccounts"}).then(B=>B).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!O||O.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const D=zN(O[0]);let F=(r=k==null?void 0:k.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!F){const B=await j.request({method:"eth_chainId"});F=aP(B)}const R={domain:N.host,address:D,statement:E,uri:N.href,version:"1",chainId:F,nonce:(s=k==null?void 0:k.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(l=(o=k==null?void 0:k.signInWithEthereum)===null||o===void 0?void 0:o.issuedAt)!==null&&l!==void 0?l:new Date,expirationTime:(d=k==null?void 0:k.signInWithEthereum)===null||d===void 0?void 0:d.expirationTime,notBefore:(h=k==null?void 0:k.signInWithEthereum)===null||h===void 0?void 0:h.notBefore,requestId:(p=k==null?void 0:k.signInWithEthereum)===null||p===void 0?void 0:p.requestId,resources:(g=k==null?void 0:k.signInWithEthereum)===null||g===void 0?void 0:g.resources};b=lP(R),_=await j.request({method:"personal_sign",params:[oP(b),D]})}try{const{data:w,error:S}=await Me(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:b,signature:_},!((m=e.options)===null||m===void 0)&&m.captchaToken?{gotrue_meta_security:{captcha_token:(y=e.options)===null||y===void 0?void 0:y.captchaToken}}:null),xform:hi});if(S)throw S;if(!w||!w.session||!w.user){const E=new Dl;return this._returnResult({data:{user:null,session:null},error:E})}return w.session&&(await this._saveSession(w.session),await this._notifyAllSubscribers("SIGNED_IN",w.session)),this._returnResult({data:Object.assign({},w),error:S})}catch(w){if(Re(w))return this._returnResult({data:{user:null,session:null},error:w});throw w}}async signInWithSolana(e){var n,r,s,o,l,d,h,p,g,m,y,b;let _,w;if("message"in e)_=e.message,w=e.signature;else{const{chain:S,wallet:E,statement:k,options:j}=e;let N;if(Zn())if(typeof E=="object")N=E;else{const D=window;
103if("solana"in D&&typeof D.solana=="object"&&("signIn"in D.solana&&typeof D.solana.signIn=="function"||"signMessage"in D.solana&&typeof D.solana.signMessage=="function"))N=D.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 E!="object"||!(j!=null&&j.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");N=E}const O=new URL((n=j==null?void 0:j.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in N&&N.signIn){const D=await N.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},j==null?void 0:j.signInWithSolana),{version:"1",domain:O.host,uri:O.href}),k?{statement:k}:null));let F;if(Array.isArray(D)&&D[0]&&typeof D[0]=="object")F=D[0];else if(D&&typeof D=="object"&&"signedMessage"in D&&"signature"in D)F=D;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in F&&"signature"in F&&(typeof F.signedMessage=="string"||F.signedMessage instanceof Uint8Array)&&F.signature instanceof Uint8Array)_=typeof F.signedMessage=="string"?F.signedMessage:new TextDecoder().decode(F.signedMessage),w=F.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in N)||typeof N.signMessage!="function"||!("publicKey"in N)||typeof N!="object"||!N.publicKey||!("toBase58"in N.publicKey)||typeof N.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");_=[`${O.host} wants you to sign in with your Solana account:`,N.publicKey.toBase58(),...k?["",k,""]:[""],"Version: 1",`URI: ${O.href}`,`Issued At: ${(s=(r=j==null?void 0:j.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((o=j==null?void 0:j.signInWithSolana)===null||o===void 0)&&o.notBefore?[`Not Before: ${j.signInWithSolana.notBefore}`]:[],...!((l=j==null?void 0:j.signInWithSolana)===null||l===void 0)&&l.expirationTime?[`Expiration Time: ${j.signInWithSolana.expirationTime}`]:[],...!((d=j==null?void 0:j.signInWithSolana)===null||d===void 0)&&d.chainId?[`Chain ID: ${j.signInWithSolana.chainId}`]:[],...!((h=j==null?void 0:j.signInWithSolana)===null||h===void 0)&&h.nonce?[`Nonce: ${j.signInWithSolana.nonce}`]:[],...!((p=j==null?void 0:j.signInWithSolana)===null||p===void 0)&&p.requestId?[`Request ID: ${j.signInWithSolana.requestId}`]:[],...!((m=(g=j==null?void 0:j.signInWithSolana)===null||g===void 0?void 0:g.resources)===null||m===void 0)&&m.length?["Resources",...j.signInWithSolana.resources.map(F=>`- ${F}`)]:[]].join(`
104`);const D=await N.signMessage(new TextEncoder().encode(_),"utf8");if(!D||!(D instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");w=D}}try{const{data:S,error:E}=await Me(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:_,signature:Ao(w)},!((y=e.options)===null||y===void 0)&&y.captchaToken?{gotrue_meta_security:{captcha_token:(b=e.options)===null||b===void 0?void 0:b.captchaToken}}:null),xform:hi});if(E)throw E;if(!S||!S.session||!S.user){const k=new Dl;return this._returnResult({data:{user:null,session:null},error:k})}return S.session&&(await this._saveSession(S.session),await this._notifyAllSubscribers("SIGNED_IN",S.session)),this._returnResult({data:Object.assign({},S),error:E})}catch(S){if(Re(S))return this._returnResult({data:{user:null,session:null},error:S});throw S}}async _exchangeCodeForSession(e){const n=await po(this.storage,`${this.storageKey}-code-verifier`),[r,s]=(n??"").split("/");try{if(!r&&this.flowType==="pkce")throw new AL;const{data:o,error:l}=await Me(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:hi});if(await Xn(this.storage,`${this.storageKey}-code-verifier`),l)throw l;if(!o||!o.session||!o.user){const d=new Dl;return this._returnResult({data:{user:null,session:null,redirectType:null},error:d})}return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers(s==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",o.session)),this._returnResult({data:Object.assign(Object.assign({},o),{redirectType:s??null}),error:l})}catch(o){if(await Xn(this.storage,`${this.storageKey}-code-verifier`),Re(o))return this._returnResult({data:{user:null,session:null,redirectType:null},error:o});throw o}}async signInWithIdToken(e){try{const{options:n,provider:r,token:s,access_token:o,nonce:l}=e,d=await Me(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:s,access_token:o,nonce:l,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:hi}),{data:h,error:p}=d;if(p)return this._returnResult({data:{user:null,session:null},error:p});if(!h||!h.session||!h.user){const g=new Dl;return this._returnResult({data:{user:null,session:null},error:g})}return h.session&&(await this._saveSession(h.session),await this._notifyAllSubscribers("SIGNED_IN",h.session)),this._returnResult({data:h,error:p})}catch(n){if(Re(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(e){var n,r,s,o,l;try{if("email"in e){const{email:d,options:h}=e;let p=null,g=null;this.flowType==="pkce"&&([p,g]=await Il(this.storage,this.storageKey));const{error:m}=await Me(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:d,data:(n=h==null?void 0:h.data)!==null&&n!==void 0?n:{},create_user:(r=h==null?void 0:h.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken},code_challenge:p,code_challenge_method:g},redirectTo:h==null?void 0:h.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:m})}if("phone"in e){const{phone:d,options:h}=e,{data:p,error:g}=await Me(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:d,data:(s=h==null?void 0:h.data)!==null&&s!==void 0?s:{},create_user:(o=h==null?void 0:h.shouldCreateUser)!==null&&o!==void 0?o:!0,gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken},channel:(l=h==null?void 0:h.channel)!==null&&l!==void 0?l:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:p==null?void 0:p.message_id},error:g})}throw new Uf("You must provide either an email or phone number.")}catch(d){if(await Xn(this.storage,`${this.storageKey}-code-verifier`),Re(d))return this._returnResult({data:{user:null,session:null},error:d});throw d}}async verifyOtp(e){var n,r;try{let s,o;"options"in e&&(s=(n=e.options)===null||n===void 0?void 0:n.redirectTo,o=(r=e.options)===null||r===void 0?void 0:r.captchaToken);const{data:l,error:d}=await Me(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:o}}),redirectTo:s,xform:hi});if(d)throw d;if(!l)throw new Error("An error occurred on token verification.");const h=l.session,p=l.user;return h!=null&&h.access_token&&(await this._saveSession(h),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",h)),this._returnResult({data:{user:p,session:h},error:null})}catch(s){if(Re(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(e){var n,r,s,o,l;try{let d=null,h=null;this.flowType==="pkce"&&([d,h]=await Il(this.storage,this.storageKey));const p=await Me(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:(r=(n=e.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r: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:d,code_challenge_method:h}),headers:this.headers,xform:eP});return!((o=p.data)===null||o===void 0)&&o.url&&Zn()&&!(!((l=e.options)===null||l===void 0)&&l.skipBrowserRedirect)&&window.location.assign(p.data.url),this._returnResult(p)}catch(d){if(await Xn(this.storage,`${this.storageKey}-code-verifier`),Re(d))return this._returnResult({data:null,error:d});throw d}}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:n},error:r}=e;if(r)throw r;if(!n)throw new qn;const{error:s}=await Me(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(e){if(Re(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const n=`${this.url}/resend`;if("email"in e){const{email:r,type:s,options:o}=e,{error:l}=await Me(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:s,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},redirectTo:o==null?void 0:o.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:l})}else if("phone"in e){const{phone:r,type:s,options:o}=e,{data:l,error:d}=await Me(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:s,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:l==null?void 0:l.message_id},error:d})}throw new Uf("You must provide either an email or phone number and a type")}catch(n){if(Re(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async n=>n))}async _acquireLock(e,n){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await r,await n()))();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 r=n();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await r}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 n=await this.__loadSession();return await e(n)}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 n=await po(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?e=n:(this._debug("#getSession()","session from storage is not val
104id"),await this._removeSession())),!e)return{data:{session:null},error:null};const r=e.expires_at?e.expires_at*1e3-Date.now()<vy:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",e.expires_at),!r){if(this.userStorage){const l=await po(this.userStorage,this.storageKey+"-user");l!=null&&l.user?e.user=l.user:e.user=by()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const l={value:this.suppressGetSessionWarning};e.user=JL(e.user,l),l.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:s,error:o}=await this._callRefreshToken(e.refresh_token);return o?this._returnResult({data:{session:null},error:o}):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 n=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return n.data.user&&(this.suppressGetSessionWarning=!0),n}async _getUser(e){try{return e?await Me(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:Ma}):await this._useSession(async n=>{var r,s,o;const{data:l,error:d}=n;if(d)throw d;return!(!((r=l.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new qn}:await Me(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(o=(s=l.session)===null||s===void 0?void 0:s.access_token)!==null&&o!==void 0?o:void 0,xform:Ma})})}catch(n){if(Re(n))return $f(n)&&(await this._removeSession(),await Xn(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(e,n={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,n))}async _updateUser(e,n={}){try{return await this._useSession(async r=>{const{data:s,error:o}=r;if(o)throw o;if(!s.session)throw new qn;const l=s.session;let d=null,h=null;this.flowType==="pkce"&&e.email!=null&&([d,h]=await Il(this.storage,this.storageKey));const{data:p,error:g}=await Me(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:d,code_challenge_method:h}),jwt:l.access_token,xform:Ma});if(g)throw g;return l.user=p.user,await this._saveSession(l),await this._notifyAllSubscribers("USER_UPDATED",l),this._returnResult({data:{user:l.user},error:null})})}catch(r){if(await Xn(this.storage,`${this.storageKey}-code-verifier`),Re(r))return this._returnResult({data:{user:null},error:r});throw r}}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 qn;const n=Date.now()/1e3;let r=n,s=!0,o=null;const{payload:l}=Bf(e.access_token);if(l.exp&&(r=l.exp,s=r<=n),s){const{data:d,error:h}=await this._callRefreshToken(e.refresh_token);if(h)return this._returnResult({data:{user:null,session:null},error:h});if(!d)return{data:{user:null,session:null},error:null};o=d}else{const{data:d,error:h}=await this._getUser(e.access_token);if(h)return this._returnResult({data:{user:null,session:null},error:h});o={access_token:e.access_token,refresh_token:e.refresh_token,user:d.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)}return this._returnResult({data:{user:o.user,session:o},error:null})}catch(n){if(Re(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}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 n=>{var r;if(!e){const{data:l,error:d}=n;if(d)throw d;e=(r=l.session)!==null&&r!==void 0?r:void 0}if(!(e!=null&&e.refresh_token))throw new qn;const{data:s,error:o}=await this._callRefreshToken(e.refresh_token);return o?this._returnResult({data:{user:null,session:null},error:o}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(Re(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(e,n){var r;
104try{if(!Zn())throw new zf("No browser detected.");if(e.error||e.error_description||e.error_code)throw new zf(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new gk("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new zf("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new gk("No code detected.");const{data:j,error:N}=await this._exchangeCodeForSession(e.code);if(N)throw N;const O=new URL(window.location.href);return O.searchParams.delete("code"),window.history.replaceState(window.history.state,"",O.toString()),{data:{session:j.session,redirectType:(r=j.redirectType)!==null&&r!==void 0?r:null},error:null}}const{provider_token:s,provider_refresh_token:o,access_token:l,refresh_token:d,expires_in:h,expires_at:p,token_type:g}=e;if(!l||!h||!d||!g)throw new zf("No session defined in URL");const m=Math.round(Date.now()/1e3),y=parseInt(h);let b=m+y;p&&(b=parseInt(p));const _=b-m;_*1e3<=Kl&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${_}s, should have been closer to ${y}s`);const w=b-y;m-w>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",w,b,m):m-w<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",w,b,m);const{data:S,error:E}=await this._getUser(l);if(E)throw E;const k={provider_token:s,provider_refresh_token:o,access_token:l,expires_in:y,expires_at:b,refresh_token:d,token_type:g,user:S.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:k,redirectType:e.type},error:null})}catch(s){if(Re(s))return this._returnResult({data:{session:null,redirectType:null},error:s});throw s}}_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 n=await po(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&n)}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 n=>{var r;const{data:s,error:o}=n;if(o&&!$f(o))return this._returnResult({error:o});const l=(r=s.session)===null||r===void 0?void 0:r.access_token;if(l){const{error:d}=await this.admin.signOut(l,e);if(d&&!(TL(d)&&(d.status===404||d.status===401||d.status===403)||$f(d)))return this._returnResult({error:d})}return e!=="others"&&(await this._removeSession(),await Xn(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const n=LL(),r={id:n,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,r),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async n=>{var r,s;try{const{data:{session:o},error:l}=n;if(l)throw l;await((r=this.stateChangeEmitters.get(e))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",o)),this._debug("INITIAL_SESSION","callback id",e,"session",o)}catch(o){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",o),$f(o)?console.warn(o):console.error(o)}})}async resetPasswordForEmail(e,n={}){let r=null,s=null;this.flowType==="pkce"&&([r,s]=await Il(this.storage,this.storageKey,!0));try{return await Me(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:s,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(o){if(await Xn(this.storage,`${this.storageKey}-code-verifier`),Re(o))return this._returnResult({data:null,error:o});throw o}}async getUserIdentities(){var e;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(e=n.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(n){if(Re(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var n;try{const{data:r,error:s}=await this._useSession(async o=>{var l,d,h,p,g;const{data:m,error:y}=o;if(y)throw y;const b=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(l=e.options)===null||l===void 0?void 0:l.redirectTo,scopes:(d=e.options)===null||d===void 0?void 0:d.scopes,queryParams:(h=e.options)===null||h===void 0?void 0:h.queryParams,skipBrowserRedirect:!0});return await Me(this.fetch,"GET",b,{headers:this.headers,jwt:(g=(p=m.session)===null||p===void 0?void 0:p.access_token)!==null&&g!==void 0?g:void 0})});if(s)throw s;return Zn()&&!(!((n=e.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),this._returnResult({data:{provider:e.provider,url:r==null?void 0:r.url},error:null})}catch(r){if(Re(r))return this._returnResult({data:{provider:e.provider,url:null},error:r});throw r}}async linkIdentityIdToken(e){return await this._useSession(async n=>{var r;try{const{error:s,data:{session:o}}=n;if(s)throw s;const{options:l,provider:d,token:h,access_token:p,nonce:g}=e,m=await Me(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=o==null?void 0:o.access_token)!==null&&r!==void 0?r:void 0,body:{provider:d,id_token:h,access_token:p,nonce:g,link_identity:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:hi}),{data:y,error:b}=m;return b?this._returnResult({data:{user:null,session:null},error:b}):!y||!y.session||!y.user?this._returnResult({data:{user:null,session:null},error:new Dl}):(y.session&&(await this._saveSession(y.session),await this._notifyAllSubscribers("USER_UPDATED",y.session)),this._returnResult({data:y,error:b}))}catch(s){if(await Xn(this.storage,`${this.storageKey}-code-verifier`),Re(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(e){try{return await this._useSession(async n=>{var r,s;const{data:o,error:l}=n;if(l)throw l;
104return await Me(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(s=(r=o.session)===null||r===void 0?void 0:r.access_token)!==null&&s!==void 0?s:void 0})})}catch(n){if(Re(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(e){const n=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(n,"begin");try{const r=Date.now();return await UL(async s=>(s>0&&await $L(200*Math.pow(2,s-1)),this._debug(n,"refreshing attempt",s),await Me(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:hi})),(s,o)=>{const l=200*Math.pow(2,s);return o&&yy(o)&&Date.now()+l-r<Kl})}catch(r){if(this._debug(n,"error",r),Re(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(n,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",n,"url",r),Zn()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e,n;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const s=await po(this.storage,this.storageKey);if(s&&this.userStorage){let l=await po(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!l&&(l={user:s.user},await Jl(this.userStorage,this.storageKey+"-user",l)),s.user=(e=l==null?void 0:l.user)!==null&&e!==void 0?e:by()}else if(s&&!s.user&&!s.user){const l=await po(this.storage,this.storageKey+"-user");l&&(l!=null&&l.user)?(s.user=l.user,await Xn(this.storage,this.storageKey+"-user"),await Jl(this.storage,this.storageKey,s)):s.user=by()}if(this._debug(r,"session from storage",s),!this._isValidSession(s)){this._debug(r,"session is not valid"),s!==null&&await this._removeSession();return}const o=((n=s.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<vy;if(this._debug(r,`session has${o?"":" not"} expired with margin of ${vy}s`),o){if(this.autoRefreshToken&&s.refresh_token){const{error:l}=await this._callRefreshToken(s.refresh_token);l&&(console.error(l),yy(l)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",l),await this._removeSession()))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:l,error:d}=await this._getUser(s.access_token);!d&&(l!=null&&l.user)?(s.user=l.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(l){console.error("Error getting user data:",l),this._debug(r,"error getting user data, skipping SIGNED_IN notification",l)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(r,"error",s),console.error(s);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var n,r;if(!e)throw new qn;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new Om;const{data:o,error:l}=await this._refreshAccessToken(e);if(l)throw l;if(!o.session)throw new qn;await this._saveSession(o.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",o.session);const d={data:o.session,error:null};return this.refreshingDeferred.resolve(d),d}catch(o){if(this._debug(s,"error",o),Re(o)){const l={data:null,error:o};return yy(o)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(l),l}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(o),o}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(e,n,r=!0){const s=`#_notifyAllSubscribers(${e})`;this._debug(s,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:n});const o=[],l=Array.from(this.stateChangeEmitters.values()).map(async d=>{try{await d.callback(e,n)}catch(h){o.push(h)}});if(await Promise.all(l),o.length>0){for(let d=0;d<o.length;d+=1)console.error(o[d]);throw o[0]}}finally{this._debug(s,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await Xn(this.storage,`${this.storageKey}-code-verifier`);const n=Object.assign({},e),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await Jl(this.userStorage,this.storageKey+"-user",{user:n.user});const s=Object.assign({},n);delete s.user;const o=_k(s);await Jl(this.storage,this.storageKey,o)}else{const s=_k(n);await Jl(this.storage,this.storageKey,s)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Xn(this.storage,this.storageKey),await Xn(this.storage,this.storageKey+"-code-verifier"),await Xn(this.storage,this.storageKey+"-user"),this.userStorage&&await Xn(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Zn()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}
104catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),Kl);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e);const n=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);const n=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,n&&clearTimeout(n)}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 n=>{const{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((r.expires_at*1e3-e)/Kl);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${Kl}ms, refresh threshold is ${H0} ticks`),s<=H0&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e instanceof UN)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Zn()||!(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 n=`#_onVisibilityChanged(${e})`;this._debug(n,"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(n,"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,n,r){const s=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&s.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&s.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[o,l]=await Il(this.storage,this.storageKey),d=new URLSearchParams({code_challenge:`${encodeURIComponent(o)}`,code_challenge_method:`${encodeURIComponent(l)}`});s.push(d.toString())}if(r!=null&&r.queryParams){const o=new URLSearchParams(r.queryParams);s.push(o.toString())}return r!=null&&r.skipBrowserRedirect&&s.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${e}?${s.join("&")}`}async _unenroll(e){try{return await this._useSession(async n=>{var r;const{data:s,error:o}=n;return o?this._returnResult({data:null,error:o}):await Me(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(Re(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(e){try{return await this._useSession(async n=>{var r,s;const{data:o,error:l}=n;if(l)return this._returnResult({data:null,error:l});const d=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:h,error:p}=await Me(this.fetch,"POST",`${this.url}/factors`,{body:d,headers:this.headers,jwt:(r=o==null?void 0:o.session)===null||r===void 0?void 0:r.access_token});return p?this._returnResult({data:null,error:p}):(e.factorType==="totp"&&h.type==="totp"&&(!((s=h==null?void 0:h.totp)===null||s===void 0)&&s.qr_code)&&(h.totp.qr_code=`data:image/svg+xml;utf-8,${h.totp.qr_code}`),this._returnResult({data:h,error:null}))})}catch(n){if(Re(n))return this._returnResult({data:null,error:n});throw n}}async _verify(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:s,error:o}=n;
104if(o)return this._returnResult({data:null,error:o});const l=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?Ak(e.webauthn.credential_response):Ck(e.webauthn.credential_response)})}:{code:e.code}),{data:d,error:h}=await Me(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:l,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});return h?this._returnResult({data:null,error:h}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+d.expires_in},d)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",d),this._returnResult({data:d,error:h}))})}catch(n){if(Re(n))return this._returnResult({data:null,error:n});throw n}})}async _challenge(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:s,error:o}=n;if(o)return this._returnResult({data:null,error:o});const l=await Me(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});if(l.error)return l;const{data:d}=l;if(d.type!=="webauthn")return{data:d,error:null};switch(d.webauthn.type){case"create":return{data:Object.assign(Object.assign({},d),{webauthn:Object.assign(Object.assign({},d.webauthn),{credential_options:Object.assign(Object.assign({},d.webauthn.credential_options),{publicKey:Tk(d.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},d),{webauthn:Object.assign(Object.assign({},d.webauthn),{credential_options:Object.assign(Object.assign({},d.webauthn.credential_options),{publicKey:Nk(d.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(Re(n))return this._returnResult({data:null,error:n});throw n}})}async _challengeAndVerify(e){const{data:n,error:r}=await this._challenge({factorId:e.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:e.factorId,challengeId:n.id,code:e.code})}async _listFactors(){var e;const{data:{user:n},error:r}=await this.getUser();if(r)return{data:null,error:r};const s={all:[],phone:[],totp:[],webauthn:[]};for(const o of(e=n==null?void 0:n.factors)!==null&&e!==void 0?e:[])s.all.push(o),o.status==="verified"&&s[o.factor_type].push(o);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(e){var n,r,s,o;if(e)try{const{payload:b}=Bf(e);let _=null;b.aal&&(_=b.aal);let w=_;const{data:{user:S},error:E}=await this.getUser(e);if(E)return this._returnResult({data:null,error:E});((r=(n=S==null?void 0:S.factors)===null||n===void 0?void 0:n.filter(N=>N.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(w="aal2");const j=b.amr||[];return{data:{currentLevel:_,nextLevel:w,currentAuthenticationMethods:j},error:null}}catch(b){if(Re(b))return this._returnResult({data:null,error:b});throw b}const{data:{session:l},error:d}
104=await this.getSession();if(d)return this._returnResult({data:null,error:d});if(!l)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:h}=Bf(l.access_token);let p=null;h.aal&&(p=h.aal);let g=p;((o=(s=l.user.factors)===null||s===void 0?void 0:s.filter(b=>b.status==="verified"))!==null&&o!==void 0?o:[]).length>0&&(g="aal2");const y=h.amr||[];return{data:{currentLevel:p,nextLevel:g,currentAuthenticationMethods:y},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;return s?this._returnResult({data:null,error:s}):r?await Me(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:r.access_token,xform:o=>({data:o,error:null})}):this._returnResult({data:null,error:new qn})})}catch(n){if(Re(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(e,n){try{return await this._useSession(async r=>{const{data:{session:s},error:o}=r;if(o)return this._returnResult({data:null,error:o});if(!s)return this._returnResult({data:null,error:new qn});const l=await Me(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:d=>({data:d,error:null})});return l.data&&l.data.redirect_url&&Zn()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(l.data.redirect_url),l})}catch(r){if(Re(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(e,n){try{return await this._useSession(async r=>{const{data:{session:s},error:o}=r;if(o)return this._returnResult({data:null,error:o});if(!s)return this._returnResult({data:null,error:new qn});const l=await Me(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:d=>({data:d,error:null})});return l.data&&l.data.redirect_url&&Zn()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(l.data.redirect_url),l})}catch(r){if(Re(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:n},error:r}=e;return r?this._returnResult({data:null,error:r}):n?await Me(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new qn})})}catch(e){if(Re(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;return s?this._returnResult({data:null,error:s}):r?(await Me(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new qn})})}catch(n){if(Re(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(e,n={keys:[]}){let r=n.keys.find(d=>d.kid===e);if(r)return r;const s=Date.now();if(r=this.jwks.keys.find(d=>d.kid===e),r&&this.jwks_cached_at+kL>s)return r;const{data:o,error:l}=await Me(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(l)throw l;return!o.keys||o.keys.length===0||(this.jwks=o,this.jwks_cached_at=s,r=o.keys.find(d=>d.kid===e),!r)?null:r}async getClaims(e,n={}){try{let r=e;if(!r){const{data:b,error:_}
104=await this.getSession();if(_||!b.session)return this._returnResult({data:null,error:_});r=b.session.access_token}const{header:s,payload:o,signature:l,raw:{header:d,payload:h}}=Bf(r);n!=null&&n.allowExpired||WL(o.exp);const p=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!p){const{error:b}=await this.getUser(r);if(b)throw b;return{data:{claims:o,header:s,signature:l},error:null}}const g=YL(s.alg),m=await crypto.subtle.importKey("jwk",p,g,!0,["verify"]);if(!await crypto.subtle.verify(g,m,l,IL(`${d}.${h}`)))throw new V0("Invalid JWT signature");return{data:{claims:o,header:s,signature:l},error:null}}catch(r){if(Re(r))return this._returnResult({data:null,error:r});throw r}}async signInWithPasskey(e){var n,r,s;Di(this.experimental);try{if(!Lp())return this._returnResult({data:null,error:new Pi("Browser does not support WebAuthn",null)});const{data:o,error:l}=await this._startPasskeyAuthentication({options:{captchaToken:(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.captchaToken}});if(l||!o)return this._returnResult({data:null,error:l});const d=Nk(o.options),h=(s=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.signal)!==null&&s!==void 0?s:W0.createNewAbortSignal(),{data:p,error:g}=await qN({publicKey:d,signal:h});if(g||!p)return this._returnResult({data:null,error:g??new Pi("WebAuthn ceremony failed",null)});const m=Ck(p);return this._verifyPasskeyAuthentication({challengeId:o.challenge_id,credential:m})}catch(o){if(Re(o))return this._returnResult({data:null,error:o});throw o}}async registerPasskey(e){var n,r;Di(this.experimental);try{if(!Lp())return this._returnResult({data:null,error:new Pi("Browser does not support WebAuthn",null)});const{data:s,error:o}=await this._startPasskeyRegistration();if(o||!s)return this._returnResult({data:null,error:o});const l=Tk(s.options),d=(r=(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.signal)!==null&&r!==void 0?r:W0.createNewAbortSignal(),{data:h,error:p}=await HN({publicKey:l,signal:d});if(p||!h)return this._returnResult({data:null,error:p??new Pi("WebAuthn ceremony failed",null)});const g=Ak(h);return this._verifyPasskeyRegistration({challengeId:s.challenge_id,credential:g})}catch(s){if(Re(s))return this._returnResult({data:null,error:s});throw s}}async _startPasskeyRegistration(){Di(this.experimental);try{return await this._useSession(async e=>{const{data:{session:n},error:r}=e;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new qn});const{data:s,error:o}=await Me(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:n.access_token,body:{}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:s,error:null})})}catch(e){if(Re(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){Di(this.experimental);try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!r)return this._returnResult({data:null,error:new qn});const{data:o,error:l}=await Me(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:r.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return l?this._returnResult({data:null,error:l}):this._returnResult({data:o,error:null})})}catch(n){if(Re(n))return this._returnResult({data:null,error:n});throw n}}async _startPasskeyAuthentication(e){var n;Di(this.experimental);try{const{data:r,error:s}=await Me(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.captchaToken}}});return s?this._returnResult({data:null,error:s}):this._returnResult({data:r,error:null})}catch(r){if(Re(r))return this._returnResult({data:null,error:r});throw r}}async _verifyPasskeyAuthentication(e){Di(this.experimental);try{const{data:n,error:r}=await Me(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:hi});return r?this._returnResult({data:null,error:r}):(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:n,error:null}))}catch(n){if(Re(n))return this._returnResult({data:null,error:n});throw n}}async _listPasskeys(){Di(this.experimental);try{return await this._useSession(async e=>{const{data:{session:n},error:r}=e;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new qn});const{data:s,error:o}=await Me(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:n.access_token,xform:l=>({data:l,error:null})});return o?this._returnResult({data:null,error:o}):this._returnResult({data:s,error:null})})}catch(e){if(Re(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){Di(this.experimental);try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!r)return this._returnResult({data:null,error:new qn});const{data:o,error:l}=await Me(this.fetch,"PATCH",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:r.access_token,body:{friendly_name:e.friendlyName}});return l?this._returnResult({data:null,error:l}):this._returnResult({data:o,error:null})})}catch(n){if(Re(n))return this._returnResult({data:null,error:n});throw n}}async _deletePasskey(e){Di(this.experimental);try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!r)return this._returnResult({data:null,error:new qn});const{error:o}
104=await Me(this.fetch,"DELETE",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:r.access_token,noResolveJson:!0});return o?this._returnResult({data:null,error:o}):this._returnResult({data:null,error:null})})}catch(n){if(Re(n))return this._returnResult({data:null,error:n});throw n}}}Sd.nextInstanceID={};const yP=Sd,bP="2.106.2";let Wu="";typeof Deno<"u"?Wu="deno":typeof document<"u"?Wu="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Wu="react-native":Wu="node";const xP={"X-Client-Info":`supabase-js-${Wu}/${bP}`},_P={headers:xP},wP={schema:"public"},SP={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},EP={},kP={enabled:!1,respectSamplingDecision:!0};function jP(t,e,n,r){function s(o){return o instanceof n?o:new n(function(l){l(o)})}return new(n||(n=Promise))(function(o,l){function d(g){try{p(r.next(g))}catch(m){l(m)}}function h(g){try{p(r.throw(g))}catch(m){l(m)}}function p(g){g.done?o(g.value):s(g.value).then(d,h)}p((r=r.apply(t,[])).next())})}let _y=null;const TP="@opentelemetry/api";function NP(){return _y===null&&(_y=import(TP).catch(()=>null)),_y}function AP(){return jP(this,void 0,void 0,function*(){try{const t=yield NP();if(!t||!t.propagation||!t.context)return null;const e={};t.propagation.inject(t.context.active(),e);const n=e.traceparent;return n?{traceparent:n,tracestate:e.tracestate,baggage:e.baggage}:null}catch{return null}})}function CP(t){if(!t||typeof t!="string")return null;const e=t.split("-");if(e.length!==4)return null;const[n,r,s,o]=e;if(n.length!==2||r.length!==32||s.length!==16||o.length!==2)return null;const l=/^[0-9a-f]+$/i;return!l.test(n)||!l.test(r)||!l.test(s)||!l.test(o)||r==="00000000000000000000000000000000"||s==="0000000000000000"?null:{version:n,traceId:r,parentId:s,traceFlags:o,isSampled:(parseInt(o,16)&1)===1}}function RP(t,e){if(!t||!e||e.length===0)return!1;let n;if(t instanceof URL)n=t;else try{n=new URL(t)}catch{return!1}for(const r of e)try{if(typeof r=="string"){if(OP(n.hostname,r))return!0}else if(r instanceof RegExp){if(r.test(n.hostname))return!0}else if(typeof r=="function"&&r(n))return!0}catch{continue}return!1}function OP(t,e){if(e===t)return!0;if(e.startsWith("*.")){const n=e.slice(2);if(t.endsWith(n)&&(t===n||t.endsWith("."+n)))return!0}return!1}function DP(t){const e=[];try{const n=new URL(t);e.push(n.hostname)}catch{}return e.push("*.supabase.co","*.supabase.in"),e.push("localhost","127.0.0.1","[::1]"),e}function Ed(t){"@babel/helpers - typeof";return Ed=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},Ed(t)}function IP(t,e){if(Ed(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Ed(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function MP(t){var e=IP(t,"string");return Ed(e)=="symbol"?e:e+""}function LP(t,e,n){return(e=MP(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ok(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function mn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Ok(Object(n),!0).forEach(function(r){LP(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ok(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}const PP=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),FP=()=>Headers,$P=(t,e,n,r,s)=>{const o=PP(r),l=FP(),d=(s==null?void 0:s.enabled)===!0,h=(s==null?void 0:s.respectSamplingDecision)!==!1,p=d?DP(e):null;return async(g,m)=>{var y;const b=(y=await n())!==null&&y!==void 0?y:t;let _=new l(m==null?void 0:m.headers);if(_.has("apikey")||_.set("apikey",t),_.has("Authorization")||_.set("Authorization",`Bearer ${b}`),p){const w=await UP(g,p,h);w&&(w.traceparent&&!_.has("traceparent")&&_.set("traceparent",w.traceparent),w.tracestate&&!_.has("tracestate")&&_.set("tracestate",w.tracestate),w.baggage&&!_.has("baggage")&&_.set("baggage",w.baggage))}return o(g,mn(mn({},m),{},{headers:_}))}};async function UP(t,e,n){if(!RP(typeof t=="string"||t instanceof URL?t:t.url,e))return null;const r=await AP();if(!r||!r.traceparent)return null;if(n){const s=CP(r.traceparent);if(s&&!s.isSampled)return null}return r}function Dk(t){return typeof t=="boolean"?{enabled:t}:t}function zP(t){return t.endsWith("/")?t:t+"/"}function BP(t,e){var n,r,s,o,l,d;const{db:h,auth:p,realtime:g,global:m}=t,{db:y,auth:b,realtime:_,global:w}=e,S=Dk(t.tracePropagation),E=Dk(e.tracePropagation),k={db:mn(mn({},y),h),auth:mn(mn({},b),p),realtime:mn(mn({},_),g),storage:{},global:mn(mn(mn({},w),m),{},{headers:mn(mn({},(n=w==null?void 0:w.headers)!==null&&n!==void 0?n:{}),(r=m==null?void 0:m.headers)!==null&&r!==void 0?r:{})}),tracePropagation:{enabled:(s=(o=S==null?void 0:S.enabled)!==null&&o!==void 0?o:E==null?void 0:E.enabled)!==null&&s!==void 0?s:!1,respectSamplingDecision:(l=(d=S==null?void 0:S.respectSamplingDecision)!==null&&d!==void 0?d:E==null?void 0:E.respectSamplingDecision)!==null&&l!==void 0?l:!0},accessToken:async()=>""};return t.accessToken?k.accessToken=t.accessToken:delete k.accessToken,k}function HP(t){const e=t==null?void 0:t.trim();if(!e)throw new Error("supabaseUrl is required.");
104if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(zP(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var qP=class extends yP{constructor(t){super(t)}},GP=class{constructor(t,e,n){var r,s;this.supabaseUrl=t,this.supabaseKey=e;const o=HP(t);if(!e)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",o),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",o),this.storageUrl=new URL("storage/v1",o),this.functionsUrl=new URL("functions/v1",o);const l=`sb-${o.hostname.split(".")[0]}-auth-token`,d={db:wP,realtime:EP,auth:mn(mn({},SP),{},{storageKey:l}),global:_P,tracePropagation:kP},h=BP(n??{},d);if(this.settings=h,this.storageKey=(r=h.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(s=h.global.headers)!==null&&s!==void 0?s:{},h.accessToken)this.accessToken=h.accessToken,this.auth=new Proxy({},{get:(g,m)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(m)} is not possible`)}});else{var p;this.auth=this._initSupabaseAuthClient((p=h.auth)!==null&&p!==void 0?p:{},this.headers,h.global.fetch)}this.fetch=$P(e,t,this._getAccessToken.bind(this),h.global.fetch,h.tracePropagation),this.realtime=this._initRealtimeClient(mn({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},h.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(g=>this.realtime.setAuth(g)).catch(g=>console.warn("Failed to set initial Realtime auth token:",g)),this.rest=new o3(new URL("rest/v1",o).href,{headers:this.headers,schema:h.db.schema,fetch:this.fetch,timeout:h.db.timeout,urlLengthLimit:h.db.urlLengthLimit}),this.storage=new xL(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),h.accessToken||this._listenForAuthEvents()}get functions(){return new XM(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={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,e,n)}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,n;if(t.accessToken)return await t.accessToken();const{data:r}=await t.auth.getSession();return(e=(n=r.session)===null||n===void 0?void 0:n.access_token)!==null&&e!==void 0?e:t.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:e,detectSessionInUrl:n,storage:r,userStorage:s,storageKey:o,flowType:l,lock:d,debug:h,throwOnError:p,experimental:g,lockAcquireTimeout:m,skipAutoInitialize:y},b,_){const w={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new qP({url:this.authUrl.href,headers:mn(mn({},w),b),storageKey:o,autoRefreshToken:t,persistSession:e,detectSessionInUrl:n,storage:r,userStorage:s,flowType:l,lock:d,debug:h,throwOnError:p,experimental:g,fetch:_,lockAcquireTimeout:m,skipAutoInitialize:y,hasCustomAuthorizationHeader:Object.keys(this.headers).some(S=>S.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new H3(this.realtimeUrl.href,mn(mn({},t),{},{params:mn(mn({},{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,n){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),e=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const VP=(t,e,n)=>new GP(t,e,n);function WP(){if(typeof window<"u")return!1;const t=globalThis.process;if(!t)return!1;const e=t.version;if(e==null)return!1;const n=e.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}WP()&&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
104ode.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const YP="https://qhvibduggtmzvxeodory.supabase.co",KP="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InFodmliZHVnZ3RtenZ4ZW9kb3J5Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3Nzc3NjI5MTQsImV4cCI6MjA5MzMzODkxNH0.Oq7WHovhSYyHj-Y_pbCXXmkykqOcsCaXtEhRSmxg9b0",Ye=VP(YP,KP);var de=typeof window<"u"?window:void 0,or=typeof globalThis<"u"?globalThis:de,br=or==null?void 0:or.navigator,Ae=or==null?void 0:or.document,En=or==null?void 0:or.location,jx=or==null?void 0:or.fetch,Y0=or!=null&&or.XMLHttpRequest&&"withCredentials"in new or.XMLHttpRequest?or.XMLHttpRequest:void 0,Ik=or==null?void 0:or.AbortController,JP=or==null?void 0:or.CompressionStream,Or=br==null?void 0:br.userAgent;function GN(){return!(!de||de.navigator.onLine===!1)}var Cu=typeof globalThis<"u"?globalThis:de;Cu&&typeof self>"u"&&(Cu.self=Cu),Cu&&typeof File>"u"&&(Cu.File=function(){});var Be=de??{},Mk="0.2.0",Pt={DEBUG:!1,LIB_VERSION:Mk,LIB_NAME:"browser-common",JS_SDK_VERSION:Mk};function Lk(t,e,n,r,s,o,l){try{var d=t[o](l),h=d.value}catch(p){return void n(p)}d.done?e(h):Promise.resolve(h).then(r,s)}function gn(t){return function(){var e=this,n=arguments;return new Promise((function(r,s){var o=t.apply(e,n);function l(h){Lk(o,r,s,l,d,"next",h)}function d(h){Lk(o,r,s,l,d,"throw",h)}l(void 0)}))}}function we(){return we=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},we.apply(null,arguments)}function VN(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}var Pk=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function Fk(t){return typeof t=="string"||t}function $k(t){return typeof t=="string"?t:void 0}var Ru,XP=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],Us=(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.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t})({}),Uk=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({}),ZP=["$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"],QP=["token"],WN="NativeGzipValidationError",K0=t=>t.length>=2&&t[0]===31&&t[1]===139,zk=(t,e)=>t===Uk.GZipJS||e===Uk.GZipJS||e==="gzip",Bk=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError",Hf=t=>
104{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=WN,e},e8=(function(){var t=gn((function*(e,n){18>e.size&&Hf("too-short");var r=new Uint8Array(yield e.slice(0,10).arrayBuffer());K0(r)&&r[2]===8||Hf("invalid-header");var s=new DataView(yield e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(l=>{for(var d=(()=>{if(Ru)return Ru;Ru=[];for(var g=0;256>g;g++){for(var m=g,y=0;8>y;y++)m=1&m?3988292384^m>>>1:m>>>1;Ru[g]=m>>>0}return Ru})(),h=4294967295,p=0;l.length>p;p++)h=d[255&(h^l[p])]^h>>>8;return(4294967295^h)>>>0})(n)&&Hf("invalid-crc");var o=n.length>>>0;s.getUint32(4,!0)!==o&&Hf("invalid-size")}));return function(e,n){return t.apply(this,arguments)}})();function J0(){return J0=gn((function*(t,e,n){e===void 0&&(e=!0);try{var r=new TextEncoder().encode(t),s=new globalThis.CompressionStream("gzip"),o=s.writable.getWriter(),l=o.write(r).then((()=>o.close())).catch((function(){var p=gn((function*(g){try{yield o.abort(g)}catch{}throw g}));return function(g){return p.apply(this,arguments)}})()),d=new Response(s.readable).blob(),h=(yield Promise.all([d,l]))[0];return yield e8(h,r),h}catch(p){if(n!=null&&n.rethrow)throw p;return e&&console.error("Failed to gzip compress data",p),null}})),J0.apply(this,arguments)}var t8=["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"],Hk=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return t8.concat(e).some((r=>{var s=r.toLowerCase();return n.indexOf(s)!==-1}))};function Je(t,e){return t.indexOf(e)!==-1}var Dm=function(t){return t.trim()},X0=function(t){return t.replace(/^\$/,"")};function YN(t){var e,n=[];return(e=JSON.stringify(t,(function(r,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(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(s))return"[Circular]";n.push(s)}return s}})))!==null&&e!==void 0?e:"null"}var KN=Object.prototype,JN=KN.hasOwnProperty,Im=KN.toString,it=Array.isArray||function(t){return Im.call(t)==="[object Array]"},Li=t=>typeof t=="function",nn=t=>t===Object(t)&&!it(t),Pa=t=>{if(nn(t)){for(var e in t)if(JN.call(t,e))return!1;return!0}return!1},Ee=t=>t===void 0,Ft=t=>Im.call(t)=="[object String]",Z0=t=>Ft(t)&&t.trim().length===0,xr=t=>t===null,tt=t=>Ee(t)||xr(t),er=t=>Im.call(t)=="[object Number]"&&t==t,Ls=t=>er(t)&&t>0,Fi=t=>Im.call(t)==="[object Boolean]",n8=t=>t instanceof FormData,r8=t=>Je(ZP,t),i8=t=>Je(QP,t);function XN(t){return t===null||typeof t!="object"}function Fp(t,e){return{}.toString.call(t)==="[object "+e+"]"}function Tx(t){return typeof Event<"u"&&(function(e,n){try{return e instanceof n}catch{return!1}})(t,Event)}var s8=[!0,"true",1,"1","yes"],wy=t=>Je(s8,t),a8=[!1,"false",0,"0","no"];function ts(t,e,n,r,s){return e>n&&(r.warn("min cannot be greater than max."),e=n),er(t)?t>n?(r.warn(" cannot be  greater than max: "+n+". Using max value instead."),n):e>t?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+s),ts(s||n,e,n,r))}class o8{constructor(e){this.tt={},this.et=e.et,this.rt=ts(e.bucketSize,0,100,e.it),this.nt=ts(e.refillRate,0,this.rt,e.it),this.st=ts(e.refillInterval,0,864e5,e.it)}ot(e,n){var r=Math.floor((n-e.lastAccess)/this.st);r>0&&(e.tokens=Math.min(e.tokens+r*this.nt,this.rt),e.lastAccess=e.lastAccess+r*this.st)}consumeRateLimit(e){var n,r=Date.now(),s=String(e),o=this.tt[s];return o?this.ot(o,r):this.tt[s]=o={tokens:this.rt,lastAccess:r},o.tokens===0||(o.tokens--,o.tokens===0&&((n=this.et)==null||n.call(this,e)),o.tokens===0)}stop(){this.tt={}}}var Jr="Mobile",$p="iOS",Vs="Android",gc="Tablet",ZN=Vs+" "+gc,QN="iPad",eA="Ap
104ple",tA=eA+" Watch",id="Safari",vc="BlackBerry",nA="Samsung",rA=nA+"Browser",iA=nA+" Internet",Ro="Chrome",l8=Ro+" OS",sA=Ro+" "+$p,Nx="Internet Explorer",aA=Nx+" "+Jr,Ax="Opera",c8=Ax+" Mini",Cx="Edge",oA="Microsoft "+Cx,uc="Firefox",lA=uc+" "+$p,kd="Nintendo",jd="PlayStation",dc="Xbox",cA=Vs+" "+Jr,uA=Jr+" "+id,Yu="Windows",Q0=Yu+" Phone",qk="Nokia",eb="Ouya",dA="Generic",u8=dA+" "+Jr.toLowerCase(),hA=dA+" "+gc.toLowerCase(),tb="Konqueror",fA="Oculus Browser",Up="Vivaldi",pA="Yandex",zp="Whale",nb="DuckDuckGo",mA="Pale Moon",Bp="Waterfox",sd="Brave",gA="Google Search App",cn="(\\d+(\\.\\d+)?)",Sy=new RegExp("Version/"+cn),d8=new RegExp(dc,"i"),h8=new RegExp(jd+" \\w+","i"),f8=new RegExp(kd+" \\w+","i"),Rx=new RegExp(vc+"|PlayBook|BB10","i"),p8={"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"},vA=function(t,e,n,r){e=e||"";var s=(function(o){return o!=null&&o.brave?sd:null})(n);return s||(r!=null&&r.detectGoogleSearchApp&&Je(t,"GSA/")?gA:Je(t," OPR/")&&Je(t,"Mini")?c8:Je(t," OPR/")?Ax:Rx.test(t)?vc:Je(t,"IE"+Jr)||Je(t,"WPDesktop")?aA:Je(t,"OculusBrowser")?fA:Je(t,rA)?iA:Je(t,Cx)||Je(t,"Edg/")?oA:Je(t,Up+"/")?Up:Je(t,"YaBrowser/")?pA:Je(t,zp+"/")?zp:Je(t,nb+"/")||Je(t,"Ddg/")?nb:Je(t,"FBIOS")?"Facebook "+Jr:Je(t,"UCWEB")||Je(t,"UCBrowser")?"UC Browser":Je(t,"CriOS")?sA:Je(t,"CrMo")||Je(t,Ro)?Ro:Je(t,Vs)&&Je(t,id)?cA:Je(t,"FxiOS")?lA:Je(t.toLowerCase(),tb.toLowerCase())?tb:Je(t,sd+"/")?sd:((o,l)=>l&&Je(l,eA)||(function(d){return Je(d,id)&&!Je(d,Ro)&&!Je(d,Vs)})(o))(t,e)?Je(t,Jr)?uA:id:Je(t,"PaleMoon/")?mA:Je(t,Bp+"/")?Bp:Je(t,uc)?uc:Je(t,"MSIE")||Je(t,"Trident/")?Nx:Je(t,"Gecko")?uc:"")},m8={[aA]:[new RegExp("rv:"+cn)],[oA]:[new RegExp(Cx+"?\\/"+cn)],[Ro]:[new RegExp("("+Ro+"|CrMo)\\/"+cn)],[sA]:[new RegExp("CriOS\\/"+cn)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+cn)],[id]:[Sy],[uA]:[Sy],[Ax]:[new RegExp("(Opera|OPR)\\/"+cn)],[uc]:[new RegExp(uc+"\\/"+cn)],[lA]:[new RegExp("FxiOS\\/"+cn)],[tb]:[new RegExp("Konqueror[:/]?"+cn,"i")],[vc]:[new RegExp(vc+" "+cn),Sy],[cA]:[new RegExp("android\\s"+cn,"i")],[iA]:[new RegExp(rA+"\\/"+cn)],[fA]:[new RegExp("OculusBrowser\\/"+cn)],[Up]:[new RegExp(Up+"\\/"+cn)],[pA]:[new RegExp("YaBrowser\\/"+cn)],[zp]:[new RegExp(zp+"\\/"+cn)],[sd]:[new RegExp(sd+"\\/"+cn)],[nb]:[new RegExp("(DuckDuckGo|Ddg)\\/"+cn)],[mA]:[new RegExp("PaleMoon\\/"+cn)],[Bp]:[new RegExp(Bp+"\\/"+cn)],[gA]:[new RegExp("GSA\\/"+cn)],[Nx]:[new RegExp("(rv:|MSIE )"+cn)],Mozilla:[new RegExp("rv:"+cn)]},g8=function(t,e,n,r){var s=vA(t,e,n,r),o=m8[s];if(Ee(o))return null;for(var l=0;o.length>l;l++){var d=t.match(o[l]);if(d)return parseFloat(d[d.length-2])}return null},Gk=[[new RegExp(dc+"; "+dc+" (.*?)[);]","i"),t=>[dc,t&&t[1]||""]],[new RegExp(kd,"i"),[kd,""]],[new RegExp(jd,"i"),[jd,""]],[Rx,[vc,""]],[new RegExp(Yu,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Q0,""];if(new RegExp(Jr).test(e)&&!/IEMobile\b/.test(e))return[Yu+" "+Jr,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var r=p8[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[Yu,r]}return[Yu,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[$p,[t[3],t[4],t[5]||"0"].join(".")]:[$p,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=Ee(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Vs+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Vs+")","i"),t=>t&&t[2]?[Vs,[t[2],t[3],t[4]||"0"].join(".")]:[Vs,""]],[/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/,[l8,""]],[/Linux|debian/i,["Linux",""]]],Vk=function(t){return f8.test(t)?kd:h8.test(t)?jd:d8.test(t)?dc:new RegExp(eb,"i").test(t)?eb:new RegExp("("+Q0+"|WPDesktop)","i").test(t)?Q0:/iPad/.test(t)?QN:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?tA:Rx.test(t)?vc:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(qk,"i").test(t)?qk:/(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(Jr).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)?Vs:ZN:new RegExp("(pda|"+Jr+")","i").test(t)?u8:new RegExp(gc,"i").test(t)&&!new RegExp(gc+" pc","i").test(t)?hA:""},v8=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
104function Wk(t,e){return typeof(n=t)=="string"&&v8.test(n)?t:e();var n}function Ua(t){return t&&t.split("#")[0]}function fp(t,e){var n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}var y8=t=>t instanceof Error,yA={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}},b8=yA.info;function bA(t){if(Fi(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(it(t))return{arrayValue:{values:t.map((e=>bA(e)))}};try{return{stringValue:JSON.stringify(t)}}catch{return{stringValue:String(t)}}}function Hp(t){var e=[];for(var n in t){var r=t[n];xr(r)||Ee(r)||e.push({key:n,value:bA(r)})}return e}function x8(t,e){var n=yA[t.level||"info"]||b8,r=n.text,s=n.number,o=String(Date.now())+"000000",l={};e.distinctId&&(l.posthogDistinctId=e.distinctId),e.sessionId&&(l.sessionId=e.sessionId),e.windowId&&(l["window.id"]=e.windowId),tt(e.sessionStartTimestamp)||(l.sessionStartTimestamp=String(e.sessionStartTimestamp)),tt(e.lastActivityTimestamp)||(l.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(l["url.full"]=e.currentUrl),e.screenName&&(l["screen.name"]=e.screenName),e.appState&&(l["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(l.feature_flags=e.activeFeatureFlags);var d=we({},l,t.attributes||{}),h={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:s,severityText:r,body:{stringValue:t.body},attributes:Hp(d)};return t.trace_id&&(h.traceId=t.trace_id),t.span_id&&(h.spanId=t.span_id),Ee(t.trace_flags)||(h.flags=t.trace_flags),h}function xA(t,e,n){return we({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":n})}function _A(t,e,n,r){return{resourceLogs:[{resource:{attributes:Hp(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}let _8=class{constructor(t,e,n,r,s,o,l){var d;o===void 0&&(o=()=>Promise.resolve()),this._instance=t,this.Te=e,this.it=n,this.ut=r,this.ht=s,this.dt=o,this.ct=l,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((d=e.maxQueueSize)!==null&&d!==void 0?d:e.maxBufferSize,e.maxBufferSize),this.St=e.flushIntervalMs,this.Ct=e.maxBatchRecordsPerPost,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 n={record:x8(e,this.ut())};this.ht((()=>this.Ot(n)))}}else this.it.info("Log was rejected in beforeSend function")}}Rt(t){var e=this.Te.beforeSend;if(!e)return t;var n=it(e)?e:[e],r=t;for(var s of n)try{var o=s(r);if(!o)return this.it.info("Log was rejected in beforeSend function"),null;r=o}catch(l){return this.it.error("Error in beforeSend function for log:",l),null}return r}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 gn((function*(){if(!t._instance.isDisabled)return t.vt||(t.vt=t.Ft().finally((()=>{t.vt=null}))),t.vt}))()}Ft(){var t=this;return gn((function*(){var e;t.Mt();var n=(e=t._instance.getPersistedProperty(Us.LogsQueue))!==null&&e!==void 0?e:[];if(n.length!==0)for(var r=n.length,s=0;n.length>0&&r>s;){var o,l;t.ft=0;var d=Math.min(n.length,t.Ct),h=n.slice(0,d),p=_A(h.map((m=>m.record)),t.Lt(),(o=t.ct)!==null&&o!==void 0?o:t._instance.getLibraryId(),t._instance.getLibraryVersion()),g=yield t._instance.$t(p);if(g.kind==="too-large"&&h.length>1)t.Ct=Math.max(1,Math.floor(h.length/2)),t.it.warn("Received 413 when sending logs batch of size "+h.length+", reducing batch size to "+t.Ct);else if(g.kind==="retry-later"||(g.kind==="too-large"?t.it.warn("Dropping a single log record after 413 with batch size 1 — the record 
104is larger than the server cap and cannot be split further."):g.kind==="ok"&&t.Te.maxBatchRecordsPerPost>t.Ct&&(t.Ct=Math.min(t.Te.maxBatchRecordsPerPost,t.Ct+1)),yield t.At(h.length),n=(l=t._instance.getPersistedProperty(Us.LogsQueue))!==null&&l!==void 0?l:[],s+=h.length,g.kind==="fatal"))throw g.error}}))()}At(t){var e=this;return gn((function*(){var n,r=Math.max(0,t-e.ft),s=(n=e._instance.getPersistedProperty(Us.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(Us.LogsQueue,s.slice(r)),yield e.dt()}))()}Lt(){return xA(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ot(t){var e;if(!this._instance.optedOut){var n=(e=this._instance.getPersistedProperty(Us.LogsQueue))!==null&&e!==void 0?e:[];this.kt>n.length||(n.shift(),this.ft++,this.it.info("Logs queue is full, dropping oldest record.")),n.push(t),this._instance.setPersistedProperty(Us.LogsQueue,n),this.xt>n.length?this.Nt():this.Et()}}Nt(t){t===void 0&&(t=this.St),this.Dt||(this.Dt=fp((()=>{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(Us.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return gn((function*(){e.Mt();var n=e.flush().catch((()=>{}));t!==void 0?yield Promise.race([n,new Promise((r=>fp(r,t)))]):yield n}
104))()}flushWithTimeout(t){var e=this;return gn((function*(){var n=!1,r=e.flush(),s=new Promise((o=>fp((()=>{n=!0,o()}),t)));try{yield Promise.race([r,s])}finally{n&&r.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 Ey=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function Yk(t){return String(t)+"000000"}function Kk(t,e,n,r){var s="";return r&&(s=Object.keys(r).sort().map((o=>JSON.stringify(o)+":"+JSON.stringify(r[o]))).join(",")),t+"\0"+e+"\0"+(n??"")+"\0"+s}let w8=class{constructor(t,e,n){this._instance=t,this.Te=e,this.it=n,this.Ht=new Map,this.vt=null,this.Bt=!1,this.Ut=new Map,this.zt=new Set,this.Vt=0}count(t,e,n){e===void 0&&(e=1),this.Wt({name:t,type:"count",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}gauge(t,e,n){this.Wt({name:t,type:"gauge",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}histogram(t,e,n){this.Wt({name:t,type:"histogram",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}flush(){var t=this,e=this.vt,n=(function(){var s=gn((function*(){e&&(yield e.catch((()=>{}))),yield t.Zt()}));return function(){return s.apply(this,arguments)}})(),r=n().finally((()=>{this.vt===r&&(this.vt=null)}));return this.vt=r,r}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 n,r;try{n=e.attributes?we({},e.attributes):void 0,r=Kk(e.type,e.name,e.unit,n)}catch(l){return void this.it.warn("Dropping metric '"+e.name+"': attributes could not be serialized",l)}var s=this.Ht.get(r);if(!s){if(!this.Qt())return;s={name:e.name,type:e.type,unit:e.unit,attributes:n,windowStartMs:Date.now()},this.Ht.set(r,s)}var o=this.Ut.get(e.name);o===void 0?this.Ut.set(e.name,e.type):o===e.type||this.zt.has(e.name)||(this.zt.add(e.name),this.it.warn("Metric name '"+e.name+"' is already used as a "+o+"; 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 n;switch(t.type){case"count":t.total=((n=t.total)!==null&&n!==void 0?n: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(Ey.length+1).fill(0)});var r=t.hist;r.count+=1,r.sum+=e,r.min=Math.min(r.min,e),r.max=Math.max(r.max,e),r.bucketCounts[(function(s,o){for(var l=0;o.length>l;l++)if(o[l]>=s)return l;return o.length})(e,Ey)]+=1}}Rt(t){var e=this.Te.beforeSend;if(!e)return t;var n=it(e)?e:[e],r=t;for(var s of n)try{var o=s(r);if(!o)return this.it.info("Metric was rejected in beforeSend function"),null;r=o}catch(l){return this.it.error("Error in beforeSend function for metric:",l),null}return r}Nt(){this.Dt||(this.Dt=fp((()=>{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 gn((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 n=t.Vt,r=yield t._instance.Kt(t.Gt(e));if(n===t.Vt)switch(r.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:",r.error)}}}))()}
104Gt(t){return e=this.Xt(t),n=(function(o,l,d){return we({},o.resourceAttributes,{"service.name":o.serviceName||"unknown_service"},o.environment&&{"deployment.environment":o.environment},o.serviceVersion&&{"service.version":o.serviceVersion},{"telemetry.sdk.name":l,"telemetry.sdk.version":d})})(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Hp(n)},scopeMetrics:[{scope:{name:r,version:s},metrics:e}]}]};var e,n,r,s}Xt(t){var e=Yk(Date.now()),n=new Map;for(var r of t.values()){var s,o=Kk(r.type,r.name,r.unit,void 0),l=n.get(o);l||(l=we({name:r.name},r.unit&&{unit:r.unit}),r.type==="count"?l.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:r.type==="gauge"?l.gauge={dataPoints:[]}:l.histogram={aggregationTemporality:1,dataPoints:[]},n.set(o,l));var d=Hp((s=r.attributes)!==null&&s!==void 0?s:{}),h=Yk(r.windowStartMs);if(r.type==="count"){var p,g={attributes:d,startTimeUnixNano:h,timeUnixNano:e,asDouble:(p=r.total)!==null&&p!==void 0?p:0};l.sum.dataPoints.push(g)}else if(r.type==="gauge"){var m,y={attributes:d,timeUnixNano:e,asDouble:(m=r.last)!==null&&m!==void 0?m:0};l.gauge.dataPoints.push(y)}else r.hist&&l.histogram.dataPoints.push({attributes:d,startTimeUnixNano:h,timeUnixNano:e,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:Ey})}return Array.from(n.values())}Yt(t){var e,n;for(var r of t){var s=r[0],o=r[1],l=this.Ht.get(s);if(l)switch(l.windowStartMs=Math.min(l.windowStartMs,o.windowStartMs),l.type){case"count":l.total=((e=l.total)!==null&&e!==void 0?e:0)+((n=o.total)!==null&&n!==void 0?n:0);break;case"gauge":break;case"histogram":if(o.hist)if(l.hist){l.hist.count+=o.hist.count,l.hist.sum+=o.hist.sum,l.hist.min=Math.min(l.hist.min,o.hist.min),l.hist.max=Math.max(l.hist.max,o.hist.max);for(var d=0;l.hist.bucketCounts.length>d;d++)l.hist.bucketCounts[d]+=o.hist.bucketCounts[d]}else l.hist=o.hist}else this.Qt()&&this.Ht.set(s,o)}}};var qf,Jk,ky;function S8(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return ky&&n.length===Jk||(Jk=n.length,ky=n.reduce(((r,s)=>{qf||(qf={});var o=qf[s];if(o)r[o[0]]=o[1];else for(var l=t(s),d=l.length-1;d>=0;d--){var h=l[d],p=h==null?void 0:h.filename,g=e[s];if(p&&g){r[p]=g,qf[s]=[p,g];break}}return r}),{})),ky}}class E8{constructor(e,n,r){r===void 0&&(r=[]),this.coercers=e,this.stackParser=n,this.modifiers=r}buildFromUnknown(e,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(r,n,0).apply(e),o=this.buildParsingContext(n),l=this.parseStacktrace(s,o);return{$exception_list:this.convertToExceptionList(l,r),$exception_level:"error"}}modifyFrames(e){var n=this;return gn((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&it(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return e}))()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var r,s;return e.cause!=null&&(r=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?n.skipFirstLines:0),n.chunkIdMap)),we({},e,{cause:r,stack:s})}applyChunkIds(e,n){return e.map((r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r)))}applyCoercers(e,n){for(var r of this.coercers)if(r.match(e))return r.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return gn((function*(){var r=e;for(var s of n.modifiers)r=yield s(r);return r}))()}convertToExceptionList(e,n){var r,s,o,l={type:e.type,value:e.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(s=n.handled)===null||s===void 0||s,synthetic:(o=e.synthetic)!==null&&o!==void 0&&o}};e.stack&&(l.stacktrace={type:"raw",frames:e.stack});var d=[l];return e.cause!=null&&d.push(...this.convertToExceptionList(e.cause,we({},n,{handled:!0}))),d}buildParsingContext(e){var n;return{chunkIdMap:S8(this.stackParser),skipFirstLines:(n=e.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(e,n,r){r===void 0&&(r=0);var s=(o,l)=>{if(4>=l){var d=this.buildCoercingContext(e,n,l);return this.applyCoercers(o,d)}};return we({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:e,apply:o=>s(o,r),next:o=>s(o,r+1)})}}var yc="?";function rb(t,e,n,r,s){var o={platform:t,filename:e,function:n==="<anonymous>"?yc:n,in_app:!0};return Ee(r)||(o.lineno=r),Ee(s)||(o.colno=s),o}var wA=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:yc,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},k8=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,j8=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,T8=/\((\S*)(?::(\d+))(?::(\d+))\)/,N8=(t,e)=>{var n=k8.exec(t);if(n)return rb(e,n[1],yc,+n[2],+n[3]);var r=j8.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){var s=T8.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}var o=wA(r[1]||yc,r[2]);return rb(e,o[1],o[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},A8=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,C8=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,R8=(t,e)=>{var n=A8.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=C8.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var s=n[3],o=n[1]||yc,l=wA(o,s);return rb(e,s=l[1],o=l[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Xk=/\(error: (.*)\)/;class O8{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var r=Ft(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?n+": "+e.message:n}isDOMException(e){return Fp(e,"DOMException")}isDOMError(e){return Fp(e,"DOMError")}}class D8{match(e){return(n=>n instanceof Error)(e)}coerce(e,n){return{type:this.getType(e),value:this.getMessage(e,n),stack:this.getStack(e),cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,n){var r=e.message;return String(r.error&&typeof r.error.message=="string"?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}}class I8{constructor(){}match(e){return Fp(e,"ErrorEvent")&&e.error!=null}coerce(e,n){var r;return n.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}
104var M8=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class L8{match(e){return typeof e=="string"}coerce(e,n){var r,s=this.getInfos(e),o=s[0],l=s[1];return{type:o??"Error",value:l??e,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var n="Error",r=e,s=e.match(M8);return s&&(n=s[1],r=s[2]),[n,r]}}var P8=["fatal","error","warning","log","info","debug"];function SA(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var s=n.slice(0,r).join(", ");if(e>=s.length)return r===n.length?s:s.length>e?s.slice(0,e)+"...":s}return""}class F8{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var r,s=this.getErrorPropertyFromObject(e);return s?n.apply(s):{type:this.getType(e),value:this.getValue(e),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return Tx(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var n="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(n+=" with message: '"+e.message+"'"),n}if("message"in e&&typeof e.message=="string")return e.message;var r=this.getObjectClassName(e);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+SA(e)}isSeverityLevel(e){return Ft(e)&&!Z0(e)&&P8.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if({}.hasOwnProperty.call(e,n)){var r=e[n];if(y8(r))return r}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}}class $8{match(e){return Tx(e)}coerce(e,n){var r,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+SA(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class U8{match(e){return XN(e)}coerce(e,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class z8{match(e){return Fp(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!Tx(e))return!1;try{var n=e.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(e,n){var r,s=this.getUnhandledRejectionReason(e);return XN(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.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 qp="$message",Gp="$timestamp",B8=new Set([qp,Gp]),jy={enabled:!0,max_bytes:32768};function Vp(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:jy.enabled,max_bytes:q8(t.max_bytes,jy.max_bytes)}:we({},jy)}class H8{constructor(e){this.$e=[],this.ze=0,this.Te=Vp(e)}setConfig(e){this.Te=Vp(e),this.Ze()}add(e){var n=(function(s){var o;try{o=YN(s)}catch{return}try{var l=JSON.parse(o);if(!nn(l))return;var d=l,h=d[qp],p=d[Gp];return!Ft(h)||h.trim().length===0||!Ft(p)&&!er(p)?void 0:{step:d,json:o}}catch{return}})(e);if(n){var r=(function(s){if(typeof TextEncoder<"u")return new TextEncoder().encode(s).length;for(var o=encodeURIComponent(s),l=0,d=0;o.length>d;d++)o[d]==="%"?(l+=1,d+=2):l+=1;return l})(n.json);r>this.Te.max_bytes||(this.$e.push({step:n.step,bytes:r}),this.ze+=r,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 q8(t,e){if(!er(t)||t===1/0||t===-1/0)return e;var n=Math.floor(t);return 0>n?e:n}var EA=function(t,e){var n=(e===void 0?{}:e).debugEnabled,r={k(s){if(de&&(Pt.DEBUG||de.POSTHOG_DEBUG||n)&&!Ee(de.console)&&de.console){for(var o=("__rrweb_original__"in de.console[s])?de.console[s].__rrweb_original__:de.console[s],l=arguments.length,d=new Array(l>1?l-1:0),h=1;l>h;h++)d[h-1]=arguments[h];o(t,...d)}},debug(){for(var s=arguments.length,o=new Array(s),l=0;s>l;l++)o[l]=arguments[l];r.k("debug",...o)},info(){for(var s=arguments.length,o=new Array(s),l=0;s>l;l++)o[l]=arguments[l];r.k("log",...o)},warn(){for(var s=arguments.length,o=new Array(s),l=0;s>l;l++)o[l]=arguments[l];r.k("warn",...o)},error(){for(var s=arguments.length,o=new Array(s),l=0;s>l;l++)o[l]=arguments[l];r.k("error",...o)},critical(){for(var s=arguments.length,o=new Array(s),l=0;s>l;l++)o[l]=arguments[l];console.error(t,...o)},uninitializedWarning(s){r.error("You must initialize PostHog before calling "+s)},createLogger:(s,o)=>EA(t+" "+s,o)};return r},ke=EA("[PostHog.js]"),an=ke.createLogger,G8=an("[ExternalScriptsLoader]"),Ty=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return G8.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=Ae==null?void 0:Ae.querySelectorAll("script");
104if(r){for(var s,o=function(){if(r[l].src===e){var h=r[l];return h.__posthog_loading_callback_fired?{v:n()}:(h.addEventListener("load",(p=>{h.__posthog_loading_callback_fired=!0,n(void 0,p)})),h.onerror=p=>n(p),{v:void 0})}},l=0;r.length>l;l++)if(s=o())return s.v}var d=()=>{if(!Ae)return n("document not found");var h=Ae.createElement("script");if(h.type="text/javascript",h.crossOrigin="anonymous",h.src=e,h.onload=m=>{h.__posthog_loading_callback_fired=!0,n(void 0,m)},h.onerror=m=>n(m),t.config.prepare_external_dependency_script&&(h=t.config.prepare_external_dependency_script(h)),!h)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")Ae.head.appendChild(h);else{var p,g=Ae.querySelectorAll("body > script");g.length>0?(p=g[0].parentNode)==null||p.insertBefore(h,g[0]):Ae.body.appendChild(h)}};Ae!=null&&Ae.body?d():Ae==null||Ae.addEventListener("DOMContentLoaded",d)};Be.__PosthogExtensions__=Be.__PosthogExtensions__||{},Be.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e!=="remote-config"){var r;if(t.config.strict_script_versioning)r=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js");else{var s="/static/"+e+".js?v="+t.version;if(e==="toolbar"){var o=3e5;s=s+"&t="+Math.floor(Date.now()/o)*o}r=t.requestRouter.endpointFor("assets",s)}Ty(t,r,n)}else{var l=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");Ty(t,l,n)}},Be.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var r=t.requestRouter.endpointFor("api",e);Ty(t,r,n)};var Zk="1.407.2";Pt.DEBUG=!1,Pt.LIB_VERSION=Zk,Pt.LIB_NAME="web",Pt.JS_SDK_VERSION=Zk;var kA="$people_distinct_id",Wp="$device_id",Ny="$device_model",Ku="__alias",Ju="__timers",ib="$autocapture_disabled_server_side",sb="$heatmaps_enabled_server_side",ab="$exception_capture_enabled_server_side",ob="$error_tracking_suppression_rules",lb="$error_tracking_capture_extension_exceptions",cb="$web_vitals_enabled_server_side",Ox="$dead_clicks_enabled_server_side",Dx="$product_tours_enabled_server_side",ub="$web_vitals_allowed_metrics",Co="$session_recording_remote_config",jA="$replay_sample_rate",TA="$replay_override_sampling",NA="$replay_override_linked_flag",AA="$replay_override_url_trigger",CA="$replay_override_event_trigger",rc="$sesid",Ix="$session_is_sampled",jo="$enabled_feature_flags",pp="$active_feature_flags",Xu="$early_access_features",db="$feature_flag_details",mp="$feature_flag_payloads",hb="$feature_flag_request_id",Yp="$minimal_flag_called_events",Ps="$override_feature_flags",Xl="$override_feature_flag_payloads",So="$stored_person_properties",Eo="$stored_group_properties",fb="$surveys",Kp="$surveys_loaded_at",pb="$surveys_activated",gp="$surveys_activated_session",Zu="ph_product_tours",ad="$flag_call_reported",mb="$flag_call_reported_session_id",gb="$feature_flag_errors",Td="$feature_flag_evaluated_at",Ii="$user_state",vb="$client_session_props",yb="$capture_rate_limit",bb="$initial_campaign_params",xb="$initial_referrer_info",Jp="$initial_person_info",Xp="$epp",Gf="$posthog_cookieless",RA="$cookieless_mode",OA="$sdk_debug_extensions_init_method",DA="$sdk_debug_extensions_init_time_ms",IA="$sdk_debug_recording_script_not_loaded",Mx="PostHog loadExternalDependency extension not found.",ko="on_reject",Hs="always",Ll="anonymous",Pl="identified",_b="identified_only",Zp="visibilitychange",Qp="beforeunload",Zl="$pageview",Ay="$pageleave",Cy="$identify",Qk="$groupidentify";function Vf(t,e){it(t)&&t.forEach(e)}function $t(t,e){if(!tt(t))if(it(t))t.forEach(e);else if(n8(t))t.forEach(((r,s)=>e(r,s)));else for(var n in t)JN.call(t,n)&&e(t[n],n)}var Yt=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];for(var s of n)for(var o in s)s[o]!==void 0&&(t[o]=s[o]);return t};function vp(t){for(var e=Object.keys(t),n=e.length,r=new Array(n);n--;)r[n]=[e[n],t[e[n]]];return r}var ej=function(t){try{return t()}catch{return}},V8=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];return t.apply(this,n)}catch(s){ke.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ke.critical(s)}}},Lx=function(t){var e={};return $t(t,(function(n,r){(Ft(n)&&n.length>0||er(n))&&(e[r]=n)})),e},W8=["herokuapp.com","vercel.app","netlify.app"];function Y8(t){var e=t==null?void 0:t.hostname;if(!Ft(e))return!1;var n=e.split(".").slice(-2).join(".");for(var r of W8)if(n===r)return!1;return!0}function un(t,e,n,r){var s=r??{},o=s.capture,l=s.passive;t==null||t.addEventListener(e,n,{capture:o!==void 0&&o,passive:l===void 0||l})}
104function MA(t){return t.name==="ph_toolbar_internal"}var LA=t=>{if(Ae){try{for(var e=t+"=",n=Ae.cookie.split(";").filter((o=>o.length)),r=0;n.length>r;r++){for(var s=n[r];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}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return er(t)&&isFinite(t)&&Math.floor(t)===t});class em{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,r,s){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(s)||0>e||0>n||0>r||0>s||e>0xffffffffffff||n>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=e/Math.pow(2,40),o[1]=e/Math.pow(2,32),o[2]=e/Math.pow(2,24),o[3]=e/Math.pow(2,16),o[4]=e/256,o[5]=e,o[6]=112|n>>>8,o[7]=n,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=s>>>24,o[13]=s>>>16,o[14]=s>>>8,o[15]=s,new em(o)}toString(){for(var e="",n=0;this.bytes.length>n;n++)e=e+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new em(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var n=0;16>n;n++){var r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class K8{generate(){var e=this.generateOrAbort();if(!Ee(e))return e;this.S=0;var n=this.generateOrAbort();if(Ee(n))throw new Error("Could not generate UUID after timestamp reset");return n}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.C();else{if(this.S>=e+1e4)return;this.I++,this.I>4398046511103&&(this.S++,this.C())}return em.fromFieldsV7(this.S,Math.trunc(this.I/Math.pow(2,30)),this.I&Math.pow(2,30)-1,this.M.nextUint32())}C(){this.I=1024*this.M.nextUint32()+(1023&this.M.nextUint32())}constructor(){this.S=0,this.I=0,this.M=new J8}}var tj,PA=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};de&&!Ee(de.crypto)&&crypto.getRandomValues&&(PA=t=>crypto.getRandomValues(t));class J8{nextUint32(){return this.R.length>this.O||(PA(this.R),this.O=0),this.R[this.O++]}constructor(){this.R=new Uint32Array(8),this.O=1/0}}var Bs=()=>X8().toString(),X8=()=>(tj||(tj=new K8)).generate(),Ou="",Z8=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,qs={N:()=>!!Ae,D(t){ke.error("cookieStore error: "+t)},A:LA,F(t){var e;try{e=JSON.parse(qs.A(t))||{}}catch{}return e},q(t,e,n,r,s){if(!Ae)return!1;try{var o="",l="",d=(function(g,m){if(m){var y=(function(_,w){if(w===void 0&&(w=Ae),Ou)return Ou;if(!w||["localhost","127.0.0.1"].includes(_))return"";for(var S=_.split("."),E=Math.min(S.length,8),k="dmn_chk_"+Bs();!Ou&&E--;){var j=S.slice(E).join("."),N=k+"=1;domain=."+j+";path=/";w.cookie=N+";max-age=3",w.cookie.includes(k)&&(w.cookie=N+";max-age=0",Ou=j)}return Ou})(g);if(!y){var b=(_=>{var w=_.match(Z8);return w?w[0]:""})(g);b!==y&&ke.info("Warning: cookie subdomain discovery mismatch",b,y),y=b}return y?"; domain=."+y:""}return""})(Ae.location.hostname,r);if(n){var h=new Date;h.setTime(h.getTime()+864e5*n),o="; expires="+h.toUTCString()}s&&(l="; secure");var p=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+d+l;return p.length>3686.4&&ke.warn("cookieStore warning: large cookie, len="+p.length),Ae.cookie=p,!0}catch{return!1}},P(t,e){if(Ae!=null&&Ae.cookie)try{qs.q(t,"",-1,e)}catch{return}}},Ry=null,Vt={N(){if(!xr(Ry))return Ry;var t=!0;if(Ee(de))t=!1;else try{var e="__mplssupport__";Vt.q(e,"xyz"),Vt.A(e)!=='"xyz"'&&(t=!1),Vt.P(e)}catch{t=!1}return t||ke.error("localStorage unsupported; falling back to cookie store"),Ry=t,t},D(t){ke.error("localStorage error: "+t)},A(t){try{return de==null?void 0:de.localStorage.getItem(t)}catch(e){Vt.D(e)}return null},F(t){try{return JSON.parse(Vt.A(t))||{}}catch{}return null},q(t,e){try{return de==null||de.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){Vt.D(n)}return!1},P(t){try{de==null||de.localStorage.removeItem(t)}catch(e){Vt.D(e)}}},Q8=[Wp,"distinct_id",rc,Ix,Xp,Jp,Ii],Wf={},e9={N:()=>!0,D(t){ke.error("memoryStorage error: "+t)},A:t=>Wf[t]||null,F:t=>Wf[t]||null,q:(t,e)=>(Wf[t]=e,!0),P(t){delete Wf[t]}},mo=null,Qn={N(){if(!xr(mo))return mo;if(mo=!0,Ee(de))mo=!1;else try{var t="__support__";Qn.q(t,"xyz"),Qn.A(t)!=='"xyz"'&&(mo=!1),Qn.P(t)}catch{mo=!1}return mo},D(t){ke.error("sessionStorage error: ",t)},A(t){try{return de==null?void 0:de.sessionStorage.getItem(t)}catch(e){Qn.D(e)}return null},F(t){try{return JSON.parse(Qn.A(t))||null}catch{}return null},q(t,e){try{return de==null||de.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){Qn.D(n)}return!1},P(t){try{de==null||de.sessionStorage.removeItem(t)}catch(e){Qn.D(e)}}};class t9{constructor(e){this._instance=e}get Te(){return this._instance.config}get consent(){return this.Ge()?0:this.Qe}isOptedOut(){return this.Te.cookieless_mode===Hs||this.isRejected()||this.consent===-1&&this.Te.cookieless_mode===ko}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.Je.q(this.Ke,e?1:0,this.Te.cookie_expiration,this.Te.cross_subdomain_cookie,this.Te.secure_cookie)}reset(){this.Je.P(this.Ke,this.Te.cross_subdomain_cookie)}get Ke(){var e=this._instance.config,n=e.token,r=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(r?r+n:"__ph_opt_in_out_"+n)}get Qe(){var e=this.Je.A(this.Ke);return wy(e)?1:Je(a8,e)?0:-1}get Je(){var e=this.Te.opt_out_capturing_persistence_type,n=e==="localStorage"?Vt:qs;if(!this.Ye||this.Ye!==n){this.Ye=n;var r=e==="localStorage"?qs:Vt;r.A(this.Ke)&&(this.Ye.A(this.Ke)||this.optInOut(wy(r.A(this.Ke))),r.P(this.Ke,this.Te.cross_subdomain_cookie))}return this.Ye}Ge(){return!!this.Te.respect_dnt&&[br==null?void 0:br.doNotTrack,br==null?void 0:br.msDoNotTrack,Be.doNotTrack].some((e=>wy(e)))}}function FA(t,e){var n,r=t==null||(n=t.config)==null?void 0:n.get_current_url;if(!Li(r))return e;try{var s=r(e);return Ft(s)&&s?s:e}catch(o){return ke.error("Error in get_current_url, falling back to window.location.href",o),e}}var $A="__POSTHOG_TOOLBAR__",n9=1,r9=3,i9=11;function nj(t){return t instanceof Element&&(t.id===$A||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function za(t){return!!t&&t.nodeType===n9}function Yr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function UA(t){return!!t&&t.nodeType===r9}function zA(t){return!!t&&t.nodeType===i9&&za(t.host)}var BA=1e3;function Px(t){return t?Dm(t).split(/\s+/):[]}function rj(t,e){var n=(function(r){var s,o=de==null||(s=de.location)==null?void 0:s.href;return Ee(o)?void 0:FA(r,o)})(e);return!!(n&&t&&t.some((r=>n.match(r))))}function tm(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 Px(e)}function HA(t){return tt(t)?null:Dm(t).split(/(\s+)/).filter((e=>od(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Nd(t){var e="";return Sb(t)&&!WA(t)&&t.childNodes&&t.childNodes.length&&$t(t.childNodes,(function(n){var r;UA(n)&&n.textContent&&(e+=(r=HA(n.textContent))!==null&&r!==void 0?r:"")})),Dm(e)}function Oy(t){var e;return Ee(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var Fx=["a","button","form","input","select","textarea","label"];function wb(t,e){if(Ee(e))return!0;
104var n,r=function(o){if(e.some((l=>(function(d,h){var p=d.matches||d.matchesSelector||d.msMatchesSelector||d.mozMatchesSelector||d.webkitMatchesSelector||d.oMatchesSelector;try{return!!p&&p.call(d,h)}catch{return!1}})(o,l))))return{v:!0}};for(var s of t)if(n=r(s))return n.v;return!1}function qA(t){var e=t.parentNode;return!(!e||!za(e))&&e}var s9=[".ph-no-autocapture","[data-ph-no-autocapture]"],GA=["next","previous","prev",">","<"],a9=[...GA,"+","-","−","–"],ij=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,sj=[".ph-no-rageclick",".ph-no-capture"],o9=["","text","search","email","password","url","tel","number"];function aj(t,e){if(!de||$x(t))return!1;var n,r,s,o,l;if(Fi(e)?(n=!!e&&sj,r=void 0,s=!1):(n=(o=e==null?void 0:e.css_selector_ignorelist)!==null&&o!==void 0?o:sj,r=e==null?void 0:e.content_ignorelist,s=(l=e==null?void 0:e.ignore_text_selection)!==null&&l!==void 0&&l),n===!1||s&&(function(h){return!(!h||!za(h))&&(!!Yr(h,"textarea")||(Yr(h,"input")?Je(o9,(h.getAttribute("type")||"").toLowerCase()):(function(p){if(p.isContentEditable)return!0;var g=p.getAttribute==null?void 0:p.getAttribute("contenteditable");return g==="true"||g===""})(h)))})(t))return!1;var d=VA(t,!1).targetElementList;return!(function(h,p){if(h===!1||Ee(h))return!1;var g;if(h===!0)g=GA;else{if(!it(h))return!1;if(h.length>10)return ke.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;g=h.map((m=>m.toLowerCase()))}return p.some((m=>{var y=m.safeText,b=m.ariaLabel;return g.some((_=>ij(y,_)||ij(b,_)))}))})(r,d.map((h=>{var p;return{safeText:Nd(h).toLowerCase(),ariaLabel:((p=h.getAttribute("aria-label"))==null?void 0:p.toLowerCase().trim())||""}})))&&!wb(d,n)}var $x=t=>!t||Yr(t,"html")||!za(t),VA=(t,e)=>{if(!de||$x(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[t],s=t;s.parentNode&&!Yr(s,"body");)if(zA(s.parentNode))r.push(s.parentNode.host),s=s.parentNode.host;else{var o=qA(s);if(!o)break;if(e||Fx.indexOf(o.tagName.toLowerCase())>-1)n=!0;else try{var l=de.getComputedStyle(o);l&&l.getPropertyValue("cursor")==="pointer"&&(n=!0)}catch{}r.push(o),s=o}return{parentIsUsefulElement:n,targetElementList:r}};function Sb(t){for(var e=new Set,n=0,r=t;r.parentNode&&!Yr(r,"body");r=r.parentNode){if(n++>=BA||e.has(r))return!1;e.add(r);var s=tm(r);if(Je(s,"ph-sensitive")||Je(s,"ph-no-capture"))return!1}if(Je(tm(t),"ph-include"))return!0;var o=t.type||"";if(Ft(o))switch(o.toLowerCase()){case"hidden":case"password":return!1}var l=t.name||t.id||"";return!Ft(l)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(l.replace(/[^a-zA-Z0-9]/g,""))}function WA(t){return!!(Yr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Yr(t,"select")||Yr(t,"textarea")||t.getAttribute("contenteditable")==="true")}var YA="(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})|((?:2131|1800|35[0-9]{3})[0-9]{11})",l9=new RegExp("^(?:"+YA+")$"),c9=new RegExp(YA),KA="\\d{3}-?\\d{2}-?\\d{4}",u9=new RegExp("^("+KA+")$"),d9=new RegExp("("+KA+")");function od(t,e){return e===void 0&&(e=!0),!(tt(t)||Ft(t)&&(t=Dm(t),(e?l9:c9).test((t||"").replace(/[- ]/g,""))||(e?u9:d9).test(t)))}function oj(t){var e=Nd(t);return od(e=(e+" "+JA(t)).trim())?e:""}function JA(t){var e="";return t&&t.childNodes&&t.childNodes.length&&$t(t.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var s=Nd(n);e=(e+" "+s).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+JA(n)).trim())}catch(o){ke.error("[AutoCapture]",o)}})),e}function lj(t){return t.replace(/"|\\"/g,'\\"')}function h9(t){var e=t.attr__class;if(e)return it(e)?e:Px(e)}var Yf=an("[Dead Clicks]"),f9=()=>!0,p9=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(Ox)),r=t.instance.config.capture_dead_clicks;return Fi(r)?r:!!nn(r)||n};class cj{get lazyLoadedDeadClicksAutocapture(){return this.Xe}constructor(e,n,r){this.instance=e,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){if(e.ok){var n=e.config;"captureDeadClicks"in n&&(this.instance.persistence&&this.instance.persistence.register({[Ox]:n.
104captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.tr((()=>{this.er()})):this.stop()}tr(e){var n,r;(n=Be.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture?e():(r=Be.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(s=>{s?Yf.error("failed to load script",s):e()}))}er(){var e;if(Ae){if(!this.Xe&&(e=Be.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=nn(this.instance.config.capture_dead_clicks)?we({},this.instance.config.capture_dead_clicks):{};n.__onCapture=this.onCapture,this.onCapture&&(n.capture_dead_swipes=!1),this.Xe=Be.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.Xe.start(Ae),Yf.info("starting...")}}else Yf.error("`document` not found. Cannot start.")}stop(){this.Xe&&(this.Xe.stop(),this.Xe=void 0,Yf.info("stopping..."))}}var Dy=an("[SegmentIntegration]"),XA="posthog-js";function ZA(t,e){var n=e===void 0?{}:e,r=n.organization,s=n.projectId,o=n.prefix,l=n.severityAllowList,d=l===void 0?["error"]:l,h=n.sendExceptionsToPostHog,p=h===void 0||h;return g=>{var m,y,b,_,w;if(d!=="*"&&!d.includes(g.level)||!t.__loaded)return g;g.tags||(g.tags={});var S=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());g.tags["PostHog Person URL"]=S,t.sessionRecordingStarted()&&(g.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var E,k=((m=g.exception)==null?void 0:m.values)||[],j=k.map((O=>we({},O,{stacktrace:O.stacktrace?we({},O.stacktrace,{type:"raw",frames:(O.stacktrace.frames||[]).map((D=>we({},D,{platform:"web:javascript"})))}):void 0}))),N={$exception_message:((y=k[0])==null?void 0:y.value)||g.message,$exception_type:(b=k[0])==null?void 0:b.type,$exception_level:g.level,$exception_list:j,$sentry_event_id:g.event_id,$sentry_exception:g.exception,$sentry_exception_message:((_=k[0])==null?void 0:_.value)||g.message,$sentry_exception_type:(w=k[0])==null?void 0:w.type,$sentry_tags:g.tags};return r&&s&&(N.$sentry_url=(o||"https://sentry.io/organizations/")+r+"/issues/?project="+s+"&query="+g.event_id),p&&((E=t.exceptions)==null||E.sendExceptionEvent(N)),g}}class m9{constructor(e,n,r,s,o,l){this.name=XA,this.setupOnce=function(d){d(ZA(e,{organization:n,projectId:r,prefix:s,severityAllowList:o,sendExceptionsToPostHog:l==null||l}))}}}class uj{constructor(e){this.rr=(n,r,s)=>{s&&(s.noSessionId||s.activityTimeout||s.sessionPastMaximumLength||s.crossTabAdoption)&&(ke.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:s}),this.ir=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.nr()}nr(){var e;this.sr=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.rr)}destroy(){var e;(e=this.sr)==null||e.call(this),this.sr=void 0}doPageView(e,n){var r,s=this.ar(e,n);return this.ir={pathname:(r=de==null?void 0:de.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var n;return this.ar(e,(n=this.ir)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.ir)==null?void 0:e.pageViewId}}ar(e,n){var r=this.ir;if(!r)return{$pageview_id:n};var s={$pageview_id:n,$prev_pageview_id:r.pageViewId},o=this._instance.scrollManager.getContext();if(o&&!this._instance.config.disable_scroll_properties){var l=o.maxScrollHeight,d=o.lastScrollY,h=o.maxScrollY,p=o.maxContentHeight,g=o.lastContentY,m=o.maxContentY;if(!(Ee(l)||Ee(d)||Ee(h)||Ee(p)||Ee(g)||Ee(m))){l=Math.ceil(l),d=Math.ceil(d),h=Math.ceil(h),p=Math.ceil(p),g=Math.ceil(g),m=Math.ceil(m);var y=l>1?ts(d/l,0,1,ke):1,b=l>1?ts(h/l,0,1,ke):1,_=p>1?ts(g/p,0,1,ke):1,w=p>1?ts(m/p,0,1,ke):1;s=Yt(s,{$prev_pageview_last_scroll:d,$prev_pageview_last_scroll_percentage:y,$prev_pageview_max_scroll:h,$prev_pageview_max_scroll_percentage:b,$prev_pageview_last_content:g,$prev_pageview_last_content_percentage:_,$prev_pageview_max_content:m,$prev_pageview_max_content_percentage:w})}}return r.pathname&&(s.$prev_pageview_pathname=r.pathname),r.timestamp&&(s.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),s}}var Iy=["flags","surveys"],g9={[kA]:{exposure:"hidden"},[Ku]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Ju]:{exposure:"hidden"},[ib]:{exposure:"event"},[sb]:{exposure:"hidden"},[ab]:{exposure:"event"},[ob]:{exposure:"hidden"},[lb]:{exposure:"event"},[cb]:{exposure:"event"},[Ox]:{exposure:"event"}
104,[Dx]:{exposure:"hidden"},[ub]:{exposure:"event"},[Co]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[rc]:{exposure:"hidden"},[Ix]:{exposure:"event"},[jA]:{exposure:"event",shouldSkipFromEventProperties:t=>xr(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"},[jo]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!nn(t))return{};for(var e={},n=Object.keys(t),r=0;n.length>r;r++)e["$feature/"+n[r]]=t[n[r]];return e}},[pp]:{exposure:"event",storageGroup:"flags"},[Xu]:{exposure:"hidden"},[db]:{exposure:"hidden",storageGroup:"flags"},[mp]:{exposure:"event",storageGroup:"flags"},[hb]:{exposure:"event",storageGroup:"flags",volatile:!0},[Yp]:{exposure:"hidden",storageGroup:"flags"},[Ps]:{exposure:"event"},[Xl]:{exposure:"hidden"},[So]:{exposure:"hidden"},[Eo]:{exposure:"hidden"},[fb]:{exposure:"hidden",storageGroup:"surveys"},[Kp]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[pb]:{exposure:"event"},[gp]:{exposure:"hidden"},[Zu]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[ad]:{exposure:"hidden"},[mb]:{exposure:"hidden"},[gb]:{exposure:"hidden"},[Td]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Ii]:{exposure:"hidden"},[vb]:{exposure:"hidden"},[yb]:{exposure:"hidden"},[bb]:{exposure:"hidden"},[xb]:{exposure:"hidden"},[Jp]:{exposure:"hidden"},[Xp]:{exposure:"hidden"},[TA]:{exposure:"event"},[NA]:{exposure:"event"},[AA]:{exposure:"event"},[CA]:{exposure:"event"},[OA]:{exposure:"event"},[DA]:{exposure:"event"},[IA]:{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"}},v9=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],go=t=>{var e=g9[t];if(e)return e;for(var n of v9){var r=n[1];if(t.indexOf(n[0])===0)return r}},ic=(t,e)=>{try{return JSON.stringify(t,((n,r)=>typeof r=="bigint"?r.toString():r),e)}catch{return YN(t)}},Ad=t=>{var e=Ae==null?void 0:Ae.createElement("a");return Ee(e)?null:(e.href=t,e)},bc=function(t,e){for(var n,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;r.length>s;s++){var o=r[s].split("=");if(o[0]===e){n=o;break}}if(!it(n)||2>n.length)return"";var l=n[1];try{l=decodeURIComponent(l)}catch{ke.error("Skipping decoding for malformed query param: "+l)}return l.replace(/\+/g," ")},Cd=function(t,e,n){if(!t||!e||!e.length)return t;for(var r=t.split("#"),s=r[1],o=(r[0]||"").split("?"),l=o[1],d=o[0],h=(l||"").split("&"),p=[],g=0;h.length>g;g++){var m=h[g].split("=");it(m)&&(e.includes(m[0])?p.push(m[0]+"="+n):p.push(h[g]))}var y=d;return l!=null&&(y+="?"+p.join("&")),s!=null&&(y+="#"+s),y},nm=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},QA=(t,e)=>t>=e&&GN(),eC=(t,e,n,r)=>{if(t===0){if(GN()){var s=e+1;return s===n&&r(),s}return e}return 0},Kf="https?://(.*)",xc=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],y9=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...xc],Rd="<masked>",b9=["li_fat_id"];function tC(t,e,n){if(!Ae)return{};var r,s=e?[...xc,...n||[]]:[],o=nC(Cd(Ae.URL,s,Rd),t),l=(r={},$t(b9,(function(d){var h=LA(d);r[d]=h||null})),r);return Yt(l,o)}function nC(t,e){var n=y9.concat(e||[]),r={};return $t(n,(function(s){var o=bc(t,s);r[s]=o||null})),r}function rC(t){var e=(function(o){return o?o.search(Kf+"google.([^/?]*)")===0?"google":o.search(Kf+"bing.com")===0?"bing":o.search(Kf+"yaho
104o.com")===0?"yahoo":o.search(Kf+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",r={};if(!xr(e)){r.$search_engine=e;var s=Ae?bc(Ae.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function dj(){return navigator.language||navigator.userLanguage}var rm="$direct";function iC(){return(Ae==null?void 0:Ae.referrer)||rm}function sC(t,e,n){n===void 0&&(n=!1);var r=t?[...xc,...e||[]]:[],s=n?Ua(En==null?void 0:En.href):En==null?void 0:En.href,o=s==null?void 0:s.substring(0,1e3);return{r:iC().substring(0,1e3),u:o?Cd(o,r,Rd):void 0}}function aC(t,e){var n;e===void 0&&(e=!1);var r=t.r,s=t.u,o=e?Ua(s):s,l={$referrer:r,$referring_domain:r==null?void 0:r==rm?rm:(n=Ad(r))==null?void 0:n.host};if(o){l.$current_url=o;var d=Ad(o);l.$host=d==null?void 0:d.host,l.$pathname=d==null?void 0:d.pathname;var h=nC(o);Yt(l,h)}if(r){var p=rC(r);Yt(l,p)}return l}function oC(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function x9(){try{return new Date().getTimezoneOffset()}catch{return}}var _9={flags:Td,surveys:Kp},w9=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Fl="main";class My{constructor(e,n,r){if(r===void 0&&(r=!0),this.lr={},this.ur=!1,this.hr=!1,this.Te=e,this.dr=r,this.props={},this.cr=!1,this.vr=(o=>{var l="";return o.token&&(l=o.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),o.persistence_name?"ph_"+o.persistence_name:"ph_"+l+"_posthog"})(e),this.Je=this.pr(e),this.hr=this.gr(e),this.load(),e.debug&&ke.info("Persistence loaded",e.persistence,we({},this.props)),this.update_config(e,e,n),this.save(),de){var s=()=>this.flush();un(de,"beforeunload",s,{capture:!1}),un(de,"pagehide",s,{capture:!1})}}mr(){var e,n=(e=this.Te)==null?void 0:e.persistence_save_debounce_ms;return er(n)&&n>0?n:0}isDisabled(){return!!this.yr}pr(e){w9.indexOf(e.persistence.toLowerCase())===-1&&(ke.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n,r=(function(l,d){l===void 0&&(l=[]),d===void 0&&(d=!1);var h=[...Q8,...l];return we({},Vt,{F(p){try{var g={};try{g=qs.F(p)||{}}catch{}var m,y=JSON.parse(Vt.A(p)||"{}");if(d){var b={};for(var _ in g){var w=g[_];xr(w)||w===""||(b[_]=w)}m=Yt(y,b)}else m=Yt(g,y);return Vt.q(p,m),m}catch{}return null},q(p,g,m,y,b,_){var w=Vt.q(p,g,void 0,void 0,_);try{var S={};h.forEach((E=>{g[E]&&(S[E]=g[E])})),Object.keys(S).length&&qs.q(p,S,m,y,b,_)}catch(E){Vt.D(E)}return w},P(p,g){try{de==null||de.localStorage.removeItem(p),qs.P(p,g)}catch(m){Vt.D(m)}}})})(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),s=!1,o=e.persistence.toLowerCase();return o==="localstorage"&&Vt.N()?(n=Vt,s=!0):o==="localstorage+cookie"&&r.N()?(n=r,s=!0):o==="sessionstorage"&&Qn.N()?n=Qn:o==="memory"?n=e9:o==="cookie"?n=qs:r.N()?(n=r,s=!0):n=qs,this.ur=s,n}br(e){return this.vr+"__"+e}gr(e){return this.ur&&!!e.split_storage}_r(e){var n=e??this.Te.feature_flag_cache_ttl_ms;if(!n||0>=n)return!1;var r=this.props[Td];return!r||typeof r!="number"||Date.now()-r>n}properties(){var e={};return $t(this.props,((n,r)=>{var s=go(r);if((s==null?void 0:s.exposure)==="derived"){if(s.shouldSkipFromEventProperties!=null&&s.shouldSkipFromEventProperties(n,r===jo?()=>this._r():()=>!1))return;s.transformToEventProperties&&Yt(e,s.transformToEventProperties(n))}else if(!s||s.exposure==="event"){if(s!=null&&s.shouldSkipFromEventProperties!=null&&s.shouldSkipFromEventProperties(n,(()=>!1)))return;e[r]=n}})),e}load(){if(!this.yr){var e=this.Je.F(this.vr);e&&(this.props=Yt({},e)),this.hr&&this.wr()}}wr(){for(var e of Iy){var n=Vt.F(this.br(e));if(n&&!Pa(n)){var r=this.kr(e);r.persisted=!0,this.Sr(e)||(r.fingerprint=this.Cr(n,e)),this.Ir(e,n)||Yt(this.props,n)}}}Sr(e){return Object.keys(this.props).some((n=>{var r;return((r=go(n))==null?void 0:r.storageGroup)===e}))}Ir(e,n){var r=_9[e];if(!r)return!1;var s=n[r],o=this.props[r];return er(s)&&er(o)&&o>s}refreshKey(e){var n;if(!this.yr){var r=this.hr?(n=go(e))==null?void 0:n.storageGroup:void 0,s=r?Vt.F(this.br(r)):this.Je.F(this.vr);if(s&&e in s)this.Tr(e,s[e]);else{if(r){var o=this.Je.F(this.vr);if(o&&e in o)return void this.Tr(e,o[e])}this.Mr(e)}}}save(){if(!this.yr){var e=this.mr();e>0?Ee(this.Er)&&(this.Er=setTimeout((()=>{this.Er=void 0,this.Rr()}),e)):this.Rr()}}flush(){Ee(this.Er)||(clearTimeout(this.Er),this.Er=void 0,this.Rr())}Rr(){this.yr||(this.hr?this.Pr():this.Or(this.Je,this.vr,this.props,Fl))}Pr(){var e=this.Fr(),n=e.main,r=e.groups;for(var s of(this.Or(this.Je,this.vr,n,Fl),Iy)){var o,l=r[s];(!Pa(l)||(o=this.lr[s])!=null&&o.persisted)&&this.Or(Vt,this.br(s),l,s)}}Fr(){var e={},n={flags:{},surveys:{}};return $t(this.props,((r,s)=>{var o,l=(o=go(s))==null?void 0:o.storageGroup;l?n[l][s]=r:e[s]=r})),{main:e,groups:n}}Cr(e,n){if(n===Fl)return JSON.stringify(e)+"|"+this.Lr+"|"+this.$r+"|"+this.Ar;var r={};return $t(e,((s,o)=>{var l;r[o]=(l=go(o))!=null&&l.volatile?"__volatile__":s})),JSON.stringify(r)}Or(e,n,r,s){var o=this.kr(s);if(s===Fl||o.dirty||Ee(o.fingerprint)){var l;try{if((l=this.Cr(r,s))===o.fingerprint)return void(o.dirty=!1)}catch{l=void 0}e.q(n,r,this.Lr,this.$r,this.Ar,this.Te.debug)?(o.dirty=!1,s!==Fl&&(o.persisted=!0),Ee(l)||(o.fingerprint=l)):this.Te.debug&&
104ke.warn('failed to persist storage entry "'+n+'"; will retry on next save')}}remove(e){var n=(e===void 0?{}:e).keepGroupEntries,r=n!==void 0&&n;if(Ee(this.Er)||(clearTimeout(this.Er),this.Er=void 0),this.Je.P(this.vr,!1),this.Je.P(this.vr,!0),!r&&this.dr)for(var s of Iy)Vt.P(this.br(s));r?delete this.lr[Fl]:this.lr={}}clear(){this.remove(),this.props={}}register_once(e,n,r){if(nn(e)){Ee(n)&&(n="None"),this.Lr=Ee(r)?this.Nr:r;var s=!1;if($t(e,((o,l)=>{this.props.hasOwnProperty(l)&&this.props[l]!==n||(this.Tr(l,o),s=!0)})),s)return this.save(),!0}return!1}register(e,n){if(nn(e)){this.Lr=Ee(n)?this.Nr:n;var r=!1;if($t(e,((s,o)=>{e.hasOwnProperty(o)&&this.props[o]!==s&&(this.Tr(o,s),r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Mr(e),this.save())}update_campaign_params(){if(!this.cr){var e=tC(this.Te.custom_campaign_params,this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties);Pa(Lx(e))||this.register(e),this.cr=!0}}update_search_keyword(){var e;this.register((e=Ae==null?void 0:Ae.referrer)?rC(e):{})}update_referrer_info(){var e;this.register_once({$referrer:iC(),$referring_domain:Ae!=null&&Ae.referrer&&((e=Ad(Ae.referrer))==null?void 0:e.host)||rm},void 0)}set_initial_person_info(){this.props[bb]||this.props[xb]||this.register_once({[Jp]:sC(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={};$t([xb,bb],(s=>{var o=this.props[s];o&&$t(o,(function(l,d){e["$initial_"+X0(d)]=l}))}));var n=this.props[Jp];if(n){var r=(function(s,o){o===void 0&&(o=!1);var l=aC(s,o),d={};return $t(l,(function(h,p){d["$initial_"+X0(p)]=h})),d})(n,this.Te.disable_capture_url_hashes);Yt(e,r)}return e}safe_merge(e){return $t(this.props,(function(n,r){r in e||(e[r]=n)})),e}
104update_config(e,n,r){this.Nr=this.Lr=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var s=e.persistence!==n.persistence||!((h,p)=>{if(h.length!==p.length)return!1;var g=[...h].sort(),m=[...p].sort();return g.every(((y,b)=>y===m[b]))})(e.cookie_persisted_properties||[],n.cookie_persisted_properties||[]),o=s?this.pr(e):this.Je,l=this.gr(e);if(s||l!==this.hr){var d=this.props;this.clear(),this.Je=o,this.hr=l,this.props=d,this.save()}}set_disabled(e){this.yr=e,this.yr?this.remove():this.save()}set_cross_subdomain(e){e!==this.$r&&(this.$r=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Ar&&(this.Ar=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,n){var r=this.props[Ju]||{};r[e]=n,this.Tr(Ju,r),this.save()}remove_event_timer(e){var n=this.props[Ju]||{},r=n[e];return Ee(r)||(delete n[e],this.Tr(Ju,n),this.save()),r}get_property(e){return this.props[e]}set_property(e,n){this.Tr(e,n),this.save()}Tr(e,n){var r;this.props[e]=n,(r=go(e))!=null&&r.volatile||this.Dr(e)}Mr(e){delete this.props[e],this.Dr(e)}Dr(e){var n,r=(n=go(e))==null?void 0:n.storageGroup;r&&(this.kr(r).dirty=!0)}kr(e){return this.lr[e]||(this.lr[e]={})}}var Du={Activation:"events",Cancellation:"cancelEvents"},Ly={Popover:"popover",API:"api",Widget:"widget"},Gs={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},Py={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},Eb={Popover:"popover",Inline:"inline"},S9={SHOWN:"product tour shown"},hj={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},fj=an("[RateLimiter]");class E9{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach((s=>{fj.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4}))}catch(s){return void fj.warn('could not rate limit - continuing. Error: "'+(s==null?void 0:s.message)+'"',{text:r})}},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 n,r,s;e===void 0&&(e=!1);var o=this.captureEventsBurstLimit,l=this.captureEventsPerSecond,d=new Date().getTime(),h=(n=(r=this.instance.persistence)==null?void 0:r.get_property(yb))!==null&&n!==void 0?n:{tokens:o,last:d};h.tokens+=(d-h.last)/1e3*l,h.last=d,h.tokens>o&&(h.tokens=o);var p=1>h.tokens;return p||e||(h.tokens=Math.max(0,h.tokens-1)),!p||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+l+" events per second and "+o+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=p,(s=this.instance.persistence)==null||s.set_property(yb,h),{isRateLimited:p,remainingTokens:h.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var Iu=an("[RemoteConfig]");class lC{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=Be._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}qr(e){var n,r;(n=Be.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=Be.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):e()}jr(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(n){e(n.json)}})}load(){try{if(this.remoteConfig)return Iu.info("Using preloaded remote config",this.remoteConfig),this.Hr(this.remoteConfig),void this.Br();if(this._instance.Ur())return void Iu.warn("Remote config is disabled. Falling back to local config.");this.qr((e=>{if(!e)return Iu.info("No config found after loading remote JS config. Falling back to JSON."),void this.jr((n=>{this.Hr(n),this.Br()}));this.Hr(e),this.Br()}))}catch(e){Iu.error("Error loading remote config",e)}}stop(){this.zr&&(clearInterval(this.zr),this.zr=void 0)}refresh(){!this._instance.Ur()&&Ae&&Ae.visibilityState!=="hidden"&&this._instance.reloadFeatureFlags()}Br(){var e;if(!this.zr){var n=(e=this._instance.config.remote_config_refresh_interval_ms)!==null&&e!==void 0?e:3e5;n!==0&&(this.zr=setInterval((()=>{this.refresh()}),n))}}Hr(e){var n;e||Iu.error("Failed to fetch remote config from PostHog."),this._instance.Hr(e?{ok:!0,config:e}:{ok:!1}),(e==null?void 0:e.hasFeatureFlags)!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(n=this._instance.featureFlags)==null||n.ensureFlagsLoaded())}}var yr={GZipJS:"gzip-js",Base64:"base64"},yi=Uint8Array,Dr=Uint16Array,_c=Uint32Array,Ux=new yi([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]),zx=new yi([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]),pj=new yi([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),cC=function(t,e){for(var n=new Dr(31),r=0;31>r;++r)n[r]=e+=1<<t[r-1];var s=new _c(n[30]);for(r=1;30>r;++r)for(var o=n[r];n[r+1]>o;++o)s[o]=o-n[r]<<5|r;return[n,s]},uC=cC(Ux,2),kb=uC[1];uC[0][28]=258,kb[258]=28;for(var mj=cC(zx,0)[1],dC=new Dr(32768),rn=0;32768>rn;++rn){var $l=(43690&rn)>>>1|(21845&rn)<<1;dC[rn]=((65280&($l=(61680&($l=(52428&$l)>>>2|(13107&$l)<<2))>>>4|(3855&$l)<<4))>>>8|(255&$l)<<8)>>>1}var ld=function(t,e,n){for(var r=t.length,s=0,o=new Dr(e);r>s;++s)++o[t[s]-1];var l,d=new Dr(e);for(s=0;e>s;++s)d[s]=d[s-1]+o[s-1]<<1;for(l=new Dr(r),s=0;r>s;++s)l[s]=dC[d[t[s]-1]++]>>>15-t[s];return l},Lo=new yi(288);for(rn=0;144>rn;++rn)Lo[rn]=8;for(rn=144;256>rn;++rn)Lo[rn]=9;for(rn=256;280>rn;++rn)Lo[rn]=7;for(rn=280;288>rn;++rn)Lo[rn]=8;var im=new yi(32);for(rn=0;32>rn;++rn)im[rn]=5;var k9=ld(Lo,9),j9=ld(im,5),hC=function(t){return(t/8>>
vendor: 6,043 bytes, line 104
1040)+(7&t&&1)},fC=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof Dr?Dr:t instanceof _c?_c:yi)(n-e);return r.set(t.subarray(e,n)),r},Rs=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},Mu=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},Fy=function(t,e){for(var n=[],r=0;t.length>r;++r)t[r]&&n.push({s:r,f:t[r]});var s=n.length,o=n.slice();if(!s)return[new yi(0),0];if(s==1){var l=new yi(n[0].s+1);return l[n[0].s]=1,[l,1]}n.sort((function(O,D){return O.f-D.f})),n.push({s:-1,f:25001});var d=n[0],h=n[1],p=0,g=1,m=2;for(n[0]={s:-1,f:d.f+h.f,l:d,r:h};g!=s-1;)d=n[n[m].f>n[p].f?p++:m++],h=n[p!=g&&n[m].f>n[p].f?p++:m++],n[g++]={s:-1,f:d.f+h.f,l:d,r:h};var y=o[0].s;for(r=1;s>r;++r)o[r].s>y&&(y=o[r].s);var b=new Dr(y+1),_=jb(n[g-1],b,0);if(_>e){r=0;var w=0,S=_-e,E=1<<S;for(o.sort((function(O,D){return b[D.s]-b[O.s]||O.f-D.f}));s>r;++r){var k=o[r].s;if(e>=b[k])break;w+=E-(1<<_-b[k]),b[k]=e}for(w>>>=S;w>0;){var j=o[r].s;e>b[j]?w-=1<<e-b[j]++-1:++r}for(;r>=0&&w;--r){var N=o[r].s;b[N]==e&&(--b[N],++w)}_=e}return[new yi(b),_]},jb=function(t,e,n){return t.s==-1?Math.max(jb(t.l,e,n+1),jb(t.r,e,n+1)):e[t.s]=n},gj=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Dr(++e),r=0,s=t[0],o=1,l=function(h){n[r++]=h},d=1;e>=d;++d)if(t[d]==s&&d!=e)++o;else{if(!s&&o>2){for(;o>138;o-=138)l(32754);o>2&&(l(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(l(s),--o;o>6;o-=6)l(8304);o>2&&(l(o-3<<5|8208),o=0)}for(;o--;)l(s);o=1,s=t[d]}return[n.subarray(0,r),e]},Lu=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},Tb=function(t,e,n){var r=n.length,s=hC(e+2);t[s]=255&r,t[s+1]=r>>>8,t[s+2]=255^t[s],t[s+3]=255^t[s+1];for(var o=0;r>o;++o)t[s+o+4]=n[o];return 8*(s+4+r)},vj=function(t,e,n,r,s,o,l,d,h,p,g){Rs(e,g++,n),++s[256];for(var m=Fy(s,15),y=m[0],b=m[1],_=Fy(o,15),w=_[0],S=_[1],E=gj(y),k=E[0],j=E[1],N=gj(w),O=N[0],D=N[1],F=new Dr(19),R=0;k.length>R;++R)F[31&k[R]]++;for(R=0;O.length>R;++R)F[31&O[R]]++;for(var B=Fy(F,7),M=B[0],V=B[1],W=19;W>4&&!M[pj[W-1]];--W);var Q,K,te,I,H=p+5<<3,G=Lu(s,Lo)+Lu(o,im)+l,re=Lu(s,y)+Lu(o,w)+l+14+3*W+Lu(F,M)+(2*F[16]+3*F[17]+7*F[18]);if(G>=H&&re>=H)return Tb(e,g,t.subarray(h,h+p));if(Rs(e,g,1+(G>re)),g+=2,G>re){Q=ld(y,b),K=y,te=ld(w,S),I=w;var U=ld(M,V);for(Rs(e,g,j-257),Rs(e,g+5,D-1),Rs(e,g+10,W-4),g+=14,R=0;W>R;++R)Rs(e,g+3*R,M[pj[R]]);g+=3*W;for(var A=[k,O],$=0;2>$;++$){var P=A[$];for(R=0;P.length>R;++R)Rs(e,g,U[q=31&P[R]]),g+=M[q],q>15&&(Rs(e,g,P[R]>>>5&127),g+=P[R]>>>12)}}else Q=k9,K=Lo,te=j9,I=im;for(R=0;d>R;++R)if(r[R]>255){var q;Mu(e,g,Q[257+(q=r[R]>>>18&31)]),g+=K[q+257],q>7&&(Rs(e,g,r[R]>>>23&31),g+=Ux[q]);var z=31&r[R];Mu(e,g,te[z]),g+=I[z],z>3&&(Mu(e,g,r[R]>>>5&8191),g+=zx[z])}else Mu(e,g,Q[r[R]]),g+=K[r[R]];return Mu(e,g,Q[256]),g+K[256]},T9=new _c([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),N9=(function(){for(var t=new _c(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),$y=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function A9(t,e){e===void 0&&(e={});var n=(function(){var m=4294967295;return{p(y){for(var b=m,_=0;y.length>_;++_)b=N9[255&b^y[_]]^b>>>8;m=b},d(){return 4294967295^m}}})(),r=t.length;n.p(t);var s,o,l,d,h,p=(d=10+((s=e).filename&&s.filename.length+1||0),h=8,(function(m,y,b,_,w,S){var E=m.length,k=new yi(_+E+5*(1+Math.floor(E/7e3))+w),j=k.subarray(_,k.length-w),N=0;if(!y||8>E)for(var O=0;E>=O;O+=65535){var D=O+65535;E>D?N=Tb(j,N,m.subarray(O,D)):(j[O]=!0,N=Tb(j,N,m.subarray(O,E)))}else{for(var F=T9[y-1],R=F>>>13,B=8191&F,M=(1<<b)-1,V=new Dr(32768),W=new Dr(M+1),Q=Math.ceil(b/3),K=2*Q,te=function(jn){return(m[jn]^m[jn+1]<<Q^m[jn+2]<<K)&M},I=new _c(25e3),H=new Dr(288),G=new Dr(32),re=0,U=0,A=(O=0,0),$=0,P=0;E>O;++O){var q=te(O),z=32767&O,X=W[q];if(V[z]=X,W[q]=z,O>=$){var se=E-O;if((re>7e3||A>24576)&&se>423){N=vj(m,j,0,I,H,G,U,A,P,O-P,N),A=re=U=0,P=O;for(var ne=0;286>ne;++ne)H[ne]=0;for(ne=0;30>ne;++ne)G[ne]=0}var ie=2,fe=0,_e=B,Te=z-X&32767;if(se>2&&q==te(O-Te))for(var Oe=Math.min(R,se)-1,xe=Math.min(32767,O),Ge=Math.min(258,se);xe>=Te&&--_e&&z!=X;){if(m[O+ie]==m[O+ie-Te]){for(var Le=0;Ge>Le&&m[O+Le]==m[O+Le-Te];++Le);if(Le>ie){if(ie=Le,fe=Te,Le>Oe)break;var mt=Math.min(Te,Le-2),Et=0;for(ne=0;mt>ne;++ne){var Jt=O-Te+ne+32768&32767,wt=Jt-V[Jt]+32768&32767;wt>Et&&(Et=wt,X=Jt)}}}Te+=(z=X)-(X=V[z])+32768&32767}if(fe){I[A++]=268435456|kb[ie]<<18|mj[fe];var Xt=31&kb[ie],ur=31&mj[fe];U+=Ux[Xt]+zx[ur],++H[257+Xt],++G[ur],$=O+ie,++re}else I[A++]=m[O],++H[m[O]]}}N=vj(m,j,!0,I,H,G,U,A,P,O-P,N)}return fC(k,0,_+hC(N)+w)})(o=t,(l=e).level==null?6:l.level,l.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(o.length)))):12+l.mem,d,h)),g=p.length;return(function(m,y){var b=y.filename;if(m[0]=31,m[1]=139,m[2]=8,m[8]=2>y.level?4:y.level==9?2:0,m[9]=3,y.mtime!=0&&$y(m,4,Math.floor(new Date(y.mtime||Date.now())/1e3)),b){m[3]=8;for(var _=0;b.length>=_;++_)m[_+10]=b.charCodeAt(_)}})(p,e),$y(p,g-8,n.d()),$y(p,g-4,r),p}var C9=!!Y0||!!jx,pC="text/plain",yp=!1,Nb=(t,e)=>{var n=t.split("#"),r=n[1],s=n[0].split("?"),o=s[0],l=s[1];if(!l)return t;var d=l.split("&").filter((h=>h.split("=")[0]!==e)).join("&");return o+(d?"?"+d:"")+(r?"#"+r:"")},Bx=function(t,e,n){var r;n===void 0&&(n=!0);var s=t.split("?"),o=s[0],l=s[1],d=we({},e),h=(r=l==null?void 0:l.split("&").map((g=>{var m,y=g.split("="),b=y[0],_=n&&(m=d[b])!==null&&m!==void 0?m:y[1];return delete d[b],b+"="+_})))!==null&&r!==void 0?r:[],p=(function(g,m){var y,b;m===void 0&&(m="&");var _=[];return $t(g,(function(w,S){Ee(w)||Ee(S)||S==="undefined"||(y=encodeURIComponent((E=>E instanceof File)(w)?w.name:w.toString()),b=encodeURIComponent(S),_[_.length]=b+"="+y)})),_.join(m)})(d);return p&&h.push(p),h.length>0?o+"?"+h.join("&"):o},Uy=t=>{if(t.Vr)return t.Vr;var e=t.data,n=t.compression;if(e){if(n===yr.GZipJS){var r=A9((function(d,h){var p=d.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(d);for(var g=new yi(d.length+(d.length>>>1)),m=0,y=function(S){g[m++]=S},b=0;p>b;++b){if(m+5>g.length){var _=new yi(m+8+(p-b<<1));_.set(g),g=_}
104var w=d.charCodeAt(b);128>w?y(w):2048>w?(y(192|w>>>6),y(128|63&w)):w>55295&&57344>w?(y(240|(w=65536+(1047552&w)|1023&d.charCodeAt(++b))>>>18),y(128|w>>>12&63),y(128|w>>>6&63),y(128|63&w)):(y(224|w>>>12),y(128|w>>>6&63),y(128|63&w))}return fC(g,0,m)})(ic(e)),{mtime:0});return{contentType:pC,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===yr.Base64){var s=(function(d){return d&&btoa(encodeURIComponent(d).replace(/%([0-9A-F]{2})/g,((h,p)=>String.fromCharCode(parseInt(p,16)))))})(ic(e)),o=(d=>"data="+encodeURIComponent(typeof d=="string"?d:ic(d)))(s);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var l=ic(e);return{contentType:"application/json",body:l,estimatedSize:new Blob([l]).size}}},mC=t=>{var e,n,r=()=>t.transport==="sendBeacon"?{url:Bx(t.url,{compression:yr.Base64}),encodedBody:Uy(we({},t,{compression:yr.Base64,Vr:void 0}))}:{url:Nb(t.url,"compression"),encodedBody:Uy(we({},t,{compression:void 0,Vr:void 0}))};try{e=Uy(t)}catch(s){if(zk(t.compression,bc(t.url,"compression")))return ke.error("Failed to gzip request body, sending uncompressed payload",s),r();throw s}return e&&zk(t.compression,bc(t.url,"compression"))&&!((n=e.body)instanceof ArrayBuffer?K0(new Uint8Array(n)):ArrayBuffer.isView(n)&&K0(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(yp=!0,r()):{url:t.url,encodedBody:e}},gC=t=>{try{return mC(t)}catch(e){return ke.error(e),void(t.callback==null||t.callback({statusCode:0,error:e}))}},R9=(function(){var t=gn((function*(e){var n=ic(e.data),r=yield(function(o,l,d){return J0.apply(this,arguments)})(n,Pt.DEBUG,{rethrow:!0});if(!r)return e;var s=yield r.arrayBuffer();return we({},e,{Vr:{contentType:pC,body:s,estimatedSize:s.byteLength}})}));return function(e){return t.apply(this,arguments)}})(),O9=/Failed to fetch|NetworkError|Load failed/i,vC=t=>{var e=gC(t);if(e){var n=e.url,r=e.encodedBody,s=r??{},o=s.contentType,l=s.body,d=s.estimatedSize,h=new Headers;$t(t.headers,(function(_,w){h.append(w,_)})),o&&h.append("Content-Type",o);var p=null,g=!1;if(Ik){var m=new Ik;p={signal:m.signal,timeout:setTimeout((()=>{var _,w;g=!0,m.abort((_=t.timeout,(w=new Error("PostHog request timed out"+(_?" after "+_+"ms":""))).name="AbortError",w))}),t.timeout)}}var y=_=>{g&&(_==null?void 0:_.name)==="AbortError"||(w=>(w==null?void 0:w.name)==="TypeError"&&O9.test((w==null?void 0:w.message)||""))(_)?ke.warn(_):ke.error(_),t.callback==null||t.callback({statusCode:0,error:_})};try{var b;jx(n,we({method:(t==null?void 0:t.method)||"GET",headers:h,keepalive:t.method==="POST"&&!t.Wr&&52428.8>(d||0),body:l,signal:(b=p)==null?void 0:b.signal},t.fetchOptions)).then((_=>_.text().then((w=>{var S={statusCode:_.status,text:w};if(_.status===200)try{S.json=JSON.parse(w)}catch(E){ke.error(E)}t.callback==null||t.callback(S)})))).catch(y).finally((()=>p?clearTimeout(p.timeout):null))}catch(_){p&&clearTimeout(p.timeout),y(_)}}},Ab=t=>{try{var e=mC(t),n=e.url,r=e.encodedBody,s=r??{},o=s.body,l=s.estimatedSize;if(!o)return;var d=o instanceof Blob?o:new Blob([o],{type:s.contentType});if(br.sendBeacon(n,d))return;if(it(t.data)&&t.data.length>1&&(l??0)>16384){var h=Math.ceil(t.data.length/2);return Ab(we({},t,{data:t.data.slice(0,h)})),void Ab(we({},t,{data:t.data.slice(h)}))}ke.warn("Beacon of ~"+(l??0)+" bytes was rejected by the browser, falling back to fetch"),vC(we({},t,{Wr:!0}))}catch(p){ke.warn("Beacon send failed",p)}},D9=["/e/","/s/"],yj=(t,e,n,r)=>{var s=(d=>{var h=(p=>{var g=Ad(p),m=(g==null?void 0:g.pathname)||p.split(/[?#]/)[0];return m?m[0]==="/"?m:"/"+m:"/"})(d);return D9.some((p=>((g,m)=>g.slice(g.length-m.length)===m)(h,p)))})(t),o=s?Nb(t,"ver"):t,l=r==="query"?e==="POST"?"sent_at":"_":void 0;return Bx(n===yr.GZipJS?Nb(o,"compression"):o,we({},l?{[l]:Date.now().toString()}:{},s?{}:{ver:Pt.JS_SDK_VERSION},n===yr.GZipJS?{}:{compression:n}))},bp=[];jx&&bp.push({transport:"fetch",method:vC}),Y0&&bp.push({transport:"XHR",method(t){var e=gC(t);if(e){var n=new Y0,r=e.encodedBody;n.open(t.method||"GET",e.url,!0);var s=r??{},o=s.contentType,l=s.body;$t(t.headers,(function(d,h){n.setRequestHeader(h,d)})),o&&n.setRequestHeader("Content-Type",o),t.timeout&&(n.timeout=t.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var d={statusCode:n.status,text:n.responseText};if(n.status===200)try{d.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(d)}},n.send(l)}}}),br!=null&&br.sendBeacon&&bp.push({transport:"sendBeacon",method:Ab});var Cb=3e3;class I9{constructor(e,n){this.Zr=!0,this.Gr=[],this.Qr=ts((n==null?void 0:n.flush_interval_ms)||Cb,250,5e3,ke.createLogger("flush interval"),Cb),this.Jr=e}enqueue(e){this.Gr.push(e),this.Kr||this.Yr()}
104unload(){this.Xr();var e=this.Gr.length>0?this.ti():{},n=Object.values(e);[...n.filter((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.ei(we({},r,{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 n=this.ti(),r=function(){var o=n[s],l=new Date().getTime();o.data&&it(o.data)&&$t(o.data,(d=>{d.offset=Math.abs(d.timestamp-l),delete d.timestamp})),e.ei(o)};for(var s in n)r()}}),this.Qr))}ei(e){try{this.Jr(e)}catch(n){ke.error(n)}}Xr(){clearTimeout(this.Kr),this.Kr=void 0}ti(){var e={};return $t(this.Gr,(n=>{var r,s=n,o=(s?s.batchKey:null)||s.url;Ee(e[o])&&(e[o]=we({},s,{data:[]})),(r=e[o].data)==null||r.push(s.data)})),this.Gr=[],e}}var M9=["retriesPerformedSoFar"];class L9{constructor(e){this.ri=!1,this.ii=3e3,this.Gr=[],this._instance=e,this.Gr=[],this.ni=!0,!Ee(de)&&"onLine"in de.navigator&&(this.ni=de.navigator.onLine,this.si=()=>{this.ni=!0,this.oi()},this.ai=()=>{this.ni=!1},un(de,"online",this.si),un(de,"offline",this.ai))}get length(){return this.Gr.length}retriableRequest(e){var n=e.retriesPerformedSoFar,r=VN(e,M9);Ls(n)&&(r.url=Bx(r.url,{retry_count:n})),this._instance._send_request(we({},r,{callback:s=>{if(s.statusCode!==200&&(400>s.statusCode||s.statusCode>=500)){if((s.statusCode===0?3:10)>(n??0))return void this.Ot(we({retriesPerformedSoFar:n},r));s.statusCode===0&&ke.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(n??0)+" retries.")}r.callback==null||r.callback(s)}}))}Ot(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=(function(l){var d=3e3*Math.pow(2,l),h=d/2,p=Math.min(18e5,d),g=Math.random()-.5;return Math.ceil(p+g*(p-h))})(n),s=Date.now()+r;this.Gr.push({retryAt:s,requestOptions:e});var o="Enqueued failed request for retry in "+r;navigator.onLine||(o+=" (Browser is offline)"),ke.warn(o),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(),n=[],r=this.Gr.filter((o=>e>o.retryAt||(n.push(o),!1)));if(this.Gr=n,r.length>0)for(var s of r)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this.ui&&(clearTimeout(this.ui),this.ui=void 0),this.ri=!1,Ee(de)||(this.si&&(de.removeEventListener("online",this.si),this.si=void 0),this.ai&&(de.removeEventListener("offline",this.ai),this.ai=void 0)),this.Gr)){var n=e.requestOptions;try{this._instance._send_request(we({},n,{transport:"sendBeacon"}))}catch(r){ke.error(r)}}this.Gr=[]}}class P9{constructor(e){this.hi=()=>{var n,r,s,o;this.di||(this.di={});var l=this.scrollElement(),d=this.scrollY(),h=l?Math.max(0,l.scrollHeight-l.clientHeight):0,p=d+((l==null?void 0:l.clientHeight)||0),g=(l==null?void 0:l.scrollHeight)||0;this.di.lastScrollY=Math.ceil(d),this.di.maxScrollY=Math.max(d,(n=this.di.maxScrollY)!==null&&n!==void 0?n:0),this.di.maxScrollHeight=Math.max(h,(r=this.di.maxScrollHeight)!==null&&r!==void 0?r:0),this.di.lastContentY=p,this.di.maxContentY=Math.max(p,(s=this.di.maxContentY)!==null&&s!==void 0?s:0),this.di.maxContentHeight=Math.max(g,(o=this.di.maxContentHeight)!==null&&o!==void 0?o: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(){un(de,"scroll",this.hi,{capture:!0}),un(de,"scrollend",this.hi,{capture:!0}),un(de,"resize",this.hi)}scrollElement(){if(!this.ci)return de==null?void 0:de.document.documentElement;var e=it(this.ci)?this.ci:[this.ci];for(var n of e){var r=de==null?void 0:de.document.querySelector(n);if(r)return r}}vi(e){var n=e==="y"?"scrollTop":"scrollLeft";if(this.ci){var r=this.scrollElement();return r&&r[n]||0}return de?e==="y"?de.scrollY||de.pageYOffset||de.document.documentElement.scrollTop||0:de.scrollX||de.pageXOffset||de.document.documentElement.scrollLeft||0:0}scrollY(){return this.vi("y")}scrollX(){return this.vi("x")}}var F9=t=>sC(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
104);class bj{constructor(e,n,r,s){this.fi=o=>{var l=this.pi();if(!l||l.sessionId!==o){var d={sessionId:o,props:this.gi(this._instance)};this.mi.register({[vb]:d})}},this._instance=e,this.yi=n,this.mi=r,this.gi=s||F9,this.yi.onSessionId(this.fi)}pi(){return this.mi.props[vb]}getSetOnceProps(){var e,n=(e=this.pi())==null?void 0:e.props;return n?"r"in n?aC(n,this._instance.config.disable_capture_url_hashes):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var e={};return $t(Lx(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+X0(r)]=n})),e}}class Hx{on(e,n){return this.bi[e]||(this.bi[e]=[]),this.bi[e].push(n),()=>{this.bi[e]=this.bi[e].filter((r=>r!==n))}}emit(e,n){for(var r of this.bi[e]||[])r(n);for(var s of this.bi["*"]||[])s(e,n)}constructor(){this.bi={}}}var Pu=an("[SessionId]");class xj{on(e,n){return this.wi.on(e,n)}constructor(e,n,r){var s;if(this.xi=null,this.ki=[],this.Si=void 0,this.Ci=!1,this.wi=new Hx,this.Ii=(p,g)=>!(!Ls(p)||!Ls(g))&&Math.abs(p-g)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===Hs)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=n||Bs,this.Ri=r||Bs;var o=this.Te.persistence_name||this.Te.token;if(this._sessionTimeoutMs=1e3*ts(this.Te.session_idle_timeout_seconds||1800,60,36e3,Pu.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Pi(),this.Oi="ph_"+o+"_window_id",this.Fi="ph_"+o+"_primary_window_exists",this.Li()){var l=Qn.F(this.Oi),d=Qn.F(this.Fi);l&&!d?this.Ti=l:Qn.P(this.Oi),Qn.q(this.Fi,!0)}if((s=this.Te.bootstrap)!=null&&s.sessionID)try{var h=(p=>{var g=this.Te.bootstrap.sessionID.replace(/-/g,"");if(g.length!==32)throw new Error("Not a valid UUID");if(g[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(g.substring(0,12),16)})();this.$i(this.Te.bootstrap.sessionID,new Date().getTime(),h)}catch(p){Pu.error("Invalid sessionID in bootstrap",p)}this.Ai()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return Ee(this.ki)&&(this.ki=[]),this.ki.push(e),this.Mi&&e(this.Mi,this.Ti),()=>{this.ki=this.ki.filter((n=>n!==e))}}Li(){return this.Te.persistence!=="memory"&&!this.mi.yr&&Qn.N()}Ni(e){e!==this.Ti&&(this.Ti=e,this.Li()&&Qn.q(this.Oi,e))}Di(){return this.Ti?this.Ti:this.Li()?Qn.F(this.Oi):null}qi(e){var n=this.xi;return!xr(n)&&!xr(e)&&5e3>Math.abs(e-n)}$i(e,n,r){var s=n!==this._sessionActivityTimestamp,o=!(e!==this.Mi||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.Mi=e,o&&!s||o&&this.qi(n)||(this.xi=n,this.mi.register({[rc]:[n,e,r]}))}ji(){var e,n=(e=this.Te)==null?void 0:e.persistence_save_debounce_ms;return Ls(n)&&n>0}Hi(){this.ji()?this.mi.refreshKey(rc):(this.mi.flush(),this.mi.load())}Bi(){var e;if(!xr(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.xi){this.Hi();var n=this.Ui();n[1]===this.Mi&&n[2]===this._sessionStartTimestamp&&(this.xi=this._sessionActivityTimestamp,this.mi.register({[rc]:[this._sessionActivityTimestamp,(e=this.Mi)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.mi.flush())}}zi(){var e=this.Ui()[0],n=Ls(e)?e:0,r=Ls(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(n,r)}Vi(e){return this.Hi(),this.Ii(e,this.zi())}Ui(){var e=this.mi.props[rc];return it(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.xi=null,clearTimeout(this.Wi),this.Wi=void 0,this.$i(null,null,null)}destroy(){this.Ci=!0,this.Bi(),clearTimeout(this.Wi),this.Wi=void 0,this.Si&&de&&(de.removeEventListener(Qp,this.Si,{capture:!1}),this.Si=void 0),this.ki=[]}Ai(){this.Si=()=>{this.Bi(),this.Li()&&Qn.P(this.Fi)},un(de,Qp,this.Si,{capture:!1})}
104checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.Te.cookieless_mode===Hs)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),s=this.Ui(),o=s[1],l=s[2],d=this.zi(),h=this.Di(),p=Ls(l)&&Math.abs(r-l)>864e5,g=!1,m=!1,y=!o,b=o,_=!y&&!e&&this.Ii(r,d);if(_){(_=this.Vi(r))||Pu.info("cross-tab refresh kept the session alive",{sessionId:o});var w=this.Ui();o=w[1],l=w[2]}y||_||p?(o=this.Ei(),h=this.Ri(),Pu.info("new session ID generated",{sessionId:o,windowId:h,changeReason:{noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p}}),l=r,g=!0):(h||(h=this.Ri(),g=!0),(m=o!==b)&&(Pu.info("adopted cross-tab session id",{sessionId:o,windowId:h}),g=!0));var S=Ls(d)&&e&&!p?d:r,E=Ls(l)?l:new Date().getTime();this.Ni(h),this.$i(o,S,E),e||this.Pi();var k={noSessionId:y,activityTimeout:_,sessionPastMaximumLength:p,crossTabAdoption:m};return g&&this.ki.forEach((j=>j(o,h,k))),{sessionId:o,windowId:h,sessionStartTimestamp:E,changeReason:g?k:void 0,lastActivityTimestamp:d}}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 yC=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&Hk(n,e))return!0;try{var r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some((s=>Hk(s==null?void 0:s.brand,e))))return!0}catch{}return!!t.webdriver};function bC(){return(bC=gn((function*(){var t=br==null?void 0:br.userAgentData;if(t!=null&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return Ft(n)&&n.length>0?n:void 0}catch(r){return void ke.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",r)}}))).apply(this,arguments)}var sm=function(t,e){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function _j(t,e,n){return ic({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var xC={exact:(t,e)=>e.some((n=>t.some((r=>n===r)))),is_not:(t,e)=>e.every((n=>t.every((r=>n!==r)))),regex:(t,e)=>e.some((n=>t.some((r=>sm(n,r))))),not_regex:(t,e)=>e.every((n=>t.every((r=>!sm(n,r))))),icontains:(t,e)=>e.map(Jf).some((n=>t.map(Jf).some((r=>n.includes(r))))),not_icontains:(t,e)=>e.map(Jf).every((n=>t.map(Jf).every((r=>!n.includes(r))))),gt:(t,e)=>e.some((n=>{var r=parseFloat(n);return!isNaN(r)&&t.some((s=>r>parseFloat(s)))})),lt:(t,e)=>e.some((n=>{var r=parseFloat(n);return!isNaN(r)&&t.some((s=>r<parseFloat(s)))}))},Jf=t=>t.toLowerCase();function _C(t,e){return!t||Object.entries(t).every((n=>{var r=n[1],s=e==null?void 0:e[n[0]];if(Ee(s)||xr(s))return!1;var o=[String(s)],l=xC[r.operator];return!!l&&l(r.values,o)}))}var Rb="custom",wj="i.posthog.com",$9=/^\/static\//;class U9{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,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+wj,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}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":Rb),this.Zi[this.apiHost]}Gi(e){if($9.test(e)){var n=this.instance.config.asset_host;if(typeof n=="string")return n.trim().replace(/\/$/,"")||void 0}}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.uiHost+n;if(e==="flags")return this.flagsApiHost+n;if(e==="assets"){var r=this.Gi(n);if(r)return""+r+n}if(this.region===Rb)return this.apiHost+n;var s=wj+n;switch(e){case"assets":return"https://"+this.region+"-assets."+s;case"api":return"https://"+this.region+"."+s}}}function wC(t){var e;return!((e=t.conditions)==null||(e=e.events)==null||(e=e.values)==null||!e.length)}var Ot=an("[Surveys]"),SC="seenSurvey_",EC=t=>{try{var e=(n=>((r,s)=>""+SC+(function(o){return o.current_iteration&&o.current_iteration>0?o.id+"_"+o.current_iteration:o.id})(s))(0,n))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(n){Ot.error("Failed to persist survey seen state",n)}},z9=[Ly.Popover,Ly.Widget,Ly.API],B9={ignoreConditions:!1,ignoreDelay:!1,displayType:Eb.Popover}
104,H9=an("[PostHog ExternalIntegrations]"),q9={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class G9{constructor(e){this._instance=e}tr(e,n){var r;(r=Be.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(s=>{if(s)return H9.error("failed to load script",s);n()}))}startIfEnabledOrStop(){var e=this,n=function(){var o,l,d,h=r[0],p=r[1];!p||(o=Be.__PosthogExtensions__)!=null&&(o=o.integrations)!=null&&o[h]||e.tr(q9[h],(()=>{var g;(g=Be.__PosthogExtensions__)==null||(g=g.integrations)==null||(g=g[h])==null||g.start(e._instance)})),!p&&(l=Be.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[h]&&((d=Be.__PosthogExtensions__)==null||(d=d.integrations)==null||(d=d[h])==null||d.stop())};for(var r of Object.entries((s=this._instance.config.integrations)!==null&&s!==void 0?s:{})){var s;n()}}}var cd={},zy=0,am=()=>{},Sj='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Fu="Surveys module not available",Ej="sanitize_properties is deprecated. Use before_send instead",kC="Invalid value for property_denylist config: ",V9=["token","distinct_id",RA],Ql="posthog",jC=!C9&&(Or==null?void 0:Or.indexOf("MSIE"))===-1&&(Or==null?void 0:Or.indexOf("Mozilla"))===-1,By=t=>{var e;return we({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Y8(Ae==null?void 0:Ae.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:am,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:En&&Ft(En==null?void 0:En.search)&&En.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:(de==null||(e=de.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(n){ke.error("Bad HTTP status: "+n.statusCode+" "+n.text)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:_b,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Cb},error_tracking:{},_onCapture:am},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:a9,ignore_text_selection:!0}
104:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:n&&n>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:n&&n>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:n&&n>="2026-05-30"?250:0,split_storage:!(!n||"2026-05-30">n),detect_google_search_app:!(!n||"2026-05-30">n),disable_capture_url_hashes:!(!n||"2026-06-25">n)}))(t))},W9=[["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"]],kj=t=>{var e={};for(var n of W9){var r=n[0],s=n[1];Ee(t[r])||(e[s]=t[r])}var o=Yt({},e,t),l=t.__preview_external_dependency_versioned_paths;return Ee(l)||(Ee(t.strict_script_versioning)&&(o.strict_script_versioning=!!l),Ft(l)&&Ee(t.asset_host)&&(o.asset_host=l)),it(t.property_blacklist)&&(Ee(t.property_denylist)?o.property_denylist=t.property_blacklist:it(t.property_denylist)?o.property_denylist=[...t.property_blacklist,...t.property_denylist]:ke.error(kC+t.property_denylist)),o};class Y9{constructor(){this.__forceAllowLocalhost=!1}get Qi(){return this.__forceAllowLocalhost}set Qi(e){ke.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class gi{Ji(e,n){if(e){var r=this.Ki.indexOf(e);r!==-1&&this.Ki.splice(r,1)}return this.Ki.push(n),n.initialize==null||n.initialize(),n}Yi(){return this.config.cookieless_mode===Hs||this.config.cookieless_mode===ko&&this.consent.isRejected()}get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.webPerformance=new Y9,this.Xi=!1,this.version=Pt.LIB_VERSION,this.tn=new Hx,this.Ki=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=By(),this.SentryIntegration=m9,this.sentryIntegration=r=>(function(s,o){var l=ZA(s,o);return{name:XA,processEvent:d=>l(d)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.en=!1,this.rn=null,this.nn=null,this.sn=null,this.scrollManager=new P9(this),this.pageViewManager=new uj(this),this.rateLimiter=new E9(this),this.requestRouter=new U9(this),this.consent=new t9(this),this.externalIntegrations=new G9(this);var n=(e=gi.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.metrics=n.metrics&&new n.metrics(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(r,s,o)=>{var l=Ft(r)?{[r]:s}:r;this.setPersonProperties(l),o==null||o({})},set_once:(r,s,o)=>{var l=Ft(r)?{[r]:s}:r;this.setPersonProperties(void 0,l),o==null||o({})}},this.on("eventCaptured",(r=>ke.info('send "'+(r==null?void 0:r.event)+'"',r)))}init(e,n,r){if(r&&r!==Ql){var s,o=(s=cd[r])!==null&&s!==void 0?s:new gi;return o._init(e,n,r),cd[r]=o,cd[Ql][r]=o,o}return this._init(e,n,r)}_init(e,n,r){var s,o;n===void 0&&(n={});var l=Ft(e)?e.trim():"";if(!l)return ke.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=By(n.defaults),n.debug=this.an(n.debug),this.ln=n,this.un=[],n.person_profiles?this.nn=n.person_profiles:n.process_person&&(this.nn=n.process_person);var d=By(n.defaults),h=kj(n),p=Yt({},d,h,{name:r,token:l});nn(d.rageclick)&&nn(h.rageclick)&&(p.rageclick=Yt({},d.rageclick,h.rageclick)),nn(d.session_recording)&&nn(h.session_recording)&&(p.session_recording=Yt({},d.session_recording,h.session_recording)),this.set_config(p),this.config.on_xhr_error&&ke.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:yr.GZipJS;var g=this.hn();this.persistence=new My(this.config,g),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new My(we({},this.config,{persistence:"sessionStorage"}),g,!1);var m=we({},this.persistence.props),y=we({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.dn=new I9((N=>this.cn(N)),this.config.request_queue_config),this.vn=new L9(this),this.__request_queue=[];var b=this.Yi();if(b||(this.sessionManager=new xj(this),this.sessionPropsManager=new bj(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(ke.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.fn(b)}),0)):(ke.info("Initializing extensions synchronously"),this.fn(b)),Pt.DEBUG=Pt.DEBUG||this.config.debug,Pt.DEBUG&&ke.info("Starting in debug mode",{this:this,config:n,thisC:we({},this.config),p:m,s:y}),!this.config.identity_distinct_id||(s=n.bootstrap)!=null&&s.distinctID||(n.bootstrap=we({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((o=n.bootstrap)==null?void 0:o.distinctID)!==void 0){var _=n.bootstrap.distinctID,w=this.get_distinct_id(),S=this.persistence.get_property(Ii);if(n.bootstrap.isIdentifiedID&&w!=null&&w!==_&&S===Ll)this.identify(_);else if(n.bootstrap.isIdentifiedID&&w!=null&&w!==_&&S===Pl)ke.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 E=this.config.get_device_id(Bs()),k=n.bootstrap.isIdentifiedID?E:_;this.persistence.set_property(Ii,n.bootstrap.isIdentifiedID?Pl:Ll),this.register({distinct_id:_,$device_id:k})}}if(b)this.register_once({distinct_id:Gf,$device_id:null},"");else if(!this.get_distinct_id()){var j=this.config.get_device_id(Bs());this.register_once({distinct_id:j,$device_id:j},""),this.persistence.set_property(Ii,Ll)}
104return un(de,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?(function(N,O){var D=N.config.segment;if(!D)return O();(function(F,R){var B=F.config.segment;if(!B)return R();var M=W=>{var Q=()=>W.anonymousId()||Bs();F.config.get_device_id=Q,W.id()&&(F.register({distinct_id:W.id(),$device_id:Q()}),F.persistence.set_property(Ii,Pl)),R()},V=B.user();"then"in V&&Li(V.then)?V.then(M):M(V)})(N,(()=>{D.register((F=>{typeof Promise<"u"&&Promise.resolve||Dy.warn("This browser does not have Promise support, and can not use the segment integration");var R=(B,M)=>{if(!M)return B;B.event.userId||B.event.anonymousId===F.get_distinct_id()||(Dy.info("No userId set, resetting PostHog"),F.reset()),B.event.userId&&B.event.userId!==F.get_distinct_id()&&(Dy.info("UserId set, identifying with PostHog"),F.identify(B.event.userId));var V=F.calculateEventProperties(M,B.event.properties);return B.event.properties=Object.assign({},V,B.event.properties),B};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:B=>R(B,B.event.event),page:B=>R(B,Zl),identify:B=>R(B,Cy),screen:B=>R(B,"$screen")}})(N)).then((()=>{O()}))}))})(this,(()=>this.pn())):this.pn(),Li(this.config._onCapture)&&this.config._onCapture!==am&&(ke.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(N=>this.config._onCapture(N.event,N)))),this.config.ip&&ke.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 bC.apply(this,arguments)})().then((N=>{N&&this.register({[Ny]:N})})).catch(am),this}fn(e){var n,r,s,o,l,d,h,p,g=performance.now(),m=we({},gi.__defaultExtensionClasses,this.config.__extensionClasses),y=[];m.featureFlags&&this.Ki.push(this.featureFlags=(n=this.featureFlags)!==null&&n!==void 0?n:new m.featureFlags(this)),m.exceptions&&this.Ki.push(this.exceptions=(r=this.exceptions)!==null&&r!==void 0?r:new m.exceptions(this)),m.historyAutocapture&&this.Ki.push(this.historyAutocapture=new m.historyAutocapture(this)),m.tracingHeaders&&this.Ki.push(this.tracingHeaders=new m.tracingHeaders(this)),m.siteApps&&this.Ki.push(this.siteApps=new m.siteApps(this)),m.sessionRecording&&!e&&this.Ki.push(this.sessionRecording=new m.sessionRecording(this)),this.config.disable_scroll_properties||y.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),m.autocapture&&this.Ki.push(this.autocapture=new m.autocapture(this)),m.surveys&&this.Ki.push(this.surveys=(s=this.surveys)!==null&&s!==void 0?s:new m.surveys(this)),m.logs&&this.Ki.push(this.logs=(o=this.logs)!==null&&o!==void 0?o:new m.logs(this)),m.metrics&&this.Ki.push(this.metrics=(l=this.metrics)!==null&&l!==void 0?l:new m.metrics(this)),m.conversations&&this.Ki.push(this.conversations=(d=this.conversations)!==null&&d!==void 0?d:new m.conversations(this)),m.productTours&&this.Ki.push(this.productTours=new m.productTours(this)),m.heatmaps&&this.Ki.push(this.heatmaps=new m.heatmaps(this)),m.webVitalsAutocapture&&this.Ki.push(this.webVitalsAutocapture=new m.webVitalsAutocapture(this)),m.exceptionObserver&&this.Ki.push(this.exceptionObserver=new m.exceptionObserver(this)),m.deadClicksAutocapture&&this.Ki.push(this.deadClicksAutocapture=new m.deadClicksAutocapture(this,p9)),m.toolbar&&this.Ki.push(this.toolbar=(h=this.toolbar)!==null&&h!==void 0?h:new m.toolbar(this)),m.experiments&&this.Ki.push(this.experiments=(p=this.experiments)!==null&&p!==void 0?p:new m.experiments(this)),this.Ki.forEach((b=>{b.initialize&&y.push((()=>{b.initialize==null||b.initialize()}))})),y.push((()=>{if(this.gn){var b=this.gn;this.gn=void 0,this.Hr(b)}})),this.mn(y,g)}mn(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout((()=>{this.mn(e,n)}),0);var r=e.shift();if(r)try{r()}catch(o){ke.error("Error initializing extension:",o)}}var s=Math.round(performance.now()-n);this.register_for_session({[OA]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[DA]:s}),this.config.__preview_deferred_init_extensions&&ke.info("PostHog extensions initialized ("+s+"ms)")}Hr(e){if(!Ae||!Ae.body)return ke.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Hr(e)}),500);if(this.config.__preview_deferred_init_extensions&&(this.gn=e),this.yn=e,this.compression=void 0,e.ok){var n,r=e.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=Je(r.supportedCompression,yr.GZipJS)?yr.GZipJS:Je(r.supportedCompression,yr.Base64)?yr.Base64:void 0),(n=r.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.nn?this.nn:_b}),this.Ki.forEach((s=>s.onRemoteConfig==null?void 0:s.onRemoteConfig(e)))}pn(){try{this.config.loaded(this)}catch(r){ke.critical("`loaded` function failed",r)}if(this.bn(),this.config.internal_or_test_user_hostname&&En!=null&&En.hostname){var e=En.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?e===n:n.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Yi())&&this._n()}),1),this.wn=new lC(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()&&Vf(this.__request_queue,(e=>this.cn(e))),this.__request_queue=[],this.bn()}_handle_unload(){var e,n,r,s,o;(e=this.surveys)==null||e.handlePageUnload==null||e.handlePageUnload(),(n=this.metrics)==null||n.flush("sendBeacon"),this.config.request_batching?(this.xn()&&this.capture(Ay),(r=this.logs)==null||r.flushLogs("sendBeacon"),(s=this.dn)==null||s.unload(),(o=this.vn)==null||o.unload()):this.xn()&&this.capture(Ay,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?jC?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=we({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(Ee(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,
104(n=>{var r,s,o,l=we({},n);l.timeout=l.timeout||6e4;var d=(r=l.transport)!==null&&r!==void 0?r:"fetch";d==="sendBeacon"&&Ee(l.compression)&&l.data&&(l.compression=yr.Base64),l.timestampMode==="body"&&l.method==="POST"&&l.data&&!it(l.data)&&(l.data=we({},l.data,{sent_at:new Date().toISOString()})),l.url=yj(l.url,l.method,l.compression,l.timestampMode);var h=bp.filter((g=>!l.disableTransport||!g.transport||!l.disableTransport.includes(g.transport))),p=(s=(o=(function(g,m){for(var y=0;g.length>y;y++)if(g[y].transport===d)return g[y]})(h))==null?void 0:o.method)!==null&&s!==void 0?s:h[0].method;if(!p)throw new Error("No available transport method");d!=="sendBeacon"&&l.data&&l.compression===yr.GZipJS&&JP&&typeof Promise<"u"&&!yp?R9(l).then((g=>{p(g)})).catch((g=>{if(Bk(g))return yp=!0,void p(we({},l,{compression:void 0,url:yj(n.url,n.method,void 0,n.timestampMode)}));(m=>{if(!m||typeof m!="object")return!1;var y="name"in m?String(m.name):"";return Bk(m)||y===WN})(g)&&(yp=!0),p(l)})):p(l)})(we({},e,{callback:n=>{var r,s;this.rateLimiter.checkForLimiting(n),400>n.statusCode||(r=(s=this.config).on_request_error)==null||r.call(s,n),e.callback==null||e.callback(n)}}))):e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:0}))}
104cn(e){this.vn?this.vn.retriableRequest(e):this._send_request(e)}_execute_array(e){zy++;try{var n,r=[],s=[],o=[];Vf(e,(d=>{if(d)if(it(n=d[0]))o.push(d);else if(Li(d))try{d.call(this)}catch(h){ke.error("Error executing queued PostHog call",d,h)}else it(d)&&n==="alias"?r.push(d):it(d)&&n.indexOf("capture")!==-1&&Li(this[n])?o.push(d):s.push(d)}));var l=function(d,h){Vf(d,(function(p){try{if(it(p[0])){var g=h;$t(p,(function(m){g=g[m[0]].apply(g,m.slice(1))}))}else h[p[0]].apply(h,p.slice(1))}catch(m){ke.error("Error executing queued PostHog call",p,m)}}))};l(r,this),l(s,this),l(o,this)}finally{zy--}}push(e){if(zy>0&&it(e)&&Ft(e[0])){var n=gi.prototype[e[0]];Li(n)&&n.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,n,r){var s,o,l,d,h;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.dn){if(this.is_capturing())if(!Ee(e)&&Ft(e)){var p=!this.config.opt_out_useragent_filter&&this._is_bot();if(!p||this.config.__preview_capture_bot_pageviews){var g=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(g==null||!g.isRateLimited){n!=null&&n.$current_url&&!Ft(n==null?void 0:n.$current_url)&&(ke.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),e!=="$exception"||r!=null&&r.kn||ke.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 m=new Date,y=(r==null?void 0:r.timestamp)||m,b=Wk(r==null?void 0:r.uuid,Bs),_={uuid:b,event:e,properties:this.calculateEventProperties(e,n||{},y,b)};e===Zl&&this.config.__preview_capture_bot_pageviews&&p&&(_.event="$bot_pageview",_.properties.$browser_type="bot"),g&&(_.properties.$lib_rate_limit_remaining_tokens=g.remainingTokens);var w=e==="$feature_flag_called"&&_.properties.$feature_flag_has_experiment===!1&&this.get_property(Yp)===!0;r!=null&&r.$set&&!w&&(_.$set=r==null?void 0:r.$set);var S=r==null?void 0:r.$unset;S&&(_.$unset=S);var E,k,j,N=w?void 0:this.Sn(r==null?void 0:r.$set_once,e!==Qk,e===Cy);if(N&&(_.$set_once=N),r!=null&&r._noTruncate||(o=this.config.properties_string_max_length,l=_,d=V=>Ft(V)?V.slice(0,o):V,h=new Set,_=(function V(W,Q){if(W!==Object(W))return d?d(W):W;if(!h.has(W)){var K;if(h.add(W),it(W))K=[],Vf(W,(I=>{K.push(V(I))}));else{var te={};$t(W,((I,H)=>{h.has(I)||(te[H]=V(I))})),K=te}return K}})(l)),_.timestamp=y,Ee(r==null?void 0:r.timestamp)||(_.properties.$event_time_override_provided=!0,_.properties.$event_time_override_system_time=m),w&&(_.properties=(function(V,W){W===void 0&&(W=[]);var Q={},K=te=>{V[te]!==void 0&&(Q[te]=V[te])};return XP.forEach(K),W.forEach(K),Q})(_.properties,V9)),e===Gs.DISMISSED||e===Gs.SENT){var O=n==null?void 0:n[Py.SURVEY_ID],D=n==null?void 0:n[Py.SURVEY_ITERATION];EC({id:O,current_iteration:D}),_.$set=we({},_.$set,{[(E={id:O,current_iteration:D},k=e===Gs.SENT?"responded":"dismissed",j="$survey_"+k+"/"+E.id,E.current_iteration&&E.current_iteration>0&&(j="$survey_"+k+"/"+E.id+"/"+E.current_iteration),j)]:!0})}else e===Gs.SHOWN&&(_.$set=we({},_.$set,{[Py.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===S9.SHOWN){var F=n==null?void 0:n[hj.TOUR_TYPE];F&&(_.$set=we({},_.$set,{[hj.TOUR_LAST_SEEN_DATE+"/"+F]:new Date().toISOString()}))}var R=we({},_.properties.$set,_.$set);if(Pa(R)||this.setPersonPropertiesForFlags(R),!tt(this.config.before_send)){var B=this.Rt(_);if(!B)return;(_=B).uuid=Wk(_.uuid,Bs)}this.tn.emit("eventCaptured",_);var M={method:"POST",url:(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:_,compression:"best-available",timestampMode:"query",batchKey:r==null?void 0:r._batchKey,transport:r==null?void 0:r.transport};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.cn(M):this.dn.enqueue(M),_}ke.critical("This capture call is ignored due to client rate limiting.")}}else ke.error("No event name provided to posthog.capture")}else ke.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(n=>e(n.event,n)))}calculateEventProperties(e,n,r,s,o){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var l=o?void 0:this.persistence.remove_event_timer(e),d=we({},n);if(d.token=this.config.token,d.$config_defaults=this.config.defaults,this.Yi()&&(d[RA]=!0),e==="$snapshot"){var h=we({},this.persistence.properties(),this.sessionPersistence.properties());return d.distinct_id=h.distinct_id,(!Ft(d.distinct_id)&&!er(d.distinct_id)||Z0(d.distinct_id))&&ke.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),d}var p,g=(function(j,N,O,D){var F,R,B,M;if(D===void 0&&(D=!1),!Or)return{};var V,W=j?[...xc,...N||[]]:[],Q=(function(Oe){for(var xe=0;Gk.length>xe;xe++){var Ge=Gk[xe],Le=Ge[1],mt=Ge[0].exec(Oe),Et=mt&&(Li(Le)?Le(mt,Oe):Le);if(Et)return Et}return["",""]})(Or),K=Q[0],te=Q[1],I=(V=typeof navigator<"u"?navigator:void 0)!=null&&V.brave?{brave:!0}:{},H={};Ee(O)||(H.detectGoogleSearchApp=O);var G={},re=(F=navigator)==null||(F=F.userAgentData)==null?void 0:F.platform,U=(R=navigator)==null?void 0:R.maxTouchPoints,A=de==null||(B=de.screen)==null?void 0:B.width,$=de==null||(M=de.screen)==null?void 0:M.height,P=de==null?void 0:de.devicePixelRatio;Ee(re)||(G.userAgentDataPlatform=re),Ee(U)||(G.maxTouchPoints=U),Ee(A)||(G.screenWidth=A),Ee($)||(G.screenHeight=$),Ee(P)||(G.devicePixelRatio=P);var q,z,X,se,ne,ie,fe,_e,Te=Yt(Lx({$os:K,$os_version:te,$browser:vA(Or,n
104avigator.vendor,I,H),$device:Vk(Or),$device_type:(z=Or,X=G,_e=Vk(z),_e===QN||_e===ZN||_e==="Kobo"||_e==="Kindle Fire"||_e===hA?gc:_e===kd||_e===dc||_e===jd||_e===eb?"Console":_e===tA?"Wearable":_e?Jr:(X==null?void 0:X.userAgentDataPlatform)==="Android"&&((se=X==null?void 0:X.maxTouchPoints)!==null&&se!==void 0?se:0)>0?600>Math.min((ne=X==null?void 0:X.screenWidth)!==null&&ne!==void 0?ne:0,(ie=X==null?void 0:X.screenHeight)!==null&&ie!==void 0?ie:0)/((fe=X==null?void 0:X.devicePixelRatio)!==null&&fe!==void 0?fe:1)?Jr:gc:"Desktop"),$timezone:oC(),$timezone_offset:x9()}),{$current_url:Cd(D?Ua(En==null?void 0:En.href):En==null?void 0:En.href,W,Rd),$host:En==null?void 0:En.host,$pathname:En==null?void 0:En.pathname,$raw_user_agent:Or.length>1e3?Or.substring(0,997)+"...":Or,$browser_version:g8(Or,navigator.vendor,I,H),$browser_language:dj(),$browser_language_prefix:(q=dj(),typeof q=="string"?q.split("-")[0]:void 0),$screen_height:de==null?void 0:de.screen.height,$screen_width:de==null?void 0:de.screen.width,$viewport_height:de==null?void 0:de.innerHeight,$viewport_width:de==null?void 0:de.innerWidth,$lib:Pt.LIB_NAME,$lib_version:Pt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Pt.SDK_DIST_CHANNEL&&(Te.$sdk_dist_channel=Pt.SDK_DIST_CHANNEL),Te})(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 m=this.sessionManager.checkAndGetSessionAndWindowId(o,r.getTime()),y=m.windowId;d.$session_id=m.sessionId,d.$window_id=y}this.sessionPropsManager&&Yt(d,this.sessionPropsManager.getSessionProps());try{var b;this.sessionRecording&&Yt(d,this.sessionRecording.sdkDebugProperties),d.$sdk_debug_retry_queue_size=(b=this.vn)==null?void 0:b.length}catch(j){d.$sdk_debug_error_capturing_properties=String(j)}if(this.requestRouter.region===Rb&&(d.$lib_custom_api_host=this.config.api_host),p=e!==Zl||o?e!==Ay||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),d=Yt(d,p),e===Zl&&Ae&&(d.title=Ae.title),!Ee(l)){var _=r.getTime()-l;d.$duration=parseFloat((_/1e3).toFixed(3))}Or&&this.config.opt_out_useragent_filter&&(d.$browser_type=this._is_bot()?"bot":"browser");var w=this.persistence.properties(),S=this.sessionPersistence.properties();$t(["$referrer","$referring_domain"],(j=>{j in w&&delete S[j]})),(d=Yt({},g,w,S,d)).$is_identified=this._isIdentified(),it(this.config.property_denylist)?$t(this.config.property_denylist,(function(j){delete d[j]})):ke.error(kC+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var E=this.config.sanitize_properties;E&&(ke.error(Ej),d=E(d,e));var k=this.Cn();return d.$process_person_profile=k,k&&!o&&this.In("_calculate_event_properties"),d}Sn(e,n,r){var s;if(n===void 0&&(n=!0),r===void 0&&(r=!1),!this.persistence||!this.Cn()||this.Xi&&!r)return e;var o=this.persistence.get_initial_props(),l=(s=this.sessionPropsManager)==null?void 0:s.getSetOnceProps(),d=Yt({},o,l||{},e||{}),h=this.config.sanitize_properties;return h&&(ke.error(Ej),d=h(d,"$set_once")),n&&(this.Xi=!0),Pa(d)?void 0:d}register(e,n){var r;(r=this.persistence)==null||r.register(e,n)}register_once(e,n,r){var s;(s=this.persistence)==null||s.register_once(e,n,r)}register_for_session(e){var n;(n=this.sessionPersistence)==null||n.register(e)}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e)}Tn(e,n){this.register({[e]:n})}getFeatureFlag(e,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagResult(e,n)}getAllFeatureFlags(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,n){var r,s;return(r=(s=this.featureFlags)==null?void 0:s.isFeatureEnabled(e,n))!==null&&r!==void 0?r:n==null?void 0:n.defaultValue}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,n,r){var s;(s=this.featureFlags)==null||s.updateFlags(e,n,r)}updateEarlyAccessFeatureEnrollment(e,n,r){var s;(s=this.featureFlags)==null||s.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n,r){var s;return n===void 0&&(n=!1),(s=this.featureFlags)==null?void 0:s.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.tn.on(e,n)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:Fu}),()=>{})}onSessionId(e){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(e))!==null&&n!==void 0?n:()=>{}}
104getSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getSurveys(e,n):e([],{isLoaded:!1,error:Fu})}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:Fu})}renderSurvey(e,n){var r;(r=this.surveys)==null||r.renderSurvey(e,n)}displaySurvey(e,n){var r;n===void 0&&(n=B9),(r=this.surveys)==null||r.displaySurvey(e,n)}cancelPendingSurvey(e){var n;(n=this.surveys)==null||n.cancelPendingSurvey(e)}canRenderSurvey(e){var n,r;return(n=(r=this.surveys)==null?void 0:r.canRenderSurvey(e))!==null&&n!==void 0?n:{visible:!1,disabledReason:Fu}}canRenderSurveyAsync(e,n){var r,s;return n===void 0&&(n=!1),(r=(s=this.surveys)==null?void 0:s.canRenderSurveyAsync(e,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:Fu})}Mn(e){return!e||Z0(e)?(ke.critical("Unique user id has not been set in posthog.identify"),!1):e===Gf?(ke.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())||(ke.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(e,n,r){if(!this.__loaded||!this.persistence)return ke.uninitializedWarning("posthog.identify");if(er(e)&&(e=e.toString(),ke.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(Wp)||this.register_once({$had_persisted_distinct_id:!0,$device_id:s},""),e!==s&&e!==this.get_property(Ku)&&(this.unregister(Ku),this.register({distinct_id:e}));var o,l=(this.persistence.get_property(Ii)||Ll)===Ll;e!==s&&l?(this.persistence.set_property(Ii,Pl),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.capture(Cy,{distinct_id:e,$anon_distinct_id:s},{$set:n||{},$set_once:r||{}}),this.sn=_j(e,n,r),(o=this.featureFlags)==null||o.setAnonymousDistinctId(s)):(n||r)&&this.setPersonProperties(n,r),e!==s&&(this.reloadFeatureFlags(),this.unregister(ad))}}setPersonProperties(e,n){if((e||n)&&this.In("posthog.setPersonProperties")){var r=_j(this.get_distinct_id(),e,n);this.sn!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.sn=r):ke.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var n,r=(it(e)?e:[e]).filter((s=>Ft(s)&&s.length>0));r.length!==0&&this.In("posthog.unsetPersonProperties")&&((n=this.featureFlags)==null||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.sn=null)}group(e,n,r){if(e&&n){var s=this.getGroups(),o=s[e]!==n;if(o&&this.resetGroupPropertiesForFlags(e),this.register({$groups:we({},s,{[e]:n})}),o||r){var l={$group_type:e,$group_key:n};r&&(l.$group_set=r),this.capture(Qk,l)}r&&this.setGroupPropertiesForFlags({[e]:r}),o&&!r&&this.reloadFeatureFlags()}else ke.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){var r;n===void 0&&(n=!0),(r=this.featureFlags)==null||r.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(e){var n;e===void 0&&(e=!0),(n=this.featureFlags)==null||n.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,n){var r;n===void 0&&(n=!0),this.In("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)==null||r.setGroupPropertiesForFlags(e,n))}resetGroupPropertiesForFlags(e){var n;(n=this.featureFlags)==null||n.resetGroupPropertiesForFlags(e)}reset(e){var n,r,s,o,l,d,h,p,g,m;if(ke.info("reset"),!this.__loaded)return ke.uninitializedWarning("posthog.reset");var y,b=this.get_property(Wp),_=this.get_property(Ny),w=this.get_property(Co);if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),Ee(w)||(y=this.persistence)==null||y.register({[Co]:w}),(s=this.surveys)==null||s.reset(),(o=this.wn)==null||o.stop(),(l=this.featureFlags)==null||l.reset(),(d=this.conversations)==null||d.reset(),(h=this.logs)==null||h.reset(),(p=this.metrics)==null||p.reset(),(g=this.persistence)==null||g.set_property(Ii,Ll),(m=this.sessionManager)==null||m.resetSessionId(),this.sn=null,this.config.cookieless_mode===Hs)this.register_once({distinct_id:Gf,$device_id:null},"");else{var S=this.config.get_device_id(Bs());this.register_once({distinct_id:S,$device_id:e?S:b},""),e||Ee(_)||this.register({[Ny]:_})}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 n=this;return gn((function*(){var r,s,o,l,d;n.__loaded?((r=n.logs)==null||r.flushLogs("sendBeacon"),(s=n.metrics)==null||s.flush("sendBeacon"),(o=n.dn)==null||o.unload(),(l=n.vn)==null||l.unload(),(d=n.featureFlags)==null||d.destroy()):ke.uninitializedWarning("posthog.shutdown")}))()}
104setIdentity(e,n){var r;this.config.identity_distinct_id=e,this.config.identity_hash=n,this.alias(e),(r=this.conversations)==null||r.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,n;return(e=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var n=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n.sessionId);if(e!=null&&e.withTimestamp&&r){var o,l=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!r)return s;s+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-l,0)}return s}alias(e,n){return e===this.get_property(kA)?(ke.critical("Attempting to create alias for existing People user - aborting."),-2):this.In("posthog.alias")?(Ee(n)&&(n=this.get_distinct_id()),e!==n?(this.Tn(Ku,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(ke.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=we({},this.config);if(nn(e)){var r,s,o,l,d,h,p,g,m,y,b;Yt(this.config,kj(e));var _=this.hn();(r=this.persistence)==null||r.update_config(this.config,n,_),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new My(we({},this.config,{persistence:"sessionStorage"}),_,!1);var w=this.an(this.config.debug);Fi(w)&&(this.config.debug=w),Fi(this.config.debug)&&(this.config.debug?(Pt.DEBUG=!0,Vt.N()&&Vt.q("ph_debug",!0),ke.info("set_config",{config:e,oldConfig:n,newConfig:we({},this.config)})):(Pt.DEBUG=!1,Vt.N()&&Vt.P("ph_debug"))),(s=this.exceptionObserver)==null||s.onConfigChange(),(o=this.exceptions)==null||o.onConfigChange(),(l=this.sessionRecording)==null||l.startIfEnabledOrStop(),(d=this.tracingHeaders)==null||d.startIfEnabledOrStop(),(h=this.autocapture)==null||h.startIfEnabled(),(p=this.heatmaps)==null||p.startIfEnabled(),(g=this.exceptionObserver)==null||g.startIfEnabledOrStop(),(m=this.deadClicksAutocapture)==null||m.startIfEnabledOrStop(),(y=this.surveys)==null||y.loadIfEnabled(),this.Pn(),(b=this.externalIntegrations)==null||b.startIfEnabledOrStop()}}_overrideSDKInfo(e,n){Pt.LIB_NAME=e,Pt.LIB_VERSION=n}startSessionRecording(e){var n,r,s,o,l,d=e===!0,h={sampling:d||!(e==null||!e.sampling),linked_flag:d||!(e==null||!e.linked_flag),url_trigger:d||!(e==null||!e.url_trigger),event_trigger:d||!(e==null||!e.event_trigger)};Object.values(h).some(Boolean)&&((n=this.sessionManager)==null||n.checkAndGetSessionAndWindowId(),h.sampling&&((r=this.sessionRecording)==null||r.overrideSampling()),h.linked_flag&&((s=this.sessionRecording)==null||s.overrideLinkedFlag()),h.url_trigger&&((o=this.sessionRecording)==null||o.overrideTrigger("url")),h.event_trigger&&((l=this.sessionRecording)==null||l.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,n){if(this.exceptions){var r=new Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(we({},s,n))}}addExceptionStep(e,n){var r;(r=this.exceptions)==null||r.addExceptionStep(e,n)}captureLog(e){var n;(n=this.logs)==null||n.captureLog(e)}get logger(){var e,n;return(e=(n=this.logs)==null?void 0:n.logger)!==null&&e!==void 0?e:gi.On}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var n,r;return(n=(r=this.toolbar)==null?void 0:r.loadToolbar(e))!==null&&n!==void 0&&n}get_property(e){var n;return(n=this.persistence)==null?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)==null?void 0:n.props[e]}toString(){var e,n=(e=this.config.name)!==null&&e!==void 0?e:Ql;return n!==Ql&&(n=Ql+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(Ii))===Pl||((n=this.sessionPersistence)==null?void 0:n.get_property(Ii))===Pl}Cn(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles===_b&&!this._isIdentified()&&Pa(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Ku])&&((n=this.persistence)==null||(n=n.props)==null||!n[Xp]))}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"?(ke.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Tn(Xp,!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!==ko)}Pn(){var e,n,r,s,o=this.hn();return((e=this.persistence)==null?void 0:e.yr)!==o&&((r=this.persistence)==null||r.set_disabled(o)),((n=this.sessionPersistence)==null?void 0:n.yr)!==o&&((s=this.sessionPersistence)==null||s.set_disabled(o)),o}opt_in_capturing(e){var n;if(this.config.cookieless_mode!==Hs){if(this.Yi()){var r,s,o,l,d;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(s=this.pageViewM
104anager)==null||s.destroy(),this.sessionManager=new xj(this),this.pageViewManager=new uj(this),this.persistence&&(this.sessionPropsManager=new bj(this,this.sessionManager,this.persistence));var h,p=(o=(l=this.config.__extensionClasses)==null?void 0:l.sessionRecording)!==null&&o!==void 0?o:(d=gi.__defaultExtensionClasses)==null?void 0:d.sessionRecording;p&&(this.sessionRecording=this.Ji(this.sessionRecording,new p(this)),this.yn&&((h=this.sessionRecording)==null||h.onRemoteConfig==null||h.onRemoteConfig(this.yn)))}var g,m;this.consent.optInOut(!0),this.Pn(),this.bn(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==ko&&((g=this.surveys)==null||g.loadIfEnabled()),(Ee(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((m=e==null?void 0:e.captureEventName)!==null&&m!==void 0?m:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._n()}else ke.warn(Sj)}opt_out_capturing(){var e,n,r;this.config.cookieless_mode!==Hs?(this.config.cookieless_mode===ko&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Pn(),this.config.cookieless_mode===ko&&(this.register({distinct_id:Gf,$device_id:null}),(e=this.sessionRecording)==null||e.stopRecording(),this.sessionRecording=void 0,(n=this.sessionManager)==null||n.destroy(),(r=this.pageViewManager)==null||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this._n(),this.bn())):ke.warn(Sj)}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===Hs||(this.config.cookieless_mode===ko?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Pn()}_is_bot(){return br?yC(br,this.config.custom_blocked_useragents):void 0}_n(){Ae&&(Ae.visibilityState==="visible"?this.en||(this.en=!0,this.capture(Zl,{title:Ae.title},{send_instantly:!0}),this.rn&&(Ae.removeEventListener(Zp,this.rn),this.rn=null)):this.rn||(this.rn=this._n.bind(this),un(Ae,Zp,this.rn)))}debug(e){e===!1?(de==null||de.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(de==null||de.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}))}Ur(){var e=this.ln||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(ke.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(function(n,r,s,o,l){var d=r in n&&!tt(n[r]),h=s in n&&!tt(n[s]);return d?n[r]:!!h&&(l&&l.warn("Config field '"+s+"' is deprecated. Please use '"+r+"' instead. The old field will be removed in a future major version."),n[s])})(e,"advanced_disable_flags","advanced_disable_decide",0,ke)}Rt(e){var n;if(tt(this.config.before_send))return e;var r=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(i8),s=it(this.config.before_send)?this.config.before_send:[this.config.before_send],o=e;for(var l of s){if(o=l(o),tt(o)){var d="Event '"+e.event+"' was rejected in beforeSend function";return r8(e.event)?ke.warn(d+". This can cause unexpected behavior."):ke.info(d),null}o.properties&&!Pa(o.properties)||ke.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var h of r)if(o.properties&&tt(o.properties[h]))return ke.warn("Event '"+e.event+"' had its '"+h+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return o}getPageViewId(){var e;return(e=this.pageViewManager.ir)==null?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(r)})}an(e){var n=Fi(e)&&!e,r=Vt.N()&&Vt.A("ph_debug")==="true";return!n&&(!!r||e)}}gi.__defaultExtensionClasses={}
104,gi.On=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),(function(t,e){for(var n=0;e.length>n;n++)t.prototype[e[n]]=V8(t.prototype[e[n]])})(gi,["identify"]);class jj{constructor(e){this.disabled=e===!1;var n=nn(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,r){if(this.disabled)return!1;var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(n-s.y)<this.thresholdPx&&this.timeoutMs>r-s.timestamp){if(this.clicks.push({x:e,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:r}];return!1}}var Hy="$copy_autocapture",qy=an("[AutoCapture]");function Gy(t,e){return e.length>t?e.slice(0,t)+"...":e}function K9(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!za(e));return e}function J9(t,e){var n,r,s=e.e,o=e.maskAllElementAttributes,l=e.maskAllText,d=e.elementAttributeIgnoreList,h=e.elementsChainAsString,p=e.disableCaptureUrlHashes;if(!za(t))return{props:{}};for(var g=[t],m=new Set([t]),y=t;y.parentNode&&!Yr(y,"body")&&BA>g.length;)if(zA(y.parentNode)){var b=y.parentNode.host;if(m.has(b))break;m.add(b),g.push(b),y=b}else{if(!za(y.parentNode)||m.has(y.parentNode))break;m.add(y.parentNode),g.push(y.parentNode),y=y.parentNode}var _,w,S=[],E={},k=!1,j=!1;if($t(g,(R=>{var B=Sb(R);if(Yr(R,"a")){var M=R.getAttribute("href");k=!!(B&&M&&od(M))&&(p?Ua(M):M)}Je(tm(R),"ph-no-capture")&&(j=!0),S.push((function(W,Q,K,te,I){I===void 0&&(I=!1);var H=W.tagName.toLowerCase(),G={tag_name:H};Fx.indexOf(H)>-1&&!K&&(G.$el_text=H.toLowerCase()==="a"||H.toLowerCase()==="button"?Gy(1024,oj(W)):Gy(1024,Nd(W)));var re=tm(W);re.length>0&&(G.classes=re.filter((function(P){return P!==""}))),$t(W.attributes,(function(P){var q;if((!WA(W)||["name","id","class","aria-label"].indexOf(P.name)!==-1)&&(te==null||!te.includes(P.name))&&!Q&&od(P.value)&&(!Ft(q=P.name)||q.substring(0,10)!=="_ngcontent"&&q.substring(0,7)!=="_nghost")){var z=P.value;P.name==="class"&&(z=Px(z).join(" ")),G["attr__"+P.name]=Gy(1024,P.name==="href"&&I?Ua(z):z)}}));for(var U=1,A=1,$=W;$=K9($);)U++,$.tagName===W.tagName&&A++;return G.nth_child=U,G.nth_of_type=A,G})(R,o,l,d,p));var V=(function(W){if(!Sb(W))return{};var Q={};return $t(W.attributes,(function(K){if(K.name&&K.name.indexOf("data-ph-capture-attribute")===0){var te=K.name.replace("data-ph-capture-attribute-",""),I=K.value;te&&I&&od(I)&&(Q[te]=I)}})),Q})(R);Yt(E,V)})),j)return{props:{},explicitNoCapture:j};if(l||(S[0].$el_text=Yr(t,"a")||Yr(t,"button")?oj(t):Nd(t)),k){var N,O;S[0].attr__href=k;var D=(N=Ad(k))==null?void 0:N.host,F=de==null||(O=de.location)==null?void 0:O.host;D&&F&&D!==F&&(_=k)}return{props:Yt({$event_type:s.type,$ce_version:1},h?{}:{$elements:S},{$elements_chain:(w=S,(function(R){return R.map((B=>{var M,V,W="";if(B.tag_name&&(W+=B.tag_name),B.attr_class)for(var Q of(B.attr_class.sort(),B.attr_class))W+="."+Q.replace(/"/g,"");var K=we({},B.text?{text:B.text}:{},{"nth-child":(M=B.nth_child)!==null&&M!==void 0?M:0,"nth-of-type":(V=B.nth_of_type)!==null&&V!==void 0?V:0},B.href?{href:B.href}:{},B.attr_id?{attr_id:B.attr_id}:{},B.attributes),te={};return vp(K).sort(((I,H)=>I[0].localeCompare(H[0]))).forEach((I=>{var H=I[1];return te[lj(I[0].toString())]=lj(H.toString())})),(W+=":")+vp(te).map((I=>I[0]+'="'+I[1]+'"')).join("")})).join(";")})((function(R){return R.map((B=>{var M,V,W={text:(M=B.$el_text)==null?void 0:M.slice(0,400),tag_name:B.tag_name,href:(V=B.attr__href)==null?void 0:V.slice(0,2048),attr_class:h9(B),attr_id:B.attr__id,nth_child:B.nth_child,nth_of_type:B.nth_of_type,attributes:{}};return vp(B).filter((Q=>Q[0].indexOf("attr__")===0)).forEach((Q=>W.attributes[Q[0]]=Q[1])),W}))})(w)))},(n=S[0])!=null&&n.$el_text?{$el_text:(r=S[0])==null?void 0:r.$el_text}:{},_&&s.type==="click"?{$external_click_url:_}:{},E)}}var $u=an("[ExceptionAutocapture]"),Tj=()=>{},X9=an("[TracingHeaders]"),vo=an("[Web Vitals]"),Nj=9e5,Aj="disabled",Cj="lazy_loading",Uu="awaiting_config",Xf="missing_config";an("[SessionRecording]"),an("[SessionRecording]");
104var Ob="[SessionRecording]",Os=an(Ob),Z9=an("[Heatmaps]");function Vy(t){return nn(t)&&"clientX"in t&&"clientY"in t&&er(t.clientX)&&er(t.clientY)}var Wy=an("[Product Tours]"),Yy=t=>{var e;return!t.config.disable_product_tours&&!((e=t.persistence)==null||!e.get_property(Dx))},Q9=["$set_once","$set"],Ji=an("[SiteApps]"),Rj="Error while initializing PostHog app with config id ";function Ul(t,e,n){if(tt(t))return!1;switch(n){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}class eF{constructor(e){this.Fn=new Hx,this.Ln=(n,r)=>this.$n(n,r)&&this.An(n,r)&&this.Nn(n,r)&&this.Dn(n,r),this.$n=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=e,this.qn=new Set,this.jn=new Set}init(){var e,n;Ee((e=this._instance)==null?void 0:e._addCaptureHook)||(n=this._instance)==null||n._addCaptureHook(((r,s)=>{this.on(r,s)}))}register(e){var n,r;if(!Ee((n=this._instance)==null?void 0:n._addCaptureHook)&&(e.forEach((l=>{var d,h;(d=this.jn)==null||d.add(l),(h=l.steps)==null||h.forEach((p=>{var g;(g=this.qn)==null||g.add((p==null?void 0:p.event)||"")}))})),(r=this._instance)!=null&&r.autocapture)){var s,o=new Set;e.forEach((l=>{var d;(d=l.steps)==null||d.forEach((h=>{h!=null&&h.selector&&o.add(h==null?void 0:h.selector)}))})),(s=this._instance)==null||s.autocapture.setElementSelectors(o)}}on(e,n){var r;n!=null&&e.length!=0&&(this.qn.has(e)||this.qn.has(n.event))&&this.jn&&((r=this.jn)==null?void 0:r.size)>0&&this.jn.forEach((s=>{this.Hn(n,s)&&this.Fn.emit("actionCaptured",s.name)}))}Bn(e){this.onAction("actionCaptured",(n=>e(n)))}Hn(e,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.Ln(e,r))return!0;return!1}onAction(e,n){return this.Fn.on(e,n)}An(e,n){if(n!=null&&n.url){var r,s=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!s||typeof s!="string"||!Ul(s,n.url,n.url_matching||"contains"))return!1}return!0}Nn(e,n){return!!this.Un(e,n)&&!!this.zn(e,n)&&!!this.Vn(e,n)}Un(e,n){var r;if(n==null||!n.href)return!0;var s=this.Wn(e);if(s.length>0)return s.some((d=>Ul(d.href,n.href,n.href_matching||"exact")));var o,l=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!l&&Ul((o=l.match(/(?::|")href="(.*?)"/))?o[1]:"",n.href,n.href_matching||"exact")}zn(e,n){var r;if(n==null||!n.text)return!0;var s=this.Wn(e);if(s.length>0)return s.some((p=>Ul(p.text,n.text,n.text_matching||"exact")||Ul(p.$el_text,n.text,n.text_matching||"exact")));var o,l,d,h=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!h&&(o=(function(p){for(var g,m=[],y=/(?::|")text="(.*?)"/g;!tt(g=y.exec(p));)m.includes(g[1])||m.push(g[1]);return m})(h),l=n.text,d=n.text_matching||"exact",o.some((p=>Ul(p,l,d))))}Vn(e,n){var r,s;if(n==null||!n.selector)return!0;var o=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(o!=null&&o.includes(n.selector))return!0;var l=(e==null||(s=e.properties)==null?void 0:s.$elements_chain)||"";if(n.selector_regex&&l)try{return new RegExp(n.selector_regex).test(l)}catch{return!1}return!1}Wn(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e==null?void 0:e.properties.$elements}Dn(e,n){return n==null||!n.properties||n.properties.length===0||_C(n.properties.reduce(((r,s)=>{var o=it(s.value)?s.value.map(String):s.value!=null?[String(s.value)]:[];return r[s.key]={values:o,operator:s.operator||"exact"},r}),{}),e==null?void 0:e.properties)}}class tF{constructor(e){var n;this.Zn=[],this._instance=e,this.Gn=new Map,this.Qn=new Map,this.Jn=new Map,(n=this._instance)==null||n.onSessionId==null||n.onSessionId((r=>this.Kn(r)))}Yn(e,n){return!!e&&_C(e.propertyFilters,n==null?void 0:n.properties)}Xn(e,n){var r=new Map;return e.forEach((s=>{var o;(o=s.conditions)==null||(o=o[n])==null||(o=o.values)==null||o.forEach((l=>{if(l!=null&&l.name){var d=r.get(l.name)||[];d.push(s.id),r.set(l.name,d)}}))})),r}ts(e,n,r){var s=(r===Du.Activation?this.Gn:this.Qn).get(e),o=[];return this.es((l=>{o=l.filter((d=>s==null?void 0:s.includes(d.id)))}
104)),o.filter((l=>{var d,h=(d=l.conditions)==null||(d=d[r])==null||(d=d.values)==null?void 0:d.find((p=>p.name===e));return this.Yn(h,n)}))}register(e){var n;Ee((n=this._instance)==null?void 0:n._addCaptureHook)||(this.rs(e),this.ns(e))}ns(e){var n=e.filter((r=>{var s,o;return((s=r.conditions)==null?void 0:s.actions)&&((o=r.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0}));n.length!==0&&(this.ss==null&&(this.ss=new eF(this._instance),this.ss.init(),this.ss.Bn((r=>{this.onAction(r)}))),n.forEach((r=>{var s,o,l,d,h;r.conditions&&(s=r.conditions)!=null&&s.actions&&(o=r.conditions)!=null&&(o=o.actions)!=null&&o.values&&((l=r.conditions)==null||(l=l.actions)==null||(l=l.values)==null?void 0:l.length)>0&&((d=this.ss)==null||d.register(r.conditions.actions.values),(h=r.conditions)==null||(h=h.actions)==null||(h=h.values)==null||h.forEach((p=>{if(p&&p.name){var g=this.Jn.get(p.name);g&&g.push(r.id),this.Jn.set(p.name,g||[r.id])}})))})))}rs(e){var n,r=e.filter((o=>{var l,d;return((l=o.conditions)==null?void 0:l.events)&&((d=o.conditions)==null||(d=d.events)==null||(d=d.values)==null?void 0:d.length)>0})),s=e.filter((o=>{var l,d;return((l=o.conditions)==null?void 0:l.cancelEvents)&&((d=o.conditions)==null||(d=d.cancelEvents)==null||(d=d.values)==null?void 0:d.length)>0}));r.length===0&&s.length===0||((n=this._instance)==null||n._addCaptureHook(((o,l)=>{this.onEvent(o,l)})),this.Gn=this.Xn(e,Du.Activation),this.Qn=this.Xn(e,Du.Cancellation))}onEvent(e,n){var r,s,o=this.os(),l=(n==null||(r=n.properties)==null?void 0:r.$survey_id)||(n==null||(s=n.properties)==null?void 0:s.$product_tour_id);if(l&&this.getActivatedIds().includes(l)){var d=this.ls(e,l);if(d==="consume")return o.info("event consumed activated item, removing it",{event:e,itemId:l}),void this.us([l]);if(d==="persist")return o.info("shown item promoted to persisted activation",{event:e,itemId:l}),void this.hs(l)}if(this.Qn.has(e)){var h=this.ts(e,n,Du.Cancellation);h.length>0&&(o.info("cancel event matched, cancelling items",{event:e,itemsToCancel:h.map((g=>g.id))}),this.us(h.map((g=>g.id))),h.forEach((g=>this.ds(g.id))))}if(this.Gn.has(e)){o.info("event name matched",{event:e,eventPayload:n,items:this.Gn.get(e)});var p=this.ts(e,n,Du.Activation);this.cs(p.map((g=>g.id)))}}onAction(e){this.Jn.has(e)&&this.cs(this.Jn.get(e)||[])}cs(e){e.length!==0&&(this.Zn=[...new Set([...this.Zn,...e])],this.os().info("updating activated items",{activatedItems:this.getActivatedIds()}))}hs(e){this.Zn=this.Zn.filter((r=>r!==e));var n=this.vs();n.includes(e)||(this.fs([...n,e]),this.ps())}us(e){var n=new Set(e);this.Zn=this.Zn.filter((o=>!n.has(o)));var r=this.gs(),s=r.filter((o=>!n.has(o)));s.length!==r.length&&(this.fs(s),s.length===0&&this.ys())}gs(){var e,n=this.bs();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n])||[]}vs(){var e,n,r=this.gs();if(r.length===0)return[];var s=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[this._s()],o=(n=this._instance)==null||n.get_session_id==null?void 0:n.get_session_id();return o&&s===o?r:[]}ps(){var e,n=(e=this._instance)==null||e.get_session_id==null?void 0:e.get_session_id();n&&this.ws(n)}ys(){this.xs()}Kn(e){var n,r=(n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[this._s()];r&&r!==e&&(this.gs().length>0&&this.fs([]),this.ys())}getActivatedIds(){return[...new Set([...this.vs(),...this.Zn])].filter((e=>!this.ks(e)))}reset(){this.Zn=[],this.gs().length>0&&this.fs([]),this.ys()}getEventToItemsMap(){return this.Gn}Ss(){return this.ss}}class nF extends tF{constructor(e){super(e)}bs(){return pb}_s(){return gp}Cs(){return Gs.SHOWN}es(e){var n;(n=this._instance)==null||n.getSurveys(e)}ds(e){var n;(n=this._instance)==null||n.cancelPendingSurvey(e)}os(){return Ot}fs(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[pb]:e})}ws(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[gp]:e})}xs(){var e;(e=this._instance)==null||(e=e.persistence)==null||e.unregister(gp)}ks(){return!1}ls(e,n){var r;this.es((o=>{r=o.find((l=>l.id===n))}));var s=!r||(function(o){var l;return wC(o)&&!((l=o.conditions)==null||(l=l.events)==null||!l.repeatedActivation)||o.schedule==="always"})(r);return s?e===Gs.SHOWN?"consume":"ignore":e===Gs.SHOWN?"persist":e===Gs.DISMISSED||e===Gs.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}
104getEventToSurveys(){return this.getEventToItemsMap()}}var Ky="SDK is not enabled or survey functionality is not yet loaded",Oj="Disabled. Not loading surveys.",rF=de!=null&&de.location?nm(de.location.hash,"__posthog")||nm(location.hash,"state"):null,Dj="_postHogToolbarParams",Ij=an("[Toolbar]"),Rn=an("[FeatureFlags]"),yo=an("[FeatureFlags]",{debugEnabled:!0}),Jy=`" failed. Feature flags didn't load in time.`,Mj=t=>{for(var e={},n=0;t.length>n;n++)e[t[n]]=!0;return e},Lj=t=>{var e={};for(var n of vp(t||{})){var r=n[1];r&&(e[n[0]]=r)}return e},Ds=an("[Error tracking]"),Pj="Refusing to render web experiment since the viewer is a likely bot",iF={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>sm(e,t),not_regex:(t,e)=>!sm(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class sr{get Te(){return this._instance.config}constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((s=>{sr.Is("retrieved web experiments from the server"),n.Ts=new Map,s.forEac
104h((o=>{if(o.feature_flag_key){var l;n.Ts&&(sr.Is("setting flag key ",o.feature_flag_key," to web experiment ",o),(l=n.Ts)==null||l.set(o.feature_flag_key,o));var d=n._instance.getFeatureFlag(o.feature_flag_key);Ft(d)&&o.variants[d]&&n.Ms(o.name,d,o.variants[d].transforms)}else if(o.variants)for(var h in o.variants){var p=o.variants[h];sr.Es(p,n._instance)&&n.Ms(o.name,h,p.transforms)}}))}),r)},this._instance=e,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())sr.Is(Pj);else if(!this.Te.disable_web_experiments){if(tt(this.Ts))return this.Ts=new Map,this.loadIfEnabled(),void this.previewWebExperiment();sr.Is("applying feature flags",e),e.forEach((n=>{var r;if(this.Ts&&(r=this.Ts)!=null&&r.has(n)){var s,o=this._instance.getFeatureFlag(n),l=(s=this.Ts)==null?void 0:s.get(n);o&&l!=null&&l.variants[o]&&this.Ms(l.name,o,l.variants[o].transforms)}}))}}previewWebExperiment(){var e=sr.getWindowLocation();if(e!=null&&e.search){var n=bc(e==null?void 0:e.search,"__experiment_id"),r=bc(e==null?void 0:e.search,"__experiment_variant");n&&r&&(sr.Is("previewing web experiments "+n+" && "+r),this.getWebExperiments((s=>{this.Rs(parseInt(n),r,s)}),!1,!0))}}loadIfEnabled(){this.Te.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this.Te.disable_web_experiments&&!r)return e([]);var s=this._instance.get_property("$web_experiments");if(s&&!n)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Te.token),method:"GET",timestampMode:"query",callback:o=>e(o.statusCode===200&&o.json&&o.json.experiments||[])})}Rs(e,n,r){var s=r.filter((o=>o.id===e));s&&s.length>0&&(sr.Is("Previewing web experiment ["+s[0].name+"] with variant ["+n+"]"),this.Ms(s[0].name,n,s[0].variants[n].transforms))}static Es(e,n){return!tt(e.conditions)&&sr.Ps(e,n)&&sr.Os(e)}static Ps(e,n){var r;if(tt(e.conditions)||tt((r=e.conditions)==null?void 0:r.url))return!0;var s=sr.getWindowLocation();if(s){var o,l,d,h=FA(n,s.href);return(o=e.conditions)==null||!o.url||iF[(l=(d=e.conditions)==null?void 0:d.urlMatchType)!==null&&l!==void 0?l:"icontains"](e.conditions.url,h)}return!1}
104static getWindowLocation(){return de==null?void 0:de.location}static Os(e){var n;if(tt(e.conditions)||tt((n=e.conditions)==null?void 0:n.utm))return!0;var r=tC();if(r.utm_source){var s,o,l,d,h,p,g,m,y=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_campaign||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_campaign)==r.utm_campaign,b=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_source||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_source)==r.utm_source,_=(h=e.conditions)==null||(h=h.utm)==null||!h.utm_medium||((p=e.conditions)==null||(p=p.utm)==null?void 0:p.utm_medium)==r.utm_medium,w=(g=e.conditions)==null||(g=g.utm)==null||!g.utm_term||((m=e.conditions)==null||(m=m.utm)==null?void 0:m.utm_term)==r.utm_term;return y&&_&&w&&b}return!1}static Is(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;n>s;s++)r[s-1]=arguments[s];ke.info("[WebExperiments] "+e,r)}Ms(e,n,r){this._is_bot()?sr.Is(Pj):n!=="control"?r.forEach((s=>{if(s.selector){var o;sr.Is("applying transform of variant "+n+" for experiment "+e+" ",s);var l=(o=document)==null?void 0:o.querySelectorAll(s.selector);l==null||l.forEach((d=>{var h=d;s.html&&(h.innerHTML=s.html),s.css&&h.setAttribute("style",s.css)}))}})):sr.Is("Control variants leave the page unmodified.")}_is_bot(){return br&&this._instance?yC(br,this.Te.custom_blocked_useragents):void 0}}var ui=an("[Conversations]"),bo="Conversations not available yet.",Fj="console",Mm={featureFlags:class{constructor(t){this.Fs=!1,this.Ls=!1,this.$s=!1,this.As=!1,this.Ns=!1,this.Ds=!1,this.qs=!1,this.js=!1,this.Hs=0,this.Bs=()=>{var e=this.Us();this.Hs=0,e&&this.reloadFeatureFlags()},this._instance=t,this.featureFlagEventHandlers=[],de&&un(de,"online",this.Bs)}destroy(){de==null||de.removeEventListener("online",this.Bs)}get Te(){return this._instance.config}get mi(){return this._instance.persistence}zs(t){return this._instance.get_property(t)}Vs(){var t,e;return(t=(e=this.mi)==null?void 0:e._r(this.Te.feature_flag_cache_ttl_ms))!==null&&t!==void 0&&t}Ws(){return!!this.Vs()&&(this.js||this.$s||(this.js=!0,Rn.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Zs(){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.qs||(Rn.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.qs=!0),e!=null&&e.length?e.filter((n=>{var r=n&&typeof n=="string"&&n.trim().length>0;return r||Rn.error("Invalid evaluation context found:",n,"Expected non-empty string"),r})):[]}Gs(){return this.Zs().length>0}Qs(){var t=this.Te.flag_keys;if(!Ee(t)){if(it(t))return t.filter((e=>{var n=e&&typeof e=="string"&&e.trim().length>0;return n||Rn.error("Invalid flag key found:",e,"Expected non-empty string"),n}));Rn.error("Invalid flag_keys found:",t,"Expected array of non-empty strings")}}initialize(){var t,e,n=this._instance.config,r=(t=(e=n.bootstrap)==null?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(r).length){var s,o,l=(s=(o=n.bootstrap)==null?void 0:o.featureFlagPayloads)!==null&&s!==void 0?s:{},d=Object.keys(r).filter((p=>!!r[p])).reduce(((p,g)=>(p[g]=r[g]||!1,p)),{}),h=Object.keys(l).filter((p=>d[p])).reduce(((p,g)=>(l[g]&&(p[g]=l[g]),p)),{});this.receivedFeatureFlags({featureFlags:d,featureFlagPayloads:h})}}updateFlags(t,e,n){var r,s,o=n!=null&&n.merge&&(r=this.zs(jo))!==null&&r!==void 0?r:{},l=n!=null&&n.merge&&(s=this.zs(mp))!==null&&s!==void 0?s:{},d=we({},o,t),h=we({},l,e),p={};for(var g of Object.entries(d)){var m=g[0],y=g[1];p[m]={key:m,enabled:Fk(y),variant:$k(y),reason:void 0,metadata:Ee(h==null?void 0:h[m])?void 0:{id:0,version:void 0,description:void 0,payload:h[m]}}}this.receivedFeatureFlags({flags:p})}get hasLoadedFlags(){return this.Ls}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.zs(db),e=this.zs(Ps),n=this.zs(Xl);if(!n&&!e)return t||{};var r=Yt({},t||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(var o of s){var l,d,h=r[o],p=e==null?void 0:e[o],g=Ee(p)?(l=h==null?void 0:h.enabled)!==null&&l!==void 0&&l:!!p,m=Ee(p)?h.variant:typeof p=="string"?p:void 0,y=n==null?void 0:n[o],b=we({},h,{enabled:g,variant:g?m??(h==null?void 0:h.variant):void 0});g!==(h==null?void 0:h.enabled)&&(b.original_enabled=h==null?void 0:h.enabled),m!==(h==null?void 0:h.variant)&&(b.original_variant=h==null?void 0:h.variant),y&&(b.metadata=we({},h==null?void 0:h.metadata,{payload:y,original_payload:h==null||(d=h.metadata)==null?void 0:d.payload})),r[o]=b}return this.Fs||(Rn.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:r}),this.Fs=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((n=>{var r=t[n];return{key:n,enabled:Fk(r),variant:$k(r),payload:Pk(e[n])}}))}getFlagVariants(){var t=this.zs(jo),e=this.zs(Ps);if(!e)return t||{};for(var n=Yt({},t),r=Object.keys(e),s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.Fs||(Rn.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.Fs=!0),n}getFlagPayloads(){var t=this.zs(mp),e=this.zs(Xl);if(!e)return t||{};for(var n=Yt({},t||{}),r=Object.keys(e),s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.Fs||(Rn.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.Fs=!0),n}reloadFeatureFlags(){this.As||this.Te.advanced_disable_feature_flags||this.Us()||this.Js||(this._instance.tn.emit("featureFlagsReloading",!0),this.Js=setTimeout((()=>{this.Ks()}),5))}Ys(){clearTimeout(this.Js),this.Js=void 0}ensureFlagsLoaded(){this.Ls||this.$s||this.Js||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.As=t}Ks(t){var e;if(this.Ys(),!this._instance.Ur()&&!this.Us())if(this.$s)this.Ns=!0;else{var n=this.Te.token,r=this.zs(Wp),s={token:n,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:we({},((e=this.mi)==null?void 0:e.get_initial_props())||{},this.zs(So)||{}),group_properties:this.zs(Eo),timezone:oC()};xr(r)||Ee(r)||(s.$device_id=r),(t!=null&&t.disableFlags||this.Te.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.Gs()&&(s.evaluation_contexts=this.Zs());var o=this.Qs();Ee(o)||(s.flag_keys=o);var l=!!this.Te.advanced_only_evaluate_survey_feature_flags,d=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Te.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.$s=!0,this._instance._send_request({method:"POST",url:d,data:s,compression:this.Te.disable_compression?void 0:yr.Base64,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback:h=>{var p,g,m,y=!0;if(this.Xs(h.statusCode),h.statusCode===200&&(this.Ns||(this.$anon_distinct_id=void 0),y=!1),this.$s=!1,!s.disable_flags||this.Ns){this.Ds=!y;var b=[];
104h.error?h.error instanceof Error?b.push(h.error.name==="AbortError"?"timeout":"connection_error"):b.push("unknown_error"):h.statusCode!==200&&b.push("api_error_"+h.statusCode),(p=h.json)!=null&&p.errorsWhileComputingFlags&&b.push("errors_while_computing_flags");var _,w=!((g=h.json)==null||(g=g.quotaLimited)==null||!g.includes("feature_flags"));w&&b.push("quota_limited"),(m=this.mi)==null||m.register({[gb]:b}),w?Rn.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((_=h.json)!==null&&_!==void 0?_:{},y,{partialResponse:l}),this.Ns&&(this.Ns=!1,this.Ks()))}}})}}Us(){return QA(this.Hs,3)}Xs(t){this.Hs=eC(t,this.Hs,3,(()=>Rn.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.")))}getFeatureFlag(t,e){var n;if(e===void 0&&(e={}),!e.fresh||this.Ds)if(this.Ls||this.getFlags()&&this.getFlags().length>0){if(!this.Ws()){var r=this.getFeatureFlagResult(t,e);return(n=r==null?void 0:r.variant)!==null&&n!==void 0?n:r==null?void 0:r.enabled}}else Rn.warn('getFeatureFlag for key "'+t+Jy)}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.Ds)if(this.Ls||this.getFlags()&&this.getFlags().length>0){if(!this.Ws()){var n=this.getFlagVariants(),r=t in n,s=n[t],o=this.getFlagPayloads()[t],l=String(s),d=this.zs(hb)||void 0,h=this.zs(Td)||void 0,p=this.zs(ad)||{};if(this.Te.advanced_feature_flags_dedup_per_session){var g,m=this._instance.get_session_id(),y=this.zs(mb);m&&m!==y&&(p={},(g=this.mi)==null||g.register({[ad]:p,[mb]:m}))}if((e.send_event||!("send_event"in e))&&(!(t in p)||!p[t].includes(l))){var b,_,w,S,E,k,j,N,O,D,F;it(p[t])?p[t].push(l):p[t]=[l],(b=this.mi)==null||b.register({[ad]:p});var R=this.getFeatureFlagDetails(t),B=[...(_=this.zs(gb))!==null&&_!==void 0?_:[]];Ee(s)&&B.push("flag_missing");var M={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:o||null,$feature_flag_request_id:d,$feature_flag_evaluated_at:h,$feature_flag_bootstrapped_response:((w=this.Te.bootstrap)==null||(w=w.featureFlags)==null?void 0:w[t])||null,$feature_flag_bootstrapped_payload:((S=this.Te.bootstrap)==null||(S=S.featureFlagPayloads)==null?void 0:S[t])||null,$used_bootstrap_value:!this.Ds};Ee(R==null||(E=R.metadata)==null?void 0:E.has_experiment)||(M.$feature_flag_has_experiment=R.metadata.has_experiment),Ee(R==null||(k=R.metadata)==null?void 0:k.version)||(M.$feature_flag_version=R.metadata.version);var V,W=(j=R==null||(N=R.reason)==null?void 0:N.description)!==null&&j!==void 0?j:R==null||(O=R.reason)==null?void 0:O.code;W&&(M.$feature_flag_reason=W),R!=null&&(D=R.metadata)!=null&&D.id&&(M.$feature_flag_id=R.metadata.id),Ee(R==null?void 0:R.original_variant)&&Ee(R==null?void 0:R.original_enabled)||(M.$feature_flag_original_response=Ee(R.original_variant)?R.original_enabled:R.original_variant),R!=null&&(F=R.metadata)!=null&&F.original_payload&&(M.$feature_flag_original_payload=R==null||(V=R.metadata)==null?void 0:V.original_payload),B.length&&(M.$feature_flag_error=B.join(",")),this._instance.capture("$feature_flag_called",M)}if(r)return{key:t,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:Pk(o)}}}else Rn.warn('getFeatureFlagResult for key "'+t+Jy)}getRemoteConfigPayload(t,e){var n=this.Te.token,r={distinct_id:this._instance.get_distinct_id(),token:n};this.Gs()&&(r.evaluation_contexts=this.Zs());var s=this.Qs();Ee(s)||(r.flag_keys=s),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this.Te.disable_compression?void 0:yr.Base64,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback(o){var l,d=(l=o.json)==null?void 0:l.featureFlagPayloads;e((d==null?void 0:d[t])||void 0)}})}isFeatureEnabled(t,e){if(e===void 0&&(e={}),e.fresh&&!this.Ds)return e.defaultValue;if(!(this.Ls||this.getFlags()&&this.getFlags().length>0))return Rn.warn('isFeatureEnabled for key "'+t+Jy),e.defaultValue;var n=this.getFeatureFlag(t,e);return Ee(n)?e.defaultValue:!!n}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,n){if(this.mi){this.Ls=!0;var r=this.getFlagVariants(),s=this.getFlagPayloads(),o=this.getFlagsWithDetails();(function(l,d,h,p,g,m){h===void 0&&(h={}),p===void 0&&(p={}),g===void 0&&(g={});var y=(R=>{var B=R.flags;return B?(R.featureFlags=Object.fromEntries(Object.keys(B).map((M=>{var V;return[M,(V=B[M].variant)!==null&&V!==void 0?V:B[M].enabled]}))),R.featureFlagPayloads=Object.fromEntries(Object.keys(B).filter((M=>B[M].enabled)).filter((M=>{var V;return(V=B[M].metadata)==null?void 0:V.payload})).map((M=>{var V;return[M,(V=B[M].metadata)==null?void 0:V.payload]})))):R.featureFlags&&Rn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),R})(l),b=y.flags,_=y.featureFlags,w=y.featureFlagPayloads;if(_){var S=l.requestId,E=l.evaluatedAt;if(it(_)){Rn.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var k={};if(_)for(var j=0;_.length>j;j++)k[_[j]]=!0;d&&d.register({[pp]:_,[jo]:k,[Yp]:!1})}else{var N=_,O=w,D=b;if(m!=null&&m.partialResponse)N=we({},h,N),O=we({},p,O),D=we({},g,D);else if(l.errorsWhileComputingFlags)if(b){var F=new Set(Object.keys(b).filter((R=>{var B;return!((B=b[R])!=null&&B.failed)})));N=we({},h,Object.fromEntries(Object.entries(N).filter((R=>F.has(R[0]))))),O=we({},p,Object.fromEntries(Object.entries(O||{}).filter((R=>F.has(R[0]))))),D=we({},g,Object.fromEntries(Object.entries(D||{}).filter((R=>F.has(R[0])))))}else N=we({},h,N),O=we({},p,O),D=we({},g,D);d&&d.register(we({[pp]:Object.keys(Lj(N)),[jo]:N||{},[mp]:O||{},[db]:D||{},[Yp]:l.minimalFlagCalledEvents===!0},S?{[hb]:S}:{},E?{[Td]:E}:{}))}}})(t,this.mi,r,s,o,n),e||(this.js=!1),this.eo(e)}}override(t,e){e===void 0&&(e=!1),Rn.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.mi)return Rn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this.mi.unregister(Ps),this.mi.unregister(Xl),this.eo(),yo.info("All overrides cleared");if(it(t)){var e=Mj(t);return this.mi.register({[Ps]:e}),this.eo(),yo.info("Flag overrides set",{flags:t})}if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var n,r=t;if(this.Fs=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this.mi.unregister(Ps),yo.info("Flag overrides cleared");else if(r.flags){if(it(r.flags)){var s=Mj(r.flags);this.mi.register({[Ps]:s})}else this.mi.register({[Ps]:r.flags});yo.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this.mi.unregister(Xl),yo.info("Payload overrides cleared")):r.payloads&&(this.mi.register({[Xl]:r.payloads}),yo.info("Payload overrides set",{payloads:r.payloads}))),void this.eo()}if(t&&typeof t=="object")return this.mi.register({[Ps]:t}),this.eo(),yo.info("Flag overrides set",{flags:t});Rn.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Ls){var e=this.ro(),n=e.flags,r=e.flagVariants;try{t(n,r)}catch(s){Rn.error("Error while running feature flags callback",s)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var r,s=(this.zs(Xu)||[]).find((h=>h.flagKey===t)),o={["$feature_enrollment/"+t]:e},l={$feature_flag:t,$feature_enrollment:e,$set:o};s&&(l.$early_access_feature_name=s.name),n&&(l.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",l),this.setPersonPropertiesForFlags(o,!1);var d=we({},this.getFlagVariants(),{[t]:e});(r=this.mi)==null||r.register({[pp]:Object.keys(Lj(d)),[jo]:d}),this.eo()}getEarlyAccessFeatures(t,e,n){e===void 0&&(e=!1);var r=this.zs(Xu),s=n?"&"+n.map((o=>"stage="+o)).join("&"):"";if(r&&!e)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Te.token+s),method:"GET",timestampMode:"query",callback:o=>{var l,d;if(o.json){var h=o.json.earlyAccessFeatures;return(l=this.mi)==null||l.unregister(Xu),(d=this.mi)==null||d.register({[Xu]:h}),t(h)}}})}ro(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((n=>e[n])),flagVariants:Object.keys(e).filter((n=>e[n])).reduce(((n,r)=>(n[r]=e[r],n)),{})}}eo(t){var e=this.ro(),n=e.flags,r=e.flagVariants;
104this.featureFlagEventHandlers.forEach((s=>{try{s(n,r,{errorsLoading:t})}catch(o){Rn.error("Error while running feature flags callback",o)}}))}setPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.zs(So)||{},r=(t==null?void 0:t.$set)||(t!=null&&t.$set_once?{}:t),s=t==null?void 0:t.$set_once,o={};if(s)for(var l in s)({}).hasOwnProperty.call(s,l)&&(l in n||(o[l]=s[l]));this._instance.register({[So]:we({},n,o,r)}),e&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=we({},this.zs(So)||{});t.forEach((r=>{delete n[r]})),this._instance.register({[So]:n}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){t===void 0&&(t=!0),this._instance.unregister(So),t&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.zs(Eo)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((r=>{n[r]=we({},n[r],t[r]),delete t[r]})),this._instance.register({[Eo]:we({},n,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.zs(Eo)||{};this._instance.register({[Eo]:we({},e,{[t]:{}})})}else this._instance.unregister(Eo)}reset(){this.Ls=!1,this.$s=!1,this.As=!1,this.Ns=!1,this.Ds=!1,this.$anon_distinct_id=void 0,this.Ys(),this.Fs=!1,this.Hs=0}}},sF={sessionRecording:class{get Te(){return this._instance.config}get mi(){return this._instance.persistence}get started(){var t;return!((t=this.io)==null||!t.isStarted)}get status(){var t,e;return this.no===Uu||this.no===Xf?this.no:(t=(e=this.io)==null?void 0:e.status)!==null&&t!==void 0?t:this.no}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.no=Aj,this.so=void 0,this._instance=t,!this._instance.sessionManager)throw Os.error("started without valid sessionManager"),new Error(Ob+" started without valid sessionManager. This is a bug.");if(this.Te.cookieless_mode===Hs)throw new Error(Ob+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get oo(){var t,e=!((t=this._instance.get_property(Co))==null||!t.enabled),n=!this.Te.disable_session_recording,r=this.Te.disable_session_recording||this._instance.consent.isOptedOut();return de&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(!this.oo||(e=this.io)==null||!e.isStarted){var n=!Ee(Object.assign)&&!Ee(Array.from);this.oo&&n?(this.ao(t),Os.info("starting")):(this.no=Aj,this.stopRecording())}}ao(t){var e,n,r;this.oo&&(this.no!==Uu&&this.no!==Xf&&(this.no=Cj),Be!=null&&(e=Be.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(n=Be.__PosthogExtensions__)!=null&&n.initSessionRecording?this.lo(t):(r=Be.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.uo,(s=>{if(s)return Os.error("could not load recorder",s);this.lo(t)})))}stopRecording(){var t,e;(t=this.so)==null||t.call(this),this.so=void 0,(e=this.io)==null||e.stop()}ho(){var t,e;(t=this.so)==null||t.call(this),this.so=void 0,(e=this.io)==null||e.discard()}do(){var t,e;(t=this.mi)==null||t.unregister(Ix),(e=this.mi)==null||e.unregister(jA)}co(t,e){if(tt(t))return null;var n,r=er(t)?t:parseFloat(t);return typeof(n=r)!="number"||!Number.isFinite(n)||0>n||n>1?(Os.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}vo(t){if(this.mi){var e,n,r=this.mi,s=()=>{var o,l=t.sessionRecording===!1?void 0:t.sessionRecording,d=this.co((o=this.Te.session_recording)==null?void 0:o.sampleRate,"session_recording.sampleRate"),h=this.co(l==null?void 0:l.sampleRate,"remote config sampleRate"),p=d??h;tt(p)&&this.do();var g=l==null?void 0:l.minimumDurationMilliseconds;r.register({[Co]:we({cache_timestamp:Date.now(),enabled:!!l},l,{networkPayloadCapture:we({capturePerformance:t.capturePerformance},l==null?void 0:l.networkPayloadCapture),canvasRecording:{enabled:l==null?void 0:l.recordCanvas,fps:l==null?void 0:l.canvasFps,quality:l==null?void 0:l.canvasQuality},sampleRate:p,minimumDurationMilliseconds:Ee(g)?null:g,endpoint:l==null?void 0:l.endpoint,triggerMatchType:l==null?void 0:l.triggerMatchType,masking:l==null?void 0:l.masking,urlTriggers:l==null?void 0:l.urlTriggers,version:l==null?void 0:l.version,triggerGroups:l==null?void 0:l.triggerGroups})})};s(),(e=this.so)==null||e.call(this),this.so=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(s)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?e.sessionRecording===!1?(this.vo(e),void this.ho()):(this.vo(e),void this.startIfEnabledOrStop()):(this.no===Uu&&(this.no=Xf,Os.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var n;e===void 0&&(e="log"),(n=this.io)!=null&&n.log?this.io.log(t,e):Os.warn("log called before recorder was ready")}get uo(){var t,e,n=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.get_property(Co);return(n==null||(e=n.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}fo(){var t,e,n=this._instance.get_property(Co);if(!n)return!1;try{e=typeof n=="object"?n:JSON.parse(n)}catch(s){return Os.warn("persisted remote config for session recording is invali
104d and will be ignored",s),!1}var r=(t=e.cache_timestamp)!==null&&t!==void 0?t:Date.now();return 36e5>=Date.now()-r}lo(t){var e,n;if((e=Be.__PosthogExtensions__)==null||!e.initSessionRecording)return Os.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[IA]:!0});if(this.io||(this.io=(n=Be.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.io._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.fo())return this.no===Xf||this.no===Uu?void 0:(this.no=Uu,Os.info("persisted remote config is stale, requesting fresh config before starting"),void new lC(this._instance).load());this.no=Cj,this.io.start(t)}onRRwebEmit(t){var e;(e=this.io)==null||e.onRRwebEmit==null||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.io||(e=this.mi)==null||e.register({[NA]:!0}),(t=this.io)==null||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.io||(e=this.mi)==null||e.register({[TA]:!0}),(t=this.io)==null||t.overrideSampling()}overrideTrigger(t){var e,n;this.io||(n=this.mi)==null||n.register({[t==="url"?AA:CA]:!0}),(e=this.io)==null||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.io)==null?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var n;return!((n=this.io)==null||!n.tryAddCustomEvent(t,e))}}},aF={autocapture:class{constructor(t){this.po=!1,this.mo=null,this.yo=!1,this.bo=!1,this.instance=t,this.rageclicks=new jj(t.config.rageclick),this._o=null}initialize(){this.startIfEnabled()}get Te(){var t,e,n=nn(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(t=n.url_allowlist)==null?void 0:t.map((r=>new RegExp(r))),n.url_ignorelist=(e=n.url_ignorelist)==null?void 0:e.map((r=>new RegExp(r))),n}wo(){if(this.isBrowserSupported()){if(de&&Ae){var t=n=>{n=n||(de==null?void 0:de.event);try{this.xo(n)}catch(r){qy.error("Failed to capture event",r)}};if(un(Ae,"submit",t,{capture:!0}),un(Ae,"change",t,{capture:!0}),un(Ae,"click",t,{capture:!0}),this.Te.capture_copied_text){var e=n=>{n=n||(de==null?void 0:de.event);try{this.xo(n,Hy)}catch(r){qy.error("Failed to capture copy/cut event",r)}};un(Ae,"copy",e,{capture:!0}),un(Ae,"cut",e,{capture:!0})}}}else qy.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.po&&(this.wo(),this.po=!0)}onRemoteConfig(t){if(this.yo=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.bo=e.elementsChainAsString);var n=e.autocapture_opt_out;Fi(n)&&(this.instance.persistence&&this.instance.persistence.register({[ib]:n}),this.mo=n),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this._o=t}getElementSelectors(t){var e,n=[];return(e=this._o)==null||e.forEach((r=>{var s=Ae==null?void 0:Ae.querySelectorAll(r);s==null||s.forEach((o=>{t===o&&n.push(r)}))})),n}get isEnabled(){var t,e,n=(t=this.instance.persistence)==null?void 0:t.props[ib],r=this.mo,s=this.instance.Ur()&&!this.yo;if(xr(r)&&!Fi(n)&&!s)return!1;var o=(e=this.mo)!==null&&e!==void 0?e:!!n;return!!this.instance.config.autocapture&&!o}xo(t,e){if(e===void 0&&(e="$autocapture"),this.isEnabled){var n,r=Oy(t);UA(r)&&(r=r.parentNode||null),e==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime())&&aj(r,this.instance.config.rageclick)&&this.xo(t,"$rageclick");var s=e===Hy;if(r&&(function(m,y,b,_,w,S){var E;if(!de||$x(m)||b!=null&&b.url_allowlist&&!rj(b.url_allowlist,S)||b!=null&&b.url_ignorelist&&rj(b.url_ignorelist,S))return!1;if(b!=null&&b.dom_event_allowlist){var k=b.dom_event_allowlist;if(k&&!k.some((R=>y.type===R)))return!1}var j=VA(m,_),N=j.parentIsUsefulElement,O=j.targetElementList;if(!(function(R,B){var M=B==null?void 0:B.element_allowlist;if(Ee(M))return!0;var V,W=function(K){if(M.some((te=>K.tagName.toLowerCase()===te)))return{v:!0}};for(var Q of R)if(V=W(Q))return V.v;return!1})(O,b)||!wb(O,b==null?void 0:b.css_selector_allowlist)||wb(O,(E=b==null?void 0:b.css_selector_ignorelist)!==null&&E!==void 0?E:s9))return!1;try{var D=de.getComputedStyle(m);if(D&&D.getPropertyValue("cursor")==="pointer"&&y.type==="click")return!0}catch{}var F=m.tagName.toLowerCase();switch(F){case"html":return!1;case"form":return(w||["submit"]).indexOf(y.type)>=0;case"input":case"select":case"textarea":return(w||["change","click"]).indexOf(y.type)>=0;default:return N?(w||["click"]).indexOf(y.type)>=0:(w||["click"]).indexOf(y.type)>=0&&(Fx.indexOf(F)>-1||m.getAttribute("contenteditable")==="true")}})(r,t,this.Te,s,s?["copy","cut"]:void 0,this.instance)){var o=J9(r,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Te.element_attribute_ignorelist,elementsC
104hainAsString:this.bo,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),l=o.props;if(o.explicitNoCapture)return!1;var d=this.getElementSelectors(r);if(d&&d.length>0&&(l.$element_selectors=d),e===Hy){var h,p=HA(de==null||(h=de.getSelection())==null?void 0:h.toString()),g=t.type||"clipboard";if(!p)return!1;l.$selected_content=p,l.$copy_type=g}return this.instance.capture(e,l),!0}}}isBrowserSupported(){return Li(Ae==null?void 0:Ae.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.ko=(de==null||(e=de.location)==null?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(ke.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.So&&this.So(),this.So=void 0,ke.info("History API monitoring stopped")}monitorHistoryChanges(){de&&de.history&&(this.Co("pushState"),this.Co("replaceState"),this.Io())}Co(t){var e;if(de&&((e=de.history[t])==null||!e.__posthog_wrapped__)){var n=this;(function(r,s,o){try{if(!(s in r))return Tj;var l={next:r[s]},d=o((function(){for(var h=arguments.length,p=new Array(h),g=0;h>g;g++)p[g]=arguments[g];return l.next.apply(this,p)}));return Li(d)&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:l}})),r[s]=d,()=>{if(r[s]!==d)for(var h=r[s];Li(h)&&h.__posthog_layer__;){var p=h.__posthog_layer__;if(p.next===d)return void(p.next=l.next);h=p.next}else r[s]=l.next}}catch{return Tj}})(de.history,t,(r=>function(s,o,l){r.call(this,s,o,l),n.To(t)}))}}To(t){try{var e,n=de==null||(e=de.location)==null?void 0:e.pathname;if(!n)return;n!==this.ko&&this.isEnabled&&this._instance.capture(Zl,{navigation_type:t}),this.ko=n}catch(r){ke.error("Error capturing "+t+" pageview",r)}}Io(){if(!this.So){var t=()=>{this.To("popstate")};un(de,"popstate",t),this.So=()=>{de&&de.removeEventListener("popstate",t)}}}},heatmaps:class{get Te(){return this.instance.config}constructor(t){var e;this.Mo=!1,this.po=!1,this.Eo=null,this.instance=t,this.Mo=!((e=this.instance.persistence)==null||!e.props[sb]),this.rageclicks=new jj(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return nn(this.Te.capture_heatmaps)&&this.Te.capture_heatmaps.flush_interval_milliseconds&&(t=this.Te.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return tt(this.Te.capture_heatmaps)?tt(this.Te.enable_heatmaps)?this.Mo:this.Te.enable_heatmaps:this.Te.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.po)return;Z9.info("starting..."),this.Ro(),this.ke()}else{var t;clearInterval((t=this.Eo)!==null&&t!==void 0?t:void 0),this.Po(),this.getAndClearBuffer()}}onRemoteConfig(t){if(t.ok){var e=t.config;if("heatmaps"in e){var n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[sb]:n}),this.Mo=n,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.R;return this.R=void 0,t}Oo(t){Vy(t.originalEvent)&&this.pe(t.originalEvent,"deadclick")}ke(){this.Eo&&clearInterval(this.Eo),this.Eo=(Ae==null?void 0:Ae.visibilityState)==="visible"?setInterval(this.oi.bind(this),this.flushIntervalMilliseconds):null}Ro(){de&&Ae&&(this.Fo=this.oi.bind(this),un(de,Qp,this.Fo),this.Lo=t=>this.pe(t||(de==null?void 0:de.event)),un(Ae,"click",this.Lo,{capture:!0}),this.$o=t=>this.Ao(t||(de==null?void 0:de.event)),un(Ae,"mousemove",this.$o,{capture:!0}),this.No=new cj(this.instance,f9,this.Oo.bind(this)),this.No.startIfEnabledOrStop(),this.Do=this.ke.bind(this),un(Ae,Zp,this.Do),this.po=!0)}Po(){var t;de&&Ae&&(this.Fo&&de.removeEventListener(Qp,this.Fo),this.Lo&&Ae.removeEventListener("click",this.Lo,{capture:!0}),this.$o&&Ae.removeEventListener("mousemove",this.$o,{capture:!0}),this.Do&&Ae.removeEventListener(Zp,this.Do),clearTimeout(this.qo),(t=this.No)==null||t.stop(),this.po=!1)}jo(t,e){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),o=(function(l,d,h){for(var p=l;p&&za(p)&&!Yr(p,"body");){if(p===h)return!1;var g=void 0;try{var m,y,b;g=(m=(y=(b=p.ownerDocument)==null?void 0:b.defaultView)!==null&&y!==void 0?y:de)==null?void 0:m.getComputedStyle(p).position}catch{return!1}if(Je(d,g))return!0;p=qA(p)}return!1})(Oy(t),["fixed","sticky"],s);return{x:t.clientX+(o?0:r),y:t.clientY+(o?0:n),target_fixed:o,type:e}}pe(t,e){var n;if(e===void 0&&(e="click"),!nj(t.target)&&Vy(t)){var r=this.jo(t,e);(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&aj(Oy(t),this.instance.config.rageclick)&&this.Wt(we({},r,{type:"rageclick"})),this.Wt(r)}}Ao(t){!nj(t.target)&&Vy(t)&&(clearTimeout(this.qo),this.qo=setTimeout((()=>{this.Wt(this.jo(t,"mousemove"))}),500))}Wt(t){if(de){var e=this.Te.disable_capture_url_hashes?Ua(de.location.href):de.location.href,n=this.Te.custom_personal_data_properties,r=this.Te.mask_personal_data_properties?[...xc,...n||[]]:[],s=Cd(e,r,Rd);this.R=this.R||{},this.R[s]||(this.R[s]=[]),this.R[s].push(t)}}oi(){this.R&&!Pa(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:cj,webVitalsAutocapture:class{constructor(t){var e;this.Mo=!1,this.po=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Ho=()=>{clearTimeout(this.Bo),this.R.metrics.length!==0&&(this._instance.capture("$web_vitals",this.R.metrics.reduce(((n,r)=>we({},n,{["$web_vitals_"+r.name+"_event"]:we({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Uo=n=>{var r;this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.zo();if(!Ee(s))if(tt(n==null?void 0:n.name)||tt(n==null?void 0:n.value))vo.error("Invalid metric received",n);else if(!this.Vo||this.Vo>n.value){this.R.url!==s&&(this.Ho(),this.Bo=setTimeout(this.Ho,this.flushToCaptureTimeoutMs)),Ee(this.R.url)&&(this.R.url=s),this.R.firstMetricTimestamp=Ee(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0);var o=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0),l=we({},n,{$current_url:s,timestamp:Date.now()});Ee(o)||(l.$session_id=o.sessionId,l.$window_id=o.windowId),this.R.metrics.push(l),this.R.metrics.length===this.allowedMetrics.length&&this.Ho()}else vo.error("Ignoring metric with value >= "+this.Vo,n)},this.Wo=()=>
104{if(!this.po){var n,r,s,o,l=Be.__PosthogExtensions__;if(!Ee(l)&&!Ee(l.postHogWebVitalsCallbacks)){var d=l.postHogWebVitalsCallbacks;n=d.onLCP,r=d.onCLS,s=d.onFCP,o=d.onINP}n&&r&&s&&o?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.Uo.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Uo.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this.Uo.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&o(this.Uo.bind(this)),this.po=!0):vo.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Mo=!((e=this._instance.persistence)==null||!e.props[cb]),this.startIfEnabled()}get Zo(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,n=nn(this.Zo)?(t=this.Zo)==null?void 0:t.web_vitals_allowed_metrics:void 0;return tt(n)?((e=this._instance.persistence)==null?void 0:e.props[ub])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(nn(this.Zo)?this.Zo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=nn(this.Zo)?this.Zo.web_vitals_attribution:void 0;return t!=null&&t}get Vo(){var t=nn(this.Zo)&&er(this.Zo.__web_vitals_max_value)?this.Zo.__web_vitals_max_value:Nj;return t>0&&6e4>=t?Nj:t}get isEnabled(){var t=En==null?void 0:En.protocol;if(t!=="http:"&&t!=="https:")return vo.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=nn(this.Zo)?this.Zo.web_vitals:Fi(this.Zo)?this.Zo:void 0;return Fi(e)?e:this.Mo}startIfEnabled(){this.isEnabled&&!this.po&&(vo.info("enabled, starting..."),this.tr(this.Wo))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var n=nn(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=nn(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[cb]:n}),this._instance.persistence.register({[ub]:r})),this.Mo=n,this.startIfEnabled()}}}tr(t){var e,n;(e=Be.__PosthogExtensions__)!=null&&e.postHogWebVitalsCallbacks?t():(n=Be.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(r=>{r?vo.error("failed to load script",r):t()}))}zo(){var t=de?this._instance.config.disable_capture_url_hashes?Ua(de.location.href):de.location.href:void 0;if(t){var e=this._instance.config.custom_personal_data_properties,n=this._instance.config.mask_personal_data_properties?[...xc,...e||[]]:[];return Cd(t,n,Rd)}vo.error("Could not determine current URL")}}},oF={exceptionObserver:class{constructor(t){var e;this.Wo=()=>{var n;if(de&&this.isEnabled&&(n=Be.__PosthogExtensions__)!=null&&n.errorWrappingFunctions){var r=Be.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=Be.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,o=Be.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Go&&this.Te.capture_unhandled_errors&&(this.Go=r(this.captureException.bind(this))),!this.Qo&&this.Te.capture_unhandled_rejections&&(this.Qo=s(this.captureException.bind(this))),!this.Jo&&this.Te.capture_console_errors&&(this.Jo=o(this.captureException.bind(this)))}catch(l){$u.error("failed to start",l),this.Ko()}}},this._instance=t,this.Yo=!((e=this._instance.persistence)==null||!e.props[ab]),this.Xo=new o8(we({},(function(n){var r,s,o,l;return n===void 0&&(n={}),{refillRate:(r=(s=n.exceptionRateLimiterRefillRate)!==null&&s!==void 0?s:n.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(o=(l=n.exceptionRateLimiterBucketSize)!==null&&l!==void 0?l:n.__exceptionRateLimiterBucketSize)!==null&&o!==void 0?o:10}})(this._instance.config.error_tracking),{refillInterval:1e4,it:$u})),this.Te=this.ta(),this.startIfEnabledOrStop()}ta(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return nn(t)?e=we({},e,t):(Ee(t)?this.Yo:t)&&(e=we({},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?($u.info("enabled"),this.Ko(),this.tr(this.Wo)):this.Ko()}tr(t){var e,n;(e=Be.__PosthogExtensions__)!=null&&e.errorWrappingFunctions?t():(n=Be.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return $u.error("failed to load script",r);t()}))}Ko(){var t,e,n;(t=this.Go)==null||t.call(this),this.Go=void 0,(e=this.Qo)==null||e.call(this),this.Qo=void 0,(n=this.Jo)==null||n.call(this),this.Jo=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.Yo=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[ab]:this.Yo}),this.Te=this.ta(),this.startIfEnabledOrStop())}}onConfigChange(){this.Te=this.ta()}captureException(t){var e,n,r,s=(e=t==null||(n=t.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&e!==void 0?e:"Exception";this.Xo.consumeRateLimit(s)?$u.info("Skipping exception capture because of client rate limiting.",{exception:s}):(r=this._instance.exceptions)==null||r.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,n;this.ea=[],this.ra=new E8([new O8,new z8,new I8,new D8,new $8,new F8,new L8,new U8],(function(r){for(var s=arguments.length,o=new Array(s>1?s-1:0),l=1;s>l;l++)o[l-1]=arguments[l];return function(d,h){h===void 0&&(h=0);for(var p=[],g=d.split(`
105`),m=h;g.length>m;m++){var y=g[m];if(1024>=y.length){var b=Xk.test(y)?y.replace(Xk,"$1"):y;if(!b.match(/\S*Error: /)){for(var _ of o){var w=_(b,r);
105if(w){p.push(w);break}}if(p.length>=50)break}}}return(function(S){if(!S.length)return[];var E=Array.from(S);return E.reverse(),E.slice(0,50).map((k=>{return we({},k,{filename:k.filename||(j=E,j[j.length-1]||{}).filename,function:k.function||yc});var j}))})(p)}})("web:javascript",N8,R8)),this._instance=t,this.ea=(e=(n=this._instance.persistence)==null?void 0:n.get_property(ob))!==null&&e!==void 0?e:[],this.ia=Vp(this.na()),this.sa=new H8(this.ia)}onConfigChange(){this.ia=Vp(this.na()),this.sa.setConfig(this.ia)}onRemoteConfig(t){var e,n,r;if(t.ok){var s=t.config;if("errorTracking"in s){var o=(e=(n=s.errorTracking)==null?void 0:n.suppressionRules)!==null&&e!==void 0?e:[],l=(r=s.errorTracking)==null?void 0:r.captureExtensionExceptions;this.ea=o,this._instance.persistence&&this._instance.persistence.register({[ob]:this.ea,[lb]:l})}}}get oa(){var t,e=!!this._instance.get_property(lb),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.ra.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.ia.enabled)try{if(!Ft(t)||t.trim().length===0)return void Ds.warn("Ignoring exception step because message must be a non-empty string");var n=(function(o){if(!o)return{sanitizedProperties:{},droppedKeys:[]};var l=[];return{sanitizedProperties:Object.keys(o).reduce(((d,h)=>B8.has(h)?(l.push(h),d):(d[h]=o[h],d)),{}),droppedKeys:l}})(this.aa(e)),r=n.sanitizedProperties,s=n.droppedKeys;s.length>0&&Ds.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.sa.add(we({[qp]:t,[Gp]:new Date().toISOString()},r))}catch(o){Ds.error("Failed to add exception step. Ignoring breadcrumb.",o)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.la(e)){if(this.ua(e))return this.ha("Exception dropped: matched a suppression rule"),void Ds.info("Skipping exception capture because a suppression rule matched");if(!this.oa&&this.da(e))return this.ha("Exception dropped: thrown by a browser extension"),void Ds.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ca(e))return this.ha("Exception dropped: thrown by the PostHog SDK"),void Ds.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this.ia.enabled&&tt(t.$exception_steps)?this.va(t):t;try{var r=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",kn:!0});return r&&this.sa.clear(),r}catch(s){return Ds.error("Failed to capture exception event. Dropping this exception.",s),void this.sa.clear()}}catch(s){return void Ds.error("Failed to process exception event. Ignoring this exception.",s)}}va(t){try{var e=this.sa.getAttachable();return e.length===0?t:we({},t,{$exception_steps:e})}catch(n){return Ds.error("Failed to read buffered exception steps. Capturing exception without steps.",n),t}}ha(t){this.ia.enabled&&this.sa.add({[qp]:t,[Gp]:new Date().toISOString()})}aa(t){return nn(t)?we({},t):{}}na(){var t,e;return(t=(e=this._instance.config.error_tracking)==null?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}ua(t){if(t.length===0)return!1;var e=t.reduce(((n,r)=>{var s=r.type,o=r.value;return Ft(s)&&s.length>0&&n.$exception_types.push(s),Ft(o)&&o.length>0&&n.$exception_values.push(o),n}),{$exception_types:[],$exception_values:[]});return this.ea.some((n=>{var r=n.values.map((s=>{var o,l=xC[s.operator],d=it(s.value)?s.value:[s.value],h=(o=e[s.key])!==null&&o!==void 0?o:[];return d.length>0&&l(d,h)}));return n.type==="OR"?r.some(Boolean):r.every(Boolean)}))}da(t){return t.flatMap((e=>{var n,r;return(n=(r=e.stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[]})).some((e=>e.filename&&e.filename.startsWith("chrome-extension://")))}ca(t){if(t.length>0){var e,n,r,s,o=(e=(n=t[0].stacktrace)==null?void 0:n.frames)!==null&&e!==void 0?e:[],l=o[o.length-1];return(r=l==null||(s=l.filename)==null?void 0:s.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}la(t){return!tt(t)&&it(t)}}},lF=we({productTours:class{get mi(){return this._instance.persistence}constructor(t){this.fa=null,this.pa=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var n,r;if(this.mi&&this.mi.register({[Dx]:!!e.productTours}),!Yy(this._instance))return!this.fa&&tt((n=this.mi)==null?void 0:n.props[Zu])||Wy.info("product tours disabled; stopping and clearing cached tours"),(r=this.fa)==null||r.stop(),this.fa=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.fa&&Yy(this._instance)&&this.tr((()=>this.ga()))}tr(t){var e,n;(e=Be.__PosthogExtensions__)!=null&&e.generateProductTours?t():(n=Be.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",(r=>{r?Wy.error("Could not load product tours script",r):t()}))}ga(){var t;!this.fa&&(t=Be.__PosthogExtensions__)!=null&&t.generateProductTours&&(this.fa=Be.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(e===void 0&&(e=!1),!it(this.pa)||e){var n=this.mi;if(n){var r=n.props[Zu];if(it(r)&&!e)return this.pa=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:s=>{if(Yy(this._instance)){var o=s.statusCode;if(o!==200||!s.json){var l="Product Tours API could not be loaded, status: "+o;return Wy.error(l),void t([],{isLoaded:!1,error:l})}var d=it(s.json.product_tours)?s.json.product_tours:[];this.pa=d,n&&n.register({[Zu]:d}),t(d,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.pa,{isLoaded:!0})}getActiveProductTours(t){tt(this.fa)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.fa.getActiveProductTours(t)}showProductTour(t){var e;(e=this.fa)==null||e.showTourById(t)}previewTour(t){this.fa?this.fa.previewTour(t):this.tr((()=>{var e;this.ga(),(e=this.fa)==null||e.previewTour(t)}))}dismissProductTour(){var t;(t=this.fa)==null||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.fa)==null||t.nextStep()}previousStep(){var t;(t=this.fa)==null||t.previousStep()}clearCache(){var t;this.pa=null,(t=this.mi)==null||t.unregister(Zu)}resetTour(t){var e;(e=this.fa)==null||e.resetTour(t)}resetAllTours(){var t;(t=this.fa)==null||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.fa)==null||e.cancelPendingTour(t)}}},Mm),cF={siteApps:class{constructor(t){this.ma=0,this._instance=t,this.ya=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}ba(t,e){if(e){var n=this.globalsForEvent(e);this.ya.push(n),this.ya.length>1e3&&(this.ya=this.ya.slice(10))}}get siteAppLoaders(){var t;return(t=Be._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.ba.bind(this));this._a=()=>{t(),this.ya=[],this._a=void 0}}}globalsForEvent(t){var e,n,r,s,o,l,d;if(!t)throw new Error("Event payload is required");var h={},p=this._instance.get_property("$groups")||[],g=this._instance.get_property("$stored_group_properties")||{};for(var m of Object.entries(g)){var y=m[0];h[y]={id:p[y],type:y,properties:m[1]}}var b=t.$set_once,_=t.$set;return{event:we({},VN(t,Q9),{properties:we({},t.properties,_?{$set:we({},(e=(n=t.properties)==null?void 0:n.$set)!==null&&e!==void 0?e:{},_)}:{},b?{$set_once:we({},(r=(s=t.properties)==null?void 0:s.$set_once)!==null&&r!==void 0?r:{},b)}:{}),elements_chain:(o=(l=t.properties)==null?void 0:l.$elements_chain)!==null&&o!==void 0?o:"",distinct_id:(d=t.properties)==null?void 0:d.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}wa(t){var e,n=(e=t.tagName)==null?void 0:e.toLowerCase();return n==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(Ji.error("prepare_external_dependency_stylesheet returned null"),null):n==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||(Ji.error("prepare_external_dependency_script returned null"),null):t}xa(){var t,e,n,r,s,o,l,d;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var h=Ae==null?void 0:Ae.defaultView,p=h==null||(t=h.Node)==null?void 0:t.prototype;if(!h||!p)return()=>{};if(this.ma++,this.ka)return this.Sa();var g=[],m=this,y=new WeakSet,b=(S,E,k)=>{if(S!=null&&S[E]){var j=S[E];S[E]=k(j),g.push((()=>{S[E]=j}))}},_=S=>{if(y.has(S))return S;var E=m.wa(S);return E&&y.add(E),E},w=S=>S.map((E=>typeof E=="string"?E:_(E))).filter((E=>!xr(E)));return b(p,"appendChild",(S=>function(E){var k=_(E);return k?S.call(this,k):E})),b(p,"insertBefore",(S=>function(E,k){var j=_(E);return j?S.call(this,j,k):E})),b(p,"replaceChild",(S=>function(E,k){var j=_(E);return j?S.call(this,j,k):k})),[(e=h.Element)==null?void 0:e.prototype,(n=h.Document)==null?void 0:n.prototype,(r=h.DocumentFragment)==null?void 0:r.prototype].forEach((S=>{b(S,"append",(E=>function(){for(var k=arguments.length,j=new Array(k),N=0;k>N;N++)j[N]=arguments[N];return E.apply(this,w(j))})),b(S,"prepend",(E=>function(){for(var k=arguments.length,j=new Array(k),N=0;k>N;N++)j[N]=arguments[N];return E.apply(this,w(j))}))})),[(s=h.Element)==null?void 0:s.prototype,(o=h.CharacterData)==null?void 0:o.prototype,(l=h.DocumentType)==null?void 0:l.prototype].forEach((S=>{b(S,"before",(E=>function(){for(var k=arguments.length,j=new Array(k),N=0;k>N;N++)j[N]=arguments[N];return E.apply(this,w(j))})),b(S,"after",(E=>function(){for(var k=arguments.length,j=new Array(k),N=0;k>N;N++)j[N]=arguments[N];return E.apply(this,w(j))})),b(S,"replaceWith",(E=>function(){for(var k=arguments.length,j=new Array(k),N=0;k>N;N++)j[N]=arguments[N];var O=w(j);return j.length&&!O.length?void 0:E.apply(this,O)}))})),b((d=h.Element)==null?void 0:d.prototype,"insertAdjacentElement",(S=>function(E,k){var j=_(k);return j?S.call(this,E,j):null})),this.ka=()=>{g.forEach((S=>S())),this.ka=void 0},this.Sa()}Sa(){var t=!1;return()=>{var e;t||(t=!0,this.ma--,this.ma===0&&((e=this.ka)==null||e.call(this)))}}Ca(t,e){e===void 0&&(e=!0);var n=this.xa();try{var r=t(n);return e&&n(),r}catch(s){throw n(),s}}setupSiteApp(t){var e=this.apps[t.id],n=()=>{var l;!e.errored&&this.ya.length&&(Ji.info("Processing "+this.ya.length+" events for site app with id "+t.id),this.ya.forEac
105h((d=>this.Ca((()=>e.processEvent==null?void 0:e.processEvent(d))))),e.processedBuffer=!0),Object.values(this.apps).every((d=>d.processedBuffer||d.errored))&&((l=this._a)==null||l.call(this))},r=!1,s=l=>{e.errored=!l,e.loaded=!0,Ji.info("Site app with id "+t.id+" "+(l?"loaded":"errored")),r&&n()};try{var o=this.Ca((l=>t.init({posthog:this._instance,callback(d){l(),s(d)}})),!1).processEvent;o&&(e.processEvent=o),r=!0}catch(l){Ji.error(Rj+t.id,l),s(!1)}if(r&&e.loaded)try{n()}catch(l){Ji.error("Error while processing buffered events PostHog app with config id "+t.id,l),e.errored=!0}}Ia(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of t)this.setupSiteApp(n)}Ta(t){var e=this;if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(t),r=function(o){try{e.Ca((()=>o.processEvent==null?void 0:o.processEvent(n)))}catch(l){Ji.error("Error while processing event "+t.event+" for site app "+o.id,l)}};for(var s of Object.values(this.apps))r(s)}}onRemoteConfig(t){var e,n,r,s=this;if((e=this.siteAppLoaders)!=null&&e.length)return this.isEnabled?(this.Ia(),void this._instance.on("eventCaptured",(h=>this.Ta(h)))):void Ji.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this._a)==null||n.call(this),t.ok){var o=t.config;if((r=o.siteApps)!=null&&r.length)if(this.isEnabled){var l=function(){var h,p=d.id,g=d.url;Be["__$$ph_site_app_"+p]=s._instance,(h=Be.__PosthogExtensions__)==null||h.loadSiteApp==null||h.loadSiteApp(s._instance,g,(m=>{if(m)return Ji.error(Rj+p,m)}))};for(var d of o.siteApps)l()}else Ji.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},uF={tracingHeaders:class{constructor(t){this.Ma=void 0,this.Ea=void 0,this.Ra=void 0,this.Wo=()=>{var e,n,r=this.Pa();r?(Ee(this.Ma)&&(this.Ma=(e=Be.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),Ee(this.Ea)&&(this.Ea=(n=Be.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null?void 0:n._patchFetch(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Ko()},this._instance=t}initialize(){this.startIfEnabledOrStop()}tr(t){var e,n;(e=Be.__PosthogExtensions__)!=null&&e.tracingHeadersPatchFns?t():(n=Be.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return X9.error("failed to load script",r);t()}))}Oa(){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}Pa(){var t=this.Oa();return it(t)?(it(this.Ra)?this.Ra.splice(0,this.Ra.length,...t):this.Ra=[...t],t.length>0?this.Ra:void 0):(it(this.Ra)&&this.Ra.splice(0),this.Ra=t||void 0,this.Ra)}Ko(){var t,e;(t=this.Ma)==null||t.call(this),(e=this.Ea)==null||e.call(this),this.Ma=void 0,this.Ea=void 0}startIfEnabledOrStop(){this.Pa()?this.tr(this.Wo):this.Ko()}}},dF=we({surveys:class{get Te(){return this._instance.config}constructor(t){this.Fa=void 0,this._surveyManager=null,this.La=!1,this.$a=[],this.Aa=null,this.Na=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.Te.disable_surveys){if(!t.ok)return Ot.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(tt(e))return Ot.warn("Flags not loaded yet. Not loading surveys.");var n=it(e);this.Fa=n?e.length>0:e,Ot.info("flags response received, isSurveysEnabled: "+this.Fa),this.loadIfEnabled()}}reset(){try{var t;(t=this._surveyEventReceiver)==null||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(SC)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach((s=>localStorage.removeItem(s)))}catch{}}loadIfEnabled(){if(!this._surveyManager)if(this.La)Ot.info("Already initializing surveys, skipping...");else if(this.Te.disable_surveys)Ot.info(Oj);else if(this.Te.cookieless_mode&&this._instance.consent.isOptedOut())Ot.info("Not loading surveys in cookieless mode without consent.");else{var t=Be==null?void 0:Be.__PosthogExtensions__;if(t){if(!Ee(this.Fa)||this.Te.advanced_enable_surveys){var e=this.Fa||this.Te.advanced_enable_surveys;this.La=!0;try{var n=t.generateSurveys;if(n)return void this.Da(n,e);var r=t.loadExternalDependency;if(!r)return void this.qa(Mx);r(this._instance,"surveys",(s=>{s||!t.generateSurveys?this.qa("Could not load surveys script",s):this.Da(t.generateSurveys,e)}))}catch(s){throw this.qa("Error initializing surveys",s),s}finally{this.La=!1}}}else Ot.error("PostHog Extensions not found.")}}Da(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new nF(this._instance),Ot.info("Surveys loaded successfully"),this.ja({isLoaded:!0})}qa(t,e){Ot.error(t,e),this.ja({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.$a.push(t),this._surveyManager&&this.ja({isLoaded:!0}),()=>{this.$a=this.$a.filter((e=>e!==t))}}getSurveys(t,e){if(e===void 0&&(e=!1),this.Te.disable_surveys)return Ot.info(Oj),t([]);var n,r=this._instance.get_property(fb);if(r&&!e)return t(r,{isLoaded:!0}
105),void(this.Ha()&&this.getSurveys((()=>{}),!0));typeof Promise<"u"&&this.Aa?this.Aa.then((s=>t(s.surveys,s.context))):(typeof Promise<"u"&&(this.Aa=new Promise((s=>{n=s}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Te.token),method:"GET",timestampMode:"query",timeout:this.Te.surveys_request_timeout_ms,callback:s=>{var o;this.Aa=null;var l=s.statusCode;if(l!==200||!s.json){var d="Surveys API could not be loaded, status: "+l;Ot.error(d),this.Na=Date.now();var h={isLoaded:!1,error:d};return t([],h),void(n==null||n({surveys:[],context:h}))}this.Na=null;var p,g=s.json.surveys||[],m=g.filter((b=>(function(_){return!(!_.start_date||_.end_date)})(b)&&(wC(b)||(function(_){var w;return!((w=_.conditions)==null||(w=w.actions)==null||(w=w.values)==null||!w.length)})(b))));m.length>0&&((p=this._surveyEventReceiver)==null||p.register(m)),(o=this._instance.persistence)==null||o.register({[fb]:g,[Kp]:Date.now()});var y={isLoaded:!0};t(g,y),n==null||n({surveys:g,context:y})}}))}Ha(){return this.Ba()&&!this.Aa&&!this.Ua()}Ba(){var t=this._instance.get_property(Kp);return er(t)&&Date.now()-t>3e5}Ua(){return er(this.Na)&&3e5>Date.now()-this.Na}markSurveyAsSeen(t,e){var n,r={id:t,current_iteration:(n=e==null?void 0:e.iteration)!==null&&n!==void 0?n:null};EC(r);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}ja(t){for(var e of this.$a)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(n){Ot.error("Error in survey callback",n)}}getActiveMatchingSurveys(t,e){if(e===void 0&&(e=!1),!tt(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Ot.warn("init was not called")}za(t){var e=null;return this.getSurveys((n=>{var r;e=(r=n.find((s=>s.id===t)))!==null&&r!==void 0?r:null})),e}Va(t){if(tt(this._surveyManager))return{eligible:!1,reason:Ky};var e=typeof t=="string"?this.za(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(tt(this._surveyManager))return Ot.warn("init was not called"),{visible:!1,disabledReason:Ky};var e=this.Va(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return tt(this._surveyManager)?(Ot.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Ky})):new Promise((n=>{this.getSurveys((r=>{var s,o=(s=r.find((d=>d.id===t)))!==null&&s!==void 0?s:null;if(o){var l=this.Va(o);n({visible:l.eligible,disabledReason:l.reason})}else n({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,n){var r;if(tt(this._surveyManager))Ot.warn("init was not called");else{var s=typeof t=="string"?this.za(t):t;if(s!=null&&s.id)if(z9.includes(s.type)){var o=Ae==null?void 0:Ae.querySelector(e);if(o)return(r=s.appearance)!=null&&r.surveyPopupDelaySeconds?(Ot.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var l,d;Ot.info("Rendering survey "+s.id+" with delay of "+((l=s.appearance)==null?void 0:l.surveyPopupDelaySeconds)+" seconds"),(d=this._surveyManager)==null||d.renderSurvey(s,o,n),Ot.info("Survey "+s.id+" rendered")}),1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,o,n);Ot.warn("Survey element not found")}else Ot.warn("Surveys of type "+s.type+" cannot be rendered in the app");else Ot.warn("Survey not found")}}displaySurvey(t,e){var n;if(tt(this._surveyManager))Ot.warn("init was not called");else{var r=this.za(t);if(r){var s=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=we({},r,{appearance:we({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==Eb.Popover&&e.initialResponses&&Ot.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){var o=this.canRenderSurvey(r);if(!o.visible)return void Ot.warn("Survey is not eligible to be displayed: ",o.disabledReason)}e.displayType!==Eb.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else Ot.warn("Survey not found")}}cancelPendingSurvey(t){tt(this._surveyManager)?Ot.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;(t=this._surveyManager)==null||t.handlePageUnload==null||t.handlePageUnload()}}},Mm),hF={toolbar:class{constructor(t){this.instance=t}Wa(t){Be.ph_toolbar_state=t}Za(){var t;return(t=Be.ph_toolbar_state)!==null&&t!==void 0?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,n){if(t===void 0&&(t=void 0),e===void 0&&(e=void 0),n===void 0&&(n=void 0),MA(this.instance.config)||!de||!Ae)return!1;t=t??de.location,n=n??de.history;try{if(!e){try{de.localStorage.setItem("test","test"),de.localStorage.removeItem("test")}catch{return!1}e=de==null?void 0:de.localStorage}var r,s=rF||nm(t.hash,"__posthog")||nm(t.hash,"state"),o=s?ej((()=>JSON.parse(atob(decodeURIComponent(s)))))||ej((()=>JSON.parse(decodeURIComponent(s)))):null;return o&&o.action==="ph_authorize"?((r=o).source="url",r&&Object.keys(r).length>0&&(o.desiredHash?t.hash=o.desiredHash:n?n.replaceState(n.state,"",t.pathname+t.search):t.hash="")):((r=JSON.parse(e.getItem(Dj)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}Ga(t){var e=Be.ph_load_toolbar||Be.ph_load_editor;!tt(e)&&Li(e)?e(t,this.instance):Ij.warn("No toolbar load function found")}loadToolbar(t){var e=!(Ae==null||!Ae.getElementById($A));if(!de||e)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=we({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(de.localStorage.setItem(Dj,JSON.stringify(we({},r,{source:void 0}))),this.Za()===2)this.Ga(r);else if(this.Za()===0){var s;this.Wa(1),(s=Be.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"toolbar",(o=>{if(o)return Ij.error("[Toolbar] Failed to load",o),void this.Wa(0);this.Wa(2),this.Ga(r)})),un(de,"turbolinks:load",(()=>{this.Wa(0),this.loadToolbar(r)}))}return!0}Qa(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,n){return t===void 0&&(t=void 0),e===void 0&&(e=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(t,e,n)}}},fF=we({experiments:sr},Mm),pF={conversations:class{constructor(t){this.Ja=void 0,this._conversationsManager=null,this.Ka=!1,this.Ya=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&t.ok){var e=t.config.conversations;tt(e)||(Fi(e)?this.Ja=e:(this.Ja=e.enabled,this.Ya=e),this.loadIfEnabled())}}reset(){var t;(t=this._conversationsManager)==null||t.reset(),this._conversationsManager=null,this.Ja=void 0,this.Ya=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ka||this._instance.config.disable_conversations||MA(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=Be==null?void 0:Be.__PosthogExtensions__;if(t&&!Ee(this.Ja)&&this.Ja)if(this.Ya&&this.Ya.token){this.Ka=!0;try{var e=t.initConversations;if(e)return this.Xa(e),void(this.Ka=!1);var n=t.loadExternalDependency;if(!n)return void this.tl(Mx);n(this._instance,"conversations",(r=>{r||!t.initConversations?this.tl("Could not load conversations script",r):this.Xa(t.initConversations),this.Ka=!1}))}catch(r){this.tl("Error initializing conversations",r),this.Ka=!1}}else ui.error("Conversations enabled but missing token in remote config.")}}Xa(t){if(this.Ya)try{this._conversationsManager=t(this.Ya,this._instance),ui.info("Conversations loaded successfully")}catch(e){this.tl("Error completing conversations initialization",e)}else ui.error("Cannot complete initialization: remote config is null")}tl(t,e){ui.error(t,e),this._conversationsManager=null,this.Ka=!1}show(){this._conversationsManager?this._conversationsManager.show():ui.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Ja===!0&&!xr(this._conversationsManager)}isVisible(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,n){var r=this;return gn((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,n):(ui.warn(bo),null)}))()}getMessages(t,e){var n=this;return gn((function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(ui.warn(bo),null)}))()}markAsRead(t){var e=this;return gn((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(ui.warn(bo),null)}))()}getTickets(t){var e=this;return gn((function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(ui.warn(bo),null)}))()}requestRestoreLink(t){var e=this;return gn((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(ui.warn(bo),null)}))()}restoreFromToken(t){var e=this;return gn((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(ui.warn(bo),null)}))()}restoreFromUrlToken(){var t=this;return gn((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(ui.warn(bo),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()}}},mF={logs:class{constructor(t){var e;this.el=!1,this.rl=!1,this.it=an("[logs]"),this.Gr=[],this.il=[],this.Hs=0,this.nl=()=>{var n,r;this.Hs=0,(n=this.sl)==null||n.onReconnect(),(r=this.ol)==null||r.onReconnect()},this._instance=t,this._instance&&(e=this._instance.config.logs)!=null&&e.captureConsoleLogs&&(this.el=!0),de&&un(de,"online",this.nl)}al(t,e,n,r){var s,o=(function(l,d){var h,p,g,m,y,b,_,w=(h=l==null?void 0:l.flushIntervalMs)!==null&&h!==void 0?h:3e3,S=(p=l==null?void 0:l.maxBufferSize)!==null&&p!==void 0?p:100,E=d!=null&&d.consoleCapture?void 0:(g=l==null?void 0:l.maxLogsPerInterval)!==null&&g!==void 0?g:1e3,k=Ee(E)?Math.max(S,2048):Math.max(S,E),j=l==null?void 0:l.resourceAttributes;return{serviceName:(m=(y=j==null?void 0:j["service.name"])!==null&&y!==void 0?y:l==null?void 0:l.serviceName)!==null&&m!==void 0?m:d==null?void 0:d.serviceNameDefault,serviceVersion:(b=j==null?void 0:j["service.version"])!==null&&b!==void 0?b:l==null?void 0:l.serviceVersion,environment:(_=j==null?void 0:j["deployment.environment"])!==null&&_!==void 0?_:l==null?void 0:l.environment,resourceAttributes:j,beforeSend:l==null?void 0:l.beforeSend,flushIntervalMs:w,maxBufferSize:S,maxQueueSize:k,maxBatchRecordsPerPost:100,rateCapWindowMs:w,maxLogsPerInterval:E,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}})((s=this._instance)==null||(s=s.config)==null?void 0:s.logs,n);return[new _8(this.ll(t,e),o,this.it,(()=>this.ul()),(l=>l()),void 0,r),o]}hl(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.sl||this.dl!==e){var n;(n=this.sl)==null||n.reset(),this.dl=e;var r=this.al((()=>this.Gr),(s=>{this.Gr=s}));this.sl=r[0],this.cl=r[1]}return this.sl}vl(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.ol||this.fl!==e){var n;(n=this.ol)==null||n.reset(),this.fl=e;var r=this.al((()=>this.il),(s=>{this.il=s}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},Fj);this.ol=r[0],this.pl=r[1]}return this.ol}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e;if(t.ok){var n=(e=t.config.logs)==null?void 0:e.captureConsoleLogs;!tt(n)&&n&&(this.el=!0,this.loadIfEnabled())}}reset(){var t,e;this.Gr=[],(t=this.sl)==null||t.reset(),this.il=[],(e=this.ol)==null||e.reset(),this.Hs=0}captureLog(t){this.hl().captureLog(t)}le(t){this.vl().captureLog(t)}get logger(){return this.gl||(this.gl={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.gl}flushLogs(t){t?this.ml(t):(this.sl&&this.sl.flush().catch((e=>this.it.error("PostHog logs flush failed:",e))),this.ol&&this.ol.flush().catch((e=>this.it.error("PostHog logs flush failed:",e))))}loadIfEnabled(){if(this.el&&!this.rl){var t=Be==null?void 0:Be.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",(n=>{var r;n||(r=t.logs)==null||!r.initializeLogs?this.it.error("Could not load logs script",n):(t.logs.initializeLogs(this._instance),this.rl=!0)})):this.it.error(Mx)}else this.it.error("PostHog Extensions not found.")}}ll(t,e){var n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:r=>r===Us.LogsQueue?t():void 0,setPersistedProperty(r,s){var o;r===Us.LogsQueue&&e((o=s)!==null&&o!==void 0?o:[])},$t:r=>this.$t(r),getLibraryId:()=>Pt.LIB_NAME,getLibraryVersion:()=>Pt.LIB_VERSION}}$t(t){return new Promise((e=>{if(QA(this.Hs,3))e({kind:"fatal",error:new Error("logs endpoint is unreachable, dropping batch")});else{var n=!1,r=o=>{n||(n=!0,clearTimeout(s),e(o))},s=setTimeout((()=>r({kind:"retry-later",error:new Error("logs request timed out")})),9e4);this._instance._send_request({method:"POST",url:this.yl(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:o=>{var l=o.statusCode;if(this.bl(l),l>=200&&300>l)r({kind:"ok"});else if(l===413)r({kind:"too-large"});else if(l!==0&&l!==429&&500>l)r({kind:"fatal",error:new Error("logs request failed with status "+l)});else{var d;r({kind:"retry-later",error:(d=o.error)!==null&&d!==void 0?d:new Error("logs request failed with status "+l)})}}})}}))}bl(t){(t!==0||this._instance.__loaded)&&(this.Hs=eC(t,this.Hs,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."))))}ml(t){this.Gr.length>0&&this._l(t,this.Gr,this.cl,Pt.LIB_NAME,(e=>{this.Gr=e})),this.il.length>0&&this._l(t,this.il,this.pl,Fj,(e=>{this.il=e}))}_l(t,e,n,r,s){if(e.length!==0){var o=e.map((d=>d.record));s([]);var l=_A(o,xA(n,Pt.LIB_NAME,Pt.LIB_VERSION),r,Pt.LIB_VERSION);this._instance._send_request({method:"POST",url:this.yl(),data:l,compression:"best-available",batchKey:"logs",transport:t})}}yl(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}ul(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var n=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.windowId,s=n.sessionStartTimestamp,o=n.lastActivityTimestamp;e.sessionId=n.sessionId,e.windowId=r,tt(s)||(e.sessionStartTimestamp=s),tt(o)||(e.lastActivityTimestamp=o)}if(Be!=null&&(t=Be.location)!=null&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?Ua(Be.location.href):Be.location.href),this._instance.featureFlags){var l=this._instance.featureFlags.getFlags();l&&l.length>0&&(e.activeFeatureFlags=l)}return e}}},gF={metrics:class{constructor(t){this.it=an("[metrics]"),this._instance=t}initialize(){}hl(){var t,e,n=(t=this._instance)==null||(t=t.config)==null?void 0:t.metrics;return this.sl&&this.dl===n||((e=this.sl)==null||e.reset(),this.dl=n,this.sl=new w8(this.ll(),(function(r){var s,o,l,d,h,p=r==null?void 0:r.resourceAttributes;return{serviceName:(s=p==null?void 0:p["service.name"])!==null&&s!==void 0?s:r==null?void 0:r.serviceName,serviceVersion:(o=p==null?void 0:p["service.version"])!==null&&o!==void 0?o:r==null?void 0:r.serviceVersion,environment:(l=p==null?void 0:p["deployment.environment"])!==null&&l!==void 0?l:r==null?void 0:r.environment,resourceAttributes:p,beforeSend:r==null?void 0:r.beforeSend,flushIntervalMs:(d=r==null?void 0:r.flushIntervalMs)!==null&&d!==void 0?d:1e4,maxSeriesPerFlush:(h=r==null?void 0:r.maxSeriesPerFlus
105h)!==null&&h!==void 0?h:1e3}})(n),this.it)),this.sl}count(t,e,n){e===void 0&&(e=1),this.hl().count(t,e,n)}gauge(t,e,n){this.hl().gauge(t,e,n)}histogram(t,e,n){this.hl().histogram(t,e,n)}flush(t){if(!this.sl)return Promise.resolve();if(t){var e=this.sl.drainWindow();return e&&this.Kt(e,t),Promise.resolve()}return this.sl.flush().catch((n=>this.it.error("PostHog metrics flush failed:",n)))}reset(){var t;(t=this.sl)==null||t.reset()}ll(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Kt:n=>e.Kt(n),getLibraryId:()=>Pt.LIB_NAME,getLibraryVersion:()=>Pt.LIB_VERSION}}Kt(t,e){return new Promise((n=>{var r=!1,s=l=>{r||(r=!0,clearTimeout(o),n(l))},o=setTimeout((()=>s({kind:"retry-later",error:new Error("metrics request timed out")})),9e4);this._instance._send_request(we({method:"POST",url:this.wl(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(l){var d=l.statusCode;if(d>=200&&300>d)s({kind:"ok"});else if(d===413)s({kind:"too-large"});else if(d!==0&&d!==429&&500>d)s({kind:"fatal",error:new Error("metrics request failed with status "+d)});else{var h;s({kind:"retry-later",error:(h=l.error)!==null&&h!==void 0?h:new Error("metrics request failed with status "+d)})}}}))}))}wl(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},vF=we({},Mm,sF,aF,oF,lF,cF,dF,uF,hF,fF,pF,mF,gF);gi.__defaultExtensionClasses=we({},vF);var qx=(function(){Pt.SDK_DIST_CHANNEL="npm";var t=cd[Ql]=new gi;return(function(){function e(){e.done||(e.done=!0,jC=!1,$t(cd,(function(n){n._dom_loaded()})))}Ae!=null&&Ae.addEventListener?Ae.readyState==="complete"?e():un(Ae,"DOMContentLoaded",e,{capture:!1}):de&&ke.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})(),TC;function yF(t){TC=t}function Db(){return TC}var Gx=T.createContext({get client(){return Db()},bootstrap:void 0});function NC(t,e,n){if(n===void 0&&(n=new WeakMap),t===e)return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(n.has(t)&&n.get(t)===e)return!0;n.set(t,e);var r=Object.keys(t),s=Object.keys(e);if(r.length!==s.length)return!1;for(var o=0,l=r;o<l.length;o++){var d=l[o];if(!s.includes(d)||!NC(t[d],e[d],n))return!1}return!0}function bF(t){var e,n,r=t.children,s=t.client,o=t.apiKey,l=t.options,d=T.useRef(null),h=T.useMemo(function(){if(s)return o&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),l&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),s;var p=Db();return o||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),p},[s,o,JSON.stringify(l)]);return T.useEffect(function(){if(!(s||!o)){var p=Db(),g=d.current;g?(o!==g.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),l&&!NC(l,g.options)&&p.set_config(l),d.current={apiKey:o,options:l??{}}):(p.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),p.init(o,l),d.current={apiKey:o,options:l??{}})}},[s,o,JSON.stringify(l)]),Ut.createElement(Gx.Provider,{value:{client:h,bootstrap:(e=l==null?void 0:l.bootstrap)!==null&&e!==void 0?e:(n=s==null?void 0:s.config)===null||n===void 0?void 0:n.bootstrap}},r)}var Xy=function(t){return typeof t=="function"},In=function(){var t=T.useContext(Gx).client;return t},Ib=function(t,e){return Ib=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&
105(n[s]=r[s])},Ib(t,e)};function xF(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ib(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var _F={componentStack:null,exceptionEvent:null,error:null},wF={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."};(function(t){xF(e,t);function e(n){var r=t.call(this,n)||this;return r.state=_F,r}return e.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,o;Xy(s)?o=s(n):typeof s=="object"&&(o=s);var l=this.context.client,d=l.captureException(n,o),h=r.componentStack;this.setState({error:n,componentStack:h??null,exceptionEvent:d})},e.prototype.render=function(){var n=this.props,r=n.children,s=n.fallback,o=this.state;if(o.componentStack==null)return Xy(r)?r():r;var l=Xy(s)?Ut.createElement(s,{error:o.error,componentStack:o.componentStack,exceptionEvent:o.exceptionEvent}):s;return Ut.isValidElement(l)?l:(console.warn(wF.INVALID_FALLBACK),Ut.createElement(Ut.Fragment,null))},e.contextType=Gx,e})(Ut.Component);yF(qx);const AC=T.createContext(null);function SF({children:t}){const[e,n]=T.useState(null),[r,s]=T.useState(null),[o,l]=T.useState(!0),d=In(),h=T.useRef(null);T.useEffect(()=>{const y=_=>{_&&h.current!==_.id&&(h.current=_.id,d.identify(_.id,{email:_.email}))};Ye.auth.getSession().then(({data:{session:_}})=>{s(_),n((_==null?void 0:_.user)??null),y((_==null?void 0:_.user)??null),l(!1)});const{data:{subscription:b}}=Ye.auth.onAuthStateChange((_,w)=>{if(s(w),n((w==null?void 0:w.user)??null),_==="SIGNED_OUT"||!(w!=null&&w.user)){h.current=null;return}y(w.user)});return()=>b.unsubscribe()},[d]);const p=async(y,b)=>{var S,E;const{data:_,error:w}=await Ye.auth.signUp({email:y,password:b,options:{emailRedirectTo:`${window.location.origin}/auth/callback`}});return!w&&_.user&&((S=_.user.identities)!=null&&S.length)&&((E=window.gtag)==null||E.call(window,"event","sign_up",{method:"email"})),{error:w,session:_.session??null}},g=async(y,b)=>{const{data:_,error:w}=await Ye.auth.signInWithPassword({email:y,password:b});return!w&&_.user&&d.capture("user_logged_in",{method:"email"}),{error:w}},m=async()=>{await Ye.auth.signOut()};return u.jsx(AC.Provider,{value:{user:e,session:r,loading:o,signUp:p,signIn:g,signOut:m},children:t})}function hn(){const t=T.useContext(AC);if(!t)throw new Error("useAuth must be used within AuthProvider");return t}function EF(){const{user:t,loading:e}=hn();return e?u.jsx("div",{role:"status","aria-label":"Loading",className:"flex items-center justify-center min-h-screen bg-gray-950",children:u.jsx("div",{"aria-hidden":"true",className:"w-6 h-6 border-2 border-indigo-500 border-t-transparent rounded-full animate-spin"})}):t?u.jsx(yN,{}):u.jsx(Qd,{to:"/login",replace:!0})}/**
106 * @license lucide-react v1.21.0 - ISC
107 *
108 * This source code is licensed under the ISC license.
109 * See the LICENSE file in the root directory of this source tree.
110 */const CC=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
111 * @license lucide-react v1.21.0 - ISC
112 *
113 * This source code is licensed under the ISC license.
114 * See the LICENSE file in the root directory of this source tree.
115 */const kF=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
116 * @license lucide-react v1.21.0 - ISC
117 *
118 * This source code is licensed under the ISC license.
119 * See the LICENSE file in the root directory of this source tree.
120 */const jF=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
121 * @license lucide-react v1.21.0 - ISC
122 *
123 * This source code is licensed under the ISC license.
124 * See the LICENSE file in the root directory of this source tree.
125 */const $j=t=>{const e=jF(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
126 * @license lucide-react v1.21.0 - ISC
127 *
128 * This source code is licensed under the ISC license.
129 * See the LICENSE file in the root directory of this source tree.
130 */var Zy={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"};/**
131 * @license lucide-react v1.21.0 - ISC
132 *
133 * This source code is licensed under the ISC license.
134 * See the LICENSE file in the root directory of this source tree.
135 */const TF=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},NF=T.createContext({}),AF=()=>T.useContext(NF),CF=T.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:s="",children:o,iconNode:l,...d},h)=>{const{size:p=24,strokeWidth:g=2,absoluteStrokeWidth:m=!1,color:y="currentColor",className:b=""}=AF()??{},_=r??m?Number(n??g)*24/Number(e??p):n??g;return T.createElement("svg",{ref:h,...Zy,width:e??p??Zy.width,height:e??p??Zy.height,stroke:t??y,strokeWidth:_,className:CC("lucide",b,s),...!o&&!TF(d)&&{"aria-hidden":"true"},...d},[...l.map(([w,S])=>T.createElement(w,S)),...Array.isArray(o)?o:[o]])});/**
136 * @license lucide-react v1.21.0 - ISC
137 *
138 * This source code is licensed under the ISC license.
139 * See the LICENSE file in the root directory of this source tree.
140 */const RC=(t,e)=>{const n=T.forwardRef(({className:r,...s},o)=>T.createElement(CF,{ref:o,iconNode:e,className:CC(`lucide-${kF($j(t))}`,`lucide-${t}`,r),...s}));return n.displayName=$j(t),n};/**
141 * @license lucide-react v1.21.0 - ISC
142 *
143 * This source code is licensed under the ISC license.
144 * See the LICENSE file in the root directory of this source tree.
145 */const RF=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],OF=RC("moon",RF);/**
146 * @license lucide-react v1.21.0 - ISC
147 *
148 * This source code is licensed under the ISC license.
149 * See the LICENSE file in the root directory of this source tree.
150 */const DF=[["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"}]],IF=RC("sun",DF),MF={plan:"free",status:"active",current_period_end:null,
150stripe_customer_id:null,stripe_price_id:null,monthly_analysis_count:0,analyses_remaining:10,is_pro:!1};function zo(){const{user:t}=hn(),[e,n]=T.useState(MF),[r,s]=T.useState(!0),o=T.useCallback(async()=>{if(!t)return;const{data:l,error:d}=await Ye.functions.invoke("get-subscription");!d&&l&&n(l),s(!1)},[t]);return T.useEffect(()=>{s(!0),o()},[o]),{subscription:e,loading:r,refresh:o}}function LF(){const{user:t}=hn(),[e,n]=T.useState(null),[r,s]=T.useState(null),[o,l]=T.useState(!0);T.useEffect(()=>{if(!t){l(!1);return}let h=!1;return Ye.from("profiles").select("raw_profile, profile_pic_url").eq("id",t.id).maybeSingle().then(({data:p})=>{h||(n((p==null?void 0:p.raw_profile)??null),s((p==null?void 0:p.profile_pic_url)??null),l(!1))}),()=>{h=!0}},[t]);const d=!!e&&Array.isArray(e.work_history)&&e.work_history.length>0;return{rawProfile:e,profilePicUrl:r,loading:o,isComplete:d}}function PF(){const{user:t}=hn(),[e,n]=T.useState(null),[r,s]=T.useState(!0);return T.useEffect(()=>{if(!t){s(!1);return}let o=!1;return Ye.from("job_preferences").select("onboarding_complete").eq("user_id",t.id).maybeSingle().then(({data:l})=>{o||(n(!!(l!=null&&l.onboarding_complete)),s(!1))}),()=>{o=!0}},[t]),{onboardingComplete:e,loading:r}}const $e=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,ut=globalThis,Oo="10.54.0";function Bo(){return Lm(ut),ut}function Lm(t){const e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||Oo,e[Oo]=e[Oo]||{}}function Nc(t,e,n=ut){const r=n.__SENTRY__=n.__SENTRY__||{},s=r[Oo]=r[Oo]||{};return s[t]||(s[t]=e())}const FF=["debug","info","warn","error","log","assert","trace"],$F="Sentry Logger ",om={};function Ho(t){if(!("console"in ut))return t();const e=ut.console,n={},r=Object.keys(om);r.forEach(s=>{const o=om[s];n[s]=e[s],e[s]=o});try{return t()}finally{r.forEach(s=>{e[s]=n[s]})}}function UF(){Wx().enabled=!0}function zF(){Wx().enabled=!1}function OC(){return Wx().enabled}function BF(...t){Vx("log",...t)}function HF(...t){Vx("warn",...t)}function qF(...t){Vx("error",...t)}function Vx(t,...e){$e&&OC()&&Ho(()=>{ut.console[t](`${$F}[${t}]:`,...e)})}function Wx(){return $e?Nc("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const je={enable:UF,disable:zF,isEnabled:OC,log:BF,warn:HF,error:qF},DC=50,Po="?",Uj=/\(error: (.*)\)/,zj=/captureMessage|captureException/;function IC(...t){const e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,s=0)=>{const o=[],l=n.split(`
151`);for(let d=r;d<l.length;d++){let h=l[d];h.length>1024&&(h=h.slice(0,1024));const p=Uj.test(h)?h.replace(Uj,"$1"):h;if(!p.includes("Error: ")){for(const g of e){const m=g(p);if(m){o.push(m);break}}if(o.length>=DC+s)break}}return VF(o.slice(s))}}function GF(t){return Array.isArray(t)?IC(...t):t}function VF(t){if(!t.length)return[];const e=Array.from(t);return/sentryWrapped/.test(Zf(e).function||"")&&e.pop(),e.reverse(),zj.test(Zf(e).function||"")&&(e.pop(),zj.test(Zf(e).function||"")&&e.pop()),e.slice(0,DC).map(n=>({...n,filename:n.filename||Zf(e).filename,function:n.function||Po}))}function Zf(t){return t[t.length-1]||{}}const Qy="<anonymous>";function Zs(t){try{return!t||typeof t!="function"?Qy:t.name||Qy}catch{return Qy}}function Bj(t){const e=t.exception;if(e){const n=[];try{return e.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}function MC(t){return"__v_isVNode"in t&&t.__v_isVNode?"[VueVNode]":"[VueViewModel]"}const Qu={},Hj={};function qa(t,e){return Qu[t]=Qu[t]||[],Qu[t].push(e),()=>{const n=Qu[t];if(n){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}}}function Ga(t,e){if(!Hj[t]){Hj[t]=!0;try{e()}catch(n){$e&&je.error(`Error while instrumenting ${t}`,n)}}}function bi(t,e){const n=t&&Qu[t];if(n)for(const r of n)try{r(e)}catch(s){$e&&je.error(`Error while triggering instrumentation handler.
152Type: ${t}
153Name: ${Zs(r)}
154Error:`,s)}}let e0=null;function LC(t){const e="error";qa(e,t),Ga(e,WF)}function WF(){e0=ut.onerror,ut.onerror=function(t,e,n,r,s){return bi("error",{column:r,error:s,line:n,msg:t,url:e}),e0?e0.apply(this,arguments):!1},ut.onerror.__SENTRY_INSTRUMENTED__=!0}let t0=null;function PC(t){const e="unhandledrejection";qa(e,t),Ga(e,YF)}function YF(){t0=ut.onunhandledrejection,ut.onunhandledrejection=function(t){return bi("unhandledrejection",t),t0?t0.apply(this,arguments):!0},ut.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const FC=Object.prototype.toString;function th(t){switch(FC.call(t)){case"[object Error]":case"[object E
154xception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Qs(t,Error)}}function Ac(t,e){return FC.call(t)===`[object ${e}]`}function $C(t){return Ac(t,"ErrorEvent")}function qj(t){return Ac(t,"DOMError")}function KF(t){return Ac(t,"DOMException")}function Ys(t){return Ac(t,"String")}function Yx(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function wc(t){return t===null||Yx(t)||typeof t!="object"&&typeof t!="function"}function Od(t){return Ac(t,"Object")}function Pm(t){return typeof Event<"u"&&Qs(t,Event)}function JF(t){return typeof Element<"u"&&Qs(t,Element)}function XF(t){return Ac(t,"RegExp")}function nh(t){return!!(t!=null&&t.then&&typeof t.then=="function")}function ZF(t){return Od(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function Qs(t,e){try{return t instanceof e}catch{return!1}}function UC(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue||t.__v_isVNode))}function Kx(t){return typeof Request<"u"&&Qs(t,Request)}const Jx=ut,QF=80;function tr(t,e={}){if(!t)return"<unknown>";try{let n=t;const r=5,s=[];let o=0,l=0;const d=" > ",h=d.length;let p;const g=Array.isArray(e)?e:e.keyAttrs,m=!Array.isArray(e)&&e.maxStringLength||QF;for(;n&&o++<r&&(p=e6(n,g),!(p==="html"||o>1&&l+s.length*h+p.length>=m));)s.push(p),l+=p.length,n=n.parentNode;return s.reverse().join(d)}catch{return"<unknown>"}}function e6(t,e){const n=t,r=[];if(!(n!=null&&n.tagName))return"";if(Jx.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const s=e!=null&&e.length?e.filter(o=>n.getAttribute(o)).map(o=>[o,n.getAttribute(o)]):null;if(s!=null&&s.length)s.forEach(o=>{r.push(`[${o[0]}="${o[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const o=n.className;if(o&&Ys(o)){const l=o.split(/\s+/);for(const d of l)r.push(`.${d}`)}}for(const o of["aria-label","type","name","title","alt"]){const l=n.getAttribute(o);l&&r.push(`[${o}="${l}"]`)}return r.join("")}function rh(){try{return Jx.document.location.href}catch{return""}}function zC(t,e=5){if(!Jx.HTMLElement)return null;let n=t;for(let r=0;r<e;r++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}function Kr(t,e,n){if(!(e in t))return;const r=t[e];if(typeof r!="function")return;const s=n(r);typeof s=="function"&&BC(s,r);try{t[e]=s}catch{$e&&je.log(`Failed to replace method "${e}" in object`,t)}}function Ir(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{$e&&je.log(`Failed to add non-enumerable property "${String(e)}" to object`,t)}}function BC(t,e){try{const n=e.prototype||{};t.prototype=e.prototype=n,Ir(t,"__sentry_original__",e)}catch{}}function Xx(t){return t.__sentry_original__}function HC(t){if(th(t))return{message:t.message,name:t.name,stack:t.stack,...Vj(t)};if(Pm(t)){const e={type:t.type,target:Gj(t.target),currentTarget:Gj(t.currentTarget),...Vj(t)};return typeof CustomEvent<"u"&&Qs(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function Gj(t){try{return JF(t)?tr(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function Vj(t){return typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t)):{}}function t6(t){const e=Object.keys(HC(t));return e.sort(),e[0]?e.join(", "):"[object has no keys]"}let zl;function ih(t){if(zl!==void 0)return zl?zl(t):t();const e=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=ut;return e in n&&typeof n[e]=="function"?(zl=n[e],zl(t)):(zl=null,t())}function Fa(){return ih(()=>Math.random())}function sh(){return ih(()=>Date.now())}function Mb(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function Wj(t,e){if(!Array.isArray(t))return"";const n=[];for(let r=0;r<t.length;r++){const s=t[r];try{UC(s)?n.push(MC(s)):n.push(String(s))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function ud(t,e,n=!1){return Ys(t)?XF(e)?e.test(t):Ys(e)?n?t===e:t.includes(e):typeof e=="function"?e(t):!1:!1}function Ks(t,e=[],n=!1){for(const r of e)if(ud(t,r,n))return!0;return!1}function n6(){const t=ut;return t.crypto||t.msCrypto}let n0;function r6(){return Fa()*16}function xi(t=n6()){try{if(t!=null&&t.randomUUID)return ih(()=>t.randomUUID()).replace(/-/g,"")}catch{}return n0||(n0="10000000100040008000"+1e11),n0.replace(/[018]/g,e=>(e^(r6()&15)>>e/4).toString(16))}function qC(t){var e,n;return(n=(e=t.exception)==null?void 0:e.values)==null?void 0:n[0]}function To(t){const{message:e,event_id:n}=t;if(e)return e;const r=qC(t);return r?r.type&&r.value?`${r.type}: ${r.value}
154`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Lb(t,e,n){const r=t.exception=t.exception||{},s=r.values=r.values||[],o=s[0]=s[0]||{};o.value||(o.value=e||""),o.type||(o.type="Error")}function Do(t,e){const n=qC(t);if(!n)return;const r={type:"generic",handled:!0},s=n.mechanism;if(n.mechanism={...r,...s,...e},e&&"data"in e){const o={...s==null?void 0:s.data,...e.data};n.mechanism.data=o}}function Yj(t){if(i6(t))return!0;try{Ir(t,"__sentry_captured__",!0)}catch{}return!1}function i6(t){try{return t.__sentry_captured__}catch{}}const GC=1e3;function qo(){return sh()/GC}function s6(){const{performance:t}=ut;if(!(t!=null&&t.now)||!t.timeOrigin)return qo;const e=t.timeOrigin;return()=>(e+ih(()=>t.now()))/GC}let Kj;function Bn(){return(Kj??(Kj=s6()))()}let r0=null;function a6(){var l;const{performance:t}=ut;if(!(t!=null&&t.now))return;const e=3e5,n=ih(()=>t.now()),r=sh(),s=t.timeOrigin;if(typeof s=="number"&&Math.abs(s+n-r)<e)return s;const o=(l=t.timing)==null?void 0:l.navigationStart;return typeof o=="number"&&Math.abs(o+n-r)<e?o:r-n}function cr(){return r0===null&&(r0=a6()),r0}function o6(t){const e=Bn(),n={sid:xi(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>c6(n)};return t&&Sc(n,t),n}function Sc(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||Bn(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:xi()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function l6(t,e){let n={};t.status==="ok"&&(n={status:"exited"}),Sc(t,n)}function c6(t){return{sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}}}function ah(t,e,n=2){if(!e||typeof e!="object"||n<=0)return e;if(t&&Object.keys(e).length===0)return t;const r={...t};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=ah(r[s],e[s],n-1));return r}function ea(){return xi()}function Js(){return xi().substring(16)}const Pb="_sentrySpan";function Dd(t,e){e?Ir(t,Pb,e):delete t[Pb]}function lm(t){return t[Pb]}const u6=100;class ss{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:ea(),sampleRand:Fa()}}clone(){const e=new ss;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._attributes={...this._attributes},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,e._conversationId=this._conversationId,Dd(e,lm(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Sc(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this.setTags({[e]:n})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,n){return this.setAttributes({[e]:n})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...this._extra,[e]:n},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const n=typeof e=="function"?e(this):e,r=n instanceof ss?n.getScopeData():Od(n)?e:void 0,{tags:s,attributes:o,extra:l,user:d,contexts:h,level:p,fingerprint:g=[],propagationContext:m,conversationId:y}=r||{};return this._tags={...this._tags,...s},this._attributes={...this._attributes,...o},this._extra={...this._extra,...l},this._contexts={...this._contexts,...h},d&&Object.keys(d).length&&(this._user=d),p&&(this._level=p),g.length&&(this._fingerprint=g),m&&(this._propagationContext=m),y&&(this._conversationId=y),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,Dd(this,void 0),this._attachments=[],this.setPropagationContext({traceId:ea(),sampleRand:Fa()}),this._notifyScopeListeners(),this}addBreadcrumb(e,n){var o;const r=typeof n=="number"?n:u6;if(r<=0)return this;const s={timestamp:qo(),...e,message:e.message?Mb(e.message,2048):e.message};return this._breadcrumbs.push(s),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),(o=this._client)==null||o.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:lm(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=ah(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){const r=(n==null?void 0:n.event_id)||xi();if(!this._client)return $e&&je.warn("No client configured on scope - will not capture exception!"),r;const s=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:s,...n,event_id:r},this),r}captureMessage(e,n,r){const s=(r==null?void 0:r.event_id)||xi();if(!this._client)return $e&&je.warn("No client configured on scope - will not capture message!"),s;const o=(r==null?void 0:r.syntheticException)??new Error(e);return this._client.captureMessage(e,n,{originalException:e,syntheticException:o,...r,event_id:s},this),s}
154captureEvent(e,n){const r=e.event_id||(n==null?void 0:n.event_id)||xi();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):($e&&je.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}function d6(){return Nc("defaultCurrentScope",()=>new ss)}function h6(){return Nc("defaultIsolationScope",()=>new ss)}const Jj=t=>t instanceof Promise&&!t[VC],VC=Symbol("chained PromiseLike"),f6=(t,e,n)=>{const r=t.then(s=>(e(s),s),s=>{throw n(s),s});return Jj(r)&&Jj(t)?r:p6(t,r)},p6=(t,e)=>{if(!e)return t;let n=!1;for(const r in t){if(r in e)continue;n=!0;const s=t[r];typeof s=="function"?Object.defineProperty(e,r,{value:(...o)=>s.apply(t,o),enumerable:!0,configurable:!0,writable:!0}):e[r]=s}return n&&Object.assign(e,{[VC]:!0}),e};class m6{constructor(e,n){let r;e?r=e:r=new ss;let s;n?s=n:s=new ss,this._stack=[{scope:r}],this._isolationScope=s}withScope(e){const n=this._pushScope();let r;try{r=e(n)}catch(s){throw this._popScope(),s}return nh(r)?f6(r,()=>this._popScope(),()=>this._popScope()):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function Ec(){const t=Bo(),e=Lm(t);return e.stack=e.stack||new m6(d6(),h6())}function g6(t){return Ec().withScope(t)}function v6(t,e){const n=Ec();return n.withScope(()=>(n.getStackTop().scope=t,e(t)))}function Xj(t){return Ec().withScope(()=>t(Ec().getIsolationScope()))}function y6(){return{withIsolationScope:Xj,withScope:g6,withSetScope:v6,withSetIsolationScope:(t,e)=>Xj(e),getCurrentScope:()=>Ec().getScope(),getIsolationScope:()=>Ec().getIsolationScope()}}function Cc(t){const e=Lm(t);return e.acs?e.acs:y6()}function b6(t){return typeof t=="object"&&t!=null&&!Array.isArray(t)&&Object.keys(t).includes("value")}function x6(t,e){const{value:n,unit:r}=b6(t)?t:{value:t,unit:void 0},s=_6(n),o=r&&typeof r=="string"?{unit:r}:{};if(s)return{...s,...o};if(!e||e==="skip-undefined"&&n===void 0)return;let l="";try{l=JSON.stringify(n)??""}catch{}return{value:l,type:"string",...o}}function Zj(t,e=!1){const n={};for(const[r,s]of Object.entries(t??{})){const o=x6(s,e);o&&(n[r]=o)}return n}function _6(t){if(Array.isArray(t))return{value:t,type:"array"};const e=typeof t=="string"?"string":typeof t=="boolean"?"boolean":typeof t=="number"&&!Number.isNaN(t)?Number.isInteger(t)?"integer":"double":null;if(e)return{value:t,type:e}}function Dt(){const t=Bo();return Cc(t).getCurrentScope()}function Hi(){const t=Bo();return Cc(t).getIsolationScope()}function w6(){return Nc("globalScope",()=>new ss)}function oh(...t){const e=Bo(),n=Cc(e);if(t.length===2){const[r,s]=t;return r?n.withSetScope(r,s):n.withScope(s)}return n.withScope(t[0])}function yt(){return Dt().getClient()}function S6(t){const e=t.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:s}=e,o={trace_id:n,span_id:s||Js()};return r&&(o.parent_span_id=r),o}const Ws="sentry.source",Zx="sentry.sample_rate",WC="sentry.previous_trace_sample_rate",Si="sentry.op",Dn="sentry.origin",Id="sentry.idle_span_finish_reason",lh="sentry.measurement_unit",ch="sentry.measurement_value",Qj="sentry.custom_span_name",Qx="sentry.profile_id",Va="sentry.exclusive_time",E6="sentry.link.type",k6="gen_ai.conversation.id",YC=0,Fm=1,Gn=2;function j6(t){if(t<400&&t>=100)return{code:Fm};if(t>=400&&t<500)switch(t){case 401:return{code:Gn,message:"unauthenticated"};case 403:return{code:Gn,message:"permission_denied"};case 404:return{code:Gn,message:"not_found"};case 409:return{code:Gn,message:"already_exists"};case 413:return{code:Gn,message:"failed_precondition"};case 429:return{code:Gn,message:"resource_exhausted"};case 499:return{code:Gn,message:"cancelled"};default:return{code:Gn,message:"invalid_argument"}}if(t>=500&&t<600)switch(t){case 501:return{code:Gn,message:"unimplemented"};case 503:return{code:Gn,message:"unavailable"};case 504:return{code:Gn,message:"deadline_exceeded"};default:return{code:Gn,message:"internal_error"}}return{code:Gn,message:"internal_error"}}function KC(t,e){t.setAttribute("http.response.status_code",e);const n=j6(e);n.message!=="unknown_error"&&t.setStatus(n)}function T6(t){try{const e=ut.WeakRef;if(typeof e=="function")return new e(t)}catch{}return t}function N6(t){if(t){if(typeof t=="object"&&"deref"in t&&typeof t.deref=="function")try{return t.deref()}catch{return}return t}}const JC="_sentryScope",XC="_sentryIsolationScope";function A6(t,e,n){t&&(Ir(t,XC,T6(n)),Ir(t,JC,e))}function cm(t){const e=t;return{scope:e[JC],isolationScope:N6(e[XC])}}const um="sentry-",C6=8192;function ZC(t){const e=O6(t);if(!e)return;const n=Object.entries(e).reduce((r,[s,o])=>{if(s.startsWith(um)){const l=s.slice(um.length);r[l]=o}return r},{});if(Object.keys(n).length>0)return n}function R6(t){if(!t)return;const e=Object.entries(t).reduce((n,[r,s])=>(s&&(n[`${um}${r}`]=s),n),{});return D6(e)}function O6(t){if(!(!t||!Ys(t)&&!Array.isArray(t)))return Array.isArray(t)?t.reduce((e,n)=>{const r=eT(n);return Object.entries(r).forEach(([s,o])=>{e[s]=o}),e},{}):eT(t)}function eT(t){return t.split(",").map(e=>{const n=e.indexOf("=");if(n===-1)return[];const r=e.slice(0,n),s=e.slice(n+1);return[r,s].map(o=>{try{return decodeURIComponent(o.trim())}catch{return}})}).reduce((e,[n,r])=>(n&&r&&(e[n]=r),e),{})}function D6(t){if(Object.keys(t).length!==0)return Object.entries(t).reduce((e,[n,r],s)=>{const o=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,l=s===0?o:`${e},${o}`;return l.length>C6?($e&&je.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),e):l},"")}const I6=/^o(\d+)\./,M6=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function L6(t){return t==="http"||t==="https"}function Go(t,e=!1){const{host:n,path:r,pass:s,port:o,projectId:l,protocol:d,publicKey:h}=t;return`${d}://${h}${e&&s?`:${s}`:""}@${n}${o?`:${o}`:""}/${r&&`${r}/`}${l}`}function P6(t){const e=M6.exec(t);if(!e){Ho(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}const[n,r,s="",o="",l="",d=""]=e.slice(1);let h="",p=d;const g=p.split("/");if(g.length>1&&(h=g.slice(0,-1).join("/"),p=g.pop()),p){const m=p.match(/^\d+/);m&&(p=m[0])}return QC({host:o,pass:s,path:h,projectId:p,port:l,protocol:n,publicKey:r})}function QC(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function F6(t){if(!$e)return!0;const{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(l=>t[l]?!1:(je.error(`Invalid Sentry Dsn: ${l} missing`),!0))?!1:n.match(/^\d+$/)?L6(r)?e&&isNaN(parseInt(e,10))?(je.error(`Invalid Sentry Dsn: Invalid port ${e}
154`),!1):!0:(je.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(je.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function $6(t){const e=t.match(I6);return e==null?void 0:e[1]}function U6(t){const e=t.getOptions(),{host:n}=t.getDsn()||{};let r;return e.orgId?r=String(e.orgId):n&&(r=$6(n)),r}function eR(t){const e=typeof t=="string"?P6(t):QC(t);if(!(!e||!F6(e)))return e}function Md(t){if(typeof t=="boolean")return Number(t);const e=typeof t=="string"?parseFloat(t):t;if(!(typeof e!="number"||isNaN(e)||e<0||e>1))return e}const tR=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function z6(t){if(!t)return;const e=t.match(tR);if(!e)return;let n;return e[3]==="1"?n=!0:e[3]==="0"&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}function B6(t,e){const n=z6(t),r=ZC(e);if(!(n!=null&&n.traceId))return{traceId:ea(),sampleRand:Fa()};const s=H6(n,r);r&&(r.sample_rand=s.toString());const{traceId:o,parentSpanId:l,parentSampled:d}=n;return{traceId:o,parentSpanId:l,sampled:d,dsc:r||{},sampleRand:s}}function nR(t=ea(),e=Js(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${t}-${e}${r}`}function rR(t=ea(),e=Js(),n){return`00-${t}-${e}-${n?"01":"00"}`}function H6(t,e){const n=Md(e==null?void 0:e.sample_rand);if(n!==void 0)return n;const r=Md(e==null?void 0:e.sample_rate);return r&&(t==null?void 0:t.parentSampled)!==void 0?t.parentSampled?Fa()*r:r+Fa()*(1-r):Fa()}const iR=0,$m=1;let tT=!1;function q6(t){const{spanId:e,traceId:n}=t.spanContext(),{data:r,op:s,parent_span_id:o,status:l,origin:d,links:h}=Tt(t);return{parent_span_id:o,span_id:e,trace_id:n,data:r,op:s,status:l,origin:d,links:h}}function G6(t){const{spanId:e,traceId:n,isRemote:r}=t.spanContext(),s=r?e:Tt(t).parent_span_id,o=cm(t).scope,l=r?(o==null?void 0:o.getPropagationContext().propagationSpanId)||Js():e;return{parent_span_id:s,span_id:l,trace_id:n}}function V6(t){const{traceId:e,spanId:n}=t.spanContext(),r=Wa(t);return nR(e,n,r)}function W6(t){const{traceId:e,spanId:n}=t.spanContext(),r=Wa(t);return rR(e,n,r)}function sR(t){if(t&&t.length>0)return t.map(({context:{spanId:e,traceId:n,traceFlags:r,...s},attributes:o})=>({span_id:e,trace_id:n,sampled:r===$m,attributes:o,...s}))}function aR(t){if(t!=null&&t.length)return t.map(({context:{spanId:e,traceId:n,traceFlags:r},attributes:s})=>({span_id:e,trace_id:n,sampled:r===$m,attributes:s}))}function Xs(t){return typeof t=="number"?nT(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?nT(t.getTime()):Bn()}function nT(t){return t>9999999999?t/1e3:t}function Tt(t){if(uR(t))return t.getSpanJSON();const{spanId:e,traceId:n}=t.spanContext();if(cR(t)){const{attributes:r,startTime:s,name:o,endTime:l,status:d,links:h}=t;return{span_id:e,trace_id:n,data:r,description:o,parent_span_id:lR(t),start_timestamp:Xs(s),timestamp:Xs(l)||void 0,status:dR(d),op:r[Si],origin:r[Dn],links:sR(h)}}return{span_id:e,trace_id:n,start_timestamp:0,data:{}}}function oR(t){if(uR(t))return t.getStreamedSpanJSON();const{spanId:e,traceId:n}=t.spanContext();if(cR(t)){const{attributes:r,startTime:s,name:o,endTime:l,status:d,links:h}=t;return{name:o,span_id:e,trace_id:n,parent_span_id:lR(t),start_timestamp:Xs(s),end_timestamp:Xs(l),is_segment:t===$b(t),status:hR(d),attributes:r,links:aR(h)}}return{span_id:e,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:t===$b(t)}}function lR(t){var e;return"parentSpanId"in t?t.parentSpanId:"parentSpanContext"in t?(e=t.parentSpanContext)==null?void 0:e.spanId:void 0}function Y6(t){var e;return{...t,attributes:Zj(t.attributes),links:(e=t.links)==null?void 0:e.map(n=>({...n,attributes:Zj(n.attributes)}))}}function cR(t){const e=t;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function uR(t){return typeof t.getSpanJSON=="function"}function Wa(t){const{traceFlags:e}=t.spanContext();return e===$m}
154function dR(t){if(!(!t||t.code===YC))return t.code===Fm?"ok":t.message||"internal_error"}function hR(t){return!t||t.code===Fm||t.code===YC||t.message==="cancelled"?"ok":"error"}const Io="_sentryChildSpans",Fb="_sentryRootSpan";function fR(t,e){const n=t[Fb]||t;Ir(e,Fb,n),t[Io]?t[Io].add(e):Ir(t,Io,new Set([e]))}function K6(t,e){t[Io]&&t[Io].delete(e)}function xp(t){const e=new Set;function n(r){if(!e.has(r)&&Wa(r)){e.add(r);const s=r[Io]?Array.from(r[Io]):[];for(const o of s)n(o)}}return n(t),Array.from(e)}const lr=$b;function $b(t){return t[Fb]||t}function Qr(){const t=Bo(),e=Cc(t);return e.getActiveSpan?e.getActiveSpan():lm(Dt())}function Ub(){tT||(Ho(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),tT=!0)}let rT=!1;function J6(){if(rT)return;function t(){const e=Qr(),n=e&&lr(e);if(n){const r="internal_error";$e&&je.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:Gn,message:r})}}t.tag="sentry_tracingErrorCallback",rT=!0,LC(t),PC(t)}function Ui(t){var n;if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const e=t||((n=yt())==null?void 0:n.getOptions());return!!e&&(e.tracesSampleRate!=null||!!e.tracesSampler)}function iT(t){je.log(`Ignoring span ${t.op} - ${t.description} because it matches \`ignoreSpans\`.`)}function Ld(t,e){if(!(e!=null&&e.length))return!1;for(const n of e){if(Q6(n)){if(t.description&&ud(t.description,n))return $e&&iT(t),!0;continue}const r=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!r)continue;const s=n.name?t.description&&ud(t.description,n.name):!0,o=n.op?t.op&&ud(t.op,n.op):!0,l=n.attributes?Object.entries(n.attributes).every(([d,h])=>{var p;return X6((p=t.attributes)==null?void 0:p[d],h)}):!0;if(s&&o&&l)return $e&&iT(t),!0}return!1}function X6(t,e){return typeof t=="string"&&(typeof e=="string"||e instanceof RegExp)?ud(t,e):Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((n,r)=>n===e[r]):t===e}function Z6(t,e){const n=e.parent_span_id,r=e.span_id;if(n)for(const s of t)s.parent_span_id===r&&(s.parent_span_id=n)}function Q6(t){return typeof t=="string"||t instanceof RegExp}const e_="production",pR="_frozenDsc";function _p(t,e){Ir(t,pR,e)}function mR(t,e){const n=e.getOptions(),{publicKey:r}=e.getDsn()||{},s={environment:n.environment||e_,release:n.release,public_key:r,trace_id:t,org_id:U6(e)};return e.emit("createDsc",s),s}function gR(t,e){const n=e.getPropagationContext();return n.dsc||mR(n.traceId,t)}function Ba(t){var _;const e=yt();if(!e)return{};const n=lr(t),r=Tt(n),s=r.data,o=n.spanContext().traceState,l=(o==null?void 0:o.get("sentry.sample_rate"))??s[Zx]??s[WC];function d(w){return(typeof l=="number"||typeof l=="string")&&(w.sample_rate=`${l}`),w}const h=n[pR];if(h)return d(h);const p=o==null?void 0:o.get("sentry.dsc"),g=p&&ZC(p);if(g)return d(g);const m=mR(t.spanContext().traceId,e),y=s[Ws]??s["sentry.span.source"],b=r.description;return y!=="url"&&b&&(m.transaction=b),Ui()&&(m.sampled=String(Wa(n)),m.sample_rand=(o==null?void 0:o.get("sentry.sample_rand"))??((_=cm(n).scope)==null?void 0:_.getPropagationContext().sampleRand.toString())),d(m),e.emit("createDsc",m,n),m}class ns{constructor(e={}){this._traceId=e.traceId||ea(),this._spanId=e.spanId||Js(),this.dropReason=e.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:iR}}end(e){}setAttribute(e,n){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,n,r){return this}addLink(e){return this}addLinks(e){return this}recordException(e,n){}}function vR(t){return!!t&&typeof t=="function"&&"_streamed"in t&&!!t._streamed}const e$=Symbol.for("sentry.skipNormalization"),t$=Symbol.for("sentry.overrideNormalizationDepth");function n$(t){return!!t[e$]}function r$(t){const e=t[t$];return typeof e=="number"?e:void 0}function zs(t,e=100,n=1/0){try{return zb("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function yR(t,e=3,n=100*1024){const r=zs(t,e);return o$(r)>n?yR(t,e-1,n):r}function zb(t,e,n=1/0,r=1/0,s=l$()){const[o,l]=s;if(e==null||["boolean","string"].includes(typeof e)||typeof e=="number"&&Number.isFinite(e))return e;const d=i$(t,e);if(!d.startsWith("[object "))return d;if(n$(e))return e;const h=r$(e),p=h!==void 0?h:n;if(p===0)return d.replace("object ","");if(o(e))return"[Circular ~]";const g=e;if(g&&typeof g.toJSON=="function")try{const _=g.toJSON();return zb("",_,p-1,r,s)}catch{}const m=Array.isArray(e)?[]:{};let y=0;const b=HC(e);for(const _ in b){if(!Object.prototype.hasOwnProperty.call(b,_))continue;if(y>=r){m[_]="[MaxProperties ~]";break}const w=b[_];m[_]=zb(_,w,p-1,r,s),y++}
154return l(e),m}function i$(t,e){try{if(t==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(t==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&e===global)return"[Global]";if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(UC(e))return MC(e);if(ZF(e))return"[SyntheticEvent]";if(typeof e=="number"&&!Number.isFinite(e))return`[${e}]`;if(typeof e=="function")return`[Function: ${Zs(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;const n=s$(e);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function s$(t){const e=Object.getPrototypeOf(t);return e!=null&&e.constructor?e.constructor.name:"null prototype"}function a$(t){return~-encodeURI(t).split(/%..|./).length}function o$(t){return a$(JSON.stringify(t))}function l$(){const t=new WeakSet;function e(r){return t.has(r)?!0:(t.add(r),!1)}function n(r){t.delete(r)}return[e,n]}function Vo(t,e=[]){return[t,e]}function sT(t,e){const[n,r]=t;return[n,[...r,e]]}function Bb(t,e){const n=t[1];for(const r of n){const s=r[0].type;if(e(r,s))return!0}return!1}function c$(t,e){return Bb(t,(n,r)=>e.includes(r))}function Hb(t){const e=Lm(ut);return e.encodePolyfill?e.encodePolyfill(t):new TextEncoder().encode(t)}function u$(t){const[e,n]=t;let r=JSON.stringify(e);function s(o){typeof r=="string"?r=typeof o=="string"?r+o:[Hb(r),o]:r.push(typeof o=="string"?Hb(o):o)}for(const o of n){const[l,d]=o;if(s(`
155${JSON.stringify(l)}
156`),typeof d=="string"||d instanceof Uint8Array)s(d);else{let h;try{h=JSON.stringify(d)}catch{h=JSON.stringify(zs(d))}s(h)}}return typeof r=="string"?r:d$(r)}function d$(t){const e=t.reduce((s,o)=>s+o.length,0),n=new Uint8Array(e);let r=0;for(const s of t)n.set(s,r),r+=s.length;return n}function h$(t){return[{type:"span"},t]}function f$(t){const e=typeof t.data=="string"?Hb(t.data):t.data;return[{type:"attachment",length:e.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType},e]}const bR={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function p$(t){return t in bR}function aT(t){return p$(t)?bR[t]:t}function xR(t){if(!(t!=null&&t.sdk))return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}function m$(t,e,n,r){var o;const s=(o=t.sdkProcessingMetadata)==null?void 0:o.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date().toISOString(),...e&&{sdk:e},...!!n&&r&&{dsn:Go(r)},...s&&{trace:s}}}function g$(t,e){var r,s,o,l;if(!e)return t;const n=t.sdk||{};return t.sdk={...n,name:n.name||e.name,version:n.version||e.version,integrations:[...((r=t.sdk)==null?void 0:r.integrations)||[],...e.integrations||[]],packages:[...((s=t.sdk)==null?void 0:s.packages)||[],...e.packages||[]],settings:(o=t.sdk)!=null&&o.settings||e.settings?{...(l=t.sdk)==null?void 0:l.settings,...e.settings}:void 0},t}function v$(t,e,n,r){const s=xR(n),o={sent_at:new Date().toISOString(),...s&&{sdk:s},...!!r&&e&&{dsn:Go(e)}},l="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return Vo(o,[l])}function y$(t,e,n,r){const s=xR(n),o=t.type&&t.type!=="replay_event"?t.type:"event";g$(t,n==null?void 0:n.sdk);const l=m$(t,s,r,e);return delete t.sdkProcessingMetadata,Vo(l,[[{type:o},t]])}function b$(t,e){function n(b){return!!b.trace_id&&!!b.public_key}const r=Ba(t[0]),s=e==null?void 0:e.getDsn(),o=e==null?void 0:e.getOptions().tunnel,l={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!o&&s&&{dsn:Go(s)}},{beforeSendSpan:d,ignoreSpans:h}=(e==null?void 0:e.getOptions())||{},p=h!=null&&h.length?t.filter(b=>{const _=Tt(b);return!Ld({description:_.description,op:_.op,attributes:_.data},h)}):t,g=t.length-p.length;g&&(e==null||e.recordDroppedEvent("before_send","span",g));const m=d?b=>{const _=Tt(b),w=vR(d)?_:d(_);return w||(Ub(),_)}:Tt,y=[];for(const b of p){const _=m(b);_&&y.push(h$(_))}return Vo(l,y)}function x$(t){if(!$e)return;const{description:e="< unknown name >",op:n="< unknown op >",parent_span_id:r}=Tt(t),{spanId:s}=t.spanContext(),o=Wa(t),l=lr(t),d=l===t,h=`[Tracing] Starting ${o?"sampled":"unsampled"} ${d?"root ":""}span`,p=[`op: ${n}`,`name: ${e}`,`ID: ${s}`];if(r&&p.push(`parent ID: ${r}`),!d){const{op:g,description:m}=Tt(l);p.push(`root ID: ${l.spanContext().spanId}`),g&&p.push(`root op: ${g}`),m&&p.push(`root description: ${m}`)}je.log(`${h}
157  ${p.join(`
158  `)}`)}function _$(t){if(!$e)return;const{description:e="< unknown name >",op:n="< unknown op >"}=Tt(t),{spanId:r}=t.spanContext(),o=lr(t)===t,l=`[Tracing] Finishing "${n}" ${o?"root ":""}span "${e}" with ID ${r}`;je.log(l)}function w$(t,e,n,r=Qr()){const s=r&&lr(r);s&&($e&&je.log(`[Measurement] Setting measurement on root span: ${t} = ${e} ${n}`),s.addEvent(t,{[ch]:e,[lh]:n}))}function oT(t){if(!t||t.length===0)return;const e={};return t.forEach(n=>{const r=n.attributes||{}
158,s=r[lh],o=r[ch];typeof s=="string"&&typeof o=="number"&&(e[n.name]={value:o,unit:s})}),e}function as(t){return t.getOptions().traceLifecycle==="stream"}const lT=1e3;class Um{constructor(e={}){this._traceId=e.traceId||ea(),this._spanId=e.spanId||Js(),this._startTime=e.startTimestamp||Bn(),this._links=e.links,this._attributes={},this.setAttributes({[Dn]:"manual",[Si]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this._links?this._links.push(e):this._links=[e],this}addLinks(e){return this._links?this._links.push(...e):this._links=e,this}recordException(e,n){}spanContext(){const{_spanId:e,_traceId:n,_sampled:r}=this;return{spanId:e,traceId:n,traceFlags:r?$m:iR}}setAttribute(e,n){return n===void 0?delete this._attributes[e]:this._attributes[e]=n,this}setAttributes(e){return Object.keys(e).forEach(n=>this.setAttribute(n,e[n])),this}updateStartTime(e){this._startTime=Xs(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,this.setAttribute(Ws,"custom"),this}end(e){this._endTime||(this._endTime=Xs(e),_$(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[Si],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:dR(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[Dn],profile_id:this._attributes[Qx],exclusive_time:this._attributes[Va],measurements:oT(this._events),is_segment:this._isStandaloneSpan&&lr(this)===this||void 0,segment_id:this._isStandaloneSpan?lr(this).spanContext().spanId:void 0,links:sR(this._links)}}getStreamedSpanJSON(){return{name:this._name??"",span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===lr(this),status:hR(this._status),attributes:this._attributes,links:aR(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,n,r){$e&&je.log("[Tracing] Adding an event to span:",e);const s=cT(n)?n:r||Bn(),o=cT(n)?{}:n||{},l={name:e,time:Xs(s),attributes:o};return this._events.push(l),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const e=yt();if(e&&(e.emit("spanEnd",this),this._isStandaloneSpan||e.emit("afterSpanEnd",this)),!(this._isStandaloneSpan||this===lr(this)))return;if(this._isStandaloneSpan){this._sampled?E$(b$([this],e)):($e&&je.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),e&&e.recordDroppedEvent("sample_rate","span"));return}else if(e&&as(e)){e.emit("afterSegmentSpanEnd",this);return}const r=this._convertSpanToTransaction();r&&(cm(this).scope||Dt()).captureEvent(r)}_convertSpanToTransaction(){var m;if(!uT(Tt(this)))return;this._name||($e&&je.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:e,isolationScope:n}=cm(this),r=(m=e==null?void 0:e.getScopeData().sdkProcessingMetadata)==null?void 0:m.normalizedRequest;if(this._sampled!==!0)return;const o=xp(this).filter(y=>y!==this&&!S$(y)).map(y=>Tt(y)).filter(uT),l=this._attributes[Ws];delete this._attributes[Qj];let d=!1;o.forEach(y=>{var b;delete y.data[Qj],(b=y.op)!=null&&b.startsWith("gen_ai.")&&(d=!0)});const h={contexts:{trace:q6(this)},spans:o.length>lT?o.sort((y,b)=>y.start_timestamp-b.start_timestamp).slice(0,lT):o,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:e,capturedSpanIsolationScope:n,dynamicSamplingContext:Ba(this),hasGenAiSpans:d},request:r,...l&&{transaction_info:{source:l}}},p=oT(this._events);return p&&Object.keys(p).length&&($e&&je.log("[Measurements] Adding measurements to transaction event",JSON.stringify(p,void 0,2)),h.measurements=p),h}}function cT(t){return t&&typeof t=="number"||t instanceof Date||Array.isArray(t)}function uT(t){return!!t.start_timestamp&&!!t.timestamp&&!!t.span_id&&!!t.trace_id}function S$(t){return t instanceof Um&&t.isStandaloneSpan()}function E$(t){const e=yt();if(!e)return;const n=t[1];if(!n||n.length===0){e.recordDroppedEvent("before_send","span");return}e.sendEnvelope(t)}function k$(t,e,n){if(!Ui(t))return[!1];let r,s;typeof t.tracesSampler=="function"?(s=t.tracesSampler({...e,inheritOrSampleWith:d=>typeof e.parentSampleRate=="number"?e.parentSampleRate:typeof e.parentSampled=="boolean"?Number(e.parentSampled):d}),r=!0):e.parentSampled!==void 0?s=e.parentSampled:typeof t.tracesSampleRate<"u"&&(s=t.tracesSampleRate,r=!0);const o=Md(s);if(o===void 0)return $e&&je.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(s)} of type ${JSON.stringify(typeof s)}.`),[!1];if(!o)return $e&&je.log(`[Tracing] Discarding transaction because ${typeof t.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,o,r];const l=n<o;return l||$e&&je.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(s)})`),[l,o,r]}const j$="__SENTRY_SUPPRESS_TRACING__";function Ya(t){const e=wR();if(e.startInactiveSpan)return e.startInactiveSpan(t);const n=N$(t),{forceTransaction:r,parentSpan:s}=t;return(t.scope?l=>oh(t.scope,l):s!==void 0?l=>_R(s,l):l=>l())(()=>{const l=Dt(),d=C$(l,s),h=yt();return t.onlyIfParent&&!d?(h==null||h.recordDroppedEvent("no_parent_span","span"),new ns):T$({parentSpan:d,spanArguments:n,forceTransaction:r,scope:l})})}function _R(t,e){const n=wR();return n.withActiveSpan?n.withActiveSpan(t,e):oh(r=>(Dd(r,t||void 0),e(r)))}function T$({parentSpan:t,spanArguments:e,forceTransaction:n,scope:r}){if(!Ui()){const d=new ns;if(n||!t){const h={sampled:"false",sample_rate:"0",transaction:e.name,...Ba(d)};_p(d,h)}return d}const s=yt();if(R$(s,e))return t_(r)||s==null||s.recordDroppedEvent("ignored","span"),new ns({dropReason:"ignored",traceId:(t==null?void 0:t.spanContext().traceId)??r.getPropagationContext().traceId});const o=Hi();let l;if(t&&!n)l=A$(t,r,e),fR(t,l);else if(t){const d=Ba(t),{traceId:h,spanId:p}=t.spanContext(),g=Wa(t);l=dT({traceId:h,parentSpanId:p,...e},r,g),_p(l,d)}else{const{traceId:d,dsc:h,parentSpanId:p,sampled:g}={...o.getPropagationContext(),...r.getPropagationContext()};l=dT({traceId:d,parentSpanId:p,...e},r,g),h&&_p(l,h)}return x$(l),A6(l,r,o),l}function N$(t){const n={isStandalone:(t.experimental||{}).standalone,...t};if(t.startTime){const r={...n};return r.startTimestamp=Xs(t.startTime),delete r.startTime,r}return n}function wR(){const t=Bo();return Cc(t)}function dT(t,e,n){var w;const r=yt(),s=(r==null?void 0:r.getOptions())||{},{name:o=""}=t,l={spanAttributes:{...t.attributes},spanName:o,parentSampled:n};r==null||r.emit("beforeSampling",l,{decision:!1});const d=l.parentSampled??n,h=l.spanAttributes,p=e.getPropagationContext(),g=t_(e),[m,y,b]=g?[!1]:k$(s,{name:o,parentSampled:d,attributes:h,parentSampleRate:
158Md((w=p.dsc)==null?void 0:w.sample_rate)},p.sampleRand),_=new Um({...t,attributes:{[Ws]:"custom",[Zx]:y!==void 0&&b?y:void 0,...h},sampled:m});return!m&&r&&!g&&($e&&je.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate",as(r)?"span":"transaction")),r&&r.emit("spanStart",_),_}function A$(t,e,n){const{spanId:r,traceId:s}=t.spanContext(),o=t_(e),l=o?!1:Wa(t),d=l?new Um({...n,parentSpanId:r,traceId:s,sampled:l}):new ns({traceId:s});fR(t,d);const h=yt();return h&&(as(h)&&d instanceof ns&&(t instanceof ns&&t.dropReason?(d.dropReason=t.dropReason,h.recordDroppedEvent(t.dropReason,"span")):o||(d.dropReason="sample_rate",h.recordDroppedEvent("sample_rate","span"))),h.emit("spanStart",d),n.endTimestamp&&(h.emit("spanEnd",d),h.emit("afterSpanEnd",d))),d}function C$(t,e){if(e)return e;if(e===null)return;const n=lm(t);if(!n)return;const r=yt();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?lr(n):n}function R$(t,e){var r;const n=t==null?void 0:t.getOptions().ignoreSpans;return!t||!as(t)||!(n!=null&&n.length)?!1:Ld({description:e.name||"",op:((r=e.attributes)==null?void 0:r[Si])||e.op,attributes:e.attributes},n)}function t_(t){return t.getScopeData().sdkProcessingMetadata[j$]===!0}const wp={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},O$="heartbeatFailed",D$="idleTimeout",I$="finalTimeout",M$="externalFinish";function SR(t,e={}){const n=new Map;let r=!1,s,o=M$,l=!e.disableAutoFinish;const d=[],{idleTimeout:h=wp.idleTimeout,finalTimeout:p=wp.finalTimeout,childSpanTimeout:g=wp.childSpanTimeout,beforeSpanEnd:m,trimIdleSpanEndTimestamp:y=!0}=e,b=yt();if(!b||!Ui()){const F=new ns,R={sample_rate:"0",sampled:"false",...Ba(F)};return _p(F,R),F}const _=Dt(),w=Qr(),S=L$(t);S.end=new Proxy(S.end,{apply(F,R,B){if(m&&m(S),R instanceof ns)return;const[M,...V]=B,W=M||Bn(),Q=Xs(W),K=xp(S).filter(U=>U!==S),te=Tt(S);if(!K.length||!y)return D(Q),Reflect.apply(F,R,[Q,...V]);const I=b.getOptions().ignoreSpans,H=K==null?void 0:K.reduce((U,A)=>{const $=Tt(A);return!$.timestamp||I&&Ld({description:$.description,op:$.op,attributes:$.data},I)?U:U?Math.max(U,$.timestamp):$.timestamp},void 0),G=te.start_timestamp,re=Math.min(G?G+p/1e3:1/0,Math.max(G||-1/0,Math.min(Q,H||1/0)));return D(re),Reflect.apply(F,R,[re,...V])}});function E(){s&&(clearTimeout(s),s=void 0)}function k(F){E(),s=setTimeout(()=>{!r&&n.size===0&&l&&(o=D$,S.end(F))},h)}function j(F){s=setTimeout(()=>{!r&&l&&(o=O$,S.end(F))},g)}function N(F){E(),n.set(F,!0);const R=Bn();j(R+g/1e3)}function O(F){if(n.has(F)&&n.delete(F),n.size===0){const R=Bn();k(R+h/1e3)}}function D(F){r=!0,n.clear(),d.forEach(K=>K()),Dd(_,w);const R=Tt(S),{start_timestamp:B}=R;if(!B)return;R.data[Id]||S.setAttribute(Id,o);const V=R.status;(!V||V==="unknown")&&S.setStatus({code:Fm}),je.log(`[Tracing] Idle span "${R.op}" finished`);const W=xp(S).filter(K=>K!==S);let Q=0;W.forEach(K=>{K.isRecording()&&(K.setStatus({code:Gn,message:"cancelled"}),K.end(F),$e&&je.log("[Tracing] Cancelling span since span ended early",JSON.stringify(K,void 0,2)));const te=Tt(K),{timestamp:I=0,start_timestamp:H=0}=te,G=H<=F,re=(p+h)/1e3,U=I-H<=re;if($e){const A=JSON.stringify(K,void 0,2);G?U||je.log("[Tracing] Discarding span since it finished after idle span final timeout",A):je.log("[Tracing] Discarding span since it happened after idle span was finished",A)}(!U||!G)&&(K6(S,K),Q++)}),Q>0&&S.setAttribute("sentry.idle_span_discarded_spans",Q)}return d.push(b.on("spanStart",F=>{if(r||F===S||Tt(F).timestamp||F instanceof Um&&F.isStandaloneSpan())return;xp(S).includes(F)&&N(F.spanContext().spanId)})),d.push(b.on("spanEnd",F=>{r||O(F.spanContext().spanId)})),d.push(b.on("idleSpanEnableAutoFinish",F=>{F===S&&(l=!0,k(),n.size&&j())})),e.disableAutoFinish||k(),setTimeout(()=>{r||(S.setStatus({code:Gn,message:"deadline_exceeded"}),o=I$,S.end())},p),S}function L$(t){const e=Ya(t);return Dd(Dt(),e),$e&&je.log("[Tracing] Started span is an idle span"),e}function P$(t,e){const{fingerprint:n,span:r,breadcrumbs:s,sdkProcessingMetadata:o}=e;F$(t,e),r&&z$(t,r),B$(t,n),$$(t,s),U$(t,o)}function hT(t,e){const{extra:n,tags:r,attributes:s,user:o,contexts:l,level:d,sdkProcessingMetadata:h,breadcrumbs:p,fingerprint:g,eventProcessors:m,attachments:y,propagationContext:b,transactionName:_,span:w}=e;
158zu(t,"extra",n),zu(t,"tags",r),zu(t,"attributes",s),zu(t,"user",o),zu(t,"contexts",l),t.sdkProcessingMetadata=ah(t.sdkProcessingMetadata,h,2),d&&(t.level=d),_&&(t.transactionName=_),w&&(t.span=w),p.length&&(t.breadcrumbs=[...t.breadcrumbs,...p]),g.length&&(t.fingerprint=[...t.fingerprint,...g]),m.length&&(t.eventProcessors=[...t.eventProcessors,...m]),y.length&&(t.attachments=[...t.attachments,...y]),t.propagationContext={...t.propagationContext,...b}}function zu(t,e,n){t[e]=ah(t[e],n,1)}function ER(t,e){const n=w6().getScopeData();return t&&hT(n,t.getScopeData()),e&&hT(n,e.getScopeData()),n}function F$(t,e){const{extra:n,tags:r,user:s,contexts:o,level:l,transactionName:d}=e;Object.keys(n).length&&(t.extra={...n,...t.extra}),Object.keys(r).length&&(t.tags={...r,...t.tags}),Object.keys(s).length&&(t.user={...s,...t.user}),Object.keys(o).length&&(t.contexts={...o,...t.contexts}),l&&(t.level=l),d&&t.type!=="transaction"&&(t.transaction=d)}function $$(t,e){const n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function U$(t,e){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...e}}function z$(t,e){t.contexts={trace:G6(e),...t.contexts},t.sdkProcessingMetadata={dynamicSamplingContext:Ba(e),...t.sdkProcessingMetadata};const n=lr(e),r=Tt(n).description;r&&!t.transaction&&t.type==="transaction"&&(t.transaction=r)}function B$(t,e){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint.length||delete t.fingerprint}const H$="thismessage:/";function kR(t){return"isRelative"in t}function n_(t,e){const n=t.indexOf("://")<=0&&t.indexOf("//")!==0,r=n?H$:void 0;try{if("canParse"in URL&&!URL.canParse(t,r))return;const s=new URL(t,r);return n?{isRelative:n,pathname:s.pathname,search:s.search,hash:s.hash}:s}catch{}}function jR(t){if(kR(t))return t.pathname;const e=new URL(t);return e.search="",e.hash="",["80","443"].includes(e.port)&&(e.port=""),e.password&&(e.password="%filtered%"),e.username&&(e.username="%filtered%"),e.toString()}function Mo(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}function q$(t){return t.split(/[?#]/,1)[0]}function rs(t,e=!0){if(t.startsWith("data:")){const n=t.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",s=t.includes(";base64,"),o=t.indexOf(",");let l="";if(e&&o!==-1){const d=t.slice(o+1);l=d.length>10?`${d.slice(0,10)}... [truncated]`:d}return`data:${r}${s?",base64":""}${l?`,${l}`:""}`}return t}function TR(t,e){const n=t.attributes??(t.attributes={});Object.entries(e).forEach(([r,s])=>{s!=null&&!(r in n)&&(n[r]=s)})}const i0=0,fT=1,pT=2;function uh(t){return new Pd(e=>{e(t)})}function r_(t){return new Pd((e,n)=>{n(t)})}class Pd{constructor(e){this._state=i0,this._handlers=[],this._runExecutor(e)}then(e,n){return new Pd((r,s)=>{this._handlers.push([!1,o=>{if(!e)r(o);else try{r(e(o))}catch(l){s(l)}},o=>{if(!n)s(o);else try{r(n(o))}catch(l){s(l)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new Pd((n,r)=>{let s,o;return this.then(l=>{o=!1,s=l,e&&e()},l=>{o=!0,s=l,e&&e()}).then(()=>{if(o){r(s);return}n(s)})})}_executeHandlers(){if(this._state===i0)return;const e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===fT&&n[1](this._value),this._state===pT&&n[2](this._value),n[0]=!0)})}_runExecutor(e){const n=(o,l)=>{if(this._state===i0){if(nh(l)){l.then(r,s);return}this._state=o,this._value=l,this._executeHandlers()}},r=o=>{n(fT,o)},s=o=>{n(pT,o)};try{e(r,s)}catch(o){s(o)}}}function G$(t,e,n,r=0){try{const s=qb(e,n,t,r);return nh(s)?s:uh(s)}catch(s){return r_(s)}}function qb(t,e,n,r){const s=n[r];if(!t||!s)return t;const o=s({...t},e);return $e&&o===null&&je.log(`Event processor "${s.id||"?"}" dropped event`),nh(o)?o.then(l=>qb(l,e,n,r+1)):qb(o,e,n,r+1)}let Is,mT,gT,Ca;function V$(t){const e=ut._sentryDebugIds,n=ut._debugIds;if(!e&&!n)return{};const r=e?Object.keys(e):[],s=n?Object.keys(n):[];if(Ca&&r.length===mT&&s.length===gT)return Ca;mT=r.length,gT=s.length,Ca={},Is||(Is={});const o=(l,d)=>{for(const h of l){const p=d[h],g=Is==null?void 0:Is[h];if(g&&Ca&&p)Ca[g[0]]=p,Is&&(Is[h]=[g[0],p]);else if(p){const m=t(h);for(let y=m.length-1;y>=0;y--){const b=m[y],_=b==null?void 0:b.filename;if(_&&Ca&&Is){Ca[_]=p,Is[h]=[_,p];break}}}}};return e&&o(r,e),n&&o(s,n),Ca}
158function W$(t,e,n,r,s,o){const{normalizeDepth:l=3,normalizeMaxBreadth:d=1e3}=t,h={...e,event_id:e.event_id||n.event_id||xi(),timestamp:e.timestamp||qo()},p=n.integrations||t.integrations.map(E=>E.name);Y$(h,t),X$(h,p),s&&s.emit("applyFrameMetadata",e),e.type===void 0&&K$(h,t.stackParser);const g=Q$(r,n.captureContext);n.mechanism&&Do(h,n.mechanism);const m=s?s.getEventProcessors():[],y=ER(o,g),b=[...n.attachments||[],...y.attachments];b.length&&(n.attachments=b),P$(h,y);const _=[...m,...y.eventProcessors];return(n.data&&n.data.__sentry__===!0?uh(h):G$(_,h,n)).then(E=>(E&&J$(E),typeof l=="number"&&l>0?Z$(E,l,d):E))}function Y$(t,e){var d,h;const{environment:n,release:r,dist:s,maxValueLength:o}=e;t.environment=t.environment||n||e_,!t.release&&r&&(t.release=r),!t.dist&&s&&(t.dist=s);const l=t.request;l!=null&&l.url&&o&&(l.url=Mb(l.url,o)),o&&((h=(d=t.exception)==null?void 0:d.values)==null||h.forEach(p=>{p.value&&(p.value=Mb(p.value,o))}))}function K$(t,e){var r,s;const n=V$(e);(s=(r=t.exception)==null?void 0:r.values)==null||s.forEach(o=>{var l,d;(d=(l=o.stacktrace)==null?void 0:l.frames)==null||d.forEach(h=>{h.filename&&(h.debug_id=n[h.filename])})})}function J$(t){var r,s;const e={};if((s=(r=t.exception)==null?void 0:r.values)==null||s.forEach(o=>{var l,d;(d=(l=o.stacktrace)==null?void 0:l.frames)==null||d.forEach(h=>{h.debug_id&&(h.abs_path?e[h.abs_path]=h.debug_id:h.filename&&(e[h.filename]=h.debug_id),delete h.debug_id)})}),Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];const n=t.debug_meta.images;Object.entries(e).forEach(([o,l])=>{n.push({type:"sourcemap",code_file:o,debug_id:l})})}function X$(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function Z$(t,e,n){var s,o;if(!t)return null;const r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(l=>({...l,...l.data&&{data:zs(l.data,e,n)}}))},...t.user&&{user:zs(t.user,e,n)},...t.contexts&&{contexts:zs(t.contexts,e,n)},...t.extra&&{extra:zs(t.extra,e,n)}};return(s=t.contexts)!=null&&s.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=zs(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(l=>({...l,...l.data&&{data:zs(l.data,e,n)}}))),(o=t.contexts)!=null&&o.flags&&r.contexts&&(r.contexts.flags=zs(t.contexts.flags,3,n)),r}function Q$(t,e){if(!e)return t;const n=t?t.clone():new ss;return n.update(e),n}function eU(t){if(t)return tU(t)?{captureContext:t}:rU(t)?{captureContext:t}:t}function tU(t){return t instanceof ss||typeof t=="function"}const nU=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function rU(t){return Object.keys(t).some(e=>nU.includes(e))}function hc(t,e){return Dt().captureException(t,eU(e))}function NR(t,e){return Dt().captureEvent(t,e)}function iU(t,e){Hi().setContext(t,e)}function sU(){return Hi().lastEventId()}function aU(){const t=yt();return(t==null?void 0:t.getOptions().enabled)!==!1&&!!(t!=null&&t.getTransport())}function vT(t){const e=Hi(),{user:n}=ER(e,Dt()),{userAgent:r}=ut.navigator||{},s=o6({user:n,...r&&{userAgent:r},...t}),o=e.getSession();return(o==null?void 0:o.status)==="ok"&&Sc(o,{status:"exited"}),AR(),e.setSession(s),s}function AR(){const t=Hi(),n=Dt().getSession()||t.getSession();n&&l6(n),CR(),t.setSession()}function CR(){const t=Hi(),e=yt(),n=t.getSession();n&&e&&e.captureSession(n)}function s0(t=!1){if(t){AR();return}CR()}const oU="7";function RR(t){const e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function lU(t){return`${RR(t)}${t.projectId}/envelope/`}function cU(t,e){const n={sentry_version:oU};return t.publicKey&&(n.sentry_key=t.publicKey),e&&(n.sentry_client=`${e.name}/${e.version}`),new URLSearchParams(n).toString()}function uU(t,e,n){return e||`${lU(t)}?${cU(t,n)}`}function dU(t,e){const n=eR(t);if(!n)return"";const r=`${RR(n)}embed/error-page/`;let s=`dsn=${Go(n)}`;for(const o in e)if(o!=="dsn"&&o!=="onClose")if(o==="user"){const l=e.user;if(!l)continue;l.name&&(s+=`&name=${encodeURIComponent(l.name)}
158`),l.email&&(s+=`&email=${encodeURIComponent(l.email)}`)}else s+=`&${encodeURIComponent(o)}=${encodeURIComponent(e[o])}`;return`${r}?${s}`}const yT=[];function hU(t){const e={};return t.forEach(n=>{const{name:r}=n,s=e[r];s&&!s.isDefaultInstance&&n.isDefaultInstance||(e[r]=n)}),Object.values(e)}function fU(t){const e=t.defaultIntegrations||[],n=t.integrations;e.forEach(s=>{s.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...e,...n];else if(typeof n=="function"){const s=n(e);r=Array.isArray(s)?s:[s]}else r=e;return hU(r)}function pU(t,e){const n={};return e.forEach(r=>{r!=null&&r.beforeSetup&&r.beforeSetup(t)}),e.forEach(r=>{r&&OR(t,r,n)}),n}function bT(t,e){for(const n of e)n!=null&&n.afterAllSetup&&n.afterAllSetup(t)}function OR(t,e,n){if(n[e.name]){$e&&je.log(`Integration skipped because it was already installed: ${e.name}`);return}if(n[e.name]=e,!yT.includes(e.name)&&typeof e.setupOnce=="function"&&(e.setupOnce(),yT.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),typeof e.preprocessEvent=="function"){const r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(s,o)=>r(s,o,t))}if(typeof e.processEvent=="function"){const r=e.processEvent.bind(e),s=Object.assign((o,l)=>r(o,l,t),{id:e.name});t.addEventProcessor(s)}["processSpan","processSegmentSpan"].forEach(r=>{const s=e[r];typeof s=="function"&&t.on(r,o=>s.call(e,o,t))}),$e&&je.log(`Integration installed: ${e.name}`)}function mU(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function gU(){/*! __SENTRY_SDK_SOURCE__ */return"npm"}function vU(){return!mU()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function zm(){return typeof window<"u"&&(!vU()||yU())}function yU(){const t=ut.process;return(t==null?void 0:t.type)==="renderer"}function bU(t,e){const n=e?"auto":"never";return[{type:"log",item_count:t.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...zm()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:t}]}function xU(t,e,n,r,s){const o={};return e!=null&&e.sdk&&(o.sdk={name:e.sdk.name,version:e.sdk.version}),n&&r&&(o.dsn=Go(r)),Vo(o,[bU(t,s)])}function Gb(t,e){const n=e??_U(t)??[];if(n.length===0)return;const r=t.getOptions(),s=xU(n,r._metadata,r.tunnel,t.getDsn(),t.getDataCollectionOptions().userInfo);DR().set(t,[]),t.emit("flushLogs"),t.sendEnvelope(s)}function _U(t){return DR().get(t)}function DR(){return Nc("clientToLogBufferMap",()=>new WeakMap)}function wU(t,e){const n=e?"auto":"never";return[{type:"trace_metric",item_count:t.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{version:2,...zm()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:t}]}function SU(t,e,n,r,s){const o={};return e!=null&&e.sdk&&(o.sdk={name:e.sdk.name,version:e.sdk.version}),n&&r&&(o.dsn=Go(r)),Vo(o,[wU(t,s)])}function IR(t,e){const n=e??EU(t)??[];if(n.length===0)return;const r=t.getOptions(),s=SU(n,r._metadata,r.tunnel,t.getDsn(),r.sendDefaultPii);MR().set(t,[]),t.emit("flushMetrics"),t.sendEnvelope(s)}function EU(t){return MR().get(t)}function MR(){return Nc("clientToMetricBufferMap",()=>new WeakMap)}function kU(t){const e={trace_id:t.trace_id,span_id:t.span_id,parent_span_id:t.parent_span_id,name:t.description||"",start_timestamp:t.start_timestamp,end_timestamp:t.timestamp||t.start_timestamp,status:!t.status||t.status==="ok"||t.status==="cancelled"?"ok":"error",is_segment:!1,attributes:{...t.data},links:t.links};return Y6(e)}function jU(t,e){var o,l,d;if(t.type!=="transaction"||!((o=t.spans)!=null&&o.length)||!((l=t.sdkProcessingMetadata)!=null&&l.hasGenAiSpans)||!e.getOptions().streamGenAiSpans||as(e))return;const n=[],r=[];for(const h of t.spans)(d=h.op)!=null&&d.startsWith("gen_ai.")?n.push(kU(h)):r.push(h);if(n.length===0)return;t.spans=r;const s=e.getOptions().sendDefaultPii?"auto":"never";return[{type:"span",item_count:n.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...zm()&&{ingest_settings:{infer_ip:s,infer_user_agent:s}},items:n}]}function LR(t){return typeof t=="object"&&typeof t.unref=="function"&&t.unref(),t}const i_=Symbol.for("SentryBufferFullError");function s_(t=100){const e=new Set;function n(){return e.size<t}function r(l){e.delete(l)}function s(l){if(!n())return r_(i_);const d=l();return e.add(d),d.then(()=>r(d),()=>r(d)),d}function o(l){if(!e.size)return uh(!0);const d=Promise.allSettled(Array.from(e)).then(()=>!0);if(!l)return d;const h=[d,new Promise(p=>LR(setTimeout(()=>p(!1),l)))];return Promise.race(h)}return{get $(){return Array.from(e)},add:s,drain:o}}const TU=60*1e3;function NU(t,e=sh()){const n=parseInt(`${t}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${t}`);return isNaN(r)?TU:r-e}function AU(t,e){return t[e]||t.all||0}function CU(t,e,n=sh()){return AU(t,e)>n}function RU(t,{statusCode:e,headers:n},r=sh()){const s={...t},o=n==null?void 0:n["x-sentry-rate-limits"],l=n==null?void 0:n["retry-after"];if(o)for(const d of o.trim().split(",")){const[h,p,,,g]=d.split(":",5),m=parseInt(h,10),y=(isNaN(m)?60:m)*1e3;
158if(!p)s.all=r+y;else for(const b of p.split(";"))b==="metric_bucket"?(!g||g.split(";").includes("custom"))&&(s[b]=r+y):s[b]=r+y}else l?s.all=r+NU(l,r):e===429&&(s.all=r+60*1e3);return s}const PR=64;function OU(t,e,n=s_(t.bufferSize||PR)){let r={};const s=l=>n.drain(l);function o(l){const d=[];if(Bb(l,(m,y)=>{const b=aT(y);CU(r,b)?t.recordDroppedEvent("ratelimit_backoff",b):d.push(m)}),d.length===0)return Promise.resolve({});const h=Vo(l[0],d),p=m=>{if(c$(h,["client_report"])){$e&&je.warn(`Dropping client report. Will not send outcomes (reason: ${m}).`);return}Bb(h,(y,b)=>{t.recordDroppedEvent(m,aT(b))})},g=()=>e({body:u$(h)}).then(m=>m.statusCode===413?($e&&je.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),p("send_error"),m):($e&&m.statusCode!==void 0&&(m.statusCode<200||m.statusCode>=300)&&je.warn(`Sentry responded with status code ${m.statusCode} to sent event.`),r=RU(r,m),m),m=>{throw p("network_error"),$e&&je.error("Encountered error running transport request:",m),m});return n.add(g).then(m=>m,m=>{if(m===i_)return $e&&je.error("Skipped sending event because buffer is full."),p("queue_overflow"),Promise.resolve({});throw m})}return{send:o,flush:s}}function DU(t,e,n){const r=[{type:"client_report"},{timestamp:qo(),discarded_events:t}];return Vo(e?{dsn:e}:{},[r])}function FR(t){const e=[];t.message&&e.push(t.message);try{const n=t.exception.values[t.exception.values.length-1];n!=null&&n.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`))}catch{}return e}function IU(t){var h;const{trace_id:e,parent_span_id:n,span_id:r,status:s,origin:o,data:l,op:d}=((h=t.contexts)==null?void 0:h.trace)??{};return{data:l??{},description:t.transaction,op:d,parent_span_id:n,span_id:r??"",start_timestamp:t.start_timestamp??0,status:s,timestamp:t.timestamp,trace_id:e??"",origin:o,profile_id:l==null?void 0:l[Qx],exclusive_time:l==null?void 0:l[Va],measurements:t.measurements,is_segment:!0}}function MU(t){return{type:"transaction",timestamp:t.timestamp,start_timestamp:t.start_timestamp,transaction:t.description,contexts:{trace:{trace_id:t.trace_id,span_id:t.span_id,parent_span_id:t.parent_span_id,op:t.op,status:t.status,origin:t.origin,data:{...t.data,...t.profile_id&&{[Qx]:t.profile_id},...t.exclusive_time&&{[Va]:t.exclusive_time}}}},measurements:t.measurements}}const Qf=["forwarded","-ip","remote-","via","-user"];function LU(t){return t===!0?{userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],queryParams:!0,genAI:{inputs:!0,outputs:!0},stackFrameVariables:!0,frameContextLines:5}:{userInfo:!1,cookies:{deny:Qf},httpHeaders:{request:{deny:Qf},response:{deny:Qf}},httpBodies:[],queryParams:{deny:Qf},genAI:{inputs:!1,outputs:!1},stackFrameVariables:!0,frameContextLines:5}}const PU={userInfo:!1,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:[],queryParams:!0,genAI:{inputs:!0,outputs:!0},stackFrameVariables:!0,frameContextLines:5};function FU(t){var r,s,o,l;const e=t.dataCollection!=null?PU:LU(t.sendDefaultPii),n=t.dataCollection??{};return{userInfo:n.userInfo??e.userInfo,cookies:n.cookies??e.cookies,httpHeaders:{request:((r=n.httpHeaders)==null?void 0:r.request)??e.httpHeaders.request,response:((s=n.httpHeaders)==null?void 0:s.response)??e.httpHeaders.response},httpBodies:n.httpBodies??e.httpBodies,queryParams:n.queryParams??e.queryParams,genAI:{inputs:((o=n.genAI)==null?void 0:o.inputs)??e.genAI.inputs,outputs:((l=n.genAI)==null?void 0:l.outputs)??e.genAI.outputs}
158,stackFrameVariables:n.stackFrameVariables??e.stackFrameVariables,frameContextLines:n.frameContextLines??e.frameContextLines}}const xT="Not capturing exception because it's already been captured.",_T="Discarded session because of missing or non-string release",$R=Symbol.for("SentryInternalError"),UR=Symbol.for("SentryDoNotSendEventError"),$U=5e3;function Sp(t){return{message:t,[$R]:!0}}function a0(t){return{message:t,[UR]:!0}}function wT(t){return!!t&&typeof t=="object"&&$R in t}function ST(t){return!!t&&typeof t=="object"&&UR in t}function ET(t,e,n,r,s){let o=0,l,d=!1;t.on(n,()=>{o=0,clearTimeout(l),d=!1}),t.on(e,h=>{if(o+=r(h),o>=8e5)s(t);else if(!d){const p=t.getOptions()._flushInterval??$U;p>0&&(d=!0,l=LR(setTimeout(()=>{s(t)},p)))}}),t.on("flush",()=>{s(t)})}class UU{constructor(e){var r,s,o;if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=s_(((r=e.transportOptions)==null?void 0:r.bufferSize)??PR),this._dataCollection=FU(e),e.dsn?this._dsn=eR(e.dsn):$e&&je.warn("No DSN provided, client will not send events."),this._dsn){const l=uU(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:l})}this._options.enableLogs=this._options.enableLogs??((s=this._options._experiments)==null?void 0:s.enableLogs),this._options.enableLogs&&ET(this,"afterCaptureLog","flushLogs",qU,Gb),(this._options.enableMetrics??((o=this._options._experiments)==null?void 0:o.enableMetrics)??!0)&&ET(this,"afterCaptureMetric","flushMetrics",HU,IR)}captureException(e,n,r){const s=xi();if(Yj(e))return $e&&je.log(xT),s;const o={event_id:s,...n};return this._process(()=>this.eventFromException(e,o).then(l=>this._captureEvent(l,o,r)).then(l=>l),"error"),o.event_id}captureMessage(e,n,r,s){const o={event_id:xi(),...r},l=Yx(e)?e:String(e),d=wc(e),h=d?this.eventFromMessage(l,n,o):this.eventFromException(e,o);return this._process(()=>h.then(p=>this._captureEvent(p,o,s)),d?"unknown":"error"),o.event_id}captureEvent(e,n,r){const s=xi();if(n!=null&&n.originalException&&Yj(n.originalException))return $e&&je.log(xT),s;const o={event_id:s,...n},l=e.sdkProcessingMetadata||{},d=l.capturedSpanScope,h=l.capturedSpanIsolationScope,p=kT(e.type);return this._process(()=>this._captureEvent(e,o,d||r,h),p),o.event_id}captureSession(e){this.sendSession(e),Sc(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getDataCollectionOptions(){return this._dataCollection}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){const n=this._transport;if(this.emit("flush"),!n)return!0;const r=await this._isClientDoneProcessing(e),s=await n.flush(e);return r&&s}async close(e){Gb(this);const n=await this.flush(e);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(e){const n=this._integrations[e.name];!n&&e.beforeSetup&&e.beforeSetup(this),OR(this,e,this._integrations),n||bT(this,[e])}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);const r=jU(e,this);let s=y$(e,this._dsn,this._options._metadata,this._options.tunnel);for(const o of n.attachments||[])s=sT(s,f$(o));r&&(s=sT(s,r)),this.sendEnvelope(s).then(o=>
158this.emit("afterSendEvent",e,o))}sendSession(e){const{release:n,environment:r=e_}=this._options;if("aggregates"in e){const o=e.attrs||{};if(!o.release&&!n){$e&&je.warn(_T);return}o.release=o.release||n,o.environment=o.environment||r,e.attrs=o}else{if(!e.release&&!n){$e&&je.warn(_T);return}e.release=e.release||n,e.environment=e.environment||r}this.emit("beforeSendSession",e);const s=v$(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(s)}recordDroppedEvent(e,n,r=1){if(this._options.sendClientReports){const s=`${e}:${n}`;$e&&je.log(`Recording outcome: "${s}"${r>1?` (${r} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+r}}on(e,n){const r=this._hooks[e]=this._hooks[e]||new Set,s=(...o)=>n(...o);return r.add(s),()=>{r.delete(s)}}emit(e,...n){const r=this._hooks[e];r&&r.forEach(s=>s(...n))}async sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(n){return $e&&je.error("Error while sending envelope:",n),{}}return $e&&je.error("Transport disabled"),{}}registerCleanup(e){}dispose(){}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=pU(this,e),bT(this,e)}_updateSessionFromEvent(e,n){var h,p;let r=n.level==="fatal",s=!1;const o=(h=n.exception)==null?void 0:h.values;if(o){s=!0,r=!1;for(const g of o)if(((p=g.mechanism)==null?void 0:p.handled)===!1){r=!0;break}}const l=e.status==="ok";(l&&e.errors===0||l&&r)&&(Sc(e,{...r&&{status:"crashed"},errors:e.errors||Number(s||r)}),this.captureSession(e))}async _isClientDoneProcessing(e){let n=0;for(;!e||n<e;){if(await new Promise(r=>setTimeout(r,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,n,r,s){const o=this.getOptions(),l=this.getIntegrationNames();return!n.integrations&&l.length&&(n.integrations=l),this.emit("preprocessEvent",e,n),e.type||s.setLastEventId(e.event_id||n.event_id),W$(o,e,n,r,this,s).then(d=>{var p;if(d===null)return d;this.emit("postprocessEvent",d,n),d.contexts={trace:{...(p=d.contexts)==null?void 0:p.trace,...S6(r)},...d.contexts};const h=gR(this,r);return d.sdkProcessingMetadata={dynamicSamplingContext:h,...d.sdkProcessingMetadata},d})}_captureEvent(e,n={},r=Dt(),s=Hi()){return $e&&Vb(e)&&je.log(`Captured error event \`${FR(e)[0]||"<unknown>"}\``),this._processEvent(e,n,r,s).then(o=>o.event_id,o=>{$e&&(ST(o)?je.log(o.message):wT(o)?je.warn(o.message):je.warn(o))})}_processEvent(e,n,r,s){const o=this.getOptions(),{sampleRate:l}=o,d=zR(e),h=Vb(e),g=`before send for type \`${e.type||"error"}\``,m=typeof l>"u"?void 0:Md(l);if(h&&typeof m=="number"&&Fa()>m)return this.recordDroppedEvent("sample_rate","error"),r_(a0(`Discarding event because it's not included in the random sample (sampling rate = ${l})`));const y=kT(e.type);return this._prepareEvent(e,n,r,s).then(b=>{var S;if(b===null)throw this.recordDroppedEvent("event_processor",y),a0("An event processor returned `null`, will not send event.");if(((S=n.data)==null?void 0:S.__sentry__)===!0)return b;const w=BU(this,o,b,n);return zU(w,g)}).then(b=>{var S;if(b===null){if(this.recordDroppedEvent("before_send",y),d){const k=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",k)}throw a0(`${g} returned \`null\`, will not send event.`)}const _=r.getSession()||s.getSession();if(h&&_&&this._updateSessionFromEvent(_,b),d){const E=((S=b.sdkProcessingMetadata)==null?void 0:S.spanCountBeforeProcessing)||0,k=b.spans?b.spans.length:0,j=E-k;j>0&&this.recordDroppedEvent("before_send","span",j)}const w=b.transaction_info;if(d&&w&&b.transaction!==e.transaction){const E="custom";b.transaction_info={...w,source:E}}return this.sendEvent(b,n),b}).then(null,b=>{throw ST(b)||wT(b)?b:(this.captureException(b,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:b}),Sp(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
159Reason: ${b}`))})}_process(e,n){this._numProcessing++,this._promiseBuffer.add(e).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===i_&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map(([n,r])=>{const[s,o]=n.split(":");return{reason:s,category:o,quantity:r}})}_flushOutcomes(){$e&&je.log("Flushing outcomes...");const e=this._clearOutcomes();if(e.length===0){$e&&je.log("No outcomes to send");return}if(!this._dsn){$e&&je.log("No dsn provided, will not send outcomes");return}$e&&je.log("Sending outcomes:",e);const n=DU(e,this._options.tunnel&&Go(this._dsn));this.sendEnvelope(n)}}function kT(t){return t==="replay_event"?"replay":t||"error"}function zU(t,e){const n=`${e} must return \`null\` or a valid event.`;if(nh(t))return t.then(r=>{if(!Od(r)&&r!==null)throw Sp(n);return r},r=>{throw Sp(`${e} rejected with ${r}`)});if(!Od(t)&&t!==null)throw Sp(n);return t}function BU(t,e,n,r){const{beforeSend:s,beforeSendTransaction:o,ignoreSpans:l}=e,d=!vR(e.beforeSendSpan)&&e.beforeSendSpan;let h=n;if(Vb(h)&&s)return s(h,r);if(zR(h)){if(d||l){const p=IU(h);if(l!=null&&l.length&&Ld({description:p.description,op:p.op,attributes:p.data},l))return null;if(d){const g=d(p);g?h=ah(n,MU(g)):Ub()}if(h.spans){const g=[],m=h.spans;for(const b of m){if(l!=null&&l.length&&Ld({description:b.description,op:b.op,attributes:b.data},l)){Z6(m,b);continue}if(d){const _=d(b);
159_?g.push(_):(Ub(),g.push(b))}else g.push(b)}const y=h.spans.length-g.length;y&&t.recordDroppedEvent("before_send","span",y),h.spans=g}}if(o){if(h.spans){const p=h.spans.length;h.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:p}}return o(h,r)}}return h}function Vb(t){return t.type===void 0}function zR(t){return t.type==="transaction"}function HU(t){let e=0;return t.name&&(e+=t.name.length*2),e+=8,e+BR(t.attributes)}function qU(t){let e=0;return t.message&&(e+=t.message.length*2),e+BR(t.attributes)}function BR(t){if(!t)return 0;let e=0;return Object.values(t).forEach(n=>{Array.isArray(n)?e+=n.length*jT(n[0]):wc(n)?e+=jT(n):e+=100}),e}function jT(t){return typeof t=="string"?t.length*2:typeof t=="number"?8:typeof t=="boolean"?4:0}function GU(t,e){e.debug===!0&&($e?je.enable():Ho(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),Dt().update(e.initialScope);const r=new t(e);return VU(r),r.init(),r}function VU(t){Dt().setClient(t)}function WU(t){var e;"aggregates"in t?((e=t.attrs)==null?void 0:e.ip_address)===void 0&&(t.attrs={...t.attrs,ip_address:"{{auto}}"}):t.ipAddress===void 0&&(t.ipAddress="{{auto}}")}function HR(t,e,n=[e],r="npm"){const s=(t._metadata=t._metadata||{}).sdk=t._metadata.sdk||{};s.name||(s.name=`sentry.javascript.${e}`,s.packages=n.map(o=>({name:`${r}:@sentry/${o}`,version:Oo})),s.version=Oo)}function qR(t={}){const e=t.client||yt();if(!aU()||!e)return{};const n=Bo(),r=Cc(n);if(r.getTraceData)return r.getTraceData(t);const s=t.scope||Dt(),o=t.span||Qr(),l=o?V6(o):YU(s),d=o?Ba(o):gR(e,s),h=R6(d);if(!tR.test(l))return je.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const g={"sentry-trace":l,baggage:h};return t.propagateTraceparent&&(g.traceparent=o?W6(o):KU(s)),g}function YU(t){const{traceId:e,sampled:n,propagationSpanId:r}=t.getPropagationContext();return nR(e,r,n)}function KU(t){const{traceId:e,sampled:n,propagationSpanId:r}=t.getPropagationContext();return rR(e,r,n)}const JU=100;function Fo(t,e){const n=yt(),r=Hi();if(!n)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:o=JU}=n.getOptions();if(o<=0)return;const d={timestamp:qo(),...t},h=s?Ho(()=>s(d,e)):d;h!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",h,e),r.addBreadcrumb(h,o))}let TT;const XU="FunctionToString",NT=new WeakMap,ZU=(()=>({name:XU,setupOnce(){TT=Function.prototype.toString;try{Function.prototype.toString=function(...t){const e=Xx(this),n=NT.has(yt())&&e!==void 0?e:this;return TT.apply(n,t)}}catch{}},setup(t){NT.set(t,!0)}})),QU=ZU,ez=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],tz="EventFilters",nz=(t={})=>{let e;return{name:tz,setup(n){const r=n.getOptions();e=AT(t,r)},processEvent(n,r,s){if(!e){const o=s.getOptions();e=AT(t,o)}return iz(n,e)?null:n}}},rz=((t={})=>({...nz(t),name:"InboundFilters"}));function AT(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:ez],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[]]}}function iz(t,e){if(t.type){if(t.type==="transaction"&&az(t,e.ignoreTransactions))return $e&&je.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
160Event: ${To(t)}`),!0}else{if(sz(t,e.ignoreErrors))return $e&&je.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
161Event: ${To(t)}`),!0;if(uz(t))return $e&&je.warn(`Event dropped due to not having an error message, error type or stacktrace.
162Event: ${To(t)}`),!0;if(oz(t,e.denyUrls))return $e&&je.warn(`Event dropped due to being matched by \`denyUrls\` option.
163Event: ${To(t)}.
164Url: ${dm(t)}`),!0;if(!lz(t,e.allowUrls))return $e&&je.warn(`Event dropped due to not being matched by \`allowUrls\` option.
165Event: ${To(t)}.
166Url: ${dm(t)}`),!0}return!1}function sz(t,e){return e!=null&&e.length?FR(t).some(n=>Ks(n,e)):!1}function az(t,e){if(!(e!=null&&e.length))return!1;const n=t.transaction;return n?Ks(n,e):!1}function oz(t,e){if(!(e!=null&&e.length))return!1;const n=dm(t);return n?Ks(n,e):!1}function lz(t,e){if(!(e!=null&&e.length))return!0;const n=dm(t);return n?Ks(n,e):!0}function cz(t=[]){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function dm(t){var e,n;try{const r=[...((e=t.exception)==null?void 0:e.values)??[]].reverse().find(o=>{var l,d,h;return((l=o.mechanism)==null?void 0:l.parent_id)===void 0&&((h=(d=o.stacktrace)==null?void 0:d.frames)==null?void 0:h.length)}),s=(n=r==null?void 0:r.stacktrace)==null?void 0:n.frames;return s?cz(s):null}catch{return $e&&je.error(`Cannot extract url for event ${To(t)}`),null}}function uz(t){var e,n;return(n=(e=t.exception)==null?void 0:e.values)!=null&&n.length?!t.message&&!t.exception.values.some(r=>r.stacktrace||r.type&&r.type!=="Error"||r.value):!1}function dz(t,e,n,r,s,o){var d;if(!((d=s.exception)!=null&&d.values)||!o||!Qs(o.originalException,Error))return;const l=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;l&&(s.exception.values=Wb(t,e,r,o.originalException,n,s.exception.values,l,0))}function Wb(t,e,n,r,s,o,l,d){if(o.length>=n+1)return o;let h=[...o];if(Qs(r[s],Error)){CT(l,d,r);const p=t(e,r[s]),g=h.length;RT(p,s,g,d),h=Wb(t,e,n,r[s],s,[p,...h],p,g)}
166return GR(r)&&r.errors.forEach((p,g)=>{if(Qs(p,Error)){CT(l,d,r);const m=t(e,p),y=h.length;RT(m,`errors[${g}]`,y,d),h=Wb(t,e,n,p,s,[m,...h],m,y)}}),h}function GR(t){return Array.isArray(t.errors)}function CT(t,e,n){t.mechanism={handled:!0,type:"auto.core.linked_errors",...GR(n)&&{is_exception_group:!0},...t.mechanism,exception_id:e}}function RT(t,e,n,r){t.mechanism={handled:!0,...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function hz(t){return th(t)&&"__sentry_fetch_url_host__"in t&&typeof t.__sentry_fetch_url_host__=="string"}function OT(t){return hz(t)?`${t.message} (${t.__sentry_fetch_url_host__})`:t.message}const DT=new Set([]);function fz(t){const e="console",n=qa(e,t);return Ga(e,pz),n}function pz(){"console"in ut&&FF.forEach(function(t){t in ut.console&&Kr(ut.console,t,function(e){return om[t]=e,function(...n){const r=n[0],s=om[t],o=DT.size&&typeof r=="string"&&Ks(r,DT);o||bi("console",{args:n,level:t}),(!o||$e&&je.isEnabled())&&(s==null||s.apply(ut.console,n))}})})}function mz(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}const gz="Dedupe",vz=(()=>{let t;return{name:gz,processEvent(e){if(e.type)return e;try{if(bz(e,t))return $e&&je.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}}),yz=vz;function bz(t,e){return e?!!(xz(t,e)||_z(t,e)):!1}function xz(t,e){const n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!WR(t,e)||!VR(t,e))}function _z(t,e){const n=IT(e),r=IT(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!WR(t,e)||!VR(t,e))}function VR(t,e){let n=Bj(t),r=Bj(e);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let s=0;s<r.length;s++){const o=r[s],l=n[s];if(o.filename!==l.filename||o.lineno!==l.lineno||o.colno!==l.colno||o.function!==l.function)return!1}return!0}function WR(t,e){let n=t.fingerprint,r=e.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function IT(t){var e,n;return(n=(e=t.exception)==null?void 0:e.values)==null?void 0:n[0]}const wz="ConversationId",Sz=(()=>({name:wz,setup(t){t.on("spanStart",e=>{const n=Dt().getScopeData(),r=Hi().getScopeData(),s=n.conversationId||r.conversationId;if(s){const{op:o,data:l,description:d}=Tt(e);if(!(o!=null&&o.startsWith("gen_ai."))&&!l["ai.operationId"]&&!(d!=null&&d.startsWith("ai.")))return;e.setAttribute(k6,s)}})}})),Ez=Sz;function kz(t,e,n,r,s){if(!t.fetchData)return;const{method:o,url:l}=t.fetchData,d=Ui()&&e(l);if(t.endTimestamp){const _=t.fetchData.__span;if(!_)return;const w=r[_];w&&(d&&(Nz(w,t),jz(w,t,s)),delete r[_]);return}const{spanOrigin:h="auto.http.browser",propagateTraceparent:p=!1}=typeof s=="object"?s:{spanOrigin:s},g=yt(),y=!!Qr()||!!g&&as(g),b=d&&y?Ya(Rz(l,o,h)):new ns;if(d&&!y&&(g==null||g.recordDroppedEvent("no_parent_span","span")),t.fetchData.__span=b.spanContext().spanId,r[b.spanContext().spanId]=b,n(t.fetchData.url)){const _=t.args[0],w={...t.args[1]||{}},S=Tz(_,w,Ui()&&y?b:void 0,p);S&&(t.args[1]=w,w.headers=S)}if(g){const _={input:t.args,response:t.response,startTimestamp:t.startTimestamp,endTimestamp:t.endTimestamp};g.emit("beforeOutgoingRequestSpan",b,_)}return b}function jz(t,e,n){var s;const r=typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0;r==null||r(t,{headers:(s=e.response)==null?void 0:s.headers,error:e.error})}function Tz(t,e,n,r){const s=qR({span:n,propagateTraceparent:r}),o=s["sentry-trace"],l=s.baggage,d=s.traceparent;if(!o)return;const h=e.headers||(Kx(t)?t.headers:void 0);if(h)if(Az(h)){const p=new Headers(h);if(p.get("sentry-trace")||p.set("sentry-trace",o),r&&d&&!p.get("traceparent")&&p.set("traceparent",d),l){const g=p.get("baggage");g?ep(g)||p.set("baggage",`${g},${l}`):p.set("baggage",l)}return p}else if(Cz(h)){const p=[...h];p.find(m=>m[0]==="sentry-trace")||p.push(["sentry-trace",o]),r&&d&&!p.find(m=>m[0]==="traceparent")&&p.push(["traceparent",d]);const g=h.find(m=>m[0]==="baggage"&&typeof m[1]=="string"&&ep(m[1]));return l&&!g&&p.push(["baggage",l]),p}else{const p="sentry-trace"in h?h["sentry-trace"]:void 0,g="traceparent"in h?h.traceparent:void 0,m="baggage"in h?h.baggage:void 0,y=m?Array.isArray(m)?[...m]:[m]:[],b=m&&(Array.isArray(m)?m.find(w=>ep(w)):ep(m));l&&!b&&y.push(l);const _=Object.assign({},h,{"sentry-trace":p??o,baggage:y.length>0?y.join(","):void 0});return r&&d&&!g&&(_.traceparent=d),_}else return{...s}}function Nz(t,e){var n,r;if(e.response){KC(t,e.response.status);const s=(r=(n=e.response)==null?void 0:n.headers)==null?void 0:r.get("content-length");if(s){const o=parseInt(s);o>0&&t.setAttribute("http.response_content_length",o)}}else e.error&&t.setStatus({code:Gn,message:"internal_error"});t.end()}function ep(t){return typeof t!="string"?!1:t.split(",").some(e=>e.trim().startsWith(um))}function Az(t){return typeof Headers<"u"&&Qs(t,Headers)}function Cz(t){return Array.isArray(t)?t.every(e=>Array.isArray(e)&&e.length===2&&typeof e[0]=="string"):!1}function Rz(t,e,n){if(t.startsWith("data:")){const o=rs(t);return{name:`${e} ${o}`,attributes:MT(t,void 0,e,n)}}const r=n_(t),s=r?jR(r):t;return{name:`${e} ${s}`,attributes:MT(t,r,e,n)}}function MT(t,e,n,r){const s={url:rs(t),type:"fetch","http.method":n,[Dn]:r,[Si]:"http.client"};return e&&(kR(e)||(s["http.url"]=rs(e.href),s["server.address"]=e.host),e.search&&(s["http.query"]=e.search),e.hash&&(s["http.fragment"]=e.hash)),s}function YR(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}const Fd=ut;function Oz(){return"history"in Fd&&!!Fd.history}function Dz(){if(!("fetch"in Fd))return!1;
166try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function Yb(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function Iz(){var n;if(typeof EdgeRuntime=="string")return!0;if(!Dz())return!1;if(Yb(Fd.fetch))return!0;let t=!1;const e=Fd.document;if(e&&typeof e.createElement=="function")try{const r=e.createElement("iframe");r.hidden=!0,e.head.appendChild(r),(n=r.contentWindow)!=null&&n.fetch&&(t=Yb(r.contentWindow.fetch)),e.head.removeChild(r)}catch(r){$e&&je.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return t}function a_(t,e){const n="fetch",r=qa(n,t);return Ga(n,()=>KR(void 0,e)),r}function Mz(t){const e="fetch-body-resolved",n=qa(e,t);return Ga(e,()=>KR(Pz)),n}function KR(t,e=!1){e&&!Iz()||Kr(ut,"fetch",function(n){return function(...r){const s=new Error,{method:o,url:l}=Fz(r),d={args:r,fetchData:{method:o,url:l},startTimestamp:Bn()*1e3,virtualError:s,headers:$z(r)};return t||bi("fetch",{...d}),n.apply(ut,r).then(async h=>(t?t(h):bi("fetch",{...d,endTimestamp:Bn()*1e3,response:h}),h),h=>{bi("fetch",{...d,endTimestamp:Bn()*1e3,error:h}),th(h)&&h.stack===void 0&&(h.stack=s.stack,Ir(h,"framesToPop",1));const p=yt(),g=(p==null?void 0:p.getOptions().enhanceFetchErrorMessages)??"always";if(g!==!1&&h instanceof TypeError&&(h.message==="Failed to fetch"||h.message==="Load failed"||h.message==="NetworkError when attempting to fetch resource."))try{const b=new URL(d.fetchData.url).host;g==="always"?h.message=`${h.message} (${b})`:Ir(h,"__sentry_fetch_url_host__",b)}catch{}throw h})}})}async function Lz(t,e){if(t!=null&&t.body){const n=t.body,r=n.getReader(),s=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3);let o=!0;for(;o;){let l;try{l=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);const{done:d}=await r.read();clearTimeout(l),d&&(e(),o=!1)}catch{o=!1}finally{clearTimeout(l)}}clearTimeout(s),r.releaseLock(),n.cancel().then(null,()=>{})}}function Pz(t){let e;try{e=t.clone()}catch{return}Lz(e,()=>{bi("fetch-body-resolved",{endTimestamp:Bn()*1e3,response:t})})}function Ep(t,e){return!!t&&typeof t=="object"&&!!t[e]}function LT(t){return typeof t=="string"?t:t?Ep(t,"url")?t.url:t.toString?t.toString():"":""}function Fz(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){const[n,r]=t;return{url:LT(n),method:Ep(r,"method")?String(r.method).toUpperCase():Kx(n)&&Ep(n,"method")?String(n.method).toUpperCase():"GET"}}const e=t[0];return{url:LT(e),method:Ep(e,"method")?String(e.method).toUpperCase():"GET"}}function $z(t){const[e,n]=t;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(Kx(e))return new Headers(e.headers)}catch{}}const nt=ut;let Kb=0;function JR(){return Kb>0}function Uz(){Kb++,setTimeout(()=>{Kb--})}function kc(t,e={}){function n(s){return typeof s=="function"}if(!n(t))return t;try{const s=t.__sentry_wrapped__;if(s)return typeof s=="function"?s:t;if(Xx(t))return t}catch{return t}const r=function(...s){ut._sentryWrappedDepth=(ut._sentryWrappedDepth||0)+1;try{const o=s.map(l=>kc(l,e));return t.apply(this,o)}catch(o){throw Uz(),oh(l=>{l.addEventProcessor(d=>(e.mechanism&&(Lb(d,void 0),Do(d,e.mechanism)),d.extra={...d.extra,arguments:s},d)),hc(o)}),o}finally{ut._sentryWrappedDepth=(ut._sentryWrappedDepth||0)-1}};try{for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=t[s])}catch{}BC(r,t),Ir(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch{}return r}function hm(){const t=rh(),{referrer:e}=nt.document||{},{userAgent:n}=nt.navigator||{},r={...e&&{Referer:e},...n&&{"User-Agent":n}};return{url:t,headers:r}}function o_(t,e){const n=Bm(t,e),r={type:Gz(e),value:Vz(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function zz(t,e,n,r){const s=yt(),o=s==null?void 0:s.getOptions().normalizeDepth,l=Xz(e),d={__serialized__:yR(e,o)};if(l)return{exception:{values:[o_(t,l)]},extra:d};const h={exception:{values:[{type:Pm(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:Kz(e,{isUnhandledRejection:r})}]},extra:d};if(n){const p=Bm(t,n);p.length&&(h.exception.values[0].stacktrace={frames:p})}return h}function o0(t,e){return{exception:{values:[o_(t,e)]}}}function Bm(t,e){const n=e.stacktrace||e.stack||"",r=Hz(e),s=qz(e);try{return t(n,r,s)}catch{}return[]}const Bz=/Minified React error #\d+;/i;function Hz(t){return t&&Bz.test(t.message)?1:0}function qz(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function XR(t){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?t instanceof WebAssembly.Exception:!1}function Gz(t){const e=t==null?void 0:t.name;return!e&&XR(t)?t.message&&Array.isArray(t.message)&&t.message.length==2?t.message[0]:"WebAssembly.Exception":e}function Vz(t){const e=t==null?void 0:t.message;return XR(t)?Array.isArray(t.message)&&t.message.length==2?t.message[1]:"wasm exception":e?e.error&&typeof e.error.message=="string"?OT(e.error):OT(t):"No error message"}function Wz(t,e,n,r){const s=(n==null?void 0:n.syntheticException)||void 0,o=l_(t,e,s,r);return Do(o),o.level="error",n!=null&&n.event_id&&(o.event_id=n.event_id),uh(o)}function Yz(t,e,n="info",r,s){const o=(r==null?void 0:r.syntheticException)||void 0,l=Jb(t,e,o,s);return l.level=n,r!=null&&r.event_id&&(l.event_id=r.event_id),uh(l)}function l_(t,e,n,r,s){var l,d;let o;if($C(e)&&e.error)return o0(t,e.error);if(qj(e)||KF(e)){const h=e;if("stack"in e){o=o0(t,e);const p=(d=(l=o.exception)==null?void 0:l.values)==null?void 0:d[0];if(r&&n&&p&&!p.stacktrace){const g=Bm(t,n);g.length&&(p.stacktrace={frames:g},Do(o,{synthetic:!0}))}}else{const p=h.name||(qj(h)?"DOMError":"DOMException"),g=h.message?`${p}: ${h.message}`:p;o=Jb(t,g,n,r),Lb(o,g)}return"code"in h&&(o.tags={...o.tags,"DOMException.code":`${h.code}`}),o}return th(e)?o0(t,e):Od(e)||Pm(e)?(o=zz(t,e,n,s),Do(o,{synthetic:!0}),o):(o=Jb(t,e,n,r),Lb(o,`${e}`),Do(o,{synthetic:!0}),o)}function Jb(t,e,n,r){const s={};if(r&&n){const o=Bm(t,n);o.length&&(s.exception={values:[{value:e,stacktrace:{frames:o}}]}),Do(s,{synthetic:!0})}
166if(Yx(e)){const{__sentry_template_string__:o,__sentry_template_values__:l}=e;return s.logentry={message:o,params:l},s}return s.message=e,s}function Kz(t,{isUnhandledRejection:e}){const n=t6(t),r=e?"promise rejection":"exception";return $C(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:Pm(t)?`Event \`${Jz(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function Jz(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function Xz(t){return Object.values(t).find(e=>e instanceof Error)}class Zz extends UU{constructor(e){var g;const n=Qz(e),r=nt.SENTRY_SDK_SOURCE||gU();HR(n,"browser",["browser"],r),(g=n._metadata)!=null&&g.sdk&&(n._metadata.sdk.settings={infer_ip:n.sendDefaultPii?"auto":"never",...n._metadata.sdk.settings}),super(n);const{sendDefaultPii:s,sendClientReports:o,enableLogs:l,_experiments:d,enableMetrics:h}=this._options,p=h??(d==null?void 0:d.enableMetrics)??!0;nt.document&&(o||l||p)&&nt.document.addEventListener("visibilitychange",()=>{nt.document.visibilityState==="hidden"&&(o&&this._flushOutcomes(),l&&Gb(this),p&&IR(this))}),s&&this.on("beforeSendSession",WU)}eventFromException(e,n){return Wz(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return Yz(this._options.stackParser,e,n,r,this._options.attachStacktrace)}_prepareEvent(e,n,r,s){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r,s)}}function Qz(t){var e;return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:(e=nt.SENTRY_RELEASE)==null?void 0:e.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...t}}const ia=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Xe=ut,e7=(t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good",dh=(t,e,n,r)=>{let s,o;return l=>{e.value>=0&&(l||r)&&(o=e.value-(s??0),(o||s===void 0)&&(s=e.value,e.delta=o,e.rating=e7(e.value,n),t(e)))}},hh=(t=!0)=>{var n,r;const e=(r=(n=Xe.performance)==null?void 0:n.getEntriesByType)==null?void 0:r.call(n,"navigation")[0];if(!t||e&&e.responseStart>0&&e.responseStart<performance.now())return e},Rc=()=>{const t=hh();return(t==null?void 0:t.activationStart)??0};function $a(t,e,n){Xe.document&&Xe.addEventListener(t,e,n)}function fm(t,e,n){Xe.document&&Xe.removeEventListener(t,e,n)}let fc=-1;const ZR=new Set,t7=()=>{var t,e;return((t=Xe.document)==null?void 0:t.visibilityState)==="hidden"&&!((e=Xe.document)!=null&&e.prerendering)?0:1/0},kp=t=>{if(n7(t)&&fc>-1){if(t.type==="visibilitychange"||t.type==="pagehide")for(const e of ZR)e();isFinite(fc)||(fc=t.type==="visibilitychange"?t.timeStamp:0,fm("prerenderingchange",kp,!0))}},fh=()=>{var t;if(Xe.document&&fc<0){const e=Rc();fc=(Xe.document.prerendering||(t=globalThis.performance.getEntriesByType("visibility-state").filter(r=>r.name==="hidden"&&r.startTime>e)[0])==null?void 0:t.startTime)??t7(),$a("visibilitychange",kp,!0),$a("pagehide",kp,!0),$a("prerenderingchange",kp,!0)}return{get firstHiddenTime(){return fc},onHidden(e){ZR.add(e)}}};function n7(t){var e;return t.type==="pagehide"||((e=Xe.document)==null?void 0:e.visibilityState)==="hidden"}const r7=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,ph=(t,e=-1)=>{var o,l;const n=hh();let r="navigate";return n&&((o=Xe.document)!=null&&o.prerendering||Rc()>0?r="prerender":(l=Xe.document)!=null&&l.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:t,value:e,rating:"good",delta:0,entries:[],id:r7(),navigationType:r}},l0=new WeakMap;function c_(t,e){try{return l0.get(t)||l0.set(t,new e),l0.get(t)}catch{return new e}}class i7{constructor(){this._sessionValue=0,this._sessionEntries=[]}_processEntry(e){var s;if(e.hadRecentInput)return;const n=this._sessionEntries[0],r=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&n&&r&&e.startTime-r.startTime<1e3&&e.startTime-n.startTime<5e3?(this._sessionValue+=e.value,this._sessionEntries.push(e)):(this._sessionValue=e.value,this._sessionEntries=[e]),(s=this._onAfterProcessingUnexpectedShift)==null||s.call(this,e)}}const Oc=(t,e,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const r=new PerformanceObserver(s=>{Promise.resolve().then(()=>{e(s.getEntries())})});return r.observe({type:t,buffered:!0,...n}),r}}catch{}},u_=t=>{let e=!1;return()=>{e||(t(),e=!0)}},Hm=t=>{var e;(e=Xe.document)!=null&&e.prerendering?addEventListener("prerenderingchange",()=>t(),!0):t()},s7=[1800,3e3],a7=(t,e={})=>{Hm(()=>{const n=fh(),r=ph("FCP");let s;const l=Oc("paint",d=>{for(const h of d)h.name==="first-contentful-paint"&&(l.disconnect(),h.startTime<n.firstHiddenTime&&(r.value=Math.max(h.startTime-Rc(),0),r.entries.push(h),s(!0)))});l&&(s=dh(t,r,s7,e.reportAllChanges))})},o7=[.1,.25],l7=(t,e={})=>{a7(u_(()=>{var h;const n=ph("CLS",0);let r;const s=fh(),o=c_(e,i7),l=p=>{for(const g of p)o._processEntry(g);o._sessionValue>
166n.value&&(n.value=o._sessionValue,n.entries=o._sessionEntries,r())},d=Oc("layout-shift",l);d&&(r=dh(t,n,o7,e.reportAllChanges),s.onHidden(()=>{l(d.takeRecords()),r(!0)}),(h=Xe==null?void 0:Xe.setTimeout)==null||h.call(Xe,r))}))};let QR=0,c0=1/0,tp=0;const c7=t=>{t.forEach(e=>{e.interactionId&&(c0=Math.min(c0,e.interactionId),tp=Math.max(tp,e.interactionId),QR=tp?(tp-c0)/7+1:0)})};let Xb;const eO=()=>Xb?QR:performance.interactionCount||0,u7=()=>{"interactionCount"in performance||Xb||(Xb=Oc("event",c7,{type:"event",buffered:!0,durationThreshold:0}))},u0=10;let tO=0;const d7=()=>eO()-tO;class h7{constructor(){this._longestInteractionList=[],this._longestInteractionMap=new Map}_resetInteractions(){tO=eO(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const e=Math.min(this._longestInteractionList.length-1,Math.floor(d7()/50));return this._longestInteractionList[e]}_processEntry(e){var s,o;if((s=this._onBeforeProcessingEntry)==null||s.call(this,e),!(e.interactionId||e.entryType==="first-input"))return;const n=this._longestInteractionList.at(-1);let r=this._longestInteractionMap.get(e.interactionId);if(r||this._longestInteractionList.length<u0||e.duration>n._latency){if(r?e.duration>r._latency?(r.entries=[e],r._latency=e.duration):e.duration===r._latency&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],_latency:e.duration},this._longestInteractionMap.set(r.id,r),this._longestInteractionList.push(r)),this._longestInteractionList.sort((l,d)=>d._latency-l._latency),this._longestInteractionList.length>u0){const l=this._longestInteractionList.splice(u0);for(const d of l)this._longestInteractionMap.delete(d.id)}(o=this._onAfterProcessingINPCandidate)==null||o.call(this,r)}}}const nO=t=>{var n;const e=Xe.requestIdleCallback||Xe.setTimeout;((n=Xe.document)==null?void 0:n.visibilityState)==="hidden"?t():(t=u_(t),$a("visibilitychange",t,{once:!0,capture:!0}),$a("pagehide",t,{once:!0,capture:!0}),e(()=>{t(),fm("visibilitychange",t,{capture:!0}),fm("pagehide",t,{capture:!0})}))},f7=[200,500],p7=40,m7=(t,e={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=fh();Hm(()=>{u7();const r=ph("INP");let s;const o=c_(e,h7),l=h=>{nO(()=>{for(const g of h)o._processEntry(g);const p=o._estimateP98LongestInteraction();p&&p._latency!==r.value&&(r.value=p._latency,r.entries=p.entries,s())})},d=Oc("event",l,{durationThreshold:e.durationThreshold??p7});s=dh(t,r,f7,e.reportAllChanges),d&&(d.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{l(d.takeRecords()),s(!0)}))})};class g7{_processEntry(e){var n;(n=this._onBeforeProcessingEntry)==null||n.call(this,e)}}const v7=[2500,4e3],y7=(t,e={})=>{Hm(()=>{const n=fh(),r=ph("LCP");let s;const o=c_(e,g7),l=h=>{e.reportAllChanges||(h=h.slice(-1));for(const p of h)o._processEntry(p),p.startTime<n.firstHiddenTime&&(r.value=Math.max(p.startTime-Rc(),0),r.entries=[p],s())},d=Oc("largest-contentful-paint",l);if(d){s=dh(t,r,v7,e.reportAllChanges);const h=u_(()=>{l(d.takeRecords()),d.disconnect(),s(!0)}),p=g=>{g.isTrusted&&(nO(h),fm(g.type,p,{capture:!0}))};for(const g of["keydown","click","visibilitychange"])$a(g,p,{capture:!0})}})},b7=[800,1800],Zb=t=>{var e,n;(e=Xe.document)!=null&&e.prerendering?Hm(()=>Zb(t)):((n=Xe.document)==null?void 0:n.readyState)!=="complete"?addEventListener("load",()=>Zb(t),!0):setTimeout(t)},x7=(t,e={})=>{const n=ph("TTFB"),r=dh(t,n,b7,e.reportAllChanges);Zb(()=>{const s=hh();s&&(n.value=Math.max(s.responseStart-Rc(),0),n.entries=[s],r(!0))})},dd={},pm={};let rO,iO,sO,aO;function d_(t,e=!1){return qm("cls",t,w7,rO,e)}function h_(t,e=!1){return qm("lcp",t,S7,iO,e)}function _7(t){return qm("ttfb",t,E7,sO)}function oO(t){return qm("inp",t,k7,aO)}function $d(t,e){return lO(t,e),pm[t]||(j7(t),pm[t]=!0),cO(t,e)}function mh(t,e){const n=dd[t];
166if(n!=null&&n.length)for(const r of n)try{r(e)}catch(s){ia&&je.error(`Error while triggering instrumentation handler.
167Type: ${t}
168Name: ${Zs(r)}
169Error:`,s)}}function w7(){return l7(t=>{mh("cls",{metric:t}),rO=t},{reportAllChanges:!0})}function S7(){return y7(t=>{mh("lcp",{metric:t}),iO=t},{reportAllChanges:!0})}function E7(){return x7(t=>{mh("ttfb",{metric:t}),sO=t})}function k7(){return m7(t=>{mh("inp",{metric:t}),aO=t})}function qm(t,e,n,r,s=!1){lO(t,e);let o;return pm[t]||(o=n(),pm[t]=!0),r&&e({metric:r}),cO(t,e,s?o:void 0)}function j7(t){const e={};t==="event"&&(e.durationThreshold=0),Oc(t,n=>{mh(t,{entries:n})},e)}function lO(t,e){dd[t]=dd[t]||[],dd[t].push(e)}function cO(t,e,n){return()=>{n&&n();const r=dd[t];if(!r)return;const s=r.indexOf(e);s!==-1&&r.splice(s,1)}}function T7(t){return"duration"in t}const N7=t=>{const e=n=>{var r;(n.type==="pagehide"||((r=Xe.document)==null?void 0:r.visibilityState)==="hidden")&&t(n)};$a("visibilitychange",e,{capture:!0,once:!0}),$a("pagehide",e,{capture:!0,once:!0})};function d0(t){return typeof t=="number"&&isFinite(t)}function Ha(t,e,n,{...r}){const s=Tt(t).start_timestamp;return s&&s>e&&typeof t.updateStartTime=="function"&&t.updateStartTime(e),_R(t,()=>{const o=Ya({startTime:e,...r});return o&&o.end(n),o})}function f_(t){var S;const e=yt();if(!e)return;const{name:n,transaction:r,attributes:s,startTime:o}=t,{release:l,environment:d,sendDefaultPii:h}=e.getOptions(),p=e.getIntegrationByName("Replay"),g=p==null?void 0:p.getReplayId(),m=Dt(),y=m.getUser(),b=y!==void 0?y.email||y.id||y.ip_address:void 0;let _;try{_=m.getScopeData().contexts.profile.profile_id}catch{}const w={release:l,environment:d,user:b||void 0,profile_id:_||void 0,replay_id:g||void 0,transaction:r,"user_agent.original":(S=Xe.navigator)==null?void 0:S.userAgent,"client.address":h?"{{auto}}":void 0,...s};return Ya({name:n,attributes:w,startTime:o,experimental:{standalone:!0}})}function gh(){return Xe.addEventListener&&Xe.performance}function sn(t){return t/1e3}function A7(t){let e="unknown",n="unknown",r="";for(const s of t){if(s==="/"){[e,n]=t.split("/");break}if(!isNaN(Number(s))){e=r==="h"?"http":r,n=t.split(r)[1];break}r+=s}return r===t&&(e=r),{name:e,version:n}}function Gm(t){try{return PerformanceObserver.supportedEntryTypes.includes(t)}catch{return!1}}function Vm(t,e){let n,r=!1;function s(d){!r&&n&&e(d,n.spanContext().spanId,n),r=!0}N7(()=>{s("pagehide")});const o=t.on("beforeStartNavigationSpan",(d,h)=>{h!=null&&h.isRedirect||(s("navigation"),o(),l())}),l=t.on("afterStartPageLoadSpan",d=>{n=d,l()})}function C7(t){let e=0,n;if(!Gm("layout-shift"))return;const r=d_(({metric:s})=>{const o=s.entries[s.entries.length-1];
169o&&(e=s.value,n=o)},!0);Vm(t,(s,o)=>{R7(e,n,o,s),r()})}function R7(t,e,n,r){var p;ia&&je.log(`Sending CLS span (${t})`);const s=e?sn((cr()||0)+e.startTime):Bn(),o=Dt().getScopeData().transactionName,l=e?tr((p=e.sources[0])==null?void 0:p.node):"Layout shift",d={[Dn]:"auto.http.browser.cls",[Si]:"ui.webvital.cls",[Va]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};e!=null&&e.sources&&e.sources.forEach((g,m)=>{d[`cls.source.${m+1}`]=tr(g.node)});const h=f_({name:l,transaction:o,attributes:d,startTime:s});h&&(h.addEvent("cls",{[lh]:"",[ch]:t}),h.end(s))}const O7=6e4;function vh(t){return t!=null&&t>0&&t<=O7}function D7(t){let e=0,n;if(!Gm("largest-contentful-paint"))return;const r=h_(({metric:s})=>{const o=s.entries[s.entries.length-1];!o||!vh(s.value)||(e=s.value,n=o)},!0);Vm(t,(s,o)=>{I7(e,n,o,s),r()})}function I7(t,e,n,r){if(!vh(t))return;ia&&je.log(`Sending LCP span (${t})`);const s=sn((cr()||0)+((e==null?void 0:e.startTime)||0)),o=Dt().getScopeData().transactionName,l=e?tr(e.element):"Largest contentful paint",d={[Dn]:"auto.http.browser.lcp",[Si]:"ui.webvital.lcp",[Va]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};e&&(e.element&&(d["lcp.element"]=tr(e.element)),e.id&&(d["lcp.id"]=e.id),e.url&&(d["lcp.url"]=e.url),e.loadTime!=null&&(d["lcp.loadTime"]=e.loadTime),e.renderTime!=null&&(d["lcp.renderTime"]=e.renderTime),e.size!=null&&(d["lcp.size"]=e.size));const h=f_({name:l,transaction:o,attributes:d,startTime:s});h&&(h.addEvent("lcp",{[lh]:"millisecond",[ch]:t}),h.end(s))}function di(t){return t&&((cr()||performance.timeOrigin)+t)/1e3}function uO(t){var n;const e={};if(t.nextHopProtocol!=null){const{name:r,version:s}=A7(t.nextHopProtocol);e["network.protocol.version"]=s,e["network.protocol.name"]=r}return cr()||(n=gh())!=null&&n.timeOrigin?M7({...e,"http.request.redirect_start":di(t.redirectStart),"http.request.redirect_end":di(t.redirectEnd),"http.request.worker_start":di(t.workerStart),"http.request.fetch_start":di(t.fetchStart),"http.request.domain_lookup_start":di(t.domainLookupStart),"http.request.domain_lookup_end":di(t.domainLookupEnd),"http.request.connect_start":di(t.connectStart),"http.request.secure_connection_start":di(t.secureConnectionStart),"http.request.connection_end":di(t.connectEnd),"http.request.request_start":di(t.requestStart),"http.request.response_start":di(t.responseStart),"http.request.response_end":di(t.responseEnd),"http.request.time_to_first_byte":t.responseStart!=null?t.responseStart/1e3:void 0}):e}function M7(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!=null))}const L7=2147483647;let PT=0,vr={},Rr,sc;function P7({recordClsStandaloneSpans:t,recordLcpStandaloneSpans:e,client:n}){const r=gh();if(r&&cr()){r.mark&&Xe.performance.mark("sentry-tracing-init");const s=e?D7(n):e===!1?B7():void 0,o=t?C7(n):t===!1?z7():void 0,l=H7();return()=>{l(),s==null||s(),o==null||o()}}return()=>{}}function F7(){$d("longtask",({entries:t})=>{const e=Qr();if(!e)return;const{op:n,start_timestamp:r}=Tt(e);for(const s of t){const o=sn(cr()+s.startTime),l=sn(s.duration);n==="navigation"&&r&&o<r||Ha(e,o,o+l,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[Dn]:"auto.ui.browser.metrics"}})}})}function $7(){new PerformanceObserver(e=>{const n=Qr();if(n)for(const r of e.getEntries()){if(!r.scripts[0])continue;const s=sn(cr()+r.startTime),{start_timestamp:o,op:l}=Tt(n);if(l==="navigation"&&o&&s<o)continue;const d=sn(r.duration),h={[Dn]:"auto.ui.browser.metrics"},p=r.scripts[0],{invoker:g,invokerType:m,sourceURL:y,sourceFunctionName:b,sourceCharPosition:_}=p;h["browser.script.invoker"]=g,h["browser.script.invoker_type"]=m,y&&(h["code.filepath"]=y),b&&(h["code.function"]=b),_!==-1&&(h["browser.script.source_char_position"]=_),Ha(n,s,s+d,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:h})}}).observe({type:"long-animation-frame",buffered:!0})}function U7(){$d("event",({entries:t})=>{const e=Qr();if(e){for(const n of t)if(n.name==="click"){const r=sn(cr()+n.startTime),s=sn(n.duration),o={name:tr(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[Dn]:"auto.ui.browser.metrics"}},l=zC(n.target);l&&(o.attributes["ui.component_name"]=l),Ha(e,r,r+s,o)}}})}function z7(){return d_(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(vr.cls={value:t.value,unit:""},sc=e)},!0)}function B7(){return h_(({metric:t})=>{const e=t.entries[t.entries.length-1];!e||!vh(t.value)||(vr.lcp={value:t.value,unit:"millisecond"},Rr=e)},!0)}function H7(){return _7(({metric:t})=>{t.entries[t.entries.length-1]&&(vr.ttfb={value:t.value,unit:"millisecond"})})}function q7(t,e){const n=gh(),r=cr();if(!(n!=null&&n.getEntries)||!r)return;const{spanStreamingEnabled:s,ignorePerformanceApiSpans:o,ignoreResourceSpans:l,recordClsOnPageloadSpan:d,recordLcpOnPageloadSpan:h}=e,p=sn(r),g=n.getEntries(),{op:m,start_timestamp:y}=Tt(t);if(g.slice(PT).forEach(b=>{const _=sn(b.startTime),w=sn(Math.max(0,b.duration));if(!(m==="navigation"&&y&&p+_<y))switch(b.entryType){case"navigation":{Y7(t,b,p);break}case"mark":case"paint":case"measure":{V7(t,b,_,w,p,o);const S=fh(),E=b.startTime<S.firstHiddenTime;b.name==="first-paint"&&E&&(vr.fp={value:b.startTime,unit:"millisecond"}),b.name==="first-contentful-paint"&&E&&(vr.fcp={value:b.startTime,unit:"millisecond"});break}case"resource":{X7(t,b,b.name,_,w,p,l);break}}}),PT=Math.max(g.length-1,0),Z7(t,s),m==="pageload"){if(tB(vr),s){const b=(_,w,S)=>{const E=S??`browser.web_vital.${_}.value`;t.setAttribute(E,w),ia&&je.log("Setting web vital attribute",{[E]:w},"on pageload span")};["ttfb","fp","fcp"].forEach(_=>{vr[_]&&b(_,vr[_].value)}),vr["ttfb.requestTime"]&&b("ttfb.requestTime",vr["ttfb.requestTime"].value,"browser.web_vital.ttfb.request_time")}else d||delete vr.cls,h||delete vr.lcp,Object.entries(vr).forEach(([b,_])=>{w$(b,_.value,_.unit)}),Q7(t,e);t.setAttribute(s?"browser.performance.time_origin":"performance.timeOrigin",p),t.setAttribute(s?"browser.performance.navigation.activation_start":"performance.activationStart",Rc())}Rr=void 0,sc=void 0,vr={}}function G7(t){if((t==null?void 0:t.entryType)==="measure")try{return t.detail.devtools.track==="Components ⚛"}catch{return}}function V7(t,e,n,r,s,o){if(G7(e)||["mark","measure"].includes(e.entryType)&&Ks(e.name,o))return;const l=hh(!1),d=sn(l?l.requestStart:0),h=s+Math.max(n,d),p=s+n,g=p+r,m={[Dn]:"auto.resource.browser.metrics"};h!==p&&(m["sentry.browser.measure_happened_before_request"]=!0,m["sentry.browser.measure_start_time"]=h),W7(m,e),h<=g&&Ha(t,h,g,{name:e.name,op:e.entryType,attributes:m})}function W7(t,e){try{const n=e.detail;if(!n)return;if(typeof n=="object"){for(const[r,s]of Object.entries(n))if(s&&wc(s))t[`sentry.browser.measure.detail.${r}`]=s;else if(s!==void 0)try{t[`sentry.browser.measure.detail.${r}`]=JSON.stringify(s)}catch{}return}if(wc(n)){t["sentry.browser.measure.detail"]=n;return}try{t["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function Y7(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{np(t,e,r,n)}),np(t,e,"secureConnection",n,"TLS/SSL"),np(t,e,"fetch",n,"cache"),np(t,e,"domainLookup",n,"DNS"),J7(t,e,n)}function np(t,e,n,r,s=n){const o=K7(n),l=e[o],d=e[`${n}Start`];!d||!l||Ha(t,r+sn(d),r+sn(l),{op:`browser.${s}`,name:e.name,attributes:{[Dn]:"auto.ui.browser.metrics",...n==="redirect"&&e.redirectCount!=null?{"http.redirect_count":e.redirectCount}:{}}})}function K7(t){return t==="secureConnection"?"connectEnd":t==="fetch"?"domainLookupStart":`${t}End`}function J7(t,e,n){const r=n+sn(e.requestStart),s=n+sn(e.responseEnd),o=n+sn(e.responseStart);e.responseEnd&&(Ha(t,r,s,{op:"browser.request",name:e.name,attributes:{[Dn]:"auto.ui.browser.metrics"}}),Ha(t,o,s,{op:"browser.response",name:e.name,attributes:{[Dn]:"auto.ui.browser.metrics"}}))}function X7(t,e,n,r,s,o,l){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;const d=e.initiatorType?`resource.${e.initiatorType}`:"resource.other";if(l!=null&&l.includes(d))return;const h={[Dn]:"auto.resource.browser.metrics"},p=Mo(n);p.protocol&&(h["url.scheme"]=p.protocol.split(":").pop()),p.host&&(h["server.address"]=p.host),h["url.same_origin"]=n.includes(Xe.location.origin),eB(e,h,[["responseStatus","http.response.status_code"],["transferSize","http.response_transfer_size"],["encodedBodySize","http.response_content_length"],["decodedBodySize","http.decoded_response_content_length"],["renderBlockingStatus","resource.render_blocking_status"],["deliveryType","http.response_delivery_type"]]);const g={...h,...uO(e)},m=o+r,y=m+s;Ha(t,m,y,{name:n.replace(Xe.location.origin,""),op:d,attributes:g})}function Z7(t,e){const n=Xe.navigator;if(!n)return;const r=n.connection;r&&(r.effectiveType&&t.setAttribute(e?"network.connection.effective_type":"effectiveConnectionType",r.effectiveType),r.type&&t.setAttribute(e?"network.connection.type":"connectionType",r.type),d0(r.rtt)&&(vr["connection.rtt"]={value:r.rtt,unit:"millisecond"},e&&t.setAttribute("network.connection.rtt",r.rtt))),d0(n.deviceMemory)&&(e?t.setAttribute("device.memory.estimated_capacity",n.deviceMemory):t.setAttribute("deviceMemory",`${n.deviceMemory} GB`)),d0(n.hardwareConcurrency)&&(e?t.setAttribute("device.processor_count",n.hardwareConcurrency):t.setAttribute("hardwareConcurrency",String(n.hardwareConcurrency)))}function Q7(t,e){Rr&&e.recordLcpOnPageloadSpan&&(Rr.element&&t.setAttribute("lcp.element",tr(Rr.element)),Rr.id&&t.setAttribute("lcp.id",Rr.id),Rr.url&&t.setAttribute("lcp.url",Rr.url.trim().slice(0,200)),Rr.loadTime!=null&&t.setAttribute("lcp.loadTime",Rr.loadTime),Rr.renderTime!=null&&t.setAttribute("lcp.renderTime",Rr.renderTime),t.setAttribute("lcp.size",Rr.size)),sc!=null&&sc.sources&&e.recordClsOnPageloadSpan&&sc.sources.forEac
169h((n,r)=>t.setAttribute(`cls.source.${r+1}`,tr(n.node)))}function eB(t,e,n){n.forEach(([r,s])=>{const o=t[r];o!=null&&(typeof o=="number"&&o<L7||typeof o=="string")&&(e[s]=o)})}function tB(t){const e=hh(!1);if(!e)return;const{responseStart:n,requestStart:r}=e;r<=n&&(t["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}const h0=[],hd=new Map,Bl=new Map,dO=60;function nB(){if(gh()&&cr()){const e=rB();return()=>{e()}}return()=>{}}const Ud={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function rB(){return oO(iB)}const iB=({metric:t})=>{if(t.value==null)return;const e=sn(t.value);if(e>dO)return;const n=t.entries.find(_=>_.duration===t.value&&Ud[_.name]);if(!n)return;const{interactionId:r}=n,s=Ud[n.name],o=sn(cr()+n.startTime),l=Qr(),d=l?lr(l):void 0,h=r!=null?hd.get(r):void 0,p=(h==null?void 0:h.span)||d,g=p?Tt(p).description:Dt().getScopeData().transactionName,m=(h==null?void 0:h.elementName)||tr(n.target),y={[Dn]:"auto.http.browser.inp",[Si]:`ui.interaction.${s}`,[Va]:n.duration},b=f_({name:m,transaction:g,attributes:y,startTime:o});b&&(b.addEvent("inp",{[lh]:"millisecond",[ch]:t.value}),b.end(o+e))};function sB(t){return t!=null?hd.get(t):void 0}function aB(){const t=Object.keys(Ud);zm()&&t.forEach(s=>{Xe.addEventListener(s,e,{capture:!0,passive:!0})});function e(s){const o=s.target;if(!o)return;const l=tr(o),d=Math.round(s.timeStamp);if(Bl.set(d,l),Bl.size>50){const h=Bl.keys().next().value;h!==void 0&&Bl.delete(h)}}function n(s){const o=Math.round(s.startTime);let l=Bl.get(o);if(!l)for(let d=-5;d<=5;d++){const h=Bl.get(o+d);if(h){l=h;break}}return l||"<unknown>"}const r=({entries:s})=>{const o=Qr(),l=o&&lr(o);s.forEach(d=>{if(!T7(d))return;const h=d.interactionId;if(h==null||hd.has(h))return;const p=d.target?tr(d.target):n(d);if(h0.length>10){const g=h0.shift();hd.delete(g)}h0.push(h),hd.set(h,{span:l,elementName:p})})};$d("event",r),$d("first-input",r)}function p_(t){var _,w;const{name:e,op:n,origin:r,metricName:s,value:o,attributes:l,parentSpan:d,reportEvent:h,startTime:p,endTime:g}=t,m=Dt().getScopeData().transactionName,y={[Dn]:r,[Si]:n,[Va]:0,[`browser.web_vital.${s}.value`]:o,"sentry.transaction":m,"user_agent.original":(_=Xe.navigator)==null?void 0:_.userAgent,...l};d&&((w=oR(d).attributes)==null?void 0:w[Si])==="pageload"&&(y["sentry.pageload.span_id"]=d.spanContext().spanId),h&&(y[`browser.web_vital.${s}.report_event`]=h);const b=Ya({name:e,attributes:y,startTime:p,parentSpan:d});b&&b.end(g??p)}function oB(t){let e=0,n;if(!Gm("largest-contentful-paint"))return;const r=h_(({metric:s})=>{const o=s.entries[s.entries.length-1];
169!o||!vh(s.value)||(e=s.value,n=o)},!0);Vm(t,(s,o,l)=>{lB(e,n,l,s),r()})}function lB(t,e,n,r){if(!vh(t))return;ia&&je.log(`Sending LCP span (${t})`);const s=cr()||0,o=sn(s),l=sn(s+((e==null?void 0:e.startTime)||0)),d=e?tr(e.element):"Largest contentful paint",h={};e!=null&&e.element&&(h["browser.web_vital.lcp.element"]=tr(e.element)),e!=null&&e.id&&(h["browser.web_vital.lcp.id"]=e.id),e!=null&&e.url&&(h["browser.web_vital.lcp.url"]=e.url),(e==null?void 0:e.loadTime)!=null&&(h["browser.web_vital.lcp.load_time"]=e.loadTime),(e==null?void 0:e.renderTime)!=null&&(h["browser.web_vital.lcp.render_time"]=e.renderTime),(e==null?void 0:e.size)!=null&&(h["browser.web_vital.lcp.size"]=e.size),p_({name:d,op:"ui.webvital.lcp",origin:"auto.http.browser.lcp",metricName:"lcp",value:t,attributes:h,parentSpan:n,reportEvent:r,startTime:o,endTime:l})}function cB(t){let e=0,n;if(!Gm("layout-shift"))return;const r=d_(({metric:s})=>{const o=s.entries[s.entries.length-1];o&&(e=s.value,n=o)},!0);Vm(t,(s,o,l)=>{uB(e,n,l,s),r()})}function uB(t,e,n,r){var d;ia&&je.log(`Sending CLS span (${t})`);const s=e?sn((cr()||0)+e.startTime):Bn(),o=e?tr((d=e.sources[0])==null?void 0:d.node):"Layout shift",l={};e!=null&&e.sources&&e.sources.forEach((h,p)=>{l[`browser.web_vital.cls.source.${p+1}`]=tr(h.node)}),p_({name:o,op:"ui.webvital.cls",origin:"auto.http.browser.cls",metricName:"cls",value:t,attributes:l,parentSpan:n,reportEvent:r,startTime:s})}function dB(){if(!gh()||!cr())return;oO(({metric:n})=>{if(n.value==null||sn(n.value)>dO)return;const s=n.entries.find(o=>o.duration===n.value&&Ud[o.name]);s&&hB(n.value,s)})}function hB(t,e){ia&&je.log(`Sending INP span (${t})`);const n=sn(cr()+e.startTime),r=sn(t),s=Ud[e.name],o=sB(e.interactionId),l=Qr(),d=l?lr(l):void 0,h=(o==null?void 0:o.span)||d,p=h?oR(h).name:Dt().getScopeData().transactionName,g=(o==null?void 0:o.elementName)||tr(e.target);p_({name:g,op:`ui.interaction.${s}`,origin:"auto.http.browser.inp",metricName:"inp",value:t,attributes:{[Va]:e.duration,"sentry.transaction":p},startTime:n,endTime:n+r,parentSpan:h})}const fB=1e3;let FT,Qb,ex;function pB(t){qa("dom",t),Ga("dom",mB)}function mB(){if(!Xe.document)return;const t=bi.bind(null,"dom"),e=$T(t,!0);Xe.document.addEventListener("click",e,!1),Xe.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{var o,l;const s=(o=Xe[n])==null?void 0:o.prototype;(l=s==null?void 0:s.hasOwnProperty)!=null&&l.call(s,"addEventListener")&&(Kr(s,"addEventListener",function(d){return function(h,p,g){if(h==="click"||h=="keypress")try{const m=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},y=m[h]=m[h]||{refCount:0};if(!y.handler){const b=$T(t);y.handler=b,d.call(this,h,b,g)}y.refCount++}catch{}return d.call(this,h,p,g)}}),Kr(s,"removeEventListener",function(d){return function(h,p,g){if(h==="click"||h=="keypress")try{const m=this.__sentry_instrumentation_handlers__||{},y=m[h];y&&(y.refCount--,y.refCount<=0&&(d.call(this,h,y.handler,g),y.handler=void 0,delete m[h]),Object.keys(m).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return d.call(this,h,p,g)}}))})}function gB(t){if(t.type!==Qb)return!1;try{if(!t.target||t.target._sentryId!==ex)return!1}catch{}return!0}function vB(t,e){return t!=="keypress"?!1:e!=null&&e.tagName?!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable):!0}function $T(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;const r=yB(n);if(vB(n.type,r))return;Ir(n,"_sentryCaptured",!0),r&&!r._sentryId&&Ir(r,"_sentryId",xi());
vendor: 6,550 bytes, lines 169-170
169const s=n.type==="keypress"?"input":n.type;gB(n)||(t({event:n,name:s,global:e}),Qb=n.type,ex=r?r._sentryId:void 0),clearTimeout(FT),FT=Xe.setTimeout(()=>{ex=void 0,Qb=void 0},fB)}}function yB(t){try{return t.target}catch{return null}}let rp;function m_(t){const e="history";qa(e,t),Ga(e,bB)}function bB(){if(Xe.addEventListener("popstate",()=>{const e=Xe.location.href,n=rp;if(rp=e,n===e)return;bi("history",{from:n,to:e})}),!Oz())return;function t(e){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const s=rp,o=xB(String(r));if(rp=o,s===o)return e.apply(this,n);bi("history",{from:s,to:o})}return e.apply(this,n)}}Kr(Xe.history,"pushState",t),Kr(Xe.history,"replaceState",t)}function xB(t){try{return new URL(t,Xe.location.origin).toString()}catch{return t}}const jp={};function _B(t){const e=jp[t];if(e)return e;let n=Xe[t];if(Yb(n))return jp[t]=n.bind(Xe);const r=Xe.document;if(r&&typeof r.createElement=="function")try{const s=r.createElement("iframe");s.hidden=!0,r.head.appendChild(s);const o=s.contentWindow;o!=null&&o[t]&&(n=o[t]),r.head.removeChild(s)}catch(s){ia&&je.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,s)}return n&&(jp[t]=n.bind(Xe))}function wB(t){jp[t]=void 0}const ac="__sentry_xhr_v3__";function hO(t){qa("xhr",t),Ga("xhr",SB)}function SB(){if(!Xe.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,n,r){const s=new Error,o=Bn()*1e3,l=Ys(r[0])?r[0].toUpperCase():void 0,d=EB(r[1]);if(!l||!d)return e.apply(n,r);n[ac]={method:l,url:d,request_headers:{}},l==="POST"&&d.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const h=()=>{const p=n[ac];if(p&&n.readyState===4){try{p.status_code=n.status}catch{}const g={endTimestamp:Bn()*1e3,startTimestamp:o,xhr:n,virtualError:s};bi("xhr",g)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(p,g,m){return h(),p.apply(g,m)}}):n.addEventListener("readystatechange",h),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(p,g,m){const[y,b]=m,_=g[ac];return _&&Ys(y)&&Ys(b)&&(_.request_headers[y.toLowerCase()]=b),p.apply(g,m)}}),e.apply(n,r)}}),t.send=new Proxy(t.send,{apply(e,n,r){const s=n[ac];if(!s)return e.apply(n,r);r[0]!==void 0&&(s.body=r[0]);const o={startTimestamp:Bn()*1e3,xhr:n};return bi("xhr",o),e.apply(n,r)}})}function EB(t){if(Ys(t))return t;try{return t.toString()}catch{}}function kB(t){let e;try{e=t.getAllResponseHeaders()}catch(n){return ia&&je.error(n,"Failed to get xhr response headers",t),{}}return e?e.split(`\r
170`).reduce((n,r)=>{const[s,o]=r.split(": ");return o&&(n[s.toLowerCase()]=o),n},{}):{}}const jB=40;function TB(t,e=_B("fetch")){let n=0,r=0;async function s(o){const l=o.body.length;n+=l,r++;const d={body:o.body,method:"POST",referrerPolicy:"strict-origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};try{const h=await e(t.url,d);return{statusCode:h.status,headers:{"x-sentry-rate-limits":h.headers.get("X-Sentry-Rate-Limits"),"retry-after":h.headers.get("Retry-After")}}}catch(h){throw wB("fetch"),h}finally{n-=l,r--}}return OU(t,s,s_(t.bufferSize||jB))}const _r=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,NB=30,AB=50;function tx(t,e,n,r){const s={filename:t,function:e==="<anonymous>"?Po:e,in_app:!0};return n!==void 0&&(s.lineno=n),r!==void 0&&(s.colno=r),s}const CB=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,RB=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,OB=/\((\S*)(?::(\d+))(?::(\d+))\)/,DB=/at (.+?) ?\(data:(.+?),/,IB=t=>{var s;const e=t.match(DB);if(e)return{filename:`<data:${e[2]}>`,function:e[1]};const n=CB.exec(t);if(n){const[,o,l,d]=n;return tx(o,Po,+l,+d)}const r=RB.exec(t);if(r){if(((s=r[2])==null?void 0:s.indexOf("eval"))===0){const h=OB.exec(r[2]);h&&(r[2]=h[1],r[3]=h[2],r[4]=h[3])}const[l,d]=fO(r[1]||Po,r[2]);return tx(d,l,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},MB=[NB,IB],LB=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,PB=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,FB=t=>{const e=LB.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const o=PB.exec(e[3]);o&&(e[1]=e[1]||"eval",e[3]=o[1],e[4]=o[2],e[5]="")}let r=e[3],s=e[1]||Po;return[s,r]=fO(s,r),tx(r,s,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},$B=[AB,FB],UB=[MB,$B],zB=IC(...UB),fO=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:Po,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},ip=1024,BB="Breadcrumbs",HB=((t={})=>{const e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:BB,setup(n){e.console&&fz(WB(n)),e.dom&&pB(VB(n,e.dom)),e.xhr&&hO(YB(n)),e.fetch&&a_(KB(n)),e.history&&m_(JB(n)),e.sentry&&n.on("beforeSendEvent",GB(n))}}}),qB=HB;function GB(t){return function(n){yt()===t&&Fo({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:To(n)},{event:n})}}function VB(t,e){return function(r){if(yt()!==t)return;let s,o,l=typeof e=="object"?e.serializeAttribute:void 0,d=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;d&&d>ip&&(_r&&je.warn(`\`dom.maxStringLength\` cannot exceed ${ip}, but a value of ${d} was configured. Sentry will use ${ip} instead.`),d=ip),typeof l=="string"&&(l=[l]);try{const p=r.event,g=XB(p)?p.target:p;s=tr(g,{keyAttrs:l,maxStringLength:d}),o=zC(g)}catch{s="<unknown>"}if(s.length===0)return;const h={category:`ui.${r.name}`,message:s};o&&(h.data={"ui.component_name":o}),Fo(h,{event:r.event,name:r.name,global:r.global})}}function WB(t){return function(n){if(yt()!==t)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:mz(n.level),message:Wj(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${Wj(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;Fo(r,{input:n.args,level:n.level})}}function YB(t){return function(n){if(yt()!==t)return;const{startTimestamp:r,endTimestamp:s}=n,o=n.xhr[ac];if(!r||!s||!o)return;const{method:l,url:d,status_code:h,body:p}=o,g={method:l,url:d,status_code:h},m={xhr:n.xhr,input:p,startTimestamp:r,endTimestamp:s},y={category:"xhr",data:g,type:"http",level:YR(h)};t.emit("beforeOutgoingRequestBreadcrumb",y,m),Fo(y,m)}}function KB(t){return function(n){if(yt()!==t)return;const{startTimestamp:r,endTimestamp:s}=n;
170if(s&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const o={data:n.error,input:n.args,startTimestamp:r,endTimestamp:s},l={category:"fetch",data:n.fetchData,level:"error",type:"http"};t.emit("beforeOutgoingRequestBreadcrumb",l,o),Fo(l,o)}else{const o=n.response,l={...n.fetchData,status_code:o==null?void 0:o.status},d={input:n.args,response:o,startTimestamp:r,endTimestamp:s},h={category:"fetch",data:l,type:"http",level:YR(l.status_code)};t.emit("beforeOutgoingRequestBreadcrumb",h,d),Fo(h,d)}}}function JB(t){return function(n){if(yt()!==t)return;let r=n.from,s=n.to;const o=Mo(nt.location.href);let l=r?Mo(r):void 0;const d=Mo(s);l!=null&&l.path||(l=o),o.protocol===d.protocol&&o.host===d.host&&(s=d.relative),o.protocol===l.protocol&&o.host===l.host&&(r=l.relative),Fo({category:"navigation",data:{from:r,to:s}})}}function XB(t){return!!t&&!!t.target}const ZB="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),QB="BrowserApiErrors",eH=((t={})=>{const e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...t};return{name:QB,setupOnce(){e.setTimeout&&Kr(nt,"setTimeout",UT),e.setInterval&&Kr(nt,"setInterval",UT),e.requestAnimationFrame&&Kr(nt,"requestAnimationFrame",nH),e.XMLHttpRequest&&"XMLHttpRequest"in nt&&Kr(XMLHttpRequest.prototype,"send",rH);const n=e.eventTarget;n&&(Array.isArray(n)?n:ZB).forEach(s=>iH(s,e))}}}),tH=eH;function UT(t){return function(...e){const n=e[0];return e[0]=kc(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Zs(t)}`}}),t.apply(this,e)}}function nH(t){return function(e){return t.apply(this,[kc(e,{mechanism:{data:{handler:Zs(t)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function rH(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(s=>{s in n&&typeof n[s]=="function"&&Kr(n,s,function(o){const l={mechanism:{data:{handler:Zs(o)},handled:!1,type:`auto.browser.browserapierrors.xhr.${s}`}},d=Xx(o);return d&&(l.mechanism.data.handler=Zs(d)),kc(o,l)})}),t.apply(this,e)}}function iH(t,e){var s,o;const r=(s=nt[t])==null?void 0:s.prototype;(o=r==null?void 0:r.hasOwnProperty)!=null&&o.call(r,"addEventListener")&&(Kr(r,"addEventListener",function(l){return function(d,h,p){try{sH(h)&&(h.handleEvent=kc(h.handleEvent,{mechanism:{data:{handler:Zs(h),target:t},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return e.unregisterOriginalCallbacks&&aH(this,d,h),l.apply(this,[d,kc(h,{mechanism:{data:{handler:Zs(h),target:t},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),p])}}),Kr(r,"removeEventListener",function(l){return function(d,h,p){try{const g=h.__sentry_wrapped__;g&&l.call(this,d,g,p)}catch{}return l.call(this,d,h,p)}}))}function sH(t){return typeof t.handleEvent=="function"}function aH(t,e,n){t&&typeof t=="object"&&"removeEventListener"in t&&typeof t.removeEventListener=="function"&&t.removeEventListener(e,n)}const oH=(t={})=>{const e=t.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof nt.document>"u"){_r&&je.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}vT({ignoreDuration:!0}),s0();const n=Hi();let r=n.getUser();n.addScopeListener(s=>{const o=s.getUser();((r==null?void 0:r.id)!==(o==null?void 0:o.id)||(r==null?void 0:r.ip_address)!==(o==null?void 0:o.ip_address))&&(s0(),r=o)}),e==="route"&&m_(({from:s,to:o})=>{s!==o&&(vT({ignoreDuration:!0}),s0())})}}},lH="CultureContext",cH=(()=>({name:lH,preprocessEvent(t){var n;const e=zT();e&&(t.contexts={...t.contexts,culture:{...e,...(n=t.contexts)==null?void 0:n.culture}})},processSegmentSpan(t){const e=zT();e&&TR(t,{"culture.locale":e.locale,"culture.timezone":e.timezone,"culture.calendar":e.calendar})}})),uH=cH;function zT(){try{const t=nt.Intl;if(!t)return;const e=t.DateTimeFormat().resolvedOptions();return{locale:e.locale,timezone:e.timeZone,calendar:e.calendar}}catch{return}}const dH="GlobalHandlers",hH=((t={})=>{const e={onerror:!0,onunhandledrejection:!0,...t};return{name:dH,setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&(pH(n),BT("onerror")),e.onunhandledrejection&&(mH(n),BT("onunhandledrejection"))}}}),fH=hH;function pH(t){LC(e=>{const{stackParser:n,attachStacktrace:r}=pO();if(yt()!==t||JR())return;const{msg:s,url:o,line:l,column:d,error:h}=e,p=yH(l_(n,h||s,void 0,r,!1),o,l,d);p.level="error",NR(p,{originalException:h,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function mH(t){PC(e=>{const{stackParser:n,attachStacktrace:r}=pO();if(yt()!==t||JR())return;const s=gH(e),o=wc(s)?vH(s):l_(n,s,void 0,r,!0);o.level="error",NR(o,{originalException:s,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function gH(t){if(wc(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}function vH(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function yH(t,e,n,r){const s=t.exception=t.exception||{},o=s.values=s.values||[],l=o[0]=o[0]||{},d=l.stacktrace=l.stacktrace||{},h=d.frames=d.frames||[];return h.length===0&&h.push({colno:r,lineno:n,filename:bH(e)??rh(),function:Po,in_app:!0}),t}function BT(t){_r&&je.log(`Global Handler attached: ${t}`)}function pO(){const t=yt();return(t==null?void 0:t.getOptions())||{stackParser:()=>[],attachStacktrace:!1}}function bH(t){if(!(!Ys(t)||t.length===0))return t.startsWith("data:")?`<${rs(t,!1)}>`:t}const xH=()=>({name:"HttpContext",preprocessEvent(t){var r;if(!nt.navigator&&!nt.location&&!nt.document)return;const e=hm(),n={...e.headers,...(r=t.request)==null?void 0:r.headers};t.request={...e,...t.request,headers:n}},processSegmentSpan(t){if(!nt.navigator&&!nt.location&&!nt.document)return;const e=hm();TR(t,{"url.full":e.url||void 0,"http.request.header.user_agent":e.headers["User-Agent"],"http.request.header.referer":e.headers.Referer})}}),_H="cause",wH=5,SH="LinkedErrors",EH=((t={})=>{const e=t.limit||wH,n=t.key||_H;return{name:SH,preprocessEvent(r,s,o){const l=o.getOptions();dz(o_,l.stackParser,n,e,r,s)}}}),kH=EH;function jH(){return TH()?(_r&&Ho(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function TH(){var s;if(typeof nt.window>"u")return!1;const t=nt;if(t.nw)return!1;const e=t.chrome||t.browser;if(!((s=e==null?void 0:e.runtime)!=null&&s.id))return!1;const n=rh();return!(nt===nt.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function NH(t){return[rz(),QU(),Ez(),tH(),qB(),fH(),kH(),yz(),xH(),uH(),oH()]}function AH(t={}){const e=!t.skipBrowserExtensionCheck&&jH();let n=t.defaultIntegrations==null?NH():t.defaultIntegrations;const r={...t,enabled:e?!1:t.enabled,stackParser:GF(t.stackParser||zB),integrations:fU({integrations:t.integrations,defaultIntegrations:n}),transport:t.transport||TB};return GU(Zz,r)}function HT(t={}){const e=nt.document,n=(e==null?void 0:e.head)||(e==null?void 0:e.body);if(!n){_r&&je.error("[showReportDialog] Global document not defined");return}const r=Dt(),s=yt(),o=s==null?void 0:s.getDsn();if(!o){_r&&je.error("[showReportDialog] DSN not configured");return}const l={...t,user:{...r.getUser(),...t.user},eventId:t.eventId||sU()},d=nt.document.createElement("script");d.async=!0,d.crossOrigin="anonymous",d.src=dU(o,l);const{onLoad:h,onClose:p}=l;if(h&&(d.onload=h),p){const g=m=>{if(m.data==="__sentry_reportdialog_closed__")try{p()}finally{nt.removeEventListener("message",g)}};nt.addEventListener("message",g)}n.appendChild(d)}function CH(t){return t.split(",").some(e=>e.trim().startsWith("sentry-"))}function mO(t){try{return new URL(t,nt.location.origin).href}catch{return}}function RH(t){return t.entryType==="resource"&&"initiatorType"in t&&typeof t.nextHopProtocol=="string"&&(t.initiatorType==="fetch"||t.initiatorType==="xmlhttprequest")}function gO(t){try{return new Headers(t)}catch{return}}const vO={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function OH(t,e){const{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:s,enableHTTPTimings:o,tracePropagationTargets:l,onRequestSpanStart:d,onRequestSpanEnd:h}={...vO,...e},p=typeof s=="function"?s:b=>!0,g=b=>IH(b,l),m={},y=t.getOptions().propagateTraceparent;n&&a_(b=>{const _=kz(b,p,g,m,{propagateTraceparent:y,onRequestSpanEnd:h});if(_){const w=mO(b.fetchData.url),S=w?Mo(w).host:void 0;_.setAttributes({"http.url":w?rs(w):void 0,"server.address":S}),o&&qT(_,t),d==null||d(_,{headers:b.headers})}}),r&&hO(b=>{var w;const _=MH(b,p,g,m,y,h);_&&(o&&qT(_,t),d==null||d(_,{headers:gO((w=b.xhr.__sentry_xhr_v3__)==null?void 0:w.request_headers)}))})}const DH=300;function qT(t,e){const{url:n}=Tt(t).data;
170if(!n||typeof n!="string")return;let r=()=>void setTimeout(s);if(as(e)){const o=t.end.bind(t);t.end=l=>{const d=l??Bn();let h=!1;const p=()=>{h||(h=!0,setTimeout(s),o(d),clearTimeout(g))};r=p;const g=setTimeout(p,DH)}}const s=$d("resource",({entries:o})=>{o.forEach(l=>{RH(l)&&l.name.endsWith(n)&&(t.setAttributes(uO(l)),r())})})}function IH(t,e){const n=rh();if(n){let r,s;try{r=new URL(t,n),s=new URL(n).origin}catch{return!1}const o=r.origin===s;return e?Ks(r.toString(),e)||o&&Ks(r.pathname,e):o}else{const r=!!t.match(/^\/(?!\/)/);return e?Ks(t,e):r}}function MH(t,e,n,r,s,o){const l=t.xhr,d=l==null?void 0:l[ac];if(!l||l.__sentry_own_request__||!d)return;const{url:h,method:p}=d,g=Ui()&&e(h);if(t.endTimestamp){const k=l.__sentry_xhr_span_id__;if(!k)return;const j=r[k];j&&(g&&d.status_code!==void 0&&(KC(j,d.status_code),j.end(),o==null||o(j,{headers:gO(kB(l)),error:t.error})),delete r[k]);return}const m=mO(h),y=Mo(m||h),b=rs(q$(h)),_=yt(),S=!!Qr()||!!_&&as(_),E=g&&S?Ya({name:`${p} ${b}`,attributes:{url:rs(h),type:"xhr","http.method":p,"http.url":m?rs(m):void 0,"server.address":y==null?void 0:y.host,[Dn]:"auto.http.browser",[Si]:"http.client",...(y==null?void 0:y.search)&&{"http.query":y==null?void 0:y.search},...(y==null?void 0:y.hash)&&{"http.fragment":y==null?void 0:y.hash}}}):new ns;return g&&!S&&(_==null||_.recordDroppedEvent("no_parent_span","span")),l.__sentry_xhr_span_id__=E.spanContext().spanId,r[l.__sentry_xhr_span_id__]=E,n(h)&&LH(l,Ui()&&S?E:void 0,s),_&&_.emit("beforeOutgoingRequestSpan",E,t),E}function LH(t,e,n){const{"sentry-trace":r,baggage:s,traceparent:o}=qR({span:e,propagateTraceparent:n});r&&PH(t,r,s,o)}function PH(t,e,n,r){var o;const s=(o=t.__sentry_xhr_v3__)==null?void 0:o.request_headers;if(!(s!=null&&s["sentry-trace"]||!t.setRequestHeader))try{if(t.setRequestHeader("sentry-trace",e),r&&!(s!=null&&s.traceparent)&&t.setRequestHeader("traceparent",r),n){const l=s==null?void 0:s.baggage;(!l||!CH(l))&&t.setRequestHeader("baggage",n)}}catch{}}const GT=new WeakMap,VT=new WeakMap,FH=9e4,$H=["text/event-stream","application/x-ndjson","application/stream+json"],UH=()=>({name:"FetchStreamPerformance",setup(){Mz(t=>{if(t.response){const e=GT.get(t.response);if(e&&t.endTimestamp){e.end(t.endTimestamp);const n=VT.get(t.response);n&&clearTimeout(n)}}}),a_(t=>{var e,n,r,s;if(t.endTimestamp&&t.response){const o=((e=t.response.headers)==null?void 0:e.get("
170content-type"))||"";if((n=t.response.headers)!=null&&n.get("content-length")||!$H.some(y=>o.startsWith(y)))return;const l=((r=t.fetchData)==null?void 0:r.url)||"",d=((s=t.fetchData)==null?void 0:s.method)||"GET",h=n_(l),p=l.startsWith("data:")?rs(l):h?jR(h):l,g=Ya({name:`${d} ${p}`,startTime:t.endTimestamp,attributes:{url:rs(l),"http.method":d,type:"fetch",[Si]:"http.client.stream",[Dn]:"auto.http.browser.stream"}});GT.set(t.response,g);const m=setTimeout(()=>{g.isRecording()&&g.end()},FH);VT.set(t.response,m)}})}});function zH(){nt.document?nt.document.addEventListener("visibilitychange",()=>{const t=Qr();if(!t)return;const e=lr(t);if(nt.document.hidden&&e){const n="cancelled",{op:r,status:s}=Tt(e);_r&&je.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),s||e.setStatus({code:Gn,message:n}),e.setAttribute("sentry.cancellation_reason","document.hidden"),e.end()}}):_r&&je.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const BH=3600,yO="sentry_previous_trace",HH="sentry.previous_trace";function qH(t,{linkPreviousTrace:e,consistentTraceSampling:n}){const r=e==="session-storage";let s=r?WH():void 0;t.on("spanStart",l=>{if(lr(l)!==l)return;const d=Dt().getPropagationContext();s=GH(s,l,d),r&&VH(s)});let o=!0;n&&t.on("beforeSampling",l=>{if(!s)return;const d=Dt(),h=d.getPropagationContext();if(o&&h.parentSpanId){o=!1;return}d.setPropagationContext({...h,dsc:{...h.dsc,sample_rate:String(s.sampleRate),sampled:String(nx(s.spanContext))},sampleRand:s.sampleRand}),l.parentSampled=nx(s.spanContext),l.parentSampleRate=s.sampleRate,l.spanAttributes={...l.spanAttributes,[WC]:s.sampleRate}})}function GH(t,e,n){const r=Tt(e);function s(){var d,h;try{return Number((d=n.dsc)==null?void 0:d.sample_rate)??Number((h=r.data)==null?void 0:h[Zx])}catch{return 0}}const o={spanContext:e.spanContext(),startTimestamp:r.start_timestamp,sampleRate:s(),sampleRand:n.sampleRand};if(!t)return o;const l=t.spanContext;return l.traceId===r.trace_id?t:(Date.now()/1e3-t.startTimestamp<=BH&&(_r&&je.log(`Adding previous_trace \`${JSON.stringify(l)}\` link to span \`${JSON.stringify({op:r.op,...e.spanContext()})}\``),e.addLink({context:l,attributes:{[E6]:"previous_trace"}}),e.setAttribute(HH,`${l.traceId}-${l.spanId}-${nx(l)?1:0}`)),o)}function VH(t){try{nt.sessionStorage.setItem(yO,JSON.stringify(t))}catch(e){_r&&je.warn("Could not store previous trace in sessionStorage",e)}}function WH(){var t;try{const e=(t=nt.sessionStorage)==null?void 0:t.getItem(yO);return JSON.parse(e)}catch{return}}function nx(t){return t.traceFlags===1}const YH="BrowserTracing",KH=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function JH(){const t=nt.navigator;return t!=null&&t.userAgent?KH.test(t.userAgent):!1}const XH={...wp,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...vO},ZH=((t={})=>{"enableElementTiming"in t&&Ho(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});const e={name:void 0,source:void 0},n=nt.document,{enableInp:r,enableLongTask:s,enableLongAnimationFrame:o,_experiments:{enableInteractions:l,enableStandaloneClsSpans:d,enableStandaloneLcpSpans:h},beforeStartSpan:p,idleTimeout:g,finalTimeout:m,childSpanTimeout:y,markBackgroundSpan:b,traceFetch:_,traceXHR:w,trackFetchStreamPerformance:S,shouldCreateSpanForRequest:E,enableHTTPTimings:k,ignoreResourceSpans:j,ignorePerformanceApiSpans:N,instrumentPageLoad:O,instrumentNavigation:D,detectRedirects:F,linkPreviousTrace:R,consistentTraceSampling:B,enableReportPageLoaded:M,onRequestSpanStart:V,onRequestSpanEnd:W}={...XH,...t},Q=JH();let K,te,I;function H(G,re,U=!0){const A=re.op==="pageload",$=re.name,P=p?p(re):re,q=P.attributes||{};if($!==P.name&&(q[Ws]="custom",P.attributes=q),!U){const se=qo();Ya({...P,startTime:se}).end(se);return}e.name=P.name,e.source=q[Ws];const z=SR(P,{idleTimeout:g,finalTimeout:m,childSpanTimeout:y,disableAutoFinish:A,beforeSpanEnd:se=>{K==null||K();const ne=as(G);q7(se,{recordClsOnPageloadSpan:!ne&&!d,recordLcpOnPageloadSpan:!ne&&!h,ignoreResourceSpans:j,ignorePerformanceApiSpans:N,spanStreamingEnabled:ne}),KT(G,void 0);const ie=Dt(),fe=ie.getPropagationContext();ie.setPropagationContext({...fe,traceId:z.spanContext().traceId,sampled:Wa(z),dsc:Ba(se)}),A&&(I=void 0)},trimIdleSpanEndTimestamp:!M});A&&M&&(I=z),KT(G,z);function X(){n&&["interactive","complete"].includes(n.readyState)&&G.emit("idleSpanEnableAutoFinish",z)}A&&!M&&n&&(n.addEventListener("readystatechange",()=>{X()}),X())}return{name:YH,setup(G){var A;if(Q){_r&&je.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}J6();const re=as(G);
170if(K=P7({recordClsStandaloneSpans:re?void 0:d||!1,recordLcpStandaloneSpans:re?void 0:h||!1,client:G}),re?(oB(G),cB(G),r&&dB()):r&&nB(),o&&ut.PerformanceObserver&&((A=PerformanceObserver.supportedEntryTypes)!=null&&A.includes("long-animation-frame"))?$7():s&&F7(),l&&U7(),F&&n){const $=()=>{te=Bn()};addEventListener("click",$,{capture:!0}),addEventListener("keydown",$,{capture:!0,passive:!0})}function U(){const $=zd(G);$&&!Tt($).timestamp&&(_r&&je.log(`[Tracing] Finishing current active span with op: ${Tt($).op}`),$.setAttribute(Id,"cancelled"),$.end())}G.on("startNavigationSpan",($,P)=>{if(yt()!==G)return;if(P!=null&&P.isRedirect){_r&&je.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),H(G,{op:"navigation.redirect",...$},!1);return}te=void 0,U(),Hi().setPropagationContext({traceId:ea(),sampleRand:Math.random(),propagationSpanId:Ui()?void 0:Js()});const q=Dt();q.setPropagationContext({traceId:ea(),sampleRand:Math.random(),propagationSpanId:Ui()?void 0:Js()}),q.setSDKProcessingMetadata({normalizedRequest:void 0}),H(G,{op:"navigation",...$,parentSpan:null,forceTransaction:!0})}),G.on("startPageLoadSpan",($,P={})=>{if(yt()!==G)return;U();const q=P.sentryTrace||WT("sentry-trace")||YT("sentry-trace"),z=P.baggage||WT("baggage")||YT("baggage"),X=B6(q,z),se=Dt();se.setPropagationContext(X),Ui()||(se.getPropagationContext().propagationSpanId=Js()),se.setSDKProcessingMetadata({normalizedRequest:hm()}),H(G,{op:"pageload",...$})}),G.on("endPageloadSpan",()=>{M&&I&&(I.setAttribute(Id,"reportPageLoaded"),I.end())})},afterAllSetup(G){if(Q)return;let re=rh();if(R!=="off"&&qH(G,{linkPreviousTrace:R,consistentTraceSampling:B}),nt.location){if(O){const U=cr();QH(G,{name:nt.location.pathname,startTime:U?U/1e3:void 0,attributes:{[Ws]:"url",[Dn]:"auto.pageload.browser"}})}D&&m_(({to:U,from:A})=>{if(A===void 0&&(re==null?void 0:re.indexOf(U))!==-1){re=void 0;return}re=void 0;const $=n_(U),P=zd(G),q=P&&F&&nq(P,te);eq(G,{name:($==null?void 0:$.pathname)||nt.location.pathname,attributes:{[Ws]:"url",[Dn]:"auto.navigation.browser"}},{url:U,isRedirect:q})})}b&&zH(),l&&tq(G,g,m,y,e),r&&aB(),OH(G,{traceFetch:_,traceXHR:w,tracePropagationTargets:G.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:E,enableHTTPTimings:k,onRequestSpanStart:V,onRequestSpanEnd:W}),S&&G.addIntegration(UH())}}});function QH(t,e,n){t.emit("startPageLoadSpan",e,n),Dt().setTransactionName(e.name);const r=zd(t);return r&&t.emit("afterStartPageLoadSpan",r),r}function eq(t,e,n){const{url:r,isRedirect:s}=n||{};t.emit("beforeStartNavigationSpan",e,{isRedirect:s}),t.emit("startNavigationSpan",e,{isRedirect:s});const o=Dt();return o.setTransactionName(e.name),r&&!s&&o.setSDKProcessingMetadata({normalizedRequest:{...hm(),url:r}}),zd(t)}function WT(t){const e=nt.document,n=e==null?void 0:e.querySelector(`meta[name=${t}]`);return(n==null?void 0:n.getAttribute("content"))||void 0}function YT(t){var r,s,o;const e=(s=(r=nt.performance)==null?void 0:r.getEntriesByType)==null?void 0:s.call(r,"navigation")[0],n=(o=e==null?void 0:e.serverTiming)==null?void 0:o.find(l=>l.name===t);return n==null?void 0:n.description}function tq(t,e,n,r,s){const o=nt.document;let l;const d=()=>{const h="ui.action.click",p=zd(t);if(p){const g=Tt(p).op;if(["navigation","pageload"].includes(g)){_r&&je.warn(`[Tracing] Did not create ${h} span because a pageload or navigation span is in progress.`);return}}if(l&&(l.setAttribute(Id,"interactionInterrupted"),l.end(),l=void 0),!s.name){_r&&je.warn(`[Tracing] Did not create ${h} transaction because _latestRouteName is missing.`);return}l=SR({name:s.name,op:h,attributes:{[Ws]:s.source||"url"}},{idleTimeout:e,finalTimeout:n,childSpanTimeout:r})};o&&addEventListener("click",d,{capture:!0})}const bO="_sentry_idleSpan";function zd(t){return t[bO]}function KT(t,e){Ir(t,bO,e)}const JT=1.5;function nq(t,e){const n=Tt(t),r=qo(),s=n.start_timestamp;return!(r-s>JT||e&&r-e<=JT)}function rq(t){const e={...t};return HR(e,"react"),iU("react",{version:T.version}),AH(e)}function iq(t){const e=t.match(/^([^.]+)/);return e!==null&&parseInt(e[0])>=17}function sq(t,e){const n=new WeakSet;function r(s,o){if(!n.has(s)){if(s.cause)return n.add(s),r(s.cause,o);s.cause=o}}r(t,e)}function aq(t,{componentStack:e}
170,n){if(iq(T.version)&&th(t)&&e){const r=new Error(t.message);r.name=`React ErrorBoundary ${t.name}`,r.stack=e,sq(t,r)}return oh(r=>(r.setContext("react",{componentStack:e}),hc(t,n)))}const oq=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,f0={componentStack:null,error:null,eventId:null};class lq extends T.Component{constructor(e){super(e),this.state=f0,this._openFallbackReportDialog=!0;const n=yt();n&&e.showDialog&&(this._openFallbackReportDialog=!1,this._cleanupHook=n.on("afterSendEvent",r=>{!r.type&&this._lastEventId&&r.event_id===this._lastEventId&&HT({...e.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(e,n){const{componentStack:r}=n,{beforeCapture:s,onError:o,showDialog:l,dialogOptions:d}=this.props;oh(h=>{s&&s(h,e,r);const p=this.props.handled!=null?this.props.handled:!!this.props.fallback,g=aq(e,n,{mechanism:{handled:p,type:"auto.function.react.error_boundary"}});o&&o(e,r,g),l&&(this._lastEventId=g,this._openFallbackReportDialog&&HT({...d,eventId:g})),this.setState({error:e,componentStack:r,eventId:g})})}componentDidMount(){const{onMount:e}=this.props;e&&e()}componentWillUnmount(){const{error:e,componentStack:n,eventId:r}=this.state,{onUnmount:s}=this.props;s&&(this.state===f0?s(null,null,null):s(e,n,r)),this._cleanupHook&&(this._cleanupHook(),this._cleanupHook=void 0)}resetErrorBoundary(){const{onReset:e}=this.props,{error:n,componentStack:r,eventId:s}=this.state;e&&e(n,r,s),this.setState(f0)}render(){const{fallback:e,children:n}=this.props,r=this.state;if(r.componentStack===null)return typeof n=="function"?n():n;const s=typeof e=="function"?T.createElement(e,{error:r.error,componentStack:r.componentStack,resetError:()=>this.resetErrorBoundary(),eventId:r.eventId}):e;return T.isValidElement(s)?s:(e&&oq&&je.warn("fallback did not produce a valid ReactElement"),null)}}const cq=5;function uq({info:t,onClose:e}){const n=Lr(),r=In(),s=T.useId();T.useEffect(()=>{const b=_=>{_.key==="Escape"&&e()};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[e]);const o=t.limit??cq,l=t.currentCount??0,d=t.variant==="add"&&l>o,h=t.jobTitle?`${t.jobTitle}${t.company?` @ ${t.company}`:""}`:null;let p,g,m=null;switch(t.variant){case"unarchive":p="Your tracker is full",g="Archive another job or upgrade to restore this one.",m=`The free plan includes ${o} active tracked jobs (${l} in use). Archiving a job frees a slot.`;break;case"discover-add":p=h?`Add ${h} to your tracker`:"Add this match to your tracker",g="Upgrade for full Discover.",m="Free includes a preview of your top matches. Pro unlocks every match, the reasons behind them, and one-click add to your tracker.";break;case"discover-more":p=`${t.moreCount??0} more ${(t.moreCount??0)===1?"match":"matches"} for you`,g="Upgrade to unlock full Discover.",m="Free includes a preview of your top 5 matches. Pro shows every match with fresh recommendations.";break;case"discover-details":p=h?`Salary, location & role details for ${h}`:"Salary, location & role details",g="Upgrade to unlock full Discover.",m="Pro unlocks the full details on every recommendation, plus one-click add to your tracker.";break;case"enrichment":p="Company intelligence is a Pro feature",g="See who you’d really be joining.",m="Funding, headcount growth, employee reviews, and attrition for every company you track.";break;default:p=d?`You have ${l} tracked jobs`:h?`Track ${h}`:"Your tracker is full",g=d?"Keep them all — upgrade to keep adding.":"Upgrade for unlimited tracking.",m=d?`The free plan includes ${o} tracked jobs — yours are grandfathered in, and nothing gets removed.`:`The free plan includes ${o} active tracked jobs (${l} in use). Archiving a job frees a slot.`}const y=()=>{r.capture("upgrade_modal_cta_clicked",{source:t.source,variant:t.variant,current_count:t.currentCount}),e(),n("/pricing")};return u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm",onClick:e,children:u.jsxs("div",{className:"rounded-2xl max-w-md w-full border p-6 bg-white border-gray-200 dark:bg-[#0D1F35] dark:border-white/10",onClick:b=>b.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":s,children:[u.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[u.jsx("div",{className:"w-9 h-9 rounded-lg flex items-end justify-center gap-[3px] pb-2 bg-[#1D9E75]/10",children:[7,11,15].map((b,_)=>u.jsx("span",{className:"w-[3px] rounded-full bg-[#1D9E75]",style:{height:b}},_))}),u.jsx("button",{type:"button","aria-label":"Close",onClick:e,className:"w-8 h-8 -mr-2 -mt-1 rounded-full flex items-center justify-center transition-colors text-gray-500 hover:text-gray-900 hover:bg-gray-100 dark:text-white/60 dark:hover:text-white dark:hover:bg-white/10",children:"✕"})]}),u.jsx("h2",{id:s,className:"text-lg font-semibold leading-snug text-gray-900 dark:text-white",children:p}),u.jsx("p",{className:"text-sm mt-1 text-gray-600 dark:text-white/60",children:g}),m&&u.jsx("p",{className:"text-xs mt-3 text-gray-500 dark:text-[#8899AA]",children:m}),u.jsx("p",{className:"text-xs mt-2 text-gray-500 dark:text-[#8899AA]",children:"Pro includes unlimited tracked jobs, full Discover, company intelligence, and complete Signal analyses — pros, cons, skill gaps, and resume tips."}),u.jsxs("div",{className:"flex items-center gap-3 mt-5",children:[u.jsx("button",{type:"button",onClick:y,className:"flex-1 py-2.5 rounded-lg text-sm font-semibold text-white bg-[#1D9E75] hover:brightness-110 transition-all",children:"Upgrade to Pro"}),u.jsx("button",{type:"button",onClick:e,className:"px-4 py-2.5 rounded-lg text-sm font-medium transition-colors text-gray-500 hover:text-gray-900 dark:text-white/50 dark:hover:text-white",children:"Not now"})]})]})})}function dq(t,e,n,r){return{id:t,domain:e,name:n,logo_url:r,hq_location:null,industry:null,description:null,size_range:null,employee_count:null,founded_year:null,ownership_status:null,last_funding_type:null,last_funding_amount:null,last_funding_date:null,hq_city:null,hq_country:null,employee_review_score:null,active_job_postings_count:null,technologies_used:null,attrition_rate:null,job_postings_growth_pct:null,website_visits_monthly:null,competitors:null,top_previous_companies:null,base_salary:null,employee_count_change_pct:null,review_culture:null,review_work_life_balance:null,review_compensation:null,review_career_opportunities:null,coresignal_last_updated:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString()}}function hq(t,e){return{id:e.id??"",company_id:e.companyId??null,source_url:t,job_title:e.jobTitle??null,location:e.location??null,salary:e.salary??null,work_type:e.workType??null,employment_type:e.employmentType??null,seniority:e.seniority??null,applicant_count:e.applicantCount??null,job_description:e.jobDescription??null,job_description_formatted:null,first_seen_at:new Date().toISOString(),salary_min:e.salaryMin??null,salary_max:e.salaryMax??null,salary_currency:e.salaryCurrency??null,salary_pay_period:e.salaryPayPeriod??null,salary_raw:e.salaryRaw??null,salary_source:null,ingestion_source:e.ingestionSource??null,external_url:null,date_posted:null,valid_through:null,department:e.department??null,benefits:e.benefits??null,
170normalized_location:e.normalizedLocation??null,latitude:null,longitude:null,is_active:!0,closed_at:null,company:e.companyId?dq(e.companyId,e.companyDomain??"",e.company??null,e.logoUrl??null):void 0}}function Wm(t){var r,s;const e=(s=(r=t.job)==null?void 0:r.analysis)==null?void 0:s[0];if(!e||e.signal_score!=null||e.summary||e.pros.length>0)return!1;const n=new Date(e.updated_at??e.created_at).getTime();return Date.now()-n<5*6e4}function fq(t){var r,s,o;const e=(s=(r=t.job)==null?void 0:r.analysis)==null?void 0:s[0];return!e||e.signal_score!=null?!1:((o=e.subscores)==null?void 0:o.composite)!=null}function xO(t,e){if(!t)return[];try{const r=JSON.parse(t);if(Array.isArray(r))return r.filter(s=>!!s&&typeof s.id=="string"&&typeof s.text=="string"&&typeof s.created_at=="string")}catch{}return t.trim()?[{id:"legacy",text:t,created_at:e}]:[]}const _O=T.createContext(null);function pq({children:t}){const{user:e}=hn(),n=In(),[r,s]=T.useState([]),[o,l]=T.useState(!0),[d,h]=T.useState(!1),p=T.useRef(!1),[g,m]=T.useState(null),[y,b]=T.useState(new Set),_=T.useRef(new Map),w=W=>{_.current.set(W,Date.now()),b(new Set(_.current.keys()))},S=W=>{n.capture("upgrade_modal_shown",{source:W.source,variant:W.variant,current_count:W.currentCount}),m(W)},E=()=>r.filter(W=>W.archived_at===null).length,k=async()=>{if(!e){s([]),h(!1),p.current=!1,l(!1);return}let W=null,Q=null;try{const{data:K,error:te}=await Ye.from("job_tracking").select(`
171          *,
172          job:jobs (
173            *,
174            company:companies (*),
175            analysis:job_analyses (*)
176          )
177        `).eq("user_id",e.id).order("created_at",{ascending:!1});te?Q=te:W=K}catch(K){Q=K instanceof Error?K:{message:String(K)}}if(Q){console.error("JobsContext: job_tracking fetch failed",Q),p.current||hc(new Error(`job_tracking fetch failed: ${Q.message??"unknown"}`),{tags:{feature:"job_tracker"},extra:{failure:Q}}),p.current=!0,h(!0),l(!1);return}s(W??[]),p.current=!1,h(!1),l(!1)};T.useEffect(()=>{k()},[e]),T.useEffect(()=>{var K,te,I;if(_.current.size===0)return;const W=Date.now();let Q=!1;for(const[H,G]of _.current){const re=r.find(A=>A.job_id===H);(((I=(te=(K=re==null?void 0:re.job)==null?void 0:K.analysis)==null?void 0:te[0])==null?void 0:I.signal_score)!=null||W-G>2*6e4)&&(_.current.delete(H),Q=!0)}Q&&b(new Set(_.current.keys()))},[r]);const j=y.size>0||r.some(W=>Wm(W)||fq(W)&&Date.now()-new Date(W.job.analysis[0].updated_at??W.job.analysis[0].created_at).getTime()<10*6e4);T.useEffect(()=>{if(!j)return;const W=setInterval(()=>void k(),4e3);return()=>clearInterval(W)},[j]);const N=W=>{s(Q=>{const K=Q.findIndex(te=>te.id===W.id);if(K>=0){const te=[...Q];return te[K]=W,te}return[W,...Q]})},O=async(W,Q,K)=>{var ne,ie;if(!e)return{error:"Not authenticated"};const{data:{session:te}}=await Ye.auth.getSession();if(!te)return{error:"Not authenticated"};const I="https://qhvibduggtmzvxeodory.supabase.co/functions/v1/analyze-job";let H;try{H=await fetch(I,{method:"POST",headers:{Authorization:`Bearer ${te.access_token}`,apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InFodmliZHVnZ3RtenZ4ZW9kb3J5Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3Nzc3NjI5MTQsImV4cCI6MjA5MzMzODkxNH0.Oq7WHovhSYyHj-Y_pbCXXmkykqOcsCaXtEhRSmxg9b0","Content-Type":"application/json"},body:JSON.stringify({url:W})})}catch(fe){const _e=fe instanceof Error?fe.message:"Network error";return n.capture("job_analysis_failed",{error:_e}),{error:_e}}if(!H.ok||!((ne=H.headers.get("content-type"))!=null&&ne.includes("text/event-stream")))try{const _e=(await H.json()).error??"Unknown error";return n.capture("job_analysis_failed",{error:_e}),{error:_e}}catch{return n.capture("job_analysis_failed",{error:"Unknown error"}),{error:"Unknown error"}}let G=null,re=null;const U=H.body.getReader(),A=new TextDecoder;let $="";e:for(;;){const{done:fe,value:_e}=await U.read();if(fe)break;$+=A.decode(_e,{stream:!0});const Te=$.split(`
178`);$=Te.pop()??"";let Oe="";for(const xe of Te)if(xe.startsWith("event: "))Oe=xe.slice(7).trim();else if(xe.startsWith("data: ")){const Ge=xe.slice(6).trim();try{const Le=JSON.parse(Ge);if(Oe==="field")Q==null||Q(Le.field,Le.value);else if(Oe==="done"){G=Le;break e}else if(Oe==="error"){re=Le.error??"Analysis failed";break e}}catch{}}else xe===""&&(Oe="")}if(re)return n.capture("job_analysis_failed",{error:re}),{error:re};
178if(!G)return n.capture("job_analysis_failed",{error:"Incomplete response"}),{error:"Incomplete response from analysis service"};const P=G.analysis,q=G.job,z=q?{...q,analysis:P?[P]:[]}:void 0,X={id:G.trackingId,job_id:G.jobId,user_id:e.id,stage:"saved",user_rating:null,notes:null,date_applied:null,date_offer:null,archived_at:null,stage_before_archive:null,stage_changed_at:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),job:z},se=((P==null?void 0:P.profile_missing)??G.profile_missing)===!0;return n.capture("job_analysis_completed",{signal_score:P==null?void 0:P.signal_score,company:(ie=q==null?void 0:q.company)==null?void 0:ie.name,job_title:q==null?void 0:q.job_title,profile_missing:se}),K&&n.capture("job_added",{source:K,job_id:G.jobId??null,company_id:(q==null?void 0:q.company_id)??null}),N(X),{error:null,profileMissing:se}},D=async(W,Q)=>{var A;if(console.log("[SignalFit] saveJob called with:",W),!e)return console.log("[SignalFit] no user"),{tracking:null,error:"Not authenticated"};const{data:{session:K}}=await Ye.auth.getSession();if(console.log("[SignalFit] session:",(A=K==null?void 0:K.user)==null?void 0:A.email),!K)return console.log("[SignalFit] no session"),{tracking:null,error:"Not authenticated"};const te="https://qhvibduggtmzvxeodory.supabase.co/functions/v1/fetch-job-info";console.log("[SignalFit] calling:",te);let I;try{I=await fetch(te,{method:"POST",headers:{Authorization:`Bearer ${K.access_token}`,apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InFodmliZHVnZ3RtenZ4ZW9kb3J5Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3Nzc3NjI5MTQsImV4cCI6MjA5MzMzODkxNH0.Oq7WHovhSYyHj-Y_pbCXXmkykqOcsCaXtEhRSmxg9b0","Content-Type":"application/json"},body:JSON.stringify({url:W})}),console.log("[SignalFit] fetch-job-info response:",I.status,I.statusText)}catch($){const P=$ instanceof Error?$.message:"Network error";return console.log("[SignalFit] fetch threw:",P),n.capture("job_save_failed",{error:P}),{tracking:null,error:P}}if(!I.ok)try{const $=await I.json();if($.code==="TRACKER_LIMIT_REACHED"){const z=$.currentCount??E(),X=(Q==null?void 0:Q.limitSource)??"manual";return n.capture("tracker_limit_hit",{source:X,current_count:z}),S({variant:"add",source:X,currentCount:z,limit:$.limit??5,jobTitle:$.jobTitle??(Q==null?void 0:Q.jobTitle)??null,company:$.company??(Q==null?void 0:Q.company)??null}),{tracking:null,error:null,code:$.code,status:I.status,limitReached:!0}}const P=$.error==="job_not_found"?$.message??"This Indeed job isn't in our database yet. Try saving from the company's career site directly.":$.error??"Unknown error",q=$.code??$.error??null;return console.log("[SignalFit] fetch-job-info error body:",$),n.capture("job_save_failed",{error:P,code:q,status:I.status}),{tracking:null,error:P,code:q,status:I.status}}catch{return console.log("[SignalFit] fetch-job-info non-JSON error response"),n.capture("job_save_failed",{error:"Unknown error",status:I.status}),{tracking:null,error:"Unknown error",code:null,status:I.status}}const H=await I.json();console.log("[SignalFit] fetch-job-info data:",{trackingId:H.trackingId,jobId:H.id,company:H.company,jobTitle:H.jobTitle});const G=H.trackingId,re=H.id;if(!G||!re)return console.log("[SignalFit] missing trackingId or jobId in response"),{tracking:null,error:"Missing tracking or job id from server"};const U={id:G,job_id:re,user_id:e.id,stage:"saved",user_rating:null,notes:null,date_applied:null,date_offer:null,archived_at:null,stage_before_archive:null,stage_changed_at:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),job:{...hq(W,H),analysis:[]}};return N(U),k(),setTimeout(()=>void k(),3e3),H.autoAnalyzing===!0&&w(re),n.capture("job_saved",{company:H.company,job_title:H.jobTitle,from_cache:H.fromCache===!0}),Q!=null&&Q.addedSource&&n.capture("job_added",{source:Q.addedSource,job_id:re,company_id:H.companyId??null}),{tracking:U,error:null}},F=async(W,Q)=>{const K=new Date().toISOString();s(te=>te.map(I=>I.id===W?{...I,stage:Q,stage_changed_at:K}:I)),n.capture("job_status_updated",{status:Q}),await Ye.from("job_tracking").update({stage:Q,stage_changed_at:K,updated_at:K}).eq("id",W)},R=async(W,Q)=>{const K=Q.trim();if(!K)return;const te=r.find($=>
178$.id===W);if(!te)return;const I=te.updated_at||te.created_at,H=xO(te.notes,I),G={id:typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`,text:K,created_at:new Date().toISOString()},re=JSON.stringify([...H,G]),U=new Date().toISOString();s($=>$.map(P=>P.id===W?{...P,notes:re,updated_at:U}:P)),n.capture("job_note_added");const{error:A}=await Ye.from("job_tracking").update({notes:re,updated_at:U}).eq("id",W);A&&(console.error("addNote failed",A),k())},B=async(W,Q)=>{s(te=>te.map(I=>I.id===W?{...I,user_rating:Q}:I));const{error:K}=await Ye.from("job_tracking").update({user_rating:Q,updated_at:new Date().toISOString()}).eq("id",W);K&&(console.error("updateRating failed",K),k())},M=async W=>{var H;const Q=new Date().toISOString(),K=r.find(G=>G.id===W),te=(K==null?void 0:K.stage)??null;s(G=>G.map(re=>re.id===W?{...re,archived_at:Q,stage_before_archive:te,updated_at:Q}:re)),n.capture("job_archived",{stage:te,closed:((H=K==null?void 0:K.job)==null?void 0:H.is_active)===!1});const{error:I}=await Ye.from("job_tracking").update({archived_at:Q,stage_before_archive:te,updated_at:Q}).eq("id",W);I&&(console.error("archiveJob failed",I),k())},V=async W=>{var re,U,A;const Q=new Date().toISOString(),K=r.find($=>$.id===W),te=(K==null?void 0:K.stage_before_archive)??(K==null?void 0:K.stage)??"saved";s($=>$.map(P=>P.id===W?{...P,archived_at:null,stage:te,stage_before_archive:null,updated_at:Q}:P));const{data:I,error:H}=await Ye.functions.invoke("restore-tracked-job",{body:{trackingId:W}});if(H){k();let $=null;try{const P=H.context;P&&($=await P.json())}catch{}if(($==null?void 0:$.code)==="TRACKER_LIMIT_REACHED"){const P=$.currentCount??E();n.capture("tracker_limit_hit",{source:"unarchive",current_count:P}),S({variant:"unarchive",source:"unarchive",currentCount:P,limit:$.limit??5,jobTitle:((re=K==null?void 0:K.job)==null?void 0:re.job_title)??null,company:((A=(U=K==null?void 0:K.job)==null?void 0:U.company)==null?void 0:A.name)??null})}else console.error("unarchiveJob failed",H);return}n.capture("job_unarchived");const G=I;G!=null&&G.autoAnalyzing&&K&&w(K.job_id)};return u.jsxs(_O.Provider,{value:{trackings:r,loading:o,fetchError:d,analyzingJobIds:y,refetch:k,analyzeJob:O,saveJob:D,updateStage:F,addNote:R,updateRating:B,archiveJob:M,unarchiveJob:V,showUpgradeModal:S},children:[t,g&&u.jsx(uq,{info:g,onClose:()=>m(null)})]})}function Ka(){const t=T.useContext(_O);if(!t)throw new Error("useJobs must be used within a JobsProvider");return t}const wO="sf-theme";function mq(){if(typeof window>"u")return"light";try{return window.localStorage.getItem(wO)==="dark"?"dark":"light"}catch{return"light"}}function gq(t){if(typeof document>"u")return;const e=document.documentElement;t==="dark"?e.classList.add("dark"):e.classList.remove("dark")}const SO=T.createContext(null);function vq({children:t}){const[e,n]=T.useState(()=>mq());T.useEffect(()=>{gq(e);try{window.localStorage.setItem(wO,e)}catch{}},[e]);const r=T.useCallback(o=>{n(o)},[]),s=T.useCallback(()=>{n(o=>o==="dark"?"light":"dark")},[]);return T.createElement(SO.Provider,{value:{theme:e,toggleTheme:s,setTheme:r}},t)}function yq(){const t=T.useContext(SO);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t}const EO="data-signalfit-extension";function p0(){return typeof document>"u"?!1:document.documentElement.hasAttribute(EO)}function Ym(){const[t,e]=T.useState(p0);return T.useEffect(()=>{if(p0()){e(!0);return}const n=new MutationObserver(()=>{p0()&&(e(!0),n.disconnect())});return n.observe(document.documentElement,{attributes:!0,attributeFilter:[EO]}),()=>n.disconnect()},[]),t}var Tp={exports:{}},bq=Tp.exports,XT;function xq(){return XT||(XT=1,(function(t,e){(function(n,r){t.exports=r(km())})(bq,function(n){return(function(){var r={9:function(d,h,p){p.r(h),h.default=".tf-v1-widget{width:100%;height:100%;min-height:inherit;position:relative}.tf-v1-widget iframe{width:100%;height:100%;border:none;overflow:hidden;border-radius:8px;min-height:inherit}.tf-v1-widget-close{display:none}.tf-v1-widget-iframe-overlay{width:100%;height:100%;border:none;overflow:hidden;border-radius:8px;position:absolute;top:0;left:0}.tf-v1-widget-fullscreen{position:fixed;top:0;left:0;right:0;bottom:0;z-index:10001;width:100% !important;height:100% !important}.tf-v1-widget-fullscreen .tf-v1-widget-close{display:block;display:block;padding:0;margin:0;position:absolute;font-size:32px;font-weight:normal;line-height:24px;width:24px;height:24px;text-align:center;text-transform:none;cursor:pointer;opacity:.75;transition:opacity .25s ease-in-out;text-decoration:none;color:#000;top:6px;right:8px;background:none;border:none;border-radius:0}
178.tf-v1-widget-fullscreen .tf-v1-widget-close:hover{opacity:1}@media(min-width: 481px){.tf-v1-widget-fullscreen .tf-v1-widget-close{color:#fff !important}}.tf-v1-widget-fullscreen .tf-v1-widget-close{z-index:1}.tf-v1-widget-fullscreen iframe{border-radius:0}"},93:function(d,h,p){var g=this&&this.__assign||function(){return g=Object.assign||function(_){for(var w,S=1,E=arguments.length;S<E;S++)for(var k in w=arguments[S])Object.prototype.hasOwnProperty.call(w,k)&&(_[k]=w[k]);return _},g.apply(this,arguments)},m=this&&this.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(h,"__esModule",{value:!0}),h.InlineStyle=void 0;var y=m(p(155)),b=m(p(206));h.InlineStyle=function(_){var w=_.filename,S=p(663)("./".concat(w,".css")),E=(0,b.default)();return y.default.createElement("style",g({},E?{nonce:E}:{},{dangerouslySetInnerHTML:{__html:S.default}}))}},123:function(d,h,p){p.r(h),h.default="@keyframes spin{to{transform:rotate(360deg)}}.tf-v1-popup{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.75);transition:opacity .25s ease-in-out;z-index:10001;display:flex;align-items:center;justify-content:center}.tf-v1-popup .tf-v1-iframe-wrapper{position:relative;transition:opacity .25s ease-in-out;min-width:360px;min-height:360px}.tf-v1-popup .tf-v1-iframe-wrapper iframe{width:100%;height:100%;border:none;overflow:hidden;border-radius:8px}.tf-v1-popup .tf-v1-close{display:block;padding:0;margin:0;position:absolute;font-size:32px;font-weight:normal;line-height:24px;width:24px;height:24px;text-align:center;text-transform:none;cursor:pointer;opacity:.75;transition:opacity .25s ease-in-out;text-decoration:none;color:#000;top:-34px;right:0;background:none;border:none;border-radius:0}.tf-v1-popup .tf-v1-close:hover{opacity:1}@media(min-width: 481px){.tf-v1-popup .tf-v1-close{color:#fff !important}}.tf-v1-popup .tf-v1-spinner{border:3px solid #aaa;font-size:40px;width:1em;height:1em;border-radius:.5em;box-sizing:border-box;animation:spin 1s linear infinite;border-top-color:#fff;position:absolute;top:50%;left:50%;margin:-20px 0 0 -20px}@media(max-width: 480px){.tf-v1-popup{width:100% !important;height:100% !important}.tf-v1-popup .tf-v1-iframe-wrapper{position:relative;transition:opacity .25s ease-in-out;min-width:100%;min-height:100%}.tf-v1-popup .tf-v1-iframe-wrapper iframe{border-radius:0}.tf-v1-popup .tf-v1-close{display:block;padding:0;margin:0;position:absolute;font-size:32px;font-weight:normal;line-height:24px;width:24px;height:24px;text-align:center;text-transform:none;cursor:pointer;opacity:.75;transition:opacity .25s ease-in-out;text-decoration:none;color:#000;top:6px;right:8px;background:none;border:none;border-radius:0}.tf-v1-popup .tf-v1-close:hover{opacity:1}}@media(max-width: 480px)and (min-width: 481px){.tf-v1-popup .tf-v1-close{color:#fff !important}}"},155:function(d){d.exports=n},161:function(d,h,p){var g=this&&this.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(h,"__esModule",{value:!0}),h.memoComponent=h.propsAreEqual=void 0;var m=p(155),y=g(p(792));h.propsAreEqual=function(b,_){return(0,y.default)(b,_)},h.memoComponent=function(b){return(0,m.memo)(b,h.propsAreEqual)}},193:function(d,h,p){var g=this&&this.__assign||function(){return g=Object.assign||function(k){for(var j,N=1,O=arguments.length;N<O;N++)for(var D in j=arguments[N])Object.prototype.hasOwnProperty.call(j,D)&&(k[D]=j[D]);return k},g.apply(this,arguments)},m=this&&this.__createBinding||(Object.create?function(k,j,N,O){O===void 0&&(O=N);var D=Object.getOwnPropertyDescriptor(j,N);D&&!("get"in D?!j.__esModule:D.writable||D.configurable)||(D={enumerable:!0,get:function(){return j[N]}}),Object.defineProperty(k,O,D)}:function(k,j,N,O){O===void 0&&(O=N),k[O]=j[N]}),y=this&&this.__setModuleDefault||(Object.create?function(k,j){Object.defineProperty(k,"default",{enumerable:!0,value:j})}:function(k,j){k.default=j}),b=this&&this.__importStar||function(k){if(k&&k.__esModule)return k;var j={};if(k!=null)for(var N in k)N!=="default"&&Object.prototype.hasOwnProperty.call(k,N)&&m(j,k,N);return y(j,k),j},_=this&&this.__rest||function(k,j){var N={};for(var O in k)Object.prototype.hasOwnProperty.call(k,O)&&j.indexOf(O)<0&&(N[O]=k[O]);if(k!=null&&typeof Object.getOwnPropertySymbols=="function"){var D=0;for(O=Object.getOwnPropertySymbols(k);D<O.length;D++)j.indexOf(O[D])<0&&Object.prototype.propertyIsEnumerable.call(k,O[D])&&(N[O[D]]=k[O[D]])}return N};Object.defineProperty(h,"__esModule",{value:!0}),h.makeButtonComponent=void 0;
178var w=b(p(155)),S=p(517),E=p(93);h.makeButtonComponent=function(k,j){return function(N){var O=N.id,D=N.children,F=N.as,R=F===void 0?"button":F,B=N.style,M=B===void 0?{}:B,V=N.className,W=V===void 0?"":V,Q=N.buttonProps,K=N.embedRef,te=_(N,["id","children","as","style","className","buttonProps","embedRef"]),I=(0,w.useRef)(S.genericEmbed),H=K||I;(0,w.useEffect)(function(){return H.current=k(O,te),function(){var U;return(U=H.current)===null||U===void 0?void 0:U.unmount()}},[O,te,H]);var G=(0,w.useMemo)(function(){return function(){var U;return(U=H.current)===null||U===void 0?void 0:U.open()}},[H]),re=w.default.createElement(R,g({style:M,className:W,onClick:G,"data-testid":"tf-v1-".concat(j),children:D},Q));return w.default.createElement(w.default.Fragment,null,w.default.createElement(E.InlineStyle,{filename:j}),re)}}},206:function(d,h,p){Object.defineProperty(h,"__esModule",{value:!0}),h.default=function(){return p.g.__webpack_nonce__!==void 0?p.g.__webpack_nonce__:null}},231:function(d,h,p){p.r(h),h.default="@keyframes spin{to{transform:rotate(360deg)}}.tf-v1-sidetab{position:fixed;top:50%;right:0;width:400px;height:580px;transform:translate(100%, -50%);box-shadow:0 2px 4px rgba(0,0,0,.08),0 2px 12px rgba(0,0,0,.06);z-index:10001;will-change:transform}.tf-v1-sidetab.ready{transition:transform 400ms cubic-bezier(0.5, 0, 0.75, 0)}.tf-v1-sidetab iframe{width:100%;height:100%;border:none;overflow:hidden;border-radius:8px 0 0 8px}.tf-v1-sidetab.open{transform:translate(0, -50%)}.tf-v1-sidetab-wrapper{position:relative;height:100%}.tf-v1-sidetab-button{position:absolute;top:50%;left:-48px;transform:rotate(-90deg) translateX(-50%);transform-origin:left top;min-width:100px;max-width:540px;height:48px;display:flex;align-items:center;padding:12px 16px;border-radius:8px 8px 0 0;color:#fff;box-shadow:0 2px 4px rgba(0,0,0,.08),0 2px 12px rgba(0,0,0,.06);background-color:#3a7685;cursor:pointer;border:0;text-decoration:none;outline:none}.tf-v1-sidetab-button-text{flex:1;font-size:18px;font-family:Helvetica,Arial,sans-serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tf-v1-sidetab-button-icon{width:24px;height:24px;font-size:24px;transform:rotate(90deg);margin-right:12px;position:relative;order:-1}.tf-v1-sidetab-button-icon>img{width:100%;height:100%;object-fit:contain}.tf-v1-sidetab-close{display:none}.tf-v1-sidetab .tf-v1-spinner{border:3px solid #aaa;font-size:24px;width:1em;height:1em;border-radius:.5em;box-sizing:border-box;animation:spin 1s linear infinite;border-top-color:#fff;position:absolute;top:50%;left:50%;margin:-12px 0 0 -12px;top:0;left:0;margin:0}@media(max-width: 480px){.tf-v1-sidetab{transition:unset}.tf-v1-sidetab.ready{transition:unset}.tf-v1-sidetab.open{top:0;left:0;right:0;bottom:0;transform:translate(0, 0);width:100% !important;height:100% !important}.tf-v1-sidetab-close{display:block;padding:0;margin:0;position:absolute;font-size:32px;font-weight:normal;line-height:24px;width:24px;height:24px;text-align:center;text-transform:none;cursor:pointer;opacity:.75;transition:opacity .25s ease-in-out;text-decoration:none;color:#000;top:6px;right:8px;background:none;border:none;border-radius:0}.tf-v1-sidetab-close:hover{opacity:1}.tf-v1-sidetab-close{display:block;z-index:1}}@media(max-width: 480px)and (min-width: 481px){.tf-v1-sidetab-close{color:#fff !important}}"},240:function(d,h,p){var g=this&&this.__createBinding||(Object.create?function(y,b,_,w){w===void 0&&(w=_);var S=Object.getOwnPropertyDescriptor(b,_);
178S&&!("get"in S?!b.__esModule:S.writable||S.configurable)||(S={enumerable:!0,get:function(){return b[_]}}),Object.defineProperty(y,w,S)}:function(y,b,_,w){w===void 0&&(w=_),y[w]=b[_]}),m=this&&this.__exportStar||function(y,b){for(var _ in y)_==="default"||Object.prototype.hasOwnProperty.call(b,_)||g(b,y,_)};Object.defineProperty(h,"__esModule",{value:!0}),m(p(193),h),m(p(390),h),m(p(558),h)},390:function(d,h,p){var g=this&&this.__createBinding||(Object.create?function(E,k,j,N){N===void 0&&(N=j);var O=Object.getOwnPropertyDescriptor(k,j);O&&!("get"in O?!k.__esModule:O.writable||O.configurable)||(O={enumerable:!0,get:function(){return k[j]}}),Object.defineProperty(E,N,O)}:function(E,k,j,N){N===void 0&&(N=j),E[N]=k[j]}),m=this&&this.__setModuleDefault||(Object.create?function(E,k){Object.defineProperty(E,"default",{enumerable:!0,value:k})}:function(E,k){E.default=k}),y=this&&this.__importStar||function(E){if(E&&E.__esModule)return E;var k={};if(E!=null)for(var j in E)j!=="default"&&Object.prototype.hasOwnProperty.call(E,j)&&g(k,E,j);return m(k,E),k},b=this&&this.__rest||function(E,k){var j={};for(var N in E)Object.prototype.hasOwnProperty.call(E,N)&&k.indexOf(N)<0&&(j[N]=E[N]);if(E!=null&&typeof Object.getOwnPropertySymbols=="function"){var O=0;for(N=Object.getOwnPropertySymbols(E);O<N.length;O++)k.indexOf(N[O])<0&&Object.prototype.propertyIsEnumerable.call(E,N[O])&&(j[N[O]]=E[N[O]])}return j};Object.defineProperty(h,"__esModule",{value:!0}),h.makeInitializerComponent=void 0;var _=y(p(155)),w=p(517),S=p(93);h.makeInitializerComponent=function(E,k){return function(j){var N=j.id,O=j.embedRef,D=b(j,["id","embedRef"]),F=(0,_.useRef)(w.genericEmbed),R=O||F;return(0,_.useEffect)(function(){return R.current=E(N,D),function(){var B;(B=R.current)===null||B===void 0||B.unmount()}},[N,D,R]),_.default.createElement(S.InlineStyle,{filename:k})}}},517:function(d,h,p){var g=this&&this.__createBinding||(Object.create?function(y,b,_,w){w===void 0&&(w=_);var S=Object.getOwnPropertyDescriptor(b,_);
178S&&!("get"in S?!b.__esModule:S.writable||S.configurable)||(S={enumerable:!0,get:function(){return b[_]}}),Object.defineProperty(y,w,S)}:function(y,b,_,w){w===void 0&&(w=_),y[w]=b[_]}),m=this&&this.__exportStar||function(y,b){for(var _ in y)_==="default"||Object.prototype.hasOwnProperty.call(b,_)||g(b,y,_)};Object.defineProperty(h,"__esModule",{value:!0}),m(p(804),h),m(p(161),h)},558:function(d,h,p){var g=this&&this.__assign||function(){return g=Object.assign||function(k){for(var j,N=1,O=arguments.length;N<O;N++)for(var D in j=arguments[N])Object.prototype.hasOwnProperty.call(j,D)&&(k[D]=j[D]);return k},g.apply(this,arguments)},m=this&&this.__createBinding||(Object.create?function(k,j,N,O){O===void 0&&(O=N);var D=Object.getOwnPropertyDescriptor(j,N);D&&!("get"in D?!j.__esModule:D.writable||D.configurable)||(D={enumerable:!0,get:function(){return j[N]}}),Object.defineProperty(k,O,D)}:function(k,j,N,O){O===void 0&&(O=N),k[O]=j[N]}),y=this&&this.__setModuleDefault||(Object.create?function(k,j){Object.defineProperty(k,"default",{enumerable:!0,value:j})}:function(k,j){k.default=j}),b=this&&this.__importStar||function(k){if(k&&k.__esModule)return k;var j={};if(k!=null)for(var N in k)N!=="default"&&Object.prototype.hasOwnProperty.call(k,N)&&m(j,k,N);return y(j,k),j},_=this&&this.__rest||function(k,j){var N={};for(var O in k)Object.prototype.hasOwnProperty.call(k,O)&&j.indexOf(O)<0&&(N[O]=k[O]);if(k!=null&&typeof Object.getOwnPropertySymbols=="function"){var D=0;for(O=Object.getOwnPropertySymbols(k);D<O.length;D++)j.indexOf(O[D])<0&&Object.prototype.propertyIsEnumerable.call(k,O[D])&&(N[O[D]]=k[O[D]])}return N};Object.defineProperty(h,"__esModule",{value:!0}),h.Widget=void 0;var w=b(p(155)),S=p(952),E=p(93);h.Widget=function(k){var j=k.id,N=k.style,O=N===void 0?{}:N,D=k.className,F=D===void 0?"":D,R=_(k,["id","style","className"]),B=(0,w.useRef)(null);return(0,w.useEffect)(function(){if(B.current){var M=(0,S.createWidget)(j,g(g({},R),{container:B.current}));return function(){M.unmount()}}},[j,R]),w.default.createElement(w.default.Fragment,null,w.default.createElement(E.InlineStyle,{filename:"widget"}),w.default.createElement("div",{style:O,className:F,ref:B}))}},663:function(d,h,p){var g={"./popover.css":842,"./popup.css":123,"./sidetab.css":231,"./slider.css":806,"./widget.css":9};function m(b){var _=y(b);return p(_)}function y(b){if(!p.o(g,b)){var _=new Error("Cannot find module '"+b+"'");throw _.code="MODULE_NOT_FOUND",_}return g[b]}m.keys=function(){return Object.keys(g)},m.resolve=y,d.exports=m,m.id=663},792:function(d){d.exports=function h(p,g){if(p===g)return!0;if(p&&g&&typeof p=="object"&&typeof g=="object"){if(p.constructor!==g.constructor)return!1;var m,y,b;if(Array.isArray(p)){if((m=p.length)!=g.length)return!1;for(y=m;y--!==0;)if(!h(p[y],g[y]))return!1;return!0}if(p.constructor===RegExp)return p.source===g.source&&p.flags===g.flags;if(p.valueOf!==Object.prototype.valueOf)return p.valueOf()===g.valueOf();if(p.toString!==Object.prototype.toString)return p.toString()===g.toString();if((m=(b=Object.keys(p)).length)!==Object.keys(g).length)return!1;for(y=m;y--!==0;)if(!Object.prototype.hasOwnProperty.call(g,b[y]))return!1;for(y=m;y--!==0;){var _=b[y];if(!h(p[_],g[_]))return!1}return!0}return p!=p&&g!=g}},804:function(d,h){Object.defineProperty(h,"__esModule",{value:!0}),h.genericEmbed=void 0,h.genericEmbed={unmount:function(){},open:function(){}}},806:function(d,h,p){p.r(h),h.default="@keyframes spin{to{transform:rotate(360deg)}}.tf-v1-slider{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.75);transition:opacity .25s ease-in-out;z-index:10001}.tf-v1-slider .tf-v1-iframe-wrapper{max-width:calc(100vw - 26px);height:100%;position:absolute;top:0;transition:right .5s ease-in-out,left .5s ease-in-out}.tf-v1-slider .tf-v1-iframe-wrapper iframe{width:100%;height:100%;border:none;overflow:hidden;border-radius:0}@media(min-width: 481px){.tf-v1-slider .tf-v1-iframe-wrapper iframe{border-radius:8px 0 0 8px}}.tf-v1-slider .tf-v1-close{display:block;padding:0;margin:0;position:absolute;font-size:32px;font-weight:normal;line-height:24px;width:24px;height:24px;text-align:center;text-transform:none;cursor:pointer;opacity:.75;transition:opacity .25s ease-in-out;text-decoration:none;color:#000;top:6px;right:8px;background:none;border:none;border-radius:0}.tf-v1-slider .tf-v1-close:hover{opacity:1}@media(min-width: 481px){.tf-v1-slider .tf-v1-close{color:#fff !important}}@media(min-width: 481px){.tf-v1-slider .tf-v1-close{top:4px;left:-26px}}.tf-v1-slider .tf-v1-close:hover{opacity:1}.tf-v1-slider .tf-v1-spinner{border:3px solid #aaa;font-size:40px;width:1em;height:1em;border-radius:.5em;box-sizing:border-box;animation:spin 1s linear infinite;border-top-color:#fff;position:absolute;top:50%;left:50%;margin:-20px 0 0 -20px}@media(min-width: 481px){.tf-v1-slider.left .tf-v1-iframe-wrapper iframe{border-radius:0 8px 8px 0}.tf-v1-slider.left .tf-v1-close{left:auto;right:-24px}}@media(max-width: 480px){.tf-v1-slider{width:100% !important;height:100% !important}.tf-v1-slider .tf-v1-iframe-wrapper{width:100% !important;max-width:100vw;height:100%;transition:unset}.tf-v1-slider .tf-v1-iframe-wrapper iframe{border-radius:none}.tf-v1-slider .tf-v1-close{display:block;padding:0;margin:0;position:absolute;font-size:32px;font-weight:normal;line-height:24px;width:24px;height:24px;text-align:center;text-transform:none;cursor:pointer;opacity:.75;transition:opacity .25s ease-in-out;text-decoration:none;color:#000;top:6px;right:8px;background:none;border:none;border-radius:0}.tf-v1-slider .tf-v1-close:hover{opacity:1}.tf-v1-slider .tf-v1-close{left:auto}}@media(max-width: 480px)and (min-width: 481px){.tf-v1-slider .tf-v1-close{color:#fff !important}}"},842:function(d,h,p){p.r(h),h.default='@keyframes spin{to{transform:rotate(360deg)}}.tf-v1-popover{bottom:96px;position:fixed;right:16px;z-index:10001}.tf-v1-popover.open{max-width:100%;min-height:360px;min-width:360px}.tf-v1-popover-wrapper{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);
178height:100%;width:100%;opacity:0;transition:opacity .25s ease-in-out;border-radius:4px;box-shadow:rgba(0,0,0,.08) 0 2px 4px,rgba(0,0,0,.06) 0 2px 12px}.tf-v1-popover-wrapper iframe{width:100%;height:100%;border:none;overflow:hidden;border-radius:8px}.tf-v1-popover-close{display:none}.tf-v1-popover-button{width:54px;height:54px;position:fixed;box-shadow:0 2px 12px rgba(0,0,0,.06),0 2px 4px rgba(0,0,0,.08);color:#fff;right:26px;bottom:26px;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;background:#3a7685;line-height:0;border:none;padding:0}.tf-v1-popover-button-icon{width:54px;height:54px;font-size:24px;border-radius:50%;overflow:hidden;display:flex;justify-content:center;align-items:center}.tf-v1-popover-button-icon svg.default{margin-top:6px}.tf-v1-popover-button-icon svg,.tf-v1-popover-button-icon img{max-width:54px;max-height:54px}.tf-v1-popover-button-icon img{width:100%;height:100%;object-fit:cover;border-radius:50%}.tf-v1-popover-tooltip{position:fixed;right:94px;bottom:33px;max-width:240px;padding:10px 25px 10px 10px;border-radius:8px;background:#fff;box-shadow:0 2px 4px rgba(0,0,0,.08),0 2px 12px rgba(0,0,0,.06);font-size:14px;font-family:Helvetica,Arial,sans-serif;line-height:22px}.tf-v1-popover-tooltip::before{background-color:#fff;content:"";display:block;width:12px;height:12px;position:absolute;right:-4px;bottom:15px;transform:rotate(45deg);box-shadow:2px -2px 2px 0 rgba(0,0,0,.06)}.tf-v1-popover-tooltip-text{overflow:hidden}.tf-v1-popover-tooltip-close{cursor:pointer;margin-left:4px;display:inline-block;text-align:center;position:absolute;top:12px;right:6px}.tf-v1-popover-tooltip-close svg{width:20px;height:20px}.tf-v1-popover-tooltip-close svg path{fill:rgba(0,0,0,.2);transition:fill 150ms ease-in-out}.tf-v1-popover-tooltip-close:hover svg path{fill:rgba(0,0,0,.3)}.tf-v1-popover-tooltip.closing{transition:opacity .25s ease-in-out;opacity:0}.tf-v1-popover-unread-dot{width:8px;height:8px;border-radius:50%;background-color:#fa6b05;border:2px solid #fff;position:absolute;top:2px;right:2px}.tf-v1-popover-unread-dot.closing{transition:opacity .25s ease-in-out;opacity:0}.tf-v1-spinner{border:3px solid #aaa;font-size:40px;width:1em;height:1em;border-radius:.5em;box-sizing:border-box;animation:spin 1s linear infinite;border-top-color:#fff;position:absolute;top:50%;left:50%;margin:-20px 0 0 -20px}@media(max-width: 480px){.tf-v1-popover.open{top:0;left:0;bottom:0;right:0;width:100% !important;height:100% !important}.tf-v1-popover.open .tf-v1-popover-close{display:block}.tf-v1-popover-wrapper{border-radius:0;box-shadow:none}.tf-v1-popover-wrapper iframe{border-radius:0}.tf-v1-popover-close{display:block;padding:0;margin:0;position:absolute;font-size:32px;font-weight:normal;line-height:24px;width:24px;height:24px;text-align:center;text-transform:none;cursor:pointer;opacity:.75;transition:opacity .25s ease-in-out;text-decoration:none;color:#000;top:6px;right:8px;background:none;border:none;border-radius:0}.tf-v1-popover-close:hover{opacity:1}.tf-v1-popover-close{display:none;z-index:1}}@media(max-width: 480px)and (min-width: 481px){.tf-v1-popover-close{color:#fff !important}}@media(max-width: 480px){.tf-v1-popover-button{width:44px;height:44px;right:8px;bottom:8px}.tf-v1-popover-button-icon{font-size:20px}.tf-v1-popover-button-icon svg{margin-top:4px;max-height:24px;max-width:24px}.tf-v1-popover-button-icon img{max-width:44px;max-height:44px}.tf-v1-popover-tooltip{position:fixed;right:66px;bottom:8px;left:auto;font-size:12px}.tf-v1-popover-tooltip::before{bottom:14px}.tf-v1-popover-unread-dot{top:0;right:0}.tf-v1-spinner{border:3px solid #aaa;font-size:32px;width:1em;height:1em;border-radius:.5em;box-sizing:border-box;animation:spin 1s linear infinite;border-top-color:#fff;position:absolute;top:50%;left:50%;margin:-16px 0 0 -16px}}'},952:function(d){d.exports=(function(){var h={19:function(g,m){Object.defineProperty(m,"__esModule",{value:!0})},249:function(g,m){Object.defineProperty(m,"__esModule",{value:!0})},352:function(g,m,y){Object.defineProperty(m,"__esModule",{value:!0}),m.setAutoClose=m.DEFAULT_AUTO_CLOSE_TIME=void 0;var b=y(476);m.DEFAULT_AUTO_CLOSE_TIME=500,m.setAutoClose=function(_,w,S){w&&S&&window.addEventListener("message",(0,b.getFormSubmitHandler)(_,function(){return setTimeout(S,(k=typeof(E=w)=="number"?E:0,Math.max(k,m.DEFAULT_AUTO_CLOSE_TIME)));var E,k}))}},476:function(g,m,y){var b=this&&this.__rest||function(E,k){var j={};for(var N in E)Object.prototype.hasOwnProperty.call(E,N)&&k.indexOf(N)<0&&(j[N]=E[N]);if(E!=null&&typeof Object.getOwnPropertySymbols=="function"){var O=0;for(N=Object.getOwnPropertySymbols(E);O<N.length;O++)k.indexOf(N[O])<0&&Object.prototype.propertyIsEnumerable.call(E,N[O])&&(j[N[O]]=E[N[O]])}return j};
178Object.defineProperty(m,"__esModule",{value:!0}),m.getRedirectHandler=m.getThankYouScreenButtonClickHandler=m.getFormThemeHandler=m.getWelcomeScreenHiddenHandler=m.getDuplicateDetectedHandler=m.getFormSubmitHandler=m.getFormHeightChangedHandler=m.getFormQuestionChangedHandler=m.getFormStartedHandler=m.getFormReadyHandler=void 0;var _=y(1407);m.getFormReadyHandler=function(E,k){return S("form-ready",E,k)},m.getFormStartedHandler=function(E,k){return S("form-started",E,k)},m.getFormQuestionChangedHandler=function(E,k){return S("form-screen-changed",E,k)},m.getFormHeightChangedHandler=function(E,k){return S("form-height-changed",E,k)},m.getFormSubmitHandler=function(E,k){return S("form-submit",E,k)},m.getDuplicateDetectedHandler=function(E,k){return S("duplicate-detected",E,k)},m.getWelcomeScreenHiddenHandler=function(E,k){return S("welcome-screen-hidden",E,k)},m.getFormThemeHandler=function(E,k){return S("form-theme",E,k)},m.getThankYouScreenButtonClickHandler=function(E,k){return S("thank-you-screen-button-click",E,k)},m.getRedirectHandler=function(E,k){return S(["redirect-after-submit","thank-you-screen-redirect"],E,(0,_.handleFormRedirect)(k))};var w=function(E,k){return Array.isArray(E)?E.includes(k):E===k};function S(E,k,j){return function(N){var O=N.data,D=O.type,F=O.embedId,R=b(O,["type","embedId"]);w(E,D)&&F===k&&(j==null||j(R))}}},883:function(g,m){var y=this&&this.__awaiter||function(S,E,k,j){return new(k||(k=Promise))(function(N,O){function D(B){try{R(j.next(B))}catch(M){O(M)}}function F(B){try{R(j.throw(B))}catch(M){O(M)}}function R(B){var M;B.done?N(B.value):(M=B.value,M instanceof k?M:new k(function(V){V(M)})).then(D,F)}R((j=j.apply(S,E||[])).next())})},b=this&&this.__generator||function(S,E){var k,j,N,O,D={label:0,sent:function(){if(1&N[0])throw N[1];return N[1]},trys:[],ops:[]};return O={next:F(0),throw:F(1),return:F(2)},typeof Symbol=="function"&&(O[Symbol.iterator]=function(){return this}),O;function F(R){return function(B){return(function(M){if(k)throw new TypeError("Generator is already executing.");for(;O&&(O=0,M[0]&&(D=0)),D;)try{if(k=1,j&&(N=2&M[0]?j.return:M[0]?j.throw||((N=j.return)&&N.call(j),0):j.next)&&!(N=N.call(j,M[1])).done)return N;switch(j=0,N&&(M=[2&M[0],N.value]),M[0]){case 0:case 1:N=M;break;case 4:return D.label++,{value:M[1],done:!1};case 5:D.label++,j=M[1],M=[0];continue;case 7:M=D.ops.pop(),D.trys.pop();continue;default:if(!((N=(N=D.trys).length>0&&N[N.length-1])||M[0]!==6&&M[0]!==2)){D=0;continue}if(M[0]===3&&(!N||M[1]>N[0]&&M[1]<N[3])){D.label=M[1];break}if(M[0]===6&&D.label<N[1]){D.label=N[1],N=M;break}if(N&&D.label<N[2]){D.label=N[2],D.ops.push(M);break}N[2]&&D.ops.pop(),D.trys.pop();continue}M=E.call(S,D)}catch(V){M=[6,V],j=0}finally{k=N=0}if(5&M[0])throw M[1];return{value:M[0]?M[1]:void 0,done:!0}})([R,B])}}};Object.defineProperty(m,"__esModule",{value:!0}),m.dispatchCustomKeyEventFromIframe=m.removeCustomKeyboardListener=m.addCustomKeyboardListener=void 0;var _="Escape",w=function(S,E){return y(void 0,void 0,void 0,function(){return b(this,function(k){return S.code===_&&typeof E=="function"&&(E(),(0,m.removeCustomKeyboardListener)()),[2]})})};m.addCustomKeyboardListener=function(S){return window.document.addEventListener("keydown",function(E){return w(E,S)})},m.removeCustomKeyboardListener=function(){return window.document.removeEventListener("keydown",w)},m.dispatchCustomKeyEventFromIframe=function(S){S.data.type==="form-close"&&window.document.dispatchEvent(new KeyboardEvent("keydown",{code:_}))}},1179:function(g,m,y){var b=this&&this.__assign||function(){return b=Object.assign||function(N){for(var O,D=1,F=arguments.length;D<F;D++)for(var R in O=arguments[D])Object.prototype.hasOwnProperty.call(O,R)&&(N[R]=O[R]);return N},b.apply(this,arguments)},_=this&&this.__rest||function(N,O){var D={};for(var F in N)Object.prototype.hasOwnProperty.call(N,F)&&O.indexOf(F)<0&&(D[F]=N[F]);if(N!=null&&typeof Object.getOwnPropertySymbols=="function"){var R=0;for(F=Object.getOwnPropertySymbols(N);R<F.length;R++)O.indexOf(F[R])<0&&Object.prototype.propertyIsEnumerable.call(N,F[R])&&(D[F[R]]=N[F[R]])}return D};
178Object.defineProperty(m,"__esModule",{value:!0}),m.createPopover=void 0;var w=y(6517),S=y(6530),E=function(N,O){var D=N.parentNode;D&&(D.removeChild(N),D.appendChild(O))},k=function(N,O){N===void 0&&(N="span"),O===void 0&&(O="tf-v1-popover-button-icon");var D=document.createElement(N);return D.className="".concat(O," tf-v1-close-icon"),D.innerHTML=w.closeIconSvg,D.dataset.testid=O,D},j={buttonColor:"#3a7685"};m.createPopover=function(N,O){O===void 0&&(O={});var D,F,R,B=b(b({},j),O),M=B.domain,V=_(B,["domain"]),W=(0,w.createIframe)("popover",{formId:N,domain:M,options:V}),Q=W.iframe,K=W.embedId,te=W.refresh,I=W.focus,H=(function(ne,ie){var fe=document.createElement("div");return fe.className="tf-v1-popover",fe.dataset.testid="tf-v1-popover",(0,w.setElementSize)(fe,{width:ne,height:ie})})(V.width,V.height),G=(function(){var ne=document.createElement("div");return ne.className="tf-v1-popover-wrapper",ne.dataset.testid="tf-v1-popover-wrapper",ne})(),re=(function(ne,ie){var fe=(0,w.getTextColor)(ie),_e=document.createElement("div");_e.className="tf-v1-popover-button-icon";var Te=(0,w.triggerIconSvg)(fe),Oe=ne==null?void 0:ne.startsWith("http");return _e.innerHTML=Oe?"<img alt='popover trigger icon button' src='".concat(ne,"'/>"):ne??Te,_e.dataset.testid="default-icon",_e})(V.customIcon,V.buttonColor||j.buttonColor),U=(function(){var ne=document.createElement("div");ne.className="tf-v1-spinner";var ie=document.createElement("div");return ie.className="tf-v1-popover-button-icon",ie.dataset.testid="spinner-icon",ie.append(ne),ie})(),A=k(),$=k("button","tf-v1-popover-close"),P=(function(ne,ie){ie===void 0&&(ie={});var fe=(0,w.getTextColor)(ne),_e=document.createElement("button");return _e.className="tf-v1-popover-button",_e.dataset.testid="tf-v1-popover-button",_e.style.backgroundColor=ne,_e.style.color=fe,(0,w.addAttributesToElement)(_e,ie),_e})(V.buttonColor||j.buttonColor,V.buttonProps);(V.container||document.body).append(H),G.append(Q),H.append(P),H.append($),P.append(re);var q=function(){F&&F.parentNode&&(F.classList.add("closing"),setTimeout(function(){(0,w.unmountElement)(F)},250))};V.tooltip&&V.tooltip.length>0&&(F=(function(ne,ie){var fe=document.createElement("span");fe.className="tf-v1-popover-tooltip-close",fe.dataset.testid="tf-v1-popover-tooltip-close",fe.innerHTML=w.closeIconSvg,fe.onclick=ie;var _e=document.createElement("div");_e.className="tf-v1-popover-tooltip-text",_e.innerHTML=ne;var Te=document.createElement("div");return Te.className="tf-v1-popover-tooltip",Te.dataset.testid="tf-v1-popover-tooltip",Te.a
vendor: 4,225 bytes, line 178
178ppendChild(_e),Te.appendChild(fe),Te})(V.tooltip,q),H.append(F)),V.notificationDays&&(V.enableSandbox||(0,S.canBuildNotificationDot)(N))&&(R=(0,S.buildNotificationDot)(),P.append(R)),Q.onload=function(ne){ne!=null&&ne.isTrusted&&(H.classList.add("open"),G.style.opacity="1",$.style.opacity="1",E(U,A),(0,w.addCustomKeyboardListener)(X))};var z=function(){(0,w.isOpen)(G)||(q(),R&&(R.classList.add("closing"),V.notificationDays&&!V.enableSandbox&&(0,S.saveNotificationDotHideUntilTime)(N,V.notificationDays),setTimeout(function(){(0,w.unmountElement)(R)},250)),setTimeout(function(){(0,w.isInPage)(G)?(G.style.opacity="0",$.style.opacity="0",G.style.display="flex",setTimeout(function(){H.classList.add("open"),G.style.opacity="1",$.style.opacity="1"}),E(re,A)):(H.append(G),E(re,U),G.style.opacity="0",$.style.opacity="0")}))},X=function(){var ne;(0,w.isOpen)(H)&&((0,w.handlePreventReopenOnClose)(V,N),(ne=O.onClose)===null||ne===void 0||ne.call(O),setTimeout(function(){V.keepSession?G.style.display="none":(0,w.unmountElement)(G),H.classList.remove("open"),E(A,re)},250))};(0,w.setAutoClose)(K,V.autoClose,X);var se=function(){(0,w.isOpen)(G)?X():z()};return P.onclick=(0,w.invokeWithoutDefault)(se),$.onclick=(0,w.invokeWithoutDefault)(X),V.open&&!(0,w.isOpen)(G)&&(D=(0,w.handleCustomOpen)(z,V,N)),{open:z,close:X,toggle:se,refresh:te,focus:I,unmount:function(){(0,w.unmountElement)(H),V.open&&(D!=null&&D.remove)&&D.remove()}}}},1403:function(g,m,y){Object.defineProperty(m,"__esModule",{value:!0}),m.getTextColor=void 0;var b=y(6546);m.getTextColor=function(_){if(!_)return"#FFFFFF";var w=_.startsWith("#")?(0,b.hexRgb)(_):(function(j){var N={red:0,green:0,blue:0},O=j.match(/\d+/g);return O&&(N.red=parseInt(O[0],10),N.green=parseInt(O[0],10),N.blue=parseInt(O[0],10)),N})(_),S=w.red,E=w.green,k=w.blue;return Math.round((299*S+587*E+114*k)/1e3)>150?"#000000":"#FFFFFF"}},1407:function(g,m){Object.defineProperty(m,"__esModule",{value:!0}),m.handleFormRedirect=void 0,m.handleFormRedirect=function(y){return function(b){var _,w,S=b.url,E=b.target;if(S)switch(E===void 0?"_parent":E){case"_self":y.src=(_=y.src,(w=S).includes("#")&&w.startsWith("".concat(_,"#"))?w.includes("?")?w.replace("#","&tf-embed-ts=".concat(Date.now(),"#")):w.replace("#","?tf-embed-ts=".concat(Date.now(),"#")):w);break;case"_blank":window.open(S,"_blank");break;case"_top":var k=document.createElement("a");k.href=S,k.target="_top",document.body.appendChild(k),k.click(),document.body.removeChild(k);break;default:window.location.href=S}else console.error("Redirect failed, no URL provided")}}},1706:function(g,m){Object.defineProperty(m,"__esModule",{value:!0}),m.lazyInitialize=void 0,m.lazyInitialize=function(y,b){var _=new IntersectionObserver(function(w){w.forEach(function(S){S.isIntersecting&&(b(),_.unobserve(S.target))})});_.observe(y)}},1915:function(g,m,y){var b=this&&this.__createBinding||(Object.create?function(w,S,E,k){k===void 0&&(k=E);var j=Object.getOwnPropertyDescriptor(S,E);j&&!("get"in j?!S.__esModule:j.writable||j.configurable)||(j={enumerable:!0,get:function(){return S[E]}}),Object.defineProperty(w,k,j)}:function(w,S,E,k){k===void 0&&(k=E),w[k]=S[E]}),_=this&&this.__exportStar||function(w,S){for(var E in w)E==="default"||Object.prototype.hasOwnProperty.call(S,E)||b(S,w,E)};Object.defineProperty(m,"__esModule",{value:!0}),_(y(3869),m),_(y(8885),m)},1947:function(g,m){Object.defineProperty(m,"__esModule",{value:!0}),m.refreshIframe=void 0,m.refreshIframe=function(y){if(y){var b=y.src;if(b.includes("&refresh")){var _=b.split("&refresh#");y.src=_.join("#")}else(_=b.split("#"))[0]="".concat(_[0],"&refresh"),y.src=_.join("#")}}},2114:function(g,m){Object.defineProperty(m,"__esModule",{value:!0}),m.sleep=void 0,m.sleep=function(y){return new Promise(function(b){return setTimeout(b,y)})}},2466:function(g,m){Object.defineProperty(m,"__esModule",{value:!0}),m.WIDGET_ATTRIBUTE=m.SLIDER_WIDTH=m.SLIDER_POSITION=m.SLIDER_ATTRIBUTE=m.SIDETAB_ATTRIBUTE=m.POPUP_SIZE=m.POPUP_ATTRIBUTE=m.POPOVER_ATTRIBUTE=m.LIVE_EMBED_DATA_REGION_EU=m.LIVE_EMBED_DATA_REGION_ATTRIBUTE=m.LIVE_EMBED_ATTRIBUTE=m.DEFAULT_EU_DOMAIN=m.DEFAULT_DOMAIN=void 0,m.DEFAULT_DOMAIN="form.typeform.com",m.DEFAULT_EU_DOMAIN="form.typeform.eu",m.
178LIVE_EMBED_ATTRIBUTE="data-tf-live",m.LIVE_EMBED_DATA_REGION_ATTRIBUTE="data-tf-region",m.LIVE_EMBED_DATA_REGION_EU="eu",m.POPOVER_ATTRIBUTE="data-tf-popover",m.POPUP_ATTRIBUTE="data-tf-popup",m.POPUP_SIZE=100,m.SIDETAB_ATTRIBUTE="data-tf-sidetab",m.SLIDER_ATTRIBUTE="data-tf-slider",m.SLIDER_POSITION="right",m.SLIDER_WIDTH=800,m.WIDGET_ATTRIBUTE="data-tf-widget"},2588:function(g,m){Object.defineProperty(m,"__esModule",{value:!0}),m.overrideFullScreenStyles=void 0,m.overrideFullScreenStyles=function(y,b){Object.assign(y.style,{zIndex:"10001",position:"absolute",top:"0",left:"0",width:"100%",height:"100%"}),b.style.borderRadius="0",Object.assign(document.body.style,{overflow:"hidden"})}},2689:function(g,m){Object.defineProperty(m,"__esModule",{value:!0}),m.isDefined=void 0,m.isDefined=function(y){return y!=null}},3106:function(g,m){Object.defineProperty(m,"__esModule",{value:!0}),m.handleCustomOpen=m.handlePreventReopenOnClose=void 0;var y={remove:function(){}};m.handlePreventReopenOnClose=function(w,S){w.preventReopenOnClose&&_(S)},m.handleCustomOpen=function(w,S,E){var k=S.open,j=S.openValue,N=S.preventReopenOnClose,O=(function(D,F,R,B){return function(){var M,V;if(!(B&&b(F)||R==="all"&&(V=document.querySelector(".tf-v1-popup, .tf-v1-slider, .tf-v1-popover-wrapper, .tf-v1-sidetab-wrapper"),(V==null?void 0:V.offsetHeight)||(V==null?void 0:V.offsetWidth)||((M=V==null?void 0:V.getClientRects())===null||M===void 0?void 0:M.length))||R==="same"&&(function(W){var Q=document.querySelectorAll(".tf-v1-popup, .tf-v1-slider, .tf-v1-popover-wrapper, .tf-v1-sidetab-wrapper");return Array.from(Q).some(function(K){var te,I=(te=K.querySelector("iframe"))===null||te===void 0?void 0:te.src;return(I==null?void 0:I.includes("typeform.com/to/".concat(W)))||(I==null?void 0:I.startsWith(W))})})(F)))return D()}})(w,E,S.respectOpenModals,N);switch(k){case"load":return O(),y;case"exit":return j?(function(D,F){var R=0,B=function(M){M.clientY<D&&M.clientY<R?(document.removeEventListener("mousemove",B,!0),F()):R=M.clientY};return document.addEventListener("mousemove",B,!0),{remove:function(){return document.removeEventListener("mousemove",B,!0)}}})(j,O):y;case"time":return setTimeout(function(){O()},j),y;case"scroll":return j?(function(D,F){function R(){var B=window.pageYOffset||document.documentElement.scrollTop,M=document.documentElement.clientTop||0,V=document.documentElement.scrollHeight,W=B-M,Q=W/V*100,K=W+window.innerHeight>=V;(Q>=D||K)&&(F(),document.removeEventListener("scroll",R))}return document.addEventListener("scroll",R),{remove:function(){return document.removeEventListener("scroll",R)}}})(j,O):y;default:return y}};var b=function(w){return document.cookie.includes("tf-".concat(w,"-closed=true"))},_=function(w){document.cookie="tf-".concat(w,"-closed=true;Path=/")}},3124:function(g,m){Object.defineProperty(m,"__esModule",{value:!0}),m.setElementSize=m.getValueWithUnits=void 0,m.getValueWithUnits=function(y){return typeof y!="string"||y.match(/^[0-9]+$/)?"".concat(y,"px"):y},m.setElementSize=function(y,b){var _=b.width,w=b.height;return _&&(y.style.width=(0,m.getValueWithUnits)(_)),w&&(y.style.height=(0,m.getValueWithUnits)(w)),y}},3542:function(g,m,y){var b=this&&this.__awaiter||function(S,E,k,j){return new(k||(k=Promise))(function(N,O){function D(B){try{R(j.next(B))}catch(M){O(M)}}function F(B){try{R(j.throw(B))}catch(M){O(M)}}function R(B){var M;B.done?N(B.value):(M=B.value,M instanceof k?M:new k(function(V){V(M)})).then(D,F)}R((j=j.apply(S,E||[])).next())})},_=this&&this.__generator||function(S,E){var k,j,N,O,D={label:0,sent:function(){if(1&N[0])throw N[1];return N[1]},trys:[],ops:[]};return O={next:F(0),throw:F(1),return:F(2)},typeof Symbol=="function"&&(O[Symbol.iterator]=function(){return this}),O;function F(R){return function(B){return(function(M){if(k)throw new TypeError("Generator is already executing.");for(;O&&(O=0,M[0]&&(D=0)),D;)try{if(k=1,j&&(N=2&M[0]?j.return:M[0]?j.throw||((N=j.return)&&N.call(j),0):j.next)&&!(N=N.call(j,M[1])).done)return N;switch(j=0,N&&(M=[2&M[0],N.value]),M[0]){case 0:case 1:N=M;break;case 4:return D.label++,{value:M[1],done:!1};case 5:D.label++,j=M[1],M=[0];continue;case 7:M=D.ops.pop(),D.trys.pop();continue;default:if(!((N=(N=D.trys).length>0&&N[N.length-1])||M[0]!==6&&M[0]!==2)){D=0;continue}if(M[0]===3&&(!N||M[1]>N[0]&&M[1]<N[3])){D.label=M[1];break}if(M[0]===6&&D.label<N[1]){D.label=N[1],N=M;break}if(N&&D.label<N[2]){D.label=N[2],D.ops.push(M);break}N[2]&&D.ops.pop(),D.trys.pop();continue}M=E.call(S,D)}catch(V){M=[6,V],j=0}finally{k=N=0}if(5&M[0])throw M[1];return{value:M[0]?M[1]:void 0,done:!0}})([R,B])}}};
178Object.defineProperty(m,"__esModule",{value:!0}),m.waitForHubspotCookie=m.getHubspotHiddenFields=m.getHubspotCookieValue=void 0;var w=y(2114);m.getHubspotCookieValue=function(){var S=document.cookie.match(new RegExp("(^| )".concat("hubspotutk","=([^;]+)")));return S&&S[2]||void 0},m.getHubspotHiddenFields=function(){return{hubspot_page_name:document.title,hubspot_page_url:window.location.href,hubspot_utk:(0,m.getHubspotCookieValue)()}},m.waitForHubspotCookie=function(){return b(void 0,void 0,void 0,function(){var S,E;return _(this,function(k){switch(k.label){case 0:S=10,E=0,k.label=1;case 1:return!(0,m.getHubspotCookieValue)()&&E<S?[4,(0,w.sleep)(250)]:[3,4];case 2:k.sent(),k.label=3;case 3:return E++,[3,1];case 4:return[2]}})})}},3631:function(g,m,y){Object.defineProperty(m,"__esModule",{value:!0}),m.buildWidget=void 0;var b=y(6517);m.buildWidget=function(_,w,S){var E=document.createElement("div");return E.className="tf-v1-widget",E.dataset.testid="tf-v1-widget",E.append(_),(0,b.setElementSize)(E,{width:w,height:S})}},3709:function(g,m){var y=this&&this.__assign||function(){return y=Object.assign||function(b){for(var _,w=1,S=arguments.length;w<S;w++)for(var E in _=arguments[w])Object.prototype.hasOwnProperty.call(_,E)&&(b[E]=_[E]);return b},y.apply(this,arguments)};Object.defineProperty(m,"__esModule",{value:!0}),m.getTransitiveSearchParams=void 0,m.getTransitiveSearchParams=function(b){var _=new URL(window.location.href);return typeof b=="boolean"&&b?Object.fromEntries(_.searchParams.entries()):Array.isArray(b)&&b.length>0?b.reduce(function(w,S){var E,k=_.searchParams.get(S);return k?y(y({},w),((E={})[S]=k,E)):w},{}):{}}},3869:function(g,m,y){var b=this&&this.__rest||function(S,E){var k={};for(var j in S)Object.prototype.hasOwnProperty.call(S,j)&&E.indexOf(j)<0&&(k[j]=S[j]);if(S!=null&&typeof Object.getOwnPropertySymbols=="function"){var N=0;for(j=Object.getOwnPropertySymbols(S);N<j.length;N++)E.indexOf(j[N])<0&&Object.prototype.propertyIsEnumerable.call(S,j[N])&&(k[j[N]]=S[j[N]])}return k};Object.defineProperty(m,"__esModule",{value:!0}),m.createSlider=void 0;var _=y(6517),w=y(2466);m.createSlider=function(S,E){if(E===void 0&&(E={}),!(0,_.hasDom)())return{open:function(){},close:function(){},toggle:function(){},refresh:function(){},focus:function(){},unmount:function(){}};var k,j=E.position,N=j===void 0?w.SLIDER_POSITION:j,O=E.width,D=O===void 0?w.SLIDER_WIDTH:O,F=E.onClose,R=E.domain,B=b(E,["position","width","onClose","domain"]),M=(0,_.createIframe)("slider",{formId:S,domain:R,options:B}),V=M.iframe,W=M.embedId,Q=M.refresh,K=M.focus,te=document.body.style.overflow,I=(function(P){var q=document.createElement("div");return q.className="tf-v1-slider ".concat(P),q.dataset.testid="tf-v1-slider",q.style.opacity="0",q})(N),H=(function(){var P=document.createElement("div");return P.className="tf-v1-spinner",P})(),G=(function(P,q){var z=document.createElement("div");return z.className="tf-v1-iframe-wrapper",z.style[P]="-100%",(0,_.setElementSize)(z,{width:q})})(N,D);G.append(V),I.append(H),I.append(G);var re=B.container||document.body;V.onload=function(P){P!=null&&P.isTrusted&&(G.style[N]="0",setTimeout(function(){H.style.display="none"},500),(0,_.addCustomKeyboardListener)(A))};var U=function(){(0,_.isOpen)(I)||((0,_.isInPage)(I)?(I.style.display="flex",setTimeout(function(){G.style[N]="0"})):(re.append(I),H.style.display="block"),document.body.style.overflow="hidden",setTimeout(function(){I.style.opacity="1"}))},A=function(){(0,_.isOpen)(I)&&((0,_.handlePreventReopenOnClose)(B,S),F==null||F(),I.style.opacity="0",G.style[N]="-100%",document.body.style.overflow=te,setTimeout(function(){B.keepSession?I.style.display="none":$()},500))};(0,_.setAutoClose)(W,B.autoClose,A),G.append((function(P){var q=document.createElement("button");return q.className="tf-v1-close tf-v1-close-icon",q.innerHTML=_.closeIconSvg,q.ariaLabel="Close",q.onclick=(0,_.invokeWithoutDefault)(P),q})(A)),B.open&&!(0,_.isOpen)(I)&&(k=(0,_.handleCustomOpen)(U,B,S));var $=function(){(0,_.unmountElement)(I),B.open&&(k!=null&&k.remove)&&k.remove()};return{open:U,close:A,toggle:function(){(0,_.isOpen)(I)?A():U()},refresh:Q,focus:K,unmount:$}}}
178,4375:function(g,m){Object.defineProperty(m,"__esModule",{value:!0}),m.includeCss=void 0,m.includeCss=function(y){var b=(function(w){return"".concat("https://embed.typeform.com/next/css/").concat(w)})(y);if(!document.querySelector('link[href="'.concat(b,'"]'))){var _=document.createElement("link");_.rel="stylesheet",_.href=b,document.head.append(_)}}},4424:function(g,m){Object.defineProperty(m,"__esModule",{value:!0}),m.invokeWithoutDefault=void 0,m.invokeWithoutDefault=function(y){return function(b){b==null||b.preventDefault(),y()}}},4471:function(g,m){Object.defineProperty(m,"__esModule",{value:!0}),m.setupGaInstance=m.sendGaIdMessage=void 0,m.sendGaIdMessage=function(_,w,S){var E={embedId:_,gaClientId:w};setTimeout(function(){S&&S.contentWindow&&S.contentWindow.postMessage({type:"ga-client-id",data:E},"*")},0)};var y=function(_){console.error(_)},b=function(_){y("Whoops! You enabled the shareGaInstance feature in your typeform embed but ".concat(_,`.
179
180`)+`Make sure to include Google Analytics Javascript code before the Typeform Embed Javascript code in your page and use correct tracker ID.
181
182It is also possible the Google Analytics was blocked by your adblock plugin.`)};m.setupGaInstance=function(_,w,S){var E=typeof S=="string"?S:void 0;if(window.gtag){if(E||(E=(function(){if(window.dataLayer){var N=window.dataLayer.find(function(O){return O.length>1&&O[0]==="config"});return N&&N[1]}})()),!E)return void b("the tracking ID could not be retrieved");var k=!1;window.gtag("get",E,"client_id",function(N){k=!0,(0,m.sendGaIdMessage)(w,N,_)}),setTimeout(function(){k||b("the tracker with ID ".concat(E," was not found"))},3e3)}else try{var j=(function(N,O){return O?N.find(function(D){return D.get("trackingId")===O}):N[0]})(window.ga.getAll(),E);j?(0,m.sendGaIdMessage)(w,j.get("clientId"),_):b("the tracker with ID ".concat(E," was not found"))}catch(N){b("the Google Analytics object was not found"),y(N)}}},4948:function(g,m,y){var b=this&&this.__createBinding||(Object.create?function(w,S,E,k){k===void 0&&(k=E);var j=Object.getOwnPropertyDescriptor(S,E);j&&!("get"in j?!S.__esModule:j.writable||j.configurable)||(j={enumerable:!0,get:function(){return S[E]}}),Object.defineProperty(w,k,j)}:function(w,S,E,k){k===void 0&&(k=E),w[k]=S[E]}),_=this&&this.__exportStar||function(w,S){for(var E in w)E==="default"||Object.prototype.hasOwnProperty.call(S,E)||b(S,w,E)};Object.defineProperty(m,"__esModule",{value:!0}),_(y(4989),m),_(y(5981),m)},4976:function(g,m){Object.defineProperty(m,"__esModule",{value:!0}),m.closeIconSvg=void 0,m.closeIconSvg=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
183  <path fill-rule="evenodd" clip-rule="evenodd" d="M4.293 4.293a1 1 0 0 1 1.414 0L12 10.586l6.293-6.293a1 1 0 1 1 1.414 1.414L13.414 12l6.293 6.293a1 1 0 0 1-1.414 1.414L12 13.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L10.586 12 4.293 5.707a1 1 0 0 1 0-1.414Z" fill="currentColor"/>
184</svg>`},4989:function(g,m,y){var b=this&&this.__assign||function(){return b=Object.assign||function(j){for(var N,O=1,D=arguments.length;O<D;O++)for(var F in N=arguments[O])Object.prototype.hasOwnProperty.call(N,F)&&(j[F]=N[F]);return j},b.apply(this,arguments)},_=this&&this.__rest||function(j,N){var O={};for(var D in j)Object.prototype.hasOwnProperty.call(j,D)&&N.indexOf(D)<0&&(O[D]=j[D]);if(j!=null&&typeof Object.getOwnPropertySymbols=="function"){var F=0;for(D=Object.getOwnPropertySymbols(j);F<D.length;F++)N.indexOf(D[F])<0&&Object.prototype.propertyIsEnumerable.call(j,D[F])&&(O[D[F]]=j[D[F]])}return O};Object.defineProperty(m,"__esModule",{value:!0}),m.createSidetab=void 0;var w=y(6517),S={buttonColor:"#3a7685",buttonText:"Launch me"},E=function(j,N){j===void 0&&(j="div"),N===void 0&&(N="tf-v1-sidetab-button-icon");var O=document.createElement(j);return O.className="".concat(N," tf-v1-close-icon"),O.innerHTML=w.closeIconSvg,O.dataset.testid=N,O},k=function(j,N){var O=j.parentNode;O&&(O.removeChild(j),O.appendChild(N))};m.createSidetab=function(j,N){N===void 0&&(N={});var O,D=b(b({},S),N),F=D.domain,R=_(D,["domain"]),B=(0,w.createIframe)("side-tab",{formId:j,domain:F,options:R}),M=B.iframe,V=B.embedId,W=B.refresh,Q=B.focus,K=(function(z,X,se,ne){var ie=document.createElement("div");return ie.className="tf-v1-sidetab",ie.dataset.testid="tf-v1-sidetab",(0,w.setElementSize)(ie,{width:z,height:X}),se!==void 0?(ie.style.top="calc(".concat((0,w.getValueWithUnits)(se)," + ").concat((0,w.getValueWithUnits)(X||580)," / 2)"),ie.style.bottom="auto"):ne!==void 0&&(ie.style.top="auto",ie.style.bottom="calc(".concat((0,w.getValueWithUnits)(ne)," - ").concat((0,w.getValueWithUnits)(X||580)," / 2)")),ie})(R.width,R.height,R.top,R.bottom),te=(function(){var z=document.createElement("div");return z.className="tf-v1-sidetab-wrapper",z.dataset.testid="tf-v1-sidetab-wrapper",z})(),I=(function(){var z=document.createElement("div");z.className="tf-v1-spinner";var X=document.createElement("div");return X.className="tf-v1-sidetab-button-icon",X.dataset.testid="spinner-icon",X.append(z),X})(),H=(function(z){var X=z.backgroundColor,se=z.textColor,ne=z.width,ie=z.height,fe=z.align,_e=fe===void 0?"center":fe,Te=z.buttonProps,Oe=Te===void 0?{}:Te,xe=document.createElement("button");return xe.className="tf-v1-sidetab-button",xe.style.backgroundColor=X,xe.style.color=se||(0,w.getTextColor)(X),(0,w.addAttributesToElement)(xe,Oe),(0,w.setElementSize)(xe,{width:ne,height:ie}),ie&&(xe.style.left="-".concat((0,w.getValueWithUnits)(ie))),_e==="top"?(xe.style.transform="rotate(-90deg) translateX(-100%)",xe.style.top="0"):_e==="bottom"&&(xe.style.transform="rotate(-90deg) translateX(0)",xe.style.top="auto",xe.style.bottom="-".concat((0,w.getValueWithUnits)(ie||48))),xe})({backgroundColor:R.buttonColor||S.buttonColor,textColor:R.buttonTextColor,width:R.buttonHeight,height:R.buttonWidth,align:R.buttonAlign,buttonProps:R.buttonProps}),G=(function(z,X){var se=document.createElement("span");return se.className="tf-v1-sidetab-button-text",se.innerHTML=z,X&&(se.style.fontSize=(0,w.getValueWithUnits)(X)),se})(R.buttonText||S.buttonText,R.buttonTextSize),re=(function(z,X,se,ne){var ie=se||(0,w.getTextColor)(X),fe=document.createElement("div");fe.className="tf-v1-sidetab-button-icon",ne&&(fe.style.width=(0,w.getValueWithUnits)(ne),fe.style.height=(0,w.getValueWithUnits)(ne));var _e=(0,w.triggerIconSvg)(ie),Te=z==null?void 0:z.startsWith("http");return fe.innerHTML=Te?"<img alt='popover trigger icon button' src='".concat(z,"'/>"):z??_e,fe.dataset.testid="default-icon",fe})(R.customIcon,R.buttonColor||S.buttonColor,R.buttonTextColor,R.buttonTextSize),U=E(),A=E("button","tf-v1-sidetab-close");(R.container||document.body).append(K),te.append(M),K.append(H),K.append(A),H.append(re),H.append(G),setTimeout(function(){K.classList.add("ready")},250),M.onload=function(z){z!=null&&z.isTrusted&&(K.classList.add("open"),k(I,U),(0,w.addCustomKeyboardListener)(P))};var $=function(){(0,w.isOpen)(te)||((0,w.isInPage)(te)?(te.style.display="flex",K.classList.add("open"),k(re,U)):(K.append(te),k(re,I)))},P=function(){var z;(0,w.isOpen)(te)&&((0,w.handlePreventReopenOnClose)(R,j),(z=R.onClose)===null||z===void 0||z.call(
184R),K.classList.remove("open"),setTimeout(function(){R.keepSession?te.style.display="none":(0,w.unmountElement)(te),k(U,re)},250))};(0,w.setAutoClose)(V,R.autoClose,P);var q=function(){(0,w.isOpen)(te)?P():$()};return H.onclick=(0,w.invokeWithoutDefault)(q),A.onclick=(0,w.invokeWithoutDefault)(P),R.open&&!(0,w.isOpen)(te)&&(O=(0,w.handleCustomOpen)($,R,j)),{open:$,close:P,toggle:q,refresh:W,focus:Q,unmount:function(){(0,w.unmountElement)(K),R.open&&(O!=null&&O.remove)&&O.remove()}}}},5330:function(g,m){Object.defineProperty(m,"__esModule",{value:!0}),m.isVisible=m.isInPage=m.isOpen=void 0,m.isOpen=function(y){return(0,m.isInPage)(y)&&(0,m.isVisible)(y)},m.isInPage=function(y){return!!y.parentNode},m.isVisible=function(y){return y.style.display!=="none"}},5363:function(g,m,y){var b=this&&this.__createBinding||(Object.create?function(w,S,E,k){k===void 0&&(k=E);var j=Object.getOwnPropertyDescriptor(S,E);j&&!("get"in j?!S.__esModule:j.writable||j.configurable)||(j={enumerable:!0,get:function(){return S[E]}}),Object.defineProperty(w,k,j)}:function(w,S,E,k){k===void 0&&(k=E),w[k]=S[E]}),_=this&&this.__exportStar||function(w,S){for(var E in w)E==="default"||Object.prototype.hasOwnProperty.call(S,E)||b(S,w,E)};Object.defineProperty(m,"__esModule",{value:!0}),_(y(1179),m),_(y(249),m)},5400:function(g,m){Object.defineProperty(m,"__esModule",{value:!0}),m.triggerIconSvg=void 0,m.triggerIconSvg=function(y){return`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
185    <path
186      fill-rule="evenodd"
187      clip-rule="evenodd"
188      d="M2.002 5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6.697l-5.748 3.832A1 1 0 0 1 6.002 22v-3h-2a2 2 0 0 1-2-2V5Zm18 0h-16v12h3a1 1 0 0 1 1 1v2.131l4.445-2.963a1 1 0 0 1 .555-.168h7V5Z"
189      fill=`.concat(y,`
190    />
191    <path
192      fill-rule="evenodd"
193      clip-rule="evenodd"
194      d="M7.5 12.25a1.25 1.25 0 1 1 0-2.5 1.25 1.25 0 0 1 0 2.5Zm4.5 0a1.25 1.25 0 1 1 0-2.5 1.25 1.25 0 0 1 0 2.5Zm4.5 0a1.25 1.25 0 1 1 0-2.5 1.25 1.25 0 0 1 0 2.5Z"
195      fill=`).concat(y,`
196    />
197  </svg>`)}},5981:function(g,m){Object.defineProperty(m,"__esModule",{value:!0})},6112:function(g,m){Object.defineProperty(m,"__esModule",{value:!0}),m.triggerIframeRedraw=void 0,m.triggerIframeRedraw=function(){this.style.transform="translateZ(0)"}},6257:function(g,m,y){var b=this&&this.__rest||function(E,k){var j={};for(var N in E)Object.prototype.hasOwnProperty.call(E,N)&&k.indexOf(N)<0&&(j[N]=E[N]);if(E!=null&&typeof Object.getOwnPropertySymbols=="function"){var O=0;for(N=Object.getOwnPropertySymbols(E);O<N.length;O++)k.indexOf(N[O])<0&&Object.prototype.propertyIsEnumerable.call(E,N[O])&&(j[N[O]]=E[N[O]])}return j};Object.defineProperty(m,"__esModule",{value:!0}),m.createPopup=void 0;var _=y(6517),w=y(2466),S=y(6517);m.createPopup=function(E,k){if(k===void 0&&(k={}),!(0,_.hasDom)())return{open:function(){},close:function(){},toggle:function(){},refresh:function(){},focus:function(){},unmount:function(){}};var j,N=k.width,O=k.height,D=k.size,F=D===void 0?w.POPUP_SIZE:D,R=k.onClose,B=k.domain,M=b(k,["width","height","size","onClose","domain"]),V=(0,_.createIframe)("popup",{formId:E,domain:B,options:M}),W=V.iframe,Q=V.embedId,K=V.refresh,te=V.focus,I=document.body.style.overflow,H=(function(){var q=document.createElement("div");return q.className="tf-v1-popup",q.dataset.testid="tf-v1-popup",q.style.opacity="0",q})(),G=(function(){var q=document.createElement("div");return q.className="tf-v1-spinner",q})(),re=(function(q,z,X){var se=document.createElement("div");return se.className="tf-v1-iframe-wrapper",se.style.opacity="0",(0,_.isDefined)(q)&&(0,_.isDefined)(z)?(0,_.setElementSize)(se,{width:q,height:z}):(se.style.width="calc(".concat(X,"% - 80px)"),se.style.height="calc(".concat(X,"% - 80px)"),se)})(N,O,F);re.append(W),H.append(G),H.append(re);var U=M.container||document.body;W.onload=function(q){q!=null&&q.isTrusted&&(re.style.opacity="1",setTimeout(function(){G.style.display="none"},250),(0,_.addCustomKeyboardListener)($))};var A=function(){(0,S.isOpen)(H)||((0,S.isInPage)(H)?H.style.display="flex":(G.style.display="block",U.append(H)),document.body.style.overflow="hidden",setTimeout(function(){H.style.opacity="1"}))},$=function(){(0,S.isOpen)(H)&&((0,_.handlePreventReopenOnClose)(M,E),R==null||R(),H.style.opacity="0",document.body.style.overflow=I,setTimeout(function(){M.keepSession?H.style.display="none":P()},250))};re.append((function(q){var z=document.createElement("button");return z.className="tf-v1-close tf-v1-close-icon",z.innerHTML=_.closeIconSvg,z.ariaLabel="Close",z.oncl
197ick=(0,_.invokeWithoutDefault)(q),z})($)),(0,_.setAutoClose)(Q,M.autoClose,$),M.open&&!(0,S.isOpen)(H)&&(j=(0,_.handleCustomOpen)(A,M,E));var P=function(){(0,_.unmountElement)(H),M.open&&(j!=null&&j.remove)&&j.remove()};return{open:A,close:$,toggle:function(){(0,S.isOpen)(H)?$():A()},refresh:K,focus:te,unmount:P}}},6419:function(g,m){Object.defineProperty(m,"__esModule",{value:!0}),m.changeColorOpacity=void 0,m.changeColorOpacity=function(y,b){return y===void 0&&(y=""),b===void 0&&(b=255),y.startsWith("rgba(")?y==null?void 0:y.replace(/, [\d.]+\)$/,", ".concat(b,")")):y}},6517:function(g,m,y){var b=this&&this.__createBinding||(Object.create?function(w,S,E,k){k===void 0&&(k=E);var j=Object.getOwnPropertyDescriptor(S,E);j&&!("get"in j?!S.__esModule:j.writable||j.configurable)||(j={enumerable:!0,get:function(){return S[E]}}),Object.defineProperty(w,k,j)}:function(w,S,E,k){k===void 0&&(k=E),w[k]=S[E]}),_=this&&this.__exportStar||function(w,S){for(var E in w)E==="default"||Object.prototype.hasOwnProperty.call(S,E)||b(S,w,E)};Object.defineProperty(m,"__esModule",{value:!0}),_(y(7177),m),_(y(7677),m),_(y(9188),m),_(y(4375),m),_(y(2689),m),_(y(7917),m),_(y(8235),m),_(y(7853),m),_(y(3124),m),_(y(9556),m),_(y(3106),m),_(y(352),m),_(y(4471),m),_(y(1403),m),_(y(1706),m),_(y(5330),m),_(y(6419),m),_(y(3542),m),_(y(4424),m),_(y(9723),m),_(y(4976),m),_(y(5400),m)},6530:function(g,m){var y=this&&this.__assign||function(){return y=Object.assign||function(S){for(var E,k=1,j=arguments.length;k<j;k++)for(var N in E=arguments[k])Object.prototype.hasOwnProperty.call(E,N)&&(S[N]=E[N]);return S},y.apply(this,arguments)};Object.defineProperty(m,"__esModule",{value:!0}),m.buildNotificationDot=m.canBuildNotificationDot=m.saveNotificationDotHideUntilTime=void 0;var b="tfNotificationData",_=function(){var S=localStorage.getItem(b);return S?JSON.parse(S):{}},w=function(S){S&&localStorage.setItem(b,JSON.stringify(S))};m.saveNotificationDotHideUntilTime=function(S,E){var k,j=new Date;j.setDate(j.getDate()+E),w(y(y({},_()),((k={})[S]={hideUntilTime:j.getTime()},k)))},m.canBuildNotificationDot=function(S){var E=(function(k){var j;return((j=_()[k])===null||j===void 0?void 0:j.hideUntilTime)||0})(S);return new Date().getTime()>E&&(E&&(function(k){var j=_();delete j[k],w(j)})(S),!0)},m.buildNotificationDot=function(){var S=document.createElement("span");return S.className="tf-v1-popover-unread-dot",S.dataset.testid="tf-v1-popover-unread-dot",S}},6546:function(g,m){Object.defineProperty(m,"__esModule",{value:!0}),m.hexRgb=void 0;var y="a-f\\d",b="#?[".concat(y,"]{3}[").concat(y,"]?"),_="#?[".concat(y,"]{6}([").concat(y,"]{2})?"),w=new RegExp("[^#".concat(y,"]"),"gi"),S=new RegExp("^".concat(b,"$|^").concat(_,"$"),"i");m.hexRgb=function(E){if(typeof E!="string"||w.test(E)||!S.test(E))throw new TypeError("Expected a valid hex string");(E=E.replace(/^#/,"")).length===8&&(E=E.slice(0,6)),E.length===4&&(E=E.slice(0,3)),E.length===3&&(E=E[0]+E[0]+E[1]+E[1]+E[2]+E[2]);var k=Number.parseInt(E,16);return{red:k>>16,green:k>>8&255,blue:255&k}}},6932:function(g,m,y){var b=this&&this.__createBinding||(Object.create?function(w,S,E,k){k===void 0&&(k=E);var j=Object.getOwnPropertyDescriptor(S,E);j&&!("get"in j?!S.__esModule:j.writable||j.configurable)||(j={enumerable:!0,get:function(){return S[E]}}),Object.defineProperty(w,k,j)}:function(w,S,E,k){k===void 0&&(k=E),w[k]=S[E]}),_=this&&this.__exportStar||function(w,S){for(var E in w)E==="default"||Object.prototype.hasOwnProperty.call(S,E)||b(S,w,E)};Object.defineProperty(m,"__esModule",{value:!0}),_(y(6257),m),_(y(8625),m)},7121:function(g,m,y){var b=this&&this.__rest||function(j,N){var O={};for(var D in j)Object.prototype.hasOwnProperty.call(j,D)&&N.indexOf(D)<0&&(O[D]=j[D]);if(j!=null&&typeof Object.getOwnPropertySymbols=="function"){var F=0;for(D=Object.getOwnPropertySymbols(j);F<D.length;F++)N.indexOf(D[F])<0&&Object.prototype.propertyIsEnumerable.call(j,D[F])&&(O[D[F]]=j[D[F]])}return O},_=this&&this.__read||function(j,N){var O=typeof Symbol=="function"&&j[Symbol.iterator];if(!O)return j;var D,F,R=O.call(j),B=[];try{for(;(N===void 0||N-- >0)&&!(D=R.next()).done;)B.push(D.value)}catch(M){F={error:M}}finally{try{D&&!D.done&&(O=R.return)&&O.call(R)}finally{if(F)throw F.error}}return B};
197Object.defineProperty(m,"__esModule",{value:!0}),m.createWidget=void 0;var w=y(6517),S=y(476),E=y(9586),k=y(2588);m.createWidget=function(j,N){if(!(0,w.hasDom)())return{refresh:function(){},focus:function(){},unmount:function(){}};var O=N.domain,D=b(N,["domain"]);D.inlineOnMobile=N.inlineOnMobile||N.fullScreen;var F=document.body.style.overflow;D.inlineOnMobile||!D.forceTouch&&!(0,w.isFullscreen)()||(D.displayAsFullScreenModal=!0,D.forceTouch=!0,D.autoResize=!1);var R=(0,w.createIframe)("widget",{formId:j,domain:O,options:D}),B=R.embedId,M=R.iframe,V=R.refresh,W=R.focus,Q=(0,E.buildWidget)(M,D.width,D.height);if(D.fullScreen&&(0,k.overrideFullScreenStyles)(N.container,M),D.autoResize){var K=_(typeof D.autoResize=="string"?D.autoResize.split(",").map(function(P){return parseInt(P)}):[],2),te=K[0],I=K[1];window.addEventListener("message",(0,S.getFormHeightChangedHandler)(B,function(P){var q=Math.max(P.height,te||0);I&&(q=Math.min(q,I)),N.container.style.height="".concat(q,"px")}))}D.autoFocus&&window.addEventListener("message",(0,S.getFormReadyHandler)(B,function(){setTimeout(function(){W()},1e3)}));var H,G=function(){return N.container.append(Q)};if(N.container.innerHTML="",N.lazy?(0,w.lazyInitialize)(N.container,G):G(),D.displayAsFullScreenModal){var re="",U=N.container,A=U.style.height;window.addEventListener("message",(0,S.getWelcomeScreenHiddenHandler)(B,function(){U.classList.add("tf-v1-widget-fullscreen"),N.opacity!==void 0&&(U.style.backgroundColor=re)})),window.addEventListener("message",(0,S.getFormThemeHandler)(B,function(P){var q;re=(0,w.changeColorOpacity)((q=P==null?void 0:P.theme)===null||q===void 0?void 0:q.backgroundColor)}));var $=((H=document.createElement("button")).className="tf-v1-widget-close tf-v1-close-icon",H.innerHTML="&times;",H.ariaLabel="Close",H);$.onclick=(0,w.invokeWithoutDefault)(function(){var P;if(U.style.height=A,(P=N.onClose)===null||P===void 0||P.call(N),U.classList.remove("tf-v1-widget-fullscreen"),U.style.backgroundColor="",D.fullScreen&&(document.body.style.overflow=F),N.keepSession){var q=document.createElement("div");q.className="tf-v1-widget-iframe-overlay",q.onclick=function(){U.classList.add("tf-v1-widget-fullscreen"),(0,w.unmountElement)(q)},Q.append(q)}else N.container.innerHTML="",G(),U.append($)}),U.append($)}return{refresh:V,focus:W,unmount:function(){(0,w.unmountElement)(Q)}}}},7177:function(g,m,y){var b=this&&this.__assign||function(){return b=Object.assign||function(O){for(var D,F=1,R=arguments.length;F<R;F++)for(var B in D=arguments[F])Object.prototype.hasOwnProperty.call(D,B)&&(O[B]=D[B]);return O},b.apply(this,arguments)},_=this&&this.__read||function(O,D){var F=typeof Symbol=="function"&&O[Symbol.iterator];if(!F)return O;var R,B,M=F.call(O),V=[];try{for(;(D===void 0||D-- >0)&&!(R=M.next()).done;)V.push(R.value)}catch(W){B={error:W}}finally{try{R&&!R.done&&(F=M.return)&&F.call(M)}finally{if(B)throw B.error}}return V};Object.defineProperty(m,"__esModule",{value:!0}),m.buildIframeSrc=void 0;var w=y(2466),S=y(7853),E=y(2689),k=y(3709),j=y(3542),N={widget:"embed-widget",popup:"popup-blank",slider:"popup-drawer",popover:"popup-popover","side-tab":"popup-side-panel"};m.buildIframeSrc=function(O){var D=O.domain,F=O.formId,R=O.type,B=O.embedId,M=O.options,V=(function(K,te,I){var H=I.transitiveSearchParams,G=I.source,re=I.medium,U=I.mediumVersion,A=I.hideFooter,$=I.hideHeaders,P=I.opacity,q=I.disableTracking,z=I.enableSandbox,X=I.shareGaInstance,se=I.forceTouch,ne=I.displayAsFullScreenModal,ie=I.tracking,fe=I.redirectTarget,_e=I.autoResize,Te=I.disableScroll,Oe=I.onEndingButtonClick,xe=I.noHeading,Ge=I.noScrollbars,Le=(0,k.getTransitiveSearchParams)(H);return b(b(b({},{"typeform-embed-id":te,"typeform-embed":N[K],"typeform-source":G,"typeform-medium":re,"typeform-medium-version":U,"embed-hide-footer":A?"true":void 0,"embed-hide-headers":$?"true":void 0,"embed-opacity":P,"disable-tracking":q||z?"true":void 0,"enable-sandbox":z?"true":void 0,"share-ga-instance":X?"true":void 0,"force-touch":se?"true":void 0,"add-placeholder-ws":K==="widget"&&ne?"true":void 0,"typeform-embed-redirect-target":fe,"typeform-embed-handles-redirect":1,"typeform-embed-auto-resize":_e?"true":void 0,"typeform-embed-disable-scroll":Te?"true":void 0,"typeform-embed-handle-ending-button-click":Oe?"true":void 0,"typeform-embed-no-heading":xe?"true":void 0,"typeform-embed-no-scrollbars":Ge?"true":void 0}),Le),ie)})(R,B,(function(K){return K.noHeading||(K.noHeading=document.querySelectorAll("h1").length>0),b(b({},{source:(te=window==null?void 0:window.location)===null||te===void 0?void 0:te.hostname.replace(/^www\./,""),medium:"embed-sdk",mediumVersion:"next"}),(0,S.removeUndefinedKeys)(K));var te})(M)),W=(function(K,te,I){if(te===void 0&&(te=w.DEFAULT_DOMAIN),K.startsWith("http://")||K.startsWith("https://"))return new URL(K);var H=te!==w.DEFAULT_DOMAIN?te:(function(G){return G==="eu"?w.DEFAULT_EU_DOMAIN:w.DEFAULT_DOMAIN})(I);return new URL("https://".concat(H,"/to/").concat(K))})(F,D,M==null?void 0:M.region);if(Object.entries(V).filter(function(K){var te=_(K,2)[1];return(0,E.isDefined)(te)}
197).forEach(function(K){var te=_(K,2),I=te[0],H=te[1];W.searchParams.set(I,H)}),M.hubspot){var Q=(0,j.getHubspotHiddenFields)();M.hidden=b(b({},M.hidden),Q)}return W.hash=(function(K,te){var I=new URLSearchParams;te.hidden&&Object.entries(te.hidden).filter(function(U){var A=_(U,2)[1];return(0,E.isDefined)(A)&&A!==""}).forEach(function(U){var A=_(U,2),$=A[0],P=A[1];typeof te.transitiveSearchParams=="boolean"&&K.searchParams.delete($),I.set($,P)});var H=(function(U){if(!U)return null;var A=Object.keys(U).at(0),$=A&&U[A]||void 0;return A===void 0||$===void 0?null:{key:"answers-".concat(A),value:$}})(te.preselect);if(H){var G=H.key,re=H.value;I.set(G,re)}return I.toString()})(W,M),W.href}},7677:function(g,m,y){var b=this&&this.__createBinding||(Object.create?function(w,S,E,k){k===void 0&&(k=E);var j=Object.getOwnPropertyDescriptor(S,E);j&&!("get"in j?!S.__esModule:j.writable||j.configurable)||(j={enumerable:!0,get:function(){return S[E]}}),Object.defineProperty(w,k,j)}:function(w,S,E,k){k===void 0&&(k=E),w[k]=S[E]}),_=this&&this.__exportStar||function(w,S){for(var E in w)E==="default"||Object.prototype.hasOwnProperty.call(S,E)||b(S,w,E)};Object.defineProperty(m,"__esModule",{value:!0}),_(y(9310),m),_(y(883),m)},7783:function(g,m,y){var b=this&&this.__createBinding||(Object.create?function(w,S,E,k){k===void 0&&(k=E);var j=Object.getOwnPropertyDescriptor(S,E);j&&!("get"in j?!S.__esModule:j.writable||j.configurable)||(j={enumerable:!0,get:function(){return S[E]}}),Object.defineProperty(w,k,j)}:function(w,S,E,k){k===void 0&&(k=E),w[k]=S[E]}),_=this&&this.__exportStar||function(w,S){for(var E in w)E==="default"||Object.prototype.hasOwnProperty.call(S,E)||b(S,w,E)};Object.defineProperty(m,"__esModule",{value:!0}),_(y(5363),m),_(y(6932),m),_(y(1915),m),_(y(9814),m),_(y(4948),m)},7853:function(g,m,y){var b=this&&this.__assign||function(){return b=Object.assign||function(S){for(var E,k=1,j=arguments.length;k<j;k++)for(var N in E=arguments[k])Object.prototype.hasOwnProperty.call(E,N)&&(S[N]=E[N]);return S},b.apply(this,arguments)},_=this&&this.__read||function(S,E){var k=typeof Symbol=="function"&&S[Symbol.iterator];if(!k)return S;var j,N,O=k.call(S),D=[];try{for(;(E===void 0||E-- >0)&&!(j=O.next()).done;)D.push(j.value)}catch(F){N={error:F}}finally{try{j&&!j.done&&(k=O.return)&&k.call(O)}finally{if(N)throw N.error}}return D};Object.defineProperty(m,"__esModule",{value:!0}),m.removeUndefinedKeys=void 0;var w=y(2689);m.removeUndefinedKeys=function(S){return Object.entries(S).filter(function(E){var k=_(E,2)[1];return(0,w.isDefined)(k)}).reduce(function(E,k){var j,N=_(k,2),O=N[0],D=N[1];return b(b({},E),((j={})[O]=D,j))},{})}},7917:function(g,m){var y=this&&this.__assign||function(){return y=Object.assign||function(j){for(var N,O=1,D=arguments.length;O<D;O++)for(var F in N=arguments[O])Object.prototype.hasOwnProperty.call(N,F)&&(j[F]=N[F]);return j},y.apply(this,arguments)},b=this&&this.__read||function(j,N){var O=typeof Symbol=="function"&&j[Symbol.iterator];if(!O)return j;var D,F,R=O.call(j),B=[];try{for(;(N===void 0||N-- >0)&&!(D=R.next()).done;)B.push(D.value)}catch(M){F={error:M}}finally{try{D&&!D.done&&(O=R.return)&&O.call(R)}finally{if(F)throw F.error}}return B};Object.defineProperty(m,"__esModule",{value:!0}),m.loadOptionsFromAttributes=m.transformAttributeValue=m.camelCaseToKebabCase=void 0,m.camelCaseToKebabCase=function(j){return j.split("").map(function(N,O){return N.toUpperCase()===N?"".concat(O!==0?"-":"").concat(N.toLowerCase()):N}).join("")};var _=function(j){return j||void 0},w=function(j){if(j!==null)return j===""||j==="yes"||j==="true"},S=function(j){var N=j?parseInt(j,10):NaN;return isNaN(N)?void 0:N},E="%ESCAPED_COMMA%",k=function(j){if(j)return j.replace(/\s/g,"").replace(/\\,/g,E).split(",").filter(function(N){return!!N}).map(function(N){return N.replace(E,",")})};m.transformAttributeValue=function(j,N){var O,D,F;switch(N){case"string":return _(j);case"boolean":return w(j);case"integer":return S(j);case"function":return(function(R){var B=R&&R in window?window[R]:void 0;return typeof B=="function"?B:void 0})(j);case"array":return k(j);
197case"record":return(function(R){if(R)return R.replace(/\\,/g,E).split(",").filter(function(B){return!!B}).map(function(B){return B.replace(E,",")}).reduce(function(B,M){var V,W=M.match(/^([^=]+)=(.*)$/);if(W){var Q=b(W,3),K=Q[1],te=Q[2];return y(y({},B),((V={})[K.trim()]=te,V))}return B},{})})(j);case"integerOrString":return(function(R){if(R)return R.match(/^[0-9]+$/)?S(R):_(R)})(j);case"integerOrBoolean":return(O=S(j))!==null&&O!==void 0?O:w(j);case"stringOrBoolean":return(D=_(j))!==null&&D!==void 0?D:w(j);case"arrayOrBoolean":return(F=k(j))!==null&&F!==void 0?F:w(j);default:throw new Error("Invalid attribute transformation ".concat(N))}},m.loadOptionsFromAttributes=function(j,N){return Object.keys(N).reduce(function(O,D){var F;return y(y({},O),((F={})[D]=(0,m.transformAttributeValue)(j.getAttribute("data-tf-".concat((0,m.camelCaseToKebabCase)(D))),N[D]),F))},{})}},8235:function(g,m){Object.defineProperty(m,"__esModule",{value:!0}),m.isFullscreen=m.isMobile=m.isBigScreen=void 0,m.isBigScreen=function(){return window.screen.width>=1024&&window.screen.height>=768},m.isMobile=function(){return/mobile|tablet|android/i.test(navigator.userAgent.toLowerCase())},m.isFullscreen=function(){return(0,m.isMobile)()&&!(0,m.isBigScreen)()}},8625:function(g,m){Object.defineProperty(m,"__esModule",{value:!0})},8885:function(g,m){Object.defineProperty(m,"__esModule",{value:!0})},9188:function(g,m){Object.defineProperty(m,"__esModule",{value:!0}),m.hasDom=void 0,m.hasDom=function(){return typeof document<"u"&&typeof window<"u"}},9310:function(g,m,y){Object.defineProperty(m,"__esModule",{value:!0}),m.createIframe=void 0;var b=y(7177),_=y(6517),w=y(9590),S=y(476),E=y(6112),k=y(883),j=y(1947);m.createIframe=function(N,O){var D=O.formId,F=O.domain,R=O.options,B=(0,w.generateEmbedId)(),M=R.iframeProps,V=M===void 0?{}:M,W=R.onReady,Q=R.onStarted,K=R.onQuestionChanged,te=R.onHeightChanged,I=R.onSubmit,H=R.onEndingButtonClick,G=R.onDuplicateDetected,re=R.shareGaInstance,U=(0,b.buildIframeSrc)({formId:D,domain:F,embedId:B,type:N,options:R}),A=document.createElement("iframe");return A.src=U,A.dataset.testid="iframe",A.style.border="0px",A.allow="microphone; camera",(0,_.addAttributesToElement)(A,V),A.addEventListener("load",E.triggerIframeRedraw,{once:!0}),window.addEventListener("message",(0,S.getFormReadyHandler)(B,W)),window.addEventListener("message",(0,S.getFormStartedHandler)(B,Q)),window.addEventListener("message",(0,S.getFormQuestionChangedH
197andler)(B,K)),window.addEventListener("message",(0,S.getFormHeightChangedHandler)(B,te)),window.addEventListener("message",(0,S.getFormSubmitHandler)(B,I)),window.addEventListener("message",(0,S.getFormThemeHandler)(B,function($){var P;if($!=null&&$.theme){var q=document.querySelector(".tf-v1-close-icon");q&&(q.style.color=(P=$.theme)===null||P===void 0?void 0:P.color)}})),window.addEventListener("message",(0,S.getThankYouScreenButtonClickHandler)(B,H)),window.addEventListener("message",(0,S.getRedirectHandler)(B,A)),window.addEventListener("message",(0,S.getDuplicateDetectedHandler)(B,G)),N!=="widget"&&window.addEventListener("message",k.dispatchCustomKeyEventFromIframe),re&&window.addEventListener("message",(0,S.getFormReadyHandler)(B,function(){(0,_.setupGaInstance)(A,B,re)})),{iframe:A,embedId:B,refresh:function(){return(0,j.refreshIframe)(A)},focus:function(){var $;($=A.contentWindow)===null||$===void 0||$.postMessage("embed-focus","*")}}}},9556:function(g,m){Object.defineProperty(m,"__esModule",{value:!0}),m.unmountElement=void 0,m.unmountElement=function(y){var b;(b=y.parentNode)===null||b===void 0||b.removeChild(y)}},9586:function(g,m,y){var b=this&&this.__createBinding||(Object.create?function(w,S,E,k){k===void 0&&(k=E);var j=Object.getOwnPropertyDescriptor(S,E);j&&!("get"in j?!S.__esModule:j.writable||j.configurable)||(j={enumerable:!0,get:function(){return S[E]}}),Object.defineProperty(w,k,j)}:function(w,S,E,k){k===void 0&&(k=E),w[k]=S[E]}),_=this&&this.__exportStar||function(w,S){for(var E in w)E==="default"||Object.prototype.hasOwnProperty.call(S,E)||b(S,w,E)};Object.defineProperty(m,"__esModule",{value:!0}),_(y(3631),m)},9590:function(g,m){var y=this&&this.__read||function(b,_){var w=typeof Symbol=="function"&&b[Symbol.iterator];if(!w)return b;var S,E,k=w.call(b),j=[];try{for(;(_===void 0||_-- >0)&&!(S=k.next()).done;)j.push(S.value)}catch(N){E={error:N}}finally{try{S&&!S.done&&(w=k.return)&&w.call(k)}finally{if(E)throw E.error}}return j};Object.defineProperty(m,"__esModule",{value:!0}),m.generateEmbedId=void 0,m.generateEmbedId=function(){var b=Math.random();return y(String(b).split("."),2)[1]}},9723:function(g,m,y){Object.defineProperty(m,"__esModule",{value:!0}),m.addAttributesToElement=void 0;var b=y(7917);m.addAttributesToElement=function(_,w){w===void 0&&(w={}
197),Object.keys(w).forEach(function(S){_.setAttribute((0,b.camelCaseToKebabCase)(S),w[S])})}},9814:function(g,m,y){var b=this&&this.__createBinding||(Object.create?function(w,S,E,k){k===void 0&&(k=E);var j=Object.getOwnPropertyDescriptor(S,E);j&&!("get"in j?!S.__esModule:j.writable||j.configurable)||(j={enumerable:!0,get:function(){return S[E]}}),Object.defineProperty(w,k,j)}:function(w,S,E,k){k===void 0&&(k=E),w[k]=S[E]}),_=this&&this.__exportStar||function(w,S){for(var E in w)E==="default"||Object.prototype.hasOwnProperty.call(S,E)||b(S,w,E)};Object.defineProperty(m,"__esModule",{value:!0}),_(y(7121),m),_(y(19),m)}},p={};return(function g(m){var y=p[m];if(y!==void 0)return y.exports;var b=p[m]={exports:{}};return h[m].call(b.exports,b,b.exports,g),b.exports})(7783)})()}},s={};function o(d){var h=s[d];if(h!==void 0)return h.exports;var p=s[d]={exports:{}};return r[d].call(p.exports,p,p.exports,o),p.exports}o.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}})(),o.o=function(d,h){return Object.prototype.hasOwnProperty.call(d,h)},o.r=function(d){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(d,"__esModule",{value:!0})};var l={};return(function(){var d=l;Object.defineProperty(d,"__esModule",{value:!0}),d.Sidetab=d.Popover=d.SliderButton=d.PopupButton=d.Widget=void 0;var h=o(952),p=o(240),g=o(517);d.Widget=(0,g.memoComponent)(p.Widget),d.PopupButton=(0,g.memoComponent)((0,p.makeButtonComponent)(h.createPopup,"popup")),d.SliderButton=(0,g.memoComponent)((0,p.makeButtonComponent)(h.createSlider,"slider")),d.Popover=(0,g.memoComponent)((0,p.makeInitializerComponent)(h.createPopover,"popover")),d.Sidetab=(0,g.memoComponent)((0,p.makeInitializerComponent)(h.createSidetab,"sidetab"))})(),l})()})})(Tp)),Tp.exports}var ZT=xq();const $o="https://chromewebstore.google.com/detail/signalfit/kghekfipehnmanooohckggadehbinkph",QT="bTwTBrjJ",e2="sidebar_collapsed";function _q(){return u.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u.jsx("path",{d:"M6 5v11"}),u.jsx("path",{d:"M12 5v6"}),u.jsx("path",{d:"M18 5v14"})]})}function wq(){return u.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[u.jsx("circle",{cx:"12",cy:"8",r:"4"}),u.jsx("path",{d:"M4 20c0-4 3.6-7 8-7s8 3 8 7"})]})}function Sq(){return u.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[u.jsx("circle",{cx:"12",cy:"12",r:"9"}),u.jsx("circle",{cx:"12",cy:"12",r:"5"}),u.jsx("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor"})]})}function Eq(){return u.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[u.jsx("circle",{cx:"12",cy:"12",r:"9"}),u.jsx("path",{d:"m16.24 7.76-2.12 6.36-6.36 2.12 2.12-6.36 6.36-2.12z"})]})}function kq(){return u.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u.jsx("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),u.jsx("circle",{cx:"9",cy:"7",r:"4"}),u.jsx("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),u.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]})}const jq="[email protected]";function t2(){return u.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u.jsx("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"}),u.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function Tq(){return u.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:u.jsx("polyline",{points:"15 18 9 12 15 6"})})}function Nq(){return u.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:u.jsx("polyline",{points:"9 18 15 12 9 6"})})}const Aq=[{to:"/tracker",label:"Job Tracker",Icon:_q}];function Cq(){return u.jsxs("svg",{width:"20",height:"14",viewBox:"0 0 20 14",fill:"none","aria-hidden":"true",children:[u.jsx("rect",{x:"0",y:"8",width:"5",height:"6",rx:"1",fill:"#1D9E75"}),u.jsx("rect",{x:"7.5",y:"3",width:"5",height:"11",rx:"1",fill:"#1D9E75"}),u.jsx("rect",{x:"15",y:"0",width:"5",height:"14",rx:"1",fill:"#1D9E75"})]})}function Rq({url:t,initial:e}){return t?u.jsx("img",{src:t,alt:"",referrerPolicy:"no-referrer",className:"w-8 h-8 rounded-full object-cover shrink-0 bg-gray-100 dark:bg-[#162440]"}):u.jsx("div",{className:"w-8 h-8 rounded-full shrink-0 flex items-center justify-center text-xs font-semibold text-white bg-[#1D9E75]",children:e})}function Oq({collapsed:t}){const{theme:e,toggleTheme:n}=yq(),r=e==="dark";return u.jsxs("button",{type:"button",onClick:n,title:r?"Switch to light mode":"Switch to dark mode","aria-label":r?"Switch to light mode":"Switch to dark mode",className:`flex items-center rounded-lg transition-colors text-gray-500 hover:text-gray-900 hover:bg-gray-100 dark:text-[#8899AA] dark:hover:text-[#F0F4F8] dar
197k:hover:bg-[#162440] ${t?"justify-center w-9 h-9 mx-auto":"gap-2 w-full px-3 py-2 text-xs font-medium"}`,children:[r?u.jsx(IF,{size:16,"aria-hidden":!0}):u.jsx(OF,{size:16,"aria-hidden":!0}),!t&&u.jsx("span",{children:r?"Light mode":"Dark mode"})]})}function Dq(){const{user:t,signOut:e}=hn(),{subscription:n}=zo(),{isComplete:r,loading:s,profilePicUrl:o}=LF(),{onboardingComplete:l,loading:d}=PF(),{trackings:h,loading:p}=Ka(),g=Lr(),m=Mr(),y=In(),[b,_]=T.useState(!1),[w,S]=T.useState({count:0,pulse:!1});T.useEffect(()=>{if(!t){S({count:0,pulse:!1});return}try{const G=localStorage.getItem(`discover_count_${t.id}`),re=G?parseInt(G,10):0,U=Number.isFinite(re)&&re>0?re:0,A=localStorage.getItem(`discover_last_seen_count_${t.id}`),$=A?parseInt(A,10):0,P=Number.isFinite($)?$:0;m.pathname==="/discover"?(localStorage.setItem(`discover_last_seen_count_${t.id}`,String(U)),S({count:U,pulse:!1})):S({count:U,pulse:U>P})}catch{S({count:0,pulse:!1})}},[t,m.pathname]);const E=T.useRef(null),[k,j]=T.useState(()=>typeof window>"u"?!1:localStorage.getItem(e2)==="1"),N=Ym();T.useEffect(()=>{localStorage.setItem(e2,k?"1":"0")},[k]),T.useEffect(()=>{if(!b)return;const G=re=>{E.current&&!E.current.contains(re.target)&&_(!1)};return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[b]);const O=(t==null?void 0:t.user_metadata)??{},D=o??O.avatar_url??null,F=O.full_name??null,R=(t==null?void 0:t.email)??"",B=F??(R?R.split("@")[0]:"Account"),M=(F??R??"?").trim().charAt(0).toUpperCase()||"?",V=()=>{y.capture("user_logged_out"),y.reset(),e()},W=!s&&r,Q=N,K=!p&&h.length>0,te=[{key:"extension",label:"Install extension",done:Q,href:$o},{key:"profile",label:"Set up profile",done:!!W,onClick:()=>g("/profile")},{key:"first-job",label:"Analyze a job",done:K,onClick:()=>g("/tracker")}],I=W===!0&&Q&&K,H=!k&&!s&&!p&&!I;return u.jsxs("aside",{className:`relative shrink-0 flex flex-col transition-all duration-200 bg-gray-50 border-r border-gray-200 dark:bg-[#0A1628] dark:border-white/10 ${k?"w-[64px]":"w-[220px]"}`,children:[u.jsx("style",{children:`
198        @keyframes discover-badge-pulse {
199          0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(29, 158, 117, 0.45); }
200          50% { transform: scale(1.12); box-shadow: 0 0 0 5px rgba(29, 158, 117, 0); }
201        }
202        /* 3 gentle pulses on mount, then static — never loops. */
203        .discover-badge-pulse {
204          animation: discover-badge-pulse 1.1s ease-in-out 3;
205        }
206        @media (prefers-reduced-motion: reduce) {
207          .discover-badge-pulse { animation: none; }
208        }
209      `}),u.jsx("button",{type:"button",onClick:()=>j(G=>!G),"aria-label":k?"Expand sidebar":"Collapse sidebar",className:"absolute top-5 -right-3 z-20 w-6 h-6 rounded-full flex items-center justify-center transition-colors bg-white border border-gray-200 text-gray-500 hover:text-gray-900 dark:bg-[#0D1F35] dark:border-white/10 dark:text-[#8899AA] dark:hover:text-[#F0F4F8]",children:k?u.jsx(Nq,{}):u.jsx(Tq,{})}),u.jsx("div",{className:`py-5 border-b border-gray-200 dark:border-white/10 ${k?"px-3":"px-5"}`,children:u.jsxs("div",{className:`flex items-center gap-2.5 ${k?"justify-center":""}`,children:[u.jsx(Cq,{}),!k&&u.jsxs("span",{className:"text-[18px] font-semibold tracking-tight",children:[u.jsx("span",{className:"text-gray-900 dark:text-[#F0F4F8]",children:"Signal"}),u.jsx("span",{className:"text-[#1D9E75]",children:"Fit"})]})]})}),u.jsxs("nav",{"aria-label":"Primary",className:"flex-1 py-4",children:[Aq.map(({to:G,label:re,Icon:U})=>u.jsxs(Ri,{to:G,title:k?re:void 0,className:({isActive:A})=>`flex items-center py-2.5 text-base font-medium transition-all ${k?"justify-center px-0 gap-0":"pl-[18px] pr-4 gap-3.5"} ${A?"text-gray-900 dark:text-[#F0F4F8]":"text-gray-500 hover:text-gray-900 hover:bg-gray-100 dark:text-[#8899AA] dark:hover:text-[#F0F4F8] dark:hover:bg-[#162440]"}`,style:({isActive:A})=>({borderLeft:A?"4px solid #1D9E75":"4px solid transparent"}),children:[u.jsx(U,{}),!k&&re]},G)),u.jsxs(Ri,{to:"/profile",title:k?"Profile":void 0,className:({isActive:G})=>`flex items-center py-2.5 text-base font-medium transition-all ${k?"justify-center px-0 gap-0":"pl-[18px] pr-4 gap-3.5"} ${G?"text-gray-900 dark:text-[#F0F4F8]":"text-gray-500 hover:text-gray-900 hover:bg-gray-100 dark:text-[#8899AA] dark:hover:text-[#F0F4F8] dar
209k:hover:bg-[#162440]"}`,style:({isActive:G})=>({borderLeft:G?"4px solid #1D9E75":"4px solid transparent"}),children:[u.jsx(wq,{}),!k&&u.jsxs(u.Fragment,{children:["Profile",!s&&!r&&u.jsx("span",{"aria-label":"Profile incomplete",style:{width:6,height:6,borderRadius:"50%",background:"#F59E0B",marginLeft:"auto"}})]})]}),u.jsxs(Ri,{to:"/goals",title:k?"Goals":void 0,className:({isActive:G})=>`flex items-center py-2.5 text-base font-medium transition-all ${k?"justify-center px-0 gap-0":"pl-[18px] pr-4 gap-3.5"} ${G?"text-gray-900 dark:text-[#F0F4F8]":"text-gray-500 hover:text-gray-900 hover:bg-gray-100 dark:text-[#8899AA] dark:hover:text-[#F0F4F8] dark:hover:bg-[#162440]"}`,style:({isActive:G})=>({borderLeft:G?"4px solid #1D9E75":"4px solid transparent"}),children:[u.jsx(Sq,{}),!k&&u.jsxs(u.Fragment,{children:["Goals",!d&&!l&&u.jsx("span",{"aria-label":"Goals not configured",style:{width:6,height:6,borderRadius:"50%",background:"#F59E0B",marginLeft:"auto"}})]})]}),u.jsxs(Ri,{to:"/discover",title:k?"Discover":void 0,className:({isActive:G})=>`relative flex items-center py-2.5 text-base font-medium transition-all ${k?"justify-center px-0 gap-0":"pl-[18px] pr-4 gap-3.5"} ${G?"text-gray-900 dark:text-[#F0F4F8]":"text-gray-500 hover:text-gray-900 hover:bg-gray-100 dark:text-[#8899AA] dark:hover:text-[#F0F4F8] dark:hover:bg-[#162440]"}`,style:({isActive:G})=>({borderLeft:G?"4px solid #1D9E75":"4px solid transparent"}),children:[u.jsx(Eq,{}),!k&&u.jsxs(u.Fragment,{children:["Discover",w.count>0&&u.jsx("span",{"aria-label":`${w.count} matches`,className:`ml-auto text-[10px] font-semibold leading-none rounded-full px-1.5 py-1 min-w-[20px] text-center text-white bg-[#1D9E75] ${w.pulse?"discover-badge-pulse":""}`,children:w.count})]}),k&&w.count>0&&u.jsx("span",{"aria-hidden":"true",className:`absolute top-1.5 right-3 w-2 h-2 rounded-full bg-[#1D9E75] ${w.pulse?"discover-badge-pulse":""}`})]}),(t==null?void 0:t.email)===jq&&u.jsxs(Ri,{to:"/coach",title:k?"Coach":void 0,className:({isActive:G})=>`flex items-center py-2.5 text-base font-medium transition-all ${k?"justify-center px-0 gap-0":"pl-[18px] pr-4 gap-3.5"} ${G?"text-gray-900 dark:text-[#F0F4F8]":"text-gray-500 hover:text-gray-900 hover:bg-gray-100 dark:text-[#8899AA] dark:hover:text-[#F0F4F8] dark:hover:bg-[#162440]"}`,style:({isActive:G})=>({borderLeft:G?"4px solid #1D9E75":"4px solid transparent"}),children:[u.jsx(kq,{}),!k&&"Coach"]})]}),!k&&u.jsx(ZT.PopupButton,{id:QT,size:70,autoClose:!0,className:"flex w-full items-center gap-2 px-4 py-2 text-xs text-left transition-colors text-gray-400 hover:text-gray-600 dark:text-white/30 dark:hover:text-white/60",children:"💬 Give feedback"}),!k&&!n.is_pro&&u.jsxs(Ri,{to:"/pricing",className:"mx-3 mb-2 flex items-center justify-between px-3 py-2 rounded-lg transition-all border border-[#1D9E75]/30 bg-[#1D9E75]/5 hover:bg-[#1D9E75]/10 dark:border-[#1D9E75]/20 dark:bg-[#1D9E75]/[0.05] dark:hover:bg-white/5",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-xs font-medium text-[#1D9E75]",children:"Upgrade to Pro"}),u.jsx("p",{className:"text-[10px] text-gray-500 dark:text-white/30",children:"Unlimited tracking · Full Discover"})]}),u.jsx("span",{className:"text-[#1D9E75] text-xs",children:"→"})]}),H&&u.jsx("div",{className:"rounded-xl p-2 mx-2 mb-3 bg-gray-100 dark:bg-white/5",children:u.jsx("ul",{className:"space-y-0",children:te.map(G=>{const re=G.key==="extension"&&!G.done,U=re?"flex items-center gap-2 text-[11px] py-1 px-1.5 w-full text-left rounded-md font-semibold transition-colors text-[#1D9E75] bg-[#1D9E75]/10 hover:bg-[#1D9E75]/[0.18] ring-1 ring-inset ring-[#1D9E75]/30":`flex items-center gap-2 text-[11px] py-0.5 w-full text-left transition-colors ${G.done?"text-gray-400 dark:text-white/30 curs
209or-default line-through":"text-gray-600 hover:text-gray-900 dark:text-white/70 dark:hover:text-white"}`,A=u.jsxs(u.Fragment,{children:[u.jsx("span",{className:`w-3 h-3 inline-flex items-center justify-center shrink-0 ${G.done||re?"text-[#1D9E75]":"text-gray-300 dark:text-white/25"}`,children:G.done?u.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:u.jsx("path",{d:"M20 6 9 17l-5-5"})}):u.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:u.jsx("circle",{cx:"12",cy:"12",r:"9"})})}),u.jsx("span",{className:"flex-1",children:G.label}),re&&u.jsx("span",{"aria-hidden":"true",children:"→"})]});return u.jsx("li",{children:G.href&&!G.done?u.jsx("a",{href:G.href,target:"_blank",rel:"noopener noreferrer",onClick:()=>y.capture("extension_install_cta_clicked",{source:"sidebar_checklist"}),className:U,children:A}):u.jsx("button",{type:"button",disabled:G.done,onClick:G.onClick,className:U,children:A})},G.key)})})}),u.jsxs("div",{className:`p-3 space-y-2.5 border-t border-gray-200 dark:border-white/10 ${k?"px-2":""}`,children:[u.jsx(Oq,{collapsed:k}),!k&&I&&!N&&u.jsxs("a",{href:$o,target:"_blank",rel:"noopener noreferrer",onClick:()=>y.capture("extension_install_cta_clicked",{source:"sidebar_footer"}),className:"flex items-center gap-2.5 px-3 py-2.5 rounded-xl transition-all border border-[#1D9E75]/30 bg-[#1D9E75]/[0.06] hover:bg-[#1D9E75]/10 dark:border-[#1D9E75]/25 dark:hover:bg-white/5",children:[u.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center shrink-0 bg-[#1D9E75]/15",children:u.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"#1D9E75","aria-hidden":"true",children:u.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"})})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("p",{className:"text-xs font-medium text-gray-700 dark:text-white/70 leading-tight",children:"Get the extension"}),u.jsx("p",{className:"text-[10px] text-gray-500 dark:text-white/30 leading-tight mt-0.5",children:"Analyze jobs as you browse"})]}),u.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",className:"text-gray-400 dark:text-white/30",children:[u.jsx("path",{d:"M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"}),u.jsx("polyline",{points:"15,3 21,3 21,9"}),u.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})]}),u.jsxs("div",{ref:E,className:"relative",children:[b&&u.jsxs("div",{className:"absolute bottom-full left-0 mb-2 min-w-[200px] rounded-xl overflow-hidden shadow-xl z-30 bg-white border border-gray-200 dark:bg-[#0D1F35] dark:border-white/10",children:[u.jsx(Ri,{to:n.is_pro?"/billing":"/pricing",onClick:()=>_(!1),className:"block px-3 py-2 text-xs text-gray-900 hover:bg-gray-100 dark:text-[#F0F4F8] dark:hover:bg-[#162440] transition-colors",children:"Billing"}),u.jsx(ZT.PopupButton,{id:QT,size:70,autoClose:!0,onClose:()=>_(!1),className:"flex w-full items-center gap-2 text-sm px-3 py-2 text-left transition-colors text-gray-500 hover:text-gray-900 dark:text-white/50 dark:hover:text-white",children:"💬 Give feedback"}),u.jsx(Ri,{to:"/support",onClick:()=>_(!1),className:"block px-3 py-2 text-xs text-gray-900 hover:bg-gray-100 dark:text-[#F0F4F8] dark:hover:bg-[#162440] transition-colors",children:"Support"}),u.jsx("button",{type:"button",onClick:()=>{_(!1),V()},className:"block w-full text-left px-3 py-2 text-xs text-gray-900 hover:bg-gray-100 dark:text-[#F0F4F8] dark:hover:bg-[#162440] transition-colors",children:"Sign out"}),u.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-t border-gray-200 dark:border-white/[0.06]",children:[u.jsx(Ri,{to:"/privacy",onClick:()=>_(!1),className:"text-[10px] transition-colors text-gray-500 hover:text-gray-900 dark:text-[#8899AA] dark:hover:text-[#F0F4F8]",children:"Privacy"}),u.jsx("span",{className:"text-[10px] text-gray-400 dark:text-[#8899AA]/40",children:"·"}),u.jsx(Ri,{to:"/terms",onClick:()=>_(!1),className:"text-[10px] transition-colors text-gray-500 hover:text-gray-900 dark:text-[#8899AA] dark:hover:text-[#F0F4F8]",children:"Terms"})]})]}),u.jsxs("button",{type:"button",onClick:()=>_(G=>!G),title:k?B:void 0,className:`group relative w-full flex items-center p-2 rounded-lg transition-colors hover:bg-gray-100 dark:hover:bg-[#162440] ${k?"justify-center gap-0":"gap-2.5"}`,"aria-label":"Account menu","aria-expanded":b,children:[u.jsx(Rq,{url:D,initial:M}),!k&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"min-w-0 flex-1 text-left text-xs font-medium text-gray-900 dark:text-[#F0F4F8] truncate",children:B}),u.jsx("span",{className:`shrink-0 transition-colors ${b?"text-gray-900 dark:text-[#F0F4F8]":"text-gray-500 dark:text-[#8899AA]"}`,children:u.jsx(t2,{})})]}),k&&u.jsx("span",{className:"absolute -top-1 -right-1 w-4 h-4 rounded-full flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity bg-white border border-gray-200 text-gray-900 dark:bg-[#162440] dark:border-white/15 dark:text-[#F0F4F8]",children:u.jsx(t2,{})})]})]})]})]})}function Iq(){const{user:t}=hn(),[e,n]=T.useState(null);return T.useEffect(()=>{if(!t){n(null);return}let s=!1;return Ye.from("profiles").select("raw_profile, onboarding_completed_at").eq("id",t.id).maybeSingle().then(({data:o,error:l})=>
209{if(!s){if(l){console.error("useOnboarding: profile lookup failed",l.message),n(!1);return}n(!(o!=null&&o.raw_profile)&&!(o!=null&&o.onboarding_completed_at))}}),()=>{s=!0}},[t]),{needsOnboarding:e,completeOnboarding:()=>n(!1)}}var g_={};(function t(e,n,r,s){var o=!!(e.Worker&&e.Blob&&e.Promise&&e.OffscreenCanvas&&e.OffscreenCanvasRenderingContext2D&&e.HTMLCanvasElement&&e.HTMLCanvasElement.prototype.transferControlToOffscreen&&e.URL&&e.URL.createObjectURL),l=typeof Path2D=="function"&&typeof DOMMatrix=="function",d=(function(){if(!e.OffscreenCanvas)return!1;try{var U=new OffscreenCanvas(1,1),A=U.getContext("2d");A.fillRect(0,0,1,1);var $=U.transferToImageBitmap();A.createPattern($,"no-repeat")}catch{return!1}return!0})();function h(){}function p(U){var A=n.exports.Promise,$=A!==void 0?A:e.Promise;return typeof $=="function"?new $(U):(U(h,h),null)}var g=(function(U,A){return{transform:function($){if(U)return $;if(A.has($))return A.get($);var P=new OffscreenCanvas($.width,$.height),q=P.getContext("2d");return q.drawImage($,0,0),A.set($,P),P},clear:function(){A.clear()}}})(d,new Map),m=(function(){var U=Math.floor(16.666666666666668),A,$,P={},q=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(A=function(z){var X=Math.random();return P[X]=requestAnimationFrame(function se(ne){q===ne||q+U-1<ne?(q=ne,delete P[X],z()):P[X]=requestAnimationFrame(se)}),X},$=function(z){P[z]&&cancelAnimationFrame(P[z])}):(A=function(z){return setTimeout(z,U)},$=function(z){return clearTimeout(z)}),{frame:A,cancel:$}})(),y=(function(){var U,A,$={};function P(q){function z(X,se){q.postMessage({options:X||{},callback:se})}q.init=function(se){var ne=se.transferControlToOffscreen();q.postMessage({canvas:ne},[ne])},q.fire=function(se,ne,ie){if(A)return z(se,null),A;var fe=Math.random().toString(36).slice(2);return A=p(function(_e){function Te(Oe){Oe.data.callback===fe&&(delete $[fe],q.removeEventListener("message",Te),A=null,g.clear(),ie(),_e())}q.addEventListener("message",Te),z(se,fe),$[fe]=Te.bind(null,{data:{callback:fe}})}),A},q.reset=function(){q.postMessage({reset:!0});for(var se in $)$[se](),delete $[se]}}return function(){if(U)return U;if(!r&&o){var q=["var CONFETTI, SIZE = {}, module = {};","("+t.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {","  if (msg.data.options) {","    CONFETTI(msg.data.options).then(function () {","      if (msg.data.callback) {","        postMessage({ callback: msg.data.callback });","      }","    });","  } else if (msg.data.reset) {","    CONFETTI && CONFETTI.reset();","  } else if (msg.data.resize) {","    SIZE.width = msg.data.resize.width;","    SIZE.height = msg.data.resize.height;","  } else if (msg.data.canvas) {","    SIZE.width = msg.data.canvas.width;","    SIZE.height = msg.data.canvas.height;","    CONFETTI = module.exports.create(msg.data.canvas);","  }","}"].join(`
210`);try{U=new Worker(URL.createObjectURL(new Blob([q])))}catch(z){return typeof console<"u"&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",z),null}P(U)}return U}})(),b={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function _(U,A){return A?A(U):U}function w(U){return U!=null}function S(U,A,$){return _(U&&w(U[A])?U[A]:b[A],$)}function E(U){return U<0?0:Math.floor(U)}function k(U,A){return Math.floor(Math.random()*(A-U))+U}function j(U){return parseInt(U,16)}function N(U){return U.map(O)}function O(U){var A=String(U).replace(/[^0-9a-f]/gi,"");return A.length<6&&(A=A[0]+A[0]+A[1]+A[1]+A[2]+A[2]),{r:j(A.substring(0,2)),g:j(A.substring(2,4)),b:j(A.substring(4,6))}}function D(U){var A=S(U,"origin",Object);return A.x=S(A,"x",Number),A.y=S(A,"y",Number),A}function F(U){U.width=document.documentElement.clientWidth,U.height=document.documentElement.clientHeight}function R(U){var A=U.getBoundingClientRect();U.width=A.width,U.height=A.height}function B(U){var A=document.createElement("canvas");
vendor: 5,437 bytes, line 210
210return A.style.position="fixed",A.style.top="0px",A.style.left="0px",A.style.pointerEvents="none",A.style.zIndex=U,A}function M(U,A,$,P,q,z,X,se,ne){U.save(),U.translate(A,$),U.rotate(z),U.scale(P,q),U.arc(0,0,1,X,se,ne),U.restore()}function V(U){var A=U.angle*(Math.PI/180),$=U.spread*(Math.PI/180);return{x:U.x,y:U.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:U.startVelocity*.5+Math.random()*U.startVelocity,angle2D:-A+(.5*$-Math.random()*$),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:U.color,shape:U.shape,tick:0,totalTicks:U.ticks,decay:U.decay,drift:U.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:U.gravity*3,ovalScalar:.6,scalar:U.scalar,flat:U.flat}}function W(U,A){A.x+=Math.cos(A.angle2D)*A.velocity+A.drift,A.y+=Math.sin(A.angle2D)*A.velocity+A.gravity,A.velocity*=A.decay,A.flat?(A.wobble=0,A.wobbleX=A.x+10*A.scalar,A.wobbleY=A.y+10*A.scalar,A.tiltSin=0,A.tiltCos=0,A.random=1):(A.wobble+=A.wobbleSpeed,A.wobbleX=A.x+10*A.scalar*Math.cos(A.wobble),A.wobbleY=A.y+10*A.scalar*Math.sin(A.wobble),A.tiltAngle+=.1,A.tiltSin=Math.sin(A.tiltAngle),A.tiltCos=Math.cos(A.tiltAngle),A.random=Math.random()+2);var $=A.tick++/A.totalTicks,P=A.x+A.random*A.tiltCos,q=A.y+A.random*A.tiltSin,z=A.wobbleX+A.random*A.tiltCos,X=A.wobbleY+A.random*A.tiltSin;if(U.fillStyle="rgba("+A.color.r+", "+A.color.g+", "+A.color.b+", "+(1-$)+")",U.beginPath(),l&&A.shape.type==="path"&&typeof A.shape.path=="string"&&Array.isArray(A.shape.matrix))U.fill(H(A.shape.path,A.shape.matrix,A.x,A.y,Math.abs(z-P)*.1,Math.abs(X-q)*.1,Math.PI/10*A.wobble));else if(A.shape.type==="bitmap"){var se=Math.PI/10*A.wobble,ne=Math.abs(z-P)*.1,ie=Math.abs(X-q)*.1,fe=A.shape.bitmap.width*A.scalar,_e=A.shape.bitmap.height*A.scalar,Te=new DOMMatrix([Math.cos(se)*ne,Math.sin(se)*ne,-Math.sin(se)*ie,Math.cos(se)*ie,A.x,A.y]);Te.multiplySelf(new DOMMatrix(A.shape.matrix));var Oe=U.createPattern(g.transform(A.shape.bitmap),"no-repeat");Oe.setTransform(Te),U.globalAlpha=1-$,U.fillStyle=Oe,U.fillRect(A.x-fe/2,A.y-_e/2,fe,_e),U.globalAlpha=1}else if(A.shape==="circle")U.ellipse?U.ellipse(A.x,A.y,Math.abs(z-P)*A.ovalScalar,Math.abs(X-q)*A.ovalScalar,Math.PI/10*A.wobble,0,2*Math.PI):M(U,A.x,A.y,Math.abs(z-P)*A.ovalScalar,Math.abs(X-q)*A.ovalScalar,Math.PI/10*A.wobble,0,2*Math.PI);else if(A.shape==="star")for(var xe=Math.PI/2*3,Ge=4*A.scalar,Le=8*A.scalar,mt=A.x,Et=A.y,Jt=5,wt=Math.PI/Jt;Jt--;)mt=A.x+Math.cos(xe)*Le,Et=A.y+Math.sin(xe)*Le,U.lineTo(mt,Et),xe+=wt,mt=A.x+Math.cos(xe)*Ge,Et=A.y+Math.sin(xe)*Ge,U.lineTo(mt,Et),xe+=wt;else U.moveTo(Math.floor(A.x),Math.floor(A.y)),U.lineTo(Math.floor(A.wobbleX),Math.floor(q)),U.lineTo(Math.floor(z),Math.floor(X)),U.lineTo(Math.floor(P),Math.floor(A.wobbleY));return U.closePath(),U.fill(),A.tick<A.totalTicks}function Q(U,A,$,P,q){var z=A.slice(),X=U.getContext("2d"),se,ne,ie=p(function(fe){function _e(){se=ne=null,X.clearRect(0,0,P.width,P.height),g.clear(),q(),fe()}function Te(){r&&!(P.width===s.width&&P.height===s.height)&&(P.width=U.width=s.width,P.height=U.height=s.height),!P.width&&!P.height&&($(U),P.width=U.width,P.height=U.height),X.clearRect(0,0,P.width,P.height),z=z.filter(function(Oe){return W(X,Oe)}),z.length?se=m.frame(Te):_e()}se=m.frame(Te),ne=_e});return{addFettis:function(fe){return z=z.concat(fe),ie},canvas:U,promise:ie,reset:function(){se&&m.cancel(se),ne&&ne()}}}function K(U,A){var $=!U,P=!!S(A||{},"resize"),q=!1,z=S(A,"disableForReducedMotion",Boolean),X=o&&!!S(A||{},"useWorker"),se=X?y():null,ne=$?F:R,ie=U&&se?!!U.__confetti_initialized:!1,fe=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,_e;function Te(xe,Ge,Le){for(var mt=S(xe,"particleCount",E),Et=S(xe,"angle",Number),Jt=S(xe,"spread",Number),wt=S(xe,"startVelocity",Number),Xt=S(xe,"decay",Number),ur=S(xe,"gravity",Number),jn=S(xe,"drift",Number),Zt=S(xe,"colors",N),nr=S(xe,"ticks",Number),dr=S(xe,"shapes"),rr=S(xe,"scalar"),Mn=!!S(xe,"flat"),on=D(xe),zt=mt,Ln=[],hr=U.width*on.x,fr=U.height*on.y;zt--;)Ln.push(V({x:hr,y:fr,angle:Et,spread:Jt,startVelocity:wt,color:Zt[zt%Zt.length],shape:dr[k(0,dr.length)],ticks:nr,decay:Xt,gravity:ur,drift:jn,scalar:rr,flat:Mn}));return _e?_e.addFettis(Ln):(_e=Q(U,Ln,ne,Ge,Le),_e.promise)}function Oe(xe){var Ge=z||S(xe,"disableForReducedMotion",Boolean),Le=S(xe,"zIndex",Number);if(Ge&&fe)return p(function(wt){wt()});$&&_e?U=_e.canvas:$&&!U&&(U=B(Le),document.body.appendChild(U)),P&&!ie&&ne(U);var mt={width:U.width,height:U.height};se&&!ie&&se.init(U),ie=!0,se&&(U.__confetti_initialized=!0);function Et(){if(se){var wt={getBoundingClientRect:function(){if(!$)return U.getBoundingClientRect()}};ne(wt),se.postMessage({resize:{width:wt.width,height:wt.height}});return}mt.width=mt.height=null}function Jt(){_e=null,P&&(q=!1,e.removeEventListener("resize",Et)),$&&U&&(document.body.contains(U)&&document.body.removeChild(U),U=null,ie=!1)}return P&&!q&&(q=!0,e.addEventListener("resize",Et,!1)),se?se.fire(xe,mt,Jt):Te(xe,mt,Jt)}return Oe.reset=function(){se&&se.reset(),_e&&_e.reset()},Oe}var te;function I(){return te||(te=K(null,{useWorker:!0,resize:!0})),te}function H(U,A,$,P,q,z,X){var se=new Path2D(U),ne=new Path2D;ne.addPath(se,new DOMMatrix(A));var ie=new Path2D;return ie.addPath(ne,new DOMMatrix([Math.cos(X)*q,Math.sin(X)*q,-Math.sin(X)*z,Math.cos(X)*z,$,P])),ie}function G(U){if(!l)throw new Error("path confetti are not supported in this browser");var A,$;
210typeof U=="string"?A=U:(A=U.path,$=U.matrix);var P=new Path2D(A),q=document.createElement("canvas"),z=q.getContext("2d");if(!$){for(var X=1e3,se=X,ne=X,ie=0,fe=0,_e,Te,Oe=0;Oe<X;Oe+=2)for(var xe=0;xe<X;xe+=2)z.isPointInPath(P,Oe,xe,"nonzero")&&(se=Math.min(se,Oe),ne=Math.min(ne,xe),ie=Math.max(ie,Oe),fe=Math.max(fe,xe));_e=ie-se,Te=fe-ne;var Ge=10,Le=Math.min(Ge/_e,Ge/Te);$=[Le,0,0,Le,-Math.round(_e/2+se)*Le,-Math.round(Te/2+ne)*Le]}return{type:"path",path:A,matrix:$}}function re(U){var A,$=1,P="#000000",q='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof U=="string"?A=U:(A=U.text,$="scalar"in U?U.scalar:$,q="fontFamily"in U?U.fontFamily:q,P="color"in U?U.color:P);var z=10*$,X=""+z+"px "+q,se=new OffscreenCanvas(z,z),ne=se.getContext("2d");ne.font=X;var ie=ne.measureText(A),fe=Math.ceil(ie.actualBoundingBoxRight+ie.actualBoundingBoxLeft),_e=Math.ceil(ie.actualBoundingBoxAscent+ie.actualBoundingBoxDescent),Te=2,Oe=ie.actualBoundingBoxLeft+Te,xe=ie.actualBoundingBoxAscent+Te;fe+=Te+Te,_e+=Te+Te,se=new OffscreenCanvas(fe,_e),ne=se.getContext("2d"),ne.font=X,ne.fillStyle=P,ne.fillText(A,Oe,xe);var Ge=1/$;return{type:"bitmap",bitmap:se.transferToImageBitmap(),matrix:[Ge,0,0,Ge,-fe*Ge/2,-_e*Ge/2]}}n.exports=function(){return I().apply(this,arguments)},n.exports.reset=function(){I().reset()},n.exports.create=K,n.exports.shapeFromPath=G,n.exports.shapeFromText=re})((function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}})(),g_,!1);const $i=g_.exports;g_.exports.create;function kO({className:t=""}){return u.jsxs("div",{className:`inline-flex flex-wrap items-center gap-x-1.5 gap-y-0.5 px-2.5 py-1 rounded-full border text-[11px] leading-tight bg-[#1D9E75]/[0.08] border-[#1D9E75]/25 text-gray-700 dark:text-white/70 ${t}`,children:[u.jsx("span",{"aria-hidden":"true",className:"text-[#1D9E75] font-semibold",children:"i"}),u.jsxs("span",{children:["Generic score — "," ",u.jsx(Kt,{to:"/profile",className:"font-semibold text-[#1D9E75] hover:underline",children:"import your profile"})," ","to see your real fit"]})]})}const m0="sf_onboarding_step";function Mq(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=()=>
210e(r.result.split(",")[1]),r.onerror=n,r.readAsDataURL(t)})}function Lq(){$i({particleCount:200,spread:90,origin:{y:.6},colors:["#1D9E75","#ffffff","#0A1628","#34d399"]}),setTimeout(()=>{$i({particleCount:100,angle:60,spread:55,origin:{x:0},colors:["#1D9E75","#ffffff","#34d399"]})},200),setTimeout(()=>{$i({particleCount:100,angle:120,spread:55,origin:{x:1},colors:["#1D9E75","#ffffff","#34d399"]})},400)}function g0(){return u.jsxs("svg",{width:"24",height:"17",viewBox:"0 0 20 14",fill:"none","aria-hidden":"true",children:[u.jsx("rect",{x:"0",y:"8",width:"5",height:"6",rx:"1",fill:"#1D9E75"}),u.jsx("rect",{x:"7.5",y:"3",width:"5",height:"11",rx:"1",fill:"#1D9E75"}),u.jsx("rect",{x:"15",y:"0",width:"5",height:"14",rx:"1",fill:"#1D9E75"})]})}function n2(){return u.jsx("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"#0A66C2","aria-hidden":"true",children:u.jsx("path",{d:"M20.5 2h-17A1.5 1.5 0 002 3.5v17A1.5 1.5 0 003.5 22h17a1.5 1.5 0 001.5-1.5v-17A1.5 1.5 0 0020.5 2zM8 19H5v-9h3zM6.5 8.25A1.75 1.75 0 118.3 6.5a1.78 1.78 0 01-1.8 1.75zM19 19h-3v-4.74c0-1.42-.6-1.93-1.38-1.93A1.74 1.74 0 0013 14.19a.66.66 0 000 .14V19h-3v-9h2.9v1.3a3.11 3.11 0 012.7-1.4c1.55 0 3.36.86 3.36 3.66z"})})}function r2(){return u.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"#1D9E75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),u.jsx("polyline",{points:"14 2 14 8 20 8"}),u.jsx("line",{x1:"8",y1:"13",x2:"16",y2:"13"}),u.jsx("line",{x1:"8",y1:"17",x2:"14",y2:"17"})]})}function i2({className:t="w-5 h-5"}){return u.jsx("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:u.jsx("path",{d:"M20 6 9 17l-5-5"})})}const v0="w-full px-3.5 py-2.5 rounded-lg text-sm focus:outline-none transition-colors border bg-white border-gray-200 text-gray-900 placeholder:text-gray-400 dark:bg-[#162440] dark:border-white/[0.08] dark:text-[#F0F4F8] dark:placeholder:text-white/30";function Pq({step:t}){return u.jsx("div",{className:"flex items-center justify-center gap-2 mt-3",children:[1,2,3].map(e=>u.jsx("span",{className:`rounded-full transition-all ${e<=t?"bg-[#1D9E75]":"bg-gray-300 dark:bg-white/20"}`,style:{width:e===t?24:8,height:8}},e))})}function Fq({onComplete:t}){const{user:e}=hn(),{analyzeJob:n}=Ka(),r=In(),[s,o]=T.useState(()=>{const ie=localStorage.getItem(m0),fe=ie?parseInt(ie,10):1;return fe===2||fe===3?fe:1});T.useEffect(()=>{localStorage.setItem(m0,String(s))},[s]);const l=async()=>{if(!e)return;const{error:ie}=await Ye.from("profiles").upsert({id:e.id,onboarding_completed_at:new Date().toISOString()});ie&&console.error("OnboardingModal: failed to persist completion",ie.message)},d=()=>{localStorage.removeItem(m0),t()},h=Ym(),[p,g]=T.useState(null),[m,y]=T.useState(""),[b,_]=T.useState("text"),[w,S]=T.useState(""),[E,k]=T.useState(null),[j,N]=T.useState(!1),[O,D]=T.useState(!1),[F,R]=T.useState(""),[B,M]=T.useState(""),[V,W]=T.useState(!1),[Q,K]=T.useState(null),[te,I]=T.useState(""),[H,G]=T.useState(!1),re=ie=>{r.capture("onboarding_profile_completed"),localStorage.setItem("sf_onboarding_profile","1"),D(!0),setTimeout(()=>{D(!1),o(3)},1e3)},U=async ie=>{if(!e)return;const{error:fe}=await Ye.from("profiles").upsert({id:e.id,full_name:ie.full_name,current_title:ie.current_title,years_experience:ie.years_experience,profile_pic_url:ie.profile_pic_url??null,raw_profile:ie,updated_at:new Date().toISOString()});if(fe){R(fe.message);return}r.capture("profile_saved"),re()},A=async()=>{if(e){if(!m.trim()){R("Enter your LinkedIn profile URL first");return}R(""),r.capture("profile_import_started",{import_method:"linkedin",source:"onboarding"}),N(!0);try{const{data:ie,error:fe}=await Ye.functions.invoke("parse-profile",{body:{mode:"linkedin",linkedin_url:m.trim()}});if(fe){R(fe.message);return}if(ie!=null&&ie.error){R(ie.error);return}await U(ie)}catch(ie){R(ie instanceof Error?ie.message:"Extraction failed")}finally{N(!1)}}},$=async()=>
210{if(!e)return;R("");const ie={mode:b};if(b==="text"){if(!w.trim()){R("Paste your resume text first");return}ie.text=w}else{if(!E){R("Select a PDF file first");return}ie.pdf_base64=await Mq(E)}r.capture("profile_import_started",{import_method:b,source:"onboarding"}),N(!0);try{const{data:fe,error:_e}=await Ye.functions.invoke("parse-profile",{body:ie});if(_e){R(_e.message);return}if(fe!=null&&fe.error){R(fe.error);return}await U(fe)}catch(fe){R(fe instanceof Error?fe.message:"Extraction failed")}finally{N(!1)}},P=async()=>{const ie=B.trim();if(!ie)return;I(""),W(!0),K({}),r.capture("onboarding_first_job_submitted");const fe=await n(ie,(_e,Te)=>{K(Oe=>{const xe=Oe??{};return _e==="jobTitle"?{...xe,job_title:Te}:_e==="company"?{...xe,company_name:Te}:_e==="signalScore"?{...xe,signal_score:Te}:_e==="summary"?{...xe,summary:Te}:xe})},"url_paste");if(W(!1),G(fe.profileMissing===!0),fe.error){I(fe.error),K(null);return}localStorage.setItem("sf_onboarding_first_job","1"),r.capture("onboarding_first_job_completed"),q()},q=()=>{l(),Lq(),setTimeout(()=>{r.capture("onboarding_completed"),d()},1500)},z=ie=>{V||j||(r.capture("onboarding_dismissed",{step:s,reason:ie}),l(),d())},X=()=>{r.capture("onboarding_skipped_profile"),o(3)},se=()=>{r.capture("onboarding_skipped_first_job"),q()},ne=()=>{h&&localStorage.setItem("sf_onboarding_extension","1"),o(2)};return T.useEffect(()=>{const ie=fe=>{fe.key==="Escape"&&(V||j||z("escape_key"))};return window.addEventListener("keydown",ie),()=>window.removeEventListener("keydown",ie)}),u.jsx("div",{className:"fixed inset-0 z-[100] overflow-y-auto bg-white dark:bg-[#0A1628]",role:"dialog","aria-modal":"true","aria-label":"Welcome to SignalFit",children:u.jsxs("div",{className:"min-h-full flex flex-col px-6 pt-8 pb-12",children:[u.jsxs("header",{className:"relative text-center",children:[u.jsxs("div",{className:"inline-flex items-center gap-2.5",children:[u.jsx(g0,{}),u.jsxs("span",{className:"text-[20px] font-semibold tracking-tight",children:[u.jsx("span",{className:"text-gray-900 dark:text-[#F0F4F8]",children:"Signal"}),u.jsx("span",{className:"text-[#1D9E75]",children:"Fit"})]})]}),u.jsx(Pq,{step:s}),u.jsx("button",{type:"button",onClick:()=>z("close_button"),disabled:V||j,"aria-label":"Close onboarding",className:"absolute right-0 top-0 w-9 h-9 inline-flex items-center justify-center rounded-lg text-lg transition-colors disabled:opacity-30 disabled:cursor-not-allowed text-gray-400 hover:text-gray-900 hover:bg-gray-100 dark:text-white/40 dark:hover:text-white dark:hover:bg-white/10",children:"✕"})]}),u.jsxs("div",{className:"flex-1 flex items-center justify-center mt-10",children:[s===1&&u.jsxs("div",{className:"w-full max-w-md mx-auto text-center",children:[u.jsx("h2",{className:"text-3xl font-bold text-gray-900 dark:text-white",children:"Get the most out of SignalFit"}),u.jsx("p",{className:"text-base mt-2 text-gray-600 dark:text-white/60",children:"The Chrome extension lets you analyze jobs directly on LinkedIn, Indeed, and 10+ job boards — no copy-
210paste needed."}),u.jsxs("div",{className:"mt-8 rounded-2xl p-8 border border-[#1D9E75]/30 bg-gray-50 dark:bg-white/5",children:[u.jsxs("div",{className:"flex items-center justify-center gap-2.5",children:[u.jsx(g0,{}),u.jsxs("span",{className:"text-[18px] font-semibold",children:[u.jsx("span",{className:"text-gray-900 dark:text-[#F0F4F8]",children:"Signal"}),u.jsx("span",{className:"text-[#1D9E75]",children:"Fit"}),u.jsx("span",{className:"text-gray-900 dark:text-[#F0F4F8]",children:" for Chrome"})]})]}),h?u.jsxs("div",{className:"mt-6",children:[u.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full text-sm font-medium bg-[#1D9E75]/15 text-[#1D9E75] border border-[#1D9E75]/30",children:[u.jsx(i2,{className:"w-4 h-4"}),"Extension installed"]}),u.jsx("button",{type:"button",onClick:ne,className:"mt-6 w-full px-5 py-3 bg-[#1D9E75] hover:bg-[#1D9E75]/90 text-base font-semibold text-white rounded-lg transition-all",children:"Continue →"})]}):u.jsxs("div",{className:"mt-6",children:[u.jsx("a",{href:$o,target:"_blank",rel:"noopener noreferrer",onClick:()=>r.capture("extension_install_cta_clicked",{source:"onboarding_modal"}),className:"block w-full px-5 py-3 rounded-lg text-base font-semibold text-white transition-all hover:brightness-110 bg-[#1D9E75] shadow-[0_8px_24px_rgba(29,158,117,0.35)]",children:"Add to Chrome — It's free"}),u.jsx("button",{type:"button",onClick:ne,className:"mt-3 text-sm transition-colors text-gray-600 hover:text-gray-900 dark:text-white/60 dark:hover:text-white",children:"Already installed? →"})]})]})]}),s===2&&u.jsxs("div",{className:"w-full max-w-2xl",children:[u.jsxs("div",{className:"text-center",children:[u.jsx("div",{className:"inline-flex items-center justify-center w-14 h-14 rounded-2xl mb-5 bg-[#1D9E75]/15 border border-[#1D9E75]/25",children:u.jsx(g0,{})}),u.jsx("h2",{className:"text-3xl font-bold text-gray-900 dark:text-white",children:"Welcome to SignalFit"}),u.jsx("p",{className:"text-base mt-2 max-w-md mx-auto text-gray-600 dark:text-white/60",children:"Let's set up your profile so we can score jobs against your actual background."})]}),u.jsxs("div",{className:"mt-8 max-w-md mx-auto",children:[O?u.jsxs("div",{className:"rounded-2xl p-6 text-center bg-[#1D9E75]/[0.08] border border-[#1D9E75]/30",children:[u.jsx("div",{className:"w-12 h-12 mx-auto rounded-full flex items-center justify-center text-[#1D9E75] bg-[#1D9E75]/15",children:u.jsx(i2,{className:"w-6 h-6"})}),u.jsx("p",{className:"mt-3 text-base font-semibold text-gray-900 dark:text-white",children:"Profile imported"})]}):p===null?u.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[u.jsxs("button",{type:"button",onClick:()=>{g("linkedin"),R("")},className:"text-left rounded-2xl p-6 cursor-pointer transition-all border bg-white border-gray-200 hover:border-[#1D9E75]/50 dark:bg-white/5 dark:border-white/10 dark:hover:border-[#1D9E75]/50",children:[u.jsx(n2,{}),u.jsx("p",{className:"font-semibold mt-3 text-gray-900 dark:text-white",children:"Import from LinkedIn"}),u.jsx("p",{className:"text-sm mt-1 text-gray-500 dark:text-white/50",children:"Fastest — pulls your full work history"})]}),u.jsxs("button",{type:"button",onClick:()=>{g("resume"),R("")},className:"text-left rounded-2xl p-6 cursor-pointer transition-all border bg-white border-gray-200 hover:border-[#1D9E75]/50 dark:bg-white/5 dark:border-white/10 dark:hover:border-[#1D9E75]/50",children:[u.jsx(r2,{}),u.jsx("p",{className:"font-semibold mt-3 text-gray-900 dark:text-white",children:"Upload Resume"}),u.jsx("p",{className:"text-sm mt-1 text-gray-500 dark:text-white/50",children:"Paste text or upload PDF"})]})]}):p==="linkedin"?u.jsxs("div",{className:"rounded-2xl p-6 border bg-white border-gray-200 dark:bg-[#0D1F35] dark:border-white/[0.08]",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[u.jsx(n2,{}),u.jsx("p",{className:"font-semibold text-gray-900 dark:text-white",children:"Import from LinkedIn"})]}),u.jsx("label",{className:"block text-sm font-medium mb-1.5 text-gray-600 dark:text-[#8899AA]",children:"LinkedIn profile URL"}),u.jsx("input",{type:"url",value:m,onChange:ie=>y(ie.target.value),placeholder:"https://www.linkedin.com/in/yourname",className:v0,autoFocus:!0}),F&&u.jsx("p",{className:"mt-3 text-sm px-3 py-2 rounded-lg border bg-red-500/10 border-red-500/30 text-red-600 dark:bg-red-500/[0.08] dark:border-red-500/20 dark:text-red-400",children:F}),u.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[u.jsxs("button",{type:"button",onClick:A,disabled:j,className:"px-5 py-2.5 bg-[#1D9E75] hover:bg-[#1D9E75]/90 disabled:opacity-40 disabled:cursor-not-allowed text-sm font-semibold text-white rounded-lg transition-all inline-flex items-center gap-2",children:[j&&u.jsx("span",{className:"w-3.5 h-3.5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),j?"Importing…":"Import →"]}),u.jsx("button",{type:"button",onClick:()=>{g(null),R("")},className:"text-sm transition-colors text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white/70",children:"← Back"})]})]}):u.jsxs("div",{className:"rounded-2xl p-6 border bg-white border-gray-200 dark:bg-[#0D1F35] dark:border-white/[0.08]",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[u.jsx(r2,{}),u.jsx("p",{className:"font-semibold text-gray-900 dark:text-white",children:"Upload Resume"})]}),u.jsx("div",{className:"inline-flex gap-1 p-1 rounded-lg mb-4 bg-gray-100 dark:bg-[#162440]",children:["text","pdf"].map(ie=>u.jsx("button",{type:"button",onClick:()=>{_(ie),R("")},className:`px-3 py-1.5 text-xs font-medium rounded-md transition-all ${b===ie?"bg-[#1D9E75] text-white":"text-gray-500 hover:text-gray-900 dark:text-[#8899AA] dark:hover:text-[#F0F4F8]"}`,children:ie==="text"?"Paste text":"Upload PDF"},ie))}),b==="text"?u.jsx("textarea",{value:w,onChange:ie=>S(ie.target.value),rows:8,placeholder:"Paste your resume text here…",className:`${v0} resize-none font-mono`}):u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"w-full flex flex-col items-center justify-center border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-colors hover:border-[#1D9E75] focus-visible:border-[#1D9E75] focus:outline-none border-gray-300 dark:border-white/[0.12]",onClick:()=>{var ie;return(ie=document.getElementById("onboarding-pdf-input"))==null?void 0:ie.click()},"aria-label":E?`Replace selected PDF: ${E.name}`:"Select resume PDF",children:E?u.jsx("p",{className:"text-sm font-medium text-[#1D9E75]",children:E.name}):u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"text-sm text-gray-500 dark:text-[#8899AA]",children:"Click to select your resume PDF"}),u.jsx("p",{className:"text-xs mt-1 text-gray-400 dark:text-[#8899AA]/60",children:"PDF only · max 10 MB"})]})}),u.jsx("input",{id:"onboarding-pdf-input",type:"file",accept:".pdf,application/pdf",className:"hidden",onChange:ie=>{var fe;return k(((fe=ie.target.files)==null?void 0:fe[0])??null)}})]}),F&&u.jsx("p",{className:"mt-3 text-sm px-3 py-2 rounded-lg border bg-red-500/10 border-red-500/30 text-red-600 dark:bg-red-500/[0.08] dark:border-red-500/20 dark:text-red-400",children:F}),u.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[u.jsxs("button",{type:"button",onClick:$,disabled:j,className:"px-5 py-2.5 bg-[#1D9E75] hover:bg-[#1D9E75]/90 disabled:opacity-40 disabled:cursor-not-allowed text-sm font-semibold text-white rounded-lg transition-all inline-flex items-center gap-2",children:[j&&u.jsx("span",{className:"w-3.5 h-3.5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),j?"Importing…":"Import →"]}),u.jsx("button",{type:"button",onClick:()=>{g(null),R("")},className:"text-sm transition-colors text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white/70",children:"← Back"})]})]}),!O&&u.jsx("div",{className:"text-center",children:u.jsx("button",{type:"button",onClick:X,disabled:j,className:"mt-8 text-xs transition-colors disabled:opacity-40 text-gray-400 hover:text-gray-600 dark:text-white/30 dark:hover:text-white/60",children:"I'll do this later →"})})]})]}),s===3&&u.jsxs("div",{className:"w-full max-w-md mx-auto text-center",children:[u.jsx("h2",{className:"text-3xl font-bold text-gray-900 dark:text-white",children:"Analyze your first role"}),u.jsx("p",{className:"text-base mt-2 text-gray-600 dark:text-white/60",children:"Paste any job URL to get your Signal score instantly."}),u.jsxs("div",{className:"mt-8 text-left",children:[u.jsx("input",{type:"url",value:B,onChange:ie=>M(ie.target.value),placeholder:"https://linkedin.com/jobs/view/...",className:v0,disabled:V,autoFocus:!0,"aria-label":"Job posting URL"}),te&&u.jsx("p",{className:"mt-3 text-sm px-3 py-2 rounded-lg border bg-red-500/10 border-red-500/30 text-red-600 dark:bg-red-500/[0.08] dark:border-red-500/20 dark:text-red-400",role:"alert",children:te}),u.jsxs("button",{type:"button",onClick:P,disabled:V||!B.trim(),className:"mt-4 w-full px-5 py-3 bg-[#1D9E75] hover:bg-[#1D9E75]/90 disabled:opacity-40 disabled:cursor-not-allowed text-base font-semibold text-white rounded-lg transition-all inline-flex items-center justify-center gap-2",children:[V&&u.jsx("span",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),V?"Analyzing…":"Analyze →"]}),Q&&(V||Q.signal_score!==void 0||Q.summary!==void 0)&&u.jsxs("div",{className:"mt-5 rounded-2xl p-5 border bg-white border-gray-200 dark:bg-[#0D1F35] dark:border-white/[0.08]","aria-live":"polite","aria-atomic":"false",children:[(Q.job_title||Q.company_name)&&u.jsxs("p",{className:"text-sm text-gray-700 dark:text-white/70",children:[Q.job_title??"…",Q.company_name&&u.jsxs("span",{className:"text-gray-500 dark:text-white/40",children:[" · ",Q.company_name]})]}),Q.signal_score!==void 0&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"mt-3 flex items-baseline gap-2",children:[u.jsx("span",{className:"text-4xl font-bold text-[#1D9E75]",children:Q.signal_score}),u.jsx("span",{className:"text-sm text-gray-500 dark:text-white/40",children:H?"Signal score":`Better fit than ${Q.signal_score}% of jobs matched to you.`})]}),H&&u.jsx(kO,{className:"mt-3"})]}),!V&&Q.signal_score===void 0&&!H&&u.jsx("p",{className:"mt-3 text-sm text-gray-500 dark:text-white/40",children:"Calibrating your score baseline — your score will appear on your tracker shortly."}),Q.summary&&u.jsx("p",{className:"mt-3 text-sm leading-relaxed text-gray-700 dark:text-white/60",children:Q.summary})]})]}),u.jsx("button",{type:"button",onClick:se,disabled:V,className:"mt-8 text-xs transition-colors disabled:opacity-40 text-gray-400 hover:text-gray-600 dark:text-white/30 dark:hover:text-white/60",children:"I'll explore on my own →"})]})]})]})})}function s2(){return u.jsxs("svg",{width:"26",height:"18",viewBox:"0 0 20 14",fill:"none","aria-hidden":"true",children:[u.jsx("rect",{x:"0",y:"8",width:"5",height:"6",rx:"1",fill:"#1D9E75"}),u.jsx("rect",{x:"7.5",y:"3",width:"5",height:"11",rx:"1",fill:"#1D9E75"}),u.jsx("rect",{x:"15",y:"0",width:"5",height:"14",rx:"1",fill:"#1D9E75"})]})}function $q({onUseUrlSubmit:t}){const e=In();T.useEffect(()=>
210{e.capture("extension_install_cta_shown",{source:"install_gate"})},[e]);const n=()=>{e.capture("install_gate_url_submit_selected"),t()};return u.jsx("div",{className:"flex min-h-full flex-col items-center justify-center py-10",children:u.jsxs("div",{className:"w-full max-w-lg text-center",children:[u.jsx("div",{className:"inline-flex items-center justify-center w-14 h-14 rounded-2xl mb-6 bg-[#1D9E75]/15 border border-[#1D9E75]/25",children:u.jsx(s2,{})}),u.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white",children:"Score every job inline, as you browse"}),u.jsx("p",{className:"text-base mt-3 max-w-md mx-auto text-gray-600 dark:text-white/60",children:"The SignalFit Chrome extension analyzes any listing on LinkedIn, Indeed, and 10+ job boards against your profile — right on the page, no copy-paste. Install it to start filling your tracker."}),u.jsxs("div",{className:"mt-8 rounded-2xl p-8 border border-[#1D9E75]/30 bg-gray-50 dark:bg-white/5",children:[u.jsxs("div",{className:"flex items-center justify-center gap-2.5",children:[u.jsx(s2,{}),u.jsxs("span",{className:"text-[18px] font-semibold",children:[u.jsx("span",{className:"text-gray-900 dark:text-[#F0F4F8]",children:"Signal"}),u.jsx("span",{className:"text-[#1D9E75]",children:"Fit"}),u.jsx("span",{className:"text-gray-900 dark:text-[#F0F4F8]",children:" for Chrome"})]})]}),u.jsx("a",{href:$o,target:"_blank",rel:"noopener noreferrer",onClick:()=>e.capture("extension_install_cta_clicked",{source:"install_gate"}),className:"mt-6 block w-full px-5 py-3 rounded-lg text-base font-semibold text-white transition-all hover:brightness-110 bg-[#1D9E75] shadow-[0_8px_24px_rgba(29,158,117,0.35)]",children:"Add to Chrome — It's free"}),u.jsx("button",{type:"button",onClick:()=>{e.capture("install_gate_already_installed_clicked"),window.location.reload()},className:"mt-4 text-sm transition-colors text-gray-600 hover:text-gray-900 dark:text-white/60 dark:hover:text-white",children:"Already installed? Refresh to detect it →"})]}),u.jsx("button",{type:"button",onClick:n,className:"mt-8 text-xs transition-colors text-gray-400 hover:text-gray-600 dark:text-white/30 dark:hover:text-white/60",children:"Prefer to paste job URLs? Continue to your tracker →"})]})})}const jO=["(max-width: 1024px)","(pointer: coarse)"];function Uq(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:jO.every(t=>window.matchMedia(t).matches)}function TO(){const[t,e]=T.useState(Uq);return T.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const n=jO.map(s=>window.matchMedia(s)),r=()=>e(n.every(s=>s.matches));return r(),n.forEach(s=>s.addEventListener("change",r)),()=>n.forEach(s=>s.removeEventListener("change",r))},[]),t}const NO="sf-mobile-gate-dismissed";function zq(){if(typeof window>"u")return!1;try{return window.sessionStorage.getItem(NO)==="1"}catch{return!1}}function v_(){const t=TO(),[e,n]=T.useState(zq);return{showGate:t&&!e,dismissGate:()=>{try{window.sessionStorage.setItem(NO,"1")}catch{}n(!0)}}}const Bq="#0A1628",a2="#1D9E75",o2="#F0F4F8",y0="#8899AA",Hq="'Plus Jakarta Sans', sans-serif";function y_({onContinue:t}){const e=In(),{pathname:n}=Mr();T.useEffect(()=>{e.capture("mobile_gate_shown",{route:n})},[e,n]);const r=()=>
210{e.capture("mobile_gate_dismissed",{route:n}),t()};return u.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"mobile-gate-heading",style:{position:"fixed",inset:0,zIndex:9999,backgroundColor:Bq,color:o2,fontFamily:Hq,display:"flex",alignItems:"center",justifyContent:"center",padding:"32px 24px",textAlign:"center",overflowY:"auto"},children:u.jsxs("div",{style:{maxWidth:440,width:"100%"},children:[u.jsxs("div",{style:{fontSize:20,fontWeight:800,letterSpacing:"-0.02em",marginBottom:44},children:["Signal",u.jsx("span",{style:{color:a2},children:"Fit"})]}),u.jsx("div",{"aria-hidden":"true",style:{width:72,height:72,margin:"0 auto 28px",borderRadius:20,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(29, 158, 117, 0.12)",border:"1px solid rgba(29, 158, 117, 0.3)"},children:u.jsxs("svg",{width:"34",height:"34",viewBox:"0 0 24 24",fill:"none",stroke:a2,strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[u.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),u.jsx("path",{d:"M8 21h8M12 17v4"})]})}),u.jsx("h1",{id:"mobile-gate-heading",style:{fontSize:26,fontWeight:700,lineHeight:1.2,margin:"0 0 16px"},children:"SignalFit is built for desktop"}),u.jsxs("p",{style:{fontSize:15,lineHeight:1.65,color:y0,margin:"0 0 14px"},children:["SignalFit's core workflow — capturing job listings with our"," ",u.jsx("strong",{style:{color:o2,fontWeight:600},children:"desktop Chrome extension"})," and organizing them on your tracker board — needs a desktop browser. Adding jobs isn't possible on mobile."]}),u.jsx("p",{style:{fontSize:15,lineHeight:1.65,color:y0,margin:"0 0 40px"},children:"Open SignalFit on your computer and install the extension to get started."}),u.jsx("button",{type:"button",onClick:r,style:{appearance:"none",background:"none",border:"none",padding:8,margin:0,font:"inherit",fontSize:14,color:y0,textDecoration:"underline",textUnderlineOffset:3,cursor:"pointer"},children:"Continue anyway"})]})})}const AO="sf-install-gate-dismissed";function qq(){if(typeof window>"u")return!1;try{return window.sessionStorage.getItem(AO)==="1"}catch{return!1}}function Gq(){const{needsOnboarding:t,completeOnboarding:e}=Iq(),n=Mr(),{showGate:r,dismissGate:s}=v_(),o=TO(),l=Ym(),[d,h]=T.useState(qq),p=()=>{try{window.sessionStorage.setItem(AO,"1")}catch{}h(!0)};if(r)return u.jsx(y_,{onContinue:s});const g=t===!0&&n.pathname!=="/profile",m=n.pathname==="/tracker"&&!o&&!l&&!d&&!g;return u.jsxs(pq,{children:[u.jsxs("div",{className:"flex h-screen overflow-hidden bg-white text-gray-900 dark:bg-[#0A1628] dark:text-[#F0F4F8]",children:[u.jsx(Dq,{}),u.jsx("main",{className:"flex-1 min-w-0 p-8 overflow-y-auto",children:m?u.jsx($q,{onUseUrlSubmit:p}):u.jsx(yN,{})})]}),g&&u.jsx(Fq,{onComplete:e})]})}function Vq(){return u.jsxs("svg",{width:"28",height:"20",viewBox:"0 0 20 14",fill:"none","aria-hidden":"true",children:[u.jsx("rect",{x:"0",y:"8",width:"5",height:"6",rx:"1",fill:"#1D9E75"}),u.jsx("rect",{x:"7.5",y:"3",width:"5",height:"11",rx:"1",fill:"#1D9E75"}),u.jsx("rect",{x:"15",y:"0",width:"5",height:"14",rx:"1",fill:"#1D9E75"})]})}function Wq(){return u.jsxs("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 overflow-hidden",children:[u.jsx("div",{className:"absolute rounded-full",style:{width:320,height:320,top:-120,left:-100,background:"rgba(29,158,117,0.20)",filter:"blur(90px)"}}),u.jsx("div",{className:"absolute rounded-full",style:{width:380,height:380,top:"38%",right:-160,background:"rgba(29,158,117,0.12)",filter:"blur(110px)"}}),u.jsx("div",{className:"absolute rounded-full",style:{width:280,height:280,bottom:-120,left:"32%",background:"rgba(29,158,117,0.10)",filter:"blur(100px)"}})]})}const Yq="w-full px-3.5 py-2.5 rounded-lg text-sm text-gray-900 dark:text-[#F0F4F8] transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[#1D9E75] focus-visible:border-[#1D9E75]",Kq={background:"var(--sf-bg-elevated)",border:"1px solid var(--sf-border-subtle)"};function l2(t){return u.jsx("input",{...t,className:`${Yq} ${t.className??""}`,style:Kq})}function Jq(){const{signIn:t}=hn(),e=Lr(),{showGate:n,dismissGate:r}=v_(),[s,o]=T.useState(""),[l,d]=T.useState(""),[h,p]=T.useState(""),[g,m]=T.useState(!1),y=async()=>{await Ye.auth.signInWithOAuth({provider:"google",options:{redirectTo:`${window.location.origin}/auth/callback`}})},b=async()=>{await Ye.auth.signInWithOAuth({provider:"apple",options:{redirectTo:`${window.location.origin}/auth/callback`}})},_=async w=>{w.preventDefault(),p(""),m(!0);const{error:S}=await t(s,l);S?(p(S.message),m(!1)):e("/tracker")};return n?u.jsx(y_,{onContinue:r}):u.jsxs("main",{className:"relative min-h-screen flex items-center justify-center px-4 overflow-hidden bg-gray-50 dark:bg-[#0A1628]",style:{backgroundImage:"radial-gradient(ellipse at 50% 0%, rgba(29,158,117,0.15) 0%, transparent 70%)"},children:[u.jsx(Wq,{}),u.jsxs("div",{className:"relative w-full max-w-sm rounded-2xl p-8",style:{background:"var(--sf-bg-card)",border:"1px solid rgba(29,158,117,0.2)",boxShadow:"0 0 40px rgba(29,158,117,0.08)"},children:[u.jsxs("div",{className:"flex flex-col items-center mb-8",children:[u.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[u.jsx(Vq,{}),u.jsxs("span",{className:"text-[28px] font-semibold tracking-tight",children:[u.jsx("span",{className:"text-gray-900 dark:text-[#F0F4F8]",children:"Signal"}),u.jsx("span",{style:{color:"#1D9E75"},children:"Fit"})]})]}),u.jsx("p",{className:"text-xs text-gray-500 dark:text-[#8899AA] tracking-wide",children:"Your AI-powered job fit analyzer"}),u.jsx("p",{className:"text-sm text-gray-500 dark:text-[#8899AA] mt-3",children:"Sign in to your account"})]}),u.jsxs("button",{type:"button",onClick:b,className:"w-full flex items-center justify-center gap-3 py-2.5 rounded-lg text-sm font-medium text-white transition-colors bg-black hover:bg-[#1a1a1a] mb-3",style:{border:"1px solid var(--sf-border-subtle)"},children:[u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"18",height:"18",fill:"white","aria-hidden":"true",children:u.jsx("path",{d:"M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701"})}),"Continue with Apple"]}),u.jsxs("button",{type:"button",onClick:y,className:"w-full flex items-center justify-center gap-3 py-2.5 rounded-lg text-sm font-medium text-gray-900 dark:text-[#F0F4F8] transition-colors hover:bg-gray-100 dark:bg-[#162440]",style:{border:"1px solid var(--sf-border-subtle)"},children:[u.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 48 48","aria-hidden":"true",children:[u.jsx("path",{fill:"#EA4335",d:"M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"}),u.jsx("path",{fill:"#4285F4",d:"M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"}),u.jsx("path",{fill:"#FBBC05",d:"M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"}),u.jsx("path",{fill:"#34A853",d:"M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.18 1.48-4.97 2.36-8.16 2.36-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"})]}),"Continue with Google"]}),u.jsxs("div",{className:"relative my-6",children:[u.jsx("div",{className:"absolute inset-0 flex items-center",children:u.jsx("div",{className:"w-full",style:{borderTop:"1px solid var(--sf-border-subtle)"}})}),u.jsx("div",{className:"relative flex justify-center",children:u.jsx("span",{className:"px-3 text-xs text-gray-500 dark:text-[#8899AA]",style:{background:"var(--sf-bg-card)"},children:"or"})})]}),u.jsxs("form",{onSubmit:_,className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx("label",{htmlFor:"login-email",className:"block text-xs font-medium text-gray-500 dark:text-[#8899AA] mb-1.5",children:"Email"}),u.jsx(l2,{id:"login-email",type:"email",required:!0,autoComplete:"email",value:s,onChange:w=>o(w.target.value),placeholder:"[email protected]"})]}),u.jsxs("div",{children:[u.jsx("label",{htmlFor:"login-password",className:"block text-xs font-medium text-gray-500 dark:text-[#8899AA] mb-1.5",children:"Password"}),u.jsx(l2,{id:"login-password",type:"password",required:!0,autoComplete:"current-password",value:l,onCh
210ange:w=>d(w.target.value),placeholder:"••••••••"})]}),h&&u.jsx("p",{role:"alert",className:"text-sm text-red-400 px-3 py-2 rounded-lg",style:{background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.2)"},children:h}),u.jsx("button",{type:"submit",disabled:g,className:"w-full py-2.5 bg-[#1D9E75] hover:bg-[#1D9E75]/90 disabled:opacity-40 disabled:cursor-not-allowed text-sm font-semibold text-white rounded-lg transition-all",children:g?"Signing in…":"Sign in"})]}),u.jsxs("p",{className:"mt-6 text-center text-sm text-gray-500 dark:text-[#8899AA]",children:["No account?"," ",u.jsx(Kt,{to:"/signup",className:"text-[#1D9E75] hover:text-[#1D9E75]/80 transition-colors font-medium",children:"Create one"})]})]})]})}function Xq(){return u.jsxs("svg",{width:"28",height:"20",viewBox:"0 0 20 14",fill:"none","aria-hidden":"true",children:[u.jsx("rect",{x:"0",y:"8",width:"5",height:"6",rx:"1",fill:"#1D9E75"}),u.jsx("rect",{x:"7.5",y:"3",width:"5",height:"11",rx:"1",fill:"#1D9E75"}),u.jsx("rect",{x:"15",y:"0",width:"5",height:"14",rx:"1",fill:"#1D9E75"})]})}function c2(){return u.jsxs("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 overflow-hidden",children:[u.jsx("div",{className:"absolute rounded-full",style:{width:320,height:320,top:-120,left:-100,background:"rgba(29,158,117,0.20)",filter:"blur(90px)"}}),u.jsx("div",{className:"absolute rounded-full",style:{width:380,height:380,top:"38%",right:-160,background:"rgba(29,158,117,0.12)",filter:"blur(110px)"}}),u.jsx("div",{className:"absolute rounded-full",style:{width:280,height:280,bottom:-120,left:"32%",background:"rgba(29,158,117,0.10)",filter:"blur(100px)"}})]})}const u2={backgroundImage:"radial-gradient(ellipse at 50% 0%, rgba(29,158,117,0.15) 0%, transparent 70%)"},d2="relative min-h-screen flex items-center justify-center px-4 overflow-hidden bg-gray-50 dark:bg-[#0A1628]",Zq="w-full px-3.5 py-2.5 rounded-lg text-sm text-gray-900 dark:text-[#F0F4F8] transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[#1D9E75] focus-visible:border-[#1D9E75]",Qq={background:"var(--sf-bg-elevated)",border:"1px solid var(--sf-border-subtle)"};function b0(t){return u.jsx("input",{...t,className:`${Zq} ${t.className??""}`,style:Qq})}function eG(){const{signUp:t}=hn(),e=Lr(),{showGate:n,dismissGate:r}=v_(),[s,o]=T.useState(""),[l,d]=T.useState(""),[h,p]=T.useState(""),[g,m]=T.useState(""),[y,b]=T.useState(!1),[_,w]=T.useState(!1),S=async()=>{await Ye.auth.signInWithOAuth({provider:"google",options:{redirectTo:`${window.location.origin}/auth/callback`}})},E=async()=>{await Ye.auth.signInWithOAuth({provider:"apple",options:{redirectTo:`${window.location.origin}/auth/callback`}})},k=async j=>{if(j.preventDefault(),m(""),l.length<6){m("Password must be at least 6 characters.");return}if(l!==h){m("Passwords do not match.");return}w(!0);const{error:N,session:O}=await t(s,l);if(N){m(N.message),w(!1);return}if(O){e("/tracker");return}b(!0)};return y?u.jsxs("main",{className:d2,style:u2,children:[u.jsx(c2,{}),u.jsxs("div",{className:"relative w-full max-w-sm text-center",children:[u.jsx("div",{className:"w-12 h-12 rounded-full flex items-center justify-center mx-auto mb-4",style:{background:"rgba(29,158,117,0.12)",border:"1px solid rgba(29,158,117,0.25)"},children:u.jsx("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"#1D9E75",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),u.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-[#F0F4F8] mb-2",children:"Check your email"}),u.jsxs("p",{className:"text-sm text-gray-500 dark:text-[#8899AA] mb-6",children:["We sent a confirmation link to"," ",u.jsx("span",{className:"text-[#1D9E75]",children:s}),". Click it to activate your account."]}),u.jsx(Kt,{to:"/login",className:"text-sm text-[#1D9E75] hover:text-[#1D9E75]/80 transition-colors font-medium",children:"Back to sign in"})]})]}):n?u.jsx(y_,{onContinue:r}):u.jsxs("main",{className:d2,style:u2,children:[u.jsx(c2,{}),u.jsxs("div",{className:"relative w-full max-w-sm rounded-2xl p-8",style:{background:"var(--sf-bg-card)",border:"1px solid rgba(29,158,117,0.2)",boxShadow:"0 0 40px rgba(29,158,117,0.08)"},children:[u.jsxs("div",{className:"flex flex-col items-center mb-8",children:[u.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[u.jsx(Xq,{}),u.jsxs("span",{className:"text-[28px] font-semibold tracking-tight",children:[u.jsx("span",{className:"text-gray-900 dark:text-[#F0F4F8]",children:"Signal"}),u.jsx("span",{style:{color:"#1D9E75"},children:"Fit"})]})]}),u.jsx("p",{className:"text-xs text-gray-500 dark:text-[#8899AA] tracking-wide",children:"Your AI-powered job fit analyzer"}),u.jsx("p",{className:"text-sm text-gray-500 dark:text-[#8899AA] mt-3",children:"Create your account"})]}),u.jsxs("button",{type:"button",onClick:E,className:"w-full flex items-center justify-center gap-3 py-2.5 rounded-lg text-sm font-medium text-white transition-colors bg-black hover:bg-[#1a1a1a] mb-3",style:{border:"1px solid var(--sf-border-subtle)"},children:[u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"18",height:"18",fill:"white","aria-hidden":"true",children:u.jsx("path",{d:"M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701"})}),"Continue with Apple"]}),u.jsxs("button",{type:"button",onClick:S,className:"w-full flex items-center justify-center gap-3 py-2.5 rounded-lg text-sm font-medium text-gray-900 dark:text-[#F0F4F8] transition-colors hover:bg-gray-100 dark:bg-[#162440]",style:{border:"1px solid var(--sf-border-subtle)"},children:[u.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 48 48","aria-hidden":"true",children:[u.jsx("path",{fill:"#EA4335",d:"M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"}),u.jsx("path",{fill:"#4285F4",d:"M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"}),u.jsx("path",{fill:"#FBBC05",d:"M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"}),u.jsx("path",{fill:"#34A853",d:"M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.18 1.48-4.97 2.36-8.16 2.36-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"})]}),"Continue with Google"]}),u.jsxs("div",{className:"relative my-6",children:[u.jsx("div",{className:"absolute inset-0 flex items-center",children:u.jsx("div",{className:"w-full",style:{borderTop:"1px solid var(--sf-border-subtle)"}})}),u.jsx("div",{className:"relative flex justify-center",children:u.jsx("span",{className:"px-3 text-xs text-gray-500 dark:text-[#8899AA]",style:{background:"var(--sf-bg-card)"},children:"or"})})]}),u.jsxs("form",{onSubmit:k,className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx("label",{htmlFor:"signup-email",className:"block text-xs font-medium text-gray-500 dark:text-[#8899AA] mb-1.5",children:"Email"}),u.jsx(b0,{id:"signup-email",type:"email",required:!0,autoComplete:"email",value:s,onChange:j=>o(j.target.value),placeholder:"[email protected]"})]}),u.jsxs("div",{children:[u.jsx("label",{htmlFor:"signup-password",className:"block text-xs font-medium text-gray-500 dark:text-[#8899AA] mb-1.5",children:"Password"}),u.jsx(b0,{id:"signup-password",type:"password",required:!0,autoComplete:"new-password",value:l,onCh
210ange:j=>d(j.target.value),placeholder:"Min. 6 characters"})]}),u.jsxs("div",{children:[u.jsx("label",{htmlFor:"signup-confirm-password",className:"block text-xs font-medium text-gray-500 dark:text-[#8899AA] mb-1.5",children:"Confirm password"}),u.jsx(b0,{id:"signup-confirm-password",type:"password",required:!0,autoComplete:"new-password",value:h,onChange:j=>p(j.target.value),placeholder:"••••••••"})]}),g&&u.jsx("p",{role:"alert",className:"text-sm text-red-400 px-3 py-2 rounded-lg",style:{background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.2)"},children:g}),u.jsx("button",{type:"submit",disabled:_,className:"w-full py-2.5 bg-[#1D9E75] hover:bg-[#1D9E75]/90 disabled:opacity-40 disabled:cursor-not-allowed text-sm font-semibold text-white rounded-lg transition-all",children:_?"Creating account…":"Create account"})]}),u.jsxs("p",{className:"mt-6 text-center text-sm text-gray-500 dark:text-[#8899AA]",children:["Already have an account?"," ",u.jsx(Kt,{to:"/login",className:"text-[#1D9E75] hover:text-[#1D9E75]/80 transition-colors font-medium",children:"Sign in"})]})]})]})}function tG(){const{user:t,loading:e}=hn(),n=Lr();return T.useEffect(()=>{var r;if(!e){if(t){const s=new Date(t.created_at).getTime(),o=new Date(t.last_sign_in_at??"").getTime();Number.isFinite(s)&&Number.isFinite(o)&&Math.abs(o-s)<5e3&&((r=window.gtag)==null||r.call(window,"event","sign_up",{method:"oauth"}))}n(t?"/tracker":"/login",{replace:!0})}},[t,e,n]),u.jsx("main",{className:"min-h-screen flex items-center justify-center bg-white dark:bg-[#0A1628]",children:u.jsx("p",{role:"status",className:"text-sm text-gray-500 dark:text-[#8899AA]",children:"Signing in…"})})}const nG="c=1idD04wBbxHKl8YzDko";function rG(t){try{const e=localStorage.getItem(`discover_count_${t}`),n=e?parseInt(e,10):0;if(!Number.isFinite(n)||n<=0)return null;const r=localStorage.getItem(`discover_last_visited_${t}`),s=r?new Date(r).getTime():NaN;if(!(!Number.isFinite(s)||Date.now()-s>1440*60*1e3))return null;const l=localStorage.getItem(`discover_preview_${t}`);let d=[];if(l){const h=JSON.parse(l);Array.isArray(h)&&(d=h.filter(p=>!!p&&typeof p=="object"&&typeof p.title=="string"&&typeof p.company=="string").slice(0,3))}return{count:n,previews:d}}catch{return null}}function iG({preview:t,delayMs:e}){const[n,r]=T.useState(!1),s=(t.company||t.title||"?").trim().charAt(0).toUpperCase()||"?",o=t.domain&&!n?u.jsx("img",{src:`https://cdn.brandfetch.io/${t.domain}/w/200/h/200?${nG}`,alt:t.company,onError:()=>r(!0),className:"w-8 h-8 rounded-lg object-cover shrink-0 bg-gray-100 dark:bg-[#162440]"}):u.jsx("div",{className:"w-8 h-8 rounded-lg shrink-0 flex items-center justify-center text-xs font-semibold text-white bg-[#1D9E75]",children:s});return u.jsxs("div",{className:"flex flex-col items-center",style:{opacity:0,animation:`fade-in-up 400ms ease-out ${e}ms forwards`},children:[o,u.jsx("span",{className:"text-[10px] truncate max-w-[60px] text-center mt-1 text-gray-500 dark:text-[#8899AA]",children:t.company||t.title})]})}function sG(){const{user:t}=hn(),e=Lr(),[n,r]=T.useState(null);return T.useEffect(()=>{if(!t){r(null);return}r(rG(t.id))},[t]),n?u.jsxs("div",{className:"relative flex flex-col gap-0 p-3 rounded-lg overflow-hidden bg-white dark:bg-transparent border border-[#1D9E75]/40 border-t-[#1D9E75]/60",style:{backgroundImage:"linear-gradient(105deg, transparent 0%, transparent 40%, rgba(29,158,117,0.08) 50%, transparent 60%, transparent 100%)",backgroundSize:"200% 100%",animation:"shimmer 4s ease-in-out infinite, border-breathe 3s ease-in-out infinite"},children:[u.jsx("style",{children:`
211        @keyframes shimmer {
212          0% { background-position: -200% center }
213          100% { background-position: 200% center }
214        }
215        @keyframes border-breathe {
216          0%, 100% { box-shadow: 0 0 0 0 rgba(29,158,117,0) }
217          50% { box-shadow: 0 0 16px 2px rgba(29,158,117,0.12) }
218        }
219        @keyframes spin-slow {
220          0% { transform: rotate(0deg) }
221          100% { transform: rotate(360deg) }
222        }
223        @keyframes fade-in-up {
224          from { opacity: 0; transform: translateY(4px) }
225          to { opacity: 1; transform: translateY(0) }
226        }
227      `}),u.jsxs("div",{className:"flex items-center",children:[u.jsx("span",{"aria-hidden":"true",className:"text-[#1D9E75] inline-block",style:{fontSize:11,lineHeight:1,animation:"spin-slow 8s linear infinite"},children:"✦"}),u.jsx("span",{className:"text-[12px] font-semibold text-[#1D9E75] ml-1.5",children:"New matches found"}),u.jsx("span",{className:"ml-auto text-[11px] rounded-full px-1.5 py-0.5 text-[#1D9E75] bg-[#1D9E75]/15 border border-[#1D9E75]/30 dark:text-white",children:n.count})]}),n.previews.length>0&&u.jsx("div",{className:"mt-3 flex items-start gap-3",children:n.previews.slice(0,3).map((s,o)=>u.jsx(iG,{preview:s,delayMs:o*150},`${s.domain??s.company}-${o}`))}),u.jsx("p",{className:"mt-3 text-[12px] text-gray-500 dark:text-[#8899AA]",children:"Roles matched to your background"}),u.jsx("button",{type:"button",onClick:()=>e("/discover"),className:"mt-3 w-full text-[12px] font-semibold text-white rounded-lg py-2 transition-all hover:brightness-110 cursor-pointer bg-[#1D9E75]",children:"View your matches →"})]}):null}const Km=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Dc(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function b_(t){return"nodeType"in t}function wr(t){var e,n;return t?Dc(t)?t:b_(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function x_(t){const{Document:e}=wr(t);return t instanceof e}function yh(t){return Dc(t)?!1:t instanceof wr(t).HTMLElement}function CO(t){return t instanceof wr(t).SVGElement}function Ic(t){return t?Dc(t)?t.document:b_(t)?x_(t)?t:yh(t)||CO(t)?t.ownerDocument:document:document:document}const ta=Km?T.useLayoutEffect:T.useEffect;function Jm(t){const e=T.useRef(t);return ta(()=>{e.current=t}),T.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return e.current==null?void 0:e.current(...r)},[])}function aG(){const t=T.useRef(null),e=T.useCallback((r,s)=>{t.current=setInterval(r,s)},[]),n=T.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function Bd(t,e){e===void 0&&(e=[t]);const n=T.useRef(t);return ta(()=>{n.current!==t&&(n.current=t)},e),n}function bh(t,e){const n=T.useRef();return T.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function mm(t){const e=Jm(t),n=T.useRef(null),r=T.useCallback(s=>{s!==n.current&&(e==null||e(s,n.current)),n.current=s},[]);return[n,r]}function gm(t){const e=T.useRef();return T.useEffect(()=>{e.current=t},[t]),e.current}let x0={};function Xm(t,e){return T.useMemo(()=>
227{if(e)return e;const n=x0[t]==null?0:x0[t]+1;return x0[t]=n,t+"-"+n},[t,e])}function RO(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((o,l)=>{const d=Object.entries(l);for(const[h,p]of d){const g=o[h];g!=null&&(o[h]=g+t*p)}return o},{...e})}}const pc=RO(1),vm=RO(-1);function oG(t){return"clientX"in t&&"clientY"in t}function __(t){if(!t)return!1;const{KeyboardEvent:e}=wr(t.target);return e&&t instanceof e}function lG(t){if(!t)return!1;const{TouchEvent:e}=wr(t.target);return e&&t instanceof e}function ym(t){if(lG(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return oG(t)?{x:t.clientX,y:t.clientY}:null}const Hd=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[Hd.Translate.toString(t),Hd.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),h2="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function cG(t){return t.matches(h2)?t:t.querySelector(h2)}const uG={display:"none"};function dG(t){let{id:e,value:n}=t;return Ut.createElement("div",{id:e,style:uG},n)}function hG(t){let{id:e,announcement:n,ariaLiveType:r="assertive"}=t;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Ut.createElement("div",{id:e,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function fG(){const[t,e]=T.useState("");return{announce:T.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const OO=T.createContext(null);function pG(t){const e=T.useContext(OO);T.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function mG(){const[t]=T.useState(()=>new Set),e=T.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[T.useCallback(r=>{let{type:s,event:o}=r;t.forEach(l=>{var d;return(d=l[s])==null?void 0:d.call(l,o)})},[t]),e]}const gG={draggable:`
228    To pick up a draggable item, press the space bar.
229    While dragging, use the arrow keys to move the item.
230    Press space again to drop the item in its new position, or press escape to cancel.
231  `},vG={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function yG(t){let{announcements:e=vG,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=gG}=t;const{announce:o,announcement:l}=fG(),d=Xm("DndLiveRegion"),[h,p]=T.useState(!1);if(T.useEffect(()=>{p(!0)},[]),pG(T.useMemo(()=>({onDragStart(m){let{active:y}=m;o(e.onDragStart({active:y}))},onDragMove(m){let{active:y,over:b}=m;e.onDragMove&&o(e.onDragMove({active:y,over:b}))},onDragOver(m){let{active:y,over:b}=m;o(e.onDragOver({active:y,over:b}))},onDragEnd(m){let{active:y,over:b}=m;o(e.onDragEnd({active:y,over:b}))},onDragCancel(m){let{active:y,over:b}=m;o(e.onDragCancel({active:y,over:b}))}}),[o,e])),!h)return null;const g=Ut.createElement(Ut.Fragment,null,Ut.createElement(dG,{id:r,value:s.draggable}),Ut.createElement(hG,{id:d,announcement:l}));return n?tc.createPortal(g,n):g}var zn;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(zn||(zn={}));function bm(){}function f2(t,e){return T.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function bG(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return T.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const zi=Object.freeze({x:0,y:0});function xG(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function _G(t,e){const n=ym(t);if(!n)return"0 0";const r={x:(n.x-e.left)/e.width*100,y:(n.y-e.top)/e.height*100};return r.x+"% "+r.y+"%"}function wG(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function SG(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function p2(t){let{left:e,top:n,height:r,width:s}=t;return[{x:e,y:n},{x:e+s,y:n},{x:e,y:n+r},{x:e+s,y:n+r}]}function EG(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}const kG=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=p2(e),o=[];for(const l of r){const{id:d}=l,h=n.get(d);if(h){const p=p2(h),g=s.reduce((y,b,_)=>y+xG(p[_],b),0),m=Number((g/4).toFixed(4));o.push({id:d,data:{droppableContainer:l,value:m}})}}return o.sort(wG)};function jG(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),s=Math.min(e.left+e.width,t.left+t.width),o=Math.min(e.top+e.height,t.top+t.height),l=s-r,d=o-n;if(r<s&&n<o){const h=e.width*e.height,p=t.width*t.height,g=l*d,m=g/(h+p-g);return Number(m.toFixed(4))}return 0}const TG=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=[];for(const o of r){const{id:l}=o,d=n.get(l);if(d){const h=jG(d,e);h>0&&s.push({id:l,data:{droppableContainer:o,value:h}})}}return s.sort(SG)};function NG(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function DO(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:zi}function AG(t){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),o=1;o<r;o++)s[o-1]=arguments[o];return s.reduce((l,d)=>
231({...l,top:l.top+t*d.y,bottom:l.bottom+t*d.y,left:l.left+t*d.x,right:l.right+t*d.x}),{...n})}}const CG=AG(1);function IO(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function RG(t,e,n){const r=IO(e);if(!r)return t;const{scaleX:s,scaleY:o,x:l,y:d}=r,h=t.left-l-(1-s)*parseFloat(n),p=t.top-d-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),g=s?t.width/s:t.width,m=o?t.height/o:t.height;return{width:g,height:m,top:p,right:h+g,bottom:p+m,left:h}}const OG={ignoreTransform:!1};function xh(t,e){e===void 0&&(e=OG);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:p,transformOrigin:g}=wr(t).getComputedStyle(t);p&&(n=RG(n,p,g))}const{top:r,left:s,width:o,height:l,bottom:d,right:h}=n;return{top:r,left:s,width:o,height:l,bottom:d,right:h}}function m2(t){return xh(t,{ignoreTransform:!0})}function DG(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function IG(t,e){return e===void 0&&(e=wr(t).getComputedStyle(t)),e.position==="fixed"}function MG(t,e){e===void 0&&(e=wr(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const o=e[s];return typeof o=="string"?n.test(o):!1})}function w_(t,e){const n=[];function r(s){if(e!=null&&n.length>=e||!s)return n;if(x_(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!yh(s)||CO(s)||n.includes(s))return n;const o=wr(t).getComputedStyle(s);return s!==t&&MG(s,o)&&n.push(s),IG(s,o)?n:r(s.parentNode)}return t?r(t):n}function MO(t){const[e]=w_(t,1);return e??null}function _0(t){return!Km||!t?null:Dc(t)?t:b_(t)?x_(t)||t===Ic(t).scrollingElement?window:yh(t)?t:null:null}function LO(t){return Dc(t)?t.scrollX:t.scrollLeft}function PO(t){return Dc(t)?t.scrollY:t.scrollTop}function rx(t){return{x:LO(t),y:PO(t)}}var Vn;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Vn||(Vn={}));function FO(t){return!Km||!t?!1:t===document.scrollingElement}function $O(t){const e={x:0,y:0},n=FO(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},s=t.scrollTop<=e.y,o=t.scrollLeft<=e.x,l=t.scrollTop>=r.y,d=t.scrollLeft>=r.x;return{isTop:s,isLeft:o,isBottom:l,isRight:d,maxScroll:r,minScroll:e}}const LG={x:.2,y:.2};function PG(t,e,n,r,s){let{top:o,left:l,right:d,bottom:h}=n;r===void 0&&(r=10),s===void 0&&(s=LG);const{isTop:p,isBottom:g,isLeft:m,isRight:y}=$O(t),b={x:0,y:0},_={x:0,y:0},w={height:e.height*s.y,width:e.width*s.x};return!p&&o<=e.top+w.height?(b.y=Vn.Backward,_.y=r*Math.abs((e.top+w.height-o)/w.height)):!g&&h>=e.bottom-w.height&&(b.y=Vn.Forward,_.y=r*Math.abs((e.bottom-w.height-h)/w.height)),!y&&d>=e.right-w.width?(b.x=Vn.Forward,_.x=r*Math.abs((e.right-w.width-d)/w.width)):!m&&l<=e.left+w.width&&(b.x=Vn.Backward,_.x=r*Math.abs((e.left+w.width-l)/w.width)),{direction:b,speed:_}}function FG(t){if(t===document.scrollingElement){const{innerWidth:o,innerHeight:l}=window;return{top:0,left:0,right:o,bottom:l,width:o,height:l}}const{top:e,left:n,right:r,bottom:s}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:s,width:t.clientWidth,height:t.clientHeight}}function UO(t){return t.reduce((e,n)=>pc(e,rx(n)),zi)}function $G(t){return t.reduce((e,n)=>e+LO(n),0)}function UG(t){return t.reduce((e,n)=>e+PO(n),0)}function zO(t,e){if(e===void 0&&(e=xh),!t)return;const{top:n,left:r,bottom:s,right:o}=e(t);MO(t)&&(s<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const zG=[["x",["left","right"],$G],["y",["top","bottom"],UG]];class S_{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=w_(n),s=UO(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[o,l,d]of zG)for(const h of l)Object.defineProperty(this,h,{get:()=>{const p=d(r),g=s[o]-p;return this.rect[h]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class fd{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>
231{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=e}add(e,n,r){var s;(s=this.target)==null||s.addEventListener(e,n,r),this.listeners.push([e,n,r])}}function BG(t){const{EventTarget:e}=wr(t);return t instanceof e?t:Ic(t)}function w0(t,e){const n=Math.abs(t.x),r=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+r**2)>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var mi;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(mi||(mi={}));function g2(t){t.preventDefault()}function HG(t){t.stopPropagation()}var Gt;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(Gt||(Gt={}));const BO={start:[Gt.Space,Gt.Enter],cancel:[Gt.Esc],end:[Gt.Space,Gt.Enter,Gt.Tab]},qG=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case Gt.Right:return{...n,x:n.x+25};case Gt.Left:return{...n,x:n.x-25};case Gt.Down:return{...n,y:n.y+25};case Gt.Up:return{...n,y:n.y-25}}};class E_{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new fd(Ic(n)),this.windowListeners=new fd(wr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(mi.Resize,this.handleCancel),this.windowListeners.add(mi.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(mi.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&zO(r),n(zi)}handleKeyDown(e){if(__(e)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:o=BO,coordinateGetter:l=qG,scrollBehavior:d="smooth"}=s,{code:h}=e;if(o.end.includes(h)){this.handleEnd(e);return}if(o.cancel.includes(h)){this.handleCancel(e);return}const{collisionRect:p}=r.current,g=p?{x:p.left,y:p.top}:zi;this.referenceCoordinates||(this.referenceCoordinates=g);const m=l(e,{active:n,context:r.current,currentCoordinates:g});if(m){const y=vm(m,g),b={x:0,y:0},{scrollableAncestors:_}=r.current;for(const w of _){const S=e.code,{isTop:E,isRight:k,isLeft:j,isBottom:N,maxScroll:O,minScroll:D}=$O(w),F=FG(w),R={x:Math.min(S===Gt.Right?F.right-F.width/2:F.right,Math.max(S===Gt.Right?F.left:F.left+F.width/2,m.x)),y:Math.min(S===Gt.Down?F.bottom-F.height/2:F.bottom,Math.max(S===Gt.Down?F.top:F.top+F.height/2,m.y))},B=S===Gt.Right&&!k||S===Gt.Left&&!j,M=S===Gt.Down&&!N||S===Gt.Up&&!E;if(B&&R.x!==m.x){const V=w.scrollLeft+y.x,W=S===Gt.Right&&V<=O.x||S===Gt.Left&&V>=D.x;if(W&&!y.y){w.scrollTo({left:V,behavior:d});return}W?b.x=w.scrollLeft-V:b.x=S===Gt.Right?w.scrollLeft-O.x:w.scrollLeft-D.x,b.x&&w.scrollBy({left:-b.x,behavior:d});break}else if(M&&R.y!==m.y){const V=w.scrollTop+y.y,W=S===Gt.Down&&V<=O.y||S===Gt.Up&&V>=D.y;if(W&&!y.x){w.scrollTo({top:V,behavior:d});return}W?b.y=w.scrollTop-V:b.y=S===Gt.Down?w.scrollTop-O.y:w.scrollTop-D.y,b.y&&w.scrollBy({top:-b.y,behavior:d});break}}this.handleMove(e,pc(vm(m,this.referenceCoordinates),b))}}}handleMove(e,n){const{onMove:r}=this.props;e.preventDefault(),r(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}E_.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=BO,onActivation:s}=e,{active:o}=n;const{code:l}=t.nativeEvent;if(r.start.includes(l)){const d=o.activatorNode.current;return d&&t.target!==d?!1:(t.preventDefault(),s==null||s({event:t.nativeEvent}),!0)}return!1}}];function v2(t){return!!(t&&"distance"in t)}function y2(t){return!!(t&&"delay"in t)}class k_{constructor(e,n,r){var s;r===void 0&&(r=BG(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:o}=e,{target:l}=o;this.props=e,this.events=n,this.document=Ic(l),this.documentListeners=new fd(this.document),this.listeners=new fd(r),this.windowListeners=new fd(wr(l)),this.initialCoordinates=(s=ym(o))!=null?s:zi,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(mi.Resize,this.handleCancel),this.windowListeners.add(mi.DragStart,g2),this.windowListeners.add(mi.VisibilityChange,this.handleCancel),this.windowListeners.add(mi.ContextMenu,g2),this.documentListeners.add(mi.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(y2(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(v2(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:r,onPending:s}=this.props;s(r,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(mi.Click,HG,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(mi.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:s,props:o}=this,{onMove:l,options:{activationConstraint:d}}=o;if(!s)return;const h=(n=ym(e))!=null?n:zi,p=vm(s,h);if(!r&&d){if(v2(d)){if(d.tolerance!=null&&w0(p,d.tolerance))return this.handleCancel();if(w0(p,d.distance))return this.handleStart()}if(y2(d)&&w0(p,d.tolerance))return this.handleCancel();this.handlePending(d,p);return}e.cancelable&&e.preventDefault(),l(h)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===Gt.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const GG={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};
231class j_ extends k_{constructor(e){const{event:n}=e,r=Ic(n.target);super(e,GG,r)}}j_.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const VG={move:{name:"mousemove"},end:{name:"mouseup"}};var ix;(function(t){t[t.RightClick=2]="RightClick"})(ix||(ix={}));class WG extends k_{constructor(e){super(e,VG,Ic(e.event.target))}}WG.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===ix.RightClick?!1:(r==null||r({event:n}),!0)}}];const S0={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class YG extends k_{constructor(e){super(e,S0)}static setup(){return window.addEventListener(S0.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(S0.move.name,e)};function e(){}}}YG.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;const{touches:s}=n;return s.length>1?!1:(r==null||r({event:n}),!0)}}];var pd;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(pd||(pd={}));var xm;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(xm||(xm={}));function KG(t){let{acceleration:e,activator:n=pd.Pointer,canScroll:r,draggingRect:s,enabled:o,interval:l=5,order:d=xm.TreeOrder,pointerCoordinates:h,scrollableAncestors:p,scrollableAncestorRects:g,delta:m,threshold:y}=t;const b=XG({delta:m,disabled:!o}),[_,w]=aG(),S=T.useRef({x:0,y:0}),E=T.useRef({x:0,y:0}),k=T.useMemo(()=>{switch(n){case pd.Pointer:return h?{top:h.y,bottom:h.y,left:h.x,right:h.x}:null;case pd.DraggableRect:return s}},[n,s,h]),j=T.useRef(null),N=T.useCallback(()=>{const D=j.current;if(!D)return;const F=S.current.x*E.current.x,R=S.current.y*E.current.y;D.scrollBy(F,R)},[]),O=T.useMemo(()=>d===xm.TreeOrder?[...p].reverse():p,[d,p]);T.useEffect(()=>{if(!o||!p.length||!k){w();return}for(const D of O){if((r==null?void 0:r(D))===!1)continue;const F=p.indexOf(D),R=g[F];if(!R)continue;const{direction:B,speed:M}=PG(D,R,k,e,y);for(const V of["x","y"])b[V][B[V]]||(M[V]=0,B[V]=0);if(M.x>0||M.y>0){w(),j.current=D,_(N,l),S.current=M,E.current=B;return}}S.current={x:0,y:0},E.current={x:0,y:0},w()},[e,N,r,w,o,l,JSON.stringify(k),JSON.stringify(b),_,p,O,g,JSON.stringify(y)])}const JG={x:{[Vn.Backward]:!1,[Vn.Forward]:!1},y:{[Vn.Backward]:!1,[Vn.Forward]:!1}};function XG(t){let{delta:e,disabled:n}=t;const r=gm(e);return bh(s=>{if(n||!r||!s)return JG;const o={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[Vn.Backward]:s.x[Vn.Backward]||o.x===-1,[Vn.Forward]:s.x[Vn.Forward]||o.x===1},y:{[Vn.Backward]:s.y[Vn.Backward]||o.y===-1,[Vn.Forward]:s.y[Vn.Forward]||o.y===1}}},[n,e,r])}function ZG(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return bh(s=>{var o;return e==null?null:(o=r??s)!=null?o:null},[r,e])}function QG(t,e){return T.useMemo(()=>t.reduce((n,r)=>{const{sensor:s}=r,o=s.activators.map(l=>({eventName:l.eventName,handler:e(l.handler,r)}));return[...n,...o]},[]),[t,e])}var qd;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(qd||(qd={}));var sx;(function(t){t.Optimized="optimized"})(sx||(sx={}));const b2=new Map;function eV(t,e){let{dragging:n,dependencies:r,config:s}=e;const[o,l]=T.useState(null),{frequency:d,measure:h,strategy:p}=s,g=T.useRef(t),m=S(),y=Bd(m),b=T.useCallback(function(E){E===void 0&&(E=[]),!y.current&&l(k=>k===null?E:k.concat(E.filter(j=>!k.includes(j))))},[y]),_=T.useRef(null),w=bh(E=>{if(m&&!n)return b2;if(!E||E===b2||g.current!==t||o!=null){const k=new Map;for(let j of t){if(!j)continue;if(o&&o.length>0&&!o.includes(j.id)&&j.rect.current){k.set(j.id,j.rect.current);continue}const N=j.node.current,O=N?new S_(h(N),N):null;j.rect.current=O,O&&k.set(j.id,O)}return k}return E},[t,o,n,m,h]);return T.useEffect(()=>{g.current=t},[t]),T.useEffect(()=>{m||b()},[n,m]),T.useEffect(()=>{o&&o.length>0&&l(null)},[JSON.stringify(o)]),T.useEffect(()=>{m||typeof d!="number"||_.current!==null||(_.current=setTimeout(()=>{b(),_.current=null},d))},[d,m,b,...r]),{droppableRects:w,measureDroppableContainers:b,measuringScheduled:o!=null};function S(){switch(p){case qd.Always:return!1;case qd.BeforeDragging:return n;default:return!n}}}function T_(t,e){return bh(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function tV(t,e){return T_(t,e)}function nV(t){let{callback:e,disabled:n}=t;const r=Jm(e),s=T.useMemo(()=>
231{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return T.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Zm(t){let{callback:e,disabled:n}=t;const r=Jm(e),s=T.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return T.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function rV(t){return new S_(xh(t),t)}function x2(t,e,n){e===void 0&&(e=rV);const[r,s]=T.useState(null);function o(){s(h=>{if(!t)return null;if(t.isConnected===!1){var p;return(p=h??n)!=null?p:null}const g=e(t);return JSON.stringify(h)===JSON.stringify(g)?h:g})}const l=nV({callback(h){if(t)for(const p of h){const{type:g,target:m}=p;if(g==="childList"&&m instanceof HTMLElement&&m.contains(t)){o();break}}}}),d=Zm({callback:o});return ta(()=>{o(),t?(d==null||d.observe(t),l==null||l.observe(document.body,{childList:!0,subtree:!0})):(d==null||d.disconnect(),l==null||l.disconnect())},[t]),r}function iV(t){const e=T_(t);return DO(t,e)}const _2=[];function sV(t){const e=T.useRef(t),n=bh(r=>t?r&&r!==_2&&t&&e.current&&t.parentNode===e.current.parentNode?r:w_(t):_2,[t]);return T.useEffect(()=>{e.current=t},[t]),n}function aV(t){const[e,n]=T.useState(null),r=T.useRef(t),s=T.useCallback(o=>{const l=_0(o.target);l&&n(d=>d?(d.set(l,rx(l)),new Map(d)):null)},[]);return T.useEffect(()=>{const o=r.current;if(t!==o){l(o);const d=t.map(h=>{const p=_0(h);return p?(p.addEventListener("scroll",s,{passive:!0}),[p,rx(p)]):null}).filter(h=>h!=null);n(d.length?new Map(d):null),r.current=t}return()=>{l(t),l(o)};function l(d){d.forEach(h=>{const p=_0(h);p==null||p.removeEventListener("scroll",s)})}},[s,t]),T.useMemo(()=>t.length?e?Array.from(e.values()).reduce((o,l)=>pc(o,l),zi):UO(t):zi,[t,e])}function w2(t,e){e===void 0&&(e=[]);const n=T.useRef(null);return T.useEffect(()=>{n.current=null},e),T.useEffect(()=>{const r=t!==zi;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?vm(t,n.current):zi}function oV(t){T.useEffect(()=>{if(!Km)return;const e=t.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of e)n==null||n()}},t.map(e=>{let{sensor:n}=e;return n}))}function lV(t,e){return T.useMemo(()=>t.reduce((n,r)=>{let{eventName:s,handler:o}=r;return n[s]=l=>{o(l,e)},n},{}),[t,e])}function HO(t){return T.useMemo(()=>t?DG(t):null,[t])}const S2=[];function cV(t,e){e===void 0&&(e=xh);const[n]=t,r=HO(n?wr(n):null),[s,o]=T.useState(S2);function l(){o(()=>t.length?t.map(h=>FO(h)?r:new S_(e(h),h)):S2)}const d=Zm({callback:l});return ta(()=>{d==null||d.disconnect(),l(),t.forEach(h=>d==null?void 0:d.observe(h))},[t]),s}function qO(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return yh(e)?e:t}function uV(t){let{measure:e}=t;const[n,r]=T.useState(null),s=T.useCallback(p=>{for(const{target:g}of p)if(yh(g)){r(m=>{const y=e(g);return m?{...m,width:y.width,height:y.height}:y});break}},[e]),o=Zm({callback:s}),l=T.useCallback(p=>{const g=qO(p);o==null||o.disconnect(),g&&(o==null||o.observe(g)),r(g?e(g):null)},[e,o]),[d,h]=mm(l);return T.useMemo(()=>({nodeRef:d,rect:n,setRef:h}),[n,d,h])}const dV=[{sensor:j_,options:{}},{sensor:E_,options:{}}],hV={current:{}},Np={draggable:{measure:m2},droppable:{measure:m2,strategy:qd.WhileDragging,frequency:sx.Optimized},dragOverlay:{measure:xh}};class md extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,r;return(n=(r=this.get(e))==null?void 0:r.node.current)!=null?n:void 0}}const fV={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new md,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:bm},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Np,measureDroppableContainers:bm,windowRect:null,measuringScheduled:!1},GO={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:bm,draggableNodes:new Map,over:null,measureDroppableContainers:bm},_h=T.createContext(GO),VO=T.createContext(fV);function pV(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new md}}}function mV(t,e){switch(e.type){case zn.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case zn.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case zn.DragEnd:case zn.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case zn.RegisterDroppable:{const{element:n}=e,{id:r}
231=n,s=new md(t.droppable.containers);return s.set(r,n),{...t,droppable:{...t.droppable,containers:s}}}case zn.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=e,o=t.droppable.containers.get(n);if(!o||r!==o.key)return t;const l=new md(t.droppable.containers);return l.set(n,{...o,disabled:s}),{...t,droppable:{...t.droppable,containers:l}}}case zn.UnregisterDroppable:{const{id:n,key:r}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const o=new md(t.droppable.containers);return o.delete(n),{...t,droppable:{...t.droppable,containers:o}}}default:return t}}function gV(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:s}=T.useContext(_h),o=gm(r),l=gm(n==null?void 0:n.id);return T.useEffect(()=>{if(!e&&!r&&o&&l!=null){if(!__(o)||document.activeElement===o.target)return;const d=s.get(l);if(!d)return;const{activatorNode:h,node:p}=d;if(!h.current&&!p.current)return;requestAnimationFrame(()=>{for(const g of[h.current,p.current]){if(!g)continue;const m=cG(g);if(m){m.focus();break}}})}},[r,e,s,l,o]),null}function WO(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((s,o)=>o({transform:s,...r}),n):n}function vV(t){return T.useMemo(()=>({draggable:{...Np.draggable,...t==null?void 0:t.draggable},droppable:{...Np.droppable,...t==null?void 0:t.droppable},dragOverlay:{...Np.dragOverlay,...t==null?void 0:t.dragOverlay}}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function yV(t){let{activeNode:e,measure:n,initialRect:r,config:s=!0}=t;const o=T.useRef(!1),{x:l,y:d}=typeof s=="boolean"?{x:s,y:s}:s;ta(()=>
231{if(!l&&!d||!e){o.current=!1;return}if(o.current||!r)return;const p=e==null?void 0:e.node.current;if(!p||p.isConnected===!1)return;const g=n(p),m=DO(g,r);if(l||(m.x=0),d||(m.y=0),o.current=!0,Math.abs(m.x)>0||Math.abs(m.y)>0){const y=MO(p);y&&y.scrollBy({top:m.y,left:m.x})}},[e,l,d,r,n])}const Qm=T.createContext({...zi,scaleX:1,scaleY:1});var Oa;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Oa||(Oa={}));const bV=T.memo(function(e){var n,r,s,o;let{id:l,accessibility:d,autoScroll:h=!0,children:p,sensors:g=dV,collisionDetection:m=TG,measuring:y,modifiers:b,..._}=e;const w=T.useReducer(mV,void 0,pV),[S,E]=w,[k,j]=mG(),[N,O]=T.useState(Oa.Uninitialized),D=N===Oa.Initialized,{draggable:{active:F,nodes:R,translate:B},droppable:{containers:M}}=S,V=F!=null?R.get(F):null,W=T.useRef({initial:null,translated:null}),Q=T.useMemo(()=>{var pe;return F!=null?{id:F,data:(pe=V==null?void 0:V.data)!=null?pe:hV,rect:W}:null},[F,V]),K=T.useRef(null),[te,I]=T.useState(null),[H,G]=T.useState(null),re=Bd(_,Object.values(_)),U=Xm("DndDescribedBy",l),A=T.useMemo(()=>M.getEnabled(),[M]),$=vV(y),{droppableRects:P,measureDroppableContainers:q,measuringScheduled:z}=eV(A,{dragging:D,dependencies:[B.x,B.y],config:$.droppable}),X=ZG(R,F),se=T.useMemo(()=>H?ym(H):null,[H]),ne=Pr(),ie=tV(X,$.draggable.measure);yV({activeNode:F!=null?R.get(F):null,config:ne.layoutShiftCompensation,initialRect:ie,measure:$.draggable.measure});const fe=x2(X,$.draggable.measure,ie),_e=x2(X?X.parentElement:null),Te=T.useRef({activatorEvent:null,active:null,activeNode:X,collisionRect:null,collisions:null,droppableRects:P,draggableNodes:R,draggingNode:null,draggingNodeRect:null,droppableContainers:M,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Oe=M.getNodeFor((n=Te.current.over)==null?void 0:n.id),xe=uV({measure:$.dragOverlay.measure}),Ge=(r=xe.nodeRef.current)!=null?r:X,Le=D?(s=xe.rect)!=null?s:fe:null,mt=!!(xe.nodeRef.current&&xe.rect),Et=iV(mt?null:fe),Jt=HO(Ge?wr(Ge):null),wt=sV(D?Oe??X:null),Xt=cV(wt),ur=WO(b,{transform:{x:B.x-Et.x,y:B.y-Et.y,scaleX:1,scaleY:1},activatorEvent:H,active:Q,activeNodeRect:fe,containerNodeRect:_e,draggingNodeRect:Le,over:Te.current.over,overlayNodeRect:xe.rect,scrollableAncestors:wt,scrollableAncestorRects:Xt,windowRect:Jt}),jn=se?pc(se,B):null,Zt=aV(wt),nr=w2(Zt),dr=w2(Zt,[fe]),rr=pc(ur,nr),Mn=Le?CG(Le,ur):null,on=Q&&Mn?m({active:Q,collisionRect:Mn,droppableRects:P,droppableContainers:A,pointerCoordinates:jn}):null,zt=EG(on,"id"),[Ln,hr]=T.useState(null),fr=mt?ur:pc(ur,dr),Pn=NG(fr,(o=Ln==null?void 0:Ln.rect)!=null?o:null,fe),Nt=T.useRef(null),yn=T.useCallback((pe,Ue)=>{let{sensor:He,options:Bt}=Ue;if(K.current==null)return;const Fn=R.get(K.current);if(!Fn)return;const bn=pe.nativeEvent,dn=new He({active:K.current,activeNode:Fn,event:bn,options:Bt,context:Te,onAbort(kt){if(!R.get(kt))return;const{onDragAbort:xn}=re.current,Y={id:kt};xn==null||xn(Y),k({type:"onDragAbort",event:Y})},onPending(kt,$n,xn,Y){if(!R.get(kt))return;const{onDragPending:oe}=re.current,ge={id:kt,constraint:$n,initialCoordinates:xn,offset:Y};oe==null||oe(ge),k({type:"onDragPending",event:ge})},onStart(kt){const $n=K.current;if($n==null)return;const xn=R.get($n);if(!xn)return;const{onDragStart:Y}=re.current,Z={activatorEvent:bn,active:{id:$n,data:xn.data,rect:W}};tc.unstable_batchedUpdates(()=>{Y==null||Y(Z),O(Oa.Initializing),E({type:zn.DragStart,initialCoordinates:kt,active:$n}),k({type:"onDragStart",event:Z}),I(Nt.current),G(bn)})},onMove(kt){E({type:zn.DragMove,coordinates:kt})},onEnd:dt(zn.DragEnd),onCancel:dt(zn.DragCancel)});Nt.current=dn;function dt(kt){return async function(){const{active:xn,collisions:Y,over:Z,scrollAdjustedTranslate:oe}=Te.current;let ge=null;if(xn&&oe){const{cancelDrop:ye}=re.current;ge={activatorEvent:bn,active:xn,collisions:Y,delta:oe,over:Z},kt===zn.DragEnd&&typeof ye=="function"&&await Promise.resolve(ye(ge))&&(kt=zn.DragCancel)}K.current=null,tc.unstable_batchedUpdates(()=>{E({type:kt}),O(Oa.Uninitialized),hr(null),I(null),G(null),Nt.current=null;const ye=kt===zn.DragEnd?"onDragEnd":"onDragCancel";if(ge){const Ce=re.current[ye];Ce==null||Ce(ge),k({type:ye,event:ge})}})}}},[R]),ei=T.useCallback((pe,Ue)=>(He,Bt)=>{const Fn=He.nativeEvent,bn=R.get(Bt);if(K.current!==null||!bn||Fn.dndKit||Fn.defaultPrevented)return;const dn={active:bn};pe(He,Ue.options,dn)===!0&&(Fn.dndKit={capturedBy:Ue.sensor},K.current=Bt,yn(He,Ue))},[R,yn]),cs=QG(g,ei);oV(g),ta(()=>{fe&&N===Oa.Initializing&&O(Oa.Initialized)},[fe,N]),T.useEffect(()=>{const{onDragMove:pe}=re.current,{active:Ue,activatorEvent:He,collisions:Bt,over:Fn}=Te.current;if(!Ue||!He)return;const bn={active:Ue,activatorEvent:He,collisions:Bt,delta:{x:rr.x,y:rr.y},over:Fn};tc.unstable_batchedUpdates(()=>{pe==null||pe(bn),k({type:"onDragMove",event:bn})})},[rr.x,rr.y]),T.useEffect(()=>{const{active:pe,activatorEvent:Ue,collisions:He,droppableContainers:Bt,scrollAdjustedTranslate:Fn}=Te.current;
231if(!pe||K.current==null||!Ue||!Fn)return;const{onDragOver:bn}=re.current,dn=Bt.get(zt),dt=dn&&dn.rect.current?{id:dn.id,rect:dn.rect.current,data:dn.data,disabled:dn.disabled}:null,kt={active:pe,activatorEvent:Ue,collisions:He,delta:{x:Fn.x,y:Fn.y},over:dt};tc.unstable_batchedUpdates(()=>{hr(dt),bn==null||bn(kt),k({type:"onDragOver",event:kt})})},[zt]),ta(()=>{Te.current={activatorEvent:H,active:Q,activeNode:X,collisionRect:Mn,collisions:on,droppableRects:P,draggableNodes:R,draggingNode:Ge,draggingNodeRect:Le,droppableContainers:M,over:Ln,scrollableAncestors:wt,scrollAdjustedTranslate:rr},W.current={initial:Le,translated:Mn}},[Q,X,on,Mn,R,Ge,Le,P,M,Ln,wt,rr]),KG({...ne,delta:B,draggingRect:Mn,pointerCoordinates:jn,scrollableAncestors:wt,scrollableAncestorRects:Xt});const sa=T.useMemo(()=>({active:Q,activeNode:X,activeNodeRect:fe,activatorEvent:H,collisions:on,containerNodeRect:_e,dragOverlay:xe,draggableNodes:R,droppableContainers:M,droppableRects:P,over:Ln,measureDroppableContainers:q,scrollableAncestors:wt,scrollableAncestorRects:Xt,measuringConfiguration:$,measuringScheduled:z,windowRect:Jt}),[Q,X,fe,H,on,_e,xe,R,M,P,Ln,q,wt,Xt,$,z,Jt]),Ei=T.useMemo(()=>({activatorEvent:H,activators:cs,active:Q,activeNodeRect:fe,ariaDescribedById:{draggable:U},dispatch:E,draggableNodes:R,over:Ln,measureDroppableContainers:q}),[H,cs,Q,fe,E,U,R,Ln,q]);return Ut.createElement(OO.Provider,{value:j},Ut.createElement(_h.Provider,{value:Ei},Ut.createElement(VO.Provider,{value:sa},Ut.createElement(Qm.Provider,{value:Pn},p)),Ut.createElement(gV,{disabled:(d==null?void 0:d.restoreFocus)===!1})),Ut.createElement(yG,{...d,hiddenTextDescribedById:U}));function Pr(){const pe=(te==null?void 0:te.autoScrollEnabled)===!1,Ue=typeof h=="object"?h.enabled===!1:h===!1,He=D&&!pe&&!Ue;return typeof h=="object"?{...h,enabled:He}:{enabled:He}}}),xV=T.createContext(null),E2="button",_V="Draggable";function wV(t){let{id:e,data:n,disabled:r=!1,attributes:s}=t;const o=Xm(_V),{activators:l,activatorEvent:d,active:h,activeNodeRect:p,ariaDescribedById:g,draggableNodes:m,over:y}=T.useContext(_h),{role:b=E2,roleDescription:_="draggable",tabIndex:w=0}=s??{},S=(h==null?void 0:h.id)===e,E=T.useContext(S?Qm:xV),[k,j]=mm(),[N,O]=mm(),D=lV(l,e),F=Bd(n);ta(()=>(m.set(e,{id:e,key:o,node:k,activatorNode:N,data:F}),()=>{const B=m.get(e);B&&B.key===o&&m.delete(e)}),[m,e]);const R=T.useMemo(()=>({role:b,tabIndex:w,"aria-disabled":r,"aria-pressed":S&&b===E2?!0:void 0,"aria-roledescription":_,"aria-describedby":g.draggable}),[r,b,w,S,_,g.draggable]);return{active:h,activatorEvent:d,activeNodeRect:p,attributes:R,isDragging:S,listeners:r?void 0:D,node:k,over:y,setNodeRef:j,setActivatorNodeRef:O,transform:E}}function SV(){return T.useContext(VO)}const EV="Droppable",kV={timeout:25};function jV(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:s}=t;const o=Xm(EV),{active:l,dispatch:d,over:h,measureDroppableContainers:p}=T.useContext(_h),g=T.useRef({disabled:n}),m=T.useRef(!1),y=T.useRef(null),b=T.useRef(null),{disabled:_,updateMeasurementsFor:w,timeout:S}={...kV,...s},E=Bd(w??r),k=T.useCallback(()=>{if(!m.current){m.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{p(Array.isArray(E.current)?E.current:[E.current]),b.current=null},S)},[S]),j=Zm({callback:k,disabled:_||!l}),N=T.useCallback((R,B)=>{j&&(B&&(j.unobserve(B),m.current=!1),R&&j.observe(R))},[j]),[O,D]=mm(N),F=Bd(e);return T.useEffect(()=>{!j||!O.current||(j.disconnect(),m.current=!1,j.observe(O.current))},[O,j]),T.useEffect(()=>(d({type:zn.RegisterDroppable,element:{id:r,key:o,disabled:n,node:O,rect:y,data:F}}),()=>d({type:zn.UnregisterDroppable,key:o,id:r})),[r]),T.useEffect(()=>{n!==g.current.disabled&&(d({type:zn.SetDroppableDisabled,id:r,key:o,disabled:n}),g.current.disabled=n)},[r,o,n,d]),{active:l,rect:y,isOver:(h==null?void 0:h.id)===r,node:O,over:h,setNodeRef:D}}function TV(t){let{animation:e,children:n}=t;const[r,s]=T.useState(null),[o,l]=T.useState(null),d=gm(n);return!n&&!r&&d&&s(d),ta(()=>{if(!o)return;const h=r==null?void 0:r.key,p=r==null?void 0:r.props.id;if(h==null||p==null){s(null);return}Promise.resolve(e(p,o)).then(()=>{s(null)})},[e,r,o]),Ut.createElement(Ut.Fragment,null,n,r?T.cloneElement(r,{ref:l}):null)}const NV={x:0,y:0,scaleX:1,scaleY:1};function AV(t){let{children:e}=t;return Ut.createElement(_h.Provider,{value:GO},Ut.createElement(Qm.Provider,{value:NV},e))}const CV={position:"fixed",touchAction:"none"},RV=t=>
231__(t)?"transform 250ms ease":void 0,OV=T.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:s,children:o,className:l,rect:d,style:h,transform:p,transition:g=RV}=t;if(!d)return null;const m=s?p:{...p,scaleX:1,scaleY:1},y={...CV,width:d.width,height:d.height,top:d.top,left:d.left,transform:Hd.Transform.toString(m),transformOrigin:s&&r?_G(r,d):void 0,transition:typeof g=="function"?g(r):g,...h};return Ut.createElement(n,{className:l,style:y,ref:e},o)}),DV=t=>e=>{let{active:n,dragOverlay:r}=e;const s={},{styles:o,className:l}=t;if(o!=null&&o.active)for(const[d,h]of Object.entries(o.active))h!==void 0&&(s[d]=n.node.style.getPropertyValue(d),n.node.style.setProperty(d,h));if(o!=null&&o.dragOverlay)for(const[d,h]of Object.entries(o.dragOverlay))h!==void 0&&r.node.style.setProperty(d,h);return l!=null&&l.active&&n.node.classList.add(l.active),l!=null&&l.dragOverlay&&r.node.classList.add(l.dragOverlay),function(){for(const[h,p]of Object.entries(s))n.node.style.setProperty(h,p);l!=null&&l.active&&n.node.classList.remove(l.active)}},IV=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:Hd.Transform.toString(e)},{transform:Hd.Transform.toString(n)}]},MV={duration:250,easing:"ease",keyframes:IV,sideEffects:DV({styles:{active:{opacity:"0"}}})};function LV(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:s}=t;return Jm((o,l)=>{if(e===null)return;const d=n.get(o);if(!d)return;const h=d.node.current;if(!h)return;const p=qO(l);if(!p)return;const{transform:g}=wr(l).getComputedStyle(l),m=IO(g);if(!m)return;const y=typeof e=="function"?e:PV(e);return zO(h,s.draggable.measure),y({active:{id:o,data:d.data,node:h,rect:s.draggable.measure(h)},draggableNodes:n,dragOverlay:{node:l,rect:s.dragOverlay.measure(p)},droppableContainers:r,measuringConfiguration:s,transform:m})})}function PV(t){const{duration:e,easing:n,sideEffects:r,keyframes:s}={...MV,...t};return o=>{let{active:l,dragOverlay:d,transform:h,...p}=o;if(!e)return;const g={x:d.rect.left-l.rect.left,y:d.rect.top-l.rect.top},m={scaleX:h.scaleX!==1?l.rect.width*h.scaleX/d.rect.width:1,scaleY:h.scaleY!==1?l.rect.height*h.scaleY/d.rect.height:1},y={x:h.x-g.x,y:h.y-g.y,...m},b=s({...p,active:l,dragOverlay:d,transform:{initial:h,final:y}}),[_]=b,w=b[b.length-1];if(JSON.stringify(_)===JSON.stringify(w))return;const S=r==null?void 0:r({active:l,dragOverlay:d,...p}),E=d.node.animate(b,{duration:e,easing:n,fill:"forwards"});return new Promise(k=>{E.onfinish=()=>{S==null||S(),k()}})}}let k2=0;function FV(t){return T.useMemo(()=>{if(t!=null)return k2++,k2},[t])}const $V=Ut.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:r,style:s,transition:o,modifiers:l,wrapperElement:d="div",className:h,zIndex:p=999}=t;const{activatorEvent:g,active:m,activeNodeRect:y,containerNodeRect:b,draggableNodes:_,droppableContainers:w,dragOverlay:S,over:E,measuringConfiguration:k,scrollableAncestors:j,scrollableAncestorRects:N,windowRect:O}=SV(),D=T.useContext(Qm),F=FV(m==null?void 0:m.id),R=WO(l,{activatorEvent:g,active:m,activeNodeRect:y,containerNodeRect:b,draggingNodeRect:S.rect,over:E,overlayNodeRect:S.rect,scrollableAncestors:j,scrollableAncestorRects:N,transform:D,windowRect:O}),B=T_(y),M=LV({config:r,draggableNodes:_,droppableContainers:w,measuringConfiguration:k}),V=B?S.setRef:void 0;return Ut.createElement(AV,null,Ut.createElement(TV,{animation:M},m&&F?Ut.createElement(OV,{key:F,id:m.id,ref:V,as:d,activatorEvent:g,adjustScale:e,className:h,transition:o,rect:B,style:{zIndex:p,...s},transform:R},n):null))}),YO={strong:{label:"Strong",color:"#1D9E75"},solid:{label:"Solid",color:"#3B82F6"},stretch:{label:"Stretch",color:"#F59E0B"},not_a_fit:{label:"Not a fit",color:"#EF4444"}},sp={not_a_fit:0,stretch:1,solid:2,strong:3};function UV({band:t}){const e=YO[t];return u.jsxs("span",{title:e.label,className:"shrink-0 inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[11px] font-semibold uppercase tracking-wide whitespace-nowrap",style:{color:e.color,background:`${e.color}14`,border:`1px solid ${e.color}40`},children:[u.jsx("span",{"aria-hidden":"true",className:"w-1.5 h-1.5 rounded-full",style:{background:e.color}}),e.label]})}const zV=["applied","interviewing","offer"];function BV(){const{user:t}=hn(),[e,n]=T.useState([]),[r,s]=T.useState(!0);T.useEffect(()=>{let l=!1;if(!t){n([]),s(!1);return}return s(!0),Ye.from("job_closure_events").select("id, job_id, stage_at_closure").eq("user_id",t.id).is("dismissed_at",null).in("stage_at_closure",zV).order("detected_at",{ascending:!1}).then(({data:d})=>{l||(n(d??[]),s(!1))}),()=>{l=!0}},[t]);const o=T.useCallback(async()=>
231{if(e.length===0)return;const l=e.map(h=>h.id);n([]);const{error:d}=await Ye.from("job_closure_events").update({dismissed_at:new Date().toISOString()}).in("id",l);d&&console.error("closure digest dismiss failed",d)},[e]);return{events:e,loading:r,dismiss:o}}const HV=[10,16,22,30],qV=["0s","0.2s","0.4s","0.6s"];function GV({message:t}){return u.jsxs("div",{role:"alert",className:"mb-4 shrink-0 flex flex-col items-center gap-3 px-3 py-5 rounded-lg",children:[u.jsx("style",{children:`
232        @keyframes sf-signal-not-found-bars {
233          0%, 100% { transform: scaleY(1);   opacity: 1;   }
234          50%      { transform: scaleY(0.3); opacity: 0.2; }
235        }
236      `}),u.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:4,height:30},children:HV.map((e,n)=>u.jsx("div",{className:"bg-gray-400 dark:bg-[#8899AA]",style:{width:6,height:e,borderRadius:2,transformOrigin:"bottom",animation:"sf-signal-not-found-bars 1.6s ease-in-out infinite",animationDelay:qV[n]}},n))}),u.jsx("p",{className:"m-0 text-sm font-medium text-gray-500 dark:text-[#8899AA]",children:"Signal not found"}),u.jsx("p",{className:"m-0 text-[13px] text-center leading-normal text-gray-400 dark:text-[#8899AA]/65",children:t})]})}const _m=["saved","applied","interviewing","offer","rejected"],N_={saved:"Saved",applied:"Applied",interviewing:"Interviewing",offer:"Offer",rejected:"Rejected"};function VV(t,e){var l,d,h,p,g,m,y,b,_;const n=t.job;if(!n)return null;let r=0,s=0;if(e.work_type&&e.work_type!=="any"&&(s++,n.work_type===e.work_type&&r++),e.salary_min&&n.salary_min&&(s++,n.salary_min>=e.salary_min*1e3&&r++),e.seniority.length>0&&(n.seniority||n.job_title)){s++;const w={ic:["associate","senior","staff","principal","individual contributor"],manager:["manager","lead","team lead"],director:["director","senior director"],vp:["vp","vice president","head of"],csuite:["chief","cto","cpo","cro","coo","ceo","president"]},S=e.seniority.flatMap(j=>w[j]??[]),E=((l=n.seniority)==null?void 0:l.toLowerCase())??"",k=((d=n.job_title)==null?void 0:d.toLowerCase())??"";S.some(j=>E.includes(j)||k.includes(j))&&r++}if((h=e.industries_yes)!=null&&h.length&&e.industries_yes[0]!=="any"){const w=((g=(p=n.company)==null?void 0:p.industry)==null?void 0:g.toLowerCase())??"";w&&(s++,e.industries_yes.some(S=>w.includes(S.toLowerCase()))&&r++,(m=e.industries_no)!=null&&m.some(S=>w.includes(S.toLowerCase()))&&(r=Math.max(0,r-1)))}if((y=e.company_stages)!=null&&y.length&&!e.company_stages.includes("any")){const w=((_=(b=n.company)==null?void 0:b.last_funding_type)==null?void 0:_.toLowerCase())??"";if(w){s++;const S={seed:["seed","pre-seed","angel"],"series a-b":["series_a","series_b","series a","series b"],"series c+":["series_c","series_d","series_e","series c","series d"],public:["post_ipo","post-ipo","ipo"]};e.company_stages.some(k=>(S[k.toLowerCase()]??[]).some(N=>w.includes(N)))&&r++}}if(s===0)return null;const o=r/s;return o>=.7?"strong":o>=.4?"partial":null}function WV({match:t}){if(!t)return null;const e=t==="strong";return u.jsx("span",{title:e?"Matches your goals":"Partially matches your goals","aria-label":e?"Matches your goals":"Partially matches your goals",className:`shrink-0 inline-flex items-center justify-center ${e?"text-[#1D9E75]":"text-gray-400 dark:text-white/30"}`,style:{filter:e?"drop-shadow(0 0 4px rgba(29,158,117,0.6))":void 0},children:u.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[u.jsx("circle",{cx:"12",cy:"12",r:"10"}),u.jsx("circle",{cx:"12",cy:"12",r:"6"}),u.jsx("circle",{cx:"12",cy:"12",r:"2"})]})})}function YV(t,e){if(e==="offer"){$i({particleCount:200,spread:90,origin:{y:.6},colors:["#1D9E75","#ffffff","#0A1628","#34d399","#6ee7b7"]}),setTimeout(()=>{$i({particleCount:100,angle:60,spread:55,origin:{x:0},colors:["#1D9E75","#ffffff","#34d399"]})},200),setTimeout(()=>{$i({particleCount:100,angle:120,spread:55,origin:{x:1},colors:["#1D9E75","#ffffff","#34d399"]})},400);return}if(t==="applied"&&e==="interviewing"){$i({particleCount:40,spread:50,origin:{y:.3}
236,gravity:1.2,colors:["#1D9E75","#ffffff","#34d399"],scalar:.8});return}}const Gd={saved:"#1D9E75",applied:"#3B82F6",interviewing:"#F59E0B",offer:"#10B981",rejected:"#EF4444"};function KO(t){return Math.floor((Date.now()-new Date(t).getTime())/(1e3*60*60*24))}function j2(t){const e=KO(t);return e<=0?"Today":e===1?"1d ago":`${e}d ago`}const Hl=["remote","hybrid","onsite"];function Xi({active:t,onClick:e,children:n,ariaLabel:r}){return u.jsx("button",{type:"button",onClick:e,"aria-label":r,"aria-pressed":t,className:`px-2 py-0.5 text-xs font-medium rounded-md transition-colors border ${t?"bg-[#1D9E75] text-white border-[#1D9E75]":"bg-transparent text-gray-500 border-gray-300 hover:text-gray-900 hover:border-gray-400 dark:text-white/50 dark:border-white/20 dark:hover:text-white dark:hover:border-white/40"}`,children:n})}function Bu({label:t,children:e}){return u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:"text-[10px] uppercase tracking-wide text-gray-400 dark:text-white/40",children:t}),u.jsx("div",{className:"flex items-center gap-1",children:e})]})}function ax({url:t,name:e,size:n=40}){if(t)return u.jsx("img",{src:t,alt:e??"",className:"rounded-lg object-cover shrink-0 bg-gray-100 dark:bg-[#162440]",style:{width:n,height:n}});const r=(e??"?").trim().charAt(0).toUpperCase();return u.jsx("div",{className:"rounded-lg shrink-0 flex items-center justify-center font-semibold text-white bg-[#1D9E75]",style:{width:n,height:n,fontSize:n<=40?14:18},children:r})}function JO(){return u.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u.jsx("rect",{width:"20",height:"5",x:"2",y:"3",rx:"1"}),u.jsx("path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8"}),u.jsx("path",{d:"M10 12h4"})]})}function XO(){return u.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u.jsx("path",{d:"M7 17 17 7"}),u.jsx("path",{d:"M7 7h10v10"})]})}function KV(){return u.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u.jsx("path",{d:"M21 12a9 9 0 1 1-2.64-6.36"}),u.jsx("path",{d:"M21 3v6h-6"})]})}function JV({size:t=16}){return u.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u.jsx("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2"}),u.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}function XV(){return u.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:[u.jsx("circle",{cx:"9",cy:"5",r:"1.6"}),u.jsx("circle",{cx:"15",cy:"5",r:"1.6"}),u.jsx("circle",{cx:"9",cy:"12",r:"1.6"}),u.jsx("circle",{cx:"15",cy:"12",r:"1.6"}),u.jsx("circle",{cx:"9",cy:"19",r:"1.6"}),u.jsx("circle",{cx:"15",cy:"19",r:"1.6"})]})}const T2=[{value:1,emoji:"👎",color:"#EF4444"},{value:3,emoji:"😐",color:"#F59E0B"},{value:5,emoji:"👍",color:"#1D9E75"}];function eg({tracking:t,onArchive:e,onRate:n,interactive:r,goalsMatch:s,readOnly:o=!1}){var R,B;const{analyzingJobIds:l}=Ka(),[d,h]=T.useState(!1),[p,g]=T.useState(t.user_rating),m=T.useRef(null);T.useEffect(()=>{g(t.user_rating)},[t.user_rating]),T.useEffect(()=>{if(!d)return;const M=V=>{m.current&&!m.current.contains(V.target)&&h(!1)};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[d]);const y=M=>{const V=p===M?null:M;g(V),n(t.id,V),h(!1),V===5&&$i({particleCount:25,spread:40,origin:{y:.6},gravity:1.5,scalar:.6,colors:["#1D9E75","#ffffff","#34d399"]})},b=p!=null?T2.find(M=>M.value===p)??null:null,_=(b==null?void 0:b.emoji)??null,w=t.job,S=w==null?void 0:w.company,E=((B=(R=w==null?void 0:w.analysis)==null?void 0:R[0])==null?void 0:B.qualification_band)??null,k=(w==null?void 0:w.source_url)??null,j=j2(t.created_at),N=(w==null?void 0:w.is_active)===!1,O=t.stage==="saved"||t.stage==="applied",D=N&&O,F=N&&(w!=null&&w.closed_at)?j2(w.closed_at):null;return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-start gap-2.5",children:[r&&u.jsx("span",{className:"shrink-0 self-stretch flex items-center transition-colors text-gray-300 group-hover:text-gray-500 dark:text-white/20 dark:group-hover:text-white/60",children:u.jsx(XV,{})}),u.jsx(ax,{url:(S==null?void 0:S.logo_url)??null,name:(S==null?void 0:S.name)??null}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("p",{className:"text-[11px] truncate leading-tight text-gray-500 dark:text-[#8899AA]",children:(S==null?void 0:S.name)??"Unknown company"}),u.jsx("p",{className:"text-[13px] font-semibold leading-snug line-clamp-2 mt-0.5 text-gray-900 dark:text-[#F0F4F8]",children:(w==null?void 0:w.job_title)??"Untitled role"})]}),u.jsxs("div",{className:"shrink-0 flex items-center gap-1.5",children:[u.jsx(WV,{match:s}),(r||o)&&k&&u.jsx("a",{href:k,target:"_blank",rel:"noopener noreferrer",title:"View job posting","aria-label":"View job posting",onPointerDown:M=>M.stopPropagation(),onClick:M=>M.stopPropagation(),className:"transition-colors text-gray-400 hover:text-gray-900 dark:text-white/40 dark:hover:text-[#F0F4F8]",children:u.jsx(XO,{})})]})]}),D&&u.jsx("div",{className:"mt-1.5",children:u.jsx("span",{className:"inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium bg-gray-100 text-gray-500 dark:bg-white/10 dark:text-white/50",children:"No longer accepting applications"})}),o&&_&&u.jsx("div",{className:"mt-1",children:u.jsx("span",{"aria-label":`Rated ${_}`,className:"rounded-lg flex items-center justify-center",style:{width:22,height:22,background:"transparent",border:`1px solid ${(b==null?void 0:b.color)??"#1D9E75"}`,fontSize:13,lineHeight:1},children:_})}),r&&u.jsx("div",{ref:m,className:"mt-1",children:d?u.jsx("div",{className:"flex items-center gap-1",children:T2.map(M=>{const V=p===M.value;return u.jsx("button",{type:"button","aria-label":`Rate ${M.emoji}`,"aria-pressed":V,onPointerDown:W=>W.stopPropagation(),onClick:W=>{W.stopPropagation(),y(M.value)},className:`w-6 h-6 rounded-lg flex items-center justify-center text-sm transition-colors border ${V?"":"bg-transparent border-gray-300 dark:border-white/15"}`,style:V?{background:M.color,borderColor:M.color}:void 0,children:M.emoji},M.value)})}):_?u.jsx("button",{type:"button","aria-label":`Rated ${_} — change rating`,onPointerDown:M=>M.stopPropagation(),onClick:M=>{M.stopPropagation(),h(!0)},className:"rounded-lg flex items-center justify-center transition-colors",style:{width:22,height:22,background:"transparent",border:`1px solid ${(b==null?void 0:b.color)??"#1D9E75"}`,fontSize:13,lineHeight:1},children:_}):u.jsx("button",{onClick:M=>{M.stopPropagation(),h(!0)},onPointerDown:M=>M.stopPropagation(),style:{width:22,height:22,background:"transparent",border:"none",padding:0,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},className:"opacity-0 group-hover:opacity-100 transition-opacity","aria-label":"Rate this job",children:u.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-gray-400 dark:text-white/30",children:u.jsx("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})})})}),u.jsxs("div",{className:"flex items-center justify-between gap-2 mt-1",children:[u.jsx("span",{className:"text-xs text-gray-400 dark:text-white/30",children:N&&F?`Closed ${F}`:N?"Closed":j}),u.jsxs("div",{className:"flex items-center gap-2",children:[E?u.jsx(UV,{band:E}):l.has(t.job_id)||Wm(t)?u.jsxs("span",{className:"text-xs flex items-center gap-1.5 text-gray-400 dark:text-white/30",children:[u.jsx("span",{className:"w-3 h-3 border-2 border-gray-300 border-t-[#1D9E75] rounded-full animate-spin dark:border-white/15 dark:border-t-[#1D9E75]"}),u.jsx("span",{children:"Analyzing…"})]}):null,r&&u.jsx("button",{type:"button",title:"Archive","aria-label":"Archive",onPointerDown:M=>M.stopPropagation(),onClick:M=>{M.stopPropagation(),e()},className:"opacity-0 group-hover:opacity-100 transition-all text-gray-400 hover:text-red-500 dark:text-white/30 dark:hover:text-red-400",children:u.jsx(JO,{})})]})]})]})}function ZV({tracking:t,onMove:e,onArchive:n,onRate:r,onOpen:s,goalsMatch:o}){var m;const{attributes:l,listeners:d,setNodeRef:h,isDragging:p}=wV({id:t.id,data:{stage:t.stage}}),g=((m=t.job)==null?void 0:m.is_active)===!1&&(t.stage==="saved"||t.stage==="applied");return u.jsx("div",{ref:h,...l,...d,onClick:s,className:"group relative flex flex-col gap-2 p-3 rounded-lg border transition-all duration-150 hover:-translate-y-0.5 hover:shadow-lg bg-white border-gray-200 hover:border-[#1D9E75]/50 hover:shadow-gray-300/40 dark:bg-[#0A1628] dark:border-white/10 dark:hover:border-[#1D9E75]/50 dark:hover:shadow-black/30",style:{opacity:p?.3:g?.6:1,cursor:p?"grabbing":"grab",touchAction:"none"},children:u.jsx(eg,{tracking:t,onMove:e,onArchive:n,onRate:r,interactive:!0,goalsMatch:o})})}function QV({tracking:t,goalsMatch:e}){return u.jsx("div",{className:"group relative flex flex-col gap-2 p-3 rounded-lg shadow-2xl bg-white border border-[#1D9E75]/50 dark:bg-[#0A1628]",style:{opacity:.5,cursor:"grabbing",width:240},children:u.jsx(eg,{tracking:t,onMove:()=>{},onArchive:()=>{},onRate:()=>{},interactive:!1,goalsMatch:e})})}function eW({stage:t,trackings:e,total:n,onMove:r,onArchive:s,onRate:o,onOpen:l,activeStage:d,goalsMatchMap:h,prepend:p}){const{isOver:g,setNodeRef:m}=jV({id:t}),y=g&&d!==null&&d!==t;return u.jsxs("div",{ref:m,className:`flex flex-col flex-1 min-w-[220px] max-w-[320px] h-full rounded-xl transition-all border bg-gray-50 dark:bg-[#0D1F35] ${y?"border-[#1D9E75]/60 shadow-[0_0_0_3px_rgba(29,158,117,0.18)]":"border-gray-200 dark:border-white/[0.08]"}`,children:[u.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 shrink-0 border-b-2",style:{borderBottomColor:Gd[t]},children:[u.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:Gd[t]}}),u.jsx("h2",{className:"text-sm font-semibold text-gray-900 dark:text-[#F0F4F8]",children:N_[t]}),u.jsxs("span",{className:"text-xs tabular-nums ml-auto text-gray-500 dark:text-[#8899AA]",children:[e.length,n>e.length&&u.jsxs("span",{className:"ml-1 text-gray-400 dark:text-white/30",children:["(",n,")"]})]})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto space-y-2 px-2 pb-2 [&::-webkit-scrollbar]:hidden",children:[p,e.length===0?u.jsx("div",{className:"flex items-center justify-center py-10 px-4 roun
236ded-lg text-center text-[12px] border border-dashed border-gray-300 text-gray-400 dark:border-white/10 dark:text-[#8899AA]/60",children:"No jobs here yet"}):e.map(b=>u.jsx(ZV,{tracking:b,onMove:_=>r(b.id,_),onArchive:()=>s(b.id),onRate:o,onOpen:()=>l(b),goalsMatch:h.get(b.id)??null},b.id))]})]})}function tW({tracking:t,onOpen:e,goalsMatch:n}){return u.jsx("div",{onClick:e,className:"group relative flex flex-col gap-2 p-3 rounded-lg transition-colors cursor-pointer border bg-white border-gray-200 hover:border-[#1D9E75]/40 dark:bg-[#0A1628] dark:border-white/[0.08] dark:hover:border-[#1D9E75]/40",children:u.jsx(eg,{tracking:t,onMove:()=>{},onArchive:()=>{},onRate:()=>{},interactive:!1,goalsMatch:n,readOnly:!0})})}function nW({stage:t,trackings:e,total:n,onOpen:r,goalsMatchMap:s}){return u.jsxs("div",{className:"flex flex-col flex-1 min-w-[220px] max-w-[320px] h-full rounded-xl border bg-gray-50 border-gray-200 dark:bg-[#0D1F35] dark:border-white/[0.08]",children:[u.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 shrink-0 border-b-2",style:{borderBottomColor:Gd[t]},children:[u.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:Gd[t]}}),u.jsx("h2",{className:"text-sm font-semibold text-gray-900 dark:text-[#F0F4F8]",children:N_[t]}),u.jsxs("span",{className:"text-xs tabular-nums ml-auto text-gray-500 dark:text-[#8899AA]",children:[e.length,n>e.length&&u.jsxs("span",{className:"ml-1 text-gray-400 dark:text-white/30",children:["(",n,")"]})]})]}),u.jsx("div",{className:"flex-1 overflow-y-auto space-y-2 px-2 pb-2 [&::-webkit-scrollbar]:hidden",children:e.length===0?u.jsx("div",{className:"flex items-center justify-center py-10 px-4 rounded-lg text-center text-[12px] border border-dashed border-gray-300 text-gray-400 dark:border-white/10 dark:text-[#8899AA]/60",children:"No jobs here yet"}):e.map(o=>u.jsx(tW,{tracking:o,onOpen:()=>r(o),goalsMatch:s.get(o.id)??null},o.id))})]})}function rW({trackings:t,onOpen:e,onUnarchive:n,goalsMatchMap:r}){const[s,o]=T.useState(!1);return s?u.jsxs("div",{className:"flex flex-col shrink-0 w-[280px] h-full rounded-xl border bg-gray-50 border-gray-200 dark:bg-[#0D1F35] dark:border-white/[0.08]",children:[u.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 shrink-0 border-b-2",style:{borderBottomColor:"#6B7280"},children:[u.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:"#6B7280"}}),u.jsx("h2",{className:"text-sm font-semibold text-gray-900 dark:text-[#F0F4F8]",children:"Archived"}),u.jsx("span",{className:"text-xs tabular-nums ml-auto text-gray-500 dark:text-[#8899AA]",children:t.length}),u.jsx("button",{type:"button","aria-label":"Collapse archived",onClick:()=>o(!1),className:"w-6 h-6 -mr-1 inline-flex items-center justify-center rounded transition-colors text-gray-400 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",children:"✕"})]}),u.jsx("div",{className:"flex-1 overflow-y-auto space-y-2 px-2 pb-2 [&::-webkit-scrollbar]:hidden",children:t.length===0?u.jsx("div",{className:"flex items-center justify-center py-10 px-4 rounded-lg text-center text-[12px] border border-dashed border-gray-300 text-gray-400 dark:border-white/10 dark:text-[#8899AA]/60",children:"Nothing archived"}):t.map(l=>u.jsxs("div",{onClick:()=>e(l),className:"group relative flex flex-col gap-2 p-3 rounded-lg transition-colors cursor-pointer border bg-white border-gray-200 hover:border-[#1D9E75]/40 dark:bg-[#0A1628] dark:border-white/[0.08] dark:hover:border-[#1D9E75]/40",style:{opacity:.85},children:[u.jsx(eg,{tracking:l,onMove:()=>{},onArchive:()=>{},onRate:()=>{},interactive:!1,goalsMatch:r.get(l.id)??null,readOnly:!0}),u.jsx("div",{className:"flex justify-end",children:u.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),n(l.id)},className:"text-[11px] font-medium transition-colors text-gray-500 hover:text-[#1D9E75] dark:text-white/40 dark:hover:text-[#1D9E75]",children:"Unarchive"})})]},l.id))})]}):u.jsx("div",{className:"shrink-0 h-full flex items-start",children:u.jsxs("button",{type:"button",onClick:()=>o(!0),"aria-expanded":!1,className:"flex items-center gap-2 px-3 py-2.5 rounded-xl border border-dashed text-sm transition-colors whitespace-nowrap text-gray-500 border-gray-300 bg-gray-50/60 hover:text-gray-900 hover:border-gray-400 dark:text-white/40 dark:border-white/15 dark:bg-white/[0.02] dark:hover:text-white/80 dark:hover:border-white/30",children:[u.jsx(JO,{}),u.jsx("span",{className:"font-medium",children:"Archived"}),u.jsxs("span",{className:"text-xs tabular-nums",children:["(",t.length,")"]})]})})}function N2(t){if(!t)return null;const e=new Date(t);return Number.isNaN(e.getTime())?null:e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function iW(t){const e=new Date(t);if(Number.isNaN(e.getTime()))return"";const n=new Date,r=l=>new Date(l.getFullYear(),l.getMonth(),l.getDate()).getTime(),s=Math.floor((r(n)-r(e))/864e5);if(s<=0){const l=Math.floor((n.getTime()-e.getTime())/6e4);return l<1?"Just now":l<60?`${l}m ago`:"Today"}if(s===1)return"Yesterday";if(s<7)return`${s}d ago`;const o=e.getFullYear()===n.getFullYear();return e.toLocaleDateString("en-US",o?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"})}function sW(t){const{salary_min:e,salary_max:n,salary_currency:r,salary_pay_period:s,salary_raw:o,salary:l}=t,d=h=>h>=1e3?`${Math.round(h/1e3)}K`:`${h}`;if(e!=null&&n!=null){const h=r==="USD"||!r?"$":`${r} `,p=(s==null?void 0:s.toLowerCase())??"",g=p.includes("hour")?"/hr":p.includes("week")?"/wk":p.includes("month")?"/mo":"/yr";return`${h}${d(e)} - ${h}${d(n)}${g}`}return o||l||null}function A2(t){return t>=1e6?`$${(t/1e6).toFixed(1).replace(/\.0$/,"")}T`:t>=1e3?`$${(t/1e3).toFixed(1).replace(/\.0$/,"")}B`:`$${t.toFixed(0)}M`}function aW(t){return`${(t*100).toFixed(1)}%`}function oW(t){try{const e=JSON.parse(t);return Array.isArray(e)?e.slice(0,5).map(n=>n&&typeof n.company_name=="string"?n.company_name:null).filter(n=>!!n):[]}catch{return[]}}function lW(){return u.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u.jsx("path",{d:"M18 6 6 18"}),u.jsx("path",{d:"m6 6 12 12"})]})}function cW({stage:t}){return u.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium bg-gray-100 dark:bg-white/[0.06]",children:[u.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:Gd[t]}}),u.jsx("span",{className:"text-gray-700 dark:text-white/80",children:N_[t]})]})}function uW({children:t}){return u.jsx("h3",{className:"text-xs uppercase tracking-wider mb-3 font-semibold text-gray-400 dark:text-white/40",children:t})}function dW({label:t,value:e}){return u.jsxs("div",{className:"flex flex-col gap-0.5",children:[u.jsx("span",{className:"text-[11px] uppercase tracking-wide text-gray-400 dark:text-white/40",children:t}),u.jsx("span",{className:"text-sm text-gray-700 dark:text-white/85",children:e})]})}function hW(t){const e=t.trim();if(!e||e.length>=60)return!1;const n=e.replace(/:$/,"").trim();if(/[.!?,;]$/.test(n))return!1;if(n===n.toUpperCase()&&/[A-Z]/.test(n))return!0;const r=n.split(/\s+/);return r.length===0||r.length>8?!1:r.filter(o=>/^[A-Z]/.test(o)).length/r.length>=.7}function fW({text:t}){const e=t.split(/\n\s*\n/).map(n=>
236n.trim()).filter(Boolean);return u.jsx("div",{className:"max-h-[320px] overflow-y-auto [&::-webkit-scrollbar]:hidden pr-1",style:{scrollbarWidth:"none"},children:e.map((n,r)=>hW(n)?u.jsx("h4",{className:"text-xs uppercase tracking-wider font-semibold mt-5 mb-2 first:mt-0 text-gray-400 dark:text-white/40",children:n},r):u.jsx("p",{className:"text-sm leading-relaxed mb-2 whitespace-pre-line text-gray-700 dark:text-white/60",children:n},r))})}function pW({tracking:t,onAddNote:e,readOnly:n=!1}){const[r,s]=T.useState(""),[o,l]=T.useState(!1),d=T.useRef(null),h=T.useMemo(()=>{const m=t.updated_at||t.created_at;return[...xO(t.notes,m)].sort((y,b)=>b.created_at.localeCompare(y.created_at))},[t.notes,t.updated_at,t.created_at]),p=m=>{m.style.height="auto",m.style.height=`${Math.min(m.scrollHeight,160)}px`},g=async()=>{var y;const m=r.trim();if(!(!m||o)){l(!0),s(""),d.current&&(d.current.style.height="auto");try{await e(t.id,m)}finally{l(!1),(y=d.current)==null||y.focus()}}};return u.jsxs("div",{className:"flex flex-col gap-3 min-h-[280px]",children:[u.jsx("div",{className:"flex-1 max-h-[420px] overflow-y-auto pr-1",children:h.length===0?u.jsx("p",{className:"text-sm italic py-6 text-center text-gray-400 dark:text-white/40",children:"No notes yet — log your first activity below"}):u.jsx("ul",{className:"divide-y divide-gray-200 dark:divide-white/5",children:h.map(m=>u.jsxs("li",{className:"py-3 first:pt-0 last:pb-0",children:[u.jsx("p",{className:"text-sm whitespace-pre-wrap leading-relaxed text-gray-700 dark:text-white/85",children:m.text}),u.jsx("p",{className:"text-[11px] mt-1 tabular-nums text-gray-400 dark:text-white/40",children:iW(m.created_at)})]},m.id))})}),!n&&u.jsxs("div",{className:"flex items-end gap-2 pt-3 border-t border-gray-200 dark:border-white/5",children:[u.jsx("textarea",{ref:d,rows:1,value:r,onChange:m=>{s(m.target.value),p(m.currentTarget)},onKeyDown:m=>{m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),g())},placeholder:"Log an activity... e.g. 'Sent thank you email'",disabled:o,className:"flex-1 border rounded-lg px-3 py-2 text-sm resize-none focus:outline-none focus:border-[#1D9E75]/50 disabled:opacity-50 bg-white border-gray-200 text-gray-900 placeholder:text-gray-400 dark:bg-white/5 dark:border-white/10 dark:text-white/85 dark:placeholder:text-white/30",style:{maxHeight:160}}),u.jsx("button",{type:"button",onClick:()=>void g(),disabled:!r.trim()||o,className:"shrink-0 px-4 py-2 text-sm font-semibold rounded-lg transition-colors disabled:opacity-40 disabled:cursor-not-allowed bg-[#1D9E75] text-white",children:"Add"})]})]})}function A_({tracking:t,job:e,analyzing:n,companyLocked:r=!1,onAnalyze:s,onClose:o,onAddNote:l,readOnly:d=!1,onAddToTracker:h,addingToTracker:p=!1,addFailed:g=!1}){var K,te;const m=In(),{showUpgradeModal:y}=Ka(),[b,_]=T.useState(t?"signal":"role"),w=T.useId();T.useEffect(()=>{_(t?"signal":"role")},[t==null?void 0:t.id]),T.useEffect(()=>{b==="company"&&r&&m.capture("enrichment_gate_shown")},[b,r,m]),T.useEffect(()=>{const I=H=>{H.key==="Escape"&&o()};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[o]);const S=e??(t==null?void 0:t.job),E=S==null?void 0:S.company,k=(te=((K=t==null?void 0:t.job)==null?void 0:K.analysis)??(S==null?void 0:S.analysis))==null?void 0:te[0],j=(k==null?void 0:k.profile_missing)===!0,N=(S==null?void 0:S.is_active)===!1,O=N?N2(S==null?void 0:S.closed_at):null,D=k!=null&&k.qualification_band?YO[k.qualification_band]??null:null,F=_W((k==null?void 0:k.subscores)??null),R=!!k&&(!!k.summary||k.pros.length>0||k.cons.length>0||k.skill_gaps.length>0||k.resume_tips.length>0),B=[],M=(S==null?void 0:S.normalized_location)??(S==null?void 0:S.location);M&&B.push(["Location",M]),S!=null&&S.work_type&&B.push(["Work Type",S.work_type.charAt(0).toUpperCase()+S.work_type.slice(1)]),S!=null&&S.employment_type&&B.push(["Employment",S.employment_type]),S!=null&&S.seniority&&B.push(["Seniority",S.seniority]),S!=null&&S.department&&B.push(["Department",S.department]);const V=S?sW(S):null;V&&B.push(["Salary",V]);const W=N2(S==null?void 0:S.date_posted);W&&B.push(["Posted",W]),(S==null?void 0:S.applicant_count)!=null&&B.push(["Applicants",`~${S.applicant_count} applicants`]);const Q=[{id:"signal",label:"Signal"},{id:"role",label:"Role"},{id:"company",label:"Company"},...t?[{id:"notes",label:"Notes"}]:[]];return u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm",onClick:o,children:u.jsxs("div",{className:"rounded-2xl max-w-3xl w-full max-h-[85vh] flex flex-col overflow-hidden border bg-white border-gray-200 dark:bg-[#0D1F35] dark:border-white/10",onClick:I=>I.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":w,children:[u.jsx("div",{className:"shrink-0 p-5",children:u.jsxs("div",{className:"flex items-start gap-4",children:[u.jsx(ax,{url:(E==null?void 0:E.logo_url)??null,name:(E==null?void 0:E.name)??null,size:48}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("p",{className:"text-sm truncate text-gray-500 dark:text-[#8899AA]",children:(E==null?void 0:E.name)??"Unknown company"}),u.jsx("h2",{id:w,className:"text-xl font-semibold leading-snug text-gray-900 dark:text-white",children:(S==null?void 0:S.job_title)??"Untitled role"})]}),u.jsxs("div",{className:"shrink-0 flex items-center gap-3",children:[t?u.jsx(cW,{stage:t.stage}):!N&&u.jsx("button",{type:"button",onClick:h,disabled:p,className:"px-3 py-1.5 text-xs font-semibold rounded-lg text-white bg-[#1D9E75] hover:brightness-110 transition-all disabled:opacity-60 disabled:cursor-not-allowed",children:p?"Adding…":g?"Try again":"+ Add to tracker"}),N?u.jsxs("div",{className:"hidden md:flex flex-col items-end gap-0.5",children:[u.jsx("span",{"aria-disabled":"true",className:"inline-flex items-center text-xs font-semibold px-2.5 py-1 rounded-lg cursor-not-allowed bg-gray-100 text-gray-400 dark:bg-white/5 dark:text-white/40",children:"No longer accepting applications"}),u.jsx("span",{className:"text-[11px] text-gray-400 dark:text-white/30",children:S!=null&&S.source_url?u.jsx("a",{href:S.source_url,target:"_blank",rel:"noopener noreferrer",className:"hover:underline",children:O?`Closed ${O}
236 · View posting`:"View posting"}):O?`Closed ${O}`:null})]}):(S==null?void 0:S.source_url)&&u.jsxs("a",{href:S.source_url,target:"_blank",rel:"noopener noreferrer",className:"hidden md:inline-flex items-center gap-1 text-xs font-semibold text-[#1D9E75] hover:opacity-80 transition-opacity",children:["View Posting",u.jsx(XO,{})]}),u.jsx("button",{type:"button","aria-label":"Close",onClick:o,className:"w-8 h-8 rounded-full flex items-center justify-center transition-colors text-gray-500 hover:text-gray-900 hover:bg-gray-100 dark:text-white/60 dark:hover:text-white dark:hover:bg-white/10",children:u.jsx(lW,{})})]})]})}),u.jsx("div",{role:"tablist","aria-label":"Job details sections",className:"shrink-0 flex border-b border-gray-200 dark:border-white/10 px-2",children:Q.map(I=>u.jsx("button",{type:"button",role:"tab","aria-selected":b===I.id,onClick:()=>_(I.id),className:`px-4 py-2.5 text-sm cursor-pointer transition border-b-2 ${b===I.id?"border-[#1D9E75] font-medium text-gray-900 dark:text-white":"border-transparent text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white/70"}`,children:I.label},I.id))}),u.jsxs("div",{className:"flex-1 overflow-y-auto p-5 [&::-webkit-scrollbar]:hidden",style:{scrollbarWidth:"none"},children:[b==="signal"&&!t&&u.jsxs("div",{className:"flex flex-col items-center gap-3 py-10 px-6 text-center",children:[u.jsx("div",{className:"text-sm italic text-gray-400 dark:text-white/30",children:"Not scored yet"}),u.jsx("p",{className:"text-xs max-w-xs text-gray-500 dark:text-white/40",children:"Signal scoring runs automatically when you add this job to your tracker — you'll get a fit score, pros and cons, and resume tips for this role."}),!N&&u.jsx("button",{type:"button",onClick:h,disabled:p,className:"mt-1 px-4 py-2 rounded-lg text-xs font-semibold text-white bg-[#1D9E75] hover:brightness-110 transition-all disabled:opacity-60 disabled:cursor-not-allowed",children:p?"Adding…":g?"Try again":"+ Add to tracker"})]}),b==="signal"&&t&&(R?u.jsxs("div",{children:[D&&u.jsxs("div",{className:"flex items-start gap-4 p-4 rounded-xl mb-6 border bg-gray-50 border-gray-200 dark:bg-white/5 dark:border-white/10",children:[u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("p",{className:"text-base font-bold uppercase tracking-wider",style:{color:D.color},children:D.label}),(k==null?void 0:k.summary)&&u.jsx("p",{className:"text-sm mt-1.5 leading-relaxed text-gray-700 dark:text-white/70",children:k.summary})]}),!d&&!N&&u.jsx("button",{type:"button",title:"Re-run analysis","aria-label":"Re-run analysis",onClick:()=>s(t),disabled:n,className:"self-start shrink-0 -mt-1 -mr-1 p-1 rounded transition-colors text-gray-300 hover:text-gray-500 dark:text-white/20 dark:hover:text-white/60 disabled:opacity-40",children:n?u.jsx("span",{className:"block w-3.5 h-3.5 border-2 border-gray-300 border-t-[#1D9E75] rounded-full animate-spin dark:border-white/20 dark:border-t-[#1D9E75]"}):u.jsx(KV,{})})]}),j&&u.jsx(kO,{className:"mb-6"}),!D&&(k==null?void 0:k.summary)&&u.jsxs("div",{className:"rounded-r-lg px-4 py-3 mb-6 border-l-2 border-[#1D9E75] bg-gray-50 dark:bg-white/5",children:[u.jsx("p",{className:"text-sm leading-relaxed italic text-gray-700 dark:text-white/70",children:k.summary}),!d&&!N&&u.jsx("button",{type:"button",onClick:()=>s(t),disabled:n,className:"mt-2 text-xs font-semibold text-[#1D9E75] hover:opacity-80 transition-opacity disabled:opacity-40",children:n?"Re-analyzing…":"Re-run analysis"})]}),F&&u.jsxs("div",{className:"rounded-xl p-4 mb-4 border bg-gray-50 border-gray-200 dark:bg-white/[0.03] dark:border-white/[0.08]",children:[u.jsx("p",{className:"text-xs uppercase tracking-wider mb-2 font-semibold text-gray-400 dark:text-white/40",children:"Preference Fit"}),u.jsx("div",{children:F.map(I=>u.jsxs("div",{className:"flex items-start gap-2 py-1.5 border-b border-gray-200 dark:border-white/5 last:border-0",children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 mt-0.5 text-sm leading-none font-semibold",style:{color:xW[I.tone]},children:bW[I.tone]}),u.jsxs("span",{className:"text-sm text-gray-700 dark:text-white/70",children:[u.jsxs("span",{className:"font-medium",children:[I.label,":"]}
236)," ",I.text]})]},I.label))})]}),(k.pros.length>0||k.cons.length>0)&&u.jsxs("div",{className:"rounded-xl p-4 mb-4 border bg-gray-50 border-gray-200 dark:bg-white/[0.03] dark:border-white/[0.08]",children:[k.pros.length>0&&u.jsxs("div",{children:[u.jsx("p",{className:"text-xs uppercase tracking-wider text-[#1D9E75] mb-2 font-semibold",children:"Pros"}),u.jsx("div",{children:k.pros.map((I,H)=>u.jsxs("div",{className:"flex items-start gap-2 py-1.5 border-b border-gray-200 dark:border-white/5 last:border-0",children:[u.jsx("span",{className:"rounded-full mt-1.5 shrink-0 bg-[#1D9E75]",style:{width:6,height:6}}),u.jsx("span",{className:"text-sm text-gray-700 dark:text-white/70",children:I})]},H))})]}),k.pros.length>0&&k.cons.length>0&&u.jsx("div",{className:"my-3 border-t border-gray-200 dark:border-white/[0.08]"}),k.cons.length>0&&u.jsxs("div",{children:[u.jsx("p",{className:"text-xs uppercase tracking-wider text-red-500 dark:text-[#EF4444] mb-2 font-semibold",children:"Cons"}),u.jsx("div",{children:k.cons.map((I,H)=>u.jsxs("div",{className:"flex items-start gap-2 py-1.5 border-b border-gray-200 dark:border-white/5 last:border-0",children:[u.jsx("span",{className:"rounded-full mt-1.5 shrink-0 bg-red-500",style:{width:6,height:6}}),u.jsx("span",{className:"text-sm text-gray-700 dark:text-white/70",children:I})]},H))})]})]}),k.skill_gaps.length>0&&u.jsxs("div",{className:"mb-4",children:[u.jsx("p",{className:"text-xs uppercase tracking-wider text-amber-500 dark:text-[#F59E0B] mb-2 font-semibold",children:"Skill Gaps"}),u.jsx("div",{children:k.skill_gaps.map((I,H)=>u.jsxs("div",{className:"flex items-start gap-2 text-sm py-1 text-gray-700 dark:text-white/60",children:[u.jsx("span",{className:"shrink-0 mt-0.5 leading-none text-amber-500 dark:text-[#F59E0B]",style:{fontSize:10},children:"▲"}),u.jsx("span",{children:I})]},H))})]}),k.resume_tips.length>0&&u.jsxs("div",{children:[u.jsx("p",{className:"text-xs uppercase tracking-wider mb-2 font-semibold text-gray-400 dark:text-white/40",children:"Resume Tips"}),u.jsx("div",{children:k.resume_tips.map((I,H)=>u.jsxs("div",{className:"flex items-start gap-2 text-sm py-1 text-gray-700 dark:text-white/60",children:[u.jsx("span",{className:"shrink-0 mt-0.5 text-[#1D9E75]",children:"→"}),u.jsx("span",{children:I})]},H))})]})]}):u.jsx("div",{className:"flex flex-col items-center gap-4 py-8",children:n?u.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500 dark:text-white/50",children:[u.jsx("span",{className:"w-4 h-4 border-2 border-gray-300 border-t-[#1D9E75] rounded-full animate-spin dark:border-white/20 dark:border-t-[#1D9E75]"}),"Analyzing..."]}):u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"text-sm italic text-gray-400 dark:text-white/30",children:"No analysis yet"}),N?u.jsx("p",{className:"text-xs text-center max-w-xs text-gray-400 dark:text-white/30",children:"This role is no longer accepting applications, so Signal scoring is disabled."}):!d&&u.jsx("button",{type:"button",onClick:()=>s(t),className:"text-xs font-semibold text-[#1D9E75] hover:opacity-80 transition-opacity",children:"Generate score"})]})})),b==="role"&&u.jsxs("div",{className:"space-y-6",children:[!1,B.length>0?u.jsx("div",{className:"grid grid-cols-2 gap-x-6 gap-y-4",children:B.map(([I,H])=>u.jsx(dW,{label:I,value:H},I))}):u.jsx("p",{className:"text-sm italic text-gray-400 dark:text-white/40",children:"No role details available."}),(S==null?void 0:S.job_description)&&u.jsxs("div",{children:[u.jsx(uW,{children:"Job Description"}),S.job_description_formatted&&S.job_description_formatted.length>0?u.jsx("div",{className:"max-h-[400px] overflow-y-auto [&::-webkit-scrollbar]:hidden pr-1",style:{scrollbarWidth:"none"},children:S.job_description_formatted.map((I,H)=>u.jsxs("div",{children:[u.jsx("h4",{className:"text-xs uppercase tracking-wider font-semibold mt-6 mb-2 first:mt-0 border-l-2 border-[#1D9E75] pl-2 text-gray-500 dark:text-white/50",children:I.heading}),u.jsx("ul",{className:"pl-1",children:I.items.map((G,re)=>u.jsxs("li",{className:"flex items-start gap-2 text-sm py-0.5 mb-1 leading-snug text-gray-700 dark:text-white/70",children:[u.jsx("span",{className:"rounded-full shrink-0 mt-[7px] bg-[#1D9E75]",style:{width:5,height:5}}),u.jsx("span",{children:G})]},re))})]},H))}):u.jsx(fW,{text:S.job_description})]})]}),b==="company"&&r&&u.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-6 text-center rounded-xl border border-dashed border-gray-300 dark:border-white/20",children:[u.jsx("span",{className:"mb-3 text-gray-400 dark:text-white/40",children:u.jsx(JV,{})}),u.jsx("p",{className:"text-sm font-semibold mb-1 text-gray-900 dark:text-white/80",children:"Company intelligence is a Pro feature"}),u.jsx("p",{className:"text-xs mb-4 max-w-xs text-gray-500 dark:text-white/40",children:"Funding, headcount growth, employee reviews, and attrition for every company you track."}),u.jsx("button",{type:"button",onClick:()=>{m.capture("enrichment_gate_cta_clicked"),y({variant:"enrichment",source:"enrichment"})},className:"px-4 py-2 rounded-lg text-xs font-semibold text-white bg-[#1D9E75]",children:"Upgrade to Pro"})]}),b==="company"&&!r&&(()=>{if(!E)return u.jsx("p",{className:"text-sm text-white/30 italic",children:"No company data available"});const I=[];E.founded_year!=null&&I.push(["Founded",String(E.founded_year)]),E.size_range?I.push(["Size",E.size_range]):E.employee_count!=null&&I.push(["Size",`${E.employee_count.toLocaleStr
236ing()} employees`]);const H=E.hq_city&&E.hq_country?`${E.hq_city}, ${E.hq_country}`:E.hq_location??null;if(H&&I.push(["HQ",H]),E.last_funding_type&&E.last_funding_amount!=null?I.push(["Funding",`${E.last_funding_type} · ${A2(E.last_funding_amount)}`]):E.last_funding_type?I.push(["Funding",E.last_funding_type]):E.last_funding_amount!=null&&I.push(["Funding",A2(E.last_funding_amount)]),E.active_job_postings_count!=null&&I.push(["Open Roles",`${E.active_job_postings_count} open roles`]),E.employee_count_change_pct!=null){const se=E.employee_count_change_pct;se>0?I.push(["Hiring Trend",`+${se.toFixed(0)}% headcount growth`,"#1D9E75"]):se<0&&I.push(["Hiring Trend",`${se.toFixed(0)}% headcount decline`,"#EF4444"])}const G=E.employee_review_score,re=G==null?null:G>=4?"#1D9E75":G>=3.5?"#F59E0B":"#EF4444",U=E.attrition_rate,A=U==null?null:U<=.1?"#1D9E75":U<=.2?"#F59E0B":"#EF4444",$=[];E.review_culture!=null&&$.push(["Culture",E.review_culture]),E.review_work_life_balance!=null&&$.push(["Work-Life Balance",E.review_work_life_balance]),E.review_compensation!=null&&$.push(["Compensation",E.review_compensation]),E.review_career_opportunities!=null&&$.push(["Career Growth",E.review_career_opportunities]);const P=$.length>=2,q=se=>se>=4?"#1D9E75":se>=3?"#F59E0B":"#EF4444",z=E.competitors?oW(E.competitors):[];return!!E.description||I.length>0||P||G!=null||U!=null||z.length>0?u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[u.jsx(ax,{url:E.logo_url??null,name:E.name??null,size:40}),u.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-3 flex-wrap",children:[u.jsx("h3",{className:"text-lg font-semibold truncate text-gray-900 dark:text-white",children:E.name??"Unknown company"}),E.industry&&u.jsx("span",{className:"text-xs rounded-full px-3 py-1 bg-gray-100 text-gray-600 dark:bg-white/10 dark:text-white/50",children:E.industry})]})]}),E.description&&u.jsx("p",{className:"text-sm leading-relaxed line-clamp-3 mb-5 text-gray-700 dark:text-white/60",children:E.description}),I.length>0&&u.jsx("div",{className:"rounded-xl p-4 mb-4 bg-gray-50 dark:bg-white/5",children:u.jsx("div",{className:"grid grid-cols-2 gap-4",children:I.map(([se,ne,ie])=>u.jsxs("div",{children:[u.jsx("p",{className:"text-xs uppercase tracking-wider mb-0.5 text-gray-400 dark:text-white/40",children:se}),u.jsx("p",{className:`text-sm font-semibold ${ie?"":"text-gray-900 dark:text-white"}`,style:ie?{color:ie}:void 0,children:ne})]},se))})}),(G!=null||U!=null)&&u.jsxs("div",{className:"mb-4",children:[u.jsx("p",{className:"text-xs uppercase tracking-wider mb-2 font-semibold text-gray-400 dark:text-white/40",children:"Company Health"}),u.jsxs("div",{className:`rounded-xl p-4 grid gap-4 bg-gray-50 dark:bg-white/5 ${G!=null&&U!=null?"grid-cols-2":"grid-cols-1"}`,children:[G!=null&&re&&u.jsxs("div",{children:[u.jsxs("p",{className:"leading-none",children:[u.jsx("span",{className:"text-2xl font-bold tabular-nums",style:{color:re},children:G.toFixed(1)}),u.jsx("span",{className:"text-sm ml-1 text-gray-400 dark:text-white/30",children:"/ 5"})]}),u.jsx("p",{className:"text-xs mt-1 text-gray-500 dark:text-white/40",children:"employee rating"})]}),U!=null&&A&&u.jsxs("div",{children:[u.jsx("p",{className:"leading-none",children:u.jsx("span",{className:"text-2xl font-bold tabular-nums",style:{color:A},children:aW(U)})}),u.jsx("p",{className:"text-xs mt-1",style:{color:A},children:U<=.1?"low attrition · people stay":U<=.2?"moderate attrition":"high attrition · high turnover"})]})]})]}),P&&u.jsxs("div",{className:"mb-4",children:[u.jsx("p",{className:"text-xs uppercase tracking-wider mb-2 font-semibold text-gray-400 dark:text-white/40",children:"Employee Reviews"}),u.jsx("div",{className:"rounded-xl p-4 grid grid-cols-1 gap-3 bg-gray-50 dark:bg-white/5",children:$.map(([se,ne])=>{const ie=q(ne),fe=Math.max(0,Math.min(100,ne/5*100));return u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{className:"text-xs w-32 shrink-0 text-gray-500 dark:text-white/50",children:se}),u.jsx("div",{className:"flex-1 h-1.5 rounded-full relative bg-gray-200 dark:bg-white/10",children:u.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full",style:{width:`${fe}%`,background:ie}})}),u.jsx("span",{className:"text-xs w-6 text-right tabular-nums text-gray-600 dark:text-white/60",children:ne.toFixed(1)})]},se)})})]}),z.length>0&&u.jsxs("div",{children:[u.jsx("p",{className:"text-xs uppercase tracking-wider mb-2 text-gray-400 dark:text-white/40",children:"Competes with"}),u.jsx("div",{className:"flex flex-wrap gap-2",children:z.map((se,ne)=>u.jsx("span",{className:"text-xs rounded-full px-3 py-1 border bg-gray-100 text-gray-600 border-gray-200 dark:bg-white/[0.08] dark:text-white/50 dark:border-white/10",children:se},ne))})]})]}):u.jsx("p",{className:"text-sm italic text-gray-400 dark:text-white/30",children:"No company data available"})})(),b==="notes"&&t&&u.jsx(pW,{tracking:t,onAddNote:l,readOnly:d})]})]})})}const E0="That doesn't look like a valid URL. Paste the full job posting link, starting with https://.";function mW(t){let e;try{e=new URL(t)}catch{return E0}return e.protocol!=="http:"&&e.protocol!=="https:"||!e.hostname.includes(".")?E0:null}function gW(t){const{code:e,status:n}=t;return e==="job_not_found"?t.error??"job_not_found":e==="no_content"?"We couldn't find a job posting at that link. Make sure it points directly to a job listing.":e==="rate_limited"?"We're having trouble fetching job pages right now. Try again in a minute.":e==="scrape_failed"||n===400?"We couldn't read that URL. Double-check the link and try again.":n===402||n===429?"We're having trouble fetching job pages right now. Try again in a minute.":"Something went wrong analyzing that job. Try again, and if it keeps failing, use Give Feedback to let us know."}function vW(t){const e=t.length,n=new Set(t.map(d=>d.stage_at_closure)),r=[];n.has("applied")&&r.push("applied to"),n.has("interviewing")&&r.push("are interviewing for"),n.has("offer")&&r.push("have an offer for");const s=r.join(" or ")||"saved";return`${e} ${e===1?"job":"jobs"} you ${s} ${e===1?"is":"are"} no longer accepting applications`}function yW({onAddRole:t}){const e=In(),n=Ym();return T.useEffect(()=>
236{e.capture("tracker_zero_state_shown")},[]),u.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6 pb-16 text-center",children:[u.jsx("div",{className:"w-16 h-16 rounded-2xl flex items-center justify-center mb-6",style:{background:"rgba(29,158,117,0.10)",border:"1px solid rgba(29,158,117,0.25)"},children:u.jsx("span",{className:"text-3xl leading-none text-[#1D9E75]",children:"+"})}),u.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-[#F0F4F8]",children:"Add your first role"}),u.jsx("p",{className:"text-sm text-gray-500 dark:text-[#8899AA] mt-2 max-w-sm",children:"Paste a job URL and we'll score it against your profile, then track it through every stage."}),u.jsx("button",{type:"button",onClick:t,className:"mt-6 px-5 py-2.5 text-sm font-semibold rounded-lg text-white transition-all hover:brightness-110",style:{background:"#1D9E75"},children:"Add a role →"}),!n&&u.jsxs("p",{className:"text-xs text-gray-500 dark:text-[#8899AA]/70 mt-6 max-w-sm",children:["Or"," ",u.jsx("a",{href:$o,target:"_blank",rel:"noopener noreferrer",onClick:()=>e.capture("extension_install_cta_clicked",{source:"tracker_zero_state"}),className:"text-[#1D9E75] hover:underline font-medium",children:"install the Chrome extension"})," ","to save jobs straight from LinkedIn, Indeed, and 10+ job boards."]})]})}const bW={good:"✓",partial:"◐",bad:"✕",none:"—"},xW={good:"#1D9E75",partial:"#F59E0B",bad:"#EF4444",none:"#9CA3AF"};function _W(t){const e=t==null?void 0:t.subscores;if(!e)return null;const n=e.salary_overlap??null,r=e.work_type_match??null;return[n==null?{label:"Salary",text:"Not specified",tone:"none"}:n>=.8?{label:"Salary",text:"Within your range",tone:"good"}:n>0?{label:"Salary",text:"Partially overlaps your range",tone:"partial"}:{label:"Salary",text:"Below your minimum",tone:"bad"}
236,r==null?{label:"Work type",text:"No preference set",tone:"none"}:r>=1?{label:"Work type",text:"Matches your preference",tone:"good"}:{label:"Work type",text:"Doesn't match your preference",tone:"bad"}]}function wW({onRetry:t}){const[e,n]=T.useState(!1);return u.jsxs("div",{role:"alert",className:"flex-1 flex flex-col items-center justify-center px-6 pb-16 text-center",children:[u.jsx("div",{className:"w-16 h-16 rounded-2xl flex items-center justify-center mb-6",style:{background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.25)"},children:u.jsx("span",{className:"text-3xl leading-none text-red-500",children:"!"})}),u.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-[#F0F4F8]",children:"Something went wrong loading your tracked jobs"}),u.jsx("p",{className:"text-sm text-gray-500 dark:text-[#8899AA] mt-2 max-w-sm",children:"This is on our end — your roles are safe. Try again in a moment."}),u.jsx("button",{type:"button",disabled:e,onClick:()=>{n(!0),t().finally(()=>n(!1))},className:"mt-6 px-5 py-2.5 text-sm font-semibold rounded-lg text-white transition-all hover:brightness-110 disabled:opacity-60",style:{background:"#1D9E75"},children:e?"Retrying…":"Retry"})]})}function SW(){const{user:t}=hn(),e=In(),{trackings:n,analyzeJob:r,saveJob:s,updateStage:o,addNote:l,updateRating:d,archiveJob:h,unarchiveJob:p,loading:g,fetchError:m,refetch:y,analyzingJobIds:b,showUpgradeModal:_}=Ka(),{subscription:w}=zo(),[S,E]=T.useState(null),[k,j]=T.useState(null),[N,O]=wN();T.useEffect(()=>{const pe=N.get("job");if(pe&&n.length>0){const Ue=n.find(He=>He.id===pe);Ue&&(j(Ue.id),O({},{replace:!0}))}},[N,n,O]),T.useEffect(()=>{const pe=N.get("limit_job");if(!pe||g)return;O({},{replace:!0});const Ue=n.filter(He=>He.archived_at===null).length;Ye.from("jobs").select("job_title, company:companies(name)").eq("source_url",pe).maybeSingle().then(({data:He})=>{const Bt=He==null?void 0:He.company;_({variant:"add",source:"extension",currentCount:Ue,limit:5,jobTitle:(He==null?void 0:He.job_title)??null,company:(Bt==null?void 0:Bt.name)??null})})},[N,g]);const[D,F]=T.useState(""),[R,B]=T.useState(!1),[M,V]=T.useState(""),[W,Q]=T.useState(!1),[K,te]=T.useState(null),I=T.useRef(null),H=async pe=>{var He;if(!((He=pe.job)!=null&&He.source_url))return;te(pe.id),(await r(pe.job.source_url)).error||(await y(),setTimeout(()=>void y(),3e3)),te(null)},[G,re]=T.useState(null),U=T.useRef(null);T.useEffect(()=>()=>{U.current&&window.clearTimeout(U.current)},[]);const A=pe=>{var He;const Ue=n.find(Bt=>Bt.id===pe);h(pe),re({trackingId:pe,title:((He=Ue==null?void 0:Ue.job)==null?void 0:He.job_title)??"job"}),U.current&&window.clearTimeout(U.current),U.current=window.setTimeout(()=>re(null),6e3)},$=()=>{G&&(p(G.trackingId),U.current&&window.clearTimeout(U.current),re(null))};T.useEffect(()=>{var pe;W&&((pe=I.current)==null||pe.focus())},[W]);const P=async()=>{const pe=D.trim();if(!pe)return;const Ue=mW(pe);if(Ue){V(Ue);return}V(""),B(!0);const He=await s(pe,{addedSource:"manual",limitSource:"manual"});He.error&&!He.limitReached?V(gW(He)):(F(""),Q(!1)),B(!1)},[q,z]=T.useState(()=>{const pe=localStorage.getItem("sf_filter_score");return pe==="stretch"||pe==="solid"||pe==="strong"?pe:"all"}),[X,se]=T.useState(()=>localStorage.getItem("sf_filter_recency")??"all"),[ne,ie]=T.useState(()=>{const pe=localStorage.getItem("sf_filter_worktypes");if(pe)try{return new Set(JSON.parse(pe))}catch{return new Set(Hl)}return new Set(Hl)}),[fe,_e]=T.useState(()=>localStorage.getItem("sf_filter_sort")??"score"),[Te,Oe]=T.useState("all"),[xe,Ge]=T.useState(()=>localStorage.getItem("sf_filter_search")??""),[Le,mt]=T.useState(null);T.useEffect(()=>{t&&Ye.from("job_preferences").select("*").eq("user_id",t.id).maybeSingle().then(({data:pe})=>{pe!=null&&pe.onboarding_complete&&mt(pe)})},[t]),T.useEffect(()=>{localStorage.setItem("sf_filter_score",q),localStorage.setItem("sf_filter_recency",X),localStorage.setItem("sf_filter_worktypes",JSON.stringify([...ne])),localStorage.setItem("sf_filter_sort",fe),xe?localStorage.setItem("sf_filter_search",xe):localStorage.removeItem("sf_filter_search")},[q,X,ne,fe,xe]);const Et=q==="all"&&X==="all"&&ne.size===Hl.length&&Te==="all"&&fe==="score"&&xe==="",Jt=()=>
236{z("all"),se("all"),ie(new Set(Hl)),Oe("all"),_e("score"),Ge(""),localStorage.removeItem("sf_filter_score"),localStorage.removeItem("sf_filter_recency"),localStorage.removeItem("sf_filter_worktypes"),localStorage.removeItem("sf_filter_sort"),localStorage.removeItem("sf_filter_search")},wt=pe=>{ie(Ue=>{const He=new Set(Ue);return He.has(pe)?He.delete(pe):He.add(pe),He})},{events:Xt,dismiss:ur}=BV(),[jn,Zt]=T.useState(null),nr=T.useRef(!1);T.useEffect(()=>{Xt.length>0&&!nr.current&&(nr.current=!0,e.capture("closure_digest_shown",{count:Xt.length}))},[Xt,e]);const dr=()=>{Zt(new Set(Xt.map(pe=>pe.job_id))),e.capture("closure_digest_clicked",{count:Xt.length})},rr=()=>{e.capture("closure_digest_dismissed",{count:Xt.length}),Zt(null),ur()},Mn=bG(f2(j_,{activationConstraint:{distance:8}}),f2(E_)),on=n.length===0,zt=T.useMemo(()=>n.filter(pe=>pe.archived_at===null),[n]),Ln=T.useMemo(()=>n.filter(pe=>pe.archived_at!==null),[n]),hr=T.useMemo(()=>{const pe=new Map;return Le&&n.forEach(Ue=>pe.set(Ue.id,VV(Ue,Le))),pe},[n,Le]),fr=T.useMemo(()=>{const pe={saved:0,applied:0,interviewing:0,offer:0,rejected:0};for(const Ue of zt)pe[Ue.stage]++;return pe},[zt]),Pn=T.useMemo(()=>{const pe=X==="all"?null:Number(X),Ue=ne.size===Hl.length,He=xe.trim().toLowerCase(),Bt=dt=>{var kt,$n,xn,Y,Z,oe,ge,ye,Ce;if(jn&&!jn.has(dt.job_id))return!1;if(q!=="all"){const Se=(xn=($n=(kt=dt.job)==null?void 0:kt.analysis)==null?void 0:$n[0])==null?void 0:xn.qualification_band;if(Se==null||sp[Se]<sp[q])return!1}if(pe!==null&&KO(dt.created_at)>pe)return!1;if(!Ue){const Se=(Y=dt.job)==null?void 0:Y.work_type;if(Se){const De=Se.toLowerCase();if(!ne.has(De))return!1}}if(Te!=="all"&&dt.user_rating!==Te)return!1;if(He){const Se=((oe=(Z=dt.job)==null?void 0:Z.job_title)==null?void 0:oe.toLowerCase())??"",De=((Ce=(ye=(ge=dt.job)==null?void 0:ge.company)==null?void 0:ye.name)==null?void 0:Ce.toLowerCase())??"";if(!Se.includes(He)&&!De.includes(He))return!1}return!0},Fn={strong:2,partial:1,null:0},bn=(dt,kt)=>{var Y,Z,oe,ge,ye,Ce;if(fe==="score"){const Se=(Z=(Y=dt.job)==null?void 0:Y.analysis)==null?void 0:Z[0],De=(ge=(oe=kt.job)==null?void 0:oe.anal
236ysis)==null?void 0:ge[0],Ne=(Se==null?void 0:Se.qualification_band)!=null?sp[Se.qualification_band]:-1,Pe=(De==null?void 0:De.qualification_band)!=null?sp[De.qualification_band]:-1;if(Ne!==Pe)return Pe-Ne;const Ve=((ye=Se==null?void 0:Se.subscores)==null?void 0:ye.composite)??-1/0;return(((Ce=De==null?void 0:De.subscores)==null?void 0:Ce.composite)??-1/0)-Ve}if(fe==="interest"){const Se=dt.user_rating??-1/0;return(kt.user_rating??-1/0)-Se}if(fe==="goals"){const Se=hr.get(dt.id)??null,De=hr.get(kt.id)??null;return(Fn[De??"null"]??0)-(Fn[Se??"null"]??0)}const $n=new Date(dt.created_at).getTime(),xn=new Date(kt.created_at).getTime();return fe==="newest"?xn-$n:$n-xn},dn={saved:[],applied:[],interviewing:[],offer:[],rejected:[]};for(const dt of zt)Bt(dt)&&dn[dt.stage].push(dt);for(const dt of _m)dn[dt].sort(bn);return dn},[zt,q,X,ne,Te,fe,xe,hr,jn]),Nt=S?zt.find(pe=>pe.id===S)??null:null,yn=(Nt==null?void 0:Nt.stage)??null,ei=k?n.find(pe=>pe.id===k)??null:null,cs=pe=>{E(pe.active.id)},sa=(pe,Ue)=>{const He=n.find(Bt=>Bt.id===pe);!He||He.stage===Ue||(YV(He.stage,Ue),o(pe,Ue))},Ei=pe=>
236{E(null);const{active:Ue,over:He}=pe;He&&sa(Ue.id,He.id)},Pr=()=>E(null);return u.jsxs("div",{className:"flex flex-col h-screen overflow-hidden",children:[u.jsxs("div",{className:"shrink-0",children:[u.jsxs("div",{className:"mb-2 shrink-0 flex items-center justify-between gap-4",children:[u.jsxs("div",{className:"flex items-baseline",children:[u.jsx("h1",{className:"text-xl font-semibold text-gray-900 dark:text-[#F0F4F8]",children:"Job Tracker"}),u.jsxs("span",{className:"text-sm ml-2 text-gray-500 dark:text-white/40",children:["· ",zt.length," ",zt.length===1?"role":"roles"," tracked"]})]}),!W&&u.jsxs("button",{type:"button",onClick:()=>Q(!0),className:"shrink-0 flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium border transition-all text-gray-600 hover:text-gray-900 border-gray-300 hover:border-gray-400 dark:text-white/60 dark:hover:text-white dark:border-white/15 dark:hover:border-white/30",children:[u.jsx("span",{style:{fontSize:16},children:"+"}),"Add Role"]})]}),W&&u.jsxs("div",{className:"mb-4 shrink-0 flex gap-2",children:[u.jsx("input",{ref:I,type:"url",value:D,onChange:pe=>F(pe.target.value),onKeyDown:pe=>{pe.key==="Enter"&&P(),pe.key==="Escape"&&Q(!1)},disabled:R,placeholder:"Paste a job URL to save...","aria-label":"Job URL to save",className:"flex-1 border rounded-lg px-4 py-2.5 text-sm focus:outline-none focus:border-[#1D9E75]/60 transition-colors disabled:opacity-40 bg-white border-gray-200 text-gray-900 placeholder-gray-400 dark:bg-white/5 dark:border-white/10 dark:text-white dark:placeholder-white/30"}),u.jsxs("button",{type:"button",onClick:P,disabled:R||!D.trim(),className:"shrink-0 bg-[#1D9E75] text-white text-sm px-4 py-2.5 rounded-lg font-medium hover:brightness-110 disabled:opacity-40 disabled:cursor-not-allowed transition-all flex items-center gap-2",children:[R&&u.jsx("span",{className:"w-3.5 h-3.5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),R?"Saving…":"Save"]}),u.jsx("button",{type:"button",onClick:()=>Q(!1),"aria-label":"Close",className:"shrink-0 w-10 flex items-center justify-center border rounded-lg transition-colors text-gray-500 hover:text-gray-900 border-gray-300 hover:border-gray-400 dark:text-white/40 dark:hover:text-white dark:border-white/15 dark:hover:border-white/30",children:"✕"})]}),M&&(M==="job_not_found"||M.includes("This Indeed job isn't in our database yet")?u.jsx(GV,{message:M}):u.jsx("p",{role:"alert",className:"mb-4 shrink-0 text-sm px-3 py-2 rounded-lg border bg-red-500/10 border-red-500/30 text-red-600 dark:bg-red-500/[0.08] dark:border-red-500/20 dark:text-red-400",children:M})),Xt.length>0&&!jn&&u.jsxs("div",{role:"status",className:"mb-2 shrink-0 flex items-center gap-3 px-3 py-2 rounded-lg border bg-gray-50 border-gray-200 text-gray-700 dark:bg-white/[0.04] dark:border-white/10 dark:text-white/70",children:[u.jsx("span",{className:"text-sm flex-1",children:vW(Xt)}),u.jsxs("button",{type:"button",onClick:dr,className:"shrink-0 text-xs font-semibold text-[#1D9E75] hover:opacity-80 transition-opacity",children:["View ",Xt.length===1?"it":"them"]}),u.jsx("button",{type:"button","aria-label":"Dismiss closure digest",onClick:rr,className:"shrink-0 w-6 h-6 inline-flex items-center justify-center rounded transition-colors text-gray-400 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",children:"✕"})]}),jn&&u.jsxs("div",{className:"mb-2 shrink-0 flex items-center gap-3 px-3 py-2 rounded-lg border bg-gray-50 border-gray-200 text-gray-600 dark:bg-white/[0.04] dark:border-white/10 dark:text-white/60",children:[u.jsxs("span",{className:"text-sm flex-1",children:["Showing ",jn.size," closed ",jn.size===1?"role":"roles"," from your pipeline."]}),u.jsx("button",{type:"button",onClick:()=>Zt(null),className:"shrink-0 text-xs font-semibold text-[#1D9E75] hover:opacity-80 transition-opacity",children:"Show all"})]}),!on&&u.jsxs("div",{className:"mb-2 shrink-0 flex items-center gap-3 flex-wrap py-1.5 px-2 rounded-lg border bg-gray-50 border-gray-200 dark:bg-[#0D1F35] dark:border-white/[0.08]",children:[u.jsxs("div",{className:"relative",children:[u.jsx("input",{type:"text",value:xe,onChange:pe=>Ge(pe.target.value),placeholder:"Search roles...","aria-label":"Search roles",className:"text-xs rounded-lg pl-3 pr-7 py-1.5 w-32 focus:outline-none transition-colors border bg-white border-gray-300 text-gray-900 placeholder-gray-400 focus:border-gray-400 dark:bg-[#0D1F35] dark:border-white/[0.12] dark:text-white/70 dark:placeholder-white/25 dark:focus:border-white/30"}),xe&&u.jsx("button",{type:"button","aria-label":"Clear search",onClick:()=>Ge(""),className:"absolute right-1.5 top-1/2 -translate-y-1/2 w-5 h-5 inline-flex items-center justify-center text-xs rounded text-gray-400 hover:text-gray-900 dark:text-white/40 dark:hover:text-white",children:"×"})]}),u.jsx(Bu,{label:"Signal",children:[["all","Any"],["stretch","Stretch & above"],["solid","Solid & above"],["strong","Strong only"]].map(([pe,Ue])=>u.jsx(Xi,{active:q===pe,onClick:()=>z(pe),children:Ue},pe))}),u.jsx(Bu,{label:"Added",children:["all","7","14","30"].map(pe=>u.jsx(Xi,{active:X===pe,onClick:()=>se(pe),children:pe==="all"?"All":`${pe}d`},pe))}),u.jsx(Bu,{label:"Type",children:Hl.map(pe=>u.jsx(Xi,{active:ne.has(pe),onClick:()=>wt(pe),children:pe.charAt(0).toUpperCase()+pe.slice(1)},pe))}),u.jsxs(Bu,{label:"Interest",children:[u.jsx(Xi,{active:Te==="all",onClick:()=>Oe("all"),children:"All"}),[5,3,1].map(pe=>{const Ue=pe===5?"Interested":pe===3?"Neutral":"Not interested";return u.jsx(Xi,{active:Te===pe,onClick:()=>Oe(pe),ariaLabel:`Filter by interest: ${Ue}`,children:u.jsx("span",{"aria-hidden":"true",children:pe===5?"👍":pe===3?"😐":"👎"})},pe)})]}),u.jsxs(Bu,{label:"Sort",children:[u.jsx(Xi,{active:fe==="score",onClick:()=>_e("score"),children:"Fit ↓"}),u.jsx(Xi,{active:fe==="newest",onClick:()=>_e("newest"),children:"Newest"}),u.jsx(Xi,{active:fe==="oldest",onClick:()=>_e("oldest"),children:"Oldest"}),u.jsx(Xi,{active:fe==="interest",onClick:()=>_e("interest"),children:"Interest ↓"}),u.jsx(Xi,{active:fe==="goals",onClick:()=>_e("goals"),children:"Goals ↓"})]}),!Et&&u.jsx("button",{type:"button",onClick:Jt,className:"ml-auto text-xs transition-colors text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white/70",children:"Reset"})]})]}),g&&zt.length===0?u.jsx("div",{className:"text-sm text-gray-500 dark:text-[#8899AA]",children:"Loading…"}):m&&on?u.jsx(wW,{onRetry:y}):on?u.jsx(yW,{onAddRole:()=>Q(!0)}):u.jsx("div",{className:"flex-1 overflow-hidden",children:u.jsxs(bV,{sensors:Mn,collisionDetection:kG,onDragStart:cs,onDragEnd:Ei,onDragCancel:Pr,children:[u.jsxs("div",{className:"flex gap-4 h-full px-6 pb-6 overflow-x-auto",children:[_m.map(pe=>u.jsx(eW,{stage:pe,trackings:Pn[pe],total:fr[pe],onMove:sa,onArchive:A,onRate:d,onOpen:Ue=>
236j(Ue.id),activeStage:yn,goalsMatchMap:hr,prepend:pe==="saved"?u.jsx(sG,{}):void 0},pe)),Ln.length>0&&u.jsx(rW,{trackings:Ln,onOpen:pe=>j(pe.id),onUnarchive:p,goalsMatchMap:hr})]}),u.jsx($V,{children:Nt?u.jsx(QV,{tracking:Nt,goalsMatch:hr.get(Nt.id)??null}):null})]})}),ei&&u.jsx(A_,{tracking:ei,analyzing:K===ei.id||b.has(ei.job_id)||Wm(ei),companyLocked:!w.is_pro,onAnalyze:H,onClose:()=>j(null),onAddNote:l}),G&&u.jsxs("div",{role:"status",className:"fixed bottom-6 left-1/2 -translate-x-1/2 z-50 flex items-center gap-4 pl-4 pr-2 py-2.5 rounded-xl border shadow-xl bg-white border-gray-200 dark:bg-[#0D1F35] dark:border-white/10",children:[u.jsxs("span",{className:"text-sm text-gray-700 dark:text-white/80",children:["Archived ",u.jsx("span",{className:"font-semibold",children:G.title})]}),u.jsx("button",{type:"button",onClick:$,className:"text-sm font-semibold px-3 py-1 rounded-lg transition-colors text-[#1D9E75] hover:bg-[#1D9E75]/10",children:"Undo"})]})]})}function EW(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=()=>
236e(r.result.split(",")[1]),r.onerror=n,r.readAsDataURL(t)})}const C2="w-full px-3.5 py-2.5 rounded-lg text-sm text-gray-900 dark:text-[#F0F4F8] focus:outline-none transition-colors",ox={background:"var(--sf-bg-elevated)",border:"1px solid var(--sf-border-subtle)"};function kW(t){var s;if(!t)return"";const e=t.trim().split(/\s+/);if(e.length===0)return"";const n=((s=e[0])==null?void 0:s[0])??"",r=e.length>1?e[e.length-1][0]:"";return(n+r).toUpperCase()}function ZO(t){var n,r,s,o,l;if(!t)return 0;let e=0;return t.full_name&&(e+=15),t.current_title&&(e+=15),t.years_experience!=null&&(e+=10),((n=t.work_history)==null?void 0:n.length)>0&&(e+=20),((r=t.skills)==null?void 0:r.length)>3&&(e+=15),((s=t.education)==null?void 0:s.length)>0&&(e+=10),((o=t.achievements)==null?void 0:o.length)>0&&(e+=10),((l=t.industries)==null?void 0:l.length)>0&&(e+=5),e}function QO(t){return t<50?"#EF4444":t<80?"#F59E0B":"#1D9E75"}function jW(t){var s,o,l;const e=[],n=(s=t.work_history)==null?void 0:s[0];if(n!=null&&n.title&&(n!=null&&n.company)&&e.push(`Most recent role: ${n.title} at ${n.company}`),t.years_experience!=null&&((o=t.work_history)!=null&&o.length)){const d=[...new Set(t.work_history.map(h=>h.company).filter(h=>!!h))].slice(0,3);d.length>0&&e.push(`Career span: ${t.years_experience} years across ${d.join(", ")}`)}const r=(l=t.education)==null?void 0:l[0];if(r!=null&&r.institution&&e.push(`Education: ${r.degree?r.degree+" from ":""}${r.institution}`),t.summary){const d=t.summary.length>120?t.summary.slice(0,120)+"…":t.summary;e.push(`About: ${d}`)}return e}function TW(t){var r;const e=[];return t.summary||e.push("Add your LinkedIn URL to import your About section"),((r=t.work_history)==null?void 0:r.some(s=>{var o;return(o=s.description)==null?void 0:o.trim()}))||e.push("Add your resume to enrich your work history"),(!t.education||t.education.length===0)&&e.push("Education helps with certain role types"),e}function R2({className:t="w-8 h-8"}){return u.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[u.jsx("circle",{cx:"12",cy:"8",r:"4"}),u.jsx("path",{d:"M4 20c0-4 3.6-7 8-7s8 3 8 7"})]})}function O2({className:t="w-8 h-8"}){return u.jsx("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:u.jsx("path",{d:"M20 6 9 17l-5-5"})})}function D2({className:t="w-5 h-5"}){return u.jsx("svg",{className:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:u.jsx("path",{d:"M20.5 2h-17A1.5 1.5 0 002 3.5v17A1.5 1.5 0 003.5 22h17a1.5 1.5 0 001.5-1.5v-17A1.5 1.5 0 0020.5 2zM8 19H5v-9h3zM6.5 8.25A1.75 1.75 0 118.3 6.5a1.78 1.78 0 01-1.8 1.75zM19 19h-3v-4.74c0-1.42-.6-1.93-1.38-1.93A1.74 1.74 0 0013 14.19a.66.66 0 000 .14V19h-3v-9h2.9v1.3a3.11 3.11 0 012.7-1.4c1.55 0 3.36.86 3.36 3.66z"})})}function NW({profile:t,actions:e}){var o,l,d;const n=ZO(t),r=QO(n),s=kW((t==null?void 0:t.full_name)??null);return u.jsxs("aside",{className:"rounded-2xl p-6 flex flex-col",style:{background:"var(--sf-bg-card)",border:"1px solid var(--sf-border-subtle)"},children:[u.jsxs("div",{className:"flex flex-col items-center text-center",children:[u.jsx("div",{className:"w-20 h-20 rounded-full flex items-center justify-center overflow-hidden",style:{background:"rgba(29,158,117,0.2)",border:"2px solid rgba(29,158,117,0.3)"},children:t!=null&&t.profile_pic_url?u.jsx("img",{src:t.profile_pic_url,alt:t.full_name??"",referrerPolicy:"no-referrer",className:"w-full h-full object-cover rounded-full"}):s?u.jsx("span",{className:"text-2xl font-bold text-[#1D9E75]",children:s}):u.jsx("span",{className:"text-gray-400 dark:text-white/30",children:u.jsx(R2,{className:"w-9 h-9"})})}),t!=null&&t.full_name?u.jsx("h2",{className:"text-xl font-semibold mt-3 text-gray-900 dark:text-white",children:t.full_name}):u.jsx("h2",{className:"text-xl font-semibold mt-3 text-gray-400 dark:text-white/40",children:"No name yet"}),(t==null?void 0:t.current_title)&&u.jsx("p",{className:"text-sm mt-0.5 text-gray-600 dark:text-white/60",children:t.current_title}),(t==null?void 0:t.years_experience)!=null&&u.jsxs("span",{className:"inline-block mt-2 text-xs px-2.5 py-0.5 rounded-full font-medium",style:{background:"rgba(29,158,117,0.12)",color:"#1D9E75",border:"1px solid rgba(29,158,117,0.2)"},children:[t.years_experience," years exp"]})]}),u.jsxs("div",{className:"mt-5",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-xs text-gray-500 dark:text-white/40",children:"Profile strength"}),u.jsxs("span",{className:"text-xs text-gray-500 dark:text-white/40",children:[n,"%"]})]}),u.jsx("div",{className:"mt-1.5 w-full h-1.5 rounded-full overflow-hidden bg-gray-200 dark:bg-white/10",children:u.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${n}%`,background:r}})})]}),t?u.jsxs("div",{className:"mt-6 space-y-5 flex-1",children:[((o=t.
236work_history)==null?void 0:o.length)>0&&u.jsxs("div",{children:[u.jsx("p",{className:"text-[11px] font-medium uppercase tracking-[0.08em] mb-2 text-gray-500 dark:text-white/40",children:"Recent roles"}),u.jsx("div",{className:"space-y-2",children:t.work_history.slice(0,3).map((h,p)=>u.jsxs("div",{className:"text-sm",children:[u.jsxs("p",{className:"text-gray-900 dark:text-white/80",children:[h.title??"—",h.company&&u.jsxs("span",{className:"text-gray-500 dark:text-white/50",children:[" · ",h.company]})]}),(h.start||h.end)&&u.jsxs("p",{className:"text-xs text-gray-500 dark:text-white/40",children:[h.start??"?"," – ",h.end??"Present"]})]},p))})]}),((l=t.skills)==null?void 0:l.length)>0&&u.jsxs("div",{children:[u.jsx("p",{className:"text-[11px] font-medium uppercase tracking-[0.08em] mb-2 text-gray-500 dark:text-white/40",children:"Skills"}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.skills.slice(0,8).map(h=>u.jsx("span",{className:"text-xs px-2 py-0.5 rounded-md text-gray-700 dark:text-white/60",style:{background:"var(--sf-bg-elevated)"},children:h},h))})]}),((d=t.industries)==null?void 0:d.length)>0&&u.jsxs("div",{children:[u.jsx("p",{className:"text-[11px] font-medium uppercase tracking-[0.08em] mb-2 text-gray-500 dark:text-white/40",children:"Industries"}),u.jsx("p",{className:"text-xs text-gray-600 dark:text-white/40",children:t.industries.join(", ")})]}),e&&u.jsx("div",{className:"mt-auto pt-2",children:e})]}):u.jsxs("div",{className:"mt-6 flex-1 flex flex-col items-center justify-center text-center py-8",children:[u.jsx("span",{className:"text-gray-300 dark:text-white/20",children:u.jsx(R2,{className:"w-10 h-10"})}),u.jsx("p",{className:"text-sm font-medium mt-3 text-gray-600 dark:text-white/60",children:"No profile yet"}),u.jsx("p",{className:"text-xs mt-1 max-w-[200px] text-gray-500 dark:text-white/40",children:"Start with LinkedIn or paste your resume to get going"})]})]})}function k0({value:t,placeholder:e,onSave:n,type:r="text"}){const[s,o]=T.useState(!1),[l,d]=T.useState(t);return T.useEffect(()=>{d(t)}
236,[t]),s?u.jsx("input",{autoFocus:!0,type:r,value:l,onChange:h=>d(h.target.value),onBlur:()=>{o(!1),l!==t&&n(l)},onKeyDown:h=>{h.key==="Enter"&&h.target.blur(),h.key==="Escape"&&(d(t),o(!1))},className:"px-2 py-1 rounded-md text-sm text-gray-900 dark:text-[#F0F4F8] focus:outline-none w-full",style:ox}):u.jsx("button",{type:"button",onClick:()=>o(!0),className:"text-left text-sm px-2 py-1 -mx-2 -my-1 rounded-md transition-colors w-full text-gray-900 hover:text-gray-900 hover:bg-gray-100 dark:text-white/80 dark:hover:text-white dark:hover:bg-white/5",children:t||u.jsx("span",{className:"text-gray-400 dark:text-white/30",children:e})})}function AW(){const{user:t}=hn(),e=In(),[n,r]=T.useState(!0),[s,o]=T.useState("import"),[l,d]=T.useState("linkedin"),[h,p]=T.useState("text"),[g,m]=T.useState(!1),[y,b]=T.useState(""),[_,w]=T.useState(null),[S,E]=T.useState(""),[k,j]=T.useState(null),[N,O]=T.useState(null),[D,F]=T.useState(!1),[R,B]=T.useState(!1),[M,V]=T.useState("");T.useEffect(()=>{t&&Ye.from("profiles").select("raw_profile").eq("id",t.id).maybeSingle().then(({data:P})=>{if(P!=null&&P.raw_profile){const q=P.raw_profile;j(q),O(q),o("done")}r(!1)})},[t]);const W=async()=>{if(t){if(!S.trim()){V("Enter your LinkedIn profile URL first");return}V(""),e.capture("profile_import_started",{import_method:"linkedin"}),F(!0);try{const{data:P,error:q}=await Ye.functions.invoke("parse-profile",{body:{mode:"linkedin",linkedin_url:S.trim()}});if(q){V(q.message);return}if(P!=null&&P.error){V(P.error);return}j(P),m(!0),d("resume")}catch(P){V(P instanceof Error?P.message:"Extraction failed")}finally{F(!1)}}},Q=async()=>{if(!t)return;V("");const q=await(async()=>{if(h==="text"){if(!y.trim())return V("Paste your resume text first"),null}else if(!_)return V("Select a PDF file first"),null;const z={};return h==="text"?z.text=y:z.pdf_base64=await EW(_),g&&k?(z.mode="enrich",z.existing_profile=k):z.mode=h,z})();if(q){e.capture("profile_import_started",{import_method:g?`enrich-${h}`:h}),F(!0);try{const{data:z,error:X}=await Ye.functions.invoke("parse-profile",{body:q});if(X){V(X.message);return}if(z!=null&&z.error){V(z.error);return}j(z),o("review")}catch(z){V(z instanceof Error?z.message:"Extraction failed")}finally{F(!1)}}},K=()=>{V(""),o("review")},te=()=>{V(""),d("resume"),m(!1),j(null)},I=async()=>{if(!t||!k)return;V(""),B(!0);const{error:P}=await Ye.from("profiles").upsert({id:t.id,full_name:k.full_name,current_title:k.current_title,years_experience:k.years_experience,profile_pic_url:k.profile_pic_url??null,raw_profile:k,updated_at:new Date().toISOString()});P?V(P.message):(e.capture("profile_saved"),O(k),o("done")),B(!1)},H=()=>{E(""),b(""),w(null),V(""),m(!1),d("linkedin"),o("import")},G=()=>{b(""),w(null),V(""),m(!0),d("resume"),N&&j(N),o("import")},re=P=>{j(q=>q&&{...q,...P})},U=P=>{k&&re({skills:k.skills.filter(q=>q!==P)})};if(n)return u.jsx("div",{className:"flex items-center justify-center h-48",children:u.jsx("div",{className:"w-5 h-5 border-2 border-[#1D9E75] border-t-transparent rounded-full animate-spin"})});const A=s==="done"?N:k,$=s==="done"?u.jsxs("div",{className:"flex flex-col gap-1.5 w-full",children:[u.jsxs("button",{onClick:H,className:"text-xs rounded-lg px-3 py-1.5 transition-colors text-left flex items-center gap-2 border text-gray-600 border-gray-300 hover:text-gray-900 hover:border-gray-400 dark:text-white/60 dark:border-white/15 dark:hover:text-white dark:hover:border-white/30",children:[u.jsx(D2,{className:"w-3.5 h-3.5 text-[#0A66C2]"}),"Update LinkedIn"]}),u.jsx("button",{onClick:G,className:"text-xs rounded-lg px-3 py-1.5 transition-colors text-left border text-gray-600 border-gray-300 hover:text-gray-900 hover:border-gray-400 dark:text-white/60 dark:border-white/15 dark:hover:text-white dark:hover:border-white/30",children:"Add / update resume"})]}):null;return u.jsxs("div",{className:"max-w-5xl",children:[u.jsxs("div",{className:"mb-8",children:[u.jsx("h1",{className:"text-2xl font-semibold text-gray-900 dark:text-[#F0F4F8]",children:"Profile"}),u.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-[#8899AA]",children:"Import your resume or LinkedIn profile to power your Signal score matches."})]}),u.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[280px_1fr] gap-6",children:[u.jsx(NW,{profile:A,actions:$}),u.jsxs("div",{children:[s==="import"&&l==="linkedin"&&u.jsxs("div",{className:"rounded-2xl p-8",style:{background:"var(--sf-bg-card)",border:"1px solid var(--sf-border-subtle)"},children:[u.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[u.jsx("span",{className:"text-[#0A66C2]",children:u.jsx(D2,{className:"w-6 h-6"})}),u.jsx("span",{className:"text-[11px] font-medium uppercase tracking-[0.08em] text-gray-500 dark:text-white/40",children:"Step 1 · LinkedIn"})]}),u.jsx("h2",{className:"text-2xl font-semibold text-gray-900 dark:text-white",children:"Start with LinkedIn"}),u.jsx("p",{className:"text-sm mt-2 max-w-md text-gray-600 dark:text-white/60",children:"We'll import your full work history, education, and profile automatically."}),u.jsxs("div",{className:"mt-6",children:[u.jsx("label",{htmlFor:"profile-linkedin-url",className:"block text-sm font-medium text-gray-500 dark:text-[#8899AA] mb-1.5",children:"LinkedIn profile URL"}),u.jsx("input",{id:"profile-linkedin-url",type:"url",value:S,onChange:P=>E(P.target.value),placeholder:"https://www.linkedin.com/in/yourname",className:C2,style:ox}),u.jsx("p",{className:"mt-1.5 text-xs",style:{color:"var(--sf-text-muted)"},children:"Your public LinkedIn profile URL — not a job listing"})]}),M&&u.jsx("p",{className:"mt-4 text-sm text-red-400 px-3 py-2 rounded-lg",style:{background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.2)"},children:M}),u.jsx("div",{className:"mt-6 flex items-center gap-4",children:u.jsxs("button",{onClick:W,disabled:D,className:"px-5 py-2.5 bg-[#1D9E75] hover:bg-[#1D9E75]/90 disabled:opacity-40 disabled:cursor-not-allowed text-sm font-semibold text-white rounded-lg transition-all flex items-center gap-2",children:[D&&u.jsx("span",{className:"w-3.5 h-3.5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),D?"Importing from LinkedIn…":"Import from LinkedIn"]})}),u.jsx("button",{onClick:te,className:"mt-6 text-xs transition-colors text-gray-500 hover:text-gray-900 dark:text-white/40 dark:hover:text-white/70",children:"Don't have LinkedIn? →"})]}),s==="import"&&l==="resume"&&u.jsxs("div",{className:"rounded-2xl p-8",style:{background:"var(--sf-bg-card)",border:"1px solid var(--sf-border-subtle)"},children:[g&&u.jsxs("div",{className:"flex items-center gap-2 mb-3 text-[#1D9E75]",children:[u.jsx(O2,{className:"w-4 h-4"}),u.jsx("span",{className:"text-[11px] font-medium uppercase tracking-[0.08em]",children:"LinkedIn imported · Step 2"})]}),u.jsx("h2",{className:"text-2xl font-semibold text-gray-900 dark:text-white",children:g?"Enhance with your resume":"Import from resume"}),g&&u.jsx("p",{className:"text-sm mt-2 max-w-md text-gray-600 dark:text-white/60",children:"Your resume descriptions will be merged with your LinkedIn data for richer analysis."}),u.jsx("div",{className:"inline-flex gap-1 p-1 rounded-lg mt-6 mb-4",style:{background:"var(--sf-bg-elevated)"},children:["text","pdf"].map(P=>u.jsx("button",{onClick:()=>{p(P),V("")},className:`px-3 py-1.5 text-xs font-medium rounded-md transition-all ${h===P?"text-white":"text-gray-500 dark:text-[#8899AA] hover:text-gray-900 dark:hover:text-[#F0F4F8]"}`,style:h===P?{background:"#1D9E75"}:{},children:P==="text"?"Paste text":"Upload PDF"},P))}),h==="text"&&u.jsx("textarea",{value:y,onChange:P=>b(P.target.value),rows:12,placeholder:"Paste your resume text here…",className:`${C2} resize-none font-mono`,style:ox,"aria-label":"Resume text"}),h==="pdf"&&u.jsxs(u.Fragment,{children:[u.jsxs("button",{type:"button",className:"w-full flex flex-col items-center justify-center border-2 border-dashed rounded-lg p-10 text-center cursor-pointer transition-colors hover:border-[#1D9E75] focus-visible:border-[#1D9E75] focus:outline-none",style:{borderColor:"var(--sf-border-subtle)"},onClick:()=>{var P;return(P=document.getElementById("pdf-input"))==null?void 0:P.click()},"aria-label":_?`Replace selected PDF: ${_.name}`:"Select resume PDF",children:[u.jsx("svg",{className:"w-8 h-8 mb-3 text-gray-500 dark:text-[#8899AA]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),_?u.jsx("p",{className:"text-sm font-medium text-[#1D9E75]",children:_.name}):u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"text-sm text-gray-500 dark:text-[#8899AA]",children:"Click to select your resume PDF"}),u.jsx("p",{className:"text-xs mt-1",style:{color:"var(--sf-text-muted)"},children:"PDF only · max 10 MB"})]})]}),u.jsx("input",{id:"pdf-input",type:"file",accept:".pdf,application/pdf",className:"hidden",onChange:P=>{var q;return w(((q=P.target.files)==null?void 0:q[0])??null)}})]}),M&&u.jsx("p",{className:"mt-4 text-sm text-red-400 px-3 py-2 rounded-lg",style:{background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.2)"},children:M}),u.jsxs("div",{className:"mt-6 flex items-center gap-4",children:[u.jsxs("button",{onClick:Q,disabled:D,className:"px-5 py-2.5 bg-[#1D9E75] hover:bg-[#1D9E75]/90 disabled:opacity-40 disabled:cursor-not-allowed text-sm font-semibold text-white rounded-lg transition-all flex items-center gap-2",children:[D&&u.jsx("span",{className:"w-3.5 h-3.5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),D?g?"Enhancing profile…":"Extracting profile…":g?"Enhance profile":"Import resume"]}),g&&u.jsx("button",{onClick:K,className:"text-sm transition-colors text-gray-500 hover:text-gray-900 dark:text-white/50 dark:hover:text-white",children:"Skip for now →"})]})]}),s==="review"&&k&&u.jsxs("div",{children:[u.jsxs("div",{className:"mb-5",children:[u.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Review your profile"}),u.jsx("p",{className:"text-sm text-gray-600 dark:text-white/50",children:"Check the extracted data before saving"})]}),u.jsxs("div",{className:"rounded-xl p-4 mb-3",style:{background:"var(--sf-bg-elevated)"},children:[u.jsx("p",{className:"text-[11px] font-medium uppercase tracking-[0.08em] mb-3 text-gray-500 dark:text-white/40",children:"Basic info"}),u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-xs mb-1 text-gray-500 dark:text-white/40",children:"Full name"}),u.jsx(k0,{value:k.full_name??"",placeholder:"Add your full name",onSave:P=>re({full_name:P||null})})]}),u.jsxs("div",{children:[u.jsx("p",{className:"text-xs mb-1 text-gray-500 dark:text-white/40",children:"Current title"}),u.jsx(k0,{value:k.current_title??"",placeholder:"Add your current title",onSave:P=>re({current_title:P||null})})]}),u.jsxs("div",{children:[u.jsx("p",{className:"text-xs mb-1 text-gray-500 dark:text-white/40",children:"Years of experience"}),u.jsx(k0,{type:"number",value:k.years_experience!=null?String(k.years_experience):"",placeholder:"Add years",onSave:P=>{const q=P===""?null:Number(P);re({years_experience:Number.isFinite(q)?q:null})}})]})]})]}),k.work_history.length>0&&u.jsxs("div",{className:"rounded-xl p-4 mb-3",style:{background:"var(--sf-bg-elevated)"},children:[u.jsx("p",{className:"text-[11px] font-medium uppercase tracking-[0.08em] mb-3 text-gray-500 dark:text-white/40",children:"Work history"}),u.jsx("div",{className:"space-y-3",children:k.work_history.map((P,q)=>u.jsxs("div",{className:"text-sm",children:[u.jsxs("p",{className:"text-gray-900 dark:text-white",children:[P.title??"—",P.company&&u.jsxs("span",{className:"text-gray-600 dark:text-white/60",children:[" · ",P.company]})]}),(P.start||P.end)&&u.jsxs("p",{className:"text-xs mt-0.5 text-gray-500 dark:text-white/40",children:[P.start??"?"," – ",P.end??"Present"]})]},q))})]}),k.skills.length>0&&u.jsxs("div",{className:"rounded-xl p-4 mb-3",style:{background:"var(--sf-bg-elevated)"},children:[u.jsx("p",{className:"text-[11px] font-medium uppercase tracking-[0.08em] mb-3 text-gray-500 dark:text-white/40",children:"Skills"}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:k.skills.map(P=>u.jsxs("span",{className:"inline-flex items-center gap-1 text-xs pl-2 pr-1 py-0.5 rounded-md group text-gray-700 dark:text-white/70",style:{background:"var(--sf-bg-elevated)"},children:[P,u.jsx("button",{type:"button",onClick:()=>U(P),"aria-label":`Remove ${P}`,className:"w-4 h-4 inline-flex items-center justify-center rounded transition-colors text-gray-400 hover:text-gray-900 dark:text-white/30 dark:hover:text-white/80",children:"×"})]},P))})]}),k.education.length>0&&u.jsxs("div",{className:"rounded-xl p-4 mb-3",style:{background:"var(--sf-bg-elevated)"},children:[u.jsx("p",{className:"text-[11px] font-medium uppercase tracking-[0.08em] mb-3 text-gray-500 dark:text-white/40",children:"Education"}),u.jsx("div",{className:"space-y-2",children:k.education.map((P,q)=>u.jsxs("div",{className:"text-sm",children:[u.jsxs("p",{className:"text-gray-900 dark:text-white",children:[P.degree??"—",P.institution&&u.jsxs("span",{className:"text-gray-600 dark:text-white/60",children:[" · ",P.institution]})]}),P.year&&u.jsx("p",{className:"text-xs mt-0.5 text-gray-500 dark:text-white/40",children:P.year})]},q))})]}),k.achievements.length>0&&u.jsxs("div",{className:"rounded-xl p-4 mb-3",style:{background:"var(--sf-bg-elevated)"},children:[u.jsx("p",{className:"text-[11px] font-medium uppercase tracking-[0.08em] mb-3 text-gray-500 dark:text-white/40",children:"Achievements"}),u.jsx("ul",{className:"space-y-1.5",children:k.achievements.map((P,q)=>u.jsxs("li",{className:"text-sm flex gap-2 text-gray-700 dark:text-white/80",children:[u.jsx("span",{className:"text-[#1D9E75] mt-1.5 w-1 h-1 rounded-full bg-[#1D9E75] shrink-0"}),u.jsx("span",{children:P})]},q))})]}),M&&u.jsx("p",{className:"mt-3 mb-3 text-sm text-red-400 px-3 py-2 rounded-lg",style:{background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.2)"},children:M}),u.jsxs("div",{className:"flex items-center gap-3 mt-5",children:[u.jsxs("button",{onClick:I,disabled:R,className:"px-5 py-2.5 bg-[#1D9E75] hover:bg-[#1D9E75]/90 disabled:opacity-40 disabled:cursor-not-allowed text-sm font-semibold text-white rounded-lg transition-all flex items-center gap-2",children:[R&&u.jsx("span",{className:"w-3.5 h-3.5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),R?"Saving…":"Looks good — save profile"]}),u.jsx("button",{onClick:H,className:"px-4 py-2.5 text-sm transition-colors text-gray-500 hover:text-gray-900 dark:text-white/50 dark:hover:text-white",children:"Start over"})]})]}),s==="done"&&N&&(()=>{const P=jW(N),q=TW(N),z=ZO(N),X=QO(z);return u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"rounded-2xl p-6 flex items-center gap-4",style:{background:"var(--sf-bg-card)",border:"1px solid var(--sf-border-subtle)"},children:[u.jsx("div",{className:"w-12 h-12 shrink-0 rounded-full flex items-center justify-center text-[#1D9E75]",style:{background:"rgba(29,158,117,0.15)",border:"1px solid rgba(29,158,117,0.3)"},children:u.jsx(O2,{className:"w-6 h-6"})}),u.jsxs("div",{children:[u.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Your profile is ready"}),u.jsx("p",{className:"text-sm text-gray-600 dark:text-white/60",children:"Signal scores will reflect your full background."})]})]}),P.length>0&&u.jsxs("div",{className:"rounded-2xl p-5",style:{background:"var(--sf-bg-card)",border:"1px solid var(--sf-border-subtle)"},children:[u.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:"What the AI knows about you"}),u.jsx("ul",{className:"mt-3 space-y-2",children:P.map((se,ne)=>u.jsxs("li",{className:"text-sm flex gap-2.5 text-gray-700 dark:text-white/70",children:[u.jsx("span",{className:"text-[#1D9E75] mt-1.5 w-1.5 h-1.5 rounded-full bg-[#1D9E75] shrink-0"}),u.jsx("span",{children:se})]},ne))})]}),u.jsxs("div",{className:"rounded-2xl p-5",style:{background:"var(--sf-bg-card)",border:"1px solid var(--sf-border-subtle)"},children:[u.jsxs("div",{className:"flex items-center justify-bet
236ween",children:[u.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:"Profile strength"}),u.jsxs("span",{className:"text-xs text-gray-500 dark:text-white/40",children:[z,"%"]})]}),u.jsx("div",{className:"mt-2 w-full h-1.5 rounded-full overflow-hidden bg-gray-200 dark:bg-white/10",children:u.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${z}%`,background:X}})}),z<80&&q.length>0&&u.jsx("ul",{className:"mt-4 space-y-2",children:q.map((se,ne)=>u.jsxs("li",{className:"text-xs flex gap-2 text-gray-600 dark:text-white/60",children:[u.jsx("span",{className:"text-gray-400 dark:text-white/30",children:"→"}),u.jsx("span",{children:se})]},ne))})]}),u.jsxs("div",{className:"flex items-center gap-4 pt-1",children:[u.jsx(Kt,{to:"/tracker",className:"px-5 py-2.5 bg-[#1D9E75] hover:bg-[#1D9E75]/90 text-sm font-semibold text-white rounded-lg transition-all",children:"Analyze a role →"}),u.jsx("button",{onClick:H,className:"text-sm transition-colors text-gray-500 hover:text-gray-900 dark:text-white/50 dark:hover:text-white",children:"Update profile"})]})]})})()]})]})]})}const CW=1800*1e3;function Vd(t){return`discover_cache_${t}`}function RW(t){var e;try{const n=localStorage.getItem(Vd(t));if(!n)return null;const r=JSON.parse(n);if(!r||typeof r.savedAt!="string"||!Array.isArray((e=r.data)==null?void 0:e.results))return null;const s=Date.now()-new Date(r.savedAt).getTime();return!Number.isFinite(s)||s>CW?null:r}catch{return null}}function OW(t,e){try{localStorage.setItem(Vd(t),JSON.stringify(e))}catch{}}function e5(t){try{localStorage.removeItem(Vd(t))}catch{}}function DW(t){e5(t)}function IW(t,e){var n;try{const r=localStorage.getItem(Vd(t));if(!r)return;const s=JSON.parse(r);if(!Array.isArray((n=s==null?void 0:s.data)==null?void 0:n.results))return;s.data.results=s.data.results.filter(o=>o.id!==e),localStorage.setItem(Vd(t),JSON.stringify(s))}catch{}}function t5(t){return`discover_dismissed_${t}`}function MW(t){try{const e=localStorage.getItem(t5(t));if(e==null)return null;const n=JSON.parse(e);return Array.isArray(n)?n.filter(r=>typeof r=="string"):[]}catch{return[]}}async function LW(t,e){if(e.length>0){const{data:n,error:r}=await Ye.from("jobs").select("id").in("id",e);if(r)return;const s=(n??[]).map(o=>({user_id:t,job_id:o.id}));if(s.length>0){const{error:o}=await Ye.from("job_dismissals").upsert(s,{onConflict:"user_id,job_id",ignoreDuplicates:!0});if(o)return}}try{localStorage.removeItem(t5(t))}catch{}}function PW(t){return{id:t.id,title:t.job_title??"",company:t.company_name,company_domain:t.domain,logo_url:t.logo_url,score:typeof t.score=="number"?t.score:Math.round(t.similarity*100),summary:null,location:t.location,work_type:t.work_type,salary_min:t.salary_min,salary_max:t.salary_max,salary_currency:t.salary_currency,salary_pay_period:t.salary_pay_period,source_url:t.source_url,date_posted:t.date_posted,company_id:t.company_id,is_active:t.is_active??!0}}function FW(){const{user:t,session:e}=hn(),[n,r]=T.useState([]),[s,o]=T.useState([]),[l,d]=T.useState("your field"),[h,p]=T.useState(null),[g,m]=T.useState("loading"),[y,b]=T.useState(0),[_,w]=T.useState(!0),[S,E]=T.useState(!1),k=T.useRef(new Set),j=T.useRef(!1),N=T.useCallback((M,V)=>{if(!t)return;const W=Array.isArray(M.results)?M.results:[],Q=W.map(PW).filter(te=>!k.current.has(te.id)),K=Array.isArray(M.company_matches)?M.company_matches:[];r(Q),j.current=Q.length>0,b(M.total_count??W.length),w(M.is_premium!==!1),o(K),d(typeof M.user_function=="str
236ing"&&M.user_function.length>0?M.user_function:"your field"),p({user_id:t.id,last_refreshed_at:V,result_count:Q.length});try{localStorage.setItem(`discover_count_${t.id}`,String(Q.length));const te=Q.slice(0,3).map(H=>({title:H.title,company:H.company??"",logo_url:H.logo_url??null,domain:H.company_domain??null}));localStorage.setItem(`discover_preview_${t.id}`,JSON.stringify(te));const I=K.slice(0,3).map(H=>({company_id:H.company_id,company_name:H.company_name,domain:H.domain}));localStorage.setItem(`discover_companies_${t.id}`,JSON.stringify(I))}catch{}M.reason==="no_profile"?m("no-profile"):Q.length>0?m("results"):m("no-matches")},[t]),O=T.useCallback(async M=>{if(!t||!e)return;const V=(M==null?void 0:M.background)===!0&&j.current;V?E(!0):m("loading");const W="https://qhvibduggtmzvxeodory.supabase.co";try{const Q=await fetch(`${W}/functions/v1/get-recommendations`,{method:"POST",headers:{Authorization:`Bearer ${e.access_token}`,"Content-Type":"application/json"}});if(!Q.ok){console.error("useDiscover: get-recommendations failed",Q.status),hc(new Error(`get-recommendations failed: HTTP ${Q.status}`),{tags:{feature:"discover"},extra:{background:V}}),V||m("error");return}const K=await Q.json();if(!Array.isArray(K.results)&&K.reason!=="no_profile"&&K.reason!=="no_matches"){hc(new Error("get-recommendations returned 200 without a results array"),{tags:{feature:"discover"},extra:{background:V,reason:K.reason}}),V||m("error");return}fetch(`${W}/functions/v1/discover-from-coresignal`,{method:"POST",headers:{Authorization:`Bearer ${e.access_token}`,"Content-Type":"application/json"}}).catch(()=>{});const te=new Date().toISOString();K.reason==="ok"&&Array.isArray(K.results)&&K.results.length>0?OW(t.id,{savedAt:te,data:K}):e5(t.id),N(K,te)}catch(Q){console.error("useDiscover: fetch threw",Q),hc(Q,{tags:{feature:"discover"},extra:{background:V}}),V||m("error")}finally{E(!1)}},[t,e,N]);T.useLayoutEffect(()=>{if(k.current=new Set,!t)return;const M=MW(t.id);M!==null&&(k.current=new Set(M),LW(t.id,M))},[t==null?void 0:t.id]),T.useLayoutEffect(()=>{if(!t||!e)return;const M=RW(t.id);if(M){N(M.data,M.savedAt);return}O()},[t,e,N,O]);const D=T.useCallback(()=>{O({background:!0})},[O]),F=T.useCallback(()=>{O()},[O]),R=T.useCallback(M=>{k.current.add(M),t&&IW(t.id,M),r(V=>{const W=V.filter(Q=>Q.id!==M);return j.current=W.length>0,W})},[t]),B=T.useCallback(M=>{t&&Ye.from("job_dismissals").upsert({user_id:t.id,job_id:M},{onConflict:"user_id,job_id",ignoreDuplicates:!0}).then(({error:V})=>{V&&console.error("dismissal insert failed",V.message)}),R(M)},[t,R]);return{status:g,results:n,totalCount:y,isPremium:_,companyMatches:s,userFunction:l,meta:h,isRefreshing:S,refresh:D,refetch:F,dismiss:B,remove:R}}const lx=[{value:"ic",label:"IC"},{value:"manager",label:"Manager"},{value:"director",label:"Director"},{value:"vp",label:"VP"},{value:"csuite",label:"C-Suite"}],$W=["Seed","Series A-B","Series C+","Public","Any"],UW=["1-50","51-500","500-5K","5K+","Any"],zW=[{value:"remote",label:"Remote"},{value:"hybrid",label:"Hybrid"},{value:"onsite",label:"Onsite"},{value:"any",label:"Any"}],I2=["Tech","Fintech","Healthcare","Media","Retail","Legal","Education","Climate","Gov/Non-profit","Any"],BW=[10,25,50,100],M2=5,HW={target_titles:[],seniority:[],company_stages:[],company_sizes:[],work_type:null,location:null,locations:[],location_radius_miles:50,salary_min:null,salary_max:null,industries_yes:[],industries_no:[],onboarding_complete:!1};function Hu(t,e){return t.includes(e)?t.filter(n=>n!==e):[...t,e]}function j0(t){return(Array.isArray(t)?t:t?[t]:[]).filter(n=>lx.some(r=>r.value===n))}function qW(){$i({particleCount:200,spread:90,origin:{y:.6},colors:["#1D9E75","#ffffff","#0A1628","#34d399"]}),setTimeout(()=>{$i({particleCount:100,angle:60,spread:55,origin:{x:0},colors:["#1D9E75","#ffffff","#34d399"]})},200),setTimeout(()=>{$i({particleCount:100,angle:120,spread:55,origin:{x:1},colors:["#1D9E75","#ffffff","#34d399"]})},400)}function GW(t,e){if(t==null&&e==null)return null;const n=r=>r>=1e3?`$${Math.round(r/1e3)}k`:`$${r}`;return t!=null&&e!=null?`${n(t)} – ${n(e)}`:t!=null?`${n(t)}+`:`up to ${n(e)}`}const Ap=9,VW=4;function WW(t){const e=[...t].filter(o=>o.job_title).sort((o,l)=>l.similarity-o.similarity),n=new Set,r=[];for(const o of e){const l=o.company_id??o.id;n.has(l)||(n.add(l),r.push(o))}const s=[];if(r.length<=Ap)s.push(...r);else for(let o=0;o<Ap;o++)s.push(r[Math.floor(o*r.length/Ap)]);return s.map(o=>({job_id:o.id,title:o.job_title,company:o.company_name,company_domain:o.domain,logo_url:o.logo_url,location:o.location,work_type:o.work_type,salary_range:GW(o.salary_min,o.salary_max),source_url:o.source_url,similarity:o.similarity}))}function xo({active:t,variant:e="default",onClick:n,children:r}){const s=t?e==="danger"?{background:"rgba(239,68,68,0.18)",borderColor:"rgba(239,68,68,0.4)",color:"#FCA5A5"}:{background:"#1D9E75",borderColor:"#1D9E75",color:"#FFFFFF"}:{background:"var(--sf-bg-elevated)",borderColor:"var(--sf-border-subtle)",color:"var(--sf-text-muted)"};return u.jsx("button",{type:"button",onClick:n,className:"text-sm font-medium px-3 py-1.5 rounded-full border transition-colors hover:text-gray-900 dark:hover:text-white",style:s,children:r})}function YW({values:t,placeholder:e,onChange:n,ariaLabel:r}){const[s,o]=T.useState(""),l=h=>{const p=h.trim().replace(/,$/,"").trim();if(p){if(t.includes(p)){o("");return}n([...t,p]),o("")}},d=h=>{h.key==="Enter"||h.key===","?(h.preventDefault(),l(s)):h.key==="Backspace"&&s===""&&t.length>0&&n(t.slice(0,-1))};return u.jsxs("div",{children:[u.jsx("input",{type:"text",value:s,onChange:h=>o(h.target.value),onKeyDown:d,onBlur:()=>l(s),placeholder:e,"aria-label":r,className:"w-full px-3.5 py-2.5 rounded-lg text-sm text-gray-900 dark:text-[#F0F4F8] focus:outline-none",style:{background:"var(--sf-bg-elevated)",border:"1px solid var(--sf-border-subtle)"}}),t.length>0&&u.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:t.map(h=>u.jsxs("span",{className:"inline-flex items-center gap-1 text-xs pl-2.5 pr-1 py-1 rounded-full",style:{background:"rgba(29,158,117,0.15)",border:"1px solid rgba(29,158,117,0.3)",color:"#1D9E75"},children:[h,u.jsx("button",{type:"button",onClick:()=>n(t.filter(p=>p!==h)),"aria-label":`Remove ${h}`,className:"text-current opacity-60 hover:opacity-100 w-4 h-4 inline-flex items-center justify-center rounded",children:"×"})]},h))})]})}function KW({existingLabels:t,onSelect:e}){const[n,r]=T.useState(""),[s,o]=T.useState([]),[l,d]=T.useState(!1),[h,p]=T.useState(0),[g,m]=T.useState(!1),y=T.useRef(0),b=/\bremote\b/i.test(n),_=s.filter(E=>!t.includes(E.label));T.useEffect(()=>{const E=n.trim();if(E.length<3||b){o([]),d(!1),m(!1);return}m(!0);const k=++y.current,j=setTimeout(async()=>{const{data:N,error:O}=await Ye.functions.invoke("geocode-location",{body:{query:E}});if(k!==y.current)return;m(!1);const D=!O&&Array.isArray(N==null?void 0:N.candidates)?N.candidates:[];o(D),p(0),d(!0)},300);return()=>clearTimeout(j)},[n]);const w=E=>{e(E),r(""),o([]),d(!1),p(0)},S=E=>{if(E.key==="Escape"){d(!1);return}if(!l||_.length===0){E.key==="Enter"&&E.preventDefault();return}E.key==="ArrowDown"?(E.preventDefault(),p(k=>Math.min(k+1,_.length-1))):E.key==="ArrowUp"?(E.preventDefault(),p(k=>Math.max(k-1,0))):E.key==="Enter"&&(E.preventDefault(),w(_[Math.min(h,_.length-1)]))};return u.jsxs("div",{className:"relative",children:[u.jsx("input",{type:"text",value:n,onChange:E=>r(E.target.value),onKeyDown:S,onFocus:()=>{_.length>0&&d(!0)},onBlur:()=>d(!1),placeholder:"Search a city or area…","aria-label":"Add a location",role:"combobox","aria-expanded":l,className:"w-full px-3.5 py-2.5 rounded-lg text-sm text-gray-900 dark:text-[#F0F4F8] focus:outline-none",style:{background:"var(--sf-bg-elevated)",border:"1px solid var(--sf-border-subtle)"}}),b&&u.jsx("p",{className:"text-xs mt-1.5 text-gray-500 dark:text-white/40",children:'Looking for remote? Set "How do you want to work?" to Remote — remote jobs always pass location filtering.'}),l&&(g||_.length>0||n.trim().length>=3)&&!b&&u.jsxs("ul",{className:"absolute z-10 left-0 right-0 mt-1 rounded-lg overflow-hidden shadow-lg",style:{background:"var(--sf-bg-card)",border:"1px solid var(--sf-border-subtle)"}
236,role:"listbox",children:[_.map((E,k)=>u.jsx("li",{role:"option","aria-selected":k===h,onMouseDown:j=>{j.preventDefault(),w(E)},onMouseEnter:()=>p(k),className:"px-3.5 py-2 text-sm cursor-pointer text-gray-900 dark:text-[#F0F4F8]",style:k===h?{background:"var(--sf-bg-elevated)"}:void 0,children:E.label},E.label)),_.length===0&&u.jsx("li",{className:"px-3.5 py-2 text-sm text-gray-500 dark:text-white/40",children:g?"Searching…":"No matches — try a city name"})]})]})}function Ms({children:t,hint:e}){return u.jsxs("div",{className:"mb-2",children:[u.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:t}),e&&u.jsx("p",{className:"text-xs mt-0.5 text-gray-500 dark:text-white/40",children:e})]})}function L2({className:t="w-6 h-6"}){return u.jsx("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:u.jsx("path",{d:"M20 6 9 17l-5-5"})})}function JW({card:t,leavingDir:e}){var l;const[n,r]=T.useState(!1),s=t.logo_url??(t.company_domain?`https://cdn.brandfetch.io/${t.company_domain}?c=1idD04wBbxHKl8YzDko`:null),o=e==="left"?"translateX(-120%) rotate(-8deg)":e==="right"?"translateX(120%) rotate(8deg)":"translateX(0) rotate(0)";return u.jsxs("div",{className:"rounded-2xl p-6 shadow-2xl mx-auto max-w-sm",style:{background:"var(--sf-bg-card)",border:"1px solid var(--sf-border-subtle)",transform:o,opacity:e?0:1,transition:"transform 200ms ease, opacity 200ms ease"},children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-12 h-12 rounded-lg flex items-center justify-center shrink-0 overflow-hidden text-base font-bold text-gray-700 dark:text-white",style:{background:"var(--sf-bg-elevated)"},children:s&&!n?u.jsx("img",{src:s,alt:"",referrerPolicy:"no-referrer",onError:()=>r(!0),className:"w-full h-full object-contain"}):(((l=t.company)==null?void 0:l[0])??"?").toUpperCase()}),u.jsx("div",{className:"min-w-0",children:u.jsx("p",{className:"font-semibold truncate text-gray-900 dark:text-white",children:t.company??"Unknown company"})})]}),u.jsx("h3",{className:"text-xl font-semibold mt-5 text-gray-900 dark:text-white",children:t.title}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-1.5",children:[t.location&&u.jsx("span",{className:"text-xs text-gray-600 dark:text-white/60",children:t.location}),t.work_type&&u.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded font-medium capitalize",style:{background:"var(--sf-bg-elevated)",color:"var(--sf-text-muted)"},children:t.work_type}),t.salary_range&&u.jsx("span",{className:"text-xs text-gray-600 dark:text-white/60",children:t.salary_range})]})]})}function XW(){const{user:t}=hn(),{saveJob:e}=Ka(),{subscription:n}=zo(),r=Lr(),s=In(),[o,l]=T.useState(!0),[d,h]=T.useState("preferences"),[p,g]=T.useState(HW),[m,y]=T.useState(null),[b,_]=T.useState([]),[w,S]=T.useState(0),[E,k]=T.useState(null),[j,N]=T.useState(null),[O,D]=T.useState([]),[F,R]=T.useState(!1),[B,M]=T.useState(!1),[V,W]=T.useState(!1),[Q,K]=T.useState("");T.useEffect(()=>{t&&Ye.from("job_preferences").select("*").eq("user_id",t.id).maybeSingle().then(({data:z})=>{if(z){const X={id:z.id,user_id:z.user_id,target_titles:z.target_titles??[],seniority:j0(z.seniority),company_stages:z.company_stages??[],company_
236sizes:z.company_sizes??[],work_type:z.work_type??null,location:z.location??null,locations:z.locations??[],location_radius_miles:z.location_radius_miles??50,salary_min:z.salary_min??null,salary_max:z.salary_max??null,industries_yes:z.industries_yes??[],industries_no:z.industries_no??[],onboarding_complete:!!z.onboarding_complete};g(X),y(X),X.onboarding_complete&&h("done")}l(!1)})},[t]);const te=(z,X)=>{g(se=>({...se,[z]:X}))},I=async()=>{var z;if(t){if(K(""),p.target_titles.length===0){K("Add at least one target title");return}R(!0);try{const X=((z=p.locations[0])==null?void 0:z.label)??null,se={user_id:t.id,target_titles:p.target_titles,seniority:p.seniority,company_stages:p.company_stages,company_sizes:p.company_sizes,work_type:p.work_type,location:X,locations:p.locations,location_radius_miles:p.location_radius_miles??50,salary_min:p.salary_min,salary_max:p.salary_max,industries_yes:p.industries_yes,industries_no:p.industries_no,onboarding_complete:p.onboarding_complete,updated_at:new Date().toISOString()},{error:ne}=await Ye.from("job_preferences").upsert(se,{onConflict:"user_id"});if(ne)throw new Error(ne.message);M(!0);const ie={p_user_id:t.id,p_limit:30},{data:fe,error:_e}=await Ye.rpc("get_recommendations_for_user",ie);if(_e)throw new Error(_e.message);let Te=fe??[];if(Te.length<Ap){const xe=await Ye.rpc("get_recommendations_for_user",{...ie,p_min_similarity:.35});!xe.error&&Array.isArray(xe.data)&&xe.data.length>Te.length&&(Te=xe.data)}const Oe=WW(Te);if(Oe.length<VW){s.capture("goals_preferences_saved",{card_count:0,calibration_skipped:!0}),await G([]);return}s.capture("goals_preferences_saved",{card_count:Oe.length}),_(Oe),S(0),D([]),h("swipe")}catch(X){K(X instanceof Error?X.message:"Failed to save preferences")}finally{R(!1),M(!1)}}},H=async z=>{if(!t)return;const X=b[w];if(!X||E||j)return;N(z?"interested":"not");const se=[...O,{card:X,interested:z}];D(se),Ye.from("job_preference_swipes").insert({user_id:t.id,job_id:X.job_id,interested:z}).then(({error:ne})=>{ne&&console.error("swipe insert failed",ne.message)}),z&&X.source_url&&e(X.source_url,{limitSource:"goals",jobTitle:X.title,company:X.company}),setTimeout(()=>{k(z?"right":"left")},150),setTimeout(async()=>{const ne=w+1;ne>=b.length?(N(null),await G(se)):(S(ne),k(null),N(null))},350)},G=async z=>{var X,se,ne,ie,fe,_e;if(t){W(!0),DW(t.id);try{const Te=z.map(({card:Et,interested:Jt})=>({company:Et.company,title:Et.title,work_type:Et.work_type,location:Et.location,interested:Jt})),{data:Oe,error:xe}=await Ye.functions.invoke("infer-job-preferences",{body:{stated_preferences:p,swipes:Te}});xe&&console.error("infer failed",xe.message);const Ge=(Oe==null?void 0:Oe.refined)??{},Le={...p,...Ge,seniority:j0(Ge.seniority).length?j0(Ge.seniority):p.seniority,target_titles:(X=Ge.target_titles)!=null&&X.length?Ge.target_titles:p.target_titles,company_stages:(se=Ge.company_stages)!=null&&se.length?Ge.company_stages:p.company_stages,company_sizes:(ne=Ge.company_sizes)!=null&&ne.length?Ge.company_sizes:p.company_sizes,industries_yes:(ie=Ge.industries_yes)!=null&&ie.length?Ge.industries_yes:p.industries_yes,industries_no:(fe=Ge.industries_no)!=null&&fe.length?Ge.industries_no:p.industries_no,onboarding_complete:!0},{error:mt}=await Ye.from("job_preferences").upsert({user_id:t.id,target_titles:Le.target_titles,seniority:Le.seniority,company_stages:Le.company_stages,company_sizes:Le.company_sizes,work_type:Le.work_type,location:((_e=Le.locations[0])==null?void 0:_e.label)??null,locations:Le.locations,location_radius_miles:Le.location_radius_miles??50,salary_min:Le.salary_min,salary_max:Le.salary_max,industries_yes:Le.industries_yes,industries_no:Le.industries_no,onboarding_complete:!0,updated_at:new Date().toISOString()},{onConflict:"user_id"});mt&&console.error("update prefs failed",mt.message),s.capture("goals_onboarding_complete"),g(Le),y(Le),h("celebrate")}catch(Te){console.error("finalize failed",Te);const Oe={...p,onboarding_complete:!0};await Ye.from("job_preferences").update({onboarding_complete:!0,updated_at:new Date().toISOString()}).eq("user_id",t.id),g(Oe),y(Oe),h("celebrate")}finally{W(!1),k(null)}}};T.useEffect(()=>{if(d!=="swipe")return;const z=X=>{X.key==="ArrowLeft"&&H(!1),X.key==="ArrowRight"&&H(!0)};return window.addEventListener("keydown",z),()=>window.removeEventListener("keydown",z)},[d,w,E,j,b]),T.useEffect(()=>{if(d!=="celebrate")return;qW();const z=n.is_pro,X=setTimeout(()=>{r(z?"/discover":"/tracker")},2600);return()=>clearTimeout(X)},[d,n.is_pro,r]);const re=T.useMemo(()=>{const z=((m==null?void 0:m.seniority)??[]).map(X=>{var se;return(se=lx.find(ne=>ne.value===X))==null?void 0:se.label}).filter(X=>!!X);return z.length===0?null:z.length===1?z[0]:`${z.slice(0,-1).join(", ")} or ${z[z.length-1]}`},[m]);if(o)return u.jsx("div",{className:"flex items-center justify-center h-48",children:u.jsx("div",{className:"w-5 h-5 border-2 border-[#1D9E75] border-t-transparent roun
236ded-full animate-spin"})});if(d==="preferences")return u.jsxs("div",{className:"max-w-2xl",children:[u.jsxs("div",{className:"mb-8",children:[u.jsx("h1",{className:"text-2xl font-semibold text-gray-900 dark:text-[#F0F4F8]",children:"What are you looking for?"}),u.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-[#8899AA]",children:"Tell us what you want — we'll calibrate your Signal scores accordingly."})]}),u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{children:[u.jsx(Ms,{hint:"Press Enter or comma to add",children:"What roles are you targeting?"}),u.jsx(YW,{values:p.target_titles,placeholder:"e.g. VP of Talent Acquisition, Head of People…",onChange:z=>te("target_titles",z),ariaLabel:"Target job titles"})]}),u.jsxs("div",{children:[u.jsx(Ms,{children:"What level are you targeting?"}),u.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[lx.map(z=>u.jsx(xo,{active:p.seniority.includes(z.value),onClick:()=>te("seniority",Hu(p.seniority,z.value)),children:z.label},z.value)),u.jsx(xo,{active:p.seniority.length===0,onClick:()=>te("seniority",[]),children:"Any"})]})]}),u.jsxs("div",{children:[u.jsx(Ms,{children:"What company stage?"}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:$W.map(z=>u.jsx(xo,{active:p.company_stages.includes(z),onClick:()=>te("company_stages",Hu(p.company_stages,z)),children:z},z))})]}),u.jsxs("div",{children:[u.jsx(Ms,{children:"Company size?"}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:UW.map(z=>u.jsx(xo,{active:p.company_sizes.includes(z),onClick:()=>te("company_sizes",Hu(p.company_sizes,z)),children:z},z))})]}),u.jsxs("div",{children:[u.jsx(Ms,{children:"How do you want to work?"}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:zW.map(z=>u.jsx(xo,{active:p.work_type===z.value,onClick:()=>te("work_type",p.work_type===z.value?null:z.value),children:z.label},z.value))})]}),p.work_type!=="remote"&&u.jsxs("div",{children:[u.jsx(Ms,{hint:`Add up to ${M2} — pick from the suggestions`,children:"Where?"}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("div",{className:"flex-1",children:p.locations.length<M2&&u.jsx(KW,{existingLabels:p.locations.map(z=>z.label),onSelect:z=>{p.locations.some(X=>X.label===z.label)||te("locations",[...p.locations,z])}})}),u.jsx("select",{value:p.location_radius_miles??50,onChange:z=>te("location_radius_miles",Number(z.target.value)),"aria-label":"Search radius around each location",className:"px-3 py-2.5 rounded-lg text-sm text-gray-900 dark:text-[#F0F4F8] focus:outline-none self-start",style:{background:"var(--sf-bg-elevated)",border:"1px solid var(--sf-border-subtle)"},children:BW.map(z=>u.jsxs("option",{value:z,children:["Within ",z," mi of any"]},z))})]}),p.locations.length>0&&u.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:p.locations.map(z=>u.jsxs("span",{className:"inline-flex items-center gap-1 text-xs pl-2.5 pr-1 py-1 rounded-full",style:{background:"rgba(29,158,117,0.15)",border:"1px solid rgba(29,158,117,0.3)",color:"#1D9E75"},children:[z.label,u.jsx("button",{type:"button",onClick:()=>te("locations",p.locations.filter(X=>X.label!==z.label)),"aria-label":`Remove ${z.label}`,className:"text-current opacity-60 hover:opacity-100 w-4 h-4 inline-flex items-center justify-center rounded",children:"×"})]},z.label))})]}),u.jsxs("div",{children:[u.jsx(Ms,{children:"Target salary range"}),u.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-700 dark:text-white/70",children:[u.jsx("span",{children:"$"}),u.jsx("input",{type:"number",value:p.salary_min??"",onChange:z=>te("salary_min",z.target.value===""?null:Number(z.target.value)),placeholder:"180",className:"px-3 py-2 rounded-lg text-sm text-gray-900 dark:text-[#F0F4F8] focus:outline-none w-24",style:{background:"var(--sf-bg-elevated)",border:"1px solid var(--sf-border-subtle)"}}),u.jsx("span",{children:"K to $"}),u.jsx("input",{type:"number",value:p.salary_max??"",onChange:z=>te("salary_max",z.target.value===""?null:Number(z.target.value)),placeholder:"260",className:"px-3 py-2 rounded-lg text-sm text-gray-900 dark:text-[#F0F4F8] focus:outline-none w-24",style:{background:"var(--sf-bg-elevated)",border:"1px solid var(--sf-border-subtle)"}}),u.jsx("span",{children:"K"})]})]}),u.jsxs("div",{children:[u.jsx(Ms,{children:"Industries you're open to"}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:I2.map(z=>u.jsx(xo,{active:p.industries_yes.includes(z),onClick:()=>te("industries_yes",Hu(p.industries_yes,z)),children:z},z))})]}),u.jsxs("div",{children:[u.jsx(Ms,{children:"Industries to avoid"}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:I2.map(z=>u.jsx(xo,{variant:"danger",active:p.industries_no.includes(z),onClick:()=>te("industries_no",Hu(p.industries_no,z)),children:z},z))})]}),Q&&u.jsx("p",{className:"text-sm text-red-400 px-3 py-2 rounded-lg",style:{background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.2)"},children:Q}),u.jsxs("button",{onClick:I,disabled:F||B,className:"w-full mt-2 px-5 py-3 bg-[#1D9E75] hover:bg-[#1D9E75]/90 disabled:opacity-40 disabled:cursor-not-allowed text-sm font-semibold text-white rounded-lg transition-all flex items-center justify-center gap-2",children:[(F||B)&&u.jsx("span",{className:"w-3.5 h-3.5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),B?"Finding real roles…":F?"Saving…":"Find my matches →"]})]})]});if(d==="swipe"){const z=b[w];return u.jsxs("div",{className:"max-w-2xl mx-auto",children:[u.jsxs("div",{className:"mb-6 flex items-start justify-between",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"text-2xl font-semibold text-gray-900 dark:text-[#F0F4F8]",children:"Do these roles interest you?"}),u.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-[#8899AA]",children:"Swipe to help us understand what you actually want."})]}),u.jsxs("span",{className:"text-xs mt-2 text-gray-500 dark:text-white/40",children:[Math.min(w+1,b.length)," of ",b.length]})]}),V?u.jsxs("div",{className:"rounded-2xl p-12 text-center",style:{background:"var(--sf-bg-card)",border:"1px solid var(--sf-border-subtle)"},children:[u.jsx("div",{className:"w-6 h-6 mx-auto border-2 border-[#1D9E75] border-t-transparent roun
236ded-full animate-spin"}),u.jsx("p",{className:"text-sm mt-4 text-gray-600 dark:text-white/60",children:"Calibrating your preferences…"})]}):z?u.jsxs(u.Fragment,{children:[u.jsx(JW,{card:z,leavingDir:E}),u.jsxs("div",{className:"flex items-center justify-center gap-3 mt-8",children:[u.jsxs("button",{type:"button",onClick:()=>H(!1),disabled:!!E||!!j,className:`px-6 py-3 rounded-full text-sm font-medium border transition-all duration-150 disabled:cursor-not-allowed ${j==="not"?"bg-red-500/80 text-white border-red-500 scale-105":"bg-gray-100 border-gray-200 text-gray-600 hover:bg-gray-200 hover:text-gray-900 dark:bg-white/8 dark:border-white/20 dark:text-white/60 dark:hover:bg-white/12 dark:hover:text-white"}`,children:[u.jsx("span",{"aria-hidden":"true",children:"👎"})," Not for me"]}),u.jsxs("button",{type:"button",onClick:()=>H(!0),disabled:!!E||!!j,className:`px-6 py-3 rounded-full text-sm font-medium border transition-all duration-150 disabled:cursor-not-allowed ${j==="interested"?"bg-[#1D9E75] text-white border-[#1D9E75] scale-105":"bg-gray-100 border-gray-200 text-gray-600 hover:bg-[#1D9E75]/15 hover:border-[#1D9E75]/40 hover:text-[#1D9E75] dark:bg-white/8 dark:border-white/20 dark:text-white/60 dark:hover:bg-[#1D9E75]/20"}`,children:[u.jsx("span",{"aria-hidden":"true",children:"👍"})," Interested"]})]}),u.jsx("p",{className:"text-center text-[11px] mt-4 text-gray-500 dark:text-white/30",children:"← / → arrow keys also work"})]}):null]})}if(d==="celebrate")return u.jsx("div",{className:"max-w-2xl mx-auto",children:u.jsxs("div",{className:"rounded-2xl p-12 text-center",style:{background:"var(--sf-bg-card)",border:"1px solid var(--sf-border-subtle)"},children:[u.jsx("div",{className:"w-12 h-12 mx-auto rounded-full flex items-center justify-center text-[#1D9E75]",style:{background:"rgba(29,158,117,0.15)",border:"1px solid rgba(29,158,117,0.3)"},children:u.jsx(L2,{})}),u.jsx("h2",{className:"text-lg font-semibold mt-4 text-gray-900 dark:text-white",children:"Got it — your recommendations are tuned"}),u.jsx("p",{className:"text-sm mt-2 text-gray-600 dark:text-white/60",children:n.is_pro?"Taking you to Discover…":"Your tuned recommendations are waiting in Discover. Heading to your tracker…"})]})});const U=m??p,A=re??"Any-level",$=U.company_stages.length?U.company_stages.join(", "):"any stage",P=U.target_titles.slice(0,3).join(", "),q=U.salary_min&&U.salary_max?`$${U.salary_min}K - $${U.salary_max}K`:"Open";return u.jsxs("div",{className:"max-w-2xl",children:[u.jsxs("div",{className:"rounded-2xl p-6 flex items-center gap-4 mb-4",style:{background:"var(--sf-bg-card)",border:"1px solid var(--sf-border-subtle)"},children:[u.jsx("div",{className:"w-12 h-12 shrink-0 rounded-full flex items-center justify-center text-[#1D9E75]",style:{background:"rgba(29,158,117,0.15)",border:"1px solid rgba(29,158,117,0.3)"},children:u.jsx(L2,{})}),u.jsxs("div",{children:[u.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"You're all set"}),u.jsx("p",{className:"text-sm text-gray-600 dark:text-white/60",children:"We've calibrated your Signal scores based on your preferences."})]})]}),u.jsxs("div",{className:"rounded-2xl p-5 mb-4",style:{background:"var(--sf-bg-card)",border:"1px solid var(--sf-border-subtle)"},children:[u.jsx("h3",{className:"text-sm font-semibold mb-3 text-gray-900 dark:text-white",children:"Your calibration"}),u.jsxs("ul",{className:"space-y-2 text-sm text-gray-700 dark:text-white/70",children:[u.jsxs("li",{children:[u.jsx("span",{className:"text-gray-500 dark:text-white/40",children:"Looking for:"})," ",A," roles at ",$," companies"]}),P&&u.jsxs("li",{children:[u.jsx("span",{className:"text-gray-500 dark:text-white/40",children:"Targeting:"})," ",P]}),u.jsxs("li",{children:[u.jsx("span",{className:"text-gray-500 dark:text-white/40",children:"Salary:"})," ",q]}),U.industries_yes.length>0&&u.jsxs("li",{children:[u.jsx("span",{className:"text-gray-500 dark:text-white/40",children:"Industries:"})," ",U.industries_yes.join(", ")]}),U.industries_no.length>0&&u.jsxs("li",{children:[u.jsx("span",{className:"text-gray-500 dark:text-white/40",children:"Avoiding:"}
236)," ",U.industries_no.join(", ")]})]})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(Kt,{to:"/tracker",className:"px-5 py-2.5 bg-[#1D9E75] hover:bg-[#1D9E75]/90 text-sm font-semibold text-white rounded-lg transition-all",children:"Start analyzing roles →"}),u.jsx("button",{onClick:()=>h("preferences"),className:"px-4 py-2.5 text-sm transition-colors text-gray-600 hover:text-gray-900 dark:text-white/60 dark:hover:text-white",children:"Adjust preferences"}),u.jsx("button",{onClick:()=>{D([]),S(0),_([]),k(null),I()},className:"px-4 py-2.5 text-sm transition-colors text-gray-600 hover:text-gray-900 dark:text-white/60 dark:hover:text-white",children:"Redo calibration"})]})]})}const ZW="price_1TT6kXFxZgcolP8xp7CoQr62",QW="price_1TVKRQFxZgcolP8x3VpSdwHx",eY=["Unlimited AI job scoring","Up to 5 tracked jobs","Discover preview — top 5 matches","Job pipeline tracking"],tY=["Unlimited tracked jobs","Full Discover with fresh recommendations","Company intelligence — funding, growth, reviews","Full fit breakdown — pros, cons, skill gaps","Resume tips tailored to each role"],nY=[{q:"What is a Signal Score?",a:"A Signal Score shows how a job ranks against the other jobs matched to you — a score of 80 means it's a better fit than 80% of them — with a full breakdown of strengths, gaps, and tips to improve your application."},{q:"How is SignalFit different from job boards?",a:"We don't list jobs — we analyze them. Paste any job URL and get instant AI-powered fit analysis so you know where to focus your energy."},{q:"Can I cancel anytime?",a:"Yes. Monthly plans cancel at the end of the current month. Quarterly plans cancel at the end of the current 3-month period. Both plans auto-renew until cancelled — you can cancel anytime from your account settings."}];function n5(){const{user:t}=hn();return u.jsx("header",{className:"bg-white/95 border-b border-gray-200 dark:bg-[#0A1628]/95 dark:border-white/[0.08]",children:u.jsxs("div",{className:"max-w-6xl mx-auto px-6 h-16 flex items-center justify-between",children:[u.jsx(Kt,{to:"/",className:"flex items-center gap-2.5",children:u.jsxs("span",{className:"text-[18px] font-semibold tracking-tight",children:[u.jsx("span",{className:"text-gray-900 dark:text-[#F0F4F8]",children:"Signal"}),u.jsx("span",{style:{color:"#1D9E75"},children:"Fit"})]})}),t?u.jsx(Kt,{to:"/tracker",className:"text-sm transition-colors text-gray-600 hover:text-gray-900 dark:text-white/60 dark:hover:text-white",children:"← Back to tracker"}):u.jsx(Kt,{to:"/login",className:"text-sm transition-colors text-gray-600 hover:text-gray-900 dark:text-white/60 dark:hover:text-white",children:"Sign in"})]})})}function P2(){return u.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#1D9E75",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",className:"mt-0.5 shrink-0","aria-hidden":"true",children:u.jsx("polyline",{points:"20 6 9 17 4 12"})})}function rY({q:t,a:e}){const[n,r]=T.useState(!1),s=T.useId();return u.jsxs("div",{className:"rounded-lg overflow-hidden",style:{background:"var(--sf-bg-card)",border:"1px solid var(--sf-border-subtle)"},children:[u.jsxs("button",{type:"button",onClick:()=>r(o=>!o),"aria-expanded":n,"aria-controls":s,className:"w-full flex items-center justify-between gap-4 px-5 py-4 text-left hover:bg-gray-50 dark:hover:bg-white/[0.02] transition-colors",children:[u.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-[#F0F4F8]",children:t}),u.jsx("span",{"aria-hidden":"true",className:"text-[#1D9E75] text-lg leading-none transition-transform",style:{transform:n?"rotate(45deg)":"rotate(0deg)"},children:"+"})]}),n&&u.jsx("div",{id:s,className:"px-5 pb-4 text-sm leading-relaxed text-gray-500 dark:text-[#8899AA]",children:e})]})}function r5({billing:t,setBilling:e,isPro:n,redirecting:r,error:s,onProCta:o,freeCta:l}){const d=t==="quarterly";return u.jsxs("div",{className:"max-w-5xl mx-auto px-4 pb-20",children:[u.jsxs("div",{className:"mb-10 text-center pt-12 sm:pt-16",children:[u.jsx("h1",{className:"text-3xl sm:text-4xl font-bold text-gray-900 dark:text-[#F0F4F8] tracking-tight mb-4",children:"Know y
236our fit before you apply"}),u.jsx("p",{className:"text-base sm:text-lg text-gray-500 dark:text-[#8899AA] max-w-2xl mx-auto leading-relaxed",children:"Stop guessing. SignalFit analyzes every job against your profile so you only invest time where it counts."})]}),u.jsx("div",{className:"flex justify-center mb-10",children:u.jsxs("div",{className:"inline-flex p-1 rounded-full",style:{background:"var(--sf-bg-card)",border:"1px solid var(--sf-border-subtle)"},children:[u.jsx("button",{onClick:()=>e("monthly"),className:"px-5 py-2 text-sm font-medium rounded-full transition-all",style:{background:d?"transparent":"#1D9E75",color:d?"var(--sf-text-muted)":"#FFFFFF"},children:"Monthly"}),u.jsxs("button",{onClick:()=>e("quarterly"),className:"px-5 py-2 text-sm font-medium rounded-full transition-all flex items-center gap-2",style:{background:d?"#1D9E75":"transparent",color:d?"#FFFFFF":"var(--sf-text-muted)"},children:["Quarterly",u.jsx("span",{className:"text-xs font-semibold px-1.5 py-0.5 rounded",style:{background:d?"rgba(255,255,255,0.18)":"rgba(29,158,117,0.15)",color:d?"#FFFFFF":"#1D9E75"},children:"Save 32%"})]})]})}),u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 max-w-4xl mx-auto",children:[u.jsxs("div",{className:"flex flex-col p-7 rounded-2xl transition-all hover:translate-y-[-2px]",style:{background:"var(--sf-bg-card)",border:"1px solid var(--sf-border-subtle)"},children:[u.jsxs("div",{className:"mb-6",children:[u.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-[#F0F4F8] mb-3",children:"Free"}),u.jsx("div",{className:"flex items-baseline gap-1.5 mb-1",children:u.jsx("span",{className:"text-5xl font-bold text-gray-900 dark:text-[#F0F4F8] tracking-tight",children:"$0"})}),u.jsx("p",{className:"text-sm text-gray-500 dark:text-[#8899AA]",children:"Forever free"})]}),u.jsx("ul",{className:"flex-1 space-y-3 mb-7",children:eY.map(h=>u.jsxs("li",{className:"flex items-start gap-2.5 text-sm text-gray-900 dark:text-[#F0F4F8]",children:[u.jsx(P2,{}),u.jsx("span",{children:h})]},h))}),u.jsx("button",{onClick:l.onClick,disabled:l.disabled,className:`w-full py-3 text-sm font-semibold rounded-lg transition-all ${l.disabled?"cursor-default":"hover:bg-gray-50 dark:hover:bg-white/[0.04]"}`,style:{background:"transparent",color:"var(--sf-text-strong)",border:"1px solid var(--sf-border-subtle)"},children:l.label})]}),u.jsxs("div",{className:"flex flex-col p-7 rounded-2xl relative transition-all hover:translate-y-[-2px]",style:{backgroundColor:"#0A1628",backgroundImage:"linear-gradient(160deg, rgba(29,158,117,0.10) 0%, rgba(29,158,117,0) 55%)",border:"1px solid rgba(29,158,117,0.5)",transform:"scale(1.03)",boxShadow:"0 0 0 1px rgba(29,158,117,0.25), 0 0 40px rgba(29,158,117,0.18), 0 12px 40px rgba(0,0,0,0.35)"},children:[d&&u.jsx("span",{className:"absolute -top-3 right-6 text-xs font-semibold text-white px-3 py-1 rounded-full",style:{background:"#1D9E75",boxShadow:"0 4px 12px rgba(29,158,117,0.4)"},children:"Most popular"}),u.jsxs("div",{className:"mb-6",children:[u.jsx("h2",{className:"text-lg font-semibold text-[#F0F4F8] mb-3",children:"Pro"}),u.jsxs("div",{className:"flex items-baseline gap-2 mb-1",children:[u.jsx("span",{className:"text-5xl font-bold text-[#F0F4F8] tracking-tight",children:d?"$39":"$19"}),u.jsx("span",{className:"text-sm text-[#8899AA]",children:d?"every 3 months":"per month"})]}),d?u.jsx("p",{className:"text-sm font-semibold",style:{color:"#1D9E75"},children:"$13/mo · Save 32%"}):u.jsx("p",{className:"text-sm text-[#8899AA]",children:"Cancel anytime"})]}),u.jsx("ul",{className:"flex-1 space-y-3 mb-7",children:tY.map(h=>u.jsxs("li",{className:"flex items-start gap-2.5 text-sm text-[#F0F4F8]",children:[u.jsx(P2,{}),u.jsx("span",{children:h})]},h))}),n?u.jsx(Kt,{to:"/billing",className:"w-full py-3 text-sm font-semibold rounded-lg text-center block transition-colors hover:bg-[rgba(29,158,117,0.18)]",style:{background:"rgba(29,158,117,0.1)",color:"#1D9E75",border:"1px solid rgba(29,158,117,0.2)"},children:"Manage billing"}):u.jsxs("button",{onClick:o,disabled:r,className:"w-full py-3 text-sm font-semibold rounded-lg bg-[#1D9E75] hover:bg-[#17835f] disabled:opacity-40 disabled:cursor-not-allowed text-white transition-all flex items-center justify-center gap-2",style:{boxShadow:"0 8px 24px rgba(29,158,117,0.35)"},children:[r&&u.jsx("span",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),r?"Redirecting…":"Start Pro"]})]})]}),s&&u.jsx("p",{className:"mt-6 text-sm text-red-600 dark:text-red-400 px-3 py-2 rounded-lg text-center max-w-md mx-auto",style:{background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.2)"},children:s}),u.jsx("div",{className:"mt-14 grid grid-cols-1 sm:grid-cols-3 gap-4 max-w-3xl mx-auto",children:[{icon:"🔒",label:"Secure payments via Stripe"},{icon:"↩️",label:"Cancel anytime"},{icon:"🎯",label:"Built for job seekers"}].map(h=>u.jsxs("div",{className:"flex items-center justify-center gap-2 px-4 py-3 rounded-lg text-sm text-gray-500 dark:text-[#8899AA]",style:{background:"var(--sf-bg-elevated)",border:"1px solid var(--sf-border-subtle)"},children:[u.jsx("span",{"aria-hidden":"true",children:h.icon}),u.jsx("span",{children:h.label})]},h.label))}),u.jsxs("div",{className:"mt-16 max-w-2xl mx-auto",children:[u.jsx("h2",{className:"text-2xl font-semibold text-gray-900 dark:text-[#F0F4F8] text-center mb-6",children:"Frequently asked"}),u.jsx("div",{className:"space-y-3",children:nY.map(h=>u.jsx(rY,{q:h.q,a:h.a},h.q))})]})]})}function iY(){const t=Lr(),e=In(),[n,r]=T.useState("quarterly"),s=()=>{e.capture("pricing_signup_clicked",{billing_period:n,intent:"pro"}),t("/signup?next=/pricing")},o=()=>{e.capture("pricing_signup_clicked",{intent:"free"}),t("/signup")};return u.jsxs("div",{style:{background:"var(--sf-bg-canvas)",minHeight:"100vh",color:"var(--sf-text-strong)"},children:[u.jsx(n5,{}),u.jsx(r5,{billing:n,setBilling:r,isPro:!1,redirecting:!1,error:"",onProCta:s,freeCta:{label:"Get started free",onClick:o,disabled:!1}})]})}function sY(){const{subscription:t,loading:e}=zo(),n=In(),[r,s]=T.useState("quarterly"),[o,l]=T.useState(!1),[d,h]=T.useState(""),p=async()=>{var w;h(""),l(!0);const m=r==="quarterly"?QW:ZW,y=r==="quarterly"?39:19;(w=window.gtag)==null||w.call(window,"event","begin_checkout",{value:y,currency:"USD",items:[{item_id:`pro_${r}`,item_name:`SignalFit Pro (${r})`,price:y,quantity:1}]}),n.capture("checkout_started",{billing_period:r});const{data:b,error:_}=await Ye.functions.invoke("create-checkout-session",{body:{priceId:m}});if(_||!(b!=null&&b.url)){h("Failed to start checkout — please try again."),l(!1);return}window.location.href=b.url};if(e)return u.jsx("div",{className:"flex items-center justify-center h-48",children:u.jsx("div",{className:"w-5 h-5 border-2 border-[#1D9E75] border-t-transparent roun
236ded-full animate-spin"})});const g=t.is_pro;return u.jsxs("div",{style:{background:"var(--sf-bg-canvas)",minHeight:"100vh",color:"var(--sf-text-strong)"},children:[u.jsx(n5,{}),u.jsx(r5,{billing:r,setBilling:s,isPro:g,redirecting:o,error:d,onProCta:p,freeCta:{label:g?"Included in Pro":"Current plan",disabled:!0}})]})}function aY(){const{user:t,loading:e}=hn();return T.useEffect(()=>{window.scrollTo(0,0)},[]),e?u.jsx("div",{className:"flex items-center justify-center h-48",children:u.jsx("div",{className:"w-5 h-5 border-2 border-[#1D9E75] border-t-transparent rounded-full animate-spin"})}):t?u.jsx(sY,{}):u.jsx(iY,{})}const oY="price_1TT6kXFxZgcolP8xp7CoQr62",lY="price_1TVKRQFxZgcolP8x3VpSdwHx";function cY(t){return t===lY?{label:"Quarterly",amount:"$39 / quarter"}:t===oY?{label:"Monthly",amount:"$19 / month"}:{label:"Monthly",amount:"$19 / month"}}function uY(t){if(!t)return"—";const e=new Date(t);return Number.isNaN(e.getTime())?"—":e.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})}function dY(){const{subscription:t,loading:e}=zo(),n=In(),[r,s]=T.useState(!1),[o,l]=T.useState("");if(e)return u.jsx("div",{className:"flex items-center justify-center h-48",children:u.jsx("div",{className:"w-5 h-5 border-2 border-[#1D9E75] border-t-transparent rounded-full animate-spin"})});if(!t.is_pro)return u.jsx(Qd,{to:"/pricing",replace:!0});const d=cY(t.stripe_price_id),h=uY(t.current_period_end),p=t.monthly_analysis_count,g=t.status==="past_due",m=async()=>{l(""),s(!0),n.capture("billing_portal_opened");const{data:y,error:b}=await Ye.functions.invoke("create-portal-session");if(b||!(y!=null&&y.url)){console.error("create-portal-session failed",b),l("We couldn't open the billing portal — email [email protected] to make changes."),s(!1);return}window.location.href=y.url};return u.jsxs("div",{className:"max-w-3xl mx-auto py-8 px-4 space-y-6",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"text-2xl font-semibold text-gray-900 dark:text-[#F0F4F8]",children:"Billing"}),u.jsx("p",{className:"text-sm mt-1 text-gray-500 dark:text-[#8899AA]",children:"Manage your subscription, payment method, and invoices."})]}),u.jsxs("section",{className:"rounded-2xl p-6 border bg-white border-gray-200 dark:bg-[#0D1F35] dark:border-white/[0.08]",children:[u.jsxs("div",{className:"flex items-start justify-between gap-4 mb-5",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-xs uppercase tracking-wide mb-1 text-gray-500 dark:text-[#8899AA]",children:"Current plan"}),u.jsxs("div",{className:"flex items-center gap-2.5",children:[u.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-[#F0F4F8]",children:"Pro"}),g?u.jsx("span",{className:"text-[11px] font-medium px-2 py-0.5 rounded-full bg-[#F59E0B]/15 text-[#F59E0B] border border-[#F59E0B]/30",children:"Payment issue"}):u.jsx("span",{className:"text-[11px] font-medium px-2 py-0.5 rounded-full bg-[#1D9E75]/15 text-[#1D9E75] border border-[#1D9E75]/30",children:"Active"})]})]}),t.plan==="pro"&&(t.status==="active"||g)&&u.jsxs("button",{type:"button",onClick:m,disabled:r,className:"shrink-0 px-4 py-2 text-sm font-semibold rounded-lg transition-colors disabled:opacity-40 disabled:cursor-not-allowed inline-flex items-center gap-2 bg-[#1D9E75] text-white",children:[r&&u.jsx("span",{className:"w-3.5 h-3.5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),r?"Opening…":"Manage billing"]})]}),g&&u.jsxs("div",{className:"mb-5 flex items-start justify-between gap-4 text-sm px-4 py-3 rounded-lg border bg-[#F59E0B]/10 border-[#F59E0B]/30 text-amber-800 dark:bg-[#F59E0B]/[0.08] dark:border-[#F59E0B]/25 dark:text-[#F59E0B]",children:[u.jsx("p",{children:"There's a problem with your payment method — we'll keep retrying, and your Pro access continues in the meantime. Update your card to keep it that way."}),u.jsx("button",{type:"button",onClick:m,disabled:r,className:"shrink-0 text-sm font-semibold underline underline-offset-2 disabled:opacity-40",children:"Update card"})]}),u.jsxs("dl",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4 text-sm",children:[u.jsx(T0,{label:"Billing period",value:d.label}),u.jsx(T0,{label:"Amount",value:d.amount}),u.jsx(T0,{label:"Next billing date",value:h})]}),o&&u.jsx("p",{className:"mt-4 text-sm px-3 py-2 rounded-lg border bg-red-500/10 border-red-500/30 text-red-600 dark:bg-red-500/[0.08] dark:border-red-500/20 dark:text-red-400",children:o})]}),u.jsxs("section",{className:"rounded-2xl p-6 border bg-white border-gray-200 dark:bg-[#0D1F35] dark:border-white/[0.08]",children:[u.jsx("p",{className:"text-xs uppercase tracking-wide mb-3 text-gray-500 dark:text-[#8899AA]",children:"Usage this month"}),u.jsxs("div",{className:"flex items-baseline gap-2",children:[u.jsx("span",{className:"text-2xl font-semibold tabular-nums text-gray-900 dark:text-[#F0F4F8]",children:p}),u.jsx("span",{className:"text-sm text-gray-500 dark:text-[#8899AA]",children:"analyses · unlimited included"})]})]}),u.jsxs("p",{className:"text-xs text-gray-400 dark:text-[#8899AA]/70",children:["Need help? Email"," ",u.jsx("a",{href:"mailto:[email protected]",className:"text-[#1D9E75] hover:underline",children:"[email protected]"}),"."]})]})}function T0({label:t,value:e}){return u.jsxs("div",{children:[u.jsx("dt",{className:"text-[11px] uppercase tracking-wide mb-1 text-gray-500 dark:text-[#8899AA]",children:t}),u.jsx("dd",{className:"text-sm font-medium text-gray-900 dark:text-[#F0F4F8]",children:e})]})}const hY="c=1idD04wBbxHKl8YzDko",fY="id, company_id, source_url, job_title, location, salary, work_type, employment_type, seniority, applicant_count, job_description, job_description_formatted, first_seen_at, salary_min, salary_max, salary_currency, salary_pay_period, salary_raw, salary_source, ingestion_source, external_url, date_posted, val
236id_through, department, benefits, normalized_location, latitude, longitude, is_active, closed_at",pY="id, domain, name, logo_url, industry, description, size_range, employee_count, employee_count_change_pct, founded_year, ownership_status, last_funding_type, last_funding_amount, last_funding_date, hq_city, hq_country, employee_review_score, review_culture, review_work_life_balance, review_compensation, review_career_opportunities, active_job_postings_count, technologies_used, coresignal_last_updated, attrition_rate, job_postings_growth_pct, top_previous_companies, competitors, base_salary, website_visits_monthly, created_at, updated_at";async function mY(t){const{data:e,error:n}=await Ye.from("jobs").select(`${fY}, company:companies (${pY})`).eq("id",t).maybeSingle();return n||!e?null:e}function cx({size:t=11}){return u.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u.jsx("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2"}),u.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}function gY(t){if(!t)return"";const e=new Date(t);if(Number.isNaN(e.getTime()))return"";const n=Date.now()-e.getTime(),r=Math.floor(n/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const s=Math.floor(r/60);if(s<24)return`${s} hour${s===1?"":"s"} ago`;const o=Math.floor(s/24);return o<7?`${o} day${o===1?"":"s"} ago`:e.toLocaleDateString("en-US",{month:"short",day:"numeric"})}function vY(t,e){if(t==null&&e==null)return null;const n=r=>r>=1e3?`$${Math.round(r/1e3)}k`:`$${r}`;return t!=null&&e!=null?`${n(t)} – ${n(e)}`:t!=null?`${n(t)}+`:e!=null?`up to ${n(e)}`:null}function yY(t){if(!t)return null;const e=t.toLowerCase();return e==="remote"?"Remote":e==="hybrid"?"Hybrid":e==="onsite"||e==="on-site"||e==="on_site"?"Onsite":t}function i5({domain:t,name:e}){const[n,r]=T.useState(!1);if(t&&!n)return u.jsx("img",{src:`https://cdn.brandfetch.io/${t}/w/400/h/400?${hY}`,alt:e??"",onError:()=>r(!0),className:"w-12 h-12 rounded-lg object-cover shrink-0",style:{background:"var(--sf-bg-elevated)"}});const s=(e??"?").trim().charAt(0).toUpperCase()||"?";return u.jsx("div",{className:"w-12 h-12 rounded-lg shrink-0 flex items-center justify-center text-base font-semibold text-white",style:{background:"#1D9E75"},children:s})}function bY(){return u.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:u.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})}function ap({children:t}){return u.jsx("span",{className:"inline-flex items-center gap-1 text-[11px] px-2 py-0.5 rounded-full",style:{background:"var(--sf-bg-elevated)",color:"var(--sf-text-muted)",border:"1px solid var(--sf-border-subtle)"},children:t})}function xY({result:t,index:e,locked:n,onSaved:r,onDismiss:s,onView:o,viewLoading:l}){const{saveJob:d,showUpgradeModal:h}=Ka(),p=In(),[g,m]=T.useState("idle"),y=vY(t.salary_min,t.salary_max),b=yY(t.work_type),_=S=>{p.capture("discover_locked_content_clicked",{element:S}),h({variant:S==="add_to_tracker"?"discover-add":"discover-details",source:"discover",jobTitle:t.title,company:t.company})},w=async()=>{if(n){_("add_to_tracker");return}if(!t.source_url||g==="saving"||g==="saved")return;m("saving"),p.capture("discover_add_to_tracker",{score:t.score});const{error:S,limitReached:E}=await d(t.source_url,{limitSource:"discover",jobTitle:t.title,company:t.company});if(E){m("idle");return}if(S){m("error"),setTimeout(()=>m("idle"),2500);return}m("saved"),setTimeout(()=>r(t.id),1200)};return u.jsxs("div",{className:"discover-card group relative flex flex-col gap-3 p-5 rounded-xl",style:{background:"var(--sf-bg-card)",border:"1px solid var(--sf-border-subtle)",animationDelay:`${e*50}ms`},children:[u.jsx("button",{type:"button",onClick:()=>{p.capture("discover_job_dismissed",{job_id:t.id,company:t.company,job_title:t.title}),s(t.id)},"aria-label":"Dismiss recommendation",className:"absolute top-2 right-2 p-1 rounded text-gray-500 dark:text-[#8899AA] opacity-0 group-hover:opacity-100 focus-visible:opacity-100 hover:text-gray-900 dark:hover:text-[#F0F4F8] focus-visible:text-gray-900 dark:focus-visible:text-[#F0F4F8] transition-opacity",children:u.jsx(bY,{})}),u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx(i5,{domain:t.company_domain,name:t.company}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("h3",{className:"text-[15px] font-bold text-gray-900 dark:text-[#F0F4F8] leading-snug line-clamp-2",children:t.title}),t.company&&u.jsx("p",{className:"text-[12px] text-gray-500 dark:text-[#8899AA] mt-0.5 truncate",children:t.company})]}),n&&u.jsxs("span",{className:"shrink-0 self-start mt-0.5 mr-5 text-[11px] font-bold px-1.5 py-0.5 rounded whitespace-nowrap",style:{background:"rgba(29,158,117,0.15)",color:"#1D9E75",border:"1px solid rgba(29,158,117,0.3)"},children:[t.score," match"]})]}),n?u.jsxs("button",{type:"button",onClick:()=>_("details"),"aria-label":"Upgrade to unlock salary, location and role details",className:"relative text-left rounded-lg",children:[u.jsxs("div",{className:"blur-[6px] select-none pointer-events-none min-h-[26px] flex flex-wrap items-center gap-1.5","aria-hidden":"true",children:[t.location&&u.jsx(ap,{children:t.location}),b&&u.jsx(ap,{children:b}),y&&u.jsx("span",{className:"text-[12px] font-semibold",style:{color:"#1D9E75"},children:y})]}),u.jsxs("span",{className:"absolute inset-0 flex items-center justify-center gap-1.5 text-[#1D9E75]",children:[u.jsx(cx,{}),u.jsx("span",{className:"text-[11px] font-semibold",children:"Salary, location & role details — upgrade to unlock"})]})]}):u.jsxs(u.Fragment,{children:[(t.location||b||y)&&u.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[t.location&&u.jsx(ap,{children:t.location}),b&&u.jsx(ap,{children:b}),y&&u.jsx("span",{className:"text-[12px] font-semibold",style:{color:"#1D9E75"},children:y})]}),t.summary&&u.jsx("p",{className:"text-[13px] text-gray-500 dark:text-[#8899AA] leading-relaxed line-clamp-2",children:t.summary})]}),u.jsxs("div",{className:"flex items-center gap-2 mt-auto pt-3",style:{borderTop:"1px solid var(--sf-border-subtle)"},children:[u.jsx("button",{type:"button",onClick:w,disabled:!n&&(!t.source_url||g==="saving"||g==="saved"),className:"flex-1 px-3 py-2 text-xs font-semibold rounded-lg transition-colors disabled:opacity-60 disabled:cursor-not-allowed inline-flex items-center justify-center gap-1.5",style:{background:g==="saved"?"rgba(29,158,117,0.18)":"#1D9E75",color:g==="saved"?"#1D9
236E75":"#FFFFFF",border:g==="saved"?"1px solid rgba(29,158,117,0.4)":"1px solid transparent"},children:n?u.jsxs(u.Fragment,{children:[u.jsx(cx,{}),u.jsx("span",{children:"Add to tracker"})]}):u.jsxs(u.Fragment,{children:[g==="saving"&&"+ Adding…",g==="saved"&&"Added ✓",g==="error"&&"Try again",g==="idle"&&"+ Add to tracker"]})}),u.jsx("button",{type:"button",onClick:()=>o(t),disabled:l,className:"px-3 py-2 text-xs font-semibold rounded-lg transition-colors text-gray-500 dark:text-[#8899AA] hover:text-gray-900 dark:hover:text-[#F0F4F8] hover:bg-white/5 disabled:opacity-60 disabled:cursor-wait",style:{border:"1px solid var(--sf-border-subtle)"},children:l?"Opening…":"View job"})]})]})}function _Y({match:t,index:e}){const n=Lr(),r=In(),o=[t.industry,t.size_range].filter(d=>!!d).join(" · "),l=()=>{r.capture("discover_company_match_clicked",{company_id:t.company_id,company_name:t.company_name,similarity:t.similarity}),n(`/tracker?company=${t.company_id}`)};return u.jsxs("button",{type:"button",onClick:l,className:"discover-card group relative flex flex-col gap-2 p-4 rounded-xl text-left transition-colors hover:bg-white/[0.02]",style:{background:"var(--sf-bg-card)",border:"1px solid var(--sf-border-subtle)",minWidth:200,maxWidth:200,animationDelay:`${e*50}ms`},children:[u.jsx(i5,{domain:t.domain,name:t.company_name}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("h3",{className:"text-[14px] font-semibold text-gray-900 dark:text-[#F0F4F8] truncate",children:t.company_name??"Unknown company"}),o&&u.jsx("p",{className:"text-[11px] text-gray-500 dark:text-[#8899AA] mt-0.5 truncate",children:o})]})]})}function Mc({size:t=56}){return u.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"#1D9E75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u.jsx("circle",{cx:"12",cy:"12",r:"10"}),u.jsx("polygon",{points:"16.24,7.76 14.12,14.12 7.76,16.24 9.88,9.88",fill:"#1D9E75",stroke:"none"})]})}function wY(){return u.jsxs("div",{role:"status",className:"flex flex-col items-center justify-center py-24 px-6 text-center",children:[u.jsxs("div",{className:"relative w-48 h-48 flex items-center justify-center",children:[u.jsx("span",{className:"radar-ring","aria-hidden":!0}),u.jsx("span",{className:"radar-ring","aria-hidden":!0}),u.jsx("span",{className:"radar-ring","aria-hidden":!0}),u.jsx("div",{className:"relative z-10 w-20 h-20 rounded-full flex items-center justify-center",style:{background:"rgba(29,158,117,0.12)",border:"1px solid rgba(29,158,117,0.3)"},children:u.jsx(Mc,{size:40})})]}),u.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-[#F0F4F8] mt-8",children:"Scanning for your next opportunity…"}),u.jsx("p",{className:"text-sm text-gray-500 dark:text-[#8899AA] mt-2 max-w-sm",children:"We're searching live job postings that match your goals."})]})}const F2=["Scanning thousands of live roles","Scoring each one against your profile","Ranking your strongest matches","Almost there"];function SY(){return u.jsxs("div",{className:"flex flex-col gap-3 p-5 rounded-xl",style:{background:"var(--sf-bg-card)",border:"1px solid var(--sf-border-subtle)"},"aria-hidden":"true",children:[u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx("div",{className:"skeleton-block w-12 h-12 rounded-lg shrink-0"}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"skeleton-block h-4 w-3/4 rounded"}),u.jsx("div",{className:"skeleton-block h-3 w-1/2 rounded mt-2"})]})]}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("div",{className:"skeleton-block h-5 w-20 rounded-full"}),u.jsx("div",{className:"skeleton-block h-5 w-16 rounded-full"}),u.jsx("div",{className:"skeleton-block h-4 w-14 rounded"})]}),u.jsx("div",{className:"mt-auto pt-3",style:{borderTop:"1px solid var(--sf-border-subtle)"},children:u.jsx("div",{className:"skeleton-block h-8 w-full rounded-lg"})})]})}function EY(){const[t,e]=T.useState(0);return T.useEffect(()=>{if(t>=F2.length-1)return;const n=setTimeout(()=>e(r=>r+1),2500);return()=>clearTimeout(n)},[t]),u.jsxs("div",{role:"status","aria-live":"polite",children:[u.jsxs("div",{className:"flex flex-col items-center py-6",children:[u.jsx("span",{className:"compass-spin inline-flex",children:u.jsx(Mc,{size:40})}),u.jsxs("p",{className:"text-sm text-gray-500 dark:text-[#8899AA] mt-4",children:[F2[t],"…"]})]}),u.jsxs("div",{className:"mb-6",children:[u.jsx("div",{className:"skeleton-block h-7 w-64 roun
236ded-md"}),u.jsx("div",{className:"skeleton-block h-4 w-44 rounded-md mt-2"})]}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:Array.from({length:6}).map((n,r)=>u.jsx(SY,{},r))})]})}function kY({onSetGoals:t}){return u.jsxs("div",{className:"flex flex-col items-center justify-center py-24 px-6 text-center",children:[u.jsx("div",{className:"w-20 h-20 rounded-full flex items-center justify-center mb-6",style:{background:"rgba(29,158,117,0.08)",border:"1px solid rgba(29,158,117,0.2)"},children:u.jsx(Mc,{size:40})}),u.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-[#F0F4F8]",children:"Set your goals to unlock Discover"}),u.jsx("p",{className:"text-sm text-gray-500 dark:text-[#8899AA] mt-2 max-w-md",children:"Tell us what you're looking for and we'll find strong matches automatically."}),u.jsx("button",{type:"button",onClick:t,className:"mt-6 px-5 py-2.5 text-sm font-semibold rounded-lg text-white transition-colors",style:{background:"#1D9E75"},children:"Set your goals →"})]})}function jY({onSetUpProfile:t}){return u.jsxs("div",{className:"flex flex-col items-center justify-center py-24 px-6 text-center",children:[u.jsx("div",{className:"w-20 h-20 rounded-full flex items-center justify-center mb-6",style:{background:"rgba(29,158,117,0.08)",border:"1px solid rgba(29,158,117,0.2)"},children:u.jsx(Mc,{size:40})}),u.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-[#F0F4F8]",children:"Add your profile to unlock Discover"}),u.jsx("p",{className:"text-sm text-gray-500 dark:text-[#8899AA] mt-2 max-w-md",children:"We match roles against your work history. Import your LinkedIn or resume and we'll start surfacing jobs that fit."}),u.jsx("button",{type:"button",onClick:t,className:"mt-6 px-5 py-2.5 text-sm font-semibold rounded-lg text-white transition-colors",style:{background:"#1D9E75"},children:"Set up your profile →"})]})}function TY({onAdjustGoals:t}){return u.jsxs("div",{role:"status",className:"flex flex-col items-center justify-center py-24 px-6 text-center",children:[u.jsx("div",{className:"w-20 h-20 rounded-full flex items-center justify-center mb-6",style:{background:"rgba(136,153,170,0.08)",border:"1px solid var(--sf-border-subtle)"},children:u.jsx(Mc,{size:40})}),u.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-[#F0F4F8]",children:"No strong matches right now"}),u.jsx("p",{className:"text-sm text-gray-500 dark:text-[#8899AA] mt-2 max-w-md",children:"New jobs are added daily, so check back soon."}),u.jsx("button",{type:"button",onClick:t,className:"mt-6 px-4 py-2 text-sm font-medium rounded-lg border transition-colors text-gray-600 hover:text-gray-900 border-gray-300 hover:border-gray-400 dark:text-white/60 dark:hover:text-white dark:border-white/15 dark:hover:border-white/30",children:"Adjust your goals →"})]})}function NY({onRetry:t}){return u.jsxs("div",{role:"alert",className:"flex flex-col items-center justify-center py-24 px-6 text-center",children:[u.jsx("div",{className:"w-20 h-20 rounded-full flex items-center justify-center mb-6",style:{background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.25)"},children:u.jsx(Mc,{size:40})}),u.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-[#F0F4F8]",children:"Something went wrong loading matches"}),u.jsx("p",{className:"text-sm text-gray-500 dark:text-[#8899AA] mt-2 max-w-md",children:"This is on our end, not your search. Try again in a moment."}),u.jsx("button",{type:"button",onClick:t,className:"mt-6 px-5 py-2.5 text-sm font-semibold rounded-lg text-white transition-colors",style:{background:"#1D9E75"},children:"Retry"})]})}function AY(){const t=Lr(),e=In(),{user:n}=hn(),{showUpgradeModal:r,saveJob:s,addNote:o,analyzeJob:l,analyzingJobIds:d,trackings:h}=Ka(),{status:p,results:g,totalCount:m,isPremium:y,companyMatches:b,userFunction:_,meta:w,isRefreshing:S,refresh:E,dismiss:k,remove:j,refetch:N}=FW(),[O,D]=T.useState(null),[F,R]=T.useState(null),[B,M]=T.useState(!1),[V,W]=T.useState(!1),[Q,K]=T.useState(!1),te=O?h.find(ne=>ne.job_id===O.job.id&&ne.archived_at===null)??null:null,I=async ne=>{if(F)return;R(ne.id),e.capture("discover_job_viewed",{job_id:ne.id,company:ne.company,job_title:ne.title});const ie=await mY(ne.id);R(null),ie&&(W(!1),D({result:ne,job:ie}))},H=async()=>
236{if(!O||B)return;const{result:ne}=O;if(!y){e.capture("discover_locked_content_clicked",{element:"add_to_tracker"}),r({variant:"discover-add",source:"discover",jobTitle:ne.title,company:ne.company});return}if(!ne.source_url)return;M(!0),W(!1),e.capture("discover_add_to_tracker",{score:ne.score});const{error:ie,limitReached:fe}=await s(ne.source_url,{limitSource:"discover",jobTitle:ne.title,company:ne.company});if(M(!1),!fe){if(ie){W(!0);return}j(ne.id)}},G=async ne=>{var ie;(ie=ne.job)!=null&&ie.source_url&&(K(!0),await l(ne.job.source_url),K(!1))},[re,U]=T.useState(!1),A=g.filter(ne=>ne.is_active===!1).length,$=re?g:g.filter(ne=>ne.is_active!==!1),P=y?0:Math.max(0,m-5),q=y?$.length:m,z=T.useRef(!1);T.useEffect(()=>{p==="results"&&!y&&!z.current&&(z.current=!0,e.capture("discover_preview_shown",{visible_count:$.length}))},[p,y,$.length,e]);const X=()=>{e.capture("discover_locked_content_clicked",{element:"more_matches"}),r({variant:"discover-more",source:"discover",moreCount:P})};T.useEffect(()=>{if(n)try{localStorage.setItem(`discover_last_visited_${n.id}`,new Date().toISOString())}catch{}},[n]),T.useEffect(()=>{if(!(!n||p!=="results"))try{localStorage.setItem(`discover_last_seen_count_${n.id}`,localStorage.getItem(`discover_count_${n.id}`)??"0")}catch{}},[n,p,g.length]);const se=(w==null?void 0:w.last_refreshed_at)!=null&&Date.now()-new Date(w.last_refreshed_at).getTime()<60*6e4;return u.jsxs("div",{className:"max-w-5xl mx-auto py-8 px-4",children:[u.jsx("style",{children:`
237        @keyframes radar-ping {
238          0%   { transform: scale(0.35); opacity: 0.7; }
239          80%  { opacity: 0;             }
240          100% { transform: scale(2.2);  opacity: 0; }
241        }
242        .radar-ring {
243          position: absolute;
244          width: 120px;
245          height: 120px;
246          border: 1.5px solid #1D9E75;
247          border-radius: 9999px;
248          animation: radar-ping 2.6s cubic-bezier(0.2, 0.6, 0.2, 1) infinite;
249        }
250        .radar-ring:nth-child(2) { animation-delay: 0.86s; }
251        .radar-ring:nth-child(3) { animation-delay: 1.72s; }
252
253        @keyframes discover-card-in {
254          from { opacity: 0; transform: translateY(8px); }
255          to   { opacity: 1; transform: translateY(0);   }
256        }
257        .discover-card {
258          animation: discover-card-in 0.36s ease-out backwards;
259        }
260
261        @keyframes compass-spin {
262          to { transform: rotate(360deg); }
263        }
264        .compass-spin {
265          animation: compass-spin 9s linear infinite;
266        }
267
268        .skeleton-block {
269          position: relative;
270          overflow: hidden;
271          background: var(--sf-bg-elevated);
272        }
273        .skeleton-block::after {
274          content: '';
275          position: absolute;
276          inset: 0;
277          transform: translateX(-100%);
278          background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.18), transparent);
279          animation: skeleton-shimmer 1.6s ease-in-out infinite;
280        }
281        @keyframes skeleton-shimmer {
282          to { transform: translateX(100%); }
283        }
284
285        @media (prefers-reduced-motion: reduce) {
286          .radar-ring,
287          .discover-card,
288          .compass-spin,
289          .skeleton-block::after {
290            animation: none !important;
291          }
292        }
293      `}),p==="loading"&&u.jsx(EY,{}),p==="scanning"&&u.jsx(wY,{}),p==="no-goals"&&u.jsx(kY,{onSetGoals:()=>t("/goals")}),p==="no-profile"&&u.jsx(jY,{onSetUpProfile:()=>t("/profile")}),p==="no-matches"&&u.jsx(TY,{onAdjustGoals:()=>t("/goals")}),p==="error"&&u.jsx(NY,{onRetry:()=>void N()}),p==="results"&&u.jsxs(u.Fragment,{children:[u.jsxs("header",{className:"mb-6",children:[u.jsxs("div",{className:"flex items-baseline gap-3 flex-wrap",children:[u.jsxs("h1",{className:"text-2xl font-semibold text-gray-900 dark:text-[#F0F4F8]",children:[q," strong ",q===1?"match":"matches"," found"]}),se&&u.jsx("span",{className:"text-[10px] font-semibold tracking-wide px-1.5 py-0.5 rounded uppercase",style:{background:"rgba(29,158,117,0.15)",color:"#1D9E75",border:"1px solid rgba(29,158,117,0.3)"},children:"New"})]}),u.jsxs("p",{className:"text-sm text-gray-500 dark:text-[#8899AA] mt-1",children:["Based on your goals",(w==null?void 0:w.last_refreshed_at)&&u.jsxs(u.Fragment,{children:[" · Updated ",gY(w.last_refreshed_at)]})," · ",u.jsx("button",{type:"button",onClick:()=>E(),disabled:S,className:"text-[#1D9E75] font-medium hover:underline disabled:opacity-60 disabled:cursor-default",children:S?"Refreshing…":"Refresh matches"})]})]}),A>0&&u.jsx("div",{className:"mb-4 flex items-center gap-2",children:u.jsx("button",{type:"button",onClick:()=>U(ne=>!ne),className:"text-xs font-medium px-2.5 py-1 rounded-md border transition-colors text-gray-500 border-gray-300 hover:text-gray-900 hover:border-gray-400 dark:text-white/50 dark:border-white/20 dark:hover:text-white dark:hover:border-white/40",children:re?"Hide closed":`Show closed (${A})`})}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:$.map((ne,ie)=>u.jsx(xY,{result:ne,index:ie,locked:!y,onSaved:j,onDismiss:k,onView:fe=>void I(fe),viewLoading:F===ne.id},ne.id))}),P>0&&u.jsxs("button",{type:"button",onClick:X,className:"mt-4 w-full flex items-center justify-between px-5 py-4 rounded-xl text-left transition-colors hover:bg-white/[0.02]",style:{background:"var(--sf-bg-card)",border:"1px dashed rgba(29,158,117,0.4)"},children:[u.jsxs("span",{className:"text-sm font-semibold text-gray-900 dark:text-[#F0F4F8]",children:[P," more ",P===1?"match":"matches"," for you"]}),u.jsxs("span",{className:"text-xs font-semibold text-[#1D9E75] inline-flex items-center gap-1.5",children:[u.jsx(cx,{}),"Upgrade to see them all →"]})]}),b.length>0&&u.jsxs("section",{className:"mt-10",children:[u.jsxs("header",{className:"mb-4",children:[u.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-[#F0F4F8]",children:["These companies are actively scaling their ",_," function"]}),u.jsx("p",{className:"text-sm text-gray-500 dark:text-[#8899AA] mt-1",children:"Based on their current hiring patterns"})]}),u.jsx("div",{className:"flex gap-3 overflow-x-auto -mx-4 px-4 pb-2",children:b.map((ne,ie)=>u.jsx(_Y,{match:ne,index:ie},ne.company_id))})]})]}),O&&u.jsx(A_,{tracking:te,job:O.job,analyzing:Q||(te?d.has(te.job_id)||Wm(te):!1),companyLocked:!y,onAnalyze:ne=>void G(ne),onClose:()=>D(null),onAddNote:o,onAddToTracker:()=>void H(),addingToTracker:B,addFailed:V})]})}async function s5(t,e){const{data:{session:n}}=await Ye.auth.getSession();if(!n)throw new Error("Not authenticated");const r=`https://qhvibduggtmzvxeodory.supabase.co/functions/v1/${t}`,s=await fetch(r,{method:"POST",headers:{Authorization:`Bearer ${n.access_token}`,apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InFodmliZHVnZ3RtenZ4ZW9kb3J5Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3Nzc3NjI5MTQsImV4cCI6MjA5MzMzODkxNH0.Oq7WHovhSYyHj-Y_pbCXXmkykqOcsCaXtEhRSmxg9b0","Content-Type":"application/json"},body:JSON.stringify(e)});if(!s.ok){const o=await s.json().catch(()=>({error:"Request failed"}));throw new Error(o.error??`HTTP ${s.status}`)}return s.json()}function CY(){const{user:t}=hn(),[e,n]=T.useState([]),[r,s]=T.useState(!0),[o,l]=T.useState(null),d=T.useCallback(async()=>
293{if(!t){n([]),s(!1);return}s(!0),l(null);try{const{clients:h}=await s5("list-coach-clients",{});n(h??[])}catch(h){l(h instanceof Error?h.message:"Failed to load clients")}finally{s(!1)}},[t]);return T.useEffect(()=>{d()},[d]),{clients:e,loading:r,error:o,refetch:d}}function RY(t){const[e,n]=T.useState([]),[r,s]=T.useState(!1),[o,l]=T.useState(null),d=T.useCallback(async()=>{if(!t){n([]);return}s(!0),l(null);try{const{trackings:h}=await s5("get-client-jobs",{client_id:t});n(h??[])}catch(h){l(h instanceof Error?h.message:"Failed to load client jobs")}finally{s(!1)}},[t]);return T.useEffect(()=>{d()},[d]),{trackings:e,loading:r,error:o,refetch:d}}const OY="[email protected]";function DY({url:t,name:e,email:n,size:r=32}){const s=((e??n??"?").trim().charAt(0)||"?").toUpperCase();return t?u.jsx("img",{src:t,alt:"",referrerPolicy:"no-referrer",className:"rounded-full object-cover shrink-0",style:{width:r,height:r,background:"var(--sf-bg-elevated)"}}):u.jsx("div",{className:"rounded-full shrink-0 flex items-center justify-center text-white font-semibold",style:{width:r,height:r,background:"#1D9E75",fontSize:r<=28?11:13},children:s})}function IY({clients:t,selectedId:e,onSelect:n,onRemove:r}){return u.jsx("ul",{className:"space-y-1",children:t.map(s=>{const o=s.id===e;return u.jsx("li",{children:u.jsxs("div",{className:`group relative flex items-center gap-3 px-3 py-2 rounded-lg transition-colors ${o?"bg-gray-100 dark:bg-[#162440]":"hover:bg-white/5"}`,style:{border:o?"1px solid rgba(29,158,117,0.4)":"1px solid transparent"},children:[u.jsxs("button",{type:"button",onClick:()=>n(s.id),className:"flex-1 min-w-0 flex items-center gap-3 text-left",children:[u.jsx(DY,{url:s.profile_pic_url,name:s.full_name,email:s.email,size:36}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("p",{className:"text-[13px] font-medium text-gray-900 dark:text-[#F0F4F8] truncate",children:s.full_name??s.email??"Unknown client"}),s.email&&u.jsx("p",{className:"text-[11px] text-gray-500 dark:text-[#8899AA] truncate",children:s.email})]})]}),u.jsx("button",{type:"button",onClick:l=>{l.stopPropagation(),r(s)},title:"Remove client","aria-label":`Remove ${s.full_name??s.email??"client"}`,className:"shrink-0 w-6 h-6 rounded-md flex items-center justify-center text-gray-500 dark:text-[#8899AA] hover:text-[#EF4444] hover:bg-white/5 opacity-0 group-hover:opacity-100 focus-visible:opacity-100 transition-opacity",children:u.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round","aria-hidden":"true",children:u.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})})]})},s.id)})})}function MY({client:t,removing:e,error:n,onCancel:r,onConfirm:s}){const o=t.full_name??t.email??"this client",l=T.useId();return T.useEffect(()=>{const d=h=>{h.key==="Escape"&&!e&&r()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[r,e]),u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{background:"rgba(0,0,0,0.6)"},onClick:r,children:u.jsxs("div",{className:"w-full max-w-sm rounded-xl p-6",style:{background:"var(--sf-bg-card)",border:"1px solid var(--sf-border-subtle)"},onClick:d=>d.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":l,children:[u.jsxs("h2",{id:l,className:"text-base font-semibold text-gray-900 dark:text-[#F0F4F8] mb-2",children:["Remove ",o," from your clients?"]}),u.jsx("p",{className:"text-xs text-gray-500 dark:text-[#8899AA] mb-4",children:"This unlinks them from your coach view. None of their data is deleted."}),n&&u.jsx("p",{className:"text-xs text-[#EF4444] mb-3",children:n}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx("button",{type:"button",onClick:r,disabled:e,className:"px-3 py-1.5 text-xs font-medium rounded-lg text-gray-500 dark:text-[#8899AA] hover:text-gray-900 dark:hover:text-[#F0F4F8] transition-colors",children:"Cancel"}),u.jsx("button",{type:"button",onClick:s,disabled:e,className:"px-3 py-1.5 text-xs font-semibold rounded-lg transition-opacity disabled:opacity-50",style:{background:"#EF4444",color:"var(--sf-text-strong)"},children:e?"Removing…":"Remove"})]})]})})}async function ux(t,e){const{data:{session:n}}=await Ye.auth.getSession();if(!n)throw new Error("Not authenticated");const r=await fetch(`https://qhvibduggtmzvxeodory.supabase.co/functions/v1/${t}`,{method:"POST",headers:{Authorization:`Bearer ${n.access_token}`,apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InFodmliZHVnZ3RtenZ4ZW9kb3J5Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3Nzc3NjI5MTQsImV4cCI6MjA5MzMzODkxNH0.Oq7WHovhSYyHj-Y_pbCXXmkykqOcsCaXtEhRSmxg9b0","Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){const s=await r.json().catch(()=>({}));throw new Error(s.error??`HTTP ${r.status}`)}return r.json()}function LY({existingClientIds:t,onClose:e,onAdded:n}){const[r,s]=T.useState(""),[o,l]=T.useState([]),[d,h]=T.useState(!1),[p,g]=T.useState(null),[m,y]=T.useState(null),[b,_]=T.useState(null),w=T.useRef(null),S=T.useId();T.useEffect(()=>{const j=N=>{N.key==="Escape"&&e()};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[e]);const E=T.useCallback(async j=>{if(!j.trim()){l([]),h(!1);return}h(!0),g(null);try{const{users:N}=await ux("search-users",{query:j});l(N??[])}catch(N){g(N instanceof Error?N.message:"Search failed")}finally{h(!1)}},[]);T.useEffect(()=>(w.current&&window.clearTimeout(w.current),w.current=window.setTimeout(()=>void E(r),250),()=>{w.current&&window.clearTimeout(w.current)}),[r,E]);const k=async j=>{y(j.id),_(null);try{await ux("add-coach-client",{client_id:j.id}),n(j.id)}catch(N){_(N instanceof Error?N.message:"Failed to add client")}finally{y(null)}};return u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{background:"rgba(0,0,0,0.6)"},onClick:e,children:u.jsxs("div",{className:"w-full max-w-md rounded-xl p-6 flex flex-col",style:{background:"var(--sf-bg-card)",border:"1px solid var(--sf-border-subtle)",maxHeight:"70vh"},onClick:j=>j.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":S,children:[u.jsx("h2",{id:S,className:"text-lg font-semibold text-gray-900 dark:text-[#F0F4F8] mb-1",children:"Add a client"}),u.jsx("p",{className:"text-xs text-gray-500 dark:text-[#8899AA] mb-4",children:"Search by email or name to link an existing user as your client."}),u.jsx("input",{type:"text",autoFocus:!0,value:r,onChange:j=>s(j.target.value),placeholder:"Search by email or name…",className:"w-full px-3 py-2 text-sm rounded-lg outline-none focus:ring-2 focus:ring-[#1D9E75]/40 mb-3",style:{background:"var(--sf-bg-canvas)",border:"1px solid var(--sf-border-subtle)",color:"var(--sf-text-strong)"}}),b&&u.jsx("p",{className:"text-xs text-[#EF4444] mb-2",children:b}),p&&u.jsx("p",{className:"text-xs text-[#EF4444] mb-2",children:p}),u.jsx("div",{className:"flex-1 overflow-y-auto -mx-2",children:r.trim()?d?u.jsx("p",{className:"text-xs text-gray-500 dark:text-[#8899AA] px-2 py-4 text-center",children:"Searching…"}):o.length===0?u.jsx("p",{className:"text-xs text-gray-500 dark:text-[#8899AA] italic px-2 py-4 text-center",children:"No users found"}):u.jsx("ul",{className:"space-y-1",children:o.map(j=>{const N=t.has(j.id),O=m===j.id,D=((j.full_name??j.email??"?").trim().charAt(0)||"?").toUpperCase();return u.jsx("li",{children:u.jsxs("button",{type:"button",disabled:N||O,onClick:()=>void k(j),className:`w-full flex items-center gap-3 px-2 py-2 rounded-lg text-left transition-colors ${N?"opacity-50 cursor-default":"hover:bg-white/5"}`,children:[j.avatar_url?u.jsx("img",{src:j.avatar_url,alt:"",referrerPolicy:"no-referrer",className:"w-8 h-8 rounded-full object-cover shrink-0",style:{background:"var(--sf-bg-elevated)"}}):u.jsx("div",{className:"w-8 h-8 rounded-full shrink-0 flex items-center justify-center text-white text-xs font-semibold",style:{background:"#1D9E75"},children:D}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("p",{className:"text-[13px] font-medium text-gray-900 dark:text-[#F0F4F8] truncate",children:j.full_name??j.email??"Unknown user"}),j.email&&j.full_name&&u.jsx("p",{className:"text-[11px] text-gray-500 dark:text-[#8899AA] truncate",children:j.email})]}),u.jsx("span",{className:"text-[11px] shrink-0",children:N?u.jsx("span",{className:"text-gray-500 dark:text-[#8899AA]",children:"Linked"}):O?u.jsx("span",{className:"text-[#1D9E75]",children:"Adding…"}):u.jsx("span",{className:"text-[#1D9E75] font-semibold",children:"+ Add"})})]})},j.id)})}):u.jsx("p",{className:"text-xs text-gray-500 dark:text-[#8899AA] italic px-2 py-4 text-center",children:"Type to search…"})}),u.jsx("div",{className:"flex justify-end pt-3 mt-2",style:{borderTop:"1px solid var(--sf-border-subtle)"},children:u.jsx("button",{type:"button",onClick:e,className:"px-3 py-1.5 text-xs font-medium rounded-lg text-gray-500 dark:text-[#8899AA] hover:text-gray-900 dark:hover:text-[#F0F4F8] transition-colors",children:"Close"})})]})})}function PY({client:t,onClose:e,onAdded:n}){const[r,s]=T.useState(""),[o,l]=T.useState(!1),[d,h]=T.useState(null),p=T.useId();T.useEffect(()=>{const m=y=>{y.key==="Escape"&&!o&&e()};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[e,o]);const g=async m=>{m.preventDefault();const y=r.trim();if(y){l(!0),h(null);try{const{data:{session:b}}=await Ye.auth.getSession();if(!b)throw new Error("Not authenticated");const _=await fetch("https://qhvibduggtmzvxeodory.supabase.co/functions/v1/add-client-job",{method:"POST",headers:{Authorization:`Bearer ${b.access_token}`,apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InFodmliZHVnZ3RtenZ4ZW9kb3J5Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3Nzc3NjI5MTQsImV4cCI6MjA5MzMzODkxNH0.Oq7WHovhSYyHj-Y_pbCXXmkykqOcsCaXtEhRSmxg9b0","Content-Type":"application/json"},body:JSON.stringify({client_id:t.id,url:y})});if(!_.ok){const w=await _.json().catch(()=>({}));throw new Error(w.error??`HTTP ${_.status}`)}n(),e()}catch(b){h(b instanceof Error?b.message:"Failed to add job")}finally{l(!1)}}};return u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{background:"rgba(0,0,0,0.6)"},onClick:e,children:u.jsxs("div",{className:"w-full max-w-md rounded-xl p-6",style:{background:"var(--sf-bg-card)",border:"1px solid var(--sf-border-subtle)"},onClick:m=>m.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":p,children:[u.jsxs("h2",{id:p,className:"text-lg font-semibold text-gray-900 dark:text-[#F0F4F8] mb-1",children:["Add job for ",t.full_name??t.email??"client"]}),u.jsx("p",{className:"text-xs text-gray-500 dark:text-[#8899AA] mb-4",children:"Paste a job URL — SignalFit will scrape and save it to their tracker."}),u.jsxs("form",{onSubmit:g,className:"space-y-3",children:[u.jsx("input",{type:"url",required:!0,autoFocus:!0,value:r,onChange:m=>s(m.target.value),placeholder:"https://...",disabled:o,className:"w-full px-3 py-2 text-sm rounded-lg outline-none focus:ring-2 focus:ring-[#1D9E75]/40",style:{background:"var(--sf-bg-canvas)",border:"1px solid var(--sf-border-subtle)",color:"var(--sf-text-strong)"}}),d&&u.jsx("p",{className:"text-xs text-[#EF4444]",children:d}),u.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[u.jsx("button",{type:"button",onClick:e,disabled:o,className:"px-3 py-1.5 text-xs font-medium rounded-lg text-gray-500 dark:text-[#8899AA] hover:text-gray-900 dark:hover:text-[#F0F4F8] transition-colors",children:"Cancel"}),u.jsx("button",{type:"submit",disabled:o||!r.trim(),className:"px-3 py-1.5 text-xs font-semibold rounded-lg transition-opacity disabled:opacity-50",style:{background:"#1D9E75",color:"var(--sf-text-strong)"},children:o?"Adding…":"Add job"})]})]})]})})}function FY(){var te;const{user:t}=hn(),{subscription:e}=zo(),{clients:n,loading:r,error:s,refetch:o}=CY(),[l,d]=T.useState(null),[h,p]=T.useState(!1),[g,m]=T.useState(!1),[y,b]=T.useState(null),[_,w]=T.useState(null),[S,E]=T.useState(!1),[k,j]=T.useState(null),N=T.useMemo(()=>new Set(n.map(I=>I.id)),[n]),O=async()=>
293{if(_){E(!0),j(null);try{await ux("remove-coach-client",{client_id:_.id});const I=_.id;w(null),await o(),l===I&&d(null)}catch(I){j(I instanceof Error?I.message:"Failed to remove client")}finally{E(!1)}}},{trackings:D,loading:F,error:R,refetch:B}=RY(l);T.useEffect(()=>{l===null&&n.length>0&&d(n[0].id)},[n,l]),T.useEffect(()=>{b(null)},[l]);const M=T.useMemo(()=>{const I={saved:0,applied:0,interviewing:0,offer:0,rejected:0};for(const H of D)I[H.stage]++;return I},[D]),V=T.useMemo(()=>{const I={saved:[],applied:[],interviewing:[],offer:[],rejected:[]};for(const H of D)I[H.stage].push(H);for(const H of _m)I[H].sort((G,re)=>new Date(re.created_at).getTime()-new Date(G.created_at).getTime());return I},[D]),W=T.useMemo(()=>new Map,[]),Q=y?D.find(I=>I.id===y)??null:null;if(t&&t.email!==OY)return u.jsx(Qd,{to:"/tracker",replace:!0});const K=n.find(I=>I.id===l)??null;return u.jsxs("div",{className:"flex -m-8 h-screen overflow-hidden",children:[u.jsxs("aside",{className:"w-[280px] shrink-0 flex flex-col",style:{background:"var(--sf-bg-canvas)",borderRight:"1px solid var(--sf-border-subtle)"},children:[u.jsxs("div",{className:"px-4 py-5 flex items-start justify-between gap-3",style:{borderBottom:"1px solid var(--sf-border-subtle)"},children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("h1",{className:"text-base font-semibold text-gray-900 dark:text-[#F0F4F8]",children:"My Clients"}),u.jsx("p",{className:"text-xs text-gray-500 dark:text-[#8899AA] mt-0.5",children:r?"Loading…":`${n.length} linked`})]}),u.jsx("button",{type:"button",onClick:()=>m(!0),title:"Add a client",className:"shrink-0 px-2.5 py-1 text-xs font-semibold rounded-lg transition-opacity hover:opacity-90",style:{background:"#1D9E75",color:"var(--sf-text-strong)"},children:"+ Add"})]}),u.jsx("div",{className:"flex-1 overflow-y-auto px-3 py-3",children:s?u.jsx("p",{className:"text-xs text-[#EF4444] px-2",children:s}):n.length===0&&!r?u.jsx("p",{className:"text-xs text-gray-500 dark:text-[#8899AA] px-2",children:"No clients linked yet."}):u.jsx(IY,{clients:n,selectedId:l,onSelect:d,onRemove:I=>{j(null),w(I)}})})]}),u.jsx("section",{className:"flex-1 min-w-0 flex flex-col overflow-hidden",children:K?u.jsxs(u.Fragment,{children:[u.jsxs("header",{className:"flex items-center justify-between gap-4 px-6 py-4 shrink-0",style:{borderBottom:"1px solid var(--sf-border-subtle)"},children:[u.jsxs("div",{className:"min-w-0",children:[u.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-[#F0F4F8] truncate",children:[K.full_name??K.email??"Client","'s Board"]}),K.email&&u.jsx("p",{className:"text-xs text-gray-500 dark:text-[#8899AA] truncate",children:K.email})]}),u.jsxs("button",{type:"button",onClick:()=>p(!0),className:"shrink-0 px-3 py-1.5 text-xs font-semibold rounded-lg transition-opacity hover:opacity-90",style:{background:"#1D9E75",color:"var(--sf-text-strong)"},children:["+ Add job for ",((te=K.full_name)==null?void 0:te.split(" ")[0])??"client"]})]}),u.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:R?u.jsx("p",{className:"text-sm text-[#EF4444] p-6",children:R}):F?u.jsx("p",{className:"text-sm text-gray-500 dark:text-[#8899AA] p-6",children:"Loading board…"}):D.length===0?u.jsx("p",{className:"text-sm text-gray-500 dark:text-[#8899AA] italic p-6",children:"No jobs tracked yet — add one above"}):u.jsx("div",{className:"flex gap-4 h-full px-6 pb-6 pt-4 overflow-x-auto",children:_m.map(I=>u.jsx(nW,{stage:I,trackings:V[I],total:M[I],onOpen:H=>b(H.id),goalsMatchMap:W},I))})})]}):u.jsx("div",{className:"flex-1 flex items-center justify-center",children:u.jsx("p",{className:"text-sm text-gray-500 dark:text-[#8899AA]",children:r?"Loading…":"Select a client to view their board"})})}),h&&K&&u.jsx(PY,{client:K,onClose:()=>p(!1),onAdded:()=>void B()}),g&&u.jsx(LY,{existingClientIds:N,onClose:()=>m(!1),onAdded:I=>{o().then(()=>d(I)),m(!1)}}),_&&u.jsx(MY,{client:_,removing:S,error:k,onCancel:()=>{S||(w(null),j(null))},onConfirm:()=>void O()}),Q&&u.jsx(A_,{tracking:Q,analyzing:!1,companyLocked:!e.is_pro,onAnalyze:()=>{},onClose:()=>b(null),onAddNote:async()=>{},readOnly:!0})]})}function $Y(){const t=Lr(),[e]=wN(),{refresh:n}=zo(),r=In(),s=e.get("session_id")??void 0,o=Number(e.get("value"))||void 0,l=e.get("plan")??void 0,d=e.get("
293currency")??"USD",h=T.useRef(!1);return T.useEffect(()=>{var p;h.current||(h.current=!0,r.capture("upgrade_completed"),(p=window.gtag)==null||p.call(window,"event","purchase",{transaction_id:s,value:o,currency:d,items:l?[{item_id:`pro_${l}`,item_name:`SignalFit Pro (${l})`,price:o,quantity:1}]:void 0}),n())},[s,o,d,l]),u.jsx("main",{className:"min-h-screen bg-white dark:bg-[#0A1628] flex items-center justify-center p-6",children:u.jsxs("div",{className:"max-w-md w-full text-center",children:[u.jsx("div",{className:"w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-6",style:{background:"rgba(29,158,117,0.12)",border:"1px solid rgba(29,158,117,0.25)"},children:u.jsx("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"#1D9E75",strokeWidth:2,"aria-hidden":"true",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),u.jsx("h1",{className:"text-2xl font-semibold text-gray-900 dark:text-[#F0F4F8] mb-2",children:"You're on Pro"}),u.jsx("p",{className:"text-sm text-gray-500 dark:text-[#8899AA] mb-8",children:"Unlimited tracking, full Discover, company intelligence, and complete analyses are now unlocked."}),u.jsx("button",{type:"button",onClick:()=>t("/tracker"),className:"inline-flex items-center gap-2 px-6 py-2.5 bg-[#1D9E75] hover:bg-[#1D9E75]/90 text-sm font-semibold text-white rounded-lg transition-all",children:"Go to dashboard"})]})})}function UY(){return u.jsx("div",{className:"min-h-screen",style:{background:"var(--sf-bg-canvas)",color:"var(--sf-text-strong)",fontFamily:'"Plus Jakarta Sans", system-ui, sans-serif'},children:u.jsxs("main",{className:"max-w-3xl mx-auto px-6 py-10",children:[u.jsx(Kt,{to:"/",className:"text-sm text-gray-500 dark:text-[#8899AA] hover:text-gray-900 dark:hover:text-[#F0F4F8] transition-colors",children:"← Back to home"}),u.jsx("h1",{className:"text-3xl font-semibold mt-6 mb-2",children:"SignalFit Privacy Policy"}),u.jsx("p",{className:"text-xs text-gray-500 dark:text-[#8899AA] mb-10",children:"Last Modified: May 9, 2026"}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Introduction"}),u.jsx("p",{className:"leading-relaxed",children:'Talent Sherpas LLC, operating as SignalFit ("Company," "we," "our," or "us") respects your privacy and is committed to protecting it through compliance with this Privacy Policy. This policy describes the types of information we collect from job seekers ("you" or "user") when you use our web-based service ("Services") or visit https://signalfit.ai/ (our "Website"), including our Chrome extension. We do not ask for your information unless we truly need it.'}),u.jsx("p",{className:"leading-relaxed mt-3",children:"By accessing our Website or using our Services, you agree to this Privacy Policy. If you do not agree, do not use our Services."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Our Services"}),u.jsx("p",{className:"leading-relaxed",children:"SignalFit is an AI-powered job fit analysis platform that helps job seekers evaluate how well they match job postings, organize their job search, and track their application pipeline. We use artificial intelligence to generate Signal Scores, summaries, and insights based on job descriptions and your profile. SignalFit does not share your personal data with third parties without your consent, and will never sell your personal data. This does not extend to website hosting partners and third-party services involved in running our platform, provided they commit to keeping your information private."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Information We Collect"}),u.jsx("p",{className:"leading-relaxed mb-3",children:"We collect several types of information, including:"}),u.jsxs("ul",{className:"list-disc pl-6 space-y-2 leading-relaxed",children:[u.jsx("li",{children:'Information by which you may be personally identified, such as your name and email address ("personal information")'}),u.jsx("li",{children:"Information about your job search activity, including jobs you save, analyze, and track"}),u.jsx("li",{children:"Information you provide in your profile, such as your resume, skills, work experience, and career preferences"}),u.jsx("li",{children:"Usage information collected automatically as you navigate our Services, including IP addresses, browser type, and usage patterns"}),u.jsx("li",{children:"Information from third-party authentication providers (e.g. Google) when you sign in"})]})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"How We Collect Information"}),u.jsx("p",{className:"leading-relaxed mb-3",children:"We collect information:"}),u.jsxs("ul",{className:"list-disc pl-6 space-y-2 leading-relaxed",children:[u.jsx("li",{children:"Directly from you when you provide it"}),u.jsx("li",{children:"Automatically as you use our Services, through cookies and similar technologies"}),u.jsx("li",{children:"From third-party authentication providers when you log in via Google"})]})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"How We Use Your Information"}),u.jsx("p",{className:"leading-relaxed mb-3",children:"We use information we collect to:"}),u.jsxs("ul",{className:"list-disc pl-6 space-y-2 leading-relaxed",children:[u.jsx("li",{children:"Provide and improve our Services, including generating AI-powered job fit analyses and Signal Scores"}),u.jsx("li",{children:"Personalize your experience and remember your preferences"}),u.jsx("li",{children:"Process subscription payments through Stripe"}),u.jsx("li",{children:"Send you service-related communications"}),u.jsx("li",{children:"Monitor and analyze usage trends to improve our platform"}),u.jsx("li",{children:"Comply with legal obligations"})]})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"AI Processing"}),u.jsx("p",{className:"leading-relaxed",children:"Our Services use artificial intelligence to analyze job descriptions alongside your profile data to generate Signal Scores and related insights. This processing occurs on your behalf to provide the core functionality of our Services. AI-generated outputs are for informational purposes only and do not constitute professional career advice."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Third-Party Job Data"}),u.jsx("p",{className:"leading-relaxed",children:"When you save a job posting, we may retrieve and store data about that job from third-party sources including job boards and company data providers. We use this data solely to provide our Services to you."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Disclosure of Your Information"}),u.jsx("p",{className:"leading-relaxed mb-3",children:"We only share your personal information in the following circumstances:"}),u.jsxs("ul",{className:"list-disc pl-6 space-y-2 leading-relaxed",children:[u.jsx("li",{children:"With your consent"}),u.jsx("li",{children:"With service providers who assist us in operating our platform (see Third-Party Services below)"}),u.jsx("li",{children:"When required by law, regulation, or val
293id legal process"}),u.jsx("li",{children:"In connection with a business transfer or acquisition (see Business Transfers below)"})]}),u.jsx("p",{className:"leading-relaxed mt-3",children:"We do not sell your personal data to third parties."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"California Privacy Rights (CCPA)"}),u.jsx("p",{className:"leading-relaxed mb-3",children:"If you are a California resident, you have the following rights under the California Consumer Privacy Act (CCPA):"}),u.jsxs("ul",{className:"list-disc pl-6 space-y-2 leading-relaxed",children:[u.jsxs("li",{children:[u.jsx("strong",{children:"Right to Know"})," — You have the right to request that we disclose what personal information we collect, use, disclose, and sell about you."]}),u.jsxs("li",{children:[u.jsx("strong",{children:"Right to Delete"})," — You have the right to request deletion of personal information we have collected about you, subject to certain exceptions."]}),u.jsxs("li",{children:[u.jsx("strong",{children:"Right to Opt-Out of Sale"})," — We do not sell your personal information. You do not need to opt out."]}),u.jsxs("li",{children:[u.jsx("strong",{children:"Right to Non-Discrimination"})," — We will not discriminate against you for exercising any of your CCPA rights."]})]}),u.jsx("p",{className:"leading-relaxed mt-3",children:"To exercise your rights under CCPA, contact us at [email protected]. We will respond to verifiable consumer requests within 45 days. You may designate an authorized agent to submit requests on your behalf."}),u.jsx("p",{className:"leading-relaxed mt-3",children:"In the past 12 months we have collected the following categories of personal information: identifiers (name, email), internet activity (usage data), and professional information (job search data). We collect this information for the business purposes described in this policy and do not sell it."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Account Preferences and Opt-Out"}),u.jsx("p",{className:"leading-relaxed",children:"You may update your profile information and preferences at any time through your account settings. You may opt out of marketing emails by clicking the unsubscribe link in any email we send."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Retention"}),u.jsx("p",{className:"leading-relaxed",children:"We retain your personal information for as long as necessary to provide our Services. You may delete your account at any time by contacting us at [email protected]. Upon account deletion we will remove your personal data, subject to any legal retention requirements."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Data Security"}),u.jsx("p",{className:"leading-relaxed",children:"We implement industry-standard security measures to protect your personal information from unauthorized access, use, alteration, and disclosure. Your data is stored on secured servers. However, no internet transmission is completely secure and we cannot guarantee absolute security."}),u.jsx("p",{className:"leading-relaxed mt-3",children:"You are responsible for keeping your account credentials confidential. Do not share your password with anyone."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Cookies"}),u.jsx("p",{className:"leading-relaxed",children:"We use cookies and similar tracking technologies to collect information about your activity on our Website and Services. Cookies help us understand how you use our platform and improve your experience. You may instruct your browser to refuse cookies, though some features of our Services may not function correctly without them."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Third-Party Services"}),u.jsx("p",{className:"leading-relaxed mb-3",children:"We use the following categories of third-party services to operate our platform:"}),u.jsxs("ul",{className:"list-disc pl-6 space-y-2 leading-relaxed",children:[u.jsxs("li",{children:[u.jsx("strong",{children:"Authentication:"})," Supabase (user accounts and session management)"]}),u.jsxs("li",{children:[u.jsx("strong",{children:"Payments:"})," Stripe, Inc. (subscription billing and payment processing — see Stripe's privacy policy at stripe.com/privacy)"]}),u.jsxs("li",{children:[u.jsx("strong",{children:"Hosting:"})," Vercel (web hosting and deployment)"]}),u.jsxs("li",{children:[u.jsx("strong",{children:"Analytics:"})," Google Analytics, PostHog (usage analytics)"]}),u.jsxs("li",{children:[u.jsx("strong",{children:"Error monitoring:"})," Sentry (error tracking)"]}),u.jsxs("li",{children:[u.jsx("strong",{children:"AI processing:"})," Anthropic (AI-powered job analysis)"]}),u.jsxs("li",{children:[u.jsx("strong",{children:"Job data:"})," Coresignal, Enrichlayer, Firecrawl (job and company data enrichment)"]}),u.jsxs("li",{children:[u.jsx("strong",{children:"Email:"})," Resend (transactional email delivery)"]})]}),u.jsx("p",{className:"leading-relaxed mt-3",children:"We review the privacy practices of our third-party providers before engaging them. Third parties may only access your personal information for the specific purpose of providing their services to us."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Chrome Extension"}),u.jsx("p",{className:"leading-relaxed",children:"Our Chrome extension reads job posting URLs from supported websites to enable job saving and analysis. The extension does not read or transmit any other browsing activity. Session tokens are stored locally in your browser's extension storage solely to authenticate requests to our Services."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Children Under 18"}),u.jsx("p",{className:"leading-relaxed",children:"Our Services are not intended for users under 18 years of age. We do not knowingly collect personal information from minors. If you believe we have collected information from a minor, contact us at [email protected] and we will delete it promptly."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Business Transfers"}),u.jsx("p",{className:"leading-relaxed",children:"If Talent Sherpas LLC or its assets are acquired or we enter bankruptcy proceedings, user information may be transferred as part of that transaction. You acknowledge such transfers may occur and that any acquiring party may continue to use your information in accordance with this policy."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Changes to This Policy"}),u.jsx("p",{className:"leading-relaxed",children:"We may update this Privacy Policy from time to time. The date of the last revision is shown at the top of this page. Your continued use of our Services after any update constitutes acceptance of the revised policy."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Contact"}),u.jsx("p",{className:"leading-relaxed",children:"Questions about this Privacy Policy or to exercise your privacy rights? Contact us at [email protected]."})]})]})})}function zY(){return u.jsx("div",{className:"min-h-screen",style:{background:"var(--sf-bg-canvas)",color:"var(--sf-text-strong)",fontFamily:'"Plus Jakarta Sans", system-ui, sans-serif'},children:u.jsxs("main",{className:"max-w-3xl mx-auto px-6 py-10",children:[u.jsx(Kt,{to:"/",className:"text-sm text-gray-500 dark:text-[#8899AA] hover:text-gray-900 dark:hover:text-[#F0F4F8] transition-colors",children:"← Back to home"}),u.jsx("h1",{className:"text-3xl font-semibold mt-6 mb-2",children:"SignalFit Terms of Service"}),u.jsx("p",{className:"text-xs text-gray-500 dark:text-[#8899AA] mb-10",children:"Last Modified: May 9, 2026"}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Introduction"}),u.jsx("p",{className:"leading-relaxed",children:'These Terms of Service are entered into by and between you and Talent Sherpas LLC, operating as SignalFit ("C
293ompany," "we," "our," or "us"). These Terms govern your access to and use of https://signalfit.ai/ (our "Website") and the web-based services we provide ("Services"), including our Chrome extension, whether as a guest or registered user. By accessing the Website or using our Services, you accept and agree to be bound by these Terms. If you do not agree, you must not access or use our Website or Services.'})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Changes to the Terms"}),u.jsx("p",{className:"leading-relaxed",children:"We may revise these Terms at any time at our sole discretion. Changes are effective immediately when posted. Your continued use of our Services following any update means you accept the revised Terms."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Accounts"}),u.jsx("p",{className:"leading-relaxed",children:"To use our Services, you must create a SignalFit account. We reserve the right to disable any account at any time for any reason, including violation of these Terms. Information shared with SignalFit is subject to our Privacy Policy."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Job Seekers"}),u.jsx("p",{className:"leading-relaxed",children:"Job Seekers may create an account using a personal email address or Google account. Your account is personal to you — do not share access credentials. You are responsible for all activity under your account. Notify us immediately of any unauthorized use at [email protected]."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Guidelines"}),u.jsx("p",{className:"leading-relaxed mb-3",children:"You agree not to use our Services:"}),u.jsxs("ul",{className:"list-disc pl-6 space-y-2 leading-relaxed",children:[u.jsx("li",{children:"In any way that violates applicable law or regulation"}),u.jsx("li",{children:"To exploit, harm, or attempt to harm other users"}),u.jsx("li",{children:"To upload or transmit any defamatory, obscene, or otherwise objectionable content"}),u.jsx("li",{children:"To interfere with or disrupt the integrity or performance of our Services"}),u.jsx("li",{children:"To attempt to gain unauthorized access to any part of our Services or systems"}),u.jsx("li",{children:"To scrape, crawl, or otherwise extract data from our Services in an automated manner"})]})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"AI-Generated Content"}),u.jsx("p",{className:"leading-relaxed",children:"Our Services use artificial intelligence to generate job fit analyses, Signal Scores, and related content. These outputs are provided for informational purposes only and do not constitute career, legal, or professional advice. You are solely responsible for any decisions you make based on AI-generated content. We do not guarantee the accuracy, completeness, or fitness of any AI-generated output for any particular purpose."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Third-Party Data"}),u.jsx("p",{className:"leading-relaxed",children:"Our Services may incorporate data from third-party sources including job boards, company databases, and professional networks. We do not control the accuracy of third-party data and are not responsible for errors or omissions in such data."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Chrome Extension"}),u.jsx("p",{className:"leading-relaxed",children:"Our Chrome extension is designed to assist job seekers in saving and analyzing job postings from supported websites. Use of the extension must comply with these Terms and the terms of any website on which you use the extension."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Subscription and Payments"}),u.jsx("p",{className:"leading-relaxed",children:"Some features of our Services require a paid subscription. Subscription fees are charged through our payment processor, Stripe. By subscribing, you authorize us to charge your payment method on a recurring basis. You may cancel your subscription at any time; cancellation takes effect at the end of your current billing period. We reserve the right to change pricing with advance notice."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Licenses"}),u.jsx("p",{className:"leading-relaxed",children:"You are granted a personal, limited, non-transferable, non-sublicensable license to access and use our Services for your personal job search purposes. You may not reproduce, distribute, modify, or create derivative works of any part of our Services without our express written permission."}),u.jsx("p",{className:"leading-relaxed mt-3",children:"We do not claim ownership of content you provide to our Services. By submitting content, you grant Talent Sherpas LLC a non-exclusive, worldwide, royalty-free license to use, store, and process your content solely to provide and improve our Services."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Intellectual Property"}),u.jsx("p",{className:"leading-relaxed",children:"All content, features, and functionality of our Services — including the SignalFit name, logo, software, and AI models — are owned by Talent Sherpas LLC and protected by applicable intellectual property laws. You may not use our trademarks or branding without prior written permission."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Reliance on Information"}),u.jsx("p",{className:"leading-relaxed",children:"Information provided through our Services is for general informational purposes only. We do not warrant the accuracy or c
293ompleteness of any content. Any reliance you place on our Services is at your own risk."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Third-Party Links"}),u.jsx("p",{className:"leading-relaxed",children:"Our Services may contain links to third-party websites. We are not responsible for the content or practices of any third-party site and disclaim all liability arising from your use of third-party services."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Indemnification"}),u.jsx("p",{className:"leading-relaxed",children:"You agree to defend, indemnify, and hold harmless Talent Sherpas LLC and its officers, directors, employees, and agents from any claims, damages, or expenses arising from your use of our Services, your violation of these Terms, or your violation of any applicable law."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Warranty Disclaimer"}),u.jsx("p",{className:"leading-relaxed",children:'Our Services are provided on an "as is" and "as available" basis without warranties of any kind, express or implied, including warranties of merchantability, fitness for a particular purpose, or non-infringement. We do not warrant that our Services will be uninterrupted, error-free, or free of harmful components.'})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Limitation of Liability"}),u.jsx("p",{className:"leading-relaxed",children:"To the fullest extent permitted by law, Talent Sherpas LLC shall not be liable for any indirect, incidental, consequential, special, or punitive damages arising from your use of or inability to use our Services, even if advised of the possibility of such damages."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Dispute Resolution"}),u.jsx("p",{className:"leading-relaxed",children:"Any disputes arising from these Terms or your use of our Services shall be resolved through binding arbitration under the rules of the American Arbitration Association, applying the laws of the State of California."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Governing Law"}),u.jsx("p",{className:"leading-relaxed",children:"These Terms are governed by the laws of the State of California, without regard to conflict of law principles. Any legal action not subject to arbitration shall be brought exclusively in the federal or state courts located in San Mateo County, California."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Children Under 18"}),u.jsx("p",{className:"leading-relaxed",children:"Our Services are not intended for users under 18 years of age. We do not knowingly collect personal information from minors. If you believe we have collected information from a minor, contact us at [email protected] and we will delete it promptly."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Entire Agreement"}),u.jsx("p",{className:"leading-relaxed",children:"These Terms constitute the entire agreement between you and Talent Sherpas LLC regarding your use of our Services."})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Contact"}),u.jsx("p",{className:"leading-relaxed",children:"Questions or concerns? Contact us at [email protected]."})]})]})})}function BY(){return u.jsxs("svg",{width:"28",height:"20",viewBox:"0 0 20 14",fill:"none","aria-hidden":"true",children:[u.jsx("rect",{x:"0",y:"8",width:"5",height:"6",rx:"1",fill:"#1D9E75"}),u.jsx("rect",{x:"7.5",y:"3",width:"5",height:"11",rx:"1",fill:"#1D9E75"}),u.jsx("rect",{x:"15",y:"0",width:"5",height:"14",rx:"1",fill:"#1D9E75"})]})}const HY=[{q:"What does SignalFit do?",a:"SignalFit analyzes job postings against your profile and gives you a Signal Score — an AI-powered fit assessment that shows your strengths, gaps, and resume tips for each role."},{q:"How do I install the Chrome extension?",a:'Search "SignalFit" in the Chrome Web Store and click Install. Once installed, navigate to any job posting on LinkedIn or Indeed and click the SignalFit icon.'},{q:"What job boards does the extension support?",a:"Currently LinkedIn and Indeed. More platforms coming soon."},{q:"Is my data private?",a:"Yes. Your profile and job data are private to your account and never shared with employers or third parties."},{q:"How do I cancel my subscription?",a:"You can cancel anytime from your profile settings. You'll retain access until the end of your billing period."},{q:"Something isn’t working. What should I do?",a:"Email us at [email protected] with a description of the issue and we'll get back to you within 1 business day."}];function qY(){return u.jsx("div",{className:"min-h-screen",style:{background:"var(--sf-bg-canvas)",color:"var(--sf-text-strong)",fontFamily:'"Plus Jakarta Sans", system-ui, sans-serif'},children:u.jsxs("main",{className:"max-w-2xl mx-auto py-16 px-6",children:[u.jsx(Kt,{to:"/",className:"text-sm text-gray-500 dark:text-[#8899AA] hover:text-gray-900 dark:hover:text-[#F0F4F8] transition-colors",children:"← Back to home"}),u.jsxs("div",{className:"flex items-center gap-3 mt-8",children:[u.jsx(BY,{}),u.jsx("span",{className:"text-base font-semibold tracking-tight",children:"SignalFit"})]}),u.jsx("h1",{className:"text-3xl font-semibold mt-6",children:"Support"}),u.jsx("p",{className:"text-gray-500 dark:text-[#8899AA] mt-2",children:"We're here to help."}),u.jsxs("section",{className:"mt-12",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Get in touch"}),u.jsxs("p",{className:"leading-relaxed",children:["Email us at"," ",u.jsx("a",{href:"mailto:[email protected]",className:"text-gray-900 dark:text-[#F0F4F8] underline underline-offset-2 hover:text-[#1D9E75] transition-colors",children:"[email protected]"}),"."]}),u.jsx("p",{className:"leading-relaxed text-sm text-gray-500 dark:text-[#8899AA] mt-2",children:"We typically respond within 1 business day."})]}),u.jsxs("section",{className:"mt-12",children:[u.jsx("h2",{className:"text-xl font-semibold mb-4",style:{color:"#1D9E75"},children:"Frequently asked questions"}),u.jsx("div",{className:"space-y-6",children:HY.map(t=>u.jsxs("div",{children:[u.jsx("h3",{className:"font-semibold text-gray-900 dark:text-[#F0F4F8] mb-1",children:t.q}),u.jsx("p",{className:"leading-relaxed text-[#C4D0DC]",children:t.a})]},t.q))})]}),u.jsxs("section",{className:"mt-12 mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Privacy & legal"}),u.jsxs("div",{className:"flex flex-wrap gap-x-6 gap-y-2",children:[u.jsx(Kt,{to:"/privacy",className:"text-gray-900 dark:text-[#F0F4F8] underline underline-offset-2 hover:text-[#1D9E75] transition-colors",children:"Privacy Policy"}),u.jsx(Kt,{to:"/terms",className:"text-gray-900 dark:text-[#F0F4F8] underline underline-offset-2 hover:text-[#1D9E75] transition-colors",children:"Terms of Service"})]})]})]})})}function GY(){return u.jsx("div",{className:"min-h-screen",style:{background:"var(--sf-bg-canvas)",color:"var(--sf-text-strong)",fontFamily:'"Plus Jakarta Sans", system-ui, sans-serif'},children:u.jsxs("main",{className:"max-w-3xl mx-auto px-6 py-10",children:[u.jsx(Kt,{to:"/",className:"text-sm text-gray-500 dark:text-[#8899AA] hover:text-gray-900 dark:hover:text-[#F0F4F8] transition-colors",children:"← Back to home"}),u.jsx("h1",{className:"text-3xl font-semibold mt-6 mb-2",children:"Accessibility"}),u.jsx("p",{className:"text-xs text-gray-500 dark:text-[#8899AA] mb-10",children:"Last Modified: May 26, 2026"}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Our commitment"}),u.jsxs("p",{className:"leading-relaxed",children:["SignalFit is built to be usable by everyone. We aim to conform to the"," ",u.jsx("a",{href:"https://www.w3.org/TR/WCAG21/",target:"_blank",rel:"noopener noreferrer",className:"text-[#1D9E75] hover:underline",children:"Web Content Accessibility Guidelines (WCAG) 2.1 at Level AA"}),". We test with keyboard navigation and screen readers, and we treat accessibility as a functional requirement rather than an afterthought."]})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"What this means in practice"}),u.jsxs("ul",{className:"list-disc pl-6 space-y-2 leading-relaxed",children:[u.jsx("li",{children:"All interactive controls are reachable and operable using the keyboard."}),u.jsx("li",{children:"Form fields are labelled, and error messages are announced to assistive tech."}),u.jsx("li",{children:"Modals and dialogs use ARIA dialog semantics and can be dismissed with Escape."}),u.jsx("li",{children:"Streaming AI output (Signal Score analysis) is announced as it arrives via live regions."}),u.jsx("li",{children:"Icons that are purely decorative are hidden from screen readers; icon-only buttons carry text labels."}),u.jsxs("li",{children:["Page landmarks (",u.jsx("code",{children:"main"}),", ",u.jsx("code",{children:"nav"}),", ",u.jsx("code",{children:"header"}),", ",u.jsx("code",{children:"footer"}),") are used so screen-reader users can navigate by region."]})]})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Known exceptions"}),u.jsx("p",{className:"leading-relaxed mb-3",children:"We are continually improving and aware of the following areas that fall short of full WCAG 2.1 AA conformance. We are actively working on each:"}),u.jsxs("ul",{className:"list-disc pl-6 space-y-2 leading-relaxed",children:[u.jsxs("li",{children:[u.jsx("strong",{children:"Drag-and-drop kanban board."})," The Job Tracker board supports keyboard drag operations, but moving cards with the keyboard is less ergonomic than with a pointer. Keyboard users can also change a job's stage via the stage dropdown on each card."]}),u.jsxs("li",{children:[u.jsx("strong",{children:"Reduced motion."})," Some animations on the landing page (scroll reveals, radar pings, confetti) do not yet respect the"," ",u.jsx("code",{children:"prefers-reduced-motion"})," system setting."]}),u.jsxs("li",{children:[u.jsx("strong",{children:"Focus trapping in modals."})," Modal dialogs are labelled and dismissable with Escape, but focus is not yet fully trapped within the modal while it is open."]}),u.jsxs("li",{children:[u.jsx("strong",{children:"Color contrast on de-emphasized text."})," A handful of low-emphasis labels and timestamps may fall below the 4.5:1 ratio for normal text. We are auditing and adjusting the palette."]})]})]}),u.jsxs("section",{className:"mb-8",children:[u.jsx("h2",{className:"text-xl font-semibold mb-3",style:{color:"#1D9E75"},children:"Report an issue"}),u.jsxs("p",{className:"leading-relaxed",children:["If you encounter an accessibility barrier while using SignalFit — or you have ideas for how we can do better — please email"," ",u.jsx("a",{href:"mailto:[email protected]",className:"text-[#1D9E75] hover:underline",children:"[email protected]"}),". Include the page you were on and a short description of the issue, and we will respond within 1 business day."]})]})]})})}function VY(){return u.jsxs("svg",{width:"22",height:"16",viewBox:"0 0 20 14",fill:"none","aria-hidden":"true",children:[u.jsx("rect",{x:"0",y:"8",width:"5",height:"6",rx:"1",fill:"#1D9E75"}),u.jsx("rect",{x:"7.5",y:"3",width:"5",height:"11",rx:"1",fill:"#1D9E75"}),u.jsx("rect",{x:"15",y:"0",width:"5",height:"14",rx:"1",fill:"#1D9E75"})]})}function WY(){return u.jsxs("main",{className:"bg-white dark:bg-[#0A1628] min-h-screen flex flex-col items-center justify-center gap-4 px-6",
293style:{fontFamily:'"Plus Jakarta Sans", system-ui, sans-serif'},children:[u.jsxs(Kt,{to:"/",className:"flex items-center gap-2.5 mb-2",children:[u.jsx(VY,{}),u.jsxs("span",{className:"text-[18px] font-semibold tracking-tight",children:[u.jsx("span",{className:"text-gray-900 dark:text-[#F0F4F8]",children:"Signal"}),u.jsx("span",{style:{color:"#1D9E75"},children:"Fit"})]})]}),u.jsx("p",{className:"text-[#1D9E75] font-bold text-8xl tracking-tight leading-none",children:"404"}),u.jsx("h1",{className:"text-2xl font-semibold text-gray-900 dark:text-white",children:"Page not found"}),u.jsx("p",{className:"text-center max-w-md text-gray-500 dark:text-white/50",children:"The page you're looking for doesn't exist or has moved."}),u.jsx(Kt,{to:"/",className:"mt-2 px-7 py-3.5 rounded-lg text-base font-semibold text-white transition-all hover:brightness-110",style:{background:"#1D9E75",boxShadow:"0 10px 28px rgba(29,158,117,0.4)"},children:"Go to SignalFit →"})]})}const Xr="#0A1628",Wo="#5C6B7A",os="#8899AA",na="#E5E9EE",C_="#F5F7FA",R_="#0A1628",Wd="#F0F4F8",_i="#1D9E75";
293function YY(){return u.jsxs("svg",{width:"22",height:"16",viewBox:"0 0 20 14",fill:"none","aria-hidden":"true",children:[u.jsx("rect",{x:"0",y:"8",width:"5",height:"6",rx:"1",fill:_i}),u.jsx("rect",{x:"7.5",y:"3",width:"5",height:"11",rx:"1",fill:_i}),u.jsx("rect",{x:"15",y:"0",width:"5",height:"14",rx:"1",fill:_i})]})}function KY(t){const e=T.useRef(null),[n,r]=T.useState(!1);return T.useEffect(()=>{const s=e.current;if(!s)return;const o=new IntersectionObserver(([l])=>{l.isIntersecting&&(r(!0),o.unobserve(l.target))},{threshold:.15,...t});return o.observe(s),()=>o.disconnect()},[t]),{ref:e,inView:n}}function kn({children:t,delay:e=0}){const{ref:n,inView:r}=KY();return u.jsx("div",{ref:n,style:{opacity:r?1:0,transform:r?"translateY(0)":"translateY(16px)",transition:`opacity 600ms ease ${e}ms, transform 600ms ease ${e}ms`},children:t})}const N0=87;function JY(){const[t,e]=T.useState(0);T.useEffect(()=>{const g=performance.now();let m=0;const y=b=>{const _=b-g,w=Math.min(1,_/1500),S=1-Math.pow(1-w,3);e(Math.round(S*N0)),w<1&&(m=requestAnimationFrame(y))};return m=requestAnimationFrame(y),()=>cancelAnimationFrame(m)},[]);const n=72,r=7,s=160,o=s/2,l=2*Math.PI*n,d=t/100,h=l*(1-d);return u.jsxs("div",{className:"flex flex-col items-center",children:[u.jsxs("div",{className:"relative",style:{width:s,height:s},role:"img","aria-label":`Signal Score ${N0} — better fit than ${N0}% of jobs matched to you`,children:[u.jsxs("svg",{width:s,height:s,className:"-rotate-90",children:[u.jsx("circle",{cx:o,cy:o,r:n,fill:"none",stroke:"rgba(255,255,255,0.10)",strokeWidth:r}),u.jsx("circle",{cx:o,cy:o,r:n,fill:"none",stroke:_i,strokeWidth:r,strokeLinecap:"round",strokeDasharray:l,strokeDashoffset:h,style:{filter:"drop-shadow(0 0 12px rgba(29,158,117,0.45))",transition:"stroke-dashoffset 60ms linear"}})]}),u.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[u.jsx("span",{className:"text-4xl font-bold tabular-nums tracking-tight",style:{color:Wd},children:t}),u.jsx("span",{className:"text-xs mt-1",style:{color:os},children:"percentile fit"})]})]}),u.jsx("p",{className:"mt-5 text-sm",style:{color:os},children:"Your Signal Score"}),u.jsxs("div",{className:"mt-4 flex flex-wrap items-center justify-center gap-2",children:[u.jsx("span",{className:"text-xs font-medium px-3 py-1 rounded-full",style:{background:"rgba(29,158,117,0.12)",color:"#3DBA8F",border:"1px solid rgba(29,158,117,0.35)"},children:"Strong match"}),u.jsx("span",{className:"text-xs font-medium px-3 py-1 rounded-full",style:{background:"rgba(245,158,11,0.10)",color:"#F59E0B",border:"1px solid rgba(245,158,11,0.3)"},children:"3 skill gaps"}),u.jsx("span",{className:"text-xs font-medium px-3 py-1 rounded-full",style:{background:"rgba(29,158,117,0.12)",color:"#3DBA8F",border:"1px solid rgba(29,158,117,0.35)"},children:"2 resume tips"})]})]})}function XY(){return u.jsx("header",{className:"sticky top-0 z-50",style:{background:"rgba(255,255,255,0.88)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",borderBottom:`1px solid ${na}`},children:u.jsxs("div",{className:"max-w-6xl mx-auto px-6 h-16 flex items-center justify-between",children:[u.jsxs(Kt,{to:"/",className:"flex items-center gap-2.5",children:[u.jsx(YY,{}),u.jsxs("span",{className:"text-[18px] font-semibold tracking-tight",children:[u.jsx("span",{style:{color:Xr},children:"Signal"}),u.jsx("span",{style:{color:_i},children:"Fit"})]})]}),u.jsx(Kt,{to:"/signup",className:"text-sm font-semibold text-white px-4 py-2 rounded-lg transition-all hover:brightness-110",style:{background:_i,boxShadow:"0 6px 18px rgba(29,158,117,0.35)"},children:"Get started free"})]})})}function ZY(){const t=e=>{var n;e.preventDefault(),(n=document.getElementById("how-it-works"))==null||n.scrollIntoView({behavior:"smooth",block:"start"})};return u.jsx("section",{className:"relative overflow-hidden",style:{backgroundColor:R_,backgroundImage:"radial-gradient(1100px 500px at 50% -10%, rgba(29,158,117,0.22) 0%, rgba(29,158,117,0) 60%)"},children:u.jsxs("div",{className:"max-w-5xl mx-auto px-6 pt-12 pb-12 sm:pt-16 sm:pb-14 text-center",children:[u.jsx(kn,{children:u.jsx("h1",{className:"text-4xl sm:text-5xl md:text-6xl font-bold tracking-tight leading-[1.05]",style:{color:Wd}
293,children:"Know your fit before you apply"})}),u.jsx(kn,{delay:120,children:u.jsx("p",{className:"mt-4 text-lg sm:text-xl max-w-2xl mx-auto leading-relaxed",style:{color:os},children:"SignalFit scores any job posting against your track record in seconds — built for senior tech professionals who don't have time to apply blind."})}),u.jsx(kn,{delay:240,children:u.jsxs("div",{className:"mt-8 flex flex-col sm:flex-row items-center justify-center gap-3",children:[u.jsx(Kt,{to:"/signup",className:"w-full sm:w-auto px-7 py-3.5 rounded-lg text-base font-semibold text-white transition-all hover:brightness-110",style:{background:_i,boxShadow:"0 10px 28px rgba(29,158,117,0.4)"},children:"Get started free"}),u.jsx("a",{href:"#how-it-works",onClick:t,className:"w-full sm:w-auto px-7 py-3.5 rounded-lg text-base font-semibold transition-all hover:bg-white/[0.06]",style:{color:Wd,border:"1px solid rgba(255,255,255,0.25)"},children:"See how it works"})]})}),u.jsx(kn,{delay:360,children:u.jsx("div",{className:"mt-10 flex justify-center",children:u.jsx(JY,{})})})]})})}const QY=[{name:"LinkedIn",domain:"linkedin.com"},{name:"Indeed",domain:"indeed.com"},{name:"Glassdoor",domain:"glassdoor.com"},{name:"Greenhouse",domain:"greenhouse.io"},{name:"Ashby",domain:"ashbyhq.com"},{name:"Lever",domain:"lever.co"},{name:"Workday",domain:"workday.com"},{name:"Gem",domain:"gem.com"}],eK="1idD04wBbxHKl8YzDko";function tK(){return u.jsx("section",{style:{background:"#FFFFFF",borderBottom:`1px solid ${na}`},children:u.jsx("div",{className:"max-w-5xl mx-auto py-10 px-6",children:u.jsxs(kn,{children:[u.jsx("p",{className:"text-xs uppercase tracking-widest text-center mb-8",style:{color:os},children:"Works where you search"}),u.jsxs("div",{className:"flex items-center justify-center flex-wrap gap-8 sm:gap-12",children:[QY.map(t=>u.jsx("img",{src:`https://cdn.brandfetch.io/${t.domain}/w/120/h/40/logo?c=${eK}`,alt:t.name,height:28,className:"brightness-0",style:{height:28,width:"auto",opacity:.35,transition:"opacity 0.2s"},onMouseEnter:e=>e.currentTarget.style.opacity="0.7",onMouseLeave:e=>e.currentTarget.style.opacity="0.35",onError:e=>e.currentTarget.style.display="none"},t.name)),u.jsx("span",{style:{fontSize:12,color:Wo,border:`1px solid ${na}`,borderRadius:20,padding:"4px 12px",whiteSpace:"nowrap"},children:"+ more every day"})]})]})})})}function A0({icon:t,title:e,body:n}){return u.jsxs("div",{className:"p-7 rounded-2xl h-full transition-all hover:translate-y-[-2px]",style:{background:"#FFFFFF",border:`1px solid ${na}`},children:[u.jsx("div",{className:"text-3xl mb-4","aria-hidden":"true",children:t}),u.jsx("h3",{className:"text-lg font-semibold mb-2",style:{color:Xr},children:e}),u.jsx("p",{className:"text-sm leading-relaxed",style:{color:Wo},children:n})]})}function nK(){return u.jsx("section",{style:{background:C_},children:u.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-20 sm:py-24",children:[u.jsx(kn,{children:u.jsx("h2",{className:"text-3xl sm:text-4xl font-bold text-center tracking-tight mb-12",style:{color:Xr},children:"Applying blind is killing your job search"})}),u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-5",children:[u.jsx(kn,{children:u.jsx(A0,{icon:"📋",title:"Volume stops working at senior level",body:"The right roles are fewer and the bar is higher. Mass applications waste weeks of your time and erode your confidence."})}),u.jsx(kn,{delay:120,children:u.jsx(A0,{icon:"🔍",title:"You can't tell what they actually want",body:"Job descriptions are vague. Requirements are inflated. It's hard to know if you're a real candidate or just filling out forms."})}),u.jsx(kn,{delay:240,children:u.jsx(A0,{icon:"📉",title:"No signal, no strategy",body:"Without knowing your fit, you're optimizing blind — polishing a resume for a role you were never going to get."})})]})]})})}function C0({num:t,title:e,body:n}){return u.jsxs("div",{className:"relative flex-1",children:[u.jsx("div",{className:"w-12 h-12 rounded-full flex items-center justify-center text-lg font-bold mx-auto mb-5 relative z-10",style:{background:"#FFFFFF",color:_i,border:`2px solid ${_i}`,boxShadow:"0 0 24px rgba(29,158,117,0.2)"},children:t}),u.jsx("h3",{className:"text-lg font-semibold text-center mb-2",style:{color:Xr},children:e}),u.jsx("p",{className:"text-sm leading-relaxed text-center max-w-[260px] mx-auto",style:{color:Wo},children:n})]})}function rK(){return u.jsx("section",{id:"how-it-works",style:{background:"#FFFFFF"},children:u.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-20 sm:py-24",children:[u.jsx(kn,{children:u.jsx("h2",{className:"text-3xl sm:text-4xl font-bold text-center tracking-tight mb-16",style:{color:Xr},children:"Three steps to smarter applications"})}),u.jsx(kn,{delay:120,children:u.jsxs("div",{className:"relative flex flex-col md:flex-row gap-12 md:gap-6",children:[u.jsx("div",{className:"hidden md:block absolute left-[16%] right-[16%] top-6 h-px",style:{backgroundImage:"linear-gradient(to right, rgba(29,158,117,0.4) 50%, rgba(29,158,117,0) 0%)",backgroundSize:"8px 1px",backgroundRepeat:"repeat-x"},"aria-hidden":"true"}),u.jsx(C0,{num:1,title:"Save any job",body:"Paste a URL or use the Chrome extension on LinkedIn, Indeed, Greenhouse, and more."}),u.jsx(C0,{num:2,title:"Get your Signal Score",body:"We score the role against your actual experience — your score means it's a better fit than that percent of jobs matched to you."}
293),u.jsx(C0,{num:3,title:"Apply with confidence",body:"Know your strengths, gaps, and exactly what to emphasize before you write a single word."})]})})]})})}function iK(){return u.jsx("section",{style:{background:C_},children:u.jsx("div",{className:"max-w-5xl mx-auto px-6 py-20 sm:py-24",children:u.jsx(kn,{children:u.jsxs("div",{className:"rounded-3xl px-8 py-12 flex flex-col sm:flex-row items-center gap-8",style:{backgroundColor:"#FFFFFF",backgroundImage:"linear-gradient(135deg, rgba(29,158,117,0.10) 0%, rgba(29,158,117,0) 60%)",border:"1px solid rgba(29,158,117,0.3)"},children:[u.jsxs("div",{className:"flex-1",children:[u.jsx("div",{className:"mb-4",children:u.jsx("span",{className:"text-xs font-semibold uppercase tracking-widest",style:{color:os},children:"Chrome Extension"})}),u.jsx("h2",{className:"text-2xl sm:text-3xl font-bold tracking-tight mb-3",style:{color:Xr},children:"Analyze jobs as you browse"}),u.jsx("p",{className:"text-base leading-relaxed mb-2",style:{color:Wo},children:"Install the SignalFit extension and get your Signal score on any job page — LinkedIn, Indeed, Greenhouse, and more. No copy-paste required."}),u.jsx("p",{className:"text-xs",style:{color:os},children:"Works on LinkedIn · Indeed · Greenhouse · Lever · Ashby · Workday"})]}),u.jsx("div",{className:"flex flex-col items-center gap-3 shrink-0",children:u.jsx("a",{href:$o,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 px-6 py-3.5 rounded-xl text-base font-semibold text-white transition-all hover:brightness-110",style:{background:_i,boxShadow:"0 8px 24px rgba(29,158,117,0.35)"},children:"Add to Chrome — It's free"})})]})})})})}function op({icon:t,title:e,body:n}){return u.jsxs("div",{className:"p-7 rounded-2xl h-full transition-all hover:translate-y-[-2px] group",style:{background:"#FFFFFF",border:`1px solid ${na}`},onMouseEnter:r=>r.currentTarget.style.borderColor="rgba(29,158,117,0.5)",onMouseLeave:r=>r.currentTarget.style.borderColor=na,children:[u.jsx("div",{className:"text-3xl mb-4","aria-hidden":"true",children:t}),u.jsx("h3",{className:"text-lg font-semibold mb-2",style:{color:Xr},children:e}),u.jsx("p",{className:"text-sm leading-relaxed",style:{color:Wo},children:n})]})}function sK(){return u.jsx("section",{style:{background:"#FFFFFF"},children:u.jsxs("div",{className:"max-w-5xl mx-auto px-6 py-20 sm:py-24",children:[u.jsx(kn,{children:u.jsx("h2",{className:"text-3xl sm:text-4xl font-bold text-center tracking-tight mb-12",style:{color:Xr},children:"Everything you need to search smarter"})}),u.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-5",children:[u.jsx(kn,{children:u.jsx(op,{icon:"🎯",title:"Signal Score",body:"Instant fit analysis — see how a role ranks against every job matched to you before you apply."})}),u.jsx(kn,{delay:80,children:u.jsx(op,{icon:"🏢",title:"Company Intelligence",body:"Funding stage, headcount growth, employee reviews, and tech stack — all in one place."})}),u.jsx(kn,{delay:160,children:u.jsx(op,{icon:"📊",title:"Job Pipeline",body:"Track every role from saved to offer. Stay organized across your entire search."})}),u.jsx(kn,{delay:240,children:u.jsx(op,{icon:"⚡",title:"Chrome Extension",body:"Save and analyze jobs directly from LinkedIn, Indeed, Greenhouse, and 10+ job boards."})})]})]})})}function aK(){return u.jsx("section",{style:{background:C_},children:u.jsxs("div",{className:"max-w-5xl mx-auto px-6 py-20 sm:py-24",children:[u.jsx(kn,{children:u.jsx("h2",{className:"text-3xl sm:text-4xl font-bold text-center tracking-tight mb-12",style:{color:Xr},children:"Free to start. Upgrade when you're ready."})}),u.jsx(kn,{delay:120,children:u.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-5 max-w-3xl mx-auto",children:[u.jsxs("div",{className:"p-7 rounded-2xl",style:{background:"#FFFFFF",border:`1px solid ${na}`},children:[u.jsx("h3",{className:"text-lg font-semibold mb-2",style:{color:Xr},children:"Free"}),u.jsx("p",{className:"text-sm leading-relaxed",style:{color:Wo},children:"Unlimited AI scoring · 5 tracked jobs · Discover preview"})]}),u.jsxs("div",{className:"p-7 rounded-2xl",style:{backgroundColor:R_,backgroundImage:"linear-gradient(160deg, rgba(29,158,117,0.10) 0%, rgba(29,158,117,0) 60%)",border:"1px solid rgba(29,158,117,0.5)",boxShadow:"0 0 32px rgba(29,158,117,0.15)"},children:[u.jsx("h3",{className:"text-lg font-semibold mb-2",style:{color:Wd},children:"Pro"}),u.jsxs("p",{className:"text-sm leading-relaxed",style:{color:os},children:["Unlimited tracking · Full Discover · Company intelligence ·"," ",u.
293jsx("span",{className:"font-semibold",style:{color:_i},children:"from $13/mo"})]})]})]})}),u.jsx(kn,{delay:240,children:u.jsx("div",{className:"mt-10 flex justify-center",children:u.jsx(Kt,{to:"/pricing",className:"px-6 py-3 rounded-lg text-sm font-semibold transition-all hover:bg-white",style:{color:Xr,border:"1px solid #D2D9E0"},children:"See pricing"})})})]})})}function oK(){return u.jsx("section",{style:{background:"#FFFFFF"},children:u.jsx("div",{className:"max-w-5xl mx-auto px-6 py-20 sm:py-24",children:u.jsx(kn,{children:u.jsxs("div",{className:"rounded-3xl px-6 py-16 sm:py-20 text-center",style:{backgroundColor:R_,backgroundImage:"radial-gradient(800px 300px at 50% 0%, rgba(29,158,117,0.22) 0%, rgba(29,158,117,0) 70%)",border:"1px solid rgba(29,158,117,0.3)"},children:[u.jsx("h2",{className:"text-3xl sm:text-4xl font-bold tracking-tight mb-4",style:{color:Wd},children:"Start your smarter job search today"}),u.jsx("p",{className:"text-base sm:text-lg mb-8",style:{color:os},children:"Free to start. No credit card required."}),u.jsx(Kt,{to:"/signup",className:"inline-block px-8 py-4 rounded-lg text-base font-semibold text-white transition-all hover:brightness-110",style:{background:_i,boxShadow:"0 12px 32px rgba(29,158,117,0.4)"},children:"Get started free"})]})})})})}const lK=[{heading:"Product",links:[{label:"Job Tracker",href:"/tracker"},{label:"Signal Score",href:"/signup"},{label:"Chrome Extension",href:$o,external:!0},{label:"Pricing",href:"/pricing"}]},{heading:"Company",links:[{label:"Privacy Policy",href:"/privacy"},{label:"Terms of Service",href:"/terms"},{label:"Support",href:"/support"},{label:"Email Us",href:"mailto:[email protected]",external:!0}]},{heading:"Connect",links:[{label:"LinkedIn",href:"https://www.linkedin.com/company/talent-sherpas",external:!0}]}];function cK({link:t}){const e="text-sm transition-colors hover:text-[#1D9E75]",n={color:Wo};return t.external?u.jsx("a",{href:t.href,className:e,style:n,target:t.href.startsWith("mailto:")?void 0:"_blank",rel:t.href.startsWith("mailto:")?void 0:"noopener noreferrer",children:t.label}):u.jsx(Kt,{to:t.href,className:e,style:n,children:t.label})}function uK(){return u.jsx("footer",{style:{background:"#FFFFFF",borderTop:`1px solid ${na}`},children:u.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-14",children:[u.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-10",children:lK.map(t=>u.jsxs("div",{children:[u.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider mb-4",style:{color:Xr},children:t.heading}),u.jsx("ul",{className:"space-y-3",children:t.links.map(e=>u.jsx("li",{children:u.jsx(cK,{link:e})},e.label))})]},t.heading))}),u.jsxs("div",{className:"mt-12 pt-6 flex flex-col sm:flex-row items-center justify-between gap-3",style:{borderTop:`1px solid ${na}`},children:[u.jsx("p",{className:"text-xs",style:{color:os},children:"© 2026 Talent Sherpas LLC · SignalFit"}),u.jsx("p",{className:"text-xs italic",style:{color:os},children:"Built for job seekers, not recruiters"})]})]})})}function dK(){const{user:t,loading:e}=hn();return e?u.jsx("div",{className:"flex items-center justify-center min-h-screen",style:{background:"#FFFFFF"},children:u.jsx("div",{className:"w-6 h-6 border-2 border-[#1D9E75] border-t-transparent rounded-full animate-spin"})}):t?u.jsx(Qd,{to:"/tracker",replace:!0}):u.jsxs("div",{className:"min-h-screen",style:{background:"#FFFFFF",color:Xr,fontFamily:'"Plus Jakarta Sans", system-ui, sans-serif'},children:[u.jsx(XY,{}),u.jsxs("main",{children:[u.jsx(ZY,{}),u.jsx(tK,{}),u.jsx(nK,{}),u.jsx(rK,{}),u.jsx(iK,{}),u.jsx(sK,{}),u.jsx(aK,{}),u.jsx(oK,{})]}),u.jsx(uK,{})]})}function hK(){const t=gN(),e=In();return t&&e.captureException(t),u.jsx("div",{className:"min-h-screen flex items-center justify-center bg-white dark:bg-[#0A1628] p-6",children:u.jsxs("div",{className:"text-center",children:[u.jsx("p",{className:"text-lg font-semibold text-gray-900 dark:text-[#F0F4F8] mb-2",children:"Something went wrong"}),u.jsx("p",{className:"text-sm text-gray-500 dark:text-[#8899AA]",children:"Please refresh the page and try again."})]})})}const fK=LM([{path:"/",element:u.jsx(dK,{})},{path:"/login",element:u.jsx(Jq,{})},{path:"/signup",element:u.jsx(eG,{})},{path:"/auth/callback",element:u.jsx(tG,{})},{path:"/upgrade/success",element:u.jsx($Y,{})},{path:"/privacy",element:u.jsx(UY,{})},{path:"/terms",element:u.jsx(zY,{})},{path:"/support",element:u.jsx(qY,{})},{path:"/accessibility",element:u.jsx(GY,{})},{path:"/pricing",element:u.jsx(aY,{})},{element:u.jsx(EF,{}),ErrorBoundary:hK,children:[{element:u.jsx(Gq,{}),children:[{path:"/tracker",element:u.jsx(SW,{})},{path:"/discover",element:u.jsx(AY,{})},{path:"/profile",element:u.jsx(AW,{})},{path:"/goals",element:u.jsx(XW,{})},{path:"/billing",element:u.jsx(dY,{})},{path:"/coach",element:u.jsx(FY,{})}]}]},{path:"/dashboard",element:u.jsx(Qd,{to:"/tracker",replace:!0})},{path:"*",element:u.jsx(WY,{})}]);function pK(){return u.jsx(SF,{children:u.jsx(WM,{router:fK})})}var wm={},mK=()=>{window.si||(window.si=function(...e){window.siq=window.siq||[],window.siq.push(e)})},gK="@vercel/speed-insights",vK="2.0.0";function yK(){return typeof window<"u"}function bK(){try{const t="production"}catch{}return"production"}function a5(){return bK()==="development"}function xK(t){return t.scriptSrc?Sm(t.scriptSrc):a5()?"https://va.vercel-scripts.com/v1/speed-insights/script.debug.js":t.dsn?"https://va.vercel-scripts.com/v1/speed-insights/script.
293js":t.basePath?Sm(`${t.basePath}/speed-insights/script.js`):"/_vercel/speed-insights/script.js"}function _K(t,e){var n;let r=t;if(e)try{r={...(n=JSON.parse(e))==null?void 0:n.speedInsights,...t}}catch{}const s={sdkn:gK+(r.framework?`/${r.framework}`:""),sdkv:vK};return r.sampleRate&&(s.sampleRate=r.sampleRate.toString()),r.route&&(s.route=r.route),a5()&&r.debug===!1&&(s.debug="false"),r.dsn&&(s.dsn=r.dsn),r.endpoint?s.endpoint=Sm(r.endpoint):r.basePath&&(s.endpoint=Sm(`${r.basePath}/speed-insights/vitals`)),{src:xK(r),beforeSend:r.beforeSend,dataset:s}}function Sm(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")?t:`/${t}`}function wK(t={},e){var n;if(!yK()||t.route===null)return null;mK();const{beforeSend:r,src:s,dataset:o}=_K(t,e);if(document.head.querySelector(`script[src*="${s}"]`))return null;r&&((n=window.si)==null||n.call(window,"beforeSend",r));const l=document.createElement("script");l.src=s,l.defer=!0;for(const[d,h]of Object.entries(o))l.dataset[d]=h;return l.onerror=()=>{console.log(`[Vercel Speed Insights] Failed to load script from ${s}. Please check if any content blockers are enabled and try again.`)},document.head.appendChild(l),{setRoute:d=>{l.dataset.route=d??void 0}}}function SK(){if(!(typeof process>"u"||typeof wm>"u"))return wm.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function EK(){if(!(typeof process>"u"||typeof wm>"u"))return wm.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}function kK(t){T.useEffect(()=>{var n;t.beforeSend&&((n=window.si)==null||n.call(window,"beforeSend",t.beforeSend))},[t.beforeSend]);const e=T.useRef(null);return T.useEffect(()=>{if(!e.current){const n=wK({framework:t.framework??"react",basePath:t.basePath??SK(),...t},t.configString??EK());n&&(e.current=n.setRoute)}},[t]),T.useEffect(()=>{e.current&&t.route&&e.current(t.route)},[t.route]),null}var Em={},jK=()=>{window.va||(window.va=function(...e){window.vaq||(window.vaq=[]),window.vaq.push(e)})},TK="@vercel/analytics",NK="2.0.1";function o5(){return typeof window<"u"}function l5(){try{const t="production"}catch{}return"production"}function AK(t="auto"){if(t==="auto"){window.vam=l5();return}window.vam=t}function CK(){return(o5()?window.vam:l5())||"production"}function O_(){return CK()==="development"}function RK(t){return t.scriptSrc?oc(t.scriptSrc):O_()?"https://va.vercel-scripts.com/v1/script.debug.js":t.basePath?oc(`${t.basePath}/insights/script.js`):"/_vercel/insights/script.js"}function OK(t,e){var n;let r=t;if(e)try{r={...(n=JSON.parse(e))==null?void 0:n.analytics,...t}}catch{}AK(r.mode);const s={sdkn:TK+(r.framework?`/${r.framework}`:""),sdkv:NK};return r.disableAutoTrack&&(s.disableAutoTrack="1"),r.viewEndpoint&&(s.viewEndpoint=oc(r.viewEndpoint)),r.eventEndpoint&&(s.eventEndpoint=oc(r.eventEndpoint)),r.sessionEndpoint&&(s.sessionEndpoint=oc(r.sessionEndpoint)),O_()&&r.debug===!1&&(s.debug="false"),r.dsn&&(s.dsn=r.dsn),r.endpoint?s.endpoint=r.endpoint:r.basePath&&(s.endpoint=oc(`${r.basePath}/insights`)),{beforeSend:r.beforeSend,src:RK(r),dataset:s}}function oc(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")?t:`/${t}`}function DK(t={debug:!0},e){var n;if(!o5())return;const{beforeSend:r,src:s,dataset:o}=OK(t,e);if(jK(),r&&((n=window.va)==null||n.call(window,"beforeSend",r)),document.head.querySelector(`script[src*="${s}"]`))return;const l=document.createElement("script");l.src=s;for(const[d,h]of Object.entries(o))l.dataset[d]=h;l.defer=!0,l.onerror=()=>{const d=O_()?"Please check if any ad blockers are enabled and try again.":"Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.";console.log(`[Vercel Web Analytics] Failed to load script from ${s}. ${d}`)},document.head.appendChild(l)}function IK({route:t,path:e}){var n;(n=window.va)==null||n.call(window,"pageview",{route:t,path:e})}function MK(){if(!(typeof process>"u"||typeof Em>"u"))return Em.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function LK(){if(!(typeof process>"u"||typeof Em>"u"))return Em.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}function PK(t){return T.useEffect(()=>{var e;
293t.beforeSend&&((e=window.va)==null||e.call(window,"beforeSend",t.beforeSend))},[t.beforeSend]),T.useEffect(()=>{DK({framework:t.framework||"react",basePath:t.basePath??MK(),...t.route!==void 0&&{disableAutoTrack:!0},...t},t.configString??LK())},[]),T.useEffect(()=>{t.route&&t.path&&IK({route:t.route,path:t.path})},[t.route,t.path]),null}qx.init("phc_oe4a7MXHESiyA6FWZd3NsEsspPKmoeMsJRuqxn9iStEH",{api_host:"https://us.i.posthog.com",defaults:"2026-01-30"});rq({dsn:"https://88f29525bae287777f5105b5c023390d@o4511329003700224.ingest.us.sentry.io/4511329010778112",integrations:[ZH()],tracesSampleRate:1});k4.createRoot(document.getElementById("root")).render(u.jsx(T.StrictMode,{children:u.jsx(lq,{children:u.jsx(bF,{client:qx,children:u.jsxs(vq,{children:[u.jsx(pK,{}),u.jsx(kK,{}),u.jsx(PK,{})]})})})}));

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.