rivet-design 0.14.13 → 0.14.14
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.
- package/dist/agent-variants/contracts.d.ts +30 -30
- package/dist/cli/commands/mcpServe.d.ts +1 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -96
- package/dist/index.js.map +1 -1
- package/dist/proxy-middleware/proxy-config.d.ts.map +1 -1
- package/dist/proxy-middleware/proxy-config.js +33 -19
- package/dist/proxy-middleware/proxy-config.js.map +1 -1
- package/dist/server.d.ts +0 -19
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +17 -491
- package/dist/server.js.map +1 -1
- package/dist/services/AuthService.d.ts +1 -1
- package/dist/services/AuthService.d.ts.map +1 -1
- package/dist/services/AuthService.js +5 -4
- package/dist/services/AuthService.js.map +1 -1
- package/dist/services/MCPOnboardingTelemetry.d.ts +2 -2
- package/dist/services/MCPOnboardingTelemetry.d.ts.map +1 -1
- package/dist/services/MCPOnboardingTelemetry.js +0 -3
- package/dist/services/MCPOnboardingTelemetry.js.map +1 -1
- package/dist/services/TelemetryService.d.ts +1 -96
- package/dist/services/TelemetryService.d.ts.map +1 -1
- package/dist/services/TelemetryService.js +0 -198
- package/dist/services/TelemetryService.js.map +1 -1
- package/dist/services/accessTokenRefresh.d.ts +0 -11
- package/dist/services/accessTokenRefresh.d.ts.map +1 -1
- package/dist/services/accessTokenRefresh.js +4 -24
- package/dist/services/accessTokenRefresh.js.map +1 -1
- package/package.json +1 -3
- package/src/ui/dist/assets/main-CHUtDutm.js +422 -0
- package/src/ui/dist/assets/main-CrLtwwgK.css +1 -0
- package/src/ui/dist/index.html +2 -2
- package/dist/demo/sessionRuntime.d.ts +0 -2
- package/dist/demo/sessionRuntime.d.ts.map +0 -1
- package/dist/demo/sessionRuntime.js +0 -48
- package/dist/demo/sessionRuntime.js.map +0 -1
- package/dist/hosted-demo.d.ts +0 -2
- package/dist/hosted-demo.d.ts.map +0 -1
- package/dist/hosted-demo.js +0 -83
- package/dist/hosted-demo.js.map +0 -1
- package/dist/routes/demo.d.ts +0 -33
- package/dist/routes/demo.d.ts.map +0 -1
- package/dist/routes/demo.js +0 -180
- package/dist/routes/demo.js.map +0 -1
- package/dist/services/HostedDemoAuthSessionService.d.ts +0 -50
- package/dist/services/HostedDemoAuthSessionService.d.ts.map +0 -1
- package/dist/services/HostedDemoAuthSessionService.js +0 -192
- package/dist/services/HostedDemoAuthSessionService.js.map +0 -1
- package/dist/services/HostedDemoAuthSessionStore.d.ts +0 -44
- package/dist/services/HostedDemoAuthSessionStore.d.ts.map +0 -1
- package/dist/services/HostedDemoAuthSessionStore.js +0 -90
- package/dist/services/HostedDemoAuthSessionStore.js.map +0 -1
- package/dist/services/HostedDemoSessionService.d.ts +0 -91
- package/dist/services/HostedDemoSessionService.d.ts.map +0 -1
- package/dist/services/HostedDemoSessionService.js +0 -568
- package/dist/services/HostedDemoSessionService.js.map +0 -1
- package/dist/services/HostedDemoSessionStore.d.ts +0 -49
- package/dist/services/HostedDemoSessionStore.d.ts.map +0 -1
- package/dist/services/HostedDemoSessionStore.js +0 -90
- package/dist/services/HostedDemoSessionStore.js.map +0 -1
- package/dist/services/hostedDemoSessionAuthRefresh.d.ts +0 -18
- package/dist/services/hostedDemoSessionAuthRefresh.d.ts.map +0 -1
- package/dist/services/hostedDemoSessionAuthRefresh.js +0 -39
- package/dist/services/hostedDemoSessionAuthRefresh.js.map +0 -1
- package/dist/utils/shouldRecordHostedDemoSessionAction.d.ts +0 -8
- package/dist/utils/shouldRecordHostedDemoSessionAction.d.ts.map +0 -1
- package/dist/utils/shouldRecordHostedDemoSessionAction.js +0 -11
- package/dist/utils/shouldRecordHostedDemoSessionAction.js.map +0 -1
- package/src/ui/dist/assets/main-BfVGaiD6.js +0 -422
- package/src/ui/dist/assets/main-CobdEReL.css +0 -1
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
var EO=Object.defineProperty;var YS=t=>{throw TypeError(t)};var CO=(t,e,n)=>e in t?EO(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Fo=(t,e,n)=>CO(t,typeof e!="symbol"?e+"":e,n),dv=(t,e,n)=>e.has(t)||YS("Cannot "+n);var U=(t,e,n)=>(dv(t,e,"read from private field"),n?n.call(t):e.get(t)),He=(t,e,n)=>e.has(t)?YS("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ke=(t,e,n,r)=>(dv(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),at=(t,e,n)=>(dv(t,e,"access private method"),n);var zh=(t,e,n,r)=>({set _(s){ke(t,e,s,n)},get _(){return U(t,e,r)}});function kO(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 a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).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 e0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var fv={exports:{}},Qu={},hv={exports:{}},st={};/**
|
|
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 XS;function PO(){if(XS)return st;XS=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"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=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 _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,y={};function w(D,Y,ee){this.props=D,this.context=Y,this.refs=y,this.updater=ee||_}w.prototype.isReactComponent={},w.prototype.setState=function(D,Y){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,Y,"setState")},w.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function S(){}S.prototype=w.prototype;function T(D,Y,ee){this.props=D,this.context=Y,this.refs=y,this.updater=ee||_}var P=T.prototype=new S;P.constructor=T,x(P,w.prototype),P.isPureReactComponent=!0;var k=Array.isArray,R=Object.prototype.hasOwnProperty,L={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function A(D,Y,ee){var ie,oe={},ce=null,xe=null;if(Y!=null)for(ie in Y.ref!==void 0&&(xe=Y.ref),Y.key!==void 0&&(ce=""+Y.key),Y)R.call(Y,ie)&&!O.hasOwnProperty(ie)&&(oe[ie]=Y[ie]);var ae=arguments.length-2;if(ae===1)oe.children=ee;else if(1<ae){for(var se=Array(ae),Ve=0;Ve<ae;Ve++)se[Ve]=arguments[Ve+2];oe.children=se}if(D&&D.defaultProps)for(ie in ae=D.defaultProps,ae)oe[ie]===void 0&&(oe[ie]=ae[ie]);return{$$typeof:t,type:D,key:ce,ref:xe,props:oe,_owner:L.current}}function I(D,Y){return{$$typeof:t,type:D.type,key:Y,ref:D.ref,props:D.props,_owner:D._owner}}function N(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function j(D){var Y={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(ee){return Y[ee]})}var F=/\/+/g;function K(D,Y){return typeof D=="object"&&D!==null&&D.key!=null?j(""+D.key):Y.toString(36)}function X(D,Y,ee,ie,oe){var ce=typeof D;(ce==="undefined"||ce==="boolean")&&(D=null);var xe=!1;if(D===null)xe=!0;else switch(ce){case"string":case"number":xe=!0;break;case"object":switch(D.$$typeof){case t:case e:xe=!0}}if(xe)return xe=D,oe=oe(xe),D=ie===""?"."+K(xe,0):ie,k(oe)?(ee="",D!=null&&(ee=D.replace(F,"$&/")+"/"),X(oe,Y,ee,"",function(Ve){return Ve})):oe!=null&&(N(oe)&&(oe=I(oe,ee+(!oe.key||xe&&xe.key===oe.key?"":(""+oe.key).replace(F,"$&/")+"/")+D)),Y.push(oe)),1;if(xe=0,ie=ie===""?".":ie+":",k(D))for(var ae=0;ae<D.length;ae++){ce=D[ae];var se=ie+K(ce,ae);xe+=X(ce,Y,ee,se,oe)}else if(se=m(D),typeof se=="function")for(D=se.call(D),ae=0;!(ce=D.next()).done;)ce=ce.value,se=ie+K(ce,ae++),xe+=X(ce,Y,ee,se,oe);else if(ce==="object")throw Y=String(D),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.");return xe}function W(D,Y,ee){if(D==null)return D;var ie=[],oe=0;return X(D,ie,"","",function(ce){return Y.call(ee,ce,oe++)}),ie}function G(D){if(D._status===-1){var Y=D._result;Y=Y(),Y.then(function(ee){(D._status===0||D._status===-1)&&(D._status=1,D._result=ee)},function(ee){(D._status===0||D._status===-1)&&(D._status=2,D._result=ee)}),D._status===-1&&(D._status=0,D._result=Y)}if(D._status===1)return D._result.default;throw D._result}var q={current:null},$={transition:null},ne={ReactCurrentDispatcher:q,ReactCurrentBatchConfig:$,ReactCurrentOwner:L};function z(){throw Error("act(...) is not supported in production builds of React.")}return st.Children={map:W,forEach:function(D,Y,ee){W(D,function(){Y.apply(this,arguments)},ee)},count:function(D){var Y=0;return W(D,function(){Y++}),Y},toArray:function(D){return W(D,function(Y){return Y})||[]},only:function(D){if(!N(D))throw Error("React.Children.only expected to receive a single React element child.");return D}},st.Component=w,st.Fragment=n,st.Profiler=s,st.PureComponent=T,st.StrictMode=r,st.Suspense=u,st.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ne,st.act=z,st.cloneElement=function(D,Y,ee){if(D==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+D+".");var ie=x({},D.props),oe=D.key,ce=D.ref,xe=D._owner;if(Y!=null){if(Y.ref!==void 0&&(ce=Y.ref,xe=L.current),Y.key!==void 0&&(oe=""+Y.key),D.type&&D.type.defaultProps)var ae=D.type.defaultProps;for(se in Y)R.call(Y,se)&&!O.hasOwnProperty(se)&&(ie[se]=Y[se]===void 0&&ae!==void 0?ae[se]:Y[se])}var se=arguments.length-2;if(se===1)ie.children=ee;else if(1<se){ae=Array(se);for(var Ve=0;Ve<se;Ve++)ae[Ve]=arguments[Ve+2];ie.children=ae}return{$$typeof:t,type:D.type,key:oe,ref:ce,props:ie,_owner:xe}},st.createContext=function(D){return D={$$typeof:a,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},D.Provider={$$typeof:i,_context:D},D.Consumer=D},st.createElement=A,st.createFactory=function(D){var Y=A.bind(null,D);return Y.type=D,Y},st.createRef=function(){return{current:null}},st.forwardRef=function(D){return{$$typeof:c,render:D}},st.isValidElement=N,st.lazy=function(D){return{$$typeof:h,_payload:{_status:-1,_result:D},_init:G}},st.memo=function(D,Y){return{$$typeof:f,type:D,compare:Y===void 0?null:Y}},st.startTransition=function(D){var Y=$.transition;$.transition={};try{D()}finally{$.transition=Y}},st.unstable_act=z,st.useCallback=function(D,Y){return q.current.useCallback(D,Y)},st.useContext=function(D){return q.current.useContext(D)},st.useDebugValue=function(){},st.useDeferredValue=function(D){return q.current.useDeferredValue(D)},st.useEffect=function(D,Y){return q.current.useEffect(D,Y)},st.useId=function(){return q.current.useId()},st.useImperativeHandle=function(D,Y,ee){return q.current.useImperativeHandle(D,Y,ee)},st.useInsertionEffect=function(D,Y){return q.current.useInsertionEffect(D,Y)},st.useLayoutEffect=function(D,Y){return q.current.useLayoutEffect(D,Y)},st.useMemo=function(D,Y){return q.current.useMemo(D,Y)},st.useReducer=function(D,Y,ee){return q.current.useReducer(D,Y,ee)},st.useRef=function(D){return q.current.useRef(D)},st.useState=function(D){return q.current.useState(D)},st.useSyncExternalStore=function(D,Y,ee){return q.current.useSyncExternalStore(D,Y,ee)},st.useTransition=function(){return q.current.useTransition()},st.version="18.3.1",st}var QS;function f2(){return QS||(QS=1,hv.exports=PO()),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 JS;function TO(){if(JS)return Qu;JS=1;var t=f2(),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 a(c,u,f){var h,p={},m=null,_=null;f!==void 0&&(m=""+f),u.key!==void 0&&(m=""+u.key),u.ref!==void 0&&(_=u.ref);for(h in u)r.call(u,h)&&!i.hasOwnProperty(h)&&(p[h]=u[h]);if(c&&c.defaultProps)for(h in u=c.defaultProps,u)p[h]===void 0&&(p[h]=u[h]);return{$$typeof:e,type:c,key:m,ref:_,props:p,_owner:s.current}}return Qu.Fragment=n,Qu.jsx=a,Qu.jsxs=a,Qu}var eE;function RO(){return eE||(eE=1,fv.exports=TO()),fv.exports}var E=RO(),v=f2();const ve=e0(v),Ef=kO({__proto__:null,default:ve},[v]);var Cf=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(){}},ll,zo,Lc,P8,AO=(P8=class extends Cf{constructor(){super();He(this,ll);He(this,zo);He(this,Lc);ke(this,Lc,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){U(this,zo)||this.setEventListener(U(this,Lc))}onUnsubscribe(){var e;this.hasListeners()||((e=U(this,zo))==null||e.call(this),ke(this,zo,void 0))}setEventListener(e){var n;ke(this,Lc,e),(n=U(this,zo))==null||n.call(this),ke(this,zo,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){U(this,ll)!==e&&(ke(this,ll,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof U(this,ll)=="boolean"?U(this,ll):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},ll=new WeakMap,zo=new WeakMap,Lc=new WeakMap,P8),h2=new AO,IO={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Uo,d2,T8,MO=(T8=class{constructor(){He(this,Uo,IO);He(this,d2,!1)}setTimeoutProvider(t){ke(this,Uo,t)}setTimeout(t,e){return U(this,Uo).setTimeout(t,e)}clearTimeout(t){U(this,Uo).clearTimeout(t)}setInterval(t,e){return U(this,Uo).setInterval(t,e)}clearInterval(t){U(this,Uo).clearInterval(t)}},Uo=new WeakMap,d2=new WeakMap,T8),rl=new MO;function OO(t){setTimeout(t,0)}var LO=typeof window>"u"||"Deno"in globalThis;function Er(){}function NO(t,e){return typeof t=="function"?t(e):t}function U1(t){return typeof t=="number"&&t>=0&&t!==1/0}function j8(t,e){return Math.max(t+(e||0)-Date.now(),0)}function ta(t,e){return typeof t=="function"?t(e):t}function Br(t,e){return typeof t=="function"?t(e):t}function tE(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:c}=t;if(a){if(r){if(e.queryHash!==p2(a,e.options))return!1}else if(!Kc(e.queryKey,a))return!1}if(n!=="all"){const u=e.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof c=="boolean"&&e.isStale()!==c||s&&s!==e.state.fetchStatus||i&&!i(e))}function nE(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if($d(e.options.mutationKey)!==$d(i))return!1}else if(!Kc(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function p2(t,e){return((e==null?void 0:e.queryKeyHashFn)||$d)(t)}function $d(t){return JSON.stringify(t,(e,n)=>W1(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Kc(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(!Kc(t[r],e[r]))return!1;return!0}const n=Object.keys(e);for(const r of n)if(!Kc(t[r],e[r]))return!1;return!0}return!1}var DO=Object.prototype.hasOwnProperty;function F8(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=rE(t)&&rE(e);if(!r&&!(W1(t)&&W1(e)))return e;const i=(r?t:Object.keys(t)).length,a=r?e:Object.keys(e),c=a.length,u=r?new Array(c):{};let f=0;for(let h=0;h<c;h++){const p=r?h:a[h],m=t[p],_=e[p];if(m===_){u[p]=m,(r?h<i:DO.call(t,p))&&f++;continue}if(m===null||_===null||typeof m!="object"||typeof _!="object"){u[p]=_;continue}const x=F8(m,_,n+1);u[p]=x,x===m&&f++}return i===c&&f===i?t:u}function B1(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 rE(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function W1(t){if(!sE(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!sE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function sE(t){return Object.prototype.toString.call(t)==="[object Object]"}function jO(t){return new Promise(e=>{rl.setTimeout(e,t)})}function G1(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?F8(t,e):e}function FO(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function VO(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var m2=Symbol();function V8(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===m2?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function $8(t,e){return typeof t=="function"?t(...e):!!t}function $O(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}var Hd=(()=>{let t=()=>LO;return{isServer(){return t()},setIsServer(e){t=e}}})();function K1(){let t,e;const n=new Promise((s,i)=>{t=s,e=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),t(s)},n.reject=s=>{r({status:"rejected",reason:s}),e(s)},n}var HO=OO;function zO(){let t=[],e=0,n=c=>{c()},r=c=>{c()},s=HO;const i=c=>{e?t.push(c):s(()=>{n(c)})},a=()=>{const c=t;t=[],c.length&&s(()=>{r(()=>{c.forEach(u=>{n(u)})})})};return{batch:c=>{let u;e++;try{u=c()}finally{e--,e||a()}return u},batchCalls:c=>(...u)=>{i(()=>{c(...u)})},schedule:i,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{s=c}}}var jn=zO(),Nc,Bo,Dc,R8,UO=(R8=class extends Cf{constructor(){super();He(this,Nc,!0);He(this,Bo);He(this,Dc);ke(this,Dc,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,Bo)||this.setEventListener(U(this,Dc))}onUnsubscribe(){var e;this.hasListeners()||((e=U(this,Bo))==null||e.call(this),ke(this,Bo,void 0))}setEventListener(e){var n;ke(this,Dc,e),(n=U(this,Bo))==null||n.call(this),ke(this,Bo,e(this.setOnline.bind(this)))}setOnline(e){U(this,Nc)!==e&&(ke(this,Nc,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return U(this,Nc)}},Nc=new WeakMap,Bo=new WeakMap,Dc=new WeakMap,R8),Qp=new UO;function BO(t){return Math.min(1e3*2**t,3e4)}function H8(t){return(t??"online")==="online"?Qp.isOnline():!0}var Z1=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function z8(t){let e=!1,n=0,r;const s=K1(),i=()=>s.status!=="pending",a=y=>{var w;if(!i()){const S=new Z1(y);m(S),(w=t.onCancel)==null||w.call(t,S)}},c=()=>{e=!0},u=()=>{e=!1},f=()=>h2.isFocused()&&(t.networkMode==="always"||Qp.isOnline())&&t.canRun(),h=()=>H8(t.networkMode)&&t.canRun(),p=y=>{i()||(r==null||r(),s.resolve(y))},m=y=>{i()||(r==null||r(),s.reject(y))},_=()=>new Promise(y=>{var w;r=S=>{(i()||f())&&y(S)},(w=t.onPause)==null||w.call(t)}).then(()=>{var y;r=void 0,i()||(y=t.onContinue)==null||y.call(t)}),x=()=>{if(i())return;let y;const w=n===0?t.initialPromise:void 0;try{y=w??t.fn()}catch(S){y=Promise.reject(S)}Promise.resolve(y).then(p).catch(S=>{var L;if(i())return;const T=t.retry??(Hd.isServer()?0:3),P=t.retryDelay??BO,k=typeof P=="function"?P(n,S):P,R=T===!0||typeof T=="number"&&n<T||typeof T=="function"&&T(n,S);if(e||!R){m(S);return}n++,(L=t.onFail)==null||L.call(t,n,S),jO(k).then(()=>f()?void 0:_()).then(()=>{e?m(S):x()})})};return{promise:s,status:()=>s.status,cancel:a,continue:()=>(r==null||r(),s),cancelRetry:c,continueRetry:u,canStart:h,start:()=>(h()?x():_().then(x),s)}}var cl,A8,U8=(A8=class{constructor(){He(this,cl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),U1(this.gcTime)&&ke(this,cl,rl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Hd.isServer()?1/0:300*1e3))}clearGcTimeout(){U(this,cl)!==void 0&&(rl.clearTimeout(U(this,cl)),ke(this,cl,void 0))}},cl=new WeakMap,A8);function WO(t){return{onFetch:(e,n)=>{var h,p,m,_,x;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=((_=e.state.data)==null?void 0:_.pages)||[],a=((x=e.state.data)==null?void 0:x.pageParams)||[];let c={pages:[],pageParams:[]},u=0;const f=async()=>{let y=!1;const w=P=>{$O(P,()=>e.signal,()=>y=!0)},S=V8(e.options,e.fetchOptions),T=async(P,k,R)=>{if(y)return Promise.reject(e.signal.reason);if(k==null&&P.pages.length)return Promise.resolve(P);const O=(()=>{const j={client:e.client,queryKey:e.queryKey,pageParam:k,direction:R?"backward":"forward",meta:e.options.meta};return w(j),j})(),A=await S(O),{maxPages:I}=e.options,N=R?VO:FO;return{pages:N(P.pages,A,I),pageParams:N(P.pageParams,k,I)}};if(s&&i.length){const P=s==="backward",k=P?GO:iE,R={pages:i,pageParams:a},L=k(r,R);c=await T(R,L,P)}else{const P=t??i.length;do{const k=u===0?a[0]??r.initialPageParam:iE(r,c);if(u>0&&k==null)break;c=await T(c,k),u++}while(u<P)}return c};e.options.persister?e.fetchFn=()=>{var y,w;return(w=(y=e.options).persister)==null?void 0:w.call(y,f,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=f}}}function iE(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 GO(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 jc,ul,Fc,fs,dl,Cn,_f,fl,zr,B8,Ui,I8,KO=(I8=class extends U8{constructor(e){super();He(this,zr);He(this,jc);He(this,ul);He(this,Fc);He(this,fs);He(this,dl);He(this,Cn);He(this,_f);He(this,fl);ke(this,fl,!1),ke(this,_f,e.defaultOptions),this.setOptions(e.options),this.observers=[],ke(this,dl,e.client),ke(this,fs,U(this,dl).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,ke(this,ul,aE(this.options)),this.state=e.state??U(this,ul),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return U(this,jc)}get promise(){var e;return(e=U(this,Cn))==null?void 0:e.promise}setOptions(e){if(this.options={...U(this,_f),...e},e!=null&&e._type&&ke(this,jc,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=aE(this.options);n.data!==void 0&&(this.setState(oE(n.data,n.dataUpdatedAt)),ke(this,ul,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&U(this,fs).remove(this)}setData(e,n){const r=G1(this.state.data,e,this.options);return at(this,zr,Ui).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e){at(this,zr,Ui).call(this,{type:"setState",state:e})}cancel(e){var r,s;const n=(r=U(this,Cn))==null?void 0:r.promise;return(s=U(this,Cn))==null||s.cancel(e),n?n.then(Er).catch(Er):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return U(this,ul)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Br(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===m2||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ta(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:!j8(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=U(this,Cn))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=U(this,Cn))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),U(this,fs).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(U(this,Cn)&&(U(this,fl)||at(this,zr,B8).call(this)?U(this,Cn).cancel({revert:!0}):U(this,Cn).cancelRetry()),this.scheduleGc()),U(this,fs).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||at(this,zr,Ui).call(this,{type:"invalidate"})}async fetch(e,n){var f,h,p,m,_,x,y,w,S,T,P;if(this.state.fetchStatus!=="idle"&&((f=U(this,Cn))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(U(this,Cn))return U(this,Cn).continueRetry(),U(this,Cn).promise}if(e&&this.setOptions(e),!this.options.queryFn){const k=this.observers.find(R=>R.options.queryFn);k&&this.setOptions(k.options)}const r=new AbortController,s=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(ke(this,fl,!0),r.signal)})},i=()=>{const k=V8(this.options,n),L=(()=>{const O={client:U(this,dl),queryKey:this.queryKey,meta:this.meta};return s(O),O})();return ke(this,fl,!1),this.options.persister?this.options.persister(k,L,this):k(L)},c=(()=>{const k={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:U(this,dl),state:this.state,fetchFn:i};return s(k),k})(),u=U(this,jc)==="infinite"?WO(this.options.pages):this.options.behavior;u==null||u.onFetch(c,this),ke(this,Fc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=c.fetchOptions)==null?void 0:h.meta))&&at(this,zr,Ui).call(this,{type:"fetch",meta:(p=c.fetchOptions)==null?void 0:p.meta}),ke(this,Cn,z8({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:k=>{k instanceof Z1&&k.revert&&this.setState({...U(this,Fc),fetchStatus:"idle"}),r.abort()},onFail:(k,R)=>{at(this,zr,Ui).call(this,{type:"failed",failureCount:k,error:R})},onPause:()=>{at(this,zr,Ui).call(this,{type:"pause"})},onContinue:()=>{at(this,zr,Ui).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const k=await U(this,Cn).start();if(k===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(k),(_=(m=U(this,fs).config).onSuccess)==null||_.call(m,k,this),(y=(x=U(this,fs).config).onSettled)==null||y.call(x,k,this.state.error,this),k}catch(k){if(k instanceof Z1){if(k.silent)return U(this,Cn).promise;if(k.revert){if(this.state.data===void 0)throw k;return this.state.data}}throw at(this,zr,Ui).call(this,{type:"error",error:k}),(S=(w=U(this,fs).config).onError)==null||S.call(w,k,this),(P=(T=U(this,fs).config).onSettled)==null||P.call(T,this.state.data,k,this),k}finally{this.scheduleGc()}}},jc=new WeakMap,ul=new WeakMap,Fc=new WeakMap,fs=new WeakMap,dl=new WeakMap,Cn=new WeakMap,_f=new WeakMap,fl=new WeakMap,zr=new WeakSet,B8=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Ui=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,...W8(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...oE(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ke(this,Fc,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),jn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),U(this,fs).notify({query:this,type:"updated",action:e})})},I8);function W8(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:H8(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function oE(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function aE(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 wr,lt,xf,sr,hl,Vc,Qi,Wo,wf,$c,Hc,pl,ml,Go,zc,gt,md,q1,Y1,X1,Q1,J1,ey,ty,G8,M8,ZO=(M8=class extends Cf{constructor(e,n){super();He(this,gt);He(this,wr);He(this,lt);He(this,xf);He(this,sr);He(this,hl);He(this,Vc);He(this,Qi);He(this,Wo);He(this,wf);He(this,$c);He(this,Hc);He(this,pl);He(this,ml);He(this,Go);He(this,zc,new Set);this.options=n,ke(this,wr,e),ke(this,Wo,null),ke(this,Qi,K1()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(U(this,lt).addObserver(this),lE(U(this,lt),this.options)?at(this,gt,md).call(this):this.updateResult(),at(this,gt,Q1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ny(U(this,lt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ny(U(this,lt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,at(this,gt,J1).call(this),at(this,gt,ey).call(this),U(this,lt).removeObserver(this)}setOptions(e){const n=this.options,r=U(this,lt);if(this.options=U(this,wr).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Br(this.options.enabled,U(this,lt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");at(this,gt,ty).call(this),U(this,lt).setOptions(this.options),n._defaulted&&!B1(this.options,n)&&U(this,wr).getQueryCache().notify({type:"observerOptionsUpdated",query:U(this,lt),observer:this});const s=this.hasListeners();s&&cE(U(this,lt),r,this.options,n)&&at(this,gt,md).call(this),this.updateResult(),s&&(U(this,lt)!==r||Br(this.options.enabled,U(this,lt))!==Br(n.enabled,U(this,lt))||ta(this.options.staleTime,U(this,lt))!==ta(n.staleTime,U(this,lt)))&&at(this,gt,q1).call(this);const i=at(this,gt,Y1).call(this);s&&(U(this,lt)!==r||Br(this.options.enabled,U(this,lt))!==Br(n.enabled,U(this,lt))||i!==U(this,Go))&&at(this,gt,X1).call(this,i)}getOptimisticResult(e){const n=U(this,wr).getQueryCache().build(U(this,wr),e),r=this.createResult(n,e);return YO(this,r)&&(ke(this,sr,r),ke(this,Vc,this.options),ke(this,hl,U(this,lt).state)),r}getCurrentResult(){return U(this,sr)}trackResult(e,n){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&U(this,Qi).status==="pending"&&U(this,Qi).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(e){U(this,zc).add(e)}getCurrentQuery(){return U(this,lt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=U(this,wr).defaultQueryOptions(e),r=U(this,wr).getQueryCache().build(U(this,wr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return at(this,gt,md).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),U(this,sr)))}createResult(e,n){var I;const r=U(this,lt),s=this.options,i=U(this,sr),a=U(this,hl),c=U(this,Vc),f=e!==r?e.state:U(this,xf),{state:h}=e;let p={...h},m=!1,_;if(n._optimisticResults){const N=this.hasListeners(),j=!N&&lE(e,n),F=N&&cE(e,r,n,s);(j||F)&&(p={...p,...W8(h.data,e.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:x,errorUpdatedAt:y,status:w}=p;_=p.data;let S=!1;if(n.placeholderData!==void 0&&_===void 0&&w==="pending"){let N;i!=null&&i.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(N=i.data,S=!0):N=typeof n.placeholderData=="function"?n.placeholderData((I=U(this,Hc))==null?void 0:I.state.data,U(this,Hc)):n.placeholderData,N!==void 0&&(w="success",_=G1(i==null?void 0:i.data,N,n),m=!0)}if(n.select&&_!==void 0&&!S)if(i&&_===(a==null?void 0:a.data)&&n.select===U(this,wf))_=U(this,$c);else try{ke(this,wf,n.select),_=n.select(_),_=G1(i==null?void 0:i.data,_,n),ke(this,$c,_),ke(this,Wo,null)}catch(N){ke(this,Wo,N)}U(this,Wo)&&(x=U(this,Wo),_=U(this,$c),y=Date.now(),w="error");const T=p.fetchStatus==="fetching",P=w==="pending",k=w==="error",R=P&&T,L=_!==void 0,A={status:w,fetchStatus:p.fetchStatus,isPending:P,isSuccess:w==="success",isError:k,isInitialLoading:R,isLoading:R,data:_,dataUpdatedAt:p.dataUpdatedAt,error:x,errorUpdatedAt:y,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:p.dataUpdateCount>f.dataUpdateCount||p.errorUpdateCount>f.errorUpdateCount,isFetching:T,isRefetching:T&&!P,isLoadingError:k&&!L,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:k&&L,isStale:g2(e,n),refetch:this.refetch,promise:U(this,Qi),isEnabled:Br(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const N=A.data!==void 0,j=A.status==="error"&&!N,F=W=>{j?W.reject(A.error):N&&W.resolve(A.data)},K=()=>{const W=ke(this,Qi,A.promise=K1());F(W)},X=U(this,Qi);switch(X.status){case"pending":e.queryHash===r.queryHash&&F(X);break;case"fulfilled":(j||A.data!==X.value)&&K();break;case"rejected":(!j||A.error!==X.reason)&&K();break}}return A}updateResult(){const e=U(this,sr),n=this.createResult(U(this,lt),this.options);if(ke(this,hl,U(this,lt).state),ke(this,Vc,this.options),U(this,hl).data!==void 0&&ke(this,Hc,U(this,lt)),B1(n,e))return;ke(this,sr,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!U(this,zc).size)return!0;const a=new Set(i??U(this,zc));return this.options.throwOnError&&a.add("error"),Object.keys(U(this,sr)).some(c=>{const u=c;return U(this,sr)[u]!==e[u]&&a.has(u)})};at(this,gt,G8).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&at(this,gt,Q1).call(this)}},wr=new WeakMap,lt=new WeakMap,xf=new WeakMap,sr=new WeakMap,hl=new WeakMap,Vc=new WeakMap,Qi=new WeakMap,Wo=new WeakMap,wf=new WeakMap,$c=new WeakMap,Hc=new WeakMap,pl=new WeakMap,ml=new WeakMap,Go=new WeakMap,zc=new WeakMap,gt=new WeakSet,md=function(e){at(this,gt,ty).call(this);let n=U(this,lt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Er)),n},q1=function(){at(this,gt,J1).call(this);const e=ta(this.options.staleTime,U(this,lt));if(Hd.isServer()||U(this,sr).isStale||!U1(e))return;const r=j8(U(this,sr).dataUpdatedAt,e)+1;ke(this,pl,rl.setTimeout(()=>{U(this,sr).isStale||this.updateResult()},r))},Y1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(U(this,lt)):this.options.refetchInterval)??!1},X1=function(e){at(this,gt,ey).call(this),ke(this,Go,e),!(Hd.isServer()||Br(this.options.enabled,U(this,lt))===!1||!U1(U(this,Go))||U(this,Go)===0)&&ke(this,ml,rl.setInterval(()=>{(this.options.refetchIntervalInBackground||h2.isFocused())&&at(this,gt,md).call(this)},U(this,Go)))},Q1=function(){at(this,gt,q1).call(this),at(this,gt,X1).call(this,at(this,gt,Y1).call(this))},J1=function(){U(this,pl)!==void 0&&(rl.clearTimeout(U(this,pl)),ke(this,pl,void 0))},ey=function(){U(this,ml)!==void 0&&(rl.clearInterval(U(this,ml)),ke(this,ml,void 0))},ty=function(){const e=U(this,wr).getQueryCache().build(U(this,wr),this.options);if(e===U(this,lt))return;const n=U(this,lt);ke(this,lt,e),ke(this,xf,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},G8=function(e){jn.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(U(this,sr))}),U(this,wr).getQueryCache().notify({query:U(this,lt),type:"observerResultsUpdated"})})},M8);function qO(t,e){return Br(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&Br(e.retryOnMount,t)===!1)}function lE(t,e){return qO(t,e)||t.state.data!==void 0&&ny(t,e,e.refetchOnMount)}function ny(t,e,n){if(Br(e.enabled,t)!==!1&&ta(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&g2(t,e)}return!1}function cE(t,e,n,r){return(t!==e||Br(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&g2(t,n)}function g2(t,e){return Br(e.enabled,t)!==!1&&t.isStaleByTime(ta(e.staleTime,t))}function YO(t,e){return!B1(t.getCurrentResult(),e)}var bf,ai,Zn,gl,li,$o,O8,XO=(O8=class extends U8{constructor(e){super();He(this,li);He(this,bf);He(this,ai);He(this,Zn);He(this,gl);ke(this,bf,e.client),this.mutationId=e.mutationId,ke(this,Zn,e.mutationCache),ke(this,ai,[]),this.state=e.state||QO(),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,ai).includes(e)||(U(this,ai).push(e),this.clearGcTimeout(),U(this,Zn).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){ke(this,ai,U(this,ai).filter(n=>n!==e)),this.scheduleGc(),U(this,Zn).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){U(this,ai).length||(this.state.status==="pending"?this.scheduleGc():U(this,Zn).remove(this))}continue(){var e;return((e=U(this,gl))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var a,c,u,f,h,p,m,_,x,y,w,S,T,P,k,R,L,O;const n=()=>{at(this,li,$o).call(this,{type:"continue"})},r={client:U(this,bf),meta:this.options.meta,mutationKey:this.options.mutationKey};ke(this,gl,z8({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(A,I)=>{at(this,li,$o).call(this,{type:"failed",failureCount:A,error:I})},onPause:()=>{at(this,li,$o).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>U(this,Zn).canRun(this)}));const s=this.state.status==="pending",i=!U(this,gl).canStart();try{if(s)n();else{at(this,li,$o).call(this,{type:"pending",variables:e,isPaused:i}),U(this,Zn).config.onMutate&&await U(this,Zn).config.onMutate(e,this,r);const I=await((c=(a=this.options).onMutate)==null?void 0:c.call(a,e,r));I!==this.state.context&&at(this,li,$o).call(this,{type:"pending",context:I,variables:e,isPaused:i})}const A=await U(this,gl).start();return await((f=(u=U(this,Zn).config).onSuccess)==null?void 0:f.call(u,A,e,this.state.context,this,r)),await((p=(h=this.options).onSuccess)==null?void 0:p.call(h,A,e,this.state.context,r)),await((_=(m=U(this,Zn).config).onSettled)==null?void 0:_.call(m,A,null,this.state.variables,this.state.context,this,r)),await((y=(x=this.options).onSettled)==null?void 0:y.call(x,A,null,e,this.state.context,r)),at(this,li,$o).call(this,{type:"success",data:A}),A}catch(A){try{await((S=(w=U(this,Zn).config).onError)==null?void 0:S.call(w,A,e,this.state.context,this,r))}catch(I){Promise.reject(I)}try{await((P=(T=this.options).onError)==null?void 0:P.call(T,A,e,this.state.context,r))}catch(I){Promise.reject(I)}try{await((R=(k=U(this,Zn).config).onSettled)==null?void 0:R.call(k,void 0,A,this.state.variables,this.state.context,this,r))}catch(I){Promise.reject(I)}try{await((O=(L=this.options).onSettled)==null?void 0:O.call(L,void 0,A,e,this.state.context,r))}catch(I){Promise.reject(I)}throw at(this,li,$o).call(this,{type:"error",error:A}),A}finally{U(this,Zn).runNext(this)}}},bf=new WeakMap,ai=new WeakMap,Zn=new WeakMap,gl=new WeakMap,li=new WeakSet,$o=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),jn.batch(()=>{U(this,ai).forEach(r=>{r.onMutationUpdate(e)}),U(this,Zn).notify({mutation:this,type:"updated",action:e})})},O8);function QO(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ji,Fs,Sf,L8,JO=(L8=class extends Cf{constructor(e={}){super();He(this,Ji);He(this,Fs);He(this,Sf);this.config=e,ke(this,Ji,new Set),ke(this,Fs,new Map),ke(this,Sf,0)}build(e,n,r){const s=new XO({client:e,mutationCache:this,mutationId:++zh(this,Sf)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){U(this,Ji).add(e);const n=Uh(e);if(typeof n=="string"){const r=U(this,Fs).get(n);r?r.push(e):U(this,Fs).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(U(this,Ji).delete(e)){const n=Uh(e);if(typeof n=="string"){const r=U(this,Fs).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,Fs).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Uh(e);if(typeof n=="string"){const r=U(this,Fs).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r;const n=Uh(e);if(typeof n=="string"){const s=(r=U(this,Fs).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){jn.batch(()=>{U(this,Ji).forEach(e=>{this.notify({type:"removed",mutation:e})}),U(this,Ji).clear(),U(this,Fs).clear()})}getAll(){return Array.from(U(this,Ji))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>nE(n,r))}findAll(e={}){return this.getAll().filter(n=>nE(e,n))}notify(e){jn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return jn.batch(()=>Promise.all(e.map(n=>n.continue().catch(Er))))}},Ji=new WeakMap,Fs=new WeakMap,Sf=new WeakMap,L8);function Uh(t){var e;return(e=t.options.scope)==null?void 0:e.id}var ci,N8,eL=(N8=class extends Cf{constructor(e={}){super();He(this,ci);this.config=e,ke(this,ci,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??p2(s,n);let a=this.get(i);return a||(a=new KO({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){U(this,ci).has(e.queryHash)||(U(this,ci).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=U(this,ci).get(e.queryHash);n&&(e.destroy(),n===e&&U(this,ci).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){jn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return U(this,ci).get(e)}getAll(){return[...U(this,ci).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>tE(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>tE(e,r)):n}notify(e){jn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){jn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){jn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ci=new WeakMap,N8),Xt,Ko,Zo,Uc,Bc,qo,Wc,Gc,D8,tL=(D8=class{constructor(t={}){He(this,Xt);He(this,Ko);He(this,Zo);He(this,Uc);He(this,Bc);He(this,qo);He(this,Wc);He(this,Gc);ke(this,Xt,t.queryCache||new eL),ke(this,Ko,t.mutationCache||new JO),ke(this,Zo,t.defaultOptions||{}),ke(this,Uc,new Map),ke(this,Bc,new Map),ke(this,qo,0)}mount(){zh(this,qo)._++,U(this,qo)===1&&(ke(this,Wc,h2.subscribe(async t=>{t&&(await this.resumePausedMutations(),U(this,Xt).onFocus())})),ke(this,Gc,Qp.subscribe(async t=>{t&&(await this.resumePausedMutations(),U(this,Xt).onOnline())})))}unmount(){var t,e;zh(this,qo)._--,U(this,qo)===0&&((t=U(this,Wc))==null||t.call(this),ke(this,Wc,void 0),(e=U(this,Gc))==null||e.call(this),ke(this,Gc,void 0))}isFetching(t){return U(this,Xt).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return U(this,Ko).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=U(this,Xt).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=U(this,Xt).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(ta(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return U(this,Xt).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),s=U(this,Xt).get(r.queryHash),i=s==null?void 0:s.state.data,a=NO(e,i);if(a!==void 0)return U(this,Xt).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return jn.batch(()=>U(this,Xt).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,Xt).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=U(this,Xt);jn.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=U(this,Xt);return jn.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=jn.batch(()=>U(this,Xt).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Er).catch(Er)}invalidateQueries(t,e={}){return jn.batch(()=>(U(this,Xt).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=jn.batch(()=>U(this,Xt).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Er)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Er)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=U(this,Xt).build(this,e);return n.isStaleByTime(ta(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Er).catch(Er)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Er).catch(Er)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return Qp.isOnline()?U(this,Ko).resumePausedMutations():Promise.resolve()}getQueryCache(){return U(this,Xt)}getMutationCache(){return U(this,Ko)}getDefaultOptions(){return U(this,Zo)}setDefaultOptions(t){ke(this,Zo,t)}setQueryDefaults(t,e){U(this,Uc).set($d(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...U(this,Uc).values()],n={};return e.forEach(r=>{Kc(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){U(this,Bc).set($d(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...U(this,Bc).values()],n={};return e.forEach(r=>{Kc(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...U(this,Zo).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=p2(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===m2&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...U(this,Zo).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){U(this,Xt).clear(),U(this,Ko).clear()}},Xt=new WeakMap,Ko=new WeakMap,Zo=new WeakMap,Uc=new WeakMap,Bc=new WeakMap,qo=new WeakMap,Wc=new WeakMap,Gc=new WeakMap,D8),K8=v.createContext(void 0),Z8=t=>{const e=v.useContext(K8);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},nL=({client:t,children:e})=>(v.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),E.jsx(K8.Provider,{value:t,children:e})),q8=v.createContext(!1),rL=()=>v.useContext(q8);q8.Provider;function sL(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var iL=v.createContext(sL()),oL=()=>v.useContext(iL),aL=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?$8(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},lL=t=>{v.useEffect(()=>{t.clearReset()},[t])},cL=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||$8(n,[t.error,r])),uL=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))}},dL=(t,e)=>t.isLoading&&t.isFetching&&!e,fL=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,uE=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function hL(t,e,n){var _,x,y,w;const r=rL(),s=oL(),i=Z8(),a=i.defaultQueryOptions(t);(x=(_=i.getDefaultOptions().queries)==null?void 0:_._experimental_beforeQuery)==null||x.call(_,a);const c=i.getQueryCache().get(a.queryHash),u=t.subscribed!==!1;a._optimisticResults=r?"isRestoring":u?"optimistic":void 0,uL(a),aL(a,s,c),lL(s);const f=!i.getQueryCache().get(a.queryHash),[h]=v.useState(()=>new e(i,a)),p=h.getOptimisticResult(a),m=!r&&u;if(v.useSyncExternalStore(v.useCallback(S=>{const T=m?h.subscribe(jn.batchCalls(S)):Er;return h.updateResult(),T},[h,m]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),v.useEffect(()=>{h.setOptions(a)},[a,h]),fL(a,p))throw uE(a,h,s);if(cL({result:p,errorResetBoundary:s,throwOnError:a.throwOnError,query:c,suspense:a.suspense}))throw p.error;if((w=(y=i.getDefaultOptions().queries)==null?void 0:y._experimental_afterQuery)==null||w.call(y,a,p),a.experimental_prefetchInRender&&!Hd.isServer()&&dL(p,r)){const S=f?uE(a,h,s):c==null?void 0:c.promise;S==null||S.catch(Er).finally(()=>{h.updateResult()})}return a.notifyOnChangeProps?p:h.trackResult(p)}function ry(t,e){return hL(t,ZO)}var te=typeof window<"u"?window:void 0,Yn=typeof globalThis<"u"?globalThis:te,or=Yn==null?void 0:Yn.navigator,Se=Yn==null?void 0:Yn.document,on=Yn==null?void 0:Yn.location,v2=Yn==null?void 0:Yn.fetch,sy=Yn!=null&&Yn.XMLHttpRequest&&"withCredentials"in new Yn.XMLHttpRequest?Yn.XMLHttpRequest:void 0,dE=Yn==null?void 0:Yn.AbortController,pL=Yn==null?void 0:Yn.CompressionStream,br=or==null?void 0:or.userAgent;function Y8(){return!(!te||te.navigator.onLine===!1)}var Ju=typeof globalThis<"u"?globalThis:te;Ju&&typeof self>"u"&&(Ju.self=Ju),Ju&&typeof File>"u"&&(Ju.File=function(){});var $e=te??{},mt={DEBUG:!1,LIB_VERSION:"0.2.3",LIB_NAME:"browser-common"};function fE(t,e,n,r,s,i,a){try{var c=t[i](a),u=c.value}catch(f){return void n(f)}c.done?e(u):Promise.resolve(u).then(r,s)}function Jt(t){return function(){var e=this,n=arguments;return new Promise((function(r,s){var i=t.apply(e,n);function a(u){fE(i,r,s,a,c,"next",u)}function c(u){fE(i,r,s,a,c,"throw",u)}a(void 0)}))}}function ue(){return ue=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ue.apply(null,arguments)}function X8(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}var hE=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function pE(t){return typeof t=="string"||t}function mE(t){return typeof t=="string"?t:void 0}var ed,mL=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],Ki=(function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t})({}),gE=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({}),gL=["$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"],vL=["token"],Q8="NativeGzipValidationError",iy=t=>t.length>=2&&t[0]===31&&t[1]===139,vE=(t,e)=>t===gE.GZipJS||e===gE.GZipJS||e==="gzip",yE=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError",Bh=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=Q8,e},yL=(function(){var t=Jt((function*(e,n){18>e.size&&Bh("too-short");var r=new Uint8Array(yield e.slice(0,10).arrayBuffer());iy(r)&&r[2]===8||Bh("invalid-header");var s=new DataView(yield e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(a=>{for(var c=(()=>{if(ed)return ed;ed=[];for(var h=0;256>h;h++){for(var p=h,m=0;8>m;m++)p=1&p?3988292384^p>>>1:p>>>1;ed[h]=p>>>0}return ed})(),u=4294967295,f=0;a.length>f;f++)u=c[255&(u^a[f])]^u>>>8;return(4294967295^u)>>>0})(n)&&Bh("invalid-crc");var i=n.length>>>0;s.getUint32(4,!0)!==i&&Bh("invalid-size")}));return function(e,n){return t.apply(this,arguments)}})();function oy(){return oy=Jt((function*(t,e,n){e===void 0&&(e=!0);try{var r=new TextEncoder().encode(t),s=new globalThis.CompressionStream("gzip"),i=s.writable.getWriter(),a=i.write(r).then((()=>i.close())).catch((function(){var f=Jt((function*(h){try{yield i.abort(h)}catch{}throw h}));return function(h){return f.apply(this,arguments)}})()),c=new Response(s.readable).blob(),u=(yield Promise.all([c,a]))[0];return yield yL(u,r),u}catch(f){if(n!=null&&n.rethrow)throw f;return e&&console.error("Failed to gzip compress data",f),null}})),oy.apply(this,arguments)}var _L=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],_E=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return _L.concat(e).some((r=>{var s=r.toLowerCase();return n.indexOf(s)!==-1}))};function Ge(t,e){return t.indexOf(e)!==-1}var t0=function(t){return t.trim()},ay=function(t){return t.replace(/^\$/,"")};function J8(t){var e,n=[];return(e=JSON.stringify(t,(function(r,s){if(typeof s=="bigint")return s.toString();if(typeof s!="function"&&typeof s!="symbol"){if(s instanceof Error)return{name:s.name,message:s.message,stack:s.stack};if(s&&typeof s=="object"){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(s))return"[Circular]";n.push(s)}return s}})))!==null&&e!==void 0?e:"null"}var e6=Object.prototype,t6=e6.hasOwnProperty,n0=e6.toString,Qe=Array.isArray||function(t){return n0.call(t)==="[object Array]"},Vs=t=>typeof t=="function",Lt=t=>t===Object(t)&&!Qe(t),Yo=t=>{if(Lt(t)){for(var e in t)if(t6.call(t,e))return!1;return!0}return!1},ge=t=>t===void 0,_t=t=>n0.call(t)=="[object String]",ly=t=>_t(t)&&t.trim().length===0,ur=t=>t===null,Je=t=>ge(t)||ur(t),Vn=t=>n0.call(t)=="[object Number]"&&t==t,Bi=t=>Vn(t)&&t>0,$s=t=>n0.call(t)==="[object Boolean]",xL=t=>t instanceof FormData,wL=t=>Ge(gL,t),bL=t=>Ge(vL,t);function n6(t){return t===null||typeof t!="object"}function Jp(t,e){return{}.toString.call(t)==="[object "+e+"]"}function y2(t){return typeof Event<"u"&&(function(e,n){try{return e instanceof n}catch{return!1}})(t,Event)}var SL=[!0,"true",1,"1","yes"],pv=t=>Ge(SL,t),EL=[!1,"false",0,"0","no"];function hi(t,e,n,r,s){return e>n&&(r.warn("min cannot be greater than max."),e=n),Vn(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),hi(s||n,e,n,r))}class CL{constructor(e){this.$e={},this.ze=e.ze,this.Ze=hi(e.bucketSize,0,100,e.Ge),this.Qe=hi(e.refillRate,0,this.Ze,e.Ge),this.Je=hi(e.refillInterval,0,864e5,e.Ge)}Ke(e,n){var r=Math.floor((n-e.lastAccess)/this.Je);r>0&&(e.tokens=Math.min(e.tokens+r*this.Qe,this.Ze),e.lastAccess=e.lastAccess+r*this.Je)}consumeRateLimit(e){var n,r=Date.now(),s=String(e),i=this.$e[s];return i?this.Ke(i,r):this.$e[s]=i={tokens:this.Ze,lastAccess:r},i.tokens===0||(i.tokens--,i.tokens===0&&((n=this.ze)==null||n.call(this,e)),i.tokens===0)}stop(){this.$e={}}}var Yr="Mobile",em="iOS",io="Android",Zc="Tablet",r6=io+" "+Zc,s6="iPad",i6="Apple",o6=i6+" Watch",Ed="Safari",qc="BlackBerry",a6="Samsung",l6=a6+"Browser",c6=a6+" Internet",vl="Chrome",kL=vl+" OS",u6=vl+" "+em,_2="Internet Explorer",d6=_2+" "+Yr,x2="Opera",PL=x2+" Mini",w2="Edge",f6="Microsoft "+w2,Cc="Firefox",h6=Cc+" "+em,zd="Nintendo",Ud="PlayStation",kc="Xbox",p6=io+" "+Yr,m6=Yr+" "+Ed,gd="Windows",cy=gd+" Phone",xE="Nokia",uy="Ouya",g6="Generic",TL=g6+" "+Yr.toLowerCase(),v6=g6+" "+Zc.toLowerCase(),dy="Konqueror",y6="Oculus Browser",tm="Vivaldi",_6="Yandex",nm="Whale",fy="DuckDuckGo",x6="Pale Moon",rm="Waterfox",Cd="Brave",w6="Google Search App",Ht="(\\d+(\\.\\d+)?)",mv=new RegExp("Version/"+Ht),RL=new RegExp(kc,"i"),AL=new RegExp(Ud+" \\w+","i"),IL=new RegExp(zd+" \\w+","i"),b2=new RegExp(qc+"|PlayBook|BB10","i"),ML={"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"},b6=function(t,e,n,r){e=e||"";var s=(function(i){return i!=null&&i.brave?Cd:null})(n);return s||(r!=null&&r.detectGoogleSearchApp&&Ge(t,"GSA/")?w6:Ge(t," OPR/")&&Ge(t,"Mini")?PL:Ge(t," OPR/")?x2:b2.test(t)?qc:Ge(t,"IE"+Yr)||Ge(t,"WPDesktop")?d6:Ge(t,"OculusBrowser")?y6:Ge(t,l6)?c6:Ge(t,w2)||Ge(t,"Edg/")?f6:Ge(t,tm+"/")?tm:Ge(t,"YaBrowser/")?_6:Ge(t,nm+"/")?nm:Ge(t,fy+"/")||Ge(t,"Ddg/")?fy:Ge(t,"FBIOS")?"Facebook "+Yr:Ge(t,"UCWEB")||Ge(t,"UCBrowser")?"UC Browser":Ge(t,"CriOS")?u6:Ge(t,"CrMo")||Ge(t,vl)?vl:Ge(t,io)&&Ge(t,Ed)?p6:Ge(t,"FxiOS")?h6:Ge(t.toLowerCase(),dy.toLowerCase())?dy:Ge(t,Cd+"/")?Cd:((i,a)=>a&&Ge(a,i6)||(function(c){return Ge(c,Ed)&&!Ge(c,vl)&&!Ge(c,io)})(i))(t,e)?Ge(t,Yr)?m6:Ed:Ge(t,"PaleMoon/")?x6:Ge(t,rm+"/")?rm:Ge(t,Cc)?Cc:Ge(t,"MSIE")||Ge(t,"Trident/")?_2:Ge(t,"Gecko")?Cc:"")},OL={[d6]:[new RegExp("rv:"+Ht)],[f6]:[new RegExp(w2+"?\\/"+Ht)],[vl]:[new RegExp("("+vl+"|CrMo)\\/"+Ht)],[u6]:[new RegExp("CriOS\\/"+Ht)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ht)],[Ed]:[mv],[m6]:[mv],[x2]:[new RegExp("(Opera|OPR)\\/"+Ht)],[Cc]:[new RegExp(Cc+"\\/"+Ht)],[h6]:[new RegExp("FxiOS\\/"+Ht)],[dy]:[new RegExp("Konqueror[:/]?"+Ht,"i")],[qc]:[new RegExp(qc+" "+Ht),mv],[p6]:[new RegExp("android\\s"+Ht,"i")],[c6]:[new RegExp(l6+"\\/"+Ht)],[y6]:[new RegExp("OculusBrowser\\/"+Ht)],[tm]:[new RegExp(tm+"\\/"+Ht)],[_6]:[new RegExp("YaBrowser\\/"+Ht)],[nm]:[new RegExp(nm+"\\/"+Ht)],[Cd]:[new RegExp(Cd+"\\/"+Ht)],[fy]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Ht)],[x6]:[new RegExp("PaleMoon\\/"+Ht)],[rm]:[new RegExp(rm+"\\/"+Ht)],[w6]:[new RegExp("GSA\\/"+Ht)],[_2]:[new RegExp("(rv:|MSIE )"+Ht)],Mozilla:[new RegExp("rv:"+Ht)]},LL=function(t,e,n,r){var s=b6(t,e,n,r),i=OL[s];if(ge(i))return null;for(var a=0;i.length>a;a++){var c=t.match(i[a]);if(c)return parseFloat(c[c.length-2])}return null},wE=[[new RegExp(kc+"; "+kc+" (.*?)[);]","i"),t=>[kc,t&&t[1]||""]],[new RegExp(zd,"i"),[zd,""]],[new RegExp(Ud,"i"),[Ud,""]],[b2,[qc,""]],[new RegExp(gd,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[cy,""];if(new RegExp(Yr).test(e)&&!/IEMobile\b/.test(e))return[gd+" "+Yr,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var r=ML[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[gd,r]}return[gd,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[em,[t[3],t[4],t[5]||"0"].join(".")]:[em,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=ge(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+io+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+io+")","i"),t=>t&&t[2]?[io,[t[2],t[3],t[4]||"0"].join(".")]:[io,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[kL,""]],[/Linux|debian/i,["Linux",""]]],bE=function(t){return IL.test(t)?zd:AL.test(t)?Ud:RL.test(t)?kc:new RegExp(uy,"i").test(t)?uy:new RegExp("("+cy+"|WPDesktop)","i").test(t)?cy:/iPad/.test(t)?s6:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?o6:b2.test(t)?qc:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(xE,"i").test(t)?xE:/(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(Yr).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)?io:r6:new RegExp("(pda|"+Yr+")","i").test(t)?TL:new RegExp(Zc,"i").test(t)&&!new RegExp(Zc+" pc","i").test(t)?v6:""},NL=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function SE(t,e){return typeof(n=t)=="string"&&NL.test(n)?t:e();var n}function oa(t){return t&&t.split("#")[0]}function Sp(t,e){var n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}var DL=t=>t instanceof Error,S6={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}},jL=S6.info;function E6(t){if($s(t))return{boolValue:t};if(typeof t=="number")return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if(typeof t=="string")return{stringValue:t};if(Qe(t))return{arrayValue:{values:t.map((e=>E6(e)))}};try{return{stringValue:JSON.stringify(t)}}catch{return{stringValue:String(t)}}}function sm(t){var e=[];for(var n in t){var r=t[n];ur(r)||ge(r)||e.push({key:n,value:E6(r)})}return e}function FL(t,e){var n=S6[t.level||"info"]||jL,r=n.text,s=n.number,i=String(Date.now())+"000000",a={};e.distinctId&&(a.posthogDistinctId=e.distinctId),e.sessionId&&(a.sessionId=e.sessionId),e.windowId&&(a["window.id"]=e.windowId),Je(e.sessionStartTimestamp)||(a.sessionStartTimestamp=String(e.sessionStartTimestamp)),Je(e.lastActivityTimestamp)||(a.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(a["url.full"]=e.currentUrl),e.screenName&&(a["screen.name"]=e.screenName),e.appState&&(a["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(a.feature_flags=e.activeFeatureFlags);var c=ue({},a,t.attributes||{}),u={timeUnixNano:i,observedTimeUnixNano:i,severityNumber:s,severityText:r,body:{stringValue:t.body},attributes:sm(c)};return t.trace_id&&(u.traceId=t.trace_id),t.span_id&&(u.spanId=t.span_id),ge(t.trace_flags)||(u.flags=t.trace_flags),u}function C6(t,e,n){return ue({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":n})}function k6(t,e,n,r){return{resourceLogs:[{resource:{attributes:sm(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}let VL=class{constructor(t,e,n,r,s,i,a){var c;i===void 0&&(i=()=>Promise.resolve()),this._instance=t,this.Te=e,this.Ge=n,this.Ye=r,this.Xe=s,this.et=i,this.tt=a,this.rt=null,this.it=0,this.nt=0,this.st=0,this.ot=0,this.ut=!1,this.ht=e.maxBufferSize,this.dt=Math.max((c=e.maxQueueSize)!==null&&c!==void 0?c:e.maxBufferSize,e.maxBufferSize),this.ct=e.flushIntervalMs,this.vt=e.maxBatchRecordsPerPost,this.ft=e.rateCapWindowMs,this.yt=e.maxLogsPerInterval}reset(){this.bt(),this.rt=null,this.st=0,this.ot=0,this.ut=!1,this.it=0,this.nt=0,this.vt=this.Te.maxBatchRecordsPerPost}onReconnect(){this.nt=0,this._t()}captureLog(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&t!=null&&t.body){var e=this.wt(t);if(e!==null)if(e.body){if(this.xt()){var n={record:FL(e,this.Ye())};this.Xe((()=>this.kt(n)))}}else this.Ge.info("Log was rejected in beforeSend function")}}wt(t){var e=this.Te.beforeSend;if(!e)return t;var n=Qe(e)?e:[e],r=t;for(var s of n)try{var i=s(r);if(!i)return this.Ge.info("Log was rejected in beforeSend function"),null;r=i}catch(a){return this.Ge.error("Error in beforeSend function for log:",a),null}return r}xt(){if(this.yt===void 0)return!0;var t=Date.now(),e=t-this.st;return this.ft>e&&e>=0||(this.st=t,this.ot=0,this.ut=!1),this.yt>this.ot?(this.ot++,!0):(this.ut||(this.Ge.warn("captureLog dropping logs: exceeded "+this.yt+" logs per "+this.ft+"ms"),this.ut=!0),!1)}flush(){var t=this;return Jt((function*(){if(!t._instance.isDisabled)return t.rt||(t.rt=t.St().finally((()=>{t.rt=null}))),t.rt}))()}St(){var t=this;return Jt((function*(){var e;t.bt();var n=(e=t._instance.getPersistedProperty(Ki.LogsQueue))!==null&&e!==void 0?e:[];if(n.length!==0)for(var r=n.length,s=0;n.length>0&&r>s;){var i,a;t.it=0;var c=Math.min(n.length,t.vt),u=n.slice(0,c),f=k6(u.map((p=>p.record)),t.Ct(),(i=t.tt)!==null&&i!==void 0?i:t._instance.getLibraryId(),t._instance.getLibraryVersion()),h=yield t._instance.Tt(f);if(h.kind==="too-large"&&u.length>1)t.vt=Math.max(1,Math.floor(u.length/2)),t.Ge.warn("Received 413 when sending logs batch of size "+u.length+", reducing batch size to "+t.vt);else if(h.kind==="retry-later"||(h.kind==="too-large"?t.Ge.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):h.kind==="ok"&&t.Te.maxBatchRecordsPerPost>t.vt&&(t.vt=Math.min(t.Te.maxBatchRecordsPerPost,t.vt+1)),yield t.It(u.length),n=(a=t._instance.getPersistedProperty(Ki.LogsQueue))!==null&&a!==void 0?a:[],s+=u.length,h.kind==="fatal"))throw h.error}}))()}It(t){var e=this;return Jt((function*(){var n,r=Math.max(0,t-e.it),s=(n=e._instance.getPersistedProperty(Ki.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(Ki.LogsQueue,s.slice(r)),yield e.et()}))()}Ct(){return C6(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion())}kt(t){var e;if(!this._instance.optedOut){var n=(e=this._instance.getPersistedProperty(Ki.LogsQueue))!==null&&e!==void 0?e:[];this.dt>n.length||(n.shift(),this.it++,this.Ge.info("Logs queue is full, dropping oldest record.")),n.push(t),this._instance.setPersistedProperty(Ki.LogsQueue,n),this.ht>n.length?this.Mt():this._t()}}Mt(t){t===void 0&&(t=this.ct),this.Et||(this.Et=Sp((()=>{this.Et=void 0,this._t()}),t))}Rt(){var t=Math.min(Math.max(0,this.nt-1),6);return this.ct*Math.pow(2,t)}Pt(){var t=this._instance.getPersistedProperty(Ki.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return Jt((function*(){e.bt();var n=e.flush().catch((()=>{}));t!==void 0?yield Promise.race([n,new Promise((r=>Sp(r,t)))]):yield n}))()}flushWithTimeout(t){var e=this;return Jt((function*(){var n=!1,r=e.flush(),s=new Promise((i=>Sp((()=>{n=!0,i()}),t)));try{yield Promise.race([r,s])}finally{n&&r.catch((()=>{}))}}))()}_t(){this.flush().then((()=>{this.nt=0}),(t=>{this.nt++,this.Ge.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.Pt()&&this.Mt(this.Rt())}))}bt(){this.Et&&(clearTimeout(this.Et),this.Et=void 0)}};var gv=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function EE(t){return String(t)+"000000"}function CE(t,e,n,r){var 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}let $L=class{constructor(t,e,n){this._instance=t,this.Te=e,this.Ge=n,this.Ot=new Map,this.rt=null,this.Ft=!1,this.Lt=new Map,this.$t=new Set,this.At=0}count(t,e,n){e===void 0&&(e=1),this.Nt({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.Nt({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.Nt({name:t,type:"histogram",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}flush(){var t=this,e=this.rt,n=(function(){var s=Jt((function*(){e&&(yield e.catch((()=>{}))),yield t.Dt()}));return function(){return s.apply(this,arguments)}})(),r=n().finally((()=>{this.rt===r&&(this.rt=null)}));return this.rt=r,r}drainWindow(){if(this.Ot.size===0)return null;var t=this.Ot;return this.Ot=new Map,this.Ft=!1,this.Lt=new Map,this.$t=new Set,this.qt(t)}reset(){this.At++,this.bt(),this.Ot=new Map,this.rt=null,this.Ft=!1,this.Lt=new Map,this.$t=new Set}Nt(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.wt(t);if(e!==null)if(e.name&&typeof e.name=="string")if(typeof e.value=="number"&&Number.isFinite(e.value))if(e.type==="count"&&0>e.value)this.Ge.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var n,r;try{n=e.attributes?ue({},e.attributes):void 0,r=CE(e.type,e.name,e.unit,n)}catch(a){return void this.Ge.warn("Dropping metric '"+e.name+"': attributes could not be serialized",a)}var s=this.Ot.get(r);if(!s){if(!this.jt())return;s={name:e.name,type:e.type,unit:e.unit,attributes:n,windowStartMs:Date.now()},this.Ot.set(r,s)}var i=this.Lt.get(e.name);i===void 0?this.Lt.set(e.name,e.type):i===e.type||this.$t.has(e.name)||(this.$t.add(e.name),this.Ge.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.Ht(s,e.value),this.Mt()}else this.Ge.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.Ge.warn("Dropping metric with empty name")}}jt(){return this.Te.maxSeriesPerFlush>this.Ot.size||(this.Ft||(this.Ft=!0,this.Ge.warn("Metric series cap reached ("+this.Te.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Ht(t,e){var n;switch(t.type){case"count":t.total=((n=t.total)!==null&&n!==void 0?n:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(gv.length+1).fill(0)});var r=t.hist;r.count+=1,r.sum+=e,r.min=Math.min(r.min,e),r.max=Math.max(r.max,e),r.bucketCounts[(function(s,i){for(var a=0;i.length>a;a++)if(i[a]>=s)return a;return i.length})(e,gv)]+=1}}wt(t){var e=this.Te.beforeSend;if(!e)return t;var n=Qe(e)?e:[e],r=t;for(var s of n)try{var i=s(r);if(!i)return this.Ge.info("Metric was rejected in beforeSend function"),null;r=i}catch(a){return this.Ge.error("Error in beforeSend function for metric:",a),null}return r}Mt(){this.Et||(this.Et=Sp((()=>{this.Et=void 0,this.flush().catch((t=>{this.Ge.error("Metrics flush failed:",t)}))}),this.Te.flushIntervalMs))}bt(){this.Et&&(clearTimeout(this.Et),this.Et=void 0)}Dt(){var t=this;return Jt((function*(){if(t.Ot.size!==0){var e=t.Ot;t.Ot=new Map,t.Ft=!1,t.Lt=new Map,t.$t=new Set;var n=t.At,r=yield t._instance.Bt(t.qt(e));if(n===t.At)switch(r.kind){case"ok":return;case"retry-later":return t.Ut(e),void t.Mt();case"too-large":return void t.Ge.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.Ge.error("Failed to send metrics batch:",r.error)}}}))()}qt(t){return e=this.zt(t),n=(function(i,a,c){return ue({},i.resourceAttributes,{"service.name":i.serviceName||"unknown_service"},i.environment&&{"deployment.environment":i.environment},i.serviceVersion&&{"service.version":i.serviceVersion},{"telemetry.sdk.name":a,"telemetry.sdk.version":c})})(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:sm(n)},scopeMetrics:[{scope:{name:r,version:s},metrics:e}]}]};var e,n,r,s}zt(t){var e=EE(Date.now()),n=new Map;for(var r of t.values()){var s,i=CE(r.type,r.name,r.unit,void 0),a=n.get(i);a||(a=ue({name:r.name},r.unit&&{unit:r.unit}),r.type==="count"?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:r.type==="gauge"?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},n.set(i,a));var c=sm((s=r.attributes)!==null&&s!==void 0?s:{}),u=EE(r.windowStartMs);if(r.type==="count"){var f,h={attributes:c,startTimeUnixNano:u,timeUnixNano:e,asDouble:(f=r.total)!==null&&f!==void 0?f:0};a.sum.dataPoints.push(h)}else if(r.type==="gauge"){var p,m={attributes:c,timeUnixNano:e,asDouble:(p=r.last)!==null&&p!==void 0?p:0};a.gauge.dataPoints.push(m)}else r.hist&&a.histogram.dataPoints.push({attributes:c,startTimeUnixNano:u,timeUnixNano:e,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:gv})}return Array.from(n.values())}Ut(t){var e,n;for(var r of t){var s=r[0],i=r[1],a=this.Ot.get(s);if(a)switch(a.windowStartMs=Math.min(a.windowStartMs,i.windowStartMs),a.type){case"count":a.total=((e=a.total)!==null&&e!==void 0?e:0)+((n=i.total)!==null&&n!==void 0?n:0);break;case"gauge":break;case"histogram":if(i.hist)if(a.hist){a.hist.count+=i.hist.count,a.hist.sum+=i.hist.sum,a.hist.min=Math.min(a.hist.min,i.hist.min),a.hist.max=Math.max(a.hist.max,i.hist.max);for(var c=0;a.hist.bucketCounts.length>c;c++)a.hist.bucketCounts[c]+=i.hist.bucketCounts[c]}else a.hist=i.hist}else this.jt()&&this.Ot.set(s,i)}}};var Wh,kE,vv;function HL(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return vv&&n.length===kE||(kE=n.length,vv=n.reduce(((r,s)=>{Wh||(Wh={});var i=Wh[s];if(i)r[i[0]]=i[1];else for(var a=t(s),c=a.length-1;c>=0;c--){var u=a[c],f=u==null?void 0:u.filename,h=e[s];if(f&&h){r[f]=h,Wh[s]=[f,h];break}}return r}),{})),vv}}class zL{constructor(e,n,r){r===void 0&&(r=[]),this.coercers=e,this.stackParser=n,this.modifiers=r}buildFromUnknown(e,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(r,n,0).apply(e),i=this.buildParsingContext(n),a=this.parseStacktrace(s,i);return{$exception_list:this.convertToExceptionList(a,r),$exception_level:"error"}}modifyFrames(e){var n=this;return Jt((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&Qe(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return e}))()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var r,s;return e.cause!=null&&(r=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?n.skipFirstLines:0),n.chunkIdMap)),ue({},e,{cause:r,stack:s})}applyChunkIds(e,n){return e.map((r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r)))}applyCoercers(e,n){for(var r of this.coercers)if(r.match(e))return r.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return Jt((function*(){var r=e;for(var s of n.modifiers)r=yield s(r);return r}))()}convertToExceptionList(e,n){var r,s,i,a={type:e.type,value:e.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(s=n.handled)===null||s===void 0||s,synthetic:(i=e.synthetic)!==null&&i!==void 0&&i}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var c=[a];return e.cause!=null&&c.push(...this.convertToExceptionList(e.cause,ue({},n,{handled:!0}))),c}buildParsingContext(e){var n;return{chunkIdMap:HL(this.stackParser),skipFirstLines:(n=e.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(e,n,r){r===void 0&&(r=0);var s=(i,a)=>{if(4>=a){var c=this.buildCoercingContext(e,n,a);return this.applyCoercers(i,c)}};return ue({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:e,apply:i=>s(i,r),next:i=>s(i,r+1)})}}var Yc="?";function hy(t,e,n,r,s){var i={platform:t,filename:e,function:n==="<anonymous>"?Yc:n,in_app:!0};return ge(r)||(i.lineno=r),ge(s)||(i.colno=s),i}var P6=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:Yc,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},UL=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,BL=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,WL=/\((\S*)(?::(\d+))(?::(\d+))\)/,GL=(t,e)=>{var n=UL.exec(t);if(n)return hy(e,n[1],Yc,+n[2],+n[3]);var r=BL.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){var s=WL.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}var i=P6(r[1]||Yc,r[2]);return hy(e,i[1],i[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},KL=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ZL=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,qL=(t,e)=>{var n=KL.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=ZL.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var s=n[3],i=n[1]||Yc,a=P6(i,s);return hy(e,s=a[1],i=a[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},PE=/\(error: (.*)\)/;class YL{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var r=_t(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?n+": "+e.message:n}isDOMException(e){return Jp(e,"DOMException")}isDOMError(e){return Jp(e,"DOMError")}}class XL{match(e){return(n=>n instanceof Error)(e)}coerce(e,n){return{type:this.getType(e),value:this.getMessage(e,n),stack:this.getStack(e),cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,n){var r=e.message;return String(r.error&&typeof r.error.message=="string"?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}}class QL{constructor(){}match(e){return Jp(e,"ErrorEvent")&&e.error!=null}coerce(e,n){var r;return n.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}var JL=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class eN{match(e){return typeof e=="string"}coerce(e,n){var r,s=this.getInfos(e),i=s[0],a=s[1];return{type:i??"Error",value:a??e,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var n="Error",r=e,s=e.match(JL);return s&&(n=s[1],r=s[2]),[n,r]}}var tN=["fatal","error","warning","log","info","debug"];function T6(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var s=n.slice(0,r).join(", ");if(e>=s.length)return r===n.length?s:s.length>e?s.slice(0,e)+"...":s}return""}class nN{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var r,s=this.getErrorPropertyFromObject(e);return s?n.apply(s):{type:this.getType(e),value:this.getValue(e),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return y2(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var n="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(n+=" with message: '"+e.message+"'"),n}if("message"in e&&typeof e.message=="string")return e.message;var r=this.getObjectClassName(e);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+T6(e)}isSeverityLevel(e){return _t(e)&&!ly(e)&&tN.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if({}.hasOwnProperty.call(e,n)){var r=e[n];if(DL(r))return r}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}}class rN{match(e){return y2(e)}coerce(e,n){var r,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+T6(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class sN{match(e){return n6(e)}coerce(e,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class iN{match(e){return Jp(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!y2(e))return!1;try{var n=e.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(e,n){var r,s=this.getUnhandledRejectionReason(e);return n6(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(s)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&e.detail!=null&&typeof e.detail=="object"&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var im="$message",om="$timestamp",oN=new Set([im,om]),yv={enabled:!0,max_bytes:32768};function am(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:yv.enabled,max_bytes:lN(t.max_bytes,yv.max_bytes)}:ue({},yv)}class aN{constructor(e){this.Vt=[],this.Wt=0,this.Te=am(e)}setConfig(e){this.Te=am(e),this.Zt()}add(e){var n=(function(s){var i;try{i=J8(s)}catch{return}try{var a=JSON.parse(i);if(!Lt(a))return;var c=a,u=c[im],f=c[om];return!_t(u)||u.trim().length===0||!_t(f)&&!Vn(f)?void 0:{step:c,json:i}}catch{return}})(e);if(n){var r=(function(s){if(typeof TextEncoder<"u")return new TextEncoder().encode(s).length;for(var i=encodeURIComponent(s),a=0,c=0;i.length>c;c++)i[c]==="%"?(a+=1,c+=2):a+=1;return a})(n.json);r>this.Te.max_bytes||(this.Vt.push({step:n.step,bytes:r}),this.Wt+=r,this.Zt())}}getAttachable(){return this.Vt.map((e=>e.step))}clear(){this.Vt=[],this.Wt=0}size(){return this.Vt.length}Zt(){for(;this.Wt>this.Te.max_bytes&&this.Vt.length>0;){var e=this.Vt.shift();e&&(this.Wt-=e.bytes)}}}function lN(t,e){if(!Vn(t)||t===1/0||t===-1/0)return e;var n=Math.floor(t);return 0>n?e:n}var R6=function(t,e){var n=(e===void 0?{}:e).debugEnabled,r={k(s){if(te&&(mt.DEBUG||te.POSTHOG_DEBUG||n)&&!ge(te.console)&&te.console){for(var i=("__rrweb_original__"in te.console[s])?te.console[s].__rrweb_original__:te.console[s],a=arguments.length,c=new Array(a>1?a-1:0),u=1;a>u;u++)c[u-1]=arguments[u];i(t,...c)}},debug(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("debug",...i)},info(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("log",...i)},warn(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("warn",...i)},error(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("error",...i)},critical(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];console.error(t,...i)},uninitializedWarning(s){r.error("You must initialize PostHog before calling "+s)},createLogger:(s,i)=>R6(t+" "+s,i)};return r},_e=R6("[PostHog.js]"),Ft=_e.createLogger,cN=Ft("[ExternalScriptsLoader]"),_v=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return cN.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=Se==null?void 0:Se.querySelectorAll("script");if(r){for(var s,i=function(){if(r[a].src===e){var u=r[a];return u.__posthog_loading_callback_fired?{v:n()}:(u.addEventListener("load",(f=>{u.__posthog_loading_callback_fired=!0,n(void 0,f)})),u.onerror=f=>n(f),{v:void 0})}},a=0;r.length>a;a++)if(s=i())return s.v}var c=()=>{if(!Se)return n("document not found");var u=Se.createElement("script");if(u.type="text/javascript",u.crossOrigin="anonymous",u.src=e,u.onload=p=>{u.__posthog_loading_callback_fired=!0,n(void 0,p)},u.onerror=p=>n(p),t.config.prepare_external_dependency_script&&(u=t.config.prepare_external_dependency_script(u)),!u)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")Se.head.appendChild(u);else{var f,h=Se.querySelectorAll("body > script");h.length>0?(f=h[0].parentNode)==null||f.insertBefore(u,h[0]):Se.body.appendChild(u)}};Se!=null&&Se.body?c():Se==null||Se.addEventListener("DOMContentLoaded",c)};$e.__PosthogExtensions__=$e.__PosthogExtensions__||{},$e.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e!=="remote-config"){var r;if(t.config.strict_script_versioning)r=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js");else{var s="/static/"+e+".js?v="+t.version;if(e==="toolbar"){var i=3e5;s=s+"&t="+Math.floor(Date.now()/i)*i}r=t.requestRouter.endpointFor("assets",s)}_v(t,r,n)}else{var a=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");_v(t,a,n)}},$e.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var r=t.requestRouter.endpointFor("api",e);_v(t,r,n)};mt.DEBUG=!1,mt.LIB_VERSION="1.407.5",mt.LIB_NAME="web";var A6="$people_distinct_id",lm="$device_id",xv="$device_model",vd="__alias",yd="__timers",py="$autocapture_disabled_server_side",my="$heatmaps_enabled_server_side",gy="$exception_capture_enabled_server_side",vy="$error_tracking_suppression_rules",yy="$error_tracking_capture_extension_exceptions",_y="$web_vitals_enabled_server_side",S2="$dead_clicks_enabled_server_side",E2="$product_tours_enabled_server_side",xy="$web_vitals_allowed_metrics",sl="$session_recording_remote_config",I6="$replay_sample_rate",M6="$replay_override_sampling",O6="$replay_override_linked_flag",L6="$replay_override_url_trigger",N6="$replay_override_event_trigger",yc="$sesid",C2="$session_is_sampled",tl="$enabled_feature_flags",Ep="$active_feature_flags",_d="$early_access_features",wy="$feature_flag_details",Cp="$feature_flag_payloads",by="$feature_flag_request_id",cm="$minimal_flag_called_events",Wi="$override_feature_flags",hc="$override_feature_flag_payloads",Ya="$stored_person_properties",Xa="$stored_group_properties",Sy="$surveys",um="$surveys_loaded_at",Ey="$surveys_activated",kp="$surveys_activated_session",xd="ph_product_tours",kd="$flag_call_reported",Cy="$flag_call_reported_session_id",ky="$feature_flag_errors",Bd="$feature_flag_evaluated_at",Ns="$user_state",Py="$client_session_props",Ty="$capture_rate_limit",Ry="$initial_campaign_params",Ay="$initial_referrer_info",dm="$initial_person_info",fm="$epp",Gh="$posthog_cookieless",D6="$cookieless_mode",j6="$sdk_debug_extensions_init_method",F6="$sdk_debug_extensions_init_time_ms",V6="$sdk_debug_recording_script_not_loaded",k2="PostHog loadExternalDependency extension not found.",Qa="on_reject",eo="always",nc="anonymous",rc="identified",Iy="identified_only",hm="visibilitychange",pm="beforeunload",pc="$pageview",wv="$pageleave",bv="$identify",TE="$groupidentify";function Kh(t,e){Qe(t)&&t.forEach(e)}function xt(t,e){if(!Je(t))if(Qe(t))t.forEach(e);else if(xL(t))t.forEach(((r,s)=>e(r,s)));else for(var n in t)t6.call(t,n)&&e(t[n],n)}var Rt=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];for(var s of n)for(var i in s)s[i]!==void 0&&(t[i]=s[i]);return t};function Pp(t){for(var e=Object.keys(t),n=e.length,r=new Array(n);n--;)r[n]=[e[n],t[e[n]]];return r}var RE=function(t){try{return t()}catch{return}},uN=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];return t.apply(this,n)}catch(s){_e.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),_e.critical(s)}}},P2=function(t){var e={};return xt(t,(function(n,r){(_t(n)&&n.length>0||Vn(n))&&(e[r]=n)})),e},dN=["herokuapp.com","vercel.app","netlify.app"];function fN(t){var e=t==null?void 0:t.hostname;if(!_t(e))return!1;var n=e.split(".").slice(-2).join(".");for(var r of dN)if(n===r)return!1;return!0}function zt(t,e,n,r){var s=r??{},i=s.capture,a=s.passive;t==null||t.addEventListener(e,n,{capture:i!==void 0&&i,passive:a===void 0||a})}function $6(t){return t.name==="ph_toolbar_internal"}var H6=t=>{if(Se){try{for(var e=t+"=",n=Se.cookie.split(";").filter((i=>i.length)),r=0;n.length>r;r++){for(var s=n[r];s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}}catch{}return null}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Vn(t)&&isFinite(t)&&Math.floor(t)===t});class mm{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,r,s){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(s)||0>e||0>n||0>r||0>s||e>0xffffffffffff||n>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");var 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 mm(i)}toString(){for(var e="",n=0;this.bytes.length>n;n++)e=e+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new mm(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var n=0;16>n;n++){var r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class hN{generate(){var e=this.generateOrAbort();if(!ge(e))return e;this.S=0;var n=this.generateOrAbort();if(ge(n))throw new Error("Could not generate UUID after timestamp reset");return n}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.C();else{if(this.S>=e+1e4)return;this.I++,this.I>4398046511103&&(this.S++,this.C())}return mm.fromFieldsV7(this.S,Math.trunc(this.I/Math.pow(2,30)),this.I&Math.pow(2,30)-1,this.M.nextUint32())}C(){this.I=1024*this.M.nextUint32()+(1023&this.M.nextUint32())}constructor(){this.S=0,this.I=0,this.M=new pN}}var AE,z6=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};te&&!ge(te.crypto)&&crypto.getRandomValues&&(z6=t=>crypto.getRandomValues(t));class pN{nextUint32(){return this.R.length>this.O||(z6(this.R),this.O=0),this.R[this.O++]}constructor(){this.R=new Uint32Array(8),this.O=1/0}}var Yi=()=>mN().toString(),mN=()=>(AE||(AE=new hN)).generate(),td="",gN=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,to={N:()=>!!Se,D(t){_e.error("cookieStore error: "+t)},A:H6,F(t){var e;try{e=JSON.parse(to.A(t))||{}}catch{}return e},q(t,e,n,r,s){if(!Se)return!1;try{var i="",a="",c=(function(h,p){if(p){var m=(function(x,y){if(y===void 0&&(y=Se),td)return td;if(!y||["localhost","127.0.0.1"].includes(x))return"";for(var w=x.split("."),S=Math.min(w.length,8),T="dmn_chk_"+Yi();!td&&S--;){var P=w.slice(S).join("."),k=T+"=1;domain=."+P+";path=/";y.cookie=k+";max-age=3",y.cookie.includes(T)&&(y.cookie=k+";max-age=0",td=P)}return td})(h);if(!m){var _=(x=>{var y=x.match(gN);return y?y[0]:""})(h);_!==m&&_e.info("Warning: cookie subdomain discovery mismatch",_,m),m=_}return m?"; domain=."+m:""}return""})(Se.location.hostname,r);if(n){var u=new Date;u.setTime(u.getTime()+864e5*n),i="; expires="+u.toUTCString()}s&&(a="; secure");var f=t+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+c+a;return f.length>3686.4&&_e.warn("cookieStore warning: large cookie, len="+f.length),Se.cookie=f,!0}catch{return!1}},P(t,e){if(Se!=null&&Se.cookie)try{to.q(t,"",-1,e)}catch{return}}},Sv=null,bt={N(){if(!ur(Sv))return Sv;var t=!0;if(ge(te))t=!1;else try{var e="__mplssupport__";bt.q(e,"xyz"),bt.A(e)!=='"xyz"'&&(t=!1),bt.P(e)}catch{t=!1}return t||_e.error("localStorage unsupported; falling back to cookie store"),Sv=t,t},D(t){_e.error("localStorage error: "+t)},A(t){try{return te==null?void 0:te.localStorage.getItem(t)}catch(e){bt.D(e)}return null},F(t){try{return JSON.parse(bt.A(t))||{}}catch{}return null},q(t,e){try{return te==null||te.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){bt.D(n)}return!1},P(t){try{te==null||te.localStorage.removeItem(t)}catch(e){bt.D(e)}}},vN=[lm,"distinct_id",yc,C2,fm,dm,Ns],Zh={},yN={N:()=>!0,D(t){_e.error("memoryStorage error: "+t)},A:t=>Zh[t]||null,F:t=>Zh[t]||null,q:(t,e)=>(Zh[t]=e,!0),P(t){delete Zh[t]}},ja=null,Dn={N(){if(!ur(ja))return ja;if(ja=!0,ge(te))ja=!1;else try{var t="__support__";Dn.q(t,"xyz"),Dn.A(t)!=='"xyz"'&&(ja=!1),Dn.P(t)}catch{ja=!1}return ja},D(t){_e.error("sessionStorage error: ",t)},A(t){try{return te==null?void 0:te.sessionStorage.getItem(t)}catch(e){Dn.D(e)}return null},F(t){try{return JSON.parse(Dn.A(t))||null}catch{}return null},q(t,e){try{return te==null||te.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){Dn.D(n)}return!1},P(t){try{te==null||te.sessionStorage.removeItem(t)}catch(e){Dn.D(e)}}};class _N{constructor(e){this._instance=e}get Te(){return this._instance.config}get consent(){return this.Gt()?0:this.Qt}isOptedOut(){return this.Te.cookieless_mode===eo||this.isRejected()||this.consent===-1&&this.Te.cookieless_mode===Qa}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Te.opt_out_capturing_by_default}optInOut(e){this.Jt.q(this.Kt,e?1:0,this.Te.cookie_expiration,this.Te.cross_subdomain_cookie,this.Te.secure_cookie)}reset(){this.Jt.P(this.Kt,this.Te.cross_subdomain_cookie)}get Kt(){var e=this._instance.config,n=e.token,r=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(r?r+n:"__ph_opt_in_out_"+n)}get Qt(){var e=this.Jt.A(this.Kt);return pv(e)?1:Ge(EL,e)?0:-1}get Jt(){var e=this.Te.opt_out_capturing_persistence_type,n=e==="localStorage"?bt:to;if(!this.Yt||this.Yt!==n){this.Yt=n;var r=e==="localStorage"?to:bt;r.A(this.Kt)&&(this.Yt.A(this.Kt)||this.optInOut(pv(r.A(this.Kt))),r.P(this.Kt,this.Te.cross_subdomain_cookie))}return this.Yt}Gt(){return!!this.Te.respect_dnt&&[or==null?void 0:or.doNotTrack,or==null?void 0:or.msDoNotTrack,$e.doNotTrack].some((e=>pv(e)))}}function U6(t,e){var n,r=t==null||(n=t.config)==null?void 0:n.get_current_url;if(!Vs(r))return e;try{var s=r(e);return _t(s)&&s?s:e}catch(i){return _e.error("Error in get_current_url, falling back to window.location.href",i),e}}var B6="__POSTHOG_TOOLBAR__",xN=1,wN=3,bN=11;function IE(t){return t instanceof Element&&(t.id===B6||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function aa(t){return!!t&&t.nodeType===xN}function Kr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function W6(t){return!!t&&t.nodeType===wN}function G6(t){return!!t&&t.nodeType===bN&&aa(t.host)}var K6=1e3;function T2(t){return t?t0(t).split(/\s+/):[]}function ME(t,e){var n=(function(r){var s,i=te==null||(s=te.location)==null?void 0:s.href;return ge(i)?void 0:U6(r,i)})(e);return!!(n&&t&&t.some((r=>n.match(r))))}function gm(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return T2(e)}function Z6(t){return Je(t)?null:t0(t).split(/(\s+)/).filter((e=>Pd(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Wd(t){var e="";return Oy(t)&&!Q6(t)&&t.childNodes&&t.childNodes.length&&xt(t.childNodes,(function(n){var r;W6(n)&&n.textContent&&(e+=(r=Z6(n.textContent))!==null&&r!==void 0?r:"")})),t0(e)}function Ev(t){var e;return ge(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var R2=["a","button","form","input","select","textarea","label"];function My(t,e){if(ge(e))return!0;var n,r=function(i){if(e.some((a=>(function(c,u){var f=c.matches||c.matchesSelector||c.msMatchesSelector||c.mozMatchesSelector||c.webkitMatchesSelector||c.oMatchesSelector;try{return!!f&&f.call(c,u)}catch{return!1}})(i,a))))return{v:!0}};for(var s of t)if(n=r(s))return n.v;return!1}function q6(t){var e=t.parentNode;return!(!e||!aa(e))&&e}var SN=[".ph-no-autocapture","[data-ph-no-autocapture]"],Y6=["next","previous","prev",">","<"],EN=[...Y6,"+","-","−","–"],OE=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,LE=[".ph-no-rageclick",".ph-no-capture"],CN=["","text","search","email","password","url","tel","number"];function NE(t,e){if(!te||A2(t))return!1;var n,r,s,i,a;if($s(e)?(n=!!e&&LE,r=void 0,s=!1):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:LE,r=e==null?void 0:e.content_ignorelist,s=(a=e==null?void 0:e.ignore_text_selection)!==null&&a!==void 0&&a),n===!1||s&&(function(u){return!(!u||!aa(u))&&(!!Kr(u,"textarea")||(Kr(u,"input")?Ge(CN,(u.getAttribute("type")||"").toLowerCase()):(function(f){if(f.isContentEditable)return!0;var h=f.getAttribute==null?void 0:f.getAttribute("contenteditable");return h==="true"||h===""})(u)))})(t))return!1;var c=X6(t,!1).targetElementList;return!(function(u,f){if(u===!1||ge(u))return!1;var h;if(u===!0)h=Y6;else{if(!Qe(u))return!1;if(u.length>10)return _e.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 f.some((p=>{var m=p.safeText,_=p.ariaLabel;return h.some((x=>OE(m,x)||OE(_,x)))}))})(r,c.map((u=>{var f;return{safeText:Wd(u).toLowerCase(),ariaLabel:((f=u.getAttribute("aria-label"))==null?void 0:f.toLowerCase().trim())||""}})))&&!My(c,n)}var A2=t=>!t||Kr(t,"html")||!aa(t),X6=(t,e)=>{if(!te||A2(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[t],s=t;s.parentNode&&!Kr(s,"body");)if(G6(s.parentNode))r.push(s.parentNode.host),s=s.parentNode.host;else{var i=q6(s);if(!i)break;if(e||R2.indexOf(i.tagName.toLowerCase())>-1)n=!0;else try{var a=te.getComputedStyle(i);a&&a.getPropertyValue("cursor")==="pointer"&&(n=!0)}catch{}r.push(i),s=i}return{parentIsUsefulElement:n,targetElementList:r}};function Oy(t){for(var e=new Set,n=0,r=t;r.parentNode&&!Kr(r,"body");r=r.parentNode){if(n++>=K6||e.has(r))return!1;e.add(r);var s=gm(r);if(Ge(s,"ph-sensitive")||Ge(s,"ph-no-capture"))return!1}if(Ge(gm(t),"ph-include"))return!0;var i=t.type||"";if(_t(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var a=t.name||t.id||"";return!_t(a)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,""))}function Q6(t){return!!(Kr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Kr(t,"select")||Kr(t,"textarea")||t.getAttribute("contenteditable")==="true")}var J6="(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})",kN=new RegExp("^(?:"+J6+")$"),PN=new RegExp(J6),eP="\\d{3}-?\\d{2}-?\\d{4}",TN=new RegExp("^("+eP+")$"),RN=new RegExp("("+eP+")");function Pd(t,e){return e===void 0&&(e=!0),!(Je(t)||_t(t)&&(t=t0(t),(e?kN:PN).test((t||"").replace(/[- ]/g,""))||(e?TN:RN).test(t)))}function DE(t){var e=Wd(t);return Pd(e=(e+" "+tP(t)).trim())?e:""}function tP(t){var e="";return t&&t.childNodes&&t.childNodes.length&&xt(t.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var s=Wd(n);e=(e+" "+s).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+tP(n)).trim())}catch(i){_e.error("[AutoCapture]",i)}})),e}function jE(t){return t.replace(/"|\\"/g,'\\"')}function AN(t){var e=t.attr__class;if(e)return Qe(e)?e:T2(e)}var qh=Ft("[Dead Clicks]"),IN=()=>!0,MN=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(S2)),r=t.instance.config.capture_dead_clicks;return $s(r)?r:!!Lt(r)||n};class FE{get lazyLoadedDeadClicksAutocapture(){return this.Xt}constructor(e,n,r){this.instance=e,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){if(e.ok){var n=e.config;"captureDeadClicks"in n&&(this.instance.persistence&&this.instance.persistence.register({[S2]:n.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.er((()=>{this.tr()})):this.stop()}er(e){var n,r;(n=$e.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture?e():(r=$e.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(s=>{s?qh.error("failed to load script",s):e()}))}tr(){var e;if(Se){if(!this.Xt&&(e=$e.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=Lt(this.instance.config.capture_dead_clicks)?ue({},this.instance.config.capture_dead_clicks):{};n.__onCapture=this.onCapture,this.onCapture&&(n.capture_dead_swipes=!1),this.Xt=$e.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.Xt.start(Se),qh.info("starting...")}}else qh.error("`document` not found. Cannot start.")}stop(){this.Xt&&(this.Xt.stop(),this.Xt=void 0,qh.info("stopping..."))}}var Cv=Ft("[SegmentIntegration]"),nP="posthog-js";function rP(t,e){var n=e===void 0?{}:e,r=n.organization,s=n.projectId,i=n.prefix,a=n.severityAllowList,c=a===void 0?["error"]:a,u=n.sendExceptionsToPostHog,f=u===void 0||u;return h=>{var p,m,_,x,y;if(c!=="*"&&!c.includes(h.level)||!t.__loaded)return h;h.tags||(h.tags={});var w=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());h.tags["PostHog Person URL"]=w,t.sessionRecordingStarted()&&(h.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var S,T=((p=h.exception)==null?void 0:p.values)||[],P=T.map((R=>ue({},R,{stacktrace:R.stacktrace?ue({},R.stacktrace,{type:"raw",frames:(R.stacktrace.frames||[]).map((L=>ue({},L,{platform:"web:javascript"})))}):void 0}))),k={$exception_message:((m=T[0])==null?void 0:m.value)||h.message,$exception_type:(_=T[0])==null?void 0:_.type,$exception_level:h.level,$exception_list:P,$sentry_event_id:h.event_id,$sentry_exception:h.exception,$sentry_exception_message:((x=T[0])==null?void 0:x.value)||h.message,$sentry_exception_type:(y=T[0])==null?void 0:y.type,$sentry_tags:h.tags};return r&&s&&(k.$sentry_url=(i||"https://sentry.io/organizations/")+r+"/issues/?project="+s+"&query="+h.event_id),f&&((S=t.exceptions)==null||S.sendExceptionEvent(k)),h}}class ON{constructor(e,n,r,s,i,a){this.name=nP,this.setupOnce=function(c){c(rP(e,{organization:n,projectId:r,prefix:s,severityAllowList:i,sendExceptionsToPostHog:a==null||a}))}}}class VE{constructor(e){this.rr=(n,r,s)=>{s&&(s.noSessionId||s.activityTimeout||s.sessionPastMaximumLength||s.crossTabAdoption)&&(_e.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:s}),this.ir=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.nr()}nr(){var e;this.sr=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.rr)}destroy(){var e;(e=this.sr)==null||e.call(this),this.sr=void 0}doPageView(e,n){var r,s=this.ar(e,n);return this.ir={pathname:(r=te==null?void 0:te.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var n;return this.ar(e,(n=this.ir)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.ir)==null?void 0:e.pageViewId}}ar(e,n){var r=this.ir;if(!r)return{$pageview_id:n};var s={$pageview_id:n,$prev_pageview_id:r.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var a=i.maxScrollHeight,c=i.lastScrollY,u=i.maxScrollY,f=i.maxContentHeight,h=i.lastContentY,p=i.maxContentY;if(!(ge(a)||ge(c)||ge(u)||ge(f)||ge(h)||ge(p))){a=Math.ceil(a),c=Math.ceil(c),u=Math.ceil(u),f=Math.ceil(f),h=Math.ceil(h),p=Math.ceil(p);var m=a>1?hi(c/a,0,1,_e):1,_=a>1?hi(u/a,0,1,_e):1,x=f>1?hi(h/f,0,1,_e):1,y=f>1?hi(p/f,0,1,_e):1;s=Rt(s,{$prev_pageview_last_scroll:c,$prev_pageview_last_scroll_percentage:m,$prev_pageview_max_scroll:u,$prev_pageview_max_scroll_percentage:_,$prev_pageview_last_content:h,$prev_pageview_last_content_percentage:x,$prev_pageview_max_content:p,$prev_pageview_max_content_percentage:y})}}return r.pathname&&(s.$prev_pageview_pathname=r.pathname),r.timestamp&&(s.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),s}}var kv=["flags","surveys"],LN={[A6]:{exposure:"hidden"},[vd]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[yd]:{exposure:"hidden"},[py]:{exposure:"event"},[my]:{exposure:"hidden"},[gy]:{exposure:"event"},[vy]:{exposure:"hidden"},[yy]:{exposure:"event"},[_y]:{exposure:"event"},[S2]:{exposure:"event"},[E2]:{exposure:"hidden"},[xy]:{exposure:"event"},[sl]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[yc]:{exposure:"hidden"},[C2]:{exposure:"event"},[I6]:{exposure:"event",shouldSkipFromEventProperties:t=>ur(t)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[tl]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!Lt(t))return{};for(var e={},n=Object.keys(t),r=0;n.length>r;r++)e["$feature/"+n[r]]=t[n[r]];return e}},[Ep]:{exposure:"event",storageGroup:"flags"},[_d]:{exposure:"hidden"},[wy]:{exposure:"hidden",storageGroup:"flags"},[Cp]:{exposure:"event",storageGroup:"flags"},[by]:{exposure:"event",storageGroup:"flags",volatile:!0},[cm]:{exposure:"hidden",storageGroup:"flags"},[Wi]:{exposure:"event"},[hc]:{exposure:"hidden"},[Ya]:{exposure:"hidden"},[Xa]:{exposure:"hidden"},[Sy]:{exposure:"hidden",storageGroup:"surveys"},[um]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[Ey]:{exposure:"event"},[kp]:{exposure:"hidden"},[xd]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[kd]:{exposure:"hidden"},[Cy]:{exposure:"hidden"},[ky]:{exposure:"hidden"},[Bd]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Ns]:{exposure:"hidden"},[Py]:{exposure:"hidden"},[Ty]:{exposure:"hidden"},[Ry]:{exposure:"hidden"},[Ay]:{exposure:"hidden"},[dm]:{exposure:"hidden"},[fm]:{exposure:"hidden"},[M6]:{exposure:"event"},[O6]:{exposure:"event"},[L6]:{exposure:"event"},[N6]:{exposure:"event"},[j6]:{exposure:"event"},[F6]:{exposure:"event"},[V6]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},NN=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Fa=t=>{var e=LN[t];if(e)return e;for(var n of NN){var r=n[1];if(t.indexOf(n[0])===0)return r}},_c=(t,e)=>{try{return JSON.stringify(t,((n,r)=>typeof r=="bigint"?r.toString():r),e)}catch{return J8(t)}},vm=t=>{var e=Se==null?void 0:Se.createElement("a");return ge(e)?null:(e.href=t,e)},Xc=function(t,e){for(var n,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;r.length>s;s++){var i=r[s].split("=");if(i[0]===e){n=i;break}}if(!Qe(n)||2>n.length)return"";var a=n[1];try{a=decodeURIComponent(a)}catch{_e.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Gd=function(t,e,n){if(!t||!e||!e.length)return t;for(var r=t.split("#"),s=r[1],i=(r[0]||"").split("?"),a=i[1],c=i[0],u=(a||"").split("&"),f=[],h=0;u.length>h;h++){var p=u[h].split("=");Qe(p)&&(e.includes(p[0])?f.push(p[0]+"="+n):f.push(u[h]))}var m=c;return a!=null&&(m+="?"+f.join("&")),s!=null&&(m+="#"+s),m},ym=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},sP=(t,e)=>t>=e&&Y8(),iP=(t,e,n,r)=>{if(t===0){if(Y8()){var s=e+1;return s===n&&r(),s}return e}return 0},Yh="https?://(.*)",Qc=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],DN=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Qc],Kd="<masked>",jN=["li_fat_id"];function oP(t,e,n){if(!Se)return{};var r,s=e?[...Qc,...n||[]]:[],i=aP(Gd(Se.URL,s,Kd),t),a=(r={},xt(jN,(function(c){var u=H6(c);r[c]=u||null})),r);return Rt(a,i)}function aP(t,e){var n=DN.concat(e||[]),r={};return xt(n,(function(s){var i=Xc(t,s);r[s]=i||null})),r}function lP(t){var e=(function(i){return i?i.search(Yh+"google.([^/?]*)")===0?"google":i.search(Yh+"bing.com")===0?"bing":i.search(Yh+"yahoo.com")===0?"yahoo":i.search(Yh+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",r={};if(!ur(e)){r.$search_engine=e;var s=Se?Xc(Se.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function $E(){return navigator.language||navigator.userLanguage}var _m="$direct";function cP(){return(Se==null?void 0:Se.referrer)||_m}function uP(t,e,n){n===void 0&&(n=!1);var r=t?[...Qc,...e||[]]:[],s=n?oa(on==null?void 0:on.href):on==null?void 0:on.href,i=s==null?void 0:s.substring(0,1e3);return{r:cP().substring(0,1e3),u:i?Gd(i,r,Kd):void 0}}function dP(t,e){var n;e===void 0&&(e=!1);var r=t.r,s=t.u,i=e?oa(s):s,a={$referrer:r,$referring_domain:r==null?void 0:r==_m?_m:(n=vm(r))==null?void 0:n.host};if(i){a.$current_url=i;var c=vm(i);a.$host=c==null?void 0:c.host,a.$pathname=c==null?void 0:c.pathname;var u=aP(i);Rt(a,u)}if(r){var f=lP(r);Rt(a,f)}return a}function fP(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function FN(){try{return new Date().getTimezoneOffset()}catch{return}}var VN={flags:Bd,surveys:um},$N=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],sc="main";class Pv{constructor(e,n,r){if(r===void 0&&(r=!0),this.lr={},this.ur=!1,this.hr=!1,this.Te=e,this.dr=r,this.props={},this.cr=!1,this.vr=(i=>{var a="";return i.token&&(a=i.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),i.persistence_name?"ph_"+i.persistence_name:"ph_"+a+"_posthog"})(e),this.Jt=this.pr(e),this.hr=this.gr(e),this.load(),e.debug&&_e.info("Persistence loaded",e.persistence,ue({},this.props)),this.update_config(e,e,n),this.save(),te){var s=()=>this.flush();zt(te,"beforeunload",s,{capture:!1}),zt(te,"pagehide",s,{capture:!1})}}mr(){var e,n=(e=this.Te)==null?void 0:e.persistence_save_debounce_ms;return Vn(n)&&n>0?n:0}isDisabled(){return!!this.yr}pr(e){$N.indexOf(e.persistence.toLowerCase())===-1&&(_e.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n,r=(function(a,c){a===void 0&&(a=[]),c===void 0&&(c=!1);var u=[...vN,...a];return ue({},bt,{F(f){try{var h={};try{h=to.F(f)||{}}catch{}var p,m=JSON.parse(bt.A(f)||"{}");if(c){var _={};for(var x in h){var y=h[x];ur(y)||y===""||(_[x]=y)}p=Rt(m,_)}else p=Rt(h,m);return bt.q(f,p),p}catch{}return null},q(f,h,p,m,_,x){var y=bt.q(f,h,void 0,void 0,x);try{var w={};u.forEach((S=>{h[S]&&(w[S]=h[S])})),Object.keys(w).length&&to.q(f,w,p,m,_,x)}catch(S){bt.D(S)}return y},P(f,h){try{te==null||te.localStorage.removeItem(f),to.P(f,h)}catch(p){bt.D(p)}}})})(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),s=!1,i=e.persistence.toLowerCase();return i==="localstorage"&&bt.N()?(n=bt,s=!0):i==="localstorage+cookie"&&r.N()?(n=r,s=!0):i==="sessionstorage"&&Dn.N()?n=Dn:i==="memory"?n=yN:i==="cookie"?n=to:r.N()?(n=r,s=!0):n=to,this.ur=s,n}br(e){return this.vr+"__"+e}gr(e){return this.ur&&!!e.split_storage}_r(e){var n=e??this.Te.feature_flag_cache_ttl_ms;if(!n||0>=n)return!1;var r=this.props[Bd];return!r||typeof r!="number"||Date.now()-r>n}properties(){var e={};return xt(this.props,((n,r)=>{var s=Fa(r);if((s==null?void 0:s.exposure)==="derived"){if(s.shouldSkipFromEventProperties!=null&&s.shouldSkipFromEventProperties(n,r===tl?()=>this._r():()=>!1))return;s.transformToEventProperties&&Rt(e,s.transformToEventProperties(n))}else if(!s||s.exposure==="event"){if(s!=null&&s.shouldSkipFromEventProperties!=null&&s.shouldSkipFromEventProperties(n,(()=>!1)))return;e[r]=n}})),e}load(){if(!this.yr){var e=this.Jt.F(this.vr);e&&(this.props=Rt({},e)),this.hr&&this.wr()}}wr(){for(var e of kv){var n=bt.F(this.br(e));if(n&&!Yo(n)){var r=this.kr(e);r.persisted=!0,this.Sr(e)||(r.fingerprint=this.Cr(n,e)),this.Tr(e,n)||Rt(this.props,n)}}}Sr(e){return Object.keys(this.props).some((n=>{var r;return((r=Fa(n))==null?void 0:r.storageGroup)===e}))}Tr(e,n){var r=VN[e];if(!r)return!1;var s=n[r],i=this.props[r];return Vn(s)&&Vn(i)&&i>s}refreshKey(e){var n;if(!this.yr){var r=this.hr?(n=Fa(e))==null?void 0:n.storageGroup:void 0,s=r?bt.F(this.br(r)):this.Jt.F(this.vr);if(s&&e in s)this.Ir(e,s[e]);else{if(r){var i=this.Jt.F(this.vr);if(i&&e in i)return void this.Ir(e,i[e])}this.Mr(e)}}}save(){if(!this.yr){var e=this.mr();e>0?ge(this.Er)&&(this.Er=setTimeout((()=>{this.Er=void 0,this.Rr()}),e)):this.Rr()}}flush(){ge(this.Er)||(clearTimeout(this.Er),this.Er=void 0,this.Rr())}Rr(){this.yr||(this.hr?this.Pr():this.Or(this.Jt,this.vr,this.props,sc))}Pr(){var e=this.Fr(),n=e.main,r=e.groups;for(var s of(this.Or(this.Jt,this.vr,n,sc),kv)){var i,a=r[s];(!Yo(a)||(i=this.lr[s])!=null&&i.persisted)&&this.Or(bt,this.br(s),a,s)}}Fr(){var e={},n={flags:{},surveys:{}};return xt(this.props,((r,s)=>{var i,a=(i=Fa(s))==null?void 0:i.storageGroup;a?n[a][s]=r:e[s]=r})),{main:e,groups:n}}Cr(e,n){if(n===sc)return JSON.stringify(e)+"|"+this.Lr+"|"+this.$r+"|"+this.Ar;var r={};return xt(e,((s,i)=>{var a;r[i]=(a=Fa(i))!=null&&a.volatile?"__volatile__":s})),JSON.stringify(r)}Or(e,n,r,s){var i=this.kr(s);if(s===sc||i.dirty||ge(i.fingerprint)){var a;try{if((a=this.Cr(r,s))===i.fingerprint)return void(i.dirty=!1)}catch{a=void 0}e.q(n,r,this.Lr,this.$r,this.Ar,this.Te.debug)?(i.dirty=!1,s!==sc&&(i.persisted=!0),ge(a)||(i.fingerprint=a)):this.Te.debug&&_e.warn('failed to persist storage entry "'+n+'"; will retry on next save')}}remove(e){var n=(e===void 0?{}:e).keepGroupEntries,r=n!==void 0&&n;if(ge(this.Er)||(clearTimeout(this.Er),this.Er=void 0),this.Jt.P(this.vr,!1),this.Jt.P(this.vr,!0),!r&&this.dr)for(var s of kv)bt.P(this.br(s));r?delete this.lr[sc]:this.lr={}}clear(){this.remove(),this.props={}}register_once(e,n,r){if(Lt(e)){ge(n)&&(n="None"),this.Lr=ge(r)?this.Nr:r;var s=!1;if(xt(e,((i,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==n||(this.Ir(a,i),s=!0)})),s)return this.save(),!0}return!1}register(e,n){if(Lt(e)){this.Lr=ge(n)?this.Nr:n;var r=!1;if(xt(e,((s,i)=>{e.hasOwnProperty(i)&&this.props[i]!==s&&(this.Ir(i,s),r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Mr(e),this.save())}update_campaign_params(){if(!this.cr){var e=oP(this.Te.custom_campaign_params,this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties);Yo(P2(e))||this.register(e),this.cr=!0}}update_search_keyword(){var e;this.register((e=Se==null?void 0:Se.referrer)?lP(e):{})}update_referrer_info(){var e;this.register_once({$referrer:cP(),$referring_domain:Se!=null&&Se.referrer&&((e=vm(Se.referrer))==null?void 0:e.host)||_m},void 0)}set_initial_person_info(){this.props[Ry]||this.props[Ay]||this.register_once({[dm]:uP(this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties,this.Te.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};xt([Ay,Ry],(s=>{var i=this.props[s];i&&xt(i,(function(a,c){e["$initial_"+ay(c)]=a}))}));var n=this.props[dm];if(n){var r=(function(s,i){i===void 0&&(i=!1);var a=dP(s,i),c={};return xt(a,(function(u,f){c["$initial_"+ay(f)]=u})),c})(n,this.Te.disable_capture_url_hashes);Rt(e,r)}return e}safe_merge(e){return xt(this.props,(function(n,r){r in e||(e[r]=n)})),e}update_config(e,n,r){this.Nr=this.Lr=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var s=e.persistence!==n.persistence||!((u,f)=>{if(u.length!==f.length)return!1;var h=[...u].sort(),p=[...f].sort();return h.every(((m,_)=>m===p[_]))})(e.cookie_persisted_properties||[],n.cookie_persisted_properties||[]),i=s?this.pr(e):this.Jt,a=this.gr(e);if(s||a!==this.hr){var c=this.props;this.clear(),this.Jt=i,this.hr=a,this.props=c,this.save()}}set_disabled(e){this.yr=e,this.yr?this.remove():this.save()}set_cross_subdomain(e){e!==this.$r&&(this.$r=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Ar&&(this.Ar=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,n){var r=this.props[yd]||{};r[e]=n,this.Ir(yd,r),this.save()}remove_event_timer(e){var n=this.props[yd]||{},r=n[e];return ge(r)||(delete n[e],this.Ir(yd,n),this.save()),r}get_property(e){return this.props[e]}set_property(e,n){this.Ir(e,n),this.save()}Ir(e,n){var r;this.props[e]=n,(r=Fa(e))!=null&&r.volatile||this.Dr(e)}Mr(e){delete this.props[e],this.Dr(e)}Dr(e){var n,r=(n=Fa(e))==null?void 0:n.storageGroup;r&&(this.kr(r).dirty=!0)}kr(e){return this.lr[e]||(this.lr[e]={})}}var ir={GZipJS:"gzip-js",Base64:"base64"},nd={Activation:"events",Cancellation:"cancelEvents"},Tv={Popover:"popover",API:"api",Widget:"widget"},no={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},Rv={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},Ly={Popover:"popover",Inline:"inline"},HN={SHOWN:"product tour shown"},HE={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},zE=Ft("[RateLimiter]");class zN{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach((s=>{zE.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4}))}catch(s){return void zE.warn('could not rate limit - continuing. Error: "'+(s==null?void 0:s.message)+'"',{text:r})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var n,r,s;e===void 0&&(e=!1);var i=this.captureEventsBurstLimit,a=this.captureEventsPerSecond,c=new Date().getTime(),u=(n=(r=this.instance.persistence)==null?void 0:r.get_property(Ty))!==null&&n!==void 0?n:{tokens:i,last:c};u.tokens+=(c-u.last)/1e3*a,u.last=c,u.tokens>i&&(u.tokens=i);var f=1>u.tokens;return f||e||(u.tokens=Math.max(0,u.tokens-1)),!f||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+a+" events per second and "+i+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=f,(s=this.instance.persistence)==null||s.set_property(Ty,u),{isRateLimited:f,remainingTokens:u.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var rd=Ft("[RemoteConfig]");class hP{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=$e._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}qr(e){var n,r;(n=$e.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=$e.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):e()}jr(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(n){e(n.json)}})}load(){try{if(this.remoteConfig)return rd.info("Using preloaded remote config",this.remoteConfig),this.Hr(this.remoteConfig),void this.Br();if(this._instance.Ur())return void rd.warn("Remote config is disabled. Falling back to local config.");this.qr((e=>{if(!e)return rd.info("No config found after loading remote JS config. Falling back to JSON."),void this.jr((n=>{this.Hr(n),this.Br()}));this.Hr(e),this.Br()}))}catch(e){rd.error("Error loading remote config",e)}}stop(){this.zr&&(clearInterval(this.zr),this.zr=void 0)}refresh(){!this._instance.Ur()&&Se&&Se.visibilityState!=="hidden"&&this._instance.reloadFeatureFlags()}Br(){var e;if(!this.zr){var n=(e=this._instance.config.remote_config_refresh_interval_ms)!==null&&e!==void 0?e:3e5;n!==0&&(this.zr=setInterval((()=>{this.refresh()}),n))}}Hr(e){var n;e||rd.error("Failed to fetch remote config from PostHog."),this._instance.Hr(e?{ok:!0,config:e}:{ok:!1}),(e==null?void 0:e.hasFeatureFlags)!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(n=this._instance.featureFlags)==null||n.ensureFlagsLoaded())}}var ys=Uint8Array,kr=Uint16Array,Jc=Uint32Array,I2=new ys([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]),M2=new ys([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]),UE=new ys([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),pP=function(t,e){for(var n=new kr(31),r=0;31>r;++r)n[r]=e+=1<<t[r-1];var s=new Jc(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]},mP=pP(I2,2),Ny=mP[1];mP[0][28]=258,Ny[258]=28;for(var BE=pP(M2,0)[1],gP=new kr(32768),Dt=0;32768>Dt;++Dt){var ic=(43690&Dt)>>>1|(21845&Dt)<<1;gP[Dt]=((65280&(ic=(61680&(ic=(52428&ic)>>>2|(13107&ic)<<2))>>>4|(3855&ic)<<4))>>>8|(255&ic)<<8)>>>1}var Td=function(t,e,n){for(var r=t.length,s=0,i=new kr(e);r>s;++s)++i[t[s]-1];var a,c=new kr(e);for(s=0;e>s;++s)c[s]=c[s-1]+i[s-1]<<1;for(a=new kr(r),s=0;r>s;++s)a[s]=gP[c[t[s]-1]++]>>>15-t[s];return a},Cl=new ys(288);for(Dt=0;144>Dt;++Dt)Cl[Dt]=8;for(Dt=144;256>Dt;++Dt)Cl[Dt]=9;for(Dt=256;280>Dt;++Dt)Cl[Dt]=7;for(Dt=280;288>Dt;++Dt)Cl[Dt]=8;var xm=new ys(32);for(Dt=0;32>Dt;++Dt)xm[Dt]=5;var UN=Td(Cl,9),BN=Td(xm,5),vP=function(t){return(t/8>>0)+(7&t&&1)},yP=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof kr?kr:t instanceof Jc?Jc:ys)(n-e);return r.set(t.subarray(e,n)),r},Di=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},sd=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},Av=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 ys(0),0];if(s==1){var a=new ys(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(R,L){return R.f-L.f})),n.push({s:-1,f:25001});var c=n[0],u=n[1],f=0,h=1,p=2;for(n[0]={s:-1,f:c.f+u.f,l:c,r:u};h!=s-1;)c=n[n[p].f>n[f].f?f++:p++],u=n[f!=h&&n[p].f>n[f].f?f++:p++],n[h++]={s:-1,f:c.f+u.f,l:c,r:u};var m=i[0].s;for(r=1;s>r;++r)i[r].s>m&&(m=i[r].s);var _=new kr(m+1),x=Dy(n[h-1],_,0);if(x>e){r=0;var y=0,w=x-e,S=1<<w;for(i.sort((function(R,L){return _[L.s]-_[R.s]||R.f-L.f}));s>r;++r){var T=i[r].s;if(e>=_[T])break;y+=S-(1<<x-_[T]),_[T]=e}for(y>>>=w;y>0;){var P=i[r].s;e>_[P]?y-=1<<e-_[P]++-1:++r}for(;r>=0&&y;--r){var k=i[r].s;_[k]==e&&(--_[k],++y)}x=e}return[new ys(_),x]},Dy=function(t,e,n){return t.s==-1?Math.max(Dy(t.l,e,n+1),Dy(t.r,e,n+1)):e[t.s]=n},WE=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new kr(++e),r=0,s=t[0],i=1,a=function(u){n[r++]=u},c=1;e>=c;++c)if(t[c]==s&&c!=e)++i;else{if(!s&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(s),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(s);i=1,s=t[c]}return[n.subarray(0,r),e]},id=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},jy=function(t,e,n){var r=n.length,s=vP(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)},GE=function(t,e,n,r,s,i,a,c,u,f,h){Di(e,h++,n),++s[256];for(var p=Av(s,15),m=p[0],_=p[1],x=Av(i,15),y=x[0],w=x[1],S=WE(m),T=S[0],P=S[1],k=WE(y),R=k[0],L=k[1],O=new kr(19),A=0;T.length>A;++A)O[31&T[A]]++;for(A=0;R.length>A;++A)O[31&R[A]]++;for(var I=Av(O,7),N=I[0],j=I[1],F=19;F>4&&!N[UE[F-1]];--F);var K,X,W,G,q=f+5<<3,$=id(s,Cl)+id(i,xm)+a,ne=id(s,m)+id(i,y)+a+14+3*F+id(O,N)+(2*O[16]+3*O[17]+7*O[18]);if($>=q&&ne>=q)return jy(e,h,t.subarray(u,u+f));if(Di(e,h,1+($>ne)),h+=2,$>ne){K=Td(m,_),X=m,W=Td(y,w),G=y;var z=Td(N,j);for(Di(e,h,P-257),Di(e,h+5,L-1),Di(e,h+10,F-4),h+=14,A=0;F>A;++A)Di(e,h+3*A,N[UE[A]]);h+=3*F;for(var D=[T,R],Y=0;2>Y;++Y){var ee=D[Y];for(A=0;ee.length>A;++A)Di(e,h,z[ie=31&ee[A]]),h+=N[ie],ie>15&&(Di(e,h,ee[A]>>>5&127),h+=ee[A]>>>12)}}else K=UN,X=Cl,W=BN,G=xm;for(A=0;c>A;++A)if(r[A]>255){var ie;sd(e,h,K[257+(ie=r[A]>>>18&31)]),h+=X[ie+257],ie>7&&(Di(e,h,r[A]>>>23&31),h+=I2[ie]);var oe=31&r[A];sd(e,h,W[oe]),h+=G[oe],oe>3&&(sd(e,h,r[A]>>>5&8191),h+=M2[oe])}else sd(e,h,K[r[A]]),h+=X[r[A]];return sd(e,h,K[256]),h+X[256]},WN=new Jc([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),GN=(function(){for(var t=new Jc(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),Iv=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function KN(t,e){e===void 0&&(e={});var n=(function(){var p=4294967295;return{p(m){for(var _=p,x=0;m.length>x;++x)_=GN[255&_^m[x]]^_>>>8;p=_},d(){return 4294967295^p}}})(),r=t.length;n.p(t);var s,i,a,c,u,f=(c=10+((s=e).filename&&s.filename.length+1||0),u=8,(function(p,m,_,x,y,w){var S=p.length,T=new ys(x+S+5*(1+Math.floor(S/7e3))+y),P=T.subarray(x,T.length-y),k=0;if(!m||8>S)for(var R=0;S>=R;R+=65535){var L=R+65535;S>L?k=jy(P,k,p.subarray(R,L)):(P[R]=!0,k=jy(P,k,p.subarray(R,S)))}else{for(var O=WN[m-1],A=O>>>13,I=8191&O,N=(1<<_)-1,j=new kr(32768),F=new kr(N+1),K=Math.ceil(_/3),X=2*K,W=function(At){return(p[At]^p[At+1]<<K^p[At+2]<<X)&N},G=new Jc(25e3),q=new kr(288),$=new kr(32),ne=0,z=0,D=(R=0,0),Y=0,ee=0;S>R;++R){var ie=W(R),oe=32767&R,ce=F[ie];if(j[oe]=ce,F[ie]=oe,R>=Y){var xe=S-R;if((ne>7e3||D>24576)&&xe>423){k=GE(p,P,0,G,q,$,z,D,ee,R-ee,k),D=ne=z=0,ee=R;for(var ae=0;286>ae;++ae)q[ae]=0;for(ae=0;30>ae;++ae)$[ae]=0}var se=2,Ve=0,De=I,Re=oe-ce&32767;if(xe>2&&ie==W(R-Re))for(var Ye=Math.min(A,xe)-1,ut=Math.min(32767,R),kt=Math.min(258,xe);ut>=Re&&--De&&oe!=ce;){if(p[R+se]==p[R+se-Re]){for(var we=0;kt>we&&p[R+we]==p[R+we-Re];++we);if(we>se){if(se=we,Ve=Re,we>Ye)break;var je=Math.min(Re,we-2),ze=0;for(ae=0;je>ae;++ae){var it=R-Re+ae+32768&32767,Pt=it-j[it]+32768&32767;Pt>ze&&(ze=Pt,ce=it)}}}Re+=(oe=ce)-(ce=j[oe])+32768&32767}if(Ve){G[D++]=268435456|Ny[se]<<18|BE[Ve];var tt=31&Ny[se],Xe=31&BE[Ve];z+=I2[tt]+M2[Xe],++q[257+tt],++$[Xe],Y=R+se,++ne}else G[D++]=p[R],++q[p[R]]}}k=GE(p,P,!0,G,q,$,z,D,ee,R-ee,k)}return yP(T,0,x+vP(k)+y)})(i=t,(a=e).level==null?6:a.level,a.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+a.mem,c,u)),h=f.length;return(function(p,m){var _=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&&Iv(p,4,Math.floor(new Date(m.mtime||Date.now())/1e3)),_){p[3]=8;for(var x=0;_.length>=x;++x)p[x+10]=_.charCodeAt(x)}})(f,e),Iv(f,h-8,n.d()),Iv(f,h-4,r),f}var ZN=!!sy||!!v2,_P="text/plain",Tp=!1,xP=(t,e)=>{var n=t.split("#"),r=n[1],s=n[0].split("?"),i=s[0],a=s[1];if(!a)return t;var c=a.split("&").filter((u=>u.split("=")[0]!==e)).join("&");return i+(c?"?"+c:"")+(r?"#"+r:"")},O2=function(t,e,n){var r;n===void 0&&(n=!0);var s=t.split("?"),i=s[0],a=s[1],c=ue({},e),u=(r=a==null?void 0:a.split("&").map((h=>{var p,m=h.split("="),_=m[0],x=n&&(p=c[_])!==null&&p!==void 0?p:m[1];return delete c[_],_+"="+x})))!==null&&r!==void 0?r:[],f=(function(h,p){var m,_;p===void 0&&(p="&");var x=[];return xt(h,(function(y,w){ge(y)||ge(w)||w==="undefined"||(m=encodeURIComponent((S=>S instanceof File)(y)?y.name:y.toString()),_=encodeURIComponent(w),x[x.length]=_+"="+m)})),x.join(p)})(c);return f&&u.push(f),u.length>0?i+"?"+u.join("&"):i},Mv=t=>{if(t.Vr)return t.Vr;var e=t.data,n=t.compression;if(e){if(n===ir.GZipJS){var r=KN((function(c,u){var f=c.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(c);for(var h=new ys(c.length+(c.length>>>1)),p=0,m=function(w){h[p++]=w},_=0;f>_;++_){if(p+5>h.length){var x=new ys(p+8+(f-_<<1));x.set(h),h=x}var y=c.charCodeAt(_);128>y?m(y):2048>y?(m(192|y>>>6),m(128|63&y)):y>55295&&57344>y?(m(240|(y=65536+(1047552&y)|1023&c.charCodeAt(++_))>>>18),m(128|y>>>12&63),m(128|y>>>6&63),m(128|63&y)):(m(224|y>>>12),m(128|y>>>6&63),m(128|63&y))}return yP(h,0,p)})(_c(e)),{mtime:0});return{contentType:_P,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===ir.Base64){var s=(function(c){return c&&btoa(encodeURIComponent(c).replace(/%([0-9A-F]{2})/g,((u,f)=>String.fromCharCode(parseInt(f,16)))))})(_c(e)),i=(c=>"data="+encodeURIComponent(typeof c=="string"?c:_c(c)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var a=_c(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},wP=t=>{var e,n,r=()=>t.transport==="sendBeacon"?{url:O2(t.url,{compression:ir.Base64}),encodedBody:Mv(ue({},t,{compression:ir.Base64,Vr:void 0}))}:{url:xP(t.url,"compression"),encodedBody:Mv(ue({},t,{compression:void 0,Vr:void 0}))};try{e=Mv(t)}catch(s){if(vE(t.compression,Xc(t.url,"compression")))return _e.error("Failed to gzip request body, sending uncompressed payload",s),r();throw s}return e&&vE(t.compression,Xc(t.url,"compression"))&&!((n=e.body)instanceof ArrayBuffer?iy(new Uint8Array(n)):ArrayBuffer.isView(n)&&iy(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(Tp=!0,r()):{url:t.url,encodedBody:e}},bP=t=>{try{return wP(t)}catch(e){return _e.error(e),void(t.callback==null||t.callback({statusCode:0,error:e}))}},qN=(function(){var t=Jt((function*(e){var n=_c(e.data),r=yield(function(i,a,c){return oy.apply(this,arguments)})(n,mt.DEBUG,{rethrow:!0});if(!r)return e;var s=yield r.arrayBuffer();return ue({},e,{Vr:{contentType:_P,body:s,estimatedSize:s.byteLength}})}));return function(e){return t.apply(this,arguments)}})(),YN=/Failed to fetch|NetworkError|Load failed/i,SP=t=>{var e=bP(t);if(e){var n=e.url,r=e.encodedBody,s=r??{},i=s.contentType,a=s.body,c=s.estimatedSize,u=new Headers;xt(t.headers,(function(x,y){u.append(y,x)})),i&&u.append("Content-Type",i);var f=null,h=!1;if(dE){var p=new dE;f={signal:p.signal,timeout:setTimeout((()=>{var x,y;h=!0,p.abort((x=t.timeout,(y=new Error("PostHog request timed out"+(x?" after "+x+"ms":""))).name="AbortError",y))}),t.timeout)}}var m=x=>{h&&(x==null?void 0:x.name)==="AbortError"||(y=>(y==null?void 0:y.name)==="TypeError"&&YN.test((y==null?void 0:y.message)||""))(x)?_e.warn(x):_e.error(x),t.callback==null||t.callback({statusCode:0,error:x})};try{var _;v2(n,ue({method:(t==null?void 0:t.method)||"GET",headers:u,keepalive:t.method==="POST"&&!t.Wr&&52428.8>(c||0),body:a,signal:(_=f)==null?void 0:_.signal},t.fetchOptions)).then((x=>x.text().then((y=>{var w={statusCode:x.status,text:y};if(x.status===200)try{w.json=JSON.parse(y)}catch(S){_e.error(S)}t.callback==null||t.callback(w)})))).catch(m).finally((()=>f?clearTimeout(f.timeout):null))}catch(x){f&&clearTimeout(f.timeout),m(x)}}},Fy=t=>{try{var e,n=wP(t),r=n.url,s=n.encodedBody,i=s??{},a=i.body,c=i.estimatedSize;if(!a)return;var u=a instanceof Blob?a:new Blob([a],{type:i.contentType});if(or.sendBeacon(r,u))return;var f=Qe(t.data)?t.data:(e=t.data)==null?void 0:e.batch;if(Qe(f)&&f.length>1&&(c??0)>16384){var h=Math.ceil(f.length/2),p=m=>Qe(t.data)?m:ue({},t.data,{batch:m});return Fy(ue({},t,{data:p(f.slice(0,h))})),void Fy(ue({},t,{data:p(f.slice(h))}))}_e.warn("Beacon of ~"+(c??0)+" bytes was rejected by the browser, falling back to fetch"),SP(ue({},t,{Wr:!0}))}catch(m){_e.warn("Beacon send failed",m)}},KE=(t,e,n,r)=>{var s=r==="query"?e==="POST"?"sent_at":"_":void 0;return O2(n===ir.GZipJS?xP(t,"compression"):t,ue({},s?{[s]:Date.now().toString()}:{},n===ir.GZipJS?{}:{compression:n}))},Rp=[];v2&&Rp.push({transport:"fetch",method:SP}),sy&&Rp.push({transport:"XHR",method(t){var e=bP(t);if(e){var n=new sy,r=e.encodedBody;n.open(t.method||"GET",e.url,!0);var s=r??{},i=s.contentType,a=s.body;xt(t.headers,(function(c,u){n.setRequestHeader(u,c)})),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var c={statusCode:n.status,text:n.responseText};if(n.status===200)try{c.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(c)}},n.send(a)}}}),or!=null&&or.sendBeacon&&Rp.push({transport:"sendBeacon",method:Fy});var Vy=3e3;class XN{constructor(e,n){this.Zr=!0,this.Gr=[],this.Qr=hi((n==null?void 0:n.flush_interval_ms)||Vy,250,5e3,_e.createLogger("flush interval"),Vy),this.Jr=e}enqueue(e){this.Gr.push(e),this.Kr||this.Yr()}unload(){this.Xr();var e=this.Gr.length>0?this.ei():{},n=Object.values(e);[...n.filter((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.ti(ue({},r,{transport:"sendBeacon"}))}))}enable(){this.Zr=!1,this.Yr()}Yr(){var e=this;this.Zr||(this.Kr=setTimeout((()=>{if(this.Xr(),this.Gr.length>0){var n=this.ei(),r=function(){var i=n[s],a=new Date().getTime();i.data&&Qe(i.data)&&xt(i.data,(c=>{c.offset=Math.abs(c.timestamp-a),delete c.timestamp})),e.ti(i)};for(var s in n)r()}}),this.Qr))}ti(e){try{this.Jr(e)}catch(n){_e.error(n)}}Xr(){clearTimeout(this.Kr),this.Kr=void 0}ei(){var e={};return xt(this.Gr,(n=>{var r,s=n,i=(s?s.batchKey:null)||s.url;ge(e[i])&&(e[i]=ue({},s,{data:[]})),(r=e[i].data)==null||r.push(s.data)})),this.Gr=[],e}}var QN=["retriesPerformedSoFar"];class JN{constructor(e){this.ri=!1,this.ii=3e3,this.Gr=[],this._instance=e,this.Gr=[],this.ni=!0,!ge(te)&&"onLine"in te.navigator&&(this.ni=te.navigator.onLine,this.si=()=>{this.ni=!0,this.oi()},this.ai=()=>{this.ni=!1},zt(te,"online",this.si),zt(te,"offline",this.ai))}get length(){return this.Gr.length}retriableRequest(e){var n=e.retriesPerformedSoFar,r=X8(e,QN);Bi(n)&&(r.url=O2(r.url,{retry_count:n})),this._instance._send_request(ue({},r,{callback:s=>{if(s.statusCode!==200&&(400>s.statusCode||s.statusCode>=500)){if((s.statusCode===0?3:10)>(n??0))return void this.kt(ue({retriesPerformedSoFar:n},r));s.statusCode===0&&_e.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(n??0)+" retries.")}r.callback==null||r.callback(s)}}))}kt(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=(function(a){var c=3e3*Math.pow(2,a),u=c/2,f=Math.min(18e5,c),h=Math.random()-.5;return Math.ceil(f+h*(f-u))})(n),s=Date.now()+r;this.Gr.push({retryAt:s,requestOptions:e});var i="Enqueued failed request for retry in "+r;navigator.onLine||(i+=" (Browser is offline)"),_e.warn(i),this.ri||(this.ri=!0,this.li())}li(){if(this.ui&&clearTimeout(this.ui),this.Gr.length===0)return this.ri=!1,void(this.ui=void 0);this.ui=setTimeout((()=>{this.ni&&this.Gr.length>0&&this.oi(),this.li()}),this.ii)}oi(){var e=Date.now(),n=[],r=this.Gr.filter((i=>e>i.retryAt||(n.push(i),!1)));if(this.Gr=n,r.length>0)for(var s of r)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this.ui&&(clearTimeout(this.ui),this.ui=void 0),this.ri=!1,ge(te)||(this.si&&(te.removeEventListener("online",this.si),this.si=void 0),this.ai&&(te.removeEventListener("offline",this.ai),this.ai=void 0)),this.Gr)){var n=e.requestOptions;try{this._instance._send_request(ue({},n,{transport:"sendBeacon"}))}catch(r){_e.error(r)}}this.Gr=[]}}class eD{constructor(e){this.hi=()=>{var n,r,s,i;this.di||(this.di={});var a=this.scrollElement(),c=this.scrollY(),u=a?Math.max(0,a.scrollHeight-a.clientHeight):0,f=c+((a==null?void 0:a.clientHeight)||0),h=(a==null?void 0:a.scrollHeight)||0;this.di.lastScrollY=Math.ceil(c),this.di.maxScrollY=Math.max(c,(n=this.di.maxScrollY)!==null&&n!==void 0?n:0),this.di.maxScrollHeight=Math.max(u,(r=this.di.maxScrollHeight)!==null&&r!==void 0?r:0),this.di.lastContentY=f,this.di.maxContentY=Math.max(f,(s=this.di.maxContentY)!==null&&s!==void 0?s:0),this.di.maxContentHeight=Math.max(h,(i=this.di.maxContentHeight)!==null&&i!==void 0?i:0)},this._instance=e}get ci(){return this._instance.config.scroll_root_selector}getContext(){return this.di}resetContext(){var e=this.di;return setTimeout(this.hi,0),e}startMeasuringScrollPosition(){zt(te,"scroll",this.hi,{capture:!0}),zt(te,"scrollend",this.hi,{capture:!0}),zt(te,"resize",this.hi)}scrollElement(){if(!this.ci)return te==null?void 0:te.document.documentElement;var e=Qe(this.ci)?this.ci:[this.ci];for(var n of e){var r=te==null?void 0:te.document.querySelector(n);if(r)return r}}vi(e){var n=e==="y"?"scrollTop":"scrollLeft";if(this.ci){var r=this.scrollElement();return r&&r[n]||0}return te?e==="y"?te.scrollY||te.pageYOffset||te.document.documentElement.scrollTop||0:te.scrollX||te.pageXOffset||te.document.documentElement.scrollLeft||0:0}scrollY(){return this.vi("y")}scrollX(){return this.vi("x")}}var tD=t=>uP(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);class ZE{constructor(e,n,r,s){this.fi=i=>{var a=this.pi();if(!a||a.sessionId!==i){var c={sessionId:i,props:this.gi(this._instance)};this.mi.register({[Py]:c})}},this._instance=e,this.yi=n,this.mi=r,this.gi=s||tD,this.yi.onSessionId(this.fi)}pi(){return this.mi.props[Py]}getSetOnceProps(){var e,n=(e=this.pi())==null?void 0:e.props;return n?"r"in n?dP(n,this._instance.config.disable_capture_url_hashes):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var e={};return xt(P2(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+ay(r)]=n})),e}}class L2{on(e,n){return this.bi[e]||(this.bi[e]=[]),this.bi[e].push(n),()=>{this.bi[e]=this.bi[e].filter((r=>r!==n))}}emit(e,n){for(var r of this.bi[e]||[])r(n);for(var s of this.bi["*"]||[])s(e,n)}constructor(){this.bi={}}}var od=Ft("[SessionId]");class qE{on(e,n){return this.wi.on(e,n)}constructor(e,n,r){var s;if(this.xi=null,this.ki=[],this.Si=void 0,this.Ci=!1,this.wi=new L2,this.Ti=(f,h)=>!(!Bi(f)||!Bi(h))&&Math.abs(f-h)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===eo)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Te=e.config,this.mi=e.persistence,this.Ii=void 0,this.Mi=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ei=n||Yi,this.Ri=r||Yi;var i=this.Te.persistence_name||this.Te.token;if(this._sessionTimeoutMs=1e3*hi(this.Te.session_idle_timeout_seconds||1800,60,36e3,od.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Pi(),this.Oi="ph_"+i+"_window_id",this.Fi="ph_"+i+"_primary_window_exists",this.Li()){var a=Dn.F(this.Oi),c=Dn.F(this.Fi);a&&!c?this.Ii=a:Dn.P(this.Oi),Dn.q(this.Fi,!0)}if((s=this.Te.bootstrap)!=null&&s.sessionID)try{var u=(f=>{var h=this.Te.bootstrap.sessionID.replace(/-/g,"");if(h.length!==32)throw new Error("Not a valid UUID");if(h[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(h.substring(0,12),16)})();this.$i(this.Te.bootstrap.sessionID,new Date().getTime(),u)}catch(f){od.error("Invalid sessionID in bootstrap",f)}this.Ai()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return ge(this.ki)&&(this.ki=[]),this.ki.push(e),this.Mi&&e(this.Mi,this.Ii),()=>{this.ki=this.ki.filter((n=>n!==e))}}Li(){return this.Te.persistence!=="memory"&&!this.mi.yr&&Dn.N()}Ni(e){e!==this.Ii&&(this.Ii=e,this.Li()&&Dn.q(this.Oi,e))}Di(){return this.Ii?this.Ii:this.Li()?Dn.F(this.Oi):null}qi(e){var n=this.xi;return!ur(n)&&!ur(e)&&5e3>Math.abs(e-n)}$i(e,n,r){var s=n!==this._sessionActivityTimestamp,i=!(e!==this.Mi||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.Mi=e,i&&!s||i&&this.qi(n)||(this.xi=n,this.mi.register({[yc]:[n,e,r]}))}ji(){var e,n=(e=this.Te)==null?void 0:e.persistence_save_debounce_ms;return Bi(n)&&n>0}Hi(){this.ji()?this.mi.refreshKey(yc):(this.mi.flush(),this.mi.load())}Bi(){var e;if(!ur(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.xi){this.Hi();var n=this.Ui();n[1]===this.Mi&&n[2]===this._sessionStartTimestamp&&(this.xi=this._sessionActivityTimestamp,this.mi.register({[yc]:[this._sessionActivityTimestamp,(e=this.Mi)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.mi.flush())}}zi(){var e=this.Ui()[0],n=Bi(e)?e:0,r=Bi(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(n,r)}Vi(e){return this.Hi(),this.Ti(e,this.zi())}Ui(){var e=this.mi.props[yc];return Qe(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.xi=null,clearTimeout(this.Wi),this.Wi=void 0,this.$i(null,null,null)}destroy(){this.Ci=!0,this.Bi(),clearTimeout(this.Wi),this.Wi=void 0,this.Si&&te&&(te.removeEventListener(pm,this.Si,{capture:!1}),this.Si=void 0),this.ki=[]}Ai(){this.Si=()=>{this.Bi(),this.Li()&&Dn.P(this.Fi)},zt(te,pm,this.Si,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.Te.cookieless_mode===eo)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),s=this.Ui(),i=s[1],a=s[2],c=this.zi(),u=this.Di(),f=Bi(a)&&Math.abs(r-a)>864e5,h=!1,p=!1,m=!i,_=i,x=!m&&!e&&this.Ti(r,c);if(x){(x=this.Vi(r))||od.info("cross-tab refresh kept the session alive",{sessionId:i});var y=this.Ui();i=y[1],a=y[2]}m||x||f?(i=this.Ei(),u=this.Ri(),od.info("new session ID generated",{sessionId:i,windowId:u,changeReason:{noSessionId:m,activityTimeout:x,sessionPastMaximumLength:f}}),a=r,h=!0):(u||(u=this.Ri(),h=!0),(p=i!==_)&&(od.info("adopted cross-tab session id",{sessionId:i,windowId:u}),h=!0));var w=Bi(c)&&e&&!f?c:r,S=Bi(a)?a:new Date().getTime();this.Ni(u),this.$i(i,w,S),e||this.Pi();var T={noSessionId:m,activityTimeout:x,sessionPastMaximumLength:f,crossTabAdoption:p};return h&&this.ki.forEach((P=>P(i,u,T))),{sessionId:i,windowId:u,sessionStartTimestamp:S,changeReason:h?T:void 0,lastActivityTimestamp:c}}Pi(){this.Ci||(clearTimeout(this.Wi),this.Wi=setTimeout((()=>{if(!this.Ci)if(this.Vi(new Date().getTime())){var e=this.Mi;this.resetSessionId(),this.wi.emit("forcedIdleReset",{idleSessionId:e})}else this.Pi()}),1.1*this.sessionTimeoutMs))}}var EP=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&_E(n,e))return!0;try{var r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some((s=>_E(s==null?void 0:s.brand,e))))return!0}catch{}return!!t.webdriver};function CP(){return(CP=Jt((function*(){var t=or==null?void 0:or.userAgentData;if(t!=null&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return _t(n)&&n.length>0?n:void 0}catch(r){return void _e.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",r)}}))).apply(this,arguments)}var wm=function(t,e){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function YE(t,e,n){return _c({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var kP={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=>wm(n,r))))),not_regex:(t,e)=>e.every((n=>t.every((r=>!wm(n,r))))),icontains:(t,e)=>e.map(Xh).some((n=>t.map(Xh).some((r=>n.includes(r))))),not_icontains:(t,e)=>e.map(Xh).every((n=>t.map(Xh).every((r=>!n.includes(r))))),gt:(t,e)=>e.some((n=>{var r=parseFloat(n);return!isNaN(r)&&t.some((s=>r>parseFloat(s)))})),lt:(t,e)=>e.some((n=>{var r=parseFloat(n);return!isNaN(r)&&t.some((s=>r<parseFloat(s)))}))},Xh=t=>t.toLowerCase();function PP(t,e){return!t||Object.entries(t).every((n=>{var r=n[1],s=e==null?void 0:e[n[0]];if(ge(s)||ur(s))return!1;var i=[String(s)],a=kP[r.operator];return!!a&&a(r.values,i)}))}var $y="custom",XE="i.posthog.com",nD=/^\/static\//;class rD{constructor(e){this.Zi={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+XE,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.Zi[this.apiHost]||(this.Zi[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":$y),this.Zi[this.apiHost]}Gi(e){if(nD.test(e)){var n=this.instance.config.asset_host;if(typeof n=="string")return n.trim().replace(/\/$/,"")||void 0}}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.uiHost+n;if(e==="flags")return this.flagsApiHost+n;if(e==="assets"){var r=this.Gi(n);if(r)return""+r+n}if(this.region===$y)return this.apiHost+n;var s=XE+n;switch(e){case"assets":return"https://"+this.region+"-assets."+s;case"api":return"https://"+this.region+"."+s}}}function TP(t){var e;return!((e=t.conditions)==null||(e=e.events)==null||(e=e.values)==null||!e.length)}var yt=Ft("[Surveys]"),RP="seenSurvey_",AP=t=>{try{var e=(n=>((r,s)=>""+RP+(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(n){yt.error("Failed to persist survey seen state",n)}},sD=[Tv.Popover,Tv.Widget,Tv.API],iD={ignoreConditions:!1,ignoreDelay:!1,displayType:Ly.Popover},oD=Ft("[PostHog ExternalIntegrations]"),aD={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class lD{constructor(e){this._instance=e}er(e,n){var r;(r=$e.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(s=>{if(s)return oD.error("failed to load script",s);n()}))}startIfEnabledOrStop(){var e=this,n=function(){var i,a,c,u=r[0],f=r[1];!f||(i=$e.__PosthogExtensions__)!=null&&(i=i.integrations)!=null&&i[u]||e.er(aD[u],(()=>{var h;(h=$e.__PosthogExtensions__)==null||(h=h.integrations)==null||(h=h[u])==null||h.start(e._instance)})),!f&&(a=$e.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[u]&&((c=$e.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[u])==null||c.stop())};for(var r of Object.entries((s=this._instance.config.integrations)!==null&&s!==void 0?s:{})){var s;n()}}}var Rd={},Ov=0,bm=()=>{},QE='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',ad="Surveys module not available",JE="sanitize_properties is deprecated. Use before_send instead",IP="Invalid value for property_denylist config: ",cD=["token","distinct_id",D6],mc="posthog",MP=!ZN&&(br==null?void 0:br.indexOf("MSIE"))===-1&&(br==null?void 0:br.indexOf("Mozilla"))===-1,Lv=t=>{var e;return ue({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:fN(Se==null?void 0:Se.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:bm,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:on&&_t(on==null?void 0:on.search)&&on.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:(te==null||(e=te.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(n){_e.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:Iy,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Vy},error_tracking:{},_onCapture:bm},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:EN,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:n&&n>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:n&&n>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:n&&n>="2026-05-30"?250:0,split_storage:!(!n||"2026-05-30">n),detect_google_search_app:!(!n||"2026-05-30">n),disable_capture_url_hashes:!(!n||"2026-06-25">n)}))(t))},uD=[["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"]],eC=t=>{var e={};for(var n of uD){var r=n[0],s=n[1];ge(t[r])||(e[s]=t[r])}var i=Rt({},e,t),a=t.__preview_external_dependency_versioned_paths;return ge(a)||(ge(t.strict_script_versioning)&&(i.strict_script_versioning=!!a),_t(a)&&ge(t.asset_host)&&(i.asset_host=a)),Qe(t.property_blacklist)&&(ge(t.property_denylist)?i.property_denylist=t.property_blacklist:Qe(t.property_denylist)?i.property_denylist=[...t.property_blacklist,...t.property_denylist]:_e.error(IP+t.property_denylist)),i};class dD{constructor(){this.__forceAllowLocalhost=!1}get Qi(){return this.__forceAllowLocalhost}set Qi(e){_e.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class hs{Ji(e,n){if(e){var r=this.Ki.indexOf(e);r!==-1&&this.Ki.splice(r,1)}return this.Ki.push(n),n.initialize==null||n.initialize(),n}Yi(){return this.config.cookieless_mode===eo||this.config.cookieless_mode===Qa&&this.consent.isRejected()}get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.webPerformance=new dD,this.Xi=!1,this.version=mt.LIB_VERSION,this.en=new L2,this.Ki=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Lv(),this.SentryIntegration=ON,this.sentryIntegration=r=>(function(s,i){var a=rP(s,i);return{name:nP,processEvent:c=>a(c)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.tn=!1,this.rn=null,this.nn=null,this.sn=null,this.scrollManager=new eD(this),this.pageViewManager=new VE(this),this.rateLimiter=new zN(this),this.requestRouter=new rD(this),this.consent=new _N(this),this.externalIntegrations=new lD(this);var n=(e=hs.__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)=>{var a=_t(r)?{[r]:s}:r;this.setPersonProperties(a),i==null||i({})},set_once:(r,s,i)=>{var a=_t(r)?{[r]:s}:r;this.setPersonProperties(void 0,a),i==null||i({})}},this.on("eventCaptured",(r=>_e.info('send "'+(r==null?void 0:r.event)+'"',r)))}init(e,n,r){if(r&&r!==mc){var s,i=(s=Rd[r])!==null&&s!==void 0?s:new hs;return i._init(e,n,r),Rd[r]=i,Rd[mc][r]=i,i}return this._init(e,n,r)}_init(e,n,r){var s,i;n===void 0&&(n={});var a=_t(e)?e.trim():"";if(!a)return _e.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=Lv(n.defaults),n.debug=this.an(n.debug),this.ln=n,this.un=[],n.person_profiles?this.nn=n.person_profiles:n.process_person&&(this.nn=n.process_person);var c=Lv(n.defaults),u=eC(n),f=Rt({},c,u,{name:r,token:a});Lt(c.rageclick)&&Lt(u.rageclick)&&(f.rageclick=Rt({},c.rageclick,u.rageclick)),Lt(c.session_recording)&&Lt(u.session_recording)&&(f.session_recording=Rt({},c.session_recording,u.session_recording)),this.set_config(f),this.config.on_xhr_error&&_e.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:ir.GZipJS;var h=this.hn();this.persistence=new Pv(this.config,h),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Pv(ue({},this.config,{persistence:"sessionStorage"}),h,!1);var p=ue({},this.persistence.props),m=ue({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.dn=new XN((k=>this.cn(k)),this.config.request_queue_config),this.vn=new JN(this),this.__request_queue=[];var _=this.Yi();if(_||(this.sessionManager=new qE(this),this.sessionPropsManager=new ZE(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(_e.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.fn(_)}),0)):(_e.info("Initializing extensions synchronously"),this.fn(_)),mt.DEBUG=mt.DEBUG||this.config.debug,mt.DEBUG&&_e.info("Starting in debug mode",{this:this,config:n,thisC:ue({},this.config),p,s:m}),!this.config.identity_distinct_id||(s=n.bootstrap)!=null&&s.distinctID||(n.bootstrap=ue({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((i=n.bootstrap)==null?void 0:i.distinctID)!==void 0){var x=n.bootstrap.distinctID,y=this.get_distinct_id(),w=this.persistence.get_property(Ns);if(n.bootstrap.isIdentifiedID&&y!=null&&y!==x&&w===nc)this.identify(x);else if(n.bootstrap.isIdentifiedID&&y!=null&&y!==x&&w===rc)_e.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var S=this.config.get_device_id(Yi()),T=n.bootstrap.isIdentifiedID?S:x;this.persistence.set_property(Ns,n.bootstrap.isIdentifiedID?rc:nc),this.register({distinct_id:x,$device_id:T})}}if(_)this.register_once({distinct_id:Gh,$device_id:null},"");else if(!this.get_distinct_id()){var P=this.config.get_device_id(Yi());this.register_once({distinct_id:P,$device_id:P},""),this.persistence.set_property(Ns,nc)}return zt(te,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?(function(k,R){var L=k.config.segment;if(!L)return R();(function(O,A){var I=O.config.segment;if(!I)return A();var N=F=>{var K=()=>F.anonymousId()||Yi();O.config.get_device_id=K,F.id()&&(O.register({distinct_id:F.id(),$device_id:K()}),O.persistence.set_property(Ns,rc)),A()},j=I.user();"then"in j&&Vs(j.then)?j.then(N):N(j)})(k,(()=>{L.register((O=>{typeof Promise<"u"&&Promise.resolve||Cv.warn("This browser does not have Promise support, and can not use the segment integration");var A=(I,N)=>{if(!N)return I;I.event.userId||I.event.anonymousId===O.get_distinct_id()||(Cv.info("No userId set, resetting PostHog"),O.reset()),I.event.userId&&I.event.userId!==O.get_distinct_id()&&(Cv.info("UserId set, identifying with PostHog"),O.identify(I.event.userId));var j=O.calculateEventProperties(N,I.event.properties);return I.event.properties=Object.assign({},j,I.event.properties),I};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:I=>A(I,I.event.event),page:I=>A(I,pc),identify:I=>A(I,bv),screen:I=>A(I,"$screen")}})(k)).then((()=>{R()}))}))})(this,(()=>this.pn())):this.pn(),Vs(this.config._onCapture)&&this.config._onCapture!==bm&&(_e.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(k=>this.config._onCapture(k.event,k)))),this.config.ip&&_e.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 CP.apply(this,arguments)})().then((k=>{k&&this.register({[xv]:k})})).catch(bm),this}fn(e){var n,r,s,i,a,c,u,f,h=performance.now(),p=ue({},hs.__defaultExtensionClasses,this.config.__extensionClasses),m=[];p.featureFlags&&this.Ki.push(this.featureFlags=(n=this.featureFlags)!==null&&n!==void 0?n:new p.featureFlags(this)),p.exceptions&&this.Ki.push(this.exceptions=(r=this.exceptions)!==null&&r!==void 0?r:new p.exceptions(this)),p.historyAutocapture&&this.Ki.push(this.historyAutocapture=new p.historyAutocapture(this)),p.tracingHeaders&&this.Ki.push(this.tracingHeaders=new p.tracingHeaders(this)),p.siteApps&&this.Ki.push(this.siteApps=new p.siteApps(this)),p.sessionRecording&&!e&&this.Ki.push(this.sessionRecording=new p.sessionRecording(this)),this.config.disable_scroll_properties||m.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),p.autocapture&&this.Ki.push(this.autocapture=new p.autocapture(this)),p.surveys&&this.Ki.push(this.surveys=(s=this.surveys)!==null&&s!==void 0?s:new p.surveys(this)),p.logs&&this.Ki.push(this.logs=(i=this.logs)!==null&&i!==void 0?i:new p.logs(this)),p.metrics&&this.Ki.push(this.metrics=(a=this.metrics)!==null&&a!==void 0?a:new p.metrics(this)),p.conversations&&this.Ki.push(this.conversations=(c=this.conversations)!==null&&c!==void 0?c:new p.conversations(this)),p.productTours&&this.Ki.push(this.productTours=new p.productTours(this)),p.heatmaps&&this.Ki.push(this.heatmaps=new p.heatmaps(this)),p.webVitalsAutocapture&&this.Ki.push(this.webVitalsAutocapture=new p.webVitalsAutocapture(this)),p.exceptionObserver&&this.Ki.push(this.exceptionObserver=new p.exceptionObserver(this)),p.deadClicksAutocapture&&this.Ki.push(this.deadClicksAutocapture=new p.deadClicksAutocapture(this,MN)),p.toolbar&&this.Ki.push(this.toolbar=(u=this.toolbar)!==null&&u!==void 0?u:new p.toolbar(this)),p.experiments&&this.Ki.push(this.experiments=(f=this.experiments)!==null&&f!==void 0?f:new p.experiments(this)),this.Ki.forEach((_=>{_.initialize&&m.push((()=>{_.initialize==null||_.initialize()}))})),m.push((()=>{if(this.gn){var _=this.gn;this.gn=void 0,this.Hr(_)}})),this.mn(m,h)}mn(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout((()=>{this.mn(e,n)}),0);var r=e.shift();if(r)try{r()}catch(i){_e.error("Error initializing extension:",i)}}var s=Math.round(performance.now()-n);this.register_for_session({[j6]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[F6]:s}),this.config.__preview_deferred_init_extensions&&_e.info("PostHog extensions initialized ("+s+"ms)")}Hr(e){if(!Se||!Se.body)return _e.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Hr(e)}),500);if(this.config.__preview_deferred_init_extensions&&(this.gn=e),this.yn=e,this.compression=void 0,e.ok){var n,r=e.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=Ge(r.supportedCompression,ir.GZipJS)?ir.GZipJS:Ge(r.supportedCompression,ir.Base64)?ir.Base64:void 0),(n=r.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.nn?this.nn:Iy}),this.Ki.forEach((s=>s.onRemoteConfig==null?void 0:s.onRemoteConfig(e)))}pn(){try{this.config.loaded(this)}catch(r){_e.critical("`loaded` function failed",r)}if(this.bn(),this.config.internal_or_test_user_hostname&&on!=null&&on.hostname){var e=on.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?e===n:n.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Yi())&&this._n()}),1),this.wn=new hP(this),this.wn.load()}bn(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.dn)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Kh(this.__request_queue,(e=>this.cn(e))),this.__request_queue=[],this.bn()}_handle_unload(){var e,n,r,s,i;(e=this.surveys)==null||e.handlePageUnload==null||e.handlePageUnload(),(n=this.metrics)==null||n.flush("sendBeacon"),this.config.request_batching?(this.xn()&&this.capture(wv),(r=this.logs)==null||r.flushLogs("sendBeacon"),(s=this.dn)==null||s.unload(),(i=this.vn)==null||i.unload()):this.xn()&&this.capture(wv,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?MP?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=ue({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(ge(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(n=>{var r,s,i,a=ue({},n);a.timeout=a.timeout||6e4;var c,u,f,h,p,m=(r=a.transport)!==null&&r!==void 0?r:"fetch";m==="sendBeacon"&&ge(a.compression)&&a.data&&(a.compression=ir.Base64),a.method==="POST"&&a.data&&(a.timestampMode==="capture-body"?a.data={api_key:(u=(p=(h=Qe(c=a.data)?c:[c])[0])==null||(f=p.properties)==null?void 0:f.token)!==null&&u!==void 0?u:p==null?void 0:p.token,batch:h,sent_at:new Date().toISOString()}:a.timestampMode==="body"&&(a.data=(function(y,w){return w===void 0&&(w=new Date().toISOString()),Qe(y)?y.map((S=>ue({},S,{sent_at:w}))):ue({},y,{sent_at:w})})(a.data))),a.url=KE(a.url,a.method,a.compression,a.timestampMode);var _=Rp.filter((y=>!a.disableTransport||!y.transport||!a.disableTransport.includes(y.transport))),x=(s=(i=(function(y,w){for(var S=0;y.length>S;S++)if(y[S].transport===m)return y[S]})(_))==null?void 0:i.method)!==null&&s!==void 0?s:_[0].method;if(!x)throw new Error("No available transport method");m!=="sendBeacon"&&a.data&&a.compression===ir.GZipJS&&pL&&typeof Promise<"u"&&!Tp?qN(a).then((y=>{x(y)})).catch((y=>{if(yE(y))return Tp=!0,void x(ue({},a,{compression:void 0,url:KE(n.url,n.method,void 0,n.timestampMode)}));(w=>{if(!w||typeof w!="object")return!1;var S="name"in w?String(w.name):"";return yE(w)||S===Q8})(y)&&(Tp=!0),x(a)})):x(a)})(ue({},e,{callback:n=>{var r,s;this.rateLimiter.checkForLimiting(n),400>n.statusCode||(r=(s=this.config).on_request_error)==null||r.call(s,n),e.callback==null||e.callback(n)}}))):e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:0}))}cn(e){this.vn?this.vn.retriableRequest(e):this._send_request(e)}_execute_array(e){Ov++;try{var n,r=[],s=[],i=[];Kh(e,(c=>{if(c)if(Qe(n=c[0]))i.push(c);else if(Vs(c))try{c.call(this)}catch(u){_e.error("Error executing queued PostHog call",c,u)}else Qe(c)&&n==="alias"?r.push(c):Qe(c)&&n.indexOf("capture")!==-1&&Vs(this[n])?i.push(c):s.push(c)}));var a=function(c,u){Kh(c,(function(f){try{if(Qe(f[0])){var h=u;xt(f,(function(p){h=h[p[0]].apply(h,p.slice(1))}))}else u[f[0]].apply(u,f.slice(1))}catch(p){_e.error("Error executing queued PostHog call",f,p)}}))};a(r,this),a(s,this),a(i,this)}finally{Ov--}}push(e){if(Ov>0&&Qe(e)&&_t(e[0])){var n=hs.prototype[e[0]];Vs(n)&&n.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,n,r){var s,i,a,c,u;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.dn){if(this.is_capturing())if(!ge(e)&&_t(e)){var f=!this.config.opt_out_useragent_filter&&this._is_bot();if(!f||this.config.__preview_capture_bot_pageviews){var h=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(h==null||!h.isRateLimited){n!=null&&n.$current_url&&!_t(n==null?void 0:n.$current_url)&&(_e.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),e!=="$exception"||r!=null&&r.kn||_e.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var p=new Date,m=(r==null?void 0:r.timestamp)||p,_=SE(r==null?void 0:r.uuid,Yi),x={uuid:_,event:e,properties:this.calculateEventProperties(e,n||{},m,_)};e===pc&&this.config.__preview_capture_bot_pageviews&&f&&(x.event="$bot_pageview",x.properties.$browser_type="bot"),h&&(x.properties.$lib_rate_limit_remaining_tokens=h.remainingTokens);var y=e==="$feature_flag_called"&&x.properties.$feature_flag_has_experiment===!1&&this.get_property(cm)===!0;r!=null&&r.$set&&!y&&(x.$set=r==null?void 0:r.$set);var w=r==null?void 0:r.$unset;w&&(x.$unset=w);var S,T,P,k=y?void 0:this.Sn(r==null?void 0:r.$set_once,e!==TE,e===bv);if(k&&(x.$set_once=k),r!=null&&r._noTruncate||(i=this.config.properties_string_max_length,a=x,c=F=>_t(F)?F.slice(0,i):F,u=new Set,x=(function F(K,X){if(K!==Object(K))return c?c(K):K;if(!u.has(K)){var W;if(u.add(K),Qe(K))W=[],Kh(K,(q=>{W.push(F(q))}));else{var G={};xt(K,((q,$)=>{u.has(q)||(G[$]=F(q))})),W=G}return W}})(a)),x.timestamp=m,ge(r==null?void 0:r.timestamp)||(x.properties.$event_time_override_provided=!0,x.properties.$event_time_override_system_time=p),y&&(x.properties=(function(F,K){K===void 0&&(K=[]);var X={},W=G=>{F[G]!==void 0&&(X[G]=F[G])};return mL.forEach(W),K.forEach(W),X})(x.properties,cD)),e===no.DISMISSED||e===no.SENT){var R=n==null?void 0:n[Rv.SURVEY_ID],L=n==null?void 0:n[Rv.SURVEY_ITERATION];AP({id:R,current_iteration:L}),x.$set=ue({},x.$set,{[(S={id:R,current_iteration:L},T=e===no.SENT?"responded":"dismissed",P="$survey_"+T+"/"+S.id,S.current_iteration&&S.current_iteration>0&&(P="$survey_"+T+"/"+S.id+"/"+S.current_iteration),P)]:!0})}else e===no.SHOWN&&(x.$set=ue({},x.$set,{[Rv.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===HN.SHOWN){var O=n==null?void 0:n[HE.TOUR_TYPE];O&&(x.$set=ue({},x.$set,{[HE.TOUR_LAST_SEEN_DATE+"/"+O]:new Date().toISOString()}))}var A=ue({},x.properties.$set,x.$set);if(Yo(A)||this.setPersonPropertiesForFlags(A),!Je(this.config.before_send)){var I=this.wt(x);if(!I)return;(x=I).uuid=SE(x.uuid,Yi)}this.en.emit("eventCaptured",x);var N=(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),j={method:"POST",url:N,data:x,compression:"best-available",timestampMode:(r==null?void 0:r._batchKey)==="recordings"||/\/s\/(?:\?|$)/.test(N)?"body":"capture-body",batchKey:r==null?void 0:r._batchKey,transport:r==null?void 0:r.transport};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.cn(j):this.dn.enqueue(j),x}_e.critical("This capture call is ignored due to client rate limiting.")}}else _e.error("No event name provided to posthog.capture")}else _e.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(n=>e(n.event,n)))}calculateEventProperties(e,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var a=i?void 0:this.persistence.remove_event_timer(e),c=ue({},n);if(c.token=this.config.token,c.$config_defaults=this.config.defaults,this.Yi()&&(c[D6]=!0),e==="$snapshot"){var u=ue({},this.persistence.properties(),this.sessionPersistence.properties());return c.distinct_id=u.distinct_id,(!_t(c.distinct_id)&&!Vn(c.distinct_id)||ly(c.distinct_id))&&_e.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),c}var f,h=(function(P,k,R,L){var O,A,I,N;if(L===void 0&&(L=!1),!br)return{};var j,F=P?[...Qc,...k||[]]:[],K=(function(Ye){for(var ut=0;wE.length>ut;ut++){var kt=wE[ut],we=kt[1],je=kt[0].exec(Ye),ze=je&&(Vs(we)?we(je,Ye):we);if(ze)return ze}return["",""]})(br),X=K[0],W=K[1],G=(j=typeof navigator<"u"?navigator:void 0)!=null&&j.brave?{brave:!0}:{},q={};ge(R)||(q.detectGoogleSearchApp=R);var $={},ne=(O=navigator)==null||(O=O.userAgentData)==null?void 0:O.platform,z=(A=navigator)==null?void 0:A.maxTouchPoints,D=te==null||(I=te.screen)==null?void 0:I.width,Y=te==null||(N=te.screen)==null?void 0:N.height,ee=te==null?void 0:te.devicePixelRatio;ge(ne)||($.userAgentDataPlatform=ne),ge(z)||($.maxTouchPoints=z),ge(D)||($.screenWidth=D),ge(Y)||($.screenHeight=Y),ge(ee)||($.devicePixelRatio=ee);var ie,oe,ce,xe,ae,se,Ve,De,Re=Rt(P2({$os:X,$os_version:W,$browser:b6(br,navigator.vendor,G,q),$device:bE(br),$device_type:(oe=br,ce=$,De=bE(oe),De===s6||De===r6||De==="Kobo"||De==="Kindle Fire"||De===v6?Zc:De===zd||De===kc||De===Ud||De===uy?"Console":De===o6?"Wearable":De?Yr:(ce==null?void 0:ce.userAgentDataPlatform)==="Android"&&((xe=ce==null?void 0:ce.maxTouchPoints)!==null&&xe!==void 0?xe:0)>0?600>Math.min((ae=ce==null?void 0:ce.screenWidth)!==null&&ae!==void 0?ae:0,(se=ce==null?void 0:ce.screenHeight)!==null&&se!==void 0?se:0)/((Ve=ce==null?void 0:ce.devicePixelRatio)!==null&&Ve!==void 0?Ve:1)?Yr:Zc:"Desktop"),$timezone:fP(),$timezone_offset:FN()}),{$current_url:Gd(L?oa(on==null?void 0:on.href):on==null?void 0:on.href,F,Kd),$host:on==null?void 0:on.host,$pathname:on==null?void 0:on.pathname,$raw_user_agent:br.length>1e3?br.substring(0,997)+"...":br,$browser_version:LL(br,navigator.vendor,G,q),$browser_language:$E(),$browser_language_prefix:(ie=$E(),typeof ie=="string"?ie.split("-")[0]:void 0),$screen_height:te==null?void 0:te.screen.height,$screen_width:te==null?void 0:te.screen.width,$viewport_height:te==null?void 0:te.innerHeight,$viewport_width:te==null?void 0:te.innerWidth,$lib:mt.LIB_NAME,$lib_version:mt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return mt.SDK_DIST_CHANNEL&&(Re.$sdk_dist_channel=mt.SDK_DIST_CHANNEL),Re})(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var p=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime()),m=p.windowId;c.$session_id=p.sessionId,c.$window_id=m}this.sessionPropsManager&&Rt(c,this.sessionPropsManager.getSessionProps());try{var _;this.sessionRecording&&Rt(c,this.sessionRecording.sdkDebugProperties),c.$sdk_debug_retry_queue_size=(_=this.vn)==null?void 0:_.length}catch(P){c.$sdk_debug_error_capturing_properties=String(P)}if(this.requestRouter.region===$y&&(c.$lib_custom_api_host=this.config.api_host),f=e!==pc||i?e!==wv||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),c=Rt(c,f),e===pc&&Se&&(c.title=Se.title),!ge(a)){var x=r.getTime()-a;c.$duration=parseFloat((x/1e3).toFixed(3))}br&&this.config.opt_out_useragent_filter&&(c.$browser_type=this._is_bot()?"bot":"browser");var y=this.persistence.properties(),w=this.sessionPersistence.properties();xt(["$referrer","$referring_domain"],(P=>{P in y&&delete w[P]})),(c=Rt({},h,y,w,c)).$is_identified=this._isIdentified(),Qe(this.config.property_denylist)?xt(this.config.property_denylist,(function(P){delete c[P]})):_e.error(IP+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var S=this.config.sanitize_properties;S&&(_e.error(JE),c=S(c,e));var T=this.Cn();return c.$process_person_profile=T,T&&!i&&this.Tn("_calculate_event_properties"),c}Sn(e,n,r){var s;if(n===void 0&&(n=!0),r===void 0&&(r=!1),!this.persistence||!this.Cn()||this.Xi&&!r)return e;var i=this.persistence.get_initial_props(),a=(s=this.sessionPropsManager)==null?void 0:s.getSetOnceProps(),c=Rt({},i,a||{},e||{}),u=this.config.sanitize_properties;return u&&(_e.error(JE),c=u(c,"$set_once")),n&&(this.Xi=!0),Yo(c)?void 0:c}register(e,n){var r;(r=this.persistence)==null||r.register(e,n)}register_once(e,n,r){var s;(s=this.persistence)==null||s.register_once(e,n,r)}register_for_session(e){var n;(n=this.sessionPersistence)==null||n.register(e)}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e)}In(e,n){this.register({[e]:n})}getFeatureFlag(e,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagResult(e,n)}getAllFeatureFlags(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,n){var r,s;return(r=(s=this.featureFlags)==null?void 0:s.isFeatureEnabled(e,n))!==null&&r!==void 0?r:n==null?void 0:n.defaultValue}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,n,r){var s;(s=this.featureFlags)==null||s.updateFlags(e,n,r)}updateEarlyAccessFeatureEnrollment(e,n,r){var s;(s=this.featureFlags)==null||s.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n,r){var s;return n===void 0&&(n=!1),(s=this.featureFlags)==null?void 0:s.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.en.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:ad}),()=>{})}onSessionId(e){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getSurveys(e,n):e([],{isLoaded:!1,error:ad})}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:ad})}renderSurvey(e,n){var r;(r=this.surveys)==null||r.renderSurvey(e,n)}displaySurvey(e,n){var r;n===void 0&&(n=iD),(r=this.surveys)==null||r.displaySurvey(e,n)}cancelPendingSurvey(e){var n;(n=this.surveys)==null||n.cancelPendingSurvey(e)}canRenderSurvey(e){var n,r;return(n=(r=this.surveys)==null?void 0:r.canRenderSurvey(e))!==null&&n!==void 0?n:{visible:!1,disabledReason:ad}}canRenderSurveyAsync(e,n){var r,s;return n===void 0&&(n=!1),(r=(s=this.surveys)==null?void 0:s.canRenderSurveyAsync(e,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:ad})}Mn(e){return!e||ly(e)?(_e.critical("Unique user id has not been set in posthog.identify"),!1):e===Gh?(_e.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())||(_e.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 _e.uninitializedWarning("posthog.identify");if(Vn(e)&&(e=e.toString(),_e.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Mn(e)&&this.Tn("posthog.identify")){var s=this.get_distinct_id();this.register({$user_id:e}),this.get_property(lm)||this.register_once({$had_persisted_distinct_id:!0,$device_id:s},""),e!==s&&e!==this.get_property(vd)&&(this.unregister(vd),this.register({distinct_id:e}));var i,a=(this.persistence.get_property(Ns)||nc)===nc;e!==s&&a?(this.persistence.set_property(Ns,rc),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.capture(bv,{distinct_id:e,$anon_distinct_id:s},{$set:n||{},$set_once:r||{}}),this.sn=YE(e,n,r),(i=this.featureFlags)==null||i.setAnonymousDistinctId(s)):(n||r)&&this.setPersonProperties(n,r),e!==s&&(this.reloadFeatureFlags(),this.unregister(kd))}}setPersonProperties(e,n){if((e||n)&&this.Tn("posthog.setPersonProperties")){var r=YE(this.get_distinct_id(),e,n);this.sn!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.sn=r):_e.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var n,r=(Qe(e)?e:[e]).filter((s=>_t(s)&&s.length>0));r.length!==0&&this.Tn("posthog.unsetPersonProperties")&&((n=this.featureFlags)==null||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.sn=null)}group(e,n,r){if(e&&n){var s=this.getGroups(),i=s[e]!==n;if(i&&this.resetGroupPropertiesForFlags(e),this.register({$groups:ue({},s,{[e]:n})}),i||r){var a={$group_type:e,$group_key:n};r&&(a.$group_set=r),this.capture(TE,a)}r&&this.setGroupPropertiesForFlags({[e]:r}),i&&!r&&this.reloadFeatureFlags()}else _e.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){var r;n===void 0&&(n=!0),(r=this.featureFlags)==null||r.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(e){var n;e===void 0&&(e=!0),(n=this.featureFlags)==null||n.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,n){var r;n===void 0&&(n=!0),this.Tn("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)==null||r.setGroupPropertiesForFlags(e,n))}resetGroupPropertiesForFlags(e){var n;(n=this.featureFlags)==null||n.resetGroupPropertiesForFlags(e)}reset(e){var n,r,s,i,a,c,u,f,h,p;if(_e.info("reset"),!this.__loaded)return _e.uninitializedWarning("posthog.reset");var m,_=this.get_property(lm),x=this.get_property(xv),y=this.get_property(sl);if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),ge(y)||(m=this.persistence)==null||m.register({[sl]:y}),(s=this.surveys)==null||s.reset(),(i=this.wn)==null||i.stop(),(a=this.featureFlags)==null||a.reset(),(c=this.conversations)==null||c.reset(),(u=this.logs)==null||u.reset(),(f=this.metrics)==null||f.reset(),(h=this.persistence)==null||h.set_property(Ns,nc),(p=this.sessionManager)==null||p.resetSessionId(),this.sn=null,this.config.cookieless_mode===eo)this.register_once({distinct_id:Gh,$device_id:null},"");else{var w=this.config.get_device_id(Yi());this.register_once({distinct_id:w,$device_id:e?w:_},""),e||ge(x)||this.register({[xv]:x})}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var n=this;return Jt((function*(){var r,s,i,a,c;n.__loaded?((r=n.logs)==null||r.flushLogs("sendBeacon"),(s=n.metrics)==null||s.flush("sendBeacon"),(i=n.dn)==null||i.unload(),(a=n.vn)==null||a.unload(),(c=n.featureFlags)==null||c.destroy()):_e.uninitializedWarning("posthog.shutdown")}))()}setIdentity(e,n){var r;this.config.identity_distinct_id=e,this.config.identity_hash=n,this.alias(e),(r=this.conversations)==null||r.En()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.Rn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var n=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n.sessionId);if(e!=null&&e.withTimestamp&&r){var i,a=(i=e.timestampLookBack)!==null&&i!==void 0?i:10;if(!r)return s;s+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-a,0)}return s}alias(e,n){return e===this.get_property(A6)?(_e.critical("Attempting to create alias for existing People user - aborting."),-2):this.Tn("posthog.alias")?(ge(n)&&(n=this.get_distinct_id()),e!==n?(this.In(vd,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(_e.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=ue({},this.config);if(Lt(e)){var r,s,i,a,c,u,f,h,p,m,_;Rt(this.config,eC(e));var x=this.hn();(r=this.persistence)==null||r.update_config(this.config,n,x),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Pv(ue({},this.config,{persistence:"sessionStorage"}),x,!1);var y=this.an(this.config.debug);$s(y)&&(this.config.debug=y),$s(this.config.debug)&&(this.config.debug?(mt.DEBUG=!0,bt.N()&&bt.q("ph_debug",!0),_e.info("set_config",{config:e,oldConfig:n,newConfig:ue({},this.config)})):(mt.DEBUG=!1,bt.N()&&bt.P("ph_debug"))),(s=this.exceptionObserver)==null||s.onConfigChange(),(i=this.exceptions)==null||i.onConfigChange(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),(c=this.tracingHeaders)==null||c.startIfEnabledOrStop(),(u=this.autocapture)==null||u.startIfEnabled(),(f=this.heatmaps)==null||f.startIfEnabled(),(h=this.exceptionObserver)==null||h.startIfEnabledOrStop(),(p=this.deadClicksAutocapture)==null||p.startIfEnabledOrStop(),(m=this.surveys)==null||m.loadIfEnabled(),this.Pn(),(_=this.externalIntegrations)==null||_.startIfEnabledOrStop()}}_overrideSDKInfo(e,n){mt.LIB_NAME=e,mt.LIB_VERSION=n}startSessionRecording(e){var n,r,s,i,a,c=e===!0,u={sampling:c||!(e==null||!e.sampling),linked_flag:c||!(e==null||!e.linked_flag),url_trigger:c||!(e==null||!e.url_trigger),event_trigger:c||!(e==null||!e.event_trigger)};Object.values(u).some(Boolean)&&((n=this.sessionManager)==null||n.checkAndGetSessionAndWindowId(),u.sampling&&((r=this.sessionRecording)==null||r.overrideSampling()),u.linked_flag&&((s=this.sessionRecording)==null||s.overrideLinkedFlag()),u.url_trigger&&((i=this.sessionRecording)==null||i.overrideTrigger("url")),u.event_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,n){if(this.exceptions){var r=new Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(ue({},s,n))}}addExceptionStep(e,n){var r;(r=this.exceptions)==null||r.addExceptionStep(e,n)}captureLog(e){var n;(n=this.logs)==null||n.captureLog(e)}get logger(){var e,n;return(e=(n=this.logs)==null?void 0:n.logger)!==null&&e!==void 0?e:hs.On}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var n,r;return(n=(r=this.toolbar)==null?void 0:r.loadToolbar(e))!==null&&n!==void 0&&n}get_property(e){var n;return(n=this.persistence)==null?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)==null?void 0:n.props[e]}toString(){var e,n=(e=this.config.name)!==null&&e!==void 0?e:mc;return n!==mc&&(n=mc+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(Ns))===rc||((n=this.sessionPersistence)==null?void 0:n.get_property(Ns))===rc}Cn(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles===Iy&&!this._isIdentified()&&Yo(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[vd])&&((n=this.persistence)==null||(n=n.props)==null||!n[fm]))}xn(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Cn()||this.Tn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Tn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Tn(e){return this.config.person_profiles==="never"?(_e.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.In(fm,!0),!0)}hn(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Qa)}Pn(){var e,n,r,s,i=this.hn();return((e=this.persistence)==null?void 0:e.yr)!==i&&((r=this.persistence)==null||r.set_disabled(i)),((n=this.sessionPersistence)==null?void 0:n.yr)!==i&&((s=this.sessionPersistence)==null||s.set_disabled(i)),i}opt_in_capturing(e){var n;if(this.config.cookieless_mode!==eo){if(this.Yi()){var r,s,i,a,c;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(s=this.pageViewManager)==null||s.destroy(),this.sessionManager=new qE(this),this.pageViewManager=new VE(this),this.persistence&&(this.sessionPropsManager=new ZE(this,this.sessionManager,this.persistence));var u,f=(i=(a=this.config.__extensionClasses)==null?void 0:a.sessionRecording)!==null&&i!==void 0?i:(c=hs.__defaultExtensionClasses)==null?void 0:c.sessionRecording;f&&(this.sessionRecording=this.Ji(this.sessionRecording,new f(this)),this.yn&&((u=this.sessionRecording)==null||u.onRemoteConfig==null||u.onRemoteConfig(this.yn)))}var h,p;this.consent.optInOut(!0),this.Pn(),this.bn(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==Qa&&((h=this.surveys)==null||h.loadIfEnabled()),(ge(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((p=e==null?void 0:e.captureEventName)!==null&&p!==void 0?p:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._n()}else _e.warn(QE)}opt_out_capturing(){var e,n,r;this.config.cookieless_mode!==eo?(this.config.cookieless_mode===Qa&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Pn(),this.config.cookieless_mode===Qa&&(this.register({distinct_id:Gh,$device_id:null}),(e=this.sessionRecording)==null||e.stopRecording(),this.sessionRecording=void 0,(n=this.sessionManager)==null||n.destroy(),(r=this.pageViewManager)==null||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this._n(),this.bn())):_e.warn(QE)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===1?"granted":e===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===eo||(this.config.cookieless_mode===Qa?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Pn()}_is_bot(){return or?EP(or,this.config.custom_blocked_useragents):void 0}_n(){Se&&(Se.visibilityState==="visible"?this.tn||(this.tn=!0,this.capture(pc,{title:Se.title},{send_instantly:!0}),this.rn&&(Se.removeEventListener(hm,this.rn),this.rn=null)):this.rn||(this.rn=this._n.bind(this),zt(Se,hm,this.rn)))}debug(e){e===!1?(te==null||te.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(te==null||te.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Ur(){var e=this.ln||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(_e.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,a){var c=r in n&&!Je(n[r]),u=s in n&&!Je(n[s]);return c?n[r]:!!u&&(a&&a.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,_e)}wt(e){var n;if(Je(this.config.before_send))return e;var r=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(bL),s=Qe(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var a of s){if(i=a(i),Je(i)){var c="Event '"+e.event+"' was rejected in beforeSend function";return wL(e.event)?_e.warn(c+". This can cause unexpected behavior."):_e.info(c),null}i.properties&&!Yo(i.properties)||_e.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var u of r)if(i.properties&&Je(i.properties[u]))return _e.warn("Event '"+e.event+"' had its '"+u+"' 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.ir)==null?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(r)})}an(e){var n=$s(e)&&!e,r=bt.N()&&bt.A("ph_debug")==="true";return!n&&(!!r||e)}}hs.__defaultExtensionClasses={},hs.On=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),(function(t,e){for(var n=0;e.length>n;n++)t.prototype[e[n]]=uN(t.prototype[e[n]])})(hs,["identify"]);class tC{constructor(e){this.disabled=e===!1;var n=Lt(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,r){if(this.disabled)return!1;var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(n-s.y)<this.thresholdPx&&this.timeoutMs>r-s.timestamp){if(this.clicks.push({x:e,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:r}];return!1}}var Nv="$copy_autocapture",Dv=Ft("[AutoCapture]");function jv(t,e){return e.length>t?e.slice(0,t)+"...":e}function fD(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!aa(e));return e}function hD(t,e){var n,r,s=e.e,i=e.maskAllElementAttributes,a=e.maskAllText,c=e.elementAttributeIgnoreList,u=e.elementsChainAsString,f=e.disableCaptureUrlHashes;if(!aa(t))return{props:{}};for(var h=[t],p=new Set([t]),m=t;m.parentNode&&!Kr(m,"body")&&K6>h.length;)if(G6(m.parentNode)){var _=m.parentNode.host;if(p.has(_))break;p.add(_),h.push(_),m=_}else{if(!aa(m.parentNode)||p.has(m.parentNode))break;p.add(m.parentNode),h.push(m.parentNode),m=m.parentNode}var x,y,w=[],S={},T=!1,P=!1;if(xt(h,(A=>{var I=Oy(A);if(Kr(A,"a")){var N=A.getAttribute("href");T=!!(I&&N&&Pd(N))&&(f?oa(N):N)}Ge(gm(A),"ph-no-capture")&&(P=!0),w.push((function(F,K,X,W,G){G===void 0&&(G=!1);var q=F.tagName.toLowerCase(),$={tag_name:q};R2.indexOf(q)>-1&&!X&&($.$el_text=q.toLowerCase()==="a"||q.toLowerCase()==="button"?jv(1024,DE(F)):jv(1024,Wd(F)));var ne=gm(F);ne.length>0&&($.classes=ne.filter((function(ee){return ee!==""}))),xt(F.attributes,(function(ee){var ie;if((!Q6(F)||["name","id","class","aria-label"].indexOf(ee.name)!==-1)&&(W==null||!W.includes(ee.name))&&!K&&Pd(ee.value)&&(!_t(ie=ee.name)||ie.substring(0,10)!=="_ngcontent"&&ie.substring(0,7)!=="_nghost")){var oe=ee.value;ee.name==="class"&&(oe=T2(oe).join(" ")),$["attr__"+ee.name]=jv(1024,ee.name==="href"&&G?oa(oe):oe)}}));for(var z=1,D=1,Y=F;Y=fD(Y);)z++,Y.tagName===F.tagName&&D++;return $.nth_child=z,$.nth_of_type=D,$})(A,i,a,c,f));var j=(function(F){if(!Oy(F))return{};var K={};return xt(F.attributes,(function(X){if(X.name&&X.name.indexOf("data-ph-capture-attribute")===0){var W=X.name.replace("data-ph-capture-attribute-",""),G=X.value;W&&G&&Pd(G)&&(K[W]=G)}})),K})(A);Rt(S,j)})),P)return{props:{},explicitNoCapture:P};if(a||(w[0].$el_text=Kr(t,"a")||Kr(t,"button")?DE(t):Wd(t)),T){var k,R;w[0].attr__href=T;var L=(k=vm(T))==null?void 0:k.host,O=te==null||(R=te.location)==null?void 0:R.host;L&&O&&L!==O&&(x=T)}return{props:Rt({$event_type:s.type,$ce_version:1},u?{}:{$elements:w},{$elements_chain:(y=w,(function(A){return A.map((I=>{var N,j,F="";if(I.tag_name&&(F+=I.tag_name),I.attr_class)for(var K of(I.attr_class.sort(),I.attr_class))F+="."+K.replace(/"/g,"");var X=ue({},I.text?{text:I.text}:{},{"nth-child":(N=I.nth_child)!==null&&N!==void 0?N:0,"nth-of-type":(j=I.nth_of_type)!==null&&j!==void 0?j:0},I.href?{href:I.href}:{},I.attr_id?{attr_id:I.attr_id}:{},I.attributes),W={};return Pp(X).sort(((G,q)=>G[0].localeCompare(q[0]))).forEach((G=>{var q=G[1];return W[jE(G[0].toString())]=jE(q.toString())})),(F+=":")+Pp(W).map((G=>G[0]+'="'+G[1]+'"')).join("")})).join(";")})((function(A){return A.map((I=>{var N,j,F={text:(N=I.$el_text)==null?void 0:N.slice(0,400),tag_name:I.tag_name,href:(j=I.attr__href)==null?void 0:j.slice(0,2048),attr_class:AN(I),attr_id:I.attr__id,nth_child:I.nth_child,nth_of_type:I.nth_of_type,attributes:{}};return Pp(I).filter((K=>K[0].indexOf("attr__")===0)).forEach((K=>F.attributes[K[0]]=K[1])),F}))})(y)))},(n=w[0])!=null&&n.$el_text?{$el_text:(r=w[0])==null?void 0:r.$el_text}:{},x&&s.type==="click"?{$external_click_url:x}:{},S)}}var ld=Ft("[ExceptionAutocapture]"),nC=()=>{},pD=Ft("[TracingHeaders]"),Va=Ft("[Web Vitals]"),rC=9e5,sC="disabled",iC="lazy_loading",cd="awaiting_config",Qh="missing_config";Ft("[SessionRecording]"),Ft("[SessionRecording]");var Hy="[SessionRecording]",ji=Ft(Hy),mD=Ft("[Heatmaps]");function Fv(t){return Lt(t)&&"clientX"in t&&"clientY"in t&&Vn(t.clientX)&&Vn(t.clientY)}var Vv=Ft("[Product Tours]"),$v=t=>{var e;return!t.config.disable_product_tours&&!((e=t.persistence)==null||!e.get_property(E2))},gD=["$set_once","$set"],ti=Ft("[SiteApps]"),oC="Error while initializing PostHog app with config id ";function oc(t,e,n){if(Je(t))return!1;switch(n){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}class vD{constructor(e){this.Fn=new L2,this.Ln=(n,r)=>this.$n(n,r)&&this.An(n,r)&&this.Nn(n,r)&&this.Dn(n,r),this.$n=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=e,this.qn=new Set,this.jn=new Set}init(){var e,n;ge((e=this._instance)==null?void 0:e._addCaptureHook)||(n=this._instance)==null||n._addCaptureHook(((r,s)=>{this.on(r,s)}))}register(e){var n,r;if(!ge((n=this._instance)==null?void 0:n._addCaptureHook)&&(e.forEach((a=>{var c,u;(c=this.jn)==null||c.add(a),(u=a.steps)==null||u.forEach((f=>{var h;(h=this.qn)==null||h.add((f==null?void 0:f.event)||"")}))})),(r=this._instance)!=null&&r.autocapture)){var s,i=new Set;e.forEach((a=>{var c;(c=a.steps)==null||c.forEach((u=>{u!=null&&u.selector&&i.add(u==null?void 0:u.selector)}))})),(s=this._instance)==null||s.autocapture.setElementSelectors(i)}}on(e,n){var r;n!=null&&e.length!=0&&(this.qn.has(e)||this.qn.has(n.event))&&this.jn&&((r=this.jn)==null?void 0:r.size)>0&&this.jn.forEach((s=>{this.Hn(n,s)&&this.Fn.emit("actionCaptured",s.name)}))}Bn(e){this.onAction("actionCaptured",(n=>e(n)))}Hn(e,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.Ln(e,r))return!0;return!1}onAction(e,n){return this.Fn.on(e,n)}An(e,n){if(n!=null&&n.url){var r,s=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!s||typeof s!="string"||!oc(s,n.url,n.url_matching||"contains"))return!1}return!0}Nn(e,n){return!!this.Un(e,n)&&!!this.zn(e,n)&&!!this.Vn(e,n)}Un(e,n){var r;if(n==null||!n.href)return!0;var s=this.Wn(e);if(s.length>0)return s.some((c=>oc(c.href,n.href,n.href_matching||"exact")));var i,a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!a&&oc((i=a.match(/(?::|")href="(.*?)"/))?i[1]:"",n.href,n.href_matching||"exact")}zn(e,n){var r;if(n==null||!n.text)return!0;var s=this.Wn(e);if(s.length>0)return s.some((f=>oc(f.text,n.text,n.text_matching||"exact")||oc(f.$el_text,n.text,n.text_matching||"exact")));var i,a,c,u=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!u&&(i=(function(f){for(var h,p=[],m=/(?::|")text="(.*?)"/g;!Je(h=m.exec(f));)p.includes(h[1])||p.push(h[1]);return p})(u),a=n.text,c=n.text_matching||"exact",i.some((f=>oc(f,a,c))))}Vn(e,n){var r,s;if(n==null||!n.selector)return!0;var i=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(i!=null&&i.includes(n.selector))return!0;var a=(e==null||(s=e.properties)==null?void 0:s.$elements_chain)||"";if(n.selector_regex&&a)try{return new RegExp(n.selector_regex).test(a)}catch{return!1}return!1}Wn(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e==null?void 0:e.properties.$elements}Dn(e,n){return n==null||!n.properties||n.properties.length===0||PP(n.properties.reduce(((r,s)=>{var i=Qe(s.value)?s.value.map(String):s.value!=null?[String(s.value)]:[];return r[s.key]={values:i,operator:s.operator||"exact"},r}),{}),e==null?void 0:e.properties)}}class yD{constructor(e){var n;this.Zn=[],this._instance=e,this.Gn=new Map,this.Qn=new Map,this.Jn=new Map,(n=this._instance)==null||n.onSessionId==null||n.onSessionId((r=>this.Kn(r)))}Yn(e,n){return!!e&&PP(e.propertyFilters,n==null?void 0:n.properties)}Xn(e,n){var r=new Map;return e.forEach((s=>{var i;(i=s.conditions)==null||(i=i[n])==null||(i=i.values)==null||i.forEach((a=>{if(a!=null&&a.name){var c=r.get(a.name)||[];c.push(s.id),r.set(a.name,c)}}))})),r}es(e,n,r){var s=(r===nd.Activation?this.Gn:this.Qn).get(e),i=[];return this.ts((a=>{i=a.filter((c=>s==null?void 0:s.includes(c.id)))})),i.filter((a=>{var c,u=(c=a.conditions)==null||(c=c[r])==null||(c=c.values)==null?void 0:c.find((f=>f.name===e));return this.Yn(u,n)}))}register(e){var n;ge((n=this._instance)==null?void 0:n._addCaptureHook)||(this.rs(e),this.ns(e))}ns(e){var n=e.filter((r=>{var s,i;return((s=r.conditions)==null?void 0:s.actions)&&((i=r.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0}));n.length!==0&&(this.ss==null&&(this.ss=new vD(this._instance),this.ss.init(),this.ss.Bn((r=>{this.onAction(r)}))),n.forEach((r=>{var s,i,a,c,u;r.conditions&&(s=r.conditions)!=null&&s.actions&&(i=r.conditions)!=null&&(i=i.actions)!=null&&i.values&&((a=r.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((c=this.ss)==null||c.register(r.conditions.actions.values),(u=r.conditions)==null||(u=u.actions)==null||(u=u.values)==null||u.forEach((f=>{if(f&&f.name){var h=this.Jn.get(f.name);h&&h.push(r.id),this.Jn.set(f.name,h||[r.id])}})))})))}rs(e){var n,r=e.filter((i=>{var a,c;return((a=i.conditions)==null?void 0:a.events)&&((c=i.conditions)==null||(c=c.events)==null||(c=c.values)==null?void 0:c.length)>0})),s=e.filter((i=>{var a,c;return((a=i.conditions)==null?void 0:a.cancelEvents)&&((c=i.conditions)==null||(c=c.cancelEvents)==null||(c=c.values)==null?void 0:c.length)>0}));r.length===0&&s.length===0||((n=this._instance)==null||n._addCaptureHook(((i,a)=>{this.onEvent(i,a)})),this.Gn=this.Xn(e,nd.Activation),this.Qn=this.Xn(e,nd.Cancellation))}onEvent(e,n){var r,s,i=this.os(),a=(n==null||(r=n.properties)==null?void 0:r.$survey_id)||(n==null||(s=n.properties)==null?void 0:s.$product_tour_id);if(a&&this.getActivatedIds().includes(a)){var c=this.ls(e,a);if(c==="consume")return i.info("event consumed activated item, removing it",{event:e,itemId:a}),void this.us([a]);if(c==="persist")return i.info("shown item promoted to persisted activation",{event:e,itemId:a}),void this.hs(a)}if(this.Qn.has(e)){var u=this.es(e,n,nd.Cancellation);u.length>0&&(i.info("cancel event matched, cancelling items",{event:e,itemsToCancel:u.map((h=>h.id))}),this.us(u.map((h=>h.id))),u.forEach((h=>this.ds(h.id))))}if(this.Gn.has(e)){i.info("event name matched",{event:e,eventPayload:n,items:this.Gn.get(e)});var f=this.es(e,n,nd.Activation);this.cs(f.map((h=>h.id)))}}onAction(e){this.Jn.has(e)&&this.cs(this.Jn.get(e)||[])}cs(e){e.length!==0&&(this.Zn=[...new Set([...this.Zn,...e])],this.os().info("updating activated items",{activatedItems:this.getActivatedIds()}))}hs(e){this.Zn=this.Zn.filter((r=>r!==e));var n=this.vs();n.includes(e)||(this.fs([...n,e]),this.ps())}us(e){var n=new Set(e);this.Zn=this.Zn.filter((i=>!n.has(i)));var r=this.gs(),s=r.filter((i=>!n.has(i)));s.length!==r.length&&(this.fs(s),s.length===0&&this.ys())}gs(){var e,n=this.bs();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n])||[]}vs(){var e,n,r=this.gs();if(r.length===0)return[];var s=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[this._s()],i=(n=this._instance)==null||n.get_session_id==null?void 0:n.get_session_id();return i&&s===i?r:[]}ps(){var e,n=(e=this._instance)==null||e.get_session_id==null?void 0:e.get_session_id();n&&this.ws(n)}ys(){this.xs()}Kn(e){var n,r=(n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[this._s()];r&&r!==e&&(this.gs().length>0&&this.fs([]),this.ys())}getActivatedIds(){return[...new Set([...this.vs(),...this.Zn])].filter((e=>!this.ks(e)))}reset(){this.Zn=[],this.gs().length>0&&this.fs([]),this.ys()}getEventToItemsMap(){return this.Gn}Ss(){return this.ss}}class _D extends yD{constructor(e){super(e)}bs(){return Ey}_s(){return kp}Cs(){return no.SHOWN}ts(e){var n;(n=this._instance)==null||n.getSurveys(e)}ds(e){var n;(n=this._instance)==null||n.cancelPendingSurvey(e)}os(){return yt}fs(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[Ey]:e})}ws(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[kp]:e})}xs(){var e;(e=this._instance)==null||(e=e.persistence)==null||e.unregister(kp)}ks(){return!1}ls(e,n){var r;this.ts((i=>{r=i.find((a=>a.id===n))}));var s=!r||(function(i){var a;return TP(i)&&!((a=i.conditions)==null||(a=a.events)==null||!a.repeatedActivation)||i.schedule==="always"})(r);return s?e===no.SHOWN?"consume":"ignore":e===no.SHOWN?"persist":e===no.DISMISSED||e===no.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Jh="SDK is not enabled or survey functionality is not yet loaded",aC="Disabled. Not loading surveys.",xD=te!=null&&te.location?ym(te.location.hash,"__posthog")||ym(location.hash,"state"):null,lC="_postHogToolbarParams",cC=Ft("[Toolbar]"),fn=Ft("[FeatureFlags]"),$a=Ft("[FeatureFlags]",{debugEnabled:!0}),Hv=`" failed. Feature flags didn't load in time.`,uC=t=>{for(var e={},n=0;t.length>n;n++)e[t[n]]=!0;return e},dC=t=>{var e={};for(var n of Pp(t||{})){var r=n[1];r&&(e[n[0]]=r)}return e},Fi=Ft("[Error tracking]"),fC="Refusing to render web experiment since the viewer is a likely bot",wD={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>wm(e,t),not_regex:(t,e)=>!wm(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class Kn{get Te(){return this._instance.config}constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((s=>{Kn.Ts("retrieved web experiments from the server"),n.Is=new Map,s.forEach((i=>{if(i.feature_flag_key){var a;n.Is&&(Kn.Ts("setting flag key ",i.feature_flag_key," to web experiment ",i),(a=n.Is)==null||a.set(i.feature_flag_key,i));var c=n._instance.getFeatureFlag(i.feature_flag_key);_t(c)&&i.variants[c]&&n.Ms(i.name,c,i.variants[c].transforms)}else if(i.variants)for(var u in i.variants){var f=i.variants[u];Kn.Es(f,n._instance)&&n.Ms(i.name,u,f.transforms)}}))}),r)},this._instance=e,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())Kn.Ts(fC);else if(!this.Te.disable_web_experiments){if(Je(this.Is))return this.Is=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Kn.Ts("applying feature flags",e),e.forEach((n=>{var r;if(this.Is&&(r=this.Is)!=null&&r.has(n)){var s,i=this._instance.getFeatureFlag(n),a=(s=this.Is)==null?void 0:s.get(n);i&&a!=null&&a.variants[i]&&this.Ms(a.name,i,a.variants[i].transforms)}}))}}previewWebExperiment(){var e=Kn.getWindowLocation();if(e!=null&&e.search){var n=Xc(e==null?void 0:e.search,"__experiment_id"),r=Xc(e==null?void 0:e.search,"__experiment_variant");n&&r&&(Kn.Ts("previewing web experiments "+n+" && "+r),this.getWebExperiments((s=>{this.Rs(parseInt(n),r,s)}),!1,!0))}}loadIfEnabled(){this.Te.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this.Te.disable_web_experiments&&!r)return e([]);var s=this._instance.get_property("$web_experiments");if(s&&!n)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Te.token),method:"GET",timestampMode:"query",callback:i=>e(i.statusCode===200&&i.json&&i.json.experiments||[])})}Rs(e,n,r){var s=r.filter((i=>i.id===e));s&&s.length>0&&(Kn.Ts("Previewing web experiment ["+s[0].name+"] with variant ["+n+"]"),this.Ms(s[0].name,n,s[0].variants[n].transforms))}static Es(e,n){return!Je(e.conditions)&&Kn.Ps(e,n)&&Kn.Os(e)}static Ps(e,n){var r;if(Je(e.conditions)||Je((r=e.conditions)==null?void 0:r.url))return!0;var s=Kn.getWindowLocation();if(s){var i,a,c,u=U6(n,s.href);return(i=e.conditions)==null||!i.url||wD[(a=(c=e.conditions)==null?void 0:c.urlMatchType)!==null&&a!==void 0?a:"icontains"](e.conditions.url,u)}return!1}static getWindowLocation(){return te==null?void 0:te.location}static Os(e){var n;if(Je(e.conditions)||Je((n=e.conditions)==null?void 0:n.utm))return!0;var r=oP();if(r.utm_source){var s,i,a,c,u,f,h,p,m=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_campaign||((i=e.conditions)==null||(i=i.utm)==null?void 0:i.utm_campaign)==r.utm_campaign,_=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((c=e.conditions)==null||(c=c.utm)==null?void 0:c.utm_source)==r.utm_source,x=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_medium||((f=e.conditions)==null||(f=f.utm)==null?void 0:f.utm_medium)==r.utm_medium,y=(h=e.conditions)==null||(h=h.utm)==null||!h.utm_term||((p=e.conditions)==null||(p=p.utm)==null?void 0:p.utm_term)==r.utm_term;return m&&x&&y&&_}return!1}static Ts(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;n>s;s++)r[s-1]=arguments[s];_e.info("[WebExperiments] "+e,r)}Ms(e,n,r){this._is_bot()?Kn.Ts(fC):n!=="control"?r.forEach((s=>{if(s.selector){var i;Kn.Ts("applying transform of variant "+n+" for experiment "+e+" ",s);var a=(i=document)==null?void 0:i.querySelectorAll(s.selector);a==null||a.forEach((c=>{var u=c;s.html&&(u.innerHTML=s.html),s.css&&u.setAttribute("style",s.css)}))}})):Kn.Ts("Control variants leave the page unmodified.")}_is_bot(){return or&&this._instance?EP(or,this.Te.custom_blocked_useragents):void 0}}var us=Ft("[Conversations]"),Ha="Conversations not available yet.",hC="console",r0={featureFlags:class{constructor(t){this.Fs=!1,this.Ls=!1,this.$s=!1,this.As=!1,this.Ns=!1,this.Ds=!1,this.qs=!1,this.js=!1,this.Hs=0,this.Bs=()=>{var e=this.Us();this.Hs=0,e&&this.reloadFeatureFlags()},this._instance=t,this.featureFlagEventHandlers=[],te&&zt(te,"online",this.Bs)}destroy(){te==null||te.removeEventListener("online",this.Bs)}get Te(){return this._instance.config}get mi(){return this._instance.persistence}zs(t){return this._instance.get_property(t)}Vs(){var t,e;return(t=(e=this.mi)==null?void 0:e._r(this.Te.feature_flag_cache_ttl_ms))!==null&&t!==void 0&&t}Ws(){return!!this.Vs()&&(this.js||this.$s||(this.js=!0,fn.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Zs(){var t,e=(t=this.Te.evaluation_contexts)!==null&&t!==void 0?t:this.Te.evaluation_environments;return!this.Te.evaluation_environments||this.Te.evaluation_contexts||this.qs||(fn.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.qs=!0),e!=null&&e.length?e.filter((n=>{var r=n&&typeof n=="string"&&n.trim().length>0;return r||fn.error("Invalid evaluation context found:",n,"Expected non-empty string"),r})):[]}Gs(){return this.Zs().length>0}Qs(){var t=this.Te.flag_keys;if(!ge(t)){if(Qe(t))return t.filter((e=>{var n=e&&typeof e=="string"&&e.trim().length>0;return n||fn.error("Invalid flag key found:",e,"Expected non-empty string"),n}));fn.error("Invalid flag_keys found:",t,"Expected array of non-empty strings")}}initialize(){var t,e,n=this._instance.config,r=(t=(e=n.bootstrap)==null?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(r).length){var s,i,a=(s=(i=n.bootstrap)==null?void 0:i.featureFlagPayloads)!==null&&s!==void 0?s:{},c=Object.keys(r).filter((f=>!!r[f])).reduce(((f,h)=>(f[h]=r[h]||!1,f)),{}),u=Object.keys(a).filter((f=>c[f])).reduce(((f,h)=>(a[h]&&(f[h]=a[h]),f)),{});this.receivedFeatureFlags({featureFlags:c,featureFlagPayloads:u})}}updateFlags(t,e,n){var r,s,i=n!=null&&n.merge&&(r=this.zs(tl))!==null&&r!==void 0?r:{},a=n!=null&&n.merge&&(s=this.zs(Cp))!==null&&s!==void 0?s:{},c=ue({},i,t),u=ue({},a,e),f={};for(var h of Object.entries(c)){var p=h[0],m=h[1];f[p]={key:p,enabled:pE(m),variant:mE(m),reason:void 0,metadata:ge(u==null?void 0:u[p])?void 0:{id:0,version:void 0,description:void 0,payload:u[p]}}}this.receivedFeatureFlags({flags:f})}get hasLoadedFlags(){return this.Ls}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.zs(wy),e=this.zs(Wi),n=this.zs(hc);if(!n&&!e)return t||{};var r=Rt({},t||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(var i of s){var a,c,u=r[i],f=e==null?void 0:e[i],h=ge(f)?(a=u==null?void 0:u.enabled)!==null&&a!==void 0&&a:!!f,p=ge(f)?u.variant:typeof f=="string"?f:void 0,m=n==null?void 0:n[i],_=ue({},u,{enabled:h,variant:h?p??(u==null?void 0:u.variant):void 0});h!==(u==null?void 0:u.enabled)&&(_.original_enabled=u==null?void 0:u.enabled),p!==(u==null?void 0:u.variant)&&(_.original_variant=u==null?void 0:u.variant),m&&(_.metadata=ue({},u==null?void 0:u.metadata,{payload:m,original_payload:u==null||(c=u.metadata)==null?void 0:c.payload})),r[i]=_}return this.Fs||(fn.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:r}),this.Fs=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((n=>{var r=t[n];return{key:n,enabled:pE(r),variant:mE(r),payload:hE(e[n])}}))}getFlagVariants(){var t=this.zs(tl),e=this.zs(Wi);if(!e)return t||{};for(var n=Rt({},t),r=Object.keys(e),s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.Fs||(fn.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.Fs=!0),n}getFlagPayloads(){var t=this.zs(Cp),e=this.zs(hc);if(!e)return t||{};for(var n=Rt({},t||{}),r=Object.keys(e),s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.Fs||(fn.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.Fs=!0),n}reloadFeatureFlags(){this.As||this.Te.advanced_disable_feature_flags||this.Us()||this.Js||(this._instance.en.emit("featureFlagsReloading",!0),this.Js=setTimeout((()=>{this.Ks()}),5))}Ys(){clearTimeout(this.Js),this.Js=void 0}ensureFlagsLoaded(){this.Ls||this.$s||this.Js||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.As=t}Ks(t){var e;if(this.Ys(),!this._instance.Ur()&&!this.Us())if(this.$s)this.Ns=!0;else{var n=this.Te.token,r=this.zs(lm),s={token:n,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:ue({},((e=this.mi)==null?void 0:e.get_initial_props())||{},this.zs(Ya)||{},{$lib:mt.LIB_NAME,$lib_version:mt.LIB_VERSION}),group_properties:this.zs(Xa),timezone:fP()};ur(r)||ge(r)||(s.$device_id=r),(t!=null&&t.disableFlags||this.Te.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.Gs()&&(s.evaluation_contexts=this.Zs());var i=this.Qs();ge(i)||(s.flag_keys=i);var a=!!this.Te.advanced_only_evaluate_survey_feature_flags,c=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Te.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.$s=!0,this._instance._send_request({method:"POST",url:c,data:s,compression:this.Te.disable_compression?void 0:ir.Base64,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback:u=>{var f,h,p,m=!0;if(this.Xs(u.statusCode),u.statusCode===200&&(this.Ns||(this.$anon_distinct_id=void 0),m=!1),this.$s=!1,!s.disable_flags||this.Ns){this.Ds=!m;var _=[];u.error?u.error instanceof Error?_.push(u.error.name==="AbortError"?"timeout":"connection_error"):_.push("unknown_error"):u.statusCode!==200&&_.push("api_error_"+u.statusCode),(f=u.json)!=null&&f.errorsWhileComputingFlags&&_.push("errors_while_computing_flags");var x,y=!((h=u.json)==null||(h=h.quotaLimited)==null||!h.includes("feature_flags"));y&&_.push("quota_limited"),(p=this.mi)==null||p.register({[ky]:_}),y?fn.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(s.disable_flags||this.receivedFeatureFlags((x=u.json)!==null&&x!==void 0?x:{},m,{partialResponse:a}),this.Ns&&(this.Ns=!1,this.Ks()))}}})}}Us(){return sP(this.Hs,3)}Xs(t){this.Hs=iP(t,this.Hs,3,(()=>fn.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.")))}getFeatureFlag(t,e){var n;if(e===void 0&&(e={}),!e.fresh||this.Ds)if(this.Ls||this.getFlags()&&this.getFlags().length>0){if(!this.Ws()){var r=this.getFeatureFlagResult(t,e);return(n=r==null?void 0:r.variant)!==null&&n!==void 0?n:r==null?void 0:r.enabled}}else fn.warn('getFeatureFlag for key "'+t+Hv)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return e==null?void 0:e.payload}getFeatureFlagResult(t,e){if(e===void 0&&(e={}),!e.fresh||this.Ds)if(this.Ls||this.getFlags()&&this.getFlags().length>0){if(!this.Ws()){var n=this.getFlagVariants(),r=t in n,s=n[t],i=this.getFlagPayloads()[t],a=String(s),c=this.zs(by)||void 0,u=this.zs(Bd)||void 0,f=this.zs(kd)||{};if(this.Te.advanced_feature_flags_dedup_per_session){var h,p=this._instance.get_session_id(),m=this.zs(Cy);p&&p!==m&&(f={},(h=this.mi)==null||h.register({[kd]:f,[Cy]:p}))}if((e.send_event||!("send_event"in e))&&(!(t in f)||!f[t].includes(a))){var _,x,y,w,S,T,P,k,R,L,O;Qe(f[t])?f[t].push(a):f[t]=[a],(_=this.mi)==null||_.register({[kd]:f});var A=this.getFeatureFlagDetails(t),I=[...(x=this.zs(ky))!==null&&x!==void 0?x:[]];ge(s)&&I.push("flag_missing");var N={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:i||null,$feature_flag_request_id:c,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:((y=this.Te.bootstrap)==null||(y=y.featureFlags)==null?void 0:y[t])||null,$feature_flag_bootstrapped_payload:((w=this.Te.bootstrap)==null||(w=w.featureFlagPayloads)==null?void 0:w[t])||null,$used_bootstrap_value:!this.Ds};ge(A==null||(S=A.metadata)==null?void 0:S.has_experiment)||(N.$feature_flag_has_experiment=A.metadata.has_experiment),ge(A==null||(T=A.metadata)==null?void 0:T.version)||(N.$feature_flag_version=A.metadata.version);var j,F=(P=A==null||(k=A.reason)==null?void 0:k.description)!==null&&P!==void 0?P:A==null||(R=A.reason)==null?void 0:R.code;F&&(N.$feature_flag_reason=F),A!=null&&(L=A.metadata)!=null&&L.id&&(N.$feature_flag_id=A.metadata.id),ge(A==null?void 0:A.original_variant)&&ge(A==null?void 0:A.original_enabled)||(N.$feature_flag_original_response=ge(A.original_variant)?A.original_enabled:A.original_variant),A!=null&&(O=A.metadata)!=null&&O.original_payload&&(N.$feature_flag_original_payload=A==null||(j=A.metadata)==null?void 0:j.original_payload),I.length&&(N.$feature_flag_error=I.join(",")),this._instance.capture("$feature_flag_called",N)}if(r)return{key:t,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:hE(i)}}}else fn.warn('getFeatureFlagResult for key "'+t+Hv)}getRemoteConfigPayload(t,e){var n=this.Te.token,r={distinct_id:this._instance.get_distinct_id(),token:n,person_properties:{$lib:mt.LIB_NAME,$lib_version:mt.LIB_VERSION}};this.Gs()&&(r.evaluation_contexts=this.Zs());var s=this.Qs();ge(s)||(r.flag_keys=s),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this.Te.disable_compression?void 0:ir.Base64,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback(i){var a,c=(a=i.json)==null?void 0:a.featureFlagPayloads;e((c==null?void 0:c[t])||void 0)}})}isFeatureEnabled(t,e){if(e===void 0&&(e={}),e.fresh&&!this.Ds)return e.defaultValue;if(!(this.Ls||this.getFlags()&&this.getFlags().length>0))return fn.warn('isFeatureEnabled for key "'+t+Hv),e.defaultValue;var n=this.getFeatureFlag(t,e);return ge(n)?e.defaultValue:!!n}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,n){if(this.mi){this.Ls=!0;var r=this.getFlagVariants(),s=this.getFlagPayloads(),i=this.getFlagsWithDetails();(function(a,c,u,f,h,p){u===void 0&&(u={}),f===void 0&&(f={}),h===void 0&&(h={});var m=(A=>{var I=A.flags;return I?(A.featureFlags=Object.fromEntries(Object.keys(I).map((N=>{var j;return[N,(j=I[N].variant)!==null&&j!==void 0?j:I[N].enabled]}))),A.featureFlagPayloads=Object.fromEntries(Object.keys(I).filter((N=>I[N].enabled)).filter((N=>{var j;return(j=I[N].metadata)==null?void 0:j.payload})).map((N=>{var j;return[N,(j=I[N].metadata)==null?void 0:j.payload]})))):A.featureFlags&&fn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),A})(a),_=m.flags,x=m.featureFlags,y=m.featureFlagPayloads;if(x){var w=a.requestId,S=a.evaluatedAt;if(Qe(x)){fn.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var T={};if(x)for(var P=0;x.length>P;P++)T[x[P]]=!0;c&&c.register({[Ep]:x,[tl]:T,[cm]:!1})}else{var k=x,R=y,L=_;if(p!=null&&p.partialResponse)k=ue({},u,k),R=ue({},f,R),L=ue({},h,L);else if(a.errorsWhileComputingFlags)if(_){var O=new Set(Object.keys(_).filter((A=>{var I;return!((I=_[A])!=null&&I.failed)})));k=ue({},u,Object.fromEntries(Object.entries(k).filter((A=>O.has(A[0]))))),R=ue({},f,Object.fromEntries(Object.entries(R||{}).filter((A=>O.has(A[0]))))),L=ue({},h,Object.fromEntries(Object.entries(L||{}).filter((A=>O.has(A[0])))))}else k=ue({},u,k),R=ue({},f,R),L=ue({},h,L);c&&c.register(ue({[Ep]:Object.keys(dC(k)),[tl]:k||{},[Cp]:R||{},[wy]:L||{},[cm]:a.minimalFlagCalledEvents===!0},w?{[by]:w}:{},S?{[Bd]:S}:{}))}}})(t,this.mi,r,s,i,n),e||(this.js=!1),this.eo(e)}}override(t,e){e===void 0&&(e=!1),fn.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.mi)return fn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this.mi.unregister(Wi),this.mi.unregister(hc),this.eo(),$a.info("All overrides cleared");if(Qe(t)){var e=uC(t);return this.mi.register({[Wi]:e}),this.eo(),$a.info("Flag overrides set",{flags:t})}if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var n,r=t;if(this.Fs=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this.mi.unregister(Wi),$a.info("Flag overrides cleared");else if(r.flags){if(Qe(r.flags)){var s=uC(r.flags);this.mi.register({[Wi]:s})}else this.mi.register({[Wi]:r.flags});$a.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this.mi.unregister(hc),$a.info("Payload overrides cleared")):r.payloads&&(this.mi.register({[hc]:r.payloads}),$a.info("Payload overrides set",{payloads:r.payloads}))),void this.eo()}if(t&&typeof t=="object")return this.mi.register({[Wi]:t}),this.eo(),$a.info("Flag overrides set",{flags:t});fn.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Ls){var e=this.ro(),n=e.flags,r=e.flagVariants;try{t(n,r)}catch(s){fn.error("Error while running feature flags callback",s)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var r,s=(this.zs(_d)||[]).find((u=>u.flagKey===t)),i={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:i};s&&(a.$early_access_feature_name=s.name),n&&(a.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(i,!1);var c=ue({},this.getFlagVariants(),{[t]:e});(r=this.mi)==null||r.register({[Ep]:Object.keys(dC(c)),[tl]:c}),this.eo()}getEarlyAccessFeatures(t,e,n){e===void 0&&(e=!1);var r=this.zs(_d),s=n?"&"+n.map((i=>"stage="+i)).join("&"):"";if(r&&!e)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Te.token+s),method:"GET",timestampMode:"query",callback:i=>{var a,c;if(i.json){var u=i.json.earlyAccessFeatures;return(a=this.mi)==null||a.unregister(_d),(c=this.mi)==null||c.register({[_d]:u}),t(u)}}})}ro(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((n=>e[n])),flagVariants:Object.keys(e).filter((n=>e[n])).reduce(((n,r)=>(n[r]=e[r],n)),{})}}eo(t){var e=this.ro(),n=e.flags,r=e.flagVariants;this.featureFlagEventHandlers.forEach((s=>{try{s(n,r,{errorsLoading:t})}catch(i){fn.error("Error while running feature flags callback",i)}}))}setPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.zs(Ya)||{},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(var a in s)({}).hasOwnProperty.call(s,a)&&(a in n||(i[a]=s[a]));this._instance.register({[Ya]:ue({},n,i,r)}),e&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=ue({},this.zs(Ya)||{});t.forEach((r=>{delete n[r]})),this._instance.register({[Ya]:n}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){t===void 0&&(t=!0),this._instance.unregister(Ya),t&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.zs(Xa)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((r=>{n[r]=ue({},n[r],t[r]),delete t[r]})),this._instance.register({[Xa]:ue({},n,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.zs(Xa)||{};this._instance.register({[Xa]:ue({},e,{[t]:{}})})}else this._instance.unregister(Xa)}reset(){this.Ls=!1,this.$s=!1,this.As=!1,this.Ns=!1,this.Ds=!1,this.$anon_distinct_id=void 0,this.Ys(),this.Fs=!1,this.Hs=0}}},bD={sessionRecording:class{get Te(){return this._instance.config}get mi(){return this._instance.persistence}get started(){var t;return!((t=this.io)==null||!t.isStarted)}get status(){var t,e;return this.no===cd||this.no===Qh?this.no:(t=(e=this.io)==null?void 0:e.status)!==null&&t!==void 0?t:this.no}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.no=sC,this.so=void 0,this._instance=t,!this._instance.sessionManager)throw ji.error("started without valid sessionManager"),new Error(Hy+" started without valid sessionManager. This is a bug.");if(this.Te.cookieless_mode===eo)throw new Error(Hy+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get oo(){var t,e=!((t=this._instance.get_property(sl))==null||!t.enabled),n=!this.Te.disable_session_recording,r=this.Te.disable_session_recording||this._instance.consent.isOptedOut();return te&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(!this.oo||(e=this.io)==null||!e.isStarted){var n=!ge(Object.assign)&&!ge(Array.from);this.oo&&n?(this.ao(t),ji.info("starting")):(this.no=sC,this.stopRecording())}}ao(t){var e,n,r;this.oo&&(this.no!==cd&&this.no!==Qh&&(this.no=iC),$e!=null&&(e=$e.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(n=$e.__PosthogExtensions__)!=null&&n.initSessionRecording?this.lo(t):(r=$e.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.uo,(s=>{if(s)return ji.error("could not load recorder",s);this.lo(t)})))}stopRecording(){var t,e;(t=this.so)==null||t.call(this),this.so=void 0,(e=this.io)==null||e.stop()}ho(){var t,e;(t=this.so)==null||t.call(this),this.so=void 0,(e=this.io)==null||e.discard()}do(){var t,e;(t=this.mi)==null||t.unregister(C2),(e=this.mi)==null||e.unregister(I6)}co(t,e){if(Je(t))return null;var n,r=Vn(t)?t:parseFloat(t);return typeof(n=r)!="number"||!Number.isFinite(n)||0>n||n>1?(ji.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}vo(t){if(this.mi){var e,n,r=this.mi,s=()=>{var i,a=t.sessionRecording===!1?void 0:t.sessionRecording,c=this.co((i=this.Te.session_recording)==null?void 0:i.sampleRate,"session_recording.sampleRate"),u=this.co(a==null?void 0:a.sampleRate,"remote config sampleRate"),f=c??u;Je(f)&&this.do();var h=a==null?void 0:a.minimumDurationMilliseconds;r.register({[sl]:ue({cache_timestamp:Date.now(),enabled:!!a},a,{networkPayloadCapture:ue({capturePerformance:t.capturePerformance},a==null?void 0:a.networkPayloadCapture),canvasRecording:{enabled:a==null?void 0:a.recordCanvas,fps:a==null?void 0:a.canvasFps,quality:a==null?void 0:a.canvasQuality},sampleRate:f,minimumDurationMilliseconds:ge(h)?null:h,endpoint:a==null?void 0:a.endpoint,triggerMatchType:a==null?void 0:a.triggerMatchType,masking:a==null?void 0:a.masking,urlTriggers:a==null?void 0:a.urlTriggers,version:a==null?void 0:a.version,triggerGroups:a==null?void 0:a.triggerGroups})})};s(),(e=this.so)==null||e.call(this),this.so=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(s)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?e.sessionRecording===!1?(this.vo(e),void this.ho()):(this.vo(e),void this.startIfEnabledOrStop()):(this.no===cd&&(this.no=Qh,ji.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var n;e===void 0&&(e="log"),(n=this.io)!=null&&n.log?this.io.log(t,e):ji.warn("log called before recorder was ready")}get uo(){var t,e,n=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.get_property(sl);return(n==null||(e=n.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}fo(){var t,e,n=this._instance.get_property(sl);if(!n)return!1;try{e=typeof n=="object"?n:JSON.parse(n)}catch(s){return ji.warn("persisted remote config for session recording is invalid and will be ignored",s),!1}var r=(t=e.cache_timestamp)!==null&&t!==void 0?t:Date.now();return 36e5>=Date.now()-r}lo(t){var e,n;if((e=$e.__PosthogExtensions__)==null||!e.initSessionRecording)return ji.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[V6]:!0});if(this.io||(this.io=(n=$e.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.io._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.fo())return this.no===Qh||this.no===cd?void 0:(this.no=cd,ji.info("persisted remote config is stale, requesting fresh config before starting"),void new hP(this._instance).load());this.no=iC,this.io.start(t)}onRRwebEmit(t){var e;(e=this.io)==null||e.onRRwebEmit==null||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.io||(e=this.mi)==null||e.register({[O6]:!0}),(t=this.io)==null||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.io||(e=this.mi)==null||e.register({[M6]:!0}),(t=this.io)==null||t.overrideSampling()}overrideTrigger(t){var e,n;this.io||(n=this.mi)==null||n.register({[t==="url"?L6:N6]:!0}),(e=this.io)==null||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.io)==null?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var n;return!((n=this.io)==null||!n.tryAddCustomEvent(t,e))}}},SD={autocapture:class{constructor(t){this.po=!1,this.mo=null,this.yo=!1,this.bo=!1,this.instance=t,this.rageclicks=new tC(t.config.rageclick),this._o=null}initialize(){this.startIfEnabled()}get Te(){var t,e,n=Lt(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(t=n.url_allowlist)==null?void 0:t.map((r=>new RegExp(r))),n.url_ignorelist=(e=n.url_ignorelist)==null?void 0:e.map((r=>new RegExp(r))),n}wo(){if(this.isBrowserSupported()){if(te&&Se){var t=n=>{n=n||(te==null?void 0:te.event);try{this.xo(n)}catch(r){Dv.error("Failed to capture event",r)}};if(zt(Se,"submit",t,{capture:!0}),zt(Se,"change",t,{capture:!0}),zt(Se,"click",t,{capture:!0}),this.Te.capture_copied_text){var e=n=>{n=n||(te==null?void 0:te.event);try{this.xo(n,Nv)}catch(r){Dv.error("Failed to capture copy/cut event",r)}};zt(Se,"copy",e,{capture:!0}),zt(Se,"cut",e,{capture:!0})}}}else Dv.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.po&&(this.wo(),this.po=!0)}onRemoteConfig(t){if(this.yo=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.bo=e.elementsChainAsString);var n=e.autocapture_opt_out;$s(n)&&(this.instance.persistence&&this.instance.persistence.register({[py]:n}),this.mo=n),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this._o=t}getElementSelectors(t){var e,n=[];return(e=this._o)==null||e.forEach((r=>{var s=Se==null?void 0:Se.querySelectorAll(r);s==null||s.forEach((i=>{t===i&&n.push(r)}))})),n}get isEnabled(){var t,e,n=(t=this.instance.persistence)==null?void 0:t.props[py],r=this.mo,s=this.instance.Ur()&&!this.yo;if(ur(r)&&!$s(n)&&!s)return!1;var i=(e=this.mo)!==null&&e!==void 0?e:!!n;return!!this.instance.config.autocapture&&!i}xo(t,e){if(e===void 0&&(e="$autocapture"),this.isEnabled){var n,r=Ev(t);W6(r)&&(r=r.parentNode||null),e==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime())&&NE(r,this.instance.config.rageclick)&&this.xo(t,"$rageclick");var s=e===Nv;if(r&&(function(p,m,_,x,y,w){var S;if(!te||A2(p)||_!=null&&_.url_allowlist&&!ME(_.url_allowlist,w)||_!=null&&_.url_ignorelist&&ME(_.url_ignorelist,w))return!1;if(_!=null&&_.dom_event_allowlist){var T=_.dom_event_allowlist;if(T&&!T.some((A=>m.type===A)))return!1}var P=X6(p,x),k=P.parentIsUsefulElement,R=P.targetElementList;if(!(function(A,I){var N=I==null?void 0:I.element_allowlist;if(ge(N))return!0;var j,F=function(X){if(N.some((W=>X.tagName.toLowerCase()===W)))return{v:!0}};for(var K of A)if(j=F(K))return j.v;return!1})(R,_)||!My(R,_==null?void 0:_.css_selector_allowlist)||My(R,(S=_==null?void 0:_.css_selector_ignorelist)!==null&&S!==void 0?S:SN))return!1;try{var L=te.getComputedStyle(p);if(L&&L.getPropertyValue("cursor")==="pointer"&&m.type==="click")return!0}catch{}var O=p.tagName.toLowerCase();switch(O){case"html":return!1;case"form":return(y||["submit"]).indexOf(m.type)>=0;case"input":case"select":case"textarea":return(y||["change","click"]).indexOf(m.type)>=0;default:return k?(y||["click"]).indexOf(m.type)>=0:(y||["click"]).indexOf(m.type)>=0&&(R2.indexOf(O)>-1||p.getAttribute("contenteditable")==="true")}})(r,t,this.Te,s,s?["copy","cut"]:void 0,this.instance)){var i=hD(r,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Te.element_attribute_ignorelist,elementsChainAsString:this.bo,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),a=i.props;if(i.explicitNoCapture)return!1;var c=this.getElementSelectors(r);if(c&&c.length>0&&(a.$element_selectors=c),e===Nv){var u,f=Z6(te==null||(u=te.getSelection())==null?void 0:u.toString()),h=t.type||"clipboard";if(!f)return!1;a.$selected_content=f,a.$copy_type=h}return this.instance.capture(e,a),!0}}}isBrowserSupported(){return Vs(Se==null?void 0:Se.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.ko=(te==null||(e=te.location)==null?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(_e.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.So&&this.So(),this.So=void 0,_e.info("History API monitoring stopped")}monitorHistoryChanges(){te&&te.history&&(this.Co("pushState"),this.Co("replaceState"),this.To())}Co(t){var e;if(te&&((e=te.history[t])==null||!e.__posthog_wrapped__)){var n=this;(function(r,s,i){try{if(!(s in r))return nC;var a={next:r[s]},c=i((function(){for(var u=arguments.length,f=new Array(u),h=0;u>h;h++)f[h]=arguments[h];return a.next.apply(this,f)}));return Vs(c)&&(c.prototype=c.prototype||{},Object.defineProperties(c,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:a}})),r[s]=c,()=>{if(r[s]!==c)for(var u=r[s];Vs(u)&&u.__posthog_layer__;){var f=u.__posthog_layer__;if(f.next===c)return void(f.next=a.next);u=f.next}else r[s]=a.next}}catch{return nC}})(te.history,t,(r=>function(s,i,a){r.call(this,s,i,a),n.Io(t)}))}}Io(t){try{var e,n=te==null||(e=te.location)==null?void 0:e.pathname;if(!n)return;n!==this.ko&&this.isEnabled&&this._instance.capture(pc,{navigation_type:t}),this.ko=n}catch(r){_e.error("Error capturing "+t+" pageview",r)}}To(){if(!this.So){var t=()=>{this.Io("popstate")};zt(te,"popstate",t),this.So=()=>{te&&te.removeEventListener("popstate",t)}}}},heatmaps:class{get Te(){return this.instance.config}constructor(t){var e;this.Mo=!1,this.po=!1,this.Eo=null,this.instance=t,this.Mo=!((e=this.instance.persistence)==null||!e.props[my]),this.rageclicks=new tC(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Lt(this.Te.capture_heatmaps)&&this.Te.capture_heatmaps.flush_interval_milliseconds&&(t=this.Te.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Je(this.Te.capture_heatmaps)?Je(this.Te.enable_heatmaps)?this.Mo:this.Te.enable_heatmaps:this.Te.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.po)return;mD.info("starting..."),this.Ro(),this.ke()}else{var t;clearInterval((t=this.Eo)!==null&&t!==void 0?t:void 0),this.Po(),this.getAndClearBuffer()}}onRemoteConfig(t){if(t.ok){var e=t.config;if("heatmaps"in e){var n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[my]:n}),this.Mo=n,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.R;return this.R=void 0,t}Oo(t){Fv(t.originalEvent)&&this.pe(t.originalEvent,"deadclick")}ke(){this.Eo&&clearInterval(this.Eo),this.Eo=(Se==null?void 0:Se.visibilityState)==="visible"?setInterval(this.oi.bind(this),this.flushIntervalMilliseconds):null}Ro(){te&&Se&&(this.Fo=this.oi.bind(this),zt(te,pm,this.Fo),this.Lo=t=>this.pe(t||(te==null?void 0:te.event)),zt(Se,"click",this.Lo,{capture:!0}),this.$o=t=>this.Ao(t||(te==null?void 0:te.event)),zt(Se,"mousemove",this.$o,{capture:!0}),this.No=new FE(this.instance,IN,this.Oo.bind(this)),this.No.startIfEnabledOrStop(),this.Do=this.ke.bind(this),zt(Se,hm,this.Do),this.po=!0)}Po(){var t;te&&Se&&(this.Fo&&te.removeEventListener(pm,this.Fo),this.Lo&&Se.removeEventListener("click",this.Lo,{capture:!0}),this.$o&&Se.removeEventListener("mousemove",this.$o,{capture:!0}),this.Do&&Se.removeEventListener(hm,this.Do),clearTimeout(this.qo),(t=this.No)==null||t.stop(),this.po=!1)}jo(t,e){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),i=(function(a,c,u){for(var f=a;f&&aa(f)&&!Kr(f,"body");){if(f===u)return!1;var h=void 0;try{var p,m,_;h=(p=(m=(_=f.ownerDocument)==null?void 0:_.defaultView)!==null&&m!==void 0?m:te)==null?void 0:p.getComputedStyle(f).position}catch{return!1}if(Ge(c,h))return!0;f=q6(f)}return!1})(Ev(t),["fixed","sticky"],s);return{x:t.clientX+(i?0:r),y:t.clientY+(i?0:n),target_fixed:i,type:e}}pe(t,e){var n;if(e===void 0&&(e="click"),!IE(t.target)&&Fv(t)){var r=this.jo(t,e);(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&NE(Ev(t),this.instance.config.rageclick)&&this.Nt(ue({},r,{type:"rageclick"})),this.Nt(r)}}Ao(t){!IE(t.target)&&Fv(t)&&(clearTimeout(this.qo),this.qo=setTimeout((()=>{this.Nt(this.jo(t,"mousemove"))}),500))}Nt(t){if(te){var e=this.Te.disable_capture_url_hashes?oa(te.location.href):te.location.href,n=this.Te.custom_personal_data_properties,r=this.Te.mask_personal_data_properties?[...Qc,...n||[]]:[],s=Gd(e,r,Kd);this.R=this.R||{},this.R[s]||(this.R[s]=[]),this.R[s].push(t)}}oi(){this.R&&!Yo(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:FE,webVitalsAutocapture:class{constructor(t){var e;this.Mo=!1,this.po=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Ho=()=>{clearTimeout(this.Bo),this.R.metrics.length!==0&&(this._instance.capture("$web_vitals",this.R.metrics.reduce(((n,r)=>ue({},n,{["$web_vitals_"+r.name+"_event"]:ue({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Uo=n=>{var r;this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.zo();if(!ge(s))if(Je(n==null?void 0:n.name)||Je(n==null?void 0:n.value))Va.error("Invalid metric received",n);else if(!this.Vo||this.Vo>n.value){this.R.url!==s&&(this.Ho(),this.Bo=setTimeout(this.Ho,this.flushToCaptureTimeoutMs)),ge(this.R.url)&&(this.R.url=s),this.R.firstMetricTimestamp=ge(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0);var i=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0),a=ue({},n,{$current_url:s,timestamp:Date.now()});ge(i)||(a.$session_id=i.sessionId,a.$window_id=i.windowId),this.R.metrics.push(a),this.R.metrics.length===this.allowedMetrics.length&&this.Ho()}else Va.error("Ignoring metric with value >= "+this.Vo,n)},this.Wo=()=>{if(!this.po){var n,r,s,i,a=$e.__PosthogExtensions__;if(!ge(a)&&!ge(a.postHogWebVitalsCallbacks)){var c=a.postHogWebVitalsCallbacks;n=c.onLCP,r=c.onCLS,s=c.onFCP,i=c.onINP}n&&r&&s&&i?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.Uo.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Uo.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this.Uo.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.Uo.bind(this)),this.po=!0):Va.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Mo=!((e=this._instance.persistence)==null||!e.props[_y]),this.startIfEnabled()}get Zo(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,n=Lt(this.Zo)?(t=this.Zo)==null?void 0:t.web_vitals_allowed_metrics:void 0;return Je(n)?((e=this._instance.persistence)==null?void 0:e.props[xy])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(Lt(this.Zo)?this.Zo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=Lt(this.Zo)?this.Zo.web_vitals_attribution:void 0;return t!=null&&t}get Vo(){var t=Lt(this.Zo)&&Vn(this.Zo.__web_vitals_max_value)?this.Zo.__web_vitals_max_value:rC;return t>0&&6e4>=t?rC:t}get isEnabled(){var t=on==null?void 0:on.protocol;if(t!=="http:"&&t!=="https:")return Va.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Lt(this.Zo)?this.Zo.web_vitals:$s(this.Zo)?this.Zo:void 0;return $s(e)?e:this.Mo}startIfEnabled(){this.isEnabled&&!this.po&&(Va.info("enabled, starting..."),this.er(this.Wo))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var n=Lt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Lt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[_y]:n}),this._instance.persistence.register({[xy]:r})),this.Mo=n,this.startIfEnabled()}}}er(t){var e,n;(e=$e.__PosthogExtensions__)!=null&&e.postHogWebVitalsCallbacks?t():(n=$e.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(r=>{r?Va.error("failed to load script",r):t()}))}zo(){var t=te?this._instance.config.disable_capture_url_hashes?oa(te.location.href):te.location.href:void 0;if(t){var e=this._instance.config.custom_personal_data_properties,n=this._instance.config.mask_personal_data_properties?[...Qc,...e||[]]:[];return Gd(t,n,Kd)}Va.error("Could not determine current URL")}}},ED={exceptionObserver:class{constructor(t){var e;this.Wo=()=>{var n;if(te&&this.isEnabled&&(n=$e.__PosthogExtensions__)!=null&&n.errorWrappingFunctions){var r=$e.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=$e.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=$e.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Go&&this.Te.capture_unhandled_errors&&(this.Go=r(this.captureException.bind(this))),!this.Qo&&this.Te.capture_unhandled_rejections&&(this.Qo=s(this.captureException.bind(this))),!this.Jo&&this.Te.capture_console_errors&&(this.Jo=i(this.captureException.bind(this)))}catch(a){ld.error("failed to start",a),this.Ko()}}},this._instance=t,this.Yo=!((e=this._instance.persistence)==null||!e.props[gy]),this.Xo=new CL(ue({},(function(n){var r,s,i,a;return n===void 0&&(n={}),{refillRate:(r=(s=n.exceptionRateLimiterRefillRate)!==null&&s!==void 0?s:n.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(i=(a=n.exceptionRateLimiterBucketSize)!==null&&a!==void 0?a:n.__exceptionRateLimiterBucketSize)!==null&&i!==void 0?i:10}})(this._instance.config.error_tracking),{refillInterval:1e4,Ge:ld})),this.Te=this.ea(),this.startIfEnabledOrStop()}ea(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Lt(t)?e=ue({},e,t):(ge(t)?this.Yo:t)&&(e=ue({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Te.capture_console_errors||this.Te.capture_unhandled_errors||this.Te.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(ld.info("enabled"),this.Ko(),this.er(this.Wo)):this.Ko()}er(t){var e,n;(e=$e.__PosthogExtensions__)!=null&&e.errorWrappingFunctions?t():(n=$e.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return ld.error("failed to load script",r);t()}))}Ko(){var t,e,n;(t=this.Go)==null||t.call(this),this.Go=void 0,(e=this.Qo)==null||e.call(this),this.Qo=void 0,(n=this.Jo)==null||n.call(this),this.Jo=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.Yo=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[gy]:this.Yo}),this.Te=this.ea(),this.startIfEnabledOrStop())}}onConfigChange(){this.Te=this.ea()}captureException(t){var e,n,r,s=(e=t==null||(n=t.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&e!==void 0?e:"Exception";this.Xo.consumeRateLimit(s)?ld.info("Skipping exception capture because of client rate limiting.",{exception:s}):(r=this._instance.exceptions)==null||r.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,n;this.ta=[],this.ra=new zL([new YL,new iN,new QL,new XL,new rN,new nN,new eN,new sN],(function(r){for(var s=arguments.length,i=new Array(s>1?s-1:0),a=1;s>a;a++)i[a-1]=arguments[a];return function(c,u){u===void 0&&(u=0);for(var f=[],h=c.split(`
|
|
18
|
+
`),p=u;h.length>p;p++){var m=h[p];if(1024>=m.length){var _=PE.test(m)?m.replace(PE,"$1"):m;if(!_.match(/\S*Error: /)){for(var x of i){var y=x(_,r);if(y){f.push(y);break}}if(f.length>=50)break}}}return(function(w){if(!w.length)return[];var S=Array.from(w);return S.reverse(),S.slice(0,50).map((T=>{return ue({},T,{filename:T.filename||(P=S,P[P.length-1]||{}).filename,function:T.function||Yc});var P}))})(f)}})("web:javascript",GL,qL)),this._instance=t,this.ta=(e=(n=this._instance.persistence)==null?void 0:n.get_property(vy))!==null&&e!==void 0?e:[],this.ia=am(this.na()),this.sa=new aN(this.ia)}onConfigChange(){this.ia=am(this.na()),this.sa.setConfig(this.ia)}onRemoteConfig(t){var e,n,r;if(t.ok){var s=t.config;if("errorTracking"in s){var i=(e=(n=s.errorTracking)==null?void 0:n.suppressionRules)!==null&&e!==void 0?e:[],a=(r=s.errorTracking)==null?void 0:r.captureExtensionExceptions;this.ta=i,this._instance.persistence&&this._instance.persistence.register({[vy]:this.ta,[yy]:a})}}}get oa(){var t,e=!!this._instance.get_property(yy),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.ra.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.ia.enabled)try{if(!_t(t)||t.trim().length===0)return void Fi.warn("Ignoring exception step because message must be a non-empty string");var n=(function(i){if(!i)return{sanitizedProperties:{},droppedKeys:[]};var a=[];return{sanitizedProperties:Object.keys(i).reduce(((c,u)=>oN.has(u)?(a.push(u),c):(c[u]=i[u],c)),{}),droppedKeys:a}})(this.aa(e)),r=n.sanitizedProperties,s=n.droppedKeys;s.length>0&&Fi.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.sa.add(ue({[im]:t,[om]:new Date().toISOString()},r))}catch(i){Fi.error("Failed to add exception step. Ignoring breadcrumb.",i)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.la(e)){if(this.ua(e))return this.ha("Exception dropped: matched a suppression rule"),void Fi.info("Skipping exception capture because a suppression rule matched");if(!this.oa&&this.da(e))return this.ha("Exception dropped: thrown by a browser extension"),void Fi.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ca(e))return this.ha("Exception dropped: thrown by the PostHog SDK"),void Fi.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this.ia.enabled&&Je(t.$exception_steps)?this.va(t):t;try{var r=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",kn:!0});return r&&this.sa.clear(),r}catch(s){return Fi.error("Failed to capture exception event. Dropping this exception.",s),void this.sa.clear()}}catch(s){return void Fi.error("Failed to process exception event. Ignoring this exception.",s)}}va(t){try{var e=this.sa.getAttachable();return e.length===0?t:ue({},t,{$exception_steps:e})}catch(n){return Fi.error("Failed to read buffered exception steps. Capturing exception without steps.",n),t}}ha(t){this.ia.enabled&&this.sa.add({[im]:t,[om]:new Date().toISOString()})}aa(t){return Lt(t)?ue({},t):{}}na(){var t,e;return(t=(e=this._instance.config.error_tracking)==null?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}ua(t){if(t.length===0)return!1;var e=t.reduce(((n,r)=>{var s=r.type,i=r.value;return _t(s)&&s.length>0&&n.$exception_types.push(s),_t(i)&&i.length>0&&n.$exception_values.push(i),n}),{$exception_types:[],$exception_values:[]});return this.ta.some((n=>{var r=n.values.map((s=>{var i,a=kP[s.operator],c=Qe(s.value)?s.value:[s.value],u=(i=e[s.key])!==null&&i!==void 0?i:[];return c.length>0&&a(c,u)}));return n.type==="OR"?r.some(Boolean):r.every(Boolean)}))}da(t){return t.flatMap((e=>{var n,r;return(n=(r=e.stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[]})).some((e=>e.filename&&e.filename.startsWith("chrome-extension://")))}ca(t){if(t.length>0){var e,n,r,s,i=(e=(n=t[0].stacktrace)==null?void 0:n.frames)!==null&&e!==void 0?e:[],a=i[i.length-1];return(r=a==null||(s=a.filename)==null?void 0:s.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}la(t){return!Je(t)&&Qe(t)}}},CD=ue({productTours:class{get mi(){return this._instance.persistence}constructor(t){this.fa=null,this.pa=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var n,r;if(this.mi&&this.mi.register({[E2]:!!e.productTours}),!$v(this._instance))return!this.fa&&Je((n=this.mi)==null?void 0:n.props[xd])||Vv.info("product tours disabled; stopping and clearing cached tours"),(r=this.fa)==null||r.stop(),this.fa=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.fa&&$v(this._instance)&&this.er((()=>this.ga()))}er(t){var e,n;(e=$e.__PosthogExtensions__)!=null&&e.generateProductTours?t():(n=$e.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",(r=>{r?Vv.error("Could not load product tours script",r):t()}))}ga(){var t;!this.fa&&(t=$e.__PosthogExtensions__)!=null&&t.generateProductTours&&(this.fa=$e.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(e===void 0&&(e=!1),!Qe(this.pa)||e){var n=this.mi;if(n){var r=n.props[xd];if(Qe(r)&&!e)return this.pa=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:s=>{if($v(this._instance)){var i=s.statusCode;if(i!==200||!s.json){var a="Product Tours API could not be loaded, status: "+i;return Vv.error(a),void t([],{isLoaded:!1,error:a})}var c=Qe(s.json.product_tours)?s.json.product_tours:[];this.pa=c,n&&n.register({[xd]:c}),t(c,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.pa,{isLoaded:!0})}getActiveProductTours(t){Je(this.fa)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.fa.getActiveProductTours(t)}showProductTour(t){var e;(e=this.fa)==null||e.showTourById(t)}previewTour(t){this.fa?this.fa.previewTour(t):this.er((()=>{var e;this.ga(),(e=this.fa)==null||e.previewTour(t)}))}dismissProductTour(){var t;(t=this.fa)==null||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.fa)==null||t.nextStep()}previousStep(){var t;(t=this.fa)==null||t.previousStep()}clearCache(){var t;this.pa=null,(t=this.mi)==null||t.unregister(xd)}resetTour(t){var e;(e=this.fa)==null||e.resetTour(t)}resetAllTours(){var t;(t=this.fa)==null||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.fa)==null||e.cancelPendingTour(t)}}},r0),kD={siteApps:class{constructor(t){this.ma=0,this._instance=t,this.ya=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}ba(t,e){if(e){var n=this.globalsForEvent(e);this.ya.push(n),this.ya.length>1e3&&(this.ya=this.ya.slice(10))}}get siteAppLoaders(){var t;return(t=$e._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.ba.bind(this));this._a=()=>{t(),this.ya=[],this._a=void 0}}}globalsForEvent(t){var e,n,r,s,i,a,c;if(!t)throw new Error("Event payload is required");var u={},f=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var p of Object.entries(h)){var m=p[0];u[m]={id:f[m],type:m,properties:p[1]}}var _=t.$set_once,x=t.$set;return{event:ue({},X8(t,gD),{properties:ue({},t.properties,x?{$set:ue({},(e=(n=t.properties)==null?void 0:n.$set)!==null&&e!==void 0?e:{},x)}:{},_?{$set_once:ue({},(r=(s=t.properties)==null?void 0:s.$set_once)!==null&&r!==void 0?r:{},_)}:{}),elements_chain:(i=(a=t.properties)==null?void 0:a.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(c=t.properties)==null?void 0:c.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:u}}wa(t){var e,n=(e=t.tagName)==null?void 0:e.toLowerCase();return n==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(ti.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)||(ti.error("prepare_external_dependency_script returned null"),null):t}xa(){var t,e,n,r,s,i,a,c;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var u=Se==null?void 0:Se.defaultView,f=u==null||(t=u.Node)==null?void 0:t.prototype;if(!u||!f)return()=>{};if(this.ma++,this.ka)return this.Sa();var h=[],p=this,m=new WeakSet,_=(w,S,T)=>{if(w!=null&&w[S]){var P=w[S];w[S]=T(P),h.push((()=>{w[S]=P}))}},x=w=>{if(m.has(w))return w;var S=p.wa(w);return S&&m.add(S),S},y=w=>w.map((S=>typeof S=="string"?S:x(S))).filter((S=>!ur(S)));return _(f,"appendChild",(w=>function(S){var T=x(S);return T?w.call(this,T):S})),_(f,"insertBefore",(w=>function(S,T){var P=x(S);return P?w.call(this,P,T):S})),_(f,"replaceChild",(w=>function(S,T){var P=x(S);return P?w.call(this,P,T):T})),[(e=u.Element)==null?void 0:e.prototype,(n=u.Document)==null?void 0:n.prototype,(r=u.DocumentFragment)==null?void 0:r.prototype].forEach((w=>{_(w,"append",(S=>function(){for(var T=arguments.length,P=new Array(T),k=0;T>k;k++)P[k]=arguments[k];return S.apply(this,y(P))})),_(w,"prepend",(S=>function(){for(var T=arguments.length,P=new Array(T),k=0;T>k;k++)P[k]=arguments[k];return S.apply(this,y(P))}))})),[(s=u.Element)==null?void 0:s.prototype,(i=u.CharacterData)==null?void 0:i.prototype,(a=u.DocumentType)==null?void 0:a.prototype].forEach((w=>{_(w,"before",(S=>function(){for(var T=arguments.length,P=new Array(T),k=0;T>k;k++)P[k]=arguments[k];return S.apply(this,y(P))})),_(w,"after",(S=>function(){for(var T=arguments.length,P=new Array(T),k=0;T>k;k++)P[k]=arguments[k];return S.apply(this,y(P))})),_(w,"replaceWith",(S=>function(){for(var T=arguments.length,P=new Array(T),k=0;T>k;k++)P[k]=arguments[k];var R=y(P);return P.length&&!R.length?void 0:S.apply(this,R)}))})),_((c=u.Element)==null?void 0:c.prototype,"insertAdjacentElement",(w=>function(S,T){var P=x(T);return P?w.call(this,S,P):null})),this.ka=()=>{h.forEach((w=>w())),this.ka=void 0},this.Sa()}Sa(){var t=!1;return()=>{var e;t||(t=!0,this.ma--,this.ma===0&&((e=this.ka)==null||e.call(this)))}}Ca(t,e){e===void 0&&(e=!0);var n=this.xa();try{var r=t(n);return e&&n(),r}catch(s){throw n(),s}}setupSiteApp(t){var e=this.apps[t.id],n=()=>{var a;!e.errored&&this.ya.length&&(ti.info("Processing "+this.ya.length+" events for site app with id "+t.id),this.ya.forEach((c=>this.Ca((()=>e.processEvent==null?void 0:e.processEvent(c))))),e.processedBuffer=!0),Object.values(this.apps).every((c=>c.processedBuffer||c.errored))&&((a=this._a)==null||a.call(this))},r=!1,s=a=>{e.errored=!a,e.loaded=!0,ti.info("Site app with id "+t.id+" "+(a?"loaded":"errored")),r&&n()};try{var i=this.Ca((a=>t.init({posthog:this._instance,callback(c){a(),s(c)}})),!1).processEvent;i&&(e.processEvent=i),r=!0}catch(a){ti.error(oC+t.id,a),s(!1)}if(r&&e.loaded)try{n()}catch(a){ti.error("Error while processing buffered events PostHog app with config id "+t.id,a),e.errored=!0}}Ta(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of t)this.setupSiteApp(n)}Ia(t){var e=this;if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(t),r=function(i){try{e.Ca((()=>i.processEvent==null?void 0:i.processEvent(n)))}catch(a){ti.error("Error while processing event "+t.event+" for site app "+i.id,a)}};for(var s of Object.values(this.apps))r(s)}}onRemoteConfig(t){var e,n,r,s=this;if((e=this.siteAppLoaders)!=null&&e.length)return this.isEnabled?(this.Ta(),void this._instance.on("eventCaptured",(u=>this.Ia(u)))):void ti.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this._a)==null||n.call(this),t.ok){var i=t.config;if((r=i.siteApps)!=null&&r.length)if(this.isEnabled){var a=function(){var u,f=c.id,h=c.url;$e["__$$ph_site_app_"+f]=s._instance,(u=$e.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(s._instance,h,(p=>{if(p)return ti.error(oC+f,p)}))};for(var c of i.siteApps)a()}else ti.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},PD={tracingHeaders:class{constructor(t){this.Ma=void 0,this.Ea=void 0,this.Ra=void 0,this.Wo=()=>{var e,n,r=this.Pa();r?(ge(this.Ma)&&(this.Ma=(e=$e.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),ge(this.Ea)&&(this.Ea=(n=$e.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null?void 0:n._patchFetch(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Ko()},this._instance=t}initialize(){this.startIfEnabledOrStop()}er(t){var e,n;(e=$e.__PosthogExtensions__)!=null&&e.tracingHeadersPatchFns?t():(n=$e.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return pD.error("failed to load script",r);t()}))}Oa(){var t,e;return(t=(e=this._instance.config.tracing_headers)!==null&&e!==void 0?e:this._instance.config.addTracingHeaders)!==null&&t!==void 0?t:this._instance.config.__add_tracing_headers}Pa(){var t=this.Oa();return Qe(t)?(Qe(this.Ra)?this.Ra.splice(0,this.Ra.length,...t):this.Ra=[...t],t.length>0?this.Ra:void 0):(Qe(this.Ra)&&this.Ra.splice(0),this.Ra=t||void 0,this.Ra)}Ko(){var t,e;(t=this.Ma)==null||t.call(this),(e=this.Ea)==null||e.call(this),this.Ma=void 0,this.Ea=void 0}startIfEnabledOrStop(){this.Pa()?this.er(this.Wo):this.Ko()}}},TD=ue({surveys:class{get Te(){return this._instance.config}constructor(t){this.Fa=void 0,this._surveyManager=null,this.La=!1,this.$a=[],this.Aa=null,this.Na=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.Te.disable_surveys){if(!t.ok)return yt.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(Je(e))return yt.warn("Flags not loaded yet. Not loading surveys.");var n=Qe(e);this.Fa=n?e.length>0:e,yt.info("flags response received, isSurveysEnabled: "+this.Fa),this.loadIfEnabled()}}reset(){try{var t;(t=this._surveyEventReceiver)==null||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(RP)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach((s=>localStorage.removeItem(s)))}catch{}}loadIfEnabled(){if(!this._surveyManager)if(this.La)yt.info("Already initializing surveys, skipping...");else if(this.Te.disable_surveys)yt.info(aC);else if(this.Te.cookieless_mode&&this._instance.consent.isOptedOut())yt.info("Not loading surveys in cookieless mode without consent.");else{var t=$e==null?void 0:$e.__PosthogExtensions__;if(t){if(!ge(this.Fa)||this.Te.advanced_enable_surveys){var e=this.Fa||this.Te.advanced_enable_surveys;this.La=!0;try{var n=t.generateSurveys;if(n)return void this.Da(n,e);var r=t.loadExternalDependency;if(!r)return void this.qa(k2);r(this._instance,"surveys",(s=>{s||!t.generateSurveys?this.qa("Could not load surveys script",s):this.Da(t.generateSurveys,e)}))}catch(s){throw this.qa("Error initializing surveys",s),s}finally{this.La=!1}}}else yt.error("PostHog Extensions not found.")}}Da(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new _D(this._instance),yt.info("Surveys loaded successfully"),this.ja({isLoaded:!0})}qa(t,e){yt.error(t,e),this.ja({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.$a.push(t),this._surveyManager&&this.ja({isLoaded:!0}),()=>{this.$a=this.$a.filter((e=>e!==t))}}getSurveys(t,e){if(e===void 0&&(e=!1),this.Te.disable_surveys)return yt.info(aC),t([]);var n,r=this._instance.get_property(Sy);if(r&&!e)return t(r,{isLoaded:!0}),void(this.Ha()&&this.getSurveys((()=>{}),!0));typeof Promise<"u"&&this.Aa?this.Aa.then((s=>t(s.surveys,s.context))):(typeof Promise<"u"&&(this.Aa=new Promise((s=>{n=s}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Te.token),method:"GET",timestampMode:"query",timeout:this.Te.surveys_request_timeout_ms,callback:s=>{var i;this.Aa=null;var a=s.statusCode;if(a!==200||!s.json){var c="Surveys API could not be loaded, status: "+a;yt.error(c),this.Na=Date.now();var u={isLoaded:!1,error:c};return t([],u),void(n==null||n({surveys:[],context:u}))}this.Na=null;var f,h=s.json.surveys||[],p=h.filter((_=>(function(x){return!(!x.start_date||x.end_date)})(_)&&(TP(_)||(function(x){var y;return!((y=x.conditions)==null||(y=y.actions)==null||(y=y.values)==null||!y.length)})(_))));p.length>0&&((f=this._surveyEventReceiver)==null||f.register(p)),(i=this._instance.persistence)==null||i.register({[Sy]:h,[um]:Date.now()});var m={isLoaded:!0};t(h,m),n==null||n({surveys:h,context:m})}}))}Ha(){return this.Ba()&&!this.Aa&&!this.Ua()}Ba(){var t=this._instance.get_property(um);return Vn(t)&&Date.now()-t>3e5}Ua(){return Vn(this.Na)&&3e5>Date.now()-this.Na}markSurveyAsSeen(t,e){var n,r={id:t,current_iteration:(n=e==null?void 0:e.iteration)!==null&&n!==void 0?n:null};AP(r);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}ja(t){for(var e of this.$a)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(n){yt.error("Error in survey callback",n)}}getActiveMatchingSurveys(t,e){if(e===void 0&&(e=!1),!Je(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);yt.warn("init was not called")}za(t){var e=null;return this.getSurveys((n=>{var r;e=(r=n.find((s=>s.id===t)))!==null&&r!==void 0?r:null})),e}Va(t){if(Je(this._surveyManager))return{eligible:!1,reason:Jh};var e=typeof t=="string"?this.za(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}Wa(t){if(Je(this._surveyManager))return{eligible:!1,reason:Jh};var e=typeof t=="string"?this.za(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Je(this._surveyManager))return yt.warn("init was not called"),{visible:!1,disabledReason:Jh};var e=this.Wa(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Je(this._surveyManager)?(yt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Jh})):new Promise((n=>{this.getSurveys((r=>{var s,i=(s=r.find((c=>c.id===t)))!==null&&s!==void 0?s:null;if(i){var a=this.Wa(i);n({visible:a.eligible,disabledReason:a.reason})}else n({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,n){var r;if(Je(this._surveyManager))yt.warn("init was not called");else{var s=typeof t=="string"?this.za(t):t;if(s!=null&&s.id)if(sD.includes(s.type)){var i=Se==null?void 0:Se.querySelector(e);if(i)return(r=s.appearance)!=null&&r.surveyPopupDelaySeconds?(yt.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var a,c;yt.info("Rendering survey "+s.id+" with delay of "+((a=s.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(c=this._surveyManager)==null||c.renderSurvey(s,i,n),yt.info("Survey "+s.id+" rendered")}),1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,i,n);yt.warn("Survey element not found")}else yt.warn("Surveys of type "+s.type+" cannot be rendered in the app");else yt.warn("Survey not found")}}displaySurvey(t,e){var n;if(Je(this._surveyManager))yt.warn("init was not called");else{var r=this.za(t);if(r){var s=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=ue({},r,{appearance:ue({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==Ly.Popover&&e.initialResponses&&yt.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){var i=this.Va(r);if(!i.eligible)return void yt.warn("Survey is not eligible to be displayed: ",i.reason)}e.displayType!==Ly.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else yt.warn("Survey not found")}}cancelPendingSurvey(t){Je(this._surveyManager)?yt.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;(t=this._surveyManager)==null||t.handlePageUnload==null||t.handlePageUnload()}}},r0),RD={toolbar:class{constructor(t){this.instance=t}Za(t){$e.ph_toolbar_state=t}Ga(){var t;return(t=$e.ph_toolbar_state)!==null&&t!==void 0?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,n){if(t===void 0&&(t=void 0),e===void 0&&(e=void 0),n===void 0&&(n=void 0),$6(this.instance.config)||!te||!Se)return!1;t=t??te.location,n=n??te.history;try{if(!e){try{te.localStorage.setItem("test","test"),te.localStorage.removeItem("test")}catch{return!1}e=te==null?void 0:te.localStorage}var r,s=xD||ym(t.hash,"__posthog")||ym(t.hash,"state"),i=s?RE((()=>JSON.parse(atob(decodeURIComponent(s)))))||RE((()=>JSON.parse(decodeURIComponent(s)))):null;return i&&i.action==="ph_authorize"?((r=i).source="url",r&&Object.keys(r).length>0&&(i.desiredHash?t.hash=i.desiredHash:n?n.replaceState(n.state,"",t.pathname+t.search):t.hash="")):((r=JSON.parse(e.getItem(lC)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}Qa(t){var e=$e.ph_load_toolbar||$e.ph_load_editor;!Je(e)&&Vs(e)?e(t,this.instance):cC.warn("No toolbar load function found")}loadToolbar(t){var e=!(Se==null||!Se.getElementById(B6));if(!te||e)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=ue({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(te.localStorage.setItem(lC,JSON.stringify(ue({},r,{source:void 0}))),this.Ga()===2)this.Qa(r);else if(this.Ga()===0){var s;this.Za(1),(s=$e.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"toolbar",(i=>{if(i)return cC.error("[Toolbar] Failed to load",i),void this.Za(0);this.Za(2),this.Qa(r)})),zt(te,"turbolinks:load",(()=>{this.Za(0),this.loadToolbar(r)}))}return!0}Ja(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,n){return t===void 0&&(t=void 0),e===void 0&&(e=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(t,e,n)}}},AD=ue({experiments:Kn},r0),ID={conversations:class{constructor(t){this.Ka=void 0,this._conversationsManager=null,this.Ya=!1,this.Xa=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&t.ok){var e=t.config.conversations;Je(e)||($s(e)?this.Ka=e:(this.Ka=e.enabled,this.Xa=e),this.loadIfEnabled())}}reset(){var t;(t=this._conversationsManager)==null||t.reset(),this._conversationsManager=null,this.Ka=void 0,this.Xa=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ya||this._instance.config.disable_conversations||$6(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=$e==null?void 0:$e.__PosthogExtensions__;if(t&&!ge(this.Ka)&&this.Ka)if(this.Xa&&this.Xa.token){this.Ya=!0;try{var e=t.initConversations;if(e)return this.el(e),void(this.Ya=!1);var n=t.loadExternalDependency;if(!n)return void this.tl(k2);n(this._instance,"conversations",(r=>{r||!t.initConversations?this.tl("Could not load conversations script",r):this.el(t.initConversations),this.Ya=!1}))}catch(r){this.tl("Error initializing conversations",r),this.Ya=!1}}else us.error("Conversations enabled but missing token in remote config.")}}el(t){if(this.Xa)try{this._conversationsManager=t(this.Xa,this._instance),us.info("Conversations loaded successfully")}catch(e){this.tl("Error completing conversations initialization",e)}else us.error("Cannot complete initialization: remote config is null")}tl(t,e){us.error(t,e),this._conversationsManager=null,this.Ya=!1}show(){this._conversationsManager?this._conversationsManager.show():us.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Ka===!0&&!ur(this._conversationsManager)}isVisible(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,n){var r=this;return Jt((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,n):(us.warn(Ha),null)}))()}getMessages(t,e){var n=this;return Jt((function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(us.warn(Ha),null)}))()}markAsRead(t){var e=this;return Jt((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(us.warn(Ha),null)}))()}getTickets(t){var e=this;return Jt((function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(us.warn(Ha),null)}))()}requestRestoreLink(t){var e=this;return Jt((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(us.warn(Ha),null)}))()}restoreFromToken(t){var e=this;return Jt((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(us.warn(Ha),null)}))()}restoreFromUrlToken(){var t=this;return Jt((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(us.warn(Ha),null)}))()}getCurrentTicketId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getWidgetSessionId())!==null&&t!==void 0?t:null}En(){var t;(t=this._conversationsManager)==null||t.setIdentity()}Rn(){var t;(t=this._conversationsManager)==null||t.clearIdentity()}}},MD={logs:class{constructor(t){var e;this.rl=!1,this.il=!1,this.Ge=Ft("[logs]"),this.Gr=[],this.nl=[],this.Hs=0,this.sl=()=>{var n,r;this.Hs=0,(n=this.ol)==null||n.onReconnect(),(r=this.al)==null||r.onReconnect()},this._instance=t,this._instance&&(e=this._instance.config.logs)!=null&&e.captureConsoleLogs&&(this.rl=!0),te&&zt(te,"online",this.sl)}ll(t,e,n,r){var s,i=(function(a,c){var u,f,h,p,m,_,x,y=(u=a==null?void 0:a.flushIntervalMs)!==null&&u!==void 0?u:3e3,w=(f=a==null?void 0:a.maxBufferSize)!==null&&f!==void 0?f:100,S=c!=null&&c.consoleCapture?void 0:(h=a==null?void 0:a.maxLogsPerInterval)!==null&&h!==void 0?h:1e3,T=ge(S)?Math.max(w,2048):Math.max(w,S),P=a==null?void 0:a.resourceAttributes;return{serviceName:(p=(m=P==null?void 0:P["service.name"])!==null&&m!==void 0?m:a==null?void 0:a.serviceName)!==null&&p!==void 0?p:c==null?void 0:c.serviceNameDefault,serviceVersion:(_=P==null?void 0:P["service.version"])!==null&&_!==void 0?_:a==null?void 0:a.serviceVersion,environment:(x=P==null?void 0:P["deployment.environment"])!==null&&x!==void 0?x:a==null?void 0:a.environment,resourceAttributes:P,beforeSend:a==null?void 0:a.beforeSend,flushIntervalMs:y,maxBufferSize:w,maxQueueSize:T,maxBatchRecordsPerPost:100,rateCapWindowMs:y,maxLogsPerInterval:S,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}})((s=this._instance)==null||(s=s.config)==null?void 0:s.logs,n);return[new VL(this.ul(t,e),i,this.Ge,(()=>this.hl()),(a=>a()),void 0,r),i]}dl(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.ol||this.cl!==e){var n;(n=this.ol)==null||n.reset(),this.cl=e;var r=this.ll((()=>this.Gr),(s=>{this.Gr=s}));this.ol=r[0],this.vl=r[1]}return this.ol}fl(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.al||this.pl!==e){var n;(n=this.al)==null||n.reset(),this.pl=e;var r=this.ll((()=>this.nl),(s=>{this.nl=s}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},hC);this.al=r[0],this.gl=r[1]}return this.al}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e;if(t.ok){var n=(e=t.config.logs)==null?void 0:e.captureConsoleLogs;!Je(n)&&n&&(this.rl=!0,this.loadIfEnabled())}}reset(){var t,e;this.Gr=[],(t=this.ol)==null||t.reset(),this.nl=[],(e=this.al)==null||e.reset(),this.Hs=0}captureLog(t){this.dl().captureLog(t)}le(t){this.fl().captureLog(t)}get logger(){return this.ml||(this.ml={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.ml}flushLogs(t){t?this.yl(t):(this.ol&&this.ol.flush().catch((e=>this.Ge.error("PostHog logs flush failed:",e))),this.al&&this.al.flush().catch((e=>this.Ge.error("PostHog logs flush failed:",e))))}loadIfEnabled(){if(this.rl&&!this.il){var t=$e==null?void 0:$e.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",(n=>{var r;n||(r=t.logs)==null||!r.initializeLogs?this.Ge.error("Could not load logs script",n):(t.logs.initializeLogs(this._instance),this.il=!0)})):this.Ge.error(k2)}else this.Ge.error("PostHog Extensions not found.")}}ul(t,e){var n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:r=>r===Ki.LogsQueue?t():void 0,setPersistedProperty(r,s){var i;r===Ki.LogsQueue&&e((i=s)!==null&&i!==void 0?i:[])},Tt:r=>this.Tt(r),getLibraryId:()=>mt.LIB_NAME,getLibraryVersion:()=>mt.LIB_VERSION}}Tt(t){return new Promise((e=>{if(sP(this.Hs,3))e({kind:"fatal",error:new Error("logs endpoint is unreachable, dropping batch")});else{var n=!1,r=i=>{n||(n=!0,clearTimeout(s),e(i))},s=setTimeout((()=>r({kind:"retry-later",error:new Error("logs request timed out")})),9e4);this._instance._send_request({method:"POST",url:this.bl(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:i=>{var a=i.statusCode;if(this._l(a),a>=200&&300>a)r({kind:"ok"});else if(a===413)r({kind:"too-large"});else if(a!==0&&a!==429&&500>a)r({kind:"fatal",error:new Error("logs request failed with status "+a)});else{var c;r({kind:"retry-later",error:(c=i.error)!==null&&c!==void 0?c:new Error("logs request failed with status "+a)})}}})}}))}_l(t){(t!==0||this._instance.__loaded)&&(this.Hs=iP(t,this.Hs,3,(()=>this.Ge.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."))))}yl(t){this.Gr.length>0&&this.wl(t,this.Gr,this.vl,mt.LIB_NAME,(e=>{this.Gr=e})),this.nl.length>0&&this.wl(t,this.nl,this.gl,hC,(e=>{this.nl=e}))}wl(t,e,n,r,s){if(e.length!==0){var i=e.map((c=>c.record));s([]);var a=k6(i,C6(n,mt.LIB_NAME,mt.LIB_VERSION),r,mt.LIB_VERSION);this._instance._send_request({method:"POST",url:this.bl(),data:a,compression:"best-available",batchKey:"logs",transport:t})}}bl(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}hl(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var n=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.windowId,s=n.sessionStartTimestamp,i=n.lastActivityTimestamp;e.sessionId=n.sessionId,e.windowId=r,Je(s)||(e.sessionStartTimestamp=s),Je(i)||(e.lastActivityTimestamp=i)}if($e!=null&&(t=$e.location)!=null&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?oa($e.location.href):$e.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(e.activeFeatureFlags=a)}return e}}},OD={metrics:class{constructor(t){this.Ge=Ft("[metrics]"),this._instance=t}initialize(){}dl(){var t,e,n=(t=this._instance)==null||(t=t.config)==null?void 0:t.metrics;return this.ol&&this.cl===n||((e=this.ol)==null||e.reset(),this.cl=n,this.ol=new $L(this.ul(),(function(r){var s,i,a,c,u,f=r==null?void 0:r.resourceAttributes;return{serviceName:(s=f==null?void 0:f["service.name"])!==null&&s!==void 0?s:r==null?void 0:r.serviceName,serviceVersion:(i=f==null?void 0:f["service.version"])!==null&&i!==void 0?i:r==null?void 0:r.serviceVersion,environment:(a=f==null?void 0:f["deployment.environment"])!==null&&a!==void 0?a:r==null?void 0:r.environment,resourceAttributes:f,beforeSend:r==null?void 0:r.beforeSend,flushIntervalMs:(c=r==null?void 0:r.flushIntervalMs)!==null&&c!==void 0?c:1e4,maxSeriesPerFlush:(u=r==null?void 0:r.maxSeriesPerFlush)!==null&&u!==void 0?u:1e3}})(n),this.Ge)),this.ol}count(t,e,n){e===void 0&&(e=1),this.dl().count(t,e,n)}gauge(t,e,n){this.dl().gauge(t,e,n)}histogram(t,e,n){this.dl().histogram(t,e,n)}flush(t){if(!this.ol)return Promise.resolve();if(t){var e=this.ol.drainWindow();return e&&this.Bt(e,t),Promise.resolve()}return this.ol.flush().catch((n=>this.Ge.error("PostHog metrics flush failed:",n)))}reset(){var t;(t=this.ol)==null||t.reset()}ul(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Bt:n=>e.Bt(n),getLibraryId:()=>mt.LIB_NAME,getLibraryVersion:()=>mt.LIB_VERSION}}Bt(t,e){return new Promise((n=>{var r=!1,s=a=>{r||(r=!0,clearTimeout(i),n(a))},i=setTimeout((()=>s({kind:"retry-later",error:new Error("metrics request timed out")})),9e4);this._instance._send_request(ue({method:"POST",url:this.xl(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(a){var c=a.statusCode;if(c>=200&&300>c)s({kind:"ok"});else if(c===413)s({kind:"too-large"});else if(c!==0&&c!==429&&500>c)s({kind:"fatal",error:new Error("metrics request failed with status "+c)});else{var u;s({kind:"retry-later",error:(u=a.error)!==null&&u!==void 0?u:new Error("metrics request failed with status "+c)})}}}))}))}xl(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},LD=ue({},r0,bD,SD,ED,CD,kD,TD,PD,RD,AD,ID,MD,OD);hs.__defaultExtensionClasses=ue({},LD);var be=(function(){mt.SDK_DIST_CHANNEL="npm";var t=Rd[mc]=new hs;return(function(){function e(){e.done||(e.done=!0,MP=!1,xt(Rd,(function(n){n._dom_loaded()})))}Se!=null&&Se.addEventListener?Se.readyState==="complete"?e():zt(Se,"DOMContentLoaded",e,{capture:!1}):te&&_e.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})(),OP;function ND(t){OP=t}function zy(){return OP}var N2=v.createContext({get client(){return zy()},bootstrap:void 0});function LP(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,a=r;i<a.length;i++){var c=a[i];if(!s.includes(c)||!LP(t[c],e[c],n))return!1}return!0}function DD(t){var e,n,r=t.children,s=t.client,i=t.apiKey,a=t.options,c=v.useRef(null),u=v.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`."),a&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),s;var f=zy();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."),f},[s,i,JSON.stringify(a)]);return v.useEffect(function(){if(!(s||!i)){var f=zy(),h=c.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."),a&&!LP(a,h.options)&&f.set_config(a),c.current={apiKey:i,options:a??{}}):(f.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),f.init(i,a),c.current={apiKey:i,options:a??{}})}},[s,i,JSON.stringify(a)]),ve.createElement(N2.Provider,{value:{client:u,bootstrap:(e=a==null?void 0:a.bootstrap)!==null&&e!==void 0?e:(n=s==null?void 0:s.config)===null||n===void 0?void 0:n.bootstrap}},r)}var zv=function(t){return typeof t=="function"},s0=function(){var t=v.useContext(N2).client;return t},Uy=function(t,e){return Uy=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(n[s]=r[s])},Uy(t,e)};function jD(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Uy(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var FD={componentStack:null,exceptionEvent:null,error:null},VD={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},$D=(function(t){jD(e,t);function e(n){var r=t.call(this,n)||this;return r.state=FD,r}return e.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;zv(s)?i=s(n):typeof s=="object"&&(i=s);var a=this.context.client,c=a.captureException(n,i),u=r.componentStack;this.setState({error:n,componentStack:u??null,exceptionEvent:c})},e.prototype.render=function(){var n=this.props,r=n.children,s=n.fallback,i=this.state;if(i.componentStack==null)return zv(r)?r():r;var a=zv(s)?ve.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent}):s;return ve.isValidElement(a)?a:(console.warn(VD.INVALID_FALLBACK),ve.createElement(ve.Fragment,null))},e.contextType=N2,e})(ve.Component);ND(be);var ep={},Uv={exports:{}},xr={},Bv={exports:{}},Wv={};/**
|
|
19
|
+
* @license React
|
|
20
|
+
* scheduler.production.min.js
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/var pC;function HD(){return pC||(pC=1,(function(t){function e($,ne){var z=$.length;$.push(ne);e:for(;0<z;){var D=z-1>>>1,Y=$[D];if(0<s(Y,ne))$[D]=ne,$[z]=Y,z=D;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var ne=$[0],z=$.pop();if(z!==ne){$[0]=z;e:for(var D=0,Y=$.length,ee=Y>>>1;D<ee;){var ie=2*(D+1)-1,oe=$[ie],ce=ie+1,xe=$[ce];if(0>s(oe,z))ce<Y&&0>s(xe,oe)?($[D]=xe,$[ce]=z,D=ce):($[D]=oe,$[ie]=z,D=ie);else if(ce<Y&&0>s(xe,z))$[D]=xe,$[ce]=z,D=ce;else break e}}return ne}function s($,ne){var z=$.sortIndex-ne.sortIndex;return z!==0?z:$.id-ne.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var a=Date,c=a.now();t.unstable_now=function(){return a.now()-c}}var u=[],f=[],h=1,p=null,m=3,_=!1,x=!1,y=!1,w=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P($){for(var ne=n(f);ne!==null;){if(ne.callback===null)r(f);else if(ne.startTime<=$)r(f),ne.sortIndex=ne.expirationTime,e(u,ne);else break;ne=n(f)}}function k($){if(y=!1,P($),!x)if(n(u)!==null)x=!0,G(R);else{var ne=n(f);ne!==null&&q(k,ne.startTime-$)}}function R($,ne){x=!1,y&&(y=!1,S(A),A=-1),_=!0;var z=m;try{for(P(ne),p=n(u);p!==null&&(!(p.expirationTime>ne)||$&&!j());){var D=p.callback;if(typeof D=="function"){p.callback=null,m=p.priorityLevel;var Y=D(p.expirationTime<=ne);ne=t.unstable_now(),typeof Y=="function"?p.callback=Y:p===n(u)&&r(u),P(ne)}else r(u);p=n(u)}if(p!==null)var ee=!0;else{var ie=n(f);ie!==null&&q(k,ie.startTime-ne),ee=!1}return ee}finally{p=null,m=z,_=!1}}var L=!1,O=null,A=-1,I=5,N=-1;function j(){return!(t.unstable_now()-N<I)}function F(){if(O!==null){var $=t.unstable_now();N=$;var ne=!0;try{ne=O(!0,$)}finally{ne?K():(L=!1,O=null)}}else L=!1}var K;if(typeof T=="function")K=function(){T(F)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,W=X.port2;X.port1.onmessage=F,K=function(){W.postMessage(null)}}else K=function(){w(F,0)};function G($){O=$,L||(L=!0,K())}function q($,ne){A=w(function(){$(t.unstable_now())},ne)}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($){$.callback=null},t.unstable_continueExecution=function(){x||_||(x=!0,G(R))},t.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<$?Math.floor(1e3/$):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_getFirstCallbackNode=function(){return n(u)},t.unstable_next=function($){switch(m){case 1:case 2:case 3:var ne=3;break;default:ne=m}var z=m;m=ne;try{return $()}finally{m=z}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function($,ne){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var z=m;m=$;try{return ne()}finally{m=z}},t.unstable_scheduleCallback=function($,ne,z){var D=t.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?D+z:D):z=D,$){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=z+Y,$={id:h++,callback:ne,priorityLevel:$,startTime:z,expirationTime:Y,sortIndex:-1},z>D?($.sortIndex=z,e(f,$),n(u)===null&&$===n(f)&&(y?(S(A),A=-1):y=!0,q(k,z-D))):($.sortIndex=Y,e(u,$),x||_||(x=!0,G(R))),$},t.unstable_shouldYield=j,t.unstable_wrapCallback=function($){var ne=m;return function(){var z=m;m=ne;try{return $.apply(this,arguments)}finally{m=z}}}})(Wv)),Wv}var mC;function zD(){return mC||(mC=1,Bv.exports=HD()),Bv.exports}/**
|
|
27
|
+
* @license React
|
|
28
|
+
* react-dom.production.min.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/var gC;function UD(){if(gC)return xr;gC=1;var t=f2(),e=zD();function n(o){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+o,d=1;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+o+"; visit "+l+" 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(o,l){a(o,l),a(o+"Capture",l)}function a(o,l){for(s[o]=l,o=0;o<l.length;o++)r.add(l[o])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,f=/^[: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(o){return u.call(p,o)?!0:u.call(h,o)?!1:f.test(o)?p[o]=!0:(h[o]=!0,!1)}function _(o,l,d,g){if(d!==null&&d.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return g?!1:d!==null?!d.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function x(o,l,d,g){if(l===null||typeof l>"u"||_(o,l,d,g))return!0;if(g)return!1;if(d!==null)switch(d.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function y(o,l,d,g,b,C,M){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=g,this.attributeNamespace=b,this.mustUseProperty=d,this.propertyName=o,this.type=l,this.sanitizeURL=C,this.removeEmptyString=M}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){w[o]=new y(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var l=o[0];w[l]=new y(l,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){w[o]=new y(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){w[o]=new y(o,2,!1,o,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(o){w[o]=new y(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){w[o]=new y(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){w[o]=new y(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){w[o]=new y(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){w[o]=new y(o,5,!1,o.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function T(o){return o[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(o){var l=o.replace(S,T);w[l]=new y(l,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var l=o.replace(S,T);w[l]=new y(l,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var l=o.replace(S,T);w[l]=new y(l,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){w[o]=new y(o,1,!1,o.toLowerCase(),null,!1,!1)}),w.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){w[o]=new y(o,1,!1,o.toLowerCase(),null,!0,!0)});function P(o,l,d,g){var b=w.hasOwnProperty(l)?w[l]:null;(b!==null?b.type!==0:g||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(x(l,d,b,g)&&(d=null),g||b===null?m(l)&&(d===null?o.removeAttribute(l):o.setAttribute(l,""+d)):b.mustUseProperty?o[b.propertyName]=d===null?b.type===3?!1:"":d:(l=b.attributeName,g=b.attributeNamespace,d===null?o.removeAttribute(l):(b=b.type,d=b===3||b===4&&d===!0?"":""+d,g?o.setAttributeNS(g,l,d):o.setAttribute(l,d))))}var k=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,R=Symbol.for("react.element"),L=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),N=Symbol.for("react.provider"),j=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),q=Symbol.for("react.offscreen"),$=Symbol.iterator;function ne(o){return o===null||typeof o!="object"?null:(o=$&&o[$]||o["@@iterator"],typeof o=="function"?o:null)}var z=Object.assign,D;function Y(o){if(D===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);D=l&&l[1]||""}return`
|
|
35
|
+
`+D+o}var ee=!1;function ie(o,l){if(!o||ee)return"";ee=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(re){var g=re}Reflect.construct(o,[],l)}else{try{l.call()}catch(re){g=re}o.call(l.prototype)}else{try{throw Error()}catch(re){g=re}o()}}catch(re){if(re&&g&&typeof re.stack=="string"){for(var b=re.stack.split(`
|
|
36
|
+
`),C=g.stack.split(`
|
|
37
|
+
`),M=b.length-1,V=C.length-1;1<=M&&0<=V&&b[M]!==C[V];)V--;for(;1<=M&&0<=V;M--,V--)if(b[M]!==C[V]){if(M!==1||V!==1)do if(M--,V--,0>V||b[M]!==C[V]){var B=`
|
|
38
|
+
`+b[M].replace(" at new "," at ");return o.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",o.displayName)),B}while(1<=M&&0<=V);break}}}finally{ee=!1,Error.prepareStackTrace=d}return(o=o?o.displayName||o.name:"")?Y(o):""}function oe(o){switch(o.tag){case 5:return Y(o.type);case 16:return Y("Lazy");case 13:return Y("Suspense");case 19:return Y("SuspenseList");case 0:case 2:case 15:return o=ie(o.type,!1),o;case 11:return o=ie(o.type.render,!1),o;case 1:return o=ie(o.type,!0),o;default:return""}}function ce(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case O:return"Fragment";case L:return"Portal";case I:return"Profiler";case A:return"StrictMode";case K:return"Suspense";case X:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case j:return(o.displayName||"Context")+".Consumer";case N:return(o._context.displayName||"Context")+".Provider";case F:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case W:return l=o.displayName||null,l!==null?l:ce(o.type)||"Memo";case G:l=o._payload,o=o._init;try{return ce(o(l))}catch{}}return null}function xe(o){var l=o.type;switch(o.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=l.render,o=o.displayName||o.name||"",l.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ce(l);case 8:return l===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 l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function ae(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function se(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Ve(o){var l=se(o)?"checked":"value",d=Object.getOwnPropertyDescriptor(o.constructor.prototype,l),g=""+o[l];if(!o.hasOwnProperty(l)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var b=d.get,C=d.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return b.call(this)},set:function(M){g=""+M,C.call(this,M)}}),Object.defineProperty(o,l,{enumerable:d.enumerable}),{getValue:function(){return g},setValue:function(M){g=""+M},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function De(o){o._valueTracker||(o._valueTracker=Ve(o))}function Re(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var d=l.getValue(),g="";return o&&(g=se(o)?o.checked?"true":"false":o.value),o=g,o!==d?(l.setValue(o),!0):!1}function Ye(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function ut(o,l){var d=l.checked;return z({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:d??o._wrapperState.initialChecked})}function kt(o,l){var d=l.defaultValue==null?"":l.defaultValue,g=l.checked!=null?l.checked:l.defaultChecked;d=ae(l.value!=null?l.value:d),o._wrapperState={initialChecked:g,initialValue:d,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function we(o,l){l=l.checked,l!=null&&P(o,"checked",l,!1)}function je(o,l){we(o,l);var d=ae(l.value),g=l.type;if(d!=null)g==="number"?(d===0&&o.value===""||o.value!=d)&&(o.value=""+d):o.value!==""+d&&(o.value=""+d);else if(g==="submit"||g==="reset"){o.removeAttribute("value");return}l.hasOwnProperty("value")?it(o,l.type,d):l.hasOwnProperty("defaultValue")&&it(o,l.type,ae(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(o.defaultChecked=!!l.defaultChecked)}function ze(o,l,d){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var g=l.type;if(!(g!=="submit"&&g!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+o._wrapperState.initialValue,d||l===o.value||(o.value=l),o.defaultValue=l}d=o.name,d!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,d!==""&&(o.name=d)}function it(o,l,d){(l!=="number"||Ye(o.ownerDocument)!==o)&&(d==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+d&&(o.defaultValue=""+d))}var Pt=Array.isArray;function tt(o,l,d,g){if(o=o.options,l){l={};for(var b=0;b<d.length;b++)l["$"+d[b]]=!0;for(d=0;d<o.length;d++)b=l.hasOwnProperty("$"+o[d].value),o[d].selected!==b&&(o[d].selected=b),b&&g&&(o[d].defaultSelected=!0)}else{for(d=""+ae(d),l=null,b=0;b<o.length;b++){if(o[b].value===d){o[b].selected=!0,g&&(o[b].defaultSelected=!0);return}l!==null||o[b].disabled||(l=o[b])}l!==null&&(l.selected=!0)}}function Xe(o,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return z({},l,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function At(o,l){var d=l.value;if(d==null){if(d=l.children,l=l.defaultValue,d!=null){if(l!=null)throw Error(n(92));if(Pt(d)){if(1<d.length)throw Error(n(93));d=d[0]}l=d}l==null&&(l=""),d=l}o._wrapperState={initialValue:ae(d)}}function Qn(o,l){var d=ae(l.value),g=ae(l.defaultValue);d!=null&&(d=""+d,d!==o.value&&(o.value=d),l.defaultValue==null&&o.defaultValue!==d&&(o.defaultValue=d)),g!=null&&(o.defaultValue=""+g)}function An(o){var l=o.textContent;l===o._wrapperState.initialValue&&l!==""&&l!==null&&(o.value=l)}function ws(o){switch(o){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 Lr(o,l){return o==null||o==="http://www.w3.org/1999/xhtml"?ws(l):o==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var Nr,Jn=(function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,d,g,b){MSApp.execUnsafeLocalFunction(function(){return o(l,d,g,b)})}:o})(function(o,l){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=l;else{for(Nr=Nr||document.createElement("div"),Nr.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=Nr.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;l.firstChild;)o.appendChild(l.firstChild)}});function wn(o,l){if(l){var d=o.firstChild;if(d&&d===o.lastChild&&d.nodeType===3){d.nodeValue=l;return}}o.textContent=l}var Bs={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},Ws=["Webkit","ms","Moz","O"];Object.keys(Bs).forEach(function(o){Ws.forEach(function(l){l=l+o.charAt(0).toUpperCase()+o.substring(1),Bs[l]=Bs[o]})});function In(o,l,d){return l==null||typeof l=="boolean"||l===""?"":d||typeof l!="number"||l===0||Bs.hasOwnProperty(o)&&Bs[o]?(""+l).trim():l+"px"}function Si(o,l){o=o.style;for(var d in l)if(l.hasOwnProperty(d)){var g=d.indexOf("--")===0,b=In(d,l[d],g);d==="float"&&(d="cssFloat"),g?o.setProperty(d,b):o[d]=b}}var Ei=z({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 bs(o,l){if(l){if(Ei[o]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(n(137,o));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(n(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(n(61))}if(l.style!=null&&typeof l.style!="object")throw Error(n(62))}}function Gs(o,l){if(o.indexOf("-")===-1)return typeof l.is=="string";switch(o){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 fr=null;function er(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Ks=null,Ss=null,Dr=null;function Ci(o){if(o=ju(o)){if(typeof Ks!="function")throw Error(n(280));var l=o.stateNode;l&&(l=rh(l),Ks(o.stateNode,o.type,l))}}function Ke(o){Ss?Dr?Dr.push(o):Dr=[o]:Ss=o}function It(){if(Ss){var o=Ss,l=Dr;if(Dr=Ss=null,Ci(o),l)for(o=0;o<l.length;o++)Ci(l[o])}}function tn(o,l){return o(l)}function nn(){}var Zs=!1;function qt(o,l,d){if(Zs)return o(l,d);Zs=!0;try{return tn(o,l,d)}finally{Zs=!1,(Ss!==null||Dr!==null)&&(nn(),It())}}function cn(o,l){var d=o.stateNode;if(d===null)return null;var g=rh(d);if(g===null)return null;d=g[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(o=o.type,g=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!g;break e;default:o=!1}if(o)return null;if(d&&typeof d!="function")throw Error(n(231,l,typeof d));return d}var Es=!1;if(c)try{var un={};Object.defineProperty(un,"passive",{get:function(){Es=!0}}),window.addEventListener("test",un,un),window.removeEventListener("test",un,un)}catch{Es=!1}function zn(o,l,d,g,b,C,M,V,B){var re=Array.prototype.slice.call(arguments,3);try{l.apply(d,re)}catch(fe){this.onError(fe)}}var qs=!1,hr=null,Sa=!1,Il=null,M0={onError:function(o){qs=!0,hr=o}};function O0(o,l,d,g,b,C,M,V,B){qs=!1,hr=null,zn.apply(M0,arguments)}function pu(o,l,d,g,b,C,M,V,B){if(O0.apply(this,arguments),qs){if(qs){var re=hr;qs=!1,hr=null}else throw Error(n(198));Sa||(Sa=!0,Il=re)}}function ki(o){var l=o,d=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,(l.flags&4098)!==0&&(d=l.return),o=l.return;while(o)}return l.tag===3?d:null}function Ff(o){if(o.tag===13){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function Vf(o){if(ki(o)!==o)throw Error(n(188))}function L0(o){var l=o.alternate;if(!l){if(l=ki(o),l===null)throw Error(n(188));return l!==o?null:o}for(var d=o,g=l;;){var b=d.return;if(b===null)break;var C=b.alternate;if(C===null){if(g=b.return,g!==null){d=g;continue}break}if(b.child===C.child){for(C=b.child;C;){if(C===d)return Vf(b),o;if(C===g)return Vf(b),l;C=C.sibling}throw Error(n(188))}if(d.return!==g.return)d=b,g=C;else{for(var M=!1,V=b.child;V;){if(V===d){M=!0,d=b,g=C;break}if(V===g){M=!0,g=b,d=C;break}V=V.sibling}if(!M){for(V=C.child;V;){if(V===d){M=!0,d=C,g=b;break}if(V===g){M=!0,g=C,d=b;break}V=V.sibling}if(!M)throw Error(n(189))}}if(d.alternate!==g)throw Error(n(190))}if(d.tag!==3)throw Error(n(188));return d.stateNode.current===d?o:l}function Ml(o){return o=L0(o),o!==null?Ol(o):null}function Ol(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var l=Ol(o);if(l!==null)return l;o=o.sibling}return null}var mu=e.unstable_scheduleCallback,$f=e.unstable_cancelCallback,Pw=e.unstable_shouldYield,yo=e.unstable_requestPaint,Vt=e.unstable_now,gu=e.unstable_getCurrentPriorityLevel,vu=e.unstable_ImmediatePriority,yu=e.unstable_UserBlockingPriority,Pi=e.unstable_NormalPriority,_u=e.unstable_LowPriority,xu=e.unstable_IdlePriority,Ea=null,jr=null;function Hf(o){if(jr&&typeof jr.onCommitFiberRoot=="function")try{jr.onCommitFiberRoot(Ea,o,void 0,(o.current.flags&128)===128)}catch{}}var H=Math.clz32?Math.clz32:me,le=Math.log,Pe=Math.LN2;function me(o){return o>>>=0,o===0?32:31-(le(o)/Pe|0)|0}var he=64,Ce=4194304;function We(o){switch(o&-o){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 o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function Ee(o,l){var d=o.pendingLanes;if(d===0)return 0;var g=0,b=o.suspendedLanes,C=o.pingedLanes,M=d&268435455;if(M!==0){var V=M&~b;V!==0?g=We(V):(C&=M,C!==0&&(g=We(C)))}else M=d&~b,M!==0?g=We(M):C!==0&&(g=We(C));if(g===0)return 0;if(l!==0&&l!==g&&(l&b)===0&&(b=g&-g,C=l&-l,b>=C||b===16&&(C&4194240)!==0))return l;if((g&4)!==0&&(g|=d&16),l=o.entangledLanes,l!==0)for(o=o.entanglements,l&=g;0<l;)d=31-H(l),b=1<<d,g|=o[d],l&=~b;return g}function tr(o,l){switch(o){case 1:case 2:case 4:return l+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 l+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 pr(o,l){for(var d=o.suspendedLanes,g=o.pingedLanes,b=o.expirationTimes,C=o.pendingLanes;0<C;){var M=31-H(C),V=1<<M,B=b[M];B===-1?((V&d)===0||(V&g)!==0)&&(b[M]=tr(V,l)):B<=l&&(o.expiredLanes|=V),C&=~V}}function ns(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function Cs(){var o=he;return he<<=1,(he&4194240)===0&&(he=64),o}function rs(o){for(var l=[],d=0;31>d;d++)l.push(o);return l}function rn(o,l,d){o.pendingLanes|=l,l!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,l=31-H(l),o[l]=d}function Ys(o,l){var d=o.pendingLanes&~l;o.pendingLanes=l,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=l,o.mutableReadLanes&=l,o.entangledLanes&=l,l=o.entanglements;var g=o.eventTimes;for(o=o.expirationTimes;0<d;){var b=31-H(d),C=1<<b;l[b]=0,g[b]=-1,o[b]=-1,d&=~C}}function ks(o,l){var d=o.entangledLanes|=l;for(o=o.entanglements;d;){var g=31-H(d),b=1<<g;b&l|o[g]&l&&(o[g]|=l),d&=~b}}var vt=0;function Tw(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var Rw,N0,Aw,Iw,Mw,D0=!1,zf=[],_o=null,xo=null,wo=null,wu=new Map,bu=new Map,bo=[],GI="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 Ow(o,l){switch(o){case"focusin":case"focusout":_o=null;break;case"dragenter":case"dragleave":xo=null;break;case"mouseover":case"mouseout":wo=null;break;case"pointerover":case"pointerout":wu.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":bu.delete(l.pointerId)}}function Su(o,l,d,g,b,C){return o===null||o.nativeEvent!==C?(o={blockedOn:l,domEventName:d,eventSystemFlags:g,nativeEvent:C,targetContainers:[b]},l!==null&&(l=ju(l),l!==null&&N0(l)),o):(o.eventSystemFlags|=g,l=o.targetContainers,b!==null&&l.indexOf(b)===-1&&l.push(b),o)}function KI(o,l,d,g,b){switch(l){case"focusin":return _o=Su(_o,o,l,d,g,b),!0;case"dragenter":return xo=Su(xo,o,l,d,g,b),!0;case"mouseover":return wo=Su(wo,o,l,d,g,b),!0;case"pointerover":var C=b.pointerId;return wu.set(C,Su(wu.get(C)||null,o,l,d,g,b)),!0;case"gotpointercapture":return C=b.pointerId,bu.set(C,Su(bu.get(C)||null,o,l,d,g,b)),!0}return!1}function Lw(o){var l=Ca(o.target);if(l!==null){var d=ki(l);if(d!==null){if(l=d.tag,l===13){if(l=Ff(d),l!==null){o.blockedOn=l,Mw(o.priority,function(){Aw(d)});return}}else if(l===3&&d.stateNode.current.memoizedState.isDehydrated){o.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Uf(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var d=F0(o.domEventName,o.eventSystemFlags,l[0],o.nativeEvent);if(d===null){d=o.nativeEvent;var g=new d.constructor(d.type,d);fr=g,d.target.dispatchEvent(g),fr=null}else return l=ju(d),l!==null&&N0(l),o.blockedOn=d,!1;l.shift()}return!0}function Nw(o,l,d){Uf(o)&&d.delete(l)}function ZI(){D0=!1,_o!==null&&Uf(_o)&&(_o=null),xo!==null&&Uf(xo)&&(xo=null),wo!==null&&Uf(wo)&&(wo=null),wu.forEach(Nw),bu.forEach(Nw)}function Eu(o,l){o.blockedOn===l&&(o.blockedOn=null,D0||(D0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,ZI)))}function Cu(o){function l(b){return Eu(b,o)}if(0<zf.length){Eu(zf[0],o);for(var d=1;d<zf.length;d++){var g=zf[d];g.blockedOn===o&&(g.blockedOn=null)}}for(_o!==null&&Eu(_o,o),xo!==null&&Eu(xo,o),wo!==null&&Eu(wo,o),wu.forEach(l),bu.forEach(l),d=0;d<bo.length;d++)g=bo[d],g.blockedOn===o&&(g.blockedOn=null);for(;0<bo.length&&(d=bo[0],d.blockedOn===null);)Lw(d),d.blockedOn===null&&bo.shift()}var Ll=k.ReactCurrentBatchConfig,Bf=!0;function qI(o,l,d,g){var b=vt,C=Ll.transition;Ll.transition=null;try{vt=1,j0(o,l,d,g)}finally{vt=b,Ll.transition=C}}function YI(o,l,d,g){var b=vt,C=Ll.transition;Ll.transition=null;try{vt=4,j0(o,l,d,g)}finally{vt=b,Ll.transition=C}}function j0(o,l,d,g){if(Bf){var b=F0(o,l,d,g);if(b===null)tg(o,l,g,Wf,d),Ow(o,g);else if(KI(b,o,l,d,g))g.stopPropagation();else if(Ow(o,g),l&4&&-1<GI.indexOf(o)){for(;b!==null;){var C=ju(b);if(C!==null&&Rw(C),C=F0(o,l,d,g),C===null&&tg(o,l,g,Wf,d),C===b)break;b=C}b!==null&&g.stopPropagation()}else tg(o,l,g,null,d)}}var Wf=null;function F0(o,l,d,g){if(Wf=null,o=er(g),o=Ca(o),o!==null)if(l=ki(o),l===null)o=null;else if(d=l.tag,d===13){if(o=Ff(l),o!==null)return o;o=null}else if(d===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null);return Wf=o,null}function Dw(o){switch(o){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(gu()){case vu:return 1;case yu:return 4;case Pi:case _u:return 16;case xu:return 536870912;default:return 16}default:return 16}}var So=null,V0=null,Gf=null;function jw(){if(Gf)return Gf;var o,l=V0,d=l.length,g,b="value"in So?So.value:So.textContent,C=b.length;for(o=0;o<d&&l[o]===b[o];o++);var M=d-o;for(g=1;g<=M&&l[d-g]===b[C-g];g++);return Gf=b.slice(o,1<g?1-g:void 0)}function Kf(o){var l=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&l===13&&(o=13)):o=l,o===10&&(o=13),32<=o||o===13?o:0}function Zf(){return!0}function Fw(){return!1}function Fr(o){function l(d,g,b,C,M){this._reactName=d,this._targetInst=b,this.type=g,this.nativeEvent=C,this.target=M,this.currentTarget=null;for(var V in o)o.hasOwnProperty(V)&&(d=o[V],this[V]=d?d(C):C[V]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?Zf:Fw,this.isPropagationStopped=Fw,this}return z(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=Zf)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Zf)},persist:function(){},isPersistent:Zf}),l}var Nl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$0=Fr(Nl),ku=z({},Nl,{view:0,detail:0}),XI=Fr(ku),H0,z0,Pu,qf=z({},ku,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:B0,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==Pu&&(Pu&&o.type==="mousemove"?(H0=o.screenX-Pu.screenX,z0=o.screenY-Pu.screenY):z0=H0=0,Pu=o),H0)},movementY:function(o){return"movementY"in o?o.movementY:z0}}),Vw=Fr(qf),QI=z({},qf,{dataTransfer:0}),JI=Fr(QI),eM=z({},ku,{relatedTarget:0}),U0=Fr(eM),tM=z({},Nl,{animationName:0,elapsedTime:0,pseudoElement:0}),nM=Fr(tM),rM=z({},Nl,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),sM=Fr(rM),iM=z({},Nl,{data:0}),$w=Fr(iM),oM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},aM={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"},lM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function cM(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=lM[o])?!!l[o]:!1}function B0(){return cM}var uM=z({},ku,{key:function(o){if(o.key){var l=oM[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=Kf(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?aM[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:B0,charCode:function(o){return o.type==="keypress"?Kf(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Kf(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),dM=Fr(uM),fM=z({},qf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Hw=Fr(fM),hM=z({},ku,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:B0}),pM=Fr(hM),mM=z({},Nl,{propertyName:0,elapsedTime:0,pseudoElement:0}),gM=Fr(mM),vM=z({},qf,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),yM=Fr(vM),_M=[9,13,27,32],W0=c&&"CompositionEvent"in window,Tu=null;c&&"documentMode"in document&&(Tu=document.documentMode);var xM=c&&"TextEvent"in window&&!Tu,zw=c&&(!W0||Tu&&8<Tu&&11>=Tu),Uw=" ",Bw=!1;function Ww(o,l){switch(o){case"keyup":return _M.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gw(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Dl=!1;function wM(o,l){switch(o){case"compositionend":return Gw(l);case"keypress":return l.which!==32?null:(Bw=!0,Uw);case"textInput":return o=l.data,o===Uw&&Bw?null:o;default:return null}}function bM(o,l){if(Dl)return o==="compositionend"||!W0&&Ww(o,l)?(o=jw(),Gf=V0=So=null,Dl=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return zw&&l.locale!=="ko"?null:l.data;default:return null}}var SM={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 Kw(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!SM[o.type]:l==="textarea"}function Zw(o,l,d,g){Ke(g),l=eh(l,"onChange"),0<l.length&&(d=new $0("onChange","change",null,d,g),o.push({event:d,listeners:l}))}var Ru=null,Au=null;function EM(o){fb(o,0)}function Yf(o){var l=Hl(o);if(Re(l))return o}function CM(o,l){if(o==="change")return l}var qw=!1;if(c){var G0;if(c){var K0="oninput"in document;if(!K0){var Yw=document.createElement("div");Yw.setAttribute("oninput","return;"),K0=typeof Yw.oninput=="function"}G0=K0}else G0=!1;qw=G0&&(!document.documentMode||9<document.documentMode)}function Xw(){Ru&&(Ru.detachEvent("onpropertychange",Qw),Au=Ru=null)}function Qw(o){if(o.propertyName==="value"&&Yf(Au)){var l=[];Zw(l,Au,o,er(o)),qt(EM,l)}}function kM(o,l,d){o==="focusin"?(Xw(),Ru=l,Au=d,Ru.attachEvent("onpropertychange",Qw)):o==="focusout"&&Xw()}function PM(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Yf(Au)}function TM(o,l){if(o==="click")return Yf(l)}function RM(o,l){if(o==="input"||o==="change")return Yf(l)}function AM(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var Ps=typeof Object.is=="function"?Object.is:AM;function Iu(o,l){if(Ps(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var d=Object.keys(o),g=Object.keys(l);if(d.length!==g.length)return!1;for(g=0;g<d.length;g++){var b=d[g];if(!u.call(l,b)||!Ps(o[b],l[b]))return!1}return!0}function Jw(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function eb(o,l){var d=Jw(o);o=0;for(var g;d;){if(d.nodeType===3){if(g=o+d.textContent.length,o<=l&&g>=l)return{node:d,offset:l-o};o=g}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=Jw(d)}}function tb(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?tb(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function nb(){for(var o=window,l=Ye();l instanceof o.HTMLIFrameElement;){try{var d=typeof l.contentWindow.location.href=="string"}catch{d=!1}if(d)o=l.contentWindow;else break;l=Ye(o.document)}return l}function Z0(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}function IM(o){var l=nb(),d=o.focusedElem,g=o.selectionRange;if(l!==d&&d&&d.ownerDocument&&tb(d.ownerDocument.documentElement,d)){if(g!==null&&Z0(d)){if(l=g.start,o=g.end,o===void 0&&(o=l),"selectionStart"in d)d.selectionStart=l,d.selectionEnd=Math.min(o,d.value.length);else if(o=(l=d.ownerDocument||document)&&l.defaultView||window,o.getSelection){o=o.getSelection();var b=d.textContent.length,C=Math.min(g.start,b);g=g.end===void 0?C:Math.min(g.end,b),!o.extend&&C>g&&(b=g,g=C,C=b),b=eb(d,C);var M=eb(d,g);b&&M&&(o.rangeCount!==1||o.anchorNode!==b.node||o.anchorOffset!==b.offset||o.focusNode!==M.node||o.focusOffset!==M.offset)&&(l=l.createRange(),l.setStart(b.node,b.offset),o.removeAllRanges(),C>g?(o.addRange(l),o.extend(M.node,M.offset)):(l.setEnd(M.node,M.offset),o.addRange(l)))}}for(l=[],o=d;o=o.parentNode;)o.nodeType===1&&l.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d<l.length;d++)o=l[d],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var MM=c&&"documentMode"in document&&11>=document.documentMode,jl=null,q0=null,Mu=null,Y0=!1;function rb(o,l,d){var g=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;Y0||jl==null||jl!==Ye(g)||(g=jl,"selectionStart"in g&&Z0(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Mu&&Iu(Mu,g)||(Mu=g,g=eh(q0,"onSelect"),0<g.length&&(l=new $0("onSelect","select",null,l,d),o.push({event:l,listeners:g}),l.target=jl)))}function Xf(o,l){var d={};return d[o.toLowerCase()]=l.toLowerCase(),d["Webkit"+o]="webkit"+l,d["Moz"+o]="moz"+l,d}var Fl={animationend:Xf("Animation","AnimationEnd"),animationiteration:Xf("Animation","AnimationIteration"),animationstart:Xf("Animation","AnimationStart"),transitionend:Xf("Transition","TransitionEnd")},X0={},sb={};c&&(sb=document.createElement("div").style,"AnimationEvent"in window||(delete Fl.animationend.animation,delete Fl.animationiteration.animation,delete Fl.animationstart.animation),"TransitionEvent"in window||delete Fl.transitionend.transition);function Qf(o){if(X0[o])return X0[o];if(!Fl[o])return o;var l=Fl[o],d;for(d in l)if(l.hasOwnProperty(d)&&d in sb)return X0[o]=l[d];return o}var ib=Qf("animationend"),ob=Qf("animationiteration"),ab=Qf("animationstart"),lb=Qf("transitionend"),cb=new Map,ub="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 Eo(o,l){cb.set(o,l),i(l,[o])}for(var Q0=0;Q0<ub.length;Q0++){var J0=ub[Q0],OM=J0.toLowerCase(),LM=J0[0].toUpperCase()+J0.slice(1);Eo(OM,"on"+LM)}Eo(ib,"onAnimationEnd"),Eo(ob,"onAnimationIteration"),Eo(ab,"onAnimationStart"),Eo("dblclick","onDoubleClick"),Eo("focusin","onFocus"),Eo("focusout","onBlur"),Eo(lb,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("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 Ou="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(" "),NM=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ou));function db(o,l,d){var g=o.type||"unknown-event";o.currentTarget=d,pu(g,l,void 0,o),o.currentTarget=null}function fb(o,l){l=(l&4)!==0;for(var d=0;d<o.length;d++){var g=o[d],b=g.event;g=g.listeners;e:{var C=void 0;if(l)for(var M=g.length-1;0<=M;M--){var V=g[M],B=V.instance,re=V.currentTarget;if(V=V.listener,B!==C&&b.isPropagationStopped())break e;db(b,V,re),C=B}else for(M=0;M<g.length;M++){if(V=g[M],B=V.instance,re=V.currentTarget,V=V.listener,B!==C&&b.isPropagationStopped())break e;db(b,V,re),C=B}}}if(Sa)throw o=Il,Sa=!1,Il=null,o}function Mt(o,l){var d=l[ag];d===void 0&&(d=l[ag]=new Set);var g=o+"__bubble";d.has(g)||(hb(l,o,2,!1),d.add(g))}function eg(o,l,d){var g=0;l&&(g|=4),hb(d,o,g,l)}var Jf="_reactListening"+Math.random().toString(36).slice(2);function Lu(o){if(!o[Jf]){o[Jf]=!0,r.forEach(function(d){d!=="selectionchange"&&(NM.has(d)||eg(d,!1,o),eg(d,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[Jf]||(l[Jf]=!0,eg("selectionchange",!1,l))}}function hb(o,l,d,g){switch(Dw(l)){case 1:var b=qI;break;case 4:b=YI;break;default:b=j0}d=b.bind(null,l,d,o),b=void 0,!Es||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(b=!0),g?b!==void 0?o.addEventListener(l,d,{capture:!0,passive:b}):o.addEventListener(l,d,!0):b!==void 0?o.addEventListener(l,d,{passive:b}):o.addEventListener(l,d,!1)}function tg(o,l,d,g,b){var C=g;if((l&1)===0&&(l&2)===0&&g!==null)e:for(;;){if(g===null)return;var M=g.tag;if(M===3||M===4){var V=g.stateNode.containerInfo;if(V===b||V.nodeType===8&&V.parentNode===b)break;if(M===4)for(M=g.return;M!==null;){var B=M.tag;if((B===3||B===4)&&(B=M.stateNode.containerInfo,B===b||B.nodeType===8&&B.parentNode===b))return;M=M.return}for(;V!==null;){if(M=Ca(V),M===null)return;if(B=M.tag,B===5||B===6){g=C=M;continue e}V=V.parentNode}}g=g.return}qt(function(){var re=C,fe=er(d),pe=[];e:{var de=cb.get(o);if(de!==void 0){var Te=$0,Oe=o;switch(o){case"keypress":if(Kf(d)===0)break e;case"keydown":case"keyup":Te=dM;break;case"focusin":Oe="focus",Te=U0;break;case"focusout":Oe="blur",Te=U0;break;case"beforeblur":case"afterblur":Te=U0;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Te=Vw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Te=JI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Te=pM;break;case ib:case ob:case ab:Te=nM;break;case lb:Te=gM;break;case"scroll":Te=XI;break;case"wheel":Te=yM;break;case"copy":case"cut":case"paste":Te=sM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Te=Hw}var Ne=(l&4)!==0,sn=!Ne&&o==="scroll",Q=Ne?de!==null?de+"Capture":null:de;Ne=[];for(var Z=re,J;Z!==null;){J=Z;var ye=J.stateNode;if(J.tag===5&&ye!==null&&(J=ye,Q!==null&&(ye=cn(Z,Q),ye!=null&&Ne.push(Nu(Z,ye,J)))),sn)break;Z=Z.return}0<Ne.length&&(de=new Te(de,Oe,null,d,fe),pe.push({event:de,listeners:Ne}))}}if((l&7)===0){e:{if(de=o==="mouseover"||o==="pointerover",Te=o==="mouseout"||o==="pointerout",de&&d!==fr&&(Oe=d.relatedTarget||d.fromElement)&&(Ca(Oe)||Oe[Ti]))break e;if((Te||de)&&(de=fe.window===fe?fe:(de=fe.ownerDocument)?de.defaultView||de.parentWindow:window,Te?(Oe=d.relatedTarget||d.toElement,Te=re,Oe=Oe?Ca(Oe):null,Oe!==null&&(sn=ki(Oe),Oe!==sn||Oe.tag!==5&&Oe.tag!==6)&&(Oe=null)):(Te=null,Oe=re),Te!==Oe)){if(Ne=Vw,ye="onMouseLeave",Q="onMouseEnter",Z="mouse",(o==="pointerout"||o==="pointerover")&&(Ne=Hw,ye="onPointerLeave",Q="onPointerEnter",Z="pointer"),sn=Te==null?de:Hl(Te),J=Oe==null?de:Hl(Oe),de=new Ne(ye,Z+"leave",Te,d,fe),de.target=sn,de.relatedTarget=J,ye=null,Ca(fe)===re&&(Ne=new Ne(Q,Z+"enter",Oe,d,fe),Ne.target=J,Ne.relatedTarget=sn,ye=Ne),sn=ye,Te&&Oe)t:{for(Ne=Te,Q=Oe,Z=0,J=Ne;J;J=Vl(J))Z++;for(J=0,ye=Q;ye;ye=Vl(ye))J++;for(;0<Z-J;)Ne=Vl(Ne),Z--;for(;0<J-Z;)Q=Vl(Q),J--;for(;Z--;){if(Ne===Q||Q!==null&&Ne===Q.alternate)break t;Ne=Vl(Ne),Q=Vl(Q)}Ne=null}else Ne=null;Te!==null&&pb(pe,de,Te,Ne,!1),Oe!==null&&sn!==null&&pb(pe,sn,Oe,Ne,!0)}}e:{if(de=re?Hl(re):window,Te=de.nodeName&&de.nodeName.toLowerCase(),Te==="select"||Te==="input"&&de.type==="file")var Fe=CM;else if(Kw(de))if(qw)Fe=RM;else{Fe=PM;var Ue=kM}else(Te=de.nodeName)&&Te.toLowerCase()==="input"&&(de.type==="checkbox"||de.type==="radio")&&(Fe=TM);if(Fe&&(Fe=Fe(o,re))){Zw(pe,Fe,d,fe);break e}Ue&&Ue(o,de,re),o==="focusout"&&(Ue=de._wrapperState)&&Ue.controlled&&de.type==="number"&&it(de,"number",de.value)}switch(Ue=re?Hl(re):window,o){case"focusin":(Kw(Ue)||Ue.contentEditable==="true")&&(jl=Ue,q0=re,Mu=null);break;case"focusout":Mu=q0=jl=null;break;case"mousedown":Y0=!0;break;case"contextmenu":case"mouseup":case"dragend":Y0=!1,rb(pe,d,fe);break;case"selectionchange":if(MM)break;case"keydown":case"keyup":rb(pe,d,fe)}var Be;if(W0)e:{switch(o){case"compositionstart":var Ze="onCompositionStart";break e;case"compositionend":Ze="onCompositionEnd";break e;case"compositionupdate":Ze="onCompositionUpdate";break e}Ze=void 0}else Dl?Ww(o,d)&&(Ze="onCompositionEnd"):o==="keydown"&&d.keyCode===229&&(Ze="onCompositionStart");Ze&&(zw&&d.locale!=="ko"&&(Dl||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&Dl&&(Be=jw()):(So=fe,V0="value"in So?So.value:So.textContent,Dl=!0)),Ue=eh(re,Ze),0<Ue.length&&(Ze=new $w(Ze,o,null,d,fe),pe.push({event:Ze,listeners:Ue}),Be?Ze.data=Be:(Be=Gw(d),Be!==null&&(Ze.data=Be)))),(Be=xM?wM(o,d):bM(o,d))&&(re=eh(re,"onBeforeInput"),0<re.length&&(fe=new $w("onBeforeInput","beforeinput",null,d,fe),pe.push({event:fe,listeners:re}),fe.data=Be))}fb(pe,l)})}function Nu(o,l,d){return{instance:o,listener:l,currentTarget:d}}function eh(o,l){for(var d=l+"Capture",g=[];o!==null;){var b=o,C=b.stateNode;b.tag===5&&C!==null&&(b=C,C=cn(o,d),C!=null&&g.unshift(Nu(o,C,b)),C=cn(o,l),C!=null&&g.push(Nu(o,C,b))),o=o.return}return g}function Vl(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function pb(o,l,d,g,b){for(var C=l._reactName,M=[];d!==null&&d!==g;){var V=d,B=V.alternate,re=V.stateNode;if(B!==null&&B===g)break;V.tag===5&&re!==null&&(V=re,b?(B=cn(d,C),B!=null&&M.unshift(Nu(d,B,V))):b||(B=cn(d,C),B!=null&&M.push(Nu(d,B,V)))),d=d.return}M.length!==0&&o.push({event:l,listeners:M})}var DM=/\r\n?/g,jM=/\u0000|\uFFFD/g;function mb(o){return(typeof o=="string"?o:""+o).replace(DM,`
|
|
39
|
+
`).replace(jM,"")}function th(o,l,d){if(l=mb(l),mb(o)!==l&&d)throw Error(n(425))}function nh(){}var ng=null,rg=null;function sg(o,l){return o==="textarea"||o==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var ig=typeof setTimeout=="function"?setTimeout:void 0,FM=typeof clearTimeout=="function"?clearTimeout:void 0,gb=typeof Promise=="function"?Promise:void 0,VM=typeof queueMicrotask=="function"?queueMicrotask:typeof gb<"u"?function(o){return gb.resolve(null).then(o).catch($M)}:ig;function $M(o){setTimeout(function(){throw o})}function og(o,l){var d=l,g=0;do{var b=d.nextSibling;if(o.removeChild(d),b&&b.nodeType===8)if(d=b.data,d==="/$"){if(g===0){o.removeChild(b),Cu(l);return}g--}else d!=="$"&&d!=="$?"&&d!=="$!"||g++;d=b}while(d);Cu(l)}function Co(o){for(;o!=null;o=o.nextSibling){var l=o.nodeType;if(l===1||l===3)break;if(l===8){if(l=o.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return o}function vb(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var d=o.data;if(d==="$"||d==="$!"||d==="$?"){if(l===0)return o;l--}else d==="/$"&&l++}o=o.previousSibling}return null}var $l=Math.random().toString(36).slice(2),Xs="__reactFiber$"+$l,Du="__reactProps$"+$l,Ti="__reactContainer$"+$l,ag="__reactEvents$"+$l,HM="__reactListeners$"+$l,zM="__reactHandles$"+$l;function Ca(o){var l=o[Xs];if(l)return l;for(var d=o.parentNode;d;){if(l=d[Ti]||d[Xs]){if(d=l.alternate,l.child!==null||d!==null&&d.child!==null)for(o=vb(o);o!==null;){if(d=o[Xs])return d;o=vb(o)}return l}o=d,d=o.parentNode}return null}function ju(o){return o=o[Xs]||o[Ti],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function Hl(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(n(33))}function rh(o){return o[Du]||null}var lg=[],zl=-1;function ko(o){return{current:o}}function Ot(o){0>zl||(o.current=lg[zl],lg[zl]=null,zl--)}function Tt(o,l){zl++,lg[zl]=o.current,o.current=l}var Po={},Un=ko(Po),mr=ko(!1),ka=Po;function Ul(o,l){var d=o.type.contextTypes;if(!d)return Po;var g=o.stateNode;if(g&&g.__reactInternalMemoizedUnmaskedChildContext===l)return g.__reactInternalMemoizedMaskedChildContext;var b={},C;for(C in d)b[C]=l[C];return g&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=l,o.__reactInternalMemoizedMaskedChildContext=b),b}function gr(o){return o=o.childContextTypes,o!=null}function sh(){Ot(mr),Ot(Un)}function yb(o,l,d){if(Un.current!==Po)throw Error(n(168));Tt(Un,l),Tt(mr,d)}function _b(o,l,d){var g=o.stateNode;if(l=l.childContextTypes,typeof g.getChildContext!="function")return d;g=g.getChildContext();for(var b in g)if(!(b in l))throw Error(n(108,xe(o)||"Unknown",b));return z({},d,g)}function ih(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||Po,ka=Un.current,Tt(Un,o),Tt(mr,mr.current),!0}function xb(o,l,d){var g=o.stateNode;if(!g)throw Error(n(169));d?(o=_b(o,l,ka),g.__reactInternalMemoizedMergedChildContext=o,Ot(mr),Ot(Un),Tt(Un,o)):Ot(mr),Tt(mr,d)}var Ri=null,oh=!1,cg=!1;function wb(o){Ri===null?Ri=[o]:Ri.push(o)}function UM(o){oh=!0,wb(o)}function To(){if(!cg&&Ri!==null){cg=!0;var o=0,l=vt;try{var d=Ri;for(vt=1;o<d.length;o++){var g=d[o];do g=g(!0);while(g!==null)}Ri=null,oh=!1}catch(b){throw Ri!==null&&(Ri=Ri.slice(o+1)),mu(vu,To),b}finally{vt=l,cg=!1}}return null}var Bl=[],Wl=0,ah=null,lh=0,ss=[],is=0,Pa=null,Ai=1,Ii="";function Ta(o,l){Bl[Wl++]=lh,Bl[Wl++]=ah,ah=o,lh=l}function bb(o,l,d){ss[is++]=Ai,ss[is++]=Ii,ss[is++]=Pa,Pa=o;var g=Ai;o=Ii;var b=32-H(g)-1;g&=~(1<<b),d+=1;var C=32-H(l)+b;if(30<C){var M=b-b%5;C=(g&(1<<M)-1).toString(32),g>>=M,b-=M,Ai=1<<32-H(l)+b|d<<b|g,Ii=C+o}else Ai=1<<C|d<<b|g,Ii=o}function ug(o){o.return!==null&&(Ta(o,1),bb(o,1,0))}function dg(o){for(;o===ah;)ah=Bl[--Wl],Bl[Wl]=null,lh=Bl[--Wl],Bl[Wl]=null;for(;o===Pa;)Pa=ss[--is],ss[is]=null,Ii=ss[--is],ss[is]=null,Ai=ss[--is],ss[is]=null}var Vr=null,$r=null,$t=!1,Ts=null;function Sb(o,l){var d=cs(5,null,null,0);d.elementType="DELETED",d.stateNode=l,d.return=o,l=o.deletions,l===null?(o.deletions=[d],o.flags|=16):l.push(d)}function Eb(o,l){switch(o.tag){case 5:var d=o.type;return l=l.nodeType!==1||d.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(o.stateNode=l,Vr=o,$r=Co(l.firstChild),!0):!1;case 6:return l=o.pendingProps===""||l.nodeType!==3?null:l,l!==null?(o.stateNode=l,Vr=o,$r=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(d=Pa!==null?{id:Ai,overflow:Ii}:null,o.memoizedState={dehydrated:l,treeContext:d,retryLane:1073741824},d=cs(18,null,null,0),d.stateNode=l,d.return=o,o.child=d,Vr=o,$r=null,!0):!1;default:return!1}}function fg(o){return(o.mode&1)!==0&&(o.flags&128)===0}function hg(o){if($t){var l=$r;if(l){var d=l;if(!Eb(o,l)){if(fg(o))throw Error(n(418));l=Co(d.nextSibling);var g=Vr;l&&Eb(o,l)?Sb(g,d):(o.flags=o.flags&-4097|2,$t=!1,Vr=o)}}else{if(fg(o))throw Error(n(418));o.flags=o.flags&-4097|2,$t=!1,Vr=o}}}function Cb(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;Vr=o}function ch(o){if(o!==Vr)return!1;if(!$t)return Cb(o),$t=!0,!1;var l;if((l=o.tag!==3)&&!(l=o.tag!==5)&&(l=o.type,l=l!=="head"&&l!=="body"&&!sg(o.type,o.memoizedProps)),l&&(l=$r)){if(fg(o))throw kb(),Error(n(418));for(;l;)Sb(o,l),l=Co(l.nextSibling)}if(Cb(o),o.tag===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(n(317));e:{for(o=o.nextSibling,l=0;o;){if(o.nodeType===8){var d=o.data;if(d==="/$"){if(l===0){$r=Co(o.nextSibling);break e}l--}else d!=="$"&&d!=="$!"&&d!=="$?"||l++}o=o.nextSibling}$r=null}}else $r=Vr?Co(o.stateNode.nextSibling):null;return!0}function kb(){for(var o=$r;o;)o=Co(o.nextSibling)}function Gl(){$r=Vr=null,$t=!1}function pg(o){Ts===null?Ts=[o]:Ts.push(o)}var BM=k.ReactCurrentBatchConfig;function Fu(o,l,d){if(o=d.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(d._owner){if(d=d._owner,d){if(d.tag!==1)throw Error(n(309));var g=d.stateNode}if(!g)throw Error(n(147,o));var b=g,C=""+o;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===C?l.ref:(l=function(M){var V=b.refs;M===null?delete V[C]:V[C]=M},l._stringRef=C,l)}if(typeof o!="string")throw Error(n(284));if(!d._owner)throw Error(n(290,o))}return o}function uh(o,l){throw o=Object.prototype.toString.call(l),Error(n(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o))}function Pb(o){var l=o._init;return l(o._payload)}function Tb(o){function l(Q,Z){if(o){var J=Q.deletions;J===null?(Q.deletions=[Z],Q.flags|=16):J.push(Z)}}function d(Q,Z){if(!o)return null;for(;Z!==null;)l(Q,Z),Z=Z.sibling;return null}function g(Q,Z){for(Q=new Map;Z!==null;)Z.key!==null?Q.set(Z.key,Z):Q.set(Z.index,Z),Z=Z.sibling;return Q}function b(Q,Z){return Q=Do(Q,Z),Q.index=0,Q.sibling=null,Q}function C(Q,Z,J){return Q.index=J,o?(J=Q.alternate,J!==null?(J=J.index,J<Z?(Q.flags|=2,Z):J):(Q.flags|=2,Z)):(Q.flags|=1048576,Z)}function M(Q){return o&&Q.alternate===null&&(Q.flags|=2),Q}function V(Q,Z,J,ye){return Z===null||Z.tag!==6?(Z=iv(J,Q.mode,ye),Z.return=Q,Z):(Z=b(Z,J),Z.return=Q,Z)}function B(Q,Z,J,ye){var Fe=J.type;return Fe===O?fe(Q,Z,J.props.children,ye,J.key):Z!==null&&(Z.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===G&&Pb(Fe)===Z.type)?(ye=b(Z,J.props),ye.ref=Fu(Q,Z,J),ye.return=Q,ye):(ye=Lh(J.type,J.key,J.props,null,Q.mode,ye),ye.ref=Fu(Q,Z,J),ye.return=Q,ye)}function re(Q,Z,J,ye){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==J.containerInfo||Z.stateNode.implementation!==J.implementation?(Z=ov(J,Q.mode,ye),Z.return=Q,Z):(Z=b(Z,J.children||[]),Z.return=Q,Z)}function fe(Q,Z,J,ye,Fe){return Z===null||Z.tag!==7?(Z=Da(J,Q.mode,ye,Fe),Z.return=Q,Z):(Z=b(Z,J),Z.return=Q,Z)}function pe(Q,Z,J){if(typeof Z=="string"&&Z!==""||typeof Z=="number")return Z=iv(""+Z,Q.mode,J),Z.return=Q,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case R:return J=Lh(Z.type,Z.key,Z.props,null,Q.mode,J),J.ref=Fu(Q,null,Z),J.return=Q,J;case L:return Z=ov(Z,Q.mode,J),Z.return=Q,Z;case G:var ye=Z._init;return pe(Q,ye(Z._payload),J)}if(Pt(Z)||ne(Z))return Z=Da(Z,Q.mode,J,null),Z.return=Q,Z;uh(Q,Z)}return null}function de(Q,Z,J,ye){var Fe=Z!==null?Z.key:null;if(typeof J=="string"&&J!==""||typeof J=="number")return Fe!==null?null:V(Q,Z,""+J,ye);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case R:return J.key===Fe?B(Q,Z,J,ye):null;case L:return J.key===Fe?re(Q,Z,J,ye):null;case G:return Fe=J._init,de(Q,Z,Fe(J._payload),ye)}if(Pt(J)||ne(J))return Fe!==null?null:fe(Q,Z,J,ye,null);uh(Q,J)}return null}function Te(Q,Z,J,ye,Fe){if(typeof ye=="string"&&ye!==""||typeof ye=="number")return Q=Q.get(J)||null,V(Z,Q,""+ye,Fe);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case R:return Q=Q.get(ye.key===null?J:ye.key)||null,B(Z,Q,ye,Fe);case L:return Q=Q.get(ye.key===null?J:ye.key)||null,re(Z,Q,ye,Fe);case G:var Ue=ye._init;return Te(Q,Z,J,Ue(ye._payload),Fe)}if(Pt(ye)||ne(ye))return Q=Q.get(J)||null,fe(Z,Q,ye,Fe,null);uh(Z,ye)}return null}function Oe(Q,Z,J,ye){for(var Fe=null,Ue=null,Be=Z,Ze=Z=0,En=null;Be!==null&&Ze<J.length;Ze++){Be.index>Ze?(En=Be,Be=null):En=Be.sibling;var ft=de(Q,Be,J[Ze],ye);if(ft===null){Be===null&&(Be=En);break}o&&Be&&ft.alternate===null&&l(Q,Be),Z=C(ft,Z,Ze),Ue===null?Fe=ft:Ue.sibling=ft,Ue=ft,Be=En}if(Ze===J.length)return d(Q,Be),$t&&Ta(Q,Ze),Fe;if(Be===null){for(;Ze<J.length;Ze++)Be=pe(Q,J[Ze],ye),Be!==null&&(Z=C(Be,Z,Ze),Ue===null?Fe=Be:Ue.sibling=Be,Ue=Be);return $t&&Ta(Q,Ze),Fe}for(Be=g(Q,Be);Ze<J.length;Ze++)En=Te(Be,Q,Ze,J[Ze],ye),En!==null&&(o&&En.alternate!==null&&Be.delete(En.key===null?Ze:En.key),Z=C(En,Z,Ze),Ue===null?Fe=En:Ue.sibling=En,Ue=En);return o&&Be.forEach(function(jo){return l(Q,jo)}),$t&&Ta(Q,Ze),Fe}function Ne(Q,Z,J,ye){var Fe=ne(J);if(typeof Fe!="function")throw Error(n(150));if(J=Fe.call(J),J==null)throw Error(n(151));for(var Ue=Fe=null,Be=Z,Ze=Z=0,En=null,ft=J.next();Be!==null&&!ft.done;Ze++,ft=J.next()){Be.index>Ze?(En=Be,Be=null):En=Be.sibling;var jo=de(Q,Be,ft.value,ye);if(jo===null){Be===null&&(Be=En);break}o&&Be&&jo.alternate===null&&l(Q,Be),Z=C(jo,Z,Ze),Ue===null?Fe=jo:Ue.sibling=jo,Ue=jo,Be=En}if(ft.done)return d(Q,Be),$t&&Ta(Q,Ze),Fe;if(Be===null){for(;!ft.done;Ze++,ft=J.next())ft=pe(Q,ft.value,ye),ft!==null&&(Z=C(ft,Z,Ze),Ue===null?Fe=ft:Ue.sibling=ft,Ue=ft);return $t&&Ta(Q,Ze),Fe}for(Be=g(Q,Be);!ft.done;Ze++,ft=J.next())ft=Te(Be,Q,Ze,ft.value,ye),ft!==null&&(o&&ft.alternate!==null&&Be.delete(ft.key===null?Ze:ft.key),Z=C(ft,Z,Ze),Ue===null?Fe=ft:Ue.sibling=ft,Ue=ft);return o&&Be.forEach(function(SO){return l(Q,SO)}),$t&&Ta(Q,Ze),Fe}function sn(Q,Z,J,ye){if(typeof J=="object"&&J!==null&&J.type===O&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case R:e:{for(var Fe=J.key,Ue=Z;Ue!==null;){if(Ue.key===Fe){if(Fe=J.type,Fe===O){if(Ue.tag===7){d(Q,Ue.sibling),Z=b(Ue,J.props.children),Z.return=Q,Q=Z;break e}}else if(Ue.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===G&&Pb(Fe)===Ue.type){d(Q,Ue.sibling),Z=b(Ue,J.props),Z.ref=Fu(Q,Ue,J),Z.return=Q,Q=Z;break e}d(Q,Ue);break}else l(Q,Ue);Ue=Ue.sibling}J.type===O?(Z=Da(J.props.children,Q.mode,ye,J.key),Z.return=Q,Q=Z):(ye=Lh(J.type,J.key,J.props,null,Q.mode,ye),ye.ref=Fu(Q,Z,J),ye.return=Q,Q=ye)}return M(Q);case L:e:{for(Ue=J.key;Z!==null;){if(Z.key===Ue)if(Z.tag===4&&Z.stateNode.containerInfo===J.containerInfo&&Z.stateNode.implementation===J.implementation){d(Q,Z.sibling),Z=b(Z,J.children||[]),Z.return=Q,Q=Z;break e}else{d(Q,Z);break}else l(Q,Z);Z=Z.sibling}Z=ov(J,Q.mode,ye),Z.return=Q,Q=Z}return M(Q);case G:return Ue=J._init,sn(Q,Z,Ue(J._payload),ye)}if(Pt(J))return Oe(Q,Z,J,ye);if(ne(J))return Ne(Q,Z,J,ye);uh(Q,J)}return typeof J=="string"&&J!==""||typeof J=="number"?(J=""+J,Z!==null&&Z.tag===6?(d(Q,Z.sibling),Z=b(Z,J),Z.return=Q,Q=Z):(d(Q,Z),Z=iv(J,Q.mode,ye),Z.return=Q,Q=Z),M(Q)):d(Q,Z)}return sn}var Kl=Tb(!0),Rb=Tb(!1),dh=ko(null),fh=null,Zl=null,mg=null;function gg(){mg=Zl=fh=null}function vg(o){var l=dh.current;Ot(dh),o._currentValue=l}function yg(o,l,d){for(;o!==null;){var g=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,g!==null&&(g.childLanes|=l)):g!==null&&(g.childLanes&l)!==l&&(g.childLanes|=l),o===d)break;o=o.return}}function ql(o,l){fh=o,mg=Zl=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&l)!==0&&(vr=!0),o.firstContext=null)}function os(o){var l=o._currentValue;if(mg!==o)if(o={context:o,memoizedValue:l,next:null},Zl===null){if(fh===null)throw Error(n(308));Zl=o,fh.dependencies={lanes:0,firstContext:o}}else Zl=Zl.next=o;return l}var Ra=null;function _g(o){Ra===null?Ra=[o]:Ra.push(o)}function Ab(o,l,d,g){var b=l.interleaved;return b===null?(d.next=d,_g(l)):(d.next=b.next,b.next=d),l.interleaved=d,Mi(o,g)}function Mi(o,l){o.lanes|=l;var d=o.alternate;for(d!==null&&(d.lanes|=l),d=o,o=o.return;o!==null;)o.childLanes|=l,d=o.alternate,d!==null&&(d.childLanes|=l),d=o,o=o.return;return d.tag===3?d.stateNode:null}var Ro=!1;function xg(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ib(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function Oi(o,l){return{eventTime:o,lane:l,tag:0,payload:null,callback:null,next:null}}function Ao(o,l,d){var g=o.updateQueue;if(g===null)return null;if(g=g.shared,(dt&2)!==0){var b=g.pending;return b===null?l.next=l:(l.next=b.next,b.next=l),g.pending=l,Mi(o,d)}return b=g.interleaved,b===null?(l.next=l,_g(g)):(l.next=b.next,b.next=l),g.interleaved=l,Mi(o,d)}function hh(o,l,d){if(l=l.updateQueue,l!==null&&(l=l.shared,(d&4194240)!==0)){var g=l.lanes;g&=o.pendingLanes,d|=g,l.lanes=d,ks(o,d)}}function Mb(o,l){var d=o.updateQueue,g=o.alternate;if(g!==null&&(g=g.updateQueue,d===g)){var b=null,C=null;if(d=d.firstBaseUpdate,d!==null){do{var M={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};C===null?b=C=M:C=C.next=M,d=d.next}while(d!==null);C===null?b=C=l:C=C.next=l}else b=C=l;d={baseState:g.baseState,firstBaseUpdate:b,lastBaseUpdate:C,shared:g.shared,effects:g.effects},o.updateQueue=d;return}o=d.lastBaseUpdate,o===null?d.firstBaseUpdate=l:o.next=l,d.lastBaseUpdate=l}function ph(o,l,d,g){var b=o.updateQueue;Ro=!1;var C=b.firstBaseUpdate,M=b.lastBaseUpdate,V=b.shared.pending;if(V!==null){b.shared.pending=null;var B=V,re=B.next;B.next=null,M===null?C=re:M.next=re,M=B;var fe=o.alternate;fe!==null&&(fe=fe.updateQueue,V=fe.lastBaseUpdate,V!==M&&(V===null?fe.firstBaseUpdate=re:V.next=re,fe.lastBaseUpdate=B))}if(C!==null){var pe=b.baseState;M=0,fe=re=B=null,V=C;do{var de=V.lane,Te=V.eventTime;if((g&de)===de){fe!==null&&(fe=fe.next={eventTime:Te,lane:0,tag:V.tag,payload:V.payload,callback:V.callback,next:null});e:{var Oe=o,Ne=V;switch(de=l,Te=d,Ne.tag){case 1:if(Oe=Ne.payload,typeof Oe=="function"){pe=Oe.call(Te,pe,de);break e}pe=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=Ne.payload,de=typeof Oe=="function"?Oe.call(Te,pe,de):Oe,de==null)break e;pe=z({},pe,de);break e;case 2:Ro=!0}}V.callback!==null&&V.lane!==0&&(o.flags|=64,de=b.effects,de===null?b.effects=[V]:de.push(V))}else Te={eventTime:Te,lane:de,tag:V.tag,payload:V.payload,callback:V.callback,next:null},fe===null?(re=fe=Te,B=pe):fe=fe.next=Te,M|=de;if(V=V.next,V===null){if(V=b.shared.pending,V===null)break;de=V,V=de.next,de.next=null,b.lastBaseUpdate=de,b.shared.pending=null}}while(!0);if(fe===null&&(B=pe),b.baseState=B,b.firstBaseUpdate=re,b.lastBaseUpdate=fe,l=b.shared.interleaved,l!==null){b=l;do M|=b.lane,b=b.next;while(b!==l)}else C===null&&(b.shared.lanes=0);Ma|=M,o.lanes=M,o.memoizedState=pe}}function Ob(o,l,d){if(o=l.effects,l.effects=null,o!==null)for(l=0;l<o.length;l++){var g=o[l],b=g.callback;if(b!==null){if(g.callback=null,g=d,typeof b!="function")throw Error(n(191,b));b.call(g)}}}var Vu={},Qs=ko(Vu),$u=ko(Vu),Hu=ko(Vu);function Aa(o){if(o===Vu)throw Error(n(174));return o}function wg(o,l){switch(Tt(Hu,l),Tt($u,o),Tt(Qs,Vu),o=l.nodeType,o){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:Lr(null,"");break;default:o=o===8?l.parentNode:l,l=o.namespaceURI||null,o=o.tagName,l=Lr(l,o)}Ot(Qs),Tt(Qs,l)}function Yl(){Ot(Qs),Ot($u),Ot(Hu)}function Lb(o){Aa(Hu.current);var l=Aa(Qs.current),d=Lr(l,o.type);l!==d&&(Tt($u,o),Tt(Qs,d))}function bg(o){$u.current===o&&(Ot(Qs),Ot($u))}var Bt=ko(0);function mh(o){for(var l=o;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||d.data==="$?"||d.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Sg=[];function Eg(){for(var o=0;o<Sg.length;o++)Sg[o]._workInProgressVersionPrimary=null;Sg.length=0}var gh=k.ReactCurrentDispatcher,Cg=k.ReactCurrentBatchConfig,Ia=0,Wt=null,vn=null,bn=null,vh=!1,zu=!1,Uu=0,WM=0;function Bn(){throw Error(n(321))}function kg(o,l){if(l===null)return!1;for(var d=0;d<l.length&&d<o.length;d++)if(!Ps(o[d],l[d]))return!1;return!0}function Pg(o,l,d,g,b,C){if(Ia=C,Wt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,gh.current=o===null||o.memoizedState===null?qM:YM,o=d(g,b),zu){C=0;do{if(zu=!1,Uu=0,25<=C)throw Error(n(301));C+=1,bn=vn=null,l.updateQueue=null,gh.current=XM,o=d(g,b)}while(zu)}if(gh.current=xh,l=vn!==null&&vn.next!==null,Ia=0,bn=vn=Wt=null,vh=!1,l)throw Error(n(300));return o}function Tg(){var o=Uu!==0;return Uu=0,o}function Js(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bn===null?Wt.memoizedState=bn=o:bn=bn.next=o,bn}function as(){if(vn===null){var o=Wt.alternate;o=o!==null?o.memoizedState:null}else o=vn.next;var l=bn===null?Wt.memoizedState:bn.next;if(l!==null)bn=l,vn=o;else{if(o===null)throw Error(n(310));vn=o,o={memoizedState:vn.memoizedState,baseState:vn.baseState,baseQueue:vn.baseQueue,queue:vn.queue,next:null},bn===null?Wt.memoizedState=bn=o:bn=bn.next=o}return bn}function Bu(o,l){return typeof l=="function"?l(o):l}function Rg(o){var l=as(),d=l.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=o;var g=vn,b=g.baseQueue,C=d.pending;if(C!==null){if(b!==null){var M=b.next;b.next=C.next,C.next=M}g.baseQueue=b=C,d.pending=null}if(b!==null){C=b.next,g=g.baseState;var V=M=null,B=null,re=C;do{var fe=re.lane;if((Ia&fe)===fe)B!==null&&(B=B.next={lane:0,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),g=re.hasEagerState?re.eagerState:o(g,re.action);else{var pe={lane:fe,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null};B===null?(V=B=pe,M=g):B=B.next=pe,Wt.lanes|=fe,Ma|=fe}re=re.next}while(re!==null&&re!==C);B===null?M=g:B.next=V,Ps(g,l.memoizedState)||(vr=!0),l.memoizedState=g,l.baseState=M,l.baseQueue=B,d.lastRenderedState=g}if(o=d.interleaved,o!==null){b=o;do C=b.lane,Wt.lanes|=C,Ma|=C,b=b.next;while(b!==o)}else b===null&&(d.lanes=0);return[l.memoizedState,d.dispatch]}function Ag(o){var l=as(),d=l.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=o;var g=d.dispatch,b=d.pending,C=l.memoizedState;if(b!==null){d.pending=null;var M=b=b.next;do C=o(C,M.action),M=M.next;while(M!==b);Ps(C,l.memoizedState)||(vr=!0),l.memoizedState=C,l.baseQueue===null&&(l.baseState=C),d.lastRenderedState=C}return[C,g]}function Nb(){}function Db(o,l){var d=Wt,g=as(),b=l(),C=!Ps(g.memoizedState,b);if(C&&(g.memoizedState=b,vr=!0),g=g.queue,Ig(Vb.bind(null,d,g,o),[o]),g.getSnapshot!==l||C||bn!==null&&bn.memoizedState.tag&1){if(d.flags|=2048,Wu(9,Fb.bind(null,d,g,b,l),void 0,null),Sn===null)throw Error(n(349));(Ia&30)!==0||jb(d,l,b)}return b}function jb(o,l,d){o.flags|=16384,o={getSnapshot:l,value:d},l=Wt.updateQueue,l===null?(l={lastEffect:null,stores:null},Wt.updateQueue=l,l.stores=[o]):(d=l.stores,d===null?l.stores=[o]:d.push(o))}function Fb(o,l,d,g){l.value=d,l.getSnapshot=g,$b(l)&&Hb(o)}function Vb(o,l,d){return d(function(){$b(l)&&Hb(o)})}function $b(o){var l=o.getSnapshot;o=o.value;try{var d=l();return!Ps(o,d)}catch{return!0}}function Hb(o){var l=Mi(o,1);l!==null&&Ms(l,o,1,-1)}function zb(o){var l=Js();return typeof o=="function"&&(o=o()),l.memoizedState=l.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Bu,lastRenderedState:o},l.queue=o,o=o.dispatch=ZM.bind(null,Wt,o),[l.memoizedState,o]}function Wu(o,l,d,g){return o={tag:o,create:l,destroy:d,deps:g,next:null},l=Wt.updateQueue,l===null?(l={lastEffect:null,stores:null},Wt.updateQueue=l,l.lastEffect=o.next=o):(d=l.lastEffect,d===null?l.lastEffect=o.next=o:(g=d.next,d.next=o,o.next=g,l.lastEffect=o)),o}function Ub(){return as().memoizedState}function yh(o,l,d,g){var b=Js();Wt.flags|=o,b.memoizedState=Wu(1|l,d,void 0,g===void 0?null:g)}function _h(o,l,d,g){var b=as();g=g===void 0?null:g;var C=void 0;if(vn!==null){var M=vn.memoizedState;if(C=M.destroy,g!==null&&kg(g,M.deps)){b.memoizedState=Wu(l,d,C,g);return}}Wt.flags|=o,b.memoizedState=Wu(1|l,d,C,g)}function Bb(o,l){return yh(8390656,8,o,l)}function Ig(o,l){return _h(2048,8,o,l)}function Wb(o,l){return _h(4,2,o,l)}function Gb(o,l){return _h(4,4,o,l)}function Kb(o,l){if(typeof l=="function")return o=o(),l(o),function(){l(null)};if(l!=null)return o=o(),l.current=o,function(){l.current=null}}function Zb(o,l,d){return d=d!=null?d.concat([o]):null,_h(4,4,Kb.bind(null,l,o),d)}function Mg(){}function qb(o,l){var d=as();l=l===void 0?null:l;var g=d.memoizedState;return g!==null&&l!==null&&kg(l,g[1])?g[0]:(d.memoizedState=[o,l],o)}function Yb(o,l){var d=as();l=l===void 0?null:l;var g=d.memoizedState;return g!==null&&l!==null&&kg(l,g[1])?g[0]:(o=o(),d.memoizedState=[o,l],o)}function Xb(o,l,d){return(Ia&21)===0?(o.baseState&&(o.baseState=!1,vr=!0),o.memoizedState=d):(Ps(d,l)||(d=Cs(),Wt.lanes|=d,Ma|=d,o.baseState=!0),l)}function GM(o,l){var d=vt;vt=d!==0&&4>d?d:4,o(!0);var g=Cg.transition;Cg.transition={};try{o(!1),l()}finally{vt=d,Cg.transition=g}}function Qb(){return as().memoizedState}function KM(o,l,d){var g=Lo(o);if(d={lane:g,action:d,hasEagerState:!1,eagerState:null,next:null},Jb(o))eS(l,d);else if(d=Ab(o,l,d,g),d!==null){var b=rr();Ms(d,o,g,b),tS(d,l,g)}}function ZM(o,l,d){var g=Lo(o),b={lane:g,action:d,hasEagerState:!1,eagerState:null,next:null};if(Jb(o))eS(l,b);else{var C=o.alternate;if(o.lanes===0&&(C===null||C.lanes===0)&&(C=l.lastRenderedReducer,C!==null))try{var M=l.lastRenderedState,V=C(M,d);if(b.hasEagerState=!0,b.eagerState=V,Ps(V,M)){var B=l.interleaved;B===null?(b.next=b,_g(l)):(b.next=B.next,B.next=b),l.interleaved=b;return}}catch{}finally{}d=Ab(o,l,b,g),d!==null&&(b=rr(),Ms(d,o,g,b),tS(d,l,g))}}function Jb(o){var l=o.alternate;return o===Wt||l!==null&&l===Wt}function eS(o,l){zu=vh=!0;var d=o.pending;d===null?l.next=l:(l.next=d.next,d.next=l),o.pending=l}function tS(o,l,d){if((d&4194240)!==0){var g=l.lanes;g&=o.pendingLanes,d|=g,l.lanes=d,ks(o,d)}}var xh={readContext:os,useCallback:Bn,useContext:Bn,useEffect:Bn,useImperativeHandle:Bn,useInsertionEffect:Bn,useLayoutEffect:Bn,useMemo:Bn,useReducer:Bn,useRef:Bn,useState:Bn,useDebugValue:Bn,useDeferredValue:Bn,useTransition:Bn,useMutableSource:Bn,useSyncExternalStore:Bn,useId:Bn,unstable_isNewReconciler:!1},qM={readContext:os,useCallback:function(o,l){return Js().memoizedState=[o,l===void 0?null:l],o},useContext:os,useEffect:Bb,useImperativeHandle:function(o,l,d){return d=d!=null?d.concat([o]):null,yh(4194308,4,Kb.bind(null,l,o),d)},useLayoutEffect:function(o,l){return yh(4194308,4,o,l)},useInsertionEffect:function(o,l){return yh(4,2,o,l)},useMemo:function(o,l){var d=Js();return l=l===void 0?null:l,o=o(),d.memoizedState=[o,l],o},useReducer:function(o,l,d){var g=Js();return l=d!==void 0?d(l):l,g.memoizedState=g.baseState=l,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:l},g.queue=o,o=o.dispatch=KM.bind(null,Wt,o),[g.memoizedState,o]},useRef:function(o){var l=Js();return o={current:o},l.memoizedState=o},useState:zb,useDebugValue:Mg,useDeferredValue:function(o){return Js().memoizedState=o},useTransition:function(){var o=zb(!1),l=o[0];return o=GM.bind(null,o[1]),Js().memoizedState=o,[l,o]},useMutableSource:function(){},useSyncExternalStore:function(o,l,d){var g=Wt,b=Js();if($t){if(d===void 0)throw Error(n(407));d=d()}else{if(d=l(),Sn===null)throw Error(n(349));(Ia&30)!==0||jb(g,l,d)}b.memoizedState=d;var C={value:d,getSnapshot:l};return b.queue=C,Bb(Vb.bind(null,g,C,o),[o]),g.flags|=2048,Wu(9,Fb.bind(null,g,C,d,l),void 0,null),d},useId:function(){var o=Js(),l=Sn.identifierPrefix;if($t){var d=Ii,g=Ai;d=(g&~(1<<32-H(g)-1)).toString(32)+d,l=":"+l+"R"+d,d=Uu++,0<d&&(l+="H"+d.toString(32)),l+=":"}else d=WM++,l=":"+l+"r"+d.toString(32)+":";return o.memoizedState=l},unstable_isNewReconciler:!1},YM={readContext:os,useCallback:qb,useContext:os,useEffect:Ig,useImperativeHandle:Zb,useInsertionEffect:Wb,useLayoutEffect:Gb,useMemo:Yb,useReducer:Rg,useRef:Ub,useState:function(){return Rg(Bu)},useDebugValue:Mg,useDeferredValue:function(o){var l=as();return Xb(l,vn.memoizedState,o)},useTransition:function(){var o=Rg(Bu)[0],l=as().memoizedState;return[o,l]},useMutableSource:Nb,useSyncExternalStore:Db,useId:Qb,unstable_isNewReconciler:!1},XM={readContext:os,useCallback:qb,useContext:os,useEffect:Ig,useImperativeHandle:Zb,useInsertionEffect:Wb,useLayoutEffect:Gb,useMemo:Yb,useReducer:Ag,useRef:Ub,useState:function(){return Ag(Bu)},useDebugValue:Mg,useDeferredValue:function(o){var l=as();return vn===null?l.memoizedState=o:Xb(l,vn.memoizedState,o)},useTransition:function(){var o=Ag(Bu)[0],l=as().memoizedState;return[o,l]},useMutableSource:Nb,useSyncExternalStore:Db,useId:Qb,unstable_isNewReconciler:!1};function Rs(o,l){if(o&&o.defaultProps){l=z({},l),o=o.defaultProps;for(var d in o)l[d]===void 0&&(l[d]=o[d]);return l}return l}function Og(o,l,d,g){l=o.memoizedState,d=d(g,l),d=d==null?l:z({},l,d),o.memoizedState=d,o.lanes===0&&(o.updateQueue.baseState=d)}var wh={isMounted:function(o){return(o=o._reactInternals)?ki(o)===o:!1},enqueueSetState:function(o,l,d){o=o._reactInternals;var g=rr(),b=Lo(o),C=Oi(g,b);C.payload=l,d!=null&&(C.callback=d),l=Ao(o,C,b),l!==null&&(Ms(l,o,b,g),hh(l,o,b))},enqueueReplaceState:function(o,l,d){o=o._reactInternals;var g=rr(),b=Lo(o),C=Oi(g,b);C.tag=1,C.payload=l,d!=null&&(C.callback=d),l=Ao(o,C,b),l!==null&&(Ms(l,o,b,g),hh(l,o,b))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var d=rr(),g=Lo(o),b=Oi(d,g);b.tag=2,l!=null&&(b.callback=l),l=Ao(o,b,g),l!==null&&(Ms(l,o,g,d),hh(l,o,g))}};function nS(o,l,d,g,b,C,M){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(g,C,M):l.prototype&&l.prototype.isPureReactComponent?!Iu(d,g)||!Iu(b,C):!0}function rS(o,l,d){var g=!1,b=Po,C=l.contextType;return typeof C=="object"&&C!==null?C=os(C):(b=gr(l)?ka:Un.current,g=l.contextTypes,C=(g=g!=null)?Ul(o,b):Po),l=new l(d,C),o.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=wh,o.stateNode=l,l._reactInternals=o,g&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=b,o.__reactInternalMemoizedMaskedChildContext=C),l}function sS(o,l,d,g){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(d,g),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(d,g),l.state!==o&&wh.enqueueReplaceState(l,l.state,null)}function Lg(o,l,d,g){var b=o.stateNode;b.props=d,b.state=o.memoizedState,b.refs={},xg(o);var C=l.contextType;typeof C=="object"&&C!==null?b.context=os(C):(C=gr(l)?ka:Un.current,b.context=Ul(o,C)),b.state=o.memoizedState,C=l.getDerivedStateFromProps,typeof C=="function"&&(Og(o,l,C,d),b.state=o.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(l=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),l!==b.state&&wh.enqueueReplaceState(b,b.state,null),ph(o,d,b,g),b.state=o.memoizedState),typeof b.componentDidMount=="function"&&(o.flags|=4194308)}function Xl(o,l){try{var d="",g=l;do d+=oe(g),g=g.return;while(g);var b=d}catch(C){b=`
|
|
40
|
+
Error generating stack: `+C.message+`
|
|
41
|
+
`+C.stack}return{value:o,source:l,stack:b,digest:null}}function Ng(o,l,d){return{value:o,source:null,stack:d??null,digest:l??null}}function Dg(o,l){try{console.error(l.value)}catch(d){setTimeout(function(){throw d})}}var QM=typeof WeakMap=="function"?WeakMap:Map;function iS(o,l,d){d=Oi(-1,d),d.tag=3,d.payload={element:null};var g=l.value;return d.callback=function(){Th||(Th=!0,Xg=g),Dg(o,l)},d}function oS(o,l,d){d=Oi(-1,d),d.tag=3;var g=o.type.getDerivedStateFromError;if(typeof g=="function"){var b=l.value;d.payload=function(){return g(b)},d.callback=function(){Dg(o,l)}}var C=o.stateNode;return C!==null&&typeof C.componentDidCatch=="function"&&(d.callback=function(){Dg(o,l),typeof g!="function"&&(Mo===null?Mo=new Set([this]):Mo.add(this));var M=l.stack;this.componentDidCatch(l.value,{componentStack:M!==null?M:""})}),d}function aS(o,l,d){var g=o.pingCache;if(g===null){g=o.pingCache=new QM;var b=new Set;g.set(l,b)}else b=g.get(l),b===void 0&&(b=new Set,g.set(l,b));b.has(d)||(b.add(d),o=fO.bind(null,o,l,d),l.then(o,o))}function lS(o){do{var l;if((l=o.tag===13)&&(l=o.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return o;o=o.return}while(o!==null);return null}function cS(o,l,d,g,b){return(o.mode&1)===0?(o===l?o.flags|=65536:(o.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(l=Oi(-1,1),l.tag=2,Ao(d,l,1))),d.lanes|=1),o):(o.flags|=65536,o.lanes=b,o)}var JM=k.ReactCurrentOwner,vr=!1;function nr(o,l,d,g){l.child=o===null?Rb(l,null,d,g):Kl(l,o.child,d,g)}function uS(o,l,d,g,b){d=d.render;var C=l.ref;return ql(l,b),g=Pg(o,l,d,g,C,b),d=Tg(),o!==null&&!vr?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~b,Li(o,l,b)):($t&&d&&ug(l),l.flags|=1,nr(o,l,g,b),l.child)}function dS(o,l,d,g,b){if(o===null){var C=d.type;return typeof C=="function"&&!sv(C)&&C.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(l.tag=15,l.type=C,fS(o,l,C,g,b)):(o=Lh(d.type,null,g,l,l.mode,b),o.ref=l.ref,o.return=l,l.child=o)}if(C=o.child,(o.lanes&b)===0){var M=C.memoizedProps;if(d=d.compare,d=d!==null?d:Iu,d(M,g)&&o.ref===l.ref)return Li(o,l,b)}return l.flags|=1,o=Do(C,g),o.ref=l.ref,o.return=l,l.child=o}function fS(o,l,d,g,b){if(o!==null){var C=o.memoizedProps;if(Iu(C,g)&&o.ref===l.ref)if(vr=!1,l.pendingProps=g=C,(o.lanes&b)!==0)(o.flags&131072)!==0&&(vr=!0);else return l.lanes=o.lanes,Li(o,l,b)}return jg(o,l,d,g,b)}function hS(o,l,d){var g=l.pendingProps,b=g.children,C=o!==null?o.memoizedState:null;if(g.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},Tt(Jl,Hr),Hr|=d;else{if((d&1073741824)===0)return o=C!==null?C.baseLanes|d:d,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:o,cachePool:null,transitions:null},l.updateQueue=null,Tt(Jl,Hr),Hr|=o,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},g=C!==null?C.baseLanes:d,Tt(Jl,Hr),Hr|=g}else C!==null?(g=C.baseLanes|d,l.memoizedState=null):g=d,Tt(Jl,Hr),Hr|=g;return nr(o,l,b,d),l.child}function pS(o,l){var d=l.ref;(o===null&&d!==null||o!==null&&o.ref!==d)&&(l.flags|=512,l.flags|=2097152)}function jg(o,l,d,g,b){var C=gr(d)?ka:Un.current;return C=Ul(l,C),ql(l,b),d=Pg(o,l,d,g,C,b),g=Tg(),o!==null&&!vr?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~b,Li(o,l,b)):($t&&g&&ug(l),l.flags|=1,nr(o,l,d,b),l.child)}function mS(o,l,d,g,b){if(gr(d)){var C=!0;ih(l)}else C=!1;if(ql(l,b),l.stateNode===null)Sh(o,l),rS(l,d,g),Lg(l,d,g,b),g=!0;else if(o===null){var M=l.stateNode,V=l.memoizedProps;M.props=V;var B=M.context,re=d.contextType;typeof re=="object"&&re!==null?re=os(re):(re=gr(d)?ka:Un.current,re=Ul(l,re));var fe=d.getDerivedStateFromProps,pe=typeof fe=="function"||typeof M.getSnapshotBeforeUpdate=="function";pe||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(V!==g||B!==re)&&sS(l,M,g,re),Ro=!1;var de=l.memoizedState;M.state=de,ph(l,g,M,b),B=l.memoizedState,V!==g||de!==B||mr.current||Ro?(typeof fe=="function"&&(Og(l,d,fe,g),B=l.memoizedState),(V=Ro||nS(l,d,V,g,de,B,re))?(pe||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount()),typeof M.componentDidMount=="function"&&(l.flags|=4194308)):(typeof M.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=g,l.memoizedState=B),M.props=g,M.state=B,M.context=re,g=V):(typeof M.componentDidMount=="function"&&(l.flags|=4194308),g=!1)}else{M=l.stateNode,Ib(o,l),V=l.memoizedProps,re=l.type===l.elementType?V:Rs(l.type,V),M.props=re,pe=l.pendingProps,de=M.context,B=d.contextType,typeof B=="object"&&B!==null?B=os(B):(B=gr(d)?ka:Un.current,B=Ul(l,B));var Te=d.getDerivedStateFromProps;(fe=typeof Te=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(V!==pe||de!==B)&&sS(l,M,g,B),Ro=!1,de=l.memoizedState,M.state=de,ph(l,g,M,b);var Oe=l.memoizedState;V!==pe||de!==Oe||mr.current||Ro?(typeof Te=="function"&&(Og(l,d,Te,g),Oe=l.memoizedState),(re=Ro||nS(l,d,re,g,de,Oe,B)||!1)?(fe||typeof M.UNSAFE_componentWillUpdate!="function"&&typeof M.componentWillUpdate!="function"||(typeof M.componentWillUpdate=="function"&&M.componentWillUpdate(g,Oe,B),typeof M.UNSAFE_componentWillUpdate=="function"&&M.UNSAFE_componentWillUpdate(g,Oe,B)),typeof M.componentDidUpdate=="function"&&(l.flags|=4),typeof M.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof M.componentDidUpdate!="function"||V===o.memoizedProps&&de===o.memoizedState||(l.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||V===o.memoizedProps&&de===o.memoizedState||(l.flags|=1024),l.memoizedProps=g,l.memoizedState=Oe),M.props=g,M.state=Oe,M.context=B,g=re):(typeof M.componentDidUpdate!="function"||V===o.memoizedProps&&de===o.memoizedState||(l.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||V===o.memoizedProps&&de===o.memoizedState||(l.flags|=1024),g=!1)}return Fg(o,l,d,g,C,b)}function Fg(o,l,d,g,b,C){pS(o,l);var M=(l.flags&128)!==0;if(!g&&!M)return b&&xb(l,d,!1),Li(o,l,C);g=l.stateNode,JM.current=l;var V=M&&typeof d.getDerivedStateFromError!="function"?null:g.render();return l.flags|=1,o!==null&&M?(l.child=Kl(l,o.child,null,C),l.child=Kl(l,null,V,C)):nr(o,l,V,C),l.memoizedState=g.state,b&&xb(l,d,!0),l.child}function gS(o){var l=o.stateNode;l.pendingContext?yb(o,l.pendingContext,l.pendingContext!==l.context):l.context&&yb(o,l.context,!1),wg(o,l.containerInfo)}function vS(o,l,d,g,b){return Gl(),pg(b),l.flags|=256,nr(o,l,d,g),l.child}var Vg={dehydrated:null,treeContext:null,retryLane:0};function $g(o){return{baseLanes:o,cachePool:null,transitions:null}}function yS(o,l,d){var g=l.pendingProps,b=Bt.current,C=!1,M=(l.flags&128)!==0,V;if((V=M)||(V=o!==null&&o.memoizedState===null?!1:(b&2)!==0),V?(C=!0,l.flags&=-129):(o===null||o.memoizedState!==null)&&(b|=1),Tt(Bt,b&1),o===null)return hg(l),o=l.memoizedState,o!==null&&(o=o.dehydrated,o!==null)?((l.mode&1)===0?l.lanes=1:o.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(M=g.children,o=g.fallback,C?(g=l.mode,C=l.child,M={mode:"hidden",children:M},(g&1)===0&&C!==null?(C.childLanes=0,C.pendingProps=M):C=Nh(M,g,0,null),o=Da(o,g,d,null),C.return=l,o.return=l,C.sibling=o,l.child=C,l.child.memoizedState=$g(d),l.memoizedState=Vg,o):Hg(l,M));if(b=o.memoizedState,b!==null&&(V=b.dehydrated,V!==null))return eO(o,l,M,g,V,b,d);if(C){C=g.fallback,M=l.mode,b=o.child,V=b.sibling;var B={mode:"hidden",children:g.children};return(M&1)===0&&l.child!==b?(g=l.child,g.childLanes=0,g.pendingProps=B,l.deletions=null):(g=Do(b,B),g.subtreeFlags=b.subtreeFlags&14680064),V!==null?C=Do(V,C):(C=Da(C,M,d,null),C.flags|=2),C.return=l,g.return=l,g.sibling=C,l.child=g,g=C,C=l.child,M=o.child.memoizedState,M=M===null?$g(d):{baseLanes:M.baseLanes|d,cachePool:null,transitions:M.transitions},C.memoizedState=M,C.childLanes=o.childLanes&~d,l.memoizedState=Vg,g}return C=o.child,o=C.sibling,g=Do(C,{mode:"visible",children:g.children}),(l.mode&1)===0&&(g.lanes=d),g.return=l,g.sibling=null,o!==null&&(d=l.deletions,d===null?(l.deletions=[o],l.flags|=16):d.push(o)),l.child=g,l.memoizedState=null,g}function Hg(o,l){return l=Nh({mode:"visible",children:l},o.mode,0,null),l.return=o,o.child=l}function bh(o,l,d,g){return g!==null&&pg(g),Kl(l,o.child,null,d),o=Hg(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function eO(o,l,d,g,b,C,M){if(d)return l.flags&256?(l.flags&=-257,g=Ng(Error(n(422))),bh(o,l,M,g)):l.memoizedState!==null?(l.child=o.child,l.flags|=128,null):(C=g.fallback,b=l.mode,g=Nh({mode:"visible",children:g.children},b,0,null),C=Da(C,b,M,null),C.flags|=2,g.return=l,C.return=l,g.sibling=C,l.child=g,(l.mode&1)!==0&&Kl(l,o.child,null,M),l.child.memoizedState=$g(M),l.memoizedState=Vg,C);if((l.mode&1)===0)return bh(o,l,M,null);if(b.data==="$!"){if(g=b.nextSibling&&b.nextSibling.dataset,g)var V=g.dgst;return g=V,C=Error(n(419)),g=Ng(C,g,void 0),bh(o,l,M,g)}if(V=(M&o.childLanes)!==0,vr||V){if(g=Sn,g!==null){switch(M&-M){case 4:b=2;break;case 16:b=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:b=32;break;case 536870912:b=268435456;break;default:b=0}b=(b&(g.suspendedLanes|M))!==0?0:b,b!==0&&b!==C.retryLane&&(C.retryLane=b,Mi(o,b),Ms(g,o,b,-1))}return rv(),g=Ng(Error(n(421))),bh(o,l,M,g)}return b.data==="$?"?(l.flags|=128,l.child=o.child,l=hO.bind(null,o),b._reactRetry=l,null):(o=C.treeContext,$r=Co(b.nextSibling),Vr=l,$t=!0,Ts=null,o!==null&&(ss[is++]=Ai,ss[is++]=Ii,ss[is++]=Pa,Ai=o.id,Ii=o.overflow,Pa=l),l=Hg(l,g.children),l.flags|=4096,l)}function _S(o,l,d){o.lanes|=l;var g=o.alternate;g!==null&&(g.lanes|=l),yg(o.return,l,d)}function zg(o,l,d,g,b){var C=o.memoizedState;C===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:g,tail:d,tailMode:b}:(C.isBackwards=l,C.rendering=null,C.renderingStartTime=0,C.last=g,C.tail=d,C.tailMode=b)}function xS(o,l,d){var g=l.pendingProps,b=g.revealOrder,C=g.tail;if(nr(o,l,g.children,d),g=Bt.current,(g&2)!==0)g=g&1|2,l.flags|=128;else{if(o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&_S(o,d,l);else if(o.tag===19)_S(o,d,l);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}g&=1}if(Tt(Bt,g),(l.mode&1)===0)l.memoizedState=null;else switch(b){case"forwards":for(d=l.child,b=null;d!==null;)o=d.alternate,o!==null&&mh(o)===null&&(b=d),d=d.sibling;d=b,d===null?(b=l.child,l.child=null):(b=d.sibling,d.sibling=null),zg(l,!1,b,d,C);break;case"backwards":for(d=null,b=l.child,l.child=null;b!==null;){if(o=b.alternate,o!==null&&mh(o)===null){l.child=b;break}o=b.sibling,b.sibling=d,d=b,b=o}zg(l,!0,d,null,C);break;case"together":zg(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Sh(o,l){(l.mode&1)===0&&o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2)}function Li(o,l,d){if(o!==null&&(l.dependencies=o.dependencies),Ma|=l.lanes,(d&l.childLanes)===0)return null;if(o!==null&&l.child!==o.child)throw Error(n(153));if(l.child!==null){for(o=l.child,d=Do(o,o.pendingProps),l.child=d,d.return=l;o.sibling!==null;)o=o.sibling,d=d.sibling=Do(o,o.pendingProps),d.return=l;d.sibling=null}return l.child}function tO(o,l,d){switch(l.tag){case 3:gS(l),Gl();break;case 5:Lb(l);break;case 1:gr(l.type)&&ih(l);break;case 4:wg(l,l.stateNode.containerInfo);break;case 10:var g=l.type._context,b=l.memoizedProps.value;Tt(dh,g._currentValue),g._currentValue=b;break;case 13:if(g=l.memoizedState,g!==null)return g.dehydrated!==null?(Tt(Bt,Bt.current&1),l.flags|=128,null):(d&l.child.childLanes)!==0?yS(o,l,d):(Tt(Bt,Bt.current&1),o=Li(o,l,d),o!==null?o.sibling:null);Tt(Bt,Bt.current&1);break;case 19:if(g=(d&l.childLanes)!==0,(o.flags&128)!==0){if(g)return xS(o,l,d);l.flags|=128}if(b=l.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),Tt(Bt,Bt.current),g)break;return null;case 22:case 23:return l.lanes=0,hS(o,l,d)}return Li(o,l,d)}var wS,Ug,bS,SS;wS=function(o,l){for(var d=l.child;d!==null;){if(d.tag===5||d.tag===6)o.appendChild(d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},Ug=function(){},bS=function(o,l,d,g){var b=o.memoizedProps;if(b!==g){o=l.stateNode,Aa(Qs.current);var C=null;switch(d){case"input":b=ut(o,b),g=ut(o,g),C=[];break;case"select":b=z({},b,{value:void 0}),g=z({},g,{value:void 0}),C=[];break;case"textarea":b=Xe(o,b),g=Xe(o,g),C=[];break;default:typeof b.onClick!="function"&&typeof g.onClick=="function"&&(o.onclick=nh)}bs(d,g);var M;d=null;for(re in b)if(!g.hasOwnProperty(re)&&b.hasOwnProperty(re)&&b[re]!=null)if(re==="style"){var V=b[re];for(M in V)V.hasOwnProperty(M)&&(d||(d={}),d[M]="")}else re!=="dangerouslySetInnerHTML"&&re!=="children"&&re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&re!=="autoFocus"&&(s.hasOwnProperty(re)?C||(C=[]):(C=C||[]).push(re,null));for(re in g){var B=g[re];if(V=b!=null?b[re]:void 0,g.hasOwnProperty(re)&&B!==V&&(B!=null||V!=null))if(re==="style")if(V){for(M in V)!V.hasOwnProperty(M)||B&&B.hasOwnProperty(M)||(d||(d={}),d[M]="");for(M in B)B.hasOwnProperty(M)&&V[M]!==B[M]&&(d||(d={}),d[M]=B[M])}else d||(C||(C=[]),C.push(re,d)),d=B;else re==="dangerouslySetInnerHTML"?(B=B?B.__html:void 0,V=V?V.__html:void 0,B!=null&&V!==B&&(C=C||[]).push(re,B)):re==="children"?typeof B!="string"&&typeof B!="number"||(C=C||[]).push(re,""+B):re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&(s.hasOwnProperty(re)?(B!=null&&re==="onScroll"&&Mt("scroll",o),C||V===B||(C=[])):(C=C||[]).push(re,B))}d&&(C=C||[]).push("style",d);var re=C;(l.updateQueue=re)&&(l.flags|=4)}},SS=function(o,l,d,g){d!==g&&(l.flags|=4)};function Gu(o,l){if(!$t)switch(o.tailMode){case"hidden":l=o.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?o.tail=null:d.sibling=null;break;case"collapsed":d=o.tail;for(var g=null;d!==null;)d.alternate!==null&&(g=d),d=d.sibling;g===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:g.sibling=null}}function Wn(o){var l=o.alternate!==null&&o.alternate.child===o.child,d=0,g=0;if(l)for(var b=o.child;b!==null;)d|=b.lanes|b.childLanes,g|=b.subtreeFlags&14680064,g|=b.flags&14680064,b.return=o,b=b.sibling;else for(b=o.child;b!==null;)d|=b.lanes|b.childLanes,g|=b.subtreeFlags,g|=b.flags,b.return=o,b=b.sibling;return o.subtreeFlags|=g,o.childLanes=d,l}function nO(o,l,d){var g=l.pendingProps;switch(dg(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wn(l),null;case 1:return gr(l.type)&&sh(),Wn(l),null;case 3:return g=l.stateNode,Yl(),Ot(mr),Ot(Un),Eg(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(o===null||o.child===null)&&(ch(l)?l.flags|=4:o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Ts!==null&&(ev(Ts),Ts=null))),Ug(o,l),Wn(l),null;case 5:bg(l);var b=Aa(Hu.current);if(d=l.type,o!==null&&l.stateNode!=null)bS(o,l,d,g,b),o.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!g){if(l.stateNode===null)throw Error(n(166));return Wn(l),null}if(o=Aa(Qs.current),ch(l)){g=l.stateNode,d=l.type;var C=l.memoizedProps;switch(g[Xs]=l,g[Du]=C,o=(l.mode&1)!==0,d){case"dialog":Mt("cancel",g),Mt("close",g);break;case"iframe":case"object":case"embed":Mt("load",g);break;case"video":case"audio":for(b=0;b<Ou.length;b++)Mt(Ou[b],g);break;case"source":Mt("error",g);break;case"img":case"image":case"link":Mt("error",g),Mt("load",g);break;case"details":Mt("toggle",g);break;case"input":kt(g,C),Mt("invalid",g);break;case"select":g._wrapperState={wasMultiple:!!C.multiple},Mt("invalid",g);break;case"textarea":At(g,C),Mt("invalid",g)}bs(d,C),b=null;for(var M in C)if(C.hasOwnProperty(M)){var V=C[M];M==="children"?typeof V=="string"?g.textContent!==V&&(C.suppressHydrationWarning!==!0&&th(g.textContent,V,o),b=["children",V]):typeof V=="number"&&g.textContent!==""+V&&(C.suppressHydrationWarning!==!0&&th(g.textContent,V,o),b=["children",""+V]):s.hasOwnProperty(M)&&V!=null&&M==="onScroll"&&Mt("scroll",g)}switch(d){case"input":De(g),ze(g,C,!0);break;case"textarea":De(g),An(g);break;case"select":case"option":break;default:typeof C.onClick=="function"&&(g.onclick=nh)}g=b,l.updateQueue=g,g!==null&&(l.flags|=4)}else{M=b.nodeType===9?b:b.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=ws(d)),o==="http://www.w3.org/1999/xhtml"?d==="script"?(o=M.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof g.is=="string"?o=M.createElement(d,{is:g.is}):(o=M.createElement(d),d==="select"&&(M=o,g.multiple?M.multiple=!0:g.size&&(M.size=g.size))):o=M.createElementNS(o,d),o[Xs]=l,o[Du]=g,wS(o,l,!1,!1),l.stateNode=o;e:{switch(M=Gs(d,g),d){case"dialog":Mt("cancel",o),Mt("close",o),b=g;break;case"iframe":case"object":case"embed":Mt("load",o),b=g;break;case"video":case"audio":for(b=0;b<Ou.length;b++)Mt(Ou[b],o);b=g;break;case"source":Mt("error",o),b=g;break;case"img":case"image":case"link":Mt("error",o),Mt("load",o),b=g;break;case"details":Mt("toggle",o),b=g;break;case"input":kt(o,g),b=ut(o,g),Mt("invalid",o);break;case"option":b=g;break;case"select":o._wrapperState={wasMultiple:!!g.multiple},b=z({},g,{value:void 0}),Mt("invalid",o);break;case"textarea":At(o,g),b=Xe(o,g),Mt("invalid",o);break;default:b=g}bs(d,b),V=b;for(C in V)if(V.hasOwnProperty(C)){var B=V[C];C==="style"?Si(o,B):C==="dangerouslySetInnerHTML"?(B=B?B.__html:void 0,B!=null&&Jn(o,B)):C==="children"?typeof B=="string"?(d!=="textarea"||B!=="")&&wn(o,B):typeof B=="number"&&wn(o,""+B):C!=="suppressContentEditableWarning"&&C!=="suppressHydrationWarning"&&C!=="autoFocus"&&(s.hasOwnProperty(C)?B!=null&&C==="onScroll"&&Mt("scroll",o):B!=null&&P(o,C,B,M))}switch(d){case"input":De(o),ze(o,g,!1);break;case"textarea":De(o),An(o);break;case"option":g.value!=null&&o.setAttribute("value",""+ae(g.value));break;case"select":o.multiple=!!g.multiple,C=g.value,C!=null?tt(o,!!g.multiple,C,!1):g.defaultValue!=null&&tt(o,!!g.multiple,g.defaultValue,!0);break;default:typeof b.onClick=="function"&&(o.onclick=nh)}switch(d){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}}g&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return Wn(l),null;case 6:if(o&&l.stateNode!=null)SS(o,l,o.memoizedProps,g);else{if(typeof g!="string"&&l.stateNode===null)throw Error(n(166));if(d=Aa(Hu.current),Aa(Qs.current),ch(l)){if(g=l.stateNode,d=l.memoizedProps,g[Xs]=l,(C=g.nodeValue!==d)&&(o=Vr,o!==null))switch(o.tag){case 3:th(g.nodeValue,d,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&th(g.nodeValue,d,(o.mode&1)!==0)}C&&(l.flags|=4)}else g=(d.nodeType===9?d:d.ownerDocument).createTextNode(g),g[Xs]=l,l.stateNode=g}return Wn(l),null;case 13:if(Ot(Bt),g=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if($t&&$r!==null&&(l.mode&1)!==0&&(l.flags&128)===0)kb(),Gl(),l.flags|=98560,C=!1;else if(C=ch(l),g!==null&&g.dehydrated!==null){if(o===null){if(!C)throw Error(n(318));if(C=l.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(n(317));C[Xs]=l}else Gl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Wn(l),C=!1}else Ts!==null&&(ev(Ts),Ts=null),C=!0;if(!C)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=d,l):(g=g!==null,g!==(o!==null&&o.memoizedState!==null)&&g&&(l.child.flags|=8192,(l.mode&1)!==0&&(o===null||(Bt.current&1)!==0?yn===0&&(yn=3):rv())),l.updateQueue!==null&&(l.flags|=4),Wn(l),null);case 4:return Yl(),Ug(o,l),o===null&&Lu(l.stateNode.containerInfo),Wn(l),null;case 10:return vg(l.type._context),Wn(l),null;case 17:return gr(l.type)&&sh(),Wn(l),null;case 19:if(Ot(Bt),C=l.memoizedState,C===null)return Wn(l),null;if(g=(l.flags&128)!==0,M=C.rendering,M===null)if(g)Gu(C,!1);else{if(yn!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(M=mh(o),M!==null){for(l.flags|=128,Gu(C,!1),g=M.updateQueue,g!==null&&(l.updateQueue=g,l.flags|=4),l.subtreeFlags=0,g=d,d=l.child;d!==null;)C=d,o=g,C.flags&=14680066,M=C.alternate,M===null?(C.childLanes=0,C.lanes=o,C.child=null,C.subtreeFlags=0,C.memoizedProps=null,C.memoizedState=null,C.updateQueue=null,C.dependencies=null,C.stateNode=null):(C.childLanes=M.childLanes,C.lanes=M.lanes,C.child=M.child,C.subtreeFlags=0,C.deletions=null,C.memoizedProps=M.memoizedProps,C.memoizedState=M.memoizedState,C.updateQueue=M.updateQueue,C.type=M.type,o=M.dependencies,C.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),d=d.sibling;return Tt(Bt,Bt.current&1|2),l.child}o=o.sibling}C.tail!==null&&Vt()>ec&&(l.flags|=128,g=!0,Gu(C,!1),l.lanes=4194304)}else{if(!g)if(o=mh(M),o!==null){if(l.flags|=128,g=!0,d=o.updateQueue,d!==null&&(l.updateQueue=d,l.flags|=4),Gu(C,!0),C.tail===null&&C.tailMode==="hidden"&&!M.alternate&&!$t)return Wn(l),null}else 2*Vt()-C.renderingStartTime>ec&&d!==1073741824&&(l.flags|=128,g=!0,Gu(C,!1),l.lanes=4194304);C.isBackwards?(M.sibling=l.child,l.child=M):(d=C.last,d!==null?d.sibling=M:l.child=M,C.last=M)}return C.tail!==null?(l=C.tail,C.rendering=l,C.tail=l.sibling,C.renderingStartTime=Vt(),l.sibling=null,d=Bt.current,Tt(Bt,g?d&1|2:d&1),l):(Wn(l),null);case 22:case 23:return nv(),g=l.memoizedState!==null,o!==null&&o.memoizedState!==null!==g&&(l.flags|=8192),g&&(l.mode&1)!==0?(Hr&1073741824)!==0&&(Wn(l),l.subtreeFlags&6&&(l.flags|=8192)):Wn(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function rO(o,l){switch(dg(l),l.tag){case 1:return gr(l.type)&&sh(),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return Yl(),Ot(mr),Ot(Un),Eg(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 5:return bg(l),null;case 13:if(Ot(Bt),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(n(340));Gl()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return Ot(Bt),null;case 4:return Yl(),null;case 10:return vg(l.type._context),null;case 22:case 23:return nv(),null;case 24:return null;default:return null}}var Eh=!1,Gn=!1,sO=typeof WeakSet=="function"?WeakSet:Set,Ie=null;function Ql(o,l){var d=o.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(g){Yt(o,l,g)}else d.current=null}function Bg(o,l,d){try{d()}catch(g){Yt(o,l,g)}}var ES=!1;function iO(o,l){if(ng=Bf,o=nb(),Z0(o)){if("selectionStart"in o)var d={start:o.selectionStart,end:o.selectionEnd};else e:{d=(d=o.ownerDocument)&&d.defaultView||window;var g=d.getSelection&&d.getSelection();if(g&&g.rangeCount!==0){d=g.anchorNode;var b=g.anchorOffset,C=g.focusNode;g=g.focusOffset;try{d.nodeType,C.nodeType}catch{d=null;break e}var M=0,V=-1,B=-1,re=0,fe=0,pe=o,de=null;t:for(;;){for(var Te;pe!==d||b!==0&&pe.nodeType!==3||(V=M+b),pe!==C||g!==0&&pe.nodeType!==3||(B=M+g),pe.nodeType===3&&(M+=pe.nodeValue.length),(Te=pe.firstChild)!==null;)de=pe,pe=Te;for(;;){if(pe===o)break t;if(de===d&&++re===b&&(V=M),de===C&&++fe===g&&(B=M),(Te=pe.nextSibling)!==null)break;pe=de,de=pe.parentNode}pe=Te}d=V===-1||B===-1?null:{start:V,end:B}}else d=null}d=d||{start:0,end:0}}else d=null;for(rg={focusedElem:o,selectionRange:d},Bf=!1,Ie=l;Ie!==null;)if(l=Ie,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Ie=o;else for(;Ie!==null;){l=Ie;try{var Oe=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(Oe!==null){var Ne=Oe.memoizedProps,sn=Oe.memoizedState,Q=l.stateNode,Z=Q.getSnapshotBeforeUpdate(l.elementType===l.type?Ne:Rs(l.type,Ne),sn);Q.__reactInternalSnapshotBeforeUpdate=Z}break;case 3:var J=l.stateNode.containerInfo;J.nodeType===1?J.textContent="":J.nodeType===9&&J.documentElement&&J.removeChild(J.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ye){Yt(l,l.return,ye)}if(o=l.sibling,o!==null){o.return=l.return,Ie=o;break}Ie=l.return}return Oe=ES,ES=!1,Oe}function Ku(o,l,d){var g=l.updateQueue;if(g=g!==null?g.lastEffect:null,g!==null){var b=g=g.next;do{if((b.tag&o)===o){var C=b.destroy;b.destroy=void 0,C!==void 0&&Bg(l,d,C)}b=b.next}while(b!==g)}}function Ch(o,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var d=l=l.next;do{if((d.tag&o)===o){var g=d.create;d.destroy=g()}d=d.next}while(d!==l)}}function Wg(o){var l=o.ref;if(l!==null){var d=o.stateNode;switch(o.tag){case 5:o=d;break;default:o=d}typeof l=="function"?l(o):l.current=o}}function CS(o){var l=o.alternate;l!==null&&(o.alternate=null,CS(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&(delete l[Xs],delete l[Du],delete l[ag],delete l[HM],delete l[zM])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function kS(o){return o.tag===5||o.tag===3||o.tag===4}function PS(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||kS(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Gg(o,l,d){var g=o.tag;if(g===5||g===6)o=o.stateNode,l?d.nodeType===8?d.parentNode.insertBefore(o,l):d.insertBefore(o,l):(d.nodeType===8?(l=d.parentNode,l.insertBefore(o,d)):(l=d,l.appendChild(o)),d=d._reactRootContainer,d!=null||l.onclick!==null||(l.onclick=nh));else if(g!==4&&(o=o.child,o!==null))for(Gg(o,l,d),o=o.sibling;o!==null;)Gg(o,l,d),o=o.sibling}function Kg(o,l,d){var g=o.tag;if(g===5||g===6)o=o.stateNode,l?d.insertBefore(o,l):d.appendChild(o);else if(g!==4&&(o=o.child,o!==null))for(Kg(o,l,d),o=o.sibling;o!==null;)Kg(o,l,d),o=o.sibling}var Mn=null,As=!1;function Io(o,l,d){for(d=d.child;d!==null;)TS(o,l,d),d=d.sibling}function TS(o,l,d){if(jr&&typeof jr.onCommitFiberUnmount=="function")try{jr.onCommitFiberUnmount(Ea,d)}catch{}switch(d.tag){case 5:Gn||Ql(d,l);case 6:var g=Mn,b=As;Mn=null,Io(o,l,d),Mn=g,As=b,Mn!==null&&(As?(o=Mn,d=d.stateNode,o.nodeType===8?o.parentNode.removeChild(d):o.removeChild(d)):Mn.removeChild(d.stateNode));break;case 18:Mn!==null&&(As?(o=Mn,d=d.stateNode,o.nodeType===8?og(o.parentNode,d):o.nodeType===1&&og(o,d),Cu(o)):og(Mn,d.stateNode));break;case 4:g=Mn,b=As,Mn=d.stateNode.containerInfo,As=!0,Io(o,l,d),Mn=g,As=b;break;case 0:case 11:case 14:case 15:if(!Gn&&(g=d.updateQueue,g!==null&&(g=g.lastEffect,g!==null))){b=g=g.next;do{var C=b,M=C.destroy;C=C.tag,M!==void 0&&((C&2)!==0||(C&4)!==0)&&Bg(d,l,M),b=b.next}while(b!==g)}Io(o,l,d);break;case 1:if(!Gn&&(Ql(d,l),g=d.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=d.memoizedProps,g.state=d.memoizedState,g.componentWillUnmount()}catch(V){Yt(d,l,V)}Io(o,l,d);break;case 21:Io(o,l,d);break;case 22:d.mode&1?(Gn=(g=Gn)||d.memoizedState!==null,Io(o,l,d),Gn=g):Io(o,l,d);break;default:Io(o,l,d)}}function RS(o){var l=o.updateQueue;if(l!==null){o.updateQueue=null;var d=o.stateNode;d===null&&(d=o.stateNode=new sO),l.forEach(function(g){var b=pO.bind(null,o,g);d.has(g)||(d.add(g),g.then(b,b))})}}function Is(o,l){var d=l.deletions;if(d!==null)for(var g=0;g<d.length;g++){var b=d[g];try{var C=o,M=l,V=M;e:for(;V!==null;){switch(V.tag){case 5:Mn=V.stateNode,As=!1;break e;case 3:Mn=V.stateNode.containerInfo,As=!0;break e;case 4:Mn=V.stateNode.containerInfo,As=!0;break e}V=V.return}if(Mn===null)throw Error(n(160));TS(C,M,b),Mn=null,As=!1;var B=b.alternate;B!==null&&(B.return=null),b.return=null}catch(re){Yt(b,l,re)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)AS(l,o),l=l.sibling}function AS(o,l){var d=o.alternate,g=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(Is(l,o),ei(o),g&4){try{Ku(3,o,o.return),Ch(3,o)}catch(Ne){Yt(o,o.return,Ne)}try{Ku(5,o,o.return)}catch(Ne){Yt(o,o.return,Ne)}}break;case 1:Is(l,o),ei(o),g&512&&d!==null&&Ql(d,d.return);break;case 5:if(Is(l,o),ei(o),g&512&&d!==null&&Ql(d,d.return),o.flags&32){var b=o.stateNode;try{wn(b,"")}catch(Ne){Yt(o,o.return,Ne)}}if(g&4&&(b=o.stateNode,b!=null)){var C=o.memoizedProps,M=d!==null?d.memoizedProps:C,V=o.type,B=o.updateQueue;if(o.updateQueue=null,B!==null)try{V==="input"&&C.type==="radio"&&C.name!=null&&we(b,C),Gs(V,M);var re=Gs(V,C);for(M=0;M<B.length;M+=2){var fe=B[M],pe=B[M+1];fe==="style"?Si(b,pe):fe==="dangerouslySetInnerHTML"?Jn(b,pe):fe==="children"?wn(b,pe):P(b,fe,pe,re)}switch(V){case"input":je(b,C);break;case"textarea":Qn(b,C);break;case"select":var de=b._wrapperState.wasMultiple;b._wrapperState.wasMultiple=!!C.multiple;var Te=C.value;Te!=null?tt(b,!!C.multiple,Te,!1):de!==!!C.multiple&&(C.defaultValue!=null?tt(b,!!C.multiple,C.defaultValue,!0):tt(b,!!C.multiple,C.multiple?[]:"",!1))}b[Du]=C}catch(Ne){Yt(o,o.return,Ne)}}break;case 6:if(Is(l,o),ei(o),g&4){if(o.stateNode===null)throw Error(n(162));b=o.stateNode,C=o.memoizedProps;try{b.nodeValue=C}catch(Ne){Yt(o,o.return,Ne)}}break;case 3:if(Is(l,o),ei(o),g&4&&d!==null&&d.memoizedState.isDehydrated)try{Cu(l.containerInfo)}catch(Ne){Yt(o,o.return,Ne)}break;case 4:Is(l,o),ei(o);break;case 13:Is(l,o),ei(o),b=o.child,b.flags&8192&&(C=b.memoizedState!==null,b.stateNode.isHidden=C,!C||b.alternate!==null&&b.alternate.memoizedState!==null||(Yg=Vt())),g&4&&RS(o);break;case 22:if(fe=d!==null&&d.memoizedState!==null,o.mode&1?(Gn=(re=Gn)||fe,Is(l,o),Gn=re):Is(l,o),ei(o),g&8192){if(re=o.memoizedState!==null,(o.stateNode.isHidden=re)&&!fe&&(o.mode&1)!==0)for(Ie=o,fe=o.child;fe!==null;){for(pe=Ie=fe;Ie!==null;){switch(de=Ie,Te=de.child,de.tag){case 0:case 11:case 14:case 15:Ku(4,de,de.return);break;case 1:Ql(de,de.return);var Oe=de.stateNode;if(typeof Oe.componentWillUnmount=="function"){g=de,d=de.return;try{l=g,Oe.props=l.memoizedProps,Oe.state=l.memoizedState,Oe.componentWillUnmount()}catch(Ne){Yt(g,d,Ne)}}break;case 5:Ql(de,de.return);break;case 22:if(de.memoizedState!==null){OS(pe);continue}}Te!==null?(Te.return=de,Ie=Te):OS(pe)}fe=fe.sibling}e:for(fe=null,pe=o;;){if(pe.tag===5){if(fe===null){fe=pe;try{b=pe.stateNode,re?(C=b.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none"):(V=pe.stateNode,B=pe.memoizedProps.style,M=B!=null&&B.hasOwnProperty("display")?B.display:null,V.style.display=In("display",M))}catch(Ne){Yt(o,o.return,Ne)}}}else if(pe.tag===6){if(fe===null)try{pe.stateNode.nodeValue=re?"":pe.memoizedProps}catch(Ne){Yt(o,o.return,Ne)}}else if((pe.tag!==22&&pe.tag!==23||pe.memoizedState===null||pe===o)&&pe.child!==null){pe.child.return=pe,pe=pe.child;continue}if(pe===o)break e;for(;pe.sibling===null;){if(pe.return===null||pe.return===o)break e;fe===pe&&(fe=null),pe=pe.return}fe===pe&&(fe=null),pe.sibling.return=pe.return,pe=pe.sibling}}break;case 19:Is(l,o),ei(o),g&4&&RS(o);break;case 21:break;default:Is(l,o),ei(o)}}function ei(o){var l=o.flags;if(l&2){try{e:{for(var d=o.return;d!==null;){if(kS(d)){var g=d;break e}d=d.return}throw Error(n(160))}switch(g.tag){case 5:var b=g.stateNode;g.flags&32&&(wn(b,""),g.flags&=-33);var C=PS(o);Kg(o,C,b);break;case 3:case 4:var M=g.stateNode.containerInfo,V=PS(o);Gg(o,V,M);break;default:throw Error(n(161))}}catch(B){Yt(o,o.return,B)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function oO(o,l,d){Ie=o,IS(o)}function IS(o,l,d){for(var g=(o.mode&1)!==0;Ie!==null;){var b=Ie,C=b.child;if(b.tag===22&&g){var M=b.memoizedState!==null||Eh;if(!M){var V=b.alternate,B=V!==null&&V.memoizedState!==null||Gn;V=Eh;var re=Gn;if(Eh=M,(Gn=B)&&!re)for(Ie=b;Ie!==null;)M=Ie,B=M.child,M.tag===22&&M.memoizedState!==null?LS(b):B!==null?(B.return=M,Ie=B):LS(b);for(;C!==null;)Ie=C,IS(C),C=C.sibling;Ie=b,Eh=V,Gn=re}MS(o)}else(b.subtreeFlags&8772)!==0&&C!==null?(C.return=b,Ie=C):MS(o)}}function MS(o){for(;Ie!==null;){var l=Ie;if((l.flags&8772)!==0){var d=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:Gn||Ch(5,l);break;case 1:var g=l.stateNode;if(l.flags&4&&!Gn)if(d===null)g.componentDidMount();else{var b=l.elementType===l.type?d.memoizedProps:Rs(l.type,d.memoizedProps);g.componentDidUpdate(b,d.memoizedState,g.__reactInternalSnapshotBeforeUpdate)}var C=l.updateQueue;C!==null&&Ob(l,C,g);break;case 3:var M=l.updateQueue;if(M!==null){if(d=null,l.child!==null)switch(l.child.tag){case 5:d=l.child.stateNode;break;case 1:d=l.child.stateNode}Ob(l,M,d)}break;case 5:var V=l.stateNode;if(d===null&&l.flags&4){d=V;var B=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":B.autoFocus&&d.focus();break;case"img":B.src&&(d.src=B.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var re=l.alternate;if(re!==null){var fe=re.memoizedState;if(fe!==null){var pe=fe.dehydrated;pe!==null&&Cu(pe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Gn||l.flags&512&&Wg(l)}catch(de){Yt(l,l.return,de)}}if(l===o){Ie=null;break}if(d=l.sibling,d!==null){d.return=l.return,Ie=d;break}Ie=l.return}}function OS(o){for(;Ie!==null;){var l=Ie;if(l===o){Ie=null;break}var d=l.sibling;if(d!==null){d.return=l.return,Ie=d;break}Ie=l.return}}function LS(o){for(;Ie!==null;){var l=Ie;try{switch(l.tag){case 0:case 11:case 15:var d=l.return;try{Ch(4,l)}catch(B){Yt(l,d,B)}break;case 1:var g=l.stateNode;if(typeof g.componentDidMount=="function"){var b=l.return;try{g.componentDidMount()}catch(B){Yt(l,b,B)}}var C=l.return;try{Wg(l)}catch(B){Yt(l,C,B)}break;case 5:var M=l.return;try{Wg(l)}catch(B){Yt(l,M,B)}}}catch(B){Yt(l,l.return,B)}if(l===o){Ie=null;break}var V=l.sibling;if(V!==null){V.return=l.return,Ie=V;break}Ie=l.return}}var aO=Math.ceil,kh=k.ReactCurrentDispatcher,Zg=k.ReactCurrentOwner,ls=k.ReactCurrentBatchConfig,dt=0,Sn=null,dn=null,On=0,Hr=0,Jl=ko(0),yn=0,Zu=null,Ma=0,Ph=0,qg=0,qu=null,yr=null,Yg=0,ec=1/0,Ni=null,Th=!1,Xg=null,Mo=null,Rh=!1,Oo=null,Ah=0,Yu=0,Qg=null,Ih=-1,Mh=0;function rr(){return(dt&6)!==0?Vt():Ih!==-1?Ih:Ih=Vt()}function Lo(o){return(o.mode&1)===0?1:(dt&2)!==0&&On!==0?On&-On:BM.transition!==null?(Mh===0&&(Mh=Cs()),Mh):(o=vt,o!==0||(o=window.event,o=o===void 0?16:Dw(o.type)),o)}function Ms(o,l,d,g){if(50<Yu)throw Yu=0,Qg=null,Error(n(185));rn(o,d,g),((dt&2)===0||o!==Sn)&&(o===Sn&&((dt&2)===0&&(Ph|=d),yn===4&&No(o,On)),_r(o,g),d===1&&dt===0&&(l.mode&1)===0&&(ec=Vt()+500,oh&&To()))}function _r(o,l){var d=o.callbackNode;pr(o,l);var g=Ee(o,o===Sn?On:0);if(g===0)d!==null&&$f(d),o.callbackNode=null,o.callbackPriority=0;else if(l=g&-g,o.callbackPriority!==l){if(d!=null&&$f(d),l===1)o.tag===0?UM(DS.bind(null,o)):wb(DS.bind(null,o)),VM(function(){(dt&6)===0&&To()}),d=null;else{switch(Tw(g)){case 1:d=vu;break;case 4:d=yu;break;case 16:d=Pi;break;case 536870912:d=xu;break;default:d=Pi}d=BS(d,NS.bind(null,o))}o.callbackPriority=l,o.callbackNode=d}}function NS(o,l){if(Ih=-1,Mh=0,(dt&6)!==0)throw Error(n(327));var d=o.callbackNode;if(tc()&&o.callbackNode!==d)return null;var g=Ee(o,o===Sn?On:0);if(g===0)return null;if((g&30)!==0||(g&o.expiredLanes)!==0||l)l=Oh(o,g);else{l=g;var b=dt;dt|=2;var C=FS();(Sn!==o||On!==l)&&(Ni=null,ec=Vt()+500,La(o,l));do try{uO();break}catch(V){jS(o,V)}while(!0);gg(),kh.current=C,dt=b,dn!==null?l=0:(Sn=null,On=0,l=yn)}if(l!==0){if(l===2&&(b=ns(o),b!==0&&(g=b,l=Jg(o,b))),l===1)throw d=Zu,La(o,0),No(o,g),_r(o,Vt()),d;if(l===6)No(o,g);else{if(b=o.current.alternate,(g&30)===0&&!lO(b)&&(l=Oh(o,g),l===2&&(C=ns(o),C!==0&&(g=C,l=Jg(o,C))),l===1))throw d=Zu,La(o,0),No(o,g),_r(o,Vt()),d;switch(o.finishedWork=b,o.finishedLanes=g,l){case 0:case 1:throw Error(n(345));case 2:Na(o,yr,Ni);break;case 3:if(No(o,g),(g&130023424)===g&&(l=Yg+500-Vt(),10<l)){if(Ee(o,0)!==0)break;if(b=o.suspendedLanes,(b&g)!==g){rr(),o.pingedLanes|=o.suspendedLanes&b;break}o.timeoutHandle=ig(Na.bind(null,o,yr,Ni),l);break}Na(o,yr,Ni);break;case 4:if(No(o,g),(g&4194240)===g)break;for(l=o.eventTimes,b=-1;0<g;){var M=31-H(g);C=1<<M,M=l[M],M>b&&(b=M),g&=~C}if(g=b,g=Vt()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*aO(g/1960))-g,10<g){o.timeoutHandle=ig(Na.bind(null,o,yr,Ni),g);break}Na(o,yr,Ni);break;case 5:Na(o,yr,Ni);break;default:throw Error(n(329))}}}return _r(o,Vt()),o.callbackNode===d?NS.bind(null,o):null}function Jg(o,l){var d=qu;return o.current.memoizedState.isDehydrated&&(La(o,l).flags|=256),o=Oh(o,l),o!==2&&(l=yr,yr=d,l!==null&&ev(l)),o}function ev(o){yr===null?yr=o:yr.push.apply(yr,o)}function lO(o){for(var l=o;;){if(l.flags&16384){var d=l.updateQueue;if(d!==null&&(d=d.stores,d!==null))for(var g=0;g<d.length;g++){var b=d[g],C=b.getSnapshot;b=b.value;try{if(!Ps(C(),b))return!1}catch{return!1}}}if(d=l.child,l.subtreeFlags&16384&&d!==null)d.return=l,l=d;else{if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function No(o,l){for(l&=~qg,l&=~Ph,o.suspendedLanes|=l,o.pingedLanes&=~l,o=o.expirationTimes;0<l;){var d=31-H(l),g=1<<d;o[d]=-1,l&=~g}}function DS(o){if((dt&6)!==0)throw Error(n(327));tc();var l=Ee(o,0);if((l&1)===0)return _r(o,Vt()),null;var d=Oh(o,l);if(o.tag!==0&&d===2){var g=ns(o);g!==0&&(l=g,d=Jg(o,g))}if(d===1)throw d=Zu,La(o,0),No(o,l),_r(o,Vt()),d;if(d===6)throw Error(n(345));return o.finishedWork=o.current.alternate,o.finishedLanes=l,Na(o,yr,Ni),_r(o,Vt()),null}function tv(o,l){var d=dt;dt|=1;try{return o(l)}finally{dt=d,dt===0&&(ec=Vt()+500,oh&&To())}}function Oa(o){Oo!==null&&Oo.tag===0&&(dt&6)===0&&tc();var l=dt;dt|=1;var d=ls.transition,g=vt;try{if(ls.transition=null,vt=1,o)return o()}finally{vt=g,ls.transition=d,dt=l,(dt&6)===0&&To()}}function nv(){Hr=Jl.current,Ot(Jl)}function La(o,l){o.finishedWork=null,o.finishedLanes=0;var d=o.timeoutHandle;if(d!==-1&&(o.timeoutHandle=-1,FM(d)),dn!==null)for(d=dn.return;d!==null;){var g=d;switch(dg(g),g.tag){case 1:g=g.type.childContextTypes,g!=null&&sh();break;case 3:Yl(),Ot(mr),Ot(Un),Eg();break;case 5:bg(g);break;case 4:Yl();break;case 13:Ot(Bt);break;case 19:Ot(Bt);break;case 10:vg(g.type._context);break;case 22:case 23:nv()}d=d.return}if(Sn=o,dn=o=Do(o.current,null),On=Hr=l,yn=0,Zu=null,qg=Ph=Ma=0,yr=qu=null,Ra!==null){for(l=0;l<Ra.length;l++)if(d=Ra[l],g=d.interleaved,g!==null){d.interleaved=null;var b=g.next,C=d.pending;if(C!==null){var M=C.next;C.next=b,g.next=M}d.pending=g}Ra=null}return o}function jS(o,l){do{var d=dn;try{if(gg(),gh.current=xh,vh){for(var g=Wt.memoizedState;g!==null;){var b=g.queue;b!==null&&(b.pending=null),g=g.next}vh=!1}if(Ia=0,bn=vn=Wt=null,zu=!1,Uu=0,Zg.current=null,d===null||d.return===null){yn=1,Zu=l,dn=null;break}e:{var C=o,M=d.return,V=d,B=l;if(l=On,V.flags|=32768,B!==null&&typeof B=="object"&&typeof B.then=="function"){var re=B,fe=V,pe=fe.tag;if((fe.mode&1)===0&&(pe===0||pe===11||pe===15)){var de=fe.alternate;de?(fe.updateQueue=de.updateQueue,fe.memoizedState=de.memoizedState,fe.lanes=de.lanes):(fe.updateQueue=null,fe.memoizedState=null)}var Te=lS(M);if(Te!==null){Te.flags&=-257,cS(Te,M,V,C,l),Te.mode&1&&aS(C,re,l),l=Te,B=re;var Oe=l.updateQueue;if(Oe===null){var Ne=new Set;Ne.add(B),l.updateQueue=Ne}else Oe.add(B);break e}else{if((l&1)===0){aS(C,re,l),rv();break e}B=Error(n(426))}}else if($t&&V.mode&1){var sn=lS(M);if(sn!==null){(sn.flags&65536)===0&&(sn.flags|=256),cS(sn,M,V,C,l),pg(Xl(B,V));break e}}C=B=Xl(B,V),yn!==4&&(yn=2),qu===null?qu=[C]:qu.push(C),C=M;do{switch(C.tag){case 3:C.flags|=65536,l&=-l,C.lanes|=l;var Q=iS(C,B,l);Mb(C,Q);break e;case 1:V=B;var Z=C.type,J=C.stateNode;if((C.flags&128)===0&&(typeof Z.getDerivedStateFromError=="function"||J!==null&&typeof J.componentDidCatch=="function"&&(Mo===null||!Mo.has(J)))){C.flags|=65536,l&=-l,C.lanes|=l;var ye=oS(C,V,l);Mb(C,ye);break e}}C=C.return}while(C!==null)}$S(d)}catch(Fe){l=Fe,dn===d&&d!==null&&(dn=d=d.return);continue}break}while(!0)}function FS(){var o=kh.current;return kh.current=xh,o===null?xh:o}function rv(){(yn===0||yn===3||yn===2)&&(yn=4),Sn===null||(Ma&268435455)===0&&(Ph&268435455)===0||No(Sn,On)}function Oh(o,l){var d=dt;dt|=2;var g=FS();(Sn!==o||On!==l)&&(Ni=null,La(o,l));do try{cO();break}catch(b){jS(o,b)}while(!0);if(gg(),dt=d,kh.current=g,dn!==null)throw Error(n(261));return Sn=null,On=0,yn}function cO(){for(;dn!==null;)VS(dn)}function uO(){for(;dn!==null&&!Pw();)VS(dn)}function VS(o){var l=US(o.alternate,o,Hr);o.memoizedProps=o.pendingProps,l===null?$S(o):dn=l,Zg.current=null}function $S(o){var l=o;do{var d=l.alternate;if(o=l.return,(l.flags&32768)===0){if(d=nO(d,l,Hr),d!==null){dn=d;return}}else{if(d=rO(d,l),d!==null){d.flags&=32767,dn=d;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{yn=6,dn=null;return}}if(l=l.sibling,l!==null){dn=l;return}dn=l=o}while(l!==null);yn===0&&(yn=5)}function Na(o,l,d){var g=vt,b=ls.transition;try{ls.transition=null,vt=1,dO(o,l,d,g)}finally{ls.transition=b,vt=g}return null}function dO(o,l,d,g){do tc();while(Oo!==null);if((dt&6)!==0)throw Error(n(327));d=o.finishedWork;var b=o.finishedLanes;if(d===null)return null;if(o.finishedWork=null,o.finishedLanes=0,d===o.current)throw Error(n(177));o.callbackNode=null,o.callbackPriority=0;var C=d.lanes|d.childLanes;if(Ys(o,C),o===Sn&&(dn=Sn=null,On=0),(d.subtreeFlags&2064)===0&&(d.flags&2064)===0||Rh||(Rh=!0,BS(Pi,function(){return tc(),null})),C=(d.flags&15990)!==0,(d.subtreeFlags&15990)!==0||C){C=ls.transition,ls.transition=null;var M=vt;vt=1;var V=dt;dt|=4,Zg.current=null,iO(o,d),AS(d,o),IM(rg),Bf=!!ng,rg=ng=null,o.current=d,oO(d),yo(),dt=V,vt=M,ls.transition=C}else o.current=d;if(Rh&&(Rh=!1,Oo=o,Ah=b),C=o.pendingLanes,C===0&&(Mo=null),Hf(d.stateNode),_r(o,Vt()),l!==null)for(g=o.onRecoverableError,d=0;d<l.length;d++)b=l[d],g(b.value,{componentStack:b.stack,digest:b.digest});if(Th)throw Th=!1,o=Xg,Xg=null,o;return(Ah&1)!==0&&o.tag!==0&&tc(),C=o.pendingLanes,(C&1)!==0?o===Qg?Yu++:(Yu=0,Qg=o):Yu=0,To(),null}function tc(){if(Oo!==null){var o=Tw(Ah),l=ls.transition,d=vt;try{if(ls.transition=null,vt=16>o?16:o,Oo===null)var g=!1;else{if(o=Oo,Oo=null,Ah=0,(dt&6)!==0)throw Error(n(331));var b=dt;for(dt|=4,Ie=o.current;Ie!==null;){var C=Ie,M=C.child;if((Ie.flags&16)!==0){var V=C.deletions;if(V!==null){for(var B=0;B<V.length;B++){var re=V[B];for(Ie=re;Ie!==null;){var fe=Ie;switch(fe.tag){case 0:case 11:case 15:Ku(8,fe,C)}var pe=fe.child;if(pe!==null)pe.return=fe,Ie=pe;else for(;Ie!==null;){fe=Ie;var de=fe.sibling,Te=fe.return;if(CS(fe),fe===re){Ie=null;break}if(de!==null){de.return=Te,Ie=de;break}Ie=Te}}}var Oe=C.alternate;if(Oe!==null){var Ne=Oe.child;if(Ne!==null){Oe.child=null;do{var sn=Ne.sibling;Ne.sibling=null,Ne=sn}while(Ne!==null)}}Ie=C}}if((C.subtreeFlags&2064)!==0&&M!==null)M.return=C,Ie=M;else e:for(;Ie!==null;){if(C=Ie,(C.flags&2048)!==0)switch(C.tag){case 0:case 11:case 15:Ku(9,C,C.return)}var Q=C.sibling;if(Q!==null){Q.return=C.return,Ie=Q;break e}Ie=C.return}}var Z=o.current;for(Ie=Z;Ie!==null;){M=Ie;var J=M.child;if((M.subtreeFlags&2064)!==0&&J!==null)J.return=M,Ie=J;else e:for(M=Z;Ie!==null;){if(V=Ie,(V.flags&2048)!==0)try{switch(V.tag){case 0:case 11:case 15:Ch(9,V)}}catch(Fe){Yt(V,V.return,Fe)}if(V===M){Ie=null;break e}var ye=V.sibling;if(ye!==null){ye.return=V.return,Ie=ye;break e}Ie=V.return}}if(dt=b,To(),jr&&typeof jr.onPostCommitFiberRoot=="function")try{jr.onPostCommitFiberRoot(Ea,o)}catch{}g=!0}return g}finally{vt=d,ls.transition=l}}return!1}function HS(o,l,d){l=Xl(d,l),l=iS(o,l,1),o=Ao(o,l,1),l=rr(),o!==null&&(rn(o,1,l),_r(o,l))}function Yt(o,l,d){if(o.tag===3)HS(o,o,d);else for(;l!==null;){if(l.tag===3){HS(l,o,d);break}else if(l.tag===1){var g=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Mo===null||!Mo.has(g))){o=Xl(d,o),o=oS(l,o,1),l=Ao(l,o,1),o=rr(),l!==null&&(rn(l,1,o),_r(l,o));break}}l=l.return}}function fO(o,l,d){var g=o.pingCache;g!==null&&g.delete(l),l=rr(),o.pingedLanes|=o.suspendedLanes&d,Sn===o&&(On&d)===d&&(yn===4||yn===3&&(On&130023424)===On&&500>Vt()-Yg?La(o,0):qg|=d),_r(o,l)}function zS(o,l){l===0&&((o.mode&1)===0?l=1:(l=Ce,Ce<<=1,(Ce&130023424)===0&&(Ce=4194304)));var d=rr();o=Mi(o,l),o!==null&&(rn(o,l,d),_r(o,d))}function hO(o){var l=o.memoizedState,d=0;l!==null&&(d=l.retryLane),zS(o,d)}function pO(o,l){var d=0;switch(o.tag){case 13:var g=o.stateNode,b=o.memoizedState;b!==null&&(d=b.retryLane);break;case 19:g=o.stateNode;break;default:throw Error(n(314))}g!==null&&g.delete(l),zS(o,d)}var US;US=function(o,l,d){if(o!==null)if(o.memoizedProps!==l.pendingProps||mr.current)vr=!0;else{if((o.lanes&d)===0&&(l.flags&128)===0)return vr=!1,tO(o,l,d);vr=(o.flags&131072)!==0}else vr=!1,$t&&(l.flags&1048576)!==0&&bb(l,lh,l.index);switch(l.lanes=0,l.tag){case 2:var g=l.type;Sh(o,l),o=l.pendingProps;var b=Ul(l,Un.current);ql(l,d),b=Pg(null,l,g,o,b,d);var C=Tg();return l.flags|=1,typeof b=="object"&&b!==null&&typeof b.render=="function"&&b.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,gr(g)?(C=!0,ih(l)):C=!1,l.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,xg(l),b.updater=wh,l.stateNode=b,b._reactInternals=l,Lg(l,g,o,d),l=Fg(null,l,g,!0,C,d)):(l.tag=0,$t&&C&&ug(l),nr(null,l,b,d),l=l.child),l;case 16:g=l.elementType;e:{switch(Sh(o,l),o=l.pendingProps,b=g._init,g=b(g._payload),l.type=g,b=l.tag=gO(g),o=Rs(g,o),b){case 0:l=jg(null,l,g,o,d);break e;case 1:l=mS(null,l,g,o,d);break e;case 11:l=uS(null,l,g,o,d);break e;case 14:l=dS(null,l,g,Rs(g.type,o),d);break e}throw Error(n(306,g,""))}return l;case 0:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:Rs(g,b),jg(o,l,g,b,d);case 1:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:Rs(g,b),mS(o,l,g,b,d);case 3:e:{if(gS(l),o===null)throw Error(n(387));g=l.pendingProps,C=l.memoizedState,b=C.element,Ib(o,l),ph(l,g,null,d);var M=l.memoizedState;if(g=M.element,C.isDehydrated)if(C={element:g,isDehydrated:!1,cache:M.cache,pendingSuspenseBoundaries:M.pendingSuspenseBoundaries,transitions:M.transitions},l.updateQueue.baseState=C,l.memoizedState=C,l.flags&256){b=Xl(Error(n(423)),l),l=vS(o,l,g,d,b);break e}else if(g!==b){b=Xl(Error(n(424)),l),l=vS(o,l,g,d,b);break e}else for($r=Co(l.stateNode.containerInfo.firstChild),Vr=l,$t=!0,Ts=null,d=Rb(l,null,g,d),l.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(Gl(),g===b){l=Li(o,l,d);break e}nr(o,l,g,d)}l=l.child}return l;case 5:return Lb(l),o===null&&hg(l),g=l.type,b=l.pendingProps,C=o!==null?o.memoizedProps:null,M=b.children,sg(g,b)?M=null:C!==null&&sg(g,C)&&(l.flags|=32),pS(o,l),nr(o,l,M,d),l.child;case 6:return o===null&&hg(l),null;case 13:return yS(o,l,d);case 4:return wg(l,l.stateNode.containerInfo),g=l.pendingProps,o===null?l.child=Kl(l,null,g,d):nr(o,l,g,d),l.child;case 11:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:Rs(g,b),uS(o,l,g,b,d);case 7:return nr(o,l,l.pendingProps,d),l.child;case 8:return nr(o,l,l.pendingProps.children,d),l.child;case 12:return nr(o,l,l.pendingProps.children,d),l.child;case 10:e:{if(g=l.type._context,b=l.pendingProps,C=l.memoizedProps,M=b.value,Tt(dh,g._currentValue),g._currentValue=M,C!==null)if(Ps(C.value,M)){if(C.children===b.children&&!mr.current){l=Li(o,l,d);break e}}else for(C=l.child,C!==null&&(C.return=l);C!==null;){var V=C.dependencies;if(V!==null){M=C.child;for(var B=V.firstContext;B!==null;){if(B.context===g){if(C.tag===1){B=Oi(-1,d&-d),B.tag=2;var re=C.updateQueue;if(re!==null){re=re.shared;var fe=re.pending;fe===null?B.next=B:(B.next=fe.next,fe.next=B),re.pending=B}}C.lanes|=d,B=C.alternate,B!==null&&(B.lanes|=d),yg(C.return,d,l),V.lanes|=d;break}B=B.next}}else if(C.tag===10)M=C.type===l.type?null:C.child;else if(C.tag===18){if(M=C.return,M===null)throw Error(n(341));M.lanes|=d,V=M.alternate,V!==null&&(V.lanes|=d),yg(M,d,l),M=C.sibling}else M=C.child;if(M!==null)M.return=C;else for(M=C;M!==null;){if(M===l){M=null;break}if(C=M.sibling,C!==null){C.return=M.return,M=C;break}M=M.return}C=M}nr(o,l,b.children,d),l=l.child}return l;case 9:return b=l.type,g=l.pendingProps.children,ql(l,d),b=os(b),g=g(b),l.flags|=1,nr(o,l,g,d),l.child;case 14:return g=l.type,b=Rs(g,l.pendingProps),b=Rs(g.type,b),dS(o,l,g,b,d);case 15:return fS(o,l,l.type,l.pendingProps,d);case 17:return g=l.type,b=l.pendingProps,b=l.elementType===g?b:Rs(g,b),Sh(o,l),l.tag=1,gr(g)?(o=!0,ih(l)):o=!1,ql(l,d),rS(l,g,b),Lg(l,g,b,d),Fg(null,l,g,!0,o,d);case 19:return xS(o,l,d);case 22:return hS(o,l,d)}throw Error(n(156,l.tag))};function BS(o,l){return mu(o,l)}function mO(o,l,d,g){this.tag=o,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cs(o,l,d,g){return new mO(o,l,d,g)}function sv(o){return o=o.prototype,!(!o||!o.isReactComponent)}function gO(o){if(typeof o=="function")return sv(o)?1:0;if(o!=null){if(o=o.$$typeof,o===F)return 11;if(o===W)return 14}return 2}function Do(o,l){var d=o.alternate;return d===null?(d=cs(o.tag,l,o.key,o.mode),d.elementType=o.elementType,d.type=o.type,d.stateNode=o.stateNode,d.alternate=o,o.alternate=d):(d.pendingProps=l,d.type=o.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=o.flags&14680064,d.childLanes=o.childLanes,d.lanes=o.lanes,d.child=o.child,d.memoizedProps=o.memoizedProps,d.memoizedState=o.memoizedState,d.updateQueue=o.updateQueue,l=o.dependencies,d.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},d.sibling=o.sibling,d.index=o.index,d.ref=o.ref,d}function Lh(o,l,d,g,b,C){var M=2;if(g=o,typeof o=="function")sv(o)&&(M=1);else if(typeof o=="string")M=5;else e:switch(o){case O:return Da(d.children,b,C,l);case A:M=8,b|=8;break;case I:return o=cs(12,d,l,b|2),o.elementType=I,o.lanes=C,o;case K:return o=cs(13,d,l,b),o.elementType=K,o.lanes=C,o;case X:return o=cs(19,d,l,b),o.elementType=X,o.lanes=C,o;case q:return Nh(d,b,C,l);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case N:M=10;break e;case j:M=9;break e;case F:M=11;break e;case W:M=14;break e;case G:M=16,g=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return l=cs(M,d,l,b),l.elementType=o,l.type=g,l.lanes=C,l}function Da(o,l,d,g){return o=cs(7,o,g,l),o.lanes=d,o}function Nh(o,l,d,g){return o=cs(22,o,g,l),o.elementType=q,o.lanes=d,o.stateNode={isHidden:!1},o}function iv(o,l,d){return o=cs(6,o,null,l),o.lanes=d,o}function ov(o,l,d){return l=cs(4,o.children!==null?o.children:[],o.key,l),l.lanes=d,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}function vO(o,l,d,g,b){this.tag=l,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=rs(0),this.expirationTimes=rs(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rs(0),this.identifierPrefix=g,this.onRecoverableError=b,this.mutableSourceEagerHydrationData=null}function av(o,l,d,g,b,C,M,V,B){return o=new vO(o,l,d,V,B),l===1?(l=1,C===!0&&(l|=8)):l=0,C=cs(3,null,null,l),o.current=C,C.stateNode=o,C.memoizedState={element:g,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},xg(C),o}function yO(o,l,d){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:L,key:g==null?null:""+g,children:o,containerInfo:l,implementation:d}}function WS(o){if(!o)return Po;o=o._reactInternals;e:{if(ki(o)!==o||o.tag!==1)throw Error(n(170));var l=o;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(gr(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(n(171))}if(o.tag===1){var d=o.type;if(gr(d))return _b(o,d,l)}return l}function GS(o,l,d,g,b,C,M,V,B){return o=av(d,g,!0,o,b,C,M,V,B),o.context=WS(null),d=o.current,g=rr(),b=Lo(d),C=Oi(g,b),C.callback=l??null,Ao(d,C,b),o.current.lanes=b,rn(o,b,g),_r(o,g),o}function Dh(o,l,d,g){var b=l.current,C=rr(),M=Lo(b);return d=WS(d),l.context===null?l.context=d:l.pendingContext=d,l=Oi(C,M),l.payload={element:o},g=g===void 0?null:g,g!==null&&(l.callback=g),o=Ao(b,l,M),o!==null&&(Ms(o,b,M,C),hh(o,b,M)),M}function jh(o){if(o=o.current,!o.child)return null;switch(o.child.tag){case 5:return o.child.stateNode;default:return o.child.stateNode}}function KS(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<l?d:l}}function lv(o,l){KS(o,l),(o=o.alternate)&&KS(o,l)}function _O(){return null}var ZS=typeof reportError=="function"?reportError:function(o){console.error(o)};function cv(o){this._internalRoot=o}Fh.prototype.render=cv.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(n(409));Dh(o,l,null,null)},Fh.prototype.unmount=cv.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;Oa(function(){Dh(null,o,null,null)}),l[Ti]=null}};function Fh(o){this._internalRoot=o}Fh.prototype.unstable_scheduleHydration=function(o){if(o){var l=Iw();o={blockedOn:null,target:o,priority:l};for(var d=0;d<bo.length&&l!==0&&l<bo[d].priority;d++);bo.splice(d,0,o),d===0&&Lw(o)}};function uv(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function Vh(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function qS(){}function xO(o,l,d,g,b){if(b){if(typeof g=="function"){var C=g;g=function(){var re=jh(M);C.call(re)}}var M=GS(l,g,o,0,null,!1,!1,"",qS);return o._reactRootContainer=M,o[Ti]=M.current,Lu(o.nodeType===8?o.parentNode:o),Oa(),M}for(;b=o.lastChild;)o.removeChild(b);if(typeof g=="function"){var V=g;g=function(){var re=jh(B);V.call(re)}}var B=av(o,0,!1,null,null,!1,!1,"",qS);return o._reactRootContainer=B,o[Ti]=B.current,Lu(o.nodeType===8?o.parentNode:o),Oa(function(){Dh(l,B,d,g)}),B}function $h(o,l,d,g,b){var C=d._reactRootContainer;if(C){var M=C;if(typeof b=="function"){var V=b;b=function(){var B=jh(M);V.call(B)}}Dh(l,M,o,b)}else M=xO(d,l,o,b,g);return jh(M)}Rw=function(o){switch(o.tag){case 3:var l=o.stateNode;if(l.current.memoizedState.isDehydrated){var d=We(l.pendingLanes);d!==0&&(ks(l,d|1),_r(l,Vt()),(dt&6)===0&&(ec=Vt()+500,To()))}break;case 13:Oa(function(){var g=Mi(o,1);if(g!==null){var b=rr();Ms(g,o,1,b)}}),lv(o,1)}},N0=function(o){if(o.tag===13){var l=Mi(o,134217728);if(l!==null){var d=rr();Ms(l,o,134217728,d)}lv(o,134217728)}},Aw=function(o){if(o.tag===13){var l=Lo(o),d=Mi(o,l);if(d!==null){var g=rr();Ms(d,o,l,g)}lv(o,l)}},Iw=function(){return vt},Mw=function(o,l){var d=vt;try{return vt=o,l()}finally{vt=d}},Ks=function(o,l,d){switch(l){case"input":if(je(o,d),l=d.name,d.type==="radio"&&l!=null){for(d=o;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<d.length;l++){var g=d[l];if(g!==o&&g.form===o.form){var b=rh(g);if(!b)throw Error(n(90));Re(g),je(g,b)}}}break;case"textarea":Qn(o,d);break;case"select":l=d.value,l!=null&&tt(o,!!d.multiple,l,!1)}},tn=tv,nn=Oa;var wO={usingClientEntryPoint:!1,Events:[ju,Hl,rh,Ke,It,tv]},Xu={findFiberByHostInstance:Ca,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},bO={bundleType:Xu.bundleType,version:Xu.version,rendererPackageName:Xu.rendererPackageName,rendererConfig:Xu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:k.ReactCurrentDispatcher,findHostInstanceByFiber:function(o){return o=Ml(o),o===null?null:o.stateNode},findFiberByHostInstance:Xu.findFiberByHostInstance||_O,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 Hh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hh.isDisabled&&Hh.supportsFiber)try{Ea=Hh.inject(bO),jr=Hh}catch{}}return xr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=wO,xr.createPortal=function(o,l){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!uv(l))throw Error(n(200));return yO(o,l,null,d)},xr.createRoot=function(o,l){if(!uv(o))throw Error(n(299));var d=!1,g="",b=ZS;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onRecoverableError!==void 0&&(b=l.onRecoverableError)),l=av(o,1,!1,null,null,d,!1,g,b),o[Ti]=l.current,Lu(o.nodeType===8?o.parentNode:o),new cv(l)},xr.findDOMNode=function(o){if(o==null)return null;if(o.nodeType===1)return o;var l=o._reactInternals;if(l===void 0)throw typeof o.render=="function"?Error(n(188)):(o=Object.keys(o).join(","),Error(n(268,o)));return o=Ml(l),o=o===null?null:o.stateNode,o},xr.flushSync=function(o){return Oa(o)},xr.hydrate=function(o,l,d){if(!Vh(l))throw Error(n(200));return $h(null,o,l,!0,d)},xr.hydrateRoot=function(o,l,d){if(!uv(o))throw Error(n(405));var g=d!=null&&d.hydratedSources||null,b=!1,C="",M=ZS;if(d!=null&&(d.unstable_strictMode===!0&&(b=!0),d.identifierPrefix!==void 0&&(C=d.identifierPrefix),d.onRecoverableError!==void 0&&(M=d.onRecoverableError)),l=GS(l,null,o,1,d??null,b,!1,C,M),o[Ti]=l.current,Lu(o),g)for(o=0;o<g.length;o++)d=g[o],b=d._getVersion,b=b(d._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[d,b]:l.mutableSourceEagerHydrationData.push(d,b);return new Fh(l)},xr.render=function(o,l,d){if(!Vh(l))throw Error(n(200));return $h(null,o,l,!1,d)},xr.unmountComponentAtNode=function(o){if(!Vh(o))throw Error(n(40));return o._reactRootContainer?(Oa(function(){$h(null,null,o,!1,function(){o._reactRootContainer=null,o[Ti]=null})}),!0):!1},xr.unstable_batchedUpdates=tv,xr.unstable_renderSubtreeIntoContainer=function(o,l,d,g){if(!Vh(d))throw Error(n(200));if(o==null||o._reactInternals===void 0)throw Error(n(38));return $h(o,l,d,!1,g)},xr.version="18.3.1-next-f1338f8080-20240426",xr}var vC;function NP(){if(vC)return Uv.exports;vC=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(),Uv.exports=UD(),Uv.exports}var yC;function BD(){if(yC)return ep;yC=1;var t=NP();return ep.createRoot=t.createRoot,ep.hydrateRoot=t.hydrateRoot,ep}var WD=BD();const GD=e0(WD),ro={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function DP(t){return"init"in t}function By(t){return typeof t.write=="function"}function KD(t){return!!t.onMount}function _C(t){return"v"in t||"e"in t}function Sm(t){if("e"in t)throw t.e;if((ro?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}function Em(t){return typeof(t==null?void 0:t.then)=="function"}function ZD(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 jP(t,e,n){if(!n.p.has(t)){n.p.add(t);const r=()=>n.p.delete(t);e.then(r,r)}}function FP(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 a=new Set(s);for(const c of i)a.add(c);return a}function qD(t){return!!t.INTERNAL_onInit}const YD=(t,e,n,...r)=>n.read(...r),XD=(t,e,n,...r)=>n.write(...r),QD=(t,e,n)=>n.INTERNAL_onInit(e),JD=(t,e,n,r)=>{var s;return(s=n.onMount)==null?void 0:s.call(n,r)},e9=(t,e,n)=>{var r;const s=t[0];let i=s.get(n);if(!i){const a=t[6],c=t[9];i={d:new Map,p:new Set,n:0},s.set(n,i),(r=a.i)==null||r.call(a,n),qD(n)&&c(t,e,n)}return i},t9=(t,e)=>{var n;const r=t[1],s=t[3],i=t[4],a=t[5],c=t[6],u=t[13];if(!c.f&&!s.size&&!i.size&&!a.size)return;const f=[],h=p=>{try{p()}catch(m){f.push(m)}};do{c.f&&h(c.f);const p=new Set;for(const m of s){const _=(n=r.get(m))==null?void 0:n.l;if(_)for(const x of _)p.add(x)}s.clear();for(const m of a)p.add(m);a.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||a.size||i.size);if(f.length)throw new AggregateError(f)},n9=(t,e)=>{const n=t[1],r=t[2],s=t[3],i=t[11],a=t[14],c=t[17];if(!s.size)return;const u=[],f=[],h=new WeakSet,p=new WeakSet,m=[],_=[];for(const x of s)m.push(x),_.push(i(t,e,x));for(;m.length;){const x=m.length-1,y=m[x],w=_[x];if(p.has(y)){m.pop(),_.pop();continue}if(h.has(y)){if(r.get(y)===w.n)u.push(y),f.push(w);else if((ro?"production":void 0)!=="production"&&r.has(y))throw new Error("[Bug] invalidated atom exists");p.add(y),m.pop(),_.pop();continue}h.add(y);for(const S of FP(y,w,n))h.has(S)||(m.push(S),_.push(i(t,e,S)))}for(let x=u.length-1;x>=0;--x){const y=u[x],w=f[x];let S=!1;for(const T of w.d.keys())if(T!==y&&s.has(T)){S=!0;break}S&&(r.set(y,w.n),a(t,e,y),c(t,e,y)),r.delete(y)}},Wy=new WeakSet,r9=(t,e,n)=>{var r,s;const i=t[1],a=t[2],c=t[3],u=t[6],f=t[7],h=t[11],p=t[12],m=t[13],_=t[14],x=t[16],y=t[17],w=t[20],S=t[26],T=t[28],P=h(t,e,n),k=T[0];if(_C(P)){if(i.has(n)&&a.get(n)!==P.n||P.m===k)return P.m=k,P;let W=!1;for(const[G,q]of P.d)if(_(t,e,G).n!==q){W=!0;break}if(!W)return P.m=k,P}let R=!0;const L=new Set(P.d.keys()),O=()=>{for(const W of L)P.d.delete(W)},A=()=>{if(i.has(n)){const W=!c.size;y(t,e,n),W&&(m(t,e),p(t,e))}},I=W=>{var G;if(W===n){const $=h(t,e,W);if(!_C($))if(DP(W))w(t,e,W,W.init);else throw new Error("no atom init");return Sm($)}const q=_(t,e,W);try{return Sm(q)}finally{L.delete(W),P.d.set(W,q.n),Em(P.v)&&jP(n,P.v,q),i.has(n)&&((G=i.get(W))==null||G.t.add(n)),R||A()}};let N,j;const F={get signal(){return N||(N=new AbortController),N.signal},get setSelf(){return(ro?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(ro?"production":void 0)!=="production"&&!By(n)&&console.warn("setSelf function cannot be used with read-only atom"),!j&&By(n)&&(j=(...W)=>{if((ro?"production":void 0)!=="production"&&R&&console.warn("setSelf function cannot be called in sync"),!R)try{return x(t,e,n,W)}finally{m(t,e),p(t,e)}}),j}},K=P.n,X=a.get(n)===K;try{(ro?"production":void 0)!=="production"&&Wy.delete(e);const W=f(t,e,n,I,F);if((ro?"production":void 0)!=="production"&&Wy.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),w(t,e,n,W),Em(W)){S(t,e,W,()=>N==null?void 0:N.abort());const G=()=>{O(),A()};W.then(G,G)}else O();return(r=u.r)==null||r.call(u,n),P.m=k,P}catch(W){if(ZD(W))throw W;return delete P.v,P.e=W,++P.n,P.m=k,P}finally{R=!1,P.n!==K&&X&&(a.set(n,P.n),c.add(n),(s=u.c)==null||s.call(u,n))}},s9=(t,e,n)=>{const r=t[1],s=t[2],i=t[11],a=[n];for(;a.length;){const c=a.pop(),u=i(t,e,c);for(const f of FP(c,u,r)){const h=i(t,e,f);s.get(f)!==h.n&&(s.set(f,h.n),a.push(f))}}},i9=(t,e,n,r)=>{const s=t[3],i=t[6],a=t[8],c=t[11],u=t[12],f=t[13],h=t[14],p=t[15],m=t[16],_=t[17],x=t[20],y=t[28];let w=!0;const S=P=>Sm(h(t,e,P)),T=(P,...k)=>{var R;const L=c(t,e,P);try{if(P===n){if(!DP(P))throw new Error("atom not writable");(ro?"production":void 0)!=="production"&&Wy.add(e);const O=L.n,A=k[0];x(t,e,P,A),_(t,e,P),O!==L.n&&(++y[0],s.add(P),p(t,e,P),(R=i.c)==null||R.call(i,P));return}else return m(t,e,P,k)}finally{w||(f(t,e),u(t,e))}};try{return a(t,e,n,S,T,...r)}finally{w=!1}},o9=(t,e,n)=>{var r;const s=t[1],i=t[3],a=t[6],c=t[11],u=t[15],f=t[18],h=t[19],p=c(t,e,n),m=s.get(n);if(m&&p.d.size>0){for(const[_,x]of p.d)if(!m.d.has(_)){const y=c(t,e,_);f(t,e,_).t.add(n),m.d.add(_),x!==y.n&&(i.add(_),u(t,e,_),(r=a.c)==null||r.call(a,_))}for(const _ of m.d)if(!p.d.has(_)){m.d.delete(_);const x=h(t,e,_);x==null||x.t.delete(n)}}},a9=(t,e,n)=>{var r;const s=t[1],i=t[4],a=t[6],c=t[10],u=t[11],f=t[12],h=t[13],p=t[14],m=t[16],_=t[18],x=u(t,e,n);let y=s.get(n);if(!y){p(t,e,n);for(const w of x.d.keys())_(t,e,w).t.add(n);if(y={l:new Set,d:new Set(x.d.keys()),t:new Set},s.set(n,y),By(n)&&KD(n)){const w=()=>{let S=!0;const T=(...P)=>{try{return m(t,e,n,P)}finally{S||(h(t,e),f(t,e))}};try{const P=c(t,e,n,T);P&&(y.u=()=>{S=!0;try{P()}finally{S=!1}})}finally{S=!1}};i.add(w)}(r=a.m)==null||r.call(a,n)}return y},l9=(t,e,n)=>{var r,s;const i=t[1],a=t[5],c=t[6],u=t[11],f=t[19],h=u(t,e,n);let p=i.get(n);if(!p||p.l.size)return p;let m=!1;for(const _ of p.t)if((r=i.get(_))!=null&&r.d.has(n)){m=!0;break}if(!m){p.u&&a.add(p.u),p=void 0,i.delete(n);for(const _ of h.d.keys()){const x=f(t,e,_);x==null||x.t.delete(n)}(s=c.u)==null||s.call(c,n);return}return p},c9=(t,e,n,r)=>{const s=t[11],i=t[27],a=s(t,e,n),c="v"in a,u=a.v;if(Em(r))for(const f of a.d.keys())jP(n,r,s(t,e,f));a.v=r,delete a.e,(!c||!Object.is(u,a.v))&&(++a.n,Em(u)&&i(t,e,u))},u9=(t,e,n)=>{const r=t[14];return Sm(r(t,e,n))},d9=(t,e,n,...r)=>{const s=t[3],i=t[12],a=t[13],c=t[16],u=s.size;try{return c(t,e,n,r)}finally{s.size!==u&&(a(t,e),i(t,e))}},f9=(t,e,n,r)=>{const s=t[12],i=t[13],a=t[18],c=t[19],f=a(t,e,n).l;return f.add(r),i(t,e),s(t,e),()=>{f.delete(r),c(t,e,n),i(t,e),s(t,e)}},h9=(t,e,n,r)=>{const s=t[25];let i=s.get(n);if(!i){i=new Set,s.set(n,i);const a=()=>s.delete(n);n.then(a,a)}i.add(r)},p9=(t,e,n)=>{const s=t[25].get(n);s==null||s.forEach(i=>i())},VP=new WeakMap;function m9(t){const e=VP.get(t);if((ro?"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 g9(...t){const e={get(a){return r(n,e,a)},set(a,...c){return s(n,e,a,...c)},sub(a,c){return i(n,e,a,c)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},YD,XD,QD,JD,e9,t9,n9,r9,s9,i9,o9,a9,l9,c9,u9,d9,f9,void 0,new WeakMap,h9,p9,[0]].map((a,c)=>t[c]||a);VP.set(e,Object.freeze(n));const r=n[21],s=n[22],i=n[23];return e}const $P={};let v9=0;function nt(t,e){const n=`atom${++v9}`,r={toString(){return($P?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=y9,r.write=_9),e&&(r.write=e),r}function y9(t){return t(this)}function _9(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function x9(){return g9()}let ud;function w9(){return ud||(ud=x9(),($P?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=ud),globalThis.__JOTAI_DEFAULT_STORE__!==ud&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),ud}const b9={},S9=v.createContext(void 0);function D2(t){return v.useContext(S9)||w9()}const Gy=t=>typeof(t==null?void 0:t.then)=="function",Ky=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},E9=ve.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(Ky(t),t)}),Gv=new WeakMap,xC=(t,e,n)=>{const r=m9(t),s=r[26];let i=Gv.get(e);return i||(i=new Promise((a,c)=>{let u=e;const f=m=>_=>{u===m&&a(_)},h=m=>_=>{u===m&&c(_)},p=()=>{try{const m=n();Gy(m)?(Gv.set(m,i),u=m,m.then(f(m),h(m)),s(r,t,m,p)):a(m)}catch(m){c(m)}};e.then(f(e),h(e)),s(r,t,e,p)}),Gv.set(e,i)),i};function et(t,e){const{delay:n,unstable_promiseStatus:r=!ve.use}={},s=D2(),[[i,a,c],u]=v.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 f=i;if((a!==s||c!==t)&&(u(),f=s.get(t)),v.useEffect(()=>{const h=s.sub(t,()=>{if(r)try{const p=s.get(t);Gy(p)&&Ky(xC(s,p,()=>s.get(t)))}catch{}if(typeof n=="number"){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3.
|
|
42
|
+
|
|
43
|
+
Migration guide:
|
|
44
|
+
|
|
45
|
+
Create a custom hook like the following.
|
|
46
|
+
|
|
47
|
+
function useAtomValueWithDelay<Value>(
|
|
48
|
+
atom: Atom<Value>,
|
|
49
|
+
options: { delay: number },
|
|
50
|
+
): Value {
|
|
51
|
+
const { delay } = options
|
|
52
|
+
const store = useStore(options)
|
|
53
|
+
const [value, setValue] = useState(() => store.get(atom))
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
const unsub = store.sub(atom, () => {
|
|
56
|
+
setTimeout(() => setValue(store.get(atom)), delay)
|
|
57
|
+
})
|
|
58
|
+
return unsub
|
|
59
|
+
}, [store, atom, delay])
|
|
60
|
+
return value
|
|
61
|
+
}
|
|
62
|
+
`),setTimeout(u,n);return}u()});return u(),h},[s,t,n,r]),v.useDebugValue(f),Gy(f)){const h=xC(s,f,()=>s.get(t));return r&&Ky(h),E9(h)}return f}function ot(t,e){const n=D2();return v.useCallback((...s)=>{if((b9?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...s)},[n,t])}function HP(t,e){return[et(t),ot(t)]}const j2=v.createContext({});function F2(t){const e=v.useRef(null);return e.current===null&&(e.current=t()),e.current}const C9=typeof window<"u",V2=C9?v.useLayoutEffect:v.useEffect,i0=v.createContext(null);function $2(t,e){t.indexOf(e)===-1&&t.push(e)}function Cm(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const vi=(t,e,n)=>n>e?e:n<t?t:n;let o0=()=>{};const la={},zP=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),UP=t=>typeof t=="object"&&t!==null,BP=t=>/^0[^.\s]+$/u.test(t);function WP(t){let e;return()=>(e===void 0&&(e=t()),e)}const _s=t=>t,kf=(...t)=>t.reduce((e,n)=>r=>n(e(r))),Zd=(t,e,n)=>{const r=e-t;return r?(n-t)/r:1};class H2{constructor(){this.subscriptions=[]}add(e){return $2(this.subscriptions,e),()=>Cm(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 a=this.subscriptions[i];a&&a(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Xr=t=>t*1e3,ms=t=>t/1e3,GP=(t,e)=>e?t*(1e3/e):0,KP=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,k9=1e-7,P9=12;function T9(t,e,n,r,s){let i,a,c=0;do a=e+(n-e)/2,i=KP(a,r,s)-t,i>0?n=a:e=a;while(Math.abs(i)>k9&&++c<P9);return a}function Pf(t,e,n,r){if(t===e&&n===r)return _s;const s=i=>T9(i,0,1,t,n);return i=>i===0||i===1?i:KP(s(i),e,r)}const ZP=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,qP=t=>e=>1-t(1-e),YP=Pf(.33,1.53,.69,.99),z2=qP(YP),XP=ZP(z2),QP=t=>t>=1?1:(t*=2)<1?.5*z2(t):.5*(2-Math.pow(2,-10*(t-1))),U2=t=>1-Math.sin(Math.acos(t)),JP=qP(U2),e3=ZP(U2),R9=Pf(.42,0,1,1),A9=Pf(0,0,.58,1),t3=Pf(.42,0,.58,1),I9=t=>Array.isArray(t)&&typeof t[0]!="number",n3=t=>Array.isArray(t)&&typeof t[0]=="number",M9={linear:_s,easeIn:R9,easeInOut:t3,easeOut:A9,circIn:U2,circInOut:e3,circOut:JP,backIn:z2,backInOut:XP,backOut:YP,anticipate:QP},O9=t=>typeof t=="string",wC=t=>{if(n3(t)){o0(t.length===4);const[e,n,r,s]=t;return Pf(e,n,r,s)}else if(O9(t))return M9[t];return t},tp=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function L9(t){let e=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(f){i.has(f)&&(u.schedule(f),t()),f(a)}const u={schedule:(f,h=!1,p=!1)=>{const _=p&&r?e:n;return h&&i.add(f),_.add(f),f},cancel:f=>{n.delete(f),i.delete(f)},process:f=>{if(a=f,r){s=!0;return}r=!0;const h=e;e=n,n=h,e.forEach(c),e.clear(),r=!1,s&&(s=!1,u.process(f))}};return u}const N9=40;function r3(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=tp.reduce((P,k)=>(P[k]=L9(i),P),{}),{setup:c,read:u,resolveKeyframes:f,preUpdate:h,update:p,preRender:m,render:_,postRender:x}=a,y=()=>{const P=la.useManualTiming,k=P?s.timestamp:performance.now();n=!1,P||(s.delta=r?1e3/60:Math.max(Math.min(k-s.timestamp,N9),1)),s.timestamp=k,s.isProcessing=!0,c.process(s),u.process(s),f.process(s),h.process(s),p.process(s),m.process(s),_.process(s),x.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(y))},w=()=>{n=!0,r=!0,s.isProcessing||t(y)};return{schedule:tp.reduce((P,k)=>{const R=a[k];return P[k]=(L,O=!1,A=!1)=>(n||w(),R.schedule(L,O,A)),P},{}),cancel:P=>{for(let k=0;k<tp.length;k++)a[tp[k]].cancel(P)},state:s,steps:a}}const{schedule:Ct,cancel:ca,state:Nn,steps:Kv}=r3(typeof requestAnimationFrame<"u"?requestAnimationFrame:_s,!0);let Ap;function D9(){Ap=void 0}const ar={now:()=>(Ap===void 0&&ar.set(Nn.isProcessing||la.useManualTiming?Nn.timestamp:performance.now()),Ap),set:t=>{Ap=t,queueMicrotask(D9)}},s3=t=>e=>typeof e=="string"&&e.startsWith(t),i3=s3("--"),j9=s3("var(--"),B2=t=>j9(t)?F9.test(t.split("/*")[0].trim()):!1,F9=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function bC(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const au={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},qd={...au,transform:t=>vi(0,1,t)},np={...au,default:1},Ad=t=>Math.round(t*1e5)/1e5,W2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function V9(t){return t==null}const $9=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,G2=(t,e)=>n=>!!(typeof n=="string"&&$9.test(n)&&n.startsWith(t)||e&&!V9(n)&&Object.prototype.hasOwnProperty.call(n,e)),o3=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,c]=r.match(W2);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(a),alpha:c!==void 0?parseFloat(c):1}},H9=t=>vi(0,255,t),Zv={...au,transform:t=>Math.round(H9(t))},il={test:G2("rgb","red"),parse:o3("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+Zv.transform(t)+", "+Zv.transform(e)+", "+Zv.transform(n)+", "+Ad(qd.transform(r))+")"};function z9(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 Zy={test:G2("#"),parse:z9,transform:il.transform},Tf=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Gi=Tf("deg"),gi=Tf("%"),Le=Tf("px"),U9=Tf("vh"),B9=Tf("vw"),SC={...gi,parse:t=>gi.parse(t)/100,transform:t=>gi.transform(t*100)},xc={test:G2("hsl","hue"),parse:o3("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+gi.transform(Ad(e))+", "+gi.transform(Ad(n))+", "+Ad(qd.transform(r))+")"},mn={test:t=>il.test(t)||Zy.test(t)||xc.test(t),parse:t=>il.test(t)?il.parse(t):xc.test(t)?xc.parse(t):Zy.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?il.transform(t):xc.transform(t),getAnimatableNone:t=>{const e=mn.parse(t);return e.alpha=0,mn.transform(e)}},W9=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function G9(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(W2))==null?void 0:e.length)||0)+(((n=t.match(W9))==null?void 0:n.length)||0)>0}const a3="number",l3="color",K9="var",Z9="var(",EC="${}",q9=/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 eu(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const c=e.replace(q9,u=>(mn.test(u)?(r.color.push(i),s.push(l3),n.push(mn.parse(u))):u.startsWith(Z9)?(r.var.push(i),s.push(K9),n.push(u)):(r.number.push(i),s.push(a3),n.push(parseFloat(u))),++i,EC)).split(EC);return{values:n,split:c,indexes:r,types:s}}function Y9(t){return eu(t).values}function c3({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 a=e[i];a===a3?s+=Ad(r[i]):a===l3?s+=mn.transform(r[i]):s+=r[i]}return s}}function X9(t){return c3(eu(t))}const Q9=t=>typeof t=="number"?0:mn.test(t)?mn.getAnimatableNone(t):t,J9=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:Q9(t);function e7(t){const e=eu(t);return c3(e)(e.values.map((r,s)=>J9(r,e.split[s])))}const Hs={test:G9,parse:Y9,createTransformer:X9,getAnimatableNone:e7};function qv(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 t7({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,i=0,a=0;if(!e)s=i=a=n;else{const c=n<.5?n*(1+e):n+e-n*e,u=2*n-c;s=qv(u,c,t+1/3),i=qv(u,c,t),a=qv(u,c,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function km(t,e){return n=>n>0?e:t}const Et=(t,e,n)=>t+(e-t)*n,Yv=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},n7=[Zy,il,xc],r7=t=>n7.find(e=>e.test(t));function CC(t){const e=r7(t);if(!e)return!1;let n=e.parse(t);return e===xc&&(n=t7(n)),n}const kC=(t,e)=>{const n=CC(t),r=CC(e);if(!n||!r)return km(t,e);const s={...n};return i=>(s.red=Yv(n.red,r.red,i),s.green=Yv(n.green,r.green,i),s.blue=Yv(n.blue,r.blue,i),s.alpha=Et(n.alpha,r.alpha,i),il.transform(s))},qy=new Set(["none","hidden"]);function s7(t,e){return qy.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function i7(t,e){return n=>Et(t,e,n)}function K2(t){return typeof t=="number"?i7:typeof t=="string"?B2(t)?km:mn.test(t)?kC:l7:Array.isArray(t)?u3:typeof t=="object"?mn.test(t)?kC:o7:km}function u3(t,e){const n=[...t],r=n.length,s=t.map((i,a)=>K2(i)(i,e[a]));return i=>{for(let a=0;a<r;a++)n[a]=s[a](i);return n}}function o7(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=K2(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function a7(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],a=t.indexes[i][r[i]],c=t.values[a]??0;n[s]=c,r[i]++}return n}const l7=(t,e)=>{const n=Hs.createTransformer(e),r=eu(t),s=eu(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?qy.has(t)&&!s.values.length||qy.has(e)&&!r.values.length?s7(t,e):kf(u3(a7(r,s),s.values),n):km(t,e)};function d3(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Et(t,e,n):K2(t)(t,e)}const c7=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Ct.update(e,n),stop:()=>ca(e),now:()=>Nn.isProcessing?Nn.timestamp:ar.now()}},f3=(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)})`},Pm=2e4;function Z2(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Pm;)e+=n,r=t.next(e);return e>=Pm?1/0:e}function u7(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(Z2(r),Pm);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:ms(s)}}const Qt={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 Yy(t,e){return t*Math.sqrt(1-e*e)}const d7=12;function f7(t,e,n){let r=n;for(let s=1;s<d7;s++)r=r-t(r)/e(r);return r}const Xv=.001;function h7({duration:t=Qt.duration,bounce:e=Qt.bounce,velocity:n=Qt.velocity,mass:r=Qt.mass}){let s,i,a=1-e;a=vi(Qt.minDamping,Qt.maxDamping,a),t=vi(Qt.minDuration,Qt.maxDuration,ms(t)),a<1?(s=f=>{const h=f*a,p=h*t,m=h-n,_=Yy(f,a),x=Math.exp(-p);return Xv-m/_*x},i=f=>{const p=f*a*t,m=p*n+n,_=Math.pow(a,2)*Math.pow(f,2)*t,x=Math.exp(-p),y=Yy(Math.pow(f,2),a);return(-s(f)+Xv>0?-1:1)*((m-_)*x)/y}):(s=f=>{const h=Math.exp(-f*t),p=(f-n)*t+1;return-Xv+h*p},i=f=>{const h=Math.exp(-f*t),p=(n-f)*(t*t);return h*p});const c=5/t,u=f7(s,i,c);if(t=Xr(t),isNaN(u))return{stiffness:Qt.stiffness,damping:Qt.damping,duration:t};{const f=Math.pow(u,2)*r;return{stiffness:f,damping:a*2*Math.sqrt(r*f),duration:t}}}const p7=["duration","bounce"],m7=["stiffness","damping","mass"];function PC(t,e){return e.some(n=>t[n]!==void 0)}function g7(t){let e={velocity:Qt.velocity,stiffness:Qt.stiffness,damping:Qt.damping,mass:Qt.mass,isResolvedFromDuration:!1,...t};if(!PC(t,m7)&&PC(t,p7))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*vi(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Qt.mass,stiffness:s,damping:i}}else{const n=h7({...t,velocity:0});e={...e,...n,mass:Qt.mass},e.isResolvedFromDuration=!0}return e}function Tm(t=Qt.visualDuration,e=Qt.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],a=n.keyframes[n.keyframes.length-1],c={done:!1,value:i},{stiffness:u,damping:f,mass:h,duration:p,velocity:m,isResolvedFromDuration:_}=g7({...n,velocity:-ms(n.velocity||0)}),x=m||0,y=f/(2*Math.sqrt(u*h)),w=a-i,S=ms(Math.sqrt(u/h)),T=Math.abs(w)<5;r||(r=T?Qt.restSpeed.granular:Qt.restSpeed.default),s||(s=T?Qt.restDelta.granular:Qt.restDelta.default);let P,k,R,L,O,A;if(y<1)R=Yy(S,y),L=(x+y*S*w)/R,P=N=>{const j=Math.exp(-y*S*N);return a-j*(L*Math.sin(R*N)+w*Math.cos(R*N))},O=y*S*L+w*R,A=y*S*w-L*R,k=N=>Math.exp(-y*S*N)*(O*Math.sin(R*N)+A*Math.cos(R*N));else if(y===1){P=j=>a-Math.exp(-S*j)*(w+(x+S*w)*j);const N=x+S*w;k=j=>Math.exp(-S*j)*(S*N*j-x)}else{const N=S*Math.sqrt(y*y-1);P=X=>{const W=Math.exp(-y*S*X),G=Math.min(N*X,300);return a-W*((x+y*S*w)*Math.sinh(G)+N*w*Math.cosh(G))/N};const j=(x+y*S*w)/N,F=y*S*j-w*N,K=y*S*w-j*N;k=X=>{const W=Math.exp(-y*S*X),G=Math.min(N*X,300);return W*(F*Math.sinh(G)+K*Math.cosh(G))}}const I={calculatedDuration:_&&p||null,velocity:N=>Xr(k(N)),next:N=>{if(!_&&y<1){const F=Math.exp(-y*S*N),K=Math.sin(R*N),X=Math.cos(R*N),W=a-F*(L*K+w*X),G=Xr(F*(O*K+A*X));return c.done=Math.abs(G)<=r&&Math.abs(a-W)<=s,c.value=c.done?a:W,c}const j=P(N);if(_)c.done=N>=p;else{const F=Xr(k(N));c.done=Math.abs(F)<=r&&Math.abs(a-j)<=s}return c.value=c.done?a:j,c},toString:()=>{const N=Math.min(Z2(I),Pm),j=f3(F=>I.next(N*F).value,N,30);return N+"ms "+j},toTransition:()=>{}};return I}Tm.applyToOptions=t=>{const e=u7(t,100,Tm);return t.ease=e.ease,t.duration=Xr(e.duration),t.type="keyframes",t};const v7=5;function h3(t,e,n){const r=Math.max(e-v7,0);return GP(n-t(r),e-r)}function Xy({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:a,min:c,max:u,restDelta:f=.5,restSpeed:h}){const p=t[0],m={done:!1,value:p},_=A=>c!==void 0&&A<c||u!==void 0&&A>u,x=A=>c===void 0?u:u===void 0||Math.abs(c-A)<Math.abs(u-A)?c:u;let y=n*e;const w=p+y,S=a===void 0?w:a(w);S!==w&&(y=S-p);const T=A=>-y*Math.exp(-A/r),P=A=>S+T(A),k=A=>{const I=T(A),N=P(A);m.done=Math.abs(I)<=f,m.value=m.done?S:N};let R,L;const O=A=>{_(m.value)&&(R=A,L=Tm({keyframes:[m.value,x(m.value)],velocity:h3(P,A,m.value),damping:s,stiffness:i,restDelta:f,restSpeed:h}))};return O(0),{calculatedDuration:null,next:A=>{let I=!1;return!L&&R===void 0&&(I=!0,k(A),O(A)),R!==void 0&&A>=R?L.next(A-R):(!I&&k(A),m)}}}function y7(t,e,n){const r=[],s=n||la.mix||d3,i=t.length-1;for(let a=0;a<i;a++){let c=s(t[a],t[a+1]);if(e){const u=Array.isArray(e)?e[a]||_s:e;c=kf(u,c)}r.push(c)}return r}function _7(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(o0(i===e.length),i===1)return()=>e[0];if(i===2&&e[0]===e[1])return()=>e[1];const a=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const c=y7(e,r,s),u=c.length,f=h=>{if(a&&h<t[0])return e[0];let p=0;if(u>1)for(;p<t.length-2&&!(h<t[p+1]);p++);const m=Zd(t[p],t[p+1],h);return c[p](m)};return n?h=>f(vi(t[0],t[i-1],h)):f}function x7(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=Zd(0,e,r);t.push(Et(n,1,s))}}function w7(t){const e=[0];return x7(e,t.length-1),e}function b7(t,e){return t.map(n=>n*e)}function S7(t,e){return t.map(()=>e||t3).splice(0,t.length-1)}function Id({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=I9(r)?r.map(wC):wC(r),i={done:!1,value:e[0]},a=b7(n&&n.length===e.length?n:w7(e),t),c=_7(a,e,{ease:Array.isArray(s)?s:S7(e,s)});return{calculatedDuration:t,next:u=>(i.value=c(u),i.done=u>=t,i)}}const E7=t=>t!==null;function a0(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(E7),c=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!c||r===void 0?i[c]:r}const C7={decay:Xy,inertia:Xy,tween:Id,keyframes:Id,spring:Tm};function p3(t){typeof t.type=="string"&&(t.type=C7[t.type])}class q2{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 k7=t=>t/100;class Rm extends q2{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!==ar.now()&&this.tick(ar.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;p3(e);const{type:n=Id,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:a=0}=e;let{keyframes:c}=e;const u=n||Id;u!==Id&&typeof c[0]!="number"&&(this.mixKeyframes=kf(k7,d3(c[0],c[1])),c=[0,100]);const f=u({...e,keyframes:c});i==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...c].reverse(),velocity:-a})),f.calculatedDuration===null&&(f.calculatedDuration=Z2(f));const{calculatedDuration:h}=f;this.calculatedDuration=h,this.resolvedDuration=h+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=f}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:a,resolvedDuration:c,calculatedDuration:u}=this;if(this.startTime===null)return r.next(0);const{delay:f=0,keyframes:h,repeat:p,repeatType:m,repeatDelay:_,type:x,onUpdate:y,finalKeyframe:w}=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 S=this.currentTime-f*(this.playbackSpeed>=0?1:-1),T=this.playbackSpeed>=0?S<0:S>s;this.currentTime=Math.max(S,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let P=this.currentTime,k=r;if(p){const A=Math.min(this.currentTime,s)/c;let I=Math.floor(A),N=A%1;!N&&A>=1&&(N=1),N===1&&I--,I=Math.min(I,p+1),!!(I%2)&&(m==="reverse"?(N=1-N,_&&(N-=_/c)):m==="mirror"&&(k=a)),P=vi(0,1,N)*c}let R;T?(this.delayState.value=h[0],R=this.delayState):R=k.next(P),i&&!T&&(R.value=i(R.value));let{done:L}=R;!T&&u!==null&&(L=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const O=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&L);return O&&x!==Xy&&(R.value=a0(h,this.options,w,this.speed)),y&&y(R.value),O&&this.finish(),R}then(e,n){return this.finished.then(e,n)}get duration(){return ms(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+ms(e)}get time(){return ms(this.currentTime)}set time(e){e=Xr(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 h3(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(ar.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=ms(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=c7,startTime:n}=this.options;this.driver||(this.driver=e(a=>this.tick(a))),(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(ar.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 P7(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const ol=t=>t*180/Math.PI,Qy=t=>{const e=ol(Math.atan2(t[1],t[0]));return Jy(e)},T7={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Qy,rotateZ:Qy,skewX:t=>ol(Math.atan(t[1])),skewY:t=>ol(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Jy=t=>(t=t%360,t<0&&(t+=360),t),TC=Qy,RC=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),AC=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),R7={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:RC,scaleY:AC,scale:t=>(RC(t)+AC(t))/2,rotateX:t=>Jy(ol(Math.atan2(t[6],t[5]))),rotateY:t=>Jy(ol(Math.atan2(-t[2],t[0]))),rotateZ:TC,rotate:TC,skewX:t=>ol(Math.atan(t[4])),skewY:t=>ol(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function e_(t){return t.includes("scale")?1:0}function t_(t,e){if(!t||t==="none")return e_(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=R7,s=n;else{const c=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=T7,s=c}if(!s)return e_(e);const i=r[e],a=s[1].split(",").map(I7);return typeof i=="function"?i(a):a[i]}const A7=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return t_(n,e)};function I7(t){return parseFloat(t.trim())}const lu=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],cu=new Set([...lu,"pathRotation"]),IC=t=>t===au||t===Le,M7=new Set(["x","y","z"]),O7=lu.filter(t=>!M7.has(t));function L7(t){const e=[];return O7.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Xo={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})=>t_(e,"x"),y:(t,{transform:e})=>t_(e,"y")};Xo.translateX=Xo.x;Xo.translateY=Xo.y;const yl=new Set;let n_=!1,r_=!1,s_=!1;function m3(){if(r_){const t=Array.from(yl).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=L7(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,a])=>{var c;(c=r.getValue(i))==null||c.set(a)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}r_=!1,n_=!1,yl.forEach(t=>t.complete(s_)),yl.clear()}function g3(){yl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(r_=!0)})}function N7(){s_=!0,g3(),m3(),s_=!1}class Y2{constructor(e,n,r,s,i,a=!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=a}scheduleResolve(){this.state="scheduled",this.isAsync?(yl.add(this),n_||(n_=!0,Ct.read(g3),Ct.resolveKeyframes(m3))):(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(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(r&&n){const c=r.readValue(n,a);c!=null&&(e[0]=c)}e[0]===void 0&&(e[0]=a),s&&i===void 0&&s.set(e[0])}P7(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),yl.delete(this)}cancel(){this.state==="scheduled"&&(yl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const D7=t=>t.startsWith("--");function v3(t,e,n){D7(e)?t.style.setProperty(e,n):t.style[e]=n}const j7={};function y3(t,e){const n=WP(t);return()=>j7[e]??n()}const F7=y3(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),_3=y3(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),wd=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,MC={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:wd([0,.65,.55,1]),circOut:wd([.55,0,1,.45]),backIn:wd([.31,.01,.66,-.59]),backOut:wd([.33,1.53,.69,.99])};function x3(t,e){if(t)return typeof t=="function"?_3()?f3(t,e):"ease-out":n3(t)?wd(t):Array.isArray(t)?t.map(n=>x3(n,e)||MC.easeOut):MC[t]}function V7(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:c="easeOut",times:u}={},f=void 0){const h={[e]:n};u&&(h.offset=u);const p=x3(c,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:a==="reverse"?"alternate":"normal"};return f&&(m.pseudoElement=f),t.animate(h,m)}function w3(t){return typeof t=="function"&&"applyToOptions"in t}function $7({type:t,...e}){return w3(t)&&_3()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class b3 extends q2{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:a=!1,finalKeyframe:c,onComplete:u}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,o0(typeof e.type!="string");const f=$7(e);this.animation=V7(n,r,s,f,i),f.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const h=a0(s,this.options,c,this.speed);this.updateMotionValue&&this.updateMotionValue(h),v3(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 ms(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+ms(e)}get time(){return ms(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Xr(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&&F7()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),_s):s(this)}}const S3={anticipate:QP,backInOut:XP,circInOut:e3};function H7(t){return t in S3}function z7(t){typeof t.ease=="string"&&H7(t.ease)&&(t.ease=S3[t.ease])}const Qv=10;class U7 extends b3{constructor(e){z7(e),p3(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,...a}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const c=new Rm({...a,autoplay:!1}),u=Math.max(Qv,ar.now()-this.startTime),f=vi(0,Qv,u-Qv),h=c.sample(u).value,{name:p}=this.options;i&&p&&v3(i,p,h),n.setWithVelocity(c.sample(Math.max(0,u-f)).value,h,f),c.stop()}}const OC=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Hs.test(t)||t==="0")&&!t.startsWith("url("));function B7(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 W7(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],a=OC(s,e),c=OC(i,e);return!a||!c?!1:B7(t)||(n==="spring"||w3(n))&&r}function i_(t){t.duration=0,t.type="keyframes"}const E3=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),G7=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function K7(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&G7.test(t[e]))return!0;return!1}const Z7=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),q7=WP(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Y7(t){var p;const{motionValue:e,name:n,repeatDelay:r,repeatType:s,damping:i,type:a,keyframes:c}=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:f,transformTemplate:h}=e.owner.getProps();return q7()&&n&&(E3.has(n)||Z7.has(n)&&K7(c))&&(n!=="transform"||!h)&&!f&&!r&&s!=="mirror"&&i!==0&&a!=="inertia"}const X7=40;class Q7 extends q2{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a="loop",keyframes:c,name:u,motionValue:f,element:h,...p}){var x;super(),this.stop=()=>{var y,w;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=ar.now();const m={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:a,name:u,motionValue:f,element:h,...p},_=(h==null?void 0:h.KeyframeResolver)||Y2;this.keyframeResolver=new _(c,(y,w,S)=>this.onKeyframesResolved(y,w,m,!S),u,f,h),(x=this.keyframeResolver)==null||x.scheduleResolve()}onKeyframesResolved(e,n,r,s){var S,T;this.keyframeResolver=void 0;const{name:i,type:a,velocity:c,delay:u,isHandoff:f,onUpdate:h}=r;this.resolvedAt=ar.now();let p=!0;W7(e,i,a,c)||(p=!1,(la.instantAnimations||!u)&&(h==null||h(a0(e,r,n))),e[0]=e[e.length-1],i_(r),r.repeat=0);const _={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>X7?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},x=p&&!f&&Y7(_),y=(T=(S=_.motionValue)==null?void 0:S.owner)==null?void 0:T.current;let w;if(x)try{w=new U7({..._,element:y})}catch{w=new Rm(_)}else w=new Rm(_);w.finished.then(()=>{this.notifyFinished()}).catch(_s),this.pendingTimeline&&(this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=w}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(),N7()),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 C3(t,e,n,r=0,s=1){const i=Array.from(t).sort((f,h)=>f.sortNodePosition(h)).indexOf(e),a=t.size,c=(a-1)*r;return typeof n=="function"?n(i,a):s===1?i*r:c-i*r}const LC=30,J7=t=>!isNaN(parseFloat(t));class ej{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=ar.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 a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=ar.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=J7(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 H2);const r=this.events[e].add(n);return e==="change"?()=>{r(),Ct.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=ar.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>LC)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,LC);return GP(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 tu(t,e){return new ej(t,e)}function k3(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function X2(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?k3(n,t):n}const tj={type:"spring",stiffness:500,damping:25,restSpeed:10},nj=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),rj={type:"keyframes",duration:.8},sj={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ij=(t,{keyframes:e})=>e.length>2?rj:cu.has(t)?t.startsWith("scale")?nj(e[1]):tj:sj,oj=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function aj(t){for(const e in t)if(!oj.has(e))return!0;return!1}const Q2=(t,e,n,r={},s,i)=>a=>{const c=X2(r,t)||{},u=c.delay||r.delay||0;let{elapsed:f=0}=r;f=f-Xr(u);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...c,delay:-f,onUpdate:m=>{e.set(m),c.onUpdate&&c.onUpdate(m)},onComplete:()=>{a(),c.onComplete&&c.onComplete()},name:t,motionValue:e,element:i?void 0:s};aj(c)||Object.assign(h,ij(t,h)),h.duration&&(h.duration=Xr(h.duration)),h.repeatDelay&&(h.repeatDelay=Xr(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let p=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(i_(h),h.delay===0&&(p=!0)),(la.instantAnimations||la.skipAnimations||s!=null&&s.shouldSkipAnimations||c.skipAnimations)&&(p=!0,i_(h),h.delay=0),h.allowFlatten=!c.type&&!c.ease,p&&!i&&e.get()!==void 0){const m=a0(h.keyframes,c);if(m!==void 0){Ct.update(()=>{h.onUpdate(m),h.onComplete()});return}}return c.isSync?new Rm(h):new Q7(h)},lj=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function cj(t){const e=lj.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function P3(t,e,n=1){const[r,s]=cj(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const a=i.trim();return zP(a)?parseFloat(a):a}return B2(s)?P3(s,e,n+1):s}function NC(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function J2(t,e,n,r){if(typeof e=="function"){const[s,i]=NC(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]=NC(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function _l(t,e,n){const r=t.getProps();return J2(r,e,n!==void 0?n:r.custom,t)}const T3=new Set(["width","height","top","left","right","bottom",...lu]),o_=t=>Array.isArray(t);function uj(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,tu(n))}function dj(t){return o_(t)?t[t.length-1]||0:t}function fj(t,e){const n=_l(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const c=dj(i[a]);uj(t,a,c)}}const Fn=t=>!!(t&&t.getVelocity);function hj(t){return!!(Fn(t)&&t.add)}function a_(t,e){const n=t.getValue("willChange");if(hj(n))return n.add(e);if(!n&&la.WillChange){const r=new la.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function ex(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const pj="framerAppearId",R3="data-"+ex(pj);function A3(t){return t.props[R3]}function mj({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function I3(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:a,...c}=e;const u=t.getDefaultTransition();i=i?k3(i,u):u;const f=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],_=i==null?void 0:i.path;_&&_.animateVisualElement(t,c,i,n,p);for(const x in c){const y=t.getValue(x,t.latestValues[x]??null),w=c[x];if(w===void 0||m&&mj(m,x))continue;const S={delay:n,...X2(i||{},x)};h&&(S.skipAnimations=!0);const T=y.get();if(T!==void 0&&!y.isAnimating()&&!Array.isArray(w)&&w===T&&!S.velocity){Ct.update(()=>y.set(w));continue}let P=!1;if(window.MotionHandoffAnimation){const L=A3(t);if(L){const O=window.MotionHandoffAnimation(L,x,Ct);O!==null&&(S.startTime=O,P=!0)}}a_(t,x);const k=f??t.shouldReduceMotion;y.start(Q2(x,y,w,k&&T3.has(x)?{type:!1}:S,t,P));const R=y.animation;R&&p.push(R)}if(a){const x=()=>Ct.update(()=>{a&&fj(t,a)});p.length?Promise.all(p).then(x):x()}return p}function l_(t,e,n={}){var u;const r=_l(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(I3(t,r,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(f=0)=>{const{delayChildren:h=0,staggerChildren:p,staggerDirection:m}=s;return gj(t,e,f,h,p,m,n)}:()=>Promise.resolve(),{when:c}=s;if(c){const[f,h]=c==="beforeChildren"?[i,a]:[a,i];return f().then(()=>h())}else return Promise.all([i(),a(n.delay)])}function gj(t,e,n=0,r=0,s=0,i=1,a){const c=[];for(const u of t.variantChildren)u.notify("AnimationStart",e),c.push(l_(u,e,{...a,delay:n+(typeof r=="function"?0:r)+C3(t.variantChildren,u,r,s,i)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(c)}function vj(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>l_(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=l_(t,e,n);else{const s=typeof e=="function"?_l(t,e,n.custom):e;r=Promise.all(I3(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const yj={test:t=>t==="auto",parse:t=>t},M3=t=>e=>e.test(t),O3=[au,Le,gi,Gi,B9,U9,yj],DC=t=>O3.find(M3(t));function _j(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||BP(t):!0}const xj=new Set(["brightness","contrast","saturate","opacity"]);function wj(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(W2)||[];if(!r)return t;const s=n.replace(r,"");let i=xj.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const bj=/\b([a-z-]*)\(.*?\)/gu,c_={...Hs,getAnimatableNone:t=>{const e=t.match(bj);return e?e.map(wj).join(" "):t}},u_={...Hs,getAnimatableNone:t=>{const e=Hs.parse(t);return Hs.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},jC={...au,transform:Math.round},Sj={rotate:Gi,pathRotation:Gi,rotateX:Gi,rotateY:Gi,rotateZ:Gi,scale:np,scaleX:np,scaleY:np,scaleZ:np,skew:Gi,skewX:Gi,skewY:Gi,distance:Le,translateX:Le,translateY:Le,translateZ:Le,x:Le,y:Le,z:Le,perspective:Le,transformPerspective:Le,opacity:qd,originX:SC,originY:SC,originZ:Le},Am={borderWidth:Le,borderTopWidth:Le,borderRightWidth:Le,borderBottomWidth:Le,borderLeftWidth:Le,borderRadius:Le,borderTopLeftRadius:Le,borderTopRightRadius:Le,borderBottomRightRadius:Le,borderBottomLeftRadius:Le,width:Le,maxWidth:Le,height:Le,maxHeight:Le,top:Le,right:Le,bottom:Le,left:Le,inset:Le,insetBlock:Le,insetBlockStart:Le,insetBlockEnd:Le,insetInline:Le,insetInlineStart:Le,insetInlineEnd:Le,padding:Le,paddingTop:Le,paddingRight:Le,paddingBottom:Le,paddingLeft:Le,paddingBlock:Le,paddingBlockStart:Le,paddingBlockEnd:Le,paddingInline:Le,paddingInlineStart:Le,paddingInlineEnd:Le,margin:Le,marginTop:Le,marginRight:Le,marginBottom:Le,marginLeft:Le,marginBlock:Le,marginBlockStart:Le,marginBlockEnd:Le,marginInline:Le,marginInlineStart:Le,marginInlineEnd:Le,fontSize:Le,backgroundPositionX:Le,backgroundPositionY:Le,...Sj,zIndex:jC,fillOpacity:qd,strokeOpacity:qd,numOctaves:jC},Ej={...Am,color:mn,backgroundColor:mn,outlineColor:mn,fill:mn,stroke:mn,borderColor:mn,borderTopColor:mn,borderRightColor:mn,borderBottomColor:mn,borderLeftColor:mn,filter:c_,WebkitFilter:c_,mask:u_,WebkitMask:u_},L3=t=>Ej[t],Cj=new Set([c_,u_]);function N3(t,e){let n=L3(t);return Cj.has(n)||(n=Hs),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const kj=new Set(["auto","none","0"]);function Pj(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!kj.has(i)&&eu(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=N3(n,s)}class Tj extends Y2{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(),B2(p))){const m=P3(p,n.current);m!==void 0&&(e[h]=m),h===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!T3.has(r)||e.length!==2)return;const[s,i]=e,a=DC(s),c=DC(i),u=bC(s),f=bC(i);if(u!==f&&Xo[r]){this.needsMeasurement=!0;return}if(a!==c)if(IC(a)&&IC(c))for(let h=0;h<e.length;h++){const p=e[h];typeof p=="string"&&(e[h]=parseFloat(p))}else Xo[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||_j(e[s]))&&r.push(s);r.length&&Pj(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=Xo[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 c;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,a=r[i];r[i]=Xo[n](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),(c=this.removedTransforms)!=null&&c.length&&this.removedTransforms.forEach(([u,f])=>{e.getValue(u).set(f)}),this.resolveNoneKeyframes()}}const tx=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function D3(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 d_=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Ip(t){return UP(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:nx}=r3(queueMicrotask,!1),Ds={x:!1,y:!1};function j3(){return Ds.x||Ds.y}function Rj(t){return t==="x"||t==="y"?Ds[t]?null:(Ds[t]=!0,()=>{Ds[t]=!1}):Ds.x||Ds.y?null:(Ds.x=Ds.y=!0,()=>{Ds.x=Ds.y=!1})}function F3(t,e){const n=D3(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function Aj(t){return!(t.pointerType==="touch"||j3())}function Ij(t,e,n={}){const[r,s,i]=F3(t,n);return r.forEach(a=>{let c=!1,u=!1,f;const h=()=>{a.removeEventListener("pointerleave",x)},p=w=>{f&&(f(w),f=void 0),h()},m=w=>{c=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),u&&(u=!1,p(w))},_=()=>{c=!0,window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",m,s)},x=w=>{if(w.pointerType!=="touch"){if(c){u=!0;return}p(w)}},y=w=>{if(!Aj(w))return;u=!1;const S=e(a,w);typeof S=="function"&&(f=S,a.addEventListener("pointerleave",x,s))};a.addEventListener("pointerenter",y,s),a.addEventListener("pointerdown",_,s)}),i}const V3=(t,e)=>e?t===e?!0:V3(t,e.parentElement):!1,rx=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Mj=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Oj(t){return Mj.has(t.tagName)||t.isContentEditable===!0}const Lj=new Set(["INPUT","SELECT","TEXTAREA"]);function Nj(t){return Lj.has(t.tagName)||t.isContentEditable===!0}const Mp=new WeakSet;function FC(t){return e=>{e.key==="Enter"&&t(e)}}function Jv(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Dj=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=FC(()=>{if(Mp.has(n))return;Jv(n,"down");const s=FC(()=>{Jv(n,"up")}),i=()=>Jv(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 VC(t){return rx(t)&&!j3()}const $C=new WeakSet;function jj(t,e,n={}){const[r,s,i]=F3(t,n),a=c=>{const u=c.currentTarget;if(!VC(c)||$C.has(c))return;Mp.add(u),n.stopPropagation&&$C.add(c);const f=e(u,c),h={...s,capture:!0},p=(x,y)=>{window.removeEventListener("pointerup",m,h),window.removeEventListener("pointercancel",_,h),Mp.has(u)&&Mp.delete(u),VC(x)&&typeof f=="function"&&f(x,{success:y})},m=x=>{p(x,u===window||u===document||n.useGlobalTarget||V3(u,x.target))},_=x=>{p(x,!1)};window.addEventListener("pointerup",m,h),window.addEventListener("pointercancel",_,h)};return r.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",a,s),Ip(c)&&(c.addEventListener("focus",f=>Dj(f,s)),!Oj(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),i}function sx(t){return UP(t)&&"ownerSVGElement"in t}const Op=new WeakMap;let Ho;const $3=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:sx(r)&&"getBBox"in r?r.getBBox()[e]:r[n],Fj=$3("inline","width","offsetWidth"),Vj=$3("block","height","offsetHeight");function $j({target:t,borderBoxSize:e}){var n;(n=Op.get(t))==null||n.forEach(r=>{r(t,{get width(){return Fj(t,e)},get height(){return Vj(t,e)}})})}function Hj(t){t.forEach($j)}function zj(){typeof ResizeObserver>"u"||(Ho=new ResizeObserver(Hj))}function Uj(t,e){Ho||zj();const n=D3(t);return n.forEach(r=>{let s=Op.get(r);s||(s=new Set,Op.set(r,s)),s.add(e),Ho==null||Ho.observe(r)}),()=>{n.forEach(r=>{const s=Op.get(r);s==null||s.delete(e),s!=null&&s.size||Ho==null||Ho.unobserve(r)})}}const Lp=new Set;let wc;function Bj(){wc=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Lp.forEach(e=>e(t))},window.addEventListener("resize",wc)}function Wj(t){return Lp.add(t),wc||Bj(),()=>{Lp.delete(t),!Lp.size&&typeof wc=="function"&&(window.removeEventListener("resize",wc),wc=void 0)}}function HC(t,e){return typeof t=="function"?Wj(t):Uj(t,e)}function Gj(t){return sx(t)&&t.tagName==="svg"}const Kj=[...O3,mn,Hs],Zj=t=>Kj.find(M3(t)),zC=()=>({translate:0,scale:1,origin:0,originPoint:0}),bc=()=>({x:zC(),y:zC()}),UC=()=>({min:0,max:0}),xn=()=>({x:UC(),y:UC()}),qj=new WeakMap;function l0(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Yd(t){return typeof t=="string"||Array.isArray(t)}const ix=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ox=["initial",...ix];function c0(t){return l0(t.animate)||ox.some(e=>Yd(t[e]))}function H3(t){return!!(c0(t)||t.variants)}function Yj(t,e,n){for(const r in e){const s=e[r],i=n[r];if(Fn(s))t.addValue(r,s);else if(Fn(i))t.addValue(r,tu(s,{owner:t}));else if(i!==s)if(t.hasValue(r)){const a=t.getValue(r);a.liveStyle===!0?a.jump(s):a.hasAnimated||a.set(s)}else{const a=t.getStaticValue(r);t.addValue(r,tu(a!==void 0?a:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const Im={current:null},ax={current:!1},Xj=typeof window<"u";function z3(){if(ax.current=!0,!!Xj)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 BC=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Mm={};function U3(t){Mm=t}function Qj(){return Mm}class Jj{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:a,visualState:c},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=Y2,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 _=ar.now();this.renderScheduledAt<_&&(this.renderScheduledAt=_,Ct.render(this.render,!1,!0))};const{latestValues:f,renderState:h}=c;this.latestValues=f,this.baseTarget={...f},this.initialValues=n.initial?{...f}:{},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=!!a,this.isControllingVariants=c0(n),this.isVariantNode=H3(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:p,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const _ in m){const x=m[_];f[_]!==void 0&&Fn(x)&&x.set(f[_])}}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,qj.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:(ax.current||z3(),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(),ca(this.notifyUpdate),ca(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&&E3.has(e)&&this.current instanceof HTMLElement){const{factory:a,keyframes:c,times:u,ease:f,duration:h}=n.accelerate,p=new b3({element:this.current,name:e,keyframes:c,times:u,ease:f,duration:Xr(h)}),m=a(p);this.valueSubscriptions.set(e,()=>{m(),p.cancel()});return}const r=cu.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&Ct.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 Mm){const n=Mm[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):xn()}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<BC.length;r++){const s=BC[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,a=e[i];a&&(this.propEventSubscriptions[s]=this.on(s,a))}this.prevMotionValues=Yj(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=tu(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"&&(zP(r)||BP(r))?r=parseFloat(r):!Zj(r)&&Hs.test(n)&&(r=N3(e,n)),this.setBaseTarget(e,Fn(r)?r.get():r)),Fn(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 a=J2(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);a&&(r=a[e])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!Fn(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 H2),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){nx.render(this.render)}}class B3 extends Jj{constructor(){super(...arguments),this.KeyframeResolver=Tj}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;Fn(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ga{constructor(e){this.isMounted=!1,this.node=e}update(){}}function W3({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function eF({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function tF(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 e1(t){return t===void 0||t===1}function f_({scale:t,scaleX:e,scaleY:n}){return!e1(t)||!e1(e)||!e1(n)}function Ja(t){return f_(t)||G3(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function G3(t){return WC(t.x)||WC(t.y)}function WC(t){return t&&t!=="0%"}function Om(t,e,n){const r=t-n,s=e*r;return n+s}function GC(t,e,n,r,s){return s!==void 0&&(t=Om(t,s,r)),Om(t,n,r)+e}function h_(t,e=0,n=1,r,s){t.min=GC(t.min,e,n,r,s),t.max=GC(t.max,e,n,r,s)}function K3(t,{x:e,y:n}){h_(t.x,e.translate,e.scale,e.originPoint),h_(t.y,n.translate,n.scale,n.originPoint)}const KC=.999999999999,ZC=1.0000000000001;function nF(t,e,n,r=!1){var c;const s=n.length;if(!s)return;e.x=e.y=1;let i,a;for(let u=0;u<s;u++){i=n[u],a=i.projectionDelta;const{visualElement:f}=i.options;f&&f.props.style&&f.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(ui(t.x,-i.scroll.offset.x),ui(t.y,-i.scroll.offset.y)),a&&(e.x*=a.x.scale,e.y*=a.y.scale,K3(t,a)),r&&Ja(i.latestValues)&&Np(t,i.latestValues,(c=i.layout)==null?void 0:c.layoutBox))}e.x<ZC&&e.x>KC&&(e.x=1),e.y<ZC&&e.y>KC&&(e.y=1)}function ui(t,e){t.min+=e,t.max+=e}function qC(t,e,n,r,s=.5){const i=Et(t.min,t.max,s);h_(t,e,n,i,r)}function YC(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function Np(t,e,n){const r=n??t;qC(t.x,YC(e.x,r.x),e.scaleX,e.scale,e.originX),qC(t.y,YC(e.y,r.y),e.scaleY,e.scale,e.originY)}function Z3(t,e){return W3(tF(t.getBoundingClientRect(),e))}function rF(t,e,n){const r=Z3(t,n),{scroll:s}=e;return s&&(ui(r.x,s.offset.x),ui(r.y,s.offset.y)),r}const sF={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},iF=lu.length;function oF(t,e,n){let r="",s=!0;for(let a=0;a<iF;a++){const c=lu[a],u=t[c];if(u===void 0)continue;let f=!0;if(typeof u=="number")f=u===(c.startsWith("scale")?1:0);else{const h=parseFloat(u);f=c.startsWith("scale")?h===1:h===0}if(!f||n){const h=d_(u,Am[c]);if(!f){s=!1;const p=sF[c]||c;r+=`${p}(${h}) `}n&&(e[c]=h)}}const i=t.pathRotation;return i&&(s=!1,r+=`rotate(${d_(i,Am.pathRotation)}) `),r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function lx(t,e,n){const{style:r,vars:s,transformOrigin:i}=t;let a=!1,c=!1;for(const u in e){const f=e[u];if(cu.has(u)){a=!0;continue}else if(i3(u)){s[u]=f;continue}else{const h=d_(f,Am[u]);u.startsWith("origin")?(c=!0,i[u]=h):r[u]=h}}if(e.transform||(a||n?r.transform=oF(e,t.transform,n):r.transform&&(r.transform="none")),c){const{originX:u="50%",originY:f="50%",originZ:h=0}=i;r.transformOrigin=`${u} ${f} ${h}`}}function q3(t,{style:e,vars:n},r,s){const i=t.style;let a;for(a in e)i[a]=e[a];s==null||s.applyProjectionStyles(i,r);for(a in n)i.setProperty(a,n[a])}function XC(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const dd={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Le.test(t))t=parseFloat(t);else return t;const n=XC(t,e.target.x),r=XC(t,e.target.y);return`${n}% ${r}%`}},aF={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=Hs.parse(t);if(s.length>5)return r;const i=Hs.createTransformer(t),a=typeof s[0]!="number"?1:0,c=n.x.scale*e.x,u=n.y.scale*e.y;s[0+a]/=c,s[1+a]/=u;const f=Et(c,u,.5);return typeof s[2+a]=="number"&&(s[2+a]/=f),typeof s[3+a]=="number"&&(s[3+a]/=f),i(s)}},p_={borderRadius:{...dd,applyTo:[...tx]},borderTopLeftRadius:dd,borderTopRightRadius:dd,borderBottomLeftRadius:dd,borderBottomRightRadius:dd,boxShadow:aF};function Y3(t,{layout:e,layoutId:n}){return cu.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!p_[t]||t==="opacity")}function cx(t,e,n){var a;const r=t.style,s=e==null?void 0:e.style,i={};if(!r)return i;for(const c in r)(Fn(r[c])||s&&Fn(s[c])||Y3(c,t)||((a=n==null?void 0:n.getValue(c))==null?void 0:a.liveStyle)!==void 0)&&(i[c]=r[c]);return i}function lF(t){return window.getComputedStyle(t)}class cF extends B3{constructor(){super(...arguments),this.type="html",this.renderInstance=q3}mount(e){o0(!!e.style),super.mount(e)}readValueFromInstance(e,n){var r;if(cu.has(n))return(r=this.projection)!=null&&r.isProjecting?e_(n):A7(e,n);{const s=lF(e),i=(i3(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Z3(e,n)}build(e,n,r){lx(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return cx(e,n,r)}}const uF={offset:"stroke-dashoffset",array:"stroke-dasharray"},dF={offset:"strokeDashoffset",array:"strokeDasharray"};function fF(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?uF:dF;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const hF=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function X3(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:a=0,...c},u,f,h){if(lx(t,c,f),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 _ of hF)p[_]!==void 0&&(m[_]=p[_],delete p[_]);e!==void 0&&(p.x=e),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),s!==void 0&&fF(p,s,i,a,!1)}const Q3=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"]),J3=t=>typeof t=="string"&&t.toLowerCase()==="svg";function pF(t,e,n,r){q3(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(Q3.has(s)?s:ex(s),e.attrs[s])}function eT(t,e,n){const r=cx(t,e,n);for(const s in t)if(Fn(t[s])||Fn(e[s])){const i=lu.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class mF extends B3{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=xn}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(cu.has(n)){const r=L3(n);return r&&r.default||0}return n=Q3.has(n)?n:ex(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return eT(e,n,r)}build(e,n,r){X3(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){pF(e,n,r,s)}mount(e){this.isSVGTag=J3(e.tagName),super.mount(e)}}const gF=ox.length;function tT(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?tT(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<gF;n++){const r=ox[n],s=t.props[r];(Yd(s)||s===!1)&&(e[r]=s)}return e}function nT(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 vF=[...ix].reverse(),yF=ix.length;function _F(t){return e=>Promise.all(e.map(({animation:n,options:r})=>vj(t,n,r)))}function xF(t){let e=_F(t),n=QC(),r=!0,s=!1;const i=f=>(h,p)=>{var _;const m=_l(t,p,f==="exit"?(_=t.presenceContext)==null?void 0:_.custom:void 0);if(m){const{transition:x,transitionEnd:y,...w}=m;h={...h,...w,...y}}return h};function a(f){e=f(t)}function c(f){const{props:h}=t,p=tT(t.parent)||{},m=[],_=new Set;let x={},y=1/0;for(let S=0;S<yF;S++){const T=vF[S],P=n[T],k=h[T]!==void 0?h[T]:p[T],R=Yd(k),L=T===f?P.isActive:null;L===!1&&(y=S);let O=k===p[T]&&k!==h[T]&&R;if(O&&(r||s)&&t.manuallyAnimateOnMount&&(O=!1),P.protectedKeys={...x},!P.isActive&&L===null||!k&&!P.prevProp||l0(k)||typeof k=="boolean")continue;if(T==="exit"&&P.isActive&&L!==!0){P.prevResolvedValues&&(x={...x,...P.prevResolvedValues});continue}const A=wF(P.prevProp,k);let I=A||T===f&&P.isActive&&!O&&R||S>y&&R,N=!1;const j=Array.isArray(k)?k:[k];let F=j.reduce(i(T),{});L===!1&&(F={});const{prevResolvedValues:K={}}=P,X={...K,...F},W=$=>{I=!0,_.has($)&&(N=!0,_.delete($)),P.needsAnimating[$]=!0;const ne=t.getValue($);ne&&(ne.liveStyle=!1)};for(const $ in X){const ne=F[$],z=K[$];if(x.hasOwnProperty($))continue;let D=!1;o_(ne)&&o_(z)?D=!nT(ne,z)||A:D=ne!==z,D?ne!=null?W($):_.add($):ne!==void 0&&_.has($)?W($):P.protectedKeys[$]=!0}P.prevProp=k,P.prevResolvedValues=F,P.isActive&&(x={...x,...F}),(r||s)&&t.blockInitialAnimation&&(I=!1);const G=O&&A;I&&(!G||N)&&m.push(...j.map($=>{const ne={type:T};if(typeof $=="string"&&(r||s)&&!G&&t.manuallyAnimateOnMount&&t.parent){const{parent:z}=t,D=_l(z,$);if(z.enteringChildren&&D){const{delayChildren:Y}=D.transition||{};ne.delay=C3(z.enteringChildren,t,Y)}}return{animation:$,options:ne}}))}if(_.size){const S={};if(typeof h.initial!="boolean"){const T=_l(t,Array.isArray(h.initial)?h.initial[0]:h.initial);T&&T.transition&&(S.transition=T.transition)}_.forEach(T=>{const P=t.getBaseTarget(T),k=t.getValue(T);k&&(k.liveStyle=!0),S[T]=P??null}),m.push({animation:S})}let w=!!m.length;return r&&(h.initial===!1||h.initial===h.animate)&&!t.manuallyAnimateOnMount&&(w=!1),r=!1,s=!1,w?e(m):Promise.resolve()}function u(f,h){var m;if(n[f].isActive===h)return Promise.resolve();(m=t.variantChildren)==null||m.forEach(_=>{var x;return(x=_.animationState)==null?void 0:x.setActive(f,h)}),n[f].isActive=h;const p=c(f);for(const _ in n)n[_].protectedKeys={};return p}return{animateChanges:c,setActive:u,setAnimateFunction:a,getState:()=>n,reset:()=>{n=QC(),s=!0}}}function wF(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!nT(e,t):!1}function za(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function QC(){return{animate:za(!0),whileInView:za(),whileHover:za(),whileTap:za(),whileDrag:za(),whileFocus:za(),exit:za()}}function m_(t,e){t.min=e.min,t.max=e.max}function Os(t,e){m_(t.x,e.x),m_(t.y,e.y)}function JC(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const rT=1e-4,bF=1-rT,SF=1+rT,sT=.01,EF=0-sT,CF=0+sT;function lr(t){return t.max-t.min}function kF(t,e,n){return Math.abs(t-e)<=n}function e4(t,e,n,r=.5){t.origin=r,t.originPoint=Et(e.min,e.max,t.origin),t.scale=lr(n)/lr(e),t.translate=Et(n.min,n.max,t.origin)-t.originPoint,(t.scale>=bF&&t.scale<=SF||isNaN(t.scale))&&(t.scale=1),(t.translate>=EF&&t.translate<=CF||isNaN(t.translate))&&(t.translate=0)}function Md(t,e,n,r){e4(t.x,e.x,n.x,r?r.originX:void 0),e4(t.y,e.y,n.y,r?r.originY:void 0)}function t4(t,e,n,r=0){const s=r?Et(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+lr(e)}function PF(t,e,n,r){t4(t.x,e.x,n.x,r==null?void 0:r.x),t4(t.y,e.y,n.y,r==null?void 0:r.y)}function n4(t,e,n,r=0){const s=r?Et(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+lr(e)}function Lm(t,e,n,r){n4(t.x,e.x,n.x,r==null?void 0:r.x),n4(t.y,e.y,n.y,r==null?void 0:r.y)}function r4(t,e,n,r,s){return t-=e,t=Om(t,1/n,r),s!==void 0&&(t=Om(t,1/s,r)),t}function TF(t,e=0,n=1,r=.5,s,i=t,a=t){if(gi.test(e)&&(e=parseFloat(e),e=Et(a.min,a.max,e/100)-a.min),typeof e!="number")return;let c=Et(i.min,i.max,r);t===i&&(c-=e),t.min=r4(t.min,e,n,c,s),t.max=r4(t.max,e,n,c,s)}function s4(t,e,[n,r,s],i,a){TF(t,e[n],e[r],e[s],e.scale,i,a)}const RF=["x","scaleX","originX"],AF=["y","scaleY","originY"];function i4(t,e,n,r){s4(t.x,e,RF,n?n.x:void 0,r?r.x:void 0),s4(t.y,e,AF,n?n.y:void 0,r?r.y:void 0)}function o4(t){return t.translate===0&&t.scale===1}function iT(t){return o4(t.x)&&o4(t.y)}function a4(t,e){return t.min===e.min&&t.max===e.max}function IF(t,e){return a4(t.x,e.x)&&a4(t.y,e.y)}function l4(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function oT(t,e){return l4(t.x,e.x)&&l4(t.y,e.y)}function c4(t){return lr(t.x)/lr(t.y)}function u4(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function ii(t){return[t("x"),t("y")]}function MF(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,a=(n==null?void 0:n.z)||0;if((s||i||a)&&(r=`translate3d(${s}px, ${i}px, ${a}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:f,rotate:h,pathRotation:p,rotateX:m,rotateY:_,skewX:x,skewY:y}=n;f&&(r=`perspective(${f}px) ${r}`),h&&(r+=`rotate(${h}deg) `),p&&(r+=`rotate(${p}deg) `),m&&(r+=`rotateX(${m}deg) `),_&&(r+=`rotateY(${_}deg) `),x&&(r+=`skewX(${x}deg) `),y&&(r+=`skewY(${y}deg) `)}const c=t.x.scale*e.x,u=t.y.scale*e.y;return(c!==1||u!==1)&&(r+=`scale(${c}, ${u})`),r||"none"}const OF=tx.length,d4=t=>typeof t=="string"?parseFloat(t):t,f4=t=>typeof t=="number"||Le.test(t);function LF(t,e,n,r,s,i){s?(t.opacity=Et(0,n.opacity??1,NF(r)),t.opacityExit=Et(e.opacity??1,0,DF(r))):i&&(t.opacity=Et(e.opacity??1,n.opacity??1,r));for(let a=0;a<OF;a++){const c=tx[a];let u=h4(e,c),f=h4(n,c);if(u===void 0&&f===void 0)continue;u||(u=0),f||(f=0),u===0||f===0||f4(u)===f4(f)?(t[c]=Math.max(Et(d4(u),d4(f),r),0),(gi.test(f)||gi.test(u))&&(t[c]+="%")):t[c]=f}(e.rotate||n.rotate)&&(t.rotate=Et(e.rotate||0,n.rotate||0,r))}function h4(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const NF=aT(0,.5,JP),DF=aT(.5,.95,_s);function aT(t,e,n){return r=>r<t?0:r>e?1:n(Zd(t,e,r))}function jF(t,e,n){const r=Fn(t)?t:tu(t);return r.start(Q2("",r,e,n)),r.animation}function Xd(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}const FF=(t,e)=>t.depth-e.depth;class VF{constructor(){this.children=[],this.isDirty=!1}add(e){$2(this.children,e),this.isDirty=!0}remove(e){Cm(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(FF),this.isDirty=!1,this.children.forEach(e)}}function $F(t,e){const n=ar.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(ca(r),t(i-e))};return Ct.setup(r,!0),()=>ca(r)}function Dp(t){return Fn(t)?t.get():t}class HF{constructor(){this.members=[]}add(e){$2(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&&(Cm(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(Cm(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:a}=e.options;(i===void 0||i!==a)&&(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,a;(r=(n=e.options).onExitComplete)==null||r.call(n),(a=(s=e.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||a.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 jp={hasAnimatedSinceResize:!0,hasEverUpdated:!1},t1=["","X","Y","Z"],zF=1e3;let UF=0;function n1(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function lT(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=A3(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Ct,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&lT(r)}function cT({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},c=e==null?void 0:e()){this.id=UF++,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(GF),this.nodes.forEach(QF),this.nodes.forEach(JF),this.nodes.forEach(KF)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new VF)}addEventListener(a,c){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new H2),this.eventHandlers.get(a).add(c)}notifyListeners(a,...c){const u=this.eventHandlers.get(a);u&&u.notify(...c)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=sx(a)&&!Gj(a),this.instance=a;const{layoutId:c,layout:u,visualElement:f}=this.options;if(f&&!f.current&&f.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(u||c)&&(this.isLayoutDirty=!0),t){let h,p=0;const m=()=>this.root.updateBlockedByResize=!1;Ct.read(()=>{p=window.innerWidth}),t(a,()=>{const _=window.innerWidth;_!==p&&(p=_,this.root.updateBlockedByResize=!0,h&&h(),h=$F(m,250),jp.hasAnimatedSinceResize&&(jp.hasAnimatedSinceResize=!1,this.nodes.forEach(g4)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&f&&(c||u)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:p,hasRelativeLayoutChanged:m,layout:_})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||f.getDefaultTransition()||sV,{onLayoutAnimationStart:y,onLayoutAnimationComplete:w}=f.getProps(),S=!this.targetLayout||!oT(this.targetLayout,_),T=!p&&m;if(this.options.layoutRoot||this.resumeFrom||T||p&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const P={...X2(x,"layout"),onPlay:y,onComplete:w};(f.shouldReduceMotion||this.options.layoutRoot)&&(P.delay=0,P.type=!1),this.startAnimation(P),this.setAnimationOrigin(h,T,P.path)}else p||g4(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=_})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ca(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(eV),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&lT(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:c,layout:u}=this.options;if(c===void 0&&!u)return;const f=this.getTransformTemplate();this.prevTransformTemplateValue=f?f(this.latestValues,""):void 0,this.updateSnapshot(),a&&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(qF),this.nodes.forEach(p4);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(m4);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(YF),this.nodes.forEach(XF),this.nodes.forEach(BF),this.nodes.forEach(WF)):this.nodes.forEach(m4),this.clearAllSnapshots();const c=ar.now();Nn.delta=vi(0,1e3/60,c-Nn.timestamp),Nn.timestamp=c,Nn.isProcessing=!0,Kv.update.process(Nn),Kv.preRender.process(Nn),Kv.render.process(Nn),Nn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,nx.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ZF),this.sharedNodes.forEach(tV)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ct.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ct.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!lr(this.snapshot.measuredBox.x)&&!lr(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 a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=xn()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:c}=this.options;c&&c.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let c=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(c=!1),c&&this.instance){const u=r(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:u,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!s)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,c=this.projectionDelta&&!iT(this.projectionDelta),u=this.getTransformTemplate(),f=u?u(this.latestValues,""):void 0,h=f!==this.prevTransformTemplateValue;a&&this.instance&&(c||Ja(this.latestValues)||h)&&(s(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const c=this.measurePageBox();let u=this.removeElementScroll(c);return a&&(u=this.removeTransform(u)),iV(u),{animationId:this.root.animationId,measuredBox:c,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var f;const{visualElement:a}=this.options;if(!a)return xn();const c=a.measureViewportBox();if(!(((f=this.scroll)==null?void 0:f.wasRoot)||this.path.some(oV))){const{scroll:h}=this.root;h&&(ui(c.x,h.offset.x),ui(c.y,h.offset.y))}return c}removeElementScroll(a){var u;const c=xn();if(Os(c,a),(u=this.scroll)!=null&&u.wasRoot)return c;for(let f=0;f<this.path.length;f++){const h=this.path[f],{scroll:p,options:m}=h;h!==this.root&&p&&m.layoutScroll&&(p.wasRoot&&Os(c,a),ui(c.x,p.offset.x),ui(c.y,p.offset.y))}return c}applyTransform(a,c=!1,u){var h,p;const f=u||xn();Os(f,a);for(let m=0;m<this.path.length;m++){const _=this.path[m];!c&&_.options.layoutScroll&&_.scroll&&_!==_.root&&(ui(f.x,-_.scroll.offset.x),ui(f.y,-_.scroll.offset.y)),Ja(_.latestValues)&&Np(f,_.latestValues,(h=_.layout)==null?void 0:h.layoutBox)}return Ja(this.latestValues)&&Np(f,this.latestValues,(p=this.layout)==null?void 0:p.layoutBox),f}removeTransform(a){var u;const c=xn();Os(c,a);for(let f=0;f<this.path.length;f++){const h=this.path[f];if(!Ja(h.latestValues))continue;let p;h.instance&&(f_(h.latestValues)&&h.updateSnapshot(),p=xn(),Os(p,h.measurePageBox())),i4(c,h.latestValues,(u=h.snapshot)==null?void 0:u.layoutBox,p)}return Ja(this.latestValues)&&i4(c,this.latestValues),c}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.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!==Nn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var _;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==c;if(!(a||u&&this.isSharedProjectionDirty||this.isProjectionDirty||(_=this.parent)!=null&&_.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:p}=this.options;if(!this.layout||!(h||p))return;this.resolvedRelativeTargetAt=Nn.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=xn(),this.targetWithTransforms=xn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),PF(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Os(this.target,this.layout.layoutBox),K3(this.target,this.targetDelta)):Os(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||f_(this.parent.latestValues)||G3(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,c,u){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=xn(),this.relativeTargetOrigin=xn(),Lm(this.relativeTargetOrigin,c,u,this.options.layoutAnchor||void 0),Os(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var x;const a=this.getLead(),c=!!this.resumingFrom||this!==a;let u=!0;if((this.isProjectionDirty||(x=this.parent)!=null&&x.isProjectionDirty)&&(u=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Nn.timestamp&&(u=!1),u)return;const{layout:f,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||!(f||h))return;Os(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,m=this.treeScale.y;nF(this.layoutCorrected,this.treeScale,this.path,c),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=xn());const{target:_}=a;if(!_){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(JC(this.prevProjectionDelta.x,this.projectionDelta.x),JC(this.prevProjectionDelta.y,this.projectionDelta.y)),Md(this.projectionDelta,this.layoutCorrected,_,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==m||!u4(this.projectionDelta.x,this.prevProjectionDelta.x)||!u4(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",_))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var c;if((c=this.options.visualElement)==null||c.scheduleRender(),a){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=bc(),this.projectionDelta=bc(),this.projectionDeltaWithTransform=bc()}setAnimationOrigin(a,c=!1,u){const f=this.snapshot,h=f?f.latestValues:{},p={...this.latestValues},m=bc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const _=xn(),x=f?f.source:void 0,y=this.layout?this.layout.source:void 0,w=x!==y,S=this.getStack(),T=!S||S.members.length<=1,P=!!(w&&!T&&this.options.crossfade===!0&&!this.path.some(rV));this.animationProgress=0;let k;const R=u==null?void 0:u.interpolateProjection(a);this.mixTargetDelta=L=>{const O=L/1e3,A=R==null?void 0:R(O);A?(m.x.translate=A.x,m.x.scale=Et(a.x.scale,1,O),m.x.origin=a.x.origin,m.x.originPoint=a.x.originPoint,m.y.translate=A.y,m.y.scale=Et(a.y.scale,1,O),m.y.origin=a.y.origin,m.y.originPoint=a.y.originPoint):(v4(m.x,a.x,O),v4(m.y,a.y,O)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Lm(_,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),nV(this.relativeTarget,this.relativeTargetOrigin,_,O),k&&IF(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=xn()),Os(k,this.relativeTarget)),w&&(this.animationValues=p,LF(p,h,this.latestValues,O,P,T)),A&&A.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=A.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=O},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var c,u,f;this.notifyListeners("animationStart"),(c=this.currentAnimation)==null||c.stop(),(f=(u=this.resumingFrom)==null?void 0:u.currentAnimation)==null||f.stop(),this.pendingAnimation&&(ca(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ct.update(()=>{jp.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=tu(0)),this.motionValue.jump(0,!1),this.currentAnimation=jF(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:h=>{this.mixTargetDelta(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{a.onComplete&&a.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 a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(zF),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:c,target:u,layout:f,latestValues:h}=a;if(!(!c||!u||!f)){if(this!==a&&this.layout&&f&&uT(this.options.animationType,this.layout.layoutBox,f.layoutBox)){u=this.target||xn();const p=lr(this.layout.layoutBox.x);u.x.min=a.target.x.min,u.x.max=u.x.min+p;const m=lr(this.layout.layoutBox.y);u.y.min=a.target.y.min,u.y.max=u.y.min+m}Os(c,u),Np(c,h),Md(this.projectionDeltaWithTransform,this.layoutCorrected,c,h)}}registerSharedNode(a,c){this.sharedNodes.has(a)||this.sharedNodes.set(a,new HF),this.sharedNodes.get(a).add(c);const f=c.options.initialPromotionConfig;c.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.shouldPreserveFollowOpacity(c):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var c;const{layoutId:a}=this.options;return a?((c=this.getStack())==null?void 0:c.lead)||this:this}getPrevLead(){var c;const{layoutId:a}=this.options;return a?(c=this.getStack())==null?void 0:c.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:c,preserveFollowOpacity:u}={}){const f=this.getStack();f&&f.promote(this,u),a&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let c=!1;const{latestValues:u}=a;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(c=!0),!c)return;const f={};u.z&&n1("z",a,f,this.animationValues);for(let h=0;h<t1.length;h++)n1(`rotate${t1[h]}`,a,f,this.animationValues),n1(`skew${t1[h]}`,a,f,this.animationValues);a.render();for(const h in f)a.setStaticValue(h,f[h]),this.animationValues&&(this.animationValues[h]=f[h]);a.scheduleRender()}applyProjectionStyles(a,c){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=Dp(c==null?void 0:c.pointerEvents)||"",a.transform=u?u(this.latestValues,""):"none";return}const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=Dp(c==null?void 0:c.pointerEvents)||""),this.hasProjected&&!Ja(this.latestValues)&&(a.transform=u?u({},""):"none",this.hasProjected=!1);return}a.visibility="";const h=f.animationValues||f.latestValues;this.applyTransformsToTarget();let p=MF(this.projectionDeltaWithTransform,this.treeScale,h);u&&(p=u(h,p)),a.transform=p;const{x:m,y:_}=this.projectionDelta;a.transformOrigin=`${m.origin*100}% ${_.origin*100}% 0`,f.animationValues?a.opacity=f===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:a.opacity=f===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const x in p_){if(h[x]===void 0)continue;const{correct:y,applyTo:w,isCSSVariable:S}=p_[x],T=p==="none"?h[x]:y(h[x],f);if(w){const P=w.length;for(let k=0;k<P;k++)a[w[k]]=T}else S?this.options.visualElement.renderState.vars[x]=T:a[x]=T}this.options.layoutId&&(a.pointerEvents=f===this?Dp(c==null?void 0:c.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var c;return(c=a.currentAnimation)==null?void 0:c.stop()}),this.root.nodes.forEach(p4),this.root.sharedNodes.clear()}}}function BF(t){t.updateLayout()}function WF(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,a=e.source!==t.layout.source;if(i==="size")ii(p=>{const m=a?e.measuredBox[p]:e.layoutBox[p],_=lr(m);m.min=r[p].min,m.max=m.min+_});else if(i==="x"||i==="y"){const p=i==="x"?"y":"x";m_(a?e.measuredBox[p]:e.layoutBox[p],r[p])}else uT(i,e.layoutBox,r)&&ii(p=>{const m=a?e.measuredBox[p]:e.layoutBox[p],_=lr(r[p]);m.max=m.min+_,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[p].max=t.relativeTarget[p].min+_)});const c=bc();Md(c,r,e.layoutBox);const u=bc();a?Md(u,t.applyTransform(s,!0),e.measuredBox):Md(u,r,e.layoutBox);const f=!iT(c);let h=!1;if(!t.resumeFrom){const p=t.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:m,layout:_}=p;if(m&&_){const x=t.options.layoutAnchor||void 0,y=xn();Lm(y,e.layoutBox,m.layoutBox,x);const w=xn();Lm(w,r,_.layoutBox,x),oT(y,w)||(h=!0),p.options.layoutRoot&&(t.relativeTarget=w,t.relativeTargetOrigin=y,t.relativeParent=p)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:u,layoutDelta:c,hasLayoutChanged:f,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function GF(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 KF(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ZF(t){t.clearSnapshot()}function p4(t){t.clearMeasurements()}function qF(t){t.isLayoutDirty=!0,t.updateLayout()}function m4(t){t.isLayoutDirty=!1}function YF(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function XF(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function g4(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function QF(t){t.resolveTargetDelta()}function JF(t){t.calcProjection()}function eV(t){t.resetSkewAndRotation()}function tV(t){t.removeLeadSnapshot()}function v4(t,e,n){t.translate=Et(e.translate,0,n),t.scale=Et(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function y4(t,e,n,r){t.min=Et(e.min,n.min,r),t.max=Et(e.max,n.max,r)}function nV(t,e,n,r){y4(t.x,e.x,n.x,r),y4(t.y,e.y,n.y,r)}function rV(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const sV={duration:.45,ease:[.4,0,.1,1]},_4=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),x4=_4("applewebkit/")&&!_4("chrome/")?Math.round:_s;function w4(t){t.min=x4(t.min),t.max=x4(t.max)}function iV(t){w4(t.x),w4(t.y)}function uT(t,e,n){return t==="position"||t==="preserve-aspect"&&!kF(c4(e),c4(n),.2)}function oV(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const aV=cT({attachResizeListener:(t,e)=>Xd(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}),r1={current:void 0},dT=cT({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!r1.current){const t=new aV({});t.mount(window),t.setOptions({layoutScroll:!0}),r1.current=t}return r1.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),ux=v.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function b4(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function lV(...t){return e=>{let n=!1;const r=t.map(s=>{const i=b4(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():b4(t[s],null)}}}}function cV(...t){return v.useCallback(lV(...t),t)}class uV extends v.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(Ip(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=Ip(r)&&r.offsetWidth||0,i=Ip(r)&&r.offsetHeight||0,a=getComputedStyle(n),c=this.props.sizeRef.current;c.height=parseFloat(a.height),c.width=parseFloat(a.width),c.top=n.offsetTop,c.left=n.offsetLeft,c.right=s-c.width-c.left,c.bottom=i-c.height-c.top,c.direction=a.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function dV({children:t,isPresent:e,anchorX:n,anchorY:r,root:s,pop:i}){var m;const a=v.useId(),c=v.useRef(null),u=v.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:f}=v.useContext(ux),h=i!==!1?((m=t.props)==null?void 0:m.ref)??(t==null?void 0:t.ref):void 0,p=cV(c,h);return v.useInsertionEffect(()=>{const{width:_,height:x,top:y,left:w,right:S,bottom:T,direction:P}=u.current;if(e||i===!1||!c.current||!_||!x)return;const k=P==="rtl",R=n==="left"?k?`right: ${S}`:`left: ${w}`:k?`left: ${w}`:`right: ${S}`,L=r==="bottom"?`bottom: ${T}`:`top: ${y}`;c.current.dataset.motionPopId=a;const O=document.createElement("style");f&&(O.nonce=f);const A=s??document.head;return A.appendChild(O),O.sheet&&O.sheet.insertRule(`
|
|
63
|
+
[data-motion-pop-id="${a}"] {
|
|
64
|
+
position: absolute !important;
|
|
65
|
+
width: ${_}px !important;
|
|
66
|
+
height: ${x}px !important;
|
|
67
|
+
${R}px !important;
|
|
68
|
+
${L}px !important;
|
|
69
|
+
}
|
|
70
|
+
`),()=>{var I;(I=c.current)==null||I.removeAttribute("data-motion-pop-id"),A.contains(O)&&A.removeChild(O)}},[e]),E.jsx(uV,{isPresent:e,childRef:c,sizeRef:u,pop:i,children:i===!1?t:v.cloneElement(t,{ref:p})})}const fV=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a,anchorX:c,anchorY:u,root:f})=>{const h=F2(hV),p=v.useId(),m=v.useRef(n),_=v.useRef(r);V2(()=>{m.current=n,_.current=r});let x=!0,y=v.useMemo(()=>(x=!1,{id:p,initial:e,isPresent:n,custom:s,onExitComplete:w=>{h.set(w,!0);for(const S of h.values())if(!S)return;r&&r()},register:w=>(h.set(w,!1),()=>{var S;h.delete(w),!m.current&&!h.size&&((S=_.current)==null||S.call(_))})}),[n,h,r]);return i&&x&&(y={...y}),v.useMemo(()=>{h.forEach((w,S)=>h.set(S,!1))},[n]),v.useEffect(()=>{!n&&!h.size&&r&&r()},[n]),t=E.jsx(dV,{pop:a==="popLayout",isPresent:n,anchorX:c,anchorY:u,root:f,children:t}),E.jsx(i0.Provider,{value:y,children:t})};function hV(){return new Map}function fT(t=!0){const e=v.useContext(i0);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=e,i=v.useId();v.useEffect(()=>{if(t)return s(i)},[t]);const a=v.useCallback(()=>t&&r&&r(i),[i,r,t]);return!n&&r?[!1,a]:[!0]}const rp=t=>t.key||"";function S4(t){const e=[];return v.Children.forEach(t,n=>{v.isValidElement(n)&&e.push(n)}),e}const oo=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:a=!1,anchorX:c="left",anchorY:u="top",root:f})=>{const[h,p]=fT(a),m=v.useMemo(()=>S4(t),[t]),_=a&&!h?[]:m.map(rp),x=v.useRef(!0),y=v.useRef(m),w=F2(()=>new Map),S=v.useRef(new Set),[T,P]=v.useState(m),[k,R]=v.useState(m);V2(()=>{x.current=!1,y.current=m;for(let A=0;A<k.length;A++){const I=rp(k[A]);_.includes(I)?(w.delete(I),S.current.delete(I)):w.get(I)!==!0&&w.set(I,!1)}},[k,_.length,_.join("-")]);const L=[];if(m!==T){let A=[...m];for(let I=0;I<k.length;I++){const N=k[I],j=rp(N);_.includes(j)||(A.splice(I,0,N),L.push(N))}return i==="wait"&&L.length&&(A=L),R(S4(A)),P(m),null}const{forceRender:O}=v.useContext(j2);return E.jsx(E.Fragment,{children:k.map(A=>{const I=rp(A),N=a&&!h?!1:m===k||_.includes(I),j=()=>{if(S.current.has(I))return;if(w.has(I))S.current.add(I),w.set(I,!0);else return;let F=!0;w.forEach(K=>{K||(F=!1)}),F&&(O==null||O(),R(y.current),a&&(p==null||p()),r&&r())};return E.jsx(fV,{isPresent:N,initial:!x.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:f,onExitComplete:N?void 0:j,anchorX:c,anchorY:u,children:A},I)})})},hT=v.createContext({strict:!1}),E4={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 C4=!1;function pV(){if(C4)return;const t={};for(const e in E4)t[e]={isEnabled:n=>E4[e].some(r=>!!n[r])};U3(t),C4=!0}function pT(){return pV(),Qj()}function mV(t){const e=pT();for(const n in t)e[n]={...e[n],...t[n]};U3(e)}const gV=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 Nm(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||gV.has(t)}let mT=t=>!Nm(t);function vV(t){typeof t=="function"&&(mT=e=>e.startsWith("on")?!Nm(e):t(e))}try{vV(require("@emotion/is-prop-valid").default)}catch{}function yV(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||Fn(t[s])||(mT(s)||n===!0&&Nm(s)||!e&&!Nm(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const u0=v.createContext({});function _V(t,e){if(c0(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Yd(n)?n:void 0,animate:Yd(r)?r:void 0}}return t.inherit!==!1?e:{}}function xV(t){const{initial:e,animate:n}=_V(t,v.useContext(u0));return v.useMemo(()=>({initial:e,animate:n}),[k4(e),k4(n)])}function k4(t){return Array.isArray(t)?t.join(" "):t}const dx=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function gT(t,e,n){for(const r in e)!Fn(e[r])&&!Y3(r,n)&&(t[r]=e[r])}function wV({transformTemplate:t},e){return v.useMemo(()=>{const n=dx();return lx(n,e,t),Object.assign({},n.vars,n.style)},[e])}function bV(t,e){const n=t.style||{},r={};return gT(r,n,t),Object.assign(r,wV(t,e)),r}function SV(t,e){const n={},r=bV(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 vT=()=>({...dx(),attrs:{}});function EV(t,e,n,r){const s=v.useMemo(()=>{const i=vT();return X3(i,e,J3(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};gT(i,t.style,t),s.style={...i,...s.style}}return s}const CV=["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 fx(t){return typeof t!="string"||t.includes("-")?!1:!!(CV.indexOf(t)>-1||/[A-Z]/u.test(t))}function kV(t,e,n,{latestValues:r},s,i=!1,a){const u=(a??fx(t)?EV:SV)(e,r,s,t),f=yV(e,typeof t=="string",i),h=t!==v.Fragment?{...f,...u,ref:n}:{},{children:p}=e,m=v.useMemo(()=>Fn(p)?p.get():p,[p]);return v.createElement(t,{...h,children:m})}function PV({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:TV(n,r,s,t),renderState:e()}}function TV(t,e,n,r){const s={},i=r(t,{});for(const m in i)s[m]=Dp(i[m]);let{initial:a,animate:c}=t;const u=c0(t),f=H3(t);e&&f&&!u&&t.inherit!==!1&&(a===void 0&&(a=e.initial),c===void 0&&(c=e.animate));let h=n?n.initial===!1:!1;h=h||a===!1;const p=h?c:a;if(p&&typeof p!="boolean"&&!l0(p)){const m=Array.isArray(p)?p:[p];for(let _=0;_<m.length;_++){const x=J2(t,m[_]);if(x){const{transitionEnd:y,transition:w,...S}=x;for(const T in S){let P=S[T];if(Array.isArray(P)){const k=h?P.length-1:0;P=P[k]}P!==null&&(s[T]=P)}for(const T in y)s[T]=y[T]}}}return s}const yT=t=>(e,n)=>{const r=v.useContext(u0),s=v.useContext(i0),i=()=>PV(t,e,r,s);return n?i():F2(i)},RV=yT({scrapeMotionValuesFromProps:cx,createRenderState:dx}),AV=yT({scrapeMotionValuesFromProps:eT,createRenderState:vT}),IV=Symbol.for("motionComponentSymbol");function MV(t,e,n){const r=v.useRef(n);v.useInsertionEffect(()=>{r.current=n});const s=v.useRef(null);return v.useCallback(i=>{var c;i&&((c=t.onMount)==null||c.call(t,i)),e&&(i?e.mount(i):e.unmount());const a=r.current;if(typeof a=="function")if(i){const u=a(i);typeof u=="function"&&(s.current=u)}else s.current?(s.current(),s.current=null):a(i);else a&&(a.current=i)},[e])}const _T=v.createContext({});function gc(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function OV(t,e,n,r,s,i){var P,k;const{visualElement:a}=v.useContext(u0),c=v.useContext(hT),u=v.useContext(i0),f=v.useContext(ux),h=f.reducedMotion,p=f.skipAnimations,m=v.useRef(null),_=v.useRef(!1);r=r||c.renderer,!m.current&&r&&(m.current=r(t,{visualState:e,parent:a,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:h,skipAnimations:p,isSVG:i}),_.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const x=m.current,y=v.useContext(_T);x&&!x.projection&&s&&(x.type==="html"||x.type==="svg")&&LV(m.current,n,s,y);const w=v.useRef(!1);v.useInsertionEffect(()=>{x&&w.current&&x.update(n,u)});const S=n[R3],T=v.useRef(!!S&&typeof window<"u"&&!((P=window.MotionHandoffIsComplete)!=null&&P.call(window,S))&&((k=window.MotionHasOptimisedAnimation)==null?void 0:k.call(window,S)));return V2(()=>{_.current=!0,x&&(w.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),T.current&&x.animationState&&x.animationState.animateChanges())}),v.useEffect(()=>{x&&(!T.current&&x.animationState&&x.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{var R;(R=window.MotionHandoffMarkAsComplete)==null||R.call(window,S)}),T.current=!1),x.enteringChildren=void 0)}),x}function LV(t,e,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:c,layoutScroll:u,layoutRoot:f,layoutAnchor:h,layoutCrossfade:p}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:xT(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!a||c&&gc(c),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:u,layoutRoot:f,layoutAnchor:h})}function xT(t){if(t)return t.options.allowProjection!==!1?t.projection:xT(t.parent)}function s1(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&mV(r);const i=n?n==="svg":fx(t),a=i?AV:RV;function c(f,h){let p;const m={...v.useContext(ux),...f,layoutId:NV(f)},{isStatic:_}=m,x=xV(f),y=a(f,_);if(!_&&typeof window<"u"){DV();const w=jV(m);p=w.MeasureLayout,x.visualElement=OV(t,y,m,s,w.ProjectionNode,i)}return E.jsxs(u0.Provider,{value:x,children:[p&&x.visualElement?E.jsx(p,{visualElement:x.visualElement,...m}):null,kV(t,f,MV(y,x.visualElement,h),y,_,e,i)]})}c.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const u=v.forwardRef(c);return u[IV]=t,u}function NV({layoutId:t}){const e=v.useContext(j2).id;return e&&t!==void 0?e+"-"+t:t}function DV(t,e){v.useContext(hT).strict}function jV(t){const e=pT(),{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 FV(t,e){if(typeof Proxy>"u")return s1;const n=new Map,r=(i,a)=>s1(i,a,t,e),s=(i,a)=>r(i,a);return new Proxy(s,{get:(i,a)=>a==="create"?r:(n.has(a)||n.set(a,s1(a,void 0,t,e)),n.get(a))})}const VV=(t,e)=>e.isSVG??fx(t)?new mF(e):new cF(e,{allowProjection:t!==v.Fragment});class $V extends ga{constructor(e){super(e),e.animationState||(e.animationState=xF(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();l0(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 HV=0;class zV extends ga{constructor(){super(...arguments),this.id=HV++,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:a,custom:c}=this.node.getProps();if(typeof a=="string"||typeof a=="object"&&a!==null&&!Array.isArray(a)){const u=_l(this.node,a,c);if(u){const{transition:f,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 UV={animation:{Feature:$V},exit:{Feature:zV}};function Rf(t){return{point:{x:t.pageX,y:t.pageY}}}const BV=t=>e=>rx(e)&&t(e,Rf(e));function Od(t,e,n,r){return Xd(t,e,BV(n),r)}const wT=({current:t})=>t?t.ownerDocument.defaultView:null,P4=(t,e)=>Math.abs(t-e);function WV(t,e){const n=P4(t.x,e.x),r=P4(t.y,e.y);return Math.sqrt(n**2+r**2)}const T4=new Set(["auto","scroll"]);class bT{constructor(e,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:c}={}){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=x=>{this.handleScroll(x.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=sp(this.lastRawMoveEventInfo,this.transformPagePoint));const x=i1(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,w=WV(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!w)return;const{point:S}=x,{timestamp:T}=Nn;this.history.push({...S,timestamp:T});const{onStart:P,onMove:k}=this.handlers;y||(P&&P(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,x)},this.handlePointerMove=(x,y)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=y,this.lastMoveEventInfo=sp(y,this.transformPagePoint),Ct.update(this.updatePoint,!0)},this.handlePointerUp=(x,y)=>{this.end();const{onEnd:w,onSessionEnd:S,resumeAnimation:T}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&T&&T(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const P=i1(x.type==="pointercancel"?this.lastMoveEventInfo:sp(y,this.transformPagePoint),this.history);this.startEvent&&w&&w(x,P),S&&S(x,P)},!rx(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=s||window;const u=Rf(e),f=sp(u,this.transformPagePoint),{point:h}=f,{timestamp:p}=Nn;this.history=[{...h,timestamp:p}];const{onSessionStart:m}=n;m&&m(e,i1(f,this.history));const _={passive:!0,capture:!0};this.removeListeners=kf(Od(this.contextWindow,"pointermove",this.handlePointerMove,_),Od(this.contextWindow,"pointerup",this.handlePointerUp,_),Od(this.contextWindow,"pointercancel",this.handlePointerUp,_)),c&&this.startScrollTracking(c)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(T4.has(r.overflowX)||T4.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),Ct.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ca(this.updatePoint)}}function sp(t,e){return e?{point:e(t.point)}:t}function R4(t,e){return{x:t.x-e.x,y:t.y-e.y}}function i1({point:t},e){return{point:t,delta:R4(t,ST(e)),offset:R4(t,GV(e)),velocity:KV(e,.1)}}function GV(t){return t[0]}function ST(t){return t[t.length-1]}function KV(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=ST(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>Xr(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>Xr(e)*2&&(r=t[1]);const i=ms(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const a={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function ZV(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?Et(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?Et(n,t,r.max):Math.min(t,n)),t}function A4(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 qV(t,{top:e,left:n,bottom:r,right:s}){return{x:A4(t.x,n,s),y:A4(t.y,e,r)}}function I4(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 YV(t,e){return{x:I4(t.x,e.x),y:I4(t.y,e.y)}}function XV(t,e){let n=.5;const r=lr(t),s=lr(e);return s>r?n=Zd(e.min,e.max-r,t.min):r>s&&(n=Zd(t.min,t.max-s,e.min)),vi(0,1,n)}function QV(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 g_=.35;function JV(t=g_){return t===!1?t=0:t===!0&&(t=g_),{x:M4(t,"left","right"),y:M4(t,"top","bottom")}}function M4(t,e,n){return{min:O4(t,e),max:O4(t,n)}}function O4(t,e){return typeof t=="number"?t:t[e]||0}const e$=new WeakMap;class t${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=xn(),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(Rf(p).point),this.stopAnimation()},a=(p,m)=>{const{drag:_,dragPropagation:x,onDragStart:y}=this.getProps();if(_&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Rj(_),!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),ii(S=>{let T=this.getAxisMotionValue(S).get()||0;if(gi.test(T)){const{projection:P}=this.visualElement;if(P&&P.layout){const k=P.layout.layoutBox[S];k&&(T=lr(k)*(parseFloat(T)/100))}}this.originPoint[S]=T}),y&&Ct.update(()=>y(p,m),!1,!0),a_(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},c=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m;const{dragPropagation:_,dragDirectionLock:x,onDirectionLock:y,onDrag:w}=this.getProps();if(!_&&!this.openDragLock)return;const{offset:S}=m;if(x&&this.currentDirection===null){this.currentDirection=r$(S),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",m.point,S),this.updateAxis("y",m.point,S),this.visualElement.render(),w&&Ct.update(()=>w(p,m),!1,!0)},u=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m,this.stop(p,m),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new bT(e,{onSessionStart:i,onStart:a,onMove:c,onSessionEnd:u,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:r,contextWindow:wT(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:a}=s;this.startAnimation(a);const{onDragEnd:c}=this.getProps();c&&Ct.postRender(()=>c(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||!ip(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let a=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(a=ZV(a,this.constraints[e],this.elastic[e])),i.set(a)}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&&gc(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=qV(r.layoutBox,e):this.constraints=!1,this.elastic=JV(n),s!==this.constraints&&!gc(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&ii(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=QV(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!gc(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=rF(r,s.root,this.visualElement.getTransformPagePoint());let a=YV(s.layout.layoutBox,i);if(n){const c=n(eF(a));this.hasMutatedConstraints=!!c,c&&(a=W3(c))}return a}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:c}=this.getProps(),u=this.constraints||{},f=ii(h=>{if(!ip(h,n,this.currentDirection))return;let p=u&&u[h]||{};(a===!0||a===h)&&(p={min:0,max:0});const m=s?200:1e6,_=s?40:1e7,x={type:"inertia",velocity:r?e[h]:0,bounceStiffness:m,bounceDamping:_,timeConstant:750,restDelta:1,restSpeed:10,...i,...p};return this.startAxisValueAnimation(h,x)});return Promise.all(f).then(c)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return a_(this.visualElement,e),r.start(Q2(e,r,0,n,this.visualElement,!1))}stopAnimation(){ii(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){ii(n=>{const{drag:r}=this.getProps();if(!ip(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:c}=s.layout.layoutBox[n],u=i.get()||0;i.set(e[n]-Et(a,c,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!gc(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};ii(a=>{const c=this.getAxisMotionValue(a);if(c&&this.constraints!==!1){const u=c.get();s[a]=XV({min:u,max:u},this.constraints[a])}});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(),ii(a=>{if(!ip(a,e,null))return;const c=this.getAxisMotionValue(a),{min:u,max:f}=this.constraints[a];c.set(Et(u,f,s[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;e$.set(this.visualElement,this);const e=this.visualElement.current,n=Od(e,"pointerdown",f=>{const{drag:h,dragListener:p=!0}=this.getProps(),m=f.target,_=m!==e&&Nj(m);h&&p&&!_&&this.start(f)});let r;const s=()=>{const{dragConstraints:f}=this.getProps();gc(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),r||(r=n$(e,f.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,a=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Ct.read(s);const c=Xd(window,"resize",()=>this.scalePositionWithinConstraints()),u=i.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:h})=>{this.isDragging&&h&&(ii(p=>{const m=this.getAxisMotionValue(p);m&&(this.originPoint[p]+=f[p].translate,m.set(m.get()+f[p].translate))}),this.visualElement.render())}));return()=>{c(),n(),a(),u&&u(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:a=g_,dragMomentum:c=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:c}}}function L4(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function n$(t,e,n){const r=HC(t,L4(n)),s=HC(e,L4(n));return()=>{r(),s()}}function ip(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function r$(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class s$ extends ga{constructor(e){super(e),this.removeGroupControls=_s,this.removeListeners=_s,this.controls=new t$(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||_s}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 o1=t=>(e,n)=>{t&&Ct.update(()=>t(e,n),!1,!0)};class i$ extends ga{constructor(){super(...arguments),this.removePointerDownListener=_s}onPointerDown(e){this.session=new bT(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:wT(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:o1(e),onStart:o1(n),onMove:o1(r),onEnd:(i,a)=>{delete this.session,s&&Ct.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=Od(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 a1=!1;class o$ extends v.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),a1&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),jp.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:a}=r;return a&&(a.isPresent=i,e.layoutDependency!==n&&a.setOptions({...a.options,layoutDependency:n}),a1=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||Ct.postRender(()=>{const c=a.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),nx.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;a1=!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 ET(t){const[e,n]=fT(),r=v.useContext(j2);return E.jsx(o$,{...t,layoutGroup:r,switchLayoutGroup:v.useContext(_T),isPresent:e,safeToRemove:n})}const a$={pan:{Feature:i$},drag:{Feature:s$,ProjectionNode:dT,MeasureLayout:ET}};function N4(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&&Ct.postRender(()=>i(e,Rf(e)))}class l$ extends ga{mount(){const{current:e}=this.node;e&&(this.unmount=Ij(e,(n,r)=>(N4(this.node,r,"Start"),s=>N4(this.node,s,"End"))))}unmount(){}}class c$ extends ga{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=kf(Xd(this.node.current,"focus",()=>this.onFocus()),Xd(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function D4(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&&Ct.postRender(()=>i(e,Rf(e)))}class u$ extends ga{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=jj(e,(s,i)=>(D4(this.node,i,"Start"),(a,{success:c})=>D4(this.node,a,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const v_=new WeakMap,l1=new WeakMap,d$=t=>{const e=v_.get(t.target);e&&e(t)},f$=t=>{t.forEach(d$)};function h$({root:t,...e}){const n=t||document;l1.has(n)||l1.set(n,{});const r=l1.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(f$,{root:t,...e})),r[s]}function p$(t,e,n){const r=h$(e);return v_.set(t,n),r.observe(t),()=>{v_.delete(t),r.unobserve(t)}}const m$={some:0,all:1};class g$ extends ga{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,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:m$[s]},c=f=>{const{isIntersecting:h}=f;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(),_=h?p:m;_&&_(f)};this.stopObserver=p$(this.node.current,a,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(v$(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function v$({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const y$={inView:{Feature:g$},tap:{Feature:u$},focus:{Feature:c$},hover:{Feature:l$}},_$={layout:{ProjectionNode:dT,MeasureLayout:ET}},x$={...UV,...y$,...a$,..._$},ao=FV(x$,VV);function w$(){!ax.current&&z3();const[t]=v.useState(Im.current);return t}const xl=ao;var d0=NP();const b$=e0(d0);function S$(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 E$=t=>{switch(t){case"success":return P$;case"info":return R$;case"warning":return T$;case"error":return A$;default:return null}},C$=Array(12).fill(0),k$=({visible:t,className:e})=>ve.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},ve.createElement("div",{className:"sonner-spinner"},C$.map((n,r)=>ve.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),P$=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.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"})),T$=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ve.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"})),R$=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.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"})),A$=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.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"})),I$=ve.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"},ve.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ve.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),M$=()=>{const[t,e]=ve.useState(document.hidden);return ve.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t};let y_=1;class O${constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{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.create=e=>{var n;const{message:r,...s}=e,i=typeof(e==null?void 0:e.id)=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:y_++,a=this.toasts.find(u=>u.id===i),c=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),a?this.toasts=this.toasts.map(u=>u.id===i?(this.publish({...u,...e,id:i,title:r}),{...u,...e,id:i,dismissible:c,title:r}):u):this.addToast({title:r,...s,dismissible:c,id:i}),i},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:e,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),e),this.message=(e,n)=>this.create({...n,message:e}),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,a;const c=s.then(async f=>{if(a=["resolve",f],ve.isValidElement(f))i=!1,this.create({id:r,type:"default",message:f});else if(N$(f)&&!f.ok){i=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,m=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,x=typeof p=="object"&&!ve.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,...x})}else if(f instanceof Error){i=!1;const p=typeof n.error=="function"?await n.error(f):n.error,m=typeof n.description=="function"?await n.description(f):n.description,x=typeof p=="object"&&!ve.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,...x})}else if(n.success!==void 0){i=!1;const p=typeof n.success=="function"?await n.success(f):n.success,m=typeof n.description=="function"?await n.description(f):n.description,x=typeof p=="object"&&!ve.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:m,...x})}}).catch(async f=>{if(a=["reject",f],n.error!==void 0){i=!1;const h=typeof n.error=="function"?await n.error(f):n.error,p=typeof n.description=="function"?await n.description(f):n.description,_=typeof h=="object"&&!ve.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:p,..._})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((f,h)=>c.then(()=>a[0]==="reject"?h(a[1]):f(a[1])).catch(h));return typeof r!="string"&&typeof r!="number"?{unwrap:u}:Object.assign(r,{unwrap:u})},this.custom=(e,n)=>{const r=(n==null?void 0:n.id)||y_++;return this.create({jsx:e(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Sr=new O$,L$=(t,e)=>{const n=(e==null?void 0:e.id)||y_++;return Sr.addToast({title:t,...e,id:n}),n},N$=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",D$=L$,j$=()=>Sr.toasts,F$=()=>Sr.getActiveToasts(),pt=Object.assign(D$,{success:Sr.success,info:Sr.info,warning:Sr.warning,error:Sr.error,custom:Sr.custom,message:Sr.message,promise:Sr.promise,dismiss:Sr.dismiss,loading:Sr.loading},{getHistory:j$,getToasts:F$});S$("[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}[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(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-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]{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 op(t){return t.label!==void 0}const V$=3,$$="24px",H$="16px",j4=4e3,z$=356,U$=14,B$=45,W$=200;function ni(...t){return t.filter(Boolean).join(" ")}function G$(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const K$=t=>{var e,n,r,s,i,a,c,u,f;const{invert:h,toast:p,unstyled:m,interacting:_,setHeights:x,visibleToasts:y,heights:w,index:S,toasts:T,expanded:P,removeToast:k,defaultRichColors:R,closeButton:L,style:O,cancelButtonStyle:A,actionButtonStyle:I,className:N="",descriptionClassName:j="",duration:F,position:K,gap:X,expandByDefault:W,classNames:G,icons:q,closeButtonAriaLabel:$="Close toast"}=t,[ne,z]=ve.useState(null),[D,Y]=ve.useState(null),[ee,ie]=ve.useState(!1),[oe,ce]=ve.useState(!1),[xe,ae]=ve.useState(!1),[se,Ve]=ve.useState(!1),[De,Re]=ve.useState(!1),[Ye,ut]=ve.useState(0),[kt,we]=ve.useState(0),je=ve.useRef(p.duration||F||j4),ze=ve.useRef(null),it=ve.useRef(null),Pt=S===0,tt=S+1<=y,Xe=p.type,At=p.dismissible!==!1,Qn=p.className||"",An=p.descriptionClassName||"",ws=ve.useMemo(()=>w.findIndex(Ke=>Ke.toastId===p.id)||0,[w,p.id]),Lr=ve.useMemo(()=>{var Ke;return(Ke=p.closeButton)!=null?Ke:L},[p.closeButton,L]),Nr=ve.useMemo(()=>p.duration||F||j4,[p.duration,F]),Jn=ve.useRef(0),wn=ve.useRef(0),Bs=ve.useRef(0),Ws=ve.useRef(null),[In,Si]=K.split("-"),Ei=ve.useMemo(()=>w.reduce((Ke,It,tn)=>tn>=ws?Ke:Ke+It.height,0),[w,ws]),bs=M$(),Gs=p.invert||h,fr=Xe==="loading";wn.current=ve.useMemo(()=>ws*X+Ei,[ws,Ei]),ve.useEffect(()=>{je.current=Nr},[Nr]),ve.useEffect(()=>{ie(!0)},[]),ve.useEffect(()=>{const Ke=it.current;if(Ke){const It=Ke.getBoundingClientRect().height;return we(It),x(tn=>[{toastId:p.id,height:It,position:p.position},...tn]),()=>x(tn=>tn.filter(nn=>nn.toastId!==p.id))}},[x,p.id]),ve.useLayoutEffect(()=>{if(!ee)return;const Ke=it.current,It=Ke.style.height;Ke.style.height="auto";const tn=Ke.getBoundingClientRect().height;Ke.style.height=It,we(tn),x(nn=>nn.find(qt=>qt.toastId===p.id)?nn.map(qt=>qt.toastId===p.id?{...qt,height:tn}:qt):[{toastId:p.id,height:tn,position:p.position},...nn])},[ee,p.title,p.description,x,p.id,p.jsx,p.action,p.cancel]);const er=ve.useCallback(()=>{ce(!0),ut(wn.current),x(Ke=>Ke.filter(It=>It.toastId!==p.id)),setTimeout(()=>{k(p)},W$)},[p,k,x,wn]);ve.useEffect(()=>{if(p.promise&&Xe==="loading"||p.duration===1/0||p.type==="loading")return;let Ke;return P||_||bs?(()=>{if(Bs.current<Jn.current){const nn=new Date().getTime()-Jn.current;je.current=je.current-nn}Bs.current=new Date().getTime()})():(()=>{je.current!==1/0&&(Jn.current=new Date().getTime(),Ke=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),er()},je.current))})(),()=>clearTimeout(Ke)},[P,_,p,Xe,bs,er]),ve.useEffect(()=>{p.delete&&(er(),p.onDismiss==null||p.onDismiss.call(p,p))},[er,p.delete]);function Ks(){var Ke;if(q!=null&&q.loading){var It;return ve.createElement("div",{className:ni(G==null?void 0:G.loader,p==null||(It=p.classNames)==null?void 0:It.loader,"sonner-loader"),"data-visible":Xe==="loading"},q.loading)}return ve.createElement(k$,{className:ni(G==null?void 0:G.loader,p==null||(Ke=p.classNames)==null?void 0:Ke.loader),visible:Xe==="loading"})}const Ss=p.icon||(q==null?void 0:q[Xe])||E$(Xe);var Dr,Ci;return ve.createElement("li",{tabIndex:0,ref:it,className:ni(N,Qn,G==null?void 0:G.toast,p==null||(e=p.classNames)==null?void 0:e.toast,G==null?void 0:G.default,G==null?void 0:G[Xe],p==null||(n=p.classNames)==null?void 0:n[Xe]),"data-sonner-toast":"","data-rich-colors":(Dr=p.richColors)!=null?Dr:R,"data-styled":!(p.jsx||p.unstyled||m),"data-mounted":ee,"data-promise":!!p.promise,"data-swiped":De,"data-removed":oe,"data-visible":tt,"data-y-position":In,"data-x-position":Si,"data-index":S,"data-front":Pt,"data-swiping":xe,"data-dismissible":At,"data-type":Xe,"data-invert":Gs,"data-swipe-out":se,"data-swipe-direction":D,"data-expanded":!!(P||W&&ee),"data-testid":p.testId,style:{"--index":S,"--toasts-before":S,"--z-index":T.length-S,"--offset":`${oe?Ye:wn.current}px`,"--initial-height":W?"auto":`${kt}px`,...O,...p.style},onDragEnd:()=>{ae(!1),z(null),Ws.current=null},onPointerDown:Ke=>{Ke.button!==2&&(fr||!At||(ze.current=new Date,ut(wn.current),Ke.target.setPointerCapture(Ke.pointerId),Ke.target.tagName!=="BUTTON"&&(ae(!0),Ws.current={x:Ke.clientX,y:Ke.clientY})))},onPointerUp:()=>{var Ke,It,tn;if(se||!At)return;Ws.current=null;const nn=Number(((Ke=it.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Zs=Number(((It=it.current)==null?void 0:It.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),qt=new Date().getTime()-((tn=ze.current)==null?void 0:tn.getTime()),cn=ne==="x"?nn:Zs,Es=Math.abs(cn)/qt;if(Math.abs(cn)>=B$||Es>.11){ut(wn.current),p.onDismiss==null||p.onDismiss.call(p,p),Y(ne==="x"?nn>0?"right":"left":Zs>0?"down":"up"),er(),Ve(!0);return}else{var un,zn;(un=it.current)==null||un.style.setProperty("--swipe-amount-x","0px"),(zn=it.current)==null||zn.style.setProperty("--swipe-amount-y","0px")}Re(!1),ae(!1),z(null)},onPointerMove:Ke=>{var It,tn,nn;if(!Ws.current||!At||((It=window.getSelection())==null?void 0:It.toString().length)>0)return;const qt=Ke.clientY-Ws.current.y,cn=Ke.clientX-Ws.current.x;var Es;const un=(Es=t.swipeDirections)!=null?Es:G$(K);!ne&&(Math.abs(cn)>1||Math.abs(qt)>1)&&z(Math.abs(cn)>Math.abs(qt)?"x":"y");let zn={x:0,y:0};const qs=hr=>1/(1.5+Math.abs(hr)/20);if(ne==="y"){if(un.includes("top")||un.includes("bottom"))if(un.includes("top")&&qt<0||un.includes("bottom")&&qt>0)zn.y=qt;else{const hr=qt*qs(qt);zn.y=Math.abs(hr)<Math.abs(qt)?hr:qt}}else if(ne==="x"&&(un.includes("left")||un.includes("right")))if(un.includes("left")&&cn<0||un.includes("right")&&cn>0)zn.x=cn;else{const hr=cn*qs(cn);zn.x=Math.abs(hr)<Math.abs(cn)?hr:cn}(Math.abs(zn.x)>0||Math.abs(zn.y)>0)&&Re(!0),(tn=it.current)==null||tn.style.setProperty("--swipe-amount-x",`${zn.x}px`),(nn=it.current)==null||nn.style.setProperty("--swipe-amount-y",`${zn.y}px`)}},Lr&&!p.jsx&&Xe!=="loading"?ve.createElement("button",{"aria-label":$,"data-disabled":fr,"data-close-button":!0,onClick:fr||!At?()=>{}:()=>{er(),p.onDismiss==null||p.onDismiss.call(p,p)},className:ni(G==null?void 0:G.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(Ci=q==null?void 0:q.close)!=null?Ci:I$):null,(Xe||p.icon||p.promise)&&p.icon!==null&&((q==null?void 0:q[Xe])!==null||p.icon)?ve.createElement("div",{"data-icon":"",className:ni(G==null?void 0:G.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||Ks():null,p.type!=="loading"?Ss:null):null,ve.createElement("div",{"data-content":"",className:ni(G==null?void 0:G.content,p==null||(i=p.classNames)==null?void 0:i.content)},ve.createElement("div",{"data-title":"",className:ni(G==null?void 0:G.title,p==null||(a=p.classNames)==null?void 0:a.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?ve.createElement("div",{"data-description":"",className:ni(j,An,G==null?void 0:G.description,p==null||(c=p.classNames)==null?void 0:c.description)},typeof p.description=="function"?p.description():p.description):null),ve.isValidElement(p.cancel)?p.cancel:p.cancel&&op(p.cancel)?ve.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||A,onClick:Ke=>{op(p.cancel)&&At&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Ke),er())},className:ni(G==null?void 0:G.cancelButton,p==null||(u=p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,ve.isValidElement(p.action)?p.action:p.action&&op(p.action)?ve.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||I,onClick:Ke=>{op(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Ke),!Ke.defaultPrevented&&er())},className:ni(G==null?void 0:G.actionButton,p==null||(f=p.classNames)==null?void 0:f.actionButton)},p.action.label):null)};function F4(){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 Z$(t,e){const n={};return[t,e].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",c=i?H$:$$;function u(f){["top","right","bottom","left"].forEach(h=>{n[`${a}-${h}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${a}-${f}`]=c:n[`${a}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):u(c)}),n}const q$=ve.forwardRef(function(e,n){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:c,closeButton:u,className:f,offset:h,mobileOffset:p,theme:m="light",richColors:_,duration:x,style:y,visibleToasts:w=V$,toastOptions:S,dir:T=F4(),gap:P=U$,icons:k,containerAriaLabel:R="Notifications"}=e,[L,O]=ve.useState([]),A=ve.useMemo(()=>r?L.filter(ee=>ee.toasterId===r):L.filter(ee=>!ee.toasterId),[L,r]),I=ve.useMemo(()=>Array.from(new Set([i].concat(A.filter(ee=>ee.position).map(ee=>ee.position)))),[A,i]),[N,j]=ve.useState([]),[F,K]=ve.useState(!1),[X,W]=ve.useState(!1),[G,q]=ve.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=ve.useRef(null),ne=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),z=ve.useRef(null),D=ve.useRef(!1),Y=ve.useCallback(ee=>{O(ie=>{var oe;return(oe=ie.find(ce=>ce.id===ee.id))!=null&&oe.delete||Sr.dismiss(ee.id),ie.filter(({id:ce})=>ce!==ee.id)})},[]);return ve.useEffect(()=>Sr.subscribe(ee=>{if(ee.dismiss){requestAnimationFrame(()=>{O(ie=>ie.map(oe=>oe.id===ee.id?{...oe,delete:!0}:oe))});return}setTimeout(()=>{b$.flushSync(()=>{O(ie=>{const oe=ie.findIndex(ce=>ce.id===ee.id);return oe!==-1?[...ie.slice(0,oe),{...ie[oe],...ee},...ie.slice(oe+1)]:[ee,...ie]})})})}),[L]),ve.useEffect(()=>{if(m!=="system"){q(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;const ee=window.matchMedia("(prefers-color-scheme: dark)");try{ee.addEventListener("change",({matches:ie})=>{q(ie?"dark":"light")})}catch{ee.addListener(({matches:oe})=>{try{q(oe?"dark":"light")}catch(ce){console.error(ce)}})}},[m]),ve.useEffect(()=>{L.length<=1&&K(!1)},[L]),ve.useEffect(()=>{const ee=ie=>{var oe;if(a.every(ae=>ie[ae]||ie.code===ae)){var xe;K(!0),(xe=$.current)==null||xe.focus()}ie.code==="Escape"&&(document.activeElement===$.current||(oe=$.current)!=null&&oe.contains(document.activeElement))&&K(!1)};return document.addEventListener("keydown",ee),()=>document.removeEventListener("keydown",ee)},[a]),ve.useEffect(()=>{if($.current)return()=>{z.current&&(z.current.focus({preventScroll:!0}),z.current=null,D.current=!1)}},[$.current]),ve.createElement("section",{ref:n,"aria-label":`${R} ${ne}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},I.map((ee,ie)=>{var oe;const[ce,xe]=ee.split("-");return A.length?ve.createElement("ol",{key:ee,dir:T==="auto"?F4():T,tabIndex:-1,ref:$,className:f,"data-sonner-toaster":!0,"data-sonner-theme":G,"data-y-position":ce,"data-x-position":xe,style:{"--front-toast-height":`${((oe=N[0])==null?void 0:oe.height)||0}px`,"--width":`${z$}px`,"--gap":`${P}px`,...y,...Z$(h,p)},onBlur:ae=>{D.current&&!ae.currentTarget.contains(ae.relatedTarget)&&(D.current=!1,z.current&&(z.current.focus({preventScroll:!0}),z.current=null))},onFocus:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||D.current||(D.current=!0,z.current=ae.relatedTarget)},onMouseEnter:()=>K(!0),onMouseMove:()=>K(!0),onMouseLeave:()=>{X||K(!1)},onDragEnd:()=>K(!1),onPointerDown:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||W(!0)},onPointerUp:()=>W(!1)},A.filter(ae=>!ae.position&&ie===0||ae.position===ee).map((ae,se)=>{var Ve,De;return ve.createElement(K$,{key:ae.id,icons:k,index:se,toast:ae,defaultRichColors:_,duration:(Ve=S==null?void 0:S.duration)!=null?Ve:x,className:S==null?void 0:S.className,descriptionClassName:S==null?void 0:S.descriptionClassName,invert:s,visibleToasts:w,closeButton:(De=S==null?void 0:S.closeButton)!=null?De:u,interacting:X,position:ee,style:S==null?void 0:S.style,unstyled:S==null?void 0:S.unstyled,classNames:S==null?void 0:S.classNames,cancelButtonStyle:S==null?void 0:S.cancelButtonStyle,actionButtonStyle:S==null?void 0:S.actionButtonStyle,closeButtonAriaLabel:S==null?void 0:S.closeButtonAriaLabel,removeToast:Y,toasts:A.filter(Re=>Re.position==ae.position),heights:N.filter(Re=>Re.position==ae.position),setHeights:j,expandByDefault:c,gap:P,expanded:F,swipeDirections:e.swipeDirections})})):null}))});var Y$=Object.defineProperty,uu=(t,e)=>Y$(t,"name",{value:e,configurable:!0}),CT=!!(typeof window<"u"&&window.document&&window.document.createElement);function Nt(t,e,{checkForDefaultPrevented:n=!0}={}){return uu(function(s){if(t==null||t(s),n===!1||!s||!s.defaultPrevented)return e==null?void 0:e(s)},"handleEvent")}uu(Nt,"composeEventHandlers");function X$(t){var e;if(!CT)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}uu(X$,"getOwnerWindow");function __(t){if(!CT)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}uu(__,"getOwnerDocument");function kT(t,e=!1){const{activeElement:n}=__(t);if(!(n!=null&&n.nodeName))return null;if(PT(n)&&n.contentDocument)return kT(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const s=__(n).getElementById(r);if(s)return s}}return n}uu(kT,"getActiveElement");function PT(t){return t.tagName==="IFRAME"}uu(PT,"isFrame");var Q$=Object.defineProperty,hx=(t,e)=>Q$(t,"name",{value:e,configurable:!0});function x_(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}hx(x_,"setRef");function TT(...t){return e=>{let n=!1;const r=t.map(s=>{const i=x_(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():x_(t[s],null)}}}}hx(TT,"composeRefs");function jt(...t){return v.useCallback(TT(...t),t)}hx(jt,"useComposedRefs");var J$=Object.defineProperty,ps=(t,e)=>J$(t,"name",{value:e,configurable:!0});function eH(t,e){const n=v.createContext(e);n.displayName=t+"Context";const r=ps(i=>{const{children:a,...c}=i,u=v.useMemo(()=>c,Object.values(c));return E.jsx(n.Provider,{value:u,children:a})},"Provider");r.displayName=t+"Provider";function s(i,a={}){const{optional:c=!1}=a,u=v.useContext(n);if(u)return u;if(e!==void 0)return e;if(!c)throw new Error(`\`${i}\` must be used within \`${t}\``)}return ps(s,"useContext"),[r,s]}ps(eH,"createContext");function wi(t,e=[]){let n=[];function r(i,a){const c=v.createContext(a);c.displayName=i+"Context";const u=n.length;n=[...n,a];const f=ps(p=>{var S;const{scope:m,children:_,...x}=p,y=((S=m==null?void 0:m[t])==null?void 0:S[u])||c,w=v.useMemo(()=>x,Object.values(x));return E.jsx(y.Provider,{value:w,children:_})},"Provider");f.displayName=i+"Provider";function h(p,m,_={}){var S;const{optional:x=!1}=_,y=((S=m==null?void 0:m[t])==null?void 0:S[u])||c,w=v.useContext(y);if(w)return w;if(a!==void 0)return a;if(!x)throw new Error(`\`${p}\` must be used within \`${i}\``)}return ps(h,"useContext"),[f,h]}ps(r,"createContext");const s=ps(()=>{const i=n.map(a=>v.createContext(a));return ps(function(c){const u=(c==null?void 0:c[t])||i;return v.useMemo(()=>({[`__scope${t}`]:{...c,[t]:u}}),[c,u])},"useScope")},"createScope");return s.scopeName=t,[r,RT(s,...e)]}ps(wi,"createContextScope");function RT(...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 a=r.reduce((c,{useScope:u,scopeName:f})=>{const p=u(i)[`__scope${f}`];return{...c,...p}},{});return v.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}ps(RT,"composeContextScopes");var Pr=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},tH=Object.defineProperty,nH=(t,e)=>tH(t,"name",{value:e,configurable:!0}),rH=Ef[" useId ".trim().toString()]||(()=>{}),sH=0;function na(t){const[e,n]=v.useState(rH());return Pr(()=>{t||n(r=>r??String(sH++))},[t]),t||(e?`radix-${e}`:"")}nH(na,"useId");var iH=Object.defineProperty,oH=(t,e)=>iH(t,"name",{value:e,configurable:!0}),V4=Ef[" useEffectEvent ".trim().toString()],$4=Ef[" useInsertionEffect ".trim().toString()];function AT(t){if(typeof V4=="function")return V4(t);const e=v.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof $4=="function"?$4(()=>{e.current=t}):Pr(()=>{e.current=t}),v.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}oH(AT,"useEffectEvent");var aH=Object.defineProperty,Af=(t,e)=>aH(t,"name",{value:e,configurable:!0}),lH=Ef[" useInsertionEffect ".trim().toString()]||Pr;function va({prop:t,defaultProp:e,onChange:n=Af(()=>{},"onChange"),caller:r}){const[s,i,a]=IT({defaultProp:e,onChange:n}),c=t!==void 0,u=c?t:s,f=v.useCallback(h=>{var p;if(c){const m=MT(h)?h(t):h;m!==t&&((p=a.current)==null||p.call(a,m))}else i(h)},[c,t,i,a]);return[u,f]}Af(va,"useControllableState");function IT({defaultProp:t,onChange:e}){const[n,r]=v.useState(t),s=v.useRef(n),i=v.useRef(e);return lH(()=>{i.current=e},[e]),v.useEffect(()=>{var a;s.current!==n&&((a=i.current)==null||a.call(i,n),s.current=n)},[n,s]),[n,r,i]}Af(IT,"useUncontrolledState");function MT(t){return typeof t=="function"}Af(MT,"isFunction");var H4=Symbol("RADIX:SYNC_STATE");function cH(t,e,n,r){const{prop:s,defaultProp:i,onChange:a,caller:c}=e,u=s!==void 0,f=AT(a),h=[{...n,state:i}];r&&h.push(r);const[p,m]=v.useReducer((w,S)=>{if(S.type===H4)return{...w,state:S.state};const T=t(w,S);return u&&!Object.is(T.state,w.state)&&f(T.state),T},...h),_=p.state,x=v.useRef(_);v.useEffect(()=>{x.current!==_&&(x.current=_,u||f(_))},[_,x,u]);const y=v.useMemo(()=>s!==void 0?{...p,state:s}:p,[p,s]);return v.useEffect(()=>{u&&!Object.is(s,p.state)&&m({type:H4,state:s})},[s,p.state,u]),[y,m]}Af(cH,"useControllableStateReducer");var uH=Object.defineProperty,zs=(t,e)=>uH(t,"name",{value:e,configurable:!0});function ua(t){const e=v.forwardRef((n,r)=>{let{children:s,...i}=n,a=null,c=!1;const u=[];w_(s)&&typeof ap=="function"&&(s=ap(s._payload)),v.Children.forEach(s,m=>{var _;if(jT(m)){c=!0;const x=m;let y="child"in x.props?x.props.child:x.props.children;w_(y)&&typeof ap=="function"&&(y=ap(y._payload)),a=dH(x,y),u.push((_=a==null?void 0:a.props)==null?void 0:_.children)}else u.push(m)}),a?a=v.cloneElement(a,void 0,u):!c&&v.Children.count(s)===1&&v.isValidElement(s)&&(a=s);const f=a?DT(a):void 0,h=jt(r,f);if(!a){if(s||s===0)throw new Error(c?pH(t):hH(t));return s}const p=NT(i,a.props??{});return a.type!==v.Fragment&&(p.ref=r?h:f),v.cloneElement(a,p)});return e.displayName=`${t}.Slot`,e}zs(ua,"createSlot");var OT=Symbol.for("radix.slottable");function LT(t){const e=zs(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=OT,e}zs(LT,"createSlottable");var dH=zs((t,e)=>{if("child"in t.props){const n=t.props.child;return v.isValidElement(n)?v.cloneElement(n,void 0,t.props.children(n.props.children)):null}return v.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function NT(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]=(...c)=>{const u=i(...c);return s(...c),u}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}zs(NT,"mergeProps");function DT(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)}zs(DT,"getElementRef");function jT(t){return v.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===OT}zs(jT,"isSlottable");var fH=Symbol.for("react.lazy");function w_(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===fH&&"_payload"in t&&FT(t._payload)}zs(w_,"isLazyComponent");function FT(t){return typeof t=="object"&&t!==null&&"then"in t}zs(FT,"isPromiseLike");var hH=zs(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),pH=zs(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),ap=Ef[" use ".trim().toString()],mH=Object.defineProperty,gH=(t,e)=>mH(t,"name",{value:e,configurable:!0}),vH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ln=vH.reduce((t,e)=>{const n=ua(`Primitive.${e}`),r=v.forwardRef((s,i)=>{const{asChild:a,...c}=s,u=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),E.jsx(u,{...c,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function VT(t,e){t&&d0.flushSync(()=>t.dispatchEvent(e))}gH(VT,"dispatchDiscreteCustomEvent");var yH=Object.defineProperty,_H=(t,e)=>yH(t,"name",{value:e,configurable:!0});function kl(t){const e=v.useRef(t);return v.useEffect(()=>{e.current=t}),v.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}_H(kl,"useCallbackRef");var xH=Object.defineProperty,kn=(t,e)=>xH(t,"name",{value:e,configurable:!0}),b_="dismissableLayer.update",wH="dismissableLayer.pointerDownOutside",bH="dismissableLayer.focusOutside",z4,$T=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),px=v.forwardRef(kn(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:c,onInteractOutside:u,onDismiss:f,...h}=e,p=v.useContext($T),[m,_]=v.useState(null),x=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=v.useState({}),w=jt(n,_),S=Array.from(p.layers),[T]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),P=T?S.indexOf(T):-1,k=m?S.indexOf(m):-1,R=p.layersWithOutsidePointerEventsDisabled.size>0,L=k>=P,O=v.useRef(!1),A=zT(F=>{a==null||a(F),u==null||u(F),F.defaultPrevented||f==null||f()},{ownerDocument:x,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:O,dismissableSurfaces:p.dismissableSurfaces,shouldHandlePointerDownOutside:v.useCallback(F=>{if(!(F instanceof Node))return!1;const K=[...p.branches].some(X=>X.contains(F));return L&&!K},[p.branches,L])}),I=UT(F=>{if(s&&O.current)return;const K=F.target;[...p.branches].some(W=>W.contains(K))||(c==null||c(F),u==null||u(F),F.defaultPrevented||f==null||f())},x),N=m?k===S.length-1:!1,j=kl(F=>{F.key==="Escape"&&(i==null||i(F),!F.defaultPrevented&&f&&(F.preventDefault(),f()))});return v.useEffect(()=>{if(N)return x.addEventListener("keydown",j,{capture:!0}),()=>x.removeEventListener("keydown",j,{capture:!0})},[x,N,j]),v.useEffect(()=>{if(m)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(z4=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(m)),p.layers.add(m),S_(),()=>{r&&(p.layersWithOutsidePointerEventsDisabled.delete(m),p.layersWithOutsidePointerEventsDisabled.size===0&&(x.body.style.pointerEvents=z4))}},[m,x,r,p]),v.useEffect(()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),S_())},[m,p]),v.useEffect(()=>{const F=kn(()=>y({}),"handleUpdate");return document.addEventListener(b_,F),()=>document.removeEventListener(b_,F)},[]),E.jsx(ln.div,{...h,ref:w,style:{pointerEvents:R?L?"auto":"none":void 0,...e.style},onFocusCapture:Nt(e.onFocusCapture,I.onFocusCapture),onBlurCapture:Nt(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:Nt(e.onPointerDownCapture,A.onPointerDownCapture)})},"DismissableLayer"));function HT(){const t=v.useContext($T),[e,n]=v.useState(null);return v.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}kn(HT,"useDismissableLayerSurface");var SH=kn(()=>!0,"IS_TRUE");function zT(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:a=SH}=e,c=kl(t),u=v.useRef(!1),f=v.useRef(!1),h=v.useRef(new Map),p=v.useRef(()=>{});return v.useEffect(()=>{function m(){f.current=!1,s.current=!1,h.current.clear()}kn(m,"resetOutsideInteraction");function _(){return Array.from(h.current.values()).some(Boolean)}kn(_,"isOutsideInteractionIntercepted");function x(P){if(!f.current)return;const k=P.target;k instanceof Node&&[...i].some(L=>L.contains(k))||h.current.set(P.type,!0),P.type==="click"&&window.setTimeout(()=>{f.current&&p.current()},0)}kn(x,"handleInteractionCapture");function y(P){f.current&&h.current.set(P.type,!1)}kn(y,"handleInteractionBubble");const w=kn(P=>{if(P.target&&!u.current){let k=function(){n.removeEventListener("click",p.current);const L=_();m(),L||mx(wH,c,R,{discrete:!0})};if(kn(k,"handleAndDispatchPointerDownOutsideEvent"),!a(P.target)){n.removeEventListener("click",p.current),m(),u.current=!1;return}const R={originalEvent:P};f.current=!0,s.current=r&&P.button===0,h.current.clear(),!r||P.button!==0?k():(n.removeEventListener("click",p.current),p.current=k,n.addEventListener("click",p.current,{once:!0}))}else n.removeEventListener("click",p.current),m();u.current=!1},"handlePointerDown"),S=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const P of S)n.addEventListener(P,x,!0),n.addEventListener(P,y);const T=window.setTimeout(()=>{n.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(T),n.removeEventListener("pointerdown",w),n.removeEventListener("click",p.current);for(const P of S)n.removeEventListener(P,x,!0),n.removeEventListener(P,y)}},[n,c,r,s,i,a]),{onPointerDownCapture:kn(()=>u.current=!0,"onPointerDownCapture")}}kn(zT,"usePointerDownOutside");function UT(t,e=globalThis==null?void 0:globalThis.document){const n=kl(t),r=v.useRef(!1);return v.useEffect(()=>{const s=kn(i=>{i.target&&!r.current&&mx(bH,n,{originalEvent:i},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:kn(()=>r.current=!0,"onFocusCapture"),onBlurCapture:kn(()=>r.current=!1,"onBlurCapture")}}kn(UT,"useFocusOutside");function S_(){const t=new CustomEvent(b_);document.dispatchEvent(t)}kn(S_,"dispatchUpdate");function mx(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?VT(s,i):s.dispatchEvent(i)}kn(mx,"handleAndDispatchCustomEvent");var EH=Object.defineProperty,cr=(t,e)=>EH(t,"name",{value:e,configurable:!0}),c1="focusScope.autoFocusOnMount",u1="focusScope.autoFocusOnUnmount",U4={bubbles:!1,cancelable:!0},BT=v.forwardRef(cr(function(e,n){const{loop:r=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...c}=e,[u,f]=v.useState(null),h=kl(i),p=kl(a),m=v.useRef(null),_=jt(n,f),x=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(s){let w=function(k){if(x.paused||!u)return;const R=k.target;u.contains(R)?m.current=R:Zi(m.current,{select:!0})},S=function(k){if(x.paused||!u)return;const R=k.relatedTarget;R!==null&&(u.contains(R)||Zi(m.current,{select:!0}))},T=function(k){if(document.activeElement===document.body)for(const L of k)L.removedNodes.length>0&&Zi(u)};cr(w,"handleFocusIn"),cr(S,"handleFocusOut"),cr(T,"handleMutations"),document.addEventListener("focusin",w),document.addEventListener("focusout",S);const P=new MutationObserver(T);return u&&P.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",S),P.disconnect()}}},[s,u,x.paused]),v.useEffect(()=>{if(u){B4.add(x);const w=document.activeElement;if(!u.contains(w)){const T=new CustomEvent(c1,U4);u.addEventListener(c1,h),u.dispatchEvent(T),T.defaultPrevented||(WT(YT(gx(u)),{select:!0}),document.activeElement===w&&Zi(u))}return()=>{u.removeEventListener(c1,h),setTimeout(()=>{const T=new CustomEvent(u1,U4);u.addEventListener(u1,p),u.dispatchEvent(T),T.defaultPrevented||Zi(w??document.body,{select:!0}),u.removeEventListener(u1,p),B4.remove(x)},0)}}},[u,h,p,x]);const y=v.useCallback(w=>{if(!r&&!s||x.paused)return;const S=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,T=document.activeElement;if(S&&T){const P=w.currentTarget,[k,R]=GT(P);k&&R?!w.shiftKey&&T===R?(w.preventDefault(),r&&Zi(k,{select:!0})):w.shiftKey&&T===k&&(w.preventDefault(),r&&Zi(R,{select:!0})):T===P&&w.preventDefault()}},[r,s,x.paused]);return E.jsx(ln.div,{tabIndex:-1,...c,ref:_,onKeyDown:y})},"FocusScope"));function WT(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Zi(r,{select:e}),document.activeElement!==n)return}cr(WT,"focusFirst");function GT(t){const e=gx(t),n=E_(e,t),r=E_(e.reverse(),t);return[n,r]}cr(GT,"getTabbableEdges");function gx(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:cr(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}cr(gx,"getTabbableCandidates");function E_(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):KT(r,{upTo:e})))return r}cr(E_,"findVisible");function KT(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}cr(KT,"isHidden");function ZT(t){return t instanceof HTMLInputElement&&"select"in t}cr(ZT,"isSelectableInput");function Zi(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&ZT(t)&&e&&t.select()}}cr(Zi,"focus");var B4=qT();function qT(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=C_(t,e),t.unshift(e)},remove(e){var n;t=C_(t,e),(n=t[0])==null||n.resume()}}}cr(qT,"createFocusScopesStack");function C_(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}cr(C_,"arrayRemove");function YT(t){return t.filter(e=>e.tagName!=="A")}cr(YT,"removeLinks");var CH=Object.defineProperty,kH=(t,e)=>CH(t,"name",{value:e,configurable:!0}),vx=v.forwardRef(kH(function(e,n){var u;const{container:r,...s}=e,[i,a]=v.useState(!1);Pr(()=>a(!0),[]);const c=r||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return c?d0.createPortal(E.jsx(ln.div,{...s,ref:n}),c):null},"Portal")),PH=Object.defineProperty,uo=(t,e)=>PH(t,"name",{value:e,configurable:!0});function XT(t,e){return v.useReducer((n,r)=>e[n][r]??n,t)}uo(XT,"useStateMachine");var ya=uo(t=>{const{present:e,children:n}=t,r=QT(e),s=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),i=JT(r.ref,e5(s));return typeof n=="function"||r.isPresent?v.cloneElement(s,{ref:i}):null},"Presence");function QT(t){const[e,n]=v.useState(),r=v.useRef(null),s=v.useRef(t),i=v.useRef("none"),a=v.useRef(void 0),c=t?"mounted":"unmounted",[u,f]=XT(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{u==="mounted"?(i.current=a.current??vc(r.current),a.current=void 0):i.current="none"},[u]),Pr(()=>{const h=r.current,p=s.current;if(p!==t){const _=i.current,x=vc(h);t?(a.current=x,f("MOUNT")):x==="none"||(h==null?void 0:h.display)==="none"?f("UNMOUNT"):f(p&&_!==x?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,f]),Pr(()=>{if(e){let h;const p=e.ownerDocument.defaultView??window,m=uo(x=>{const w=vc(r.current).includes(CSS.escape(x.animationName));if(x.target===e&&w&&(f("ANIMATION_END"),!s.current)){const S=e.style.animationFillMode;e.style.animationFillMode="forwards",h=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=S)})}},"handleAnimationEnd"),_=uo(x=>{x.target===e&&(i.current=vc(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",_),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{p.clearTimeout(h),e.removeEventListener("animationstart",_),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else f("ANIMATION_END")},[e,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:v.useCallback(h=>{if(h){const p=getComputedStyle(h);r.current=p,a.current=vc(p)}else r.current=null;n(h)},[])}}uo(QT,"usePresence");function k_(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}uo(k_,"setRef");function JT(...t){const e=v.useRef(t);return e.current=t,v.useCallback(n=>{const r=e.current;let s=!1;const i=r.map(a=>{const c=k_(a,n);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let a=0;a<i.length;a++){const c=i[a];typeof c=="function"?c():k_(r[a],null)}}},[])}uo(JT,"useStableComposedRefs");function vc(t){return(t==null?void 0:t.animationName)||"none"}uo(vc,"getAnimationName");function e5(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)}uo(e5,"getElementRef");var TH=Object.defineProperty,yx=(t,e)=>TH(t,"name",{value:e,configurable:!0}),lp=0,ri=null;function RH(t){return f0(),t.children}yx(RH,"FocusGuards");function f0(){v.useEffect(()=>{ri||(ri={start:P_(),end:P_()});const{start:t,end:e}=ri;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),lp++,()=>{lp===1&&(ri==null||ri.start.remove(),ri==null||ri.end.remove(),ri=null),lp=Math.max(0,lp-1)}},[])}yx(f0,"useFocusGuards");function P_(){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}yx(P_,"createFocusGuard");var di=function(){return di=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},di.apply(this,arguments)};function t5(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 AH(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 Fp="right-scroll-bar-position",Vp="width-before-scroll-bar",IH="with-scroll-bars-hidden",MH="--removed-body-scroll-bar-size";function d1(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function OH(t,e){var n=v.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 LH=typeof window<"u"?v.useLayoutEffect:v.useEffect,W4=new WeakMap;function NH(t,e){var n=OH(null,function(r){return t.forEach(function(s){return d1(s,r)})});return LH(function(){var r=W4.get(n);if(r){var s=new Set(r),i=new Set(t),a=n.current;s.forEach(function(c){i.has(c)||d1(c,null)}),i.forEach(function(c){s.has(c)||d1(c,a)})}W4.set(n,t)},[t]),n}function DH(t){return t}function jH(t,e){e===void 0&&(e=DH);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 a=e(i,r);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(i),a=n}var u=function(){var h=a;a=[],h.forEach(i)},f=function(){return Promise.resolve().then(u)};f(),n={push:function(h){a.push(h),f()},filter:function(h){return a=a.filter(h),n}}}};return s}function FH(t){t===void 0&&(t={});var e=jH(null);return e.options=di({async:!0,ssr:!1},t),e}var n5=function(t){var e=t.sideCar,n=t5(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 v.createElement(r,di({},n))};n5.isSideCarExport=!0;function VH(t,e){return t.useMedium(e),n5}var r5=FH(),f1=function(){},h0=v.forwardRef(function(t,e){var n=v.useRef(null),r=v.useState({onScrollCapture:f1,onWheelCapture:f1,onTouchMoveCapture:f1}),s=r[0],i=r[1],a=t.forwardProps,c=t.children,u=t.className,f=t.removeScrollBar,h=t.enabled,p=t.shards,m=t.sideCar,_=t.noRelative,x=t.noIsolation,y=t.inert,w=t.allowPinchZoom,S=t.as,T=S===void 0?"div":S,P=t.gapMode,k=t5(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=m,L=NH([n,e]),O=di(di({},k),s);return v.createElement(v.Fragment,null,h&&v.createElement(R,{sideCar:r5,removeScrollBar:f,shards:p,noRelative:_,noIsolation:x,inert:y,setCallbacks:i,allowPinchZoom:!!w,lockRef:n,gapMode:P}),a?v.cloneElement(v.Children.only(c),di(di({},O),{ref:L})):v.createElement(T,di({},O,{className:u,ref:L}),c))});h0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};h0.classNames={fullWidth:Vp,zeroRight:Fp};var $H=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function HH(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=$H();return e&&t.setAttribute("nonce",e),t}function zH(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function UH(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var BH=function(){var t=0,e=null;return{add:function(n){t==0&&(e=HH())&&(zH(e,n),UH(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},WH=function(){var t=BH();return function(e,n){v.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},s5=function(){var t=WH(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},GH={left:0,top:0,right:0,gap:0},h1=function(t){return parseInt(t||"",10)||0},KH=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[h1(n),h1(r),h1(s)]},ZH=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return GH;var e=KH(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])}},qH=s5(),Pc="data-scroll-locked",YH=function(t,e,n,r){var s=t.left,i=t.top,a=t.right,c=t.gap;return n===void 0&&(n="margin"),`
|
|
71
|
+
.`.concat(IH,` {
|
|
72
|
+
overflow: hidden `).concat(r,`;
|
|
73
|
+
padding-right: `).concat(c,"px ").concat(r,`;
|
|
74
|
+
}
|
|
75
|
+
body[`).concat(Pc,`] {
|
|
76
|
+
overflow: hidden `).concat(r,`;
|
|
77
|
+
overscroll-behavior: contain;
|
|
78
|
+
`).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
79
|
+
padding-left: `.concat(s,`px;
|
|
80
|
+
padding-top: `).concat(i,`px;
|
|
81
|
+
padding-right: `).concat(a,`px;
|
|
82
|
+
margin-left:0;
|
|
83
|
+
margin-top:0;
|
|
84
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
85
|
+
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.`).concat(Fp,` {
|
|
89
|
+
right: `).concat(c,"px ").concat(r,`;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.`).concat(Vp,` {
|
|
93
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.`).concat(Fp," .").concat(Fp,` {
|
|
97
|
+
right: 0 `).concat(r,`;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.`).concat(Vp," .").concat(Vp,` {
|
|
101
|
+
margin-right: 0 `).concat(r,`;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
body[`).concat(Pc,`] {
|
|
105
|
+
`).concat(MH,": ").concat(c,`px;
|
|
106
|
+
}
|
|
107
|
+
`)},G4=function(){var t=parseInt(document.body.getAttribute(Pc)||"0",10);return isFinite(t)?t:0},XH=function(){v.useEffect(function(){return document.body.setAttribute(Pc,(G4()+1).toString()),function(){var t=G4()-1;t<=0?document.body.removeAttribute(Pc):document.body.setAttribute(Pc,t.toString())}},[])},QH=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;XH();var i=v.useMemo(function(){return ZH(s)},[s]);return v.createElement(qH,{styles:YH(i,!e,s,n?"":"!important")})},T_=!1;if(typeof window<"u")try{var cp=Object.defineProperty({},"passive",{get:function(){return T_=!0,!0}});window.addEventListener("test",cp,cp),window.removeEventListener("test",cp,cp)}catch{T_=!1}var ac=T_?{passive:!1}:!1,JH=function(t){return t.tagName==="TEXTAREA"},i5=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!JH(t)&&n[e]==="visible")},ez=function(t){return i5(t,"overflowY")},tz=function(t){return i5(t,"overflowX")},K4=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=o5(t,r);if(s){var i=a5(t,r),a=i[1],c=i[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},nz=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},rz=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},o5=function(t,e){return t==="v"?ez(e):tz(e)},a5=function(t,e){return t==="v"?nz(e):rz(e)},sz=function(t,e){return t==="h"&&e==="rtl"?-1:1},iz=function(t,e,n,r,s){var i=sz(t,window.getComputedStyle(e).direction),a=i*r,c=n.target,u=e.contains(c),f=!1,h=a>0,p=0,m=0;do{if(!c)break;var _=a5(t,c),x=_[0],y=_[1],w=_[2],S=y-w-i*x;(x||S)&&o5(t,c)&&(p+=S,m+=x);var T=c.parentNode;c=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!u&&c!==document.body||u&&(e.contains(c)||e===c));return(h&&Math.abs(p)<1||!h&&Math.abs(m)<1)&&(f=!0),f},up=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Z4=function(t){return[t.deltaX,t.deltaY]},q4=function(t){return t&&"current"in t?t.current:t},oz=function(t,e){return t[0]===e[0]&&t[1]===e[1]},az=function(t){return`
|
|
108
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
109
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
110
|
+
`)},lz=0,lc=[];function cz(t){var e=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),s=v.useState(lz++)[0],i=v.useState(s5)[0],a=v.useRef(t);v.useEffect(function(){a.current=t},[t]),v.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var y=AH([t.lockRef.current],(t.shards||[]).map(q4),!0).filter(Boolean);return y.forEach(function(w){return w.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),y.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var c=v.useCallback(function(y,w){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!a.current.allowPinchZoom;var S=up(y),T=n.current,P="deltaX"in y?y.deltaX:T[0]-S[0],k="deltaY"in y?y.deltaY:T[1]-S[1],R,L=y.target,O=Math.abs(P)>Math.abs(k)?"h":"v";if("touches"in y&&O==="h"&&L.type==="range")return!1;var A=window.getSelection(),I=A&&A.anchorNode,N=I?I===L||I.contains(L):!1;if(N)return!1;var j=K4(O,L);if(!j)return!0;if(j?R=O:(R=O==="v"?"h":"v",j=K4(O,L)),!j)return!1;if(!r.current&&"changedTouches"in y&&(P||k)&&(r.current=R),!R)return!0;var F=r.current||R;return iz(F,w,y,F==="h"?P:k)},[]),u=v.useCallback(function(y){var w=y;if(!(!lc.length||lc[lc.length-1]!==i)){var S="deltaY"in w?Z4(w):up(w),T=e.current.filter(function(R){return R.name===w.type&&(R.target===w.target||w.target===R.shadowParent)&&oz(R.delta,S)})[0];if(T&&T.should){w.cancelable&&w.preventDefault();return}if(!T){var P=(a.current.shards||[]).map(q4).filter(Boolean).filter(function(R){return R.contains(w.target)}),k=P.length>0?c(w,P[0]):!a.current.noIsolation;k&&w.cancelable&&w.preventDefault()}}},[]),f=v.useCallback(function(y,w,S,T){var P={name:y,delta:w,target:S,should:T,shadowParent:uz(S)};e.current.push(P),setTimeout(function(){e.current=e.current.filter(function(k){return k!==P})},1)},[]),h=v.useCallback(function(y){n.current=up(y),r.current=void 0},[]),p=v.useCallback(function(y){f(y.type,Z4(y),y.target,c(y,t.lockRef.current))},[]),m=v.useCallback(function(y){f(y.type,up(y),y.target,c(y,t.lockRef.current))},[]);v.useEffect(function(){return lc.push(i),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",u,ac),document.addEventListener("touchmove",u,ac),document.addEventListener("touchstart",h,ac),function(){lc=lc.filter(function(y){return y!==i}),document.removeEventListener("wheel",u,ac),document.removeEventListener("touchmove",u,ac),document.removeEventListener("touchstart",h,ac)}},[]);var _=t.removeScrollBar,x=t.inert;return v.createElement(v.Fragment,null,x?v.createElement(i,{styles:az(s)}):null,_?v.createElement(QH,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function uz(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const dz=VH(r5,cz);var _x=v.forwardRef(function(t,e){return v.createElement(h0,di({},t,{ref:e,sideCar:dz}))});_x.classNames=h0.classNames;var fz=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},cc=new WeakMap,dp=new WeakMap,fp={},p1=0,l5=function(t){return t&&(t.host||l5(t.parentNode))},hz=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=l5(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})},pz=function(t,e,n,r){var s=hz(e,Array.isArray(t)?t:[t]);fp[n]||(fp[n]=new WeakMap);var i=fp[n],a=[],c=new Set,u=new Set(s),f=function(p){!p||c.has(p)||(c.add(p),f(p.parentNode))};s.forEach(f);var h=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(m){if(c.has(m))h(m);else try{var _=m.getAttribute(r),x=_!==null&&_!=="false",y=(cc.get(m)||0)+1,w=(i.get(m)||0)+1;cc.set(m,y),i.set(m,w),a.push(m),y===1&&x&&dp.set(m,!0),w===1&&m.setAttribute(n,"true"),x||m.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",m,S)}})};return h(e),c.clear(),p1++,function(){a.forEach(function(p){var m=cc.get(p)-1,_=i.get(p)-1;cc.set(p,m),i.set(p,_),m||(dp.has(p)||p.removeAttribute(r),dp.delete(p)),_||p.removeAttribute(n)}),p1--,p1||(cc=new WeakMap,cc=new WeakMap,dp=new WeakMap,fp={})}},c5=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=fz(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),pz(r,s,n,"aria-hidden")):function(){return null}},mz=Object.defineProperty,Us=(t,e)=>mz(t,"name",{value:e,configurable:!0}),xx="Dialog",[u5,MJ]=wi(xx),[gz,go]=u5(xx),wx=Us(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,c=v.useRef(null),u=v.useRef(null),[f,h]=va({prop:r,defaultProp:s??!1,onChange:i,caller:xx}),[p,m]=v.useState(0),[_,x]=v.useState(0);return E.jsx(gz,{scope:e,triggerRef:c,contentRef:u,contentId:na(),titleId:na(),descriptionId:na(),titlePresent:p>0,descriptionPresent:_>0,setTitleCount:m,setDescriptionCount:x,open:f,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(y=>!y),[h]),modal:a,children:n})},"Dialog"),d5="DialogPortal",[vz,f5]=u5(d5,{forceMount:void 0}),bx=Us(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=go(d5,e);return E.jsx(vz,{scope:e,forceMount:n,children:v.Children.map(r,a=>E.jsx(ya,{present:n||i.open,children:E.jsx(vx,{asChild:!0,container:s,children:a})}))})},"DialogPortal"),R_="DialogOverlay",Sx=v.forwardRef(Us(function(e,n){const r=f5(R_,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,a=go(R_,e.__scopeDialog);return a.modal?E.jsx(ya,{present:s||a.open,children:E.jsx(_z,{...i,ref:n})}):null},"DialogOverlay")),yz=ua("DialogOverlay.RemoveScroll"),_z=v.forwardRef(Us(function(e,n){const{__scopeDialog:r,...s}=e,i=go(R_,r),a=HT(),c=jt(n,a);return E.jsx(_x,{as:yz,allowPinchZoom:!0,shards:[i.contentRef],children:E.jsx(ln.div,{"data-state":Px(i.open),...s,ref:c,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),Qd="DialogContent",Ex=v.forwardRef(Us(function(e,n){const r=f5(Qd,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,a=go(Qd,e.__scopeDialog);return E.jsx(ya,{present:s||a.open,children:a.modal?E.jsx(xz,{...i,ref:n}):E.jsx(wz,{...i,ref:n})})},"DialogContent")),xz=v.forwardRef(Us(function(e,n){const r=go(Qd,e.__scopeDialog),s=v.useRef(null),i=jt(n,r.contentRef,s);return v.useEffect(()=>{const a=s.current;if(a)return c5(a)},[]),E.jsx(h5,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Nt(e.onCloseAutoFocus,a=>{var c;a.preventDefault(),(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Nt(e.onPointerDownOutside,a=>{const c=a.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&a.preventDefault()}),onFocusOutside:Nt(e.onFocusOutside,a=>a.preventDefault())})},"DialogContentModal")),wz=v.forwardRef(Us(function(e,n){const r=go(Qd,e.__scopeDialog),s=v.useRef(!1),i=v.useRef(!1);return E.jsx(h5,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var c,u;(c=e.onCloseAutoFocus)==null||c.call(e,a),a.defaultPrevented||(s.current||(u=r.triggerRef.current)==null||u.focus(),a.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:a=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,a),a.defaultPrevented||(s.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=a.target;((h=r.triggerRef.current)==null?void 0:h.contains(c))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})},"DialogContentNonModal")),h5=v.forwardRef(Us(function(e,n){const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,...c}=e,u=go(Qd,r);return f0(),E.jsx(E.Fragment,{children:E.jsx(BT,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:a,children:E.jsx(px,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionPresent?u.descriptionId:void 0,"aria-labelledby":u.titlePresent?u.titleId:void 0,"data-state":Px(u.open),...c,ref:n,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})},"DialogContentImpl")),bz="DialogTitle",Cx=v.forwardRef(Us(function(e,n){const{__scopeDialog:r,...s}=e,i=go(bz,r),{setTitleCount:a}=i;return Pr(()=>(a(c=>c+1),()=>a(c=>c-1)),[a]),E.jsx(ln.h2,{id:i.titleId,...s,ref:n})},"DialogTitle")),Sz="DialogDescription",kx=v.forwardRef(Us(function(e,n){const{__scopeDialog:r,...s}=e,i=go(Sz,r),{setDescriptionCount:a}=i;return Pr(()=>(a(c=>c+1),()=>a(c=>c-1)),[a]),E.jsx(ln.p,{id:i.descriptionId,...s,ref:n})},"DialogDescription"));function Px(t){return t?"open":"closed"}Us(Px,"getState");const Ez=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),Cz=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),kz=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),Pz=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),Tz=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),Rz=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),Az=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),Iz=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,40V168H168V88H88V40Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),Mz=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),Oz=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),Lz=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),Nz=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),Dz=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),jz=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),Fz=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),Vz=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),$z=v.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),Hn=v.forwardRef((t,e)=>{const{alt:n,color:r,size:s,weight:i,mirrored:a,children:c,weights:u,...f}=t,{color:h="currentColor",size:p,weight:m="regular",mirrored:_=!1,...x}=v.useContext($z);return v.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:a||_?"scale(-1, 1)":void 0,...x,...f},!!n&&v.createElement("title",null,n),c,u.get(i??m))});Hn.displayName="IconBase";const p5=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:Ez}));p5.displayName="ArrowLeftIcon";const Hz=p5,m5=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:Cz}));m5.displayName="ArrowSquareOutIcon";const zz=m5,g5=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:kz}));g5.displayName="ArrowUpIcon";const Uz=g5,v5=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:Pz}));v5.displayName="CaretDownIcon";const Bz=v5,y5=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:Tz}));y5.displayName="ChatCircleIcon";const Wz=y5,_5=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:Rz}));_5.displayName="CheckIcon";const x5=_5,w5=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:Az}));w5.displayName="CircleNotchIcon";const p0=w5,b5=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:Iz}));b5.displayName="CopyIcon";const Jd=b5,S5=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:Mz}));S5.displayName="MagnifyingGlassIcon";const Gz=S5,E5=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:Oz}));E5.displayName="PencilSimpleIcon";const Kz=E5,C5=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:Lz}));C5.displayName="SidebarSimpleIcon";const Zz=C5,k5=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:Nz}));k5.displayName="SignOutIcon";const qz=k5,P5=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:Dz}));P5.displayName="SparkleIcon";const m1=P5,T5=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:jz}));T5.displayName="SwatchesIcon";const R5=T5,A5=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:Fz}));A5.displayName="TrashIcon";const Yz=A5,I5=v.forwardRef((t,e)=>v.createElement(Hn,{ref:e,...t,weights:Vz}));I5.displayName="XIcon";const M5=I5;function O5(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=O5(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function Xz(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=O5(t))&&(r&&(r+=" "),r+=e);return r}const Qz=(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},Jz=(t,e)=>({classGroupId:t,validator:e}),L5=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Dm="-",Y4=[],eU="arbitrary..",tU=t=>{const e=rU(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return nU(a);const c=a.split(Dm),u=c[0]===""&&c.length>1?1:0;return N5(c,u,e)},getConflictingClassGroupIds:(a,c)=>{if(c){const u=r[a],f=n[a];return u?f?Qz(f,u):u:f||Y4}return n[a]||Y4}}},N5=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const f=N5(t,e+1,i);if(f)return f}const a=n.validators;if(a===null)return;const c=e===0?t.join(Dm):t.slice(e).join(Dm),u=a.length;for(let f=0;f<u;f++){const h=a[f];if(h.validator(c))return h.classGroupId}},nU=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?eU+r:void 0})(),rU=t=>{const{theme:e,classGroups:n}=t;return sU(n,e)},sU=(t,e)=>{const n=L5();for(const r in t){const s=t[r];Tx(s,n,r,e)}return n},Tx=(t,e,n,r)=>{const s=t.length;for(let i=0;i<s;i++){const a=t[i];iU(a,e,n,r)}},iU=(t,e,n,r)=>{if(typeof t=="string"){oU(t,e,n);return}if(typeof t=="function"){aU(t,e,n,r);return}lU(t,e,n,r)},oU=(t,e,n)=>{const r=t===""?e:D5(e,t);r.classGroupId=n},aU=(t,e,n,r)=>{if(cU(t)){Tx(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(Jz(n,t))},lU=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let a=0;a<i;a++){const[c,u]=s[a];Tx(u,D5(e,c),n,r)}},D5=(t,e)=>{let n=t;const r=e.split(Dm),s=r.length;for(let i=0;i<s;i++){const a=r[i];let c=n.nextPart.get(a);c||(c=L5(),n.nextPart.set(a,c)),n=c}return n},cU=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,uU=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const s=(i,a)=>{n[i]=a,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(i){let a=n[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in n?n[i]=a:s(i,a)}}},A_="!",X4=":",dU=[],Q4=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),fU=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let a=0,c=0,u=0,f;const h=s.length;for(let y=0;y<h;y++){const w=s[y];if(a===0&&c===0){if(w===X4){i.push(s.slice(u,y)),u=y+1;continue}if(w==="/"){f=y;continue}}w==="["?a++:w==="]"?a--:w==="("?c++:w===")"&&c--}const p=i.length===0?s:s.slice(u);let m=p,_=!1;p.endsWith(A_)?(m=p.slice(0,-1),_=!0):p.startsWith(A_)&&(m=p.slice(1),_=!0);const x=f&&f>u?f-u:void 0;return Q4(i,_,m,x)};if(e){const s=e+X4,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):Q4(dU,!1,a,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},hU=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 a=n[i],c=a[0]==="[",u=e.has(a);c||u?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},pU=t=>({cache:uU(t.cacheSize),parseClassName:fU(t),sortModifiers:hU(t),postfixLookupClassGroupIds:mU(t),...tU(t)}),mU=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},gU=/\s+/,vU=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=e,c=[],u=t.trim().split(gU);let f="";for(let h=u.length-1;h>=0;h-=1){const p=u[h],{isExternal:m,modifiers:_,hasImportantModifier:x,baseClassName:y,maybePostfixModifierPosition:w}=n(p);if(m){f=p+(f.length>0?" "+f:f);continue}let S=!!w,T;if(S){const O=y.substring(0,w);T=r(O);const A=T&&a[T]?r(y):void 0;A&&A!==T&&(T=A,S=!1)}else T=r(y);if(!T){if(!S){f=p+(f.length>0?" "+f:f);continue}if(T=r(y),!T){f=p+(f.length>0?" "+f:f);continue}S=!1}const P=_.length===0?"":_.length===1?_[0]:i(_).join(":"),k=x?P+A_:P,R=k+T;if(c.indexOf(R)>-1)continue;c.push(R);const L=s(T,S);for(let O=0;O<L.length;++O){const A=L[O];c.push(k+A)}f=p+(f.length>0?" "+f:f)}return f},yU=(...t)=>{let e=0,n,r,s="";for(;e<t.length;)(n=t[e++])&&(r=j5(n))&&(s&&(s+=" "),s+=r);return s},j5=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=j5(t[r]))&&(n&&(n+=" "),n+=e);return n},_U=(t,...e)=>{let n,r,s,i;const a=u=>{const f=e.reduce((h,p)=>p(h),t());return n=pU(f),r=n.cache.get,s=n.cache.set,i=c,c(u)},c=u=>{const f=r(u);if(f)return f;const h=vU(u,n);return s(u,h),h};return i=a,(...u)=>i(yU(...u))},xU=[],_n=t=>{const e=n=>n[t]||xU;return e.isThemeGetter=!0,e},F5=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,V5=/^\((?:(\w[\w-]*):)?(.+)\)$/i,wU=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,bU=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,SU=/\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$/,EU=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,CU=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kU=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Vo=t=>wU.test(t),rt=t=>!!t&&!Number.isNaN(Number(t)),si=t=>!!t&&Number.isInteger(Number(t)),g1=t=>t.endsWith("%")&&rt(t.slice(0,-1)),Vi=t=>bU.test(t),$5=()=>!0,PU=t=>SU.test(t)&&!EU.test(t),Rx=()=>!1,TU=t=>CU.test(t),RU=t=>kU.test(t),AU=t=>!Ae(t)&&!Me(t),IU=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)),MU=t=>_a(t,U5,Rx),Ae=t=>F5.test(t),Ua=t=>_a(t,B5,PU),J4=t=>_a(t,$U,rt),OU=t=>_a(t,G5,$5),LU=t=>_a(t,W5,Rx),ek=t=>_a(t,H5,Rx),NU=t=>_a(t,z5,RU),hp=t=>_a(t,K5,TU),Me=t=>V5.test(t),fd=t=>Rl(t,B5),DU=t=>Rl(t,W5),tk=t=>Rl(t,H5),jU=t=>Rl(t,U5),FU=t=>Rl(t,z5),pp=t=>Rl(t,K5,!0),VU=t=>Rl(t,G5,!0),_a=(t,e,n)=>{const r=F5.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Rl=(t,e,n=!1)=>{const r=V5.exec(t);return r?r[1]?e(r[1]):n:!1},H5=t=>t==="position"||t==="percentage",z5=t=>t==="image"||t==="url",U5=t=>t==="length"||t==="size"||t==="bg-size",B5=t=>t==="length",$U=t=>t==="number",W5=t=>t==="family-name",G5=t=>t==="number"||t==="weight",K5=t=>t==="shadow",HU=()=>{const t=_n("color"),e=_n("font"),n=_n("text"),r=_n("font-weight"),s=_n("tracking"),i=_n("leading"),a=_n("breakpoint"),c=_n("container"),u=_n("spacing"),f=_n("radius"),h=_n("shadow"),p=_n("inset-shadow"),m=_n("text-shadow"),_=_n("drop-shadow"),x=_n("blur"),y=_n("perspective"),w=_n("aspect"),S=_n("ease"),T=_n("animate"),P=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],R=()=>[...k(),Me,Ae],L=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],A=()=>[Me,Ae,u],I=()=>[Vo,"full","auto",...A()],N=()=>[si,"none","subgrid",Me,Ae],j=()=>["auto",{span:["full",si,Me,Ae]},si,Me,Ae],F=()=>[si,"auto",Me,Ae],K=()=>["auto","min","max","fr",Me,Ae],X=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...A()],q=()=>[Vo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],$=()=>[Vo,"screen","full","dvw","lvw","svw","min","max","fit",...A()],ne=()=>[Vo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],z=()=>[t,Me,Ae],D=()=>[...k(),tk,ek,{position:[Me,Ae]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ee=()=>["auto","cover","contain",jU,MU,{size:[Me,Ae]}],ie=()=>[g1,fd,Ua],oe=()=>["","none","full",f,Me,Ae],ce=()=>["",rt,fd,Ua],xe=()=>["solid","dashed","dotted","double"],ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[rt,g1,tk,ek],Ve=()=>["","none",x,Me,Ae],De=()=>["none",rt,Me,Ae],Re=()=>["none",rt,Me,Ae],Ye=()=>[rt,Me,Ae],ut=()=>[Vo,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Vi],breakpoint:[Vi],color:[$5],container:[Vi],"drop-shadow":[Vi],ease:["in","out","in-out"],font:[AU],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Vi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Vi],shadow:[Vi],spacing:["px",rt],text:[Vi],"text-shadow":[Vi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Vo,Ae,Me,w]}],container:["container"],"container-type":[{"@container":["","normal","size",Me,Ae]}],"container-named":[IU],columns:[{columns:[rt,Ae,Me,c]}],"break-after":[{"break-after":P()}],"break-before":[{"break-before":P()}],"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:R()}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[si,"auto",Me,Ae]}],basis:[{basis:[Vo,"full","auto",c,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[rt,Vo,"auto","initial","none",Ae]}],grow:[{grow:["",rt,Me,Ae]}],shrink:[{shrink:["",rt,Me,Ae]}],order:[{order:[si,"first","last","none",Me,Ae]}],"grid-cols":[{"grid-cols":N()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":N()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":K()}],"auto-rows":[{"auto-rows":K()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...X(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...X()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":X()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],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:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mbs:[{mbs:G()}],mbe:[{mbe:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...ne()]}],"min-block-size":[{"min-block":["auto",...ne()]}],"max-block-size":[{"max-block":["none",...ne()]}],w:[{w:[c,"screen",...q()]}],"min-w":[{"min-w":[c,"screen","none",...q()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[a]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",n,fd,Ua]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,VU,OU]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",g1,Ae]}],"font-family":[{font:[DU,LU,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,Me,Ae]}],"line-clamp":[{"line-clamp":[rt,"none",Me,J4]}],leading:[{leading:[i,...A()]}],"list-image":[{"list-image":["none",Me,Ae]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Me,Ae]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...xe(),"wavy"]}],"text-decoration-thickness":[{decoration:[rt,"from-font","auto",Me,Ua]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[rt,"auto",Me,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:[si,Me,Ae]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Me,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",Me,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:Y()}],"bg-size":[{bg:ee()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},si,Me,Ae],radial:["",Me,Ae],conic:[si,Me,Ae]},FU,NU]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:ie()}],"gradient-via-pos":[{via:ie()}],"gradient-to-pos":[{to:ie()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...xe(),"hidden","none"]}],"divide-style":[{divide:[...xe(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-bs":[{"border-bs":z()}],"border-color-be":[{"border-be":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...xe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[rt,Me,Ae]}],"outline-w":[{outline:["",rt,fd,Ua]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",h,pp,hp]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",p,pp,hp]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[rt,Ua]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",m,pp,hp]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[rt,Me,Ae]}],"mix-blend":[{"mix-blend":[...ae(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ae()}],"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":[rt]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[Me,Ae]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"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":k()}],"mask-image-conic-pos":[{"mask-conic":[rt]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:ee()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Me,Ae]}],filter:[{filter:["","none",Me,Ae]}],blur:[{blur:Ve()}],brightness:[{brightness:[rt,Me,Ae]}],contrast:[{contrast:[rt,Me,Ae]}],"drop-shadow":[{"drop-shadow":["","none",_,pp,hp]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",rt,Me,Ae]}],"hue-rotate":[{"hue-rotate":[rt,Me,Ae]}],invert:[{invert:["",rt,Me,Ae]}],saturate:[{saturate:[rt,Me,Ae]}],sepia:[{sepia:["",rt,Me,Ae]}],"backdrop-filter":[{"backdrop-filter":["","none",Me,Ae]}],"backdrop-blur":[{"backdrop-blur":Ve()}],"backdrop-brightness":[{"backdrop-brightness":[rt,Me,Ae]}],"backdrop-contrast":[{"backdrop-contrast":[rt,Me,Ae]}],"backdrop-grayscale":[{"backdrop-grayscale":["",rt,Me,Ae]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[rt,Me,Ae]}],"backdrop-invert":[{"backdrop-invert":["",rt,Me,Ae]}],"backdrop-opacity":[{"backdrop-opacity":[rt,Me,Ae]}],"backdrop-saturate":[{"backdrop-saturate":[rt,Me,Ae]}],"backdrop-sepia":[{"backdrop-sepia":["",rt,Me,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",Me,Ae]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[rt,"initial",Me,Ae]}],ease:[{ease:["linear","initial",S,Me,Ae]}],delay:[{delay:[rt,Me,Ae]}],animate:[{animate:["none",T,Me,Ae]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,Me,Ae]}],"perspective-origin":[{"perspective-origin":R()}],rotate:[{rotate:De()}],"rotate-x":[{"rotate-x":De()}],"rotate-y":[{"rotate-y":De()}],"rotate-z":[{"rotate-z":De()}],scale:[{scale:Re()}],"scale-x":[{"scale-x":Re()}],"scale-y":[{"scale-y":Re()}],"scale-z":[{"scale-z":Re()}],"scale-3d":["scale-3d"],skew:[{skew:Ye()}],"skew-x":[{"skew-x":Ye()}],"skew-y":[{"skew-y":Ye()}],transform:[{transform:[Me,Ae,"","none","gpu","cpu"]}],"transform-origin":[{origin:R()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ut()}],"translate-x":[{"translate-x":ut()}],"translate-y":[{"translate-y":ut()}],"translate-z":[{"translate-z":ut()}],"translate-none":["translate-none"],zoom:[{zoom:[si,Me,Ae]}],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"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",Me,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":z()}],"scrollbar-track-color":[{"scrollbar-track":z()}],"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",Me,Ae]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[rt,fd,Ua,J4]}],stroke:[{stroke:["none",...z()]}],"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":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-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-r","border-w-l"],"border-w-y":["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-r","border-color-l"],"border-color-y":["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-mr","scroll-ml"],"scroll-my":["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-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},zU=_U(HU);function dr(...t){return zU(Xz(t))}const ef={fast:{type:"spring",duration:.08,bounce:0},moderate:{type:"spring",duration:.16,bounce:.15}},nk=["#f59e0b","#38bdf8","#34d399","#a78bfa","#fb7185","#22d3ee","#fb923c","#a3e635","#e879f9","#2dd4bf"];function Z5(t){let e=0;for(let r=0;r<t.length;r++)e=e*31+t.charCodeAt(r)|0;const n=nk[Math.abs(e)%nk.length];return{color:n,backgroundColor:`${n}22`}}function q5(t,e={}){const{axis:n="y"}=e,r=v.useRef(new Map),[s,i]=v.useState(null),[a,c]=v.useState([]),u=v.useRef([]),f=v.useRef(0),h=v.useRef(null),p=v.useRef(null),m=v.useCallback(()=>{if(!t.current)return;const T=[];r.current.forEach((P,k)=>{T[k]={top:P.offsetTop,height:P.offsetHeight,left:P.offsetLeft,width:P.offsetWidth}}),u.current=T,c(T)},[t]),_=v.useCallback((S,T)=>{T?r.current.set(S,T):r.current.delete(S),p.current!==null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{p.current=null,m()})},[m]),x=v.useCallback(S=>{const T=S.clientX,P=S.clientY;h.current!==null&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{h.current=null;const k=t.current;if(!k)return;const R=k.getBoundingClientRect(),L=n==="x"?T:P;let O=null,A=1/0,I=null;const N=u.current,j=n==="x"?k.scrollLeft:k.scrollTop,F=n==="x"?k.clientLeft:k.clientTop,K=n==="x"?R.left:R.top,X=n==="x"?k.offsetWidth:k.offsetHeight,W=n==="x"?R.width:R.height,G=X>0?W/X:1;for(let q=0;q<N.length;q++){const $=N[q];if(!$)continue;const ne=n==="x"?$.left:$.top,z=K+(F+ne-j)*G,D=(n==="x"?$.width:$.height)*G,Y=z+D;L>=z&&L<=Y&&(I=q);const ee=z+D/2,ie=Math.abs(L-ee);ie<A&&(A=ie,O=q)}i(I??O)})},[n,t]),y=v.useCallback(()=>{f.current+=1,m()},[m]),w=v.useCallback(()=>{h.current!==null&&(cancelAnimationFrame(h.current),h.current=null),i(null)},[]);return v.useEffect(()=>()=>{h.current!==null&&cancelAnimationFrame(h.current),p.current!==null&&cancelAnimationFrame(p.current)},[]),{activeIndex:s,setActiveIndex:i,itemRects:a,sessionRef:f,handlers:{onMouseMove:x,onMouseEnter:y,onMouseLeave:w},registerItem:_,measureItems:m}}function UU(t,e,n){v.useEffect(()=>(t(e,n.current),()=>t(e,null)),[e,t,n])}const Y5=(t,e)=>`style:${t}:${e}`,X5=t=>`text:${t}`,Q5=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"]},J5=t=>Q5(t)[0],mp=(t,e)=>Q5(t).includes(e),BU=t=>{const e=J5(t.elementId),n=t.batchId?`:${t.batchId}`:"";return t.type==="style"?`${Y5(e,t.property)}${n}`:`${X5(e)}${n}`},Ln=[];for(let t=0;t<256;++t)Ln.push((t+256).toString(16).slice(1));function WU(t,e=0){return(Ln[t[e+0]]+Ln[t[e+1]]+Ln[t[e+2]]+Ln[t[e+3]]+"-"+Ln[t[e+4]]+Ln[t[e+5]]+"-"+Ln[t[e+6]]+Ln[t[e+7]]+"-"+Ln[t[e+8]]+Ln[t[e+9]]+"-"+Ln[t[e+10]]+Ln[t[e+11]]+Ln[t[e+12]]+Ln[t[e+13]]+Ln[t[e+14]]+Ln[t[e+15]]).toLowerCase()}const GU=new Uint8Array(16);function KU(){return crypto.getRandomValues(GU)}function rk(t,e,n){return crypto.randomUUID?crypto.randomUUID():ZU(t)}function ZU(t,e,n){var s;t=t||{};const r=t.random??((s=t.rng)==null?void 0:s.call(t))??KU();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,WU(r)}const qU=300;class YU{constructor(){Fo(this,"history",{current:new Map,past:[],future:[]});Fo(this,"pendingChanges",new Map);Fo(this,"currentBatchId",null);Fo(this,"debounceTimer",null);Fo(this,"onChangeCallbacks",[]);Fo(this,"stateBeforePending",null);Fo(this,"transactionDepth",0)}recordChange(e){this.pendingChanges.size===0&&(this.currentBatchId=rk(),this.stateBeforePending=new Map(this.history.current)),this.currentBatchId&&(e.batchId=this.currentBatchId);const n=J5(e.elementId),r=e.type==="style"?Y5(n,e.property):X5(n),s=Array.from(this.history.current.entries()).find(([a])=>a===r||a.startsWith(`${r}:`));if(s){const a=s[1];e.type==="style"&&a.type==="style"?e.oldValue=a.oldValue:e.type==="text"&&a.type==="text"&&(e.oldText=a.oldText)}const i=BU(e);this.history.current.set(i,e),this.pendingChanges.set(i,e),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.commitPending()},qU),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"&&mp(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"&&mp(r.elementId,e)).sort((r,s)=>s.timestamp-r.timestamp)[0]}hasChanges(e){return Array.from(this.history.current.values()).some(n=>mp(n.elementId,e))}getChangesForElement(e){return Array.from(this.history.current.values()).filter(n=>mp(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=rk(),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 jm={kind:"base"};function tf(t){return t.kind==="base"?"base":`variant:${t.sessionId}:${t.variantId}`}function XU(t,e){return t.kind==="base"&&e.kind,t.kind==="variant"&&e.kind==="variant"?t.sessionId===e.sessionId&&t.variantId===e.variantId:!1}const QU={resize:{default:!1},variants:{default:!1},designSystemEditor:{default:!1},branchDiff:{default:!1},gitUi:{default:!0},createProject:{default:!1},desktopForceUpgrade:{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}},eR=Object.fromEntries(Object.entries(QU).map(([t,e])=>[t,{isEnabled:e.default}]));nt("view");const tR=nt(!0),nR=nt(null),JU=nt("chat"),rR=nt(0),sR=nt({name:null,email:null}),sk=nt(jm);nt(null);const nf=new Map,eB=t=>{const e=tf(t);let n=nf.get(e);return n||(n=new YU,nf.set(e,n)),n};nt(t=>eB(t(sk)),(t,e,n)=>{nf.set(tf(t(sk)),n)});const tB=t=>{for(const e of[...nf.keys()])e==="base"||t.has(e)||nf.delete(e)},rf=nt(new Map),ik=nt(null);nt(null);const I_=nt(0),Fm=nt(null),M_=nt(!1),O_=nt(null),iR=nt(!1),oR=nt(!1),L_=nt(null),N_=nt(null),sf=nt(null),Ax=nt(null),fo=nt(null),If=nt({active:!1}),aR=nt([]),ok=nt(null),nB=(t,e,n)=>{let r=!1;const s=new Map(t);for(const[i,a]of t)a.target&&XU(a.target,e)&&(s.set(i,{...a,target:n}),r=!0);return r?s:t},rB=nt(null,(t,e,n)=>{const r=u=>{const f=u??jm;return f.kind==="variant"&&!n.has(tf(f))},s=t(rf);let i=null;for(const[u,f]of s)r(f.target)&&(i??(i=new Set)).add(u);if(i){const u=new Map(s);for(const f of i)u.delete(f);e(rf,u)}const a=t(ik);a&&r(a.target)&&(e(ik,null),e(aB,!1));const c=t(ok);c&&(i!=null&&i.has(c.commentId))&&e(ok,null),tB(n)}),D_=nt(eR),sB=nt(!1),lR=nt(null),Mf=nt(!0),cR=nt(!1),uR=nt(!1),dR=nt(null),iB=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},m0=nt(iB()),oB=nt(null),aB=nt(!1);nt(0);nt(0);var $p={exports:{}},lB=$p.exports,ak;function cB(){return ak||(ak=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(lB,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={},a=null;function c(y,w){var S=y[w];if(typeof S.bind=="function")return S.bind(y);try{return Function.prototype.bind.call(S,y)}catch{return function(){return Function.prototype.apply.apply(S,[y,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 f(y){return y==="debug"&&(y="log"),typeof console===n?!1:y==="trace"&&r?u:console[y]!==void 0?c(console,y):console.log!==void 0?c(console,"log"):e}function h(){for(var y=this.getLevel(),w=0;w<s.length;w++){var S=s[w];this[S]=w<y?e:this.methodFactory(S,y,this.name)}if(this.log=this.debug,typeof console===n&&y<this.levels.SILENT)return"No console available for logging"}function p(y){return function(){typeof console!==n&&(h.call(this),this[y].apply(this,arguments))}}function m(y,w,S){return f(y)||p.apply(this,arguments)}function _(y,w){var S=this,T,P,k,R="loglevel";typeof y=="string"?R+=":"+y:typeof y=="symbol"&&(R=void 0);function L(j){var F=(s[j]||"silent").toUpperCase();if(!(typeof window===n||!R)){try{window.localStorage[R]=F;return}catch{}try{window.document.cookie=encodeURIComponent(R)+"="+F+";"}catch{}}}function O(){var j;if(!(typeof window===n||!R)){try{j=window.localStorage[R]}catch{}if(typeof j===n)try{var F=window.document.cookie,K=encodeURIComponent(R),X=F.indexOf(K+"=");X!==-1&&(j=/^([^;]+)/.exec(F.slice(X+K.length+1))[1])}catch{}return S.levels[j]===void 0&&(j=void 0),j}}function A(){if(!(typeof window===n||!R)){try{window.localStorage.removeItem(R)}catch{}try{window.document.cookie=encodeURIComponent(R)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function I(j){var F=j;if(typeof F=="string"&&S.levels[F.toUpperCase()]!==void 0&&(F=S.levels[F.toUpperCase()]),typeof F=="number"&&F>=0&&F<=S.levels.SILENT)return F;throw new TypeError("log.setLevel() called with invalid level: "+j)}S.name=y,S.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},S.methodFactory=w||m,S.getLevel=function(){return k??P??T},S.setLevel=function(j,F){return k=I(j),F!==!1&&L(k),h.call(S)},S.setDefaultLevel=function(j){P=I(j),O()||S.setLevel(j,!1)},S.resetLevel=function(){k=null,A(),h.call(S)},S.enableAll=function(j){S.setLevel(S.levels.TRACE,j)},S.disableAll=function(j){S.setLevel(S.levels.SILENT,j)},S.rebuild=function(){if(a!==S&&(T=I(a.getLevel())),h.call(S),a===S)for(var j in i)i[j].rebuild()},T=I(a?a.getLevel():"WARN");var N=O();N!=null&&(k=I(N)),h.call(S)}a=new _,a.getLogger=function(w){if(typeof w!="symbol"&&typeof w!="string"||w==="")throw new TypeError("You must supply a name when creating a logger.");var S=i[w];return S||(S=i[w]=new _(w,a.methodFactory)),S};var x=typeof window!==n?window.log:void 0;return a.noConflict=function(){return typeof window!==n&&window.log===a&&(window.log=x),a},a.getLoggers=function(){return i},a.default=a,a})})($p)),$p.exports}var uB=cB();const js=e0(uB),dB="INFO",fB=dB.toUpperCase();js.setLevel(js.levels[fB]||js.levels.INFO);const xs=t=>{const e=t?`[${t}] `:"";return{trace:(n,...r)=>js.trace(`${e}${n}`,...r),debug:(n,...r)=>js.debug(`${e}${n}`,...r),info:(n,...r)=>js.info(`${e}${n}`,...r),warn:(n,...r)=>js.warn(`${e}${n}`,...r),error:(n,...r)=>{js.error(`${e}${n}`,...r);try{const i=r.map(c=>c instanceof Error?c.message:String(c)).join(" ").slice(0,512),a={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}:{}};be.capture("logger_error",a)}catch(s){console.error("[logger] Failed to send logger_error to PostHog:",s)}},api:(n,...r)=>js.info(`${e}API: ${n}`,...r),hook:(n,...r)=>js.debug(`${e}Hook: ${n}`,...r),mount:(n,...r)=>js.debug(`${e}Mount: ${n}`,...r)}};let Hp=0;const hB=()=>{Hp+=1;let t=!1;return()=>{t||(t=!0,Hp=Math.max(0,Hp-1))}},pB=()=>Hp>0;function mB(t){return t==="cursor"?"Cursor":t==="codex"?"Codex":t==="claude-desktop"?"Claude":"Claude Code"}const gB=["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],Ix=({className:t,"data-testid":e}={})=>E.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:E.jsx("div",{className:"rivet-sparkle-strip",children:gB.map((n,r)=>E.jsx("span",{className:"block",style:{height:"1em",lineHeight:"1em"},children:n},r))})}),vB=["top","right","bottom","left"],da=Math.min,lo=Math.max,Vm=Math.round,gp=Math.floor,co=t=>({x:t,y:t}),yB={left:"right",right:"left",bottom:"top",top:"bottom"};function fR(t,e,n){return lo(t,da(e,n))}function ho(t,e){return typeof t=="function"?t(e):t}function fa(t){return t.split("-")[0]}function du(t){return t.split("-")[1]}function Mx(t){return t==="x"?"y":"x"}function Ox(t){return t==="y"?"height":"width"}function pi(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Lx(t){return Mx(pi(t))}function _B(t,e,n){n===void 0&&(n=!1);const r=du(t),s=Lx(t),i=Ox(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=$m(a)),[a,$m(a)]}function xB(t){const e=$m(t);return[j_(t),e,j_(e)]}function j_(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const lk=["left","right"],ck=["right","left"],wB=["top","bottom"],bB=["bottom","top"];function SB(t,e,n){switch(t){case"top":case"bottom":return n?e?ck:lk:e?lk:ck;case"left":case"right":return e?wB:bB;default:return[]}}function EB(t,e,n,r){const s=du(t);let i=SB(fa(t),n==="start",r);return s&&(i=i.map(a=>a+"-"+s),e&&(i=i.concat(i.map(j_)))),i}function $m(t){const e=fa(t);return yB[e]+t.slice(e.length)}function CB(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 hR(t){return typeof t!="number"?CB(t):{top:t,right:t,bottom:t,left:t}}function Hm(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 uk(t,e,n){let{reference:r,floating:s}=t;const i=pi(e),a=Lx(e),c=Ox(a),u=fa(e),f=i==="y",h=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,m=r[c]/2-s[c]/2;let _;switch(u){case"top":_={x:h,y:r.y-s.height};break;case"bottom":_={x:h,y:r.y+r.height};break;case"right":_={x:r.x+r.width,y:p};break;case"left":_={x:r.x-s.width,y:p};break;default:_={x:r.x,y:r.y}}const x=du(e);return x&&(_[a]+=m*(x==="end"?1:-1)*(n&&f?-1:1)),_}async function kB(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:a,elements:c,strategy:u}=t,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:m=!1,padding:_=0}=ho(e,t),x=hR(_),w=c[m?p==="floating"?"reference":"floating":p],S=Hm(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:f,rootBoundary:h,strategy:u})),T=p==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),k=await(i.isElement==null?void 0:i.isElement(P))&&await(i.getScale==null?void 0:i.getScale(P))||{x:1,y:1},R=Hm(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:T,offsetParent:P,strategy:u}):T);return{top:(S.top-R.top+x.top)/k.y,bottom:(R.bottom-S.bottom+x.bottom)/k.y,left:(S.left-R.left+x.left)/k.x,right:(R.right-S.right+x.right)/k.x}}const PB=50,TB=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:a}=n,c=a.detectOverflow?a:{...a,detectOverflow:kB},u=await(a.isRTL==null?void 0:a.isRTL(e));let f=await a.getElementRects({reference:t,floating:e,strategy:s}),{x:h,y:p}=uk(f,r,u),m=r,_=0;const x={};for(let y=0;y<i.length;y++){const w=i[y];if(!w)continue;const{name:S,fn:T}=w,{x:P,y:k,data:R,reset:L}=await T({x:h,y:p,initialPlacement:r,placement:m,strategy:s,middlewareData:x,rects:f,platform:c,elements:{reference:t,floating:e}});h=P??h,p=k??p,x[S]={...x[S],...R},L&&_<PB&&(_++,typeof L=="object"&&(L.placement&&(m=L.placement),L.rects&&(f=L.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:s}):L.rects),{x:h,y:p}=uk(f,m,u)),y=-1)}return{x:h,y:p,placement:m,strategy:s,middlewareData:x}},RB=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:a,elements:c,middlewareData:u}=e,{element:f,padding:h=0}=ho(t,e)||{};if(f==null)return{};const p=hR(h),m={x:n,y:r},_=Lx(s),x=Ox(_),y=await a.getDimensions(f),w=_==="y",S=w?"top":"left",T=w?"bottom":"right",P=w?"clientHeight":"clientWidth",k=i.reference[x]+i.reference[_]-m[_]-i.floating[x],R=m[_]-i.reference[_],L=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let O=L?L[P]:0;(!O||!await(a.isElement==null?void 0:a.isElement(L)))&&(O=c.floating[P]||i.floating[x]);const A=k/2-R/2,I=O/2-y[x]/2-1,N=da(p[S],I),j=da(p[T],I),F=O-y[x]-j,K=O/2-y[x]/2+A,X=fR(N,K,F),W=!u.arrow&&du(s)!=null&&K!==X&&i.reference[x]/2-(K<N?N:j)-y[x]/2<0,G=W?K<N?K-N:K-F:0;return{[_]:m[_]+G,data:{[_]:X,centerOffset:K-X-G,...W&&{alignmentOffset:G}},reset:W}}}),AB=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:s,middlewareData:i,rects:a,initialPlacement:c,platform:u,elements:f}=e,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...w}=ho(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=fa(s),T=pi(c),P=fa(c)===c,k=await(u.isRTL==null?void 0:u.isRTL(f.floating)),R=m||(P||!y?[$m(c)]:xB(c)),L=x!=="none";!m&&L&&R.push(...EB(c,y,x,k));const O=[c,...R],A=await u.detectOverflow(e,w),I=[];let N=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&I.push(A[S]),p){const X=_B(s,a,k);I.push(A[X[0]],A[X[1]])}if(N=[...N,{placement:s,overflows:I}],!I.every(X=>X<=0)){var j,F;const X=(((j=i.flip)==null?void 0:j.index)||0)+1,W=O[X];if(W&&(!(p==="alignment"?T!==pi(W):!1)||N.every($=>pi($.placement)===T?$.overflows[0]>0:!0)))return{data:{index:X,overflows:N},reset:{placement:W}};let G=(F=N.filter(q=>q.overflows[0]<=0).sort((q,$)=>q.overflows[1]-$.overflows[1])[0])==null?void 0:F.placement;if(!G)switch(_){case"bestFit":{var K;const q=(K=N.filter($=>{if(L){const ne=pi($.placement);return ne===T||ne==="y"}return!0}).map($=>[$.placement,$.overflows.filter(ne=>ne>0).reduce((ne,z)=>ne+z,0)]).sort(($,ne)=>$[1]-ne[1])[0])==null?void 0:K[0];q&&(G=q);break}case"initialPlacement":G=c;break}if(s!==G)return{reset:{placement:G}}}return{}}}};function dk(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function fk(t){return vB.some(e=>t[e]>=0)}const IB=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:s="referenceHidden",...i}=ho(t,e);switch(s){case"referenceHidden":{const a=await r.detectOverflow(e,{...i,elementContext:"reference"}),c=dk(a,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:fk(c)}}}case"escaped":{const a=await r.detectOverflow(e,{...i,altBoundary:!0}),c=dk(a,n.floating);return{data:{escapedOffsets:c,escaped:fk(c)}}}default:return{}}}}},pR=new Set(["left","top"]);async function MB(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=fa(n),c=du(n),u=pi(n)==="y",f=pR.has(a)?-1:1,h=i&&u?-1:1,p=ho(e,t);let{mainAxis:m,crossAxis:_,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof x=="number"&&(_=c==="end"?x*-1:x),u?{x:_*h,y:m*f}:{x:m*f,y:_*h}}const OB=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:a,middlewareData:c}=e,u=await MB(e,t);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+u.x,y:i+u.y,data:{...u,placement:a}}}}},LB=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:a=!0,crossAxis:c=!1,limiter:u={fn:T=>{let{x:P,y:k}=T;return{x:P,y:k}}},...f}=ho(t,e),h={x:n,y:r},p=await i.detectOverflow(e,f),m=pi(s),_=Mx(m);let x=h[_],y=h[m];const w=(T,P)=>fR(P+p[T==="y"?"top":"left"],P,P-p[T==="y"?"bottom":"right"]);a&&(x=w(_,x)),c&&(y=w(m,y));const S=u.fn({...e,[_]:x,[m]:y});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[_]:a,[m]:c}}}}}},NB=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:s,y:i,placement:a,rects:c,middlewareData:u}=e,{offset:f=0,mainAxis:h=!0,crossAxis:p=!0}=ho(t,e),m={x:s,y:i},_=pi(a),x=Mx(_);let y=m[x],w=m[_];const S=ho(f,e),T=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(n=S.mainAxis)!=null?n:0,crossAxis:(r=S.crossAxis)!=null?r:0};if(h){const R=x==="y"?"height":"width",L=c.reference[x]-c.floating[R]+T.mainAxis,O=c.reference[x]+c.reference[R]-T.mainAxis;y<L?y=L:y>O&&(y=O)}if(p){var P,k;const R=x==="y"?"width":"height",L=pR.has(fa(a)),O=c.reference[_]-c.floating[R]+(L&&((P=u.offset)==null?void 0:P[_])||0)+(L?0:T.crossAxis),A=c.reference[_]+c.reference[R]+(L?0:((k=u.offset)==null?void 0:k[_])||0)-(L?T.crossAxis:0);w<O?w=O:w>A&&(w=A)}return{[x]:y,[_]:w}}}},DB=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:a=()=>{},...c}=ho(t,e),u=await s.detectOverflow(e,c),f=fa(n),h=du(n),p=pi(n)==="y",{width:m,height:_}=r.floating;let x,y;f==="top"||f==="bottom"?(x=f,y=h===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(y=f,x=h==="end"?"top":"bottom");const w=_-u.top-u.bottom,S=m-u.left-u.right,T=da(_-u[x],w),P=da(m-u[y],S),k=e.middlewareData.shift,R=!k;let L=T,O=P;k!=null&&k.enabled.x&&(O=S),k!=null&&k.enabled.y&&(L=w),R&&!h&&(p?O=m-2*lo(u.left,u.right):L=_-2*lo(u.top,u.bottom)),await a({...e,availableWidth:O,availableHeight:L});const A=await s.getDimensions(i.floating);return m!==A.width||_!==A.height?{reset:{rects:!0}}:{}}}};function g0(){return typeof window<"u"}function fu(t){return mR(t)?(t.nodeName||"").toLowerCase():"#document"}function Tr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function vo(t){var e;return(e=(mR(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function mR(t){return g0()?t instanceof Node||t instanceof Tr(t).Node:!1}function yi(t){return g0()?t instanceof Element||t instanceof Tr(t).Element:!1}function xa(t){return g0()?t instanceof HTMLElement||t instanceof Tr(t).HTMLElement:!1}function hk(t){return!g0()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Tr(t).ShadowRoot}function v0(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=_i(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&s!=="inline"&&s!=="contents"}function jB(t){return/^(table|td|th)$/.test(fu(t))}function y0(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const FB=/transform|translate|scale|rotate|perspective|filter/,VB=/paint|layout|strict|content/,Ba=t=>!!t&&t!=="none";let v1;function Nx(t){const e=yi(t)?_i(t):t;return Ba(e.transform)||Ba(e.translate)||Ba(e.scale)||Ba(e.rotate)||Ba(e.perspective)||!Dx()&&(Ba(e.backdropFilter)||Ba(e.filter))||FB.test(e.willChange||"")||VB.test(e.contain||"")}function $B(t){let e=Pl(t);for(;xa(e)&&!of(e);){if(Nx(e))return e;if(y0(e))return null;e=Pl(e)}return null}function Dx(){return v1==null&&(v1=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),v1}function of(t){return/^(html|body|#document)$/.test(fu(t))}function _i(t){return Tr(t).getComputedStyle(t)}function _0(t){return yi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Pl(t){if(fu(t)==="html")return t;const e=t.assignedSlot||t.parentNode||hk(t)&&t.host||vo(t);return hk(e)?e.host:e}function gR(t){const e=Pl(t);return of(e)?(t.ownerDocument||t).body:xa(e)&&v0(e)?e:gR(e)}function af(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=gR(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),a=Tr(s);if(i){const c=F_(a);return e.concat(a,a.visualViewport||[],v0(s)?s:[],c&&n?af(c):[])}else return e.concat(s,af(s,[],n))}function F_(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function vR(t){const e=_i(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=xa(t),i=s?t.offsetWidth:n,a=s?t.offsetHeight:r,c=Vm(n)!==i||Vm(r)!==a;return c&&(n=i,r=a),{width:n,height:r,$:c}}function jx(t){return yi(t)?t:t.contextElement}function Tc(t){const e=jx(t);if(!xa(e))return co(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=vR(e);let a=(i?Vm(n.width):n.width)/r,c=(i?Vm(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const HB=co(0);function yR(t){const e=Tr(t);return!Dx()||!e.visualViewport?HB:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function zB(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Tr(t)}function Tl(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=jx(t);let a=co(1);e&&(r?yi(r)&&(a=Tc(r)):a=Tc(t));const c=zB(i,n,r)?yR(i):co(0);let u=(s.left+c.x)/a.x,f=(s.top+c.y)/a.y,h=s.width/a.x,p=s.height/a.y;if(i&&r){const m=Tr(i),_=yi(r)?Tr(r):r;let x=m,y=F_(x);for(;y&&_!==x;){const w=Tc(y),S=y.getBoundingClientRect(),T=_i(y),P=S.left+(y.clientLeft+parseFloat(T.paddingLeft))*w.x,k=S.top+(y.clientTop+parseFloat(T.paddingTop))*w.y;u*=w.x,f*=w.y,h*=w.x,p*=w.y,u+=P,f+=k,x=Tr(y),y=F_(x)}}return Hm({width:h,height:p,x:u,y:f})}function x0(t,e){const n=_0(t).scrollLeft;return e?e.left+n:Tl(vo(t)).left+n}function _R(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-x0(t,n),s=n.top+e.scrollTop;return{x:r,y:s}}function UB(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",a=vo(r),c=e?y0(e.floating):!1;if(r===a||c&&i)return n;let u={scrollLeft:0,scrollTop:0},f=co(1);const h=co(0),p=xa(r);if((p||!i)&&((fu(r)!=="body"||v0(a))&&(u=_0(r)),p)){const _=Tl(r);f=Tc(r),h.x=_.x+r.clientLeft,h.y=_.y+r.clientTop}const m=a&&!p&&!i?_R(a,u):co(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-u.scrollLeft*f.x+h.x+m.x,y:n.y*f.y-u.scrollTop*f.y+h.y+m.y}}function BB(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function WB(t){const e=_0(t),n=t.ownerDocument.body,r=lo(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=lo(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+x0(t);const a=-e.scrollTop;return _i(n).direction==="rtl"&&(i+=lo(t.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:a}}const GB=25;function KB(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=Tr(t),i=vo(t),a=s.visualViewport;let c=i.clientWidth,u=i.clientHeight,f=0,h=0;if(a){const m=!Dx()||e==="fixed";r?m||(f=-a.offsetLeft,h=-a.offsetTop):(c=a.width,u=a.height,m&&(f=a.offsetLeft,h=a.offsetTop))}if(x0(i)<=0){const m=i.ownerDocument,_=m.body,x=getComputedStyle(_),y=m.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,w=Math.abs(i.clientWidth-_.clientWidth-y),S=getComputedStyle(i).scrollbarGutter==="stable both-edges"?w/2:w;S<=GB&&(c-=S)}return{width:c,height:u,x:f,y:h}}function ZB(t,e){const n=Tl(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Tc(t),a=t.clientWidth*i.x,c=t.clientHeight*i.y,u=s*i.x,f=r*i.y;return{width:a,height:c,x:u,y:f}}function pk(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=KB(t,n,e);else if(e==="document")r=WB(vo(t));else if(yi(e))r=ZB(e,n);else{const s=yR(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return Hm(r)}function qB(t,e){const n=e.get(t);if(n)return n;let r=af(t,[],!1).filter(c=>yi(c)&&fu(c)!=="body"),s=null;const i=_i(t).position==="fixed";let a=i?Pl(t):t;for(;yi(a)&&!of(a);){const c=_i(a),u=Nx(a),f=s?s.position:i?"fixed":"";!u&&(f==="fixed"||f==="absolute"&&c.position==="static")?r=r.filter(p=>p!==a):s=c,a=Pl(a)}return e.set(t,r),r}function YB(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const a=[...n==="clippingAncestors"?y0(e)?[]:qB(e,this._c):[].concat(n),r],c=pk(e,a[0],s);let u=c.top,f=c.right,h=c.bottom,p=c.left;for(let m=1;m<a.length;m++){const _=pk(e,a[m],s);u=lo(_.top,u),f=da(_.right,f),h=da(_.bottom,h),p=lo(_.left,p)}return{width:f-p,height:h-u,x:p,y:u}}function XB(t){const{width:e,height:n}=vR(t);return{width:e,height:n}}function QB(t,e,n){const r=xa(e),s=vo(e),i=n==="fixed",a=Tl(t,!0,i,e);let c={scrollLeft:0,scrollTop:0};const u=co(0);if((r||!i)&&((fu(e)!=="body"||v0(s))&&(c=_0(e)),r)){const m=Tl(e,!0,i,e);u.x=m.x+e.clientLeft,u.y=m.y+e.clientTop}!r&&s&&(u.x=x0(s));const f=s&&!r&&!i?_R(s,c):co(0),h=a.left+c.scrollLeft-u.x-f.x,p=a.top+c.scrollTop-u.y-f.y;return{x:h,y:p,width:a.width,height:a.height}}function y1(t){return _i(t).position==="static"}function mk(t,e){if(!xa(t)||_i(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return vo(t)===n&&(n=n.ownerDocument.body),n}function xR(t,e){const n=Tr(t);if(y0(t))return n;if(!xa(t)){let s=Pl(t);for(;s&&!of(s);){if(yi(s)&&!y1(s))return s;s=Pl(s)}return n}let r=mk(t,e);for(;r&&jB(r)&&y1(r);)r=mk(r,e);return r&&of(r)&&y1(r)&&!Nx(r)?n:r||$B(t)||n}const JB=async function(t){const e=this.getOffsetParent||xR,n=this.getDimensions,r=await n(t.floating);return{reference:QB(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function eW(t){return _i(t).direction==="rtl"}const tW={convertOffsetParentRelativeRectToViewportRelativeRect:UB,getDocumentElement:vo,getClippingRect:YB,getOffsetParent:xR,getElementRects:JB,getClientRects:BB,getDimensions:XB,getScale:Tc,isElement:yi,isRTL:eW};function wR(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function nW(t,e,n){let r=null,s;const i=vo(t);function a(){var h;clearTimeout(s),(h=r)==null||h.disconnect(),r=null}function c(h,p){h===void 0&&(h=!1),p===void 0&&(p=1),a();const m=t.getBoundingClientRect(),{left:_,top:x,width:y,height:w}=m;if(h||e(),!y||!w)return;const S=gp(x),T=gp(i.clientWidth-(_+y)),P=gp(i.clientHeight-(x+w)),k=gp(_),L={rootMargin:-S+"px "+-T+"px "+-P+"px "+-k+"px",threshold:lo(0,da(1,p))||1};let O=!0;function A(I){const N=I[0].intersectionRatio;if(!wR(m,t.getBoundingClientRect()))return c();if(N!==p){if(!O)return c();N?c(!1,N):s=setTimeout(()=>{c(!1,1e-7)},1e3)}O=!1}try{r=new IntersectionObserver(A,{...L,root:i.ownerDocument})}catch{r=new IntersectionObserver(A,L)}r.observe(t)}const u=Tr(t),f=()=>c(n);return u.addEventListener("resize",f),c(!0),()=>{u.removeEventListener("resize",f),a()}}function rW(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,f=jx(t),h=s||i?[...f?af(f):[],...e?af(e):[]]:[];h.forEach(S=>{s&&S.addEventListener("scroll",n),i&&S.addEventListener("resize",n)});const p=f&&c?nW(f,n,i):null;let m=-1,_=null;a&&(_=new ResizeObserver(S=>{let[T]=S;T&&T.target===f&&_&&e&&(_.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var P;(P=_)==null||P.observe(e)})),n()}),f&&!u&&_.observe(f),e&&_.observe(e));let x,y=u?Tl(t):null;u&&w();function w(){const S=Tl(t);y&&!wR(y,S)&&n(),y=S,x=requestAnimationFrame(w)}return n(),()=>{var S;h.forEach(T=>{s&&T.removeEventListener("scroll",n),i&&T.removeEventListener("resize",n)}),p==null||p(),(S=_)==null||S.disconnect(),_=null,u&&cancelAnimationFrame(x)}}const sW=OB,iW=LB,oW=AB,aW=DB,lW=IB,gk=RB,cW=NB,uW=(t,e,n)=>{const r=new Map,s=n??{},i={...tW,...s.platform,_c:r};return TB(t,e,{...s,platform:i})};var dW=typeof document<"u",fW=function(){},zp=dW?v.useLayoutEffect:fW;function zm(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(!zm(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)&&!zm(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function bR(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function vk(t,e){const n=bR(t);return Math.round(e*n)/n}function _1(t){const e=v.useRef(t);return zp(()=>{e.current=t}),e}function hW(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:a}={},transform:c=!0,whileElementsMounted:u,open:f}=t,[h,p]=v.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,_]=v.useState(r);zm(m,r)||_(r);const[x,y]=v.useState(null),[w,S]=v.useState(null),T=v.useCallback($=>{$!==L.current&&(L.current=$,y($))},[]),P=v.useCallback($=>{$!==O.current&&(O.current=$,S($))},[]),k=i||x,R=a||w,L=v.useRef(null),O=v.useRef(null),A=v.useRef(h),I=u!=null,N=_1(u),j=_1(s),F=_1(f),K=v.useCallback(()=>{if(!L.current||!O.current)return;const $={placement:e,strategy:n,middleware:m};j.current&&($.platform=j.current),uW(L.current,O.current,$).then(ne=>{const z={...ne,isPositioned:F.current!==!1};X.current&&!zm(A.current,z)&&(A.current=z,d0.flushSync(()=>{p(z)}))})},[m,e,n,j,F]);zp(()=>{f===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,p($=>({...$,isPositioned:!1})))},[f]);const X=v.useRef(!1);zp(()=>(X.current=!0,()=>{X.current=!1}),[]),zp(()=>{if(k&&(L.current=k),R&&(O.current=R),k&&R){if(N.current)return N.current(k,R,K);K()}},[k,R,K,N,I]);const W=v.useMemo(()=>({reference:L,floating:O,setReference:T,setFloating:P}),[T,P]),G=v.useMemo(()=>({reference:k,floating:R}),[k,R]),q=v.useMemo(()=>{const $={position:n,left:0,top:0};if(!G.floating)return $;const ne=vk(G.floating,h.x),z=vk(G.floating,h.y);return c?{...$,transform:"translate("+ne+"px, "+z+"px)",...bR(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ne,top:z}},[n,c,G.floating,h.x,h.y]);return v.useMemo(()=>({...h,update:K,refs:W,elements:G,floatingStyles:q}),[h,K,W,G,q])}const pW=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?gk({element:r.current,padding:s}).fn(n):{}:r?gk({element:r,padding:s}).fn(n):{}}}},mW=(t,e)=>{const n=sW(t);return{name:n.name,fn:n.fn,options:[t,e]}},gW=(t,e)=>{const n=iW(t);return{name:n.name,fn:n.fn,options:[t,e]}},vW=(t,e)=>({fn:cW(t).fn,options:[t,e]}),yW=(t,e)=>{const n=oW(t);return{name:n.name,fn:n.fn,options:[t,e]}},_W=(t,e)=>{const n=aW(t);return{name:n.name,fn:n.fn,options:[t,e]}},xW=(t,e)=>{const n=lW(t);return{name:n.name,fn:n.fn,options:[t,e]}},wW=(t,e)=>{const n=pW(t);return{name:n.name,fn:n.fn,options:[t,e]}};var bW=Object.defineProperty,SW=(t,e)=>bW(t,"name",{value:e,configurable:!0});function Fx(t){const[e,n]=v.useState(void 0);return Pr(()=>{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 a,c;if("borderBoxSize"in i){const u=i.borderBoxSize,f=Array.isArray(u)?u[0]:u;a=f.inlineSize,c=f.blockSize}else a=t.offsetWidth,c=t.offsetHeight;n({width:a,height:c})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}SW(Fx,"useSize");var EW=Object.defineProperty,ra=(t,e)=>EW(t,"name",{value:e,configurable:!0}),SR="Popper",[ER,w0]=wi(SR),[CW,CR]=ER(SR),kW=ra(t=>{const{__scopePopper:e,children:n}=t,[r,s]=v.useState(null),[i,a]=v.useState(void 0);return E.jsx(CW,{scope:e,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:a,children:n})},"Popper"),PW="PopperAnchor",TW=v.forwardRef(ra(function(e,n){const{__scopePopper:r,virtualRef:s,...i}=e,a=CR(PW,r),c=v.useRef(null),u=a.onAnchorChange,f=v.useCallback(y=>{c.current=y,y&&u(y)},[u]),h=jt(n,f),p=v.useRef(null);v.useEffect(()=>{if(!s)return;const y=p.current;p.current=s.current,y!==p.current&&u(p.current)});const m=a.placementState&&b0(a.placementState),_=m==null?void 0:m[0],x=m==null?void 0:m[1];return s?null:E.jsx(ln.div,{"data-radix-popper-side":_,"data-radix-popper-align":x,...i,ref:h})},"PopperAnchor")),kR="PopperContent",[RW,OJ]=ER(kR),AW=v.forwardRef(ra(function(e,n){var se,Ve,De,Re,Ye,ut,kt;const{__scopePopper:r,side:s="bottom",sideOffset:i=0,align:a="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:h=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:_=!1,updatePositionStrategy:x="optimized",onPlaced:y,...w}=e,S=CR(kR,r),[T,P]=v.useState(null),k=jt(n,P),[R,L]=v.useState(null),O=Fx(R),A=(O==null?void 0:O.width)??0,I=(O==null?void 0:O.height)??0,N=s+(a!=="center"?"-"+a:""),j=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},F=Array.isArray(h)?h:[h],K=F.length>0,X={padding:j,boundary:F.filter(PR),altBoundary:K},{refs:W,floatingStyles:G,placement:q,isPositioned:$,middlewareData:ne}=hW({strategy:"fixed",placement:N,whileElementsMounted:ra((...we)=>rW(...we,{animationFrame:x==="always"}),"whileElementsMounted"),elements:{reference:S.anchor},middleware:[mW({mainAxis:i+I,alignmentAxis:c}),f&&gW({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?vW():void 0,...X}),f&&yW({...X}),_W({...X,apply:ra(({elements:we,rects:je,availableWidth:ze,availableHeight:it})=>{const{width:Pt,height:tt}=je.reference,Xe=we.floating.style;Xe.setProperty("--radix-popper-available-width",`${ze}px`),Xe.setProperty("--radix-popper-available-height",`${it}px`),Xe.setProperty("--radix-popper-anchor-width",`${Pt}px`),Xe.setProperty("--radix-popper-anchor-height",`${tt}px`)},"apply")}),R&&wW({element:R,padding:u}),IW({arrowWidth:A,arrowHeight:I}),_&&xW({strategy:"referenceHidden",...X,boundary:K?X.boundary:void 0})]}),z=S.setPlacementState;Pr(()=>(z(q),()=>{z(void 0)}),[q,z]);const[D,Y]=b0(q),ee=kl(y);Pr(()=>{$&&(ee==null||ee())},[$,ee]);const ie=(se=ne.arrow)==null?void 0:se.x,oe=(Ve=ne.arrow)==null?void 0:Ve.y,ce=((De=ne.arrow)==null?void 0:De.centerOffset)!==0,[xe,ae]=v.useState();return Pr(()=>{T&&ae(window.getComputedStyle(T).zIndex)},[T]),E.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:$?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:xe,"--radix-popper-transform-origin":[(Re=ne.transformOrigin)==null?void 0:Re.x,(Ye=ne.transformOrigin)==null?void 0:Ye.y].join(" "),...((ut=ne.hide)==null?void 0:ut.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:E.jsx(RW,{scope:r,placedSide:D,placedAlign:Y,onArrowChange:L,arrowX:ie,arrowY:oe,shouldHideArrow:ce,children:E.jsx(ln.div,{"data-side":D,"data-align":Y,...w,ref:k,style:{...w.style,animation:$?(kt=w.style)==null?void 0:kt.animation:"none"}})})})},"PopperContent"));function PR(t){return t!==null}ra(PR,"isNotNull");var IW=ra(t=>({name:"transformOrigin",options:t,fn(e){var w,S,T;const{placement:n,rects:r,middlewareData:s}=e,a=((w=s.arrow)==null?void 0:w.centerOffset)!==0,c=a?0:t.arrowWidth,u=a?0:t.arrowHeight,[f,h]=b0(n),p={start:"0%",center:"50%",end:"100%"}[h],m=(((S=s.arrow)==null?void 0:S.x)??0)+c/2,_=(((T=s.arrow)==null?void 0:T.y)??0)+u/2;let x="",y="";return f==="bottom"?(x=a?p:`${m}px`,y=`${-u}px`):f==="top"?(x=a?p:`${m}px`,y=`${r.floating.height+u}px`):f==="right"?(x=`${-u}px`,y=a?p:`${_}px`):f==="left"&&(x=`${r.floating.width+u}px`,y=a?p:`${_}px`),{data:{x,y}}}}),"transformOrigin");function b0(t){const[e,n="center"]=t.split("-");return[e,n]}ra(b0,"getSideAndAlignFromPlacement");var TR=kW,RR=TW,AR=AW,MW=Object.defineProperty,wa=(t,e)=>MW(t,"name",{value:e,configurable:!0}),Vx="Popover",[IR,LJ]=wi(Vx,[w0]),$x=w0(),[OW,hu]=IR(Vx),LW=wa(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!1}=t,c=$x(e),u=v.useRef(null),[f,h]=v.useState(!1),[p,m]=va({prop:r,defaultProp:s??!1,onChange:i,caller:Vx});return E.jsx(TR,{...c,children:E.jsx(OW,{scope:e,contentId:na(),triggerRef:u,open:p,onOpenChange:m,onOpenToggle:v.useCallback(()=>m(_=>!_),[m]),hasCustomAnchor:f,onCustomAnchorAdd:v.useCallback(()=>h(!0),[]),onCustomAnchorRemove:v.useCallback(()=>h(!1),[]),modal:a,children:n})})},"Popover"),NW="PopoverTrigger",DW=v.forwardRef(wa(function(e,n){const{__scopePopover:r,...s}=e,i=hu(NW,r),a=$x(r),c=jt(n,i.triggerRef),u=E.jsx(ln.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Hx(i.open),...s,ref:c,onClick:Nt(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?u:E.jsx(RR,{asChild:!0,...a,children:u})},"PopoverTrigger")),MR="PopoverPortal",[jW,FW]=IR(MR,{forceMount:void 0}),VW=wa(t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=hu(MR,e);return E.jsx(jW,{scope:e,forceMount:n,children:E.jsx(ya,{present:n||i.open,children:E.jsx(vx,{asChild:!0,container:s,children:r})})})},"PopoverPortal"),lf="PopoverContent",$W=v.forwardRef(wa(function(e,n){const r=FW(lf,e.__scopePopover),{forceMount:s=r.forceMount,...i}=e,a=hu(lf,e.__scopePopover);return E.jsx(ya,{present:s||a.open,children:a.modal?E.jsx(zW,{...i,ref:n}):E.jsx(UW,{...i,ref:n})})},"PopoverContent")),HW=ua("PopoverContent.RemoveScroll"),zW=v.forwardRef(wa(function(e,n){const r=hu(lf,e.__scopePopover),s=v.useRef(null),i=jt(n,s),a=v.useRef(!1);return v.useEffect(()=>{const c=s.current;if(c)return c5(c)},[]),E.jsx(_x,{as:HW,allowPinchZoom:!0,children:E.jsx(OR,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Nt(e.onCloseAutoFocus,c=>{var u;c.preventDefault(),a.current||(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Nt(e.onPointerDownOutside,c=>{const u=c.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,h=u.button===2||f;a.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:Nt(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),UW=v.forwardRef(wa(function(e,n){const r=hu(lf,e.__scopePopover),s=v.useRef(!1),i=v.useRef(!1);return E.jsx(OR,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var c,u;(c=e.onCloseAutoFocus)==null||c.call(e,a),a.defaultPrevented||(s.current||(u=r.triggerRef.current)==null||u.focus(),a.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:a=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,a),a.defaultPrevented||(s.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=a.target;((h=r.triggerRef.current)==null?void 0:h.contains(c))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})},"PopoverContentNonModal")),OR=v.forwardRef(wa(function(e,n){const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:p,...m}=e,_=hu(lf,r),x=$x(r);return f0(),E.jsx(BT,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:a,children:E.jsx(px,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:h,onDismiss:()=>_.onOpenChange(!1),deferPointerDownOutside:!0,children:E.jsx(AR,{"data-state":Hx(_.open),role:"dialog",id:_.contentId,...x,...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 Hx(t){return t?"open":"closed"}wa(Hx,"getState");var LR=LW,NR=DW,DR=VW,jR=$W;const FR=({primaryLabel:t,primaryIcon:e,primaryAction:n,isDisabled:r=!1,isDropdownDisabled:s=!1,isLoading:i=!1,loadingLabel:a,dropdownAriaLabel:c="More actions",dropdownItems:u})=>{const[f,h]=v.useState(!1),p=i?a??t:t,m=u.length>0;return E.jsxs("div",{className:"flex items-stretch",children:[E.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?E.jsx(e,{className:"h-3.5 w-3.5",weight:"bold"}):null,p]}),m?E.jsxs(LR,{open:f,onOpenChange:h,children:[E.jsx(NR,{asChild:!0,children:E.jsx("button",{"aria-label":c,disabled:s||i,title:c,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:E.jsx(Bz,{className:"h-3.5 w-3.5",weight:"bold"})})}),E.jsx(DR,{children:E.jsx(jR,{className:"border-divider bg-main z-[60] min-w-[140px] rounded-lg border p-1 shadow-lg",sideOffset:5,align:"end",children:u.map(_=>{const x=_.icon;return E.jsxs("button",{onClick:()=>{_.isDisabled||(_.onClick(),h(!1))},disabled:_.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:[x?E.jsx(x,{className:"h-3.5 w-3.5",weight:"bold"}):null,_.label]},_.label)})})})]}):null]})};var BW=Object.defineProperty,WW=(t,e)=>BW(t,"name",{value:e,configurable:!0}),GW=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"}),KW=v.forwardRef(WW(function(e,n){return E.jsx(ln.span,{...e,ref:n,style:{...GW,...e.style}})},"VisuallyHidden")),ZW=KW,qW=Object.defineProperty,Tn=(t,e)=>qW(t,"name",{value:e,configurable:!0}),[zx,NJ]=wi("Tooltip",[w0]),Ux=w0(),YW="TooltipProvider",XW=700,V_="tooltip.open",[QW,Bx]=zx(YW),JW=Tn(t=>{const{__scopeTooltip:e,delayDuration:n=XW,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,a=v.useRef(!0),c=v.useRef(!1),u=v.useRef(0);return v.useEffect(()=>{const f=u.current;return()=>window.clearTimeout(f)},[]),E.jsx(QW,{scope:e,isOpenDelayedRef:a,delayDuration:n,onOpen:v.useCallback(()=>{r<=0||(window.clearTimeout(u.current),a.current=!1)},[r]),onClose:v.useCallback(()=>{r<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>a.current=!0,r))},[r]),isPointerInTransitRef:c,onPointerInTransitChange:v.useCallback(f=>{c.current=f},[]),disableHoverableContent:s,children:i})},"TooltipProvider"),$_="Tooltip",[eG,Of]=zx($_),tG=Tn(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:a,delayDuration:c}=t,u=Bx($_,t.__scopeTooltip),f=Ux(e),[h,p]=v.useState(null),[m,_]=v.useState(void 0),x=na(),y=v.useRef(0),w=a??u.disableHoverableContent,S=c??u.delayDuration,T=v.useRef(!1),[P,k]=va({prop:r,defaultProp:s??!1,onChange:Tn(N=>{N?(u.onOpen(),document.dispatchEvent(new CustomEvent(V_))):u.onClose(),i==null||i(N)},"onChange"),caller:$_}),R=v.useMemo(()=>P?T.current?"delayed-open":"instant-open":"closed",[P]),L=v.useCallback(()=>{window.clearTimeout(y.current),y.current=0,T.current=!1,k(!0)},[k]),O=v.useCallback(()=>{window.clearTimeout(y.current),y.current=0,k(!1)},[k]),A=v.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{T.current=!0,k(!0),y.current=0},S)},[S,k]);v.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]);const I=m??x;return E.jsx(TR,{...f,children:E.jsx(eG,{scope:e,contentId:I,setContentId:_,open:P,stateAttribute:R,trigger:h,onTriggerChange:p,onTriggerEnter:v.useCallback(()=>{u.isOpenDelayedRef.current?A():L()},[u.isOpenDelayedRef,A,L]),onTriggerLeave:v.useCallback(()=>{w?O():(window.clearTimeout(y.current),y.current=0)},[O,w]),onOpen:L,onClose:O,disableHoverableContent:w,children:n})})},"Tooltip"),yk="TooltipTrigger",nG=v.forwardRef(Tn(function(e,n){const{__scopeTooltip:r,...s}=e,i=Of(yk,r),a=Bx(yk,r),c=Ux(r),u=v.useRef(null),f=jt(n,u,i.onTriggerChange),h=v.useRef(!1),p=v.useRef(!1),m=v.useCallback(()=>h.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),E.jsx(RR,{asChild:!0,...c,children:E.jsx(ln.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...s,ref:f,onPointerMove:Nt(e.onPointerMove,_=>{_.pointerType!=="touch"&&!p.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:Nt(e.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:Nt(e.onPointerDown,()=>{i.open&&i.onClose(),h.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:Nt(e.onFocus,()=>{h.current||i.onOpen()}),onBlur:Nt(e.onBlur,i.onClose),onClick:Nt(e.onClick,i.onClose)})})},"TooltipTrigger")),VR="TooltipPortal",[rG,sG]=zx(VR,{forceMount:void 0}),iG=Tn(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=Of(VR,e);return E.jsx(rG,{scope:e,forceMount:n,children:E.jsx(ya,{present:n||i.open,children:E.jsx(vx,{asChild:!0,container:s,children:r})})})},"TooltipPortal"),cf="TooltipContent",oG=v.forwardRef(Tn(function(e,n){const r=sG(cf,e.__scopeTooltip),{forceMount:s=r.forceMount,side:i="top",...a}=e,c=Of(cf,e.__scopeTooltip);return E.jsx(ya,{present:s||c.open,children:c.disableHoverableContent?E.jsx($R,{side:i,...a,ref:n}):E.jsx(aG,{side:i,...a,ref:n})})},"TooltipContent")),aG=v.forwardRef(Tn(function(e,n){const r=Of(cf,e.__scopeTooltip),s=Bx(cf,e.__scopeTooltip),i=v.useRef(null),a=jt(n,i),[c,u]=v.useState(null),{trigger:f,onClose:h}=r,p=i.current,{onPointerInTransitChange:m}=s,_=v.useCallback(()=>{u(null),m(!1)},[m]),x=v.useCallback((y,w)=>{const S=y.currentTarget,T={x:y.clientX,y:y.clientY},P=HR(T,S.getBoundingClientRect()),k=zR(T,P),R=UR(w.getBoundingClientRect()),L=WR([...k,...R]);u(L),m(!0)},[m]);return v.useEffect(()=>()=>_(),[_]),v.useEffect(()=>{if(f&&p){const y=Tn(S=>x(S,p),"handleTriggerLeave"),w=Tn(S=>x(S,f),"handleContentLeave");return f.addEventListener("pointerleave",y),p.addEventListener("pointerleave",w),()=>{f.removeEventListener("pointerleave",y),p.removeEventListener("pointerleave",w)}}},[f,p,x,_]),v.useEffect(()=>{if(c){const y=Tn(w=>{const S=w.target,T={x:w.clientX,y:w.clientY},P=(f==null?void 0:f.contains(S))||(p==null?void 0:p.contains(S)),k=!BR(T,c);P?_():k&&(_(),h())},"handleTrackPointerGrace");return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[f,p,c,h,_]),E.jsx($R,{...e,ref:a})},"TooltipContentHoverable")),lG=LT("TooltipContent"),$R=v.forwardRef(Tn(function(e,n){const{__scopeTooltip:r,children:s,"aria-label":i,id:a,onEscapeKeyDown:c,onPointerDownOutside:u,...f}=e,h=Of(cf,r),p=Ux(r),{onClose:m}=h;v.useEffect(()=>(document.addEventListener(V_,m),()=>document.removeEventListener(V_,m)),[m]),v.useEffect(()=>{if(h.trigger){const x=Tn(y=>{y.target instanceof Node&&y.target.contains(h.trigger)&&m()},"handleScroll");return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[h.trigger,m]);const{setContentId:_}=h;return Pr(()=>(_(a),()=>{_(void 0)}),[a,_]),E.jsx(px,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:x=>x.preventDefault(),onDismiss:m,children:E.jsxs(AR,{"data-state":h.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:h.contentId,...p,...f,ref:n,style:{...f.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:[E.jsx(lG,{children:s}),i?E.jsx(ZW,{id:h.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl"));function HR(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")}}Tn(HR,"getExitSideFromRect");function zR(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}Tn(zR,"getPaddedExitPoints");function UR(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}]}Tn(UR,"getPointsFromRect");function BR(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;i<e.length;a=i++){const c=e[i],u=e[a],f=c.x,h=c.y,p=u.x,m=u.y;h>r!=m>r&&n<(p-f)*(r-h)/(m-h)+f&&(s=!s)}return s}Tn(BR,"isPointInPolygon");function WR(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),GR(e)}Tn(WR,"getHull");function GR(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],a=e[e.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.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],a=n[n.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.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)}Tn(GR,"getHullPresorted");var cG=JW,uG=tG,dG=nG,fG=iG,hG=oG;const Ld={normal:"'wght' 400",medium:"'wght' 450",semibold:"'wght' 550"},KR={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"}},ZR=v.createContext(null);function S0(){const t=v.useContext(ZR);return t?t.classes:KR.pill}function pG(t){const e=document.documentElement;e.classList.add("transitioning"),e.offsetHeight,t(),setTimeout(()=>e.classList.remove("transitioning"),200)}function mG({children:t,defaultShape:e="pill"}){const[n,r]=v.useState(e),s=v.useCallback(i=>{pG(()=>r(i))},[]);return E.jsx(ZR.Provider,{value:{shape:n,setShape:s,classes:KR[n]},children:t})}const qR=v.createContext(null);function YR({value:t,children:e}){return E.jsx(qR.Provider,{value:t,children:e})}function gG(t){switch(t){case"top":return{y:4};case"bottom":return{y:-4};case"left":return{x:4};case"right":return{x:-4}}}function Wx({content:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=200,className:i,forceOpen:a,onOpenChange:c}){const[u,f]=v.useState(!1),h=a!==void 0?a:u,[p,m]=v.useState(!1),_=S0(),x=v.useContext(qR);v.useEffect(()=>{h&&m(!0)},[h]);const y=()=>{h||m(!1)},w=gG(n);return E.jsx(cG,{delayDuration:s,children:E.jsxs(uG,{open:h,onOpenChange:S=>{f(S),c==null||c(S)},children:[E.jsx(dG,{asChild:!0,children:e}),p&&E.jsx(fG,{forceMount:!0,container:x??void 0,children:E.jsx(hG,{side:n,sideOffset:r,forceMount:!0,className:"z-tooltip",children:E.jsx(ao.div,{className:dr("bg-neutral-900 text-white text-[12px] px-2 py-1 border border-white/10 shadow-lg",_.bg,i),style:{fontVariationSettings:Ld.medium},initial:{opacity:0,scale:.8,...w},animate:{opacity:h?1:0,scale:h?1:.9,x:0,y:0},transition:h?{type:"spring",duration:.34,bounce:.55}:{duration:.1},onAnimationComplete:y,children:t})})})]})})}const so=({label:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=300,disabled:i=!1,forceOpen:a})=>i?E.jsx(E.Fragment,{children:e}):E.jsx(Wx,{content:t,side:n,sideOffset:r,delayDuration:s,forceOpen:a,children:e}),E0="/__rivet/preview",_k=`${E0}/variant/`,xk=`${E0}/history/`,XR=t=>t?t.startsWith("/")?t:`/${t}`:"/",vG=t=>`${E0}/variant/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${XR(t.routePath)}`,yG=t=>`${E0}/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${XR(t.routePath)}`,_G=t=>{try{const e=new URL(t,"http://localhost");return e.pathname.startsWith(_k)||e.pathname.startsWith(xk)}catch{return t.startsWith(_k)||t.startsWith(xk)}},wk=t=>{var s,i,a,c;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")?vG({sessionId:e,variantId:n.workItemId,routePath:t.routePath}):e&&(r==null?void 0:r.kind)==="fresh"&&((a=r.executionPlan)==null?void 0:a.mode)!=="vite_app"&&((c=n.preview)==null?void 0:c.kind)!=="dev_server"?`/api/variants/${e}/static/${n.workItemId}`:null},bk="/rivet/",QR=t=>{if(!t.startsWith(bk))return null;const e=t.slice(bk.length);return!e||e==="/"?null:`/${e}`},uf=(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(()=>{})},xG=(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),uf(r,e))}},Um=(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}}},Sk=6,H_="original",Gx="Original",Kx="The original state of your app before any variants were generated.",Ek=200,hn=xs("AgentVariantsPanel"),x1=()=>{var t;(t=window.getSelection())==null||t.removeAllRanges()},wG=t=>t?t.kind==="active"?t.variant.workItemId:`${t.entry.sessionId}:${t.entry.variantId}`:null,uc=t=>{var e;return!!t.hasTree&&((e=t.serve)==null?void 0:e.kind)==="dev-server"},bG=t=>{var e;return t?t.kind==="existing"?!0:((e=t.executionPlan)==null?void 0:e.mode)==="vite_app":!1};function Rc(t,...e){return t?e.some(n=>(n??"").toLowerCase().includes(t)):!0}async function $i(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 SG=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},nl=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")},JR=t=>{var e;return((e=t.previewUnavailable)==null?void 0:e.reason)==="idle_timeout"},eA=t=>t.status==="succeeded"&&!nl(t)&&(!t.previewUnavailable||JR(t)),w1=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"},Ck=(t,e,n)=>{const r=t.includes("?")?"&":"?";return`${t}${r}${encodeURIComponent(e)}=${encodeURIComponent(n)}`},EG=t=>{var e;return SG(t)&&((e=t.preview)==null?void 0:e.kind)==="static_artifact"},kk=(t,e)=>t.map(n=>`${n.workItemId}:${e[n.workItemId]??""}`).join("|"),CG=(t,e)=>t.length===e.length&&t.every((n,r)=>{var i,a;const s=e[r];return n.sessionId===s.sessionId&&n.variantId===s.variantId&&n.label===s.label&&n.brief===s.brief&&n.createdAt===s.createdAt&&((i=n.serve)==null?void 0:i.kind)===((a=s.serve)==null?void 0:a.kind)&&n.hasTree===s.hasTree}),kG=()=>{var xu,Ea,jr,Hf;const t=et(If),e=et(aR),n=et(lR),r=et(Mf),s=et(D_),i=((xu=s.deployPrototype)==null?void 0:xu.isEnabled)??!1,a=((Ea=s.canvasShare)==null?void 0:Ea.isEnabled)??!1,c=((jr=s.variantSend)==null?void 0:jr.isEnabled)??!1,u=((Hf=s.designContextViewer)==null?void 0:Hf.isEnabled)??!1,f=et(uR),h=et(dR),p=ot(I_),m=ot(Fm),_=ot(M_),x=ot(O_),y=ot(iR),w=ot(oR),S=ot(sf),T=ot(Ax),P=ot(nR);v.useEffect(()=>(P("Directions"),()=>P(null)),[P]);const k=et(fo),R=ot(fo),L=v.useCallback((H=!1)=>{if(xG(k),R(null),H&&k){const le=Um("ended",k);be.capture(le.event,le.properties)}},[R,k]),O=et(L_),A=ot(L_),I=et(N_),N=ot(N_),j=I?`${I.sessionId}:${I.variantId}`:null,[F,K]=v.useState(""),[X,W]=v.useState(null),[G,q]=v.useState(null),[$,ne]=v.useState({}),[z,D]=v.useState(null),[Y,ee]=v.useState({}),[ie,oe]=v.useState(null),[ce,xe]=v.useState([]),ae=v.useRef([]);ae.current=ce;const[se,Ve]=v.useState(!1),De=v.useRef(!1);De.current=I!==null||O!==null||se;const Re=v.useMemo(()=>t.active?t.variants:[],[t]),Ye=v.useMemo(()=>Re.filter(EG),[Re]),ut=v.useMemo(()=>kk(Ye,$),[Ye,$]),kt=(z==null?void 0:z.key)===ut?z.shareUrl:null,we=t.active?t.sessionId:null,je=v.useMemo(()=>{const H=new Set;for(const le of Re)le.adoptedSource&&H.add(`${le.adoptedSource.sessionId}:${le.adoptedSource.variantId}`);return H},[Re]),ze=v.useMemo(()=>[...ce.filter(le=>le.sessionId!==we&&!je.has(`${le.sessionId}:${le.variantId}`))].sort((le,Pe)=>{const me=new Date(le.createdAt).getTime(),he=new Date(Pe.createdAt).getTime();return(Number.isNaN(he)?0:he)-(Number.isNaN(me)?0:me)}),[je,ce,we]),it=v.useMemo(()=>I?Re.find(H=>{var le,Pe;return((le=H.adoptedSource)==null?void 0:le.sessionId)===I.sessionId&&((Pe=H.adoptedSource)==null?void 0:Pe.variantId)===I.variantId})??null:null,[I,Re]),Pt=v.useMemo(()=>I?ze.find(H=>H.sessionId===I.sessionId&&H.variantId===I.variantId)??null:null,[I,ze]),tt=t.active?t.projectContext:null,Xe=(tt==null?void 0:tt.kind)==="fresh"?tt.workspacePath:n,At=!t.active&&ze.length>0&&ze.every(H=>H.projectKind==="fresh"),Qn=t.active?bG(tt):!!n&&!At,An=v.useMemo(()=>Xe?`?projectPath=${encodeURIComponent(Xe)}`:"",[Xe]),ws=v.useRef(null),Lr=v.useRef(null),Nr=typeof window>"u"?"/":QR(window.location.pathname)??"/",Jn=v.useRef(null),wn=v.useRef(!1),Bs=v.useCallback((H,le)=>{le.button!==0&&le.pointerType==="mouse"||(le.preventDefault(),x1(),Jn.current={kind:"live",variantId:H,startX:le.clientX,startY:le.clientY,committed:!1})},[]),Ws=v.useCallback((H,le)=>{le.button!==0&&le.pointerType==="mouse"||(le.preventDefault(),x1(),Jn.current={kind:"past",entry:H,startX:le.clientX,startY:le.clientY,committed:!1})},[]);v.useEffect(()=>{const H=me=>{const he=Jn.current;if(!he)return;const Ce=me.clientX-he.startX,We=me.clientY-he.startY;if(!he.committed){if(Ce*Ce+We*We<Sk*Sk)return;if(x1(),he.kind==="live"){const Ee=Re.find(pr=>pr.workItemId===he.variantId);if(!Ee||Ee.status!=="succeeded"){Jn.current=null;return}const tr=wk({sessionId:we,variant:Ee,projectContext:tt,routePath:Nr});S({sessionId:we??"",variantId:Ee.workItemId,label:Ee.label||"Direction",url:tr,source:"live",runLabel:Ee.runLabel,description:Ee.description})}else{const{entry:Ee}=he,tr=uc(Ee),pr=tr?yG({sessionId:Ee.sessionId,variantId:Ee.variantId,routePath:Nr}):`/api/variants/history/${encodeURIComponent(Ee.sessionId)}/${encodeURIComponent(Ee.variantId)}/preview${An}`;if(S({sessionId:Ee.sessionId,variantId:Ee.variantId,label:Ee.label||"Direction",url:pr,source:tr?"history-dev-server":"history-static",runLabel:Ee.runLabel,description:Ee.brief}),tr){const ns=Ck(`/api/variants/history/${encodeURIComponent(Ee.sessionId)}/${encodeURIComponent(Ee.variantId)}/run${An}`,"targetAddressed","1");(async()=>{try{if(!(await fetch(ns,{method:"POST"})).ok)return;const rs=Ck(pr,"replay",String(Date.now()));S(rn=>!rn||rn.sessionId!==Ee.sessionId||rn.variantId!==Ee.variantId||rn.source!=="history-dev-server"?rn:{...rn,url:rs}),R(rn=>{if(!rn)return rn;const Ys=ks=>!ks||ks.sessionId!==Ee.sessionId||ks.variantId!==Ee.variantId?ks:{...ks,url:rs};return{...rn,left:Ys(rn.left),right:Ys(rn.right)}})}catch(Cs){hn.warn("history replay drag boot failed",Cs)}})()}}he.committed=!0}T({x:me.clientX,y:me.clientY})},le=()=>{const me=Jn.current;me!=null&&me.committed&&(wn.current=!0),Jn.current=null,T(null)},Pe=me=>{if(me.key!=="Escape")return;const he=Jn.current;he!=null&&he.committed&&(he.kind==="past"&&uc(he.entry)&&uf({sessionId:he.entry.sessionId,variantId:he.entry.variantId,source:"history-dev-server"}),Jn.current=null,S(null),T(null))};return window.addEventListener("pointermove",H),window.addEventListener("pointerup",le),window.addEventListener("pointercancel",le),window.addEventListener("keydown",Pe),()=>{window.removeEventListener("pointermove",H),window.removeEventListener("pointerup",le),window.removeEventListener("pointercancel",le),window.removeEventListener("keydown",Pe)}},[Re,we,tt,Nr,An,S,T,R]);const In=v.useMemo(()=>{var le;if(se||j)return null;const H=O?Re.find(Pe=>Pe.workItemId===O):null;return O&&!H?null:H?nl(H)?H.workItemId:null:t.active?((le=Re.find(Pe=>{var me,he;return nl(Pe)&&(((me=Pe.preview)==null?void 0:me.kind)==="static_artifact"||((he=Pe.preview)==null?void 0:he.kind)==="dev_server")}))==null?void 0:le.workItemId)??null:null},[O,j,se,t,Re]),Si=v.useCallback(async H=>{var Pe,me,he,Ce;if(!we)return;const le=(H==null?void 0:H.workItemId)??null;W({kind:"switch",variantId:le??void 0});try{if(((Pe=H==null?void 0:H.preview)==null?void 0:Pe.kind)==="static_artifact"){if(_(!1),x(null),((me=H.refinement)==null?void 0:me.status)==="succeeded"){const Ee=H.preview.url.includes("?")?"&":"?";m(`${H.preview.url}${Ee}refinement=${encodeURIComponent(H.refinement.workItemId)}`)}else m(H.preview.url);p(Ee=>Ee+1);return}if(le&&we&&t.active&&t.projectContext.kind==="fresh"&&((he=t.projectContext.executionPlan)==null?void 0:he.mode)!=="vite_app"&&((Ce=H==null?void 0:H.preview)==null?void 0:Ce.kind)!=="dev_server"){_(!1),x(null),m(`/api/variants/${we}/static/${le}`),p(Ee=>Ee+1);return}const We=H&&le?wk({sessionId:we,variant:H,projectContext:t.active?t.projectContext:null,routePath:Nr}):null;if(We){_(!1),x(null),m(We),p(Ee=>Ee+1);return}be.capture("variants_panel.preview_display_failed",{sessionId:we,variantId:le,previewKind:H?w1(H):"none",hasPreview:!!(H!=null&&H.preview),hasPort:typeof(H==null?void 0:H.port)=="number",errorMessage:"No addressable dev-server preview URL"}),_(!1),x(null)}catch(We){hn.warn("preview display failed",We),be.capture("variants_panel.preview_display_failed",{sessionId:we,variantId:le,previewKind:H?w1(H):"none",hasPreview:!!(H!=null&&H.preview),hasPort:typeof(H==null?void 0:H.port)=="number",errorMessage:We instanceof Error?We.message:String(We)}),_(!1),x(null)}finally{W(null)}},[we,t,Nr,p,m,_,x]),Ei=v.useRef(!1),bs=v.useRef(null),Gs=v.useRef(0),fr=v.useCallback(()=>{if(Gs.current++,y(!1),w(!1),!Ei.current)return;const H=bs.current;Ei.current=!1,bs.current=null;const le=H?new URLSearchParams({sessionId:H.sessionId,variantId:H.variantId}):null,Pe=le?`/api/variants/history/replay/stop?${le.toString()}`:"/api/variants/history/replay/stop";fetch(Pe,{method:"POST"}).catch(me=>hn.warn("history replay stop failed",me))},[y,w]),er=v.useCallback(async H=>{if(we){W({kind:"switch",variantId:H.workItemId});try{const le=await fetch(`/api/variants/${we}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:H.workItemId})});if(!le.ok){const Pe=await $i(le);throw new Error(Pe.message??`Preview restoration failed (${le.status})`)}}catch(le){hn.warn("preview restoration failed",le),be.capture("variants_panel.preview_display_failed",{sessionId:we,variantId:H.workItemId,previewKind:"dev_server",hasPreview:!1,hasPort:!1,errorMessage:le instanceof Error?le.message:String(le)})}finally{W(null)}}},[we]),Ks=v.useCallback(H=>{var Ce,We,Ee,tr,pr;if(wn.current){wn.current=!1;return}const le=nl(H),Pe=H.status==="pending"||H.status==="running"||eA(H);if(!le&&!Pe)return;fr();const me=w1(H),he=Re.find(ns=>ns.workItemId===O);be.capture("variants_panel.preview_requested",{sessionId:we,fromVariantId:he==null?void 0:he.workItemId,toVariantId:H.workItemId,variantStatus:H.status,isPreviewReady:le,isArmed:Pe,previewKind:me,hasPreview:!!H.preview,hasPort:typeof H.port=="number",viewEnabled:((We=(Ce=H.actions)==null?void 0:Ce.view)==null?void 0:We.enabled)??null,previewUnavailableReason:((Ee=H.previewUnavailable)==null?void 0:Ee.reason)??null}),A(H.workItemId),N(null),le?(Lr.current=H.workItemId,Ve(!1),L(!0),Si(H)):(Lr.current=null,Ve(!1),m(null),_(!1),be.capture("variants_panel.preview_armed",{sessionId:we,fromVariantId:he==null?void 0:he.workItemId,toVariantId:H.workItemId,variantStatus:H.status,previewKind:me,hasPreview:!!H.preview,hasPort:typeof H.port=="number",viewEnabled:((pr=(tr=H.actions)==null?void 0:tr.view)==null?void 0:pr.enabled)??null}),JR(H)&&er(H)),be.capture("variants_panel.preview_switched",{sessionId:we,fromVariantId:he==null?void 0:he.workItemId,toVariantId:H.workItemId,armed:Pe})},[O,we,L,A,N,fr,er,Si,Re,m,_]),Ss=t.active?`${t.sessionId}:${t.stage}`:"inactive",Dr=v.useRef(!1);v.useEffect(()=>{if(r)return;let H=!1;return(async()=>{try{const le=await fetch(`/api/variants/history${An}`,{credentials:"same-origin"});if(!le.ok)return;const Pe=await le.json();if(H)return;const me=(Pe.variants??[]).filter(he=>{var Ce,We;return((Ce=he.preview)==null?void 0:Ce.kind)==="static"||((We=he.serve)==null?void 0:We.kind)==="static"||uc(he)});if(!Dr.current&&!De.current&&Ss==="inactive"&&me.length>0&&me.every(he=>he.projectKind==="fresh")){const he=[...me].sort((Ce,We)=>new Date(We.createdAt).getTime()-new Date(Ce.createdAt).getTime()).find(Ce=>!uc(Ce));he&&(Dr.current=!0,N({sessionId:he.sessionId,variantId:he.variantId,previewKind:"static"}),Ve(!1),m(`/api/variants/history/${encodeURIComponent(he.sessionId)}/${encodeURIComponent(he.variantId)}/preview${An}`))}if(CG(ae.current,me))return;ae.current=me,xe(me)}catch(le){hn.warn("Failed to load past variants",le)}})(),()=>{H=!0}},[r,Ss,An]);const Ci=v.useCallback(()=>{Ei.current=!1,bs.current=null,y(!1),w(!1),N(null),A(null),Ve(!0),_(!1),x(null),m(null),p(H=>H+1)},[A,y,w,p,m,x,N,_]),Ke=v.useCallback(H=>{if(wn.current){wn.current=!1;return}if(L(!0),N({sessionId:H.sessionId,variantId:H.variantId,previewKind:uc(H)?"dev_server":"static"}),A(null),Ve(!1),uc(H)){const le=++Gs.current;Ei.current=!0,bs.current={sessionId:H.sessionId,variantId:H.variantId},y(!0),w(!0),(async()=>{W({kind:"switch"}),be.capture("variants_panel.history_replay_started",{sessionId:H.sessionId,variantId:H.variantId});const Pe=me=>be.capture("variants_panel.history_replay_failed",{sessionId:H.sessionId,variantId:H.variantId,...me});try{const me=await fetch(`/api/variants/history/${encodeURIComponent(H.sessionId)}/${encodeURIComponent(H.variantId)}/run${An}`,{method:"POST"});if(le!==Gs.current)return;if(!me.ok){const{errorCode:he}=await $i(me);hn.warn(`history replay failed: HTTP ${me.status} ${he??""}`),Pe({httpStatus:me.status,errorCode:he}),Ci();return}w(!1),_(!0),x(null),m(null),p(he=>he+1),be.capture("variants_panel.history_replay_ready",{sessionId:H.sessionId,variantId:H.variantId})}catch(me){if(le!==Gs.current)return;hn.warn("history replay failed",me),Pe({errorMessage:me instanceof Error?me.message:String(me)}),Ci()}finally{W(null)}})();return}fr(),_(!1),x(null),m(`/api/variants/history/${encodeURIComponent(H.sessionId)}/${encodeURIComponent(H.variantId)}/preview${An}`)},[Ci,W,y,w,p,N,A,m,x,L,_,fr,An]),It=v.useCallback(async()=>{fr();const H=()=>{L(!0),A(null),N(null),Ve(!0),Lr.current=null,_(!1),x(null),m(null),p(le=>le+1)};if(!we){H();return}W({kind:"switch"});try{const le=await fetch(`/api/variants/${we}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})});if(!le.ok){hn.warn(`switch to original failed: HTTP ${le.status}`);return}H(),_(!0),be.capture("variants_panel.preview_switched",{sessionId:we,fromVariantId:O,toVariantId:null,target:"original",armed:!1})}catch(le){hn.warn("preview-port original switch failed",le)}finally{W(null)}},[O,we,A,N,p,m,x,L,_,fr]),tn=v.useCallback(async H=>{var Pe,me;const le=((me=(Pe=H.actions)==null?void 0:Pe.commit)==null?void 0:me.enabled)??H.status==="succeeded";if(!(!we||!le)){be.capture("variants_panel.commit_clicked",{sessionId:we,variantId:H.workItemId,variantLabel:H.label}),W({kind:"commit",variantId:H.workItemId});try{const he=await fetch(`/api/variants/${we}/commit`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:H.workItemId})});if(!he.ok){const{message:We,errorCode:Ee}=await $i(he);hn.warn(`commit failed: HTTP ${he.status} ${Ee??""} ${We??""}`),be.capture("variants_panel.commit_failed",{sessionId:we,variantId:H.workItemId,httpStatus:he.status,errorCode:Ee??null,errorMessage:We??null}),pt.error("Couldn't send direction",{description:We??`The server rejected the request (HTTP ${he.status}). Try again, or pick a different direction.`});return}const Ce=await he.json().catch(()=>null);be.capture("variants_panel.commit_succeeded",{sessionId:we,variantId:H.workItemId,payloadKind:(Ce==null?void 0:Ce.payloadKind)??null,duplicate:(Ce==null?void 0:Ce.duplicate)??!1}),pt.success(`Sent "${H.label}" to your project`,{description:(Ce==null?void 0:Ce.payloadKind)==="project-created"?`Project created at ${(Ce==null?void 0:Ce.destinationPath)??"destination"}.`:"Direction diff applied to your working tree (uncommitted)."}),(Ce==null?void 0:Ce.payloadKind)!=="project-created"&&(m(null),_(!1),p(We=>We+1))}catch(he){hn.warn("commit failed",he),be.capture("variants_panel.commit_failed",{sessionId:we,variantId:H.workItemId,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:he instanceof Error?he.message:String(he)}),pt.error("Couldn't send direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{W(null)}}},[we,p,m,_]),nn=v.useCallback(async(H,le,Pe)=>{be.capture("variants_panel.deploy_clicked",{sessionId:H,variantId:le,variantLabel:Pe});try{const me=await fetch(`/api/variants/${H}/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:le,...n?{projectPath:n}:{}})});if(!me.ok){const{message:We,errorCode:Ee}=await $i(me);return hn.warn(`deploy failed: HTTP ${me.status} ${Ee??""} ${We??""}`),be.capture("variants_panel.deploy_failed",{sessionId:H,variantId:le,httpStatus:me.status,errorCode:Ee??null,errorMessage:We??null}),pt.error("Couldn't deploy this direction",{description:We??`The server rejected the request (HTTP ${me.status}). Try again.`}),null}const he=await me.json().catch(()=>null),Ce=he==null?void 0:he.shareUrl;return Ce?(await navigator.clipboard.writeText(Ce).catch(()=>{}),be.capture("variants_panel.deploy_succeeded",{sessionId:H,variantId:le}),pt.success(`"${Pe}" is live — link copied`,{action:{label:"Open",onClick:()=>window.open(Ce,"_blank","noopener")}}),Ce):(pt.error("Couldn't deploy this direction",{description:"The deploy host returned an unexpected response."}),null)}catch(me){return hn.warn("deploy failed",me),be.capture("variants_panel.deploy_failed",{sessionId:H,variantId:le,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:me instanceof Error?me.message:String(me)}),pt.error("Couldn't deploy this direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."}),null}},[n]),Zs=v.useCallback(async H=>{if(!we)return;const le=$[H.workItemId];if(le){await navigator.clipboard.writeText(le).catch(()=>{}),pt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(le,"_blank","noopener")}});return}W({kind:"deploy",variantId:H.workItemId});try{const Pe=await nn(we,H.workItemId,H.label);Pe&&ne(me=>({...me,[H.workItemId]:Pe}))}finally{W(null)}},[we,$,nn]),qt=v.useCallback(async()=>{if(!(!we||Ye.length===0)){if(kt){await navigator.clipboard.writeText(kt).catch(()=>{}),pt.success("Canvas link copied",{action:{label:"Open",onClick:()=>window.open(kt,"_blank","noopener")}});return}be.capture("variants_panel.deploy_clicked",{sessionId:we,variantId:"canvas",variantLabel:"Canvas",variantCount:Ye.length}),W({kind:"deploy-canvas"});try{const H=await fetch(`/api/variants/${we}/canvas/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantIds:Ye.map(Ce=>Ce.workItemId),...n?{projectPath:n}:{}})});if(!H.ok){const{message:Ce,errorCode:We}=await $i(H);hn.warn(`canvas deploy failed: HTTP ${H.status} ${We??""} ${Ce??""}`),be.capture("variants_panel.deploy_failed",{sessionId:we,variantId:"canvas",httpStatus:H.status,errorCode:We??null,errorMessage:Ce??null,variantCount:Ye.length}),pt.error("Couldn't share this canvas",{description:Ce??`The server rejected the request (HTTP ${H.status}). Try again.`});return}const le=await H.json().catch(()=>null),Pe=le==null?void 0:le.shareUrl;if(!Pe){pt.error("Couldn't share this canvas",{description:"The deploy host returned an unexpected response."});return}const me=Object.fromEntries(((le==null?void 0:le.variants)??[]).filter(Ce=>typeof Ce.variantId=="string"&&typeof Ce.shareUrl=="string").map(Ce=>[Ce.variantId,Ce.shareUrl])),he=Object.keys(me).length>0?{...$,...me}:$;he!==$&&ne(he),await navigator.clipboard.writeText(Pe).catch(()=>{}),D({key:kk(Ye,he),shareUrl:Pe}),be.capture("variants_panel.deploy_succeeded",{sessionId:we,variantId:"canvas",variantCount:Ye.length}),pt.success("Canvas is live — link copied",{action:{label:"Open",onClick:()=>window.open(Pe,"_blank","noopener")}})}catch(H){hn.warn("canvas deploy failed",H),be.capture("variants_panel.deploy_failed",{sessionId:we,variantId:"canvas",httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:H instanceof Error?H.message:String(H),variantCount:Ye.length}),pt.error("Couldn't share this canvas",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{W(null)}}},[kt,Ye,$,n,we]),cn=v.useCallback(async H=>{const le=`${H.sessionId}:${H.variantId}`,Pe=Y[le];if(Pe){await navigator.clipboard.writeText(Pe).catch(()=>{}),pt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(Pe,"_blank","noopener")}});return}oe(le);try{const me=await nn(H.sessionId,H.variantId,H.label);me&&ee(he=>({...he,[le]:me}))}finally{oe(null)}},[Y,nn]),Es=v.useCallback(async H=>{if(we){be.capture("variants_panel.remove_clicked",{sessionId:we,variantId:H.workItemId,variantLabelLength:H.label.length}),W({kind:"remove",variantId:H.workItemId});try{const le=await fetch(`/api/variants/${we}/${H.workItemId}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!le.ok){const{message:Pe}=await $i(le);hn.warn(`remove failed: HTTP ${le.status} ${Pe??""}`),pt.error("Couldn't remove direction",{description:Pe??`The server rejected the request (HTTP ${le.status}). Try again.`});return}(H.workItemId===In||H.workItemId===O)&&(A(null),m(null),_(!1),p(Pe=>Pe+1))}catch(le){hn.warn("remove failed",le),pt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{W(null)}}},[we,O,In,A,m,_,p]),un=v.useCallback(async H=>{if(!Xe){pt.error("Couldn't remove direction",{description:"No project path available."});return}be.capture("variants_panel.remove_past_clicked",{sessionId:H.sessionId,variantId:H.variantId});const le=`${H.sessionId}:${H.variantId}`,Pe=me=>me.sessionId===H.sessionId&&me.variantId===H.variantId;W({kind:"remove",variantId:le}),xe(me=>me.filter(he=>!Pe(he))),j===le&&(N(null),m(null),_(!1),p(me=>me+1));try{const me=await fetch(`/api/variants/history/${encodeURIComponent(H.sessionId)}/${encodeURIComponent(H.variantId)}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectPath:Xe})});if(!me.ok){const{message:he}=await $i(me);xe(Ce=>Ce.some(Pe)?Ce:[...Ce,H]),pt.error("Couldn't remove direction",{description:he??`The server rejected the request (HTTP ${me.status}). Try again.`})}}catch(me){hn.warn("remove past failed",me),xe(he=>he.some(Pe)?he:[...he,H]),pt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{W(null)}},[Xe,j,N,m,_,p]),zn=v.useCallback(H=>{q(H)},[]),qs=v.useCallback(async()=>{if(G)try{G.kind==="active"?await Es(G.variant):await un(G.entry)}finally{q(null)}},[G,Es,un]),hr=wG(G),Sa=(X==null?void 0:X.kind)==="remove"&&X.variantId===hr,[Il,M0]=v.useState(null),[O0,pu]=v.useState(null),ki=v.useCallback(H=>{pu(H)},[]),Ff=v.useCallback(()=>{pu(null)},[]),Vf=v.useCallback(async H=>{const le=H.trim();if(le)try{await navigator.clipboard.writeText(le),pt.success("Copied")}catch{pt.error("Couldn't copy")}},[]),L0=v.useCallback(async(H,le)=>{pu(null);const Pe=le.trim();if(!Pe||H.kind==="original")return;if(H.kind==="active"){if(!we||Pe===H.variant.label)return;be.capture("variants_panel.rename",{sessionId:we,variantId:H.variant.workItemId,labelLength:Pe.length,past:!1});try{const Ce=await fetch(`/api/variants/${we}/${H.variant.workItemId}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Pe})});if(!Ce.ok){const{message:We}=await $i(Ce);pt.error("Couldn't rename direction",{description:We??`The server rejected the request (HTTP ${Ce.status}). Try again.`})}}catch(Ce){hn.warn("rename failed",Ce),pt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}return}const{entry:me}=H;if(Pe===me.label.trim())return;if(!Xe){pt.error("Couldn't rename direction",{description:"No project path available."});return}be.capture("variants_panel.rename",{sessionId:me.sessionId,variantId:me.variantId,labelLength:Pe.length,past:!0});const he=Ce=>Ce.sessionId===me.sessionId&&Ce.variantId===me.variantId;xe(Ce=>Ce.map(We=>he(We)?{...We,label:Pe}:We));try{const Ce=await fetch(`/api/variants/history/${encodeURIComponent(me.sessionId)}/${encodeURIComponent(me.variantId)}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Pe,projectPath:Xe})});if(!Ce.ok){const{message:We}=await $i(Ce);xe(Ee=>Ee.map(tr=>he(tr)?{...tr,label:me.label}:tr)),pt.error("Couldn't rename direction",{description:We??`The server rejected the request (HTTP ${Ce.status}). Try again.`})}}catch(Ce){hn.warn("rename failed",Ce),xe(We=>We.map(Ee=>he(Ee)?{...Ee,label:me.label}:Ee)),pt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}},[we,Xe]);v.useEffect(()=>{if(ws.current!==we){const le=ws.current===null;if(ws.current=we,Lr.current=null,D(null),m(null),_(!1),x(null),L(),A(null),N(null),Ve(!1),Dr.current=!1,!le)return}if(j||se||!In||t.active!==!0||Lr.current===In)return;const H=Re.find(le=>le.workItemId===In);H&&(Lr.current=In,L(),Si(H))},[we,j,se,In,t,Re,Si,L,A,N,m,x,_]),v.useEffect(()=>{!I||!it||(Lr.current=null,N(null),A(it.workItemId),Ve(!1))},[it,I,we,A,N]),v.useEffect(()=>{!I||it||Pt||N(null)},[it,I,Pt,we,N,ze]),v.useEffect(()=>{const H=F.trim().toLowerCase(),le=Re.filter(Ee=>nl(Ee)&&Rc(H,Ee.label,Ee.runLabel)),Pe=ze.filter(Ee=>Rc(H,Ee.label,Ee.runLabel,Ee.brief)),me=Qn&&Rc(H,Gx,Kx);if(le.length===0&&Pe.length===0&&!me)return;const he=[...le.map(Ee=>({source:"live",variant:Ee})),...Pe.map(Ee=>({source:"past",entry:Ee})),...me?[{source:"original"}]:[]],Ce=Ee=>Ee.source==="live"?`live:${Ee.variant.workItemId}`:Ee.source==="past"?`past:${Ee.entry.sessionId}:${Ee.entry.variantId}`:H_,We=Ee=>{if(pB())return;if(Ee.key==="Enter"){const Ys=Re.find(ks=>ks.workItemId===Il);Ys&&nl(Ys)&&(Ee.preventDefault(),Ks(Ys));return}if(Ee.key!=="ArrowUp"&&Ee.key!=="ArrowDown")return;Ee.preventDefault();let pr=In?`live:${In}`:null;j?pr=`past:${j}`:se&&(pr=H_);const ns=pr?he.findIndex(Ys=>Ce(Ys)===pr):-1;let Cs;if(ns===-1?Cs=Ee.key==="ArrowDown"?0:he.length-1:Ee.key==="ArrowDown"?Cs=Math.min(ns+1,he.length-1):Cs=Math.max(ns-1,0),Cs===ns)return;const rs=he[Cs];rs.source==="live"?Ks(rs.variant):rs.source==="past"?Ke(rs.entry):It();const rn=document.querySelector(`[data-variant-key="${Ce(rs)}"]`);rn instanceof HTMLElement&&rn.focus({preventScroll:!0})};return window.addEventListener("keydown",We),()=>window.removeEventListener("keydown",We)},[Re,ze,F,Qn,j,se,In,Il,Ks,Ke,It]);const Ml=Re.find(H=>H.workItemId===In)??null,Ol=j?ze.find(H=>`${H.sessionId}:${H.variantId}`===j)??null:null,mu=!!Ol,$f=t.active?t.artifacts??[]:[],yo=[...(t.active?Re.filter(H=>H.status!=="cancelled"):[]).map(H=>({kind:"active",variant:H})),...ze.map(H=>({kind:"past",entry:H})),...Qn?[{kind:"original"}]:[]],Vt=F.trim().toLowerCase(),gu=Vt?yo.filter(H=>AG(H,Vt)):yo,vu=new Set(Re.map(H=>H.requestId).filter(Boolean)),yu=e.filter(H=>!vu.has(H.requestId)),Pi=yu.length>0,_u=r&&!Pi&&yo.length===0;return E.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[yo.length>0?E.jsx("div",{className:"px-3 pt-2 pb-1",children:E.jsxs("div",{className:"relative",children:[E.jsx(Gz,{size:13,className:"text-content-muted pointer-events-none absolute top-1/2 left-2 -translate-y-1/2"}),E.jsx("input",{type:"text",value:F,onChange:H=>K(H.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,E.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-2",children:[Pi?E.jsx(BG,{groups:yu}):null,_u?E.jsx(WG,{}):null,t.active&&yo.length===0&&!Pi&&!_u?E.jsx(GG,{}):null,!t.active&&!Pi&&!_u&&ze.length===0&&!Qn?E.jsx(KG,{isMCPSession:f,mcpEditor:h}):null,yo.length>0&&gu.length===0?E.jsxs("p",{className:"text-content-muted px-1 py-6 text-center text-xs",children:["No directions match “",F.trim(),"”."]}):null,gu.length>0?E.jsx(LG,{rows:gu,activeVariantId:O??In,activePastKey:j,isOriginalSelected:se,busy:X,editingKey:O0,onSelectActive:Ks,onSelectPast:Ke,onSelectOriginal:It,onActivePointerDown:Bs,onPastPointerDown:Ws,onHover:M0,onRemove:H=>zn({kind:"active",variant:H}),onRemovePast:H=>zn({kind:"past",entry:H}),onStartRename:ki,onCommitRename:L0,onCancelRename:Ff,onCopyVariantContext:Vf,activeSessionId:t.active?t.sessionId:null,projectPath:Xe}):null,t.active&&u?E.jsx($G,{artifacts:$f}):null]}),mu&&Ol?E.jsx(jG,{entry:Ol,deploying:ie===j,deployedUrl:j?Y[j]??null:null,onDeploy:cn,isDeployDisabled:!i}):null,!mu&&t.active?E.jsx(UG,{selectedVariant:Ml,busy:X,onSend:tn,onDeploy:Zs,onDeployCanvas:qt,canDeploy:i&&(tt==null?void 0:tt.kind)==="fresh",canDeployCanvas:i&&a&&(tt==null?void 0:tt.kind)==="fresh",canSendToAgent:c,canvasVariantCount:Ye.length,canvasDeployedUrl:kt,deployedUrl:Ml?$[Ml.workItemId]??null:null}):null,E.jsx(TG,{target:G,isConfirming:Sa,onCancel:()=>q(null),onConfirm:qs})]})},PG=t=>t.kind==="active"?t.variant.label.trim()||"this direction":t.entry.label.trim()||"this direction",TG=({target:t,isConfirming:e,onCancel:n,onConfirm:r})=>{if(!t)return null;const s=PG(t);return E.jsx(wx,{open:!0,onOpenChange:i=>{!i&&!e&&n()},children:E.jsxs(bx,{children:[E.jsx(Sx,{className:"z-max fixed inset-0 bg-black/40"}),E.jsx(Ex,{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:E.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[E.jsx(Cx,{className:"text-content text-base font-medium",children:"Remove direction?"}),E.jsxs(kx,{className:"text-content-subtle text-sm leading-5",children:['This removes "',s,'" from the directions list.']}),E.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[E.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"}),E.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...":"Remove direction"})]})]})})]})})},RG=t=>t.kind==="active"?`live:${t.variant.workItemId}`:t.kind==="past"?`past:${t.entry.sessionId}:${t.entry.variantId}`:H_,AG=(t,e)=>t.kind==="active"?Rc(e,t.variant.label,t.variant.runLabel):t.kind==="past"?Rc(e,t.entry.label,t.entry.runLabel,t.entry.brief):Rc(e,Gx,Kx),IG=t=>t.length<=Ek?t:`${t.slice(0,Ek-1)}…`,MG=(t,e)=>t.kind==="active"?e?`${e}:${t.variant.workItemId}`:null:t.kind==="past"?`${t.entry.sessionId}:${t.entry.variantId}`:null,OG=t=>{var i,a;const e=[t.label.trim(),(i=t.description)==null?void 0:i.trim()].filter(c=>!!c).join(`
|
|
111
|
+
`);if(!t.reference)return e;const n=((a=t.projectPath)==null?void 0:a.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(`
|
|
112
|
+
`);return e?`${e}
|
|
113
|
+
|
|
114
|
+
${s}`:s},LG=({rows:t,activeVariantId:e,activePastKey:n,isOriginalSelected:r,busy:s,editingKey:i,onSelectActive:a,onSelectPast:c,onSelectOriginal:u,onActivePointerDown:f,onPastPointerDown:h,onHover:p,onRemove:m,onRemovePast:_,onStartRename:x,onCommitRename:y,onCancelRename:w,onCopyVariantContext:S,activeSessionId:T,projectPath:P})=>{const k=v.useRef(null),{activeIndex:R,itemRects:L,sessionRef:O,handlers:A,registerItem:I}=q5(k),N=(s==null?void 0:s.kind)==="switch",j=R!==null?L[R]:null;return E.jsxs("div",{ref:k,className:"relative",onMouseEnter:A.onMouseEnter,onMouseMove:A.onMouseMove,onMouseLeave:A.onMouseLeave,children:[E.jsx(oo,{children:j&&E.jsx(xl.div,{className:"bg-hover pointer-events-none absolute z-0 rounded-md",initial:{opacity:0,top:j.top,left:j.left,width:j.width,height:j.height},animate:{opacity:1,top:j.top,left:j.left,width:j.width,height:j.height},exit:{opacity:0,transition:{duration:.06}},transition:{...ef.fast,opacity:{duration:.08}}},O.current)}),E.jsx("ul",{className:"relative",children:t.map((F,K)=>{const X=RG(F);let W=!1;return F.kind==="active"?W=F.variant.workItemId===e:F.kind==="past"?W=`${F.entry.sessionId}:${F.entry.variantId}`===n:W=r,E.jsx(NG,{rowKey:X,row:F,index:K,isSelected:W,isEditing:i===X,isSwitchInFlight:N,busy:s,registerItem:I,onSelectActive:a,onSelectPast:c,onSelectOriginal:u,onActivePointerDown:f,onPastPointerDown:h,onHover:p,onRemove:m,onRemovePast:_,onStartRename:x,onCommitRename:y,onCancelRename:w,onCopyVariantContext:S,activeSessionId:T,projectPath:P},X)})})]})},NG=({rowKey:t,row:e,index:n,isSelected:r,isEditing:s,isSwitchInFlight:i,busy:a,registerItem:c,onSelectActive:u,onSelectPast:f,onSelectOriginal:h,onActivePointerDown:p,onPastPointerDown:m,onHover:_,onRemove:x,onRemovePast:y,onStartRename:w,onCommitRename:S,onCancelRename:T,onCopyVariantContext:P,activeSessionId:k,projectPath:R})=>{var xe,ae;const L=v.useRef(null);UU(c,n,L);const O=e.kind==="active",A=e.kind==="original",I=e.kind==="active"?e.variant:null,N=e.kind==="past"?e.entry:null,j=O?I.status==="succeeded":!0,F=O?nl(I):!0,K=O?eA(I):!1,X=O&&(I.status==="pending"||I.status==="running"),W=O?j&&(F||K)||X:!0,G=O&&I.status==="failed",q=O&&I.status==="cancelled",$=O&&(!W||i),ne=O&&(a==null?void 0:a.kind)==="remove"&&a.variantId===I.workItemId,z=O&&(((xe=I.refinement)==null?void 0:xe.status)==="pending"||((ae=I.refinement)==null?void 0:ae.status)==="running");let D=Gx;O?D=I.label||`Direction ${n+1}`:N&&(D=N.label.trim()||"Untitled direction");let Y;O?Y=I.runLabel:N&&(Y=N.runLabel);let ee=Kx;O?ee=I.description:N&&(ee=N.brief);const ie=ee?IG(ee):null,oe=MG(e,k),ce=oe?"Copy variant reference":"Copy description";return s?E.jsx("li",{ref:L,"data-proximity-index":n,className:"group relative z-10",children:E.jsx("div",{className:"bg-main-input flex w-full items-start gap-2 rounded-md px-3 py-2",children:E.jsxs("span",{className:"min-w-0 flex-1",children:[E.jsx(DG,{initial:D,onCommit:se=>S(e,se),onCancel:T}),ie&&E.jsx("span",{className:"text-content-muted mt-1 line-clamp-2 block text-xs leading-snug",children:ie})]})})}):E.jsxs("li",{ref:L,"data-proximity-index":n,className:"group relative z-10",children:[E.jsx("div",{role:"button",tabIndex:W?0:-1,"data-variant-id":O?I.workItemId:void 0,"data-variant-key":t,onClick:()=>{if($)return;const se=window.getSelection();se&&!se.isCollapsed||(e.kind==="active"?u(e.variant):e.kind==="past"?f(e.entry):h())},onKeyDown:se=>{$||(se.key==="Enter"||se.key===" ")&&(se.preventDefault(),se.stopPropagation(),e.kind==="active"?u(e.variant):e.kind==="past"?f(e.entry):h())},onPointerDown:se=>{$||(e.kind==="active"?j&&p(e.variant.workItemId,se):e.kind==="past"&&m(e.entry,se))},"aria-pressed":W?r:void 0,"aria-disabled":O?!W:void 0,"aria-busy":X||z,onMouseEnter:O?()=>_(I.workItemId):void 0,onMouseLeave:O?()=>_(null):void 0,className:dr("focus-visible:ring-content-muted/40 flex w-full items-start gap-2 rounded-md px-3 py-2 text-left transition-colors focus:outline-none focus-visible:ring-1",r&&"bg-main-input ring-content-muted/40 ring-1 ring-inset",j&&F&&"cursor-grab active:cursor-grabbing",(X||K)&&"cursor-pointer",!j&&!X&&!K&&"cursor-not-allowed opacity-60",$&&"cursor-not-allowed opacity-50"),style:j?{touchAction:"none"}:void 0,children:E.jsxs("span",{className:"min-w-0 flex-1",children:[E.jsxs("span",{className:"flex items-center gap-2",children:[(X||z)&&E.jsx(Ix,{className:"text-content-muted shrink-0 text-sm","data-testid":z&&!X?"variant-refining":void 0}),E.jsx(so,{label:"Double-click to rename",disabled:A,children:E.jsx("span",{onDoubleClick:se=>{se.stopPropagation(),A||w(t)},className:dr("min-w-0 flex-1 truncate text-sm font-medium select-text",A?"cursor-default":"cursor-text",j||r?"text-content":"text-content-muted"),children:D})}),G&&E.jsx(so,{label:I.errorMessage??I.errorCode??"Failed",disabled:!I.errorMessage&&!I.errorCode,children:E.jsx("span",{className:"shrink-0",children:E.jsx(Pk,{label:"Failed"})})}),q&&E.jsx(Pk,{label:"Cancelled"}),Y&&E.jsx("span",{className:"ml-auto max-w-[8rem] shrink-0 truncate rounded px-1.5 py-0.5 text-[10px] font-medium opacity-100 transition-opacity duration-150 group-hover:opacity-0 group-has-[:focus-visible]:opacity-0",style:Z5(Y),children:Y})]}),ie&&E.jsx("span",{className:"text-content-muted mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug select-text",children:ie})]})}),E.jsxs("div",{className:dr("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"),children:[ee||oe?E.jsx(so,{label:ce,children:E.jsx("button",{type:"button","aria-label":ce,onClick:se=>{se.stopPropagation(),P(OG({label:D,description:ee,reference:oe,projectPath:R}))},onPointerDown:se=>se.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:E.jsx(Jd,{size:13,weight:"bold"})})}):null,!A&&E.jsx(so,{label:"Rename",children:E.jsx("button",{type:"button","aria-label":"Rename direction",onClick:se=>{se.stopPropagation(),w(t)},onPointerDown:se=>se.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:E.jsx(Kz,{size:13,weight:"bold"})})}),!A&&E.jsx(so,{label:"Remove",children:E.jsx("button",{type:"button","data-variant-remove-id":e.kind==="active"?e.variant.workItemId:void 0,"aria-label":"Remove direction",disabled:ne,onClick:se=>{se.stopPropagation(),e.kind==="active"?x(e.variant):y(e.entry)},onPointerDown:se=>se.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 ml-1 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50",children:E.jsx(Yz,{size:13,weight:"bold"})})})]})]})},DG=({initial:t,onCommit:e,onCancel:n})=>{const[r,s]=v.useState(t),i=v.useRef(!1),a=v.useCallback(u=>{u&&(u.focus(),u.select())},[]),c=u=>{i.current||(i.current=!0,u?e(r):n())};return E.jsx("input",{ref:a,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(),c(!0)):u.key==="Escape"&&(u.preventDefault(),c(!1))},onBlur:()=>c(!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"})},Pk=({label:t})=>E.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}),jG=({entry:t,deploying:e,deployedUrl:n,onDeploy:r,isDeployDisabled:s=!1})=>{const a=e?"Deploying…":n?"Copy link":"Share";return E.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 pt-2 pb-4",children:[E.jsxs("div",{className:"min-w-0",children:[E.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),n?E.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}),E.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?E.jsx(Jd,{size:12,weight:"bold"}):null,a]})]})},FG={agent_browser:"Browser extracted",cache:"Cached",static:"Bundled catalog",manual:"Manual"},VG={design_context:"DESIGN.md",source_context:"Source",qa_report:"QA",asset:"Asset"},$G=({artifacts:t})=>{const[e,n]=v.useState(null),r=v.useMemo(()=>e&&t.some(i=>i.id===e)?e:null,[t,e]);if(t.length===0)return null;const s=i=>{n(a=>a===i?null:i)};return E.jsxs("section",{"aria-label":"Directions session artifacts",className:"mt-4",children:[E.jsx("div",{className:"flex shrink-0 items-center px-3 py-2",children:E.jsx("span",{className:"text-content truncate text-sm font-medium",children:"Artifacts"})}),E.jsx("ul",{className:"mt-2 space-y-1 px-1",children:t.map(i=>E.jsx(HG,{artifact:i,isExpanded:i.id===r,onToggle:()=>s(i.id)},i.id))})]})},HG=({artifact:t,isExpanded:e,onToggle:n})=>{const r=VG[t.kind],s=t.source?FG[t.source]:null,i=[t.kind==="design_context"?null:s,t.summary].filter(Boolean).join(" · "),a=t.kind==="design_context"&&!!t.viewUrl,c=`${e?"Hide":"View"} ${r} artifact${t.label?`: ${t.label}`:""}`;return a?E.jsx("li",{className:"border-main-border rounded-md border",children:E.jsxs("div",{className:"flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs",children:[E.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[E.jsxs("span",{className:"flex items-center gap-2",children:[E.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}),E.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?E.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),E.jsx("a",{href:t.viewUrl,target:"_blank",rel:"noreferrer",onClick:()=>{be.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:E.jsx(zz,{className:"h-3.5 w-3.5",weight:"bold"})})]})}):E.jsxs("li",{className:"border-main-border rounded-md border",children:[E.jsxs("button",{type:"button",onClick:n,"aria-expanded":e,"aria-label":c,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:[E.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[E.jsxs("span",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"text-content-muted text-[10px] font-semibold tracking-wide uppercase",children:r}),E.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?E.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),E.jsx("span",{className:"text-content-muted shrink-0 text-[11px]",children:e?"Hide":"View"})]}),e?E.jsx("div",{className:"border-main-border bg-main-light border-t px-3 py-2",children:E.jsx(zG,{artifact:t})}):null]})},zG=({artifact:t})=>E.jsxs("div",{className:"text-content-muted space-y-1 text-[11px]",children:[t.summary?E.jsx("p",{children:t.summary}):null,t.path?E.jsxs("p",{children:["Stored at ",t.path]}):null,!t.summary&&!t.path?E.jsx("p",{children:"No inline content available for this artifact."}):null]}),UG=({selectedVariant:t,busy:e,onSend:n,onDeploy:r,onDeployCanvas:s,canDeploy:i,canDeployCanvas:a,canSendToAgent:c,canvasVariantCount:u,canvasDeployedUrl:f,deployedUrl:h})=>{var O,A,I,N;const p=t?((A=(O=t.actions)==null?void 0:O.commit)==null?void 0:A.enabled)??t.status==="succeeded":!1,m=p&&e===null,_=(e==null?void 0:e.kind)==="commit"&&e.variantId===(t==null?void 0:t.workItemId),x=(e==null?void 0:e.kind)==="deploy"&&e.variantId===(t==null?void 0:t.workItemId),y=(e==null?void 0:e.kind)==="deploy-canvas",w=!i||!p||e!==null,S=a&&u>0,P=x?"Deploying…":h?"Copy link":"Share",R=y?"Sharing…":f?"Copy canvas link":"Share canvas",L=_?"Applying…":"Apply to project";return E.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 pt-2 pb-4",children:[E.jsx("div",{className:"min-w-0",children:t?E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),h?E.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}):null}),E.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[E.jsx(FR,{primaryLabel:P,primaryIcon:h&&!x?Jd:void 0,primaryAction:()=>{t&&r(t)},isDisabled:w,isDropdownDisabled:e!==null,isLoading:x,loadingLabel:"Deploying…",dropdownAriaLabel:"More share actions",dropdownItems:S?[{label:R,icon:f&&!y?Jd:void 0,onClick:s,isDisabled:e!==null}]:[]}),c?E.jsx("button",{type:"button",onClick:()=>{t&&n(t)},disabled:!m,title:(N=(I=t==null?void 0:t.actions)==null?void 0:I.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:L}):null]})]})},tA=()=>E.jsx("div",{"data-testid":"direction-skeleton-row","aria-hidden":"true",className:"flex w-full items-start rounded-md px-3 py-2",children:E.jsxs("span",{className:"min-w-0 flex-1",children:[E.jsxs("span",{className:"flex items-center gap-2",children:[E.jsx(Ix,{className:"text-content-muted shrink-0 text-sm"}),E.jsx("span",{className:"bg-muted-foreground/15 h-3.5 w-28 animate-pulse rounded"})]}),E.jsx("span",{className:"mt-1.5 flex",children:E.jsx("span",{className:"bg-muted-foreground/10 h-2.5 w-full max-w-[14rem] animate-pulse rounded"})})]})}),BG=({groups:t})=>E.jsx("div",{className:"space-y-0.5",children:t.flatMap(e=>Array.from({length:Math.max(1,e.count)}).map((n,r)=>E.jsx(tA,{},`${e.requestId}-${r}`)))}),WG=()=>E.jsx("div",{"data-testid":"direction-boot-skeletons",className:"space-y-0.5",children:Array.from({length:3}).map((t,e)=>E.jsx(tA,{},e))}),GG=()=>E.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[E.jsx("div",{className:"text-content text-sm",children:"No directions yet"}),E.jsx("div",{className:"text-content-muted text-xs",children:"They’ll appear here as they generate."})]}),Tk="Try different ways to create a dropdown that feels fluid and dynamic",KG=({isMCPSession:t=!1,mcpEditor:e=null})=>{const[n,r]=v.useState(!1),s=mB(e),i=t?s:"your coding agent",a=()=>{navigator.clipboard.writeText(Tk).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})};return E.jsxs("div",{className:"flex flex-col items-start gap-3 px-2 py-2",children:[E.jsx("p",{className:"text-content text-sm font-medium",children:"Create your first direction"}),E.jsxs("p",{className:"text-content-muted text-xs",children:["Use ",i," to generate directions."]}),E.jsxs("div",{className:"w-full",children:[E.jsx("p",{className:"text-content-muted mb-2 text-xs",children:"Here's a sample prompt to use:"}),E.jsxs("div",{className:"border-main-border bg-main-input relative rounded-md border px-3 py-2.5 pr-8",children:[E.jsxs("p",{className:"text-content-muted text-xs leading-snug",children:["“",Tk,"”"]}),E.jsx("button",{type:"button",onClick:a,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?E.jsx(x5,{className:"h-3.5 w-3.5 text-emerald-500",weight:"bold"}):E.jsx(Jd,{className:"h-3.5 w-3.5",weight:"bold"})})]})]})]})},ZG=({onClose:t})=>{const e=et(nR);return t?E.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?E.jsx("span",{className:"text-content min-w-0 truncate text-sm font-medium",title:e,children:e}):E.jsx("span",{}),E.jsx(so,{label:"Close panel",side:"bottom",children:E.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:E.jsx(Zz,{className:"h-4 w-4",weight:"bold"})})})]}):null},qG='[data-menu-item]:not([disabled]):not([aria-disabled="true"])',YG=({itemSelector:t=qG,loop:e=!1}={})=>{const n=v.useRef(null),r=v.useRef(null),s=v.useCallback(a=>{var c;n.current=a,a?r.current=hB():((c=r.current)==null||c.call(r),r.current=null)},[]),i=v.useCallback(a=>{var x;const{key:c}=a;if(c!=="ArrowDown"&&c!=="ArrowUp"&&c!=="Home"&&c!=="End")return;const u=n.current;if(!u)return;const f=Array.from(u.querySelectorAll(t));if(f.length===0)return;a.preventDefault(),a.stopPropagation();const h=f.indexOf(document.activeElement),p=f.length-1,m=y=>{if(h===-1)return y===1?0:p;const w=h+y;return e?(w+f.length)%f.length:Math.min(Math.max(w,0),p)};let _;c==="Home"?_=0:c==="End"?_=p:c==="ArrowDown"?_=m(1):_=m(-1),(x=f[_])==null||x.focus()},[t,e]);return{containerRef:s,onKeyDown:i}},Rk="/assets/arena-Db0j1set.png",XG=xs("useIntegrations"),b1=["integrations"],QG="rivet:connect-result",JG=t=>typeof t=="object"&&t!==null&&t.type===QG,eK=nt(null),Ak=async()=>{const t=await fetch("/api/integrations");if(!t.ok)throw new Error(`Failed to load integrations (${t.status})`);return(await t.json()).integrations??[]},tK=()=>{const t=Z8(),[e,n]=HP(eK),r=ry({queryKey:b1,queryFn:Ak,staleTime:1e4}),s=v.useCallback(async()=>(await t.invalidateQueries({queryKey:b1,refetchType:"none"}),t.fetchQuery({queryKey:b1,queryFn:Ak})),[t]),i=v.useCallback(async c=>{const u=window.open("","_blank","width=560,height=720");if(!u)throw new Error("Popup blocked. Allow popups to connect.");n(c);try{const f=await fetch(`/api/integrations/${c}/connect`,{method:"POST"}),h=await f.json().catch(()=>({}));if(!f.ok||!h.authUrl)throw u.close(),new Error(h.error||`Could not connect ${c}`);return u.location.href=h.authUrl,await new Promise(p=>{let m=!1,_=null;const x=async(w,S=!1)=>{if(!m){m=!0,window.removeEventListener("message",y),_&&clearInterval(_);try{const P=(await s()).some(k=>k.provider===c&&k.status==="connected");p(S&&P?"connected":w)}catch{p(w)}}},y=w=>{if(JG(w.data)&&w.data.provider===c){if(w.data.status==="error"){XG.warn(`Connect failed for ${c}:`,w.data.message),x("failed");return}x("connected")}};window.addEventListener("message",y),_=setInterval(()=>{u.closed&&x("closed",!0)},500)})}finally{n(null)}},[s,n]),a=v.useCallback(async c=>{n(c);try{const u=await fetch(`/api/integrations/${c}`,{method:"DELETE"});if(!u.ok){const f=await u.json().catch(()=>({}));throw new Error(f.error||`Could not disconnect ${c}`)}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:a,refetch:s}},Ac=({onClick:t,title:e,shortcut:n,children:r,disabled:s=!1,className:i="",type:a="button","data-cy":c})=>{const u=E.jsx("button",{onClick:t,disabled:s,className:i,type:a,"data-cy":c,children:r});return e?E.jsx(Wx,{content:E.jsxs("div",{className:"flex flex-row items-center gap-2",children:[E.jsx("span",{children:e}),n?E.jsx("span",{className:"rounded bg-white/15 px-1.5 py-0.5 text-[11px]",children:n}):null]}),children:u}):u},Wa=({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}:{}}}),Ik=xs("ConnectorsModal"),nK=()=>E.jsx("svg",{viewBox:"0 0 24 24",className:"h-6 w-6","aria-hidden":"true",children:E.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"})}),rK=()=>E.jsx("span",{"aria-hidden":"true",className:"h-6 w-6 bg-[#b1b1b1]",style:{WebkitMaskImage:`url(${Rk})`,maskImage:`url(${Rk})`,WebkitMaskSize:"contain",maskSize:"contain",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center"}}),sK=[{provider:"pinterest",name:"Pinterest",description:"Pull boards and pins in as visual references.",tileClassName:"bg-[#e60023] text-white",icon:E.jsx(nK,{})},{provider:"arena",name:"Are.na",description:"Connect channels of collected blocks and links.",tileClassName:"bg-[#18181b] text-content",icon:E.jsx(rK,{})}],iK=({meta:t,integration:e,isPending:n,isHighlighted:r,onConnect:s,onDisconnect:i})=>{const a=(e==null?void 0:e.status)==="connected",c=e!=null&&e.externalUsername?`@${e.externalUsername}`:null;return E.jsxs("article",{className:`bg-main-light flex flex-col rounded-xl p-[18px] ${r?"ring-secondary ring-2":""}`,children:[E.jsx("span",{className:`grid h-[52px] w-[52px] flex-none place-items-center rounded-xl ${t.tileClassName}`,"aria-hidden":"true",children:t.icon}),E.jsxs("div",{className:"mt-4 flex-1",children:[E.jsxs("h2",{className:"text-content flex items-center gap-1.5 text-[15px] font-semibold",children:[t.name,a?E.jsx(x5,{className:"h-3.5 w-3.5",weight:"bold","aria-hidden":"true"}):null]}),E.jsx("p",{className:"text-content-subtle mt-1 text-[13px] leading-relaxed",children:t.description}),a&&c?E.jsx("p",{className:"text-content-muted mt-2.5 text-xs font-medium",children:c}):null]}),a?E.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"}):E.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"})]})},z_=({isOpen:t,onClose:e,context:n="menu",highlightProvider:r=null})=>{const{integrations:s,isLoading:i,error:a,pendingProvider:c,connect:u,disconnect:f}=tK(),h=s0(),[p,m]=v.useState(null),_=S=>s.find(T=>T.provider===S),x=v.useCallback(S=>{const T=Date.now(),P=Wa({action:"connect",outcome:"started",provider:S,entryPoint:n});h==null||h.capture(P.event,P.properties),u(S).then(k=>{const R=Date.now()-T;if(k==="connected"){const O=Wa({action:"connect",outcome:"completed",provider:S,entryPoint:n,durationMs:R});h==null||h.capture(O.event,O.properties);return}const L=Wa({action:"connect",outcome:"failed",provider:S,entryPoint:n,durationMs:R,failureReason:k==="closed"?"popup_closed":"provider_failed"});h==null||h.capture(L.event,L.properties)}).catch(k=>{const R=k instanceof Error?k.message:"Could not connect.",L=Wa({action:"connect",outcome:"failed",provider:S,entryPoint:n,durationMs:Date.now()-T,failureReason:R.includes("Popup blocked")?"popup_blocked":"request_failed"});h==null||h.capture(L.event,L.properties),Ik.warn(`Connect error for ${S}:`,R),pt.error(R)})},[u,n,h]),y=v.useCallback(S=>{const T=Date.now(),P=Wa({action:"disconnect",outcome:"started",provider:S,entryPoint:n});h==null||h.capture(P.event,P.properties),f(S).then(()=>{const k=Wa({action:"disconnect",outcome:"completed",provider:S,entryPoint:n,durationMs:Date.now()-T});h==null||h.capture(k.event,k.properties)}).catch(k=>{const R=k instanceof Error?k.message:"Could not disconnect.",L=Wa({action:"disconnect",outcome:"failed",provider:S,entryPoint:n,durationMs:Date.now()-T,failureReason:"request_failed"});h==null||h.capture(L.event,L.properties),Ik.warn(`Disconnect error for ${S}:`,R),pt.error(R)})},[n,f,h]),w=n==="onboarding";return E.jsx(wx,{open:t,onOpenChange:S=>!S&&e(),children:E.jsxs(bx,{children:[E.jsx(Sx,{className:"z-max fixed inset-0 bg-black/40"}),E.jsx(Ex,{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:E.jsxs(YR,{value:p,children:[E.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[E.jsx(Cx,{className:"text-content text-base font-medium",children:"Connect design references"}),E.jsx(Ac,{onClick:e,title:"Close",className:"text-content-subtle hover:bg-main-hover hover:text-content rounded p-1 transition-colors",children:E.jsx(M5,{className:"h-4 w-4",weight:"bold"})})]}),E.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[E.jsx(kx,{className:"text-content-subtle text-sm",children:"Connect your design references to use them with Rivet’s MCP."}),a?E.jsx("p",{className:"rounded-lg bg-red-500/10 px-4 py-3 text-[13px] font-medium text-red-300",children:a}):null,E.jsx("div",{className:"grid grid-cols-2 gap-4",children:sK.map(S=>E.jsx(iK,{meta:S,integration:_(S.provider),isPending:i||c===S.provider,isHighlighted:r===S.provider,onConnect:()=>x(S.provider),onDisconnect:()=>y(S.provider)},S.provider))}),w?E.jsxs("div",{className:"flex items-center justify-between gap-4",children:[E.jsx("p",{className:"text-content-subtle text-xs",children:"You can always do this later from the account menu."}),E.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]})]})})]})})},Mk=({className:t=""})=>E.jsx("span",{"aria-hidden":"true",className:`rivet-skeleton block rounded ${t}`.trim()}),oK=xs("SupportTicketModal"),Ok=5e3,S1="feedback",aK=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},lK=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=aK(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}`},cK=({isOpen:t,onClose:e,contactEmail:n})=>{const r=s0(),[s,i]=v.useState(""),[a,c]=v.useState(!1),[u,f]=v.useState(null),h=v.useCallback(()=>{i("")},[]),p=v.useCallback(()=>{a||(h(),e())},[a,e,h]),m=v.useCallback(async()=>{const w=s.trim();if(!(!w||a)){c(!0);try{const S=typeof(r==null?void 0:r.get_session_id)=="function"?r.get_session_id():void 0,T=typeof(r==null?void 0:r.get_distinct_id)=="function"?r.get_distinct_id():void 0,P=n==null?void 0:n.trim(),k=await fetch("/api/support/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:S1,message:w,contactEmail:P||void 0,metadata:{posthogSessionId:S??void 0,posthogDistinctId:T??void 0,appVersion:"0.14.14",appEnvironment:"production",pageUrl:window.location.href,userAgent:navigator.userAgent,submittedAt:new Date().toISOString()}})});if(!k.ok){const R=await lK(k);throw new Error(R)}r==null||r.capture("support_ticket_submitted",{ticket_type:S1,has_posthog_session_id:!!S}),pt.success("Feedback sent",{description:"Thanks for sharing this."}),h(),e()}catch(S){const T=S instanceof Error?S.message:"Failed to send message";r==null||r.capture("support_ticket_submit_failed",{ticket_type:S1,error:T}),oK.error("Failed to submit support ticket:",T),pt.error("Could not send feedback",{description:T})}finally{c(!1)}}},[n,a,s,e,r,h]),_=v.useCallback(w=>{w.key==="Enter"&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),m())},[m]),x=Ok-s.length,y=a||s.trim().length===0;return E.jsx(wx,{open:t,onOpenChange:w=>!w&&p(),children:E.jsxs(bx,{children:[E.jsx(Sx,{className:"fixed inset-0 z-max bg-black/40"}),E.jsx(Ex,{ref:f,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:E.jsxs(YR,{value:u,children:[E.jsxs("div",{className:"flex items-center justify-between rounded-t-lg border-b border-main-border bg-main-light px-4 py-2",children:[E.jsx(Cx,{className:"text-base font-medium text-content",children:"Send feedback"}),E.jsx(Ac,{onClick:p,disabled:a,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:E.jsx(M5,{className:"h-4 w-4",weight:"bold"})})]}),E.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[E.jsx(kx,{className:"text-sm text-content-subtle",children:"Tell us what happened or what we can improve."}),E.jsxs("div",{className:"rounded-lg bg-main-input outline outline-1 outline-transparent transition-[outline-color] focus-within:outline-white/20",children:[E.jsx("textarea",{id:"support-ticket-message","aria-label":"Your feedback",value:s,onChange:w=>i(w.target.value),onKeyDown:_,maxLength:Ok,rows:6,disabled:a,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"}),E.jsxs("div",{className:"flex items-center justify-between px-3 pb-3 pt-1",children:[E.jsx("span",{className:"text-xs text-content-subtle",children:"Context details are included automatically."}),E.jsxs("div",{className:"flex items-center gap-2",children:[x<=500&&E.jsx("span",{className:"text-xs text-content-subtle",children:x}),E.jsx(Ac,{onClick:m,disabled:y,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:a?E.jsx(p0,{className:"h-5 w-5 animate-spin",weight:"bold"}):E.jsx(Uz,{className:"h-5 w-5",weight:"bold"})})]})]})]})]})]})})]})})},uK=xs("ProfileAvatar"),nA=(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):""},dK=(t,e)=>nA(t,e).charAt(0).toUpperCase(),fK=({className:t="",side:e="bottom",align:n="end"})=>{const{name:r,email:s}=et(sR),i=et(cR),[a,c]=v.useState(!1),[u,f]=v.useState(!1),[h,p]=v.useState(!1),[m,_]=v.useState(!1),{containerRef:x,onKeyDown:y}=YG(),w=et(Mf),S=dK(r,s);if(!S)return w?E.jsxs("span",{"data-testid":"profile-avatar-skeleton","aria-hidden":"true",className:`flex shrink-0 items-center gap-2 ${t}`.trim(),children:[E.jsx(Mk,{className:"h-7 w-7 rounded-full"}),E.jsx(Mk,{className:"h-3 w-16"})]}):null;const T=nA(r,s),P=(r==null?void 0:r.trim())||null,k=(s==null?void 0:s.trim())||null,R=async()=>{_(!0);try{const L=await fetch("/api/auth/logout",{method:"POST",credentials:"same-origin"});if(!L.ok)throw new Error(`Logout failed: ${L.status}`)}catch(L){uK.warn("Logout request failed",L),pt.error("Could not log out. Please try again."),_(!1);return}window.location.reload()};return E.jsxs(E.Fragment,{children:[E.jsxs(LR,{open:a,onOpenChange:c,children:[E.jsx(NR,{asChild:!0,children:E.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:[E.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:S}),T?E.jsx("span",{className:"max-w-[8rem] truncate text-xs font-medium",children:T}):null]})}),E.jsx(DR,{children:E.jsxs(jR,{ref:x,onKeyDown:y,role:"menu",className:"bg-surface-2 z-[60] min-w-[180px] rounded-lg p-1 shadow-lg",side:e,sideOffset:6,align:n,children:[P||k?E.jsxs("div",{className:"border-main-border border-b px-3 py-2",children:[P?E.jsx("div",{className:"text-content truncate text-xs font-medium",children:P}):null,k?E.jsx("div",{className:"text-content-muted truncate text-[11px]",children:k}):null]}):null,E.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{c(!1),f(!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:[E.jsx(R5,{className:"h-3.5 w-3.5",weight:"bold"}),"Connect design references"]}),E.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{c(!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:[E.jsx(Wz,{className:"h-3.5 w-3.5",weight:"bold"}),"Share feedback"]}),E.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:R,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:[E.jsx(qz,{className:"h-3.5 w-3.5",weight:"bold"}),m?"Logging out…":"Log out"]})]})})]}),E.jsx(z_,{isOpen:u,onClose:()=>f(!1)}),E.jsx(cK,{isOpen:h,onClose:()=>p(!1),contactEmail:s??void 0})]})},hK=({onClose:t})=>E.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:[E.jsx(ZG,{onClose:t}),E.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:E.jsx(kG,{})}),E.jsx("div",{className:"border-main-border bg-main-light flex flex-shrink-0 items-center border-t px-2.5 py-1.5",children:E.jsx(fK,{side:"top",align:"start"})})]});async function pK(t,e){const{delaysMs:n,shouldRetry:r,onRetry:s}=e;for(let i=1;;i++)try{return await t(i)}catch(a){const c=n[i-1];if(c===void 0||r&&!r(a))throw a;s==null||s(a,i,c),await new Promise(u=>setTimeout(u,c))}}const Lk=xs("useServerConfig"),rA=[250,500,1e3,2e3,4e3],Nk=rA.length+1,mK=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}},gK=()=>{const[t,e]=v.useState(null),[n,r]=v.useState(!0),[s,i]=v.useState(null),a=v.useCallback(async()=>{try{r(!0),i(null);const c=await pK(mK,{delaysMs:rA,onRetry:(u,f,h)=>{Lk.warn(`Server config fetch failed (attempt ${f}); retrying in ${h}ms`,u)}});return e(c),c}catch(c){const u=c instanceof Error?c.message:"Failed to fetch server config";throw i(u),Lk.warn("Error fetching server config:",c),c}finally{r(!1)}},[]);return{config:t,fetchConfig:a,isLoading:n,error:s}},vK="#1C1C20",Hi=[118,118,124],Dk=.85,yK=3,_K=.15,vp=36,xK=4.4,wK=.7,bK=3.5,SK=.8,jk=9,EK=11,CK=[1.35,1.12,.95,.85],kK=[0,1.1,2.3,3.1],PK=[0,.35,.16,.13],TK=[.9,.5,.4,.35],Ga=3,E1=[[{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}]],yp=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},Up=t=>{const e=Math.min(1,Math.max(0,t));return e*e*(3-2*e)},Ka=(t,e)=>(Math.round(t/e-.5)+.5)*e,RK=Math.sin(Math.PI/3),Fk=(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*RK;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()},AK=(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)-jk}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)-jk}return Up(.5-r/(2*EK))},sA=({className:t="",trackGlobalLoaderCount:e=!0})=>{const n=ot(rR),r=v.useRef(null),s=v.useCallback(i=>{var N;if((N=r.current)==null||N.call(r),r.current=null,!i)return;const a=i.getContext("2d");if(!a)return;e&&n(j=>j+1);const c=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let u=[],f=0,h=0,p=vp,m=vp,_=null,x=null,y=0,w=-1;const S=new Array(33),T=j=>{const F=Math.round(j*32);let K=S[F];if(!K){const X=F/32,W=Math.round(Hi[0]+(255-Hi[0])*X),G=Math.round(Hi[1]+(255-Hi[1])*X),q=Math.round(Hi[2]+(255-Hi[2])*X);K=`rgba(${W}, ${G}, ${q}, ${Dk})`,S[F]=K}return K},P=j=>{const F=1-.35*j,K=Math.round(Hi[0]*F),X=Math.round(Hi[1]*F),W=Math.round(Hi[2]*F);return`rgba(${K}, ${X}, ${W}, ${Dk})`},k=j=>{let F=Math.floor(Math.random()*E1.length);F===w&&(F=(F+1)%E1.length),w=F;const K=[0,0,0,0],X=E1[F].map((D,Y)=>{const ee=D.level,ie=K[ee]++,oe=kK[ee]+ie*PK[ee],ce=TK[ee]+yp(F*131+Y*17+5)*.2;if(D.hline){const se=Ka((D.y??0)*h,m);return{hline:!0,x1:Ka(D.x1*f,p),x2:Ka(D.x2*f,p),y1:se,y2:se,level:ee,start:oe,dur:ce}}const xe=Ka(D.x1*f,p),ae=Ka((D.y1??0)*h,m);return{hline:!1,x1:xe,y1:ae,x2:Math.max(Ka(D.x2*f,p),xe+p),y2:Math.max(Ka((D.y2??0)*h,m),ae+m),level:ee,start:oe,dur:ce}}),W=X.reduce((D,Y)=>Math.max(D,Y.start+Y.dur),0),G=u.length,q=new Float32Array(G*Ga),$=new Int16Array(G*Ga).fill(-1),ne=new Uint8Array(G),z=X[0];for(let D=0;D<G;D++){const Y=u[D];Y.x>z.x1&&Y.x<z.x2&&Y.y>z.y1&&Y.y<z.y2&&(ne[D]=1);const ee=D*Ga;for(let ie=0;ie<X.length;ie++){const oe=AK(Y.x,Y.y,X[ie]);if(oe<=.02)continue;let ce=ee;for(let xe=ee;xe<ee+Ga;xe++){if($[xe]===-1){ce=xe;break}q[xe]<q[ce]&&(ce=xe)}($[ce]===-1||oe>q[ce])&&(q[ce]=oe,$[ce]=ie)}}return{startT:j,buildEnd:W,els:X,frame:z,cellQ:q,cellEl:$,inFrame:ne}},R=()=>{const j=i.getBoundingClientRect();f=Math.max(1,j.width),h=Math.max(1,j.height);const F=Math.min(2,window.devicePixelRatio||1);i.width=Math.round(f*F),i.height=Math.round(h*F),a.setTransform(F,0,0,F,0,0);const K=Math.max(8,Math.round(f/vp)),X=Math.max(6,Math.round(h/vp));p=f/K,m=h/X,u=[];for(let W=0;W<X;W++){const G=X>1?W/(X-1):.5,q=xK*(1+wK*.4*(G*2-1));for(let $=0;$<K;$++){const ne=W*8191+$*131+1,z={x:($+.5)*p,y:(W+.5)*m,size:q,seed:ne,phase:yp(ne),kind:0};z.kind=Math.floor(yp(ne*97)*3),u.push(z)}}x=null,_=null},L=new Float32Array(32),O=j=>{a.fillStyle=vK,a.fillRect(0,0,f,h),_||(_=k(j+.2)),j>=_.startT+_.buildEnd+bK&&(x=_,y=j,_=k(j+.2));let F=0;x&&(F=1-Up((j-y)/SK),F<=0&&(x=null));const K=_;for(let z=0;z<K.els.length;z++){const D=K.els[z];L[z]=Up(Math.min(1,Math.max(0,(j-K.startT-D.start)/D.dur)))}const X=L[0],W=P(0),G=P(X),q=F>0?P(F):W,$=F>0?P(Math.max(X,F)):G,ne=u.length;for(let z=0;z<ne;z++){const D=u[z];let Y=0,ee=0;const ie=z*Ga;for(let De=ie;De<ie+Ga;De++){const Re=K.cellEl[De];if(Re<0)break;const Ye=K.cellQ[De]*L[Re];Ye>Y&&(Y=Ye,ee=K.els[Re].level)}if(x)for(let De=ie;De<ie+Ga;De++){const Re=x.cellEl[De];if(Re<0)break;const Ye=x.cellQ[De]*F;Ye>Y&&(Y=Ye,ee=x.els[Re].level)}const oe=j/yK+D.phase,ce=Math.floor(oe),xe=oe-ce,ae=Up(Math.min(xe,1-xe)/_K),se=Math.floor(yp(D.seed*97+ce*7919)*3);se!==D.kind&&Y<.02&&ae<.05&&(D.kind=se);const Ve=Math.max(ae*(1-Y),Y);if(!(Ve<.01))if(Y<.02){const De=K.inFrame[z]===1,Re=x?x.inFrame[z]===1:!1;De?a.fillStyle=Re?$:G:a.fillStyle=Re?q:W;const Ye=Math.max(De?X:0,Re?F:0);Fk(a,D.kind,D.x,D.y,D.size*Ve*(1-.2*Ye))}else{a.fillStyle=T(Y);const De=1+(CK[ee]-1)*Y;Fk(a,D.kind,D.x,D.y,D.size*Ve*De)}}};R();let A=0;if(c)_=k(-100),O(0);else{const j=performance.now(),F=K=>{O((K-j)/1e3),A=requestAnimationFrame(F)};A=requestAnimationFrame(F)}const I=new ResizeObserver(()=>{R(),c&&(_=k(-100),O(0))});I.observe(i),r.current=()=>{cancelAnimationFrame(A),I.disconnect(),e&&n(j=>j-1)}},[e,n]);return E.jsx("canvas",{ref:s,"aria-hidden":"true",className:`h-full w-full ${t}`.trim()})},IK=async(t=null)=>{if(t)return MK(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 _p();if(!e.ok)return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null};let r;try{r=await e.json()}catch{return _p()}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}:_p()},iA=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}}},MK=t=>iA(t),_p=()=>iA("/"),C1=xs("usePreviewUpstreamHealth"),OK=500,LK=4e3,NK=15e3,DK=3,jK=(t,e={})=>{const n=v.useRef(null),r=v.useRef(null),s=e.probeMsWhileDown??OK,i=e.probeMsWhileUp??LK,a=e.firstUnreachableCaptureAfterMs??NK,c=e.rerunProbeImmediatelyOnVersion,u=e.probePath??null,f=e.skip??!1,h=v.useRef(e.onPersistentUpstreamServerErrors);h.current=e.onPersistentUpstreamServerErrors;const[p,m]=v.useState(t==="static"),[_,x]=v.useState(0),[y,w]=v.useState(null),[S,T]=v.useState(0),[P,k]=v.useState(!1),[R,L]=v.useState(!1),[O,A]=v.useState(t==="static"?null:"upstream_unreachable");return v.useEffect(()=>{if(t==="static"){m(!0),w(null),T(0),k(!1),L(!0),A(null);return}if(f){m(!1),w(null),T(0),k(!1),L(!0),A("upstream_unreachable"),n.current=null;return}let I=!0;const N=Date.now();w(N),T(0),k(!1),m(!1),L(!1),A("upstream_unreachable");const j={current:!1},F={current:!1},K={current:!1},X={current:null},W={current:!1},G={current:!1},q={current:0},$={current:!1},ne={current:null};let z=null;const D=()=>{K.current||(K.current=!0,I&&L(!0))},Y=()=>{z!==null&&(clearTimeout(z),z=null)},ee=(oe,ce)=>{Y(),z=setTimeout(ce,oe)},ie=async()=>{var Ye;if(!I)return;T(ut=>ut+1);const{isOk:oe,unavailableReason:ce,upstreamStatus:xe}=await IK(u);if(!I)return;D(),ne.current=xe;const ae=oe&&xe!==null&&xe>=500;ae&&G.current?q.current+=1:oe&&!ae&&(q.current=0);const se=q.current>=DK;if(se&&!$.current&&xe!==null&&($.current=!0,be==null||be.capture("preview_upstream_error_responses",{framework:t,upstream_status:xe,consecutive_count:q.current}),C1.warn(`Preview upstream is listening but has served ${q.current} consecutive ${xe} responses`),(Ye=h.current)==null||Ye.call(h,{upstreamStatus:xe,consecutiveCount:q.current})),oe&&!se){ae||(G.current=!0,$.current=!1);const ut=!W.current;W.current=!0,m(!0),A(null),X.current=null,F.current=!1,k(!1),j.current?ut&&(be==null||be.capture("preview_upstream_restored",{framework:t})):(j.current=!0,be==null||be.capture("preview_dev_server_ready",{framework:t,ready_after_ms:Date.now()-N})),ee(i,ie);return}const De=W.current;W.current=!1,m(!1),A(ce),X.current===null&&(X.current=Date.now(),F.current=!1,k(!1)),De&&(be==null||be.capture("preview_upstream_lost",{framework:t,upstream_status:xe}),x(ut=>ut+1),C1.warn("Preview upstream became unavailable after it was ready"));const Re=Date.now()-X.current;Re>=a&&!F.current&&(F.current=!0,k(!0),be==null||be.capture("preview_dev_server_unreachable",{framework:t,elapsed_ms:Re,upstream_status:ne.current}),C1.warn("Dev server did not become ready within timeout window")),ee(s,ie)};return n.current=()=>ee(0,ie),ee(0,ie),()=>{I=!1,n.current=null,Y()}},[t,s,i,a,u,f]),v.useEffect(()=>{var N;if(t==="static"||c===void 0)return;const I=r.current;r.current=c,I!==null&&I!==c&&((N=n.current)==null||N.call(n))},[t,c]),{isUpstreamReady:p,iframeRemountKey:_,probeStartedAt:y,probeAttemptCount:S,isFirstUnreachableWindowExceeded:P,initialProbeComplete:R,unavailableReason:O}};function FK(t){return t.enteringSplit&&t.isExistingSession&&t.hasActiveVariantProxy}const oA=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}`},aA=({agentApplyMode:t,url:e})=>e.startsWith("/")?`${oA(t)}${e}`:e,VK="allow-scripts allow-same-origin allow-forms allow-popups allow-modals",$K=t=>VK,HK=xs("PreviewSurface"),Vk=(t,e)=>t==="about:blank"?"blank":t.includes("/api/variants/")?"static_artifact":e.kind==="variant"?"dev_server":"original",lA=({target:t,src:e,framework:n,remountKey:r})=>(et(m0),E.jsx("div",{className:"relative h-full w-full",children:E.jsx("iframe",{src:e,className:"h-full w-full border-none",title:"Project Preview",sandbox:$K(),onLoad:()=>{be==null||be.capture("preview_iframe_loaded",{framework:n,src:e}),t.kind==="variant"&&(be==null||be.capture("variants_panel.preview_displayed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:Vk(e,t),framework:n}))},onError:()=>{be==null||be.capture("preview_iframe_load_failed",{framework:n,src:e}),t.kind==="variant"&&(be==null||be.capture("variants_panel.preview_display_failed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:Vk(e,t),framework:n})),HK.warn("Preview iframe failed to load",{framework:n,src:e})}},r)})),zK="modulepreload",UK=function(t){return"/"+t},$k={},BK=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let a=function(f){return Promise.all(f.map(h=>Promise.resolve(h).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),u=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));s=a(n.map(f=>{if(f=UK(f),f in $k)return;$k[f]=!0;const h=f.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${p}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":zK,h||(m.as="script"),m.crossOrigin="",m.href=f,u&&m.setAttribute("nonce",u),document.head.appendChild(m),h)return new Promise((_,x)=>{m.addEventListener("load",_),m.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${f}`)))})}))}function i(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return s.then(a=>{for(const c of a||[])c.status==="rejected"&&i(c.reason);return e().catch(i)})},WK=v.lazy(()=>BK(()=>Promise.resolve().then(()=>Sq),void 0)),GK={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"},KK={sm:"text-lg font-semibold text-content",md:"text-2xl font-semibold text-content",lg:"text-3xl font-semibold text-content"},ZK={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"},Nd=({backdrop:t,media:e,title:n,description:r,actions:s,tone:i="neutral",fill:a="surface",size:c="md",children:u,state:f,role:h="status",busy:p=!1,className:m=""})=>{const _=v.useCallback(y=>{y&&f&&(be==null||be.capture("status_surface_shown",{state:f,tone:i,fill:a}))},[f,i,a]),x=!!(e||n||r||u||s!=null&&s.length);return E.jsxs("div",{ref:_,className:`${GK[a]} ${m}`.trim(),role:h,"aria-live":"polite","aria-busy":p||void 0,"data-state":f,children:[t?E.jsx("div",{className:"absolute inset-0",children:t}):null,x?E.jsxs("div",{className:"relative z-10 flex max-w-sm flex-col items-center gap-5 text-center",children:[e,n?E.jsx("h2",{className:KK[c],children:n}):null,r?E.jsx("p",{className:"text-content-muted text-base leading-relaxed",children:r}):null,u,s!=null&&s.length?E.jsx("div",{className:"flex flex-row items-center gap-3",children:s.map(y=>E.jsx("button",{type:"button",onClick:y.onClick,className:ZK[y.variant??"neutral"],children:y.label},y.label))}):null]}):null]})},U_=({loader:t="coalesce",trackGlobalLoaderCount:e,size:n="lg",...r})=>t==="coalesce"?E.jsx(Nd,{...r,size:n,busy:!0,backdrop:E.jsx(sA,{trackGlobalLoaderCount:e})}):t==="logo"?E.jsx(Nd,{...r,size:n,busy:!0,backdrop:E.jsx(v.Suspense,{fallback:null,children:E.jsx(WK,{className:"absolute inset-0"})})}):E.jsx(Nd,{...r,size:n,busy:!0,media:E.jsx(p0,{"aria-hidden":!0,className:"text-content h-8 w-8 shrink-0 animate-spin",weight:"bold"})}),cA=({icon:t,...e})=>E.jsx(Nd,{...e,tone:"neutral",media:t?E.jsx("div",{className:"text-content-muted",children:t}):void 0}),Bm=t=>E.jsx(Nd,{...t,tone:"error",role:"alert"}),Hk="/static/",qK=t=>{try{return new URL(t,"http://localhost").pathname.endsWith(Hk)}catch{return t.endsWith(Hk)}},YK=({isInteractionDisabled:t=!1,framework:e,userPort:n})=>{var we;const r=et(I_),s=ot(I_),i=et(Fm),a=ot(Fm),c=et(If),u=et(m0),f=et(M_),h=et(O_),p=et(iR),m=et(oR),_=ot(O_),x=et(fo),y=et(N_),w=ot(M_),S=c.active&&c.projectContext.kind==="fresh",T=et(L_),P=c.active?c.variants.find(je=>je.workItemId===T&&(je.status==="pending"||je.status==="running"||je.status==="succeeded"&&!je.preview&&typeof je.port!="number"&&(!je.previewUnavailable||je.previewUnavailable.reason==="idle_timeout")))??null:null,k=c.active&&c.variants.some(je=>je.status==="pending"||je.status==="running"),R=S||k,L=c.active?c.variants.find(je=>{var ze;return je.workItemId===T&&je.status==="succeeded"&&!!je.previewUnavailable&&((ze=je.previewUnavailable)==null?void 0:ze.reason)!=="idle_timeout"})??null:null,O=e==="static"&&i!==null&&qK(i);v.useEffect(()=>{c.active||w(!1)},[c.active,w]);const A=v.useRef(!1);v.useEffect(()=>{const je=!!(x!=null&&x.left||x!=null&&x.right),ze=je&&!A.current;A.current=je;const it=c.active?c.sessionId:null;!it||!FK({enteringSplit:ze,isExistingSession:c.active&&c.projectContext.kind==="existing",hasActiveVariantProxy:f&&h!==null})||(w(!1),_(null),s(Pt=>Pt+1),fetch(`/api/variants/${encodeURIComponent(it)}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(()=>{}))},[x,c,f,h,w,_,s]);const N=v.useMemo(()=>{var Xe;if(f||i&&!O||!c.active)return null;const{stage:je,variants:ze}=c,it=je==="ready"||je==="degraded",Pt=ze.some(At=>{var Qn,An;return((Qn=At.refinement)==null?void 0:Qn.status)==="pending"||((An=At.refinement)==null?void 0:An.status)==="running"});if(!it&&!Pt)return null;const tt=ze.find(At=>{var Qn;return At.status==="succeeded"&&((Qn=At.preview)==null?void 0:Qn.kind)==="static_artifact"});return((Xe=tt==null?void 0:tt.preview)==null?void 0:Xe.kind)==="static_artifact"?tt.preview.url:null},[O,i,f,c])??i,j=v.useMemo(()=>!c.active||!N?null:c.variants.find(je=>{var ze;return((ze=je.preview)==null?void 0:ze.kind)==="static_artifact"&&N.startsWith(je.preview.url)})??null,[N,c]),F=v.useMemo(()=>{if((y==null?void 0:y.previewKind)==="static")return{kind:"variant",sessionId:y.sessionId,variantId:y.variantId};if(!c.active)return jm;if(j)return{kind:"variant",sessionId:c.sessionId,variantId:j.workItemId};if(N){const ze=N.match(/\/__rivet\/preview\/variant\/([^/]+)\/([^/?#]+)/),it=ze!=null&&ze[1]?decodeURIComponent(ze[1]):null,Pt=ze!=null&&ze[2]?decodeURIComponent(ze[2]):null;if(it===c.sessionId&&Pt&&c.variants.some(At=>At.workItemId===Pt))return{kind:"variant",sessionId:c.sessionId,variantId:Pt};const tt=N.match(/\/api\/variants\/[^/]+\/static\/([^/?#]+)/),Xe=tt!=null&&tt[1]?decodeURIComponent(tt[1]):null;if(Xe&&c.variants.some(At=>At.workItemId===Xe))return{kind:"variant",sessionId:c.sessionId,variantId:Xe}}const je=!!(x!=null&&x.left||x!=null&&x.right);return(!je||S)&&!N&&f&&h&&c.variants.some(ze=>ze.workItemId===h)?{kind:"variant",sessionId:c.sessionId,variantId:h}:(!je||S)&&!N&&T&&c.variants.some(ze=>ze.workItemId===T)?{kind:"variant",sessionId:c.sessionId,variantId:T}:jm},[y,j,c,f,h,N,x,S,T]),K=v.useRef(null);v.useEffect(()=>{var Pt,tt;if(!j||((Pt=j.preview)==null?void 0:Pt.kind)!=="static_artifact"||((tt=j.refinement)==null?void 0:tt.status)!=="succeeded")return;const je=`${j.workItemId}:${j.refinement.workItemId}`;if(K.current===je)return;K.current=je;const ze=j.preview.url.includes("?")?"&":"?",it=`${j.preview.url}${ze}refinement=${encodeURIComponent(j.refinement.workItemId)}`;N!==it&&(a(it),s(Xe=>Xe+1))},[N,j,s,a,c]);const X=N!==null&&_G(N),W=N!==null&&!X||S&&!f&&!X,{isUpstreamReady:G,iframeRemountKey:q,probeAttemptCount:$,initialProbeComplete:ne}=jK(e,{rerunProbeImmediatelyOnVersion:r,probePath:X?N:null,skip:W}),[z,D]=v.useState(()=>p&&G?r:null),Y=v.useRef(null);v.useEffect(()=>{if(!p){Y.current=null,D(null);return}if(z===r){Y.current=null;return}const je=Y.current;if(!je||je.remountKey!==r){Y.current={remountKey:r,probeAttemptCount:$};return}G&&$>je.probeAttemptCount&&(Y.current=null,D(r))},[z,r,p,$,G]);const ie=N!==null&&!X||G,ce=m||p&&z!==r||p&&!ie,xe=`${q}:${r}`,ae=QR(window.location.pathname),se=e==="static"?`/static${ae??"/"}`:ae??"/",Ve=oA(u);let De=null;N&&(De=aA({agentApplyMode:u,url:N}));const Ye=P||ce?"about:blank":(X&&!ie?"about:blank":De)??(ie?`${Ve}${se}`:"about:blank"),ut=!!P||!!L||!ie&≠let kt=null;return ce?kt=E.jsx(U_,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"preview_replay_boot"}):P?kt=E.jsx(U_,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"variant_building",children:E.jsx("span",{className:"sr-only",children:"Building your direction"})}):L?kt=E.jsx(Bm,{fill:"overlay",state:"preview_unavailable",title:"Preview couldn’t start",description:((we=L.previewUnavailable)==null?void 0:we.reason)==="missing_dev_script"?"This project has no dev script for Rivet to run.":"Its preview server didn’t start.",actions:[{label:"Reload",onClick:()=>window.location.reload()}]}):ut&&(kt=R?E.jsx(cA,{fill:"overlay",state:"preview_no_selection",title:"Nothing to preview yet",description:"Pick a direction from the panel."}):E.jsx(Bm,{fill:"overlay",state:"preview_offline",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>window.location.reload()}]})),E.jsxs("div",{className:"relative h-full w-full",children:[kt,E.jsx(lA,{target:F,src:Ye,framework:e,remountKey:xe})]})};function zk({side:t,sessionId:e,variantId:n,url:r,label:s,source:i,isFallback:a=!1}){var P;const c=et(fo),u=ot(fo),f=s0(),h=et(If),p=et(m0),m=v.useRef(!1),_=v.useCallback(()=>{m.current||(m.current=!0,uf({source:i,sessionId:e,variantId:n}))},[i,e,n]),x=v.useCallback(()=>{if(a){u(null);const O=Um("ended",c);f==null||f.capture(O.event,O.properties);return}_();const k={...c};delete k[t];const R=k.left||k.right?k:null;u(R);const L=Um(R?"updated":"ended",R??c);f==null||f.capture(L.event,L.properties)},[a,f,u,t,c,_]),y=v.useMemo(()=>({kind:"variant",sessionId:e,variantId:n}),[e,n]),w=v.useMemo(()=>!h.active||h.sessionId!==e?null:h.variants.find(k=>k.workItemId===n)??null,[e,n,h]),S=v.useMemo(()=>{var R,L;let k=r;if(((R=w==null?void 0:w.preview)==null?void 0:R.kind)==="static_artifact"&&((L=w.refinement)==null?void 0:L.status)==="succeeded"){const O=w.preview.url.includes("?")?"&":"?";k=`${w.preview.url}${O}refinement=${encodeURIComponent(w.refinement.workItemId)}`}return aA({agentApplyMode:p,url:k})},[p,w,r]),T=((P=w==null?void 0:w.refinement)==null?void 0:P.status)==="succeeded"?`${n}:${w.refinement.workItemId}`:n;return E.jsxs("div",{className:"variant-split-secondary","data-cy":"variant-split-pane","data-variant-id":n,children:[E.jsxs("div",{className:"variant-split-secondary-toolbar",children:[E.jsx("span",{className:"variant-split-secondary-label",title:s,children:s}),E.jsx(so,{label:"Collapse",children:E.jsx("button",{type:"button",className:"variant-split-secondary-close",onClick:x,"aria-label":"Collapse split view",children:E.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",focusable:"false",children:E.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"})})})})]}),E.jsx("div",{className:"variant-split-secondary-body relative min-h-0 flex-1",children:E.jsx(lA,{target:y,src:S,framework:"static",remountKey:T})})]})}const Uk=240;function XK(){const t=et(sf),e=et(Ax),n=v.useRef(null);return v.useEffect(()=>{if(!t||!e||!n.current)return;const r=e.x-Uk/2,s=e.y-22;n.current.style.transform=`translate3d(${r}px, ${s}px, 0)`},[t,e]),!t||!e?null:E.jsx("div",{ref:n,"aria-hidden":"true",className:"variant-drag-ghost",style:{width:Uk},children:E.jsxs("div",{className:"variant-drag-ghost-body",children:[E.jsxs("div",{className:"variant-drag-ghost-row",children:[E.jsx("div",{className:"variant-drag-ghost-title",children:t.label}),t.runLabel?E.jsx("div",{className:"variant-drag-ghost-tag",style:Z5(t.runLabel),children:t.runLabel}):null]}),t.description?E.jsx("div",{className:"variant-drag-ghost-desc",children:t.description}):null]})})}function QK(){const t=et(sf),e=et(Ax),n=et(fo),r=ot(sf),s=ot(fo),i=s0(),a=v.useRef(null),[c,u]=v.useState(null),[f,h]=v.useState("hidden");v.useEffect(()=>{if(!t){h("hidden"),u(null);return}const _=requestAnimationFrame(()=>h("visible"));return()=>cancelAnimationFrame(_)},[t]);const p=v.useCallback((_,x)=>{const y=a.current;if(!y)return null;const w=y.getBoundingClientRect();return _<w.left||_>w.right||x<w.top||x>w.bottom?null:_<(w.left+w.right)/2?"left":"right"},[]);if(v.useEffect(()=>{if(!t||!e)return;const _=p(e.x,e.y);u(x=>x===_?x:_)},[t,e,p]),v.useEffect(()=>{if(!t)return;const _=x=>{const y=p(x.clientX,x.clientY);if(y&&t.url){const w={sessionId:t.sessionId,variantId:t.variantId,label:t.label,url:t.url,source:t.source},S=n==null?void 0:n[y];S&&(S.sessionId!==w.sessionId||S.variantId!==w.variantId)&&uf(S);const T={...n??{},[y]:w};s(T);const P=Um(n?"updated":"started",T);i==null||i.capture(P.event,P.properties),h("exiting"),window.setTimeout(()=>r(null),220)}else uf(t),h("exiting"),window.setTimeout(()=>r(null),220)};return window.addEventListener("pointerup",_),window.addEventListener("pointercancel",_),()=>{window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",_)}},[t,p,i,r,s,n]),!t)return null;const m=["variant-drop-zones",f==="visible"&&"is-visible",f==="exiting"&&"is-exiting"].filter(Boolean).join(" ");return E.jsxs("div",{ref:a,className:m,"aria-hidden":"true",children:[E.jsx(Bk,{side:"left",hovered:c==="left",canDrop:!!t.url,label:t.label}),E.jsx(Bk,{side:"right",hovered:c==="right",canDrop:!!t.url,label:t.label})]})}function Bk({side:t,hovered:e,canDrop:n,label:r}){return E.jsxs("div",{className:["variant-drop-zone",`is-${t}`,e&&"is-hover",!n&&"is-disabled"].filter(Boolean).join(" "),children:[E.jsxs("div",{className:"variant-drop-zone-inner",children:[E.jsx("div",{className:`variant-drop-zone-icon is-${t}`}),E.jsx("div",{className:"variant-drop-zone-caption",children:n?`Add ${t} split`:"Split unavailable for this direction"})]}),E.jsx("div",{className:"variant-drop-zone-preview","aria-hidden":"true",children:E.jsx("div",{className:"variant-drop-zone-preview-label",children:r})}),E.jsx("div",{className:"variant-drop-zone-border"})]})}const uA=(t,e,n)=>{var i,a;if(!t.active||t.sessionId!==e)return null;const r=t.variants.find(c=>c.workItemId===n);if(((i=r==null?void 0:r.preview)==null?void 0:i.kind)!=="static_artifact")return null;if(((a=r.refinement)==null?void 0:a.status)!=="succeeded")return r.preview.url;const s=r.preview.url.includes("?")?"&":"?";return`${r.preview.url}${s}refinement=${encodeURIComponent(r.refinement.workItemId)}`},Wk=(t,e)=>{if(!t)return;const n=uA(e,t.sessionId,t.variantId);return!n||n===t.url?t:{...t,url:n}},JK=()=>E.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:E.jsx("div",{className:"border-main-border relative min-h-0 flex-1 overflow-hidden rounded-lg border",children:E.jsx(sA,{trackGlobalLoaderCount:!1})})}),eZ=({isLoading:t=!1,isInteractionDisabled:e=!1})=>{const{config:n,fetchConfig:r,isLoading:s,error:i}=gK();return v.useEffect(()=>{r().catch(a=>{be==null||be.capture("preview_config_load_failed",{message:a instanceof Error?a.message:"unknown_error",attempts:Nk})})},[r]),s?E.jsx(JK,{}):i||!n?E.jsx(Bm,{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:()=>{be==null||be.capture("preview_config_retry_clicked"),r().catch(a=>{be==null||be.capture("preview_config_load_failed",{message:a instanceof Error?a.message:"unknown_error",attempts:Nk})})}}]}):E.jsx(tZ,{isLoading:t,isInteractionDisabled:e,framework:n.framework,userPort:n.userPort})};function tZ(t){const e=et(fo),n=et(sf),r=et(If),s=et(Fm),i=e==null?void 0:e.left,a=e==null?void 0:e.right,c=v.useMemo(()=>{var R,L;if(!r.active||r.projectContext.kind!=="fresh"||!(!!i!=!!a))return;const y=(R=i??a)==null?void 0:R.variantId,w=r.variants.filter(O=>{var A;return O.status==="succeeded"&&((A=O.preview)==null?void 0:A.kind)==="static_artifact"&&O.workItemId!==y}),S=s==null?void 0:s.replace(/[?&]refinement=[^&]*$/,""),P=w.find(O=>{var A;return((A=O.preview)==null?void 0:A.kind)==="static_artifact"&&O.preview.url===S})??w[0];if(((L=P==null?void 0:P.preview)==null?void 0:L.kind)!=="static_artifact")return;const k=uA(r,r.sessionId,P.workItemId);if(k)return{sessionId:r.sessionId,variantId:P.workItemId,label:P.label,url:k,source:"live"}},[r,i,a,s]),u=Wk(i,r)??(a?c:void 0),f=Wk(a,r)??(i?c:void 0),h=!i&&!!u,p=!a&&!!f,m=!!(u||f),_=E.jsx(YK,{isInteractionDisabled:t.isInteractionDisabled,framework:t.framework,userPort:t.userPort});return E.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-1 flex-col",children:E.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:[E.jsxs("div",{className:"variant-preview-row flex h-full min-h-0 w-full flex-1",children:[u&&E.jsx(zk,{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&&f)&&E.jsx("div",{className:"variant-preview-primary flex h-full min-h-0 flex-1 flex-col",children:_}),f&&E.jsx(zk,{side:"right",sessionId:f.sessionId,variantId:f.variantId,url:f.url,label:f.label,source:f.source,isFallback:p},`right-${f.sessionId}:${f.variantId}:${f.url}`)]}),E.jsx("div",{className:"variant-preview-atmosphere","aria-hidden":"true"}),E.jsx(QK,{}),E.jsx(XK,{})]})})}function qi(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function dA(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
|
|
115
|
+
* GSAP 3.15.0
|
|
116
|
+
* https://gsap.com
|
|
117
|
+
*
|
|
118
|
+
* @license Copyright 2008-2026, GreenSock. All rights reserved.
|
|
119
|
+
* Subject to the terms at https://gsap.com/standard-license
|
|
120
|
+
* @author: Jack Doyle, jack@greensock.com
|
|
121
|
+
*/var Qr={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},df={duration:.5,overwrite:!1,delay:0},Zx,$n,Ut,gs=1e8,St=1/gs,B_=Math.PI*2,nZ=B_/4,rZ=0,fA=Math.sqrt,sZ=Math.cos,iZ=Math.sin,Rn=function(e){return typeof e=="string"},en=function(e){return typeof e=="function"},po=function(e){return typeof e=="number"},qx=function(e){return typeof e>"u"},xi=function(e){return typeof e=="object"},Rr=function(e){return e!==!1},Yx=function(){return typeof window<"u"},xp=function(e){return en(e)||Rn(e)},hA=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Xn=Array.isArray,oZ=/random\([^)]+\)/g,aZ=/,\s*/g,Gk=/(?:-?\.?\d|\.)+/gi,pA=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Sc=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,k1=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,mA=/[+-]=-?[.\d]+/,lZ=/[^,'"\[\]\s]+/gi,cZ=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Kt,oi,W_,Xx,es={},Wm={},gA,vA=function(e){return(Wm=nu(e,es))&&Or},Qx=function(e,n){return console.warn("Invalid property",e,"set to",n,"Missing plugin? gsap.registerPlugin()")},ff=function(e,n){return!n&&console.warn(e)},yA=function(e,n){return e&&(es[e]=n)&&Wm&&(Wm[e]=n)||es},hf=function(){return 0},uZ={suppressEvents:!0,isStart:!0,kill:!1},Bp={suppressEvents:!0,kill:!1},dZ={suppressEvents:!0},Jx={},sa=[],G_={},_A,Wr={},P1={},Kk=30,Wp=[],ew="",tw=function(e){var n=e[0],r,s;if(xi(n)||en(n)||(e=[e]),!(r=(n._gsap||{}).harness)){for(s=Wp.length;s--&&!Wp[s].targetTest(n););r=Wp[s]}for(s=e.length;s--;)e[s]&&(e[s]._gsap||(e[s]._gsap=new HA(e[s],r)))||e.splice(s,1);return e},wl=function(e){return e._gsap||tw(vs(e))[0]._gsap},xA=function(e,n,r){return(r=e[n])&&en(r)?e[n]():qx(r)&&e.getAttribute&&e.getAttribute(n)||r},Ar=function(e,n){return(e=e.split(",")).forEach(n)||e},an=function(e){return Math.round(e*1e5)/1e5||0},Gt=function(e){return Math.round(e*1e7)/1e7||0},Ic=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},fZ=function(e,n){for(var r=n.length,s=0;e.indexOf(n[s])<0&&++s<r;);return s<r},Gm=function(){var e=sa.length,n=sa.slice(0),r,s;for(G_={},sa.length=0,r=0;r<e;r++)s=n[r],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},nw=function(e){return!!(e._initted||e._startAt||e.add)},wA=function(e,n,r,s){sa.length&&!$n&&Gm(),e.render(n,r,!!($n&&n<0&&nw(e))),sa.length&&!$n&&Gm()},bA=function(e){var n=parseFloat(e);return(n||n===0)&&(e+"").match(lZ).length<2?n:Rn(e)?e.trim():e},SA=function(e){return e},ts=function(e,n){for(var r in n)r in e||(e[r]=n[r]);return e},hZ=function(e){return function(n,r){for(var s in r)s in n||s==="duration"&&e||s==="ease"||(n[s]=r[s])}},nu=function(e,n){for(var r in n)e[r]=n[r];return e},Zk=function t(e,n){for(var r in n)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=xi(n[r])?t(e[r]||(e[r]={}),n[r]):n[r]);return e},Km=function(e,n){var r={},s;for(s in e)s in n||(r[s]=e[s]);return r},Dd=function(e){var n=e.parent||Kt,r=e.keyframes?hZ(Xn(e.keyframes)):ts;if(Rr(e.inherit))for(;n;)r(e,n.vars.defaults),n=n.parent||n._dp;return e},pZ=function(e,n){for(var r=e.length,s=r===n.length;s&&r--&&e[r]===n[r];);return r<0},EA=function(e,n,r,s,i){var a=e[s],c;if(i)for(c=n[i];a&&a[i]>c;)a=a._prev;return a?(n._next=a._next,a._next=n):(n._next=e[r],e[r]=n),n._next?n._next._prev=n:e[s]=n,n._prev=a,n.parent=n._dp=e,n},C0=function(e,n,r,s){r===void 0&&(r="_first"),s===void 0&&(s="_last");var i=n._prev,a=n._next;i?i._next=a:e[r]===n&&(e[r]=a),a?a._prev=i:e[s]===n&&(e[s]=i),n._next=n._prev=n.parent=null},ha=function(e,n){e.parent&&(!n||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},bl=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},mZ=function(e){for(var n=e.parent;n&&n.parent;)n._dirty=1,n.totalDuration(),n=n.parent;return e},K_=function(e,n,r,s){return e._startAt&&($n?e._startAt.revert(Bp):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(n,!0,s))},gZ=function t(e){return!e||e._ts&&t(e.parent)},qk=function(e){return e._repeat?ru(e._tTime,e=e.duration()+e._rDelay)*e:0},ru=function(e,n){var r=Math.floor(e=Gt(e/n));return e&&r===e?r-1:r},Zm=function(e,n){return(e-n._start)*n._ts+(n._ts>=0?0:n._dirty?n.totalDuration():n._tDur)},k0=function(e){return e._end=Gt(e._start+(e._tDur/Math.abs(e._ts||e._rts||St)||0))},P0=function(e,n){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=Gt(r._time-(e._ts>0?n/e._ts:((e._dirty?e.totalDuration():e._tDur)-n)/-e._ts)),k0(e),r._dirty||bl(r,e)),e},CA=function(e,n){var r;if((n._time||!n._dur&&n._initted||n._start<e._time&&(n._dur||!n.add))&&(r=Zm(e.rawTime(),n),(!n._dur||Lf(0,n.totalDuration(),r)-n._tTime>St)&&n.render(r,!0)),bl(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=-St}},fi=function(e,n,r,s){return n.parent&&ha(n),n._start=Gt((po(r)?r:r||e!==Kt?ds(e,r,n):e._time)+n._delay),n._end=Gt(n._start+(n.totalDuration()/Math.abs(n.timeScale())||0)),EA(e,n,"_first","_last",e._sort?"_start":0),Z_(n)||(e._recent=n),s||CA(e,n),e._ts<0&&P0(e,e._tTime),e},kA=function(e,n){return(es.ScrollTrigger||Qx("scrollTrigger",n))&&es.ScrollTrigger.create(n,e)},PA=function(e,n,r,s,i){if(sw(e,n,i),!e._initted)return 1;if(!r&&e._pt&&!$n&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&_A!==Gr.frame)return sa.push(e),e._lazy=[i,s],1},vZ=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},Z_=function(e){var n=e.data;return n==="isFromStart"||n==="isStart"},yZ=function(e,n,r,s){var i=e.ratio,a=n<0||!n&&(!e._start&&vZ(e)&&!(!e._initted&&Z_(e))||(e._ts<0||e._dp._ts<0)&&!Z_(e))?0:1,c=e._rDelay,u=0,f,h,p;if(c&&e._repeat&&(u=Lf(0,e._tDur,n),h=ru(u,c),e._yoyo&&h&1&&(a=1-a),h!==ru(e._tTime,c)&&(i=1-a,e.vars.repeatRefresh&&e._initted&&e.invalidate())),a!==i||$n||s||e._zTime===St||!n&&e._zTime){if(!e._initted&&PA(e,n,s,r,u))return;for(p=e._zTime,e._zTime=n||(r?St:0),r||(r=n&&!p),e.ratio=a,e._from&&(a=1-a),e._time=0,e._tTime=u,f=e._pt;f;)f.r(a,f.d),f=f._next;n<0&&K_(e,n,r,!0),e._onUpdate&&!r&&Zr(e,"onUpdate"),u&&e._repeat&&!r&&e.parent&&Zr(e,"onRepeat"),(n>=e._tDur||n<0)&&e.ratio===a&&(a&&ha(e,1),!r&&!$n&&(Zr(e,a?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=n)},_Z=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}},su=function(e,n,r,s){var i=e._repeat,a=Gt(n)||0,c=e._tTime/e._tDur;return c&&!s&&(e._time*=a/e._dur),e._dur=a,e._tDur=i?i<0?1e10:Gt(a*(i+1)+e._rDelay*i):a,c>0&&!s&&P0(e,e._tTime=e._tDur*c),e.parent&&k0(e),r||bl(e.parent,e),e},Yk=function(e){return e instanceof Cr?bl(e):su(e,e._dur)},xZ={_start:0,endTime:hf,totalDuration:hf},ds=function t(e,n,r){var s=e.labels,i=e._recent||xZ,a=e.duration()>=gs?i.endTime(!1):e._dur,c,u,f;return Rn(n)&&(isNaN(n)||n in s)?(u=n.charAt(0),f=n.substr(-1)==="%",c=n.indexOf("="),u==="<"||u===">"?(c>=0&&(n=n.replace(/=/,"")),(u==="<"?i._start:i.endTime(i._repeat>=0))+(parseFloat(n.substr(1))||0)*(f?(c<0?i:r).totalDuration()/100:1)):c<0?(n in s||(s[n]=a),s[n]):(u=parseFloat(n.charAt(c-1)+n.substr(c+1)),f&&r&&(u=u/100*(Xn(r)?r[0]:r).totalDuration()),c>1?t(e,n.substr(0,c-1),r)+u:a+u)):n==null?a:+n},jd=function(e,n,r){var s=po(n[1]),i=(s?2:1)+(e<2?0:1),a=n[i],c,u;if(s&&(a.duration=n[1]),a.parent=r,e){for(c=a,u=r;u&&!("immediateRender"in c);)c=u.vars.defaults||{},u=Rr(u.vars.inherit)&&u.parent;a.immediateRender=Rr(c.immediateRender),e<2?a.runBackwards=1:a.startAt=n[i-1]}return new gn(n[0],a,n[i+1])},ba=function(e,n){return e||e===0?n(e):n},Lf=function(e,n,r){return r<e?e:r>n?n:r},qn=function(e,n){return!Rn(e)||!(n=cZ.exec(e))?"":n[1]},wZ=function(e,n,r){return ba(r,function(s){return Lf(e,n,s)})},q_=[].slice,TA=function(e,n){return e&&xi(e)&&"length"in e&&(!n&&!e.length||e.length-1 in e&&xi(e[0]))&&!e.nodeType&&e!==oi},bZ=function(e,n,r){return r===void 0&&(r=[]),e.forEach(function(s){var i;return Rn(s)&&!n||TA(s,1)?(i=r).push.apply(i,vs(s)):r.push(s)})||r},vs=function(e,n,r){return Ut&&!n&&Ut.selector?Ut.selector(e):Rn(e)&&!r&&(W_||!iu())?q_.call((n||Xx).querySelectorAll(e),0):Xn(e)?bZ(e,r):TA(e)?q_.call(e,0):e?[e]:[]},Y_=function(e){return e=vs(e)[0]||ff("Invalid scope")||{},function(n){var r=e.current||e.nativeElement||e;return vs(n,r.querySelectorAll?r:r===e?ff("Invalid scope")||Xx.createElement("div"):e)}},RA=function(e){return e.sort(function(){return .5-Math.random()})},AA=function(e){if(en(e))return e;var n=xi(e)?e:{each:e},r=Sl(n.ease),s=n.from||0,i=parseFloat(n.base)||0,a={},c=s>0&&s<1,u=isNaN(s)||c,f=n.axis,h=s,p=s;return Rn(s)?h=p={center:.5,edges:.5,end:1}[s]||0:!c&&u&&(h=s[0],p=s[1]),function(m,_,x){var y=(x||n).length,w=a[y],S,T,P,k,R,L,O,A,I;if(!w){if(I=n.grid==="auto"?0:(n.grid||[1,gs])[1],!I){for(O=-gs;O<(O=x[I++].getBoundingClientRect().left)&&I<y;);I<y&&I--}for(w=a[y]=[],S=u?Math.min(I,y)*h-.5:s%I,T=I===gs?0:u?y*p/I-.5:s/I|0,O=0,A=gs,L=0;L<y;L++)P=L%I-S,k=T-(L/I|0),w[L]=R=f?Math.abs(f==="y"?k:P):fA(P*P+k*k),R>O&&(O=R),R<A&&(A=R);s==="random"&&RA(w),w.max=O-A,w.min=A,w.v=y=(parseFloat(n.amount)||parseFloat(n.each)*(I>y?y-1:f?f==="y"?y/I:I:Math.max(I,y/I))||0)*(s==="edges"?-1:1),w.b=y<0?i-y:i,w.u=qn(n.amount||n.each)||0,r=r&&y<0?NZ(r):r}return y=(w[m]-w.min)/w.max||0,Gt(w.b+(r?r(y):y)*w.v)+w.u}},X_=function(e){var n=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var s=Gt(Math.round(parseFloat(r)/e)*e*n);return(s-s%1)/n+(po(r)?0:qn(r))}},IA=function(e,n){var r=Xn(e),s,i;return!r&&xi(e)&&(s=r=e.radius||gs,e.values?(e=vs(e.values),(i=!po(e[0]))&&(s*=s)):e=X_(e.increment)),ba(n,r?en(e)?function(a){return i=e(a),Math.abs(i-a)<=s?i:a}:function(a){for(var c=parseFloat(i?a.x:a),u=parseFloat(i?a.y:0),f=gs,h=0,p=e.length,m,_;p--;)i?(m=e[p].x-c,_=e[p].y-u,m=m*m+_*_):m=Math.abs(e[p]-c),m<f&&(f=m,h=p);return h=!s||f<=s?e[h]:a,i||h===a||po(a)?h:h+qn(a)}:X_(e))},MA=function(e,n,r,s){return ba(Xn(e)?!n:r===!0?!!(r=0):!s,function(){return Xn(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})},SZ=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,a){return a(i)},s)}},EZ=function(e,n){return function(r){return e(parseFloat(r))+(n||qn(r))}},CZ=function(e,n,r){return LA(e,n,0,1,r)},OA=function(e,n,r){return ba(r,function(s){return e[~~n(s)]})},kZ=function t(e,n,r){var s=n-e;return Xn(e)?OA(e,t(0,e.length),n):ba(r,function(i){return(s+(i-e)%s)%s+e})},PZ=function t(e,n,r){var s=n-e,i=s*2;return Xn(e)?OA(e,t(0,e.length-1),n):ba(r,function(a){return a=(i+(a-e)%i)%i||0,e+(a>s?i-a:a)})},pf=function(e){return e.replace(oZ,function(n){var r=n.indexOf("[")+1,s=n.substring(r||7,r?n.indexOf("]"):n.length-1).split(aZ);return MA(r?s:+s[0],r?0:+s[1],+s[2]||1e-5)})},LA=function(e,n,r,s,i){var a=n-e,c=s-r;return ba(i,function(u){return r+((u-e)/a*c||0)})},TZ=function t(e,n,r,s){var i=isNaN(e+n)?0:function(_){return(1-_)*e+_*n};if(!i){var a=Rn(e),c={},u,f,h,p,m;if(r===!0&&(s=1)&&(r=null),a)e={p:e},n={p:n};else if(Xn(e)&&!Xn(n)){for(h=[],p=e.length,m=p-2,f=1;f<p;f++)h.push(t(e[f-1],e[f]));p--,i=function(x){x*=p;var y=Math.min(m,~~x);return h[y](x-y)},r=n}else s||(e=nu(Xn(e)?[]:{},e));if(!h){for(u in n)rw.call(c,e,u,"get",n[u]);i=function(x){return aw(x,c)||(a?e.p:e)}}}return ba(r,i)},Xk=function(e,n,r){var s=e.labels,i=gs,a,c,u;for(a in s)c=s[a]-n,c<0==!!r&&c&&i>(c=Math.abs(c))&&(u=a,i=c);return u},Zr=function(e,n,r){var s=e.vars,i=s[n],a=Ut,c=e._ctx,u,f,h;if(i)return u=s[n+"Params"],f=s.callbackScope||e,r&&sa.length&&Gm(),c&&(Ut=c),h=u?i.apply(f,u):i.call(f),Ut=a,h},bd=function(e){return ha(e),e.scrollTrigger&&e.scrollTrigger.kill(!!$n),e.progress()<1&&Zr(e,"onInterrupt"),e},Ec,NA=[],DA=function(e){if(e)if(e=!e.name&&e.default||e,Yx()||e.headless){var n=e.name,r=en(e),s=n&&!r&&e.init?function(){this._props=[]}:e,i={init:hf,render:aw,add:rw,kill:WZ,modifier:BZ,rawVars:0},a={targetTest:0,get:0,getSetter:ow,aliases:{},register:0};if(iu(),e!==s){if(Wr[n])return;ts(s,ts(Km(e,i),a)),nu(s.prototype,nu(i,Km(e,a))),Wr[s.prop=n]=s,e.targetTest&&(Wp.push(s),Jx[n]=1),n=(n==="css"?"CSS":n.charAt(0).toUpperCase()+n.substr(1))+"Plugin"}yA(n,s),e.register&&e.register(Or,s,Ir)}else NA.push(e)},wt=255,Sd={aqua:[0,wt,wt],lime:[0,wt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,wt],navy:[0,0,128],white:[wt,wt,wt],olive:[128,128,0],yellow:[wt,wt,0],orange:[wt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[wt,0,0],pink:[wt,192,203],cyan:[0,wt,wt],transparent:[wt,wt,wt,0]},T1=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)*wt+.5|0},jA=function(e,n,r){var s=e?po(e)?[e>>16,e>>8&wt,e&wt]:0:Sd.black,i,a,c,u,f,h,p,m,_,x;if(!s){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Sd[e])s=Sd[e];else if(e.charAt(0)==="#"){if(e.length<6&&(i=e.charAt(1),a=e.charAt(2),c=e.charAt(3),e="#"+i+i+a+a+c+c+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return s=parseInt(e.substr(1,6),16),[s>>16,s>>8&wt,s&wt,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),s=[e>>16,e>>8&wt,e&wt]}else if(e.substr(0,3)==="hsl"){if(s=x=e.match(Gk),!n)u=+s[0]%360/360,f=+s[1]/100,h=+s[2]/100,a=h<=.5?h*(f+1):h+f-h*f,i=h*2-a,s.length>3&&(s[3]*=1),s[0]=T1(u+1/3,i,a),s[1]=T1(u,i,a),s[2]=T1(u-1/3,i,a);else if(~e.indexOf("="))return s=e.match(pA),r&&s.length<4&&(s[3]=1),s}else s=e.match(Gk)||Sd.transparent;s=s.map(Number)}return n&&!x&&(i=s[0]/wt,a=s[1]/wt,c=s[2]/wt,p=Math.max(i,a,c),m=Math.min(i,a,c),h=(p+m)/2,p===m?u=f=0:(_=p-m,f=h>.5?_/(2-p-m):_/(p+m),u=p===i?(a-c)/_+(a<c?6:0):p===a?(c-i)/_+2:(i-a)/_+4,u*=60),s[0]=~~(u+.5),s[1]=~~(f*100+.5),s[2]=~~(h*100+.5)),r&&s.length<4&&(s[3]=1),s},FA=function(e){var n=[],r=[],s=-1;return e.split(ia).forEach(function(i){var a=i.match(Sc)||[];n.push.apply(n,a),r.push(s+=a.length+1)}),n.c=r,n},Qk=function(e,n,r){var s="",i=(e+s).match(ia),a=n?"hsla(":"rgba(",c=0,u,f,h,p;if(!i)return e;if(i=i.map(function(m){return(m=jA(m,n,1))&&a+(n?m[0]+","+m[1]+"%,"+m[2]+"%,"+m[3]:m.join(","))+")"}),r&&(h=FA(e),u=r.c,u.join(s)!==h.c.join(s)))for(f=e.replace(ia,"1").split(Sc),p=f.length-1;c<p;c++)s+=f[c]+(~u.indexOf(c)?i.shift()||a+"0,0,0,0)":(h.length?h:i.length?i:r).shift());if(!f)for(f=e.split(ia),p=f.length-1;c<p;c++)s+=f[c]+i[c];return s+f[p]},ia=(function(){var t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in Sd)t+="|"+e+"\\b";return new RegExp(t+")","gi")})(),RZ=/hsl[a]?\(/,VA=function(e){var n=e.join(" "),r;if(ia.lastIndex=0,ia.test(n))return r=RZ.test(n),e[1]=Qk(e[1],r),e[0]=Qk(e[0],r,FA(e[1])),!0},mf,Gr=(function(){var t=Date.now,e=500,n=33,r=t(),s=r,i=1e3/240,a=i,c=[],u,f,h,p,m,_,x=function y(w){var S=t()-s,T=w===!0,P,k,R,L;if((S>e||S<0)&&(r+=S-n),s+=S,R=s-r,P=R-a,(P>0||T)&&(L=++p.frame,m=R-p.time*1e3,p.time=R=R/1e3,a+=P+(P>=i?4:i-P),k=1),T||(u=f(y)),k)for(_=0;_<c.length;_++)c[_](R,m,L,w)};return p={time:0,frame:0,tick:function(){x(!0)},deltaRatio:function(w){return m/(1e3/(w||60))},wake:function(){gA&&(!W_&&Yx()&&(oi=W_=window,Xx=oi.document||{},es.gsap=Or,(oi.gsapVersions||(oi.gsapVersions=[])).push(Or.version),vA(Wm||oi.GreenSockGlobals||!oi.gsap&&oi||{}),NA.forEach(DA)),h=typeof requestAnimationFrame<"u"&&requestAnimationFrame,u&&p.sleep(),f=h||function(w){return setTimeout(w,a-p.time*1e3+1|0)},mf=1,x(2))},sleep:function(){(h?cancelAnimationFrame:clearTimeout)(u),mf=0,f=hf},lagSmoothing:function(w,S){e=w||1/0,n=Math.min(S||33,e)},fps:function(w){i=1e3/(w||240),a=p.time*1e3+i},add:function(w,S,T){var P=S?function(k,R,L,O){w(k,R,L,O),p.remove(P)}:w;return p.remove(w),c[T?"unshift":"push"](P),iu(),P},remove:function(w,S){~(S=c.indexOf(w))&&c.splice(S,1)&&_>=S&&_--},_listeners:c},p})(),iu=function(){return!mf&&Gr.wake()},ct={},AZ=/^[\d.\-M][\d.\-,\s]/,IZ=/["']/g,MZ=function(e){for(var n={},r=e.substr(1,e.length-3).split(":"),s=r[0],i=1,a=r.length,c,u,f;i<a;i++)u=r[i],c=i!==a-1?u.lastIndexOf(","):u.length,f=u.substr(0,c),n[s]=isNaN(f)?f.replace(IZ,"").trim():+f,s=u.substr(c+1).trim();return n},OZ=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)},LZ=function(e){var n=(e+"").split("("),r=ct[n[0]];return r&&n.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[MZ(n[1])]:OZ(e).split(",").map(bA)):ct._CE&&AZ.test(e)?ct._CE("",e):r},NZ=function(e){return function(n){return 1-e(1-n)}},Sl=function(e,n){return e&&(en(e)?e:ct[e]||LZ(e))||n},Al=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},a;return Ar(e,function(c){ct[c]=es[c]=i,ct[a=c.toLowerCase()]=r;for(var u in i)ct[a+(u==="easeIn"?".in":u==="easeOut"?".out":".inOut")]=ct[c+"."+u]=i[u]}),i},$A=function(e){return function(n){return n<.5?(1-e(1-n*2))/2:.5+e((n-.5)*2)/2}},R1=function t(e,n,r){var s=n>=1?n:1,i=(r||(e?.3:.45))/(n<1?n:1),a=i/B_*(Math.asin(1/s)||0),c=function(h){return h===1?1:s*Math.pow(2,-10*h)*iZ((h-a)*i)+1},u=e==="out"?c:e==="in"?function(f){return 1-c(1-f)}:$A(c);return i=B_/i,u.config=function(f,h){return t(e,f,h)},u},A1=function t(e,n){n===void 0&&(n=1.70158);var r=function(a){return a?--a*a*((n+1)*a+n)+1:0},s=e==="out"?r:e==="in"?function(i){return 1-r(1-i)}:$A(r);return s.config=function(i){return t(e,i)},s};Ar("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var n=e<5?e+1:e;Al(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})});ct.Linear.easeNone=ct.none=ct.Linear.easeIn;Al("Elastic",R1("in"),R1("out"),R1());(function(t,e){var n=1/e,r=2*n,s=2.5*n,i=function(c){return c<n?t*c*c:c<r?t*Math.pow(c-1.5/e,2)+.75:c<s?t*(c-=2.25/e)*c+.9375:t*Math.pow(c-2.625/e,2)+.984375};Al("Bounce",function(a){return 1-i(1-a)},i)})(7.5625,2.75);Al("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)});Al("Circ",function(t){return-(fA(1-t*t)-1)});Al("Sine",function(t){return t===1?1:-sZ(t*nZ)+1});Al("Back",A1("in"),A1("out"),A1());ct.SteppedEase=ct.steps=es.SteppedEase={config:function(e,n){e===void 0&&(e=1);var r=1/e,s=e+(n?0:1),i=n?1:0,a=1-St;return function(c){return((s*Lf(0,a,c)|0)+i)*r}}};df.ease=ct["quad.out"];Ar("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return ew+=t+","+t+"Params,"});var HA=function(e,n){this.id=rZ++,e._gsap=this,this.target=e,this.harness=n,this.get=n?n.get:xA,this.set=n?n.getSetter:ow},gf=(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,su(this,+n.duration,1,1),this.data=n.data,Ut&&(this._ctx=Ut,Ut.data.push(this)),mf||Gr.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,su(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,s){if(iu(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(P0(this,r),!i._dp||i.parent||CA(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)&&fi(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!s||this._initted&&Math.abs(this._zTime)===St||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),wA(this,r,s)),this},e.time=function(r,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+qk(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)+qk(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?ru(this._tTime,i)+1:1},e.timeScale=function(r,s){if(!arguments.length)return this._rts===-St?0:this._rts;if(this._rts===r)return this;var i=this.parent&&this._ts?Zm(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-St?0:this._rts,this.totalTime(Lf(-Math.abs(this._delay),this.totalDuration(),i),s!==!1),k0(this),mZ(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):(iu(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==St&&(this._tTime-=St)))),this):this._ps},e.startTime=function(r){if(arguments.length){this._start=Gt(r);var s=this.parent||this._dp;return s&&(s._sort||!this.parent)&&fi(s,this,this._start-this._delay),this}return this._start},e.endTime=function(r){return this._start+(Rr(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?Zm(s.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=dZ);var s=$n;return $n=r,nw(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),$n=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,Yk(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var s=this._time;return this._rDelay=r,Yk(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(ds(this,r),Rr(s))},e.restart=function(r,s){return this.play().totalTime(r?-this._delay:0,Rr(s)),this._dur||(this._zTime=-St),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?-St:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-St,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)-St)},e.eventCallback=function(r,s,i){var a=this.vars;return arguments.length>1?(s?(a[r]=s,i&&(a[r+"Params"]=i),r==="onUpdate"&&(this._onUpdate=s)):delete a[r],this):a[r]},e.then=function(r){var s=this,i=s._prom;return new Promise(function(a){var c=en(r)?r:SA,u=function(){var h=s.then;s.then=null,i&&i(),en(c)&&(c=c(s))&&(c.then||c===s)&&(s.then=h),a(c),s.then=h};s._initted&&s.totalProgress()===1&&s._ts>=0||!s._tTime&&s._ts<0?u():s._prom=u})},e.kill=function(){bd(this)},t})();ts(gf.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:-St,_prom:0,_ps:!1,_rts:1});var Cr=(function(t){dA(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=Rr(r.sortChildren),Kt&&fi(r.parent||Kt,qi(i),s),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&kA(qi(i),r.scrollTrigger),i}var n=e.prototype;return n.to=function(s,i,a){return jd(0,arguments,this),this},n.from=function(s,i,a){return jd(1,arguments,this),this},n.fromTo=function(s,i,a,c){return jd(2,arguments,this),this},n.set=function(s,i,a){return i.duration=0,i.parent=this,Dd(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new gn(s,i,ds(this,a),1),this},n.call=function(s,i,a){return fi(this,gn.delayedCall(0,s,i),a)},n.staggerTo=function(s,i,a,c,u,f,h){return a.duration=i,a.stagger=a.stagger||c,a.onComplete=f,a.onCompleteParams=h,a.parent=this,new gn(s,a,ds(this,u)),this},n.staggerFrom=function(s,i,a,c,u,f,h){return a.runBackwards=1,Dd(a).immediateRender=Rr(a.immediateRender),this.staggerTo(s,i,a,c,u,f,h)},n.staggerFromTo=function(s,i,a,c,u,f,h,p){return c.startAt=a,Dd(c).immediateRender=Rr(c.immediateRender),this.staggerTo(s,i,c,u,f,h,p)},n.render=function(s,i,a){var c=this._time,u=this._dirty?this.totalDuration():this._tDur,f=this._dur,h=s<=0?0:Gt(s),p=this._zTime<0!=s<0&&(this._initted||!f),m,_,x,y,w,S,T,P,k,R,L,O;if(this!==Kt&&h>u&&s>=0&&(h=u),h!==this._tTime||a||p){if(c!==this._time&&f&&(h+=this._time-c,s+=this._time-c),m=h,k=this._start,P=this._ts,S=!P,p&&(f||(c=this._zTime),(s||!i)&&(this._zTime=s)),this._repeat){if(L=this._yoyo,w=f+this._rDelay,this._repeat<-1&&s<0)return this.totalTime(w*100+s,i,a);if(m=Gt(h%w),h===u?(y=this._repeat,m=f):(R=Gt(h/w),y=~~R,y&&y===R&&(m=f,y--),m>f&&(m=f)),R=ru(this._tTime,w),!c&&this._tTime&&R!==y&&this._tTime-R*w-this._dur<=0&&(R=y),L&&y&1&&(m=f-m,O=1),y!==R&&!this._lock){var A=L&&R&1,I=A===(L&&y&1);if(y<R&&(A=!A),c=A?0:h%f?f:h,this._lock=1,this.render(c||(O?0:Gt(y*w)),i,!f)._lock=0,this._tTime=h,!i&&this.parent&&Zr(this,"onRepeat"),this.vars.repeatRefresh&&!O&&(this.invalidate()._lock=1,R=y),c&&c!==this._time||S!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(f=this._dur,u=this._tDur,I&&(this._lock=2,c=A?f:-1e-4,this.render(c,!0),this.vars.repeatRefresh&&!O&&this.invalidate()),this._lock=0,!this._ts&&!S)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(T=_Z(this,Gt(c),Gt(m)),T&&(h-=m-(m=T._start))),this._tTime=h,this._time=m,this._act=!!P,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=s,c=0),!c&&h&&f&&!i&&!R&&(Zr(this,"onStart"),this._tTime!==h))return this;if(m>=c&&s>=0)for(_=this._first;_;){if(x=_._next,(_._act||m>=_._start)&&_._ts&&T!==_){if(_.parent!==this)return this.render(s,i,a);if(_.render(_._ts>0?(m-_._start)*_._ts:(_._dirty?_.totalDuration():_._tDur)+(m-_._start)*_._ts,i,a),m!==this._time||!this._ts&&!S){T=0,x&&(h+=this._zTime=-St);break}}_=x}else{_=this._last;for(var N=s<0?s:m;_;){if(x=_._prev,(_._act||N<=_._end)&&_._ts&&T!==_){if(_.parent!==this)return this.render(s,i,a);if(_.render(_._ts>0?(N-_._start)*_._ts:(_._dirty?_.totalDuration():_._tDur)+(N-_._start)*_._ts,i,a||$n&&nw(_)),m!==this._time||!this._ts&&!S){T=0,x&&(h+=this._zTime=N?-St:St);break}}_=x}}if(T&&!i&&(this.pause(),T.render(m>=c?0:-St)._zTime=m>=c?1:-1,this._ts))return this._start=k,k0(this),this.render(s,i,a);this._onUpdate&&!i&&Zr(this,"onUpdate",!0),(h===u&&this._tTime>=this.totalDuration()||!h&&c)&&(k===this._start||Math.abs(P)!==Math.abs(this._ts))&&(this._lock||((s||!f)&&(h===u&&this._ts>0||!h&&this._ts<0)&&ha(this,1),!i&&!(s<0&&!c)&&(h||c||!u)&&(Zr(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 a=this;if(po(i)||(i=ds(this,i,s)),!(s instanceof gf)){if(Xn(s))return s.forEach(function(c){return a.add(c,i)}),this;if(Rn(s))return this.addLabel(s,i);if(en(s))s=gn.delayedCall(0,s);else return this}return this!==s?fi(this,s,i):this},n.getChildren=function(s,i,a,c){s===void 0&&(s=!0),i===void 0&&(i=!0),a===void 0&&(a=!0),c===void 0&&(c=-gs);for(var u=[],f=this._first;f;)f._start>=c&&(f instanceof gn?i&&u.push(f):(a&&u.push(f),s&&u.push.apply(u,f.getChildren(!0,i,a)))),f=f._next;return u},n.getById=function(s){for(var i=this.getChildren(1,1,1),a=i.length;a--;)if(i[a].vars.id===s)return i[a]},n.remove=function(s){return Rn(s)?this.removeLabel(s):en(s)?this.killTweensOf(s):(s.parent===this&&C0(this,s),s===this._recent&&(this._recent=this._last),bl(this))},n.totalTime=function(s,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Gt(Gr.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]=ds(this,i),this},n.removeLabel=function(s){return delete this.labels[s],this},n.addPause=function(s,i,a){var c=gn.delayedCall(0,i||hf,a);return c.data="isPause",this._hasPause=1,fi(this,c,ds(this,s))},n.removePause=function(s){var i=this._first;for(s=ds(this,s);i;)i._start===s&&i.data==="isPause"&&ha(i),i=i._next},n.killTweensOf=function(s,i,a){for(var c=this.getTweensOf(s,a),u=c.length;u--;)Qo!==c[u]&&c[u].kill(s,i);return this},n.getTweensOf=function(s,i){for(var a=[],c=vs(s),u=this._first,f=po(i),h;u;)u instanceof gn?fZ(u._targets,c)&&(f?(!Qo||u._initted&&u._ts)&&u.globalTime(0)<=i&&u.globalTime(u.totalDuration())>i:!i||u.isActive())&&a.push(u):(h=u.getTweensOf(c,i)).length&&a.push.apply(a,h),u=u._next;return a},n.tweenTo=function(s,i){i=i||{};var a=this,c=ds(a,s),u=i,f=u.startAt,h=u.onStart,p=u.onStartParams,m=u.immediateRender,_,x=gn.to(a,ts({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:c,overwrite:"auto",duration:i.duration||Math.abs((c-(f&&"time"in f?f.time:a._time))/a.timeScale())||St,onStart:function(){if(a.pause(),!_){var w=i.duration||Math.abs((c-(f&&"time"in f?f.time:a._time))/a.timeScale());x._dur!==w&&su(x,w,0,1).render(x._time,!0,!0),_=1}h&&h.apply(x,p||[])}},i));return m?x.render(0):x},n.tweenFromTo=function(s,i,a){return this.tweenTo(i,ts({startAt:{time:ds(this,s)}},a))},n.recent=function(){return this._recent},n.nextLabel=function(s){return s===void 0&&(s=this._time),Xk(this,ds(this,s))},n.previousLabel=function(s){return s===void 0&&(s=this._time),Xk(this,ds(this,s),1)},n.currentLabel=function(s){return arguments.length?this.seek(s,!0):this.previousLabel(this._time+St)},n.shiftChildren=function(s,i,a){a===void 0&&(a=0);var c=this._first,u=this.labels,f;for(s=Gt(s);c;)c._start>=a&&(c._start+=s,c._end+=s),c=c._next;if(i)for(f in u)u[f]>=a&&(u[f]+=s);return bl(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,a;i;)a=i._next,this.remove(i),i=a;return this._dp&&(this._time=this._tTime=this._pTime=0),s&&(this.labels={}),bl(this)},n.totalDuration=function(s){var i=0,a=this,c=a._last,u=gs,f,h,p;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-s:s));if(a._dirty){for(p=a.parent;c;)f=c._prev,c._dirty&&c.totalDuration(),h=c._start,h>u&&a._sort&&c._ts&&!a._lock?(a._lock=1,fi(a,c,h-c._delay,1)._lock=0):u=h,h<0&&c._ts&&(i-=h,(!p&&!a._dp||p&&p.smoothChildTiming)&&(a._start+=Gt(h/a._ts),a._time-=h,a._tTime-=h),a.shiftChildren(-h,!1,-1/0),u=0),c._end>i&&c._ts&&(i=c._end),c=f;su(a,a===Kt&&a._time>i?a._time:i,1,1),a._dirty=0}return a._tDur},e.updateRoot=function(s){if(Kt._ts&&(wA(Kt,Zm(s,Kt)),_A=Gr.frame),Gr.frame>=Kk){Kk+=Qr.autoSleep||120;var i=Kt._first;if((!i||!i._ts)&&Qr.autoSleep&&Gr._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||Gr.sleep()}}},e})(gf);ts(Cr.prototype,{_lock:0,_hasPause:0,_forcing:0});var DZ=function(e,n,r,s,i,a,c){var u=new Ir(this._pt,e,n,0,1,KA,null,i),f=0,h=0,p,m,_,x,y,w,S,T;for(u.b=r,u.e=s,r+="",s+="",(S=~s.indexOf("random("))&&(s=pf(s)),a&&(T=[r,s],a(T,e,n),r=T[0],s=T[1]),m=r.match(k1)||[];p=k1.exec(s);)x=p[0],y=s.substring(f,p.index),_?_=(_+1)%5:y.substr(-5)==="rgba("&&(_=1),x!==m[h++]&&(w=parseFloat(m[h-1])||0,u._pt={_next:u._pt,p:y||h===1?y:",",s:w,c:x.charAt(1)==="="?Ic(w,x)-w:parseFloat(x)-w,m:_&&_<4?Math.round:0},f=k1.lastIndex);return u.c=f<s.length?s.substring(f,s.length):"",u.fp=c,(mA.test(s)||S)&&(u.e=0),this._pt=u,u},rw=function(e,n,r,s,i,a,c,u,f,h){en(s)&&(s=s(i||0,e,a));var p=e[n],m=r!=="get"?r:en(p)?f?e[n.indexOf("set")||!en(e["get"+n.substr(3)])?n:"get"+n.substr(3)](f):e[n]():p,_=en(p)?f?HZ:WA:iw,x;if(Rn(s)&&(~s.indexOf("random(")&&(s=pf(s)),s.charAt(1)==="="&&(x=Ic(m,s)+(qn(m)||0),(x||x===0)&&(s=x))),!h||m!==s||Q_)return!isNaN(m*s)&&s!==""?(x=new Ir(this._pt,e,n,+m||0,s-(m||0),typeof p=="boolean"?UZ:GA,0,_),f&&(x.fp=f),c&&x.modifier(c,this,e),this._pt=x):(!p&&!(n in e)&&Qx(n,s),DZ.call(this,e,n,m,s,_,u||Qr.stringFilter,f))},jZ=function(e,n,r,s,i){if(en(e)&&(e=Fd(e,i,n,r,s)),!xi(e)||e.style&&e.nodeType||Xn(e)||hA(e))return Rn(e)?Fd(e,i,n,r,s):e;var a={},c;for(c in e)a[c]=Fd(e[c],i,n,r,s);return a},zA=function(e,n,r,s,i,a){var c,u,f,h;if(Wr[e]&&(c=new Wr[e]).init(i,c.rawVars?n[e]:jZ(n[e],s,i,a,r),r,s,a)!==!1&&(r._pt=u=new Ir(r._pt,i,e,0,1,c.render,c,0,c.priority),r!==Ec))for(f=r._ptLookup[r._targets.indexOf(i)],h=c._props.length;h--;)f[c._props[h]]=u;return c},Qo,Q_,sw=function t(e,n,r){var s=e.vars,i=s.ease,a=s.startAt,c=s.immediateRender,u=s.lazy,f=s.onUpdate,h=s.runBackwards,p=s.yoyoEase,m=s.keyframes,_=s.autoRevert,x=e._dur,y=e._startAt,w=e._targets,S=e.parent,T=S&&S.data==="nested"?S.vars.targets:w,P=e._overwrite==="auto"&&!Zx,k=e.timeline,R=s.easeReverse||p,L,O,A,I,N,j,F,K,X,W,G,q,$;if(k&&(!m||!i)&&(i="none"),e._ease=Sl(i,df.ease),e._rEase=R&&(Sl(R)||e._ease),e._from=!k&&!!s.runBackwards,e._from&&(e.ratio=1),!k||m&&!s.stagger){if(K=w[0]?wl(w[0]).harness:0,q=K&&s[K.prop],L=Km(s,Jx),y&&(y._zTime<0&&y.progress(1),n<0&&h&&c&&!_?y.render(-1,!0):y.revert(h&&x?Bp:uZ),y._lazy=0),a){if(ha(e._startAt=gn.set(w,ts({data:"isStart",overwrite:!1,parent:S,immediateRender:!0,lazy:!y&&Rr(u),startAt:null,delay:0,onUpdate:f&&function(){return Zr(e,"onUpdate")},stagger:0},a))),e._startAt._dp=0,e._startAt._sat=e,n<0&&($n||!c&&!_)&&e._startAt.revert(Bp),c&&x&&n<=0&&r<=0){n&&(e._zTime=n);return}}else if(h&&x&&!y){if(n&&(c=!1),A=ts({overwrite:!1,data:"isFromStart",lazy:c&&!y&&Rr(u),immediateRender:c,stagger:0,parent:S},L),q&&(A[K.prop]=q),ha(e._startAt=gn.set(w,A)),e._startAt._dp=0,e._startAt._sat=e,n<0&&($n?e._startAt.revert(Bp):e._startAt.render(-1,!0)),e._zTime=n,!c)t(e._startAt,St,St);else if(!n)return}for(e._pt=e._ptCache=0,u=x&&Rr(u)||u&&!x,O=0;O<w.length;O++){if(N=w[O],F=N._gsap||tw(w)[O]._gsap,e._ptLookup[O]=W={},G_[F.id]&&sa.length&&Gm(),G=T===w?O:T.indexOf(N),K&&(X=new K).init(N,q||L,e,G,T)!==!1&&(e._pt=I=new Ir(e._pt,N,X.name,0,1,X.render,X,0,X.priority),X._props.forEach(function(ne){W[ne]=I}),X.priority&&(j=1)),!K||q)for(A in L)Wr[A]&&(X=zA(A,L,e,G,N,T))?X.priority&&(j=1):W[A]=I=rw.call(e,N,A,"get",L[A],G,T,0,s.stringFilter);e._op&&e._op[O]&&e.kill(N,e._op[O]),P&&e._pt&&(Qo=e,Kt.killTweensOf(N,W,e.globalTime(n)),$=!e.parent,Qo=0),e._pt&&u&&(G_[F.id]=1)}j&&ZA(e),e._onInit&&e._onInit(e)}e._onUpdate=f,e._initted=(!e._op||e._pt)&&!$,m&&n<=0&&k.render(gs,!0,!0)},FZ=function(e,n,r,s,i,a,c,u){var f=(e._pt&&e._ptCache||(e._ptCache={}))[n],h,p,m,_;if(!f)for(f=e._ptCache[n]=[],m=e._ptLookup,_=e._targets.length;_--;){if(h=m[_][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 Q_=1,e.vars[n]="+=0",sw(e,c),Q_=0,u?ff(n+" not eligible for reset. Try splitting into individual properties"):1;f.push(h)}for(_=f.length;_--;)p=f[_],h=p._pt||p,h.s=(s||s===0)&&!i?s:h.s+(s||0)+a*h.c,h.c=r-h.s,p.e&&(p.e=an(r)+qn(p.e)),p.b&&(p.b=h.s+qn(p.b))},VZ=function(e,n){var r=e[0]?wl(e[0]).harness:0,s=r&&r.aliases,i,a,c,u;if(!s)return n;i=nu({},n);for(a in s)if(a in i)for(u=s[a].split(","),c=u.length;c--;)i[u[c]]=i[a];return i},$Z=function(e,n,r,s){var i=n.ease||s||"power1.inOut",a,c;if(Xn(n))c=r[e]||(r[e]=[]),n.forEach(function(u,f){return c.push({t:f/(n.length-1)*100,v:u,e:i})});else for(a in n)c=r[a]||(r[a]=[]),a==="ease"||c.push({t:parseFloat(e),v:n[a],e:i})},Fd=function(e,n,r,s,i){return en(e)?e.call(n,r,s,i):Rn(e)&&~e.indexOf("random(")?pf(e):e},UA=ew+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",BA={};Ar(UA+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return BA[t]=1});var gn=(function(t){dA(e,t);function e(r,s,i,a){var c;typeof s=="number"&&(i.duration=s,s=i,i=null),c=t.call(this,a?s:Dd(s))||this;var u=c.vars,f=u.duration,h=u.delay,p=u.immediateRender,m=u.stagger,_=u.overwrite,x=u.keyframes,y=u.defaults,w=u.scrollTrigger,S=s.parent||Kt,T=(Xn(r)||hA(r)?po(r[0]):"length"in s)?[r]:vs(r),P,k,R,L,O,A,I,N;if(c._targets=T.length?tw(T):ff("GSAP target "+r+" not found. https://gsap.com",!Qr.nullTargetWarn)||[],c._ptLookup=[],c._overwrite=_,x||m||xp(f)||xp(h)){s=c.vars;var j=s.easeReverse||s.yoyoEase;if(P=c.timeline=new Cr({data:"nested",defaults:y||{},targets:S&&S.data==="nested"?S.vars.targets:T}),P.kill(),P.parent=P._dp=qi(c),P._start=0,m||xp(f)||xp(h)){if(L=T.length,I=m&&AA(m),xi(m))for(O in m)~UA.indexOf(O)&&(N||(N={}),N[O]=m[O]);for(k=0;k<L;k++)R=Km(s,BA),R.stagger=0,j&&(R.easeReverse=j),N&&nu(R,N),A=T[k],R.duration=+Fd(f,qi(c),k,A,T),R.delay=(+Fd(h,qi(c),k,A,T)||0)-c._delay,!m&&L===1&&R.delay&&(c._delay=h=R.delay,c._start+=h,R.delay=0),P.to(A,R,I?I(k,A,T):0),P._ease=ct.none;P.duration()?f=h=0:c.timeline=0}else if(x){Dd(ts(P.vars.defaults,{ease:"none"})),P._ease=Sl(x.ease||s.ease||"none");var F=0,K,X,W;if(Xn(x))x.forEach(function(G){return P.to(T,G,">")}),P.duration();else{R={};for(O in x)O==="ease"||O==="easeEach"||$Z(O,x[O],R,x.easeEach);for(O in R)for(K=R[O].sort(function(G,q){return G.t-q.t}),F=0,k=0;k<K.length;k++)X=K[k],W={ease:X.e,duration:(X.t-(k?K[k-1].t:0))/100*f},W[O]=X.v,P.to(T,W,F),F+=W.duration;P.duration()<f&&P.to({},{duration:f-P.duration()})}}f||c.duration(f=P.duration())}else c.timeline=0;return _===!0&&!Zx&&(Qo=qi(c),Kt.killTweensOf(T),Qo=0),fi(S,qi(c),i),s.reversed&&c.reverse(),s.paused&&c.paused(!0),(p||!f&&!x&&c._start===Gt(S._time)&&Rr(p)&&gZ(qi(c))&&S.data!=="nested")&&(c._tTime=-St,c.render(Math.max(0,-h)||0)),w&&kA(qi(c),w),c}var n=e.prototype;return n.render=function(s,i,a){var c=this._time,u=this._tDur,f=this._dur,h=s<0,p=s>u-St&&!h?u:s<St?0:s,m,_,x,y,w,S,T,P;if(!f)yZ(this,s,i,a);else if(p!==this._tTime||!s||a||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==h||this._lazy){if(m=p,P=this.timeline,this._repeat){if(y=f+this._rDelay,this._repeat<-1&&h)return this.totalTime(y*100+s,i,a);if(m=Gt(p%y),p===u?(x=this._repeat,m=f):(w=Gt(p/y),x=~~w,x&&x===w?(m=f,x--):m>f&&(m=f)),S=this._yoyo&&x&1,S&&(m=f-m),w=ru(this._tTime,y),m===c&&!a&&this._initted&&x===w)return this._tTime=p,this;x!==w&&this.vars.repeatRefresh&&!S&&!this._lock&&m!==y&&this._initted&&(this._lock=a=1,this.render(Gt(y*x),!0).invalidate()._lock=0)}if(!this._initted){if(PA(this,h?s:m,a,i,p))return this._tTime=0,this;if(c!==this._time&&!(a&&this.vars.repeatRefresh&&x!==w))return this;if(f!==this._dur)return this.render(s,i,a)}if(this._rEase){var k=m<c;if(k!==this._inv){var R=k?c:f-c;this._inv=k,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=c,this._invRecip=R?(k?-1:1)/R:0,this._invScale=k?-this.ratio:1-this.ratio,this._invEase=k?this._rEase:this._ease}this.ratio=T=this._invRatio+this._invScale*this._invEase((m-this._invTime)*this._invRecip)}else this.ratio=T=this._ease(m/f);if(this._from&&(this.ratio=T=1-T),this._tTime=p,this._time=m,!this._act&&this._ts&&(this._act=1,this._lazy=0),!c&&p&&!i&&!w&&(Zr(this,"onStart"),this._tTime!==p))return this;for(_=this._pt;_;)_.r(T,_.d),_=_._next;P&&P.render(s<0?s:P._dur*P._ease(m/this._dur),i,a)||this._startAt&&(this._zTime=s),this._onUpdate&&!i&&(h&&K_(this,s,i,a),Zr(this,"onUpdate")),this._repeat&&x!==w&&this.vars.onRepeat&&!i&&this.parent&&Zr(this,"onRepeat"),(p===this._tDur||!p)&&this._tTime===p&&(h&&!this._onUpdate&&K_(this,s,!0,!0),(s||!f)&&(p===this._tDur&&this._ts>0||!p&&this._ts<0)&&ha(this,1),!i&&!(h&&!c)&&(p||c||S)&&(Zr(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,a,c,u){mf||Gr.wake(),this._ts||this.play();var f=Math.min(this._dur,(this._dp._time-this._start)*this._ts),h;return this._initted||sw(this,f),h=this._ease(f/this._dur),FZ(this,s,i,a,c,h,f,u)?this.resetTo(s,i,a,c,1):(P0(this,0),this.parent||EA(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?bd(this):this.scrollTrigger&&this.scrollTrigger.kill(!!$n),this;if(this.timeline){var a=this.timeline.totalDuration();return this.timeline.killTweensOf(s,i,Qo&&Qo.vars.overwrite!==!0)._first||bd(this),this.parent&&a!==this.timeline.totalDuration()&&su(this,this._dur*this.timeline._tDur/a,0,1),this}var c=this._targets,u=s?vs(s):c,f=this._ptLookup,h=this._pt,p,m,_,x,y,w,S;if((!i||i==="all")&&pZ(c,u))return i==="all"&&(this._pt=0),bd(this);for(p=this._op=this._op||[],i!=="all"&&(Rn(i)&&(y={},Ar(i,function(T){return y[T]=1}),i=y),i=VZ(c,i)),S=c.length;S--;)if(~u.indexOf(c[S])){m=f[S],i==="all"?(p[S]=i,x=m,_={}):(_=p[S]=p[S]||{},x=i);for(y in x)w=m&&m[y],w&&((!("kill"in w.d)||w.d.kill(y)===!0)&&C0(this,w,"_pt"),delete m[y]),_!=="all"&&(_[y]=1)}return this._initted&&!this._pt&&h&&bd(this),this},e.to=function(s,i){return new e(s,i,arguments[2])},e.from=function(s,i){return jd(1,arguments)},e.delayedCall=function(s,i,a,c){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:s,onComplete:i,onReverseComplete:i,onCompleteParams:a,onReverseCompleteParams:a,callbackScope:c})},e.fromTo=function(s,i,a){return jd(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,a){return Kt.killTweensOf(s,i,a)},e})(gf);ts(gn.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});Ar("staggerTo,staggerFrom,staggerFromTo",function(t){gn[t]=function(){var e=new Cr,n=q_.call(arguments,0);return n.splice(t==="staggerFromTo"?5:4,0,0),e[t].apply(e,n)}});var iw=function(e,n,r){return e[n]=r},WA=function(e,n,r){return e[n](r)},HZ=function(e,n,r,s){return e[n](s.fp,r)},zZ=function(e,n,r){return e.setAttribute(n,r)},ow=function(e,n){return en(e[n])?WA:qx(e[n])&&e.setAttribute?zZ:iw},GA=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e6)/1e6,n)},UZ=function(e,n){return n.set(n.t,n.p,!!(n.s+n.c*e),n)},KA=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)},aw=function(e,n){for(var r=n._pt;r;)r.r(e,r.d),r=r._next},BZ=function(e,n,r,s){for(var i=this._pt,a;i;)a=i._next,i.p===s&&i.modifier(e,n,r),i=a},WZ=function(e){for(var n=this._pt,r,s;n;)s=n._next,n.p===e&&!n.op||n.op===e?C0(this,n,"_pt"):n.dep||(r=1),n=s;return!r},GZ=function(e,n,r,s){s.mSet(e,n,s.m.call(s.tween,r,s.mt),s)},ZA=function(e){for(var n=e._pt,r,s,i,a;n;){for(r=n._next,s=i;s&&s.pr>n.pr;)s=s._next;(n._prev=s?s._prev:a)?n._prev._next=n:i=n,(n._next=s)?s._prev=n:a=n,n=r}e._pt=i},Ir=(function(){function t(n,r,s,i,a,c,u,f,h){this.t=r,this.s=i,this.c=a,this.p=s,this.r=c||GA,this.d=u||this,this.set=f||iw,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=GZ,this.m=r,this.mt=i,this.tween=s},t})();Ar(ew+"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 Jx[t]=1});es.TweenMax=es.TweenLite=gn;es.TimelineLite=es.TimelineMax=Cr;Kt=new Cr({sortChildren:!1,defaults:df,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Qr.stringFilter=VA;var El=[],Gp={},KZ=[],Jk=0,ZZ=0,I1=function(e){return(Gp[e]||KZ).map(function(n){return n()})},J_=function(){var e=Date.now(),n=[];e-Jk>2&&(I1("matchMediaInit"),El.forEach(function(r){var s=r.queries,i=r.conditions,a,c,u,f;for(c in s)a=oi.matchMedia(s[c]).matches,a&&(u=1),a!==i[c]&&(i[c]=a,f=1);f&&(r.revert(),u&&n.push(r))}),I1("matchMediaRevert"),n.forEach(function(r){return r.onMatch(r,function(s){return r.add(null,s)})}),Jk=e,I1("matchMedia"))},qA=(function(){function t(n,r){this.selector=r&&Y_(r),this.data=[],this._r=[],this.isReverted=!1,this.id=ZZ++,n&&this.add(n)}var e=t.prototype;return e.add=function(r,s,i){en(r)&&(i=s,s=r,r=en);var a=this,c=function(){var f=Ut,h=a.selector,p;return f&&f!==a&&f.data.push(a),i&&(a.selector=Y_(i)),Ut=a,p=s.apply(a,arguments),en(p)&&a._r.push(p),Ut=f,a.selector=h,a.isReverted=!1,p};return a.last=c,r===en?c(a,function(u){return a.add(null,u)}):r?a[r]=c:c},e.ignore=function(r){var s=Ut;Ut=null,r(this),Ut=s},e.getTweens=function(){var r=[];return this.data.forEach(function(s){return s instanceof t?r.push.apply(r,s.getTweens()):s instanceof gn&&!(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 c=i.getTweens(),u=i.data.length,f;u--;)f=i.data[u],f.data==="isFlip"&&(f.revert(),f.getChildren(!0,!0,!1).forEach(function(h){return c.splice(c.indexOf(h),1)}));for(c.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--;)f=i.data[u],f instanceof Cr?f.data!=="nested"&&(f.scrollTrigger&&f.scrollTrigger.revert(),f.kill()):!(f instanceof gn)&&f.revert&&f.revert(r);i._r.forEach(function(h){return h(r,i)}),i.isReverted=!0})():this.data.forEach(function(c){return c.kill&&c.kill()}),this.clear(),s)for(var a=El.length;a--;)El[a].id===this.id&&El.splice(a,1)},e.revert=function(r){this.kill(r||{})},t})(),qZ=(function(){function t(n){this.contexts=[],this.scope=n,Ut&&Ut.data.push(this)}var e=t.prototype;return e.add=function(r,s,i){xi(r)||(r={matches:r});var a=new qA(0,i||this.scope),c=a.conditions={},u,f,h;Ut&&!a.selector&&(a.selector=Ut.selector),this.contexts.push(a),s=a.add("onMatch",s),a.queries=r;for(f in r)f==="all"?h=1:(u=oi.matchMedia(r[f]),u&&(El.indexOf(a)<0&&El.push(a),(c[f]=u.matches)&&(h=1),u.addListener?u.addListener(J_):u.addEventListener("change",J_)));return h&&s(a,function(p){return a.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})(),qm={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 DA(s)})},timeline:function(e){return new Cr(e)},getTweensOf:function(e,n){return Kt.getTweensOf(e,n)},getProperty:function(e,n,r,s){Rn(e)&&(e=vs(e)[0]);var i=wl(e||{}).get,a=r?SA:bA;return r==="native"&&(r=""),e&&(n?a((Wr[n]&&Wr[n].get||i)(e,n,r,s)):function(c,u,f){return a((Wr[c]&&Wr[c].get||i)(e,c,u,f))})},quickSetter:function(e,n,r){if(e=vs(e),e.length>1){var s=e.map(function(h){return Or.quickSetter(h,n,r)}),i=s.length;return function(h){for(var p=i;p--;)s[p](h)}}e=e[0]||{};var a=Wr[n],c=wl(e),u=c.harness&&(c.harness.aliases||{})[n]||n,f=a?function(h){var p=new a;Ec._pt=0,p.init(e,r?h+r:h,Ec,0,[e]),p.render(1,p),Ec._pt&&aw(1,Ec)}:c.set(e,u);return a?f:function(h){return f(e,u,r?h+r:h,c,1)}},quickTo:function(e,n,r){var s,i=Or.to(e,ts((s={},s[n]="+=0.1",s.paused=!0,s.stagger=0,s),r||{})),a=function(u,f,h){return i.resetTo(n,u,f,h)};return a.tween=i,a},isTweening:function(e){return Kt.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=Sl(e.ease,df.ease)),Zk(df,e||{})},config:function(e){return Zk(Qr,e||{})},registerEffect:function(e){var n=e.name,r=e.effect,s=e.plugins,i=e.defaults,a=e.extendTimeline;(s||"").split(",").forEach(function(c){return c&&!Wr[c]&&!es[c]&&ff(n+" effect requires "+c+" plugin.")}),P1[n]=function(c,u,f){return r(vs(c),ts(u||{},i),f)},a&&(Cr.prototype[n]=function(c,u,f){return this.add(P1[n](c,xi(u)?u:(f=u)&&{},this),f)})},registerEase:function(e,n){ct[e]=Sl(n)},parseEase:function(e,n){return arguments.length?Sl(e,n):ct},getById:function(e){return Kt.getById(e)},exportRoot:function(e,n){e===void 0&&(e={});var r=new Cr(e),s,i;for(r.smoothChildTiming=Rr(e.smoothChildTiming),Kt.remove(r),r._dp=0,r._time=r._tTime=Kt._time,s=Kt._first;s;)i=s._next,(n||!(!s._dur&&s instanceof gn&&s.vars.onComplete===s._targets[0]))&&fi(r,s,s._start-s._delay),s=i;return fi(Kt,r,0),r},context:function(e,n){return e?new qA(e,n):Ut},matchMedia:function(e){return new qZ(e)},matchMediaRefresh:function(){return El.forEach(function(e){var n=e.conditions,r,s;for(s in n)n[s]&&(n[s]=!1,r=1);r&&e.revert()})||J_()},addEventListener:function(e,n){var r=Gp[e]||(Gp[e]=[]);~r.indexOf(n)||r.push(n)},removeEventListener:function(e,n){var r=Gp[e],s=r&&r.indexOf(n);s>=0&&r.splice(s,1)},utils:{wrap:kZ,wrapYoyo:PZ,distribute:AA,random:MA,snap:IA,normalize:CZ,getUnit:qn,clamp:wZ,splitColor:jA,toArray:vs,selector:Y_,mapRange:LA,pipe:SZ,unitize:EZ,interpolate:TZ,shuffle:RA},install:vA,effects:P1,ticker:Gr,updateRoot:Cr.updateRoot,plugins:Wr,globalTimeline:Kt,core:{PropTween:Ir,globals:yA,Tween:gn,Timeline:Cr,Animation:gf,getCache:wl,_removeLinkedListItem:C0,reverting:function(){return $n},context:function(e){return e&&Ut&&(Ut.data.push(e),e._ctx=Ut),Ut},suppressOverwrites:function(e){return Zx=e}}};Ar("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return qm[t]=gn[t]});Gr.add(Cr.updateRoot);Ec=qm.to({},{duration:0});var YZ=function(e,n){for(var r=e._pt;r&&r.p!==n&&r.op!==n&&r.fp!==n;)r=r._next;return r},XZ=function(e,n){var r=e._targets,s,i,a;for(s in n)for(i=r.length;i--;)a=e._ptLookup[i][s],a&&(a=a.d)&&(a._pt&&(a=YZ(a,s)),a&&a.modifier&&a.modifier(n[s],e,r[i],s))},M1=function(e,n){return{name:e,headless:1,rawVars:1,init:function(s,i,a){a._onInit=function(c){var u,f;if(Rn(i)&&(u={},Ar(i,function(h){return u[h]=1}),i=u),n){u={};for(f in i)u[f]=n(i[f]);i=u}XZ(c,i)}}}},Or=qm.registerPlugin({name:"attr",init:function(e,n,r,s,i){var a,c,u;this.tween=r;for(a in n)u=e.getAttribute(a)||"",c=this.add(e,"setAttribute",(u||0)+"",n[a],s,i,0,0,a),c.op=a,c.b=u,this._props.push(a)},render:function(e,n){for(var r=n._pt;r;)$n?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)}},M1("roundProps",X_),M1("modifiers"),M1("snap",IA))||qm;gn.version=Cr.version=Or.version="3.15.0";gA=1;Yx()&&iu();ct.Power0;ct.Power1;ct.Power2;ct.Power3;ct.Power4;ct.Linear;ct.Quad;ct.Cubic;ct.Quart;ct.Quint;ct.Strong;ct.Elastic;ct.Back;ct.SteppedEase;ct.Bounce;ct.Sine;ct.Expo;ct.Circ;/*!
|
|
122
|
+
* CSSPlugin 3.15.0
|
|
123
|
+
* https://gsap.com
|
|
124
|
+
*
|
|
125
|
+
* Copyright 2008-2026, GreenSock. All rights reserved.
|
|
126
|
+
* Subject to the terms at https://gsap.com/standard-license
|
|
127
|
+
* @author: Jack Doyle, jack@greensock.com
|
|
128
|
+
*/var e8,Jo,Mc,lw,al,t8,cw,QZ=function(){return typeof window<"u"},mo={},el=180/Math.PI,Oc=Math.PI/180,dc=Math.atan2,n8=1e8,uw=/([A-Z])/g,JZ=/(left|right|width|margin|padding|x)/i,eq=/[\s,\(]\S/,mi={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},e2=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},tq=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)},nq=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)},rq=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)},sq=function(e,n){var r=n.s+n.c*e;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},YA=function(e,n){return n.set(n.t,n.p,e?n.e:n.b,n)},XA=function(e,n){return n.set(n.t,n.p,e!==1?n.b:n.e,n)},iq=function(e,n,r){return e.style[n]=r},oq=function(e,n,r){return e.style.setProperty(n,r)},aq=function(e,n,r){return e._gsap[n]=r},lq=function(e,n,r){return e._gsap.scaleX=e._gsap.scaleY=r},cq=function(e,n,r,s,i){var a=e._gsap;a.scaleX=a.scaleY=r,a.renderTransform(i,a)},uq=function(e,n,r,s,i){var a=e._gsap;a[n]=r,a.renderTransform(i,a)},Zt="transform",Mr=Zt+"Origin",dq=function t(e,n){var r=this,s=this.target,i=s.style,a=s._gsap;if(e in mo&&i){if(this.tfm=this.tfm||{},e!=="transform")e=mi[e]||e,~e.indexOf(",")?e.split(",").forEach(function(c){return r.tfm[c]=Xi(s,c)}):this.tfm[e]=a.x?a[e]:Xi(s,e),e===Mr&&(this.tfm.zOrigin=a.zOrigin);else return mi.transform.split(",").forEach(function(c){return t.call(r,c,n)});if(this.props.indexOf(Zt)>=0)return;a.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push(Mr,n,"")),e=Zt}(i||n)&&this.props.push(e,n,i[e])},QA=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},fq=function(){var e=this.props,n=this.target,r=n.style,s=n._gsap,i,a;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(uw,"-$1").toLowerCase());if(this.tfm){for(a in this.tfm)s[a]=this.tfm[a];s.svg&&(s.renderTransform(),n.setAttribute("data-svg-origin",this.svgo||"")),i=cw(),(!i||!i.isStart)&&!r[Zt]&&(QA(r),s.zOrigin&&r[Mr]&&(r[Mr]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},JA=function(e,n){var r={target:e,props:[],revert:fq,save:dq};return e._gsap||Or.core.getCache(e),n&&e.style&&e.nodeType&&n.split(",").forEach(function(s){return r.save(s)}),r},eI,t2=function(e,n){var r=Jo.createElementNS?Jo.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):Jo.createElement(e);return r&&r.style?r:Jo.createElement(e)},qr=function t(e,n,r){var s=getComputedStyle(e);return s[n]||s.getPropertyValue(n.replace(uw,"-$1").toLowerCase())||s.getPropertyValue(n)||!r&&t(e,ou(n)||n,1)||""},r8="O,Moz,ms,Ms,Webkit".split(","),ou=function(e,n,r){var s=n||al,i=s.style,a=5;if(e in i&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);a--&&!(r8[a]+e in i););return a<0?null:(a===3?"ms":a>=0?r8[a]:"")+e},n2=function(){QZ()&&window.document&&(e8=window,Jo=e8.document,Mc=Jo.documentElement,al=t2("div")||{style:{}},t2("div"),Zt=ou(Zt),Mr=Zt+"Origin",al.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",eI=!!ou("perspective"),cw=Or.core.reverting,lw=1)},s8=function(e){var n=e.ownerSVGElement,r=t2("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=e.cloneNode(!0),i;s.style.display="block",r.appendChild(s),Mc.appendChild(r);try{i=s.getBBox()}catch{}return r.removeChild(s),Mc.removeChild(r),i},i8=function(e,n){for(var r=n.length;r--;)if(e.hasAttribute(n[r]))return e.getAttribute(n[r])},tI=function(e){var n,r;try{n=e.getBBox()}catch{n=s8(e),r=1}return n&&(n.width||n.height)||r||(n=s8(e)),n&&!n.width&&!n.x&&!n.y?{x:+i8(e,["x","cx","x1"])||0,y:+i8(e,["y","cy","y1"])||0,width:0,height:0}:n},nI=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&tI(e))},pa=function(e,n){if(n){var r=e.style,s;n in mo&&n!==Mr&&(n=Zt),r.removeProperty?(s=n.substr(0,2),(s==="ms"||n.substr(0,6)==="webkit")&&(n="-"+n),r.removeProperty(s==="--"?n:n.replace(uw,"-$1").toLowerCase())):r.removeAttribute(n)}},ea=function(e,n,r,s,i,a){var c=new Ir(e._pt,n,r,0,1,a?XA:YA);return e._pt=c,c.b=s,c.e=i,e._props.push(r),c},o8={deg:1,rad:1,turn:1},hq={grid:1,flex:1},ma=function t(e,n,r,s){var i=parseFloat(r)||0,a=(r+"").trim().substr((i+"").length)||"px",c=al.style,u=JZ.test(n),f=e.tagName.toLowerCase()==="svg",h=(f?"client":"offset")+(u?"Width":"Height"),p=100,m=s==="px",_=s==="%",x,y,w,S;if(s===a||!i||o8[s]||o8[a])return i;if(a!=="px"&&!m&&(i=t(e,n,r,"px")),S=e.getCTM&&nI(e),(_||a==="%")&&(mo[n]||~n.indexOf("adius")))return x=S?e.getBBox()[u?"width":"height"]:e[h],an(_?i/x*p:i/100*x);if(c[u?"width":"height"]=p+(m?a:s),y=s!=="rem"&&~n.indexOf("adius")||s==="em"&&e.appendChild&&!f?e:e.parentNode,S&&(y=(e.ownerSVGElement||{}).parentNode),(!y||y===Jo||!y.appendChild)&&(y=Jo.body),w=y._gsap,w&&_&&w.width&&u&&w.time===Gr.time&&!w.uncache)return an(i/w.width*p);if(_&&(n==="height"||n==="width")){var T=e.style[n];e.style[n]=p+s,x=e[h],T?e.style[n]=T:pa(e,n)}else(_||a==="%")&&!hq[qr(y,"display")]&&(c.position=qr(e,"position")),y===e&&(c.position="static"),y.appendChild(al),x=al[h],y.removeChild(al),c.position="absolute";return u&&_&&(w=wl(y),w.time=Gr.time,w.width=y[h]),an(m?x*i/p:x&&i?p/x*i:0)},Xi=function(e,n,r,s){var i;return lw||n2(),n in mi&&n!=="transform"&&(n=mi[n],~n.indexOf(",")&&(n=n.split(",")[0])),mo[n]&&n!=="transform"?(i=yf(e,s),i=n!=="transformOrigin"?i[n]:i.svg?i.origin:Xm(qr(e,Mr))+" "+i.zOrigin+"px"):(i=e.style[n],(!i||i==="auto"||s||~(i+"").indexOf("calc("))&&(i=Ym[n]&&Ym[n](e,n,r)||qr(e,n)||xA(e,n)||(n==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?ma(e,n,i,r)+r:i},pq=function(e,n,r,s){if(!r||r==="none"){var i=ou(n,e,1),a=i&&qr(e,i,1);a&&a!==r?(n=i,r=a):n==="borderColor"&&(r=qr(e,"borderTopColor"))}var c=new Ir(this._pt,e.style,n,0,1,KA),u=0,f=0,h,p,m,_,x,y,w,S,T,P,k,R;if(c.b=r,c.e=s,r+="",s+="",s.substring(0,6)==="var(--"&&(s=qr(e,s.substring(4,s.indexOf(")")))),s==="auto"&&(y=e.style[n],e.style[n]=s,s=qr(e,n)||s,y?e.style[n]=y:pa(e,n)),h=[r,s],VA(h),r=h[0],s=h[1],m=r.match(Sc)||[],R=s.match(Sc)||[],R.length){for(;p=Sc.exec(s);)w=p[0],T=s.substring(u,p.index),x?x=(x+1)%5:(T.substr(-5)==="rgba("||T.substr(-5)==="hsla(")&&(x=1),w!==(y=m[f++]||"")&&(_=parseFloat(y)||0,k=y.substr((_+"").length),w.charAt(1)==="="&&(w=Ic(_,w)+k),S=parseFloat(w),P=w.substr((S+"").length),u=Sc.lastIndex-P.length,P||(P=P||Qr.units[n]||k,u===s.length&&(s+=P,c.e+=P)),k!==P&&(_=ma(e,n,y,P)||0),c._pt={_next:c._pt,p:T||f===1?T:",",s:_,c:S-_,m:x&&x<4||n==="zIndex"?Math.round:0});c.c=u<s.length?s.substring(u,s.length):""}else c.r=n==="display"&&s==="none"?XA:YA;return mA.test(s)&&(c.e=0),this._pt=c,c},a8={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},mq=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]=a8[r]||r,n[1]=a8[s]||s,n.join(" ")},gq=function(e,n){if(n.tween&&n.tween._time===n.tween._dur){var r=n.t,s=r.style,i=n.u,a=r._gsap,c,u,f;if(i==="all"||i===!0)s.cssText="",u=1;else for(i=i.split(","),f=i.length;--f>-1;)c=i[f],mo[c]&&(u=1,c=c==="transformOrigin"?Mr:Zt),pa(r,c);u&&(pa(r,Zt),a&&(a.svg&&r.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",yf(r,1),a.uncache=1,QA(s)))}},Ym={clearProps:function(e,n,r,s,i){if(i.data!=="isFromStart"){var a=e._pt=new Ir(e._pt,n,r,0,0,gq);return a.u=s,a.pr=-10,a.tween=i,e._props.push(r),1}}},vf=[1,0,0,1,0,0],rI={},sI=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},l8=function(e){var n=qr(e,Zt);return sI(n)?vf:n.substr(7).match(pA).map(an)},dw=function(e,n){var r=e._gsap||wl(e),s=e.style,i=l8(e),a,c,u,f;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"?vf:i):(i===vf&&!e.offsetParent&&e!==Mc&&!r.svg&&(u=s.display,s.display="block",a=e.parentNode,(!a||!e.offsetParent&&!e.getBoundingClientRect().width)&&(f=1,c=e.nextElementSibling,Mc.appendChild(e)),i=l8(e),u?s.display=u:pa(e,"display"),f&&(c?a.insertBefore(e,c):a?a.appendChild(e):Mc.removeChild(e))),n&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},r2=function(e,n,r,s,i,a){var c=e._gsap,u=i||dw(e,!0),f=c.xOrigin||0,h=c.yOrigin||0,p=c.xOffset||0,m=c.yOffset||0,_=u[0],x=u[1],y=u[2],w=u[3],S=u[4],T=u[5],P=n.split(" "),k=parseFloat(P[0])||0,R=parseFloat(P[1])||0,L,O,A,I;r?u!==vf&&(O=_*w-x*y)&&(A=k*(w/O)+R*(-y/O)+(y*T-w*S)/O,I=k*(-x/O)+R*(_/O)-(_*T-x*S)/O,k=A,R=I):(L=tI(e),k=L.x+(~P[0].indexOf("%")?k/100*L.width:k),R=L.y+(~(P[1]||P[0]).indexOf("%")?R/100*L.height:R)),s||s!==!1&&c.smooth?(S=k-f,T=R-h,c.xOffset=p+(S*_+T*y)-S,c.yOffset=m+(S*x+T*w)-T):c.xOffset=c.yOffset=0,c.xOrigin=k,c.yOrigin=R,c.smooth=!!s,c.origin=n,c.originIsAbsolute=!!r,e.style[Mr]="0px 0px",a&&(ea(a,c,"xOrigin",f,k),ea(a,c,"yOrigin",h,R),ea(a,c,"xOffset",p,c.xOffset),ea(a,c,"yOffset",m,c.yOffset)),e.setAttribute("data-svg-origin",k+" "+R)},yf=function(e,n){var r=e._gsap||new HA(e);if("x"in r&&!n&&!r.uncache)return r;var s=e.style,i=r.scaleX<0,a="px",c="deg",u=getComputedStyle(e),f=qr(e,Mr)||"0",h,p,m,_,x,y,w,S,T,P,k,R,L,O,A,I,N,j,F,K,X,W,G,q,$,ne,z,D,Y,ee,ie,oe;return h=p=m=y=w=S=T=P=k=0,_=x=1,r.svg=!!(e.getCTM&&nI(e)),u.translate&&((u.translate!=="none"||u.scale!=="none"||u.rotate!=="none")&&(s[Zt]=(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[Zt]!=="none"?u[Zt]:"")),s.scale=s.rotate=s.translate="none"),O=dw(e,r.svg),r.svg&&(r.uncache?($=e.getBBox(),f=r.xOrigin-$.x+"px "+(r.yOrigin-$.y)+"px",q=""):q=!n&&e.getAttribute("data-svg-origin"),r2(e,q||f,!!q||r.originIsAbsolute,r.smooth!==!1,O)),R=r.xOrigin||0,L=r.yOrigin||0,O!==vf&&(j=O[0],F=O[1],K=O[2],X=O[3],h=W=O[4],p=G=O[5],O.length===6?(_=Math.sqrt(j*j+F*F),x=Math.sqrt(X*X+K*K),y=j||F?dc(F,j)*el:0,T=K||X?dc(K,X)*el+y:0,T&&(x*=Math.abs(Math.cos(T*Oc))),r.svg&&(h-=R-(R*j+L*K),p-=L-(R*F+L*X))):(oe=O[6],ee=O[7],z=O[8],D=O[9],Y=O[10],ie=O[11],h=O[12],p=O[13],m=O[14],A=dc(oe,Y),w=A*el,A&&(I=Math.cos(-A),N=Math.sin(-A),q=W*I+z*N,$=G*I+D*N,ne=oe*I+Y*N,z=W*-N+z*I,D=G*-N+D*I,Y=oe*-N+Y*I,ie=ee*-N+ie*I,W=q,G=$,oe=ne),A=dc(-K,Y),S=A*el,A&&(I=Math.cos(-A),N=Math.sin(-A),q=j*I-z*N,$=F*I-D*N,ne=K*I-Y*N,ie=X*N+ie*I,j=q,F=$,K=ne),A=dc(F,j),y=A*el,A&&(I=Math.cos(A),N=Math.sin(A),q=j*I+F*N,$=W*I+G*N,F=F*I-j*N,G=G*I-W*N,j=q,W=$),w&&Math.abs(w)+Math.abs(y)>359.9&&(w=y=0,S=180-S),_=an(Math.sqrt(j*j+F*F+K*K)),x=an(Math.sqrt(G*G+oe*oe)),A=dc(W,G),T=Math.abs(A)>2e-4?A*el:0,k=ie?1/(ie<0?-ie:ie):0),r.svg&&(q=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!sI(qr(e,Zt)),q&&e.setAttribute("transform",q))),Math.abs(T)>90&&Math.abs(T)<270&&(i?(_*=-1,T+=y<=0?180:-180,y+=y<=0?180:-180):(x*=-1,T+=T<=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)+a,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)+a,r.z=m+a,r.scaleX=an(_),r.scaleY=an(x),r.rotation=an(y)+c,r.rotationX=an(w)+c,r.rotationY=an(S)+c,r.skewX=T+c,r.skewY=P+c,r.transformPerspective=k+a,(r.zOrigin=parseFloat(f.split(" ")[2])||!n&&r.zOrigin||0)&&(s[Mr]=Xm(f)),r.xOffset=r.yOffset=0,r.force3D=Qr.force3D,r.renderTransform=r.svg?yq:eI?iI:vq,r.uncache=0,r},Xm=function(e){return(e=e.split(" "))[0]+" "+e[1]},O1=function(e,n,r){var s=qn(n);return an(parseFloat(n)+parseFloat(ma(e,"x",r+"px",s)))+s},vq=function(e,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,iI(e,n)},Za="0deg",hd="0px",qa=") ",iI=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,a=r.x,c=r.y,u=r.z,f=r.rotation,h=r.rotationY,p=r.rotationX,m=r.skewX,_=r.skewY,x=r.scaleX,y=r.scaleY,w=r.transformPerspective,S=r.force3D,T=r.target,P=r.zOrigin,k="",R=S==="auto"&&e&&e!==1||S===!0;if(P&&(p!==Za||h!==Za)){var L=parseFloat(h)*Oc,O=Math.sin(L),A=Math.cos(L),I;L=parseFloat(p)*Oc,I=Math.cos(L),a=O1(T,a,O*I*-P),c=O1(T,c,-Math.sin(L)*-P),u=O1(T,u,A*I*-P+P)}w!==hd&&(k+="perspective("+w+qa),(s||i)&&(k+="translate("+s+"%, "+i+"%) "),(R||a!==hd||c!==hd||u!==hd)&&(k+=u!==hd||R?"translate3d("+a+", "+c+", "+u+") ":"translate("+a+", "+c+qa),f!==Za&&(k+="rotate("+f+qa),h!==Za&&(k+="rotateY("+h+qa),p!==Za&&(k+="rotateX("+p+qa),(m!==Za||_!==Za)&&(k+="skew("+m+", "+_+qa),(x!==1||y!==1)&&(k+="scale("+x+", "+y+qa),T.style[Zt]=k||"translate(0, 0)"},yq=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,a=r.x,c=r.y,u=r.rotation,f=r.skewX,h=r.skewY,p=r.scaleX,m=r.scaleY,_=r.target,x=r.xOrigin,y=r.yOrigin,w=r.xOffset,S=r.yOffset,T=r.forceCSS,P=parseFloat(a),k=parseFloat(c),R,L,O,A,I;u=parseFloat(u),f=parseFloat(f),h=parseFloat(h),h&&(h=parseFloat(h),f+=h,u+=h),u||f?(u*=Oc,f*=Oc,R=Math.cos(u)*p,L=Math.sin(u)*p,O=Math.sin(u-f)*-m,A=Math.cos(u-f)*m,f&&(h*=Oc,I=Math.tan(f-h),I=Math.sqrt(1+I*I),O*=I,A*=I,h&&(I=Math.tan(h),I=Math.sqrt(1+I*I),R*=I,L*=I)),R=an(R),L=an(L),O=an(O),A=an(A)):(R=p,A=m,L=O=0),(P&&!~(a+"").indexOf("px")||k&&!~(c+"").indexOf("px"))&&(P=ma(_,"x",a,"px"),k=ma(_,"y",c,"px")),(x||y||w||S)&&(P=an(P+x-(x*R+y*O)+w),k=an(k+y-(x*L+y*A)+S)),(s||i)&&(I=_.getBBox(),P=an(P+s/100*I.width),k=an(k+i/100*I.height)),I="matrix("+R+","+L+","+O+","+A+","+P+","+k+")",_.setAttribute("transform",I),T&&(_.style[Zt]=I)},_q=function(e,n,r,s,i){var a=360,c=Rn(i),u=parseFloat(i)*(c&&~i.indexOf("rad")?el:1),f=u-s,h=s+f+"deg",p,m;return c&&(p=i.split("_")[1],p==="short"&&(f%=a,f!==f%(a/2)&&(f+=f<0?a:-a)),p==="cw"&&f<0?f=(f+a*n8)%a-~~(f/a)*a:p==="ccw"&&f>0&&(f=(f-a*n8)%a-~~(f/a)*a)),e._pt=m=new Ir(e._pt,n,r,s,f,tq),m.e=h,m.u="deg",e._props.push(r),m},c8=function(e,n){for(var r in n)e[r]=n[r];return e},xq=function(e,n,r){var s=c8({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",a=r.style,c,u,f,h,p,m,_,x;s.svg?(f=r.getAttribute("transform"),r.setAttribute("transform",""),a[Zt]=n,c=yf(r,1),pa(r,Zt),r.setAttribute("transform",f)):(f=getComputedStyle(r)[Zt],a[Zt]=n,c=yf(r,1),a[Zt]=f);for(u in mo)f=s[u],h=c[u],f!==h&&i.indexOf(u)<0&&(_=qn(f),x=qn(h),p=_!==x?ma(r,u,f,x):parseFloat(f),m=parseFloat(h),e._pt=new Ir(e._pt,c,u,p,m-p,e2),e._pt.u=x||0,e._props.push(u));c8(c,s)};Ar("padding,margin,Width,Radius",function(t,e){var n="Top",r="Right",s="Bottom",i="Left",a=(e<3?[n,r,s,i]:[n+i,n+r,s+r,s+i]).map(function(c){return e<2?t+c:"border"+c+t});Ym[e>1?"border"+t:t]=function(c,u,f,h,p){var m,_;if(arguments.length<4)return m=a.map(function(x){return Xi(c,x,f)}),_=m.join(" "),_.split(m[0]).length===5?m[0]:_;m=(h+"").split(" "),_={},a.forEach(function(x,y){return _[x]=m[y]=m[y]||m[(y-1)/2|0]}),c.init(u,_,p)}});var oI={name:"css",register:n2,targetTest:function(e){return e.style&&e.nodeType},init:function(e,n,r,s,i){var a=this._props,c=e.style,u=r.vars.startAt,f,h,p,m,_,x,y,w,S,T,P,k,R,L,O,A,I;lw||n2(),this.styles=this.styles||JA(e),A=this.styles.props,this.tween=r;for(y in n)if(y!=="autoRound"&&(h=n[y],!(Wr[y]&&zA(y,n,r,s,e,i)))){if(_=typeof h,x=Ym[y],_==="function"&&(h=h.call(r,s,e,i),_=typeof h),_==="string"&&~h.indexOf("random(")&&(h=pf(h)),x)x(this,e,y,h,r)&&(O=1);else if(y.substr(0,2)==="--")f=(getComputedStyle(e).getPropertyValue(y)+"").trim(),h+="",ia.lastIndex=0,ia.test(f)||(w=qn(f),S=qn(h),S?w!==S&&(f=ma(e,y,f,S)+S):w&&(h+=w)),this.add(c,"setProperty",f,h,s,i,0,0,y),a.push(y),A.push(y,0,c[y]);else if(_!=="undefined"){if(u&&y in u?(f=typeof u[y]=="function"?u[y].call(r,s,e,i):u[y],Rn(f)&&~f.indexOf("random(")&&(f=pf(f)),qn(f+"")||f==="auto"||(f+=Qr.units[y]||qn(Xi(e,y))||""),(f+"").charAt(1)==="="&&(f=Xi(e,y))):f=Xi(e,y),m=parseFloat(f),T=_==="string"&&h.charAt(1)==="="&&h.substr(0,2),T&&(h=h.substr(2)),p=parseFloat(h),y in mi&&(y==="autoAlpha"&&(m===1&&Xi(e,"visibility")==="hidden"&&p&&(m=0),A.push("visibility",0,c.visibility),ea(this,c,"visibility",m?"inherit":"hidden",p?"inherit":"hidden",!p)),y!=="scale"&&y!=="transform"&&(y=mi[y],~y.indexOf(",")&&(y=y.split(",")[0]))),P=y in mo,P){if(this.styles.save(y),I=h,_==="string"&&h.substring(0,6)==="var(--"){if(h=qr(e,h.substring(4,h.indexOf(")"))),h.substring(0,5)==="calc("){var N=e.style.perspective;e.style.perspective=h,h=qr(e,"perspective"),N?e.style.perspective=N:pa(e,"perspective")}p=parseFloat(h)}if(k||(R=e._gsap,R.renderTransform&&!n.parseTransform||yf(e,n.parseTransform),L=n.smoothOrigin!==!1&&R.smooth,k=this._pt=new Ir(this._pt,c,Zt,0,1,R.renderTransform,R,0,-1),k.dep=1),y==="scale")this._pt=new Ir(this._pt,R,"scaleY",R.scaleY,(T?Ic(R.scaleY,T+p):p)-R.scaleY||0,e2),this._pt.u=0,a.push("scaleY",y),y+="X";else if(y==="transformOrigin"){A.push(Mr,0,c[Mr]),h=mq(h),R.svg?r2(e,h,0,L,0,this):(S=parseFloat(h.split(" ")[2])||0,S!==R.zOrigin&&ea(this,R,"zOrigin",R.zOrigin,S),ea(this,c,y,Xm(f),Xm(h)));continue}else if(y==="svgOrigin"){r2(e,h,1,L,0,this);continue}else if(y in rI){_q(this,R,y,m,T?Ic(m,T+h):h);continue}else if(y==="smoothOrigin"){ea(this,R,"smooth",R.smooth,h);continue}else if(y==="force3D"){R[y]=h;continue}else if(y==="transform"){xq(this,h,e);continue}}else y in c||(y=ou(y)||y);if(P||(p||p===0)&&(m||m===0)&&!eq.test(h)&&y in c)w=(f+"").substr((m+"").length),p||(p=0),S=qn(h)||(y in Qr.units?Qr.units[y]:w),w!==S&&(m=ma(e,y,f,S)),this._pt=new Ir(this._pt,P?R:c,y,m,(T?Ic(m,T+p):p)-m,!P&&(S==="px"||y==="zIndex")&&n.autoRound!==!1?sq:e2),this._pt.u=S||0,P&&I!==h?(this._pt.b=f,this._pt.e=I,this._pt.r=rq):w!==S&&S!=="%"&&(this._pt.b=f,this._pt.r=nq);else if(y in c)pq.call(this,e,y,f,T?T+h:h);else if(y in e)this.add(e,y,f||e[y],T?T+h:h,s,i);else if(y!=="parseTransform"){Qx(y,h);continue}P||(y in c?A.push(y,0,c[y]):typeof e[y]=="function"?A.push(y,2,e[y]()):A.push(y,1,f||e[y])),a.push(y)}}O&&ZA(this)},render:function(e,n){if(n.tween._time||!cw())for(var r=n._pt;r;)r.r(e,r.d),r=r._next;else n.styles.revert()},get:Xi,aliases:mi,getSetter:function(e,n,r){var s=mi[n];return s&&s.indexOf(",")<0&&(n=s),n in mo&&n!==Mr&&(e._gsap.x||Xi(e,"x"))?r&&t8===r?n==="scale"?lq:aq:(t8=r||{})&&(n==="scale"?cq:uq):e.style&&!qx(e.style[n])?iq:~n.indexOf("-")?oq:ow(e,n)},core:{_removeProperty:pa,_getMatrix:dw}};Or.utils.checkPrefix=ou;Or.core.getStyleSaver=JA;(function(t,e,n,r){var s=Ar(t+","+e+","+n,function(i){mo[i]=1});Ar(e,function(i){Qr.units[i]="deg",rI[i]=1}),mi[s[13]]=t+","+e,Ar(r,function(i){var a=i.split(":");mi[a[1]]=s[a[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");Ar("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){Qr.units[t]="px"});Or.registerPlugin(oI);var Ls=Or.registerPlugin(oI)||Or;Ls.core.Tween;const Kp="/assets/logo-animation",L1=1280,wq=[{id:"eraser",src:`${Kp}/eraser.png`,cssW:189,cssH:74,rot:-90,fit:337,localX:60,localY:168,seaX:.2,seaY:.27,seaRot:-8},{id:"clasp",src:`${Kp}/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:`${Kp}/playdough.png`,cssW:236,cssH:206,rot:5,fit:150,localX:182,localY:277,seaX:.52,seaY:.79,seaRot:6}],bq=[{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}],s2=({className:t})=>{const e=v.useRef(null),n=v.useRef(null),r=v.useRef(null);return v.useEffect(()=>{const s=e.current,i=n.current,a=r.current;if(!s||!i||!a)return;const c=window.matchMedia("(prefers-reduced-motion: reduce)").matches,u=(S,T)=>S+Math.random()*(T-S);let f=null,h,p=1;const m=wq.map(S=>({...S})),_=()=>{s.querySelectorAll(".la-obj").forEach(A=>A.remove());const S=s.getBoundingClientRect(),T=S.width||L1,P=S.height||L1*.64;p=T/L1,i.style.width=`${242*p}px`,i.style.height=`${250*p}px`;const R=250*p/337,L=[],O=(A,I,N)=>{const j=document.createElement("div");return j.className="la-obj",j.style.width=`${I}px`,j.innerHTML=`<img src="${A}" alt="" style="${N?"transform:scaleX(-1)":""}">`,s.appendChild(j),j};return bq.forEach((A,I)=>{const N=A.w*p,j=O(`${Kp}/sea/${A.k}.png`,N,I%2===0);Ls.set(j,{x:A.x*T-N/2,y:A.y*P-N/2,rotation:A.r,opacity:1,scale:0,transformOrigin:"50% 50%"}),L.push({el:j,hero:!1,rest:1})}),m.forEach(A=>{const I=A.cssW*p;A.el=O(A.src,I,!!A.flip),A.finalScale=A.fit*R/(A.cssW*p),Ls.set(A.el,{x:A.seaX*T-I/2,y:A.seaY*P-A.cssH*p/2,rotation:A.seaRot,opacity:1,scale:0,transformOrigin:"50% 50%",zIndex:30}),L.push({el:A.el,hero:!0,rest:150/A.cssW})}),L},x=(S,T)=>{const P=s.getBoundingClientRect(),k=a.getBoundingClientRect();return{x:k.left-P.left+S/326*k.width,y:k.top-P.top+T/337*k.height}},y=()=>{f&&f.revert();const S=_();if(c){f=Ls.context(()=>{S.filter(k=>!k.hero).forEach(k=>Ls.set(k.el,{scale:0})),m.forEach(k=>{if(!k.el)return;const R=x(k.localX,k.localY);Ls.set(k.el,{x:R.x-k.cssW*p/2,y:R.y-k.cssH*p/2,rotation:k.rot,scale:k.finalScale})})},s);return}const T=[],P=[];f=Ls.context(()=>{const k=Ls.timeline();k.to(S.map(R=>R.el),{scale:R=>S[R].rest,duration:.5,ease:"steps(4)",stagger:{each:.045,from:"random"}}),k.add(()=>{S.forEach(({el:R,hero:L},O)=>{const A=L?T:P,I=O%2?1:-1;A.push(Ls.to(R,{rotation:"+="+u(2.5,6)*I,duration:u(.5,.9),repeat:-1,yoyo:!0,ease:"steps(2)",delay:u(0,.4)}),Ls.to(R,{y:"+="+u(5,11)*I,x:"+="+u(4,9)*-I,duration:u(.7,1.2),repeat:-1,yoyo:!0,ease:"steps(3)",delay:u(0,.4)}))})},"<0.1"),k.to({},{duration:1.1}),k.add("pick"),m.forEach((R,L)=>{R.el&&k.to(R.el,{scale:150/R.cssW*1.2,duration:.28,ease:"steps(3)",yoyo:!0,repeat:1},"pick+="+L*.08)}),k.add("clear","pick+=0.7"),k.add(()=>P.forEach(R=>R.kill()),"clear"),k.to(S.filter(R=>!R.hero).map(R=>R.el),{scale:0,rotation:"+=40",duration:.5,ease:"steps(5)",overwrite:"auto",stagger:{each:.025,from:"random"}},"clear"),k.add("assemble","clear+=0.25"),k.add(()=>T.forEach(R=>R.kill()),"assemble"),m.forEach((R,L)=>{if(!R.el||R.finalScale===void 0)return;const O=x(R.localX,R.localY);k.to(R.el,{x:O.x-R.cssW*p/2,y:O.y-R.cssH*p/2,rotation:R.rot,scale:R.finalScale,duration:1.05,ease:"steps(9)",overwrite:"auto"},"assemble+="+L*.12)}),m.forEach(R=>{!R.el||R.finalScale===void 0||k.to(R.el,{scale:R.finalScale*1.03,duration:.16,ease:"steps(2)",yoyo:!0,repeat:1},"assemble+=1.45")})},s)};Ls.ticker.fps(12),y();const w=()=>{clearTimeout(h),h=setTimeout(y,250)};return window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w),clearTimeout(h),f==null||f.revert(),s.querySelectorAll(".la-obj").forEach(S=>S.remove())}},[]),E.jsx("div",{ref:e,className:`la-scene ${t??""}`,children:E.jsx("div",{ref:n,className:"la-logo-stage",children:E.jsx("svg",{ref:r,className:"la-mark",viewBox:"0 0 326 337","aria-hidden":"true"})})})},Sq=Object.freeze(Object.defineProperty({__proto__:null,default:s2},Symbol.toStringTag,{value:"Module"})),u8=({isSigningIn:t})=>t?E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-current border-t-transparent"}),E.jsx("span",{children:"Signing in..."})]}):E.jsxs(E.Fragment,{children:[E.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"Google",className:"h-5 w-5"}),E.jsx("span",{children:"Sign in with Google"})]}),Eq=({isSigningIn:t,onStartSignIn:e,errorMessage:n=null,isDesktopShell:r=!1,displayMode:s="full"})=>s==="modal"?E.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:[E.jsx(s2,{className:"relative z-0 h-44 w-full"}),E.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-6 px-8 pb-12 pt-8",children:[E.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[E.jsx("h1",{className:"text-xl font-medium text-content",children:"Welcome to Rivet"}),E.jsx("p",{className:"text-sm leading-relaxed text-content-muted",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),E.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:E.jsx(u8,{isSigningIn:t})}),n?E.jsx("p",{className:"text-center text-xs text-red-200",children:n}):null]})]}):E.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-white font-main text-[#18181b]",children:[r?E.jsx("div",{className:"fixed left-0 right-0 top-0 z-10 h-8",style:{WebkitAppRegion:"drag"}}):null,E.jsx(s2,{className:"absolute inset-0 z-0"}),E.jsxs("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 flex flex-col items-center gap-5 pb-[14vh]",children:[E.jsxs("div",{className:"flex flex-col items-center gap-2 px-6 text-center",children:[E.jsx("h1",{className:"text-xl font-medium tracking-tight text-[#18181b]",children:"Welcome to Rivet"}),E.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."})]}),E.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:E.jsx(u8,{isSigningIn:t})}),n?E.jsx("p",{className:"text-center text-xs text-red-500",children:n}):null]})]}),Cq="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",kq=({message:t})=>E.jsx("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-[#1c1c20] font-main text-white",children:E.jsxs("div",{className:"flex flex-col items-center gap-10",children:[E.jsx("img",{src:Cq,alt:"Rivet",className:"h-8 w-auto object-contain"}),E.jsxs("div",{className:"glass-panel flex items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium",children:[E.jsx(p0,{className:"h-5 w-5 shrink-0 animate-spin text-primary",weight:"bold"}),E.jsx("span",{children:t})]})]})}),Pq="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",Qm=44,pd=8,wp=16,Tq=4,d8=-18,Rq=.18,Aq=[.22,1,.36,1],f8=.92,Iq=1,Mq=.95,Oq=.4,Lq=[.19,1,.22,1],N1=0,Nq=1,Dq=0,jq=0,Fq=0,aI=({position:t,viewport:e,boundsLeft:n=0})=>{const r=n+pd,s=Math.max(r,e.width-Qm-pd),i=Math.max(pd,e.height-Qm-pd);return{x:Math.min(s,Math.max(r,t.x)),y:Math.min(i,Math.max(pd,t.y))}},fw=()=>({width:window.innerWidth,height:window.innerHeight}),Vq=({position:t,boundsLeftPx:e=0})=>aI({position:t,viewport:fw(),boundsLeft:e}),$q=()=>{if(typeof window>"u")return{x:wp,y:wp};const t=fw();return{x:t.width-Qm-wp,y:t.height-Qm-wp}},Hq=({deltaX:t,deltaY:e})=>Math.hypot(t,e)>=Tq,zq=t=>t.button===void 0||t.button<=Fq,h8=t=>{const e=t.nativeEvent;return{x:Number.isFinite(t.clientX)?t.clientX:e.clientX,y:Number.isFinite(t.clientY)?t.clientY:e.clientY}},Uq=({isVisible:t,isPanelOpen:e,isReducedMotion:n,position:r,dragBoundsLeftPx:s=0,onToggle:i,onPositionChange:a})=>{const c=v.useRef(null),u=v.useRef(!1),[f,h]=v.useState(!1),[p,m]=v.useState(!1),_=n?!1:{opacity:N1,scale:f8,x:d8},x=n?{opacity:N1}:{opacity:N1,scale:f8,x:d8},y=n?{duration:jq}:{duration:Rq,ease:Aq,scale:{duration:Oq,ease:Lq}},w=v.useCallback(()=>{const R=c.current;R&&(u.current=R.hasMoved),c.current=null,h(!1)},[]),S=v.useCallback(R=>{const L=c.current;if(!L)return;const O=h8(R),A=O.x-L.startPointer.x,I=O.y-L.startPointer.y,N=L.hasMoved||Hq({deltaX:A,deltaY:I});c.current={...L,hasMoved:N},N&&a(aI({position:{x:L.startPosition.x+A,y:L.startPosition.y+I},viewport:fw(),boundsLeft:s}))},[a,s]),T=v.useCallback(R=>{if(c.current||!zq(R))return;const L=h8(R);c.current={startPointer:L,startPosition:r,hasMoved:!1},h(!0)},[r]),P=v.useCallback(()=>{if(u.current){u.current=!1;return}i()},[i]),k=e?"Close panel":"Open panel";return E.jsxs(E.Fragment,{children:[f?E.jsx("div",{className:"fixed inset-0 z-40 cursor-grabbing","data-cy":"rivet-panel-launcher-drag-surface",onPointerMove:S,onPointerUp:w,onPointerCancel:w,onMouseMove:S,onMouseUp:w}):null,E.jsx(oo,{children:t?E.jsx(so,{label:k,side:"top",forceOpen:p&&!f?void 0:!1,children:E.jsx(xl.button,{type:"button","aria-label":k,"data-cy":"reopen-panel",onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),initial:_,animate:{opacity:Nq,scale:Iq,x:Dq},whileTap:{scale:Mq},exit:x,transition:y,onPointerDown:T,onMouseDown:T,onPointerMove:S,onPointerUp:w,onPointerCancel:w,onMouseMove:S,onMouseUp:w,onClick:P,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 ${f?"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:E.jsx("img",{src:Pq,alt:"","aria-hidden":"true",draggable:!1,className:"h-4 w-4"})})}):null})]})},D1=xs("useConfig"),Bq=300*1e3,Wq=1800*1e3,Gq=60*1e3,Kq=300*1e3,Zq=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.queueAccessToken)??null},qq=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},Yq=t=>({...eR,...t??{}}),Xq=()=>{const t=et(D_),e=ot(D_),n=ot(uR),r=ot(dR),s=ot(m0),i=ot(oB),a=ot(cR),c=ot(sB),u=ot(Mf),f=ot(sR),h=v.useCallback(S=>{a(S.agentModeAvailable),f({name:S.name??null,email:S.email??null}),S.isMCPSession&&n(!0),S.mcpEditor&&r(S.mcpEditor),s(S.agentApplyMode??qq()??null),i(S.queueAccessToken??Zq())},[s,a,n,r,i,f]),p=ry({queryKey:["rivet-config"],queryFn:async()=>{const S=await fetch("/api/config");if(!S.ok)throw new Error(`Failed to fetch config: ${S.statusText}`);return await S.json()},staleTime:Bq,gcTime:Wq}),m=ry({queryKey:["rivet-feature-flags"],queryFn:async()=>{const S=await fetch("/api/feature-flags");if(!S.ok)throw new Error(`Failed to fetch feature flags: ${S.statusText}`);return await S.json()},staleTime:Gq,gcTime:Kq}),{refetch:_}=p,{refetch:x}=m;v.useLayoutEffect(()=>{p.data&&(h(p.data),u(!1),D1.info("Config loaded:",p.data)),m.data&&(e(Yq(m.data.featureFlags)),c(!0))},[p.data,m.data,h,u,e,c]),v.useLayoutEffect(()=>{p.error&&(c(!0),u(!1),D1.warn("Failed to load config:",p.error instanceof Error?p.error.message:"Failed to load config")),m.error&&(c(!0),D1.warn("Failed to load feature flags:",m.error instanceof Error?m.error.message:"Failed to load feature flags"))},[p.error,m.error,u,c]);const y=v.useCallback(async()=>{const[S]=await Promise.all([_(),x()]);return S.data?S.data:null},[_,x]);let w=null;return p.error instanceof Error?w=p.error.message:p.error&&(w="Failed to load config"),{config:p.data??null,featureFlags:t,loading:p.isPending||!p.error&&m.isPending,error:w,refetchConfig:y}},Zp="rivet_just_signed_in",fc=xs("useOAuthCallback"),Qq="https://rivet-proxy.onrender.com",Jq=()=>{const[t,e]=v.useState({isProcessing:!1,isComplete:!1,error:null});return v.useEffect(()=>{const n=new AbortController;let r=!1;return(async()=>{var c,u,f;const i=window.location.hash,a=window.location.search;if(!(!i||!i.includes("access_token"))&&!r){e({isProcessing:!0,isComplete:!1,error:null});try{fc.info("Processing OAuth callback...");const h=new URLSearchParams(i.substring(1)),p=h.get("access_token"),m=h.get("refresh_token"),x=new URLSearchParams(a).get("session");if(!p)throw new Error("No access token found in URL");if(!x)throw new Error("No session ID found in URL");fc.info(`Completing OAuth with session: ${x}`);const y=await fetch(`${Qq}/api/auth/google/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:x,accessToken:p,refreshToken:m}),signal:n.signal}),w=await y.json();if(!y.ok||!w.success)throw new Error(w.error||w.message||"Failed to complete authentication");if(fc.info("OAuth authentication completed successfully"),r)return;if((c=w.user)!=null&&c.id?(be.identify(w.user.id,{...w.user.email?{email:w.user.email}:{}}),w.user.email&&be.alias(w.user.email,w.user.id)):(u=w.user)!=null&&u.email&&be.identify(w.user.email,{email:w.user.email}),(f=w.user)!=null&&f.email&&p)try{const T=await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:w.user.email,token:p,refreshToken:m,userId:w.user.id}),signal:n.signal});T.ok||fc.warn(`Local auth store returned ${T.status}`)}catch(T){if(r)return;fc.warn("Failed to store auth locally:",T)}if(r)return;window.sessionStorage.setItem(Zp,"1");const S=window.location.pathname;window.history.replaceState({},document.title,S),e({isProcessing:!1,isComplete:!0,error:null})}catch(h){if(r)return;const p=h instanceof Error?h.message:"Unknown error occurred";fc.warn("OAuth callback error:",h),e({isProcessing:!1,isComplete:!1,error:p})}}})(),()=>{r=!0,n.abort()}},[]),t},j1=xs("useAgentVariantsSession"),eY=t=>typeof t.pendingCount=="number"&&t.pendingCount===0&&(t.pendingVariantRequests??0)===0&&(t.leasedVariantRequests??0)===0&&(t.activeLeases??[]).length===0,p8=(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[a,c]of r)c.status==="sending"&&c.variantRequestId&&(e.has(c.variantRequestId)||n&&c.variantRequest!==void 0)&&(s.delete(a),i=!0);return i?s:r})},tY=(t,e)=>{var s;if(t.size===0)return t;let n=!1;const r=new Map(t);for(const[i,a]of t){if(a.status!=="sending"||!a.awaitingSnapshotOutcome||a.variantRequest!==void 0)continue;const c=a.target;if(!c||c.kind!=="variant"||c.sessionId!==e.sessionId)continue;const u=(s=e.variants.find(f=>f.workItemId===c.variantId))==null?void 0:s.refinement;u&&(u.status==="succeeded"?(r.set(i,{...a,status:"complete",awaitingSnapshotOutcome:void 0}),n=!0):(u.status==="failed"||u.status==="cancelled")&&(r.set(i,{...a,status:"error",awaitingSnapshotOutcome:void 0}),n=!0))}return n?r:t},nY=({enabled:t=!0}={})=>{const e=ot(If),n=ot(tR),r=ot(JU),s=ot(aR),i=ot(rB),a=D2(),c=v.useRef(null);v.useEffect(()=>{if(!t)return;const u=new EventSource("/api/variants/events");return u.onmessage=f=>{try{const h=JSON.parse(f.data),p=c.current;if(h.active){const x=new Set(h.variants.map(y=>y.requestId).filter(y=>!!y));s(y=>y.filter(S=>!x.has(S.requestId))),p8(a,x,!1),a.set(rf,y=>{let w=y;for(const S of h.variants){const T=S.adoptedSource;T&&(w=nB(w,{kind:"variant",sessionId:T.sessionId,variantId:T.variantId},{kind:"variant",sessionId:h.sessionId,variantId:S.workItemId}))}return w}),a.set(rf,y=>tY(y,h)),h.sessionId!==c.current&&(c.current=h.sessionId,n(!0),r("directions"))}else c.current=null,p8(a,new Set,eY(h));e(h);const m=!h.active&&p!==null,_=h.active&&h.sessionId!==p;if(_&&fetch(`/api/variants/${h.sessionId}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(x=>j1.warn("failed to reset preview-port on session switch",x)),m||_){const x=new Set;if(h.active)for(const w of h.variants)x.add(tf({kind:"variant",sessionId:h.sessionId,variantId:w.workItemId}));const y=a.get(fo);for(const w of[y==null?void 0:y.left,y==null?void 0:y.right])w&&x.add(tf({kind:"variant",sessionId:w.sessionId,variantId:w.variantId}));i(x)}}catch(h){j1.warn("failed to parse SSE event payload",h)}},u.onerror=f=>{j1.warn("SSE error (auto-reconnects)",f)},()=>{u.close()}},[t,e,n,r,s,i,a])};var rY=Object.defineProperty,Pn=(t,e)=>rY(t,"name",{value:e,configurable:!0});function hw(t){const e=t+"CollectionProvider",[n,r]=wi(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=Pn(y=>{const{scope:w,children:S}=y,T=v.useRef(null),P=v.useRef(new Map).current;return E.jsx(s,{scope:w,itemMap:P,collectionRef:T,children:S})},"CollectionProvider");a.displayName=e;const c=t+"CollectionSlot",u=ua(c),f=v.forwardRef((y,w)=>{const{scope:S,children:T}=y,P=i(c,S),k=jt(w,P.collectionRef);return E.jsx(u,{ref:k,children:T})});f.displayName=c;const h=t+"CollectionItemSlot",p="data-radix-collection-item",m=ua(h),_=v.forwardRef((y,w)=>{const{scope:S,children:T,...P}=y,k=v.useRef(null),R=jt(w,k),L=i(h,S);return v.useEffect(()=>(L.itemMap.set(k,{ref:k,...P}),()=>void L.itemMap.delete(k))),E.jsx(m,{[p]:"",ref:R,children:T})});_.displayName=h;function x(y){const w=i(t+"CollectionConsumer",y);return v.useCallback(()=>{const T=w.collectionRef.current;if(!T)return[];const P=Array.from(T.querySelectorAll(`[${p}]`));return Array.from(w.itemMap.values()).sort((L,O)=>P.indexOf(L.ref.current)-P.indexOf(O.ref.current))},[w.collectionRef,w.itemMap])}return Pn(x,"useCollection"),[{Provider:a,Slot:f,ItemSlot:_},x,r]}Pn(hw,"createCollection");var m8=new WeakMap,pn,Ur,F1=(Ur=class extends Map{constructor(n){super(n);He(this,pn);ke(this,pn,[...super.keys()]),m8.set(this,!0)}set(n,r){return m8.get(this)&&(this.has(n)?U(this,pn)[U(this,pn).indexOf(n)]=n:U(this,pn).push(n)),super.set(n,r),this}insert(n,r,s){const i=this.has(r),a=U(this,pn).length,c=pw(n);let u=c>=0?c:a+c;const f=u<0||u>=a?-1:u;if(f===this.size||i&&f===this.size-1||f===-1)return this.set(r,s),this;const h=this.size+(i?0:1);c<0&&u++;const p=[...U(this,pn)];let m,_=!1;for(let x=u;x<h;x++)if(u===x){let y=p[x];p[x]===r&&(y=p[x+1]),i&&this.delete(r),m=this.get(y),this.set(r,s)}else{!_&&p[x-1]===r&&(_=!0);const y=p[_?x:x-1],w=m;m=this.get(y),this.delete(y),this.set(y,w)}return this}with(n,r,s){const i=new Ur(this);return i.insert(n,r,s),i}before(n){const r=U(this,pn).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,s){const i=U(this,pn).indexOf(n);return i===-1?this:this.insert(i,r,s)}after(n){let r=U(this,pn).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,pn).indexOf(n);return i===-1?this:this.insert(i+1,r,s)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return ke(this,pn,[]),super.clear()}delete(n){const r=super.delete(n);return r&&U(this,pn).splice(U(this,pn).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=qp(U(this,pn),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=qp(U(this,pn),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return U(this,pn).indexOf(n)}keyAt(n){return qp(U(this,pn),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 a of this)Reflect.apply(n,r,[a,i,this])&&s.push(a),i++;return new Ur(s)}map(n,r){const s=[];let i=0;for(const a of this)s.push([a[0],Reflect.apply(n,r,[a,i,this])]),i++;return new Ur(s)}reduce(...n){const[r,s]=n;let i=0,a=s??this.at(0);for(const c of this)i===0&&n.length===1?a=c:a=Reflect.apply(r,this,[a,c,i,this]),i++;return a}reduceRight(...n){const[r,s]=n;let i=s??this.at(-1);for(let a=this.size-1;a>=0;a--){const c=this.at(a);a===this.size-1&&n.length===1?i=c:i=Reflect.apply(r,this,[i,c,a,this])}return i}toSorted(n){const r=[...this.entries()].sort(n);return new Ur(r)}toReversed(){const n=new Ur;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 Ur(r)}slice(n,r){const s=new Ur;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 a=n;a<=i;a++){const c=this.keyAt(a),u=this.get(c);s.set(c,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}},pn=new WeakMap,Pn(Ur,"OrderedDict"),Ur);function qp(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=lI(t,e);return n===-1?void 0:t[n]}Pn(qp,"at");function lI(t,e){const n=t.length,r=pw(e),s=r>=0?r:n+r;return s<0||s>=n?-1:s}Pn(lI,"toSafeIndex");function pw(t){return t!==t||t===0?0:Math.trunc(t)}Pn(pw,"toSafeInteger");function sY(t){const e=t+"CollectionProvider",[n,r]=wi(e),[s,i]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new F1,setItemMap:Pn(()=>{},"setItemMap")}),a=Pn(({state:P,...k})=>P?E.jsx(u,{...k,state:P}):E.jsx(c,{...k}),"CollectionProvider");a.displayName=e;const c=Pn(P=>{const k=w();return E.jsx(u,{...P,state:k})},"CollectionInit");c.displayName=e+"Init";const u=Pn(P=>{const{scope:k,children:R,state:L}=P,O=v.useRef(null),[A,I]=v.useState(null),N=jt(O,I),[j,F]=L;return v.useEffect(()=>{if(!A)return;const K=dI(()=>{});return K.observe(A,{childList:!0,subtree:!0}),()=>{K.disconnect()}},[A]),E.jsx(s,{scope:k,itemMap:j,setItemMap:F,collectionRef:N,collectionRefObject:O,collectionElement:A,children:R})},"CollectionProviderImpl");u.displayName=e+"Impl";const f=t+"CollectionSlot",h=ua(f),p=v.forwardRef((P,k)=>{const{scope:R,children:L}=P,O=i(f,R),A=jt(k,O.collectionRef);return E.jsx(h,{ref:A,children:L})});p.displayName=f;const m=t+"CollectionItemSlot",_="data-radix-collection-item",x=ua(m),y=v.forwardRef((P,k)=>{const{scope:R,children:L,...O}=P,A=v.useRef(null),[I,N]=v.useState(null),j=jt(k,A,N),F=i(m,R),{setItemMap:K}=F,X=v.useRef(O);cI(X.current,O)||(X.current=O);const W=X.current;return v.useEffect(()=>{const G=W;return K(q=>I?q.has(I)?q.set(I,{...G,element:I}).toSorted(i2):(q.set(I,{...G,element:I}),q.toSorted(i2)):q),()=>{K(q=>!I||!q.has(I)?q:(q.delete(I),new F1(q)))}},[I,W,K]),E.jsx(x,{[_]:"",ref:j,children:L})});y.displayName=m;function w(){return v.useState(new F1)}Pn(w,"useInitCollection");function S(P){const{itemMap:k}=i(t+"CollectionConsumer",P);return k}return Pn(S,"useCollection"),[{Provider:a,Slot:p,ItemSlot:y},{createCollectionScope:r,useCollection:S,useInitCollection:w}]}Pn(sY,"createCollection");function cI(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}Pn(cI,"shallowEqual");function uI(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}Pn(uI,"isElementPreceding");function i2(t,e){return!t[1].element||!e[1].element?0:uI(t[1].element,e[1].element)?-1:1}Pn(i2,"sortByDocumentPosition");function dI(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}Pn(dI,"getChildListObserver");var iY=Object.defineProperty,Nf=(t,e)=>iY(t,"name",{value:e,configurable:!0}),mw="Collapsible",[oY,fI]=wi(mw),[aY,gw]=oY(mw),lY=v.forwardRef(Nf(function(e,n){const{__scopeCollapsible:r,open:s,defaultOpen:i,disabled:a,onOpenChange:c,...u}=e,[f,h]=va({prop:s,defaultProp:i??!1,onChange:c,caller:mw});return E.jsx(aY,{scope:r,disabled:a,contentId:na(),open:f,onOpenToggle:v.useCallback(()=>h(p=>!p),[h]),children:E.jsx(ln.div,{"data-state":T0(f),"data-disabled":a?"":void 0,...u,ref:n})})},"Collapsible")),cY="CollapsibleTrigger",uY=v.forwardRef(Nf(function(e,n){const{__scopeCollapsible:r,...s}=e,i=gw(cY,r);return E.jsx(ln.button,{type:"button","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":T0(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...s,ref:n,onClick:Nt(e.onClick,i.onOpenToggle)})},"CollapsibleTrigger")),hI="CollapsibleContent",dY=v.forwardRef(Nf(function(e,n){const{forceMount:r,...s}=e,i=gw(hI,e.__scopeCollapsible);return E.jsx(ya,{present:r||i.open,children:({present:a})=>E.jsx(fY,{...s,ref:n,present:a})})},"CollapsibleContent")),fY=v.forwardRef(Nf(function(e,n){const{__scopeCollapsible:r,present:s,children:i,...a}=e,c=gw(hI,r),[u,f]=v.useState(s),h=v.useRef(null),p=jt(n,h),m=v.useRef(0),_=m.current,x=v.useRef(0),y=x.current,w=c.open||u,S=v.useRef(w),T=v.useRef(void 0);return v.useEffect(()=>{const P=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(P)},[]),Pr(()=>{const P=h.current;if(P){T.current=T.current||{transitionDuration:P.style.transitionDuration,animationName:P.style.animationName},P.style.transitionDuration="0s",P.style.animationName="none";const k=P.getBoundingClientRect();m.current=k.height,x.current=k.width,S.current||(P.style.transitionDuration=T.current.transitionDuration,P.style.animationName=T.current.animationName),f(s)}},[c.open,s]),E.jsx(ln.div,{"data-state":T0(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!w,...a,ref:p,style:{"--radix-collapsible-content-height":_?`${_}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:w&&i})},"CollapsibleContentImpl"));function T0(t){return t?"open":"closed"}Nf(T0,"getState");var hY=lY,pY=uY,mY=dY,gY=Object.defineProperty,vY=(t,e)=>gY(t,"name",{value:e,configurable:!0}),yY=v.createContext(void 0);function vw(t){const e=v.useContext(yY);return t||e||"ltr"}vY(vw,"useDirection");var _Y=Object.defineProperty,Jr=(t,e)=>_Y(t,"name",{value:e,configurable:!0}),bi="Accordion",xY=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[yw,wY,bY]=hw(bi),[R0,DJ]=wi(bi,[bY,fI]),_w=fI(),SY=v.forwardRef(Jr(function(e,n){const{type:r,...s}=e,i=s,a=s;return E.jsx(yw.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?E.jsx(PY,{...a,ref:n}):E.jsx(kY,{...i,ref:n})})},"Accordion")),[pI,EY]=R0(bi),[mI,CY]=R0(bi,{collapsible:!1}),kY=v.forwardRef(Jr(function(e,n){const{value:r,defaultValue:s,onValueChange:i=Jr(()=>{},"onValueChange"),collapsible:a=!1,...c}=e,[u,f]=va({prop:r,defaultProp:s??"",onChange:i,caller:bi});return E.jsx(pI,{scope:e.__scopeAccordion,value:v.useMemo(()=>u?[u]:[],[u]),onItemOpen:f,onItemClose:v.useCallback(()=>a&&f(""),[a,f]),children:E.jsx(mI,{scope:e.__scopeAccordion,collapsible:a,children:E.jsx(gI,{...c,ref:n})})})},"AccordionImplSingle")),PY=v.forwardRef(Jr(function(e,n){const{value:r,defaultValue:s,onValueChange:i=Jr(()=>{},"onValueChange"),...a}=e,[c,u]=va({prop:r,defaultProp:s??[],onChange:i,caller:bi}),f=v.useCallback(p=>u((m=[])=>[...m,p]),[u]),h=v.useCallback(p=>u((m=[])=>m.filter(_=>_!==p)),[u]);return E.jsx(pI,{scope:e.__scopeAccordion,value:c,onItemOpen:f,onItemClose:h,children:E.jsx(mI,{scope:e.__scopeAccordion,collapsible:!0,children:E.jsx(gI,{...a,ref:n})})})},"AccordionImplMultiple")),[TY,A0]=R0(bi),gI=v.forwardRef(Jr(function(e,n){const{__scopeAccordion:r,disabled:s,dir:i,orientation:a="vertical",...c}=e,u=v.useRef(null),f=jt(u,n),h=wY(r),m=vw(i)==="ltr",_=Nt(e.onKeyDown,x=>{var I;if(!xY.includes(x.key))return;const y=x.target,w=h().filter(N=>{var j;return!((j=N.ref.current)!=null&&j.disabled)}),S=w.findIndex(N=>N.ref.current===y),T=w.length;if(S===-1)return;x.preventDefault();let P=S;const k=0,R=T-1,L=Jr(()=>{P=S+1,P>R&&(P=k)},"moveNext"),O=Jr(()=>{P=S-1,P<k&&(P=R)},"movePrev");switch(x.key){case"Home":P=k;break;case"End":P=R;break;case"ArrowRight":a==="horizontal"&&(m?L():O());break;case"ArrowDown":a==="vertical"&&L();break;case"ArrowLeft":a==="horizontal"&&(m?O():L());break;case"ArrowUp":a==="vertical"&&O();break}const A=P%T;(I=w[A].ref.current)==null||I.focus()});return E.jsx(TY,{scope:r,disabled:s,direction:i,orientation:a,children:E.jsx(yw.Slot,{scope:r,children:E.jsx(ln.div,{...c,"data-orientation":a,ref:f,onKeyDown:s?void 0:_})})})},"AccordionImpl")),o2="AccordionItem",[RY,xw]=R0(o2),AY=v.forwardRef(Jr(function(e,n){const{__scopeAccordion:r,value:s,...i}=e,a=A0(o2,r),c=EY(o2,r),u=_w(r),f=na(),h=s&&c.value.includes(s)||!1,p=a.disabled||e.disabled;return E.jsx(RY,{scope:r,open:h,disabled:p,triggerId:f,children:E.jsx(hY,{"data-orientation":a.orientation,"data-state":ww(h),...u,...i,ref:n,disabled:p,open:h,onOpenChange:m=>{m?c.onItemOpen(s):c.onItemClose(s)}})})},"AccordionItem")),IY="AccordionHeader",MY=v.forwardRef(Jr(function(e,n){const{__scopeAccordion:r,...s}=e,i=A0(bi,r),a=xw(IY,r);return E.jsx(ln.h3,{"data-orientation":i.orientation,"data-state":ww(a.open),"data-disabled":a.disabled?"":void 0,...s,ref:n})},"AccordionHeader")),g8="AccordionTrigger",OY=v.forwardRef(Jr(function(e,n){const{__scopeAccordion:r,...s}=e,i=A0(bi,r),a=xw(g8,r),c=CY(g8,r),u=_w(r);return E.jsx(yw.ItemSlot,{scope:r,children:E.jsx(pY,{"aria-disabled":a.open&&!c.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...u,...s,ref:n})})},"AccordionTrigger")),LY="AccordionContent",NY=v.forwardRef(Jr(function(e,n){const{__scopeAccordion:r,...s}=e,i=A0(bi,r),a=xw(LY,r),c=_w(r);return E.jsx(mY,{role:"region","aria-labelledby":a.triggerId,"data-orientation":i.orientation,...c,...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 ww(t){return t?"open":"closed"}Jr(ww,"getState");var vI=SY,DY=AY,jY=MY,FY=OY,VY=NY;/**
|
|
129
|
+
* @license lucide-react v1.27.0 - ISC
|
|
130
|
+
*
|
|
131
|
+
* This source code is licensed under the ISC license.
|
|
132
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
+
*/const yI=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
|
|
134
|
+
* @license lucide-react v1.27.0 - ISC
|
|
135
|
+
*
|
|
136
|
+
* This source code is licensed under the ISC license.
|
|
137
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
+
*/const $Y=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
139
|
+
* @license lucide-react v1.27.0 - ISC
|
|
140
|
+
*
|
|
141
|
+
* This source code is licensed under the ISC license.
|
|
142
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
+
*/const HY=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
|
|
144
|
+
* @license lucide-react v1.27.0 - ISC
|
|
145
|
+
*
|
|
146
|
+
* This source code is licensed under the ISC license.
|
|
147
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
+
*/const v8=t=>{const e=HY(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
|
|
149
|
+
* @license lucide-react v1.27.0 - ISC
|
|
150
|
+
*
|
|
151
|
+
* This source code is licensed under the ISC license.
|
|
152
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
153
|
+
*/var V1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
154
|
+
* @license lucide-react v1.27.0 - ISC
|
|
155
|
+
*
|
|
156
|
+
* This source code is licensed under the ISC license.
|
|
157
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
158
|
+
*/const zY=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},UY=v.createContext({}),BY=()=>v.useContext(UY),WY=v.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...c},u)=>{const{size:f=24,strokeWidth:h=2,absoluteStrokeWidth:p=!1,color:m="currentColor",className:_=""}=BY()??{},x=r??p?Number(n??h)*24/Number(e??f):n??h;return v.createElement("svg",{ref:u,...V1,width:e??f??V1.width,height:e??f??V1.height,stroke:t??m,strokeWidth:x,className:yI("lucide",_,s),...!i&&!zY(c)&&{"aria-hidden":"true"},...c},[...a.map(([y,w])=>v.createElement(y,w)),...Array.isArray(i)?i:[i]])});/**
|
|
159
|
+
* @license lucide-react v1.27.0 - ISC
|
|
160
|
+
*
|
|
161
|
+
* This source code is licensed under the ISC license.
|
|
162
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
+
*/const qe=(t,e)=>{const n=v.forwardRef(({className:r,...s},i)=>v.createElement(WY,{ref:i,iconNode:e,className:yI(`lucide-${$Y(v8(t))}`,`lucide-${t}`,r),...s}));return n.displayName=v8(t),n};/**
|
|
164
|
+
* @license lucide-react v1.27.0 - ISC
|
|
165
|
+
*
|
|
166
|
+
* This source code is licensed under the ISC license.
|
|
167
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
+
*/const GY=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],KY=qe("arrow-left",GY);/**
|
|
169
|
+
* @license lucide-react v1.27.0 - ISC
|
|
170
|
+
*
|
|
171
|
+
* This source code is licensed under the ISC license.
|
|
172
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
173
|
+
*/const ZY=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],qY=qe("arrow-right",ZY);/**
|
|
174
|
+
* @license lucide-react v1.27.0 - ISC
|
|
175
|
+
*
|
|
176
|
+
* This source code is licensed under the ISC license.
|
|
177
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
178
|
+
*/const YY=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],XY=qe("arrow-up",YY);/**
|
|
179
|
+
* @license lucide-react v1.27.0 - ISC
|
|
180
|
+
*
|
|
181
|
+
* This source code is licensed under the ISC license.
|
|
182
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
183
|
+
*/const QY=[["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"}]],JY=qe("bell",QY);/**
|
|
184
|
+
* @license lucide-react v1.27.0 - ISC
|
|
185
|
+
*
|
|
186
|
+
* This source code is licensed under the ISC license.
|
|
187
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
188
|
+
*/const eX=[["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"}]],tX=qe("brain",eX);/**
|
|
189
|
+
* @license lucide-react v1.27.0 - ISC
|
|
190
|
+
*
|
|
191
|
+
* This source code is licensed under the ISC license.
|
|
192
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
193
|
+
*/const nX=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],rX=qe("check",nX);/**
|
|
194
|
+
* @license lucide-react v1.27.0 - ISC
|
|
195
|
+
*
|
|
196
|
+
* This source code is licensed under the ISC license.
|
|
197
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
198
|
+
*/const sX=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],iX=qe("chevron-down",sX);/**
|
|
199
|
+
* @license lucide-react v1.27.0 - ISC
|
|
200
|
+
*
|
|
201
|
+
* This source code is licensed under the ISC license.
|
|
202
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
203
|
+
*/const oX=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],aX=qe("chevron-right",oX);/**
|
|
204
|
+
* @license lucide-react v1.27.0 - ISC
|
|
205
|
+
*
|
|
206
|
+
* This source code is licensed under the ISC license.
|
|
207
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
208
|
+
*/const lX=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],cX=qe("circle",lX);/**
|
|
209
|
+
* @license lucide-react v1.27.0 - ISC
|
|
210
|
+
*
|
|
211
|
+
* This source code is licensed under the ISC license.
|
|
212
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
213
|
+
*/const uX=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],dX=qe("clock",uX);/**
|
|
214
|
+
* @license lucide-react v1.27.0 - ISC
|
|
215
|
+
*
|
|
216
|
+
* This source code is licensed under the ISC license.
|
|
217
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
218
|
+
*/const fX=[["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"}]],hX=qe("copy",fX);/**
|
|
219
|
+
* @license lucide-react v1.27.0 - ISC
|
|
220
|
+
*
|
|
221
|
+
* This source code is licensed under the ISC license.
|
|
222
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
223
|
+
*/const pX=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],mX=qe("dot",pX);/**
|
|
224
|
+
* @license lucide-react v1.27.0 - ISC
|
|
225
|
+
*
|
|
226
|
+
* This source code is licensed under the ISC license.
|
|
227
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
228
|
+
*/const gX=[["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"}]],vX=qe("globe",gX);/**
|
|
229
|
+
* @license lucide-react v1.27.0 - ISC
|
|
230
|
+
*
|
|
231
|
+
* This source code is licensed under the ISC license.
|
|
232
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
233
|
+
*/const yX=[["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"}]],_X=qe("heart",yX);/**
|
|
234
|
+
* @license lucide-react v1.27.0 - ISC
|
|
235
|
+
*
|
|
236
|
+
* This source code is licensed under the ISC license.
|
|
237
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
238
|
+
*/const xX=[["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"}]],wX=qe("house",xX);/**
|
|
239
|
+
* @license lucide-react v1.27.0 - ISC
|
|
240
|
+
*
|
|
241
|
+
* This source code is licensed under the ISC license.
|
|
242
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
243
|
+
*/const bX=[["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"}]],SX=qe("image",bX);/**
|
|
244
|
+
* @license lucide-react v1.27.0 - ISC
|
|
245
|
+
*
|
|
246
|
+
* This source code is licensed under the ISC license.
|
|
247
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
248
|
+
*/const EX=[["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"}]],CX=qe("inbox",EX);/**
|
|
249
|
+
* @license lucide-react v1.27.0 - ISC
|
|
250
|
+
*
|
|
251
|
+
* This source code is licensed under the ISC license.
|
|
252
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
253
|
+
*/const kX=[["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"}]],PX=qe("lightbulb",kX);/**
|
|
254
|
+
* @license lucide-react v1.27.0 - ISC
|
|
255
|
+
*
|
|
256
|
+
* This source code is licensed under the ISC license.
|
|
257
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
258
|
+
*/const TX=[["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"}]],RX=qe("link",TX);/**
|
|
259
|
+
* @license lucide-react v1.27.0 - ISC
|
|
260
|
+
*
|
|
261
|
+
* This source code is licensed under the ISC license.
|
|
262
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
263
|
+
*/const AX=[["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"}]],IX=qe("loader",AX);/**
|
|
264
|
+
* @license lucide-react v1.27.0 - ISC
|
|
265
|
+
*
|
|
266
|
+
* This source code is licensed under the ISC license.
|
|
267
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
268
|
+
*/const MX=[["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"}]],OX=qe("lock",MX);/**
|
|
269
|
+
* @license lucide-react v1.27.0 - ISC
|
|
270
|
+
*
|
|
271
|
+
* This source code is licensed under the ISC license.
|
|
272
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
273
|
+
*/const LX=[["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"}]],NX=qe("mail",LX);/**
|
|
274
|
+
* @license lucide-react v1.27.0 - ISC
|
|
275
|
+
*
|
|
276
|
+
* This source code is licensed under the ISC license.
|
|
277
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
278
|
+
*/const DX=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],jX=qe("menu",DX);/**
|
|
279
|
+
* @license lucide-react v1.27.0 - ISC
|
|
280
|
+
*
|
|
281
|
+
* This source code is licensed under the ISC license.
|
|
282
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
283
|
+
*/const FX=[["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"}]],VX=qe("message-circle",FX);/**
|
|
284
|
+
* @license lucide-react v1.27.0 - ISC
|
|
285
|
+
*
|
|
286
|
+
* This source code is licensed under the ISC license.
|
|
287
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
288
|
+
*/const $X=[["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"}]],HX=qe("monitor",$X);/**
|
|
289
|
+
* @license lucide-react v1.27.0 - ISC
|
|
290
|
+
*
|
|
291
|
+
* This source code is licensed under the ISC license.
|
|
292
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
293
|
+
*/const zX=[["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"}]],UX=qe("moon",zX);/**
|
|
294
|
+
* @license lucide-react v1.27.0 - ISC
|
|
295
|
+
*
|
|
296
|
+
* This source code is licensed under the ISC license.
|
|
297
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
298
|
+
*/const BX=[["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"}]],WX=qe("paintbrush",BX);/**
|
|
299
|
+
* @license lucide-react v1.27.0 - ISC
|
|
300
|
+
*
|
|
301
|
+
* This source code is licensed under the ISC license.
|
|
302
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
303
|
+
*/const GX=[["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"}]],KX=qe("palette",GX);/**
|
|
304
|
+
* @license lucide-react v1.27.0 - ISC
|
|
305
|
+
*
|
|
306
|
+
* This source code is licensed under the ISC license.
|
|
307
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
308
|
+
*/const ZX=[["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"}]],qX=qe("pause",ZX);/**
|
|
309
|
+
* @license lucide-react v1.27.0 - ISC
|
|
310
|
+
*
|
|
311
|
+
* This source code is licensed under the ISC license.
|
|
312
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
313
|
+
*/const YX=[["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"}]],XX=qe("pencil",YX);/**
|
|
314
|
+
* @license lucide-react v1.27.0 - ISC
|
|
315
|
+
*
|
|
316
|
+
* This source code is licensed under the ISC license.
|
|
317
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
318
|
+
*/const QX=[["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"}]],JX=qe("pipette",QX);/**
|
|
319
|
+
* @license lucide-react v1.27.0 - ISC
|
|
320
|
+
*
|
|
321
|
+
* This source code is licensed under the ISC license.
|
|
322
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
323
|
+
*/const eQ=[["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"}]],tQ=qe("play",eQ);/**
|
|
324
|
+
* @license lucide-react v1.27.0 - ISC
|
|
325
|
+
*
|
|
326
|
+
* This source code is licensed under the ISC license.
|
|
327
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
328
|
+
*/const nQ=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],rQ=qe("plus",nQ);/**
|
|
329
|
+
* @license lucide-react v1.27.0 - ISC
|
|
330
|
+
*
|
|
331
|
+
* This source code is licensed under the ISC license.
|
|
332
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
333
|
+
*/const sQ=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]],iQ=qe("rectangle-horizontal",sQ);/**
|
|
334
|
+
* @license lucide-react v1.27.0 - ISC
|
|
335
|
+
*
|
|
336
|
+
* This source code is licensed under the ISC license.
|
|
337
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
338
|
+
*/const oQ=[["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"}]],aQ=qe("rocket",oQ);/**
|
|
339
|
+
* @license lucide-react v1.27.0 - ISC
|
|
340
|
+
*
|
|
341
|
+
* This source code is licensed under the ISC license.
|
|
342
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
343
|
+
*/const lQ=[["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"}]],cQ=qe("rotate-ccw",lQ);/**
|
|
344
|
+
* @license lucide-react v1.27.0 - ISC
|
|
345
|
+
*
|
|
346
|
+
* This source code is licensed under the ISC license.
|
|
347
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
348
|
+
*/const uQ=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],dQ=qe("search",uQ);/**
|
|
349
|
+
* @license lucide-react v1.27.0 - ISC
|
|
350
|
+
*
|
|
351
|
+
* This source code is licensed under the ISC license.
|
|
352
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
353
|
+
*/const fQ=[["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"}]],hQ=qe("settings",fQ);/**
|
|
354
|
+
* @license lucide-react v1.27.0 - ISC
|
|
355
|
+
*
|
|
356
|
+
* This source code is licensed under the ISC license.
|
|
357
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
358
|
+
*/const pQ=[["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"}]],mQ=qe("shield",pQ);/**
|
|
359
|
+
* @license lucide-react v1.27.0 - ISC
|
|
360
|
+
*
|
|
361
|
+
* This source code is licensed under the ISC license.
|
|
362
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
363
|
+
*/const gQ=[["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"}]],vQ=qe("skip-forward",gQ);/**
|
|
364
|
+
* @license lucide-react v1.27.0 - ISC
|
|
365
|
+
*
|
|
366
|
+
* This source code is licensed under the ISC license.
|
|
367
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
368
|
+
*/const yQ=[["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"}]],_Q=qe("square-library",yQ);/**
|
|
369
|
+
* @license lucide-react v1.27.0 - ISC
|
|
370
|
+
*
|
|
371
|
+
* This source code is licensed under the ISC license.
|
|
372
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
373
|
+
*/const xQ=[["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"}]],wQ=qe("star",xQ);/**
|
|
374
|
+
* @license lucide-react v1.27.0 - ISC
|
|
375
|
+
*
|
|
376
|
+
* This source code is licensed under the ISC license.
|
|
377
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
378
|
+
*/const bQ=[["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"}]],SQ=qe("sun",bQ);/**
|
|
379
|
+
* @license lucide-react v1.27.0 - ISC
|
|
380
|
+
*
|
|
381
|
+
* This source code is licensed under the ISC license.
|
|
382
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
383
|
+
*/const EQ=[["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"}]],CQ=qe("user",EQ);/**
|
|
384
|
+
* @license lucide-react v1.27.0 - ISC
|
|
385
|
+
*
|
|
386
|
+
* This source code is licensed under the ISC license.
|
|
387
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
388
|
+
*/const kQ=[["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"}]],PQ=qe("users",kQ);/**
|
|
389
|
+
* @license lucide-react v1.27.0 - ISC
|
|
390
|
+
*
|
|
391
|
+
* This source code is licensed under the ISC license.
|
|
392
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
393
|
+
*/const TQ=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],RQ=qe("x",TQ),AQ={"chevron-right":aX,"chevron-down":iX,pipette:JX,x:RQ,copy:hX,menu:jX,dot:mX,monitor:HX,sun:SQ,moon:UX,"rectangle-horizontal":iQ,circle:cX,"square-library":_Q,clock:dX,star:wQ,settings:hQ,plus:rQ,"arrow-left":KY,"arrow-right":qY,"arrow-up":XY,search:dQ,loader:IX,users:PQ,lock:OX,mail:NX,bell:JY,shield:mQ,palette:KX,lightbulb:PX,rocket:aQ,heart:_X,paintbrush:WX,brain:tX,globe:vX,user:CQ,image:SX,link:RX,check:rX,"rotate-ccw":cQ,play:tQ,pause:qX,home:wX,"message-circle":VX,inbox:CX,pencil:XX,"skip-forward":vQ},y8={lucide:AQ},_I=v.createContext(null);function IQ(t){const e=v.useContext(_I);return e?y8[e.iconLibrary][t]:y8.lucide[t]}function MQ({children:t,defaultLibrary:e="lucide"}){const[n,r]=v.useState(e),s=v.useCallback(i=>{r(i)},[]);return E.jsx(_I.Provider,{value:{iconLibrary:n,setIconLibrary:s},children:t})}const xI=v.createContext(null);function bw(){return v.useContext(xI)}const wI=v.createContext(null);function bI(){const t=v.useContext(wI);if(!t)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return t}const OQ=v.forwardRef((t,e)=>{const{children:n,type:r="single",className:s,...i}=t,a=v.useRef(null),c=v.useRef(new Map),[u,f]=v.useState(new Map),{activeIndex:h,setActiveIndex:p,itemRects:m,sessionRef:_,handlers:x,registerItem:y,measureItems:w}=q5(a),S=v.useCallback((ae,se)=>{se?c.current.set(ae,se):c.current.delete(ae)},[]),T=v.useCallback(()=>{if(!a.current)return;const ae=new Map;c.current.forEach((se,Ve)=>{ae.set(Ve,{top:se.offsetTop,left:se.offsetLeft,width:se.offsetWidth,height:se.offsetHeight})}),f(ae)},[]),[P,k]=v.useState(()=>r==="single"?t.defaultValue??"":""),[R,L]=v.useState(()=>r==="multiple"?t.defaultValue??[]:[]),O=t.onValueChange,A=t.onValueChange,I=t.value,N=new Set(r==="multiple"?t.value??R:(()=>{const ae=t.value??P;return ae?[ae]:[]})()),j=v.useCallback(ae=>{const se=t;se.onValueChange?se.onValueChange(ae):k(ae)},[O]),F=v.useCallback(ae=>{const se=t;se.onValueChange?se.onValueChange(ae):L(ae)},[A]),K=v.useCallback(ae=>{if(r==="multiple"){const se=t.value??R;F(se.filter(Ve=>Ve!==ae))}else j("")},[r,j,F,R,I]);v.useEffect(()=>{w(),T()},[w,T,n]);const X=[...N].join(",");v.useEffect(()=>{w(),T()},[w,T,X]);const[W,G]=v.useState(null),q=h!==null?m[h]:null,$=W!==null?m[W]:null,ne=h!==null&&!u.has(h),z=S0(),{value:D,defaultValue:Y,onValueChange:ee,collapsible:ie,type:oe,...ce}=i,xe=r==="multiple"?{type:"multiple",value:t.value??R,onValueChange:F}:{type:"single",collapsible:t.collapsible??!0,value:t.value??P,onValueChange:j};return E.jsx(xI.Provider,{value:{registerItem:y,registerFullItem:S,activeIndex:h,grouped:!0,remeasure:()=>{w(),T()},openValues:N,openItemRects:u,toggleValue:K},children:E.jsx(vI,{...xe,asChild:!0,children:E.jsxs("div",{ref:ae=>{a.current=ae,typeof e=="function"?e(ae):e&&(e.current=ae)},onMouseEnter:x.onMouseEnter,onMouseMove:ae=>{const se=a.current;if(se){const Ve=se.getBoundingClientRect(),De=se.offsetHeight,Re=Ve.height,Ye=De>0?Re/De:1,ut=(ae.clientY-Ve.top)/Ye+se.scrollTop;for(const[kt,we]of u){const je=m[kt];if(!je)continue;const ze=je.top+je.height,it=we.top+we.height;if(ut>=ze&&ut<=it){p(null);return}}}x.onMouseMove(ae)},onMouseLeave:x.onMouseLeave,onFocus:ae=>{var Ve;const se=(Ve=ae.target.closest("[data-proximity-index]"))==null?void 0:Ve.getAttribute("data-proximity-index");if(se!=null){const De=Number(se);p(De),G(ae.target.matches(":focus-visible")?De:null)}},onBlur:ae=>{var se;(se=a.current)!=null&&se.contains(ae.relatedTarget)||(G(null),p(null))},className:dr("relative flex flex-col gap-0.5 w-72 max-w-full",s),...ce,children:[E.jsx(oo,{children:[...u.entries()].map(([ae,se])=>E.jsx(ao.div,{className:`absolute ${z.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:!1,animate:{top:se.top,left:se.left,width:se.width,height:se.height,opacity:ne?.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-${ae}`))}),E.jsx(oo,{children:q&&E.jsx(ao.div,{className:`absolute ${z.bg} bg-hover pointer-events-none`,initial:{opacity:0,top:q.top,left:q.left,width:q.width,height:q.height},animate:{opacity:1,top:q.top,left:q.left,width:q.width,height:q.height},exit:{opacity:0,transition:{duration:.06}},transition:{...ef.fast,opacity:{duration:.08}}},_.current)}),E.jsx(oo,{children:$&&E.jsx(ao.div,{className:`absolute ${z.focusRing} pointer-events-none z-20 border border-[#6B97FF]`,initial:!1,animate:{left:$.left-2,top:$.top-2,width:$.width+4,height:$.height+4},exit:{opacity:0,transition:{duration:.06}},transition:{...ef.fast,opacity:{duration:.08}}})}),n]})})})});OQ.displayName="AccordionGroup";const SI=v.forwardRef(({children:t,type:e="single",collapsible:n=!0,defaultValue:r,value:s,onValueChange:i,className:a,...c},u)=>{const[f,h]=v.useState(()=>e==="single"?r??"":""),[p,m]=v.useState(()=>e==="multiple"?r??[]:[]),_=new Set(e==="multiple"?s??p:(()=>{const T=s??f;return T?[T]:[]})()),x=v.useCallback(T=>{i?i(T):h(T)},[i]),y=v.useCallback(T=>{i?i(T):m(T)},[i]),w=v.useCallback(T=>{e==="multiple"?y((s??p).filter(k=>k!==T)):x("")},[e,s,p,x,y]),S=e==="multiple"?{type:"multiple",value:s??p,defaultValue:r,onValueChange:y}:{type:"single",collapsible:n,value:s??f,defaultValue:r,onValueChange:x};return E.jsx(vI,{...S,asChild:!0,children:E.jsx("div",{ref:u,className:dr("w-72 max-w-full flex flex-col gap-0.5",a),...c,children:E.jsx(EI.Provider,{value:_,children:E.jsx(CI.Provider,{value:w,children:t})})})})});SI.displayName="Accordion";const EI=v.createContext(new Set),CI=v.createContext(()=>{}),kI=v.forwardRef(({value:t,index:e,disabled:n,children:r,className:s,...i},a)=>{const c=v.useRef(null),u=bw(),f=v.useContext(EI),h=v.useContext(CI),p=S0(),m=u!=null&&u.grouped?u.openValues.has(t):f.has(t),_=v.useRef(null),x=v.useCallback(()=>{u!=null&&u.grouped?u.toggleValue(t):h(t)},[u,h,t]);return v.useEffect(()=>{if(u!=null&&u.grouped&&e!==void 0)return u.registerItem(e,_.current),()=>u.registerItem(e,null)},[e,u]),v.useEffect(()=>{if(u!=null&&u.grouped&&e!==void 0)return m?u.registerFullItem(e,c.current):u.registerFullItem(e,null),()=>u.registerFullItem(e,null)},[e,u,m]),E.jsx(wI.Provider,{value:{index:e,value:t,isOpen:m,onToggle:x,triggerRef:_},children:E.jsxs(DY,{ref:y=>{c.current=y,typeof a=="function"?a(y):a&&(a.current=y)},value:t,disabled:n,"data-proximity-index":e,className:dr(!(u!=null&&u.grouped)&&"relative",s),...i,children:[!(u!=null&&u.grouped)&&E.jsx(oo,{children:m&&E.jsx(ao.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]})})});kI.displayName="AccordionItem";const PI=v.forwardRef(({children:t,className:e,...n},r)=>{const s=IQ("chevron-right"),i=bw(),{index:a,isOpen:c,triggerRef:u}=bI(),f=S0(),[h,p]=v.useState(!1),m=i!=null&&i.grouped?i.activeIndex===a:h,_=E.jsx(jY,{asChild:!0,children:E.jsx("div",{children:E.jsxs(FY,{ref:r,className:dr(`relative z-10 flex items-center gap-2.5 ${f.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:[E.jsxs("span",{className:"inline-grid text-[13px] flex-1 text-left",children:[E.jsx("span",{className:"col-start-1 row-start-1 invisible",style:{fontVariationSettings:Ld.semibold},"aria-hidden":"true",children:t}),E.jsx("span",{className:dr("col-start-1 row-start-1 transition-[color,font-variation-settings] duration-80",c||m?"text-foreground":"text-muted-foreground"),style:{fontVariationSettings:c?Ld.semibold:Ld.normal},children:t})]}),E.jsx(ao.span,{className:"shrink-0 inline-flex items-center justify-center",animate:{rotate:c?90:0},transition:ef.fast,children:E.jsx(s,{size:16,strokeWidth:c||m?2:1.5,className:dr("transition-[color,stroke-width] duration-80",c||m?"text-foreground":"text-muted-foreground")})})]})})});return i!=null&&i.grouped?E.jsx("div",{ref:u,children:_}):E.jsxs("div",{className:"relative",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[E.jsx(oo,{children:h&&E.jsx(ao.div,{className:`absolute inset-0 ${f.bg} bg-hover pointer-events-none`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.06}},transition:{duration:.08}})}),_]})});PI.displayName="AccordionTrigger";const TI=v.forwardRef(({children:t,className:e,...n},r)=>{const s=bw(),{isOpen:i}=bI();return E.jsx(oo,{initial:!1,children:i&&E.jsx(VY,{forceMount:!0,asChild:!0,...n,children:E.jsx(ao.div,{ref:r,className:dr("overflow-hidden",e),initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{...ef.moderate,bounce:0},onUpdate:()=>{s==null||s.remeasure()},onAnimationComplete:()=>{s==null||s.remeasure()},children:E.jsx("div",{className:"px-3 pb-3 pt-1 text-[13px] text-muted-foreground",children:t})})})})});TI.displayName="AccordionContent";const Yp=({children:t,defaultValue:e=[],className:n=""})=>E.jsx(SI,{type:"multiple",defaultValue:e,className:dr("w-full",n),children:t}),LQ=({value:t,title:e,description:n,dataCy:r,icon:s,children:i,className:a=""})=>{const c=a.includes("first-item");return E.jsxs(kI,{value:t,className:dr("w-full",!c&&"border-t border-main-border"),children:[E.jsxs(PI,{"data-cy":r,children:[s?E.jsx("span",{className:"mr-1 inline-flex items-center",children:s}):null,e]}),E.jsxs(TI,{children:[n?E.jsx("p",{className:"pb-2 text-sm text-content-subtle",children:n}):null,i]})]})};Yp.Item=LQ;const NQ=({message:t,isLoading:e=!0})=>E.jsxs("div",{className:"flex items-center gap-2 text-sm text-content",children:[e?E.jsx(p0,{className:"h-4 w-4 shrink-0 animate-spin text-primary",weight:"bold"}):null,E.jsx("span",{className:"whitespace-pre-wrap font-sans",children:t})]}),DQ=()=>{const t=v.useRef(Date.now()),[e,n]=v.useState(0);return v.useEffect(()=>{const r=()=>n(Math.max(0,Math.floor((Date.now()-t.current)/1e3)));r();const s=setInterval(r,1e3);return()=>clearInterval(s)},[]),e},jQ=t=>{const e=Math.floor(t/60),n=t%60;return`${e}:${n.toString().padStart(2,"0")}`},_8="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",x8="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",FQ="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",Xp=["Applying","Thinking","Planning","Crafting"],VQ=Xp.reduce((t,e)=>t.length>=e.length?t:e),$Q=20,HQ="Still working — runs can take a few minutes.",zQ=({hint:t,showElapsed:e=!0})=>{const[n,r]=v.useState(0),s=DQ();v.useEffect(()=>{const a=setInterval(()=>{r(c=>(c+1)%Xp.length)},4e3);return()=>clearInterval(a)},[]);const i=t??(e&&s>=$Q?HQ:null);return E.jsxs("div",{role:"status",className:"flex items-center gap-2 px-3 py-1","data-cy":"thinking-indicator",children:[E.jsx(xl.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:E.jsx(xl.path,{animate:{d:[_8,x8,FQ,x8,_8]},transition:{d:{duration:6,ease:"easeInOut",repeat:1/0,times:[0,.25,.5,.75,1]}}})}),E.jsxs("span",{className:"inline-grid overflow-hidden text-sm font-medium",style:{fontVariationSettings:Ld.medium},children:[E.jsx("span",{className:"shimmer-text invisible col-start-1 row-start-1","aria-hidden":"true",children:VQ}),E.jsx(oo,{mode:"popLayout",initial:!1,children:E.jsx(xl.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:Xp[n]},Xp[n])})]}),e?E.jsx("span",{className:"text-xs tabular-nums text-content-subtle","data-cy":"thinking-elapsed",children:jQ(s)}):null,i?E.jsx("span",{className:"text-xs text-content-subtle",children:i}):null]})};var UQ=Object.defineProperty,BQ=(t,e)=>UQ(t,"name",{value:e,configurable:!0});function Sw(t,[e,n]){return Math.min(n,Math.max(e,t))}BQ(Sw,"clamp");var WQ=Object.defineProperty,GQ=(t,e)=>WQ(t,"name",{value:e,configurable:!0});function RI(t){const e=v.useRef({value:t,previous:t});return v.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}GQ(RI,"usePrevious");var KQ=Object.defineProperty,ht=(t,e)=>KQ(t,"name",{value:e,configurable:!0}),AI=["PageUp","PageDown"],II=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],MI={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Df="Slider",[a2,ZQ,qQ]=hw(Df),[Ew,jJ]=wi(Df,[qQ]),[YQ,jf]=Ew(Df),XQ=v.forwardRef(ht(function(e,n){const{name:r,min:s=0,max:i=100,step:a=1,orientation:c="horizontal",disabled:u=!1,minStepsBetweenThumbs:f=0,defaultValue:h=[s],value:p,onValueChange:m=ht(()=>{},"onValueChange"),onValueCommit:_=ht(()=>{},"onValueCommit"),inverted:x=!1,form:y,...w}=e,S=v.useRef(new Set),T=v.useRef(0),P=v.useRef(!1),R=c==="horizontal"?QQ:JQ,[L,O]=v.useState(null),A=jt(n,O),[I=[],N]=va({prop:p,defaultProp:h,onChange:ht(q=>{var ne;(ne=[...S.current][T.current])==null||ne.focus({preventScroll:!0,focusVisible:P.current}),P.current=!1,m(q)},"onChange")}),j=v.useRef(I),F=v.useRef(I);v.useEffect(()=>{const q=y?L==null?void 0:L.ownerDocument.getElementById(y):L==null?void 0:L.closest("form");if(q instanceof HTMLFormElement){const $=ht(()=>N(F.current),"reset");return q.addEventListener("reset",$),()=>q.removeEventListener("reset",$)}},[L,y,N]);function K(q){const $=$I(I,q);G(q,$)}ht(K,"handleSlideStart");function X(q){G(q,T.current)}ht(X,"handleSlideMove");function W(){String(I)!==String(j.current)&&_(I)}ht(W,"handleSlideEnd");function G(q,$,{commit:ne}={commit:!1}){const z=kw(a),D=Vd(Math.round((q-s)/a)*a+s,z),Y=Sw(D,[s,i]);N((ee=[])=>{const ie=FI(ee,Y,$);if(UI(ie,f*a)){T.current=ie.indexOf(Y);const oe=String(ie)!==String(ee);return oe&&ne&&_(ie),oe?ie:ee}else return ee})}return ht(G,"updateValues"),E.jsx(YQ,{scope:e.__scopeSlider,name:r,disabled:u,min:s,max:i,valueIndexToChangeRef:T,thumbs:S.current,values:I,orientation:c,form:y,children:E.jsx(a2.Provider,{scope:e.__scopeSlider,children:E.jsx(a2.Slot,{scope:e.__scopeSlider,children:E.jsx(R,{"aria-disabled":u,"data-disabled":u?"":void 0,...w,ref:A,onPointerDown:Nt(w.onPointerDown,()=>{u||(j.current=I,P.current=!1)}),min:s,max:i,inverted:x,onSlideStart:u?void 0:K,onSlideMove:u?void 0:X,onSlideEnd:u?void 0:W,onHomeKeyDown:()=>{u||(P.current=!0,G(s,0,{commit:!0}))},onEndKeyDown:()=>{u||(P.current=!0,G(i,I.length-1,{commit:!0}))},onStepKeyDown:({event:q,direction:$})=>{if(!u){P.current=!0;const D=AI.includes(q.key)||q.shiftKey&&II.includes(q.key)?10:1,Y=T.current,ee=I[Y],ie=BI(ee,{min:s,step:a,direction:$,multiplier:D});G(ie,Y,{commit:!0})}}})})})})},"Slider")),[OI,LI]=Ew(Df,{startEdge:"left",endEdge:"right",size:"width",direction:1}),QQ=v.forwardRef(ht(function(e,n){const{min:r,max:s,dir:i,inverted:a,onSlideStart:c,onSlideMove:u,onSlideEnd:f,onStepKeyDown:h,...p}=e,[m,_]=v.useState(null),x=jt(n,_),y=v.useRef(void 0),w=vw(i),S=w==="ltr",T=S&&!a||!S&&a;function P(k){const R=y.current||m.getBoundingClientRect(),L=[0,R.width],A=I0(L,T?[r,s]:[s,r]);return y.current=R,A(k-R.left)}return ht(P,"getValueFromPointer"),E.jsx(OI,{scope:e.__scopeSlider,startEdge:T?"left":"right",endEdge:T?"right":"left",direction:T?1:-1,size:"width",children:E.jsx(NI,{dir:w,"data-orientation":"horizontal",...p,ref:x,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:k=>{const R=P(k.clientX);c==null||c(R)},onSlideMove:k=>{const R=P(k.clientX);u==null||u(R)},onSlideEnd:()=>{y.current=void 0,f==null||f()},onStepKeyDown:k=>{const L=MI[T?"from-left":"from-right"].includes(k.key);h==null||h({event:k,direction:L?-1:1})}})})},"SliderHorizontal")),JQ=v.forwardRef(ht(function(e,n){const{min:r,max:s,inverted:i,onSlideStart:a,onSlideMove:c,onSlideEnd:u,onStepKeyDown:f,...h}=e,p=v.useRef(null),m=jt(n,p),_=v.useRef(void 0),x=!i;function y(w){const S=_.current||p.current.getBoundingClientRect(),T=[0,S.height],k=I0(T,x?[s,r]:[r,s]);return _.current=S,k(w-S.top)}return ht(y,"getValueFromPointer"),E.jsx(OI,{scope:e.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:E.jsx(NI,{"data-orientation":"vertical",...h,ref:m,style:{...h.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const S=y(w.clientY);a==null||a(S)},onSlideMove:w=>{const S=y(w.clientY);c==null||c(S)},onSlideEnd:()=>{_.current=void 0,u==null||u()},onStepKeyDown:w=>{const T=MI[x?"from-bottom":"from-top"].includes(w.key);f==null||f({event:w,direction:T?-1:1})}})})},"SliderVertical")),NI=v.forwardRef(ht(function(e,n){const{__scopeSlider:r,onSlideStart:s,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:c,onEndKeyDown:u,onStepKeyDown:f,...h}=e,p=jf(Df,r);return E.jsx(ln.span,{...h,ref:n,onKeyDown:Nt(e.onKeyDown,m=>{m.key==="Home"?(c(m),m.preventDefault()):m.key==="End"?(u(m),m.preventDefault()):AI.concat(II).includes(m.key)&&(f(m),m.preventDefault())}),onPointerDown:Nt(e.onPointerDown,m=>{const _=m.target;_.setPointerCapture(m.pointerId),m.preventDefault(),p.thumbs.has(_)?_.focus({preventScroll:!0,focusVisible:!1}):s(m)}),onPointerMove:Nt(e.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&i(m)}),onPointerUp:Nt(e.onPointerUp,m=>{const _=m.target;_.hasPointerCapture(m.pointerId)&&(_.releasePointerCapture(m.pointerId),a(m))})})},"SliderImpl")),eJ="SliderTrack",tJ=v.forwardRef(ht(function(e,n){const{__scopeSlider:r,...s}=e,i=jf(eJ,r);return E.jsx(ln.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...s,ref:n})},"SliderTrack")),w8="SliderRange",nJ=v.forwardRef(ht(function(e,n){const{__scopeSlider:r,...s}=e,i=jf(w8,r),a=LI(w8,r),c=v.useRef(null),u=jt(n,c),f=i.values.length,h=i.values.map(_=>Cw(_,i.min,i.max)),p=f>1?Math.min(...h):0,m=100-Math.max(...h);return E.jsx(ln.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...s,ref:u,style:{...e.style,[a.startEdge]:p+"%",[a.endEdge]:m+"%"}})},"SliderRange")),rJ="SliderThumb",[sJ,DI]=Ew(rJ),iJ="SliderThumbProvider";function jI(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:s}=t,i=jf(iJ,e),a=ZQ(e),[c,u]=v.useState(null),f=v.useMemo(()=>c?a().findIndex(w=>w.ref.current===c):-1,[a,c]),h=Fx(c),p=c?!!i.form||!!c.closest("form"):!0,m=i.values[f],_=n??(i.name?i.name+(i.values.length>1?"[]":""):void 0),x=m===void 0?0:Cw(m,i.min,i.max);v.useEffect(()=>{if(c)return i.thumbs.add(c),()=>{i.thumbs.delete(c)}},[c,i.thumbs]);const y={value:m,name:_,form:i.form,isFormControl:p,index:f,thumb:c,onThumbChange:u,percent:x,size:h};return E.jsx(sJ,{scope:e,...y,children:WI(s)?s(y):r})}ht(jI,"SliderThumbProvider");var $1="SliderThumbTrigger",oJ=v.forwardRef(ht(function(e,n){const{__scopeSlider:r,...s}=e,i=jf($1,r),a=LI($1,r),{index:c,value:u,percent:f,size:h,onThumbChange:p}=DI($1,r),m=jt(n,p),_=VI(c,i.values.length),x=h==null?void 0:h[a.size],y=x?HI(x,f,a.direction):0;return E.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${f}% + ${y}px)`},children:E.jsx(a2.ItemSlot,{scope:r,children:E.jsx(ln.span,{role:"slider","aria-label":e["aria-label"]||_,"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:Nt(e.onFocus,()=>{i.valueIndexToChangeRef.current=c})})})})},"SliderThumbTrigger")),aJ=v.forwardRef(ht(function(e,n){const{__scopeSlider:r,name:s,...i}=e;return E.jsx(jI,{__scopeSlider:r,name:s,internal_do_not_use_render:({index:a,isFormControl:c})=>E.jsxs(E.Fragment,{children:[E.jsx(oJ,{...i,ref:n,__scopeSlider:r}),c?E.jsx(cJ,{__scopeSlider:r},a):null]})})},"SliderThumb")),lJ="SliderBubbleInput",cJ=v.forwardRef(ht(function({__scopeSlider:e,...n},r){const{value:s,name:i,form:a}=DI(lJ,e),c=v.useRef(null),u=jt(c,r),f=RI(s);return v.useEffect(()=>{const h=c.current;if(!h)return;const p=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(p,"value").set;if(f!==s&&_){const x=new Event("input",{bubbles:!0});_.call(h,s),h.dispatchEvent(x)}},[f,s]),E.jsx(ln.input,{style:{display:"none"},name:i,form:a,...n,ref:u,defaultValue:s})},"SliderBubbleInput"));function FI(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}ht(FI,"getNextSortedValues");function Cw(t,e,n){const i=100/(n-e)*(t-e);return Sw(i,[0,100])}ht(Cw,"convertValueToPercentage");function VI(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}ht(VI,"getLabel");function $I(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)}ht($I,"getClosestValueIndex");function HI(t,e,n){const r=t/2,i=I0([0,50],[0,r]);return(r-i(e)*n)*n}ht(HI,"getThumbInBoundsOffset");function zI(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}ht(zI,"getStepsBetweenValues");function UI(t,e){if(e>0){const n=zI(t);return Math.min(...n)>=e}return!0}ht(UI,"hasMinStepsBetweenValues");function I0(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])}}ht(I0,"linearScale");function kw(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]||"",a=Number(s);return Math.max(0,i.length-a)}const n=e.split(".")[1];return n?n.length:0}ht(kw,"getDecimalCount");function Vd(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}ht(Vd,"roundValue");function BI(t,{min:e,step:n,direction:r,multiplier:s}){const i=kw(n),a=(t-e)/n,c=Math.round(a),u=Vd(c*n+e,i)===Vd(t,i);let f;return u?f=c+s*r:r>0?f=Math.ceil(a):f=Math.floor(a),Vd(f*n+e,i)}ht(BI,"getNextStepValue");function WI(t){return typeof t=="function"}ht(WI,"isFunction");const l2=v.forwardRef(({className:t,...e},n)=>E.jsxs(XQ,{ref:n,className:dr("relative flex w-full touch-none select-none items-center","data-[disabled]:opacity-50",t),...e,children:[E.jsx(tJ,{className:"relative h-1 w-full grow overflow-hidden rounded-full bg-input",children:E.jsx(nJ,{className:"absolute h-full bg-primary"})}),E.jsx(aJ,{className:dr("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")})]}));l2.displayName="Slider";const uJ=[{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"}],dJ=[{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"}],fJ=[{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"}],bp=[{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."}],hJ=()=>{window.location.hash=""},zi=({title:t,eyebrow:e,description:n,children:r})=>E.jsxs("section",{className:"border-border bg-card shadow-surface-3 rounded-2xl border p-5",children:[E.jsxs("div",{className:"mb-5 max-w-2xl",children:[E.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.18em] uppercase",children:e}),E.jsx("h2",{className:"text-foreground mt-2 text-xl font-semibold",children:t}),E.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:n})]}),r]}),b8=({swatches:t})=>E.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map(e=>E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-3",children:[E.jsx("div",{className:`h-16 rounded-lg ${e.className}`}),E.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3",children:[E.jsx("span",{className:"text-foreground text-sm font-medium",children:e.name}),E.jsx("code",{className:"bg-muted text-muted-foreground rounded px-2 py-1 text-xs",children:e.utility})]})]},e.name))}),pJ=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",mJ=()=>{const t=bp.filter(n=>n.status==="showcased").length,e=bp.filter(n=>n.status==="cataloged").length;return E.jsx("main",{className:"bg-main font-main text-content h-screen overflow-y-auto",children:E.jsxs("div",{className:"mx-auto flex w-full max-w-6xl flex-col gap-6 px-6 py-6 lg:px-8",children:[E.jsxs("header",{className:"border-border bg-surface-2 shadow-surface-4 rounded-3xl border p-6",children:[E.jsxs("button",{type:"button",onClick:hJ,className:"text-content-subtle hover:text-content mb-6 inline-flex items-center gap-2 text-sm transition-colors",children:[E.jsx(Hz,{className:"h-4 w-4",weight:"bold"}),"Back to editor"]}),E.jsxs("div",{className:"flex flex-col gap-5 lg:flex-row lg:items-end lg:justify-between",children:[E.jsxs("div",{className:"max-w-3xl",children:[E.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.22em] uppercase",children:"Local component gallery"}),E.jsx("h1",{className:"text-foreground mt-3 text-4xl font-semibold tracking-tight",children:"Rivet design system"}),E.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."})]}),E.jsx("div",{className:"border-border bg-surface-3 rounded-2xl border p-4",children:E.jsxs("div",{className:"text-content-muted flex items-center gap-3 text-sm",children:[E.jsx(R5,{className:"text-primary h-5 w-5",weight:"bold"}),"Open with ",E.jsx("code",{className:"text-content",children:"#/design-system"})]})})]})]}),E.jsx(zi,{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:E.jsxs("div",{className:"grid gap-4 lg:grid-cols-[1fr_1fr]",children:[E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Rivet Button wrapper"}),E.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[E.jsx(Ac,{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"}),E.jsx(Ac,{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"}),E.jsx(Ac,{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"}),E.jsx(FR,{primaryLabel:"Ship",primaryIcon:m1,primaryAction:()=>{},dropdownItems:[{label:"Create PR",onClick:()=>{}},{label:"Copy branch",onClick:()=>{}}]})]})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Tooltip states"}),E.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[E.jsx(so,{label:"Rivet tooltip API",side:"bottom",children:E.jsx("button",{className:"border-border bg-surface-4 text-content rounded-lg border px-4 py-2 text-sm",children:"Hover target"})}),E.jsx(Wx,{content:"Forced open preview",forceOpen:!0,side:"right",children:E.jsx("button",{className:"bg-selected text-content rounded-lg px-4 py-2 text-sm",children:"UI tooltip"})})]})]})]})}),E.jsx(zi,{eyebrow:"Tokens",title:"Surface ladder",description:"Surface tokens move from the base app background toward raised panels without leaving the dark Rivet palette.",children:E.jsx(b8,{swatches:uJ})}),E.jsx(zi,{eyebrow:"Tokens",title:"Color roles",description:"Named roles should communicate purpose: brand, selection, neutral accent, and outcome colors.",children:E.jsx(b8,{swatches:dJ})}),E.jsx(zi,{eyebrow:"Type",title:"Typography",description:"Satoshi remains the default UI voice with clear hierarchy and muted support text.",children:E.jsxs("div",{className:"grid gap-4 lg:grid-cols-3",children:[E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-primary text-xs tracking-[0.18em] uppercase",children:"Display"}),E.jsx("p",{className:"text-foreground mt-2 text-3xl font-semibold tracking-tight",children:"Visual edits, quickly"})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground text-sm font-semibold",children:"Panel heading"}),E.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."})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-content-subtle text-xs font-medium tracking-[0.16em] uppercase",children:"Micro label"}),E.jsx("code",{className:"bg-muted text-muted-foreground mt-3 block rounded-lg px-3 py-2 text-xs",children:"font-main text-content"})]})]})}),E.jsx(zi,{eyebrow:"Layout",title:"Spacing rhythm",description:"A compact spacing scale keeps editor chrome dense while preserving scannable groupings.",children:E.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:E.jsx("div",{className:"flex flex-col gap-3",children:fJ.map(n=>E.jsxs("div",{className:"flex items-center gap-4",children:[E.jsx("code",{className:"text-muted-foreground w-16 text-xs",children:n.name}),E.jsx("div",{className:`${n.className} bg-primary h-4 rounded`}),E.jsx("div",{className:"bg-border h-px flex-1"})]},n.name))})})}),E.jsx(zi,{eyebrow:"Primitives",title:"Accordion and slider",description:"Representative Radix primitives styled through the local component layer.",children:E.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[E.jsxs(Yp,{defaultValue:["foundations"],className:"border-border bg-surface-2 rounded-xl border p-2",children:[E.jsx(Yp.Item,{value:"foundations",title:"Foundations",description:"Tokens, surfaces, type, and spacing.",className:"first-item",icon:E.jsx(m1,{className:"text-primary h-4 w-4"}),children:E.jsx("p",{children:"Use these pieces before adding one-off visual rules."})}),E.jsx(Yp.Item,{value:"components",title:"Components",description:"Buttons, tooltips, accordions, sliders.",children:E.jsx("p",{children:"Keep states visible in this route as the system evolves."})})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-5",children:[E.jsx("p",{className:"text-foreground mb-5 text-sm font-medium",children:"Slider states"}),E.jsxs("div",{className:"space-y-6",children:[E.jsx(l2,{defaultValue:[64],max:100,step:1}),E.jsx(l2,{defaultValue:[36],max:100,step:1,disabled:!0})]})]})]})}),E.jsx(zi,{eyebrow:"Feedback",title:"Motion and loading",description:"Loading states use existing CSS animation utilities and avoid per-frame React work where possible.",children:E.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Progress"}),E.jsx(NQ,{message:"Applying visual change..."})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Sparkle strip"}),E.jsx(Ix,{className:"text-primary text-xl"})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Shimmer text"}),E.jsx("span",{className:"shimmer-text text-sm font-medium",children:"Generating variants"})]}),E.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4 sm:col-span-3",children:E.jsx(zQ,{hint:"Reading selected elements"})})]})}),E.jsx(zi,{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:E.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[E.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:E.jsx(U_,{fill:"surface",loader:"coalesce",trackGlobalLoaderCount:!1})}),E.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:E.jsx(cA,{icon:E.jsx(m1,{size:32}),title:"Nothing to preview yet",description:"Pick a direction from the panel."})}),E.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:E.jsx(Bm,{fill:"surface",size:"sm",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>{}}]})})]})}),E.jsxs(zi,{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:[E.jsxs("div",{className:"mb-4 grid gap-3 sm:grid-cols-3",children:[E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Total components"}),E.jsx("p",{className:"text-foreground mt-2 text-2xl font-semibold",children:bp.length})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Showcased"}),E.jsx("p",{className:"text-accent-success mt-2 text-2xl font-semibold",children:t})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Cataloged"}),E.jsx("p",{className:"text-primary mt-2 text-2xl font-semibold",children:e})]})]}),E.jsxs("div",{className:"border-border overflow-hidden rounded-xl border",children:[E.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:[E.jsx("span",{children:"Component"}),E.jsx("span",{children:"Status"}),E.jsx("span",{children:"Coverage note"})]}),E.jsx("div",{className:"divide-border bg-surface-2 divide-y",children:bp.map(n=>E.jsxs("div",{className:"grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] gap-3 px-4 py-3 text-sm",children:[E.jsxs("div",{children:[E.jsx("p",{className:"text-foreground font-medium",children:n.name}),E.jsx("code",{className:"text-muted-foreground text-xs",children:n.path})]}),E.jsx("div",{children:E.jsx("span",{className:`inline-flex rounded-full border px-2 py-1 text-xs font-medium ${pJ(n.status)}`,children:n.status})}),E.jsx("p",{className:"text-muted-foreground",children:n.note})]},n.path))})]})]})]})})},gJ=t=>(t.startsWith("#/")?t.slice(2):t.slice(1)).split("?")[0]==="design-system"?"design-system":"editor",vJ=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"},H1=({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}:{}}}),S8=xs("App"),yJ=2e3,_J=60,E8="Connecting to Google...",C8="https://rivet-proxy.onrender.com",xJ=`<!doctype html>
|
|
394
|
+
<html lang="en">
|
|
395
|
+
<head>
|
|
396
|
+
<meta charset="utf-8" />
|
|
397
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
398
|
+
<title>${E8}</title>
|
|
399
|
+
<style>
|
|
400
|
+
:root { color-scheme: light dark; }
|
|
401
|
+
body {
|
|
402
|
+
margin: 0;
|
|
403
|
+
min-height: 100vh;
|
|
404
|
+
display: grid;
|
|
405
|
+
place-items: center;
|
|
406
|
+
font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
|
|
407
|
+
background: #111215;
|
|
408
|
+
color: #f3f4f6;
|
|
409
|
+
}
|
|
410
|
+
.panel {
|
|
411
|
+
border: 1px solid rgba(255, 255, 255, 0.16);
|
|
412
|
+
border-radius: 12px;
|
|
413
|
+
padding: 18px 22px;
|
|
414
|
+
background: rgba(255, 255, 255, 0.06);
|
|
415
|
+
font-size: 14px;
|
|
416
|
+
}
|
|
417
|
+
</style>
|
|
418
|
+
</head>
|
|
419
|
+
<body>
|
|
420
|
+
<div class="panel">${E8}</div>
|
|
421
|
+
</body>
|
|
422
|
+
</html>`,c2=274,Jm=395,z1=Math.min(Jm,Math.round((c2+Jm)/2*1.1)),k8="rivet:panelWidth:v2",wJ=t=>{if(!(t instanceof HTMLElement))return!1;const e=t.tagName.toLowerCase();return t.isContentEditable||e==="input"||e==="textarea"||e==="select"},bJ=({projectPath:t})=>{const e=et(rR)>0,[n,r]=HP(tR),s=w$(),[i,a]=v.useState(()=>{if(typeof window>"u")return z1;const k=Number(window.localStorage.getItem(k8));return Number.isFinite(k)&&k>=c2&&k<=Jm?k:z1}),[c,u]=v.useState(!1),[f,h]=v.useState($q),p=n?i:0,[m,_]=v.useState(n);v.useEffect(()=>{if(!n){_(!1);return}h(k=>Vq({position:k,boundsLeftPx:i}))},[n,i]),v.useEffect(()=>{window.localStorage.setItem(k8,String(i))},[i]),v.useEffect(()=>{if(!n)return;const k=R=>{R.key==="Escape"&&(wJ(R.target)||(R.preventDefault(),r(!1)))};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[n,r]);const x=v.useCallback(k=>{k.preventDefault(),k.stopPropagation();const R=k.clientX,L=i;u(!0);const O=I=>{const N=Math.min(Jm,Math.max(c2,L+(I.clientX-R)));a(N)},A=()=>{window.removeEventListener("pointermove",O),window.removeEventListener("pointerup",A),window.removeEventListener("pointercancel",A),u(!1)};window.addEventListener("pointermove",O),window.addEventListener("pointerup",A),window.addEventListener("pointercancel",A)},[i]),y=v.useCallback(()=>a(z1),[]),w=Jq(),S=et(Mf);nY({enabled:!S});const T=w.isProcessing?"Completing authentication...":null,P=ot(lR);return v.useEffect(()=>{P(t??null)},[t,P]),E.jsxs(xl.div,{className:"relative flex h-screen overflow-hidden",initial:!1,animate:{opacity:1},transition:{duration:.5,ease:"easeOut"},"data-cy":"rivet-app",children:[T!==null?E.jsx("div",{className:"absolute inset-0 z-50",children:E.jsx(kq,{message:T})}):null,E.jsx("div",{className:"relative flex min-w-0 flex-1 flex-col",children:E.jsx(eZ,{})}),E.jsx(E.Fragment,{children:e?null:E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"relative order-first h-full flex-shrink-0",style:{width:m?i:0},children:E.jsxs(xl.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&&_(!0)},style:{width:i,willChange:"transform"},children:[E.jsx(hK,{onClose:()=>r(!1)}),E.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize panel",onPointerDown:x,onDoubleClick:y,className:"group/resize absolute inset-y-0 right-0 z-20 flex w-3 cursor-col-resize touch-none justify-end",children:E.jsx("span",{className:`h-full transition-all duration-150 ${c?"bg-content-muted w-0.5":"bg-divider group-hover/resize:bg-content-muted w-px group-hover/resize:w-0.5"}`})})]})}),c&&E.jsx("div",{className:"fixed inset-0 z-[100] cursor-col-resize"}),E.jsx(Uq,{isVisible:!0,isPanelOpen:n,isReducedMotion:!!s,position:f,dragBoundsLeftPx:p,onPositionChange:h,onToggle:()=>r(k=>!k)})]})}),E.jsx(q$,{duration:5e3,richColors:!0,toastOptions:{style:{maxHeight:"150px",overflow:"hidden"}}})]})},u2="rivet_connect_deep_link",SJ=()=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search),e=t.get("connect"),n=e??window.sessionStorage.getItem(u2);if(n!=="pinterest"&&n!=="arena")return null;if(window.sessionStorage.setItem(u2,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},EJ=SJ(),CJ=()=>{const[t,e]=v.useState(window.location.hash),[n]=v.useState(()=>typeof window<"u"&&window.sessionStorage.getItem(Zp)==="1"),[r,s]=v.useState(!1),[i,a]=v.useState(EJ);v.useEffect(()=>{n&&window.sessionStorage.removeItem(Zp)},[n]);const{config:c,refetchConfig:u,loading:f,error:h}=Xq(),p=ot(Mf),[m,_]=v.useState(!1),[x,y]=v.useState(null),[w,S]=v.useState(!1);v.useEffect(()=>{c!=null&&c.userId?(be.identify(c.userId,{...c.email?{email:c.email}:{}}),c.email&&be.alias(c.email,c.userId)):c!=null&&c.email&&be.identify(c.email,{email:c.email})},[c==null?void 0:c.userId,c==null?void 0:c.email]),v.useEffect(()=>{c&&be.register({source:"visual_editor",surface:"visual_editor"})},[c]);const T=v.useCallback(async()=>{var K;const I=globalThis.crypto.randomUUID(),N=Date.now();_(!0),y(null);const j=H1({outcome:"started",authAttemptId:I,startedAt:N,now:N});be.capture(j.event,j.properties);let F=null;try{if(F=window.open("","_blank"),!F)throw new Error("Pop-up blocked. Please allow pop-ups and try again.");try{F.document.open(),F.document.write(xJ),F.document.close()}catch(G){S8.warn("Failed to render loading state in auth popup:",G)}const X=await fetch(`${C8}/api/auth/google/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"desktop"})}),W=await X.json();if(!X.ok||!W.success||!W.authUrl||!W.sessionId||!W.pollSecret)throw new Error(W.error||W.message||"Failed to start Google login");if(F.closed)throw new Error("Sign-in window was closed before Google login started.");F.location.href=W.authUrl;for(let G=0;G<_J;G+=1){if(F.closed)throw new Error("Sign-in window was closed before authentication completed.");const $=await(await fetch(`${C8}/api/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:W.sessionId,pollSecret:W.pollSecret})})).json();if($.success&&$.token&&((K=$.user)!=null&&K.email)){if(!(await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:$.user.email,token:$.token,refreshToken:$.refreshToken,userId:$.user.id})})).ok)throw new Error("Signed in, but failed to store session locally.");F.close(),window.sessionStorage.setItem(Zp,"1");const z=H1({outcome:"completed",authAttemptId:I,startedAt:N,now:Date.now()});be.capture(z.event,z.properties),window.location.reload();return}if($.error&&$.error!=="Pending")throw new Error($.error||"Google login failed");await new Promise(ne=>setTimeout(ne,yJ))}throw new Error("Authentication timed out. Please try again.")}catch(X){F&&!F.closed&&F.close();const W=X instanceof Error?X.message:"Failed to start login flow";S8.warn("Login failed:",W);const G=H1({outcome:"failed",authAttemptId:I,startedAt:N,now:Date.now(),failureReason:vJ(W)});be.capture(G.event,G.properties),y(W),_(!1)}},[]),P=c!=null&&c.agentModeAvailable!==!0,k=gJ(t),R=v.useCallback(async()=>{S(!0),p(!0);try{await u()}finally{p(!1),S(!1)}},[u,p]);if(v.useEffect(()=>{const I=()=>{const N=window.location.hash;e(N)};return window.addEventListener("hashchange",I),()=>window.removeEventListener("hashchange",I)},[]),k==="design-system")return E.jsx(mJ,{});if(!f&&c===null&&!w){const I=h||"Could not load Rivet configuration.";return E.jsx("div",{className:"bg-main flex h-screen items-center justify-center px-6",children:E.jsxs("div",{className:"border-divider bg-main w-full max-w-md rounded-lg border p-6 text-center shadow-lg",children:[E.jsx("p",{className:"text-content text-sm font-medium",children:"We could not start Rivet yet."}),E.jsx("p",{className:"text-content-dim mt-2 text-xs",children:I}),E.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:()=>{R()},children:"Retry"})]})})}if(P)return E.jsx(Eq,{isSigningIn:m,onStartSignIn:()=>{T()},errorMessage:x,displayMode:"full"});const O=(c==null?void 0:c.agentModeAvailable)===!0&&i!==null,A=(c==null?void 0:c.agentModeAvailable)===!0&&n&&!r&&!O;return E.jsxs(E.Fragment,{children:[E.jsx(bJ,{projectPath:c==null?void 0:c.projectPath}),E.jsx(z_,{context:"onboarding",isOpen:A,onClose:()=>s(!0)}),E.jsx(z_,{context:"menu",isOpen:O,highlightProvider:i,onClose:()=>{window.sessionStorage.removeItem(u2),a(null)}})]})},kJ="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",PJ=new tL,TJ={session_recording:{maskAllInputs:!0,maskTextSelector:"[data-rivet-private]"}},RJ=()=>E.jsx("div",{style:{display:"flex",height:"100vh",alignItems:"center",justifyContent:"center"},children:E.jsx("p",{style:{fontSize:"14px",color:"#6b7280"},children:"Something went wrong. Please reload the page."})});GD.createRoot(document.getElementById("root")).render(E.jsx(ve.StrictMode,{children:E.jsx(DD,{apiKey:kJ,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",...TJ,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.14.14",env:"production"})}},children:E.jsx($D,{fallback:E.jsx(RJ,{}),children:E.jsx(nL,{client:PJ,children:E.jsx(mG,{defaultShape:"rounded",children:E.jsx(MQ,{defaultLibrary:"lucide",children:E.jsx(CJ,{})})})})})})}));
|