rivet-design 0.16.2 → 0.16.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,438 @@
1
+ var iD=Object.defineProperty;var k6=t=>{throw TypeError(t)};var oD=(t,e,n)=>e in t?iD(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var zo=(t,e,n)=>oD(t,typeof e!="symbol"?e+"":e,n),Fv=(t,e,n)=>e.has(t)||k6("Cannot "+n);var U=(t,e,n)=>(Fv(t,e,"read from private field"),n?n.call(t):e.get(t)),Ye=(t,e,n)=>e.has(t)?k6("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Pe=(t,e,n,r)=>(Fv(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),pt=(t,e,n)=>(Fv(t,e,"access private method"),n);var vp=(t,e,n,r)=>({set _(s){Pe(t,e,s,n)},get _(){return U(t,e,r)}});function aD(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 i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(t,s,i.get?i:{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 i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function Pm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Vv={exports:{}},yd={},Hv={exports:{}},ut={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its 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 C6;function lD(){if(C6)return ut;C6=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function m(D){return D===null||typeof D!="object"?null:(D=p&&D[p]||D["@@iterator"],typeof D=="function"?D:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,_={};function x(D,X,ce){this.props=D,this.context=X,this.refs=_,this.updater=ce||v}x.prototype.isReactComponent={},x.prototype.setState=function(D,X){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,X,"setState")},x.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function b(){}b.prototype=x.prototype;function k(D,X,ce){this.props=D,this.context=X,this.refs=_,this.updater=ce||v}var C=k.prototype=new b;C.constructor=k,w(C,x.prototype),C.isPureReactComponent=!0;var T=Array.isArray,I=Object.prototype.hasOwnProperty,M={current:null},R={key:!0,ref:!0,__self:!0,__source:!0};function A(D,X,ce){var se,re={},de=null,ye=null;if(X!=null)for(se in X.ref!==void 0&&(ye=X.ref),X.key!==void 0&&(de=""+X.key),X)I.call(X,se)&&!R.hasOwnProperty(se)&&(re[se]=X[se]);var fe=arguments.length-2;if(fe===1)re.children=ce;else if(1<fe){for(var oe=Array(fe),je=0;je<fe;je++)oe[je]=arguments[je+2];re.children=oe}if(D&&D.defaultProps)for(se in fe=D.defaultProps,fe)re[se]===void 0&&(re[se]=fe[se]);return{$$typeof:t,type:D,key:de,ref:ye,props:re,_owner:M.current}}function L(D,X){return{$$typeof:t,type:D.type,key:X,ref:D.ref,props:D.props,_owner:D._owner}}function N(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function F(D){var X={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(ce){return X[ce]})}var j=/\/+/g;function Q(D,X){return typeof D=="object"&&D!==null&&D.key!=null?F(""+D.key):X.toString(36)}function q(D,X,ce,se,re){var de=typeof D;(de==="undefined"||de==="boolean")&&(D=null);var ye=!1;if(D===null)ye=!0;else switch(de){case"string":case"number":ye=!0;break;case"object":switch(D.$$typeof){case t:case e:ye=!0}}if(ye)return ye=D,re=re(ye),D=se===""?"."+Q(ye,0):se,T(re)?(ce="",D!=null&&(ce=D.replace(j,"$&/")+"/"),q(re,X,ce,"",function(je){return je})):re!=null&&(N(re)&&(re=L(re,ce+(!re.key||ye&&ye.key===re.key?"":(""+re.key).replace(j,"$&/")+"/")+D)),X.push(re)),1;if(ye=0,se=se===""?".":se+":",T(D))for(var fe=0;fe<D.length;fe++){de=D[fe];var oe=se+Q(de,fe);ye+=q(de,X,ce,oe,re)}else if(oe=m(D),typeof oe=="function")for(D=oe.call(D),fe=0;!(de=D.next()).done;)de=de.value,oe=se+Q(de,fe++),ye+=q(de,X,ce,oe,re);else if(de==="object")throw X=String(D),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.");return ye}function Z(D,X,ce){if(D==null)return D;var se=[],re=0;return q(D,se,"","",function(de){return X.call(ce,de,re++)}),se}function W(D){if(D._status===-1){var X=D._result;X=X(),X.then(function(ce){(D._status===0||D._status===-1)&&(D._status=1,D._result=ce)},function(ce){(D._status===0||D._status===-1)&&(D._status=2,D._result=ce)}),D._status===-1&&(D._status=0,D._result=X)}if(D._status===1)return D._result.default;throw D._result}var Y={current:null},V={transition:null},J={ReactCurrentDispatcher:Y,ReactCurrentBatchConfig:V,ReactCurrentOwner:M};function B(){throw Error("act(...) is not supported in production builds of React.")}return ut.Children={map:Z,forEach:function(D,X,ce){Z(D,function(){X.apply(this,arguments)},ce)},count:function(D){var X=0;return Z(D,function(){X++}),X},toArray:function(D){return Z(D,function(X){return X})||[]},only:function(D){if(!N(D))throw Error("React.Children.only expected to receive a single React element child.");return D}},ut.Component=x,ut.Fragment=n,ut.Profiler=s,ut.PureComponent=k,ut.StrictMode=r,ut.Suspense=u,ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=J,ut.act=B,ut.cloneElement=function(D,X,ce){if(D==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+D+".");var se=w({},D.props),re=D.key,de=D.ref,ye=D._owner;if(X!=null){if(X.ref!==void 0&&(de=X.ref,ye=M.current),X.key!==void 0&&(re=""+X.key),D.type&&D.type.defaultProps)var fe=D.type.defaultProps;for(oe in X)I.call(X,oe)&&!R.hasOwnProperty(oe)&&(se[oe]=X[oe]===void 0&&fe!==void 0?fe[oe]:X[oe])}var oe=arguments.length-2;if(oe===1)se.children=ce;else if(1<oe){fe=Array(oe);for(var je=0;je<oe;je++)fe[je]=arguments[je+2];se.children=fe}return{$$typeof:t,type:D.type,key:re,ref:de,props:se,_owner:ye}},ut.createContext=function(D){return D={$$typeof:o,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},D.Provider={$$typeof:i,_context:D},D.Consumer=D},ut.createElement=A,ut.createFactory=function(D){var X=A.bind(null,D);return X.type=D,X},ut.createRef=function(){return{current:null}},ut.forwardRef=function(D){return{$$typeof:l,render:D}},ut.isValidElement=N,ut.lazy=function(D){return{$$typeof:h,_payload:{_status:-1,_result:D},_init:W}},ut.memo=function(D,X){return{$$typeof:d,type:D,compare:X===void 0?null:X}},ut.startTransition=function(D){var X=V.transition;V.transition={};try{D()}finally{V.transition=X}},ut.unstable_act=B,ut.useCallback=function(D,X){return Y.current.useCallback(D,X)},ut.useContext=function(D){return Y.current.useContext(D)},ut.useDebugValue=function(){},ut.useDeferredValue=function(D){return Y.current.useDeferredValue(D)},ut.useEffect=function(D,X){return Y.current.useEffect(D,X)},ut.useId=function(){return Y.current.useId()},ut.useImperativeHandle=function(D,X,ce){return Y.current.useImperativeHandle(D,X,ce)},ut.useInsertionEffect=function(D,X){return Y.current.useInsertionEffect(D,X)},ut.useLayoutEffect=function(D,X){return Y.current.useLayoutEffect(D,X)},ut.useMemo=function(D,X){return Y.current.useMemo(D,X)},ut.useReducer=function(D,X,ce){return Y.current.useReducer(D,X,ce)},ut.useRef=function(D){return Y.current.useRef(D)},ut.useState=function(D){return Y.current.useState(D)},ut.useSyncExternalStore=function(D,X,ce){return Y.current.useSyncExternalStore(D,X,ce)},ut.useTransition=function(){return Y.current.useTransition()},ut.version="18.3.1",ut}var P6;function B2(){return P6||(P6=1,Hv.exports=lD()),Hv.exports}/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its 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 T6;function cD(){if(T6)return yd;T6=1;var t=B2(),e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(l,u,d){var h,p={},m=null,v=null;d!==void 0&&(m=""+d),u.key!==void 0&&(m=""+u.key),u.ref!==void 0&&(v=u.ref);for(h in u)r.call(u,h)&&!i.hasOwnProperty(h)&&(p[h]=u[h]);if(l&&l.defaultProps)for(h in u=l.defaultProps,u)p[h]===void 0&&(p[h]=u[h]);return{$$typeof:e,type:l,key:m,ref:v,props:p,_owner:s.current}}return yd.Fragment=n,yd.jsx=o,yd.jsxs=o,yd}var I6;function uD(){return I6||(I6=1,Vv.exports=cD()),Vv.exports}var S=uD(),g=B2();const we=Pm(g),Zf=aD({__proto__:null,default:we},[g]),HC=g.createContext(void 0),zC=t=>{const e=g.useContext(HC);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},dD=({client:t,children:e})=>(g.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),S.jsx(HC.Provider,{value:t,children:e})),fD={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)};var Ko,z2,RC,hD=(RC=class{constructor(){Ye(this,Ko,fD);Ye(this,z2,!1)}setTimeoutProvider(t){Pe(this,Ko,t)}setTimeout(t,e){return U(this,Ko).setTimeout(t,e)}clearTimeout(t){U(this,Ko).clearTimeout(t)}setInterval(t,e){return U(this,Ko).setInterval(t,e)}clearInterval(t){U(this,Ko).clearInterval(t)}},Ko=new WeakMap,z2=new WeakMap,RC);const gl=new hD;function pD(t){setTimeout(t,0)}const mD=typeof window>"u"||"Deno"in globalThis;function Dr(){}function gD(t,e){return typeof t=="function"?t(e):t}function BC(t){return typeof t=="number"&&t>=0&&t!==1/0}function UC(t,e){return Math.max(t+(e||0)-Date.now(),0)}function un(t,e){return typeof t=="function"?t(e):t}function A6(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:l}=t;if(o){if(r){if(e.queryHash!==U2(o,e.options))return!1}else if(!du(e.queryKey,o))return!1}if(n!=="all"){const u=e.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||s&&s!==e.state.fetchStatus||i&&!i(e))}function R6(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(cf(e.options.mutationKey)!==cf(i))return!1}else if(!du(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function U2(t,e){return((e==null?void 0:e.queryKeyHashFn)||cf)(t)}function cf(t){return JSON.stringify(t,(e,n)=>Ty(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function du(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(Array.isArray(t)&&Array.isArray(e)){for(let r=0;r<e.length;r++)if(!du(t[r],e[r]))return!1;return!0}const n=Object.keys(e);for(const r of n)if(!du(t[r],e[r]))return!1;return!0}return!1}const vD=Object.prototype.hasOwnProperty;function WC(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=M6(t)&&M6(e);if(!r&&!(Ty(t)&&Ty(e)))return e;const s=(r?t:Object.keys(t)).length,i=r?e:Object.keys(e),o=i.length,l=r?new Array(o):{};let u=0;for(let d=0;d<o;d++){const h=r?d:i[d],p=t[h],m=e[h];if(p===m){l[h]=p,(r?d<s:vD.call(t,h))&&u++;continue}if(p===null||m===null||typeof p!="object"||typeof m!="object"){l[h]=m;continue}const v=WC(p,m,n+1);l[h]=v,v===p&&u++}return s===o&&u===s?t:l}function zv(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function M6(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Ty(t){if(!O6(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!O6(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function O6(t){return Object.prototype.toString.call(t)==="[object Object]"}function yD(t){return new Promise(e=>{gl.setTimeout(e,t)})}function Iy(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?WC(t,e):e}function _D(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function wD(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}const W2=Symbol();function ZC(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===W2?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function qC(t,e){return typeof t=="function"?t(...e):!!t}function xD(t,e,n){let r=!1,s;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(s??(s=e()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),t}let bD=()=>mD;const Z2=()=>bD();var qf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},wl,Yo,Qc,MC,SD=(MC=class extends qf{constructor(){super();Ye(this,wl);Ye(this,Yo);Ye(this,Qc);Pe(this,Qc,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){U(this,Yo)||this.setEventListener(U(this,Qc))}onUnsubscribe(){var e;this.hasListeners()||((e=U(this,Yo))==null||e.call(this),Pe(this,Yo,void 0))}setEventListener(e){var n;Pe(this,Qc,e),(n=U(this,Yo))==null||n.call(this),Pe(this,Yo,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){U(this,wl)!==e&&(Pe(this,wl,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof U(this,wl)=="boolean"?U(this,wl):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},wl=new WeakMap,Yo=new WeakMap,Qc=new WeakMap,MC);const q2=new SD,ED=pD;function kD(){let t=[],e=0,n=l=>{l()},r=l=>{l()},s=ED;const i=l=>{e?t.push(l):s(()=>{n(l)})},o=()=>{const l=t;t=[],l.length&&s(()=>{r(()=>{l.forEach(u=>{n(u)})})})};return{batch:l=>{let u;e++;try{u=l()}finally{e--,e||o()}return u},batchCalls:l=>(...u)=>{i(()=>{l(...u)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}const tr=kD();var Jc,Xo,eu,OC,CD=(OC=class extends qf{constructor(){super();Ye(this,Jc,!0);Ye(this,Xo);Ye(this,eu);Pe(this,eu,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){U(this,Xo)||this.setEventListener(U(this,eu))}onUnsubscribe(){var e;this.hasListeners()||((e=U(this,Xo))==null||e.call(this),Pe(this,Xo,void 0))}setEventListener(e){var n;Pe(this,eu,e),(n=U(this,Xo))==null||n.call(this),Pe(this,Xo,e(this.setOnline.bind(this)))}setOnline(e){U(this,Jc)!==e&&(Pe(this,Jc,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return U(this,Jc)}},Jc=new WeakMap,Xo=new WeakMap,eu=new WeakMap,OC);const A0=new CD;function PD(t){return Math.min(1e3*2**t,3e4)}function GC(t){return(t??"online")==="online"?A0.isOnline():!0}var Ay=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function KC(t){let e=!1,n=0,r,s="pending",i,o;const l=new Promise((k,C)=>{i=k,o=C});l.catch(Dr);const u=()=>s!=="pending",d=k=>{var C;if(!u()){const T=new Ay(k);_(T),(C=t.onCancel)==null||C.call(t,T)}},h=()=>{e=!0},p=()=>{e=!1},m=()=>q2.isFocused()&&(t.networkMode==="always"||A0.isOnline())&&t.canRun(),v=()=>GC(t.networkMode)&&t.canRun(),w=k=>{u()||(r==null||r(),s="resolved",i(k))},_=k=>{u()||(r==null||r(),s="rejected",o(k))},x=()=>new Promise(k=>{var C;r=T=>{(u()||m())&&k(T)},(C=t.onPause)==null||C.call(t)}).then(()=>{var k;r=void 0,u()||(k=t.onContinue)==null||k.call(t)}),b=()=>{if(u())return;let k;const C=n===0?t.initialPromise:void 0;try{k=C??t.fn()}catch(T){k=Promise.reject(T)}Promise.resolve(k).then(w).catch(T=>{var L;if(u())return;const I=t.retry??(Z2()?0:3),M=t.retryDelay??PD,R=typeof M=="function"?M(n,T):M,A=I===!0||typeof I=="number"&&n<I||typeof I=="function"&&I(n,T);if(e||!A){_(T);return}n++,(L=t.onFail)==null||L.call(t,n,T),yD(R).then(()=>m()?void 0:x()).then(()=>{e?_(T):b()})})};return{promise:l,status:()=>s,cancel:d,continue:()=>(r==null||r(),l),cancelRetry:h,continueRetry:p,canStart:v,start:()=>(v()?b():x().then(b),l)}}var xl,LC,YC=(LC=class{constructor(){Ye(this,xl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),BC(this.gcTime)&&Pe(this,xl,gl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Z2()?1/0:3e5))}clearGcTimeout(){U(this,xl)!==void 0&&(gl.clearTimeout(U(this,xl)),Pe(this,xl,void 0))}},xl=new WeakMap,LC);function TD(t){return{onFetch:(e,n)=>{var h,p,m,v,w;const r=e.options,s=(m=(p=(h=e.fetchOptions)==null?void 0:h.meta)==null?void 0:p.fetchMore)==null?void 0:m.direction,i=((v=e.state.data)==null?void 0:v.pages)||[],o=((w=e.state.data)==null?void 0:w.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const d=async()=>{let _=!1;const x=C=>{xD(C,()=>e.signal,()=>_=!0)},b=ZC(e.options,e.fetchOptions),k=async(C,T,I)=>{if(_)return Promise.reject(e.signal.reason);if(T==null&&C.pages.length)return Promise.resolve(C);const R=(()=>{const F={client:e.client,queryKey:e.queryKey,pageParam:T,direction:I?"backward":"forward",meta:e.options.meta};return x(F),F})(),A=await b(R),{maxPages:L}=e.options,N=I?wD:_D;return{pages:N(C.pages,A,L),pageParams:N(C.pageParams,T,L)}};if(s&&i.length){const C=s==="backward",T=C?ID:L6,I={pages:i,pageParams:o};l=await k(I,T(r,I),C)}else{const C=t??i.length;do{const T=u===0?o[0]??r.initialPageParam:L6(r,l);if(u>0&&T==null)break;l=await k(l,T),u++}while(u<C)}return l};e.options.persister?e.fetchFn=()=>{var _,x;return(x=(_=e.options).persister)==null?void 0:x.call(_,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=d}}}function L6(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function ID(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var tu,bl,nu,Cs,Sl,Ln,Hf,El,Xs,Qi,DC,AD=(DC=class extends YC{constructor(e){super();Ye(this,Xs);Ye(this,tu);Ye(this,bl);Ye(this,nu);Ye(this,Cs);Ye(this,Sl);Ye(this,Ln);Ye(this,Hf);Ye(this,El);Pe(this,El,!1),Pe(this,Hf,e.defaultOptions),this.setOptions(e.options),this.observers=[],Pe(this,Sl,e.client),Pe(this,Cs,U(this,Sl).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Pe(this,bl,N6(this.options)),this.state=e.state??U(this,bl),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return U(this,tu)}get promise(){var e;return(e=U(this,Ln))==null?void 0:e.promise}setOptions(e){if(this.options={...U(this,Hf),...e},e!=null&&e._type&&Pe(this,tu,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=N6(this.options);n.data!==void 0&&(this.setState(D6(n.data,n.dataUpdatedAt)),Pe(this,bl,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&U(this,Cs).remove(this)}setData(e,n){const r=Iy(this.state.data,e,this.options);return pt(this,Xs,Qi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e){pt(this,Xs,Qi).call(this,{type:"setState",state:e})}cancel(e){var r,s;const n=(r=U(this,Ln))==null?void 0:r.promise;return(s=U(this,Ln))==null||s.cancel(e),n?n.then(Dr).catch(Dr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return U(this,bl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>un(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===W2||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>un(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!UC(this.state.dataUpdatedAt,e)}onFocus(){var e,n;(e=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||e.refetch({cancelRefetch:!1}),(n=U(this,Ln))==null||n.continue()}onOnline(){var e,n;(e=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||e.refetch({cancelRefetch:!1}),(n=U(this,Ln))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),U(this,Cs).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){const n=this.observers.indexOf(e);n!==-1&&(this.observers.splice(n,1),this.observers.length||(U(this,Ln)&&(U(this,El)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?U(this,Ln).cancel({revert:!0}):U(this,Ln).cancelRetry()),this.scheduleGc()),U(this,Cs).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||pt(this,Xs,Qi).call(this,{type:"invalidate"})}async fetch(e,n){var d,h,p,m,v,w,_,x,b,k,C,T;if(this.state.fetchStatus!=="idle"&&((d=U(this,Ln))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(U(this,Ln))return U(this,Ln).continueRetry(),U(this,Ln).promise}if(e&&this.setOptions(e),!this.options.queryFn){const I=this.observers.find(M=>M.options.queryFn);I&&this.setOptions(I.options)}const r=new AbortController,s=I=>{Object.defineProperty(I,"signal",{enumerable:!0,get:()=>(Pe(this,El,!0),r.signal)})},i=()=>{const I=ZC(this.options,n),R=(()=>{const A={client:U(this,Sl),queryKey:this.queryKey,meta:this.meta};return s(A),A})();return Pe(this,El,!1),this.options.persister?this.options.persister(I,R,this):I(R)},l=(()=>{const I={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:U(this,Sl),state:this.state,fetchFn:i};return s(I),I})();(h=U(this,tu)==="infinite"?TD(this.options.pages):this.options.behavior)==null||h.onFetch(l,this),Pe(this,nu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=l.fetchOptions)==null?void 0:p.meta))&&pt(this,Xs,Qi).call(this,{type:"fetch",meta:(m=l.fetchOptions)==null?void 0:m.meta});const u=Pe(this,Ln,KC({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:I=>{I instanceof Ay&&I.revert&&this.setState({...U(this,nu),fetchStatus:"idle"}),r.abort()},onFail:(I,M)=>{pt(this,Xs,Qi).call(this,{type:"failed",failureCount:I,error:M})},onPause:()=>{pt(this,Xs,Qi).call(this,{type:"pause"})},onContinue:()=>{pt(this,Xs,Qi).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const I=await u.start();if(I===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(I),(w=(v=U(this,Cs).config).onSuccess)==null||w.call(v,I,this),(x=(_=U(this,Cs).config).onSettled)==null||x.call(_,I,this.state.error,this),I}catch(I){if(I instanceof Ay){if(I.silent)return U(this,Ln).promise;if(I.revert){if(this.state.data===void 0)throw I;return this.state.data}}throw pt(this,Xs,Qi).call(this,{type:"error",error:I}),(k=(b=U(this,Cs).config).onError)==null||k.call(b,I,this),(T=(C=U(this,Cs).config).onSettled)==null||T.call(C,this.state.data,I,this),I}finally{U(this,Ln)===u&&Pe(this,Ln,void 0),this.scheduleGc()}}},tu=new WeakMap,bl=new WeakMap,nu=new WeakMap,Cs=new WeakMap,Sl=new WeakMap,Ln=new WeakMap,Hf=new WeakMap,El=new WeakMap,Xs=new WeakSet,Qi=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...XC(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...D6(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Pe(this,nu,e.manual?s:void 0),s;case"error":const i=e.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),tr.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),U(this,Cs).notify({query:this,type:"updated",action:e})})},DC);function XC(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:GC(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function D6(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function N6(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var vr,mt,zf,yr,kl,ru,io,Bf,su,iu,Cl,Pl,Qo,ou,Tt,Ld,Ry,My,Oy,Ly,Dy,Ny,$y,jy,NC,RD=(NC=class extends qf{constructor(e,n){super();Ye(this,Tt);Ye(this,vr);Ye(this,mt);Ye(this,zf);Ye(this,yr);Ye(this,kl);Ye(this,ru);Ye(this,io);Ye(this,Bf);Ye(this,su);Ye(this,iu);Ye(this,Cl);Ye(this,Pl);Ye(this,Qo);Ye(this,ou,new Set);this.options=n,Pe(this,vr,e),Pe(this,io,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(U(this,mt).addObserver(this),$6(U(this,mt),this.options)?pt(this,Tt,Ld).call(this):this.updateResult(),pt(this,Tt,Dy).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Fy(U(this,mt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Fy(U(this,mt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,pt(this,Tt,Ny).call(this),pt(this,Tt,$y).call(this),U(this,mt).removeObserver(this)}setOptions(e){const n=this.options,r=U(this,mt);if(this.options=U(this,vr).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof un(this.options.enabled,U(this,mt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");pt(this,Tt,jy).call(this),U(this,mt).setOptions(this.options),n._defaulted&&!zv(this.options,n)&&U(this,vr).getQueryCache().notify({type:"observerOptionsUpdated",query:U(this,mt),observer:this});const s=this.hasListeners();s&&j6(U(this,mt),r,this.options,n)&&pt(this,Tt,Ld).call(this),this.updateResult(),s&&(U(this,mt)!==r||un(this.options.enabled,U(this,mt))!==un(n.enabled,U(this,mt))||un(this.options.staleTime,U(this,mt))!==un(n.staleTime,U(this,mt)))&&pt(this,Tt,My).call(this);const i=pt(this,Tt,Oy).call(this);s&&(U(this,mt)!==r||un(this.options.enabled,U(this,mt))!==un(n.enabled,U(this,mt))||i!==U(this,Qo))&&pt(this,Tt,Ly).call(this,i)}getOptimisticResult(e){const n=U(this,vr).getQueryCache().build(U(this,vr),e),r=this.createResult(n,e);return zv(this.getCurrentResult(),r)||(Pe(this,yr,r),Pe(this,ru,this.options),Pe(this,kl,U(this,mt).state)),r}getCurrentResult(){return U(this,yr)}trackResult(e,n){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),n==null||n(s),Reflect.get(r,s))})}trackProp(e){U(this,ou).add(e)}getCurrentQuery(){return U(this,mt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=U(this,vr).defaultQueryOptions(e),r=U(this,vr).getQueryCache().build(U(this,vr),n);let s=()=>{},i;const o=new Promise(l=>{i=l,s=U(this,vr).getQueryCache().subscribe(u=>{u.type==="updated"&&u.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),l(this.createResult(r,n)))})});return Promise.race([r.fetch().then(()=>{const l=this.createResult(r,n);return i==null||i(l),l}).finally(()=>{s()}),o])}fetch(e){return pt(this,Tt,Ld).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),U(this,yr)))}createResult(e,n){var M;const r=U(this,mt),s=this.options,i=U(this,yr),o=U(this,kl),l=U(this,ru),u=e!==r?e.state:U(this,zf),{state:d}=e;let h={...d},p=!1,m;if(n._optimisticResults){const R=this.hasListeners(),A=!R&&$6(e,n),L=R&&j6(e,r,n,s);(A||L)&&(h={...h,...XC(d.data,e.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:v,errorUpdatedAt:w,status:_}=h;m=h.data;let x=!1;if(n.placeholderData!==void 0&&m===void 0&&_==="pending"){let R;i!=null&&i.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(R=i.data,x=!0):R=typeof n.placeholderData=="function"?n.placeholderData((M=U(this,iu))==null?void 0:M.state.data,U(this,iu)):n.placeholderData,R!==void 0&&(_="success",m=Iy(i==null?void 0:i.data,R,n),p=!0)}if(n.select&&m!==void 0&&!x)if(i&&m===(o==null?void 0:o.data)&&n.select===U(this,Bf))m=U(this,su);else try{Pe(this,Bf,n.select),m=n.select(m),m=Iy(i==null?void 0:i.data,m,n),Pe(this,su,m),Pe(this,io,null)}catch(R){Pe(this,io,R)}else m===void 0&&Pe(this,io,null);U(this,io)&&(v=U(this,io),m=U(this,su),w=Date.now(),_="error",p=!1);const b=h.fetchStatus==="fetching",k=_==="pending",C=_==="error",T=k&&b,I=m!==void 0;return{status:_,fetchStatus:h.fetchStatus,isPending:k,isSuccess:_==="success",isError:C,isInitialLoading:T,isLoading:T,data:m,dataUpdatedAt:h.dataUpdatedAt,error:v,errorUpdatedAt:w,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:b,isRefetching:b&&!k,isLoadingError:C&&!I,isPaused:h.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:C&&I,isStale:G2(e,n),refetch:this.refetch,isEnabled:un(n.enabled,e)!==!1}}updateResult(){const e=U(this,yr),n=this.createResult(U(this,mt),this.options);if(Pe(this,kl,U(this,mt).state),Pe(this,ru,this.options),U(this,kl).data!==void 0&&Pe(this,iu,U(this,mt)),zv(n,e))return;Pe(this,yr,n);const s=(()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!U(this,ou).size)return!0;const l=new Set(o??U(this,ou));return this.options.throwOnError&&l.add("error"),Object.keys(U(this,yr)).some(u=>{const d=u;return U(this,yr)[d]!==e[d]&&l.has(d)})})();tr.batch(()=>{s&&this.listeners.forEach(i=>{i(U(this,yr))}),U(this,vr).getQueryCache().notify({query:U(this,mt),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&pt(this,Tt,Dy).call(this)}},vr=new WeakMap,mt=new WeakMap,zf=new WeakMap,yr=new WeakMap,kl=new WeakMap,ru=new WeakMap,io=new WeakMap,Bf=new WeakMap,su=new WeakMap,iu=new WeakMap,Cl=new WeakMap,Pl=new WeakMap,Qo=new WeakMap,ou=new WeakMap,Tt=new WeakSet,Ld=function(e){pt(this,Tt,jy).call(this);let n=U(this,mt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Dr)),n},Ry=function(e){return!Z2()&&un(this.options.enabled,U(this,mt))!==!1&&BC(e)},My=function(){pt(this,Tt,Ny).call(this);const e=un(this.options.staleTime,U(this,mt));if(U(this,yr).isStale||!pt(this,Tt,Ry).call(this,e))return;const n=UC(U(this,yr).dataUpdatedAt,e)+1;Pe(this,Cl,gl.setTimeout(()=>{U(this,yr).isStale||this.updateResult()},n))},Oy=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(U(this,mt)):this.options.refetchInterval)??!1},Ly=function(e){pt(this,Tt,$y).call(this),Pe(this,Qo,e),!(U(this,Qo)===0||!pt(this,Tt,Ry).call(this,U(this,Qo)))&&Pe(this,Pl,gl.setInterval(()=>{(this.options.refetchIntervalInBackground||q2.isFocused())&&pt(this,Tt,Ld).call(this)},U(this,Qo)))},Dy=function(){pt(this,Tt,My).call(this),pt(this,Tt,Ly).call(this,pt(this,Tt,Oy).call(this))},Ny=function(){U(this,Cl)!==void 0&&(gl.clearTimeout(U(this,Cl)),Pe(this,Cl,void 0))},$y=function(){U(this,Pl)!==void 0&&(gl.clearInterval(U(this,Pl)),Pe(this,Pl,void 0))},jy=function(){const e=U(this,vr).getQueryCache().build(U(this,vr),this.options);if(e===U(this,mt))return;const n=U(this,mt);Pe(this,mt,e),Pe(this,zf,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},NC);function MD(t,e){return un(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&un(e.retryOnMount,t)===!1)}function $6(t,e){return MD(t,e)||t.state.data!==void 0&&Fy(t,e,e.refetchOnMount)}function Fy(t,e,n){if(un(e.enabled,t)!==!1&&un(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&G2(t,e)}return!1}function j6(t,e,n,r){return(t!==e||un(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&G2(t,n)}function G2(t,e){return un(e.enabled,t)!==!1&&t.isStaleByTime(un(e.staleTime,t))}var Uf,wi,cr,Tl,xi,Zo,$C,OD=($C=class extends YC{constructor(e){super();Ye(this,xi);Ye(this,Uf);Ye(this,wi);Ye(this,cr);Ye(this,Tl);Pe(this,Uf,e.client),this.mutationId=e.mutationId,Pe(this,cr,e.mutationCache),Pe(this,wi,[]),this.state=e.state||LD(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){U(this,wi).includes(e)||(U(this,wi).push(e),this.clearGcTimeout(),U(this,cr).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Pe(this,wi,U(this,wi).filter(n=>n!==e)),this.scheduleGc(),U(this,cr).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){U(this,wi).length||(this.state.status==="pending"?this.scheduleGc():U(this,cr).remove(this))}continue(){var e;return((e=U(this,Tl))==null?void 0:e.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(e){var l,u,d,h,p,m,v,w,_,x,b,k,C,T,I,M,R,A;const n=()=>{pt(this,xi,Zo).call(this,{type:"continue"})},r={client:U(this,Uf),meta:this.options.meta,mutationKey:this.options.mutationKey},s=Pe(this,Tl,KC({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(L,N)=>{pt(this,xi,Zo).call(this,{type:"failed",failureCount:L,error:N})},onPause:()=>{pt(this,xi,Zo).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>U(this,cr).canRun(this)})),i=this.state.status==="pending",o=!s.canStart();try{if(i)n();else{pt(this,xi,Zo).call(this,{type:"pending",variables:e,isPaused:o}),U(this,cr).config.onMutate&&await U(this,cr).config.onMutate(e,this,r);const N=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,e,r));N!==this.state.context&&pt(this,xi,Zo).call(this,{type:"pending",context:N,variables:e,isPaused:o})}const L=await s.start();return await((h=(d=U(this,cr).config).onSuccess)==null?void 0:h.call(d,L,e,this.state.context,this,r)),await((m=(p=this.options).onSuccess)==null?void 0:m.call(p,L,e,this.state.context,r)),await((w=(v=U(this,cr).config).onSettled)==null?void 0:w.call(v,L,null,this.state.variables,this.state.context,this,r)),await((x=(_=this.options).onSettled)==null?void 0:x.call(_,L,null,e,this.state.context,r)),pt(this,xi,Zo).call(this,{type:"success",data:L}),L}catch(L){try{await((k=(b=U(this,cr).config).onError)==null?void 0:k.call(b,L,e,this.state.context,this,r))}catch(N){Promise.reject(N)}try{await((T=(C=this.options).onError)==null?void 0:T.call(C,L,e,this.state.context,r))}catch(N){Promise.reject(N)}try{await((M=(I=U(this,cr).config).onSettled)==null?void 0:M.call(I,void 0,L,this.state.variables,this.state.context,this,r))}catch(N){Promise.reject(N)}try{await((A=(R=this.options).onSettled)==null?void 0:A.call(R,void 0,L,e,this.state.context,r))}catch(N){Promise.reject(N)}throw pt(this,xi,Zo).call(this,{type:"error",error:L}),L}finally{U(this,Tl)===s&&Pe(this,Tl,void 0),U(this,cr).runNext(this)}}},Uf=new WeakMap,wi=new WeakMap,cr=new WeakMap,Tl=new WeakMap,xi=new WeakSet,Zo=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),tr.batch(()=>{U(this,wi).forEach(r=>{r.onMutationUpdate(e)}),U(this,cr).notify({mutation:this,type:"updated",action:e})})},$C);function LD(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var oo,Qs,Wf,jC,DD=(jC=class extends qf{constructor(e={}){super();Ye(this,oo);Ye(this,Qs);Ye(this,Wf);this.config=e,Pe(this,oo,new Set),Pe(this,Qs,new Map),Pe(this,Wf,0)}build(e,n,r){const s=new OD({client:e,mutationCache:this,mutationId:++vp(this,Wf)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){U(this,oo).add(e);const n=yp(e);if(typeof n=="string"){const r=U(this,Qs).get(n);r?r.push(e):U(this,Qs).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(U(this,oo).delete(e)){const n=yp(e);if(typeof n=="string"){const r=U(this,Qs).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&U(this,Qs).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){var r;const n=yp(e);if(typeof n=="string"){const s=(r=U(this,Qs).get(n))==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r,s;const n=yp(e);return typeof n=="string"?((s=(r=U(this,Qs).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){tr.batch(()=>{U(this,oo).forEach(e=>{this.notify({type:"removed",mutation:e})}),U(this,oo).clear(),U(this,Qs).clear()})}getAll(){return Array.from(U(this,oo))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>R6(n,r))}findAll(e={}){return this.getAll().filter(n=>R6(e,n))}notify(e){tr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return tr.batch(()=>Promise.all(e.map(n=>n.continue().catch(Dr))))}},oo=new WeakMap,Qs=new WeakMap,Wf=new WeakMap,jC);function yp(t){var e;return(e=t.options.scope)==null?void 0:e.id}var bi,FC,ND=(FC=class extends qf{constructor(e={}){super();Ye(this,bi);this.config=e,Pe(this,bi,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??U2(s,n);let o=this.get(i);return o||(o=new AD({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){U(this,bi).has(e.queryHash)||(U(this,bi).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=U(this,bi).get(e.queryHash);n&&(e.destroy(),n===e&&U(this,bi).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){tr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return U(this,bi).get(e)}getAll(){return[...U(this,bi).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>A6(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>A6(e,r)):n}notify(e){tr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){tr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){tr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},bi=new WeakMap,FC),tn,Jo,ea,au,lu,ta,cu,uu,VC,$D=(VC=class{constructor(t={}){Ye(this,tn);Ye(this,Jo);Ye(this,ea);Ye(this,au);Ye(this,lu);Ye(this,ta);Ye(this,cu);Ye(this,uu);Pe(this,tn,t.queryCache||new ND),Pe(this,Jo,t.mutationCache||new DD),Pe(this,ea,t.defaultOptions||{}),Pe(this,au,new Map),Pe(this,lu,new Map),Pe(this,ta,0)}mount(){vp(this,ta)._++,U(this,ta)===1&&(Pe(this,cu,q2.subscribe(async t=>{t&&(await this.resumePausedMutations(),U(this,tn).onFocus())})),Pe(this,uu,A0.subscribe(async t=>{t&&(await this.resumePausedMutations(),U(this,tn).onOnline())})))}unmount(){var t,e;vp(this,ta)._--,U(this,ta)===0&&((t=U(this,cu))==null||t.call(this),Pe(this,cu,void 0),(e=U(this,uu))==null||e.call(this),Pe(this,uu,void 0))}isFetching(t){return U(this,tn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return U(this,Jo).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=U(this,tn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=U(this,tn).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(un(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return U(this,tn).findAll(t).map(({queryKey:e,state:n})=>[e,n.data])}setQueryData(t,e,n){var o;const r=this.defaultQueryOptions({queryKey:t}),s=(o=U(this,tn).get(r.queryHash))==null?void 0:o.state.data,i=gD(e,s);if(i!==void 0)return U(this,tn).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(t,e,n){return tr.batch(()=>U(this,tn).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=U(this,tn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=U(this,tn);tr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=U(this,tn);return tr.batch(()=>{const r=n.findAll(t),s=new Set(r);return r.forEach(i=>{i.reset()}),this.refetchQueries({type:"active",predicate:i=>s.has(i)},e)})}cancelQueries(t,e={}){const n={revert:!0,...e},r=tr.batch(()=>U(this,tn).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Dr).catch(Dr)}invalidateQueries(t,e={}){return tr.batch(()=>(U(this,tn).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=tr.batch(()=>U(this,tn).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Dr)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Dr)}async query(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=U(this,tn).build(this,e),r=n.isStaleByTime(un(e.staleTime,n))?await n.fetch(e):n.state.data,s=e.select;return s?s(r):r}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=U(this,tn).build(this,e);return n.isStaleByTime(un(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Dr).catch(Dr)}infiniteQuery(t){return t._type="infinite",this.query(t)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Dr).catch(Dr)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return A0.isOnline()?U(this,Jo).resumePausedMutations():Promise.resolve()}getQueryCache(){return U(this,tn)}getMutationCache(){return U(this,Jo)}getDefaultOptions(){return U(this,ea)}setDefaultOptions(t){Pe(this,ea,t)}setQueryDefaults(t,e){U(this,au).set(cf(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...U(this,au).values()],n={};return e.forEach(r=>{du(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){U(this,lu).set(cf(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...U(this,lu).values()],n={};return e.forEach(r=>{du(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...U(this,ea).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=U2(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===W2&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...U(this,ea).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){U(this,tn).clear(),U(this,Jo).clear()}},tn=new WeakMap,Jo=new WeakMap,ea=new WeakMap,au=new WeakMap,lu=new WeakMap,ta=new WeakMap,cu=new WeakMap,uu=new WeakMap,VC);const QC=g.createContext(!1),jD=()=>g.useContext(QC);QC.Provider;function FD(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const VD=g.createContext(FD()),HD=()=>g.useContext(VD),zD=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?qC(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||r)&&(e.isReset()||(t.retryOnMount=!1))},BD=t=>{g.useEffect(()=>{t.clearReset()},[t])},UD=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||qC(n,[t.error,r])),WD=t=>{if(t.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},ZD=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,qD=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function GD(t,e,n){const r=jD(),s=HD(),i=zC(),o=i.defaultQueryOptions(t),l=i.getQueryCache().get(o.queryHash),u=t.subscribed!==!1;o._optimisticResults=r?"isRestoring":u?"optimistic":void 0,WD(o),zD(o,s,l),BD(s);const[d]=g.useState(()=>new e(i,o)),h=d.getOptimisticResult(o),p=!r&&u;if(g.useSyncExternalStore(g.useCallback(m=>{const v=p?d.subscribe(tr.batchCalls(m)):Dr;return d.updateResult(),v},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),g.useEffect(()=>{d.setOptions(o)},[o,d]),ZD(o,h))throw qD(o,d,s);if(UD({result:h,errorResetBoundary:s,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw h.error;return o.notifyOnChangeProps?h:d.trackResult(h)}function Vy(t,e){return GD(t,RD)}const ee="u">typeof window?window:void 0,dr="u">typeof globalThis?globalThis:ee,$n=dr==null?void 0:dr.navigator,ue=dr==null?void 0:dr.document,Bt=dr==null?void 0:dr.location,uf=dr==null?void 0:dr.fetch,K2=dr!=null&&dr.XMLHttpRequest&&"withCredentials"in new dr.XMLHttpRequest?dr.XMLHttpRequest:void 0,F6=dr==null?void 0:dr.AbortController,KD=dr==null?void 0:dr.CompressionStream,_r=$n==null?void 0:$n.userAgent;function JC(){return!(!ee||ee.navigator.onLine===!1)}const _d=typeof globalThis<"u"?globalThis:ee;_d&&typeof self>"u"&&(_d.self=_d),_d&&typeof File>"u"&&(_d.File=function(){});const Le=ee??{},YD="0.8.3",fo={DEBUG:!1,LIB_VERSION:YD,LIB_NAME:"browser-common"};var vi=(function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.AiCaptureQueue="ai_capture_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.PushRegistered="push_registered",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t})({}),Hy=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});const XD=["$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"],QD=["token"];function ze(t,e){return t.indexOf(e)!==-1}const Tm=function(t){return t.trim()},zy=function(t){return t.replace(/^\$/,"")};function e3(t){var e;const 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"}const t3=Object.prototype,Y2=t3.hasOwnProperty,Im=t3.toString,He=Array.isArray||function(t){return Im.call(t)==="[object Array]"},Nn=t=>typeof t=="function",st=t=>t===Object(t)&&!He(t),Nr=t=>{if(st(t)){for(const e in t)if(Y2.call(t,e))return!1;return!0}return!1},le=t=>t===void 0,tt=t=>Im.call(t)=="[object String]",Hd=t=>tt(t)&&t.trim().length===0,Kt=t=>t===null,Xe=t=>le(t)||Kt(t),Xt=t=>Im.call(t)=="[object Number]"&&t==t,Ji=t=>Xt(t)&&t>0,xr=t=>Im.call(t)==="[object Boolean]",JD=t=>ze(XD,t),eN=t=>ze(QD,t);function n3(t){return t===null||typeof t!="object"}function R0(t,e){return{}.toString.call(t)===`[object ${e}]`}function Pu(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return r3(t,Error)}}function X2(t){return"u">typeof Event&&r3(t,Event)}function r3(t,e){try{return t instanceof e}catch{return!1}}const tN=[!0,"true",1,"1","yes"],Bv=t=>ze(tN,t),nN=[!1,"false",0,"0","no"];function V6(t,e,n,r,s,i,o){try{var l=t[i](o),u=l.value}catch(d){return void n(d)}l.done?e(u):Promise.resolve(u).then(r,s)}function Mt(t){return function(){var e=this,n=arguments;return new Promise(function(r,s){var i=t.apply(e,n);function o(u){V6(i,r,s,o,l,"next",u)}function l(u){V6(i,r,s,o,l,"throw",u)}o(void 0)})}}const rN=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],H6=function(t,e=[]){if(!t)return!1;const n=t.toLowerCase();return rN.concat(e).some(r=>{const s=r.toLowerCase();return n.indexOf(s)!==-1})};function Ci(t,e,n,r,s){return e>n&&(r.warn("min cannot be greater than max."),e=n),Xt(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),Ci(s??n,e,n,r))}var sN=class{constructor(t){this.C={},this.I=t.I,this.R=Ci(t.bucketSize,0,100,t.$),this.A=Ci(t.refillRate,0,this.R,t.$),this.O=Ci(t.refillInterval,0,864e5,t.$)}F(t,e){const n=Math.floor((e-t.lastAccess)/this.O);n>0&&(t.tokens=Math.min(t.tokens+n*this.A,this.R),t.lastAccess=t.lastAccess+n*this.O)}consumeRateLimit(t){var e;const n=Date.now(),r=String(t);let s=this.C[r];return s?this.F(s,n):(s={tokens:this.R,lastAccess:n},this.C[r]=s),s.tokens===0||(s.tokens--,s.tokens===0&&((e=this.I)===null||e===void 0||e.call(this,t)),s.tokens===0)}stop(){this.C={}}};const fu="Mobile",df="Android",M0="Tablet",s3="Android Tablet",i3="iPad",o3="Apple Watch",e0="Safari",Am="BlackBerry",a3="Samsung Internet",t0="Chrome",l3="Chrome iOS",c3="Internet Explorer",u3="Internet Explorer Mobile",d3="Opera",f3="Microsoft Edge",n0="Firefox",h3="Firefox iOS",O0="Nintendo",L0="PlayStation",Rm="Xbox",p3="Android Mobile",m3="Mobile Safari",Uv="Windows",g3="Windows Phone",z6="Nokia",By="Ouya",iN="Generic "+fu.toLowerCase(),v3="Generic "+M0.toLowerCase(),Uy="Konqueror",y3="Oculus Browser",_3="Vivaldi",w3="Yandex",x3="Whale",b3="DuckDuckGo",S3="Pale Moon",E3="Waterfox",Wy="Brave",k3="Claude",C3="Codex",P3="ChatGPT",T3="Google Search App",Wv=new RegExp("Version/(\\d+(\\.\\d+)?)"),Zv=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),oN=new RegExp(Rm,"i"),aN=new RegExp("PlayStation \\w+","i"),lN=new RegExp("Nintendo \\w+","i"),Q2=new RegExp("BlackBerry|PlayBook|BB10","i"),cN={"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"},I3=function(t,e,n,r){return e=e||"",(function(i){return i!=null&&i.brave?Wy:null})(n)||(r!=null&&r.detectGoogleSearchApp&&ze(t,"GSA/")?T3:ze(t," OPR/")&&ze(t,"Mini")?"Opera Mini":ze(t," OPR/")?d3:Q2.test(t)?Am:ze(t,"IEMobile")||ze(t,"WPDesktop")?u3:ze(t,"OculusBrowser")?y3:ze(t,"SamsungBrowser")?a3:ze(t,"Edge")||ze(t,"Edg/")?f3:ze(t,"Vivaldi/")?_3:ze(t,"YaBrowser/")?w3:ze(t,"Whale/")?x3:ze(t,"DuckDuckGo/")||ze(t,"Ddg/")?b3:ze(t,"Claude/")?k3:ze(t,"Codex/")?C3:ze(t,"ChatGPT/")?P3:ze(t,"FBIOS")?"Facebook Mobile":ze(t,"UCWEB")||ze(t,"UCBrowser")?"UC Browser":ze(t,"CriOS")?l3:ze(t,"CrMo")||ze(t,t0)?t0:ze(t,df)&&ze(t,e0)?p3:ze(t,"FxiOS")?h3:ze(t.toLowerCase(),Uy.toLowerCase())?Uy:ze(t,"Brave/")?Wy:((i,o)=>o&&ze(o,"Apple")||(function(l){return ze(l,e0)&&!ze(l,t0)&&!ze(l,df)})(i))(t,e)?ze(t,fu)?m3:e0:ze(t,"PaleMoon/")?S3:ze(t,"Waterfox/")?E3:ze(t,n0)?n0:ze(t,"MSIE")||ze(t,"Trident/")?c3:ze(t,"Gecko")?n0:"")},uN={[u3]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[f3]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[t0]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[l3]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[e0]:[Wv],[m3]:[Wv],[d3]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[n0]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[h3]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[Uy]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[Am]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),Wv],[p3]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[a3]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[y3]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[_3]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[w3]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[x3]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[Wy]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[k3]:[Zv],[C3]:[Zv],[P3]:[Zv],[b3]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[S3]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[E3]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[T3]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[c3]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},dN=function(t,e,n,r){const s=I3(t,e,n,r),i=uN[s];if(le(i))return null;for(let o=0;i.length>o;o++){const l=t.match(i[o]);if(l)return parseFloat(l[l.length-2])}return null},B6=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),t=>[Rm,t&&t[1]||""]],[new RegExp(O0,"i"),[O0,""]],[new RegExp(L0,"i"),[L0,""]],[Q2,[Am,""]],[new RegExp(Uv,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[g3,""];if(new RegExp(fu).test(e)&&!/IEMobile\b/.test(e))return["Windows Mobile",""];const n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){let r=cN[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[Uv,r]}return[Uv,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?["iOS",[t[3],t[4],t[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{let e="";return t&&t.length>=3&&(e=le(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),t=>t&&t[2]?[df,[t[2],t[3],t[4]||"0"].join(".")]:[df,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{const e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],A3=function(t){for(let e=0;B6.length>e;e++){const[n,r]=B6[e],s=n.exec(t),i=s&&(Nn(r)?r(s,t):r);if(i)return i}return["",""]},R3=function(t){return lN.test(t)?O0:aN.test(t)?L0:oN.test(t)?Rm:new RegExp(By,"i").test(t)?By:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?g3:/iPad/.test(t)?i3:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?o3:Q2.test(t)?Am:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(z6,"i").test(t)?z6:/(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(fu).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)?df:s3:new RegExp("(pda|Mobile)","i").test(t)?iN:new RegExp(M0,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?v3:""},fN=function(t,e){var n;const r=R3(t);return r===i3||r===s3||r==="Kobo"||r==="Kindle Fire"||r===v3?M0:r===O0||r===Rm||r===L0||r===By?"Console":r===o3?"Wearable":r?fu:(e==null?void 0:e.userAgentDataPlatform)==="Android"&&((n=e==null?void 0:e.maxTouchPoints)!==null&&n!==void 0?n:0)>0?600>Math.min((s=e==null?void 0:e.screenWidth)!==null&&s!==void 0?s:0,(i=e==null?void 0:e.screenHeight)!==null&&i!==void 0?i:0)/((o=e==null?void 0:e.devicePixelRatio)!==null&&o!==void 0?o:1)?fu:M0:"Desktop";var s,i,o},qv=/\bFBAV\/(\d+(?:\.\d+)*)/i,U6=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",qv],[/\bFBAN\/EMA\b/i,"Facebook Lite",qv],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",qv],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],Zy="[Truncated]",Gf="[Unserializable]";function zc(t){let e="";for(let n=0;t.length>n;n++){const r=t.charCodeAt(n);if(55296>r||r>56319)e+=56320>r||r>57343?t[n]:"�";else{const s=t.charCodeAt(n+1);56320>s||s>57343?e+="�":(e+=t[n]+t[n+1],n++)}}return e}function M3(t,e){if(!e)return t;let n=[];try{n=Object.keys(e)}catch{n=[]}for(const r of n){let s;try{s=e[r]}catch{s=Gf}Object.defineProperty(t,r,{value:s,enumerable:!0,writable:!0,configurable:!0})}return t}const r0=3e5;var O3=class{record(t){if(t.kind==="too-large")return;if(t.kind!=="retry-later")return void this.reset();if(!t.retryAfterMs)return;const e=this.isOpen(),n=Date.now(),r=Math.min(t.retryAfterMs,r0);if(!e)return this.ts=n,void(this.es=n+r);this.es=Math.max(this.es,Math.min(n+r,this.ts+r0))}remainingMs(){const t=Date.now();if(this.ts-5e3>t)return this.reset(),0;const e=Math.min(r0,Math.max(0,this.es-t));return e===0&&this.reset(),e}isOpen(){return this.remainingMs()>0}reset(){this.es=0,this.ts=0}constructor(){this.es=0,this.ts=0}};const hN=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function W6(t,e){return typeof(n=t)=="string"&&hN.test(n)?t:e();var n}function L3(t,e){const n=new Error(e);try{Object.defineProperty(n,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch{}return n}function ma(t){return t&&t.split("#")[0]}function Z6(t){try{return t()}catch{return}}function D3(t,e){const n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}function q6(t,e,n){return N3.apply(this,arguments)}function N3(){return(N3=Mt(function*(t,e,n){let r;try{return yield Promise.race([t,new Promise((s,i)=>{r=D3(()=>{try{n==null||n(),s()}catch(o){i(o)}},e)})])}finally{clearTimeout(r)}})).apply(this,arguments)}let _p,G6,Gv;function pN(t){const e=globalThis._posthogChunkIds;if(!e)return;const n=Object.keys(e);return Gv&&n.length===G6||(G6=n.length,Gv=n.reduce((r,s)=>{_p||(_p={});const i=_p[s];if(i)r[i[0]]=i[1];else{const o=t(s);for(let l=o.length-1;l>=0;l--){const u=o[l],d=u==null?void 0:u.filename,h=e[s];if(d&&h){r[d]=h,_p[s]=[d,h];break}}}return r},{})),Gv}function zd(t){return zd=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},zd(t)}function mN(t,e,n){return(e=(function(r){var s=(function(i){if(zd(i)!="object"||!i)return i;var o=i[Symbol.toPrimitive];if(o!==void 0){var l=o.call(i,"string");if(zd(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)})(r);return zd(s)=="symbol"?s:s+""})(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function K6(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 z(t){for(var e=1;arguments.length>e;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?K6(Object(n),!0).forEach(function(r){mN(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):K6(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var gN=class{constructor(t,e,n=[]){this.coercers=t,this.stackParser=e,this.modifiers=n}buildFromUnknown(t,e={}){const n=e&&e.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(n,e,0).apply(t),s=this.buildParsingContext(e),i=this.parseStacktrace(r,s);return{$exception_list:this.convertToExceptionList(i,n),$exception_level:"error"}}modifyFrames(t){var e=this;return Mt(function*(){for(const n of t)n.stacktrace&&n.stacktrace.frames&&He(n.stacktrace.frames)&&(n.stacktrace.frames=yield e.applyModifiers(n.stacktrace.frames));return t})()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:(e=t.syntheticException)===null||e===void 0?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var n;let r,s;if(t.cause!=null&&(r=this.parseStacktrace(t.cause,e)),t.stack!=""&&t.stack!=null)try{s=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)}catch{}return z(z({},t),{},{cause:r,stack:s,errors:(n=t.errors)===null||n===void 0?void 0:n.map(i=>this.parseStacktrace(i,e))})}applyChunkIds(t,e){return t.map(n=>(n.filename&&e&&(n.chunk_id=e[n.filename]),n))}applyCoercers(t,e){for(const n of this.coercers)if(n.match(t))return n.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var e=this;return Mt(function*(){let n=t;for(const r of e.modifiers)n=yield r(n);return n})()}convertToExceptionList(t,e){const n=[],r=(s,i,o)=>{var l;const u=n.length,d=i===void 0?z(z({type:typeof e.type=="string"&&e.type.length>0?e.type:"generic"},typeof e.handled=="boolean"?{handled:e.handled}:e.handled===void 0?{handled:!0}:{}),{},{synthetic:typeof e.synthetic=="boolean"?e.synthetic:s.synthetic,exception_id:u}):{type:"chained",source:o,synthetic:s.synthetic,exception_id:u,parent_id:i},h={type:s.type,value:s.value,mechanism:d};s.stack&&(h.stacktrace={type:"raw",frames:s.stack}),n.push(h),s.cause&&r(s.cause,u,"cause");for(const p of(l=s.errors)!==null&&l!==void 0?l:[])r(p,u,"member")};return r(t),n}buildParsingContext(t){var e;return{chunkIdMap:pN(this.stackParser),skipFirstLines:(e=t.skipFirstLines)!==null&&e!==void 0?e:1}}getAggregateErrors(t){try{if(Pu(t)){let n=Object.getPrototypeOf(t);for(let r=0;n&&100>r;r++){var e;const s=(e=Object.getOwnPropertyDescriptor(n,"constructor"))===null||e===void 0?void 0:e.value;if(typeof s=="function"&&s.name==="AggregateError"){const i=t.errors;return He(i)?i:void 0}n=Object.getPrototypeOf(n)}}}catch{}}buildCoercingContext(t,e,n=0){let r=0,s=0,i=!1;const o=new Set,l=[],u={},d=(m,v,w=0)=>{const _=h(v,w),x=_.apply;if(_.apply=M=>{l.push(m);try{return x(M)}finally{l.pop()}},w>4||w>0&&l.indexOf(m)!==-1)return this.coerceFallback(_);const b=typeof m=="object"&&m!==null||typeof m=="function";if(w===0&&r>=50||b&&o.has(m))return;b&&o.add(m),w===0&&r++;const k=this.getAggregateErrors(m);let C,T;i||(i=!!k);try{if(C=this.applyCoercers(m,_),!C)throw u}catch(M){if(M===u)return void(w===0&&r--);if(!i)throw M;C=this.coerceFallback(_)}if(!k||r>=50)return C;try{T=k.length}catch{return C}if(!Number.isInteger(T)||0>T||T>4294967295)return C;const I=[];for(let M=0;50>r&&1e3>s&&T>M;M++){let R;s++;try{R=_.next(k[M])}catch{r++,R=this.coerceFallback(h(v+1))}R&&I.push(R)}return z(z({},C),{},{errors:I})},h=(m,v=0)=>z(z({},e),{},{syntheticException:m==0?e.syntheticException:void 0,mechanism:m==0?t:{},apply(w){const _=d(w,m,v+1);if(!_)throw u;return _},next:w=>d(w,m+1)}),p=h(n);return z(z({},p),{},{apply:m=>{var v;return(v=d(m,n))!==null&&v!==void 0?v:this.coerceFallback(p)}})}};const vN=/^([a-z][a-z0-9.+-]+):/i,yN=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function _N(t){if(!t||t==="<anonymous>")return!1;const e=vN.exec(t);return!e||yN.includes(e[1].toLowerCase())}function qy(t,e,n,r,s){const i={platform:t,filename:e,function:n==="<anonymous>"?"?":n,in_app:_N(e)};return le(r)||(i.lineno=r),le(s)||(i.colno=s),i}const $3=(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]:"?",n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},wN=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,xN=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,bN=/\((\S*)(?::(\d+))(?::(\d+))\)/,SN=(t,e)=>{const n=wN.exec(t);if(n){const[,s,i,o]=n;return qy(e,s,"?",+i,+o)}const r=xN.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){const o=bN.exec(r[2]);o&&(r[2]=o[1],r[3]=o[2],r[4]=o[3])}const[s,i]=$3(r[1]||"?",r[2]);return qy(e,i,s,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},EN=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,kN=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,CN=(t,e)=>{const n=EN.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const i=kN.exec(n[3]);i&&(n[1]=n[1]||"eval",n[3]=i[1],n[4]=i[2],n[5]="")}let r=n[3],s=n[1]||"?";return[s,r]=$3(s,r),qy(e,r,s,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Y6=/\(error: (.*)\)/;function J2(t,e){return t.filename===e.filename&&t.function===e.function&&t.module===e.module&&t.lineno===e.lineno&&t.colno===e.colno}function PN(t){for(let e=1;10>=e;e++){const n=t.length-2*e;if(0>n)break;let r=!0;for(let s=0;e>s;s++)if(!J2(t[n+s],t[n+e+s])){r=!1;break}if(r){for(let s=0;e>s;s++)t[n+s]=t[n+e+s];return t.length=n+e,{start:n,length:e}}}}function TN(t,e){const n=e.start+e.length,r=F3(t,e);r&&t.splice(n+r===t.length?n:e.start,r)}function j3(t,e){let n=e.start;for(;n>0&&J2(t[n-1],t[n-1+e.length]);)n--;return e.start-n}function F3(t,e){const n=e.start+e.length;let r=n;for(;t.length>r&&J2(t[r],t[r-e.length]);)r++;return r-n}function IN(t,e){const n=e[0];let r=t.length-(n?j3(t,n):0);for(const s of e)r-=F3(t,s);return r}function AN(t,e,n){for(let r=0;t.length>r;r++){const s=t[(e+r)%t.length],i=t[(n+r)%t.length];if(s!==i)return i>s}return!1}var RN=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){const n=tt(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:n?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){const e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?`${e}: ${t.message}`:e}isDOMException(t){return R0(t,"DOMException")}isDOMError(t){return R0(t,"DOMError")}},MN=class{match(t){return Pu(t)}coerce(t,e){var n;const r=this.getStack(t),s=r===void 0?(n=e.syntheticException)===null||n===void 0?void 0:n.stack:void 0,i=!!s;return{type:this.getType(t),value:this.getMessage(t,e),stack:r??s,cause:t.cause?e.next(t.cause):void 0,synthetic:i}}getType(t){return t.name||t.constructor.name}getMessage(t,e){const n=t.message;return String(n.error&&typeof n.error.message=="string"?n.error.message:n)}getStack(t){try{const e=t.stacktrace;if(typeof e=="string"&&e.length>0)return e;const n=t.stack;return typeof n=="string"&&n.length>0?n:void 0}catch{return}}},ON=class{match(t){return!!R0(t,"ErrorEvent")&&(t.error!=null||this.ur(t))}coerce(t,e){var n;if(t.error!=null)return e.apply(t.error);const r=e.apply(t.message);return z(z({},r),{},{stack:(n=this.cr(t))!==null&&n!==void 0?n:r.stack,synthetic:!0})}ur(t){return tt(t.message)&&t.message.length>0}cr(t){var e,n;const r=t,s=(e=r.lineno)!==null&&e!==void 0?e:0,i=(n=r.colno)!==null&&n!==void 0?n:0;if(tt(r.filename)&&r.filename.length!==0&&s!==0)return`Error
18
+ at ${r.filename}:${s}:${i}`}};const LN=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var DN=class{match(t){return typeof t=="string"}coerce(t,e){var n;const[r,s]=this.getInfos(t);return{type:r??"Error",value:s??t,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}getInfos(t){let e="Error",n=t;const r=t.match(LN);return r&&(e=r[1],n=r[2]),[e,n]}};const NN=["fatal","error","warning","log","info","debug"];function V3(t,e=40){const n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(let r=n.length;r>0;r--){const s=n.slice(0,r).join(", ");if(e>=s.length)return r===n.length?s:s.length>e?`${s.slice(0,e)}...`:s}return""}var $N=class{match(t){return typeof t=="object"&&t!==null}coerce(t,e){var n,r;const s=this.getErrorPropertyFromObject(t);return s?e.apply(s):{type:this.getType(t),value:this.getValue(t),stack:(n=this.getStack(t))!==null&&n!==void 0?n:(r=e.syntheticException)===null||r===void 0?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(X2(t))return t.constructor.name;const e="name"in t?t.name:void 0;return tt(e)&&!Hd(e)?e:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){let n=`'${t.name}' captured as exception`;return"message"in t&&typeof t.message=="string"&&(n+=` with message: '${t.message}'`),n}if("message"in t&&typeof t.message=="string")return t.message;const e=this.getObjectClassName(t);return`${e&&e!=="Object"?`'${e}'`:"Object"} captured as exception with keys: ${V3(t)}`}isSeverityLevel(t){return tt(t)&&!Hd(t)&&NN.indexOf(t)>=0}getStack(t){try{return tt(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:tt(t.stack)&&t.stack.length>0?t.stack:void 0}catch{return}}getErrorPropertyFromObject(t){for(const e in t)if({}.hasOwnProperty.call(t,e)){const n=t[e];if(Pu(n))return n}}getObjectClassName(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{return}}},jN=class{match(t){return X2(t)}coerce(t,e){var n;const r=t.constructor.name;return{type:r,value:`${r} captured as exception with keys: ${V3(t)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}},FN=class{match(t){return n3(t)}coerce(t,e){var n;return{type:"Error",value:`Primitive value captured as exception: ${String(t)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}},VN=class{match(t){return R0(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!X2(t))return!1;try{const e=t.detail;return e!=null&&typeof e=="object"&&"reason"in e}catch{return!1}}coerce(t,e){var n;const r=this.getUnhandledRejectionReason(t);return n3(r)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(r)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}:e.apply(r)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&t.detail!=null&&typeof t.detail=="object"&&"reason"in t.detail)return t.detail.reason}catch{}return t}};const D0="$message",N0="$timestamp",HN=new Set([D0,N0]),Kv={enabled:!0,max_bytes:32768};function $0(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:Kv.enabled,max_bytes:BN(t.max_bytes,Kv.max_bytes)}:z({},Kv)}var zN=class{constructor(t){this.ns=[],this.ss=0,this.Ir=$0(t)}setConfig(t){this.Ir=$0(t),this.rs()}add(t){const e=(function(r){let s;try{s=e3(r)}catch{return}try{const i=JSON.parse(s);if(!st(i))return;const o=i,l=o[D0],u=o[N0];return!tt(l)||l.trim().length===0||!tt(u)&&!Xt(u)?void 0:{step:o,json:s}}catch{return}})(t);if(!e)return;const n=(function(r){if("u">typeof TextEncoder)return new TextEncoder().encode(r).length;const s=encodeURIComponent(r);let i=0;for(let o=0;s.length>o;o++)s[o]==="%"?(i+=1,o+=2):i+=1;return i})(e.json);n>this.Ir.max_bytes||(this.ns.push({step:e.step,bytes:n}),this.ss+=n,this.rs())}getAttachable(){return this.ns.map(t=>t.step)}clear(){this.ns=[],this.ss=0}size(){return this.ns.length}rs(){for(;this.ss>this.Ir.max_bytes&&this.ns.length>0;){const t=this.ns.shift();t&&(this.ss-=t.bytes)}}};function BN(t,e){if(!Xt(t)||t===1/0||t===-1/0)return e;const n=Math.floor(t);return 0>n?e:n}const X6=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function Q6(t){return typeof t=="string"||t}function J6(t){return typeof t=="string"?t:void 0}const UN=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],H3="NativeGzipValidationError",Gy=t=>t.length>=2&&t[0]===31&&t[1]===139,eS=(t,e)=>t===Hy.GZipJS||e===Hy.GZipJS||e==="gzip",tS=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError";let wd;const wp=t=>{throw L3(H3,`Native gzip produced invalid output: ${t}`)},WN=(nS=Mt(function*(t,e){18>t.size&&wp("too-short");const n=new Uint8Array(yield t.slice(0,10).arrayBuffer());Gy(n)&&n[2]===8||wp("invalid-header");const r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(i=>{const o=(()=>{if(wd)return wd;wd=[];for(let u=0;256>u;u++){let d=u;for(let h=0;8>h;h++)d=1&d?3988292384^d>>>1:d>>>1;wd[u]=d>>>0}return wd})();let l=4294967295;for(let u=0;i.length>u;u++)l=o[255&(l^i[u])]^l>>>8;return(4294967295^l)>>>0})(e)&&wp("invalid-crc");const s=e.length>>>0;r.getUint32(4,!0)!==s&&wp("invalid-size")}),function(t,e){return nS.apply(this,arguments)});var nS;function Ky(){return Ky=Mt(function*(t,e=!0,n){try{const s=new TextEncoder().encode(t),i=new globalThis.CompressionStream("gzip"),o=i.writable.getWriter(),l=o.write(s).then(()=>o.close()).catch((r=Mt(function*(h){try{yield o.abort(h)}catch{}throw h}),function(h){return r.apply(this,arguments)})),u=new Response(i.readable).blob(),[d]=yield Promise.all([u,l]);return yield WN(d,s),d}catch(s){if(n!=null&&n.rethrow)throw s;return e&&console.error("Failed to gzip compress data",s),null}var r}),Ky.apply(this,arguments)}function z3(t,e){if(t==null)return{};var n,r,s=(function(o,l){if(o==null)return{};var u={};for(var d in o)if({}.hasOwnProperty.call(o,d)){if(l.includes(d))continue;u[d]=o[d]}return u})(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;i.length>r;r++)e.includes(n=i[r])||{}.propertyIsEnumerable.call(t,n)&&(s[n]=t[n])}return s}const ZN={}.propertyIsEnumerable;function j0(t,e){try{return B3(t,e,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch{return[]}}function ew(t,e,n,r){if(0>=n.remainingNodes)return{stringValue:Zy};if(n.remainingNodes--,xr(t))return{boolValue:t};if(typeof t=="bigint")return(function(s,i){const o=s.toString(),l=BigInt("9223372036854775808");return s>=l||-l>s?(i==null||i.debug(`Attribute ${o} is outside the int64 range; encoding it as a string`),{stringValue:o}):{intValue:o}})(t,e);if(typeof t=="number"){if(!Number.isFinite(t))return{stringValue:String(t)};if(Number.isInteger(t)){if(Number.isSafeInteger(t))return{intValue:String(t)};if(typeof BigInt>"u")return{stringValue:String(t)};const s=BigInt(t).toString();return t>=9223372036854776e3||-9223372036854776e3>t?(e==null||e.debug(`Attribute ${s} is outside the int64 range; encoding it as a string`),{stringValue:s}):{intValue:s}}return{doubleValue:t}}if(typeof t=="string")return{stringValue:zc(t)};if(typeof t=="function")return{stringValue:"[Function]"};if(typeof t=="symbol")return{stringValue:String(t)};if(typeof t=="object"&&t!==null){if(n.ancestors.has(t))return{stringValue:"[Circular]"};if(r>=20)return{stringValue:Zy};if(t instanceof Date){const s=t.getTime(),i=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:typeof i=="string"?zc(i):String(i)}}n.ancestors.add(t);try{try{const s=t.toJSON;if(typeof s=="function")return ew(s.call(t),e,n,r+1)}catch{}return He(t)?{arrayValue:{values:qN(t,e,n,r+1)}}:{kvlistValue:{values:B3(t,e,n,r+1)}}}finally{n.ancestors.delete(t)}}return{stringValue:zc(String(t))}}function qN(t,e,n,r){const s=[],i=Math.min(t.length,1e3);let o=0;for(;i>o&&n.remainingNodes>0;o++)try{const l=o in t?t[o]:void 0;if(Xe(l))continue;s.push(ew(l,e,n,r))}catch{s.push({stringValue:Gf})}return t.length>o&&s.push({stringValue:Zy}),s}function B3(t,e,n,r){const s=[];for(const i in t)if(ZN.call(t,i)){if(!i){e==null||e.debug("Dropping an attribute with an empty key");continue}if(s.length>=1e3||0>=n.remainingNodes){e==null||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{const o=t[i];if(Kt(o)||le(o))continue;s.push({key:zc(i),value:ew(o,e,n,r)})}catch{s.push({key:zc(i),value:{stringValue:Gf}})}}return s}function U3(t,e,n){return z(z(z(z({},M3({},t.resourceAttributes)),{},{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment}),t.serviceVersion&&{"service.version":t.serviceVersion}),{},{"telemetry.sdk.name":e,"telemetry.sdk.version":n})}const GN=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function W3(t,e){const n=M3({},t),r={};for(const s of GN)({}).hasOwnProperty.call(n,s)&&(r[s]=n[s],delete n[s]);return[...j0(n,e),...j0(r,e)]}const rS={darwin:"macOS",win32:"Windows",cygwin:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",netbsd:"NetBSD",sunos:"SunOS",aix:"AIX",haiku:"Haiku","Mac OS X":"macOS"},Z3={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}},KN=Z3.info;function YN(t){try{return zc(String(t))}catch{return Gf}}function XN(t,e,n,r){const s=t.level||"info",{text:i,number:o}=Z3[s]||KN,l=(function(m=Date.now()){return String(m)+"000000"})(Xt(r)?r:void 0),u={};e.distinctId&&(u.posthogDistinctId=e.distinctId),e.sessionId&&(u.sessionId=e.sessionId),e.windowId&&(u["window.id"]=e.windowId),Xe(e.sessionStartTimestamp)||(u.sessionStartTimestamp=String(e.sessionStartTimestamp)),Xe(e.lastActivityTimestamp)||(u.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(u["url.full"]=e.currentUrl),e.screenName&&(u["screen.name"]=e.screenName),e.appState&&(u["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(u.feature_flags=e.activeFeatureFlags);const d=z({},u),h=t.attributes;if(h){let m=[];try{m=Object.keys(h)}catch{m=[]}for(const v of m){let w;try{w=h[v]}catch{w=Gf}Object.defineProperty(d,v,{value:w,enumerable:!0,writable:!0,configurable:!0})}}const p={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:o,severityText:i,body:{stringValue:YN(t.body)},attributes:j0(d,n)};return t.trace_id&&(p.traceId=t.trace_id),t.span_id&&(p.spanId=t.span_id),le(t.trace_flags)||(p.flags=t.trace_flags),p}function q3(t,e,n){return U3(t,e,n)}function G3(t,e,n,r){return{resourceLogs:[{resource:{attributes:W3(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}var K3=class{constructor(t){this.ls=t,this.us=0}get pending(){return!!this.hs}arm(t){this.clear(),this.us=Date.now()+t,this.hs=D3(()=>{this.hs=void 0,this.ls()},t)}armNoEarlierThan(t){this.hs&&Date.now()+t<=this.us||this.arm(t)}clear(){this.hs&&(clearTimeout(this.hs),this.hs=void 0)}};function Y3(){return .75+.5*Math.random()}function X3(t,e,n,r){const s=Math.min(Math.max(0,e-1),6),i=t*Math.pow(2,s);return Math.round(Math.min(i,Math.max(r,t))*n)}var QN=class{constructor(t,e,n,r,s,i=()=>Promise.resolve(),o){var l;this._instance=t,this.Ir=e,this.$=n,this.cs=r,this.ds=s,this.vs=i,this.fs=o,this.ps=new K3(()=>this.gs()),this.ys=null,this.bs=0,this._s=0,this.ws=new O3,this.ks=0,this.Ss=1,this.xs=0,this.Cs=0,this.$s=!1,this.Is=e.maxBufferSize,this.Ts=Math.max((l=e.maxQueueSize)!==null&&l!==void 0?l:e.maxBufferSize,e.maxBufferSize),this.Ms=e.flushIntervalMs,this.Es=e.maxBatchRecordsPerPost,this.Ps=e.rateCapWindowMs,this.Rs=e.maxLogsPerInterval}clearQueue(){this._s++,this._instance.setPersistedProperty(vi.LogsQueue,[])}reset(){this.ps.clear(),this.xs=0,this.Cs=0,this.$s=!1,this.ks=0,this.Ss=1,this.ws.reset(),this.Es=this.Ir.maxBatchRecordsPerPost}onReconnect(){this.ks=0,this.Ss=1,this.ws.isOpen()?this.As()&&this.Fs():this.gs()}captureLog(t,e){var n;if(this._instance.isDisabled||this._instance.optedOut||!(t!=null&&t.body))return;const r=this.Os(t);if(r===null)return;if(!r.body)return void this.$.info("Log was rejected in beforeSend function");if(!this.Ds())return;const s={record:XN(r,(n=e==null?void 0:e.context)!==null&&n!==void 0?n:this.cs(),this.$,e==null?void 0:e.occurredAtMs)};this.ds(()=>this.Ls(s))}Os(t){const e=this.Ir.beforeSend;if(!e)return t;const n=He(e)?e:[e];let r=t;for(const s of n)try{const i=s(r);if(!i)return this.$.info("Log was rejected in beforeSend function"),null;r=i}catch(i){return this.$.error("Error in beforeSend function for log:",i),null}return r}Ds(){if(this.Rs===void 0)return!0;const t=Date.now(),e=t-this.xs;return this.Ps>e&&e>=0||(this.xs=t,this.Cs=0,this.$s=!1),this.Rs>this.Cs?(this.Cs++,!0):(this.$s||(this.$.warn(`captureLog dropping logs: exceeded ${this.Rs} logs per ${this.Ps}ms`),this.$s=!0),!1)}flush(){var t=this;return Mt(function*(){if(!t._instance.isDisabled)return t.ys||(t.ys=t.Ns().finally(()=>{t.ys=null})),t.ys})()}Ns(){var t=this;return Mt(function*(){var e;t.ps.clear();let n=(e=t._instance.getPersistedProperty(vi.LogsQueue))!==null&&e!==void 0?e:[];if(n.length===0)return;const r=n.length;let s=0;for(;n.length>0&&r>s;){var i,o;const l=t._s;t.bs=0;const u=Math.min(n.length,t.Es),d=n.slice(0,u),h=G3(d.map(m=>m.record),t.qs(),(i=t.fs)!==null&&i!==void 0?i:t._instance.getLibraryId(),t._instance.getLibraryVersion()),p=yield t._instance.js(h);if(t._s!==l)return;if(p.kind==="too-large"&&d.length>1)t.Es=Math.max(1,Math.floor(d.length/2)),t.$.warn(`Logs batch of size ${d.length} was too large for the ingestion endpoint, reducing batch size to ${t.Es}`);else if(t.ws.record(p),t.ps.pending&&t.ps.arm(Math.max(t.Ms,t.ws.remainingMs())),p.kind==="retry-later"||(p.kind==="too-large"?t.$.warn("Dropping a single log record with batch size 1 — the record is larger than the server cap and cannot be split further."):p.kind==="ok"&&t.Ir.maxBatchRecordsPerPost>t.Es&&(t.Es=Math.min(t.Ir.maxBatchRecordsPerPost,t.Es+1)),yield t.Bs(d.length),n=(o=t._instance.getPersistedProperty(vi.LogsQueue))!==null&&o!==void 0?o:[],s+=d.length,p.kind==="fatal"))throw p.error}})()}Bs(t){var e=this;return Mt(function*(){var n;const r=Math.max(0,t-e.bs),s=(n=e._instance.getPersistedProperty(vi.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(vi.LogsQueue,s.slice(r)),yield e.vs()})()}qs(){return q3(this.Ir,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ls(t){var e;if(this._instance.optedOut)return;const n=(e=this._instance.getPersistedProperty(vi.LogsQueue))!==null&&e!==void 0?e:[];this.Ts>n.length||(n.shift(),this.bs++,this.$.info("Logs queue is full, dropping oldest record.")),n.push(t),this._instance.setPersistedProperty(vi.LogsQueue,n),this.Is>n.length||this.ws.isOpen()?this.Fs():this.gs()}Fs(){this.ps.pending||this.ps.arm(Math.max(this.Ms,this.ws.remainingMs()))}Hs(){return Math.max(X3(this.Ms,this.ks,this.Ss,3e4),this.ws.remainingMs())}As(){const t=this._instance.getPersistedProperty(vi.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return Mt(function*(){e.ps.clear();const n=e.flush().catch(()=>{});t!==void 0?yield q6(n,t):yield n})()}flushWithTimeout(t){var e=this;return Mt(function*(){const n=e.flush();yield q6(n,t,()=>{n.catch(()=>{})})})()}gs(){this.flush().then(()=>{this.ks=0,this.Ss=1},t=>{this.ks++,this.Ss=Y3(),this.$.error("PostHog logs flush failed:",t)}).finally(()=>{!this._instance.isDisabled&&this.As()&&this.ps.armNoEarlierThan(this.Hs())})}};const Yv=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function sS(t){return String(t)+"000000"}function iS(t,e,n,r){let s="";return r&&(s=Object.keys(r).sort().map(i=>`${JSON.stringify(i)}:${JSON.stringify(r[i])}`).join(",")),`${t}\0${e}\0${n??""}\0${s}`}var JN=class{constructor(t,e,n){this._instance=t,this.Ir=e,this.$=n,this.zs=new Map,this.ps=new K3(()=>this.flush().catch(r=>{this.$.error("Metrics flush failed:",r)})),this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.ws=new O3,this.ks=0,this.Ss=1,this.Gs=0}count(t,e=1,n){this.Zs({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.Zs({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.Zs({name:t,type:"histogram",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}flush(){var t=this;const e=this.ys,n=(function(){var r=Mt(function*(){e&&(yield e.catch(()=>{})),yield t.Qs()});return function(){return r.apply(this,arguments)}})()().finally(()=>{this.ys===n&&(this.ys=null)});return this.ys=n,n}drainWindow(){if(this.zs.size===0)return null;const t=this.zs;return this.zs=new Map,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.Js(t)}reset(){this.Gs++,this.ws.reset(),this.ks=0,this.Ss=1,this.ps.clear(),this.zs=new Map,this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set}Zs(t){if(this._instance.isDisabled||this._instance.optedOut)return;const e=this.Os(t);if(e===null)return;if(!e.name||typeof e.name!="string")return void this.$.warn("Dropping metric with empty name");if(typeof e.value!="number"||!Number.isFinite(e.value))return void this.$.warn(`Dropping metric '${e.name}': value must be a finite number`);if(e.type==="count"&&0>e.value)return void this.$.warn(`Dropping count '${e.name}': counters are monotonic, value must be >= 0`);let n,r;try{n=e.attributes?z({},e.attributes):void 0,r=iS(e.type,e.name,e.unit,n)}catch(o){return void this.$.warn(`Dropping metric '${e.name}': attributes could not be serialized`,o)}let s=this.zs.get(r);if(!s){if(!this.Ks())return;s={name:e.name,type:e.type,unit:e.unit,attributes:n,windowStartMs:Date.now()},this.zs.set(r,s)}const i=this.Ws.get(e.name);i===void 0?this.Ws.set(e.name,e.type):i===e.type||this.Vs.has(e.name)||(this.Vs.add(e.name),this.$.warn(`Metric name '${e.name}' is already used as a ${i}; recording it as a ${e.type} too will blend both series in charts. Use a distinct name.`)),this.Xs(s,e.value),this.Fs()}Ks(){return this.Ir.maxSeriesPerFlush>this.zs.size||(this.Us||(this.Us=!0,this.$.warn(`Metric series cap reached (${this.Ir.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}Xs(t,e){switch(t.type){case"count":var n;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(Yv.length+1).fill(0)});const 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,i){for(let o=0;i.length>o;o++)if(i[o]>=s)return o;return i.length})(e,Yv)]+=1;break}}}Os(t){const e=this.Ir.beforeSend;if(!e)return t;const n=He(e)?e:[e];let r=t;for(const s of n)try{const i=s(r);if(!i)return this.$.info("Metric was rejected in beforeSend function"),null;r=i}catch(i){return this.$.error("Error in beforeSend function for metric:",i),null}return r}Fs(){this.ps.pending||this.ps.arm(this.Hs())}Hs(){return Math.max(X3(this.Ir.flushIntervalMs,this.ks,this.Ss,3e4),this.ws.remainingMs())}Qs(){var t=this;return Mt(function*(){if(t.ps.clear(),t.zs.size===0)return;const e=t.zs;t.zs=new Map,t.Us=!1,t.Ws=new Map,t.Vs=new Set;const n=t.Gs,r=yield t._instance.Ys(t.Js(e));if(n===t.Gs)switch(t.ws.record(r),r.kind==="retry-later"?(t.ks++,t.Ss=Y3()):(t.ks=0,t.Ss=1),t.ps.pending&&t.ps.arm(t.Hs()),r.kind){case"ok":return;case"retry-later":return t.lo(e),void t.ps.armNoEarlierThan(t.Hs());case"too-large":return void t.$.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.$.error("Failed to send metrics batch:",r.error)}})()}Js(t){return e=this.uo(t),n=(function(i,o,l){return U3(i,o,l)})(this.Ir,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:W3(n)},scopeMetrics:[{scope:{name:r,version:s},metrics:e}]}]};var e,n,r,s}uo(t){const e=sS(Date.now()),n=new Map;for(const o of t.values()){var r;const l=iS(o.type,o.name,o.unit,void 0);let u=n.get(l);u||(u=z({name:o.name},o.unit&&{unit:o.unit}),o.type==="count"?u.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:o.type==="gauge"?u.gauge={dataPoints:[]}:u.histogram={aggregationTemporality:1,dataPoints:[]},n.set(l,u));const d=j0((r=o.attributes)!==null&&r!==void 0?r:{},this.$),h=sS(o.windowStartMs);if(o.type==="count"){var s;const p={attributes:d,startTimeUnixNano:h,timeUnixNano:e,asDouble:(s=o.total)!==null&&s!==void 0?s:0};u.sum.dataPoints.push(p)}else if(o.type==="gauge"){var i;const p={attributes:d,timeUnixNano:e,asDouble:(i=o.last)!==null&&i!==void 0?i:0};u.gauge.dataPoints.push(p)}else o.hist&&u.histogram.dataPoints.push({attributes:d,startTimeUnixNano:h,timeUnixNano:e,count:o.hist.count,sum:o.hist.sum,min:o.hist.min,max:o.hist.max,bucketCounts:o.hist.bucketCounts,explicitBounds:Yv})}return Array.from(n.values())}lo(t){for(const[r,s]of t){const i=this.zs.get(r);if(i)switch(i.windowStartMs=Math.min(i.windowStartMs,s.windowStartMs),i.type){case"count":var e,n;i.total=((e=i.total)!==null&&e!==void 0?e:0)+((n=s.total)!==null&&n!==void 0?n:0);break;case"gauge":break;case"histogram":if(s.hist)if(i.hist){i.hist.count+=s.hist.count,i.hist.sum+=s.hist.sum,i.hist.min=Math.min(i.hist.min,s.hist.min),i.hist.max=Math.max(i.hist.max,s.hist.max);for(let o=0;i.hist.bucketCounts.length>o;o++)i.hist.bucketCounts[o]+=s.hist.bucketCounts[o]}else i.hist=s.hist}else this.Ks()&&this.zs.set(r,s)}}};const Q3=(t,{debugEnabled:e}={})=>{const n={N(r,...s){ee&&(fo.DEBUG||ee.POSTHOG_DEBUG||e)&&!le(ee.console)&&ee.console&&("__rrweb_original__"in ee.console[r]?ee.console[r].__rrweb_original__:ee.console[r])(t,...s)},debug(...r){n.N("debug",...r)},info(...r){n.N("log",...r)},warn(...r){n.N("warn",...r)},error(...r){n.N("error",...r)},critical(...r){console.error(t,...r)},uninitializedWarning(r){n.error(`You must initialize PostHog before calling ${r}`)},createLogger:(r,s)=>Q3(`${t} ${r}`,s)};return n},ge=Q3("[PostHog.js]"),qt=ge.createLogger,e7=qt("[ExternalScriptsLoader]"),F0=t=>{const e=ue==null?void 0:ue.querySelectorAll("script");if(e){for(let n=0;e.length>n;n++)if(e[n].src===t||e[n].getAttribute("src")===t)return e[n]}},dl=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return e7.warn(`${e} was requested but loading of external scripts is disabled.`),n("Loading of external scripts is disabled");const r=F0(e);if(r){if(r.__posthog_loading_callback_fired)return n();const i=r.__posthog_loading_error;return i?n(i):(r.addEventListener("load",o=>{r.__posthog_loading_callback_fired=!0,n(void 0,o)}),void r.addEventListener("error",o=>{r.__posthog_loading_error=o,n(o)}))}const s=()=>{if(!ue)return n("document not found");if(F0(e))return dl(t,e,n);let i=ue.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=l=>{i.__posthog_loading_callback_fired=!0,n(void 0,l)},i.onerror=l=>{i.__posthog_loading_error=l,n(l)},t.config.prepare_external_dependency_script&&(i=t.config.prepare_external_dependency_script(i)),!i)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")ue.head.appendChild(i);else{const l=ue.querySelectorAll("body > script");var o;l.length>0?(o=l[0].parentNode)===null||o===void 0||o.insertBefore(i,l[0]):ue.body.appendChild(i)}};ue!=null&&ue.body?s():ue==null||ue.addEventListener("DOMContentLoaded",s)},Xv={},oS=(t,e)=>{let n=`/static/${e}.js?v=${t.version}`;return e==="toolbar"&&(n=`${n}&t=${Math.floor(Date.now()/3e5)*3e5}`),t.requestRouter.endpointFor("assets",n)};Le.__PosthogExtensions__=Le.__PosthogExtensions__||{},Le.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e==="remote-config"){const s=t.requestRouter.endpointFor("assets",`/array/${t.config.token}/config.js`);return void dl(t,s,n)}const r=t.config.strict_script_versioning;if(r){const s=t.requestRouter.endpointFor("assets",`/static/${t.version}/${e}.js`),i=Xv[s];if(r==="fallback"&&i){if(F0(i))return void dl(t,i,n);delete Xv[s]}return void dl(t,s,r==="fallback"?(o,l)=>{if(o)if(typeof o=="string")n(o);else{var u;const d=oS(t,e);Xv[s]=d;const h=F0(s);h==null||(u=h.parentNode)===null||u===void 0||u.removeChild(h),dl(t,d,n)}else n(void 0,l)}:n)}dl(t,oS(t,e),n)},Le.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{const r=t.requestRouter.endpointFor("api",e);dl(t,r,n)},fo.DEBUG=!1,fo.LIB_VERSION="1.433.5",fo.LIB_NAME="web";var Tn=fo;const t7="$people_distinct_id",qs="distinct_id",tw="$device_id",Qv="$device_model",V0="__alias",n7="__cmpns",aS="$fbc",Bc="$fbc_persistence",lS="$fbp",Bd="$fbp_persistence",Yy="__timers",J3="$autocapture_disabled_server_side",Xy="$heatmaps_enabled_server_side",Qy="$exception_capture_enabled_server_side",eP="$error_tracking_suppression_rules",Jy="$error_tracking_capture_extension_exceptions",e_="$web_vitals_enabled_server_side",nw="$dead_clicks_enabled_server_side",rw="$product_tours_enabled_server_side",tP="$logs_capture_enabled_server_side",nP="$web_vitals_allowed_metrics",Ud="$session_recording_remote_config",r7="$session_recording_enabled_server_side",s7="$replay_sample_rate",i7="$replay_override_sampling",o7="$replay_override_linked_flag",a7="$replay_override_url_trigger",l7="$replay_override_event_trigger",Oc="$sesid",rP="$session_is_sampled",c7="$session_past_minimum_duration",u7="$session_recording_url_trigger_activated_session",d7="$session_recording_event_trigger_activated_session",f7="$debug_first_full_snapshot_timestamp",h7="$sess_rec_flush_size",Js="$enabled_feature_flags",ao="$active_feature_flags",t_="$early_access_features",Il="$feature_flag_details",na="$feature_flag_payloads",Al="$feature_flag_request_id",Wd="$minimal_flag_called_events",gi="$override_feature_flags",fl="$override_feature_flag_payloads",ra="$stored_person_properties",sa="$stored_group_properties",sP="$groups",n_="$surveys",H0="$surveys_loaded_at",iP="$surveys_activated",oP="$surveys_activated_session",aP="$surveys_activated_timestamps",r_="ph_product_tours",p7="$product_tours_activated",m7="$product_tours_activated_session",g7="$conversations_widget_session_id",v7="$conversations_ticket_id",y7="$conversations_widget_state",_7="$conversations_user_traits",ia="$flag_call_reported",Dd="$flag_call_reported_session_id",ff="$feature_flag_errors",ua="$feature_flag_evaluated_at",wr="$user_state",s_="$client_session_props",w7="$capture_rate_limit",lP="$initial_campaign_params",cP="$initial_referrer_info",Lc="$initial_person_info",sw="$epp",Jv="$posthog_cookieless",uP="$cookieless_mode",dP="$sdk_debug_extensions_init_method",fP="$sdk_debug_extensions_init_time_ms",hP="$sdk_debug_recording_script_not_loaded",x7="$sdk_debug_replay_event_trigger_status",b7="$sdk_debug_replay_linked_flag_trigger_status",S7="$sdk_debug_replay_matched_recording_trigger_groups",E7="$sdk_debug_replay_pending_trigger_conditions",k7="$sdk_debug_replay_remote_trigger_matching_config",C7="$sdk_debug_replay_trigger_groups_count",P7="$sdk_debug_replay_url_trigger_status",T7="$session_recording_start_reason",iw="PostHog loadExternalDependency extension not found.",lo="anonymous",s0="identified",pP="identified_only",hf="visibilitychange",z0="beforeunload",ow="$pageview",cS="$pageleave",mP="$identify",uS="$groupidentify";function Dc(t,e){He(t)&&t.forEach(e)}function bt(t,e){if(!Xe(t))if(He(t))t.forEach(e);else if((n=>n instanceof FormData)(t))t.forEach((n,r)=>e(n,r));else for(const n in t)Y2.call(t,n)&&e(t[n],n)}const Rt=function(t,...e){for(const n of e)for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t};function i0(t){const e=Object.keys(t);let n=e.length;const r=new Array(n);for(;n--;)r[n]=[e[n],t[e[n]]];return r}const I7=function(t){return function(...e){try{return t.apply(this,e)}catch(n){ge.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ge.critical(n)}}},aw=function(t){const e={};return bt(t,function(n,r){(tt(n)&&n.length>0||Xt(n))&&(e[r]=n)}),e};function gP(t){const e=z({},t);for(const n of["name","message","stack","cause","errors"])try{n in t&&(e[n]=t[n])}catch{}return e}const A7=["herokuapp.com","vercel.app","netlify.app"];function R7(t){const e=t==null?void 0:t.hostname;if(!tt(e))return!1;const n=e.split(".").slice(-2).join(".");for(const r of A7)if(n===r)return!1;return!0}function yt(t,e,n,r){const{capture:s=!1,passive:i=!0}=r??{};t==null||t.addEventListener(e,n,{capture:s,passive:i})}function i_(t){return t.name==="ph_toolbar_internal"}const B0=t=>{if(ue){try{const e=t+"=",n=ue.cookie.split(";").filter(r=>r.length);for(let r=0;n.length>r;r++){let s=n[r];for(;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 Xt(t)&&isFinite(t)&&Math.floor(t)===t});var M7=class o_{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");const i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/256,i[5]=e,i[6]=112|n>>>8,i[7]=n,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=s>>>24,i[13]=s>>>16,i[14]=s>>>8,i[15]=s,new o_(i)}toString(){let e="";for(let n=0;this.bytes.length>n;n++)e=e+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new o_(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(let n=0;16>n;n++){const r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}},O7=class{generate(){const t=this.generateOrAbort();if(!le(t))return t;{this.Ct=0;const e=this.generateOrAbort();if(le(e))throw new Error("Could not generate UUID after timestamp reset");return e}}generateOrAbort(){const t=(()=>{const e=Date.now();return Xt(e)&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0})();if(t>this.Ct)this.Ct=t,this.Mt();else{if(this.Ct>=t+1e4)return;this.It++,this.It>4398046511103&&(this.Ct++,this.Mt())}return M7.fromFieldsV7(this.Ct,Math.trunc(this.It/Math.pow(2,30)),this.It&Math.pow(2,30)-1,this.Tt.nextUint32())}Mt(){this.It=1024*this.Tt.nextUint32()+(1023&this.Tt.nextUint32())}constructor(){this.Ct=0,this.It=0,this.Tt=new L7}};let vP=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};ee&&!le(ee.crypto)&&crypto.getRandomValues&&(vP=t=>crypto.getRandomValues(t));var L7=class{nextUint32(){return this.Rt.length>this.$t||(vP(this.Rt),this.$t=0),this.Rt[this.$t++]}constructor(){this.Rt=new Uint32Array(8),this.$t=1/0}};let dS;const ei=()=>D7().toString(),D7=()=>(dS||(dS=new O7)).generate();let xd="";const N7=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;let yc=null;const zt={Et(){if(!Kt(yc))return yc;if(yc=!1,ue)try{const t=`__ph_cookie_support_${ei()}`;zt.At(t,"xyz"),yc=B0(t)==='"xyz"',zt.Lt(t)}catch{yc=!1}return yc},Pt(t){ge.error("cookieStore error: "+t)},Ot:B0,Dt(t){let e;try{e=JSON.parse(zt.Ot(t))||{}}catch{}return e},At(t,e,n,r,s){if(!ue)return!1;try{let i="",o="";const l=(function(d,h){if(h){let p=(function(m,v=ue){if(xd)return xd;if(!v||["localhost","127.0.0.1"].includes(m))return"";const w=m.split(".");let _=Math.min(w.length,8);const x="dmn_chk_"+ei();for(;!xd&&_--;){const b=w.slice(_).join("."),k=x+"=1;domain=."+b+";path=/";v.cookie=k+";max-age=3",v.cookie.includes(x)&&(v.cookie=k+";max-age=0",xd=b)}return xd})(d);if(!p){const m=(v=>{const w=v.match(N7);return w?w[0]:""})(d);m!==p&&ge.info("Warning: cookie subdomain discovery mismatch",m,p),p=m}return p?"; domain=."+p:""}return""})(ue.location.hostname,r);if(n){const d=new Date;d.setTime(d.getTime()+864e5*n),i="; expires="+d.toUTCString()}s&&(o="; secure");const u=t+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+l+o;return u.length>3686.4&&ge.warn("cookieStore warning: large cookie, len="+u.length),ue.cookie=u,!0}catch{return!1}},Lt(t,e){if(ue!=null&&ue.cookie)try{zt.At(t,"",-1,e)}catch{return}}};let e1=null;const dt={Et(){if(!Kt(e1))return e1;let t=!0;if(le(ee))t=!1;else try{const e="__mplssupport__";dt.At(e,"xyz"),dt.Ot(e)!=='"xyz"'&&(t=!1),dt.Lt(e)}catch{t=!1}return t||ge.error("localStorage unsupported; falling back to cookie store"),e1=t,t},Pt(t){ge.error("localStorage error: "+t)},Ot(t){try{return ee==null?void 0:ee.localStorage.getItem(t)}catch(e){dt.Pt(e)}return null},Dt(t){try{return JSON.parse(dt.Ot(t))||{}}catch{}return null},At(t,e){try{return ee==null||ee.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){dt.Pt(n)}return!1},Lt(t){try{ee==null||ee.localStorage.removeItem(t)}catch(e){dt.Pt(e)}}},t1=[ra,ao,Js,Il,na,Al,ua,ff,ia],hl=[tw,qs,Oc,rP,sw,Lc,Bc,wr],U0=t=>t+"_cpm",$7=["__proto__","constructor","prototype"],n1=t=>{if(!st(t))return{};const e={};return Object.keys(t).forEach(n=>{$7.indexOf(n)===-1&&(e[n]=t[n])}),e},r1=(t,e=[])=>{const n={};return[...hl,...e].forEach(r=>{const s=t[r];le(s)||Kt(s)||s===""||(n[r]=s)}),n},yP=t=>{let e=5381,n=2166136261;for(let r=0;t.length>r;r++){const s=t.charCodeAt(r);e=33*e^s,n=Math.imul(n^s,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(n>>>0).toString(36)},fS=(t,e)=>({p:e,f:yP(JSON.stringify(t))}),hS=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{const n=zt.Dt(U0(t)),r=(n==null?void 0:n.f)===yP(e)&&He(n.p);return{properties:r?n.p:[],isValid:r}}catch{return{properties:[],isValid:!1}}},s1=(t,e)=>e+"|"+(zt.Ot(U0(t))||""),_c={},a_={Et:()=>!0,Pt(t){ge.error("memoryStorage error: "+t)},Ot:t=>t in _c?_c[t]:null,Dt:t=>t in _c?_c[t]:null,At:(t,e)=>(_c[t]=e,!0),Lt(t){delete _c[t]}};let Qa=null;const At={Et(){if(!Kt(Qa))return Qa;if(Qa=!0,le(ee))Qa=!1;else try{const t="__support__";At.At(t,"xyz"),At.Ot(t)!=='"xyz"'&&(Qa=!1),At.Lt(t)}catch{Qa=!1}return Qa},Pt(t){ge.error("sessionStorage error: ",t)},Ot(t){try{return ee==null?void 0:ee.sessionStorage.getItem(t)}catch(e){At.Pt(e)}return null},Dt(t){try{return JSON.parse(At.Ot(t))||null}catch{}return null},At(t,e){try{return ee==null||ee.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){At.Pt(n)}return!1},Lt(t){try{ee==null||ee.sessionStorage.removeItem(t)}catch(e){At.Pt(e)}}};var j7=class{constructor(t){this._instance=t}get Ir(){return this._instance.config}get consent(){return this.Ao()?0:this.Fo}isOptedOut(){return this.Ir.cookieless_mode==="always"||this.isRejected()||this.consent===-1&&this.Ir.cookieless_mode==="on_reject"}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Ir.opt_out_capturing_by_default}optInOut(t){this.Oo.At(this.Do,t?1:0,this.Ir.cookie_expiration,this.Ir.cross_subdomain_cookie,this.Ir.secure_cookie)}reset(){this.Oo.Lt(this.Do,this.Ir.cross_subdomain_cookie)}get Do(){const{token:t,opt_out_capturing_cookie_prefix:e,consent_persistence_name:n}=this._instance.config;return n||(e?e+t:"__ph_opt_in_out_"+t)}get Fo(){const t=this.Oo.Ot(this.Do);return Bv(t)?1:ze(nN,t)?0:-1}get Oo(){const t=this.Ir.opt_out_capturing_persistence_type,e=t==="localStorage"?dt:zt,n=e.Et()?e:a_;if(!this.Lo||this.Lo!==n){this.Lo=n;const r=t==="localStorage"?zt:dt;r.Ot(this.Do)&&(this.Lo.Ot(this.Do)||this.optInOut(Bv(r.Ot(this.Do))),r.Lt(this.Do,this.Ir.cross_subdomain_cookie))}return this.Lo}Ao(){return!!this.Ir.respect_dnt&&[$n==null?void 0:$n.doNotTrack,$n==null?void 0:$n.msDoNotTrack,Le.doNotTrack,$n==null?void 0:$n.globalPrivacyControl].some(t=>Bv(t))}};function _P(t,e){var n;const r=t==null||(n=t.config)===null||n===void 0?void 0:n.get_current_url;if(!Nn(r))return e;try{const s=r(e);return tt(s)&&s?s:e}catch(s){return ge.error("Error in get_current_url, falling back to window.location.href",s),e}}function pS(t){var e;return t instanceof Element&&(t.id==="__POSTHOG_TOOLBAR__"||!!(!((e=t.closest)===null||e===void 0)&&e.call(t,".toolbar-global-fade-container")))}function Ai(t){return!!t&&t.nodeType===1}function nr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function wP(t){return!!t&&t.nodeType===3}function lw(t){return!!t&&t.nodeType===11&&Ai(t.host)}function cw(t){return t?Tm(t).split(/\s+/):[]}function mS(t,e){const n=(function(r){var s;const i=ee==null||(s=ee.location)===null||s===void 0?void 0:s.href;return le(i)?void 0:_P(r,i)})(e);return!!(n&&t&&t.some(r=>n.match(r)))}function hu(t){let e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return cw(e)}function xP(t){return Xe(t)?null:Tm(t).split(/(\s+)/).filter(e=>qd(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function pf(t){let e="";return Uc(t)&&!mf(t)&&t.childNodes&&t.childNodes.length&&bt(t.childNodes,function(n){var r;wP(n)&&n.textContent&&(e+=(r=xP(n.textContent))!==null&&r!==void 0?r:"")}),Tm(e)}function Zd(t){var e;return le(t.target)?t.srcElement||null:!((e=t.target)===null||e===void 0)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}const uw=["a","button","form","input","select","textarea","label"];function l_(t,e){const n=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!n&&n.call(t,e)}catch{return!1}}function c_(t,e){if(le(e))return!0;for(const n of t)if(e.some(r=>l_(n,r)))return!0;return!1}function bP(t){const e=t.parentNode;return!(!e||!Ai(e))&&e}const i1=[".ph-no-autocapture","[data-ph-no-autocapture]"],SP=["next","previous","prev",">","<"],F7=[...SP,"+","-","−","–"],gS=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,vS=[".ph-no-rageclick",".ph-no-capture"],V7=["","text","search","email","password","url","tel","number"];function EP(t,e){if(!ee||dw(t))return!1;let n,r,s;var i,o;if(xr(e)?(n=!!e&&vS,r=void 0,s=!1):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:vS,r=e==null?void 0:e.content_ignorelist,s=(o=e==null?void 0:e.ignore_text_selection)!==null&&o!==void 0&&o),n===!1||s&&(function(u){return!(!u||!Ai(u))&&(!!nr(u,"textarea")||(nr(u,"input")?ze(V7,(u.getAttribute("type")||"").toLowerCase()):(function(d){var h;if(d.isContentEditable)return!0;const p=(h=d.getAttribute)===null||h===void 0?void 0:h.call(d,"contenteditable");return p==="true"||p===""})(u)))})(t))return!1;const{targetElementList:l}=kP(t,!1);return!(function(u,d){if(u===!1||le(u))return!1;let h;if(u===!0)h=SP;else{if(!He(u))return!1;if(u.length>10)return ge.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;h=u.map(p=>p.toLowerCase())}return d.some(({safeText:p,ariaLabel:m})=>h.some(v=>gS(p,v)||gS(m,v)))})(r,l.map(u=>{var d;return{safeText:pf(u).toLowerCase(),ariaLabel:((d=u.getAttribute("aria-label"))===null||d===void 0?void 0:d.toLowerCase().trim())||""}}))&&!c_(l,n)}const dw=t=>!t||nr(t,"html")||!Ai(t),kP=(t,e)=>{if(!ee||dw(t))return{parentIsUsefulElement:!1,targetElementList:[]};let n=!1;const r=[t];let s=t;for(;s.parentNode&&!nr(s,"body");){if(lw(s.parentNode)){r.push(s.parentNode.host),s=s.parentNode.host;continue}const i=bP(s);if(!i)break;if(e||uw.indexOf(i.tagName.toLowerCase())>-1)n=!0;else try{const o=ee.getComputedStyle(i);o&&o.getPropertyValue("cursor")==="pointer"&&(n=!0)}catch{}r.push(i),s=i}return{parentIsUsefulElement:n,targetElementList:r}};function Uc(t){const e=new Set;let n=0;for(let i=t;i.parentNode&&!nr(i,"body");i=i.parentNode){if(n++>=1e3||e.has(i))return!1;e.add(i);const o=hu(i);if(ze(o,"ph-sensitive")||ze(o,"ph-no-capture"))return!1}if(ze(hu(t),"ph-include"))return!0;const r=t.type||"";if(tt(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}const s=t.name||t.id||"";return!tt(s)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,""))}function mf(t){return!!(nr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||nr(t,"select")||nr(t,"textarea")||t.getAttribute("contenteditable")==="true")}const yS=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),_S=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,H7=[16,15,14,13],z7=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),wS=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),xS=/[0-9A-Za-z_]/;function B7(t){let e=0,n=!1;for(let r=t.length-1;r>=0;r--){let s=t.charCodeAt(r)-48;n&&(s*=2,s>9&&(s-=9)),e+=s,n=!n}return e%10==0}function qd(t,e=!0){return!(Xe(t)||tt(t)&&(t=Tm(t),(e?yS.test((t||"").replace(/[- ]/g,"")):(function(n){let r;for(_S.lastIndex=0;r=_S.exec(n);){const s=r[2];if(!s)continue;const i=s.replace(/[- ]/g,"");for(let o=0;i.length>o;o++)for(const l of H7){const u=o+l;if(i.length>=u){const d=i.slice(o,u);if(yS.test(d)&&B7(d))return!0}}}return!1})(t))||(e?z7.test(t):(function(n){let r;for(wS.lastIndex=0;r=wS.exec(n);){const s=r[1],i=r[3];if(!(s&&i&&xS.test(s)&&xS.test(i)))return!0}return!1})(t))))}function bS(t){let e=pf(t);return e=`${e} ${CP(t)}`.trim(),qd(e)?e:""}function CP(t){let e="";return t&&t.childNodes&&t.childNodes.length&&bt(t.childNodes,function(n){var r;if(n&&((r=n.tagName)===null||r===void 0?void 0:r.toLowerCase())==="span")try{const s=pf(n);e=`${e} ${s}`.trim(),n.childNodes&&n.childNodes.length&&(e=`${e} ${CP(n)}`.trim())}catch(s){ge.error("[AutoCapture]",s)}}),e}function SS(t){return t.replace(/"|\\"/g,'\\"')}function U7(t){const e=t.attr__class;if(e)return He(e)?e:cw(e)}const xp=qt("[Dead Clicks]"),W7=()=>!0,Z7=t=>{var e;const n=!!(!((e=t.instance.persistence)===null||e===void 0)&&e.get_property(nw)),r=t.instance.config.capture_dead_clicks;return xr(r)?r:!!st(r)||n};var ES=class{get lazyLoadedDeadClicksAutocapture(){return this.No}constructor(t,e,n){this.instance=t,this.isEnabled=e,this.onCapture=n,this.startIfEnabledOrStop()}onRemoteConfig(t){if(!t.ok)return;const e=t.config;"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[nw]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.qo(()=>{this.jo()}):this.stop()}qo(t){var e,n,r;!((e=Le.__PosthogExtensions__)===null||e===void 0)&&e.initDeadClicksAutocapture?t():(n=Le.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this.instance,"dead-clicks-autocapture",s=>{s?xp.error("failed to load script",s):t()})}jo(){var t;if(ue){if(!this.No&&(!((t=Le.__PosthogExtensions__)===null||t===void 0)&&t.initDeadClicksAutocapture)){const e=st(this.instance.config.capture_dead_clicks)?z({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.No=Le.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.No.start(ue),xp.info("starting...")}}else xp.error("`document` not found. Cannot start.")}stop(){this.No&&(this.No.stop(),this.No=void 0,xp.info("stopping..."))}};const bd=qt("[SegmentIntegration]");function kS(t,e,n=!0){const r=t.config.segment;if(!r)return e();const{analytics:s,filterProperties:i}=(l=>Nn(l.register))(o=r)?{analytics:o}:o;var o;(function(l,u,d,h){const p=v=>{const w=()=>v.anonymousId()||ei();l.config.get_device_id=w,h&&v.id()&&(l.register({distinct_id:v.id(),$device_id:w()}),l.persistence.set_property(wr,s0)),d(h?void 0:v.anonymousId()||void 0)},m=u.user();"then"in m&&Nn(m.then)?m.then(p):p(m)})(t,s,l=>{s.register(((u,d,{filterProperties:h}={})=>{typeof Promise<"u"&&Promise.resolve||bd.warn("This browser does not have Promise support, and can not use the segment integration");const p=(m,v)=>{if(!v)return m;const w=!!d&&m.event.anonymousId===d&&!m.event.userId;w||m.event.userId||m.event.anonymousId===u.get_distinct_id()||(bd.info("No userId set, resetting PostHog"),u.reset()),w||(d=void 0),m.event.userId&&m.event.userId!==u.get_distinct_id()&&(bd.info("UserId set, identifying with PostHog"),u.identify(m.event.userId));let _=u.calculateEventProperties(v,m.event.properties);if(!Xe(h)){const x=m.event.properties||{},b={};for(const C of Object.keys(_))Y2.call(x,C)||(b[C]=_[C]);const k=((C,T)=>{const I=He(C)?C:[C];let M=z({},T);for(const R of I)try{if(M=R(M),Xe(M))return null}catch(A){return bd.error("Error in Segment filterProperties:",A),null}return M})(h,b);if(Xe(k))return m;_=k}return m.event.properties=Object.assign({},_,m.event.properties),m};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(m){return p(m,m.event.event)},page(m){return p(m,ow)},identify(m){return p(m,mP)},screen(m){return p(m,"$screen")}}})(t,l,{filterProperties:i})).then(()=>{e()},u=>{bd.error("Failed to register the Segment integration",u),e()})},n)}const PP="posthog-js";function TP(t,{organization:e,projectId:n,prefix:r,severityAllowList:s=["error"],sendExceptionsToPostHog:i=!0}={}){return o=>{var l,u,d,h,p;if(s!=="*"&&!s.includes(o.level)||!t.__loaded)return o;o.tags||(o.tags={});const m=t.requestRouter.endpointFor("ui",`/project/${t.config.token}/person/${t.get_distinct_id()}`);o.tags["PostHog Person URL"]=m,t.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));const v=((l=o.exception)===null||l===void 0?void 0:l.values)||[],w=v.map(b=>z(z({},b),{},{stacktrace:b.stacktrace?z(z({},b.stacktrace),{},{type:"raw",frames:(b.stacktrace.frames||[]).map(k=>z(z({},k),{},{platform:"web:javascript"}))}):void 0})),_={$exception_message:((u=v[0])===null||u===void 0?void 0:u.value)||o.message,$exception_type:(d=v[0])===null||d===void 0?void 0:d.type,$exception_level:o.level,$exception_list:w,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((h=v[0])===null||h===void 0?void 0:h.value)||o.message,$sentry_exception_type:(p=v[0])===null||p===void 0?void 0:p.type,$sentry_tags:o.tags};var x;return e&&n&&(_.$sentry_url=(r||"https://sentry.io/organizations/")+e+"/issues/?project="+n+"&query="+o.event_id),i&&((x=t.exceptions)===null||x===void 0||x.sendExceptionEvent(_)),o}}var q7=class{constructor(t,e,n,r,s,i){this.name=PP,this.setupOnce=function(o){o(TP(t,{organization:e,projectId:n,prefix:r,severityAllowList:s,sendExceptionsToPostHog:i==null||i}))}}},CS=class{constructor(t){this.Bo=(e,n,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(ge.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),this.Ho=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.zo()}zo(){var t;this.Uo=(t=this._instance.sessionManager)===null||t===void 0?void 0:t.onSessionId(this.Bo)}destroy(){var t;(t=this.Uo)===null||t===void 0||t.call(this),this.Uo=void 0}doPageView(t,e){var n;const r=this.Wo(t,e);return this.Ho={pathname:(n=ee==null?void 0:ee.location.pathname)!==null&&n!==void 0?n:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(t){var e;return this.Wo(t,(e=this.Ho)===null||e===void 0?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this.Ho)===null||t===void 0?void 0:t.pageViewId}}Wo(t,e){const n=this.Ho;if(!n)return{$pageview_id:e};let r={$pageview_id:e,$prev_pageview_id:n.pageViewId};const s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){let{maxScrollHeight:i,lastScrollY:o,maxScrollY:l,maxContentHeight:u,lastContentY:d,maxContentY:h}=s;if(!(le(i)||le(o)||le(l)||le(u)||le(d)||le(h))){i=Math.ceil(i),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),d=Math.ceil(d),h=Math.ceil(h);const p=i>1?Ci(o/i,0,1,ge):1,m=i>1?Ci(l/i,0,1,ge):1,v=u>1?Ci(d/u,0,1,ge):1,w=u>1?Ci(h/u,0,1,ge):1;r=Rt(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:p,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:m,$prev_pageview_last_content:d,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:w})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(t.getTime()-n.timestamp.getTime())/1e3),r}};const Sd=["flags","surveys"],G7={[t7]:{exposure:"hidden"},[V0]:{exposure:"hidden"},[n7]:{exposure:"hidden"},[Yy]:{exposure:"hidden"},[Bc]:{exposure:"hidden"},[Bd]:{exposure:"hidden"},[J3]:{exposure:"event"},[Xy]:{exposure:"hidden"},[tP]:{exposure:"hidden"},[Qy]:{exposure:"event"},[eP]:{exposure:"hidden"},[Jy]:{exposure:"event"},[e_]:{exposure:"event"},[nw]:{exposure:"event"},[rw]:{exposure:"hidden"},[nP]:{exposure:"event"},[Ud]:{exposure:"hidden"},[r7]:{exposure:"hidden"},[Oc]:{exposure:"hidden"},[rP]:{exposure:"event"},[s7]:{exposure:"event",shouldSkipFromEventProperties:t=>Kt(t)},[c7]:{exposure:"event"},[u7]:{exposure:"event"},[d7]:{exposure:"event"},[f7]:{exposure:"event"},[h7]:{exposure:"hidden"},[Js]:{exposure:"hidden",storageGroup:"flags"},[ao]:{exposure:"hidden",storageGroup:"flags"},[t_]:{exposure:"hidden"},[Il]:{exposure:"hidden",storageGroup:"flags"},[na]:{exposure:"hidden",storageGroup:"flags"},[Al]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Wd]:{exposure:"hidden",storageGroup:"flags"},[gi]:{exposure:"hidden"},[fl]:{exposure:"hidden"},[ra]:{exposure:"hidden"},[sa]:{exposure:"hidden"},[n_]:{exposure:"hidden",storageGroup:"surveys"},[H0]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[iP]:{exposure:"event"},[oP]:{exposure:"hidden"},[aP]:{exposure:"hidden"},[r_]:{exposure:"hidden"},[p7]:{exposure:"hidden"},[m7]:{exposure:"hidden"},[g7]:{exposure:"event"},[v7]:{exposure:"event"},[y7]:{exposure:"event"},[_7]:{exposure:"event"},[ia]:{exposure:"hidden"},[Dd]:{exposure:"hidden"},[sP]:{exposure:"event"},[ff]:{exposure:"hidden"},[ua]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[wr]:{exposure:"hidden"},[s_]:{exposure:"hidden"},[w7]:{exposure:"hidden"},[lP]:{exposure:"hidden"},[cP]:{exposure:"hidden"},[Lc]:{exposure:"hidden"},[sw]:{exposure:"hidden"},[i7]:{exposure:"event"},[o7]:{exposure:"event"},[a7]:{exposure:"event"},[l7]:{exposure:"event"},[dP]:{exposure:"event"},[fP]:{exposure:"event"},[hP]:{exposure:"event"},[x7]:{exposure:"event"},[b7]:{exposure:"event"},[S7]:{exposure:"event"},[E7]:{exposure:"event"},[k7]:{exposure:"event"},[C7]:{exposure:"event"},[P7]:{exposure:"event"},[T7]:{exposure:"event"}},K7=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Bn=t=>{const e=G7[t];if(e)return e;for(const[n,r]of K7)if(t.indexOf(n)===0)return r},Nc=(t,e)=>{try{let n;return JSON.stringify(t,(r,s)=>{var i;return Pu(s)?((i=n)!==null&&i!==void 0||(n=new WeakMap),n.has(s)||n.set(s,gP(s)),n.get(s)):typeof s=="bigint"?s.toString():s},e)}catch{return e3(t)}},ga=t=>{const e=ue==null?void 0:ue.createElement("a");return le(e)?null:(e.href=t,e)},pu=function(t,e){const n=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&");let r;for(let s=0;n.length>s;s++){const i=n[s].split("=");if(i[0]===e){r=i;break}}if(!He(r)||2>r.length)return"";{let s=r[1];try{s=decodeURIComponent(s)}catch{ge.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")}},gf=function(t,e,n){if(!t||!e||!e.length)return t;const r=t.split("#"),s=r[1],i=(r[0]||"").split("?"),o=i[1],l=i[0],u=(o||"").split("&"),d=[];for(let p=0;u.length>p;p++){const m=u[p].split("=");He(m)&&(e.includes(m[0])?d.push(m[0]+"="+n):d.push(u[p]))}let h=l;return o!=null&&(h+="?"+d.join("&")),s!=null&&(h+="#"+s),h},W0=function(t,e){const n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},IP=(t,e)=>t>=e&&JC(),AP=(t,e,n,r)=>{if(t===0){if(JC()){const s=e+1;return s===n&&r(),s}return e}return 0},mu=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Y7=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...mu],vf="<masked>",X7=["li_fat_id"];function RP(t,e,n){if(!ue)return{};const r=e?[...mu,...n||[]]:[],s=MP(gf(ue.URL,r,vf),t),i=(function(){const o={};return bt(X7,function(l){const u=B0(l);o[l]=u||null}),o})();return Rt(i,s)}function MP(t,e){const n=Y7.concat(e||[]),r={};return bt(n,function(s){const i=pu(t,s);r[s]=i||null}),r}function OP(t){const e=(function(s){return s?s.search("https?://(.*)google.([^/?]*)")===0?"google":s.search("https?://(.*)bing.com")===0?"bing":s.search("https?://(.*)yahoo.com")===0?"yahoo":s.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",r={};if(!Kt(e)){r.$search_engine=e;const s=ue?pu(ue.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function LP(){return navigator.language||navigator.userLanguage}function Q7(){const t=LP();return typeof t=="string"?t.split("-")[0]:void 0}const Z0="$direct";function DP(){return(ue==null?void 0:ue.referrer)||Z0}function NP(t,e,n=!1){const r=t?[...mu,...e||[]]:[],s=n?ma(Bt==null?void 0:Bt.href):Bt==null?void 0:Bt.href,i=s==null?void 0:s.substring(0,1e3);return{r:DP().substring(0,1e3),u:i?gf(i,r,vf):void 0}}function $P(t,e=!1){var n;const{r,u:s}=t,i=e?ma(s):s,o={$referrer:r,$referring_domain:r==null?void 0:r==Z0?Z0:(n=ga(r))===null||n===void 0?void 0:n.host};if(i){o.$current_url=i;const l=ga(i);o.$host=l==null?void 0:l.host,o.$pathname=l==null?void 0:l.pathname;const u=MP(i);Rt(o,u)}if(r){const l=OP(r);Rt(o,l)}return o}function jP(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function J7(){try{return new Date().getTimezoneOffset()}catch{return}}const e$={flags:ua,surveys:H0},t$=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],bp=t=>`${t}_cookie_identity_change_pending`,Sp=t=>{let e="",n=0;for(const r of t){const s=encodeURIComponent(JSON.stringify(r).slice(1,-1)).length;if(n+s>1e3)break;e+=r,n+=s}return e},kn="main",eo=[Js,ao,Il,na,Al,ua,Wd,ra],o1=t=>eo.indexOf(t)!==-1,FP=[Bc,Bd],PS=t=>FP.indexOf(t)!==-1,Bo=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch{return t===e}},wc=t=>{if(!t)return{};const e=JSON.parse(t);return st(e)?e:{}},TS=(t,e)=>{bt(t,(n,r)=>{const s=Bn(r);s&&s.exposure!=="event"||{}.hasOwnProperty.call(e,r)||delete t[r]})};var a1=class{constructor(t,e,n=!0){if(this.Vo={},this.Go=!1,this.Zo=!1,this.Qo=!1,this.Jo=!1,this.Ko=!1,this.Xo=new Map,this.Yo=!1,this.tl=!1,this.el=!1,this.il=new Set,this.nl=new Set,this.Ir=t,this.sl=n,this.props={},this.rl=void 0,this.ol=(r=>{let s="";return r.token&&(s=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+s+"_posthog"})(t),this.Oo=this.ll(t),this.Qo=this.al(t),this.load(),this.ul(),t.debug&&ge.info("Persistence loaded",t.persistence,z({},this.props)),this.update_config(t,t,e),this.save(),ee){const r=()=>this.flush();yt(ee,"beforeunload",r,{capture:!1}),yt(ee,"pagehide",r,{capture:!1}),this.hl=s=>{if(this.Go&&(!s.storageArea||s.storageArea===(ee==null?void 0:ee.localStorage))&&s.key)if(s.key!==this.ol){if(this.Qo){const i=Sd.find(o=>s.key===this.cl(o));i&&this.dl(s.key,i)}}else this.dl(s.key,kn)},yt(ee,"storage",this.hl)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach(([e,n])=>{const r=this.Xo.get(e);if(!o1(e)||r===!0)return;if(n===!0)return void this.vl(e,!0);const s=new Set(r||[]);n.forEach(i=>s.add(i)),s.size&&this.vl(e,s)})}onCrossTabFeatureFlagChange(t){return this.nl.add(t),()=>this.nl.delete(t)}destroy(){this.hl&&ee&&(ee.removeEventListener("storage",this.hl),this.hl=void 0),this.nl.clear()}dl(t,e,n=!0){if(this.mi)return!1;let r,s;try{if(s=dt.Ot(t),Kt(s)){const l=this.fl(e);return l.storageValue=null,e!==kn&&(l.persisted=!1),!1}r=wc(s)}catch{return!1}const i=e===kn?r:dt.Dt(this.ol);if(i&&this.pl(i))return!1;const o=this.gl(r,e,n);return e===kn&&this.Qo&&!Bo(this.ml().main,r)||this.yl(r,e,!0,s),o}pl(t){const e=this.props[qs],n=t[qs];return!le(e)&&!le(n)&&e!==n}yl(t,e,n,r){const s=this.fl(e);s.storageValue=r,e!==kn&&(s.persisted=n);try{s.fingerprint=this.bl(t,e)}catch{s.fingerprint=void 0}}gl(t,e,n){let r=!1;return eo.forEach(s=>{var i;const o=(i=Bn(s))===null||i===void 0?void 0:i.storageGroup;if(e===kn&&this.Qo&&o||e!==kn&&o!==e)return;const l=s in t,u=this._l(s,l?t[s]:void 0),d=this.Xo.has(s)?s in this.props:l;d===s in this.props&&Bo(u,this.props[s])||(d?this.wl(s,u,!1):this.kl(s,!1),r=!0)}),r&&n&&this.nl.forEach(s=>s()),r}Sl(){if(!this.Go)return!1;try{this.el=!1;const t=dt.Ot(this.ol),e=this.fl(kn);let n,r=!1,s=!1;if(t!==e.storageValue)if(Kt(t))e.storageValue=null;else{if(n=wc(t),this.el=!this.tl&&this.pl(n),this.el)return!1;s=this.gl(n,kn,!1),!this.Qo||Bo(this.ml().main,n)?this.yl(n,kn,!0,t):e.storageValue=t,r=!0}return this.Qo&&Sd.forEach(i=>{const o=dt.Ot(this.cl(i)),l=this.fl(i),u=n||{},d=r&&eo.some(p=>{var m;return((m=Bn(p))===null||m===void 0?void 0:m.storageGroup)===i&&p in u});if(o===l.storageValue&&!d)return;if(Kt(o))return l.storageValue=null,l.persisted=!1,void(d&&(s=this.gl(u,i,!1)||s));const h=wc(o);s=this.gl(h,i,!1)||s,this.yl(h,i,!0,o)}),s}catch{return!1}}vl(t,e){this.Xo.set(t,e);const n=Bn(t);n!=null&&n.volatile||(this.fl((this.Qo?n==null?void 0:n.storageGroup:void 0)||kn).fingerprint=void 0,this.xl(t))}Cl(){eo.forEach(t=>this.Xo.set(t,!0))}ul(){if(this.Go)try{const t=dt.Ot(this.ol),e=wc(t);this.fl(kn).storageValue=t,eo.forEach(n=>{var r;const s=this.Qo?(r=Bn(n))===null||r===void 0?void 0:r.storageGroup:void 0,i=s?dt.Ot(this.cl(s)):null;if(s){const l=this.fl(s);l.storageValue=i,l.persisted=!Kt(i)}const o=s&&!Kt(i)?wc(i):e;n in this.props?this.$l(n,o[n],this.props[n]):n in o&&this.vl(n,!0)})}catch{}}_l(t,e){const n=this.Xo.get(t);if(!n)return e;if(n===!0)return this.props[t];if(t==="$active_feature_flags"){const i=new Set(He(e)?e:[]),o=new Set(He(this.props[t])?this.props[t]:[]);return n.forEach(l=>o.has(l)?i.add(l):i.delete(l)),Array.from(i)}const r=st(e)?z({},e):{},s=st(this.props[t])?this.props[t]:{};return n.forEach(i=>{i in s?r[i]=s[i]:delete r[i]}),r}$l(t,e,n){if(!o1(t))return;const r=this.Xo.get(t);if(r===!0)return;let s=e;if(this.Go)try{var i;const l=this.Qo?(i=Bn(t))===null||i===void 0?void 0:i.storageGroup:void 0,u=l?this.cl(l):this.ol;s=wc(dt.Ot(u))[t]}catch{}const o=new Set(r||[]);if(t==="$active_feature_flags"){if(!le(e)&&!He(e)||!le(s)&&!He(s)||!He(n))return void this.vl(t,!0);const l=new Set(e||[]),u=new Set(s||[]),d=new Set(n);new Set([...l,...d]).forEach(h=>{l.has(h)!==d.has(h)&&o.add(h)}),o.forEach(h=>{u.has(h)===d.has(h)&&o.delete(h)})}else{if(!st(n))return void(Bo(s,n)?this.Xo.delete(t):this.vl(t,!0));{if(!le(e)&&!st(e)||le(e)&&Nr(n)&&le(s))return void this.vl(t,!0);const l=st(e)?e:{},u=st(s)?s:{};new Set([...Object.keys(l),...Object.keys(n)]).forEach(d=>{d in l==d in n&&Bo(l[d],n[d])||o.add(d)}),o.forEach(d=>{d in u==d in n&&Bo(u[d],n[d])&&o.delete(d)})}}o.size?this.vl(t,o):this.Xo.delete(t)}Il(){var t;const e=(t=this.Ir)===null||t===void 0?void 0:t.persistence_save_debounce_ms;return Xt(e)&&e>0?e:0}Tl(t){if(this.Ir.cookieWinsOnConflict&&this.Ir.persistence.toLowerCase()==="localstorage+cookie")if(t)try{const e=r1(t,this.Ir.cookie_persisted_properties||[]),n=fS(e,this.Ir.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(n),s=zt.Ot(this.ol)||void 0;s&&s1(this.ol,s)===r&&(this.Ml=r,this.El=s)}catch{}else try{const e=zt.Ot(this.ol)||void 0;this.Ml=e?s1(this.ol,e):void 0,this.El=e}catch{}}syncCookieProperties(){return this.Pl(this.Ir)}Pl(t,e=!1){if(this.mi&&!e||this.Ko||!t.cookieWinsOnConflict||t.persistence.toLowerCase()!=="localstorage+cookie")return!1;let n;try{n=zt.Ot(this.ol)||void 0}catch{}if(!n||n===this.El)return!1;const r=s1(this.ol,n);let s;try{s=n1(JSON.parse(n))}catch{return!1}if((zt.Ot(this.ol)||void 0)!==n)return!1;this.Ml=r,this.El=n;const i=hS(this.ol,n),o=[...hl,...i.properties],l={};if(Object.keys(s).forEach(_=>{const x=s[_];(le(x)||Kt(x)||x===""||_==="$user_state"&&x!=="anonymous"&&x!=="identified")&&(l[_]=!0,delete s[_])}),Nr(s))return!1;const u="distinct_id"in s||s.$user_state==="anonymous"||s.$user_state==="identified",d=this.props,h=d[qs],p=d[wr],m=Rt({},d);[...hl,...t.cookie_persisted_properties||[]].forEach(_=>{if(o.indexOf(_)!==-1&&!(_ in s)&&!l[_]&&(u||_!=="distinct_id"&&_!=="$user_state")){const x=m[_];(i.isValid||hl.indexOf(_)===-1||x!==!1&&x!==0)&&delete m[_]}}),this.props=Rt(m,s),eo.forEach(_=>{const x=_ in this.props;_ in d===x&&Bo(d[_],this.props[_])||(x?this.$l(_,d[_],this.props[_]):this.vl(_,!0))}),!u||"$user_state"in s||"$user_state"in this.props||this.wl(wr,lo);const v=this.props[qs],w=this.props[wr];return!u||v===h&&w===p||(this.tl=!0,this.Jo=!0,At.At(bp(this.ol),!0),this.kl(ra),this.kl(ao),this.kl(Js),this.kl(Il),this.kl(na),this.kl(Al),this.kl(ua),this.kl(ff),this.kl(ia),w!=="anonymous"||p!=="identified"&&s.$user_state!=="anonymous"&&(le(h)||v===h)||(TS(this.props,s),this.kl(sa)),w==="identified"?this.props.$user_id=v:delete this.props.$user_id,this.kl(V0)),!0}consumeCookieIdentityChange(){const t=bp(this.ol),e=this.Jo||!!At.Ot(t);return this.Jo=!1,e&&At.Lt(t),e}Rl(t=!1){return!(this.Ko||this.mi&&!t||!this.Ir.cookieWinsOnConflict||this.Ir.persistence.toLowerCase()!=="localstorage+cookie"||(this.Ko=!0,0))}Al(){this.Ko&&(le(this.Fl)||(clearTimeout(this.Fl),this.Fl=void 0),delete this.Vo[kn],this.Ol(!0))}Dl(t=!0){if(this.Ko)try{t?this.Al():le(this.Fl)||(clearTimeout(this.Fl),this.Fl=void 0)}finally{this.Ko=!1}}isDisabled(){return!!this.mi}ll(t){t$.indexOf(t.persistence.toLowerCase())===-1&&(ge.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");const e=((o=[],l=!1)=>{const u=[...hl,...o];return z(z({},dt),{},{Dt(d){try{let p,m={};try{p=zt.Ot(d)||void 0,m=p?n1(JSON.parse(p)):{}}catch{}const v=JSON.parse(dt.Ot(d)||"{}");let w;if(l){const _=hS(d,p),x=[...hl,..._.properties],b={};Object.keys(m).forEach(C=>{const T=m[C];Kt(T)||T===""||C==="$user_state"&&T!=="anonymous"&&T!=="identified"||(b[C]=T)});const k="distinct_id"in b||b.$user_state==="anonymous"||b.$user_state==="identified";if(Object.keys(b).length>0){var h;const C=v[qs],T=(h=v.$user_state)!==null&&h!==void 0?h:lo;u.forEach(I=>{if(x.indexOf(I)!==-1&&!(I in m)&&(k||I!=="distinct_id"&&I!=="$user_state")){const M=v[I];(_.isValid||hl.indexOf(I)===-1||M!==!1&&M!==0)&&delete v[I]}}),!k||"$user_state"in m||"$user_state"in v||(v[wr]=lo),!k||("distinct_id"in b?b[qs]:v[qs])===C&&("$user_state"in b?b[wr]:v[wr])===T||(t1.forEach(I=>delete v[I]),b.$user_state==="identified"&&"distinct_id"in b?v.$user_id=b[qs]:delete v.$user_id,b.$user_state!=="identified"&&(delete v[sP],delete v[sa]),delete v.__alias)}w=Rt(v,b)}else w=Rt(m,v);return dt.At(d,w),w}catch{}return null},At(d,h,p,m,v,w){const _=dt.At(d,h,void 0,void 0,w);try{const x=r1(h,o);if(Object.keys(x).length){if(l){const b=U0(d),k=fS(x,o);if(zt.At(b,k,p,m,v,w),zt.Ot(b)!==JSON.stringify(k)){zt.Lt(b,m);const C=r1(h);return zt.At(d,C,p,m,v,w),_}}zt.At(d,x,p,m,v,w)}}catch(x){dt.Pt(x)}return _},Lt(d,h){try{ee==null||ee.localStorage.removeItem(d),zt.Lt(d,h),zt.Lt(U0(d),h)}catch(p){dt.Pt(p)}}})})(t.cookie_persisted_properties||[],t.cookieWinsOnConflict);let n,r=!1,s=!1;const i=t.persistence.toLowerCase();return i==="localstorage"&&dt.Et()?(n=dt,s=!0):i==="localstorage+cookie"&&e.Et()?(n=e,s=!0,r=!0):i==="sessionstorage"&&At.Et()?n=At:i==="memory"?n=a_:i==="cookie"&&zt.Et()?(n=zt,r=!0):e.Et()?(n=e,s=!0,r=!0):zt.Et()?(n=zt,r=!0):n=a_,this.Go=s,this.Zo=r,n}cl(t){return`${this.ol}__${t}`}al(t){return this.Go&&!!t.split_storage}properties(){const t={};return bt(this.props,(e,n)=>{const r=Bn(n);if(!r||r.exposure==="event"){var s;if(!(r==null||(s=r.shouldSkipFromEventProperties)===null||s===void 0)&&s.call(r,e))return;t[n]=e}}),t}load(t=!1){if(this.mi&&!t)return;const e=this.Ir.cookieWinsOnConflict&&this.Ir.persistence.toLowerCase()==="localstorage+cookie",n=e?dt.Dt(this.ol):null;let r={};if(e)try{r=n1(zt.Dt(this.ol)),bt(r,(l,u)=>{(le(l)||Kt(l)||l==="")&&delete r[u]})}catch{}const s=this.Oo.Dt(this.ol);if(s&&(this.props=Rt({},s)),this.Qo&&this.Ll(),e&&s){var i,o;const l=n==null?void 0:n[qs],u=(i=n==null?void 0:n.$user_state)!==null&&i!==void 0?i:lo,d=s[qs],h=(o=s.$user_state)!==null&&o!==void 0?o:lo;if(d!==l||h!==u){this.Jo=!0,At.At(bp(this.ol),!0);const p=Rt({},this.props);t1.forEach(v=>delete p[v]),h!=="anonymous"||u!=="identified"&&r.$user_state!=="anonymous"&&(le(l)||d===l)||(TS(p,r),delete p[sa]),this.props=p;const m=new Set;t1.forEach(v=>{var w;const _=(w=Bn(v))===null||w===void 0?void 0:w.storageGroup;_&&m.add(_)}),m.forEach(v=>{const w={};bt(this.props,(_,x)=>{var b;((b=Bn(x))===null||b===void 0?void 0:b.storageGroup)===v&&(w[x]=_)}),Nr(w)?(dt.Lt(this.cl(v)),this.Vo[v]={}):dt.At(this.cl(v),w)&&(this.Vo[v]={persisted:!0,fingerprint:this.bl(w,v)})})}}At.Ot(bp(this.ol))&&(this.Jo=!0)}Ll(){for(const t of Sd){const e=dt.Dt(this.cl(t));if(e&&!Nr(e)){const n=this.fl(t);n.persisted=!0,this.Nl(t)||(n.fingerprint=this.bl(e,t)),this.ql(t,e)||Rt(this.props,e)}}}Nl(t){return Object.keys(this.props).some(e=>{var n;return((n=Bn(e))===null||n===void 0?void 0:n.storageGroup)===t})}ql(t,e){const n=e$[t];if(!n)return!1;const r=e[n],s=this.props[n];return Xt(r)&&Xt(s)&&s>r}refreshKey(t){var e;if(this.mi||this.il.has(t))return;const n=this.Qo?(e=Bn(t))===null||e===void 0?void 0:e.storageGroup:void 0,r=n?dt.Dt(this.cl(n)):this.Oo.Dt(this.ol);if(r&&t in r)this.wl(t,r[t],!1);else{if(n){const s=this.Oo.Dt(this.ol);if(s&&t in s)return void this.wl(t,s[t],!1)}this.kl(t,!1)}}save(){if(this.mi)return;const t=this.Il();t>0?le(this.Fl)&&(this.Fl=setTimeout(()=>{this.Fl=void 0,this.Ol()},t)):this.Ol()}flush(){le(this.Fl)||(clearTimeout(this.Fl),this.Fl=void 0,this.Ol())}Ol(t=!1){if(this.mi||this.Ko&&!t)return;t||(this.syncCookieProperties(),this.Ir.cookieWinsOnConflict&&this.Ir.persistence.toLowerCase()==="localstorage+cookie"||FP.forEach(s=>this.refreshKey(s)));const e=!t&&!this.Yo;e||(this.el=!1);const n=!!e&&this.Sl();if(this.el)return void(this.Ir.debug&&ge.warn("skipping persistence write because storage belongs to a different distinct ID"));if(this.Qo)return this.jl(),void(n&&this.nl.forEach(s=>s()));const r=this.Bl(this.Oo,this.ol,this.props,kn);r==="written"&&this.Tl(this.props),r!=="failed"&&(this.Xo.clear(),this.tl=!1,this.il.clear()),n&&this.nl.forEach(s=>s())}jl(){const{main:t,groups:e}=this.ml(),n=this.Bl(this.Oo,this.ol,t,kn);n==="written"&&this.Tl(t),n!=="failed"&&(this.tl=!1,this.il.clear(),eo.forEach(s=>{var i;!((i=Bn(s))===null||i===void 0)&&i.storageGroup||this.Xo.delete(s)}));for(const s of Sd){var r;const i=e[s];if(Nr(i)&&!(!((r=this.Vo[s])===null||r===void 0)&&r.persisted)){eo.forEach(l=>{var u;((u=Bn(l))===null||u===void 0?void 0:u.storageGroup)===s&&this.Xo.delete(l)});continue}const o=this.Bl(dt,this.cl(s),i,s);o!=="failed"&&eo.forEach(l=>{const u=Bn(l);(u==null?void 0:u.storageGroup)!==s||o!=="written"&&u.volatile||this.Xo.delete(l)})}}ml(){const t={},e={flags:{},surveys:{}};return bt(this.props,(n,r)=>{var s;const i=(s=Bn(r))===null||s===void 0?void 0:s.storageGroup;i?e[i][r]=n:t[r]=n}),{main:t,groups:e}}bl(t,e){if(e===kn)return JSON.stringify(t)+"|"+this.Hl+"|"+this.zl+"|"+this.Ul;const n={};return bt(t,(r,s)=>{var i;n[s]=!((i=Bn(s))===null||i===void 0)&&i.volatile?"__volatile__":r}),JSON.stringify(n)}Bl(t,e,n,r){const s=this.fl(r);if(r!==kn&&!s.dirty&&!le(s.fingerprint))return"skipped";let i;try{if(i=this.bl(n,r),i===s.fingerprint)return s.dirty=!1,"skipped"}catch{i=void 0}return t.At(e,n,this.Hl,this.zl,this.Ul,this.Ir.debug)?(s.dirty=!1,r!==kn&&(s.persisted=!0),le(i)||(s.fingerprint=i),this.Go&&(s.storageValue=dt.Ot(e)),"written"):(this.Ir.debug&&ge.warn(`failed to persist storage entry "${e}"; will retry on next save`),"failed")}remove({keepGroupEntries:t=!1}={}){if(this.Cl(),le(this.Fl)||(clearTimeout(this.Fl),this.Fl=void 0),this.Oo.Lt(this.ol,!1),this.Oo.Lt(this.ol,!0),!t&&this.sl)for(const e of Sd)dt.Lt(this.cl(e));t?delete this.Vo[kn]:this.Vo={},this.Ml=void 0,this.El=void 0}clear(){this.remove(),this.props={}}register_once(t,e,n){if(st(t)){this.syncCookieProperties(),le(e)&&(e="None"),this.Hl=le(n)?this.Wl:n;let r=!1;if(bt(t,(s,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.wl(i,s),r=!0)}),r)return this.save(),!0}return!1}register(t,e){if(st(t)){this.syncCookieProperties(),this.Hl=le(e)?this.Wl:e;let n=!1;if(bt(t,(r,s)=>{t.hasOwnProperty(s)&&(this.props[s]!==r||st(r)||He(r))&&(this.wl(s,r),n=!0)}),n)return this.save(),!0}return!1}unregister(t){this.syncCookieProperties();const e=typeof t=="string"?[t]:t;let n=!1;for(const r of e)r in this.props&&(this.kl(r),n=!0);n&&this.save()}update_campaign_params(){const t=ue==null?void 0:ue.URL;if(t===this.rl)return;const e=RP(this.Ir.custom_campaign_params,this.Ir.mask_personal_data_properties,this.Ir.custom_personal_data_properties),n=!Nr(aw(e));return n&&this.register(e),this.rl=t,n?e:void 0}update_search_keyword(){this.register((function(){const t=ue==null?void 0:ue.referrer;return t?OP(t):{}})())}update_referrer_info(){var t;this.register_once({$referrer:DP(),$referring_domain:(ue==null?void 0:ue.referrer)&&((t=ga(ue.referrer))===null||t===void 0?void 0:t.host)||Z0},void 0)}set_initial_person_info(){if(this.props.$initial_campaign_params||this.props.$initial_referrer_info)return;const t=NP(this.Ir.mask_personal_data_properties,this.Ir.custom_personal_data_properties,this.Ir.disable_capture_url_hashes);this.register_once({[Lc]:this.Zo?{r:Sp(t.r),u:t.u?Sp(t.u):void 0}:t},void 0)}get_initial_props(){const t={};bt([cP,lP],n=>{const r=this.props[n];r&&bt(r,function(s,i){t["$initial_"+zy(i)]=s})});const e=this.props[Lc];if(e){const n=(function(r,s=!1){const i=$P(r,s),o={};return bt(i,function(l,u){o[`$initial_${zy(u)}`]=l}),o})(e,this.Ir.disable_capture_url_hashes);Rt(t,n)}return t}safe_merge(t){return bt(this.props,function(e,n){n in t||(t[n]=e)}),t}update_config(t,e,n){const r=t.persistence!==e.persistence,s=!((v,w)=>{if(v.length!==w.length)return!1;const _=[...v].sort(),x=[...w].sort();return _.every((b,k)=>b===x[k])})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),i=r||s,o=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,l=t.disable_persistence||!!n,u=!!this.mi&&!l;l||this.Pl(e,u),this.Ir=t,!l&&(r||s||o)&&(this.Ml=void 0,this.El=void 0,this.Pl(z(z({},t),{},{cookie_persisted_properties:e.cookie_persisted_properties}),u));const d=i||o?this.ll(t):this.Oo;this.Vl();const h=this.al(t),p=i||h!==this.Qo,m=!l&&(p||t.cross_subdomain_cookie!==this.zl||t.secure_cookie!==this.Ul)&&this.Rl(u);this.Yo=p;try{if(this.Wl=this.Hl=t.cookie_expiration,this.set_disabled(l),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),p){const v=this.props;this.clear(),this.Oo=d,this.Qo=h,this.props=v,this.save()}else o&&(this.Oo=d,l||(delete this.Vo[kn],this.Ol()))}finally{this.Yo=!1,m&&this.Dl()}}Vl(){const t=this.props[Lc];if(!this.Zo||!st(t)||typeof t.r!="string")return;const e=Sp(t.r),n=typeof t.u=="string"?Sp(t.u):t.u;e===t.r&&n===t.u||this.wl(Lc,z(z({},t),{},{r:e,u:n}))}set_disabled(t){this.mi=t,this.mi?this.remove():this.save()}set_cross_subdomain(t){t!==this.zl&&(this.zl=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.Ul&&(this.Ul=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){const n=this.props.__timers||{};n[t]=e,this.wl(Yy,n),this.save()}remove_event_timer(t){const e=this.props.__timers||{},n=e[t];return le(n)||(delete e[t],this.wl(Yy,e),this.save()),n}get_property(t){return this.props[t]}set_property(t,e){this.wl(t,e),this.save()}wl(t,e,n=!0){var r;const s=this.props[t];this.props[t]=e,n&&(t!=="distinct_id"&&t!=="$user_state"||s===e||(this.tl=!0),PS(t)&&!Bo(s,e)&&this.il.add(t),this.$l(t,s,e),!((r=Bn(t))===null||r===void 0)&&r.volatile||this.xl(t))}kl(t,e=!0){delete this.props[t],e&&(o1(t)&&this.vl(t,!0),PS(t)&&this.il.add(t),this.xl(t))}xl(t){var e;const n=(e=Bn(t))===null||e===void 0?void 0:e.storageGroup;n&&(this.fl(n).dirty=!0)}fl(t){return this.Vo[t]||(this.Vo[t]={})}};const is={GZipJS:"gzip-js",Base64:"base64"},Ed={Activation:"events",Cancellation:"cancelEvents"},l1={Popover:"popover",API:"api",Widget:"widget"},co={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},c1={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},u_={Popover:"popover",Inline:"inline"};function Ep(t){let e=!0;return{dispose(){if(e){e=!1;const n=t();n&&Nn(n.then)&&n.then(void 0,()=>{})}}}}const n$={SHOWN:"product tour shown"},IS={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},AS=qt("[RateLimiter]");var r$=class{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{const n=e.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach(r=>{AS.info(`${r||"events"} is quota limited.`),this.serverLimits[r]=new Date().getTime()+6e4})}catch(r){return void AS.warn(`could not rate limit - continuing. Error: "${r==null?void 0:r.message}"`,{text:n})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return((t=this.instance.config.rate_limiting)===null||t===void 0?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max(((t=this.instance.config.rate_limiting)===null||t===void 0?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t=!1){var e,n,r;const{captureEventsBurstLimit:s,captureEventsPerSecond:i}=this,o=new Date().getTime(),l=(e=(n=this.instance.persistence)===null||n===void 0?void 0:n.get_property("$capture_rate_limit"))!==null&&e!==void 0?e:{tokens:s,last:o};l.tokens+=(o-l.last)/1e3*i,l.last=o,l.tokens>s&&(l.tokens=s);const u=1>l.tokens;if(u||t||(l.tokens=Math.max(0,l.tokens-1)),u&&!t){const d=(Xt(l.dropped)?l.dropped:0)+1;l.dropped=d,!this.lastEventRateLimited&&this.Gl(d)&&(l.dropped=0)}return this.lastEventRateLimited=u,(r=this.instance.persistence)===null||r===void 0||r.set_property("$capture_rate_limit",l),{isRateLimited:u,remainingTokens:l.tokens}}Zl(t){const e=this.instance.config.property_denylist;return!He(e)||!e.includes(t)}Ql(){var t;if(this.Zl("$current_url")&&this.Zl("$pathname")&&(Bt!=null&&Bt.pathname))return`${(t=Bt.origin)!==null&&t!==void 0?t:""}${Bt.pathname}`}Gl(t){var e,n;const{captureEventsBurstLimit:r,captureEventsPerSecond:s}=this,i=this.Ql(),o=this.Zl("$session_id")?(e=(n=this.instance).get_session_id)===null||e===void 0?void 0:e.call(n):void 0,l=[`${t} event(s) dropped since the last warning`,i?`triggered on ${i}`:void 0,o?`session ${o}`:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:`posthog-js client rate limited: ${l}. Config is set to ${s} events per second and ${r} events burst limit.`},{skip_client_rate_limiting:!0})}isServerRateLimited(t){const e=this.serverLimits[t||"events"]||!1;return e!==!1&&new Date().getTime()<e}};const Uo=qt("[RemoteConfig]");var VP=class{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=Le._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(t=t[this._instance.config.token])===null||t===void 0?void 0:t.config}Jl(t){var e,n,r;!((e=Le.__PosthogExtensions__)===null||e===void 0)&&e.loadExternalDependency?(n=Le.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"remote-config",()=>t(this.remoteConfig)):t()}Kl(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets",`/array/${this._instance.config.token}/config`),callback:t})}load(){try{if(this.remoteConfig)return Uo.info("Using preloaded remote config",this.remoteConfig),void this.Xl(this.remoteConfig);if(this._instance.Yl())return void Uo.warn("Remote config is disabled. Falling back to local config.");this.Jl(t=>{if(!t)return Uo.info("No config found after loading remote JS config. Falling back to JSON."),void this.Kl(e=>{this.Xl(e.json,e)});this.Xl(t)})}catch(t){Uo.error("Error loading remote config",t),this.Xl()}}Xl(t,e){!t&&e&&(e.statusCode===0?e.error||Uo.warn("Failed to fetch remote config from PostHog."):Uo.error("Failed to fetch remote config from PostHog."));try{this._instance.Xl(t?{ok:!0,config:t}:{ok:!1})}catch(r){Uo.error("Error applying remote config",r)}if((t==null?void 0:t.hasFeatureFlags)!==!1&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var n;(n=this._instance.featureFlags)===null||n===void 0||n.ensureFlagsLoaded()}catch(r){Uo.error("Error loading feature flags",r)}}},Rs=Uint8Array,jr=Uint16Array,gu=Uint32Array,fw=new Rs([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]),hw=new Rs([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]),RS=new Rs([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),HP=function(t,e){for(var n=new jr(31),r=0;31>r;++r)n[r]=e+=1<<t[r-1];var s=new gu(n[30]);for(r=1;30>r;++r)for(var i=n[r];n[r+1]>i;++i)s[i]=i-n[r]<<5|r;return[n,s]},zP=HP(fw,2),d_=zP[1];zP[0][28]=258,d_[258]=28;for(var MS=HP(hw,0)[1],BP=new jr(32768),Wt=0;32768>Wt;++Wt){var xc=(43690&Wt)>>>1|(21845&Wt)<<1;BP[Wt]=((65280&(xc=(61680&(xc=(52428&xc)>>>2|(13107&xc)<<2))>>>4|(3855&xc)<<4))>>>8|(255&xc)<<8)>>>1}var Gd=function(t,e,n){for(var r=t.length,s=0,i=new jr(e);r>s;++s)++i[t[s]-1];var o,l=new jr(e);for(s=0;e>s;++s)l[s]=l[s-1]+i[s-1]<<1;for(o=new jr(r),s=0;r>s;++s)o[s]=BP[l[t[s]-1]++]>>>15-t[s];return o},$l=new Rs(288);for(Wt=0;144>Wt;++Wt)$l[Wt]=8;for(Wt=144;256>Wt;++Wt)$l[Wt]=9;for(Wt=256;280>Wt;++Wt)$l[Wt]=7;for(Wt=280;288>Wt;++Wt)$l[Wt]=8;var q0=new Rs(32);for(Wt=0;32>Wt;++Wt)q0[Wt]=5;var s$=Gd($l,9),i$=Gd(q0,5),UP=function(t){return(t/8|0)+(7&t&&1)},WP=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof jr?jr:t instanceof gu?gu:Rs)(n-e);return r.set(t.subarray(e,n)),r},qi=function(t,e,n){var r=e/8|0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},kd=function(t,e,n){var r=e/8|0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},u1=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,i=n.slice();if(!s)return[new Rs(0),0];if(s==1){var o=new Rs(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(I,M){return I.f-M.f}),n.push({s:-1,f:25001});var l=n[0],u=n[1],d=0,h=1,p=2;for(n[0]={s:-1,f:l.f+u.f,l,r:u};h!=s-1;)l=n[n[p].f>n[d].f?d++:p++],u=n[d!=h&&n[p].f>n[d].f?d++:p++],n[h++]={s:-1,f:l.f+u.f,l,r:u};var m=i[0].s;for(r=1;s>r;++r)i[r].s>m&&(m=i[r].s);var v=new jr(m+1),w=f_(n[h-1],v,0);if(w>e){r=0;var _=0,x=w-e,b=1<<x;for(i.sort(function(I,M){return v[M.s]-v[I.s]||I.f-M.f});s>r;++r){var k=i[r].s;if(e>=v[k])break;_+=b-(1<<w-v[k]),v[k]=e}for(_>>>=x;_>0;){var C=i[r].s;e>v[C]?_-=1<<e-v[C]++-1:++r}for(;r>=0&&_;--r){var T=i[r].s;v[T]==e&&(--v[T],++_)}w=e}return[new Rs(v),w]},f_=function(t,e,n){return t.s==-1?Math.max(f_(t.l,e,n+1),f_(t.r,e,n+1)):e[t.s]=n},OS=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new jr(++e),r=0,s=t[0],i=1,o=function(u){n[r++]=u},l=1;e>=l;++l)if(t[l]==s&&l!=e)++i;else{if(!s&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(s),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(s);i=1,s=t[l]}return[n.subarray(0,r),e]},Cd=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},h_=function(t,e,n){var r=n.length,s=UP(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 i=0;r>i;++i)t[s+i+4]=n[i];return 8*(s+4+r)},LS=function(t,e,n,r,s,i,o,l,u,d,h){qi(e,h++,n),++s[256];for(var p=u1(s,15),m=p[0],v=p[1],w=u1(i,15),_=w[0],x=w[1],b=OS(m),k=b[0],C=b[1],T=OS(_),I=T[0],M=T[1],R=new jr(19),A=0;k.length>A;++A)R[31&k[A]]++;for(A=0;I.length>A;++A)R[31&I[A]]++;for(var L=u1(R,7),N=L[0],F=L[1],j=19;j>4&&!N[RS[j-1]];--j);var Q,q,Z,W,Y=d+5<<3,V=Cd(s,$l)+Cd(i,q0)+o,J=Cd(s,m)+Cd(i,_)+o+14+3*j+Cd(R,N)+(2*R[16]+3*R[17]+7*R[18]);if(V>=Y&&J>=Y)return h_(e,h,t.subarray(u,u+d));if(qi(e,h,1+(V>J)),h+=2,V>J){Q=Gd(m,v),q=m,Z=Gd(_,x),W=_;var B=Gd(N,F);for(qi(e,h,C-257),qi(e,h+5,M-1),qi(e,h+10,j-4),h+=14,A=0;j>A;++A)qi(e,h+3*A,N[RS[A]]);h+=3*j;for(var D=[k,I],X=0;2>X;++X){var ce=D[X];for(A=0;ce.length>A;++A)qi(e,h,B[se=31&ce[A]]),h+=N[se],se>15&&(qi(e,h,ce[A]>>>5&127),h+=ce[A]>>>12)}}else Q=s$,q=$l,Z=i$,W=q0;for(A=0;l>A;++A)if(r[A]>255){var se;kd(e,h,Q[257+(se=r[A]>>>18&31)]),h+=q[se+257],se>7&&(qi(e,h,r[A]>>>23&31),h+=fw[se]);var re=31&r[A];kd(e,h,Z[re]),h+=W[re],re>3&&(kd(e,h,r[A]>>>5&8191),h+=hw[re])}else kd(e,h,Q[r[A]]),h+=q[r[A]];return kd(e,h,Q[256]),h+q[256]},o$=new gu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),a$=(function(){for(var t=new gu(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),d1=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function l$(t,e){e===void 0&&(e={});var n=(function(){var p=4294967295;return{p(m){for(var v=p,w=0;m.length>w;++w)v=a$[255&v^m[w]]^v>>>8;p=v},d(){return 4294967295^p}}})(),r=t.length;n.p(t);var s,i,o,l,u,d=(l=10+((s=e).filename&&s.filename.length+1||0),u=8,(function(p,m,v,w,_,x){var b=p.length,k=new Rs(w+b+5*(1+Math.floor(b/7e3))+_),C=k.subarray(w,k.length-_),T=0;if(!m||8>b)for(var I=0;b>=I;I+=65535){var M=I+65535;b>M?T=h_(C,T,p.subarray(I,M)):(C[I]=x,T=h_(C,T,p.subarray(I,b)))}else{for(var R=o$[m-1],A=R>>>13,L=8191&R,N=(1<<v)-1,F=new jr(32768),j=new jr(N+1),Q=Math.ceil(v/3),q=2*Q,Z=function(xe){return(p[xe]^p[xe+1]<<Q^p[xe+2]<<q)&N},W=new gu(25e3),Y=new jr(288),V=new jr(32),J=0,B=0,D=(I=0,0),X=0,ce=0;b>I;++I){var se=Z(I),re=32767&I,de=j[se];if(F[re]=de,j[se]=re,I>=X){var ye=b-I;if((J>7e3||D>24576)&&ye>423){T=LS(p,C,0,W,Y,V,B,D,ce,I-ce,T),D=J=B=0,ce=I;for(var fe=0;286>fe;++fe)Y[fe]=0;for(fe=0;30>fe;++fe)V[fe]=0}var oe=2,je=0,Ce=L,We=re-de&32767;if(ye>2&&se==Z(I-We))for(var at=Math.min(A,ye)-1,it=Math.min(32767,I),Ot=Math.min(258,ye);it>=We&&--Ce&&re!=de;){if(p[I+oe]==p[I+oe-We]){for(var ht=0;Ot>ht&&p[I+ht]==p[I+ht-We];++ht);if(ht>oe){if(oe=ht,je=We,ht>at)break;var De=Math.min(We,ht-2),rt=0;for(fe=0;De>fe;++fe){var Be=I-We+fe+32768&32767,ct=Be-F[Be]+32768&32767;ct>rt&&(rt=ct,de=Be)}}}We+=(re=de)-(de=F[re])+32768&32767}if(je){W[D++]=268435456|d_[oe]<<18|MS[je];var Re=31&d_[oe],Ze=31&MS[je];B+=fw[Re]+hw[Ze],++Y[257+Re],++V[Ze],X=I+oe,++J}else W[D++]=p[I],++Y[p[I]]}}T=LS(p,C,x,W,Y,V,B,D,ce,I-ce,T)}return WP(k,0,w+UP(T)+_)})(i=t,(o=e).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+o.mem,l,u,!0)),h=d.length;return(function(p,m){var v=m.filename;if(p[0]=31,p[1]=139,p[2]=8,p[8]=2>m.level?4:m.level==9?2:0,p[9]=3,m.mtime!=0&&d1(p,4,Math.floor(new Date(m.mtime||Date.now())/1e3)),v){p[3]=8;for(var w=0;v.length>=w;++w)p[w+10]=v.charCodeAt(w)}})(d,e),d1(d,h-8,n.d()),d1(d,h-4,r),d}const c$=!!K2||!!uf,ZP=new WeakMap,qP="text/plain";let f1=0,o0=!1;const GP=(t,e)=>{const[n,r]=t.split("#"),[s,i]=n.split("?");if(!i)return t;const o=i.split("&").filter(l=>l.split("=")[0]!==e).join("&");return`${s}${o?`?${o}`:""}${r?`#${r}`:""}`},Kf=(t,e,n=!0)=>{var r;const[s,i]=t.split("?"),o=z({},e),l=(r=i==null?void 0:i.split("&").map(d=>{var h;const[p,m]=d.split("="),v=n&&(h=o[p])!==null&&h!==void 0?h:m;return delete o[p],`${p}=${v}`}))!==null&&r!==void 0?r:[],u=(function(d,h="&"){let p,m;const v=[];return bt(d,function(w,_){le(w)||le(_)||_==="undefined"||(p=encodeURIComponent((x=>x instanceof File)(w)?w.name:w.toString()),m=encodeURIComponent(_),v[v.length]=m+"="+p)}),v.join(h)})(o);return u&&l.push(u),l.length>0?`${s}?${l.join("&")}`:s},h1=t=>{if(t.ta)return t.ta;const{data:e,compression:n}=t;if(!e)return;if(n===is.GZipJS){const s=l$((function(i){var o=i.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(i);for(var l=new Rs(i.length+(i.length>>>1)),u=0,d=function(v){l[u++]=v},h=0;o>h;++h){if(u+5>l.length){var p=new Rs(u+8+(o-h<<1));p.set(l),l=p}var m=i.charCodeAt(h);128>m?d(m):2048>m?(d(192|m>>>6),d(128|63&m)):m>55295&&57344>m?(d(240|(m=65536+(1047552&m)|1023&i.charCodeAt(++h))>>>18),d(128|m>>>12&63),d(128|m>>>6&63),d(128|63&m)):(d(224|m>>>12),d(128|m>>>6&63),d(128|63&m))}return WP(l,0,u)})(Nc(e)),{mtime:0});return{contentType:qP,body:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),estimatedSize:s.byteLength}}if(n===is.Base64){const s=(function(o){return o&&btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,(l,u)=>String.fromCharCode(parseInt(u,16))))})(Nc(e)),i=(o=>"data="+encodeURIComponent(typeof o=="string"?o:Nc(o)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}const r=Nc(e);return{contentType:"application/json",body:r,estimatedSize:new Blob([r]).size}},KP=t=>{const e=()=>t.transport==="sendBeacon"?{url:Kf(t.url,{compression:is.Base64}),encodedBody:h1(z(z({},t),{},{compression:is.Base64,ta:void 0}))}:{url:GP(t.url,"compression"),encodedBody:h1(z(z({},t),{},{compression:void 0,ta:void 0}))};let n;try{n=h1(t)}catch(s){if(eS(t.compression,pu(t.url,"compression")))return ge.error("Failed to gzip request body, sending uncompressed payload",s),e();throw s}return n&&eS(t.compression,pu(t.url,"compression"))&&!((r=n.body)instanceof ArrayBuffer?Gy(new Uint8Array(r)):ArrayBuffer.isView(r)&&Gy(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)))?(o0=!0,e()):{url:t.url,encodedBody:n};var r},YP=t=>{try{return KP(t)}catch(n){var e;return ge.error(n),void((e=t.callback)===null||e===void 0||e.call(t,{statusCode:0,error:n}))}},u$=(function(){var t=Mt(function*(e){const n=yield(function(s){return Ky.apply(this,arguments)})(Nc(e.data),Tn.DEBUG,{rethrow:!0});if(!n)return e;const r=yield n.arrayBuffer();return z(z({},e),{},{ta:{contentType:qP,body:r,estimatedSize:r.byteLength}})});return function(e){return t.apply(this,arguments)}})(),d$=/Failed to fetch|NetworkError|Load failed/i,XP=t=>(t==null?void 0:t.name)==="TypeError"&&d$.test((t==null?void 0:t.message)||""),QP=t=>{try{const e=(function(n,r=Date.now()){if(typeof n!="string"||!n)return;const s=n.trim(),i=/^\d+\s*,/.test(s)?s.slice(0,s.indexOf(",")).trim():s;if(/^\d+$/.test(i)){const u=1e3*Math.min(Number(i),300);return u>0?u:void 0}if(!/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(i))return;const o=/^\w{3} \w{3} /.test(i)?i+" GMT":i,l=Date.parse(o)-r;return Number.isFinite(l)&&l>0?Math.min(l,r0):void 0})(t());return le(e)?void 0:Math.min(e,3e4)}catch{return}},JP=t=>{const e=YP(t);if(!e)return;const n=new K2;ZP.set(n,!0);const{url:r,encodedBody:s}=e;n.open(t.method||"GET",r,!0);const{contentType:i,body:o}=s??{};bt(t.headers,function(l,u){n.setRequestHeader(u,l)}),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var l;const u={statusCode:n.status,text:n.responseText};if(n.status===200)try{u.json=JSON.parse(n.responseText)}catch{}(l=t.callback)===null||l===void 0||l.call(t,u,QP(()=>n.getResponseHeader("Retry-After")))}},n.send(o)},e5=t=>{const e=YP(t);if(!e)return;const{url:n,encodedBody:r}=e,{contentType:s,body:i,estimatedSize:o}=r??{},l=new Headers;bt(t.headers,function(w,_){l.append(_,w)}),s&&l.append("Content-Type",s);let u=null,d=!1;if(F6){const w=new F6;u={signal:w.signal,timeout:setTimeout(()=>{d=!0;try{w.abort(L3("AbortError","PostHog request timed out"+((_=t.timeout)?` after ${_}ms`:"")))}catch(x){p(x)}var _},t.timeout)}}let h=!1;const p=w=>{var _;h||(h=!0,d&&(w==null?void 0:w.name)==="AbortError"||XP(w)?ge.warn(w):ge.error(w),(_=t.callback)===null||_===void 0||_.call(t,{statusCode:0,error:w}))};let m=0;const v=()=>{f1-=m,m=0,u&&clearTimeout(u.timeout)};try{const w=z({method:(t==null?void 0:t.method)||"GET",headers:l,referrerPolicy:"strict-origin",body:i,signal:u==null?void 0:u.signal},t.fetchOptions),_=o??(le(i)?0:void 0);w.keepalive=w.method==="POST"&&!t.ea&&w.keepalive!==!1&&w.body===i&&!le(_)&&_>=0&&52428.8>f1+_,w.keepalive&&(m=_,f1+=m),uf(n,w).then(x=>x.text().then(b=>{var k;if(h)return;const C={statusCode:x.status,text:b};if(x.status===200)try{C.json=JSON.parse(b)}catch(T){ge.error(T)}h=!0,v(),(k=t.callback)===null||k===void 0||k.call(t,C,QP(()=>x.headers.get("Retry-After")))})).catch(x=>{v(),p(x)}).finally(v)}catch(w){v(),p(w)}},p_=t=>{try{var e;const{url:n,encodedBody:r}=KP(t),{contentType:s,body:i,estimatedSize:o}=r??{};if(!i)return;const l=i instanceof Blob?i:new Blob([i],{type:s});if($n.sendBeacon(n,l))return;const u=He(t.data)?t.data:(e=t.data)===null||e===void 0?void 0:e.batch;if(He(u)&&u.length>1&&(o??0)>16384){const d=Math.ceil(u.length/2),h=p=>He(t.data)?p:z(z({},t.data),{},{batch:p});return p_(z(z({},t),{},{data:h(u.slice(0,d))})),void p_(z(z({},t),{},{data:h(u.slice(d))}))}ge.warn(`Beacon of ~${o??0} bytes was rejected by the browser, falling back to ${uf?"fetch":"XHR"}`),uf?e5(z(z({},t),{},{ea:!0})):JP(t)}catch(n){ge.warn("Beacon send failed",n)}},DS=(t,e,n,r)=>{const s=r==="query"?e==="POST"?"sent_at":"_":void 0;return Kf(n===is.GZipJS?GP(t,"compression"):t,z(z({},s?{[s]:Date.now().toString()}:{}),n===is.GZipJS?{}:{compression:n}))},f$=(()=>{const t=[];return uf&&t.push({transport:"fetch",method:e5}),K2&&t.push({transport:"XHR",method:JP}),$n!=null&&$n.sendBeacon&&t.push({transport:"sendBeacon",method:p_}),t})();let t5=!c$&&(_r==null?void 0:_r.indexOf("MSIE"))===-1&&(_r==null?void 0:_r.indexOf("Mozilla"))===-1;function n5(t,e,n){var r,s,i;n&&(e=z(z({},e),{},{callback:o=>n(o)})),t.__loaded?t5?t.__request_queue.push(e):t.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&((s=e.callback)===null||s===void 0||s.call(e,{statusCode:429})):(e.transport=e.transport||t.config.api_transport,e.headers=z(z({},t.config.request_headers),e.headers),e.compression=e.compression==="best-available"?(r=t.compression)!==null&&r!==void 0?r:e.compressionFallback:e.compression,(le(t.config.disable_beacon)?t.config.__preview_disable_beacon:t.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||t.config.fetch_options,((o,l)=>{var u,d,h;const p=z(z({},o),{},{callback:l??(x=>{var b;return(b=o.callback)===null||b===void 0?void 0:b.call(o,x)})});p.timeout=p.timeout||6e4;const m=(u=p.transport)!==null&&u!==void 0?u:"fetch";m==="sendBeacon"&&le(p.compression)&&p.data&&(p.compression=is.Base64),p.method==="POST"&&p.data&&(p.timestampMode==="capture-body"?p.data=(x=>{var b,k;const C=(He(x)?x:[x]).map(I=>z(z({},I),I.timestamp instanceof Date&&!isNaN(I.timestamp.getTime())?{timestamp:I.timestamp.toISOString()}:{})),T=C[0];return{api_key:(b=T==null||(k=T.properties)===null||k===void 0?void 0:k.token)!==null&&b!==void 0?b:T==null?void 0:T.token,batch:C,sent_at:new Date().toISOString()}})(p.data):p.timestampMode==="body"&&(p.data=((x,b=new Date().toISOString())=>He(x)?x.map(k=>z(z({},k),{},{sent_at:b})):z(z({},x),{},{sent_at:b}))(p.data))),p.url=DS(p.url,p.method,p.compression,p.timestampMode);const v=f$.filter(x=>!p.disableTransport||!x.transport||!p.disableTransport.includes(x.transport)),w=(d=(h=(function(x,b){for(let k=0;x.length>k;k++)if(b(x[k]))return x[k]})(v,x=>x.transport===m))===null||h===void 0?void 0:h.method)!==null&&d!==void 0?d:v[0].method;if(!w)throw new Error("No available transport method");const _=x=>{try{w(x)}catch(k){var b;XP(k)?ge.warn(k):ge.error(k),(b=p.callback)===null||b===void 0||b.call(p,{statusCode:0,error:k})}};m!=="sendBeacon"&&p.data&&p.compression===is.GZipJS&&KD&&typeof Promise<"u"&&!o0?u$(p).then(x=>{_(x)}).catch(x=>{if(tS(x))return o0=!0,void _(z(z({},p),{},{compression:void 0,url:DS(o.url,o.method,void 0,o.timestampMode)}));(b=>{if(!b||typeof b!="object")return!1;const k="name"in b?String(b.name):"";return tS(b)||k===H3})(x)&&(o0=!0),_(p)}):w(p)})(e,(o,l)=>{var u,d,h;t.rateLimiter.checkForLimiting(o),400>o.statusCode||(u=(d=t.config).on_request_error)===null||u===void 0||u.call(d,o),n?n(o,l):(h=e.callback)===null||h===void 0||h.call(e,o)})):e.fireCallbackOnDrop&&((i=e.callback)===null||i===void 0||i.call(e,{statusCode:0}))}var h$=class{constructor(t,e){this.ia=!0,this.na=[],this.sa=Ci((e==null?void 0:e.flush_interval_ms)||3e3,250,5e3,ge.createLogger("flush interval"),3e3),this.ra=t}enqueue(t){this.na.push(t),this.oa||this.la()}unload(){this.aa();const t=this.na.length>0?this.ua():{},e=Object.values(t);[...e.filter(n=>n.url.indexOf("/e")===0),...e.filter(n=>n.url.indexOf("/e")!==0)].map(n=>{this.ha(n,"sendBeacon")})}enable(){this.ia=!1,this.la()}la(){this.ia||(this.oa=setTimeout(()=>{if(this.aa(),this.na.length>0){const t=this.ua();for(const e in t)this.ha(t[e])}},this.sa))}ha(t,e){try{this.ra(t,e)}catch(n){ge.error(n)}}aa(){clearTimeout(this.oa),this.oa=void 0}ua(){const t={};return bt(this.na,e=>{var n;const r=e,s=((r?r.batchKey:null)||r.url)+(r.batchGroup?`:${r.batchGroup}`:"");le(t[s])&&(t[s]=z(z({},r),{},{data:[]})),(n=t[s].data)===null||n===void 0||n.push(r.data)}),this.na=[],t}};const p$=["retriesPerformedSoFar"];var m$=class{constructor(t){this._instance=t,this.ca=!1,this.da=3e3,this.na=[],this.na=[],this.va=!0,this.resume()}resume(){if(!le(ee)&&"onLine"in ee.navigator){if(this.va=ee.navigator.onLine,this.fa)return;this.fa=()=>{this.va=!0,this.pa()},this.ga=()=>{this.va=!1},yt(ee,"online",this.fa),yt(ee,"offline",this.ga)}}get length(){return this.na.length}retriableRequest(t,e){let{retriesPerformedSoFar:n}=t,r=z3(t,p$);Ji(n)&&(r.url=Kf(r.url,{retry_count:n})),n5(this._instance,e?z(z({},r),{},{transport:e}):r,(s,i)=>{var o;if(s.statusCode!==200&&(400>s.statusCode||s.statusCode>=500)){if((s.statusCode===0?3:10)>(n??0))return void this.Ls(z({retriesPerformedSoFar:n},r),i);s.statusCode===0&&ge.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.`)}(o=r.callback)===null||o===void 0||o.call(r,s)})}Ls(t,e){const n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;const r=Math.max((function(o){const l=3e3*Math.pow(2,o),u=l/2,d=Math.min(18e5,l),h=(Math.random()-.5)*(d-u);return Math.ceil(d+h)})(n),e??0),s=Date.now()+r;this.na.push({retryAt:s,requestOptions:t});let i=`Enqueued failed request for retry in ${r}`;navigator.onLine||(i+=" (Browser is offline)"),ge.warn(i),this.ca||(this.ca=!0,this.ma())}ma(){if(this.ya&&clearTimeout(this.ya),this.na.length===0)return this.ca=!1,void(this.ya=void 0);this.ya=setTimeout(()=>{this.va&&this.na.length>0&&this.pa(),this.ma()},this.da)}pa(){const t=Date.now(),e=[],n=this.na.filter(r=>t>r.retryAt||(e.push(r),!1));if(this.na=e,n.length>0)for(const{requestOptions:r}of n)this.retriableRequest(r)}unload(){this.ya&&(clearTimeout(this.ya),this.ya=void 0),this.ca=!1,le(ee)||(this.fa&&(ee.removeEventListener("online",this.fa),this.fa=void 0),this.ga&&(ee.removeEventListener("offline",this.ga),this.ga=void 0));for(const{requestOptions:t}of this.na)try{this._instance._send_request(z(z({},t),{},{transport:"sendBeacon"}))}catch(e){ge.error(e)}this.na=[]}},g$=class{constructor(t){this._instance=t,this.ba=()=>{var e,n,r,s;this._a||(this._a={});const i=this.scrollElement(),o=this.scrollY(),l=i?Math.max(0,i.scrollHeight-i.clientHeight):0,u=o+((i==null?void 0:i.clientHeight)||0),d=(i==null?void 0:i.scrollHeight)||0;this._a.lastScrollY=Math.ceil(o),this._a.maxScrollY=Math.max(o,(e=this._a.maxScrollY)!==null&&e!==void 0?e:0),this._a.maxScrollHeight=Math.max(l,(n=this._a.maxScrollHeight)!==null&&n!==void 0?n:0),this._a.lastContentY=u,this._a.maxContentY=Math.max(u,(r=this._a.maxContentY)!==null&&r!==void 0?r:0),this._a.maxContentHeight=Math.max(d,(s=this._a.maxContentHeight)!==null&&s!==void 0?s:0)}}get wa(){return this._instance.config.scroll_root_selector}getContext(){return this._a}resetContext(){const t=this._a;return this._a=void 0,setTimeout(this.ba,0),t}startMeasuringScrollPosition(){yt(ee,"scroll",this.ba,{capture:!0}),yt(ee,"scrollend",this.ba,{capture:!0}),yt(ee,"resize",this.ba)}scrollElement(){if(this.wa){const n=He(this.wa)?this.wa:[this.wa];for(const r of n){var t;const s=ee==null||(t=ee.document)===null||t===void 0?void 0:t.querySelector(r);if(s)return s}return}var e;return ee==null||(e=ee.document)===null||e===void 0?void 0:e.documentElement}ka(t){var e,n;const r=t==="y"?"scrollTop":"scrollLeft";if(this.wa){const s=this.scrollElement();return s&&s[r]||0}return ee?t==="y"?ee.scrollY||ee.pageYOffset||((e=ee.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.scrollTop)||0:ee.scrollX||ee.pageXOffset||((n=ee.document)===null||n===void 0||(n=n.documentElement)===null||n===void 0?void 0:n.scrollLeft)||0:0}scrollY(){return this.ka("y")}scrollX(){return this.ka("x")}};const v$=t=>NP(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);var NS=class{constructor(t,e,n,r){this.Be=s=>{const i=this.Sa();if(i&&i.sessionId===s)return;const o={sessionId:s,props:this.xa(this._instance)};this.Ca.register({[s_]:o})},this._instance=t,this.$a=e,this.Ca=n,this.xa=r||v$,this.$a.onSessionId(this.Be)}Sa(){return this.Ca.props[s_]}getSetOnceProps(){var t;const e=(t=this.Sa())===null||t===void 0?void 0:t.props;return e?"r"in e?$P(e,this._instance.config.disable_capture_url_hashes):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){const t={};return bt(aw(this.getSetOnceProps()),(e,n)=>{n==="$current_url"&&(n="url"),t[`$session_entry_${zy(n)}`]=e}),t}},G0=class{on(t,e){return this.Ia[t]||(this.Ia[t]=[]),this.Ia[t].push(e),()=>{this.Ia[t]=this.Ia[t].filter(n=>n!==e)}}emit(t,e){for(const n of this.Ia[t]||[])n(e);for(const n of this.Ia["*"]||[])n(t,e)}constructor(){this.Ia={}}};const bc=qt("[SessionId]"),$S=864e5;var jS=class{on(t,e){return this.Ta.on(t,e)}constructor(t,e,n){var r;if(this.Ma=null,this.Ea=null,this.Pa=[],this.Ra=void 0,this.Aa=!1,this.Ta=new G0,this.Fa=(i,o)=>!(!Ji(i)||!Ji(o))&&Math.abs(i-o)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Ir=t.config,this.Ca=t.persistence,this.He=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.Oa=void 0,this._sessionActivityTimestamp=null,this.Da=e||ei,this.La=n||ei;const s=this.Ir.persistence_name||this.Ir.token;if(this._sessionTimeoutMs=1e3*Ci(this.Ir.session_idle_timeout_seconds||1800,60,36e3,bc.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Na(),this.qa="ph_"+s+"_window_id",this.ja="ph_"+s+"_primary_window_exists",this.Ba()){const i=At.Dt(this.qa),o=At.Dt(this.ja);i&&!o?this.He=i:At.Lt(this.qa),At.At(this.ja,!0)}!((r=this.Ir.bootstrap)===null||r===void 0)&&r.sessionID&&this.setBootstrapSessionId(this.Ir.bootstrap.sessionID),this.Ha()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return le(this.Pa)&&(this.Pa=[]),this.Pa.push(t),this.Xt&&t(this.Xt,this.He),()=>{this.Pa=this.Pa.filter(e=>e!==t)}}Ba(){return this.Ir.persistence!=="memory"&&!this.Ca.mi&&At.Et()}za(t){t!==this.He&&(this.He=t,this.Ba()&&At.At(this.qa,t))}Ua(){return this.He?this.He:this.Ba()?At.Dt(this.qa):null}Wa(t){const e=this.Ma;return!Kt(e)&&!Kt(t)&&5e3>Math.abs(t-e)}Va(t,e,n){const r=e!==this._sessionActivityTimestamp,s=!(t!==this.Xt||n!==this._sessionStartTimestamp);this._sessionStartTimestamp=n,this._sessionActivityTimestamp=e,this.Xt=t,s&&!r||s&&this.Wa(e)||(this.Ma=e,this.Ca.register({[Oc]:[e,t,n]}))}Ga(){var t;const e=(t=this.Ir)===null||t===void 0?void 0:t.persistence_save_debounce_ms;return Ji(e)&&e>0}Za(){this.Ga()?this.Ca.refreshKey(Oc):(this.Ca.flush(),this.Ca.load())}Qa(){var t;if(Kt(this._sessionActivityTimestamp)||this._sessionActivityTimestamp===this.Ma)return;this.Za();const[,e,n]=this.Ja();e===this.Xt&&n===this._sessionStartTimestamp&&(this.Ma=this._sessionActivityTimestamp,this.Ca.register({[Oc]:[this._sessionActivityTimestamp,(t=this.Xt)!==null&&t!==void 0?t:null,this._sessionStartTimestamp]}),this.Ca.flush())}Ka(){const[t]=this.Ja(),e=Ji(t)?t:0,n=Ji(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,n)}Xa(t){return this.Za(),this.Fa(t,this.Ka())}Ja(){const t=this.Ca.props[Oc];return He(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Ma=null,this.Oa=void 0,clearTimeout(this.Ya),this.Ya=void 0,this.Va(null,null,null)}setBootstrapSessionId(t,e=!1){const n=((r,s=new Date().getTime())=>{try{const i=(o=>{const l=o.replace(/-/g,"");if(l.length!==32)throw new Error("Not a valid UUID");if(l[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(l.substring(0,12),16)})(r);return i>s+6e4?void bc.error("Bootstrap sessionID cannot be in the future"):i}catch(i){return void bc.error("Invalid sessionID in bootstrap",i)}})(t);return!le(n)&&(e?this.Oa={sessionId:t,sessionStartTimestamp:n}:this.Va(t,new Date().getTime(),n),!0)}destroy(){this.Aa=!0,this.Qa(),clearTimeout(this.Ya),this.Ya=void 0,this.Ra&&ee&&(ee.removeEventListener(z0,this.Ra,{capture:!1}),this.Ra=void 0),this.Pa=[]}Ha(){this.Ra=()=>{this.Qa(),this.Ba()&&At.Lt(this.ja)},yt(ee,z0,this.Ra,{capture:!1})}checkAndGetSessionAndWindowId(t=!1,e=null,n=!1){if(this.Ir.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');const r=e||new Date().getTime(),s=this.Xt;if(n)this.Ea=r;else if(Kt(this.Ea)||this.Ea>r||r-this.Ea>=1e3){var i,o;(i=(o=this.Ca).syncCookieProperties)===null||i===void 0||i.call(o),this.Ea=r}let[,l,u]=this.Ja();const d=!le(s)&&l!==s,h=this.Ka();let p=this.Ua();const m=this.Oa,v=!!m&&(m.sessionStartTimestamp>r+6e4||r-m.sessionStartTimestamp>$S),w=m?v:Ji(u)&&Math.abs(r-u)>$S;let _=!1,x=d;const b=!l||!!m,k=l;let C=!b&&!t&&this.Fa(r,h);if(C&&(C=this.Xa(r),C||bc.info("cross-tab refresh kept the session alive",{sessionId:l}),[,l,u]=this.Ja()),b||C||w){x=!1;const R=m&&!v;l=R?m.sessionId:this.Da(),p=this.La(),bc.info("new session ID assigned",{sessionId:l,windowId:p,bootstrapped:!!R,changeReason:{noSessionId:b,activityTimeout:C,sessionPastMaximumLength:w}}),u=R?m.sessionStartTimestamp:r,this.Oa=void 0,_=!0}else p||(p=this.La(),_=!0),x=x||l!==k,x&&(bc.info("adopted cross-tab session id",{sessionId:l,windowId:p}),_=!0);const T=Ji(h)&&t&&!w?h:r,I=Ji(u)?u:new Date().getTime();this.za(p),this.Va(l,T,I),t||this.Na();const M={noSessionId:b,activityTimeout:C,sessionPastMaximumLength:w,crossTabAdoption:x};return _&&this.Pa.forEach(R=>R(l,p,M)),{sessionId:l,windowId:p,sessionStartTimestamp:I,changeReason:_?M:void 0,lastActivityTimestamp:h}}Na(){this.Aa||(clearTimeout(this.Ya),this.Ya=setTimeout(()=>{if(!this.Aa)if(this.Xa(new Date().getTime())){const t=this.Xt;this.resetSessionId(),this.Ta.emit("forcedIdleReset",{idleSessionId:t})}else this.Na()},1.1*this.sessionTimeoutMs))}};const r5=function(t,e){if(!t)return!1;const n=t.userAgent;if(n&&H6(n,e))return!0;try{const r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some(s=>H6(s==null?void 0:s.brand,e)))return!0}catch{}return!!t.webdriver};function s5(){return(s5=Mt(function*(){const t=$n==null?void 0:$n.userAgentData;if(t!=null&&t.getHighEntropyValues)try{const e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return tt(n)&&n.length>0?n:void 0}catch(e){return void ge.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}function y$(t,e){let n=`$survey_${e}/${t.id}`;return t.current_iteration&&t.current_iteration>0&&(n=`$survey_${e}/${t.id}/${t.current_iteration}`),n}function i5(t){var e;return!!(!((e=t.conditions)===null||e===void 0||(e=e.events)===null||e===void 0||(e=e.values)===null||e===void 0)&&e.length)}const K0=(t,e)=>{if(!(n=>{try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}},kp=t=>t.toLowerCase(),o5={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=>K0(n,r))),not_regex:(t,e)=>e.every(n=>t.every(r=>!K0(n,r))),icontains:(t,e)=>e.map(kp).some(n=>t.map(kp).some(r=>n.includes(r))),not_icontains:(t,e)=>e.map(kp).every(n=>t.map(kp).every(r=>!n.includes(r))),gt:(t,e)=>e.some(n=>{const r=parseFloat(n);return!isNaN(r)&&t.some(s=>r>parseFloat(s))}),lt:(t,e)=>e.some(n=>{const r=parseFloat(n);return!isNaN(r)&&t.some(s=>r<parseFloat(s))})};function a5(t,e){return!t||Object.entries(t).every(([n,r])=>{const s=e==null?void 0:e[n];if(s==null)return!1;const i=o5[r.operator];return!!i&&i(r.values,[String(s)])})}function p1(t,e,n){return Nc({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}const m_="custom",FS="i.posthog.com",_$=/^\/static\//,w$=["/s/","/e/","/i/"];var x$=class{constructor(t){this.tu={},this.instance=t}get apiHost(){const t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get flagsApiHost(){const t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t;let e=(t=this.instance.config.ui_host)===null||t===void 0?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace(`.${FS}`,".posthog.com")),e==="https://app.posthog.com"?"https://us.posthog.com":e}get region(){return this.tu[this.apiHost]||(this.tu[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":m_),this.tu[this.apiHost]}eu(t){if(!_$.test(t))return;const e=this.instance.config.asset_host;return typeof e=="string"&&e.trim().replace(/\/$/,"")||void 0}iu(t){const e=ga(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}nu(t,e,n){if(t==="ui")return n;let r=n;const s=this.instance.config.rewriteRequestPath;if(s){var i;const o=((i=ga(n))===null||i===void 0?void 0:i.href)||n;r=s(new URL(o)).toString()}if(s&&t==="api"&&w$.some(o=>e.indexOf(o)===0)){const o=this.iu(r);if(o){const l=this.apiHost;let u=this.su;(u==null?void 0:u.apiHost)===l&&u.rewriteRequestPath===s||(u={apiHost:l,rewriteRequestPath:s,urls:new Set},this.su=u),u.urls.add(o)}}return r}isIngestionEndpoint(t){const e=this.su,n=this.iu(t);return(e==null?void 0:e.apiHost)===this.apiHost&&e.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!n&&e.urls.has(n)}endpointFor(t,e=""){if(e&&(e=e[0]==="/"?e:`/${e}`),t==="ui")return this.nu(t,e,this.uiHost+e);if(t==="flags")return this.nu(t,e,this.flagsApiHost+e);if(t==="assets"){const r=this.eu(e);if(r)return this.nu(t,e,`${r}${e}`)}if(this.region===m_)return this.nu(t,e,this.apiHost+e);const n=FS+e;switch(t){case"assets":return this.nu(t,e,`https://${this.region}-assets.${n}`);case"api":return this.nu(t,e,`https://${this.region}.${n}`)}}};const wt=qt("[Surveys]"),l5=t=>{try{const e=(n=>((r,s)=>`seenSurvey_${(function(i){return i.current_iteration&&i.current_iteration>0?`${i.id}_${i.current_iteration}`:i.id})(s)}`)(0,n))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(e){wt.error("Failed to persist survey seen state",e)}},b$=[l1.Popover,l1.Widget,l1.API],S$={ignoreConditions:!1,ignoreDelay:!1,displayType:u_.Popover},E$=qt("[PostHog ExternalIntegrations]"),k$={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};var C$=class{constructor(t){this._instance=t}qo(t,e){var n,r;(n=Le.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,t,s=>{if(s)return E$.error("failed to load script",s);e()})}startIfEnabledOrStop(){var t;for(const[s,i]of Object.entries((t=this._instance.config.integrations)!==null&&t!==void 0?t:{})){var e,n,r;i&&!(!((e=Le.__PosthogExtensions__)===null||e===void 0||(e=e.integrations)===null||e===void 0)&&e[s])&&this.qo(k$[s],()=>{var o;(o=Le.__PosthogExtensions__)===null||o===void 0||(o=o.integrations)===null||o===void 0||(o=o[s])===null||o===void 0||o.start(this._instance)}),!i&&(!((n=Le.__PosthogExtensions__)===null||n===void 0||(n=n.integrations)===null||n===void 0)&&n[s])&&((r=Le.__PosthogExtensions__)===null||r===void 0||(r=r.integrations)===null||r===void 0||(r=r[s])===null||r===void 0||r.stop())}}},P$=class{constructor(t,e){this.$=t,this.mo=e,this.ru=new Map,this.xo=!1}add(t){var e=this;return Mt(function*(){if(e.xo)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(e.ru.has(t.name))throw new Error(`Browser extension "${t.name}" is already registered`);e.ru.set(t.name,t);try{const n=t.setup(e.mo);n&&(yield n)}catch(n){const r=e.ru.get(t.name)===t;r&&e.ru.delete(t.name),e.$.error(`Failed to set up browser extension "${t.name}"`,n),r&&e.ou(t)}})()}getExtension(t){return this.ru.get(t)}dispose(){if(this.xo)return;this.xo=!0;const t=Array.from(this.ru.values()).reverse();this.ru.clear();for(const e of t)this.ou(e)}ou(t){try{var e;const n=(e=t.dispose)===null||e===void 0?void 0:e.call(t);n&&Nn(n.then)&&n.then(void 0,r=>{this.$.error(`Failed to dispose browser extension "${t.name}"`,r)})}catch(n){this.$.error(`Failed to dispose browser extension "${t.name}"`,n)}}},T$=class{constructor(t){this._instance=t}initialize(){}get(t){const e=this._instance.persistence;if(typeof t=="string")return e==null?void 0:e.get_property(t);const n={};for(const r of t){const s=e==null?void 0:e.get_property(r);le(s)||(n[r]=s)}return n}set(t,e){var n;(n=this._instance.persistence)===null||n===void 0||n.register(typeof t=="string"?{[t]:e}:t)}remove(t){var e;(e=this._instance.persistence)===null||e===void 0||e.unregister(t)}};const VS="extensionsRemoteConfig";var I$=class{constructor(t){this.instance=t,this.xo=!1,this.$=ge,this.lu=t.au,this.kv=new T$(t),this.onEvent=e=>Ep(this.instance.on("eventCaptured",n=>{try{e({event:n.event,properties:n.properties})}catch(r){this.$.error("Browser extension event listener failed",r)}})),this.onRemoteConfig=e=>{if(this.xo)return Ep(()=>{});const n=s=>{try{e(s)}catch(i){this.$.error("Browser extension remote config listener failed",i)}},r=this.instance.uu.on(VS,n);return this.lu&&n(this.lu),Ep(r)},this.hu=new P$(ge.createLogger("[BrowserExtensions]"),this)}get logger(){return this.$}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return(t=this.instance.get_property("$device_id"))!==null&&t!==void 0?t:this.distinctId}get deviceId(){const t=this.instance.get_property(tw);return typeof t=="string"?t:void 0}get library(){return{name:Tn.LIB_NAME,version:Tn.LIB_VERSION}}get initialPersonProperties(){var t,e;return(t=(e=this.instance.persistence)===null||e===void 0?void 0:e.get_initial_props())!==null&&t!==void 0?t:{}}get groups(){return this.instance.getGroups()}get session(){try{var t,e,n,r;const s=(t=this.instance.sessionManager)===null||t===void 0?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:(e=s==null?void 0:s.sessionId)!==null&&e!==void 0?e:"",windowId:(n=s==null?void 0:s.windowId)!==null&&n!==void 0?n:"",sessionStartTimestamp:(r=s==null?void 0:s.sessionStartTimestamp)!==null&&r!==void 0?r:0}}catch{return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(t){return this.hu.add(t)}getExtension(t){return this.hu.getExtension(t)}capture(t,e,n){var r=this;return Mt(function*(){n?r.instance.capture(t,e,{timestamp:n.timestamp,uuid:n.uuid,$set:n.set,$set_once:n.setOnce}):r.instance.capture(t,e)})()}registerDynamicEventProperties(t){return Ep(this.instance.cu(t))}handleRemoteConfig(t){this.xo||(this.lu=t,this.instance.uu.emit(VS,t))}sendRequest(t){var e=this;return Mt(function*(n,r={}){var s;const i=e.instance.requestRouter.endpointFor((s=r.target)!==null&&s!==void 0?s:"api",n),o={method:r.method,url:r.query?Kf(i,r.query):i,data:r.body,headers:r.headers,timeout:r.timeoutMs,fireCallbackOnDrop:!0,transport:r.transport,compression:r.compression,compressionFallback:r.target==="flags"&&r.compression==="best-available"?Hy.Base64:void 0,timestampMode:r.sentAt};return r.transport==="sendBeacon"?(e.instance._send_request(o),{statusCode:202}):new Promise(l=>{o.callback=l,e.instance._send_request(o)})}).apply(this,arguments)}dispose(){this.xo||(this.xo=!0,this.hu.dispose())}};const Kd={};let m1=0;const Yd=()=>{},HS='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Pd="Surveys module not available",zS="sanitize_properties is deprecated. Use before_send instead",c5="Invalid value for property_denylist config: ",A$=/^[A-Za-z0-9_-]{1,400}$/,BS=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,US=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,R$=["token","distinct_id",uP],Nd="posthog",M$=t=>{const e={};return t&&t!=="unset"&&("2025-11-30">t||(e.strictMinimumDuration=!0),"2026-05-30">t||(e.canvasCapture={resolutionScale:.6}),"2026-06-25">t||(e.streamNetworkBody=!0),"2026-08-30">t||(e.captureJsonLd=!0)),e},g1=t=>{var e;return z({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:R7(ue==null?void 0:ue.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Yd,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:Bt&&tt(Bt==null?void 0:Bt.search)&&Bt.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:(ee==null||(e=ee.location)===null||e===void 0?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(n){ge.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:pP,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:Yd},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:F7,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:M$(n),external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:n&&n>="2026-05-30"?250:0,split_storage:!(!n||"2026-05-30">n),detect_google_search_app:!(!n||"2026-05-30">n),disable_capture_url_hashes:!(!n||"2026-06-25">n),cookieWinsOnConflict:!(!n||n==="unset"||"2026-08-29">n)}))(t))},O$=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],WS=t=>{const e={};for(const[s,i]of O$)le(t[s])||(e[i]=t[s]);const n=Rt({},e,t),r=t.__preview_external_dependency_versioned_paths;return le(r)||(le(t.strict_script_versioning)&&(n.strict_script_versioning=!!r),tt(r)&&le(t.asset_host)&&(n.asset_host=r)),He(t.property_blacklist)&&(le(t.property_denylist)?n.property_denylist=t.property_blacklist:He(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:ge.error(c5+t.property_denylist)),n};var L$=class{constructor(){this.__forceAllowLocalhost=!1}get du(){return this.__forceAllowLocalhost}set du(t){ge.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}},Xd=class qo{vu(e){if(!e)return;const n=this.ru.indexOf(e);n!==-1&&this.ru.splice(n,1)}fu(e,n){var r;return this.vu(e),this.ru.push(n),(r=n.initialize)===null||r===void 0||r.call(n),n}pu(){return this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isRejected()}gu(){if(this.mu||this.config.reuseAnonymousId||this.config.segment||this.pu())return;const e=this.config.persistence==="memory"||this.config.persistence==="sessionStorage";if(!e&&!this.config.disable_persistence||this.yu)return;let n,r,s;e?(n=`persistence is set to '${this.config.persistence}'`,r=this.config.persistence==="memory"?"on every page load":"for every new browser tab or window",s="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(n="persistence is disabled (disable_persistence is true)",r="on every page load",s="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.mu=!0,console.warn("[PostHog.js]",`${n} but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID ${r}, so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. ${s}`)}bu(){if(this.pu()||this.get_distinct_id()!=="$posthog_cookieless")return;const e=this.persistence;if(!e)return;this._u()||e.load(!0);const n=this.get_distinct_id();if(!n||n==="$posthog_cookieless"){const r=this.config.get_device_id(ei());this.register({distinct_id:r,$device_id:r}),e.set_property(wr,lo)}this.wu()}get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.ku=!1,this.Su=!1,this.webPerformance=new L$,this.xu=!1,this.version=Tn.LIB_VERSION,this.Cu=new Set,this.$u="",this.uu=new G0,this.ru=[],this.Iu=[],this.yu=!1,this.mu=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=g1(),this.SentryIntegration=q7,this.sentryIntegration=r=>(function(s,i){const o=TP(s,i);return{name:PP,processEvent:l=>o(l)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Tu=!1,this.Mu=null,this.Eu=null,this.Pu=null,this.scrollManager=new g$(this),this.pageViewManager=new CS(this),this.rateLimiter=new r$(this),this.requestRouter=new x$(this),this.consent=new j7(this),this.externalIntegrations=new C$(this);const n=(e=qo.__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,i)=>{const o=tt(r)?{[r]:s}:r;this.setPersonProperties(o),i==null||i({})},set_once:(r,s,i)=>{const o=tt(r)?{[r]:s}:r;this.setPersonProperties(void 0,o),i==null||i({})}},this.on("eventCaptured",r=>ge.info(`send "${r==null?void 0:r.event}"`,r))}init(e,n,r){if(r&&r!==Nd){var s;const i=(s=Kd[r])!==null&&s!==void 0?s:new qo;return i._init(e,n,r),Kd[r]=i,Kd[Nd][r]=i,i}return this._init(e,n,r)}_init(e,n={},r){var s,i,o;const l=tt(e)?e.trim():"";if(!l)return ge.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;var u;if(this.__loaded)return l!==((u=this.config)===null||u===void 0?void 0:u.token)?console.warn("[PostHog.js]",`You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('${l}', { ... }, 'project2')`):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=g1(n.defaults),n.debug=this.Ru(n.debug),this.Au=n,this.Fu=[],n.person_profiles?this.Eu=n.person_profiles:n.process_person&&(this.Eu=n.process_person);const d=g1(n.defaults),h=WS(n),p=Rt({},d,h,{name:r,token:l});st(d.rageclick)&&st(h.rageclick)&&(p.rageclick=Rt({},d.rageclick,h.rageclick)),st(d.session_recording)&&st(h.session_recording)&&(p.session_recording=Rt({},d.session_recording,h.session_recording)),this.set_config(p),this.config.on_xhr_error&&ge.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:is.GZipJS;const m=this._u();if(this.persistence=new a1(this.config,m),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new a1(z(z({},this.config),{},{persistence:"sessionStorage"}),m,!1),this.$u="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties",this.config.persistence!=="memory"&&!m&&At.Et()){const b=At.Dt(this.$u);He(b)&&b.forEach(k=>{tt(k)&&this.Cu.add(k)})}else At.Lt(this.$u);const v=z({},this.persistence.props),w=z({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Ou=new h$((b,k)=>this.Du(b,k),this.config.request_queue_config),this.Lu=new m$(this),this.__request_queue=[];const _=this.pu();_||(this.sessionManager=new jS(this),this.sessionPropsManager=new NS(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((b,k,C)=>{(C!=null&&C.activityTimeout||C!=null&&C.sessionPastMaximumLength||C!=null&&C.crossTabAdoption)&&this.Nu()})),this.qu(),this.config.__preview_deferred_init_extensions?(ge.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.ju(_)},0)):(ge.info("Initializing extensions synchronously"),this.ju(_)),Tn.DEBUG=Tn.DEBUG||this.config.debug,Tn.DEBUG&&ge.info("Starting in debug mode",{this:this,config:n,thisC:z({},this.config),p:v,s:w}),this.config.identity_distinct_id&&!(!((s=n.bootstrap)===null||s===void 0)&&s.distinctID)&&(n.bootstrap=z(z({},n.bootstrap),{},{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));const x=(i=n.bootstrap)===null||i===void 0?void 0:i.distinctID;if(this.yu=!!x&&!Hd(x),(o=n.bootstrap)===null||o===void 0?void 0:o.distinctID){const b=n.bootstrap.distinctID,k=this.get_distinct_id(),C=this.persistence.get_property(wr);if(n.bootstrap.isIdentifiedID&&k!=null&&k!==b&&C==="anonymous")this.identify(b);else if(n.bootstrap.isIdentifiedID&&k!=null&&k!==b&&C==="identified")ge.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{const T=this.config.get_device_id(ei()),I=n.bootstrap.isIdentifiedID?T:b;this.persistence.set_property(wr,n.bootstrap.isIdentifiedID?s0:lo),this.register({distinct_id:b,$device_id:I})}}if(_)this.register_once({distinct_id:Jv,$device_id:null},"");else if(!this.get_distinct_id()){const b=this.config.get_device_id(ei());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(wr,lo)}return yt(ee,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),yt(ee,"pageshow",()=>{var b;this.ku=!1,this.Su||(b=this.Lu)===null||b===void 0||b.resume()}),n.segment?kS(this,()=>this.Bu()):this.Bu(),Nn(this.config._onCapture)&&this.config._onCapture!==Yd&&(ge.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",b=>this.config._onCapture(b.event,b))),this.config.ip&&ge.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 s5.apply(this,arguments)})().then(b=>{b&&this.register({[Qv]:b})}).catch(Yd),this}Hu(e){const n=e;return tt(n.name)&&Nn(n.setup)}zu(e,n){this.Hu(e)?n.push(()=>{this.Uu().add(e).catch(()=>{var r;return(r=e.dispose)===null||r===void 0?void 0:r.call(e)}).catch(r=>{ge.error(`Failed to dispose browser extension "${e.name}"`,r)})}):this.ru.push(e)}qu(){var e,n,r;const s=(e=(n=this.config.__extensionClasses)===null||n===void 0?void 0:n.featureFlags)!==null&&e!==void 0?e:(r=qo.__defaultExtensionClasses)===null||r===void 0?void 0:r.featureFlags;var i,o,l;s&&(this.featureFlags&&this.featureFlags instanceof s||((i=this.Wu)===null||i===void 0||i.call(this),this.Wu=void 0,this.featureFlags=new s(this)),Nn(this.featureFlags.onReloading)&&Nn(this.featureFlags.setup)?this.Wu||(this.Wu=this.featureFlags.onReloading(()=>{this.uu.emit("featureFlagsReloading",!0)}),this.Uu().add(this.featureFlags)):(o=(l=this.featureFlags).initialize)===null||o===void 0||o.call(l))}ju(e){const n=performance.now(),r=z(z({},qo.__defaultExtensionClasses),this.config.__extensionClasses),s=[];var i,o,l,u,d,h,p;r.exceptions&&this.ru.push(this.exceptions=(i=this.exceptions)!==null&&i!==void 0?i:new r.exceptions(this)),r.historyAutocapture&&this.ru.push(this.historyAutocapture=new r.historyAutocapture(this)),r.tracingHeaders&&this.ru.push(this.tracingHeaders=new r.tracingHeaders(this)),r.siteApps&&this.ru.push(this.siteApps=new r.siteApps(this)),r.sessionRecording&&!e&&this.ru.push(this.sessionRecording=new r.sessionRecording(this)),this.config.disable_scroll_properties||s.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),r.autocapture&&this.zu(this.autocapture=new r.autocapture(this),s),r.surveys&&this.zu(this.surveys=(o=this.surveys)!==null&&o!==void 0?o:new r.surveys(this),s),r.logs&&this.zu(this.logs=(l=this.logs)!==null&&l!==void 0?l:new r.logs(this),s),r.metrics&&this.ru.push(this.metrics=(u=this.metrics)!==null&&u!==void 0?u:new r.metrics(this)),r.conversations&&this.ru.push(this.conversations=(d=this.conversations)!==null&&d!==void 0?d:new r.conversations(this)),r.productTours&&this.ru.push(this.productTours=new r.productTours(this)),r.heatmaps&&this.ru.push(this.heatmaps=new r.heatmaps(this)),r.webVitalsAutocapture&&this.ru.push(this.webVitalsAutocapture=new r.webVitalsAutocapture(this)),r.exceptionObserver&&this.ru.push(this.exceptionObserver=new r.exceptionObserver(this)),r.deadClicksAutocapture&&this.ru.push(this.deadClicksAutocapture=new r.deadClicksAutocapture(this,Z7)),r.toolbar&&this.ru.push(this.toolbar=(h=this.toolbar)!==null&&h!==void 0?h:new r.toolbar(this)),r.experiments&&this.ru.push(this.experiments=(p=this.experiments)!==null&&p!==void 0?p:new r.experiments(this)),this.ru.forEach(m=>{m.initialize&&s.push(()=>{var v;(v=m.initialize)===null||v===void 0||v.call(m)})}),s.push(()=>{if(this.Vu){const m=this.Vu;this.Vu=void 0,this.ru.forEach(v=>{var w;return(w=v.onRemoteConfig)===null||w===void 0?void 0:w.call(v,m)})}}),this.Gu(s,n)}Gu(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout(()=>{this.Gu(e,n)},0);const s=e.shift();if(s)try{s()}catch(i){ge.error("Error initializing extension:",i)}}const r=Math.round(performance.now()-n);this.register_for_session({[dP]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[fP]:r}),this.config.__preview_deferred_init_extensions&&ge.info(`PostHog extensions initialized (${r}ms)`)}Xl(e){var n;if(!ue||!ue.body)return ge.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Xl(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.Vu=e),this.au=e,this.compression=void 0,e.ok){var r;const s=e.config;s.supportedCompression&&!this.config.disable_compression&&(this.compression=ze(s.supportedCompression,is.GZipJS)?is.GZipJS:ze(s.supportedCompression,is.Base64)?is.Base64:void 0),!((r=s.analytics)===null||r===void 0)&&r.endpoint&&(this.analyticsDefaultEndpoint=s.analytics.endpoint)}this.set_config({person_profiles:this.Eu?this.Eu:pP}),(n=this.Zu)===null||n===void 0||n.handleRemoteConfig(e),this.ru.forEach(s=>{var i;return(i=s.onRemoteConfig)===null||i===void 0?void 0:i.call(s,e)})}Bu(){try{this.config.loaded(this)}catch(e){ge.critical("`loaded` function failed",e)}if(this.Qu(),this.config.internal_or_test_user_hostname&&(Bt==null?void 0:Bt.hostname)){const e=Bt.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.pu())&&this.Ju()},1),this.Ku=new VP(this),this.Ku.load()}Qu(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Ou)===null||e===void 0||e.enable())}_dom_loaded(){this.is_capturing()&&Dc(this.__request_queue,e=>this.Du(e)),this.__request_queue=[],this.Qu()}_handle_unload(){var e,n,r,s,i,o;this.ku=!0,(e=this.surveys)===null||e===void 0||(n=e.handlePageUnload)===null||n===void 0||n.call(e),(r=this.metrics)===null||r===void 0||r.flush("sendBeacon"),this.config.request_batching?(this.Xu()&&this.capture(cS),(s=this.logs)===null||s===void 0||s.flushLogs("sendBeacon"),(i=this.Ou)===null||i===void 0||i.unload(),(o=this.Lu)===null||o===void 0||o.unload()):this.Xu()&&this.capture(cS,null,{transport:"sendBeacon"})}_send_request(e){n5(this,e)}Du(e,n){this.Lu?this.Lu.retriableRequest(e,n):this._send_request(n?z(z({},e),{},{transport:n}):e)}_execute_array(e){m1++;try{let n;const r=[],s=[],i=[];Dc(e,l=>{if(l)if(n=l[0],He(n))i.push(l);else if(Nn(l))try{l.call(this)}catch(u){ge.error("Error executing queued PostHog call",l,u)}else He(l)&&n==="alias"?r.push(l):He(l)&&n.indexOf("capture")!==-1&&Nn(this[n])?i.push(l):s.push(l)});const o=function(l,u){Dc(l,function(d){try{if(He(d[0])){let h=u;bt(d,function(p){h=h[p[0]].apply(h,p.slice(1))})}else u[d[0]].apply(u,d.slice(1))}catch(h){ge.error("Error executing queued PostHog call",d,h)}})};o(r,this),o(s,this),o(i,this)}finally{m1--}}push(e){if(m1>0&&He(e)&&tt(e[0])){const n=qo.prototype[e[0]];return void(Nn(n)&&n.apply(this,e.slice(1)))}this._execute_array([e])}get Yu(){return{property:aS,persistenceKey:Bc,cookieName:"_fbc",pattern:BS,register:(e,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[Bc]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(Bc)}}}get th(){return{property:lS,persistenceKey:Bd,cookieName:"_fbp",pattern:US,register:(e,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[Bd]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(Bd)}}}eh(e){var n;const r=(n=this.persistence)===null||n===void 0?void 0:n.get_property(e.persistenceKey);return tt(r)&&e.pattern.test(r)?{value:r,delivered:!1}:st(r)&&tt(r.value)&&e.pattern.test(r.value)?{value:r.value,delivered:r.delivered===!0}:void 0}ih(e,n,r){return n===(r==null?void 0:r.value)?{value:n,pending:!r.delivered}:(e.register(n,!1),{value:n,pending:!0})}nh(e){if(!this.config.save_campaign_params||this.pu())return;const n=B0(e.cookieName);return tt(n)&&e.pattern.test(n)?n:void 0}sh(e,n,r,s){if(!this.persistence)return;const i=this.Yu;this.persistence.refreshKey(i.persistenceKey);const o=this.eh(i);if(s)return void i.unregister();if(r)return tt(n)&&BS.test(n)?this.ih(i,n,o):void i.unregister();const l=tt(e)&&A$.test(e)?e:void 0,u=this.nh(i);return u&&((d,h,p)=>{const m=d.split(".");if(h)return m[3]===h;if(!p)return!0;const v=p.value.split(".");return m[3]===v[3]||Number(m[2])>Number(v[2])})(u,l,o)?this.ih(i,u,o):l?(o==null?void 0:o.value.split(".")[3])===l?{value:o.value,pending:!o.delivered}:this.ih(i,`fb.1.${Date.now()}.${l}`,o):o?{value:o.value,pending:!o.delivered}:void 0}rh(e,n,r){if(!this.persistence)return;const s=this.th;this.persistence.refreshKey(s.persistenceKey);const i=this.eh(s);if(r)return void s.unregister();if(n)return tt(e)&&US.test(e)?this.ih(s,e,i):void s.unregister();const o=this.nh(s);return o?this.ih(s,o,i):i?{value:i.value,pending:!i.delivered}:void 0}oh(e,n){if(!this.persistence)return;this.persistence.refreshKey(e.persistenceKey);const r=this.eh(e);(r==null?void 0:r.value)!==n||r.delivered||e.register(n,!0)}capture(e,n,r){var s,i;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Ou))return void ge.uninitializedWarning("posthog.capture");if(!this.is_capturing())return;if(le(e)||!tt(e))return void ge.error("No event name provided to posthog.capture");this.bu();const o=!this.config.opt_out_useragent_filter&&this._is_bot();if(o&&!this.config.__preview_capture_bot_pageviews)return;const l=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(l!=null&&l.isRateLimited)return void ge.critical("This capture call is ignored due to client rate limiting.");let u;n!=null&&n.$current_url&&!tt(n==null?void 0:n.$current_url)&&(ge.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.ah||ge.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&&(u=this.sessionPersistence.update_campaign_params()),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();const d=new Date,h=(r==null?void 0:r.timestamp)||d,p=W6(r==null?void 0:r.uuid,ei);let m={uuid:p,event:e,properties:this.calculateEventProperties(e,n||{},h,p)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&o&&(m.event="$bot_pageview",m.properties.$browser_type="bot"),l&&(m.properties.$lib_rate_limit_remaining_tokens=l.remainingTokens);const v=e==="$feature_flag_called"&&m.properties.$feature_flag_has_experiment===!1&&this.get_property("$minimal_flag_called_events")===!0;r!=null&&r.$set&&!v&&(m.$set=r==null?void 0:r.$set);const w=st(n==null?void 0:n.$set)?n.$set:void 0,_=He(n==null?void 0:n.$unset)?n.$unset:[],x=(r==null?void 0:r.$unset)||[],b=q=>{var Z;const W=!!(r!=null&&r.$set)&&q in r.$set;return{hasProvided:W||!!w&&q in w,provided:W?r==null||(Z=r.$set)===null||Z===void 0?void 0:Z[q]:w==null?void 0:w[q],unset:_.indexOf(q)!==-1||x.indexOf(q)!==-1}},k=b(aS),C=b(lS),T=[{channel:this.Yu,hasProvided:k.hasProvided,update:this.sh(u==null?void 0:u.fbclid,k.provided,k.hasProvided,k.unset)},{channel:this.th,hasProvided:C.hasProvided,update:this.rh(C.provided,C.hasProvided,C.unset)}];for(const{channel:q,hasProvided:Z,update:W}of T)W&&m.properties.$process_person_profile===!0&&W.pending&&!Z&&!v&&(m.$set=z({[q.property]:W.value},m.$set));const I=r==null?void 0:r.$unset;I&&(m.$unset=I);const M=v?void 0:this.uh(r==null?void 0:r.$set_once,e!==uS,e===mP);if(M&&(m.$set_once=M),r!=null&&r._noTruncate||(R=this.config.properties_string_max_length,m=(function(q,Z){const W=new Set;return(function Y(V,J){if(V!==Object(V))return Z?Z(V):V;if(W.has(V))return;let B;if(W.add(V),He(V))B=[],Dc(V,D=>{B.push(Y(D))});else{const D={};bt(Pu(V)?gP(V):V,(X,ce)=>{W.has(X)||(D[ce]=Y(X))}),B=D}return B})(q)})(m,q=>tt(q)?q.slice(0,R):q)),m.timestamp=h,le(r==null?void 0:r.timestamp)||(m.properties.$event_time_override_provided=!0,m.properties.$event_time_override_system_time=d),v&&(m.properties=((q,Z=[])=>{const W={},Y=V=>{q[V]!==void 0&&(W[V]=q[V])};return UN.forEach(Y),Z.forEach(Y),W})(m.properties,R$)),e===co.DISMISSED||e===co.SENT){const q=n==null?void 0:n[c1.SURVEY_ID],Z=n==null?void 0:n[c1.SURVEY_ITERATION];l5({id:q,current_iteration:Z}),m.$set=z(z({},m.$set),{},{[y$({id:q,current_iteration:Z},e===co.SENT?"responded":"dismissed")]:!0})}else e===co.SHOWN&&(m.$set=z(z({},m.$set),{},{[c1.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var R;if(e===n$.SHOWN){const q=n==null?void 0:n[IS.TOUR_TYPE];q&&(m.$set=z(z({},m.$set),{},{[`${IS.TOUR_LAST_SEEN_DATE}/${q}`]:new Date().toISOString()}))}const A=z(z({},m.properties.$set),m.$set);if(Nr(A)||this.setPersonPropertiesForFlags(A),!Xe(this.config.before_send)){const q=this.Os(m);if(!q)return;m=q,m.uuid=W6(m.uuid,ei)}const L=T.filter(({channel:q,update:Z})=>{var W,Y,V;const J=(W=(Y=m.$set)===null||Y===void 0?void 0:Y[q.property])!==null&&W!==void 0?W:st((V=m.properties)===null||V===void 0?void 0:V.$set)?m.properties.$set[q.property]:void 0;return(Z==null?void 0:Z.pending)&&J===Z.value});this.uu.emit("eventCaptured",m);const N=(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),F=(r==null?void 0:r._batchKey)==="recordings"||/\/s\/(?:\?|$)/.test(N),j=z(z(z({method:"POST",url:N,data:m,compression:"best-available",timestampMode:F?"body":"capture-body",batchKey:r==null?void 0:r._batchKey},F&&(!((i=m.properties)===null||i===void 0)&&i.$session_id)?{batchGroup:m.properties.$session_id+(m.properties.$window_id?`-${m.properties.$window_id}`:"")}:{}),r!=null&&r.transport?{transport:r.transport}:{}),L.length?{fireCallbackOnDrop:!0,callback:q=>{if(q.statusCode>=200&&300>q.statusCode)for(const{channel:Z,update:W}of L)this.oh(Z,W.value)}}:{});if(!this.config.request_batching||r&&!(r!=null&&r._batchKey)||r!=null&&r.send_instantly||L.length){var Q;let q;!j.transport&&!j.callback&&Nr((Q=this.config.request_headers)!==null&&Q!==void 0?Q:{})&&this.ku&&(q="sendBeacon"),this.Du(j,q)}else this.Ou.enqueue(j);return m}_addCaptureHook(e){return this.on("eventCaptured",n=>e(n.event,n))}getExtension(e){var n;return(n=this.Zu)===null||n===void 0?void 0:n.getExtension(e)}Uu(){var e;return(e=this.Zu)!==null&&e!==void 0?e:this.Zu=new I$(this)}cu(e){this.Iu.push(e);let n=!0;return()=>{if(!n)return;n=!1;const r=this.Iu.indexOf(e);r!==-1&&this.Iu.splice(r,1)}}hh(e=!0){var n,r,s;return!!(!((n=this.persistence)===null||n===void 0)&&n.consumeCookieIdentityChange())&&(this.Pu=null,this.persistence.get_property("$user_state")==="anonymous"&&((s=this.sessionPersistence)===null||s===void 0||s.clear(),this.Cu.clear(),this.dh()),(r=this.featureFlags)===null||r===void 0||r.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;this.persistence.syncCookieProperties(),this.hh();const o=i?void 0:this.persistence.remove_event_timer(e);let l=z({},n);if(l.token=this.config.token,l.$config_defaults=this.config.defaults,this.pu()&&(l[uP]=!0),e==="$snapshot"){const k=z(z({},this.persistence.properties()),this.sessionPersistence.properties());return l.distinct_id=k.distinct_id,(!tt(l.distinct_id)&&!Xt(l.distinct_id)||Hd(l.distinct_id))&&ge.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}const u=(function(k,C,T,I=!1){var M,R,A,L;if(!_r)return{};const N=k?[...mu,...C||[]]:[],[F,j]=A3(_r),[Q,q]=(function(se){for(let re=0;U6.length>re;re++){const[de,ye,fe]=U6[re],oe=se.match(de);if(oe){const je=fe&&se.match(fe)||oe;return[ye,(je==null?void 0:je[1])||""]}}return["",""]})(_r),Z=(function(){const se="u">typeof navigator?navigator:void 0;return se!=null&&se.brave?{brave:!0}:{}})(),W={};le(T)||(W.detectGoogleSearchApp=T);const Y={},V=(M=navigator)===null||M===void 0||(M=M.userAgentData)===null||M===void 0?void 0:M.platform,J=(R=navigator)===null||R===void 0?void 0:R.maxTouchPoints,B=ee==null||(A=ee.screen)===null||A===void 0?void 0:A.width,D=ee==null||(L=ee.screen)===null||L===void 0?void 0:L.height,X=ee==null?void 0:ee.devicePixelRatio;le(V)||(Y.userAgentDataPlatform=V),le(J)||(Y.maxTouchPoints=J),le(B)||(Y.screenWidth=B),le(D)||(Y.screenHeight=D),le(X)||(Y.devicePixelRatio=X);const ce=Rt(aw({$os:F,$os_version:j,$browser:I3(_r,navigator.vendor,Z,W),$webview_app:Q,$webview_app_version:q,$device:R3(_r),$device_type:fN(_r,Y),$timezone:jP(),$timezone_offset:J7()}),{$current_url:gf(I?ma(Bt==null?void 0:Bt.href):Bt==null?void 0:Bt.href,N,vf),$host:Bt==null?void 0:Bt.host,$pathname:Bt==null?void 0:Bt.pathname,$raw_user_agent:_r.length>1e3?_r.substring(0,997)+"...":_r,$browser_version:dN(_r,navigator.vendor,Z,W),$browser_language:LP(),$browser_language_prefix:Q7(),$screen_height:ee==null?void 0:ee.screen.height,$screen_width:ee==null?void 0:ee.screen.width,$viewport_height:ee==null?void 0:ee.innerHeight,$viewport_width:ee==null?void 0:ee.innerWidth,$lib:fo.LIB_NAME,$lib_version:fo.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return fo.SDK_DIST_CHANNEL&&(ce.$sdk_dist_channel=fo.SDK_DIST_CHANNEL),ce})(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){const{sessionId:k,windowId:C}=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime(),!0);l.$session_id=k,l.$window_id=C}this.sessionPropsManager&&Rt(l,this.sessionPropsManager.getSessionProps());try{var d;this.sessionRecording&&Rt(l,this.sessionRecording.sdkDebugProperties),l.$sdk_debug_retry_queue_size=(d=this.Lu)===null||d===void 0?void 0:d.length}catch(k){l.$sdk_debug_error_capturing_properties=String(k)}let h;if(this.requestRouter.region===m_&&(l.$lib_custom_api_host=this.config.api_host),h=e!=="$pageview"||i?e!=="$pageleave"||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),l=Rt(l,h),e==="$pageview"&&ue&&(l.title=ue.title),!le(o)){const k=r.getTime()-o;l.$duration=parseFloat((k/1e3).toFixed(3))}_r&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser");const p=this.persistence.properties(),m=this.sessionPersistence.properties(),v=l.$groups,w=p.$groups;st(v)&&!Nr(v)&&(l.$groups=z(z({},st(w)?w:{}),v)),bt(["$referrer","$referring_domain"],k=>{k in p&&delete m[k]});const _={};if(this.Iu.length>0)for(const k of this.Iu.slice())try{Rt(_,k())}catch(C){ge.error("Failed to produce browser extension event properties",C)}l=Rt({},u,p,m,z(z({},_),l)),l.$is_identified=this._isIdentified(),He(this.config.property_denylist)?bt(this.config.property_denylist,function(k){delete l[k]}):ge.error(c5+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);const x=this.config.sanitize_properties;x&&(ge.error(zS),l=x(l,e));const b=this.fh();return l.$process_person_profile=b,b&&!i&&this.ph("_calculate_event_properties"),l}uh(e,n=!0,r=!1){var s;if(!this.persistence||!this.fh()||this.xu&&!r)return e;const i=this.persistence.get_initial_props(),o=(s=this.sessionPropsManager)===null||s===void 0?void 0:s.getSetOnceProps();let l=Rt({},i,o||{},e||{});const u=this.config.sanitize_properties;return u&&(ge.error(zS),l=u(l,"$set_once")),n&&(this.xu=!0),Nr(l)?void 0:l}register(e,n){var r;(r=this.persistence)===null||r===void 0||r.register(e,n)}register_once(e,n,r){var s;(s=this.persistence)===null||s===void 0||s.register_once(e,n,r)}register_for_session(e){var n,r;(n=this.persistence)===null||n===void 0||n.syncCookieProperties(),this.hh(),(r=this.sessionPersistence)===null||r===void 0||r.register(e),Object.keys(e).forEach(s=>this.Cu.add(s)),this.dh()}unregister(e){var n;(n=this.persistence)===null||n===void 0||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(e),this.Cu.delete(e),this.dh()}gh(e,n){this.register({[e]:n})}Nu(){this.Cu.forEach(e=>{var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(e)}),this.Cu.clear(),this.dh()}dh(){var e;if(!this.$u)return;if(this.config.persistence==="memory"||!((e=this.sessionPersistence)===null||e===void 0)&&e.mi||!At.Et())return void At.Lt(this.$u);const n=[];this.Cu.forEach(r=>n.push(r)),n.length>0?At.At(this.$u,n):At.Lt(this.$u)}getFeatureFlag(e,n){var r;return(r=this.featureFlags)===null||r===void 0?void 0:r.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n;return(n=this.featureFlags)===null||n===void 0?void 0:n.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){var r;return(r=this.featureFlags)===null||r===void 0?void 0:r.getFeatureFlagResult(e,n)}getAllFeatureFlags(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,n){var r,s;return(r=(s=this.featureFlags)===null||s===void 0?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===void 0||e.reloadFeatureFlags()}updateFlags(e,n,r){var s;(s=this.featureFlags)===null||s===void 0||s.updateFlags(e,n,r)}updateEarlyAccessFeatureEnrollment(e,n,r){var s;(s=this.featureFlags)===null||s===void 0||s.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n=!1,r){var s;return(s=this.featureFlags)===null||s===void 0?void 0:s.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.uu.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:Pd}),()=>{})}onSessionId(e){var n,r;return(n=(r=this.sessionManager)===null||r===void 0?void 0:r.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n=!1){this.surveys?this.surveys.getSurveys(e,n):e([],{isLoaded:!1,error:Pd})}getActiveMatchingSurveys(e,n=!1){this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:Pd})}renderSurvey(e,n){var r;(r=this.surveys)===null||r===void 0||r.renderSurvey(e,n)}displaySurvey(e,n=S$){var r;(r=this.surveys)===null||r===void 0||r.displaySurvey(e,n)}cancelPendingSurvey(e){var n;(n=this.surveys)===null||n===void 0||n.cancelPendingSurvey(e)}canRenderSurvey(e){var n,r;return(n=(r=this.surveys)===null||r===void 0?void 0:r.canRenderSurvey(e))!==null&&n!==void 0?n:{visible:!1,disabledReason:Pd}}canRenderSurveyAsync(e,n=!1){var r,s;return(r=(s=this.surveys)===null||s===void 0?void 0:s.canRenderSurveyAsync(e,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:Pd})}mh(e){return!e||Hd(e)?(ge.critical("Unique user id has not been set in posthog.identify"),!1):e==="$posthog_cookieless"?(ge.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())||(ge.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 ge.uninitializedWarning("posthog.identify");if(Xt(e)&&(e=e.toString(),ge.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!this.mh(e)||!this.ph("posthog.identify"))return;this.bu();const s=this.get_distinct_id(),i=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,o=this.hh(!1),l=this.persistence.Rl();let u=!1;try{const h=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:h},""),e!==h&&e!==this.get_property("__alias")&&(this.unregister(V0),this.register({distinct_id:e}));const p=(this.persistence.get_property("$user_state")||"anonymous")===lo,m=e!==h,v=!m&&p;if(m&&p){var d;const w=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:h};this.persistence.set_property(wr,s0),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Al(),this.capture("$identify",w,{$set:n||{},$set_once:r||{}})&&(this.Pu=p1(e,n,r)),(d=this.featureFlags)===null||d===void 0||d.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:h)}else if(v){this.persistence.set_property(wr,s0);const w=n||{},_=r||{};this.setPersonPropertiesForFlags({$set:w,$set_once:_},!1),this.config.cookieWinsOnConflict&&this.persistence.Al(),this.capture("$set",{$set:w,$set_once:_})&&(this.Pu=p1(e,n,r))}else(n||r)&&this.setPersonProperties(n,r);m||i||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(ia)):v&&(n||r)&&this.reloadFeatureFlags(),u=!0}finally{l&&this.persistence.Dl(u)}}setPersonProperties(e,n){if(!e&&!n||!this.ph("posthog.setPersonProperties"))return;const r=p1(this.get_distinct_id(),e,n);this.Pu!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}})&&(this.Pu=r)):ge.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}unsetPersonProperties(e){var n;const r=(He(e)?e:[e]).filter(s=>tt(s)&&s.length>0);r.length!==0&&this.ph("posthog.unsetPersonProperties")&&((n=this.featureFlags)===null||n===void 0||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.Pu=null)}group(e,n,r){var s;if(!e||!n)return void ge.error("posthog.group requires a group type and group key");(s=this.persistence)===null||s===void 0||s.syncCookieProperties(),this.hh();const i=this.getGroups(),o=i[e]!==n;if(o&&this.resetGroupPropertiesForFlags(e),this.register({$groups:z(z({},i),{},{[e]:n})}),(o||r)&&this.fh()){const l={$group_type:e,$group_key:n};r&&(l.$group_set=r),this.capture(uS,l)}r&&this.setGroupPropertiesForFlags({[e]:r}),o&&!r&&this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n=!0){var r;(r=this.featureFlags)===null||r===void 0||r.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(e=!0){var n;(n=this.featureFlags)===null||n===void 0||n.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,n=!0){var r;this.ph("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)===null||r===void 0||r.setGroupPropertiesForFlags(e,n))}resetGroupPropertiesForFlags(e){var n;(n=this.featureFlags)===null||n===void 0||n.resetGroupPropertiesForFlags(e)}reset(e){const n=xr(e)?e:e==null?void 0:e.resetDeviceID,r=xr(e)||e==null?void 0:e.bootstrap;this.yh(n,!1,r)}yh(e,n=!1,r){var s,i,o,l,u,d;if(ge.info("reset"),!this.__loaded)return ge.uninitializedWarning("posthog.reset");const h=r==null?void 0:r.sessionID;this.config.bootstrap=r||((s=this.Au)===null||s===void 0?void 0:s.bootstrap)||{},(i=this.featureFlags)===null||i===void 0||(o=i.updateConfig)===null||o===void 0||o.call(i,this.config,this.Yl());const p=this.get_property(tw),m=this.get_property(Qv),v=this.get_property(Ud);(l=this.sessionRecording)===null||l===void 0||l.flushBeforeIdentityReset();const w=this.is_capturing();this.consent.reset(),n||!w||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");const _=(u=this.persistence)===null||u===void 0||(d=u.Rl)===null||d===void 0?void 0:d.call(u);let x=!1;try{var b,k,C,T,I,M,R,A,L,N,F,j,Q;if((b=this.persistence)===null||b===void 0||b.clear(),(k=this.sessionPersistence)===null||k===void 0||k.clear(),this.Cu.clear(),this.dh(),le(v)||(N=this.persistence)===null||N===void 0||N.register({$session_recording_remote_config:v}),(C=this.surveys)===null||C===void 0||C.reset(),(T=this.featureFlags)===null||T===void 0||T.reset(),(I=this.conversations)===null||I===void 0||I.reset(),(M=this.logs)===null||M===void 0||M.reset(),(R=this.metrics)===null||R===void 0||R.reset(),(A=this.persistence)===null||A===void 0||A.set_property("$user_state","anonymous"),(L=this.sessionManager)===null||L===void 0||L.resetSessionId(),this.Pu=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:Jv,$device_id:null},"");else{const W=this.config.get_device_id(ei());this.register_once({distinct_id:W,$device_id:e?W:p},""),e||le(m)||this.register({[Qv]:m})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),r&&(r.distinctID&&!this.pu()&&((Q=this.persistence)===null||Q===void 0||Q.set_property("$user_state",r.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:r.distinctID})),(F=this.featureFlags)===null||F===void 0||F.initialize(),!Xe(h)&&!(!((j=this.sessionManager)===null||j===void 0)&&j.setBootstrapSessionId(h,!0)))){const W=z({},r);delete W.sessionID,this.config.bootstrap=W}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,x=!0}finally{var q,Z;_&&((q=this.persistence)===null||q===void 0||(Z=q.Dl)===null||Z===void 0||Z.call(q,x))}this.reloadFeatureFlags()}shutdown(e){var n=this;return Mt(function*(){var r,s,i,o,l,u,d,h;if(n.__loaded){n.Su=!0,n.Uu().dispose(),(r=n.sessionRecording)===null||r===void 0||r.dispose(),(s=n.logs)===null||s===void 0||s.flushLogs("sendBeacon"),(i=n.metrics)===null||i===void 0||i.flush("sendBeacon"),(o=n.metrics)===null||o===void 0||o.dispose(),(l=n.Ou)===null||l===void 0||l.unload(),(u=n.Lu)===null||u===void 0||u.unload();try{var p;(p=n.featureFlags)===null||p===void 0||p.destroy()}catch(m){ge.error("Error while destroying feature flags",m)}(d=n.persistence)===null||d===void 0||d.destroy(),(h=n.sessionPersistence)===null||h===void 0||h.destroy()}else ge.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,n){var r;delete this.config.identity_claims,this.config.identity_distinct_id=e,this.config.identity_hash=n,this.alias(e),(r=this.conversations)===null||r===void 0||r.bh()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,(e=this.conversations)===null||e===void 0||e._h()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";const{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0);let s=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${n}`);if(e!=null&&e.withTimestamp&&r){var i;const o=(i=e.timestampLookBack)!==null&&i!==void 0?i:10;if(!r)return s;s+=`?t=${Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0)}`}return s}alias(e,n){return e===this.get_property("$people_distinct_id")?(ge.critical("Attempting to create alias for existing People user - aborting."),-2):this.ph("posthog.alias")?(le(n)&&(n=this.get_distinct_id()),e!==n?(this.gh(V0,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(ge.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){const n=z({},this.config);if(st(e)){var r,s,i,o,l,u,d,h,p,m,v,w,_,x;Rt(this.config,WS(e));const k=this._u();(r=this.persistence)===null||r===void 0||r.update_config(this.config,n,k),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new a1(z(z({},this.config),{},{persistence:"sessionStorage"}),k,!1);const C=this.Ru(this.config.debug);var b;xr(C)&&(this.config.debug=C),xr(this.config.debug)&&(this.config.debug?(Tn.DEBUG=!0,dt.Et()&&dt.At("ph_debug",!0),ge.info("set_config",{config:e,oldConfig:n,newConfig:z({},this.config)})):(Tn.DEBUG=!1,dt.Et()&&dt.Lt("ph_debug"))),(s=this.featureFlags)===null||s===void 0||(i=s.updateConfig)===null||i===void 0||i.call(s,this.config,this.Yl()),(o=this.exceptionObserver)===null||o===void 0||o.onConfigChange(),(l=this.exceptions)===null||l===void 0||l.onConfigChange(),(u=this.metrics)===null||u===void 0||u.onConfigChange(),(d=this.sessionRecording)===null||d===void 0||d.startIfEnabledOrStop(),(h=this.tracingHeaders)===null||h===void 0||h.startIfEnabledOrStop(),(p=this.autocapture)===null||p===void 0||p.startIfEnabled(),(m=this.heatmaps)===null||m===void 0||m.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&((b=this.historyAutocapture)===null||b===void 0||b.startIfEnabledOrStop()),(v=this.exceptionObserver)===null||v===void 0||v.startIfEnabledOrStop(),(w=this.deadClicksAutocapture)===null||w===void 0||w.startIfEnabledOrStop(),(_=this.surveys)===null||_===void 0||_.loadIfEnabled(),this.wu(),(x=this.externalIntegrations)===null||x===void 0||x.startIfEnabledOrStop(),!n.segment&&this.config.segment&&this.persistence&&kS(this,Yd,!1)}}_overrideSDKInfo(e,n){Tn.LIB_NAME=e,Tn.LIB_VERSION=n}startSessionRecording(e){const n=e===!0,r={sampling:n||!!(e!=null&&e.sampling),linked_flag:n||!!(e!=null&&e.linked_flag),url_trigger:n||!!(e!=null&&e.url_trigger),event_trigger:n||!!(e!=null&&e.event_trigger)};var s,i,o,l,u;Object.values(r).some(Boolean)&&((s=this.sessionManager)===null||s===void 0||s.checkAndGetSessionAndWindowId(),r.sampling&&((i=this.sessionRecording)===null||i===void 0||i.overrideSampling()),r.linked_flag&&((o=this.sessionRecording)===null||o===void 0||o.overrideLinkedFlag()),r.url_trigger&&((l=this.sessionRecording)===null||l===void 0||l.overrideTrigger("url")),r.event_trigger&&((u=this.sessionRecording)===null||u===void 0||u.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!!(!((e=this.sessionRecording)===null||e===void 0)&&e.started)}captureException(e,n){try{if(!this.exceptions)return;const r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(z(z({},r),n))}catch{return}}addExceptionStep(e,n){var r;(r=this.exceptions)===null||r===void 0||r.addExceptionStep(e,n)}captureLog(e){var n;(n=this.logs)===null||n===void 0||n.captureLog(e)}get logger(){var e,n;return(e=(n=this.logs)===null||n===void 0?void 0:n.logger)!==null&&e!==void 0?e:qo.wh}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||r===void 0?void 0:r.loadToolbar(e))!==null&&n!==void 0&&n}get_property(e){var n;return(n=this.persistence)===null||n===void 0?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)===null||n===void 0?void 0:n.props[e]}toString(){var e;let n=(e=this.config.name)!==null&&e!==void 0?e:Nd;return n!==Nd&&(n="posthog."+n),n}_isIdentified(){var e,n;return((e=this.persistence)===null||e===void 0?void 0:e.get_property("$user_state"))==="identified"||((n=this.sessionPersistence)===null||n===void 0?void 0:n.get_property("$user_state"))==="identified"}fh(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Nr(this.getGroups())&&!(!((e=this.persistence)===null||e===void 0||(e=e.props)===null||e===void 0)&&e.__alias)&&!(!((n=this.persistence)===null||n===void 0||(n=n.props)===null||n===void 0)&&n.$epp))}Xu(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&!!this.config.capture_pageview}createPersonProfile(){this.fh()||this.ph("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.ph("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}ph(e){return this.config.person_profiles==="never"?(ge.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.gu(),this.gh(sw,!0),!0)}_u(){if(this.config.cookieless_mode==="always")return!0;const e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!=="on_reject")}wu(){var e,n;const r=this._u();var s,i,o;return this.is_capturing()||(s=this.logs)===null||s===void 0||s.kh(),((e=this.persistence)===null||e===void 0?void 0:e.mi)!==r&&((i=this.persistence)===null||i===void 0||i.set_disabled(r)),((n=this.sessionPersistence)===null||n===void 0?void 0:n.mi)!==r&&((o=this.sessionPersistence)===null||o===void 0||o.set_disabled(r)),r&&(this.Cu.clear(),this.dh()),r}opt_in_capturing(e){var n;if(this.config.cookieless_mode!=="always"){if(this.pu()){var r,s,i,o,l,u;(r=this.sessionRecording)===null||r===void 0||r.dispose({discardBufferedEvents:!0}),this.yh(!0,!0),(s=this.sessionManager)===null||s===void 0||s.destroy(),(i=this.pageViewManager)===null||i===void 0||i.destroy(),this.sessionManager=new jS(this),this.pageViewManager=new CS(this),this.persistence&&(this.sessionPropsManager=new NS(this,this.sessionManager,this.persistence));const v=(o=(l=this.config.__extensionClasses)===null||l===void 0?void 0:l.sessionRecording)!==null&&o!==void 0?o:(u=qo.__defaultExtensionClasses)===null||u===void 0?void 0:u.sessionRecording;var d,h;v&&(this.sessionRecording=this.fu(this.sessionRecording,new v(this)),this.au&&((d=this.sessionRecording)===null||d===void 0||(h=d.onRemoteConfig)===null||h===void 0||h.call(d,this.au)))}var p,m;this.consent.optInOut(!0),this.wu(),this.Qu(),(n=this.sessionRecording)===null||n===void 0||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&((p=this.surveys)===null||p===void 0||p.loadIfEnabled()),(le(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.Ju()}else ge.warn(HS)}opt_out_capturing(){if(this.config.cookieless_mode==="always")return void ge.warn(HS);const e=this.config.cookieless_mode==="on_reject"?this.sessionRecording:void 0;var n,r;e==null||e.dispose({discardBufferedEvents:!0}),this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.yh(!0,!0),this.consent.optInOut(!1),this.wu(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:Jv,$device_id:null}),this.vu(e),this.sessionRecording=void 0,(n=this.sessionManager)===null||n===void 0||n.destroy(),(r=this.pageViewManager)===null||r===void 0||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Ju(),this.Qu())}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){const e=this.consent.consent;return e===1?"granted":e===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.wu()}_is_bot(){return $n?r5($n,this.config.custom_blocked_useragents):void 0}Ju(){ue&&(ue.visibilityState==="visible"?this.Tu||(this.Tu=!0,this.capture(ow,{title:ue.title},{send_instantly:!0}),this.Mu&&(ue.removeEventListener(hf,this.Mu),this.Mu=null)):this.Mu||(this.Mu=this.Ju.bind(this),yt(ue,hf,this.Mu)))}debug(e){e===!1?(ee==null||ee.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(ee==null||ee.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}))}Yl(){const e=this.Au||{};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?(ge.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,i,o){const l=r in n&&!Xe(n[r]),u=s in n&&!Xe(n[s]);return l?n[r]:!!u&&(o&&o.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,ge)}Os(e){var n;if(Xe(this.config.before_send))return e;const r=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(eN),s=He(this.config.before_send)?this.config.before_send:[this.config.before_send];let i=e;for(const o of s)try{if(i=o(i),Xe(i)){const l=`Event '${e.event}' was rejected in beforeSend function`;return JD(e.event)?ge.warn(`${l}. This can cause unexpected behavior.`):ge.info(l),null}i.properties&&!Nr(i.properties)||ge.warn(`Event '${e.event}' has no properties after beforeSend function, this is likely an error.`)}catch(l){return ge.error(`Error in beforeSend function for event '${e.event}':`,l),null}for(const o of r)if(i.properties&&Xe(i.properties[o]))return ge.warn(`Event '${e.event}' had its '${o}' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped.`),null;return i}getPageViewId(){var e;return(e=this.pageViewManager.Ho)===null||e===void 0?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(r)})}Ru(e){const n=xr(e)&&!e,r=dt.Et()&&dt.Ot("ph_debug")==="true";return!n&&(!!r||e)}};Xd.__defaultExtensionClasses={},Xd.wh=(()=>{const t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),(function(t,e){for(let n=0;e.length>n;n++)t.prototype[e[n]]=I7(t.prototype[e[n]])})(Xd,["identify"]);var u5=class{constructor(t){this.disabled=t===!1;const e=st(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,n){if(this.disabled)return!1;const r=this.clicks[this.clicks.length-1];if(r&&Math.abs(t-r.x)+Math.abs(e-r.y)<this.thresholdPx&&this.timeoutMs>n-r.timestamp){if(this.clicks.push({x:t,y:e,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:n}];return!1}};const v1="$copy_autocapture",Cp=qt("[AutoCapture]");function y1(t,e){return e.length>t?e.slice(0,t)+"...":e}function D$(t){if(t.previousElementSibling)return t.previousElementSibling;let e=t;do e=e.previousSibling;while(e&&!Ai(e));return e}function N$(t,{e,maskAllElementAttributes:n,maskAllText:r,elementAttributeIgnoreList:s,elementsChainAsString:i,disableCaptureUrlHashes:o}){var l,u;if(!Ai(t))return{props:{}};const d=[t],h=new Set([t]);let p=t;for(;p.parentNode&&!nr(p,"body")&&1e3>d.length;){if(lw(p.parentNode)){const M=p.parentNode.host;if(h.has(M))break;h.add(M),d.push(M),p=M;continue}if(!Ai(p.parentNode)||h.has(p.parentNode))break;h.add(p.parentNode),d.push(p.parentNode),p=p.parentNode}const m=e.type==="click"&&t.namespaceURI==="http://www.w3.org/2000/svg"?d.findIndex(M=>nr(M,"button")||nr(M,"a")):-1;m>0&&(r=r||d.slice(0,m+1).some(M=>!Uc(M)||mf(M)));const v=[],w={};let _,x=!1,b=!1;if(bt(d,M=>{const R=Uc(M);if(nr(M,"a")&&!n&&!(s!=null&&s.includes("href"))){const A=M.getAttribute("href");x=!!(R&&A&&qd(A))&&(o?ma(A):A)}ze(hu(M),"ph-no-capture")&&(b=!0),v.push((function(A,L,N,F,j=!1){const Q=A.tagName.toLowerCase(),q={tag_name:Q};uw.indexOf(Q)>-1&&!N&&(q.$el_text=Q.toLowerCase()==="a"||Q.toLowerCase()==="button"?y1(1024,bS(A)):y1(1024,pf(A)));const Z=hu(A);L||F!=null&&F.includes("class")||0>=Z.length||(q.classes=Z.filter(function(J){return J!==""})),bt(A.attributes,function(J){var B;if((!mf(A)||["name","id","class","aria-label"].indexOf(J.name)!==-1)&&!(F!=null&&F.includes(J.name))&&!L&&qd(J.value)&&(!tt(B=J.name)||B.substring(0,10)!=="_ngcontent"&&B.substring(0,7)!=="_nghost")){let D=J.value;J.name==="class"&&(D=cw(D).join(" ")),q["attr__"+J.name]=y1(1024,J.name==="href"&&j?ma(D):D)}});let W=1,Y=1,V=A;for(;V=D$(V);)W++,V.tagName===A.tagName&&Y++;return q.nth_child=W,q.nth_of_type=Y,q})(M,n,r,s,o)),bt((function(A){if(!Uc(A))return{};const L={};return bt(A.attributes,function(N){if(N.name&&N.name.indexOf("data-ph-capture-attribute")===0){const F=N.name.replace("data-ph-capture-attribute-",""),j=N.value;F&&j&&qd(j)&&(L[F]=j)}}),L})(M),(A,L)=>{({}).hasOwnProperty.call(w,L)||(w[L]=A)})}),b)return{props:{},explicitNoCapture:b};if(m>0&&(t=d[m],v.splice(0,m)),r||(v[0].$el_text=nr(t,"a")||nr(t,"button")?bS(t):pf(t)),x){var k,C;v[0].attr__href=x;const M=(k=ga(x))===null||k===void 0?void 0:k.host,R=ee==null||(C=ee.location)===null||C===void 0?void 0:C.host;M&&R&&M!==R&&(_=x)}return{props:Rt((I=e.type,{$event_type:I,$ce_version:1}),i?{}:{$elements:v},{$elements_chain:(T=v,He(T)?(function(M){return M.map(R=>{var A,L;let N="";if(R.tag_name&&(N+=R.tag_name),R.attr_class){R.attr_class.sort();for(const Q of R.attr_class)N+=`.${Q.replace(/"/g,"")}`}const F=z(z(z(z({},R.text?{text:R.text}:{}),{},{"nth-child":(A=R.nth_child)!==null&&A!==void 0?A:0,"nth-of-type":(L=R.nth_of_type)!==null&&L!==void 0?L:0},R.href?{href:R.href}:{}),R.attr_id?{attr_id:R.attr_id}:{}),R.attributes),j={};return i0(F).sort(([Q],[q])=>(function(Z,W){return W>Z?-1:Z>W?1:0})(Q,q)).forEach(([Q,q])=>j[SS(Q.toString())]=SS(q.toString())),N+=":",N+=i0(j).map(([Q,q])=>`${Q}="${q}"`).join(""),N}).join(";")})((function(M){return M.map(R=>{var A,L;const N={text:(A=R.$el_text)===null||A===void 0?void 0:A.slice(0,400),tag_name:R.tag_name,href:(L=R.attr__href)===null||L===void 0?void 0:L.slice(0,2048),attr_class:U7(R),attr_id:R.attr__id,nth_child:R.nth_child,nth_of_type:R.nth_of_type,attributes:{}};return i0(R).filter(([F])=>F.indexOf("attr__")===0).forEach(([F,j])=>N.attributes[F]=j),N})})(T)):"")},!((l=v[0])===null||l===void 0)&&l.$el_text?{$el_text:(u=v[0])===null||u===void 0?void 0:u.$el_text}:{},_&&e.type==="click"?{$external_click_url:_}:{},w),target:t};var T,I}var $$=class{ho(){this.co=void 0,clearTimeout(this.do),this.do=void 0}vo(t){var e;if(!Uc(t))return!0;const n=(e=this.fo().css_selector_ignorelist)!==null&&e!==void 0?e:i1,r=new Set;let s=t;for(;s;){if(r.size>=1e3||r.has(s))return!0;r.add(s);const i=s,o=hu(i);if(ze(o,"ph-no-capture")||ze(o,"ph-sensitive")||mf(i)||n.some(u=>l_(i,u)))return!0;const l=s.parentNode;s=lw(l)?l.host:l&&Ai(l)?l:null}return!1}po(t){if(!this.isEnabled||t.type==="pointercancel")return void this.ho();if(t.type==="pointerdown"){this.ho();const r=Zd(t);var e;return void(t.isPrimary&&t.button===0&&!t.ctrlKey&&r&&Ai(r)&&(this.co={target:r,excluded:this.vo(r),id:t.pointerId,x:t.clientX,y:t.clientY,released:!1,distinctId:(e=this.mo)===null||e===void 0?void 0:e.distinctId}))}const n=this.co;n&&(t.pointerId!==n.id||Math.abs(t.clientX-n.x)>5||Math.abs(t.clientY-n.y)>5?this.ho():t.type==="pointerup"&&(n.released=!0,this.do=setTimeout(()=>this.ho(),0)))}yo(t){var e;const n=this.co;this.ho();const r=Zd(t);if(n!=null&&n.released&&n.target.isConnected&&n.distinctId===((e=this.mo)===null||e===void 0?void 0:e.distinctId)&&t.pointerId===n.id&&(t.detail>0||t.pointerType==="touch"||t.pointerType==="pen")&&t.button===0&&5>=Math.abs(t.clientX-n.x)&&5>=Math.abs(t.clientY-n.y)&&r&&(nr(r,"html")||nr(r,"body"))){var s;if(n.excluded)return null;const i=(s=this.fo().css_selector_ignorelist)!==null&&s!==void 0?s:i1;return[r,ue==null?void 0:ue.documentElement,ue==null?void 0:ue.body].some(o=>{if(!o)return!1;const l=hu(o);return ze(l,"ph-no-capture")||ze(l,"ph-sensitive")||!Uc(o)||mf(o)||i.some(u=>l_(o,u))})?null:n.target}}constructor(t){this.bo=t,this.name="autocapture",this._o=!1,this.wo=null,this.ko=!1,this.So=!1,this.Ir={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.xo=!1,this.bo.refresh(this.Ir),this.rageclicks=new u5(this.Ir.rageclick),this.Co=null}setup(t){this.$o(),this.mo=t;const e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.xo?e.dispose():(this.Io=e,this.startIfEnabled())}dispose(){var t;this.xo||(this.xo=!0,this.mo=void 0,(t=this.Io)===null||t===void 0||t.dispose(),this.Io=void 0,this.To())}fo(){return this.bo.refresh(this.Ir),this.Ir}$o(){var t,e;return this.fo(),this.Ir.url_allowlist=(t=this.Ir.url_allowlist)===null||t===void 0?void 0:t.map(n=>new RegExp(n)),this.Ir.url_ignorelist=(e=this.Ir.url_ignorelist)===null||e===void 0?void 0:e.map(n=>new RegExp(n)),this.Ir}Mo(){if(!this.isBrowserSupported())return void Cp.info("Disabling Automatic Event Collection because this browser is not supported");if(!ee||!ue)return;const t=this.Eo=e=>{e=e||(ee==null?void 0:ee.event);try{if(e.type==="blur")return void this.ho();if(e.type.indexOf("pointer")===0)return void this.po(e);const n=e.type==="click"?this.yo(e):void 0;if(Kt(n))return;this.Po(e,"$autocapture",n)}catch(n){Cp.error("Failed to capture event",n)}};if(yt(ee,"blur",t),yt(ue,"submit",t,{capture:!0}),yt(ue,"change",t,{capture:!0}),yt(ue,"click",t,{capture:!0}),bt(["pointerdown","pointermove","pointerup","pointercancel"],e=>{yt(ue,e,t,{capture:!0})}),this.fo().capture_copied_text){const e=this.Ro=n=>{n=n||(ee==null?void 0:ee.event);try{this.Po(n,v1)}catch(r){Cp.error("Failed to capture clipboard event",r)}};yt(ue,"copy",e,{capture:!0}),yt(ue,"cut",e,{capture:!0}),yt(ue,"paste",e,{capture:!0})}}To(){this.ho(),this.Eo&&(ee==null||ee.removeEventListener("blur",this.Eo),bt(["pointerdown","pointermove","pointerup","pointercancel"],t=>{ue==null||ue.removeEventListener(t,this.Eo,!0)}),ue==null||ue.removeEventListener("submit",this.Eo,!0),ue==null||ue.removeEventListener("change",this.Eo,!0),ue==null||ue.removeEventListener("click",this.Eo,!0),this.Eo=void 0),this.Ro&&(ue==null||ue.removeEventListener("copy",this.Ro,!0),ue==null||ue.removeEventListener("cut",this.Ro,!0),ue==null||ue.removeEventListener("paste",this.Ro,!0),this.Ro=void 0),this._o=!1}startIfEnabled(){this.isEnabled||this.ho(),!this.xo&&this.mo&&this.isEnabled&&!this._o&&(this.Mo(),this._o=!0)}onRemoteConfig(t){if(this.xo)return;if(this.ko=!0,!t.ok)return void this.startIfEnabled();const e=t.config;e.elementsChainAsString&&(this.So=e.elementsChainAsString);const n=e.autocapture_opt_out;var r;xr(n)&&((r=this.mo)===null||r===void 0||r.kv.set("$autocapture_disabled_server_side",n),this.wo=n),this.startIfEnabled()}setElementSelectors(t){this.Co=t}getElementSelectors(t,e){var n;const r=[];return(n=this.Co)===null||n===void 0||n.forEach(s=>{const i=ue==null?void 0:ue.querySelectorAll(s);i==null||i.forEach(o=>{t!==o&&e!==o||ze(r,s)||r.push(s)})}),r}get isEnabled(){var t,e;if(this.xo)return!1;const n=(t=this.mo)===null||t===void 0?void 0:t.kv.get(J3),r=this.wo,s=this.fo();if(!s.remoteRequestsDisabled&&!this.ko)return!1;const i=s.remoteRequestsDisabled&&!this.ko;if(Kt(r)&&!xr(n)&&!i)return!1;const o=(e=this.wo)!==null&&e!==void 0?e:!!n;return!!s.enabled&&!o}Po(t,e="$autocapture",n){if(!this.isEnabled)return void this.ho();let r=n||Zd(t);wP(r)&&(r=r.parentNode||null);const s=this.$o();var i;e==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&s.rageclick&&(!((i=this.rageclicks)===null||i===void 0)&&i.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime()))&&EP(r,s.rageclick)&&this.Po(t,"$rageclick",n);const o=e===v1,l=o?z(z({},s),{},{dom_event_allowlist:void 0}):s;if(r&&(function(p,m,v,w,_,x){var b;if(!ee||dw(p)||v!=null&&v.url_allowlist&&!mS(v.url_allowlist,x)||v!=null&&v.url_ignorelist&&mS(v.url_ignorelist,x))return!1;if(v!=null&&v.dom_event_allowlist){const I=v.dom_event_allowlist;if(I&&!I.some(M=>m.type===M))return!1}const{parentIsUsefulElement:k,targetElementList:C}=kP(p,w);if(!(function(I,M){const R=M==null?void 0:M.element_allowlist;if(le(R))return!0;for(const A of I)if(R.some(L=>A.tagName.toLowerCase()===L))return!0;return!1})(C,v)||!c_(C,v==null?void 0:v.css_selector_allowlist)||c_(C,(b=v==null?void 0:v.css_selector_ignorelist)!==null&&b!==void 0?b:i1))return!1;try{const I=ee.getComputedStyle(p);if(I&&I.getPropertyValue("cursor")==="pointer"&&m.type==="click")return!0}catch{}const T=p.tagName.toLowerCase();switch(T){case"html":return!1;case"form":return(_||["submit"]).indexOf(m.type)>=0;case"input":case"select":case"textarea":return(_||["change","click"]).indexOf(m.type)>=0;default:return k?(_||["click"]).indexOf(m.type)>=0:(_||["click"]).indexOf(m.type)>=0&&(uw.indexOf(T)>-1||p.getAttribute("contenteditable")==="true")}})(r,t,l,o,o?["copy","cut","paste"]:void 0,{config:{get_current_url:s.getCurrentUrl}})){var u;const{props:p,explicitNoCapture:m,target:v}=N$(r,{e:t,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this.So,disableCaptureUrlHashes:s.disableCaptureUrlHashes});if(m)return!1;const w=this.getElementSelectors(r,v);if(w&&w.length>0&&(p.$element_selectors=w),e===v1){const _=t.type||"clipboard";if(_!=="paste"){var d,h;const x=ee==null||(d=ee.getSelection())===null||d===void 0?void 0:d.toString(),b=xP(x);if(!b)return!1;p.$selected_content=b,p.$clipboard_text_length=(h=x==null?void 0:x.length)!==null&&h!==void 0?h:0}p.$copy_type=_}return(u=this.mo)===null||u===void 0||u.capture(e,p).catch(_=>Cp.error("Failed to capture event",_)),!0}}isBrowserSupported(){return Nn(ue==null?void 0:ue.querySelectorAll)}},j$=class{constructor(t){this._instance=t}refresh(t){const e=this._instance.config,n=st(e.autocapture)?e.autocapture:void 0;t.enabled=!!e.autocapture,t.rageclick=e.rageclick,t.maskAllElementAttributes=e.mask_all_element_attributes,t.maskAllText=e.mask_all_text,t.disableCaptureUrlHashes=e.disable_capture_url_hashes,t.getCurrentUrl=e.get_current_url,t.remoteRequestsDisabled=this._instance.Yl(),t.url_allowlist=n==null?void 0:n.url_allowlist,t.url_ignorelist=n==null?void 0:n.url_ignorelist,t.dom_event_allowlist=n==null?void 0:n.dom_event_allowlist,t.element_allowlist=n==null?void 0:n.element_allowlist,t.css_selector_allowlist=n==null?void 0:n.css_selector_allowlist,t.css_selector_ignorelist=n==null?void 0:n.css_selector_ignorelist,t.element_attribute_ignorelist=n==null?void 0:n.element_attribute_ignorelist,t.capture_copied_text=n==null?void 0:n.capture_copied_text}};const Td=qt("[ExceptionAutocapture]"),ZS=()=>{},qS=t=>{var e;if(Nn(t))return(e=t.__posthog_layer__)!==null&&e!==void 0?e:t.__rrweb_layer__};function yf(t,e,n){try{if(!(e in t))return ZS;const r={next:t[e]},s=n(function(...i){return r.next.apply(this,i)});return Nn(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),t[e]=s,()=>{if(t[e]===s)return void(t[e]=r.next);let i=t[e],o=qS(i);for(;o;){if(o.next===s)return void(o.next=r.next);i=o.next,o=qS(i)}}}catch{return ZS}}const F$=qt("[TracingHeaders]"),Ja=qt("[Web Vitals]"),GS=9e5,KS=["CLS","FCP","INP","LCP"],V$=["INP","LCP"],H$=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],_1="disabled",YS="lazy_loading",Gi=qt("[SessionRecording]"),z$=qt("[Heatmaps]");function w1(t){return st(t)&&"clientX"in t&&"clientY"in t&&Xt(t.clientX)&&Xt(t.clientY)}const Pp=qt("[Product Tours]"),x1=t=>{var e;return!t.config.disable_product_tours&&!!(!((e=t.persistence)===null||e===void 0)&&e.get_property(rw))},B$=["$set_once","$set"],di=qt("[SiteApps]"),XS="Error while initializing PostHog app with config id ",d5=(t,e)=>t!=null&&t.then?t.then(e):e(t),Sc="SDK is not enabled or survey functionality is not yet loaded",QS="Disabled. Not loading surveys.";var U$=class{constructor(t,e){this.bo=t,this.Sh=e,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.xh=!1,this.Ch=[],this.$h=null,this.Ih=null,this.xo=!1,this.Th=new Set,this.onRemoteConfig=n=>{if(this.xo||this.Ir.disableSurveys)return;if(!n.ok)return wt.warn("Remote config unavailable. Not loading surveys.");const r=n.config.surveys;if(Xe(r))return wt.warn("Flags not loaded yet. Not loading surveys.");this.Mh=xr(r)?r:r.length>0,wt.info(`flags response received, isSurveysEnabled: ${this.Mh}`),this.loadIfEnabled()}}setup(t){if(!this.xo)return this.Eh=t,d5(t.kv.initialize(),()=>{if(this.Eh!==t||this.xo)return;this.Eh=void 0,this.mo=t;const e=t.onRemoteConfig(this.onRemoteConfig);this.xo?e.dispose():(this.Io=e,this.loadIfEnabled())})}dispose(){var t,e,n,r;this.xo||(this.xo=!0,this.Eh=void 0,this.mo=void 0,(t=this.Io)===null||t===void 0||t.dispose(),this.Io=void 0,(e=this._surveyEventReceiver)===null||e===void 0||e.dispose(),this._surveyEventReceiver=null,(n=this._surveyManager)===null||n===void 0||(r=n.dispose)===null||r===void 0||r.call(n),this._surveyManager=null,this.Ch=[],this.$h=null,this.Th.forEach(s=>clearTimeout(s)),this.Th.clear())}get Ir(){return this.bo.get()}initialize(){this.loadIfEnabled()}reset(){try{var t;(t=this._surveyEventReceiver)===null||t===void 0||t.reset(),localStorage.removeItem("lastSeenSurveyDate");const e=[];for(let n=0;n<localStorage.length;n++){const r=localStorage.key(n);(r!=null&&r.startsWith("seenSurvey_")||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach(n=>localStorage.removeItem(n))}catch{}}loadIfEnabled(){if(this.xo||!this.mo)return;const t=this.Ir;if(this._surveyManager)return;if(this.xh)return void wt.info("Already initializing surveys, skipping...");if(t.disableSurveys)return void wt.info(QS);if(t.cookielessMode&&this.bo.isOptedOut())return void wt.info("Not loading surveys in cookieless mode without consent.");const e=this.bo.getExtensions();if(!e)return void wt.error("PostHog Extensions not found.");if(le(this.Mh)&&!t.advancedEnableSurveys)return;const n=this.Mh||t.advancedEnableSurveys;this.xh=!0;try{const r=e.generateSurveys;if(r)return this.Ph(r,n),void(this.xh=!1);const s=e.loadExternalDependency;if(!s)return this.Rh(iw),void(this.xh=!1);s(i=>{try{if(this.xo)return;const o=this.bo.getExtensions();i||!(o!=null&&o.generateSurveys)?this.Rh("Could not load surveys script",i):this.Ph(o.generateSurveys,n)}finally{this.xh=!1}})}catch(r){throw this.xh=!1,this.Rh("Error initializing surveys",r),r}}Ph(t,e){this.xo||(this._surveyManager=t(e),this._surveyEventReceiver=this.bo.createEventReceiver(),wt.info("Surveys loaded successfully"),this.Ah({isLoaded:!0}))}Rh(t,e){wt.error(t,e),this.Ah({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Ch.push(t),this._surveyManager&&this.Ah({isLoaded:!0}),()=>{this.Ch=this.Ch.filter(e=>e!==t)}}getSurveys(t,e=!1){var n;const r=(n=this.mo)!==null&&n!==void 0?n:this.Sh;if(!r||this.xo)return;if(this.Ir.disableSurveys)return wt.info(QS),t([]);const s=r.kv.get(n_);if(s&&!e)return t(s,{isLoaded:!0}),void(this.Fh()&&this.getSurveys(()=>{},!0));if(this.$h)return void this.$h.then(({surveys:l,context:u})=>{this.xo||t(l,u)}).catch(l=>wt.error("Error in survey callback",l));const i=this.Oh("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this.Ir.requestTimeoutMs}).then(l=>{try{return this.Dh(r,l)}catch(u){return wt.error("Error processing surveys response",u),this.Dh(r,{statusCode:0,error:u})}},l=>this.Dh(r,{statusCode:0,error:l}));this.$h=i;const o=()=>{this.$h===i&&(this.$h=null)};i.then(l=>{o(),this.xo||t(l.surveys,l.context)},o).catch(l=>wt.error("Error in survey callback",l))}Oh(t,e){const n=this.mo;return n?n.sendRequest(t,e):new Promise(r=>r({statusCode:0,error:new Error(Sc)}))}Dh(t,e){if(this.xo)return{surveys:[],context:{isLoaded:!1,error:Sc}};const n=e.statusCode;if(n!==200||!e.json){const o=`Surveys API could not be loaded, status: ${n}`;return n!==0?wt.error(o):e.error||wt.warn(o),this.Ih=Date.now(),{surveys:[],context:{isLoaded:!1,error:o}}}this.Ih=null;const r=e.json.surveys||[],s=r.filter(o=>(function(l){return!(!l.start_date||l.end_date)})(o)&&(i5(o)||(function(l){var u;return!!(!((u=l.conditions)===null||u===void 0||(u=u.actions)===null||u===void 0||(u=u.values)===null||u===void 0)&&u.length)})(o)));var i;return s.length>0&&((i=this._surveyEventReceiver)===null||i===void 0||i.register(s)),t.kv.set({[n_]:r,[H0]:Date.now()}),{surveys:r,context:{isLoaded:!0}}}Fh(){return this.Lh()&&!this.$h&&!this.Nh()}Lh(){var t,e;const n=(t=(e=this.mo)!==null&&e!==void 0?e:this.Sh)===null||t===void 0?void 0:t.kv.get(H0);return Xt(n)&&Date.now()-n>3e5}Nh(){return Xt(this.Ih)&&3e5>Date.now()-this.Ih}markSurveyAsSeen(t,e){var n;const r={id:t,current_iteration:(n=e==null?void 0:e.iteration)!==null&&n!==void 0?n:null};l5(r);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}Ah(t){for(const e of this.Ch)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(n){wt.error("Error in survey callback",n)}}getActiveMatchingSurveys(t,e=!1){if(!Xe(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);wt.warn("init was not called")}qh(t){let e=null;return this.getSurveys(n=>{var r;e=(r=n.find(s=>s.id===t))!==null&&r!==void 0?r:null}),e}jh(t){if(Xe(this._surveyManager))return{eligible:!1,reason:Sc};const e=typeof t=="string"?this.qh(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}Bh(t){if(!this.bo.isCapturing())return{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"};if(Xe(this._surveyManager))return{eligible:!1,reason:Sc};const e=typeof t=="string"?this.qh(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Xe(this._surveyManager))return wt.warn("init was not called"),{visible:!1,disabledReason:Sc};const e=this.Bh(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Xe(this._surveyManager)?(wt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Sc})):new Promise(n=>{this.getSurveys(r=>{var s;const i=(s=r.find(o=>o.id===t))!==null&&s!==void 0?s:null;if(i){const o=this.Bh(i);n({visible:o.eligible,disabledReason:o.reason})}else n({visible:!1,disabledReason:"Survey not found"})},e)})}renderSurvey(t,e,n){var r;if(!this.bo.isCapturing())return;if(Xe(this._surveyManager))return void wt.warn("init was not called");const s=typeof t=="string"?this.qh(t):t;if(!(s!=null&&s.id))return void wt.warn("Survey not found");if(!b$.includes(s.type))return void wt.warn(`Surveys of type ${s.type} cannot be rendered in the app`);const i=ue==null?void 0:ue.querySelector(e);if(i){if(!((r=s.appearance)===null||r===void 0)&&r.surveyPopupDelaySeconds){wt.info(`Rendering survey ${s.id} with delay of ${s.appearance.surveyPopupDelaySeconds} seconds`);const o=setTimeout(()=>{var l,u;this.Th.delete(o),!this.xo&&this.bo.isCapturing()&&(wt.info(`Rendering survey ${s.id} with delay of ${(l=s.appearance)===null||l===void 0?void 0:l.surveyPopupDelaySeconds} seconds`),(u=this._surveyManager)===null||u===void 0||u.renderSurvey(s,i,n),wt.info(`Survey ${s.id} rendered`))},1e3*s.appearance.surveyPopupDelaySeconds);return void this.Th.add(o)}this._surveyManager.renderSurvey(s,i,n)}else wt.warn("Survey element not found")}displaySurvey(t,e){var n;if(!this.bo.isCapturing())return;if(Xe(this._surveyManager))return void wt.warn("init was not called");const r=this.qh(t);if(!r)return void wt.warn("Survey not found");let s=r;if(!((n=r.appearance)===null||n===void 0)&&n.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=z(z({},r),{},{appearance:z(z({},r.appearance),{},{surveyPopupDelaySeconds:0})})),e.displayType!==u_.Popover&&e.initialResponses&&wt.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){const i=this.jh(r);if(!i.eligible)return void wt.warn("Survey is not eligible to be displayed: ",i.reason)}e.displayType!==u_.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}cancelPendingSurvey(t){Xe(this._surveyManager)?wt.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t,e;(t=this._surveyManager)===null||t===void 0||(e=t.handlePageUnload)===null||e===void 0||e.call(t)}};function Ec(t,e,n){if(Xe(t))return!1;switch(n){case"exact":return t===e;case"contains":{const 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}}var W$=class{constructor(t){this._instance=t,this.Hh=new Set,this.zh=new Set,this.Uh=new G0,this.Wh=(e,n)=>this.Vh(e,n)&&this.Gh(e,n)&&this.Zh(e,n)&&this.Qh(e,n),this.Vh=(e,n)=>!(n!=null&&n.event)||(e==null?void 0:e.event)===(n==null?void 0:n.event)}init(){var t,e;le((t=this._instance)===null||t===void 0?void 0:t._addCaptureHook)||(this.Jh=(e=this._instance)===null||e===void 0?void 0:e._addCaptureHook((n,r)=>{this.on(n,r)}))}dispose(){var t;(t=this.Jh)===null||t===void 0||t.call(this),this.Jh=void 0,this.Uh=new G0}register(t){var e,n;if(!le((e=this._instance)===null||e===void 0?void 0:e._addCaptureHook)&&(t.forEach(r=>{var s;this.Hh.add(r),(s=r.steps)===null||s===void 0||s.forEach(i=>{this.zh.add((i==null?void 0:i.event)||"")})}),(n=this._instance)===null||n===void 0?void 0:n.autocapture)){const r=new Set;this.Hh.forEach(s=>{var i;(i=s.steps)===null||i===void 0||i.forEach(o=>{o!=null&&o.selector&&r.add(o.selector)})}),this._instance.autocapture.setElementSelectors(r)}}replace(t){this.Hh.clear(),this.zh.clear(),this.register(t)}on(t,e){e!=null&&t.length!=0&&(this.zh.has(t)||this.zh.has(e.event))&&this.Hh.forEach(n=>{this.Kh(e,n)&&this.Uh.emit("actionCaptured",n.name)})}Xh(t){this.onAction("actionCaptured",e=>t(e))}Kh(t,e){if((e==null?void 0:e.steps)==null)return!1;for(const n of e.steps)if(this.Wh(t,n))return!0;return!1}onAction(t,e){return this.Uh.on(t,e)}Gh(t,e){if(e!=null&&e.url){var n;const r=t==null||(n=t.properties)===null||n===void 0?void 0:n.$current_url;if(!r||typeof r!="string"||!Ec(r,e.url,e.url_matching||"contains"))return!1}return!0}Zh(t,e){return!!this.Yh(t,e)&&!!this.tc(t,e)&&!!this.ec(t,e)}Yh(t,e){var n;if(!(e!=null&&e.href))return!0;const r=this.nc(t);if(r.length>0)return r.some(i=>Ec(i.href,e.href,e.href_matching||"exact"));const s=(t==null||(n=t.properties)===null||n===void 0?void 0:n.$elements_chain)||"";return!!s&&Ec((function(i){const o=i.match(/(?::|")href="(.*?)"/);return o?o[1]:""})(s),e.href,e.href_matching||"exact")}tc(t,e){var n;if(!(e!=null&&e.text))return!0;const r=this.nc(t);if(r.length>0)return r.some(u=>Ec(u.text,e.text,e.text_matching||"exact")||Ec(u.$el_text,e.text,e.text_matching||"exact"));const s=(t==null||(n=t.properties)===null||n===void 0?void 0:n.$elements_chain)||"";return!!s&&(i=(function(u){const d=[],h=/(?::|")text="(.*?)"/g;let p;for(;!Xe(p=h.exec(u));)d.includes(p[1])||d.push(p[1]);return d})(s),o=e.text,l=e.text_matching||"exact",i.some(u=>Ec(u,o,l)));var i,o,l}ec(t,e){var n,r;if(!(e!=null&&e.selector))return!0;const s=t==null||(n=t.properties)===null||n===void 0?void 0:n.$element_selectors;if(s!=null&&s.includes(e.selector))return!0;const i=(t==null||(r=t.properties)===null||r===void 0?void 0:r.$elements_chain)||"";if(e.selector_regex&&i)try{return new RegExp(e.selector_regex).test(i)}catch{return!1}return!1}nc(t){var e;return(t==null||(e=t.properties)===null||e===void 0?void 0:e.$elements)==null?[]:t==null?void 0:t.properties.$elements}Qh(t,e){return!(e!=null&&e.properties)||e.properties.length===0||a5(e.properties.reduce((n,r)=>{const s=He(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return n[r.key]={values:s,operator:r.operator||"exact"},n},{}),t==null?void 0:t.properties)}},Z$=class{constructor(t){var e,n;this.sc=[],this._instance=t,this.rc=new Map,this.oc=new Map,this.lc=new Map,this.ac=(e=this._instance)===null||e===void 0||(n=e.onSessionId)===null||n===void 0?void 0:n.call(e,r=>this.uc(r))}hc(t){return!1}cc(){return null}dc(t){}vc(){}fc(t,e){return!!t&&a5(t.propertyFilters,e==null?void 0:e.properties)}gc(t,e){const n=new Map;return t.forEach(r=>{var s;(s=r.conditions)===null||s===void 0||(s=s[e])===null||s===void 0||(s=s.values)===null||s===void 0||s.forEach(i=>{if(i!=null&&i.name){const o=n.get(i.name)||[];o.push(r.id),n.set(i.name,o)}})}),n}mc(t,e,n){const r=(n===Ed.Activation?this.rc:this.oc).get(t);let s=[];return this.yc(i=>{s=i.filter(o=>r==null?void 0:r.includes(o.id))}),s.filter(i=>{var o;const l=(o=i.conditions)===null||o===void 0||(o=o[n])===null||o===void 0||(o=o.values)===null||o===void 0?void 0:o.find(u=>u.name===t);return this.fc(l,e)})}register(t){this.bc(t,!1)}replace(t){this.bc(t,!0)}bc(t,e){var n;le((n=this._instance)===null||n===void 0?void 0:n._addCaptureHook)||(this._c(t,e),this.wc(t,e))}wc(t,e){const n=t.filter(i=>{var o;return(o=i.conditions)===null||o===void 0||(o=o.actions)===null||o===void 0||(o=o.values)===null||o===void 0?void 0:o.length});var r;if(e&&this.lc.clear(),n.length===0)return void(e&&((r=this.kc)===null||r===void 0||r.replace([])));this.kc||(this.kc=new W$(this._instance),this.kc.init(),this.kc.Xh(i=>this.onAction(i)));const s=[];n.forEach(i=>{var o;(o=i.conditions)===null||o===void 0||(o=o.actions)===null||o===void 0||o.values.forEach(l=>{if(s.push(l),l.name){var u;const d=(u=this.lc.get(l.name))!==null&&u!==void 0?u:[];d.includes(i.id)||d.push(i.id),this.lc.set(l.name,d)}})}),e?this.kc.replace(s):this.kc.register(s)}Sc(t,e){e.forEach((n,r)=>{var s;const i=(s=t.get(r))!==null&&s!==void 0?s:[];n.forEach(o=>{i.includes(o)||i.push(o)}),t.set(r,i)})}_c(t,e){var n,r;const s=t.filter(u=>{var d,h;return((d=u.conditions)===null||d===void 0?void 0:d.events)&&((h=u.conditions)===null||h===void 0||(h=h.events)===null||h===void 0||(h=h.values)===null||h===void 0?void 0:h.length)>0}),i=t.filter(u=>{var d,h;return((d=u.conditions)===null||d===void 0?void 0:d.cancelEvents)&&((h=u.conditions)===null||h===void 0||(h=h.cancelEvents)===null||h===void 0||(h=h.values)===null||h===void 0?void 0:h.length)>0}),o=this.gc(t,Ed.Activation),l=this.gc(t,Ed.Cancellation);e?(this.rc=o,this.oc=l):(this.Sc(this.rc,o),this.Sc(this.oc,l)),(s.length!==0||i.length!==0)&&((n=this.Jh)!==null&&n!==void 0||(this.Jh=(r=this._instance)===null||r===void 0?void 0:r._addCaptureHook((u,d)=>{this.onEvent(u,d)})))}onEvent(t,e){var n,r;const s=this.xc(),i=(e==null||(n=e.properties)===null||n===void 0?void 0:n.$survey_id)||(e==null||(r=e.properties)===null||r===void 0?void 0:r.$product_tour_id);if(i&&this.getActivatedIds().includes(i)){const l=this.Cc(t,i);if(l==="consume")return s.info("event consumed activated item, removing it",{event:t,itemId:i}),void this.$c([i]);if(l==="persist")return s.info("shown item promoted to persisted activation",{event:t,itemId:i}),this.Ic(i),void this.Tc([i])}if(this.oc.has(t)){const l=this.mc(t,e,Ed.Cancellation);l.length>0&&(s.info("cancel event matched, cancelling items",{event:t,itemsToCancel:l.map(u=>u.id)}),this.$c(l.map(u=>u.id)),l.forEach(u=>this.Mc(u.id)))}if(!this.rc.has(t))return;s.info("event name matched",{event:t,eventPayload:e,items:this.rc.get(t)});const o=this.mc(t,e,Ed.Activation);this.Ec(o.map(l=>l.id))}onAction(t){this.lc.has(t)&&this.Ec(this.lc.get(t)||[])}Ec(t){var e,n;if(t.length===0)return;const r=!!(!((e=this._instance)===null||e===void 0||(n=e.get_session_id)===null||n===void 0)&&n.call(e)),s=[];for(const i of t)r&&this.hc(i)?this.Ic(i)&&this.Pc(i):s.push(i);s.length>0&&(this.sc=[...new Set([...this.sc,...s])]),this.xc().info("updating activated items",{activatedItems:this.getActivatedIds()})}Ic(t){this.sc=this.sc.filter(n=>n!==t);const e=this.Rc();return!e.includes(t)&&(this.Ac([...e,t]),this.Fc(),!0)}$c(t){const e=new Set(t);this.sc=this.sc.filter(s=>!e.has(s));const n=this.Oc(),r=n.filter(s=>!e.has(s));r.length!==n.length&&(this.Ac(r),r.length===0&&this.Dc()),this.Tc(t)}Lc(){var t;const e=this.cc();if(!e)return{};const n=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.props[e];return n&&typeof n=="object"?n:{}}Pc(t){if(!this.cc())return;const e=this.Lc();this.dc(z(z({},e),{},{[t]:Date.now()}))}Tc(t){if(!this.cc())return;const e=this.Lc(),n={};let r=!1;for(const[s,i]of Object.entries(e))t.includes(s)?r=!0:n[s]=i;r&&(Nr(n)?this.vc():this.dc(n))}Nc(){this.cc()&&this.vc()}getActivationTimestamp(t){if(!this.Rc().includes(t))return;const e=this.Lc()[t];return Xt(e)?e:void 0}Oc(){var t;const e=this.qc();return((t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.props[e])||[]}Rc(){var t,e,n;const r=this.Oc();if(r.length===0)return[];const s=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.props[this.jc()],i=(e=this._instance)===null||e===void 0||(n=e.get_session_id)===null||n===void 0?void 0:n.call(e);return i&&s===i?r:[]}Fc(){var t,e;const n=(t=this._instance)===null||t===void 0||(e=t.get_session_id)===null||e===void 0?void 0:e.call(t);n&&this.Bc(n)}Dc(){this.Hc()}uc(t){var e;const n=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.props[this.jc()];if(n&&n!==t){const r=this.Oc(),s=this.Lc();r.length>0&&(this.Ac([]),r.filter(i=>Xt(s[i])).forEach(i=>this.Mc(i))),this.Dc(),this.Nc()}}getActivatedIds(){return[...new Set([...this.Rc(),...this.sc])].filter(t=>!this.zc(t))}dispose(){var t,e,n;(t=this.ac)===null||t===void 0||t.call(this),this.ac=void 0,(e=this.Jh)===null||e===void 0||e.call(this),this.Jh=void 0,(n=this.kc)===null||n===void 0||n.dispose(),this.kc=void 0}reset(){this.sc=[],this.Oc().length>0&&this.Ac([]),this.Dc(),this.Nc()}getEventToItemsMap(){return this.rc}Uc(){return this.kc}},q$=class extends Z${constructor(t){super(t)}qc(){return iP}jc(){return oP}cc(){return aP}dc(t){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.register({$surveys_activated_timestamps:t})}vc(){var t;(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||t.unregister("$surveys_activated_timestamps")}hc(t){var e;let n;this.yc(s=>{n=s.find(i=>i.id===t)});const r=n==null||(e=n.appearance)===null||e===void 0?void 0:e.surveyPopupDelaySeconds;return Xt(r)&&r>0}Wc(){return co.SHOWN}yc(t){var e;(e=this._instance)===null||e===void 0||e.getSurveys(t)}Mc(t){var e;(e=this._instance)===null||e===void 0||e.cancelPendingSurvey(t)}xc(){return wt}Ac(t){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.register({$surveys_activated:t})}Bc(t){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.register({$surveys_activated_session:t})}Hc(){var t;(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||t.unregister("$surveys_activated_session")}zc(){return!1}Cc(t,e){let n;return this.yc(r=>{n=r.find(s=>s.id===e)}),!n||(function(r){var s;return i5(r)&&!!(!((s=r.conditions)===null||s===void 0||(s=s.events)===null||s===void 0)&&s.repeatedActivation)||r.schedule==="always"})(n)?t===co.SHOWN?"consume":"ignore":t===co.SHOWN?"persist":t===co.DISMISSED||t===co.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},G$=class{constructor(t){this._instance=t}initialize(){}get(t){if(typeof t=="string")return this._instance.get_property(t);const e={};for(const n of t){const r=this._instance.get_property(n);le(r)||(e[n]=r)}return e}set(t,e){this._instance.register(typeof t=="string"?{[t]:e}:t)}remove(t){typeof t!="string"?t.forEach(e=>this._instance.unregister(e)):this._instance.unregister(t)}},K$=class{constructor(e){this._instance=e}get(){const e=this._instance.config;return{disableSurveys:e.disable_surveys,cookielessMode:!!e.cookieless_mode,advancedEnableSurveys:e.advanced_enable_surveys,requestTimeoutMs:e.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}isCapturing(){return this._instance.is_capturing()}getExtensions(){const e=Le==null?void 0:Le.__PosthogExtensions__;if(!e)return;const{generateSurveys:n,loadExternalDependency:r}=e;return{generateSurveys:n?s=>n(this._instance,s):void 0,loadExternalDependency:r?s=>r(this._instance,"surveys",s):void 0}}createEventReceiver(){return new q$(this._instance)}};const Y$=ee!=null&&ee.location?W0(ee.location.hash,"__posthog")||W0(location.hash,"state"):null,JS="_postHogToolbarParams",e8=qt("[Toolbar]"),t8=qt("[FeatureFlags]");var X$=class{constructor(t,e=!1){this.Vc=!1,this.update(t,e)}update(t,e){this.Gc=((n,r)=>{var s,i,o,l,u,d,h;return{bootstrap:{featureFlags:(s=(i=n.bootstrap)===null||i===void 0?void 0:i.featureFlags)!==null&&s!==void 0?s:void 0,featureFlagPayloads:(o=(l=n.bootstrap)===null||l===void 0?void 0:l.featureFlagPayloads)!==null&&o!==void 0?o:void 0},remoteRequestsDisabled:r,featureFlagsDisabled:!!n.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!n.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!n.advanced_feature_flags_dedup_per_session,cacheTtlMs:n.feature_flag_cache_ttl_ms,refreshIntervalMs:(u=n.remote_config_refresh_interval_ms)!==null&&u!==void 0?u:3e5,idleRefreshBackoff:le(n.remote_config_refresh_interval_ms),requestTimeoutMs:n.feature_flag_request_timeout_ms,compression:n.disable_compression?void 0:"best-available",evaluationContexts:(d=(h=n.evaluation_contexts)!==null&&h!==void 0?h:n.evaluation_environments)!==null&&d!==void 0?d:[],flagKeys:He(n.flag_keys)?n.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.Vc||(t8.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Vc=!0),le(t.flag_keys)||He(t.flag_keys)||t8.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.Gc}};const n8=qt("[FeatureFlags]"),el=qt("[FeatureFlags]",{debugEnabled:!0}),b1=`" failed. Feature flags didn't load in time.`,r8=["click","keydown","wheel","touchstart","pointerdown"],s8="connection_error",i8=t=>{const e={};for(let n=0;t.length>n;n++)e[t[n]]=!0;return e},o8=t=>{const e={};for(const[n,r]of i0(t||{}))r&&(e[n]=r);return e},a8=t=>Pu(t)&&(t.name==="RangeError"&&t.message.indexOf("Maximum call stack size exceeded")===0||t.name==="InternalError"&&t.message==="too much recursion"),Ws=qt("[Error tracking]"),g_="webkit-masked-url:",Q$=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],J$=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",g_],ej=["__firefox__","__gCrWeb"],l8="Refusing to render web experiment since the viewer is a likely bot",tj={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>K0(e,t),not_regex:(t,e)=>!K0(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t},Es=qt("[Conversations]"),tl="Conversations not available yet.";function c8(t,e){var n,r,s,i,o,l,u;const d=(n=t==null?void 0:t.flushIntervalMs)!==null&&n!==void 0?n:3e3,h=(r=t==null?void 0:t.maxBufferSize)!==null&&r!==void 0?r:100,p=e!=null&&e.consoleCapture?void 0:(s=t==null?void 0:t.maxLogsPerInterval)!==null&&s!==void 0?s:1e3,m=le(p)?Math.max(h,2048):Math.max(h,p),v=z(z({},(function(){let w="",_="";try{const x=$n==null?void 0:$n.userAgent;x&&([w,_]=A3(x))}catch{}return(function(x,b){const k=(function(C){if(C)return{}.hasOwnProperty.call(rS,C)?rS[C]:C})(x);return z(z({},k?{"os.name":k}:{}),b?{"os.version":b}:{})})(w,_)})()),t==null?void 0:t.resourceAttributes);return{serviceName:(i=(o=v==null?void 0:v["service.name"])!==null&&o!==void 0?o:t==null?void 0:t.serviceName)!==null&&i!==void 0?i:e==null?void 0:e.serviceNameDefault,serviceVersion:(l=v==null?void 0:v["service.version"])!==null&&l!==void 0?l:t==null?void 0:t.serviceVersion,environment:(u=v==null?void 0:v["deployment.environment"])!==null&&u!==void 0?u:t==null?void 0:t.environment,resourceAttributes:v,beforeSend:t==null?void 0:t.beforeSend,flushIntervalMs:d,maxBufferSize:h,maxQueueSize:m,maxBatchRecordsPerPost:100,rateCapWindowMs:d,maxLogsPerInterval:p,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}const nj=["debug","log","warn","error","info"],rj=t=>{for(;t!=null&&t.__rrweb_original__;)t=t.__rrweb_original__;return t},u8="console",f5="__posthogHandledLogsRequestError",S1=(t,e)=>{const n=t instanceof Error?t:new Error(e);return n[f5]=!0,n},d8=t=>!!t&&typeof t=="object"&&t[f5]===!0,Y0=qt("[NetworkMetrics]"),pw=()=>{var t;return!(ee==null||(t=ee.performance)===null||t===void 0)&&t.now?ee.performance.now():Date.now()},sj=t=>t?`${Math.floor(t/100)}xx`:"missing",h5=(t,e)=>{var n;const r=String(e);return{method:String(t).toUpperCase(),url:((n=ga(r))===null||n===void 0?void 0:n.href)||r}},v_=(t,e,n,r,s)=>{try{var i,o,l;const d=s();if(!d)return;const h=n||void 0,p=pw()-r,m=ga(e.url);if(m&&m.protocol!=="http:"&&m.protocol!=="https:")return;const v={url:(m==null?void 0:m.href)||e.url,method:e.method},w=Nn(d.name)?d.name(v):tt(d.name)?d.name:"http.client.request.duration";if(!w)return;const _=z({method:v.method,host:(i=m==null?void 0:m.hostname)!==null&&i!==void 0?i:"",path:m?(u=m.pathname,u.split("/").map(x=>(b=>/^\d+$/.test(b)||b.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(b))(x)?":id":x).join("/")):"",status_class:sj(h)},(o=d.attributes)===null||o===void 0?void 0:o.call(d,v,{status:h,durationMs:p}));(l=t.metrics)===null||l===void 0||l.histogram(w,p,{unit:"ms",attributes:_})}catch(d){Y0.error("Failed to record network metric",d)}var u},p5=()=>{},ij=(t,e)=>Nn(ee==null?void 0:ee.fetch)?yf(ee,"fetch",n=>function(...r){const s=pw(),i=n.apply(this,r);if(!e())return i;try{var o,l,u;const[d,h]=r,p=h5((o=(l=h==null?void 0:h.method)!==null&&l!==void 0?l:d==null?void 0:d.method)!==null&&o!==void 0?o:"GET",(u=d==null?void 0:d.url)!==null&&u!==void 0?u:d);return i.then(m=>(v_(t,p,m==null?void 0:m.status,s,e),m),m=>{throw v_(t,p,void 0,s,e),m})}catch(d){return Y0.error("Failed to observe fetch",d),i}}):p5,oj=(t,e)=>{var n;const r=ee==null||(n=ee.XMLHttpRequest)===null||n===void 0?void 0:n.prototype;if(!r)return p5;const s=new WeakMap,i=yf(r,"open",l=>function(...u){try{ZP.has(this)||s.set(this,h5(u[0],u[1]))}catch(d){Y0.error("Failed to observe XHR open",d)}return l.apply(this,u)}),o=yf(r,"send",l=>function(...u){let d;try{const h=s.get(this);if(h&&e()){const p=pw();d=()=>{this.removeEventListener("loadend",d),v_(t,h,this.status,p,e)},yt(this,"loadend",d)}}catch(h){Y0.error("Failed to observe XHR send",h)}try{return l.apply(this,u)}catch(h){throw d&&this.removeEventListener("loadend",d),h}});return()=>{i(),o()}},Mm={featureFlags:class{constructor(t){this.name="featureFlags",this.Zc=!1,this.featureFlagEventHandlers=[],this.$=n8,this.Qc={},this.Jc={},this.Kc=[],this.Xc=!1,this.Yc=!1,this.td=0,this.ed=!1,this.nd=!1,this.sd=!1,this.rd=!1,this.od=0,this.ld=!1,this.an=()=>{const e=this.ad();this.od=0,e&&this.reloadFeatureFlags()},this.ud=()=>{var e,n;const r=this.hd,s=(e=this.dd)!==null&&e!==void 0?e:r;le(r)||le(s)||this.Ir.remoteRequestsDisabled||!ue||ue.visibilityState==="hidden"||Date.now()-((n=this.vd)!==null&&n!==void 0?n:0)<s||(this.dd=this.ld||!this.Ir.idleRefreshBackoff?r:Math.min(2*s,36e5),this.ld=!1,this.reloadFeatureFlags(),this.fd())},this.pd=()=>{this.ld&&this.dd===this.hd||this.gd()},this.ln=()=>{(ue==null?void 0:ue.visibilityState)==="visible"&&this.gd()},"get"in t?this.bo=t:(this._instance=t,this.md=new X$(t.config,t.Yl()),this.bo=this.md)}updateConfig(t,e){var n;(n=this.md)===null||n===void 0||n.update(t,e),this.mo&&this.yd()}setup(t){return this.Eh=t,this.$=t.logger.createLogger("[FeatureFlags]"),d5(t.kv.initialize(),()=>{this.Eh===t&&(this.Eh=void 0,this.mo=t,this.bd(t))})}bd(t){var e;if(this.mo===t)return ee&&yt(ee,"online",this.an),this.yd(),this._d=t.registerDynamicEventProperties(()=>this.wd()?this.Qc:this.Jc),this.kd=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.onCrossTabFeatureFlagChange(()=>{this.Sd(),this.xd(),this.Cd()}),this.xd(),this.initialize()}gd(){this.ld=!0,this.dd=this.hd,this.ud()}yd(){const t=this.Ir.refreshIntervalMs,e=!this.Ir.remoteRequestsDisabled&&ue&&!le(t)&&t>0?t:void 0;this.Ir.idleRefreshBackoff||(this.dd=e),e!==this.hd&&(this.$d(),le(e)||(this.hd=e,this.dd=e,this.fd(),ue!=null&&ue.addEventListener&&(yt(ue,hf,this.ln),Dc(r8,n=>{yt(ue,n,this.pd,{capture:!0})}))))}fd(){le(this.hd)||(le(this.Id)||clearInterval(this.Id),this.vd=Date.now(),this.Id=setInterval(this.ud,this.hd))}$d(){var t;le(this.Id)||(clearInterval(this.Id),this.Id=void 0,ue==null||(t=ue.removeEventListener)===null||t===void 0||t.call(ue,"visibilitychange",this.ln),Dc(r8,e=>{var n;ue==null||(n=ue.removeEventListener)===null||n===void 0||n.call(ue,e,this.pd,{capture:!0})})),this.hd=void 0,this.dd=void 0,this.ld=!1,this.vd=void 0}destroy(){this.Td()}dispose(){this.Td()}Td(){var t,e;this.$d(),this.td++,this.nd=!1,this.Eh=void 0,this.mo&&(this.Md(),(t=this._d)===null||t===void 0||t.dispose(),this._d=void 0,(e=this.kd)===null||e===void 0||e.call(this),this.kd=void 0,this.Kc=[],ee==null||ee.removeEventListener("online",this.an),this.mo=void 0)}get Ir(){return this.bo.get()}Ed(t){var e;return this.Pd&&t in this.Pd?this.Pd[t]:(e=this.mo)===null||e===void 0?void 0:e.kv.get(t)}Sd(){return!!this.Pd&&(this.Pd=void 0,!0)}Rd(){var t;return!le((t=this.mo)===null||t===void 0?void 0:t.kv.get("$enabled_feature_flags"))&&this.Sd()}At(t){this.Ad(()=>{var e;return(e=this.mo)===null||e===void 0?void 0:e.kv.set(t)})}Fd(t,e,n){var r;if(!(!((r=this._instance)===null||r===void 0)&&r.persistence)||!t.$enabled_feature_flags)return;const s=this.Ed("$enabled_feature_flags")||{},i=t.$enabled_feature_flags||{},o=e.flags||e.featureFlags,l=e.flags?Object.entries(e.flags).filter(([,b])=>!(b!=null&&b.failed)).map(([b])=>b):[],u=!!e.errorsWhileComputingFlags&&!!e.flags,d=u?l:n&&!He(o)?Object.keys(o||{}):Array.from(new Set([...Object.keys(s),...Object.keys(i)])),h=this.Ed("$feature_flag_payloads")||{},p=t.$feature_flag_payloads||{},m=u||n?d:Array.from(new Set([...Object.keys(h),...Object.keys(p)])),v=!u&&!n,w=!!v||d,_=!!v||m,x={[ao]:w,[Js]:w,[na]:_};t.$feature_flag_details&&(x[Il]=w);for(const b of[Al,ua,Wd])le(t[b])||(x[b]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(x)}Lt(t){this.Ad(()=>{var e;return(e=this.mo)===null||e===void 0?void 0:e.kv.remove(t)})}Ad(t){try{t()}catch(e){this.$.error("Failed to update feature flag persistence",e)}}xd(){const t={};for(const r of[ao,na,Al,gi]){const s=this.Ed(r);le(s)||(t[r]=s)}this.Qc=t;const e=z({},t),n=this.Ed(Js);if(n)for(const[r,s]of Object.entries(n))e[`$feature/${r}`]=s;this.Jc=e}wd(){const t=this.Ir.cacheTtlMs;if(!t||0>=t)return!1;const e=this.Ed(ua);return typeof e!="number"||Date.now()-e>t}Od(){return!!this.wd()&&(this.rd||this.Yc||(this.rd=!0,this.$.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Dd(){const t=this.Ir.evaluationContexts;return t!=null&&t.length?t.filter(e=>{const n=e&&typeof e=="string"&&e.trim().length>0;return n||this.$.error("Invalid evaluation context found:",e,"Expected non-empty string"),n}):[]}Ld(){const t=this.Ir.flagKeys;if(!le(t))return t.filter(e=>{const n=e&&typeof e=="string"&&e.trim().length>0;return n||this.$.error("Invalid flag key found:",e,"Expected non-empty string"),n})}initialize(){var t,e;const n=this.Ir,r=(t=(e=n.bootstrap)===null||e===void 0?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(r).length){var s,i;const o=(s=(i=n.bootstrap)===null||i===void 0?void 0:i.featureFlagPayloads)!==null&&s!==void 0?s:{},l=Object.keys(r).filter(d=>!le(r[d])).reduce((d,h)=>(d[h]=r[h],d),{}),u=Object.keys(o).filter(d=>l[d]).reduce((d,h)=>(d[h]=o[h],d),{});return this.Nd({featureFlags:l,featureFlagPayloads:u},void 0,{persist:!1})}}updateFlags(t,e,n){var r,s;const i=n!=null&&n.merge&&(r=this.Ed("$enabled_feature_flags"))!==null&&r!==void 0?r:{},o=n!=null&&n.merge&&(s=this.Ed("$feature_flag_payloads"))!==null&&s!==void 0?s:{},l=z(z({},i),t),u=z(z({},o),e),d={};for(const[h,p]of Object.entries(l))d[h]={key:h,enabled:Q6(p),variant:J6(p),reason:void 0,metadata:le(u==null?void 0:u[h])?void 0:{id:0,version:void 0,description:void 0,payload:u[h]}};this.Nd({flags:d})}get hasLoadedFlags(){return this.Xc}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){const t=this.Ed(Il),e=this.Ed(gi),n=this.Ed(fl);if(!n&&!e)return t||{};const r=Rt({},t||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(const l of s){var i;const u=r[l],d=e==null?void 0:e[l],h=le(d)?(i=u==null?void 0:u.enabled)!==null&&i!==void 0&&i:!!d,p=le(d)?u==null?void 0:u.variant:typeof d=="string"?d:void 0,m=n==null?void 0:n[l],v=z(z({},u),{},{enabled:h,variant:h?p??(u==null?void 0:u.variant):void 0});var o;h!==(u==null?void 0:u.enabled)&&(v.original_enabled=u==null?void 0:u.enabled),p!==(u==null?void 0:u.variant)&&(v.original_variant=u==null?void 0:u.variant),m&&(v.metadata=z(z({},u==null?void 0:u.metadata),{},{payload:m,original_payload:u==null||(o=u.metadata)===null||o===void 0?void 0:o.payload})),r[l]=v}return this.Zc||(this.$.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:r}),this.Zc=!0),r}getAllFeatureFlags(){const t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map(n=>{const r=t[n];return{key:n,enabled:Q6(r),variant:J6(r),payload:X6(e[n])}})}getFlagVariants(){const t=this.Ed(Js),e=this.Ed(gi);if(!e)return t||{};const n=Rt({},t||{}),r=Object.keys(e);for(let s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.Zc||(this.$.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.Zc=!0),n}getFlagPayloads(){const t=this.Ed(na),e=this.Ed(fl);if(!e)return t||{};const n=Rt({},t||{}),r=Object.keys(e);for(let s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.Zc||(this.$.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.Zc=!0),n}reloadFeatureFlags(){this.ed||this.Ir.featureFlagsDisabled||this.ad()||(this.Yc&&(this.nd=!0),this.qd||(this.Kc.slice().forEach(t=>{try{t()}catch(e){this.$.error("Error while running feature flags reloading callback",e)}}),this.qd=setTimeout(()=>{this.jd()},5)))}Md(){clearTimeout(this.qd),this.qd=void 0}onReloading(t){return this.Kc.push(t),()=>{this.Kc=this.Kc.filter(e=>e!==t)}}ensureFlagsLoaded(){this.Xc||this.Yc||this.qd||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.ed=t}resetFlagCallReported(){this.Lt(ia)}jd(t){this.Md();const e=this.mo;if(!e||this.Ir.remoteRequestsDisabled||this.ad())return;if(this.Yc)return void(this.nd=!0);const n={token:e.projectToken,distinct_id:e.distinctId,groups:e.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:z(z(z({},e.initialPersonProperties),this.Ed("$stored_person_properties")||{}),{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Ed(sa),timezone:jP()};le(e.deviceId)||(n.$device_id=e.deviceId),(t!=null&&t.disableFlags||this.Ir.featureFlagsDisabled)&&(n.disable_flags=!0);const r=this.Dd();r.length&&(n.evaluation_contexts=r);const s=this.Ld();le(s)||(n.flag_keys=s);const i=this.Ir.onlyEvaluateSurveyFeatureFlags,o="/flags/?v=2"+(i?"&only_evaluate_survey_feature_flags=true":""),l=this.td;this.Yc=!0;const u=()=>{this.nd&&(this.nd=!1,this.jd())},d=p=>{var m,v;const w=(m=p.json)!==null&&m!==void 0?m:{},_=p.statusCode!==200;if(this.Yc=!1,l!==this.td)return void u();if(this.Bd(p.statusCode),_||this.nd||(this.$anon_distinct_id=void 0),n.disable_flags&&!this.nd)return;this.sd=!_;const x=[];p.error?x.push(p.error instanceof Error&&p.error.name==="AbortError"?"timeout":p.error instanceof Error?s8:"unknown_error"):p.statusCode!==200&&x.push(`api_error_${p.statusCode}`),w.errorsWhileComputingFlags&&x.push("errors_while_computing_flags");const b=!!(!((v=w.quotaLimited)===null||v===void 0)&&v.includes("feature_flags"));b&&x.push("quota_limited"),this.At({[ff]:x}),b?this.$.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):n.disable_flags||this.Nd(w,_,{partialResponse:i}),u()},h=p=>{this.Yc=!1,l===this.td&&(this.At({[ff]:[s8]}),this.$.error("Feature flag request failed",p),this.Rd()&&this.Cd(!0)),u()};try{e.sendRequest(o,{target:"flags",method:"POST",body:n,compression:this.Ir.compression,sentAt:"body",timeoutMs:this.Ir.requestTimeoutMs}).then(d).catch(h)}catch(p){h(p)}}ad(){return IP(this.od,3)}Bd(t){this.od=AP(t,this.od,3,()=>this.$.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(t,e={}){var n;if(e.fresh&&!this.sd)return;if(!(this.Xc||this.getFlags()&&this.getFlags().length>0))return void this.$.warn('getFeatureFlag for key "'+t+b1);if(this.Od())return;const r=this.getFeatureFlagResult(t,e);return(n=r==null?void 0:r.variant)!==null&&n!==void 0?n:r==null?void 0:r.enabled}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){const e=this.getFeatureFlagResult(t,{send_event:!1});return e==null?void 0:e.payload}getFeatureFlagResult(t,e={}){if(e.fresh&&!this.sd)return;if(!(this.Xc||this.getFlags()&&this.getFlags().length>0))return void this.$.warn('getFeatureFlagResult for key "'+t+b1);if(this.Od())return;const n=this.getFlagVariants(),r=t in n,s=n[t],i=this.getFlagPayloads()[t],o=String(s),l=this.Ed("$feature_flag_request_id")||void 0,u=this.Ed("$feature_flag_evaluated_at")||void 0;let d,h=this.Ed("$flag_call_reported")||{};if(this.Ir.deduplicateCallsPerSession){var p;const L=(p=this.mo)===null||p===void 0?void 0:p.session.sessionId,N=this.Ed(Dd);L&&L!==N&&(h={},d=L)}if(e.send_event||!("send_event"in e))if(t in h&&h[t].includes(o))d&&this.At({[ia]:h,[Dd]:d});else{var m,v,w,_,x,b,k,C,T,I,M,R;He(h[t])?h[t].push(o):h[t]=[o],this.At(z({[ia]:h},d?{[Dd]:d}:{}));const L=this.getFeatureFlagDetails(t),N=[...(m=this.Ed("$feature_flag_errors"))!==null&&m!==void 0?m:[]];le(s)&&N.push("flag_missing");const F={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:i??null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:(v=(w=this.Ir.bootstrap)===null||w===void 0||(w=w.featureFlags)===null||w===void 0?void 0:w[t])!==null&&v!==void 0?v:null,$feature_flag_bootstrapped_payload:(_=(x=this.Ir.bootstrap)===null||x===void 0||(x=x.featureFlagPayloads)===null||x===void 0?void 0:x[t])!==null&&_!==void 0?_:null,$used_bootstrap_value:!this.sd};le(L==null||(b=L.metadata)===null||b===void 0?void 0:b.has_experiment)||(F.$feature_flag_has_experiment=L.metadata.has_experiment),le(L==null||(k=L.metadata)===null||k===void 0?void 0:k.version)||(F.$feature_flag_version=L.metadata.version);const j=(C=L==null||(T=L.reason)===null||T===void 0?void 0:T.description)!==null&&C!==void 0?C:L==null||(I=L.reason)===null||I===void 0?void 0:I.code;var A;j&&(F.$feature_flag_reason=j),!(L==null||(M=L.metadata)===null||M===void 0)&&M.id&&(F.$feature_flag_id=L.metadata.id),le(L==null?void 0:L.original_variant)&&le(L==null?void 0:L.original_enabled)||(F.$feature_flag_original_response=le(L.original_variant)?L.original_enabled:L.original_variant),!(L==null||(R=L.metadata)===null||R===void 0)&&R.original_payload&&(F.$feature_flag_original_payload=L==null||(A=L.metadata)===null||A===void 0?void 0:A.original_payload),N.length&&(F.$feature_flag_error=N.join(",")),this.Hd(F)}else d&&this.At({[ia]:h,[Dd]:d});return r?{key:t,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:X6(i)}:void 0}Hd(t){try{var e;(e=this.mo)===null||e===void 0||e.capture("$feature_flag_called",t).catch(n=>{this.$.error("Failed to capture feature flag call",n)})}catch(n){this.$.error("Failed to capture feature flag call",n)}}getRemoteConfigPayload(t,e){this.zd(t,e)}zd(t,e){var n=this;return Mt(function*(){const r=n.mo;if(!r)return;const s={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},i=n.Dd();i.length&&(s.evaluation_contexts=i);const o=n.Ld();let l;le(o)||(s.flag_keys=o);try{var u;const d=(u=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:s,compression:n.Ir.compression,sentAt:"body",timeoutMs:n.Ir.requestTimeoutMs})).json)===null||u===void 0?void 0:u.featureFlagPayloads;l=(d==null?void 0:d[t])||void 0}catch(d){return void n.$.error("Remote config feature flag request failed",d)}try{e(l)}catch(d){n.$.error("Remote config feature flag callback failed",d)}})()}isFeatureEnabled(t,e={}){if(e.fresh&&!this.sd)return e.defaultValue;if(!(this.Xc||this.getFlags()&&this.getFlags().length>0))return this.$.warn('isFeatureEnabled for key "'+t+b1),e.defaultValue;const n=this.getFeatureFlag(t,e);return le(n)?e.defaultValue:!!n}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(e=>e!==t)}receivedFeatureFlags(t,e,n){this.Nd(t,e,n)}Nd(t,e,n){if(!this.mo)return;this.Xc=!0;const r=((s,i={},o={},l={},u,d=n8)=>{const h=((C,T)=>{const I=C.flags;if(I){const M=Object.fromEntries(Object.keys(I).map(A=>{var L;return[A,(L=I[A].variant)!==null&&L!==void 0?L:I[A].enabled]})),R=Object.fromEntries(Object.keys(I).filter(A=>I[A].enabled).filter(A=>{var L;return!le((L=I[A].metadata)===null||L===void 0?void 0:L.payload)}).map(A=>{var L;return[A,(L=I[A].metadata)===null||L===void 0?void 0:L.payload]}));return z(z({},C),{},{featureFlags:M,featureFlagPayloads:R})}return C.featureFlags&&T.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),C})(s,d),p=h.flags,m=h.featureFlags,v=h.featureFlagPayloads;if(!m)return;const w=s.requestId,_=s.evaluatedAt;if(He(m)){d.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");const C={};if(m)for(let T=0;m.length>T;T++)C[m[T]]=!0;return{[ao]:m,[Js]:C,[Wd]:!1}}let x=m,b=v,k=p;if(u!=null&&u.partialResponse){const C=Object.keys(x),T=b||{};x=z(z({},i),x),b=z(z({},o),T),C.forEach(I=>{I in T||b==null||delete b[I]}),k=z(z({},l),k)}else if(s.errorsWhileComputingFlags)if(p){const C=new Set(Object.keys(p).filter(I=>{var M;return!(!((M=p[I])===null||M===void 0)&&M.failed)}));x=z(z({},i),Object.fromEntries(Object.entries(x).filter(([I])=>C.has(I))));const T=Object.fromEntries(Object.entries(b||{}).filter(([I])=>C.has(I)));b=z(z({},o),T),C.forEach(I=>{I in T||b==null||delete b[I]}),k=z(z({},l),Object.fromEntries(Object.entries(k||{}).filter(([I])=>C.has(I))))}else x=z(z({},i),x),b=z(z({},o),b),k=z(z({},l),k);return z(z({[ao]:Object.keys(o8(x)),[Js]:x||{},[na]:b||{},[Il]:k||{},[Wd]:s.minimalFlagCalledEvents===!0},w?{[Al]:w}:{}),_?{[ua]:_}:{})})(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this.$);if(r)if((n==null?void 0:n.persist)===!1){const s=!le(this.mo.kv.get(Js));this.Pd=r,s||this.At(r)}else this.Sd(),this.Fd(r,t,!!(n!=null&&n.partialResponse)),this.At(r);else e&&this.Rd();e||(this.rd=!1),this.Cd(e)}override(t,e=!1){this.$.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.Ud(t)}Ud(t){if(this.mo){if(t===!1)return this.Lt([gi,fl]),this.Cd(),void el.info("All overrides cleared");if(He(t))return this.At({[gi]:i8(t)}),this.Cd(),void el.info("Flag overrides set",{flags:t});if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var e;const n=t;this.Zc=!!((e=n.suppressWarning)!==null&&e!==void 0&&e);const r={},s=n.flags,i=n.payloads;return s&&(r[gi]=He(s)?i8(s):s),i&&(r[fl]=i),Object.keys(r).length&&this.At(r),s===!1&&i===!1?this.Lt([gi,fl]):s===!1?this.Lt(gi):i===!1&&this.Lt(fl),this.Cd(),s===!1?el.info("Flag overrides cleared"):s&&el.info("Flag overrides set",{flags:s}),void(i===!1?el.info("Payload overrides cleared"):i&&el.info("Payload overrides set",{payloads:i}))}if(t&&typeof t=="object")return this.At({[gi]:t}),this.Cd(),void el.info("Flag overrides set",{flags:t});this.$.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.$.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Xc){const{flags:e,flagVariants:n}=this.Wd();try{t(e,n)}catch(r){this.$.error("Error while running feature flags callback",r)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var r;const s=(this.Ed("$early_access_features")||[]).find(d=>d.flagKey===t),i={[`$feature_enrollment/${t}`]:e},o={$feature_flag:t,$feature_enrollment:e,$set:i};s&&(o.$early_access_feature_name=s.name),n&&(o.$feature_enrollment_stage=n);const l=z(z({},this.getFlagVariants()),{},{[t]:e});(r=this._instance)===null||r===void 0||(r=r.persistence)===null||r===void 0||r.markCrossTabFeatureFlagChanges({$active_feature_flags:[t],$enabled_feature_flags:[t],$stored_person_properties:Object.keys(i)}),this.At({[ao]:Object.keys(o8(l)),[Js]:l,[ra]:z(z({},this.Ed("$stored_person_properties")||{}),i)}),this.Cd();try{var u;(u=this.mo)===null||u===void 0||u.capture("$feature_enrollment_update",o).catch(d=>{this.$.error("Failed to capture early access feature enrollment",d)})}catch(d){this.$.error("Failed to capture early access feature enrollment",d)}}getEarlyAccessFeatures(t,e=!1,n){const r=this.Ed(t_);!r||e?this.Vd(t,n):t(r)}Vd(t,e){var n=this;return Mt(function*(){const r=n.mo;if(!r)return;const s=e?`&${e.map(o=>`stage=${o}`).join("&")}`:"";let i;try{const o=yield r.sendRequest(`/api/early_access_features/?token=${r.projectToken}${s}`,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;i=o.json.earlyAccessFeatures,n.At({[t_]:i})}catch(o){return void n.$.error("Early access feature request failed",o)}try{t(i)}catch(o){n.$.error("Early access feature callback failed",o)}})()}Wd(){const 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),{})}}Cd(t){this.xd();const{flags:e,flagVariants:n}=this.Wd();this.featureFlagEventHandlers.forEach(r=>{try{r(e,n,{errorsLoading:t})}catch(s){this.$.error("Error while running feature flags callback",s)}})}setPersonPropertiesForFlags(t,e=!0){this.Gd(t,e)}Gd(t,e=!0){const n=this.Ed("$stored_person_properties")||{},r=(t==null?void 0:t.$set)||(t!=null&&t.$set_once?{}:t),s=t==null?void 0:t.$set_once,i={};if(s)for(const o in s)({}).hasOwnProperty.call(s,o)&&(o in n||(i[o]=s[o]));this.At({[ra]:z(z(z({},n),i),r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e=!0){const n=z({},this.Ed("$stored_person_properties")||{});t.forEach(r=>{delete n[r]}),this.At({[ra]:n}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t=!0){this.Lt(ra),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e=!0){const n=this.Ed("$stored_group_properties")||{},r=z({},n);for(const s of Object.keys(t))r[s]=z(z({},n[s]),t[s]);this.At({[sa]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){const e=this.Ed("$stored_group_properties")||{};this.At({[sa]:z(z({},e),{},{[t]:{}})})}else this.Lt(sa)}reset(){this.td++,this.nd=!1,this.Qc={},this.Jc={},this.Pd=void 0,this.Xc=!1,this.ed=!1,this.sd=!1,this.$anon_distinct_id=void 0,this.Md(),this.Zc=!1,this.od=0}}},aj={sessionRecording:class{get Ir(){return this._instance.config}get Ca(){return this._instance.persistence}get started(){var t;return!!(!((t=this.Zd)===null||t===void 0)&&t.isStarted)}get status(){var t,e;return this.Qd==="awaiting_config"||this.Qd==="missing_config"?this.Qd:(t=(e=this.Zd)===null||e===void 0?void 0:e.status)!==null&&t!==void 0?t:this.Qd}constructor(t){if(this._instance=t,this._forceAllowLocalhostNetworkCapture=!1,this.Qd=_1,this.Jd=void 0,this.Kd=!1,this.Xe=(()=>{var e,n;if(!(ue!=null&&ue.visibilityState)||ue.visibilityState==="visible")return!0;const r=ee==null||(e=ee.performance)===null||e===void 0||(n=e.getEntriesByType)===null||n===void 0?void 0:n.call(e,"visibility-state");return!(r!=null&&r.length)||r.some(s=>s.name==="visible")})(),this.ln=()=>{var e,n;(ue==null?void 0:ue.visibilityState)==="visible"&&(this.Xe=!0,(e=this.Zd)===null||e===void 0||(n=e.setDocumentWasEverVisible)===null||n===void 0||n.call(e,!0))},!this._instance.sessionManager)throw Gi.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if(this.Ir.cookieless_mode==="always")throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');ue!=null&&ue.addEventListener&&yt(ue,"visibilitychange",this.ln)}initialize(){this.startIfEnabledOrStop()}dispose({discardBufferedEvents:t=!1}={}){var e;this.Kd=!0,ue==null||(e=ue.removeEventListener)===null||e===void 0||e.call(ue,"visibilitychange",this.ln),t?this.Xd(!0):this.stopRecording()}get Yd(){var t;const e=!!(!((t=this._instance.get_property("$session_recording_remote_config"))===null||t===void 0)&&t.enabled),n=!this.Ir.disable_session_recording,r=this.Ir.disable_session_recording||this._instance.consent.isOptedOut();return ee&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(this.Kd||this.Yd&&(!((e=this.Zd)===null||e===void 0)&&e.isStarted))return;const n=!le(Object.assign)&&!le(Array.from);this.Yd&&n?(this.tv(t),Gi.info("starting")):(this.Qd=_1,this.stopRecording())}tv(t){var e,n;if(this.Yd)if(this.Qd!=="awaiting_config"&&this.Qd!=="missing_config"&&(this.Qd=YS),(Le==null||(e=Le.__PosthogExtensions__)===null||e===void 0||(e=e.rrweb)===null||e===void 0?void 0:e.record)&&((n=Le.__PosthogExtensions__)===null||n===void 0?void 0:n.initSessionRecording))this.ev(t);else{var r,s;const i=this._instance.sessionManager;(r=Le.__PosthogExtensions__)===null||r===void 0||(s=r.loadExternalDependency)===null||s===void 0||s.call(r,this._instance,this.iv,o=>{if(!this.Kd&&this.Yd&&this._instance.sessionManager===i)return o?(this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0}),Gi.error("could not load recorder",o)):void this.ev(t);this.Qd="disabled"})}}stopRecording(){var t,e;(t=this.Jd)===null||t===void 0||t.call(this),this.Jd=void 0,(e=this.Zd)===null||e===void 0||e.stop()}Xd(t=!1){var e,n;(e=this.Jd)===null||e===void 0||e.call(this),this.Jd=void 0,(n=this.Zd)===null||n===void 0||n.discard({discardProducerEvents:t})}nv(){var t,e;(t=this.Ca)===null||t===void 0||t.unregister("$session_is_sampled"),(e=this.Ca)===null||e===void 0||e.unregister("$replay_sample_rate")}sv(t,e){if(Xe(t))return null;const n=Xt(t)?t:parseFloat(t);return typeof(r=n)!="number"||!Number.isFinite(r)||0>r||r>1?(Gi.warn(`${e} must be between 0 and 1. Ignoring invalid value:`,t),null):n;var r}rv(t){if(this.Ca){var e,n;const r=this.Ca,s=()=>{var i;const o=t.sessionRecording===!1?void 0:t.sessionRecording,l=this.sv((i=this.Ir.session_recording)===null||i===void 0?void 0:i.sampleRate,"session_recording.sampleRate"),u=this.sv(o==null?void 0:o.sampleRate,"remote config sampleRate"),d=l??u;Xe(d)&&this.nv();const h=o==null?void 0:o.minimumDurationMilliseconds;r.register({[Ud]:z(z({cache_timestamp:Date.now(),enabled:!!o},o),{},{networkPayloadCapture:z({capturePerformance:t.capturePerformance},o==null?void 0:o.networkPayloadCapture),canvasRecording:{enabled:o==null?void 0:o.recordCanvas,fps:o==null?void 0:o.canvasFps,quality:o==null?void 0:o.canvasQuality},sampleRate:d,minimumDurationMilliseconds:le(h)?null:h,endpoint:o==null?void 0:o.endpoint,triggerMatchType:o==null?void 0:o.triggerMatchType,masking:o==null?void 0:o.masking,urlTriggers:o==null?void 0:o.urlTriggers,version:o==null?void 0:o.version,triggerGroups:o==null?void 0:o.triggerGroups})})};s(),(e=this.Jd)===null||e===void 0||e.call(this),this.Jd=(n=this._instance.sessionManager)===null||n===void 0?void 0:n.onSessionId(s)}}onRemoteConfig(t){const e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?e.sessionRecording===!1?(this.rv(e),void this.Xd()):(this.rv(e),void this.startIfEnabledOrStop()):(this.Qd==="awaiting_config"&&(this.Qd="missing_config",Gi.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e="log"){var n;!((n=this.Zd)===null||n===void 0)&&n.log?this.Zd.log(t,e):Gi.warn("log called before recorder was ready")}get iv(){var t,e;const n=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.get_property(Ud);return(n==null||(e=n.scriptConfig)===null||e===void 0?void 0:e.script)||"lazy-recorder"}ov(){const t=this._instance.get_property(Ud);if(!t)return!1;let e;try{e=typeof t=="object"?t:JSON.parse(t)}catch(n){return Gi.warn("persisted remote config for session recording is invalid and will be ignored",n),!1}return!Xe(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}ev(t){var e,n,r;if(!this.Kd&&this.Yd&&this._instance.sessionManager){if(!(!((e=Le.__PosthogExtensions__)===null||e===void 0)&&e.initSessionRecording))return Gi.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[hP]:!0});var s;if(this.Zd||(this.Zd=(s=Le.__PosthogExtensions__)===null||s===void 0?void 0:s.initSessionRecording(this._instance,this.Xe),this.Zd._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.ov())return this.Qd==="missing_config"||this.Qd==="awaiting_config"?void 0:(this.Qd="awaiting_config",Gi.info("persisted remote config is stale, requesting fresh config before starting"),void new VP(this._instance).load());this.Qd=YS,(n=(r=this.Zd).setDocumentWasEverVisible)===null||n===void 0||n.call(r,this.Xe),this.Zd.start(t)}else this.Qd=_1}onRRwebEmit(t){var e,n;(e=this.Zd)===null||e===void 0||(n=e.onRRwebEmit)===null||n===void 0||n.call(e,t)}overrideLinkedFlag(){var t,e;this.Zd||(e=this.Ca)===null||e===void 0||e.register({$replay_override_linked_flag:!0}),(t=this.Zd)===null||t===void 0||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Zd||(e=this.Ca)===null||e===void 0||e.register({$replay_override_sampling:!0}),(t=this.Zd)===null||t===void 0||t.overrideSampling()}overrideTrigger(t){var e,n;this.Zd||(n=this.Ca)===null||n===void 0||n.register({[t==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(e=this.Zd)===null||e===void 0||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.Zd)===null||t===void 0?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var n;return!!(!((n=this.Zd)===null||n===void 0)&&n.tryAddCustomEvent(t,e))}flushBeforeIdentityReset(){var t,e;(t=this.Zd)===null||t===void 0||(e=t.flushBeforeIdentityReset)===null||e===void 0||e.call(t)}}},lj={autocapture:class extends $${constructor(t){super(new j$(t)),this.instance=t}},historyAutocapture:class{constructor(t){this._instance=t,this.lv=this.av()}initialize(){this.startIfEnabled()}get isEnabled(){const t=this.uv();return!!(t.path||t.search||this.hv(t))}startIfEnabled(){this.isEnabled&&(ge.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.lv=this.av(),this.startIfEnabled()}stop(){this.dv&&this.dv(),this.dv=void 0,this.vv&&this.vv(),this.vv=void 0,ge.info("History API monitoring stopped")}monitorHistoryChanges(){ee&&ee.history&&(this.fv("pushState"),this.fv("replaceState"),this.pv(),this.hv()&&this.gv())}fv(t){var e;if(!ee||!((e=ee.history[t])===null||e===void 0)&&e.__posthog_wrapped__)return;const n=this;yf(ee.history,t,r=>function(s,i,o){r.call(this,s,i,o),n.mv(t)})}av(){const t=ee==null?void 0:ee.location;if(t!=null&&t.pathname)return{pathname:t.pathname,search:t.search,hash:t.hash}}uv(){const t=this._instance.config.capture_pageview;return t==="history_change"?{path:!0}:st(t)?t:{}}hv(t=this.uv()){return!!t.hash&&!this._instance.config.disable_capture_url_hashes}yv(t){const e=this.uv(),n=this.lv;return!(!n||!(e.path&&t.pathname!==n.pathname||e.search&&t.search!==n.search||this.hv(e)&&t.hash!==n.hash))}mv(t){try{const e=this.av();if(!e)return;this.yv(e)&&this._instance.capture(ow,{navigation_type:t}),this.lv=e}catch(e){ge.error(`Error capturing ${t} pageview`,e)}}pv(){if(this.dv)return;const t=()=>{this.mv("popstate")};yt(ee,"popstate",t),this.dv=()=>{ee&&ee.removeEventListener("popstate",t)}}gv(){if(this.vv)return;const t=()=>{this.mv("hashchange")};yt(ee,"hashchange",t),this.vv=()=>{ee&&ee.removeEventListener("hashchange",t)}}},heatmaps:class{get Ir(){return this.instance.config}constructor(t){var e;this.bv=!1,this._o=!1,this._v=null,this.instance=t,this.bv=!!(!((e=this.instance.persistence)===null||e===void 0)&&e.props[Xy]),this.rageclicks=new u5(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){let t=5e3;return st(this.Ir.capture_heatmaps)&&this.Ir.capture_heatmaps.flush_interval_milliseconds&&(t=this.Ir.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Xe(this.Ir.capture_heatmaps)?Xe(this.Ir.enable_heatmaps)?this.bv:this.Ir.enable_heatmaps:this.Ir.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this._o)return;z$.info("starting..."),this.wv(),this.ln()}else{var t;clearInterval((t=this._v)!==null&&t!==void 0?t:void 0),this.Sv(),this.getAndClearBuffer()}}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if(!("heatmaps"in e))return;const n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Xy]:n}),this.bv=n,this.startIfEnabled()}getAndClearBuffer(){const t=this.Rt;return this.Rt=void 0,t}xv(t){w1(t.originalEvent)&&this.Mr(t.originalEvent,"deadclick")}ln(){this._v&&clearInterval(this._v),this._v=(ue==null?void 0:ue.visibilityState)==="visible"?setInterval(this.pa.bind(this),this.flushIntervalMilliseconds):null}wv(){ee&&ue&&(this.Cv=this.pa.bind(this),yt(ee,z0,this.Cv),this.$v=t=>this.Mr(t||(ee==null?void 0:ee.event)),yt(ue,"click",this.$v,{capture:!0}),this.Iv=t=>this.Tv(t||(ee==null?void 0:ee.event)),yt(ue,"mousemove",this.Iv,{capture:!0}),this.Mv=new ES(this.instance,W7,this.xv.bind(this)),this.Mv.startIfEnabledOrStop(),this.Ev=this.ln.bind(this),yt(ue,hf,this.Ev),this._o=!0)}Sv(){var t;ee&&ue&&(this.Cv&&ee.removeEventListener(z0,this.Cv),this.$v&&ue.removeEventListener("click",this.$v,{capture:!0}),this.Iv&&ue.removeEventListener("mousemove",this.Iv,{capture:!0}),this.Ev&&ue.removeEventListener(hf,this.Ev),clearTimeout(this.Pv),(t=this.Mv)===null||t===void 0||t.stop(),this._o=!1)}Rv(t,e){const n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),i=(function(o,l,u){let d=o;for(;d&&Ai(d)&&!nr(d,"body");){if(d===u)return!1;let v;try{var h,p,m;v=(h=(p=(m=d.ownerDocument)===null||m===void 0?void 0:m.defaultView)!==null&&p!==void 0?p:ee)===null||h===void 0?void 0:h.getComputedStyle(d).position}catch{return!1}if(ze(l,v))return!0;d=bP(d)}return!1})(Zd(t),["fixed","sticky"],s);return{x:t.clientX+(i?0:r),y:t.clientY+(i?0:n),target_fixed:i,type:e}}Mr(t,e="click"){var n;if(pS(t.target)||!w1(t))return;const r=this.Rv(t,e);!((n=this.rageclicks)===null||n===void 0)&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&EP(Zd(t),this.instance.config.rageclick)&&this.Zs(z(z({},r),{},{type:"rageclick"})),this.Zs(r)}Tv(t){!pS(t.target)&&w1(t)&&(clearTimeout(this.Pv),this.Pv=setTimeout(()=>{this.Zs(this.Rv(t,"mousemove"))},500))}Zs(t){if(!ee)return;const e=this.Ir.disable_capture_url_hashes?ma(ee.location.href):ee.location.href,n=this.Ir.custom_personal_data_properties,r=this.Ir.mask_personal_data_properties?[...mu,...n||[]]:[],s=gf(e,r,vf);this.Rt=this.Rt||{},this.Rt[s]||(this.Rt[s]=[]),this.Rt[s].push(t)}pa(){this.Rt&&!Nr(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:ES,webVitalsAutocapture:class{constructor(t){var e;this._instance=t,this.bv=!1,this._o=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Av=()=>{clearTimeout(this.Fv),this.Fv=void 0,this.Rt.metrics.length!==0&&(this._instance.capture("$web_vitals",z({$current_url:this.Rt.url},this.Rt.metrics.reduce((n,r)=>z(z({},n),{},{[`$web_vitals_${r.name}_event`]:z({},r),[`$web_vitals_${r.name}_value`]:r.value}),{}))),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Ov=n=>{var r;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},Xe(n==null?void 0:n.name)||Xe(n==null?void 0:n.value))return void Ja.error("Invalid metric received",n);const s=typeof n.navigationURL=="string"?n.navigationURL:void 0,i=this.Dv(s);if(le(i))return;const o=Xt(n.navigationId)||typeof n.navigationId=="string"?`navigation:${n.navigationId}`:`url:${i}`;if(this.Lv&&n.value>=this.Lv)return void Ja.error("Ignoring metric with value >= "+this.Lv,n);this.Rt.navigationKey!==o&&(this.Av(),this.Fv=setTimeout(this.Av,this.flushToCaptureTimeoutMs)),le(this.Rt.navigationKey)&&(this.Rt.navigationKey=o,this.Rt.url=i),this.Rt.firstMetricTimestamp=le(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;const l=(r=this._instance.sessionManager)===null||r===void 0?void 0:r.checkAndGetSessionAndWindowId(!0),u=z(z(z({},n),s?{navigationURL:i}:{}),{},{$current_url:i,timestamp:Date.now()});if(delete u.entries,st(n.attribution)&&this.attributionMetrics.indexOf(n.name)>-1){const d={};for(const h of H$){const p=h==="url"&&typeof n.attribution[h]=="string"?this.Dv(n.attribution[h]):n.attribution[h];le(p)||(d[h]=p)}u.attribution=d}else delete u.attribution;le(l)||(u.$session_id=l.sessionId,u.$window_id=l.windowId),this.Rt.metrics.push(u),this.Rt.metrics.length===this.allowedMetrics.length&&this.Av()},this.Nv=()=>{if(this._o)return;let n,r,s,i,o=!1;const l=Le.__PosthogExtensions__,u=l==null?void 0:l.postHogWebVitalsCallbacksByFlavor,d=(u==null?void 0:u[this.qv])||(this.qv==="web-vitals"&&le(u)?l==null?void 0:l.postHogWebVitalsCallbacks:void 0);if(!le(d)){const m=d.withoutAttribution,v=this.attributionMetrics;o=!le(m),n=v.indexOf("LCP")>-1?d.onLCP:(m==null?void 0:m.onLCP)||d.onLCP,r=v.indexOf("CLS")>-1?d.onCLS:(m==null?void 0:m.onCLS)||d.onCLS,s=v.indexOf("FCP")>-1?d.onFCP:(m==null?void 0:m.onFCP)||d.onFCP,i=v.indexOf("INP")>-1?d.onINP:(m==null?void 0:m.onINP)||d.onINP}if(!(n&&r&&s&&i))return void Ja.error("web vitals callbacks not loaded - not starting");const h={reportSoftNavs:this.useSoftNavs},p=o&&this.attributionMetrics.indexOf("INP")>-1?z(z({},h),{},{includeProcessedEventEntries:!1}):h;this.allowedMetrics.indexOf("LCP")>-1&&n(this.Ov.bind(this),h),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Ov.bind(this),h),this.allowedMetrics.indexOf("FCP")>-1&&s(this.Ov.bind(this),h),this.allowedMetrics.indexOf("INP")>-1&&i(this.Ov.bind(this),p),this._o=!0},this.bv=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[e_]),this.startIfEnabled()}get jv(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e;const n=st(this.jv)?(t=this.jv)===null||t===void 0?void 0:t.web_vitals_allowed_metrics:void 0;return Xe(n)?((e=this._instance.persistence)===null||e===void 0?void 0:e.props.$web_vitals_allowed_metrics)||KS:n}get flushToCaptureTimeoutMs(){return(st(this.jv)?this.jv.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){const t=st(this.jv)?this.jv.web_vitals_attribution:void 0;return xr(t)?t?KS:[]:He(t)?t:V$}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){const t=st(this.jv)?this.jv.__preview_web_vitals_soft_navs:void 0;return t!=null&&t}get Lv(){const t=st(this.jv)&&Xt(this.jv.__web_vitals_max_value)?this.jv.__web_vitals_max_value:GS;return t>0&&6e4>=t?GS:t}get isEnabled(){const t=Bt==null?void 0:Bt.protocol;if(t!=="http:"&&t!=="https:")return Ja.info("Web Vitals are disabled on non-http/https protocols"),!1;const e=st(this.jv)?this.jv.web_vitals:xr(this.jv)?this.jv:void 0;return xr(e)?e:this.bv}startIfEnabled(){this.isEnabled&&!this._o&&(Ja.info("enabled, starting..."),this.qo(this.Nv))}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if(!("capturePerformance"in e))return;const n=st(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=st(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[e_]:n}),this._instance.persistence.register({[nP]:r})),this.bv=n,this.startIfEnabled()}get qv(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}qo(t){var e;const n=Le.__PosthogExtensions__,r=this.qv,s=n==null?void 0:n.postHogWebVitalsCallbacksByFlavor;s!=null&&s[r]||r==="web-vitals"&&le(s)&&(n!=null&&n.postHogWebVitalsCallbacks)?t():n==null||(e=n.loadExternalDependency)===null||e===void 0||e.call(n,this._instance,r,i=>{i?Ja.error("failed to load script",i):t()})}Dv(t){const e=t||(ee==null?void 0:ee.location.href);if(!e)return void Ja.error("Could not determine current URL");const n=this._instance.config.disable_capture_url_hashes?ma(e):e,r=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...mu,...r||[]]:[];return gf(n,s,vf)}}},cj={exceptionObserver:class{constructor(t){var e;this.Nv=()=>{var n;if(!ee||!this.isEnabled||!(!((n=Le.__PosthogExtensions__)===null||n===void 0)&&n.errorWrappingFunctions))return;const r=Le.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=Le.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=Le.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Bv&&this.Ir.capture_unhandled_errors&&(this.Bv=r(this.captureException.bind(this))),!this.Hv&&this.Ir.capture_unhandled_rejections&&(this.Hv=s(this.captureException.bind(this))),!this.zv&&this.Ir.capture_console_errors&&(this.zv=i(this.captureException.bind(this)))}catch(o){Td.error("failed to start",o),this.Uv()}},this._instance=t,this.Wv=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[Qy]),this.wt=new sN(z(z({},(function(n={}){var r,s,i,o;return{refillRate:(r=(s=n.exceptionRateLimiterRefillRate)!==null&&s!==void 0?s:n.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(i=(o=n.exceptionRateLimiterBucketSize)!==null&&o!==void 0?o:n.__exceptionRateLimiterBucketSize)!==null&&i!==void 0?i:10}})(this._instance.config.error_tracking)),{},{refillInterval:1e4,$:Td})),this.Ir=this.Vv(),this.startIfEnabledOrStop()}Vv(){const t=this._instance.config.capture_exceptions;let e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return st(t)?e=z(z({},e),t):(le(t)?this.Wv:t)&&(e=z(z({},e),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Ir.capture_console_errors||this.Ir.capture_unhandled_errors||this.Ir.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Td.info("enabled"),this.Uv(),this.qo(this.Nv)):this.Uv()}qo(t){var e,n,r;!((e=Le.__PosthogExtensions__)===null||e===void 0)&&e.errorWrappingFunctions?t():(n=Le.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"exception-autocapture",s=>{if(s)return Td.error("failed to load script",s);t()})}Uv(){var t,e,n;(t=this.Bv)===null||t===void 0||t.call(this),this.Bv=void 0,(e=this.Hv)===null||e===void 0||e.call(this),this.Hv=void 0,(n=this.zv)===null||n===void 0||n.call(this),this.zv=void 0}onRemoteConfig(t){if(!t.ok)return;const e=t.config;"autocaptureExceptions"in e&&(this.Wv=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Qy]:this.Wv}),this.Ir=this.Vv(),this.startIfEnabledOrStop())}onConfigChange(){this.Ir=this.Vv()}captureException(t){try{var e,n,r;const s=(e=t==null||(n=t.$exception_list)===null||n===void 0||(n=n[0])===null||n===void 0?void 0:n.type)!==null&&e!==void 0?e:"Exception";if(this.wt.consumeRateLimit(s))return void Td.info("Skipping exception capture because of client rate limiting.",{exception:s});(r=this._instance.exceptions)===null||r===void 0||r.sendExceptionEvent(t)}catch{}}},exceptions:class{constructor(t){var e,n;this.Gv=[],this.Zv=new gN([new RN,new VN,new ON,new MN,new jN,new $N,new DN,new FN],(function(r,...s){return(i,o=0)=>{const l=[],u=i.split(`
19
+ `),d=Math.min(u.length,o+1e3),h=[];for(let v=o;d>v;v++){const w=u[v];if(w.length>1024)continue;const _=Y6.test(w)?w.replace(Y6,"$1"):w;if(!_.match(/\S*Error: /)){for(const x of s){const b=x(_,r);if(b){l.push(b);const k=PN(l);if(k){for(let C=h.length-1;C>=0;C--){const T=h[C];if(k.start>=T.start+T.length)break;h.pop()}h.push(k)}break}}if(IN(l,h)>=50)break}}const p=[...h].sort((v,w)=>w.start-v.start),m=p[p.length-1];if(m){const v=j3(l,m);l.splice(m.start-v,v);for(const w of p)w.start-=v}for(const v of p)TN(l,v);return h.some(v=>v.start===0&&l.length===v.length)&&(function(v){const w=v.map(x=>`${x.function}|${x.filename}|${x.lineno}|${x.colno}|${x.module}`);let _=0;for(let x=1;w.length>x;x++)AN(w,x,_)&&(_=x);v.push(...v.splice(0,_))})(l),(function(v){if(!v.length)return[];const w=Array.from(v);return w.reverse(),w.slice(0,50).map(_=>{return z(z({},_),{},{filename:_.filename||(x=w,x[x.length-1]||{}).filename,function:_.function||"?"});var x})})(l)}})("web:javascript",SN,CN)),this._instance=t,this.Gv=(e=(n=this._instance.persistence)===null||n===void 0?void 0:n.get_property("$error_tracking_suppression_rules"))!==null&&e!==void 0?e:[],this.Qv=$0(this.Jv()),this.Kv=new zN(this.Qv)}onConfigChange(){this.Qv=$0(this.Jv()),this.Kv.setConfig(this.Qv)}onRemoteConfig(t){var e,n,r;if(!t.ok)return;const s=t.config;if(!("errorTracking"in s))return;const i=(e=(n=s.errorTracking)===null||n===void 0?void 0:n.suppressionRules)!==null&&e!==void 0?e:[],o=(r=s.errorTracking)===null||r===void 0?void 0:r.captureExtensionExceptions;this.Gv=i,this._instance.persistence&&this._instance.persistence.register({[eP]:this.Gv,[Jy]:o})}get Xv(){var t;const e=!!this._instance.get_property(Jy),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.Zv.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.Qv.enabled)try{if(!tt(t)||t.trim().length===0)return void Ws.warn("Ignoring exception step because message must be a non-empty string");const{sanitizedProperties:n,droppedKeys:r}=(function(s){if(!s)return{sanitizedProperties:{},droppedKeys:[]};const i=[];return{sanitizedProperties:Object.keys(s).reduce((o,l)=>HN.has(l)?(i.push(l),o):(o[l]=s[l],o),{}),droppedKeys:i}})(this.Yv(e));r.length>0&&Ws.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.Kv.add(z({[D0]:t,[N0]:new Date().toISOString()},n))}catch(n){Ws.error("Failed to add exception step. Ignoring breadcrumb.",n)}}sendExceptionEvent(t){try{const e=t.$exception_list;if(this.tf(e)){if(this.ef(e))return this.if("Exception dropped: matched a suppression rule"),void Ws.info("Skipping exception capture because a suppression rule matched");if(!this.Xv&&this.nf(e))return this.if("Exception dropped: thrown by a browser extension"),void Ws.info("Skipping exception capture because it was thrown by an extension");if(!this.Xv&&this.sf(e))return this.if("Exception dropped: thrown by an injected browser script"),void Ws.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.rf(e))return this.if("Exception dropped: thrown by the PostHog SDK"),void Ws.info("Skipping exception capture because it was thrown by the PostHog SDK")}const n=this.Qv.enabled&&Xe(t.$exception_steps)?this.lf(t):t,r=(function(){const s=globalThis._posthogReleaseId;return typeof s=="string"&&s.length>0?s:void 0})();r&&(n.$release_id=r);try{const s=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",ah:!0});return s&&this.Kv.clear(),s}catch(s){return a8(s)||Ws.error("Failed to capture exception event. Dropping this exception.",s),void this.Kv.clear()}}catch(e){return void(a8(e)||Ws.error("Failed to process exception event. Ignoring this exception.",e))}}lf(t){try{const e=this.Kv.getAttachable();return e.length===0?t:z(z({},t),{},{$exception_steps:e})}catch(e){return Ws.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}if(t){this.Qv.enabled&&this.Kv.add({[D0]:t,[N0]:new Date().toISOString()})}Yv(t){return st(t)?z({},t):{}}Jv(){var t,e;return(t=(e=this._instance.config.error_tracking)===null||e===void 0?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}ef(t){if(t.length===0)return!1;try{const e=t.reduce((n,{type:r,value:s})=>(tt(r)&&r.length>0&&n.$exception_types.push(r),tt(s)&&s.length>0&&n.$exception_values.push(s),n),{$exception_types:[],$exception_values:[]});return this.Gv.some(n=>{const r=n.values.map(s=>{const i=o5[s.operator],o=e[s.key];if(!i||!o)return!1;const l=He(s.value)?s.value:[s.value];return l.length>0&&i(l,o)});return n.type==="OR"?r.some(Boolean):r.every(Boolean)})}catch(e){return Ws.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}nf(t){const e=t.flatMap(r=>{var s,i;return(s=(i=r.stacktrace)===null||i===void 0?void 0:i.frames)!==null&&s!==void 0?s:[]}),n=e.filter(({filename:r})=>!!r&&J$.some(s=>r.startsWith(s)));return n.length!==0&&(!n.every(({filename:r})=>!!r&&r.startsWith(g_))||t.some(({type:r,value:s})=>r==="NoResponse"||tt(s)&&Q$.some(({value:i,exact:o})=>o?s===i:s.includes(i)))&&!e.some(({in_app:r,filename:s})=>r&&!(s!=null&&s.startsWith(g_))))}sf(t){return t.some(({value:e})=>tt(e)&&ej.some(n=>e.includes(n)))}rf(t){if(t.length>0){var e,n,r,s;const i=(e=(n=t[0].stacktrace)===null||n===void 0?void 0:n.frames)!==null&&e!==void 0?e:[],o=i[i.length-1];return(r=o==null||(s=o.filename)===null||s===void 0?void 0:s.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}tf(t){return!Xe(t)&&He(t)}}},uj=z({productTours:class{get Ca(){return this._instance.persistence}constructor(t){this.af=null,this.uf=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if("productTours"in e){var n,r;if(this.Ca&&this.Ca.register({[rw]:!!e.productTours}),!x1(this._instance))return!this.af&&Xe((n=this.Ca)===null||n===void 0?void 0:n.props.ph_product_tours)||Pp.info("product tours disabled; stopping and clearing cached tours"),(r=this.af)===null||r===void 0||r.stop(),this.af=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.af&&x1(this._instance)&&this.qo(()=>this.hf())}qo(t){var e,n,r;!((e=Le.__PosthogExtensions__)===null||e===void 0)&&e.generateProductTours?t():(n=Le.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"product-tours",s=>{s?Pp.error("Could not load product tours script",s):t()})}hf(){var t;!this.af&&(!((t=Le.__PosthogExtensions__)===null||t===void 0)&&t.generateProductTours)&&(this.af=Le.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e=!1){if(He(this.uf)&&!e)return void t(this.uf,{isLoaded:!0});const n=this.Ca;if(n){const r=n.props[r_];if(He(r)&&!e)return this.uf=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:r=>{if(!x1(this._instance))return void t([],{isLoaded:!0});const s=r.statusCode;if(s!==200||!r.json){const o=`Product Tours API could not be loaded, status: ${s}`;return s===0?r.error||Pp.warn(o):Pp.error(o),void t([],{isLoaded:!1,error:o})}const i=He(r.json.product_tours)?r.json.product_tours:[];this.uf=i,n&&n.register({[r_]:i}),t(i,{isLoaded:!0})}})}getActiveProductTours(t){Xe(this.af)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.af.getActiveProductTours(t)}showProductTour(t){var e;(e=this.af)===null||e===void 0||e.showTourById(t)}previewTour(t){this.af?this.af.previewTour(t):this.qo(()=>{var e;this.hf(),(e=this.af)===null||e===void 0||e.previewTour(t)})}dismissProductTour(){var t;(t=this.af)===null||t===void 0||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.af)===null||t===void 0||t.nextStep()}previousStep(){var t;(t=this.af)===null||t===void 0||t.previousStep()}clearCache(){var t;this.uf=null,(t=this.Ca)===null||t===void 0||t.unregister("ph_product_tours")}resetTour(t){var e;(e=this.af)===null||e===void 0||e.resetTour(t)}resetAllTours(){var t;(t=this.af)===null||t===void 0||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.af)===null||e===void 0||e.cancelPendingTour(t)}}},Mm),dj={siteApps:class{constructor(t){this._instance=t,this.cf=0,this.df=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}vf(t,e){if(!e)return;const n=this.globalsForEvent(e);this.df.push(n),this.df.length>1e3&&(this.df=this.df.slice(10))}get siteAppLoaders(){var t;return(t=Le._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(t=t[this._instance.config.token])===null||t===void 0?void 0:t.siteApps}initialize(){if(this.isEnabled){const t=this._instance._addCaptureHook(this.vf.bind(this));this.ff=()=>{t(),this.df=[],this.ff=void 0}}}globalsForEvent(t){var e,n,r,s,i,o,l;if(!t)throw new Error("Event payload is required");const u={},d=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(const[v,w]of Object.entries(h))u[v]={id:d[v],type:v,properties:w};const{$set_once:p,$set:m}=t;return{event:z(z({},z3(t,B$)),{},{properties:z(z(z({},t.properties),m?{$set:z(z({},(e=(n=t.properties)===null||n===void 0?void 0:n.$set)!==null&&e!==void 0?e:{}),m)}:{}),p?{$set_once:z(z({},(r=(s=t.properties)===null||s===void 0?void 0:s.$set_once)!==null&&r!==void 0?r:{}),p)}:{}),elements_chain:(i=(o=t.properties)===null||o===void 0?void 0:o.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(l=t.properties)===null||l===void 0?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:u}}pf(t){var e;const n=(e=t.tagName)===null||e===void 0?void 0:e.toLowerCase();return n==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(di.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)||(di.error("prepare_external_dependency_script returned null"),null):t}gf(){var t,e,n,r,s,i,o,l;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};const u=ue==null?void 0:ue.defaultView,d=u==null||(t=u.Node)===null||t===void 0?void 0:t.prototype;if(!u||!d)return()=>{};if(this.cf++,this.mf)return this.yf();const h=[],p=this,m=new WeakSet,v=(x,b,k)=>{if(!(x!=null&&x[b]))return;const C=x[b];x[b]=k(C),h.push(()=>{x[b]=C})},w=x=>{if(m.has(x))return x;const b=p.pf(x);return b&&m.add(b),b},_=x=>x.map(b=>typeof b=="string"?b:w(b)).filter(b=>!Kt(b));return v(d,"appendChild",x=>function(b){const k=w(b);return k?x.call(this,k):b}),v(d,"insertBefore",x=>function(b,k){const C=w(b);return C?x.call(this,C,k):b}),v(d,"replaceChild",x=>function(b,k){const C=w(b);return C?x.call(this,C,k):k}),[(e=u.Element)===null||e===void 0?void 0:e.prototype,(n=u.Document)===null||n===void 0?void 0:n.prototype,(r=u.DocumentFragment)===null||r===void 0?void 0:r.prototype].forEach(x=>{v(x,"append",b=>function(...k){return b.apply(this,_(k))}),v(x,"prepend",b=>function(...k){return b.apply(this,_(k))})}),[(s=u.Element)===null||s===void 0?void 0:s.prototype,(i=u.CharacterData)===null||i===void 0?void 0:i.prototype,(o=u.DocumentType)===null||o===void 0?void 0:o.prototype].forEach(x=>{v(x,"before",b=>function(...k){return b.apply(this,_(k))}),v(x,"after",b=>function(...k){return b.apply(this,_(k))}),v(x,"replaceWith",b=>function(...k){const C=_(k);return k.length&&!C.length?void 0:b.apply(this,C)})}),v((l=u.Element)===null||l===void 0?void 0:l.prototype,"insertAdjacentElement",x=>function(b,k){const C=w(k);return C?x.call(this,b,C):null}),this.mf=()=>{h.forEach(x=>x()),this.mf=void 0},this.yf()}yf(){let t=!1;return()=>{var e;t||(t=!0,this.cf--,this.cf===0&&((e=this.mf)===null||e===void 0||e.call(this)))}}bf(t,e=!0){const n=this.gf();try{const r=t(n);return e&&n(),r}catch(r){throw n(),r}}setupSiteApp(t){const e=this.apps[t.id],n=()=>{var i;!e.errored&&this.df.length&&(di.info(`Processing ${this.df.length} events for site app with id ${t.id}`),this.df.forEach(o=>this.bf(()=>{var l;return(l=e.processEvent)===null||l===void 0?void 0:l.call(e,o)})),e.processedBuffer=!0),Object.values(this.apps).every(o=>o.processedBuffer||o.errored)&&((i=this.ff)===null||i===void 0||i.call(this))};let r=!1;const s=i=>{e.errored=!i,e.loaded=!0,di.info(`Site app with id ${t.id} ${i?"loaded":"errored"}`),r&&n()};try{const{processEvent:i}=this.bf(o=>t.init({posthog:this._instance,callback(l){o(),s(l)}}),!1);i&&(e.processEvent=i),r=!0}catch(i){di.error(XS+t.id,i),s(!1)}if(r&&e.loaded)try{n()}catch(i){di.error(`Error while processing buffered events PostHog app with config id ${t.id}`,i),e.errored=!0}}_f(){const t=this.siteAppLoaders||[];for(const e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(const e of t)this.setupSiteApp(e)}wf(t){if(Object.keys(this.apps).length===0)return;const e=this.globalsForEvent(t);for(const n of Object.values(this.apps))try{this.bf(()=>{var r;return(r=n.processEvent)===null||r===void 0?void 0:r.call(n,e)})}catch(r){di.error(`Error while processing event ${t.event} for site app ${n.id}`,r)}}onRemoteConfig(t){var e,n,r;if(!((e=this.siteAppLoaders)===null||e===void 0)&&e.length)return this.isEnabled?(this._f(),void this._instance.on("eventCaptured",l=>this.wf(l))):void di.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.ff)===null||n===void 0||n.call(this),!t.ok)return;const s=t.config;if(!((r=s.siteApps)===null||r===void 0)&&r.length)if(this.isEnabled)for(const{id:l,url:u}of s.siteApps){var i,o;Le[`__$$ph_site_app_${l}`]=this._instance,(i=Le.__PosthogExtensions__)===null||i===void 0||(o=i.loadSiteApp)===null||o===void 0||o.call(i,this._instance,u,d=>{if(d)return di.error(XS+l,d)})}else di.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},fj={tracingHeaders:class{constructor(t){this._instance=t,this.kf=void 0,this.Sf=void 0,this.xf=void 0,this.Nv=()=>{const e=this.Cf();var n,r;e?(le(this.kf)&&(this.kf=(n=Le.__PosthogExtensions__)===null||n===void 0||(n=n.tracingHeadersPatchFns)===null||n===void 0?void 0:n._patchXHR(e,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),le(this.Sf)&&(this.Sf=(r=Le.__PosthogExtensions__)===null||r===void 0||(r=r.tracingHeadersPatchFns)===null||r===void 0?void 0:r._patchFetch(e,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.Uv()}}initialize(){this.startIfEnabledOrStop()}qo(t){var e,n,r;!((e=Le.__PosthogExtensions__)===null||e===void 0)&&e.tracingHeadersPatchFns?t():(n=Le.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"tracing-headers",s=>{if(s)return F$.error("failed to load script",s);t()})}$f(){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}Cf(){const t=this.$f();return He(t)?(He(this.xf)?this.xf.splice(0,this.xf.length,...t):this.xf=[...t],t.length>0?this.xf:void 0):(He(this.xf)&&this.xf.splice(0),this.xf=t||void 0,this.xf)}Uv(){var t,e;(t=this.kf)===null||t===void 0||t.call(this),(e=this.Sf)===null||e===void 0||e.call(this),this.kf=void 0,this.Sf=void 0}startIfEnabledOrStop(){this.Cf()?this.qo(this.Nv):this.Uv()}}},hj=z({surveys:class extends U${constructor(t){var e;super(new K$(t),(e=t,{get projectToken(){return e.config.token},kv:new G$(e)})),this._instance=t}Oh(t,e){const n=e.query?Kf(t,e.query):t;return new Promise(r=>{var s;this._instance._send_request({method:e.method,url:this._instance.requestRouter.endpointFor((s=e.target)!==null&&s!==void 0?s:"api",n),data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,timestampMode:e.sentAt,callback:r})})}}},Mm),pj={toolbar:class{constructor(t){this.instance=t}If(t){Le.ph_toolbar_state=t}Tf(){var t;return(t=Le.ph_toolbar_state)!==null&&t!==void 0?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t=void 0,e=void 0,n=void 0){var r,s;if(i_(this.instance.config)||!ee||!ue)return!1;t=(r=t)!==null&&r!==void 0?r:ee.location,n=(s=n)!==null&&s!==void 0?s:ee.history;try{if(!e){try{ee.localStorage.setItem("test","test"),ee.localStorage.removeItem("test")}catch{return!1}e=ee==null?void 0:ee.localStorage}const i=Y$||W0(t.hash,"__posthog")||W0(t.hash,"state");let o;const l=i?Z6(()=>JSON.parse(atob(decodeURIComponent(i))))||Z6(()=>JSON.parse(decodeURIComponent(i))):null;return l&&l.action==="ph_authorize"?(o=l,o.source="url",o&&Object.keys(o).length>0&&(l.desiredHash?t.hash=l.desiredHash:n?n.replaceState(n.state,"",t.pathname+t.search):t.hash="")):(o=JSON.parse(e.getItem(JS)||"{}"),o.source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token||(this.loadToolbar(o),0))}catch{return!1}}Mf(t){const e=Le.ph_load_toolbar||Le.ph_load_editor;!Xe(e)&&Nn(e)?e(t,this.instance):e8.warn("No toolbar load function found")}loadToolbar(t){const e=!!(ue!=null&&ue.getElementById("__POSTHOG_TOOLBAR__"));if(!ee||e)return!1;const n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=z(z({token:this.instance.config.token},t),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(ee.localStorage.setItem(JS,JSON.stringify(z(z({},r),{},{source:void 0}))),this.Tf()===2)this.Mf(r);else if(this.Tf()===0){var s,i;this.If(1),(s=Le.__PosthogExtensions__)===null||s===void 0||(i=s.loadExternalDependency)===null||i===void 0||i.call(s,this.instance,"toolbar",o=>{if(o)return e8.error("[Toolbar] Failed to load",o),void this.If(0);this.If(2),this.Mf(r)}),yt(ee,"turbolinks:load",()=>{this.If(0),this.loadToolbar(r)})}return!0}Ef(t){return this.loadToolbar(t)}maybeLoadEditor(t=void 0,e=void 0,n=void 0){return this.maybeLoadToolbar(t,e,n)}}},mj=z({experiments:class gr{get Ir(){return this._instance.config}constructor(e){this._instance=e,this.getWebExperimentsAndEvaluateDisplayLogic=(n=!1)=>{this.getWebExperiments(r=>{gr.Pf("retrieved web experiments from the server"),this.Rf=new Map,r.forEach(s=>{if(s.feature_flag_key){var i;this.Rf&&(gr.Pf("setting flag key ",s.feature_flag_key," to web experiment ",s),(i=this.Rf)===null||i===void 0||i.set(s.feature_flag_key,s));const o=this._instance.getFeatureFlag(s.feature_flag_key);tt(o)&&s.variants[o]&&this.Af(s.name,o,s.variants[o].transforms)}else if(s.variants)for(const o in s.variants){const l=s.variants[o];gr.Ff(l,this._instance)&&this.Af(s.name,o,l.transforms)}})},n)},this._instance.onFeatureFlags(n=>{this.onFeatureFlags(n)})}initialize(){}onFeatureFlags(e){if(this._is_bot())gr.Pf(l8);else if(!this.Ir.disable_web_experiments){if(Xe(this.Rf))return this.Rf=new Map,this.loadIfEnabled(),void this.previewWebExperiment();gr.Pf("applying feature flags",e),e.forEach(n=>{var r;if(this.Rf&&(!((r=this.Rf)===null||r===void 0)&&r.has(n))){var s;const i=this._instance.getFeatureFlag(n),o=(s=this.Rf)===null||s===void 0?void 0:s.get(n);i&&(o!=null&&o.variants[i])&&this.Af(o.name,i,o.variants[i].transforms)}})}}previewWebExperiment(){const e=gr.getWindowLocation();if(e!=null&&e.search){const n=pu(e==null?void 0:e.search,"__experiment_id"),r=pu(e==null?void 0:e.search,"__experiment_variant");n&&r&&(gr.Pf(`previewing web experiments ${n} && ${r}`),this.getWebExperiments(s=>{this.Of(parseInt(n),r,s)},!1,!0))}}loadIfEnabled(){this.Ir.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this.Ir.disable_web_experiments&&!r)return e([]);const 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.Ir.token}`),method:"GET",timestampMode:"query",callback:i=>e(i.statusCode===200&&i.json&&i.json.experiments||[])})}Of(e,n,r){const s=r.filter(i=>i.id===e);s&&s.length>0&&(gr.Pf(`Previewing web experiment [${s[0].name}] with variant [${n}]`),this.Af(s[0].name,n,s[0].variants[n].transforms))}static Ff(e,n){return!Xe(e.conditions)&&gr.Df(e,n)&&gr.Lf(e)}static Df(e,n){var r;if(Xe(e.conditions)||Xe((r=e.conditions)===null||r===void 0?void 0:r.url))return!0;const s=gr.getWindowLocation();if(s){var i,o,l;const u=_P(n,s.href);return!(!((i=e.conditions)===null||i===void 0)&&i.url)||tj[(o=(l=e.conditions)===null||l===void 0?void 0:l.urlMatchType)!==null&&o!==void 0?o:"icontains"](e.conditions.url,u)}return!1}static getWindowLocation(){return ee==null?void 0:ee.location}static Lf(e){var n;if(Xe(e.conditions)||Xe((n=e.conditions)===null||n===void 0?void 0:n.utm))return!0;const r=RP();if(r.utm_source){var s,i,o,l,u,d,h,p;const m=!(!((s=e.conditions)===null||s===void 0||(s=s.utm)===null||s===void 0)&&s.utm_campaign)||((i=e.conditions)===null||i===void 0||(i=i.utm)===null||i===void 0?void 0:i.utm_campaign)==r.utm_campaign,v=!(!((o=e.conditions)===null||o===void 0||(o=o.utm)===null||o===void 0)&&o.utm_source)||((l=e.conditions)===null||l===void 0||(l=l.utm)===null||l===void 0?void 0:l.utm_source)==r.utm_source,w=!(!((u=e.conditions)===null||u===void 0||(u=u.utm)===null||u===void 0)&&u.utm_medium)||((d=e.conditions)===null||d===void 0||(d=d.utm)===null||d===void 0?void 0:d.utm_medium)==r.utm_medium,_=!(!((h=e.conditions)===null||h===void 0||(h=h.utm)===null||h===void 0)&&h.utm_term)||((p=e.conditions)===null||p===void 0||(p=p.utm)===null||p===void 0?void 0:p.utm_term)==r.utm_term;return m&&w&&_&&v}return!1}static Pf(e,...n){ge.info(`[WebExperiments] ${e}`,n)}Af(e,n,r){this._is_bot()?gr.Pf(l8):n!=="control"?r.forEach(s=>{if(s.selector){var i;gr.Pf(`applying transform of variant ${n} for experiment ${e} `,s);const o=(i=document)===null||i===void 0?void 0:i.querySelectorAll(s.selector);o==null||o.forEach(l=>{const u=l;s.html&&(u.innerHTML=s.html),s.css&&u.setAttribute("style",s.css)})}}):gr.Pf("Control variants leave the page unmodified.")}_is_bot(){return $n&&this._instance?r5($n,this.Ir.custom_blocked_useragents):void 0}}},Mm),gj={conversations:class{constructor(t){this._instance=t,this.Nf=void 0,this._conversationsManager=null,this.qf=!1,this.ne=null,this.jf=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(this._instance.config.disable_conversations||(this.Bf=t.ok,!t.ok))return;const e=t.config.conversations;Xe(e)||(xr(e)?this.Nf=e:(this.Nf=e.enabled,this.ne=e),this.loadIfEnabled())}reset(){var t;(t=this._conversationsManager)===null||t===void 0||t.reset(),this._conversationsManager=null,this.Nf=void 0,this.ne=null,this.Bf=void 0,this.jf=!1}loadIfEnabled(){if(this._conversationsManager||this.qf||this._instance.config.disable_conversations||i_(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())return;const t=Le==null?void 0:Le.__PosthogExtensions__;if(t&&!le(this.Nf)&&this.Nf)if(this.ne&&this.ne.token){this.qf=!0;try{const e=t.initConversations;if(e)return this.Hf(e),void(this.qf=!1);const n=t.loadExternalDependency;if(!n)return void this.zf(iw);n(this._instance,"conversations",r=>{r||!t.initConversations?this.zf("Could not load conversations script",r):this.Hf(t.initConversations),this.qf=!1})}catch(e){this.zf("Error initializing conversations",e),this.qf=!1}}else Es.error("Conversations enabled but missing token in remote config.")}Hf(t){if(this.ne)try{this._conversationsManager=t(this.ne,this._instance),this.jf=!1,Es.info("Conversations loaded successfully")}catch(e){this.zf("Error completing conversations initialization",e)}else Es.error("Cannot complete initialization: remote config is null")}zf(t,e){Es.error(t,e),this._conversationsManager=null,this.qf=!1,this.jf=!0}show(){this._conversationsManager?this._conversationsManager.show():Es.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Nf===!0&&!Kt(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":i_(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.Bf===!1?"remote_config_failed":le(this.Nf)?this.Bf?"disabled_in_project":"remote_config_pending":this.Nf?Xe(this.ne)||!this.ne.token?"missing_token":Le!=null&&Le.__PosthogExtensions__?this.qf?"initializing":this.jf?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,n){var r=this;return Mt(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,n):(Es.warn(tl),null)})()}getMessages(t,e){var n=this;return Mt(function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(Es.warn(tl),null)})()}markAsRead(t){var e=this;return Mt(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(Es.warn(tl),null)})()}getTickets(t){var e=this;return Mt(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(Es.warn(tl),null)})()}requestRestoreLink(t){var e=this;return Mt(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(Es.warn(tl),null)})()}restoreFromToken(t){var e=this;return Mt(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(Es.warn(tl),null)})()}restoreFromUrlToken(){var t=this;return Mt(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Es.warn(tl),null)})()}getCurrentTicketId(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.getWidgetSessionId())!==null&&t!==void 0?t:null}bh(){var t;(t=this._conversationsManager)===null||t===void 0||t.setIdentity()}_h(){var t;(t=this._conversationsManager)===null||t===void 0||t.clearIdentity()}}},vj={logs:class{constructor(t){var e;this._instance=t,this.name="logs",this.Uf=!1,this.Wf=!1,this.Vf=!1,this.$=qt("[logs]"),this.Gf=z(z({},this.$),{},{error:(...n)=>{n.some(d8)||this.$.error(...n)}}),this.na=[],this.Zf=[],this.od=0,this.xo=!1,this.Qf=[],this.Jf=[],this.Kf=!1,this.Xf=!1,this.Yf=()=>{var n,r;this.xo||(this.od=0,(n=this.tp)===null||n===void 0||n.onReconnect(),(r=this.ep)===null||r===void 0||r.onReconnect())},this._instance&&(!((e=this._instance.config.logs)===null||e===void 0)&&e.captureConsoleLogs)&&(this.Uf=!0),ee&&yt(ee,"online",this.Yf)}np(t,e,n,r){var s;const i=c8((s=this._instance)===null||s===void 0||(s=s.config)===null||s===void 0?void 0:s.logs,n);return[new QN(this.sp(t,e),i,this.Gf,()=>this.rp(),o=>o(),void 0,r),i]}op(){var t;const e=(t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.logs;var n;return this.tp&&this.lp===e||((n=this.tp)===null||n===void 0||n.reset(),this.lp=e,[this.tp,this.ap]=this.np(()=>this.na,r=>{this.na=r})),this.tp}up(){var t;const e=(t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.logs;var n;return this.ep&&this.hp===e||((n=this.ep)===null||n===void 0||n.reset(),this.hp=e,[this.ep,this.cp]=this.np(()=>this.Zf,r=>{this.Zf=r},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},u8)),this.ep}setup(t){var e;if(this.xo)return;this.mo=t,!((e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0||(e=e.logs)===null||e===void 0)&&e.captureConsoleLogs&&(this.Uf=!0),(this.Uf||this.dp()&&this.vp())&&this.fp();let n=!1;const r=t.onRemoteConfig(s=>{var i;n=s.ok&&((i=s.config.logs)===null||i===void 0?void 0:i.captureConsoleLogs)===!0,this.onRemoteConfig(s)});this.xo?r.dispose():(this.Io=r,n||this.loadIfEnabled())}dispose(){var t,e,n,r;this.xo||(this.xo=!0,this.pp(),(t=this.Io)===null||t===void 0||t.dispose(),this.Io=void 0,this.mo=void 0,this.Vf=!1,ee==null||ee.removeEventListener("online",this.Yf),(e=this.gp)===null||e===void 0||e.call(this),this.gp=void 0,(n=this.tp)===null||n===void 0||n.reset(),(r=this.ep)===null||r===void 0||r.reset())}onRemoteConfig(t){var e,n;if(this.xo)return;const r=t.ok?(e=t.config.logs)===null||e===void 0?void 0:e.captureConsoleLogs:void 0;Xe(r)?this.mp():((n=this._instance)===null||n===void 0||(n=n.persistence)===null||n===void 0||n.register({$logs_capture_enabled_server_side:!!r}),r?(this.Uf=!0,this.Wf||this.fp(),this.loadIfEnabled()):this.mp())}reset(){var t,e,n,r;this.pp(),(t=this.tp)===null||t===void 0||t.clearQueue(),this.na=[],(e=this.tp)===null||e===void 0||e.reset(),(n=this.ep)===null||n===void 0||n.clearQueue(),this.Zf=[],(r=this.ep)===null||r===void 0||r.reset(),this.od=0}captureLog(t){this.xo||this.op().captureLog(t)}captureConsoleLog(t){this.xo||this.up().captureLog(t)}captureBufferedConsoleLog(t,e,n){this.xo||this.up().captureLog(t,{context:e,occurredAtMs:n})}vp(){var t;return!!(!((t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||(t=t.props)===null||t===void 0)&&t[tP])}dp(){var t,e,n;return!(!((t=this._instance)===null||t===void 0||(e=t.Yl)===null||e===void 0)&&e.call(t))||!!(!((n=Le._POSTHOG_REMOTE_CONFIG)===null||n===void 0||(n=n[this._instance.config.token])===null||n===void 0)&&n.config)}kh(){var t;this.pp(),(t=this.ep)===null||t===void 0||t.clearQueue(),this.Zf=[]}mp(){this.Uf||this.pp()}fp(){var t;if(this.Kf||!(Le!=null&&Le.console))return;const e=c8((t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.logs).maxBufferSize;let n=!0;this.Jf.push(()=>{n=!1});for(const r of nj){let s;try{s=rj(Le.console[r])}catch{continue}s&&this.Jf.push(yf(Le.console,r,i=>{const o=(...l)=>{try{n&&this.yp(r,l,e)}catch{}return i.apply(Le.console,l)};return o.__rrweb_original__=s,o}))}this.Kf=!0,this.bp=setTimeout(()=>{this.pp()},3e4)}yp(t,e,n){var r;if(this.Kf&&!this.Xf&&e.length!==0)if(!((r=this._instance)===null||r===void 0)&&r.is_capturing()){if(n>this.Qf.length){this.Xf=!0;try{this.Qf.push({level:t,args:e,occurredAtMs:Date.now(),context:this.rp()})}finally{this.Xf=!1}}}else this.pp()}pp(){if(this.Qf=[],this.Kf){this.Kf=!1,this.bp&&(clearTimeout(this.bp),this.bp=void 0);for(const t of this.Jf)t();this.Jf=[]}}_p(){const t=this.Qf;return this.pp(),t}get logger(){return this.wp||(this.wp={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.wp}flushLogs(t){t?this.kp(t):(this.tp&&this.tp.flush().catch(e=>this.Sp(e)),this.ep&&this.ep.flush().catch(e=>this.Sp(e)))}Sp(t){d8(t)||this.$.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(this.xo||!this.Uf||this.Wf||this.Vf)return;const t=Le==null?void 0:Le.__PosthogExtensions__;if(!t)return this.$.error("PostHog Extensions not found."),void this.pp();const e=t.loadExternalDependency;if(!e)return this.$.error(iw),void this.pp();this.Vf=!0;try{e(this._instance,"logs",n=>{if(this.Vf=!1,this.xo||!this.Uf)return;const r=t.logs;if(n||!(r!=null&&r.initializeLogs))this.$.error("Could not load logs script",n),this.pp();else{var s;const l=this._p();var i,o;this.gp=r.initializeLogs((s=this.mo)!==null&&s!==void 0?s:this._instance),this.Wf=!0,l.length>0&&((i=r.replayConsoleBuffer)===null||i===void 0||i.call(r,(o=this.mo)!==null&&o!==void 0?o:this._instance,l))}})}catch(n){throw this.Vf=!1,n}}sp(t,e){const n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:r=>r===vi.LogsQueue?t():void 0,setPersistedProperty(r,s){var i;r===vi.LogsQueue&&e((i=s)!==null&&i!==void 0?i:[])},js:r=>this.js(r),getLibraryId:()=>Tn.LIB_NAME,getLibraryVersion:()=>Tn.LIB_VERSION}}js(t){return new Promise(e=>{if(IP(this.od,3))return void e({kind:"fatal",error:S1(void 0,"logs endpoint is unreachable, dropping batch")});let n=!1;const r=i=>{n||(n=!0,clearTimeout(s),e(i))},s=setTimeout(()=>{this.$.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:S1(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.xp(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:i=>{const o=i.statusCode;if(this.Cp(o),o>=200&&300>o)r({kind:"ok"});else if(o===413)r({kind:"too-large"});else if(o!==0&&o!==408&&o!==429&&500>o)r({kind:"fatal",error:new Error(`logs request failed with status ${o}`)});else{var l;o===0?(i.error||this.$.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:S1(i.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:(l=i.error)!==null&&l!==void 0?l:new Error(`logs request failed with status ${o}`)})}}})})}Cp(t){(t!==0||this._instance.__loaded)&&(this.od=AP(t,this.od,3,()=>this.$.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}kp(t){this.na.length>0&&this.$p(t,this.na,this.ap,Tn.LIB_NAME,e=>{this.na=e}),this.Zf.length>0&&this.$p(t,this.Zf,this.cp,u8,e=>{this.Zf=e})}$p(t,e,n,r,s){if(e.length===0)return;const i=e.map(l=>l.record);s([]);const o=G3(i,q3(n,Tn.LIB_NAME,Tn.LIB_VERSION),r,Tn.LIB_VERSION);this._instance._send_request({method:"POST",url:this.xp(),data:o,compression:"best-available",batchKey:"logs",transport:t})}xp(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}rp(){var t;const e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){const{sessionId:n,windowId:r,sessionStartTimestamp:s,lastActivityTimestamp:i}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);e.sessionId=n,e.windowId=r,Xe(s)||(e.sessionStartTimestamp=s),Xe(i)||(e.lastActivityTimestamp=i)}if(!(Le==null||(t=Le.location)===null||t===void 0)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?ma(Le.location.href):Le.location.href),this._instance.featureFlags){const n=this._instance.featureFlags.getFlags();n&&n.length>0&&(e.activeFeatureFlags=n)}return e}}},yj={metrics:class{constructor(t){this._instance=t,this.$=qt("[metrics]"),this.xo=!1}initialize(){this.onConfigChange()}onConfigChange(){var t;if(this.xo)return;const e=!!(!((t=this._instance.config.metrics)===null||t===void 0)&&t.network);e&&!this.Ip?this.Ip=(n=>{let r=!0;const s=()=>r?(l=>{var u;const d=(u=l.config.metrics)===null||u===void 0?void 0:u.network;return d===!0?{}:d||void 0})(n):void 0,i=ij(n,s),o=oj(n,s);return()=>{r=!1,i(),o()}})(this._instance):!e&&this.Ip&&(this.Ip(),this.Ip=void 0)}op(){var t;const e=(t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.metrics;var n;return this.tp&&this.lp===e||((n=this.tp)===null||n===void 0||n.reset(),this.lp=e,this.tp=new JN(this.sp(),(function(r){var s,i,o,l,u;const d=r==null?void 0:r.resourceAttributes;return{serviceName:(s=d==null?void 0:d["service.name"])!==null&&s!==void 0?s:r==null?void 0:r.serviceName,serviceVersion:(i=d==null?void 0:d["service.version"])!==null&&i!==void 0?i:r==null?void 0:r.serviceVersion,environment:(o=d==null?void 0:d["deployment.environment"])!==null&&o!==void 0?o:r==null?void 0:r.environment,resourceAttributes:d,beforeSend:r==null?void 0:r.beforeSend,flushIntervalMs:(l=r==null?void 0:r.flushIntervalMs)!==null&&l!==void 0?l:1e4,maxSeriesPerFlush:(u=r==null?void 0:r.maxSeriesPerFlush)!==null&&u!==void 0?u:1e3}})(e),this.$)),this.tp}count(t,e=1,n){this.op().count(t,e,n)}gauge(t,e,n){this.op().gauge(t,e,n)}histogram(t,e,n){this.op().histogram(t,e,n)}flush(t){if(!this.tp)return Promise.resolve();if(t){const e=this.tp.drainWindow();return e&&this.Ys(e,t),Promise.resolve()}return this.tp.flush().catch(e=>this.$.error("PostHog metrics flush failed:",e))}reset(){var t;(t=this.tp)===null||t===void 0||t.reset()}dispose(){var t,e;this.xo=!0,(t=this.Ip)===null||t===void 0||t.call(this),this.Ip=void 0,(e=this.tp)===null||e===void 0||e.reset()}sp(){const t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Ys:n=>e.Ys(n),getLibraryId:()=>Tn.LIB_NAME,getLibraryVersion:()=>Tn.LIB_VERSION}}Ys(t,e){return new Promise(n=>{let r=!1;const s=o=>{r||(r=!0,clearTimeout(i),n(o))},i=setTimeout(()=>s({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(z(z({method:"POST",url:this.Tp(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e}),{},{fireCallbackOnDrop:!0,callback(o){const l=o.statusCode;if(l>=200&&300>l)s({kind:"ok"});else if(l===413)s({kind:"too-large"});else if(l!==0&&l!==408&&l!==429&&500>l)s({kind:"fatal",error:new Error(`metrics request failed with status ${l}`)});else{var u;s({kind:"retry-later",error:(u=o.error)!==null&&u!==void 0?u:new Error(`metrics request failed with status ${l}`)})}}}))})}Tp(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}};Xd.__defaultExtensionClasses=z({},z(z(z(z(z(z(z(z(z(z(z(z(z({},Mm),aj),lj),cj),uj),dj),hj),fj),pj),mj),gj),vj),yj));const _j=(function(){Tn.SDK_DIST_CHANNEL="npm";const t=Kd[Nd]=new Xd;return(function(){function e(){e.done||(e.done=!0,t5=!1,bt(Kd,function(n){n._dom_loaded()}))}ue!=null&&ue.addEventListener?ue.readyState==="complete"?e():yt(ue,"DOMContentLoaded",e,{capture:!1}):ee&&ge.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})();var Ee=_j,wj=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();var xj=function(t,e,n){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:n?"".concat(n," ",e):e})},Tp,m5;function bj(t){m5=t}function y_(){return m5}var mw=g.createContext({get client(){return y_()},bootstrap:void 0});function g5(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 i=0,o=r;i<o.length;i++){var l=o[i];if(!s.includes(l)||!g5(t[l],e[l],n))return!1}return!0}function Sj(t){var e,n,r=t.children,s=t.client,i=t.apiKey,o=t.options,l=g.useRef(null),u=g.useMemo(function(){if(s)return i&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),o&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),s;var d=y_();return i||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."),d},[s,i,JSON.stringify(o)]);return g.useEffect(function(){if(!(s||!i)){var d=y_(),h=l.current;h?(i!==h.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."),o&&!g5(o,h.options)&&d.set_config(o),l.current={apiKey:i,options:o??{}}):(d.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),d.init(i,o),l.current={apiKey:i,options:o??{}})}},[s,i,JSON.stringify(o)]),we.createElement(mw.Provider,{value:{client:u,bootstrap:(e=o==null?void 0:o.bootstrap)!==null&&e!==void 0?e:(n=s==null?void 0:s.config)===null||n===void 0?void 0:n.bootstrap}},r)}var E1=function(t){return typeof t=="function"},Ej=function(t){return t===void 0},Yf=function(){var t=g.useContext(mw).client;return t},a0=function(t){var e=Object.prototype.toString.call(t);return t instanceof Error||e==="[object Error]"||e==="[object Exception]"||e==="[object DOMException]"||e==="[object DOMError]"},kj=function(t,e){for(var n=new WeakSet,r=t;!n.has(r);){if(n.add(r),!a0(r.cause)){Ej(r.cause)||(e.cause=r.cause),r.cause=e;return}r=r.cause}},Cj=function(t,e){if(!e)return t;var n=new Error(a0(t)?t.message:"Primitive value captured as exception: ".concat(String(t)));return n.name="React ErrorBoundary ".concat(a0(t)?t.name:"Error"),n.stack=e,a0(t)?(kj(t,n),t):n},f8={componentStack:null,exceptionEvent:null,error:null},Pj={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},Tj=(Tp=(function(t){wj(e,t);function e(n){var r=t.call(this,n)||this;return r._resetError=function(){r.setState(f8)},r.state=f8,r}return e.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;E1(s)?i=s(n,r):typeof s=="object"&&(i=s);var o=this.context.client,l=r.componentStack,u=o.captureException(Cj(n,l),i);this.setState({error:n,componentStack:l??null,exceptionEvent:u})},e.prototype.render=function(){var n=this.props,r=n.children,s=n.fallback,i=this.state;if(i.componentStack==null)return E1(r)?r():r;var o=E1(s)?we.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent,resetError:this._resetError}):s;return we.isValidElement(o)?o:(console.warn(Pj.INVALID_FALLBACK),we.createElement(we.Fragment,null))},e})(we.Component),xj(Tp,"PostHogErrorBoundary"),(function(){Tp.contextType=mw})(),Tp);bj(Ee);var Ip={},k1={exports:{}},Or={},C1={exports:{}},P1={};/**
20
+ * @license React
21
+ * scheduler.production.min.js
22
+ *
23
+ * Copyright (c) Facebook, Inc. and its affiliates.
24
+ *
25
+ * This source code is licensed under the MIT license found in the
26
+ * LICENSE file in the root directory of this source tree.
27
+ */var h8;function Ij(){return h8||(h8=1,(function(t){function e(V,J){var B=V.length;V.push(J);e:for(;0<B;){var D=B-1>>>1,X=V[D];if(0<s(X,J))V[D]=J,V[B]=X,B=D;else break e}}function n(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var J=V[0],B=V.pop();if(B!==J){V[0]=B;e:for(var D=0,X=V.length,ce=X>>>1;D<ce;){var se=2*(D+1)-1,re=V[se],de=se+1,ye=V[de];if(0>s(re,B))de<X&&0>s(ye,re)?(V[D]=ye,V[de]=B,D=de):(V[D]=re,V[se]=B,D=se);else if(de<X&&0>s(ye,B))V[D]=ye,V[de]=B,D=de;else break e}}return J}function s(V,J){var B=V.sortIndex-J.sortIndex;return B!==0?B:V.id-J.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var u=[],d=[],h=1,p=null,m=3,v=!1,w=!1,_=!1,x=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(V){for(var J=n(d);J!==null;){if(J.callback===null)r(d);else if(J.startTime<=V)r(d),J.sortIndex=J.expirationTime,e(u,J);else break;J=n(d)}}function T(V){if(_=!1,C(V),!w)if(n(u)!==null)w=!0,W(I);else{var J=n(d);J!==null&&Y(T,J.startTime-V)}}function I(V,J){w=!1,_&&(_=!1,b(A),A=-1),v=!0;var B=m;try{for(C(J),p=n(u);p!==null&&(!(p.expirationTime>J)||V&&!F());){var D=p.callback;if(typeof D=="function"){p.callback=null,m=p.priorityLevel;var X=D(p.expirationTime<=J);J=t.unstable_now(),typeof X=="function"?p.callback=X:p===n(u)&&r(u),C(J)}else r(u);p=n(u)}if(p!==null)var ce=!0;else{var se=n(d);se!==null&&Y(T,se.startTime-J),ce=!1}return ce}finally{p=null,m=B,v=!1}}var M=!1,R=null,A=-1,L=5,N=-1;function F(){return!(t.unstable_now()-N<L)}function j(){if(R!==null){var V=t.unstable_now();N=V;var J=!0;try{J=R(!0,V)}finally{J?Q():(M=!1,R=null)}}else M=!1}var Q;if(typeof k=="function")Q=function(){k(j)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,Z=q.port2;q.port1.onmessage=j,Q=function(){Z.postMessage(null)}}else Q=function(){x(j,0)};function W(V){R=V,M||(M=!0,Q())}function Y(V,J){A=x(function(){V(t.unstable_now())},J)}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(V){V.callback=null},t.unstable_continueExecution=function(){w||v||(w=!0,W(I))},t.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<V?Math.floor(1e3/V):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_getFirstCallbackNode=function(){return n(u)},t.unstable_next=function(V){switch(m){case 1:case 2:case 3:var J=3;break;default:J=m}var B=m;m=J;try{return V()}finally{m=B}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(V,J){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var B=m;m=V;try{return J()}finally{m=B}},t.unstable_scheduleCallback=function(V,J,B){var D=t.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?D+B:D):B=D,V){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=B+X,V={id:h++,callback:J,priorityLevel:V,startTime:B,expirationTime:X,sortIndex:-1},B>D?(V.sortIndex=B,e(d,V),n(u)===null&&V===n(d)&&(_?(b(A),A=-1):_=!0,Y(T,B-D))):(V.sortIndex=X,e(u,V),w||v||(w=!0,W(I))),V},t.unstable_shouldYield=F,t.unstable_wrapCallback=function(V){var J=m;return function(){var B=m;m=J;try{return V.apply(this,arguments)}finally{m=B}}}})(P1)),P1}var p8;function Aj(){return p8||(p8=1,C1.exports=Ij()),C1.exports}/**
28
+ * @license React
29
+ * react-dom.production.min.js
30
+ *
31
+ * Copyright (c) Facebook, Inc. and its affiliates.
32
+ *
33
+ * This source code is licensed under the MIT license found in the
34
+ * LICENSE file in the root directory of this source tree.
35
+ */var m8;function Rj(){if(m8)return Or;m8=1;var t=B2(),e=Aj();function n(a){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+a,f=1;f<arguments.length;f++)c+="&args[]="+encodeURIComponent(arguments[f]);return"Minified React error #"+a+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function i(a,c){o(a,c),o(a+"Capture",c)}function o(a,c){for(s[a]=c,a=0;a<c.length;a++)r.add(c[a])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,d=/^[: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]*$/,h={},p={};function m(a){return u.call(p,a)?!0:u.call(h,a)?!1:d.test(a)?p[a]=!0:(h[a]=!0,!1)}function v(a,c,f,y){if(f!==null&&f.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return y?!1:f!==null?!f.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function w(a,c,f,y){if(c===null||typeof c>"u"||v(a,c,f,y))return!0;if(y)return!1;if(f!==null)switch(f.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function _(a,c,f,y,E,P,O){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=y,this.attributeNamespace=E,this.mustUseProperty=f,this.propertyName=a,this.type=c,this.sanitizeURL=P,this.removeEmptyString=O}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){x[a]=new _(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var c=a[0];x[c]=new _(c,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){x[a]=new _(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){x[a]=new _(a,2,!1,a,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){x[a]=new _(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){x[a]=new _(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){x[a]=new _(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){x[a]=new _(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){x[a]=new _(a,5,!1,a.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function k(a){return a[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var c=a.replace(b,k);x[c]=new _(c,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var c=a.replace(b,k);x[c]=new _(c,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var c=a.replace(b,k);x[c]=new _(c,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){x[a]=new _(a,1,!1,a.toLowerCase(),null,!1,!1)}),x.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){x[a]=new _(a,1,!1,a.toLowerCase(),null,!0,!0)});function C(a,c,f,y){var E=x.hasOwnProperty(c)?x[c]:null;(E!==null?E.type!==0:y||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(w(c,f,E,y)&&(f=null),y||E===null?m(c)&&(f===null?a.removeAttribute(c):a.setAttribute(c,""+f)):E.mustUseProperty?a[E.propertyName]=f===null?E.type===3?!1:"":f:(c=E.attributeName,y=E.attributeNamespace,f===null?a.removeAttribute(c):(E=E.type,f=E===3||E===4&&f===!0?"":""+f,y?a.setAttributeNS(y,c,f):a.setAttribute(c,f))))}var T=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,I=Symbol.for("react.element"),M=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),N=Symbol.for("react.provider"),F=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),Y=Symbol.for("react.offscreen"),V=Symbol.iterator;function J(a){return a===null||typeof a!="object"?null:(a=V&&a[V]||a["@@iterator"],typeof a=="function"?a:null)}var B=Object.assign,D;function X(a){if(D===void 0)try{throw Error()}catch(f){var c=f.stack.trim().match(/\n( *(at )?)/);D=c&&c[1]||""}return`
36
+ `+D+a}var ce=!1;function se(a,c){if(!a||ce)return"";ce=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(ie){var y=ie}Reflect.construct(a,[],c)}else{try{c.call()}catch(ie){y=ie}a.call(c.prototype)}else{try{throw Error()}catch(ie){y=ie}a()}}catch(ie){if(ie&&y&&typeof ie.stack=="string"){for(var E=ie.stack.split(`
37
+ `),P=y.stack.split(`
38
+ `),O=E.length-1,H=P.length-1;1<=O&&0<=H&&E[O]!==P[H];)H--;for(;1<=O&&0<=H;O--,H--)if(E[O]!==P[H]){if(O!==1||H!==1)do if(O--,H--,0>H||E[O]!==P[H]){var G=`
39
+ `+E[O].replace(" at new "," at ");return a.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",a.displayName)),G}while(1<=O&&0<=H);break}}}finally{ce=!1,Error.prepareStackTrace=f}return(a=a?a.displayName||a.name:"")?X(a):""}function re(a){switch(a.tag){case 5:return X(a.type);case 16:return X("Lazy");case 13:return X("Suspense");case 19:return X("SuspenseList");case 0:case 2:case 15:return a=se(a.type,!1),a;case 11:return a=se(a.type.render,!1),a;case 1:return a=se(a.type,!0),a;default:return""}}function de(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case R:return"Fragment";case M:return"Portal";case L:return"Profiler";case A:return"StrictMode";case Q:return"Suspense";case q:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case F:return(a.displayName||"Context")+".Consumer";case N:return(a._context.displayName||"Context")+".Provider";case j:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case Z:return c=a.displayName||null,c!==null?c:de(a.type)||"Memo";case W:c=a._payload,a=a._init;try{return de(a(c))}catch{}}return null}function ye(a){var c=a.type;switch(a.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=c.render,a=a.displayName||a.name||"",c.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return de(c);case 8:return c===A?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function fe(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function oe(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function je(a){var c=oe(a)?"checked":"value",f=Object.getOwnPropertyDescriptor(a.constructor.prototype,c),y=""+a[c];if(!a.hasOwnProperty(c)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var E=f.get,P=f.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return E.call(this)},set:function(O){y=""+O,P.call(this,O)}}),Object.defineProperty(a,c,{enumerable:f.enumerable}),{getValue:function(){return y},setValue:function(O){y=""+O},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function Ce(a){a._valueTracker||(a._valueTracker=je(a))}function We(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var f=c.getValue(),y="";return a&&(y=oe(a)?a.checked?"true":"false":a.value),a=y,a!==f?(c.setValue(a),!0):!1}function at(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function it(a,c){var f=c.checked;return B({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??a._wrapperState.initialChecked})}function Ot(a,c){var f=c.defaultValue==null?"":c.defaultValue,y=c.checked!=null?c.checked:c.defaultChecked;f=fe(c.value!=null?c.value:f),a._wrapperState={initialChecked:y,initialValue:f,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function ht(a,c){c=c.checked,c!=null&&C(a,"checked",c,!1)}function De(a,c){ht(a,c);var f=fe(c.value),y=c.type;if(f!=null)y==="number"?(f===0&&a.value===""||a.value!=f)&&(a.value=""+f):a.value!==""+f&&(a.value=""+f);else if(y==="submit"||y==="reset"){a.removeAttribute("value");return}c.hasOwnProperty("value")?Be(a,c.type,f):c.hasOwnProperty("defaultValue")&&Be(a,c.type,fe(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(a.defaultChecked=!!c.defaultChecked)}function rt(a,c,f){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var y=c.type;if(!(y!=="submit"&&y!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+a._wrapperState.initialValue,f||c===a.value||(a.value=c),a.defaultValue=c}f=a.name,f!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,f!==""&&(a.name=f)}function Be(a,c,f){(c!=="number"||at(a.ownerDocument)!==a)&&(f==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+f&&(a.defaultValue=""+f))}var ct=Array.isArray;function Re(a,c,f,y){if(a=a.options,c){c={};for(var E=0;E<f.length;E++)c["$"+f[E]]=!0;for(f=0;f<a.length;f++)E=c.hasOwnProperty("$"+a[f].value),a[f].selected!==E&&(a[f].selected=E),E&&y&&(a[f].defaultSelected=!0)}else{for(f=""+fe(f),c=null,E=0;E<a.length;E++){if(a[E].value===f){a[E].selected=!0,y&&(a[E].defaultSelected=!0);return}c!==null||a[E].disabled||(c=a[E])}c!==null&&(c.selected=!0)}}function Ze(a,c){if(c.dangerouslySetInnerHTML!=null)throw Error(n(91));return B({},c,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function xe(a,c){var f=c.value;if(f==null){if(f=c.children,c=c.defaultValue,f!=null){if(c!=null)throw Error(n(92));if(ct(f)){if(1<f.length)throw Error(n(93));f=f[0]}c=f}c==null&&(c=""),f=c}a._wrapperState={initialValue:fe(f)}}function St(a,c){var f=fe(c.value),y=fe(c.defaultValue);f!=null&&(f=""+f,f!==a.value&&(a.value=f),c.defaultValue==null&&a.defaultValue!==f&&(a.defaultValue=f)),y!=null&&(a.defaultValue=""+y)}function It(a){var c=a.textContent;c===a._wrapperState.initialValue&&c!==""&&c!==null&&(a.value=c)}function kr(a){switch(a){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Os(a,c){return a==null||a==="http://www.w3.org/1999/xhtml"?kr(c):a==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var wn,xn=(function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,f,y,E){MSApp.execUnsafeLocalFunction(function(){return a(c,f,y,E)})}:a})(function(a,c){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=c;else{for(wn=wn||document.createElement("div"),wn.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=wn.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;c.firstChild;)a.appendChild(c.firstChild)}});function Ls(a,c){if(c){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=c;return}}a.textContent=c}var Fn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Cr=["Webkit","ms","Moz","O"];Object.keys(Fn).forEach(function(a){Cr.forEach(function(c){c=c+a.charAt(0).toUpperCase()+a.substring(1),Fn[c]=Fn[a]})});function Zr(a,c,f){return c==null||typeof c=="boolean"||c===""?"":f||typeof c!="number"||c===0||Fn.hasOwnProperty(a)&&Fn[a]?(""+c).trim():c+"px"}function So(a,c){a=a.style;for(var f in c)if(c.hasOwnProperty(f)){var y=f.indexOf("--")===0,E=Zr(f,c[f],y);f==="float"&&(f="cssFloat"),y?a.setProperty(f,E):a[f]=E}}var Ma=B({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ds(a,c){if(c){if(Ma[a]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(n(137,a));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(n(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(n(61))}if(c.style!=null&&typeof c.style!="object")throw Error(n(62))}}function $i(a,c){if(a.indexOf("-")===-1)return typeof c.is=="string";switch(a){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 Gn=null;function ji(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var hr=null,pn=null,bn=null;function qr(a){if(a=rd(a)){if(typeof hr!="function")throw Error(n(280));var c=a.stateNode;c&&(c=Mh(c),hr(a.stateNode,a.type,c))}}function Oa(a){pn?bn?bn.push(a):bn=[a]:pn=a}function La(){if(pn){var a=pn,c=bn;if(bn=pn=null,qr(a),c)for(a=0;a<c.length;a++)qr(c[a])}}function Ue(a,c){return a(c)}function Qt(){}var on=!1;function An(a,c,f){if(on)return a(c,f);on=!0;try{return Ue(a,c,f)}finally{on=!1,(pn!==null||bn!==null)&&(Qt(),La())}}function Gr(a,c){var f=a.stateNode;if(f===null)return null;var y=Mh(f);if(y===null)return null;f=y[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(a=a.type,y=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!y;break e;default:a=!1}if(a)return null;if(f&&typeof f!="function")throw Error(n(231,c,typeof f));return f}var vt=!1;if(l)try{var an={};Object.defineProperty(an,"passive",{get:function(){vt=!0}}),window.addEventListener("test",an,an),window.removeEventListener("test",an,an)}catch{vt=!1}function Kn(a,c,f,y,E,P,O,H,G){var ie=Array.prototype.slice.call(arguments,3);try{c.apply(f,ie)}catch(me){this.onError(me)}}var Pr=!1,Sn=null,Kr=!1,ii=null,uh={onError:function(a){Pr=!0,Sn=a}};function Ul(a,c,f,y,E,P,O,H,G){Pr=!1,Sn=null,Kn.apply(uh,arguments)}function dh(a,c,f,y,E,P,O,H,G){if(Ul.apply(this,arguments),Pr){if(Pr){var ie=Sn;Pr=!1,Sn=null}else throw Error(n(198));Kr||(Kr=!0,ii=ie)}}function Ns(a){var c=a,f=a;if(a.alternate)for(;c.return;)c=c.return;else{a=c;do c=a,(c.flags&4098)!==0&&(f=c.return),a=c.return;while(a)}return c.tag===3?f:null}function Wl(a){if(a.tag===13){var c=a.memoizedState;if(c===null&&(a=a.alternate,a!==null&&(c=a.memoizedState)),c!==null)return c.dehydrated}return null}function Zl(a){if(Ns(a)!==a)throw Error(n(188))}function Du(a){var c=a.alternate;if(!c){if(c=Ns(a),c===null)throw Error(n(188));return c!==a?null:a}for(var f=a,y=c;;){var E=f.return;if(E===null)break;var P=E.alternate;if(P===null){if(y=E.return,y!==null){f=y;continue}break}if(E.child===P.child){for(P=E.child;P;){if(P===f)return Zl(E),a;if(P===y)return Zl(E),c;P=P.sibling}throw Error(n(188))}if(f.return!==y.return)f=E,y=P;else{for(var O=!1,H=E.child;H;){if(H===f){O=!0,f=E,y=P;break}if(H===y){O=!0,y=E,f=P;break}H=H.sibling}if(!O){for(H=P.child;H;){if(H===f){O=!0,f=P,y=E;break}if(H===y){O=!0,y=P,f=E;break}H=H.sibling}if(!O)throw Error(n(189))}}if(f.alternate!==y)throw Error(n(190))}if(f.tag!==3)throw Error(n(188));return f.stateNode.current===f?a:c}function fh(a){return a=Du(a),a!==null?Da(a):null}function Da(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var c=Da(a);if(c!==null)return c;a=a.sibling}return null}var hh=e.unstable_scheduleCallback,ph=e.unstable_cancelCallback,ig=e.unstable_shouldYield,Nu=e.unstable_requestPaint,Ft=e.unstable_now,mh=e.unstable_getCurrentPriorityLevel,$u=e.unstable_ImmediatePriority,gh=e.unstable_UserBlockingPriority,Na=e.unstable_NormalPriority,og=e.unstable_LowPriority,vh=e.unstable_IdlePriority,Eo=null,gs=null;function ag(a){if(gs&&typeof gs.onCommitFiberRoot=="function")try{gs.onCommitFiberRoot(Eo,a,void 0,(a.current.flags&128)===128)}catch{}}var Yr=Math.clz32?Math.clz32:ju,lg=Math.log,cg=Math.LN2;function ju(a){return a>>>=0,a===0?32:31-(lg(a)/cg|0)|0}var ql=64,Gl=4194304;function $a(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function ko(a,c){var f=a.pendingLanes;if(f===0)return 0;var y=0,E=a.suspendedLanes,P=a.pingedLanes,O=f&268435455;if(O!==0){var H=O&~E;H!==0?y=$a(H):(P&=O,P!==0&&(y=$a(P)))}else O=f&~E,O!==0?y=$a(O):P!==0&&(y=$a(P));if(y===0)return 0;if(c!==0&&c!==y&&(c&E)===0&&(E=y&-y,P=c&-c,E>=P||E===16&&(P&4194240)!==0))return c;if((y&4)!==0&&(y|=f&16),c=a.entangledLanes,c!==0)for(a=a.entanglements,c&=y;0<c;)f=31-Yr(c),E=1<<f,y|=a[f],c&=~E;return y}function Fu(a,c){switch(a){case 1:case 2:case 4:return c+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function yh(a,c){for(var f=a.suspendedLanes,y=a.pingedLanes,E=a.expirationTimes,P=a.pendingLanes;0<P;){var O=31-Yr(P),H=1<<O,G=E[O];G===-1?((H&f)===0||(H&y)!==0)&&(E[O]=Fu(H,c)):G<=c&&(a.expiredLanes|=H),P&=~H}}function Vu(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function ug(){var a=ql;return ql<<=1,(ql&4194240)===0&&(ql=64),a}function oi(a){for(var c=[],f=0;31>f;f++)c.push(a);return c}function Co(a,c,f){a.pendingLanes|=c,c!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,c=31-Yr(c),a[c]=f}function Hu(a,c){var f=a.pendingLanes&~c;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=c,a.mutableReadLanes&=c,a.entangledLanes&=c,c=a.entanglements;var y=a.eventTimes;for(a=a.expirationTimes;0<f;){var E=31-Yr(f),P=1<<E;c[E]=0,y[E]=-1,a[E]=-1,f&=~P}}function zu(a,c){var f=a.entangledLanes|=c;for(a=a.entanglements;f;){var y=31-Yr(f),E=1<<y;E&c|a[y]&c&&(a[y]|=c),f&=~E}}var Ct=0;function _h(a){return a&=-a,1<a?4<a?(a&268435455)!==0?16:536870912:4:1}var Bu,Uu,Wu,ja,Kl,Yl=!1,Fa=[],$s=null,js=null,$=null,ae=new Map,ke=new Map,he=[],_e="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Se(a,c){switch(a){case"focusin":case"focusout":$s=null;break;case"dragenter":case"dragleave":js=null;break;case"mouseover":case"mouseout":$=null;break;case"pointerover":case"pointerout":ae.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":ke.delete(c.pointerId)}}function qe(a,c,f,y,E,P){return a===null||a.nativeEvent!==P?(a={blockedOn:c,domEventName:f,eventSystemFlags:y,nativeEvent:P,targetContainers:[E]},c!==null&&(c=rd(c),c!==null&&Uu(c)),a):(a.eventSystemFlags|=y,c=a.targetContainers,E!==null&&c.indexOf(E)===-1&&c.push(E),a)}function Te(a,c,f,y,E){switch(c){case"focusin":return $s=qe($s,a,c,f,y,E),!0;case"dragenter":return js=qe(js,a,c,f,y,E),!0;case"mouseover":return $=qe($,a,c,f,y,E),!0;case"pointerover":var P=E.pointerId;return ae.set(P,qe(ae.get(P)||null,a,c,f,y,E)),!0;case"gotpointercapture":return P=E.pointerId,ke.set(P,qe(ke.get(P)||null,a,c,f,y,E)),!0}return!1}function ln(a){var c=Va(a.target);if(c!==null){var f=Ns(c);if(f!==null){if(c=f.tag,c===13){if(c=Wl(f),c!==null){a.blockedOn=c,Kl(a.priority,function(){Wu(f)});return}}else if(c===3&&f.stateNode.current.memoizedState.isDehydrated){a.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}a.blockedOn=null}function mn(a){if(a.blockedOn!==null)return!1;for(var c=a.targetContainers;0<c.length;){var f=fg(a.domEventName,a.eventSystemFlags,c[0],a.nativeEvent);if(f===null){f=a.nativeEvent;var y=new f.constructor(f.type,f);Gn=y,f.target.dispatchEvent(y),Gn=null}else return c=rd(f),c!==null&&Uu(c),a.blockedOn=f,!1;c.shift()}return!0}function Xr(a,c,f){mn(a)&&f.delete(c)}function Qr(){Yl=!1,$s!==null&&mn($s)&&($s=null),js!==null&&mn(js)&&(js=null),$!==null&&mn($)&&($=null),ae.forEach(Xr),ke.forEach(Xr)}function Yn(a,c){a.blockedOn===c&&(a.blockedOn=null,Yl||(Yl=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Qr)))}function et(a){function c(E){return Yn(E,a)}if(0<Fa.length){Yn(Fa[0],a);for(var f=1;f<Fa.length;f++){var y=Fa[f];y.blockedOn===a&&(y.blockedOn=null)}}for($s!==null&&Yn($s,a),js!==null&&Yn(js,a),$!==null&&Yn($,a),ae.forEach(c),ke.forEach(c),f=0;f<he.length;f++)y=he[f],y.blockedOn===a&&(y.blockedOn=null);for(;0<he.length&&(f=he[0],f.blockedOn===null);)ln(f),f.blockedOn===null&&he.shift()}var Pt=T.ReactCurrentBatchConfig,vs=!0;function AL(a,c,f,y){var E=Ct,P=Pt.transition;Pt.transition=null;try{Ct=1,dg(a,c,f,y)}finally{Ct=E,Pt.transition=P}}function RL(a,c,f,y){var E=Ct,P=Pt.transition;Pt.transition=null;try{Ct=4,dg(a,c,f,y)}finally{Ct=E,Pt.transition=P}}function dg(a,c,f,y){if(vs){var E=fg(a,c,f,y);if(E===null)Ig(a,c,y,wh,f),Se(a,y);else if(Te(E,a,c,f,y))y.stopPropagation();else if(Se(a,y),c&4&&-1<_e.indexOf(a)){for(;E!==null;){var P=rd(E);if(P!==null&&Bu(P),P=fg(a,c,f,y),P===null&&Ig(a,c,y,wh,f),P===E)break;E=P}E!==null&&y.stopPropagation()}else Ig(a,c,y,null,f)}}var wh=null;function fg(a,c,f,y){if(wh=null,a=ji(y),a=Va(a),a!==null)if(c=Ns(a),c===null)a=null;else if(f=c.tag,f===13){if(a=Wl(c),a!==null)return a;a=null}else if(f===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;a=null}else c!==a&&(a=null);return wh=a,null}function db(a){switch(a){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(mh()){case $u:return 1;case gh:return 4;case Na:case og:return 16;case vh:return 536870912;default:return 16}default:return 16}}var Po=null,hg=null,xh=null;function fb(){if(xh)return xh;var a,c=hg,f=c.length,y,E="value"in Po?Po.value:Po.textContent,P=E.length;for(a=0;a<f&&c[a]===E[a];a++);var O=f-a;for(y=1;y<=O&&c[f-y]===E[P-y];y++);return xh=E.slice(a,1<y?1-y:void 0)}function bh(a){var c=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&c===13&&(a=13)):a=c,a===10&&(a=13),32<=a||a===13?a:0}function Sh(){return!0}function hb(){return!1}function Jr(a){function c(f,y,E,P,O){this._reactName=f,this._targetInst=E,this.type=y,this.nativeEvent=P,this.target=O,this.currentTarget=null;for(var H in a)a.hasOwnProperty(H)&&(f=a[H],this[H]=f?f(P):P[H]);return this.isDefaultPrevented=(P.defaultPrevented!=null?P.defaultPrevented:P.returnValue===!1)?Sh:hb,this.isPropagationStopped=hb,this}return B(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=Sh)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Sh)},persist:function(){},isPersistent:Sh}),c}var Xl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pg=Jr(Xl),Zu=B({},Xl,{view:0,detail:0}),ML=Jr(Zu),mg,gg,qu,Eh=B({},Zu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yg,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==qu&&(qu&&a.type==="mousemove"?(mg=a.screenX-qu.screenX,gg=a.screenY-qu.screenY):gg=mg=0,qu=a),mg)},movementY:function(a){return"movementY"in a?a.movementY:gg}}),pb=Jr(Eh),OL=B({},Eh,{dataTransfer:0}),LL=Jr(OL),DL=B({},Zu,{relatedTarget:0}),vg=Jr(DL),NL=B({},Xl,{animationName:0,elapsedTime:0,pseudoElement:0}),$L=Jr(NL),jL=B({},Xl,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),FL=Jr(jL),VL=B({},Xl,{data:0}),mb=Jr(VL),HL={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zL={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"},BL={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function UL(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=BL[a])?!!c[a]:!1}function yg(){return UL}var WL=B({},Zu,{key:function(a){if(a.key){var c=HL[a.key]||a.key;if(c!=="Unidentified")return c}return a.type==="keypress"?(a=bh(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?zL[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yg,charCode:function(a){return a.type==="keypress"?bh(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?bh(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),ZL=Jr(WL),qL=B({},Eh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gb=Jr(qL),GL=B({},Zu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yg}),KL=Jr(GL),YL=B({},Xl,{propertyName:0,elapsedTime:0,pseudoElement:0}),XL=Jr(YL),QL=B({},Eh,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),JL=Jr(QL),e9=[9,13,27,32],_g=l&&"CompositionEvent"in window,Gu=null;l&&"documentMode"in document&&(Gu=document.documentMode);var t9=l&&"TextEvent"in window&&!Gu,vb=l&&(!_g||Gu&&8<Gu&&11>=Gu),yb=" ",_b=!1;function wb(a,c){switch(a){case"keyup":return e9.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xb(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Ql=!1;function n9(a,c){switch(a){case"compositionend":return xb(c);case"keypress":return c.which!==32?null:(_b=!0,yb);case"textInput":return a=c.data,a===yb&&_b?null:a;default:return null}}function r9(a,c){if(Ql)return a==="compositionend"||!_g&&wb(a,c)?(a=fb(),xh=hg=Po=null,Ql=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return vb&&c.locale!=="ko"?null:c.data;default:return null}}var s9={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 bb(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c==="input"?!!s9[a.type]:c==="textarea"}function Sb(a,c,f,y){Oa(y),c=Ih(c,"onChange"),0<c.length&&(f=new pg("onChange","change",null,f,y),a.push({event:f,listeners:c}))}var Ku=null,Yu=null;function i9(a){Hb(a,0)}function kh(a){var c=rc(a);if(We(c))return a}function o9(a,c){if(a==="change")return c}var Eb=!1;if(l){var wg;if(l){var xg="oninput"in document;if(!xg){var kb=document.createElement("div");kb.setAttribute("oninput","return;"),xg=typeof kb.oninput=="function"}wg=xg}else wg=!1;Eb=wg&&(!document.documentMode||9<document.documentMode)}function Cb(){Ku&&(Ku.detachEvent("onpropertychange",Pb),Yu=Ku=null)}function Pb(a){if(a.propertyName==="value"&&kh(Yu)){var c=[];Sb(c,Yu,a,ji(a)),An(i9,c)}}function a9(a,c,f){a==="focusin"?(Cb(),Ku=c,Yu=f,Ku.attachEvent("onpropertychange",Pb)):a==="focusout"&&Cb()}function l9(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return kh(Yu)}function c9(a,c){if(a==="click")return kh(c)}function u9(a,c){if(a==="input"||a==="change")return kh(c)}function d9(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var Fs=typeof Object.is=="function"?Object.is:d9;function Xu(a,c){if(Fs(a,c))return!0;if(typeof a!="object"||a===null||typeof c!="object"||c===null)return!1;var f=Object.keys(a),y=Object.keys(c);if(f.length!==y.length)return!1;for(y=0;y<f.length;y++){var E=f[y];if(!u.call(c,E)||!Fs(a[E],c[E]))return!1}return!0}function Tb(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Ib(a,c){var f=Tb(a);a=0;for(var y;f;){if(f.nodeType===3){if(y=a+f.textContent.length,a<=c&&y>=c)return{node:f,offset:c-a};a=y}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=Tb(f)}}function Ab(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?Ab(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function Rb(){for(var a=window,c=at();c instanceof a.HTMLIFrameElement;){try{var f=typeof c.contentWindow.location.href=="string"}catch{f=!1}if(f)a=c.contentWindow;else break;c=at(a.document)}return c}function bg(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}function f9(a){var c=Rb(),f=a.focusedElem,y=a.selectionRange;if(c!==f&&f&&f.ownerDocument&&Ab(f.ownerDocument.documentElement,f)){if(y!==null&&bg(f)){if(c=y.start,a=y.end,a===void 0&&(a=c),"selectionStart"in f)f.selectionStart=c,f.selectionEnd=Math.min(a,f.value.length);else if(a=(c=f.ownerDocument||document)&&c.defaultView||window,a.getSelection){a=a.getSelection();var E=f.textContent.length,P=Math.min(y.start,E);y=y.end===void 0?P:Math.min(y.end,E),!a.extend&&P>y&&(E=y,y=P,P=E),E=Ib(f,P);var O=Ib(f,y);E&&O&&(a.rangeCount!==1||a.anchorNode!==E.node||a.anchorOffset!==E.offset||a.focusNode!==O.node||a.focusOffset!==O.offset)&&(c=c.createRange(),c.setStart(E.node,E.offset),a.removeAllRanges(),P>y?(a.addRange(c),a.extend(O.node,O.offset)):(c.setEnd(O.node,O.offset),a.addRange(c)))}}for(c=[],a=f;a=a.parentNode;)a.nodeType===1&&c.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<c.length;f++)a=c[f],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var h9=l&&"documentMode"in document&&11>=document.documentMode,Jl=null,Sg=null,Qu=null,Eg=!1;function Mb(a,c,f){var y=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;Eg||Jl==null||Jl!==at(y)||(y=Jl,"selectionStart"in y&&bg(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),Qu&&Xu(Qu,y)||(Qu=y,y=Ih(Sg,"onSelect"),0<y.length&&(c=new pg("onSelect","select",null,c,f),a.push({event:c,listeners:y}),c.target=Jl)))}function Ch(a,c){var f={};return f[a.toLowerCase()]=c.toLowerCase(),f["Webkit"+a]="webkit"+c,f["Moz"+a]="moz"+c,f}var ec={animationend:Ch("Animation","AnimationEnd"),animationiteration:Ch("Animation","AnimationIteration"),animationstart:Ch("Animation","AnimationStart"),transitionend:Ch("Transition","TransitionEnd")},kg={},Ob={};l&&(Ob=document.createElement("div").style,"AnimationEvent"in window||(delete ec.animationend.animation,delete ec.animationiteration.animation,delete ec.animationstart.animation),"TransitionEvent"in window||delete ec.transitionend.transition);function Ph(a){if(kg[a])return kg[a];if(!ec[a])return a;var c=ec[a],f;for(f in c)if(c.hasOwnProperty(f)&&f in Ob)return kg[a]=c[f];return a}var Lb=Ph("animationend"),Db=Ph("animationiteration"),Nb=Ph("animationstart"),$b=Ph("transitionend"),jb=new Map,Fb="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function To(a,c){jb.set(a,c),i(c,[a])}for(var Cg=0;Cg<Fb.length;Cg++){var Pg=Fb[Cg],p9=Pg.toLowerCase(),m9=Pg[0].toUpperCase()+Pg.slice(1);To(p9,"on"+m9)}To(Lb,"onAnimationEnd"),To(Db,"onAnimationIteration"),To(Nb,"onAnimationStart"),To("dblclick","onDoubleClick"),To("focusin","onFocus"),To("focusout","onBlur"),To($b,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ju="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(" "),g9=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ju));function Vb(a,c,f){var y=a.type||"unknown-event";a.currentTarget=f,dh(y,c,void 0,a),a.currentTarget=null}function Hb(a,c){c=(c&4)!==0;for(var f=0;f<a.length;f++){var y=a[f],E=y.event;y=y.listeners;e:{var P=void 0;if(c)for(var O=y.length-1;0<=O;O--){var H=y[O],G=H.instance,ie=H.currentTarget;if(H=H.listener,G!==P&&E.isPropagationStopped())break e;Vb(E,H,ie),P=G}else for(O=0;O<y.length;O++){if(H=y[O],G=H.instance,ie=H.currentTarget,H=H.listener,G!==P&&E.isPropagationStopped())break e;Vb(E,H,ie),P=G}}}if(Kr)throw a=ii,Kr=!1,ii=null,a}function Vt(a,c){var f=c[Dg];f===void 0&&(f=c[Dg]=new Set);var y=a+"__bubble";f.has(y)||(zb(c,a,2,!1),f.add(y))}function Tg(a,c,f){var y=0;c&&(y|=4),zb(f,a,y,c)}var Th="_reactListening"+Math.random().toString(36).slice(2);function ed(a){if(!a[Th]){a[Th]=!0,r.forEach(function(f){f!=="selectionchange"&&(g9.has(f)||Tg(f,!1,a),Tg(f,!0,a))});var c=a.nodeType===9?a:a.ownerDocument;c===null||c[Th]||(c[Th]=!0,Tg("selectionchange",!1,c))}}function zb(a,c,f,y){switch(db(c)){case 1:var E=AL;break;case 4:E=RL;break;default:E=dg}f=E.bind(null,c,f,a),E=void 0,!vt||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(E=!0),y?E!==void 0?a.addEventListener(c,f,{capture:!0,passive:E}):a.addEventListener(c,f,!0):E!==void 0?a.addEventListener(c,f,{passive:E}):a.addEventListener(c,f,!1)}function Ig(a,c,f,y,E){var P=y;if((c&1)===0&&(c&2)===0&&y!==null)e:for(;;){if(y===null)return;var O=y.tag;if(O===3||O===4){var H=y.stateNode.containerInfo;if(H===E||H.nodeType===8&&H.parentNode===E)break;if(O===4)for(O=y.return;O!==null;){var G=O.tag;if((G===3||G===4)&&(G=O.stateNode.containerInfo,G===E||G.nodeType===8&&G.parentNode===E))return;O=O.return}for(;H!==null;){if(O=Va(H),O===null)return;if(G=O.tag,G===5||G===6){y=P=O;continue e}H=H.parentNode}}y=y.return}An(function(){var ie=P,me=ji(f),ve=[];e:{var pe=jb.get(a);if(pe!==void 0){var Ie=pg,Ne=a;switch(a){case"keypress":if(bh(f)===0)break e;case"keydown":case"keyup":Ie=ZL;break;case"focusin":Ne="focus",Ie=vg;break;case"focusout":Ne="blur",Ie=vg;break;case"beforeblur":case"afterblur":Ie=vg;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ie=pb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ie=LL;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ie=KL;break;case Lb:case Db:case Nb:Ie=$L;break;case $b:Ie=XL;break;case"scroll":Ie=ML;break;case"wheel":Ie=JL;break;case"copy":case"cut":case"paste":Ie=FL;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ie=gb}var Fe=(c&4)!==0,gn=!Fe&&a==="scroll",te=Fe?pe!==null?pe+"Capture":null:pe;Fe=[];for(var K=ie,ne;K!==null;){ne=K;var be=ne.stateNode;if(ne.tag===5&&be!==null&&(ne=be,te!==null&&(be=Gr(K,te),be!=null&&Fe.push(td(K,be,ne)))),gn)break;K=K.return}0<Fe.length&&(pe=new Ie(pe,Ne,null,f,me),ve.push({event:pe,listeners:Fe}))}}if((c&7)===0){e:{if(pe=a==="mouseover"||a==="pointerover",Ie=a==="mouseout"||a==="pointerout",pe&&f!==Gn&&(Ne=f.relatedTarget||f.fromElement)&&(Va(Ne)||Ne[Fi]))break e;if((Ie||pe)&&(pe=me.window===me?me:(pe=me.ownerDocument)?pe.defaultView||pe.parentWindow:window,Ie?(Ne=f.relatedTarget||f.toElement,Ie=ie,Ne=Ne?Va(Ne):null,Ne!==null&&(gn=Ns(Ne),Ne!==gn||Ne.tag!==5&&Ne.tag!==6)&&(Ne=null)):(Ie=null,Ne=ie),Ie!==Ne)){if(Fe=pb,be="onMouseLeave",te="onMouseEnter",K="mouse",(a==="pointerout"||a==="pointerover")&&(Fe=gb,be="onPointerLeave",te="onPointerEnter",K="pointer"),gn=Ie==null?pe:rc(Ie),ne=Ne==null?pe:rc(Ne),pe=new Fe(be,K+"leave",Ie,f,me),pe.target=gn,pe.relatedTarget=ne,be=null,Va(me)===ie&&(Fe=new Fe(te,K+"enter",Ne,f,me),Fe.target=ne,Fe.relatedTarget=gn,be=Fe),gn=be,Ie&&Ne)t:{for(Fe=Ie,te=Ne,K=0,ne=Fe;ne;ne=tc(ne))K++;for(ne=0,be=te;be;be=tc(be))ne++;for(;0<K-ne;)Fe=tc(Fe),K--;for(;0<ne-K;)te=tc(te),ne--;for(;K--;){if(Fe===te||te!==null&&Fe===te.alternate)break t;Fe=tc(Fe),te=tc(te)}Fe=null}else Fe=null;Ie!==null&&Bb(ve,pe,Ie,Fe,!1),Ne!==null&&gn!==null&&Bb(ve,gn,Ne,Fe,!0)}}e:{if(pe=ie?rc(ie):window,Ie=pe.nodeName&&pe.nodeName.toLowerCase(),Ie==="select"||Ie==="input"&&pe.type==="file")var Ve=o9;else if(bb(pe))if(Eb)Ve=u9;else{Ve=l9;var Ge=a9}else(Ie=pe.nodeName)&&Ie.toLowerCase()==="input"&&(pe.type==="checkbox"||pe.type==="radio")&&(Ve=c9);if(Ve&&(Ve=Ve(a,ie))){Sb(ve,Ve,f,me);break e}Ge&&Ge(a,pe,ie),a==="focusout"&&(Ge=pe._wrapperState)&&Ge.controlled&&pe.type==="number"&&Be(pe,"number",pe.value)}switch(Ge=ie?rc(ie):window,a){case"focusin":(bb(Ge)||Ge.contentEditable==="true")&&(Jl=Ge,Sg=ie,Qu=null);break;case"focusout":Qu=Sg=Jl=null;break;case"mousedown":Eg=!0;break;case"contextmenu":case"mouseup":case"dragend":Eg=!1,Mb(ve,f,me);break;case"selectionchange":if(h9)break;case"keydown":case"keyup":Mb(ve,f,me)}var Ke;if(_g)e:{switch(a){case"compositionstart":var Qe="onCompositionStart";break e;case"compositionend":Qe="onCompositionEnd";break e;case"compositionupdate":Qe="onCompositionUpdate";break e}Qe=void 0}else Ql?wb(a,f)&&(Qe="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(Qe="onCompositionStart");Qe&&(vb&&f.locale!=="ko"&&(Ql||Qe!=="onCompositionStart"?Qe==="onCompositionEnd"&&Ql&&(Ke=fb()):(Po=me,hg="value"in Po?Po.value:Po.textContent,Ql=!0)),Ge=Ih(ie,Qe),0<Ge.length&&(Qe=new mb(Qe,a,null,f,me),ve.push({event:Qe,listeners:Ge}),Ke?Qe.data=Ke:(Ke=xb(f),Ke!==null&&(Qe.data=Ke)))),(Ke=t9?n9(a,f):r9(a,f))&&(ie=Ih(ie,"onBeforeInput"),0<ie.length&&(me=new mb("onBeforeInput","beforeinput",null,f,me),ve.push({event:me,listeners:ie}),me.data=Ke))}Hb(ve,c)})}function td(a,c,f){return{instance:a,listener:c,currentTarget:f}}function Ih(a,c){for(var f=c+"Capture",y=[];a!==null;){var E=a,P=E.stateNode;E.tag===5&&P!==null&&(E=P,P=Gr(a,f),P!=null&&y.unshift(td(a,P,E)),P=Gr(a,c),P!=null&&y.push(td(a,P,E))),a=a.return}return y}function tc(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function Bb(a,c,f,y,E){for(var P=c._reactName,O=[];f!==null&&f!==y;){var H=f,G=H.alternate,ie=H.stateNode;if(G!==null&&G===y)break;H.tag===5&&ie!==null&&(H=ie,E?(G=Gr(f,P),G!=null&&O.unshift(td(f,G,H))):E||(G=Gr(f,P),G!=null&&O.push(td(f,G,H)))),f=f.return}O.length!==0&&a.push({event:c,listeners:O})}var v9=/\r\n?/g,y9=/\u0000|\uFFFD/g;function Ub(a){return(typeof a=="string"?a:""+a).replace(v9,`
40
+ `).replace(y9,"")}function Ah(a,c,f){if(c=Ub(c),Ub(a)!==c&&f)throw Error(n(425))}function Rh(){}var Ag=null,Rg=null;function Mg(a,c){return a==="textarea"||a==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Og=typeof setTimeout=="function"?setTimeout:void 0,_9=typeof clearTimeout=="function"?clearTimeout:void 0,Wb=typeof Promise=="function"?Promise:void 0,w9=typeof queueMicrotask=="function"?queueMicrotask:typeof Wb<"u"?function(a){return Wb.resolve(null).then(a).catch(x9)}:Og;function x9(a){setTimeout(function(){throw a})}function Lg(a,c){var f=c,y=0;do{var E=f.nextSibling;if(a.removeChild(f),E&&E.nodeType===8)if(f=E.data,f==="/$"){if(y===0){a.removeChild(E),et(c);return}y--}else f!=="$"&&f!=="$?"&&f!=="$!"||y++;f=E}while(f);et(c)}function Io(a){for(;a!=null;a=a.nextSibling){var c=a.nodeType;if(c===1||c===3)break;if(c===8){if(c=a.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return a}function Zb(a){a=a.previousSibling;for(var c=0;a;){if(a.nodeType===8){var f=a.data;if(f==="$"||f==="$!"||f==="$?"){if(c===0)return a;c--}else f==="/$"&&c++}a=a.previousSibling}return null}var nc=Math.random().toString(36).slice(2),ai="__reactFiber$"+nc,nd="__reactProps$"+nc,Fi="__reactContainer$"+nc,Dg="__reactEvents$"+nc,b9="__reactListeners$"+nc,S9="__reactHandles$"+nc;function Va(a){var c=a[ai];if(c)return c;for(var f=a.parentNode;f;){if(c=f[Fi]||f[ai]){if(f=c.alternate,c.child!==null||f!==null&&f.child!==null)for(a=Zb(a);a!==null;){if(f=a[ai])return f;a=Zb(a)}return c}a=f,f=a.parentNode}return null}function rd(a){return a=a[ai]||a[Fi],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function rc(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(n(33))}function Mh(a){return a[nd]||null}var Ng=[],sc=-1;function Ao(a){return{current:a}}function Ht(a){0>sc||(a.current=Ng[sc],Ng[sc]=null,sc--)}function jt(a,c){sc++,Ng[sc]=a.current,a.current=c}var Ro={},ir=Ao(Ro),Tr=Ao(!1),Ha=Ro;function ic(a,c){var f=a.type.contextTypes;if(!f)return Ro;var y=a.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===c)return y.__reactInternalMemoizedMaskedChildContext;var E={},P;for(P in f)E[P]=c[P];return y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=c,a.__reactInternalMemoizedMaskedChildContext=E),E}function Ir(a){return a=a.childContextTypes,a!=null}function Oh(){Ht(Tr),Ht(ir)}function qb(a,c,f){if(ir.current!==Ro)throw Error(n(168));jt(ir,c),jt(Tr,f)}function Gb(a,c,f){var y=a.stateNode;if(c=c.childContextTypes,typeof y.getChildContext!="function")return f;y=y.getChildContext();for(var E in y)if(!(E in c))throw Error(n(108,ye(a)||"Unknown",E));return B({},f,y)}function Lh(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Ro,Ha=ir.current,jt(ir,a),jt(Tr,Tr.current),!0}function Kb(a,c,f){var y=a.stateNode;if(!y)throw Error(n(169));f?(a=Gb(a,c,Ha),y.__reactInternalMemoizedMergedChildContext=a,Ht(Tr),Ht(ir),jt(ir,a)):Ht(Tr),jt(Tr,f)}var Vi=null,Dh=!1,$g=!1;function Yb(a){Vi===null?Vi=[a]:Vi.push(a)}function E9(a){Dh=!0,Yb(a)}function Mo(){if(!$g&&Vi!==null){$g=!0;var a=0,c=Ct;try{var f=Vi;for(Ct=1;a<f.length;a++){var y=f[a];do y=y(!0);while(y!==null)}Vi=null,Dh=!1}catch(E){throw Vi!==null&&(Vi=Vi.slice(a+1)),hh($u,Mo),E}finally{Ct=c,$g=!1}}return null}var oc=[],ac=0,Nh=null,$h=0,ys=[],_s=0,za=null,Hi=1,zi="";function Ba(a,c){oc[ac++]=$h,oc[ac++]=Nh,Nh=a,$h=c}function Xb(a,c,f){ys[_s++]=Hi,ys[_s++]=zi,ys[_s++]=za,za=a;var y=Hi;a=zi;var E=32-Yr(y)-1;y&=~(1<<E),f+=1;var P=32-Yr(c)+E;if(30<P){var O=E-E%5;P=(y&(1<<O)-1).toString(32),y>>=O,E-=O,Hi=1<<32-Yr(c)+E|f<<E|y,zi=P+a}else Hi=1<<P|f<<E|y,zi=a}function jg(a){a.return!==null&&(Ba(a,1),Xb(a,1,0))}function Fg(a){for(;a===Nh;)Nh=oc[--ac],oc[ac]=null,$h=oc[--ac],oc[ac]=null;for(;a===za;)za=ys[--_s],ys[_s]=null,zi=ys[--_s],ys[_s]=null,Hi=ys[--_s],ys[_s]=null}var es=null,ts=null,Gt=!1,Vs=null;function Qb(a,c){var f=Ss(5,null,null,0);f.elementType="DELETED",f.stateNode=c,f.return=a,c=a.deletions,c===null?(a.deletions=[f],a.flags|=16):c.push(f)}function Jb(a,c){switch(a.tag){case 5:var f=a.type;return c=c.nodeType!==1||f.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(a.stateNode=c,es=a,ts=Io(c.firstChild),!0):!1;case 6:return c=a.pendingProps===""||c.nodeType!==3?null:c,c!==null?(a.stateNode=c,es=a,ts=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(f=za!==null?{id:Hi,overflow:zi}:null,a.memoizedState={dehydrated:c,treeContext:f,retryLane:1073741824},f=Ss(18,null,null,0),f.stateNode=c,f.return=a,a.child=f,es=a,ts=null,!0):!1;default:return!1}}function Vg(a){return(a.mode&1)!==0&&(a.flags&128)===0}function Hg(a){if(Gt){var c=ts;if(c){var f=c;if(!Jb(a,c)){if(Vg(a))throw Error(n(418));c=Io(f.nextSibling);var y=es;c&&Jb(a,c)?Qb(y,f):(a.flags=a.flags&-4097|2,Gt=!1,es=a)}}else{if(Vg(a))throw Error(n(418));a.flags=a.flags&-4097|2,Gt=!1,es=a}}}function e4(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;es=a}function jh(a){if(a!==es)return!1;if(!Gt)return e4(a),Gt=!0,!1;var c;if((c=a.tag!==3)&&!(c=a.tag!==5)&&(c=a.type,c=c!=="head"&&c!=="body"&&!Mg(a.type,a.memoizedProps)),c&&(c=ts)){if(Vg(a))throw t4(),Error(n(418));for(;c;)Qb(a,c),c=Io(c.nextSibling)}if(e4(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));e:{for(a=a.nextSibling,c=0;a;){if(a.nodeType===8){var f=a.data;if(f==="/$"){if(c===0){ts=Io(a.nextSibling);break e}c--}else f!=="$"&&f!=="$!"&&f!=="$?"||c++}a=a.nextSibling}ts=null}}else ts=es?Io(a.stateNode.nextSibling):null;return!0}function t4(){for(var a=ts;a;)a=Io(a.nextSibling)}function lc(){ts=es=null,Gt=!1}function zg(a){Vs===null?Vs=[a]:Vs.push(a)}var k9=T.ReactCurrentBatchConfig;function sd(a,c,f){if(a=f.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(f._owner){if(f=f._owner,f){if(f.tag!==1)throw Error(n(309));var y=f.stateNode}if(!y)throw Error(n(147,a));var E=y,P=""+a;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===P?c.ref:(c=function(O){var H=E.refs;O===null?delete H[P]:H[P]=O},c._stringRef=P,c)}if(typeof a!="string")throw Error(n(284));if(!f._owner)throw Error(n(290,a))}return a}function Fh(a,c){throw a=Object.prototype.toString.call(c),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":a))}function n4(a){var c=a._init;return c(a._payload)}function r4(a){function c(te,K){if(a){var ne=te.deletions;ne===null?(te.deletions=[K],te.flags|=16):ne.push(K)}}function f(te,K){if(!a)return null;for(;K!==null;)c(te,K),K=K.sibling;return null}function y(te,K){for(te=new Map;K!==null;)K.key!==null?te.set(K.key,K):te.set(K.index,K),K=K.sibling;return te}function E(te,K){return te=Vo(te,K),te.index=0,te.sibling=null,te}function P(te,K,ne){return te.index=ne,a?(ne=te.alternate,ne!==null?(ne=ne.index,ne<K?(te.flags|=2,K):ne):(te.flags|=2,K)):(te.flags|=1048576,K)}function O(te){return a&&te.alternate===null&&(te.flags|=2),te}function H(te,K,ne,be){return K===null||K.tag!==6?(K=Ov(ne,te.mode,be),K.return=te,K):(K=E(K,ne),K.return=te,K)}function G(te,K,ne,be){var Ve=ne.type;return Ve===R?me(te,K,ne.props.children,be,ne.key):K!==null&&(K.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===W&&n4(Ve)===K.type)?(be=E(K,ne.props),be.ref=sd(te,K,ne),be.return=te,be):(be=cp(ne.type,ne.key,ne.props,null,te.mode,be),be.ref=sd(te,K,ne),be.return=te,be)}function ie(te,K,ne,be){return K===null||K.tag!==4||K.stateNode.containerInfo!==ne.containerInfo||K.stateNode.implementation!==ne.implementation?(K=Lv(ne,te.mode,be),K.return=te,K):(K=E(K,ne.children||[]),K.return=te,K)}function me(te,K,ne,be,Ve){return K===null||K.tag!==7?(K=Xa(ne,te.mode,be,Ve),K.return=te,K):(K=E(K,ne),K.return=te,K)}function ve(te,K,ne){if(typeof K=="string"&&K!==""||typeof K=="number")return K=Ov(""+K,te.mode,ne),K.return=te,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case I:return ne=cp(K.type,K.key,K.props,null,te.mode,ne),ne.ref=sd(te,null,K),ne.return=te,ne;case M:return K=Lv(K,te.mode,ne),K.return=te,K;case W:var be=K._init;return ve(te,be(K._payload),ne)}if(ct(K)||J(K))return K=Xa(K,te.mode,ne,null),K.return=te,K;Fh(te,K)}return null}function pe(te,K,ne,be){var Ve=K!==null?K.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number")return Ve!==null?null:H(te,K,""+ne,be);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case I:return ne.key===Ve?G(te,K,ne,be):null;case M:return ne.key===Ve?ie(te,K,ne,be):null;case W:return Ve=ne._init,pe(te,K,Ve(ne._payload),be)}if(ct(ne)||J(ne))return Ve!==null?null:me(te,K,ne,be,null);Fh(te,ne)}return null}function Ie(te,K,ne,be,Ve){if(typeof be=="string"&&be!==""||typeof be=="number")return te=te.get(ne)||null,H(K,te,""+be,Ve);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case I:return te=te.get(be.key===null?ne:be.key)||null,G(K,te,be,Ve);case M:return te=te.get(be.key===null?ne:be.key)||null,ie(K,te,be,Ve);case W:var Ge=be._init;return Ie(te,K,ne,Ge(be._payload),Ve)}if(ct(be)||J(be))return te=te.get(ne)||null,me(K,te,be,Ve,null);Fh(K,be)}return null}function Ne(te,K,ne,be){for(var Ve=null,Ge=null,Ke=K,Qe=K=0,zn=null;Ke!==null&&Qe<ne.length;Qe++){Ke.index>Qe?(zn=Ke,Ke=null):zn=Ke.sibling;var Et=pe(te,Ke,ne[Qe],be);if(Et===null){Ke===null&&(Ke=zn);break}a&&Ke&&Et.alternate===null&&c(te,Ke),K=P(Et,K,Qe),Ge===null?Ve=Et:Ge.sibling=Et,Ge=Et,Ke=zn}if(Qe===ne.length)return f(te,Ke),Gt&&Ba(te,Qe),Ve;if(Ke===null){for(;Qe<ne.length;Qe++)Ke=ve(te,ne[Qe],be),Ke!==null&&(K=P(Ke,K,Qe),Ge===null?Ve=Ke:Ge.sibling=Ke,Ge=Ke);return Gt&&Ba(te,Qe),Ve}for(Ke=y(te,Ke);Qe<ne.length;Qe++)zn=Ie(Ke,te,Qe,ne[Qe],be),zn!==null&&(a&&zn.alternate!==null&&Ke.delete(zn.key===null?Qe:zn.key),K=P(zn,K,Qe),Ge===null?Ve=zn:Ge.sibling=zn,Ge=zn);return a&&Ke.forEach(function(Ho){return c(te,Ho)}),Gt&&Ba(te,Qe),Ve}function Fe(te,K,ne,be){var Ve=J(ne);if(typeof Ve!="function")throw Error(n(150));if(ne=Ve.call(ne),ne==null)throw Error(n(151));for(var Ge=Ve=null,Ke=K,Qe=K=0,zn=null,Et=ne.next();Ke!==null&&!Et.done;Qe++,Et=ne.next()){Ke.index>Qe?(zn=Ke,Ke=null):zn=Ke.sibling;var Ho=pe(te,Ke,Et.value,be);if(Ho===null){Ke===null&&(Ke=zn);break}a&&Ke&&Ho.alternate===null&&c(te,Ke),K=P(Ho,K,Qe),Ge===null?Ve=Ho:Ge.sibling=Ho,Ge=Ho,Ke=zn}if(Et.done)return f(te,Ke),Gt&&Ba(te,Qe),Ve;if(Ke===null){for(;!Et.done;Qe++,Et=ne.next())Et=ve(te,Et.value,be),Et!==null&&(K=P(Et,K,Qe),Ge===null?Ve=Et:Ge.sibling=Et,Ge=Et);return Gt&&Ba(te,Qe),Ve}for(Ke=y(te,Ke);!Et.done;Qe++,Et=ne.next())Et=Ie(Ke,te,Qe,Et.value,be),Et!==null&&(a&&Et.alternate!==null&&Ke.delete(Et.key===null?Qe:Et.key),K=P(Et,K,Qe),Ge===null?Ve=Et:Ge.sibling=Et,Ge=Et);return a&&Ke.forEach(function(sD){return c(te,sD)}),Gt&&Ba(te,Qe),Ve}function gn(te,K,ne,be){if(typeof ne=="object"&&ne!==null&&ne.type===R&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case I:e:{for(var Ve=ne.key,Ge=K;Ge!==null;){if(Ge.key===Ve){if(Ve=ne.type,Ve===R){if(Ge.tag===7){f(te,Ge.sibling),K=E(Ge,ne.props.children),K.return=te,te=K;break e}}else if(Ge.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===W&&n4(Ve)===Ge.type){f(te,Ge.sibling),K=E(Ge,ne.props),K.ref=sd(te,Ge,ne),K.return=te,te=K;break e}f(te,Ge);break}else c(te,Ge);Ge=Ge.sibling}ne.type===R?(K=Xa(ne.props.children,te.mode,be,ne.key),K.return=te,te=K):(be=cp(ne.type,ne.key,ne.props,null,te.mode,be),be.ref=sd(te,K,ne),be.return=te,te=be)}return O(te);case M:e:{for(Ge=ne.key;K!==null;){if(K.key===Ge)if(K.tag===4&&K.stateNode.containerInfo===ne.containerInfo&&K.stateNode.implementation===ne.implementation){f(te,K.sibling),K=E(K,ne.children||[]),K.return=te,te=K;break e}else{f(te,K);break}else c(te,K);K=K.sibling}K=Lv(ne,te.mode,be),K.return=te,te=K}return O(te);case W:return Ge=ne._init,gn(te,K,Ge(ne._payload),be)}if(ct(ne))return Ne(te,K,ne,be);if(J(ne))return Fe(te,K,ne,be);Fh(te,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"?(ne=""+ne,K!==null&&K.tag===6?(f(te,K.sibling),K=E(K,ne),K.return=te,te=K):(f(te,K),K=Ov(ne,te.mode,be),K.return=te,te=K),O(te)):f(te,K)}return gn}var cc=r4(!0),s4=r4(!1),Vh=Ao(null),Hh=null,uc=null,Bg=null;function Ug(){Bg=uc=Hh=null}function Wg(a){var c=Vh.current;Ht(Vh),a._currentValue=c}function Zg(a,c,f){for(;a!==null;){var y=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),a===f)break;a=a.return}}function dc(a,c){Hh=a,Bg=uc=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&c)!==0&&(Ar=!0),a.firstContext=null)}function ws(a){var c=a._currentValue;if(Bg!==a)if(a={context:a,memoizedValue:c,next:null},uc===null){if(Hh===null)throw Error(n(308));uc=a,Hh.dependencies={lanes:0,firstContext:a}}else uc=uc.next=a;return c}var Ua=null;function qg(a){Ua===null?Ua=[a]:Ua.push(a)}function i4(a,c,f,y){var E=c.interleaved;return E===null?(f.next=f,qg(c)):(f.next=E.next,E.next=f),c.interleaved=f,Bi(a,y)}function Bi(a,c){a.lanes|=c;var f=a.alternate;for(f!==null&&(f.lanes|=c),f=a,a=a.return;a!==null;)a.childLanes|=c,f=a.alternate,f!==null&&(f.childLanes|=c),f=a,a=a.return;return f.tag===3?f.stateNode:null}var Oo=!1;function Gg(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function o4(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function Ui(a,c){return{eventTime:a,lane:c,tag:0,payload:null,callback:null,next:null}}function Lo(a,c,f){var y=a.updateQueue;if(y===null)return null;if(y=y.shared,(_t&2)!==0){var E=y.pending;return E===null?c.next=c:(c.next=E.next,E.next=c),y.pending=c,Bi(a,f)}return E=y.interleaved,E===null?(c.next=c,qg(y)):(c.next=E.next,E.next=c),y.interleaved=c,Bi(a,f)}function zh(a,c,f){if(c=c.updateQueue,c!==null&&(c=c.shared,(f&4194240)!==0)){var y=c.lanes;y&=a.pendingLanes,f|=y,c.lanes=f,zu(a,f)}}function a4(a,c){var f=a.updateQueue,y=a.alternate;if(y!==null&&(y=y.updateQueue,f===y)){var E=null,P=null;if(f=f.firstBaseUpdate,f!==null){do{var O={eventTime:f.eventTime,lane:f.lane,tag:f.tag,payload:f.payload,callback:f.callback,next:null};P===null?E=P=O:P=P.next=O,f=f.next}while(f!==null);P===null?E=P=c:P=P.next=c}else E=P=c;f={baseState:y.baseState,firstBaseUpdate:E,lastBaseUpdate:P,shared:y.shared,effects:y.effects},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=c:a.next=c,f.lastBaseUpdate=c}function Bh(a,c,f,y){var E=a.updateQueue;Oo=!1;var P=E.firstBaseUpdate,O=E.lastBaseUpdate,H=E.shared.pending;if(H!==null){E.shared.pending=null;var G=H,ie=G.next;G.next=null,O===null?P=ie:O.next=ie,O=G;var me=a.alternate;me!==null&&(me=me.updateQueue,H=me.lastBaseUpdate,H!==O&&(H===null?me.firstBaseUpdate=ie:H.next=ie,me.lastBaseUpdate=G))}if(P!==null){var ve=E.baseState;O=0,me=ie=G=null,H=P;do{var pe=H.lane,Ie=H.eventTime;if((y&pe)===pe){me!==null&&(me=me.next={eventTime:Ie,lane:0,tag:H.tag,payload:H.payload,callback:H.callback,next:null});e:{var Ne=a,Fe=H;switch(pe=c,Ie=f,Fe.tag){case 1:if(Ne=Fe.payload,typeof Ne=="function"){ve=Ne.call(Ie,ve,pe);break e}ve=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=Fe.payload,pe=typeof Ne=="function"?Ne.call(Ie,ve,pe):Ne,pe==null)break e;ve=B({},ve,pe);break e;case 2:Oo=!0}}H.callback!==null&&H.lane!==0&&(a.flags|=64,pe=E.effects,pe===null?E.effects=[H]:pe.push(H))}else Ie={eventTime:Ie,lane:pe,tag:H.tag,payload:H.payload,callback:H.callback,next:null},me===null?(ie=me=Ie,G=ve):me=me.next=Ie,O|=pe;if(H=H.next,H===null){if(H=E.shared.pending,H===null)break;pe=H,H=pe.next,pe.next=null,E.lastBaseUpdate=pe,E.shared.pending=null}}while(!0);if(me===null&&(G=ve),E.baseState=G,E.firstBaseUpdate=ie,E.lastBaseUpdate=me,c=E.shared.interleaved,c!==null){E=c;do O|=E.lane,E=E.next;while(E!==c)}else P===null&&(E.shared.lanes=0);qa|=O,a.lanes=O,a.memoizedState=ve}}function l4(a,c,f){if(a=c.effects,c.effects=null,a!==null)for(c=0;c<a.length;c++){var y=a[c],E=y.callback;if(E!==null){if(y.callback=null,y=f,typeof E!="function")throw Error(n(191,E));E.call(y)}}}var id={},li=Ao(id),od=Ao(id),ad=Ao(id);function Wa(a){if(a===id)throw Error(n(174));return a}function Kg(a,c){switch(jt(ad,c),jt(od,a),jt(li,id),a=c.nodeType,a){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:Os(null,"");break;default:a=a===8?c.parentNode:c,c=a.namespaceURI||null,a=a.tagName,c=Os(c,a)}Ht(li),jt(li,c)}function fc(){Ht(li),Ht(od),Ht(ad)}function c4(a){Wa(ad.current);var c=Wa(li.current),f=Os(c,a.type);c!==f&&(jt(od,a),jt(li,f))}function Yg(a){od.current===a&&(Ht(li),Ht(od))}var Jt=Ao(0);function Uh(a){for(var c=a;c!==null;){if(c.tag===13){var f=c.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||f.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var Xg=[];function Qg(){for(var a=0;a<Xg.length;a++)Xg[a]._workInProgressVersionPrimary=null;Xg.length=0}var Wh=T.ReactCurrentDispatcher,Jg=T.ReactCurrentBatchConfig,Za=0,en=null,Rn=null,Vn=null,Zh=!1,ld=!1,cd=0,C9=0;function or(){throw Error(n(321))}function ev(a,c){if(c===null)return!1;for(var f=0;f<c.length&&f<a.length;f++)if(!Fs(a[f],c[f]))return!1;return!0}function tv(a,c,f,y,E,P){if(Za=P,en=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Wh.current=a===null||a.memoizedState===null?A9:R9,a=f(y,E),ld){P=0;do{if(ld=!1,cd=0,25<=P)throw Error(n(301));P+=1,Vn=Rn=null,c.updateQueue=null,Wh.current=M9,a=f(y,E)}while(ld)}if(Wh.current=Kh,c=Rn!==null&&Rn.next!==null,Za=0,Vn=Rn=en=null,Zh=!1,c)throw Error(n(300));return a}function nv(){var a=cd!==0;return cd=0,a}function ci(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vn===null?en.memoizedState=Vn=a:Vn=Vn.next=a,Vn}function xs(){if(Rn===null){var a=en.alternate;a=a!==null?a.memoizedState:null}else a=Rn.next;var c=Vn===null?en.memoizedState:Vn.next;if(c!==null)Vn=c,Rn=a;else{if(a===null)throw Error(n(310));Rn=a,a={memoizedState:Rn.memoizedState,baseState:Rn.baseState,baseQueue:Rn.baseQueue,queue:Rn.queue,next:null},Vn===null?en.memoizedState=Vn=a:Vn=Vn.next=a}return Vn}function ud(a,c){return typeof c=="function"?c(a):c}function rv(a){var c=xs(),f=c.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=a;var y=Rn,E=y.baseQueue,P=f.pending;if(P!==null){if(E!==null){var O=E.next;E.next=P.next,P.next=O}y.baseQueue=E=P,f.pending=null}if(E!==null){P=E.next,y=y.baseState;var H=O=null,G=null,ie=P;do{var me=ie.lane;if((Za&me)===me)G!==null&&(G=G.next={lane:0,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),y=ie.hasEagerState?ie.eagerState:a(y,ie.action);else{var ve={lane:me,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null};G===null?(H=G=ve,O=y):G=G.next=ve,en.lanes|=me,qa|=me}ie=ie.next}while(ie!==null&&ie!==P);G===null?O=y:G.next=H,Fs(y,c.memoizedState)||(Ar=!0),c.memoizedState=y,c.baseState=O,c.baseQueue=G,f.lastRenderedState=y}if(a=f.interleaved,a!==null){E=a;do P=E.lane,en.lanes|=P,qa|=P,E=E.next;while(E!==a)}else E===null&&(f.lanes=0);return[c.memoizedState,f.dispatch]}function sv(a){var c=xs(),f=c.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=a;var y=f.dispatch,E=f.pending,P=c.memoizedState;if(E!==null){f.pending=null;var O=E=E.next;do P=a(P,O.action),O=O.next;while(O!==E);Fs(P,c.memoizedState)||(Ar=!0),c.memoizedState=P,c.baseQueue===null&&(c.baseState=P),f.lastRenderedState=P}return[P,y]}function u4(){}function d4(a,c){var f=en,y=xs(),E=c(),P=!Fs(y.memoizedState,E);if(P&&(y.memoizedState=E,Ar=!0),y=y.queue,iv(p4.bind(null,f,y,a),[a]),y.getSnapshot!==c||P||Vn!==null&&Vn.memoizedState.tag&1){if(f.flags|=2048,dd(9,h4.bind(null,f,y,E,c),void 0,null),Hn===null)throw Error(n(349));(Za&30)!==0||f4(f,c,E)}return E}function f4(a,c,f){a.flags|=16384,a={getSnapshot:c,value:f},c=en.updateQueue,c===null?(c={lastEffect:null,stores:null},en.updateQueue=c,c.stores=[a]):(f=c.stores,f===null?c.stores=[a]:f.push(a))}function h4(a,c,f,y){c.value=f,c.getSnapshot=y,m4(c)&&g4(a)}function p4(a,c,f){return f(function(){m4(c)&&g4(a)})}function m4(a){var c=a.getSnapshot;a=a.value;try{var f=c();return!Fs(a,f)}catch{return!0}}function g4(a){var c=Bi(a,1);c!==null&&Us(c,a,1,-1)}function v4(a){var c=ci();return typeof a=="function"&&(a=a()),c.memoizedState=c.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ud,lastRenderedState:a},c.queue=a,a=a.dispatch=I9.bind(null,en,a),[c.memoizedState,a]}function dd(a,c,f,y){return a={tag:a,create:c,destroy:f,deps:y,next:null},c=en.updateQueue,c===null?(c={lastEffect:null,stores:null},en.updateQueue=c,c.lastEffect=a.next=a):(f=c.lastEffect,f===null?c.lastEffect=a.next=a:(y=f.next,f.next=a,a.next=y,c.lastEffect=a)),a}function y4(){return xs().memoizedState}function qh(a,c,f,y){var E=ci();en.flags|=a,E.memoizedState=dd(1|c,f,void 0,y===void 0?null:y)}function Gh(a,c,f,y){var E=xs();y=y===void 0?null:y;var P=void 0;if(Rn!==null){var O=Rn.memoizedState;if(P=O.destroy,y!==null&&ev(y,O.deps)){E.memoizedState=dd(c,f,P,y);return}}en.flags|=a,E.memoizedState=dd(1|c,f,P,y)}function _4(a,c){return qh(8390656,8,a,c)}function iv(a,c){return Gh(2048,8,a,c)}function w4(a,c){return Gh(4,2,a,c)}function x4(a,c){return Gh(4,4,a,c)}function b4(a,c){if(typeof c=="function")return a=a(),c(a),function(){c(null)};if(c!=null)return a=a(),c.current=a,function(){c.current=null}}function S4(a,c,f){return f=f!=null?f.concat([a]):null,Gh(4,4,b4.bind(null,c,a),f)}function ov(){}function E4(a,c){var f=xs();c=c===void 0?null:c;var y=f.memoizedState;return y!==null&&c!==null&&ev(c,y[1])?y[0]:(f.memoizedState=[a,c],a)}function k4(a,c){var f=xs();c=c===void 0?null:c;var y=f.memoizedState;return y!==null&&c!==null&&ev(c,y[1])?y[0]:(a=a(),f.memoizedState=[a,c],a)}function C4(a,c,f){return(Za&21)===0?(a.baseState&&(a.baseState=!1,Ar=!0),a.memoizedState=f):(Fs(f,c)||(f=ug(),en.lanes|=f,qa|=f,a.baseState=!0),c)}function P9(a,c){var f=Ct;Ct=f!==0&&4>f?f:4,a(!0);var y=Jg.transition;Jg.transition={};try{a(!1),c()}finally{Ct=f,Jg.transition=y}}function P4(){return xs().memoizedState}function T9(a,c,f){var y=jo(a);if(f={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null},T4(a))I4(c,f);else if(f=i4(a,c,f,y),f!==null){var E=mr();Us(f,a,y,E),A4(f,c,y)}}function I9(a,c,f){var y=jo(a),E={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null};if(T4(a))I4(c,E);else{var P=a.alternate;if(a.lanes===0&&(P===null||P.lanes===0)&&(P=c.lastRenderedReducer,P!==null))try{var O=c.lastRenderedState,H=P(O,f);if(E.hasEagerState=!0,E.eagerState=H,Fs(H,O)){var G=c.interleaved;G===null?(E.next=E,qg(c)):(E.next=G.next,G.next=E),c.interleaved=E;return}}catch{}finally{}f=i4(a,c,E,y),f!==null&&(E=mr(),Us(f,a,y,E),A4(f,c,y))}}function T4(a){var c=a.alternate;return a===en||c!==null&&c===en}function I4(a,c){ld=Zh=!0;var f=a.pending;f===null?c.next=c:(c.next=f.next,f.next=c),a.pending=c}function A4(a,c,f){if((f&4194240)!==0){var y=c.lanes;y&=a.pendingLanes,f|=y,c.lanes=f,zu(a,f)}}var Kh={readContext:ws,useCallback:or,useContext:or,useEffect:or,useImperativeHandle:or,useInsertionEffect:or,useLayoutEffect:or,useMemo:or,useReducer:or,useRef:or,useState:or,useDebugValue:or,useDeferredValue:or,useTransition:or,useMutableSource:or,useSyncExternalStore:or,useId:or,unstable_isNewReconciler:!1},A9={readContext:ws,useCallback:function(a,c){return ci().memoizedState=[a,c===void 0?null:c],a},useContext:ws,useEffect:_4,useImperativeHandle:function(a,c,f){return f=f!=null?f.concat([a]):null,qh(4194308,4,b4.bind(null,c,a),f)},useLayoutEffect:function(a,c){return qh(4194308,4,a,c)},useInsertionEffect:function(a,c){return qh(4,2,a,c)},useMemo:function(a,c){var f=ci();return c=c===void 0?null:c,a=a(),f.memoizedState=[a,c],a},useReducer:function(a,c,f){var y=ci();return c=f!==void 0?f(c):c,y.memoizedState=y.baseState=c,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:c},y.queue=a,a=a.dispatch=T9.bind(null,en,a),[y.memoizedState,a]},useRef:function(a){var c=ci();return a={current:a},c.memoizedState=a},useState:v4,useDebugValue:ov,useDeferredValue:function(a){return ci().memoizedState=a},useTransition:function(){var a=v4(!1),c=a[0];return a=P9.bind(null,a[1]),ci().memoizedState=a,[c,a]},useMutableSource:function(){},useSyncExternalStore:function(a,c,f){var y=en,E=ci();if(Gt){if(f===void 0)throw Error(n(407));f=f()}else{if(f=c(),Hn===null)throw Error(n(349));(Za&30)!==0||f4(y,c,f)}E.memoizedState=f;var P={value:f,getSnapshot:c};return E.queue=P,_4(p4.bind(null,y,P,a),[a]),y.flags|=2048,dd(9,h4.bind(null,y,P,f,c),void 0,null),f},useId:function(){var a=ci(),c=Hn.identifierPrefix;if(Gt){var f=zi,y=Hi;f=(y&~(1<<32-Yr(y)-1)).toString(32)+f,c=":"+c+"R"+f,f=cd++,0<f&&(c+="H"+f.toString(32)),c+=":"}else f=C9++,c=":"+c+"r"+f.toString(32)+":";return a.memoizedState=c},unstable_isNewReconciler:!1},R9={readContext:ws,useCallback:E4,useContext:ws,useEffect:iv,useImperativeHandle:S4,useInsertionEffect:w4,useLayoutEffect:x4,useMemo:k4,useReducer:rv,useRef:y4,useState:function(){return rv(ud)},useDebugValue:ov,useDeferredValue:function(a){var c=xs();return C4(c,Rn.memoizedState,a)},useTransition:function(){var a=rv(ud)[0],c=xs().memoizedState;return[a,c]},useMutableSource:u4,useSyncExternalStore:d4,useId:P4,unstable_isNewReconciler:!1},M9={readContext:ws,useCallback:E4,useContext:ws,useEffect:iv,useImperativeHandle:S4,useInsertionEffect:w4,useLayoutEffect:x4,useMemo:k4,useReducer:sv,useRef:y4,useState:function(){return sv(ud)},useDebugValue:ov,useDeferredValue:function(a){var c=xs();return Rn===null?c.memoizedState=a:C4(c,Rn.memoizedState,a)},useTransition:function(){var a=sv(ud)[0],c=xs().memoizedState;return[a,c]},useMutableSource:u4,useSyncExternalStore:d4,useId:P4,unstable_isNewReconciler:!1};function Hs(a,c){if(a&&a.defaultProps){c=B({},c),a=a.defaultProps;for(var f in a)c[f]===void 0&&(c[f]=a[f]);return c}return c}function av(a,c,f,y){c=a.memoizedState,f=f(y,c),f=f==null?c:B({},c,f),a.memoizedState=f,a.lanes===0&&(a.updateQueue.baseState=f)}var Yh={isMounted:function(a){return(a=a._reactInternals)?Ns(a)===a:!1},enqueueSetState:function(a,c,f){a=a._reactInternals;var y=mr(),E=jo(a),P=Ui(y,E);P.payload=c,f!=null&&(P.callback=f),c=Lo(a,P,E),c!==null&&(Us(c,a,E,y),zh(c,a,E))},enqueueReplaceState:function(a,c,f){a=a._reactInternals;var y=mr(),E=jo(a),P=Ui(y,E);P.tag=1,P.payload=c,f!=null&&(P.callback=f),c=Lo(a,P,E),c!==null&&(Us(c,a,E,y),zh(c,a,E))},enqueueForceUpdate:function(a,c){a=a._reactInternals;var f=mr(),y=jo(a),E=Ui(f,y);E.tag=2,c!=null&&(E.callback=c),c=Lo(a,E,y),c!==null&&(Us(c,a,y,f),zh(c,a,y))}};function R4(a,c,f,y,E,P,O){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(y,P,O):c.prototype&&c.prototype.isPureReactComponent?!Xu(f,y)||!Xu(E,P):!0}function M4(a,c,f){var y=!1,E=Ro,P=c.contextType;return typeof P=="object"&&P!==null?P=ws(P):(E=Ir(c)?Ha:ir.current,y=c.contextTypes,P=(y=y!=null)?ic(a,E):Ro),c=new c(f,P),a.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Yh,a.stateNode=c,c._reactInternals=a,y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=E,a.__reactInternalMemoizedMaskedChildContext=P),c}function O4(a,c,f,y){a=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(f,y),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(f,y),c.state!==a&&Yh.enqueueReplaceState(c,c.state,null)}function lv(a,c,f,y){var E=a.stateNode;E.props=f,E.state=a.memoizedState,E.refs={},Gg(a);var P=c.contextType;typeof P=="object"&&P!==null?E.context=ws(P):(P=Ir(c)?Ha:ir.current,E.context=ic(a,P)),E.state=a.memoizedState,P=c.getDerivedStateFromProps,typeof P=="function"&&(av(a,c,P,f),E.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(c=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),c!==E.state&&Yh.enqueueReplaceState(E,E.state,null),Bh(a,f,E,y),E.state=a.memoizedState),typeof E.componentDidMount=="function"&&(a.flags|=4194308)}function hc(a,c){try{var f="",y=c;do f+=re(y),y=y.return;while(y);var E=f}catch(P){E=`
41
+ Error generating stack: `+P.message+`
42
+ `+P.stack}return{value:a,source:c,stack:E,digest:null}}function cv(a,c,f){return{value:a,source:null,stack:f??null,digest:c??null}}function uv(a,c){try{console.error(c.value)}catch(f){setTimeout(function(){throw f})}}var O9=typeof WeakMap=="function"?WeakMap:Map;function L4(a,c,f){f=Ui(-1,f),f.tag=3,f.payload={element:null};var y=c.value;return f.callback=function(){rp||(rp=!0,kv=y),uv(a,c)},f}function D4(a,c,f){f=Ui(-1,f),f.tag=3;var y=a.type.getDerivedStateFromError;if(typeof y=="function"){var E=c.value;f.payload=function(){return y(E)},f.callback=function(){uv(a,c)}}var P=a.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(f.callback=function(){uv(a,c),typeof y!="function"&&(No===null?No=new Set([this]):No.add(this));var O=c.stack;this.componentDidCatch(c.value,{componentStack:O!==null?O:""})}),f}function N4(a,c,f){var y=a.pingCache;if(y===null){y=a.pingCache=new O9;var E=new Set;y.set(c,E)}else E=y.get(c),E===void 0&&(E=new Set,y.set(c,E));E.has(f)||(E.add(f),a=q9.bind(null,a,c,f),c.then(a,a))}function $4(a){do{var c;if((c=a.tag===13)&&(c=a.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return a;a=a.return}while(a!==null);return null}function j4(a,c,f,y,E){return(a.mode&1)===0?(a===c?a.flags|=65536:(a.flags|=128,f.flags|=131072,f.flags&=-52805,f.tag===1&&(f.alternate===null?f.tag=17:(c=Ui(-1,1),c.tag=2,Lo(f,c,1))),f.lanes|=1),a):(a.flags|=65536,a.lanes=E,a)}var L9=T.ReactCurrentOwner,Ar=!1;function pr(a,c,f,y){c.child=a===null?s4(c,null,f,y):cc(c,a.child,f,y)}function F4(a,c,f,y,E){f=f.render;var P=c.ref;return dc(c,E),y=tv(a,c,f,y,P,E),f=nv(),a!==null&&!Ar?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~E,Wi(a,c,E)):(Gt&&f&&jg(c),c.flags|=1,pr(a,c,y,E),c.child)}function V4(a,c,f,y,E){if(a===null){var P=f.type;return typeof P=="function"&&!Mv(P)&&P.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(c.tag=15,c.type=P,H4(a,c,P,y,E)):(a=cp(f.type,null,y,c,c.mode,E),a.ref=c.ref,a.return=c,c.child=a)}if(P=a.child,(a.lanes&E)===0){var O=P.memoizedProps;if(f=f.compare,f=f!==null?f:Xu,f(O,y)&&a.ref===c.ref)return Wi(a,c,E)}return c.flags|=1,a=Vo(P,y),a.ref=c.ref,a.return=c,c.child=a}function H4(a,c,f,y,E){if(a!==null){var P=a.memoizedProps;if(Xu(P,y)&&a.ref===c.ref)if(Ar=!1,c.pendingProps=y=P,(a.lanes&E)!==0)(a.flags&131072)!==0&&(Ar=!0);else return c.lanes=a.lanes,Wi(a,c,E)}return dv(a,c,f,y,E)}function z4(a,c,f){var y=c.pendingProps,E=y.children,P=a!==null?a.memoizedState:null;if(y.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},jt(mc,ns),ns|=f;else{if((f&1073741824)===0)return a=P!==null?P.baseLanes|f:f,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:a,cachePool:null,transitions:null},c.updateQueue=null,jt(mc,ns),ns|=a,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=P!==null?P.baseLanes:f,jt(mc,ns),ns|=y}else P!==null?(y=P.baseLanes|f,c.memoizedState=null):y=f,jt(mc,ns),ns|=y;return pr(a,c,E,f),c.child}function B4(a,c){var f=c.ref;(a===null&&f!==null||a!==null&&a.ref!==f)&&(c.flags|=512,c.flags|=2097152)}function dv(a,c,f,y,E){var P=Ir(f)?Ha:ir.current;return P=ic(c,P),dc(c,E),f=tv(a,c,f,y,P,E),y=nv(),a!==null&&!Ar?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~E,Wi(a,c,E)):(Gt&&y&&jg(c),c.flags|=1,pr(a,c,f,E),c.child)}function U4(a,c,f,y,E){if(Ir(f)){var P=!0;Lh(c)}else P=!1;if(dc(c,E),c.stateNode===null)Qh(a,c),M4(c,f,y),lv(c,f,y,E),y=!0;else if(a===null){var O=c.stateNode,H=c.memoizedProps;O.props=H;var G=O.context,ie=f.contextType;typeof ie=="object"&&ie!==null?ie=ws(ie):(ie=Ir(f)?Ha:ir.current,ie=ic(c,ie));var me=f.getDerivedStateFromProps,ve=typeof me=="function"||typeof O.getSnapshotBeforeUpdate=="function";ve||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(H!==y||G!==ie)&&O4(c,O,y,ie),Oo=!1;var pe=c.memoizedState;O.state=pe,Bh(c,y,O,E),G=c.memoizedState,H!==y||pe!==G||Tr.current||Oo?(typeof me=="function"&&(av(c,f,me,y),G=c.memoizedState),(H=Oo||R4(c,f,H,y,pe,G,ie))?(ve||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount()),typeof O.componentDidMount=="function"&&(c.flags|=4194308)):(typeof O.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=G),O.props=y,O.state=G,O.context=ie,y=H):(typeof O.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{O=c.stateNode,o4(a,c),H=c.memoizedProps,ie=c.type===c.elementType?H:Hs(c.type,H),O.props=ie,ve=c.pendingProps,pe=O.context,G=f.contextType,typeof G=="object"&&G!==null?G=ws(G):(G=Ir(f)?Ha:ir.current,G=ic(c,G));var Ie=f.getDerivedStateFromProps;(me=typeof Ie=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(H!==ve||pe!==G)&&O4(c,O,y,G),Oo=!1,pe=c.memoizedState,O.state=pe,Bh(c,y,O,E);var Ne=c.memoizedState;H!==ve||pe!==Ne||Tr.current||Oo?(typeof Ie=="function"&&(av(c,f,Ie,y),Ne=c.memoizedState),(ie=Oo||R4(c,f,ie,y,pe,Ne,G)||!1)?(me||typeof O.UNSAFE_componentWillUpdate!="function"&&typeof O.componentWillUpdate!="function"||(typeof O.componentWillUpdate=="function"&&O.componentWillUpdate(y,Ne,G),typeof O.UNSAFE_componentWillUpdate=="function"&&O.UNSAFE_componentWillUpdate(y,Ne,G)),typeof O.componentDidUpdate=="function"&&(c.flags|=4),typeof O.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof O.componentDidUpdate!="function"||H===a.memoizedProps&&pe===a.memoizedState||(c.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||H===a.memoizedProps&&pe===a.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=Ne),O.props=y,O.state=Ne,O.context=G,y=ie):(typeof O.componentDidUpdate!="function"||H===a.memoizedProps&&pe===a.memoizedState||(c.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||H===a.memoizedProps&&pe===a.memoizedState||(c.flags|=1024),y=!1)}return fv(a,c,f,y,P,E)}function fv(a,c,f,y,E,P){B4(a,c);var O=(c.flags&128)!==0;if(!y&&!O)return E&&Kb(c,f,!1),Wi(a,c,P);y=c.stateNode,L9.current=c;var H=O&&typeof f.getDerivedStateFromError!="function"?null:y.render();return c.flags|=1,a!==null&&O?(c.child=cc(c,a.child,null,P),c.child=cc(c,null,H,P)):pr(a,c,H,P),c.memoizedState=y.state,E&&Kb(c,f,!0),c.child}function W4(a){var c=a.stateNode;c.pendingContext?qb(a,c.pendingContext,c.pendingContext!==c.context):c.context&&qb(a,c.context,!1),Kg(a,c.containerInfo)}function Z4(a,c,f,y,E){return lc(),zg(E),c.flags|=256,pr(a,c,f,y),c.child}var hv={dehydrated:null,treeContext:null,retryLane:0};function pv(a){return{baseLanes:a,cachePool:null,transitions:null}}function q4(a,c,f){var y=c.pendingProps,E=Jt.current,P=!1,O=(c.flags&128)!==0,H;if((H=O)||(H=a!==null&&a.memoizedState===null?!1:(E&2)!==0),H?(P=!0,c.flags&=-129):(a===null||a.memoizedState!==null)&&(E|=1),jt(Jt,E&1),a===null)return Hg(c),a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?((c.mode&1)===0?c.lanes=1:a.data==="$!"?c.lanes=8:c.lanes=1073741824,null):(O=y.children,a=y.fallback,P?(y=c.mode,P=c.child,O={mode:"hidden",children:O},(y&1)===0&&P!==null?(P.childLanes=0,P.pendingProps=O):P=up(O,y,0,null),a=Xa(a,y,f,null),P.return=c,a.return=c,P.sibling=a,c.child=P,c.child.memoizedState=pv(f),c.memoizedState=hv,a):mv(c,O));if(E=a.memoizedState,E!==null&&(H=E.dehydrated,H!==null))return D9(a,c,O,y,H,E,f);if(P){P=y.fallback,O=c.mode,E=a.child,H=E.sibling;var G={mode:"hidden",children:y.children};return(O&1)===0&&c.child!==E?(y=c.child,y.childLanes=0,y.pendingProps=G,c.deletions=null):(y=Vo(E,G),y.subtreeFlags=E.subtreeFlags&14680064),H!==null?P=Vo(H,P):(P=Xa(P,O,f,null),P.flags|=2),P.return=c,y.return=c,y.sibling=P,c.child=y,y=P,P=c.child,O=a.child.memoizedState,O=O===null?pv(f):{baseLanes:O.baseLanes|f,cachePool:null,transitions:O.transitions},P.memoizedState=O,P.childLanes=a.childLanes&~f,c.memoizedState=hv,y}return P=a.child,a=P.sibling,y=Vo(P,{mode:"visible",children:y.children}),(c.mode&1)===0&&(y.lanes=f),y.return=c,y.sibling=null,a!==null&&(f=c.deletions,f===null?(c.deletions=[a],c.flags|=16):f.push(a)),c.child=y,c.memoizedState=null,y}function mv(a,c){return c=up({mode:"visible",children:c},a.mode,0,null),c.return=a,a.child=c}function Xh(a,c,f,y){return y!==null&&zg(y),cc(c,a.child,null,f),a=mv(c,c.pendingProps.children),a.flags|=2,c.memoizedState=null,a}function D9(a,c,f,y,E,P,O){if(f)return c.flags&256?(c.flags&=-257,y=cv(Error(n(422))),Xh(a,c,O,y)):c.memoizedState!==null?(c.child=a.child,c.flags|=128,null):(P=y.fallback,E=c.mode,y=up({mode:"visible",children:y.children},E,0,null),P=Xa(P,E,O,null),P.flags|=2,y.return=c,P.return=c,y.sibling=P,c.child=y,(c.mode&1)!==0&&cc(c,a.child,null,O),c.child.memoizedState=pv(O),c.memoizedState=hv,P);if((c.mode&1)===0)return Xh(a,c,O,null);if(E.data==="$!"){if(y=E.nextSibling&&E.nextSibling.dataset,y)var H=y.dgst;return y=H,P=Error(n(419)),y=cv(P,y,void 0),Xh(a,c,O,y)}if(H=(O&a.childLanes)!==0,Ar||H){if(y=Hn,y!==null){switch(O&-O){case 4:E=2;break;case 16:E=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:E=32;break;case 536870912:E=268435456;break;default:E=0}E=(E&(y.suspendedLanes|O))!==0?0:E,E!==0&&E!==P.retryLane&&(P.retryLane=E,Bi(a,E),Us(y,a,E,-1))}return Rv(),y=cv(Error(n(421))),Xh(a,c,O,y)}return E.data==="$?"?(c.flags|=128,c.child=a.child,c=G9.bind(null,a),E._reactRetry=c,null):(a=P.treeContext,ts=Io(E.nextSibling),es=c,Gt=!0,Vs=null,a!==null&&(ys[_s++]=Hi,ys[_s++]=zi,ys[_s++]=za,Hi=a.id,zi=a.overflow,za=c),c=mv(c,y.children),c.flags|=4096,c)}function G4(a,c,f){a.lanes|=c;var y=a.alternate;y!==null&&(y.lanes|=c),Zg(a.return,c,f)}function gv(a,c,f,y,E){var P=a.memoizedState;P===null?a.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:f,tailMode:E}:(P.isBackwards=c,P.rendering=null,P.renderingStartTime=0,P.last=y,P.tail=f,P.tailMode=E)}function K4(a,c,f){var y=c.pendingProps,E=y.revealOrder,P=y.tail;if(pr(a,c,y.children,f),y=Jt.current,(y&2)!==0)y=y&1|2,c.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=c.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&G4(a,f,c);else if(a.tag===19)G4(a,f,c);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===c)break e;for(;a.sibling===null;){if(a.return===null||a.return===c)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}y&=1}if(jt(Jt,y),(c.mode&1)===0)c.memoizedState=null;else switch(E){case"forwards":for(f=c.child,E=null;f!==null;)a=f.alternate,a!==null&&Uh(a)===null&&(E=f),f=f.sibling;f=E,f===null?(E=c.child,c.child=null):(E=f.sibling,f.sibling=null),gv(c,!1,E,f,P);break;case"backwards":for(f=null,E=c.child,c.child=null;E!==null;){if(a=E.alternate,a!==null&&Uh(a)===null){c.child=E;break}a=E.sibling,E.sibling=f,f=E,E=a}gv(c,!0,f,null,P);break;case"together":gv(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Qh(a,c){(c.mode&1)===0&&a!==null&&(a.alternate=null,c.alternate=null,c.flags|=2)}function Wi(a,c,f){if(a!==null&&(c.dependencies=a.dependencies),qa|=c.lanes,(f&c.childLanes)===0)return null;if(a!==null&&c.child!==a.child)throw Error(n(153));if(c.child!==null){for(a=c.child,f=Vo(a,a.pendingProps),c.child=f,f.return=c;a.sibling!==null;)a=a.sibling,f=f.sibling=Vo(a,a.pendingProps),f.return=c;f.sibling=null}return c.child}function N9(a,c,f){switch(c.tag){case 3:W4(c),lc();break;case 5:c4(c);break;case 1:Ir(c.type)&&Lh(c);break;case 4:Kg(c,c.stateNode.containerInfo);break;case 10:var y=c.type._context,E=c.memoizedProps.value;jt(Vh,y._currentValue),y._currentValue=E;break;case 13:if(y=c.memoizedState,y!==null)return y.dehydrated!==null?(jt(Jt,Jt.current&1),c.flags|=128,null):(f&c.child.childLanes)!==0?q4(a,c,f):(jt(Jt,Jt.current&1),a=Wi(a,c,f),a!==null?a.sibling:null);jt(Jt,Jt.current&1);break;case 19:if(y=(f&c.childLanes)!==0,(a.flags&128)!==0){if(y)return K4(a,c,f);c.flags|=128}if(E=c.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),jt(Jt,Jt.current),y)break;return null;case 22:case 23:return c.lanes=0,z4(a,c,f)}return Wi(a,c,f)}var Y4,vv,X4,Q4;Y4=function(a,c){for(var f=c.child;f!==null;){if(f.tag===5||f.tag===6)a.appendChild(f.stateNode);else if(f.tag!==4&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},vv=function(){},X4=function(a,c,f,y){var E=a.memoizedProps;if(E!==y){a=c.stateNode,Wa(li.current);var P=null;switch(f){case"input":E=it(a,E),y=it(a,y),P=[];break;case"select":E=B({},E,{value:void 0}),y=B({},y,{value:void 0}),P=[];break;case"textarea":E=Ze(a,E),y=Ze(a,y),P=[];break;default:typeof E.onClick!="function"&&typeof y.onClick=="function"&&(a.onclick=Rh)}Ds(f,y);var O;f=null;for(ie in E)if(!y.hasOwnProperty(ie)&&E.hasOwnProperty(ie)&&E[ie]!=null)if(ie==="style"){var H=E[ie];for(O in H)H.hasOwnProperty(O)&&(f||(f={}),f[O]="")}else ie!=="dangerouslySetInnerHTML"&&ie!=="children"&&ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&ie!=="autoFocus"&&(s.hasOwnProperty(ie)?P||(P=[]):(P=P||[]).push(ie,null));for(ie in y){var G=y[ie];if(H=E!=null?E[ie]:void 0,y.hasOwnProperty(ie)&&G!==H&&(G!=null||H!=null))if(ie==="style")if(H){for(O in H)!H.hasOwnProperty(O)||G&&G.hasOwnProperty(O)||(f||(f={}),f[O]="");for(O in G)G.hasOwnProperty(O)&&H[O]!==G[O]&&(f||(f={}),f[O]=G[O])}else f||(P||(P=[]),P.push(ie,f)),f=G;else ie==="dangerouslySetInnerHTML"?(G=G?G.__html:void 0,H=H?H.__html:void 0,G!=null&&H!==G&&(P=P||[]).push(ie,G)):ie==="children"?typeof G!="string"&&typeof G!="number"||(P=P||[]).push(ie,""+G):ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&(s.hasOwnProperty(ie)?(G!=null&&ie==="onScroll"&&Vt("scroll",a),P||H===G||(P=[])):(P=P||[]).push(ie,G))}f&&(P=P||[]).push("style",f);var ie=P;(c.updateQueue=ie)&&(c.flags|=4)}},Q4=function(a,c,f,y){f!==y&&(c.flags|=4)};function fd(a,c){if(!Gt)switch(a.tailMode){case"hidden":c=a.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?a.tail=null:f.sibling=null;break;case"collapsed":f=a.tail;for(var y=null;f!==null;)f.alternate!==null&&(y=f),f=f.sibling;y===null?c||a.tail===null?a.tail=null:a.tail.sibling=null:y.sibling=null}}function ar(a){var c=a.alternate!==null&&a.alternate.child===a.child,f=0,y=0;if(c)for(var E=a.child;E!==null;)f|=E.lanes|E.childLanes,y|=E.subtreeFlags&14680064,y|=E.flags&14680064,E.return=a,E=E.sibling;else for(E=a.child;E!==null;)f|=E.lanes|E.childLanes,y|=E.subtreeFlags,y|=E.flags,E.return=a,E=E.sibling;return a.subtreeFlags|=y,a.childLanes=f,c}function $9(a,c,f){var y=c.pendingProps;switch(Fg(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ar(c),null;case 1:return Ir(c.type)&&Oh(),ar(c),null;case 3:return y=c.stateNode,fc(),Ht(Tr),Ht(ir),Qg(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(a===null||a.child===null)&&(jh(c)?c.flags|=4:a===null||a.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,Vs!==null&&(Tv(Vs),Vs=null))),vv(a,c),ar(c),null;case 5:Yg(c);var E=Wa(ad.current);if(f=c.type,a!==null&&c.stateNode!=null)X4(a,c,f,y,E),a.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!y){if(c.stateNode===null)throw Error(n(166));return ar(c),null}if(a=Wa(li.current),jh(c)){y=c.stateNode,f=c.type;var P=c.memoizedProps;switch(y[ai]=c,y[nd]=P,a=(c.mode&1)!==0,f){case"dialog":Vt("cancel",y),Vt("close",y);break;case"iframe":case"object":case"embed":Vt("load",y);break;case"video":case"audio":for(E=0;E<Ju.length;E++)Vt(Ju[E],y);break;case"source":Vt("error",y);break;case"img":case"image":case"link":Vt("error",y),Vt("load",y);break;case"details":Vt("toggle",y);break;case"input":Ot(y,P),Vt("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!P.multiple},Vt("invalid",y);break;case"textarea":xe(y,P),Vt("invalid",y)}Ds(f,P),E=null;for(var O in P)if(P.hasOwnProperty(O)){var H=P[O];O==="children"?typeof H=="string"?y.textContent!==H&&(P.suppressHydrationWarning!==!0&&Ah(y.textContent,H,a),E=["children",H]):typeof H=="number"&&y.textContent!==""+H&&(P.suppressHydrationWarning!==!0&&Ah(y.textContent,H,a),E=["children",""+H]):s.hasOwnProperty(O)&&H!=null&&O==="onScroll"&&Vt("scroll",y)}switch(f){case"input":Ce(y),rt(y,P,!0);break;case"textarea":Ce(y),It(y);break;case"select":case"option":break;default:typeof P.onClick=="function"&&(y.onclick=Rh)}y=E,c.updateQueue=y,y!==null&&(c.flags|=4)}else{O=E.nodeType===9?E:E.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=kr(f)),a==="http://www.w3.org/1999/xhtml"?f==="script"?(a=O.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof y.is=="string"?a=O.createElement(f,{is:y.is}):(a=O.createElement(f),f==="select"&&(O=a,y.multiple?O.multiple=!0:y.size&&(O.size=y.size))):a=O.createElementNS(a,f),a[ai]=c,a[nd]=y,Y4(a,c,!1,!1),c.stateNode=a;e:{switch(O=$i(f,y),f){case"dialog":Vt("cancel",a),Vt("close",a),E=y;break;case"iframe":case"object":case"embed":Vt("load",a),E=y;break;case"video":case"audio":for(E=0;E<Ju.length;E++)Vt(Ju[E],a);E=y;break;case"source":Vt("error",a),E=y;break;case"img":case"image":case"link":Vt("error",a),Vt("load",a),E=y;break;case"details":Vt("toggle",a),E=y;break;case"input":Ot(a,y),E=it(a,y),Vt("invalid",a);break;case"option":E=y;break;case"select":a._wrapperState={wasMultiple:!!y.multiple},E=B({},y,{value:void 0}),Vt("invalid",a);break;case"textarea":xe(a,y),E=Ze(a,y),Vt("invalid",a);break;default:E=y}Ds(f,E),H=E;for(P in H)if(H.hasOwnProperty(P)){var G=H[P];P==="style"?So(a,G):P==="dangerouslySetInnerHTML"?(G=G?G.__html:void 0,G!=null&&xn(a,G)):P==="children"?typeof G=="string"?(f!=="textarea"||G!=="")&&Ls(a,G):typeof G=="number"&&Ls(a,""+G):P!=="suppressContentEditableWarning"&&P!=="suppressHydrationWarning"&&P!=="autoFocus"&&(s.hasOwnProperty(P)?G!=null&&P==="onScroll"&&Vt("scroll",a):G!=null&&C(a,P,G,O))}switch(f){case"input":Ce(a),rt(a,y,!1);break;case"textarea":Ce(a),It(a);break;case"option":y.value!=null&&a.setAttribute("value",""+fe(y.value));break;case"select":a.multiple=!!y.multiple,P=y.value,P!=null?Re(a,!!y.multiple,P,!1):y.defaultValue!=null&&Re(a,!!y.multiple,y.defaultValue,!0);break;default:typeof E.onClick=="function"&&(a.onclick=Rh)}switch(f){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return ar(c),null;case 6:if(a&&c.stateNode!=null)Q4(a,c,a.memoizedProps,y);else{if(typeof y!="string"&&c.stateNode===null)throw Error(n(166));if(f=Wa(ad.current),Wa(li.current),jh(c)){if(y=c.stateNode,f=c.memoizedProps,y[ai]=c,(P=y.nodeValue!==f)&&(a=es,a!==null))switch(a.tag){case 3:Ah(y.nodeValue,f,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&Ah(y.nodeValue,f,(a.mode&1)!==0)}P&&(c.flags|=4)}else y=(f.nodeType===9?f:f.ownerDocument).createTextNode(y),y[ai]=c,c.stateNode=y}return ar(c),null;case 13:if(Ht(Jt),y=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(Gt&&ts!==null&&(c.mode&1)!==0&&(c.flags&128)===0)t4(),lc(),c.flags|=98560,P=!1;else if(P=jh(c),y!==null&&y.dehydrated!==null){if(a===null){if(!P)throw Error(n(318));if(P=c.memoizedState,P=P!==null?P.dehydrated:null,!P)throw Error(n(317));P[ai]=c}else lc(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;ar(c),P=!1}else Vs!==null&&(Tv(Vs),Vs=null),P=!0;if(!P)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=f,c):(y=y!==null,y!==(a!==null&&a.memoizedState!==null)&&y&&(c.child.flags|=8192,(c.mode&1)!==0&&(a===null||(Jt.current&1)!==0?Mn===0&&(Mn=3):Rv())),c.updateQueue!==null&&(c.flags|=4),ar(c),null);case 4:return fc(),vv(a,c),a===null&&ed(c.stateNode.containerInfo),ar(c),null;case 10:return Wg(c.type._context),ar(c),null;case 17:return Ir(c.type)&&Oh(),ar(c),null;case 19:if(Ht(Jt),P=c.memoizedState,P===null)return ar(c),null;if(y=(c.flags&128)!==0,O=P.rendering,O===null)if(y)fd(P,!1);else{if(Mn!==0||a!==null&&(a.flags&128)!==0)for(a=c.child;a!==null;){if(O=Uh(a),O!==null){for(c.flags|=128,fd(P,!1),y=O.updateQueue,y!==null&&(c.updateQueue=y,c.flags|=4),c.subtreeFlags=0,y=f,f=c.child;f!==null;)P=f,a=y,P.flags&=14680066,O=P.alternate,O===null?(P.childLanes=0,P.lanes=a,P.child=null,P.subtreeFlags=0,P.memoizedProps=null,P.memoizedState=null,P.updateQueue=null,P.dependencies=null,P.stateNode=null):(P.childLanes=O.childLanes,P.lanes=O.lanes,P.child=O.child,P.subtreeFlags=0,P.deletions=null,P.memoizedProps=O.memoizedProps,P.memoizedState=O.memoizedState,P.updateQueue=O.updateQueue,P.type=O.type,a=O.dependencies,P.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),f=f.sibling;return jt(Jt,Jt.current&1|2),c.child}a=a.sibling}P.tail!==null&&Ft()>gc&&(c.flags|=128,y=!0,fd(P,!1),c.lanes=4194304)}else{if(!y)if(a=Uh(O),a!==null){if(c.flags|=128,y=!0,f=a.updateQueue,f!==null&&(c.updateQueue=f,c.flags|=4),fd(P,!0),P.tail===null&&P.tailMode==="hidden"&&!O.alternate&&!Gt)return ar(c),null}else 2*Ft()-P.renderingStartTime>gc&&f!==1073741824&&(c.flags|=128,y=!0,fd(P,!1),c.lanes=4194304);P.isBackwards?(O.sibling=c.child,c.child=O):(f=P.last,f!==null?f.sibling=O:c.child=O,P.last=O)}return P.tail!==null?(c=P.tail,P.rendering=c,P.tail=c.sibling,P.renderingStartTime=Ft(),c.sibling=null,f=Jt.current,jt(Jt,y?f&1|2:f&1),c):(ar(c),null);case 22:case 23:return Av(),y=c.memoizedState!==null,a!==null&&a.memoizedState!==null!==y&&(c.flags|=8192),y&&(c.mode&1)!==0?(ns&1073741824)!==0&&(ar(c),c.subtreeFlags&6&&(c.flags|=8192)):ar(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function j9(a,c){switch(Fg(c),c.tag){case 1:return Ir(c.type)&&Oh(),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return fc(),Ht(Tr),Ht(ir),Qg(),a=c.flags,(a&65536)!==0&&(a&128)===0?(c.flags=a&-65537|128,c):null;case 5:return Yg(c),null;case 13:if(Ht(Jt),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(n(340));lc()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return Ht(Jt),null;case 4:return fc(),null;case 10:return Wg(c.type._context),null;case 22:case 23:return Av(),null;case 24:return null;default:return null}}var Jh=!1,lr=!1,F9=typeof WeakSet=="function"?WeakSet:Set,Me=null;function pc(a,c){var f=a.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(y){cn(a,c,y)}else f.current=null}function yv(a,c,f){try{f()}catch(y){cn(a,c,y)}}var J4=!1;function V9(a,c){if(Ag=vs,a=Rb(),bg(a)){if("selectionStart"in a)var f={start:a.selectionStart,end:a.selectionEnd};else e:{f=(f=a.ownerDocument)&&f.defaultView||window;var y=f.getSelection&&f.getSelection();if(y&&y.rangeCount!==0){f=y.anchorNode;var E=y.anchorOffset,P=y.focusNode;y=y.focusOffset;try{f.nodeType,P.nodeType}catch{f=null;break e}var O=0,H=-1,G=-1,ie=0,me=0,ve=a,pe=null;t:for(;;){for(var Ie;ve!==f||E!==0&&ve.nodeType!==3||(H=O+E),ve!==P||y!==0&&ve.nodeType!==3||(G=O+y),ve.nodeType===3&&(O+=ve.nodeValue.length),(Ie=ve.firstChild)!==null;)pe=ve,ve=Ie;for(;;){if(ve===a)break t;if(pe===f&&++ie===E&&(H=O),pe===P&&++me===y&&(G=O),(Ie=ve.nextSibling)!==null)break;ve=pe,pe=ve.parentNode}ve=Ie}f=H===-1||G===-1?null:{start:H,end:G}}else f=null}f=f||{start:0,end:0}}else f=null;for(Rg={focusedElem:a,selectionRange:f},vs=!1,Me=c;Me!==null;)if(c=Me,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,Me=a;else for(;Me!==null;){c=Me;try{var Ne=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(Ne!==null){var Fe=Ne.memoizedProps,gn=Ne.memoizedState,te=c.stateNode,K=te.getSnapshotBeforeUpdate(c.elementType===c.type?Fe:Hs(c.type,Fe),gn);te.__reactInternalSnapshotBeforeUpdate=K}break;case 3:var ne=c.stateNode.containerInfo;ne.nodeType===1?ne.textContent="":ne.nodeType===9&&ne.documentElement&&ne.removeChild(ne.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(be){cn(c,c.return,be)}if(a=c.sibling,a!==null){a.return=c.return,Me=a;break}Me=c.return}return Ne=J4,J4=!1,Ne}function hd(a,c,f){var y=c.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var E=y=y.next;do{if((E.tag&a)===a){var P=E.destroy;E.destroy=void 0,P!==void 0&&yv(c,f,P)}E=E.next}while(E!==y)}}function ep(a,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var f=c=c.next;do{if((f.tag&a)===a){var y=f.create;f.destroy=y()}f=f.next}while(f!==c)}}function _v(a){var c=a.ref;if(c!==null){var f=a.stateNode;switch(a.tag){case 5:a=f;break;default:a=f}typeof c=="function"?c(a):c.current=a}}function e6(a){var c=a.alternate;c!==null&&(a.alternate=null,e6(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&(delete c[ai],delete c[nd],delete c[Dg],delete c[b9],delete c[S9])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function t6(a){return a.tag===5||a.tag===3||a.tag===4}function n6(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||t6(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function wv(a,c,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?f.nodeType===8?f.parentNode.insertBefore(a,c):f.insertBefore(a,c):(f.nodeType===8?(c=f.parentNode,c.insertBefore(a,f)):(c=f,c.appendChild(a)),f=f._reactRootContainer,f!=null||c.onclick!==null||(c.onclick=Rh));else if(y!==4&&(a=a.child,a!==null))for(wv(a,c,f),a=a.sibling;a!==null;)wv(a,c,f),a=a.sibling}function xv(a,c,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?f.insertBefore(a,c):f.appendChild(a);else if(y!==4&&(a=a.child,a!==null))for(xv(a,c,f),a=a.sibling;a!==null;)xv(a,c,f),a=a.sibling}var Xn=null,zs=!1;function Do(a,c,f){for(f=f.child;f!==null;)r6(a,c,f),f=f.sibling}function r6(a,c,f){if(gs&&typeof gs.onCommitFiberUnmount=="function")try{gs.onCommitFiberUnmount(Eo,f)}catch{}switch(f.tag){case 5:lr||pc(f,c);case 6:var y=Xn,E=zs;Xn=null,Do(a,c,f),Xn=y,zs=E,Xn!==null&&(zs?(a=Xn,f=f.stateNode,a.nodeType===8?a.parentNode.removeChild(f):a.removeChild(f)):Xn.removeChild(f.stateNode));break;case 18:Xn!==null&&(zs?(a=Xn,f=f.stateNode,a.nodeType===8?Lg(a.parentNode,f):a.nodeType===1&&Lg(a,f),et(a)):Lg(Xn,f.stateNode));break;case 4:y=Xn,E=zs,Xn=f.stateNode.containerInfo,zs=!0,Do(a,c,f),Xn=y,zs=E;break;case 0:case 11:case 14:case 15:if(!lr&&(y=f.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){E=y=y.next;do{var P=E,O=P.destroy;P=P.tag,O!==void 0&&((P&2)!==0||(P&4)!==0)&&yv(f,c,O),E=E.next}while(E!==y)}Do(a,c,f);break;case 1:if(!lr&&(pc(f,c),y=f.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=f.memoizedProps,y.state=f.memoizedState,y.componentWillUnmount()}catch(H){cn(f,c,H)}Do(a,c,f);break;case 21:Do(a,c,f);break;case 22:f.mode&1?(lr=(y=lr)||f.memoizedState!==null,Do(a,c,f),lr=y):Do(a,c,f);break;default:Do(a,c,f)}}function s6(a){var c=a.updateQueue;if(c!==null){a.updateQueue=null;var f=a.stateNode;f===null&&(f=a.stateNode=new F9),c.forEach(function(y){var E=K9.bind(null,a,y);f.has(y)||(f.add(y),y.then(E,E))})}}function Bs(a,c){var f=c.deletions;if(f!==null)for(var y=0;y<f.length;y++){var E=f[y];try{var P=a,O=c,H=O;e:for(;H!==null;){switch(H.tag){case 5:Xn=H.stateNode,zs=!1;break e;case 3:Xn=H.stateNode.containerInfo,zs=!0;break e;case 4:Xn=H.stateNode.containerInfo,zs=!0;break e}H=H.return}if(Xn===null)throw Error(n(160));r6(P,O,E),Xn=null,zs=!1;var G=E.alternate;G!==null&&(G.return=null),E.return=null}catch(ie){cn(E,c,ie)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)i6(c,a),c=c.sibling}function i6(a,c){var f=a.alternate,y=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(Bs(c,a),ui(a),y&4){try{hd(3,a,a.return),ep(3,a)}catch(Fe){cn(a,a.return,Fe)}try{hd(5,a,a.return)}catch(Fe){cn(a,a.return,Fe)}}break;case 1:Bs(c,a),ui(a),y&512&&f!==null&&pc(f,f.return);break;case 5:if(Bs(c,a),ui(a),y&512&&f!==null&&pc(f,f.return),a.flags&32){var E=a.stateNode;try{Ls(E,"")}catch(Fe){cn(a,a.return,Fe)}}if(y&4&&(E=a.stateNode,E!=null)){var P=a.memoizedProps,O=f!==null?f.memoizedProps:P,H=a.type,G=a.updateQueue;if(a.updateQueue=null,G!==null)try{H==="input"&&P.type==="radio"&&P.name!=null&&ht(E,P),$i(H,O);var ie=$i(H,P);for(O=0;O<G.length;O+=2){var me=G[O],ve=G[O+1];me==="style"?So(E,ve):me==="dangerouslySetInnerHTML"?xn(E,ve):me==="children"?Ls(E,ve):C(E,me,ve,ie)}switch(H){case"input":De(E,P);break;case"textarea":St(E,P);break;case"select":var pe=E._wrapperState.wasMultiple;E._wrapperState.wasMultiple=!!P.multiple;var Ie=P.value;Ie!=null?Re(E,!!P.multiple,Ie,!1):pe!==!!P.multiple&&(P.defaultValue!=null?Re(E,!!P.multiple,P.defaultValue,!0):Re(E,!!P.multiple,P.multiple?[]:"",!1))}E[nd]=P}catch(Fe){cn(a,a.return,Fe)}}break;case 6:if(Bs(c,a),ui(a),y&4){if(a.stateNode===null)throw Error(n(162));E=a.stateNode,P=a.memoizedProps;try{E.nodeValue=P}catch(Fe){cn(a,a.return,Fe)}}break;case 3:if(Bs(c,a),ui(a),y&4&&f!==null&&f.memoizedState.isDehydrated)try{et(c.containerInfo)}catch(Fe){cn(a,a.return,Fe)}break;case 4:Bs(c,a),ui(a);break;case 13:Bs(c,a),ui(a),E=a.child,E.flags&8192&&(P=E.memoizedState!==null,E.stateNode.isHidden=P,!P||E.alternate!==null&&E.alternate.memoizedState!==null||(Ev=Ft())),y&4&&s6(a);break;case 22:if(me=f!==null&&f.memoizedState!==null,a.mode&1?(lr=(ie=lr)||me,Bs(c,a),lr=ie):Bs(c,a),ui(a),y&8192){if(ie=a.memoizedState!==null,(a.stateNode.isHidden=ie)&&!me&&(a.mode&1)!==0)for(Me=a,me=a.child;me!==null;){for(ve=Me=me;Me!==null;){switch(pe=Me,Ie=pe.child,pe.tag){case 0:case 11:case 14:case 15:hd(4,pe,pe.return);break;case 1:pc(pe,pe.return);var Ne=pe.stateNode;if(typeof Ne.componentWillUnmount=="function"){y=pe,f=pe.return;try{c=y,Ne.props=c.memoizedProps,Ne.state=c.memoizedState,Ne.componentWillUnmount()}catch(Fe){cn(y,f,Fe)}}break;case 5:pc(pe,pe.return);break;case 22:if(pe.memoizedState!==null){l6(ve);continue}}Ie!==null?(Ie.return=pe,Me=Ie):l6(ve)}me=me.sibling}e:for(me=null,ve=a;;){if(ve.tag===5){if(me===null){me=ve;try{E=ve.stateNode,ie?(P=E.style,typeof P.setProperty=="function"?P.setProperty("display","none","important"):P.display="none"):(H=ve.stateNode,G=ve.memoizedProps.style,O=G!=null&&G.hasOwnProperty("display")?G.display:null,H.style.display=Zr("display",O))}catch(Fe){cn(a,a.return,Fe)}}}else if(ve.tag===6){if(me===null)try{ve.stateNode.nodeValue=ie?"":ve.memoizedProps}catch(Fe){cn(a,a.return,Fe)}}else if((ve.tag!==22&&ve.tag!==23||ve.memoizedState===null||ve===a)&&ve.child!==null){ve.child.return=ve,ve=ve.child;continue}if(ve===a)break e;for(;ve.sibling===null;){if(ve.return===null||ve.return===a)break e;me===ve&&(me=null),ve=ve.return}me===ve&&(me=null),ve.sibling.return=ve.return,ve=ve.sibling}}break;case 19:Bs(c,a),ui(a),y&4&&s6(a);break;case 21:break;default:Bs(c,a),ui(a)}}function ui(a){var c=a.flags;if(c&2){try{e:{for(var f=a.return;f!==null;){if(t6(f)){var y=f;break e}f=f.return}throw Error(n(160))}switch(y.tag){case 5:var E=y.stateNode;y.flags&32&&(Ls(E,""),y.flags&=-33);var P=n6(a);xv(a,P,E);break;case 3:case 4:var O=y.stateNode.containerInfo,H=n6(a);wv(a,H,O);break;default:throw Error(n(161))}}catch(G){cn(a,a.return,G)}a.flags&=-3}c&4096&&(a.flags&=-4097)}function H9(a,c,f){Me=a,o6(a)}function o6(a,c,f){for(var y=(a.mode&1)!==0;Me!==null;){var E=Me,P=E.child;if(E.tag===22&&y){var O=E.memoizedState!==null||Jh;if(!O){var H=E.alternate,G=H!==null&&H.memoizedState!==null||lr;H=Jh;var ie=lr;if(Jh=O,(lr=G)&&!ie)for(Me=E;Me!==null;)O=Me,G=O.child,O.tag===22&&O.memoizedState!==null?c6(E):G!==null?(G.return=O,Me=G):c6(E);for(;P!==null;)Me=P,o6(P),P=P.sibling;Me=E,Jh=H,lr=ie}a6(a)}else(E.subtreeFlags&8772)!==0&&P!==null?(P.return=E,Me=P):a6(a)}}function a6(a){for(;Me!==null;){var c=Me;if((c.flags&8772)!==0){var f=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:lr||ep(5,c);break;case 1:var y=c.stateNode;if(c.flags&4&&!lr)if(f===null)y.componentDidMount();else{var E=c.elementType===c.type?f.memoizedProps:Hs(c.type,f.memoizedProps);y.componentDidUpdate(E,f.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var P=c.updateQueue;P!==null&&l4(c,P,y);break;case 3:var O=c.updateQueue;if(O!==null){if(f=null,c.child!==null)switch(c.child.tag){case 5:f=c.child.stateNode;break;case 1:f=c.child.stateNode}l4(c,O,f)}break;case 5:var H=c.stateNode;if(f===null&&c.flags&4){f=H;var G=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":G.autoFocus&&f.focus();break;case"img":G.src&&(f.src=G.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var ie=c.alternate;if(ie!==null){var me=ie.memoizedState;if(me!==null){var ve=me.dehydrated;ve!==null&&et(ve)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}lr||c.flags&512&&_v(c)}catch(pe){cn(c,c.return,pe)}}if(c===a){Me=null;break}if(f=c.sibling,f!==null){f.return=c.return,Me=f;break}Me=c.return}}function l6(a){for(;Me!==null;){var c=Me;if(c===a){Me=null;break}var f=c.sibling;if(f!==null){f.return=c.return,Me=f;break}Me=c.return}}function c6(a){for(;Me!==null;){var c=Me;try{switch(c.tag){case 0:case 11:case 15:var f=c.return;try{ep(4,c)}catch(G){cn(c,f,G)}break;case 1:var y=c.stateNode;if(typeof y.componentDidMount=="function"){var E=c.return;try{y.componentDidMount()}catch(G){cn(c,E,G)}}var P=c.return;try{_v(c)}catch(G){cn(c,P,G)}break;case 5:var O=c.return;try{_v(c)}catch(G){cn(c,O,G)}}}catch(G){cn(c,c.return,G)}if(c===a){Me=null;break}var H=c.sibling;if(H!==null){H.return=c.return,Me=H;break}Me=c.return}}var z9=Math.ceil,tp=T.ReactCurrentDispatcher,bv=T.ReactCurrentOwner,bs=T.ReactCurrentBatchConfig,_t=0,Hn=null,En=null,Qn=0,ns=0,mc=Ao(0),Mn=0,pd=null,qa=0,np=0,Sv=0,md=null,Rr=null,Ev=0,gc=1/0,Zi=null,rp=!1,kv=null,No=null,sp=!1,$o=null,ip=0,gd=0,Cv=null,op=-1,ap=0;function mr(){return(_t&6)!==0?Ft():op!==-1?op:op=Ft()}function jo(a){return(a.mode&1)===0?1:(_t&2)!==0&&Qn!==0?Qn&-Qn:k9.transition!==null?(ap===0&&(ap=ug()),ap):(a=Ct,a!==0||(a=window.event,a=a===void 0?16:db(a.type)),a)}function Us(a,c,f,y){if(50<gd)throw gd=0,Cv=null,Error(n(185));Co(a,f,y),((_t&2)===0||a!==Hn)&&(a===Hn&&((_t&2)===0&&(np|=f),Mn===4&&Fo(a,Qn)),Mr(a,y),f===1&&_t===0&&(c.mode&1)===0&&(gc=Ft()+500,Dh&&Mo()))}function Mr(a,c){var f=a.callbackNode;yh(a,c);var y=ko(a,a===Hn?Qn:0);if(y===0)f!==null&&ph(f),a.callbackNode=null,a.callbackPriority=0;else if(c=y&-y,a.callbackPriority!==c){if(f!=null&&ph(f),c===1)a.tag===0?E9(d6.bind(null,a)):Yb(d6.bind(null,a)),w9(function(){(_t&6)===0&&Mo()}),f=null;else{switch(_h(y)){case 1:f=$u;break;case 4:f=gh;break;case 16:f=Na;break;case 536870912:f=vh;break;default:f=Na}f=_6(f,u6.bind(null,a))}a.callbackPriority=c,a.callbackNode=f}}function u6(a,c){if(op=-1,ap=0,(_t&6)!==0)throw Error(n(327));var f=a.callbackNode;if(vc()&&a.callbackNode!==f)return null;var y=ko(a,a===Hn?Qn:0);if(y===0)return null;if((y&30)!==0||(y&a.expiredLanes)!==0||c)c=lp(a,y);else{c=y;var E=_t;_t|=2;var P=h6();(Hn!==a||Qn!==c)&&(Zi=null,gc=Ft()+500,Ka(a,c));do try{W9();break}catch(H){f6(a,H)}while(!0);Ug(),tp.current=P,_t=E,En!==null?c=0:(Hn=null,Qn=0,c=Mn)}if(c!==0){if(c===2&&(E=Vu(a),E!==0&&(y=E,c=Pv(a,E))),c===1)throw f=pd,Ka(a,0),Fo(a,y),Mr(a,Ft()),f;if(c===6)Fo(a,y);else{if(E=a.current.alternate,(y&30)===0&&!B9(E)&&(c=lp(a,y),c===2&&(P=Vu(a),P!==0&&(y=P,c=Pv(a,P))),c===1))throw f=pd,Ka(a,0),Fo(a,y),Mr(a,Ft()),f;switch(a.finishedWork=E,a.finishedLanes=y,c){case 0:case 1:throw Error(n(345));case 2:Ya(a,Rr,Zi);break;case 3:if(Fo(a,y),(y&130023424)===y&&(c=Ev+500-Ft(),10<c)){if(ko(a,0)!==0)break;if(E=a.suspendedLanes,(E&y)!==y){mr(),a.pingedLanes|=a.suspendedLanes&E;break}a.timeoutHandle=Og(Ya.bind(null,a,Rr,Zi),c);break}Ya(a,Rr,Zi);break;case 4:if(Fo(a,y),(y&4194240)===y)break;for(c=a.eventTimes,E=-1;0<y;){var O=31-Yr(y);P=1<<O,O=c[O],O>E&&(E=O),y&=~P}if(y=E,y=Ft()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*z9(y/1960))-y,10<y){a.timeoutHandle=Og(Ya.bind(null,a,Rr,Zi),y);break}Ya(a,Rr,Zi);break;case 5:Ya(a,Rr,Zi);break;default:throw Error(n(329))}}}return Mr(a,Ft()),a.callbackNode===f?u6.bind(null,a):null}function Pv(a,c){var f=md;return a.current.memoizedState.isDehydrated&&(Ka(a,c).flags|=256),a=lp(a,c),a!==2&&(c=Rr,Rr=f,c!==null&&Tv(c)),a}function Tv(a){Rr===null?Rr=a:Rr.push.apply(Rr,a)}function B9(a){for(var c=a;;){if(c.flags&16384){var f=c.updateQueue;if(f!==null&&(f=f.stores,f!==null))for(var y=0;y<f.length;y++){var E=f[y],P=E.getSnapshot;E=E.value;try{if(!Fs(P(),E))return!1}catch{return!1}}}if(f=c.child,c.subtreeFlags&16384&&f!==null)f.return=c,c=f;else{if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Fo(a,c){for(c&=~Sv,c&=~np,a.suspendedLanes|=c,a.pingedLanes&=~c,a=a.expirationTimes;0<c;){var f=31-Yr(c),y=1<<f;a[f]=-1,c&=~y}}function d6(a){if((_t&6)!==0)throw Error(n(327));vc();var c=ko(a,0);if((c&1)===0)return Mr(a,Ft()),null;var f=lp(a,c);if(a.tag!==0&&f===2){var y=Vu(a);y!==0&&(c=y,f=Pv(a,y))}if(f===1)throw f=pd,Ka(a,0),Fo(a,c),Mr(a,Ft()),f;if(f===6)throw Error(n(345));return a.finishedWork=a.current.alternate,a.finishedLanes=c,Ya(a,Rr,Zi),Mr(a,Ft()),null}function Iv(a,c){var f=_t;_t|=1;try{return a(c)}finally{_t=f,_t===0&&(gc=Ft()+500,Dh&&Mo())}}function Ga(a){$o!==null&&$o.tag===0&&(_t&6)===0&&vc();var c=_t;_t|=1;var f=bs.transition,y=Ct;try{if(bs.transition=null,Ct=1,a)return a()}finally{Ct=y,bs.transition=f,_t=c,(_t&6)===0&&Mo()}}function Av(){ns=mc.current,Ht(mc)}function Ka(a,c){a.finishedWork=null,a.finishedLanes=0;var f=a.timeoutHandle;if(f!==-1&&(a.timeoutHandle=-1,_9(f)),En!==null)for(f=En.return;f!==null;){var y=f;switch(Fg(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&Oh();break;case 3:fc(),Ht(Tr),Ht(ir),Qg();break;case 5:Yg(y);break;case 4:fc();break;case 13:Ht(Jt);break;case 19:Ht(Jt);break;case 10:Wg(y.type._context);break;case 22:case 23:Av()}f=f.return}if(Hn=a,En=a=Vo(a.current,null),Qn=ns=c,Mn=0,pd=null,Sv=np=qa=0,Rr=md=null,Ua!==null){for(c=0;c<Ua.length;c++)if(f=Ua[c],y=f.interleaved,y!==null){f.interleaved=null;var E=y.next,P=f.pending;if(P!==null){var O=P.next;P.next=E,y.next=O}f.pending=y}Ua=null}return a}function f6(a,c){do{var f=En;try{if(Ug(),Wh.current=Kh,Zh){for(var y=en.memoizedState;y!==null;){var E=y.queue;E!==null&&(E.pending=null),y=y.next}Zh=!1}if(Za=0,Vn=Rn=en=null,ld=!1,cd=0,bv.current=null,f===null||f.return===null){Mn=1,pd=c,En=null;break}e:{var P=a,O=f.return,H=f,G=c;if(c=Qn,H.flags|=32768,G!==null&&typeof G=="object"&&typeof G.then=="function"){var ie=G,me=H,ve=me.tag;if((me.mode&1)===0&&(ve===0||ve===11||ve===15)){var pe=me.alternate;pe?(me.updateQueue=pe.updateQueue,me.memoizedState=pe.memoizedState,me.lanes=pe.lanes):(me.updateQueue=null,me.memoizedState=null)}var Ie=$4(O);if(Ie!==null){Ie.flags&=-257,j4(Ie,O,H,P,c),Ie.mode&1&&N4(P,ie,c),c=Ie,G=ie;var Ne=c.updateQueue;if(Ne===null){var Fe=new Set;Fe.add(G),c.updateQueue=Fe}else Ne.add(G);break e}else{if((c&1)===0){N4(P,ie,c),Rv();break e}G=Error(n(426))}}else if(Gt&&H.mode&1){var gn=$4(O);if(gn!==null){(gn.flags&65536)===0&&(gn.flags|=256),j4(gn,O,H,P,c),zg(hc(G,H));break e}}P=G=hc(G,H),Mn!==4&&(Mn=2),md===null?md=[P]:md.push(P),P=O;do{switch(P.tag){case 3:P.flags|=65536,c&=-c,P.lanes|=c;var te=L4(P,G,c);a4(P,te);break e;case 1:H=G;var K=P.type,ne=P.stateNode;if((P.flags&128)===0&&(typeof K.getDerivedStateFromError=="function"||ne!==null&&typeof ne.componentDidCatch=="function"&&(No===null||!No.has(ne)))){P.flags|=65536,c&=-c,P.lanes|=c;var be=D4(P,H,c);a4(P,be);break e}}P=P.return}while(P!==null)}m6(f)}catch(Ve){c=Ve,En===f&&f!==null&&(En=f=f.return);continue}break}while(!0)}function h6(){var a=tp.current;return tp.current=Kh,a===null?Kh:a}function Rv(){(Mn===0||Mn===3||Mn===2)&&(Mn=4),Hn===null||(qa&268435455)===0&&(np&268435455)===0||Fo(Hn,Qn)}function lp(a,c){var f=_t;_t|=2;var y=h6();(Hn!==a||Qn!==c)&&(Zi=null,Ka(a,c));do try{U9();break}catch(E){f6(a,E)}while(!0);if(Ug(),_t=f,tp.current=y,En!==null)throw Error(n(261));return Hn=null,Qn=0,Mn}function U9(){for(;En!==null;)p6(En)}function W9(){for(;En!==null&&!ig();)p6(En)}function p6(a){var c=y6(a.alternate,a,ns);a.memoizedProps=a.pendingProps,c===null?m6(a):En=c,bv.current=null}function m6(a){var c=a;do{var f=c.alternate;if(a=c.return,(c.flags&32768)===0){if(f=$9(f,c,ns),f!==null){En=f;return}}else{if(f=j9(f,c),f!==null){f.flags&=32767,En=f;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Mn=6,En=null;return}}if(c=c.sibling,c!==null){En=c;return}En=c=a}while(c!==null);Mn===0&&(Mn=5)}function Ya(a,c,f){var y=Ct,E=bs.transition;try{bs.transition=null,Ct=1,Z9(a,c,f,y)}finally{bs.transition=E,Ct=y}return null}function Z9(a,c,f,y){do vc();while($o!==null);if((_t&6)!==0)throw Error(n(327));f=a.finishedWork;var E=a.finishedLanes;if(f===null)return null;if(a.finishedWork=null,a.finishedLanes=0,f===a.current)throw Error(n(177));a.callbackNode=null,a.callbackPriority=0;var P=f.lanes|f.childLanes;if(Hu(a,P),a===Hn&&(En=Hn=null,Qn=0),(f.subtreeFlags&2064)===0&&(f.flags&2064)===0||sp||(sp=!0,_6(Na,function(){return vc(),null})),P=(f.flags&15990)!==0,(f.subtreeFlags&15990)!==0||P){P=bs.transition,bs.transition=null;var O=Ct;Ct=1;var H=_t;_t|=4,bv.current=null,V9(a,f),i6(f,a),f9(Rg),vs=!!Ag,Rg=Ag=null,a.current=f,H9(f),Nu(),_t=H,Ct=O,bs.transition=P}else a.current=f;if(sp&&(sp=!1,$o=a,ip=E),P=a.pendingLanes,P===0&&(No=null),ag(f.stateNode),Mr(a,Ft()),c!==null)for(y=a.onRecoverableError,f=0;f<c.length;f++)E=c[f],y(E.value,{componentStack:E.stack,digest:E.digest});if(rp)throw rp=!1,a=kv,kv=null,a;return(ip&1)!==0&&a.tag!==0&&vc(),P=a.pendingLanes,(P&1)!==0?a===Cv?gd++:(gd=0,Cv=a):gd=0,Mo(),null}function vc(){if($o!==null){var a=_h(ip),c=bs.transition,f=Ct;try{if(bs.transition=null,Ct=16>a?16:a,$o===null)var y=!1;else{if(a=$o,$o=null,ip=0,(_t&6)!==0)throw Error(n(331));var E=_t;for(_t|=4,Me=a.current;Me!==null;){var P=Me,O=P.child;if((Me.flags&16)!==0){var H=P.deletions;if(H!==null){for(var G=0;G<H.length;G++){var ie=H[G];for(Me=ie;Me!==null;){var me=Me;switch(me.tag){case 0:case 11:case 15:hd(8,me,P)}var ve=me.child;if(ve!==null)ve.return=me,Me=ve;else for(;Me!==null;){me=Me;var pe=me.sibling,Ie=me.return;if(e6(me),me===ie){Me=null;break}if(pe!==null){pe.return=Ie,Me=pe;break}Me=Ie}}}var Ne=P.alternate;if(Ne!==null){var Fe=Ne.child;if(Fe!==null){Ne.child=null;do{var gn=Fe.sibling;Fe.sibling=null,Fe=gn}while(Fe!==null)}}Me=P}}if((P.subtreeFlags&2064)!==0&&O!==null)O.return=P,Me=O;else e:for(;Me!==null;){if(P=Me,(P.flags&2048)!==0)switch(P.tag){case 0:case 11:case 15:hd(9,P,P.return)}var te=P.sibling;if(te!==null){te.return=P.return,Me=te;break e}Me=P.return}}var K=a.current;for(Me=K;Me!==null;){O=Me;var ne=O.child;if((O.subtreeFlags&2064)!==0&&ne!==null)ne.return=O,Me=ne;else e:for(O=K;Me!==null;){if(H=Me,(H.flags&2048)!==0)try{switch(H.tag){case 0:case 11:case 15:ep(9,H)}}catch(Ve){cn(H,H.return,Ve)}if(H===O){Me=null;break e}var be=H.sibling;if(be!==null){be.return=H.return,Me=be;break e}Me=H.return}}if(_t=E,Mo(),gs&&typeof gs.onPostCommitFiberRoot=="function")try{gs.onPostCommitFiberRoot(Eo,a)}catch{}y=!0}return y}finally{Ct=f,bs.transition=c}}return!1}function g6(a,c,f){c=hc(f,c),c=L4(a,c,1),a=Lo(a,c,1),c=mr(),a!==null&&(Co(a,1,c),Mr(a,c))}function cn(a,c,f){if(a.tag===3)g6(a,a,f);else for(;c!==null;){if(c.tag===3){g6(c,a,f);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(No===null||!No.has(y))){a=hc(f,a),a=D4(c,a,1),c=Lo(c,a,1),a=mr(),c!==null&&(Co(c,1,a),Mr(c,a));break}}c=c.return}}function q9(a,c,f){var y=a.pingCache;y!==null&&y.delete(c),c=mr(),a.pingedLanes|=a.suspendedLanes&f,Hn===a&&(Qn&f)===f&&(Mn===4||Mn===3&&(Qn&130023424)===Qn&&500>Ft()-Ev?Ka(a,0):Sv|=f),Mr(a,c)}function v6(a,c){c===0&&((a.mode&1)===0?c=1:(c=Gl,Gl<<=1,(Gl&130023424)===0&&(Gl=4194304)));var f=mr();a=Bi(a,c),a!==null&&(Co(a,c,f),Mr(a,f))}function G9(a){var c=a.memoizedState,f=0;c!==null&&(f=c.retryLane),v6(a,f)}function K9(a,c){var f=0;switch(a.tag){case 13:var y=a.stateNode,E=a.memoizedState;E!==null&&(f=E.retryLane);break;case 19:y=a.stateNode;break;default:throw Error(n(314))}y!==null&&y.delete(c),v6(a,f)}var y6;y6=function(a,c,f){if(a!==null)if(a.memoizedProps!==c.pendingProps||Tr.current)Ar=!0;else{if((a.lanes&f)===0&&(c.flags&128)===0)return Ar=!1,N9(a,c,f);Ar=(a.flags&131072)!==0}else Ar=!1,Gt&&(c.flags&1048576)!==0&&Xb(c,$h,c.index);switch(c.lanes=0,c.tag){case 2:var y=c.type;Qh(a,c),a=c.pendingProps;var E=ic(c,ir.current);dc(c,f),E=tv(null,c,y,a,E,f);var P=nv();return c.flags|=1,typeof E=="object"&&E!==null&&typeof E.render=="function"&&E.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Ir(y)?(P=!0,Lh(c)):P=!1,c.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,Gg(c),E.updater=Yh,c.stateNode=E,E._reactInternals=c,lv(c,y,a,f),c=fv(null,c,y,!0,P,f)):(c.tag=0,Gt&&P&&jg(c),pr(null,c,E,f),c=c.child),c;case 16:y=c.elementType;e:{switch(Qh(a,c),a=c.pendingProps,E=y._init,y=E(y._payload),c.type=y,E=c.tag=X9(y),a=Hs(y,a),E){case 0:c=dv(null,c,y,a,f);break e;case 1:c=U4(null,c,y,a,f);break e;case 11:c=F4(null,c,y,a,f);break e;case 14:c=V4(null,c,y,Hs(y.type,a),f);break e}throw Error(n(306,y,""))}return c;case 0:return y=c.type,E=c.pendingProps,E=c.elementType===y?E:Hs(y,E),dv(a,c,y,E,f);case 1:return y=c.type,E=c.pendingProps,E=c.elementType===y?E:Hs(y,E),U4(a,c,y,E,f);case 3:e:{if(W4(c),a===null)throw Error(n(387));y=c.pendingProps,P=c.memoizedState,E=P.element,o4(a,c),Bh(c,y,null,f);var O=c.memoizedState;if(y=O.element,P.isDehydrated)if(P={element:y,isDehydrated:!1,cache:O.cache,pendingSuspenseBoundaries:O.pendingSuspenseBoundaries,transitions:O.transitions},c.updateQueue.baseState=P,c.memoizedState=P,c.flags&256){E=hc(Error(n(423)),c),c=Z4(a,c,y,f,E);break e}else if(y!==E){E=hc(Error(n(424)),c),c=Z4(a,c,y,f,E);break e}else for(ts=Io(c.stateNode.containerInfo.firstChild),es=c,Gt=!0,Vs=null,f=s4(c,null,y,f),c.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(lc(),y===E){c=Wi(a,c,f);break e}pr(a,c,y,f)}c=c.child}return c;case 5:return c4(c),a===null&&Hg(c),y=c.type,E=c.pendingProps,P=a!==null?a.memoizedProps:null,O=E.children,Mg(y,E)?O=null:P!==null&&Mg(y,P)&&(c.flags|=32),B4(a,c),pr(a,c,O,f),c.child;case 6:return a===null&&Hg(c),null;case 13:return q4(a,c,f);case 4:return Kg(c,c.stateNode.containerInfo),y=c.pendingProps,a===null?c.child=cc(c,null,y,f):pr(a,c,y,f),c.child;case 11:return y=c.type,E=c.pendingProps,E=c.elementType===y?E:Hs(y,E),F4(a,c,y,E,f);case 7:return pr(a,c,c.pendingProps,f),c.child;case 8:return pr(a,c,c.pendingProps.children,f),c.child;case 12:return pr(a,c,c.pendingProps.children,f),c.child;case 10:e:{if(y=c.type._context,E=c.pendingProps,P=c.memoizedProps,O=E.value,jt(Vh,y._currentValue),y._currentValue=O,P!==null)if(Fs(P.value,O)){if(P.children===E.children&&!Tr.current){c=Wi(a,c,f);break e}}else for(P=c.child,P!==null&&(P.return=c);P!==null;){var H=P.dependencies;if(H!==null){O=P.child;for(var G=H.firstContext;G!==null;){if(G.context===y){if(P.tag===1){G=Ui(-1,f&-f),G.tag=2;var ie=P.updateQueue;if(ie!==null){ie=ie.shared;var me=ie.pending;me===null?G.next=G:(G.next=me.next,me.next=G),ie.pending=G}}P.lanes|=f,G=P.alternate,G!==null&&(G.lanes|=f),Zg(P.return,f,c),H.lanes|=f;break}G=G.next}}else if(P.tag===10)O=P.type===c.type?null:P.child;else if(P.tag===18){if(O=P.return,O===null)throw Error(n(341));O.lanes|=f,H=O.alternate,H!==null&&(H.lanes|=f),Zg(O,f,c),O=P.sibling}else O=P.child;if(O!==null)O.return=P;else for(O=P;O!==null;){if(O===c){O=null;break}if(P=O.sibling,P!==null){P.return=O.return,O=P;break}O=O.return}P=O}pr(a,c,E.children,f),c=c.child}return c;case 9:return E=c.type,y=c.pendingProps.children,dc(c,f),E=ws(E),y=y(E),c.flags|=1,pr(a,c,y,f),c.child;case 14:return y=c.type,E=Hs(y,c.pendingProps),E=Hs(y.type,E),V4(a,c,y,E,f);case 15:return H4(a,c,c.type,c.pendingProps,f);case 17:return y=c.type,E=c.pendingProps,E=c.elementType===y?E:Hs(y,E),Qh(a,c),c.tag=1,Ir(y)?(a=!0,Lh(c)):a=!1,dc(c,f),M4(c,y,E),lv(c,y,E,f),fv(null,c,y,!0,a,f);case 19:return K4(a,c,f);case 22:return z4(a,c,f)}throw Error(n(156,c.tag))};function _6(a,c){return hh(a,c)}function Y9(a,c,f,y){this.tag=a,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ss(a,c,f,y){return new Y9(a,c,f,y)}function Mv(a){return a=a.prototype,!(!a||!a.isReactComponent)}function X9(a){if(typeof a=="function")return Mv(a)?1:0;if(a!=null){if(a=a.$$typeof,a===j)return 11;if(a===Z)return 14}return 2}function Vo(a,c){var f=a.alternate;return f===null?(f=Ss(a.tag,c,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=c,f.type=a.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=a.flags&14680064,f.childLanes=a.childLanes,f.lanes=a.lanes,f.child=a.child,f.memoizedProps=a.memoizedProps,f.memoizedState=a.memoizedState,f.updateQueue=a.updateQueue,c=a.dependencies,f.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f}function cp(a,c,f,y,E,P){var O=2;if(y=a,typeof a=="function")Mv(a)&&(O=1);else if(typeof a=="string")O=5;else e:switch(a){case R:return Xa(f.children,E,P,c);case A:O=8,E|=8;break;case L:return a=Ss(12,f,c,E|2),a.elementType=L,a.lanes=P,a;case Q:return a=Ss(13,f,c,E),a.elementType=Q,a.lanes=P,a;case q:return a=Ss(19,f,c,E),a.elementType=q,a.lanes=P,a;case Y:return up(f,E,P,c);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case N:O=10;break e;case F:O=9;break e;case j:O=11;break e;case Z:O=14;break e;case W:O=16,y=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return c=Ss(O,f,c,E),c.elementType=a,c.type=y,c.lanes=P,c}function Xa(a,c,f,y){return a=Ss(7,a,y,c),a.lanes=f,a}function up(a,c,f,y){return a=Ss(22,a,y,c),a.elementType=Y,a.lanes=f,a.stateNode={isHidden:!1},a}function Ov(a,c,f){return a=Ss(6,a,null,c),a.lanes=f,a}function Lv(a,c,f){return c=Ss(4,a.children!==null?a.children:[],a.key,c),c.lanes=f,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function Q9(a,c,f,y,E){this.tag=c,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=oi(0),this.expirationTimes=oi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=oi(0),this.identifierPrefix=y,this.onRecoverableError=E,this.mutableSourceEagerHydrationData=null}function Dv(a,c,f,y,E,P,O,H,G){return a=new Q9(a,c,f,H,G),c===1?(c=1,P===!0&&(c|=8)):c=0,P=Ss(3,null,null,c),a.current=P,P.stateNode=a,P.memoizedState={element:y,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},Gg(P),a}function J9(a,c,f){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:y==null?null:""+y,children:a,containerInfo:c,implementation:f}}function w6(a){if(!a)return Ro;a=a._reactInternals;e:{if(Ns(a)!==a||a.tag!==1)throw Error(n(170));var c=a;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(Ir(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(n(171))}if(a.tag===1){var f=a.type;if(Ir(f))return Gb(a,f,c)}return c}function x6(a,c,f,y,E,P,O,H,G){return a=Dv(f,y,!0,a,E,P,O,H,G),a.context=w6(null),f=a.current,y=mr(),E=jo(f),P=Ui(y,E),P.callback=c??null,Lo(f,P,E),a.current.lanes=E,Co(a,E,y),Mr(a,y),a}function dp(a,c,f,y){var E=c.current,P=mr(),O=jo(E);return f=w6(f),c.context===null?c.context=f:c.pendingContext=f,c=Ui(P,O),c.payload={element:a},y=y===void 0?null:y,y!==null&&(c.callback=y),a=Lo(E,c,O),a!==null&&(Us(a,E,O,P),zh(a,E,O)),O}function fp(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function b6(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<c?f:c}}function Nv(a,c){b6(a,c),(a=a.alternate)&&b6(a,c)}function eD(){return null}var S6=typeof reportError=="function"?reportError:function(a){console.error(a)};function $v(a){this._internalRoot=a}hp.prototype.render=$v.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(n(409));dp(a,c,null,null)},hp.prototype.unmount=$v.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;Ga(function(){dp(null,a,null,null)}),c[Fi]=null}};function hp(a){this._internalRoot=a}hp.prototype.unstable_scheduleHydration=function(a){if(a){var c=ja();a={blockedOn:null,target:a,priority:c};for(var f=0;f<he.length&&c!==0&&c<he[f].priority;f++);he.splice(f,0,a),f===0&&ln(a)}};function jv(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function pp(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function E6(){}function tD(a,c,f,y,E){if(E){if(typeof y=="function"){var P=y;y=function(){var ie=fp(O);P.call(ie)}}var O=x6(c,y,a,0,null,!1,!1,"",E6);return a._reactRootContainer=O,a[Fi]=O.current,ed(a.nodeType===8?a.parentNode:a),Ga(),O}for(;E=a.lastChild;)a.removeChild(E);if(typeof y=="function"){var H=y;y=function(){var ie=fp(G);H.call(ie)}}var G=Dv(a,0,!1,null,null,!1,!1,"",E6);return a._reactRootContainer=G,a[Fi]=G.current,ed(a.nodeType===8?a.parentNode:a),Ga(function(){dp(c,G,f,y)}),G}function mp(a,c,f,y,E){var P=f._reactRootContainer;if(P){var O=P;if(typeof E=="function"){var H=E;E=function(){var G=fp(O);H.call(G)}}dp(c,O,a,E)}else O=tD(f,c,a,E,y);return fp(O)}Bu=function(a){switch(a.tag){case 3:var c=a.stateNode;if(c.current.memoizedState.isDehydrated){var f=$a(c.pendingLanes);f!==0&&(zu(c,f|1),Mr(c,Ft()),(_t&6)===0&&(gc=Ft()+500,Mo()))}break;case 13:Ga(function(){var y=Bi(a,1);if(y!==null){var E=mr();Us(y,a,1,E)}}),Nv(a,1)}},Uu=function(a){if(a.tag===13){var c=Bi(a,134217728);if(c!==null){var f=mr();Us(c,a,134217728,f)}Nv(a,134217728)}},Wu=function(a){if(a.tag===13){var c=jo(a),f=Bi(a,c);if(f!==null){var y=mr();Us(f,a,c,y)}Nv(a,c)}},ja=function(){return Ct},Kl=function(a,c){var f=Ct;try{return Ct=a,c()}finally{Ct=f}},hr=function(a,c,f){switch(c){case"input":if(De(a,f),c=f.name,f.type==="radio"&&c!=null){for(f=a;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<f.length;c++){var y=f[c];if(y!==a&&y.form===a.form){var E=Mh(y);if(!E)throw Error(n(90));We(y),De(y,E)}}}break;case"textarea":St(a,f);break;case"select":c=f.value,c!=null&&Re(a,!!f.multiple,c,!1)}},Ue=Iv,Qt=Ga;var nD={usingClientEntryPoint:!1,Events:[rd,rc,Mh,Oa,La,Iv]},vd={findFiberByHostInstance:Va,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},rD={bundleType:vd.bundleType,version:vd.version,rendererPackageName:vd.rendererPackageName,rendererConfig:vd.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:T.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=fh(a),a===null?null:a.stateNode},findFiberByHostInstance:vd.findFiberByHostInstance||eD,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gp.isDisabled&&gp.supportsFiber)try{Eo=gp.inject(rD),gs=gp}catch{}}return Or.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=nD,Or.createPortal=function(a,c){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!jv(c))throw Error(n(200));return J9(a,c,null,f)},Or.createRoot=function(a,c){if(!jv(a))throw Error(n(299));var f=!1,y="",E=S6;return c!=null&&(c.unstable_strictMode===!0&&(f=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onRecoverableError!==void 0&&(E=c.onRecoverableError)),c=Dv(a,1,!1,null,null,f,!1,y,E),a[Fi]=c.current,ed(a.nodeType===8?a.parentNode:a),new $v(c)},Or.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var c=a._reactInternals;if(c===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=fh(c),a=a===null?null:a.stateNode,a},Or.flushSync=function(a){return Ga(a)},Or.hydrate=function(a,c,f){if(!pp(c))throw Error(n(200));return mp(null,a,c,!0,f)},Or.hydrateRoot=function(a,c,f){if(!jv(a))throw Error(n(405));var y=f!=null&&f.hydratedSources||null,E=!1,P="",O=S6;if(f!=null&&(f.unstable_strictMode===!0&&(E=!0),f.identifierPrefix!==void 0&&(P=f.identifierPrefix),f.onRecoverableError!==void 0&&(O=f.onRecoverableError)),c=x6(c,null,a,1,f??null,E,!1,P,O),a[Fi]=c.current,ed(a),y)for(a=0;a<y.length;a++)f=y[a],E=f._getVersion,E=E(f._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[f,E]:c.mutableSourceEagerHydrationData.push(f,E);return new hp(c)},Or.render=function(a,c,f){if(!pp(c))throw Error(n(200));return mp(null,a,c,!1,f)},Or.unmountComponentAtNode=function(a){if(!pp(a))throw Error(n(40));return a._reactRootContainer?(Ga(function(){mp(null,null,a,!1,function(){a._reactRootContainer=null,a[Fi]=null})}),!0):!1},Or.unstable_batchedUpdates=Iv,Or.unstable_renderSubtreeIntoContainer=function(a,c,f,y){if(!pp(f))throw Error(n(200));if(a==null||a._reactInternals===void 0)throw Error(n(38));return mp(a,c,f,!1,y)},Or.version="18.3.1-next-f1338f8080-20240426",Or}var g8;function v5(){if(g8)return k1.exports;g8=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(),k1.exports=Rj(),k1.exports}var v8;function Mj(){if(v8)return Ip;v8=1;var t=v5();return Ip.createRoot=t.createRoot,Ip.hydrateRoot=t.hydrateRoot,Ip}var Oj=Mj();const Lj=Pm(Oj),uo={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function y5(t){return"init"in t}function __(t){return typeof t.write=="function"}function Dj(t){return!!t.onMount}function y8(t){return"v"in t||"e"in t}function X0(t){if("e"in t)throw t.e;if((uo?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}function Q0(t){return typeof(t==null?void 0:t.then)=="function"}function Nj(t){if(!(t instanceof Error))return!1;const e=t.name,n=t.message.toLowerCase();return(e==="RangeError"||e==="InternalError")&&(n.includes("call stack")||n.includes("too much recursion")||n.includes("stack overflow"))}function _5(t,e,n){if(!n.p.has(t)){n.p.add(t);const r=()=>n.p.delete(t);e.then(r,r)}}function w5(t,e,n){const r=n.get(t),s=r==null?void 0:r.t,i=e.p;if(!(s!=null&&s.size))return i;if(!i.size)return s;const o=new Set(s);for(const l of i)o.add(l);return o}function $j(t){return!!t.INTERNAL_onInit}const jj=(t,e,n,...r)=>n.read(...r),Fj=(t,e,n,...r)=>n.write(...r),Vj=(t,e,n)=>n.INTERNAL_onInit(e),Hj=(t,e,n,r)=>{var s;return(s=n.onMount)==null?void 0:s.call(n,r)},zj=(t,e,n)=>{var r;const s=t[0];let i=s.get(n);if(!i){const o=t[6],l=t[9];i={d:new Map,p:new Set,n:0},s.set(n,i),(r=o.i)==null||r.call(o,n),$j(n)&&l(t,e,n)}return i},Bj=(t,e)=>{var n;const r=t[1],s=t[3],i=t[4],o=t[5],l=t[6],u=t[13];if(!l.f&&!s.size&&!i.size&&!o.size)return;const d=[],h=p=>{try{p()}catch(m){d.push(m)}};do{l.f&&h(l.f);const p=new Set;for(const m of s){const v=(n=r.get(m))==null?void 0:n.l;if(v)for(const w of v)p.add(w)}s.clear();for(const m of o)p.add(m);o.clear();for(const m of i)p.add(m);i.clear();for(const m of p)h(m);s.size&&u(t,e)}while(s.size||o.size||i.size);if(d.length)throw new AggregateError(d)},Uj=(t,e)=>{const n=t[1],r=t[2],s=t[3],i=t[11],o=t[14],l=t[17];if(!s.size)return;const u=[],d=[],h=new WeakSet,p=new WeakSet,m=[],v=[];for(const w of s)m.push(w),v.push(i(t,e,w));for(;m.length;){const w=m.length-1,_=m[w],x=v[w];if(p.has(_)){m.pop(),v.pop();continue}if(h.has(_)){if(r.get(_)===x.n)u.push(_),d.push(x);else if((uo?"production":void 0)!=="production"&&r.has(_))throw new Error("[Bug] invalidated atom exists");p.add(_),m.pop(),v.pop();continue}h.add(_);for(const b of w5(_,x,n))h.has(b)||(m.push(b),v.push(i(t,e,b)))}for(let w=u.length-1;w>=0;--w){const _=u[w],x=d[w];let b=!1;for(const k of x.d.keys())if(k!==_&&s.has(k)){b=!0;break}b&&(r.set(_,x.n),o(t,e,_),l(t,e,_)),r.delete(_)}},w_=new WeakSet,Wj=(t,e,n)=>{var r,s;const i=t[1],o=t[2],l=t[3],u=t[6],d=t[7],h=t[11],p=t[12],m=t[13],v=t[14],w=t[16],_=t[17],x=t[20],b=t[26],k=t[28],C=h(t,e,n),T=k[0];if(y8(C)){if(i.has(n)&&o.get(n)!==C.n||C.m===T)return C.m=T,C;let Z=!1;for(const[W,Y]of C.d)if(v(t,e,W).n!==Y){Z=!0;break}if(!Z)return C.m=T,C}let I=!0;const M=new Set(C.d.keys()),R=()=>{for(const Z of M)C.d.delete(Z)},A=()=>{if(i.has(n)){const Z=!l.size;_(t,e,n),Z&&(m(t,e),p(t,e))}},L=Z=>{var W;if(Z===n){const V=h(t,e,Z);if(!y8(V))if(y5(Z))x(t,e,Z,Z.init);else throw new Error("no atom init");return X0(V)}const Y=v(t,e,Z);try{return X0(Y)}finally{M.delete(Z),C.d.set(Z,Y.n),Q0(C.v)&&_5(n,C.v,Y),i.has(n)&&((W=i.get(Z))==null||W.t.add(n)),I||A()}};let N,F;const j={get signal(){return N||(N=new AbortController),N.signal},get setSelf(){return(uo?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(uo?"production":void 0)!=="production"&&!__(n)&&console.warn("setSelf function cannot be used with read-only atom"),!F&&__(n)&&(F=(...Z)=>{if((uo?"production":void 0)!=="production"&&I&&console.warn("setSelf function cannot be called in sync"),!I)try{return w(t,e,n,Z)}finally{m(t,e),p(t,e)}}),F}},Q=C.n,q=o.get(n)===Q;try{(uo?"production":void 0)!=="production"&&w_.delete(e);const Z=d(t,e,n,L,j);if((uo?"production":void 0)!=="production"&&w_.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),x(t,e,n,Z),Q0(Z)){b(t,e,Z,()=>N==null?void 0:N.abort());const W=()=>{R(),A()};Z.then(W,W)}else R();return(r=u.r)==null||r.call(u,n),C.m=T,C}catch(Z){if(Nj(Z))throw Z;return delete C.v,C.e=Z,++C.n,C.m=T,C}finally{I=!1,C.n!==Q&&q&&(o.set(n,C.n),l.add(n),(s=u.c)==null||s.call(u,n))}},Zj=(t,e,n)=>{const r=t[1],s=t[2],i=t[11],o=[n];for(;o.length;){const l=o.pop(),u=i(t,e,l);for(const d of w5(l,u,r)){const h=i(t,e,d);s.get(d)!==h.n&&(s.set(d,h.n),o.push(d))}}},qj=(t,e,n,r)=>{const s=t[3],i=t[6],o=t[8],l=t[11],u=t[12],d=t[13],h=t[14],p=t[15],m=t[16],v=t[17],w=t[20],_=t[28];let x=!0;const b=C=>X0(h(t,e,C)),k=(C,...T)=>{var I;const M=l(t,e,C);try{if(C===n){if(!y5(C))throw new Error("atom not writable");(uo?"production":void 0)!=="production"&&w_.add(e);const R=M.n,A=T[0];w(t,e,C,A),v(t,e,C),R!==M.n&&(++_[0],s.add(C),p(t,e,C),(I=i.c)==null||I.call(i,C));return}else return m(t,e,C,T)}finally{x||(d(t,e),u(t,e))}};try{return o(t,e,n,b,k,...r)}finally{x=!1}},Gj=(t,e,n)=>{var r;const s=t[1],i=t[3],o=t[6],l=t[11],u=t[15],d=t[18],h=t[19],p=l(t,e,n),m=s.get(n);if(m&&p.d.size>0){for(const[v,w]of p.d)if(!m.d.has(v)){const _=l(t,e,v);d(t,e,v).t.add(n),m.d.add(v),w!==_.n&&(i.add(v),u(t,e,v),(r=o.c)==null||r.call(o,v))}for(const v of m.d)if(!p.d.has(v)){m.d.delete(v);const w=h(t,e,v);w==null||w.t.delete(n)}}},Kj=(t,e,n)=>{var r;const s=t[1],i=t[4],o=t[6],l=t[10],u=t[11],d=t[12],h=t[13],p=t[14],m=t[16],v=t[18],w=u(t,e,n);let _=s.get(n);if(!_){p(t,e,n);for(const x of w.d.keys())v(t,e,x).t.add(n);if(_={l:new Set,d:new Set(w.d.keys()),t:new Set},s.set(n,_),__(n)&&Dj(n)){const x=()=>{let b=!0;const k=(...C)=>{try{return m(t,e,n,C)}finally{b||(h(t,e),d(t,e))}};try{const C=l(t,e,n,k);C&&(_.u=()=>{b=!0;try{C()}finally{b=!1}})}finally{b=!1}};i.add(x)}(r=o.m)==null||r.call(o,n)}return _},Yj=(t,e,n)=>{var r,s;const i=t[1],o=t[5],l=t[6],u=t[11],d=t[19],h=u(t,e,n);let p=i.get(n);if(!p||p.l.size)return p;let m=!1;for(const v of p.t)if((r=i.get(v))!=null&&r.d.has(n)){m=!0;break}if(!m){p.u&&o.add(p.u),p=void 0,i.delete(n);for(const v of h.d.keys()){const w=d(t,e,v);w==null||w.t.delete(n)}(s=l.u)==null||s.call(l,n);return}return p},Xj=(t,e,n,r)=>{const s=t[11],i=t[27],o=s(t,e,n),l="v"in o,u=o.v;if(Q0(r))for(const d of o.d.keys())_5(n,r,s(t,e,d));o.v=r,delete o.e,(!l||!Object.is(u,o.v))&&(++o.n,Q0(u)&&i(t,e,u))},Qj=(t,e,n)=>{const r=t[14];return X0(r(t,e,n))},Jj=(t,e,n,...r)=>{const s=t[3],i=t[12],o=t[13],l=t[16],u=s.size;try{return l(t,e,n,r)}finally{s.size!==u&&(o(t,e),i(t,e))}},eF=(t,e,n,r)=>{const s=t[12],i=t[13],o=t[18],l=t[19],d=o(t,e,n).l;return d.add(r),i(t,e),s(t,e),()=>{d.delete(r),l(t,e,n),i(t,e),s(t,e)}},tF=(t,e,n,r)=>{const s=t[25];let i=s.get(n);if(!i){i=new Set,s.set(n,i);const o=()=>s.delete(n);n.then(o,o)}i.add(r)},nF=(t,e,n)=>{const s=t[25].get(n);s==null||s.forEach(i=>i())},x5=new WeakMap;function rF(t){const e=x5.get(t);if((uo?"production":void 0)!=="production"&&!e)throw new Error("Store must be created by buildStore to read its building blocks");const n=e[24];return n?n(e,t):e}function sF(...t){const e={get(o){return r(n,e,o)},set(o,...l){return s(n,e,o,...l)},sub(o,l){return i(n,e,o,l)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},jj,Fj,Vj,Hj,zj,Bj,Uj,Wj,Zj,qj,Gj,Kj,Yj,Xj,Qj,Jj,eF,void 0,new WeakMap,tF,nF,[0]].map((o,l)=>t[l]||o);x5.set(e,Object.freeze(n));const r=n[21],s=n[22],i=n[23];return e}const b5={};let iF=0;function ot(t,e){const n=`atom${++iF}`,r={toString(){return(b5?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=oF,r.write=aF),e&&(r.write=e),r}function oF(t){return t(this)}function aF(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function lF(){return sF()}let Id;function cF(){return Id||(Id=lF(),(b5?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Id),globalThis.__JOTAI_DEFAULT_STORE__!==Id&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Id}const uF={},dF=g.createContext(void 0);function gw(t){return g.useContext(dF)||cF()}const x_=t=>typeof(t==null?void 0:t.then)=="function",b_=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},fF=we.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(b_(t),t)}),T1=new WeakMap,_8=(t,e,n)=>{const r=rF(t),s=r[26];let i=T1.get(e);return i||(i=new Promise((o,l)=>{let u=e;const d=m=>v=>{u===m&&o(v)},h=m=>v=>{u===m&&l(v)},p=()=>{try{const m=n();x_(m)?(T1.set(m,i),u=m,m.then(d(m),h(m)),s(r,t,m,p)):o(m)}catch(m){l(m)}};e.then(d(e),h(e)),s(r,t,e,p)}),T1.set(e,i)),i};function nt(t,e){const{delay:n,unstable_promiseStatus:r=!we.use}={},s=gw(),[[i,o,l],u]=g.useReducer(h=>{const p=s.get(t);return Object.is(h[0],p)&&h[1]===s&&h[2]===t?h:[p,s,t]},void 0,()=>[s.get(t),s,t]);let d=i;if((o!==s||l!==t)&&(u(),d=s.get(t)),g.useEffect(()=>{const h=s.sub(t,()=>{if(r)try{const p=s.get(t);x_(p)&&b_(_8(s,p,()=>s.get(t)))}catch{}if(typeof n=="number"){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3.
43
+
44
+ Migration guide:
45
+
46
+ Create a custom hook like the following.
47
+
48
+ function useAtomValueWithDelay<Value>(
49
+ atom: Atom<Value>,
50
+ options: { delay: number },
51
+ ): Value {
52
+ const { delay } = options
53
+ const store = useStore(options)
54
+ const [value, setValue] = useState(() => store.get(atom))
55
+ useEffect(() => {
56
+ const unsub = store.sub(atom, () => {
57
+ setTimeout(() => setValue(store.get(atom)), delay)
58
+ })
59
+ return unsub
60
+ }, [store, atom, delay])
61
+ return value
62
+ }
63
+ `),setTimeout(u,n);return}u()});return u(),h},[s,t,n,r]),g.useDebugValue(d),x_(d)){const h=_8(s,d,()=>s.get(t));return r&&b_(h),fF(h)}return d}function ft(t,e){const n=gw();return g.useCallback((...s)=>{if((uF?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...s)},[n,t])}function S5(t,e){return[nt(t),ft(t)]}const vw=g.createContext({});function yw(t){const e=g.useRef(null);return e.current===null&&(e.current=t()),e.current}const hF=typeof window<"u",_w=hF?g.useLayoutEffect:g.useEffect,Om=g.createContext(null);function ww(t,e){t.indexOf(e)===-1&&t.push(e)}function J0(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Ri=(t,e,n)=>n>e?e:n<t?t:n;let Lm=()=>{};const va={},E5=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),k5=t=>typeof t=="object"&&t!==null,C5=t=>/^0[^.\s]+$/u.test(t);function P5(t){let e;return()=>(e===void 0&&(e=t()),e)}const Ms=t=>t,Xf=(...t)=>t.reduce((e,n)=>r=>n(e(r))),_f=(t,e,n)=>{const r=e-t;return r?(n-t)/r:1};class xw{constructor(){this.subscriptions=[]}add(e){return ww(this.subscriptions,e),()=>J0(this.subscriptions,e)}notify(e,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const cs=t=>t*1e3,Ts=t=>t/1e3,T5=(t,e)=>e?t*(1e3/e):0,I5=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,pF=1e-7,mF=12;function gF(t,e,n,r,s){let i,o,l=0;do o=e+(n-e)/2,i=I5(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>pF&&++l<mF);return o}function Qf(t,e,n,r){if(t===e&&n===r)return Ms;const s=i=>gF(i,0,1,t,n);return i=>i===0||i===1?i:I5(s(i),e,r)}const A5=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,R5=t=>e=>1-t(1-e),M5=Qf(.33,1.53,.69,.99),bw=R5(M5),O5=A5(bw),L5=t=>t>=1?1:(t*=2)<1?.5*bw(t):.5*(2-Math.pow(2,-10*(t-1))),Sw=t=>1-Math.sin(Math.acos(t)),D5=R5(Sw),N5=A5(Sw),vF=Qf(.42,0,1,1),yF=Qf(0,0,.58,1),$5=Qf(.42,0,.58,1),_F=t=>Array.isArray(t)&&typeof t[0]!="number",j5=t=>Array.isArray(t)&&typeof t[0]=="number",wF={linear:Ms,easeIn:vF,easeInOut:$5,easeOut:yF,circIn:Sw,circInOut:N5,circOut:D5,backIn:bw,backInOut:O5,backOut:M5,anticipate:L5},xF=t=>typeof t=="string",w8=t=>{if(j5(t)){Lm(t.length===4);const[e,n,r,s]=t;return Qf(e,n,r,s)}else if(xF(t))return wF[t];return t},Ap=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function bF(t){let e=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(d){i.has(d)&&(u.schedule(d),t()),d(o)}const u={schedule:(d,h=!1,p=!1)=>{const v=p&&r?e:n;return h&&i.add(d),v.add(d),d},cancel:d=>{n.delete(d),i.delete(d)},process:d=>{if(o=d,r){s=!0;return}r=!0;const h=e;e=n,n=h,e.forEach(l),e.clear(),r=!1,s&&(s=!1,u.process(d))}};return u}const SF=40;function F5(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=Ap.reduce((C,T)=>(C[T]=bF(i),C),{}),{setup:l,read:u,resolveKeyframes:d,preUpdate:h,update:p,preRender:m,render:v,postRender:w}=o,_=()=>{const C=va.useManualTiming,T=C?s.timestamp:performance.now();n=!1,C||(s.delta=r?1e3/60:Math.max(Math.min(T-s.timestamp,SF),1)),s.timestamp=T,s.isProcessing=!0,l.process(s),u.process(s),d.process(s),h.process(s),p.process(s),m.process(s),v.process(s),w.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(_))},x=()=>{n=!0,r=!0,s.isProcessing||t(_)};return{schedule:Ap.reduce((C,T)=>{const I=o[T];return C[T]=(M,R=!1,A=!1)=>(n||x(),I.schedule(M,R,A)),C},{}),cancel:C=>{for(let T=0;T<Ap.length;T++)o[Ap[T]].cancel(C)},state:s,steps:o}}const{schedule:$t,cancel:ya,state:er,steps:I1}=F5(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ms,!0);let l0;function EF(){l0=void 0}const br={now:()=>(l0===void 0&&br.set(er.isProcessing||va.useManualTiming?er.timestamp:performance.now()),l0),set:t=>{l0=t,queueMicrotask(EF)}},V5=t=>e=>typeof e=="string"&&e.startsWith(t),H5=V5("--"),kF=V5("var(--"),Ew=t=>kF(t)?CF.test(t.split("/*")[0].trim()):!1,CF=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function x8(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Tu={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},wf={...Tu,transform:t=>Ri(0,1,t)},Rp={...Tu,default:1},Qd=t=>Math.round(t*1e5)/1e5,kw=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function PF(t){return t==null}const TF=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Cw=(t,e)=>n=>!!(typeof n=="string"&&TF.test(n)&&n.startsWith(t)||e&&!PF(n)&&Object.prototype.hasOwnProperty.call(n,e)),z5=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,l]=r.match(kw);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},IF=t=>Ri(0,255,t),A1={...Tu,transform:t=>Math.round(IF(t))},vl={test:Cw("rgb","red"),parse:z5("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+A1.transform(t)+", "+A1.transform(e)+", "+A1.transform(n)+", "+Qd(wf.transform(r))+")"};function AF(t){let e="",n="",r="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const S_={test:Cw("#"),parse:AF,transform:vl.transform},Jf=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),to=Jf("deg"),Ii=Jf("%"),$e=Jf("px"),RF=Jf("vh"),MF=Jf("vw"),b8={...Ii,parse:t=>Ii.parse(t)/100,transform:t=>Ii.transform(t*100)},$c={test:Cw("hsl","hue"),parse:z5("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Ii.transform(Qd(e))+", "+Ii.transform(Qd(n))+", "+Qd(wf.transform(r))+")"},Pn={test:t=>vl.test(t)||S_.test(t)||$c.test(t),parse:t=>vl.test(t)?vl.parse(t):$c.test(t)?$c.parse(t):S_.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?vl.transform(t):$c.transform(t),getAnimatableNone:t=>{const e=Pn.parse(t);return e.alpha=0,Pn.transform(e)}},OF=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function LF(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(kw))==null?void 0:e.length)||0)+(((n=t.match(OF))==null?void 0:n.length)||0)>0}const B5="number",U5="color",DF="var",NF="var(",S8="${}",$F=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function vu(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=e.replace($F,u=>(Pn.test(u)?(r.color.push(i),s.push(U5),n.push(Pn.parse(u))):u.startsWith(NF)?(r.var.push(i),s.push(DF),n.push(u)):(r.number.push(i),s.push(B5),n.push(parseFloat(u))),++i,S8)).split(S8);return{values:n,split:l,indexes:r,types:s}}function jF(t){return vu(t).values}function W5({split:t,types:e}){const n=t.length;return r=>{let s="";for(let i=0;i<n;i++)if(s+=t[i],r[i]!==void 0){const o=e[i];o===B5?s+=Qd(r[i]):o===U5?s+=Pn.transform(r[i]):s+=r[i]}return s}}function FF(t){return W5(vu(t))}const VF=t=>typeof t=="number"?0:Pn.test(t)?Pn.getAnimatableNone(t):t,HF=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:VF(t);function zF(t){const e=vu(t);return W5(e)(e.values.map((r,s)=>HF(r,e.split[s])))}const ti={test:LF,parse:jF,createTransformer:FF,getAnimatableNone:zF};function R1(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function BF({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,i=0,o=0;if(!e)s=i=o=n;else{const l=n<.5?n*(1+e):n+e-n*e,u=2*n-l;s=R1(u,l,t+1/3),i=R1(u,l,t),o=R1(u,l,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function em(t,e){return n=>n>0?e:t}const Nt=(t,e,n)=>t+(e-t)*n,M1=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},UF=[S_,vl,$c],WF=t=>UF.find(e=>e.test(t));function E8(t){const e=WF(t);if(!e)return!1;let n=e.parse(t);return e===$c&&(n=BF(n)),n}const k8=(t,e)=>{const n=E8(t),r=E8(e);if(!n||!r)return em(t,e);const s={...n};return i=>(s.red=M1(n.red,r.red,i),s.green=M1(n.green,r.green,i),s.blue=M1(n.blue,r.blue,i),s.alpha=Nt(n.alpha,r.alpha,i),vl.transform(s))},E_=new Set(["none","hidden"]);function ZF(t,e){return E_.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function qF(t,e){return n=>Nt(t,e,n)}function Pw(t){return typeof t=="number"?qF:typeof t=="string"?Ew(t)?em:Pn.test(t)?k8:YF:Array.isArray(t)?Z5:typeof t=="object"?Pn.test(t)?k8:GF:em}function Z5(t,e){const n=[...t],r=n.length,s=t.map((i,o)=>Pw(i)(i,e[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function GF(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=Pw(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function KF(t,e){const n=[],r={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const i=e.types[s],o=t.indexes[i][r[i]],l=t.values[o]??0;n[s]=l,r[i]++}return n}const YF=(t,e)=>{const n=ti.createTransformer(e),r=vu(t),s=vu(e);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?E_.has(t)&&!s.values.length||E_.has(e)&&!r.values.length?ZF(t,e):Xf(Z5(KF(r,s),s.values),n):em(t,e)};function q5(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Nt(t,e,n):Pw(t)(t,e)}const XF=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>$t.update(e,n),stop:()=>ya(e),now:()=>er.isProcessing?er.timestamp:br.now()}},G5=(t,e,n=10)=>{let r="";const s=Math.max(Math.round(e/n),2);for(let i=0;i<s;i++)r+=Math.round(t(i/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},tm=2e4;function Tw(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<tm;)e+=n,r=t.next(e);return e>=tm?1/0:e}function QF(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(Tw(r),tm);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:Ts(s)}}const dn={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function k_(t,e){return t*Math.sqrt(1-e*e)}const JF=12;function eV(t,e,n){let r=n;for(let s=1;s<JF;s++)r=r-t(r)/e(r);return r}const O1=.001;function tV({duration:t=dn.duration,bounce:e=dn.bounce,velocity:n=dn.velocity,mass:r=dn.mass}){let s,i,o=1-e;o=Ri(dn.minDamping,dn.maxDamping,o),t=Ri(dn.minDuration,dn.maxDuration,Ts(t)),o<1?(s=d=>{const h=d*o,p=h*t,m=h-n,v=k_(d,o),w=Math.exp(-p);return O1-m/v*w},i=d=>{const p=d*o*t,m=p*n+n,v=Math.pow(o,2)*Math.pow(d,2)*t,w=Math.exp(-p),_=k_(Math.pow(d,2),o);return(-s(d)+O1>0?-1:1)*((m-v)*w)/_}):(s=d=>{const h=Math.exp(-d*t),p=(d-n)*t+1;return-O1+h*p},i=d=>{const h=Math.exp(-d*t),p=(n-d)*(t*t);return h*p});const l=5/t,u=eV(s,i,l);if(t=cs(t),isNaN(u))return{stiffness:dn.stiffness,damping:dn.damping,duration:t};{const d=Math.pow(u,2)*r;return{stiffness:d,damping:o*2*Math.sqrt(r*d),duration:t}}}const nV=["duration","bounce"],rV=["stiffness","damping","mass"];function C8(t,e){return e.some(n=>t[n]!==void 0)}function sV(t){let e={velocity:dn.velocity,stiffness:dn.stiffness,damping:dn.damping,mass:dn.mass,isResolvedFromDuration:!1,...t};if(!C8(t,rV)&&C8(t,nV))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Ri(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:dn.mass,stiffness:s,damping:i}}else{const n=tV({...t,velocity:0});e={...e,...n,mass:dn.mass},e.isResolvedFromDuration=!0}return e}function nm(t=dn.visualDuration,e=dn.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:i},{stiffness:u,damping:d,mass:h,duration:p,velocity:m,isResolvedFromDuration:v}=sV({...n,velocity:-Ts(n.velocity||0)}),w=m||0,_=d/(2*Math.sqrt(u*h)),x=o-i,b=Ts(Math.sqrt(u/h)),k=Math.abs(x)<5;r||(r=k?dn.restSpeed.granular:dn.restSpeed.default),s||(s=k?dn.restDelta.granular:dn.restDelta.default);let C,T,I,M,R,A;if(_<1)I=k_(b,_),M=(w+_*b*x)/I,C=N=>{const F=Math.exp(-_*b*N);return o-F*(M*Math.sin(I*N)+x*Math.cos(I*N))},R=_*b*M+x*I,A=_*b*x-M*I,T=N=>Math.exp(-_*b*N)*(R*Math.sin(I*N)+A*Math.cos(I*N));else if(_===1){C=F=>o-Math.exp(-b*F)*(x+(w+b*x)*F);const N=w+b*x;T=F=>Math.exp(-b*F)*(b*N*F-w)}else{const N=b*Math.sqrt(_*_-1);C=q=>{const Z=Math.exp(-_*b*q),W=Math.min(N*q,300);return o-Z*((w+_*b*x)*Math.sinh(W)+N*x*Math.cosh(W))/N};const F=(w+_*b*x)/N,j=_*b*F-x*N,Q=_*b*x-F*N;T=q=>{const Z=Math.exp(-_*b*q),W=Math.min(N*q,300);return Z*(j*Math.sinh(W)+Q*Math.cosh(W))}}const L={calculatedDuration:v&&p||null,velocity:N=>cs(T(N)),next:N=>{if(!v&&_<1){const j=Math.exp(-_*b*N),Q=Math.sin(I*N),q=Math.cos(I*N),Z=o-j*(M*Q+x*q),W=cs(j*(R*Q+A*q));return l.done=Math.abs(W)<=r&&Math.abs(o-Z)<=s,l.value=l.done?o:Z,l}const F=C(N);if(v)l.done=N>=p;else{const j=cs(T(N));l.done=Math.abs(j)<=r&&Math.abs(o-F)<=s}return l.value=l.done?o:F,l},toString:()=>{const N=Math.min(Tw(L),tm),F=G5(j=>L.next(N*j).value,N,30);return N+"ms "+F},toTransition:()=>{}};return L}nm.applyToOptions=t=>{const e=QF(t,100,nm);return t.ease=e.ease,t.duration=cs(e.duration),t.type="keyframes",t};const iV=5;function K5(t,e,n){const r=Math.max(e-iV,0);return T5(n-t(r),e-r)}function C_({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:l,max:u,restDelta:d=.5,restSpeed:h}){const p=t[0],m={done:!1,value:p},v=A=>l!==void 0&&A<l||u!==void 0&&A>u,w=A=>l===void 0?u:u===void 0||Math.abs(l-A)<Math.abs(u-A)?l:u;let _=n*e;const x=p+_,b=o===void 0?x:o(x);b!==x&&(_=b-p);const k=A=>-_*Math.exp(-A/r),C=A=>b+k(A),T=A=>{const L=k(A),N=C(A);m.done=Math.abs(L)<=d,m.value=m.done?b:N};let I,M;const R=A=>{v(m.value)&&(I=A,M=nm({keyframes:[m.value,w(m.value)],velocity:K5(C,A,m.value),damping:s,stiffness:i,restDelta:d,restSpeed:h}))};return R(0),{calculatedDuration:null,next:A=>{let L=!1;return!M&&I===void 0&&(L=!0,T(A),R(A)),I!==void 0&&A>=I?M.next(A-I):(!L&&T(A),m)}}}function oV(t,e,n){const r=[],s=n||va.mix||q5,i=t.length-1;for(let o=0;o<i;o++){let l=s(t[o],t[o+1]);if(e){const u=Array.isArray(e)?e[o]||Ms:e;l=Xf(u,l)}r.push(l)}return r}function aV(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(Lm(i===e.length),i===1)return()=>e[0];if(i===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const l=oV(e,r,s),u=l.length,d=h=>{if(o&&h<t[0])return e[0];let p=0;if(u>1)for(;p<t.length-2&&!(h<t[p+1]);p++);const m=_f(t[p],t[p+1],h);return l[p](m)};return n?h=>d(Ri(t[0],t[i-1],h)):d}function lV(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=_f(0,e,r);t.push(Nt(n,1,s))}}function cV(t){const e=[0];return lV(e,t.length-1),e}function uV(t,e){return t.map(n=>n*e)}function dV(t,e){return t.map(()=>e||$5).splice(0,t.length-1)}function Jd({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=_F(r)?r.map(w8):w8(r),i={done:!1,value:e[0]},o=uV(n&&n.length===e.length?n:cV(e),t),l=aV(o,e,{ease:Array.isArray(s)?s:dV(e,s)});return{calculatedDuration:t,next:u=>(i.value=l(u),i.done=u>=t,i)}}const fV=t=>t!==null;function Dm(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(fV),l=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!l||r===void 0?i[l]:r}const hV={decay:C_,inertia:C_,tween:Jd,keyframes:Jd,spring:nm};function Y5(t){typeof t.type=="string"&&(t.type=hV[t.type])}class Iw{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const pV=t=>t/100;class rm extends Iw{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==br.now()&&this.tick(br.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Y5(e);const{type:n=Jd,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=e;let{keyframes:l}=e;const u=n||Jd;u!==Jd&&typeof l[0]!="number"&&(this.mixKeyframes=Xf(pV,q5(l[0],l[1])),l=[0,100]);const d=u({...e,keyframes:l});i==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...l].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=Tw(d));const{calculatedDuration:h}=d;this.calculatedDuration=h,this.resolvedDuration=h+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=d}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:u}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:h,repeat:p,repeatType:m,repeatDelay:v,type:w,onUpdate:_,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const b=this.currentTime-d*(this.playbackSpeed>=0?1:-1),k=this.playbackSpeed>=0?b<0:b>s;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let C=this.currentTime,T=r;if(p){const A=Math.min(this.currentTime,s)/l;let L=Math.floor(A),N=A%1;!N&&A>=1&&(N=1),N===1&&L--,L=Math.min(L,p+1),!!(L%2)&&(m==="reverse"?(N=1-N,v&&(N-=v/l)):m==="mirror"&&(T=o)),C=Ri(0,1,N)*l}let I;k?(this.delayState.value=h[0],I=this.delayState):I=T.next(C),i&&!k&&(I.value=i(I.value));let{done:M}=I;!k&&u!==null&&(M=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return R&&w!==C_&&(I.value=Dm(h,this.options,x,this.speed)),_&&_(I.value),R&&this.finish(),I}then(e,n){return this.finished.then(e,n)}get duration(){return Ts(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Ts(e)}get time(){return Ts(this.currentTime)}set time(e){e=cs(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return K5(r=>this.generator.next(r).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(br.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=Ts(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=XF,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(br.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function mV(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const yl=t=>t*180/Math.PI,P_=t=>{const e=yl(Math.atan2(t[1],t[0]));return T_(e)},gV={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:P_,rotateZ:P_,skewX:t=>yl(Math.atan(t[1])),skewY:t=>yl(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},T_=t=>(t=t%360,t<0&&(t+=360),t),P8=P_,T8=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),I8=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),vV={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:T8,scaleY:I8,scale:t=>(T8(t)+I8(t))/2,rotateX:t=>T_(yl(Math.atan2(t[6],t[5]))),rotateY:t=>T_(yl(Math.atan2(-t[2],t[0]))),rotateZ:P8,rotate:P8,skewX:t=>yl(Math.atan(t[4])),skewY:t=>yl(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function I_(t){return t.includes("scale")?1:0}function A_(t,e){if(!t||t==="none")return I_(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=vV,s=n;else{const l=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=gV,s=l}if(!s)return I_(e);const i=r[e],o=s[1].split(",").map(_V);return typeof i=="function"?i(o):o[i]}const yV=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return A_(n,e)};function _V(t){return parseFloat(t.trim())}const Iu=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Au=new Set([...Iu,"pathRotation"]),A8=t=>t===Tu||t===$e,wV=new Set(["x","y","z"]),xV=Iu.filter(t=>!wV.has(t));function bV(t){const e=[];return xV.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const oa={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:r})=>{const s=t.max-t.min;return r==="border-box"?s:s-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:r})=>{const s=t.max-t.min;return r==="border-box"?s:s-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>A_(e,"x"),y:(t,{transform:e})=>A_(e,"y")};oa.translateX=oa.x;oa.translateY=oa.y;const Rl=new Set;let R_=!1,M_=!1,O_=!1;function X5(){if(M_){const t=Array.from(Rl).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=bV(r);s.length&&(n.set(r,s),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var l;(l=r.getValue(i))==null||l.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}M_=!1,R_=!1,Rl.forEach(t=>t.complete(O_)),Rl.clear()}function Q5(){Rl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(M_=!0)})}function SV(){O_=!0,Q5(),X5(),O_=!1}class Aw{constructor(e,n,r,s,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Rl.add(this),R_||(R_=!0,$t.read(Q5),$t.resolveKeyframes(X5))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:s}=this;if(e[0]===null){const i=s==null?void 0:s.get(),o=e[e.length-1];if(i!==void 0)e[0]=i;else if(r&&n){const l=r.readValue(n,o);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=o),s&&i===void 0&&s.set(e[0])}mV(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Rl.delete(this)}cancel(){this.state==="scheduled"&&(Rl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const EV=t=>t.startsWith("--");function J5(t,e,n){EV(e)?t.style.setProperty(e,n):t.style[e]=n}const kV={};function eT(t,e){const n=P5(t);return()=>kV[e]??n()}const CV=eT(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),tT=eT(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),$d=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,R8={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:$d([0,.65,.55,1]),circOut:$d([.55,0,1,.45]),backIn:$d([.31,.01,.66,-.59]),backOut:$d([.33,1.53,.69,.99])};function nT(t,e){if(t)return typeof t=="function"?tT()?G5(t,e):"ease-out":j5(t)?$d(t):Array.isArray(t)?t.map(n=>nT(n,e)||R8.easeOut):R8[t]}function PV(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:l="easeOut",times:u}={},d=void 0){const h={[e]:n};u&&(h.offset=u);const p=nT(l,s);Array.isArray(p)&&(h.easing=p);const m={delay:r,duration:s,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return d&&(m.pseudoElement=d),t.animate(h,m)}function rT(t){return typeof t=="function"&&"applyToOptions"in t}function TV({type:t,...e}){return rT(t)&&tT()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class sT extends Iw{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:l,onComplete:u}=e;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=e,Lm(typeof e.type!="string");const d=TV(e);this.animation=PV(n,r,s,d,i),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const h=Dm(s,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(h),J5(n,r,h),this.animation.cancel()}u==null||u(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return Ts(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Ts(e)}get time(){return Ts(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=cs(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:r,observe:s}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&CV()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Ms):s(this)}}const iT={anticipate:L5,backInOut:O5,circInOut:N5};function IV(t){return t in iT}function AV(t){typeof t.ease=="string"&&IV(t.ease)&&(t.ease=iT[t.ease])}const L1=10;class RV extends sT{constructor(e){AV(e),Y5(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const l=new rm({...o,autoplay:!1}),u=Math.max(L1,br.now()-this.startTime),d=Ri(0,L1,u-L1),h=l.sample(u).value,{name:p}=this.options;i&&p&&J5(i,p,h),n.setWithVelocity(l.sample(Math.max(0,u-d)).value,h,d),l.stop()}}const M8=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(ti.test(t)||t==="0")&&!t.startsWith("url("));function MV(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function OV(t,e,n,r){const s=t[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const i=t[t.length-1],o=M8(s,e),l=M8(i,e);return!o||!l?!1:MV(t)||(n==="spring"||rT(n))&&r}function L_(t){t.duration=0,t.type="keyframes"}const oT=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),LV=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function DV(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&LV.test(t[e]))return!0;return!1}const NV=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),$V=P5(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function jV(t){var p;const{motionValue:e,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:l}=t,u=(p=e==null?void 0:e.owner)==null?void 0:p.current;if(!(u instanceof HTMLElement)&&!(u instanceof SVGElement))return!1;const{onUpdate:d,transformTemplate:h}=e.owner.getProps();return $V()&&n&&(oT.has(n)||NV.has(n)&&DV(l))&&(n!=="transform"||!h)&&!d&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const FV=40;class VV extends Iw{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:l,name:u,motionValue:d,element:h,...p}){var w;super(),this.stop=()=>{var _,x;this._animation&&(this._animation.stop(),(_=this.stopTimeline)==null||_.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=br.now();const m={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:u,motionValue:d,element:h,...p},v=(h==null?void 0:h.KeyframeResolver)||Aw;this.keyframeResolver=new v(l,(_,x,b)=>this.onKeyframesResolved(_,x,m,!b),u,d,h),(w=this.keyframeResolver)==null||w.scheduleResolve()}onKeyframesResolved(e,n,r,s){var b,k;this.keyframeResolver=void 0;const{name:i,type:o,velocity:l,delay:u,isHandoff:d,onUpdate:h}=r;this.resolvedAt=br.now();let p=!0;OV(e,i,o,l)||(p=!1,(va.instantAnimations||!u)&&(h==null||h(Dm(e,r,n))),e[0]=e[e.length-1],L_(r),r.repeat=0);const v={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>FV?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},w=p&&!d&&jV(v),_=(k=(b=v.motionValue)==null?void 0:b.owner)==null?void 0:k.current;let x;if(w)try{x=new RV({...v,element:_})}catch{x=new rm(v)}else x=new rm(v);x.finished.then(()=>{this.notifyFinished()}).catch(Ms),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),SV()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function aT(t,e,n,r=0,s=1){const i=Array.from(t).sort((d,h)=>d.sortNodePosition(h)).indexOf(e),o=t.size,l=(o-1)*r;return typeof n=="function"?n(i,o):s===1?i*r:l-i*r}const O8=30,HV=t=>!isNaN(parseFloat(t));class zV{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=br.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=br.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=HV(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new xw);const r=this.events[e].add(n);return e==="change"?()=>{r(),$t.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=br.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>O8)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,O8);return T5(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function yu(t,e){return new zV(t,e)}function lT(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function Rw(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?lT(n,t):n}const BV={type:"spring",stiffness:500,damping:25,restSpeed:10},UV=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),WV={type:"keyframes",duration:.8},ZV={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},qV=(t,{keyframes:e})=>e.length>2?WV:Au.has(t)?t.startsWith("scale")?UV(e[1]):BV:ZV,GV=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function KV(t){for(const e in t)if(!GV.has(e))return!0;return!1}const Mw=(t,e,n,r={},s,i)=>o=>{const l=Rw(r,t)||{},u=l.delay||r.delay||0;let{elapsed:d=0}=r;d=d-cs(u);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-d,onUpdate:m=>{e.set(m),l.onUpdate&&l.onUpdate(m)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:i?void 0:s};KV(l)||Object.assign(h,qV(t,h)),h.duration&&(h.duration=cs(h.duration)),h.repeatDelay&&(h.repeatDelay=cs(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let p=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(L_(h),h.delay===0&&(p=!0)),(va.instantAnimations||va.skipAnimations||s!=null&&s.shouldSkipAnimations||l.skipAnimations)&&(p=!0,L_(h),h.delay=0),h.allowFlatten=!l.type&&!l.ease,p&&!i&&e.get()!==void 0){const m=Dm(h.keyframes,l);if(m!==void 0){$t.update(()=>{h.onUpdate(m),h.onComplete()});return}}return l.isSync?new rm(h):new VV(h)},YV=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function XV(t){const e=YV.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function cT(t,e,n=1){const[r,s]=XV(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const o=i.trim();return E5(o)?parseFloat(o):o}return Ew(s)?cT(s,e,n+1):s}function L8(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function Ow(t,e,n,r){if(typeof e=="function"){const[s,i]=L8(r);e=e(n!==void 0?n:t.custom,s,i)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,i]=L8(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function Ml(t,e,n){const r=t.getProps();return Ow(r,e,n!==void 0?n:r.custom,t)}const uT=new Set(["width","height","top","left","right","bottom",...Iu]),D_=t=>Array.isArray(t);function QV(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,yu(n))}function JV(t){return D_(t)?t[t.length-1]||0:t}function eH(t,e){const n=Ml(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const l=JV(i[o]);QV(t,o,l)}}const rr=t=>!!(t&&t.getVelocity);function tH(t){return!!(rr(t)&&t.add)}function N_(t,e){const n=t.getValue("willChange");if(tH(n))return n.add(e);if(!n&&va.WillChange){const r=new va.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function Lw(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const nH="framerAppearId",dT="data-"+Lw(nH);function fT(t){return t.props[dT]}function rH({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function hT(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...l}=e;const u=t.getDefaultTransition();i=i?lT(i,u):u;const d=i==null?void 0:i.reduceMotion,h=i==null?void 0:i.skipAnimations;r&&(i=r);const p=[],m=s&&t.animationState&&t.animationState.getState()[s],v=i==null?void 0:i.path;v&&v.animateVisualElement(t,l,i,n,p);for(const w in l){const _=t.getValue(w,t.latestValues[w]??null),x=l[w];if(x===void 0||m&&rH(m,w))continue;const b={delay:n,...Rw(i||{},w)};h&&(b.skipAnimations=!0);const k=_.get();if(k!==void 0&&!_.isAnimating()&&!Array.isArray(x)&&x===k&&!b.velocity){$t.update(()=>_.set(x));continue}let C=!1;if(window.MotionHandoffAnimation){const M=fT(t);if(M){const R=window.MotionHandoffAnimation(M,w,$t);R!==null&&(b.startTime=R,C=!0)}}N_(t,w);const T=d??t.shouldReduceMotion;_.start(Mw(w,_,x,T&&uT.has(w)?{type:!1}:b,t,C));const I=_.animation;I&&p.push(I)}if(o){const w=()=>$t.update(()=>{o&&eH(t,o)});p.length?Promise.all(p).then(w):w()}return p}function $_(t,e,n={}){var u;const r=Ml(t,e,n.type==="exit"?(u=t.presenceContext)==null?void 0:u.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(hT(t,r,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(d=0)=>{const{delayChildren:h=0,staggerChildren:p,staggerDirection:m}=s;return sH(t,e,d,h,p,m,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[d,h]=l==="beforeChildren"?[i,o]:[o,i];return d().then(()=>h())}else return Promise.all([i(),o(n.delay)])}function sH(t,e,n=0,r=0,s=0,i=1,o){const l=[];for(const u of t.variantChildren)u.notify("AnimationStart",e),l.push($_(u,e,{...o,delay:n+(typeof r=="function"?0:r)+aT(t.variantChildren,u,r,s,i)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(l)}function iH(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>$_(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=$_(t,e,n);else{const s=typeof e=="function"?Ml(t,e,n.custom):e;r=Promise.all(hT(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const oH={test:t=>t==="auto",parse:t=>t},pT=t=>e=>e.test(t),mT=[Tu,$e,Ii,to,MF,RF,oH],D8=t=>mT.find(pT(t));function aH(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||C5(t):!0}const lH=new Set(["brightness","contrast","saturate","opacity"]);function cH(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(kw)||[];if(!r)return t;const s=n.replace(r,"");let i=lH.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const uH=/\b([a-z-]*)\(.*?\)/gu,j_={...ti,getAnimatableNone:t=>{const e=t.match(uH);return e?e.map(cH).join(" "):t}},F_={...ti,getAnimatableNone:t=>{const e=ti.parse(t);return ti.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},N8={...Tu,transform:Math.round},dH={rotate:to,pathRotation:to,rotateX:to,rotateY:to,rotateZ:to,scale:Rp,scaleX:Rp,scaleY:Rp,scaleZ:Rp,skew:to,skewX:to,skewY:to,distance:$e,translateX:$e,translateY:$e,translateZ:$e,x:$e,y:$e,z:$e,perspective:$e,transformPerspective:$e,opacity:wf,originX:b8,originY:b8,originZ:$e},sm={borderWidth:$e,borderTopWidth:$e,borderRightWidth:$e,borderBottomWidth:$e,borderLeftWidth:$e,borderRadius:$e,borderTopLeftRadius:$e,borderTopRightRadius:$e,borderBottomRightRadius:$e,borderBottomLeftRadius:$e,width:$e,maxWidth:$e,height:$e,maxHeight:$e,top:$e,right:$e,bottom:$e,left:$e,inset:$e,insetBlock:$e,insetBlockStart:$e,insetBlockEnd:$e,insetInline:$e,insetInlineStart:$e,insetInlineEnd:$e,padding:$e,paddingTop:$e,paddingRight:$e,paddingBottom:$e,paddingLeft:$e,paddingBlock:$e,paddingBlockStart:$e,paddingBlockEnd:$e,paddingInline:$e,paddingInlineStart:$e,paddingInlineEnd:$e,margin:$e,marginTop:$e,marginRight:$e,marginBottom:$e,marginLeft:$e,marginBlock:$e,marginBlockStart:$e,marginBlockEnd:$e,marginInline:$e,marginInlineStart:$e,marginInlineEnd:$e,fontSize:$e,backgroundPositionX:$e,backgroundPositionY:$e,...dH,zIndex:N8,fillOpacity:wf,strokeOpacity:wf,numOctaves:N8},fH={...sm,color:Pn,backgroundColor:Pn,outlineColor:Pn,fill:Pn,stroke:Pn,borderColor:Pn,borderTopColor:Pn,borderRightColor:Pn,borderBottomColor:Pn,borderLeftColor:Pn,filter:j_,WebkitFilter:j_,mask:F_,WebkitMask:F_},gT=t=>fH[t],hH=new Set([j_,F_]);function vT(t,e){let n=gT(t);return hH.has(n)||(n=ti),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const pH=new Set(["auto","none","0"]);function mH(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!pH.has(i)&&vu(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=vT(n,s)}class gH extends Aw{constructor(e,n,r,s,i){super(e,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let h=0;h<e.length;h++){let p=e[h];if(typeof p=="string"&&(p=p.trim(),Ew(p))){const m=cT(p,n.current);m!==void 0&&(e[h]=m),h===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!uT.has(r)||e.length!==2)return;const[s,i]=e,o=D8(s),l=D8(i),u=x8(s),d=x8(i);if(u!==d&&oa[r]){this.needsMeasurement=!0;return}if(o!==l)if(A8(o)&&A8(l))for(let h=0;h<e.length;h++){const p=e[h];typeof p=="string"&&(e[h]=parseFloat(p))}else oa[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||aH(e[s]))&&r.push(s);r.length&&mH(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=oa[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&e.getValue(r,s).jump(s,!1)}measureEndState(){var l;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,o=r[i];r[i]=oa[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([u,d])=>{e.getValue(u).set(d)}),this.resolveNoneKeyframes()}}const Dw=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function yT(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const s=(n==null?void 0:n[t])??r.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(r=>r!=null)}const V_=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function c0(t){return k5(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Nw}=F5(queueMicrotask,!1),Ks={x:!1,y:!1};function _T(){return Ks.x||Ks.y}function vH(t){return t==="x"||t==="y"?Ks[t]?null:(Ks[t]=!0,()=>{Ks[t]=!1}):Ks.x||Ks.y?null:(Ks.x=Ks.y=!0,()=>{Ks.x=Ks.y=!1})}function wT(t,e){const n=yT(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function yH(t){return!(t.pointerType==="touch"||_T())}function _H(t,e,n={}){const[r,s,i]=wT(t,n);return r.forEach(o=>{let l=!1,u=!1,d;const h=()=>{o.removeEventListener("pointerleave",w)},p=x=>{d&&(d(x),d=void 0),h()},m=x=>{l=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),u&&(u=!1,p(x))},v=()=>{l=!0,window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",m,s)},w=x=>{if(x.pointerType!=="touch"){if(l){u=!0;return}p(x)}},_=x=>{if(!yH(x))return;u=!1;const b=e(o,x);typeof b=="function"&&(d=b,o.addEventListener("pointerleave",w,s))};o.addEventListener("pointerenter",_,s),o.addEventListener("pointerdown",v,s)}),i}const xT=(t,e)=>e?t===e?!0:xT(t,e.parentElement):!1,$w=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,wH=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function xH(t){return wH.has(t.tagName)||t.isContentEditable===!0}const bH=new Set(["INPUT","SELECT","TEXTAREA"]);function SH(t){return bH.has(t.tagName)||t.isContentEditable===!0}const u0=new WeakSet;function $8(t){return e=>{e.key==="Enter"&&t(e)}}function D1(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const EH=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=$8(()=>{if(u0.has(n))return;D1(n,"down");const s=$8(()=>{D1(n,"up")}),i=()=>D1(n,"cancel");n.addEventListener("keyup",s,e),n.addEventListener("blur",i,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function j8(t){return $w(t)&&!_T()}const F8=new WeakSet;function kH(t,e,n={}){const[r,s,i]=wT(t,n),o=l=>{const u=l.currentTarget;if(!j8(l)||F8.has(l))return;u0.add(u),n.stopPropagation&&F8.add(l);const d=e(u,l),h={...s,capture:!0},p=(w,_)=>{window.removeEventListener("pointerup",m,h),window.removeEventListener("pointercancel",v,h),u0.has(u)&&u0.delete(u),j8(w)&&typeof d=="function"&&d(w,{success:_})},m=w=>{p(w,u===window||u===document||n.useGlobalTarget||xT(u,w.target))},v=w=>{p(w,!1)};window.addEventListener("pointerup",m,h),window.addEventListener("pointercancel",v,h)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),c0(l)&&(l.addEventListener("focus",d=>EH(d,s)),!xH(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}function jw(t){return k5(t)&&"ownerSVGElement"in t}const d0=new WeakMap;let Go;const bT=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:jw(r)&&"getBBox"in r?r.getBBox()[e]:r[n],CH=bT("inline","width","offsetWidth"),PH=bT("block","height","offsetHeight");function TH({target:t,borderBoxSize:e}){var n;(n=d0.get(t))==null||n.forEach(r=>{r(t,{get width(){return CH(t,e)},get height(){return PH(t,e)}})})}function IH(t){t.forEach(TH)}function AH(){typeof ResizeObserver>"u"||(Go=new ResizeObserver(IH))}function RH(t,e){Go||AH();const n=yT(t);return n.forEach(r=>{let s=d0.get(r);s||(s=new Set,d0.set(r,s)),s.add(e),Go==null||Go.observe(r)}),()=>{n.forEach(r=>{const s=d0.get(r);s==null||s.delete(e),s!=null&&s.size||Go==null||Go.unobserve(r)})}}const f0=new Set;let jc;function MH(){jc=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};f0.forEach(e=>e(t))},window.addEventListener("resize",jc)}function OH(t){return f0.add(t),jc||MH(),()=>{f0.delete(t),!f0.size&&typeof jc=="function"&&(window.removeEventListener("resize",jc),jc=void 0)}}function V8(t,e){return typeof t=="function"?OH(t):RH(t,e)}function LH(t){return jw(t)&&t.tagName==="svg"}const DH=[...mT,Pn,ti],NH=t=>DH.find(pT(t)),H8=()=>({translate:0,scale:1,origin:0,originPoint:0}),Fc=()=>({x:H8(),y:H8()}),z8=()=>({min:0,max:0}),Dn=()=>({x:z8(),y:z8()}),$H=new WeakMap;function Nm(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function xf(t){return typeof t=="string"||Array.isArray(t)}const Fw=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Vw=["initial",...Fw];function $m(t){return Nm(t.animate)||Vw.some(e=>xf(t[e]))}function ST(t){return!!($m(t)||t.variants)}function jH(t,e,n){for(const r in e){const s=e[r],i=n[r];if(rr(s))t.addValue(r,s);else if(rr(i))t.addValue(r,yu(s,{owner:t}));else if(i!==s)if(t.hasValue(r)){const o=t.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=t.getStaticValue(r);t.addValue(r,yu(o!==void 0?o:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const im={current:null},Hw={current:!1},FH=typeof window<"u";function ET(){if(Hw.current=!0,!!FH)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>im.current=t.matches;t.addEventListener("change",e),e()}else im.current=!1}const B8=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let om={};function kT(t){om=t}function VH(){return om}class HH{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:o,visualState:l},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Aw,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const v=br.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,$t.render(this.render,!1,!0))};const{latestValues:d,renderState:h}=l;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=h,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=u,this.blockInitialAnimation=!!o,this.isControllingVariants=$m(n),this.isVariantNode=ST(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:p,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const v in m){const w=m[v];d[v]!==void 0&&rr(w)&&w.set(d[v])}}mount(e){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=e,$H.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,i)=>this.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Hw.current||ET(),this.shouldReduceMotion=im.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),ya(this.notifyUpdate),ya(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&oT.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:l,times:u,ease:d,duration:h}=n.accelerate,p=new sT({element:this.current,name:e,keyframes:l,times:u,ease:d,duration:cs(h)}),m=o(p);this.valueSubscriptions.set(e,()=>{m(),p.cancel()});return}const r=Au.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&$t.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{s(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in om){const n=om[e];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[e]&&s&&r(this.props)&&(this.features[e]=new s(this)),this.features[e]){const i=this.features[e];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Dn()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<B8.length;r++){const s=B8[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=e[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=jH(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=yu(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(E5(r)||C5(r))?r=parseFloat(r):!NH(r)&&ti.test(n)&&(r=vT(e,n)),this.setBaseTarget(e,rr(r)?r.get():r)),rr(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Ow(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(r=o[e])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!rr(s)?s:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new xw),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Nw.render(this.render)}}class CT extends HH{constructor(){super(...arguments),this.KeyframeResolver=gH}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const r=e.style;return r?r[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;rr(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ka{constructor(e){this.isMounted=!1,this.node=e}update(){}}function PT({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function zH({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function BH(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function N1(t){return t===void 0||t===1}function H_({scale:t,scaleX:e,scaleY:n}){return!N1(t)||!N1(e)||!N1(n)}function pl(t){return H_(t)||TT(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function TT(t){return U8(t.x)||U8(t.y)}function U8(t){return t&&t!=="0%"}function am(t,e,n){const r=t-n,s=e*r;return n+s}function W8(t,e,n,r,s){return s!==void 0&&(t=am(t,s,r)),am(t,n,r)+e}function z_(t,e=0,n=1,r,s){t.min=W8(t.min,e,n,r,s),t.max=W8(t.max,e,n,r,s)}function IT(t,{x:e,y:n}){z_(t.x,e.translate,e.scale,e.originPoint),z_(t.y,n.translate,n.scale,n.originPoint)}const Z8=.999999999999,q8=1.0000000000001;function UH(t,e,n,r=!1){var l;const s=n.length;if(!s)return;e.x=e.y=1;let i,o;for(let u=0;u<s;u++){i=n[u],o=i.projectionDelta;const{visualElement:d}=i.options;d&&d.props.style&&d.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(Si(t.x,-i.scroll.offset.x),Si(t.y,-i.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,IT(t,o)),r&&pl(i.latestValues)&&h0(t,i.latestValues,(l=i.layout)==null?void 0:l.layoutBox))}e.x<q8&&e.x>Z8&&(e.x=1),e.y<q8&&e.y>Z8&&(e.y=1)}function Si(t,e){t.min+=e,t.max+=e}function G8(t,e,n,r,s=.5){const i=Nt(t.min,t.max,s);z_(t,e,n,i,r)}function K8(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function h0(t,e,n){const r=n??t;G8(t.x,K8(e.x,r.x),e.scaleX,e.scale,e.originX),G8(t.y,K8(e.y,r.y),e.scaleY,e.scale,e.originY)}function AT(t,e){return PT(BH(t.getBoundingClientRect(),e))}function WH(t,e,n){const r=AT(t,n),{scroll:s}=e;return s&&(Si(r.x,s.offset.x),Si(r.y,s.offset.y)),r}const ZH={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},qH=Iu.length;function GH(t,e,n){let r="",s=!0;for(let o=0;o<qH;o++){const l=Iu[o],u=t[l];if(u===void 0)continue;let d=!0;if(typeof u=="number")d=u===(l.startsWith("scale")?1:0);else{const h=parseFloat(u);d=l.startsWith("scale")?h===1:h===0}if(!d||n){const h=V_(u,sm[l]);if(!d){s=!1;const p=ZH[l]||l;r+=`${p}(${h}) `}n&&(e[l]=h)}}const i=t.pathRotation;return i&&(s=!1,r+=`rotate(${V_(i,sm.pathRotation)}) `),r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function zw(t,e,n){const{style:r,vars:s,transformOrigin:i}=t;let o=!1,l=!1;for(const u in e){const d=e[u];if(Au.has(u)){o=!0;continue}else if(H5(u)){s[u]=d;continue}else{const h=V_(d,sm[u]);u.startsWith("origin")?(l=!0,i[u]=h):r[u]=h}}if(e.transform||(o||n?r.transform=GH(e,t.transform,n):r.transform&&(r.transform="none")),l){const{originX:u="50%",originY:d="50%",originZ:h=0}=i;r.transformOrigin=`${u} ${d} ${h}`}}function RT(t,{style:e,vars:n},r,s){const i=t.style;let o;for(o in e)i[o]=e[o];s==null||s.applyProjectionStyles(i,r);for(o in n)i.setProperty(o,n[o])}function Y8(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ad={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if($e.test(t))t=parseFloat(t);else return t;const n=Y8(t,e.target.x),r=Y8(t,e.target.y);return`${n}% ${r}%`}},KH={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=ti.parse(t);if(s.length>5)return r;const i=ti.createTransformer(t),o=typeof s[0]!="number"?1:0,l=n.x.scale*e.x,u=n.y.scale*e.y;s[0+o]/=l,s[1+o]/=u;const d=Nt(l,u,.5);return typeof s[2+o]=="number"&&(s[2+o]/=d),typeof s[3+o]=="number"&&(s[3+o]/=d),i(s)}},B_={borderRadius:{...Ad,applyTo:[...Dw]},borderTopLeftRadius:Ad,borderTopRightRadius:Ad,borderBottomLeftRadius:Ad,borderBottomRightRadius:Ad,boxShadow:KH};function MT(t,{layout:e,layoutId:n}){return Au.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!B_[t]||t==="opacity")}function Bw(t,e,n){var o;const r=t.style,s=e==null?void 0:e.style,i={};if(!r)return i;for(const l in r)(rr(r[l])||s&&rr(s[l])||MT(l,t)||((o=n==null?void 0:n.getValue(l))==null?void 0:o.liveStyle)!==void 0)&&(i[l]=r[l]);return i}function YH(t){return window.getComputedStyle(t)}class XH extends CT{constructor(){super(...arguments),this.type="html",this.renderInstance=RT}mount(e){Lm(!!e.style),super.mount(e)}readValueFromInstance(e,n){var r;if(Au.has(n))return(r=this.projection)!=null&&r.isProjecting?I_(n):yV(e,n);{const s=YH(e),i=(H5(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return AT(e,n)}build(e,n,r){zw(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return Bw(e,n,r)}}const QH={offset:"stroke-dashoffset",array:"stroke-dasharray"},JH={offset:"strokeDashoffset",array:"strokeDasharray"};function ez(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?QH:JH;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const tz=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function OT(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...l},u,d,h){if(zw(t,l,d),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:m}=t;p.transform&&(m.transform=p.transform,delete p.transform),(m.transform||p.transformOrigin)&&(m.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),m.transform&&(m.transformBox=(h==null?void 0:h.transformBox)??"fill-box",delete p.transformBox);for(const v of tz)p[v]!==void 0&&(m[v]=p[v],delete p[v]);e!==void 0&&(p.x=e),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),s!==void 0&&ez(p,s,i,o,!1)}const LT=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),DT=t=>typeof t=="string"&&t.toLowerCase()==="svg";function nz(t,e,n,r){RT(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(LT.has(s)?s:Lw(s),e.attrs[s])}function NT(t,e,n){const r=Bw(t,e,n);for(const s in t)if(rr(t[s])||rr(e[s])){const i=Iu.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class rz extends CT{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Dn}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Au.has(n)){const r=gT(n);return r&&r.default||0}return n=LT.has(n)?n:Lw(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return NT(e,n,r)}build(e,n,r){OT(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){nz(e,n,r,s)}mount(e){this.isSVGTag=DT(e.tagName),super.mount(e)}}const sz=Vw.length;function $T(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?$T(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<sz;n++){const r=Vw[n],s=t.props[r];(xf(s)||s===!1)&&(e[r]=s)}return e}function jT(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const iz=[...Fw].reverse(),oz=Fw.length;function az(t){return e=>Promise.all(e.map(({animation:n,options:r})=>iH(t,n,r)))}function lz(t){let e=az(t),n=X8(),r=!0,s=!1;const i=d=>(h,p)=>{var v;const m=Ml(t,p,d==="exit"?(v=t.presenceContext)==null?void 0:v.custom:void 0);if(m){const{transition:w,transitionEnd:_,...x}=m;h={...h,...x,..._}}return h};function o(d){e=d(t)}function l(d){const{props:h}=t,p=$T(t.parent)||{},m=[],v=new Set;let w={},_=1/0;for(let b=0;b<oz;b++){const k=iz[b],C=n[k],T=h[k]!==void 0?h[k]:p[k],I=xf(T),M=k===d?C.isActive:null;M===!1&&(_=b);let R=T===p[k]&&T!==h[k]&&I;if(R&&(r||s)&&t.manuallyAnimateOnMount&&(R=!1),C.protectedKeys={...w},!C.isActive&&M===null||!T&&!C.prevProp||Nm(T)||typeof T=="boolean")continue;if(k==="exit"&&C.isActive&&M!==!0){C.prevResolvedValues&&(w={...w,...C.prevResolvedValues});continue}const A=cz(C.prevProp,T);let L=A||k===d&&C.isActive&&!R&&I||b>_&&I,N=!1;const F=Array.isArray(T)?T:[T];let j=F.reduce(i(k),{});M===!1&&(j={});const{prevResolvedValues:Q={}}=C,q={...Q,...j},Z=V=>{L=!0,v.has(V)&&(N=!0,v.delete(V)),C.needsAnimating[V]=!0;const J=t.getValue(V);J&&(J.liveStyle=!1)};for(const V in q){const J=j[V],B=Q[V];if(w.hasOwnProperty(V))continue;let D=!1;D_(J)&&D_(B)?D=!jT(J,B)||A:D=J!==B,D?J!=null?Z(V):v.add(V):J!==void 0&&v.has(V)?Z(V):C.protectedKeys[V]=!0}C.prevProp=T,C.prevResolvedValues=j,C.isActive&&(w={...w,...j}),(r||s)&&t.blockInitialAnimation&&(L=!1);const W=R&&A;L&&(!W||N)&&m.push(...F.map(V=>{const J={type:k};if(typeof V=="string"&&(r||s)&&!W&&t.manuallyAnimateOnMount&&t.parent){const{parent:B}=t,D=Ml(B,V);if(B.enteringChildren&&D){const{delayChildren:X}=D.transition||{};J.delay=aT(B.enteringChildren,t,X)}}return{animation:V,options:J}}))}if(v.size){const b={};if(typeof h.initial!="boolean"){const k=Ml(t,Array.isArray(h.initial)?h.initial[0]:h.initial);k&&k.transition&&(b.transition=k.transition)}v.forEach(k=>{const C=t.getBaseTarget(k),T=t.getValue(k);T&&(T.liveStyle=!0),b[k]=C??null}),m.push({animation:b})}let x=!!m.length;return r&&(h.initial===!1||h.initial===h.animate)&&!t.manuallyAnimateOnMount&&(x=!1),r=!1,s=!1,x?e(m):Promise.resolve()}function u(d,h){var m;if(n[d].isActive===h)return Promise.resolve();(m=t.variantChildren)==null||m.forEach(v=>{var w;return(w=v.animationState)==null?void 0:w.setActive(d,h)}),n[d].isActive=h;const p=l(d);for(const v in n)n[v].protectedKeys={};return p}return{animateChanges:l,setActive:u,setAnimateFunction:o,getState:()=>n,reset:()=>{n=X8(),s=!0}}}function cz(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!jT(e,t):!1}function nl(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function X8(){return{animate:nl(!0),whileInView:nl(),whileHover:nl(),whileTap:nl(),whileDrag:nl(),whileFocus:nl(),exit:nl()}}function U_(t,e){t.min=e.min,t.max=e.max}function Zs(t,e){U_(t.x,e.x),U_(t.y,e.y)}function Q8(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const FT=1e-4,uz=1-FT,dz=1+FT,VT=.01,fz=0-VT,hz=0+VT;function Sr(t){return t.max-t.min}function pz(t,e,n){return Math.abs(t-e)<=n}function J8(t,e,n,r=.5){t.origin=r,t.originPoint=Nt(e.min,e.max,t.origin),t.scale=Sr(n)/Sr(e),t.translate=Nt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=uz&&t.scale<=dz||isNaN(t.scale))&&(t.scale=1),(t.translate>=fz&&t.translate<=hz||isNaN(t.translate))&&(t.translate=0)}function ef(t,e,n,r){J8(t.x,e.x,n.x,r?r.originX:void 0),J8(t.y,e.y,n.y,r?r.originY:void 0)}function eE(t,e,n,r=0){const s=r?Nt(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+Sr(e)}function mz(t,e,n,r){eE(t.x,e.x,n.x,r==null?void 0:r.x),eE(t.y,e.y,n.y,r==null?void 0:r.y)}function tE(t,e,n,r=0){const s=r?Nt(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+Sr(e)}function lm(t,e,n,r){tE(t.x,e.x,n.x,r==null?void 0:r.x),tE(t.y,e.y,n.y,r==null?void 0:r.y)}function nE(t,e,n,r,s){return t-=e,t=am(t,1/n,r),s!==void 0&&(t=am(t,1/s,r)),t}function gz(t,e=0,n=1,r=.5,s,i=t,o=t){if(Ii.test(e)&&(e=parseFloat(e),e=Nt(o.min,o.max,e/100)-o.min),typeof e!="number")return;let l=Nt(i.min,i.max,r);t===i&&(l-=e),t.min=nE(t.min,e,n,l,s),t.max=nE(t.max,e,n,l,s)}function rE(t,e,[n,r,s],i,o){gz(t,e[n],e[r],e[s],e.scale,i,o)}const vz=["x","scaleX","originX"],yz=["y","scaleY","originY"];function sE(t,e,n,r){rE(t.x,e,vz,n?n.x:void 0,r?r.x:void 0),rE(t.y,e,yz,n?n.y:void 0,r?r.y:void 0)}function iE(t){return t.translate===0&&t.scale===1}function HT(t){return iE(t.x)&&iE(t.y)}function oE(t,e){return t.min===e.min&&t.max===e.max}function _z(t,e){return oE(t.x,e.x)&&oE(t.y,e.y)}function aE(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function zT(t,e){return aE(t.x,e.x)&&aE(t.y,e.y)}function lE(t){return Sr(t.x)/Sr(t.y)}function cE(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function yi(t){return[t("x"),t("y")]}function wz(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:d,rotate:h,pathRotation:p,rotateX:m,rotateY:v,skewX:w,skewY:_}=n;d&&(r=`perspective(${d}px) ${r}`),h&&(r+=`rotate(${h}deg) `),p&&(r+=`rotate(${p}deg) `),m&&(r+=`rotateX(${m}deg) `),v&&(r+=`rotateY(${v}deg) `),w&&(r+=`skewX(${w}deg) `),_&&(r+=`skewY(${_}deg) `)}const l=t.x.scale*e.x,u=t.y.scale*e.y;return(l!==1||u!==1)&&(r+=`scale(${l}, ${u})`),r||"none"}const xz=Dw.length,uE=t=>typeof t=="string"?parseFloat(t):t,dE=t=>typeof t=="number"||$e.test(t);function bz(t,e,n,r,s,i){s?(t.opacity=Nt(0,n.opacity??1,Sz(r)),t.opacityExit=Nt(e.opacity??1,0,Ez(r))):i&&(t.opacity=Nt(e.opacity??1,n.opacity??1,r));for(let o=0;o<xz;o++){const l=Dw[o];let u=fE(e,l),d=fE(n,l);if(u===void 0&&d===void 0)continue;u||(u=0),d||(d=0),u===0||d===0||dE(u)===dE(d)?(t[l]=Math.max(Nt(uE(u),uE(d),r),0),(Ii.test(d)||Ii.test(u))&&(t[l]+="%")):t[l]=d}(e.rotate||n.rotate)&&(t.rotate=Nt(e.rotate||0,n.rotate||0,r))}function fE(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Sz=BT(0,.5,D5),Ez=BT(.5,.95,Ms);function BT(t,e,n){return r=>r<t?0:r>e?1:n(_f(t,e,r))}function kz(t,e,n){const r=rr(t)?t:yu(t);return r.start(Mw("",r,e,n)),r.animation}function bf(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}const Cz=(t,e)=>t.depth-e.depth;class Pz{constructor(){this.children=[],this.isDirty=!1}add(e){ww(this.children,e),this.isDirty=!0}remove(e){J0(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Cz),this.isDirty=!1,this.children.forEach(e)}}function Tz(t,e){const n=br.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(ya(r),t(i-e))};return $t.setup(r,!0),()=>ya(r)}function p0(t){return rr(t)?t.get():t}class Iz{constructor(){this.members=[]}add(e){ww(this.members,e);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===e||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(J0(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(J0(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let r=this.members.indexOf(e)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(e,n){var s;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:o}=e.options;(i===void 0||i!==o)&&(e.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(s=e.root)!=null&&s.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,r,s,i,o;(r=(n=e.options).onExitComplete)==null||r.call(n),(o=(s=e.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||o.call(i)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const m0={hasAnimatedSinceResize:!0,hasEverUpdated:!1},$1=["","X","Y","Z"],Az=1e3;let Rz=0;function j1(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function UT(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=fT(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",$t,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&UT(r)}function WT({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=e==null?void 0:e()){this.id=Rz++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Lz),this.nodes.forEach(Vz),this.nodes.forEach(Hz),this.nodes.forEach(Dz)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new Pz)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new xw),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const u=this.eventHandlers.get(o);u&&u.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=jw(o)&&!LH(o),this.instance=o;const{layoutId:l,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(u||l)&&(this.isLayoutDirty=!0),t){let h,p=0;const m=()=>this.root.updateBlockedByResize=!1;$t.read(()=>{p=window.innerWidth}),t(o,()=>{const v=window.innerWidth;v!==p&&(p=v,this.root.updateBlockedByResize=!0,h&&h(),h=Tz(m,250),m0.hasAnimatedSinceResize&&(m0.hasAnimatedSinceResize=!1,this.nodes.forEach(mE)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:p,hasRelativeLayoutChanged:m,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||d.getDefaultTransition()||Zz,{onLayoutAnimationStart:_,onLayoutAnimationComplete:x}=d.getProps(),b=!this.targetLayout||!zT(this.targetLayout,v),k=!p&&m;if(this.options.layoutRoot||this.resumeFrom||k||p&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const C={...Rw(w,"layout"),onPlay:_,onComplete:x};(d.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C),this.setAnimationOrigin(h,k,C.path)}else p||mE(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ya(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(zz),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&UT(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const p=this.path[h];p.shouldResetTransform=!0,(typeof p.latestValues.x=="string"||typeof p.latestValues.y=="string")&&(p.isLayoutDirty=!0),p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:l,layout:u}=this.options;if(l===void 0&&!u)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const u=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),u&&this.nodes.forEach($z),this.nodes.forEach(hE);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(pE);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(jz),this.nodes.forEach(Fz),this.nodes.forEach(Mz),this.nodes.forEach(Oz)):this.nodes.forEach(pE),this.clearAllSnapshots();const l=br.now();er.delta=Ri(0,1e3/60,l-er.timestamp),er.timestamp=l,er.isProcessing=!0,I1.update.process(er),I1.preRender.process(er),I1.render.process(er),er.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Nw.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Nz),this.sharedNodes.forEach(Bz)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,$t.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){$t.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Sr(this.snapshot.measuredBox.x)&&!Sr(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let u=0;u<this.path.length;u++)this.path[u].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Dn()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l&&this.instance){const u=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:u,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!HT(this.projectionDelta),u=this.getTransformTemplate(),d=u?u(this.latestValues,""):void 0,h=d!==this.prevTransformTemplateValue;o&&this.instance&&(l||pl(this.latestValues)||h)&&(s(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let u=this.removeElementScroll(l);return o&&(u=this.removeTransform(u)),qz(u),{animationId:this.root.animationId,measuredBox:l,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:o}=this.options;if(!o)return Dn();const l=o.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(Gz))){const{scroll:h}=this.root;h&&(Si(l.x,h.offset.x),Si(l.y,h.offset.y))}return l}removeElementScroll(o){var u;const l=Dn();if(Zs(l,o),(u=this.scroll)!=null&&u.wasRoot)return l;for(let d=0;d<this.path.length;d++){const h=this.path[d],{scroll:p,options:m}=h;h!==this.root&&p&&m.layoutScroll&&(p.wasRoot&&Zs(l,o),Si(l.x,p.offset.x),Si(l.y,p.offset.y))}return l}applyTransform(o,l=!1,u){var h,p;const d=u||Dn();Zs(d,o);for(let m=0;m<this.path.length;m++){const v=this.path[m];!l&&v.options.layoutScroll&&v.scroll&&v!==v.root&&(Si(d.x,-v.scroll.offset.x),Si(d.y,-v.scroll.offset.y)),pl(v.latestValues)&&h0(d,v.latestValues,(h=v.layout)==null?void 0:h.layoutBox)}return pl(this.latestValues)&&h0(d,this.latestValues,(p=this.layout)==null?void 0:p.layoutBox),d}removeTransform(o){var u;const l=Dn();Zs(l,o);for(let d=0;d<this.path.length;d++){const h=this.path[d];if(!pl(h.latestValues))continue;let p;h.instance&&(H_(h.latestValues)&&h.updateSnapshot(),p=Dn(),Zs(p,h.measurePageBox())),sE(l,h.latestValues,(u=h.snapshot)==null?void 0:u.layoutBox,p)}return pl(this.latestValues)&&sE(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==er.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var v;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:p}=this.options;if(!this.layout||!(h||p))return;this.resolvedRelativeTargetAt=er.timestamp;const m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Dn(),this.targetWithTransforms=Dn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),mz(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Zs(this.target,this.layout.layoutBox),IT(this.target,this.targetDelta)):Zs(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?this.createRelativeTarget(m,this.target,m.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||H_(this.parent.latestValues)||TT(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,l,u){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Dn(),this.relativeTargetOrigin=Dn(),lm(this.relativeTargetOrigin,l,u,this.options.layoutAnchor||void 0),Zs(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var w;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let u=!0;if((this.isProjectionDirty||(w=this.parent)!=null&&w.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===er.timestamp&&(u=!1),u)return;const{layout:d,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||h))return;Zs(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,m=this.treeScale.y;UH(this.layoutCorrected,this.treeScale,this.path,l),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Dn());const{target:v}=o;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Q8(this.prevProjectionDelta.x,this.projectionDelta.x),Q8(this.prevProjectionDelta.y,this.projectionDelta.y)),ef(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==m||!cE(this.projectionDelta.x,this.prevProjectionDelta.x)||!cE(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),o){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Fc(),this.projectionDelta=Fc(),this.projectionDeltaWithTransform=Fc()}setAnimationOrigin(o,l=!1,u){const d=this.snapshot,h=d?d.latestValues:{},p={...this.latestValues},m=Fc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const v=Dn(),w=d?d.source:void 0,_=this.layout?this.layout.source:void 0,x=w!==_,b=this.getStack(),k=!b||b.members.length<=1,C=!!(x&&!k&&this.options.crossfade===!0&&!this.path.some(Wz));this.animationProgress=0;let T;const I=u==null?void 0:u.interpolateProjection(o);this.mixTargetDelta=M=>{const R=M/1e3,A=I==null?void 0:I(R);A?(m.x.translate=A.x,m.x.scale=Nt(o.x.scale,1,R),m.x.origin=o.x.origin,m.x.originPoint=o.x.originPoint,m.y.translate=A.y,m.y.scale=Nt(o.y.scale,1,R),m.y.origin=o.y.origin,m.y.originPoint=o.y.originPoint):(gE(m.x,o.x,R),gE(m.y,o.y,R)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(lm(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Uz(this.relativeTarget,this.relativeTargetOrigin,v,R),T&&_z(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=Dn()),Zs(T,this.relativeTarget)),x&&(this.animationValues=p,bz(p,h,this.latestValues,R,C,k)),A&&A.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=A.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=R},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,u,d;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(d=(u=this.resumingFrom)==null?void 0:u.currentAnimation)==null||d.stop(),this.pendingAnimation&&(ya(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=$t.update(()=>{m0.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=yu(0)),this.motionValue.jump(0,!1),this.currentAnimation=kz(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:h=>{this.mixTargetDelta(h),o.onUpdate&&o.onUpdate(h)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Az),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:u,layout:d,latestValues:h}=o;if(!(!l||!u||!d)){if(this!==o&&this.layout&&d&&ZT(this.options.animationType,this.layout.layoutBox,d.layoutBox)){u=this.target||Dn();const p=Sr(this.layout.layoutBox.x);u.x.min=o.target.x.min,u.x.max=u.x.min+p;const m=Sr(this.layout.layoutBox.y);u.y.min=o.target.y.min,u.y.max=u.y.min+m}Zs(l,u),h0(l,h),ef(this.projectionDeltaWithTransform,this.layoutCorrected,l,h)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Iz),this.sharedNodes.get(o).add(l);const d=l.options.initialPromotionConfig;l.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var l;const{layoutId:o}=this.options;return o?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:o}=this.options;return o?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:u}={}){const d=this.getStack();d&&d.promote(this,u),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:u}=o;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(l=!0),!l)return;const d={};u.z&&j1("z",o,d,this.animationValues);for(let h=0;h<$1.length;h++)j1(`rotate${$1[h]}`,o,d,this.animationValues),j1(`skew${$1[h]}`,o,d,this.animationValues);o.render();for(const h in d)o.setStaticValue(h,d[h]),this.animationValues&&(this.animationValues[h]=d[h]);o.scheduleRender()}applyProjectionStyles(o,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=p0(l==null?void 0:l.pointerEvents)||"",o.transform=u?u(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=p0(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!pl(this.latestValues)&&(o.transform=u?u({},""):"none",this.hasProjected=!1);return}o.visibility="";const h=d.animationValues||d.latestValues;this.applyTransformsToTarget();let p=wz(this.projectionDeltaWithTransform,this.treeScale,h);u&&(p=u(h,p)),o.transform=p;const{x:m,y:v}=this.projectionDelta;o.transformOrigin=`${m.origin*100}% ${v.origin*100}% 0`,d.animationValues?o.opacity=d===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:o.opacity=d===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const w in B_){if(h[w]===void 0)continue;const{correct:_,applyTo:x,isCSSVariable:b}=B_[w],k=p==="none"?h[w]:_(h[w],d);if(x){const C=x.length;for(let T=0;T<C;T++)o[x[T]]=k}else b?this.options.visualElement.renderState.vars[w]=k:o[w]=k}this.options.layoutId&&(o.pointerEvents=d===this?p0(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(hE),this.root.sharedNodes.clear()}}}function Mz(t){t.updateLayout()}function Oz(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=t.layout,{animationType:i}=t.options,o=e.source!==t.layout.source;if(i==="size")yi(p=>{const m=o?e.measuredBox[p]:e.layoutBox[p],v=Sr(m);m.min=r[p].min,m.max=m.min+v});else if(i==="x"||i==="y"){const p=i==="x"?"y":"x";U_(o?e.measuredBox[p]:e.layoutBox[p],r[p])}else ZT(i,e.layoutBox,r)&&yi(p=>{const m=o?e.measuredBox[p]:e.layoutBox[p],v=Sr(r[p]);m.max=m.min+v,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[p].max=t.relativeTarget[p].min+v)});const l=Fc();ef(l,r,e.layoutBox);const u=Fc();o?ef(u,t.applyTransform(s,!0),e.measuredBox):ef(u,r,e.layoutBox);const d=!HT(l);let h=!1;if(!t.resumeFrom){const p=t.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:m,layout:v}=p;if(m&&v){const w=t.options.layoutAnchor||void 0,_=Dn();lm(_,e.layoutBox,m.layoutBox,w);const x=Dn();lm(x,r,v.layoutBox,w),zT(_,x)||(h=!0),p.options.layoutRoot&&(t.relativeTarget=x,t.relativeTargetOrigin=_,t.relativeParent=p)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:u,layoutDelta:l,hasLayoutChanged:d,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function Lz(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Dz(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Nz(t){t.clearSnapshot()}function hE(t){t.clearMeasurements()}function $z(t){t.isLayoutDirty=!0,t.updateLayout()}function pE(t){t.isLayoutDirty=!1}function jz(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function Fz(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function mE(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Vz(t){t.resolveTargetDelta()}function Hz(t){t.calcProjection()}function zz(t){t.resetSkewAndRotation()}function Bz(t){t.removeLeadSnapshot()}function gE(t,e,n){t.translate=Nt(e.translate,0,n),t.scale=Nt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function vE(t,e,n,r){t.min=Nt(e.min,n.min,r),t.max=Nt(e.max,n.max,r)}function Uz(t,e,n,r){vE(t.x,e.x,n.x,r),vE(t.y,e.y,n.y,r)}function Wz(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Zz={duration:.45,ease:[.4,0,.1,1]},yE=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),_E=yE("applewebkit/")&&!yE("chrome/")?Math.round:Ms;function wE(t){t.min=_E(t.min),t.max=_E(t.max)}function qz(t){wE(t.x),wE(t.y)}function ZT(t,e,n){return t==="position"||t==="preserve-aspect"&&!pz(lE(e),lE(n),.2)}function Gz(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const Kz=WT({attachResizeListener:(t,e)=>bf(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),F1={current:void 0},qT=WT({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!F1.current){const t=new Kz({});t.mount(window),t.setOptions({layoutScroll:!0}),F1.current=t}return F1.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Uw=g.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function xE(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Yz(...t){return e=>{let n=!1;const r=t.map(s=>{const i=xE(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():xE(t[s],null)}}}}function Xz(...t){return g.useCallback(Yz(...t),t)}class Qz extends g.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(c0(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=c0(r)&&r.offsetWidth||0,i=c0(r)&&r.offsetHeight||0,o=getComputedStyle(n),l=this.props.sizeRef.current;l.height=parseFloat(o.height),l.width=parseFloat(o.width),l.top=n.offsetTop,l.left=n.offsetLeft,l.right=s-l.width-l.left,l.bottom=i-l.height-l.top,l.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function Jz({children:t,isPresent:e,anchorX:n,anchorY:r,root:s,pop:i}){var m;const o=g.useId(),l=g.useRef(null),u=g.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:d}=g.useContext(Uw),h=i!==!1?((m=t.props)==null?void 0:m.ref)??(t==null?void 0:t.ref):void 0,p=Xz(l,h);return g.useInsertionEffect(()=>{const{width:v,height:w,top:_,left:x,right:b,bottom:k,direction:C}=u.current;if(e||i===!1||!l.current||!v||!w)return;const T=C==="rtl",I=n==="left"?T?`right: ${b}`:`left: ${x}`:T?`left: ${x}`:`right: ${b}`,M=r==="bottom"?`bottom: ${k}`:`top: ${_}`;l.current.dataset.motionPopId=o;const R=document.createElement("style");d&&(R.nonce=d);const A=s??document.head;return A.appendChild(R),R.sheet&&R.sheet.insertRule(`
64
+ [data-motion-pop-id="${o}"] {
65
+ position: absolute !important;
66
+ width: ${v}px !important;
67
+ height: ${w}px !important;
68
+ ${I}px !important;
69
+ ${M}px !important;
70
+ }
71
+ `),()=>{var L;(L=l.current)==null||L.removeAttribute("data-motion-pop-id"),A.contains(R)&&A.removeChild(R)}},[e]),S.jsx(Qz,{isPresent:e,childRef:l,sizeRef:u,pop:i,children:i===!1?t:g.cloneElement(t,{ref:p})})}const eB=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:l,anchorY:u,root:d})=>{const h=yw(tB),p=g.useId(),m=g.useRef(n),v=g.useRef(r);_w(()=>{m.current=n,v.current=r});let w=!0,_=g.useMemo(()=>(w=!1,{id:p,initial:e,isPresent:n,custom:s,onExitComplete:x=>{h.set(x,!0);for(const b of h.values())if(!b)return;r&&r()},register:x=>(h.set(x,!1),()=>{var b;h.delete(x),!m.current&&!h.size&&((b=v.current)==null||b.call(v))})}),[n,h,r]);return i&&w&&(_={..._}),g.useMemo(()=>{h.forEach((x,b)=>h.set(b,!1))},[n]),g.useEffect(()=>{!n&&!h.size&&r&&r()},[n]),t=S.jsx(Jz,{pop:o==="popLayout",isPresent:n,anchorX:l,anchorY:u,root:d,children:t}),S.jsx(Om.Provider,{value:_,children:t})};function tB(){return new Map}function GT(t=!0){const e=g.useContext(Om);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=e,i=g.useId();g.useEffect(()=>{if(t)return s(i)},[t]);const o=g.useCallback(()=>t&&r&&r(i),[i,r,t]);return!n&&r?[!1,o]:[!0]}const Mp=t=>t.key||"";function bE(t){const e=[];return g.Children.forEach(t,n=>{g.isValidElement(n)&&e.push(n)}),e}const us=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:l="left",anchorY:u="top",root:d})=>{const[h,p]=GT(o),m=g.useMemo(()=>bE(t),[t]),v=o&&!h?[]:m.map(Mp),w=g.useRef(!0),_=g.useRef(m),x=yw(()=>new Map),b=g.useRef(new Set),[k,C]=g.useState(m),[T,I]=g.useState(m);_w(()=>{w.current=!1,_.current=m;for(let A=0;A<T.length;A++){const L=Mp(T[A]);v.includes(L)?(x.delete(L),b.current.delete(L)):x.get(L)!==!0&&x.set(L,!1)}},[T,v.length,v.join("-")]);const M=[];if(m!==k){let A=[...m];for(let L=0;L<T.length;L++){const N=T[L],F=Mp(N);v.includes(F)||(A.splice(L,0,N),M.push(N))}return i==="wait"&&M.length&&(A=M),I(bE(A)),C(m),null}const{forceRender:R}=g.useContext(vw);return S.jsx(S.Fragment,{children:T.map(A=>{const L=Mp(A),N=o&&!h?!1:m===T||v.includes(L),F=()=>{if(b.current.has(L))return;if(x.has(L))b.current.add(L),x.set(L,!0);else return;let j=!0;x.forEach(Q=>{Q||(j=!1)}),j&&(R==null||R(),I(_.current),o&&(p==null||p()),r&&r())};return S.jsx(eB,{isPresent:N,initial:!w.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:d,onExitComplete:N?void 0:F,anchorX:l,anchorY:u,children:A},L)})})},KT=g.createContext({strict:!1}),SE={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let EE=!1;function nB(){if(EE)return;const t={};for(const e in SE)t[e]={isEnabled:n=>SE[e].some(r=>!!n[r])};kT(t),EE=!0}function YT(){return nB(),VH()}function rB(t){const e=YT();for(const n in t)e[n]={...e[n],...t[n]};kT(e)}const sB=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function cm(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||sB.has(t)}let XT=t=>!cm(t);function iB(t){typeof t=="function"&&(XT=e=>e.startsWith("on")?!cm(e):t(e))}try{iB(require("@emotion/is-prop-valid").default)}catch{}function oB(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||rr(t[s])||(XT(s)||n===!0&&cm(s)||!e&&!cm(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const jm=g.createContext({});function aB(t,e){if($m(t)){const{initial:n,animate:r}=t;return{initial:n===!1||xf(n)?n:void 0,animate:xf(r)?r:void 0}}return t.inherit!==!1?e:{}}function lB(t){const{initial:e,animate:n}=aB(t,g.useContext(jm));return g.useMemo(()=>({initial:e,animate:n}),[kE(e),kE(n)])}function kE(t){return Array.isArray(t)?t.join(" "):t}const Ww=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function QT(t,e,n){for(const r in e)!rr(e[r])&&!MT(r,n)&&(t[r]=e[r])}function cB({transformTemplate:t},e){return g.useMemo(()=>{const n=Ww();return zw(n,e,t),Object.assign({},n.vars,n.style)},[e])}function uB(t,e){const n=t.style||{},r={};return QT(r,n,t),Object.assign(r,cB(t,e)),r}function dB(t,e){const n={},r=uB(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const JT=()=>({...Ww(),attrs:{}});function fB(t,e,n,r){const s=g.useMemo(()=>{const i=JT();return OT(i,e,DT(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};QT(i,t.style,t),s.style={...i,...s.style}}return s}const hB=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Zw(t){return typeof t!="string"||t.includes("-")?!1:!!(hB.indexOf(t)>-1||/[A-Z]/u.test(t))}function pB(t,e,n,{latestValues:r},s,i=!1,o){const u=(o??Zw(t)?fB:dB)(e,r,s,t),d=oB(e,typeof t=="string",i),h=t!==g.Fragment?{...d,...u,ref:n}:{},{children:p}=e,m=g.useMemo(()=>rr(p)?p.get():p,[p]);return g.createElement(t,{...h,children:m})}function mB({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:gB(n,r,s,t),renderState:e()}}function gB(t,e,n,r){const s={},i=r(t,{});for(const m in i)s[m]=p0(i[m]);let{initial:o,animate:l}=t;const u=$m(t),d=ST(t);e&&d&&!u&&t.inherit!==!1&&(o===void 0&&(o=e.initial),l===void 0&&(l=e.animate));let h=n?n.initial===!1:!1;h=h||o===!1;const p=h?l:o;if(p&&typeof p!="boolean"&&!Nm(p)){const m=Array.isArray(p)?p:[p];for(let v=0;v<m.length;v++){const w=Ow(t,m[v]);if(w){const{transitionEnd:_,transition:x,...b}=w;for(const k in b){let C=b[k];if(Array.isArray(C)){const T=h?C.length-1:0;C=C[T]}C!==null&&(s[k]=C)}for(const k in _)s[k]=_[k]}}}return s}const eI=t=>(e,n)=>{const r=g.useContext(jm),s=g.useContext(Om),i=()=>mB(t,e,r,s);return n?i():yw(i)},vB=eI({scrapeMotionValuesFromProps:Bw,createRenderState:Ww}),yB=eI({scrapeMotionValuesFromProps:NT,createRenderState:JT}),_B=Symbol.for("motionComponentSymbol");function wB(t,e,n){const r=g.useRef(n);g.useInsertionEffect(()=>{r.current=n});const s=g.useRef(null);return g.useCallback(i=>{var l;i&&((l=t.onMount)==null||l.call(t,i)),e&&(i?e.mount(i):e.unmount());const o=r.current;if(typeof o=="function")if(i){const u=o(i);typeof u=="function"&&(s.current=u)}else s.current?(s.current(),s.current=null):o(i);else o&&(o.current=i)},[e])}const tI=g.createContext({});function Rc(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function xB(t,e,n,r,s,i){var C,T;const{visualElement:o}=g.useContext(jm),l=g.useContext(KT),u=g.useContext(Om),d=g.useContext(Uw),h=d.reducedMotion,p=d.skipAnimations,m=g.useRef(null),v=g.useRef(!1);r=r||l.renderer,!m.current&&r&&(m.current=r(t,{visualState:e,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:h,skipAnimations:p,isSVG:i}),v.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const w=m.current,_=g.useContext(tI);w&&!w.projection&&s&&(w.type==="html"||w.type==="svg")&&bB(m.current,n,s,_);const x=g.useRef(!1);g.useInsertionEffect(()=>{w&&x.current&&w.update(n,u)});const b=n[dT],k=g.useRef(!!b&&typeof window<"u"&&!((C=window.MotionHandoffIsComplete)!=null&&C.call(window,b))&&((T=window.MotionHasOptimisedAnimation)==null?void 0:T.call(window,b)));return _w(()=>{v.current=!0,w&&(x.current=!0,window.MotionIsMounted=!0,w.updateFeatures(),w.scheduleRenderMicrotask(),k.current&&w.animationState&&w.animationState.animateChanges())}),g.useEffect(()=>{w&&(!k.current&&w.animationState&&w.animationState.animateChanges(),k.current&&(queueMicrotask(()=>{var I;(I=window.MotionHandoffMarkAsComplete)==null||I.call(window,b)}),k.current=!1),w.enteringChildren=void 0)}),w}function bB(t,e,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:l,layoutScroll:u,layoutRoot:d,layoutAnchor:h,layoutCrossfade:p}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:nI(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||l&&Rc(l),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:u,layoutRoot:d,layoutAnchor:h})}function nI(t){if(t)return t.options.allowProjection!==!1?t.projection:nI(t.parent)}function V1(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&rB(r);const i=n?n==="svg":Zw(t),o=i?yB:vB;function l(d,h){let p;const m={...g.useContext(Uw),...d,layoutId:SB(d)},{isStatic:v}=m,w=lB(d),_=o(d,v);if(!v&&typeof window<"u"){EB();const x=kB(m);p=x.MeasureLayout,w.visualElement=xB(t,_,m,s,x.ProjectionNode,i)}return S.jsxs(jm.Provider,{value:w,children:[p&&w.visualElement?S.jsx(p,{visualElement:w.visualElement,...m}):null,pB(t,d,wB(_,w.visualElement,h),_,v,e,i)]})}l.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const u=g.forwardRef(l);return u[_B]=t,u}function SB({layoutId:t}){const e=g.useContext(vw).id;return e&&t!==void 0?e+"-"+t:t}function EB(t,e){g.useContext(KT).strict}function kB(t){const e=YT(),{drag:n,layout:r}=e;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(t)||r!=null&&r.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function CB(t,e){if(typeof Proxy>"u")return V1;const n=new Map,r=(i,o)=>V1(i,o,t,e),s=(i,o)=>r(i,o);return new Proxy(s,{get:(i,o)=>o==="create"?r:(n.has(o)||n.set(o,V1(o,void 0,t,e)),n.get(o))})}const PB=(t,e)=>e.isSVG??Zw(t)?new rz(e):new XH(e,{allowProjection:t!==g.Fragment});class TB extends ka{constructor(e){super(e),e.animationState||(e.animationState=lz(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Nm(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let IB=0;class AB extends ka{constructor(){super(...arguments),this.id=IB++,this.isExitComplete=!1}update(){var i;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;if(e&&r===!1){if(this.isExitComplete){const{initial:o,custom:l}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){const u=Ml(this.node,o,l);if(u){const{transition:d,transitionEnd:h,...p}=u;for(const m in p)(i=this.node.getValue(m))==null||i.jump(p[m])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!e);n&&!e&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const RB={animation:{Feature:TB},exit:{Feature:AB}};function eh(t){return{point:{x:t.pageX,y:t.pageY}}}const MB=t=>e=>$w(e)&&t(e,eh(e));function tf(t,e,n,r){return bf(t,e,MB(n),r)}const rI=({current:t})=>t?t.ownerDocument.defaultView:null,CE=(t,e)=>Math.abs(t-e);function OB(t,e){const n=CE(t.x,e.x),r=CE(t.y,e.y);return Math.sqrt(n**2+r**2)}const PE=new Set(["auto","scroll"]);class sI{constructor(e,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=w=>{this.handleScroll(w.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Op(this.lastRawMoveEventInfo,this.transformPagePoint));const w=H1(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,x=OB(w.offset,{x:0,y:0})>=this.distanceThreshold;if(!_&&!x)return;const{point:b}=w,{timestamp:k}=er;this.history.push({...b,timestamp:k});const{onStart:C,onMove:T}=this.handlers;_||(C&&C(this.lastMoveEvent,w),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,w)},this.handlePointerMove=(w,_)=>{this.lastMoveEvent=w,this.lastRawMoveEventInfo=_,this.lastMoveEventInfo=Op(_,this.transformPagePoint),$t.update(this.updatePoint,!0)},this.handlePointerUp=(w,_)=>{this.end();const{onEnd:x,onSessionEnd:b,resumeAnimation:k}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&k&&k(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const C=H1(w.type==="pointercancel"?this.lastMoveEventInfo:Op(_,this.transformPagePoint),this.history);this.startEvent&&x&&x(w,C),b&&b(w,C)},!$w(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const u=eh(e),d=Op(u,this.transformPagePoint),{point:h}=d,{timestamp:p}=er;this.history=[{...h,timestamp:p}];const{onSessionStart:m}=n;m&&m(e,H1(d,this.history));const v={passive:!0,capture:!0};this.removeListeners=Xf(tf(this.contextWindow,"pointermove",this.handlePointerMove,v),tf(this.contextWindow,"pointerup",this.handlePointerUp,v),tf(this.contextWindow,"pointercancel",this.handlePointerUp,v)),l&&this.startScrollTracking(l)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(PE.has(r.overflowX)||PE.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const r=e===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:s.x-n.x,y:s.y-n.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,s),$t.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ya(this.updatePoint)}}function Op(t,e){return e?{point:e(t.point)}:t}function TE(t,e){return{x:t.x-e.x,y:t.y-e.y}}function H1({point:t},e){return{point:t,delta:TE(t,iI(e)),offset:TE(t,LB(e)),velocity:DB(e,.1)}}function LB(t){return t[0]}function iI(t){return t[t.length-1]}function DB(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=iI(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>cs(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>cs(e)*2&&(r=t[1]);const i=Ts(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function NB(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?Nt(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?Nt(n,t,r.max):Math.min(t,n)),t}function IE(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function $B(t,{top:e,left:n,bottom:r,right:s}){return{x:IE(t.x,n,s),y:IE(t.y,e,r)}}function AE(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function jB(t,e){return{x:AE(t.x,e.x),y:AE(t.y,e.y)}}function FB(t,e){let n=.5;const r=Sr(t),s=Sr(e);return s>r?n=_f(e.min,e.max-r,t.min):r>s&&(n=_f(t.min,t.max-s,e.min)),Ri(0,1,n)}function VB(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const W_=.35;function HB(t=W_){return t===!1?t=0:t===!0&&(t=W_),{x:RE(t,"left","right"),y:RE(t,"top","bottom")}}function RE(t,e,n){return{min:ME(t,e),max:ME(t,n)}}function ME(t,e){return typeof t=="number"?t:t[e]||0}const zB=new WeakMap;class BB{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Dn(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=p=>{n&&this.snapToCursor(eh(p).point),this.stopAnimation()},o=(p,m)=>{const{drag:v,dragPropagation:w,onDragStart:_}=this.getProps();if(v&&!w&&(this.openDragLock&&this.openDragLock(),this.openDragLock=vH(v),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),yi(b=>{let k=this.getAxisMotionValue(b).get()||0;if(Ii.test(k)){const{projection:C}=this.visualElement;if(C&&C.layout){const T=C.layout.layoutBox[b];T&&(k=Sr(T)*(parseFloat(k)/100))}}this.originPoint[b]=k}),_&&$t.update(()=>_(p,m),!1,!0),N_(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},l=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m;const{dragPropagation:v,dragDirectionLock:w,onDirectionLock:_,onDrag:x}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:b}=m;if(w&&this.currentDirection===null){this.currentDirection=WB(b),this.currentDirection!==null&&_&&_(this.currentDirection);return}this.updateAxis("x",m.point,b),this.updateAxis("y",m.point,b),this.visualElement.render(),x&&$t.update(()=>x(p,m),!1,!0)},u=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m,this.stop(p,m),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new sI(e,{onSessionStart:i,onStart:o,onMove:l,onSessionEnd:u,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:r,contextWindow:rI(this.visualElement),element:this.visualElement.current})}stop(e,n){const r=e||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&$t.postRender(()=>l(r,s))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,r){const{drag:s}=this.getProps();if(!r||!Lp(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=NB(o,this.constraints[e],this.elastic[e])),i.set(o)}resolveConstraints(){var i;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;e&&Rc(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=$B(r.layoutBox,e):this.constraints=!1,this.elastic=HB(n),s!==this.constraints&&!Rc(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&yi(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=VB(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Rc(e))return!1;const r=e.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const i=WH(r,s.root,this.visualElement.getTransformPagePoint());let o=jB(s.layout.layoutBox,i);if(n){const l=n(zH(o));this.hasMutatedConstraints=!!l,l&&(o=PT(l))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),u=this.constraints||{},d=yi(h=>{if(!Lp(h,n,this.currentDirection))return;let p=u&&u[h]||{};(o===!0||o===h)&&(p={min:0,max:0});const m=s?200:1e6,v=s?40:1e7,w={type:"inertia",velocity:r?e[h]:0,bounceStiffness:m,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...i,...p};return this.startAxisValueAnimation(h,w)});return Promise.all(d).then(l)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return N_(this.visualElement,e),r.start(Mw(e,r,0,n,this.visualElement,!1))}stopAnimation(){yi(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps()[n];return s||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){yi(n=>{const{drag:r}=this.getProps();if(!Lp(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[n],u=i.get()||0;i.set(e[n]-Nt(o,l,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Rc(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};yi(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const u=l.get();s[o]=FB({min:u,max:u},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),yi(o=>{if(!Lp(o,e,null))return;const l=this.getAxisMotionValue(o),{min:u,max:d}=this.constraints[o];l.set(Nt(u,d,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;zB.set(this.visualElement,this);const e=this.visualElement.current,n=tf(e,"pointerdown",d=>{const{drag:h,dragListener:p=!0}=this.getProps(),m=d.target,v=m!==e&&SH(m);h&&p&&!v&&this.start(d)});let r;const s=()=>{const{dragConstraints:d}=this.getProps();Rc(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=UB(e,d.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),$t.read(s);const l=bf(window,"resize",()=>this.scalePositionWithinConstraints()),u=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:h})=>{this.isDragging&&h&&(yi(p=>{const m=this.getAxisMotionValue(p);m&&(this.originPoint[p]+=d[p].translate,m.set(m.get()+d[p].translate))}),this.visualElement.render())}));return()=>{l(),n(),o(),u&&u(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=W_,dragMomentum:l=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:l}}}function OE(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function UB(t,e,n){const r=V8(t,OE(n)),s=V8(e,OE(n));return()=>{r(),s()}}function Lp(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function WB(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class ZB extends ka{constructor(e){super(e),this.removeGroupControls=Ms,this.removeListeners=Ms,this.controls=new BB(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ms}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const z1=t=>(e,n)=>{t&&$t.update(()=>t(e,n),!1,!0)};class qB extends ka{constructor(){super(...arguments),this.removePointerDownListener=Ms}onPointerDown(e){this.session=new sI(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:rI(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:z1(e),onStart:z1(n),onMove:z1(r),onEnd:(i,o)=>{delete this.session,s&&$t.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=tf(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let B1=!1;class GB extends g.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=e;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),B1&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),m0.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),B1=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||$t.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),Nw.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;B1=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function oI(t){const[e,n]=GT(),r=g.useContext(vw);return S.jsx(GB,{...t,layoutGroup:r,switchLayoutGroup:g.useContext(tI),isPresent:e,safeToRemove:n})}const KB={pan:{Feature:qB},drag:{Feature:ZB,ProjectionNode:qT,MeasureLayout:oI}};function LE(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&$t.postRender(()=>i(e,eh(e)))}class YB extends ka{mount(){const{current:e}=this.node;e&&(this.unmount=_H(e,(n,r)=>(LE(this.node,r,"Start"),s=>LE(this.node,s,"End"))))}unmount(){}}class XB extends ka{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Xf(bf(this.node.current,"focus",()=>this.onFocus()),bf(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function DE(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&$t.postRender(()=>i(e,eh(e)))}class QB extends ka{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=kH(e,(s,i)=>(DE(this.node,i,"Start"),(o,{success:l})=>DE(this.node,o,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Z_=new WeakMap,U1=new WeakMap,JB=t=>{const e=Z_.get(t.target);e&&e(t)},eU=t=>{t.forEach(JB)};function tU({root:t,...e}){const n=t||document;U1.has(n)||U1.set(n,{});const r=U1.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(eU,{root:t,...e})),r[s]}function nU(t,e,n){const r=tU(e);return Z_.set(t,n),r.observe(t),()=>{Z_.delete(t),r.unobserve(t)}}const rU={some:0,all:1};class sU extends ka{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var u;(u=this.stopObserver)==null||u.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=e,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:rU[s]},l=d=>{const{isIntersecting:h}=d;if(this.isInView===h||(this.isInView=h,i&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:p,onViewportLeave:m}=this.node.getProps(),v=h?p:m;v&&v(d)};this.stopObserver=nU(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(iU(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function iU({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const oU={inView:{Feature:sU},tap:{Feature:QB},focus:{Feature:XB},hover:{Feature:YB}},aU={layout:{ProjectionNode:qT,MeasureLayout:oI}},lU={...RB,...oU,...KB,...aU},ho=CB(lU,PB);function cU(){!Hw.current&&ET();const[t]=g.useState(im.current);return t}const ni=ho;var th=v5();const uU=Pm(th);function dU(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const fU=t=>{switch(t){case"success":return mU;case"info":return vU;case"warning":return gU;case"error":return yU;default:return null}},hU=Array(12).fill(0),pU=({visible:t,className:e})=>we.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},we.createElement("div",{className:"sonner-spinner"},hU.map((n,r)=>we.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),mU=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},we.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),gU=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},we.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),vU=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},we.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),yU=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},we.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),_U=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},we.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),we.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),wU=()=>{const[t,e]=we.useState(document.hidden);return we.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),t};let xU=1;const bU=100,NE=t=>{var e;return typeof(t==null?void 0:t.id)=="number"||(t==null||(e=t.id)==null?void 0:e.length)>0?t.id:xU++};class SU{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(n=>e(n)),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-bU;e<=0||(this.toasts=this.toasts.filter(n=>e>0&&this.dismissedToasts.has(n.id)?(this.dismissedToasts.delete(n.id),e--,!1):!0))},this.create=e=>{const{message:n,...r}=e,s=NE(e),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const o=this.dismissedToasts.has(s),l=e.dismissible===void 0?!0:e.dismissible;return o&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(d=>d.id!==s)),(o?void 0:this.toasts.find(d=>d.id===s))?this.toasts=this.toasts.map(d=>d.id===s?(this.publish({...d,...e,id:s,title:n}),{...d,...e,id:s,dismissible:l,title:n}):d):this.addToast({title:n,...r,dismissible:l,id:s}),s},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);const n=this.pendingDismissals.get(e);return n!==void 0&&cancelAnimationFrame(n),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(r=>r({id:e,dismiss:!0}))})),e},this.message=(e,n)=>this.create({...n,message:e,type:void 0}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(e instanceof Function?e():e);let i=r!==void 0,o;const l=s.then(async d=>{if(o=["resolve",d],we.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(kU(d)&&!d.ok){i=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,m=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,w=typeof p=="object"&&!we.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,...w})}else if(d instanceof Error){i=!1;const p=typeof n.error=="function"?await n.error(d):n.error,m=typeof n.description=="function"?await n.description(d):n.description,w=typeof p=="object"&&!we.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,...w})}else if(n.success!==void 0){i=!1;const p=typeof n.success=="function"?await n.success(d):n.success,m=typeof n.description=="function"?await n.description(d):n.description,w=typeof p=="object"&&!we.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:m,...w})}}).catch(async d=>{if(o=["reject",d],n.error!==void 0){i=!1;const h=typeof n.error=="function"?await n.error(d):n.error,p=typeof n.description=="function"?await n.description(d):n.description,v=typeof h=="object"&&!we.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:p,...v})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((d,h)=>l.then(()=>o[0]==="reject"?h(o[1]):d(o[1])).catch(h));return typeof r!="string"&&typeof r!="number"?{unwrap:u}:Object.assign(r,{unwrap:u})},this.custom=(e,n)=>{const r=NE(n);return this.create({...n,jsx:e(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const Lr=new SU,EU=(t,e)=>Lr.message(t,e),kU=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",CU=EU,PU=()=>Lr.toasts,TU=()=>Lr.getActiveToasts(),xt=Object.assign(CU,{success:Lr.success,info:Lr.info,warning:Lr.warning,error:Lr.error,custom:Lr.custom,message:Lr.message,promise:Lr.promise,dismiss:Lr.dismiss,loading:Lr.loading},{getHistory:PU,getToasts:TU});dU("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Dp(t){return t.label!==void 0}const IU=3,AU="24px",RU="16px",$E=4e3,MU=356,OU=14,LU=45,DU=200;function fi(...t){return t.filter(Boolean).join(" ")}function NU(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const $U=t=>{var e,n,r,s,i,o,l,u,d;const{invert:h,toast:p,unstyled:m,interacting:v,setHeights:w,visibleToasts:_,heights:x,index:b,toasts:k,expanded:C,removeToast:T,defaultRichColors:I,closeButton:M,style:R,cancelButtonStyle:A,actionButtonStyle:L,className:N="",descriptionClassName:F="",duration:j,position:Q,gap:q,expandByDefault:Z,classNames:W,icons:Y,closeButtonAriaLabel:V="Close toast"}=t,[J,B]=we.useState(null),[D,X]=we.useState(null),[ce,se]=we.useState(!1),[re,de]=we.useState(!1),[ye,fe]=we.useState(!1),[oe,je]=we.useState(!1),[Ce,We]=we.useState(!1),[at,it]=we.useState(0),[Ot,ht]=we.useState(0),De=we.useRef(p.duration||j||$E),rt=we.useRef(null),Be=we.useRef(null),ct=b===0,Re=b+1<=_,Ze=p.type,xe=Ze??"default",St=p.dismissible!==!1,It=p.className||"",kr=p.descriptionClassName||"",Os=we.useMemo(()=>x.findIndex(Ue=>Ue.toastId===p.id)||0,[x,p.id]),wn=we.useMemo(()=>{var Ue;return(Ue=p.closeButton)!=null?Ue:M},[p.closeButton,M]),xn=we.useMemo(()=>p.duration||j||$E,[p.duration,j]),Ls=we.useRef(0),Fn=we.useRef(0),Cr=we.useRef(0),Zr=we.useRef(null),[So,Ma]=Q.split("-"),Ds=we.useMemo(()=>x.reduce((Ue,Qt,on)=>on>=Os?Ue:Ue+Qt.height,0),[x,Os]),$i=wU(),Gn=we.useMemo(()=>{var Ue;return(Ue=t.swipeDirections)!=null?Ue:NU(Q)},[t.swipeDirections,Q]),ji=p.invert||h,hr=Ze==="loading";Fn.current=we.useMemo(()=>Os*q+Ds,[Os,Ds]),we.useEffect(()=>{De.current=xn},[xn]),we.useEffect(()=>{se(!0)},[]),we.useEffect(()=>{const Ue=Be.current;if(Ue){const Qt=Ue.getBoundingClientRect().height;return ht(Qt),w(on=>[{toastId:p.id,height:Qt,position:p.position},...on]),()=>w(on=>on.filter(An=>An.toastId!==p.id))}},[w,p.id]),we.useLayoutEffect(()=>{if(!ce)return;const Ue=Be.current,Qt=Ue.style.height;Ue.style.height="auto";const on=Ue.getBoundingClientRect().height;Ue.style.height=Qt,ht(on),w(An=>An.find(vt=>vt.toastId===p.id)?An.map(vt=>vt.toastId===p.id?{...vt,height:on}:vt):[{toastId:p.id,height:on,position:p.position},...An])},[ce,p.title,p.description,w,p.id,p.jsx,p.action,p.cancel]);const pn=we.useCallback(()=>{de(!0),it(Fn.current),w(Ue=>Ue.filter(Qt=>Qt.toastId!==p.id)),setTimeout(()=>{T(p)},DU)},[p,T,w,Fn]);we.useEffect(()=>{if(p.promise&&Ze==="loading"||p.duration===1/0||p.type==="loading")return;let Ue;return C||v||$i?(()=>{if(Cr.current<Ls.current){const An=new Date().getTime()-Ls.current;De.current=De.current-An}Cr.current=new Date().getTime()})():(()=>{De.current!==1/0&&(Ls.current=new Date().getTime(),Ue=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),pn()},De.current))})(),()=>clearTimeout(Ue)},[C,v,p,Ze,$i,pn]),we.useEffect(()=>{p.delete&&(pn(),p.onDismiss==null||p.onDismiss.call(p,p))},[pn,p.delete]);function bn(){var Ue;if(Y!=null&&Y.loading){var Qt;return we.createElement("div",{className:fi(W==null?void 0:W.loader,p==null||(Qt=p.classNames)==null?void 0:Qt.loader,"sonner-loader"),"data-visible":Ze==="loading"},Y.loading)}return we.createElement(pU,{className:fi(W==null?void 0:W.loader,p==null||(Ue=p.classNames)==null?void 0:Ue.loader),visible:Ze==="loading"})}const qr=p.icon||(Y==null?void 0:Y[Ze])||fU(Ze);var Oa,La;return we.createElement("li",{tabIndex:0,ref:Be,className:fi(N,It,W==null?void 0:W.toast,p==null||(e=p.classNames)==null?void 0:e.toast,W==null?void 0:W[xe],p==null||(n=p.classNames)==null?void 0:n[xe]),"data-sonner-toast":"","data-rich-colors":(Oa=p.richColors)!=null?Oa:I,"data-styled":!(p.jsx||p.unstyled||m),"data-mounted":ce,"data-promise":!!p.promise,"data-swiped":Ce,"data-removed":re,"data-visible":Re,"data-y-position":So,"data-x-position":Ma,"data-index":b,"data-front":ct,"data-swiping":ye,"data-dismissible":St,"data-type":Ze,"data-invert":ji,"data-swipe-out":oe,"data-swipe-direction":D,"data-expanded":!!(C||Z&&ce),"data-testid":p.testId,style:{"--index":b,"--toasts-before":b,"--z-index":k.length-b,"--offset":`${re?at:Fn.current}px`,"--initial-height":Z?"auto":`${Ot}px`,...R,...p.style},onDragEnd:()=>{fe(!1),B(null),Zr.current=null},onPointerDown:Ue=>{Ue.button!==2&&(hr||!St||(rt.current=new Date,it(Fn.current),Ue.target.setPointerCapture(Ue.pointerId),Ue.target.tagName!=="BUTTON"&&(fe(!0),Zr.current={x:Ue.clientX,y:Ue.clientY})))},onPointerUp:()=>{var Ue,Qt,on;if(oe||!St)return;Zr.current=null;const An=Number(((Ue=Be.current)==null?void 0:Ue.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Gr=Number(((Qt=Be.current)==null?void 0:Qt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),vt=new Date().getTime()-((on=rt.current)==null?void 0:on.getTime()),an=J==="x"?An:Gr,Kn=Math.abs(an)/vt;if((J==="x"?Gn.includes(An>0?"right":"left"):Gn.includes(Gr>0?"bottom":"top"))&&(Math.abs(an)>=LU||Kn>.11)){it(Fn.current),p.onDismiss==null||p.onDismiss.call(p,p),X(J==="x"?An>0?"right":"left":Gr>0?"down":"up"),pn(),je(!0);return}else{var Sn,Kr;(Sn=Be.current)==null||Sn.style.setProperty("--swipe-amount-x","0px"),(Kr=Be.current)==null||Kr.style.setProperty("--swipe-amount-y","0px")}We(!1),fe(!1),B(null)},onPointerMove:Ue=>{var Qt,on,An;if(!Zr.current||!St||((Qt=window.getSelection())==null?void 0:Qt.toString().length)>0)return;const vt=Ue.clientY-Zr.current.y,an=Ue.clientX-Zr.current.x;!J&&(Math.abs(an)>1||Math.abs(vt)>1)&&B(Math.abs(an)>Math.abs(vt)?"x":"y");let Kn={x:0,y:0};const Pr=Sn=>1/(1.5+Math.abs(Sn)/20);if(J==="y"){if(Gn.includes("top")||Gn.includes("bottom"))if(Gn.includes("top")&&vt<0||Gn.includes("bottom")&&vt>0)Kn.y=vt;else{const Sn=vt*Pr(vt);Kn.y=Math.abs(Sn)<Math.abs(vt)?Sn:vt}}else if(J==="x"&&(Gn.includes("left")||Gn.includes("right")))if(Gn.includes("left")&&an<0||Gn.includes("right")&&an>0)Kn.x=an;else{const Sn=an*Pr(an);Kn.x=Math.abs(Sn)<Math.abs(an)?Sn:an}(Math.abs(Kn.x)>0||Math.abs(Kn.y)>0)&&We(!0),(on=Be.current)==null||on.style.setProperty("--swipe-amount-x",`${Kn.x}px`),(An=Be.current)==null||An.style.setProperty("--swipe-amount-y",`${Kn.y}px`)}},wn&&!p.jsx&&Ze!=="loading"?we.createElement("button",{"aria-label":V,"data-disabled":hr,"data-close-button":!0,onClick:hr||!St?()=>{}:()=>{pn(),p.onDismiss==null||p.onDismiss.call(p,p)},className:fi(W==null?void 0:W.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(La=Y==null?void 0:Y.close)!=null?La:_U):null,(Ze||p.icon||p.promise)&&p.icon!==null&&((Y==null?void 0:Y[Ze])!==null||p.icon)?we.createElement("div",{"data-icon":"",className:fi(W==null?void 0:W.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},Ze==="loading"?p.icon||bn():p.promise?bn():null,Ze!=="loading"?qr:null):null,we.createElement("div",{"data-content":"",className:fi(W==null?void 0:W.content,p==null||(i=p.classNames)==null?void 0:i.content)},we.createElement("div",{"data-title":"",className:fi(W==null?void 0:W.title,p==null||(o=p.classNames)==null?void 0:o.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?we.createElement("div",{"data-description":"",className:fi(F,kr,W==null?void 0:W.description,p==null||(l=p.classNames)==null?void 0:l.description)},typeof p.description=="function"?p.description():p.description):null),we.isValidElement(p.cancel)?p.cancel:p.cancel&&Dp(p.cancel)?we.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||A,onClick:Ue=>{Dp(p.cancel)&&St&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Ue),pn())},className:fi(W==null?void 0:W.cancelButton,p==null||(u=p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,we.isValidElement(p.action)?p.action:p.action&&Dp(p.action)?we.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||L,onClick:Ue=>{Dp(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Ue),!Ue.defaultPrevented&&pn())},className:fi(W==null?void 0:W.actionButton,p==null||(d=p.classNames)==null?void 0:d.actionButton)},p.action.label):null)};function jE(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function jU(t,e){const n={};return[t,e].forEach((r,s)=>{const i=s===1,o=i?"--mobile-offset":"--offset",l=i?RU:AU;function u(d){["top","right","bottom","left"].forEach(h=>{n[`${o}-${h}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${o}-${d}`]=l:n[`${o}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):u(l)}),n}const FU=we.forwardRef(function(e,n){const{id:r,invert:s,position:i="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:u,className:d,offset:h,mobileOffset:p,theme:m="light",richColors:v,duration:w,style:_,visibleToasts:x=IU,toastOptions:b,dir:k=jE(),gap:C=OU,icons:T,customAriaLabel:I,containerAriaLabel:M="Notifications"}=e,[R,A]=we.useState([]),L=we.useMemo(()=>r?R.filter(se=>se.toasterId===r):R.filter(se=>!se.toasterId),[R,r]),N=we.useMemo(()=>Array.from(new Set([i].concat(L.filter(se=>se.position).map(se=>se.position)))),[L,i]),[F,j]=we.useState([]),[Q,q]=we.useState(!1),[Z,W]=we.useState(!1),[Y,V]=we.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),J=we.useRef(null),B=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),D=we.useRef(null),X=we.useRef(!1),ce=we.useCallback(se=>{A(re=>{var de;return(de=re.find(ye=>ye.id===se.id))!=null&&de.delete||Lr.dismiss(se.id),re.filter(({id:ye})=>ye!==se.id)})},[]);return we.useEffect(()=>Lr.subscribe(se=>{if(se.dismiss){requestAnimationFrame(()=>{A(re=>re.map(de=>de.id===se.id?{...de,delete:!0}:de))});return}setTimeout(()=>{uU.flushSync(()=>{A(re=>{const de=re.findIndex(ye=>ye.id===se.id);return de!==-1?[...re.slice(0,de),{...re[de],...se},...re.slice(de+1)]:[se,...re]})})})}),[]),we.useEffect(()=>{if(m!=="system"){V(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?V("dark"):V("light")),typeof window>"u")return;const se=window.matchMedia("(prefers-color-scheme: dark)");try{se.addEventListener("change",({matches:re})=>{V(re?"dark":"light")})}catch{se.addListener(({matches:de})=>{try{V(de?"dark":"light")}catch(ye){console.error(ye)}})}},[m]),we.useEffect(()=>{R.length<=1&&q(!1)},[R]),we.useEffect(()=>{const se=re=>{var de;if(o.length>0&&o.every(oe=>re[oe]||re.code===oe)){var fe;q(!0),(fe=J.current)==null||fe.focus()}re.code==="Escape"&&(document.activeElement===J.current||(de=J.current)!=null&&de.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",se),()=>document.removeEventListener("keydown",se)},[o]),we.useEffect(()=>{if(J.current)return()=>{D.current&&(D.current.focus({preventScroll:!0}),D.current=null,X.current=!1)}},[J.current]),we.createElement("section",{ref:n,"aria-label":I??`${M} ${B}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},N.map((se,re)=>{var de;const[ye,fe]=se.split("-");return L.length?we.createElement("ol",{key:se,dir:k==="auto"?jE():k,tabIndex:-1,ref:J,className:d,"data-sonner-toaster":!0,"data-sonner-theme":Y,"data-y-position":ye,"data-x-position":fe,style:{"--front-toast-height":`${((de=F[0])==null?void 0:de.height)||0}px`,"--width":`${MU}px`,"--gap":`${C}px`,..._,...jU(h,p)},onBlur:oe=>{X.current&&!oe.currentTarget.contains(oe.relatedTarget)&&(X.current=!1,D.current&&(D.current.focus({preventScroll:!0}),D.current=null))},onFocus:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||X.current||(X.current=!0,D.current=oe.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{Z||q(!1)},onDragEnd:()=>q(!1),onPointerDown:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||W(!0)},onPointerUp:()=>W(!1)},L.filter(oe=>!oe.position&&re===0||oe.position===se).map((oe,je)=>{var Ce,We;return we.createElement($U,{key:oe.id,icons:T,index:je,toast:oe,defaultRichColors:v,duration:(Ce=b==null?void 0:b.duration)!=null?Ce:w,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:s,visibleToasts:x,closeButton:(We=b==null?void 0:b.closeButton)!=null?We:u,interacting:Z,position:se,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:ce,toasts:L.filter(at=>at.position==oe.position),heights:F.filter(at=>at.position==oe.position),setHeights:j,expandByDefault:l,gap:C,expanded:Q,swipeDirections:e.swipeDirections})})):null}))});var VU=Object.defineProperty,Ru=(t,e)=>VU(t,"name",{value:e,configurable:!0}),aI=!!(typeof window<"u"&&window.document&&window.document.createElement);function Ut(t,e,{checkForDefaultPrevented:n=!0}={}){return Ru(function(s){if(t==null||t(s),n===!1||!s||!s.defaultPrevented)return e==null?void 0:e(s)},"handleEvent")}Ru(Ut,"composeEventHandlers");function HU(t){var e;if(!aI)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}Ru(HU,"getOwnerWindow");function q_(t){if(!aI)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}Ru(q_,"getOwnerDocument");function lI(t,e=!1){const{activeElement:n}=q_(t);if(!(n!=null&&n.nodeName))return null;if(cI(n)&&n.contentDocument)return lI(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const s=q_(n).getElementById(r);if(s)return s}}return n}Ru(lI,"getActiveElement");function cI(t){return t.tagName==="IFRAME"}Ru(cI,"isFrame");var zU=Object.defineProperty,qw=(t,e)=>zU(t,"name",{value:e,configurable:!0});function G_(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}qw(G_,"setRef");function uI(...t){return e=>{let n=!1;const r=t.map(s=>{const i=G_(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():G_(t[s],null)}}}}qw(uI,"composeRefs");function Zt(...t){return g.useCallback(uI(...t),t)}qw(Zt,"useComposedRefs");var BU=Object.defineProperty,Ps=(t,e)=>BU(t,"name",{value:e,configurable:!0});function UU(t,e){const n=g.createContext(e);n.displayName=t+"Context";const r=Ps(i=>{const{children:o,...l}=i,u=g.useMemo(()=>l,Object.values(l));return S.jsx(n.Provider,{value:u,children:o})},"Provider");r.displayName=t+"Provider";function s(i,o={}){const{optional:l=!1}=o,u=g.useContext(n);if(u)return u;if(e!==void 0)return e;if(!l)throw new Error(`\`${i}\` must be used within \`${t}\``)}return Ps(s,"useContext"),[r,s]}Ps(UU,"createContext");function Di(t,e=[]){let n=[];function r(i,o){const l=g.createContext(o);l.displayName=i+"Context";const u=n.length;n=[...n,o];const d=Ps(p=>{var b;const{scope:m,children:v,...w}=p,_=((b=m==null?void 0:m[t])==null?void 0:b[u])||l,x=g.useMemo(()=>w,Object.values(w));return S.jsx(_.Provider,{value:x,children:v})},"Provider");d.displayName=i+"Provider";function h(p,m,v={}){var b;const{optional:w=!1}=v,_=((b=m==null?void 0:m[t])==null?void 0:b[u])||l,x=g.useContext(_);if(x)return x;if(o!==void 0)return o;if(!w)throw new Error(`\`${p}\` must be used within \`${i}\``)}return Ps(h,"useContext"),[d,h]}Ps(r,"createContext");const s=Ps(()=>{const i=n.map(o=>g.createContext(o));return Ps(function(l){const u=(l==null?void 0:l[t])||i;return g.useMemo(()=>({[`__scope${t}`]:{...l,[t]:u}}),[l,u])},"useScope")},"createScope");return s.scopeName=t,[r,dI(s,...e)]}Ps(Di,"createContextScope");function dI(...t){const e=t[0];if(t.length===1)return e;const n=Ps(()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return Ps(function(i){const o=r.reduce((l,{useScope:u,scopeName:d})=>{const p=u(i)[`__scope${d}`];return{...l,...p}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}Ps(dI,"composeContextScopes");var Fr=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},WU=Object.defineProperty,ZU=(t,e)=>WU(t,"name",{value:e,configurable:!0}),qU=Zf[" useId ".trim().toString()]||(()=>{}),GU=0;function da(t){const[e,n]=g.useState(qU());return Fr(()=>{t||n(r=>r??String(GU++))},[t]),t||(e?`radix-${e}`:"")}ZU(da,"useId");var KU=Object.defineProperty,YU=(t,e)=>KU(t,"name",{value:e,configurable:!0}),FE=Zf[" useEffectEvent ".trim().toString()],VE=Zf[" useInsertionEffect ".trim().toString()];function fI(t){if(typeof FE=="function")return FE(t);const e=g.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof VE=="function"?VE(()=>{e.current=t}):Fr(()=>{e.current=t}),g.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}YU(fI,"useEffectEvent");var XU=Object.defineProperty,nh=(t,e)=>XU(t,"name",{value:e,configurable:!0}),QU=Zf[" useInsertionEffect ".trim().toString()]||Fr;function Ca({prop:t,defaultProp:e,onChange:n=nh(()=>{},"onChange"),caller:r}){const[s,i,o]=hI({defaultProp:e,onChange:n}),l=t!==void 0,u=l?t:s,d=g.useCallback(h=>{var p;if(l){const m=pI(h)?h(t):h;m!==t&&((p=o.current)==null||p.call(o,m))}else i(h)},[l,t,i,o]);return[u,d]}nh(Ca,"useControllableState");function hI({defaultProp:t,onChange:e}){const[n,r]=g.useState(t),s=g.useRef(n),i=g.useRef(e);return QU(()=>{i.current=e},[e]),g.useEffect(()=>{var o;s.current!==n&&((o=i.current)==null||o.call(i,n),s.current=n)},[n,s]),[n,r,i]}nh(hI,"useUncontrolledState");function pI(t){return typeof t=="function"}nh(pI,"isFunction");var HE=Symbol("RADIX:SYNC_STATE");function JU(t,e,n,r){const{prop:s,defaultProp:i,onChange:o,caller:l}=e,u=s!==void 0,d=fI(o),h=[{...n,state:i}];r&&h.push(r);const[p,m]=g.useReducer((x,b)=>{if(b.type===HE)return{...x,state:b.state};const k=t(x,b);return u&&!Object.is(k.state,x.state)&&d(k.state),k},...h),v=p.state,w=g.useRef(v);g.useEffect(()=>{w.current!==v&&(w.current=v,u||d(v))},[v,w,u]);const _=g.useMemo(()=>s!==void 0?{...p,state:s}:p,[p,s]);return g.useEffect(()=>{u&&!Object.is(s,p.state)&&m({type:HE,state:s})},[s,p.state,u]),[_,m]}nh(JU,"useControllableStateReducer");var eW=Object.defineProperty,ri=(t,e)=>eW(t,"name",{value:e,configurable:!0});function _a(t){const e=g.forwardRef((n,r)=>{let{children:s,...i}=n,o=null,l=!1;const u=[];K_(s)&&typeof Np=="function"&&(s=Np(s._payload)),g.Children.forEach(s,m=>{var v;if(_I(m)){l=!0;const w=m;let _="child"in w.props?w.props.child:w.props.children;K_(_)&&typeof Np=="function"&&(_=Np(_._payload)),o=tW(w,_),u.push((v=o==null?void 0:o.props)==null?void 0:v.children)}else u.push(m)}),o?o=g.cloneElement(o,void 0,u):!l&&g.Children.count(s)===1&&g.isValidElement(s)&&(o=s);const d=o?yI(o):void 0,h=Zt(r,d);if(!o){if(s||s===0)throw new Error(l?sW(t):rW(t));return s}const p=vI(i,o.props??{});return o.type!==g.Fragment&&(p.ref=r?h:d),g.cloneElement(o,p)});return e.displayName=`${t}.Slot`,e}ri(_a,"createSlot");var mI=Symbol.for("radix.slottable");function gI(t){const e=ri(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=mI,e}ri(gI,"createSlottable");var tW=ri((t,e)=>{if("child"in t.props){const n=t.props.child;return g.isValidElement(n)?g.cloneElement(n,void 0,t.props.children(n.props.children)):null}return g.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function vI(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...l)=>{const u=i(...l);return s(...l),u}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}ri(vI,"mergeProps");function yI(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}ri(yI,"getElementRef");function _I(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===mI}ri(_I,"isSlottable");var nW=Symbol.for("react.lazy");function K_(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===nW&&"_payload"in t&&wI(t._payload)}ri(K_,"isLazyComponent");function wI(t){return typeof t=="object"&&t!==null&&"then"in t}ri(wI,"isPromiseLike");var rW=ri(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),sW=ri(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Np=Zf[" use ".trim().toString()],iW=Object.defineProperty,oW=(t,e)=>iW(t,"name",{value:e,configurable:!0}),aW=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_n=aW.reduce((t,e)=>{const n=_a(`Primitive.${e}`),r=g.forwardRef((s,i)=>{const{asChild:o,...l}=s,u=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(u,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function xI(t,e){t&&th.flushSync(()=>t.dispatchEvent(e))}oW(xI,"dispatchDiscreteCustomEvent");var lW=Object.defineProperty,cW=(t,e)=>lW(t,"name",{value:e,configurable:!0});function jl(t){const e=g.useRef(t);return g.useEffect(()=>{e.current=t}),g.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}cW(jl,"useCallbackRef");var uW=Object.defineProperty,Un=(t,e)=>uW(t,"name",{value:e,configurable:!0}),Y_="dismissableLayer.update",dW="dismissableLayer.pointerDownOutside",fW="dismissableLayer.focusOutside",zE,bI=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Gw=g.forwardRef(Un(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:u,onDismiss:d,...h}=e,p=g.useContext(bI),[m,v]=g.useState(null),w=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,_]=g.useState({}),x=Zt(n,v),b=Array.from(p.layers),[k]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),C=k?b.indexOf(k):-1,T=m?b.indexOf(m):-1,I=p.layersWithOutsidePointerEventsDisabled.size>0,M=T>=C,R=g.useRef(!1),A=EI(j=>{o==null||o(j),u==null||u(j),j.defaultPrevented||d==null||d()},{ownerDocument:w,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:R,dismissableSurfaces:p.dismissableSurfaces,shouldHandlePointerDownOutside:g.useCallback(j=>{if(!(j instanceof Node))return!1;const Q=[...p.branches].some(q=>q.contains(j));return M&&!Q},[p.branches,M])}),L=kI(j=>{if(s&&R.current)return;const Q=j.target;[...p.branches].some(Z=>Z.contains(Q))||(l==null||l(j),u==null||u(j),j.defaultPrevented||d==null||d())},w),N=m?T===b.length-1:!1,F=jl(j=>{j.key==="Escape"&&(i==null||i(j),!j.defaultPrevented&&d&&(j.preventDefault(),d()))});return g.useEffect(()=>{if(N)return w.addEventListener("keydown",F,{capture:!0}),()=>w.removeEventListener("keydown",F,{capture:!0})},[w,N,F]),g.useEffect(()=>{if(m)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(zE=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(m)),p.layers.add(m),X_(),()=>{r&&(p.layersWithOutsidePointerEventsDisabled.delete(m),p.layersWithOutsidePointerEventsDisabled.size===0&&(w.body.style.pointerEvents=zE))}},[m,w,r,p]),g.useEffect(()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),X_())},[m,p]),g.useEffect(()=>{const j=Un(()=>_({}),"handleUpdate");return document.addEventListener(Y_,j),()=>document.removeEventListener(Y_,j)},[]),S.jsx(_n.div,{...h,ref:x,style:{pointerEvents:I?M?"auto":"none":void 0,...e.style},onFocusCapture:Ut(e.onFocusCapture,L.onFocusCapture),onBlurCapture:Ut(e.onBlurCapture,L.onBlurCapture),onPointerDownCapture:Ut(e.onPointerDownCapture,A.onPointerDownCapture)})},"DismissableLayer"));function SI(){const t=g.useContext(bI),[e,n]=g.useState(null);return g.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}Un(SI,"useDismissableLayerSurface");var hW=Un(()=>!0,"IS_TRUE");function EI(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:o=hW}=e,l=jl(t),u=g.useRef(!1),d=g.useRef(!1),h=g.useRef(new Map),p=g.useRef(()=>{});return g.useEffect(()=>{function m(){d.current=!1,s.current=!1,h.current.clear()}Un(m,"resetOutsideInteraction");function v(){return Array.from(h.current.values()).some(Boolean)}Un(v,"isOutsideInteractionIntercepted");function w(C){if(!d.current)return;const T=C.target;T instanceof Node&&[...i].some(M=>M.contains(T))||h.current.set(C.type,!0),C.type==="click"&&window.setTimeout(()=>{d.current&&p.current()},0)}Un(w,"handleInteractionCapture");function _(C){d.current&&h.current.set(C.type,!1)}Un(_,"handleInteractionBubble");const x=Un(C=>{if(C.target&&!u.current){let T=function(){n.removeEventListener("click",p.current);const M=v();m(),M||Kw(dW,l,I,{discrete:!0})};if(Un(T,"handleAndDispatchPointerDownOutsideEvent"),!o(C.target)){n.removeEventListener("click",p.current),m(),u.current=!1;return}const I={originalEvent:C};d.current=!0,s.current=r&&C.button===0,h.current.clear(),!r||C.button!==0?T():(n.removeEventListener("click",p.current),p.current=T,n.addEventListener("click",p.current,{once:!0}))}else n.removeEventListener("click",p.current),m();u.current=!1},"handlePointerDown"),b=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const C of b)n.addEventListener(C,w,!0),n.addEventListener(C,_);const k=window.setTimeout(()=>{n.addEventListener("pointerdown",x)},0);return()=>{window.clearTimeout(k),n.removeEventListener("pointerdown",x),n.removeEventListener("click",p.current);for(const C of b)n.removeEventListener(C,w,!0),n.removeEventListener(C,_)}},[n,l,r,s,i,o]),{onPointerDownCapture:Un(()=>u.current=!0,"onPointerDownCapture")}}Un(EI,"usePointerDownOutside");function kI(t,e=globalThis==null?void 0:globalThis.document){const n=jl(t),r=g.useRef(!1);return g.useEffect(()=>{const s=Un(i=>{i.target&&!r.current&&Kw(fW,n,{originalEvent:i},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:Un(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Un(()=>r.current=!1,"onBlurCapture")}}Un(kI,"useFocusOutside");function X_(){const t=new CustomEvent(Y_);document.dispatchEvent(t)}Un(X_,"dispatchUpdate");function Kw(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?xI(s,i):s.dispatchEvent(i)}Un(Kw,"handleAndDispatchCustomEvent");var pW=Object.defineProperty,Er=(t,e)=>pW(t,"name",{value:e,configurable:!0}),W1="focusScope.autoFocusOnMount",Z1="focusScope.autoFocusOnUnmount",BE={bubbles:!1,cancelable:!0},CI=g.forwardRef(Er(function(e,n){const{loop:r=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[u,d]=g.useState(null),h=jl(i),p=jl(o),m=g.useRef(null),v=Zt(n,d),w=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(s){let x=function(T){if(w.paused||!u)return;const I=T.target;u.contains(I)?m.current=I:no(m.current,{select:!0})},b=function(T){if(w.paused||!u)return;const I=T.relatedTarget;I!==null&&(u.contains(I)||no(m.current,{select:!0}))},k=function(T){if(document.activeElement===document.body)for(const M of T)M.removedNodes.length>0&&no(u)};Er(x,"handleFocusIn"),Er(b,"handleFocusOut"),Er(k,"handleMutations"),document.addEventListener("focusin",x),document.addEventListener("focusout",b);const C=new MutationObserver(k);return u&&C.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",b),C.disconnect()}}},[s,u,w.paused]),g.useEffect(()=>{if(u){UE.add(w);const x=document.activeElement;if(!u.contains(x)){const k=new CustomEvent(W1,BE);u.addEventListener(W1,h),u.dispatchEvent(k),k.defaultPrevented||(PI(MI(Yw(u)),{select:!0}),document.activeElement===x&&no(u))}return()=>{u.removeEventListener(W1,h),setTimeout(()=>{const k=new CustomEvent(Z1,BE);u.addEventListener(Z1,p),u.dispatchEvent(k),k.defaultPrevented||no(x??document.body,{select:!0}),u.removeEventListener(Z1,p),UE.remove(w)},0)}}},[u,h,p,w]);const _=g.useCallback(x=>{if(!r&&!s||w.paused)return;const b=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,k=document.activeElement;if(b&&k){const C=x.currentTarget,[T,I]=TI(C);T&&I?!x.shiftKey&&k===I?(x.preventDefault(),r&&no(T,{select:!0})):x.shiftKey&&k===T&&(x.preventDefault(),r&&no(I,{select:!0})):k===C&&x.preventDefault()}},[r,s,w.paused]);return S.jsx(_n.div,{tabIndex:-1,...l,ref:v,onKeyDown:_})},"FocusScope"));function PI(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(no(r,{select:e}),document.activeElement!==n)return}Er(PI,"focusFirst");function TI(t){const e=Yw(t),n=Q_(e,t),r=Q_(e.reverse(),t);return[n,r]}Er(TI,"getTabbableEdges");function Yw(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:Er(r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)e.push(n.currentNode);return e}Er(Yw,"getTabbableCandidates");function Q_(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):II(r,{upTo:e})))return r}Er(Q_,"findVisible");function II(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}Er(II,"isHidden");function AI(t){return t instanceof HTMLInputElement&&"select"in t}Er(AI,"isSelectableInput");function no(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&AI(t)&&e&&t.select()}}Er(no,"focus");var UE=RI();function RI(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=J_(t,e),t.unshift(e)},remove(e){var n;t=J_(t,e),(n=t[0])==null||n.resume()}}}Er(RI,"createFocusScopesStack");function J_(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}Er(J_,"arrayRemove");function MI(t){return t.filter(e=>e.tagName!=="A")}Er(MI,"removeLinks");var mW=Object.defineProperty,gW=(t,e)=>mW(t,"name",{value:e,configurable:!0}),Xw=g.forwardRef(gW(function(e,n){var u;const{container:r,...s}=e,[i,o]=g.useState(!1);Fr(()=>o(!0),[]);const l=r||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?th.createPortal(S.jsx(_n.div,{...s,ref:n}),l):null},"Portal")),vW=Object.defineProperty,go=(t,e)=>vW(t,"name",{value:e,configurable:!0});function OI(t,e){return g.useReducer((n,r)=>e[n][r]??n,t)}go(OI,"useStateMachine");var Pa=go(t=>{const{present:e,children:n}=t,r=LI(e),s=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),i=DI(r.ref,NI(s));return typeof n=="function"||r.isPresent?g.cloneElement(s,{ref:i}):null},"Presence");function LI(t){const[e,n]=g.useState(),r=g.useRef(null),s=g.useRef(t),i=g.useRef("none"),o=g.useRef(void 0),l=t?"mounted":"unmounted",[u,d]=OI(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{u==="mounted"?(i.current=o.current??Mc(r.current),o.current=void 0):i.current="none"},[u]),Fr(()=>{const h=r.current,p=s.current;if(p!==t){const v=i.current,w=Mc(h);t?(o.current=w,d("MOUNT")):w==="none"||(h==null?void 0:h.display)==="none"?d("UNMOUNT"):d(p&&v!==w?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,d]),Fr(()=>{if(e){let h;const p=e.ownerDocument.defaultView??window,m=go(w=>{const x=Mc(r.current).includes(CSS.escape(w.animationName));if(w.target===e&&x&&(d("ANIMATION_END"),!s.current)){const b=e.style.animationFillMode;e.style.animationFillMode="forwards",h=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=b)})}},"handleAnimationEnd"),v=go(w=>{w.target===e&&(i.current=Mc(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",v),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{p.clearTimeout(h),e.removeEventListener("animationstart",v),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:g.useCallback(h=>{if(h){const p=getComputedStyle(h);r.current=p,o.current=Mc(p)}else r.current=null;n(h)},[])}}go(LI,"usePresence");function e2(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}go(e2,"setRef");function DI(...t){const e=g.useRef(t);return e.current=t,g.useCallback(n=>{const r=e.current;let s=!1;const i=r.map(o=>{const l=e2(o,n);return!s&&typeof l=="function"&&(s=!0),l});if(s)return()=>{for(let o=0;o<i.length;o++){const l=i[o];typeof l=="function"?l():e2(r[o],null)}}},[])}go(DI,"useStableComposedRefs");function Mc(t){return(t==null?void 0:t.animationName)||"none"}go(Mc,"getAnimationName");function NI(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}go(NI,"getElementRef");var yW=Object.defineProperty,Qw=(t,e)=>yW(t,"name",{value:e,configurable:!0}),$p=0,hi=null;function _W(t){return Fm(),t.children}Qw(_W,"FocusGuards");function Fm(){g.useEffect(()=>{hi||(hi={start:t2(),end:t2()});const{start:t,end:e}=hi;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),$p++,()=>{$p===1&&(hi==null||hi.start.remove(),hi==null||hi.end.remove(),hi=null),$p=Math.max(0,$p-1)}},[])}Qw(Fm,"useFocusGuards");function t2(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}Qw(t2,"createFocusGuard");var Ei=function(){return Ei=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Ei.apply(this,arguments)};function $I(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 wW(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,i;r<s;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var g0="right-scroll-bar-position",v0="width-before-scroll-bar",xW="with-scroll-bars-hidden",bW="--removed-body-scroll-bar-size";function q1(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function SW(t,e){var n=g.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=e,n.facade}var EW=typeof window<"u"?g.useLayoutEffect:g.useEffect,WE=new WeakMap;function kW(t,e){var n=SW(null,function(r){return t.forEach(function(s){return q1(s,r)})});return EW(function(){var r=WE.get(n);if(r){var s=new Set(r),i=new Set(t),o=n.current;s.forEach(function(l){i.has(l)||q1(l,null)}),i.forEach(function(l){s.has(l)||q1(l,o)})}WE.set(n,t)},[t]),n}function CW(t){return t}function PW(t,e){e===void 0&&(e=CW);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(i){var o=e(i,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(i),o=n}var u=function(){var h=o;o=[],h.forEach(i)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(h){o.push(h),d()},filter:function(h){return o=o.filter(h),n}}}};return s}function TW(t){t===void 0&&(t={});var e=PW(null);return e.options=Ei({async:!0,ssr:!1},t),e}var jI=function(t){var e=t.sideCar,n=$I(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return g.createElement(r,Ei({},n))};jI.isSideCarExport=!0;function IW(t,e){return t.useMedium(e),jI}var FI=TW(),G1=function(){},Vm=g.forwardRef(function(t,e){var n=g.useRef(null),r=g.useState({onScrollCapture:G1,onWheelCapture:G1,onTouchMoveCapture:G1}),s=r[0],i=r[1],o=t.forwardProps,l=t.children,u=t.className,d=t.removeScrollBar,h=t.enabled,p=t.shards,m=t.sideCar,v=t.noRelative,w=t.noIsolation,_=t.inert,x=t.allowPinchZoom,b=t.as,k=b===void 0?"div":b,C=t.gapMode,T=$I(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),I=m,M=kW([n,e]),R=Ei(Ei({},T),s);return g.createElement(g.Fragment,null,h&&g.createElement(I,{sideCar:FI,removeScrollBar:d,shards:p,noRelative:v,noIsolation:w,inert:_,setCallbacks:i,allowPinchZoom:!!x,lockRef:n,gapMode:C}),o?g.cloneElement(g.Children.only(l),Ei(Ei({},R),{ref:M})):g.createElement(k,Ei({},R,{className:u,ref:M}),l))});Vm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Vm.classNames={fullWidth:v0,zeroRight:g0};var AW=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function RW(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=AW();return e&&t.setAttribute("nonce",e),t}function MW(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function OW(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var LW=function(){var t=0,e=null;return{add:function(n){t==0&&(e=RW())&&(MW(e,n),OW(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},DW=function(){var t=LW();return function(e,n){g.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},VI=function(){var t=DW(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},NW={left:0,top:0,right:0,gap:0},K1=function(t){return parseInt(t||"",10)||0},$W=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],s=e[t==="padding"?"paddingRight":"marginRight"];return[K1(n),K1(r),K1(s)]},jW=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return NW;var e=$W(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},FW=VI(),Wc="data-scroll-locked",VW=function(t,e,n,r){var s=t.left,i=t.top,o=t.right,l=t.gap;return n===void 0&&(n="margin"),`
72
+ .`.concat(xW,` {
73
+ overflow: hidden `).concat(r,`;
74
+ padding-right: `).concat(l,"px ").concat(r,`;
75
+ }
76
+ body[`).concat(Wc,`] {
77
+ overflow: hidden `).concat(r,`;
78
+ overscroll-behavior: contain;
79
+ `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
80
+ padding-left: `.concat(s,`px;
81
+ padding-top: `).concat(i,`px;
82
+ padding-right: `).concat(o,`px;
83
+ margin-left:0;
84
+ margin-top:0;
85
+ margin-right: `).concat(l,"px ").concat(r,`;
86
+ `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
87
+ }
88
+
89
+ .`).concat(g0,` {
90
+ right: `).concat(l,"px ").concat(r,`;
91
+ }
92
+
93
+ .`).concat(v0,` {
94
+ margin-right: `).concat(l,"px ").concat(r,`;
95
+ }
96
+
97
+ .`).concat(g0," .").concat(g0,` {
98
+ right: 0 `).concat(r,`;
99
+ }
100
+
101
+ .`).concat(v0," .").concat(v0,` {
102
+ margin-right: 0 `).concat(r,`;
103
+ }
104
+
105
+ body[`).concat(Wc,`] {
106
+ `).concat(bW,": ").concat(l,`px;
107
+ }
108
+ `)},ZE=function(){var t=parseInt(document.body.getAttribute(Wc)||"0",10);return isFinite(t)?t:0},HW=function(){g.useEffect(function(){return document.body.setAttribute(Wc,(ZE()+1).toString()),function(){var t=ZE()-1;t<=0?document.body.removeAttribute(Wc):document.body.setAttribute(Wc,t.toString())}},[])},zW=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;HW();var i=g.useMemo(function(){return jW(s)},[s]);return g.createElement(FW,{styles:VW(i,!e,s,n?"":"!important")})},n2=!1;if(typeof window<"u")try{var jp=Object.defineProperty({},"passive",{get:function(){return n2=!0,!0}});window.addEventListener("test",jp,jp),window.removeEventListener("test",jp,jp)}catch{n2=!1}var kc=n2?{passive:!1}:!1,BW=function(t){return t.tagName==="TEXTAREA"},HI=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!BW(t)&&n[e]==="visible")},UW=function(t){return HI(t,"overflowY")},WW=function(t){return HI(t,"overflowX")},qE=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=zI(t,r);if(s){var i=BI(t,r),o=i[1],l=i[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ZW=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},qW=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},zI=function(t,e){return t==="v"?UW(e):WW(e)},BI=function(t,e){return t==="v"?ZW(e):qW(e)},GW=function(t,e){return t==="h"&&e==="rtl"?-1:1},KW=function(t,e,n,r,s){var i=GW(t,window.getComputedStyle(e).direction),o=i*r,l=n.target,u=e.contains(l),d=!1,h=o>0,p=0,m=0;do{if(!l)break;var v=BI(t,l),w=v[0],_=v[1],x=v[2],b=_-x-i*w;(w||b)&&zI(t,l)&&(p+=b,m+=w);var k=l.parentNode;l=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!u&&l!==document.body||u&&(e.contains(l)||e===l));return(h&&Math.abs(p)<1||!h&&Math.abs(m)<1)&&(d=!0),d},Fp=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},GE=function(t){return[t.deltaX,t.deltaY]},KE=function(t){return t&&"current"in t?t.current:t},YW=function(t,e){return t[0]===e[0]&&t[1]===e[1]},XW=function(t){return`
109
+ .block-interactivity-`.concat(t,` {pointer-events: none;}
110
+ .allow-interactivity-`).concat(t,` {pointer-events: all;}
111
+ `)},QW=0,Cc=[];function JW(t){var e=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),s=g.useState(QW++)[0],i=g.useState(VI)[0],o=g.useRef(t);g.useEffect(function(){o.current=t},[t]),g.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var _=wW([t.lockRef.current],(t.shards||[]).map(KE),!0).filter(Boolean);return _.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),_.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var l=g.useCallback(function(_,x){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!o.current.allowPinchZoom;var b=Fp(_),k=n.current,C="deltaX"in _?_.deltaX:k[0]-b[0],T="deltaY"in _?_.deltaY:k[1]-b[1],I,M=_.target,R=Math.abs(C)>Math.abs(T)?"h":"v";if("touches"in _&&R==="h"&&M.type==="range")return!1;var A=window.getSelection(),L=A&&A.anchorNode,N=L?L===M||L.contains(M):!1;if(N)return!1;var F=qE(R,M);if(!F)return!0;if(F?I=R:(I=R==="v"?"h":"v",F=qE(R,M)),!F)return!1;if(!r.current&&"changedTouches"in _&&(C||T)&&(r.current=I),!I)return!0;var j=r.current||I;return KW(j,x,_,j==="h"?C:T)},[]),u=g.useCallback(function(_){var x=_;if(!(!Cc.length||Cc[Cc.length-1]!==i)){var b="deltaY"in x?GE(x):Fp(x),k=e.current.filter(function(I){return I.name===x.type&&(I.target===x.target||x.target===I.shadowParent)&&YW(I.delta,b)})[0];if(k&&k.should){x.cancelable&&x.preventDefault();return}if(!k){var C=(o.current.shards||[]).map(KE).filter(Boolean).filter(function(I){return I.contains(x.target)}),T=C.length>0?l(x,C[0]):!o.current.noIsolation;T&&x.cancelable&&x.preventDefault()}}},[]),d=g.useCallback(function(_,x,b,k){var C={name:_,delta:x,target:b,should:k,shadowParent:eZ(b)};e.current.push(C),setTimeout(function(){e.current=e.current.filter(function(T){return T!==C})},1)},[]),h=g.useCallback(function(_){n.current=Fp(_),r.current=void 0},[]),p=g.useCallback(function(_){d(_.type,GE(_),_.target,l(_,t.lockRef.current))},[]),m=g.useCallback(function(_){d(_.type,Fp(_),_.target,l(_,t.lockRef.current))},[]);g.useEffect(function(){return Cc.push(i),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",u,kc),document.addEventListener("touchmove",u,kc),document.addEventListener("touchstart",h,kc),function(){Cc=Cc.filter(function(_){return _!==i}),document.removeEventListener("wheel",u,kc),document.removeEventListener("touchmove",u,kc),document.removeEventListener("touchstart",h,kc)}},[]);var v=t.removeScrollBar,w=t.inert;return g.createElement(g.Fragment,null,w?g.createElement(i,{styles:XW(s)}):null,v?g.createElement(zW,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function eZ(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const tZ=IW(FI,JW);var Jw=g.forwardRef(function(t,e){return g.createElement(Vm,Ei({},t,{ref:e,sideCar:tZ}))});Jw.classNames=Vm.classNames;var nZ=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Pc=new WeakMap,Vp=new WeakMap,Hp={},Y1=0,UI=function(t){return t&&(t.host||UI(t.parentNode))},rZ=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=UI(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},sZ=function(t,e,n,r){var s=rZ(e,Array.isArray(t)?t:[t]);Hp[n]||(Hp[n]=new WeakMap);var i=Hp[n],o=[],l=new Set,u=new Set(s),d=function(p){!p||l.has(p)||(l.add(p),d(p.parentNode))};s.forEach(d);var h=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(m){if(l.has(m))h(m);else try{var v=m.getAttribute(r),w=v!==null&&v!=="false",_=(Pc.get(m)||0)+1,x=(i.get(m)||0)+1;Pc.set(m,_),i.set(m,x),o.push(m),_===1&&w&&Vp.set(m,!0),x===1&&m.setAttribute(n,"true"),w||m.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",m,b)}})};return h(e),l.clear(),Y1++,function(){o.forEach(function(p){var m=Pc.get(p)-1,v=i.get(p)-1;Pc.set(p,m),i.set(p,v),m||(Vp.has(p)||p.removeAttribute(r),Vp.delete(p)),v||p.removeAttribute(n)}),Y1--,Y1||(Pc=new WeakMap,Pc=new WeakMap,Vp=new WeakMap,Hp={})}},WI=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=nZ(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),sZ(r,s,n,"aria-hidden")):function(){return null}},iZ=Object.defineProperty,si=(t,e)=>iZ(t,"name",{value:e,configurable:!0}),ex="Dialog",[ZI,Xne]=Di(ex),[oZ,xo]=ZI(ex),tx=si(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=t,l=g.useRef(null),u=g.useRef(null),[d,h]=Ca({prop:r,defaultProp:s??!1,onChange:i,caller:ex}),[p,m]=g.useState(0),[v,w]=g.useState(0);return S.jsx(oZ,{scope:e,triggerRef:l,contentRef:u,contentId:da(),titleId:da(),descriptionId:da(),titlePresent:p>0,descriptionPresent:v>0,setTitleCount:m,setDescriptionCount:w,open:d,onOpenChange:h,onOpenToggle:g.useCallback(()=>h(_=>!_),[h]),modal:o,children:n})},"Dialog"),qI="DialogPortal",[aZ,GI]=ZI(qI,{forceMount:void 0}),nx=si(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=xo(qI,e);return S.jsx(aZ,{scope:e,forceMount:n,children:g.Children.map(r,o=>S.jsx(Pa,{present:n||i.open,children:S.jsx(Xw,{asChild:!0,container:s,children:o})}))})},"DialogPortal"),r2="DialogOverlay",rx=g.forwardRef(si(function(e,n){const r=GI(r2,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,o=xo(r2,e.__scopeDialog);return o.modal?S.jsx(Pa,{present:s||o.open,children:S.jsx(cZ,{...i,ref:n})}):null},"DialogOverlay")),lZ=_a("DialogOverlay.RemoveScroll"),cZ=g.forwardRef(si(function(e,n){const{__scopeDialog:r,...s}=e,i=xo(r2,r),o=SI(),l=Zt(n,o);return S.jsx(Jw,{as:lZ,allowPinchZoom:!0,shards:[i.contentRef],children:S.jsx(_n.div,{"data-state":ax(i.open),...s,ref:l,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),Sf="DialogContent",sx=g.forwardRef(si(function(e,n){const r=GI(Sf,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,o=xo(Sf,e.__scopeDialog);return S.jsx(Pa,{present:s||o.open,children:o.modal?S.jsx(uZ,{...i,ref:n}):S.jsx(dZ,{...i,ref:n})})},"DialogContent")),uZ=g.forwardRef(si(function(e,n){const r=xo(Sf,e.__scopeDialog),s=g.useRef(null),i=Zt(n,r.contentRef,s);return g.useEffect(()=>{const o=s.current;if(o)return WI(o)},[]),S.jsx(KI,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Ut(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Ut(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:Ut(e.onFocusOutside,o=>o.preventDefault())})},"DialogContentModal")),dZ=g.forwardRef(si(function(e,n){const r=xo(Sf,e.__scopeDialog),s=g.useRef(!1),i=g.useRef(!1);return S.jsx(KI,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(s.current||(u=r.triggerRef.current)==null||u.focus(),o.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:o=>{var d,h;(d=e.onInteractOutside)==null||d.call(e,o),o.defaultPrevented||(s.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((h=r.triggerRef.current)==null?void 0:h.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})},"DialogContentNonModal")),KI=g.forwardRef(si(function(e,n){const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,u=xo(Sf,r);return Fm(),S.jsx(S.Fragment,{children:S.jsx(CI,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(Gw,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionPresent?u.descriptionId:void 0,"aria-labelledby":u.titlePresent?u.titleId:void 0,"data-state":ax(u.open),...l,ref:n,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})},"DialogContentImpl")),fZ="DialogTitle",ix=g.forwardRef(si(function(e,n){const{__scopeDialog:r,...s}=e,i=xo(fZ,r),{setTitleCount:o}=i;return Fr(()=>(o(l=>l+1),()=>o(l=>l-1)),[o]),S.jsx(_n.h2,{id:i.titleId,...s,ref:n})},"DialogTitle")),hZ="DialogDescription",ox=g.forwardRef(si(function(e,n){const{__scopeDialog:r,...s}=e,i=xo(hZ,r),{setDescriptionCount:o}=i;return Fr(()=>(o(l=>l+1),()=>o(l=>l-1)),[o]),S.jsx(_n.p,{id:i.descriptionId,...s,ref:n})},"DialogDescription"));function ax(t){return t?"open":"closed"}si(ax,"getState");const pZ=["top","right","bottom","left"],wa=Math.min,po=Math.max,um=Math.round,zp=Math.floor,mo=t=>({x:t,y:t}),mZ={left:"right",right:"left",bottom:"top",top:"bottom"};function YI(t,e,n){return po(t,wa(e,n))}function vo(t,e){return typeof t=="function"?t(e):t}function xa(t){return t.split("-")[0]}function Mu(t){return t.split("-")[1]}function lx(t){return t==="x"?"y":"x"}function cx(t){return t==="y"?"height":"width"}function Pi(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function ux(t){return lx(Pi(t))}function gZ(t,e,n){n===void 0&&(n=!1);const r=Mu(t),s=ux(t),i=cx(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=dm(o)),[o,dm(o)]}function vZ(t){const e=dm(t);return[s2(t),e,s2(e)]}function s2(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const YE=["left","right"],XE=["right","left"],yZ=["top","bottom"],_Z=["bottom","top"];function wZ(t,e,n){switch(t){case"top":case"bottom":return n?e?XE:YE:e?YE:XE;case"left":case"right":return e?yZ:_Z;default:return[]}}function xZ(t,e,n,r){const s=Mu(t);let i=wZ(xa(t),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(s2)))),i}function dm(t){const e=xa(t);return mZ[e]+t.slice(e.length)}function bZ(t){var e,n,r,s;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(r=t.bottom)!=null?r:0,left:(s=t.left)!=null?s:0}}function XI(t){return typeof t!="number"?bZ(t):{top:t,right:t,bottom:t,left:t}}function fm(t){const{x:e,y:n,width:r,height:s}=t;return{width:r,height:s,top:n,left:e,right:e+r,bottom:n+s,x:e,y:n}}function QE(t,e,n){let{reference:r,floating:s}=t;const i=Pi(e),o=ux(e),l=cx(o),u=xa(e),d=i==="y",h=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,m=r[l]/2-s[l]/2;let v;switch(u){case"top":v={x:h,y:r.y-s.height};break;case"bottom":v={x:h,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:p};break;case"left":v={x:r.x-s.width,y:p};break;default:v={x:r.x,y:r.y}}const w=Mu(e);return w&&(v[o]+=m*(w==="end"?1:-1)*(n&&d?-1:1)),v}async function SZ(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:o,elements:l,strategy:u}=t,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:m=!1,padding:v=0}=vo(e,t),w=XI(v),x=l[m?p==="floating"?"reference":"floating":p],b=fm(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:h,strategy:u})),k=p==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),T=await(i.isElement==null?void 0:i.isElement(C))&&await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1},I=fm(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:k,offsetParent:C,strategy:u}):k);return{top:(b.top-I.top+w.top)/T.y,bottom:(I.bottom-b.bottom+w.bottom)/T.y,left:(b.left-I.left+w.left)/T.x,right:(I.right-b.right+w.right)/T.x}}const EZ=50,kZ=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:SZ},u=await(o.isRTL==null?void 0:o.isRTL(e));let d=await o.getElementRects({reference:t,floating:e,strategy:s}),{x:h,y:p}=QE(d,r,u),m=r,v=0;const w={};for(let _=0;_<i.length;_++){const x=i[_];if(!x)continue;const{name:b,fn:k}=x,{x:C,y:T,data:I,reset:M}=await k({x:h,y:p,initialPlacement:r,placement:m,strategy:s,middlewareData:w,rects:d,platform:l,elements:{reference:t,floating:e}});h=C??h,p=T??p,w[b]={...w[b],...I},M&&v<EZ&&(v++,typeof M=="object"&&(M.placement&&(m=M.placement),M.rects&&(d=M.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:s}):M.rects),{x:h,y:p}=QE(d,m,u)),_=-1)}return{x:h,y:p,placement:m,strategy:s,middlewareData:w}},CZ=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:o,elements:l,middlewareData:u}=e,{element:d,padding:h=0}=vo(t,e)||{};if(d==null)return{};const p=XI(h),m={x:n,y:r},v=ux(s),w=cx(v),_=await o.getDimensions(d),x=v==="y",b=x?"top":"left",k=x?"bottom":"right",C=x?"clientHeight":"clientWidth",T=i.reference[w]+i.reference[v]-m[v]-i.floating[w],I=m[v]-i.reference[v],M=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let R=M?M[C]:0;(!R||!await(o.isElement==null?void 0:o.isElement(M)))&&(R=l.floating[C]||i.floating[w]);const A=T/2-I/2,L=R/2-_[w]/2-1,N=wa(p[b],L),F=wa(p[k],L),j=R-_[w]-F,Q=R/2-_[w]/2+A,q=YI(N,Q,j),Z=!u.arrow&&Mu(s)!=null&&Q!==q&&i.reference[w]/2-(Q<N?N:F)-_[w]/2<0,W=Z?Q<N?Q-N:Q-j:0;return{[v]:m[v]+W,data:{[v]:q,centerOffset:Q-q-W,...Z&&{alignmentOffset:W}},reset:Z}}}),PZ=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:l,platform:u,elements:d}=e,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:_=!0,...x}=vo(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=xa(s),k=Pi(l),C=xa(l)===l,T=await(u.isRTL==null?void 0:u.isRTL(d.floating)),I=m||(C||!_?[dm(l)]:vZ(l)),M=w!=="none";!m&&M&&I.push(...xZ(l,_,w,T));const R=[l,...I],A=await u.detectOverflow(e,x),L=[];let N=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&L.push(A[b]),p){const q=gZ(s,o,T);L.push(A[q[0]],A[q[1]])}if(N=[...N,{placement:s,overflows:L}],!L.every(q=>q<=0)){var F,j;const q=(((F=i.flip)==null?void 0:F.index)||0)+1,Z=R[q];if(Z&&(!(p==="alignment"?k!==Pi(Z):!1)||N.every(V=>Pi(V.placement)===k?V.overflows[0]>0:!0)))return{data:{index:q,overflows:N},reset:{placement:Z}};let W=(j=N.filter(Y=>Y.overflows[0]<=0).sort((Y,V)=>Y.overflows[1]-V.overflows[1])[0])==null?void 0:j.placement;if(!W)switch(v){case"bestFit":{var Q;const Y=(Q=N.filter(V=>{if(M){const J=Pi(V.placement);return J===k||J==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(J=>J>0).reduce((J,B)=>J+B,0)]).sort((V,J)=>V[1]-J[1])[0])==null?void 0:Q[0];Y&&(W=Y);break}case"initialPlacement":W=l;break}if(s!==W)return{reset:{placement:W}}}return{}}}};function JE(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function ek(t){return pZ.some(e=>t[e]>=0)}const TZ=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:s="referenceHidden",...i}=vo(t,e);switch(s){case"referenceHidden":{const o=await r.detectOverflow(e,{...i,elementContext:"reference"}),l=JE(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:ek(l)}}}case"escaped":{const o=await r.detectOverflow(e,{...i,altBoundary:!0}),l=JE(o,n.floating);return{data:{escapedOffsets:l,escaped:ek(l)}}}default:return{}}}}},QI=new Set(["left","top"]);async function IZ(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=xa(n),l=Mu(n),u=Pi(n)==="y",d=QI.has(o)?-1:1,h=i&&u?-1:1,p=vo(e,t);let{mainAxis:m,crossAxis:v,alignmentAxis:w}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof w=="number"&&(v=l==="end"?w*-1:w),u?{x:v*h,y:m*d}:{x:m*d,y:v*h}}const AZ=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:o,middlewareData:l}=e,u=await IZ(e,t);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+u.x,y:i+u.y,data:{...u,placement:o}}}}},RZ=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:s,platform:i}=e,{mainAxis:o=!0,crossAxis:l=!1,limiter:u={fn:k=>{let{x:C,y:T}=k;return{x:C,y:T}}},...d}=vo(t,e),h={x:n,y:r},p=await i.detectOverflow(e,d),m=Pi(s),v=lx(m);let w=h[v],_=h[m];const x=(k,C)=>YI(C+p[k==="y"?"top":"left"],C,C-p[k==="y"?"bottom":"right"]);o&&(w=x(v,w)),l&&(_=x(m,_));const b=u.fn({...e,[v]:w,[m]:_});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[v]:o,[m]:l}}}}}},MZ=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:s,y:i,placement:o,rects:l,middlewareData:u}=e,{offset:d=0,mainAxis:h=!0,crossAxis:p=!0}=vo(t,e),m={x:s,y:i},v=Pi(o),w=lx(v);let _=m[w],x=m[v];const b=vo(d,e),k=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:(n=b.mainAxis)!=null?n:0,crossAxis:(r=b.crossAxis)!=null?r:0};if(h){const I=w==="y"?"height":"width",M=l.reference[w]-l.floating[I]+k.mainAxis,R=l.reference[w]+l.reference[I]-k.mainAxis;_<M?_=M:_>R&&(_=R)}if(p){var C,T;const I=w==="y"?"width":"height",M=QI.has(xa(o)),R=l.reference[v]-l.floating[I]+(M&&((C=u.offset)==null?void 0:C[v])||0)+(M?0:k.crossAxis),A=l.reference[v]+l.reference[I]+(M?0:((T=u.offset)==null?void 0:T[v])||0)-(M?k.crossAxis:0);x<R?x=R:x>A&&(x=A)}return{[w]:_,[v]:x}}}},OZ=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:s,elements:i}=e,{apply:o=()=>{},...l}=vo(t,e),u=await s.detectOverflow(e,l),d=xa(n),h=Mu(n),p=Pi(n)==="y",{width:m,height:v}=r.floating;let w,_;d==="top"||d==="bottom"?(w=d,_=h===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(_=d,w=h==="end"?"top":"bottom");const x=v-u.top-u.bottom,b=m-u.left-u.right,k=wa(v-u[w],x),C=wa(m-u[_],b),T=e.middlewareData.shift,I=!T;let M=k,R=C;T!=null&&T.enabled.x&&(R=b),T!=null&&T.enabled.y&&(M=x),I&&!h&&(p?R=m-2*po(u.left,u.right):M=v-2*po(u.top,u.bottom)),await o({...e,availableWidth:R,availableHeight:M});const A=await s.getDimensions(i.floating);return m!==A.width||v!==A.height?{reset:{rects:!0}}:{}}}};function Hm(){return typeof window<"u"}function Ou(t){return JI(t)?(t.nodeName||"").toLowerCase():"#document"}function Vr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function bo(t){var e;return(e=(JI(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function JI(t){return Hm()?t instanceof Node||t instanceof Vr(t).Node:!1}function Mi(t){return Hm()?t instanceof Element||t instanceof Vr(t).Element:!1}function Ta(t){return Hm()?t instanceof HTMLElement||t instanceof Vr(t).HTMLElement:!1}function tk(t){return!Hm()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Vr(t).ShadowRoot}function zm(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=Oi(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&s!=="inline"&&s!=="contents"}function LZ(t){return/^(table|td|th)$/.test(Ou(t))}function Bm(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const DZ=/transform|translate|scale|rotate|perspective|filter/,NZ=/paint|layout|strict|content/,rl=t=>!!t&&t!=="none";let X1;function dx(t){const e=Mi(t)?Oi(t):t;return rl(e.transform)||rl(e.translate)||rl(e.scale)||rl(e.rotate)||rl(e.perspective)||!fx()&&(rl(e.backdropFilter)||rl(e.filter))||DZ.test(e.willChange||"")||NZ.test(e.contain||"")}function $Z(t){let e=Fl(t);for(;Ta(e)&&!Ef(e);){if(dx(e))return e;if(Bm(e))return null;e=Fl(e)}return null}function fx(){return X1==null&&(X1=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),X1}function Ef(t){return/^(html|body|#document)$/.test(Ou(t))}function Oi(t){return Vr(t).getComputedStyle(t)}function Um(t){return Mi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Fl(t){if(Ou(t)==="html")return t;const e=t.assignedSlot||t.parentNode||tk(t)&&t.host||bo(t);return tk(e)?e.host:e}function eA(t){const e=Fl(t);return Ef(e)?(t.ownerDocument||t).body:Ta(e)&&zm(e)?e:eA(e)}function kf(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=eA(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),o=Vr(s);if(i){const l=i2(o);return e.concat(o,o.visualViewport||[],zm(s)?s:[],l&&n?kf(l):[])}else return e.concat(s,kf(s,[],n))}function i2(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function tA(t){const e=Oi(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=Ta(t),i=s?t.offsetWidth:n,o=s?t.offsetHeight:r,l=um(n)!==i||um(r)!==o;return l&&(n=i,r=o),{width:n,height:r,$:l}}function hx(t){return Mi(t)?t:t.contextElement}function Zc(t){const e=hx(t);if(!Ta(e))return mo(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=tA(e);let o=(i?um(n.width):n.width)/r,l=(i?um(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const jZ=mo(0);function nA(t){const e=Vr(t);return!fx()||!e.visualViewport?jZ:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function FZ(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Vr(t)}function Vl(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=hx(t);let o=mo(1);e&&(r?Mi(r)&&(o=Zc(r)):o=Zc(t));const l=FZ(i,n,r)?nA(i):mo(0);let u=(s.left+l.x)/o.x,d=(s.top+l.y)/o.y,h=s.width/o.x,p=s.height/o.y;if(i&&r){const m=Vr(i),v=Mi(r)?Vr(r):r;let w=m,_=i2(w);for(;_&&v!==w;){const x=Zc(_),b=_.getBoundingClientRect(),k=Oi(_),C=b.left+(_.clientLeft+parseFloat(k.paddingLeft))*x.x,T=b.top+(_.clientTop+parseFloat(k.paddingTop))*x.y;u*=x.x,d*=x.y,h*=x.x,p*=x.y,u+=C,d+=T,w=Vr(_),_=i2(w)}}return fm({width:h,height:p,x:u,y:d})}function Wm(t,e){const n=Um(t).scrollLeft;return e?e.left+n:Vl(bo(t)).left+n}function rA(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-Wm(t,n),s=n.top+e.scrollTop;return{x:r,y:s}}function VZ(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",o=bo(r),l=e?Bm(e.floating):!1;if(r===o||l&&i)return n;let u={scrollLeft:0,scrollTop:0},d=mo(1);const h=mo(0),p=Ta(r);if((p||!i)&&((Ou(r)!=="body"||zm(o))&&(u=Um(r)),p)){const v=Vl(r);d=Zc(r),h.x=v.x+r.clientLeft,h.y=v.y+r.clientTop}const m=o&&!p&&!i?rA(o,u):mo(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+h.x+m.x,y:n.y*d.y-u.scrollTop*d.y+h.y+m.y}}function HZ(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function zZ(t){const e=Um(t),n=t.ownerDocument.body,r=po(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=po(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+Wm(t);const o=-e.scrollTop;return Oi(n).direction==="rtl"&&(i+=po(t.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:o}}const BZ=25;function UZ(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=Vr(t),i=bo(t),o=s.visualViewport;let l=i.clientWidth,u=i.clientHeight,d=0,h=0;if(o){const m=!fx()||e==="fixed";r?m||(d=-o.offsetLeft,h=-o.offsetTop):(l=o.width,u=o.height,m&&(d=o.offsetLeft,h=o.offsetTop))}if(Wm(i)<=0){const m=i.ownerDocument,v=m.body,w=getComputedStyle(v),_=m.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,x=Math.abs(i.clientWidth-v.clientWidth-_),b=getComputedStyle(i).scrollbarGutter==="stable both-edges"?x/2:x;b<=BZ&&(l-=b)}return{width:l,height:u,x:d,y:h}}function WZ(t,e){const n=Vl(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Zc(t),o=t.clientWidth*i.x,l=t.clientHeight*i.y,u=s*i.x,d=r*i.y;return{width:o,height:l,x:u,y:d}}function nk(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=UZ(t,n,e);else if(e==="document")r=zZ(bo(t));else if(Mi(e))r=WZ(e,n);else{const s=nA(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return fm(r)}function ZZ(t,e){const n=e.get(t);if(n)return n;let r=kf(t,[],!1).filter(l=>Mi(l)&&Ou(l)!=="body"),s=null;const i=Oi(t).position==="fixed";let o=i?Fl(t):t;for(;Mi(o)&&!Ef(o);){const l=Oi(o),u=dx(o),d=s?s.position:i?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&l.position==="static")?r=r.filter(p=>p!==o):s=l,o=Fl(o)}return e.set(t,r),r}function qZ(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const o=[...n==="clippingAncestors"?Bm(e)?[]:ZZ(e,this._c):[].concat(n),r],l=nk(e,o[0],s);let u=l.top,d=l.right,h=l.bottom,p=l.left;for(let m=1;m<o.length;m++){const v=nk(e,o[m],s);u=po(v.top,u),d=wa(v.right,d),h=wa(v.bottom,h),p=po(v.left,p)}return{width:d-p,height:h-u,x:p,y:u}}function GZ(t){const{width:e,height:n}=tA(t);return{width:e,height:n}}function KZ(t,e,n){const r=Ta(e),s=bo(e),i=n==="fixed",o=Vl(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const u=mo(0);if((r||!i)&&((Ou(e)!=="body"||zm(s))&&(l=Um(e)),r)){const m=Vl(e,!0,i,e);u.x=m.x+e.clientLeft,u.y=m.y+e.clientTop}!r&&s&&(u.x=Wm(s));const d=s&&!r&&!i?rA(s,l):mo(0),h=o.left+l.scrollLeft-u.x-d.x,p=o.top+l.scrollTop-u.y-d.y;return{x:h,y:p,width:o.width,height:o.height}}function Q1(t){return Oi(t).position==="static"}function rk(t,e){if(!Ta(t)||Oi(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return bo(t)===n&&(n=n.ownerDocument.body),n}function sA(t,e){const n=Vr(t);if(Bm(t))return n;if(!Ta(t)){let s=Fl(t);for(;s&&!Ef(s);){if(Mi(s)&&!Q1(s))return s;s=Fl(s)}return n}let r=rk(t,e);for(;r&&LZ(r)&&Q1(r);)r=rk(r,e);return r&&Ef(r)&&Q1(r)&&!dx(r)?n:r||$Z(t)||n}const YZ=async function(t){const e=this.getOffsetParent||sA,n=this.getDimensions,r=await n(t.floating);return{reference:KZ(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function XZ(t){return Oi(t).direction==="rtl"}const QZ={convertOffsetParentRelativeRectToViewportRelativeRect:VZ,getDocumentElement:bo,getClippingRect:qZ,getOffsetParent:sA,getElementRects:YZ,getClientRects:HZ,getDimensions:GZ,getScale:Zc,isElement:Mi,isRTL:XZ};function iA(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function JZ(t,e,n){let r=null,s;const i=bo(t);function o(){var h;clearTimeout(s),(h=r)==null||h.disconnect(),r=null}function l(h,p){h===void 0&&(h=!1),p===void 0&&(p=1),o();const m=t.getBoundingClientRect(),{left:v,top:w,width:_,height:x}=m;if(h||e(),!_||!x)return;const b=zp(w),k=zp(i.clientWidth-(v+_)),C=zp(i.clientHeight-(w+x)),T=zp(v),M={rootMargin:-b+"px "+-k+"px "+-C+"px "+-T+"px",threshold:po(0,wa(1,p))||1};let R=!0;function A(L){const N=L[0].intersectionRatio;if(!iA(m,t.getBoundingClientRect()))return l();if(N!==p){if(!R)return l();N?l(!1,N):s=setTimeout(()=>{l(!1,1e-7)},1e3)}R=!1}try{r=new IntersectionObserver(A,{...M,root:i.ownerDocument})}catch{r=new IntersectionObserver(A,M)}r.observe(t)}const u=Vr(t),d=()=>l(n);return u.addEventListener("resize",d),l(!0),()=>{u.removeEventListener("resize",d),o()}}function eq(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=hx(t),h=s||i?[...d?kf(d):[],...e?kf(e):[]]:[];h.forEach(b=>{s&&b.addEventListener("scroll",n),i&&b.addEventListener("resize",n)});const p=d&&l?JZ(d,n,i):null;let m=-1,v=null;o&&(v=new ResizeObserver(b=>{let[k]=b;k&&k.target===d&&v&&e&&(v.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=v)==null||C.observe(e)})),n()}),d&&!u&&v.observe(d),e&&v.observe(e));let w,_=u?Vl(t):null;u&&x();function x(){const b=Vl(t);_&&!iA(_,b)&&n(),_=b,w=requestAnimationFrame(x)}return n(),()=>{var b;h.forEach(k=>{s&&k.removeEventListener("scroll",n),i&&k.removeEventListener("resize",n)}),p==null||p(),(b=v)==null||b.disconnect(),v=null,u&&cancelAnimationFrame(w)}}const tq=AZ,nq=RZ,rq=PZ,sq=OZ,iq=TZ,sk=CZ,oq=MZ,aq=(t,e,n)=>{const r=new Map,s=n??{},i={...QZ,...s.platform,_c:r};return kZ(t,e,{...s,platform:i})};var lq=typeof document<"u",cq=function(){},y0=lq?g.useLayoutEffect:cq;function hm(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!hm(t[r],e[r]))return!1;return!0}if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&t.$$typeof)&&!hm(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function oA(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function ik(t,e){const n=oA(t);return Math.round(e*n)/n}function J1(t){const e=g.useRef(t);return y0(()=>{e.current=t}),e}function uq(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:u,open:d}=t,[h,p]=g.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,v]=g.useState(r);hm(m,r)||v(r);const[w,_]=g.useState(null),[x,b]=g.useState(null),k=g.useCallback(V=>{V!==M.current&&(M.current=V,_(V))},[]),C=g.useCallback(V=>{V!==R.current&&(R.current=V,b(V))},[]),T=i||w,I=o||x,M=g.useRef(null),R=g.useRef(null),A=g.useRef(h),L=u!=null,N=J1(u),F=J1(s),j=J1(d),Q=g.useCallback(()=>{if(!M.current||!R.current)return;const V={placement:e,strategy:n,middleware:m};F.current&&(V.platform=F.current),aq(M.current,R.current,V).then(J=>{const B={...J,isPositioned:j.current!==!1};q.current&&!hm(A.current,B)&&(A.current=B,th.flushSync(()=>{p(B)}))})},[m,e,n,F,j]);y0(()=>{d===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,p(V=>({...V,isPositioned:!1})))},[d]);const q=g.useRef(!1);y0(()=>(q.current=!0,()=>{q.current=!1}),[]),y0(()=>{if(T&&(M.current=T),I&&(R.current=I),T&&I){if(N.current)return N.current(T,I,Q);Q()}},[T,I,Q,N,L]);const Z=g.useMemo(()=>({reference:M,floating:R,setReference:k,setFloating:C}),[k,C]),W=g.useMemo(()=>({reference:T,floating:I}),[T,I]),Y=g.useMemo(()=>{const V={position:n,left:0,top:0};if(!W.floating)return V;const J=ik(W.floating,h.x),B=ik(W.floating,h.y);return l?{...V,transform:"translate("+J+"px, "+B+"px)",...oA(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:B}},[n,l,W.floating,h.x,h.y]);return g.useMemo(()=>({...h,update:Q,refs:Z,elements:W,floatingStyles:Y}),[h,Q,Z,W,Y])}const dq=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:s}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?sk({element:r.current,padding:s}).fn(n):{}:r?sk({element:r,padding:s}).fn(n):{}}}},fq=(t,e)=>{const n=tq(t);return{name:n.name,fn:n.fn,options:[t,e]}},hq=(t,e)=>{const n=nq(t);return{name:n.name,fn:n.fn,options:[t,e]}},pq=(t,e)=>({fn:oq(t).fn,options:[t,e]}),mq=(t,e)=>{const n=rq(t);return{name:n.name,fn:n.fn,options:[t,e]}},gq=(t,e)=>{const n=sq(t);return{name:n.name,fn:n.fn,options:[t,e]}},vq=(t,e)=>{const n=iq(t);return{name:n.name,fn:n.fn,options:[t,e]}},yq=(t,e)=>{const n=dq(t);return{name:n.name,fn:n.fn,options:[t,e]}};var _q=Object.defineProperty,wq=(t,e)=>_q(t,"name",{value:e,configurable:!0});function px(t){const[e,n]=g.useState(void 0);return Fr(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,l;if("borderBoxSize"in i){const u=i.borderBoxSize,d=Array.isArray(u)?u[0]:u;o=d.inlineSize,l=d.blockSize}else o=t.offsetWidth,l=t.offsetHeight;n({width:o,height:l})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}wq(px,"useSize");var xq=Object.defineProperty,fa=(t,e)=>xq(t,"name",{value:e,configurable:!0}),aA="Popper",[lA,Zm]=Di(aA),[bq,cA]=lA(aA),Sq=fa(t=>{const{__scopePopper:e,children:n}=t,[r,s]=g.useState(null),[i,o]=g.useState(void 0);return S.jsx(bq,{scope:e,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:o,children:n})},"Popper"),Eq="PopperAnchor",kq=g.forwardRef(fa(function(e,n){const{__scopePopper:r,virtualRef:s,...i}=e,o=cA(Eq,r),l=g.useRef(null),u=o.onAnchorChange,d=g.useCallback(_=>{l.current=_,_&&u(_)},[u]),h=Zt(n,d),p=g.useRef(null);g.useEffect(()=>{if(!s)return;const _=p.current;p.current=s.current,_!==p.current&&u(p.current)});const m=o.placementState&&qm(o.placementState),v=m==null?void 0:m[0],w=m==null?void 0:m[1];return s?null:S.jsx(_n.div,{"data-radix-popper-side":v,"data-radix-popper-align":w,...i,ref:h})},"PopperAnchor")),uA="PopperContent",[Cq,Qne]=lA(uA),Pq=g.forwardRef(fa(function(e,n){var oe,je,Ce,We,at,it,Ot;const{__scopePopper:r,side:s="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:h=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:v=!1,updatePositionStrategy:w="optimized",onPlaced:_,...x}=e,b=cA(uA,r),[k,C]=g.useState(null),T=Zt(n,C),[I,M]=g.useState(null),R=px(I),A=(R==null?void 0:R.width)??0,L=(R==null?void 0:R.height)??0,N=s+(o!=="center"?"-"+o:""),F=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},j=Array.isArray(h)?h:[h],Q=j.length>0,q={padding:F,boundary:j.filter(dA),altBoundary:Q},{refs:Z,floatingStyles:W,placement:Y,isPositioned:V,middlewareData:J}=uq({strategy:"fixed",placement:N,whileElementsMounted:fa((...ht)=>eq(...ht,{animationFrame:w==="always"}),"whileElementsMounted"),elements:{reference:b.anchor},middleware:[fq({mainAxis:i+L,alignmentAxis:l}),d&&hq({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?pq():void 0,...q}),d&&mq({...q}),gq({...q,apply:fa(({elements:ht,rects:De,availableWidth:rt,availableHeight:Be})=>{const{width:ct,height:Re}=De.reference,Ze=ht.floating.style;Ze.setProperty("--radix-popper-available-width",`${rt}px`),Ze.setProperty("--radix-popper-available-height",`${Be}px`),Ze.setProperty("--radix-popper-anchor-width",`${ct}px`),Ze.setProperty("--radix-popper-anchor-height",`${Re}px`)},"apply")}),I&&yq({element:I,padding:u}),Tq({arrowWidth:A,arrowHeight:L}),v&&vq({strategy:"referenceHidden",...q,boundary:Q?q.boundary:void 0})]}),B=b.setPlacementState;Fr(()=>(B(Y),()=>{B(void 0)}),[Y,B]);const[D,X]=qm(Y),ce=jl(_);Fr(()=>{V&&(ce==null||ce())},[V,ce]);const se=(oe=J.arrow)==null?void 0:oe.x,re=(je=J.arrow)==null?void 0:je.y,de=((Ce=J.arrow)==null?void 0:Ce.centerOffset)!==0,[ye,fe]=g.useState();return Fr(()=>{k&&fe(window.getComputedStyle(k).zIndex)},[k]),S.jsx("div",{ref:Z.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:V?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ye,"--radix-popper-transform-origin":[(We=J.transformOrigin)==null?void 0:We.x,(at=J.transformOrigin)==null?void 0:at.y].join(" "),...((it=J.hide)==null?void 0:it.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:S.jsx(Cq,{scope:r,placedSide:D,placedAlign:X,onArrowChange:M,arrowX:se,arrowY:re,shouldHideArrow:de,children:S.jsx(_n.div,{"data-side":D,"data-align":X,...x,ref:T,style:{...x.style,animation:V?(Ot=x.style)==null?void 0:Ot.animation:"none"}})})})},"PopperContent"));function dA(t){return t!==null}fa(dA,"isNotNull");var Tq=fa(t=>({name:"transformOrigin",options:t,fn(e){var x,b,k;const{placement:n,rects:r,middlewareData:s}=e,o=((x=s.arrow)==null?void 0:x.centerOffset)!==0,l=o?0:t.arrowWidth,u=o?0:t.arrowHeight,[d,h]=qm(n),p={start:"0%",center:"50%",end:"100%"}[h],m=(((b=s.arrow)==null?void 0:b.x)??0)+l/2,v=(((k=s.arrow)==null?void 0:k.y)??0)+u/2;let w="",_="";return d==="bottom"?(w=o?p:`${m}px`,_=`${-u}px`):d==="top"?(w=o?p:`${m}px`,_=`${r.floating.height+u}px`):d==="right"?(w=`${-u}px`,_=o?p:`${v}px`):d==="left"&&(w=`${r.floating.width+u}px`,_=o?p:`${v}px`),{data:{x:w,y:_}}}}),"transformOrigin");function qm(t){const[e,n="center"]=t.split("-");return[e,n]}fa(qm,"getSideAndAlignFromPlacement");var fA=Sq,hA=kq,pA=Pq,Iq=Object.defineProperty,Ia=(t,e)=>Iq(t,"name",{value:e,configurable:!0}),mx="Popover",[mA,Jne]=Di(mx,[Zm]),gx=Zm(),[Aq,Lu]=mA(mx),Rq=Ia(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!1}=t,l=gx(e),u=g.useRef(null),[d,h]=g.useState(!1),[p,m]=Ca({prop:r,defaultProp:s??!1,onChange:i,caller:mx});return S.jsx(fA,{...l,children:S.jsx(Aq,{scope:e,contentId:da(),triggerRef:u,open:p,onOpenChange:m,onOpenToggle:g.useCallback(()=>m(v=>!v),[m]),hasCustomAnchor:d,onCustomAnchorAdd:g.useCallback(()=>h(!0),[]),onCustomAnchorRemove:g.useCallback(()=>h(!1),[]),modal:o,children:n})})},"Popover"),Mq="PopoverTrigger",Oq=g.forwardRef(Ia(function(e,n){const{__scopePopover:r,...s}=e,i=Lu(Mq,r),o=gx(r),l=Zt(n,i.triggerRef),u=S.jsx(_n.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":vx(i.open),...s,ref:l,onClick:Ut(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?u:S.jsx(hA,{asChild:!0,...o,children:u})},"PopoverTrigger")),gA="PopoverPortal",[Lq,Dq]=mA(gA,{forceMount:void 0}),Nq=Ia(t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=Lu(gA,e);return S.jsx(Lq,{scope:e,forceMount:n,children:S.jsx(Pa,{present:n||i.open,children:S.jsx(Xw,{asChild:!0,container:s,children:r})})})},"PopoverPortal"),Cf="PopoverContent",$q=g.forwardRef(Ia(function(e,n){const r=Dq(Cf,e.__scopePopover),{forceMount:s=r.forceMount,...i}=e,o=Lu(Cf,e.__scopePopover);return S.jsx(Pa,{present:s||o.open,children:o.modal?S.jsx(Fq,{...i,ref:n}):S.jsx(Vq,{...i,ref:n})})},"PopoverContent")),jq=_a("PopoverContent.RemoveScroll"),Fq=g.forwardRef(Ia(function(e,n){const r=Lu(Cf,e.__scopePopover),s=g.useRef(null),i=Zt(n,s),o=g.useRef(!1);return g.useEffect(()=>{const l=s.current;if(l)return WI(l)},[]),S.jsx(Jw,{as:jq,allowPinchZoom:!0,children:S.jsx(vA,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ut(e.onCloseAutoFocus,l=>{var u;l.preventDefault(),o.current||(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Ut(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,h=u.button===2||d;o.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:Ut(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),Vq=g.forwardRef(Ia(function(e,n){const r=Lu(Cf,e.__scopePopover),s=g.useRef(!1),i=g.useRef(!1);return S.jsx(vA,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(s.current||(u=r.triggerRef.current)==null||u.focus(),o.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:o=>{var d,h;(d=e.onInteractOutside)==null||d.call(e,o),o.defaultPrevented||(s.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((h=r.triggerRef.current)==null?void 0:h.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})},"PopoverContentNonModal")),vA=g.forwardRef(Ia(function(e,n){const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:p,...m}=e,v=Lu(Cf,r),w=gx(r);return Fm(),S.jsx(CI,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(Gw,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onDismiss:()=>v.onOpenChange(!1),deferPointerDownOutside:!0,children:S.jsx(pA,{"data-state":vx(v.open),role:"dialog",id:v.contentId,...w,...m,ref:n,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl"));function vx(t){return t?"open":"closed"}Ia(vx,"getState");var yx=Rq,_x=Oq,wx=Nq,xx=$q;const Hq=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),g.createElement("path",{d:"M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z"}))]]),zq=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M184,80V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H176A8,8,0,0,1,184,80Z",opacity:"0.2"}),g.createElement("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M192,136v72a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V80A16,16,0,0,1,48,64h72a8,8,0,0,1,0,16H48V208H176V136a8,8,0,0,1,16,0Zm32-96a8,8,0,0,0-8-8H152a8,8,0,0,0-5.66,13.66L172.69,72l-42.35,42.34a8,8,0,0,0,11.32,11.32L184,83.31l26.34,26.35A8,8,0,0,0,224,104Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M222,104a6,6,0,0,1-12,0V54.49l-69.75,69.75a6,6,0,0,1-8.48-8.48L201.51,46H152a6,6,0,0,1,0-12h64a6,6,0,0,1,6,6Zm-38,26a6,6,0,0,0-6,6v72a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V80a2,2,0,0,1,2-2h72a6,6,0,0,0,0-12H48A14,14,0,0,0,34,80V208a14,14,0,0,0,14,14H176a14,14,0,0,0,14-14V136A6,6,0,0,0,184,130Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M220,104a4,4,0,0,1-8,0V49.66l-73.16,73.17a4,4,0,0,1-5.66-5.66L206.34,44H152a4,4,0,0,1,0-8h64a4,4,0,0,1,4,4Zm-36,28a4,4,0,0,0-4,4v72a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V80a4,4,0,0,1,4-4h72a4,4,0,0,0,0-8H48A12,12,0,0,0,36,80V208a12,12,0,0,0,12,12H176a12,12,0,0,0,12-12V136A4,4,0,0,0,184,132Z"}))]]),Bq=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),g.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]),Uq=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),g.createElement("path",{d:"M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z"}))]]),Wq=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,20A108,108,0,0,0,31.85,177.23L21,209.66A20,20,0,0,0,46.34,235l32.43-10.81A108,108,0,1,0,128,20Zm0,192a84,84,0,0,1-42.06-11.27,12,12,0,0,0-6-1.62,12.1,12.1,0,0,0-3.8.62l-29.79,9.93,9.93-29.79a12,12,0,0,0-1-9.81A84,84,0,1,1,128,212Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128A96,96,0,0,1,79.93,211.11h0L42.54,223.58a8,8,0,0,1-10.12-10.12l12.47-37.39h0A96,96,0,1,1,224,128Z",opacity:"0.2"}),g.createElement("path",{d:"M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232,128A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,26A102,102,0,0,0,38.35,176.69L26.73,211.56a14,14,0,0,0,17.71,17.71l34.87-11.62A102,102,0,1,0,128,26Zm0,192a90,90,0,0,1-45.06-12.08,6.09,6.09,0,0,0-3-.81,6.2,6.2,0,0,0-1.9.31L40.65,217.88a2,2,0,0,1-2.53-2.53L50.58,178a6,6,0,0,0-.5-4.91A90,90,0,1,1,128,218Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,28A100,100,0,0,0,40.53,176.5l-11.9,35.69a12,12,0,0,0,15.18,15.18l35.69-11.9A100,100,0,1,0,128,28Zm0,192a92,92,0,0,1-46.07-12.35,4.05,4.05,0,0,0-2-.54,3.93,3.93,0,0,0-1.27.21L41.28,219.78a4,4,0,0,1-5.06-5.06l12.46-37.38a4,4,0,0,0-.33-3.27A92,92,0,1,1,128,220Z"}))]]),Zq=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z",opacity:"0.2"}),g.createElement("path",{d:"M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"}))]]),qq=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M236,128a108,108,0,0,1-216,0c0-42.52,24.73-81.34,63-98.9A12,12,0,1,1,93,50.91C63.24,64.57,44,94.83,44,128a84,84,0,0,0,168,0c0-33.17-19.24-63.43-49-77.09A12,12,0,1,1,173,29.1C211.27,46.66,236,85.48,236,128Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),g.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,176A72,72,0,0,1,92,65.64a8,8,0,0,1,8,13.85,56,56,0,1,0,56,0,8,8,0,0,1,8-13.85A72,72,0,0,1,128,200Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M230,128a102,102,0,0,1-204,0c0-40.18,23.35-76.86,59.5-93.45a6,6,0,0,1,5,10.9C58.61,60.09,38,92.49,38,128a90,90,0,0,0,180,0c0-35.51-20.61-67.91-52.5-82.55a6,6,0,0,1,5-10.9C206.65,51.14,230,87.82,230,128Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M228,128a100,100,0,0,1-200,0c0-39.4,22.9-75.37,58.33-91.63a4,4,0,1,1,3.34,7.27C57.07,58.6,36,91.71,36,128a92,92,0,0,0,184,0c0-36.29-21.07-69.4-53.67-84.36a4,4,0,1,1,3.34-7.27C205.1,52.63,228,88.6,228,128Z"}))]]),Gq=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,40V168H168V88H88V40Z",opacity:"0.2"}),g.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z"}))]]),Kq=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z",opacity:"0.2"}),g.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z"}))]]),Yq=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M248.23,112.31A20,20,0,0,0,232,104H220V88a20,20,0,0,0-20-20H132L105.34,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V208a12,12,0,0,0,12,12H211.1a12,12,0,0,0,11.33-8l28.49-81.47.06-.17A20,20,0,0,0,248.23,112.31ZM92,68l28.8,21.6A12,12,0,0,0,128,92h68v12H69.77a20,20,0,0,0-18.94,13.58L44,137.15V68ZM202.59,196H48.89l23.72-68H226.37Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,88v24H69.77a8,8,0,0,0-7.59,5.47L32,208V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h72A8,8,0,0,1,208,88Z",opacity:"0.2"}),g.createElement("path",{d:"M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Zm112,136H43.1l26.67-80H232Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208h0a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M243.36,111.81A14,14,0,0,0,232,106H214V88a14,14,0,0,0-14-14H130L101.74,52.8a14.06,14.06,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V208a6,6,0,0,0,6,6H211.1a6,6,0,0,0,5.69-4.1l28.49-85.47A14,14,0,0,0,243.36,111.81ZM40,62H93.34a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h72a2,2,0,0,1,2,2v18H69.77a14,14,0,0,0-13.28,9.57L38,171V64A2,2,0,0,1,40,62Zm193.9,58.63L206.78,202H40.33l27.54-82.63a2,2,0,0,1,1.9-1.37H232a2,2,0,0,1,1.9,2.63Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208h0a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Zm112,136H43.1l26.67-80H232Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M241.72,113a11.88,11.88,0,0,0-9.73-5H212V88a12,12,0,0,0-12-12H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V208a4,4,0,0,0,4,4H211.09a4,4,0,0,0,3.79-2.74l28.49-85.47A11.86,11.86,0,0,0,241.72,113ZM40,60H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h72a4,4,0,0,1,4,4v20H69.76a12,12,0,0,0-11.38,8.21L36,183.35V64A4,4,0,0,1,40,60Zm195.78,61.26L208.2,204H37.55L66,118.74A4,4,0,0,1,69.76,116H232a4,4,0,0,1,3.79,5.26Z"}))]]),Xq=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,68H132L105.33,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V200a20,20,0,0,0,20,20H216.89A19.13,19.13,0,0,0,236,200.89V88A20,20,0,0,0,216,68Zm-4,128H44V68H92l28.8,21.6A12,12,0,0,0,128,92h84Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,88V200.89a7.11,7.11,0,0,1-7.11,7.11H40a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h88A8,8,0,0,1,224,88Z",opacity:"0.2"}),g.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232,88V200.89A15.13,15.13,0,0,1,216.89,216H40a16,16,0,0,1-16-16V64A16,16,0,0,1,40,48H93.33a16.12,16.12,0,0,1,9.6,3.2L130.67,72H216A16,16,0,0,1,232,88Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,74H130L101.73,52.8a14,14,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V200a14,14,0,0,0,14,14H216.89A13.12,13.12,0,0,0,230,200.89V88A14,14,0,0,0,216,74Zm2,126.89a1.11,1.11,0,0,1-1.11,1.11H40a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H93.33a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h88a2,2,0,0,1,2,2Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,76H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V200a12,12,0,0,0,12,12H216.89A11.12,11.12,0,0,0,228,200.89V88A12,12,0,0,0,216,76Zm4,124.89a3.12,3.12,0,0,1-3.11,3.11H40a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h88a4,4,0,0,1,4,4Z"}))]]),Qq=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),g.createElement("path",{d:"M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z"}))]]),Jq=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),g.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z"}))]]),eG=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M238.15,78.54,177.46,17.86a20,20,0,0,0-28.3,0L97.2,70c-12.43-3.33-36.68-5.72-61.74,14.5a20,20,0,0,0-1.6,29.73l45.46,45.47-39.8,39.8a12,12,0,0,0,17,17l39.8-39.81,45.47,45.46A20,20,0,0,0,155.91,228c.46,0,.93,0,1.4-.05A20,20,0,0,0,171.87,220c4.69-6.23,11-16.13,14.44-28s3.45-22.88.16-33.4l51.7-51.87A20,20,0,0,0,238.15,78.54Zm-74.26,68.79a12,12,0,0,0-2.23,13.84c3.43,6.86,6.9,21-6.28,40.65L54.08,100.53c21.09-14.59,39.53-6.64,41-6a11.67,11.67,0,0,0,13.81-2.29l54.43-54.61,55,55Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M229.66,98.34,172.39,155.8c11.46,22.93-1.72,45.86-10.11,57a8,8,0,0,1-12,.83L42.34,105.76A8,8,0,0,1,43,93.85c29.65-23.92,57.4-10,57.4-10l57.27-57.46a8,8,0,0,1,11.31,0L229.66,87A8,8,0,0,1,229.66,98.34Z",opacity:"0.2"}),g.createElement("path",{d:"M235.32,81.37,174.63,20.69a16,16,0,0,0-22.63,0L98.37,74.49c-10.66-3.34-35-7.37-60.4,13.14a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33c19.64-26.1,17.75-47.32,13.19-60L235.33,104A16,16,0,0,0,235.32,81.37ZM224,92.69h0l-57.27,57.46a8,8,0,0,0-1.49,9.22c9.46,18.93-1.8,38.59-9.34,48.62L48,100.08c12.08-9.74,23.64-12.31,32.48-12.31A40.13,40.13,0,0,1,96.81,91a8,8,0,0,0,9.25-1.51L163.32,32,224,92.68Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M235.33,104l-53.47,53.65c4.56,12.67,6.45,33.89-13.19,60A15.93,15.93,0,0,1,157,224c-.38,0-.75,0-1.13,0a16,16,0,0,1-11.32-4.69L96.29,171,53.66,213.66a8,8,0,0,1-11.32-11.32L85,159.71l-48.3-48.3A16,16,0,0,1,38,87.63c25.42-20.51,49.75-16.48,60.4-13.14L152,20.7a16,16,0,0,1,22.63,0l60.69,60.68A16,16,0,0,1,235.33,104Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M233.91,82.79,173.22,22.1a14,14,0,0,0-19.81,0L98.93,76.77c-9.52-3.25-34-8.34-59.71,12.41A14,14,0,0,0,38.1,110l49.71,49.71-44.05,44a6,6,0,1,0,8.48,8.48l44.05-44.05L146,217.89a14,14,0,0,0,9.9,4.11q.49,0,1,0a14,14,0,0,0,10.19-5.54c19.72-26.21,17.15-47.23,12.46-59.3l54.37-54.55A14,14,0,0,0,233.91,82.79ZM225.42,94.1h0l-57.27,57.46a6,6,0,0,0-1.11,6.92c9.94,19.88-1.71,40.32-9.54,50.72a2,2,0,0,1-3,.2L46.58,101.51a2,2,0,0,1,.18-3c12.5-10.09,24.5-12.76,33.7-12.76a42.13,42.13,0,0,1,17.25,3.41A6,6,0,0,0,104.64,88L161.9,30.59a2,2,0,0,1,2.83,0l60.69,60.68A2,2,0,0,1,225.42,94.1Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M235.32,81.37,174.63,20.69a16,16,0,0,0-22.63,0L98.37,74.49c-10.66-3.34-35-7.37-60.4,13.14a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33c19.64-26.1,17.75-47.32,13.19-60L235.33,104A16,16,0,0,0,235.32,81.37ZM224,92.69h0l-57.27,57.46a8,8,0,0,0-1.49,9.22c9.46,18.93-1.8,38.59-9.34,48.62L48,100.08c12.08-9.74,23.64-12.31,32.48-12.31A40.13,40.13,0,0,1,96.81,91a8,8,0,0,0,9.25-1.51L163.32,32,224,92.68Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M232.49,84.2,171.8,23.51a12,12,0,0,0-17,0L99.45,79.07c-8.08-3-32.79-9.45-59,11.67a12,12,0,0,0-1,17.84l51.13,51.13L45.17,205.17a4,4,0,0,0,5.66,5.66l45.46-45.47,51.12,51.12A12,12,0,0,0,155.9,220c.28,0,.57,0,.85,0a12,12,0,0,0,8.73-4.74c19.83-26.36,16.51-47.18,11.71-58.57l55.3-55.49A12,12,0,0,0,232.49,84.2Zm-5.66,11.31h0L169.56,153a4,4,0,0,0-.75,4.61c10.43,20.85-1.62,42-9.73,52.83a4,4,0,0,1-6,.4L45.17,102.93a4,4,0,0,1,.33-6C58.44,86.53,70.86,83.74,80.44,83.74A43.9,43.9,0,0,1,98.6,87.38a4,4,0,0,0,4.62-.75l57.27-57.46a4,4,0,0,1,5.66,0l60.68,60.69A4,4,0,0,1,226.83,95.51Z"}))]]),tG=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,60H76V196H44ZM212,196H100V60H212Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z",opacity:"0.2"}),g.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,160H88V56H216V200Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM38,200V56a2,2,0,0,1,2-2H82V202H40A2,2,0,0,1,38,200Zm180,0a2,2,0,0,1-2,2H94V54H216a2,2,0,0,1,2,2Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM36,200V56a4,4,0,0,1,4-4H84V204H40A4,4,0,0,1,36,200Zm184,0a4,4,0,0,1-4,4H92V52H216a4,4,0,0,1,4,4Z"}))]]),nG=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M124,216a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V40A12,12,0,0,1,48,28h64a12,12,0,0,1,0,24H60V204h52A12,12,0,0,1,124,216Zm108.49-96.49-40-40a12,12,0,0,0-17,17L195,116H112a12,12,0,0,0,0,24h83l-19.52,19.51a12,12,0,0,0,17,17l40-40A12,12,0,0,0,232.49,119.51Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z",opacity:"0.2"}),g.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40A8,8,0,0,0,176,88v32H112a8,8,0,0,0,0,16h64v32a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,229.66,122.34Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M116,216a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H52V212h60A4,4,0,0,1,116,216Zm110.83-90.83-40-40a4,4,0,0,0-5.66,5.66L214.34,124H112a4,4,0,0,0,0,8H214.34l-33.17,33.17a4,4,0,0,0,5.66,5.66l40-40A4,4,0,0,0,226.83,125.17Z"}))]]),rG=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M199,125.31l-49.88-18.39L130.69,57a19.92,19.92,0,0,0-37.38,0L74.92,106.92,25,125.31a19.92,19.92,0,0,0,0,37.38l49.88,18.39L93.31,231a19.92,19.92,0,0,0,37.38,0l18.39-49.88L199,162.69a19.92,19.92,0,0,0,0-37.38Zm-63.38,35.16a12,12,0,0,0-7.11,7.11L112,212.28l-16.47-44.7a12,12,0,0,0-7.11-7.11L43.72,144l44.7-16.47a12,12,0,0,0,7.11-7.11L112,75.72l16.47,44.7a12,12,0,0,0,7.11,7.11L180.28,144ZM140,40a12,12,0,0,1,12-12h12V16a12,12,0,0,1,24,0V28h12a12,12,0,0,1,0,24H188V64a12,12,0,0,1-24,0V52H152A12,12,0,0,1,140,40ZM252,88a12,12,0,0,1-12,12h-4v4a12,12,0,0,1-24,0v-4h-4a12,12,0,0,1,0-24h4V72a12,12,0,0,1,24,0v4h4A12,12,0,0,1,252,88Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M194.82,151.43l-55.09,20.3-20.3,55.09a7.92,7.92,0,0,1-14.86,0l-20.3-55.09-55.09-20.3a7.92,7.92,0,0,1,0-14.86l55.09-20.3,20.3-55.09a7.92,7.92,0,0,1,14.86,0l20.3,55.09,55.09,20.3A7.92,7.92,0,0,1,194.82,151.43Z",opacity:"0.2"}),g.createElement("path",{d:"M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M196.89,130.94,144.4,111.6,125.06,59.11a13.92,13.92,0,0,0-26.12,0L79.6,111.6,27.11,130.94a13.92,13.92,0,0,0,0,26.12L79.6,176.4l19.34,52.49a13.92,13.92,0,0,0,26.12,0L144.4,176.4l52.49-19.34a13.92,13.92,0,0,0,0-26.12Zm-4.15,14.86-55.08,20.3a6,6,0,0,0-3.56,3.56l-20.3,55.08a1.92,1.92,0,0,1-3.6,0L89.9,169.66a6,6,0,0,0-3.56-3.56L31.26,145.8a1.92,1.92,0,0,1,0-3.6l55.08-20.3a6,6,0,0,0,3.56-3.56l20.3-55.08a1.92,1.92,0,0,1,3.6,0l20.3,55.08a6,6,0,0,0,3.56,3.56l55.08,20.3a1.92,1.92,0,0,1,0,3.6ZM146,40a6,6,0,0,1,6-6h18V16a6,6,0,0,1,12,0V34h18a6,6,0,0,1,0,12H182V64a6,6,0,0,1-12,0V46H152A6,6,0,0,1,146,40ZM246,88a6,6,0,0,1-6,6H230v10a6,6,0,0,1-12,0V94H208a6,6,0,0,1,0-12h10V72a6,6,0,0,1,12,0V82h10A6,6,0,0,1,246,88Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M196.2,132.81l-53.36-19.65L123.19,59.8a11.93,11.93,0,0,0-22.38,0L81.16,113.16,27.8,132.81a11.93,11.93,0,0,0,0,22.38l53.36,19.65,19.65,53.36a11.93,11.93,0,0,0,22.38,0l19.65-53.36,53.36-19.65a11.93,11.93,0,0,0,0-22.38Zm-2.77,14.87L138.35,168a4,4,0,0,0-2.37,2.37l-20.3,55.08a3.92,3.92,0,0,1-7.36,0L88,170.35A4,4,0,0,0,85.65,168l-55.08-20.3a3.92,3.92,0,0,1,0-7.36L85.65,120A4,4,0,0,0,88,117.65l20.3-55.08a3.92,3.92,0,0,1,7.36,0L136,117.65a4,4,0,0,0,2.37,2.37l55.08,20.3a3.92,3.92,0,0,1,0,7.36ZM148,40a4,4,0,0,1,4-4h20V16a4,4,0,0,1,8,0V36h20a4,4,0,0,1,0,8H180V64a4,4,0,0,1-8,0V44H152A4,4,0,0,1,148,40Zm96,48a4,4,0,0,1-4,4H228v12a4,4,0,0,1-8,0V92H208a4,4,0,0,1,0-8h12V72a4,4,0,0,1,8,0V84h12A4,4,0,0,1,244,88Z"}))]]),sG=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M100,36H56A20,20,0,0,0,36,56v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V56A20,20,0,0,0,100,36ZM96,96H60V60H96ZM200,36H156a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,60H160V60h36Zm-96,40H56a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V156A20,20,0,0,0,100,136Zm-4,60H60V160H96Zm104-60H156a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V156A20,20,0,0,0,200,136Zm-4,60H160V160h36Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M112,56v48a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8h48A8,8,0,0,1,112,56Zm88-8H152a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V56A8,8,0,0,0,200,48Zm-96,96H56a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V152A8,8,0,0,0,104,144Zm96,0H152a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V152A8,8,0,0,0,200,144Z",opacity:"0.2"}),g.createElement("path",{d:"M200,136H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48ZM104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M120,56v48a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40h48A16,16,0,0,1,120,56Zm80-16H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm-96,96H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm96,0H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M104,42H56A14,14,0,0,0,42,56v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V56A14,14,0,0,0,104,42Zm2,62a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm94-62H152a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,62a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm-98,34H56a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V152A14,14,0,0,0,104,138Zm2,62a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm94-62H152a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V152A14,14,0,0,0,200,138Zm2,62a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M104,44H56A12,12,0,0,0,44,56v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V56A12,12,0,0,0,104,44Zm4,60a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Zm92-60H152a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,60a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4ZM104,140H56a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V152A12,12,0,0,0,104,140Zm4,60a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Zm92-60H152a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V152A12,12,0,0,0,200,140Zm4,60a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Z"}))]]),iG=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M242.79,149.32,223.7,97.11A20,20,0,0,0,198.12,85.2l-61.31,22.22L147.7,45.18A20,20,0,0,0,131.55,22L76.87,12.31A19.94,19.94,0,0,0,53.76,28.55l-25,143.13A48,48,0,0,0,67.4,227.26a51.19,51.19,0,0,0,8.7.74H224a20,20,0,0,0,20-20V156.19A21.74,21.74,0,0,0,242.79,149.32ZM99,184.18a23.84,23.84,0,0,1-9.86,15.56,23.28,23.28,0,0,1-17.56,3.89,24,24,0,0,1-19.23-27.82L76.71,36.66,123.37,45,99,184.18Zm23.64,4.13,9.39-53.64,70.49-25.54,16.3,44.59-96.23,34.87C122.62,188.5,122.65,188.41,122.66,188.31ZM220,204H150.52L220,178.82ZM89.22,174.07l-1.4,8A12,12,0,0,1,76,192a12.35,12.35,0,0,1-2.08-.18,12,12,0,0,1-9.75-13.89l1.4-8a12,12,0,0,1,23.64,4.14Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M135.88,43.11l-25,143.14a35.71,35.71,0,0,1-41.34,29.2h0a36,36,0,0,1-28.95-41.71l25-143.13a8,8,0,0,1,9.19-6.49l54.67,9.73A8,8,0,0,1,135.88,43.11Z",opacity:"0.2"}),g.createElement("path",{d:"M88,180a12,12,0,1,1-12-12A12,12,0,0,1,88,180Zm152-23.81V208a16,16,0,0,1-16,16H76a46.36,46.36,0,0,1-7.94-.68,44,44,0,0,1-35.43-50.95l25-143.13a15.94,15.94,0,0,1,18.47-13L130.84,26a16,16,0,0,1,12.92,18.52l-12.08,69L199.49,89a16,16,0,0,1,20.45,9.52L239,150.69A18.35,18.35,0,0,1,240,156.19ZM103,184.87,128,41.74,73.46,32l-25,143.1A28,28,0,0,0,70.9,207.57,27.29,27.29,0,0,0,91.46,203,27.84,27.84,0,0,0,103,184.87ZM116.78,195,224,156.11,204.92,104,128.5,131.7l-9.78,55.92A44.63,44.63,0,0,1,116.78,195ZM224,173.12,127.74,208H224Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M240,155.91a16,16,0,0,0-1-5.22L219.94,98.48A16,16,0,0,0,199.49,89l-67.81,24.57,12.08-69A16,16,0,0,0,130.84,26L76.17,16.25a15.94,15.94,0,0,0-18.47,13l-25,143.12A43.82,43.82,0,0,0,75.78,224H224a16,16,0,0,0,16-16ZM76,196a16,16,0,1,1,16-16A16,16,0,0,1,76,196Zm42.72-8.38,9.78-55.92L204.92,104,224,156.11,116.78,195A44.89,44.89,0,0,0,118.72,187.62ZM224,208H127.74L224,173.11Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M86,180a10,10,0,1,1-10-10A10,10,0,0,1,86,180Zm152-23.81V208a14,14,0,0,1-14,14H76a44.18,44.18,0,0,1-7.58-.65,42,42,0,0,1-33.81-48.64l25-143.13A13.94,13.94,0,0,1,75.82,18.22l54.67,9.72a14,14,0,0,1,11.3,16.21l-12.67,72.44,71-25.75a14,14,0,0,1,17.89,8.32l19.09,52.22A15.66,15.66,0,0,1,238,156.19Zm-133.07,29L130,42.08a2,2,0,0,0-1.58-2.32L73.72,30l-.34,0a1.84,1.84,0,0,0-1.07.35,2,2,0,0,0-.82,1.3l-25,143.13a30,30,0,0,0,24.09,34.76,29.25,29.25,0,0,0,22-4.89,29.81,29.81,0,0,0,12.33-19.44Zm8.25,13.17L224.71,158a2,2,0,0,0,1.11-1,1.86,1.86,0,0,0,.06-1.46l-19.09-52.21a2,2,0,0,0-2.53-1.17l-77.53,28.09-10,57.07A41.9,41.9,0,0,1,113.18,198.38ZM226,170.27,116.35,210H224a2,2,0,0,0,2-2Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M88,180a12,12,0,1,1-12-12A12,12,0,0,1,88,180Zm152-23.81V208a16,16,0,0,1-16,16H76a46.36,46.36,0,0,1-7.94-.68,44,44,0,0,1-35.43-50.95l25-143.13a15.94,15.94,0,0,1,18.47-13L130.84,26a16,16,0,0,1,12.92,18.52l-12.08,69L199.49,89a16,16,0,0,1,20.45,9.52L239,150.69A18.35,18.35,0,0,1,240,156.19ZM103,184.87,128,41.74,73.46,32l-25,143.1A28,28,0,0,0,70.9,207.57,27.29,27.29,0,0,0,91.46,203,27.84,27.84,0,0,0,103,184.87ZM116.78,195,224,156.11,204.92,104,128.5,131.7l-9.78,55.92A44.63,44.63,0,0,1,116.78,195ZM224,173.12,127.74,208H224Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M235.27,152.07,216.19,99.85a12,12,0,0,0-15.34-7.13l-74.3,26.92,13.27-75.83a12,12,0,0,0-9.68-13.9L75.47,20.19a11.75,11.75,0,0,0-8.89,2,11.9,11.9,0,0,0-4.94,7.77l-25,143.13A40,40,0,0,0,68.8,219.39,42.68,42.68,0,0,0,76,220H224a12,12,0,0,0,12-12V156.19A14,14,0,0,0,235.27,152.07Zm-31.7-51.83a4,4,0,0,1,5.1,2.36l19.09,52.21a3.9,3.9,0,0,1-.13,3,3.94,3.94,0,0,1-2.24,2L108.78,202.11a40,40,0,0,0,6-15.17L125,128.73ZM93.75,206.29a31.25,31.25,0,0,1-23.55,5.22,32,32,0,0,1-25.71-37.08l25-143.13a4,4,0,0,1,1.64-2.59A3.85,3.85,0,0,1,73.38,28a4,4,0,0,1,.69.06l54.67,9.73a4,4,0,0,1,3.2,4.64l-25,143.13h0A31.79,31.79,0,0,1,93.75,206.29ZM228,208a4,4,0,0,1-4,4H105l123-44.59ZM84,180a8,8,0,1,1-8-8A8,8,0,0,1,84,180Z"}))]]),oG=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),g.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z"}))]]),aG=new Map([["bold",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"}))],["duotone",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),g.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["fill",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["light",g.createElement(g.Fragment,null,g.createElement("path",{d:"M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"}))],["regular",g.createElement(g.Fragment,null,g.createElement("path",{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"}))],["thin",g.createElement(g.Fragment,null,g.createElement("path",{d:"M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"}))]]),lG=g.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),hn=g.forwardRef((t,e)=>{const{alt:n,color:r,size:s,weight:i,mirrored:o,children:l,weights:u,...d}=t,{color:h="currentColor",size:p,weight:m="regular",mirrored:v=!1,...w}=g.useContext(lG);return g.createElement("svg",{ref:e,xmlns:"http://www.w3.org/2000/svg",width:s??p,height:s??p,fill:r??h,viewBox:"0 0 256 256",transform:o||v?"scale(-1, 1)":void 0,...w,...d},!!n&&g.createElement("title",null,n),l,u.get(i??m))});hn.displayName="IconBase";const yA=g.forwardRef((t,e)=>g.createElement(hn,{ref:e,...t,weights:Hq}));yA.displayName="ArrowLeftIcon";const cG=yA,_A=g.forwardRef((t,e)=>g.createElement(hn,{ref:e,...t,weights:zq}));_A.displayName="ArrowSquareOutIcon";const uG=_A,wA=g.forwardRef((t,e)=>g.createElement(hn,{ref:e,...t,weights:Bq}));wA.displayName="ArrowUpIcon";const dG=wA,xA=g.forwardRef((t,e)=>g.createElement(hn,{ref:e,...t,weights:Uq}));xA.displayName="CaretDownIcon";const fG=xA,bA=g.forwardRef((t,e)=>g.createElement(hn,{ref:e,...t,weights:Wq}));bA.displayName="ChatCircleIcon";const hG=bA,SA=g.forwardRef((t,e)=>g.createElement(hn,{ref:e,...t,weights:Zq}));SA.displayName="CheckIcon";const EA=SA,kA=g.forwardRef((t,e)=>g.createElement(hn,{ref:e,...t,weights:qq}));kA.displayName="CircleNotchIcon";const Gm=kA,CA=g.forwardRef((t,e)=>g.createElement(hn,{ref:e,...t,weights:Gq}));CA.displayName="CopyIcon";const Pf=CA,PA=g.forwardRef((t,e)=>g.createElement(hn,{ref:e,...t,weights:Kq}));PA.displayName="DotsThreeIcon";const pG=PA,TA=g.forwardRef((t,e)=>g.createElement(hn,{ref:e,...t,weights:Yq}));TA.displayName="FolderOpenIcon";const mG=TA,IA=g.forwardRef((t,e)=>g.createElement(hn,{ref:e,...t,weights:Xq}));IA.displayName="FolderSimpleIcon";const gG=IA,AA=g.forwardRef((t,e)=>g.createElement(hn,{ref:e,...t,weights:Qq}));AA.displayName="MagnifyingGlassIcon";const vG=AA,RA=g.forwardRef((t,e)=>g.createElement(hn,{ref:e,...t,weights:Jq}));RA.displayName="PencilSimpleIcon";const MA=RA,OA=g.forwardRef((t,e)=>g.createElement(hn,{ref:e,...t,weights:eG}));OA.displayName="PushPinIcon";const LA=OA,DA=g.forwardRef((t,e)=>g.createElement(hn,{ref:e,...t,weights:tG}));DA.displayName="SidebarSimpleIcon";const yG=DA,NA=g.forwardRef((t,e)=>g.createElement(hn,{ref:e,...t,weights:nG}));NA.displayName="SignOutIcon";const _G=NA,$A=g.forwardRef((t,e)=>g.createElement(hn,{ref:e,...t,weights:rG}));$A.displayName="SparkleIcon";const ey=$A,jA=g.forwardRef((t,e)=>g.createElement(hn,{ref:e,...t,weights:sG}));jA.displayName="SquaresFourIcon";const wG=jA,FA=g.forwardRef((t,e)=>g.createElement(hn,{ref:e,...t,weights:iG}));FA.displayName="SwatchesIcon";const VA=FA,HA=g.forwardRef((t,e)=>g.createElement(hn,{ref:e,...t,weights:oG}));HA.displayName="TrashIcon";const zA=HA,BA=g.forwardRef((t,e)=>g.createElement(hn,{ref:e,...t,weights:aG}));BA.displayName="XIcon";const UA=BA;function WA(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=WA(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function xG(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=WA(t))&&(r&&(r+=" "),r+=e);return r}const bG=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},SG=(t,e)=>({classGroupId:t,validator:e}),ZA=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),pm="-",ok=[],EG="arbitrary..",kG=t=>{const e=PG(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return CG(o);const l=o.split(pm),u=l[0]===""&&l.length>1?1:0;return qA(l,u,e)},getConflictingClassGroupIds:(o,l)=>{if(l){const u=r[o],d=n[o];return u?d?bG(d,u):u:d||ok}return n[o]||ok}}},qA=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const d=qA(t,e+1,i);if(d)return d}const o=n.validators;if(o===null)return;const l=e===0?t.join(pm):t.slice(e).join(pm),u=o.length;for(let d=0;d<u;d++){const h=o[d];if(h.validator(l))return h.classGroupId}},CG=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?EG+r:void 0})(),PG=t=>{const{theme:e,classGroups:n}=t;return TG(n,e)},TG=(t,e)=>{const n=ZA();for(const r in t){const s=t[r];bx(s,n,r,e)}return n},bx=(t,e,n,r)=>{const s=t.length;for(let i=0;i<s;i++){const o=t[i];IG(o,e,n,r)}},IG=(t,e,n,r)=>{if(typeof t=="string"){AG(t,e,n);return}if(typeof t=="function"){RG(t,e,n,r);return}MG(t,e,n,r)},AG=(t,e,n)=>{const r=t===""?e:GA(e,t);r.classGroupId=n},RG=(t,e,n,r)=>{if(OG(t)){bx(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(SG(n,t))},MG=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let o=0;o<i;o++){const[l,u]=s[o];bx(u,GA(e,l),n,r)}},GA=(t,e)=>{let n=t;const r=e.split(pm),s=r.length;for(let i=0;i<s;i++){const o=r[i];let l=n.nextPart.get(o);l||(l=ZA(),n.nextPart.set(o,l)),n=l}return n},OG=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,LG=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const s=(i,o)=>{n[i]=o,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(i){let o=n[i];if(o!==void 0)return o;if((o=r[i])!==void 0)return s(i,o),o},set(i,o){i in n?n[i]=o:s(i,o)}}},o2="!",ak=":",DG=[],lk=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),NG=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let o=0,l=0,u=0,d;const h=s.length;for(let _=0;_<h;_++){const x=s[_];if(o===0&&l===0){if(x===ak){i.push(s.slice(u,_)),u=_+1;continue}if(x==="/"){d=_;continue}}x==="["?o++:x==="]"?o--:x==="("?l++:x===")"&&l--}const p=i.length===0?s:s.slice(u);let m=p,v=!1;p.endsWith(o2)?(m=p.slice(0,-1),v=!0):p.startsWith(o2)&&(m=p.slice(1),v=!0);const w=d&&d>u?d-u:void 0;return lk(i,v,m,w)};if(e){const s=e+ak,i=r;r=o=>o.startsWith(s)?i(o.slice(s.length)):lk(DG,!1,o,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},$G=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let i=0;i<n.length;i++){const o=n[i],l=o[0]==="[",u=e.has(o);l||u?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(o)):s.push(o)}return s.length>0&&(s.sort(),r.push(...s)),r}},jG=t=>({cache:LG(t.cacheSize),parseClassName:NG(t),sortModifiers:$G(t),postfixLookupClassGroupIds:FG(t),...kG(t)}),FG=t=>{const e=Object.create(null),n=t.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)e[n[r]]=!0;return e},VG=/\s+/,HG=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:o}=e,l=[],u=t.trim().split(VG);let d="";for(let h=u.length-1;h>=0;h-=1){const p=u[h],{isExternal:m,modifiers:v,hasImportantModifier:w,baseClassName:_,maybePostfixModifierPosition:x}=n(p);if(m){d=p+(d.length>0?" "+d:d);continue}let b=!!x,k;if(b){const R=_.substring(0,x);k=r(R);const A=k&&o[k]?r(_):void 0;A&&A!==k&&(k=A,b=!1)}else k=r(_);if(!k){if(!b){d=p+(d.length>0?" "+d:d);continue}if(k=r(_),!k){d=p+(d.length>0?" "+d:d);continue}b=!1}const C=v.length===0?"":v.length===1?v[0]:i(v).join(":"),T=w?C+o2:C,I=T+k;if(l.indexOf(I)>-1)continue;l.push(I);const M=s(k,b);for(let R=0;R<M.length;++R){const A=M[R];l.push(T+A)}d=p+(d.length>0?" "+d:d)}return d},zG=(...t)=>{let e=0,n,r,s="";for(;e<t.length;)(n=t[e++])&&(r=KA(n))&&(s&&(s+=" "),s+=r);return s},KA=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=KA(t[r]))&&(n&&(n+=" "),n+=e);return n},BG=(t,...e)=>{let n,r,s,i;const o=u=>{const d=e.reduce((h,p)=>p(h),t());return n=jG(d),r=n.cache.get,s=n.cache.set,i=l,l(u)},l=u=>{const d=r(u);if(d)return d;const h=HG(u,n);return s(u,h),h};return i=o,(...u)=>i(zG(...u))},UG=[],On=t=>{const e=n=>n[t]||UG;return e.isThemeGetter=!0,e.themeKey=t,e},YA=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,XA=/^\((?:(\w[\w-]*):)?(.+)\)$/i,WG=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ZG=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qG=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,GG=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,KG=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,YG=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Wo=t=>WG.test(t),lt=t=>!!t&&!Number.isNaN(Number(t)),pi=t=>!!t&&Number.isInteger(Number(t)),ty=t=>t.endsWith("%")&&lt(t.slice(0,-1)),Ki=t=>ZG.test(t),QA=()=>!0,XG=t=>qG.test(t)&&!GG.test(t),Sx=()=>!1,QG=t=>KG.test(t),JG=t=>YG.test(t),eK=t=>!Ae(t)&&!Oe(t),tK=t=>t.startsWith("@container")&&(t[10]==="/"&&t[11]!==void 0||t[11]==="s"&&t[16]!==void 0&&t.startsWith("-size/",10)||t[11]==="n"&&t[18]!==void 0&&t.startsWith("-normal/",10)),nK=t=>Aa(t,tR,Sx),Ae=t=>YA.test(t),sl=t=>Aa(t,nR,XG),ck=t=>Aa(t,uK,lt),rK=t=>Aa(t,sR,QA),sK=t=>Aa(t,rR,Sx),uk=t=>Aa(t,JA,Sx),iK=t=>Aa(t,eR,JG),Bp=t=>Aa(t,iR,QG),Oe=t=>XA.test(t),Rd=t=>zl(t,nR),oK=t=>zl(t,rR),dk=t=>zl(t,JA),aK=t=>zl(t,tR),lK=t=>zl(t,eR),Up=t=>zl(t,iR,!0),cK=t=>zl(t,sR,!0),Aa=(t,e,n)=>{const r=YA.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},zl=(t,e,n=!1)=>{const r=XA.exec(t);return r?r[1]?e(r[1]):n:!1},JA=t=>t==="position"||t==="percentage",eR=t=>t==="image"||t==="url",tR=t=>t==="length"||t==="size"||t==="bg-size",nR=t=>t==="length",uK=t=>t==="number",rR=t=>t==="family-name",sR=t=>t==="number"||t==="weight",iR=t=>t==="shadow",dK=()=>{const t=On("color"),e=On("font"),n=On("text"),r=On("font-weight"),s=On("tracking"),i=On("leading"),o=On("breakpoint"),l=On("container"),u=On("spacing"),d=On("radius"),h=On("shadow"),p=On("inset-shadow"),m=On("text-shadow"),v=On("drop-shadow"),w=On("blur"),_=On("perspective"),x=On("aspect"),b=On("ease"),k=On("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],I=()=>[...T(),Oe,Ae],M=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],A=()=>[Oe,Ae,u],L=()=>[Wo,"full","auto",...A()],N=()=>[pi,"none","subgrid",Oe,Ae],F=()=>["auto",{span:["full",pi,Oe,Ae]},pi,Oe,Ae],j=()=>[pi,"auto",Oe,Ae],Q=()=>["auto","min","max","fr",Oe,Ae],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],W=()=>["auto",...A()],Y=()=>[Wo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],V=()=>[l,Wo,"screen","full","dvw","lvw","svw","min","max","fit",...A()],J=()=>[Wo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],B=()=>[t,Oe,Ae],D=()=>[...T(),dk,uk,{position:[Oe,Ae]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ce=()=>["auto","cover","contain",aK,nK,{size:[Oe,Ae]}],se=()=>[ty,Rd,sl],re=()=>["","none","full",d,Oe,Ae],de=()=>["",lt,Rd,sl],ye=()=>["solid","dashed","dotted","double"],fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],oe=()=>[lt,ty,dk,uk],je=()=>["","none",w,Oe,Ae],Ce=()=>["none",lt,Oe,Ae],We=()=>["none",lt,Oe,Ae],at=()=>[lt,Oe,Ae],it=()=>[Wo,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ki],breakpoint:[Ki],color:[QA],container:[Ki],"drop-shadow":[Ki],ease:["in","out","in-out"],font:[eK],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ki],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ki],shadow:[Ki],spacing:["px",lt],text:[Ki],"text-shadow":[Ki],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Wo,Ae,Oe,x]}],container:["container"],"container-type":[{"@container":["","normal","size",Oe,Ae]}],"container-named":[tK],columns:[{columns:[lt,"auto",Ae,Oe,l]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:I()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{"inset-s":L(),start:L()}],end:[{"inset-e":L(),end:L()}],"inset-bs":[{"inset-bs":L()}],"inset-be":[{"inset-be":L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[pi,"auto",Oe,Ae]}],basis:[{basis:[Wo,"full","auto",l,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[lt,Wo,"auto","initial","none",Ae]}],grow:[{grow:["",lt,Oe,Ae]}],shrink:[{shrink:["",lt,Oe,Ae]}],order:[{order:[pi,"first","last","none",Oe,Ae]}],"grid-cols":[{"grid-cols":N()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":j()}],"col-end":[{"col-end":j()}],"grid-rows":[{"grid-rows":N()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":j()}],"row-end":[{"row-end":j()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Q()}],"auto-rows":[{"auto-rows":Q()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...Z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Z(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:W()}],mx:[{mx:W()}],my:[{my:W()}],ms:[{ms:W()}],me:[{me:W()}],mbs:[{mbs:W()}],mbe:[{mbe:W()}],mt:[{mt:W()}],mr:[{mr:W()}],mb:[{mb:W()}],ml:[{ml:W()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],"inline-size":[{inline:["auto",...V()]}],"min-inline-size":[{"min-inline":["auto",...V()]}],"max-inline-size":[{"max-inline":["none",...V()]}],"block-size":[{block:["auto",...J()]}],"min-block-size":[{"min-block":["auto",...J()]}],"max-block-size":[{"max-block":["none",...J()]}],w:[{w:[l,"screen",...Y()]}],"min-w":[{"min-w":[l,"screen","none",...Y()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh","none",...Y()]}],"font-size":[{text:["base",n,Rd,sl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,cK,rK]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ty,Ae]}],"font-family":[{font:[oK,sK,e]}],"font-features":[{"font-features":[Ae]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Oe,Ae]}],"line-clamp":[{"line-clamp":[lt,"none",Oe,ck]}],leading:[{leading:["none",i,...A()]}],"list-image":[{"list-image":["none",Oe,Ae]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Oe,Ae]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ye(),"wavy"]}],"text-decoration-thickness":[{decoration:[lt,"from-font","auto",Oe,sl]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[lt,"auto",Oe,Ae]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"tab-size":[{tab:[pi,Oe,Ae]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Oe,Ae]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Oe,Ae]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:ce()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},pi,Oe,Ae],radial:["",Oe,Ae],conic:["",pi,Oe,Ae]},lK,iK]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:se()}],"gradient-via-pos":[{via:se()}],"gradient-to-pos":[{to:se()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:re()}],"rounded-s":[{"rounded-s":re()}],"rounded-e":[{"rounded-e":re()}],"rounded-t":[{"rounded-t":re()}],"rounded-r":[{"rounded-r":re()}],"rounded-b":[{"rounded-b":re()}],"rounded-l":[{"rounded-l":re()}],"rounded-ss":[{"rounded-ss":re()}],"rounded-se":[{"rounded-se":re()}],"rounded-ee":[{"rounded-ee":re()}],"rounded-es":[{"rounded-es":re()}],"rounded-tl":[{"rounded-tl":re()}],"rounded-tr":[{"rounded-tr":re()}],"rounded-br":[{"rounded-br":re()}],"rounded-bl":[{"rounded-bl":re()}],"border-w":[{border:de()}],"border-w-x":[{"border-x":de()}],"border-w-y":[{"border-y":de()}],"border-w-s":[{"border-s":de()}],"border-w-e":[{"border-e":de()}],"border-w-bs":[{"border-bs":de()}],"border-w-be":[{"border-be":de()}],"border-w-t":[{"border-t":de()}],"border-w-r":[{"border-r":de()}],"border-w-b":[{"border-b":de()}],"border-w-l":[{"border-l":de()}],"divide-x":[{"divide-x":de()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":de()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ye(),"hidden","none"]}],"divide-style":[{divide:[...ye(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-bs":[{"border-bs":B()}],"border-color-be":[{"border-be":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...ye(),"none","hidden"]}],"outline-offset":[{"outline-offset":[lt,Oe,Ae]}],"outline-w":[{outline:["",lt,Rd,sl]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","inner","none",h,Up,Bp]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",p,Up,Bp]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:de()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[lt,sl]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":de()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",m,Up,Bp]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[lt,Oe,Ae]}],"mix-blend":[{"mix-blend":[...fe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":fe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[lt]}],"mask-image-linear-from-pos":[{"mask-linear-from":oe()}],"mask-image-linear-to-pos":[{"mask-linear-to":oe()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":oe()}],"mask-image-t-to-pos":[{"mask-t-to":oe()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":oe()}],"mask-image-r-to-pos":[{"mask-r-to":oe()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":oe()}],"mask-image-b-to-pos":[{"mask-b-to":oe()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":oe()}],"mask-image-l-to-pos":[{"mask-l-to":oe()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":oe()}],"mask-image-x-to-pos":[{"mask-x-to":oe()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":oe()}],"mask-image-y-to-pos":[{"mask-y-to":oe()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[Oe,Ae]}],"mask-image-radial-from-pos":[{"mask-radial-from":oe()}],"mask-image-radial-to-pos":[{"mask-radial-to":oe()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":T()}],"mask-image-conic-pos":[{"mask-conic":[lt]}],"mask-image-conic-from-pos":[{"mask-conic-from":oe()}],"mask-image-conic-to-pos":[{"mask-conic-to":oe()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:ce()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Oe,Ae]}],filter:[{filter:["","none",Oe,Ae]}],blur:[{blur:je()}],brightness:[{brightness:[lt,Oe,Ae]}],contrast:[{contrast:[lt,Oe,Ae]}],"drop-shadow":[{"drop-shadow":["","none",v,Up,Bp]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",lt,Oe,Ae]}],"hue-rotate":[{"hue-rotate":[lt,Oe,Ae]}],invert:[{invert:["",lt,Oe,Ae]}],saturate:[{saturate:[lt,Oe,Ae]}],sepia:[{sepia:["",lt,Oe,Ae]}],"backdrop-filter":[{"backdrop-filter":["","none",Oe,Ae]}],"backdrop-blur":[{"backdrop-blur":je()}],"backdrop-brightness":[{"backdrop-brightness":[lt,Oe,Ae]}],"backdrop-contrast":[{"backdrop-contrast":[lt,Oe,Ae]}],"backdrop-grayscale":[{"backdrop-grayscale":["",lt,Oe,Ae]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[lt,Oe,Ae]}],"backdrop-invert":[{"backdrop-invert":["",lt,Oe,Ae]}],"backdrop-opacity":[{"backdrop-opacity":[lt,Oe,Ae]}],"backdrop-saturate":[{"backdrop-saturate":[lt,Oe,Ae]}],"backdrop-sepia":[{"backdrop-sepia":["",lt,Oe,Ae]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Oe,Ae]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[lt,"initial",Oe,Ae]}],ease:[{ease:["linear","initial",b,Oe,Ae]}],delay:[{delay:[lt,Oe,Ae]}],animate:[{animate:["none",k,Oe,Ae]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,Oe,Ae]}],"perspective-origin":[{"perspective-origin":I()}],rotate:[{rotate:Ce()}],"rotate-x":[{"rotate-x":Ce()}],"rotate-y":[{"rotate-y":Ce()}],"rotate-z":[{"rotate-z":Ce()}],scale:[{scale:We()}],"scale-x":[{"scale-x":We()}],"scale-y":[{"scale-y":We()}],"scale-z":[{"scale-z":We()}],"scale-3d":["scale-3d"],skew:[{skew:at()}],"skew-x":[{"skew-x":at()}],"skew-y":[{"skew-y":at()}],transform:[{transform:[Oe,Ae,"","none","gpu","cpu"]}],"transform-origin":[{origin:I()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:it()}],"translate-x":[{"translate-x":it()}],"translate-y":[{"translate-y":it()}],"translate-z":[{"translate-z":it()}],"translate-none":["translate-none"],zoom:[{zoom:[pi,Oe,Ae]}],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Oe,Ae]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":B()}],"scrollbar-track-color":[{"scrollbar-track":B()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Oe,Ae]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[lt,Rd,sl,ck]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},fK=BG(dK);function jn(...t){return fK(xG(t))}const Tf={fast:{type:"spring",duration:.08,bounce:0},moderate:{type:"spring",duration:.16,bounce:.15}},hK="data-hover-dead-zone";function oR(t,e={}){const{axis:n="y",snapTolerancePx:r=1/0}=e,s=g.useRef(new Map),[i,o]=g.useState(null),[l,u]=g.useState([]),d=g.useRef([]),h=g.useRef(0),p=g.useRef(null),m=g.useRef(null),v=g.useCallback(()=>{const C=[];return s.current.forEach((T,I)=>{C[I]={top:T.offsetTop,height:T.offsetHeight,left:T.offsetLeft,width:T.offsetWidth}}),C},[]),w=g.useCallback(()=>{if(!t.current)return;const T=v();d.current=T,u(T)},[t,v]),_=g.useCallback((C,T)=>{T?s.current.set(C,T):s.current.delete(C),m.current!==null&&cancelAnimationFrame(m.current),m.current=requestAnimationFrame(()=>{m.current=null,w()})},[w]),x=g.useCallback(C=>{const T=C.clientX,I=C.clientY,M=C.target instanceof Element&&C.target.closest(`[${hK}]`)!==null;p.current!==null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{p.current=null;const R=t.current;if(!R)return;if(M){o(null);return}const A=v(),L=d.current;(A.length!==L.length||A.some((ce,se)=>{const re=L[se];return!re||!ce||ce.top!==re.top||ce.height!==re.height||ce.left!==re.left||ce.width!==re.width}))&&(d.current=A,u(A));const F=R.getBoundingClientRect(),j=n==="x"?T:I;let Q=null,q=1/0,Z=null;const W=d.current,Y=n==="x"?R.scrollLeft:R.scrollTop,V=n==="x"?R.clientLeft:R.clientTop,J=n==="x"?F.left:F.top,B=n==="x"?R.offsetWidth:R.offsetHeight,D=n==="x"?F.width:F.height,X=B>0?D/B:1;for(let ce=0;ce<W.length;ce++){const se=W[ce];if(!se)continue;const re=n==="x"?se.left:se.top,de=J+(V+re-Y)*X,ye=(n==="x"?se.width:se.height)*X,fe=de+ye;j>=de&&j<=fe&&(Z=ce);let oe=0;j<de?oe=de-j:j>fe&&(oe=j-fe),oe<q&&(q=oe,Q=ce)}o(Z??(q<=r?Q:null))})},[n,t,r,v]),b=g.useCallback(()=>{h.current+=1,w()},[w]),k=g.useCallback(()=>{p.current!==null&&(cancelAnimationFrame(p.current),p.current=null),o(null)},[]);return g.useEffect(()=>()=>{p.current!==null&&cancelAnimationFrame(p.current),m.current!==null&&cancelAnimationFrame(m.current)},[]),{activeIndex:i,setActiveIndex:o,itemRects:l,sessionRef:h,handlers:{onMouseMove:x,onMouseEnter:b,onMouseLeave:k},registerItem:_,measureItems:w}}function pK(t,e,n){g.useEffect(()=>(t(e,n.current),()=>t(e,null)),[e,t,n])}let _0=0;const mK=()=>{_0+=1;let t=!1;return()=>{t||(t=!0,_0=Math.max(0,_0-1))}},gK=()=>_0>0,vK='[data-menu-item]:not([disabled]):not([aria-disabled="true"])',aR=({itemSelector:t=vK,loop:e=!1}={})=>{const n=g.useRef(null),r=g.useRef(null),s=g.useCallback(o=>{var l;n.current=o,o?r.current=mK():((l=r.current)==null||l.call(r),r.current=null)},[]),i=g.useCallback(o=>{var w;const{key:l}=o;if(l!=="ArrowDown"&&l!=="ArrowUp"&&l!=="Home"&&l!=="End")return;const u=n.current;if(!u)return;const d=Array.from(u.querySelectorAll(t));if(d.length===0)return;o.preventDefault(),o.stopPropagation();const h=d.indexOf(document.activeElement),p=d.length-1,m=_=>{if(h===-1)return _===1?0:p;const x=h+_;return e?(x+d.length)%d.length:Math.min(Math.max(x,0),p)};let v;l==="Home"?v=0:l==="End"?v=p:l==="ArrowDown"?v=m(1):v=m(-1),(w=d[v])==null||w.focus()},[t,e]);return{containerRef:s,onKeyDown:i}};var w0={exports:{}},yK=w0.exports,fk;function _K(){return fk||(fk=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(yK,function(){var e=function(){},n="undefined",r=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),s=["trace","debug","info","warn","error"],i={},o=null;function l(_,x){var b=_[x];if(typeof b.bind=="function")return b.bind(_);try{return Function.prototype.bind.call(b,_)}catch{return function(){return Function.prototype.apply.apply(b,[_,arguments])}}}function u(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function d(_){return _==="debug"&&(_="log"),typeof console===n?!1:_==="trace"&&r?u:console[_]!==void 0?l(console,_):console.log!==void 0?l(console,"log"):e}function h(){for(var _=this.getLevel(),x=0;x<s.length;x++){var b=s[x];this[b]=x<_?e:this.methodFactory(b,_,this.name)}if(this.log=this.debug,typeof console===n&&_<this.levels.SILENT)return"No console available for logging"}function p(_){return function(){typeof console!==n&&(h.call(this),this[_].apply(this,arguments))}}function m(_,x,b){return d(_)||p.apply(this,arguments)}function v(_,x){var b=this,k,C,T,I="loglevel";typeof _=="string"?I+=":"+_:typeof _=="symbol"&&(I=void 0);function M(F){var j=(s[F]||"silent").toUpperCase();if(!(typeof window===n||!I)){try{window.localStorage[I]=j;return}catch{}try{window.document.cookie=encodeURIComponent(I)+"="+j+";"}catch{}}}function R(){var F;if(!(typeof window===n||!I)){try{F=window.localStorage[I]}catch{}if(typeof F===n)try{var j=window.document.cookie,Q=encodeURIComponent(I),q=j.indexOf(Q+"=");q!==-1&&(F=/^([^;]+)/.exec(j.slice(q+Q.length+1))[1])}catch{}return b.levels[F]===void 0&&(F=void 0),F}}function A(){if(!(typeof window===n||!I)){try{window.localStorage.removeItem(I)}catch{}try{window.document.cookie=encodeURIComponent(I)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function L(F){var j=F;if(typeof j=="string"&&b.levels[j.toUpperCase()]!==void 0&&(j=b.levels[j.toUpperCase()]),typeof j=="number"&&j>=0&&j<=b.levels.SILENT)return j;throw new TypeError("log.setLevel() called with invalid level: "+F)}b.name=_,b.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},b.methodFactory=x||m,b.getLevel=function(){return T??C??k},b.setLevel=function(F,j){return T=L(F),j!==!1&&M(T),h.call(b)},b.setDefaultLevel=function(F){C=L(F),R()||b.setLevel(F,!1)},b.resetLevel=function(){T=null,A(),h.call(b)},b.enableAll=function(F){b.setLevel(b.levels.TRACE,F)},b.disableAll=function(F){b.setLevel(b.levels.SILENT,F)},b.rebuild=function(){if(o!==b&&(k=L(o.getLevel())),h.call(b),o===b)for(var F in i)i[F].rebuild()},k=L(o?o.getLevel():"WARN");var N=R();N!=null&&(T=L(N)),h.call(b)}o=new v,o.getLogger=function(x){if(typeof x!="symbol"&&typeof x!="string"||x==="")throw new TypeError("You must supply a name when creating a logger.");var b=i[x];return b||(b=i[x]=new v(x,o.methodFactory)),b};var w=typeof window!==n?window.log:void 0;return o.noConflict=function(){return typeof window!==n&&window.log===o&&(window.log=w),o},o.getLoggers=function(){return i},o.default=o,o})})(w0)),w0.exports}var wK=_K();const Ys=Pm(wK),xK="INFO",bK=xK.toUpperCase();Ys.setLevel(Ys.levels[bK]||Ys.levels.INFO);const ms=t=>{const e=t?`[${t}] `:"";return{trace:(n,...r)=>Ys.trace(`${e}${n}`,...r),debug:(n,...r)=>Ys.debug(`${e}${n}`,...r),info:(n,...r)=>Ys.info(`${e}${n}`,...r),warn:(n,...r)=>Ys.warn(`${e}${n}`,...r),error:(n,...r)=>{Ys.error(`${e}${n}`,...r);try{const i=r.map(l=>l instanceof Error?l.message:String(l)).join(" ").slice(0,512),o={source:"ui",error_message:n,service:t??"unknown",error_type:"logged_error",url:window.location.pathname,error_args_count:r.length,...i?{error_detail:i}:{}};Ee.capture("logger_error",o)}catch(s){console.error("[logger] Failed to send logger_error to PostHog:",s)}},api:(n,...r)=>Ys.info(`${e}API: ${n}`,...r),hook:(n,...r)=>Ys.debug(`${e}Hook: ${n}`,...r),mount:(n,...r)=>Ys.debug(`${e}Mount: ${n}`,...r)}},hk=ms("useVariantsUiState"),SK={groups:[],rows:{}},Wp={pinned:[],order:SK},jd="pinned",EK="top",ny=t=>`rows:${t}`,pk=t=>e=>e.pinned.includes(t)?e:{...e,pinned:[...e.pinned,t]},kK=t=>e=>({...e,pinned:e.pinned.filter(n=>n!==t)}),CK=(t,e)=>n=>{if(t===jd){const r=new Set(e);return{...n,pinned:[...e,...n.pinned.filter(s=>!r.has(s))]}}return t===EK?{...n,order:{...n.order,groups:e}}:{...n,order:{...n.order,rows:{...n.order.rows,[t.slice(5)]:e}}}},PK=t=>{const e=t?`?projectPath=${encodeURIComponent(t)}`:"",[n,r]=g.useState(Wp),s=g.useRef(n);s.current=n;const i=g.useRef(!1),o=g.useRef([]),l=g.useCallback(v=>{t&&fetch(`/api/variants/ui-state${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({uiState:v})}).catch(w=>{hk.warn("persist failed — arrangement kept for this session only",w)})},[t,e]);g.useEffect(()=>{if(r(Wp),s.current=Wp,i.current=!1,o.current=[],!t)return;let v=!1;return(async()=>{try{const w=await fetch(`/api/variants/ui-state${e}`);if(!w.ok||v)return;const _=await w.json();if(v)return;let x=_.uiState??Wp;const b=o.current;o.current=[];for(const k of b)x=k(x);i.current=!0,s.current=x,r(x),b.length>0&&l(x)}catch(w){hk.warn("load failed — arrangement is session-local until reload",w)}})(),()=>{v=!0}},[t,e,l]);const u=g.useCallback(v=>{const w=v(s.current);s.current=w,r(w),i.current?l(w):o.current.push(v)},[l]),d=g.useCallback(v=>{const w=!s.current.pinned.includes(v);u(w?pk(v):kK(v))},[u]),h=g.useCallback(v=>{s.current.pinned.includes(v)||u(pk(v))},[u]),p=g.useCallback((v,w)=>{u(CK(v,w))},[u]),m=g.useMemo(()=>new Set(n.pinned),[n.pinned]);return{pinnedKeys:n.pinned,pinnedKeySet:m,listOrder:n.order,togglePin:d,pinItem:h,reorder:p}},TK=t=>{const{containerRef:e,dragged:n,yieldToSelector:r,restrictToSelector:s,onReorder:i}=t,[o,l]=g.useState(null),u=g.useCallback(p=>{const m=e.current;return m?Array.from(m.querySelectorAll(`[data-reorder-container="${CSS.escape(p)}"]`)):[]},[e]),d=g.useCallback(p=>{if(!n){o&&l(null);return}const m=e.current;if(!m)return;if(r){const b=m.querySelector(r);if(b){const k=b.getBoundingClientRect();if(p.clientY>=k.top&&p.clientY<=k.bottom){o&&l(null);return}}}if(s){const b=m.querySelector(s),k=b==null?void 0:b.getBoundingClientRect();if(!k||p.clientY<k.top||p.clientY>k.bottom){o&&l(null);return}}const v=u(n.container);if(v.length===0){o&&l(null);return}const w=m.getBoundingClientRect().top;let _=v.length;for(let b=0;b<v.length;b++){const k=v[b].getBoundingClientRect();if(p.clientY<k.top+k.height/2){_=b;break}}let x;_===0?x=v[0].getBoundingClientRect().top-w-1:_===v.length?x=v[v.length-1].getBoundingClientRect().bottom-w:x=(v[_-1].getBoundingClientRect().bottom+v[_].getBoundingClientRect().top)/2-w,(!o||o.index!==_||o.container!==n.container)&&l({container:n.container,index:_,top:x})},[e,n,o,u,r,s]),h=g.useCallback(()=>{if(!n||!o)return;l(null);const p=u(o.container).map(w=>w.dataset.reorderKey).filter(w=>!!w),m=p.indexOf(n.key);if(m===-1)return;p.splice(m,1);const v=o.index>m?o.index-1:o.index;p.splice(v,0,n.key),i(o.container,p)},[n,o,u,i]);return{dropTarget:o,onPointerMove:d,onPointerUp:h}},lR=(t,e)=>`style:${t}:${e}`,cR=t=>`text:${t}`,uR=t=>{const e=[t.rivetId,t.xpath,t.cssSelector].filter(n=>!!n).map(n=>n.trim()).filter(Boolean);return e.length>0?[...new Set(e)]:["unknown"]},dR=t=>uR(t)[0],Zp=(t,e)=>uR(t).includes(e),IK=t=>{const e=dR(t.elementId),n=t.batchId?`:${t.batchId}`:"";return t.type==="style"?`${lR(e,t.property)}${n}`:`${cR(e)}${n}`},Jn=[];for(let t=0;t<256;++t)Jn.push((t+256).toString(16).slice(1));function AK(t,e=0){return(Jn[t[e+0]]+Jn[t[e+1]]+Jn[t[e+2]]+Jn[t[e+3]]+"-"+Jn[t[e+4]]+Jn[t[e+5]]+"-"+Jn[t[e+6]]+Jn[t[e+7]]+"-"+Jn[t[e+8]]+Jn[t[e+9]]+"-"+Jn[t[e+10]]+Jn[t[e+11]]+Jn[t[e+12]]+Jn[t[e+13]]+Jn[t[e+14]]+Jn[t[e+15]]).toLowerCase()}const RK=new Uint8Array(16);function MK(){return crypto.getRandomValues(RK)}function mk(t,e,n){return crypto.randomUUID?crypto.randomUUID():OK(t)}function OK(t,e,n){var s;t=t||{};const r=t.random??((s=t.rng)==null?void 0:s.call(t))??MK();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,AK(r)}const LK=300;class DK{constructor(){zo(this,"history",{current:new Map,past:[],future:[]});zo(this,"pendingChanges",new Map);zo(this,"currentBatchId",null);zo(this,"debounceTimer",null);zo(this,"onChangeCallbacks",[]);zo(this,"stateBeforePending",null);zo(this,"transactionDepth",0)}recordChange(e){this.pendingChanges.size===0&&(this.currentBatchId=mk(),this.stateBeforePending=new Map(this.history.current)),this.currentBatchId&&(e.batchId=this.currentBatchId);const n=dR(e.elementId),r=e.type==="style"?lR(n,e.property):cR(n),s=Array.from(this.history.current.entries()).find(([o])=>o===r||o.startsWith(`${r}:`));if(s){const o=s[1];e.type==="style"&&o.type==="style"?e.oldValue=o.oldValue:e.type==="text"&&o.type==="text"&&(e.oldText=o.oldText)}const i=IK(e);this.history.current.set(i,e),this.pendingChanges.set(i,e),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.commitPending()},LK),this.notifyChange()}flushPending(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.commitPending()}removeChange(e){const n=this.history.current.get(e)??this.pendingChanges.get(e)??null,r=this.history.current.has(e),s=this.pendingChanges.has(e);return!r&&!s?null:(r&&this.history.current.delete(e),s&&this.pendingChanges.delete(e),n&&this.stateBeforePending&&(this.stateBeforePending=this.removeChangeFromSnapshotById(this.stateBeforePending,n.id)),s&&this.pendingChanges.size===0&&(this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.stateBeforePending=null,this.currentBatchId=null),r&&(this.history.future=[]),n&&(this.history.past=this.history.past.map(i=>this.removeChangeFromSnapshotById(i,n.id)).filter(i=>i.size>0)),this.notifyChange(),n)}removeChangeById(e){const n=Array.from(this.history.current.entries()).find(([,s])=>s.id===e);if(n)return this.removeChange(n[0]);const r=Array.from(this.pendingChanges.entries()).find(([,s])=>s.id===e);return r?this.removeChange(r[0]):null}removeChangeFromSnapshotById(e,n){return new Map(Array.from(e.entries()).filter(([,r])=>r.id!==n))}commitPending(){this.pendingChanges.size===0||!this.stateBeforePending||this.transactionDepth>0||(this.history.past.push(this.stateBeforePending),this.history.future=[],this.pendingChanges.clear(),this.stateBeforePending=null,this.currentBatchId=null,this.notifyChange())}undo(){if(this.pendingChanges.size>0&&this.commitPending(),this.history.past.length===0)return null;const e=new Map(this.history.current);this.history.future.push(e),this.history.current=this.history.past.pop(),this.notifyChange();const n=[];for(const[r,s]of e)this.history.current.has(r)||n.push(s);return n}redo(){if(this.history.future.length===0)return null;const e=new Map(this.history.current);this.history.past.push(e),this.history.current=this.history.future.pop(),this.notifyChange();const n=[];for(const[r,s]of this.history.current)e.has(r)||n.push(s);return n}getChanges(){return Array.from(this.history.current.values())}getStyleChanges(){return Array.from(this.history.current.values()).filter(e=>e.type==="style")}getTextChanges(){return Array.from(this.history.current.values()).filter(e=>e.type==="text")}getChangeCount(){return this.getUniqueBatchCount(this.history.current.values())}getStyleBatchCount(){return this.getUniqueBatchCount(Array.from(this.history.current.values()).filter(e=>e.type==="style"))}getTextBatchCount(){return this.getUniqueBatchCount(Array.from(this.history.current.values()).filter(e=>e.type==="text"))}getUniqueBatchCount(e){const n=new Set;for(const r of e)r.batchId?n.add(r.batchId):n.add(r.id);return n.size}canUndo(){return this.history.past.length>0||this.pendingChanges.size>0}canRedo(){return this.history.future.length>0}clear(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.history={current:new Map,past:[],future:[]},this.pendingChanges.clear(),this.stateBeforePending=null,this.currentBatchId=null,this.notifyChange()}getStyleChange(e,n){return Array.from(this.history.current.values()).filter(s=>s.type==="style"&&Zp(s.elementId,e)&&s.property===n).sort((s,i)=>i.timestamp-s.timestamp)[0]}getTextChange(e){return Array.from(this.history.current.values()).filter(r=>r.type==="text"&&Zp(r.elementId,e)).sort((r,s)=>s.timestamp-r.timestamp)[0]}hasChanges(e){return Array.from(this.history.current.values()).some(n=>Zp(n.elementId,e))}getChangesForElement(e){return Array.from(this.history.current.values()).filter(n=>Zp(n.elementId,e))}onChange(e){return this.onChangeCallbacks.push(e),()=>{const n=this.onChangeCallbacks.indexOf(e);n!==-1&&this.onChangeCallbacks.splice(n,1)}}notifyChange(){this.onChangeCallbacks.forEach(e=>e())}export(){return{current:Array.from(this.history.current.entries()),past:this.history.past.map(e=>Array.from(e.entries())),future:this.history.future.map(e=>Array.from(e.entries()))}}import(e){this.history={current:new Map(e.current),past:e.past.map(n=>new Map(n)),future:e.future.map(n=>new Map(n))},this.notifyChange()}async transaction(e){const n=this.pendingChanges.size===0;n&&(this.currentBatchId=mk(),this.stateBeforePending=new Map(this.history.current)),this.transactionDepth++;try{await e()}catch(r){throw n&&this.stateBeforePending&&(this.history.current=new Map(this.stateBeforePending),this.pendingChanges.clear(),this.currentBatchId=null,this.stateBeforePending=null),r}finally{this.transactionDepth--,n&&this.transactionDepth===0&&this.flushPending()}}}const mm={kind:"base"};function If(t){return t.kind==="base"?"base":`variant:${t.sessionId}:${t.variantId}`}function NK(t,e){return t.kind==="base"&&e.kind,t.kind==="variant"&&e.kind==="variant"?t.sessionId===e.sessionId&&t.variantId===e.variantId:!1}const $K={resize:{default:!1},variants:{default:!1},designSystemEditor:{default:!1},branchDiff:{default:!1},gitUi:{default:!0},createProject:{default:!1},deployPrototype:{default:!1},canvasShare:{default:!1},variantSend:{default:!1},generativeControls:{default:!1},refineMode:{default:!1},designContextViewer:{default:!1},variantReferences:{default:!1},inspectorUndoRedo:{default:!1}},fR=Object.fromEntries(Object.entries($K).map(([t,e])=>[t,{isEnabled:e.default}]));ot("view");const hR=ot(!0),pR=ot(null),jK=ot("chat"),mR=ot(0),gR=ot({name:null,email:null}),gk=ot(mm);ot(null);const Af=new Map,FK=t=>{const e=If(t);let n=Af.get(e);return n||(n=new DK,Af.set(e,n)),n};ot(t=>FK(t(gk)),(t,e,n)=>{Af.set(If(t(gk)),n)});const VK=t=>{for(const e of[...Af.keys()])e==="base"||t.has(e)||Af.delete(e)},Rf=ot(new Map),vk=ot(null);ot(null);const a2=ot(0),gm=ot(null),l2=ot(!1),c2=ot(null),vR=ot(!1),yR=ot(!1),u2=ot(null),d2=ot(null),_u=ot(null),Ex=ot(null),yo=ot(null),rh=ot({active:!1}),_R=ot([]),yk=ot(null),HK=(t,e,n)=>{let r=!1;const s=new Map(t);for(const[i,o]of t)o.target&&NK(o.target,e)&&(s.set(i,{...o,target:n}),r=!0);return r?s:t},zK=ot(null,(t,e,n)=>{const r=u=>{const d=u??mm;return d.kind==="variant"&&!n.has(If(d))},s=t(Rf);let i=null;for(const[u,d]of s)r(d.target)&&(i??(i=new Set)).add(u);if(i){const u=new Map(s);for(const d of i)u.delete(d);e(Rf,u)}const o=t(vk);o&&r(o.target)&&(e(vk,null),e(ZK,!1));const l=t(yk);l&&(i!=null&&i.has(l.commentId))&&e(yk,null),VK(n)}),f2=ot(fR),BK=ot(!1),wR=ot(null),sh=ot(!0),xR=ot(!1),bR=ot(!1),SR=ot(null),UK=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},Km=ot(UK()),WK=ot(null),ZK=ot(!1);ot(0);ot(0);function qK(t){return t==="cursor"?"Cursor":t==="codex"?"Codex":t==="claude-desktop"?"Claude":"Claude Code"}const GK=["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],kx=({className:t,"data-testid":e}={})=>S.jsx("div",{className:`rivet-sparkle relative overflow-hidden font-mono leading-none ${t??"text-base text-primary"}`,style:{height:"1em",width:"4ch"},"aria-hidden":"true","data-testid":e,children:S.jsx("div",{className:"rivet-sparkle-strip",children:GK.map((n,r)=>S.jsx("span",{className:"block",style:{height:"1em",lineHeight:"1em"},children:n},r))})}),ER=({primaryLabel:t,primaryIcon:e,primaryAction:n,isDisabled:r=!1,isDropdownDisabled:s=!1,isLoading:i=!1,loadingLabel:o,dropdownAriaLabel:l="More actions",dropdownItems:u})=>{const[d,h]=g.useState(!1),p=i?o??t:t,m=u.length>0;return S.jsxs("div",{className:"flex items-stretch",children:[S.jsxs("button",{onClick:n,disabled:r||i,className:`bg-main-hover hover:bg-main-input flex h-7 shrink-0 items-center gap-1.5 px-3 text-xs font-medium text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${m?"rounded-l-md":"rounded-md"}`,children:[e?S.jsx(e,{className:"h-3.5 w-3.5",weight:"bold"}):null,p]}),m?S.jsxs(yx,{open:d,onOpenChange:h,children:[S.jsx(_x,{asChild:!0,children:S.jsx("button",{"aria-label":l,disabled:s||i,title:l,className:"bg-main-hover hover:bg-main-input h-7 shrink-0 rounded-r-md border-l border-white/20 px-1.5 text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(fG,{className:"h-3.5 w-3.5",weight:"bold"})})}),S.jsx(wx,{children:S.jsx(xx,{className:"border-divider bg-main z-[60] min-w-[140px] rounded-lg border p-1 shadow-lg",sideOffset:5,align:"end",children:u.map(v=>{const w=v.icon;return S.jsxs("button",{onClick:()=>{v.isDisabled||(v.onClick(),h(!1))},disabled:v.isDisabled,className:"text-content hover:bg-hover flex w-full items-center gap-2 rounded px-3 py-1.5 text-xs transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[w?S.jsx(w,{className:"h-3.5 w-3.5",weight:"bold"}):null,v.label]},v.label)})})})]}):null]})};var KK=Object.defineProperty,YK=(t,e)=>KK(t,"name",{value:e,configurable:!0}),XK=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),QK=g.forwardRef(YK(function(e,n){return S.jsx(_n.span,{...e,ref:n,style:{...XK,...e.style}})},"VisuallyHidden")),JK=QK,eY=Object.defineProperty,Zn=(t,e)=>eY(t,"name",{value:e,configurable:!0}),[Cx,ere]=Di("Tooltip",[Zm]),Px=Zm(),tY="TooltipProvider",nY=700,h2="tooltip.open",[rY,Tx]=Cx(tY),sY=Zn(t=>{const{__scopeTooltip:e,delayDuration:n=nY,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,o=g.useRef(!0),l=g.useRef(!1),u=g.useRef(0);return g.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),S.jsx(rY,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:g.useCallback(()=>{r<=0||(window.clearTimeout(u.current),o.current=!1)},[r]),onClose:g.useCallback(()=>{r<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:l,onPointerInTransitChange:g.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:i})},"TooltipProvider"),p2="Tooltip",[iY,ih]=Cx(p2),oY=Zn(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=t,u=Tx(p2,t.__scopeTooltip),d=Px(e),[h,p]=g.useState(null),[m,v]=g.useState(void 0),w=da(),_=g.useRef(0),x=o??u.disableHoverableContent,b=l??u.delayDuration,k=g.useRef(!1),[C,T]=Ca({prop:r,defaultProp:s??!1,onChange:Zn(N=>{N?(u.onOpen(),document.dispatchEvent(new CustomEvent(h2))):u.onClose(),i==null||i(N)},"onChange"),caller:p2}),I=g.useMemo(()=>C?k.current?"delayed-open":"instant-open":"closed",[C]),M=g.useCallback(()=>{window.clearTimeout(_.current),_.current=0,k.current=!1,T(!0)},[T]),R=g.useCallback(()=>{window.clearTimeout(_.current),_.current=0,T(!1)},[T]),A=g.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{k.current=!0,T(!0),_.current=0},b)},[b,T]);g.useEffect(()=>()=>{_.current&&(window.clearTimeout(_.current),_.current=0)},[]);const L=m??w;return S.jsx(fA,{...d,children:S.jsx(iY,{scope:e,contentId:L,setContentId:v,open:C,stateAttribute:I,trigger:h,onTriggerChange:p,onTriggerEnter:g.useCallback(()=>{u.isOpenDelayedRef.current?A():M()},[u.isOpenDelayedRef,A,M]),onTriggerLeave:g.useCallback(()=>{x?R():(window.clearTimeout(_.current),_.current=0)},[R,x]),onOpen:M,onClose:R,disableHoverableContent:x,children:n})})},"Tooltip"),_k="TooltipTrigger",aY=g.forwardRef(Zn(function(e,n){const{__scopeTooltip:r,...s}=e,i=ih(_k,r),o=Tx(_k,r),l=Px(r),u=g.useRef(null),d=Zt(n,u,i.onTriggerChange),h=g.useRef(!1),p=g.useRef(!1),m=g.useCallback(()=>h.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),S.jsx(hA,{asChild:!0,...l,children:S.jsx(_n.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...s,ref:d,onPointerMove:Ut(e.onPointerMove,v=>{v.pointerType!=="touch"&&!p.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:Ut(e.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:Ut(e.onPointerDown,()=>{i.open&&i.onClose(),h.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:Ut(e.onFocus,()=>{h.current||i.onOpen()}),onBlur:Ut(e.onBlur,i.onClose),onClick:Ut(e.onClick,i.onClose)})})},"TooltipTrigger")),kR="TooltipPortal",[lY,cY]=Cx(kR,{forceMount:void 0}),uY=Zn(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=ih(kR,e);return S.jsx(lY,{scope:e,forceMount:n,children:S.jsx(Pa,{present:n||i.open,children:S.jsx(Xw,{asChild:!0,container:s,children:r})})})},"TooltipPortal"),Mf="TooltipContent",dY=g.forwardRef(Zn(function(e,n){const r=cY(Mf,e.__scopeTooltip),{forceMount:s=r.forceMount,side:i="top",...o}=e,l=ih(Mf,e.__scopeTooltip);return S.jsx(Pa,{present:s||l.open,children:l.disableHoverableContent?S.jsx(CR,{side:i,...o,ref:n}):S.jsx(fY,{side:i,...o,ref:n})})},"TooltipContent")),fY=g.forwardRef(Zn(function(e,n){const r=ih(Mf,e.__scopeTooltip),s=Tx(Mf,e.__scopeTooltip),i=g.useRef(null),o=Zt(n,i),[l,u]=g.useState(null),{trigger:d,onClose:h}=r,p=i.current,{onPointerInTransitChange:m}=s,v=g.useCallback(()=>{u(null),m(!1)},[m]),w=g.useCallback((_,x)=>{const b=_.currentTarget,k={x:_.clientX,y:_.clientY},C=PR(k,b.getBoundingClientRect()),T=TR(k,C),I=IR(x.getBoundingClientRect()),M=RR([...T,...I]);u(M),m(!0)},[m]);return g.useEffect(()=>()=>v(),[v]),g.useEffect(()=>{if(d&&p){const _=Zn(b=>w(b,p),"handleTriggerLeave"),x=Zn(b=>w(b,d),"handleContentLeave");return d.addEventListener("pointerleave",_),p.addEventListener("pointerleave",x),()=>{d.removeEventListener("pointerleave",_),p.removeEventListener("pointerleave",x)}}},[d,p,w,v]),g.useEffect(()=>{if(l){const _=Zn(x=>{const b=x.target,k={x:x.clientX,y:x.clientY},C=(d==null?void 0:d.contains(b))||(p==null?void 0:p.contains(b)),T=!AR(k,l);C?v():T&&(v(),h())},"handleTrackPointerGrace");return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[d,p,l,h,v]),S.jsx(CR,{...e,ref:o})},"TooltipContentHoverable")),hY=gI("TooltipContent"),CR=g.forwardRef(Zn(function(e,n){const{__scopeTooltip:r,children:s,"aria-label":i,id:o,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,h=ih(Mf,r),p=Px(r),{onClose:m}=h;g.useEffect(()=>(document.addEventListener(h2,m),()=>document.removeEventListener(h2,m)),[m]),g.useEffect(()=>{if(h.trigger){const w=Zn(_=>{_.target instanceof Node&&_.target.contains(h.trigger)&&m()},"handleScroll");return window.addEventListener("scroll",w,{capture:!0}),()=>window.removeEventListener("scroll",w,{capture:!0})}},[h.trigger,m]);const{setContentId:v}=h;return Fr(()=>(v(o),()=>{v(void 0)}),[o,v]),S.jsx(Gw,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:w=>w.preventDefault(),onDismiss:m,children:S.jsxs(pA,{"data-state":h.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:h.contentId,...p,...d,ref:n,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[S.jsx(hY,{children:s}),i?S.jsx(JK,{id:h.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl"));function PR(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}Zn(PR,"getExitSideFromRect");function TR(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}Zn(TR,"getPaddedExitPoints");function IR(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}Zn(IR,"getPointsFromRect");function AR(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const l=e[i],u=e[o],d=l.x,h=l.y,p=u.x,m=u.y;h>r!=m>r&&n<(p-d)*(r-h)/(m-h)+d&&(s=!s)}return s}Zn(AR,"isPointInPolygon");function RR(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),MR(e)}Zn(RR,"getHull");function MR(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const s=t[r];for(;e.length>=2;){const i=e[e.length-1],o=e[e.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}Zn(MR,"getHullPresorted");var pY=sY,mY=oY,gY=aY,vY=uY,yY=dY;const nf={normal:"'wght' 400",medium:"'wght' 450",semibold:"'wght' 550"},OR={pill:{item:"rounded-[20px]",bg:"rounded-[20px]",focusRing:"rounded-[22px]",mergedBg:"rounded-2xl",container:"rounded-3xl",button:"rounded-[20px]",input:"rounded-[20px]"},rounded:{item:"rounded-lg",bg:"rounded-lg",focusRing:"rounded-[10px]",mergedBg:"rounded-lg",container:"rounded-xl",button:"rounded-lg",input:"rounded-lg"}},LR=g.createContext(null);function Ym(){const t=g.useContext(LR);return t?t.classes:OR.pill}function _Y(t){const e=document.documentElement;e.classList.add("transitioning"),e.offsetHeight,t(),setTimeout(()=>e.classList.remove("transitioning"),200)}function wY({children:t,defaultShape:e="pill"}){const[n,r]=g.useState(e),s=g.useCallback(i=>{_Y(()=>r(i))},[]);return S.jsx(LR.Provider,{value:{shape:n,setShape:s,classes:OR[n]},children:t})}const DR=g.createContext(null);function NR({value:t,children:e}){return S.jsx(DR.Provider,{value:t,children:e})}function xY(t){switch(t){case"top":return{y:4};case"bottom":return{y:-4};case"left":return{x:4};case"right":return{x:-4}}}function Ix({content:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=200,className:i,forceOpen:o,onOpenChange:l}){const[u,d]=g.useState(!1),h=o!==void 0?o:u,[p,m]=g.useState(!1),v=Ym(),w=g.useContext(DR);g.useEffect(()=>{h&&m(!0)},[h]);const _=()=>{h||m(!1)},x=xY(n);return S.jsx(pY,{delayDuration:s,children:S.jsxs(mY,{open:h,onOpenChange:b=>{d(b),l==null||l(b)},children:[S.jsx(gY,{asChild:!0,children:e}),p&&S.jsx(vY,{forceMount:!0,container:w??void 0,children:S.jsx(yY,{side:n,sideOffset:r,forceMount:!0,className:"z-tooltip",children:S.jsx(ho.div,{className:jn("bg-neutral-900 text-white text-[12px] px-2 py-1 border border-white/10 shadow-lg",v.bg,i),style:{fontVariationSettings:nf.medium},initial:{opacity:0,scale:.8,...x},animate:{opacity:h?1:0,scale:h?1:.9,x:0,y:0},transition:h?{type:"spring",duration:.34,bounce:.55}:{duration:.1},onAnimationComplete:_,children:t})})})]})})}const Hl=({label:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=300,disabled:i=!1,forceOpen:o})=>i?S.jsx(S.Fragment,{children:e}):S.jsx(Ix,{content:t,side:n,sideOffset:r,delayDuration:s,forceOpen:o,children:e}),Xm="/__rivet/preview",wk=`${Xm}/variant/`,xk=`${Xm}/history/`,$R=t=>t?t.startsWith("/")?t:`/${t}`:"/",bY=t=>`${Xm}/variant/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${$R(t.routePath)}`,SY=t=>`${Xm}/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${$R(t.routePath)}`,EY=t=>{try{const e=new URL(t,"http://localhost");return e.pathname.startsWith(wk)||e.pathname.startsWith(xk)}catch{return t.startsWith(wk)||t.startsWith(xk)}},bk=t=>{var s,i,o,l;const{sessionId:e,variant:n,projectContext:r}=t;return n.status!=="succeeded"?null:((s=n.preview)==null?void 0:s.kind)==="static_artifact"?n.preview.url:e&&(((i=n.preview)==null?void 0:i.kind)==="dev_server"||typeof n.port=="number")?bY({sessionId:e,variantId:n.workItemId,routePath:t.routePath}):e&&(r==null?void 0:r.kind)==="fresh"&&((o=r.executionPlan)==null?void 0:o.mode)!=="vite_app"&&((l=n.preview)==null?void 0:l.kind)!=="dev_server"?`/api/variants/${e}/static/${n.workItemId}`:null},Sk="/rivet/",jR=t=>{if(!t.startsWith(Sk))return null;const e=t.slice(Sk.length);return!e||e==="/"?null:`/${e}`},wu=(t,e=fetch)=>{if((t==null?void 0:t.source)!=="history-dev-server")return;const n=new URLSearchParams({sessionId:t.sessionId,variantId:t.variantId});e(`/api/variants/history/replay/stop?${n.toString()}`,{method:"POST"}).catch(()=>{})},kY=(t,e=fetch)=>{const n=new Set;for(const r of[t==null?void 0:t.left,t==null?void 0:t.right]){if((r==null?void 0:r.source)!=="history-dev-server")continue;const s=`${r.sessionId}:${r.variantId}`;n.has(s)||(n.add(s),wu(r,e))}},vm=(t,e)=>{const n=e==null?void 0:e.left,r=e==null?void 0:e.right;return{event:`visual_editor_variant_compare_${t}`,properties:{bound_side_count:+!!n+ +!!r,is_cross_session:!!(n&&r&&n.sessionId!==r.sessionId),left_session_id:n==null?void 0:n.sessionId,left_source:n==null?void 0:n.source,left_variant_id:n==null?void 0:n.variantId,right_session_id:r==null?void 0:r.sessionId,right_source:r==null?void 0:r.source,right_variant_id:r==null?void 0:r.variantId}}},Ek=6,FR="original",Ax="Original",VR="The original state of your app before any variants were generated.",kk=200,m2=[.33,1,.68,1],g2=.22,vn=ms("AgentVariantsPanel"),ry=()=>{var t;(t=window.getSelection())==null||t.removeAllRanges()},Tc=t=>{var e;return!!t.hasTree&&((e=t.serve)==null?void 0:e.kind)==="dev-server"},CY=t=>{var e;return t?t.kind==="existing"?!0:((e=t.executionPlan)==null?void 0:e.mode)==="vite_app":!1};function sy(t,...e){return t?e.some(n=>(n??"").toLowerCase().includes(t)):!0}const PY=(t,e)=>{if(t.kind==="original")return null;const n=t.kind==="active"?t.variant.runLabel:t.entry.runLabel,r=n==null?void 0:n.trim();return r?t.kind==="active"?e?{label:r,run:t.variant.requestId?{sessionId:e,requestId:t.variant.requestId}:{sessionId:e,runLabel:r}}:null:{label:r,run:t.entry.requestId?{sessionId:t.entry.sessionId,requestId:t.entry.requestId}:{sessionId:t.entry.sessionId,runLabel:r}}:null},HR=t=>{const e="requestId"in t?["request",t.requestId]:["label",t.runLabel];return`run:${JSON.stringify([t.sessionId,...e])}`},TY="original",v2="pinned-section";function zR(t){return`rivet:collapsedRuns:${t}`}function qp(t){try{const e=window.localStorage.getItem(zR(t)),n=e?JSON.parse(e):null;return Array.isArray(n)?new Set(n.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function iy(t,e){try{window.localStorage.setItem(zR(t),JSON.stringify([...e]))}catch{}}const Ck=(t,e)=>{const n=[],r=new Map;for(const s of t){const i=PY(s,e);let o="";s.kind==="original"?o=TY:i&&(o=HR(i.run));let l=r.get(o);l||(l={key:o,label:(i==null?void 0:i.label)??null,run:(i==null?void 0:i.run)??null,rows:[]},r.set(o,l),n.push(l)),l.rows.push(s)}return n};async function mi(t){try{const e=await t.json();return{message:typeof e.message=="string"?e.message:null,errorCode:typeof e.errorCode=="string"?e.errorCode:null}}catch{return{message:null,errorCode:null}}}const IY=t=>{var n,r;const e=((r=(n=t.actions)==null?void 0:n.commit)==null?void 0:r.enabled)??t.status==="succeeded";return t.status==="succeeded"&&e},rf=t=>{var e,n;return t.status!=="succeeded"?!1:((n=(e=t.actions)==null?void 0:e.view)==null?void 0:n.enabled)??(!!t.preview||typeof t.port=="number")},BR=t=>{var e;return((e=t.previewUnavailable)==null?void 0:e.reason)==="idle_timeout"},AY=t=>t.status==="succeeded"&&!rf(t)&&(!t.previewUnavailable||BR(t)),oy=t=>{var e,n;return((e=t.preview)==null?void 0:e.kind)==="static_artifact"?"static_artifact":((n=t.preview)==null?void 0:n.kind)==="dev_server"||typeof t.port=="number"?"dev_server":"none"},Pk=(t,e,n)=>{const r=t.includes("?")?"&":"?";return`${t}${r}${encodeURIComponent(e)}=${encodeURIComponent(n)}`},RY=t=>{var e;return IY(t)&&((e=t.preview)==null?void 0:e.kind)==="static_artifact"},Tk=(t,e)=>t.map(n=>`${n.workItemId}:${e[n.workItemId]??""}`).join("|"),MY=(t,e)=>t.length===e.length&&t.every((n,r)=>{var i,o;const s=e[r];return n.sessionId===s.sessionId&&n.variantId===s.variantId&&n.requestId===s.requestId&&n.label===s.label&&n.brief===s.brief&&n.runLabel===s.runLabel&&n.createdAt===s.createdAt&&((i=n.serve)==null?void 0:i.kind)===((o=s.serve)==null?void 0:o.kind)&&n.hasTree===s.hasTree}),OY=()=>{var Yl,Fa,$s,js;const t=nt(rh),e=nt(_R),n=nt(wR),r=nt(sh),s=nt(f2),i=((Yl=s.deployPrototype)==null?void 0:Yl.isEnabled)??!1,o=((Fa=s.canvasShare)==null?void 0:Fa.isEnabled)??!1,l=(($s=s.variantSend)==null?void 0:$s.isEnabled)??!1,u=((js=s.designContextViewer)==null?void 0:js.isEnabled)??!1,d=nt(bR),h=nt(SR),p=ft(a2),m=ft(gm),v=ft(l2),w=ft(c2),_=ft(vR),x=ft(yR),b=ft(_u),k=nt(_u),C=ft(Ex),T=ft(pR);g.useEffect(()=>(T("Directions"),()=>T(null)),[T]);const I=nt(yo),M=ft(yo),R=g.useCallback(($=!1)=>{if(kY(I),M(null),$&&I){const ae=vm("ended",I);Ee.capture(ae.event,ae.properties)}},[M,I]),A=nt(u2),L=ft(u2),N=nt(d2),F=ft(d2),j=N?`${N.sessionId}:${N.variantId}`:null,[Q,q]=g.useState(""),[Z,W]=g.useReducer($=>$+1,0),Y=g.useMemo(()=>n!==null?qp(n):new Set,[n,Z]),V=g.useCallback($=>{if(n===null)return;const ae=new Set(qp(n));ae.delete($)||ae.add($),iy(n,ae),W()},[n]),[J,B]=g.useState(null),[D,X]=g.useState(null),[ce,se]=g.useState(!1),[re,de]=g.useState({}),[ye,fe]=g.useState(null),[oe,je]=g.useState({}),[Ce,We]=g.useState(null),[at,it]=g.useState([]),Ot=g.useRef([]);Ot.current=at;const[ht,De]=g.useState(!1),rt=g.useRef(!1);rt.current=N!==null||A!==null||ht;const Be=g.useMemo(()=>t.active?t.variants:[],[t]),ct=g.useMemo(()=>Be.filter(RY),[Be]),Re=g.useMemo(()=>Tk(ct,re),[ct,re]),Ze=(ye==null?void 0:ye.key)===Re?ye.shareUrl:null,xe=t.active?t.sessionId:null,St=g.useMemo(()=>{const $=new Set;for(const ae of Be)ae.adoptedSource&&$.add(`${ae.adoptedSource.sessionId}:${ae.adoptedSource.variantId}`);return $},[Be]),It=g.useMemo(()=>[...at.filter(ae=>ae.sessionId!==xe&&!St.has(`${ae.sessionId}:${ae.variantId}`))].sort((ae,ke)=>{const he=new Date(ae.createdAt).getTime(),_e=new Date(ke.createdAt).getTime();return(Number.isNaN(_e)?0:_e)-(Number.isNaN(he)?0:he)}),[St,at,xe]),kr=g.useMemo(()=>N?Be.find($=>{var ae,ke;return((ae=$.adoptedSource)==null?void 0:ae.sessionId)===N.sessionId&&((ke=$.adoptedSource)==null?void 0:ke.variantId)===N.variantId})??null:null,[N,Be]),Os=g.useMemo(()=>N?It.find($=>$.sessionId===N.sessionId&&$.variantId===N.variantId)??null:null,[N,It]),wn=t.active?t.projectContext:null,xn=(wn==null?void 0:wn.kind)==="fresh"?wn.workspacePath:n,Ls=!t.active&&It.length>0&&It.every($=>$.projectKind==="fresh"),Fn=t.active?CY(wn):!!n&&!Ls,Cr=g.useMemo(()=>xn?`?projectPath=${encodeURIComponent(xn)}`:"",[xn]),{pinnedKeys:Zr,pinnedKeySet:So,listOrder:Ma,togglePin:Ds,pinItem:$i,reorder:Gn}=PK(xn),ji=g.useRef(null),hr=g.useRef(null),pn=typeof window>"u"?"/":jR(window.location.pathname)??"/",bn=g.useRef(null),qr=g.useRef(!1),Oa=g.useCallback(($,ae)=>{ae.button!==0&&ae.pointerType==="mouse"||(ae.preventDefault(),ry(),bn.current={kind:"live",variantId:$,startX:ae.clientX,startY:ae.clientY,committed:!1})},[]),La=g.useCallback(($,ae)=>{ae.button!==0&&ae.pointerType==="mouse"||(ae.preventDefault(),ry(),bn.current={kind:"past",entry:$,startX:ae.clientX,startY:ae.clientY,committed:!1})},[]);g.useEffect(()=>{const $=he=>{const _e=bn.current;if(!_e)return;const Se=he.clientX-_e.startX,qe=he.clientY-_e.startY;if(!_e.committed){if(Se*Se+qe*qe<Ek*Ek)return;if(ry(),_e.kind==="live"){const Te=Be.find(mn=>mn.workItemId===_e.variantId);if(!Te||Te.status!=="succeeded"){bn.current=null;return}const ln=bk({sessionId:xe,variant:Te,projectContext:wn,routePath:pn});b({sessionId:xe??"",variantId:Te.workItemId,label:Te.label||"Direction",url:ln,source:"live",runLabel:Te.runLabel,description:Te.description})}else{const{entry:Te}=_e,ln=Tc(Te),mn=ln?SY({sessionId:Te.sessionId,variantId:Te.variantId,routePath:pn}):`/api/variants/history/${encodeURIComponent(Te.sessionId)}/${encodeURIComponent(Te.variantId)}/preview${Cr}`;if(b({sessionId:Te.sessionId,variantId:Te.variantId,label:Te.label||"Direction",url:mn,source:ln?"history-dev-server":"history-static",runLabel:Te.runLabel,description:Te.brief}),ln){const Xr=Pk(`/api/variants/history/${encodeURIComponent(Te.sessionId)}/${encodeURIComponent(Te.variantId)}/run${Cr}`,"targetAddressed","1");(async()=>{try{if(!(await fetch(Xr,{method:"POST"})).ok)return;const Yn=Pk(mn,"replay",String(Date.now()));b(et=>!et||et.sessionId!==Te.sessionId||et.variantId!==Te.variantId||et.source!=="history-dev-server"?et:{...et,url:Yn}),M(et=>{if(!et)return et;const Pt=vs=>!vs||vs.sessionId!==Te.sessionId||vs.variantId!==Te.variantId?vs:{...vs,url:Yn};return{...et,left:Pt(et.left),right:Pt(et.right)}})}catch(Qr){vn.warn("history replay drag boot failed",Qr)}})()}}_e.committed=!0}C({x:he.clientX,y:he.clientY})},ae=()=>{const he=bn.current;he!=null&&he.committed&&(qr.current=!0,window.setTimeout(()=>{qr.current=!1},0)),bn.current=null,C(null)},ke=he=>{if(he.key!=="Escape")return;const _e=bn.current;_e!=null&&_e.committed&&(_e.kind==="past"&&Tc(_e.entry)&&wu({sessionId:_e.entry.sessionId,variantId:_e.entry.variantId,source:"history-dev-server"}),bn.current=null,b(null),C(null))};return window.addEventListener("pointermove",$),window.addEventListener("pointerup",ae),window.addEventListener("pointercancel",ae),window.addEventListener("keydown",ke),()=>{window.removeEventListener("pointermove",$),window.removeEventListener("pointerup",ae),window.removeEventListener("pointercancel",ae),window.removeEventListener("keydown",ke)}},[Be,xe,wn,pn,Cr,b,C,M]);const Ue=g.useCallback(()=>{var $;($=bn.current)!=null&&$.committed&&(qr.current=!0,window.setTimeout(()=>{qr.current=!1},0)),bn.current=null,C(null),k&&(k.source==="history-dev-server"&&wu({sessionId:k.sessionId,variantId:k.variantId,source:"history-dev-server"}),b(null))},[k,b,C]),Qt=g.useCallback($=>{const ae=!So.has($);Ee.capture(ae?"variants_panel.direction_pinned":"variants_panel.direction_unpinned",{method:"menu"}),Ds($)},[So,Ds]),on=g.useCallback(()=>{k&&(Ee.capture("variants_panel.direction_pinned",{method:"drag"}),$i(`row:past:${k.sessionId}:${k.variantId}`),Ue())},[k,Ue,$i]),An=g.useCallback($=>{Ee.capture("variants_panel.direction_unpinned",{method:"drag"}),Ds($),Ue()},[Ds,Ue]),Gr=g.useCallback(($,ae)=>{Gn($,ae),Ue()},[Gn,Ue]),vt=g.useMemo(()=>{var ae;if(ht||j)return null;const $=A?Be.find(ke=>ke.workItemId===A):null;return A&&!$?null:$?rf($)?$.workItemId:null:t.active?((ae=Be.find(ke=>{var he,_e;return rf(ke)&&(((he=ke.preview)==null?void 0:he.kind)==="static_artifact"||((_e=ke.preview)==null?void 0:_e.kind)==="dev_server")}))==null?void 0:ae.workItemId)??null:null},[A,j,ht,t,Be]),an=ht||Fn&&A===null&&j===null&&vt===null,Kn=g.useCallback(async $=>{var ke,he,_e,Se;if(!xe)return;const ae=($==null?void 0:$.workItemId)??null;B({kind:"switch",variantId:ae??void 0});try{if(((ke=$==null?void 0:$.preview)==null?void 0:ke.kind)==="static_artifact"){if(v(!1),w(null),((he=$.refinement)==null?void 0:he.status)==="succeeded"){const Te=$.preview.url.includes("?")?"&":"?";m(`${$.preview.url}${Te}refinement=${encodeURIComponent($.refinement.workItemId)}`)}else m($.preview.url);p(Te=>Te+1);return}if(ae&&xe&&t.active&&t.projectContext.kind==="fresh"&&((_e=t.projectContext.executionPlan)==null?void 0:_e.mode)!=="vite_app"&&((Se=$==null?void 0:$.preview)==null?void 0:Se.kind)!=="dev_server"){v(!1),w(null),m(`/api/variants/${xe}/static/${ae}`),p(Te=>Te+1);return}const qe=$&&ae?bk({sessionId:xe,variant:$,projectContext:t.active?t.projectContext:null,routePath:pn}):null;if(qe){v(!1),w(null),m(qe),p(Te=>Te+1);return}Ee.capture("variants_panel.preview_display_failed",{sessionId:xe,variantId:ae,previewKind:$?oy($):"none",hasPreview:!!($!=null&&$.preview),hasPort:typeof($==null?void 0:$.port)=="number",errorMessage:"No addressable dev-server preview URL"}),v(!1),w(null)}catch(qe){vn.warn("preview display failed",qe),Ee.capture("variants_panel.preview_display_failed",{sessionId:xe,variantId:ae,previewKind:$?oy($):"none",hasPreview:!!($!=null&&$.preview),hasPort:typeof($==null?void 0:$.port)=="number",errorMessage:qe instanceof Error?qe.message:String(qe)}),v(!1),w(null)}finally{B(null)}},[xe,t,pn,p,m,v,w]),Pr=g.useRef(!1),Sn=g.useRef(null),Kr=g.useRef(0),ii=g.useCallback(()=>{if(Kr.current++,_(!1),x(!1),!Pr.current)return;const $=Sn.current;Pr.current=!1,Sn.current=null;const ae=$?new URLSearchParams({sessionId:$.sessionId,variantId:$.variantId}):null,ke=ae?`/api/variants/history/replay/stop?${ae.toString()}`:"/api/variants/history/replay/stop";fetch(ke,{method:"POST"}).catch(he=>vn.warn("history replay stop failed",he))},[_,x]),uh=g.useCallback(async $=>{if(xe){B({kind:"switch",variantId:$.workItemId});try{const ae=await fetch(`/api/variants/${xe}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:$.workItemId})});if(!ae.ok){const ke=await mi(ae);throw new Error(ke.message??`Preview restoration failed (${ae.status})`)}}catch(ae){vn.warn("preview restoration failed",ae),Ee.capture("variants_panel.preview_display_failed",{sessionId:xe,variantId:$.workItemId,previewKind:"dev_server",hasPreview:!1,hasPort:!1,errorMessage:ae instanceof Error?ae.message:String(ae)})}finally{B(null)}}},[xe]),Ul=g.useCallback($=>{var Se,qe,Te,ln,mn;if(qr.current){qr.current=!1;return}const ae=rf($),ke=$.status==="pending"||$.status==="running"||AY($);ii();const he=oy($),_e=Be.find(Xr=>Xr.workItemId===A);Ee.capture("variants_panel.preview_requested",{sessionId:xe,fromVariantId:_e==null?void 0:_e.workItemId,toVariantId:$.workItemId,variantStatus:$.status,isPreviewReady:ae,isArmed:ke,previewKind:he,hasPreview:!!$.preview,hasPort:typeof $.port=="number",viewEnabled:((qe=(Se=$.actions)==null?void 0:Se.view)==null?void 0:qe.enabled)??null,previewUnavailableReason:((Te=$.previewUnavailable)==null?void 0:Te.reason)??null}),L($.workItemId),F(null),ae?(hr.current=$.workItemId,De(!1),R(!0),Kn($)):(hr.current=null,De(!1),m(null),v(!1),ke&&Ee.capture("variants_panel.preview_armed",{sessionId:xe,fromVariantId:_e==null?void 0:_e.workItemId,toVariantId:$.workItemId,variantStatus:$.status,previewKind:he,hasPreview:!!$.preview,hasPort:typeof $.port=="number",viewEnabled:((mn=(ln=$.actions)==null?void 0:ln.view)==null?void 0:mn.enabled)??null}),BR($)&&uh($)),Ee.capture("variants_panel.preview_switched",{sessionId:xe,fromVariantId:_e==null?void 0:_e.workItemId,toVariantId:$.workItemId,armed:ke})},[A,xe,R,L,F,ii,uh,Kn,Be,m,v]),dh=t.active?`${t.sessionId}:${t.stage}`:"inactive",Ns=g.useRef(!1);g.useEffect(()=>{if(r)return;let $=!1;return(async()=>{try{const ae=await fetch(`/api/variants/history${Cr}`,{credentials:"same-origin"});if(!ae.ok)return;const ke=await ae.json();if($)return;const he=(ke.variants??[]).filter(_e=>{var Se,qe;return((Se=_e.preview)==null?void 0:Se.kind)==="static"||((qe=_e.serve)==null?void 0:qe.kind)==="static"||Tc(_e)});if(!Ns.current&&!rt.current&&dh==="inactive"&&he.length>0&&he.every(_e=>_e.projectKind==="fresh")){const _e=[...he].sort((Se,qe)=>new Date(qe.createdAt).getTime()-new Date(Se.createdAt).getTime()).find(Se=>!Tc(Se));_e&&(Ns.current=!0,F({sessionId:_e.sessionId,variantId:_e.variantId,previewKind:"static"}),De(!1),m(`/api/variants/history/${encodeURIComponent(_e.sessionId)}/${encodeURIComponent(_e.variantId)}/preview${Cr}`))}if(MY(Ot.current,he))return;Ot.current=he,it(he)}catch(ae){vn.warn("Failed to load past variants",ae)}})(),()=>{$=!0}},[r,dh,Cr]);const Wl=g.useCallback(()=>{Pr.current=!1,Sn.current=null,_(!1),x(!1),F(null),L(null),De(!0),v(!1),w(null),m(null),p($=>$+1)},[L,_,x,p,m,w,F,v]),Zl=g.useCallback($=>{if(qr.current){qr.current=!1;return}if(R(!0),F({sessionId:$.sessionId,variantId:$.variantId,previewKind:Tc($)?"dev_server":"static"}),L(null),De(!1),Tc($)){const ae=++Kr.current;Pr.current=!0,Sn.current={sessionId:$.sessionId,variantId:$.variantId},_(!0),x(!0),(async()=>{B({kind:"switch"}),Ee.capture("variants_panel.history_replay_started",{sessionId:$.sessionId,variantId:$.variantId});const ke=he=>Ee.capture("variants_panel.history_replay_failed",{sessionId:$.sessionId,variantId:$.variantId,...he});try{const he=await fetch(`/api/variants/history/${encodeURIComponent($.sessionId)}/${encodeURIComponent($.variantId)}/run${Cr}`,{method:"POST"});if(ae!==Kr.current)return;if(!he.ok){const{errorCode:_e}=await mi(he);vn.warn(`history replay failed: HTTP ${he.status} ${_e??""}`),ke({httpStatus:he.status,errorCode:_e}),Wl();return}x(!1),v(!0),w(null),m(null),p(_e=>_e+1),Ee.capture("variants_panel.history_replay_ready",{sessionId:$.sessionId,variantId:$.variantId})}catch(he){if(ae!==Kr.current)return;vn.warn("history replay failed",he),ke({errorMessage:he instanceof Error?he.message:String(he)}),Wl()}finally{B(null)}})();return}ii(),v(!1),w(null),m(`/api/variants/history/${encodeURIComponent($.sessionId)}/${encodeURIComponent($.variantId)}/preview${Cr}`)},[Wl,B,_,x,p,F,L,m,w,R,v,ii,Cr]),Du=g.useCallback(async()=>{ii();const $=()=>{R(!0),L(null),F(null),De(!0),hr.current=null,v(!1),w(null),m(null),p(ae=>ae+1)};if(!xe){$();return}B({kind:"switch"});try{const ae=await fetch(`/api/variants/${xe}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})});if(!ae.ok){vn.warn(`switch to original failed: HTTP ${ae.status}`);return}$(),v(!0),Ee.capture("variants_panel.preview_switched",{sessionId:xe,fromVariantId:A,toVariantId:null,target:"original",armed:!1})}catch(ae){vn.warn("preview-port original switch failed",ae)}finally{B(null)}},[A,xe,L,F,p,m,w,R,v,ii]),fh=g.useCallback(async $=>{var ke,he;const ae=((he=(ke=$.actions)==null?void 0:ke.commit)==null?void 0:he.enabled)??$.status==="succeeded";if(!(!xe||!ae)){Ee.capture("variants_panel.commit_clicked",{sessionId:xe,variantId:$.workItemId,variantLabel:$.label}),B({kind:"commit",variantId:$.workItemId});try{const _e=await fetch(`/api/variants/${xe}/commit`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:$.workItemId})});if(!_e.ok){const{message:qe,errorCode:Te}=await mi(_e);vn.warn(`commit failed: HTTP ${_e.status} ${Te??""} ${qe??""}`),Ee.capture("variants_panel.commit_failed",{sessionId:xe,variantId:$.workItemId,httpStatus:_e.status,errorCode:Te??null,errorMessage:qe??null}),xt.error("Couldn't send direction",{description:qe??`The server rejected the request (HTTP ${_e.status}). Try again, or pick a different direction.`});return}const Se=await _e.json().catch(()=>null);Ee.capture("variants_panel.commit_succeeded",{sessionId:xe,variantId:$.workItemId,payloadKind:(Se==null?void 0:Se.payloadKind)??null,duplicate:(Se==null?void 0:Se.duplicate)??!1}),xt.success(`Sent "${$.label}" to your project`,{description:(Se==null?void 0:Se.payloadKind)==="project-created"?`Project created at ${(Se==null?void 0:Se.destinationPath)??"destination"}.`:"Direction diff applied to your working tree (uncommitted)."}),(Se==null?void 0:Se.payloadKind)!=="project-created"&&(m(null),v(!1),p(qe=>qe+1))}catch(_e){vn.warn("commit failed",_e),Ee.capture("variants_panel.commit_failed",{sessionId:xe,variantId:$.workItemId,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:_e instanceof Error?_e.message:String(_e)}),xt.error("Couldn't send direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{B(null)}}},[xe,p,m,v]),Da=g.useCallback(async($,ae,ke)=>{Ee.capture("variants_panel.deploy_clicked",{sessionId:$,variantId:ae,variantLabel:ke});try{const he=await fetch(`/api/variants/${$}/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:ae,...n?{projectPath:n}:{}})});if(!he.ok){const{message:qe,errorCode:Te}=await mi(he);return vn.warn(`deploy failed: HTTP ${he.status} ${Te??""} ${qe??""}`),Ee.capture("variants_panel.deploy_failed",{sessionId:$,variantId:ae,httpStatus:he.status,errorCode:Te??null,errorMessage:qe??null}),xt.error("Couldn't deploy this direction",{description:qe??`The server rejected the request (HTTP ${he.status}). Try again.`}),null}const _e=await he.json().catch(()=>null),Se=_e==null?void 0:_e.shareUrl;return Se?(await navigator.clipboard.writeText(Se).catch(()=>{}),Ee.capture("variants_panel.deploy_succeeded",{sessionId:$,variantId:ae}),xt.success(`"${ke}" is live — link copied`,{action:{label:"Open",onClick:()=>window.open(Se,"_blank","noopener")}}),Se):(xt.error("Couldn't deploy this direction",{description:"The deploy host returned an unexpected response."}),null)}catch(he){return vn.warn("deploy failed",he),Ee.capture("variants_panel.deploy_failed",{sessionId:$,variantId:ae,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:he instanceof Error?he.message:String(he)}),xt.error("Couldn't deploy this direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."}),null}},[n]),hh=g.useCallback(async $=>{if(!xe)return;const ae=re[$.workItemId];if(ae){await navigator.clipboard.writeText(ae).catch(()=>{}),xt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(ae,"_blank","noopener")}});return}B({kind:"deploy",variantId:$.workItemId});try{const ke=await Da(xe,$.workItemId,$.label);ke&&de(he=>({...he,[$.workItemId]:ke}))}finally{B(null)}},[xe,re,Da]),ph=g.useCallback(async()=>{if(!(!xe||ct.length===0)){if(Ze){await navigator.clipboard.writeText(Ze).catch(()=>{}),xt.success("Canvas link copied",{action:{label:"Open",onClick:()=>window.open(Ze,"_blank","noopener")}});return}Ee.capture("variants_panel.deploy_clicked",{sessionId:xe,variantId:"canvas",variantLabel:"Canvas",variantCount:ct.length}),B({kind:"deploy-canvas"});try{const $=await fetch(`/api/variants/${xe}/canvas/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantIds:ct.map(Se=>Se.workItemId),...n?{projectPath:n}:{}})});if(!$.ok){const{message:Se,errorCode:qe}=await mi($);vn.warn(`canvas deploy failed: HTTP ${$.status} ${qe??""} ${Se??""}`),Ee.capture("variants_panel.deploy_failed",{sessionId:xe,variantId:"canvas",httpStatus:$.status,errorCode:qe??null,errorMessage:Se??null,variantCount:ct.length}),xt.error("Couldn't share this canvas",{description:Se??`The server rejected the request (HTTP ${$.status}). Try again.`});return}const ae=await $.json().catch(()=>null),ke=ae==null?void 0:ae.shareUrl;if(!ke){xt.error("Couldn't share this canvas",{description:"The deploy host returned an unexpected response."});return}const he=Object.fromEntries(((ae==null?void 0:ae.variants)??[]).filter(Se=>typeof Se.variantId=="string"&&typeof Se.shareUrl=="string").map(Se=>[Se.variantId,Se.shareUrl])),_e=Object.keys(he).length>0?{...re,...he}:re;_e!==re&&de(_e),await navigator.clipboard.writeText(ke).catch(()=>{}),fe({key:Tk(ct,_e),shareUrl:ke}),Ee.capture("variants_panel.deploy_succeeded",{sessionId:xe,variantId:"canvas",variantCount:ct.length}),xt.success("Canvas is live — link copied",{action:{label:"Open",onClick:()=>window.open(ke,"_blank","noopener")}})}catch($){vn.warn("canvas deploy failed",$),Ee.capture("variants_panel.deploy_failed",{sessionId:xe,variantId:"canvas",httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:$ instanceof Error?$.message:String($),variantCount:ct.length}),xt.error("Couldn't share this canvas",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{B(null)}}},[Ze,ct,re,n,xe]),ig=g.useCallback(async $=>{const ae=`${$.sessionId}:${$.variantId}`,ke=oe[ae];if(ke){await navigator.clipboard.writeText(ke).catch(()=>{}),xt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(ke,"_blank","noopener")}});return}We(ae);try{const he=await Da($.sessionId,$.variantId,$.label);he&&je(_e=>({..._e,[ae]:he}))}finally{We(null)}},[oe,Da]),Nu=g.useCallback(async $=>{if(xe){Ee.capture("variants_panel.remove_clicked",{sessionId:xe,variantId:$.workItemId,variantLabelLength:$.label.length}),B({kind:"remove",variantId:$.workItemId});try{const ae=await fetch(`/api/variants/${xe}/${$.workItemId}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!ae.ok){const{message:ke}=await mi(ae);vn.warn(`remove failed: HTTP ${ae.status} ${ke??""}`),xt.error("Couldn't remove direction",{description:ke??`The server rejected the request (HTTP ${ae.status}). Try again.`});return}($.workItemId===vt||$.workItemId===A)&&(L(null),m(null),v(!1),p(ke=>ke+1))}catch(ae){vn.warn("remove failed",ae),xt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{B(null)}}},[xe,A,vt,L,m,v,p]),Ft=g.useCallback(async $=>{if(!xn){xt.error("Couldn't remove direction",{description:"No project path available."});return}Ee.capture("variants_panel.remove_past_clicked",{sessionId:$.sessionId,variantId:$.variantId});const ae=`${$.sessionId}:${$.variantId}`,ke=he=>he.sessionId===$.sessionId&&he.variantId===$.variantId;B({kind:"remove",variantId:ae}),it(he=>he.filter(_e=>!ke(_e))),j===ae&&(F(null),m(null),v(!1),p(he=>he+1));try{const he=await fetch(`/api/variants/history/${encodeURIComponent($.sessionId)}/${encodeURIComponent($.variantId)}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectPath:xn})});if(!he.ok){const{message:_e}=await mi(he);it(Se=>Se.some(ke)?Se:[...Se,$]),xt.error("Couldn't remove direction",{description:_e??`The server rejected the request (HTTP ${he.status}). Try again.`})}}catch(he){vn.warn("remove past failed",he),it(_e=>_e.some(ke)?_e:[..._e,$]),xt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{B(null)}},[xn,j,F,m,v,p]),mh=g.useCallback($=>{X($)},[]),$u=g.useCallback($=>{if(!$.label||!$.run)return;const ae=$.rows.flatMap(he=>he.kind==="active"?[he.variant]:[]),ke=$.rows.flatMap(he=>he.kind==="past"?[he.entry]:[]);ae.length===0&&ke.length===0||X({kind:"run",label:$.label,variants:ae,entries:ke})},[]),gh=g.useCallback(async()=>{if(!(!D||ce)){se(!0);try{if(D.kind==="active")await Nu(D.variant);else if(D.kind==="past")await Ft(D.entry);else{for(const $ of D.variants)await Nu($);for(const $ of D.entries)await Ft($)}}finally{se(!1),X(null)}}},[D,ce,Nu,Ft]),[Na,og]=g.useState(null),[vh,Eo]=g.useState(null),gs=g.useCallback($=>{Eo($)},[]),ag=g.useCallback(()=>{Eo(null)},[]),Yr=g.useCallback(async $=>{const ae=$.trim();if(ae)try{await navigator.clipboard.writeText(ae),xt.success("Copied")}catch{xt.error("Couldn't copy")}},[]),lg=g.useCallback(async($,ae)=>{Eo(null);const ke=ae.trim();if(!ke||$.kind==="original")return;if($.kind==="active"){if(!xe||ke===$.variant.label)return;Ee.capture("variants_panel.rename",{sessionId:xe,variantId:$.variant.workItemId,labelLength:ke.length,past:!1});try{const Se=await fetch(`/api/variants/${xe}/${$.variant.workItemId}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:ke})});if(!Se.ok){const{message:qe}=await mi(Se);xt.error("Couldn't rename direction",{description:qe??`The server rejected the request (HTTP ${Se.status}). Try again.`})}}catch(Se){vn.warn("rename failed",Se),xt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}return}const{entry:he}=$;if(ke===he.label.trim())return;if(!xn){xt.error("Couldn't rename direction",{description:"No project path available."});return}Ee.capture("variants_panel.rename",{sessionId:he.sessionId,variantId:he.variantId,labelLength:ke.length,past:!0});const _e=Se=>Se.sessionId===he.sessionId&&Se.variantId===he.variantId;it(Se=>Se.map(qe=>_e(qe)?{...qe,label:ke}:qe));try{const Se=await fetch(`/api/variants/history/${encodeURIComponent(he.sessionId)}/${encodeURIComponent(he.variantId)}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:ke,projectPath:xn})});if(!Se.ok){const{message:qe}=await mi(Se);it(Te=>Te.map(ln=>_e(ln)?{...ln,label:he.label}:ln)),xt.error("Couldn't rename direction",{description:qe??`The server rejected the request (HTTP ${Se.status}). Try again.`})}}catch(Se){vn.warn("rename failed",Se),it(qe=>qe.map(Te=>_e(Te)?{...Te,label:he.label}:Te)),xt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}},[xe,xn]),[cg,ju]=g.useState(null),ql=g.useCallback($=>{ju($)},[]),Gl=g.useCallback(()=>{ju(null)},[]),$a=g.useCallback(async($,ae)=>{if(ju(null),!$.label||!$.run)return;const ke=$.label,he=ae.trim();if(!he||he===ke)return;Ee.capture("variants_panel.rename_run",{runLabelLength:he.length});const _e="requestId"in $.run?$.run.requestId:void 0,Se=_e?$.key:HR({sessionId:$.run.sessionId,runLabel:he}),qe=Se!==$.key;let Te=!1,ln=!1;if(n!==null&&qe){const et=qp(n);Te=et.has($.key),ln=et.has(Se),Te&&(et.add(Se),iy(n,et),W())}const mn=et=>{if(n===null||!qe)return;const Pt=qp(n);et?Pt.delete($.key):(Te?Pt.add($.key):Pt.delete($.key),ln?Pt.add(Se):Pt.delete(Se)),iy(n,Pt),W()},Xr=new Set($.rows.flatMap(et=>et.kind==="past"?[`${et.entry.sessionId}:${et.entry.variantId}`]:[])),Qr=et=>Xr.has(`${et.sessionId}:${et.variantId}`);it(et=>et.map(Pt=>Qr(Pt)?{...Pt,runLabel:he}:Pt));const Yn=()=>it(et=>et.map(Pt=>Qr(Pt)?{...Pt,runLabel:ke}:Pt));try{const et=await fetch("/api/variants/runs/rename",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:$.run.sessionId,..._e?{requestId:_e}:{},runLabel:ke,label:he,...xn?{projectPath:xn}:{}})});if(et.ok)mn(!0);else{const{message:Pt}=await mi(et);Yn(),mn(!1),xt.error("Couldn't rename run",{description:Pt??`The server rejected the request (HTTP ${et.status}). Try again.`})}}catch(et){vn.warn("run rename failed",et),Yn(),mn(!1),xt.error("Couldn't rename run",{description:"Network or server error. Try again."})}},[xn,n,it]);g.useEffect(()=>{if(ji.current!==xe){const ae=ji.current===null;if(ji.current=xe,hr.current=null,fe(null),m(null),v(!1),w(null),R(),L(null),F(null),De(!1),Ns.current=!1,!ae)return}if(j||ht||!vt||t.active!==!0||hr.current===vt)return;const $=Be.find(ae=>ae.workItemId===vt);$&&(hr.current=vt,R(),Kn($))},[xe,j,ht,vt,t,Be,Kn,R,L,F,m,w,v]),g.useEffect(()=>{!N||!kr||(hr.current=null,F(null),L(kr.workItemId),De(!1))},[kr,N,xe,L,F]),g.useEffect(()=>{!N||kr||Os||F(null)},[kr,N,Os,xe,F,It]),g.useEffect(()=>{const $=Q.trim().toLowerCase(),ae=[...Be.map(Te=>({kind:"active",variant:Te})),...It.map(Te=>({kind:"past",entry:Te})),...Fn?[{kind:"original"}]:[]],ke=$?ae.filter(Te=>Ik(Te,$)):ae,{pinned:he,unpinned:_e}=Ak(Mk(Ck(ke,xe),Ma),Zr,xe),Se=[...Y.has(v2)?[]:he,..._e.flatMap(Te=>Te.key!==""&&Y.has(Te.key)?[]:Te.rows)];if(Se.length===0)return;const qe=Te=>{if(gK())return;if(Te.key==="Enter"){const Pt=Be.find(vs=>vs.workItemId===Na);Pt&&(Te.preventDefault(),Ul(Pt));return}if(Te.key!=="ArrowUp"&&Te.key!=="ArrowDown")return;Te.preventDefault();const ln=A??vt;let mn=ln?`live:${ln}`:null;j?mn=`past:${j}`:an&&(mn=FR);const Xr=mn?Se.findIndex(Pt=>xu(Pt)===mn):-1;let Qr;if(Xr===-1?Qr=Te.key==="ArrowDown"?0:Se.length-1:Te.key==="ArrowDown"?Qr=Math.min(Xr+1,Se.length-1):Qr=Math.max(Xr-1,0),Qr===Xr)return;const Yn=Se[Qr];Yn.kind==="active"?Ul(Yn.variant):Yn.kind==="past"?Zl(Yn.entry):Du();const et=document.querySelector(`[data-variant-key="${xu(Yn)}"]`);et instanceof HTMLElement&&et.focus({preventScroll:!0})};return window.addEventListener("keydown",qe),()=>window.removeEventListener("keydown",qe)},[Be,It,Q,Fn,Y,Zr,Ma,xe,A,j,an,vt,Na,Ul,Zl,Du]);const ko=Be.find($=>$.workItemId===vt)??null,Fu=j?It.find($=>`${$.sessionId}:${$.variantId}`===j)??null:null,yh=!!Fu,Vu=t.active?t.artifacts??[]:[],oi=[...(t.active?Be:[]).map($=>({kind:"active",variant:$})),...It.map($=>({kind:"past",entry:$})),...Fn?[{kind:"original"}]:[]],Co=Q.trim().toLowerCase(),Hu=Co?oi.filter($=>Ik($,Co)):oi,zu=Mk(Ck(Hu,xe),Ma),{pinned:Ct,unpinned:_h}=Ak(zu,Zr,xe);let Bu=null;k&&(Bu=k.source==="live"?`live:${k.variantId}`:`past:${k.sessionId}:${k.variantId}`);const Uu=new Set(Be.map($=>$.requestId).filter(Boolean)),Wu=e.filter($=>!Uu.has($.requestId)),ja=Wu.length>0,Kl=r&&!ja&&oi.length===0;return S.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[oi.length>0?S.jsx("div",{className:"pt-2 pr-5 pb-1 pl-3",children:S.jsxs("div",{className:"relative",children:[S.jsx(vG,{size:13,className:"text-content-muted pointer-events-none absolute top-1/2 left-2 -translate-y-1/2"}),S.jsx("input",{type:"text",value:Q,onChange:$=>q($.target.value),placeholder:"Search directions…","aria-label":"Search directions",className:"border-main-border bg-main-input/40 text-content placeholder:text-content-muted focus:ring-content-muted/40 w-full rounded-md border py-1.5 pr-2 pl-7 text-xs focus:ring-1 focus:outline-none"})]})}):null,S.jsxs("div",{className:"flex-1 [scrollbar-gutter:stable] overflow-y-auto px-3 py-2",children:[ja?S.jsx(KY,{groups:Wu}):null,Kl?S.jsx(YY,{}):null,t.active&&oi.length===0&&!ja&&!Kl?S.jsx(XY,{}):null,!t.active&&!ja&&!Kl&&It.length===0&&!Fn?S.jsx(QY,{isMCPSession:d,mcpEditor:h}):null,oi.length>0&&Hu.length===0?S.jsxs("p",{className:"text-content-muted px-1 py-6 text-center text-xs",children:["No directions match “",Q.trim(),"”."]}):null,Hu.length>0?S.jsx(FY,{groups:_h,pinned:Ct,pinnedKeys:So,draggedRowKey:Bu,onDropPin:on,onDropUnpin:An,onTogglePin:Qt,onReorder:Gr,collapsedRuns:Y,onToggleRun:V,activeVariantId:A??vt,activePastKey:j,isOriginalSelected:an,busy:J,editingKey:vh,onSelectActive:Ul,onSelectPast:Zl,onSelectOriginal:Du,onActivePointerDown:Oa,onPastPointerDown:La,onHover:og,onRemove:$=>mh({kind:"active",variant:$}),onRemovePast:$=>mh({kind:"past",entry:$}),onStartRename:gs,onCommitRename:lg,onCancelRename:ag,editingRunKey:cg,onStartRunRename:ql,onCommitRunRename:$a,onCancelRunRename:Gl,onRemoveRun:$u,onCopyVariantContext:Yr,activeSessionId:t.active?t.sessionId:null,projectPath:xn}):null,t.active&&u?S.jsx(WY,{artifacts:Vu}):null]}),yh&&Fu?S.jsx(zY,{entry:Fu,deploying:Ce===j,deployedUrl:j?oe[j]??null:null,onDeploy:ig,isDeployDisabled:!i}):null,!yh&&t.active?S.jsx(GY,{selectedVariant:ko,busy:J,onSend:fh,onDeploy:hh,onDeployCanvas:ph,canDeploy:i&&(wn==null?void 0:wn.kind)==="fresh",canDeployCanvas:i&&o&&(wn==null?void 0:wn.kind)==="fresh",canSendToAgent:l,canvasVariantCount:ct.length,canvasDeployedUrl:Ze,deployedUrl:ko?re[ko.workItemId]??null:null}):null,S.jsx(DY,{target:D,isConfirming:ce,onCancel:()=>X(null),onConfirm:gh})]})},LY=t=>t.kind==="active"?t.variant.label.trim()||"this direction":t.kind==="run"?t.label.trim()||"this run":t.entry.label.trim()||"this direction",DY=({target:t,isConfirming:e,onCancel:n,onConfirm:r})=>{if(!t)return null;const s=LY(t),i=t.kind==="run",o=i?t.variants.length+t.entries.length:0,l=i?"Remove run":"Remove direction";return S.jsx(tx,{open:!0,onOpenChange:u=>{!u&&!e&&n()},children:S.jsxs(nx,{children:[S.jsx(rx,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(sx,{className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[360px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(ix,{className:"text-content text-base font-medium",children:i?"Remove run?":"Remove direction?"}),S.jsx(ox,{className:"text-content-subtle text-sm leading-5",children:i?`This removes all ${o} directions in “${s}”.`:`This removes “${s}” from the directions list.`}),S.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[S.jsx("button",{type:"button",onClick:n,disabled:e,className:"text-content-subtle hover:bg-main-hover hover:text-content rounded-md px-3 py-1.5 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),S.jsx("button",{type:"button","aria-label":"Confirm remove direction",onClick:r,disabled:e,className:"rounded-md bg-red-500/15 px-3 py-1.5 text-sm font-medium text-red-200 transition-colors hover:bg-red-500/25 disabled:cursor-not-allowed disabled:opacity-50",children:e?"Removing...":l})]})]})})]})})},xu=t=>t.kind==="active"?`live:${t.variant.workItemId}`:t.kind==="past"?`past:${t.entry.sessionId}:${t.entry.variantId}`:FR,Ik=(t,e)=>t.kind==="active"?sy(e,t.variant.label,t.variant.runLabel):t.kind==="past"?sy(e,t.entry.label,t.entry.runLabel,t.entry.brief):sy(e,Ax,VR),UR=(t,e)=>t.startsWith("live:")?`row:past:${e??""}:${t.slice(5)}`:`row:${t}`,WR=(t,e)=>UR(xu(t),e),Ak=(t,e,n)=>{if(e.length===0)return{pinned:[],unpinned:t};const r=new Set(e),s=new Map,i=[];for(const l of t){const u=[];for(const d of l.rows){const h=WR(d,n);r.has(h)?s.set(h,d):u.push(d)}u.length>0&&i.push(u.length===l.rows.length?l:{...l,rows:u})}return{pinned:e.flatMap(l=>{const u=s.get(l);return u?[u]:[]}),unpinned:i}},Rk=(t,e,n)=>{if(!e||e.length===0)return t;const r=new Map(e.map((o,l)=>[o,l])),s=t.filter(o=>!r.has(n(o)));if(s.length===t.length)return t;const i=t.filter(o=>r.has(n(o))).sort((o,l)=>r.get(n(o))-r.get(n(l)));return[...s,...i]},Mk=(t,e)=>{const n=t.map(r=>{const s=e.rows[r.key];return!s||s.length===0?r:{...r,rows:Rk(r.rows,s,xu)}});return Rk(n,e.groups,r=>r.key)},NY=t=>t.length<=kk?t:`${t.slice(0,kk-1)}…`,$Y=(t,e)=>t.kind==="active"?e?`${e}:${t.variant.workItemId}`:null:t.kind==="past"?`${t.entry.sessionId}:${t.entry.variantId}`:null,jY=t=>{var i,o;const e=[t.label.trim(),(i=t.description)==null?void 0:i.trim()].filter(l=>!!l).join(`
112
+ `);if(!t.reference)return e;const n=((o=t.projectPath)==null?void 0:o.trim())??"",r=n?` --project '${n.replace(/'/g,"'\\''")}'`:"",s=[`Rivet variant: ${t.reference}`,"To inspect the full variant context, run:",`rivet variants get ${t.reference}${r}`].join(`
113
+ `);return e?`${e}
114
+
115
+ ${s}`:s},FY=({groups:t,pinned:e,pinnedKeys:n,draggedRowKey:r,onDropPin:s,onDropUnpin:i,onTogglePin:o,onReorder:l,collapsedRuns:u,onToggleRun:d,activeVariantId:h,activePastKey:p,isOriginalSelected:m,busy:v,editingKey:w,onSelectActive:_,onSelectPast:x,onSelectOriginal:b,onActivePointerDown:k,onPastPointerDown:C,onHover:T,onRemove:I,onRemovePast:M,onStartRename:R,onCommitRename:A,onCancelRename:L,editingRunKey:N,onStartRunRename:F,onCommitRunRename:j,onCancelRunRename:Q,onRemoveRun:q,onCopyVariantContext:Z,activeSessionId:W,projectPath:Y})=>{const V=g.useRef(null),{activeIndex:J,itemRects:B,sessionRef:D,handlers:X,registerItem:ce}=oR(V,{snapTolerancePx:5}),[se,re]=g.useState(!1),[de,ye]=g.useState(!1),fe=u.has(v2),oe=r!==null,je=g.useMemo(()=>{if(!r)return null;const Re=UR(r,W);if(n.has(Re))return{container:jd,key:Re};const Ze=t.find(xe=>xe.rows.some(St=>xu(St)===r));return Ze?{container:ny(Ze.key),key:r}:null},[r,n,t,W]),Ce=(je==null?void 0:je.container)===jd,{dropTarget:We,onPointerMove:at,onPointerUp:it}=TK({containerRef:V,dragged:je,yieldToSelector:Ce?void 0:"[data-pinned-drop-zone]",restrictToSelector:Ce?"[data-pinned-drop-zone]":void 0,onReorder:l}),Ot=J!==null?B[J]:null,ht=Re=>Re.kind==="active"?Re.variant.workItemId===h:Re.kind==="past"?`${Re.entry.sessionId}:${Re.entry.variantId}`===p:m,De=(Re,Ze,xe,St)=>{const It=xu(Re),kr=WR(Re,W);return S.jsx(HY,{rowKey:It,row:Re,index:Ze,isSelected:ht(Re),isEditing:w===It,isPinned:n.has(kr),onTogglePin:()=>o(kr),reorderContainer:xe,reorderKey:xe===jd?kr:It,isNested:St,busy:v,registerItem:ce,onSelectActive:_,onSelectPast:x,onSelectOriginal:b,onActivePointerDown:k,onPastPointerDown:C,onHover:T,onRemove:I,onRemovePast:M,onStartRename:R,onCommitRename:A,onCancelRename:L,onCopyVariantContext:Z,activeSessionId:W,projectPath:Y},It)};let rt=0;const Be=Re=>{if(Re.key==="")return Re.rows.map(It=>De(It,rt++,ny(Re.key),!1));const Ze=u.has(Re.key),xe=Ze?null:Re.rows.map(It=>De(It,rt++,ny(Re.key),!0)),St=Re.label;return S.jsx(VY,{label:St??Ax,collapsed:Ze,onToggle:()=>d(Re.key),directionCount:Re.rows.length,isEditing:St!==null&&N===Re.key,onStartRename:St!==null?()=>F(Re.key):void 0,onCommitRename:St!==null?It=>j(Re,It):void 0,onCancelRename:Q,onRemove:St!==null?()=>q(Re):void 0,children:xe},Re.key)},ct=e.length>0||oe;return S.jsxs("div",{ref:V,className:"relative",onMouseEnter:X.onMouseEnter,onMouseMove:X.onMouseMove,onMouseLeave:X.onMouseLeave,onPointerMove:at,onPointerUp:Re=>{var Ze;if(Ce&&je){const xe=(Ze=V.current)==null?void 0:Ze.querySelector("[data-pinned-drop-zone]"),St=xe==null?void 0:xe.getBoundingClientRect();if(!(St!==void 0&&Re.clientY>=St.top&&Re.clientY<=St.bottom)){i(je.key);return}}it()},children:[je&&We?S.jsx("div",{className:"bg-content-muted pointer-events-none absolute right-1 left-1 z-20 h-0.5 rounded-full",style:{top:We.top}}):null,S.jsx(us,{children:Ot&&S.jsx(ni.div,{className:"bg-hover pointer-events-none absolute z-0 rounded-md",initial:{opacity:0,top:Ot.top,left:Ot.left,width:Ot.width,height:Ot.height},animate:{opacity:1,top:Ot.top,left:Ot.left,width:Ot.width,height:Ot.height},exit:{opacity:0,transition:{duration:.06}},transition:{...Tf.fast,opacity:{duration:.08}}},D.current)}),S.jsxs("ul",{className:"relative flex flex-col gap-2",children:[S.jsx(us,{initial:!1,children:ct?S.jsxs(ni.li,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:g2,ease:m2},"data-pinned-drop-zone":"",className:jn("overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",oe&&"ring-content-muted/30 ring-1",oe&&se&&"ring-content-muted/70 bg-white/[0.03]"),onPointerEnter:oe?()=>re(!0):void 0,onPointerLeave:oe?()=>re(!1):void 0,onPointerUp:oe?()=>{re(!1),s()}:void 0,children:[S.jsx("div",{"data-hover-dead-zone":"",children:S.jsxs("button",{type:"button",onClick:()=>d(v2),"aria-expanded":!fe,"aria-label":`${fe?"Expand":"Collapse"} pinned items`,className:"focus-visible:ring-content-muted/40 flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-white/[0.03] focus:outline-none focus-visible:ring-1 focus-visible:ring-inset",children:[S.jsx(LA,{size:13,weight:"fill",className:"text-content-muted shrink-0"}),S.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:"Pinned"})]})}),S.jsx(us,{initial:!1,children:!fe&&S.jsx(ni.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:g2,ease:m2},className:"overflow-hidden",children:e.length>0?S.jsx("ul",{className:"flex flex-col gap-2",children:e.map(Re=>De(Re,rt++,jd,!1))}):null},"body")})]},"pinned-section"):null}),ct&&t.length>0?S.jsxs("li",{className:jn("mt-2 overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",Ce&&"ring-content-muted/30 ring-1",Ce&&de&&"ring-content-muted/70 bg-white/[0.03]"),onPointerEnter:Ce?()=>ye(!0):void 0,onPointerLeave:Ce?()=>ye(!1):void 0,onPointerUp:Ce?()=>ye(!1):void 0,children:[S.jsxs("div",{"data-hover-dead-zone":"",className:"flex w-full items-center gap-2 px-3 py-2",children:[S.jsx(wG,{size:13,weight:"fill",className:"text-content-muted shrink-0"}),S.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:"Directions"})]}),S.jsx("ul",{className:"flex flex-col gap-2",children:t.map(Re=>Be(Re))})]}):t.map(Re=>Be(Re))]})]})},ZR=({open:t,onOpenChange:e,triggerLabel:n,actions:r})=>{const{containerRef:s,onKeyDown:i}=aR();return S.jsxs(yx,{open:t,onOpenChange:e,children:[S.jsx(Hl,{label:n,children:S.jsx(_x,{asChild:!0,children:S.jsx("button",{type:"button","aria-label":n,onClick:o=>o.stopPropagation(),onPointerDown:o=>o.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1",children:S.jsx(pG,{size:15,weight:"bold"})})})}),S.jsx(wx,{children:S.jsx(xx,{ref:s,onKeyDown:i,role:"menu",side:"bottom",align:"end",sideOffset:4,onCloseAutoFocus:o=>o.preventDefault(),className:"bg-surface-2 z-[60] min-w-[160px] rounded-lg p-1 shadow-lg",children:r.map(o=>S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,disabled:o.disabled,onClick:l=>{l.stopPropagation(),e(!1),o.onSelect()},onPointerDown:l=>l.stopPropagation(),className:"text-content hover:bg-hover focus:bg-hover flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[o.icon,o.label]},o.key))})})]})},VY=({label:t,collapsed:e,directionCount:n,onToggle:r,isEditing:s=!1,onStartRename:i,onCommitRename:o,onCancelRename:l,onRemove:u,children:d})=>{const h=Yf(),[p,m]=g.useState(!1),v=[...i?[{key:"rename",label:"Rename",icon:S.jsx(MA,{size:13,weight:"bold"}),onSelect:i}]:[],...u?[{key:"remove",label:"Remove",icon:S.jsx(zA,{size:13,weight:"bold"}),onSelect:u}]:[]],w=e?S.jsx(gG,{size:13,weight:"fill",className:"shrink-0 text-sky-400"}):S.jsx(mG,{size:13,weight:"fill",className:"shrink-0 text-sky-400"});return s&&o&&l?S.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[S.jsxs("div",{"data-hover-dead-zone":"",className:"bg-main-input flex w-full items-center gap-2 px-3 py-2",children:[w,S.jsx("span",{className:"min-w-0 flex-1",children:S.jsx(qR,{initial:t,onCommit:o,onCancel:l})})]}),S.jsx(us,{initial:!1,children:!e&&S.jsx(ni.ul,{className:"overflow-hidden",children:d},"body")})]}):S.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[S.jsxs("div",{"data-hover-dead-zone":"",className:"group relative",children:[S.jsxs("button",{type:"button",onClick:_=>{if((_.metaKey||_.ctrlKey)&&v.length>0){m(!0);return}h==null||h.capture("variants_panel.folder_toggled",{isCollapsed:!e,directionCount:n}),r()},"aria-expanded":!e,"aria-label":`${e?"Expand":"Collapse"} ${t} directions`,className:"focus-visible:ring-content-muted/40 flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-white/[0.03] focus:outline-none focus-visible:ring-1 focus-visible:ring-inset",children:[w,S.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:t})]}),v.length>0&&S.jsx("div",{className:jn("absolute top-1.5 right-2 flex items-center gap-0.5 transition-opacity duration-150","pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 has-[:focus-visible]:pointer-events-auto has-[:focus-visible]:opacity-100",p&&"pointer-events-auto opacity-100"),children:S.jsx(ZR,{open:p,onOpenChange:m,triggerLabel:`${t} run actions`,actions:v})})]}),S.jsx(us,{initial:!1,children:!e&&S.jsx(ni.ul,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:g2,ease:m2},className:"overflow-hidden",children:d},"body")})]})},HY=({rowKey:t,row:e,index:n,isSelected:r,isEditing:s,isPinned:i,onTogglePin:o,reorderContainer:l,reorderKey:u,isNested:d,busy:h,registerItem:p,onSelectActive:m,onSelectPast:v,onSelectOriginal:w,onActivePointerDown:_,onPastPointerDown:x,onHover:b,onRemove:k,onRemovePast:C,onStartRename:T,onCommitRename:I,onCancelRename:M,onCopyVariantContext:R,activeSessionId:A,projectPath:L})=>{var oe,je;const N=g.useRef(null);pK(p,n,N);const[F,j]=g.useState(!1),Q=e.kind==="active",q=e.kind==="original",Z=e.kind==="active"?e.variant:null,W=e.kind==="past"?e.entry:null,Y=Q?Z.status==="succeeded":!0,V=Q?rf(Z):!0,J=Q&&(Z.status==="pending"||Z.status==="running"),B=Q&&Z.status==="failed",D=Q&&Z.status==="cancelled",X=Q&&(h==null?void 0:h.kind)==="remove"&&h.variantId===Z.workItemId,ce=Q&&(((oe=Z.refinement)==null?void 0:oe.status)==="pending"||((je=Z.refinement)==null?void 0:je.status)==="running");let se=Ax;Q?se=Z.label||`Direction ${n+1}`:W&&(se=W.label.trim()||"Untitled direction");let re=VR;Q?re=Z.description:W&&(re=W.brief);const de=re?NY(re):null,ye=$Y(e,A),fe=ye?"Copy variant reference":"Copy description";return s?S.jsx("li",{ref:N,"data-proximity-index":n,"data-reorder-container":l,"data-reorder-key":u,className:"group relative z-10",children:S.jsx("div",{className:jn("bg-main-input flex w-full items-start gap-2 rounded-md py-2 pr-3",d?"pl-[33px]":"pl-3"),children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsx(qR,{initial:se,onCommit:Ce=>I(e,Ce),onCancel:M}),de&&S.jsx("span",{className:"text-content-muted mt-1 line-clamp-2 block text-xs leading-snug",children:de})]})})}):S.jsxs("li",{ref:N,"data-proximity-index":n,"data-reorder-container":l,"data-reorder-key":u,className:"group relative z-10",children:[S.jsx("div",{role:"button",tabIndex:0,"data-variant-id":Q?Z.workItemId:void 0,"data-variant-key":t,onClick:Ce=>{if(Ce.metaKey||Ce.ctrlKey){j(!0);return}const We=window.getSelection();We&&!We.isCollapsed||(e.kind==="active"?m(e.variant):e.kind==="past"?v(e.entry):w())},onKeyDown:Ce=>{(Ce.key==="Enter"||Ce.key===" ")&&(Ce.preventDefault(),Ce.stopPropagation(),e.kind==="active"?m(e.variant):e.kind==="past"?v(e.entry):w())},onPointerDown:Ce=>{Ce.metaKey||Ce.ctrlKey||(e.kind==="active"?V&&_(e.variant.workItemId,Ce):e.kind==="past"&&x(e.entry,Ce))},"aria-pressed":r,"aria-disabled":Q?!1:void 0,"aria-busy":J||ce,onMouseEnter:Q?()=>b(Z.workItemId):void 0,onMouseLeave:Q?()=>b(null):void 0,className:jn("flex w-full items-start gap-2 rounded-md py-2 pr-3 text-left transition-colors focus:outline-none",d?"pl-[33px]":"pl-3",r&&"bg-main-input",V&&"cursor-grab active:cursor-grabbing",!V&&"cursor-pointer"),style:V?{touchAction:"none"}:void 0,children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[(J||ce)&&S.jsx(kx,{className:"text-content-muted shrink-0 text-sm","data-testid":ce&&!J?"variant-refining":void 0}),S.jsx(Hl,{label:"Double-click to rename",disabled:q,children:S.jsx("span",{onDoubleClick:Ce=>{Ce.stopPropagation(),q||T(t)},className:jn("min-w-0 flex-1 truncate text-sm font-medium select-text",q?"cursor-default":"cursor-text",Y||r?"text-content":"text-content-muted"),children:se})}),B&&S.jsx(Hl,{label:Z.errorMessage??Z.errorCode??"Failed",disabled:!Z.errorMessage&&!Z.errorCode,children:S.jsx("span",{className:"shrink-0",children:S.jsx(Ok,{label:"Failed"})})}),D&&S.jsx(Ok,{label:"Cancelled"})]}),de&&S.jsx("span",{className:"text-content-muted mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug select-text",children:de})]})}),S.jsx("div",{className:jn("absolute top-1.5 right-2 flex items-center gap-0.5 transition-opacity duration-150","pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 has-[:focus-visible]:pointer-events-auto has-[:focus-visible]:opacity-100",F&&"pointer-events-auto opacity-100"),children:S.jsx(ZR,{open:F,onOpenChange:j,triggerLabel:"Direction actions",actions:[...re||ye?[{key:"copy",label:fe,icon:S.jsx(Pf,{size:13,weight:"bold"}),onSelect:()=>R(jY({label:se,description:re,reference:ye,projectPath:L}))}]:[],{key:"pin",label:i?"Unpin":"Pin",icon:S.jsx(LA,{size:13,weight:"bold"}),onSelect:o},...q?[]:[{key:"rename",label:"Rename",icon:S.jsx(MA,{size:13,weight:"bold"}),onSelect:()=>T(t)},{key:"remove",label:"Remove",icon:S.jsx(zA,{size:13,weight:"bold"}),disabled:X,onSelect:()=>{e.kind==="active"?k(e.variant):e.kind==="past"&&C(e.entry)}}]]})})]})},qR=({initial:t,onCommit:e,onCancel:n})=>{const[r,s]=g.useState(t),i=g.useRef(!1),o=g.useCallback(u=>{u&&(u.focus(),u.select())},[]),l=u=>{i.current||(i.current=!0,u?e(r):n())};return S.jsx("input",{ref:o,type:"text",value:r,maxLength:120,"aria-label":"Rename direction",onChange:u=>s(u.target.value),onKeyDown:u=>{u.stopPropagation(),u.key==="Enter"?(u.preventDefault(),l(!0)):u.key==="Escape"&&(u.preventDefault(),l(!1))},onBlur:()=>l(!0),onClick:u=>u.stopPropagation(),onPointerDown:u=>u.stopPropagation(),className:"border-content-muted/40 bg-main text-content focus:ring-content-muted/50 w-full rounded border px-1.5 py-0.5 text-sm font-medium focus:ring-1 focus:outline-none"})},Ok=({label:t})=>S.jsx("span",{className:"bg-main-input text-content-muted shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium tracking-wide uppercase",children:t}),zY=({entry:t,deploying:e,deployedUrl:n,onDeploy:r,isDeployDisabled:s=!1})=>{const o=e?"Deploying…":n?"Copy link":"Share";return S.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 py-4",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),n?S.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}),S.jsxs("button",{type:"button",onClick:()=>r(t),disabled:e||s,title:n?`Copy share link (${n})`:"Deploy this direction and get a public link to share",className:"border-main-border text-content hover:bg-main-input flex shrink-0 items-center gap-1 rounded-md border px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[n&&!e?S.jsx(Pf,{size:12,weight:"bold"}):null,o]})]})},BY={agent_browser:"Browser extracted",cache:"Cached",static:"Bundled catalog",manual:"Manual"},UY={design_context:"DESIGN.md",source_context:"Source",qa_report:"QA",asset:"Asset"},WY=({artifacts:t})=>{const[e,n]=g.useState(null),r=g.useMemo(()=>e&&t.some(i=>i.id===e)?e:null,[t,e]);if(t.length===0)return null;const s=i=>{n(o=>o===i?null:i)};return S.jsxs("section",{"aria-label":"Directions session artifacts",className:"mt-4",children:[S.jsx("div",{className:"flex shrink-0 items-center px-3 py-2",children:S.jsx("span",{className:"text-content truncate text-sm font-medium",children:"Artifacts"})}),S.jsx("ul",{className:"mt-2 space-y-1 px-1",children:t.map(i=>S.jsx(ZY,{artifact:i,isExpanded:i.id===r,onToggle:()=>s(i.id)},i.id))})]})},ZY=({artifact:t,isExpanded:e,onToggle:n})=>{const r=UY[t.kind],s=t.source?BY[t.source]:null,i=[t.kind==="design_context"?null:s,t.summary].filter(Boolean).join(" · "),o=t.kind==="design_context"&&!!t.viewUrl,l=`${e?"Hide":"View"} ${r} artifact${t.label?`: ${t.label}`:""}`;return o?S.jsx("li",{className:"border-main-border rounded-md border",children:S.jsxs("div",{className:"flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs",children:[S.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"border-content-muted/30 bg-main-input text-content-muted shrink-0 rounded-full border px-2 py-0.5 text-[9px] font-semibold tracking-wide uppercase",children:r}),S.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?S.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),S.jsx("a",{href:t.viewUrl,target:"_blank",rel:"noreferrer",onClick:()=>{Ee.capture("visual_editor_design_context_opened",{context_kind:"design_system",artifact_source:t.source})},"aria-label":`Open ${r} artifact${t.label?`: ${t.label}`:""}`,className:"text-content-muted hover:bg-main-input hover:text-content focus-visible:ring-content-muted/40 shrink-0 rounded p-1 transition-colors focus:outline-none focus-visible:ring-1",children:S.jsx(uG,{className:"h-3.5 w-3.5",weight:"bold"})})]})}):S.jsxs("li",{className:"border-main-border rounded-md border",children:[S.jsxs("button",{type:"button",onClick:n,"aria-expanded":e,"aria-label":l,className:"hover:bg-main-input flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs transition-colors",children:[S.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"text-content-muted text-[10px] font-semibold tracking-wide uppercase",children:r}),S.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?S.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),S.jsx("span",{className:"text-content-muted shrink-0 text-[11px]",children:e?"Hide":"View"})]}),e?S.jsx("div",{className:"border-main-border bg-main-light border-t px-3 py-2",children:S.jsx(qY,{artifact:t})}):null]})},qY=({artifact:t})=>S.jsxs("div",{className:"text-content-muted space-y-1 text-[11px]",children:[t.summary?S.jsx("p",{children:t.summary}):null,t.path?S.jsxs("p",{children:["Stored at ",t.path]}):null,!t.summary&&!t.path?S.jsx("p",{children:"No inline content available for this artifact."}):null]}),GY=({selectedVariant:t,busy:e,onSend:n,onDeploy:r,onDeployCanvas:s,canDeploy:i,canDeployCanvas:o,canSendToAgent:l,canvasVariantCount:u,canvasDeployedUrl:d,deployedUrl:h})=>{var R,A,L,N;const p=t?((A=(R=t.actions)==null?void 0:R.commit)==null?void 0:A.enabled)??t.status==="succeeded":!1,m=p&&e===null,v=(e==null?void 0:e.kind)==="commit"&&e.variantId===(t==null?void 0:t.workItemId),w=(e==null?void 0:e.kind)==="deploy"&&e.variantId===(t==null?void 0:t.workItemId),_=(e==null?void 0:e.kind)==="deploy-canvas",x=!i||!p||e!==null,b=o&&u>0,C=w?"Deploying…":h?"Copy link":"Share",I=_?"Sharing…":d?"Copy canvas link":"Share canvas",M=v?"Applying…":"Apply to project";return S.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 py-4",children:[S.jsx("div",{className:"min-w-0",children:t?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),h?S.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}):null}),S.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[S.jsx(ER,{primaryLabel:C,primaryIcon:h&&!w?Pf:void 0,primaryAction:()=>{t&&r(t)},isDisabled:x,isDropdownDisabled:e!==null,isLoading:w,loadingLabel:"Deploying…",dropdownAriaLabel:"More share actions",dropdownItems:b?[{label:I,icon:d&&!_?Pf:void 0,onClick:s,isDisabled:e!==null}]:[]}),l?S.jsx("button",{type:"button",onClick:()=>{t&&n(t)},disabled:!m,title:(N=(L=t==null?void 0:t.actions)==null?void 0:L.commit)==null?void 0:N.reason,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:M}):null]})]})},GR=()=>S.jsx("div",{"data-testid":"direction-skeleton-row","aria-hidden":"true",className:"flex w-full items-start rounded-md px-3 py-2",children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[S.jsx(kx,{className:"text-content-muted shrink-0 text-sm"}),S.jsx("span",{className:"bg-muted-foreground/15 h-3.5 w-28 animate-pulse rounded"})]}),S.jsx("span",{className:"mt-1.5 flex",children:S.jsx("span",{className:"bg-muted-foreground/10 h-2.5 w-full max-w-[14rem] animate-pulse rounded"})})]})}),KY=({groups:t})=>S.jsx("div",{className:"space-y-0.5",children:t.flatMap(e=>Array.from({length:Math.max(1,e.count)}).map((n,r)=>S.jsx(GR,{},`${e.requestId}-${r}`)))}),YY=()=>S.jsx("div",{"data-testid":"direction-boot-skeletons",className:"space-y-0.5",children:Array.from({length:3}).map((t,e)=>S.jsx(GR,{},e))}),XY=()=>S.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[S.jsx("div",{className:"text-content text-sm",children:"No directions yet"}),S.jsx("div",{className:"text-content-muted text-xs",children:"They’ll appear here as they generate."})]}),Lk="Try different ways to create a dropdown that feels fluid and dynamic",QY=({isMCPSession:t=!1,mcpEditor:e=null})=>{const[n,r]=g.useState(!1),s=qK(e),i=t?s:"your coding agent",o=()=>{navigator.clipboard.writeText(Lk).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})};return S.jsxs("div",{className:"flex flex-col items-start gap-3 px-2 py-2",children:[S.jsx("p",{className:"text-content text-sm font-medium",children:"Create your first direction"}),S.jsxs("p",{className:"text-content-muted text-xs",children:["Use ",i," to generate directions."]}),S.jsxs("div",{className:"w-full",children:[S.jsx("p",{className:"text-content-muted mb-2 text-xs",children:"Here's a sample prompt to use:"}),S.jsxs("div",{className:"border-main-border bg-main-input relative rounded-md border px-3 py-2.5 pr-8",children:[S.jsxs("p",{className:"text-content-muted text-xs leading-snug",children:["“",Lk,"”"]}),S.jsx("button",{type:"button",onClick:o,className:"text-content-muted hover:bg-main-border hover:text-content absolute top-2 right-2 rounded p-0.5 transition-colors",title:"Copy to clipboard",children:n?S.jsx(EA,{className:"h-3.5 w-3.5 text-emerald-500",weight:"bold"}):S.jsx(Pf,{className:"h-3.5 w-3.5",weight:"bold"})})]})]})]})},JY=({onClose:t})=>{const e=nt(pR);return t?S.jsxs("div",{className:"z-10 flex flex-shrink-0 items-center justify-between gap-2 border-b border-main-border bg-main-light px-2.5 py-2.5",children:[e?S.jsx("span",{className:"text-content min-w-0 truncate text-sm font-medium",title:e,children:e}):S.jsx("span",{}),S.jsx(Hl,{label:"Close panel",side:"bottom",children:S.jsx("button",{onClick:t,className:"flex h-6 w-6 flex-shrink-0 items-center justify-center rounded p-1 text-content-subtle transition-colors hover:bg-main-input hover:text-content",children:S.jsx(yG,{className:"h-4 w-4",weight:"bold"})})})]}):null},Dk="/assets/arena-Db0j1set.png",eX=ms("useIntegrations"),ay=["integrations"],tX="rivet:connect-result",nX=t=>typeof t=="object"&&t!==null&&t.type===tX,rX=ot(null),Nk=async()=>{const t=await fetch("/api/integrations");if(!t.ok)throw new Error(`Failed to load integrations (${t.status})`);return(await t.json()).integrations??[]},sX=()=>{const t=zC(),[e,n]=S5(rX),r=Vy({queryKey:ay,queryFn:Nk,staleTime:1e4}),s=g.useCallback(async()=>(await t.invalidateQueries({queryKey:ay,refetchType:"none"}),t.fetchQuery({queryKey:ay,queryFn:Nk})),[t]),i=g.useCallback(async l=>{const u=window.open("","_blank","width=560,height=720");if(!u)throw new Error("Popup blocked. Allow popups to connect.");n(l);try{const d=await fetch(`/api/integrations/${l}/connect`,{method:"POST"}),h=await d.json().catch(()=>({}));if(!d.ok||!h.authUrl)throw u.close(),new Error(h.error||`Could not connect ${l}`);return u.location.href=h.authUrl,await new Promise(p=>{let m=!1,v=null;const w=async(x,b=!1)=>{if(!m){m=!0,window.removeEventListener("message",_),v&&clearInterval(v);try{const C=(await s()).some(T=>T.provider===l&&T.status==="connected");p(b&&C?"connected":x)}catch{p(x)}}},_=x=>{if(nX(x.data)&&x.data.provider===l){if(x.data.status==="error"){eX.warn(`Connect failed for ${l}:`,x.data.message),w("failed");return}w("connected")}};window.addEventListener("message",_),v=setInterval(()=>{u.closed&&w("closed",!0)},500)})}finally{n(null)}},[s,n]),o=g.useCallback(async l=>{n(l);try{const u=await fetch(`/api/integrations/${l}`,{method:"DELETE"});if(!u.ok){const d=await u.json().catch(()=>({}));throw new Error(d.error||`Could not disconnect ${l}`)}await s()}finally{n(null)}},[s,n]);return{integrations:r.data??[],isLoading:r.isPending,error:r.error instanceof Error?r.error.message:null,pendingProvider:e,connect:i,disconnect:o,refetch:s}},qc=({onClick:t,title:e,shortcut:n,children:r,disabled:s=!1,className:i="",type:o="button","data-cy":l})=>{const u=S.jsx("button",{onClick:t,disabled:s,className:i,type:o,"data-cy":l,children:r});return e?S.jsx(Ix,{content:S.jsxs("div",{className:"flex flex-row items-center gap-2",children:[S.jsx("span",{children:e}),n?S.jsx("span",{className:"rounded bg-white/15 px-1.5 py-0.5 text-[11px]",children:n}):null]}),children:u}):u},il=({action:t,outcome:e,provider:n,entryPoint:r,durationMs:s,failureReason:i})=>({event:`visual_editor_reference_${t==="connect"?"connection":"disconnection"}_${e}`,properties:{provider:n,entry_point:r,...s!==void 0?{duration_ms:s}:{},...i?{failure_reason:i}:{}}}),$k=ms("ConnectorsModal"),iX=()=>S.jsx("svg",{viewBox:"0 0 24 24",className:"h-6 w-6","aria-hidden":"true",children:S.jsx("path",{fill:"currentColor",d:"M12 0C5.373 0 0 5.372 0 12c0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.781c0-1.669.967-2.915 2.171-2.915 1.024 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.132 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.137.893 2.739.098.119.112.223.083.344-.091.379-.293 1.194-.333 1.361-.052.22-.174.266-.401.16-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.36-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146A12.004 12.004 0 0 0 12 24c6.627 0 12-5.373 12-12C24 5.372 18.627 0 12 0z"})}),oX=()=>S.jsx("span",{"aria-hidden":"true",className:"h-6 w-6 bg-[#b1b1b1]",style:{WebkitMaskImage:`url(${Dk})`,maskImage:`url(${Dk})`,WebkitMaskSize:"contain",maskSize:"contain",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center"}}),aX=[{provider:"pinterest",name:"Pinterest",description:"Pull boards and pins in as visual references.",tileClassName:"bg-[#e60023] text-white",icon:S.jsx(iX,{})},{provider:"arena",name:"Are.na",description:"Connect channels of collected blocks and links.",tileClassName:"bg-[#18181b] text-content",icon:S.jsx(oX,{})}],lX=({meta:t,integration:e,isPending:n,isHighlighted:r,onConnect:s,onDisconnect:i})=>{const o=(e==null?void 0:e.status)==="connected",l=e!=null&&e.externalUsername?`@${e.externalUsername}`:null;return S.jsxs("article",{className:`bg-main-light flex flex-col rounded-xl p-[18px] ${r?"ring-secondary ring-2":""}`,children:[S.jsx("span",{className:`grid h-[52px] w-[52px] flex-none place-items-center rounded-xl ${t.tileClassName}`,"aria-hidden":"true",children:t.icon}),S.jsxs("div",{className:"mt-4 flex-1",children:[S.jsxs("h2",{className:"text-content flex items-center gap-1.5 text-[15px] font-semibold",children:[t.name,o?S.jsx(EA,{className:"h-3.5 w-3.5",weight:"bold","aria-hidden":"true"}):null]}),S.jsx("p",{className:"text-content-subtle mt-1 text-[13px] leading-relaxed",children:t.description}),o&&l?S.jsx("p",{className:"text-content-muted mt-2.5 text-xs font-medium",children:l}):null]}),o?S.jsx("button",{type:"button",onClick:i,disabled:n,className:"active-push bg-main-input text-content-muted mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg px-3.5 text-[13px] font-semibold transition-colors hover:bg-red-500/10 hover:text-red-300 disabled:cursor-not-allowed disabled:opacity-50",children:n?"Disconnecting…":"Disconnect"}):S.jsx("button",{type:"button",onClick:s,disabled:n,className:"active-push bg-secondary text-secondary-foreground hover:bg-accent mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg px-3.5 text-[13px] font-semibold transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:n?"Connecting…":"Connect"})]})},y2=({isOpen:t,onClose:e,context:n="menu",highlightProvider:r=null})=>{const{integrations:s,isLoading:i,error:o,pendingProvider:l,connect:u,disconnect:d}=sX(),h=Yf(),[p,m]=g.useState(null),v=b=>s.find(k=>k.provider===b),w=g.useCallback(b=>{const k=Date.now(),C=il({action:"connect",outcome:"started",provider:b,entryPoint:n});h==null||h.capture(C.event,C.properties),u(b).then(T=>{const I=Date.now()-k;if(T==="connected"){const R=il({action:"connect",outcome:"completed",provider:b,entryPoint:n,durationMs:I});h==null||h.capture(R.event,R.properties);return}const M=il({action:"connect",outcome:"failed",provider:b,entryPoint:n,durationMs:I,failureReason:T==="closed"?"popup_closed":"provider_failed"});h==null||h.capture(M.event,M.properties)}).catch(T=>{const I=T instanceof Error?T.message:"Could not connect.",M=il({action:"connect",outcome:"failed",provider:b,entryPoint:n,durationMs:Date.now()-k,failureReason:I.includes("Popup blocked")?"popup_blocked":"request_failed"});h==null||h.capture(M.event,M.properties),$k.warn(`Connect error for ${b}:`,I),xt.error(I)})},[u,n,h]),_=g.useCallback(b=>{const k=Date.now(),C=il({action:"disconnect",outcome:"started",provider:b,entryPoint:n});h==null||h.capture(C.event,C.properties),d(b).then(()=>{const T=il({action:"disconnect",outcome:"completed",provider:b,entryPoint:n,durationMs:Date.now()-k});h==null||h.capture(T.event,T.properties)}).catch(T=>{const I=T instanceof Error?T.message:"Could not disconnect.",M=il({action:"disconnect",outcome:"failed",provider:b,entryPoint:n,durationMs:Date.now()-k,failureReason:"request_failed"});h==null||h.capture(M.event,M.properties),$k.warn(`Disconnect error for ${b}:`,I),xt.error(I)})},[n,d,h]),x=n==="onboarding";return S.jsx(tx,{open:t,onOpenChange:b=>!b&&e(),children:S.jsxs(nx,{children:[S.jsx(rx,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(sx,{ref:m,className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[560px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:S.jsxs(NR,{value:p,children:[S.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[S.jsx(ix,{className:"text-content text-base font-medium",children:"Connect design references"}),S.jsx(qc,{onClick:e,title:"Close",className:"text-content-subtle hover:bg-main-hover hover:text-content rounded p-1 transition-colors",children:S.jsx(UA,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[S.jsx(ox,{className:"text-content-subtle text-sm",children:"Connect your design references to use them with Rivet’s MCP."}),o?S.jsx("p",{className:"rounded-lg bg-red-500/10 px-4 py-3 text-[13px] font-medium text-red-300",children:o}):null,S.jsx("div",{className:"grid grid-cols-2 gap-4",children:aX.map(b=>S.jsx(lX,{meta:b,integration:v(b.provider),isPending:i||l===b.provider,isHighlighted:r===b.provider,onConnect:()=>w(b.provider),onDisconnect:()=>_(b.provider)},b.provider))}),x?S.jsxs("div",{className:"flex items-center justify-between gap-4",children:[S.jsx("p",{className:"text-content-subtle text-xs",children:"You can always do this later from the account menu."}),S.jsx("button",{type:"button",onClick:e,className:"active-push bg-secondary text-secondary-foreground hover:bg-accent flex-none rounded-lg px-3.5 py-2 text-[13px] font-medium transition-colors",children:"Skip for now"})]}):null]})]})})]})})},jk=({className:t=""})=>S.jsx("span",{"aria-hidden":"true",className:`rivet-skeleton block rounded ${t}`.trim()}),cX=ms("SupportTicketModal"),Fk=5e3,ly="feedback",uX=t=>{var r;if(!t)return null;const e=(r=t.formErrors)==null?void 0:r[0];if(e)return e;const n=t.fieldErrors??{};for(const s of Object.values(n)){const i=s==null?void 0:s[0];if(i)return i}return null},dX=async t=>{let e;try{e=await t.json()}catch{e=void 0}if(t.status===400){if(typeof(e==null?void 0:e.details)=="string"&&e.details.trim())return e.details;if(typeof(e==null?void 0:e.details)=="object"&&e.details!==null){const n=uX(e.details);if(n)return n}return"Please check your feedback and try again."}return t.status>=500?typeof(e==null?void 0:e.details)=="string"&&e.details.trim()?e.details:"Could not send feedback right now. Please try again later.":typeof(e==null?void 0:e.error)=="string"&&e.error.trim()?e.error:`HTTP ${t.status}`},fX=({isOpen:t,onClose:e,contactEmail:n})=>{const r=Yf(),[s,i]=g.useState(""),[o,l]=g.useState(!1),[u,d]=g.useState(null),h=g.useCallback(()=>{i("")},[]),p=g.useCallback(()=>{o||(h(),e())},[o,e,h]),m=g.useCallback(async()=>{const x=s.trim();if(!(!x||o)){l(!0);try{const b=typeof(r==null?void 0:r.get_session_id)=="function"?r.get_session_id():void 0,k=typeof(r==null?void 0:r.get_distinct_id)=="function"?r.get_distinct_id():void 0,C=n==null?void 0:n.trim(),T=await fetch("/api/support/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:ly,message:x,contactEmail:C||void 0,metadata:{posthogSessionId:b??void 0,posthogDistinctId:k??void 0,appVersion:"0.16.3",appEnvironment:"production",pageUrl:window.location.href,userAgent:navigator.userAgent,submittedAt:new Date().toISOString()}})});if(!T.ok){const I=await dX(T);throw new Error(I)}r==null||r.capture("support_ticket_submitted",{ticket_type:ly,has_posthog_session_id:!!b}),xt.success("Feedback sent",{description:"Thanks for sharing this."}),h(),e()}catch(b){const k=b instanceof Error?b.message:"Failed to send message";r==null||r.capture("support_ticket_submit_failed",{ticket_type:ly,error:k}),cX.error("Failed to submit support ticket:",k),xt.error("Could not send feedback",{description:k})}finally{l(!1)}}},[n,o,s,e,r,h]),v=g.useCallback(x=>{x.key==="Enter"&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),m())},[m]),w=Fk-s.length,_=o||s.trim().length===0;return S.jsx(tx,{open:t,onOpenChange:x=>!x&&p(),children:S.jsxs(nx,{children:[S.jsx(rx,{className:"fixed inset-0 z-max bg-black/40"}),S.jsx(sx,{ref:d,className:"fixed left-1/2 top-1/2 z-max w-[440px] -translate-x-1/2 -translate-y-1/2 rounded-lg border border-main-border bg-main font-main shadow-2xl outline-none",children:S.jsxs(NR,{value:u,children:[S.jsxs("div",{className:"flex items-center justify-between rounded-t-lg border-b border-main-border bg-main-light px-4 py-2",children:[S.jsx(ix,{className:"text-base font-medium text-content",children:"Send feedback"}),S.jsx(qc,{onClick:p,disabled:o,title:"Close",className:"rounded p-1 text-content-subtle transition-colors hover:bg-main-hover hover:text-content disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(UA,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(ox,{className:"text-sm text-content-subtle",children:"Tell us what happened or what we can improve."}),S.jsxs("div",{className:"rounded-lg bg-main-input outline outline-1 outline-transparent transition-[outline-color] focus-within:outline-white/20",children:[S.jsx("textarea",{id:"support-ticket-message","aria-label":"Your feedback",value:s,onChange:x=>i(x.target.value),onKeyDown:v,maxLength:Fk,rows:6,disabled:o,placeholder:"What happened?",className:"max-h-64 w-full resize-none overflow-y-auto bg-transparent pb-1 pl-3 pr-3 pt-3 text-sm text-content placeholder-content-subtle focus:outline-none disabled:opacity-50"}),S.jsxs("div",{className:"flex items-center justify-between px-3 pb-3 pt-1",children:[S.jsx("span",{className:"text-xs text-content-subtle",children:"Context details are included automatically."}),S.jsxs("div",{className:"flex items-center gap-2",children:[w<=500&&S.jsx("span",{className:"text-xs text-content-subtle",children:w}),S.jsx(qc,{onClick:m,disabled:_,title:"Send feedback",shortcut:"⌘↵",className:"flex items-center justify-center rounded bg-primary p-1 text-content transition-colors hover:bg-primary-hover disabled:cursor-not-allowed disabled:opacity-80",children:o?S.jsx(Gm,{className:"h-5 w-5 animate-spin",weight:"bold"}):S.jsx(dG,{className:"h-5 w-5",weight:"bold"})})]})]})]})]})]})})]})})},hX=ms("ProfileAvatar"),KR=(t,e)=>{const n=(t??"").trim();if(n)return n.split(/\s+/).filter(Boolean)[0]??"";const s=((e??"").split("@")[0]??"").split(/[._\-+]/).filter(Boolean)[0]??"";return s?s[0].toUpperCase()+s.slice(1):""},pX=(t,e)=>KR(t,e).charAt(0).toUpperCase(),mX=({className:t="",side:e="bottom",align:n="end"})=>{const{name:r,email:s}=nt(gR),i=nt(xR),[o,l]=g.useState(!1),[u,d]=g.useState(!1),[h,p]=g.useState(!1),[m,v]=g.useState(!1),{containerRef:w,onKeyDown:_}=aR(),x=nt(sh),b=pX(r,s);if(!b)return x?S.jsxs("span",{"data-testid":"profile-avatar-skeleton","aria-hidden":"true",className:`flex shrink-0 items-center gap-2 ${t}`.trim(),children:[S.jsx(jk,{className:"h-7 w-7 rounded-full"}),S.jsx(jk,{className:"h-3 w-16"})]}):null;const k=KR(r,s),C=(r==null?void 0:r.trim())||null,T=(s==null?void 0:s.trim())||null,I=async()=>{v(!0);try{const M=await fetch("/api/auth/logout",{method:"POST",credentials:"same-origin"});if(!M.ok)throw new Error(`Logout failed: ${M.status}`)}catch(M){hX.warn("Logout request failed",M),xt.error("Could not log out. Please try again."),v(!1);return}window.location.reload()};return S.jsxs(S.Fragment,{children:[S.jsxs(yx,{open:o,onOpenChange:l,children:[S.jsx(_x,{asChild:!0,children:S.jsxs("button",{type:"button","aria-label":"Account",className:`text-content-muted hover:text-content flex shrink-0 items-center gap-2 transition-colors select-none ${t}`,children:[S.jsx("span",{className:"border-main-border bg-main-input flex h-7 w-7 items-center justify-center rounded-full border text-[11px] leading-none font-semibold",children:b}),k?S.jsx("span",{className:"max-w-[8rem] truncate text-xs font-medium",children:k}):null]})}),S.jsx(wx,{children:S.jsxs(xx,{ref:w,onKeyDown:_,role:"menu",className:"bg-surface-2 z-[60] min-w-[180px] rounded-lg p-1 shadow-lg",side:e,sideOffset:6,align:n,children:[C||T?S.jsxs("div",{className:"border-main-border border-b px-3 py-2",children:[C?S.jsx("div",{className:"text-content truncate text-xs font-medium",children:C}):null,T?S.jsx("div",{className:"text-content-muted truncate text-[11px]",children:T}):null]}):null,S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{l(!1),d(!0)},disabled:!i,className:"text-content hover:bg-hover focus:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(VA,{className:"h-3.5 w-3.5",weight:"bold"}),"Connect design references"]}),S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{l(!1),p(!0)},className:"text-content hover:bg-hover focus:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs transition-colors focus:outline-none",children:[S.jsx(hG,{className:"h-3.5 w-3.5",weight:"bold"}),"Share feedback"]}),S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:I,disabled:m,className:"text-content hover:bg-hover focus:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(_G,{className:"h-3.5 w-3.5",weight:"bold"}),m?"Logging out…":"Log out"]})]})})]}),S.jsx(y2,{isOpen:u,onClose:()=>d(!1)}),S.jsx(fX,{isOpen:h,onClose:()=>p(!1),contactEmail:s??void 0})]})},gX=({onClose:t})=>S.jsxs("div",{className:"bg-main font-main scrollbar-hide relative flex h-full w-full cursor-auto flex-col overflow-hidden shadow-2xl","data-cy":"element-inspector",children:[S.jsx(JY,{onClose:t}),S.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:S.jsx(OY,{})}),S.jsx("div",{className:"border-main-border bg-main-light flex flex-shrink-0 items-center border-t px-2.5 py-1.5",children:S.jsx(mX,{side:"top",align:"start"})})]});async function vX(t,e){const{delaysMs:n,shouldRetry:r,onRetry:s}=e;for(let i=1;;i++)try{return await t(i)}catch(o){const l=n[i-1];if(l===void 0||r&&!r(o))throw o;s==null||s(o,i,l),await new Promise(u=>setTimeout(u,l))}}const Vk=ms("useServerConfig"),YR=[250,500,1e3,2e3,4e3],Hk=YR.length+1,yX=async()=>{var n;const t=await fetch("/api/health");if(!t.ok)throw new Error(`Failed to fetch config: ${t.status}`);const e=await t.json();if(!e.framework)throw new Error("Server did not return framework information");return{userPort:((n=e.ports)==null?void 0:n.userDevServer)||3e3,framework:e.framework}},_X=()=>{const[t,e]=g.useState(null),[n,r]=g.useState(!0),[s,i]=g.useState(null),o=g.useCallback(async()=>{try{r(!0),i(null);const l=await vX(yX,{delaysMs:YR,onRetry:(u,d,h)=>{Vk.warn(`Server config fetch failed (attempt ${d}); retrying in ${h}ms`,u)}});return e(l),l}catch(l){const u=l instanceof Error?l.message:"Failed to fetch server config";throw i(u),Vk.warn("Error fetching server config:",l),l}finally{r(!1)}},[]);return{config:t,fetchConfig:o,isLoading:n,error:s}},wX="#1C1C20",Yi=[118,118,124],zk=.85,xX=3,bX=.15,Gp=36,SX=4.4,EX=.7,kX=3.5,CX=.8,Bk=9,PX=11,TX=[1.35,1.12,.95,.85],IX=[0,1.1,2.3,3.1],AX=[0,.35,.16,.13],RX=[.9,.5,.4,.35],ol=3,cy=[[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.14,y1:.13,x2:.86,y2:.23,level:1},{x1:.14,y1:.28,x2:.3,y2:.87,level:1},{x1:.34,y1:.28,x2:.86,y2:.87,level:1},{x1:.165,y1:.155,x2:.225,y2:.205,level:2},{x1:.7,y1:.155,x2:.755,y2:.205,level:2},{x1:.775,y1:.155,x2:.83,y2:.205,level:2},{x1:.165,y1:.32,x2:.275,y2:.375,level:2},{x1:.165,y1:.415,x2:.275,y2:.47,level:2},{x1:.165,y1:.51,x2:.275,y2:.565,level:2},{x1:.37,y1:.32,x2:.585,y2:.56,level:2},{x1:.615,y1:.32,x2:.83,y2:.56,level:2},{x1:.37,y1:.61,x2:.83,y2:.83,level:2},{hline:!0,x1:.39,x2:.81,y:.685,level:3},{hline:!0,x1:.39,x2:.75,y:.755,level:3}],[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.16,y1:.17,x2:.52,y2:.45,level:1},{x1:.58,y1:.17,x2:.685,y2:.29,level:1},{x1:.715,y1:.17,x2:.84,y2:.29,level:1},{x1:.58,y1:.33,x2:.685,y2:.45,level:1},{x1:.715,y1:.33,x2:.84,y2:.45,level:1},{x1:.16,y1:.55,x2:.84,y2:.85,level:1},{x1:.19,y1:.21,x2:.36,y2:.33,level:2},{hline:!0,x1:.19,x2:.48,y:.37,level:3},{hline:!0,x1:.19,x2:.42,y:.42,level:3},{x1:.19,y1:.6,x2:.49,y2:.8,level:2},{hline:!0,x1:.53,x2:.8,y:.63,level:3},{hline:!0,x1:.53,x2:.76,y:.7,level:3},{hline:!0,x1:.53,x2:.79,y:.77,level:3}],[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.14,y1:.13,x2:.86,y2:.22,level:1},{x1:.14,y1:.28,x2:.36,y2:.87,level:1},{x1:.39,y1:.28,x2:.61,y2:.87,level:1},{x1:.64,y1:.28,x2:.86,y2:.87,level:1},{x1:.165,y1:.15,x2:.225,y2:.2,level:2},{x1:.165,y1:.32,x2:.335,y2:.52,level:2},{x1:.415,y1:.32,x2:.585,y2:.52,level:2},{x1:.665,y1:.32,x2:.835,y2:.52,level:2},{hline:!0,x1:.165,x2:.335,y:.6,level:3},{hline:!0,x1:.165,x2:.3,y:.67,level:3},{hline:!0,x1:.415,x2:.585,y:.6,level:3},{hline:!0,x1:.415,x2:.55,y:.67,level:3},{hline:!0,x1:.665,x2:.835,y:.6,level:3},{hline:!0,x1:.665,x2:.8,y:.67,level:3}],[{x1:.1,y1:.08,x2:.9,y2:.92,level:0},{x1:.3,y1:.22,x2:.7,y2:.74,level:1},{x1:.34,y1:.27,x2:.55,y2:.34,level:2},{hline:!0,x1:.36,x2:.64,y:.42,level:3},{hline:!0,x1:.36,x2:.6,y:.49,level:3},{hline:!0,x1:.36,x2:.62,y:.56,level:3},{x1:.5,y1:.63,x2:.575,y2:.69,level:2},{x1:.595,y1:.63,x2:.66,y2:.69,level:2}]],Kp=t=>{let e=t|0;return e=Math.imul(e^e>>>16,73244475),e=Math.imul(e^e>>>16,73244475),e^=e>>>16,(e>>>0)/4294967296},x0=t=>{const e=Math.min(1,Math.max(0,t));return e*e*(3-2*e)},al=(t,e)=>(Math.round(t/e-.5)+.5)*e,MX=Math.sin(Math.PI/3),Uk=(t,e,n,r,s)=>{if(t.beginPath(),e===0)t.arc(n,r,s,0,Math.PI*2);else if(e===1){const i=s*MX;t.moveTo(n,r-s),t.lineTo(n+i,r+s/2),t.lineTo(n-i,r+s/2),t.closePath()}else{const i=s*.85;t.rect(n-i,r-i,i*2,i*2)}t.fill()},OX=(t,e,n)=>{let r;if(n.hline){const s=Math.max(n.x1-t,t-n.x2,0),i=Math.abs(e-n.y1);r=Math.hypot(s,i)-Bk}else{const s=Math.max(n.x1-t,t-n.x2,0),i=Math.max(n.y1-e,e-n.y2,0);s===0&&i===0?r=-Math.min(t-n.x1,n.x2-t,e-n.y1,n.y2-e):r=Math.hypot(s,i),r=Math.abs(r)-Bk}return x0(.5-r/(2*PX))},XR=({className:t="",trackGlobalLoaderCount:e=!0})=>{const n=ft(mR),r=g.useRef(null),s=g.useCallback(i=>{var N;if((N=r.current)==null||N.call(r),r.current=null,!i)return;const o=i.getContext("2d");if(!o)return;e&&n(F=>F+1);const l=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let u=[],d=0,h=0,p=Gp,m=Gp,v=null,w=null,_=0,x=-1;const b=new Array(33),k=F=>{const j=Math.round(F*32);let Q=b[j];if(!Q){const q=j/32,Z=Math.round(Yi[0]+(255-Yi[0])*q),W=Math.round(Yi[1]+(255-Yi[1])*q),Y=Math.round(Yi[2]+(255-Yi[2])*q);Q=`rgba(${Z}, ${W}, ${Y}, ${zk})`,b[j]=Q}return Q},C=F=>{const j=1-.35*F,Q=Math.round(Yi[0]*j),q=Math.round(Yi[1]*j),Z=Math.round(Yi[2]*j);return`rgba(${Q}, ${q}, ${Z}, ${zk})`},T=F=>{let j=Math.floor(Math.random()*cy.length);j===x&&(j=(j+1)%cy.length),x=j;const Q=[0,0,0,0],q=cy[j].map((D,X)=>{const ce=D.level,se=Q[ce]++,re=IX[ce]+se*AX[ce],de=RX[ce]+Kp(j*131+X*17+5)*.2;if(D.hline){const oe=al((D.y??0)*h,m);return{hline:!0,x1:al(D.x1*d,p),x2:al(D.x2*d,p),y1:oe,y2:oe,level:ce,start:re,dur:de}}const ye=al(D.x1*d,p),fe=al((D.y1??0)*h,m);return{hline:!1,x1:ye,y1:fe,x2:Math.max(al(D.x2*d,p),ye+p),y2:Math.max(al((D.y2??0)*h,m),fe+m),level:ce,start:re,dur:de}}),Z=q.reduce((D,X)=>Math.max(D,X.start+X.dur),0),W=u.length,Y=new Float32Array(W*ol),V=new Int16Array(W*ol).fill(-1),J=new Uint8Array(W),B=q[0];for(let D=0;D<W;D++){const X=u[D];X.x>B.x1&&X.x<B.x2&&X.y>B.y1&&X.y<B.y2&&(J[D]=1);const ce=D*ol;for(let se=0;se<q.length;se++){const re=OX(X.x,X.y,q[se]);if(re<=.02)continue;let de=ce;for(let ye=ce;ye<ce+ol;ye++){if(V[ye]===-1){de=ye;break}Y[ye]<Y[de]&&(de=ye)}(V[de]===-1||re>Y[de])&&(Y[de]=re,V[de]=se)}}return{startT:F,buildEnd:Z,els:q,frame:B,cellQ:Y,cellEl:V,inFrame:J}},I=()=>{const F=i.getBoundingClientRect();d=Math.max(1,F.width),h=Math.max(1,F.height);const j=Math.min(2,window.devicePixelRatio||1);i.width=Math.round(d*j),i.height=Math.round(h*j),o.setTransform(j,0,0,j,0,0);const Q=Math.max(8,Math.round(d/Gp)),q=Math.max(6,Math.round(h/Gp));p=d/Q,m=h/q,u=[];for(let Z=0;Z<q;Z++){const W=q>1?Z/(q-1):.5,Y=SX*(1+EX*.4*(W*2-1));for(let V=0;V<Q;V++){const J=Z*8191+V*131+1,B={x:(V+.5)*p,y:(Z+.5)*m,size:Y,seed:J,phase:Kp(J),kind:0};B.kind=Math.floor(Kp(J*97)*3),u.push(B)}}w=null,v=null},M=new Float32Array(32),R=F=>{o.fillStyle=wX,o.fillRect(0,0,d,h),v||(v=T(F+.2)),F>=v.startT+v.buildEnd+kX&&(w=v,_=F,v=T(F+.2));let j=0;w&&(j=1-x0((F-_)/CX),j<=0&&(w=null));const Q=v;for(let B=0;B<Q.els.length;B++){const D=Q.els[B];M[B]=x0(Math.min(1,Math.max(0,(F-Q.startT-D.start)/D.dur)))}const q=M[0],Z=C(0),W=C(q),Y=j>0?C(j):Z,V=j>0?C(Math.max(q,j)):W,J=u.length;for(let B=0;B<J;B++){const D=u[B];let X=0,ce=0;const se=B*ol;for(let Ce=se;Ce<se+ol;Ce++){const We=Q.cellEl[Ce];if(We<0)break;const at=Q.cellQ[Ce]*M[We];at>X&&(X=at,ce=Q.els[We].level)}if(w)for(let Ce=se;Ce<se+ol;Ce++){const We=w.cellEl[Ce];if(We<0)break;const at=w.cellQ[Ce]*j;at>X&&(X=at,ce=w.els[We].level)}const re=F/xX+D.phase,de=Math.floor(re),ye=re-de,fe=x0(Math.min(ye,1-ye)/bX),oe=Math.floor(Kp(D.seed*97+de*7919)*3);oe!==D.kind&&X<.02&&fe<.05&&(D.kind=oe);const je=Math.max(fe*(1-X),X);if(!(je<.01))if(X<.02){const Ce=Q.inFrame[B]===1,We=w?w.inFrame[B]===1:!1;Ce?o.fillStyle=We?V:W:o.fillStyle=We?Y:Z;const at=Math.max(Ce?q:0,We?j:0);Uk(o,D.kind,D.x,D.y,D.size*je*(1-.2*at))}else{o.fillStyle=k(X);const Ce=1+(TX[ce]-1)*X;Uk(o,D.kind,D.x,D.y,D.size*je*Ce)}}};I();let A=0;if(l)v=T(-100),R(0);else{const F=performance.now(),j=Q=>{R((Q-F)/1e3),A=requestAnimationFrame(j)};A=requestAnimationFrame(j)}const L=new ResizeObserver(()=>{I(),l&&(v=T(-100),R(0))});L.observe(i),r.current=()=>{cancelAnimationFrame(A),L.disconnect(),e&&n(F=>F-1)}},[e,n]);return S.jsx("canvas",{ref:s,"aria-hidden":"true",className:`h-full w-full ${t}`.trim()})},LX=async(t=null)=>{if(t)return DX(t);let e;try{e=await fetch("/api/mcp/status")}catch{return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null}}if(e.status===404||!(e.headers.get("content-type")??"").toLowerCase().includes("application/json"))return Yp();if(!e.ok)return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null};let r;try{r=await e.json()}catch{return Yp()}const s=r.devServerHealth;return s?s.ownership==="none"?{isOk:!1,unavailableReason:"upstream_unreachable",upstreamStatus:null}:s.isReachable===!0?{isOk:!0,unavailableReason:"upstream_unreachable",upstreamStatus:null}:{isOk:!1,unavailableReason:s.reason==="rivet_unreachable"?"rivet_unreachable":"upstream_unreachable",upstreamStatus:null}:Yp()},QR=async t=>{try{const e=await fetch(t);return{isOk:e.status!==502&&e.status!==503,unavailableReason:"upstream_unreachable",upstreamStatus:e.status}}catch{return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null}}},DX=t=>QR(t),Yp=()=>QR("/"),uy=ms("usePreviewUpstreamHealth"),NX=500,$X=4e3,jX=15e3,FX=3,VX=(t,e={})=>{const n=g.useRef(null),r=g.useRef(null),s=e.probeMsWhileDown??NX,i=e.probeMsWhileUp??$X,o=e.firstUnreachableCaptureAfterMs??jX,l=e.rerunProbeImmediatelyOnVersion,u=e.probePath??null,d=e.skip??!1,h=g.useRef(e.onPersistentUpstreamServerErrors);h.current=e.onPersistentUpstreamServerErrors;const[p,m]=g.useState(t==="static"),[v,w]=g.useState(0),[_,x]=g.useState(null),[b,k]=g.useState(0),[C,T]=g.useState(!1),[I,M]=g.useState(!1),[R,A]=g.useState(t==="static"?null:"upstream_unreachable");return g.useEffect(()=>{if(t==="static"){m(!0),x(null),k(0),T(!1),M(!0),A(null);return}if(d){m(!1),x(null),k(0),T(!1),M(!0),A("upstream_unreachable"),n.current=null;return}let L=!0;const N=Date.now();x(N),k(0),T(!1),m(!1),M(!1),A("upstream_unreachable");const F={current:!1},j={current:!1},Q={current:!1},q={current:null},Z={current:!1},W={current:!1},Y={current:0},V={current:!1},J={current:null};let B=null;const D=()=>{Q.current||(Q.current=!0,L&&M(!0))},X=()=>{B!==null&&(clearTimeout(B),B=null)},ce=(re,de)=>{X(),B=setTimeout(de,re)},se=async()=>{var at;if(!L)return;k(it=>it+1);const{isOk:re,unavailableReason:de,upstreamStatus:ye}=await LX(u);if(!L)return;D(),J.current=ye;const fe=re&&ye!==null&&ye>=500;fe&&W.current?Y.current+=1:re&&!fe&&(Y.current=0);const oe=Y.current>=FX;if(oe&&!V.current&&ye!==null&&(V.current=!0,Ee==null||Ee.capture("preview_upstream_error_responses",{framework:t,upstream_status:ye,consecutive_count:Y.current}),uy.warn(`Preview upstream is listening but has served ${Y.current} consecutive ${ye} responses`),(at=h.current)==null||at.call(h,{upstreamStatus:ye,consecutiveCount:Y.current})),re&&!oe){fe||(W.current=!0,V.current=!1);const it=!Z.current;Z.current=!0,m(!0),A(null),q.current=null,j.current=!1,T(!1),F.current?it&&(Ee==null||Ee.capture("preview_upstream_restored",{framework:t})):(F.current=!0,Ee==null||Ee.capture("preview_dev_server_ready",{framework:t,ready_after_ms:Date.now()-N})),ce(i,se);return}const Ce=Z.current;Z.current=!1,m(!1),A(de),q.current===null&&(q.current=Date.now(),j.current=!1,T(!1)),Ce&&(Ee==null||Ee.capture("preview_upstream_lost",{framework:t,upstream_status:ye}),w(it=>it+1),uy.warn("Preview upstream became unavailable after it was ready"));const We=Date.now()-q.current;We>=o&&!j.current&&(j.current=!0,T(!0),Ee==null||Ee.capture("preview_dev_server_unreachable",{framework:t,elapsed_ms:We,upstream_status:J.current}),uy.warn("Dev server did not become ready within timeout window")),ce(s,se)};return n.current=()=>ce(0,se),ce(0,se),()=>{L=!1,n.current=null,X()}},[t,s,i,o,u,d]),g.useEffect(()=>{var N;if(t==="static"||l===void 0)return;const L=r.current;r.current=l,L!==null&&L!==l&&((N=n.current)==null||N.call(n))},[t,l]),{isUpstreamReady:p,iframeRemountKey:v,probeStartedAt:_,probeAttemptCount:b,isFirstUnreachableWindowExceeded:C,initialProbeComplete:I,unavailableReason:R}};function HX(t){return t.enteringSplit&&t.isExistingSession&&t.hasActiveVariantProxy}const JR=t=>{var e;return t!=="embedded"||typeof window>"u"?"":((e=window.__RIVET_BOOTSTRAP__)==null?void 0:e.previewOrigin)??`${window.location.protocol}//localhost:${window.location.port}`},eM=({agentApplyMode:t,url:e})=>e.startsWith("/")?`${JR(t)}${e}`:e,zX="allow-scripts allow-same-origin allow-forms allow-popups allow-modals",BX=t=>zX,UX=ms("PreviewSurface"),Wk=(t,e)=>t==="about:blank"?"blank":t.includes("/api/variants/")?"static_artifact":e.kind==="variant"?"dev_server":"original",tM=({target:t,src:e,framework:n,remountKey:r})=>(nt(Km),S.jsx("div",{className:"relative h-full w-full",children:S.jsx("iframe",{src:e,className:"h-full w-full border-none",title:"Project Preview",sandbox:BX(),onLoad:()=>{Ee==null||Ee.capture("preview_iframe_loaded",{framework:n,src:e}),t.kind==="variant"&&(Ee==null||Ee.capture("variants_panel.preview_displayed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:Wk(e,t),framework:n}))},onError:()=>{Ee==null||Ee.capture("preview_iframe_load_failed",{framework:n,src:e}),t.kind==="variant"&&(Ee==null||Ee.capture("variants_panel.preview_display_failed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:Wk(e,t),framework:n})),UX.warn("Preview iframe failed to load",{framework:n,src:e})}},r)})),WX="modulepreload",ZX=function(t){return"/"+t},Zk={},qX=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let o=function(d){return Promise.all(d.map(h=>Promise.resolve(h).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=o(n.map(d=>{if(d=ZX(d),d in Zk)return;Zk[d]=!0;const h=d.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":WX,h||(m.as="script"),m.crossOrigin="",m.href=d,u&&m.setAttribute("nonce",u),document.head.appendChild(m),h)return new Promise((v,w)=>{m.addEventListener("load",v),m.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return e().catch(i)})},GX=g.lazy(()=>qX(()=>Promise.resolve().then(()=>IJ),void 0)),KX={surface:"relative flex h-full w-full items-center justify-center bg-main px-6",overlay:"absolute inset-0 z-10 flex items-center justify-center bg-main/90 px-6",page:"relative flex h-screen w-full items-center justify-center bg-main px-6"},YX={sm:"text-lg font-semibold text-content",md:"text-2xl font-semibold text-content",lg:"text-3xl font-semibold text-content"},XX={neutral:"rounded-md border border-divider bg-transparent px-5 py-2 text-sm font-medium text-content transition-colors hover:bg-surface-3",ghost:"rounded-md px-5 py-2 text-sm font-medium text-content-muted transition-colors hover:text-content"},Gc=({backdrop:t,media:e,title:n,description:r,actions:s,tone:i="neutral",fill:o="surface",size:l="md",children:u,state:d,role:h="status",busy:p=!1,className:m=""})=>{const v=g.useCallback(_=>{_&&d&&(Ee==null||Ee.capture("status_surface_shown",{state:d,tone:i,fill:o}))},[d,i,o]),w=!!(e||n||r||u||s!=null&&s.length);return S.jsxs("div",{ref:v,className:`${KX[o]} ${m}`.trim(),role:h,"aria-live":"polite","aria-busy":p||void 0,"data-state":d,children:[t?S.jsx("div",{className:"absolute inset-0",children:t}):null,w?S.jsxs("div",{className:"relative z-10 flex max-w-sm flex-col items-center gap-5 text-center",children:[e,n?S.jsx("h2",{className:YX[l],children:n}):null,r?S.jsx("p",{className:"text-content-muted text-base leading-relaxed",children:r}):null,u,s!=null&&s.length?S.jsx("div",{className:"flex flex-row items-center gap-3",children:s.map(_=>S.jsx("button",{type:"button",onClick:_.onClick,className:XX[_.variant??"neutral"],children:_.label},_.label))}):null]}):null]})},_2=({loader:t="coalesce",trackGlobalLoaderCount:e,size:n="lg",...r})=>t==="coalesce"?S.jsx(Gc,{...r,size:n,busy:!0,backdrop:S.jsx(XR,{trackGlobalLoaderCount:e})}):t==="logo"?S.jsx(Gc,{...r,size:n,busy:!0,backdrop:S.jsx(g.Suspense,{fallback:null,children:S.jsx(GX,{className:"absolute inset-0"})})}):S.jsx(Gc,{...r,size:n,busy:!0,media:S.jsx(Gm,{"aria-hidden":!0,className:"text-content h-8 w-8 shrink-0 animate-spin",weight:"bold"})}),nM=({icon:t,...e})=>S.jsx(Gc,{...e,tone:"neutral",media:t?S.jsx("div",{className:"text-content-muted",children:t}):void 0}),Rx=t=>S.jsx(Gc,{...t,tone:"error",role:"alert"}),qk="/static/",QX=t=>{try{return new URL(t,"http://localhost").pathname.endsWith(qk)}catch{return t.endsWith(qk)}},JX=t=>t==="spawn_error"?"The direction is saved, but its preview process didn’t start.":t==="exited"?"The direction is saved, but its preview stopped before it was ready.":t==="timeout"?"The direction is saved, but its preview took too long to become ready.":t==="missing_dev_script"?"The direction is saved, but Rivet couldn’t find a dev script to preview it.":t==="missing_static_entry"?"The direction is saved, but Rivet couldn’t find an HTML entry to preview it.":"The direction is saved, but Rivet couldn’t prepare its preview.",eQ=t=>t.status==="failed"&&t.errorCode==="VARIANT_VERIFICATION_UNAVAILABLE"?{state:"variant_verification_unavailable",title:"Rivet couldn’t verify this direction",description:"The worker completed, but Rivet couldn’t inspect its generated files.",detail:t.errorMessage??t.errorCode,isError:!0}:t.status==="failed"&&t.errorCode==="VARIANT_QA_FAILED"?{state:"variant_output_integrity_failed",title:"This direction couldn’t be verified",description:"The worker completed, but Rivet found a structural problem in the generated files.",detail:t.errorMessage??t.errorCode,isError:!0}:t.status==="failed"?{state:"variant_worker_failed",title:"This direction didn’t complete",description:"The worker stopped before producing a usable result.",detail:t.errorMessage??t.errorCode,isError:!0}:t.status==="cancelled"?{state:"variant_cancelled",title:"Direction was cancelled",description:"Rivet stopped before a preview was ready. Your other directions are unchanged.",isError:!1}:t.status==="succeeded"&&t.previewUnavailable&&t.previewUnavailable.reason!=="idle_timeout"?{state:"preview_unavailable",title:"Rivet couldn’t preview this direction",description:JX(t.previewUnavailable.reason),detail:t.previewUnavailable.portInUse?"The preview port was already in use.":void 0,isError:!0}:null,tQ=({issue:t})=>S.jsx(Gc,{fill:"overlay",size:"sm",state:t.state,role:t.isError?"alert":"status",tone:t.isError?"error":"neutral",title:t.title,description:t.description,children:t.detail?S.jsx("p",{className:"text-content-subtle text-xs leading-relaxed break-words",children:t.detail}):null}),nQ=({isInteractionDisabled:t=!1,framework:e,userPort:n})=>{const r=nt(a2),s=ft(a2),i=nt(gm),o=ft(gm),l=nt(rh),u=nt(Km),d=nt(l2),h=nt(c2),p=nt(vR),m=nt(yR),v=ft(c2),w=nt(yo),_=nt(d2),x=ft(l2),b=l.active&&l.projectContext.kind==="fresh",k=nt(u2),C=l.active?l.variants.find(De=>De.workItemId===k&&(De.status==="pending"||De.status==="running"||De.status==="succeeded"&&!De.preview&&typeof De.port!="number"&&(!De.previewUnavailable||De.previewUnavailable.reason==="idle_timeout")))??null:null,T=l.active&&l.variants.some(De=>De.status==="pending"||De.status==="running"),I=b||T,M=l.active?l.variants.find(De=>De.workItemId===k)??null:null,R=M?eQ(M):null,A=e==="static"&&i!==null&&QX(i);g.useEffect(()=>{l.active||x(!1)},[l.active,x]);const L=g.useRef(!1);g.useEffect(()=>{const De=!!(w!=null&&w.left||w!=null&&w.right),rt=De&&!L.current;L.current=De;const Be=l.active?l.sessionId:null;!Be||!HX({enteringSplit:rt,isExistingSession:l.active&&l.projectContext.kind==="existing",hasActiveVariantProxy:d&&h!==null})||(x(!1),v(null),s(ct=>ct+1),fetch(`/api/variants/${encodeURIComponent(Be)}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(()=>{}))},[w,l,d,h,x,v,s]);const F=g.useMemo(()=>{var Ze;if(d||i&&!A||!l.active)return null;const{stage:De,variants:rt}=l,Be=De==="ready"||De==="degraded",ct=rt.some(xe=>{var St,It;return((St=xe.refinement)==null?void 0:St.status)==="pending"||((It=xe.refinement)==null?void 0:It.status)==="running"});if(!Be&&!ct)return null;const Re=rt.find(xe=>{var St;return xe.status==="succeeded"&&((St=xe.preview)==null?void 0:St.kind)==="static_artifact"});return((Ze=Re==null?void 0:Re.preview)==null?void 0:Ze.kind)==="static_artifact"?Re.preview.url:null},[A,i,d,l])??i,j=g.useMemo(()=>!l.active||!F?null:l.variants.find(De=>{var rt;return((rt=De.preview)==null?void 0:rt.kind)==="static_artifact"&&F.startsWith(De.preview.url)})??null,[F,l]),Q=g.useMemo(()=>{if((_==null?void 0:_.previewKind)==="static")return{kind:"variant",sessionId:_.sessionId,variantId:_.variantId};if(!l.active)return mm;if(j)return{kind:"variant",sessionId:l.sessionId,variantId:j.workItemId};if(F){const rt=F.match(/\/__rivet\/preview\/variant\/([^/]+)\/([^/?#]+)/),Be=rt!=null&&rt[1]?decodeURIComponent(rt[1]):null,ct=rt!=null&&rt[2]?decodeURIComponent(rt[2]):null;if(Be===l.sessionId&&ct&&l.variants.some(xe=>xe.workItemId===ct))return{kind:"variant",sessionId:l.sessionId,variantId:ct};const Re=F.match(/\/api\/variants\/[^/]+\/static\/([^/?#]+)/),Ze=Re!=null&&Re[1]?decodeURIComponent(Re[1]):null;if(Ze&&l.variants.some(xe=>xe.workItemId===Ze))return{kind:"variant",sessionId:l.sessionId,variantId:Ze}}const De=!!(w!=null&&w.left||w!=null&&w.right);return(!De||b)&&!F&&d&&h&&l.variants.some(rt=>rt.workItemId===h)?{kind:"variant",sessionId:l.sessionId,variantId:h}:(!De||b)&&!F&&k&&l.variants.some(rt=>rt.workItemId===k)?{kind:"variant",sessionId:l.sessionId,variantId:k}:mm},[_,j,l,d,h,F,w,b,k]),q=g.useRef(null);g.useEffect(()=>{var ct,Re;if(!j||((ct=j.preview)==null?void 0:ct.kind)!=="static_artifact"||((Re=j.refinement)==null?void 0:Re.status)!=="succeeded")return;const De=`${j.workItemId}:${j.refinement.workItemId}`;if(q.current===De)return;q.current=De;const rt=j.preview.url.includes("?")?"&":"?",Be=`${j.preview.url}${rt}refinement=${encodeURIComponent(j.refinement.workItemId)}`;F!==Be&&(o(Be),s(Ze=>Ze+1))},[F,j,s,o,l]);const Z=F!==null&&EY(F),W=F!==null&&!Z||b&&!d&&!Z,{isUpstreamReady:Y,iframeRemountKey:V,probeAttemptCount:J,initialProbeComplete:B}=VX(e,{rerunProbeImmediatelyOnVersion:r,probePath:Z?F:null,skip:W}),[D,X]=g.useState(()=>p&&Y?r:null),ce=g.useRef(null);g.useEffect(()=>{if(!p){ce.current=null,X(null);return}if(D===r){ce.current=null;return}const De=ce.current;if(!De||De.remountKey!==r){ce.current={remountKey:r,probeAttemptCount:J};return}Y&&J>De.probeAttemptCount&&(ce.current=null,X(r))},[D,r,p,J,Y]);const re=F!==null&&!Z||Y,ye=m||p&&D!==r||p&&!re,fe=`${V}:${r}`,oe=jR(window.location.pathname),je=e==="static"?`/static${oe??"/"}`:oe??"/",Ce=JR(u);let We=null;F&&(We=eM({agentApplyMode:u,url:F}));const it=C||R||ye?"about:blank":(Z&&!re?"about:blank":We)??(re?`${Ce}${je}`:"about:blank"),Ot=!!C||!!R||!re&&B;let ht=null;return ye?ht=S.jsx(_2,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"preview_replay_boot"}):C?ht=S.jsx(_2,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"variant_building",children:S.jsx("span",{className:"sr-only",children:"Building your direction"})}):R?ht=S.jsx(tQ,{issue:R}):Ot&&(ht=I?S.jsx(nM,{fill:"overlay",state:"preview_no_selection",title:"Nothing to preview yet",description:"Pick a direction from the panel."}):S.jsx(Rx,{fill:"overlay",state:"preview_offline",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>window.location.reload()}]})),S.jsxs("div",{className:"relative h-full w-full",children:[ht,S.jsx(tM,{target:Q,src:it,framework:e,remountKey:fe})]})};function Gk({side:t,sessionId:e,variantId:n,url:r,label:s,source:i,isFallback:o=!1}){var C;const l=nt(yo),u=ft(yo),d=Yf(),h=nt(rh),p=nt(Km),m=g.useRef(!1),v=g.useCallback(()=>{m.current||(m.current=!0,wu({source:i,sessionId:e,variantId:n}))},[i,e,n]),w=g.useCallback(()=>{if(o){u(null);const R=vm("ended",l);d==null||d.capture(R.event,R.properties);return}v();const T={...l};delete T[t];const I=T.left||T.right?T:null;u(I);const M=vm(I?"updated":"ended",I??l);d==null||d.capture(M.event,M.properties)},[o,d,u,t,l,v]),_=g.useMemo(()=>({kind:"variant",sessionId:e,variantId:n}),[e,n]),x=g.useMemo(()=>!h.active||h.sessionId!==e?null:h.variants.find(T=>T.workItemId===n)??null,[e,n,h]),b=g.useMemo(()=>{var I,M;let T=r;if(((I=x==null?void 0:x.preview)==null?void 0:I.kind)==="static_artifact"&&((M=x.refinement)==null?void 0:M.status)==="succeeded"){const R=x.preview.url.includes("?")?"&":"?";T=`${x.preview.url}${R}refinement=${encodeURIComponent(x.refinement.workItemId)}`}return eM({agentApplyMode:p,url:T})},[p,x,r]),k=((C=x==null?void 0:x.refinement)==null?void 0:C.status)==="succeeded"?`${n}:${x.refinement.workItemId}`:n;return S.jsxs("div",{className:"variant-split-secondary","data-cy":"variant-split-pane","data-variant-id":n,children:[S.jsxs("div",{className:"variant-split-secondary-toolbar",children:[S.jsx("span",{className:"variant-split-secondary-label",title:s,children:s}),S.jsx(Hl,{label:"Collapse",children:S.jsx("button",{type:"button",className:"variant-split-secondary-close",onClick:w,"aria-label":"Collapse split view",children:S.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",focusable:"false",children:S.jsx("path",{d:"M2.5 2.5 L9.5 9.5 M9.5 2.5 L2.5 9.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})})]}),S.jsx("div",{className:"variant-split-secondary-body relative min-h-0 flex-1",children:S.jsx(tM,{target:_,src:b,framework:"static",remountKey:k})})]})}function rQ(){const t=nt(_u),e=nt(Ex);return!t||!e?null:th.createPortal(S.jsx("div",{"aria-hidden":"true",className:"border-main-border bg-main pointer-events-none fixed top-0 left-0 z-[70] flex max-w-60 items-center gap-2 rounded-md border px-3 py-1.5 shadow-lg",style:{transform:`translate3d(${e.x+12}px, ${e.y+12}px, 0)`},children:S.jsx("span",{className:"text-content truncate text-sm font-medium",children:t.label})}),document.body)}function sQ(){const t=nt(_u),e=nt(Ex),n=nt(yo),r=ft(_u),s=ft(yo),i=Yf(),o=g.useRef(null),[l,u]=g.useState(null),[d,h]=g.useState("hidden");g.useEffect(()=>{t||(h("hidden"),u(null))},[t]);const p=g.useCallback((v,w)=>{const _=o.current;if(!_)return null;const x=_.getBoundingClientRect();return v<x.left||v>x.right||w<x.top||w>x.bottom?null:v<(x.left+x.right)/2?"left":"right"},[]);if(g.useEffect(()=>{if(!t||!e)return;const v=p(e.x,e.y);u(w=>w===v?w:v),h(w=>{if(w==="exiting")return w;const _=v!==null?"visible":"hidden";return w===_?w:_})},[t,e,p]),g.useEffect(()=>{if(!t)return;const v=w=>{const _=p(w.clientX,w.clientY);if(_&&t.url){const x={sessionId:t.sessionId,variantId:t.variantId,label:t.label,url:t.url,source:t.source},b=n==null?void 0:n[_];b&&(b.sessionId!==x.sessionId||b.variantId!==x.variantId)&&wu(b);const k={...n??{},[_]:x};s(k);const C=vm(n?"updated":"started",k);i==null||i.capture(C.event,C.properties),h("exiting"),window.setTimeout(()=>r(null),220)}else wu(t),h("exiting"),window.setTimeout(()=>r(null),220)};return window.addEventListener("pointerup",v),window.addEventListener("pointercancel",v),()=>{window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v)}},[t,p,i,r,s,n]),!t)return null;const m=["variant-drop-zones",d==="visible"&&"is-visible",d==="exiting"&&"is-exiting"].filter(Boolean).join(" ");return S.jsxs("div",{ref:o,className:m,"aria-hidden":"true",children:[S.jsx(Kk,{side:"left",hovered:l==="left",canDrop:!!t.url,label:t.label}),S.jsx(Kk,{side:"right",hovered:l==="right",canDrop:!!t.url,label:t.label})]})}function Kk({side:t,hovered:e,canDrop:n,label:r}){return S.jsxs("div",{className:["variant-drop-zone",`is-${t}`,e&&"is-hover",!n&&"is-disabled"].filter(Boolean).join(" "),children:[S.jsxs("div",{className:"variant-drop-zone-inner",children:[S.jsx("div",{className:`variant-drop-zone-icon is-${t}`}),S.jsx("div",{className:"variant-drop-zone-caption",children:n?`Add ${t} split`:"Split unavailable for this direction"})]}),S.jsx("div",{className:"variant-drop-zone-preview","aria-hidden":"true",children:S.jsx("div",{className:"variant-drop-zone-preview-label",children:r})}),S.jsx("div",{className:"variant-drop-zone-border"})]})}const rM=(t,e,n)=>{var i,o;if(!t.active||t.sessionId!==e)return null;const r=t.variants.find(l=>l.workItemId===n);if(((i=r==null?void 0:r.preview)==null?void 0:i.kind)!=="static_artifact")return null;if(((o=r.refinement)==null?void 0:o.status)!=="succeeded")return r.preview.url;const s=r.preview.url.includes("?")?"&":"?";return`${r.preview.url}${s}refinement=${encodeURIComponent(r.refinement.workItemId)}`},Yk=(t,e)=>{if(!t)return;const n=rM(e,t.sessionId,t.variantId);return!n||n===t.url?t:{...t,url:n}},iQ=()=>S.jsx("div",{"data-testid":"preview-boot-skeleton",role:"status","aria-busy":"true","aria-label":"Loading preview",className:"bg-main flex h-full min-h-0 w-full flex-1 flex-col p-3",children:S.jsx("div",{className:"border-main-border relative min-h-0 flex-1 overflow-hidden rounded-lg border",children:S.jsx(XR,{trackGlobalLoaderCount:!1})})}),oQ=({isLoading:t=!1,isInteractionDisabled:e=!1})=>{const{config:n,fetchConfig:r,isLoading:s,error:i}=_X();return g.useEffect(()=>{r().catch(o=>{Ee==null||Ee.capture("preview_config_load_failed",{message:o instanceof Error?o.message:"unknown_error",attempts:Hk})})},[r]),s?S.jsx(iQ,{}):i||!n?S.jsx(Rx,{fill:"surface",size:"sm",state:"preview_config_error",title:"Couldn't load preview",description:"We couldn't load the preview configuration.",actions:[{label:"Retry",onClick:()=>{Ee==null||Ee.capture("preview_config_retry_clicked"),r().catch(o=>{Ee==null||Ee.capture("preview_config_load_failed",{message:o instanceof Error?o.message:"unknown_error",attempts:Hk})})}}]}):S.jsx(aQ,{isLoading:t,isInteractionDisabled:e,framework:n.framework,userPort:n.userPort})};function aQ(t){const e=nt(yo),n=nt(_u),r=nt(rh),s=nt(gm),i=e==null?void 0:e.left,o=e==null?void 0:e.right,l=g.useMemo(()=>{var I,M;if(!r.active||r.projectContext.kind!=="fresh"||!(!!i!=!!o))return;const _=(I=i??o)==null?void 0:I.variantId,x=r.variants.filter(R=>{var A;return R.status==="succeeded"&&((A=R.preview)==null?void 0:A.kind)==="static_artifact"&&R.workItemId!==_}),b=s==null?void 0:s.replace(/[?&]refinement=[^&]*$/,""),C=x.find(R=>{var A;return((A=R.preview)==null?void 0:A.kind)==="static_artifact"&&R.preview.url===b})??x[0];if(((M=C==null?void 0:C.preview)==null?void 0:M.kind)!=="static_artifact")return;const T=rM(r,r.sessionId,C.workItemId);if(T)return{sessionId:r.sessionId,variantId:C.workItemId,label:C.label,url:T,source:"live"}},[r,i,o,s]),u=Yk(i,r)??(o?l:void 0),d=Yk(o,r)??(i?l:void 0),h=!i&&!!u,p=!o&&!!d,m=!!(u||d),v=S.jsx(nQ,{isInteractionDisabled:t.isInteractionDisabled,framework:t.framework,userPort:t.userPort});return S.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-1 flex-col",children:S.jsxs("div",{className:`variant-preview-region relative flex h-full min-h-0 w-full flex-1 flex-col ${n?"is-dragging":""} ${m?"is-split":""}`,children:[S.jsxs("div",{className:"variant-preview-row flex h-full min-h-0 w-full flex-1",children:[u&&S.jsx(Gk,{side:"left",sessionId:u.sessionId,variantId:u.variantId,url:u.url,label:u.label,source:u.source,isFallback:h},`left-${u.sessionId}:${u.variantId}:${u.url}`),!(u&&d)&&S.jsx("div",{className:"variant-preview-primary flex h-full min-h-0 flex-1 flex-col",children:v}),d&&S.jsx(Gk,{side:"right",sessionId:d.sessionId,variantId:d.variantId,url:d.url,label:d.label,source:d.source,isFallback:p},`right-${d.sessionId}:${d.variantId}:${d.url}`)]}),S.jsx("div",{className:"variant-preview-atmosphere","aria-hidden":"true"}),S.jsx(sQ,{}),S.jsx(rQ,{})]})})}function ro(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function sM(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
116
+ * GSAP 3.15.0
117
+ * https://gsap.com
118
+ *
119
+ * @license Copyright 2008-2026, GreenSock. All rights reserved.
120
+ * Subject to the terms at https://gsap.com/standard-license
121
+ * @author: Jack Doyle, jack@greensock.com
122
+ */var ds={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Of={duration:.5,overwrite:!1,delay:0},Mx,sr,Yt,Is=1e8,Dt=1/Is,w2=Math.PI*2,lQ=w2/4,cQ=0,iM=Math.sqrt,uQ=Math.cos,dQ=Math.sin,qn=function(e){return typeof e=="string"},fn=function(e){return typeof e=="function"},_o=function(e){return typeof e=="number"},Ox=function(e){return typeof e>"u"},Li=function(e){return typeof e=="object"},Hr=function(e){return e!==!1},Lx=function(){return typeof window<"u"},Xp=function(e){return fn(e)||qn(e)},oM=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},fr=Array.isArray,fQ=/random\([^)]+\)/g,hQ=/,\s*/g,Xk=/(?:-?\.?\d|\.)+/gi,aM=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Vc=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,dy=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,lM=/[+-]=-?[.\d]+/,pQ=/[^,'"\[\]\s]+/gi,mQ=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,rn,_i,x2,Dx,hs={},ym={},cM,uM=function(e){return(ym=bu(e,hs))&&Wr},Nx=function(e,n){return console.warn("Invalid property",e,"set to",n,"Missing plugin? gsap.registerPlugin()")},Lf=function(e,n){return!n&&console.warn(e)},dM=function(e,n){return e&&(hs[e]=n)&&ym&&(ym[e]=n)||hs},Df=function(){return 0},gQ={suppressEvents:!0,isStart:!0,kill:!1},b0={suppressEvents:!0,kill:!1},vQ={suppressEvents:!0},$x={},ha=[],b2={},fM,ss={},fy={},Qk=30,S0=[],jx="",Fx=function(e){var n=e[0],r,s;if(Li(n)||fn(n)||(e=[e]),!(r=(n._gsap||{}).harness)){for(s=S0.length;s--&&!S0[s].targetTest(n););r=S0[s]}for(s=e.length;s--;)e[s]&&(e[s]._gsap||(e[s]._gsap=new LM(e[s],r)))||e.splice(s,1);return e},Ol=function(e){return e._gsap||Fx(As(e))[0]._gsap},hM=function(e,n,r){return(r=e[n])&&fn(r)?e[n]():Ox(r)&&e.getAttribute&&e.getAttribute(n)||r},zr=function(e,n){return(e=e.split(",")).forEach(n)||e},yn=function(e){return Math.round(e*1e5)/1e5||0},nn=function(e){return Math.round(e*1e7)/1e7||0},Kc=function(e,n){var r=n.charAt(0),s=parseFloat(n.substr(2));return e=parseFloat(e),r==="+"?e+s:r==="-"?e-s:r==="*"?e*s:e/s},yQ=function(e,n){for(var r=n.length,s=0;e.indexOf(n[s])<0&&++s<r;);return s<r},_m=function(){var e=ha.length,n=ha.slice(0),r,s;for(b2={},ha.length=0,r=0;r<e;r++)s=n[r],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},Vx=function(e){return!!(e._initted||e._startAt||e.add)},pM=function(e,n,r,s){ha.length&&!sr&&_m(),e.render(n,r,!!(sr&&n<0&&Vx(e))),ha.length&&!sr&&_m()},mM=function(e){var n=parseFloat(e);return(n||n===0)&&(e+"").match(pQ).length<2?n:qn(e)?e.trim():e},gM=function(e){return e},ps=function(e,n){for(var r in n)r in e||(e[r]=n[r]);return e},_Q=function(e){return function(n,r){for(var s in r)s in n||s==="duration"&&e||s==="ease"||(n[s]=r[s])}},bu=function(e,n){for(var r in n)e[r]=n[r];return e},Jk=function t(e,n){for(var r in n)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=Li(n[r])?t(e[r]||(e[r]={}),n[r]):n[r]);return e},wm=function(e,n){var r={},s;for(s in e)s in n||(r[s]=e[s]);return r},sf=function(e){var n=e.parent||rn,r=e.keyframes?_Q(fr(e.keyframes)):ps;if(Hr(e.inherit))for(;n;)r(e,n.vars.defaults),n=n.parent||n._dp;return e},wQ=function(e,n){for(var r=e.length,s=r===n.length;s&&r--&&e[r]===n[r];);return r<0},vM=function(e,n,r,s,i){var o=e[s],l;if(i)for(l=n[i];o&&o[i]>l;)o=o._prev;return o?(n._next=o._next,o._next=n):(n._next=e[r],e[r]=n),n._next?n._next._prev=n:e[s]=n,n._prev=o,n.parent=n._dp=e,n},Qm=function(e,n,r,s){r===void 0&&(r="_first"),s===void 0&&(s="_last");var i=n._prev,o=n._next;i?i._next=o:e[r]===n&&(e[r]=o),o?o._prev=i:e[s]===n&&(e[s]=i),n._next=n._prev=n.parent=null},ba=function(e,n){e.parent&&(!n||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},Ll=function(e,n){if(e&&(!n||n._end>e._dur||n._start<0))for(var r=e;r;)r._dirty=1,r=r.parent;return e},xQ=function(e){for(var n=e.parent;n&&n.parent;)n._dirty=1,n.totalDuration(),n=n.parent;return e},S2=function(e,n,r,s){return e._startAt&&(sr?e._startAt.revert(b0):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(n,!0,s))},bQ=function t(e){return!e||e._ts&&t(e.parent)},eC=function(e){return e._repeat?Su(e._tTime,e=e.duration()+e._rDelay)*e:0},Su=function(e,n){var r=Math.floor(e=nn(e/n));return e&&r===e?r-1:r},xm=function(e,n){return(e-n._start)*n._ts+(n._ts>=0?0:n._dirty?n.totalDuration():n._tDur)},Jm=function(e){return e._end=nn(e._start+(e._tDur/Math.abs(e._ts||e._rts||Dt)||0))},eg=function(e,n){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=nn(r._time-(e._ts>0?n/e._ts:((e._dirty?e.totalDuration():e._tDur)-n)/-e._ts)),Jm(e),r._dirty||Ll(r,e)),e},yM=function(e,n){var r;if((n._time||!n._dur&&n._initted||n._start<e._time&&(n._dur||!n.add))&&(r=xm(e.rawTime(),n),(!n._dur||oh(0,n.totalDuration(),r)-n._tTime>Dt)&&n.render(r,!0)),Ll(e,n)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(r=e;r._dp;)r.rawTime()>=0&&r.totalTime(r._tTime),r=r._dp;e._zTime=-Dt}},ki=function(e,n,r,s){return n.parent&&ba(n),n._start=nn((_o(r)?r:r||e!==rn?ks(e,r,n):e._time)+n._delay),n._end=nn(n._start+(n.totalDuration()/Math.abs(n.timeScale())||0)),vM(e,n,"_first","_last",e._sort?"_start":0),E2(n)||(e._recent=n),s||yM(e,n),e._ts<0&&eg(e,e._tTime),e},_M=function(e,n){return(hs.ScrollTrigger||Nx("scrollTrigger",n))&&hs.ScrollTrigger.create(n,e)},wM=function(e,n,r,s,i){if(zx(e,n,i),!e._initted)return 1;if(!r&&e._pt&&!sr&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&fM!==os.frame)return ha.push(e),e._lazy=[i,s],1},SQ=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},E2=function(e){var n=e.data;return n==="isFromStart"||n==="isStart"},EQ=function(e,n,r,s){var i=e.ratio,o=n<0||!n&&(!e._start&&SQ(e)&&!(!e._initted&&E2(e))||(e._ts<0||e._dp._ts<0)&&!E2(e))?0:1,l=e._rDelay,u=0,d,h,p;if(l&&e._repeat&&(u=oh(0,e._tDur,n),h=Su(u,l),e._yoyo&&h&1&&(o=1-o),h!==Su(e._tTime,l)&&(i=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==i||sr||s||e._zTime===Dt||!n&&e._zTime){if(!e._initted&&wM(e,n,s,r,u))return;for(p=e._zTime,e._zTime=n||(r?Dt:0),r||(r=n&&!p),e.ratio=o,e._from&&(o=1-o),e._time=0,e._tTime=u,d=e._pt;d;)d.r(o,d.d),d=d._next;n<0&&S2(e,n,r,!0),e._onUpdate&&!r&&as(e,"onUpdate"),u&&e._repeat&&!r&&e.parent&&as(e,"onRepeat"),(n>=e._tDur||n<0)&&e.ratio===o&&(o&&ba(e,1),!r&&!sr&&(as(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=n)},kQ=function(e,n,r){var s;if(r>n)for(s=e._first;s&&s._start<=r;){if(s.data==="isPause"&&s._start>n)return s;s=s._next}else for(s=e._last;s&&s._start>=r;){if(s.data==="isPause"&&s._start<n)return s;s=s._prev}},Eu=function(e,n,r,s){var i=e._repeat,o=nn(n)||0,l=e._tTime/e._tDur;return l&&!s&&(e._time*=o/e._dur),e._dur=o,e._tDur=i?i<0?1e10:nn(o*(i+1)+e._rDelay*i):o,l>0&&!s&&eg(e,e._tTime=e._tDur*l),e.parent&&Jm(e),r||Ll(e.parent,e),e},tC=function(e){return e instanceof $r?Ll(e):Eu(e,e._dur)},CQ={_start:0,endTime:Df,totalDuration:Df},ks=function t(e,n,r){var s=e.labels,i=e._recent||CQ,o=e.duration()>=Is?i.endTime(!1):e._dur,l,u,d;return qn(n)&&(isNaN(n)||n in s)?(u=n.charAt(0),d=n.substr(-1)==="%",l=n.indexOf("="),u==="<"||u===">"?(l>=0&&(n=n.replace(/=/,"")),(u==="<"?i._start:i.endTime(i._repeat>=0))+(parseFloat(n.substr(1))||0)*(d?(l<0?i:r).totalDuration()/100:1)):l<0?(n in s||(s[n]=o),s[n]):(u=parseFloat(n.charAt(l-1)+n.substr(l+1)),d&&r&&(u=u/100*(fr(r)?r[0]:r).totalDuration()),l>1?t(e,n.substr(0,l-1),r)+u:o+u)):n==null?o:+n},of=function(e,n,r){var s=_o(n[1]),i=(s?2:1)+(e<2?0:1),o=n[i],l,u;if(s&&(o.duration=n[1]),o.parent=r,e){for(l=o,u=r;u&&!("immediateRender"in l);)l=u.vars.defaults||{},u=Hr(u.vars.inherit)&&u.parent;o.immediateRender=Hr(l.immediateRender),e<2?o.runBackwards=1:o.startAt=n[i-1]}return new In(n[0],o,n[i+1])},Ra=function(e,n){return e||e===0?n(e):n},oh=function(e,n,r){return r<e?e:r>n?n:r},ur=function(e,n){return!qn(e)||!(n=mQ.exec(e))?"":n[1]},PQ=function(e,n,r){return Ra(r,function(s){return oh(e,n,s)})},k2=[].slice,xM=function(e,n){return e&&Li(e)&&"length"in e&&(!n&&!e.length||e.length-1 in e&&Li(e[0]))&&!e.nodeType&&e!==_i},TQ=function(e,n,r){return r===void 0&&(r=[]),e.forEach(function(s){var i;return qn(s)&&!n||xM(s,1)?(i=r).push.apply(i,As(s)):r.push(s)})||r},As=function(e,n,r){return Yt&&!n&&Yt.selector?Yt.selector(e):qn(e)&&!r&&(x2||!ku())?k2.call((n||Dx).querySelectorAll(e),0):fr(e)?TQ(e,r):xM(e)?k2.call(e,0):e?[e]:[]},C2=function(e){return e=As(e)[0]||Lf("Invalid scope")||{},function(n){var r=e.current||e.nativeElement||e;return As(n,r.querySelectorAll?r:r===e?Lf("Invalid scope")||Dx.createElement("div"):e)}},bM=function(e){return e.sort(function(){return .5-Math.random()})},SM=function(e){if(fn(e))return e;var n=Li(e)?e:{each:e},r=Dl(n.ease),s=n.from||0,i=parseFloat(n.base)||0,o={},l=s>0&&s<1,u=isNaN(s)||l,d=n.axis,h=s,p=s;return qn(s)?h=p={center:.5,edges:.5,end:1}[s]||0:!l&&u&&(h=s[0],p=s[1]),function(m,v,w){var _=(w||n).length,x=o[_],b,k,C,T,I,M,R,A,L;if(!x){if(L=n.grid==="auto"?0:(n.grid||[1,Is])[1],!L){for(R=-Is;R<(R=w[L++].getBoundingClientRect().left)&&L<_;);L<_&&L--}for(x=o[_]=[],b=u?Math.min(L,_)*h-.5:s%L,k=L===Is?0:u?_*p/L-.5:s/L|0,R=0,A=Is,M=0;M<_;M++)C=M%L-b,T=k-(M/L|0),x[M]=I=d?Math.abs(d==="y"?T:C):iM(C*C+T*T),I>R&&(R=I),I<A&&(A=I);s==="random"&&bM(x),x.max=R-A,x.min=A,x.v=_=(parseFloat(n.amount)||parseFloat(n.each)*(L>_?_-1:d?d==="y"?_/L:L:Math.max(L,_/L))||0)*(s==="edges"?-1:1),x.b=_<0?i-_:i,x.u=ur(n.amount||n.each)||0,r=r&&_<0?HQ(r):r}return _=(x[m]-x.min)/x.max||0,nn(x.b+(r?r(_):_)*x.v)+x.u}},P2=function(e){var n=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var s=nn(Math.round(parseFloat(r)/e)*e*n);return(s-s%1)/n+(_o(r)?0:ur(r))}},EM=function(e,n){var r=fr(e),s,i;return!r&&Li(e)&&(s=r=e.radius||Is,e.values?(e=As(e.values),(i=!_o(e[0]))&&(s*=s)):e=P2(e.increment)),Ra(n,r?fn(e)?function(o){return i=e(o),Math.abs(i-o)<=s?i:o}:function(o){for(var l=parseFloat(i?o.x:o),u=parseFloat(i?o.y:0),d=Is,h=0,p=e.length,m,v;p--;)i?(m=e[p].x-l,v=e[p].y-u,m=m*m+v*v):m=Math.abs(e[p]-l),m<d&&(d=m,h=p);return h=!s||d<=s?e[h]:o,i||h===o||_o(o)?h:h+ur(o)}:P2(e))},kM=function(e,n,r,s){return Ra(fr(e)?!n:r===!0?!!(r=0):!s,function(){return fr(e)?e[~~(Math.random()*e.length)]:(r=r||1e-5)&&(s=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((e-r/2+Math.random()*(n-e+r*.99))/r)*r*s)/s})},IQ=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return function(s){return n.reduce(function(i,o){return o(i)},s)}},AQ=function(e,n){return function(r){return e(parseFloat(r))+(n||ur(r))}},RQ=function(e,n,r){return PM(e,n,0,1,r)},CM=function(e,n,r){return Ra(r,function(s){return e[~~n(s)]})},MQ=function t(e,n,r){var s=n-e;return fr(e)?CM(e,t(0,e.length),n):Ra(r,function(i){return(s+(i-e)%s)%s+e})},OQ=function t(e,n,r){var s=n-e,i=s*2;return fr(e)?CM(e,t(0,e.length-1),n):Ra(r,function(o){return o=(i+(o-e)%i)%i||0,e+(o>s?i-o:o)})},Nf=function(e){return e.replace(fQ,function(n){var r=n.indexOf("[")+1,s=n.substring(r||7,r?n.indexOf("]"):n.length-1).split(hQ);return kM(r?s:+s[0],r?0:+s[1],+s[2]||1e-5)})},PM=function(e,n,r,s,i){var o=n-e,l=s-r;return Ra(i,function(u){return r+((u-e)/o*l||0)})},LQ=function t(e,n,r,s){var i=isNaN(e+n)?0:function(v){return(1-v)*e+v*n};if(!i){var o=qn(e),l={},u,d,h,p,m;if(r===!0&&(s=1)&&(r=null),o)e={p:e},n={p:n};else if(fr(e)&&!fr(n)){for(h=[],p=e.length,m=p-2,d=1;d<p;d++)h.push(t(e[d-1],e[d]));p--,i=function(w){w*=p;var _=Math.min(m,~~w);return h[_](w-_)},r=n}else s||(e=bu(fr(e)?[]:{},e));if(!h){for(u in n)Hx.call(l,e,u,"get",n[u]);i=function(w){return Wx(w,l)||(o?e.p:e)}}}return Ra(r,i)},nC=function(e,n,r){var s=e.labels,i=Is,o,l,u;for(o in s)l=s[o]-n,l<0==!!r&&l&&i>(l=Math.abs(l))&&(u=o,i=l);return u},as=function(e,n,r){var s=e.vars,i=s[n],o=Yt,l=e._ctx,u,d,h;if(i)return u=s[n+"Params"],d=s.callbackScope||e,r&&ha.length&&_m(),l&&(Yt=l),h=u?i.apply(d,u):i.call(d),Yt=o,h},Fd=function(e){return ba(e),e.scrollTrigger&&e.scrollTrigger.kill(!!sr),e.progress()<1&&as(e,"onInterrupt"),e},Hc,TM=[],IM=function(e){if(e)if(e=!e.name&&e.default||e,Lx()||e.headless){var n=e.name,r=fn(e),s=n&&!r&&e.init?function(){this._props=[]}:e,i={init:Df,render:Wx,add:Hx,kill:XQ,modifier:YQ,rawVars:0},o={targetTest:0,get:0,getSetter:Ux,aliases:{},register:0};if(ku(),e!==s){if(ss[n])return;ps(s,ps(wm(e,i),o)),bu(s.prototype,bu(i,wm(e,o))),ss[s.prop=n]=s,e.targetTest&&(S0.push(s),$x[n]=1),n=(n==="css"?"CSS":n.charAt(0).toUpperCase()+n.substr(1))+"Plugin"}dM(n,s),e.register&&e.register(Wr,s,Br)}else TM.push(e)},Lt=255,Vd={aqua:[0,Lt,Lt],lime:[0,Lt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Lt],navy:[0,0,128],white:[Lt,Lt,Lt],olive:[128,128,0],yellow:[Lt,Lt,0],orange:[Lt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Lt,0,0],pink:[Lt,192,203],cyan:[0,Lt,Lt],transparent:[Lt,Lt,Lt,0]},hy=function(e,n,r){return e+=e<0?1:e>1?-1:0,(e*6<1?n+(r-n)*e*6:e<.5?r:e*3<2?n+(r-n)*(2/3-e)*6:n)*Lt+.5|0},AM=function(e,n,r){var s=e?_o(e)?[e>>16,e>>8&Lt,e&Lt]:0:Vd.black,i,o,l,u,d,h,p,m,v,w;if(!s){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Vd[e])s=Vd[e];else if(e.charAt(0)==="#"){if(e.length<6&&(i=e.charAt(1),o=e.charAt(2),l=e.charAt(3),e="#"+i+i+o+o+l+l+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return s=parseInt(e.substr(1,6),16),[s>>16,s>>8&Lt,s&Lt,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),s=[e>>16,e>>8&Lt,e&Lt]}else if(e.substr(0,3)==="hsl"){if(s=w=e.match(Xk),!n)u=+s[0]%360/360,d=+s[1]/100,h=+s[2]/100,o=h<=.5?h*(d+1):h+d-h*d,i=h*2-o,s.length>3&&(s[3]*=1),s[0]=hy(u+1/3,i,o),s[1]=hy(u,i,o),s[2]=hy(u-1/3,i,o);else if(~e.indexOf("="))return s=e.match(aM),r&&s.length<4&&(s[3]=1),s}else s=e.match(Xk)||Vd.transparent;s=s.map(Number)}return n&&!w&&(i=s[0]/Lt,o=s[1]/Lt,l=s[2]/Lt,p=Math.max(i,o,l),m=Math.min(i,o,l),h=(p+m)/2,p===m?u=d=0:(v=p-m,d=h>.5?v/(2-p-m):v/(p+m),u=p===i?(o-l)/v+(o<l?6:0):p===o?(l-i)/v+2:(i-o)/v+4,u*=60),s[0]=~~(u+.5),s[1]=~~(d*100+.5),s[2]=~~(h*100+.5)),r&&s.length<4&&(s[3]=1),s},RM=function(e){var n=[],r=[],s=-1;return e.split(pa).forEach(function(i){var o=i.match(Vc)||[];n.push.apply(n,o),r.push(s+=o.length+1)}),n.c=r,n},rC=function(e,n,r){var s="",i=(e+s).match(pa),o=n?"hsla(":"rgba(",l=0,u,d,h,p;if(!i)return e;if(i=i.map(function(m){return(m=AM(m,n,1))&&o+(n?m[0]+","+m[1]+"%,"+m[2]+"%,"+m[3]:m.join(","))+")"}),r&&(h=RM(e),u=r.c,u.join(s)!==h.c.join(s)))for(d=e.replace(pa,"1").split(Vc),p=d.length-1;l<p;l++)s+=d[l]+(~u.indexOf(l)?i.shift()||o+"0,0,0,0)":(h.length?h:i.length?i:r).shift());if(!d)for(d=e.split(pa),p=d.length-1;l<p;l++)s+=d[l]+i[l];return s+d[p]},pa=(function(){var t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in Vd)t+="|"+e+"\\b";return new RegExp(t+")","gi")})(),DQ=/hsl[a]?\(/,MM=function(e){var n=e.join(" "),r;if(pa.lastIndex=0,pa.test(n))return r=DQ.test(n),e[1]=rC(e[1],r),e[0]=rC(e[0],r,RM(e[1])),!0},$f,os=(function(){var t=Date.now,e=500,n=33,r=t(),s=r,i=1e3/240,o=i,l=[],u,d,h,p,m,v,w=function _(x){var b=t()-s,k=x===!0,C,T,I,M;if((b>e||b<0)&&(r+=b-n),s+=b,I=s-r,C=I-o,(C>0||k)&&(M=++p.frame,m=I-p.time*1e3,p.time=I=I/1e3,o+=C+(C>=i?4:i-C),T=1),k||(u=d(_)),T)for(v=0;v<l.length;v++)l[v](I,m,M,x)};return p={time:0,frame:0,tick:function(){w(!0)},deltaRatio:function(x){return m/(1e3/(x||60))},wake:function(){cM&&(!x2&&Lx()&&(_i=x2=window,Dx=_i.document||{},hs.gsap=Wr,(_i.gsapVersions||(_i.gsapVersions=[])).push(Wr.version),uM(ym||_i.GreenSockGlobals||!_i.gsap&&_i||{}),TM.forEach(IM)),h=typeof requestAnimationFrame<"u"&&requestAnimationFrame,u&&p.sleep(),d=h||function(x){return setTimeout(x,o-p.time*1e3+1|0)},$f=1,w(2))},sleep:function(){(h?cancelAnimationFrame:clearTimeout)(u),$f=0,d=Df},lagSmoothing:function(x,b){e=x||1/0,n=Math.min(b||33,e)},fps:function(x){i=1e3/(x||240),o=p.time*1e3+i},add:function(x,b,k){var C=b?function(T,I,M,R){x(T,I,M,R),p.remove(C)}:x;return p.remove(x),l[k?"unshift":"push"](C),ku(),C},remove:function(x,b){~(b=l.indexOf(x))&&l.splice(b,1)&&v>=b&&v--},_listeners:l},p})(),ku=function(){return!$f&&os.wake()},gt={},NQ=/^[\d.\-M][\d.\-,\s]/,$Q=/["']/g,jQ=function(e){for(var n={},r=e.substr(1,e.length-3).split(":"),s=r[0],i=1,o=r.length,l,u,d;i<o;i++)u=r[i],l=i!==o-1?u.lastIndexOf(","):u.length,d=u.substr(0,l),n[s]=isNaN(d)?d.replace($Q,"").trim():+d,s=u.substr(l+1).trim();return n},FQ=function(e){var n=e.indexOf("(")+1,r=e.indexOf(")"),s=e.indexOf("(",n);return e.substring(n,~s&&s<r?e.indexOf(")",r+1):r)},VQ=function(e){var n=(e+"").split("("),r=gt[n[0]];return r&&n.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[jQ(n[1])]:FQ(e).split(",").map(mM)):gt._CE&&NQ.test(e)?gt._CE("",e):r},HQ=function(e){return function(n){return 1-e(1-n)}},Dl=function(e,n){return e&&(fn(e)?e:gt[e]||VQ(e))||n},Bl=function(e,n,r,s){r===void 0&&(r=function(u){return 1-n(1-u)}),s===void 0&&(s=function(u){return u<.5?n(u*2)/2:1-n((1-u)*2)/2});var i={easeIn:n,easeOut:r,easeInOut:s},o;return zr(e,function(l){gt[l]=hs[l]=i,gt[o=l.toLowerCase()]=r;for(var u in i)gt[o+(u==="easeIn"?".in":u==="easeOut"?".out":".inOut")]=gt[l+"."+u]=i[u]}),i},OM=function(e){return function(n){return n<.5?(1-e(1-n*2))/2:.5+e((n-.5)*2)/2}},py=function t(e,n,r){var s=n>=1?n:1,i=(r||(e?.3:.45))/(n<1?n:1),o=i/w2*(Math.asin(1/s)||0),l=function(h){return h===1?1:s*Math.pow(2,-10*h)*dQ((h-o)*i)+1},u=e==="out"?l:e==="in"?function(d){return 1-l(1-d)}:OM(l);return i=w2/i,u.config=function(d,h){return t(e,d,h)},u},my=function t(e,n){n===void 0&&(n=1.70158);var r=function(o){return o?--o*o*((n+1)*o+n)+1:0},s=e==="out"?r:e==="in"?function(i){return 1-r(1-i)}:OM(r);return s.config=function(i){return t(e,i)},s};zr("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var n=e<5?e+1:e;Bl(t+",Power"+(n-1),e?function(r){return Math.pow(r,n)}:function(r){return r},function(r){return 1-Math.pow(1-r,n)},function(r){return r<.5?Math.pow(r*2,n)/2:1-Math.pow((1-r)*2,n)/2})});gt.Linear.easeNone=gt.none=gt.Linear.easeIn;Bl("Elastic",py("in"),py("out"),py());(function(t,e){var n=1/e,r=2*n,s=2.5*n,i=function(l){return l<n?t*l*l:l<r?t*Math.pow(l-1.5/e,2)+.75:l<s?t*(l-=2.25/e)*l+.9375:t*Math.pow(l-2.625/e,2)+.984375};Bl("Bounce",function(o){return 1-i(1-o)},i)})(7.5625,2.75);Bl("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)});Bl("Circ",function(t){return-(iM(1-t*t)-1)});Bl("Sine",function(t){return t===1?1:-uQ(t*lQ)+1});Bl("Back",my("in"),my("out"),my());gt.SteppedEase=gt.steps=hs.SteppedEase={config:function(e,n){e===void 0&&(e=1);var r=1/e,s=e+(n?0:1),i=n?1:0,o=1-Dt;return function(l){return((s*oh(0,o,l)|0)+i)*r}}};Of.ease=gt["quad.out"];zr("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return jx+=t+","+t+"Params,"});var LM=function(e,n){this.id=cQ++,e._gsap=this,this.target=e,this.harness=n,this.get=n?n.get:hM,this.set=n?n.getSetter:Ux},jf=(function(){function t(n){this.vars=n,this._delay=+n.delay||0,(this._repeat=n.repeat===1/0?-2:n.repeat||0)&&(this._rDelay=n.repeatDelay||0,this._yoyo=!!n.yoyo||!!n.yoyoEase),this._ts=1,Eu(this,+n.duration,1,1),this.data=n.data,Yt&&(this._ctx=Yt,Yt.data.push(this)),$f||os.wake()}var e=t.prototype;return e.delay=function(r){return r||r===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+r-this._delay),this._delay=r,this):this._delay},e.duration=function(r){return arguments.length?this.totalDuration(this._repeat>0?r+(r+this._rDelay)*this._repeat:r):this.totalDuration()&&this._dur},e.totalDuration=function(r){return arguments.length?(this._dirty=0,Eu(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,s){if(ku(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(eg(this,r),!i._dp||i.parent||yM(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&r<this._tDur||this._ts<0&&r>0||!this._tDur&&!r)&&ki(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!s||this._initted&&Math.abs(this._zTime)===Dt||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),pM(this,r,s)),this},e.time=function(r,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+eC(this))%(this._dur+this._rDelay)||(r?this._dur:0),s):this._time},e.totalProgress=function(r,s){return arguments.length?this.totalTime(this.totalDuration()*r,s):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(r,s){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-r:r)+eC(this),s):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(r,s){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(r-1)*i,s):this._repeat?Su(this._tTime,i)+1:1},e.timeScale=function(r,s){if(!arguments.length)return this._rts===-Dt?0:this._rts;if(this._rts===r)return this;var i=this.parent&&this._ts?xm(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-Dt?0:this._rts,this.totalTime(oh(-Math.abs(this._delay),this.totalDuration(),i),s!==!1),Jm(this),xQ(this)},e.paused=function(r){return arguments.length?(this._ps!==r&&(this._ps=r,r?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(ku(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Dt&&(this._tTime-=Dt)))),this):this._ps},e.startTime=function(r){if(arguments.length){this._start=nn(r);var s=this.parent||this._dp;return s&&(s._sort||!this.parent)&&ki(s,this,this._start-this._delay),this}return this._start},e.endTime=function(r){return this._start+(Hr(r)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(r){var s=this.parent||this._dp;return s?r&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?xm(s.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=vQ);var s=sr;return sr=r,Vx(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),sr=s,this},e.globalTime=function(r){for(var s=this,i=arguments.length?r:s.rawTime();s;)i=s._start+i/(Math.abs(s._ts)||1),s=s._dp;return!this.parent&&this._sat?this._sat.globalTime(r):i},e.repeat=function(r){return arguments.length?(this._repeat=r===1/0?-2:r,tC(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var s=this._time;return this._rDelay=r,tC(this),s?this.time(s):this}return this._rDelay},e.yoyo=function(r){return arguments.length?(this._yoyo=r,this):this._yoyo},e.seek=function(r,s){return this.totalTime(ks(this,r),Hr(s))},e.restart=function(r,s){return this.play().totalTime(r?-this._delay:0,Hr(s)),this._dur||(this._zTime=-Dt),this},e.play=function(r,s){return r!=null&&this.seek(r,s),this.reversed(!1).paused(!1)},e.reverse=function(r,s){return r!=null&&this.seek(r||this.totalDuration(),s),this.reversed(!0).paused(!1)},e.pause=function(r,s){return r!=null&&this.seek(r,s),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(r){return arguments.length?(!!r!==this.reversed()&&this.timeScale(-this._rts||(r?-Dt:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-Dt,this},e.isActive=function(){var r=this.parent||this._dp,s=this._start,i;return!!(!r||this._ts&&this._initted&&r.isActive()&&(i=r.rawTime(!0))>=s&&i<this.endTime(!0)-Dt)},e.eventCallback=function(r,s,i){var o=this.vars;return arguments.length>1?(s?(o[r]=s,i&&(o[r+"Params"]=i),r==="onUpdate"&&(this._onUpdate=s)):delete o[r],this):o[r]},e.then=function(r){var s=this,i=s._prom;return new Promise(function(o){var l=fn(r)?r:gM,u=function(){var h=s.then;s.then=null,i&&i(),fn(l)&&(l=l(s))&&(l.then||l===s)&&(s.then=h),o(l),s.then=h};s._initted&&s.totalProgress()===1&&s._ts>=0||!s._tTime&&s._ts<0?u():s._prom=u})},e.kill=function(){Fd(this)},t})();ps(jf.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Dt,_prom:0,_ps:!1,_rts:1});var $r=(function(t){sM(e,t);function e(r,s){var i;return r===void 0&&(r={}),i=t.call(this,r)||this,i.labels={},i.smoothChildTiming=!!r.smoothChildTiming,i.autoRemoveChildren=!!r.autoRemoveChildren,i._sort=Hr(r.sortChildren),rn&&ki(r.parent||rn,ro(i),s),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&_M(ro(i),r.scrollTrigger),i}var n=e.prototype;return n.to=function(s,i,o){return of(0,arguments,this),this},n.from=function(s,i,o){return of(1,arguments,this),this},n.fromTo=function(s,i,o,l){return of(2,arguments,this),this},n.set=function(s,i,o){return i.duration=0,i.parent=this,sf(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new In(s,i,ks(this,o),1),this},n.call=function(s,i,o){return ki(this,In.delayedCall(0,s,i),o)},n.staggerTo=function(s,i,o,l,u,d,h){return o.duration=i,o.stagger=o.stagger||l,o.onComplete=d,o.onCompleteParams=h,o.parent=this,new In(s,o,ks(this,u)),this},n.staggerFrom=function(s,i,o,l,u,d,h){return o.runBackwards=1,sf(o).immediateRender=Hr(o.immediateRender),this.staggerTo(s,i,o,l,u,d,h)},n.staggerFromTo=function(s,i,o,l,u,d,h,p){return l.startAt=o,sf(l).immediateRender=Hr(l.immediateRender),this.staggerTo(s,i,l,u,d,h,p)},n.render=function(s,i,o){var l=this._time,u=this._dirty?this.totalDuration():this._tDur,d=this._dur,h=s<=0?0:nn(s),p=this._zTime<0!=s<0&&(this._initted||!d),m,v,w,_,x,b,k,C,T,I,M,R;if(this!==rn&&h>u&&s>=0&&(h=u),h!==this._tTime||o||p){if(l!==this._time&&d&&(h+=this._time-l,s+=this._time-l),m=h,T=this._start,C=this._ts,b=!C,p&&(d||(l=this._zTime),(s||!i)&&(this._zTime=s)),this._repeat){if(M=this._yoyo,x=d+this._rDelay,this._repeat<-1&&s<0)return this.totalTime(x*100+s,i,o);if(m=nn(h%x),h===u?(_=this._repeat,m=d):(I=nn(h/x),_=~~I,_&&_===I&&(m=d,_--),m>d&&(m=d)),I=Su(this._tTime,x),!l&&this._tTime&&I!==_&&this._tTime-I*x-this._dur<=0&&(I=_),M&&_&1&&(m=d-m,R=1),_!==I&&!this._lock){var A=M&&I&1,L=A===(M&&_&1);if(_<I&&(A=!A),l=A?0:h%d?d:h,this._lock=1,this.render(l||(R?0:nn(_*x)),i,!d)._lock=0,this._tTime=h,!i&&this.parent&&as(this,"onRepeat"),this.vars.repeatRefresh&&!R&&(this.invalidate()._lock=1,I=_),l&&l!==this._time||b!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(d=this._dur,u=this._tDur,L&&(this._lock=2,l=A?d:-1e-4,this.render(l,!0),this.vars.repeatRefresh&&!R&&this.invalidate()),this._lock=0,!this._ts&&!b)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(k=kQ(this,nn(l),nn(m)),k&&(h-=m-(m=k._start))),this._tTime=h,this._time=m,this._act=!!C,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=s,l=0),!l&&h&&d&&!i&&!I&&(as(this,"onStart"),this._tTime!==h))return this;if(m>=l&&s>=0)for(v=this._first;v;){if(w=v._next,(v._act||m>=v._start)&&v._ts&&k!==v){if(v.parent!==this)return this.render(s,i,o);if(v.render(v._ts>0?(m-v._start)*v._ts:(v._dirty?v.totalDuration():v._tDur)+(m-v._start)*v._ts,i,o),m!==this._time||!this._ts&&!b){k=0,w&&(h+=this._zTime=-Dt);break}}v=w}else{v=this._last;for(var N=s<0?s:m;v;){if(w=v._prev,(v._act||N<=v._end)&&v._ts&&k!==v){if(v.parent!==this)return this.render(s,i,o);if(v.render(v._ts>0?(N-v._start)*v._ts:(v._dirty?v.totalDuration():v._tDur)+(N-v._start)*v._ts,i,o||sr&&Vx(v)),m!==this._time||!this._ts&&!b){k=0,w&&(h+=this._zTime=N?-Dt:Dt);break}}v=w}}if(k&&!i&&(this.pause(),k.render(m>=l?0:-Dt)._zTime=m>=l?1:-1,this._ts))return this._start=T,Jm(this),this.render(s,i,o);this._onUpdate&&!i&&as(this,"onUpdate",!0),(h===u&&this._tTime>=this.totalDuration()||!h&&l)&&(T===this._start||Math.abs(C)!==Math.abs(this._ts))&&(this._lock||((s||!d)&&(h===u&&this._ts>0||!h&&this._ts<0)&&ba(this,1),!i&&!(s<0&&!l)&&(h||l||!u)&&(as(this,h===u&&s>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(h<u&&this.timeScale()>0)&&this._prom())))}return this},n.add=function(s,i){var o=this;if(_o(i)||(i=ks(this,i,s)),!(s instanceof jf)){if(fr(s))return s.forEach(function(l){return o.add(l,i)}),this;if(qn(s))return this.addLabel(s,i);if(fn(s))s=In.delayedCall(0,s);else return this}return this!==s?ki(this,s,i):this},n.getChildren=function(s,i,o,l){s===void 0&&(s=!0),i===void 0&&(i=!0),o===void 0&&(o=!0),l===void 0&&(l=-Is);for(var u=[],d=this._first;d;)d._start>=l&&(d instanceof In?i&&u.push(d):(o&&u.push(d),s&&u.push.apply(u,d.getChildren(!0,i,o)))),d=d._next;return u},n.getById=function(s){for(var i=this.getChildren(1,1,1),o=i.length;o--;)if(i[o].vars.id===s)return i[o]},n.remove=function(s){return qn(s)?this.removeLabel(s):fn(s)?this.killTweensOf(s):(s.parent===this&&Qm(this,s),s===this._recent&&(this._recent=this._last),Ll(this))},n.totalTime=function(s,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=nn(os.time-(this._ts>0?s/this._ts:(this.totalDuration()-s)/-this._ts))),t.prototype.totalTime.call(this,s,i),this._forcing=0,this):this._tTime},n.addLabel=function(s,i){return this.labels[s]=ks(this,i),this},n.removeLabel=function(s){return delete this.labels[s],this},n.addPause=function(s,i,o){var l=In.delayedCall(0,i||Df,o);return l.data="isPause",this._hasPause=1,ki(this,l,ks(this,s))},n.removePause=function(s){var i=this._first;for(s=ks(this,s);i;)i._start===s&&i.data==="isPause"&&ba(i),i=i._next},n.killTweensOf=function(s,i,o){for(var l=this.getTweensOf(s,o),u=l.length;u--;)aa!==l[u]&&l[u].kill(s,i);return this},n.getTweensOf=function(s,i){for(var o=[],l=As(s),u=this._first,d=_o(i),h;u;)u instanceof In?yQ(u._targets,l)&&(d?(!aa||u._initted&&u._ts)&&u.globalTime(0)<=i&&u.globalTime(u.totalDuration())>i:!i||u.isActive())&&o.push(u):(h=u.getTweensOf(l,i)).length&&o.push.apply(o,h),u=u._next;return o},n.tweenTo=function(s,i){i=i||{};var o=this,l=ks(o,s),u=i,d=u.startAt,h=u.onStart,p=u.onStartParams,m=u.immediateRender,v,w=In.to(o,ps({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:l,overwrite:"auto",duration:i.duration||Math.abs((l-(d&&"time"in d?d.time:o._time))/o.timeScale())||Dt,onStart:function(){if(o.pause(),!v){var x=i.duration||Math.abs((l-(d&&"time"in d?d.time:o._time))/o.timeScale());w._dur!==x&&Eu(w,x,0,1).render(w._time,!0,!0),v=1}h&&h.apply(w,p||[])}},i));return m?w.render(0):w},n.tweenFromTo=function(s,i,o){return this.tweenTo(i,ps({startAt:{time:ks(this,s)}},o))},n.recent=function(){return this._recent},n.nextLabel=function(s){return s===void 0&&(s=this._time),nC(this,ks(this,s))},n.previousLabel=function(s){return s===void 0&&(s=this._time),nC(this,ks(this,s),1)},n.currentLabel=function(s){return arguments.length?this.seek(s,!0):this.previousLabel(this._time+Dt)},n.shiftChildren=function(s,i,o){o===void 0&&(o=0);var l=this._first,u=this.labels,d;for(s=nn(s);l;)l._start>=o&&(l._start+=s,l._end+=s),l=l._next;if(i)for(d in u)u[d]>=o&&(u[d]+=s);return Ll(this)},n.invalidate=function(s){var i=this._first;for(this._lock=0;i;)i.invalidate(s),i=i._next;return t.prototype.invalidate.call(this,s)},n.clear=function(s){s===void 0&&(s=!0);for(var i=this._first,o;i;)o=i._next,this.remove(i),i=o;return this._dp&&(this._time=this._tTime=this._pTime=0),s&&(this.labels={}),Ll(this)},n.totalDuration=function(s){var i=0,o=this,l=o._last,u=Is,d,h,p;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-s:s));if(o._dirty){for(p=o.parent;l;)d=l._prev,l._dirty&&l.totalDuration(),h=l._start,h>u&&o._sort&&l._ts&&!o._lock?(o._lock=1,ki(o,l,h-l._delay,1)._lock=0):u=h,h<0&&l._ts&&(i-=h,(!p&&!o._dp||p&&p.smoothChildTiming)&&(o._start+=nn(h/o._ts),o._time-=h,o._tTime-=h),o.shiftChildren(-h,!1,-1/0),u=0),l._end>i&&l._ts&&(i=l._end),l=d;Eu(o,o===rn&&o._time>i?o._time:i,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(s){if(rn._ts&&(pM(rn,xm(s,rn)),fM=os.frame),os.frame>=Qk){Qk+=ds.autoSleep||120;var i=rn._first;if((!i||!i._ts)&&ds.autoSleep&&os._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||os.sleep()}}},e})(jf);ps($r.prototype,{_lock:0,_hasPause:0,_forcing:0});var zQ=function(e,n,r,s,i,o,l){var u=new Br(this._pt,e,n,0,1,VM,null,i),d=0,h=0,p,m,v,w,_,x,b,k;for(u.b=r,u.e=s,r+="",s+="",(b=~s.indexOf("random("))&&(s=Nf(s)),o&&(k=[r,s],o(k,e,n),r=k[0],s=k[1]),m=r.match(dy)||[];p=dy.exec(s);)w=p[0],_=s.substring(d,p.index),v?v=(v+1)%5:_.substr(-5)==="rgba("&&(v=1),w!==m[h++]&&(x=parseFloat(m[h-1])||0,u._pt={_next:u._pt,p:_||h===1?_:",",s:x,c:w.charAt(1)==="="?Kc(x,w)-x:parseFloat(w)-x,m:v&&v<4?Math.round:0},d=dy.lastIndex);return u.c=d<s.length?s.substring(d,s.length):"",u.fp=l,(lM.test(s)||b)&&(u.e=0),this._pt=u,u},Hx=function(e,n,r,s,i,o,l,u,d,h){fn(s)&&(s=s(i||0,e,o));var p=e[n],m=r!=="get"?r:fn(p)?d?e[n.indexOf("set")||!fn(e["get"+n.substr(3)])?n:"get"+n.substr(3)](d):e[n]():p,v=fn(p)?d?qQ:jM:Bx,w;if(qn(s)&&(~s.indexOf("random(")&&(s=Nf(s)),s.charAt(1)==="="&&(w=Kc(m,s)+(ur(m)||0),(w||w===0)&&(s=w))),!h||m!==s||T2)return!isNaN(m*s)&&s!==""?(w=new Br(this._pt,e,n,+m||0,s-(m||0),typeof p=="boolean"?KQ:FM,0,v),d&&(w.fp=d),l&&w.modifier(l,this,e),this._pt=w):(!p&&!(n in e)&&Nx(n,s),zQ.call(this,e,n,m,s,v,u||ds.stringFilter,d))},BQ=function(e,n,r,s,i){if(fn(e)&&(e=af(e,i,n,r,s)),!Li(e)||e.style&&e.nodeType||fr(e)||oM(e))return qn(e)?af(e,i,n,r,s):e;var o={},l;for(l in e)o[l]=af(e[l],i,n,r,s);return o},DM=function(e,n,r,s,i,o){var l,u,d,h;if(ss[e]&&(l=new ss[e]).init(i,l.rawVars?n[e]:BQ(n[e],s,i,o,r),r,s,o)!==!1&&(r._pt=u=new Br(r._pt,i,e,0,1,l.render,l,0,l.priority),r!==Hc))for(d=r._ptLookup[r._targets.indexOf(i)],h=l._props.length;h--;)d[l._props[h]]=u;return l},aa,T2,zx=function t(e,n,r){var s=e.vars,i=s.ease,o=s.startAt,l=s.immediateRender,u=s.lazy,d=s.onUpdate,h=s.runBackwards,p=s.yoyoEase,m=s.keyframes,v=s.autoRevert,w=e._dur,_=e._startAt,x=e._targets,b=e.parent,k=b&&b.data==="nested"?b.vars.targets:x,C=e._overwrite==="auto"&&!Mx,T=e.timeline,I=s.easeReverse||p,M,R,A,L,N,F,j,Q,q,Z,W,Y,V;if(T&&(!m||!i)&&(i="none"),e._ease=Dl(i,Of.ease),e._rEase=I&&(Dl(I)||e._ease),e._from=!T&&!!s.runBackwards,e._from&&(e.ratio=1),!T||m&&!s.stagger){if(Q=x[0]?Ol(x[0]).harness:0,Y=Q&&s[Q.prop],M=wm(s,$x),_&&(_._zTime<0&&_.progress(1),n<0&&h&&l&&!v?_.render(-1,!0):_.revert(h&&w?b0:gQ),_._lazy=0),o){if(ba(e._startAt=In.set(x,ps({data:"isStart",overwrite:!1,parent:b,immediateRender:!0,lazy:!_&&Hr(u),startAt:null,delay:0,onUpdate:d&&function(){return as(e,"onUpdate")},stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,n<0&&(sr||!l&&!v)&&e._startAt.revert(b0),l&&w&&n<=0&&r<=0){n&&(e._zTime=n);return}}else if(h&&w&&!_){if(n&&(l=!1),A=ps({overwrite:!1,data:"isFromStart",lazy:l&&!_&&Hr(u),immediateRender:l,stagger:0,parent:b},M),Y&&(A[Q.prop]=Y),ba(e._startAt=In.set(x,A)),e._startAt._dp=0,e._startAt._sat=e,n<0&&(sr?e._startAt.revert(b0):e._startAt.render(-1,!0)),e._zTime=n,!l)t(e._startAt,Dt,Dt);else if(!n)return}for(e._pt=e._ptCache=0,u=w&&Hr(u)||u&&!w,R=0;R<x.length;R++){if(N=x[R],j=N._gsap||Fx(x)[R]._gsap,e._ptLookup[R]=Z={},b2[j.id]&&ha.length&&_m(),W=k===x?R:k.indexOf(N),Q&&(q=new Q).init(N,Y||M,e,W,k)!==!1&&(e._pt=L=new Br(e._pt,N,q.name,0,1,q.render,q,0,q.priority),q._props.forEach(function(J){Z[J]=L}),q.priority&&(F=1)),!Q||Y)for(A in M)ss[A]&&(q=DM(A,M,e,W,N,k))?q.priority&&(F=1):Z[A]=L=Hx.call(e,N,A,"get",M[A],W,k,0,s.stringFilter);e._op&&e._op[R]&&e.kill(N,e._op[R]),C&&e._pt&&(aa=e,rn.killTweensOf(N,Z,e.globalTime(n)),V=!e.parent,aa=0),e._pt&&u&&(b2[j.id]=1)}F&&HM(e),e._onInit&&e._onInit(e)}e._onUpdate=d,e._initted=(!e._op||e._pt)&&!V,m&&n<=0&&T.render(Is,!0,!0)},UQ=function(e,n,r,s,i,o,l,u){var d=(e._pt&&e._ptCache||(e._ptCache={}))[n],h,p,m,v;if(!d)for(d=e._ptCache[n]=[],m=e._ptLookup,v=e._targets.length;v--;){if(h=m[v][n],h&&h.d&&h.d._pt)for(h=h.d._pt;h&&h.p!==n&&h.fp!==n;)h=h._next;if(!h)return T2=1,e.vars[n]="+=0",zx(e,l),T2=0,u?Lf(n+" not eligible for reset. Try splitting into individual properties"):1;d.push(h)}for(v=d.length;v--;)p=d[v],h=p._pt||p,h.s=(s||s===0)&&!i?s:h.s+(s||0)+o*h.c,h.c=r-h.s,p.e&&(p.e=yn(r)+ur(p.e)),p.b&&(p.b=h.s+ur(p.b))},WQ=function(e,n){var r=e[0]?Ol(e[0]).harness:0,s=r&&r.aliases,i,o,l,u;if(!s)return n;i=bu({},n);for(o in s)if(o in i)for(u=s[o].split(","),l=u.length;l--;)i[u[l]]=i[o];return i},ZQ=function(e,n,r,s){var i=n.ease||s||"power1.inOut",o,l;if(fr(n))l=r[e]||(r[e]=[]),n.forEach(function(u,d){return l.push({t:d/(n.length-1)*100,v:u,e:i})});else for(o in n)l=r[o]||(r[o]=[]),o==="ease"||l.push({t:parseFloat(e),v:n[o],e:i})},af=function(e,n,r,s,i){return fn(e)?e.call(n,r,s,i):qn(e)&&~e.indexOf("random(")?Nf(e):e},NM=jx+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",$M={};zr(NM+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return $M[t]=1});var In=(function(t){sM(e,t);function e(r,s,i,o){var l;typeof s=="number"&&(i.duration=s,s=i,i=null),l=t.call(this,o?s:sf(s))||this;var u=l.vars,d=u.duration,h=u.delay,p=u.immediateRender,m=u.stagger,v=u.overwrite,w=u.keyframes,_=u.defaults,x=u.scrollTrigger,b=s.parent||rn,k=(fr(r)||oM(r)?_o(r[0]):"length"in s)?[r]:As(r),C,T,I,M,R,A,L,N;if(l._targets=k.length?Fx(k):Lf("GSAP target "+r+" not found. https://gsap.com",!ds.nullTargetWarn)||[],l._ptLookup=[],l._overwrite=v,w||m||Xp(d)||Xp(h)){s=l.vars;var F=s.easeReverse||s.yoyoEase;if(C=l.timeline=new $r({data:"nested",defaults:_||{},targets:b&&b.data==="nested"?b.vars.targets:k}),C.kill(),C.parent=C._dp=ro(l),C._start=0,m||Xp(d)||Xp(h)){if(M=k.length,L=m&&SM(m),Li(m))for(R in m)~NM.indexOf(R)&&(N||(N={}),N[R]=m[R]);for(T=0;T<M;T++)I=wm(s,$M),I.stagger=0,F&&(I.easeReverse=F),N&&bu(I,N),A=k[T],I.duration=+af(d,ro(l),T,A,k),I.delay=(+af(h,ro(l),T,A,k)||0)-l._delay,!m&&M===1&&I.delay&&(l._delay=h=I.delay,l._start+=h,I.delay=0),C.to(A,I,L?L(T,A,k):0),C._ease=gt.none;C.duration()?d=h=0:l.timeline=0}else if(w){sf(ps(C.vars.defaults,{ease:"none"})),C._ease=Dl(w.ease||s.ease||"none");var j=0,Q,q,Z;if(fr(w))w.forEach(function(W){return C.to(k,W,">")}),C.duration();else{I={};for(R in w)R==="ease"||R==="easeEach"||ZQ(R,w[R],I,w.easeEach);for(R in I)for(Q=I[R].sort(function(W,Y){return W.t-Y.t}),j=0,T=0;T<Q.length;T++)q=Q[T],Z={ease:q.e,duration:(q.t-(T?Q[T-1].t:0))/100*d},Z[R]=q.v,C.to(k,Z,j),j+=Z.duration;C.duration()<d&&C.to({},{duration:d-C.duration()})}}d||l.duration(d=C.duration())}else l.timeline=0;return v===!0&&!Mx&&(aa=ro(l),rn.killTweensOf(k),aa=0),ki(b,ro(l),i),s.reversed&&l.reverse(),s.paused&&l.paused(!0),(p||!d&&!w&&l._start===nn(b._time)&&Hr(p)&&bQ(ro(l))&&b.data!=="nested")&&(l._tTime=-Dt,l.render(Math.max(0,-h)||0)),x&&_M(ro(l),x),l}var n=e.prototype;return n.render=function(s,i,o){var l=this._time,u=this._tDur,d=this._dur,h=s<0,p=s>u-Dt&&!h?u:s<Dt?0:s,m,v,w,_,x,b,k,C;if(!d)EQ(this,s,i,o);else if(p!==this._tTime||!s||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==h||this._lazy){if(m=p,C=this.timeline,this._repeat){if(_=d+this._rDelay,this._repeat<-1&&h)return this.totalTime(_*100+s,i,o);if(m=nn(p%_),p===u?(w=this._repeat,m=d):(x=nn(p/_),w=~~x,w&&w===x?(m=d,w--):m>d&&(m=d)),b=this._yoyo&&w&1,b&&(m=d-m),x=Su(this._tTime,_),m===l&&!o&&this._initted&&w===x)return this._tTime=p,this;w!==x&&this.vars.repeatRefresh&&!b&&!this._lock&&m!==_&&this._initted&&(this._lock=o=1,this.render(nn(_*w),!0).invalidate()._lock=0)}if(!this._initted){if(wM(this,h?s:m,o,i,p))return this._tTime=0,this;if(l!==this._time&&!(o&&this.vars.repeatRefresh&&w!==x))return this;if(d!==this._dur)return this.render(s,i,o)}if(this._rEase){var T=m<l;if(T!==this._inv){var I=T?l:d-l;this._inv=T,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=l,this._invRecip=I?(T?-1:1)/I:0,this._invScale=T?-this.ratio:1-this.ratio,this._invEase=T?this._rEase:this._ease}this.ratio=k=this._invRatio+this._invScale*this._invEase((m-this._invTime)*this._invRecip)}else this.ratio=k=this._ease(m/d);if(this._from&&(this.ratio=k=1-k),this._tTime=p,this._time=m,!this._act&&this._ts&&(this._act=1,this._lazy=0),!l&&p&&!i&&!x&&(as(this,"onStart"),this._tTime!==p))return this;for(v=this._pt;v;)v.r(k,v.d),v=v._next;C&&C.render(s<0?s:C._dur*C._ease(m/this._dur),i,o)||this._startAt&&(this._zTime=s),this._onUpdate&&!i&&(h&&S2(this,s,i,o),as(this,"onUpdate")),this._repeat&&w!==x&&this.vars.onRepeat&&!i&&this.parent&&as(this,"onRepeat"),(p===this._tDur||!p)&&this._tTime===p&&(h&&!this._onUpdate&&S2(this,s,!0,!0),(s||!d)&&(p===this._tDur&&this._ts>0||!p&&this._ts<0)&&ba(this,1),!i&&!(h&&!l)&&(p||l||b)&&(as(this,p===u?"onComplete":"onReverseComplete",!0),this._prom&&!(p<u&&this.timeScale()>0)&&this._prom()))}return this},n.targets=function(){return this._targets},n.invalidate=function(s){return(!s||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(s),t.prototype.invalidate.call(this,s)},n.resetTo=function(s,i,o,l,u){$f||os.wake(),this._ts||this.play();var d=Math.min(this._dur,(this._dp._time-this._start)*this._ts),h;return this._initted||zx(this,d),h=this._ease(d/this._dur),UQ(this,s,i,o,l,h,d,u)?this.resetTo(s,i,o,l,1):(eg(this,0),this.parent||vM(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},n.kill=function(s,i){if(i===void 0&&(i="all"),!s&&(!i||i==="all"))return this._lazy=this._pt=0,this.parent?Fd(this):this.scrollTrigger&&this.scrollTrigger.kill(!!sr),this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(s,i,aa&&aa.vars.overwrite!==!0)._first||Fd(this),this.parent&&o!==this.timeline.totalDuration()&&Eu(this,this._dur*this.timeline._tDur/o,0,1),this}var l=this._targets,u=s?As(s):l,d=this._ptLookup,h=this._pt,p,m,v,w,_,x,b;if((!i||i==="all")&&wQ(l,u))return i==="all"&&(this._pt=0),Fd(this);for(p=this._op=this._op||[],i!=="all"&&(qn(i)&&(_={},zr(i,function(k){return _[k]=1}),i=_),i=WQ(l,i)),b=l.length;b--;)if(~u.indexOf(l[b])){m=d[b],i==="all"?(p[b]=i,w=m,v={}):(v=p[b]=p[b]||{},w=i);for(_ in w)x=m&&m[_],x&&((!("kill"in x.d)||x.d.kill(_)===!0)&&Qm(this,x,"_pt"),delete m[_]),v!=="all"&&(v[_]=1)}return this._initted&&!this._pt&&h&&Fd(this),this},e.to=function(s,i){return new e(s,i,arguments[2])},e.from=function(s,i){return of(1,arguments)},e.delayedCall=function(s,i,o,l){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:s,onComplete:i,onReverseComplete:i,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:l})},e.fromTo=function(s,i,o){return of(2,arguments)},e.set=function(s,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new e(s,i)},e.killTweensOf=function(s,i,o){return rn.killTweensOf(s,i,o)},e})(jf);ps(In.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});zr("staggerTo,staggerFrom,staggerFromTo",function(t){In[t]=function(){var e=new $r,n=k2.call(arguments,0);return n.splice(t==="staggerFromTo"?5:4,0,0),e[t].apply(e,n)}});var Bx=function(e,n,r){return e[n]=r},jM=function(e,n,r){return e[n](r)},qQ=function(e,n,r,s){return e[n](s.fp,r)},GQ=function(e,n,r){return e.setAttribute(n,r)},Ux=function(e,n){return fn(e[n])?jM:Ox(e[n])&&e.setAttribute?GQ:Bx},FM=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e6)/1e6,n)},KQ=function(e,n){return n.set(n.t,n.p,!!(n.s+n.c*e),n)},VM=function(e,n){var r=n._pt,s="";if(!e&&n.b)s=n.b;else if(e===1&&n.e)s=n.e;else{for(;r;)s=r.p+(r.m?r.m(r.s+r.c*e):Math.round((r.s+r.c*e)*1e4)/1e4)+s,r=r._next;s+=n.c}n.set(n.t,n.p,s,n)},Wx=function(e,n){for(var r=n._pt;r;)r.r(e,r.d),r=r._next},YQ=function(e,n,r,s){for(var i=this._pt,o;i;)o=i._next,i.p===s&&i.modifier(e,n,r),i=o},XQ=function(e){for(var n=this._pt,r,s;n;)s=n._next,n.p===e&&!n.op||n.op===e?Qm(this,n,"_pt"):n.dep||(r=1),n=s;return!r},QQ=function(e,n,r,s){s.mSet(e,n,s.m.call(s.tween,r,s.mt),s)},HM=function(e){for(var n=e._pt,r,s,i,o;n;){for(r=n._next,s=i;s&&s.pr>n.pr;)s=s._next;(n._prev=s?s._prev:o)?n._prev._next=n:i=n,(n._next=s)?s._prev=n:o=n,n=r}e._pt=i},Br=(function(){function t(n,r,s,i,o,l,u,d,h){this.t=r,this.s=i,this.c=o,this.p=s,this.r=l||FM,this.d=u||this,this.set=d||Bx,this.pr=h||0,this._next=n,n&&(n._prev=this)}var e=t.prototype;return e.modifier=function(r,s,i){this.mSet=this.mSet||this.set,this.set=QQ,this.m=r,this.mt=i,this.tween=s},t})();zr(jx+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger,easeReverse",function(t){return $x[t]=1});hs.TweenMax=hs.TweenLite=In;hs.TimelineLite=hs.TimelineMax=$r;rn=new $r({sortChildren:!1,defaults:Of,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});ds.stringFilter=MM;var Nl=[],E0={},JQ=[],sC=0,eJ=0,gy=function(e){return(E0[e]||JQ).map(function(n){return n()})},I2=function(){var e=Date.now(),n=[];e-sC>2&&(gy("matchMediaInit"),Nl.forEach(function(r){var s=r.queries,i=r.conditions,o,l,u,d;for(l in s)o=_i.matchMedia(s[l]).matches,o&&(u=1),o!==i[l]&&(i[l]=o,d=1);d&&(r.revert(),u&&n.push(r))}),gy("matchMediaRevert"),n.forEach(function(r){return r.onMatch(r,function(s){return r.add(null,s)})}),sC=e,gy("matchMedia"))},zM=(function(){function t(n,r){this.selector=r&&C2(r),this.data=[],this._r=[],this.isReverted=!1,this.id=eJ++,n&&this.add(n)}var e=t.prototype;return e.add=function(r,s,i){fn(r)&&(i=s,s=r,r=fn);var o=this,l=function(){var d=Yt,h=o.selector,p;return d&&d!==o&&d.data.push(o),i&&(o.selector=C2(i)),Yt=o,p=s.apply(o,arguments),fn(p)&&o._r.push(p),Yt=d,o.selector=h,o.isReverted=!1,p};return o.last=l,r===fn?l(o,function(u){return o.add(null,u)}):r?o[r]=l:l},e.ignore=function(r){var s=Yt;Yt=null,r(this),Yt=s},e.getTweens=function(){var r=[];return this.data.forEach(function(s){return s instanceof t?r.push.apply(r,s.getTweens()):s instanceof In&&!(s.parent&&s.parent.data==="nested")&&r.push(s)}),r},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(r,s){var i=this;if(r?(function(){for(var l=i.getTweens(),u=i.data.length,d;u--;)d=i.data[u],d.data==="isFlip"&&(d.revert(),d.getChildren(!0,!0,!1).forEach(function(h){return l.splice(l.indexOf(h),1)}));for(l.map(function(h){return{g:h._dur||h._delay||h._sat&&!h._sat.vars.immediateRender?h.globalTime(0):-1/0,t:h}}).sort(function(h,p){return p.g-h.g||-1/0}).forEach(function(h){return h.t.revert(r)}),u=i.data.length;u--;)d=i.data[u],d instanceof $r?d.data!=="nested"&&(d.scrollTrigger&&d.scrollTrigger.revert(),d.kill()):!(d instanceof In)&&d.revert&&d.revert(r);i._r.forEach(function(h){return h(r,i)}),i.isReverted=!0})():this.data.forEach(function(l){return l.kill&&l.kill()}),this.clear(),s)for(var o=Nl.length;o--;)Nl[o].id===this.id&&Nl.splice(o,1)},e.revert=function(r){this.kill(r||{})},t})(),tJ=(function(){function t(n){this.contexts=[],this.scope=n,Yt&&Yt.data.push(this)}var e=t.prototype;return e.add=function(r,s,i){Li(r)||(r={matches:r});var o=new zM(0,i||this.scope),l=o.conditions={},u,d,h;Yt&&!o.selector&&(o.selector=Yt.selector),this.contexts.push(o),s=o.add("onMatch",s),o.queries=r;for(d in r)d==="all"?h=1:(u=_i.matchMedia(r[d]),u&&(Nl.indexOf(o)<0&&Nl.push(o),(l[d]=u.matches)&&(h=1),u.addListener?u.addListener(I2):u.addEventListener("change",I2)));return h&&s(o,function(p){return o.add(null,p)}),this},e.revert=function(r){this.kill(r||{})},e.kill=function(r){this.contexts.forEach(function(s){return s.kill(r,!0)})},t})(),bm={registerPlugin:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];n.forEach(function(s){return IM(s)})},timeline:function(e){return new $r(e)},getTweensOf:function(e,n){return rn.getTweensOf(e,n)},getProperty:function(e,n,r,s){qn(e)&&(e=As(e)[0]);var i=Ol(e||{}).get,o=r?gM:mM;return r==="native"&&(r=""),e&&(n?o((ss[n]&&ss[n].get||i)(e,n,r,s)):function(l,u,d){return o((ss[l]&&ss[l].get||i)(e,l,u,d))})},quickSetter:function(e,n,r){if(e=As(e),e.length>1){var s=e.map(function(h){return Wr.quickSetter(h,n,r)}),i=s.length;return function(h){for(var p=i;p--;)s[p](h)}}e=e[0]||{};var o=ss[n],l=Ol(e),u=l.harness&&(l.harness.aliases||{})[n]||n,d=o?function(h){var p=new o;Hc._pt=0,p.init(e,r?h+r:h,Hc,0,[e]),p.render(1,p),Hc._pt&&Wx(1,Hc)}:l.set(e,u);return o?d:function(h){return d(e,u,r?h+r:h,l,1)}},quickTo:function(e,n,r){var s,i=Wr.to(e,ps((s={},s[n]="+=0.1",s.paused=!0,s.stagger=0,s),r||{})),o=function(u,d,h){return i.resetTo(n,u,d,h)};return o.tween=i,o},isTweening:function(e){return rn.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=Dl(e.ease,Of.ease)),Jk(Of,e||{})},config:function(e){return Jk(ds,e||{})},registerEffect:function(e){var n=e.name,r=e.effect,s=e.plugins,i=e.defaults,o=e.extendTimeline;(s||"").split(",").forEach(function(l){return l&&!ss[l]&&!hs[l]&&Lf(n+" effect requires "+l+" plugin.")}),fy[n]=function(l,u,d){return r(As(l),ps(u||{},i),d)},o&&($r.prototype[n]=function(l,u,d){return this.add(fy[n](l,Li(u)?u:(d=u)&&{},this),d)})},registerEase:function(e,n){gt[e]=Dl(n)},parseEase:function(e,n){return arguments.length?Dl(e,n):gt},getById:function(e){return rn.getById(e)},exportRoot:function(e,n){e===void 0&&(e={});var r=new $r(e),s,i;for(r.smoothChildTiming=Hr(e.smoothChildTiming),rn.remove(r),r._dp=0,r._time=r._tTime=rn._time,s=rn._first;s;)i=s._next,(n||!(!s._dur&&s instanceof In&&s.vars.onComplete===s._targets[0]))&&ki(r,s,s._start-s._delay),s=i;return ki(rn,r,0),r},context:function(e,n){return e?new zM(e,n):Yt},matchMedia:function(e){return new tJ(e)},matchMediaRefresh:function(){return Nl.forEach(function(e){var n=e.conditions,r,s;for(s in n)n[s]&&(n[s]=!1,r=1);r&&e.revert()})||I2()},addEventListener:function(e,n){var r=E0[e]||(E0[e]=[]);~r.indexOf(n)||r.push(n)},removeEventListener:function(e,n){var r=E0[e],s=r&&r.indexOf(n);s>=0&&r.splice(s,1)},utils:{wrap:MQ,wrapYoyo:OQ,distribute:SM,random:kM,snap:EM,normalize:RQ,getUnit:ur,clamp:PQ,splitColor:AM,toArray:As,selector:C2,mapRange:PM,pipe:IQ,unitize:AQ,interpolate:LQ,shuffle:bM},install:uM,effects:fy,ticker:os,updateRoot:$r.updateRoot,plugins:ss,globalTimeline:rn,core:{PropTween:Br,globals:dM,Tween:In,Timeline:$r,Animation:jf,getCache:Ol,_removeLinkedListItem:Qm,reverting:function(){return sr},context:function(e){return e&&Yt&&(Yt.data.push(e),e._ctx=Yt),Yt},suppressOverwrites:function(e){return Mx=e}}};zr("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return bm[t]=In[t]});os.add($r.updateRoot);Hc=bm.to({},{duration:0});var nJ=function(e,n){for(var r=e._pt;r&&r.p!==n&&r.op!==n&&r.fp!==n;)r=r._next;return r},rJ=function(e,n){var r=e._targets,s,i,o;for(s in n)for(i=r.length;i--;)o=e._ptLookup[i][s],o&&(o=o.d)&&(o._pt&&(o=nJ(o,s)),o&&o.modifier&&o.modifier(n[s],e,r[i],s))},vy=function(e,n){return{name:e,headless:1,rawVars:1,init:function(s,i,o){o._onInit=function(l){var u,d;if(qn(i)&&(u={},zr(i,function(h){return u[h]=1}),i=u),n){u={};for(d in i)u[d]=n(i[d]);i=u}rJ(l,i)}}}},Wr=bm.registerPlugin({name:"attr",init:function(e,n,r,s,i){var o,l,u;this.tween=r;for(o in n)u=e.getAttribute(o)||"",l=this.add(e,"setAttribute",(u||0)+"",n[o],s,i,0,0,o),l.op=o,l.b=u,this._props.push(o)},render:function(e,n){for(var r=n._pt;r;)sr?r.set(r.t,r.p,r.b,r):r.r(e,r.d),r=r._next}},{name:"endArray",headless:1,init:function(e,n){for(var r=n.length;r--;)this.add(e,r,e[r]||0,n[r],0,0,0,0,0,1)}},vy("roundProps",P2),vy("modifiers"),vy("snap",EM))||bm;In.version=$r.version=Wr.version="3.15.0";cM=1;Lx()&&ku();gt.Power0;gt.Power1;gt.Power2;gt.Power3;gt.Power4;gt.Linear;gt.Quad;gt.Cubic;gt.Quart;gt.Quint;gt.Strong;gt.Elastic;gt.Back;gt.SteppedEase;gt.Bounce;gt.Sine;gt.Expo;gt.Circ;/*!
123
+ * CSSPlugin 3.15.0
124
+ * https://gsap.com
125
+ *
126
+ * Copyright 2008-2026, GreenSock. All rights reserved.
127
+ * Subject to the terms at https://gsap.com/standard-license
128
+ * @author: Jack Doyle, jack@greensock.com
129
+ */var iC,la,Yc,Zx,_l,oC,qx,sJ=function(){return typeof window<"u"},wo={},ml=180/Math.PI,Xc=Math.PI/180,Ic=Math.atan2,aC=1e8,Gx=/([A-Z])/g,iJ=/(left|right|width|margin|padding|x)/i,oJ=/[\s,\(]\S/,Ti={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},A2=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},aJ=function(e,n){return n.set(n.t,n.p,e===1?n.e:Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},lJ=function(e,n){return n.set(n.t,n.p,e?Math.round((n.s+n.c*e)*1e4)/1e4+n.u:n.b,n)},cJ=function(e,n){return n.set(n.t,n.p,e===1?n.e:e?Math.round((n.s+n.c*e)*1e4)/1e4+n.u:n.b,n)},uJ=function(e,n){var r=n.s+n.c*e;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},BM=function(e,n){return n.set(n.t,n.p,e?n.e:n.b,n)},UM=function(e,n){return n.set(n.t,n.p,e!==1?n.b:n.e,n)},dJ=function(e,n,r){return e.style[n]=r},fJ=function(e,n,r){return e.style.setProperty(n,r)},hJ=function(e,n,r){return e._gsap[n]=r},pJ=function(e,n,r){return e._gsap.scaleX=e._gsap.scaleY=r},mJ=function(e,n,r,s,i){var o=e._gsap;o.scaleX=o.scaleY=r,o.renderTransform(i,o)},gJ=function(e,n,r,s,i){var o=e._gsap;o[n]=r,o.renderTransform(i,o)},sn="transform",Ur=sn+"Origin",vJ=function t(e,n){var r=this,s=this.target,i=s.style,o=s._gsap;if(e in wo&&i){if(this.tfm=this.tfm||{},e!=="transform")e=Ti[e]||e,~e.indexOf(",")?e.split(",").forEach(function(l){return r.tfm[l]=so(s,l)}):this.tfm[e]=o.x?o[e]:so(s,e),e===Ur&&(this.tfm.zOrigin=o.zOrigin);else return Ti.transform.split(",").forEach(function(l){return t.call(r,l,n)});if(this.props.indexOf(sn)>=0)return;o.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push(Ur,n,"")),e=sn}(i||n)&&this.props.push(e,n,i[e])},WM=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},yJ=function(){var e=this.props,n=this.target,r=n.style,s=n._gsap,i,o;for(i=0;i<e.length;i+=3)e[i+1]?e[i+1]===2?n[e[i]](e[i+2]):n[e[i]]=e[i+2]:e[i+2]?r[e[i]]=e[i+2]:r.removeProperty(e[i].substr(0,2)==="--"?e[i]:e[i].replace(Gx,"-$1").toLowerCase());if(this.tfm){for(o in this.tfm)s[o]=this.tfm[o];s.svg&&(s.renderTransform(),n.setAttribute("data-svg-origin",this.svgo||"")),i=qx(),(!i||!i.isStart)&&!r[sn]&&(WM(r),s.zOrigin&&r[Ur]&&(r[Ur]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},ZM=function(e,n){var r={target:e,props:[],revert:yJ,save:vJ};return e._gsap||Wr.core.getCache(e),n&&e.style&&e.nodeType&&n.split(",").forEach(function(s){return r.save(s)}),r},qM,R2=function(e,n){var r=la.createElementNS?la.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):la.createElement(e);return r&&r.style?r:la.createElement(e)},ls=function t(e,n,r){var s=getComputedStyle(e);return s[n]||s.getPropertyValue(n.replace(Gx,"-$1").toLowerCase())||s.getPropertyValue(n)||!r&&t(e,Cu(n)||n,1)||""},lC="O,Moz,ms,Ms,Webkit".split(","),Cu=function(e,n,r){var s=n||_l,i=s.style,o=5;if(e in i&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);o--&&!(lC[o]+e in i););return o<0?null:(o===3?"ms":o>=0?lC[o]:"")+e},M2=function(){sJ()&&window.document&&(iC=window,la=iC.document,Yc=la.documentElement,_l=R2("div")||{style:{}},R2("div"),sn=Cu(sn),Ur=sn+"Origin",_l.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",qM=!!Cu("perspective"),qx=Wr.core.reverting,Zx=1)},cC=function(e){var n=e.ownerSVGElement,r=R2("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=e.cloneNode(!0),i;s.style.display="block",r.appendChild(s),Yc.appendChild(r);try{i=s.getBBox()}catch{}return r.removeChild(s),Yc.removeChild(r),i},uC=function(e,n){for(var r=n.length;r--;)if(e.hasAttribute(n[r]))return e.getAttribute(n[r])},GM=function(e){var n,r;try{n=e.getBBox()}catch{n=cC(e),r=1}return n&&(n.width||n.height)||r||(n=cC(e)),n&&!n.width&&!n.x&&!n.y?{x:+uC(e,["x","cx","x1"])||0,y:+uC(e,["y","cy","y1"])||0,width:0,height:0}:n},KM=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&GM(e))},Sa=function(e,n){if(n){var r=e.style,s;n in wo&&n!==Ur&&(n=sn),r.removeProperty?(s=n.substr(0,2),(s==="ms"||n.substr(0,6)==="webkit")&&(n="-"+n),r.removeProperty(s==="--"?n:n.replace(Gx,"-$1").toLowerCase())):r.removeAttribute(n)}},ca=function(e,n,r,s,i,o){var l=new Br(e._pt,n,r,0,1,o?UM:BM);return e._pt=l,l.b=s,l.e=i,e._props.push(r),l},dC={deg:1,rad:1,turn:1},_J={grid:1,flex:1},Ea=function t(e,n,r,s){var i=parseFloat(r)||0,o=(r+"").trim().substr((i+"").length)||"px",l=_l.style,u=iJ.test(n),d=e.tagName.toLowerCase()==="svg",h=(d?"client":"offset")+(u?"Width":"Height"),p=100,m=s==="px",v=s==="%",w,_,x,b;if(s===o||!i||dC[s]||dC[o])return i;if(o!=="px"&&!m&&(i=t(e,n,r,"px")),b=e.getCTM&&KM(e),(v||o==="%")&&(wo[n]||~n.indexOf("adius")))return w=b?e.getBBox()[u?"width":"height"]:e[h],yn(v?i/w*p:i/100*w);if(l[u?"width":"height"]=p+(m?o:s),_=s!=="rem"&&~n.indexOf("adius")||s==="em"&&e.appendChild&&!d?e:e.parentNode,b&&(_=(e.ownerSVGElement||{}).parentNode),(!_||_===la||!_.appendChild)&&(_=la.body),x=_._gsap,x&&v&&x.width&&u&&x.time===os.time&&!x.uncache)return yn(i/x.width*p);if(v&&(n==="height"||n==="width")){var k=e.style[n];e.style[n]=p+s,w=e[h],k?e.style[n]=k:Sa(e,n)}else(v||o==="%")&&!_J[ls(_,"display")]&&(l.position=ls(e,"position")),_===e&&(l.position="static"),_.appendChild(_l),w=_l[h],_.removeChild(_l),l.position="absolute";return u&&v&&(x=Ol(_),x.time=os.time,x.width=_[h]),yn(m?w*i/p:w&&i?p/w*i:0)},so=function(e,n,r,s){var i;return Zx||M2(),n in Ti&&n!=="transform"&&(n=Ti[n],~n.indexOf(",")&&(n=n.split(",")[0])),wo[n]&&n!=="transform"?(i=Vf(e,s),i=n!=="transformOrigin"?i[n]:i.svg?i.origin:Em(ls(e,Ur))+" "+i.zOrigin+"px"):(i=e.style[n],(!i||i==="auto"||s||~(i+"").indexOf("calc("))&&(i=Sm[n]&&Sm[n](e,n,r)||ls(e,n)||hM(e,n)||(n==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?Ea(e,n,i,r)+r:i},wJ=function(e,n,r,s){if(!r||r==="none"){var i=Cu(n,e,1),o=i&&ls(e,i,1);o&&o!==r?(n=i,r=o):n==="borderColor"&&(r=ls(e,"borderTopColor"))}var l=new Br(this._pt,e.style,n,0,1,VM),u=0,d=0,h,p,m,v,w,_,x,b,k,C,T,I;if(l.b=r,l.e=s,r+="",s+="",s.substring(0,6)==="var(--"&&(s=ls(e,s.substring(4,s.indexOf(")")))),s==="auto"&&(_=e.style[n],e.style[n]=s,s=ls(e,n)||s,_?e.style[n]=_:Sa(e,n)),h=[r,s],MM(h),r=h[0],s=h[1],m=r.match(Vc)||[],I=s.match(Vc)||[],I.length){for(;p=Vc.exec(s);)x=p[0],k=s.substring(u,p.index),w?w=(w+1)%5:(k.substr(-5)==="rgba("||k.substr(-5)==="hsla(")&&(w=1),x!==(_=m[d++]||"")&&(v=parseFloat(_)||0,T=_.substr((v+"").length),x.charAt(1)==="="&&(x=Kc(v,x)+T),b=parseFloat(x),C=x.substr((b+"").length),u=Vc.lastIndex-C.length,C||(C=C||ds.units[n]||T,u===s.length&&(s+=C,l.e+=C)),T!==C&&(v=Ea(e,n,_,C)||0),l._pt={_next:l._pt,p:k||d===1?k:",",s:v,c:b-v,m:w&&w<4||n==="zIndex"?Math.round:0});l.c=u<s.length?s.substring(u,s.length):""}else l.r=n==="display"&&s==="none"?UM:BM;return lM.test(s)&&(l.e=0),this._pt=l,l},fC={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},xJ=function(e){var n=e.split(" "),r=n[0],s=n[1]||"50%";return(r==="top"||r==="bottom"||s==="left"||s==="right")&&(e=r,r=s,s=e),n[0]=fC[r]||r,n[1]=fC[s]||s,n.join(" ")},bJ=function(e,n){if(n.tween&&n.tween._time===n.tween._dur){var r=n.t,s=r.style,i=n.u,o=r._gsap,l,u,d;if(i==="all"||i===!0)s.cssText="",u=1;else for(i=i.split(","),d=i.length;--d>-1;)l=i[d],wo[l]&&(u=1,l=l==="transformOrigin"?Ur:sn),Sa(r,l);u&&(Sa(r,sn),o&&(o.svg&&r.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",Vf(r,1),o.uncache=1,WM(s)))}},Sm={clearProps:function(e,n,r,s,i){if(i.data!=="isFromStart"){var o=e._pt=new Br(e._pt,n,r,0,0,bJ);return o.u=s,o.pr=-10,o.tween=i,e._props.push(r),1}}},Ff=[1,0,0,1,0,0],YM={},XM=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},hC=function(e){var n=ls(e,sn);return XM(n)?Ff:n.substr(7).match(aM).map(yn)},Kx=function(e,n){var r=e._gsap||Ol(e),s=e.style,i=hC(e),o,l,u,d;return r.svg&&e.getAttribute("transform")?(u=e.transform.baseVal.consolidate().matrix,i=[u.a,u.b,u.c,u.d,u.e,u.f],i.join(",")==="1,0,0,1,0,0"?Ff:i):(i===Ff&&!e.offsetParent&&e!==Yc&&!r.svg&&(u=s.display,s.display="block",o=e.parentNode,(!o||!e.offsetParent&&!e.getBoundingClientRect().width)&&(d=1,l=e.nextElementSibling,Yc.appendChild(e)),i=hC(e),u?s.display=u:Sa(e,"display"),d&&(l?o.insertBefore(e,l):o?o.appendChild(e):Yc.removeChild(e))),n&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},O2=function(e,n,r,s,i,o){var l=e._gsap,u=i||Kx(e,!0),d=l.xOrigin||0,h=l.yOrigin||0,p=l.xOffset||0,m=l.yOffset||0,v=u[0],w=u[1],_=u[2],x=u[3],b=u[4],k=u[5],C=n.split(" "),T=parseFloat(C[0])||0,I=parseFloat(C[1])||0,M,R,A,L;r?u!==Ff&&(R=v*x-w*_)&&(A=T*(x/R)+I*(-_/R)+(_*k-x*b)/R,L=T*(-w/R)+I*(v/R)-(v*k-w*b)/R,T=A,I=L):(M=GM(e),T=M.x+(~C[0].indexOf("%")?T/100*M.width:T),I=M.y+(~(C[1]||C[0]).indexOf("%")?I/100*M.height:I)),s||s!==!1&&l.smooth?(b=T-d,k=I-h,l.xOffset=p+(b*v+k*_)-b,l.yOffset=m+(b*w+k*x)-k):l.xOffset=l.yOffset=0,l.xOrigin=T,l.yOrigin=I,l.smooth=!!s,l.origin=n,l.originIsAbsolute=!!r,e.style[Ur]="0px 0px",o&&(ca(o,l,"xOrigin",d,T),ca(o,l,"yOrigin",h,I),ca(o,l,"xOffset",p,l.xOffset),ca(o,l,"yOffset",m,l.yOffset)),e.setAttribute("data-svg-origin",T+" "+I)},Vf=function(e,n){var r=e._gsap||new LM(e);if("x"in r&&!n&&!r.uncache)return r;var s=e.style,i=r.scaleX<0,o="px",l="deg",u=getComputedStyle(e),d=ls(e,Ur)||"0",h,p,m,v,w,_,x,b,k,C,T,I,M,R,A,L,N,F,j,Q,q,Z,W,Y,V,J,B,D,X,ce,se,re;return h=p=m=_=x=b=k=C=T=0,v=w=1,r.svg=!!(e.getCTM&&KM(e)),u.translate&&((u.translate!=="none"||u.scale!=="none"||u.rotate!=="none")&&(s[sn]=(u.translate!=="none"?"translate3d("+(u.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(u.rotate!=="none"?"rotate("+u.rotate+") ":"")+(u.scale!=="none"?"scale("+u.scale.split(" ").join(",")+") ":"")+(u[sn]!=="none"?u[sn]:"")),s.scale=s.rotate=s.translate="none"),R=Kx(e,r.svg),r.svg&&(r.uncache?(V=e.getBBox(),d=r.xOrigin-V.x+"px "+(r.yOrigin-V.y)+"px",Y=""):Y=!n&&e.getAttribute("data-svg-origin"),O2(e,Y||d,!!Y||r.originIsAbsolute,r.smooth!==!1,R)),I=r.xOrigin||0,M=r.yOrigin||0,R!==Ff&&(F=R[0],j=R[1],Q=R[2],q=R[3],h=Z=R[4],p=W=R[5],R.length===6?(v=Math.sqrt(F*F+j*j),w=Math.sqrt(q*q+Q*Q),_=F||j?Ic(j,F)*ml:0,k=Q||q?Ic(Q,q)*ml+_:0,k&&(w*=Math.abs(Math.cos(k*Xc))),r.svg&&(h-=I-(I*F+M*Q),p-=M-(I*j+M*q))):(re=R[6],ce=R[7],B=R[8],D=R[9],X=R[10],se=R[11],h=R[12],p=R[13],m=R[14],A=Ic(re,X),x=A*ml,A&&(L=Math.cos(-A),N=Math.sin(-A),Y=Z*L+B*N,V=W*L+D*N,J=re*L+X*N,B=Z*-N+B*L,D=W*-N+D*L,X=re*-N+X*L,se=ce*-N+se*L,Z=Y,W=V,re=J),A=Ic(-Q,X),b=A*ml,A&&(L=Math.cos(-A),N=Math.sin(-A),Y=F*L-B*N,V=j*L-D*N,J=Q*L-X*N,se=q*N+se*L,F=Y,j=V,Q=J),A=Ic(j,F),_=A*ml,A&&(L=Math.cos(A),N=Math.sin(A),Y=F*L+j*N,V=Z*L+W*N,j=j*L-F*N,W=W*L-Z*N,F=Y,Z=V),x&&Math.abs(x)+Math.abs(_)>359.9&&(x=_=0,b=180-b),v=yn(Math.sqrt(F*F+j*j+Q*Q)),w=yn(Math.sqrt(W*W+re*re)),A=Ic(Z,W),k=Math.abs(A)>2e-4?A*ml:0,T=se?1/(se<0?-se:se):0),r.svg&&(Y=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!XM(ls(e,sn)),Y&&e.setAttribute("transform",Y))),Math.abs(k)>90&&Math.abs(k)<270&&(i?(v*=-1,k+=_<=0?180:-180,_+=_<=0?180:-180):(w*=-1,k+=k<=0?180:-180)),n=n||r.uncache,r.x=h-((r.xPercent=h&&(!n&&r.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-h)?-50:0)))?e.offsetWidth*r.xPercent/100:0)+o,r.y=p-((r.yPercent=p&&(!n&&r.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-p)?-50:0)))?e.offsetHeight*r.yPercent/100:0)+o,r.z=m+o,r.scaleX=yn(v),r.scaleY=yn(w),r.rotation=yn(_)+l,r.rotationX=yn(x)+l,r.rotationY=yn(b)+l,r.skewX=k+l,r.skewY=C+l,r.transformPerspective=T+o,(r.zOrigin=parseFloat(d.split(" ")[2])||!n&&r.zOrigin||0)&&(s[Ur]=Em(d)),r.xOffset=r.yOffset=0,r.force3D=ds.force3D,r.renderTransform=r.svg?EJ:qM?QM:SJ,r.uncache=0,r},Em=function(e){return(e=e.split(" "))[0]+" "+e[1]},yy=function(e,n,r){var s=ur(n);return yn(parseFloat(n)+parseFloat(Ea(e,"x",r+"px",s)))+s},SJ=function(e,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,QM(e,n)},ll="0deg",Md="0px",cl=") ",QM=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,o=r.x,l=r.y,u=r.z,d=r.rotation,h=r.rotationY,p=r.rotationX,m=r.skewX,v=r.skewY,w=r.scaleX,_=r.scaleY,x=r.transformPerspective,b=r.force3D,k=r.target,C=r.zOrigin,T="",I=b==="auto"&&e&&e!==1||b===!0;if(C&&(p!==ll||h!==ll)){var M=parseFloat(h)*Xc,R=Math.sin(M),A=Math.cos(M),L;M=parseFloat(p)*Xc,L=Math.cos(M),o=yy(k,o,R*L*-C),l=yy(k,l,-Math.sin(M)*-C),u=yy(k,u,A*L*-C+C)}x!==Md&&(T+="perspective("+x+cl),(s||i)&&(T+="translate("+s+"%, "+i+"%) "),(I||o!==Md||l!==Md||u!==Md)&&(T+=u!==Md||I?"translate3d("+o+", "+l+", "+u+") ":"translate("+o+", "+l+cl),d!==ll&&(T+="rotate("+d+cl),h!==ll&&(T+="rotateY("+h+cl),p!==ll&&(T+="rotateX("+p+cl),(m!==ll||v!==ll)&&(T+="skew("+m+", "+v+cl),(w!==1||_!==1)&&(T+="scale("+w+", "+_+cl),k.style[sn]=T||"translate(0, 0)"},EJ=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,o=r.x,l=r.y,u=r.rotation,d=r.skewX,h=r.skewY,p=r.scaleX,m=r.scaleY,v=r.target,w=r.xOrigin,_=r.yOrigin,x=r.xOffset,b=r.yOffset,k=r.forceCSS,C=parseFloat(o),T=parseFloat(l),I,M,R,A,L;u=parseFloat(u),d=parseFloat(d),h=parseFloat(h),h&&(h=parseFloat(h),d+=h,u+=h),u||d?(u*=Xc,d*=Xc,I=Math.cos(u)*p,M=Math.sin(u)*p,R=Math.sin(u-d)*-m,A=Math.cos(u-d)*m,d&&(h*=Xc,L=Math.tan(d-h),L=Math.sqrt(1+L*L),R*=L,A*=L,h&&(L=Math.tan(h),L=Math.sqrt(1+L*L),I*=L,M*=L)),I=yn(I),M=yn(M),R=yn(R),A=yn(A)):(I=p,A=m,M=R=0),(C&&!~(o+"").indexOf("px")||T&&!~(l+"").indexOf("px"))&&(C=Ea(v,"x",o,"px"),T=Ea(v,"y",l,"px")),(w||_||x||b)&&(C=yn(C+w-(w*I+_*R)+x),T=yn(T+_-(w*M+_*A)+b)),(s||i)&&(L=v.getBBox(),C=yn(C+s/100*L.width),T=yn(T+i/100*L.height)),L="matrix("+I+","+M+","+R+","+A+","+C+","+T+")",v.setAttribute("transform",L),k&&(v.style[sn]=L)},kJ=function(e,n,r,s,i){var o=360,l=qn(i),u=parseFloat(i)*(l&&~i.indexOf("rad")?ml:1),d=u-s,h=s+d+"deg",p,m;return l&&(p=i.split("_")[1],p==="short"&&(d%=o,d!==d%(o/2)&&(d+=d<0?o:-o)),p==="cw"&&d<0?d=(d+o*aC)%o-~~(d/o)*o:p==="ccw"&&d>0&&(d=(d-o*aC)%o-~~(d/o)*o)),e._pt=m=new Br(e._pt,n,r,s,d,aJ),m.e=h,m.u="deg",e._props.push(r),m},pC=function(e,n){for(var r in n)e[r]=n[r];return e},CJ=function(e,n,r){var s=pC({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",o=r.style,l,u,d,h,p,m,v,w;s.svg?(d=r.getAttribute("transform"),r.setAttribute("transform",""),o[sn]=n,l=Vf(r,1),Sa(r,sn),r.setAttribute("transform",d)):(d=getComputedStyle(r)[sn],o[sn]=n,l=Vf(r,1),o[sn]=d);for(u in wo)d=s[u],h=l[u],d!==h&&i.indexOf(u)<0&&(v=ur(d),w=ur(h),p=v!==w?Ea(r,u,d,w):parseFloat(d),m=parseFloat(h),e._pt=new Br(e._pt,l,u,p,m-p,A2),e._pt.u=w||0,e._props.push(u));pC(l,s)};zr("padding,margin,Width,Radius",function(t,e){var n="Top",r="Right",s="Bottom",i="Left",o=(e<3?[n,r,s,i]:[n+i,n+r,s+r,s+i]).map(function(l){return e<2?t+l:"border"+l+t});Sm[e>1?"border"+t:t]=function(l,u,d,h,p){var m,v;if(arguments.length<4)return m=o.map(function(w){return so(l,w,d)}),v=m.join(" "),v.split(m[0]).length===5?m[0]:v;m=(h+"").split(" "),v={},o.forEach(function(w,_){return v[w]=m[_]=m[_]||m[(_-1)/2|0]}),l.init(u,v,p)}});var JM={name:"css",register:M2,targetTest:function(e){return e.style&&e.nodeType},init:function(e,n,r,s,i){var o=this._props,l=e.style,u=r.vars.startAt,d,h,p,m,v,w,_,x,b,k,C,T,I,M,R,A,L;Zx||M2(),this.styles=this.styles||ZM(e),A=this.styles.props,this.tween=r;for(_ in n)if(_!=="autoRound"&&(h=n[_],!(ss[_]&&DM(_,n,r,s,e,i)))){if(v=typeof h,w=Sm[_],v==="function"&&(h=h.call(r,s,e,i),v=typeof h),v==="string"&&~h.indexOf("random(")&&(h=Nf(h)),w)w(this,e,_,h,r)&&(R=1);else if(_.substr(0,2)==="--")d=(getComputedStyle(e).getPropertyValue(_)+"").trim(),h+="",pa.lastIndex=0,pa.test(d)||(x=ur(d),b=ur(h),b?x!==b&&(d=Ea(e,_,d,b)+b):x&&(h+=x)),this.add(l,"setProperty",d,h,s,i,0,0,_),o.push(_),A.push(_,0,l[_]);else if(v!=="undefined"){if(u&&_ in u?(d=typeof u[_]=="function"?u[_].call(r,s,e,i):u[_],qn(d)&&~d.indexOf("random(")&&(d=Nf(d)),ur(d+"")||d==="auto"||(d+=ds.units[_]||ur(so(e,_))||""),(d+"").charAt(1)==="="&&(d=so(e,_))):d=so(e,_),m=parseFloat(d),k=v==="string"&&h.charAt(1)==="="&&h.substr(0,2),k&&(h=h.substr(2)),p=parseFloat(h),_ in Ti&&(_==="autoAlpha"&&(m===1&&so(e,"visibility")==="hidden"&&p&&(m=0),A.push("visibility",0,l.visibility),ca(this,l,"visibility",m?"inherit":"hidden",p?"inherit":"hidden",!p)),_!=="scale"&&_!=="transform"&&(_=Ti[_],~_.indexOf(",")&&(_=_.split(",")[0]))),C=_ in wo,C){if(this.styles.save(_),L=h,v==="string"&&h.substring(0,6)==="var(--"){if(h=ls(e,h.substring(4,h.indexOf(")"))),h.substring(0,5)==="calc("){var N=e.style.perspective;e.style.perspective=h,h=ls(e,"perspective"),N?e.style.perspective=N:Sa(e,"perspective")}p=parseFloat(h)}if(T||(I=e._gsap,I.renderTransform&&!n.parseTransform||Vf(e,n.parseTransform),M=n.smoothOrigin!==!1&&I.smooth,T=this._pt=new Br(this._pt,l,sn,0,1,I.renderTransform,I,0,-1),T.dep=1),_==="scale")this._pt=new Br(this._pt,I,"scaleY",I.scaleY,(k?Kc(I.scaleY,k+p):p)-I.scaleY||0,A2),this._pt.u=0,o.push("scaleY",_),_+="X";else if(_==="transformOrigin"){A.push(Ur,0,l[Ur]),h=xJ(h),I.svg?O2(e,h,0,M,0,this):(b=parseFloat(h.split(" ")[2])||0,b!==I.zOrigin&&ca(this,I,"zOrigin",I.zOrigin,b),ca(this,l,_,Em(d),Em(h)));continue}else if(_==="svgOrigin"){O2(e,h,1,M,0,this);continue}else if(_ in YM){kJ(this,I,_,m,k?Kc(m,k+h):h);continue}else if(_==="smoothOrigin"){ca(this,I,"smooth",I.smooth,h);continue}else if(_==="force3D"){I[_]=h;continue}else if(_==="transform"){CJ(this,h,e);continue}}else _ in l||(_=Cu(_)||_);if(C||(p||p===0)&&(m||m===0)&&!oJ.test(h)&&_ in l)x=(d+"").substr((m+"").length),p||(p=0),b=ur(h)||(_ in ds.units?ds.units[_]:x),x!==b&&(m=Ea(e,_,d,b)),this._pt=new Br(this._pt,C?I:l,_,m,(k?Kc(m,k+p):p)-m,!C&&(b==="px"||_==="zIndex")&&n.autoRound!==!1?uJ:A2),this._pt.u=b||0,C&&L!==h?(this._pt.b=d,this._pt.e=L,this._pt.r=cJ):x!==b&&b!=="%"&&(this._pt.b=d,this._pt.r=lJ);else if(_ in l)wJ.call(this,e,_,d,k?k+h:h);else if(_ in e)this.add(e,_,d||e[_],k?k+h:h,s,i);else if(_!=="parseTransform"){Nx(_,h);continue}C||(_ in l?A.push(_,0,l[_]):typeof e[_]=="function"?A.push(_,2,e[_]()):A.push(_,1,d||e[_])),o.push(_)}}R&&HM(this)},render:function(e,n){if(n.tween._time||!qx())for(var r=n._pt;r;)r.r(e,r.d),r=r._next;else n.styles.revert()},get:so,aliases:Ti,getSetter:function(e,n,r){var s=Ti[n];return s&&s.indexOf(",")<0&&(n=s),n in wo&&n!==Ur&&(e._gsap.x||so(e,"x"))?r&&oC===r?n==="scale"?pJ:hJ:(oC=r||{})&&(n==="scale"?mJ:gJ):e.style&&!Ox(e.style[n])?dJ:~n.indexOf("-")?fJ:Ux(e,n)},core:{_removeProperty:Sa,_getMatrix:Kx}};Wr.utils.checkPrefix=Cu;Wr.core.getStyleSaver=ZM;(function(t,e,n,r){var s=zr(t+","+e+","+n,function(i){wo[i]=1});zr(e,function(i){ds.units[i]="deg",YM[i]=1}),Ti[s[13]]=t+","+e,zr(r,function(i){var o=i.split(":");Ti[o[1]]=s[o[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");zr("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){ds.units[t]="px"});Wr.registerPlugin(JM);var Gs=Wr.registerPlugin(JM)||Wr;Gs.core.Tween;const k0="/assets/logo-animation",_y=1280,PJ=[{id:"eraser",src:`${k0}/eraser.png`,cssW:189,cssH:74,rot:-90,fit:337,localX:60,localY:168,seaX:.2,seaY:.27,seaRot:-8},{id:"clasp",src:`${k0}/clasp.png`,cssW:170,cssH:170,rot:-248,fit:205,flip:!0,localX:188,localY:97,seaX:.8,seaY:.24,seaRot:-18},{id:"ball",src:`${k0}/playdough.png`,cssW:236,cssH:206,rot:5,fit:150,localX:182,localY:277,seaX:.52,seaY:.79,seaRot:6}],TJ=[{k:"pot",x:.075,y:.2,r:-12,w:152},{k:"chair",x:.1,y:.52,r:8,w:150},{k:"mug",x:.11,y:.84,r:-6,w:140},{k:"cart",x:.3,y:.13,r:10,w:178},{k:"terracotta-1",x:.345,y:.45,r:-18,w:122},{k:"pitcher",x:.285,y:.71,r:14,w:128},{k:"desk",x:.46,y:.25,r:-8,w:198},{k:"startac",x:.475,y:.55,r:16,w:140},{k:"vhsplant",x:.4,y:.9,r:-6,w:188},{k:"bubblephone",x:.63,y:.12,r:12,w:150},{k:"terracotta-2",x:.61,y:.43,r:20,w:122},{k:"pot",x:.675,y:.68,r:14,w:140},{k:"chair",x:.71,y:.91,r:-12,w:140},{k:"mug",x:.91,y:.15,r:8,w:136},{k:"cart",x:.905,y:.47,r:-10,w:166},{k:"startac",x:.88,y:.76,r:18,w:136}],L2=({className:t})=>{const e=g.useRef(null),n=g.useRef(null),r=g.useRef(null);return g.useEffect(()=>{const s=e.current,i=n.current,o=r.current;if(!s||!i||!o)return;const l=window.matchMedia("(prefers-reduced-motion: reduce)").matches,u=(b,k)=>b+Math.random()*(k-b);let d=null,h,p=1;const m=PJ.map(b=>({...b})),v=()=>{s.querySelectorAll(".la-obj").forEach(A=>A.remove());const b=s.getBoundingClientRect(),k=b.width||_y,C=b.height||_y*.64;p=k/_y,i.style.width=`${242*p}px`,i.style.height=`${250*p}px`;const I=250*p/337,M=[],R=(A,L,N)=>{const F=document.createElement("div");return F.className="la-obj",F.style.width=`${L}px`,F.innerHTML=`<img src="${A}" alt="" style="${N?"transform:scaleX(-1)":""}">`,s.appendChild(F),F};return TJ.forEach((A,L)=>{const N=A.w*p,F=R(`${k0}/sea/${A.k}.png`,N,L%2===0);Gs.set(F,{x:A.x*k-N/2,y:A.y*C-N/2,rotation:A.r,opacity:1,scale:0,transformOrigin:"50% 50%"}),M.push({el:F,hero:!1,rest:1})}),m.forEach(A=>{const L=A.cssW*p;A.el=R(A.src,L,!!A.flip),A.finalScale=A.fit*I/(A.cssW*p),Gs.set(A.el,{x:A.seaX*k-L/2,y:A.seaY*C-A.cssH*p/2,rotation:A.seaRot,opacity:1,scale:0,transformOrigin:"50% 50%",zIndex:30}),M.push({el:A.el,hero:!0,rest:150/A.cssW})}),M},w=(b,k)=>{const C=s.getBoundingClientRect(),T=o.getBoundingClientRect();return{x:T.left-C.left+b/326*T.width,y:T.top-C.top+k/337*T.height}},_=()=>{d&&d.revert();const b=v();if(l){d=Gs.context(()=>{b.filter(T=>!T.hero).forEach(T=>Gs.set(T.el,{scale:0})),m.forEach(T=>{if(!T.el)return;const I=w(T.localX,T.localY);Gs.set(T.el,{x:I.x-T.cssW*p/2,y:I.y-T.cssH*p/2,rotation:T.rot,scale:T.finalScale})})},s);return}const k=[],C=[];d=Gs.context(()=>{const T=Gs.timeline();T.to(b.map(I=>I.el),{scale:I=>b[I].rest,duration:.5,ease:"steps(4)",stagger:{each:.045,from:"random"}}),T.add(()=>{b.forEach(({el:I,hero:M},R)=>{const A=M?k:C,L=R%2?1:-1;A.push(Gs.to(I,{rotation:"+="+u(2.5,6)*L,duration:u(.5,.9),repeat:-1,yoyo:!0,ease:"steps(2)",delay:u(0,.4)}),Gs.to(I,{y:"+="+u(5,11)*L,x:"+="+u(4,9)*-L,duration:u(.7,1.2),repeat:-1,yoyo:!0,ease:"steps(3)",delay:u(0,.4)}))})},"<0.1"),T.to({},{duration:1.1}),T.add("pick"),m.forEach((I,M)=>{I.el&&T.to(I.el,{scale:150/I.cssW*1.2,duration:.28,ease:"steps(3)",yoyo:!0,repeat:1},"pick+="+M*.08)}),T.add("clear","pick+=0.7"),T.add(()=>C.forEach(I=>I.kill()),"clear"),T.to(b.filter(I=>!I.hero).map(I=>I.el),{scale:0,rotation:"+=40",duration:.5,ease:"steps(5)",overwrite:"auto",stagger:{each:.025,from:"random"}},"clear"),T.add("assemble","clear+=0.25"),T.add(()=>k.forEach(I=>I.kill()),"assemble"),m.forEach((I,M)=>{if(!I.el||I.finalScale===void 0)return;const R=w(I.localX,I.localY);T.to(I.el,{x:R.x-I.cssW*p/2,y:R.y-I.cssH*p/2,rotation:I.rot,scale:I.finalScale,duration:1.05,ease:"steps(9)",overwrite:"auto"},"assemble+="+M*.12)}),m.forEach(I=>{!I.el||I.finalScale===void 0||T.to(I.el,{scale:I.finalScale*1.03,duration:.16,ease:"steps(2)",yoyo:!0,repeat:1},"assemble+=1.45")})},s)};Gs.ticker.fps(12),_();const x=()=>{clearTimeout(h),h=setTimeout(_,250)};return window.addEventListener("resize",x),()=>{window.removeEventListener("resize",x),clearTimeout(h),d==null||d.revert(),s.querySelectorAll(".la-obj").forEach(b=>b.remove())}},[]),S.jsx("div",{ref:e,className:`la-scene ${t??""}`,children:S.jsx("div",{ref:n,className:"la-logo-stage",children:S.jsx("svg",{ref:r,className:"la-mark",viewBox:"0 0 326 337","aria-hidden":"true"})})})},IJ=Object.freeze(Object.defineProperty({__proto__:null,default:L2},Symbol.toStringTag,{value:"Module"})),mC=({isSigningIn:t})=>t?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-current border-t-transparent"}),S.jsx("span",{children:"Signing in..."})]}):S.jsxs(S.Fragment,{children:[S.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"Google",className:"h-5 w-5"}),S.jsx("span",{children:"Sign in with Google"})]}),AJ=({isSigningIn:t,onStartSignIn:e,errorMessage:n=null,displayMode:r="full"})=>r==="modal"?S.jsxs("div",{className:"glass-panel relative w-full max-w-sm overflow-hidden rounded-2xl border border-white/10 font-main text-white shadow-2xl",children:[S.jsx(L2,{className:"relative z-0 h-44 w-full"}),S.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-6 px-8 pb-12 pt-8",children:[S.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[S.jsx("h1",{className:"text-xl font-medium text-content",children:"Welcome to Rivet"}),S.jsx("p",{className:"text-sm leading-relaxed text-content-muted",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),S.jsx("button",{onClick:e,disabled:t,className:"glass-panel active-push flex cursor-pointer items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium transition-colors hover:bg-main-hover disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(mC,{isSigningIn:t})}),n?S.jsx("p",{className:"text-center text-xs text-red-200",children:n}):null]})]}):S.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-white font-main text-[#18181b]",children:[S.jsx(L2,{className:"absolute inset-0 z-0"}),S.jsxs("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 flex flex-col items-center gap-5 pb-[14vh]",children:[S.jsxs("div",{className:"flex flex-col items-center gap-2 px-6 text-center",children:[S.jsx("h1",{className:"text-xl font-medium tracking-tight text-[#18181b]",children:"Welcome to Rivet"}),S.jsx("p",{className:"max-w-md text-sm leading-relaxed text-[#71717a]",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),S.jsx("button",{onClick:e,disabled:t,className:"active-push pointer-events-auto flex cursor-pointer items-center gap-3 rounded-full border border-black/10 bg-white px-8 py-3.5 text-sm font-medium text-[#18181b] shadow-[0_8px_24px_rgba(40,33,28,0.14)] transition-colors hover:bg-[#faf9f7] disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(mC,{isSigningIn:t})}),n?S.jsx("p",{className:"text-center text-xs text-red-500",children:n}):null]})]}),RJ="data:image/svg+xml,%3csvg%20width='94'%20height='24'%20viewBox='0%200%2094%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M-0.000156164%2023.832V7.704H5.11184L6.47984%208.424C7.58384%207.704%209.04784%207.344%2010.8718%207.344C12.0718%207.344%2013.1278%207.476%2014.0398%207.74C14.9518%207.98%2015.6838%208.244%2016.2358%208.532C16.8118%208.82%2017.1718%209.024%2017.3158%209.144L15.5158%2013.824C15.2758%2013.656%2014.8198%2013.428%2014.1478%2013.14C13.4998%2012.852%2012.7318%2012.588%2011.8438%2012.348C10.9558%2012.084%2010.0198%2011.952%209.03584%2011.952H8.63984C7.96784%2011.952%207.45184%2012.072%207.09184%2012.312C6.73184%2012.528%206.55184%2013.02%206.55184%2013.788V23.832H-0.000156164ZM23.464%206.156C21.04%206.156%2019.828%205.124%2019.828%203.06C19.828%201.908%2020.128%201.116%2020.728%200.684C21.352%200.227999%2022.264%20-1.43051e-06%2023.464%20-1.43051e-06C24.736%20-1.43051e-06%2025.66%200.227999%2026.236%200.684C26.836%201.116%2027.136%201.908%2027.136%203.06C27.136%205.124%2025.912%206.156%2023.464%206.156ZM20.152%2023.832V7.704H26.704V23.832H20.152ZM37.4767%2023.832L29.6647%207.704H36.9007L40.3207%2016.524L41.2567%2019.116H41.6167L42.5527%2016.524L46.0087%207.704H53.1727L52.5967%209.9L45.4327%2023.832H37.4767ZM61.1953%2023.832C59.6113%2023.832%2058.3873%2023.604%2057.5233%2023.148C56.6833%2022.692%2056.1073%2022.068%2055.7953%2021.276C55.4833%2020.46%2055.3273%2019.524%2055.3273%2018.468V13.032C55.3273%2012.072%2055.4833%2011.196%2055.7953%2010.404C56.1313%209.588%2056.7193%208.94%2057.5593%208.46C58.3993%207.956%2059.6113%207.704%2061.1953%207.704H68.6473C70.5193%207.704%2071.9473%207.932%2072.9313%208.388C73.9393%208.82%2074.6233%209.444%2074.9833%2010.26C75.3673%2011.052%2075.5593%2011.976%2075.5593%2013.032V17.64H69.2593C67.0993%2017.64%2065.4553%2017.592%2064.3273%2017.496C63.2233%2017.4%2062.4433%2017.34%2061.9873%2017.316V17.856C61.9633%2018.816%2062.5393%2019.296%2063.7153%2019.296H64.8313C66.7513%2019.296%2068.5273%2019.26%2070.1593%2019.188C71.7913%2019.092%2073.0033%2019.008%2073.7953%2018.936L75.9553%2022.356C75.9553%2022.596%2075.7513%2022.824%2075.3433%2023.04C74.9353%2023.256%2074.2153%2023.448%2073.1833%2023.616C72.1753%2023.76%2070.7353%2023.832%2068.8633%2023.832H61.1953ZM61.9873%2014.184H68.8993V13.68C68.8993%2013.2%2068.8513%2012.864%2068.7553%2012.672C68.6833%2012.48%2068.4313%2012.36%2067.9993%2012.312C67.5673%2012.264%2066.8353%2012.24%2065.8033%2012.24H63.7153C62.5633%2012.24%2061.9873%2012.72%2061.9873%2013.68V14.184ZM85.8224%2023.832C83.9984%2023.832%2082.7504%2023.448%2082.0784%2022.68C81.4064%2021.912%2081.0704%2020.76%2081.0704%2019.224V12.24H78.1184V7.704H79.6304C80.0384%207.704%2080.3624%207.632%2080.6024%207.488C80.8664%207.32%2081.0344%207.032%2081.1064%206.624L81.7904%202.772H87.6944V7.704H93.7064V12.24H87.6944V17.82C87.6944%2018.42%2087.8384%2018.816%2088.1264%2019.008C88.4144%2019.2%2088.8464%2019.296%2089.4224%2019.296H93.0224L93.7424%2023.472C93.2384%2023.544%2092.4704%2023.628%2091.4384%2023.724C90.4064%2023.796%2089.2784%2023.832%2088.0544%2023.832H85.8224Z'%20fill='%23FF3300'/%3e%3c/svg%3e",MJ=({message:t})=>S.jsx("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-[#1c1c20] font-main text-white",children:S.jsxs("div",{className:"flex flex-col items-center gap-10",children:[S.jsx("img",{src:RJ,alt:"Rivet",className:"h-8 w-auto object-contain"}),S.jsxs("div",{className:"glass-panel flex items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium",children:[S.jsx(Gm,{className:"h-5 w-5 shrink-0 animate-spin text-primary",weight:"bold"}),S.jsx("span",{children:t})]})]})}),OJ="data:image/svg+xml,%3csvg%20width='548'%20height='565'%20viewBox='0%200%20548%20565'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M136.53%20-0.00177124C170.301%20-0.00177124%20197.687%2027.3551%20197.724%2061.1255L198.089%20394.976C198.189%20486.214%20124.253%20560.23%2033.0153%20560.23C14.7818%20560.23%200.000557184%20545.449%200.000557184%20527.216V61.1923C0.000557184%2027.3957%2027.3981%20-0.00177124%2061.1947%20-0.00177124H136.53Z'%20fill='white'/%3e%3cpath%20d='M271.092%20463.876C271.092%20530.762%20310.368%20564.205%20388.919%20564.205C468.248%20564.205%20507.913%20530.762%20507.913%20463.876C507.913%20426.545%20498.191%20400.88%20478.748%20386.88C460.082%20372.103%20430.139%20364.715%20388.919%20364.715C350.032%20364.715%20320.478%20372.103%20300.257%20386.88C280.814%20400.88%20271.092%20426.545%20271.092%20463.876Z'%20fill='white'/%3e%3cpath%20d='M405.25%200.917969C408.273%200.917973%20411.331%201.11183%20414.358%201.66895C437.891%205.99962%20471.151%2018.8698%20498.612%2044.5137C526.065%2070.1496%20547.676%20108.515%20547.992%20163.691C547.992%20163.693%20547.994%20163.695%20547.997%20163.695C547.999%20163.695%20548.001%20163.697%20548.001%20163.7L547.996%20164.612L548.001%20165.526C548.001%20165.528%20547.999%20165.53%20547.997%20165.53C547.994%20165.53%20547.992%20165.532%20547.992%20165.535C547.665%20222.498%20524.643%20261.54%20495.935%20287.156C467.223%20312.776%20432.863%20324.939%20409.917%20328.291C409.844%20328.302%20409.769%20328.308%20409.695%20328.308H283.146C254.52%20328.308%20231.314%20305.102%20231.314%20276.477C231.315%20244.265%20255.799%20218.161%20287.447%20213.026C309.663%20209.422%20329.612%20204.399%20344.084%20196.322C354.361%20190.586%20359.717%20184.074%20362.521%20178.421C365.332%20172.756%20365.636%20167.843%20365.636%20165.225V163.994C365.635%20161.374%20365.33%20156.465%20362.521%20150.805C359.717%20145.152%20354.361%20138.639%20344.084%20132.903C329.612%20124.826%20309.663%20119.803%20287.447%20116.199C255.799%20111.065%20231.315%2084.9602%20231.314%2052.749C231.314%2024.1235%20254.52%200.917969%20283.146%200.917969H405.25Z'%20fill='white'/%3e%3c/svg%3e",km=44,Od=8,Qp=16,LJ=4,gC=-18,DJ=.18,NJ=[.22,1,.36,1],vC=.92,$J=1,jJ=.95,FJ=.4,VJ=[.19,1,.22,1],wy=0,HJ=1,zJ=0,BJ=0,UJ=0,eO=({position:t,viewport:e,boundsLeft:n=0})=>{const r=n+Od,s=Math.max(r,e.width-km-Od),i=Math.max(Od,e.height-km-Od);return{x:Math.min(s,Math.max(r,t.x)),y:Math.min(i,Math.max(Od,t.y))}},Yx=()=>({width:window.innerWidth,height:window.innerHeight}),WJ=({position:t,boundsLeftPx:e=0})=>eO({position:t,viewport:Yx(),boundsLeft:e}),ZJ=()=>{if(typeof window>"u")return{x:Qp,y:Qp};const t=Yx();return{x:t.width-km-Qp,y:t.height-km-Qp}},qJ=({deltaX:t,deltaY:e})=>Math.hypot(t,e)>=LJ,GJ=t=>t.button===void 0||t.button<=UJ,yC=t=>{const e=t.nativeEvent;return{x:Number.isFinite(t.clientX)?t.clientX:e.clientX,y:Number.isFinite(t.clientY)?t.clientY:e.clientY}},KJ=({isVisible:t,isPanelOpen:e,isReducedMotion:n,position:r,dragBoundsLeftPx:s=0,onToggle:i,onPositionChange:o})=>{const l=g.useRef(null),u=g.useRef(!1),[d,h]=g.useState(!1),[p,m]=g.useState(!1),v=n?!1:{opacity:wy,scale:vC,x:gC},w=n?{opacity:wy}:{opacity:wy,scale:vC,x:gC},_=n?{duration:BJ}:{duration:DJ,ease:NJ,scale:{duration:FJ,ease:VJ}},x=g.useCallback(()=>{const I=l.current;I&&(u.current=I.hasMoved),l.current=null,h(!1)},[]),b=g.useCallback(I=>{const M=l.current;if(!M)return;const R=yC(I),A=R.x-M.startPointer.x,L=R.y-M.startPointer.y,N=M.hasMoved||qJ({deltaX:A,deltaY:L});l.current={...M,hasMoved:N},N&&o(eO({position:{x:M.startPosition.x+A,y:M.startPosition.y+L},viewport:Yx(),boundsLeft:s}))},[o,s]),k=g.useCallback(I=>{if(l.current||!GJ(I))return;const M=yC(I);l.current={startPointer:M,startPosition:r,hasMoved:!1},h(!0)},[r]),C=g.useCallback(()=>{if(u.current){u.current=!1;return}i()},[i]),T=e?"Close panel":"Open panel";return S.jsxs(S.Fragment,{children:[d?S.jsx("div",{className:"fixed inset-0 z-40 cursor-grabbing","data-cy":"rivet-panel-launcher-drag-surface",onPointerMove:b,onPointerUp:x,onPointerCancel:x,onMouseMove:b,onMouseUp:x}):null,S.jsx(us,{children:t?S.jsx(Hl,{label:T,side:"top",forceOpen:p&&!d?void 0:!1,children:S.jsx(ni.button,{type:"button","aria-label":T,"data-cy":"reopen-panel",onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),initial:v,animate:{opacity:HJ,scale:$J,x:zJ},whileTap:{scale:jJ},exit:w,transition:_,onPointerDown:k,onMouseDown:k,onPointerMove:b,onPointerUp:x,onPointerCancel:x,onMouseMove:b,onMouseUp:x,onClick:C,className:`bg-main absolute z-50 flex h-11 w-11 touch-none select-none items-center justify-center overflow-hidden rounded-full border border-white/10 shadow-[0_2px_8px_rgba(0,0,0,0.2),0_4px_16px_rgba(0,0,0,0.1)] transition-[background-color,box-shadow] duration-150 hover:bg-[#2a2a2a] focus:outline-none focus-visible:ring-2 focus-visible:ring-white/75 ${d?"cursor-grabbing shadow-[0_4px_12px_rgba(0,0,0,0.28),0_10px_24px_rgba(0,0,0,0.16)]":"cursor-grab"}`,style:{left:r.x,top:r.y,willChange:"left, top, transform"},children:S.jsx("img",{src:OJ,alt:"","aria-hidden":"true",draggable:!1,className:"h-4 w-4"})})}):null})]})},xy=ms("useConfig"),YJ=300*1e3,XJ=1800*1e3,QJ=60*1e3,JJ=300*1e3,eee=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.queueAccessToken)??null},tee=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},nee=t=>({...fR,...t??{}}),ree=()=>{const t=nt(f2),e=ft(f2),n=ft(bR),r=ft(SR),s=ft(Km),i=ft(WK),o=ft(xR),l=ft(BK),u=ft(sh),d=ft(gR),h=g.useCallback(b=>{o(b.agentModeAvailable),d({name:b.name??null,email:b.email??null}),b.isMCPSession&&n(!0),b.mcpEditor&&r(b.mcpEditor),s(b.agentApplyMode??tee()??null),i(b.queueAccessToken??eee())},[s,o,n,r,i,d]),p=Vy({queryKey:["rivet-config"],queryFn:async()=>{const b=await fetch("/api/config");if(!b.ok)throw new Error(`Failed to fetch config: ${b.statusText}`);return await b.json()},staleTime:YJ,gcTime:XJ}),m=Vy({queryKey:["rivet-feature-flags"],queryFn:async()=>{const b=await fetch("/api/feature-flags");if(!b.ok)throw new Error(`Failed to fetch feature flags: ${b.statusText}`);return await b.json()},staleTime:QJ,gcTime:JJ}),{refetch:v}=p,{refetch:w}=m;g.useLayoutEffect(()=>{p.data&&(h(p.data),u(!1),xy.info("Config loaded:",p.data)),m.data&&(e(nee(m.data.featureFlags)),l(!0))},[p.data,m.data,h,u,e,l]),g.useLayoutEffect(()=>{p.error&&(l(!0),u(!1),xy.warn("Failed to load config:",p.error instanceof Error?p.error.message:"Failed to load config")),m.error&&(l(!0),xy.warn("Failed to load feature flags:",m.error instanceof Error?m.error.message:"Failed to load feature flags"))},[p.error,m.error,u,l]);const _=g.useCallback(async()=>{const[b]=await Promise.all([v(),w()]);return b.data?b.data:null},[v,w]);let x=null;return p.error instanceof Error?x=p.error.message:p.error&&(x="Failed to load config"),{config:p.data??null,featureFlags:t,loading:p.isPending||!p.error&&m.isPending,error:x,refetchConfig:_}},C0="rivet_just_signed_in",Ac=ms("useOAuthCallback"),see="https://rivet-proxy.onrender.com",iee=()=>{const[t,e]=g.useState({isProcessing:!1,isComplete:!1,error:null});return g.useEffect(()=>{const n=new AbortController;let r=!1;return(async()=>{var l,u,d;const i=window.location.hash,o=window.location.search;if(!(!i||!i.includes("access_token"))&&!r){e({isProcessing:!0,isComplete:!1,error:null});try{Ac.info("Processing OAuth callback...");const h=new URLSearchParams(i.substring(1)),p=h.get("access_token"),m=h.get("refresh_token"),w=new URLSearchParams(o).get("session");if(!p)throw new Error("No access token found in URL");if(!w)throw new Error("No session ID found in URL");Ac.info(`Completing OAuth with session: ${w}`);const _=await fetch(`${see}/api/auth/google/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:w,accessToken:p,refreshToken:m}),signal:n.signal}),x=await _.json();if(!_.ok||!x.success)throw new Error(x.error||x.message||"Failed to complete authentication");if(Ac.info("OAuth authentication completed successfully"),r)return;if((l=x.user)!=null&&l.id?(Ee.identify(x.user.id,{...x.user.email?{email:x.user.email}:{}}),x.user.email&&Ee.alias(x.user.email,x.user.id)):(u=x.user)!=null&&u.email&&Ee.identify(x.user.email,{email:x.user.email}),(d=x.user)!=null&&d.email&&p)try{const k=await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:x.user.email,token:p,refreshToken:m,userId:x.user.id}),signal:n.signal});k.ok||Ac.warn(`Local auth store returned ${k.status}`)}catch(k){if(r)return;Ac.warn("Failed to store auth locally:",k)}if(r)return;window.sessionStorage.setItem(C0,"1");const b=window.location.pathname;window.history.replaceState({},document.title,b),e({isProcessing:!1,isComplete:!0,error:null})}catch(h){if(r)return;const p=h instanceof Error?h.message:"Unknown error occurred";Ac.warn("OAuth callback error:",h),e({isProcessing:!1,isComplete:!1,error:p})}}})(),()=>{r=!0,n.abort()}},[]),t},by=ms("useAgentVariantsSession"),oee=t=>typeof t.pendingCount=="number"&&t.pendingCount===0&&(t.pendingVariantRequests??0)===0&&(t.leasedVariantRequests??0)===0&&(t.activeLeases??[]).length===0,_C=(t,e,n)=>{e.size===0&&!n||t.set(Rf,r=>{if(r.size===0)return r;const s=new Map(r);let i=!1;for(const[o,l]of r)l.status==="sending"&&l.variantRequestId&&(e.has(l.variantRequestId)||n&&l.variantRequest!==void 0)&&(s.delete(o),i=!0);return i?s:r})},aee=(t,e)=>{var s;if(t.size===0)return t;let n=!1;const r=new Map(t);for(const[i,o]of t){if(o.status!=="sending"||!o.awaitingSnapshotOutcome||o.variantRequest!==void 0)continue;const l=o.target;if(!l||l.kind!=="variant"||l.sessionId!==e.sessionId)continue;const u=(s=e.variants.find(d=>d.workItemId===l.variantId))==null?void 0:s.refinement;u&&(u.status==="succeeded"?(r.set(i,{...o,status:"complete",awaitingSnapshotOutcome:void 0}),n=!0):(u.status==="failed"||u.status==="cancelled")&&(r.set(i,{...o,status:"error",awaitingSnapshotOutcome:void 0}),n=!0))}return n?r:t},lee=({enabled:t=!0}={})=>{const e=ft(rh),n=ft(hR),r=ft(jK),s=ft(_R),i=ft(zK),o=gw(),l=g.useRef(null);g.useEffect(()=>{if(!t)return;const u=new EventSource("/api/variants/events");return u.onmessage=d=>{try{const h=JSON.parse(d.data),p=l.current;if(h.active){const w=new Set(h.variants.map(_=>_.requestId).filter(_=>!!_));s(_=>_.filter(b=>!w.has(b.requestId))),_C(o,w,!1),o.set(Rf,_=>{let x=_;for(const b of h.variants){const k=b.adoptedSource;k&&(x=HK(x,{kind:"variant",sessionId:k.sessionId,variantId:k.variantId},{kind:"variant",sessionId:h.sessionId,variantId:b.workItemId}))}return x}),o.set(Rf,_=>aee(_,h)),h.sessionId!==l.current&&(l.current=h.sessionId,n(!0),r("directions"))}else l.current=null,_C(o,new Set,oee(h));e(h);const m=!h.active&&p!==null,v=h.active&&h.sessionId!==p;if(v&&fetch(`/api/variants/${h.sessionId}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(w=>by.warn("failed to reset preview-port on session switch",w)),m||v){const w=new Set;if(h.active)for(const x of h.variants)w.add(If({kind:"variant",sessionId:h.sessionId,variantId:x.workItemId}));const _=o.get(yo);for(const x of[_==null?void 0:_.left,_==null?void 0:_.right])x&&w.add(If({kind:"variant",sessionId:x.sessionId,variantId:x.variantId}));i(w)}}catch(h){by.warn("failed to parse SSE event payload",h)}},u.onerror=d=>{by.warn("SSE error (auto-reconnects)",d)},()=>{u.close()}},[t,e,n,r,s,i,o])};var cee=Object.defineProperty,Wn=(t,e)=>cee(t,"name",{value:e,configurable:!0});function Xx(t){const e=t+"CollectionProvider",[n,r]=Di(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=Wn(_=>{const{scope:x,children:b}=_,k=g.useRef(null),C=g.useRef(new Map).current;return S.jsx(s,{scope:x,itemMap:C,collectionRef:k,children:b})},"CollectionProvider");o.displayName=e;const l=t+"CollectionSlot",u=_a(l),d=g.forwardRef((_,x)=>{const{scope:b,children:k}=_,C=i(l,b),T=Zt(x,C.collectionRef);return S.jsx(u,{ref:T,children:k})});d.displayName=l;const h=t+"CollectionItemSlot",p="data-radix-collection-item",m=_a(h),v=g.forwardRef((_,x)=>{const{scope:b,children:k,...C}=_,T=g.useRef(null),I=Zt(x,T),M=i(h,b);return g.useEffect(()=>(M.itemMap.set(T,{ref:T,...C}),()=>void M.itemMap.delete(T))),S.jsx(m,{[p]:"",ref:I,children:k})});v.displayName=h;function w(_){const x=i(t+"CollectionConsumer",_);return g.useCallback(()=>{const k=x.collectionRef.current;if(!k)return[];const C=Array.from(k.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((M,R)=>C.indexOf(M.ref.current)-C.indexOf(R.ref.current))},[x.collectionRef,x.itemMap])}return Wn(w,"useCollection"),[{Provider:o,Slot:d,ItemSlot:v},w,r]}Wn(Xx,"createCollection");var wC=new WeakMap,Cn,rs,Sy=(rs=class extends Map{constructor(n){super(n);Ye(this,Cn);Pe(this,Cn,[...super.keys()]),wC.set(this,!0)}set(n,r){return wC.get(this)&&(this.has(n)?U(this,Cn)[U(this,Cn).indexOf(n)]=n:U(this,Cn).push(n)),super.set(n,r),this}insert(n,r,s){const i=this.has(r),o=U(this,Cn).length,l=Qx(n);let u=l>=0?l:o+l;const d=u<0||u>=o?-1:u;if(d===this.size||i&&d===this.size-1||d===-1)return this.set(r,s),this;const h=this.size+(i?0:1);l<0&&u++;const p=[...U(this,Cn)];let m,v=!1;for(let w=u;w<h;w++)if(u===w){let _=p[w];p[w]===r&&(_=p[w+1]),i&&this.delete(r),m=this.get(_),this.set(r,s)}else{!v&&p[w-1]===r&&(v=!0);const _=p[v?w:w-1],x=m;m=this.get(_),this.delete(_),this.set(_,x)}return this}with(n,r,s){const i=new rs(this);return i.insert(n,r,s),i}before(n){const r=U(this,Cn).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,s){const i=U(this,Cn).indexOf(n);return i===-1?this:this.insert(i,r,s)}after(n){let r=U(this,Cn).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,s){const i=U(this,Cn).indexOf(n);return i===-1?this:this.insert(i+1,r,s)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Pe(this,Cn,[]),super.clear()}delete(n){const r=super.delete(n);return r&&U(this,Cn).splice(U(this,Cn).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=P0(U(this,Cn),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=P0(U(this,Cn),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return U(this,Cn).indexOf(n)}keyAt(n){return P0(U(this,Cn),n)}from(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return i;s++}}findIndex(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return s;s++}return-1}filter(n,r){const s=[];let i=0;for(const o of this)Reflect.apply(n,r,[o,i,this])&&s.push(o),i++;return new rs(s)}map(n,r){const s=[];let i=0;for(const o of this)s.push([o[0],Reflect.apply(n,r,[o,i,this])]),i++;return new rs(s)}reduce(...n){const[r,s]=n;let i=0,o=s??this.at(0);for(const l of this)i===0&&n.length===1?o=l:o=Reflect.apply(r,this,[o,l,i,this]),i++;return o}reduceRight(...n){const[r,s]=n;let i=s??this.at(-1);for(let o=this.size-1;o>=0;o--){const l=this.at(o);o===this.size-1&&n.length===1?i=l:i=Reflect.apply(r,this,[i,l,o,this])}return i}toSorted(n){const r=[...this.entries()].sort(n);return new rs(r)}toReversed(){const n=new rs;for(let r=this.size-1;r>=0;r--){const s=this.keyAt(r),i=this.get(s);n.set(s,i)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new rs(r)}slice(n,r){const s=new rs;let i=this.size-1;if(n===void 0)return s;n<0&&(n=n+this.size),r!==void 0&&r>0&&(i=r-1);for(let o=n;o<=i;o++){const l=this.keyAt(o),u=this.get(l);s.set(l,u)}return s}every(n,r){let s=0;for(const i of this){if(!Reflect.apply(n,r,[i,s,this]))return!1;s++}return!0}some(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return!0;s++}return!1}},Cn=new WeakMap,Wn(rs,"OrderedDict"),rs);function P0(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=tO(t,e);return n===-1?void 0:t[n]}Wn(P0,"at");function tO(t,e){const n=t.length,r=Qx(e),s=r>=0?r:n+r;return s<0||s>=n?-1:s}Wn(tO,"toSafeIndex");function Qx(t){return t!==t||t===0?0:Math.trunc(t)}Wn(Qx,"toSafeInteger");function uee(t){const e=t+"CollectionProvider",[n,r]=Di(e),[s,i]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Sy,setItemMap:Wn(()=>{},"setItemMap")}),o=Wn(({state:C,...T})=>C?S.jsx(u,{...T,state:C}):S.jsx(l,{...T}),"CollectionProvider");o.displayName=e;const l=Wn(C=>{const T=x();return S.jsx(u,{...C,state:T})},"CollectionInit");l.displayName=e+"Init";const u=Wn(C=>{const{scope:T,children:I,state:M}=C,R=g.useRef(null),[A,L]=g.useState(null),N=Zt(R,L),[F,j]=M;return g.useEffect(()=>{if(!A)return;const Q=sO(()=>{});return Q.observe(A,{childList:!0,subtree:!0}),()=>{Q.disconnect()}},[A]),S.jsx(s,{scope:T,itemMap:F,setItemMap:j,collectionRef:N,collectionRefObject:R,collectionElement:A,children:I})},"CollectionProviderImpl");u.displayName=e+"Impl";const d=t+"CollectionSlot",h=_a(d),p=g.forwardRef((C,T)=>{const{scope:I,children:M}=C,R=i(d,I),A=Zt(T,R.collectionRef);return S.jsx(h,{ref:A,children:M})});p.displayName=d;const m=t+"CollectionItemSlot",v="data-radix-collection-item",w=_a(m),_=g.forwardRef((C,T)=>{const{scope:I,children:M,...R}=C,A=g.useRef(null),[L,N]=g.useState(null),F=Zt(T,A,N),j=i(m,I),{setItemMap:Q}=j,q=g.useRef(R);nO(q.current,R)||(q.current=R);const Z=q.current;return g.useEffect(()=>{const W=Z;return Q(Y=>L?Y.has(L)?Y.set(L,{...W,element:L}).toSorted(D2):(Y.set(L,{...W,element:L}),Y.toSorted(D2)):Y),()=>{Q(Y=>!L||!Y.has(L)?Y:(Y.delete(L),new Sy(Y)))}},[L,Z,Q]),S.jsx(w,{[v]:"",ref:F,children:M})});_.displayName=m;function x(){return g.useState(new Sy)}Wn(x,"useInitCollection");function b(C){const{itemMap:T}=i(t+"CollectionConsumer",C);return T}return Wn(b,"useCollection"),[{Provider:o,Slot:p,ItemSlot:_},{createCollectionScope:r,useCollection:b,useInitCollection:x}]}Wn(uee,"createCollection");function nO(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t==null||e==null)return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(e,s)||t[s]!==e[s])return!1;return!0}Wn(nO,"shallowEqual");function rO(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}Wn(rO,"isElementPreceding");function D2(t,e){return!t[1].element||!e[1].element?0:rO(t[1].element,e[1].element)?-1:1}Wn(D2,"sortByDocumentPosition");function sO(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}Wn(sO,"getChildListObserver");var dee=Object.defineProperty,ah=(t,e)=>dee(t,"name",{value:e,configurable:!0}),Jx="Collapsible",[fee,iO]=Di(Jx),[hee,eb]=fee(Jx),pee=g.forwardRef(ah(function(e,n){const{__scopeCollapsible:r,open:s,defaultOpen:i,disabled:o,onOpenChange:l,...u}=e,[d,h]=Ca({prop:s,defaultProp:i??!1,onChange:l,caller:Jx});return S.jsx(hee,{scope:r,disabled:o,contentId:da(),open:d,onOpenToggle:g.useCallback(()=>h(p=>!p),[h]),children:S.jsx(_n.div,{"data-state":tg(d),"data-disabled":o?"":void 0,...u,ref:n})})},"Collapsible")),mee="CollapsibleTrigger",gee=g.forwardRef(ah(function(e,n){const{__scopeCollapsible:r,...s}=e,i=eb(mee,r);return S.jsx(_n.button,{type:"button","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":tg(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...s,ref:n,onClick:Ut(e.onClick,i.onOpenToggle)})},"CollapsibleTrigger")),oO="CollapsibleContent",vee=g.forwardRef(ah(function(e,n){const{forceMount:r,...s}=e,i=eb(oO,e.__scopeCollapsible);return S.jsx(Pa,{present:r||i.open,children:({present:o})=>S.jsx(yee,{...s,ref:n,present:o})})},"CollapsibleContent")),yee=g.forwardRef(ah(function(e,n){const{__scopeCollapsible:r,present:s,children:i,...o}=e,l=eb(oO,r),[u,d]=g.useState(s),h=g.useRef(null),p=Zt(n,h),m=g.useRef(0),v=m.current,w=g.useRef(0),_=w.current,x=l.open||u,b=g.useRef(x),k=g.useRef(void 0);return g.useEffect(()=>{const C=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(C)},[]),Fr(()=>{const C=h.current;if(C){k.current=k.current||{transitionDuration:C.style.transitionDuration,animationName:C.style.animationName},C.style.transitionDuration="0s",C.style.animationName="none";const T=C.getBoundingClientRect();m.current=T.height,w.current=T.width,b.current||(C.style.transitionDuration=k.current.transitionDuration,C.style.animationName=k.current.animationName),d(s)}},[l.open,s]),S.jsx(_n.div,{"data-state":tg(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!x,...o,ref:p,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":_?`${_}px`:void 0,...e.style},children:x&&i})},"CollapsibleContentImpl"));function tg(t){return t?"open":"closed"}ah(tg,"getState");var _ee=pee,wee=gee,xee=vee,bee=Object.defineProperty,See=(t,e)=>bee(t,"name",{value:e,configurable:!0}),Eee=g.createContext(void 0);function tb(t){const e=g.useContext(Eee);return t||e||"ltr"}See(tb,"useDirection");var kee=Object.defineProperty,fs=(t,e)=>kee(t,"name",{value:e,configurable:!0}),Ni="Accordion",Cee=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[nb,Pee,Tee]=Xx(Ni),[ng,tre]=Di(Ni,[Tee,iO]),rb=iO(),Iee=g.forwardRef(fs(function(e,n){const{type:r,...s}=e,i=s,o=s;return S.jsx(nb.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?S.jsx(Oee,{...o,ref:n}):S.jsx(Mee,{...i,ref:n})})},"Accordion")),[aO,Aee]=ng(Ni),[lO,Ree]=ng(Ni,{collapsible:!1}),Mee=g.forwardRef(fs(function(e,n){const{value:r,defaultValue:s,onValueChange:i=fs(()=>{},"onValueChange"),collapsible:o=!1,...l}=e,[u,d]=Ca({prop:r,defaultProp:s??"",onChange:i,caller:Ni});return S.jsx(aO,{scope:e.__scopeAccordion,value:g.useMemo(()=>u?[u]:[],[u]),onItemOpen:d,onItemClose:g.useCallback(()=>o&&d(""),[o,d]),children:S.jsx(lO,{scope:e.__scopeAccordion,collapsible:o,children:S.jsx(cO,{...l,ref:n})})})},"AccordionImplSingle")),Oee=g.forwardRef(fs(function(e,n){const{value:r,defaultValue:s,onValueChange:i=fs(()=>{},"onValueChange"),...o}=e,[l,u]=Ca({prop:r,defaultProp:s??[],onChange:i,caller:Ni}),d=g.useCallback(p=>u((m=[])=>[...m,p]),[u]),h=g.useCallback(p=>u((m=[])=>m.filter(v=>v!==p)),[u]);return S.jsx(aO,{scope:e.__scopeAccordion,value:l,onItemOpen:d,onItemClose:h,children:S.jsx(lO,{scope:e.__scopeAccordion,collapsible:!0,children:S.jsx(cO,{...o,ref:n})})})},"AccordionImplMultiple")),[Lee,rg]=ng(Ni),cO=g.forwardRef(fs(function(e,n){const{__scopeAccordion:r,disabled:s,dir:i,orientation:o="vertical",...l}=e,u=g.useRef(null),d=Zt(u,n),h=Pee(r),m=tb(i)==="ltr",v=Ut(e.onKeyDown,w=>{var L;if(!Cee.includes(w.key))return;const _=w.target,x=h().filter(N=>{var F;return!((F=N.ref.current)!=null&&F.disabled)}),b=x.findIndex(N=>N.ref.current===_),k=x.length;if(b===-1)return;w.preventDefault();let C=b;const T=0,I=k-1,M=fs(()=>{C=b+1,C>I&&(C=T)},"moveNext"),R=fs(()=>{C=b-1,C<T&&(C=I)},"movePrev");switch(w.key){case"Home":C=T;break;case"End":C=I;break;case"ArrowRight":o==="horizontal"&&(m?M():R());break;case"ArrowDown":o==="vertical"&&M();break;case"ArrowLeft":o==="horizontal"&&(m?R():M());break;case"ArrowUp":o==="vertical"&&R();break}const A=C%k;(L=x[A].ref.current)==null||L.focus()});return S.jsx(Lee,{scope:r,disabled:s,direction:i,orientation:o,children:S.jsx(nb.Slot,{scope:r,children:S.jsx(_n.div,{...l,"data-orientation":o,ref:d,onKeyDown:s?void 0:v})})})},"AccordionImpl")),N2="AccordionItem",[Dee,sb]=ng(N2),Nee=g.forwardRef(fs(function(e,n){const{__scopeAccordion:r,value:s,...i}=e,o=rg(N2,r),l=Aee(N2,r),u=rb(r),d=da(),h=s&&l.value.includes(s)||!1,p=o.disabled||e.disabled;return S.jsx(Dee,{scope:r,open:h,disabled:p,triggerId:d,children:S.jsx(_ee,{"data-orientation":o.orientation,"data-state":ib(h),...u,...i,ref:n,disabled:p,open:h,onOpenChange:m=>{m?l.onItemOpen(s):l.onItemClose(s)}})})},"AccordionItem")),$ee="AccordionHeader",jee=g.forwardRef(fs(function(e,n){const{__scopeAccordion:r,...s}=e,i=rg(Ni,r),o=sb($ee,r);return S.jsx(_n.h3,{"data-orientation":i.orientation,"data-state":ib(o.open),"data-disabled":o.disabled?"":void 0,...s,ref:n})},"AccordionHeader")),xC="AccordionTrigger",Fee=g.forwardRef(fs(function(e,n){const{__scopeAccordion:r,...s}=e,i=rg(Ni,r),o=sb(xC,r),l=Ree(xC,r),u=rb(r);return S.jsx(nb.ItemSlot,{scope:r,children:S.jsx(wee,{"aria-disabled":o.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId,...u,...s,ref:n})})},"AccordionTrigger")),Vee="AccordionContent",Hee=g.forwardRef(fs(function(e,n){const{__scopeAccordion:r,...s}=e,i=rg(Ni,r),o=sb(Vee,r),l=rb(r);return S.jsx(xee,{role:"region","aria-labelledby":o.triggerId,"data-orientation":i.orientation,...l,...s,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})},"AccordionContent"));function ib(t){return t?"open":"closed"}fs(ib,"getState");var uO=Iee,zee=Nee,Bee=jee,Uee=Fee,Wee=Hee;/**
130
+ * @license lucide-react v1.46.0 - ISC
131
+ *
132
+ * This source code is licensed under the ISC license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */const Zee=t=>t==null?void 0:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
135
+ * @license lucide-react v1.46.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */function qee(t,e,n=[]){if(e==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:Zee(t),size:24,node:e,...n.length>0?{aliases:n}:{}}}/**
140
+ * @license lucide-react v1.46.0 - ISC
141
+ *
142
+ * This source code is licensed under the ISC license.
143
+ * See the LICENSE file in the root directory of this source tree.
144
+ */const Gee=t=>{let e="",n=!1;for(const r of t){if(r==="-"||r==="_"||r<=" "){n=e.length>0;continue}e.length===0?e+=r.toLowerCase():e+=n?r.toUpperCase():r,n=!1}return e};/**
145
+ * @license lucide-react v1.46.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */const Kee=t=>{const e=Gee(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
150
+ * @license lucide-react v1.46.0 - ISC
151
+ *
152
+ * This source code is licensed under the ISC license.
153
+ * See the LICENSE file in the root directory of this source tree.
154
+ */const $2=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
155
+ * @license lucide-react v1.46.0 - ISC
156
+ *
157
+ * This source code is licensed under the ISC license.
158
+ * See the LICENSE file in the root directory of this source tree.
159
+ */const ul={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
160
+ * @license lucide-react v1.46.0 - ISC
161
+ *
162
+ * This source code is licensed under the ISC license.
163
+ * See the LICENSE file in the root directory of this source tree.
164
+ */function Ey(t){return t!=null}function Yee(t,e={}){var m,v;const n=e.attributeNames??{},r=w=>n[w]??w,s=t.size??t.width??ul.width,i=t.size??t.height??ul.height,o=((m=t.aliases)==null?void 0:m.filter(w=>typeof w=="string"&&w.trim()!=="").map(w=>`lucide-${w}`))??[],l=[...t.name?[`lucide-${t.name}`]:[],...o],u=((v=e.className)==null?void 0:v.split(" ").filter(Boolean))??[],d=e.includeDefaultClasses===!1?$2(...u):$2("lucide",...l,...u),h=e.absoluteStrokeWidth?Number(e.strokeWidth??ul["stroke-width"])*Number(t.size??t.width??ul.width)/Number(e.size??e.width??ul.width):e.strokeWidth??ul["stroke-width"];return["svg",{...Object.entries(ul).reduce((w,[_,x])=>(w[r(_)]=x,w),{}),..."color"in e&&e.color&&{[r("stroke")]:e.color},..."size"in e&&Ey(e.size)&&{[r("width")]:e.size,[r("height")]:e.size},..."width"in e&&Ey(e.width)&&{[r("width")]:e.width},..."height"in e&&Ey(e.height)&&{[r("height")]:e.height},[r("stroke-width")]:h,...d&&{[r("class")]:d},[r("viewBox")]:`0 0 ${s} ${i}`,...e.hasA11yProp===!1?{[r("aria-hidden")]:"true"}:{},..."attributes"in e&&e.attributes},t.node.map(w=>{const[_,x,b]=w,k=e.nonScalingStroke?{[r("vector-effect")]:"non-scaling-stroke",...x}:x;return b?[_,k,b]:[_,k]})]}/**
165
+ * @license lucide-react v1.46.0 - ISC
166
+ *
167
+ * This source code is licensed under the ISC license.
168
+ * See the LICENSE file in the root directory of this source tree.
169
+ */function Xee(t,e={}){return Yee(t,{...e,attributeNames:{...e.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
170
+ * @license lucide-react v1.46.0 - ISC
171
+ *
172
+ * This source code is licensed under the ISC license.
173
+ * See the LICENSE file in the root directory of this source tree.
174
+ */const Qee=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},Jee=g.createContext({}),ete=()=>g.useContext(Jee),tte=g.forwardRef(({color:t,size:e,width:n,height:r,strokeWidth:s,absoluteStrokeWidth:i,nonScalingStroke:o,className:l="",children:u,iconNode:d=[],icon:h={node:d,aliases:[],size:24},...p},m)=>{const{size:v=24,strokeWidth:w=2,absoluteStrokeWidth:_=!1,nonScalingStroke:x=!1,color:b="currentColor",className:k=""}=ete()??{},C=!!u||Qee(p),[T,I,M=[]]=Xee(h,{color:t??b,width:n??e??v,height:r??e??v,strokeWidth:s??w,absoluteStrokeWidth:i??_,nonScalingStroke:o??x,className:$2(k,l),hasA11yProp:C,attributes:p});return g.createElement(T,{ref:m,...I},[...M.map(([R,A])=>g.createElement(R,A)),...Array.isArray(u)?u:[u]])});/**
175
+ * @license lucide-react v1.46.0 - ISC
176
+ *
177
+ * This source code is licensed under the ISC license.
178
+ * See the LICENSE file in the root directory of this source tree.
179
+ */function Je(t,e=[],n=[]){const r=typeof t=="string"?qee(t,e,n):t,s=g.forwardRef(({className:i,...o},l)=>g.createElement(tte,{ref:l,icon:r,className:i,...o}));return r.name&&(s.displayName=Kee(r.name)),s}/**
180
+ * @license lucide-react v1.46.0 - ISC
181
+ *
182
+ * This source code is licensed under the ISC license.
183
+ * See the LICENSE file in the root directory of this source tree.
184
+ */const dO={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};dO.node;const nte=Je(dO);/**
185
+ * @license lucide-react v1.46.0 - ISC
186
+ *
187
+ * This source code is licensed under the ISC license.
188
+ * See the LICENSE file in the root directory of this source tree.
189
+ */const fO={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};fO.node;const rte=Je(fO);/**
190
+ * @license lucide-react v1.46.0 - ISC
191
+ *
192
+ * This source code is licensed under the ISC license.
193
+ * See the LICENSE file in the root directory of this source tree.
194
+ */const hO={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};hO.node;const ste=Je(hO);/**
195
+ * @license lucide-react v1.46.0 - ISC
196
+ *
197
+ * This source code is licensed under the ISC license.
198
+ * See the LICENSE file in the root directory of this source tree.
199
+ */const pO={name:"bell",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]};pO.node;const ite=Je(pO);/**
200
+ * @license lucide-react v1.46.0 - ISC
201
+ *
202
+ * This source code is licensed under the ISC license.
203
+ * See the LICENSE file in the root directory of this source tree.
204
+ */const mO={name:"brain",size:24,node:[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]};mO.node;const ote=Je(mO);/**
205
+ * @license lucide-react v1.46.0 - ISC
206
+ *
207
+ * This source code is licensed under the ISC license.
208
+ * See the LICENSE file in the root directory of this source tree.
209
+ */const gO={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};gO.node;const ate=Je(gO);/**
210
+ * @license lucide-react v1.46.0 - ISC
211
+ *
212
+ * This source code is licensed under the ISC license.
213
+ * See the LICENSE file in the root directory of this source tree.
214
+ */const vO={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};vO.node;const lte=Je(vO);/**
215
+ * @license lucide-react v1.46.0 - ISC
216
+ *
217
+ * This source code is licensed under the ISC license.
218
+ * See the LICENSE file in the root directory of this source tree.
219
+ */const yO={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};yO.node;const cte=Je(yO);/**
220
+ * @license lucide-react v1.46.0 - ISC
221
+ *
222
+ * This source code is licensed under the ISC license.
223
+ * See the LICENSE file in the root directory of this source tree.
224
+ */const _O={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};_O.node;const ute=Je(_O);/**
225
+ * @license lucide-react v1.46.0 - ISC
226
+ *
227
+ * This source code is licensed under the ISC license.
228
+ * See the LICENSE file in the root directory of this source tree.
229
+ */const wO={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};wO.node;const dte=Je(wO);/**
230
+ * @license lucide-react v1.46.0 - ISC
231
+ *
232
+ * This source code is licensed under the ISC license.
233
+ * See the LICENSE file in the root directory of this source tree.
234
+ */const xO={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};xO.node;const fte=Je(xO);/**
235
+ * @license lucide-react v1.46.0 - ISC
236
+ *
237
+ * This source code is licensed under the ISC license.
238
+ * See the LICENSE file in the root directory of this source tree.
239
+ */const bO={name:"dot",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]};bO.node;const hte=Je(bO);/**
240
+ * @license lucide-react v1.46.0 - ISC
241
+ *
242
+ * This source code is licensed under the ISC license.
243
+ * See the LICENSE file in the root directory of this source tree.
244
+ */const SO={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};SO.node;const pte=Je(SO);/**
245
+ * @license lucide-react v1.46.0 - ISC
246
+ *
247
+ * This source code is licensed under the ISC license.
248
+ * See the LICENSE file in the root directory of this source tree.
249
+ */const EO={name:"heart",size:24,node:[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]};EO.node;const mte=Je(EO);/**
250
+ * @license lucide-react v1.46.0 - ISC
251
+ *
252
+ * This source code is licensed under the ISC license.
253
+ * See the LICENSE file in the root directory of this source tree.
254
+ */const kO={name:"house",size:24,node:[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],aliases:["home"]};kO.node;const gte=Je(kO);/**
255
+ * @license lucide-react v1.46.0 - ISC
256
+ *
257
+ * This source code is licensed under the ISC license.
258
+ * See the LICENSE file in the root directory of this source tree.
259
+ */const CO={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};CO.node;const vte=Je(CO);/**
260
+ * @license lucide-react v1.46.0 - ISC
261
+ *
262
+ * This source code is licensed under the ISC license.
263
+ * See the LICENSE file in the root directory of this source tree.
264
+ */const PO={name:"inbox",size:24,node:[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]};PO.node;const yte=Je(PO);/**
265
+ * @license lucide-react v1.46.0 - ISC
266
+ *
267
+ * This source code is licensed under the ISC license.
268
+ * See the LICENSE file in the root directory of this source tree.
269
+ */const TO={name:"lightbulb",size:24,node:[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]};TO.node;const _te=Je(TO);/**
270
+ * @license lucide-react v1.46.0 - ISC
271
+ *
272
+ * This source code is licensed under the ISC license.
273
+ * See the LICENSE file in the root directory of this source tree.
274
+ */const IO={name:"link",size:24,node:[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]};IO.node;const wte=Je(IO);/**
275
+ * @license lucide-react v1.46.0 - ISC
276
+ *
277
+ * This source code is licensed under the ISC license.
278
+ * See the LICENSE file in the root directory of this source tree.
279
+ */const AO={name:"loader",size:24,node:[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]};AO.node;const xte=Je(AO);/**
280
+ * @license lucide-react v1.46.0 - ISC
281
+ *
282
+ * This source code is licensed under the ISC license.
283
+ * See the LICENSE file in the root directory of this source tree.
284
+ */const RO={name:"lock",size:24,node:[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]};RO.node;const bte=Je(RO);/**
285
+ * @license lucide-react v1.46.0 - ISC
286
+ *
287
+ * This source code is licensed under the ISC license.
288
+ * See the LICENSE file in the root directory of this source tree.
289
+ */const MO={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};MO.node;const Ste=Je(MO);/**
290
+ * @license lucide-react v1.46.0 - ISC
291
+ *
292
+ * This source code is licensed under the ISC license.
293
+ * See the LICENSE file in the root directory of this source tree.
294
+ */const OO={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};OO.node;const Ete=Je(OO);/**
295
+ * @license lucide-react v1.46.0 - ISC
296
+ *
297
+ * This source code is licensed under the ISC license.
298
+ * See the LICENSE file in the root directory of this source tree.
299
+ */const LO={name:"message-circle",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]};LO.node;const kte=Je(LO);/**
300
+ * @license lucide-react v1.46.0 - ISC
301
+ *
302
+ * This source code is licensed under the ISC license.
303
+ * See the LICENSE file in the root directory of this source tree.
304
+ */const DO={name:"monitor",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]};DO.node;const Cte=Je(DO);/**
305
+ * @license lucide-react v1.46.0 - ISC
306
+ *
307
+ * This source code is licensed under the ISC license.
308
+ * See the LICENSE file in the root directory of this source tree.
309
+ */const NO={name:"moon",size:24,node:[["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"}]]};NO.node;const Pte=Je(NO);/**
310
+ * @license lucide-react v1.46.0 - ISC
311
+ *
312
+ * This source code is licensed under the ISC license.
313
+ * See the LICENSE file in the root directory of this source tree.
314
+ */const $O={name:"paintbrush",size:24,node:[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]]};$O.node;const Tte=Je($O);/**
315
+ * @license lucide-react v1.46.0 - ISC
316
+ *
317
+ * This source code is licensed under the ISC license.
318
+ * See the LICENSE file in the root directory of this source tree.
319
+ */const jO={name:"palette",size:24,node:[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]};jO.node;const Ite=Je(jO);/**
320
+ * @license lucide-react v1.46.0 - ISC
321
+ *
322
+ * This source code is licensed under the ISC license.
323
+ * See the LICENSE file in the root directory of this source tree.
324
+ */const FO={name:"pause",size:24,node:[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]};FO.node;const Ate=Je(FO);/**
325
+ * @license lucide-react v1.46.0 - ISC
326
+ *
327
+ * This source code is licensed under the ISC license.
328
+ * See the LICENSE file in the root directory of this source tree.
329
+ */const VO={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};VO.node;const Rte=Je(VO);/**
330
+ * @license lucide-react v1.46.0 - ISC
331
+ *
332
+ * This source code is licensed under the ISC license.
333
+ * See the LICENSE file in the root directory of this source tree.
334
+ */const HO={name:"pipette",size:24,node:[["path",{d:"m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12",key:"1y3wsu"}],["path",{d:"m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z",key:"110lr1"}],["path",{d:"m2 22 .414-.414",key:"jhxm08"}]]};HO.node;const Mte=Je(HO);/**
335
+ * @license lucide-react v1.46.0 - ISC
336
+ *
337
+ * This source code is licensed under the ISC license.
338
+ * See the LICENSE file in the root directory of this source tree.
339
+ */const zO={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};zO.node;const Ote=Je(zO);/**
340
+ * @license lucide-react v1.46.0 - ISC
341
+ *
342
+ * This source code is licensed under the ISC license.
343
+ * See the LICENSE file in the root directory of this source tree.
344
+ */const BO={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};BO.node;const Lte=Je(BO);/**
345
+ * @license lucide-react v1.46.0 - ISC
346
+ *
347
+ * This source code is licensed under the ISC license.
348
+ * See the LICENSE file in the root directory of this source tree.
349
+ */const UO={name:"rectangle-horizontal",size:24,node:[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]]};UO.node;const Dte=Je(UO);/**
350
+ * @license lucide-react v1.46.0 - ISC
351
+ *
352
+ * This source code is licensed under the ISC license.
353
+ * See the LICENSE file in the root directory of this source tree.
354
+ */const WO={name:"rocket",size:24,node:[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]};WO.node;const Nte=Je(WO);/**
355
+ * @license lucide-react v1.46.0 - ISC
356
+ *
357
+ * This source code is licensed under the ISC license.
358
+ * See the LICENSE file in the root directory of this source tree.
359
+ */const ZO={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};ZO.node;const $te=Je(ZO);/**
360
+ * @license lucide-react v1.46.0 - ISC
361
+ *
362
+ * This source code is licensed under the ISC license.
363
+ * See the LICENSE file in the root directory of this source tree.
364
+ */const qO={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};qO.node;const jte=Je(qO);/**
365
+ * @license lucide-react v1.46.0 - ISC
366
+ *
367
+ * This source code is licensed under the ISC license.
368
+ * See the LICENSE file in the root directory of this source tree.
369
+ */const GO={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};GO.node;const Fte=Je(GO);/**
370
+ * @license lucide-react v1.46.0 - ISC
371
+ *
372
+ * This source code is licensed under the ISC license.
373
+ * See the LICENSE file in the root directory of this source tree.
374
+ */const KO={name:"shield",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]};KO.node;const Vte=Je(KO);/**
375
+ * @license lucide-react v1.46.0 - ISC
376
+ *
377
+ * This source code is licensed under the ISC license.
378
+ * See the LICENSE file in the root directory of this source tree.
379
+ */const YO={name:"skip-forward",size:24,node:[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]]};YO.node;const Hte=Je(YO);/**
380
+ * @license lucide-react v1.46.0 - ISC
381
+ *
382
+ * This source code is licensed under the ISC license.
383
+ * See the LICENSE file in the root directory of this source tree.
384
+ */const XO={name:"square-library",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 7v10",key:"d5nglc"}],["path",{d:"M11 7v10",key:"pptsnr"}],["path",{d:"m15 7 2 10",key:"1m7qm5"}]],aliases:["library-square"]};XO.node;const zte=Je(XO);/**
385
+ * @license lucide-react v1.46.0 - ISC
386
+ *
387
+ * This source code is licensed under the ISC license.
388
+ * See the LICENSE file in the root directory of this source tree.
389
+ */const QO={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};QO.node;const Bte=Je(QO);/**
390
+ * @license lucide-react v1.46.0 - ISC
391
+ *
392
+ * This source code is licensed under the ISC license.
393
+ * See the LICENSE file in the root directory of this source tree.
394
+ */const JO={name:"sun",size:24,node:[["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"}]]};JO.node;const Ute=Je(JO);/**
395
+ * @license lucide-react v1.46.0 - ISC
396
+ *
397
+ * This source code is licensed under the ISC license.
398
+ * See the LICENSE file in the root directory of this source tree.
399
+ */const eL={name:"user",size:24,node:[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]};eL.node;const Wte=Je(eL);/**
400
+ * @license lucide-react v1.46.0 - ISC
401
+ *
402
+ * This source code is licensed under the ISC license.
403
+ * See the LICENSE file in the root directory of this source tree.
404
+ */const tL={name:"users",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};tL.node;const Zte=Je(tL);/**
405
+ * @license lucide-react v1.46.0 - ISC
406
+ *
407
+ * This source code is licensed under the ISC license.
408
+ * See the LICENSE file in the root directory of this source tree.
409
+ */const nL={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};nL.node;const qte=Je(nL),Gte={"chevron-right":cte,"chevron-down":lte,pipette:Mte,x:qte,copy:fte,menu:Ete,dot:hte,monitor:Cte,sun:Ute,moon:Pte,"rectangle-horizontal":Dte,circle:ute,"square-library":zte,clock:dte,star:Bte,settings:Fte,plus:Lte,"arrow-left":nte,"arrow-right":rte,"arrow-up":ste,search:jte,loader:xte,users:Zte,lock:bte,mail:Ste,bell:ite,shield:Vte,palette:Ite,lightbulb:_te,rocket:Nte,heart:mte,paintbrush:Tte,brain:ote,globe:pte,user:Wte,image:vte,link:wte,check:ate,"rotate-ccw":$te,play:Ote,pause:Ate,home:gte,"message-circle":kte,inbox:yte,pencil:Rte,"skip-forward":Hte},bC={lucide:Gte},rL=g.createContext(null);function Kte(t){const e=g.useContext(rL);return e?bC[e.iconLibrary][t]:bC.lucide[t]}function Yte({children:t,defaultLibrary:e="lucide"}){const[n,r]=g.useState(e),s=g.useCallback(i=>{r(i)},[]);return S.jsx(rL.Provider,{value:{iconLibrary:n,setIconLibrary:s},children:t})}const sL=g.createContext(null);function ob(){return g.useContext(sL)}const iL=g.createContext(null);function oL(){const t=g.useContext(iL);if(!t)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return t}const Xte=g.forwardRef((t,e)=>{const{children:n,type:r="single",className:s,...i}=t,o=g.useRef(null),l=g.useRef(new Map),[u,d]=g.useState(new Map),{activeIndex:h,setActiveIndex:p,itemRects:m,sessionRef:v,handlers:w,registerItem:_,measureItems:x}=oR(o),b=g.useCallback((fe,oe)=>{oe?l.current.set(fe,oe):l.current.delete(fe)},[]),k=g.useCallback(()=>{if(!o.current)return;const fe=new Map;l.current.forEach((oe,je)=>{fe.set(je,{top:oe.offsetTop,left:oe.offsetLeft,width:oe.offsetWidth,height:oe.offsetHeight})}),d(fe)},[]),[C,T]=g.useState(()=>r==="single"?t.defaultValue??"":""),[I,M]=g.useState(()=>r==="multiple"?t.defaultValue??[]:[]),R=t.onValueChange,A=t.onValueChange,L=t.value,N=new Set(r==="multiple"?t.value??I:(()=>{const fe=t.value??C;return fe?[fe]:[]})()),F=g.useCallback(fe=>{const oe=t;oe.onValueChange?oe.onValueChange(fe):T(fe)},[R]),j=g.useCallback(fe=>{const oe=t;oe.onValueChange?oe.onValueChange(fe):M(fe)},[A]),Q=g.useCallback(fe=>{if(r==="multiple"){const oe=t.value??I;j(oe.filter(je=>je!==fe))}else F("")},[r,F,j,I,L]);g.useEffect(()=>{x(),k()},[x,k,n]);const q=[...N].join(",");g.useEffect(()=>{x(),k()},[x,k,q]);const[Z,W]=g.useState(null),Y=h!==null?m[h]:null,V=Z!==null?m[Z]:null,J=h!==null&&!u.has(h),B=Ym(),{value:D,defaultValue:X,onValueChange:ce,collapsible:se,type:re,...de}=i,ye=r==="multiple"?{type:"multiple",value:t.value??I,onValueChange:j}:{type:"single",collapsible:t.collapsible??!0,value:t.value??C,onValueChange:F};return S.jsx(sL.Provider,{value:{registerItem:_,registerFullItem:b,activeIndex:h,grouped:!0,remeasure:()=>{x(),k()},openValues:N,openItemRects:u,toggleValue:Q},children:S.jsx(uO,{...ye,asChild:!0,children:S.jsxs("div",{ref:fe=>{o.current=fe,typeof e=="function"?e(fe):e&&(e.current=fe)},onMouseEnter:w.onMouseEnter,onMouseMove:fe=>{const oe=o.current;if(oe){const je=oe.getBoundingClientRect(),Ce=oe.offsetHeight,We=je.height,at=Ce>0?We/Ce:1,it=(fe.clientY-je.top)/at+oe.scrollTop;for(const[Ot,ht]of u){const De=m[Ot];if(!De)continue;const rt=De.top+De.height,Be=ht.top+ht.height;if(it>=rt&&it<=Be){p(null);return}}}w.onMouseMove(fe)},onMouseLeave:w.onMouseLeave,onFocus:fe=>{var je;const oe=(je=fe.target.closest("[data-proximity-index]"))==null?void 0:je.getAttribute("data-proximity-index");if(oe!=null){const Ce=Number(oe);p(Ce),W(fe.target.matches(":focus-visible")?Ce:null)}},onBlur:fe=>{var oe;(oe=o.current)!=null&&oe.contains(fe.relatedTarget)||(W(null),p(null))},className:jn("relative flex flex-col gap-0.5 w-72 max-w-full",s),...de,children:[S.jsx(us,{children:[...u.entries()].map(([fe,oe])=>S.jsx(ho.div,{className:`absolute ${B.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:!1,animate:{top:oe.top,left:oe.left,width:oe.width,height:oe.height,opacity:J?.7:1},exit:{opacity:0,transition:{duration:.12}},transition:{top:{duration:0},left:{duration:0},width:{duration:0},height:{duration:0},opacity:{duration:.08}}},`expanded-${fe}`))}),S.jsx(us,{children:Y&&S.jsx(ho.div,{className:`absolute ${B.bg} bg-hover pointer-events-none`,initial:{opacity:0,top:Y.top,left:Y.left,width:Y.width,height:Y.height},animate:{opacity:1,top:Y.top,left:Y.left,width:Y.width,height:Y.height},exit:{opacity:0,transition:{duration:.06}},transition:{...Tf.fast,opacity:{duration:.08}}},v.current)}),S.jsx(us,{children:V&&S.jsx(ho.div,{className:`absolute ${B.focusRing} pointer-events-none z-20 border border-[#6B97FF]`,initial:!1,animate:{left:V.left-2,top:V.top-2,width:V.width+4,height:V.height+4},exit:{opacity:0,transition:{duration:.06}},transition:{...Tf.fast,opacity:{duration:.08}}})}),n]})})})});Xte.displayName="AccordionGroup";const aL=g.forwardRef(({children:t,type:e="single",collapsible:n=!0,defaultValue:r,value:s,onValueChange:i,className:o,...l},u)=>{const[d,h]=g.useState(()=>e==="single"?r??"":""),[p,m]=g.useState(()=>e==="multiple"?r??[]:[]),v=new Set(e==="multiple"?s??p:(()=>{const k=s??d;return k?[k]:[]})()),w=g.useCallback(k=>{i?i(k):h(k)},[i]),_=g.useCallback(k=>{i?i(k):m(k)},[i]),x=g.useCallback(k=>{e==="multiple"?_((s??p).filter(T=>T!==k)):w("")},[e,s,p,w,_]),b=e==="multiple"?{type:"multiple",value:s??p,defaultValue:r,onValueChange:_}:{type:"single",collapsible:n,value:s??d,defaultValue:r,onValueChange:w};return S.jsx(uO,{...b,asChild:!0,children:S.jsx("div",{ref:u,className:jn("w-72 max-w-full flex flex-col gap-0.5",o),...l,children:S.jsx(lL.Provider,{value:v,children:S.jsx(cL.Provider,{value:x,children:t})})})})});aL.displayName="Accordion";const lL=g.createContext(new Set),cL=g.createContext(()=>{}),uL=g.forwardRef(({value:t,index:e,disabled:n,children:r,className:s,...i},o)=>{const l=g.useRef(null),u=ob(),d=g.useContext(lL),h=g.useContext(cL),p=Ym(),m=u!=null&&u.grouped?u.openValues.has(t):d.has(t),v=g.useRef(null),w=g.useCallback(()=>{u!=null&&u.grouped?u.toggleValue(t):h(t)},[u,h,t]);return g.useEffect(()=>{if(u!=null&&u.grouped&&e!==void 0)return u.registerItem(e,v.current),()=>u.registerItem(e,null)},[e,u]),g.useEffect(()=>{if(u!=null&&u.grouped&&e!==void 0)return m?u.registerFullItem(e,l.current):u.registerFullItem(e,null),()=>u.registerFullItem(e,null)},[e,u,m]),S.jsx(iL.Provider,{value:{index:e,value:t,isOpen:m,onToggle:w,triggerRef:v},children:S.jsxs(zee,{ref:_=>{l.current=_,typeof o=="function"?o(_):o&&(o.current=_)},value:t,disabled:n,"data-proximity-index":e,className:jn(!(u!=null&&u.grouped)&&"relative",s),...i,children:[!(u!=null&&u.grouped)&&S.jsx(us,{children:m&&S.jsx(ho.div,{className:`absolute inset-0 ${p.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.06}},transition:{duration:.08}})}),r]})})});uL.displayName="AccordionItem";const dL=g.forwardRef(({children:t,className:e,...n},r)=>{const s=Kte("chevron-right"),i=ob(),{index:o,isOpen:l,triggerRef:u}=oL(),d=Ym(),[h,p]=g.useState(!1),m=i!=null&&i.grouped?i.activeIndex===o:h,v=S.jsx(Bee,{asChild:!0,children:S.jsx("div",{children:S.jsxs(Uee,{ref:r,className:jn(`relative z-10 flex items-center gap-2.5 ${d.item} px-3 py-2 w-full cursor-pointer outline-none select-none`,!(i!=null&&i.grouped)&&"focus-visible:ring-1 focus-visible:ring-[#6B97FF] focus-visible:ring-offset-0",e),...n,children:[S.jsxs("span",{className:"inline-grid text-[13px] flex-1 text-left",children:[S.jsx("span",{className:"col-start-1 row-start-1 invisible",style:{fontVariationSettings:nf.semibold},"aria-hidden":"true",children:t}),S.jsx("span",{className:jn("col-start-1 row-start-1 transition-[color,font-variation-settings] duration-80",l||m?"text-foreground":"text-muted-foreground"),style:{fontVariationSettings:l?nf.semibold:nf.normal},children:t})]}),S.jsx(ho.span,{className:"shrink-0 inline-flex items-center justify-center",animate:{rotate:l?90:0},transition:Tf.fast,children:S.jsx(s,{size:16,strokeWidth:l||m?2:1.5,className:jn("transition-[color,stroke-width] duration-80",l||m?"text-foreground":"text-muted-foreground")})})]})})});return i!=null&&i.grouped?S.jsx("div",{ref:u,children:v}):S.jsxs("div",{className:"relative",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[S.jsx(us,{children:h&&S.jsx(ho.div,{className:`absolute inset-0 ${d.bg} bg-hover pointer-events-none`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.06}},transition:{duration:.08}})}),v]})});dL.displayName="AccordionTrigger";const fL=g.forwardRef(({children:t,className:e,...n},r)=>{const s=ob(),{isOpen:i}=oL();return S.jsx(us,{initial:!1,children:i&&S.jsx(Wee,{forceMount:!0,asChild:!0,...n,children:S.jsx(ho.div,{ref:r,className:jn("overflow-hidden",e),initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{...Tf.moderate,bounce:0},onUpdate:()=>{s==null||s.remeasure()},onAnimationComplete:()=>{s==null||s.remeasure()},children:S.jsx("div",{className:"px-3 pb-3 pt-1 text-[13px] text-muted-foreground",children:t})})})})});fL.displayName="AccordionContent";const T0=({children:t,defaultValue:e=[],className:n=""})=>S.jsx(aL,{type:"multiple",defaultValue:e,className:jn("w-full",n),children:t}),Qte=({value:t,title:e,description:n,dataCy:r,icon:s,children:i,className:o=""})=>{const l=o.includes("first-item");return S.jsxs(uL,{value:t,className:jn("w-full",!l&&"border-t border-main-border"),children:[S.jsxs(dL,{"data-cy":r,children:[s?S.jsx("span",{className:"mr-1 inline-flex items-center",children:s}):null,e]}),S.jsxs(fL,{children:[n?S.jsx("p",{className:"pb-2 text-sm text-content-subtle",children:n}):null,i]})]})};T0.Item=Qte;const Jte=({message:t,isLoading:e=!0})=>S.jsxs("div",{className:"flex items-center gap-2 text-sm text-content",children:[e?S.jsx(Gm,{className:"h-4 w-4 shrink-0 animate-spin text-primary",weight:"bold"}):null,S.jsx("span",{className:"whitespace-pre-wrap font-sans",children:t})]}),ene=()=>{const t=g.useRef(Date.now()),[e,n]=g.useState(0);return g.useEffect(()=>{const r=()=>n(Math.max(0,Math.floor((Date.now()-t.current)/1e3)));r();const s=setInterval(r,1e3);return()=>clearInterval(s)},[]),e},tne=t=>{const e=Math.floor(t/60),n=t%60;return`${e}:${n.toString().padStart(2,"0")}`},SC="M 12 8 C 14.21 8 16 9.79 16 12 C 16 14.21 14.21 16 12 16 C 9.79 16 8 14.21 8 12 C 8 9.79 9.79 8 12 8 Z",EC="M 12 12 C 14 8.5 19 8.5 19 12 C 19 15.5 14 15.5 12 12 C 10 8.5 5 8.5 5 12 C 5 15.5 10 15.5 12 12 Z",nne="M 12 16 C 14.21 16 16 14.21 16 12 C 16 9.79 14.21 8 12 8 C 9.79 8 8 9.79 8 12 C 8 14.21 9.79 16 12 16 Z",I0=["Applying","Thinking","Planning","Crafting"],rne=I0.reduce((t,e)=>t.length>=e.length?t:e),sne=20,ine="Still working — runs can take a few minutes.",one=({hint:t,showElapsed:e=!0})=>{const[n,r]=g.useState(0),s=ene();g.useEffect(()=>{const o=setInterval(()=>{r(l=>(l+1)%I0.length)},4e3);return()=>clearInterval(o)},[]);const i=t??(e&&s>=sne?ine:null);return S.jsxs("div",{role:"status",className:"flex items-center gap-2 px-3 py-1","data-cy":"thinking-indicator",children:[S.jsx(ni.svg,{"aria-hidden":!0,width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0 text-muted-foreground",children:S.jsx(ni.path,{animate:{d:[SC,EC,nne,EC,SC]},transition:{d:{duration:6,ease:"easeInOut",repeat:1/0,times:[0,.25,.5,.75,1]}}})}),S.jsxs("span",{className:"inline-grid overflow-hidden text-sm font-medium",style:{fontVariationSettings:nf.medium},children:[S.jsx("span",{className:"shimmer-text invisible col-start-1 row-start-1","aria-hidden":"true",children:rne}),S.jsx(us,{mode:"popLayout",initial:!1,children:S.jsx(ni.span,{className:"shimmer-text col-start-1 row-start-1",initial:{y:"80%",opacity:0},animate:{y:0,opacity:1,transition:{duration:.24,ease:[.4,0,.2,1]}},exit:{y:"-80%",opacity:0,transition:{duration:.16,ease:[.4,0,.2,1]}},children:I0[n]},I0[n])})]}),e?S.jsx("span",{className:"text-xs tabular-nums text-content-subtle","data-cy":"thinking-elapsed",children:tne(s)}):null,i?S.jsx("span",{className:"text-xs text-content-subtle",children:i}):null]})};var ane=Object.defineProperty,lne=(t,e)=>ane(t,"name",{value:e,configurable:!0});function ab(t,[e,n]){return Math.min(n,Math.max(e,t))}lne(ab,"clamp");var cne=Object.defineProperty,une=(t,e)=>cne(t,"name",{value:e,configurable:!0});function hL(t){const e=g.useRef({value:t,previous:t});return g.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}une(hL,"usePrevious");var dne=Object.defineProperty,kt=(t,e)=>dne(t,"name",{value:e,configurable:!0}),pL=["PageUp","PageDown"],mL=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],gL={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},lh="Slider",[j2,fne,hne]=Xx(lh),[lb,nre]=Di(lh,[hne]),[pne,ch]=lb(lh),mne=g.forwardRef(kt(function(e,n){const{name:r,min:s=0,max:i=100,step:o=1,orientation:l="horizontal",disabled:u=!1,minStepsBetweenThumbs:d=0,defaultValue:h=[s],value:p,onValueChange:m=kt(()=>{},"onValueChange"),onValueCommit:v=kt(()=>{},"onValueCommit"),inverted:w=!1,form:_,...x}=e,b=g.useRef(new Set),k=g.useRef(0),C=g.useRef(!1),I=l==="horizontal"?gne:vne,[M,R]=g.useState(null),A=Zt(n,R),[L=[],N]=Ca({prop:p,defaultProp:h,onChange:kt(Y=>{var J;(J=[...b.current][k.current])==null||J.focus({preventScroll:!0,focusVisible:C.current}),C.current=!1,m(Y)},"onChange")}),F=g.useRef(L),j=g.useRef(L);g.useEffect(()=>{const Y=_?M==null?void 0:M.ownerDocument.getElementById(_):M==null?void 0:M.closest("form");if(Y instanceof HTMLFormElement){const V=kt(()=>N(j.current),"reset");return Y.addEventListener("reset",V),()=>Y.removeEventListener("reset",V)}},[M,_,N]);function Q(Y){const V=EL(L,Y);W(Y,V)}kt(Q,"handleSlideStart");function q(Y){W(Y,k.current)}kt(q,"handleSlideMove");function Z(){String(L)!==String(F.current)&&v(L)}kt(Z,"handleSlideEnd");function W(Y,V,{commit:J}={commit:!1}){const B=ub(o),D=lf(Math.round((Y-s)/o)*o+s,B),X=ab(D,[s,i]);N((ce=[])=>{const se=bL(ce,X,V);if(PL(se,d*o)){k.current=se.indexOf(X);const re=String(se)!==String(ce);return re&&J&&v(se),re?se:ce}else return ce})}return kt(W,"updateValues"),S.jsx(pne,{scope:e.__scopeSlider,name:r,disabled:u,min:s,max:i,valueIndexToChangeRef:k,thumbs:b.current,values:L,orientation:l,form:_,children:S.jsx(j2.Provider,{scope:e.__scopeSlider,children:S.jsx(j2.Slot,{scope:e.__scopeSlider,children:S.jsx(I,{"aria-disabled":u,"data-disabled":u?"":void 0,...x,ref:A,onPointerDown:Ut(x.onPointerDown,()=>{u||(F.current=L,C.current=!1)}),min:s,max:i,inverted:w,onSlideStart:u?void 0:Q,onSlideMove:u?void 0:q,onSlideEnd:u?void 0:Z,onHomeKeyDown:()=>{u||(C.current=!0,W(s,0,{commit:!0}))},onEndKeyDown:()=>{u||(C.current=!0,W(i,L.length-1,{commit:!0}))},onStepKeyDown:({event:Y,direction:V})=>{if(!u){C.current=!0;const D=pL.includes(Y.key)||Y.shiftKey&&mL.includes(Y.key)?10:1,X=k.current,ce=L[X],se=TL(ce,{min:s,step:o,direction:V,multiplier:D});W(se,X,{commit:!0})}}})})})})},"Slider")),[vL,yL]=lb(lh,{startEdge:"left",endEdge:"right",size:"width",direction:1}),gne=g.forwardRef(kt(function(e,n){const{min:r,max:s,dir:i,inverted:o,onSlideStart:l,onSlideMove:u,onSlideEnd:d,onStepKeyDown:h,...p}=e,[m,v]=g.useState(null),w=Zt(n,v),_=g.useRef(void 0),x=tb(i),b=x==="ltr",k=b&&!o||!b&&o;function C(T){const I=_.current||m.getBoundingClientRect(),M=[0,I.width],A=sg(M,k?[r,s]:[s,r]);return _.current=I,A(T-I.left)}return kt(C,"getValueFromPointer"),S.jsx(vL,{scope:e.__scopeSlider,startEdge:k?"left":"right",endEdge:k?"right":"left",direction:k?1:-1,size:"width",children:S.jsx(_L,{dir:x,"data-orientation":"horizontal",...p,ref:w,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:T=>{const I=C(T.clientX);l==null||l(I)},onSlideMove:T=>{const I=C(T.clientX);u==null||u(I)},onSlideEnd:()=>{_.current=void 0,d==null||d()},onStepKeyDown:T=>{const M=gL[k?"from-left":"from-right"].includes(T.key);h==null||h({event:T,direction:M?-1:1})}})})},"SliderHorizontal")),vne=g.forwardRef(kt(function(e,n){const{min:r,max:s,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:u,onStepKeyDown:d,...h}=e,p=g.useRef(null),m=Zt(n,p),v=g.useRef(void 0),w=!i;function _(x){const b=v.current||p.current.getBoundingClientRect(),k=[0,b.height],T=sg(k,w?[s,r]:[r,s]);return v.current=b,T(x-b.top)}return kt(_,"getValueFromPointer"),S.jsx(vL,{scope:e.__scopeSlider,startEdge:w?"bottom":"top",endEdge:w?"top":"bottom",size:"height",direction:w?1:-1,children:S.jsx(_L,{"data-orientation":"vertical",...h,ref:m,style:{...h.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:x=>{const b=_(x.clientY);o==null||o(b)},onSlideMove:x=>{const b=_(x.clientY);l==null||l(b)},onSlideEnd:()=>{v.current=void 0,u==null||u()},onStepKeyDown:x=>{const k=gL[w?"from-bottom":"from-top"].includes(x.key);d==null||d({event:x,direction:k?-1:1})}})})},"SliderVertical")),_L=g.forwardRef(kt(function(e,n){const{__scopeSlider:r,onSlideStart:s,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:u,onStepKeyDown:d,...h}=e,p=ch(lh,r);return S.jsx(_n.span,{...h,ref:n,onKeyDown:Ut(e.onKeyDown,m=>{m.key==="Home"?(l(m),m.preventDefault()):m.key==="End"?(u(m),m.preventDefault()):pL.concat(mL).includes(m.key)&&(d(m),m.preventDefault())}),onPointerDown:Ut(e.onPointerDown,m=>{const v=m.target;v.setPointerCapture(m.pointerId),m.preventDefault(),p.thumbs.has(v)?v.focus({preventScroll:!0,focusVisible:!1}):s(m)}),onPointerMove:Ut(e.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&i(m)}),onPointerUp:Ut(e.onPointerUp,m=>{const v=m.target;v.hasPointerCapture(m.pointerId)&&(v.releasePointerCapture(m.pointerId),o(m))})})},"SliderImpl")),yne="SliderTrack",_ne=g.forwardRef(kt(function(e,n){const{__scopeSlider:r,...s}=e,i=ch(yne,r);return S.jsx(_n.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...s,ref:n})},"SliderTrack")),kC="SliderRange",wne=g.forwardRef(kt(function(e,n){const{__scopeSlider:r,...s}=e,i=ch(kC,r),o=yL(kC,r),l=g.useRef(null),u=Zt(n,l),d=i.values.length,h=i.values.map(v=>cb(v,i.min,i.max)),p=d>1?Math.min(...h):0,m=100-Math.max(...h);return S.jsx(_n.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...s,ref:u,style:{...e.style,[o.startEdge]:p+"%",[o.endEdge]:m+"%"}})},"SliderRange")),xne="SliderThumb",[bne,wL]=lb(xne),Sne="SliderThumbProvider";function xL(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:s}=t,i=ch(Sne,e),o=fne(e),[l,u]=g.useState(null),d=g.useMemo(()=>l?o().findIndex(x=>x.ref.current===l):-1,[o,l]),h=px(l),p=l?!!i.form||!!l.closest("form"):!0,m=i.values[d],v=n??(i.name?i.name+(i.values.length>1?"[]":""):void 0),w=m===void 0?0:cb(m,i.min,i.max);g.useEffect(()=>{if(l)return i.thumbs.add(l),()=>{i.thumbs.delete(l)}},[l,i.thumbs]);const _={value:m,name:v,form:i.form,isFormControl:p,index:d,thumb:l,onThumbChange:u,percent:w,size:h};return S.jsx(bne,{scope:e,..._,children:IL(s)?s(_):r})}kt(xL,"SliderThumbProvider");var ky="SliderThumbTrigger",Ene=g.forwardRef(kt(function(e,n){const{__scopeSlider:r,...s}=e,i=ch(ky,r),o=yL(ky,r),{index:l,value:u,percent:d,size:h,onThumbChange:p}=wL(ky,r),m=Zt(n,p),v=SL(l,i.values.length),w=h==null?void 0:h[o.size],_=w?kL(w,d,o.direction):0;return S.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[o.startEdge]:`calc(${d}% + ${_}px)`},children:S.jsx(j2.ItemSlot,{scope:r,children:S.jsx(_n.span,{role:"slider","aria-label":e["aria-label"]||v,"aria-valuemin":i.min,"aria-valuenow":u,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...s,ref:m,style:u===void 0?{display:"none"}:e.style,onFocus:Ut(e.onFocus,()=>{i.valueIndexToChangeRef.current=l})})})})},"SliderThumbTrigger")),kne=g.forwardRef(kt(function(e,n){const{__scopeSlider:r,name:s,...i}=e;return S.jsx(xL,{__scopeSlider:r,name:s,internal_do_not_use_render:({index:o,isFormControl:l})=>S.jsxs(S.Fragment,{children:[S.jsx(Ene,{...i,ref:n,__scopeSlider:r}),l?S.jsx(Pne,{__scopeSlider:r},o):null]})})},"SliderThumb")),Cne="SliderBubbleInput",Pne=g.forwardRef(kt(function({__scopeSlider:e,...n},r){const{value:s,name:i,form:o}=wL(Cne,e),l=g.useRef(null),u=Zt(l,r),d=hL(s);return g.useEffect(()=>{const h=l.current;if(!h)return;const p=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(p,"value").set;if(d!==s&&v){const w=new Event("input",{bubbles:!0});v.call(h,s),h.dispatchEvent(w)}},[d,s]),S.jsx(_n.input,{style:{display:"none"},name:i,form:o,...n,ref:u,defaultValue:s})},"SliderBubbleInput"));function bL(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}kt(bL,"getNextSortedValues");function cb(t,e,n){const i=100/(n-e)*(t-e);return ab(i,[0,100])}kt(cb,"convertValueToPercentage");function SL(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}kt(SL,"getLabel");function EL(t,e){if(t.length===1)return 0;const n=t.map(s=>Math.abs(s-e)),r=Math.min(...n);return n.indexOf(r)}kt(EL,"getClosestValueIndex");function kL(t,e,n){const r=t/2,i=sg([0,50],[0,r]);return(r-i(e)*n)*n}kt(kL,"getThumbInBoundsOffset");function CL(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}kt(CL,"getStepsBetweenValues");function PL(t,e){if(e>0){const n=CL(t);return Math.min(...n)>=e}return!0}kt(PL,"hasMinStepsBetweenValues");function sg(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}kt(sg,"linearScale");function ub(t){if(!Number.isFinite(t))return 0;const e=t.toString();if(e.includes("e")){const[r,s]=e.split("e"),i=r.split(".")[1]||"",o=Number(s);return Math.max(0,i.length-o)}const n=e.split(".")[1];return n?n.length:0}kt(ub,"getDecimalCount");function lf(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}kt(lf,"roundValue");function TL(t,{min:e,step:n,direction:r,multiplier:s}){const i=ub(n),o=(t-e)/n,l=Math.round(o),u=lf(l*n+e,i)===lf(t,i);let d;return u?d=l+s*r:r>0?d=Math.ceil(o):d=Math.floor(o),lf(d*n+e,i)}kt(TL,"getNextStepValue");function IL(t){return typeof t=="function"}kt(IL,"isFunction");const F2=g.forwardRef(({className:t,...e},n)=>S.jsxs(mne,{ref:n,className:jn("relative flex w-full touch-none select-none items-center","data-[disabled]:opacity-50",t),...e,children:[S.jsx(_ne,{className:"relative h-1 w-full grow overflow-hidden rounded-full bg-input",children:S.jsx(wne,{className:"absolute h-full bg-primary"})}),S.jsx(kne,{className:jn("block h-3.5 w-3.5 rounded-full border border-border bg-foreground shadow-sm","transition-transform hover:scale-110 active:scale-95","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#6B97FF]","disabled:pointer-events-none")})]}));F2.displayName="Slider";const Tne=[{name:"surface-1",utility:"bg-surface-1",className:"bg-surface-1"},{name:"surface-2",utility:"bg-surface-2",className:"bg-surface-2"},{name:"surface-3",utility:"bg-surface-3",className:"bg-surface-3"},{name:"surface-4",utility:"bg-surface-4",className:"bg-surface-4"},{name:"surface-5",utility:"bg-surface-5",className:"bg-surface-5"},{name:"surface-6",utility:"bg-surface-6",className:"bg-surface-6"}],Ine=[{name:"primary",utility:"bg-primary",className:"bg-primary"},{name:"selected",utility:"bg-selected",className:"bg-selected"},{name:"accent",utility:"bg-accent",className:"bg-accent"},{name:"success",utility:"bg-accent-success",className:"bg-accent-success"},{name:"warning",utility:"bg-accent-warning",className:"bg-accent-warning"},{name:"error",utility:"bg-accent-error",className:"bg-accent-error"}],Ane=[{name:"gap-1",className:"w-1"},{name:"gap-2",className:"w-2"},{name:"gap-3",className:"w-3"},{name:"gap-4",className:"w-4"},{name:"gap-6",className:"w-6"},{name:"gap-8",className:"w-8"}],Jp=[{name:"Accordion",path:"components/Accordion.tsx",status:"showcased",note:"Reusable primitive shown with local item composition."},{name:"AgentVariantsPanel",path:"components/AgentVariantsPanel.tsx",status:"feature-only",note:"Requires live variant session state and editor atoms."},{name:"AuthProgressScreen",path:"components/AuthProgressScreen.tsx",status:"feature-only",note:"Auth flow surface; represented through progress treatment."},{name:"AuthScreenView",path:"components/AuthScreenView.tsx",status:"feature-only",note:"Auth flow surface that depends on sign-in actions."},{name:"Button",path:"components/Button.tsx",status:"showcased",note:"Reusable tooltip-wrapped button shown in multiple states."},{name:"CommentCarouselLayer",path:"components/CommentCarouselLayer.tsx",status:"feature-only",note:"Preview overlay layer tied to iframe geometry."},{name:"CommentMarker",path:"components/CommentMarker.tsx",status:"feature-only",note:"Preview overlay marker tied to comment positions."},{name:"CommentMarkerLayer",path:"components/CommentMarkerLayer.tsx",status:"feature-only",note:"Preview overlay layer tied to comment collections."},{name:"CommentPopover",path:"components/CommentPopover.tsx",status:"feature-only",note:"Comment workflow popover tied to editor state."},{name:"CommentReferenceChip",path:"components/CommentReferenceChip.tsx",status:"feature-only",note:"Comment workflow chip tied to selected references."},{name:"CommentReferencePicker",path:"components/CommentReferencePicker.tsx",status:"feature-only",note:"Comment workflow picker tied to preview elements."},{name:"ElementInspector",path:"components/ElementInspector.tsx",status:"feature-only",note:"Primary editor surface with many app-level dependencies."},{name:"GitHome",path:"components/GitHome.tsx",status:"feature-only",note:"Git dashboard tied to repository state."},{name:"IframePreview",path:"components/IframePreview.tsx",status:"unsuitable",note:"Needs live iframe target and cross-window integration."},{name:"PreviewFrame",path:"components/PreviewFrame.tsx",status:"unsuitable",note:"Requires proxied app URL and iframe lifecycle."},{name:"PreviewSurface",path:"components/PreviewSurface.tsx",status:"unsuitable",note:"Requires preview iframe and overlay orchestration."},{name:"ProfileAvatar",path:"components/ProfileAvatar.tsx",status:"feature-only",note:"Account chrome tied to user identity data."},{name:"Progress",path:"components/Progress.tsx",status:"showcased",note:"Reusable inline loading/status primitive."},{name:"SecondaryVariantIframe",path:"components/SecondaryVariantIframe.tsx",status:"unsuitable",note:"Requires variant preview iframe lifecycle."},{name:"SparkleLoader",path:"components/SparkleLoader.tsx",status:"showcased",note:"Reusable loading animation shown in feedback states."},{name:"SplitButton",path:"components/SplitButton.tsx",status:"showcased",note:"Reusable compound action button shown with dropdown."},{name:"StatusSurface",path:"components/StatusSurface.tsx",status:"showcased",note:"Unified full-surface primitive: LoadingSurface / EmptyState / ErrorState."},{name:"SupportTicketModal",path:"components/SupportTicketModal.tsx",status:"feature-only",note:"Support workflow modal tied to form submission."},{name:"ThinkingIndicator",path:"components/ThinkingIndicator.tsx",status:"showcased",note:"Reusable thinking/loading indicator shown in feedback states."},{name:"Tooltip",path:"components/Tooltip.tsx",status:"showcased",note:"Reusable tooltip API shown with hover target."},{name:"VariantDragGhost",path:"components/VariantDragGhost.tsx",status:"feature-only",note:"Drag visual tied to variant split interactions."},{name:"VariantSplitDropZones",path:"components/VariantSplitDropZones.tsx",status:"feature-only",note:"Drop-zone visual tied to variant split interactions."},{name:"ui/accordion",path:"components/ui/accordion.tsx",status:"showcased",note:"Radix accordion primitive backing the local Accordion showcase."},{name:"ui/slider",path:"components/ui/slider.tsx",status:"showcased",note:"Radix slider primitive shown in enabled and disabled states."},{name:"ui/tooltip",path:"components/ui/tooltip.tsx",status:"showcased",note:"Radix tooltip primitive shown with forced-open preview."}],Rne=()=>{window.location.hash=""},Xi=({title:t,eyebrow:e,description:n,children:r})=>S.jsxs("section",{className:"border-border bg-card shadow-surface-3 rounded-2xl border p-5",children:[S.jsxs("div",{className:"mb-5 max-w-2xl",children:[S.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.18em] uppercase",children:e}),S.jsx("h2",{className:"text-foreground mt-2 text-xl font-semibold",children:t}),S.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:n})]}),r]}),CC=({swatches:t})=>S.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map(e=>S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-3",children:[S.jsx("div",{className:`h-16 rounded-lg ${e.className}`}),S.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3",children:[S.jsx("span",{className:"text-foreground text-sm font-medium",children:e.name}),S.jsx("code",{className:"bg-muted text-muted-foreground rounded px-2 py-1 text-xs",children:e.utility})]})]},e.name))}),Mne=t=>t==="showcased"?"border-accent-success/40 bg-accent-success/10 text-accent-success":t==="cataloged"?"border-primary/40 bg-primary/10 text-primary":t==="generated"?"border-accent/40 bg-accent/10 text-accent":t==="unsuitable"?"border-accent-warning/40 bg-accent-warning/10 text-accent-warning":"border-border bg-surface-4 text-content-muted",One=()=>{const t=Jp.filter(n=>n.status==="showcased").length,e=Jp.filter(n=>n.status==="cataloged").length;return S.jsx("main",{className:"bg-main font-main text-content h-screen overflow-y-auto",children:S.jsxs("div",{className:"mx-auto flex w-full max-w-6xl flex-col gap-6 px-6 py-6 lg:px-8",children:[S.jsxs("header",{className:"border-border bg-surface-2 shadow-surface-4 rounded-3xl border p-6",children:[S.jsxs("button",{type:"button",onClick:Rne,className:"text-content-subtle hover:text-content mb-6 inline-flex items-center gap-2 text-sm transition-colors",children:[S.jsx(cG,{className:"h-4 w-4",weight:"bold"}),"Back to editor"]}),S.jsxs("div",{className:"flex flex-col gap-5 lg:flex-row lg:items-end lg:justify-between",children:[S.jsxs("div",{className:"max-w-3xl",children:[S.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.22em] uppercase",children:"Local component gallery"}),S.jsx("h1",{className:"text-foreground mt-3 text-4xl font-semibold tracking-tight",children:"Rivet design system"}),S.jsx("p",{className:"text-muted-foreground mt-3 text-base leading-7",children:"A Storybook-like route for checking the current UI primitives, tokens, and interaction states inside the Vite app."})]}),S.jsx("div",{className:"border-border bg-surface-3 rounded-2xl border p-4",children:S.jsxs("div",{className:"text-content-muted flex items-center gap-3 text-sm",children:[S.jsx(VA,{className:"text-primary h-5 w-5",weight:"bold"}),"Open with ",S.jsx("code",{className:"text-content",children:"#/design-system"})]})})]})]}),S.jsx(Xi,{eyebrow:"Controls",title:"Button, split button, and tooltip",description:"The gallery uses Rivet's tooltip-wrapped button, compound split button, and the lower-level Radix tooltip wrapper so the reusable control APIs are visible.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-[1fr_1fr]",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Rivet Button wrapper"}),S.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[S.jsx(qc,{title:"Primary action",shortcut:"D",className:"bg-primary text-primary-foreground hover:bg-primary-hover rounded-lg px-4 py-2 text-sm font-medium transition-colors",children:"Design action"}),S.jsx(qc,{title:"Secondary action",className:"border-border bg-surface-4 text-content hover:bg-surface-5 rounded-lg border px-4 py-2 text-sm font-medium transition-colors",children:"Secondary"}),S.jsx(qc,{title:"Disabled action",disabled:!0,className:"border-border bg-muted text-muted-foreground rounded-lg border px-4 py-2 text-sm font-medium opacity-60",children:"Disabled"}),S.jsx(ER,{primaryLabel:"Ship",primaryIcon:ey,primaryAction:()=>{},dropdownItems:[{label:"Create PR",onClick:()=>{}},{label:"Copy branch",onClick:()=>{}}]})]})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Tooltip states"}),S.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[S.jsx(Hl,{label:"Rivet tooltip API",side:"bottom",children:S.jsx("button",{className:"border-border bg-surface-4 text-content rounded-lg border px-4 py-2 text-sm",children:"Hover target"})}),S.jsx(Ix,{content:"Forced open preview",forceOpen:!0,side:"right",children:S.jsx("button",{className:"bg-selected text-content rounded-lg px-4 py-2 text-sm",children:"UI tooltip"})})]})]})]})}),S.jsx(Xi,{eyebrow:"Tokens",title:"Surface ladder",description:"Surface tokens move from the base app background toward raised panels without leaving the dark Rivet palette.",children:S.jsx(CC,{swatches:Tne})}),S.jsx(Xi,{eyebrow:"Tokens",title:"Color roles",description:"Named roles should communicate purpose: brand, selection, neutral accent, and outcome colors.",children:S.jsx(CC,{swatches:Ine})}),S.jsx(Xi,{eyebrow:"Type",title:"Typography",description:"Satoshi remains the default UI voice with clear hierarchy and muted support text.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-primary text-xs tracking-[0.18em] uppercase",children:"Display"}),S.jsx("p",{className:"text-foreground mt-2 text-3xl font-semibold tracking-tight",children:"Visual edits, quickly"})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground text-sm font-semibold",children:"Panel heading"}),S.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:"Body copy uses compact line height and muted contrast for dense inspector panels."})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs font-medium tracking-[0.16em] uppercase",children:"Micro label"}),S.jsx("code",{className:"bg-muted text-muted-foreground mt-3 block rounded-lg px-3 py-2 text-xs",children:"font-main text-content"})]})]})}),S.jsx(Xi,{eyebrow:"Layout",title:"Spacing rhythm",description:"A compact spacing scale keeps editor chrome dense while preserving scannable groupings.",children:S.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:S.jsx("div",{className:"flex flex-col gap-3",children:Ane.map(n=>S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx("code",{className:"text-muted-foreground w-16 text-xs",children:n.name}),S.jsx("div",{className:`${n.className} bg-primary h-4 rounded`}),S.jsx("div",{className:"bg-border h-px flex-1"})]},n.name))})})}),S.jsx(Xi,{eyebrow:"Primitives",title:"Accordion and slider",description:"Representative Radix primitives styled through the local component layer.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[S.jsxs(T0,{defaultValue:["foundations"],className:"border-border bg-surface-2 rounded-xl border p-2",children:[S.jsx(T0.Item,{value:"foundations",title:"Foundations",description:"Tokens, surfaces, type, and spacing.",className:"first-item",icon:S.jsx(ey,{className:"text-primary h-4 w-4"}),children:S.jsx("p",{children:"Use these pieces before adding one-off visual rules."})}),S.jsx(T0.Item,{value:"components",title:"Components",description:"Buttons, tooltips, accordions, sliders.",children:S.jsx("p",{children:"Keep states visible in this route as the system evolves."})})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-5",children:[S.jsx("p",{className:"text-foreground mb-5 text-sm font-medium",children:"Slider states"}),S.jsxs("div",{className:"space-y-6",children:[S.jsx(F2,{defaultValue:[64],max:100,step:1}),S.jsx(F2,{defaultValue:[36],max:100,step:1,disabled:!0})]})]})]})}),S.jsx(Xi,{eyebrow:"Feedback",title:"Motion and loading",description:"Loading states use existing CSS animation utilities and avoid per-frame React work where possible.",children:S.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Progress"}),S.jsx(Jte,{message:"Applying visual change..."})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Sparkle strip"}),S.jsx(kx,{className:"text-primary text-xl"})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Shimmer text"}),S.jsx("span",{className:"shimmer-text text-sm font-medium",children:"Generating variants"})]}),S.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4 sm:col-span-3",children:S.jsx(one,{hint:"Reading selected elements"})})]})}),S.jsx(Xi,{eyebrow:"Feedback",title:"Status surfaces",description:"The unified full-surface system: one StatusSurface primitive with LoadingSurface / EmptyState / ErrorState wrappers. Every full-page loading, empty, and error state routes through these so they share layout, copy tone, and a single status_surface_shown impression event. Inline loaders (Sparkle, ThinkingIndicator, above) stay inline and are deliberately not part of this system.",children:S.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(_2,{fill:"surface",loader:"coalesce",trackGlobalLoaderCount:!1})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(nM,{icon:S.jsx(ey,{size:32}),title:"Nothing to preview yet",description:"Pick a direction from the panel."})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(Rx,{fill:"surface",size:"sm",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>{}}]})})]})}),S.jsxs(Xi,{eyebrow:"Inventory",title:"Component coverage",description:"Every current component file is accounted for here. Reusable primitives are rendered above; app surfaces that need live editor, git, auth, iframe, or generated state are cataloged instead of mounted unsafely.",children:[S.jsxs("div",{className:"mb-4 grid gap-3 sm:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Total components"}),S.jsx("p",{className:"text-foreground mt-2 text-2xl font-semibold",children:Jp.length})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Showcased"}),S.jsx("p",{className:"text-accent-success mt-2 text-2xl font-semibold",children:t})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Cataloged"}),S.jsx("p",{className:"text-primary mt-2 text-2xl font-semibold",children:e})]})]}),S.jsxs("div",{className:"border-border overflow-hidden rounded-xl border",children:[S.jsxs("div",{className:"border-border bg-surface-3 text-content-subtle grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] border-b px-4 py-3 text-xs font-semibold tracking-[0.14em] uppercase",children:[S.jsx("span",{children:"Component"}),S.jsx("span",{children:"Status"}),S.jsx("span",{children:"Coverage note"})]}),S.jsx("div",{className:"divide-border bg-surface-2 divide-y",children:Jp.map(n=>S.jsxs("div",{className:"grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] gap-3 px-4 py-3 text-sm",children:[S.jsxs("div",{children:[S.jsx("p",{className:"text-foreground font-medium",children:n.name}),S.jsx("code",{className:"text-muted-foreground text-xs",children:n.path})]}),S.jsx("div",{children:S.jsx("span",{className:`inline-flex rounded-full border px-2 py-1 text-xs font-medium ${Mne(n.status)}`,children:n.status})}),S.jsx("p",{className:"text-muted-foreground",children:n.note})]},n.path))})]})]})]})})},Lne=t=>(t.startsWith("#/")?t.slice(2):t.slice(1)).split("?")[0]==="design-system"?"design-system":"editor",Dne=t=>{const e=t.toLowerCase();return e.includes("timed out")?"timeout":e.includes("pop-up blocked")?"popup_blocked":e.includes("window was closed")?"popup_closed":e.includes("store session")?"credential_store_failed":"provider_failed"},Cy=({outcome:t,authAttemptId:e,startedAt:n,now:r,failureReason:s})=>({event:`visual_editor_auth_${t}`,properties:{auth_attempt_id:e,duration_ms:r-n,entry_point:"editor_gate",method:"google_oauth",...s?{failure_reason:s}:{}}}),PC=ms("App"),Nne=2e3,$ne=60,TC="Connecting to Google...",IC="https://rivet-proxy.onrender.com",jne=`<!doctype html>
410
+ <html lang="en">
411
+ <head>
412
+ <meta charset="utf-8" />
413
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
414
+ <title>${TC}</title>
415
+ <style>
416
+ :root { color-scheme: light dark; }
417
+ body {
418
+ margin: 0;
419
+ min-height: 100vh;
420
+ display: grid;
421
+ place-items: center;
422
+ font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
423
+ background: #111215;
424
+ color: #f3f4f6;
425
+ }
426
+ .panel {
427
+ border: 1px solid rgba(255, 255, 255, 0.16);
428
+ border-radius: 12px;
429
+ padding: 18px 22px;
430
+ background: rgba(255, 255, 255, 0.06);
431
+ font-size: 14px;
432
+ }
433
+ </style>
434
+ </head>
435
+ <body>
436
+ <div class="panel">${TC}</div>
437
+ </body>
438
+ </html>`,V2=274,Cm=395,Py=Math.min(Cm,Math.round((V2+Cm)/2*1.1)),AC="rivet:panelWidth:v2",Fne=t=>{if(!(t instanceof HTMLElement))return!1;const e=t.tagName.toLowerCase();return t.isContentEditable||e==="input"||e==="textarea"||e==="select"},Vne=({projectPath:t})=>{const e=nt(mR)>0,[n,r]=S5(hR),s=cU(),[i,o]=g.useState(()=>{if(typeof window>"u")return Py;const T=Number(window.localStorage.getItem(AC));return Number.isFinite(T)&&T>=V2&&T<=Cm?T:Py}),[l,u]=g.useState(!1),[d,h]=g.useState(ZJ),p=n?i:0,[m,v]=g.useState(n);g.useEffect(()=>{if(!n){v(!1);return}h(T=>WJ({position:T,boundsLeftPx:i}))},[n,i]),g.useEffect(()=>{window.localStorage.setItem(AC,String(i))},[i]),g.useEffect(()=>{if(!n)return;const T=I=>{I.key==="Escape"&&(Fne(I.target)||(I.preventDefault(),r(!1)))};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[n,r]);const w=g.useCallback(T=>{T.preventDefault(),T.stopPropagation();const I=T.clientX,M=i;u(!0);const R=L=>{const N=Math.min(Cm,Math.max(V2,M+(L.clientX-I)));o(N)},A=()=>{window.removeEventListener("pointermove",R),window.removeEventListener("pointerup",A),window.removeEventListener("pointercancel",A),u(!1)};window.addEventListener("pointermove",R),window.addEventListener("pointerup",A),window.addEventListener("pointercancel",A)},[i]),_=g.useCallback(()=>o(Py),[]),x=iee(),b=nt(sh);lee({enabled:!b});const k=x.isProcessing?"Completing authentication...":null,C=ft(wR);return g.useEffect(()=>{C(t??null)},[t,C]),S.jsxs(ni.div,{className:"relative flex h-screen overflow-hidden",initial:!1,animate:{opacity:1},transition:{duration:.5,ease:"easeOut"},"data-cy":"rivet-app",children:[k!==null?S.jsx("div",{className:"absolute inset-0 z-50",children:S.jsx(MJ,{message:k})}):null,S.jsx("div",{className:"relative flex min-w-0 flex-1 flex-col",children:S.jsx(oQ,{})}),S.jsx(S.Fragment,{children:e?null:S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"relative order-first h-full flex-shrink-0",style:{width:m?i:0},children:S.jsxs(ni.div,{className:"absolute inset-y-0 left-0 z-30",initial:!1,animate:{x:n?0:-i},transition:s?{duration:0}:{duration:.2,ease:[.22,1,.36,1]},onAnimationComplete:()=>{n&&v(!0)},style:{width:i,willChange:"transform"},children:[S.jsx(gX,{onClose:()=>r(!1)}),S.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize panel",onPointerDown:w,onDoubleClick:_,className:"group/resize absolute inset-y-0 right-0 z-20 flex w-3 cursor-col-resize touch-none justify-end",children:S.jsx("span",{className:`h-full transition-all duration-150 ${l?"bg-content-muted w-0.5":"bg-divider group-hover/resize:bg-content-muted w-px group-hover/resize:w-0.5"}`})})]})}),l&&S.jsx("div",{className:"fixed inset-0 z-[100] cursor-col-resize"}),S.jsx(KJ,{isVisible:!0,isPanelOpen:n,isReducedMotion:!!s,position:d,dragBoundsLeftPx:p,onPositionChange:h,onToggle:()=>r(T=>!T)})]})}),S.jsx(FU,{duration:5e3,richColors:!0,toastOptions:{style:{maxHeight:"150px",overflow:"hidden"}}})]})},H2="rivet_connect_deep_link",Hne=()=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search),e=t.get("connect"),n=e??window.sessionStorage.getItem(H2);if(n!=="pinterest"&&n!=="arena")return null;if(window.sessionStorage.setItem(H2,n),e){t.delete("connect");const r=t.toString();window.history.replaceState(null,document.title,window.location.pathname+(r?`?${r}`:"")+window.location.hash)}return n},zne=Hne(),Bne=()=>{const[t,e]=g.useState(window.location.hash),[n]=g.useState(()=>typeof window<"u"&&window.sessionStorage.getItem(C0)==="1"),[r,s]=g.useState(!1),[i,o]=g.useState(zne);g.useEffect(()=>{n&&window.sessionStorage.removeItem(C0)},[n]);const{config:l,refetchConfig:u,loading:d,error:h}=ree(),p=ft(sh),[m,v]=g.useState(!1),[w,_]=g.useState(null),[x,b]=g.useState(!1);g.useEffect(()=>{l!=null&&l.userId?(Ee.identify(l.userId,{...l.email?{email:l.email}:{}}),l.email&&Ee.alias(l.email,l.userId)):l!=null&&l.email&&Ee.identify(l.email,{email:l.email})},[l==null?void 0:l.userId,l==null?void 0:l.email]),g.useEffect(()=>{l&&Ee.register({source:"visual_editor",surface:"visual_editor"})},[l]);const k=g.useCallback(async()=>{var Q;const L=globalThis.crypto.randomUUID(),N=Date.now();v(!0),_(null);const F=Cy({outcome:"started",authAttemptId:L,startedAt:N,now:N});Ee.capture(F.event,F.properties);let j=null;try{if(j=window.open("","_blank"),!j)throw new Error("Pop-up blocked. Please allow pop-ups and try again.");try{j.document.open(),j.document.write(jne),j.document.close()}catch(W){PC.warn("Failed to render loading state in auth popup:",W)}const q=await fetch(`${IC}/api/auth/google/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"core"})}),Z=await q.json();if(!q.ok||!Z.success||!Z.authUrl||!Z.sessionId||!Z.pollSecret)throw new Error(Z.error||Z.message||"Failed to start Google login");if(j.closed)throw new Error("Sign-in window was closed before Google login started.");j.location.href=Z.authUrl;for(let W=0;W<$ne;W+=1){if(j.closed)throw new Error("Sign-in window was closed before authentication completed.");const V=await(await fetch(`${IC}/api/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:Z.sessionId,pollSecret:Z.pollSecret})})).json();if(V.success&&V.token&&((Q=V.user)!=null&&Q.email)){if(!(await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:V.user.email,token:V.token,refreshToken:V.refreshToken,userId:V.user.id})})).ok)throw new Error("Signed in, but failed to store session locally.");j.close(),window.sessionStorage.setItem(C0,"1");const B=Cy({outcome:"completed",authAttemptId:L,startedAt:N,now:Date.now()});Ee.capture(B.event,B.properties),window.location.reload();return}if(V.error&&V.error!=="Pending")throw new Error(V.error||"Google login failed");await new Promise(J=>setTimeout(J,Nne))}throw new Error("Authentication timed out. Please try again.")}catch(q){j&&!j.closed&&j.close();const Z=q instanceof Error?q.message:"Failed to start login flow";PC.warn("Login failed:",Z);const W=Cy({outcome:"failed",authAttemptId:L,startedAt:N,now:Date.now(),failureReason:Dne(Z)});Ee.capture(W.event,W.properties),_(Z),v(!1)}},[]),C=l!=null&&l.agentModeAvailable!==!0,T=Lne(t),I=g.useCallback(async()=>{b(!0),p(!0);try{await u()}finally{p(!1),b(!1)}},[u,p]);if(g.useEffect(()=>{const L=()=>{const N=window.location.hash;e(N)};return window.addEventListener("hashchange",L),()=>window.removeEventListener("hashchange",L)},[]),T==="design-system")return S.jsx(One,{});if(!d&&l===null&&!x){const L=h||"Could not load Rivet configuration.";return S.jsx("div",{className:"bg-main flex h-screen items-center justify-center px-6",children:S.jsxs("div",{className:"border-divider bg-main w-full max-w-md rounded-lg border p-6 text-center shadow-lg",children:[S.jsx("p",{className:"text-content text-sm font-medium",children:"We could not start Rivet yet."}),S.jsx("p",{className:"text-content-dim mt-2 text-xs",children:L}),S.jsx("button",{type:"button",className:"border-divider text-content hover:bg-main/80 mt-4 rounded-md border px-3 py-1.5 text-xs",onClick:()=>{I()},children:"Retry"})]})})}if(C)return S.jsx(AJ,{isSigningIn:m,onStartSignIn:()=>{k()},errorMessage:w,displayMode:"full"});const R=(l==null?void 0:l.agentModeAvailable)===!0&&i!==null,A=(l==null?void 0:l.agentModeAvailable)===!0&&n&&!r&&!R;return S.jsxs(S.Fragment,{children:[S.jsx(Vne,{projectPath:l==null?void 0:l.projectPath}),S.jsx(y2,{context:"onboarding",isOpen:A,onClose:()=>s(!0)}),S.jsx(y2,{context:"menu",isOpen:R,highlightProvider:i,onClose:()=>{window.sessionStorage.removeItem(H2),o(null)}})]})},Une="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",Wne=new $D,Zne={session_recording:{maskAllInputs:!0,maskTextSelector:"[data-rivet-private]"}},qne=()=>S.jsx("div",{style:{display:"flex",height:"100vh",alignItems:"center",justifyContent:"center"},children:S.jsx("p",{style:{fontSize:"14px",color:"#6b7280"},children:"Something went wrong. Please reload the page."})});Lj.createRoot(document.getElementById("root")).render(S.jsx(we.StrictMode,{children:S.jsx(Sj,{apiKey:Une,options:{api_host:"https://rivet-proxy.onrender.com/ingest",ui_host:"https://us.posthog.com",person_profiles:"always",capture_exceptions:!0,autocapture:!0,capture_pageview:!0,capture_performance:!0,persistence:"localStorage",...Zne,mask_all_text:!1,mask_all_element_attributes:!1,loaded:t=>{t.register({source:"visual_editor",surface:"visual_editor",telemetry_version:2,rivet_version:"0.16.3",env:"production"})}},children:S.jsx(Tj,{fallback:S.jsx(qne,{}),children:S.jsx(dD,{client:Wne,children:S.jsx(wY,{defaultShape:"rounded",children:S.jsx(Yte,{defaultLibrary:"lucide",children:S.jsx(Bne,{})})})})})})}));