rivet-design 0.18.4 → 0.19.0
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/cli/commands/mcpServe.d.ts.map +1 -1
- package/dist/cli/commands/mcpServe.js +27 -2
- package/dist/cli/commands/mcpServe.js.map +1 -1
- package/dist/cli/commands/profile.d.ts.map +1 -1
- package/dist/cli/commands/profile.js +15 -1
- package/dist/cli/commands/profile.js.map +1 -1
- package/dist/cli/router.d.ts.map +1 -1
- package/dist/cli/router.js +2 -1
- package/dist/cli/router.js.map +1 -1
- package/dist/routes/library/profiles.d.ts.map +1 -1
- package/dist/routes/library/profiles.js +46 -0
- package/dist/routes/library/profiles.js.map +1 -1
- package/dist/routes/referenceProfiles.d.ts +2 -0
- package/dist/routes/referenceProfiles.d.ts.map +1 -0
- package/dist/routes/referenceProfiles.js +79 -0
- package/dist/routes/referenceProfiles.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +2 -0
- package/dist/server.js.map +1 -1
- package/dist/services/TelemetryService.d.ts +1 -1
- package/dist/services/TelemetryService.d.ts.map +1 -1
- package/dist/services/TelemetryService.js.map +1 -1
- package/dist/services/profiles/DesignProfiles.d.ts +18 -0
- package/dist/services/profiles/DesignProfiles.d.ts.map +1 -1
- package/dist/services/profiles/DesignProfiles.js +129 -0
- package/dist/services/profiles/DesignProfiles.js.map +1 -1
- package/dist/services/profiles/ProfileMedia.d.ts +1 -0
- package/dist/services/profiles/ProfileMedia.d.ts.map +1 -1
- package/dist/services/profiles/ProfileMedia.js +5 -1
- package/dist/services/profiles/ProfileMedia.js.map +1 -1
- package/dist/storage/profiles/ProfileRecords.d.ts +2 -0
- package/dist/storage/profiles/ProfileRecords.d.ts.map +1 -1
- package/dist/storage/profiles/ProfileRecords.js +34 -0
- package/dist/storage/profiles/ProfileRecords.js.map +1 -1
- package/dist/types/design-library.d.ts +50 -0
- package/dist/types/design-library.d.ts.map +1 -0
- package/dist/types/design-library.js +32 -0
- package/dist/types/design-library.js.map +1 -0
- package/dist/types/reference-onboarding.d.ts +2 -2
- package/dist/utils/skills/cli-guidance.d.ts +1 -1
- package/dist/utils/skills/cli-guidance.d.ts.map +1 -1
- package/dist/utils/skills/cli-guidance.js +3 -1
- package/dist/utils/skills/cli-guidance.js.map +1 -1
- package/package.json +1 -1
- package/src/ui/dist/assets/LibraryApp-B4ztVk52.js +36 -0
- package/src/ui/dist/assets/main-CAPEQf84.js +438 -0
- package/src/ui/dist/assets/main-Ky91HHF_.css +1 -0
- package/src/ui/dist/index.html +2 -2
- package/src/ui/dist/assets/LibraryApp-Cxdyy4oV.js +0 -21
- package/src/ui/dist/assets/main-B-LY2LQB.css +0 -1
- package/src/ui/dist/assets/main-CPHvvBUN.js +0 -438
|
@@ -1,438 +0,0 @@
|
|
|
1
|
-
var OD=Object.defineProperty;var S8=t=>{throw TypeError(t)};var LD=(t,e,n)=>e in t?OD(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ca=(t,e,n)=>LD(t,typeof e!="symbol"?e+"":e,n),A1=(t,e,n)=>e.has(t)||S8("Cannot "+n);var q=(t,e,n)=>(A1(t,e,"read from private field"),n?n.call(t):e.get(t)),tt=(t,e,n)=>e.has(t)?S8("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ae=(t,e,n,r)=>(A1(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),_t=(t,e,n)=>(A1(t,e,"access private method"),n);var r0=(t,e,n,r)=>({set _(s){Ae(t,e,s,n)},get _(){return q(t,e,r)}});function ND(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in t)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();const DD="modulepreload",$D=function(t){return"/"+t},k8={},oP=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let o=function(d){return Promise.all(d.map(f=>Promise.resolve(f).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=o(n.map(d=>{if(d=$D(d),d in k8)return;k8[d]=!0;const f=d.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const g=document.createElement("link");if(g.rel=f?"stylesheet":DD,f||(g.as="script"),g.crossOrigin="",g.href=d,u&&g.setAttribute("nonce",u),document.head.appendChild(g),f)return new Promise((v,w)=>{g.addEventListener("load",v),g.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return e().catch(i)})};function _g(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var T1={exports:{}},ef={},I1={exports:{}},ht={};/**
|
|
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 E8;function jD(){if(E8)return ht;E8=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.iterator;function g(N){return N===null||typeof N!="object"?null:(N=p&&N[p]||N["@@iterator"],typeof N=="function"?N:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,_={};function x(N,X,oe){this.props=N,this.context=X,this.refs=_,this.updater=oe||v}x.prototype.isReactComponent={},x.prototype.setState=function(N,X){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,X,"setState")},x.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function b(){}b.prototype=x.prototype;function E(N,X,oe){this.props=N,this.context=X,this.refs=_,this.updater=oe||v}var C=E.prototype=new b;C.constructor=E,w(C,x.prototype),C.isPureReactComponent=!0;var R=Array.isArray,A=Object.prototype.hasOwnProperty,I={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function T(N,X,oe){var re,se={},fe=null,_e=null;if(X!=null)for(re in X.ref!==void 0&&(_e=X.ref),X.key!==void 0&&(fe=""+X.key),X)A.call(X,re)&&!M.hasOwnProperty(re)&&(se[re]=X[re]);var de=arguments.length-2;if(de===1)se.children=oe;else if(1<de){for(var ae=Array(de),Oe=0;Oe<de;Oe++)ae[Oe]=arguments[Oe+2];se.children=ae}if(N&&N.defaultProps)for(re in de=N.defaultProps,de)se[re]===void 0&&(se[re]=de[re]);return{$$typeof:t,type:N,key:fe,ref:_e,props:se,_owner:I.current}}function L(N,X){return{$$typeof:t,type:N.type,key:X,ref:N.ref,props:N.props,_owner:N._owner}}function D(N){return typeof N=="object"&&N!==null&&N.$$typeof===t}function j(N){var X={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(oe){return X[oe]})}var H=/\/+/g;function Y(N,X){return typeof N=="object"&&N!==null&&N.key!=null?j(""+N.key):X.toString(36)}function U(N,X,oe,re,se){var fe=typeof N;(fe==="undefined"||fe==="boolean")&&(N=null);var _e=!1;if(N===null)_e=!0;else switch(fe){case"string":case"number":_e=!0;break;case"object":switch(N.$$typeof){case t:case e:_e=!0}}if(_e)return _e=N,se=se(_e),N=re===""?"."+Y(_e,0):re,R(se)?(oe="",N!=null&&(oe=N.replace(H,"$&/")+"/"),U(se,X,oe,"",function(Oe){return Oe})):se!=null&&(D(se)&&(se=L(se,oe+(!se.key||_e&&_e.key===se.key?"":(""+se.key).replace(H,"$&/")+"/")+N)),X.push(se)),1;if(_e=0,re=re===""?".":re+":",R(N))for(var de=0;de<N.length;de++){fe=N[de];var ae=re+Y(fe,de);_e+=U(fe,X,oe,ae,se)}else if(ae=g(N),typeof ae=="function")for(N=ae.call(N),de=0;!(fe=N.next()).done;)fe=fe.value,ae=re+Y(fe,de++),_e+=U(fe,X,oe,ae,se);else if(fe==="object")throw X=String(N),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.");return _e}function z(N,X,oe){if(N==null)return N;var re=[],se=0;return U(N,re,"","",function(fe){return X.call(oe,fe,se++)}),re}function Z(N){if(N._status===-1){var X=N._result;X=X(),X.then(function(oe){(N._status===0||N._status===-1)&&(N._status=1,N._result=oe)},function(oe){(N._status===0||N._status===-1)&&(N._status=2,N._result=oe)}),N._status===-1&&(N._status=0,N._result=X)}if(N._status===1)return N._result.default;throw N._result}var Q={current:null},B={transition:null},ee={ReactCurrentDispatcher:Q,ReactCurrentBatchConfig:B,ReactCurrentOwner:I};function W(){throw Error("act(...) is not supported in production builds of React.")}return ht.Children={map:z,forEach:function(N,X,oe){z(N,function(){X.apply(this,arguments)},oe)},count:function(N){var X=0;return z(N,function(){X++}),X},toArray:function(N){return z(N,function(X){return X})||[]},only:function(N){if(!D(N))throw Error("React.Children.only expected to receive a single React element child.");return N}},ht.Component=x,ht.Fragment=n,ht.Profiler=s,ht.PureComponent=E,ht.StrictMode=r,ht.Suspense=u,ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ee,ht.act=W,ht.cloneElement=function(N,X,oe){if(N==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+N+".");var re=w({},N.props),se=N.key,fe=N.ref,_e=N._owner;if(X!=null){if(X.ref!==void 0&&(fe=X.ref,_e=I.current),X.key!==void 0&&(se=""+X.key),N.type&&N.type.defaultProps)var de=N.type.defaultProps;for(ae in X)A.call(X,ae)&&!M.hasOwnProperty(ae)&&(re[ae]=X[ae]===void 0&&de!==void 0?de[ae]:X[ae])}var ae=arguments.length-2;if(ae===1)re.children=oe;else if(1<ae){de=Array(ae);for(var Oe=0;Oe<ae;Oe++)de[Oe]=arguments[Oe+2];re.children=de}return{$$typeof:t,type:N.type,key:se,ref:fe,props:re,_owner:_e}},ht.createContext=function(N){return N={$$typeof:o,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},N.Provider={$$typeof:i,_context:N},N.Consumer=N},ht.createElement=T,ht.createFactory=function(N){var X=T.bind(null,N);return X.type=N,X},ht.createRef=function(){return{current:null}},ht.forwardRef=function(N){return{$$typeof:l,render:N}},ht.isValidElement=D,ht.lazy=function(N){return{$$typeof:f,_payload:{_status:-1,_result:N},_init:Z}},ht.memo=function(N,X){return{$$typeof:d,type:N,compare:X===void 0?null:X}},ht.startTransition=function(N){var X=B.transition;B.transition={};try{N()}finally{B.transition=X}},ht.unstable_act=W,ht.useCallback=function(N,X){return Q.current.useCallback(N,X)},ht.useContext=function(N){return Q.current.useContext(N)},ht.useDebugValue=function(){},ht.useDeferredValue=function(N){return Q.current.useDeferredValue(N)},ht.useEffect=function(N,X){return Q.current.useEffect(N,X)},ht.useId=function(){return Q.current.useId()},ht.useImperativeHandle=function(N,X,oe){return Q.current.useImperativeHandle(N,X,oe)},ht.useInsertionEffect=function(N,X){return Q.current.useInsertionEffect(N,X)},ht.useLayoutEffect=function(N,X){return Q.current.useLayoutEffect(N,X)},ht.useMemo=function(N,X){return Q.current.useMemo(N,X)},ht.useReducer=function(N,X,oe){return Q.current.useReducer(N,X,oe)},ht.useRef=function(N){return Q.current.useRef(N)},ht.useState=function(N){return Q.current.useState(N)},ht.useSyncExternalStore=function(N,X,oe){return Q.current.useSyncExternalStore(N,X,oe)},ht.useTransition=function(){return Q.current.useTransition()},ht.version="18.3.1",ht}var C8;function Vw(){return C8||(C8=1,I1.exports=jD()),I1.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 P8;function FD(){if(P8)return ef;P8=1;var t=Vw(),e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(l,u,d){var f,p={},g=null,v=null;d!==void 0&&(g=""+d),u.key!==void 0&&(g=""+u.key),u.ref!==void 0&&(v=u.ref);for(f in u)r.call(u,f)&&!i.hasOwnProperty(f)&&(p[f]=u[f]);if(l&&l.defaultProps)for(f in u=l.defaultProps,u)p[f]===void 0&&(p[f]=u[f]);return{$$typeof:e,type:l,key:g,ref:v,props:p,_owner:s.current}}return ef.Fragment=n,ef.jsx=o,ef.jsxs=o,ef}var R8;function VD(){return R8||(R8=1,T1.exports=FD()),T1.exports}var S=VD(),m=Vw();const we=_g(m),Dh=ND({__proto__:null,default:we},[m]),aP=m.createContext(void 0),lP=t=>{const e=m.useContext(aP);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},HD=({client:t,children:e})=>(m.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),S.jsx(aP.Provider,{value:t,children:e})),zD={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)};var va,Fw,Y3,BD=(Y3=class{constructor(){tt(this,va,zD);tt(this,Fw,!1)}setTimeoutProvider(t){Ae(this,va,t)}setTimeout(t,e){return q(this,va).setTimeout(t,e)}clearTimeout(t){q(this,va).clearTimeout(t)}setInterval(t,e){return q(this,va).setInterval(t,e)}clearInterval(t){q(this,va).clearInterval(t)}},va=new WeakMap,Fw=new WeakMap,Y3);const Fl=new BD;function UD(t){setTimeout(t,0)}const ZD=typeof window>"u"||"Deno"in globalThis;function Zr(){}function WD(t,e){return typeof t=="function"?t(e):t}function cP(t){return typeof t=="number"&&t>=0&&t!==1/0}function uP(t,e){return Math.max(t+(e||0)-Date.now(),0)}function fn(t,e){return typeof t=="function"?t(e):t}function A8(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:l}=t;if(o){if(r){if(e.queryHash!==Hw(o,e.options))return!1}else if(!zu(e.queryKey,o))return!1}if(n!=="all"){const u=e.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||s&&s!==e.state.fetchStatus||i&&!i(e))}function T8(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(Kf(e.options.mutationKey)!==Kf(i))return!1}else if(!zu(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function Hw(t,e){return((e==null?void 0:e.queryKeyHashFn)||Kf)(t)}function Kf(t){return JSON.stringify(t,(e,n)=>w_(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function zu(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(Array.isArray(t)&&Array.isArray(e)){if(e.length>t.length)return!1;for(let r=0;r<e.length;r++)if(!zu(t[r],e[r]))return!1;return!0}const n=Object.keys(e);for(const r of n)if(!zu(t[r],e[r]))return!1;return!0}return!1}const qD=Object.prototype.hasOwnProperty;function dP(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=I8(t)&&I8(e);if(!r&&!(w_(t)&&w_(e)))return e;const s=(r?t:Object.keys(t)).length,i=r?e:Object.keys(e),o=i.length,l=r?new Array(o):{};let u=0;for(let d=0;d<o;d++){const f=r?d:i[d],p=t[f],g=e[f];if(p===g){l[f]=p,(r?d<s:qD.call(t,f))&&u++;continue}if(p===null||g===null||typeof p!="object"||typeof g!="object"){l[f]=g;continue}const v=dP(p,g,n+1);l[f]=v,v===p&&u++}return s===o&&u===s?t:l}function M1(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 I8(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function w_(t){if(!M8(t))return!1;const e=Object.getPrototypeOf(t),n=e==null?void 0:e.constructor;if(n===void 0)return!0;if(typeof n!="function")return!1;const r=n.prototype;return!(!M8(r)||!r.hasOwnProperty("isPrototypeOf")||e!==Object.prototype)}function M8(t){return Object.prototype.toString.call(t)==="[object Object]"}function GD(t){return new Promise(e=>{Fl.setTimeout(e,t)})}function x_(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?dP(t,e):e}function KD(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function YD(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}const zw=Symbol();function fP(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===zw?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function hP(t,e){return typeof t=="function"?t(...e):!!t}function XD(t,e,n){let r=!1,s;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(s??(s=e()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),t}let QD=()=>ZD;const Bw=()=>QD();var $h=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(){}},Bl,ya,Au,X3,JD=(X3=class extends $h{constructor(){super();tt(this,Bl);tt(this,ya);tt(this,Au);Ae(this,Au,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){q(this,ya)||this.setEventListener(q(this,Au))}onUnsubscribe(){var e;this.hasListeners()||((e=q(this,ya))==null||e.call(this),Ae(this,ya,void 0))}setEventListener(e){var n;Ae(this,Au,e),(n=q(this,ya))==null||n.call(this),Ae(this,ya,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){q(this,Bl)!==e&&(Ae(this,Bl,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof q(this,Bl)=="boolean"?q(this,Bl):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Bl=new WeakMap,ya=new WeakMap,Au=new WeakMap,X3);const Uw=new JD,e7=UD;function t7(){let t=[],e=0,n=l=>{l()},r=l=>{l()},s=e7;const i=l=>{e?t.push(l):s(()=>{n(l)})},o=()=>{const l=t;t=[],l.length&&s(()=>{r(()=>{l.forEach(u=>{n(u)})})})};return{batch:l=>{let u;e++;try{u=l()}finally{e--,e||o()}return u},batchCalls:l=>(...u)=>{i(()=>{l(...u)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}const dr=t7();var Tu,_a,Iu,Q3,n7=(Q3=class extends $h{constructor(){super();tt(this,Tu,!0);tt(this,_a);tt(this,Iu);Ae(this,Iu,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(){q(this,_a)||this.setEventListener(q(this,Iu))}onUnsubscribe(){var e;this.hasListeners()||((e=q(this,_a))==null||e.call(this),Ae(this,_a,void 0))}setEventListener(e){var n;Ae(this,Iu,e),(n=q(this,_a))==null||n.call(this),Ae(this,_a,e(this.setOnline.bind(this)))}setOnline(e){q(this,Tu)!==e&&(Ae(this,Tu,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return q(this,Tu)}},Tu=new WeakMap,_a=new WeakMap,Iu=new WeakMap,Q3);const gm=new n7;function r7(t){return Math.min(1e3*2**t,3e4)}function pP(t){return(t??"online")==="online"?gm.isOnline():!0}var b_=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function mP(t){let e=!1,n=0,r,s="pending",i,o;const l=new Promise((E,C)=>{i=E,o=C});l.catch(Zr);const u=()=>s!=="pending",d=E=>{var C;if(!u()){const R=new b_(E);_(R),(C=t.onCancel)==null||C.call(t,R)}},f=()=>{e=!0},p=()=>{e=!1},g=()=>Uw.isFocused()&&(t.networkMode==="always"||gm.isOnline())&&t.canRun(),v=()=>pP(t.networkMode)&&t.canRun(),w=E=>{u()||(r==null||r(),s="resolved",i(E))},_=E=>{u()||(r==null||r(),s="rejected",o(E))},x=()=>new Promise(E=>{var C;r=R=>{(u()||g())&&E(R)},(C=t.onPause)==null||C.call(t)}).then(()=>{var E;r=void 0,u()||(E=t.onContinue)==null||E.call(t)}),b=()=>{if(u())return;let E;const C=n===0?t.initialPromise:void 0;try{E=C??t.fn()}catch(R){E=Promise.reject(R)}Promise.resolve(E).then(w).catch(R=>{var L;if(u())return;const A=t.retry??(Bw()?0:3),I=t.retryDelay??r7,M=typeof I=="function"?I(n,R):I,T=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,R);if(e||!T){_(R);return}n++,(L=t.onFail)==null||L.call(t,n,R),GD(M).then(()=>g()?void 0:x()).then(()=>{e?_(R):b()})})};return{promise:l,status:()=>s,cancel:d,continue:()=>(r==null||r(),l),cancelRetry:f,continueRetry:p,canStart:v,start:()=>(v()?b():x().then(b),l)}}var Ul,J3,gP=(J3=class{constructor(){tt(this,Ul)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),cP(this.gcTime)&&Ae(this,Ul,Fl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Bw()?1/0:3e5))}clearGcTimeout(){q(this,Ul)!==void 0&&(Fl.clearTimeout(q(this,Ul)),Ae(this,Ul,void 0))}},Ul=new WeakMap,J3);function s7(t){return{onFetch:(e,n)=>{var f,p,g,v,w;const r=e.options,s=(g=(p=(f=e.fetchOptions)==null?void 0:f.meta)==null?void 0:p.fetchMore)==null?void 0:g.direction,i=((v=e.state.data)==null?void 0:v.pages)||[],o=((w=e.state.data)==null?void 0:w.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const d=async()=>{let _=!1;const x=C=>{XD(C,()=>e.signal,()=>_=!0)},b=fP(e.options,e.fetchOptions),E=async(C,R,A)=>{if(_)return Promise.reject(e.signal.reason);if(R==null&&C.pages.length)return Promise.resolve(C);const M=(()=>{const j={client:e.client,queryKey:e.queryKey,pageParam:R,direction:A?"backward":"forward",meta:e.options.meta};return x(j),j})(),T=await b(M),{maxPages:L}=e.options,D=A?YD:KD;return{pages:D(C.pages,T,L),pageParams:D(C.pageParams,R,L)}};if(s&&i.length){const C=s==="backward",R=C?i7:O8,A={pages:i,pageParams:o};l=await E(A,R(r,A),C)}else{const C=t??i.length;do{const R=u===0?o[0]??r.initialPageParam:O8(r,l);if(u>0&&R==null)break;l=await E(l,R),u++}while(u<C)}return l};e.options.persister?e.fetchFn=()=>{var _,x;return(x=(_=e.options).persister)==null?void 0:x.call(_,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=d}}}function O8(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 i7(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 Mu,Zl,Ou,Vs,Wl,Wn,Ih,ql,di,mo,eP,o7=(eP=class extends gP{constructor(e){super();tt(this,di);tt(this,Mu);tt(this,Zl);tt(this,Ou);tt(this,Vs);tt(this,Wl);tt(this,Wn);tt(this,Ih);tt(this,ql);Ae(this,ql,!1),Ae(this,Ih,e.defaultOptions),this.setOptions(e.options),this.observers=[],Ae(this,Wl,e.client),Ae(this,Vs,q(this,Wl).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Ae(this,Zl,N8(this.options)),this.state=e.state??q(this,Zl),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return q(this,Mu)}get promise(){var e;return(e=q(this,Wn))==null?void 0:e.promise}setOptions(e){if(this.options={...q(this,Ih),...e},e!=null&&e._type&&Ae(this,Mu,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=N8(this.options);n.data!==void 0&&(this.setState(L8(n.data,n.dataUpdatedAt)),Ae(this,Zl,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&q(this,Vs).remove(this)}setData(e,n){const r=x_(this.state.data,e,this.options);return _t(this,di,mo).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e){_t(this,di,mo).call(this,{type:"setState",state:e})}cancel(e){var r,s;const n=(r=q(this,Wn))==null?void 0:r.promise;return(s=q(this,Wn))==null||s.cancel(e),n?n.then(Zr).catch(Zr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return q(this,Zl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>fn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===zw||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>fn(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:!uP(this.state.dataUpdatedAt,e)}onFocus(){var e,n;(e=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||e.refetch({cancelRefetch:!1}),(n=q(this,Wn))==null||n.continue()}onOnline(){var e,n;(e=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||e.refetch({cancelRefetch:!1}),(n=q(this,Wn))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),q(this,Vs).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){const n=this.observers.indexOf(e);n!==-1&&(this.observers.splice(n,1),this.observers.length||(q(this,Wn)&&(q(this,ql)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?q(this,Wn).cancel({revert:!0}):q(this,Wn).cancelRetry()),this.scheduleGc()),q(this,Vs).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||_t(this,di,mo).call(this,{type:"invalidate"})}async fetch(e,n){var d,f,p,g,v,w,_,x,b,E,C,R;if(this.state.fetchStatus!=="idle"&&((d=q(this,Wn))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(q(this,Wn))return q(this,Wn).continueRetry(),q(this,Wn).promise}if(e&&this.setOptions(e),!this.options.queryFn){const A=this.observers.find(I=>I.options.queryFn);A&&this.setOptions(A.options)}const r=new AbortController,s=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(Ae(this,ql,!0),r.signal)})},i=()=>{const A=fP(this.options,n),M=(()=>{const T={client:q(this,Wl),queryKey:this.queryKey,meta:this.meta};return s(T),T})();return Ae(this,ql,!1),this.options.persister?this.options.persister(A,M,this):A(M)},l=(()=>{const A={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:q(this,Wl),state:this.state,fetchFn:i};return s(A),A})();(f=q(this,Mu)==="infinite"?s7(this.options.pages):this.options.behavior)==null||f.onFetch(l,this),Ae(this,Ou,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=l.fetchOptions)==null?void 0:p.meta))&&_t(this,di,mo).call(this,{type:"fetch",meta:(g=l.fetchOptions)==null?void 0:g.meta});const u=Ae(this,Wn,mP({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:A=>{A instanceof b_&&A.revert&&this.setState({...q(this,Ou),fetchStatus:"idle"}),r.abort()},onFail:(A,I)=>{_t(this,di,mo).call(this,{type:"failed",failureCount:A,error:I})},onPause:()=>{_t(this,di,mo).call(this,{type:"pause"})},onContinue:()=>{_t(this,di,mo).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const A=await u.start();if(A===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(A),(w=(v=q(this,Vs).config).onSuccess)==null||w.call(v,A,this),(x=(_=q(this,Vs).config).onSettled)==null||x.call(_,A,this.state.error,this),A}catch(A){if(A instanceof b_){if(A.silent)return q(this,Wn).promise;if(A.revert){if(this.state.data===void 0)throw A;return this.state.data}}throw _t(this,di,mo).call(this,{type:"error",error:A}),(E=(b=q(this,Vs).config).onError)==null||E.call(b,A,this),(R=(C=q(this,Vs).config).onSettled)==null||R.call(C,this.state.data,A,this),A}finally{q(this,Wn)===u&&Ae(this,Wn,void 0),this.scheduleGc()}}},Mu=new WeakMap,Zl=new WeakMap,Ou=new WeakMap,Vs=new WeakMap,Wl=new WeakMap,Wn=new WeakMap,Ih=new WeakMap,ql=new WeakMap,di=new WeakSet,mo=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,...vP(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...L8(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ae(this,Ou,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),dr.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),q(this,Vs).notify({query:this,type:"updated",action:e})})},eP);function vP(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:pP(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function L8(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function N8(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 Ar,xt,Mh,Tr,Gl,Lu,bo,Oh,Nu,Du,Kl,Yl,wa,$u,$t,vf,S_,k_,E_,C_,P_,R_,A_,T_,tP,a7=(tP=class extends $h{constructor(e,n){super();tt(this,$t);tt(this,Ar);tt(this,xt);tt(this,Mh);tt(this,Tr);tt(this,Gl);tt(this,Lu);tt(this,bo);tt(this,Oh);tt(this,Nu);tt(this,Du);tt(this,Kl);tt(this,Yl);tt(this,wa);tt(this,$u,new Set);this.options=n,Ae(this,Ar,e),Ae(this,bo,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(q(this,xt).addObserver(this),D8(q(this,xt),this.options)?_t(this,$t,vf).call(this):this.updateResult(),_t(this,$t,P_).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return I_(q(this,xt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return I_(q(this,xt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,_t(this,$t,R_).call(this),_t(this,$t,A_).call(this),q(this,xt).removeObserver(this)}setOptions(e){const n=this.options,r=q(this,xt);if(this.options=q(this,Ar).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof fn(this.options.enabled,q(this,xt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");_t(this,$t,T_).call(this),q(this,xt).setOptions(this.options),n._defaulted&&!M1(this.options,n)&&q(this,Ar).getQueryCache().notify({type:"observerOptionsUpdated",query:q(this,xt),observer:this});const s=this.hasListeners();s&&$8(q(this,xt),r,this.options,n)&&_t(this,$t,vf).call(this),this.updateResult(),s&&(q(this,xt)!==r||fn(this.options.enabled,q(this,xt))!==fn(n.enabled,q(this,xt))||fn(this.options.staleTime,q(this,xt))!==fn(n.staleTime,q(this,xt)))&&_t(this,$t,k_).call(this);const i=_t(this,$t,E_).call(this);s&&(q(this,xt)!==r||fn(this.options.enabled,q(this,xt))!==fn(n.enabled,q(this,xt))||i!==q(this,wa))&&_t(this,$t,C_).call(this,i)}getOptimisticResult(e){const n=q(this,Ar).getQueryCache().build(q(this,Ar),e),r=this.createResult(n,e);return M1(this.getCurrentResult(),r)||(Ae(this,Tr,r),Ae(this,Lu,this.options),Ae(this,Gl,q(this,xt).state)),r}getCurrentResult(){return q(this,Tr)}trackResult(e,n){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),n==null||n(s),Reflect.get(r,s))})}trackProp(e){q(this,$u).add(e)}getCurrentQuery(){return q(this,xt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=q(this,Ar).defaultQueryOptions(e),r=q(this,Ar).getQueryCache().build(q(this,Ar),n);let s=()=>{},i;const o=new Promise(l=>{i=l,s=q(this,Ar).getQueryCache().subscribe(u=>{u.type==="updated"&&u.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),l(this.createResult(r,n)))})});return Promise.race([r.fetch().then(()=>{const l=this.createResult(r,n);return i==null||i(l),l}).finally(()=>{s()}),o])}fetch(e){return _t(this,$t,vf).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),q(this,Tr)))}createResult(e,n){var I;const r=q(this,xt),s=this.options,i=q(this,Tr),o=q(this,Gl),l=q(this,Lu),u=e!==r?e.state:q(this,Mh),{state:d}=e;let f={...d},p=!1,g;if(n._optimisticResults){const M=this.hasListeners(),T=!M&&D8(e,n),L=M&&$8(e,r,n,s);(T||L)&&(f={...f,...vP(d.data,e.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:v,errorUpdatedAt:w,status:_}=f;g=f.data;let x=!1;if(n.placeholderData!==void 0&&g===void 0&&_==="pending"){let M;i!=null&&i.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(M=i.data,x=!0):M=typeof n.placeholderData=="function"?n.placeholderData((I=q(this,Du))==null?void 0:I.state.data,q(this,Du)):n.placeholderData,M!==void 0&&(_="success",g=x_(i==null?void 0:i.data,M,n),p=!0)}if(n.select&&g!==void 0&&!x)if(i&&g===(o==null?void 0:o.data)&&n.select===q(this,Oh))g=q(this,Nu);else try{Ae(this,Oh,n.select),g=n.select(g),g=x_(i==null?void 0:i.data,g,n),Ae(this,Nu,g),Ae(this,bo,null)}catch(M){Ae(this,bo,M)}else g===void 0&&Ae(this,bo,null);q(this,bo)&&(v=q(this,bo),g=q(this,Nu),w=Date.now(),_="error",p=!1);const b=f.fetchStatus==="fetching",E=_==="pending",C=_==="error",R=E&&b,A=g!==void 0;return{status:_,fetchStatus:f.fetchStatus,isPending:E,isSuccess:_==="success",isError:C,isInitialLoading:R,isLoading:R,data:g,dataUpdatedAt:f.dataUpdatedAt,error:v,errorUpdatedAt:w,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:b,isRefetching:b&&!E,isLoadingError:C&&!A,isPaused:f.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:C&&A,isStale:Zw(e,n),refetch:this.refetch,isEnabled:fn(n.enabled,e)!==!1}}updateResult(){const e=q(this,Tr),n=this.createResult(q(this,xt),this.options);if(Ae(this,Gl,q(this,xt).state),Ae(this,Lu,this.options),q(this,Gl).data!==void 0&&Ae(this,Du,q(this,xt)),M1(n,e))return;Ae(this,Tr,n);const s=(()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!q(this,$u).size)return!0;const l=new Set(o??q(this,$u));return this.options.throwOnError&&l.add("error"),Object.keys(q(this,Tr)).some(u=>{const d=u;return q(this,Tr)[d]!==e[d]&&l.has(d)})})();dr.batch(()=>{s&&this.listeners.forEach(i=>{i(q(this,Tr))}),q(this,Ar).getQueryCache().notify({query:q(this,xt),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&_t(this,$t,P_).call(this)}},Ar=new WeakMap,xt=new WeakMap,Mh=new WeakMap,Tr=new WeakMap,Gl=new WeakMap,Lu=new WeakMap,bo=new WeakMap,Oh=new WeakMap,Nu=new WeakMap,Du=new WeakMap,Kl=new WeakMap,Yl=new WeakMap,wa=new WeakMap,$u=new WeakMap,$t=new WeakSet,vf=function(e){_t(this,$t,T_).call(this);let n=q(this,xt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Zr)),n},S_=function(e){return!Bw()&&fn(this.options.enabled,q(this,xt))!==!1&&cP(e)},k_=function(){_t(this,$t,R_).call(this);const e=fn(this.options.staleTime,q(this,xt));if(q(this,Tr).isStale||!_t(this,$t,S_).call(this,e))return;const n=uP(q(this,Tr).dataUpdatedAt,e)+1;Ae(this,Kl,Fl.setTimeout(()=>{q(this,Tr).isStale||this.updateResult()},n))},E_=function(){return fn(this.options.refetchInterval,q(this,xt))??!1},C_=function(e){_t(this,$t,A_).call(this),Ae(this,wa,e),!(q(this,wa)===0||!_t(this,$t,S_).call(this,q(this,wa)))&&Ae(this,Yl,Fl.setInterval(()=>{(this.options.refetchIntervalInBackground||Uw.isFocused())&&_t(this,$t,vf).call(this)},q(this,wa)))},P_=function(){_t(this,$t,k_).call(this),_t(this,$t,C_).call(this,_t(this,$t,E_).call(this))},R_=function(){q(this,Kl)!==void 0&&(Fl.clearTimeout(q(this,Kl)),Ae(this,Kl,void 0))},A_=function(){q(this,Yl)!==void 0&&(Fl.clearInterval(q(this,Yl)),Ae(this,Yl,void 0))},T_=function(){const e=q(this,Ar).getQueryCache().build(q(this,Ar),this.options);if(e===q(this,xt))return;const n=q(this,xt);Ae(this,xt,e),Ae(this,Mh,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},tP);function l7(t,e){return fn(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&fn(e.retryOnMount,t)===!1)}function D8(t,e){return l7(t,e)||t.state.data!==void 0&&I_(t,e,e.refetchOnMount)}function I_(t,e,n){if(fn(e.enabled,t)!==!1&&fn(e.staleTime,t)!=="static"){const r=fn(n,t);return r==="always"||r!==!1&&Zw(t,e)}return!1}function $8(t,e,n,r){return(t!==e||fn(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Zw(t,n)}function Zw(t,e){return fn(e.enabled,t)!==!1&&t.isStaleByTime(fn(e.staleTime,t))}var Lh,Mi,xr,Xl,Oi,ha,nP,c7=(nP=class extends gP{constructor(e){super();tt(this,Oi);tt(this,Lh);tt(this,Mi);tt(this,xr);tt(this,Xl);Ae(this,Lh,e.client),this.mutationId=e.mutationId,Ae(this,xr,e.mutationCache),Ae(this,Mi,[]),this.state=e.state||u7(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){q(this,Mi).includes(e)||(q(this,Mi).push(e),this.clearGcTimeout(),q(this,xr).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Ae(this,Mi,q(this,Mi).filter(n=>n!==e)),this.scheduleGc(),q(this,xr).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){q(this,Mi).length||(this.state.status==="pending"?this.scheduleGc():q(this,xr).remove(this))}continue(){var e;return((e=q(this,Xl))==null?void 0:e.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(e){var l,u,d,f,p,g,v,w,_,x,b,E,C,R,A,I,M,T;const n=()=>{_t(this,Oi,ha).call(this,{type:"continue"})},r={client:q(this,Lh),meta:this.options.meta,mutationKey:this.options.mutationKey},s=Ae(this,Xl,mP({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(L,D)=>{_t(this,Oi,ha).call(this,{type:"failed",failureCount:L,error:D})},onPause:()=>{_t(this,Oi,ha).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>q(this,xr).canRun(this)})),i=this.state.status==="pending",o=!s.canStart();try{if(i)n();else{_t(this,Oi,ha).call(this,{type:"pending",variables:e,isPaused:o}),q(this,xr).config.onMutate&&await q(this,xr).config.onMutate(e,this,r);const D=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,e,r));D!==this.state.context&&_t(this,Oi,ha).call(this,{type:"pending",context:D,variables:e,isPaused:o})}const L=await s.start();return await((f=(d=q(this,xr).config).onSuccess)==null?void 0:f.call(d,L,e,this.state.context,this,r)),await((g=(p=this.options).onSuccess)==null?void 0:g.call(p,L,e,this.state.context,r)),await((w=(v=q(this,xr).config).onSettled)==null?void 0:w.call(v,L,null,this.state.variables,this.state.context,this,r)),await((x=(_=this.options).onSettled)==null?void 0:x.call(_,L,null,e,this.state.context,r)),_t(this,Oi,ha).call(this,{type:"success",data:L}),L}catch(L){try{await((E=(b=q(this,xr).config).onError)==null?void 0:E.call(b,L,e,this.state.context,this,r))}catch(D){Promise.reject(D)}try{await((R=(C=this.options).onError)==null?void 0:R.call(C,L,e,this.state.context,r))}catch(D){Promise.reject(D)}try{await((I=(A=q(this,xr).config).onSettled)==null?void 0:I.call(A,void 0,L,this.state.variables,this.state.context,this,r))}catch(D){Promise.reject(D)}try{await((T=(M=this.options).onSettled)==null?void 0:T.call(M,void 0,L,e,this.state.context,r))}catch(D){Promise.reject(D)}throw _t(this,Oi,ha).call(this,{type:"error",error:L}),L}finally{q(this,Xl)===s&&Ae(this,Xl,void 0),q(this,xr).runNext(this)}}},Lh=new WeakMap,Mi=new WeakMap,xr=new WeakMap,Xl=new WeakMap,Oi=new WeakSet,ha=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),dr.batch(()=>{q(this,Mi).forEach(r=>{r.onMutationUpdate(e)}),q(this,xr).notify({mutation:this,type:"updated",action:e})})},nP);function u7(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var So,fi,Nh,rP,d7=(rP=class extends $h{constructor(e={}){super();tt(this,So);tt(this,fi);tt(this,Nh);this.config=e,Ae(this,So,new Set),Ae(this,fi,new Map),Ae(this,Nh,0)}build(e,n,r){const s=new c7({client:e,mutationCache:this,mutationId:++r0(this,Nh)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){q(this,So).add(e);const n=s0(e);if(typeof n=="string"){const r=q(this,fi).get(n);r?r.push(e):q(this,fi).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(q(this,So).delete(e)){const n=s0(e);if(typeof n=="string"){const r=q(this,fi).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&q(this,fi).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){var r;const n=s0(e);if(typeof n=="string"){const s=(r=q(this,fi).get(n))==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r,s;const n=s0(e);return typeof n=="string"?((s=(r=q(this,fi).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){dr.batch(()=>{q(this,So).forEach(e=>{this.notify({type:"removed",mutation:e})}),q(this,So).clear(),q(this,fi).clear()})}getAll(){return Array.from(q(this,So))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>T8(n,r))}findAll(e={}){return this.getAll().filter(n=>T8(e,n))}notify(e){dr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return dr.batch(()=>Promise.all(e.map(n=>n.continue().catch(Zr))))}},So=new WeakMap,fi=new WeakMap,Nh=new WeakMap,rP);function s0(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Li,sP,f7=(sP=class extends $h{constructor(e={}){super();tt(this,Li);this.config=e,Ae(this,Li,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??Hw(s,n);let o=this.get(i);return o||(o=new o7({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){q(this,Li).has(e.queryHash)||(q(this,Li).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){q(this,Li).get(e.queryHash)===e&&(e.destroy(),q(this,Li).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){dr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return q(this,Li).get(e)}getAll(){return[...q(this,Li).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>A8(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>A8(e,r)):n}notify(e){dr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){dr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){dr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Li=new WeakMap,sP),wn,xa,ba,ju,Fu,Sa,Vu,Hu,iP,h7=(iP=class{constructor(t={}){tt(this,wn);tt(this,xa);tt(this,ba);tt(this,ju);tt(this,Fu);tt(this,Sa);tt(this,Vu);tt(this,Hu);Ae(this,wn,t.queryCache||new f7),Ae(this,xa,t.mutationCache||new d7),Ae(this,ba,t.defaultOptions||{}),Ae(this,ju,new Map),Ae(this,Fu,new Map),Ae(this,Sa,0)}mount(){r0(this,Sa)._++,q(this,Sa)===1&&(Ae(this,Vu,Uw.subscribe(async t=>{t&&(await this.resumePausedMutations(),q(this,wn).onFocus())})),Ae(this,Hu,gm.subscribe(async t=>{t&&(await this.resumePausedMutations(),q(this,wn).onOnline())})))}unmount(){var t,e;r0(this,Sa)._--,q(this,Sa)===0&&((t=q(this,Vu))==null||t.call(this),Ae(this,Vu,void 0),(e=q(this,Hu))==null||e.call(this),Ae(this,Hu,void 0))}isFetching(t){return q(this,wn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return q(this,xa).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=q(this,wn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=q(this,wn).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(fn(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return q(this,wn).findAll(t).map(({queryKey:e,state:n})=>[e,n.data])}setQueryData(t,e,n){var o;const r=this.defaultQueryOptions({queryKey:t}),s=(o=q(this,wn).get(r.queryHash))==null?void 0:o.state.data,i=WD(e,s);if(i!==void 0)return q(this,wn).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(t,e,n){return dr.batch(()=>q(this,wn).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=q(this,wn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=q(this,wn);dr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=q(this,wn);return dr.batch(()=>{const r=n.findAll(t),s=new Set(r);return r.forEach(i=>{i.reset()}),this.refetchQueries({type:"active",predicate:i=>s.has(i)},e)})}cancelQueries(t,e={}){const n={revert:!0,...e},r=dr.batch(()=>q(this,wn).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Zr).catch(Zr)}invalidateQueries(t,e={}){return dr.batch(()=>(q(this,wn).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=dr.batch(()=>q(this,wn).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Zr)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Zr)}async query(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=q(this,wn).build(this,e),r=n.isStaleByTime(fn(e.staleTime,n))?await n.fetch(e):n.state.data,s=e.select;return s?s(r):r}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=q(this,wn).build(this,e);return n.isStaleByTime(fn(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Zr).catch(Zr)}infiniteQuery(t){return t._type="infinite",this.query(t)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Zr).catch(Zr)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return gm.isOnline()?q(this,xa).resumePausedMutations():Promise.resolve()}getQueryCache(){return q(this,wn)}getMutationCache(){return q(this,xa)}getDefaultOptions(){return q(this,ba)}setDefaultOptions(t){Ae(this,ba,t)}setQueryDefaults(t,e){q(this,ju).set(Kf(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...q(this,ju).values()],n={};return e.forEach(r=>{zu(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){q(this,Fu).set(Kf(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...q(this,Fu).values()],n={};return e.forEach(r=>{zu(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...q(this,ba).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Hw(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===zw&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...q(this,ba).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){q(this,wn).clear(),q(this,xa).clear()}},wn=new WeakMap,xa=new WeakMap,ba=new WeakMap,ju=new WeakMap,Fu=new WeakMap,Sa=new WeakMap,Vu=new WeakMap,Hu=new WeakMap,iP);const yP=m.createContext(!1),p7=()=>m.useContext(yP);yP.Provider;function m7(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const g7=m.createContext(m7()),v7=()=>m.useContext(g7),y7=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?hP(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||r)&&(e.isReset()||(t.retryOnMount=!1))},_7=t=>{m.useEffect(()=>{t.clearReset()},[t])},w7=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||hP(n,[t.error,r])),x7=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))}},b7=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,S7=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function k7(t,e,n){const r=p7(),s=v7(),i=lP(),o=i.defaultQueryOptions(t),l=i.getQueryCache().get(o.queryHash),u=t.subscribed!==!1;o._optimisticResults=r?"isRestoring":u?"optimistic":void 0,x7(o),y7(o,s,l),_7(s);const[d]=m.useState(()=>new e(i,o)),f=d.getOptimisticResult(o),p=!r&&u;if(m.useSyncExternalStore(m.useCallback(g=>{const v=p?d.subscribe(dr.batchCalls(g)):Zr;return d.updateResult(),v},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),m.useEffect(()=>{d.setOptions(o)},[o,d]),b7(o,f))throw S7(o,d,s);if(w7({result:f,errorResetBoundary:s,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw f.error;return o.notifyOnChangeProps?f:d.trackResult(f)}function vm(t,e){return k7(t,a7)}const J="u">typeof window?window:void 0,Sr="u">typeof globalThis?globalThis:J,Kn=Sr==null?void 0:Sr.navigator,ue=Sr==null?void 0:Sr.document,sn=Sr==null?void 0:Sr.location,Yf=Sr==null?void 0:Sr.fetch,Ww=Sr!=null&&Sr.XMLHttpRequest&&"withCredentials"in new Sr.XMLHttpRequest?Sr.XMLHttpRequest:void 0,j8=Sr==null?void 0:Sr.AbortController,E7=Sr==null?void 0:Sr.CompressionStream,Ir=Kn==null?void 0:Kn.userAgent;function _P(){return!(!J||J.navigator.onLine===!1)}const tf=typeof globalThis<"u"?globalThis:J;tf&&typeof self>"u"&&(tf.self=tf),tf&&typeof File>"u"&&(tf.File=function(){});const $e=J??{},C7="0.9.0",Ro={DEBUG:!1,LIB_VERSION:C7,LIB_NAME:"browser-common"};var Ai=(function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.AiCaptureQueue="ai_capture_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.PushRegistered="push_registered",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysInProgress="surveys_in_progress",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t})({}),M_=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});const P7=["$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"],R7=["token"];function Ze(t,e){return t.indexOf(e)!==-1}const wg=function(t){return t.trim()},O_=function(t){return t.replace(/^\$/,"")};function wP(t){var e;const n=[];return(e=JSON.stringify(t,function(r,s){if(typeof s=="bigint")return s.toString();if(typeof s!="function"&&typeof s!="symbol"){if(s instanceof Error)return{name:s.name,message:s.message,stack:s.stack};if(s&&typeof s=="object"){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(s))return"[Circular]";n.push(s)}return s}}))!==null&&e!==void 0?e:"null"}const xP=Object.prototype,qw=xP.hasOwnProperty,xg=xP.toString,Ue=Array.isArray||function(t){return xg.call(t)==="[object Array]"},Gn=t=>typeof t=="function",ut=t=>t===Object(t)&&!Ue(t),Wr=t=>{if(ut(t)){for(const e in t)if(qw.call(t,e))return!1;return!0}return!1},ce=t=>t===void 0,it=t=>xg.call(t)=="[object String]",Cf=t=>it(t)&&t.trim().length===0,on=t=>t===null,nt=t=>ce(t)||on(t),pn=t=>xg.call(t)=="[object Number]"&&t==t,go=t=>pn(t)&&t>0,Or=t=>xg.call(t)==="[object Boolean]",A7=t=>Ze(P7,t),T7=t=>Ze(R7,t);function bP(t){return t===null||typeof t!="object"}function ym(t,e){return{}.toString.call(t)===`[object ${e}]`}function ld(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return SP(t,Error)}}function Gw(t){return"u">typeof Event&&SP(t,Event)}function SP(t,e){try{return t instanceof e}catch{return!1}}const I7=[!0,"true",1,"1","yes"],O1=t=>Ze(I7,t),M7=[!1,"false",0,"0","no"];function F8(t,e,n,r,s,i,o){try{var l=t[i](o),u=l.value}catch(d){return void n(d)}l.done?e(u):Promise.resolve(u).then(r,s)}function qt(t){return function(){var e=this,n=arguments;return new Promise(function(r,s){var i=t.apply(e,n);function o(u){F8(i,r,s,o,l,"next",u)}function l(u){F8(i,r,s,o,l,"throw",u)}o(void 0)})}}const O7=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],V8=function(t,e=[]){if(!t)return!1;const n=t.toLowerCase();return O7.concat(e).some(r=>{const s=r.toLowerCase();return n.indexOf(s)!==-1})};function ji(t,e,n,r,s){return e>n&&(r.warn("min cannot be greater than max."),e=n),pn(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),ji(s??n,e,n,r))}var L7=class{constructor(t){this.C={},this.I=t.I,this.R=ji(t.bucketSize,0,100,t.$),this.A=ji(t.refillRate,0,this.R,t.$),this.O=ji(t.refillInterval,0,864e5,t.$)}F(t,e){const n=Math.floor((e-t.lastAccess)/this.O);n>0&&(t.tokens=Math.min(t.tokens+n*this.A,this.R),t.lastAccess=t.lastAccess+n*this.O)}consumeRateLimit(t){var e;const n=Date.now(),r=String(t);let s=this.C[r];return s?this.F(s,n):(s={tokens:this.R,lastAccess:n},this.C[r]=s),s.tokens===0||(s.tokens--,s.tokens===0&&((e=this.I)===null||e===void 0||e.call(this,t)),s.tokens===0)}stop(){this.C={}}};const Bu="Mobile",Xf="Android",_m="Tablet",kP="Android Tablet",EP="iPad",CP="Apple Watch",F0="Safari",bg="BlackBerry",PP="Samsung Internet",V0="Chrome",RP="Chrome iOS",AP="Internet Explorer",TP="Internet Explorer Mobile",IP="Opera",MP="Microsoft Edge",H0="Firefox",OP="Firefox iOS",wm="Nintendo",xm="PlayStation",Sg="Xbox",LP="Android Mobile",NP="Mobile Safari",L1="Windows",DP="Windows Phone",H8="Nokia",L_="Ouya",N7="Generic "+Bu.toLowerCase(),$P="Generic "+_m.toLowerCase(),N_="Konqueror",jP="Oculus Browser",FP="Vivaldi",VP="Yandex",HP="Whale",zP="DuckDuckGo",BP="Pale Moon",UP="Waterfox",D_="Brave",ZP="Claude",WP="Codex",qP="ChatGPT",GP="Google Search App",N1=new RegExp("Version/(\\d+(\\.\\d+)?)"),D1=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),D7=new RegExp(Sg,"i"),$7=new RegExp("PlayStation \\w+","i"),j7=new RegExp("Nintendo \\w+","i"),Kw=new RegExp("BlackBerry|PlayBook|BB10","i"),F7={"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"},KP=function(t,e,n,r){return e=e||"",(function(i){return i!=null&&i.brave?D_:null})(n)||(r!=null&&r.detectGoogleSearchApp&&Ze(t,"GSA/")?GP:Ze(t," OPR/")&&Ze(t,"Mini")?"Opera Mini":Ze(t," OPR/")?IP:Kw.test(t)?bg:Ze(t,"IEMobile")||Ze(t,"WPDesktop")?TP:Ze(t,"OculusBrowser")?jP:Ze(t,"SamsungBrowser")?PP:Ze(t,"Edge")||Ze(t,"Edg/")?MP:Ze(t,"Vivaldi/")?FP:Ze(t,"YaBrowser/")?VP:Ze(t,"Whale/")?HP:Ze(t,"DuckDuckGo/")||Ze(t,"Ddg/")?zP:Ze(t,"Claude/")?ZP:Ze(t,"Codex/")?WP:Ze(t,"ChatGPT/")?qP:Ze(t,"FBIOS")?"Facebook Mobile":Ze(t,"UCWEB")||Ze(t,"UCBrowser")?"UC Browser":Ze(t,"CriOS")?RP:Ze(t,"CrMo")||Ze(t,V0)?V0:Ze(t,Xf)&&Ze(t,F0)?LP:Ze(t,"FxiOS")?OP:Ze(t.toLowerCase(),N_.toLowerCase())?N_:Ze(t,"Brave/")?D_:((i,o)=>o&&Ze(o,"Apple")||(function(l){return Ze(l,F0)&&!Ze(l,V0)&&!Ze(l,Xf)})(i))(t,e)?Ze(t,Bu)?NP:F0:Ze(t,"PaleMoon/")?BP:Ze(t,"Waterfox/")?UP:Ze(t,H0)?H0:Ze(t,"MSIE")||Ze(t,"Trident/")?AP:Ze(t,"Gecko")?H0:"")},V7={[TP]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[MP]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[V0]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[RP]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[F0]:[N1],[NP]:[N1],[IP]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[H0]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[OP]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[N_]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[bg]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),N1],[LP]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[PP]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[jP]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[FP]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[VP]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[HP]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[D_]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[ZP]:[D1],[WP]:[D1],[qP]:[D1],[zP]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[BP]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[UP]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[GP]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[AP]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},H7=function(t,e,n,r){const s=KP(t,e,n,r),i=V7[s];if(ce(i))return null;for(let o=0;i.length>o;o++){const l=t.match(i[o]);if(l)return parseFloat(l[l.length-2])}return null},z8=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),t=>[Sg,t&&t[1]||""]],[new RegExp(wm,"i"),[wm,""]],[new RegExp(xm,"i"),[xm,""]],[Kw,[bg,""]],[new RegExp(L1,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[DP,""];if(new RegExp(Bu).test(e)&&!/IEMobile\b/.test(e))return["Windows Mobile",""];const n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){let r=F7[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[L1,r]}return[L1,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?["iOS",[t[3],t[4],t[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{let e="";return t&&t.length>=3&&(e=ce(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),t=>t&&t[2]?[Xf,[t[2],t[3],t[4]||"0"].join(".")]:[Xf,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{const e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],YP=function(t){for(let e=0;z8.length>e;e++){const[n,r]=z8[e],s=n.exec(t),i=s&&(Gn(r)?r(s,t):r);if(i)return i}return["",""]},XP=function(t){return j7.test(t)?wm:$7.test(t)?xm:D7.test(t)?Sg:new RegExp(L_,"i").test(t)?L_:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?DP:/iPad/.test(t)?EP:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?CP:Kw.test(t)?bg:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(H8,"i").test(t)?H8:/(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(Bu).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)?Xf:kP:new RegExp("(pda|Mobile)","i").test(t)?N7:new RegExp(_m,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?$P:""},z7=function(t,e){var n;const r=XP(t);return r===EP||r===kP||r==="Kobo"||r==="Kindle Fire"||r===$P?_m:r===wm||r===Sg||r===xm||r===L_?"Console":r===CP?"Wearable":r?Bu:(e==null?void 0:e.userAgentDataPlatform)==="Android"&&((n=e==null?void 0:e.maxTouchPoints)!==null&&n!==void 0?n:0)>0?600>Math.min((s=e==null?void 0:e.screenWidth)!==null&&s!==void 0?s:0,(i=e==null?void 0:e.screenHeight)!==null&&i!==void 0?i:0)/((o=e==null?void 0:e.devicePixelRatio)!==null&&o!==void 0?o:1)?Bu:_m:"Desktop";var s,i,o},$1=/\bFBAV\/(\d+(?:\.\d+)*)/i,B8=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",$1],[/\bFBAN\/EMA\b/i,"Facebook Lite",$1],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",$1],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],$_="[Truncated]",jh="[Unserializable]";function wu(t){let e="";for(let n=0;t.length>n;n++){const r=t.charCodeAt(n);if(55296>r||r>56319)e+=56320>r||r>57343?t[n]:"�";else{const s=t.charCodeAt(n+1);56320>s||s>57343?e+="�":(e+=t[n]+t[n+1],n++)}}return e}function QP(t,e){if(!e)return t;let n=[];try{n=Object.keys(e)}catch{n=[]}for(const r of n){let s;try{s=e[r]}catch{s=jh}Object.defineProperty(t,r,{value:s,enumerable:!0,writable:!0,configurable:!0})}return t}const z0=3e5;var JP=class{record(t){if(t.kind==="too-large")return;if(t.kind!=="retry-later")return void this.reset();if(!t.retryAfterMs)return;const e=this.isOpen(),n=Date.now(),r=Math.min(t.retryAfterMs,z0);if(!e)return this.ts=n,void(this.es=n+r);this.es=Math.max(this.es,Math.min(n+r,this.ts+z0))}remainingMs(){const t=Date.now();if(this.ts-5e3>t)return this.reset(),0;const e=Math.min(z0,Math.max(0,this.es-t));return e===0&&this.reset(),e}isOpen(){return this.remainingMs()>0}reset(){this.es=0,this.ts=0}constructor(){this.es=0,this.ts=0}};const B7=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function U8(t,e){return typeof(n=t)=="string"&&B7.test(n)?t:e();var n}function e5(t,e){const n=new Error(e);try{Object.defineProperty(n,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch{}return n}function Fa(t){return t&&t.split("#")[0]}function Z8(t){try{return t()}catch{return}}function t5(t,e){const n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}function W8(t,e,n){return n5.apply(this,arguments)}function n5(){return(n5=qt(function*(t,e,n){let r;try{return yield Promise.race([t,new Promise((s,i)=>{r=t5(()=>{try{n==null||n(),s()}catch(o){i(o)}},e)})])}finally{clearTimeout(r)}})).apply(this,arguments)}let i0,q8,j1;function U7(t){const e=globalThis._posthogChunkIds;if(!e)return;const n=Object.keys(e);return j1&&n.length===q8||(q8=n.length,j1=n.reduce((r,s)=>{i0||(i0={});const i=i0[s];if(i)r[i[0]]=i[1];else{const o=t(s);for(let l=o.length-1;l>=0;l--){const u=o[l],d=u==null?void 0:u.filename,f=e[s];if(d&&f){r[d]=f,i0[s]=[d,f];break}}}return r},{})),j1}function Pf(t){return Pf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pf(t)}function Z7(t,e,n){return(e=(function(r){var s=(function(i){if(Pf(i)!="object"||!i)return i;var o=i[Symbol.toPrimitive];if(o!==void 0){var l=o.call(i,"string");if(Pf(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)})(r);return Pf(s)=="symbol"?s:s+""})(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function G8(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function V(t){for(var e=1;arguments.length>e;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?G8(Object(n),!0).forEach(function(r){Z7(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):G8(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var W7=class{constructor(t,e,n=[]){this.coercers=t,this.stackParser=e,this.modifiers=n}buildFromUnknown(t,e={}){const n=e&&e.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(n,e,0).apply(t),s=this.buildParsingContext(e),i=this.parseStacktrace(r,s);return{$exception_list:this.convertToExceptionList(i,n),$exception_level:"error"}}modifyFrames(t){var e=this;return qt(function*(){for(const n of t)n.stacktrace&&n.stacktrace.frames&&Ue(n.stacktrace.frames)&&(n.stacktrace.frames=yield e.applyModifiers(n.stacktrace.frames));return t})()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:(e=t.syntheticException)===null||e===void 0?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var n;let r,s;if(t.cause!=null&&(r=this.parseStacktrace(t.cause,e)),t.stack!=""&&t.stack!=null)try{s=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)}catch{}return V(V({},t),{},{cause:r,stack:s,errors:(n=t.errors)===null||n===void 0?void 0:n.map(i=>this.parseStacktrace(i,e))})}applyChunkIds(t,e){return t.map(n=>(n.filename&&e&&(n.chunk_id=e[n.filename]),n))}applyCoercers(t,e){for(const n of this.coercers)if(n.match(t))return n.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var e=this;return qt(function*(){let n=t;for(const r of e.modifiers)n=yield r(n);return n})()}convertToExceptionList(t,e){const n=[],r=(s,i,o)=>{var l;const u=n.length,d=i===void 0?V(V({type:typeof e.type=="string"&&e.type.length>0?e.type:"generic"},typeof e.handled=="boolean"?{handled:e.handled}:e.handled===void 0?{handled:!0}:{}),{},{synthetic:typeof e.synthetic=="boolean"?e.synthetic:s.synthetic,exception_id:u}):{type:"chained",source:o,synthetic:s.synthetic,exception_id:u,parent_id:i},f={type:s.type,value:s.value,mechanism:d};s.stack&&(f.stacktrace={type:"raw",frames:s.stack}),n.push(f),s.cause&&r(s.cause,u,"cause");for(const p of(l=s.errors)!==null&&l!==void 0?l:[])r(p,u,"member")};return r(t),n}buildParsingContext(t){var e;return{chunkIdMap:U7(this.stackParser),skipFirstLines:(e=t.skipFirstLines)!==null&&e!==void 0?e:1}}getAggregateErrors(t){try{if(ld(t)){let n=Object.getPrototypeOf(t);for(let r=0;n&&100>r;r++){var e;const s=(e=Object.getOwnPropertyDescriptor(n,"constructor"))===null||e===void 0?void 0:e.value;if(typeof s=="function"&&s.name==="AggregateError"){const i=t.errors;return Ue(i)?i:void 0}n=Object.getPrototypeOf(n)}}}catch{}}buildCoercingContext(t,e,n=0){let r=0,s=0,i=!1;const o=new Set,l=[],u={},d=(g,v,w=0)=>{const _=f(v,w),x=_.apply;if(_.apply=I=>{l.push(g);try{return x(I)}finally{l.pop()}},w>4||w>0&&l.indexOf(g)!==-1)return this.coerceFallback(_);const b=typeof g=="object"&&g!==null||typeof g=="function";if(w===0&&r>=50||b&&o.has(g))return;b&&o.add(g),w===0&&r++;const E=this.getAggregateErrors(g);let C,R;i||(i=!!E);try{if(C=this.applyCoercers(g,_),!C)throw u}catch(I){if(I===u)return void(w===0&&r--);if(!i)throw I;C=this.coerceFallback(_)}if(!E||r>=50)return C;try{R=E.length}catch{return C}if(!Number.isInteger(R)||0>R||R>4294967295)return C;const A=[];for(let I=0;50>r&&1e3>s&&R>I;I++){let M;s++;try{M=_.next(E[I])}catch{r++,M=this.coerceFallback(f(v+1))}M&&A.push(M)}return V(V({},C),{},{errors:A})},f=(g,v=0)=>V(V({},e),{},{syntheticException:g==0?e.syntheticException:void 0,mechanism:g==0?t:{},apply(w){const _=d(w,g,v+1);if(!_)throw u;return _},next:w=>d(w,g+1)}),p=f(n);return V(V({},p),{},{apply:g=>{var v;return(v=d(g,n))!==null&&v!==void 0?v:this.coerceFallback(p)}})}};const q7=/^([a-z][a-z0-9.+-]+):/i,G7=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function K7(t){if(!t||t==="<anonymous>")return!1;const e=q7.exec(t);return!e||G7.includes(e[1].toLowerCase())}function j_(t,e,n,r,s){const i={platform:t,filename:e,function:n==="<anonymous>"?"?":n,in_app:K7(e)};return ce(r)||(i.lineno=r),ce(s)||(i.colno=s),i}const r5=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:"?",n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},Y7=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,X7=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Q7=/\((\S*)(?::(\d+))(?::(\d+))\)/,J7=(t,e)=>{const n=Y7.exec(t);if(n){const[,s,i,o]=n;return j_(e,s,"?",+i,+o)}const r=X7.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){const o=Q7.exec(r[2]);o&&(r[2]=o[1],r[3]=o[2],r[4]=o[3])}const[s,i]=r5(r[1]||"?",r[2]);return j_(e,i,s,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},e$=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,t$=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,n$=(t,e)=>{const n=e$.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const i=t$.exec(n[3]);i&&(n[1]=n[1]||"eval",n[3]=i[1],n[4]=i[2],n[5]="")}let r=n[3],s=n[1]||"?";return[s,r]=r5(s,r),j_(e,r,s,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},K8=/\(error: (.*)\)/;function Yw(t,e){return t.filename===e.filename&&t.function===e.function&&t.module===e.module&&t.lineno===e.lineno&&t.colno===e.colno}function r$(t){for(let e=1;10>=e;e++){const n=t.length-2*e;if(0>n)break;let r=!0;for(let s=0;e>s;s++)if(!Yw(t[n+s],t[n+e+s])){r=!1;break}if(r){for(let s=0;e>s;s++)t[n+s]=t[n+e+s];return t.length=n+e,{start:n,length:e}}}}function s$(t,e){const n=e.start+e.length,r=i5(t,e);r&&t.splice(n+r===t.length?n:e.start,r)}function s5(t,e){let n=e.start;for(;n>0&&Yw(t[n-1],t[n-1+e.length]);)n--;return e.start-n}function i5(t,e){const n=e.start+e.length;let r=n;for(;t.length>r&&Yw(t[r],t[r-e.length]);)r++;return r-n}function i$(t,e){const n=e[0];let r=t.length-(n?s5(t,n):0);for(const s of e)r-=i5(t,s);return r}function o$(t,e,n){for(let r=0;t.length>r;r++){const s=t[(e+r)%t.length],i=t[(n+r)%t.length];if(s!==i)return i>s}return!1}var a$=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){const n=it(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:n?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){const e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?`${e}: ${t.message}`:e}isDOMException(t){return ym(t,"DOMException")}isDOMError(t){return ym(t,"DOMError")}},l$=class{match(t){return ld(t)}coerce(t,e){var n;const r=this.getStack(t),s=r===void 0?(n=e.syntheticException)===null||n===void 0?void 0:n.stack:void 0,i=!!s;return{type:this.getType(t),value:this.getMessage(t,e),stack:r??s,cause:t.cause?e.next(t.cause):void 0,synthetic:i}}getType(t){return t.name||t.constructor.name}getMessage(t,e){const n=t.message;return String(n.error&&typeof n.error.message=="string"?n.error.message:n)}getStack(t){try{const e=t.stacktrace;if(typeof e=="string"&&e.length>0)return e;const n=t.stack;return typeof n=="string"&&n.length>0?n:void 0}catch{return}}},c$=class{match(t){return!!ym(t,"ErrorEvent")&&(t.error!=null||this.ur(t))}coerce(t,e){var n;if(t.error!=null)return e.apply(t.error);const r=e.apply(t.message);return V(V({},r),{},{stack:(n=this.cr(t))!==null&&n!==void 0?n:r.stack,synthetic:!0})}ur(t){return it(t.message)&&t.message.length>0}cr(t){var e,n;const r=t,s=(e=r.lineno)!==null&&e!==void 0?e:0,i=(n=r.colno)!==null&&n!==void 0?n:0;if(it(r.filename)&&r.filename.length!==0&&s!==0)return`Error
|
|
18
|
-
at ${r.filename}:${s}:${i}`}};const u$=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var d$=class{match(t){return typeof t=="string"}coerce(t,e){var n;const[r,s]=this.getInfos(t);return{type:r??"Error",value:s??t,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}getInfos(t){let e="Error",n=t;const r=t.match(u$);return r&&(e=r[1],n=r[2]),[e,n]}};const f$=["fatal","error","warning","log","info","debug"];function o5(t,e=40){const n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(let r=n.length;r>0;r--){const s=n.slice(0,r).join(", ");if(e>=s.length)return r===n.length?s:s.length>e?`${s.slice(0,e)}...`:s}return""}var h$=class{match(t){return typeof t=="object"&&t!==null}coerce(t,e){var n,r;const s=this.getErrorPropertyFromObject(t);return s?e.apply(s):{type:this.getType(t),value:this.getValue(t),stack:(n=this.getStack(t))!==null&&n!==void 0?n:(r=e.syntheticException)===null||r===void 0?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(Gw(t))return t.constructor.name;const e="name"in t?t.name:void 0;return it(e)&&!Cf(e)?e:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){let n=`'${t.name}' captured as exception`;return"message"in t&&typeof t.message=="string"&&(n+=` with message: '${t.message}'`),n}if("message"in t&&typeof t.message=="string")return t.message;const e=this.getObjectClassName(t);return`${e&&e!=="Object"?`'${e}'`:"Object"} captured as exception with keys: ${o5(t)}`}isSeverityLevel(t){return it(t)&&!Cf(t)&&f$.indexOf(t)>=0}getStack(t){try{return it(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:it(t.stack)&&t.stack.length>0?t.stack:void 0}catch{return}}getErrorPropertyFromObject(t){for(const e in t)if({}.hasOwnProperty.call(t,e)){const n=t[e];if(ld(n))return n}}getObjectClassName(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{return}}},p$=class{match(t){return Gw(t)}coerce(t,e){var n;const r=t.constructor.name;return{type:r,value:`${r} captured as exception with keys: ${o5(t)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}},m$=class{match(t){return bP(t)}coerce(t,e){var n;return{type:"Error",value:`Primitive value captured as exception: ${String(t)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}},g$=class{match(t){return ym(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!Gw(t))return!1;try{const e=t.detail;return e!=null&&typeof e=="object"&&"reason"in e}catch{return!1}}coerce(t,e){var n;const r=this.getUnhandledRejectionReason(t);return bP(r)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(r)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}:e.apply(r)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&t.detail!=null&&typeof t.detail=="object"&&"reason"in t.detail)return t.detail.reason}catch{}return t}};const bm="$message",Sm="$timestamp",v$=new Set([bm,Sm]),F1={enabled:!0,max_bytes:32768};function km(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:F1.enabled,max_bytes:_$(t.max_bytes,F1.max_bytes)}:V({},F1)}var y$=class{constructor(t){this.ns=[],this.ss=0,this.Rr=km(t)}setConfig(t){this.Rr=km(t),this.rs()}add(t){const e=(function(r){let s;try{s=wP(r)}catch{return}try{const i=JSON.parse(s);if(!ut(i))return;const o=i,l=o[bm],u=o[Sm];return!it(l)||l.trim().length===0||!it(u)&&!pn(u)?void 0:{step:o,json:s}}catch{return}})(t);if(!e)return;const n=(function(r){if("u">typeof TextEncoder)return new TextEncoder().encode(r).length;const s=encodeURIComponent(r);let i=0;for(let o=0;s.length>o;o++)s[o]==="%"?(i+=1,o+=2):i+=1;return i})(e.json);n>this.Rr.max_bytes||(this.ns.push({step:e.step,bytes:n}),this.ss+=n,this.rs())}getAttachable(){return this.ns.map(t=>t.step)}clear(){this.ns=[],this.ss=0}size(){return this.ns.length}rs(){for(;this.ss>this.Rr.max_bytes&&this.ns.length>0;){const t=this.ns.shift();t&&(this.ss-=t.bytes)}}};function _$(t,e){if(!pn(t)||t===1/0||t===-1/0)return e;const n=Math.floor(t);return 0>n?e:n}const Y8=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function X8(t){return typeof t=="string"||t}function Q8(t){return typeof t=="string"?t:void 0}const w$=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],a5="NativeGzipValidationError",F_=t=>t.length>=2&&t[0]===31&&t[1]===139,J8=(t,e)=>t===M_.GZipJS||e===M_.GZipJS||e==="gzip",eS=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError";let nf;const o0=t=>{throw e5(a5,`Native gzip produced invalid output: ${t}`)},x$=(tS=qt(function*(t,e){18>t.size&&o0("too-short");const n=new Uint8Array(yield t.slice(0,10).arrayBuffer());F_(n)&&n[2]===8||o0("invalid-header");const r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(i=>{const o=(()=>{if(nf)return nf;nf=[];for(let u=0;256>u;u++){let d=u;for(let f=0;8>f;f++)d=1&d?3988292384^d>>>1:d>>>1;nf[u]=d>>>0}return nf})();let l=4294967295;for(let u=0;i.length>u;u++)l=o[255&(l^i[u])]^l>>>8;return(4294967295^l)>>>0})(e)&&o0("invalid-crc");const s=e.length>>>0;r.getUint32(4,!0)!==s&&o0("invalid-size")}),function(t,e){return tS.apply(this,arguments)});var tS;function V_(){return V_=qt(function*(t,e=!0,n){try{const s=new TextEncoder().encode(t),i=new globalThis.CompressionStream("gzip"),o=i.writable.getWriter(),l=o.write(s).then(()=>o.close()).catch((r=qt(function*(f){try{yield o.abort(f)}catch{}throw f}),function(f){return r.apply(this,arguments)})),u=new Response(i.readable).blob(),[d]=yield Promise.all([u,l]);return yield x$(d,s),d}catch(s){if(n!=null&&n.rethrow)throw s;return e&&console.error("Failed to gzip compress data",s),null}var r}),V_.apply(this,arguments)}function l5(t,e){if(t==null)return{};var n,r,s=(function(o,l){if(o==null)return{};var u={};for(var d in o)if({}.hasOwnProperty.call(o,d)){if(l.includes(d))continue;u[d]=o[d]}return u})(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;i.length>r;r++)e.includes(n=i[r])||{}.propertyIsEnumerable.call(t,n)&&(s[n]=t[n])}return s}const b$={}.propertyIsEnumerable;function Em(t,e){try{return c5(t,e,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch{return[]}}function Xw(t,e,n,r){if(0>=n.remainingNodes)return{stringValue:$_};if(n.remainingNodes--,Or(t))return{boolValue:t};if(typeof t=="bigint")return(function(s,i){const o=s.toString(),l=BigInt("9223372036854775808");return s>=l||-l>s?(i==null||i.debug(`Attribute ${o} is outside the int64 range; encoding it as a string`),{stringValue:o}):{intValue:o}})(t,e);if(typeof t=="number"){if(!Number.isFinite(t))return{stringValue:String(t)};if(Number.isInteger(t)){if(Number.isSafeInteger(t))return{intValue:String(t)};if(typeof BigInt>"u")return{stringValue:String(t)};const s=BigInt(t).toString();return t>=9223372036854776e3||-9223372036854776e3>t?(e==null||e.debug(`Attribute ${s} is outside the int64 range; encoding it as a string`),{stringValue:s}):{intValue:s}}return{doubleValue:t}}if(typeof t=="string")return{stringValue:wu(t)};if(typeof t=="function")return{stringValue:"[Function]"};if(typeof t=="symbol")return{stringValue:String(t)};if(typeof t=="object"&&t!==null){if(n.ancestors.has(t))return{stringValue:"[Circular]"};if(r>=20)return{stringValue:$_};if(t instanceof Date){const s=t.getTime(),i=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:typeof i=="string"?wu(i):String(i)}}n.ancestors.add(t);try{try{const s=t.toJSON;if(typeof s=="function")return Xw(s.call(t),e,n,r+1)}catch{}return Ue(t)?{arrayValue:{values:S$(t,e,n,r+1)}}:{kvlistValue:{values:c5(t,e,n,r+1)}}}finally{n.ancestors.delete(t)}}return{stringValue:wu(String(t))}}function S$(t,e,n,r){const s=[],i=Math.min(t.length,1e3);let o=0;for(;i>o&&n.remainingNodes>0;o++)try{const l=o in t?t[o]:void 0;if(nt(l))continue;s.push(Xw(l,e,n,r))}catch{s.push({stringValue:jh})}return t.length>o&&s.push({stringValue:$_}),s}function c5(t,e,n,r){const s=[];for(const i in t)if(b$.call(t,i)){if(!i){e==null||e.debug("Dropping an attribute with an empty key");continue}if(s.length>=1e3||0>=n.remainingNodes){e==null||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{const o=t[i];if(on(o)||ce(o))continue;s.push({key:wu(i),value:Xw(o,e,n,r)})}catch{s.push({key:wu(i),value:{stringValue:jh}})}}return s}function u5(t,e,n){return V(V(V(V({},QP({},t.resourceAttributes)),{},{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment}),t.serviceVersion&&{"service.version":t.serviceVersion}),{},{"telemetry.sdk.name":e,"telemetry.sdk.version":n})}const k$=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function d5(t,e){const n=QP({},t),r={};for(const s of k$)({}).hasOwnProperty.call(n,s)&&(r[s]=n[s],delete n[s]);return[...Em(n,e),...Em(r,e)]}const nS={darwin:"macOS",win32:"Windows",cygwin:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",netbsd:"NetBSD",sunos:"SunOS",aix:"AIX",haiku:"Haiku","Mac OS X":"macOS"},f5={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}},E$=f5.info;function C$(t){try{return wu(String(t))}catch{return jh}}function P$(t,e,n,r){const s=t.level||"info",{text:i,number:o}=f5[s]||E$,l=(function(g=Date.now()){return String(g)+"000000"})(pn(r)?r:void 0),u={};e.distinctId&&(u.posthogDistinctId=e.distinctId),e.sessionId&&(u.sessionId=e.sessionId),e.windowId&&(u["window.id"]=e.windowId),nt(e.sessionStartTimestamp)||(u.sessionStartTimestamp=String(e.sessionStartTimestamp)),nt(e.lastActivityTimestamp)||(u.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(u["url.full"]=e.currentUrl),e.screenName&&(u["screen.name"]=e.screenName),e.appState&&(u["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(u.feature_flags=e.activeFeatureFlags);const d=V({},u),f=t.attributes;if(f){let g=[];try{g=Object.keys(f)}catch{g=[]}for(const v of g){let w;try{w=f[v]}catch{w=jh}Object.defineProperty(d,v,{value:w,enumerable:!0,writable:!0,configurable:!0})}}const p={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:o,severityText:i,body:{stringValue:C$(t.body)},attributes:Em(d,n)};return t.trace_id&&(p.traceId=t.trace_id),t.span_id&&(p.spanId=t.span_id),ce(t.trace_flags)||(p.flags=t.trace_flags),p}function h5(t,e,n){return u5(t,e,n)}function p5(t,e,n,r){return{resourceLogs:[{resource:{attributes:d5(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}var m5=class{constructor(t){this.ls=t,this.us=0}get pending(){return!!this.hs}arm(t){this.clear(),this.us=Date.now()+t,this.hs=t5(()=>{this.hs=void 0,this.ls()},t)}armNoEarlierThan(t){this.hs&&Date.now()+t<=this.us||this.arm(t)}clear(){this.hs&&(clearTimeout(this.hs),this.hs=void 0)}};function g5(){return .75+.5*Math.random()}function v5(t,e,n,r){const s=Math.min(Math.max(0,e-1),6),i=t*Math.pow(2,s);return Math.round(Math.min(i,Math.max(r,t))*n)}var R$=class{constructor(t,e,n,r,s,i=()=>Promise.resolve(),o){var l;this._instance=t,this.Rr=e,this.$=n,this.cs=r,this.ds=s,this.vs=i,this.fs=o,this.ps=new m5(()=>this.gs()),this.ys=null,this.bs=0,this._s=0,this.ws=new JP,this.ks=0,this.Ss=1,this.xs=0,this.Cs=0,this.$s=!1,this.Ts=e.maxBufferSize,this.Is=Math.max((l=e.maxQueueSize)!==null&&l!==void 0?l:e.maxBufferSize,e.maxBufferSize),this.Ms=e.flushIntervalMs,this.Es=e.maxBatchRecordsPerPost,this.Ps=e.rateCapWindowMs,this.Rs=e.maxLogsPerInterval}clearQueue(){this._s++,this._instance.setPersistedProperty(Ai.LogsQueue,[])}reset(){this.ps.clear(),this.xs=0,this.Cs=0,this.$s=!1,this.ks=0,this.Ss=1,this.ws.reset(),this.Es=this.Rr.maxBatchRecordsPerPost}onReconnect(){this.ks=0,this.Ss=1,this.ws.isOpen()?this.As()&&this.Fs():this.gs()}captureLog(t,e){var n;if(this._instance.isDisabled||this._instance.optedOut||!(t!=null&&t.body))return;const r=this.Os(t);if(r===null)return;if(!r.body)return void this.$.info("Log was rejected in beforeSend function");if(!this.Ds())return;const s={record:P$(r,(n=e==null?void 0:e.context)!==null&&n!==void 0?n:this.cs(),this.$,e==null?void 0:e.occurredAtMs)};this.ds(()=>this.Ls(s))}Os(t){const e=this.Rr.beforeSend;if(!e)return t;const n=Ue(e)?e:[e];let r=t;for(const s of n)try{const i=s(r);if(!i)return this.$.info("Log was rejected in beforeSend function"),null;r=i}catch(i){return this.$.error("Error in beforeSend function for log:",i),null}return r}Ds(){if(this.Rs===void 0)return!0;const t=Date.now(),e=t-this.xs;return this.Ps>e&&e>=0||(this.xs=t,this.Cs=0,this.$s=!1),this.Rs>this.Cs?(this.Cs++,!0):(this.$s||(this.$.warn(`captureLog dropping logs: exceeded ${this.Rs} logs per ${this.Ps}ms`),this.$s=!0),!1)}flush(){var t=this;return qt(function*(){if(!t._instance.isDisabled)return t.ys||(t.ys=t.Ns().finally(()=>{t.ys=null})),t.ys})()}Ns(){var t=this;return qt(function*(){var e;t.ps.clear();let n=(e=t._instance.getPersistedProperty(Ai.LogsQueue))!==null&&e!==void 0?e:[];if(n.length===0)return;const r=n.length;let s=0;for(;n.length>0&&r>s;){var i,o;const l=t._s;t.bs=0;const u=Math.min(n.length,t.Es),d=n.slice(0,u),f=p5(d.map(g=>g.record),t.qs(),(i=t.fs)!==null&&i!==void 0?i:t._instance.getLibraryId(),t._instance.getLibraryVersion()),p=yield t._instance.js(f);if(t._s!==l)return;if(p.kind==="too-large"&&d.length>1)t.Es=Math.max(1,Math.floor(d.length/2)),t.$.warn(`Logs batch of size ${d.length} was too large for the ingestion endpoint, reducing batch size to ${t.Es}`);else if(t.ws.record(p),t.ps.pending&&t.ps.arm(Math.max(t.Ms,t.ws.remainingMs())),p.kind==="retry-later"||(p.kind==="too-large"?t.$.warn("Dropping a single log record with batch size 1 — the record is larger than the server cap and cannot be split further."):p.kind==="ok"&&t.Rr.maxBatchRecordsPerPost>t.Es&&(t.Es=Math.min(t.Rr.maxBatchRecordsPerPost,t.Es+1)),yield t.Bs(d.length),n=(o=t._instance.getPersistedProperty(Ai.LogsQueue))!==null&&o!==void 0?o:[],s+=d.length,p.kind==="fatal"))throw p.error}})()}Bs(t){var e=this;return qt(function*(){var n;const r=Math.max(0,t-e.bs),s=(n=e._instance.getPersistedProperty(Ai.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(Ai.LogsQueue,s.slice(r)),yield e.vs()})()}qs(){return h5(this.Rr,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ls(t){var e;if(this._instance.optedOut)return;const n=(e=this._instance.getPersistedProperty(Ai.LogsQueue))!==null&&e!==void 0?e:[];this.Is>n.length||(n.shift(),this.bs++,this.$.info("Logs queue is full, dropping oldest record.")),n.push(t),this._instance.setPersistedProperty(Ai.LogsQueue,n),this.Ts>n.length||this.ws.isOpen()?this.Fs():this.gs()}Fs(){this.ps.pending||this.ps.arm(Math.max(this.Ms,this.ws.remainingMs()))}Hs(){return Math.max(v5(this.Ms,this.ks,this.Ss,3e4),this.ws.remainingMs())}As(){const t=this._instance.getPersistedProperty(Ai.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return qt(function*(){e.ps.clear();const n=e.flush().catch(()=>{});t!==void 0?yield W8(n,t):yield n})()}flushWithTimeout(t){var e=this;return qt(function*(){const n=e.flush();yield W8(n,t,()=>{n.catch(()=>{})})})()}gs(){this.flush().then(()=>{this.ks=0,this.Ss=1},t=>{this.ks++,this.Ss=g5(),this.$.error("PostHog logs flush failed:",t)}).finally(()=>{!this._instance.isDisabled&&this.As()&&this.ps.armNoEarlierThan(this.Hs())})}};const V1=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function rS(t){return String(t)+"000000"}function sS(t,e,n,r){let s="";return r&&(s=Object.keys(r).sort().map(i=>`${JSON.stringify(i)}:${JSON.stringify(r[i])}`).join(",")),`${t}\0${e}\0${n??""}\0${s}`}var A$=class{constructor(t,e,n){this._instance=t,this.Rr=e,this.$=n,this.zs=new Map,this.ps=new m5(()=>this.flush().catch(r=>{this.$.error("Metrics flush failed:",r)})),this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.ws=new JP,this.ks=0,this.Ss=1,this.Gs=0}count(t,e=1,n){this.Zs({name:t,type:"count",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}gauge(t,e,n){this.Zs({name:t,type:"gauge",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}histogram(t,e,n){this.Zs({name:t,type:"histogram",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}flush(){var t=this;const e=this.ys,n=(function(){var r=qt(function*(){e&&(yield e.catch(()=>{})),yield t.Qs()});return function(){return r.apply(this,arguments)}})()().finally(()=>{this.ys===n&&(this.ys=null)});return this.ys=n,n}drainWindow(){if(this.zs.size===0)return null;const t=this.zs;return this.zs=new Map,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.Js(t)}reset(){this.Gs++,this.ws.reset(),this.ks=0,this.Ss=1,this.ps.clear(),this.zs=new Map,this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set}Zs(t){if(this._instance.isDisabled||this._instance.optedOut)return;const e=this.Os(t);if(e===null)return;if(!e.name||typeof e.name!="string")return void this.$.warn("Dropping metric with empty name");if(typeof e.value!="number"||!Number.isFinite(e.value))return void this.$.warn(`Dropping metric '${e.name}': value must be a finite number`);if(e.type==="count"&&0>e.value)return void this.$.warn(`Dropping count '${e.name}': counters are monotonic, value must be >= 0`);let n,r;try{n=e.attributes?V({},e.attributes):void 0,r=sS(e.type,e.name,e.unit,n)}catch(o){return void this.$.warn(`Dropping metric '${e.name}': attributes could not be serialized`,o)}let s=this.zs.get(r);if(!s){if(!this.Ks())return;s={name:e.name,type:e.type,unit:e.unit,attributes:n,windowStartMs:Date.now()},this.zs.set(r,s)}const i=this.Ws.get(e.name);i===void 0?this.Ws.set(e.name,e.type):i===e.type||this.Vs.has(e.name)||(this.Vs.add(e.name),this.$.warn(`Metric name '${e.name}' is already used as a ${i}; recording it as a ${e.type} too will blend both series in charts. Use a distinct name.`)),this.Xs(s,e.value),this.Fs()}Ks(){return this.Rr.maxSeriesPerFlush>this.zs.size||(this.Us||(this.Us=!0,this.$.warn(`Metric series cap reached (${this.Rr.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}Xs(t,e){switch(t.type){case"count":var n;t.total=((n=t.total)!==null&&n!==void 0?n:0)+e;break;case"gauge":t.last=e;break;case"histogram":{t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(V1.length+1).fill(0)});const r=t.hist;r.count+=1,r.sum+=e,r.min=Math.min(r.min,e),r.max=Math.max(r.max,e),r.bucketCounts[(function(s,i){for(let o=0;i.length>o;o++)if(i[o]>=s)return o;return i.length})(e,V1)]+=1;break}}}Os(t){const e=this.Rr.beforeSend;if(!e)return t;const n=Ue(e)?e:[e];let r=t;for(const s of n)try{const i=s(r);if(!i)return this.$.info("Metric was rejected in beforeSend function"),null;r=i}catch(i){return this.$.error("Error in beforeSend function for metric:",i),null}return r}Fs(){this.ps.pending||this.ps.arm(this.Hs())}Hs(){return Math.max(v5(this.Rr.flushIntervalMs,this.ks,this.Ss,3e4),this.ws.remainingMs())}Qs(){var t=this;return qt(function*(){if(t.ps.clear(),t.zs.size===0)return;const e=t.zs;t.zs=new Map,t.Us=!1,t.Ws=new Map,t.Vs=new Set;const n=t.Gs,r=yield t._instance.Ys(t.Js(e));if(n===t.Gs)switch(t.ws.record(r),r.kind==="retry-later"?(t.ks++,t.Ss=g5()):(t.ks=0,t.Ss=1),t.ps.pending&&t.ps.arm(t.Hs()),r.kind){case"ok":return;case"retry-later":return t.ho(e),void t.ps.armNoEarlierThan(t.Hs());case"too-large":return void t.$.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.$.error("Failed to send metrics batch:",r.error)}})()}Js(t){return e=this.vo(t),n=(function(i,o,l){return u5(i,o,l)})(this.Rr,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:d5(n)},scopeMetrics:[{scope:{name:r,version:s},metrics:e}]}]};var e,n,r,s}vo(t){const e=rS(Date.now()),n=new Map;for(const o of t.values()){var r;const l=sS(o.type,o.name,o.unit,void 0);let u=n.get(l);u||(u=V({name:o.name},o.unit&&{unit:o.unit}),o.type==="count"?u.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:o.type==="gauge"?u.gauge={dataPoints:[]}:u.histogram={aggregationTemporality:1,dataPoints:[]},n.set(l,u));const d=Em((r=o.attributes)!==null&&r!==void 0?r:{},this.$),f=rS(o.windowStartMs);if(o.type==="count"){var s;const p={attributes:d,startTimeUnixNano:f,timeUnixNano:e,asDouble:(s=o.total)!==null&&s!==void 0?s:0};u.sum.dataPoints.push(p)}else if(o.type==="gauge"){var i;const p={attributes:d,timeUnixNano:e,asDouble:(i=o.last)!==null&&i!==void 0?i:0};u.gauge.dataPoints.push(p)}else o.hist&&u.histogram.dataPoints.push({attributes:d,startTimeUnixNano:f,timeUnixNano:e,count:o.hist.count,sum:o.hist.sum,min:o.hist.min,max:o.hist.max,bucketCounts:o.hist.bucketCounts,explicitBounds:V1})}return Array.from(n.values())}ho(t){for(const[r,s]of t){const i=this.zs.get(r);if(i)switch(i.windowStartMs=Math.min(i.windowStartMs,s.windowStartMs),i.type){case"count":var e,n;i.total=((e=i.total)!==null&&e!==void 0?e:0)+((n=s.total)!==null&&n!==void 0?n:0);break;case"gauge":break;case"histogram":if(s.hist)if(i.hist){i.hist.count+=s.hist.count,i.hist.sum+=s.hist.sum,i.hist.min=Math.min(i.hist.min,s.hist.min),i.hist.max=Math.max(i.hist.max,s.hist.max);for(let o=0;i.hist.bucketCounts.length>o;o++)i.hist.bucketCounts[o]+=s.hist.bucketCounts[o]}else i.hist=s.hist}else this.Ks()&&this.zs.set(r,s)}}};const y5=(t,{debugEnabled:e}={})=>{const n={N(r,...s){J&&(Ro.DEBUG||J.POSTHOG_DEBUG||e)&&!ce(J.console)&&J.console&&("__rrweb_original__"in J.console[r]?J.console[r].__rrweb_original__:J.console[r])(t,...s)},debug(...r){n.N("debug",...r)},info(...r){n.N("log",...r)},warn(...r){n.N("warn",...r)},error(...r){n.N("error",...r)},critical(...r){console.error(t,...r)},uninitializedWarning(r){n.error(`You must initialize PostHog before calling ${r}`)},createLogger:(r,s)=>y5(`${t} ${r}`,s)};return n},ve=y5("[PostHog.js]"),un=ve.createLogger,T$=un("[ExternalScriptsLoader]"),Cm=t=>{const e=ue==null?void 0:ue.querySelectorAll("script");if(e){for(let n=0;e.length>n;n++)if(e[n].src===t||e[n].getAttribute("src")===t)return e[n]}},Ll=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return T$.warn(`${e} was requested but loading of external scripts is disabled.`),n("Loading of external scripts is disabled");const r=Cm(e);if(r){if(r.__posthog_loading_callback_fired)return n();const i=r.__posthog_loading_error;return i?n(i):(r.addEventListener("load",o=>{r.__posthog_loading_callback_fired=!0,n(void 0,o)}),void r.addEventListener("error",o=>{r.__posthog_loading_error=o,n(o)}))}const s=()=>{if(!ue)return n("document not found");if(Cm(e))return Ll(t,e,n);let i=ue.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=l=>{i.__posthog_loading_callback_fired=!0,n(void 0,l)},i.onerror=l=>{i.__posthog_loading_error=l,n(l)},t.config.prepare_external_dependency_script&&(i=t.config.prepare_external_dependency_script(i)),!i)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")ue.head.appendChild(i);else{const l=ue.querySelectorAll("body > script");var o;l.length>0?(o=l[0].parentNode)===null||o===void 0||o.insertBefore(i,l[0]):ue.body.appendChild(i)}};ue!=null&&ue.body?s():ue==null||ue.addEventListener("DOMContentLoaded",s)},H1={},iS=(t,e)=>{let n=`/static/${e}.js?v=${t.version}`;return e==="toolbar"&&(n=`${n}&t=${Math.floor(Date.now()/3e5)*3e5}`),t.requestRouter.endpointFor("assets",n)};$e.__PosthogExtensions__=$e.__PosthogExtensions__||{},$e.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e==="remote-config"){const s=t.requestRouter.endpointFor("assets",`/array/${t.config.token}/config.js`);return void Ll(t,s,n)}const r=t.config.strict_script_versioning;if(r){const s=t.requestRouter.endpointFor("assets",`/static/${t.version}/${e}.js`),i=H1[s];if(r==="fallback"&&i){if(Cm(i))return void Ll(t,i,n);delete H1[s]}return void Ll(t,s,r==="fallback"?(o,l)=>{if(o)if(typeof o=="string")n(o);else{var u;const d=iS(t,e);H1[s]=d;const f=Cm(s);f==null||(u=f.parentNode)===null||u===void 0||u.removeChild(f),Ll(t,d,n)}else n(void 0,l)}:n)}Ll(t,iS(t,e),n)},$e.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{const r=t.requestRouter.endpointFor("api",e);Ll(t,r,n)},Ro.DEBUG=!1,Ro.LIB_VERSION="1.434.15",Ro.LIB_NAME="web";var Vn=Ro;const I$="$people_distinct_id",ai="distinct_id",Qw="$device_id",z1="$device_model",Pm="__alias",M$="__cmpns",oS="$fbc",xu="$fbc_persistence",aS="$fbp",Rf="$fbp_persistence",H_="__timers",_5="$autocapture_disabled_server_side",z_="$heatmaps_enabled_server_side",B_="$exception_capture_enabled_server_side",w5="$error_tracking_suppression_rules",U_="$error_tracking_capture_extension_exceptions",Z_="$web_vitals_enabled_server_side",Jw="$dead_clicks_enabled_server_side",ex="$product_tours_enabled_server_side",x5="$logs_capture_enabled_server_side",b5="$web_vitals_allowed_metrics",Af="$session_recording_remote_config",O$="$session_recording_enabled_server_side",L$="$replay_sample_rate",N$="$replay_override_sampling",D$="$replay_override_linked_flag",$$="$replay_override_url_trigger",j$="$replay_override_event_trigger",du="$sesid",S5="$session_is_sampled",F$="$session_past_minimum_duration",V$="$session_recording_url_trigger_activated_session",H$="$session_recording_event_trigger_activated_session",z$="$debug_first_full_snapshot_timestamp",B$="$sess_rec_flush_size",hi="$enabled_feature_flags",ko="$active_feature_flags",W_="$early_access_features",Ql="$feature_flag_details",ka="$feature_flag_payloads",Jl="$feature_flag_request_id",Tf="$minimal_flag_called_events",Ri="$override_feature_flags",Nl="$override_feature_flag_payloads",Ea="$stored_person_properties",Ca="$stored_group_properties",k5="$groups",q_="$surveys",Rm="$surveys_loaded_at",E5="$surveys_activated",C5="$surveys_activated_session",P5="$surveys_activated_timestamps",G_="ph_product_tours",U$="$product_tours_activated",Z$="$product_tours_activated_session",W$="$conversations_widget_session_id",q$="$conversations_ticket_id",G$="$conversations_widget_state",K$="$conversations_user_traits",Pa="$flag_call_reported",yf="$flag_call_reported_session_id",Qf="$feature_flag_errors",Oa="$feature_flag_evaluated_at",Mr="$user_state",K_="$client_session_props",Y$="$capture_rate_limit",R5="$initial_campaign_params",A5="$initial_referrer_info",fu="$initial_person_info",tx="$epp",B1="$posthog_cookieless",T5="$cookieless_mode",I5="$sdk_debug_extensions_init_method",M5="$sdk_debug_extensions_init_time_ms",O5="$sdk_debug_recording_script_not_loaded",L5="$sdk_debug_replay_stale_config",X$="$sdk_debug_replay_event_trigger_status",Q$="$sdk_debug_replay_linked_flag_trigger_status",J$="$sdk_debug_replay_matched_recording_trigger_groups",ej="$sdk_debug_replay_pending_trigger_conditions",tj="$sdk_debug_replay_remote_trigger_matching_config",nj="$sdk_debug_replay_trigger_groups_count",rj="$sdk_debug_replay_url_trigger_status",sj="$session_recording_start_reason",nx="PostHog loadExternalDependency extension not found.",Eo="anonymous",B0="identified",N5="identified_only",Jf="visibilitychange",Am="beforeunload",rx="$pageview",lS="$pageleave",D5="$identify",cS="$groupidentify";function hu(t,e){Ue(t)&&t.forEach(e)}function At(t,e){if(!nt(t))if(Ue(t))t.forEach(e);else if((n=>n instanceof FormData)(t))t.forEach((n,r)=>e(n,r));else for(const n in t)qw.call(t,n)&&e(t[n],n)}const Ut=function(t,...e){for(const n of e)for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t};function U0(t){const e=Object.keys(t);let n=e.length;const r=new Array(n);for(;n--;)r[n]=[e[n],t[e[n]]];return r}const ij=function(t){return function(...e){try{return t.apply(this,e)}catch(n){ve.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ve.critical(n)}}},sx=function(t){const e={};return At(t,function(n,r){(it(n)&&n.length>0||pn(n))&&(e[r]=n)}),e};function $5(t){const e=V({},t);for(const n of["name","message","stack","cause","errors"])try{n in t&&(e[n]=t[n])}catch{}return e}const oj=["herokuapp.com","vercel.app","netlify.app"];function aj(t){const e=t==null?void 0:t.hostname;if(!it(e))return!1;const n=e.split(".").slice(-2).join(".");for(const r of oj)if(n===r)return!1;return!0}function Et(t,e,n,r){const{capture:s=!1,passive:i=!0}=r??{};t==null||t.addEventListener(e,n,{capture:s,passive:i})}function Y_(t){return t.name==="ph_toolbar_internal"}const If=t=>{if(ue){try{const e=t+"=",n=ue.cookie.split(";").filter(r=>r.length);for(let r=0;n.length>r;r++){let s=n[r];for(;s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}}catch{}return null}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return pn(t)&&isFinite(t)&&Math.floor(t)===t});var lj=class X_{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,r,s){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(s)||0>e||0>n||0>r||0>s||e>0xffffffffffff||n>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");const i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/256,i[5]=e,i[6]=112|n>>>8,i[7]=n,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=s>>>24,i[13]=s>>>16,i[14]=s>>>8,i[15]=s,new X_(i)}toString(){let e="";for(let n=0;this.bytes.length>n;n++)e=e+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new X_(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(let n=0;16>n;n++){const r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}},cj=class{generate(){const t=this.generateOrAbort();if(!ce(t))return t;{this.Ct=0;const e=this.generateOrAbort();if(ce(e))throw new Error("Could not generate UUID after timestamp reset");return e}}generateOrAbort(){const t=(()=>{const e=Date.now();return pn(e)&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0})();if(t>this.Ct)this.Ct=t,this.Mt();else{if(this.Ct>=t+1e4)return;this.It++,this.It>4398046511103&&(this.Ct++,this.Mt())}return lj.fromFieldsV7(this.Ct,Math.trunc(this.It/Math.pow(2,30)),this.It&Math.pow(2,30)-1,this.Tt.nextUint32())}Mt(){this.It=1024*this.Tt.nextUint32()+(1023&this.Tt.nextUint32())}constructor(){this.Ct=0,this.It=0,this.Tt=new uj}};let j5=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};J&&!ce(J.crypto)&&crypto.getRandomValues&&(j5=t=>crypto.getRandomValues(t));var uj=class{nextUint32(){return this.Rt.length>this.$t||(j5(this.Rt),this.$t=0),this.Rt[this.$t++]}constructor(){this.Rt=new Uint32Array(8),this.$t=1/0}};let uS;const pi=()=>dj().toString(),dj=()=>(uS||(uS=new cj)).generate();let rf="";const fj=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;let Kc=null;const rn={Et(){if(!on(Kc))return Kc;if(Kc=!1,ue)try{const t=`__ph_cookie_support_${pi()}`;rn.At(t,"xyz"),Kc=If(t)==='"xyz"',rn.Lt(t)}catch{Kc=!1}return Kc},Pt(t){ve.error("cookieStore error: "+t)},Ot:If,Dt(t){let e;try{e=JSON.parse(rn.Ot(t))||{}}catch{}return e},At(t,e,n,r,s){if(!ue)return!1;try{let i="",o="";const l=(function(d,f){if(f){let p=(function(g,v=ue){if(rf)return rf;if(!v||["localhost","127.0.0.1"].includes(g))return"";const w=g.split(".");let _=Math.min(w.length,8);const x="dmn_chk_"+pi();for(;!rf&&_--;){const b=w.slice(_).join("."),E=x+"=1;domain=."+b+";path=/";v.cookie=E+";max-age=3",v.cookie.includes(x)&&(v.cookie=E+";max-age=0",rf=b)}return rf})(d);if(!p){const g=(v=>{const w=v.match(fj);return w?w[0]:""})(d);g!==p&&ve.info("Warning: cookie subdomain discovery mismatch",g,p),p=g}return p?"; domain=."+p:""}return""})(ue.location.hostname,r);if(n){const d=new Date;d.setTime(d.getTime()+864e5*n),i="; expires="+d.toUTCString()}s&&(o="; secure");const u=t+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+l+o;return u.length>3686.4&&ve.warn("cookieStore warning: large cookie, len="+u.length),ue.cookie=u,!0}catch{return!1}},Lt(t,e){if(ue!=null&&ue.cookie&&(!e||!on(If(t))))try{rn.At(t,"",-1,e)}catch{return}}};let U1=null;const pt={Et(){if(!on(U1))return U1;let t=!0;if(ce(J))t=!1;else try{const e="__mplssupport__";pt.At(e,"xyz"),pt.Ot(e)!=='"xyz"'&&(t=!1),pt.Lt(e)}catch{t=!1}return t||ve.error("localStorage unsupported; falling back to cookie store"),U1=t,t},Pt(t){ve.error("localStorage error: "+t)},Ot(t){try{return J==null?void 0:J.localStorage.getItem(t)}catch(e){pt.Pt(e)}return null},Dt(t){try{return JSON.parse(pt.Ot(t))||{}}catch{}return null},At(t,e){try{return J==null||J.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){pt.Pt(n)}return!1},Lt(t){try{J==null||J.localStorage.removeItem(t)}catch(e){pt.Pt(e)}}},Z1=[Ea,ko,hi,Ql,ka,Jl,Oa,Qf,Pa],Dl=[Qw,ai,du,S5,tx,fu,xu,Mr],Tm=t=>t+"_cpm",hj=["__proto__","constructor","prototype"],W1=t=>{if(!ut(t))return{};const e={};return Object.keys(t).forEach(n=>{hj.indexOf(n)===-1&&(e[n]=t[n])}),e},q1=(t,e=[])=>{const n={};return[...Dl,...e].forEach(r=>{const s=t[r];ce(s)||on(s)||s===""||(n[r]=s)}),n},F5=t=>{let e=5381,n=2166136261;for(let r=0;t.length>r;r++){const s=t.charCodeAt(r);e=33*e^s,n=Math.imul(n^s,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(n>>>0).toString(36)},dS=(t,e)=>({p:e,f:F5(JSON.stringify(t))}),fS=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{const n=rn.Dt(Tm(t)),r=(n==null?void 0:n.f)===F5(e)&&Ue(n.p);return{properties:r?n.p:[],isValid:r}}catch{return{properties:[],isValid:!1}}},G1=(t,e)=>e+"|"+(rn.Ot(Tm(t))||""),Yc={},Q_={Et:()=>!0,Pt(t){ve.error("memoryStorage error: "+t)},Ot:t=>t in Yc?Yc[t]:null,Dt:t=>t in Yc?Yc[t]:null,At:(t,e)=>(Yc[t]=e,!0),Lt(t){delete Yc[t]}};let xl=null;const Ht={Et(){if(!on(xl))return xl;if(xl=!0,ce(J))xl=!1;else try{const t="__support__";Ht.At(t,"xyz"),Ht.Ot(t)!=='"xyz"'&&(xl=!1),Ht.Lt(t)}catch{xl=!1}return xl},Pt(t){ve.error("sessionStorage error: ",t)},Ot(t){try{return J==null?void 0:J.sessionStorage.getItem(t)}catch(e){Ht.Pt(e)}return null},Dt(t){try{return JSON.parse(Ht.Ot(t))||null}catch{}return null},At(t,e){try{return J==null||J.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){Ht.Pt(n)}return!1},Lt(t){try{J==null||J.sessionStorage.removeItem(t)}catch(e){Ht.Pt(e)}}};var pj=class{constructor(t){this._instance=t}get Rr(){return this._instance.config}get consent(){return this.Lo()?0:this.No}isOptedOut(){return this.Rr.cookieless_mode==="always"||this.isRejected()||this.consent===-1&&this.Rr.cookieless_mode==="on_reject"}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Rr.opt_out_capturing_by_default}optInOut(t){this.qo.At(this.jo,t?1:0,this.Rr.cookie_expiration,this.Rr.cross_subdomain_cookie,this.Rr.secure_cookie)}reset(){this.qo.Lt(this.jo,this.Rr.cross_subdomain_cookie)}get jo(){const{token:t,opt_out_capturing_cookie_prefix:e,consent_persistence_name:n}=this._instance.config;return n||(e?e+t:"__ph_opt_in_out_"+t)}get No(){const t=this.qo.Ot(this.jo);return O1(t)?1:Ze(M7,t)?0:-1}get qo(){const t=this.Rr.opt_out_capturing_persistence_type,e=t==="localStorage"?pt:rn,n=e.Et()?e:Q_;if(!this.Bo||this.Bo!==n){this.Bo=n;const r=t==="localStorage"?rn:pt;r.Ot(this.jo)&&(this.Bo.Ot(this.jo)||this.optInOut(O1(r.Ot(this.jo))),r.Lt(this.jo,this.Rr.cross_subdomain_cookie))}return this.Bo}Lo(){return!!this.Rr.respect_dnt&&[Kn==null?void 0:Kn.doNotTrack,Kn==null?void 0:Kn.msDoNotTrack,$e.doNotTrack,Kn==null?void 0:Kn.globalPrivacyControl].some(t=>O1(t))}};function V5(t,e){var n;const r=t==null||(n=t.config)===null||n===void 0?void 0:n.get_current_url;if(!Gn(r))return e;try{const s=r(e);return it(s)&&s?s:e}catch(s){return ve.error("Error in get_current_url, falling back to window.location.href",s),e}}function hS(t){var e;return t instanceof Element&&(t.id==="__POSTHOG_TOOLBAR__"||!!(!((e=t.closest)===null||e===void 0)&&e.call(t,".toolbar-global-fade-container")))}function Bi(t){return!!t&&t.nodeType===1}function fr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function H5(t){return!!t&&t.nodeType===3}function ix(t){return!!t&&t.nodeType===11&&Bi(t.host)}function ox(t){return t?wg(t).split(/\s+/):[]}function pS(t,e){const n=(function(r){var s;const i=J==null||(s=J.location)===null||s===void 0?void 0:s.href;return ce(i)?void 0:V5(r,i)})(e);return!!(n&&t&&t.some(r=>n.match(r)))}function Uu(t){let e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return ox(e)}function z5(t){return nt(t)?null:wg(t).split(/(\s+)/).filter(e=>Of(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function eh(t){let e="";return bu(t)&&!th(t)&&t.childNodes&&t.childNodes.length&&At(t.childNodes,function(n){var r;H5(n)&&n.textContent&&(e+=(r=z5(n.textContent))!==null&&r!==void 0?r:"")}),wg(e)}function Mf(t){var e;return ce(t.target)?t.srcElement||null:!((e=t.target)===null||e===void 0)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}const ax=["a","button","form","input","select","textarea","label"];function J_(t,e){const n=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!n&&n.call(t,e)}catch{return!1}}function e2(t,e){if(ce(e))return!0;for(const n of t)if(e.some(r=>J_(n,r)))return!0;return!1}function B5(t){const e=t.parentNode;return!(!e||!Bi(e))&&e}const K1=[".ph-no-autocapture","[data-ph-no-autocapture]"],U5=["next","previous","prev",">","<"],mj=[...U5,"+","-","−","–"],mS=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,gS=[".ph-no-rageclick",".ph-no-capture"],gj=["","text","search","email","password","url","tel","number"];function Z5(t,e){if(!J||lx(t))return!1;let n,r,s;var i,o;if(Or(e)?(n=!!e&&gS,r=void 0,s=!1):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:gS,r=e==null?void 0:e.content_ignorelist,s=(o=e==null?void 0:e.ignore_text_selection)!==null&&o!==void 0&&o),n===!1||s&&(function(u){return!(!u||!Bi(u))&&(!!fr(u,"textarea")||(fr(u,"input")?Ze(gj,(u.getAttribute("type")||"").toLowerCase()):(function(d){var f;if(d.isContentEditable)return!0;const p=(f=d.getAttribute)===null||f===void 0?void 0:f.call(d,"contenteditable");return p==="true"||p===""})(u)))})(t))return!1;const{targetElementList:l}=W5(t,!1);return!(function(u,d){if(u===!1||ce(u))return!1;let f;if(u===!0)f=U5;else{if(!Ue(u))return!1;if(u.length>10)return ve.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;f=u.map(p=>p.toLowerCase())}return d.some(({safeText:p,ariaLabel:g})=>f.some(v=>mS(p,v)||mS(g,v)))})(r,l.map(u=>{var d;return{safeText:eh(u).toLowerCase(),ariaLabel:((d=u.getAttribute("aria-label"))===null||d===void 0?void 0:d.toLowerCase().trim())||""}}))&&!e2(l,n)}const lx=t=>!t||fr(t,"html")||!Bi(t),W5=(t,e)=>{if(!J||lx(t))return{parentIsUsefulElement:!1,targetElementList:[]};let n=!1;const r=[t];let s=t;for(;s.parentNode&&!fr(s,"body");){if(ix(s.parentNode)){r.push(s.parentNode.host),s=s.parentNode.host;continue}const i=B5(s);if(!i)break;if(e||ax.indexOf(i.tagName.toLowerCase())>-1)n=!0;else try{const o=J.getComputedStyle(i);o&&o.getPropertyValue("cursor")==="pointer"&&(n=!0)}catch{}r.push(i),s=i}return{parentIsUsefulElement:n,targetElementList:r}};function bu(t){const e=new Set;let n=0;for(let i=t;i.parentNode&&!fr(i,"body");i=i.parentNode){if(n++>=1e3||e.has(i))return!1;e.add(i);const o=Uu(i);if(Ze(o,"ph-sensitive")||Ze(o,"ph-no-capture"))return!1}if(Ze(Uu(t),"ph-include"))return!0;const r=t.type||"";if(it(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}const s=t.name||t.id||"";return!it(s)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,""))}function th(t){return!!(fr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||fr(t,"select")||fr(t,"textarea")||t.getAttribute("contenteditable")==="true")}const vS=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),yS=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,vj=[16,15,14,13],yj=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),_S=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),wS=/[0-9A-Za-z_]/;function _j(t){let e=0,n=!1;for(let r=t.length-1;r>=0;r--){let s=t.charCodeAt(r)-48;n&&(s*=2,s>9&&(s-=9)),e+=s,n=!n}return e%10==0}function Of(t,e=!0){return!(nt(t)||it(t)&&(t=wg(t),(e?vS.test((t||"").replace(/[- ]/g,"")):(function(n){let r;for(yS.lastIndex=0;r=yS.exec(n);){const s=r[2];if(!s)continue;const i=s.replace(/[- ]/g,"");for(let o=0;i.length>o;o++)for(const l of vj){const u=o+l;if(i.length>=u){const d=i.slice(o,u);if(vS.test(d)&&_j(d))return!0}}}return!1})(t))||(e?yj.test(t):(function(n){let r;for(_S.lastIndex=0;r=_S.exec(n);){const s=r[1],i=r[3];if(!(s&&i&&wS.test(s)&&wS.test(i)))return!0}return!1})(t))))}function xS(t){let e=eh(t);return e=`${e} ${q5(t)}`.trim(),Of(e)?e:""}function q5(t){let e="";return t&&t.childNodes&&t.childNodes.length&&At(t.childNodes,function(n){var r;if(n&&((r=n.tagName)===null||r===void 0?void 0:r.toLowerCase())==="span")try{const s=eh(n);e=`${e} ${s}`.trim(),n.childNodes&&n.childNodes.length&&(e=`${e} ${q5(n)}`.trim())}catch(s){ve.error("[AutoCapture]",s)}}),e}function bS(t){return t.replace(/"|\\"/g,'\\"')}function wj(t){const e=t.attr__class;if(e)return Ue(e)?e:ox(e)}const a0=un("[Dead Clicks]"),xj=()=>!0,bj=t=>{var e;const n=!!(!((e=t.instance.persistence)===null||e===void 0)&&e.get_property(Jw)),r=t.instance.config.capture_dead_clicks;return Or(r)?r:!!ut(r)||n};var SS=class{get lazyLoadedDeadClicksAutocapture(){return this.Ho}constructor(t,e,n){this.instance=t,this.isEnabled=e,this.onCapture=n,this.startIfEnabledOrStop()}onRemoteConfig(t){if(!t.ok)return;const e=t.config;"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[Jw]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.zo(()=>{this.Uo()}):this.stop()}zo(t){var e,n,r;!((e=$e.__PosthogExtensions__)===null||e===void 0)&&e.initDeadClicksAutocapture?t():(n=$e.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this.instance,"dead-clicks-autocapture",s=>{s?a0.error("failed to load script",s):t()})}Uo(){var t;if(ue){if(!this.Ho&&(!((t=$e.__PosthogExtensions__)===null||t===void 0)&&t.initDeadClicksAutocapture)){const e=ut(this.instance.config.capture_dead_clicks)?V({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.Ho=$e.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.Ho.start(ue),a0.info("starting...")}}else a0.error("`document` not found. Cannot start.")}stop(){this.Ho&&(this.Ho.stop(),this.Ho=void 0,a0.info("stopping..."))}};const sf=un("[SegmentIntegration]");function kS(t,e,n=!0){const r=t.config.segment;if(!r)return e();const{analytics:s,filterProperties:i}=(l=>Gn(l.register))(o=r)?{analytics:o}:o;var o;(function(l,u,d,f){const p=v=>{const w=()=>v.anonymousId()||pi();l.config.get_device_id=w,f&&v.id()&&(l.register({distinct_id:v.id(),$device_id:w()}),l.persistence.set_property(Mr,B0)),d(f?void 0:v.anonymousId()||void 0)},g=u.user();"then"in g&&Gn(g.then)?g.then(p):p(g)})(t,s,l=>{s.register(((u,d,{filterProperties:f}={})=>{typeof Promise<"u"&&Promise.resolve||sf.warn("This browser does not have Promise support, and can not use the segment integration");const p=(g,v)=>{if(!v)return g;const w=!!d&&g.event.anonymousId===d&&!g.event.userId;w||g.event.userId||g.event.anonymousId===u.get_distinct_id()||(sf.info("No userId set, resetting PostHog"),u.reset()),w||(d=void 0),g.event.userId&&g.event.userId!==u.get_distinct_id()&&(sf.info("UserId set, identifying with PostHog"),u.identify(g.event.userId));let _=u.calculateEventProperties(v,g.event.properties);if(!nt(f)){const x=g.event.properties||{},b={};for(const C of Object.keys(_))qw.call(x,C)||(b[C]=_[C]);const E=((C,R)=>{const A=Ue(C)?C:[C];let I=V({},R);for(const M of A)try{if(I=M(I),nt(I))return null}catch(T){return sf.error("Error in Segment filterProperties:",T),null}return I})(f,b);if(nt(E))return g;_=E}return g.event.properties=Object.assign({},_,g.event.properties),g};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(g){return p(g,g.event.event)},page(g){return p(g,rx)},identify(g){return p(g,D5)},screen(g){return p(g,"$screen")}}})(t,l,{filterProperties:i})).then(()=>{e()},u=>{sf.error("Failed to register the Segment integration",u),e()})},n)}const G5="posthog-js";function K5(t,{organization:e,projectId:n,prefix:r,severityAllowList:s=["error"],sendExceptionsToPostHog:i=!0}={}){return o=>{var l,u,d,f,p;if(s!=="*"&&!s.includes(o.level)||!t.__loaded)return o;o.tags||(o.tags={});const g=t.requestRouter.endpointFor("ui",`/project/${t.config.token}/person/${t.get_distinct_id()}`);o.tags["PostHog Person URL"]=g,t.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));const v=((l=o.exception)===null||l===void 0?void 0:l.values)||[],w=v.map(b=>V(V({},b),{},{stacktrace:b.stacktrace?V(V({},b.stacktrace),{},{type:"raw",frames:(b.stacktrace.frames||[]).map(E=>V(V({},E),{},{platform:"web:javascript"}))}):void 0})),_={$exception_message:((u=v[0])===null||u===void 0?void 0:u.value)||o.message,$exception_type:(d=v[0])===null||d===void 0?void 0:d.type,$exception_level:o.level,$exception_list:w,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((f=v[0])===null||f===void 0?void 0:f.value)||o.message,$sentry_exception_type:(p=v[0])===null||p===void 0?void 0:p.type,$sentry_tags:o.tags};var x;return e&&n&&(_.$sentry_url=(r||"https://sentry.io/organizations/")+e+"/issues/?project="+n+"&query="+o.event_id),i&&((x=t.exceptions)===null||x===void 0||x.sendExceptionEvent(_)),o}}var Sj=class{constructor(t,e,n,r,s,i){this.name=G5,this.setupOnce=function(o){o(K5(t,{organization:e,projectId:n,prefix:r,severityAllowList:s,sendExceptionsToPostHog:i==null||i}))}}},ES=class{constructor(t){this.Wo=(e,n,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(ve.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),this.Vo=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.Go()}Go(){var t;this.Zo=(t=this._instance.sessionManager)===null||t===void 0?void 0:t.onSessionId(this.Wo)}destroy(){var t;(t=this.Zo)===null||t===void 0||t.call(this),this.Zo=void 0}doPageView(t,e){var n;const r=this.Qo(t,e);return this.Vo={pathname:(n=J==null?void 0:J.location.pathname)!==null&&n!==void 0?n:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(t){var e;return this.Qo(t,(e=this.Vo)===null||e===void 0?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this.Vo)===null||t===void 0?void 0:t.pageViewId}}Qo(t,e){const n=this.Vo;if(!n)return{$pageview_id:e};let r={$pageview_id:e,$prev_pageview_id:n.pageViewId};const s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){let{maxScrollHeight:i,lastScrollY:o,maxScrollY:l,maxContentHeight:u,lastContentY:d,maxContentY:f}=s;if(!(ce(i)||ce(o)||ce(l)||ce(u)||ce(d)||ce(f))){i=Math.ceil(i),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),d=Math.ceil(d),f=Math.ceil(f);const p=i>1?ji(o/i,0,1,ve):1,g=i>1?ji(l/i,0,1,ve):1,v=u>1?ji(d/u,0,1,ve):1,w=u>1?ji(f/u,0,1,ve):1;r=Ut(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:p,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:g,$prev_pageview_last_content:d,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:f,$prev_pageview_max_content_percentage:w})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(t.getTime()-n.timestamp.getTime())/1e3),r}};const of=["flags","surveys"],kj={[I$]:{exposure:"hidden"},[Pm]:{exposure:"hidden"},[M$]:{exposure:"hidden"},[H_]:{exposure:"hidden"},[xu]:{exposure:"hidden"},[Rf]:{exposure:"hidden"},[_5]:{exposure:"event"},[z_]:{exposure:"hidden"},[x5]:{exposure:"hidden"},[B_]:{exposure:"event"},[w5]:{exposure:"hidden"},[U_]:{exposure:"event"},[Z_]:{exposure:"event"},[Jw]:{exposure:"event"},[ex]:{exposure:"hidden"},[b5]:{exposure:"event"},[Af]:{exposure:"hidden"},[O$]:{exposure:"hidden"},[du]:{exposure:"hidden"},[S5]:{exposure:"event"},[L$]:{exposure:"event",shouldSkipFromEventProperties:t=>on(t)},[F$]:{exposure:"event"},[V$]:{exposure:"event"},[H$]:{exposure:"event"},[z$]:{exposure:"event"},[B$]:{exposure:"hidden"},[hi]:{exposure:"hidden",storageGroup:"flags"},[ko]:{exposure:"hidden",storageGroup:"flags"},[W_]:{exposure:"hidden"},[Ql]:{exposure:"hidden",storageGroup:"flags"},[ka]:{exposure:"hidden",storageGroup:"flags"},[Jl]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Tf]:{exposure:"hidden",storageGroup:"flags"},[Ri]:{exposure:"hidden"},[Nl]:{exposure:"hidden"},[Ea]:{exposure:"hidden"},[Ca]:{exposure:"hidden"},[q_]:{exposure:"hidden",storageGroup:"surveys"},[Rm]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[E5]:{exposure:"event"},[C5]:{exposure:"hidden"},[P5]:{exposure:"hidden"},[G_]:{exposure:"hidden"},[U$]:{exposure:"hidden"},[Z$]:{exposure:"hidden"},[W$]:{exposure:"event"},[q$]:{exposure:"event"},[G$]:{exposure:"event"},[K$]:{exposure:"event"},[Pa]:{exposure:"hidden"},[yf]:{exposure:"hidden"},[k5]:{exposure:"event"},[Qf]:{exposure:"hidden"},[Oa]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Mr]:{exposure:"hidden"},[K_]:{exposure:"hidden"},[Y$]:{exposure:"hidden"},[R5]:{exposure:"hidden"},[A5]:{exposure:"hidden"},[fu]:{exposure:"hidden"},[tx]:{exposure:"hidden"},[N$]:{exposure:"event"},[D$]:{exposure:"event"},[$$]:{exposure:"event"},[j$]:{exposure:"event"},[I5]:{exposure:"event"},[M5]:{exposure:"event"},[O5]:{exposure:"event"},[L5]:{exposure:"event"},[X$]:{exposure:"event"},[Q$]:{exposure:"event"},[J$]:{exposure:"event"},[ej]:{exposure:"event"},[tj]:{exposure:"event"},[nj]:{exposure:"event"},[rj]:{exposure:"event"},[sj]:{exposure:"event"}},Ej=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],tr=t=>{const e=kj[t];if(e)return e;for(const[n,r]of Ej)if(t.indexOf(n)===0)return r},pu=(t,e)=>{try{let n;return JSON.stringify(t,(r,s)=>{var i;return ld(s)?((i=n)!==null&&i!==void 0||(n=new WeakMap),n.has(s)||n.set(s,$5(s)),n.get(s)):typeof s=="bigint"?s.toString():s},e)}catch{return wP(t)}},Oo=t=>{const e=ue==null?void 0:ue.createElement("a");return ce(e)?null:(e.href=t,e)},Zu=function(t,e){const n=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&");let r;for(let s=0;n.length>s;s++){const i=n[s].split("=");if(i[0]===e){r=i;break}}if(!Ue(r)||2>r.length)return"";{let s=r[1];try{s=decodeURIComponent(s)}catch{ve.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")}},nh=function(t,e,n){if(!t||!e||!e.length)return t;const r=t.split("#"),s=r[1],i=(r[0]||"").split("?"),o=i[1],l=i[0],u=(o||"").split("&"),d=[];for(let p=0;u.length>p;p++){const g=u[p].split("=");Ue(g)&&(e.includes(g[0])?d.push(g[0]+"="+n):d.push(u[p]))}let f=l;return o!=null&&(f+="?"+d.join("&")),s!=null&&(f+="#"+s),f},Im=function(t,e){const n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},Y5=(t,e)=>t>=e&&_P(),X5=(t,e,n,r)=>{if(t===0){if(_P()){const s=e+1;return s===n&&r(),s}return e}return 0},Wu=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Cj=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Wu],rh="<masked>",Pj=["li_fat_id"];function Q5(t,e,n){if(!ue)return{};const r=e?[...Wu,...n||[]]:[],s=J5(nh(ue.URL,r,rh),t),i=(function(){const o={};return At(Pj,function(l){const u=If(l);o[l]=u||null}),o})();return Ut(i,s)}function J5(t,e){const n=Cj.concat(e||[]),r={};return At(n,function(s){const i=Zu(t,s);r[s]=i||null}),r}function eR(t){const e=(function(s){return s?s.search("https?://(.*)google.([^/?]*)")===0?"google":s.search("https?://(.*)bing.com")===0?"bing":s.search("https?://(.*)yahoo.com")===0?"yahoo":s.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",r={};if(!on(e)){r.$search_engine=e;const s=ue?Zu(ue.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function tR(){return navigator.language||navigator.userLanguage}function Rj(){const t=tR();return typeof t=="string"?t.split("-")[0]:void 0}const Mm="$direct";function nR(){return(ue==null?void 0:ue.referrer)||Mm}function rR(t,e,n=!1){const r=t?[...Wu,...e||[]]:[],s=n?Fa(sn==null?void 0:sn.href):sn==null?void 0:sn.href,i=s==null?void 0:s.substring(0,1e3);return{r:nR().substring(0,1e3),u:i?nh(i,r,rh):void 0}}function sR(t,e=!1){var n;const{r,u:s}=t,i=e?Fa(s):s,o={$referrer:r,$referring_domain:r==null?void 0:r==Mm?Mm:(n=Oo(r))===null||n===void 0?void 0:n.host};if(i){o.$current_url=i;const l=Oo(i);o.$host=l==null?void 0:l.host,o.$pathname=l==null?void 0:l.pathname;const u=J5(i);Ut(o,u)}if(r){const l=eR(r);Ut(o,l)}return o}function iR(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function Aj(){try{return new Date().getTimezoneOffset()}catch{return}}const Tj={flags:Oa,surveys:Rm},Ij=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],l0=t=>`${t}_cookie_identity_change_pending`,c0=t=>{let e="",n=0;for(const r of t){const s=encodeURIComponent(JSON.stringify(r).slice(1,-1)).length;if(n+s>1e3)break;e+=r,n+=s}return e},Dn="main",vo=[hi,ko,Ql,ka,Jl,Oa,Tf,Ea],Y1=t=>vo.indexOf(t)!==-1,oR=[xu,Rf],CS=t=>oR.indexOf(t)!==-1,ua=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch{return t===e}},Xc=t=>{if(!t)return{};const e=JSON.parse(t);return ut(e)?e:{}},PS=(t,e)=>{At(t,(n,r)=>{const s=tr(r);s&&s.exposure!=="event"||{}.hasOwnProperty.call(e,r)||delete t[r]})};var X1=class{constructor(t,e,n=!0){if(this.Jo={},this.Ko=!1,this.Xo=!1,this.Yo=!1,this.ta=!1,this.ea=!1,this.ia=new Map,this.na=!1,this.sa=!1,this.ra=!1,this.oa=new Set,this.aa=new Set,this.Rr=t,this.la=n,this.props={},this.ua=void 0,this.ha=(r=>{let s="";return r.token&&(s=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+s+"_posthog"})(t),this.qo=this.ca(t),this.Yo=this.da(t),this.load(),this.va(),t.debug&&ve.info("Persistence loaded",t.persistence,V({},this.props)),this.update_config(t,t,e),this.save(),J){const r=()=>this.flush();Et(J,"beforeunload",r,{capture:!1}),Et(J,"pagehide",r,{capture:!1}),this.fa=s=>{if(this.Ko&&(!s.storageArea||s.storageArea===(J==null?void 0:J.localStorage))&&s.key)if(s.key!==this.ha){if(this.Yo){const i=of.find(o=>s.key===this.pa(o));i&&this.ga(s.key,i)}}else this.ga(s.key,Dn)},Et(J,"storage",this.fa)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach(([e,n])=>{const r=this.ia.get(e);if(!Y1(e)||r===!0)return;if(n===!0)return void this.ma(e,!0);const s=new Set(r||[]);n.forEach(i=>s.add(i)),s.size&&this.ma(e,s)})}onCrossTabFeatureFlagChange(t){return this.aa.add(t),()=>this.aa.delete(t)}destroy(){this.fa&&J&&(J.removeEventListener("storage",this.fa),this.fa=void 0),this.aa.clear()}ga(t,e,n=!0){if(this.mi)return!1;let r,s;try{if(s=pt.Ot(t),on(s)){const l=this.ya(e);return l.storageValue=null,e!==Dn&&(l.persisted=!1),!1}r=Xc(s)}catch{return!1}const i=e===Dn?r:pt.Dt(this.ha);if(i&&this.ba(i))return!1;const o=this._a(r,e,n);return e===Dn&&this.Yo&&!ua(this.wa().main,r)||this.ka(r,e,!0,s),o}ba(t){const e=this.props[ai],n=t[ai];return!ce(e)&&!ce(n)&&e!==n}ka(t,e,n,r){const s=this.ya(e);s.storageValue=r,e!==Dn&&(s.persisted=n);try{s.fingerprint=this.Sa(t,e)}catch{s.fingerprint=void 0}}_a(t,e,n){let r=!1;return vo.forEach(s=>{var i;const o=(i=tr(s))===null||i===void 0?void 0:i.storageGroup;if(e===Dn&&this.Yo&&o||e!==Dn&&o!==e)return;const l=s in t,u=this.xa(s,l?t[s]:void 0),d=this.ia.has(s)?s in this.props:l;d===s in this.props&&ua(u,this.props[s])||(d?this.Ca(s,u,!1):this.$a(s,!1),r=!0)}),r&&n&&this.aa.forEach(s=>s()),r}Ta(){if(!this.Ko)return!1;try{this.ra=!1;const t=pt.Ot(this.ha),e=this.ya(Dn);let n,r=!1,s=!1;if(t!==e.storageValue)if(on(t))e.storageValue=null;else{if(n=Xc(t),this.ra=!this.sa&&this.ba(n),this.ra)return!1;s=this._a(n,Dn,!1),!this.Yo||ua(this.wa().main,n)?this.ka(n,Dn,!0,t):e.storageValue=t,r=!0}return this.Yo&&of.forEach(i=>{const o=pt.Ot(this.pa(i)),l=this.ya(i),u=n||{},d=r&&vo.some(p=>{var g;return((g=tr(p))===null||g===void 0?void 0:g.storageGroup)===i&&p in u});if(o===l.storageValue&&!d)return;if(on(o))return l.storageValue=null,l.persisted=!1,void(d&&(s=this._a(u,i,!1)||s));const f=Xc(o);s=this._a(f,i,!1)||s,this.ka(f,i,!0,o)}),s}catch{return!1}}ma(t,e){this.ia.set(t,e);const n=tr(t);n!=null&&n.volatile||(this.ya((this.Yo?n==null?void 0:n.storageGroup:void 0)||Dn).fingerprint=void 0,this.Ia(t))}Ma(){vo.forEach(t=>this.ia.set(t,!0))}va(){if(this.Ko)try{const t=pt.Ot(this.ha),e=Xc(t);this.ya(Dn).storageValue=t,vo.forEach(n=>{var r;const s=this.Yo?(r=tr(n))===null||r===void 0?void 0:r.storageGroup:void 0,i=s?pt.Ot(this.pa(s)):null;if(s){const l=this.ya(s);l.storageValue=i,l.persisted=!on(i)}const o=s&&!on(i)?Xc(i):e;n in this.props?this.Ea(n,o[n],this.props[n]):n in o&&this.ma(n,!0)})}catch{}}xa(t,e){const n=this.ia.get(t);if(!n)return e;if(n===!0)return this.props[t];if(t==="$active_feature_flags"){const i=new Set(Ue(e)?e:[]),o=new Set(Ue(this.props[t])?this.props[t]:[]);return n.forEach(l=>o.has(l)?i.add(l):i.delete(l)),Array.from(i)}const r=ut(e)?V({},e):{},s=ut(this.props[t])?this.props[t]:{};return n.forEach(i=>{i in s?r[i]=s[i]:delete r[i]}),r}Ea(t,e,n){if(!Y1(t))return;const r=this.ia.get(t);if(r===!0)return;let s=e;if(this.Ko)try{var i;const l=this.Yo?(i=tr(t))===null||i===void 0?void 0:i.storageGroup:void 0,u=l?this.pa(l):this.ha;s=Xc(pt.Ot(u))[t]}catch{}const o=new Set(r||[]);if(t==="$active_feature_flags"){if(!ce(e)&&!Ue(e)||!ce(s)&&!Ue(s)||!Ue(n))return void this.ma(t,!0);const l=new Set(e||[]),u=new Set(s||[]),d=new Set(n);new Set([...l,...d]).forEach(f=>{l.has(f)!==d.has(f)&&o.add(f)}),o.forEach(f=>{u.has(f)===d.has(f)&&o.delete(f)})}else{if(!ut(n))return void(ua(s,n)?this.ia.delete(t):this.ma(t,!0));{if(!ce(e)&&!ut(e)||ce(e)&&Wr(n)&&ce(s))return void this.ma(t,!0);const l=ut(e)?e:{},u=ut(s)?s:{};new Set([...Object.keys(l),...Object.keys(n)]).forEach(d=>{d in l==d in n&&ua(l[d],n[d])||o.add(d)}),o.forEach(d=>{d in u==d in n&&ua(u[d],n[d])&&o.delete(d)})}}o.size?this.ma(t,o):this.ia.delete(t)}Pa(){var t;const e=(t=this.Rr)===null||t===void 0?void 0:t.persistence_save_debounce_ms;return pn(e)&&e>0?e:0}Ra(t){if(this.Rr.cookieWinsOnConflict&&this.Rr.persistence.toLowerCase()==="localstorage+cookie")if(t)try{const e=q1(t,this.Rr.cookie_persisted_properties||[]),n=dS(e,this.Rr.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(n),s=rn.Ot(this.ha)||void 0;s&&G1(this.ha,s)===r&&(this.Aa=r,this.Fa=s)}catch{}else try{const e=rn.Ot(this.ha)||void 0;this.Aa=e?G1(this.ha,e):void 0,this.Fa=e}catch{}}syncCookieProperties(){return this.Oa(this.Rr)}Oa(t,e=!1){if(this.mi&&!e||this.ea||!t.cookieWinsOnConflict||t.persistence.toLowerCase()!=="localstorage+cookie")return!1;let n;try{n=rn.Ot(this.ha)||void 0}catch{}if(!n||n===this.Fa)return!1;const r=G1(this.ha,n);let s;try{s=W1(JSON.parse(n))}catch{return!1}if((rn.Ot(this.ha)||void 0)!==n)return!1;this.Aa=r,this.Fa=n;const i=fS(this.ha,n),o=[...Dl,...i.properties],l={};if(Object.keys(s).forEach(_=>{const x=s[_];(ce(x)||on(x)||x===""||_==="$user_state"&&x!=="anonymous"&&x!=="identified")&&(l[_]=!0,delete s[_])}),Wr(s))return!1;const u="distinct_id"in s||s.$user_state==="anonymous"||s.$user_state==="identified",d=this.props,f=d[ai],p=d[Mr],g=Ut({},d);[...Dl,...t.cookie_persisted_properties||[]].forEach(_=>{if(o.indexOf(_)!==-1&&!(_ in s)&&!l[_]&&(u||_!=="distinct_id"&&_!=="$user_state")){const x=g[_];(i.isValid||Dl.indexOf(_)===-1||x!==!1&&x!==0)&&delete g[_]}}),this.props=Ut(g,s),vo.forEach(_=>{const x=_ in this.props;_ in d===x&&ua(d[_],this.props[_])||(x?this.Ea(_,d[_],this.props[_]):this.ma(_,!0))}),!u||"$user_state"in s||"$user_state"in this.props||this.Ca(Mr,Eo);const v=this.props[ai],w=this.props[Mr];return!u||v===f&&w===p||(this.sa=!0,this.ta=!0,Ht.At(l0(this.ha),!0),this.$a(Ea),this.$a(ko),this.$a(hi),this.$a(Ql),this.$a(ka),this.$a(Jl),this.$a(Oa),this.$a(Qf),this.$a(Pa),w!=="anonymous"||p!=="identified"&&s.$user_state!=="anonymous"&&(ce(f)||v===f)||(PS(this.props,s),this.$a(Ca)),w==="identified"?this.props.$user_id=v:delete this.props.$user_id,this.$a(Pm)),!0}consumeCookieIdentityChange(){const t=l0(this.ha),e=this.ta||!!Ht.Ot(t);return this.ta=!1,e&&Ht.Lt(t),e}Da(t=!1){return!(this.ea||this.mi&&!t||!this.Rr.cookieWinsOnConflict||this.Rr.persistence.toLowerCase()!=="localstorage+cookie"||(this.ea=!0,0))}La(){this.ea&&(ce(this.Na)||(clearTimeout(this.Na),this.Na=void 0),delete this.Jo[Dn],this.qa(!0))}ja(t=!0){if(this.ea)try{t?this.La():ce(this.Na)||(clearTimeout(this.Na),this.Na=void 0)}finally{this.ea=!1}}isDisabled(){return!!this.mi}ca(t){Ij.indexOf(t.persistence.toLowerCase())===-1&&(ve.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");const e=((o=[],l=!1)=>{const u=[...Dl,...o];return V(V({},pt),{},{Dt(d){try{let p,g={};try{p=rn.Ot(d)||void 0,g=p?W1(JSON.parse(p)):{}}catch{}const v=JSON.parse(pt.Ot(d)||"{}");let w;if(l){const _=fS(d,p),x=[...Dl,..._.properties],b={};Object.keys(g).forEach(C=>{const R=g[C];on(R)||R===""||C==="$user_state"&&R!=="anonymous"&&R!=="identified"||(b[C]=R)});const E="distinct_id"in b||b.$user_state==="anonymous"||b.$user_state==="identified";if(Object.keys(b).length>0){var f;const C=v[ai],R=(f=v.$user_state)!==null&&f!==void 0?f:Eo;u.forEach(A=>{if(x.indexOf(A)!==-1&&!(A in g)&&(E||A!=="distinct_id"&&A!=="$user_state")){const I=v[A];(_.isValid||Dl.indexOf(A)===-1||I!==!1&&I!==0)&&delete v[A]}}),!E||"$user_state"in g||"$user_state"in v||(v[Mr]=Eo),!E||("distinct_id"in b?b[ai]:v[ai])===C&&("$user_state"in b?b[Mr]:v[Mr])===R||(Z1.forEach(A=>delete v[A]),b.$user_state==="identified"&&"distinct_id"in b?v.$user_id=b[ai]:delete v.$user_id,b.$user_state!=="identified"&&(delete v[k5],delete v[Ca]),delete v.__alias)}w=Ut(v,b)}else w=Ut(g,v);return pt.At(d,w),w}catch{}return null},At(d,f,p,g,v,w){const _=pt.At(d,f,void 0,void 0,w);try{const x=q1(f,o);if(Object.keys(x).length){if(l){const b=Tm(d),E=dS(x,o);if(rn.At(b,E,p,g,v,w),rn.Ot(b)!==JSON.stringify(E)){rn.Lt(b,g);const C=q1(f);return rn.At(d,C,p,g,v,w),_}}rn.At(d,x,p,g,v,w)}}catch(x){pt.Pt(x)}return _},Lt(d,f){try{J==null||J.localStorage.removeItem(d),rn.Lt(d,f),rn.Lt(Tm(d),f)}catch(p){pt.Pt(p)}}})})(t.cookie_persisted_properties||[],t.cookieWinsOnConflict);let n,r=!1,s=!1;const i=t.persistence.toLowerCase();return i==="localstorage"&&pt.Et()?(n=pt,s=!0):i==="localstorage+cookie"&&e.Et()?(n=e,s=!0,r=!0):i==="sessionstorage"&&Ht.Et()?n=Ht:i==="memory"?n=Q_:i==="cookie"&&rn.Et()?(n=rn,r=!0):e.Et()?(n=e,s=!0,r=!0):rn.Et()?(n=rn,r=!0):n=Q_,this.Ko=s,this.Xo=r,n}pa(t){return`${this.ha}__${t}`}da(t){return this.Ko&&!!t.split_storage}properties(){const t={};return At(this.props,(e,n)=>{const r=tr(n);if(!r||r.exposure==="event"){var s;if(!(r==null||(s=r.shouldSkipFromEventProperties)===null||s===void 0)&&s.call(r,e))return;t[n]=e}}),t}load(t=!1){if(this.mi&&!t)return;const e=this.Rr.cookieWinsOnConflict&&this.Rr.persistence.toLowerCase()==="localstorage+cookie",n=e?pt.Dt(this.ha):null;let r={};if(e)try{r=W1(rn.Dt(this.ha)),At(r,(l,u)=>{(ce(l)||on(l)||l==="")&&delete r[u]})}catch{}const s=this.qo.Dt(this.ha);if(s&&(this.props=Ut({},s)),this.Yo&&this.Ba(),e&&s){var i,o;const l=n==null?void 0:n[ai],u=(i=n==null?void 0:n.$user_state)!==null&&i!==void 0?i:Eo,d=s[ai],f=(o=s.$user_state)!==null&&o!==void 0?o:Eo;if(d!==l||f!==u){this.ta=!0,Ht.At(l0(this.ha),!0);const p=Ut({},this.props);Z1.forEach(v=>delete p[v]),f!=="anonymous"||u!=="identified"&&r.$user_state!=="anonymous"&&(ce(l)||d===l)||(PS(p,r),delete p[Ca]),this.props=p;const g=new Set;Z1.forEach(v=>{var w;const _=(w=tr(v))===null||w===void 0?void 0:w.storageGroup;_&&g.add(_)}),g.forEach(v=>{const w={};At(this.props,(_,x)=>{var b;((b=tr(x))===null||b===void 0?void 0:b.storageGroup)===v&&(w[x]=_)}),Wr(w)?(pt.Lt(this.pa(v)),this.Jo[v]={}):pt.At(this.pa(v),w)&&(this.Jo[v]={persisted:!0,fingerprint:this.Sa(w,v)})})}}Ht.Ot(l0(this.ha))&&(this.ta=!0)}Ba(){for(const t of of){const e=pt.Dt(this.pa(t));if(e&&!Wr(e)){const n=this.ya(t);n.persisted=!0,this.Ha(t)||(n.fingerprint=this.Sa(e,t)),this.za(t,e)||Ut(this.props,e)}}}Ha(t){return Object.keys(this.props).some(e=>{var n;return((n=tr(e))===null||n===void 0?void 0:n.storageGroup)===t})}za(t,e){const n=Tj[t];if(!n)return!1;const r=e[n],s=this.props[n];return pn(r)&&pn(s)&&s>r}refreshKey(t){var e;if(this.mi||this.oa.has(t))return;const n=this.Yo?(e=tr(t))===null||e===void 0?void 0:e.storageGroup:void 0,r=n?pt.Dt(this.pa(n)):this.qo.Dt(this.ha);if(r&&t in r)this.Ca(t,r[t],!1);else{if(n){const s=this.qo.Dt(this.ha);if(s&&t in s)return void this.Ca(t,s[t],!1)}this.$a(t,!1)}}save(){if(this.mi)return;const t=this.Pa();t>0?ce(this.Na)&&(this.Na=setTimeout(()=>{this.Na=void 0,this.qa()},t)):this.qa()}flush(){ce(this.Na)||(clearTimeout(this.Na),this.Na=void 0,this.qa())}qa(t=!1){if(this.mi||this.ea&&!t)return;t||(this.syncCookieProperties(),this.Rr.cookieWinsOnConflict&&this.Rr.persistence.toLowerCase()==="localstorage+cookie"||oR.forEach(s=>this.refreshKey(s)));const e=!t&&!this.na;e||(this.ra=!1);const n=!!e&&this.Ta();if(this.ra)return void(this.Rr.debug&&ve.warn("skipping persistence write because storage belongs to a different distinct ID"));if(this.Yo)return this.Ua(),void(n&&this.aa.forEach(s=>s()));const r=this.Wa(this.qo,this.ha,this.props,Dn);r==="written"&&this.Ra(this.props),r!=="failed"&&(this.ia.clear(),this.sa=!1,this.oa.clear()),n&&this.aa.forEach(s=>s())}Ua(){const{main:t,groups:e}=this.wa(),n=this.Wa(this.qo,this.ha,t,Dn);n==="written"&&this.Ra(t),n!=="failed"&&(this.sa=!1,this.oa.clear(),vo.forEach(s=>{var i;!((i=tr(s))===null||i===void 0)&&i.storageGroup||this.ia.delete(s)}));for(const s of of){var r;const i=e[s];if(Wr(i)&&!(!((r=this.Jo[s])===null||r===void 0)&&r.persisted)){vo.forEach(l=>{var u;((u=tr(l))===null||u===void 0?void 0:u.storageGroup)===s&&this.ia.delete(l)});continue}const o=this.Wa(pt,this.pa(s),i,s);o!=="failed"&&vo.forEach(l=>{const u=tr(l);(u==null?void 0:u.storageGroup)!==s||o!=="written"&&u.volatile||this.ia.delete(l)})}}wa(){const t={},e={flags:{},surveys:{}};return At(this.props,(n,r)=>{var s;const i=(s=tr(r))===null||s===void 0?void 0:s.storageGroup;i?e[i][r]=n:t[r]=n}),{main:t,groups:e}}Sa(t,e){if(e===Dn)return JSON.stringify(t)+"|"+this.Va+"|"+this.Ga+"|"+this.Za;const n={};return At(t,(r,s)=>{var i;n[s]=!((i=tr(s))===null||i===void 0)&&i.volatile?"__volatile__":r}),JSON.stringify(n)}Wa(t,e,n,r){const s=this.ya(r);if(r!==Dn&&!s.dirty&&!ce(s.fingerprint))return"skipped";let i;try{if(i=this.Sa(n,r),i===s.fingerprint)return s.dirty=!1,"skipped"}catch{i=void 0}return t.At(e,n,this.Va,this.Ga,this.Za,this.Rr.debug)?(s.dirty=!1,r!==Dn&&(s.persisted=!0),ce(i)||(s.fingerprint=i),this.Ko&&(s.storageValue=pt.Ot(e)),"written"):(this.Rr.debug&&ve.warn(`failed to persist storage entry "${e}"; will retry on next save`),"failed")}remove({keepGroupEntries:t=!1}={}){if(this.Ma(),ce(this.Na)||(clearTimeout(this.Na),this.Na=void 0),this.qo.Lt(this.ha,!1),this.qo.Lt(this.ha,!0),!t&&this.la)for(const e of of)pt.Lt(this.pa(e));t?delete this.Jo[Dn]:this.Jo={},this.Aa=void 0,this.Fa=void 0}clear(){this.remove(),this.props={}}register_once(t,e,n){if(ut(t)){this.syncCookieProperties(),ce(e)&&(e="None"),this.Va=ce(n)?this.Qa:n;let r=!1;if(At(t,(s,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.Ca(i,s),r=!0)}),r)return this.save(),!0}return!1}register(t,e){if(ut(t)){this.syncCookieProperties(),this.Va=ce(e)?this.Qa:e;let n=!1;if(At(t,(r,s)=>{t.hasOwnProperty(s)&&(this.props[s]!==r||ut(r)||Ue(r))&&(this.Ca(s,r),n=!0)}),n)return this.save(),!0}return!1}unregister(t){this.syncCookieProperties();const e=typeof t=="string"?[t]:t;let n=!1;for(const r of e)r in this.props&&(this.$a(r),n=!0);n&&this.save()}update_campaign_params(){const t=ue==null?void 0:ue.URL;if(t===this.ua)return;const e=Q5(this.Rr.custom_campaign_params,this.Rr.mask_personal_data_properties,this.Rr.custom_personal_data_properties),n=!Wr(sx(e));return n&&this.register(e),this.ua=t,n?e:void 0}update_search_keyword(){this.register((function(){const t=ue==null?void 0:ue.referrer;return t?eR(t):{}})())}update_referrer_info(){var t;this.register_once({$referrer:nR(),$referring_domain:(ue==null?void 0:ue.referrer)&&((t=Oo(ue.referrer))===null||t===void 0?void 0:t.host)||Mm},void 0)}set_initial_person_info(){if(this.props.$initial_campaign_params||this.props.$initial_referrer_info)return;const t=rR(this.Rr.mask_personal_data_properties,this.Rr.custom_personal_data_properties,this.Rr.disable_capture_url_hashes);this.register_once({[fu]:this.Xo?{r:c0(t.r),u:t.u?c0(t.u):void 0}:t},void 0)}get_initial_props(){const t={};At([A5,R5],n=>{const r=this.props[n];r&&At(r,function(s,i){t["$initial_"+O_(i)]=s})});const e=this.props[fu];if(e){const n=(function(r,s=!1){const i=sR(r,s),o={};return At(i,function(l,u){o[`$initial_${O_(u)}`]=l}),o})(e,this.Rr.disable_capture_url_hashes);Ut(t,n)}return t}safe_merge(t){return At(this.props,function(e,n){n in t||(t[n]=e)}),t}update_config(t,e,n){const r=t.persistence!==e.persistence,s=!((v,w)=>{if(v.length!==w.length)return!1;const _=[...v].sort(),x=[...w].sort();return _.every((b,E)=>b===x[E])})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),i=r||s,o=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,l=t.disable_persistence||!!n,u=!!this.mi&&!l;l||this.Oa(e,u),this.Rr=t,!l&&(r||s||o)&&(this.Aa=void 0,this.Fa=void 0,this.Oa(V(V({},t),{},{cookie_persisted_properties:e.cookie_persisted_properties}),u));const d=i||o?this.ca(t):this.qo;this.Ja();const f=this.da(t),p=i||f!==this.Yo,g=!l&&(p||t.cross_subdomain_cookie!==this.Ga||t.secure_cookie!==this.Za)&&this.Da(u);this.na=p;try{if(this.Qa=this.Va=t.cookie_expiration,this.set_disabled(l),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),p){const v=this.props;this.clear(),this.qo=d,this.Yo=f,this.props=v,this.save()}else o&&(this.qo=d,l||(delete this.Jo[Dn],this.qa()))}finally{this.na=!1,g&&this.ja()}}Ja(){const t=this.props[fu];if(!this.Xo||!ut(t)||typeof t.r!="string")return;const e=c0(t.r),n=typeof t.u=="string"?c0(t.u):t.u;e===t.r&&n===t.u||this.Ca(fu,V(V({},t),{},{r:e,u:n}))}set_disabled(t){this.mi=t,this.mi?this.remove():this.save()}set_cross_subdomain(t){t!==this.Ga&&(this.Ga=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.Za&&(this.Za=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){const n=this.props.__timers||{};n[t]=e,this.Ca(H_,n),this.save()}remove_event_timer(t){const e=this.props.__timers||{},n=e[t];return ce(n)||(delete e[t],this.Ca(H_,e),this.save()),n}get_property(t){return this.props[t]}set_property(t,e){this.Ca(t,e),this.save()}Ca(t,e,n=!0){var r;const s=this.props[t];this.props[t]=e,n&&(t!=="distinct_id"&&t!=="$user_state"||s===e||(this.sa=!0),CS(t)&&!ua(s,e)&&this.oa.add(t),this.Ea(t,s,e),!((r=tr(t))===null||r===void 0)&&r.volatile||this.Ia(t))}$a(t,e=!0){delete this.props[t],e&&(Y1(t)&&this.ma(t,!0),CS(t)&&this.oa.add(t),this.Ia(t))}Ia(t){var e;const n=(e=tr(t))===null||e===void 0?void 0:e.storageGroup;n&&(this.ya(n).dirty=!0)}ya(t){return this.Jo[t]||(this.Jo[t]={})}};const ms={GZipJS:"gzip-js",Base64:"base64"},af={Activation:"events",Cancellation:"cancelEvents"},Q1={Popover:"popover",API:"api",Widget:"widget"},Co={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},J1={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},t2={Popover:"popover",Inline:"inline"};function u0(t){let e=!0;return{dispose(){if(e){e=!1;const n=t();n&&Gn(n.then)&&n.then(void 0,()=>{})}}}}const Mj={SHOWN:"product tour shown"},RS={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},AS=un("[RateLimiter]");var Oj=class{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{const n=e.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach(r=>{AS.info(`${r||"events"} is quota limited.`),this.serverLimits[r]=new Date().getTime()+6e4})}catch(r){return void AS.warn(`could not rate limit - continuing. Error: "${r==null?void 0:r.message}"`,{text:n})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return((t=this.instance.config.rate_limiting)===null||t===void 0?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max(((t=this.instance.config.rate_limiting)===null||t===void 0?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t=!1){var e,n,r;const{captureEventsBurstLimit:s,captureEventsPerSecond:i}=this,o=new Date().getTime(),l=(e=(n=this.instance.persistence)===null||n===void 0?void 0:n.get_property("$capture_rate_limit"))!==null&&e!==void 0?e:{tokens:s,last:o};l.tokens+=(o-l.last)/1e3*i,l.last=o,l.tokens>s&&(l.tokens=s);const u=1>l.tokens;if(u||t||(l.tokens=Math.max(0,l.tokens-1)),u&&!t){const d=(pn(l.dropped)?l.dropped:0)+1;l.dropped=d,!this.lastEventRateLimited&&this.Ka(d)&&(l.dropped=0)}return this.lastEventRateLimited=u,(r=this.instance.persistence)===null||r===void 0||r.set_property("$capture_rate_limit",l),{isRateLimited:u,remainingTokens:l.tokens}}Xa(t){const e=this.instance.config.property_denylist;return!Ue(e)||!e.includes(t)}Ya(){var t;if(this.Xa("$current_url")&&this.Xa("$pathname")&&(sn!=null&&sn.pathname))return`${(t=sn.origin)!==null&&t!==void 0?t:""}${sn.pathname}`}Ka(t){var e,n;const{captureEventsBurstLimit:r,captureEventsPerSecond:s}=this,i=this.Ya(),o=this.Xa("$session_id")?(e=(n=this.instance).get_session_id)===null||e===void 0?void 0:e.call(n):void 0,l=[`${t} event(s) dropped since the last warning`,i?`triggered on ${i}`:void 0,o?`session ${o}`:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:`posthog-js client rate limited: ${l}. Config is set to ${s} events per second and ${r} events burst limit.`},{skip_client_rate_limiting:!0})}isServerRateLimited(t){const e=this.serverLimits[t||"events"]||!1;return e!==!1&&new Date().getTime()<e}};const da=un("[RemoteConfig]");var aR=class{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=$e._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(t=t[this._instance.config.token])===null||t===void 0?void 0:t.config}tl(t){var e,n,r;!((e=$e.__PosthogExtensions__)===null||e===void 0)&&e.loadExternalDependency?(n=$e.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"remote-config",()=>t(this.remoteConfig)):t()}el(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets",`/array/${this._instance.config.token}/config`),callback:t})}load(){try{if(this.remoteConfig)return da.info("Using preloaded remote config",this.remoteConfig),void this.il(this.remoteConfig);if(this._instance.nl())return void da.warn("Remote config is disabled. Falling back to local config.");this.tl(t=>{if(!t)return da.info("No config found after loading remote JS config. Falling back to JSON."),void this.el(e=>{this.il(e.json,e)});this.il(t)})}catch(t){da.error("Error loading remote config",t),this.il()}}il(t,e){!t&&e&&(e.statusCode===0?e.error||da.warn("Failed to fetch remote config from PostHog."):da.error("Failed to fetch remote config from PostHog."));try{this._instance.il(t?{ok:!0,config:t}:{ok:!1})}catch(r){da.error("Error applying remote config",r)}if((t==null?void 0:t.hasFeatureFlags)!==!1&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var n;(n=this._instance.featureFlags)===null||n===void 0||n.ensureFlagsLoaded()}catch(r){da.error("Error loading feature flags",r)}}},Zs=Uint8Array,Gr=Uint16Array,qu=Uint32Array,cx=new Zs([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]),ux=new Zs([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]),TS=new Zs([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),lR=function(t,e){for(var n=new Gr(31),r=0;31>r;++r)n[r]=e+=1<<t[r-1];var s=new qu(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]},cR=lR(cx,2),n2=cR[1];cR[0][28]=258,n2[258]=28;for(var IS=lR(ux,0)[1],uR=new Gr(32768),ln=0;32768>ln;++ln){var Qc=(43690&ln)>>>1|(21845&ln)<<1;uR[ln]=((65280&(Qc=(61680&(Qc=(52428&Qc)>>>2|(13107&Qc)<<2))>>>4|(3855&Qc)<<4))>>>8|(255&Qc)<<8)>>>1}var Lf=function(t,e,n){for(var r=t.length,s=0,i=new Gr(e);r>s;++s)++i[t[s]-1];var o,l=new Gr(e);for(s=0;e>s;++s)l[s]=l[s-1]+i[s-1]<<1;for(o=new Gr(r),s=0;r>s;++s)o[s]=uR[l[t[s]-1]++]>>>15-t[s];return o},ac=new Zs(288);for(ln=0;144>ln;++ln)ac[ln]=8;for(ln=144;256>ln;++ln)ac[ln]=9;for(ln=256;280>ln;++ln)ac[ln]=7;for(ln=280;288>ln;++ln)ac[ln]=8;var Om=new Zs(32);for(ln=0;32>ln;++ln)Om[ln]=5;var Lj=Lf(ac,9),Nj=Lf(Om,5),dR=function(t){return(t/8|0)+(7&t&&1)},fR=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof Gr?Gr:t instanceof qu?qu:Zs)(n-e);return r.set(t.subarray(e,n)),r},co=function(t,e,n){var r=e/8|0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},lf=function(t,e,n){var r=e/8|0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},ey=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 Zs(0),0];if(s==1){var o=new Zs(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(A,I){return A.f-I.f}),n.push({s:-1,f:25001});var l=n[0],u=n[1],d=0,f=1,p=2;for(n[0]={s:-1,f:l.f+u.f,l,r:u};f!=s-1;)l=n[n[p].f>n[d].f?d++:p++],u=n[d!=f&&n[p].f>n[d].f?d++:p++],n[f++]={s:-1,f:l.f+u.f,l,r:u};var g=i[0].s;for(r=1;s>r;++r)i[r].s>g&&(g=i[r].s);var v=new Gr(g+1),w=r2(n[f-1],v,0);if(w>e){r=0;var _=0,x=w-e,b=1<<x;for(i.sort(function(A,I){return v[I.s]-v[A.s]||A.f-I.f});s>r;++r){var E=i[r].s;if(e>=v[E])break;_+=b-(1<<w-v[E]),v[E]=e}for(_>>>=x;_>0;){var C=i[r].s;e>v[C]?_-=1<<e-v[C]++-1:++r}for(;r>=0&&_;--r){var R=i[r].s;v[R]==e&&(--v[R],++_)}w=e}return[new Zs(v),w]},r2=function(t,e,n){return t.s==-1?Math.max(r2(t.l,e,n+1),r2(t.r,e,n+1)):e[t.s]=n},MS=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Gr(++e),r=0,s=t[0],i=1,o=function(u){n[r++]=u},l=1;e>=l;++l)if(t[l]==s&&l!=e)++i;else{if(!s&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(s),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(s);i=1,s=t[l]}return[n.subarray(0,r),e]},cf=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},s2=function(t,e,n){var r=n.length,s=dR(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)},OS=function(t,e,n,r,s,i,o,l,u,d,f){co(e,f++,n),++s[256];for(var p=ey(s,15),g=p[0],v=p[1],w=ey(i,15),_=w[0],x=w[1],b=MS(g),E=b[0],C=b[1],R=MS(_),A=R[0],I=R[1],M=new Gr(19),T=0;E.length>T;++T)M[31&E[T]]++;for(T=0;A.length>T;++T)M[31&A[T]]++;for(var L=ey(M,7),D=L[0],j=L[1],H=19;H>4&&!D[TS[H-1]];--H);var Y,U,z,Z,Q=d+5<<3,B=cf(s,ac)+cf(i,Om)+o,ee=cf(s,g)+cf(i,_)+o+14+3*H+cf(M,D)+(2*M[16]+3*M[17]+7*M[18]);if(B>=Q&&ee>=Q)return s2(e,f,t.subarray(u,u+d));if(co(e,f,1+(B>ee)),f+=2,B>ee){Y=Lf(g,v),U=g,z=Lf(_,x),Z=_;var W=Lf(D,j);for(co(e,f,C-257),co(e,f+5,I-1),co(e,f+10,H-4),f+=14,T=0;H>T;++T)co(e,f+3*T,D[TS[T]]);f+=3*H;for(var N=[E,A],X=0;2>X;++X){var oe=N[X];for(T=0;oe.length>T;++T)co(e,f,W[re=31&oe[T]]),f+=D[re],re>15&&(co(e,f,oe[T]>>>5&127),f+=oe[T]>>>12)}}else Y=Lj,U=ac,z=Nj,Z=Om;for(T=0;l>T;++T)if(r[T]>255){var re;lf(e,f,Y[257+(re=r[T]>>>18&31)]),f+=U[re+257],re>7&&(co(e,f,r[T]>>>23&31),f+=cx[re]);var se=31&r[T];lf(e,f,z[se]),f+=Z[se],se>3&&(lf(e,f,r[T]>>>5&8191),f+=ux[se])}else lf(e,f,Y[r[T]]),f+=U[r[T]];return lf(e,f,Y[256]),f+U[256]},Dj=new qu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),$j=(function(){for(var t=new qu(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),ty=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function jj(t,e){e===void 0&&(e={});var n=(function(){var p=4294967295;return{p(g){for(var v=p,w=0;g.length>w;++w)v=$j[255&v^g[w]]^v>>>8;p=v},d(){return 4294967295^p}}})(),r=t.length;n.p(t);var s,i,o,l,u,d=(l=10+((s=e).filename&&s.filename.length+1||0),u=8,(function(p,g,v,w,_,x){var b=p.length,E=new Zs(w+b+5*(1+Math.floor(b/7e3))+_),C=E.subarray(w,E.length-_),R=0;if(!g||8>b)for(var A=0;b>=A;A+=65535){var I=A+65535;b>I?R=s2(C,R,p.subarray(A,I)):(C[A]=x,R=s2(C,R,p.subarray(A,b)))}else{for(var M=Dj[g-1],T=M>>>13,L=8191&M,D=(1<<v)-1,j=new Gr(32768),H=new Gr(D+1),Y=Math.ceil(v/3),U=2*Y,z=function(Mt){return(p[Mt]^p[Mt+1]<<Y^p[Mt+2]<<U)&D},Z=new qu(25e3),Q=new Gr(288),B=new Gr(32),ee=0,W=0,N=(A=0,0),X=0,oe=0;b>A;++A){var re=z(A),se=32767&A,fe=H[re];if(j[se]=fe,H[re]=se,A>=X){var _e=b-A;if((ee>7e3||N>24576)&&_e>423){R=OS(p,C,0,Z,Q,B,W,N,oe,A-oe,R),N=ee=W=0,oe=A;for(var de=0;286>de;++de)Q[de]=0;for(de=0;30>de;++de)B[de]=0}var ae=2,Oe=0,ke=L,Ge=se-fe&32767;if(_e>2&&re==z(A-Ge))for(var vt=Math.min(T,_e)-1,It=Math.min(32767,A),Yt=Math.min(258,_e);It>=Ge&&--ke&&se!=fe;){if(p[A+ae]==p[A+ae-Ge]){for(var wt=0;Yt>wt&&p[A+wt]==p[A+wt-Ge];++wt);if(wt>ae){if(ae=wt,Oe=Ge,wt>vt)break;var yt=Math.min(Ge,wt-2),We=0;for(de=0;yt>de;++de){var Ke=A-Ge+de+32768&32767,St=Ke-j[Ke]+32768&32767;St>We&&(We=St,fe=Ke)}}}Ge+=(se=fe)-(fe=j[se])+32768&32767}if(Oe){Z[N++]=268435456|n2[ae]<<18|IS[Oe];var Re=31&n2[ae],Ye=31&IS[Oe];W+=cx[Re]+ux[Ye],++Q[257+Re],++B[Ye],X=A+ae,++ee}else Z[N++]=p[A],++Q[p[A]]}}R=OS(p,C,x,Z,Q,B,W,N,oe,A-oe,R)}return fR(E,0,w+dR(R)+_)})(i=t,(o=e).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+o.mem,l,u,!0)),f=d.length;return(function(p,g){var v=g.filename;if(p[0]=31,p[1]=139,p[2]=8,p[8]=2>g.level?4:g.level==9?2:0,p[9]=3,g.mtime!=0&&ty(p,4,Math.floor(new Date(g.mtime||Date.now())/1e3)),v){p[3]=8;for(var w=0;v.length>=w;++w)p[w+10]=v.charCodeAt(w)}})(d,e),ty(d,f-8,n.d()),ty(d,f-4,r),d}const Fj=!!Ww||!!Yf,hR=new WeakMap,pR="text/plain";let ny=0,Z0=!1;const mR=(t,e)=>{const[n,r]=t.split("#"),[s,i]=n.split("?");if(!i)return t;const o=i.split("&").filter(l=>l.split("=")[0]!==e).join("&");return`${s}${o?`?${o}`:""}${r?`#${r}`:""}`},Fh=(t,e,n=!0)=>{var r;const[s,i]=t.split("?"),o=V({},e),l=(r=i==null?void 0:i.split("&").map(d=>{var f;const[p,g]=d.split("="),v=n&&(f=o[p])!==null&&f!==void 0?f:g;return delete o[p],`${p}=${v}`}))!==null&&r!==void 0?r:[],u=(function(d,f="&"){let p,g;const v=[];return At(d,function(w,_){ce(w)||ce(_)||_==="undefined"||(p=encodeURIComponent((x=>x instanceof File)(w)?w.name:w.toString()),g=encodeURIComponent(_),v[v.length]=g+"="+p)}),v.join(f)})(o);return u&&l.push(u),l.length>0?`${s}?${l.join("&")}`:s},ry=t=>{if(t.sl)return t.sl;const{data:e,compression:n}=t;if(!e)return;if(n===ms.GZipJS){const s=jj((function(i){var o=i.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(i);for(var l=new Zs(i.length+(i.length>>>1)),u=0,d=function(v){l[u++]=v},f=0;o>f;++f){if(u+5>l.length){var p=new Zs(u+8+(o-f<<1));p.set(l),l=p}var g=i.charCodeAt(f);128>g?d(g):2048>g?(d(192|g>>>6),d(128|63&g)):g>55295&&57344>g?(d(240|(g=65536+(1047552&g)|1023&i.charCodeAt(++f))>>>18),d(128|g>>>12&63),d(128|g>>>6&63),d(128|63&g)):(d(224|g>>>12),d(128|g>>>6&63),d(128|63&g))}return fR(l,0,u)})(pu(e)),{mtime:0});return{contentType:pR,body:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),estimatedSize:s.byteLength}}if(n===ms.Base64){const s=(function(o){return o&&btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,(l,u)=>String.fromCharCode(parseInt(u,16))))})(pu(e)),i=(o=>"data="+encodeURIComponent(typeof o=="string"?o:pu(o)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}const r=pu(e);return{contentType:"application/json",body:r,estimatedSize:new Blob([r]).size}},gR=t=>{const e=()=>t.transport==="sendBeacon"?{url:Fh(t.url,{compression:ms.Base64}),encodedBody:ry(V(V({},t),{},{compression:ms.Base64,sl:void 0}))}:{url:mR(t.url,"compression"),encodedBody:ry(V(V({},t),{},{compression:void 0,sl:void 0}))};let n;try{n=ry(t)}catch(s){if(J8(t.compression,Zu(t.url,"compression")))return ve.error("Failed to gzip request body, sending uncompressed payload",s),e();throw s}return n&&J8(t.compression,Zu(t.url,"compression"))&&!((r=n.body)instanceof ArrayBuffer?F_(new Uint8Array(r)):ArrayBuffer.isView(r)&&F_(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)))?(Z0=!0,e()):{url:t.url,encodedBody:n};var r},vR=t=>{try{return gR(t)}catch(n){var e;return ve.error(n),void((e=t.callback)===null||e===void 0||e.call(t,{statusCode:0,error:n}))}},Vj=(function(){var t=qt(function*(e){const n=yield(function(s){return V_.apply(this,arguments)})(pu(e.data),Vn.DEBUG,{rethrow:!0});if(!n)return e;const r=yield n.arrayBuffer();return V(V({},e),{},{sl:{contentType:pR,body:r,estimatedSize:r.byteLength}})});return function(e){return t.apply(this,arguments)}})(),Hj=/Failed to fetch|NetworkError|Load failed/i,yR=t=>(t==null?void 0:t.name)==="TypeError"&&Hj.test((t==null?void 0:t.message)||""),_R=t=>{try{const e=(function(n,r=Date.now()){if(typeof n!="string"||!n)return;const s=n.trim(),i=/^\d+\s*,/.test(s)?s.slice(0,s.indexOf(",")).trim():s;if(/^\d+$/.test(i)){const u=1e3*Math.min(Number(i),300);return u>0?u:void 0}if(!/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(i))return;const o=/^\w{3} \w{3} /.test(i)?i+" GMT":i,l=Date.parse(o)-r;return Number.isFinite(l)&&l>0?Math.min(l,z0):void 0})(t());return ce(e)?void 0:Math.min(e,3e4)}catch{return}},wR=t=>{const e=vR(t);if(!e)return;const n=new Ww;hR.set(n,!0);const{url:r,encodedBody:s}=e;n.open(t.method||"GET",r,!0);const{contentType:i,body:o}=s??{};At(t.headers,function(l,u){n.setRequestHeader(u,l)}),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var l;const u={statusCode:n.status,text:n.responseText};if(n.status===200)try{u.json=JSON.parse(n.responseText)}catch{}(l=t.callback)===null||l===void 0||l.call(t,u,_R(()=>n.getResponseHeader("Retry-After")))}},n.send(o)},xR=t=>{const e=vR(t);if(!e)return;const{url:n,encodedBody:r}=e,{contentType:s,body:i,estimatedSize:o}=r??{},l=new Headers;At(t.headers,function(w,_){l.append(_,w)}),s&&l.append("Content-Type",s);let u=null,d=!1;if(j8){const w=new j8;u={signal:w.signal,timeout:setTimeout(()=>{d=!0;try{w.abort(e5("AbortError","PostHog request timed out"+((_=t.timeout)?` after ${_}ms`:"")))}catch(x){p(x)}var _},t.timeout)}}let f=!1;const p=w=>{var _;f||(f=!0,d&&(w==null?void 0:w.name)==="AbortError"||yR(w)?ve.warn(w):ve.error(w),(_=t.callback)===null||_===void 0||_.call(t,{statusCode:0,error:w}))};let g=0;const v=()=>{ny-=g,g=0,u&&clearTimeout(u.timeout)};try{const w=V({method:(t==null?void 0:t.method)||"GET",headers:l,referrerPolicy:"strict-origin",body:i,signal:u==null?void 0:u.signal},t.fetchOptions),_=o??(ce(i)?0:void 0);w.keepalive=w.method==="POST"&&!t.rl&&w.keepalive!==!1&&w.body===i&&!ce(_)&&_>=0&&52428.8>ny+_,w.keepalive&&(g=_,ny+=g),Yf(n,w).then(x=>x.text().then(b=>{var E;if(f)return;const C={statusCode:x.status,text:b};if(x.status===200)try{C.json=JSON.parse(b)}catch(R){ve.error(R)}f=!0,v(),(E=t.callback)===null||E===void 0||E.call(t,C,_R(()=>x.headers.get("Retry-After")))})).catch(x=>{v(),p(x)}).finally(v)}catch(w){v(),p(w)}},i2=t=>{try{var e;const{url:n,encodedBody:r}=gR(t),{contentType:s,body:i,estimatedSize:o}=r??{};if(!i)return;const l=i instanceof Blob?i:new Blob([i],{type:s});if(Kn.sendBeacon(n,l))return;const u=Ue(t.data)?t.data:(e=t.data)===null||e===void 0?void 0:e.batch;if(Ue(u)&&u.length>1&&(o??0)>16384){const d=Math.ceil(u.length/2),f=p=>Ue(t.data)?p:V(V({},t.data),{},{batch:p});return i2(V(V({},t),{},{data:f(u.slice(0,d))})),void i2(V(V({},t),{},{data:f(u.slice(d))}))}ve.warn(`Beacon of ~${o??0} bytes was rejected by the browser, falling back to ${Yf?"fetch":"XHR"}`),Yf?xR(V(V({},t),{},{rl:!0})):wR(t)}catch(n){ve.warn("Beacon send failed",n)}},LS=(t,e,n,r)=>{const s=r==="query"?e==="POST"?"sent_at":"_":void 0;return Fh(n===ms.GZipJS?mR(t,"compression"):t,V(V({},s?{[s]:Date.now().toString()}:{}),n===ms.GZipJS?{}:{compression:n}))},zj=(()=>{const t=[];return Yf&&t.push({transport:"fetch",method:xR}),Ww&&t.push({transport:"XHR",method:wR}),Kn!=null&&Kn.sendBeacon&&t.push({transport:"sendBeacon",method:i2}),t})();let bR=!Fj&&(Ir==null?void 0:Ir.indexOf("MSIE"))===-1&&(Ir==null?void 0:Ir.indexOf("Mozilla"))===-1;function SR(t,e,n){var r,s,i;n&&(e=V(V({},e),{},{callback:o=>n(o)})),t.__loaded?bR?t.__request_queue.push(e):t.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&((s=e.callback)===null||s===void 0||s.call(e,{statusCode:429})):(e.transport=e.transport||t.config.api_transport,e.headers=V(V({},t.config.request_headers),e.headers),e.compression=e.compression==="best-available"?(r=t.compression)!==null&&r!==void 0?r:e.compressionFallback:e.compression,(ce(t.config.disable_beacon)?t.config.__preview_disable_beacon:t.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||t.config.fetch_options,((o,l)=>{var u,d,f;const p=V(V({},o),{},{callback:l??(x=>{var b;return(b=o.callback)===null||b===void 0?void 0:b.call(o,x)})});p.timeout=p.timeout||6e4;const g=(u=p.transport)!==null&&u!==void 0?u:"fetch";g==="sendBeacon"&&ce(p.compression)&&p.data&&(p.compression=ms.Base64),p.method==="POST"&&p.data&&(p.timestampMode==="capture-body"?p.data=(x=>{var b,E;const C=(Ue(x)?x:[x]).map(A=>V(V({},A),A.timestamp instanceof Date&&!isNaN(A.timestamp.getTime())?{timestamp:A.timestamp.toISOString()}:{})),R=C[0];return{api_key:(b=R==null||(E=R.properties)===null||E===void 0?void 0:E.token)!==null&&b!==void 0?b:R==null?void 0:R.token,batch:C,sent_at:new Date().toISOString()}})(p.data):p.timestampMode==="body"&&(p.data=((x,b=new Date().toISOString())=>Ue(x)?x.map(E=>V(V({},E),{},{sent_at:b})):V(V({},x),{},{sent_at:b}))(p.data))),p.url=LS(p.url,p.method,p.compression,p.timestampMode);const v=zj.filter(x=>!p.disableTransport||!x.transport||!p.disableTransport.includes(x.transport)),w=(d=(f=(function(x,b){for(let E=0;x.length>E;E++)if(b(x[E]))return x[E]})(v,x=>x.transport===g))===null||f===void 0?void 0:f.method)!==null&&d!==void 0?d:v[0].method;if(!w)throw new Error("No available transport method");const _=x=>{try{w(x)}catch(E){var b;yR(E)?ve.warn(E):ve.error(E),(b=p.callback)===null||b===void 0||b.call(p,{statusCode:0,error:E})}};g!=="sendBeacon"&&!p.preferSyncCompression&&p.data&&p.compression===ms.GZipJS&&E7&&typeof Promise<"u"&&!Z0?Vj(p).then(x=>{_(x)}).catch(x=>{if(eS(x))return Z0=!0,void _(V(V({},p),{},{compression:void 0,url:LS(o.url,o.method,void 0,o.timestampMode)}));(b=>{if(!b||typeof b!="object")return!1;const E="name"in b?String(b.name):"";return eS(b)||E===a5})(x)&&(Z0=!0),_(p)}):_(p)})(e,(o,l)=>{var u,d,f;t.rateLimiter.checkForLimiting(o),400>o.statusCode||(u=(d=t.config).on_request_error)===null||u===void 0||u.call(d,o),n?n(o,l):(f=e.callback)===null||f===void 0||f.call(e,o)})):e.fireCallbackOnDrop&&((i=e.callback)===null||i===void 0||i.call(e,{statusCode:0}))}var Bj=class{constructor(t,e){this.ol=!0,this.al=[],this.ll=ji((e==null?void 0:e.flush_interval_ms)||3e3,250,5e3,ve.createLogger("flush interval"),3e3),this.ul=t}enqueue(t){this.al.push(t),this.hl||this.cl()}unload(){this.dl();const t=this.al.length>0?this.vl():{},e=Object.values(t);[...e.filter(n=>n.url.indexOf("/e")===0),...e.filter(n=>n.url.indexOf("/e")!==0)].map(n=>{this.fl(n,"sendBeacon")})}enable(){this.ol=!1,this.cl()}cl(){this.ol||(this.hl=setTimeout(()=>{if(this.dl(),this.al.length>0){const t=this.vl();for(const e in t)this.fl(t[e])}},this.ll))}fl(t,e){try{this.ul(t,e)}catch(n){ve.error(n)}}dl(){clearTimeout(this.hl),this.hl=void 0}vl(){const t={};return At(this.al,e=>{var n;const r=e,s=((r?r.batchKey:null)||r.url)+(r.batchGroup?`:${r.batchGroup}`:"");ce(t[s])&&(t[s]=V(V({},r),{},{data:[]})),(n=t[s].data)===null||n===void 0||n.push(r.data)}),this.al=[],t}};const Uj=["retriesPerformedSoFar"];var Zj=class{constructor(t){this._instance=t,this.pl=!1,this.gl=3e3,this.al=[],this.al=[],this.ml=!0,this.resume()}resume(){if(!ce(J)&&"onLine"in J.navigator){if(this.ml=J.navigator.onLine,this.yl)return;this.yl=()=>{this.ml=!0,this.bl()},this._l=()=>{this.ml=!1},Et(J,"online",this.yl),Et(J,"offline",this._l)}}get length(){return this.al.length}retriableRequest(t,e){let{retriesPerformedSoFar:n}=t,r=l5(t,Uj);go(n)&&(r.url=Fh(r.url,{retry_count:n})),SR(this._instance,e?V(V({},r),{},{transport:e}):r,(s,i)=>{var o;if(s.statusCode!==200&&(400>s.statusCode||s.statusCode>=500)){if((s.statusCode===0?3:10)>(n??0))return void this.Ls(V({retriesPerformedSoFar:n},r),i);s.statusCode===0&&ve.warn(`Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after ${n??0} retries.`)}(o=r.callback)===null||o===void 0||o.call(r,s)})}Ls(t,e){const n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;const r=Math.max((function(o){const l=3e3*Math.pow(2,o),u=l/2,d=Math.min(18e5,l),f=(Math.random()-.5)*(d-u);return Math.ceil(d+f)})(n),e??0),s=Date.now()+r;this.al.push({retryAt:s,requestOptions:t});let i=`Enqueued failed request for retry in ${r}`;navigator.onLine||(i+=" (Browser is offline)"),ve.warn(i),this.pl||(this.pl=!0,this.wl())}wl(){if(this.kl&&clearTimeout(this.kl),this.al.length===0)return this.pl=!1,void(this.kl=void 0);this.kl=setTimeout(()=>{this.ml&&this.al.length>0&&this.bl(),this.wl()},this.gl)}bl(){const t=Date.now(),e=[],n=this.al.filter(r=>t>r.retryAt||(e.push(r),!1));if(this.al=e,n.length>0)for(const{requestOptions:r}of n)this.retriableRequest(r)}unload(){this.kl&&(clearTimeout(this.kl),this.kl=void 0),this.pl=!1,ce(J)||(this.yl&&(J.removeEventListener("online",this.yl),this.yl=void 0),this._l&&(J.removeEventListener("offline",this._l),this._l=void 0));for(const{requestOptions:t}of this.al)try{this._instance._send_request(V(V({},t),{},{transport:"sendBeacon"}))}catch(e){ve.error(e)}this.al=[]}},Wj=class{constructor(t){this._instance=t,this.Sl=()=>{var e,n,r,s;this.xl||(this.xl={});const i=this.scrollElement(),o=this.scrollY(),l=i?Math.max(0,i.scrollHeight-i.clientHeight):0,u=o+((i==null?void 0:i.clientHeight)||0),d=(i==null?void 0:i.scrollHeight)||0;this.xl.lastScrollY=Math.ceil(o),this.xl.maxScrollY=Math.max(o,(e=this.xl.maxScrollY)!==null&&e!==void 0?e:0),this.xl.maxScrollHeight=Math.max(l,(n=this.xl.maxScrollHeight)!==null&&n!==void 0?n:0),this.xl.lastContentY=u,this.xl.maxContentY=Math.max(u,(r=this.xl.maxContentY)!==null&&r!==void 0?r:0),this.xl.maxContentHeight=Math.max(d,(s=this.xl.maxContentHeight)!==null&&s!==void 0?s:0)}}get Cl(){return this._instance.config.scroll_root_selector}getContext(){return this.xl}resetContext(){const t=this.xl;return this.xl=void 0,setTimeout(this.Sl,0),t}startMeasuringScrollPosition(){Et(J,"scroll",this.Sl,{capture:!0}),Et(J,"scrollend",this.Sl,{capture:!0}),Et(J,"resize",this.Sl)}scrollElement(){if(this.Cl){const n=Ue(this.Cl)?this.Cl:[this.Cl];for(const r of n){var t;const s=J==null||(t=J.document)===null||t===void 0?void 0:t.querySelector(r);if(s)return s}return}var e;return J==null||(e=J.document)===null||e===void 0?void 0:e.documentElement}$l(t){var e,n;const r=t==="y"?"scrollTop":"scrollLeft";if(this.Cl){const s=this.scrollElement();return s&&s[r]||0}return J?t==="y"?J.scrollY||J.pageYOffset||((e=J.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.scrollTop)||0:J.scrollX||J.pageXOffset||((n=J.document)===null||n===void 0||(n=n.documentElement)===null||n===void 0?void 0:n.scrollLeft)||0:0}scrollY(){return this.$l("y")}scrollX(){return this.$l("x")}};const qj=t=>rR(t==null?void 0:t.config.mask_personal_data_properties,t==null?void 0:t.config.custom_personal_data_properties,t==null?void 0:t.config.disable_capture_url_hashes);var NS=class{constructor(t,e,n,r){this.Be=s=>{const i=this.Tl();if(i&&i.sessionId===s)return;const o={sessionId:s,props:this.Il(this._instance)};this.Ml.register({[K_]:o})},this._instance=t,this.El=e,this.Ml=n,this.Il=r||qj,this.El.onSessionId(this.Be)}Tl(){return this.Ml.props[K_]}getSetOnceProps(){var t;const e=(t=this.Tl())===null||t===void 0?void 0:t.props;return e?"r"in e?sR(e,this._instance.config.disable_capture_url_hashes):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){const t={};return At(sx(this.getSetOnceProps()),(e,n)=>{n==="$current_url"&&(n="url"),t[`$session_entry_${O_(n)}`]=e}),t}},Lm=class{on(t,e){return this.Pl[t]||(this.Pl[t]=[]),this.Pl[t].push(e),()=>{this.Pl[t]=this.Pl[t].filter(n=>n!==e)}}emit(t,e){for(const n of this.Pl[t]||[])n(e);for(const n of this.Pl["*"]||[])n(t,e)}constructor(){this.Pl={}}};const Jc=un("[SessionId]"),DS=864e5;var $S=class{on(t,e){return this.Rl.on(t,e)}constructor(t,e,n){var r;if(this.Al=null,this.Fl=null,this.Ol=[],this.Dl=void 0,this.Ll=!1,this.Rl=new Lm,this.Nl=(i,o)=>!(!go(i)||!go(o))&&Math.abs(i-o)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Rr=t.config,this.Ml=t.persistence,this.He=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.ql=void 0,this._sessionActivityTimestamp=null,this.jl=e||pi,this.Bl=n||pi;const s=this.Rr.persistence_name||this.Rr.token;if(this._sessionTimeoutMs=1e3*ji(this.Rr.session_idle_timeout_seconds||1800,60,36e3,Jc.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Hl(),this.zl="ph_"+s+"_window_id",this.Ul="ph_"+s+"_primary_window_exists",this.Wl()){const i=Ht.Dt(this.zl),o=Ht.Dt(this.Ul);i&&!o?this.He=i:Ht.Lt(this.zl),Ht.At(this.Ul,!0)}!((r=this.Rr.bootstrap)===null||r===void 0)&&r.sessionID&&this.setBootstrapSessionId(this.Rr.bootstrap.sessionID),this.Vl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return ce(this.Ol)&&(this.Ol=[]),this.Ol.push(t),this.Xt&&t(this.Xt,this.He),()=>{this.Ol=this.Ol.filter(e=>e!==t)}}Wl(){return this.Rr.persistence!=="memory"&&!this.Ml.mi&&Ht.Et()}Gl(t){t!==this.He&&(this.He=t,this.Wl()&&Ht.At(this.zl,t))}Zl(){return this.He?this.He:this.Wl()?Ht.Dt(this.zl):null}Ql(t){const e=this.Al;return!on(e)&&!on(t)&&5e3>Math.abs(t-e)}Jl(t,e,n){const r=e!==this._sessionActivityTimestamp,s=!(t!==this.Xt||n!==this._sessionStartTimestamp);this._sessionStartTimestamp=n,this._sessionActivityTimestamp=e,this.Xt=t,s&&!r||s&&this.Ql(e)||(this.Al=e,this.Ml.register({[du]:[e,t,n]}))}Kl(){var t;const e=(t=this.Rr)===null||t===void 0?void 0:t.persistence_save_debounce_ms;return go(e)&&e>0}Xl(){this.Kl()?this.Ml.refreshKey(du):(this.Ml.flush(),this.Ml.load())}Yl(){var t;if(on(this._sessionActivityTimestamp)||this._sessionActivityTimestamp===this.Al)return;this.Xl();const[,e,n]=this.tu();e===this.Xt&&n===this._sessionStartTimestamp&&(this.Al=this._sessionActivityTimestamp,this.Ml.register({[du]:[this._sessionActivityTimestamp,(t=this.Xt)!==null&&t!==void 0?t:null,this._sessionStartTimestamp]}),this.Ml.flush())}eu(){const[t]=this.tu(),e=go(t)?t:0,n=go(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,n)}iu(t){return this.Xl(),this.Nl(t,this.eu())}tu(){const t=this.Ml.props[du];return Ue(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Al=null,this.ql=void 0,clearTimeout(this.nu),this.nu=void 0,this.Jl(null,null,null)}setBootstrapSessionId(t,e=!1){const n=((r,s=new Date().getTime())=>{try{const i=(o=>{const l=o.replace(/-/g,"");if(l.length!==32)throw new Error("Not a valid UUID");if(l[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(l.substring(0,12),16)})(r);return i>s+6e4?void Jc.error("Bootstrap sessionID cannot be in the future"):i}catch(i){return void Jc.error("Invalid sessionID in bootstrap",i)}})(t);return!ce(n)&&(e?this.ql={sessionId:t,sessionStartTimestamp:n}:this.Jl(t,new Date().getTime(),n),!0)}destroy(){this.Ll=!0,this.Yl(),clearTimeout(this.nu),this.nu=void 0,this.Dl&&J&&(J.removeEventListener(Am,this.Dl,{capture:!1}),this.Dl=void 0),this.Ol=[]}Vl(){this.Dl=()=>{this.Yl(),this.Wl()&&Ht.Lt(this.Ul)},Et(J,Am,this.Dl,{capture:!1})}checkAndGetSessionAndWindowId(t=!1,e=null,n=!1){if(this.Rr.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');const r=e||new Date().getTime(),s=this.Xt;if(n)this.Fl=r;else if(on(this.Fl)||this.Fl>r||r-this.Fl>=1e3){var i,o;(i=(o=this.Ml).syncCookieProperties)===null||i===void 0||i.call(o),this.Fl=r}let[,l,u]=this.tu();const d=!ce(s)&&l!==s,f=this.eu();let p=this.Zl();const g=this.ql,v=!!g&&(g.sessionStartTimestamp>r+6e4||r-g.sessionStartTimestamp>DS),w=g?v:go(u)&&Math.abs(r-u)>DS;let _=!1,x=d,b=!l||!!g;const E=l;let C=!b&&!t&&this.Nl(r,f);if(C&&(C=this.iu(r),C||Jc.info("cross-tab refresh kept the session alive",{sessionId:l}),[,l,u]=this.tu(),C||(b=!l||!!g)),b||C||w){x=!1;const M=g&&!v;l=M?g.sessionId:this.jl(),p=this.Bl(),Jc.info("new session ID assigned",{sessionId:l,windowId:p,bootstrapped:!!M,changeReason:{noSessionId:b,activityTimeout:C,sessionPastMaximumLength:w}}),u=M?g.sessionStartTimestamp:r,this.ql=void 0,_=!0}else p||(p=this.Bl(),_=!0),x=x||l!==E,x&&(Jc.info("adopted cross-tab session id",{sessionId:l,windowId:p}),_=!0);const R=go(f)&&t&&!w?f:r,A=go(u)?u:new Date().getTime();this.Gl(p),this.Jl(l,R,A),t||this.Hl();const I={noSessionId:b,activityTimeout:C,sessionPastMaximumLength:w,crossTabAdoption:x};return _&&this.Ol.forEach(M=>M(l,p,I)),{sessionId:l,windowId:p,sessionStartTimestamp:A,changeReason:_?I:void 0,lastActivityTimestamp:f}}Hl(){this.Ll||(clearTimeout(this.nu),this.nu=setTimeout(()=>{if(!this.Ll)if(this.iu(new Date().getTime())){const t=this.Xt;this.resetSessionId(),this.Rl.emit("forcedIdleReset",{idleSessionId:t})}else this.Hl()},1.1*this.sessionTimeoutMs))}};const kR=function(t,e){if(!t)return!1;const n=t.userAgent;if(n&&V8(n,e))return!0;try{const r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some(s=>V8(s==null?void 0:s.brand,e)))return!0}catch{}return!!t.webdriver};function ER(){return(ER=qt(function*(){const t=Kn==null?void 0:Kn.userAgentData;if(t!=null&&t.getHighEntropyValues)try{const e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return it(n)&&n.length>0?n:void 0}catch(e){return void ve.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}function Gj(t,e){let n=`$survey_${e}/${t.id}`;return t.current_iteration&&t.current_iteration>0&&(n=`$survey_${e}/${t.id}/${t.current_iteration}`),n}function CR(t){var e;return!!(!((e=t.conditions)===null||e===void 0||(e=e.events)===null||e===void 0||(e=e.values)===null||e===void 0)&&e.length)}const Nm=(t,e)=>{if(!(n=>{try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}},d0=t=>t.toLowerCase(),PR={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=>Nm(n,r))),not_regex:(t,e)=>e.every(n=>t.every(r=>!Nm(n,r))),icontains:(t,e)=>e.map(d0).some(n=>t.map(d0).some(r=>n.includes(r))),not_icontains:(t,e)=>e.map(d0).every(n=>t.map(d0).every(r=>!n.includes(r))),gt:(t,e)=>e.some(n=>{const r=parseFloat(n);return!isNaN(r)&&t.some(s=>r>parseFloat(s))}),lt:(t,e)=>e.some(n=>{const r=parseFloat(n);return!isNaN(r)&&t.some(s=>r<parseFloat(s))})};function RR(t,e){return!t||Object.entries(t).every(([n,r])=>{const s=e==null?void 0:e[n];if(s==null)return!1;const i=PR[r.operator];return!!i&&i(r.values.map(String),[String(s)])})}function sy(t,e,n){return pu({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}const o2="custom",jS="i.posthog.com",Kj=/^\/static\//,Yj=["/s/","/e/","/i/"];var Xj=class{constructor(t){this.su={},this.instance=t}get apiHost(){const t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get flagsApiHost(){const t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t;let e=(t=this.instance.config.ui_host)===null||t===void 0?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace(`.${jS}`,".posthog.com")),e==="https://app.posthog.com"?"https://us.posthog.com":e}get region(){return this.su[this.apiHost]||(this.su[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":o2),this.su[this.apiHost]}ru(t){if(!Kj.test(t))return;const e=this.instance.config.asset_host;return typeof e=="string"&&e.trim().replace(/\/$/,"")||void 0}ou(t){const e=Oo(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}au(t,e,n){if(t==="ui")return n;let r=n;const s=this.instance.config.rewriteRequestPath;if(s){var i;const o=((i=Oo(n))===null||i===void 0?void 0:i.href)||n;r=s(new URL(o)).toString()}if(s&&t==="api"&&Yj.some(o=>e.indexOf(o)===0)){const o=this.ou(r);if(o){const l=this.apiHost;let u=this.lu;(u==null?void 0:u.apiHost)===l&&u.rewriteRequestPath===s||(u={apiHost:l,rewriteRequestPath:s,urls:new Set},this.lu=u),u.urls.add(o)}}return r}isIngestionEndpoint(t){const e=this.lu,n=this.ou(t);return(e==null?void 0:e.apiHost)===this.apiHost&&e.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!n&&e.urls.has(n)}endpointFor(t,e=""){if(e&&(e=e[0]==="/"?e:`/${e}`),t==="ui")return this.au(t,e,this.uiHost+e);if(t==="flags")return this.au(t,e,this.flagsApiHost+e);if(t==="assets"){const r=this.ru(e);if(r)return this.au(t,e,`${r}${e}`)}if(this.region===o2)return this.au(t,e,this.apiHost+e);const n=jS+e;switch(t){case"assets":return this.au(t,e,`https://${this.region}-assets.${n}`);case"api":return this.au(t,e,`https://${this.region}.${n}`)}}};const Pt=un("[Surveys]"),AR=t=>{try{const e=(n=>((r,s)=>`seenSurvey_${(function(i){return i.current_iteration&&i.current_iteration>0?`${i.id}_${i.current_iteration}`:i.id})(s)}`)(0,n))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(e){Pt.error("Failed to persist survey seen state",e)}},Qj=[Q1.Popover,Q1.Widget,Q1.API],Jj={ignoreConditions:!1,ignoreDelay:!1,displayType:t2.Popover},eF=un("[PostHog ExternalIntegrations]"),tF={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};var nF=class{constructor(t){this._instance=t}zo(t,e){var n,r;(n=$e.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,t,s=>{if(s)return eF.error("failed to load script",s);e()})}startIfEnabledOrStop(){var t;for(const[s,i]of Object.entries((t=this._instance.config.integrations)!==null&&t!==void 0?t:{})){var e,n,r;i&&!(!((e=$e.__PosthogExtensions__)===null||e===void 0||(e=e.integrations)===null||e===void 0)&&e[s])&&this.zo(tF[s],()=>{var o;(o=$e.__PosthogExtensions__)===null||o===void 0||(o=o.integrations)===null||o===void 0||(o=o[s])===null||o===void 0||o.start(this._instance)}),!i&&(!((n=$e.__PosthogExtensions__)===null||n===void 0||(n=n.integrations)===null||n===void 0)&&n[s])&&((r=$e.__PosthogExtensions__)===null||r===void 0||(r=r.integrations)===null||r===void 0||(r=r[s])===null||r===void 0||r.stop())}}},rF=class{constructor(t,e){this.$=t,this.wo=e,this.uu=new Map,this.Io=!1}add(t){var e=this;return qt(function*(){if(e.Io)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(e.uu.has(t.name))throw new Error(`Browser extension "${t.name}" is already registered`);e.uu.set(t.name,t);try{const n=t.setup(e.wo);n&&(yield n)}catch(n){const r=e.uu.get(t.name)===t;r&&e.uu.delete(t.name),e.$.error(`Failed to set up browser extension "${t.name}"`,n),r&&e.hu(t)}})()}getExtension(t){return this.uu.get(t)}dispose(){if(this.Io)return;this.Io=!0;const t=Array.from(this.uu.values()).reverse();this.uu.clear();for(const e of t)this.hu(e)}hu(t){try{var e;const n=(e=t.dispose)===null||e===void 0?void 0:e.call(t);n&&Gn(n.then)&&n.then(void 0,r=>{this.$.error(`Failed to dispose browser extension "${t.name}"`,r)})}catch(n){this.$.error(`Failed to dispose browser extension "${t.name}"`,n)}}},sF=class{constructor(t){this._instance=t}initialize(){}get(t){const e=this._instance.persistence;if(typeof t=="string")return e==null?void 0:e.get_property(t);const n={};for(const r of t){const s=e==null?void 0:e.get_property(r);ce(s)||(n[r]=s)}return n}set(t,e){var n;(n=this._instance.persistence)===null||n===void 0||n.register(typeof t=="string"?{[t]:e}:t)}remove(t){var e;(e=this._instance.persistence)===null||e===void 0||e.unregister(t)}};const FS="extensionsRemoteConfig";var iF=class{constructor(t){this.instance=t,this.Io=!1,this.$=ve,this.cu=t.du,this.kv=new sF(t),this.onEvent=e=>u0(this.instance.on("eventCaptured",n=>{try{e({event:n.event,properties:n.properties})}catch(r){this.$.error("Browser extension event listener failed",r)}})),this.onRemoteConfig=e=>{if(this.Io)return u0(()=>{});const n=s=>{try{e(s)}catch(i){this.$.error("Browser extension remote config listener failed",i)}},r=this.instance.vu.on(FS,n);return this.cu&&n(this.cu),u0(r)},this.fu=new rF(ve.createLogger("[BrowserExtensions]"),this)}get logger(){return this.$}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return(t=this.instance.get_property("$device_id"))!==null&&t!==void 0?t:this.distinctId}get deviceId(){const t=this.instance.get_property(Qw);return typeof t=="string"?t:void 0}get library(){return{name:Vn.LIB_NAME,version:Vn.LIB_VERSION}}get initialPersonProperties(){var t,e;return(t=(e=this.instance.persistence)===null||e===void 0?void 0:e.get_initial_props())!==null&&t!==void 0?t:{}}get groups(){return this.instance.getGroups()}get session(){try{var t,e,n,r;const s=(t=this.instance.sessionManager)===null||t===void 0?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:(e=s==null?void 0:s.sessionId)!==null&&e!==void 0?e:"",windowId:(n=s==null?void 0:s.windowId)!==null&&n!==void 0?n:"",sessionStartTimestamp:(r=s==null?void 0:s.sessionStartTimestamp)!==null&&r!==void 0?r:0}}catch{return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(t){return this.fu.add(t)}getExtension(t){return this.fu.getExtension(t)}capture(t,e,n){n?this.instance.capture(t,e,{timestamp:n.timestamp,uuid:n.uuid,$set:n.set,$set_once:n.setOnce}):this.instance.capture(t,e)}registerDynamicEventProperties(t){return u0(this.instance.pu(t))}handleRemoteConfig(t){this.Io||(this.cu=t,this.instance.vu.emit(FS,t))}sendRequest(t){var e=this;return qt(function*(n,r={}){var s;const i=e.instance.requestRouter.endpointFor((s=r.target)!==null&&s!==void 0?s:"api",n),o={method:r.method,url:r.query?Fh(i,r.query):i,data:r.body,headers:r.headers,timeout:r.timeoutMs,fireCallbackOnDrop:!0,transport:r.transport,compression:r.compression,compressionFallback:r.target==="flags"&&r.compression==="best-available"?M_.Base64:void 0,timestampMode:r.sentAt};return r.transport==="sendBeacon"?(e.instance._send_request(o),{statusCode:202}):new Promise(l=>{o.callback=l,e.instance._send_request(o)})}).apply(this,arguments)}dispose(){this.Io||(this.Io=!0,this.fu.dispose())}};const Nf={};let iy=0;const Df=()=>{},VS='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',uf="Surveys module not available",HS="sanitize_properties is deprecated. Use before_send instead",TR="Invalid value for property_denylist config: ",oF=/^[A-Za-z0-9_-]{1,400}$/,zS=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,BS=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,aF=["token","distinct_id",T5],_f="posthog",lF=t=>{const e={};return t&&t!=="unset"&&("2025-11-30">t||(e.strictMinimumDuration=!0),"2026-05-30">t||(e.canvasCapture={resolutionScale:.6}),"2026-06-25">t||(e.streamNetworkBody=!0),"2026-08-30">t||(e.captureJsonLd=!0)),e},oy=t=>{var e;return V({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:aj(ue==null?void 0:ue.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Df,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:sn&&it(sn==null?void 0:sn.search)&&sn.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:(J==null||(e=J.location)===null||e===void 0?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,feature_flag_request_max_retries:1,surveys_request_timeout_ms:1e4,on_request_error(n){ve.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:N5,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:Df},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:mj,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:lF(n),external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:n&&n>="2026-05-30"?250:0,split_storage:!(!n||"2026-05-30">n),detect_google_search_app:!(!n||"2026-05-30">n),disable_capture_url_hashes:!(!n||"2026-06-25">n),cookieWinsOnConflict:!(!n||n==="unset"||"2026-08-29">n)}))(t))},cF=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],US=t=>{const e={};for(const[s,i]of cF)ce(t[s])||(e[i]=t[s]);const n=Ut({},e,t),r=t.__preview_external_dependency_versioned_paths;return ce(r)||(ce(t.strict_script_versioning)&&(n.strict_script_versioning=!!r),it(r)&&ce(t.asset_host)&&(n.asset_host=r)),Ue(t.property_blacklist)&&(ce(t.property_denylist)?n.property_denylist=t.property_blacklist:Ue(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:ve.error(TR+t.property_denylist)),n};var uF=class{constructor(){this.__forceAllowLocalhost=!1}get gu(){return this.__forceAllowLocalhost}set gu(t){ve.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}},$f=class pa{mu(e){if(!e)return;const n=this.uu.indexOf(e);n!==-1&&this.uu.splice(n,1)}yu(e,n){var r;return this.mu(e),this.uu.push(n),(r=n.initialize)===null||r===void 0||r.call(n),n}bu(){return this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isRejected()}_u(){if(this.wu||this.config.reuseAnonymousId||this.config.segment||this.bu())return;const e=this.config.persistence==="memory"||this.config.persistence==="sessionStorage";if(!e&&!this.config.disable_persistence||this.ku)return;let n,r,s;e?(n=`persistence is set to '${this.config.persistence}'`,r=this.config.persistence==="memory"?"on every page load":"for every new browser tab or window",s="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(n="persistence is disabled (disable_persistence is true)",r="on every page load",s="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.wu=!0,console.warn("[PostHog.js]",`${n} but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID ${r}, so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. ${s}`)}Su(){if(this.bu()||this.get_distinct_id()!=="$posthog_cookieless")return;const e=this.persistence;if(!e)return;this.xu()||e.load(!0);const n=this.get_distinct_id();if(!n||n==="$posthog_cookieless"){const r=this.config.get_device_id(pi());this.register({distinct_id:r,$device_id:r}),e.set_property(Mr,Eo)}this.Cu()}get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.$u=!1,this.Tu=!1,this.webPerformance=new uF,this.Iu=!1,this.version=Vn.LIB_VERSION,this.Mu=new Set,this.Eu="",this.vu=new Lm,this.uu=[],this.Pu=[],this.ku=!1,this.wu=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=oy(),this.SentryIntegration=Sj,this.sentryIntegration=r=>(function(s,i){const o=K5(s,i);return{name:G5,processEvent:l=>o(l)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Ru=!1,this.Au=null,this.Fu=null,this.Ou=null,this.scrollManager=new Wj(this),this.pageViewManager=new ES(this),this.rateLimiter=new Oj(this),this.requestRouter=new Xj(this),this.consent=new pj(this),this.externalIntegrations=new nF(this);const n=(e=pa.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.metrics=n.metrics&&new n.metrics(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(r,s,i)=>{const o=it(r)?{[r]:s}:r;this.setPersonProperties(o),i==null||i({})},set_once:(r,s,i)=>{const o=it(r)?{[r]:s}:r;this.setPersonProperties(void 0,o),i==null||i({})}},this.on("eventCaptured",r=>ve.info(`send "${r==null?void 0:r.event}"`,r))}init(e,n,r){if(r&&r!==_f){var s;const i=(s=Nf[r])!==null&&s!==void 0?s:new pa;return i._init(e,n,r),Nf[r]=i,Nf[_f][r]=i,i}return this._init(e,n,r)}_init(e,n={},r){var s,i,o;const l=it(e)?e.trim():"";if(!l)return ve.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;var u;if(this.__loaded)return l!==((u=this.config)===null||u===void 0?void 0:u.token)?console.warn("[PostHog.js]",`You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('${l}', { ... }, 'project2')`):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=oy(n.defaults),n.debug=this.Du(n.debug),this.Lu=n,this.Nu=[],n.person_profiles?this.Fu=n.person_profiles:n.process_person&&(this.Fu=n.process_person);const d=oy(n.defaults),f=US(n),p=Ut({},d,f,{name:r,token:l});ut(d.rageclick)&&ut(f.rageclick)&&(p.rageclick=Ut({},d.rageclick,f.rageclick)),ut(d.session_recording)&&ut(f.session_recording)&&(p.session_recording=Ut({},d.session_recording,f.session_recording)),this.set_config(p),this.config.on_xhr_error&&ve.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:ms.GZipJS;const g=this.xu();if(this.persistence=new X1(this.config,g),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new X1(V(V({},this.config),{},{persistence:"sessionStorage"}),g,!1),this.Eu="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties",this.config.persistence!=="memory"&&!g&&Ht.Et()){const b=Ht.Dt(this.Eu);Ue(b)&&b.forEach(E=>{it(E)&&this.Mu.add(E)})}else Ht.Lt(this.Eu);const v=V({},this.persistence.props),w=V({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.qu=new Bj((b,E)=>this.ju(b,E),this.config.request_queue_config),this.Bu=new Zj(this),this.__request_queue=[];const _=this.bu();_||(this.sessionManager=new $S(this),this.sessionPropsManager=new NS(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((b,E,C)=>{(C!=null&&C.activityTimeout||C!=null&&C.sessionPastMaximumLength||C!=null&&C.crossTabAdoption)&&this.Hu()})),this.zu(),this.config.__preview_deferred_init_extensions?(ve.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Uu(_)},0)):(ve.info("Initializing extensions synchronously"),this.Uu(_)),Vn.DEBUG=Vn.DEBUG||this.config.debug,Vn.DEBUG&&ve.info("Starting in debug mode",{this:this,config:n,thisC:V({},this.config),p:v,s:w}),this.config.identity_distinct_id&&!(!((s=n.bootstrap)===null||s===void 0)&&s.distinctID)&&(n.bootstrap=V(V({},n.bootstrap),{},{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));const x=(i=n.bootstrap)===null||i===void 0?void 0:i.distinctID;if(this.ku=!!x&&!Cf(x),(o=n.bootstrap)===null||o===void 0?void 0:o.distinctID){const b=n.bootstrap.distinctID,E=this.get_distinct_id(),C=this.persistence.get_property(Mr);if(n.bootstrap.isIdentifiedID&&E!=null&&E!==b&&C==="anonymous")this.identify(b);else if(n.bootstrap.isIdentifiedID&&E!=null&&E!==b&&C==="identified")ve.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{const R=this.config.get_device_id(pi()),A=n.bootstrap.isIdentifiedID?R:b;this.persistence.set_property(Mr,n.bootstrap.isIdentifiedID?B0:Eo),this.register({distinct_id:b,$device_id:A})}}if(_)this.register_once({distinct_id:B1,$device_id:null},"");else if(!this.get_distinct_id()){const b=this.config.get_device_id(pi());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(Mr,Eo)}return Et(J,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),Et(J,"pageshow",()=>{var b;this.$u=!1,this.Tu||(b=this.Bu)===null||b===void 0||b.resume()}),n.segment?kS(this,()=>this.Wu()):this.Wu(),Gn(this.config._onCapture)&&this.config._onCapture!==Df&&(ve.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",b=>this.config._onCapture(b.event,b))),this.config.ip&&ve.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 ER.apply(this,arguments)})().then(b=>{b&&this.register({[z1]:b})}).catch(Df),this}Vu(e){const n=e;return it(n.name)&&Gn(n.setup)}Gu(e,n){this.Vu(e)?n.push(()=>{this.Zu().add(e).catch(()=>{var r;return(r=e.dispose)===null||r===void 0?void 0:r.call(e)}).catch(r=>{ve.error(`Failed to dispose browser extension "${e.name}"`,r)})}):this.uu.push(e)}zu(){var e,n,r;const s=(e=(n=this.config.__extensionClasses)===null||n===void 0?void 0:n.featureFlags)!==null&&e!==void 0?e:(r=pa.__defaultExtensionClasses)===null||r===void 0?void 0:r.featureFlags;var i,o,l;s&&(this.featureFlags&&this.featureFlags instanceof s||((i=this.Qu)===null||i===void 0||i.call(this),this.Qu=void 0,this.featureFlags=new s(this)),Gn(this.featureFlags.onReloading)&&Gn(this.featureFlags.setup)?this.Qu||(this.Qu=this.featureFlags.onReloading(()=>{this.vu.emit("featureFlagsReloading",!0)}),this.Zu().add(this.featureFlags)):(o=(l=this.featureFlags).initialize)===null||o===void 0||o.call(l))}Uu(e){const n=performance.now(),r=V(V({},pa.__defaultExtensionClasses),this.config.__extensionClasses),s=[];var i,o,l,u,d,f,p;r.exceptions&&this.uu.push(this.exceptions=(i=this.exceptions)!==null&&i!==void 0?i:new r.exceptions(this)),r.historyAutocapture&&this.uu.push(this.historyAutocapture=new r.historyAutocapture(this)),r.tracingHeaders&&this.uu.push(this.tracingHeaders=new r.tracingHeaders(this)),r.siteApps&&this.uu.push(this.siteApps=new r.siteApps(this)),r.sessionRecording&&!e&&this.uu.push(this.sessionRecording=new r.sessionRecording(this)),this.config.disable_scroll_properties||s.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),r.autocapture&&this.Gu(this.autocapture=new r.autocapture(this),s),r.surveys&&this.Gu(this.surveys=(o=this.surveys)!==null&&o!==void 0?o:new r.surveys(this),s),r.logs&&this.Gu(this.logs=(l=this.logs)!==null&&l!==void 0?l:new r.logs(this),s),r.metrics&&this.uu.push(this.metrics=(u=this.metrics)!==null&&u!==void 0?u:new r.metrics(this)),r.conversations&&this.uu.push(this.conversations=(d=this.conversations)!==null&&d!==void 0?d:new r.conversations(this)),r.productTours&&this.uu.push(this.productTours=new r.productTours(this)),r.heatmaps&&this.uu.push(this.heatmaps=new r.heatmaps(this)),r.webVitalsAutocapture&&this.uu.push(this.webVitalsAutocapture=new r.webVitalsAutocapture(this)),r.exceptionObserver&&this.uu.push(this.exceptionObserver=new r.exceptionObserver(this)),r.deadClicksAutocapture&&this.uu.push(this.deadClicksAutocapture=new r.deadClicksAutocapture(this,bj)),r.toolbar&&this.uu.push(this.toolbar=(f=this.toolbar)!==null&&f!==void 0?f:new r.toolbar(this)),r.experiments&&this.uu.push(this.experiments=(p=this.experiments)!==null&&p!==void 0?p:new r.experiments(this)),this.uu.forEach(g=>{g.initialize&&s.push(()=>{var v;(v=g.initialize)===null||v===void 0||v.call(g)})}),s.push(()=>{if(this.Ju){const g=this.Ju;this.Ju=void 0,this.uu.forEach(v=>{var w;return(w=v.onRemoteConfig)===null||w===void 0?void 0:w.call(v,g)})}}),this.Ku(s,n)}Ku(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout(()=>{this.Ku(e,n)},0);const s=e.shift();if(s)try{s()}catch(i){ve.error("Error initializing extension:",i)}}const r=Math.round(performance.now()-n);this.register_for_session({[I5]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[M5]:r}),this.config.__preview_deferred_init_extensions&&ve.info(`PostHog extensions initialized (${r}ms)`)}il(e){var n;if(!ue||!ue.body)return ve.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.il(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.Ju=e),this.du=e,this.compression=void 0,e.ok){var r;const s=e.config;s.supportedCompression&&!this.config.disable_compression&&(this.compression=Ze(s.supportedCompression,ms.GZipJS)?ms.GZipJS:Ze(s.supportedCompression,ms.Base64)?ms.Base64:void 0),!((r=s.analytics)===null||r===void 0)&&r.endpoint&&(this.analyticsDefaultEndpoint=s.analytics.endpoint)}this.set_config({person_profiles:this.Fu?this.Fu:N5}),(n=this.Xu)===null||n===void 0||n.handleRemoteConfig(e),this.uu.forEach(s=>{var i;return(i=s.onRemoteConfig)===null||i===void 0?void 0:i.call(s,e)})}Wu(){try{this.config.loaded(this)}catch(e){ve.critical("`loaded` function failed",e)}if(this.Yu(),this.config.internal_or_test_user_hostname&&(sn==null?void 0:sn.hostname)){const e=sn.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?e===n:n.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.bu())&&this.th()},1),this.eh=new aR(this),this.eh.load()}Yu(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.qu)===null||e===void 0||e.enable())}_dom_loaded(){this.is_capturing()&&hu(this.__request_queue,e=>this.ju(e)),this.__request_queue=[],this.Yu()}_handle_unload(){var e,n,r,s,i,o;this.$u=!0,(e=this.surveys)===null||e===void 0||(n=e.handlePageUnload)===null||n===void 0||n.call(e),(r=this.metrics)===null||r===void 0||r.flush("sendBeacon"),this.config.request_batching?(this.ih()&&this.capture(lS),(s=this.logs)===null||s===void 0||s.flushLogs("sendBeacon"),(i=this.qu)===null||i===void 0||i.unload(),(o=this.Bu)===null||o===void 0||o.unload()):this.ih()&&this.capture(lS,null,{transport:"sendBeacon"})}_send_request(e){SR(this,e)}ju(e,n){this.Bu?this.Bu.retriableRequest(e,n):this._send_request(n?V(V({},e),{},{transport:n}):e)}_execute_array(e){iy++;try{let n;const r=[],s=[],i=[];hu(e,l=>{if(l)if(n=l[0],Ue(n))i.push(l);else if(Gn(l))try{l.call(this)}catch(u){ve.error("Error executing queued PostHog call",l,u)}else Ue(l)&&n==="alias"?r.push(l):Ue(l)&&n.indexOf("capture")!==-1&&Gn(this[n])?i.push(l):s.push(l)});const o=function(l,u){hu(l,function(d){try{if(Ue(d[0])){let f=u;At(d,function(p){f=f[p[0]].apply(f,p.slice(1))})}else u[d[0]].apply(u,d.slice(1))}catch(f){ve.error("Error executing queued PostHog call",d,f)}})};o(r,this),o(s,this),o(i,this)}finally{iy--}}push(e){if(iy>0&&Ue(e)&&it(e[0])){const n=pa.prototype[e[0]];return void(Gn(n)&&n.apply(this,e.slice(1)))}this._execute_array([e])}get nh(){return{property:oS,persistenceKey:xu,cookieName:"_fbc",pattern:zS,register:(e,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[xu]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(xu)}}}get sh(){return{property:aS,persistenceKey:Rf,cookieName:"_fbp",pattern:BS,register:(e,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[Rf]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(Rf)}}}rh(e){var n;const r=(n=this.persistence)===null||n===void 0?void 0:n.get_property(e.persistenceKey);return it(r)&&e.pattern.test(r)?{value:r,delivered:!1}:ut(r)&&it(r.value)&&e.pattern.test(r.value)?{value:r.value,delivered:r.delivered===!0}:void 0}oh(e,n,r){return n===(r==null?void 0:r.value)?{value:n,pending:!r.delivered}:(e.register(n,!1),{value:n,pending:!0})}ah(e){if(!this.config.save_campaign_params||this.bu())return;const n=If(e.cookieName);return it(n)&&e.pattern.test(n)?n:void 0}uh(e,n,r,s){if(!this.persistence)return;const i=this.nh;this.persistence.refreshKey(i.persistenceKey);const o=this.rh(i);if(s)return void i.unregister();if(r)return it(n)&&zS.test(n)?this.oh(i,n,o):void i.unregister();const l=it(e)&&oF.test(e)?e:void 0,u=this.ah(i);return u&&((d,f,p)=>{const g=d.split(".");if(f)return g[3]===f;if(!p)return!0;const v=p.value.split(".");return g[3]===v[3]||Number(g[2])>Number(v[2])})(u,l,o)?this.oh(i,u,o):l?(o==null?void 0:o.value.split(".")[3])===l?{value:o.value,pending:!o.delivered}:this.oh(i,`fb.1.${Date.now()}.${l}`,o):o?{value:o.value,pending:!o.delivered}:void 0}hh(e,n,r){if(!this.persistence)return;const s=this.sh;this.persistence.refreshKey(s.persistenceKey);const i=this.rh(s);if(r)return void s.unregister();if(n)return it(e)&&BS.test(e)?this.oh(s,e,i):void s.unregister();const o=this.ah(s);return o?this.oh(s,o,i):i?{value:i.value,pending:!i.delivered}:void 0}dh(e,n){if(!this.persistence)return;this.persistence.refreshKey(e.persistenceKey);const r=this.rh(e);(r==null?void 0:r.value)!==n||r.delivered||e.register(n,!0)}capture(e,n,r){var s,i;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this.qu))return void ve.uninitializedWarning("posthog.capture");if(!this.is_capturing())return;if(ce(e)||!it(e))return void ve.error("No event name provided to posthog.capture");this.Su();const o=!this.config.opt_out_useragent_filter&&this._is_bot();if(o&&!this.config.__preview_capture_bot_pageviews)return;const l=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(l!=null&&l.isRateLimited)return void ve.critical("This capture call is ignored due to client rate limiting.");let u;n!=null&&n.$current_url&&!it(n==null?void 0:n.$current_url)&&(ve.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.fh||ve.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&(u=this.sessionPersistence.update_campaign_params()),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();const d=new Date,f=(r==null?void 0:r.timestamp)||d,p=U8(r==null?void 0:r.uuid,pi);let g={uuid:p,event:e,properties:this.calculateEventProperties(e,n||{},f,p)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&o&&(g.event="$bot_pageview",g.properties.$browser_type="bot"),l&&(g.properties.$lib_rate_limit_remaining_tokens=l.remainingTokens);const v=e==="$feature_flag_called"&&g.properties.$feature_flag_has_experiment===!1&&this.get_property("$minimal_flag_called_events")===!0;r!=null&&r.$set&&!v&&(g.$set=r==null?void 0:r.$set);const w=ut(n==null?void 0:n.$set)?n.$set:void 0,_=Ue(n==null?void 0:n.$unset)?n.$unset:[],x=(r==null?void 0:r.$unset)||[],b=U=>{var z;const Z=!!(r!=null&&r.$set)&&U in r.$set;return{hasProvided:Z||!!w&&U in w,provided:Z?r==null||(z=r.$set)===null||z===void 0?void 0:z[U]:w==null?void 0:w[U],unset:_.indexOf(U)!==-1||x.indexOf(U)!==-1}},E=b(oS),C=b(aS),R=[{channel:this.nh,hasProvided:E.hasProvided,update:this.uh(u==null?void 0:u.fbclid,E.provided,E.hasProvided,E.unset)},{channel:this.sh,hasProvided:C.hasProvided,update:this.hh(C.provided,C.hasProvided,C.unset)}];for(const{channel:U,hasProvided:z,update:Z}of R)Z&&g.properties.$process_person_profile===!0&&Z.pending&&!z&&!v&&(g.$set=V({[U.property]:Z.value},g.$set));const A=r==null?void 0:r.$unset;A&&(g.$unset=A);const I=v?void 0:this.ph(r==null?void 0:r.$set_once,e!==cS,e===D5);if(I&&(g.$set_once=I),r!=null&&r._noTruncate||(M=this.config.properties_string_max_length,g=(function(U,z){const Z=new Set;return(function Q(B,ee){if(B!==Object(B))return z?z(B):B;if(Z.has(B))return;let W;if(Z.add(B),Ue(B))W=[],hu(B,N=>{W.push(Q(N))});else{const N={};At(ld(B)?$5(B):B,(X,oe)=>{Z.has(X)||(N[oe]=Q(X))}),W=N}return W})(U)})(g,U=>it(U)?U.slice(0,M):U)),g.timestamp=f,ce(r==null?void 0:r.timestamp)||(g.properties.$event_time_override_provided=!0,g.properties.$event_time_override_system_time=d),v&&(g.properties=((U,z=[])=>{const Z={},Q=B=>{U[B]!==void 0&&(Z[B]=U[B])};return w$.forEach(Q),z.forEach(Q),Z})(g.properties,aF)),e===Co.DISMISSED||e===Co.SENT){const U=n==null?void 0:n[J1.SURVEY_ID],z=n==null?void 0:n[J1.SURVEY_ITERATION];AR({id:U,current_iteration:z}),g.$set=V(V({},g.$set),{},{[Gj({id:U,current_iteration:z},e===Co.SENT?"responded":"dismissed")]:!0})}else e===Co.SHOWN&&(g.$set=V(V({},g.$set),{},{[J1.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var M;if(e===Mj.SHOWN){const U=n==null?void 0:n[RS.TOUR_TYPE];U&&(g.$set=V(V({},g.$set),{},{[`${RS.TOUR_LAST_SEEN_DATE}/${U}`]:new Date().toISOString()}))}const T=V(V({},g.properties.$set),g.$set);if(Wr(T)||this.setPersonPropertiesForFlags(T),!nt(this.config.before_send)){const U=this.Os(g);if(!U)return;g=U,g.uuid=U8(g.uuid,pi)}const L=R.filter(({channel:U,update:z})=>{var Z,Q,B;const ee=(Z=(Q=g.$set)===null||Q===void 0?void 0:Q[U.property])!==null&&Z!==void 0?Z:ut((B=g.properties)===null||B===void 0?void 0:B.$set)?g.properties.$set[U.property]:void 0;return(z==null?void 0:z.pending)&&ee===z.value});this.vu.emit("eventCaptured",g);const D=(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),j=(r==null?void 0:r._batchKey)==="recordings"||/\/s\/(?:\?|$)/.test(D),H=V(V(V({method:"POST",url:D,data:g,compression:"best-available",preferSyncCompression:r==null?void 0:r.send_instantly,timestampMode:j?"body":"capture-body",batchKey:r==null?void 0:r._batchKey},j&&(!((i=g.properties)===null||i===void 0)&&i.$session_id)?{batchGroup:g.properties.$session_id+(g.properties.$window_id?`-${g.properties.$window_id}`:"")}:{}),r!=null&&r.transport?{transport:r.transport}:{}),L.length?{fireCallbackOnDrop:!0,callback:U=>{if(U.statusCode>=200&&300>U.statusCode)for(const{channel:z,update:Z}of L)this.dh(z,Z.value)}}:{});if(!this.config.request_batching||r&&!(r!=null&&r._batchKey)||r!=null&&r.send_instantly||L.length){var Y;let U;!H.transport&&!H.callback&&Wr((Y=this.config.request_headers)!==null&&Y!==void 0?Y:{})&&this.$u&&(U="sendBeacon"),this.ju(H,U)}else this.qu.enqueue(H);return g}_addCaptureHook(e){return this.on("eventCaptured",n=>e(n.event,n))}getExtension(e){var n;return(n=this.Xu)===null||n===void 0?void 0:n.getExtension(e)}Zu(){var e;return(e=this.Xu)!==null&&e!==void 0?e:this.Xu=new iF(this)}pu(e){this.Pu.push(e);let n=!0;return()=>{if(!n)return;n=!1;const r=this.Pu.indexOf(e);r!==-1&&this.Pu.splice(r,1)}}gh(e=!0){var n,r,s;return!!(!((n=this.persistence)===null||n===void 0)&&n.consumeCookieIdentityChange())&&(this.Ou=null,this.persistence.get_property("$user_state")==="anonymous"&&((s=this.sessionPersistence)===null||s===void 0||s.clear(),this.Mu.clear(),this.mh()),(r=this.featureFlags)===null||r===void 0||r.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;this.persistence.syncCookieProperties(),this.gh();const o=i?void 0:this.persistence.remove_event_timer(e);let l=V({},n);if(l.token=this.config.token,l.$config_defaults=this.config.defaults,this.bu()&&(l[T5]=!0),e==="$snapshot"){const E=V(V({},this.persistence.properties()),this.sessionPersistence.properties());return l.distinct_id=E.distinct_id,(!it(l.distinct_id)&&!pn(l.distinct_id)||Cf(l.distinct_id))&&ve.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}const u=(function(E,C,R,A=!1){var I,M,T,L;if(!Ir)return{};const D=E?[...Wu,...C||[]]:[],[j,H]=YP(Ir),[Y,U]=(function(re){for(let se=0;B8.length>se;se++){const[fe,_e,de]=B8[se],ae=re.match(fe);if(ae){const Oe=de&&re.match(de)||ae;return[_e,(Oe==null?void 0:Oe[1])||""]}}return["",""]})(Ir),z=(function(){const re="u">typeof navigator?navigator:void 0;return re!=null&&re.brave?{brave:!0}:{}})(),Z={};ce(R)||(Z.detectGoogleSearchApp=R);const Q={},B=(I=navigator)===null||I===void 0||(I=I.userAgentData)===null||I===void 0?void 0:I.platform,ee=(M=navigator)===null||M===void 0?void 0:M.maxTouchPoints,W=J==null||(T=J.screen)===null||T===void 0?void 0:T.width,N=J==null||(L=J.screen)===null||L===void 0?void 0:L.height,X=J==null?void 0:J.devicePixelRatio;ce(B)||(Q.userAgentDataPlatform=B),ce(ee)||(Q.maxTouchPoints=ee),ce(W)||(Q.screenWidth=W),ce(N)||(Q.screenHeight=N),ce(X)||(Q.devicePixelRatio=X);const oe=Ut(sx({$os:j,$os_version:H,$browser:KP(Ir,navigator.vendor,z,Z),$webview_app:Y,$webview_app_version:U,$device:XP(Ir),$device_type:z7(Ir,Q),$timezone:iR(),$timezone_offset:Aj()}),{$current_url:nh(A?Fa(sn==null?void 0:sn.href):sn==null?void 0:sn.href,D,rh),$host:sn==null?void 0:sn.host,$pathname:sn==null?void 0:sn.pathname,$raw_user_agent:Ir.length>1e3?Ir.substring(0,997)+"...":Ir,$browser_version:H7(Ir,navigator.vendor,z,Z),$browser_language:tR(),$browser_language_prefix:Rj(),$screen_height:J==null?void 0:J.screen.height,$screen_width:J==null?void 0:J.screen.width,$viewport_height:J==null?void 0:J.innerHeight,$viewport_width:J==null?void 0:J.innerWidth,$lib:Ro.LIB_NAME,$lib_version:Ro.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Ro.SDK_DIST_CHANNEL&&(oe.$sdk_dist_channel=Ro.SDK_DIST_CHANNEL),oe})(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){const{sessionId:E,windowId:C}=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime(),!0);l.$session_id=E,l.$window_id=C}this.sessionPropsManager&&Ut(l,this.sessionPropsManager.getSessionProps());try{var d;this.sessionRecording&&Ut(l,this.sessionRecording.sdkDebugProperties),l.$sdk_debug_retry_queue_size=(d=this.Bu)===null||d===void 0?void 0:d.length}catch(E){l.$sdk_debug_error_capturing_properties=String(E)}let f;if(this.requestRouter.region===o2&&(l.$lib_custom_api_host=this.config.api_host),f=e!=="$pageview"||i?e!=="$pageleave"||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),l=Ut(l,f),e==="$pageview"&&ue&&(l.title=ue.title),!ce(o)){const E=r.getTime()-o;l.$duration=parseFloat((E/1e3).toFixed(3))}Ir&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser");const p=this.persistence.properties(),g=this.sessionPersistence.properties(),v=l.$groups,w=p.$groups;ut(v)&&!Wr(v)&&(l.$groups=V(V({},ut(w)?w:{}),v)),At(["$referrer","$referring_domain"],E=>{E in p&&delete g[E]});const _={};if(this.Pu.length>0)for(const E of this.Pu.slice())try{Ut(_,E())}catch(C){ve.error("Failed to produce browser extension event properties",C)}l=Ut({},u,p,g,V(V({},_),l)),l.$is_identified=this._isIdentified(),Ue(this.config.property_denylist)?At(this.config.property_denylist,function(E){delete l[E]}):ve.error(TR+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);const x=this.config.sanitize_properties;x&&(ve.error(HS),l=x(l,e));const b=this.yh();return l.$process_person_profile=b,b&&!i&&this.bh("_calculate_event_properties"),l}ph(e,n=!0,r=!1){var s;if(!this.persistence||!this.yh()||this.Iu&&!r)return e;const i=this.persistence.get_initial_props(),o=(s=this.sessionPropsManager)===null||s===void 0?void 0:s.getSetOnceProps();let l=Ut({},i,o||{},e||{});const u=this.config.sanitize_properties;return u&&(ve.error(HS),l=u(l,"$set_once")),n&&(this.Iu=!0),Wr(l)?void 0:l}register(e,n){var r;(r=this.persistence)===null||r===void 0||r.register(e,n)}register_once(e,n,r){var s;(s=this.persistence)===null||s===void 0||s.register_once(e,n,r)}register_for_session(e){var n,r;(n=this.persistence)===null||n===void 0||n.syncCookieProperties(),this.gh(),(r=this.sessionPersistence)===null||r===void 0||r.register(e),Object.keys(e).forEach(s=>this.Mu.add(s)),this.mh()}unregister(e){var n;(n=this.persistence)===null||n===void 0||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(e),this.Mu.delete(e),this.mh()}_h(e,n){this.register({[e]:n})}Hu(){this.Mu.forEach(e=>{var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(e)}),this.Mu.clear(),this.mh()}mh(){var e;if(!this.Eu)return;if(this.config.persistence==="memory"||!((e=this.sessionPersistence)===null||e===void 0)&&e.mi||!Ht.Et())return void Ht.Lt(this.Eu);const n=[];this.Mu.forEach(r=>n.push(r)),n.length>0?Ht.At(this.Eu,n):Ht.Lt(this.Eu)}getFeatureFlag(e,n){var r;return(r=this.featureFlags)===null||r===void 0?void 0:r.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n;return(n=this.featureFlags)===null||n===void 0?void 0:n.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){var r;return(r=this.featureFlags)===null||r===void 0?void 0:r.getFeatureFlagResult(e,n)}getAllFeatureFlags(){var e,n;return(e=(n=this.featureFlags)===null||n===void 0?void 0:n.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,n){var r,s;return(r=(s=this.featureFlags)===null||s===void 0?void 0:s.isFeatureEnabled(e,n))!==null&&r!==void 0?r:n==null?void 0:n.defaultValue}reloadFeatureFlags(){var e;(e=this.featureFlags)===null||e===void 0||e.reloadFeatureFlags()}updateFlags(e,n,r){var s;(s=this.featureFlags)===null||s===void 0||s.updateFlags(e,n,r)}updateEarlyAccessFeatureEnrollment(e,n,r){var s;(s=this.featureFlags)===null||s===void 0||s.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n=!1,r){var s;return(s=this.featureFlags)===null||s===void 0?void 0:s.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.vu.on(e,n)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:uf}),()=>{})}onSessionId(e){var n,r;return(n=(r=this.sessionManager)===null||r===void 0?void 0:r.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n=!1){this.surveys?this.surveys.getSurveys(e,n):e([],{isLoaded:!1,error:uf})}getActiveMatchingSurveys(e,n=!1){this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:uf})}renderSurvey(e,n){var r;(r=this.surveys)===null||r===void 0||r.renderSurvey(e,n)}displaySurvey(e,n=Jj){var r;(r=this.surveys)===null||r===void 0||r.displaySurvey(e,n)}cancelPendingSurvey(e){var n;(n=this.surveys)===null||n===void 0||n.cancelPendingSurvey(e)}canRenderSurvey(e){var n,r;return(n=(r=this.surveys)===null||r===void 0?void 0:r.canRenderSurvey(e))!==null&&n!==void 0?n:{visible:!1,disabledReason:uf}}canRenderSurveyAsync(e,n=!1){var r,s;return(r=(s=this.surveys)===null||s===void 0?void 0:s.canRenderSurveyAsync(e,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:uf})}wh(e){return!e||Cf(e)?(ve.critical("Unique user id has not been set in posthog.identify"),!1):e==="$posthog_cookieless"?(ve.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())||(ve.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 ve.uninitializedWarning("posthog.identify");if(pn(e)&&(e=e.toString(),ve.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!this.wh(e)||!this.bh("posthog.identify"))return;this.Su();const s=this.get_distinct_id(),i=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,o=this.gh(!1),l=this.persistence.Da();let u=!1;try{const f=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:f},""),e!==f&&e!==this.get_property("__alias")&&(this.unregister(Pm),this.register({distinct_id:e}));const p=(this.persistence.get_property("$user_state")||"anonymous")===Eo,g=e!==f,v=!g&&p;if(g&&p){var d;const w=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:f};this.persistence.set_property(Mr,B0),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.La(),this.capture("$identify",w,{$set:n||{},$set_once:r||{}})&&(this.Ou=sy(e,n,r)),(d=this.featureFlags)===null||d===void 0||d.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:f)}else if(v){this.persistence.set_property(Mr,B0);const w=n||{},_=r||{};this.setPersonPropertiesForFlags({$set:w,$set_once:_},!1),this.config.cookieWinsOnConflict&&this.persistence.La(),this.capture("$set",{$set:w,$set_once:_})&&(this.Ou=sy(e,n,r))}else(n||r)&&this.setPersonProperties(n,r);g||i||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(Pa)):v&&(n||r)&&this.reloadFeatureFlags(),u=!0}finally{l&&this.persistence.ja(u)}}setPersonProperties(e,n){if(!e&&!n||!this.bh("posthog.setPersonProperties"))return;const r=sy(this.get_distinct_id(),e,n);this.Ou!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}})&&(this.Ou=r)):ve.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}unsetPersonProperties(e){var n;const r=(Ue(e)?e:[e]).filter(s=>it(s)&&s.length>0);r.length!==0&&this.bh("posthog.unsetPersonProperties")&&((n=this.featureFlags)===null||n===void 0||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.Ou=null)}group(e,n,r){var s;if(!e||!n)return void ve.error("posthog.group requires a group type and group key");(s=this.persistence)===null||s===void 0||s.syncCookieProperties(),this.gh();const i=this.getGroups(),o=i[e]!==n;if(o&&this.resetGroupPropertiesForFlags(e),this.register({$groups:V(V({},i),{},{[e]:n})}),(o||r)&&this.yh()){const l={$group_type:e,$group_key:n};r&&(l.$group_set=r),this.capture(cS,l)}r&&this.setGroupPropertiesForFlags({[e]:r}),o&&!r&&this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n=!0){var r;(r=this.featureFlags)===null||r===void 0||r.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(e=!0){var n;(n=this.featureFlags)===null||n===void 0||n.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,n=!0){var r;this.bh("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)===null||r===void 0||r.setGroupPropertiesForFlags(e,n))}resetGroupPropertiesForFlags(e){var n;(n=this.featureFlags)===null||n===void 0||n.resetGroupPropertiesForFlags(e)}reset(e){const n=Or(e)?e:e==null?void 0:e.resetDeviceID,r=Or(e)||e==null?void 0:e.bootstrap;this.kh(n,!1,r)}kh(e,n=!1,r){var s,i,o,l,u,d;if(ve.info("reset"),!this.__loaded)return ve.uninitializedWarning("posthog.reset");const f=r==null?void 0:r.sessionID;this.config.bootstrap=r||((s=this.Lu)===null||s===void 0?void 0:s.bootstrap)||{},(i=this.featureFlags)===null||i===void 0||(o=i.updateConfig)===null||o===void 0||o.call(i,this.config,this.nl());const p=this.get_property(Qw),g=this.get_property(z1),v=this.get_property(Af);(l=this.sessionRecording)===null||l===void 0||l.flushBeforeIdentityReset();const w=this.is_capturing();this.consent.reset(),n||!w||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");const _=(u=this.persistence)===null||u===void 0||(d=u.Da)===null||d===void 0?void 0:d.call(u);let x=!1;try{var b,E,C,R,A,I,M,T,L,D,j,H,Y;if((b=this.persistence)===null||b===void 0||b.clear(),(E=this.sessionPersistence)===null||E===void 0||E.clear(),this.Mu.clear(),this.mh(),ce(v)||(D=this.persistence)===null||D===void 0||D.register({$session_recording_remote_config:v}),(C=this.surveys)===null||C===void 0||C.reset(),(R=this.featureFlags)===null||R===void 0||R.reset(),(A=this.conversations)===null||A===void 0||A.reset(),(I=this.logs)===null||I===void 0||I.reset(),(M=this.metrics)===null||M===void 0||M.reset(),(T=this.persistence)===null||T===void 0||T.set_property("$user_state","anonymous"),(L=this.sessionManager)===null||L===void 0||L.resetSessionId(),this.Ou=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:B1,$device_id:null},"");else{const Z=this.config.get_device_id(pi());this.register_once({distinct_id:Z,$device_id:e?Z:p},""),e||ce(g)||this.register({[z1]:g})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),r&&(r.distinctID&&!this.bu()&&((Y=this.persistence)===null||Y===void 0||Y.set_property("$user_state",r.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:r.distinctID})),(j=this.featureFlags)===null||j===void 0||j.initialize(),!nt(f)&&!(!((H=this.sessionManager)===null||H===void 0)&&H.setBootstrapSessionId(f,!0)))){const Z=V({},r);delete Z.sessionID,this.config.bootstrap=Z}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,x=!0}finally{var U,z;_&&((U=this.persistence)===null||U===void 0||(z=U.ja)===null||z===void 0||z.call(U,x))}this.reloadFeatureFlags()}shutdown(e){var n=this;return qt(function*(){var r,s,i,o,l,u,d,f;if(n.__loaded){n.Tu=!0,n.Zu().dispose(),(r=n.sessionRecording)===null||r===void 0||r.dispose(),(s=n.logs)===null||s===void 0||s.flushLogs("sendBeacon"),(i=n.metrics)===null||i===void 0||i.flush("sendBeacon"),(o=n.metrics)===null||o===void 0||o.dispose(),(l=n.qu)===null||l===void 0||l.unload(),(u=n.Bu)===null||u===void 0||u.unload();try{var p;(p=n.featureFlags)===null||p===void 0||p.destroy()}catch(g){ve.error("Error while destroying feature flags",g)}(d=n.persistence)===null||d===void 0||d.destroy(),(f=n.sessionPersistence)===null||f===void 0||f.destroy()}else ve.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,n){var r;delete this.config.identity_claims,this.config.identity_distinct_id=e,this.config.identity_hash=n,this.alias(e),(r=this.conversations)===null||r===void 0||r.Sh()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,(e=this.conversations)===null||e===void 0||e.xh()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";const{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0);let s=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${n}`);if(e!=null&&e.withTimestamp&&r){var i;const o=(i=e.timestampLookBack)!==null&&i!==void 0?i:10;if(!r)return s;s+=`?t=${Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0)}`}return s}alias(e,n){return e===this.get_property("$people_distinct_id")?(ve.critical("Attempting to create alias for existing People user - aborting."),-2):this.bh("posthog.alias")?(ce(n)&&(n=this.get_distinct_id()),e!==n?(this._h(Pm,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(ve.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){const n=V({},this.config);if(ut(e)){var r,s,i,o,l,u,d,f,p,g,v,w,_,x;Ut(this.config,US(e));const E=this.xu();(r=this.persistence)===null||r===void 0||r.update_config(this.config,n,E),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new X1(V(V({},this.config),{},{persistence:"sessionStorage"}),E,!1);const C=this.Du(this.config.debug);var b;Or(C)&&(this.config.debug=C),Or(this.config.debug)&&(this.config.debug?(Vn.DEBUG=!0,pt.Et()&&pt.At("ph_debug",!0),ve.info("set_config",{config:e,oldConfig:n,newConfig:V({},this.config)})):(Vn.DEBUG=!1,pt.Et()&&pt.Lt("ph_debug"))),(s=this.featureFlags)===null||s===void 0||(i=s.updateConfig)===null||i===void 0||i.call(s,this.config,this.nl()),(o=this.exceptionObserver)===null||o===void 0||o.onConfigChange(),(l=this.exceptions)===null||l===void 0||l.onConfigChange(),(u=this.metrics)===null||u===void 0||u.onConfigChange(),(d=this.sessionRecording)===null||d===void 0||d.startIfEnabledOrStop(),(f=this.tracingHeaders)===null||f===void 0||f.startIfEnabledOrStop(),(p=this.autocapture)===null||p===void 0||p.startIfEnabled(),(g=this.heatmaps)===null||g===void 0||g.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&((b=this.historyAutocapture)===null||b===void 0||b.startIfEnabledOrStop()),(v=this.exceptionObserver)===null||v===void 0||v.startIfEnabledOrStop(),(w=this.deadClicksAutocapture)===null||w===void 0||w.startIfEnabledOrStop(),(_=this.surveys)===null||_===void 0||_.loadIfEnabled(),this.Cu(),(x=this.externalIntegrations)===null||x===void 0||x.startIfEnabledOrStop(),!n.segment&&this.config.segment&&this.persistence&&kS(this,Df,!1)}}_overrideSDKInfo(e,n){Vn.LIB_NAME=e,Vn.LIB_VERSION=n}startSessionRecording(e){const n=e===!0,r={sampling:n||!!(e!=null&&e.sampling),linked_flag:n||!!(e!=null&&e.linked_flag),url_trigger:n||!!(e!=null&&e.url_trigger),event_trigger:n||!!(e!=null&&e.event_trigger)};var s,i,o,l,u;Object.values(r).some(Boolean)&&((s=this.sessionManager)===null||s===void 0||s.checkAndGetSessionAndWindowId(),r.sampling&&((i=this.sessionRecording)===null||i===void 0||i.overrideSampling()),r.linked_flag&&((o=this.sessionRecording)===null||o===void 0||o.overrideLinkedFlag()),r.url_trigger&&((l=this.sessionRecording)===null||l===void 0||l.overrideTrigger("url")),r.event_trigger&&((u=this.sessionRecording)===null||u===void 0||u.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!!(!((e=this.sessionRecording)===null||e===void 0)&&e.started)}captureException(e,n){try{if(!this.exceptions)return;const r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(V(V({},r),n))}catch{return}}addExceptionStep(e,n){var r;(r=this.exceptions)===null||r===void 0||r.addExceptionStep(e,n)}captureLog(e){var n;(n=this.logs)===null||n===void 0||n.captureLog(e)}get logger(){var e,n;return(e=(n=this.logs)===null||n===void 0?void 0:n.logger)!==null&&e!==void 0?e:pa.Ch}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var n,r;return(n=(r=this.toolbar)===null||r===void 0?void 0:r.loadToolbar(e))!==null&&n!==void 0&&n}get_property(e){var n;return(n=this.persistence)===null||n===void 0?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)===null||n===void 0?void 0:n.props[e]}toString(){var e;let n=(e=this.config.name)!==null&&e!==void 0?e:_f;return n!==_f&&(n="posthog."+n),n}_isIdentified(){var e,n;return((e=this.persistence)===null||e===void 0?void 0:e.get_property("$user_state"))==="identified"||((n=this.sessionPersistence)===null||n===void 0?void 0:n.get_property("$user_state"))==="identified"}yh(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Wr(this.getGroups())&&!(!((e=this.persistence)===null||e===void 0||(e=e.props)===null||e===void 0)&&e.__alias)&&!(!((n=this.persistence)===null||n===void 0||(n=n.props)===null||n===void 0)&&n.$epp))}ih(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&!!this.config.capture_pageview}createPersonProfile(){this.yh()||this.bh("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.bh("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}bh(e){return this.config.person_profiles==="never"?(ve.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._u(),this._h(tx,!0),!0)}xu(){if(this.config.cookieless_mode==="always")return!0;const e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!=="on_reject")}Cu(){var e,n;const r=this.xu();var s,i,o;return this.is_capturing()||(s=this.logs)===null||s===void 0||s.$h(),((e=this.persistence)===null||e===void 0?void 0:e.mi)!==r&&((i=this.persistence)===null||i===void 0||i.set_disabled(r)),((n=this.sessionPersistence)===null||n===void 0?void 0:n.mi)!==r&&((o=this.sessionPersistence)===null||o===void 0||o.set_disabled(r)),r&&(this.Mu.clear(),this.mh()),r}opt_in_capturing(e){var n;if(this.config.cookieless_mode!=="always"){if(this.bu()){var r,s,i,o,l,u;(r=this.sessionRecording)===null||r===void 0||r.dispose({discardBufferedEvents:!0}),this.kh(!0,!0),(s=this.sessionManager)===null||s===void 0||s.destroy(),(i=this.pageViewManager)===null||i===void 0||i.destroy(),this.sessionManager=new $S(this),this.pageViewManager=new ES(this),this.persistence&&(this.sessionPropsManager=new NS(this,this.sessionManager,this.persistence));const v=(o=(l=this.config.__extensionClasses)===null||l===void 0?void 0:l.sessionRecording)!==null&&o!==void 0?o:(u=pa.__defaultExtensionClasses)===null||u===void 0?void 0:u.sessionRecording;var d,f;v&&(this.sessionRecording=this.yu(this.sessionRecording,new v(this)),this.du&&((d=this.sessionRecording)===null||d===void 0||(f=d.onRemoteConfig)===null||f===void 0||f.call(d,this.du)))}var p,g;this.consent.optInOut(!0),this.Cu(),this.Yu(),(n=this.sessionRecording)===null||n===void 0||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&((p=this.surveys)===null||p===void 0||p.loadIfEnabled()),(ce(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((g=e==null?void 0:e.captureEventName)!==null&&g!==void 0?g:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.th()}else ve.warn(VS)}opt_out_capturing(){if(this.config.cookieless_mode==="always")return void ve.warn(VS);const e=this.config.cookieless_mode==="on_reject"?this.sessionRecording:void 0;var n,r;e==null||e.dispose({discardBufferedEvents:!0}),this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.kh(!0,!0),this.consent.optInOut(!1),this.Cu(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:B1,$device_id:null}),this.mu(e),this.sessionRecording=void 0,(n=this.sessionManager)===null||n===void 0||n.destroy(),(r=this.pageViewManager)===null||r===void 0||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.th(),this.Yu())}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){const e=this.consent.consent;return e===1?"granted":e===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Cu()}_is_bot(){return Kn?kR(Kn,this.config.custom_blocked_useragents):void 0}th(){ue&&(ue.visibilityState==="visible"?this.Ru||(this.Ru=!0,this.capture(rx,{title:ue.title},{send_instantly:!0}),this.Au&&(ue.removeEventListener(Jf,this.Au),this.Au=null)):this.Au||(this.Au=this.th.bind(this),Et(ue,Jf,this.Au)))}debug(e){e===!1?(J==null||J.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(J==null||J.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}nl(){const e=this.Lu||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(ve.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(function(n,r,s,i,o){const l=r in n&&!nt(n[r]),u=s in n&&!nt(n[s]);return l?n[r]:!!u&&(o&&o.warn(`Config field '${s}' is deprecated. Please use '${r}' instead. The old field will be removed in a future major version.`),n[s])})(e,"advanced_disable_flags","advanced_disable_decide",0,ve)}Os(e){var n;if(nt(this.config.before_send))return e;const r=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(T7),s=Ue(this.config.before_send)?this.config.before_send:[this.config.before_send];let i=e;for(const o of s)try{if(i=o(i),nt(i)){const l=`Event '${e.event}' was rejected in beforeSend function`;return A7(e.event)?ve.warn(`${l}. This can cause unexpected behavior.`):ve.info(l),null}i.properties&&!Wr(i.properties)||ve.warn(`Event '${e.event}' has no properties after beforeSend function, this is likely an error.`)}catch(l){return ve.error(`Error in beforeSend function for event '${e.event}':`,l),null}for(const o of r)if(i.properties&&nt(i.properties[o]))return ve.warn(`Event '${e.event}' had its '${o}' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped.`),null;return i}getPageViewId(){var e;return(e=this.pageViewManager.Vo)===null||e===void 0?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(r)})}Du(e){const n=Or(e)&&!e,r=pt.Et()&&pt.Ot("ph_debug")==="true";return!n&&(!!r||e)}};$f.__defaultExtensionClasses={},$f.Ch=(()=>{const t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),(function(t,e){for(let n=0;e.length>n;n++)t.prototype[e[n]]=ij(t.prototype[e[n]])})($f,["identify"]);var IR=class{constructor(t){this.disabled=t===!1;const e=ut(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,n){if(this.disabled)return!1;const r=this.clicks[this.clicks.length-1];if(r&&Math.abs(t-r.x)+Math.abs(e-r.y)<this.thresholdPx&&this.timeoutMs>n-r.timestamp){if(this.clicks.push({x:t,y:e,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:n}];return!1}};const ay="$copy_autocapture",ly=un("[AutoCapture]");function cy(t,e){return e.length>t?e.slice(0,t)+"...":e}function dF(t){if(t.previousElementSibling)return t.previousElementSibling;let e=t;do e=e.previousSibling;while(e&&!Bi(e));return e}function fF(t,{e,maskAllElementAttributes:n,maskAllText:r,elementAttributeIgnoreList:s,elementsChainAsString:i,disableCaptureUrlHashes:o}){var l,u;if(!Bi(t))return{props:{}};const d=[t],f=new Set([t]);let p=t;for(;p.parentNode&&!fr(p,"body")&&1e3>d.length;){if(ix(p.parentNode)){const I=p.parentNode.host;if(f.has(I))break;f.add(I),d.push(I),p=I;continue}if(!Bi(p.parentNode)||f.has(p.parentNode))break;f.add(p.parentNode),d.push(p.parentNode),p=p.parentNode}const g=e.type==="click"&&t.namespaceURI==="http://www.w3.org/2000/svg"?d.findIndex(I=>fr(I,"button")||fr(I,"a")):-1;g>0&&(r=r||d.slice(0,g+1).some(I=>!bu(I)||th(I)));const v=[],w={};let _,x=!1,b=!1;if(At(d,I=>{const M=bu(I);if(fr(I,"a")&&!n&&!(s!=null&&s.includes("href"))){const T=I.getAttribute("href");x=!!(M&&T&&Of(T))&&(o?Fa(T):T)}Ze(Uu(I),"ph-no-capture")&&(b=!0),v.push((function(T,L,D,j,H=!1){const Y=T.tagName.toLowerCase(),U={tag_name:Y};ax.indexOf(Y)>-1&&!D&&(U.$el_text=Y.toLowerCase()==="a"||Y.toLowerCase()==="button"?cy(1024,xS(T)):cy(1024,eh(T)));const z=Uu(T);L||j!=null&&j.includes("class")||0>=z.length||(U.classes=z.filter(function(ee){return ee!==""})),At(T.attributes,function(ee){var W;if((!th(T)||["name","id","class","aria-label"].indexOf(ee.name)!==-1)&&!(j!=null&&j.includes(ee.name))&&!L&&Of(ee.value)&&(!it(W=ee.name)||W.substring(0,10)!=="_ngcontent"&&W.substring(0,7)!=="_nghost")){let N=ee.value;ee.name==="class"&&(N=ox(N).join(" ")),U["attr__"+ee.name]=cy(1024,ee.name==="href"&&H?Fa(N):N)}});let Z=1,Q=1,B=T;for(;B=dF(B);)Z++,B.tagName===T.tagName&&Q++;return U.nth_child=Z,U.nth_of_type=Q,U})(I,n,r,s,o)),At((function(T){if(!bu(T))return{};const L={};return At(T.attributes,function(D){if(D.name&&D.name.indexOf("data-ph-capture-attribute")===0){const j=D.name.replace("data-ph-capture-attribute-",""),H=D.value;j&&H&&Of(H)&&(L[j]=H)}}),L})(I),(T,L)=>{({}).hasOwnProperty.call(w,L)||(w[L]=T)})}),b)return{props:{},explicitNoCapture:b};if(g>0&&(t=d[g],v.splice(0,g)),r||(v[0].$el_text=fr(t,"a")||fr(t,"button")?xS(t):eh(t)),x){var E,C;v[0].attr__href=x;const I=(E=Oo(x))===null||E===void 0?void 0:E.host,M=J==null||(C=J.location)===null||C===void 0?void 0:C.host;I&&M&&I!==M&&(_=x)}return{props:Ut((A=e.type,{$event_type:A,$ce_version:1}),i?{}:{$elements:v},{$elements_chain:(R=v,Ue(R)?(function(I){return I.map(M=>{var T,L;let D="";if(M.tag_name&&(D+=M.tag_name),M.attr_class){M.attr_class.sort();for(const Y of M.attr_class)D+=`.${Y.replace(/"/g,"")}`}const j=V(V(V(V({},M.text?{text:M.text}:{}),{},{"nth-child":(T=M.nth_child)!==null&&T!==void 0?T:0,"nth-of-type":(L=M.nth_of_type)!==null&&L!==void 0?L:0},M.href?{href:M.href}:{}),M.attr_id?{attr_id:M.attr_id}:{}),M.attributes),H={};return U0(j).sort(([Y],[U])=>(function(z,Z){return Z>z?-1:z>Z?1:0})(Y,U)).forEach(([Y,U])=>H[bS(Y.toString())]=bS(U.toString())),D+=":",D+=U0(H).map(([Y,U])=>`${Y}="${U}"`).join(""),D}).join(";")})((function(I){return I.map(M=>{var T,L;const D={text:(T=M.$el_text)===null||T===void 0?void 0:T.slice(0,400),tag_name:M.tag_name,href:(L=M.attr__href)===null||L===void 0?void 0:L.slice(0,2048),attr_class:wj(M),attr_id:M.attr__id,nth_child:M.nth_child,nth_of_type:M.nth_of_type,attributes:{}};return U0(M).filter(([j])=>j.indexOf("attr__")===0).forEach(([j,H])=>D.attributes[j]=H),D})})(R)):"")},!((l=v[0])===null||l===void 0)&&l.$el_text?{$el_text:(u=v[0])===null||u===void 0?void 0:u.$el_text}:{},_&&e.type==="click"?{$external_click_url:_}:{},w),target:t};var R,A}var hF=class{fo(){this.po=void 0,clearTimeout(this.mo),this.mo=void 0}yo(t){var e;if(!bu(t))return!0;const n=(e=this.bo().css_selector_ignorelist)!==null&&e!==void 0?e:K1,r=new Set;let s=t;for(;s;){if(r.size>=1e3||r.has(s))return!0;r.add(s);const i=s,o=Uu(i);if(Ze(o,"ph-no-capture")||Ze(o,"ph-sensitive")||th(i)||n.some(u=>J_(i,u)))return!0;const l=s.parentNode;s=ix(l)?l.host:l&&Bi(l)?l:null}return!1}_o(t){if(!this.isEnabled||t.type==="pointercancel")return void this.fo();if(t.type==="pointerdown"){this.fo();const r=Mf(t);var e;return void(t.isPrimary&&t.button===0&&!t.ctrlKey&&r&&Bi(r)&&(this.po={target:r,excluded:this.yo(r),id:t.pointerId,x:t.clientX,y:t.clientY,released:!1,distinctId:(e=this.wo)===null||e===void 0?void 0:e.distinctId}))}const n=this.po;n&&(t.pointerId!==n.id||Math.abs(t.clientX-n.x)>5||Math.abs(t.clientY-n.y)>5?this.fo():t.type==="pointerup"&&(n.released=!0,this.mo=setTimeout(()=>this.fo(),0)))}ko(t){var e;const n=this.po;this.fo();const r=Mf(t);if(n!=null&&n.released&&n.target.isConnected&&n.distinctId===((e=this.wo)===null||e===void 0?void 0:e.distinctId)&&t.pointerId===n.id&&(t.detail>0||t.pointerType==="touch"||t.pointerType==="pen")&&t.button===0&&5>=Math.abs(t.clientX-n.x)&&5>=Math.abs(t.clientY-n.y)&&r&&(fr(r,"html")||fr(r,"body"))){var s;if(n.excluded)return null;const i=(s=this.bo().css_selector_ignorelist)!==null&&s!==void 0?s:K1;return[r,ue==null?void 0:ue.documentElement,ue==null?void 0:ue.body].some(o=>{if(!o)return!1;const l=Uu(o);return Ze(l,"ph-no-capture")||Ze(l,"ph-sensitive")||!bu(o)||th(o)||i.some(u=>J_(o,u))})?null:n.target}}constructor(t){this.So=t,this.name="autocapture",this.xo=!1,this.Co=null,this.$o=!1,this.To=!1,this.Rr={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Io=!1,this.So.refresh(this.Rr),this.rageclicks=new IR(this.Rr.rageclick),this.Mo=null}setup(t){this.Eo(),this.wo=t;const e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.Io?e.dispose():(this.Po=e,this.startIfEnabled())}dispose(){var t;this.Io||(this.Io=!0,this.wo=void 0,(t=this.Po)===null||t===void 0||t.dispose(),this.Po=void 0,this.Ro())}bo(){return this.So.refresh(this.Rr),this.Rr}Eo(){var t,e;return this.bo(),this.Rr.url_allowlist=(t=this.Rr.url_allowlist)===null||t===void 0?void 0:t.map(n=>new RegExp(n)),this.Rr.url_ignorelist=(e=this.Rr.url_ignorelist)===null||e===void 0?void 0:e.map(n=>new RegExp(n)),this.Rr}Ao(){if(!this.isBrowserSupported())return void ly.info("Disabling Automatic Event Collection because this browser is not supported");if(!J||!ue)return;const t=this.Fo=e=>{e=e||(J==null?void 0:J.event);try{if(e.type==="blur")return void this.fo();if(e.type.indexOf("pointer")===0)return void this._o(e);const n=e.type==="click"?this.ko(e):void 0;if(on(n))return;this.Oo(e,"$autocapture",n)}catch(n){ly.error("Failed to capture event",n)}};if(Et(J,"blur",t),Et(ue,"submit",t,{capture:!0}),Et(ue,"change",t,{capture:!0}),Et(ue,"click",t,{capture:!0}),At(["pointerdown","pointermove","pointerup","pointercancel"],e=>{Et(ue,e,t,{capture:!0})}),this.bo().capture_copied_text){const e=this.Do=n=>{n=n||(J==null?void 0:J.event);try{this.Oo(n,ay)}catch(r){ly.error("Failed to capture clipboard event",r)}};Et(ue,"copy",e,{capture:!0}),Et(ue,"cut",e,{capture:!0}),Et(ue,"paste",e,{capture:!0})}}Ro(){this.fo(),this.Fo&&(J==null||J.removeEventListener("blur",this.Fo),At(["pointerdown","pointermove","pointerup","pointercancel"],t=>{ue==null||ue.removeEventListener(t,this.Fo,!0)}),ue==null||ue.removeEventListener("submit",this.Fo,!0),ue==null||ue.removeEventListener("change",this.Fo,!0),ue==null||ue.removeEventListener("click",this.Fo,!0),this.Fo=void 0),this.Do&&(ue==null||ue.removeEventListener("copy",this.Do,!0),ue==null||ue.removeEventListener("cut",this.Do,!0),ue==null||ue.removeEventListener("paste",this.Do,!0),this.Do=void 0),this.xo=!1}startIfEnabled(){this.isEnabled||this.fo(),!this.Io&&this.wo&&this.isEnabled&&!this.xo&&(this.Ao(),this.xo=!0)}onRemoteConfig(t){if(this.Io)return;if(this.$o=!0,!t.ok)return void this.startIfEnabled();const e=t.config;e.elementsChainAsString&&(this.To=e.elementsChainAsString);const n=e.autocapture_opt_out;var r;Or(n)&&((r=this.wo)===null||r===void 0||r.kv.set("$autocapture_disabled_server_side",n),this.Co=n),this.startIfEnabled()}setElementSelectors(t){this.Mo=t}getElementSelectors(t,e){var n;const r=[];return(n=this.Mo)===null||n===void 0||n.forEach(s=>{const i=ue==null?void 0:ue.querySelectorAll(s);i==null||i.forEach(o=>{t!==o&&e!==o||Ze(r,s)||r.push(s)})}),r}get isEnabled(){var t,e;if(this.Io)return!1;const n=(t=this.wo)===null||t===void 0?void 0:t.kv.get(_5),r=this.Co,s=this.bo();if(!s.remoteRequestsDisabled&&!this.$o)return!1;const i=s.remoteRequestsDisabled&&!this.$o;if(on(r)&&!Or(n)&&!i)return!1;const o=(e=this.Co)!==null&&e!==void 0?e:!!n;return!!s.enabled&&!o}Oo(t,e="$autocapture",n){if(!this.isEnabled)return void this.fo();let r=n||Mf(t);H5(r)&&(r=r.parentNode||null);const s=this.Eo();var i;e==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&s.rageclick&&(!((i=this.rageclicks)===null||i===void 0)&&i.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime()))&&Z5(r,s.rageclick)&&this.Oo(t,"$rageclick",n);const o=e===ay,l=o?V(V({},s),{},{dom_event_allowlist:void 0}):s;if(r&&(function(p,g,v,w,_,x){var b;if(!J||lx(p)||v!=null&&v.url_allowlist&&!pS(v.url_allowlist,x)||v!=null&&v.url_ignorelist&&pS(v.url_ignorelist,x))return!1;if(v!=null&&v.dom_event_allowlist){const A=v.dom_event_allowlist;if(A&&!A.some(I=>g.type===I))return!1}const{parentIsUsefulElement:E,targetElementList:C}=W5(p,w);if(!(function(A,I){const M=I==null?void 0:I.element_allowlist;if(ce(M))return!0;for(const T of A)if(M.some(L=>T.tagName.toLowerCase()===L))return!0;return!1})(C,v)||!e2(C,v==null?void 0:v.css_selector_allowlist)||e2(C,(b=v==null?void 0:v.css_selector_ignorelist)!==null&&b!==void 0?b:K1))return!1;try{const A=J.getComputedStyle(p);if(A&&A.getPropertyValue("cursor")==="pointer"&&g.type==="click")return!0}catch{}const R=p.tagName.toLowerCase();switch(R){case"html":return!1;case"form":return(_||["submit"]).indexOf(g.type)>=0;case"input":case"select":case"textarea":return(_||["change","click"]).indexOf(g.type)>=0;default:return E?(_||["click"]).indexOf(g.type)>=0:(_||["click"]).indexOf(g.type)>=0&&(ax.indexOf(R)>-1||p.getAttribute("contenteditable")==="true")}})(r,t,l,o,o?["copy","cut","paste"]:void 0,{config:{get_current_url:s.getCurrentUrl}})){var u;const{props:p,explicitNoCapture:g,target:v}=fF(r,{e:t,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this.To,disableCaptureUrlHashes:s.disableCaptureUrlHashes});if(g)return!1;const w=this.getElementSelectors(r,v);if(w&&w.length>0&&(p.$element_selectors=w),e===ay){const _=t.type||"clipboard";if(_!=="paste"){var d,f;const x=J==null||(d=J.getSelection())===null||d===void 0?void 0:d.toString(),b=z5(x);if(!b)return!1;p.$selected_content=b,p.$clipboard_text_length=(f=x==null?void 0:x.length)!==null&&f!==void 0?f:0}p.$copy_type=_}return(u=this.wo)===null||u===void 0||u.capture(e,p),!0}}isBrowserSupported(){return Gn(ue==null?void 0:ue.querySelectorAll)}},pF=class{constructor(t){this._instance=t}refresh(t){const e=this._instance.config,n=ut(e.autocapture)?e.autocapture:void 0;t.enabled=!!e.autocapture,t.rageclick=e.rageclick,t.maskAllElementAttributes=e.mask_all_element_attributes,t.maskAllText=e.mask_all_text,t.disableCaptureUrlHashes=e.disable_capture_url_hashes,t.getCurrentUrl=e.get_current_url,t.remoteRequestsDisabled=this._instance.nl(),t.url_allowlist=n==null?void 0:n.url_allowlist,t.url_ignorelist=n==null?void 0:n.url_ignorelist,t.dom_event_allowlist=n==null?void 0:n.dom_event_allowlist,t.element_allowlist=n==null?void 0:n.element_allowlist,t.css_selector_allowlist=n==null?void 0:n.css_selector_allowlist,t.css_selector_ignorelist=n==null?void 0:n.css_selector_ignorelist,t.element_attribute_ignorelist=n==null?void 0:n.element_attribute_ignorelist,t.capture_copied_text=n==null?void 0:n.capture_copied_text}};const df=un("[ExceptionAutocapture]"),ZS=()=>{},WS=t=>{var e;if(Gn(t))return(e=t.__posthog_layer__)!==null&&e!==void 0?e:t.__rrweb_layer__};function sh(t,e,n){try{if(!(e in t))return ZS;const r={next:t[e]},s=n(function(...i){return r.next.apply(this,i)});return Gn(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),t[e]=s,()=>{if(t[e]===s)return void(t[e]=r.next);let i=t[e],o=WS(i);for(;o;){if(o.next===s)return void(o.next=r.next);i=o.next,o=WS(i)}}}catch{return ZS}}const mF=un("[TracingHeaders]"),bl=un("[Web Vitals]"),qS=9e5,GS=["CLS","FCP","INP","LCP"],gF=["INP","LCP"],vF=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],uy="disabled",KS="lazy_loading",uo=un("[SessionRecording]"),yF=un("[Heatmaps]");function dy(t){return ut(t)&&"clientX"in t&&"clientY"in t&&pn(t.clientX)&&pn(t.clientY)}const f0=un("[Product Tours]"),fy=t=>{var e;return!t.config.disable_product_tours&&!!(!((e=t.persistence)===null||e===void 0)&&e.get_property(ex))},_F=["$set_once","$set"],Si=un("[SiteApps]"),YS="Error while initializing PostHog app with config id ",MR=(t,e)=>t!=null&&t.then?t.then(e):e(t),eu="SDK is not enabled or survey functionality is not yet loaded",XS="Disabled. Not loading surveys.";var wF=class{constructor(t,e){this.So=t,this.Th=e,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Ih=!1,this.Mh=[],this.Eh=null,this.Ph=null,this.Io=!1,this.Rh=new Set,this.onRemoteConfig=n=>{if(this.Io||this.Rr.disableSurveys)return;if(!n.ok)return Pt.warn("Remote config unavailable. Not loading surveys.");const r=n.config.surveys;if(nt(r))return Pt.warn("Flags not loaded yet. Not loading surveys.");this.Ah=Or(r)?r:r.length>0,Pt.info(`flags response received, isSurveysEnabled: ${this.Ah}`),this.loadIfEnabled()}}setup(t){if(!this.Io)return this.Fh=t,MR(t.kv.initialize(),()=>{if(this.Fh!==t||this.Io)return;this.Fh=void 0,this.wo=t;const e=t.onRemoteConfig(this.onRemoteConfig);this.Io?e.dispose():(this.Po=e,this.loadIfEnabled())})}dispose(){var t,e,n,r;this.Io||(this.Io=!0,this.Fh=void 0,this.wo=void 0,(t=this.Po)===null||t===void 0||t.dispose(),this.Po=void 0,(e=this._surveyEventReceiver)===null||e===void 0||e.dispose(),this._surveyEventReceiver=null,(n=this._surveyManager)===null||n===void 0||(r=n.dispose)===null||r===void 0||r.call(n),this._surveyManager=null,this.Mh=[],this.Eh=null,this.Rh.forEach(s=>clearTimeout(s)),this.Rh.clear())}get Rr(){return this.So.get()}initialize(){this.loadIfEnabled()}reset(){var t,e;(t=this._surveyManager)===null||t===void 0||(e=t.clearInMemoryInProgressSurveyState)===null||e===void 0||e.call(t);try{var n;(n=this._surveyEventReceiver)===null||n===void 0||n.reset(),localStorage.removeItem("lastSeenSurveyDate");const r=[];for(let s=0;s<localStorage.length;s++){const i=localStorage.key(s);(i!=null&&i.startsWith("seenSurvey_")||i!=null&&i.startsWith("inProgressSurvey_"))&&r.push(i)}r.forEach(s=>localStorage.removeItem(s))}catch{}}loadIfEnabled(){if(this.Io||!this.wo)return;const t=this.Rr;if(this._surveyManager)return;if(this.Ih)return void Pt.info("Already initializing surveys, skipping...");if(t.disableSurveys)return void Pt.info(XS);if(t.cookielessMode&&this.So.isOptedOut())return void Pt.info("Not loading surveys in cookieless mode without consent.");const e=this.So.getExtensions();if(!e)return void Pt.error("PostHog Extensions not found.");if(ce(this.Ah)&&!t.advancedEnableSurveys)return;const n=this.Ah||t.advancedEnableSurveys;this.Ih=!0;try{const r=e.generateSurveys;if(r)return this.Oh(r,n),void(this.Ih=!1);const s=e.loadExternalDependency;if(!s)return this.Dh(nx),void(this.Ih=!1);s(i=>{try{if(this.Io)return;const o=this.So.getExtensions();i||!(o!=null&&o.generateSurveys)?this.Dh("Could not load surveys script",i):this.Oh(o.generateSurveys,n)}finally{this.Ih=!1}})}catch(r){throw this.Ih=!1,this.Dh("Error initializing surveys",r),r}}Oh(t,e){this.Io||(this._surveyManager=t(e),this._surveyEventReceiver=this.So.createEventReceiver(),Pt.info("Surveys loaded successfully"),this.Lh({isLoaded:!0}))}Dh(t,e){Pt.error(t,e),this.Lh({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Mh.push(t),this._surveyManager&&this.Lh({isLoaded:!0}),()=>{this.Mh=this.Mh.filter(e=>e!==t)}}getSurveys(t,e=!1){var n;const r=(n=this.wo)!==null&&n!==void 0?n:this.Th;if(!r||this.Io)return;if(this.Rr.disableSurveys)return Pt.info(XS),t([]);const s=r.kv.get(q_);if(s&&!e)return t(s,{isLoaded:!0}),void(this.Nh()&&this.getSurveys(()=>{},!0));if(this.Eh)return void this.Eh.then(({surveys:l,context:u})=>{this.Io||t(l,u)}).catch(l=>Pt.error("Error in survey callback",l));const i=this.qh("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this.Rr.requestTimeoutMs}).then(l=>{try{return this.jh(r,l)}catch(u){return Pt.error("Error processing surveys response",u),this.jh(r,{statusCode:0,error:u})}},l=>this.jh(r,{statusCode:0,error:l}));this.Eh=i;const o=()=>{this.Eh===i&&(this.Eh=null)};i.then(l=>{o(),this.Io||t(l.surveys,l.context)},o).catch(l=>Pt.error("Error in survey callback",l))}qh(t,e){const n=this.wo;return n?n.sendRequest(t,e):new Promise(r=>r({statusCode:0,error:new Error(eu)}))}jh(t,e){if(this.Io)return{surveys:[],context:{isLoaded:!1,error:eu}};const n=e.statusCode;if(n!==200||!e.json){const o=`Surveys API could not be loaded, status: ${n}`;return n!==0?Pt.error(o):e.error||Pt.warn(o),this.Ph=Date.now(),{surveys:[],context:{isLoaded:!1,error:o}}}this.Ph=null;const r=e.json.surveys||[],s=r.filter(o=>(function(l){return!(!l.start_date||l.end_date)})(o)&&(CR(o)||(function(l){var u;return!!(!((u=l.conditions)===null||u===void 0||(u=u.actions)===null||u===void 0||(u=u.values)===null||u===void 0)&&u.length)})(o)));var i;return s.length>0&&((i=this._surveyEventReceiver)===null||i===void 0||i.register(s)),t.kv.set({[q_]:r,[Rm]:Date.now()}),{surveys:r,context:{isLoaded:!0}}}Nh(){return this.Bh()&&!this.Eh&&!this.Hh()}Bh(){var t,e;const n=(t=(e=this.wo)!==null&&e!==void 0?e:this.Th)===null||t===void 0?void 0:t.kv.get(Rm);return pn(n)&&Date.now()-n>3e5}Hh(){return pn(this.Ph)&&3e5>Date.now()-this.Ph}markSurveyAsSeen(t,e){var n;const r={id:t,current_iteration:(n=e==null?void 0:e.iteration)!==null&&n!==void 0?n:null};AR(r);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}Lh(t){for(const e of this.Mh)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(n){Pt.error("Error in survey callback",n)}}getActiveMatchingSurveys(t,e=!1){if(!nt(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Pt.warn("init was not called")}zh(t){let e=null;return this.getSurveys(n=>{var r;e=(r=n.find(s=>s.id===t))!==null&&r!==void 0?r:null}),e}Uh(t){if(nt(this._surveyManager))return{eligible:!1,reason:eu};const e=typeof t=="string"?this.zh(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}Wh(t){if(!this.So.isCapturing())return{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"};if(nt(this._surveyManager))return{eligible:!1,reason:eu};const e=typeof t=="string"?this.zh(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(nt(this._surveyManager))return Pt.warn("init was not called"),{visible:!1,disabledReason:eu};const e=this.Wh(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return nt(this._surveyManager)?(Pt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:eu})):new Promise(n=>{this.getSurveys(r=>{var s;const i=(s=r.find(o=>o.id===t))!==null&&s!==void 0?s:null;if(i){const o=this.Wh(i);n({visible:o.eligible,disabledReason:o.reason})}else n({visible:!1,disabledReason:"Survey not found"})},e)})}renderSurvey(t,e,n){var r;if(!this.So.isCapturing())return;if(nt(this._surveyManager))return void Pt.warn("init was not called");const s=typeof t=="string"?this.zh(t):t;if(!(s!=null&&s.id))return void Pt.warn("Survey not found");if(!Qj.includes(s.type))return void Pt.warn(`Surveys of type ${s.type} cannot be rendered in the app`);const i=ue==null?void 0:ue.querySelector(e);if(i){if(!((r=s.appearance)===null||r===void 0)&&r.surveyPopupDelaySeconds){Pt.info(`Rendering survey ${s.id} with delay of ${s.appearance.surveyPopupDelaySeconds} seconds`);const o=setTimeout(()=>{var l,u;this.Rh.delete(o),!this.Io&&this.So.isCapturing()&&(Pt.info(`Rendering survey ${s.id} with delay of ${(l=s.appearance)===null||l===void 0?void 0:l.surveyPopupDelaySeconds} seconds`),(u=this._surveyManager)===null||u===void 0||u.renderSurvey(s,i,n),Pt.info(`Survey ${s.id} rendered`))},1e3*s.appearance.surveyPopupDelaySeconds);return void this.Rh.add(o)}this._surveyManager.renderSurvey(s,i,n)}else Pt.warn("Survey element not found")}displaySurvey(t,e){var n;if(!this.So.isCapturing())return;if(nt(this._surveyManager))return void Pt.warn("init was not called");const r=this.zh(t);if(!r)return void Pt.warn("Survey not found");let s=r;if(!((n=r.appearance)===null||n===void 0)&&n.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=V(V({},r),{},{appearance:V(V({},r.appearance),{},{surveyPopupDelaySeconds:0})})),e.displayType!==t2.Popover&&e.initialResponses&&Pt.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){const i=this.Uh(r);if(!i.eligible)return void Pt.warn("Survey is not eligible to be displayed: ",i.reason)}e.displayType!==t2.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}cancelPendingSurvey(t){nt(this._surveyManager)?Pt.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t,e;(t=this._surveyManager)===null||t===void 0||(e=t.handlePageUnload)===null||e===void 0||e.call(t)}};function tu(t,e,n){if(nt(t))return!1;switch(n){case"exact":return t===e;case"contains":{const r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t)}case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}var xF=class{constructor(t){this._instance=t,this.Vh=new Set,this.Gh=new Set,this.Zh=new Lm,this.Qh=(e,n)=>this.Jh(e,n)&&this.Kh(e,n)&&this.Xh(e,n)&&this.Yh(e,n),this.Jh=(e,n)=>!(n!=null&&n.event)||(e==null?void 0:e.event)===(n==null?void 0:n.event)}init(){var t,e;ce((t=this._instance)===null||t===void 0?void 0:t._addCaptureHook)||(this.tc=(e=this._instance)===null||e===void 0?void 0:e._addCaptureHook((n,r)=>{this.on(n,r)}))}dispose(){var t;(t=this.tc)===null||t===void 0||t.call(this),this.tc=void 0,this.Zh=new Lm}register(t){var e,n;if(!ce((e=this._instance)===null||e===void 0?void 0:e._addCaptureHook)&&(t.forEach(r=>{var s;this.Vh.add(r),(s=r.steps)===null||s===void 0||s.forEach(i=>{this.Gh.add((i==null?void 0:i.event)||"")})}),(n=this._instance)===null||n===void 0?void 0:n.autocapture)){const r=new Set;this.Vh.forEach(s=>{var i;(i=s.steps)===null||i===void 0||i.forEach(o=>{o!=null&&o.selector&&r.add(o.selector)})}),this._instance.autocapture.setElementSelectors(r)}}replace(t){this.Vh.clear(),this.Gh.clear(),this.register(t)}on(t,e){e!=null&&t.length!=0&&(this.Gh.has(t)||this.Gh.has(e.event))&&this.Vh.forEach(n=>{this.ec(e,n)&&this.Zh.emit("actionCaptured",n.name)})}nc(t){this.onAction("actionCaptured",e=>t(e))}ec(t,e){if((e==null?void 0:e.steps)==null)return!1;for(const n of e.steps)if(this.Qh(t,n))return!0;return!1}onAction(t,e){return this.Zh.on(t,e)}Kh(t,e){if(e!=null&&e.url){var n;const r=t==null||(n=t.properties)===null||n===void 0?void 0:n.$current_url;if(!r||typeof r!="string"||!tu(r,e.url,e.url_matching||"contains"))return!1}return!0}Xh(t,e){return!!this.sc(t,e)&&!!this.rc(t,e)&&!!this.oc(t,e)}sc(t,e){var n;if(!(e!=null&&e.href))return!0;const r=this.ac(t);if(r.length>0)return r.some(i=>tu(i.href,e.href,e.href_matching||"exact"));const s=(t==null||(n=t.properties)===null||n===void 0?void 0:n.$elements_chain)||"";return!!s&&tu((function(i){const o=i.match(/(?::|")href="(.*?)"/);return o?o[1]:""})(s),e.href,e.href_matching||"exact")}rc(t,e){var n;if(!(e!=null&&e.text))return!0;const r=this.ac(t);if(r.length>0)return r.some(u=>tu(u.text,e.text,e.text_matching||"exact")||tu(u.$el_text,e.text,e.text_matching||"exact"));const s=(t==null||(n=t.properties)===null||n===void 0?void 0:n.$elements_chain)||"";return!!s&&(i=(function(u){const d=[],f=/(?::|")text="(.*?)"/g;let p;for(;!nt(p=f.exec(u));)d.includes(p[1])||d.push(p[1]);return d})(s),o=e.text,l=e.text_matching||"exact",i.some(u=>tu(u,o,l)));var i,o,l}oc(t,e){var n,r;if(!(e!=null&&e.selector))return!0;const s=t==null||(n=t.properties)===null||n===void 0?void 0:n.$element_selectors;if(s!=null&&s.includes(e.selector))return!0;const i=(t==null||(r=t.properties)===null||r===void 0?void 0:r.$elements_chain)||"";if(e.selector_regex&&i)try{return new RegExp(e.selector_regex).test(i)}catch{return!1}return!1}ac(t){var e;return(t==null||(e=t.properties)===null||e===void 0?void 0:e.$elements)==null?[]:t==null?void 0:t.properties.$elements}Yh(t,e){return!(e!=null&&e.properties)||e.properties.length===0||RR(e.properties.reduce((n,r)=>{const s=Ue(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return n[r.key]={values:s,operator:r.operator||"exact"},n},{}),t==null?void 0:t.properties)}},bF=class{constructor(t){var e,n;this.lc=[],this._instance=t,this.uc=new Map,this.hc=new Map,this.cc=new Map,this.dc=(e=this._instance)===null||e===void 0||(n=e.onSessionId)===null||n===void 0?void 0:n.call(e,r=>this.vc(r))}fc(t){return!1}gc(){return null}mc(t){}yc(){}bc(t,e){return!!t&&RR(t.propertyFilters,e==null?void 0:e.properties)}_c(t,e){const n=new Map;return t.forEach(r=>{var s;(s=r.conditions)===null||s===void 0||(s=s[e])===null||s===void 0||(s=s.values)===null||s===void 0||s.forEach(i=>{if(i!=null&&i.name){const o=n.get(i.name)||[];o.push(r.id),n.set(i.name,o)}})}),n}wc(t,e,n){const r=(n===af.Activation?this.uc:this.hc).get(t);let s=[];return this.kc(i=>{s=i.filter(o=>r==null?void 0:r.includes(o.id))}),s.filter(i=>{var o;const l=(o=i.conditions)===null||o===void 0||(o=o[n])===null||o===void 0||(o=o.values)===null||o===void 0?void 0:o.find(u=>u.name===t);return this.bc(l,e)})}register(t){this.Sc(t,!1)}replace(t){this.Sc(t,!0)}Sc(t,e){var n;ce((n=this._instance)===null||n===void 0?void 0:n._addCaptureHook)||(this.xc(t,e),this.Cc(t,e))}Cc(t,e){const n=t.filter(i=>{var o;return(o=i.conditions)===null||o===void 0||(o=o.actions)===null||o===void 0||(o=o.values)===null||o===void 0?void 0:o.length});var r;if(e&&this.cc.clear(),n.length===0)return void(e&&((r=this.$c)===null||r===void 0||r.replace([])));this.$c||(this.$c=new xF(this._instance),this.$c.init(),this.$c.nc(i=>this.onAction(i)));const s=[];n.forEach(i=>{var o;(o=i.conditions)===null||o===void 0||(o=o.actions)===null||o===void 0||o.values.forEach(l=>{if(s.push(l),l.name){var u;const d=(u=this.cc.get(l.name))!==null&&u!==void 0?u:[];d.includes(i.id)||d.push(i.id),this.cc.set(l.name,d)}})}),e?this.$c.replace(s):this.$c.register(s)}Tc(t,e){e.forEach((n,r)=>{var s;const i=(s=t.get(r))!==null&&s!==void 0?s:[];n.forEach(o=>{i.includes(o)||i.push(o)}),t.set(r,i)})}xc(t,e){var n,r;const s=t.filter(u=>{var d,f;return((d=u.conditions)===null||d===void 0?void 0:d.events)&&((f=u.conditions)===null||f===void 0||(f=f.events)===null||f===void 0||(f=f.values)===null||f===void 0?void 0:f.length)>0}),i=t.filter(u=>{var d,f;return((d=u.conditions)===null||d===void 0?void 0:d.cancelEvents)&&((f=u.conditions)===null||f===void 0||(f=f.cancelEvents)===null||f===void 0||(f=f.values)===null||f===void 0?void 0:f.length)>0}),o=this._c(t,af.Activation),l=this._c(t,af.Cancellation);e?(this.uc=o,this.hc=l):(this.Tc(this.uc,o),this.Tc(this.hc,l)),(s.length!==0||i.length!==0)&&((n=this.tc)!==null&&n!==void 0||(this.tc=(r=this._instance)===null||r===void 0?void 0:r._addCaptureHook((u,d)=>{this.onEvent(u,d)})))}onEvent(t,e){var n,r;const s=this.Ic(),i=(e==null||(n=e.properties)===null||n===void 0?void 0:n.$survey_id)||(e==null||(r=e.properties)===null||r===void 0?void 0:r.$product_tour_id);if(i&&this.getActivatedIds().includes(i)){const l=this.Mc(t,i);if(l==="consume")return s.info("event consumed activated item, removing it",{event:t,itemId:i}),void this.Ec([i]);if(l==="persist")return s.info("shown item promoted to persisted activation",{event:t,itemId:i}),this.Pc(i),void this.Rc([i])}if(this.hc.has(t)){const l=this.wc(t,e,af.Cancellation);l.length>0&&(s.info("cancel event matched, cancelling items",{event:t,itemsToCancel:l.map(u=>u.id)}),this.Ec(l.map(u=>u.id)),l.forEach(u=>this.Ac(u.id)))}if(!this.uc.has(t))return;s.info("event name matched",{event:t,eventPayload:e,items:this.uc.get(t)});const o=this.wc(t,e,af.Activation);this.Fc(o.map(l=>l.id))}onAction(t){this.cc.has(t)&&this.Fc(this.cc.get(t)||[])}Fc(t){var e,n;if(t.length===0)return;const r=!!(!((e=this._instance)===null||e===void 0||(n=e.get_session_id)===null||n===void 0)&&n.call(e)),s=[];for(const i of t)r&&this.fc(i)?this.Pc(i)&&this.Oc(i):s.push(i);s.length>0&&(this.lc=[...new Set([...this.lc,...s])]),this.Ic().info("updating activated items",{activatedItems:this.getActivatedIds()})}Pc(t){this.lc=this.lc.filter(n=>n!==t);const e=this.Dc();return!e.includes(t)&&(this.Lc([...e,t]),this.Nc(),!0)}Ec(t){const e=new Set(t);this.lc=this.lc.filter(s=>!e.has(s));const n=this.qc(),r=n.filter(s=>!e.has(s));r.length!==n.length&&(this.Lc(r),r.length===0&&this.jc()),this.Rc(t)}Bc(){var t;const e=this.gc();if(!e)return{};const n=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.props[e];return n&&typeof n=="object"?n:{}}Oc(t){if(!this.gc())return;const e=this.Bc();this.mc(V(V({},e),{},{[t]:Date.now()}))}Rc(t){if(!this.gc())return;const e=this.Bc(),n={};let r=!1;for(const[s,i]of Object.entries(e))t.includes(s)?r=!0:n[s]=i;r&&(Wr(n)?this.yc():this.mc(n))}Hc(){this.gc()&&this.yc()}getActivationTimestamp(t){if(!this.Dc().includes(t))return;const e=this.Bc()[t];return pn(e)?e:void 0}qc(){var t;const e=this.zc();return((t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.props[e])||[]}Dc(){var t,e,n;const r=this.qc();if(r.length===0)return[];const s=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.props[this.Uc()],i=(e=this._instance)===null||e===void 0||(n=e.get_session_id)===null||n===void 0?void 0:n.call(e);return i&&s===i?r:[]}Nc(){var t,e;const n=(t=this._instance)===null||t===void 0||(e=t.get_session_id)===null||e===void 0?void 0:e.call(t);n&&this.Wc(n)}jc(){this.Vc()}vc(t){var e;const n=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.props[this.Uc()];if(n&&n!==t){const r=this.qc(),s=this.Bc();r.length>0&&(this.Lc([]),r.filter(i=>pn(s[i])).forEach(i=>this.Ac(i))),this.jc(),this.Hc()}}getActivatedIds(){return[...new Set([...this.Dc(),...this.lc])].filter(t=>!this.Gc(t))}dispose(){var t,e,n;(t=this.dc)===null||t===void 0||t.call(this),this.dc=void 0,(e=this.tc)===null||e===void 0||e.call(this),this.tc=void 0,(n=this.$c)===null||n===void 0||n.dispose(),this.$c=void 0}reset(){this.lc=[],this.qc().length>0&&this.Lc([]),this.jc(),this.Hc()}getEventToItemsMap(){return this.uc}Zc(){return this.$c}},SF=class extends bF{constructor(t){super(t)}zc(){return E5}Uc(){return C5}gc(){return P5}mc(t){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.register({$surveys_activated_timestamps:t})}yc(){var t;(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||t.unregister("$surveys_activated_timestamps")}fc(t){var e;let n;this.kc(s=>{n=s.find(i=>i.id===t)});const r=n==null||(e=n.appearance)===null||e===void 0?void 0:e.surveyPopupDelaySeconds;return pn(r)&&r>0}Qc(){return Co.SHOWN}kc(t){var e;(e=this._instance)===null||e===void 0||e.getSurveys(t)}Ac(t){var e;(e=this._instance)===null||e===void 0||e.cancelPendingSurvey(t)}Ic(){return Pt}Lc(t){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.register({$surveys_activated:t})}Wc(t){var e;(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0||e.register({$surveys_activated_session:t})}Vc(){var t;(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||t.unregister("$surveys_activated_session")}Gc(){return!1}Mc(t,e){let n;return this.kc(r=>{n=r.find(s=>s.id===e)}),!n||(function(r){var s;return CR(r)&&!!(!((s=r.conditions)===null||s===void 0||(s=s.events)===null||s===void 0)&&s.repeatedActivation)||r.schedule==="always"})(n)?t===Co.SHOWN?"consume":"ignore":t===Co.SHOWN?"persist":t===Co.DISMISSED||t===Co.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},kF=class{constructor(e){this._instance=e}initialize(){}get(e){if(typeof e=="string")return this._instance.get_property(e);const n={};for(const r of e){const s=this._instance.get_property(r);ce(s)||(n[r]=s)}return n}set(e,n){this._instance.register(typeof e=="string"?{[e]:n}:e)}remove(e){typeof e!="string"?e.forEach(n=>this._instance.unregister(n)):this._instance.unregister(e)}},EF=class{constructor(t){this._instance=t}get(){const t=this._instance.config;return{disableSurveys:t.disable_surveys,cookielessMode:!!t.cookieless_mode,advancedEnableSurveys:t.advanced_enable_surveys,requestTimeoutMs:t.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}isCapturing(){return this._instance.is_capturing()}getExtensions(){const t=$e==null?void 0:$e.__PosthogExtensions__;if(!t)return;const{generateSurveys:e,loadExternalDependency:n}=t;return{generateSurveys:e?r=>e(this._instance,r):void 0,loadExternalDependency:n?r=>n(this._instance,"surveys",r):void 0}}createEventReceiver(){return new SF(this._instance)}};const CF=J!=null&&J.location?Im(J.location.hash,"__posthog")||Im(location.hash,"state"):null,QS="_postHogToolbarParams",JS=un("[Toolbar]"),ek=un("[FeatureFlags]");var PF=class{constructor(t,e=!1){this.Jc=!1,this.update(t,e)}update(t,e){this.Kc=((n,r)=>{var s,i,o,l,u,d,f,p;return{bootstrap:{featureFlags:(s=(i=n.bootstrap)===null||i===void 0?void 0:i.featureFlags)!==null&&s!==void 0?s:void 0,featureFlagPayloads:(o=(l=n.bootstrap)===null||l===void 0?void 0:l.featureFlagPayloads)!==null&&o!==void 0?o:void 0},remoteRequestsDisabled:r,featureFlagsDisabled:!!n.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!n.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!n.advanced_feature_flags_dedup_per_session,cacheTtlMs:n.feature_flag_cache_ttl_ms,refreshIntervalMs:(u=n.remote_config_refresh_interval_ms)!==null&&u!==void 0?u:3e5,idleRefreshBackoff:ce(n.remote_config_refresh_interval_ms),requestTimeoutMs:n.feature_flag_request_timeout_ms,requestMaxRetries:Math.max(0,(d=n.feature_flag_request_max_retries)!==null&&d!==void 0?d:1),compression:n.disable_compression?void 0:"best-available",evaluationContexts:(f=(p=n.evaluation_contexts)!==null&&p!==void 0?p:n.evaluation_environments)!==null&&f!==void 0?f:[],flagKeys:Ue(n.flag_keys)?n.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.Jc||(ek.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Jc=!0),ce(t.flag_keys)||Ue(t.flag_keys)||ek.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.Kc}};const tk=un("[FeatureFlags]"),Sl=un("[FeatureFlags]",{debugEnabled:!0}),hy=`" failed. Feature flags didn't load in time.`,RF=[502,504],nk=["click","keydown","wheel","touchstart","pointerdown"],rk="connection_error",sk=t=>{const e={};for(let n=0;t.length>n;n++)e[t[n]]=!0;return e},ik=t=>{const e={};for(const[n,r]of U0(t||{}))r&&(e[n]=r);return e},ok=t=>ld(t)&&(t.name==="RangeError"&&t.message.indexOf("Maximum call stack size exceeded")===0||t.name==="InternalError"&&t.message==="too much recursion"),ii=un("[Error tracking]"),a2="webkit-masked-url:",AF=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],TF=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",a2],IF=["__firefox__","__gCrWeb"],ak="Refusing to render web experiment since the viewer is a likely bot",MF={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>Nm(e,t),not_regex:(t,e)=>!Nm(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t},js=un("[Conversations]"),kl="Conversations not available yet.";function lk(t,e){var n,r,s,i,o,l,u;const d=(n=t==null?void 0:t.flushIntervalMs)!==null&&n!==void 0?n:3e3,f=(r=t==null?void 0:t.maxBufferSize)!==null&&r!==void 0?r:100,p=e!=null&&e.consoleCapture?void 0:(s=t==null?void 0:t.maxLogsPerInterval)!==null&&s!==void 0?s:1e3,g=ce(p)?Math.max(f,2048):Math.max(f,p),v=V(V({},(function(){let w="",_="";try{const x=Kn==null?void 0:Kn.userAgent;x&&([w,_]=YP(x))}catch{}return(function(x,b){const E=(function(C){if(C)return{}.hasOwnProperty.call(nS,C)?nS[C]:C})(x);return V(V({},E?{"os.name":E}:{}),b?{"os.version":b}:{})})(w,_)})()),t==null?void 0:t.resourceAttributes);return{serviceName:(i=(o=v==null?void 0:v["service.name"])!==null&&o!==void 0?o:t==null?void 0:t.serviceName)!==null&&i!==void 0?i:e==null?void 0:e.serviceNameDefault,serviceVersion:(l=v==null?void 0:v["service.version"])!==null&&l!==void 0?l:t==null?void 0:t.serviceVersion,environment:(u=v==null?void 0:v["deployment.environment"])!==null&&u!==void 0?u:t==null?void 0:t.environment,resourceAttributes:v,beforeSend:t==null?void 0:t.beforeSend,flushIntervalMs:d,maxBufferSize:f,maxQueueSize:g,maxBatchRecordsPerPost:100,rateCapWindowMs:d,maxLogsPerInterval:p,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}const OF=["debug","log","warn","error","info"],LF=t=>{for(;t!=null&&t.__rrweb_original__;)t=t.__rrweb_original__;return t},ck="console",OR="__posthogHandledLogsRequestError",py=(t,e)=>{const n=t instanceof Error?t:new Error(e);return n[OR]=!0,n},uk=t=>!!t&&typeof t=="object"&&t[OR]===!0,Dm=un("[NetworkMetrics]"),dx=()=>{var t;return!(J==null||(t=J.performance)===null||t===void 0)&&t.now?J.performance.now():Date.now()},NF={"http:":80,"https:":443},DF=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),LR=(t,e)=>{var n;const r=String(e);return{method:String(t).toUpperCase(),url:((n=Oo(r))===null||n===void 0?void 0:n.href)||r}},l2=(t,e,n,r,s,i,o=!1)=>{try{var l,u;const d=s();if(!d)return;const f=n||void 0,p=dx()-r,g=Oo(e.url);if(g&&g.protocol!=="http:"&&g.protocol!=="https:")return;const v={url:(g==null?void 0:g.href)||e.url,method:e.method},w=Gn(d.name)?d.name(v):it(d.name)?d.name:"http.client.request.duration";if(!w)return;const _=o&&!f?void 0:((b,E)=>b?400>b?void 0:String(b):(E==null?void 0:E.name)||"_OTHER")(f,i),x=V(V(V(V(V({},(b=>{const E=DF.has(b)?b:"_OTHER";return V({"http.request.method":E},E==="_OTHER"&&b!==E?{"http.request.method_original":b}:{})})(v.method)),g?(b=>{return{"server.address":b.hostname.startsWith("[")&&b.hostname.endsWith("]")?b.hostname.slice(1,-1):b.hostname,"server.port":Number(b.port)||NF[b.protocol],"url.scheme":b.protocol.slice(0,-1),"url.template":(E=b.pathname,E.split("/").map(C=>(R=>/^\d+$/.test(R)||R.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(R))(C)?":id":C).join("/"))};var E})(g):{}),f?{"http.response.status_code":f}:{}),_?{"error.type":_}:{}),(l=d.attributes)===null||l===void 0?void 0:l.call(d,v,{status:f,durationMs:p}));(u=t.metrics)===null||u===void 0||u.histogram(w,p,{unit:"ms",attributes:x})}catch(d){Dm.error("Failed to record network metric",d)}},NR=()=>{},$F=(t,e)=>Gn(J==null?void 0:J.fetch)?sh(J,"fetch",n=>function(...r){const s=dx(),i=n.apply(this,r);if(!e())return i;try{var o,l,u;const[d,f]=r,p=LR((o=(l=f==null?void 0:f.method)!==null&&l!==void 0?l:d==null?void 0:d.method)!==null&&o!==void 0?o:"GET",(u=d==null?void 0:d.url)!==null&&u!==void 0?u:d);return i.then(g=>(l2(t,p,g==null?void 0:g.status,s,e,void 0,!0),g),g=>{throw l2(t,p,void 0,s,e,g),g})}catch(d){return Dm.error("Failed to observe fetch",d),i}}):NR,jF=(t,e)=>{var n;const r=J==null||(n=J.XMLHttpRequest)===null||n===void 0?void 0:n.prototype;if(!r)return NR;const s=new WeakMap,i=sh(r,"open",l=>function(...u){try{hR.has(this)||s.set(this,LR(u[0],u[1]))}catch(d){Dm.error("Failed to observe XHR open",d)}return l.apply(this,u)}),o=sh(r,"send",l=>function(...u){let d;try{const f=s.get(this);if(f&&e()){const p=dx();d=()=>{this.removeEventListener("loadend",d),l2(t,f,this.status,p,e)},Et(this,"loadend",d)}}catch(f){Dm.error("Failed to observe XHR send",f)}try{return l.apply(this,u)}catch(f){throw d&&this.removeEventListener("loadend",d),f}});return()=>{i(),o()}},kg={featureFlags:class{constructor(t){this.name="featureFlags",this.Xc=!1,this.featureFlagEventHandlers=[],this.$=tk,this.Yc={},this.td={},this.ed=[],this.nd=!1,this.sd=!1,this.rd=0,this.od=!1,this.ad=!1,this.ld=!1,this.ud=!1,this.hd=0,this.dd=!1,this.an=()=>{const e=this.vd();this.hd=0,e&&this.reloadFeatureFlags()},this.fd=()=>{var e,n;const r=this.pd,s=(e=this.gd)!==null&&e!==void 0?e:r;ce(r)||ce(s)||this.Rr.remoteRequestsDisabled||!ue||ue.visibilityState==="hidden"||Date.now()-((n=this.md)!==null&&n!==void 0?n:0)<s||(this.gd=this.dd||!this.Rr.idleRefreshBackoff?r:Math.min(2*s,36e5),this.dd=!1,this.reloadFeatureFlags(),this.yd())},this.bd=()=>{this.dd&&this.gd===this.pd||this._d()},this.ln=()=>{(ue==null?void 0:ue.visibilityState)==="visible"&&this._d()},"get"in t?this.So=t:(this._instance=t,this.wd=new PF(t.config,t.nl()),this.So=this.wd)}updateConfig(t,e){var n;(n=this.wd)===null||n===void 0||n.update(t,e),this.wo&&this.kd()}setup(t){return this.Fh=t,this.$=t.logger.createLogger("[FeatureFlags]"),MR(t.kv.initialize(),()=>{this.Fh===t&&(this.Fh=void 0,this.wo=t,this.Sd(t))})}Sd(t){var e;if(this.wo===t)return J&&Et(J,"online",this.an),this.kd(),this.xd=t.registerDynamicEventProperties(()=>this.Cd()?this.Yc:this.td),this.$d=(e=this._instance)===null||e===void 0||(e=e.persistence)===null||e===void 0?void 0:e.onCrossTabFeatureFlagChange(()=>{this.Td(),this.Id(),this.Md()}),this.Id(),this.initialize()}_d(){this.dd=!0,this.gd=this.pd,this.fd()}kd(){const t=this.Rr.refreshIntervalMs,e=!this.Rr.remoteRequestsDisabled&&ue&&!ce(t)&&t>0?t:void 0;this.Rr.idleRefreshBackoff||(this.gd=e),e!==this.pd&&(this.Ed(),ce(e)||(this.pd=e,this.gd=e,this.yd(),ue!=null&&ue.addEventListener&&(Et(ue,Jf,this.ln),hu(nk,n=>{Et(ue,n,this.bd,{capture:!0})}))))}yd(){ce(this.pd)||(ce(this.Pd)||clearInterval(this.Pd),this.md=Date.now(),this.Pd=setInterval(this.fd,this.pd))}Ed(){var t;ce(this.Pd)||(clearInterval(this.Pd),this.Pd=void 0,ue==null||(t=ue.removeEventListener)===null||t===void 0||t.call(ue,"visibilitychange",this.ln),hu(nk,e=>{var n;ue==null||(n=ue.removeEventListener)===null||n===void 0||n.call(ue,e,this.bd,{capture:!0})})),this.pd=void 0,this.gd=void 0,this.dd=!1,this.md=void 0}destroy(){this.Rd()}dispose(){this.Rd()}Rd(){var t,e;this.Ed(),this.rd++,this.ad=!1,this.Fh=void 0,this.wo&&(this.Ad(),(t=this.xd)===null||t===void 0||t.dispose(),this.xd=void 0,(e=this.$d)===null||e===void 0||e.call(this),this.$d=void 0,this.ed=[],J==null||J.removeEventListener("online",this.an),this.wo=void 0)}get Rr(){return this.So.get()}Fd(t){var e;return this.Od&&t in this.Od?this.Od[t]:(e=this.wo)===null||e===void 0?void 0:e.kv.get(t)}Td(){return!!this.Od&&(this.Od=void 0,!0)}Dd(){var t;return!ce((t=this.wo)===null||t===void 0?void 0:t.kv.get("$enabled_feature_flags"))&&this.Td()}At(t){this.Ld(()=>{var e;return(e=this.wo)===null||e===void 0?void 0:e.kv.set(t)})}Nd(t,e,n){var r;if(!(!((r=this._instance)===null||r===void 0)&&r.persistence)||!t.$enabled_feature_flags)return;const s=this.Fd("$enabled_feature_flags")||{},i=t.$enabled_feature_flags||{},o=e.flags||e.featureFlags,l=e.flags?Object.entries(e.flags).filter(([,b])=>!(b!=null&&b.failed)).map(([b])=>b):[],u=!!e.errorsWhileComputingFlags&&!!e.flags,d=u?l:n&&!Ue(o)?Object.keys(o||{}):Array.from(new Set([...Object.keys(s),...Object.keys(i)])),f=this.Fd("$feature_flag_payloads")||{},p=t.$feature_flag_payloads||{},g=u||n?d:Array.from(new Set([...Object.keys(f),...Object.keys(p)])),v=!u&&!n,w=!!v||d,_=!!v||g,x={[ko]:w,[hi]:w,[ka]:_};t.$feature_flag_details&&(x[Ql]=w);for(const b of[Jl,Oa,Tf])ce(t[b])||(x[b]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(x)}Lt(t){this.Ld(()=>{var e;return(e=this.wo)===null||e===void 0?void 0:e.kv.remove(t)})}Ld(t){try{t()}catch(e){this.$.error("Failed to update feature flag persistence",e)}}Id(){const t={};for(const r of[ko,ka,Jl,Ri]){const s=this.Fd(r);ce(s)||(t[r]=s)}this.Yc=t;const e=V({},t),n=this.Fd(hi);if(n)for(const[r,s]of Object.entries(n))e[`$feature/${r}`]=s;this.td=e}Cd(){const t=this.Rr.cacheTtlMs;if(!t||0>=t)return!1;const e=this.Fd(Oa);return typeof e!="number"||Date.now()-e>t}qd(){return!!this.Cd()&&(this.ud||this.sd||(this.ud=!0,this.$.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}jd(){const t=this.Rr.evaluationContexts;return t!=null&&t.length?t.filter(e=>{const n=e&&typeof e=="string"&&e.trim().length>0;return n||this.$.error("Invalid evaluation context found:",e,"Expected non-empty string"),n}):[]}Bd(){const t=this.Rr.flagKeys;if(!ce(t))return t.filter(e=>{const n=e&&typeof e=="string"&&e.trim().length>0;return n||this.$.error("Invalid flag key found:",e,"Expected non-empty string"),n})}initialize(){var t,e;const n=this.Rr,r=(t=(e=n.bootstrap)===null||e===void 0?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(r).length){var s,i;const o=(s=(i=n.bootstrap)===null||i===void 0?void 0:i.featureFlagPayloads)!==null&&s!==void 0?s:{},l=Object.keys(r).filter(d=>!ce(r[d])).reduce((d,f)=>(d[f]=r[f],d),{}),u=Object.keys(o).filter(d=>l[d]).reduce((d,f)=>(d[f]=o[f],d),{});return this.Hd({featureFlags:l,featureFlagPayloads:u},void 0,{persist:!1})}}updateFlags(t,e,n){var r,s;const i=n!=null&&n.merge&&(r=this.Fd("$enabled_feature_flags"))!==null&&r!==void 0?r:{},o=n!=null&&n.merge&&(s=this.Fd("$feature_flag_payloads"))!==null&&s!==void 0?s:{},l=V(V({},i),t),u=V(V({},o),e),d={};for(const[f,p]of Object.entries(l))d[f]={key:f,enabled:X8(p),variant:Q8(p),reason:void 0,metadata:ce(u==null?void 0:u[f])?void 0:{id:0,version:void 0,description:void 0,payload:u[f]}};this.Hd({flags:d})}get hasLoadedFlags(){return this.nd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){const t=this.Fd(Ql),e=this.Fd(Ri),n=this.Fd(Nl);if(!n&&!e)return t||{};const r=Ut({},t||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(const l of s){var i;const u=r[l],d=e==null?void 0:e[l],f=ce(d)?(i=u==null?void 0:u.enabled)!==null&&i!==void 0&&i:!!d,p=ce(d)?u==null?void 0:u.variant:typeof d=="string"?d:void 0,g=n==null?void 0:n[l],v=V(V({},u),{},{enabled:f,variant:f?p??(u==null?void 0:u.variant):void 0});var o;f!==(u==null?void 0:u.enabled)&&(v.original_enabled=u==null?void 0:u.enabled),p!==(u==null?void 0:u.variant)&&(v.original_variant=u==null?void 0:u.variant),g&&(v.metadata=V(V({},u==null?void 0:u.metadata),{},{payload:g,original_payload:u==null||(o=u.metadata)===null||o===void 0?void 0:o.payload})),r[l]=v}return this.Xc||(this.$.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:r}),this.Xc=!0),r}getAllFeatureFlags(){const t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map(n=>{const r=t[n];return{key:n,enabled:X8(r),variant:Q8(r),payload:Y8(e[n])}})}getFlagVariants(){const t=this.Fd(hi),e=this.Fd(Ri);if(!e)return t||{};const n=Ut({},t||{}),r=Object.keys(e);for(let s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.Xc||(this.$.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.Xc=!0),n}getFlagPayloads(){const t=this.Fd(ka),e=this.Fd(Nl);if(!e)return t||{};const n=Ut({},t||{}),r=Object.keys(e);for(let s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.Xc||(this.$.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.Xc=!0),n}reloadFeatureFlags(){this.od||this.Rr.featureFlagsDisabled||this.vd()||(this.sd&&(this.ad=!0),this.zd||(this.ed.slice().forEach(t=>{try{t()}catch(e){this.$.error("Error while running feature flags reloading callback",e)}}),this.zd=setTimeout(()=>{this.Ud()},5)))}Ad(){clearTimeout(this.zd),this.zd=void 0}onReloading(t){return this.ed.push(t),()=>{this.ed=this.ed.filter(e=>e!==t)}}ensureFlagsLoaded(){this.nd||this.sd||this.zd||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.od=t}resetFlagCallReported(){this.Lt(Pa)}Ud(t){this.Ad();const e=this.wo;if(!e||this.Rr.remoteRequestsDisabled||this.vd())return;if(this.sd)return void(this.ad=!0);const n={token:e.projectToken,distinct_id:e.distinctId,groups:e.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:V(V(V({},e.initialPersonProperties),this.Fd("$stored_person_properties")||{}),{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Fd(Ca),timezone:iR()};ce(e.deviceId)||(n.$device_id=e.deviceId),(t!=null&&t.disableFlags||this.Rr.featureFlagsDisabled)&&(n.disable_flags=!0);const r=this.jd();r.length&&(n.evaluation_contexts=r);const s=this.Bd();ce(s)||(n.flag_keys=s);const i=this.Rr.onlyEvaluateSurveyFeatureFlags,o="/flags/?v=2"+(i?"&only_evaluate_survey_feature_flags=true":""),l=this.rd;this.sd=!0;const u=()=>{this.ad&&(this.ad=!1,this.Ud())},d=w=>{var _,x;const b=(_=w.json)!==null&&_!==void 0?_:{},E=w.statusCode!==200;if(this.sd=!1,l!==this.rd)return void u();if(this.Wd(w.statusCode),E||this.ad||(this.$anon_distinct_id=void 0),n.disable_flags&&!this.ad)return;this.ld=!E;const C=[];w.error?C.push(w.error instanceof Error&&w.error.name==="AbortError"?"timeout":w.error instanceof Error?rk:"unknown_error"):w.statusCode!==200&&C.push(`api_error_${w.statusCode}`),b.errorsWhileComputingFlags&&C.push("errors_while_computing_flags");const R=!!(!((x=b.quotaLimited)===null||x===void 0)&&x.includes("feature_flags"));R&&C.push("quota_limited"),this.At({[Qf]:C}),R?this.$.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):n.disable_flags||this.Hd(b,E,{partialResponse:i}),u()},f=w=>{this.sd=!1,l===this.rd&&(this.At({[Qf]:[rk]}),this.$.error("Feature flag request failed",w),this.Dd()&&this.Md(!0)),u()};let p=this.Rr.requestMaxRetries;const g=()=>p>0&&l===this.rd,v=()=>{if(l!==this.rd||!this.wo||this.Rr.remoteRequestsDisabled)return this.sd=!1,void u();try{e.sendRequest(o,{target:"flags",method:"POST",body:n,compression:this.Rr.compression,sentAt:"body",timeoutMs:this.Rr.requestTimeoutMs}).then(w=>{if((_=>RF.includes(_.statusCode)||(x=>x.statusCode===0&&x.error instanceof Error&&x.error.name==="AbortError")(_))(w)&&g())return p--,void setTimeout(v,500);d(w)}).catch(f)}catch(w){f(w)}};v()}vd(){return Y5(this.hd,3)}Wd(t){this.hd=X5(t,this.hd,3,()=>this.$.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(t,e={}){var n;if(e.fresh&&!this.ld)return;if(!(this.nd||this.getFlags()&&this.getFlags().length>0))return void this.$.warn('getFeatureFlag for key "'+t+hy);if(this.qd())return;const r=this.getFeatureFlagResult(t,e);return(n=r==null?void 0:r.variant)!==null&&n!==void 0?n:r==null?void 0:r.enabled}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){const e=this.getFeatureFlagResult(t,{send_event:!1});return e==null?void 0:e.payload}getFeatureFlagResult(t,e={}){if(e.fresh&&!this.ld)return;if(!(this.nd||this.getFlags()&&this.getFlags().length>0))return void this.$.warn('getFeatureFlagResult for key "'+t+hy);if(this.qd())return;const n=this.getFlagVariants(),r=t in n,s=n[t],i=this.getFlagPayloads()[t],o=String(s),l=this.Fd("$feature_flag_request_id")||void 0,u=this.Fd("$feature_flag_evaluated_at")||void 0;let d,f=this.Fd("$flag_call_reported")||{};if(this.Rr.deduplicateCallsPerSession){var p;const L=(p=this.wo)===null||p===void 0?void 0:p.session.sessionId,D=this.Fd(yf);L&&L!==D&&(f={},d=L)}if(e.send_event||!("send_event"in e))if(t in f&&f[t].includes(o))d&&this.At({[Pa]:f,[yf]:d});else{var g,v,w,_,x,b,E,C,R,A,I,M;Ue(f[t])?f[t].push(o):f[t]=[o],this.At(V({[Pa]:f},d?{[yf]:d}:{}));const L=this.getFeatureFlagDetails(t),D=[...(g=this.Fd("$feature_flag_errors"))!==null&&g!==void 0?g:[]];ce(s)&&D.push("flag_missing");const j={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:i??null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:(v=(w=this.Rr.bootstrap)===null||w===void 0||(w=w.featureFlags)===null||w===void 0?void 0:w[t])!==null&&v!==void 0?v:null,$feature_flag_bootstrapped_payload:(_=(x=this.Rr.bootstrap)===null||x===void 0||(x=x.featureFlagPayloads)===null||x===void 0?void 0:x[t])!==null&&_!==void 0?_:null,$used_bootstrap_value:!this.ld};ce(L==null||(b=L.metadata)===null||b===void 0?void 0:b.has_experiment)||(j.$feature_flag_has_experiment=L.metadata.has_experiment),ce(L==null||(E=L.metadata)===null||E===void 0?void 0:E.version)||(j.$feature_flag_version=L.metadata.version);const H=(C=L==null||(R=L.reason)===null||R===void 0?void 0:R.description)!==null&&C!==void 0?C:L==null||(A=L.reason)===null||A===void 0?void 0:A.code;var T;H&&(j.$feature_flag_reason=H),!(L==null||(I=L.metadata)===null||I===void 0)&&I.id&&(j.$feature_flag_id=L.metadata.id),ce(L==null?void 0:L.original_variant)&&ce(L==null?void 0:L.original_enabled)||(j.$feature_flag_original_response=ce(L.original_variant)?L.original_enabled:L.original_variant),!(L==null||(M=L.metadata)===null||M===void 0)&&M.original_payload&&(j.$feature_flag_original_payload=L==null||(T=L.metadata)===null||T===void 0?void 0:T.original_payload),D.length&&(j.$feature_flag_error=D.join(",")),this.Vd(j)}else d&&this.At({[Pa]:f,[yf]:d});return r?{key:t,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:Y8(i)}:void 0}Vd(t){try{var e;(e=this.wo)===null||e===void 0||e.capture("$feature_flag_called",t)}catch(n){this.$.error("Failed to capture feature flag call",n)}}getRemoteConfigPayload(t,e){this.Gd(t,e)}Gd(t,e){var n=this;return qt(function*(){const r=n.wo;if(!r)return;const s={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},i=n.jd();i.length&&(s.evaluation_contexts=i);const o=n.Bd();let l;ce(o)||(s.flag_keys=o);try{var u;const d=(u=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:s,compression:n.Rr.compression,sentAt:"body",timeoutMs:n.Rr.requestTimeoutMs})).json)===null||u===void 0?void 0:u.featureFlagPayloads;l=(d==null?void 0:d[t])||void 0}catch(d){return void n.$.error("Remote config feature flag request failed",d)}try{e(l)}catch(d){n.$.error("Remote config feature flag callback failed",d)}})()}isFeatureEnabled(t,e={}){if(e.fresh&&!this.ld)return e.defaultValue;if(!(this.nd||this.getFlags()&&this.getFlags().length>0))return this.$.warn('isFeatureEnabled for key "'+t+hy),e.defaultValue;const n=this.getFeatureFlag(t,e);return ce(n)?e.defaultValue:!!n}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(e=>e!==t)}receivedFeatureFlags(t,e,n){this.Hd(t,e,n)}Hd(t,e,n){if(!this.wo)return;this.nd=!0;const r=((s,i={},o={},l={},u,d=tk)=>{const f=((C,R)=>{const A=C.flags;if(A){const I=Object.fromEntries(Object.keys(A).map(T=>{var L;return[T,(L=A[T].variant)!==null&&L!==void 0?L:A[T].enabled]})),M=Object.fromEntries(Object.keys(A).filter(T=>A[T].enabled).filter(T=>{var L;return!ce((L=A[T].metadata)===null||L===void 0?void 0:L.payload)}).map(T=>{var L;return[T,(L=A[T].metadata)===null||L===void 0?void 0:L.payload]}));return V(V({},C),{},{featureFlags:I,featureFlagPayloads:M})}return C.featureFlags&&R.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),C})(s,d),p=f.flags,g=f.featureFlags,v=f.featureFlagPayloads;if(!g)return;const w=s.requestId,_=s.evaluatedAt;if(Ue(g)){d.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");const C={};if(g)for(let R=0;g.length>R;R++)C[g[R]]=!0;return{[ko]:g,[hi]:C,[Tf]:!1}}let x=g,b=v,E=p;if(u!=null&&u.partialResponse){const C=Object.keys(x),R=b||{};x=V(V({},i),x),b=V(V({},o),R),C.forEach(A=>{A in R||b==null||delete b[A]}),E=V(V({},l),E)}else if(s.errorsWhileComputingFlags)if(p){const C=new Set(Object.keys(p).filter(A=>{var I;return!(!((I=p[A])===null||I===void 0)&&I.failed)}));x=V(V({},i),Object.fromEntries(Object.entries(x).filter(([A])=>C.has(A))));const R=Object.fromEntries(Object.entries(b||{}).filter(([A])=>C.has(A)));b=V(V({},o),R),C.forEach(A=>{A in R||b==null||delete b[A]}),E=V(V({},l),Object.fromEntries(Object.entries(E||{}).filter(([A])=>C.has(A))))}else x=V(V({},i),x),b=V(V({},o),b),E=V(V({},l),E);return V(V({[ko]:Object.keys(ik(x)),[hi]:x||{},[ka]:b||{},[Ql]:E||{},[Tf]:s.minimalFlagCalledEvents===!0},w?{[Jl]:w}:{}),_?{[Oa]:_}:{})})(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this.$);if(r)if((n==null?void 0:n.persist)===!1){const s=!ce(this.wo.kv.get(hi));this.Od=r,s||this.At(r)}else this.Td(),this.Nd(r,t,!!(n!=null&&n.partialResponse)),this.At(r);else e&&this.Dd();e||(this.ud=!1),this.Md(e)}override(t,e=!1){this.$.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.Zd(t)}Zd(t){if(this.wo){if(t===!1)return this.Lt([Ri,Nl]),this.Md(),void Sl.info("All overrides cleared");if(Ue(t))return this.At({[Ri]:sk(t)}),this.Md(),void Sl.info("Flag overrides set",{flags:t});if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var e;const n=t;this.Xc=!!((e=n.suppressWarning)!==null&&e!==void 0&&e);const r={},s=n.flags,i=n.payloads;return s&&(r[Ri]=Ue(s)?sk(s):s),i&&(r[Nl]=i),Object.keys(r).length&&this.At(r),s===!1&&i===!1?this.Lt([Ri,Nl]):s===!1?this.Lt(Ri):i===!1&&this.Lt(Nl),this.Md(),s===!1?Sl.info("Flag overrides cleared"):s&&Sl.info("Flag overrides set",{flags:s}),void(i===!1?Sl.info("Payload overrides cleared"):i&&Sl.info("Payload overrides set",{payloads:i}))}if(t&&typeof t=="object")return this.At({[Ri]:t}),this.Md(),void Sl.info("Flag overrides set",{flags:t});this.$.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.$.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.nd){const{flags:e,flagVariants:n}=this.Qd();try{t(e,n)}catch(r){this.$.error("Error while running feature flags callback",r)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var r;const s=(this.Fd("$early_access_features")||[]).find(d=>d.flagKey===t),i={[`$feature_enrollment/${t}`]:e},o={$feature_flag:t,$feature_enrollment:e,$set:i};s&&(o.$early_access_feature_name=s.name),n&&(o.$feature_enrollment_stage=n);const l=V(V({},this.getFlagVariants()),{},{[t]:e});(r=this._instance)===null||r===void 0||(r=r.persistence)===null||r===void 0||r.markCrossTabFeatureFlagChanges({$active_feature_flags:[t],$enabled_feature_flags:[t],$stored_person_properties:Object.keys(i)}),this.At({[ko]:Object.keys(ik(l)),[hi]:l,[Ea]:V(V({},this.Fd("$stored_person_properties")||{}),i)}),this.Md();try{var u;(u=this.wo)===null||u===void 0||u.capture("$feature_enrollment_update",o)}catch(d){this.$.error("Failed to capture early access feature enrollment",d)}}getEarlyAccessFeatures(t,e=!1,n){const r=this.Fd(W_);!r||e?this.Jd(t,n):t(r)}Jd(t,e){var n=this;return qt(function*(){const r=n.wo;if(!r)return;const s=e?`&${e.map(o=>`stage=${o}`).join("&")}`:"";let i;try{const o=yield r.sendRequest(`/api/early_access_features/?token=${r.projectToken}${s}`,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;i=o.json.earlyAccessFeatures,n.At({[W_]:i})}catch(o){return void n.$.error("Early access feature request failed",o)}try{t(i)}catch(o){n.$.error("Early access feature callback failed",o)}})()}Qd(){const t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter(n=>e[n]),flagVariants:Object.keys(e).filter(n=>e[n]).reduce((n,r)=>(n[r]=e[r],n),{})}}Md(t){this.Id();const{flags:e,flagVariants:n}=this.Qd();this.featureFlagEventHandlers.forEach(r=>{try{r(e,n,{errorsLoading:t})}catch(s){this.$.error("Error while running feature flags callback",s)}})}setPersonPropertiesForFlags(t,e=!0){this.Kd(t,e)}Kd(t,e=!0){const n=this.Fd("$stored_person_properties")||{},r=(t==null?void 0:t.$set)||(t!=null&&t.$set_once?{}:t),s=t==null?void 0:t.$set_once,i={};if(s)for(const o in s)({}).hasOwnProperty.call(s,o)&&(o in n||(i[o]=s[o]));this.At({[Ea]:V(V(V({},n),i),r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e=!0){const n=V({},this.Fd("$stored_person_properties")||{});t.forEach(r=>{delete n[r]}),this.At({[Ea]:n}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t=!0){this.Lt(Ea),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e=!0){const n=this.Fd("$stored_group_properties")||{},r=V({},n);for(const s of Object.keys(t))r[s]=V(V({},n[s]),t[s]);this.At({[Ca]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){const e=this.Fd("$stored_group_properties")||{};this.At({[Ca]:V(V({},e),{},{[t]:{}})})}else this.Lt(Ca)}reset(){this.rd++,this.ad=!1,this.Yc={},this.td={},this.Od=void 0,this.nd=!1,this.od=!1,this.ld=!1,this.$anon_distinct_id=void 0,this.Ad(),this.Xc=!1,this.hd=0}}},FF={sessionRecording:class{get Rr(){return this._instance.config}get Ml(){return this._instance.persistence}get started(){var t;return!!(!((t=this.Xd)===null||t===void 0)&&t.isStarted)}get status(){var t,e;return this.Yd==="awaiting_config"||this.Yd==="missing_config"?this.Yd:(t=(e=this.Xd)===null||e===void 0?void 0:e.status)!==null&&t!==void 0?t:this.Yd}constructor(t){if(this._instance=t,this._forceAllowLocalhostNetworkCapture=!1,this.Yd=uy,this.tv=void 0,this.ev=!1,this.Xe=(()=>{var e,n;if(!(ue!=null&&ue.visibilityState)||ue.visibilityState==="visible")return!0;const r=J==null||(e=J.performance)===null||e===void 0||(n=e.getEntriesByType)===null||n===void 0?void 0:n.call(e,"visibility-state");return!(r!=null&&r.length)||r.some(s=>s.name==="visible")})(),this.ln=()=>{var e,n;(ue==null?void 0:ue.visibilityState)==="visible"&&(this.Xe=!0,(e=this.Xd)===null||e===void 0||(n=e.setDocumentWasEverVisible)===null||n===void 0||n.call(e,!0))},!this._instance.sessionManager)throw uo.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if(this.Rr.cookieless_mode==="always")throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');ue!=null&&ue.addEventListener&&Et(ue,"visibilitychange",this.ln)}initialize(){this.startIfEnabledOrStop()}dispose({discardBufferedEvents:t=!1}={}){var e;this.ev=!0,ue==null||(e=ue.removeEventListener)===null||e===void 0||e.call(ue,"visibilitychange",this.ln),t?this.iv(!0):this.stopRecording()}get nv(){var t;const e=!!(!((t=this._instance.get_property("$session_recording_remote_config"))===null||t===void 0)&&t.enabled),n=!this.Rr.disable_session_recording,r=this.Rr.disable_session_recording||this._instance.consent.isOptedOut();return J&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(this.ev||this.nv&&(!((e=this.Xd)===null||e===void 0)&&e.isStarted))return;const n=!ce(Object.assign)&&!ce(Array.from);this.nv&&n?(this.sv(t),uo.info("starting")):(this.Yd=uy,this.stopRecording())}sv(t){var e,n;if(this.nv)if(this.Yd!=="awaiting_config"&&this.Yd!=="missing_config"&&(this.Yd=KS),($e==null||(e=$e.__PosthogExtensions__)===null||e===void 0||(e=e.rrweb)===null||e===void 0?void 0:e.record)&&((n=$e.__PosthogExtensions__)===null||n===void 0?void 0:n.initSessionRecording))this.rv(t);else{var r,s;const i=this._instance.sessionManager;(r=$e.__PosthogExtensions__)===null||r===void 0||(s=r.loadExternalDependency)===null||s===void 0||s.call(r,this._instance,this.ov,o=>{if(!this.ev&&this.nv&&this._instance.sessionManager===i)return o?(this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0}),uo.error("could not load recorder",o)):void this.rv(t);this.Yd="disabled"})}}stopRecording(){var t,e;(t=this.tv)===null||t===void 0||t.call(this),this.tv=void 0,(e=this.Xd)===null||e===void 0||e.stop()}iv(t=!1){var e,n;(e=this.tv)===null||e===void 0||e.call(this),this.tv=void 0,(n=this.Xd)===null||n===void 0||n.discard({discardProducerEvents:t})}av(){var t,e;(t=this.Ml)===null||t===void 0||t.unregister("$session_is_sampled"),(e=this.Ml)===null||e===void 0||e.unregister("$replay_sample_rate")}lv(t,e){if(nt(t))return null;const n=pn(t)?t:parseFloat(t);return typeof(r=n)!="number"||!Number.isFinite(r)||0>r||r>1?(uo.warn(`${e} must be between 0 and 1. Ignoring invalid value:`,t),null):n;var r}uv(t){if(this.Ml){var e,n;const r=this.Ml,s=()=>{var i;const o=t.sessionRecording===!1?void 0:t.sessionRecording,l=this.lv((i=this.Rr.session_recording)===null||i===void 0?void 0:i.sampleRate,"session_recording.sampleRate"),u=this.lv(o==null?void 0:o.sampleRate,"remote config sampleRate"),d=l??u;nt(d)&&this.av();const f=o==null?void 0:o.minimumDurationMilliseconds;r.register({[Af]:V(V({cache_timestamp:Date.now(),enabled:!!o},o),{},{networkPayloadCapture:V({capturePerformance:t.capturePerformance},o==null?void 0:o.networkPayloadCapture),canvasRecording:{enabled:o==null?void 0:o.recordCanvas,fps:o==null?void 0:o.canvasFps,quality:o==null?void 0:o.canvasQuality},sampleRate:d,minimumDurationMilliseconds:ce(f)?null:f,endpoint:o==null?void 0:o.endpoint,triggerMatchType:o==null?void 0:o.triggerMatchType,masking:o==null?void 0:o.masking,urlTriggers:o==null?void 0:o.urlTriggers,version:o==null?void 0:o.version,triggerGroups:o==null?void 0:o.triggerGroups})})};s(),(e=this.tv)===null||e===void 0||e.call(this),this.tv=(n=this._instance.sessionManager)===null||n===void 0?void 0:n.onSessionId(s)}}onRemoteConfig(t){const e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?e.sessionRecording===!1?(this.uv(e),void this.iv()):(this.uv(e),void this.startIfEnabledOrStop()):(this.Yd==="awaiting_config"&&(this.Yd="missing_config",this._instance.register_for_session({[L5]:!0}),uo.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e="log"){var n;!((n=this.Xd)===null||n===void 0)&&n.log?this.Xd.log(t,e):uo.warn("log called before recorder was ready")}get ov(){var t,e;const n=(t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0?void 0:t.get_property(Af);return(n==null||(e=n.scriptConfig)===null||e===void 0?void 0:e.script)||"lazy-recorder"}hv(){const t=this._instance.get_property(Af);if(!t)return!1;let e;try{e=typeof t=="object"?t:JSON.parse(t)}catch(n){return uo.warn("persisted remote config for session recording is invalid and will be ignored",n),!1}return!nt(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}rv(t){var e,n,r;if(!this.ev&&this.nv&&this._instance.sessionManager){if(!(!((e=$e.__PosthogExtensions__)===null||e===void 0)&&e.initSessionRecording))return uo.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[O5]:!0});var s;if(this.Xd||(this.Xd=(s=$e.__PosthogExtensions__)===null||s===void 0?void 0:s.initSessionRecording(this._instance,this.Xe),this.Xd._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.hv())return this.Yd==="missing_config"||this.Yd==="awaiting_config"?void 0:(this.Yd="awaiting_config",uo.info("persisted remote config is stale, requesting fresh config before starting"),void new aR(this._instance).load());this.Yd=KS,(n=(r=this.Xd).setDocumentWasEverVisible)===null||n===void 0||n.call(r,this.Xe),this.Xd.start(t)}else this.Yd=uy}onRRwebEmit(t){var e,n;(e=this.Xd)===null||e===void 0||(n=e.onRRwebEmit)===null||n===void 0||n.call(e,t)}overrideLinkedFlag(){var t,e;this.Xd||(e=this.Ml)===null||e===void 0||e.register({$replay_override_linked_flag:!0}),(t=this.Xd)===null||t===void 0||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Xd||(e=this.Ml)===null||e===void 0||e.register({$replay_override_sampling:!0}),(t=this.Xd)===null||t===void 0||t.overrideSampling()}overrideTrigger(t){var e,n;this.Xd||(n=this.Ml)===null||n===void 0||n.register({[t==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(e=this.Xd)===null||e===void 0||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.Xd)===null||t===void 0?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var n;return!!(!((n=this.Xd)===null||n===void 0)&&n.tryAddCustomEvent(t,e))}flushBeforeIdentityReset(){var t,e;(t=this.Xd)===null||t===void 0||(e=t.flushBeforeIdentityReset)===null||e===void 0||e.call(t)}}},VF={autocapture:class extends hF{constructor(t){super(new pF(t)),this.instance=t}},historyAutocapture:class{constructor(t){this.dv=!1,this._instance=t,this.vv=this.fv()}initialize(){this.startIfEnabled()}get isEnabled(){const t=this.pv();return!!(t.path||t.search||this.gv(t))}startIfEnabled(){this.isEnabled&&(ve.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.vv=this.fv(),this.startIfEnabled()}stop(){this.mv&&this.mv(),this.mv=void 0,this.yv&&this.yv(),this.yv=void 0,ve.info("History API monitoring stopped")}monitorHistoryChanges(){J&&J.history&&(this.bv("pushState"),this.bv("replaceState"),this._v(),this.gv()&&this.wv())}bv(t){var e;if(!J||!((e=J.history[t])===null||e===void 0)&&e.__posthog_wrapped__)return;const n=this;sh(J.history,t,r=>function(s,i,o){var l;n.Sv(o)&&n.xv(),r.call(this,s,i,o),n.Cv(t,!n.dv&&(J==null||(l=J.event)===null||l===void 0?void 0:l.type)!=="popstate")})}fv(){const t=J==null?void 0:J.location;if(t!=null&&t.pathname)return{pathname:t.pathname,search:t.search,hash:t.hash}}pv(){const t=this._instance.config.capture_pageview;return t==="history_change"?{path:!0}:ut(t)?t:{}}gv(t=this.pv()){return!!t.hash&&!this._instance.config.disable_capture_url_hashes}$v(t){const e=this.pv(),n=this.vv;return!(!n||!(e.path&&t.pathname!==n.pathname||e.search&&t.search!==n.search||this.gv(e)&&t.hash!==n.hash))}Cv(t,e=!1){try{e||this.xv();const n=this.fv();if(!n)return;if(this.$v(n)){const r=()=>this._instance.capture(rx,{navigation_type:t});e?(this.Tv=r,Promise.resolve().then(()=>this.xv())):r()}this.vv=n}catch(n){ve.error(`Error capturing ${t} pageview`,n)}}Sv(t){var e,n;return!(nt(t)||!J)&&((e=Oo(String(t)))===null||e===void 0?void 0:e.href)!==((n=J.location)===null||n===void 0?void 0:n.href)}xv(){const t=this.Tv;if(t){this.Tv=void 0,this.dv=!0;try{t()}catch(e){ve.error("Error capturing deferred pageview",e)}finally{this.dv=!1}this.vv=this.fv()}}_v(){if(this.mv)return;const t=()=>{this.Cv("popstate")};Et(J,"popstate",t),this.mv=()=>{J&&J.removeEventListener("popstate",t)}}wv(){if(this.yv)return;const t=()=>{this.Cv("hashchange")};Et(J,"hashchange",t),this.yv=()=>{J&&J.removeEventListener("hashchange",t)}}},heatmaps:class{get Rr(){return this.instance.config}constructor(t){var e;this.Iv=!1,this.xo=!1,this.Mv=null,this.instance=t,this.Iv=!!(!((e=this.instance.persistence)===null||e===void 0)&&e.props[z_]),this.rageclicks=new IR(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){let t=5e3;return ut(this.Rr.capture_heatmaps)&&this.Rr.capture_heatmaps.flush_interval_milliseconds&&(t=this.Rr.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return nt(this.Rr.capture_heatmaps)?nt(this.Rr.enable_heatmaps)?this.Iv:this.Rr.enable_heatmaps:this.Rr.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.xo)return;yF.info("starting..."),this.Ev(),this.ln()}else{var t;clearInterval((t=this.Mv)!==null&&t!==void 0?t:void 0),this.Pv(),this.getAndClearBuffer()}}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if(!("heatmaps"in e))return;const n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[z_]:n}),this.Iv=n,this.startIfEnabled()}getAndClearBuffer(){const t=this.Rt;return this.Rt=void 0,t}Rv(t){dy(t.originalEvent)&&this.Tr(t.originalEvent,"deadclick")}ln(){this.Mv&&clearInterval(this.Mv),this.Mv=(ue==null?void 0:ue.visibilityState)==="visible"?setInterval(this.bl.bind(this),this.flushIntervalMilliseconds):null}Ev(){J&&ue&&(this.Av=this.bl.bind(this),Et(J,Am,this.Av),this.Fv=t=>this.Tr(t||(J==null?void 0:J.event)),Et(ue,"click",this.Fv,{capture:!0}),this.Ov=t=>this.Dv(t||(J==null?void 0:J.event)),Et(ue,"mousemove",this.Ov,{capture:!0}),this.Lv=new SS(this.instance,xj,this.Rv.bind(this)),this.Lv.startIfEnabledOrStop(),this.Nv=this.ln.bind(this),Et(ue,Jf,this.Nv),this.xo=!0)}Pv(){var t;J&&ue&&(this.Av&&J.removeEventListener(Am,this.Av),this.Fv&&ue.removeEventListener("click",this.Fv,{capture:!0}),this.Ov&&ue.removeEventListener("mousemove",this.Ov,{capture:!0}),this.Nv&&ue.removeEventListener(Jf,this.Nv),clearTimeout(this.qv),(t=this.Lv)===null||t===void 0||t.stop(),this.xo=!1)}jv(t,e){const n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),i=(function(o,l,u){let d=o;for(;d&&Bi(d)&&!fr(d,"body");){if(d===u)return!1;let v;try{var f,p,g;v=(f=(p=(g=d.ownerDocument)===null||g===void 0?void 0:g.defaultView)!==null&&p!==void 0?p:J)===null||f===void 0?void 0:f.getComputedStyle(d).position}catch{return!1}if(Ze(l,v))return!0;d=B5(d)}return!1})(Mf(t),["fixed","sticky"],s);return{x:t.clientX+(i?0:r),y:t.clientY+(i?0:n),target_fixed:i,type:e}}Tr(t,e="click"){var n;if(hS(t.target)||!dy(t))return;const r=this.jv(t,e);!((n=this.rageclicks)===null||n===void 0)&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&Z5(Mf(t),this.instance.config.rageclick)&&this.Zs(V(V({},r),{},{type:"rageclick"})),this.Zs(r)}Dv(t){!hS(t.target)&&dy(t)&&(clearTimeout(this.qv),this.qv=setTimeout(()=>{this.Zs(this.jv(t,"mousemove"))},500))}Zs(t){if(!J)return;const e=this.Rr.disable_capture_url_hashes?Fa(J.location.href):J.location.href,n=this.Rr.custom_personal_data_properties,r=this.Rr.mask_personal_data_properties?[...Wu,...n||[]]:[],s=nh(e,r,rh);this.Rt=this.Rt||{},this.Rt[s]||(this.Rt[s]=[]),this.Rt[s].push(t)}bl(){this.Rt&&!Wr(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:SS,webVitalsAutocapture:class{constructor(t){var e;this._instance=t,this.Iv=!1,this.xo=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Bv=()=>{clearTimeout(this.Hv),this.Hv=void 0,this.Rt.metrics.length!==0&&(this._instance.capture("$web_vitals",V({$current_url:this.Rt.url},this.Rt.metrics.reduce((n,r)=>V(V({},n),{},{[`$web_vitals_${r.name}_event`]:V({},r),[`$web_vitals_${r.name}_value`]:r.value}),{}))),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.zv=n=>{var r;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},nt(n==null?void 0:n.name)||nt(n==null?void 0:n.value))return void bl.error("Invalid metric received",n);const s=typeof n.navigationURL=="string"?n.navigationURL:void 0,i=this.Uv(s);if(ce(i))return;const o=pn(n.navigationId)||typeof n.navigationId=="string"?`navigation:${n.navigationId}`:`url:${i}`;if(this.Wv&&n.value>=this.Wv)return void bl.error("Ignoring metric with value >= "+this.Wv,n);this.Rt.navigationKey!==o&&(this.Bv(),this.Hv=setTimeout(this.Bv,this.flushToCaptureTimeoutMs)),ce(this.Rt.navigationKey)&&(this.Rt.navigationKey=o,this.Rt.url=i),this.Rt.firstMetricTimestamp=ce(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;const l=(r=this._instance.sessionManager)===null||r===void 0?void 0:r.checkAndGetSessionAndWindowId(!0),u=V(V(V({},n),s?{navigationURL:i}:{}),{},{$current_url:i,timestamp:Date.now()});if(delete u.entries,ut(n.attribution)&&this.attributionMetrics.indexOf(n.name)>-1){const d={};for(const f of vF){const p=f==="url"&&typeof n.attribution[f]=="string"?this.Uv(n.attribution[f]):n.attribution[f];ce(p)||(d[f]=p)}u.attribution=d}else delete u.attribution;ce(l)||(u.$session_id=l.sessionId,u.$window_id=l.windowId),this.Rt.metrics.push(u),this.Rt.metrics.length===this.allowedMetrics.length&&this.Bv()},this.Vv=()=>{if(this.xo)return;let n,r,s,i,o=!1;const l=$e.__PosthogExtensions__,u=l==null?void 0:l.postHogWebVitalsCallbacksByFlavor,d=(u==null?void 0:u[this.Gv])||(this.Gv==="web-vitals"&&ce(u)?l==null?void 0:l.postHogWebVitalsCallbacks:void 0);if(!ce(d)){const g=d.withoutAttribution,v=this.attributionMetrics;o=!ce(g),n=v.indexOf("LCP")>-1?d.onLCP:(g==null?void 0:g.onLCP)||d.onLCP,r=v.indexOf("CLS")>-1?d.onCLS:(g==null?void 0:g.onCLS)||d.onCLS,s=v.indexOf("FCP")>-1?d.onFCP:(g==null?void 0:g.onFCP)||d.onFCP,i=v.indexOf("INP")>-1?d.onINP:(g==null?void 0:g.onINP)||d.onINP}if(!(n&&r&&s&&i))return void bl.error("web vitals callbacks not loaded - not starting");const f={reportSoftNavs:this.useSoftNavs},p=o&&this.attributionMetrics.indexOf("INP")>-1?V(V({},f),{},{includeProcessedEventEntries:!1}):f;this.allowedMetrics.indexOf("LCP")>-1&&n(this.zv.bind(this),f),this.allowedMetrics.indexOf("CLS")>-1&&r(this.zv.bind(this),f),this.allowedMetrics.indexOf("FCP")>-1&&s(this.zv.bind(this),f),this.allowedMetrics.indexOf("INP")>-1&&i(this.zv.bind(this),p),this.xo=!0},this.Iv=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[Z_]),this.startIfEnabled()}get Zv(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e;const n=ut(this.Zv)?(t=this.Zv)===null||t===void 0?void 0:t.web_vitals_allowed_metrics:void 0;return nt(n)?((e=this._instance.persistence)===null||e===void 0?void 0:e.props.$web_vitals_allowed_metrics)||GS:n}get flushToCaptureTimeoutMs(){return(ut(this.Zv)?this.Zv.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){const t=ut(this.Zv)?this.Zv.web_vitals_attribution:void 0;return Or(t)?t?GS:[]:Ue(t)?t:gF}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){const t=ut(this.Zv)?this.Zv.__preview_web_vitals_soft_navs:void 0;return t!=null&&t}get Wv(){const t=ut(this.Zv)&&pn(this.Zv.__web_vitals_max_value)?this.Zv.__web_vitals_max_value:qS;return t>0&&6e4>=t?qS:t}get isEnabled(){const t=sn==null?void 0:sn.protocol;if(t!=="http:"&&t!=="https:")return bl.info("Web Vitals are disabled on non-http/https protocols"),!1;const e=ut(this.Zv)?this.Zv.web_vitals:Or(this.Zv)?this.Zv:void 0;return Or(e)?e:this.Iv}startIfEnabled(){this.isEnabled&&!this.xo&&(bl.info("enabled, starting..."),this.zo(this.Vv))}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if(!("capturePerformance"in e))return;const n=ut(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=ut(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Z_]:n}),this._instance.persistence.register({[b5]:r})),this.Iv=n,this.startIfEnabled()}get Gv(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}zo(t){var e;const n=$e.__PosthogExtensions__,r=this.Gv,s=n==null?void 0:n.postHogWebVitalsCallbacksByFlavor;s!=null&&s[r]||r==="web-vitals"&&ce(s)&&(n!=null&&n.postHogWebVitalsCallbacks)?t():n==null||(e=n.loadExternalDependency)===null||e===void 0||e.call(n,this._instance,r,i=>{i?bl.error("failed to load script",i):t()})}Uv(t){const e=t||(J==null?void 0:J.location.href);if(!e)return void bl.error("Could not determine current URL");const n=this._instance.config.disable_capture_url_hashes?Fa(e):e,r=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...Wu,...r||[]]:[];return nh(n,s,rh)}}},HF={exceptionObserver:class{constructor(t){var e;this.Vv=()=>{var n;if(!J||!this.isEnabled||!(!((n=$e.__PosthogExtensions__)===null||n===void 0)&&n.errorWrappingFunctions))return;const r=$e.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=$e.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=$e.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Qv&&this.Rr.capture_unhandled_errors&&(this.Qv=r(this.captureException.bind(this))),!this.Jv&&this.Rr.capture_unhandled_rejections&&(this.Jv=s(this.captureException.bind(this))),!this.Kv&&this.Rr.capture_console_errors&&(this.Kv=i(this.captureException.bind(this)))}catch(o){df.error("failed to start",o),this.Xv()}},this._instance=t,this.Yv=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[B_]),this.wt=new L7(V(V({},(function(n={}){var r,s,i,o;return{refillRate:(r=(s=n.exceptionRateLimiterRefillRate)!==null&&s!==void 0?s:n.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(i=(o=n.exceptionRateLimiterBucketSize)!==null&&o!==void 0?o:n.__exceptionRateLimiterBucketSize)!==null&&i!==void 0?i:10}})(this._instance.config.error_tracking)),{},{refillInterval:1e4,$:df})),this.Rr=this.tf(),this.startIfEnabledOrStop()}tf(){const t=this._instance.config.capture_exceptions;let e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return ut(t)?e=V(V({},e),t):(ce(t)?this.Yv:t)&&(e=V(V({},e),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Rr.capture_console_errors||this.Rr.capture_unhandled_errors||this.Rr.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(df.info("enabled"),this.Xv(),this.zo(this.Vv)):this.Xv()}zo(t){var e,n,r;!((e=$e.__PosthogExtensions__)===null||e===void 0)&&e.errorWrappingFunctions?t():(n=$e.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"exception-autocapture",s=>{if(s)return df.error("failed to load script",s);t()})}Xv(){var t,e,n;(t=this.Qv)===null||t===void 0||t.call(this),this.Qv=void 0,(e=this.Jv)===null||e===void 0||e.call(this),this.Jv=void 0,(n=this.Kv)===null||n===void 0||n.call(this),this.Kv=void 0}onRemoteConfig(t){if(!t.ok)return;const e=t.config;"autocaptureExceptions"in e&&(this.Yv=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[B_]:this.Yv}),this.Rr=this.tf(),this.startIfEnabledOrStop())}onConfigChange(){this.Rr=this.tf()}captureException(t){try{var e,n,r;const s=(e=t==null||(n=t.$exception_list)===null||n===void 0||(n=n[0])===null||n===void 0?void 0:n.type)!==null&&e!==void 0?e:"Exception";if(this.wt.consumeRateLimit(s))return void df.info("Skipping exception capture because of client rate limiting.",{exception:s});(r=this._instance.exceptions)===null||r===void 0||r.sendExceptionEvent(t)}catch{}}},exceptions:class{constructor(t){var e,n;this.ef=[],this.if=new W7([new a$,new g$,new c$,new l$,new p$,new h$,new d$,new m$],(function(r,...s){return(i,o=0)=>{const l=[],u=i.split(`
|
|
19
|
-
`),d=Math.min(u.length,o+1e3),f=[];for(let v=o;d>v;v++){const w=u[v];if(w.length>1024)continue;const _=K8.test(w)?w.replace(K8,"$1"):w;if(!_.match(/\S*Error: /)){for(const x of s){const b=x(_,r);if(b){l.push(b);const E=r$(l);if(E){for(let C=f.length-1;C>=0;C--){const R=f[C];if(E.start>=R.start+R.length)break;f.pop()}f.push(E)}break}}if(i$(l,f)>=50)break}}const p=[...f].sort((v,w)=>w.start-v.start),g=p[p.length-1];if(g){const v=s5(l,g);l.splice(g.start-v,v);for(const w of p)w.start-=v}for(const v of p)s$(l,v);return f.some(v=>v.start===0&&l.length===v.length)&&(function(v){const w=v.map(x=>`${x.function}|${x.filename}|${x.lineno}|${x.colno}|${x.module}`);let _=0;for(let x=1;w.length>x;x++)o$(w,x,_)&&(_=x);v.push(...v.splice(0,_))})(l),(function(v){if(!v.length)return[];const w=Array.from(v);return w.reverse(),w.slice(0,50).map(_=>{return V(V({},_),{},{filename:_.filename||(x=w,x[x.length-1]||{}).filename,function:_.function||"?"});var x})})(l)}})("web:javascript",J7,n$)),this._instance=t,this.ef=(e=(n=this._instance.persistence)===null||n===void 0?void 0:n.get_property("$error_tracking_suppression_rules"))!==null&&e!==void 0?e:[],this.nf=km(this.sf()),this.rf=new y$(this.nf)}onConfigChange(){this.nf=km(this.sf()),this.rf.setConfig(this.nf)}onRemoteConfig(t){var e,n,r;if(!t.ok)return;const s=t.config;if(!("errorTracking"in s))return;const i=(e=(n=s.errorTracking)===null||n===void 0?void 0:n.suppressionRules)!==null&&e!==void 0?e:[],o=(r=s.errorTracking)===null||r===void 0?void 0:r.captureExtensionExceptions;this.ef=i,this._instance.persistence&&this._instance.persistence.register({[w5]:this.ef,[U_]:o})}get af(){var t;const e=!!this._instance.get_property(U_),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.if.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.nf.enabled)try{if(!it(t)||t.trim().length===0)return void ii.warn("Ignoring exception step because message must be a non-empty string");const{sanitizedProperties:n,droppedKeys:r}=(function(s){if(!s)return{sanitizedProperties:{},droppedKeys:[]};const i=[];return{sanitizedProperties:Object.keys(s).reduce((o,l)=>v$.has(l)?(i.push(l),o):(o[l]=s[l],o),{}),droppedKeys:i}})(this.lf(e));r.length>0&&ii.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.rf.add(V({[bm]:t,[Sm]:new Date().toISOString()},n))}catch(n){ii.error("Failed to add exception step. Ignoring breadcrumb.",n)}}sendExceptionEvent(t){try{const e=t.$exception_list;if(this.uf(e)){if(this.hf(e))return this.cf("Exception dropped: matched a suppression rule"),void ii.info("Skipping exception capture because a suppression rule matched");if(!this.af&&this.df(e))return this.cf("Exception dropped: thrown by a browser extension"),void ii.info("Skipping exception capture because it was thrown by an extension");if(!this.af&&this.vf(e))return this.cf("Exception dropped: thrown by an injected browser script"),void ii.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ff(e))return this.cf("Exception dropped: thrown by the PostHog SDK"),void ii.info("Skipping exception capture because it was thrown by the PostHog SDK")}const n=this.nf.enabled&&nt(t.$exception_steps)?this.pf(t):t,r=(function(){const s=globalThis._posthogReleaseId;return typeof s=="string"&&s.length>0?s:void 0})();r&&(n.$release_id=r);try{const s=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",fh:!0});return s&&this.rf.clear(),s}catch(s){return ok(s)||ii.error("Failed to capture exception event. Dropping this exception.",s),void this.rf.clear()}}catch(e){return void(ok(e)||ii.error("Failed to process exception event. Ignoring this exception.",e))}}pf(t){try{const e=this.rf.getAttachable();return e.length===0?t:V(V({},t),{},{$exception_steps:e})}catch(e){return ii.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}cf(t){this.nf.enabled&&this.rf.add({[bm]:t,[Sm]:new Date().toISOString()})}lf(t){return ut(t)?V({},t):{}}sf(){var t,e;return(t=(e=this._instance.config.error_tracking)===null||e===void 0?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}hf(t){if(t.length===0)return!1;try{const e=t.reduce((n,{type:r,value:s})=>(it(r)&&r.length>0&&n.$exception_types.push(r),it(s)&&s.length>0&&n.$exception_values.push(s),n),{$exception_types:[],$exception_values:[]});return this.ef.some(n=>{const r=n.values.map(s=>{const i=PR[s.operator],o=e[s.key];if(!i||!o)return!1;const l=Ue(s.value)?s.value:[s.value];return l.length>0&&i(l,o)});return n.type==="OR"?r.some(Boolean):r.every(Boolean)})}catch(e){return ii.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}df(t){const e=t.flatMap(r=>{var s,i;return(s=(i=r.stacktrace)===null||i===void 0?void 0:i.frames)!==null&&s!==void 0?s:[]}),n=e.filter(({filename:r})=>!!r&&TF.some(s=>r.startsWith(s)));return n.length!==0&&(!n.every(({filename:r})=>!!r&&r.startsWith(a2))||t.some(({type:r,value:s})=>r==="NoResponse"||it(s)&&AF.some(({value:i,exact:o})=>o?s===i:s.includes(i)))&&!e.some(({in_app:r,filename:s})=>r&&!(s!=null&&s.startsWith(a2))))}vf(t){return t.some(({value:e})=>it(e)&&IF.some(n=>e.includes(n)))}ff(t){if(t.length>0){var e,n,r,s;const i=(e=(n=t[0].stacktrace)===null||n===void 0?void 0:n.frames)!==null&&e!==void 0?e:[],o=i[i.length-1];return(r=o==null||(s=o.filename)===null||s===void 0?void 0:s.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}uf(t){return!nt(t)&&Ue(t)}}},zF=V({productTours:class{get Ml(){return this._instance.persistence}constructor(t){this.gf=null,this.mf=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!t.ok)return;const e=t.config;if("productTours"in e){var n,r;if(this.Ml&&this.Ml.register({[ex]:!!e.productTours}),!fy(this._instance))return!this.gf&&nt((n=this.Ml)===null||n===void 0?void 0:n.props.ph_product_tours)||f0.info("product tours disabled; stopping and clearing cached tours"),(r=this.gf)===null||r===void 0||r.stop(),this.gf=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.gf&&fy(this._instance)&&this.zo(()=>this.yf())}zo(t){var e,n,r;!((e=$e.__PosthogExtensions__)===null||e===void 0)&&e.generateProductTours?t():(n=$e.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"product-tours",s=>{s?f0.error("Could not load product tours script",s):t()})}yf(){var t;!this.gf&&(!((t=$e.__PosthogExtensions__)===null||t===void 0)&&t.generateProductTours)&&(this.gf=$e.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e=!1){if(Ue(this.mf)&&!e)return void t(this.mf,{isLoaded:!0});const n=this.Ml;if(n){const r=n.props[G_];if(Ue(r)&&!e)return this.mf=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/product_tours/?token=${this._instance.config.token}`),method:"GET",timestampMode:"query",callback:r=>{if(!fy(this._instance))return void t([],{isLoaded:!0});const s=r.statusCode;if(s!==200||!r.json){const o=`Product Tours API could not be loaded, status: ${s}`;return s===0?r.error||f0.warn(o):f0.error(o),void t([],{isLoaded:!1,error:o})}const i=Ue(r.json.product_tours)?r.json.product_tours:[];this.mf=i,n&&n.register({[G_]:i}),t(i,{isLoaded:!0})}})}getActiveProductTours(t){nt(this.gf)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.gf.getActiveProductTours(t)}showProductTour(t){var e;(e=this.gf)===null||e===void 0||e.showTourById(t)}previewTour(t){this.gf?this.gf.previewTour(t):this.zo(()=>{var e;this.yf(),(e=this.gf)===null||e===void 0||e.previewTour(t)})}dismissProductTour(){var t;(t=this.gf)===null||t===void 0||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.gf)===null||t===void 0||t.nextStep()}previousStep(){var t;(t=this.gf)===null||t===void 0||t.previousStep()}clearCache(){var t;this.mf=null,(t=this.Ml)===null||t===void 0||t.unregister("ph_product_tours")}resetTour(t){var e;(e=this.gf)===null||e===void 0||e.resetTour(t)}resetAllTours(){var t;(t=this.gf)===null||t===void 0||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.gf)===null||e===void 0||e.cancelPendingTour(t)}}},kg),BF={siteApps:class{constructor(t){this._instance=t,this.bf=0,this._f=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}wf(t,e){if(!e)return;const n=this.globalsForEvent(e);this._f.push(n),this._f.length>1e3&&(this._f=this._f.slice(10))}get siteAppLoaders(){var t;return(t=$e._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(t=t[this._instance.config.token])===null||t===void 0?void 0:t.siteApps}initialize(){if(this.isEnabled){const t=this._instance._addCaptureHook(this.wf.bind(this));this.kf=()=>{t(),this._f=[],this.kf=void 0}}}globalsForEvent(t){var e,n,r,s,i,o,l;if(!t)throw new Error("Event payload is required");const u={},d=this._instance.get_property("$groups")||[],f=this._instance.get_property("$stored_group_properties")||{};for(const[v,w]of Object.entries(f))u[v]={id:d[v],type:v,properties:w};const{$set_once:p,$set:g}=t;return{event:V(V({},l5(t,_F)),{},{properties:V(V(V({},t.properties),g?{$set:V(V({},(e=(n=t.properties)===null||n===void 0?void 0:n.$set)!==null&&e!==void 0?e:{}),g)}:{}),p?{$set_once:V(V({},(r=(s=t.properties)===null||s===void 0?void 0:s.$set_once)!==null&&r!==void 0?r:{}),p)}:{}),elements_chain:(i=(o=t.properties)===null||o===void 0?void 0:o.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(l=t.properties)===null||l===void 0?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:u}}Sf(t){var e;const n=(e=t.tagName)===null||e===void 0?void 0:e.toLowerCase();return n==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(Si.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)||(Si.error("prepare_external_dependency_script returned null"),null):t}xf(){var t,e,n,r,s,i,o,l;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};const u=ue==null?void 0:ue.defaultView,d=u==null||(t=u.Node)===null||t===void 0?void 0:t.prototype;if(!u||!d)return()=>{};if(this.bf++,this.Cf)return this.$f();const f=[],p=this,g=new WeakSet,v=(x,b,E)=>{if(!(x!=null&&x[b]))return;const C=x[b];x[b]=E(C),f.push(()=>{x[b]=C})},w=x=>{if(g.has(x))return x;const b=p.Sf(x);return b&&g.add(b),b},_=x=>x.map(b=>typeof b=="string"?b:w(b)).filter(b=>!on(b));return v(d,"appendChild",x=>function(b){const E=w(b);return E?x.call(this,E):b}),v(d,"insertBefore",x=>function(b,E){const C=w(b);return C?x.call(this,C,E):b}),v(d,"replaceChild",x=>function(b,E){const C=w(b);return C?x.call(this,C,E):E}),[(e=u.Element)===null||e===void 0?void 0:e.prototype,(n=u.Document)===null||n===void 0?void 0:n.prototype,(r=u.DocumentFragment)===null||r===void 0?void 0:r.prototype].forEach(x=>{v(x,"append",b=>function(...E){return b.apply(this,_(E))}),v(x,"prepend",b=>function(...E){return b.apply(this,_(E))})}),[(s=u.Element)===null||s===void 0?void 0:s.prototype,(i=u.CharacterData)===null||i===void 0?void 0:i.prototype,(o=u.DocumentType)===null||o===void 0?void 0:o.prototype].forEach(x=>{v(x,"before",b=>function(...E){return b.apply(this,_(E))}),v(x,"after",b=>function(...E){return b.apply(this,_(E))}),v(x,"replaceWith",b=>function(...E){const C=_(E);return E.length&&!C.length?void 0:b.apply(this,C)})}),v((l=u.Element)===null||l===void 0?void 0:l.prototype,"insertAdjacentElement",x=>function(b,E){const C=w(E);return C?x.call(this,b,C):null}),this.Cf=()=>{f.forEach(x=>x()),this.Cf=void 0},this.$f()}$f(){let t=!1;return()=>{var e;t||(t=!0,this.bf--,this.bf===0&&((e=this.Cf)===null||e===void 0||e.call(this)))}}Tf(t,e=!0){const n=this.xf();try{const r=t(n);return e&&n(),r}catch(r){throw n(),r}}setupSiteApp(t){const e=this.apps[t.id],n=()=>{var i;!e.errored&&this._f.length&&(Si.info(`Processing ${this._f.length} events for site app with id ${t.id}`),this._f.forEach(o=>this.Tf(()=>{var l;return(l=e.processEvent)===null||l===void 0?void 0:l.call(e,o)})),e.processedBuffer=!0),Object.values(this.apps).every(o=>o.processedBuffer||o.errored)&&((i=this.kf)===null||i===void 0||i.call(this))};let r=!1;const s=i=>{e.errored=!i,e.loaded=!0,Si.info(`Site app with id ${t.id} ${i?"loaded":"errored"}`),r&&n()};try{const{processEvent:i}=this.Tf(o=>t.init({posthog:this._instance,callback(l){o(),s(l)}}),!1);i&&(e.processEvent=i),r=!0}catch(i){Si.error(YS+t.id,i),s(!1)}if(r&&e.loaded)try{n()}catch(i){Si.error(`Error while processing buffered events PostHog app with config id ${t.id}`,i),e.errored=!0}}If(){const t=this.siteAppLoaders||[];for(const e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(const e of t)this.setupSiteApp(e)}Mf(t){if(Object.keys(this.apps).length===0)return;const e=this.globalsForEvent(t);for(const n of Object.values(this.apps))try{this.Tf(()=>{var r;return(r=n.processEvent)===null||r===void 0?void 0:r.call(n,e)})}catch(r){Si.error(`Error while processing event ${t.event} for site app ${n.id}`,r)}}onRemoteConfig(t){var e,n,r;if(!((e=this.siteAppLoaders)===null||e===void 0)&&e.length)return this.isEnabled?(this.If(),void this._instance.on("eventCaptured",l=>this.Mf(l))):void Si.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.kf)===null||n===void 0||n.call(this),!t.ok)return;const s=t.config;if(!((r=s.siteApps)===null||r===void 0)&&r.length)if(this.isEnabled)for(const{id:l,url:u}of s.siteApps){var i,o;$e[`__$$ph_site_app_${l}`]=this._instance,(i=$e.__PosthogExtensions__)===null||i===void 0||(o=i.loadSiteApp)===null||o===void 0||o.call(i,this._instance,u,d=>{if(d)return Si.error(YS+l,d)})}else Si.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},UF={tracingHeaders:class{constructor(t){this._instance=t,this.Ef=void 0,this.Pf=void 0,this.Rf=void 0,this.Vv=()=>{const e=this.Af();var n,r;e?(ce(this.Ef)&&(this.Ef=(n=$e.__PosthogExtensions__)===null||n===void 0||(n=n.tracingHeadersPatchFns)===null||n===void 0?void 0:n._patchXHR(e,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),ce(this.Pf)&&(this.Pf=(r=$e.__PosthogExtensions__)===null||r===void 0||(r=r.tracingHeadersPatchFns)===null||r===void 0?void 0:r._patchFetch(e,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.Xv()}}initialize(){this.startIfEnabledOrStop()}zo(t){var e,n,r;!((e=$e.__PosthogExtensions__)===null||e===void 0)&&e.tracingHeadersPatchFns?t():(n=$e.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"tracing-headers",s=>{if(s)return mF.error("failed to load script",s);t()})}Ff(){var t,e;return(t=(e=this._instance.config.tracing_headers)!==null&&e!==void 0?e:this._instance.config.addTracingHeaders)!==null&&t!==void 0?t:this._instance.config.__add_tracing_headers}Af(){const t=this.Ff();return Ue(t)?(Ue(this.Rf)?this.Rf.splice(0,this.Rf.length,...t):this.Rf=[...t],t.length>0?this.Rf:void 0):(Ue(this.Rf)&&this.Rf.splice(0),this.Rf=t||void 0,this.Rf)}Xv(){var t,e;(t=this.Ef)===null||t===void 0||t.call(this),(e=this.Pf)===null||e===void 0||e.call(this),this.Ef=void 0,this.Pf=void 0}startIfEnabledOrStop(){this.Af()?this.zo(this.Vv):this.Xv()}}},ZF=V({surveys:class extends wF{constructor(t){var e;super(new EF(t),(e=t,{get projectToken(){return e.config.token},kv:new kF(e)})),this._instance=t}qh(t,e){const n=e.query?Fh(t,e.query):t;return new Promise(r=>{var s;this._instance._send_request({method:e.method,url:this._instance.requestRouter.endpointFor((s=e.target)!==null&&s!==void 0?s:"api",n),data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,timestampMode:e.sentAt,callback:r})})}}},kg),WF={toolbar:class{constructor(t){this.instance=t}Of(t){$e.ph_toolbar_state=t}Df(){var t;return(t=$e.ph_toolbar_state)!==null&&t!==void 0?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t=void 0,e=void 0,n=void 0){var r,s;if(Y_(this.instance.config)||!J||!ue)return!1;t=(r=t)!==null&&r!==void 0?r:J.location,n=(s=n)!==null&&s!==void 0?s:J.history;try{if(!e){try{J.localStorage.setItem("test","test"),J.localStorage.removeItem("test")}catch{return!1}e=J==null?void 0:J.localStorage}const i=CF||Im(t.hash,"__posthog")||Im(t.hash,"state");let o;const l=i?Z8(()=>JSON.parse(atob(decodeURIComponent(i))))||Z8(()=>JSON.parse(decodeURIComponent(i))):null;return l&&l.action==="ph_authorize"?(o=l,o.source="url",o&&Object.keys(o).length>0&&(l.desiredHash?t.hash=l.desiredHash:n?n.replaceState(n.state,"",t.pathname+t.search):t.hash="")):(o=JSON.parse(e.getItem(QS)||"{}"),o.source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token||(this.loadToolbar(o),0))}catch{return!1}}Lf(t){const e=$e.ph_load_toolbar||$e.ph_load_editor;!nt(e)&&Gn(e)?e(t,this.instance):JS.warn("No toolbar load function found")}loadToolbar(t){const e=!!(ue!=null&&ue.getElementById("__POSTHOG_TOOLBAR__"));if(!J||e)return!1;const n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=V(V({token:this.instance.config.token},t),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(J.localStorage.setItem(QS,JSON.stringify(V(V({},r),{},{source:void 0}))),this.Df()===2)this.Lf(r);else if(this.Df()===0){var s,i;this.Of(1),(s=$e.__PosthogExtensions__)===null||s===void 0||(i=s.loadExternalDependency)===null||i===void 0||i.call(s,this.instance,"toolbar",o=>{if(o)return JS.error("[Toolbar] Failed to load",o),void this.Of(0);this.Of(2),this.Lf(r)}),Et(J,"turbolinks:load",()=>{this.Of(0),this.loadToolbar(r)})}return!0}Nf(t){return this.loadToolbar(t)}maybeLoadEditor(t=void 0,e=void 0,n=void 0){return this.maybeLoadToolbar(t,e,n)}}},qF=V({experiments:class Rr{get Rr(){return this._instance.config}constructor(e){this._instance=e,this.getWebExperimentsAndEvaluateDisplayLogic=(n=!1)=>{this.getWebExperiments(r=>{Rr.qf("retrieved web experiments from the server"),this.jf=new Map,r.forEach(s=>{if(s.feature_flag_key){var i;this.jf&&(Rr.qf("setting flag key ",s.feature_flag_key," to web experiment ",s),(i=this.jf)===null||i===void 0||i.set(s.feature_flag_key,s));const o=this._instance.getFeatureFlag(s.feature_flag_key);it(o)&&s.variants[o]&&this.Bf(s.name,o,s.variants[o].transforms)}else if(s.variants)for(const o in s.variants){const l=s.variants[o];Rr.Hf(l,this._instance)&&this.Bf(s.name,o,l.transforms)}})},n)},this._instance.onFeatureFlags(n=>{this.onFeatureFlags(n)})}initialize(){}onFeatureFlags(e){if(this._is_bot())Rr.qf(ak);else if(!this.Rr.disable_web_experiments){if(nt(this.jf))return this.jf=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Rr.qf("applying feature flags",e),e.forEach(n=>{var r;if(this.jf&&(!((r=this.jf)===null||r===void 0)&&r.has(n))){var s;const i=this._instance.getFeatureFlag(n),o=(s=this.jf)===null||s===void 0?void 0:s.get(n);i&&(o!=null&&o.variants[i])&&this.Bf(o.name,i,o.variants[i].transforms)}})}}previewWebExperiment(){const e=Rr.getWindowLocation();if(e!=null&&e.search){const n=Zu(e==null?void 0:e.search,"__experiment_id"),r=Zu(e==null?void 0:e.search,"__experiment_variant");n&&r&&(Rr.qf(`previewing web experiments ${n} && ${r}`),this.getWebExperiments(s=>{this.zf(parseInt(n),r,s)},!1,!0))}}loadIfEnabled(){this.Rr.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this.Rr.disable_web_experiments&&!r)return e([]);const s=this._instance.get_property("$web_experiments");if(s&&!n)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.Rr.token}`),method:"GET",timestampMode:"query",callback:i=>e(i.statusCode===200&&i.json&&i.json.experiments||[])})}zf(e,n,r){const s=r.filter(i=>i.id===e);s&&s.length>0&&(Rr.qf(`Previewing web experiment [${s[0].name}] with variant [${n}]`),this.Bf(s[0].name,n,s[0].variants[n].transforms))}static Hf(e,n){return!nt(e.conditions)&&Rr.Uf(e,n)&&Rr.Wf(e)}static Uf(e,n){var r;if(nt(e.conditions)||nt((r=e.conditions)===null||r===void 0?void 0:r.url))return!0;const s=Rr.getWindowLocation();if(s){var i,o,l;const u=V5(n,s.href);return!(!((i=e.conditions)===null||i===void 0)&&i.url)||MF[(o=(l=e.conditions)===null||l===void 0?void 0:l.urlMatchType)!==null&&o!==void 0?o:"icontains"](e.conditions.url,u)}return!1}static getWindowLocation(){return J==null?void 0:J.location}static Wf(e){var n;if(nt(e.conditions)||nt((n=e.conditions)===null||n===void 0?void 0:n.utm))return!0;const r=Q5();if(r.utm_source){var s,i,o,l,u,d,f,p;const g=!(!((s=e.conditions)===null||s===void 0||(s=s.utm)===null||s===void 0)&&s.utm_campaign)||((i=e.conditions)===null||i===void 0||(i=i.utm)===null||i===void 0?void 0:i.utm_campaign)==r.utm_campaign,v=!(!((o=e.conditions)===null||o===void 0||(o=o.utm)===null||o===void 0)&&o.utm_source)||((l=e.conditions)===null||l===void 0||(l=l.utm)===null||l===void 0?void 0:l.utm_source)==r.utm_source,w=!(!((u=e.conditions)===null||u===void 0||(u=u.utm)===null||u===void 0)&&u.utm_medium)||((d=e.conditions)===null||d===void 0||(d=d.utm)===null||d===void 0?void 0:d.utm_medium)==r.utm_medium,_=!(!((f=e.conditions)===null||f===void 0||(f=f.utm)===null||f===void 0)&&f.utm_term)||((p=e.conditions)===null||p===void 0||(p=p.utm)===null||p===void 0?void 0:p.utm_term)==r.utm_term;return g&&w&&_&&v}return!1}static qf(e,...n){ve.info(`[WebExperiments] ${e}`,n)}Bf(e,n,r){this._is_bot()?Rr.qf(ak):n!=="control"?r.forEach(s=>{if(s.selector){var i;Rr.qf(`applying transform of variant ${n} for experiment ${e} `,s);const o=(i=document)===null||i===void 0?void 0:i.querySelectorAll(s.selector);o==null||o.forEach(l=>{const u=l;s.html&&(u.innerHTML=s.html),s.css&&u.setAttribute("style",s.css)})}}):Rr.qf("Control variants leave the page unmodified.")}_is_bot(){return Kn&&this._instance?kR(Kn,this.Rr.custom_blocked_useragents):void 0}}},kg),GF={conversations:class{constructor(t){this._instance=t,this.Vf=void 0,this._conversationsManager=null,this.Gf=!1,this.ne=null,this.Zf=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(this._instance.config.disable_conversations||(this.Qf=t.ok,!t.ok))return;const e=t.config.conversations;nt(e)||(Or(e)?this.Vf=e:(this.Vf=e.enabled,this.ne=e),this.loadIfEnabled())}reset(){var t;(t=this._conversationsManager)===null||t===void 0||t.reset(),this._conversationsManager=null,this.Vf=void 0,this.ne=null,this.Qf=void 0,this.Zf=!1}loadIfEnabled(){if(this._conversationsManager||this.Gf||this._instance.config.disable_conversations||Y_(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())return;const t=$e==null?void 0:$e.__PosthogExtensions__;if(t&&!ce(this.Vf)&&this.Vf)if(this.ne&&this.ne.token){this.Gf=!0;try{const e=t.initConversations;if(e)return this.Jf(e),void(this.Gf=!1);const n=t.loadExternalDependency;if(!n)return void this.Kf(nx);n(this._instance,"conversations",r=>{r||!t.initConversations?this.Kf("Could not load conversations script",r):this.Jf(t.initConversations),this.Gf=!1})}catch(e){this.Kf("Error initializing conversations",e),this.Gf=!1}}else js.error("Conversations enabled but missing token in remote config.")}Jf(t){if(this.ne)try{this._conversationsManager=t(this.ne,this._instance),this.Zf=!1,js.info("Conversations loaded successfully")}catch(e){this.Kf("Error completing conversations initialization",e)}else js.error("Cannot complete initialization: remote config is null")}Kf(t,e){js.error(t,e),this._conversationsManager=null,this.Gf=!1,this.Zf=!0}show(){this._conversationsManager?this._conversationsManager.show():js.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Vf===!0&&!on(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Y_(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.Qf===!1?"remote_config_failed":ce(this.Vf)?this.Qf?"disabled_in_project":"remote_config_pending":this.Vf?nt(this.ne)||!this.ne.token?"missing_token":$e!=null&&$e.__PosthogExtensions__?this.Gf?"initializing":this.Zf?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,n){var r=this;return qt(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,n):(js.warn(kl),null)})()}getMessages(t,e){var n=this;return qt(function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(js.warn(kl),null)})()}markAsRead(t){var e=this;return qt(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(js.warn(kl),null)})()}getTickets(t){var e=this;return qt(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(js.warn(kl),null)})()}requestRestoreLink(t){var e=this;return qt(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(js.warn(kl),null)})()}restoreFromToken(t){var e=this;return qt(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(js.warn(kl),null)})()}restoreFromUrlToken(){var t=this;return qt(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(js.warn(kl),null)})()}getCurrentTicketId(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,e;return(t=(e=this._conversationsManager)===null||e===void 0?void 0:e.getWidgetSessionId())!==null&&t!==void 0?t:null}Sh(){var t;(t=this._conversationsManager)===null||t===void 0||t.setIdentity()}xh(){var t;(t=this._conversationsManager)===null||t===void 0||t.clearIdentity()}}},KF={logs:class{constructor(t){var e;this._instance=t,this.name="logs",this.Xf=!1,this.Yf=!1,this.tp=!1,this.$=un("[logs]"),this.ep=V(V({},this.$),{},{error:(...n)=>{n.some(uk)||this.$.error(...n)}}),this.al=[],this.np=[],this.hd=0,this.Io=!1,this.sp=[],this.rp=[],this.op=!1,this.ap=!1,this.lp=()=>{var n,r;this.Io||(this.hd=0,(n=this.up)===null||n===void 0||n.onReconnect(),(r=this.hp)===null||r===void 0||r.onReconnect())},this._instance&&(!((e=this._instance.config.logs)===null||e===void 0)&&e.captureConsoleLogs)&&(this.Xf=!0),J&&Et(J,"online",this.lp)}cp(t,e,n,r){var s;const i=lk((s=this._instance)===null||s===void 0||(s=s.config)===null||s===void 0?void 0:s.logs,n);return[new R$(this.dp(t,e),i,this.ep,()=>this.vp(),o=>o(),void 0,r),i]}fp(){var t;const e=(t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.logs;var n;return this.up&&this.pp===e||((n=this.up)===null||n===void 0||n.reset(),this.pp=e,[this.up,this.gp]=this.cp(()=>this.al,r=>{this.al=r})),this.up}mp(){var t;const e=(t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.logs;var n;return this.hp&&this.yp===e||((n=this.hp)===null||n===void 0||n.reset(),this.yp=e,[this.hp,this.bp]=this.cp(()=>this.np,r=>{this.np=r},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},ck)),this.hp}setup(t){var e;if(this.Io)return;this.wo=t,!((e=this._instance)===null||e===void 0||(e=e.config)===null||e===void 0||(e=e.logs)===null||e===void 0)&&e.captureConsoleLogs&&(this.Xf=!0),(this.Xf||this._p()&&this.wp())&&this.kp();let n=!1;const r=t.onRemoteConfig(s=>{var i;n=s.ok&&((i=s.config.logs)===null||i===void 0?void 0:i.captureConsoleLogs)===!0,this.onRemoteConfig(s)});this.Io?r.dispose():(this.Po=r,n||this.loadIfEnabled())}dispose(){var t,e,n,r;this.Io||(this.Io=!0,this.Sp(),(t=this.Po)===null||t===void 0||t.dispose(),this.Po=void 0,this.wo=void 0,this.tp=!1,J==null||J.removeEventListener("online",this.lp),(e=this.xp)===null||e===void 0||e.call(this),this.xp=void 0,(n=this.up)===null||n===void 0||n.reset(),(r=this.hp)===null||r===void 0||r.reset())}onRemoteConfig(t){var e,n;if(this.Io)return;const r=t.ok?(e=t.config.logs)===null||e===void 0?void 0:e.captureConsoleLogs:void 0;nt(r)?this.Cp():((n=this._instance)===null||n===void 0||(n=n.persistence)===null||n===void 0||n.register({$logs_capture_enabled_server_side:!!r}),r?(this.Xf=!0,this.Yf||this.kp(),this.loadIfEnabled()):this.Cp())}reset(){var t,e,n,r;this.Sp(),(t=this.up)===null||t===void 0||t.clearQueue(),this.al=[],(e=this.up)===null||e===void 0||e.reset(),(n=this.hp)===null||n===void 0||n.clearQueue(),this.np=[],(r=this.hp)===null||r===void 0||r.reset(),this.hd=0}captureLog(t){this.Io||this.fp().captureLog(t)}captureConsoleLog(t){this.Io||this.mp().captureLog(t)}captureBufferedConsoleLog(t,e,n){this.Io||this.mp().captureLog(t,{context:e,occurredAtMs:n})}wp(){var t;return!!(!((t=this._instance)===null||t===void 0||(t=t.persistence)===null||t===void 0||(t=t.props)===null||t===void 0)&&t[x5])}_p(){var t,e,n;return!(!((t=this._instance)===null||t===void 0||(e=t.nl)===null||e===void 0)&&e.call(t))||!!(!((n=$e._POSTHOG_REMOTE_CONFIG)===null||n===void 0||(n=n[this._instance.config.token])===null||n===void 0)&&n.config)}$h(){var t;this.Sp(),(t=this.hp)===null||t===void 0||t.clearQueue(),this.np=[]}Cp(){this.Xf||this.Sp()}kp(){var t;if(this.op||!($e!=null&&$e.console))return;const e=lk((t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.logs).maxBufferSize;let n=!0;this.rp.push(()=>{n=!1});for(const r of OF){let s;try{s=LF($e.console[r])}catch{continue}s&&this.rp.push(sh($e.console,r,i=>{const o=(...l)=>{try{n&&this.$p(r,l,e)}catch{}return i.apply($e.console,l)};return o.__rrweb_original__=s,o}))}this.op=!0,this.Tp=setTimeout(()=>{this.Sp()},3e4)}$p(t,e,n){var r;if(this.op&&!this.ap&&e.length!==0)if(!((r=this._instance)===null||r===void 0)&&r.is_capturing()){if(n>this.sp.length){this.ap=!0;try{this.sp.push({level:t,args:e,occurredAtMs:Date.now(),context:this.vp()})}finally{this.ap=!1}}}else this.Sp()}Sp(){if(this.sp=[],this.op){this.op=!1,this.Tp&&(clearTimeout(this.Tp),this.Tp=void 0);for(const t of this.rp)t();this.rp=[]}}Ip(){const t=this.sp;return this.Sp(),t}get logger(){return this.Mp||(this.Mp={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.Mp}flushLogs(t){t?this.Ep(t):(this.up&&this.up.flush().catch(e=>this.Pp(e)),this.hp&&this.hp.flush().catch(e=>this.Pp(e)))}Pp(t){uk(t)||this.$.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(this.Io||!this.Xf||this.Yf||this.tp)return;const t=$e==null?void 0:$e.__PosthogExtensions__;if(!t)return this.$.error("PostHog Extensions not found."),void this.Sp();const e=t.loadExternalDependency;if(!e)return this.$.error(nx),void this.Sp();this.tp=!0;try{e(this._instance,"logs",n=>{if(this.tp=!1,this.Io||!this.Xf)return;const r=t.logs;if(n||!(r!=null&&r.initializeLogs))this.$.error("Could not load logs script",n),this.Sp();else{var s;const l=this.Ip();var i,o;this.xp=r.initializeLogs((s=this.wo)!==null&&s!==void 0?s:this._instance),this.Yf=!0,l.length>0&&((i=r.replayConsoleBuffer)===null||i===void 0||i.call(r,(o=this.wo)!==null&&o!==void 0?o:this._instance,l))}})}catch(n){throw this.tp=!1,n}}dp(t,e){const n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:r=>r===Ai.LogsQueue?t():void 0,setPersistedProperty(r,s){var i;r===Ai.LogsQueue&&e((i=s)!==null&&i!==void 0?i:[])},js:r=>this.js(r),getLibraryId:()=>Vn.LIB_NAME,getLibraryVersion:()=>Vn.LIB_VERSION}}js(t){return new Promise(e=>{if(Y5(this.hd,3))return void e({kind:"fatal",error:py(void 0,"logs endpoint is unreachable, dropping batch")});let n=!1;const r=i=>{n||(n=!0,clearTimeout(s),e(i))},s=setTimeout(()=>{this.$.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:py(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.Rp(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:i=>{const o=i.statusCode;if(this.Ap(o),o>=200&&300>o)r({kind:"ok"});else if(o===413)r({kind:"too-large"});else if(o!==0&&o!==408&&o!==429&&500>o)r({kind:"fatal",error:new Error(`logs request failed with status ${o}`)});else{var l;o===0?(i.error||this.$.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:py(i.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:(l=i.error)!==null&&l!==void 0?l:new Error(`logs request failed with status ${o}`)})}}})})}Ap(t){(t!==0||this._instance.__loaded)&&(this.hd=X5(t,this.hd,3,()=>this.$.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}Ep(t){this.al.length>0&&this.Fp(t,this.al,this.gp,Vn.LIB_NAME,e=>{this.al=e}),this.np.length>0&&this.Fp(t,this.np,this.bp,ck,e=>{this.np=e})}Fp(t,e,n,r,s){if(e.length===0)return;const i=e.map(l=>l.record);s([]);const o=p5(i,h5(n,Vn.LIB_NAME,Vn.LIB_VERSION),r,Vn.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Rp(),data:o,compression:"best-available",batchKey:"logs",transport:t})}Rp(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}vp(){var t;const e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){const{sessionId:n,windowId:r,sessionStartTimestamp:s,lastActivityTimestamp:i}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);e.sessionId=n,e.windowId=r,nt(s)||(e.sessionStartTimestamp=s),nt(i)||(e.lastActivityTimestamp=i)}if(!($e==null||(t=$e.location)===null||t===void 0)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?Fa($e.location.href):$e.location.href),this._instance.featureFlags){const n=this._instance.featureFlags.getFlags();n&&n.length>0&&(e.activeFeatureFlags=n)}return e}}},YF={metrics:class{constructor(t){this._instance=t,this.$=un("[metrics]"),this.Io=!1}initialize(){this.onConfigChange()}onConfigChange(){var t;if(this.Io)return;const e=!!(!((t=this._instance.config.metrics)===null||t===void 0)&&t.network);e&&!this.Op?this.Op=(n=>{let r=!0;const s=()=>r?(l=>{var u;const d=(u=l.config.metrics)===null||u===void 0?void 0:u.network;return d===!0?{}:d||void 0})(n):void 0,i=$F(n,s),o=jF(n,s);return()=>{r=!1,i(),o()}})(this._instance):!e&&this.Op&&(this.Op(),this.Op=void 0)}fp(){var t;const e=(t=this._instance)===null||t===void 0||(t=t.config)===null||t===void 0?void 0:t.metrics;var n;return this.up&&this.pp===e||((n=this.up)===null||n===void 0||n.reset(),this.pp=e,this.up=new A$(this.dp(),(function(r){var s,i,o,l,u;const d=r==null?void 0:r.resourceAttributes;return{serviceName:(s=d==null?void 0:d["service.name"])!==null&&s!==void 0?s:r==null?void 0:r.serviceName,serviceVersion:(i=d==null?void 0:d["service.version"])!==null&&i!==void 0?i:r==null?void 0:r.serviceVersion,environment:(o=d==null?void 0:d["deployment.environment"])!==null&&o!==void 0?o:r==null?void 0:r.environment,resourceAttributes:d,beforeSend:r==null?void 0:r.beforeSend,flushIntervalMs:(l=r==null?void 0:r.flushIntervalMs)!==null&&l!==void 0?l:1e4,maxSeriesPerFlush:(u=r==null?void 0:r.maxSeriesPerFlush)!==null&&u!==void 0?u:1e3}})(e),this.$)),this.up}count(t,e=1,n){this.fp().count(t,e,n)}gauge(t,e,n){this.fp().gauge(t,e,n)}histogram(t,e,n){this.fp().histogram(t,e,n)}flush(t){if(!this.up)return Promise.resolve();if(t){const e=this.up.drainWindow();return e&&this.Ys(e,t),Promise.resolve()}return this.up.flush().catch(e=>this.$.error("PostHog metrics flush failed:",e))}reset(){var t;(t=this.up)===null||t===void 0||t.reset()}dispose(){var t,e;this.Io=!0,(t=this.Op)===null||t===void 0||t.call(this),this.Op=void 0,(e=this.up)===null||e===void 0||e.reset()}dp(){const t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Ys:n=>e.Ys(n),getLibraryId:()=>Vn.LIB_NAME,getLibraryVersion:()=>Vn.LIB_VERSION}}Ys(t,e){return new Promise(n=>{let r=!1;const s=o=>{r||(r=!0,clearTimeout(i),n(o))},i=setTimeout(()=>s({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(V(V({method:"POST",url:this.Dp(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e}),{},{fireCallbackOnDrop:!0,callback(o){const l=o.statusCode;if(l>=200&&300>l)s({kind:"ok"});else if(l===413)s({kind:"too-large"});else if(l!==0&&l!==408&&l!==429&&500>l)s({kind:"fatal",error:new Error(`metrics request failed with status ${l}`)});else{var u;s({kind:"retry-later",error:(u=o.error)!==null&&u!==void 0?u:new Error(`metrics request failed with status ${l}`)})}}}))})}Dp(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}};$f.__defaultExtensionClasses=V({},V(V(V(V(V(V(V(V(V(V(V(V(V({},kg),FF),VF),HF),zF),BF),ZF),UF),WF),qF),GF),KF),YF));const XF=(function(){Vn.SDK_DIST_CHANNEL="npm";const t=Nf[_f]=new $f;return(function(){function e(){e.done||(e.done=!0,bR=!1,At(Nf,function(n){n._dom_loaded()}))}ue!=null&&ue.addEventListener?ue.readyState==="complete"?e():Et(ue,"DOMContentLoaded",e,{capture:!1}):J&&ve.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})();var Ce=XF,QF=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();var JF=function(t,e,n){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:n?"".concat(n," ",e):e})},h0,dk="__POSTHOG_REACT_SHARED_STATE__",fk=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},ih;try{ih=fk[dk]=fk[dk]||new WeakMap}catch{ih=new WeakMap}ih.has(m.createContext)||ih.set(m.createContext,{});var ec=ih.get(m.createContext),c2;function eV(t){(!ec.defaultPostHogInstance||ec.defaultPostHogInstance===c2)&&(ec.defaultPostHogInstance=t),c2=t}function u2(){return c2}ec.context||(ec.context=m.createContext({get client(){return u2()||ec.defaultPostHogInstance},bootstrap:void 0}));var fx=ec.context;function DR(t,e,n){if(n===void 0&&(n=new WeakMap),t===e)return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(n.has(t)&&n.get(t)===e)return!0;n.set(t,e);var r=Object.keys(t),s=Object.keys(e);if(r.length!==s.length)return!1;for(var i=0,o=r;i<o.length;i++){var l=o[i];if(!s.includes(l)||!DR(t[l],e[l],n))return!1}return!0}function tV(t){var e,n,r=t.children,s=t.client,i=t.apiKey,o=t.options,l=m.useRef(null),u=m.useMemo(function(){if(s)return i&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),o&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),s;var d=u2();return i||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),d},[s,i,JSON.stringify(o)]);return m.useEffect(function(){if(!(s||!i)){var d=u2(),f=l.current;f?(i!==f.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),o&&!DR(o,f.options)&&d.set_config(o),l.current={apiKey:i,options:o??{}}):(d.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),d.init(i,o),l.current={apiKey:i,options:o??{}})}},[s,i,JSON.stringify(o)]),we.createElement(fx.Provider,{value:{client:u,bootstrap:(e=o==null?void 0:o.bootstrap)!==null&&e!==void 0?e:(n=s==null?void 0:s.config)===null||n===void 0?void 0:n.bootstrap}},r)}var my=function(t){return typeof t=="function"},nV=function(t){return t===void 0},Vo=function(){var t=m.useContext(fx).client;return t},W0=function(t){var e=Object.prototype.toString.call(t);return t instanceof Error||e==="[object Error]"||e==="[object Exception]"||e==="[object DOMException]"||e==="[object DOMError]"},rV=function(t,e){try{Object.defineProperty(t,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch{}},sV=function(t,e){for(var n=new WeakSet,r=t;!n.has(r);){if(n.add(r),!W0(r.cause)){nV(r.cause)||(e.cause=r.cause),r.cause=e;return}r=r.cause}},iV=function(t,e){if(!e)return t;var n=new Error(W0(t)?t.message:"Primitive value captured as exception: ".concat(String(t)));return rV(n,"React ErrorBoundary ".concat(W0(t)?t.name:"Error")),n.stack=e,W0(t)?(sV(t,n),t):n},hk={componentStack:null,exceptionEvent:null,error:null},oV={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},aV=(h0=(function(t){QF(e,t);function e(n){var r=t.call(this,n)||this;return r._resetError=function(){r.setState(hk)},r.state=hk,r}return e.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;my(s)?i=s(n,r):typeof s=="object"&&(i=s);var o=this.context.client,l=r.componentStack,u=o.captureException(iV(n,l),i);this.setState({error:n,componentStack:l??null,exceptionEvent:u})},e.prototype.render=function(){var n=this.props,r=n.children,s=n.fallback,i=this.state;if(i.componentStack==null)return my(r)?r():r;var o=my(s)?we.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent,resetError:this._resetError}):s;return we.isValidElement(o)?o:(console.warn(oV.INVALID_FALLBACK),we.createElement(we.Fragment,null))},e})(we.Component),JF(h0,"PostHogErrorBoundary"),(function(){h0.contextType=fx})(),h0);eV(Ce);const pk="rivet_library_token";let jf="";const lV=()=>`Bearer ${jf}`,cV=()=>{if(!window.location.pathname.startsWith("/rivet/library"))return;const t=new URLSearchParams(window.location.hash.slice(1)).get("token");if(t){jf=t;try{window.sessionStorage.setItem(pk,t)}catch{}window.history.replaceState(null,"",window.location.pathname+window.location.search)}else try{jf=window.sessionStorage.getItem(pk)??""}catch{jf=""}},Cie=async(t,e={})=>{const n=await fetch(`/api/library${t}`,{method:e.method??"GET",signal:e.signal,headers:{Authorization:`Bearer ${jf}`,"Content-Type":"application/json"},...e.body!==void 0?{body:JSON.stringify(e.body)}:{}}),r=await n.text();let s;try{s=JSON.parse(r)}catch{s={error:r}}if(!n.ok){if(n.status===401)throw new Error("Run rivet open to reconnect to this library.");const i=s&&typeof s=="object"&&"error"in s?String(s.error):`Request failed (${n.status})`;throw new Error(i)}return s};var p0={},gy={exports:{}},Br={},vy={exports:{}},yy={};/**
|
|
20
|
-
* @license React
|
|
21
|
-
* scheduler.production.min.js
|
|
22
|
-
*
|
|
23
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
24
|
-
*
|
|
25
|
-
* This source code is licensed under the MIT license found in the
|
|
26
|
-
* LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/var mk;function uV(){return mk||(mk=1,(function(t){function e(B,ee){var W=B.length;B.push(ee);e:for(;0<W;){var N=W-1>>>1,X=B[N];if(0<s(X,ee))B[N]=ee,B[W]=X,W=N;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var ee=B[0],W=B.pop();if(W!==ee){B[0]=W;e:for(var N=0,X=B.length,oe=X>>>1;N<oe;){var re=2*(N+1)-1,se=B[re],fe=re+1,_e=B[fe];if(0>s(se,W))fe<X&&0>s(_e,se)?(B[N]=_e,B[fe]=W,N=fe):(B[N]=se,B[re]=W,N=re);else if(fe<X&&0>s(_e,W))B[N]=_e,B[fe]=W,N=fe;else break e}}return ee}function s(B,ee){var W=B.sortIndex-ee.sortIndex;return W!==0?W:B.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var u=[],d=[],f=1,p=null,g=3,v=!1,w=!1,_=!1,x=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(B){for(var ee=n(d);ee!==null;){if(ee.callback===null)r(d);else if(ee.startTime<=B)r(d),ee.sortIndex=ee.expirationTime,e(u,ee);else break;ee=n(d)}}function R(B){if(_=!1,C(B),!w)if(n(u)!==null)w=!0,Z(A);else{var ee=n(d);ee!==null&&Q(R,ee.startTime-B)}}function A(B,ee){w=!1,_&&(_=!1,b(T),T=-1),v=!0;var W=g;try{for(C(ee),p=n(u);p!==null&&(!(p.expirationTime>ee)||B&&!j());){var N=p.callback;if(typeof N=="function"){p.callback=null,g=p.priorityLevel;var X=N(p.expirationTime<=ee);ee=t.unstable_now(),typeof X=="function"?p.callback=X:p===n(u)&&r(u),C(ee)}else r(u);p=n(u)}if(p!==null)var oe=!0;else{var re=n(d);re!==null&&Q(R,re.startTime-ee),oe=!1}return oe}finally{p=null,g=W,v=!1}}var I=!1,M=null,T=-1,L=5,D=-1;function j(){return!(t.unstable_now()-D<L)}function H(){if(M!==null){var B=t.unstable_now();D=B;var ee=!0;try{ee=M(!0,B)}finally{ee?Y():(I=!1,M=null)}}else I=!1}var Y;if(typeof E=="function")Y=function(){E(H)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,z=U.port2;U.port1.onmessage=H,Y=function(){z.postMessage(null)}}else Y=function(){x(H,0)};function Z(B){M=B,I||(I=!0,Y())}function Q(B,ee){T=x(function(){B(t.unstable_now())},ee)}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(B){B.callback=null},t.unstable_continueExecution=function(){w||v||(w=!0,Z(A))},t.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<B?Math.floor(1e3/B):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_getFirstCallbackNode=function(){return n(u)},t.unstable_next=function(B){switch(g){case 1:case 2:case 3:var ee=3;break;default:ee=g}var W=g;g=ee;try{return B()}finally{g=W}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(B,ee){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var W=g;g=B;try{return ee()}finally{g=W}},t.unstable_scheduleCallback=function(B,ee,W){var N=t.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?N+W:N):W=N,B){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=W+X,B={id:f++,callback:ee,priorityLevel:B,startTime:W,expirationTime:X,sortIndex:-1},W>N?(B.sortIndex=W,e(d,B),n(u)===null&&B===n(d)&&(_?(b(T),T=-1):_=!0,Q(R,W-N))):(B.sortIndex=X,e(u,B),w||v||(w=!0,Z(A))),B},t.unstable_shouldYield=j,t.unstable_wrapCallback=function(B){var ee=g;return function(){var W=g;g=ee;try{return B.apply(this,arguments)}finally{g=W}}}})(yy)),yy}var gk;function dV(){return gk||(gk=1,vy.exports=uV()),vy.exports}/**
|
|
28
|
-
* @license React
|
|
29
|
-
* react-dom.production.min.js
|
|
30
|
-
*
|
|
31
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
32
|
-
*
|
|
33
|
-
* This source code is licensed under the MIT license found in the
|
|
34
|
-
* LICENSE file in the root directory of this source tree.
|
|
35
|
-
*/var vk;function fV(){if(vk)return Br;vk=1;var t=Vw(),e=dV();function n(a){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+a,h=1;h<arguments.length;h++)c+="&args[]="+encodeURIComponent(arguments[h]);return"Minified React error #"+a+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function i(a,c){o(a,c),o(a+"Capture",c)}function o(a,c){for(s[a]=c,a=0;a<c.length;a++)r.add(c[a])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f={},p={};function g(a){return u.call(p,a)?!0:u.call(f,a)?!1:d.test(a)?p[a]=!0:(f[a]=!0,!1)}function v(a,c,h,y){if(h!==null&&h.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return y?!1:h!==null?!h.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function w(a,c,h,y){if(c===null||typeof c>"u"||v(a,c,h,y))return!0;if(y)return!1;if(h!==null)switch(h.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function _(a,c,h,y,k,P,O){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=y,this.attributeNamespace=k,this.mustUseProperty=h,this.propertyName=a,this.type=c,this.sanitizeURL=P,this.removeEmptyString=O}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){x[a]=new _(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var c=a[0];x[c]=new _(c,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){x[a]=new _(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){x[a]=new _(a,2,!1,a,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){x[a]=new _(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){x[a]=new _(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){x[a]=new _(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){x[a]=new _(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){x[a]=new _(a,5,!1,a.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function E(a){return a[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var c=a.replace(b,E);x[c]=new _(c,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var c=a.replace(b,E);x[c]=new _(c,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var c=a.replace(b,E);x[c]=new _(c,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){x[a]=new _(a,1,!1,a.toLowerCase(),null,!1,!1)}),x.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){x[a]=new _(a,1,!1,a.toLowerCase(),null,!0,!0)});function C(a,c,h,y){var k=x.hasOwnProperty(c)?x[c]:null;(k!==null?k.type!==0:y||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(w(c,h,k,y)&&(h=null),y||k===null?g(c)&&(h===null?a.removeAttribute(c):a.setAttribute(c,""+h)):k.mustUseProperty?a[k.propertyName]=h===null?k.type===3?!1:"":h:(c=k.attributeName,y=k.attributeNamespace,h===null?a.removeAttribute(c):(k=k.type,h=k===3||k===4&&h===!0?"":""+h,y?a.setAttributeNS(y,c,h):a.setAttribute(c,h))))}var R=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),I=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),j=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),Q=Symbol.for("react.offscreen"),B=Symbol.iterator;function ee(a){return a===null||typeof a!="object"?null:(a=B&&a[B]||a["@@iterator"],typeof a=="function"?a:null)}var W=Object.assign,N;function X(a){if(N===void 0)try{throw Error()}catch(h){var c=h.stack.trim().match(/\n( *(at )?)/);N=c&&c[1]||""}return`
|
|
36
|
-
`+N+a}var oe=!1;function re(a,c){if(!a||oe)return"";oe=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(ie){var y=ie}Reflect.construct(a,[],c)}else{try{c.call()}catch(ie){y=ie}a.call(c.prototype)}else{try{throw Error()}catch(ie){y=ie}a()}}catch(ie){if(ie&&y&&typeof ie.stack=="string"){for(var k=ie.stack.split(`
|
|
37
|
-
`),P=y.stack.split(`
|
|
38
|
-
`),O=k.length-1,F=P.length-1;1<=O&&0<=F&&k[O]!==P[F];)F--;for(;1<=O&&0<=F;O--,F--)if(k[O]!==P[F]){if(O!==1||F!==1)do if(O--,F--,0>F||k[O]!==P[F]){var G=`
|
|
39
|
-
`+k[O].replace(" at new "," at ");return a.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",a.displayName)),G}while(1<=O&&0<=F);break}}}finally{oe=!1,Error.prepareStackTrace=h}return(a=a?a.displayName||a.name:"")?X(a):""}function se(a){switch(a.tag){case 5:return X(a.type);case 16:return X("Lazy");case 13:return X("Suspense");case 19:return X("SuspenseList");case 0:case 2:case 15:return a=re(a.type,!1),a;case 11:return a=re(a.type.render,!1),a;case 1:return a=re(a.type,!0),a;default:return""}}function fe(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case M:return"Fragment";case I:return"Portal";case L:return"Profiler";case T:return"StrictMode";case Y:return"Suspense";case U:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case j:return(a.displayName||"Context")+".Consumer";case D:return(a._context.displayName||"Context")+".Provider";case H:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case z:return c=a.displayName||null,c!==null?c:fe(a.type)||"Memo";case Z:c=a._payload,a=a._init;try{return fe(a(c))}catch{}}return null}function _e(a){var c=a.type;switch(a.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=c.render,a=a.displayName||a.name||"",c.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fe(c);case 8:return c===T?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function de(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function ae(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function Oe(a){var c=ae(a)?"checked":"value",h=Object.getOwnPropertyDescriptor(a.constructor.prototype,c),y=""+a[c];if(!a.hasOwnProperty(c)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var k=h.get,P=h.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return k.call(this)},set:function(O){y=""+O,P.call(this,O)}}),Object.defineProperty(a,c,{enumerable:h.enumerable}),{getValue:function(){return y},setValue:function(O){y=""+O},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function ke(a){a._valueTracker||(a._valueTracker=Oe(a))}function Ge(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var h=c.getValue(),y="";return a&&(y=ae(a)?a.checked?"true":"false":a.value),a=y,a!==h?(c.setValue(a),!0):!1}function vt(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function It(a,c){var h=c.checked;return W({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:h??a._wrapperState.initialChecked})}function Yt(a,c){var h=c.defaultValue==null?"":c.defaultValue,y=c.checked!=null?c.checked:c.defaultChecked;h=de(c.value!=null?c.value:h),a._wrapperState={initialChecked:y,initialValue:h,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function wt(a,c){c=c.checked,c!=null&&C(a,"checked",c,!1)}function yt(a,c){wt(a,c);var h=de(c.value),y=c.type;if(h!=null)y==="number"?(h===0&&a.value===""||a.value!=h)&&(a.value=""+h):a.value!==""+h&&(a.value=""+h);else if(y==="submit"||y==="reset"){a.removeAttribute("value");return}c.hasOwnProperty("value")?Ke(a,c.type,h):c.hasOwnProperty("defaultValue")&&Ke(a,c.type,de(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(a.defaultChecked=!!c.defaultChecked)}function We(a,c,h){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var y=c.type;if(!(y!=="submit"&&y!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+a._wrapperState.initialValue,h||c===a.value||(a.value=c),a.defaultValue=c}h=a.name,h!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,h!==""&&(a.name=h)}function Ke(a,c,h){(c!=="number"||vt(a.ownerDocument)!==a)&&(h==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+h&&(a.defaultValue=""+h))}var St=Array.isArray;function Re(a,c,h,y){if(a=a.options,c){c={};for(var k=0;k<h.length;k++)c["$"+h[k]]=!0;for(h=0;h<a.length;h++)k=c.hasOwnProperty("$"+a[h].value),a[h].selected!==k&&(a[h].selected=k),k&&y&&(a[h].defaultSelected=!0)}else{for(h=""+de(h),c=null,k=0;k<a.length;k++){if(a[k].value===h){a[k].selected=!0,y&&(a[k].defaultSelected=!0);return}c!==null||a[k].disabled||(c=a[k])}c!==null&&(c.selected=!0)}}function Ye(a,c){if(c.dangerouslySetInnerHTML!=null)throw Error(n(91));return W({},c,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function Mt(a,c){var h=c.value;if(h==null){if(h=c.children,c=c.defaultValue,h!=null){if(c!=null)throw Error(n(92));if(St(h)){if(1<h.length)throw Error(n(93));h=h[0]}c=h}c==null&&(c=""),h=c}a._wrapperState={initialValue:de(h)}}function qe(a,c){var h=de(c.value),y=de(c.defaultValue);h!=null&&(h=""+h,h!==a.value&&(a.value=h),c.defaultValue==null&&a.defaultValue!==h&&(a.defaultValue=h)),y!=null&&(a.defaultValue=""+y)}function kt(a){var c=a.textContent;c===a._wrapperState.initialValue&&c!==""&&c!==null&&(a.value=c)}function ns(a){switch(a){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function mr(a,c){return a==null||a==="http://www.w3.org/1999/xhtml"?ns(c):a==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var Le,Bo=(function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,h,y,k){MSApp.execUnsafeLocalFunction(function(){return a(c,h,y,k)})}:a})(function(a,c){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=c;else{for(Le=Le||document.createElement("div"),Le.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=Le.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;c.firstChild;)a.appendChild(c.firstChild)}});function Mn(a,c){if(c){var h=a.firstChild;if(h&&h===a.lastChild&&h.nodeType===3){h.nodeValue=c;return}}a.textContent=c}var Yn={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},rl=["Webkit","ms","Moz","O"];Object.keys(Yn).forEach(function(a){rl.forEach(function(c){c=c+a.charAt(0).toUpperCase()+a.substring(1),Yn[c]=Yn[a]})});function mn(a,c,h){return c==null||typeof c=="boolean"||c===""?"":h||typeof c!="number"||c===0||Yn.hasOwnProperty(a)&&Yn[a]?(""+c).trim():c+"px"}function gn(a,c){a=a.style;for(var h in c)if(c.hasOwnProperty(h)){var y=h.indexOf("--")===0,k=mn(h,c[h],y);h==="float"&&(h="cssFloat"),y?a.setProperty(h,k):a[h]=k}}var gd=W({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 Ps(a,c){if(c){if(gd[a]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(n(137,a));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(n(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(n(61))}if(c.style!=null&&typeof c.style!="object")throw Error(n(62))}}function gr(a,c){if(a.indexOf("-")===-1)return typeof c.is=="string";switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Xn=null;function Yi(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Gs=null,On=null,Rs=null;function sl(a){if(a=Fd(a)){if(typeof Gs!="function")throw Error(n(280));var c=a.stateNode;c&&(c=yp(c),Gs(a.stateNode,a.type,c))}}function Xi(a){On?Rs?Rs.push(a):Rs=[a]:On=a}function rs(){if(On){var a=On,c=Rs;if(Rs=On=null,sl(a),c)for(a=0;a<c.length;a++)sl(c[a])}}function Xe(a,c){return a(c)}function Ot(){}var Ft=!1;function zn(a,c,h){if(Ft)return a(c,h);Ft=!0;try{return Xe(a,c,h)}finally{Ft=!1,(On!==null||Rs!==null)&&(Ot(),rs())}}function ss(a,c){var h=a.stateNode;if(h===null)return null;var y=yp(h);if(y===null)return null;h=y[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(a=a.type,y=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!y;break e;default:a=!1}if(a)return null;if(h&&typeof h!="function")throw Error(n(231,c,typeof h));return h}var Bt=!1;if(l)try{var Ln={};Object.defineProperty(Ln,"passive",{get:function(){Bt=!0}}),window.addEventListener("test",Ln,Ln),window.removeEventListener("test",Ln,Ln)}catch{Bt=!1}function $r(a,c,h,y,k,P,O,F,G){var ie=Array.prototype.slice.call(arguments,3);try{c.apply(h,ie)}catch(ge){this.onError(ge)}}var Ks=!1,or=null,Pn=!1,il=null,gc={onError:function(a){Ks=!0,or=a}};function vc(a,c,h,y,k,P,O,F,G){Ks=!1,or=null,$r.apply(gc,arguments)}function yc(a,c,h,y,k,P,O,F,G){if(vc.apply(this,arguments),Ks){if(Ks){var ie=or;Ks=!1,or=null}else throw Error(n(198));Pn||(Pn=!0,il=ie)}}function As(a){var c=a,h=a;if(a.alternate)for(;c.return;)c=c.return;else{a=c;do c=a,(c.flags&4098)!==0&&(h=c.return),a=c.return;while(a)}return c.tag===3?h:null}function Qi(a){if(a.tag===13){var c=a.memoizedState;if(c===null&&(a=a.alternate,a!==null&&(c=a.memoizedState)),c!==null)return c.dehydrated}return null}function vd(a){if(As(a)!==a)throw Error(n(188))}function _c(a){var c=a.alternate;if(!c){if(c=As(a),c===null)throw Error(n(188));return c!==a?null:a}for(var h=a,y=c;;){var k=h.return;if(k===null)break;var P=k.alternate;if(P===null){if(y=k.return,y!==null){h=y;continue}break}if(k.child===P.child){for(P=k.child;P;){if(P===h)return vd(k),a;if(P===y)return vd(k),c;P=P.sibling}throw Error(n(188))}if(h.return!==y.return)h=k,y=P;else{for(var O=!1,F=k.child;F;){if(F===h){O=!0,h=k,y=P;break}if(F===y){O=!0,y=k,h=P;break}F=F.sibling}if(!O){for(F=P.child;F;){if(F===h){O=!0,h=P,y=k;break}if(F===y){O=!0,y=P,h=k;break}F=F.sibling}if(!O)throw Error(n(189))}}if(h.alternate!==y)throw Error(n(190))}if(h.tag!==3)throw Error(n(188));return h.stateNode.current===h?a:c}function yd(a){return a=_c(a),a!==null?wc(a):null}function wc(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var c=wc(a);if(c!==null)return c;a=a.sibling}return null}var xc=e.unstable_scheduleCallback,Uo=e.unstable_cancelCallback,_d=e.unstable_shouldYield,Qg=e.unstable_requestPaint,Xt=e.unstable_now,Jg=e.unstable_getCurrentPriorityLevel,wd=e.unstable_ImmediatePriority,Jh=e.unstable_UserBlockingPriority,Zo=e.unstable_NormalPriority,xd=e.unstable_LowPriority,bd=e.unstable_IdlePriority,bc=null,Ts=null;function ep(a){if(Ts&&typeof Ts.onCommitFiberRoot=="function")try{Ts.onCommitFiberRoot(bc,a,void 0,(a.current.flags&128)===128)}catch{}}var is=Math.clz32?Math.clz32:tv,ev=Math.log,Sd=Math.LN2;function tv(a){return a>>>=0,a===0?32:31-(ev(a)/Sd|0)|0}var Sc=64,kc=4194304;function ol(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Ec(a,c){var h=a.pendingLanes;if(h===0)return 0;var y=0,k=a.suspendedLanes,P=a.pingedLanes,O=h&268435455;if(O!==0){var F=O&~k;F!==0?y=ol(F):(P&=O,P!==0&&(y=ol(P)))}else O=h&~k,O!==0?y=ol(O):P!==0&&(y=ol(P));if(y===0)return 0;if(c!==0&&c!==y&&(c&k)===0&&(k=y&-y,P=c&-c,k>=P||k===16&&(P&4194240)!==0))return c;if((y&4)!==0&&(y|=h&16),c=a.entangledLanes,c!==0)for(a=a.entanglements,c&=y;0<c;)h=31-is(c),k=1<<h,y|=a[h],c&=~k;return y}function kd(a,c){switch(a){case 1:case 2:case 4:return c+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function nv(a,c){for(var h=a.suspendedLanes,y=a.pingedLanes,k=a.expirationTimes,P=a.pendingLanes;0<P;){var O=31-is(P),F=1<<O,G=k[O];G===-1?((F&h)===0||(F&y)!==0)&&(k[O]=kd(F,c)):G<=c&&(a.expiredLanes|=F),P&=~F}}function Ed(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function tp(){var a=Sc;return Sc<<=1,(Sc&4194240)===0&&(Sc=64),a}function al(a){for(var c=[],h=0;31>h;h++)c.push(a);return c}function Ji(a,c,h){a.pendingLanes|=c,c!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,c=31-is(c),a[c]=h}function np(a,c){var h=a.pendingLanes&~c;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=c,a.mutableReadLanes&=c,a.entangledLanes&=c,c=a.entanglements;var y=a.eventTimes;for(a=a.expirationTimes;0<h;){var k=31-is(h),P=1<<k;c[k]=0,y[k]=-1,a[k]=-1,h&=~P}}function Cd(a,c){var h=a.entangledLanes|=c;for(a=a.entanglements;h;){var y=31-is(h),k=1<<y;k&c|a[y]&c&&(a[y]|=c),h&=~k}}var jt=0;function eo(a){return a&=-a,1<a?4<a?(a&268435455)!==0?16:536870912:4:1}var Pd,ll,rp,sp,ip,Cc=!1,Pc=[],Ys=null,os=null,Is=null,Wo=new Map,qo=new Map,Xs=[],op="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 $(a,c){switch(a){case"focusin":case"focusout":Ys=null;break;case"dragenter":case"dragleave":os=null;break;case"mouseover":case"mouseout":Is=null;break;case"pointerover":case"pointerout":Wo.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":qo.delete(c.pointerId)}}function le(a,c,h,y,k,P){return a===null||a.nativeEvent!==P?(a={blockedOn:c,domEventName:h,eventSystemFlags:y,nativeEvent:P,targetContainers:[k]},c!==null&&(c=Fd(c),c!==null&&ll(c)),a):(a.eventSystemFlags|=y,c=a.targetContainers,k!==null&&c.indexOf(k)===-1&&c.push(k),a)}function Ee(a,c,h,y,k){switch(c){case"focusin":return Ys=le(Ys,a,c,h,y,k),!0;case"dragenter":return os=le(os,a,c,h,y,k),!0;case"mouseover":return Is=le(Is,a,c,h,y,k),!0;case"pointerover":var P=k.pointerId;return Wo.set(P,le(Wo.get(P)||null,a,c,h,y,k)),!0;case"gotpointercapture":return P=k.pointerId,qo.set(P,le(qo.get(P)||null,a,c,h,y,k)),!0}return!1}function he(a){var c=cl(a.target);if(c!==null){var h=As(c);if(h!==null){if(c=h.tag,c===13){if(c=Qi(h),c!==null){a.blockedOn=c,ip(a.priority,function(){rp(h)});return}}else if(c===3&&h.stateNode.current.memoizedState.isDehydrated){a.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}a.blockedOn=null}function pe(a){if(a.blockedOn!==null)return!1;for(var c=a.targetContainers;0<c.length;){var h=Qs(a.domEventName,a.eventSystemFlags,c[0],a.nativeEvent);if(h===null){h=a.nativeEvent;var y=new h.constructor(h.type,h);Xn=y,h.target.dispatchEvent(y),Xn=null}else return c=Fd(h),c!==null&&ll(c),a.blockedOn=h,!1;c.shift()}return!0}function be(a,c,h){pe(a)&&h.delete(c)}function Qe(){Cc=!1,Ys!==null&&pe(Ys)&&(Ys=null),os!==null&&pe(os)&&(os=null),Is!==null&&pe(Is)&&(Is=null),Wo.forEach(be),qo.forEach(be)}function Pe(a,c){a.blockedOn===c&&(a.blockedOn=null,Cc||(Cc=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Qe)))}function en(a){function c(k){return Pe(k,a)}if(0<Pc.length){Pe(Pc[0],a);for(var h=1;h<Pc.length;h++){var y=Pc[h];y.blockedOn===a&&(y.blockedOn=null)}}for(Ys!==null&&Pe(Ys,a),os!==null&&Pe(os,a),Is!==null&&Pe(Is,a),Wo.forEach(c),qo.forEach(c),h=0;h<Xs.length;h++)y=Xs[h],y.blockedOn===a&&(y.blockedOn=null);for(;0<Xs.length&&(h=Xs[0],h.blockedOn===null);)he(h),h.blockedOn===null&&Xs.shift()}var vn=R.ReactCurrentBatchConfig,Er=!0;function as(a,c,h,y){var k=jt,P=vn.transition;vn.transition=null;try{jt=1,lt(a,c,h,y)}finally{jt=k,vn.transition=P}}function ls(a,c,h,y){var k=jt,P=vn.transition;vn.transition=null;try{jt=4,lt(a,c,h,y)}finally{jt=k,vn.transition=P}}function lt(a,c,h,y){if(Er){var k=Qs(a,c,h,y);if(k===null)_v(a,c,y,Vt,h),$(a,y);else if(Ee(k,a,c,h,y))y.stopPropagation();else if($(a,y),c&4&&-1<op.indexOf(a)){for(;k!==null;){var P=Fd(k);if(P!==null&&Pd(P),P=Qs(a,c,h,y),P===null&&_v(a,c,y,Vt,h),P===k)break;k=P}k!==null&&y.stopPropagation()}else _v(a,c,y,null,h)}}var Vt=null;function Qs(a,c,h,y){if(Vt=null,a=Yi(y),a=cl(a),a!==null)if(c=As(a),c===null)a=null;else if(h=c.tag,h===13){if(a=Qi(c),a!==null)return a;a=null}else if(h===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;a=null}else c!==a&&(a=null);return Vt=a,null}function c4(a){switch(a){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Jg()){case wd:return 1;case Jh:return 4;case Zo:case xd:return 16;case bd:return 536870912;default:return 16}default:return 16}}var Go=null,rv=null,ap=null;function u4(){if(ap)return ap;var a,c=rv,h=c.length,y,k="value"in Go?Go.value:Go.textContent,P=k.length;for(a=0;a<h&&c[a]===k[a];a++);var O=h-a;for(y=1;y<=O&&c[h-y]===k[P-y];y++);return ap=k.slice(a,1<y?1-y:void 0)}function lp(a){var c=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&c===13&&(a=13)):a=c,a===10&&(a=13),32<=a||a===13?a:0}function cp(){return!0}function d4(){return!1}function cs(a){function c(h,y,k,P,O){this._reactName=h,this._targetInst=k,this.type=y,this.nativeEvent=P,this.target=O,this.currentTarget=null;for(var F in a)a.hasOwnProperty(F)&&(h=a[F],this[F]=h?h(P):P[F]);return this.isDefaultPrevented=(P.defaultPrevented!=null?P.defaultPrevented:P.returnValue===!1)?cp:d4,this.isPropagationStopped=d4,this}return W(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=cp)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=cp)},persist:function(){},isPersistent:cp}),c}var Rc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sv=cs(Rc),Rd=W({},Rc,{view:0,detail:0}),oN=cs(Rd),iv,ov,Ad,up=W({},Rd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lv,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Ad&&(Ad&&a.type==="mousemove"?(iv=a.screenX-Ad.screenX,ov=a.screenY-Ad.screenY):ov=iv=0,Ad=a),iv)},movementY:function(a){return"movementY"in a?a.movementY:ov}}),f4=cs(up),aN=W({},up,{dataTransfer:0}),lN=cs(aN),cN=W({},Rd,{relatedTarget:0}),av=cs(cN),uN=W({},Rc,{animationName:0,elapsedTime:0,pseudoElement:0}),dN=cs(uN),fN=W({},Rc,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),hN=cs(fN),pN=W({},Rc,{data:0}),h4=cs(pN),mN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gN={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"},vN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function yN(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=vN[a])?!!c[a]:!1}function lv(){return yN}var _N=W({},Rd,{key:function(a){if(a.key){var c=mN[a.key]||a.key;if(c!=="Unidentified")return c}return a.type==="keypress"?(a=lp(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?gN[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lv,charCode:function(a){return a.type==="keypress"?lp(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?lp(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),wN=cs(_N),xN=W({},up,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),p4=cs(xN),bN=W({},Rd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lv}),SN=cs(bN),kN=W({},Rc,{propertyName:0,elapsedTime:0,pseudoElement:0}),EN=cs(kN),CN=W({},up,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),PN=cs(CN),RN=[9,13,27,32],cv=l&&"CompositionEvent"in window,Td=null;l&&"documentMode"in document&&(Td=document.documentMode);var AN=l&&"TextEvent"in window&&!Td,m4=l&&(!cv||Td&&8<Td&&11>=Td),g4=" ",v4=!1;function y4(a,c){switch(a){case"keyup":return RN.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _4(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Ac=!1;function TN(a,c){switch(a){case"compositionend":return _4(c);case"keypress":return c.which!==32?null:(v4=!0,g4);case"textInput":return a=c.data,a===g4&&v4?null:a;default:return null}}function IN(a,c){if(Ac)return a==="compositionend"||!cv&&y4(a,c)?(a=u4(),ap=rv=Go=null,Ac=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return m4&&c.locale!=="ko"?null:c.data;default:return null}}var MN={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 w4(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c==="input"?!!MN[a.type]:c==="textarea"}function x4(a,c,h,y){Xi(y),c=mp(c,"onChange"),0<c.length&&(h=new sv("onChange","change",null,h,y),a.push({event:h,listeners:c}))}var Id=null,Md=null;function ON(a){F4(a,0)}function dp(a){var c=Lc(a);if(Ge(c))return a}function LN(a,c){if(a==="change")return c}var b4=!1;if(l){var uv;if(l){var dv="oninput"in document;if(!dv){var S4=document.createElement("div");S4.setAttribute("oninput","return;"),dv=typeof S4.oninput=="function"}uv=dv}else uv=!1;b4=uv&&(!document.documentMode||9<document.documentMode)}function k4(){Id&&(Id.detachEvent("onpropertychange",E4),Md=Id=null)}function E4(a){if(a.propertyName==="value"&&dp(Md)){var c=[];x4(c,Md,a,Yi(a)),zn(ON,c)}}function NN(a,c,h){a==="focusin"?(k4(),Id=c,Md=h,Id.attachEvent("onpropertychange",E4)):a==="focusout"&&k4()}function DN(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return dp(Md)}function $N(a,c){if(a==="click")return dp(c)}function jN(a,c){if(a==="input"||a==="change")return dp(c)}function FN(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var Js=typeof Object.is=="function"?Object.is:FN;function Od(a,c){if(Js(a,c))return!0;if(typeof a!="object"||a===null||typeof c!="object"||c===null)return!1;var h=Object.keys(a),y=Object.keys(c);if(h.length!==y.length)return!1;for(y=0;y<h.length;y++){var k=h[y];if(!u.call(c,k)||!Js(a[k],c[k]))return!1}return!0}function C4(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function P4(a,c){var h=C4(a);a=0;for(var y;h;){if(h.nodeType===3){if(y=a+h.textContent.length,a<=c&&y>=c)return{node:h,offset:c-a};a=y}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=C4(h)}}function R4(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?R4(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function A4(){for(var a=window,c=vt();c instanceof a.HTMLIFrameElement;){try{var h=typeof c.contentWindow.location.href=="string"}catch{h=!1}if(h)a=c.contentWindow;else break;c=vt(a.document)}return c}function fv(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}function VN(a){var c=A4(),h=a.focusedElem,y=a.selectionRange;if(c!==h&&h&&h.ownerDocument&&R4(h.ownerDocument.documentElement,h)){if(y!==null&&fv(h)){if(c=y.start,a=y.end,a===void 0&&(a=c),"selectionStart"in h)h.selectionStart=c,h.selectionEnd=Math.min(a,h.value.length);else if(a=(c=h.ownerDocument||document)&&c.defaultView||window,a.getSelection){a=a.getSelection();var k=h.textContent.length,P=Math.min(y.start,k);y=y.end===void 0?P:Math.min(y.end,k),!a.extend&&P>y&&(k=y,y=P,P=k),k=P4(h,P);var O=P4(h,y);k&&O&&(a.rangeCount!==1||a.anchorNode!==k.node||a.anchorOffset!==k.offset||a.focusNode!==O.node||a.focusOffset!==O.offset)&&(c=c.createRange(),c.setStart(k.node,k.offset),a.removeAllRanges(),P>y?(a.addRange(c),a.extend(O.node,O.offset)):(c.setEnd(O.node,O.offset),a.addRange(c)))}}for(c=[],a=h;a=a.parentNode;)a.nodeType===1&&c.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<c.length;h++)a=c[h],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var HN=l&&"documentMode"in document&&11>=document.documentMode,Tc=null,hv=null,Ld=null,pv=!1;function T4(a,c,h){var y=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;pv||Tc==null||Tc!==vt(y)||(y=Tc,"selectionStart"in y&&fv(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),Ld&&Od(Ld,y)||(Ld=y,y=mp(hv,"onSelect"),0<y.length&&(c=new sv("onSelect","select",null,c,h),a.push({event:c,listeners:y}),c.target=Tc)))}function fp(a,c){var h={};return h[a.toLowerCase()]=c.toLowerCase(),h["Webkit"+a]="webkit"+c,h["Moz"+a]="moz"+c,h}var Ic={animationend:fp("Animation","AnimationEnd"),animationiteration:fp("Animation","AnimationIteration"),animationstart:fp("Animation","AnimationStart"),transitionend:fp("Transition","TransitionEnd")},mv={},I4={};l&&(I4=document.createElement("div").style,"AnimationEvent"in window||(delete Ic.animationend.animation,delete Ic.animationiteration.animation,delete Ic.animationstart.animation),"TransitionEvent"in window||delete Ic.transitionend.transition);function hp(a){if(mv[a])return mv[a];if(!Ic[a])return a;var c=Ic[a],h;for(h in c)if(c.hasOwnProperty(h)&&h in I4)return mv[a]=c[h];return a}var M4=hp("animationend"),O4=hp("animationiteration"),L4=hp("animationstart"),N4=hp("transitionend"),D4=new Map,$4="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 Ko(a,c){D4.set(a,c),i(c,[a])}for(var gv=0;gv<$4.length;gv++){var vv=$4[gv],zN=vv.toLowerCase(),BN=vv[0].toUpperCase()+vv.slice(1);Ko(zN,"on"+BN)}Ko(M4,"onAnimationEnd"),Ko(O4,"onAnimationIteration"),Ko(L4,"onAnimationStart"),Ko("dblclick","onDoubleClick"),Ko("focusin","onFocus"),Ko("focusout","onBlur"),Ko(N4,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nd="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(" "),UN=new Set("cancel close invalid load scroll toggle".split(" ").concat(Nd));function j4(a,c,h){var y=a.type||"unknown-event";a.currentTarget=h,yc(y,c,void 0,a),a.currentTarget=null}function F4(a,c){c=(c&4)!==0;for(var h=0;h<a.length;h++){var y=a[h],k=y.event;y=y.listeners;e:{var P=void 0;if(c)for(var O=y.length-1;0<=O;O--){var F=y[O],G=F.instance,ie=F.currentTarget;if(F=F.listener,G!==P&&k.isPropagationStopped())break e;j4(k,F,ie),P=G}else for(O=0;O<y.length;O++){if(F=y[O],G=F.instance,ie=F.currentTarget,F=F.listener,G!==P&&k.isPropagationStopped())break e;j4(k,F,ie),P=G}}}if(Pn)throw a=il,Pn=!1,il=null,a}function tn(a,c){var h=c[Ev];h===void 0&&(h=c[Ev]=new Set);var y=a+"__bubble";h.has(y)||(V4(c,a,2,!1),h.add(y))}function yv(a,c,h){var y=0;c&&(y|=4),V4(h,a,y,c)}var pp="_reactListening"+Math.random().toString(36).slice(2);function Dd(a){if(!a[pp]){a[pp]=!0,r.forEach(function(h){h!=="selectionchange"&&(UN.has(h)||yv(h,!1,a),yv(h,!0,a))});var c=a.nodeType===9?a:a.ownerDocument;c===null||c[pp]||(c[pp]=!0,yv("selectionchange",!1,c))}}function V4(a,c,h,y){switch(c4(c)){case 1:var k=as;break;case 4:k=ls;break;default:k=lt}h=k.bind(null,c,h,a),k=void 0,!Bt||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(k=!0),y?k!==void 0?a.addEventListener(c,h,{capture:!0,passive:k}):a.addEventListener(c,h,!0):k!==void 0?a.addEventListener(c,h,{passive:k}):a.addEventListener(c,h,!1)}function _v(a,c,h,y,k){var P=y;if((c&1)===0&&(c&2)===0&&y!==null)e:for(;;){if(y===null)return;var O=y.tag;if(O===3||O===4){var F=y.stateNode.containerInfo;if(F===k||F.nodeType===8&&F.parentNode===k)break;if(O===4)for(O=y.return;O!==null;){var G=O.tag;if((G===3||G===4)&&(G=O.stateNode.containerInfo,G===k||G.nodeType===8&&G.parentNode===k))return;O=O.return}for(;F!==null;){if(O=cl(F),O===null)return;if(G=O.tag,G===5||G===6){y=P=O;continue e}F=F.parentNode}}y=y.return}zn(function(){var ie=P,ge=Yi(h),ye=[];e:{var me=D4.get(a);if(me!==void 0){var Te=sv,je=a;switch(a){case"keypress":if(lp(h)===0)break e;case"keydown":case"keyup":Te=wN;break;case"focusin":je="focus",Te=av;break;case"focusout":je="blur",Te=av;break;case"beforeblur":case"afterblur":Te=av;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Te=f4;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Te=lN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Te=SN;break;case M4:case O4:case L4:Te=dN;break;case N4:Te=EN;break;case"scroll":Te=oN;break;case"wheel":Te=PN;break;case"copy":case"cut":case"paste":Te=hN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Te=p4}var Ve=(c&4)!==0,Rn=!Ve&&a==="scroll",te=Ve?me!==null?me+"Capture":null:me;Ve=[];for(var K=ie,ne;K!==null;){ne=K;var xe=ne.stateNode;if(ne.tag===5&&xe!==null&&(ne=xe,te!==null&&(xe=ss(K,te),xe!=null&&Ve.push($d(K,xe,ne)))),Rn)break;K=K.return}0<Ve.length&&(me=new Te(me,je,null,h,ge),ye.push({event:me,listeners:Ve}))}}if((c&7)===0){e:{if(me=a==="mouseover"||a==="pointerover",Te=a==="mouseout"||a==="pointerout",me&&h!==Xn&&(je=h.relatedTarget||h.fromElement)&&(cl(je)||je[to]))break e;if((Te||me)&&(me=ge.window===ge?ge:(me=ge.ownerDocument)?me.defaultView||me.parentWindow:window,Te?(je=h.relatedTarget||h.toElement,Te=ie,je=je?cl(je):null,je!==null&&(Rn=As(je),je!==Rn||je.tag!==5&&je.tag!==6)&&(je=null)):(Te=null,je=ie),Te!==je)){if(Ve=f4,xe="onMouseLeave",te="onMouseEnter",K="mouse",(a==="pointerout"||a==="pointerover")&&(Ve=p4,xe="onPointerLeave",te="onPointerEnter",K="pointer"),Rn=Te==null?me:Lc(Te),ne=je==null?me:Lc(je),me=new Ve(xe,K+"leave",Te,h,ge),me.target=Rn,me.relatedTarget=ne,xe=null,cl(ge)===ie&&(Ve=new Ve(te,K+"enter",je,h,ge),Ve.target=ne,Ve.relatedTarget=Rn,xe=Ve),Rn=xe,Te&&je)t:{for(Ve=Te,te=je,K=0,ne=Ve;ne;ne=Mc(ne))K++;for(ne=0,xe=te;xe;xe=Mc(xe))ne++;for(;0<K-ne;)Ve=Mc(Ve),K--;for(;0<ne-K;)te=Mc(te),ne--;for(;K--;){if(Ve===te||te!==null&&Ve===te.alternate)break t;Ve=Mc(Ve),te=Mc(te)}Ve=null}else Ve=null;Te!==null&&H4(ye,me,Te,Ve,!1),je!==null&&Rn!==null&&H4(ye,Rn,je,Ve,!0)}}e:{if(me=ie?Lc(ie):window,Te=me.nodeName&&me.nodeName.toLowerCase(),Te==="select"||Te==="input"&&me.type==="file")var ze=LN;else if(w4(me))if(b4)ze=jN;else{ze=DN;var Je=NN}else(Te=me.nodeName)&&Te.toLowerCase()==="input"&&(me.type==="checkbox"||me.type==="radio")&&(ze=$N);if(ze&&(ze=ze(a,ie))){x4(ye,ze,h,ge);break e}Je&&Je(a,me,ie),a==="focusout"&&(Je=me._wrapperState)&&Je.controlled&&me.type==="number"&&Ke(me,"number",me.value)}switch(Je=ie?Lc(ie):window,a){case"focusin":(w4(Je)||Je.contentEditable==="true")&&(Tc=Je,hv=ie,Ld=null);break;case"focusout":Ld=hv=Tc=null;break;case"mousedown":pv=!0;break;case"contextmenu":case"mouseup":case"dragend":pv=!1,T4(ye,h,ge);break;case"selectionchange":if(HN)break;case"keydown":case"keyup":T4(ye,h,ge)}var et;if(cv)e:{switch(a){case"compositionstart":var rt="onCompositionStart";break e;case"compositionend":rt="onCompositionEnd";break e;case"compositionupdate":rt="onCompositionUpdate";break e}rt=void 0}else Ac?y4(a,h)&&(rt="onCompositionEnd"):a==="keydown"&&h.keyCode===229&&(rt="onCompositionStart");rt&&(m4&&h.locale!=="ko"&&(Ac||rt!=="onCompositionStart"?rt==="onCompositionEnd"&&Ac&&(et=u4()):(Go=ge,rv="value"in Go?Go.value:Go.textContent,Ac=!0)),Je=mp(ie,rt),0<Je.length&&(rt=new h4(rt,a,null,h,ge),ye.push({event:rt,listeners:Je}),et?rt.data=et:(et=_4(h),et!==null&&(rt.data=et)))),(et=AN?TN(a,h):IN(a,h))&&(ie=mp(ie,"onBeforeInput"),0<ie.length&&(ge=new h4("onBeforeInput","beforeinput",null,h,ge),ye.push({event:ge,listeners:ie}),ge.data=et))}F4(ye,c)})}function $d(a,c,h){return{instance:a,listener:c,currentTarget:h}}function mp(a,c){for(var h=c+"Capture",y=[];a!==null;){var k=a,P=k.stateNode;k.tag===5&&P!==null&&(k=P,P=ss(a,h),P!=null&&y.unshift($d(a,P,k)),P=ss(a,c),P!=null&&y.push($d(a,P,k))),a=a.return}return y}function Mc(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function H4(a,c,h,y,k){for(var P=c._reactName,O=[];h!==null&&h!==y;){var F=h,G=F.alternate,ie=F.stateNode;if(G!==null&&G===y)break;F.tag===5&&ie!==null&&(F=ie,k?(G=ss(h,P),G!=null&&O.unshift($d(h,G,F))):k||(G=ss(h,P),G!=null&&O.push($d(h,G,F)))),h=h.return}O.length!==0&&a.push({event:c,listeners:O})}var ZN=/\r\n?/g,WN=/\u0000|\uFFFD/g;function z4(a){return(typeof a=="string"?a:""+a).replace(ZN,`
|
|
40
|
-
`).replace(WN,"")}function gp(a,c,h){if(c=z4(c),z4(a)!==c&&h)throw Error(n(425))}function vp(){}var wv=null,xv=null;function bv(a,c){return a==="textarea"||a==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Sv=typeof setTimeout=="function"?setTimeout:void 0,qN=typeof clearTimeout=="function"?clearTimeout:void 0,B4=typeof Promise=="function"?Promise:void 0,GN=typeof queueMicrotask=="function"?queueMicrotask:typeof B4<"u"?function(a){return B4.resolve(null).then(a).catch(KN)}:Sv;function KN(a){setTimeout(function(){throw a})}function kv(a,c){var h=c,y=0;do{var k=h.nextSibling;if(a.removeChild(h),k&&k.nodeType===8)if(h=k.data,h==="/$"){if(y===0){a.removeChild(k),en(c);return}y--}else h!=="$"&&h!=="$?"&&h!=="$!"||y++;h=k}while(h);en(c)}function Yo(a){for(;a!=null;a=a.nextSibling){var c=a.nodeType;if(c===1||c===3)break;if(c===8){if(c=a.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return a}function U4(a){a=a.previousSibling;for(var c=0;a;){if(a.nodeType===8){var h=a.data;if(h==="$"||h==="$!"||h==="$?"){if(c===0)return a;c--}else h==="/$"&&c++}a=a.previousSibling}return null}var Oc=Math.random().toString(36).slice(2),_i="__reactFiber$"+Oc,jd="__reactProps$"+Oc,to="__reactContainer$"+Oc,Ev="__reactEvents$"+Oc,YN="__reactListeners$"+Oc,XN="__reactHandles$"+Oc;function cl(a){var c=a[_i];if(c)return c;for(var h=a.parentNode;h;){if(c=h[to]||h[_i]){if(h=c.alternate,c.child!==null||h!==null&&h.child!==null)for(a=U4(a);a!==null;){if(h=a[_i])return h;a=U4(a)}return c}a=h,h=a.parentNode}return null}function Fd(a){return a=a[_i]||a[to],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function Lc(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(n(33))}function yp(a){return a[jd]||null}var Cv=[],Nc=-1;function Xo(a){return{current:a}}function nn(a){0>Nc||(a.current=Cv[Nc],Cv[Nc]=null,Nc--)}function Qt(a,c){Nc++,Cv[Nc]=a.current,a.current=c}var Qo={},vr=Xo(Qo),jr=Xo(!1),ul=Qo;function Dc(a,c){var h=a.type.contextTypes;if(!h)return Qo;var y=a.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===c)return y.__reactInternalMemoizedMaskedChildContext;var k={},P;for(P in h)k[P]=c[P];return y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=c,a.__reactInternalMemoizedMaskedChildContext=k),k}function Fr(a){return a=a.childContextTypes,a!=null}function _p(){nn(jr),nn(vr)}function Z4(a,c,h){if(vr.current!==Qo)throw Error(n(168));Qt(vr,c),Qt(jr,h)}function W4(a,c,h){var y=a.stateNode;if(c=c.childContextTypes,typeof y.getChildContext!="function")return h;y=y.getChildContext();for(var k in y)if(!(k in c))throw Error(n(108,_e(a)||"Unknown",k));return W({},h,y)}function wp(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Qo,ul=vr.current,Qt(vr,a),Qt(jr,jr.current),!0}function q4(a,c,h){var y=a.stateNode;if(!y)throw Error(n(169));h?(a=W4(a,c,ul),y.__reactInternalMemoizedMergedChildContext=a,nn(jr),nn(vr),Qt(vr,a)):nn(jr),Qt(jr,h)}var no=null,xp=!1,Pv=!1;function G4(a){no===null?no=[a]:no.push(a)}function QN(a){xp=!0,G4(a)}function Jo(){if(!Pv&&no!==null){Pv=!0;var a=0,c=jt;try{var h=no;for(jt=1;a<h.length;a++){var y=h[a];do y=y(!0);while(y!==null)}no=null,xp=!1}catch(k){throw no!==null&&(no=no.slice(a+1)),xc(wd,Jo),k}finally{jt=c,Pv=!1}}return null}var $c=[],jc=0,bp=null,Sp=0,Ms=[],Os=0,dl=null,ro=1,so="";function fl(a,c){$c[jc++]=Sp,$c[jc++]=bp,bp=a,Sp=c}function K4(a,c,h){Ms[Os++]=ro,Ms[Os++]=so,Ms[Os++]=dl,dl=a;var y=ro;a=so;var k=32-is(y)-1;y&=~(1<<k),h+=1;var P=32-is(c)+k;if(30<P){var O=k-k%5;P=(y&(1<<O)-1).toString(32),y>>=O,k-=O,ro=1<<32-is(c)+k|h<<k|y,so=P+a}else ro=1<<P|h<<k|y,so=a}function Rv(a){a.return!==null&&(fl(a,1),K4(a,1,0))}function Av(a){for(;a===bp;)bp=$c[--jc],$c[jc]=null,Sp=$c[--jc],$c[jc]=null;for(;a===dl;)dl=Ms[--Os],Ms[Os]=null,so=Ms[--Os],Ms[Os]=null,ro=Ms[--Os],Ms[Os]=null}var us=null,ds=null,dn=!1,ei=null;function Y4(a,c){var h=$s(5,null,null,0);h.elementType="DELETED",h.stateNode=c,h.return=a,c=a.deletions,c===null?(a.deletions=[h],a.flags|=16):c.push(h)}function X4(a,c){switch(a.tag){case 5:var h=a.type;return c=c.nodeType!==1||h.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(a.stateNode=c,us=a,ds=Yo(c.firstChild),!0):!1;case 6:return c=a.pendingProps===""||c.nodeType!==3?null:c,c!==null?(a.stateNode=c,us=a,ds=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(h=dl!==null?{id:ro,overflow:so}:null,a.memoizedState={dehydrated:c,treeContext:h,retryLane:1073741824},h=$s(18,null,null,0),h.stateNode=c,h.return=a,a.child=h,us=a,ds=null,!0):!1;default:return!1}}function Tv(a){return(a.mode&1)!==0&&(a.flags&128)===0}function Iv(a){if(dn){var c=ds;if(c){var h=c;if(!X4(a,c)){if(Tv(a))throw Error(n(418));c=Yo(h.nextSibling);var y=us;c&&X4(a,c)?Y4(y,h):(a.flags=a.flags&-4097|2,dn=!1,us=a)}}else{if(Tv(a))throw Error(n(418));a.flags=a.flags&-4097|2,dn=!1,us=a}}}function Q4(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;us=a}function kp(a){if(a!==us)return!1;if(!dn)return Q4(a),dn=!0,!1;var c;if((c=a.tag!==3)&&!(c=a.tag!==5)&&(c=a.type,c=c!=="head"&&c!=="body"&&!bv(a.type,a.memoizedProps)),c&&(c=ds)){if(Tv(a))throw J4(),Error(n(418));for(;c;)Y4(a,c),c=Yo(c.nextSibling)}if(Q4(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));e:{for(a=a.nextSibling,c=0;a;){if(a.nodeType===8){var h=a.data;if(h==="/$"){if(c===0){ds=Yo(a.nextSibling);break e}c--}else h!=="$"&&h!=="$!"&&h!=="$?"||c++}a=a.nextSibling}ds=null}}else ds=us?Yo(a.stateNode.nextSibling):null;return!0}function J4(){for(var a=ds;a;)a=Yo(a.nextSibling)}function Fc(){ds=us=null,dn=!1}function Mv(a){ei===null?ei=[a]:ei.push(a)}var JN=R.ReactCurrentBatchConfig;function Vd(a,c,h){if(a=h.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(h._owner){if(h=h._owner,h){if(h.tag!==1)throw Error(n(309));var y=h.stateNode}if(!y)throw Error(n(147,a));var k=y,P=""+a;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===P?c.ref:(c=function(O){var F=k.refs;O===null?delete F[P]:F[P]=O},c._stringRef=P,c)}if(typeof a!="string")throw Error(n(284));if(!h._owner)throw Error(n(290,a))}return a}function Ep(a,c){throw a=Object.prototype.toString.call(c),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":a))}function e6(a){var c=a._init;return c(a._payload)}function t6(a){function c(te,K){if(a){var ne=te.deletions;ne===null?(te.deletions=[K],te.flags|=16):ne.push(K)}}function h(te,K){if(!a)return null;for(;K!==null;)c(te,K),K=K.sibling;return null}function y(te,K){for(te=new Map;K!==null;)K.key!==null?te.set(K.key,K):te.set(K.index,K),K=K.sibling;return te}function k(te,K){return te=aa(te,K),te.index=0,te.sibling=null,te}function P(te,K,ne){return te.index=ne,a?(ne=te.alternate,ne!==null?(ne=ne.index,ne<K?(te.flags|=2,K):ne):(te.flags|=2,K)):(te.flags|=1048576,K)}function O(te){return a&&te.alternate===null&&(te.flags|=2),te}function F(te,K,ne,xe){return K===null||K.tag!==6?(K=S1(ne,te.mode,xe),K.return=te,K):(K=k(K,ne),K.return=te,K)}function G(te,K,ne,xe){var ze=ne.type;return ze===M?ge(te,K,ne.props.children,xe,ne.key):K!==null&&(K.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===Z&&e6(ze)===K.type)?(xe=k(K,ne.props),xe.ref=Vd(te,K,ne),xe.return=te,xe):(xe=Kp(ne.type,ne.key,ne.props,null,te.mode,xe),xe.ref=Vd(te,K,ne),xe.return=te,xe)}function ie(te,K,ne,xe){return K===null||K.tag!==4||K.stateNode.containerInfo!==ne.containerInfo||K.stateNode.implementation!==ne.implementation?(K=k1(ne,te.mode,xe),K.return=te,K):(K=k(K,ne.children||[]),K.return=te,K)}function ge(te,K,ne,xe,ze){return K===null||K.tag!==7?(K=wl(ne,te.mode,xe,ze),K.return=te,K):(K=k(K,ne),K.return=te,K)}function ye(te,K,ne){if(typeof K=="string"&&K!==""||typeof K=="number")return K=S1(""+K,te.mode,ne),K.return=te,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case A:return ne=Kp(K.type,K.key,K.props,null,te.mode,ne),ne.ref=Vd(te,null,K),ne.return=te,ne;case I:return K=k1(K,te.mode,ne),K.return=te,K;case Z:var xe=K._init;return ye(te,xe(K._payload),ne)}if(St(K)||ee(K))return K=wl(K,te.mode,ne,null),K.return=te,K;Ep(te,K)}return null}function me(te,K,ne,xe){var ze=K!==null?K.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number")return ze!==null?null:F(te,K,""+ne,xe);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case A:return ne.key===ze?G(te,K,ne,xe):null;case I:return ne.key===ze?ie(te,K,ne,xe):null;case Z:return ze=ne._init,me(te,K,ze(ne._payload),xe)}if(St(ne)||ee(ne))return ze!==null?null:ge(te,K,ne,xe,null);Ep(te,ne)}return null}function Te(te,K,ne,xe,ze){if(typeof xe=="string"&&xe!==""||typeof xe=="number")return te=te.get(ne)||null,F(K,te,""+xe,ze);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case A:return te=te.get(xe.key===null?ne:xe.key)||null,G(K,te,xe,ze);case I:return te=te.get(xe.key===null?ne:xe.key)||null,ie(K,te,xe,ze);case Z:var Je=xe._init;return Te(te,K,ne,Je(xe._payload),ze)}if(St(xe)||ee(xe))return te=te.get(ne)||null,ge(K,te,xe,ze,null);Ep(K,xe)}return null}function je(te,K,ne,xe){for(var ze=null,Je=null,et=K,rt=K=0,er=null;et!==null&&rt<ne.length;rt++){et.index>rt?(er=et,et=null):er=et.sibling;var Lt=me(te,et,ne[rt],xe);if(Lt===null){et===null&&(et=er);break}a&&et&&Lt.alternate===null&&c(te,et),K=P(Lt,K,rt),Je===null?ze=Lt:Je.sibling=Lt,Je=Lt,et=er}if(rt===ne.length)return h(te,et),dn&&fl(te,rt),ze;if(et===null){for(;rt<ne.length;rt++)et=ye(te,ne[rt],xe),et!==null&&(K=P(et,K,rt),Je===null?ze=et:Je.sibling=et,Je=et);return dn&&fl(te,rt),ze}for(et=y(te,et);rt<ne.length;rt++)er=Te(et,te,rt,ne[rt],xe),er!==null&&(a&&er.alternate!==null&&et.delete(er.key===null?rt:er.key),K=P(er,K,rt),Je===null?ze=er:Je.sibling=er,Je=er);return a&&et.forEach(function(la){return c(te,la)}),dn&&fl(te,rt),ze}function Ve(te,K,ne,xe){var ze=ee(ne);if(typeof ze!="function")throw Error(n(150));if(ne=ze.call(ne),ne==null)throw Error(n(151));for(var Je=ze=null,et=K,rt=K=0,er=null,Lt=ne.next();et!==null&&!Lt.done;rt++,Lt=ne.next()){et.index>rt?(er=et,et=null):er=et.sibling;var la=me(te,et,Lt.value,xe);if(la===null){et===null&&(et=er);break}a&&et&&la.alternate===null&&c(te,et),K=P(la,K,rt),Je===null?ze=la:Je.sibling=la,Je=la,et=er}if(Lt.done)return h(te,et),dn&&fl(te,rt),ze;if(et===null){for(;!Lt.done;rt++,Lt=ne.next())Lt=ye(te,Lt.value,xe),Lt!==null&&(K=P(Lt,K,rt),Je===null?ze=Lt:Je.sibling=Lt,Je=Lt);return dn&&fl(te,rt),ze}for(et=y(te,et);!Lt.done;rt++,Lt=ne.next())Lt=Te(et,te,rt,Lt.value,xe),Lt!==null&&(a&&Lt.alternate!==null&&et.delete(Lt.key===null?rt:Lt.key),K=P(Lt,K,rt),Je===null?ze=Lt:Je.sibling=Lt,Je=Lt);return a&&et.forEach(function(MD){return c(te,MD)}),dn&&fl(te,rt),ze}function Rn(te,K,ne,xe){if(typeof ne=="object"&&ne!==null&&ne.type===M&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case A:e:{for(var ze=ne.key,Je=K;Je!==null;){if(Je.key===ze){if(ze=ne.type,ze===M){if(Je.tag===7){h(te,Je.sibling),K=k(Je,ne.props.children),K.return=te,te=K;break e}}else if(Je.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===Z&&e6(ze)===Je.type){h(te,Je.sibling),K=k(Je,ne.props),K.ref=Vd(te,Je,ne),K.return=te,te=K;break e}h(te,Je);break}else c(te,Je);Je=Je.sibling}ne.type===M?(K=wl(ne.props.children,te.mode,xe,ne.key),K.return=te,te=K):(xe=Kp(ne.type,ne.key,ne.props,null,te.mode,xe),xe.ref=Vd(te,K,ne),xe.return=te,te=xe)}return O(te);case I:e:{for(Je=ne.key;K!==null;){if(K.key===Je)if(K.tag===4&&K.stateNode.containerInfo===ne.containerInfo&&K.stateNode.implementation===ne.implementation){h(te,K.sibling),K=k(K,ne.children||[]),K.return=te,te=K;break e}else{h(te,K);break}else c(te,K);K=K.sibling}K=k1(ne,te.mode,xe),K.return=te,te=K}return O(te);case Z:return Je=ne._init,Rn(te,K,Je(ne._payload),xe)}if(St(ne))return je(te,K,ne,xe);if(ee(ne))return Ve(te,K,ne,xe);Ep(te,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"?(ne=""+ne,K!==null&&K.tag===6?(h(te,K.sibling),K=k(K,ne),K.return=te,te=K):(h(te,K),K=S1(ne,te.mode,xe),K.return=te,te=K),O(te)):h(te,K)}return Rn}var Vc=t6(!0),n6=t6(!1),Cp=Xo(null),Pp=null,Hc=null,Ov=null;function Lv(){Ov=Hc=Pp=null}function Nv(a){var c=Cp.current;nn(Cp),a._currentValue=c}function Dv(a,c,h){for(;a!==null;){var y=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),a===h)break;a=a.return}}function zc(a,c){Pp=a,Ov=Hc=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&c)!==0&&(Vr=!0),a.firstContext=null)}function Ls(a){var c=a._currentValue;if(Ov!==a)if(a={context:a,memoizedValue:c,next:null},Hc===null){if(Pp===null)throw Error(n(308));Hc=a,Pp.dependencies={lanes:0,firstContext:a}}else Hc=Hc.next=a;return c}var hl=null;function $v(a){hl===null?hl=[a]:hl.push(a)}function r6(a,c,h,y){var k=c.interleaved;return k===null?(h.next=h,$v(c)):(h.next=k.next,k.next=h),c.interleaved=h,io(a,y)}function io(a,c){a.lanes|=c;var h=a.alternate;for(h!==null&&(h.lanes|=c),h=a,a=a.return;a!==null;)a.childLanes|=c,h=a.alternate,h!==null&&(h.childLanes|=c),h=a,a=a.return;return h.tag===3?h.stateNode:null}var ea=!1;function jv(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function s6(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function oo(a,c){return{eventTime:a,lane:c,tag:0,payload:null,callback:null,next:null}}function ta(a,c,h){var y=a.updateQueue;if(y===null)return null;if(y=y.shared,(Ct&2)!==0){var k=y.pending;return k===null?c.next=c:(c.next=k.next,k.next=c),y.pending=c,io(a,h)}return k=y.interleaved,k===null?(c.next=c,$v(y)):(c.next=k.next,k.next=c),y.interleaved=c,io(a,h)}function Rp(a,c,h){if(c=c.updateQueue,c!==null&&(c=c.shared,(h&4194240)!==0)){var y=c.lanes;y&=a.pendingLanes,h|=y,c.lanes=h,Cd(a,h)}}function i6(a,c){var h=a.updateQueue,y=a.alternate;if(y!==null&&(y=y.updateQueue,h===y)){var k=null,P=null;if(h=h.firstBaseUpdate,h!==null){do{var O={eventTime:h.eventTime,lane:h.lane,tag:h.tag,payload:h.payload,callback:h.callback,next:null};P===null?k=P=O:P=P.next=O,h=h.next}while(h!==null);P===null?k=P=c:P=P.next=c}else k=P=c;h={baseState:y.baseState,firstBaseUpdate:k,lastBaseUpdate:P,shared:y.shared,effects:y.effects},a.updateQueue=h;return}a=h.lastBaseUpdate,a===null?h.firstBaseUpdate=c:a.next=c,h.lastBaseUpdate=c}function Ap(a,c,h,y){var k=a.updateQueue;ea=!1;var P=k.firstBaseUpdate,O=k.lastBaseUpdate,F=k.shared.pending;if(F!==null){k.shared.pending=null;var G=F,ie=G.next;G.next=null,O===null?P=ie:O.next=ie,O=G;var ge=a.alternate;ge!==null&&(ge=ge.updateQueue,F=ge.lastBaseUpdate,F!==O&&(F===null?ge.firstBaseUpdate=ie:F.next=ie,ge.lastBaseUpdate=G))}if(P!==null){var ye=k.baseState;O=0,ge=ie=G=null,F=P;do{var me=F.lane,Te=F.eventTime;if((y&me)===me){ge!==null&&(ge=ge.next={eventTime:Te,lane:0,tag:F.tag,payload:F.payload,callback:F.callback,next:null});e:{var je=a,Ve=F;switch(me=c,Te=h,Ve.tag){case 1:if(je=Ve.payload,typeof je=="function"){ye=je.call(Te,ye,me);break e}ye=je;break e;case 3:je.flags=je.flags&-65537|128;case 0:if(je=Ve.payload,me=typeof je=="function"?je.call(Te,ye,me):je,me==null)break e;ye=W({},ye,me);break e;case 2:ea=!0}}F.callback!==null&&F.lane!==0&&(a.flags|=64,me=k.effects,me===null?k.effects=[F]:me.push(F))}else Te={eventTime:Te,lane:me,tag:F.tag,payload:F.payload,callback:F.callback,next:null},ge===null?(ie=ge=Te,G=ye):ge=ge.next=Te,O|=me;if(F=F.next,F===null){if(F=k.shared.pending,F===null)break;me=F,F=me.next,me.next=null,k.lastBaseUpdate=me,k.shared.pending=null}}while(!0);if(ge===null&&(G=ye),k.baseState=G,k.firstBaseUpdate=ie,k.lastBaseUpdate=ge,c=k.shared.interleaved,c!==null){k=c;do O|=k.lane,k=k.next;while(k!==c)}else P===null&&(k.shared.lanes=0);gl|=O,a.lanes=O,a.memoizedState=ye}}function o6(a,c,h){if(a=c.effects,c.effects=null,a!==null)for(c=0;c<a.length;c++){var y=a[c],k=y.callback;if(k!==null){if(y.callback=null,y=h,typeof k!="function")throw Error(n(191,k));k.call(y)}}}var Hd={},wi=Xo(Hd),zd=Xo(Hd),Bd=Xo(Hd);function pl(a){if(a===Hd)throw Error(n(174));return a}function Fv(a,c){switch(Qt(Bd,c),Qt(zd,a),Qt(wi,Hd),a=c.nodeType,a){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:mr(null,"");break;default:a=a===8?c.parentNode:c,c=a.namespaceURI||null,a=a.tagName,c=mr(c,a)}nn(wi),Qt(wi,c)}function Bc(){nn(wi),nn(zd),nn(Bd)}function a6(a){pl(Bd.current);var c=pl(wi.current),h=mr(c,a.type);c!==h&&(Qt(zd,a),Qt(wi,h))}function Vv(a){zd.current===a&&(nn(wi),nn(zd))}var yn=Xo(0);function Tp(a){for(var c=a;c!==null;){if(c.tag===13){var h=c.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||h.data==="$?"||h.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var Hv=[];function zv(){for(var a=0;a<Hv.length;a++)Hv[a]._workInProgressVersionPrimary=null;Hv.length=0}var Ip=R.ReactCurrentDispatcher,Bv=R.ReactCurrentBatchConfig,ml=0,_n=null,Bn=null,Qn=null,Mp=!1,Ud=!1,Zd=0,eD=0;function yr(){throw Error(n(321))}function Uv(a,c){if(c===null)return!1;for(var h=0;h<c.length&&h<a.length;h++)if(!Js(a[h],c[h]))return!1;return!0}function Zv(a,c,h,y,k,P){if(ml=P,_n=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Ip.current=a===null||a.memoizedState===null?sD:iD,a=h(y,k),Ud){P=0;do{if(Ud=!1,Zd=0,25<=P)throw Error(n(301));P+=1,Qn=Bn=null,c.updateQueue=null,Ip.current=oD,a=h(y,k)}while(Ud)}if(Ip.current=Np,c=Bn!==null&&Bn.next!==null,ml=0,Qn=Bn=_n=null,Mp=!1,c)throw Error(n(300));return a}function Wv(){var a=Zd!==0;return Zd=0,a}function xi(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qn===null?_n.memoizedState=Qn=a:Qn=Qn.next=a,Qn}function Ns(){if(Bn===null){var a=_n.alternate;a=a!==null?a.memoizedState:null}else a=Bn.next;var c=Qn===null?_n.memoizedState:Qn.next;if(c!==null)Qn=c,Bn=a;else{if(a===null)throw Error(n(310));Bn=a,a={memoizedState:Bn.memoizedState,baseState:Bn.baseState,baseQueue:Bn.baseQueue,queue:Bn.queue,next:null},Qn===null?_n.memoizedState=Qn=a:Qn=Qn.next=a}return Qn}function Wd(a,c){return typeof c=="function"?c(a):c}function qv(a){var c=Ns(),h=c.queue;if(h===null)throw Error(n(311));h.lastRenderedReducer=a;var y=Bn,k=y.baseQueue,P=h.pending;if(P!==null){if(k!==null){var O=k.next;k.next=P.next,P.next=O}y.baseQueue=k=P,h.pending=null}if(k!==null){P=k.next,y=y.baseState;var F=O=null,G=null,ie=P;do{var ge=ie.lane;if((ml&ge)===ge)G!==null&&(G=G.next={lane:0,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),y=ie.hasEagerState?ie.eagerState:a(y,ie.action);else{var ye={lane:ge,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null};G===null?(F=G=ye,O=y):G=G.next=ye,_n.lanes|=ge,gl|=ge}ie=ie.next}while(ie!==null&&ie!==P);G===null?O=y:G.next=F,Js(y,c.memoizedState)||(Vr=!0),c.memoizedState=y,c.baseState=O,c.baseQueue=G,h.lastRenderedState=y}if(a=h.interleaved,a!==null){k=a;do P=k.lane,_n.lanes|=P,gl|=P,k=k.next;while(k!==a)}else k===null&&(h.lanes=0);return[c.memoizedState,h.dispatch]}function Gv(a){var c=Ns(),h=c.queue;if(h===null)throw Error(n(311));h.lastRenderedReducer=a;var y=h.dispatch,k=h.pending,P=c.memoizedState;if(k!==null){h.pending=null;var O=k=k.next;do P=a(P,O.action),O=O.next;while(O!==k);Js(P,c.memoizedState)||(Vr=!0),c.memoizedState=P,c.baseQueue===null&&(c.baseState=P),h.lastRenderedState=P}return[P,y]}function l6(){}function c6(a,c){var h=_n,y=Ns(),k=c(),P=!Js(y.memoizedState,k);if(P&&(y.memoizedState=k,Vr=!0),y=y.queue,Kv(f6.bind(null,h,y,a),[a]),y.getSnapshot!==c||P||Qn!==null&&Qn.memoizedState.tag&1){if(h.flags|=2048,qd(9,d6.bind(null,h,y,k,c),void 0,null),Jn===null)throw Error(n(349));(ml&30)!==0||u6(h,c,k)}return k}function u6(a,c,h){a.flags|=16384,a={getSnapshot:c,value:h},c=_n.updateQueue,c===null?(c={lastEffect:null,stores:null},_n.updateQueue=c,c.stores=[a]):(h=c.stores,h===null?c.stores=[a]:h.push(a))}function d6(a,c,h,y){c.value=h,c.getSnapshot=y,h6(c)&&p6(a)}function f6(a,c,h){return h(function(){h6(c)&&p6(a)})}function h6(a){var c=a.getSnapshot;a=a.value;try{var h=c();return!Js(a,h)}catch{return!0}}function p6(a){var c=io(a,1);c!==null&&si(c,a,1,-1)}function m6(a){var c=xi();return typeof a=="function"&&(a=a()),c.memoizedState=c.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Wd,lastRenderedState:a},c.queue=a,a=a.dispatch=rD.bind(null,_n,a),[c.memoizedState,a]}function qd(a,c,h,y){return a={tag:a,create:c,destroy:h,deps:y,next:null},c=_n.updateQueue,c===null?(c={lastEffect:null,stores:null},_n.updateQueue=c,c.lastEffect=a.next=a):(h=c.lastEffect,h===null?c.lastEffect=a.next=a:(y=h.next,h.next=a,a.next=y,c.lastEffect=a)),a}function g6(){return Ns().memoizedState}function Op(a,c,h,y){var k=xi();_n.flags|=a,k.memoizedState=qd(1|c,h,void 0,y===void 0?null:y)}function Lp(a,c,h,y){var k=Ns();y=y===void 0?null:y;var P=void 0;if(Bn!==null){var O=Bn.memoizedState;if(P=O.destroy,y!==null&&Uv(y,O.deps)){k.memoizedState=qd(c,h,P,y);return}}_n.flags|=a,k.memoizedState=qd(1|c,h,P,y)}function v6(a,c){return Op(8390656,8,a,c)}function Kv(a,c){return Lp(2048,8,a,c)}function y6(a,c){return Lp(4,2,a,c)}function _6(a,c){return Lp(4,4,a,c)}function w6(a,c){if(typeof c=="function")return a=a(),c(a),function(){c(null)};if(c!=null)return a=a(),c.current=a,function(){c.current=null}}function x6(a,c,h){return h=h!=null?h.concat([a]):null,Lp(4,4,w6.bind(null,c,a),h)}function Yv(){}function b6(a,c){var h=Ns();c=c===void 0?null:c;var y=h.memoizedState;return y!==null&&c!==null&&Uv(c,y[1])?y[0]:(h.memoizedState=[a,c],a)}function S6(a,c){var h=Ns();c=c===void 0?null:c;var y=h.memoizedState;return y!==null&&c!==null&&Uv(c,y[1])?y[0]:(a=a(),h.memoizedState=[a,c],a)}function k6(a,c,h){return(ml&21)===0?(a.baseState&&(a.baseState=!1,Vr=!0),a.memoizedState=h):(Js(h,c)||(h=tp(),_n.lanes|=h,gl|=h,a.baseState=!0),c)}function tD(a,c){var h=jt;jt=h!==0&&4>h?h:4,a(!0);var y=Bv.transition;Bv.transition={};try{a(!1),c()}finally{jt=h,Bv.transition=y}}function E6(){return Ns().memoizedState}function nD(a,c,h){var y=ia(a);if(h={lane:y,action:h,hasEagerState:!1,eagerState:null,next:null},C6(a))P6(c,h);else if(h=r6(a,c,h,y),h!==null){var k=Pr();si(h,a,y,k),R6(h,c,y)}}function rD(a,c,h){var y=ia(a),k={lane:y,action:h,hasEagerState:!1,eagerState:null,next:null};if(C6(a))P6(c,k);else{var P=a.alternate;if(a.lanes===0&&(P===null||P.lanes===0)&&(P=c.lastRenderedReducer,P!==null))try{var O=c.lastRenderedState,F=P(O,h);if(k.hasEagerState=!0,k.eagerState=F,Js(F,O)){var G=c.interleaved;G===null?(k.next=k,$v(c)):(k.next=G.next,G.next=k),c.interleaved=k;return}}catch{}finally{}h=r6(a,c,k,y),h!==null&&(k=Pr(),si(h,a,y,k),R6(h,c,y))}}function C6(a){var c=a.alternate;return a===_n||c!==null&&c===_n}function P6(a,c){Ud=Mp=!0;var h=a.pending;h===null?c.next=c:(c.next=h.next,h.next=c),a.pending=c}function R6(a,c,h){if((h&4194240)!==0){var y=c.lanes;y&=a.pendingLanes,h|=y,c.lanes=h,Cd(a,h)}}var Np={readContext:Ls,useCallback:yr,useContext:yr,useEffect:yr,useImperativeHandle:yr,useInsertionEffect:yr,useLayoutEffect:yr,useMemo:yr,useReducer:yr,useRef:yr,useState:yr,useDebugValue:yr,useDeferredValue:yr,useTransition:yr,useMutableSource:yr,useSyncExternalStore:yr,useId:yr,unstable_isNewReconciler:!1},sD={readContext:Ls,useCallback:function(a,c){return xi().memoizedState=[a,c===void 0?null:c],a},useContext:Ls,useEffect:v6,useImperativeHandle:function(a,c,h){return h=h!=null?h.concat([a]):null,Op(4194308,4,w6.bind(null,c,a),h)},useLayoutEffect:function(a,c){return Op(4194308,4,a,c)},useInsertionEffect:function(a,c){return Op(4,2,a,c)},useMemo:function(a,c){var h=xi();return c=c===void 0?null:c,a=a(),h.memoizedState=[a,c],a},useReducer:function(a,c,h){var y=xi();return c=h!==void 0?h(c):c,y.memoizedState=y.baseState=c,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:c},y.queue=a,a=a.dispatch=nD.bind(null,_n,a),[y.memoizedState,a]},useRef:function(a){var c=xi();return a={current:a},c.memoizedState=a},useState:m6,useDebugValue:Yv,useDeferredValue:function(a){return xi().memoizedState=a},useTransition:function(){var a=m6(!1),c=a[0];return a=tD.bind(null,a[1]),xi().memoizedState=a,[c,a]},useMutableSource:function(){},useSyncExternalStore:function(a,c,h){var y=_n,k=xi();if(dn){if(h===void 0)throw Error(n(407));h=h()}else{if(h=c(),Jn===null)throw Error(n(349));(ml&30)!==0||u6(y,c,h)}k.memoizedState=h;var P={value:h,getSnapshot:c};return k.queue=P,v6(f6.bind(null,y,P,a),[a]),y.flags|=2048,qd(9,d6.bind(null,y,P,h,c),void 0,null),h},useId:function(){var a=xi(),c=Jn.identifierPrefix;if(dn){var h=so,y=ro;h=(y&~(1<<32-is(y)-1)).toString(32)+h,c=":"+c+"R"+h,h=Zd++,0<h&&(c+="H"+h.toString(32)),c+=":"}else h=eD++,c=":"+c+"r"+h.toString(32)+":";return a.memoizedState=c},unstable_isNewReconciler:!1},iD={readContext:Ls,useCallback:b6,useContext:Ls,useEffect:Kv,useImperativeHandle:x6,useInsertionEffect:y6,useLayoutEffect:_6,useMemo:S6,useReducer:qv,useRef:g6,useState:function(){return qv(Wd)},useDebugValue:Yv,useDeferredValue:function(a){var c=Ns();return k6(c,Bn.memoizedState,a)},useTransition:function(){var a=qv(Wd)[0],c=Ns().memoizedState;return[a,c]},useMutableSource:l6,useSyncExternalStore:c6,useId:E6,unstable_isNewReconciler:!1},oD={readContext:Ls,useCallback:b6,useContext:Ls,useEffect:Kv,useImperativeHandle:x6,useInsertionEffect:y6,useLayoutEffect:_6,useMemo:S6,useReducer:Gv,useRef:g6,useState:function(){return Gv(Wd)},useDebugValue:Yv,useDeferredValue:function(a){var c=Ns();return Bn===null?c.memoizedState=a:k6(c,Bn.memoizedState,a)},useTransition:function(){var a=Gv(Wd)[0],c=Ns().memoizedState;return[a,c]},useMutableSource:l6,useSyncExternalStore:c6,useId:E6,unstable_isNewReconciler:!1};function ti(a,c){if(a&&a.defaultProps){c=W({},c),a=a.defaultProps;for(var h in a)c[h]===void 0&&(c[h]=a[h]);return c}return c}function Xv(a,c,h,y){c=a.memoizedState,h=h(y,c),h=h==null?c:W({},c,h),a.memoizedState=h,a.lanes===0&&(a.updateQueue.baseState=h)}var Dp={isMounted:function(a){return(a=a._reactInternals)?As(a)===a:!1},enqueueSetState:function(a,c,h){a=a._reactInternals;var y=Pr(),k=ia(a),P=oo(y,k);P.payload=c,h!=null&&(P.callback=h),c=ta(a,P,k),c!==null&&(si(c,a,k,y),Rp(c,a,k))},enqueueReplaceState:function(a,c,h){a=a._reactInternals;var y=Pr(),k=ia(a),P=oo(y,k);P.tag=1,P.payload=c,h!=null&&(P.callback=h),c=ta(a,P,k),c!==null&&(si(c,a,k,y),Rp(c,a,k))},enqueueForceUpdate:function(a,c){a=a._reactInternals;var h=Pr(),y=ia(a),k=oo(h,y);k.tag=2,c!=null&&(k.callback=c),c=ta(a,k,y),c!==null&&(si(c,a,y,h),Rp(c,a,y))}};function A6(a,c,h,y,k,P,O){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(y,P,O):c.prototype&&c.prototype.isPureReactComponent?!Od(h,y)||!Od(k,P):!0}function T6(a,c,h){var y=!1,k=Qo,P=c.contextType;return typeof P=="object"&&P!==null?P=Ls(P):(k=Fr(c)?ul:vr.current,y=c.contextTypes,P=(y=y!=null)?Dc(a,k):Qo),c=new c(h,P),a.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Dp,a.stateNode=c,c._reactInternals=a,y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=k,a.__reactInternalMemoizedMaskedChildContext=P),c}function I6(a,c,h,y){a=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(h,y),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(h,y),c.state!==a&&Dp.enqueueReplaceState(c,c.state,null)}function Qv(a,c,h,y){var k=a.stateNode;k.props=h,k.state=a.memoizedState,k.refs={},jv(a);var P=c.contextType;typeof P=="object"&&P!==null?k.context=Ls(P):(P=Fr(c)?ul:vr.current,k.context=Dc(a,P)),k.state=a.memoizedState,P=c.getDerivedStateFromProps,typeof P=="function"&&(Xv(a,c,P,h),k.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(c=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),c!==k.state&&Dp.enqueueReplaceState(k,k.state,null),Ap(a,h,k,y),k.state=a.memoizedState),typeof k.componentDidMount=="function"&&(a.flags|=4194308)}function Uc(a,c){try{var h="",y=c;do h+=se(y),y=y.return;while(y);var k=h}catch(P){k=`
|
|
41
|
-
Error generating stack: `+P.message+`
|
|
42
|
-
`+P.stack}return{value:a,source:c,stack:k,digest:null}}function Jv(a,c,h){return{value:a,source:null,stack:h??null,digest:c??null}}function e1(a,c){try{console.error(c.value)}catch(h){setTimeout(function(){throw h})}}var aD=typeof WeakMap=="function"?WeakMap:Map;function M6(a,c,h){h=oo(-1,h),h.tag=3,h.payload={element:null};var y=c.value;return h.callback=function(){Bp||(Bp=!0,m1=y),e1(a,c)},h}function O6(a,c,h){h=oo(-1,h),h.tag=3;var y=a.type.getDerivedStateFromError;if(typeof y=="function"){var k=c.value;h.payload=function(){return y(k)},h.callback=function(){e1(a,c)}}var P=a.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(h.callback=function(){e1(a,c),typeof y!="function"&&(ra===null?ra=new Set([this]):ra.add(this));var O=c.stack;this.componentDidCatch(c.value,{componentStack:O!==null?O:""})}),h}function L6(a,c,h){var y=a.pingCache;if(y===null){y=a.pingCache=new aD;var k=new Set;y.set(c,k)}else k=y.get(c),k===void 0&&(k=new Set,y.set(c,k));k.has(h)||(k.add(h),a=xD.bind(null,a,c,h),c.then(a,a))}function N6(a){do{var c;if((c=a.tag===13)&&(c=a.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return a;a=a.return}while(a!==null);return null}function D6(a,c,h,y,k){return(a.mode&1)===0?(a===c?a.flags|=65536:(a.flags|=128,h.flags|=131072,h.flags&=-52805,h.tag===1&&(h.alternate===null?h.tag=17:(c=oo(-1,1),c.tag=2,ta(h,c,1))),h.lanes|=1),a):(a.flags|=65536,a.lanes=k,a)}var lD=R.ReactCurrentOwner,Vr=!1;function Cr(a,c,h,y){c.child=a===null?n6(c,null,h,y):Vc(c,a.child,h,y)}function $6(a,c,h,y,k){h=h.render;var P=c.ref;return zc(c,k),y=Zv(a,c,h,y,P,k),h=Wv(),a!==null&&!Vr?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~k,ao(a,c,k)):(dn&&h&&Rv(c),c.flags|=1,Cr(a,c,y,k),c.child)}function j6(a,c,h,y,k){if(a===null){var P=h.type;return typeof P=="function"&&!b1(P)&&P.defaultProps===void 0&&h.compare===null&&h.defaultProps===void 0?(c.tag=15,c.type=P,F6(a,c,P,y,k)):(a=Kp(h.type,null,y,c,c.mode,k),a.ref=c.ref,a.return=c,c.child=a)}if(P=a.child,(a.lanes&k)===0){var O=P.memoizedProps;if(h=h.compare,h=h!==null?h:Od,h(O,y)&&a.ref===c.ref)return ao(a,c,k)}return c.flags|=1,a=aa(P,y),a.ref=c.ref,a.return=c,c.child=a}function F6(a,c,h,y,k){if(a!==null){var P=a.memoizedProps;if(Od(P,y)&&a.ref===c.ref)if(Vr=!1,c.pendingProps=y=P,(a.lanes&k)!==0)(a.flags&131072)!==0&&(Vr=!0);else return c.lanes=a.lanes,ao(a,c,k)}return t1(a,c,h,y,k)}function V6(a,c,h){var y=c.pendingProps,k=y.children,P=a!==null?a.memoizedState:null;if(y.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Qt(Wc,fs),fs|=h;else{if((h&1073741824)===0)return a=P!==null?P.baseLanes|h:h,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:a,cachePool:null,transitions:null},c.updateQueue=null,Qt(Wc,fs),fs|=a,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=P!==null?P.baseLanes:h,Qt(Wc,fs),fs|=y}else P!==null?(y=P.baseLanes|h,c.memoizedState=null):y=h,Qt(Wc,fs),fs|=y;return Cr(a,c,k,h),c.child}function H6(a,c){var h=c.ref;(a===null&&h!==null||a!==null&&a.ref!==h)&&(c.flags|=512,c.flags|=2097152)}function t1(a,c,h,y,k){var P=Fr(h)?ul:vr.current;return P=Dc(c,P),zc(c,k),h=Zv(a,c,h,y,P,k),y=Wv(),a!==null&&!Vr?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~k,ao(a,c,k)):(dn&&y&&Rv(c),c.flags|=1,Cr(a,c,h,k),c.child)}function z6(a,c,h,y,k){if(Fr(h)){var P=!0;wp(c)}else P=!1;if(zc(c,k),c.stateNode===null)jp(a,c),T6(c,h,y),Qv(c,h,y,k),y=!0;else if(a===null){var O=c.stateNode,F=c.memoizedProps;O.props=F;var G=O.context,ie=h.contextType;typeof ie=="object"&&ie!==null?ie=Ls(ie):(ie=Fr(h)?ul:vr.current,ie=Dc(c,ie));var ge=h.getDerivedStateFromProps,ye=typeof ge=="function"||typeof O.getSnapshotBeforeUpdate=="function";ye||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(F!==y||G!==ie)&&I6(c,O,y,ie),ea=!1;var me=c.memoizedState;O.state=me,Ap(c,y,O,k),G=c.memoizedState,F!==y||me!==G||jr.current||ea?(typeof ge=="function"&&(Xv(c,h,ge,y),G=c.memoizedState),(F=ea||A6(c,h,F,y,me,G,ie))?(ye||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount()),typeof O.componentDidMount=="function"&&(c.flags|=4194308)):(typeof O.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=G),O.props=y,O.state=G,O.context=ie,y=F):(typeof O.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{O=c.stateNode,s6(a,c),F=c.memoizedProps,ie=c.type===c.elementType?F:ti(c.type,F),O.props=ie,ye=c.pendingProps,me=O.context,G=h.contextType,typeof G=="object"&&G!==null?G=Ls(G):(G=Fr(h)?ul:vr.current,G=Dc(c,G));var Te=h.getDerivedStateFromProps;(ge=typeof Te=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(F!==ye||me!==G)&&I6(c,O,y,G),ea=!1,me=c.memoizedState,O.state=me,Ap(c,y,O,k);var je=c.memoizedState;F!==ye||me!==je||jr.current||ea?(typeof Te=="function"&&(Xv(c,h,Te,y),je=c.memoizedState),(ie=ea||A6(c,h,ie,y,me,je,G)||!1)?(ge||typeof O.UNSAFE_componentWillUpdate!="function"&&typeof O.componentWillUpdate!="function"||(typeof O.componentWillUpdate=="function"&&O.componentWillUpdate(y,je,G),typeof O.UNSAFE_componentWillUpdate=="function"&&O.UNSAFE_componentWillUpdate(y,je,G)),typeof O.componentDidUpdate=="function"&&(c.flags|=4),typeof O.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof O.componentDidUpdate!="function"||F===a.memoizedProps&&me===a.memoizedState||(c.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||F===a.memoizedProps&&me===a.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=je),O.props=y,O.state=je,O.context=G,y=ie):(typeof O.componentDidUpdate!="function"||F===a.memoizedProps&&me===a.memoizedState||(c.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||F===a.memoizedProps&&me===a.memoizedState||(c.flags|=1024),y=!1)}return n1(a,c,h,y,P,k)}function n1(a,c,h,y,k,P){H6(a,c);var O=(c.flags&128)!==0;if(!y&&!O)return k&&q4(c,h,!1),ao(a,c,P);y=c.stateNode,lD.current=c;var F=O&&typeof h.getDerivedStateFromError!="function"?null:y.render();return c.flags|=1,a!==null&&O?(c.child=Vc(c,a.child,null,P),c.child=Vc(c,null,F,P)):Cr(a,c,F,P),c.memoizedState=y.state,k&&q4(c,h,!0),c.child}function B6(a){var c=a.stateNode;c.pendingContext?Z4(a,c.pendingContext,c.pendingContext!==c.context):c.context&&Z4(a,c.context,!1),Fv(a,c.containerInfo)}function U6(a,c,h,y,k){return Fc(),Mv(k),c.flags|=256,Cr(a,c,h,y),c.child}var r1={dehydrated:null,treeContext:null,retryLane:0};function s1(a){return{baseLanes:a,cachePool:null,transitions:null}}function Z6(a,c,h){var y=c.pendingProps,k=yn.current,P=!1,O=(c.flags&128)!==0,F;if((F=O)||(F=a!==null&&a.memoizedState===null?!1:(k&2)!==0),F?(P=!0,c.flags&=-129):(a===null||a.memoizedState!==null)&&(k|=1),Qt(yn,k&1),a===null)return Iv(c),a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?((c.mode&1)===0?c.lanes=1:a.data==="$!"?c.lanes=8:c.lanes=1073741824,null):(O=y.children,a=y.fallback,P?(y=c.mode,P=c.child,O={mode:"hidden",children:O},(y&1)===0&&P!==null?(P.childLanes=0,P.pendingProps=O):P=Yp(O,y,0,null),a=wl(a,y,h,null),P.return=c,a.return=c,P.sibling=a,c.child=P,c.child.memoizedState=s1(h),c.memoizedState=r1,a):i1(c,O));if(k=a.memoizedState,k!==null&&(F=k.dehydrated,F!==null))return cD(a,c,O,y,F,k,h);if(P){P=y.fallback,O=c.mode,k=a.child,F=k.sibling;var G={mode:"hidden",children:y.children};return(O&1)===0&&c.child!==k?(y=c.child,y.childLanes=0,y.pendingProps=G,c.deletions=null):(y=aa(k,G),y.subtreeFlags=k.subtreeFlags&14680064),F!==null?P=aa(F,P):(P=wl(P,O,h,null),P.flags|=2),P.return=c,y.return=c,y.sibling=P,c.child=y,y=P,P=c.child,O=a.child.memoizedState,O=O===null?s1(h):{baseLanes:O.baseLanes|h,cachePool:null,transitions:O.transitions},P.memoizedState=O,P.childLanes=a.childLanes&~h,c.memoizedState=r1,y}return P=a.child,a=P.sibling,y=aa(P,{mode:"visible",children:y.children}),(c.mode&1)===0&&(y.lanes=h),y.return=c,y.sibling=null,a!==null&&(h=c.deletions,h===null?(c.deletions=[a],c.flags|=16):h.push(a)),c.child=y,c.memoizedState=null,y}function i1(a,c){return c=Yp({mode:"visible",children:c},a.mode,0,null),c.return=a,a.child=c}function $p(a,c,h,y){return y!==null&&Mv(y),Vc(c,a.child,null,h),a=i1(c,c.pendingProps.children),a.flags|=2,c.memoizedState=null,a}function cD(a,c,h,y,k,P,O){if(h)return c.flags&256?(c.flags&=-257,y=Jv(Error(n(422))),$p(a,c,O,y)):c.memoizedState!==null?(c.child=a.child,c.flags|=128,null):(P=y.fallback,k=c.mode,y=Yp({mode:"visible",children:y.children},k,0,null),P=wl(P,k,O,null),P.flags|=2,y.return=c,P.return=c,y.sibling=P,c.child=y,(c.mode&1)!==0&&Vc(c,a.child,null,O),c.child.memoizedState=s1(O),c.memoizedState=r1,P);if((c.mode&1)===0)return $p(a,c,O,null);if(k.data==="$!"){if(y=k.nextSibling&&k.nextSibling.dataset,y)var F=y.dgst;return y=F,P=Error(n(419)),y=Jv(P,y,void 0),$p(a,c,O,y)}if(F=(O&a.childLanes)!==0,Vr||F){if(y=Jn,y!==null){switch(O&-O){case 4:k=2;break;case 16:k=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:k=32;break;case 536870912:k=268435456;break;default:k=0}k=(k&(y.suspendedLanes|O))!==0?0:k,k!==0&&k!==P.retryLane&&(P.retryLane=k,io(a,k),si(y,a,k,-1))}return x1(),y=Jv(Error(n(421))),$p(a,c,O,y)}return k.data==="$?"?(c.flags|=128,c.child=a.child,c=bD.bind(null,a),k._reactRetry=c,null):(a=P.treeContext,ds=Yo(k.nextSibling),us=c,dn=!0,ei=null,a!==null&&(Ms[Os++]=ro,Ms[Os++]=so,Ms[Os++]=dl,ro=a.id,so=a.overflow,dl=c),c=i1(c,y.children),c.flags|=4096,c)}function W6(a,c,h){a.lanes|=c;var y=a.alternate;y!==null&&(y.lanes|=c),Dv(a.return,c,h)}function o1(a,c,h,y,k){var P=a.memoizedState;P===null?a.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:h,tailMode:k}:(P.isBackwards=c,P.rendering=null,P.renderingStartTime=0,P.last=y,P.tail=h,P.tailMode=k)}function q6(a,c,h){var y=c.pendingProps,k=y.revealOrder,P=y.tail;if(Cr(a,c,y.children,h),y=yn.current,(y&2)!==0)y=y&1|2,c.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=c.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&W6(a,h,c);else if(a.tag===19)W6(a,h,c);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===c)break e;for(;a.sibling===null;){if(a.return===null||a.return===c)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}y&=1}if(Qt(yn,y),(c.mode&1)===0)c.memoizedState=null;else switch(k){case"forwards":for(h=c.child,k=null;h!==null;)a=h.alternate,a!==null&&Tp(a)===null&&(k=h),h=h.sibling;h=k,h===null?(k=c.child,c.child=null):(k=h.sibling,h.sibling=null),o1(c,!1,k,h,P);break;case"backwards":for(h=null,k=c.child,c.child=null;k!==null;){if(a=k.alternate,a!==null&&Tp(a)===null){c.child=k;break}a=k.sibling,k.sibling=h,h=k,k=a}o1(c,!0,h,null,P);break;case"together":o1(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function jp(a,c){(c.mode&1)===0&&a!==null&&(a.alternate=null,c.alternate=null,c.flags|=2)}function ao(a,c,h){if(a!==null&&(c.dependencies=a.dependencies),gl|=c.lanes,(h&c.childLanes)===0)return null;if(a!==null&&c.child!==a.child)throw Error(n(153));if(c.child!==null){for(a=c.child,h=aa(a,a.pendingProps),c.child=h,h.return=c;a.sibling!==null;)a=a.sibling,h=h.sibling=aa(a,a.pendingProps),h.return=c;h.sibling=null}return c.child}function uD(a,c,h){switch(c.tag){case 3:B6(c),Fc();break;case 5:a6(c);break;case 1:Fr(c.type)&&wp(c);break;case 4:Fv(c,c.stateNode.containerInfo);break;case 10:var y=c.type._context,k=c.memoizedProps.value;Qt(Cp,y._currentValue),y._currentValue=k;break;case 13:if(y=c.memoizedState,y!==null)return y.dehydrated!==null?(Qt(yn,yn.current&1),c.flags|=128,null):(h&c.child.childLanes)!==0?Z6(a,c,h):(Qt(yn,yn.current&1),a=ao(a,c,h),a!==null?a.sibling:null);Qt(yn,yn.current&1);break;case 19:if(y=(h&c.childLanes)!==0,(a.flags&128)!==0){if(y)return q6(a,c,h);c.flags|=128}if(k=c.memoizedState,k!==null&&(k.rendering=null,k.tail=null,k.lastEffect=null),Qt(yn,yn.current),y)break;return null;case 22:case 23:return c.lanes=0,V6(a,c,h)}return ao(a,c,h)}var G6,a1,K6,Y6;G6=function(a,c){for(var h=c.child;h!==null;){if(h.tag===5||h.tag===6)a.appendChild(h.stateNode);else if(h.tag!==4&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===c)break;for(;h.sibling===null;){if(h.return===null||h.return===c)return;h=h.return}h.sibling.return=h.return,h=h.sibling}},a1=function(){},K6=function(a,c,h,y){var k=a.memoizedProps;if(k!==y){a=c.stateNode,pl(wi.current);var P=null;switch(h){case"input":k=It(a,k),y=It(a,y),P=[];break;case"select":k=W({},k,{value:void 0}),y=W({},y,{value:void 0}),P=[];break;case"textarea":k=Ye(a,k),y=Ye(a,y),P=[];break;default:typeof k.onClick!="function"&&typeof y.onClick=="function"&&(a.onclick=vp)}Ps(h,y);var O;h=null;for(ie in k)if(!y.hasOwnProperty(ie)&&k.hasOwnProperty(ie)&&k[ie]!=null)if(ie==="style"){var F=k[ie];for(O in F)F.hasOwnProperty(O)&&(h||(h={}),h[O]="")}else ie!=="dangerouslySetInnerHTML"&&ie!=="children"&&ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&ie!=="autoFocus"&&(s.hasOwnProperty(ie)?P||(P=[]):(P=P||[]).push(ie,null));for(ie in y){var G=y[ie];if(F=k!=null?k[ie]:void 0,y.hasOwnProperty(ie)&&G!==F&&(G!=null||F!=null))if(ie==="style")if(F){for(O in F)!F.hasOwnProperty(O)||G&&G.hasOwnProperty(O)||(h||(h={}),h[O]="");for(O in G)G.hasOwnProperty(O)&&F[O]!==G[O]&&(h||(h={}),h[O]=G[O])}else h||(P||(P=[]),P.push(ie,h)),h=G;else ie==="dangerouslySetInnerHTML"?(G=G?G.__html:void 0,F=F?F.__html:void 0,G!=null&&F!==G&&(P=P||[]).push(ie,G)):ie==="children"?typeof G!="string"&&typeof G!="number"||(P=P||[]).push(ie,""+G):ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&(s.hasOwnProperty(ie)?(G!=null&&ie==="onScroll"&&tn("scroll",a),P||F===G||(P=[])):(P=P||[]).push(ie,G))}h&&(P=P||[]).push("style",h);var ie=P;(c.updateQueue=ie)&&(c.flags|=4)}},Y6=function(a,c,h,y){h!==y&&(c.flags|=4)};function Gd(a,c){if(!dn)switch(a.tailMode){case"hidden":c=a.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?a.tail=null:h.sibling=null;break;case"collapsed":h=a.tail;for(var y=null;h!==null;)h.alternate!==null&&(y=h),h=h.sibling;y===null?c||a.tail===null?a.tail=null:a.tail.sibling=null:y.sibling=null}}function _r(a){var c=a.alternate!==null&&a.alternate.child===a.child,h=0,y=0;if(c)for(var k=a.child;k!==null;)h|=k.lanes|k.childLanes,y|=k.subtreeFlags&14680064,y|=k.flags&14680064,k.return=a,k=k.sibling;else for(k=a.child;k!==null;)h|=k.lanes|k.childLanes,y|=k.subtreeFlags,y|=k.flags,k.return=a,k=k.sibling;return a.subtreeFlags|=y,a.childLanes=h,c}function dD(a,c,h){var y=c.pendingProps;switch(Av(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _r(c),null;case 1:return Fr(c.type)&&_p(),_r(c),null;case 3:return y=c.stateNode,Bc(),nn(jr),nn(vr),zv(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(a===null||a.child===null)&&(kp(c)?c.flags|=4:a===null||a.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,ei!==null&&(y1(ei),ei=null))),a1(a,c),_r(c),null;case 5:Vv(c);var k=pl(Bd.current);if(h=c.type,a!==null&&c.stateNode!=null)K6(a,c,h,y,k),a.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!y){if(c.stateNode===null)throw Error(n(166));return _r(c),null}if(a=pl(wi.current),kp(c)){y=c.stateNode,h=c.type;var P=c.memoizedProps;switch(y[_i]=c,y[jd]=P,a=(c.mode&1)!==0,h){case"dialog":tn("cancel",y),tn("close",y);break;case"iframe":case"object":case"embed":tn("load",y);break;case"video":case"audio":for(k=0;k<Nd.length;k++)tn(Nd[k],y);break;case"source":tn("error",y);break;case"img":case"image":case"link":tn("error",y),tn("load",y);break;case"details":tn("toggle",y);break;case"input":Yt(y,P),tn("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!P.multiple},tn("invalid",y);break;case"textarea":Mt(y,P),tn("invalid",y)}Ps(h,P),k=null;for(var O in P)if(P.hasOwnProperty(O)){var F=P[O];O==="children"?typeof F=="string"?y.textContent!==F&&(P.suppressHydrationWarning!==!0&&gp(y.textContent,F,a),k=["children",F]):typeof F=="number"&&y.textContent!==""+F&&(P.suppressHydrationWarning!==!0&&gp(y.textContent,F,a),k=["children",""+F]):s.hasOwnProperty(O)&&F!=null&&O==="onScroll"&&tn("scroll",y)}switch(h){case"input":ke(y),We(y,P,!0);break;case"textarea":ke(y),kt(y);break;case"select":case"option":break;default:typeof P.onClick=="function"&&(y.onclick=vp)}y=k,c.updateQueue=y,y!==null&&(c.flags|=4)}else{O=k.nodeType===9?k:k.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=ns(h)),a==="http://www.w3.org/1999/xhtml"?h==="script"?(a=O.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof y.is=="string"?a=O.createElement(h,{is:y.is}):(a=O.createElement(h),h==="select"&&(O=a,y.multiple?O.multiple=!0:y.size&&(O.size=y.size))):a=O.createElementNS(a,h),a[_i]=c,a[jd]=y,G6(a,c,!1,!1),c.stateNode=a;e:{switch(O=gr(h,y),h){case"dialog":tn("cancel",a),tn("close",a),k=y;break;case"iframe":case"object":case"embed":tn("load",a),k=y;break;case"video":case"audio":for(k=0;k<Nd.length;k++)tn(Nd[k],a);k=y;break;case"source":tn("error",a),k=y;break;case"img":case"image":case"link":tn("error",a),tn("load",a),k=y;break;case"details":tn("toggle",a),k=y;break;case"input":Yt(a,y),k=It(a,y),tn("invalid",a);break;case"option":k=y;break;case"select":a._wrapperState={wasMultiple:!!y.multiple},k=W({},y,{value:void 0}),tn("invalid",a);break;case"textarea":Mt(a,y),k=Ye(a,y),tn("invalid",a);break;default:k=y}Ps(h,k),F=k;for(P in F)if(F.hasOwnProperty(P)){var G=F[P];P==="style"?gn(a,G):P==="dangerouslySetInnerHTML"?(G=G?G.__html:void 0,G!=null&&Bo(a,G)):P==="children"?typeof G=="string"?(h!=="textarea"||G!=="")&&Mn(a,G):typeof G=="number"&&Mn(a,""+G):P!=="suppressContentEditableWarning"&&P!=="suppressHydrationWarning"&&P!=="autoFocus"&&(s.hasOwnProperty(P)?G!=null&&P==="onScroll"&&tn("scroll",a):G!=null&&C(a,P,G,O))}switch(h){case"input":ke(a),We(a,y,!1);break;case"textarea":ke(a),kt(a);break;case"option":y.value!=null&&a.setAttribute("value",""+de(y.value));break;case"select":a.multiple=!!y.multiple,P=y.value,P!=null?Re(a,!!y.multiple,P,!1):y.defaultValue!=null&&Re(a,!!y.multiple,y.defaultValue,!0);break;default:typeof k.onClick=="function"&&(a.onclick=vp)}switch(h){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return _r(c),null;case 6:if(a&&c.stateNode!=null)Y6(a,c,a.memoizedProps,y);else{if(typeof y!="string"&&c.stateNode===null)throw Error(n(166));if(h=pl(Bd.current),pl(wi.current),kp(c)){if(y=c.stateNode,h=c.memoizedProps,y[_i]=c,(P=y.nodeValue!==h)&&(a=us,a!==null))switch(a.tag){case 3:gp(y.nodeValue,h,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&gp(y.nodeValue,h,(a.mode&1)!==0)}P&&(c.flags|=4)}else y=(h.nodeType===9?h:h.ownerDocument).createTextNode(y),y[_i]=c,c.stateNode=y}return _r(c),null;case 13:if(nn(yn),y=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(dn&&ds!==null&&(c.mode&1)!==0&&(c.flags&128)===0)J4(),Fc(),c.flags|=98560,P=!1;else if(P=kp(c),y!==null&&y.dehydrated!==null){if(a===null){if(!P)throw Error(n(318));if(P=c.memoizedState,P=P!==null?P.dehydrated:null,!P)throw Error(n(317));P[_i]=c}else Fc(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;_r(c),P=!1}else ei!==null&&(y1(ei),ei=null),P=!0;if(!P)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=h,c):(y=y!==null,y!==(a!==null&&a.memoizedState!==null)&&y&&(c.child.flags|=8192,(c.mode&1)!==0&&(a===null||(yn.current&1)!==0?Un===0&&(Un=3):x1())),c.updateQueue!==null&&(c.flags|=4),_r(c),null);case 4:return Bc(),a1(a,c),a===null&&Dd(c.stateNode.containerInfo),_r(c),null;case 10:return Nv(c.type._context),_r(c),null;case 17:return Fr(c.type)&&_p(),_r(c),null;case 19:if(nn(yn),P=c.memoizedState,P===null)return _r(c),null;if(y=(c.flags&128)!==0,O=P.rendering,O===null)if(y)Gd(P,!1);else{if(Un!==0||a!==null&&(a.flags&128)!==0)for(a=c.child;a!==null;){if(O=Tp(a),O!==null){for(c.flags|=128,Gd(P,!1),y=O.updateQueue,y!==null&&(c.updateQueue=y,c.flags|=4),c.subtreeFlags=0,y=h,h=c.child;h!==null;)P=h,a=y,P.flags&=14680066,O=P.alternate,O===null?(P.childLanes=0,P.lanes=a,P.child=null,P.subtreeFlags=0,P.memoizedProps=null,P.memoizedState=null,P.updateQueue=null,P.dependencies=null,P.stateNode=null):(P.childLanes=O.childLanes,P.lanes=O.lanes,P.child=O.child,P.subtreeFlags=0,P.deletions=null,P.memoizedProps=O.memoizedProps,P.memoizedState=O.memoizedState,P.updateQueue=O.updateQueue,P.type=O.type,a=O.dependencies,P.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),h=h.sibling;return Qt(yn,yn.current&1|2),c.child}a=a.sibling}P.tail!==null&&Xt()>qc&&(c.flags|=128,y=!0,Gd(P,!1),c.lanes=4194304)}else{if(!y)if(a=Tp(O),a!==null){if(c.flags|=128,y=!0,h=a.updateQueue,h!==null&&(c.updateQueue=h,c.flags|=4),Gd(P,!0),P.tail===null&&P.tailMode==="hidden"&&!O.alternate&&!dn)return _r(c),null}else 2*Xt()-P.renderingStartTime>qc&&h!==1073741824&&(c.flags|=128,y=!0,Gd(P,!1),c.lanes=4194304);P.isBackwards?(O.sibling=c.child,c.child=O):(h=P.last,h!==null?h.sibling=O:c.child=O,P.last=O)}return P.tail!==null?(c=P.tail,P.rendering=c,P.tail=c.sibling,P.renderingStartTime=Xt(),c.sibling=null,h=yn.current,Qt(yn,y?h&1|2:h&1),c):(_r(c),null);case 22:case 23:return w1(),y=c.memoizedState!==null,a!==null&&a.memoizedState!==null!==y&&(c.flags|=8192),y&&(c.mode&1)!==0?(fs&1073741824)!==0&&(_r(c),c.subtreeFlags&6&&(c.flags|=8192)):_r(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function fD(a,c){switch(Av(c),c.tag){case 1:return Fr(c.type)&&_p(),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return Bc(),nn(jr),nn(vr),zv(),a=c.flags,(a&65536)!==0&&(a&128)===0?(c.flags=a&-65537|128,c):null;case 5:return Vv(c),null;case 13:if(nn(yn),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(n(340));Fc()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return nn(yn),null;case 4:return Bc(),null;case 10:return Nv(c.type._context),null;case 22:case 23:return w1(),null;case 24:return null;default:return null}}var Fp=!1,wr=!1,hD=typeof WeakSet=="function"?WeakSet:Set,Ne=null;function Zc(a,c){var h=a.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(y){kn(a,c,y)}else h.current=null}function l1(a,c,h){try{h()}catch(y){kn(a,c,y)}}var X6=!1;function pD(a,c){if(wv=Er,a=A4(),fv(a)){if("selectionStart"in a)var h={start:a.selectionStart,end:a.selectionEnd};else e:{h=(h=a.ownerDocument)&&h.defaultView||window;var y=h.getSelection&&h.getSelection();if(y&&y.rangeCount!==0){h=y.anchorNode;var k=y.anchorOffset,P=y.focusNode;y=y.focusOffset;try{h.nodeType,P.nodeType}catch{h=null;break e}var O=0,F=-1,G=-1,ie=0,ge=0,ye=a,me=null;t:for(;;){for(var Te;ye!==h||k!==0&&ye.nodeType!==3||(F=O+k),ye!==P||y!==0&&ye.nodeType!==3||(G=O+y),ye.nodeType===3&&(O+=ye.nodeValue.length),(Te=ye.firstChild)!==null;)me=ye,ye=Te;for(;;){if(ye===a)break t;if(me===h&&++ie===k&&(F=O),me===P&&++ge===y&&(G=O),(Te=ye.nextSibling)!==null)break;ye=me,me=ye.parentNode}ye=Te}h=F===-1||G===-1?null:{start:F,end:G}}else h=null}h=h||{start:0,end:0}}else h=null;for(xv={focusedElem:a,selectionRange:h},Er=!1,Ne=c;Ne!==null;)if(c=Ne,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,Ne=a;else for(;Ne!==null;){c=Ne;try{var je=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(je!==null){var Ve=je.memoizedProps,Rn=je.memoizedState,te=c.stateNode,K=te.getSnapshotBeforeUpdate(c.elementType===c.type?Ve:ti(c.type,Ve),Rn);te.__reactInternalSnapshotBeforeUpdate=K}break;case 3:var ne=c.stateNode.containerInfo;ne.nodeType===1?ne.textContent="":ne.nodeType===9&&ne.documentElement&&ne.removeChild(ne.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(xe){kn(c,c.return,xe)}if(a=c.sibling,a!==null){a.return=c.return,Ne=a;break}Ne=c.return}return je=X6,X6=!1,je}function Kd(a,c,h){var y=c.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var k=y=y.next;do{if((k.tag&a)===a){var P=k.destroy;k.destroy=void 0,P!==void 0&&l1(c,h,P)}k=k.next}while(k!==y)}}function Vp(a,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var h=c=c.next;do{if((h.tag&a)===a){var y=h.create;h.destroy=y()}h=h.next}while(h!==c)}}function c1(a){var c=a.ref;if(c!==null){var h=a.stateNode;switch(a.tag){case 5:a=h;break;default:a=h}typeof c=="function"?c(a):c.current=a}}function Q6(a){var c=a.alternate;c!==null&&(a.alternate=null,Q6(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&(delete c[_i],delete c[jd],delete c[Ev],delete c[YN],delete c[XN])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function J6(a){return a.tag===5||a.tag===3||a.tag===4}function e8(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||J6(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function u1(a,c,h){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?h.nodeType===8?h.parentNode.insertBefore(a,c):h.insertBefore(a,c):(h.nodeType===8?(c=h.parentNode,c.insertBefore(a,h)):(c=h,c.appendChild(a)),h=h._reactRootContainer,h!=null||c.onclick!==null||(c.onclick=vp));else if(y!==4&&(a=a.child,a!==null))for(u1(a,c,h),a=a.sibling;a!==null;)u1(a,c,h),a=a.sibling}function d1(a,c,h){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?h.insertBefore(a,c):h.appendChild(a);else if(y!==4&&(a=a.child,a!==null))for(d1(a,c,h),a=a.sibling;a!==null;)d1(a,c,h),a=a.sibling}var ar=null,ni=!1;function na(a,c,h){for(h=h.child;h!==null;)t8(a,c,h),h=h.sibling}function t8(a,c,h){if(Ts&&typeof Ts.onCommitFiberUnmount=="function")try{Ts.onCommitFiberUnmount(bc,h)}catch{}switch(h.tag){case 5:wr||Zc(h,c);case 6:var y=ar,k=ni;ar=null,na(a,c,h),ar=y,ni=k,ar!==null&&(ni?(a=ar,h=h.stateNode,a.nodeType===8?a.parentNode.removeChild(h):a.removeChild(h)):ar.removeChild(h.stateNode));break;case 18:ar!==null&&(ni?(a=ar,h=h.stateNode,a.nodeType===8?kv(a.parentNode,h):a.nodeType===1&&kv(a,h),en(a)):kv(ar,h.stateNode));break;case 4:y=ar,k=ni,ar=h.stateNode.containerInfo,ni=!0,na(a,c,h),ar=y,ni=k;break;case 0:case 11:case 14:case 15:if(!wr&&(y=h.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){k=y=y.next;do{var P=k,O=P.destroy;P=P.tag,O!==void 0&&((P&2)!==0||(P&4)!==0)&&l1(h,c,O),k=k.next}while(k!==y)}na(a,c,h);break;case 1:if(!wr&&(Zc(h,c),y=h.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=h.memoizedProps,y.state=h.memoizedState,y.componentWillUnmount()}catch(F){kn(h,c,F)}na(a,c,h);break;case 21:na(a,c,h);break;case 22:h.mode&1?(wr=(y=wr)||h.memoizedState!==null,na(a,c,h),wr=y):na(a,c,h);break;default:na(a,c,h)}}function n8(a){var c=a.updateQueue;if(c!==null){a.updateQueue=null;var h=a.stateNode;h===null&&(h=a.stateNode=new hD),c.forEach(function(y){var k=SD.bind(null,a,y);h.has(y)||(h.add(y),y.then(k,k))})}}function ri(a,c){var h=c.deletions;if(h!==null)for(var y=0;y<h.length;y++){var k=h[y];try{var P=a,O=c,F=O;e:for(;F!==null;){switch(F.tag){case 5:ar=F.stateNode,ni=!1;break e;case 3:ar=F.stateNode.containerInfo,ni=!0;break e;case 4:ar=F.stateNode.containerInfo,ni=!0;break e}F=F.return}if(ar===null)throw Error(n(160));t8(P,O,k),ar=null,ni=!1;var G=k.alternate;G!==null&&(G.return=null),k.return=null}catch(ie){kn(k,c,ie)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)r8(c,a),c=c.sibling}function r8(a,c){var h=a.alternate,y=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(ri(c,a),bi(a),y&4){try{Kd(3,a,a.return),Vp(3,a)}catch(Ve){kn(a,a.return,Ve)}try{Kd(5,a,a.return)}catch(Ve){kn(a,a.return,Ve)}}break;case 1:ri(c,a),bi(a),y&512&&h!==null&&Zc(h,h.return);break;case 5:if(ri(c,a),bi(a),y&512&&h!==null&&Zc(h,h.return),a.flags&32){var k=a.stateNode;try{Mn(k,"")}catch(Ve){kn(a,a.return,Ve)}}if(y&4&&(k=a.stateNode,k!=null)){var P=a.memoizedProps,O=h!==null?h.memoizedProps:P,F=a.type,G=a.updateQueue;if(a.updateQueue=null,G!==null)try{F==="input"&&P.type==="radio"&&P.name!=null&&wt(k,P),gr(F,O);var ie=gr(F,P);for(O=0;O<G.length;O+=2){var ge=G[O],ye=G[O+1];ge==="style"?gn(k,ye):ge==="dangerouslySetInnerHTML"?Bo(k,ye):ge==="children"?Mn(k,ye):C(k,ge,ye,ie)}switch(F){case"input":yt(k,P);break;case"textarea":qe(k,P);break;case"select":var me=k._wrapperState.wasMultiple;k._wrapperState.wasMultiple=!!P.multiple;var Te=P.value;Te!=null?Re(k,!!P.multiple,Te,!1):me!==!!P.multiple&&(P.defaultValue!=null?Re(k,!!P.multiple,P.defaultValue,!0):Re(k,!!P.multiple,P.multiple?[]:"",!1))}k[jd]=P}catch(Ve){kn(a,a.return,Ve)}}break;case 6:if(ri(c,a),bi(a),y&4){if(a.stateNode===null)throw Error(n(162));k=a.stateNode,P=a.memoizedProps;try{k.nodeValue=P}catch(Ve){kn(a,a.return,Ve)}}break;case 3:if(ri(c,a),bi(a),y&4&&h!==null&&h.memoizedState.isDehydrated)try{en(c.containerInfo)}catch(Ve){kn(a,a.return,Ve)}break;case 4:ri(c,a),bi(a);break;case 13:ri(c,a),bi(a),k=a.child,k.flags&8192&&(P=k.memoizedState!==null,k.stateNode.isHidden=P,!P||k.alternate!==null&&k.alternate.memoizedState!==null||(p1=Xt())),y&4&&n8(a);break;case 22:if(ge=h!==null&&h.memoizedState!==null,a.mode&1?(wr=(ie=wr)||ge,ri(c,a),wr=ie):ri(c,a),bi(a),y&8192){if(ie=a.memoizedState!==null,(a.stateNode.isHidden=ie)&&!ge&&(a.mode&1)!==0)for(Ne=a,ge=a.child;ge!==null;){for(ye=Ne=ge;Ne!==null;){switch(me=Ne,Te=me.child,me.tag){case 0:case 11:case 14:case 15:Kd(4,me,me.return);break;case 1:Zc(me,me.return);var je=me.stateNode;if(typeof je.componentWillUnmount=="function"){y=me,h=me.return;try{c=y,je.props=c.memoizedProps,je.state=c.memoizedState,je.componentWillUnmount()}catch(Ve){kn(y,h,Ve)}}break;case 5:Zc(me,me.return);break;case 22:if(me.memoizedState!==null){o8(ye);continue}}Te!==null?(Te.return=me,Ne=Te):o8(ye)}ge=ge.sibling}e:for(ge=null,ye=a;;){if(ye.tag===5){if(ge===null){ge=ye;try{k=ye.stateNode,ie?(P=k.style,typeof P.setProperty=="function"?P.setProperty("display","none","important"):P.display="none"):(F=ye.stateNode,G=ye.memoizedProps.style,O=G!=null&&G.hasOwnProperty("display")?G.display:null,F.style.display=mn("display",O))}catch(Ve){kn(a,a.return,Ve)}}}else if(ye.tag===6){if(ge===null)try{ye.stateNode.nodeValue=ie?"":ye.memoizedProps}catch(Ve){kn(a,a.return,Ve)}}else if((ye.tag!==22&&ye.tag!==23||ye.memoizedState===null||ye===a)&&ye.child!==null){ye.child.return=ye,ye=ye.child;continue}if(ye===a)break e;for(;ye.sibling===null;){if(ye.return===null||ye.return===a)break e;ge===ye&&(ge=null),ye=ye.return}ge===ye&&(ge=null),ye.sibling.return=ye.return,ye=ye.sibling}}break;case 19:ri(c,a),bi(a),y&4&&n8(a);break;case 21:break;default:ri(c,a),bi(a)}}function bi(a){var c=a.flags;if(c&2){try{e:{for(var h=a.return;h!==null;){if(J6(h)){var y=h;break e}h=h.return}throw Error(n(160))}switch(y.tag){case 5:var k=y.stateNode;y.flags&32&&(Mn(k,""),y.flags&=-33);var P=e8(a);d1(a,P,k);break;case 3:case 4:var O=y.stateNode.containerInfo,F=e8(a);u1(a,F,O);break;default:throw Error(n(161))}}catch(G){kn(a,a.return,G)}a.flags&=-3}c&4096&&(a.flags&=-4097)}function mD(a,c,h){Ne=a,s8(a)}function s8(a,c,h){for(var y=(a.mode&1)!==0;Ne!==null;){var k=Ne,P=k.child;if(k.tag===22&&y){var O=k.memoizedState!==null||Fp;if(!O){var F=k.alternate,G=F!==null&&F.memoizedState!==null||wr;F=Fp;var ie=wr;if(Fp=O,(wr=G)&&!ie)for(Ne=k;Ne!==null;)O=Ne,G=O.child,O.tag===22&&O.memoizedState!==null?a8(k):G!==null?(G.return=O,Ne=G):a8(k);for(;P!==null;)Ne=P,s8(P),P=P.sibling;Ne=k,Fp=F,wr=ie}i8(a)}else(k.subtreeFlags&8772)!==0&&P!==null?(P.return=k,Ne=P):i8(a)}}function i8(a){for(;Ne!==null;){var c=Ne;if((c.flags&8772)!==0){var h=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:wr||Vp(5,c);break;case 1:var y=c.stateNode;if(c.flags&4&&!wr)if(h===null)y.componentDidMount();else{var k=c.elementType===c.type?h.memoizedProps:ti(c.type,h.memoizedProps);y.componentDidUpdate(k,h.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var P=c.updateQueue;P!==null&&o6(c,P,y);break;case 3:var O=c.updateQueue;if(O!==null){if(h=null,c.child!==null)switch(c.child.tag){case 5:h=c.child.stateNode;break;case 1:h=c.child.stateNode}o6(c,O,h)}break;case 5:var F=c.stateNode;if(h===null&&c.flags&4){h=F;var G=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":G.autoFocus&&h.focus();break;case"img":G.src&&(h.src=G.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var ie=c.alternate;if(ie!==null){var ge=ie.memoizedState;if(ge!==null){var ye=ge.dehydrated;ye!==null&&en(ye)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}wr||c.flags&512&&c1(c)}catch(me){kn(c,c.return,me)}}if(c===a){Ne=null;break}if(h=c.sibling,h!==null){h.return=c.return,Ne=h;break}Ne=c.return}}function o8(a){for(;Ne!==null;){var c=Ne;if(c===a){Ne=null;break}var h=c.sibling;if(h!==null){h.return=c.return,Ne=h;break}Ne=c.return}}function a8(a){for(;Ne!==null;){var c=Ne;try{switch(c.tag){case 0:case 11:case 15:var h=c.return;try{Vp(4,c)}catch(G){kn(c,h,G)}break;case 1:var y=c.stateNode;if(typeof y.componentDidMount=="function"){var k=c.return;try{y.componentDidMount()}catch(G){kn(c,k,G)}}var P=c.return;try{c1(c)}catch(G){kn(c,P,G)}break;case 5:var O=c.return;try{c1(c)}catch(G){kn(c,O,G)}}}catch(G){kn(c,c.return,G)}if(c===a){Ne=null;break}var F=c.sibling;if(F!==null){F.return=c.return,Ne=F;break}Ne=c.return}}var gD=Math.ceil,Hp=R.ReactCurrentDispatcher,f1=R.ReactCurrentOwner,Ds=R.ReactCurrentBatchConfig,Ct=0,Jn=null,Nn=null,lr=0,fs=0,Wc=Xo(0),Un=0,Yd=null,gl=0,zp=0,h1=0,Xd=null,Hr=null,p1=0,qc=1/0,lo=null,Bp=!1,m1=null,ra=null,Up=!1,sa=null,Zp=0,Qd=0,g1=null,Wp=-1,qp=0;function Pr(){return(Ct&6)!==0?Xt():Wp!==-1?Wp:Wp=Xt()}function ia(a){return(a.mode&1)===0?1:(Ct&2)!==0&&lr!==0?lr&-lr:JN.transition!==null?(qp===0&&(qp=tp()),qp):(a=jt,a!==0||(a=window.event,a=a===void 0?16:c4(a.type)),a)}function si(a,c,h,y){if(50<Qd)throw Qd=0,g1=null,Error(n(185));Ji(a,h,y),((Ct&2)===0||a!==Jn)&&(a===Jn&&((Ct&2)===0&&(zp|=h),Un===4&&oa(a,lr)),zr(a,y),h===1&&Ct===0&&(c.mode&1)===0&&(qc=Xt()+500,xp&&Jo()))}function zr(a,c){var h=a.callbackNode;nv(a,c);var y=Ec(a,a===Jn?lr:0);if(y===0)h!==null&&Uo(h),a.callbackNode=null,a.callbackPriority=0;else if(c=y&-y,a.callbackPriority!==c){if(h!=null&&Uo(h),c===1)a.tag===0?QN(c8.bind(null,a)):G4(c8.bind(null,a)),GN(function(){(Ct&6)===0&&Jo()}),h=null;else{switch(eo(y)){case 1:h=wd;break;case 4:h=Jh;break;case 16:h=Zo;break;case 536870912:h=bd;break;default:h=Zo}h=v8(h,l8.bind(null,a))}a.callbackPriority=c,a.callbackNode=h}}function l8(a,c){if(Wp=-1,qp=0,(Ct&6)!==0)throw Error(n(327));var h=a.callbackNode;if(Gc()&&a.callbackNode!==h)return null;var y=Ec(a,a===Jn?lr:0);if(y===0)return null;if((y&30)!==0||(y&a.expiredLanes)!==0||c)c=Gp(a,y);else{c=y;var k=Ct;Ct|=2;var P=d8();(Jn!==a||lr!==c)&&(lo=null,qc=Xt()+500,yl(a,c));do try{_D();break}catch(F){u8(a,F)}while(!0);Lv(),Hp.current=P,Ct=k,Nn!==null?c=0:(Jn=null,lr=0,c=Un)}if(c!==0){if(c===2&&(k=Ed(a),k!==0&&(y=k,c=v1(a,k))),c===1)throw h=Yd,yl(a,0),oa(a,y),zr(a,Xt()),h;if(c===6)oa(a,y);else{if(k=a.current.alternate,(y&30)===0&&!vD(k)&&(c=Gp(a,y),c===2&&(P=Ed(a),P!==0&&(y=P,c=v1(a,P))),c===1))throw h=Yd,yl(a,0),oa(a,y),zr(a,Xt()),h;switch(a.finishedWork=k,a.finishedLanes=y,c){case 0:case 1:throw Error(n(345));case 2:_l(a,Hr,lo);break;case 3:if(oa(a,y),(y&130023424)===y&&(c=p1+500-Xt(),10<c)){if(Ec(a,0)!==0)break;if(k=a.suspendedLanes,(k&y)!==y){Pr(),a.pingedLanes|=a.suspendedLanes&k;break}a.timeoutHandle=Sv(_l.bind(null,a,Hr,lo),c);break}_l(a,Hr,lo);break;case 4:if(oa(a,y),(y&4194240)===y)break;for(c=a.eventTimes,k=-1;0<y;){var O=31-is(y);P=1<<O,O=c[O],O>k&&(k=O),y&=~P}if(y=k,y=Xt()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*gD(y/1960))-y,10<y){a.timeoutHandle=Sv(_l.bind(null,a,Hr,lo),y);break}_l(a,Hr,lo);break;case 5:_l(a,Hr,lo);break;default:throw Error(n(329))}}}return zr(a,Xt()),a.callbackNode===h?l8.bind(null,a):null}function v1(a,c){var h=Xd;return a.current.memoizedState.isDehydrated&&(yl(a,c).flags|=256),a=Gp(a,c),a!==2&&(c=Hr,Hr=h,c!==null&&y1(c)),a}function y1(a){Hr===null?Hr=a:Hr.push.apply(Hr,a)}function vD(a){for(var c=a;;){if(c.flags&16384){var h=c.updateQueue;if(h!==null&&(h=h.stores,h!==null))for(var y=0;y<h.length;y++){var k=h[y],P=k.getSnapshot;k=k.value;try{if(!Js(P(),k))return!1}catch{return!1}}}if(h=c.child,c.subtreeFlags&16384&&h!==null)h.return=c,c=h;else{if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function oa(a,c){for(c&=~h1,c&=~zp,a.suspendedLanes|=c,a.pingedLanes&=~c,a=a.expirationTimes;0<c;){var h=31-is(c),y=1<<h;a[h]=-1,c&=~y}}function c8(a){if((Ct&6)!==0)throw Error(n(327));Gc();var c=Ec(a,0);if((c&1)===0)return zr(a,Xt()),null;var h=Gp(a,c);if(a.tag!==0&&h===2){var y=Ed(a);y!==0&&(c=y,h=v1(a,y))}if(h===1)throw h=Yd,yl(a,0),oa(a,c),zr(a,Xt()),h;if(h===6)throw Error(n(345));return a.finishedWork=a.current.alternate,a.finishedLanes=c,_l(a,Hr,lo),zr(a,Xt()),null}function _1(a,c){var h=Ct;Ct|=1;try{return a(c)}finally{Ct=h,Ct===0&&(qc=Xt()+500,xp&&Jo())}}function vl(a){sa!==null&&sa.tag===0&&(Ct&6)===0&&Gc();var c=Ct;Ct|=1;var h=Ds.transition,y=jt;try{if(Ds.transition=null,jt=1,a)return a()}finally{jt=y,Ds.transition=h,Ct=c,(Ct&6)===0&&Jo()}}function w1(){fs=Wc.current,nn(Wc)}function yl(a,c){a.finishedWork=null,a.finishedLanes=0;var h=a.timeoutHandle;if(h!==-1&&(a.timeoutHandle=-1,qN(h)),Nn!==null)for(h=Nn.return;h!==null;){var y=h;switch(Av(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&_p();break;case 3:Bc(),nn(jr),nn(vr),zv();break;case 5:Vv(y);break;case 4:Bc();break;case 13:nn(yn);break;case 19:nn(yn);break;case 10:Nv(y.type._context);break;case 22:case 23:w1()}h=h.return}if(Jn=a,Nn=a=aa(a.current,null),lr=fs=c,Un=0,Yd=null,h1=zp=gl=0,Hr=Xd=null,hl!==null){for(c=0;c<hl.length;c++)if(h=hl[c],y=h.interleaved,y!==null){h.interleaved=null;var k=y.next,P=h.pending;if(P!==null){var O=P.next;P.next=k,y.next=O}h.pending=y}hl=null}return a}function u8(a,c){do{var h=Nn;try{if(Lv(),Ip.current=Np,Mp){for(var y=_n.memoizedState;y!==null;){var k=y.queue;k!==null&&(k.pending=null),y=y.next}Mp=!1}if(ml=0,Qn=Bn=_n=null,Ud=!1,Zd=0,f1.current=null,h===null||h.return===null){Un=1,Yd=c,Nn=null;break}e:{var P=a,O=h.return,F=h,G=c;if(c=lr,F.flags|=32768,G!==null&&typeof G=="object"&&typeof G.then=="function"){var ie=G,ge=F,ye=ge.tag;if((ge.mode&1)===0&&(ye===0||ye===11||ye===15)){var me=ge.alternate;me?(ge.updateQueue=me.updateQueue,ge.memoizedState=me.memoizedState,ge.lanes=me.lanes):(ge.updateQueue=null,ge.memoizedState=null)}var Te=N6(O);if(Te!==null){Te.flags&=-257,D6(Te,O,F,P,c),Te.mode&1&&L6(P,ie,c),c=Te,G=ie;var je=c.updateQueue;if(je===null){var Ve=new Set;Ve.add(G),c.updateQueue=Ve}else je.add(G);break e}else{if((c&1)===0){L6(P,ie,c),x1();break e}G=Error(n(426))}}else if(dn&&F.mode&1){var Rn=N6(O);if(Rn!==null){(Rn.flags&65536)===0&&(Rn.flags|=256),D6(Rn,O,F,P,c),Mv(Uc(G,F));break e}}P=G=Uc(G,F),Un!==4&&(Un=2),Xd===null?Xd=[P]:Xd.push(P),P=O;do{switch(P.tag){case 3:P.flags|=65536,c&=-c,P.lanes|=c;var te=M6(P,G,c);i6(P,te);break e;case 1:F=G;var K=P.type,ne=P.stateNode;if((P.flags&128)===0&&(typeof K.getDerivedStateFromError=="function"||ne!==null&&typeof ne.componentDidCatch=="function"&&(ra===null||!ra.has(ne)))){P.flags|=65536,c&=-c,P.lanes|=c;var xe=O6(P,F,c);i6(P,xe);break e}}P=P.return}while(P!==null)}h8(h)}catch(ze){c=ze,Nn===h&&h!==null&&(Nn=h=h.return);continue}break}while(!0)}function d8(){var a=Hp.current;return Hp.current=Np,a===null?Np:a}function x1(){(Un===0||Un===3||Un===2)&&(Un=4),Jn===null||(gl&268435455)===0&&(zp&268435455)===0||oa(Jn,lr)}function Gp(a,c){var h=Ct;Ct|=2;var y=d8();(Jn!==a||lr!==c)&&(lo=null,yl(a,c));do try{yD();break}catch(k){u8(a,k)}while(!0);if(Lv(),Ct=h,Hp.current=y,Nn!==null)throw Error(n(261));return Jn=null,lr=0,Un}function yD(){for(;Nn!==null;)f8(Nn)}function _D(){for(;Nn!==null&&!_d();)f8(Nn)}function f8(a){var c=g8(a.alternate,a,fs);a.memoizedProps=a.pendingProps,c===null?h8(a):Nn=c,f1.current=null}function h8(a){var c=a;do{var h=c.alternate;if(a=c.return,(c.flags&32768)===0){if(h=dD(h,c,fs),h!==null){Nn=h;return}}else{if(h=fD(h,c),h!==null){h.flags&=32767,Nn=h;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Un=6,Nn=null;return}}if(c=c.sibling,c!==null){Nn=c;return}Nn=c=a}while(c!==null);Un===0&&(Un=5)}function _l(a,c,h){var y=jt,k=Ds.transition;try{Ds.transition=null,jt=1,wD(a,c,h,y)}finally{Ds.transition=k,jt=y}return null}function wD(a,c,h,y){do Gc();while(sa!==null);if((Ct&6)!==0)throw Error(n(327));h=a.finishedWork;var k=a.finishedLanes;if(h===null)return null;if(a.finishedWork=null,a.finishedLanes=0,h===a.current)throw Error(n(177));a.callbackNode=null,a.callbackPriority=0;var P=h.lanes|h.childLanes;if(np(a,P),a===Jn&&(Nn=Jn=null,lr=0),(h.subtreeFlags&2064)===0&&(h.flags&2064)===0||Up||(Up=!0,v8(Zo,function(){return Gc(),null})),P=(h.flags&15990)!==0,(h.subtreeFlags&15990)!==0||P){P=Ds.transition,Ds.transition=null;var O=jt;jt=1;var F=Ct;Ct|=4,f1.current=null,pD(a,h),r8(h,a),VN(xv),Er=!!wv,xv=wv=null,a.current=h,mD(h),Qg(),Ct=F,jt=O,Ds.transition=P}else a.current=h;if(Up&&(Up=!1,sa=a,Zp=k),P=a.pendingLanes,P===0&&(ra=null),ep(h.stateNode),zr(a,Xt()),c!==null)for(y=a.onRecoverableError,h=0;h<c.length;h++)k=c[h],y(k.value,{componentStack:k.stack,digest:k.digest});if(Bp)throw Bp=!1,a=m1,m1=null,a;return(Zp&1)!==0&&a.tag!==0&&Gc(),P=a.pendingLanes,(P&1)!==0?a===g1?Qd++:(Qd=0,g1=a):Qd=0,Jo(),null}function Gc(){if(sa!==null){var a=eo(Zp),c=Ds.transition,h=jt;try{if(Ds.transition=null,jt=16>a?16:a,sa===null)var y=!1;else{if(a=sa,sa=null,Zp=0,(Ct&6)!==0)throw Error(n(331));var k=Ct;for(Ct|=4,Ne=a.current;Ne!==null;){var P=Ne,O=P.child;if((Ne.flags&16)!==0){var F=P.deletions;if(F!==null){for(var G=0;G<F.length;G++){var ie=F[G];for(Ne=ie;Ne!==null;){var ge=Ne;switch(ge.tag){case 0:case 11:case 15:Kd(8,ge,P)}var ye=ge.child;if(ye!==null)ye.return=ge,Ne=ye;else for(;Ne!==null;){ge=Ne;var me=ge.sibling,Te=ge.return;if(Q6(ge),ge===ie){Ne=null;break}if(me!==null){me.return=Te,Ne=me;break}Ne=Te}}}var je=P.alternate;if(je!==null){var Ve=je.child;if(Ve!==null){je.child=null;do{var Rn=Ve.sibling;Ve.sibling=null,Ve=Rn}while(Ve!==null)}}Ne=P}}if((P.subtreeFlags&2064)!==0&&O!==null)O.return=P,Ne=O;else e:for(;Ne!==null;){if(P=Ne,(P.flags&2048)!==0)switch(P.tag){case 0:case 11:case 15:Kd(9,P,P.return)}var te=P.sibling;if(te!==null){te.return=P.return,Ne=te;break e}Ne=P.return}}var K=a.current;for(Ne=K;Ne!==null;){O=Ne;var ne=O.child;if((O.subtreeFlags&2064)!==0&&ne!==null)ne.return=O,Ne=ne;else e:for(O=K;Ne!==null;){if(F=Ne,(F.flags&2048)!==0)try{switch(F.tag){case 0:case 11:case 15:Vp(9,F)}}catch(ze){kn(F,F.return,ze)}if(F===O){Ne=null;break e}var xe=F.sibling;if(xe!==null){xe.return=F.return,Ne=xe;break e}Ne=F.return}}if(Ct=k,Jo(),Ts&&typeof Ts.onPostCommitFiberRoot=="function")try{Ts.onPostCommitFiberRoot(bc,a)}catch{}y=!0}return y}finally{jt=h,Ds.transition=c}}return!1}function p8(a,c,h){c=Uc(h,c),c=M6(a,c,1),a=ta(a,c,1),c=Pr(),a!==null&&(Ji(a,1,c),zr(a,c))}function kn(a,c,h){if(a.tag===3)p8(a,a,h);else for(;c!==null;){if(c.tag===3){p8(c,a,h);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(ra===null||!ra.has(y))){a=Uc(h,a),a=O6(c,a,1),c=ta(c,a,1),a=Pr(),c!==null&&(Ji(c,1,a),zr(c,a));break}}c=c.return}}function xD(a,c,h){var y=a.pingCache;y!==null&&y.delete(c),c=Pr(),a.pingedLanes|=a.suspendedLanes&h,Jn===a&&(lr&h)===h&&(Un===4||Un===3&&(lr&130023424)===lr&&500>Xt()-p1?yl(a,0):h1|=h),zr(a,c)}function m8(a,c){c===0&&((a.mode&1)===0?c=1:(c=kc,kc<<=1,(kc&130023424)===0&&(kc=4194304)));var h=Pr();a=io(a,c),a!==null&&(Ji(a,c,h),zr(a,h))}function bD(a){var c=a.memoizedState,h=0;c!==null&&(h=c.retryLane),m8(a,h)}function SD(a,c){var h=0;switch(a.tag){case 13:var y=a.stateNode,k=a.memoizedState;k!==null&&(h=k.retryLane);break;case 19:y=a.stateNode;break;default:throw Error(n(314))}y!==null&&y.delete(c),m8(a,h)}var g8;g8=function(a,c,h){if(a!==null)if(a.memoizedProps!==c.pendingProps||jr.current)Vr=!0;else{if((a.lanes&h)===0&&(c.flags&128)===0)return Vr=!1,uD(a,c,h);Vr=(a.flags&131072)!==0}else Vr=!1,dn&&(c.flags&1048576)!==0&&K4(c,Sp,c.index);switch(c.lanes=0,c.tag){case 2:var y=c.type;jp(a,c),a=c.pendingProps;var k=Dc(c,vr.current);zc(c,h),k=Zv(null,c,y,a,k,h);var P=Wv();return c.flags|=1,typeof k=="object"&&k!==null&&typeof k.render=="function"&&k.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Fr(y)?(P=!0,wp(c)):P=!1,c.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,jv(c),k.updater=Dp,c.stateNode=k,k._reactInternals=c,Qv(c,y,a,h),c=n1(null,c,y,!0,P,h)):(c.tag=0,dn&&P&&Rv(c),Cr(null,c,k,h),c=c.child),c;case 16:y=c.elementType;e:{switch(jp(a,c),a=c.pendingProps,k=y._init,y=k(y._payload),c.type=y,k=c.tag=ED(y),a=ti(y,a),k){case 0:c=t1(null,c,y,a,h);break e;case 1:c=z6(null,c,y,a,h);break e;case 11:c=$6(null,c,y,a,h);break e;case 14:c=j6(null,c,y,ti(y.type,a),h);break e}throw Error(n(306,y,""))}return c;case 0:return y=c.type,k=c.pendingProps,k=c.elementType===y?k:ti(y,k),t1(a,c,y,k,h);case 1:return y=c.type,k=c.pendingProps,k=c.elementType===y?k:ti(y,k),z6(a,c,y,k,h);case 3:e:{if(B6(c),a===null)throw Error(n(387));y=c.pendingProps,P=c.memoizedState,k=P.element,s6(a,c),Ap(c,y,null,h);var O=c.memoizedState;if(y=O.element,P.isDehydrated)if(P={element:y,isDehydrated:!1,cache:O.cache,pendingSuspenseBoundaries:O.pendingSuspenseBoundaries,transitions:O.transitions},c.updateQueue.baseState=P,c.memoizedState=P,c.flags&256){k=Uc(Error(n(423)),c),c=U6(a,c,y,h,k);break e}else if(y!==k){k=Uc(Error(n(424)),c),c=U6(a,c,y,h,k);break e}else for(ds=Yo(c.stateNode.containerInfo.firstChild),us=c,dn=!0,ei=null,h=n6(c,null,y,h),c.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(Fc(),y===k){c=ao(a,c,h);break e}Cr(a,c,y,h)}c=c.child}return c;case 5:return a6(c),a===null&&Iv(c),y=c.type,k=c.pendingProps,P=a!==null?a.memoizedProps:null,O=k.children,bv(y,k)?O=null:P!==null&&bv(y,P)&&(c.flags|=32),H6(a,c),Cr(a,c,O,h),c.child;case 6:return a===null&&Iv(c),null;case 13:return Z6(a,c,h);case 4:return Fv(c,c.stateNode.containerInfo),y=c.pendingProps,a===null?c.child=Vc(c,null,y,h):Cr(a,c,y,h),c.child;case 11:return y=c.type,k=c.pendingProps,k=c.elementType===y?k:ti(y,k),$6(a,c,y,k,h);case 7:return Cr(a,c,c.pendingProps,h),c.child;case 8:return Cr(a,c,c.pendingProps.children,h),c.child;case 12:return Cr(a,c,c.pendingProps.children,h),c.child;case 10:e:{if(y=c.type._context,k=c.pendingProps,P=c.memoizedProps,O=k.value,Qt(Cp,y._currentValue),y._currentValue=O,P!==null)if(Js(P.value,O)){if(P.children===k.children&&!jr.current){c=ao(a,c,h);break e}}else for(P=c.child,P!==null&&(P.return=c);P!==null;){var F=P.dependencies;if(F!==null){O=P.child;for(var G=F.firstContext;G!==null;){if(G.context===y){if(P.tag===1){G=oo(-1,h&-h),G.tag=2;var ie=P.updateQueue;if(ie!==null){ie=ie.shared;var ge=ie.pending;ge===null?G.next=G:(G.next=ge.next,ge.next=G),ie.pending=G}}P.lanes|=h,G=P.alternate,G!==null&&(G.lanes|=h),Dv(P.return,h,c),F.lanes|=h;break}G=G.next}}else if(P.tag===10)O=P.type===c.type?null:P.child;else if(P.tag===18){if(O=P.return,O===null)throw Error(n(341));O.lanes|=h,F=O.alternate,F!==null&&(F.lanes|=h),Dv(O,h,c),O=P.sibling}else O=P.child;if(O!==null)O.return=P;else for(O=P;O!==null;){if(O===c){O=null;break}if(P=O.sibling,P!==null){P.return=O.return,O=P;break}O=O.return}P=O}Cr(a,c,k.children,h),c=c.child}return c;case 9:return k=c.type,y=c.pendingProps.children,zc(c,h),k=Ls(k),y=y(k),c.flags|=1,Cr(a,c,y,h),c.child;case 14:return y=c.type,k=ti(y,c.pendingProps),k=ti(y.type,k),j6(a,c,y,k,h);case 15:return F6(a,c,c.type,c.pendingProps,h);case 17:return y=c.type,k=c.pendingProps,k=c.elementType===y?k:ti(y,k),jp(a,c),c.tag=1,Fr(y)?(a=!0,wp(c)):a=!1,zc(c,h),T6(c,y,k),Qv(c,y,k,h),n1(null,c,y,!0,a,h);case 19:return q6(a,c,h);case 22:return V6(a,c,h)}throw Error(n(156,c.tag))};function v8(a,c){return xc(a,c)}function kD(a,c,h,y){this.tag=a,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $s(a,c,h,y){return new kD(a,c,h,y)}function b1(a){return a=a.prototype,!(!a||!a.isReactComponent)}function ED(a){if(typeof a=="function")return b1(a)?1:0;if(a!=null){if(a=a.$$typeof,a===H)return 11;if(a===z)return 14}return 2}function aa(a,c){var h=a.alternate;return h===null?(h=$s(a.tag,c,a.key,a.mode),h.elementType=a.elementType,h.type=a.type,h.stateNode=a.stateNode,h.alternate=a,a.alternate=h):(h.pendingProps=c,h.type=a.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=a.flags&14680064,h.childLanes=a.childLanes,h.lanes=a.lanes,h.child=a.child,h.memoizedProps=a.memoizedProps,h.memoizedState=a.memoizedState,h.updateQueue=a.updateQueue,c=a.dependencies,h.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},h.sibling=a.sibling,h.index=a.index,h.ref=a.ref,h}function Kp(a,c,h,y,k,P){var O=2;if(y=a,typeof a=="function")b1(a)&&(O=1);else if(typeof a=="string")O=5;else e:switch(a){case M:return wl(h.children,k,P,c);case T:O=8,k|=8;break;case L:return a=$s(12,h,c,k|2),a.elementType=L,a.lanes=P,a;case Y:return a=$s(13,h,c,k),a.elementType=Y,a.lanes=P,a;case U:return a=$s(19,h,c,k),a.elementType=U,a.lanes=P,a;case Q:return Yp(h,k,P,c);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case D:O=10;break e;case j:O=9;break e;case H:O=11;break e;case z:O=14;break e;case Z:O=16,y=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return c=$s(O,h,c,k),c.elementType=a,c.type=y,c.lanes=P,c}function wl(a,c,h,y){return a=$s(7,a,y,c),a.lanes=h,a}function Yp(a,c,h,y){return a=$s(22,a,y,c),a.elementType=Q,a.lanes=h,a.stateNode={isHidden:!1},a}function S1(a,c,h){return a=$s(6,a,null,c),a.lanes=h,a}function k1(a,c,h){return c=$s(4,a.children!==null?a.children:[],a.key,c),c.lanes=h,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function CD(a,c,h,y,k){this.tag=c,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=al(0),this.expirationTimes=al(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=al(0),this.identifierPrefix=y,this.onRecoverableError=k,this.mutableSourceEagerHydrationData=null}function E1(a,c,h,y,k,P,O,F,G){return a=new CD(a,c,h,F,G),c===1?(c=1,P===!0&&(c|=8)):c=0,P=$s(3,null,null,c),a.current=P,P.stateNode=a,P.memoizedState={element:y,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},jv(P),a}function PD(a,c,h){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:I,key:y==null?null:""+y,children:a,containerInfo:c,implementation:h}}function y8(a){if(!a)return Qo;a=a._reactInternals;e:{if(As(a)!==a||a.tag!==1)throw Error(n(170));var c=a;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(Fr(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(n(171))}if(a.tag===1){var h=a.type;if(Fr(h))return W4(a,h,c)}return c}function _8(a,c,h,y,k,P,O,F,G){return a=E1(h,y,!0,a,k,P,O,F,G),a.context=y8(null),h=a.current,y=Pr(),k=ia(h),P=oo(y,k),P.callback=c??null,ta(h,P,k),a.current.lanes=k,Ji(a,k,y),zr(a,y),a}function Xp(a,c,h,y){var k=c.current,P=Pr(),O=ia(k);return h=y8(h),c.context===null?c.context=h:c.pendingContext=h,c=oo(P,O),c.payload={element:a},y=y===void 0?null:y,y!==null&&(c.callback=y),a=ta(k,c,O),a!==null&&(si(a,k,O,P),Rp(a,k,O)),O}function Qp(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function w8(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var h=a.retryLane;a.retryLane=h!==0&&h<c?h:c}}function C1(a,c){w8(a,c),(a=a.alternate)&&w8(a,c)}function RD(){return null}var x8=typeof reportError=="function"?reportError:function(a){console.error(a)};function P1(a){this._internalRoot=a}Jp.prototype.render=P1.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(n(409));Xp(a,c,null,null)},Jp.prototype.unmount=P1.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;vl(function(){Xp(null,a,null,null)}),c[to]=null}};function Jp(a){this._internalRoot=a}Jp.prototype.unstable_scheduleHydration=function(a){if(a){var c=sp();a={blockedOn:null,target:a,priority:c};for(var h=0;h<Xs.length&&c!==0&&c<Xs[h].priority;h++);Xs.splice(h,0,a),h===0&&he(a)}};function R1(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function e0(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function b8(){}function AD(a,c,h,y,k){if(k){if(typeof y=="function"){var P=y;y=function(){var ie=Qp(O);P.call(ie)}}var O=_8(c,y,a,0,null,!1,!1,"",b8);return a._reactRootContainer=O,a[to]=O.current,Dd(a.nodeType===8?a.parentNode:a),vl(),O}for(;k=a.lastChild;)a.removeChild(k);if(typeof y=="function"){var F=y;y=function(){var ie=Qp(G);F.call(ie)}}var G=E1(a,0,!1,null,null,!1,!1,"",b8);return a._reactRootContainer=G,a[to]=G.current,Dd(a.nodeType===8?a.parentNode:a),vl(function(){Xp(c,G,h,y)}),G}function t0(a,c,h,y,k){var P=h._reactRootContainer;if(P){var O=P;if(typeof k=="function"){var F=k;k=function(){var G=Qp(O);F.call(G)}}Xp(c,O,a,k)}else O=AD(h,c,a,k,y);return Qp(O)}Pd=function(a){switch(a.tag){case 3:var c=a.stateNode;if(c.current.memoizedState.isDehydrated){var h=ol(c.pendingLanes);h!==0&&(Cd(c,h|1),zr(c,Xt()),(Ct&6)===0&&(qc=Xt()+500,Jo()))}break;case 13:vl(function(){var y=io(a,1);if(y!==null){var k=Pr();si(y,a,1,k)}}),C1(a,1)}},ll=function(a){if(a.tag===13){var c=io(a,134217728);if(c!==null){var h=Pr();si(c,a,134217728,h)}C1(a,134217728)}},rp=function(a){if(a.tag===13){var c=ia(a),h=io(a,c);if(h!==null){var y=Pr();si(h,a,c,y)}C1(a,c)}},sp=function(){return jt},ip=function(a,c){var h=jt;try{return jt=a,c()}finally{jt=h}},Gs=function(a,c,h){switch(c){case"input":if(yt(a,h),c=h.name,h.type==="radio"&&c!=null){for(h=a;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<h.length;c++){var y=h[c];if(y!==a&&y.form===a.form){var k=yp(y);if(!k)throw Error(n(90));Ge(y),yt(y,k)}}}break;case"textarea":qe(a,h);break;case"select":c=h.value,c!=null&&Re(a,!!h.multiple,c,!1)}},Xe=_1,Ot=vl;var TD={usingClientEntryPoint:!1,Events:[Fd,Lc,yp,Xi,rs,_1]},Jd={findFiberByHostInstance:cl,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ID={bundleType:Jd.bundleType,version:Jd.version,rendererPackageName:Jd.rendererPackageName,rendererConfig:Jd.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:R.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=yd(a),a===null?null:a.stateNode},findFiberByHostInstance:Jd.findFiberByHostInstance||RD,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 n0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!n0.isDisabled&&n0.supportsFiber)try{bc=n0.inject(ID),Ts=n0}catch{}}return Br.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=TD,Br.createPortal=function(a,c){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!R1(c))throw Error(n(200));return PD(a,c,null,h)},Br.createRoot=function(a,c){if(!R1(a))throw Error(n(299));var h=!1,y="",k=x8;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onRecoverableError!==void 0&&(k=c.onRecoverableError)),c=E1(a,1,!1,null,null,h,!1,y,k),a[to]=c.current,Dd(a.nodeType===8?a.parentNode:a),new P1(c)},Br.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var c=a._reactInternals;if(c===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=yd(c),a=a===null?null:a.stateNode,a},Br.flushSync=function(a){return vl(a)},Br.hydrate=function(a,c,h){if(!e0(c))throw Error(n(200));return t0(null,a,c,!0,h)},Br.hydrateRoot=function(a,c,h){if(!R1(a))throw Error(n(405));var y=h!=null&&h.hydratedSources||null,k=!1,P="",O=x8;if(h!=null&&(h.unstable_strictMode===!0&&(k=!0),h.identifierPrefix!==void 0&&(P=h.identifierPrefix),h.onRecoverableError!==void 0&&(O=h.onRecoverableError)),c=_8(c,null,a,1,h??null,k,!1,P,O),a[to]=c.current,Dd(a),y)for(a=0;a<y.length;a++)h=y[a],k=h._getVersion,k=k(h._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[h,k]:c.mutableSourceEagerHydrationData.push(h,k);return new Jp(c)},Br.render=function(a,c,h){if(!e0(c))throw Error(n(200));return t0(null,a,c,!1,h)},Br.unmountComponentAtNode=function(a){if(!e0(a))throw Error(n(40));return a._reactRootContainer?(vl(function(){t0(null,null,a,!1,function(){a._reactRootContainer=null,a[to]=null})}),!0):!1},Br.unstable_batchedUpdates=_1,Br.unstable_renderSubtreeIntoContainer=function(a,c,h,y){if(!e0(h))throw Error(n(200));if(a==null||a._reactInternals===void 0)throw Error(n(38));return t0(a,c,h,!1,y)},Br.version="18.3.1-next-f1338f8080-20240426",Br}var yk;function $R(){if(yk)return gy.exports;yk=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(),gy.exports=fV(),gy.exports}var _k;function hV(){if(_k)return p0;_k=1;var t=$R();return p0.createRoot=t.createRoot,p0.hydrateRoot=t.hydrateRoot,p0}var pV=hV();const mV=_g(pV),Po={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function jR(t){return"init"in t}function d2(t){return typeof t.write=="function"}function gV(t){return!!t.onMount}function wk(t){return"v"in t||"e"in t}function $m(t){if("e"in t)throw t.e;if((Po?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}function jm(t){return typeof(t==null?void 0:t.then)=="function"}function vV(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 FR(t,e,n){if(!n.p.has(t)){n.p.add(t);const r=()=>n.p.delete(t);e.then(r,r)}}function VR(t,e,n){const r=n.get(t),s=r==null?void 0:r.t,i=e.p;if(!(s!=null&&s.size))return i;if(!i.size)return s;const o=new Set(s);for(const l of i)o.add(l);return o}function yV(t){return!!t.INTERNAL_onInit}const _V=(t,e,n,...r)=>n.read(...r),wV=(t,e,n,...r)=>n.write(...r),xV=(t,e,n)=>n.INTERNAL_onInit(e),bV=(t,e,n,r)=>{var s;return(s=n.onMount)==null?void 0:s.call(n,r)},SV=(t,e,n)=>{var r;const s=t[0];let i=s.get(n);if(!i){const o=t[6],l=t[9];i={d:new Map,p:new Set,n:0},s.set(n,i),(r=o.i)==null||r.call(o,n),yV(n)&&l(t,e,n)}return i},kV=(t,e)=>{var n;const r=t[1],s=t[3],i=t[4],o=t[5],l=t[6],u=t[13];if(!l.f&&!s.size&&!i.size&&!o.size)return;const d=[],f=p=>{try{p()}catch(g){d.push(g)}};do{l.f&&f(l.f);const p=new Set;for(const g of s){const v=(n=r.get(g))==null?void 0:n.l;if(v)for(const w of v)p.add(w)}s.clear();for(const g of o)p.add(g);o.clear();for(const g of i)p.add(g);i.clear();for(const g of p)f(g);s.size&&u(t,e)}while(s.size||o.size||i.size);if(d.length)throw new AggregateError(d)},EV=(t,e)=>{const n=t[1],r=t[2],s=t[3],i=t[11],o=t[14],l=t[17];if(!s.size)return;const u=[],d=[],f=new WeakSet,p=new WeakSet,g=[],v=[];for(const w of s)g.push(w),v.push(i(t,e,w));for(;g.length;){const w=g.length-1,_=g[w],x=v[w];if(p.has(_)){g.pop(),v.pop();continue}if(f.has(_)){if(r.get(_)===x.n)u.push(_),d.push(x);else if((Po?"production":void 0)!=="production"&&r.has(_))throw new Error("[Bug] invalidated atom exists");p.add(_),g.pop(),v.pop();continue}f.add(_);for(const b of VR(_,x,n))f.has(b)||(g.push(b),v.push(i(t,e,b)))}for(let w=u.length-1;w>=0;--w){const _=u[w],x=d[w];let b=!1;for(const E of x.d.keys())if(E!==_&&s.has(E)){b=!0;break}b&&(r.set(_,x.n),o(t,e,_),l(t,e,_)),r.delete(_)}},f2=new WeakSet,CV=(t,e,n)=>{var r,s;const i=t[1],o=t[2],l=t[3],u=t[6],d=t[7],f=t[11],p=t[12],g=t[13],v=t[14],w=t[16],_=t[17],x=t[20],b=t[26],E=t[28],C=f(t,e,n),R=E[0];if(wk(C)){if(i.has(n)&&o.get(n)!==C.n||C.m===R)return C.m=R,C;let z=!1;for(const[Z,Q]of C.d)if(v(t,e,Z).n!==Q){z=!0;break}if(!z)return C.m=R,C}let A=!0;const I=new Set(C.d.keys()),M=()=>{for(const z of I)C.d.delete(z)},T=()=>{if(i.has(n)){const z=!l.size;_(t,e,n),z&&(g(t,e),p(t,e))}},L=z=>{var Z;if(z===n){const B=f(t,e,z);if(!wk(B))if(jR(z))x(t,e,z,z.init);else throw new Error("no atom init");return $m(B)}const Q=v(t,e,z);try{return $m(Q)}finally{I.delete(z),C.d.set(z,Q.n),jm(C.v)&&FR(n,C.v,Q),i.has(n)&&((Z=i.get(z))==null||Z.t.add(n)),A||T()}};let D,j;const H={get signal(){return D||(D=new AbortController),D.signal},get setSelf(){return(Po?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(Po?"production":void 0)!=="production"&&!d2(n)&&console.warn("setSelf function cannot be used with read-only atom"),!j&&d2(n)&&(j=(...z)=>{if((Po?"production":void 0)!=="production"&&A&&console.warn("setSelf function cannot be called in sync"),!A)try{return w(t,e,n,z)}finally{g(t,e),p(t,e)}}),j}},Y=C.n,U=o.get(n)===Y;try{(Po?"production":void 0)!=="production"&&f2.delete(e);const z=d(t,e,n,L,H);if((Po?"production":void 0)!=="production"&&f2.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),x(t,e,n,z),jm(z)){b(t,e,z,()=>D==null?void 0:D.abort());const Z=()=>{M(),T()};z.then(Z,Z)}else M();return(r=u.r)==null||r.call(u,n),C.m=R,C}catch(z){if(vV(z))throw z;return delete C.v,C.e=z,++C.n,C.m=R,C}finally{A=!1,C.n!==Y&&U&&(o.set(n,C.n),l.add(n),(s=u.c)==null||s.call(u,n))}},PV=(t,e,n)=>{const r=t[1],s=t[2],i=t[11],o=[n];for(;o.length;){const l=o.pop(),u=i(t,e,l);for(const d of VR(l,u,r)){const f=i(t,e,d);s.get(d)!==f.n&&(s.set(d,f.n),o.push(d))}}},RV=(t,e,n,r)=>{const s=t[3],i=t[6],o=t[8],l=t[11],u=t[12],d=t[13],f=t[14],p=t[15],g=t[16],v=t[17],w=t[20],_=t[28];let x=!0;const b=C=>$m(f(t,e,C)),E=(C,...R)=>{var A;const I=l(t,e,C);try{if(C===n){if(!jR(C))throw new Error("atom not writable");(Po?"production":void 0)!=="production"&&f2.add(e);const M=I.n,T=R[0];w(t,e,C,T),v(t,e,C),M!==I.n&&(++_[0],s.add(C),p(t,e,C),(A=i.c)==null||A.call(i,C));return}else return g(t,e,C,R)}finally{x||(d(t,e),u(t,e))}};try{return o(t,e,n,b,E,...r)}finally{x=!1}},AV=(t,e,n)=>{var r;const s=t[1],i=t[3],o=t[6],l=t[11],u=t[15],d=t[18],f=t[19],p=l(t,e,n),g=s.get(n);if(g&&p.d.size>0){for(const[v,w]of p.d)if(!g.d.has(v)){const _=l(t,e,v);d(t,e,v).t.add(n),g.d.add(v),w!==_.n&&(i.add(v),u(t,e,v),(r=o.c)==null||r.call(o,v))}for(const v of g.d)if(!p.d.has(v)){g.d.delete(v);const w=f(t,e,v);w==null||w.t.delete(n)}}},TV=(t,e,n)=>{var r;const s=t[1],i=t[4],o=t[6],l=t[10],u=t[11],d=t[12],f=t[13],p=t[14],g=t[16],v=t[18],w=u(t,e,n);let _=s.get(n);if(!_){p(t,e,n);for(const x of w.d.keys())v(t,e,x).t.add(n);if(_={l:new Set,d:new Set(w.d.keys()),t:new Set},s.set(n,_),d2(n)&&gV(n)){const x=()=>{let b=!0;const E=(...C)=>{try{return g(t,e,n,C)}finally{b||(f(t,e),d(t,e))}};try{const C=l(t,e,n,E);C&&(_.u=()=>{b=!0;try{C()}finally{b=!1}})}finally{b=!1}};i.add(x)}(r=o.m)==null||r.call(o,n)}return _},IV=(t,e,n)=>{var r,s;const i=t[1],o=t[5],l=t[6],u=t[11],d=t[19],f=u(t,e,n);let p=i.get(n);if(!p||p.l.size)return p;let g=!1;for(const v of p.t)if((r=i.get(v))!=null&&r.d.has(n)){g=!0;break}if(!g){p.u&&o.add(p.u),p=void 0,i.delete(n);for(const v of f.d.keys()){const w=d(t,e,v);w==null||w.t.delete(n)}(s=l.u)==null||s.call(l,n);return}return p},MV=(t,e,n,r)=>{const s=t[11],i=t[27],o=s(t,e,n),l="v"in o,u=o.v;if(jm(r))for(const d of o.d.keys())FR(n,r,s(t,e,d));o.v=r,delete o.e,(!l||!Object.is(u,o.v))&&(++o.n,jm(u)&&i(t,e,u))},OV=(t,e,n)=>{const r=t[14];return $m(r(t,e,n))},LV=(t,e,n,...r)=>{const s=t[3],i=t[12],o=t[13],l=t[16],u=s.size;try{return l(t,e,n,r)}finally{s.size!==u&&(o(t,e),i(t,e))}},NV=(t,e,n,r)=>{const s=t[12],i=t[13],o=t[18],l=t[19],d=o(t,e,n).l;return d.add(r),i(t,e),s(t,e),()=>{d.delete(r),l(t,e,n),i(t,e),s(t,e)}},DV=(t,e,n,r)=>{const s=t[25];let i=s.get(n);if(!i){i=new Set,s.set(n,i);const o=()=>s.delete(n);n.then(o,o)}i.add(r)},$V=(t,e,n)=>{const s=t[25].get(n);s==null||s.forEach(i=>i())},HR=new WeakMap;function jV(t){const e=HR.get(t);if((Po?"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 FV(...t){const e={get(o){return r(n,e,o)},set(o,...l){return s(n,e,o,...l)},sub(o,l){return i(n,e,o,l)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},_V,wV,xV,bV,SV,kV,EV,CV,PV,RV,AV,TV,IV,MV,OV,LV,NV,void 0,new WeakMap,DV,$V,[0]].map((o,l)=>t[l]||o);HR.set(e,Object.freeze(n));const r=n[21],s=n[22],i=n[23];return e}const zR={};let VV=0;function dt(t,e){const n=`atom${++VV}`,r={toString(){return(zR?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=HV,r.write=zV),e&&(r.write=e),r}function HV(t){return t(this)}function zV(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function BV(){return FV()}let ff;function UV(){return ff||(ff=BV(),(zR?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=ff),globalThis.__JOTAI_DEFAULT_STORE__!==ff&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),ff}const ZV={},WV=m.createContext(void 0);function Eg(t){return m.useContext(WV)||UV()}const h2=t=>typeof(t==null?void 0:t.then)=="function",p2=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},qV=we.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(p2(t),t)}),_y=new WeakMap,xk=(t,e,n)=>{const r=jV(t),s=r[26];let i=_y.get(e);return i||(i=new Promise((o,l)=>{let u=e;const d=g=>v=>{u===g&&o(v)},f=g=>v=>{u===g&&l(v)},p=()=>{try{const g=n();h2(g)?(_y.set(g,i),u=g,g.then(d(g),f(g)),s(r,t,g,p)):o(g)}catch(g){l(g)}};e.then(d(e),f(e)),s(r,t,e,p)}),_y.set(e,i)),i};function ct(t,e){const{delay:n,unstable_promiseStatus:r=!we.use}={},s=Eg(),[[i,o,l],u]=m.useReducer(f=>{const p=s.get(t);return Object.is(f[0],p)&&f[1]===s&&f[2]===t?f:[p,s,t]},void 0,()=>[s.get(t),s,t]);let d=i;if((o!==s||l!==t)&&(u(),d=s.get(t)),m.useEffect(()=>{const f=s.sub(t,()=>{if(r)try{const p=s.get(t);h2(p)&&p2(xk(s,p,()=>s.get(t)))}catch{}if(typeof n=="number"){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3.
|
|
43
|
-
|
|
44
|
-
Migration guide:
|
|
45
|
-
|
|
46
|
-
Create a custom hook like the following.
|
|
47
|
-
|
|
48
|
-
function useAtomValueWithDelay<Value>(
|
|
49
|
-
atom: Atom<Value>,
|
|
50
|
-
options: { delay: number },
|
|
51
|
-
): Value {
|
|
52
|
-
const { delay } = options
|
|
53
|
-
const store = useStore(options)
|
|
54
|
-
const [value, setValue] = useState(() => store.get(atom))
|
|
55
|
-
useEffect(() => {
|
|
56
|
-
const unsub = store.sub(atom, () => {
|
|
57
|
-
setTimeout(() => setValue(store.get(atom)), delay)
|
|
58
|
-
})
|
|
59
|
-
return unsub
|
|
60
|
-
}, [store, atom, delay])
|
|
61
|
-
return value
|
|
62
|
-
}
|
|
63
|
-
`),setTimeout(u,n);return}u()});return u(),f},[s,t,n,r]),m.useDebugValue(d),h2(d)){const f=xk(s,d,()=>s.get(t));return r&&p2(f),qV(f)}return d}function mt(t,e){const n=Eg();return m.useCallback((...s)=>{if((ZV?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...s)},[n,t])}function BR(t,e){return[ct(t),mt(t)]}const hx=m.createContext({});function px(t){const e=m.useRef(null);return e.current===null&&(e.current=t()),e.current}const GV=typeof window<"u",mx=GV?m.useLayoutEffect:m.useEffect,Cg=m.createContext(null);function gx(t,e){t.indexOf(e)===-1&&t.push(e)}function Fm(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Ui=(t,e,n)=>n>e?e:n<t?t:n;let Pg=()=>{};const Va={},UR=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),ZR=t=>typeof t=="object"&&t!==null,WR=t=>/^0[^.\s]+$/u.test(t);function qR(t){let e;return()=>(e===void 0&&(e=t()),e)}const Ws=t=>t,Vh=(...t)=>t.reduce((e,n)=>r=>n(e(r))),oh=(t,e,n)=>{const r=e-t;return r?(n-t)/r:1};class vx{constructor(){this.subscriptions=[]}add(e){return gx(this.subscriptions,e),()=>Fm(this.subscriptions,e)}notify(e,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const _s=t=>t*1e3,zs=t=>t/1e3,GR=(t,e)=>e?t*(1e3/e):0,KR=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,KV=1e-7,YV=12;function XV(t,e,n,r,s){let i,o,l=0;do o=e+(n-e)/2,i=KR(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>KV&&++l<YV);return o}function Hh(t,e,n,r){if(t===e&&n===r)return Ws;const s=i=>XV(i,0,1,t,n);return i=>i===0||i===1?i:KR(s(i),e,r)}const YR=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,XR=t=>e=>1-t(1-e),QR=Hh(.33,1.53,.69,.99),yx=XR(QR),JR=YR(yx),eA=t=>t>=1?1:(t*=2)<1?.5*yx(t):.5*(2-Math.pow(2,-10*(t-1))),_x=t=>1-Math.sin(Math.acos(t)),tA=XR(_x),nA=YR(_x),QV=Hh(.42,0,1,1),JV=Hh(0,0,.58,1),rA=Hh(.42,0,.58,1),eH=t=>Array.isArray(t)&&typeof t[0]!="number",sA=t=>Array.isArray(t)&&typeof t[0]=="number",tH={linear:Ws,easeIn:QV,easeInOut:rA,easeOut:JV,circIn:_x,circInOut:nA,circOut:tA,backIn:yx,backInOut:JR,backOut:QR,anticipate:eA},nH=t=>typeof t=="string",bk=t=>{if(sA(t)){Pg(t.length===4);const[e,n,r,s]=t;return Hh(e,n,r,s)}else if(nH(t))return tH[t];return t},m0=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function rH(t){let e=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(d){i.has(d)&&(u.schedule(d),t()),d(o)}const u={schedule:(d,f=!1,p=!1)=>{const v=p&&r?e:n;return f&&i.add(d),v.add(d),d},cancel:d=>{n.delete(d),i.delete(d)},process:d=>{if(o=d,r){s=!0;return}r=!0;const f=e;e=n,n=f,e.forEach(l),e.clear(),r=!1,s&&(s=!1,u.process(d))}};return u}const sH=40;function iA(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=m0.reduce((C,R)=>(C[R]=rH(i),C),{}),{setup:l,read:u,resolveKeyframes:d,preUpdate:f,update:p,preRender:g,render:v,postRender:w}=o,_=()=>{const C=Va.useManualTiming,R=C?s.timestamp:performance.now();n=!1,C||(s.delta=r?1e3/60:Math.max(Math.min(R-s.timestamp,sH),1)),s.timestamp=R,s.isProcessing=!0,l.process(s),u.process(s),d.process(s),f.process(s),p.process(s),g.process(s),v.process(s),w.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(_))},x=()=>{n=!0,r=!0,s.isProcessing||t(_)};return{schedule:m0.reduce((C,R)=>{const A=o[R];return C[R]=(I,M=!1,T=!1)=>(n||x(),A.schedule(I,M,T)),C},{}),cancel:C=>{for(let R=0;R<m0.length;R++)o[m0[R]].cancel(C)},state:s,steps:o}}const{schedule:Kt,cancel:Ha,state:ur,steps:wy}=iA(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ws,!0);let q0;function iH(){q0=void 0}const Lr={now:()=>(q0===void 0&&Lr.set(ur.isProcessing||Va.useManualTiming?ur.timestamp:performance.now()),q0),set:t=>{q0=t,queueMicrotask(iH)}},oA=t=>e=>typeof e=="string"&&e.startsWith(t),aA=oA("--"),oH=oA("var(--"),wx=t=>oH(t)?aH.test(t.split("/*")[0].trim()):!1,aH=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Sk(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const cd={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},ah={...cd,transform:t=>Ui(0,1,t)},g0={...cd,default:1},Ff=t=>Math.round(t*1e5)/1e5,xx=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function lH(t){return t==null}const cH=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,bx=(t,e)=>n=>!!(typeof n=="string"&&cH.test(n)&&n.startsWith(t)||e&&!lH(n)&&Object.prototype.hasOwnProperty.call(n,e)),lA=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,l]=r.match(xx);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},uH=t=>Ui(0,255,t),xy={...cd,transform:t=>Math.round(uH(t))},Vl={test:bx("rgb","red"),parse:lA("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+xy.transform(t)+", "+xy.transform(e)+", "+xy.transform(n)+", "+Ff(ah.transform(r))+")"};function dH(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 m2={test:bx("#"),parse:dH,transform:Vl.transform},zh=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),yo=zh("deg"),Hi=zh("%"),Fe=zh("px"),fH=zh("vh"),hH=zh("vw"),kk={...Hi,parse:t=>Hi.parse(t)/100,transform:t=>Hi.transform(t*100)},mu={test:bx("hsl","hue"),parse:lA("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Hi.transform(Ff(e))+", "+Hi.transform(Ff(n))+", "+Ff(ah.transform(r))+")"},jn={test:t=>Vl.test(t)||m2.test(t)||mu.test(t),parse:t=>Vl.test(t)?Vl.parse(t):mu.test(t)?mu.parse(t):m2.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Vl.transform(t):mu.transform(t),getAnimatableNone:t=>{const e=jn.parse(t);return e.alpha=0,jn.transform(e)}},pH=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function mH(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(xx))==null?void 0:e.length)||0)+(((n=t.match(pH))==null?void 0:n.length)||0)>0}const cA="number",uA="color",gH="var",vH="var(",Ek="${}",yH=/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 Gu(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=e.replace(yH,u=>(jn.test(u)?(r.color.push(i),s.push(uA),n.push(jn.parse(u))):u.startsWith(vH)?(r.var.push(i),s.push(gH),n.push(u)):(r.number.push(i),s.push(cA),n.push(parseFloat(u))),++i,Ek)).split(Ek);return{values:n,split:l,indexes:r,types:s}}function _H(t){return Gu(t).values}function dA({split:t,types:e}){const n=t.length;return r=>{let s="";for(let i=0;i<n;i++)if(s+=t[i],r[i]!==void 0){const o=e[i];o===cA?s+=Ff(r[i]):o===uA?s+=jn.transform(r[i]):s+=r[i]}return s}}function wH(t){return dA(Gu(t))}const xH=t=>typeof t=="number"?0:jn.test(t)?jn.getAnimatableNone(t):t,bH=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:xH(t);function SH(t){const e=Gu(t);return dA(e)(e.values.map((r,s)=>bH(r,e.split[s])))}const mi={test:mH,parse:_H,createTransformer:wH,getAnimatableNone:SH};function by(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 kH({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,i=0,o=0;if(!e)s=i=o=n;else{const l=n<.5?n*(1+e):n+e-n*e,u=2*n-l;s=by(u,l,t+1/3),i=by(u,l,t),o=by(u,l,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Vm(t,e){return n=>n>0?e:t}const Gt=(t,e,n)=>t+(e-t)*n,Sy=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},EH=[m2,Vl,mu],CH=t=>EH.find(e=>e.test(t));function Ck(t){const e=CH(t);if(!e)return!1;let n=e.parse(t);return e===mu&&(n=kH(n)),n}const Pk=(t,e)=>{const n=Ck(t),r=Ck(e);if(!n||!r)return Vm(t,e);const s={...n};return i=>(s.red=Sy(n.red,r.red,i),s.green=Sy(n.green,r.green,i),s.blue=Sy(n.blue,r.blue,i),s.alpha=Gt(n.alpha,r.alpha,i),Vl.transform(s))},g2=new Set(["none","hidden"]);function PH(t,e){return g2.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function RH(t,e){return n=>Gt(t,e,n)}function Sx(t){return typeof t=="number"?RH:typeof t=="string"?wx(t)?Vm:jn.test(t)?Pk:IH:Array.isArray(t)?fA:typeof t=="object"?jn.test(t)?Pk:AH:Vm}function fA(t,e){const n=[...t],r=n.length,s=t.map((i,o)=>Sx(i)(i,e[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function AH(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=Sx(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function TH(t,e){const n=[],r={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const i=e.types[s],o=t.indexes[i][r[i]],l=t.values[o]??0;n[s]=l,r[i]++}return n}const IH=(t,e)=>{const n=mi.createTransformer(e),r=Gu(t),s=Gu(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?g2.has(t)&&!s.values.length||g2.has(e)&&!r.values.length?PH(t,e):Vh(fA(TH(r,s),s.values),n):Vm(t,e)};function hA(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Gt(t,e,n):Sx(t)(t,e)}const MH=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Kt.update(e,n),stop:()=>Ha(e),now:()=>ur.isProcessing?ur.timestamp:Lr.now()}},pA=(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)})`},Hm=2e4;function kx(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Hm;)e+=n,r=t.next(e);return e>=Hm?1/0:e}function OH(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(kx(r),Hm);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:zs(s)}}const En={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 v2(t,e){return t*Math.sqrt(1-e*e)}const LH=12;function NH(t,e,n){let r=n;for(let s=1;s<LH;s++)r=r-t(r)/e(r);return r}const ky=.001;function DH({duration:t=En.duration,bounce:e=En.bounce,velocity:n=En.velocity,mass:r=En.mass}){let s,i,o=1-e;o=Ui(En.minDamping,En.maxDamping,o),t=Ui(En.minDuration,En.maxDuration,zs(t)),o<1?(s=d=>{const f=d*o,p=f*t,g=f-n,v=v2(d,o),w=Math.exp(-p);return ky-g/v*w},i=d=>{const p=d*o*t,g=p*n+n,v=Math.pow(o,2)*Math.pow(d,2)*t,w=Math.exp(-p),_=v2(Math.pow(d,2),o);return(-s(d)+ky>0?-1:1)*((g-v)*w)/_}):(s=d=>{const f=Math.exp(-d*t),p=(d-n)*t+1;return-ky+f*p},i=d=>{const f=Math.exp(-d*t),p=(n-d)*(t*t);return f*p});const l=5/t,u=NH(s,i,l);if(t=_s(t),isNaN(u))return{stiffness:En.stiffness,damping:En.damping,duration:t};{const d=Math.pow(u,2)*r;return{stiffness:d,damping:o*2*Math.sqrt(r*d),duration:t}}}const $H=["duration","bounce"],jH=["stiffness","damping","mass"];function Rk(t,e){return e.some(n=>t[n]!==void 0)}function FH(t){let e={velocity:En.velocity,stiffness:En.stiffness,damping:En.damping,mass:En.mass,isResolvedFromDuration:!1,...t};if(!Rk(t,jH)&&Rk(t,$H))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Ui(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:En.mass,stiffness:s,damping:i}}else{const n=DH({...t,velocity:0});e={...e,...n,mass:En.mass},e.isResolvedFromDuration=!0}return e}function zm(t=En.visualDuration,e=En.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:i},{stiffness:u,damping:d,mass:f,duration:p,velocity:g,isResolvedFromDuration:v}=FH({...n,velocity:-zs(n.velocity||0)}),w=g||0,_=d/(2*Math.sqrt(u*f)),x=o-i,b=zs(Math.sqrt(u/f)),E=Math.abs(x)<5;r||(r=E?En.restSpeed.granular:En.restSpeed.default),s||(s=E?En.restDelta.granular:En.restDelta.default);let C,R,A,I,M,T;if(_<1)A=v2(b,_),I=(w+_*b*x)/A,C=D=>{const j=Math.exp(-_*b*D);return o-j*(I*Math.sin(A*D)+x*Math.cos(A*D))},M=_*b*I+x*A,T=_*b*x-I*A,R=D=>Math.exp(-_*b*D)*(M*Math.sin(A*D)+T*Math.cos(A*D));else if(_===1){C=j=>o-Math.exp(-b*j)*(x+(w+b*x)*j);const D=w+b*x;R=j=>Math.exp(-b*j)*(b*D*j-w)}else{const D=b*Math.sqrt(_*_-1);C=U=>{const z=Math.exp(-_*b*U),Z=Math.min(D*U,300);return o-z*((w+_*b*x)*Math.sinh(Z)+D*x*Math.cosh(Z))/D};const j=(w+_*b*x)/D,H=_*b*j-x*D,Y=_*b*x-j*D;R=U=>{const z=Math.exp(-_*b*U),Z=Math.min(D*U,300);return z*(H*Math.sinh(Z)+Y*Math.cosh(Z))}}const L={calculatedDuration:v&&p||null,velocity:D=>_s(R(D)),next:D=>{if(!v&&_<1){const H=Math.exp(-_*b*D),Y=Math.sin(A*D),U=Math.cos(A*D),z=o-H*(I*Y+x*U),Z=_s(H*(M*Y+T*U));return l.done=Math.abs(Z)<=r&&Math.abs(o-z)<=s,l.value=l.done?o:z,l}const j=C(D);if(v)l.done=D>=p;else{const H=_s(R(D));l.done=Math.abs(H)<=r&&Math.abs(o-j)<=s}return l.value=l.done?o:j,l},toString:()=>{const D=Math.min(kx(L),Hm),j=pA(H=>L.next(D*H).value,D,30);return D+"ms "+j},toTransition:()=>{}};return L}zm.applyToOptions=t=>{const e=OH(t,100,zm);return t.ease=e.ease,t.duration=_s(e.duration),t.type="keyframes",t};const VH=5;function mA(t,e,n){const r=Math.max(e-VH,0);return GR(n-t(r),e-r)}function y2({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:l,max:u,restDelta:d=.5,restSpeed:f}){const p=t[0],g={done:!1,value:p},v=T=>l!==void 0&&T<l||u!==void 0&&T>u,w=T=>l===void 0?u:u===void 0||Math.abs(l-T)<Math.abs(u-T)?l:u;let _=n*e;const x=p+_,b=o===void 0?x:o(x);b!==x&&(_=b-p);const E=T=>-_*Math.exp(-T/r),C=T=>b+E(T),R=T=>{const L=E(T),D=C(T);g.done=Math.abs(L)<=d,g.value=g.done?b:D};let A,I;const M=T=>{v(g.value)&&(A=T,I=zm({keyframes:[g.value,w(g.value)],velocity:mA(C,T,g.value),damping:s,stiffness:i,restDelta:d,restSpeed:f}))};return M(0),{calculatedDuration:null,next:T=>{let L=!1;return!I&&A===void 0&&(L=!0,R(T),M(T)),A!==void 0&&T>=A?I.next(T-A):(!L&&R(T),g)}}}function HH(t,e,n){const r=[],s=n||Va.mix||hA,i=t.length-1;for(let o=0;o<i;o++){let l=s(t[o],t[o+1]);if(e){const u=Array.isArray(e)?e[o]||Ws:e;l=Vh(u,l)}r.push(l)}return r}function zH(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(Pg(i===e.length),i===1)return()=>e[0];if(i===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const l=HH(e,r,s),u=l.length,d=f=>{if(o&&f<t[0])return e[0];let p=0;if(u>1)for(;p<t.length-2&&!(f<t[p+1]);p++);const g=oh(t[p],t[p+1],f);return l[p](g)};return n?f=>d(Ui(t[0],t[i-1],f)):d}function BH(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=oh(0,e,r);t.push(Gt(n,1,s))}}function UH(t){const e=[0];return BH(e,t.length-1),e}function ZH(t,e){return t.map(n=>n*e)}function WH(t,e){return t.map(()=>e||rA).splice(0,t.length-1)}function Vf({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=eH(r)?r.map(bk):bk(r),i={done:!1,value:e[0]},o=ZH(n&&n.length===e.length?n:UH(e),t),l=zH(o,e,{ease:Array.isArray(s)?s:WH(e,s)});return{calculatedDuration:t,next:u=>(i.value=l(u),i.done=u>=t,i)}}const qH=t=>t!==null;function Rg(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(qH),l=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!l||r===void 0?i[l]:r}const GH={decay:y2,inertia:y2,tween:Vf,keyframes:Vf,spring:zm};function gA(t){typeof t.type=="string"&&(t.type=GH[t.type])}class Ex{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 KH=t=>t/100;class Bm extends Ex{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!==Lr.now()&&this.tick(Lr.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;gA(e);const{type:n=Vf,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=e;let{keyframes:l}=e;const u=n||Vf;u!==Vf&&typeof l[0]!="number"&&(this.mixKeyframes=Vh(KH,hA(l[0],l[1])),l=[0,100]);const d=u({...e,keyframes:l});i==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...l].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=kx(d));const{calculatedDuration:f}=d;this.calculatedDuration=f,this.resolvedDuration=f+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=d}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:u}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:f,repeat:p,repeatType:g,repeatDelay:v,type:w,onUpdate:_,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const b=this.currentTime-d*(this.playbackSpeed>=0?1:-1),E=this.playbackSpeed>=0?b<0:b>s;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let C=this.currentTime,R=r;if(p){const T=Math.min(this.currentTime,s)/l;let L=Math.floor(T),D=T%1;!D&&T>=1&&(D=1),D===1&&L--,L=Math.min(L,p+1),!!(L%2)&&(g==="reverse"?(D=1-D,v&&(D-=v/l)):g==="mirror"&&(R=o)),C=Ui(0,1,D)*l}let A;E?(this.delayState.value=f[0],A=this.delayState):A=R.next(C),i&&!E&&(A.value=i(A.value));let{done:I}=A;!E&&u!==null&&(I=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&I);return M&&w!==y2&&(A.value=Rg(f,this.options,x,this.speed)),_&&_(A.value),M&&this.finish(),A}then(e,n){return this.finished.then(e,n)}get duration(){return zs(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+zs(e)}get time(){return zs(this.currentTime)}set time(e){e=_s(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 mA(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(Lr.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=zs(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=MH,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Lr.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 YH(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Hl=t=>t*180/Math.PI,_2=t=>{const e=Hl(Math.atan2(t[1],t[0]));return w2(e)},XH={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:_2,rotateZ:_2,skewX:t=>Hl(Math.atan(t[1])),skewY:t=>Hl(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},w2=t=>(t=t%360,t<0&&(t+=360),t),Ak=_2,Tk=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Ik=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),QH={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Tk,scaleY:Ik,scale:t=>(Tk(t)+Ik(t))/2,rotateX:t=>w2(Hl(Math.atan2(t[6],t[5]))),rotateY:t=>w2(Hl(Math.atan2(-t[2],t[0]))),rotateZ:Ak,rotate:Ak,skewX:t=>Hl(Math.atan(t[4])),skewY:t=>Hl(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function x2(t){return t.includes("scale")?1:0}function b2(t,e){if(!t||t==="none")return x2(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=QH,s=n;else{const l=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=XH,s=l}if(!s)return x2(e);const i=r[e],o=s[1].split(",").map(ez);return typeof i=="function"?i(o):o[i]}const JH=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return b2(n,e)};function ez(t){return parseFloat(t.trim())}const ud=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],dd=new Set([...ud,"pathRotation"]),Mk=t=>t===cd||t===Fe,tz=new Set(["x","y","z"]),nz=ud.filter(t=>!tz.has(t));function rz(t){const e=[];return nz.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Ra={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})=>b2(e,"x"),y:(t,{transform:e})=>b2(e,"y")};Ra.translateX=Ra.x;Ra.translateY=Ra.y;const tc=new Set;let S2=!1,k2=!1,E2=!1;function vA(){if(k2){const t=Array.from(tc).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=rz(r);s.length&&(n.set(r,s),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var l;(l=r.getValue(i))==null||l.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}k2=!1,S2=!1,tc.forEach(t=>t.complete(E2)),tc.clear()}function yA(){tc.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(k2=!0)})}function sz(){E2=!0,yA(),vA(),E2=!1}class Cx{constructor(e,n,r,s,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(tc.add(this),S2||(S2=!0,Kt.read(yA),Kt.resolveKeyframes(vA))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:s}=this;if(e[0]===null){const i=s==null?void 0:s.get(),o=e[e.length-1];if(i!==void 0)e[0]=i;else if(r&&n){const l=r.readValue(n,o);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=o),s&&i===void 0&&s.set(e[0])}YH(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),tc.delete(this)}cancel(){this.state==="scheduled"&&(tc.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const iz=t=>t.startsWith("--");function _A(t,e,n){iz(e)?t.style.setProperty(e,n):t.style[e]=n}const oz={};function wA(t,e){const n=qR(t);return()=>oz[e]??n()}const az=wA(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),xA=wA(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),wf=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,Ok={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:wf([0,.65,.55,1]),circOut:wf([.55,0,1,.45]),backIn:wf([.31,.01,.66,-.59]),backOut:wf([.33,1.53,.69,.99])};function bA(t,e){if(t)return typeof t=="function"?xA()?pA(t,e):"ease-out":sA(t)?wf(t):Array.isArray(t)?t.map(n=>bA(n,e)||Ok.easeOut):Ok[t]}function lz(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:l="easeOut",times:u}={},d=void 0){const f={[e]:n};u&&(f.offset=u);const p=bA(l,s);Array.isArray(p)&&(f.easing=p);const g={delay:r,duration:s,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return d&&(g.pseudoElement=d),t.animate(f,g)}function SA(t){return typeof t=="function"&&"applyToOptions"in t}function cz({type:t,...e}){return SA(t)&&xA()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class kA extends Ex{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:l,onComplete:u}=e;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=e,Pg(typeof e.type!="string");const d=cz(e);this.animation=lz(n,r,s,d,i),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const f=Rg(s,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(f),_A(n,r,f),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 zs(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+zs(e)}get time(){return zs(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=_s(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&&az()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Ws):s(this)}}const EA={anticipate:eA,backInOut:JR,circInOut:nA};function uz(t){return t in EA}function dz(t){typeof t.ease=="string"&&uz(t.ease)&&(t.ease=EA[t.ease])}const Ey=10;class fz extends kA{constructor(e){dz(e),gA(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const l=new Bm({...o,autoplay:!1}),u=Math.max(Ey,Lr.now()-this.startTime),d=Ui(0,Ey,u-Ey),f=l.sample(u).value,{name:p}=this.options;i&&p&&_A(i,p,f),n.setWithVelocity(l.sample(Math.max(0,u-d)).value,f,d),l.stop()}}const Lk=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(mi.test(t)||t==="0")&&!t.startsWith("url("));function hz(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 pz(t,e,n,r){const s=t[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const i=t[t.length-1],o=Lk(s,e),l=Lk(i,e);return!o||!l?!1:hz(t)||(n==="spring"||SA(n))&&r}function C2(t){t.duration=0,t.type="keyframes"}const CA=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),mz=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function gz(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&mz.test(t[e]))return!0;return!1}const vz=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),yz=qR(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function _z(t){var p;const{motionValue:e,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:l}=t,u=(p=e==null?void 0:e.owner)==null?void 0:p.current;if(!(u instanceof HTMLElement)&&!(u instanceof SVGElement))return!1;const{onUpdate:d,transformTemplate:f}=e.owner.getProps();return yz()&&n&&(CA.has(n)||vz.has(n)&&gz(l))&&(n!=="transform"||!f)&&!d&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const wz=40;class xz extends Ex{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:l,name:u,motionValue:d,element:f,...p}){var w;super(),this.stop=()=>{var _,x;this._animation&&(this._animation.stop(),(_=this.stopTimeline)==null||_.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=Lr.now();const g={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:u,motionValue:d,element:f,...p},v=(f==null?void 0:f.KeyframeResolver)||Cx;this.keyframeResolver=new v(l,(_,x,b)=>this.onKeyframesResolved(_,x,g,!b),u,d,f),(w=this.keyframeResolver)==null||w.scheduleResolve()}onKeyframesResolved(e,n,r,s){var b,E;this.keyframeResolver=void 0;const{name:i,type:o,velocity:l,delay:u,isHandoff:d,onUpdate:f}=r;this.resolvedAt=Lr.now();let p=!0;pz(e,i,o,l)||(p=!1,(Va.instantAnimations||!u)&&(f==null||f(Rg(e,r,n))),e[0]=e[e.length-1],C2(r),r.repeat=0);const v={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>wz?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},w=p&&!d&&_z(v),_=(E=(b=v.motionValue)==null?void 0:b.owner)==null?void 0:E.current;let x;if(w)try{x=new fz({...v,element:_})}catch{x=new Bm(v)}else x=new Bm(v);x.finished.then(()=>{this.notifyFinished()}).catch(Ws),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),sz()),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 PA(t,e,n,r=0,s=1){const i=Array.from(t).sort((d,f)=>d.sortNodePosition(f)).indexOf(e),o=t.size,l=(o-1)*r;return typeof n=="function"?n(i,o):s===1?i*r:l-i*r}const Nk=30,bz=t=>!isNaN(parseFloat(t));class Sz{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=Lr.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=Lr.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=bz(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 vx);const r=this.events[e].add(n);return e==="change"?()=>{r(),Kt.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=Lr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Nk)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Nk);return GR(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 Ku(t,e){return new Sz(t,e)}function RA(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function Px(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?RA(n,t):n}const kz={type:"spring",stiffness:500,damping:25,restSpeed:10},Ez=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Cz={type:"keyframes",duration:.8},Pz={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Rz=(t,{keyframes:e})=>e.length>2?Cz:dd.has(t)?t.startsWith("scale")?Ez(e[1]):kz:Pz,Az=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Tz(t){for(const e in t)if(!Az.has(e))return!0;return!1}const Rx=(t,e,n,r={},s,i)=>o=>{const l=Px(r,t)||{},u=l.delay||r.delay||0;let{elapsed:d=0}=r;d=d-_s(u);const f={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-d,onUpdate:g=>{e.set(g),l.onUpdate&&l.onUpdate(g)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:i?void 0:s};Tz(l)||Object.assign(f,Rz(t,f)),f.duration&&(f.duration=_s(f.duration)),f.repeatDelay&&(f.repeatDelay=_s(f.repeatDelay)),f.from!==void 0&&(f.keyframes[0]=f.from);let p=!1;if((f.type===!1||f.duration===0&&!f.repeatDelay)&&(C2(f),f.delay===0&&(p=!0)),(Va.instantAnimations||Va.skipAnimations||s!=null&&s.shouldSkipAnimations||l.skipAnimations)&&(p=!0,C2(f),f.delay=0),f.allowFlatten=!l.type&&!l.ease,p&&!i&&e.get()!==void 0){const g=Rg(f.keyframes,l);if(g!==void 0){Kt.update(()=>{f.onUpdate(g),f.onComplete()});return}}return l.isSync?new Bm(f):new xz(f)},Iz=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Mz(t){const e=Iz.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function AA(t,e,n=1){const[r,s]=Mz(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const o=i.trim();return UR(o)?parseFloat(o):o}return wx(s)?AA(s,e,n+1):s}function Dk(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function Ax(t,e,n,r){if(typeof e=="function"){const[s,i]=Dk(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]=Dk(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function nc(t,e,n){const r=t.getProps();return Ax(r,e,n!==void 0?n:r.custom,t)}const TA=new Set(["width","height","top","left","right","bottom",...ud]),P2=t=>Array.isArray(t);function Oz(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ku(n))}function Lz(t){return P2(t)?t[t.length-1]||0:t}function Nz(t,e){const n=nc(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const l=Lz(i[o]);Oz(t,o,l)}}const hr=t=>!!(t&&t.getVelocity);function Dz(t){return!!(hr(t)&&t.add)}function R2(t,e){const n=t.getValue("willChange");if(Dz(n))return n.add(e);if(!n&&Va.WillChange){const r=new Va.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function Tx(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const $z="framerAppearId",IA="data-"+Tx($z);function MA(t){return t.props[IA]}function jz({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function OA(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...l}=e;const u=t.getDefaultTransition();i=i?RA(i,u):u;const d=i==null?void 0:i.reduceMotion,f=i==null?void 0:i.skipAnimations;r&&(i=r);const p=[],g=s&&t.animationState&&t.animationState.getState()[s],v=i==null?void 0:i.path;v&&v.animateVisualElement(t,l,i,n,p);for(const w in l){const _=t.getValue(w,t.latestValues[w]??null),x=l[w];if(x===void 0||g&&jz(g,w))continue;const b={delay:n,...Px(i||{},w)};f&&(b.skipAnimations=!0);const E=_.get();if(E!==void 0&&!_.isAnimating()&&!Array.isArray(x)&&x===E&&!b.velocity){Kt.update(()=>_.set(x));continue}let C=!1;if(window.MotionHandoffAnimation){const I=MA(t);if(I){const M=window.MotionHandoffAnimation(I,w,Kt);M!==null&&(b.startTime=M,C=!0)}}R2(t,w);const R=d??t.shouldReduceMotion;_.start(Rx(w,_,x,R&&TA.has(w)?{type:!1}:b,t,C));const A=_.animation;A&&p.push(A)}if(o){const w=()=>Kt.update(()=>{o&&Nz(t,o)});p.length?Promise.all(p).then(w):w()}return p}function A2(t,e,n={}){var u;const r=nc(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(OA(t,r,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(d=0)=>{const{delayChildren:f=0,staggerChildren:p,staggerDirection:g}=s;return Fz(t,e,d,f,p,g,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[d,f]=l==="beforeChildren"?[i,o]:[o,i];return d().then(()=>f())}else return Promise.all([i(),o(n.delay)])}function Fz(t,e,n=0,r=0,s=0,i=1,o){const l=[];for(const u of t.variantChildren)u.notify("AnimationStart",e),l.push(A2(u,e,{...o,delay:n+(typeof r=="function"?0:r)+PA(t.variantChildren,u,r,s,i)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(l)}function Vz(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>A2(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=A2(t,e,n);else{const s=typeof e=="function"?nc(t,e,n.custom):e;r=Promise.all(OA(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const Hz={test:t=>t==="auto",parse:t=>t},LA=t=>e=>e.test(t),NA=[cd,Fe,Hi,yo,hH,fH,Hz],$k=t=>NA.find(LA(t));function zz(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||WR(t):!0}const Bz=new Set(["brightness","contrast","saturate","opacity"]);function Uz(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(xx)||[];if(!r)return t;const s=n.replace(r,"");let i=Bz.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const Zz=/\b([a-z-]*)\(.*?\)/gu,T2={...mi,getAnimatableNone:t=>{const e=t.match(Zz);return e?e.map(Uz).join(" "):t}},I2={...mi,getAnimatableNone:t=>{const e=mi.parse(t);return mi.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},jk={...cd,transform:Math.round},Wz={rotate:yo,pathRotation:yo,rotateX:yo,rotateY:yo,rotateZ:yo,scale:g0,scaleX:g0,scaleY:g0,scaleZ:g0,skew:yo,skewX:yo,skewY:yo,distance:Fe,translateX:Fe,translateY:Fe,translateZ:Fe,x:Fe,y:Fe,z:Fe,perspective:Fe,transformPerspective:Fe,opacity:ah,originX:kk,originY:kk,originZ:Fe},Um={borderWidth:Fe,borderTopWidth:Fe,borderRightWidth:Fe,borderBottomWidth:Fe,borderLeftWidth:Fe,borderRadius:Fe,borderTopLeftRadius:Fe,borderTopRightRadius:Fe,borderBottomRightRadius:Fe,borderBottomLeftRadius:Fe,width:Fe,maxWidth:Fe,height:Fe,maxHeight:Fe,top:Fe,right:Fe,bottom:Fe,left:Fe,inset:Fe,insetBlock:Fe,insetBlockStart:Fe,insetBlockEnd:Fe,insetInline:Fe,insetInlineStart:Fe,insetInlineEnd:Fe,padding:Fe,paddingTop:Fe,paddingRight:Fe,paddingBottom:Fe,paddingLeft:Fe,paddingBlock:Fe,paddingBlockStart:Fe,paddingBlockEnd:Fe,paddingInline:Fe,paddingInlineStart:Fe,paddingInlineEnd:Fe,margin:Fe,marginTop:Fe,marginRight:Fe,marginBottom:Fe,marginLeft:Fe,marginBlock:Fe,marginBlockStart:Fe,marginBlockEnd:Fe,marginInline:Fe,marginInlineStart:Fe,marginInlineEnd:Fe,fontSize:Fe,backgroundPositionX:Fe,backgroundPositionY:Fe,...Wz,zIndex:jk,fillOpacity:ah,strokeOpacity:ah,numOctaves:jk},qz={...Um,color:jn,backgroundColor:jn,outlineColor:jn,fill:jn,stroke:jn,borderColor:jn,borderTopColor:jn,borderRightColor:jn,borderBottomColor:jn,borderLeftColor:jn,filter:T2,WebkitFilter:T2,mask:I2,WebkitMask:I2},DA=t=>qz[t],Gz=new Set([T2,I2]);function $A(t,e){let n=DA(t);return Gz.has(n)||(n=mi),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Kz=new Set(["auto","none","0"]);function Yz(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!Kz.has(i)&&Gu(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=$A(n,s)}class Xz extends Cx{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 f=0;f<e.length;f++){let p=e[f];if(typeof p=="string"&&(p=p.trim(),wx(p))){const g=AA(p,n.current);g!==void 0&&(e[f]=g),f===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!TA.has(r)||e.length!==2)return;const[s,i]=e,o=$k(s),l=$k(i),u=Sk(s),d=Sk(i);if(u!==d&&Ra[r]){this.needsMeasurement=!0;return}if(o!==l)if(Mk(o)&&Mk(l))for(let f=0;f<e.length;f++){const p=e[f];typeof p=="string"&&(e[f]=parseFloat(p))}else Ra[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||zz(e[s]))&&r.push(s);r.length&&Yz(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=Ra[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&e.getValue(r,s).jump(s,!1)}measureEndState(){var l;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,o=r[i];r[i]=Ra[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([u,d])=>{e.getValue(u).set(d)}),this.resolveNoneKeyframes()}}const Ix=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function jA(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 M2=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function G0(t){return ZR(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Mx}=iA(queueMicrotask,!1),ci={x:!1,y:!1};function FA(){return ci.x||ci.y}function Qz(t){return t==="x"||t==="y"?ci[t]?null:(ci[t]=!0,()=>{ci[t]=!1}):ci.x||ci.y?null:(ci.x=ci.y=!0,()=>{ci.x=ci.y=!1})}function VA(t,e){const n=jA(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function Jz(t){return!(t.pointerType==="touch"||FA())}function eB(t,e,n={}){const[r,s,i]=VA(t,n);return r.forEach(o=>{let l=!1,u=!1,d;const f=()=>{o.removeEventListener("pointerleave",w)},p=x=>{d&&(d(x),d=void 0),f()},g=x=>{l=!1,window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",g),u&&(u=!1,p(x))},v=()=>{l=!0,window.addEventListener("pointerup",g,s),window.addEventListener("pointercancel",g,s)},w=x=>{if(x.pointerType!=="touch"){if(l){u=!0;return}p(x)}},_=x=>{if(!Jz(x))return;u=!1;const b=e(o,x);typeof b=="function"&&(d=b,o.addEventListener("pointerleave",w,s))};o.addEventListener("pointerenter",_,s),o.addEventListener("pointerdown",v,s)}),i}const HA=(t,e)=>e?t===e?!0:HA(t,e.parentElement):!1,Ox=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,tB=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function nB(t){return tB.has(t.tagName)||t.isContentEditable===!0}const rB=new Set(["INPUT","SELECT","TEXTAREA"]);function sB(t){return rB.has(t.tagName)||t.isContentEditable===!0}const K0=new WeakSet;function Fk(t){return e=>{e.key==="Enter"&&t(e)}}function Cy(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const iB=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=Fk(()=>{if(K0.has(n))return;Cy(n,"down");const s=Fk(()=>{Cy(n,"up")}),i=()=>Cy(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 Vk(t){return Ox(t)&&!FA()}const Hk=new WeakSet;function oB(t,e,n={}){const[r,s,i]=VA(t,n),o=l=>{const u=l.currentTarget;if(!Vk(l)||Hk.has(l))return;K0.add(u),n.stopPropagation&&Hk.add(l);const d=e(u,l),f={...s,capture:!0},p=(w,_)=>{window.removeEventListener("pointerup",g,f),window.removeEventListener("pointercancel",v,f),K0.has(u)&&K0.delete(u),Vk(w)&&typeof d=="function"&&d(w,{success:_})},g=w=>{p(w,u===window||u===document||n.useGlobalTarget||HA(u,w.target))},v=w=>{p(w,!1)};window.addEventListener("pointerup",g,f),window.addEventListener("pointercancel",v,f)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),G0(l)&&(l.addEventListener("focus",d=>iB(d,s)),!nB(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}function Lx(t){return ZR(t)&&"ownerSVGElement"in t}const Y0=new WeakMap;let ma;const zA=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:Lx(r)&&"getBBox"in r?r.getBBox()[e]:r[n],aB=zA("inline","width","offsetWidth"),lB=zA("block","height","offsetHeight");function cB({target:t,borderBoxSize:e}){var n;(n=Y0.get(t))==null||n.forEach(r=>{r(t,{get width(){return aB(t,e)},get height(){return lB(t,e)}})})}function uB(t){t.forEach(cB)}function dB(){typeof ResizeObserver>"u"||(ma=new ResizeObserver(uB))}function fB(t,e){ma||dB();const n=jA(t);return n.forEach(r=>{let s=Y0.get(r);s||(s=new Set,Y0.set(r,s)),s.add(e),ma==null||ma.observe(r)}),()=>{n.forEach(r=>{const s=Y0.get(r);s==null||s.delete(e),s!=null&&s.size||ma==null||ma.unobserve(r)})}}const X0=new Set;let gu;function hB(){gu=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};X0.forEach(e=>e(t))},window.addEventListener("resize",gu)}function pB(t){return X0.add(t),gu||hB(),()=>{X0.delete(t),!X0.size&&typeof gu=="function"&&(window.removeEventListener("resize",gu),gu=void 0)}}function zk(t,e){return typeof t=="function"?pB(t):fB(t,e)}function mB(t){return Lx(t)&&t.tagName==="svg"}const gB=[...NA,jn,mi],vB=t=>gB.find(LA(t)),Bk=()=>({translate:0,scale:1,origin:0,originPoint:0}),vu=()=>({x:Bk(),y:Bk()}),Uk=()=>({min:0,max:0}),qn=()=>({x:Uk(),y:Uk()}),yB=new WeakMap;function Ag(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function lh(t){return typeof t=="string"||Array.isArray(t)}const Nx=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Dx=["initial",...Nx];function Tg(t){return Ag(t.animate)||Dx.some(e=>lh(t[e]))}function BA(t){return!!(Tg(t)||t.variants)}function _B(t,e,n){for(const r in e){const s=e[r],i=n[r];if(hr(s))t.addValue(r,s);else if(hr(i))t.addValue(r,Ku(s,{owner:t}));else if(i!==s)if(t.hasValue(r)){const o=t.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=t.getStaticValue(r);t.addValue(r,Ku(o!==void 0?o:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const Zm={current:null},$x={current:!1},wB=typeof window<"u";function UA(){if($x.current=!0,!!wB)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Zm.current=t.matches;t.addEventListener("change",e),e()}else Zm.current=!1}const Zk=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Wm={};function ZA(t){Wm=t}function xB(){return Wm}class bB{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:o,visualState:l},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Cx,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const v=Lr.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,Kt.render(this.render,!1,!0))};const{latestValues:d,renderState:f}=l;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=f,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=u,this.blockInitialAnimation=!!o,this.isControllingVariants=Tg(n),this.isVariantNode=BA(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:p,...g}=this.scrapeMotionValuesFromProps(n,{},this);for(const v in g){const w=g[v];d[v]!==void 0&&hr(w)&&w.set(d[v])}}mount(e){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=e,yB.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:($x.current||UA(),this.shouldReduceMotion=Zm.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(),Ha(this.notifyUpdate),Ha(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&&CA.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:l,times:u,ease:d,duration:f}=n.accelerate,p=new kA({element:this.current,name:e,keyframes:l,times:u,ease:d,duration:_s(f)}),g=o(p);this.valueSubscriptions.set(e,()=>{g(),p.cancel()});return}const r=dd.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&Kt.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 Wm){const n=Wm[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):qn()}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<Zk.length;r++){const s=Zk[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=e[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=_B(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=Ku(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"&&(UR(r)||WR(r))?r=parseFloat(r):!vB(r)&&mi.test(n)&&(r=$A(e,n)),this.setBaseTarget(e,hr(r)?r.get():r)),hr(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Ax(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(r=o[e])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!hr(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 vx),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Mx.render(this.render)}}class WA extends bB{constructor(){super(...arguments),this.KeyframeResolver=Xz}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;hr(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Ya{constructor(e){this.isMounted=!1,this.node=e}update(){}}function qA({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function SB({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function kB(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 Py(t){return t===void 0||t===1}function O2({scale:t,scaleX:e,scaleY:n}){return!Py(t)||!Py(e)||!Py(n)}function $l(t){return O2(t)||GA(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function GA(t){return Wk(t.x)||Wk(t.y)}function Wk(t){return t&&t!=="0%"}function qm(t,e,n){const r=t-n,s=e*r;return n+s}function qk(t,e,n,r,s){return s!==void 0&&(t=qm(t,s,r)),qm(t,n,r)+e}function L2(t,e=0,n=1,r,s){t.min=qk(t.min,e,n,r,s),t.max=qk(t.max,e,n,r,s)}function KA(t,{x:e,y:n}){L2(t.x,e.translate,e.scale,e.originPoint),L2(t.y,n.translate,n.scale,n.originPoint)}const Gk=.999999999999,Kk=1.0000000000001;function EB(t,e,n,r=!1){var l;const s=n.length;if(!s)return;e.x=e.y=1;let i,o;for(let u=0;u<s;u++){i=n[u],o=i.projectionDelta;const{visualElement:d}=i.options;d&&d.props.style&&d.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(Ni(t.x,-i.scroll.offset.x),Ni(t.y,-i.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,KA(t,o)),r&&$l(i.latestValues)&&Q0(t,i.latestValues,(l=i.layout)==null?void 0:l.layoutBox))}e.x<Kk&&e.x>Gk&&(e.x=1),e.y<Kk&&e.y>Gk&&(e.y=1)}function Ni(t,e){t.min+=e,t.max+=e}function Yk(t,e,n,r,s=.5){const i=Gt(t.min,t.max,s);L2(t,e,n,i,r)}function Xk(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function Q0(t,e,n){const r=n??t;Yk(t.x,Xk(e.x,r.x),e.scaleX,e.scale,e.originX),Yk(t.y,Xk(e.y,r.y),e.scaleY,e.scale,e.originY)}function YA(t,e){return qA(kB(t.getBoundingClientRect(),e))}function CB(t,e,n){const r=YA(t,n),{scroll:s}=e;return s&&(Ni(r.x,s.offset.x),Ni(r.y,s.offset.y)),r}const PB={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},RB=ud.length;function AB(t,e,n){let r="",s=!0;for(let o=0;o<RB;o++){const l=ud[o],u=t[l];if(u===void 0)continue;let d=!0;if(typeof u=="number")d=u===(l.startsWith("scale")?1:0);else{const f=parseFloat(u);d=l.startsWith("scale")?f===1:f===0}if(!d||n){const f=M2(u,Um[l]);if(!d){s=!1;const p=PB[l]||l;r+=`${p}(${f}) `}n&&(e[l]=f)}}const i=t.pathRotation;return i&&(s=!1,r+=`rotate(${M2(i,Um.pathRotation)}) `),r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function jx(t,e,n){const{style:r,vars:s,transformOrigin:i}=t;let o=!1,l=!1;for(const u in e){const d=e[u];if(dd.has(u)){o=!0;continue}else if(aA(u)){s[u]=d;continue}else{const f=M2(d,Um[u]);u.startsWith("origin")?(l=!0,i[u]=f):r[u]=f}}if(e.transform||(o||n?r.transform=AB(e,t.transform,n):r.transform&&(r.transform="none")),l){const{originX:u="50%",originY:d="50%",originZ:f=0}=i;r.transformOrigin=`${u} ${d} ${f}`}}function XA(t,{style:e,vars:n},r,s){const i=t.style;let o;for(o in e)i[o]=e[o];s==null||s.applyProjectionStyles(i,r);for(o in n)i.setProperty(o,n[o])}function Qk(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const hf={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Fe.test(t))t=parseFloat(t);else return t;const n=Qk(t,e.target.x),r=Qk(t,e.target.y);return`${n}% ${r}%`}},TB={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=mi.parse(t);if(s.length>5)return r;const i=mi.createTransformer(t),o=typeof s[0]!="number"?1:0,l=n.x.scale*e.x,u=n.y.scale*e.y;s[0+o]/=l,s[1+o]/=u;const d=Gt(l,u,.5);return typeof s[2+o]=="number"&&(s[2+o]/=d),typeof s[3+o]=="number"&&(s[3+o]/=d),i(s)}},N2={borderRadius:{...hf,applyTo:[...Ix]},borderTopLeftRadius:hf,borderTopRightRadius:hf,borderBottomLeftRadius:hf,borderBottomRightRadius:hf,boxShadow:TB};function QA(t,{layout:e,layoutId:n}){return dd.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!N2[t]||t==="opacity")}function Fx(t,e,n){var o;const r=t.style,s=e==null?void 0:e.style,i={};if(!r)return i;for(const l in r)(hr(r[l])||s&&hr(s[l])||QA(l,t)||((o=n==null?void 0:n.getValue(l))==null?void 0:o.liveStyle)!==void 0)&&(i[l]=r[l]);return i}function IB(t){return window.getComputedStyle(t)}class MB extends WA{constructor(){super(...arguments),this.type="html",this.renderInstance=XA}mount(e){Pg(!!e.style),super.mount(e)}readValueFromInstance(e,n){var r;if(dd.has(n))return(r=this.projection)!=null&&r.isProjecting?x2(n):JH(e,n);{const s=IB(e),i=(aA(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return YA(e,n)}build(e,n,r){jx(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return Fx(e,n,r)}}const OB={offset:"stroke-dashoffset",array:"stroke-dasharray"},LB={offset:"strokeDashoffset",array:"strokeDasharray"};function NB(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?OB:LB;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const DB=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function JA(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...l},u,d,f){if(jx(t,l,d),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:g}=t;p.transform&&(g.transform=p.transform,delete p.transform),(g.transform||p.transformOrigin)&&(g.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),g.transform&&(g.transformBox=(f==null?void 0:f.transformBox)??"fill-box",delete p.transformBox);for(const v of DB)p[v]!==void 0&&(g[v]=p[v],delete p[v]);e!==void 0&&(p.x=e),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),s!==void 0&&NB(p,s,i,o,!1)}const eT=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"]),tT=t=>typeof t=="string"&&t.toLowerCase()==="svg";function $B(t,e,n,r){XA(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(eT.has(s)?s:Tx(s),e.attrs[s])}function nT(t,e,n){const r=Fx(t,e,n);for(const s in t)if(hr(t[s])||hr(e[s])){const i=ud.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class jB extends WA{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=qn}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(dd.has(n)){const r=DA(n);return r&&r.default||0}return n=eT.has(n)?n:Tx(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return nT(e,n,r)}build(e,n,r){JA(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){$B(e,n,r,s)}mount(e){this.isSVGTag=tT(e.tagName),super.mount(e)}}const FB=Dx.length;function rT(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?rT(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<FB;n++){const r=Dx[n],s=t.props[r];(lh(s)||s===!1)&&(e[r]=s)}return e}function sT(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 VB=[...Nx].reverse(),HB=Nx.length;function zB(t){return e=>Promise.all(e.map(({animation:n,options:r})=>Vz(t,n,r)))}function BB(t){let e=zB(t),n=Jk(),r=!0,s=!1;const i=d=>(f,p)=>{var v;const g=nc(t,p,d==="exit"?(v=t.presenceContext)==null?void 0:v.custom:void 0);if(g){const{transition:w,transitionEnd:_,...x}=g;f={...f,...x,..._}}return f};function o(d){e=d(t)}function l(d){const{props:f}=t,p=rT(t.parent)||{},g=[],v=new Set;let w={},_=1/0;for(let b=0;b<HB;b++){const E=VB[b],C=n[E],R=f[E]!==void 0?f[E]:p[E],A=lh(R),I=E===d?C.isActive:null;I===!1&&(_=b);let M=R===p[E]&&R!==f[E]&&A;if(M&&(r||s)&&t.manuallyAnimateOnMount&&(M=!1),C.protectedKeys={...w},!C.isActive&&I===null||!R&&!C.prevProp||Ag(R)||typeof R=="boolean")continue;if(E==="exit"&&C.isActive&&I!==!0){C.prevResolvedValues&&(w={...w,...C.prevResolvedValues});continue}const T=UB(C.prevProp,R);let L=T||E===d&&C.isActive&&!M&&A||b>_&&A,D=!1;const j=Array.isArray(R)?R:[R];let H=j.reduce(i(E),{});I===!1&&(H={});const{prevResolvedValues:Y={}}=C,U={...Y,...H},z=B=>{L=!0,v.has(B)&&(D=!0,v.delete(B)),C.needsAnimating[B]=!0;const ee=t.getValue(B);ee&&(ee.liveStyle=!1)};for(const B in U){const ee=H[B],W=Y[B];if(w.hasOwnProperty(B))continue;let N=!1;P2(ee)&&P2(W)?N=!sT(ee,W)||T:N=ee!==W,N?ee!=null?z(B):v.add(B):ee!==void 0&&v.has(B)?z(B):C.protectedKeys[B]=!0}C.prevProp=R,C.prevResolvedValues=H,C.isActive&&(w={...w,...H}),(r||s)&&t.blockInitialAnimation&&(L=!1);const Z=M&&T;L&&(!Z||D)&&g.push(...j.map(B=>{const ee={type:E};if(typeof B=="string"&&(r||s)&&!Z&&t.manuallyAnimateOnMount&&t.parent){const{parent:W}=t,N=nc(W,B);if(W.enteringChildren&&N){const{delayChildren:X}=N.transition||{};ee.delay=PA(W.enteringChildren,t,X)}}return{animation:B,options:ee}}))}if(v.size){const b={};if(typeof f.initial!="boolean"){const E=nc(t,Array.isArray(f.initial)?f.initial[0]:f.initial);E&&E.transition&&(b.transition=E.transition)}v.forEach(E=>{const C=t.getBaseTarget(E),R=t.getValue(E);R&&(R.liveStyle=!0),b[E]=C??null}),g.push({animation:b})}let x=!!g.length;return r&&(f.initial===!1||f.initial===f.animate)&&!t.manuallyAnimateOnMount&&(x=!1),r=!1,s=!1,x?e(g):Promise.resolve()}function u(d,f){var g;if(n[d].isActive===f)return Promise.resolve();(g=t.variantChildren)==null||g.forEach(v=>{var w;return(w=v.animationState)==null?void 0:w.setActive(d,f)}),n[d].isActive=f;const p=l(d);for(const v in n)n[v].protectedKeys={};return p}return{animateChanges:l,setActive:u,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Jk(),s=!0}}}function UB(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!sT(e,t):!1}function El(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Jk(){return{animate:El(!0),whileInView:El(),whileHover:El(),whileTap:El(),whileDrag:El(),whileFocus:El(),exit:El()}}function D2(t,e){t.min=e.min,t.max=e.max}function oi(t,e){D2(t.x,e.x),D2(t.y,e.y)}function eE(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const iT=1e-4,ZB=1-iT,WB=1+iT,oT=.01,qB=0-oT,GB=0+oT;function Nr(t){return t.max-t.min}function KB(t,e,n){return Math.abs(t-e)<=n}function tE(t,e,n,r=.5){t.origin=r,t.originPoint=Gt(e.min,e.max,t.origin),t.scale=Nr(n)/Nr(e),t.translate=Gt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=ZB&&t.scale<=WB||isNaN(t.scale))&&(t.scale=1),(t.translate>=qB&&t.translate<=GB||isNaN(t.translate))&&(t.translate=0)}function Hf(t,e,n,r){tE(t.x,e.x,n.x,r?r.originX:void 0),tE(t.y,e.y,n.y,r?r.originY:void 0)}function nE(t,e,n,r=0){const s=r?Gt(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+Nr(e)}function YB(t,e,n,r){nE(t.x,e.x,n.x,r==null?void 0:r.x),nE(t.y,e.y,n.y,r==null?void 0:r.y)}function rE(t,e,n,r=0){const s=r?Gt(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+Nr(e)}function Gm(t,e,n,r){rE(t.x,e.x,n.x,r==null?void 0:r.x),rE(t.y,e.y,n.y,r==null?void 0:r.y)}function sE(t,e,n,r,s){return t-=e,t=qm(t,1/n,r),s!==void 0&&(t=qm(t,1/s,r)),t}function XB(t,e=0,n=1,r=.5,s,i=t,o=t){if(Hi.test(e)&&(e=parseFloat(e),e=Gt(o.min,o.max,e/100)-o.min),typeof e!="number")return;let l=Gt(i.min,i.max,r);t===i&&(l-=e),t.min=sE(t.min,e,n,l,s),t.max=sE(t.max,e,n,l,s)}function iE(t,e,[n,r,s],i,o){XB(t,e[n],e[r],e[s],e.scale,i,o)}const QB=["x","scaleX","originX"],JB=["y","scaleY","originY"];function oE(t,e,n,r){iE(t.x,e,QB,n?n.x:void 0,r?r.x:void 0),iE(t.y,e,JB,n?n.y:void 0,r?r.y:void 0)}function aE(t){return t.translate===0&&t.scale===1}function aT(t){return aE(t.x)&&aE(t.y)}function lE(t,e){return t.min===e.min&&t.max===e.max}function eU(t,e){return lE(t.x,e.x)&&lE(t.y,e.y)}function cE(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function lT(t,e){return cE(t.x,e.x)&&cE(t.y,e.y)}function uE(t){return Nr(t.x)/Nr(t.y)}function dE(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Ti(t){return[t("x"),t("y")]}function tU(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:d,rotate:f,pathRotation:p,rotateX:g,rotateY:v,skewX:w,skewY:_}=n;d&&(r=`perspective(${d}px) ${r}`),f&&(r+=`rotate(${f}deg) `),p&&(r+=`rotate(${p}deg) `),g&&(r+=`rotateX(${g}deg) `),v&&(r+=`rotateY(${v}deg) `),w&&(r+=`skewX(${w}deg) `),_&&(r+=`skewY(${_}deg) `)}const l=t.x.scale*e.x,u=t.y.scale*e.y;return(l!==1||u!==1)&&(r+=`scale(${l}, ${u})`),r||"none"}const nU=Ix.length,fE=t=>typeof t=="string"?parseFloat(t):t,hE=t=>typeof t=="number"||Fe.test(t);function rU(t,e,n,r,s,i){s?(t.opacity=Gt(0,n.opacity??1,sU(r)),t.opacityExit=Gt(e.opacity??1,0,iU(r))):i&&(t.opacity=Gt(e.opacity??1,n.opacity??1,r));for(let o=0;o<nU;o++){const l=Ix[o];let u=pE(e,l),d=pE(n,l);if(u===void 0&&d===void 0)continue;u||(u=0),d||(d=0),u===0||d===0||hE(u)===hE(d)?(t[l]=Math.max(Gt(fE(u),fE(d),r),0),(Hi.test(d)||Hi.test(u))&&(t[l]+="%")):t[l]=d}(e.rotate||n.rotate)&&(t.rotate=Gt(e.rotate||0,n.rotate||0,r))}function pE(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const sU=cT(0,.5,tA),iU=cT(.5,.95,Ws);function cT(t,e,n){return r=>r<t?0:r>e?1:n(oh(t,e,r))}function oU(t,e,n){const r=hr(t)?t:Ku(t);return r.start(Rx("",r,e,n)),r.animation}function ch(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}const aU=(t,e)=>t.depth-e.depth;class lU{constructor(){this.children=[],this.isDirty=!1}add(e){gx(this.children,e),this.isDirty=!0}remove(e){Fm(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(aU),this.isDirty=!1,this.children.forEach(e)}}function cU(t,e){const n=Lr.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(Ha(r),t(i-e))};return Kt.setup(r,!0),()=>Ha(r)}function J0(t){return hr(t)?t.get():t}class uU{constructor(){this.members=[]}add(e){gx(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&&(Fm(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(Fm(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let r=this.members.indexOf(e)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(e,n){var s;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:o}=e.options;(i===void 0||i!==o)&&(e.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(s=e.root)!=null&&s.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,r,s,i,o;(r=(n=e.options).onExitComplete)==null||r.call(n),(o=(s=e.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||o.call(i)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const em={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ry=["","X","Y","Z"],dU=1e3;let fU=0;function Ay(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function uT(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=MA(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Kt,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&uT(r)}function dT({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=e==null?void 0:e()){this.id=fU++,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(mU),this.nodes.forEach(xU),this.nodes.forEach(bU),this.nodes.forEach(gU)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new lU)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new vx),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const u=this.eventHandlers.get(o);u&&u.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Lx(o)&&!mB(o),this.instance=o;const{layoutId:l,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(u||l)&&(this.isLayoutDirty=!0),t){let f,p=0;const g=()=>this.root.updateBlockedByResize=!1;Kt.read(()=>{p=window.innerWidth}),t(o,()=>{const v=window.innerWidth;v!==p&&(p=v,this.root.updateBlockedByResize=!0,f&&f(),f=cU(g,250),em.hasAnimatedSinceResize&&(em.hasAnimatedSinceResize=!1,this.nodes.forEach(vE)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:p,hasRelativeLayoutChanged:g,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||d.getDefaultTransition()||PU,{onLayoutAnimationStart:_,onLayoutAnimationComplete:x}=d.getProps(),b=!this.targetLayout||!lT(this.targetLayout,v),E=!p&&g;if(this.options.layoutRoot||this.resumeFrom||E||p&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const C={...Px(w,"layout"),onPlay:_,onComplete:x};(d.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C),this.setAnimationOrigin(f,E,C.path)}else p||vE(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ha(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(SU),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&uT(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f<this.path.length;f++){const p=this.path[f];p.shouldResetTransform=!0,(typeof p.latestValues.x=="string"||typeof p.latestValues.y=="string")&&(p.isLayoutDirty=!0),p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:l,layout:u}=this.options;if(l===void 0&&!u)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const u=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),u&&this.nodes.forEach(yU),this.nodes.forEach(mE);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(gE);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(_U),this.nodes.forEach(wU),this.nodes.forEach(hU),this.nodes.forEach(pU)):this.nodes.forEach(gE),this.clearAllSnapshots();const l=Lr.now();ur.delta=Ui(0,1e3/60,l-ur.timestamp),ur.timestamp=l,ur.isProcessing=!0,wy.update.process(ur),wy.preRender.process(ur),wy.render.process(ur),ur.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Mx.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(vU),this.sharedNodes.forEach(kU)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Kt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Kt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Nr(this.snapshot.measuredBox.x)&&!Nr(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let u=0;u<this.path.length;u++)this.path[u].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=qn()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l&&this.instance){const u=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:u,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!aT(this.projectionDelta),u=this.getTransformTemplate(),d=u?u(this.latestValues,""):void 0,f=d!==this.prevTransformTemplateValue;o&&this.instance&&(l||$l(this.latestValues)||f)&&(s(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let u=this.removeElementScroll(l);return o&&(u=this.removeTransform(u)),RU(u),{animationId:this.root.animationId,measuredBox:l,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:o}=this.options;if(!o)return qn();const l=o.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(AU))){const{scroll:f}=this.root;f&&(Ni(l.x,f.offset.x),Ni(l.y,f.offset.y))}return l}removeElementScroll(o){var u;const l=qn();if(oi(l,o),(u=this.scroll)!=null&&u.wasRoot)return l;for(let d=0;d<this.path.length;d++){const f=this.path[d],{scroll:p,options:g}=f;f!==this.root&&p&&g.layoutScroll&&(p.wasRoot&&oi(l,o),Ni(l.x,p.offset.x),Ni(l.y,p.offset.y))}return l}applyTransform(o,l=!1,u){var f,p;const d=u||qn();oi(d,o);for(let g=0;g<this.path.length;g++){const v=this.path[g];!l&&v.options.layoutScroll&&v.scroll&&v!==v.root&&(Ni(d.x,-v.scroll.offset.x),Ni(d.y,-v.scroll.offset.y)),$l(v.latestValues)&&Q0(d,v.latestValues,(f=v.layout)==null?void 0:f.layoutBox)}return $l(this.latestValues)&&Q0(d,this.latestValues,(p=this.layout)==null?void 0:p.layoutBox),d}removeTransform(o){var u;const l=qn();oi(l,o);for(let d=0;d<this.path.length;d++){const f=this.path[d];if(!$l(f.latestValues))continue;let p;f.instance&&(O2(f.latestValues)&&f.updateSnapshot(),p=qn(),oi(p,f.measurePageBox())),oE(l,f.latestValues,(u=f.snapshot)==null?void 0:u.layoutBox,p)}return $l(this.latestValues)&&oE(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==ur.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var v;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:p}=this.options;if(!this.layout||!(f||p))return;this.resolvedRelativeTargetAt=ur.timestamp;const g=this.getClosestProjectingParent();g&&this.linkedParentVersion!==g.layoutVersion&&!g.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&g&&g.layout?this.createRelativeTarget(g,this.layout.layoutBox,g.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=qn(),this.targetWithTransforms=qn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),YB(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):oi(this.target,this.layout.layoutBox),KA(this.target,this.targetDelta)):oi(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?this.createRelativeTarget(g,this.target,g.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||O2(this.parent.latestValues)||GA(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,l,u){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=qn(),this.relativeTargetOrigin=qn(),Gm(this.relativeTargetOrigin,l,u,this.options.layoutAnchor||void 0),oi(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var w;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let u=!0;if((this.isProjectionDirty||(w=this.parent)!=null&&w.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===ur.timestamp&&(u=!1),u)return;const{layout:d,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||f))return;oi(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,g=this.treeScale.y;EB(this.layoutCorrected,this.treeScale,this.path,l),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=qn());const{target:v}=o;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(eE(this.prevProjectionDelta.x,this.projectionDelta.x),eE(this.prevProjectionDelta.y,this.projectionDelta.y)),Hf(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==g||!dE(this.projectionDelta.x,this.prevProjectionDelta.x)||!dE(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),o){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=vu(),this.projectionDelta=vu(),this.projectionDeltaWithTransform=vu()}setAnimationOrigin(o,l=!1,u){const d=this.snapshot,f=d?d.latestValues:{},p={...this.latestValues},g=vu();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const v=qn(),w=d?d.source:void 0,_=this.layout?this.layout.source:void 0,x=w!==_,b=this.getStack(),E=!b||b.members.length<=1,C=!!(x&&!E&&this.options.crossfade===!0&&!this.path.some(CU));this.animationProgress=0;let R;const A=u==null?void 0:u.interpolateProjection(o);this.mixTargetDelta=I=>{const M=I/1e3,T=A==null?void 0:A(M);T?(g.x.translate=T.x,g.x.scale=Gt(o.x.scale,1,M),g.x.origin=o.x.origin,g.x.originPoint=o.x.originPoint,g.y.translate=T.y,g.y.scale=Gt(o.y.scale,1,M),g.y.origin=o.y.origin,g.y.originPoint=o.y.originPoint):(yE(g.x,o.x,M),yE(g.y,o.y,M)),this.setTargetDelta(g),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Gm(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),EU(this.relativeTarget,this.relativeTargetOrigin,v,M),R&&eU(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=qn()),oi(R,this.relativeTarget)),x&&(this.animationValues=p,rU(p,f,this.latestValues,M,C,E)),T&&T.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=T.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=M},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,u,d;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(d=(u=this.resumingFrom)==null?void 0:u.currentAnimation)==null||d.stop(),this.pendingAnimation&&(Ha(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Kt.update(()=>{em.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ku(0)),this.motionValue.jump(0,!1),this.currentAnimation=oU(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:f=>{this.mixTargetDelta(f),o.onUpdate&&o.onUpdate(f)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(dU),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:u,layout:d,latestValues:f}=o;if(!(!l||!u||!d)){if(this!==o&&this.layout&&d&&fT(this.options.animationType,this.layout.layoutBox,d.layoutBox)){u=this.target||qn();const p=Nr(this.layout.layoutBox.x);u.x.min=o.target.x.min,u.x.max=u.x.min+p;const g=Nr(this.layout.layoutBox.y);u.y.min=o.target.y.min,u.y.max=u.y.min+g}oi(l,u),Q0(l,f),Hf(this.projectionDeltaWithTransform,this.layoutCorrected,l,f)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new uU),this.sharedNodes.get(o).add(l);const d=l.options.initialPromotionConfig;l.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var l;const{layoutId:o}=this.options;return o?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:o}=this.options;return o?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:u}={}){const d=this.getStack();d&&d.promote(this,u),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:u}=o;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(l=!0),!l)return;const d={};u.z&&Ay("z",o,d,this.animationValues);for(let f=0;f<Ry.length;f++)Ay(`rotate${Ry[f]}`,o,d,this.animationValues),Ay(`skew${Ry[f]}`,o,d,this.animationValues);o.render();for(const f in d)o.setStaticValue(f,d[f]),this.animationValues&&(this.animationValues[f]=d[f]);o.scheduleRender()}applyProjectionStyles(o,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=J0(l==null?void 0:l.pointerEvents)||"",o.transform=u?u(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=J0(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!$l(this.latestValues)&&(o.transform=u?u({},""):"none",this.hasProjected=!1);return}o.visibility="";const f=d.animationValues||d.latestValues;this.applyTransformsToTarget();let p=tU(this.projectionDeltaWithTransform,this.treeScale,f);u&&(p=u(f,p)),o.transform=p;const{x:g,y:v}=this.projectionDelta;o.transformOrigin=`${g.origin*100}% ${v.origin*100}% 0`,d.animationValues?o.opacity=d===this?f.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:o.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const w in N2){if(f[w]===void 0)continue;const{correct:_,applyTo:x,isCSSVariable:b}=N2[w],E=p==="none"?f[w]:_(f[w],d);if(x){const C=x.length;for(let R=0;R<C;R++)o[x[R]]=E}else b?this.options.visualElement.renderState.vars[w]=E:o[w]=E}this.options.layoutId&&(o.pointerEvents=d===this?J0(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(mE),this.root.sharedNodes.clear()}}}function hU(t){t.updateLayout()}function pU(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=t.layout,{animationType:i}=t.options,o=e.source!==t.layout.source;if(i==="size")Ti(p=>{const g=o?e.measuredBox[p]:e.layoutBox[p],v=Nr(g);g.min=r[p].min,g.max=g.min+v});else if(i==="x"||i==="y"){const p=i==="x"?"y":"x";D2(o?e.measuredBox[p]:e.layoutBox[p],r[p])}else fT(i,e.layoutBox,r)&&Ti(p=>{const g=o?e.measuredBox[p]:e.layoutBox[p],v=Nr(r[p]);g.max=g.min+v,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[p].max=t.relativeTarget[p].min+v)});const l=vu();Hf(l,r,e.layoutBox);const u=vu();o?Hf(u,t.applyTransform(s,!0),e.measuredBox):Hf(u,r,e.layoutBox);const d=!aT(l);let f=!1;if(!t.resumeFrom){const p=t.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:g,layout:v}=p;if(g&&v){const w=t.options.layoutAnchor||void 0,_=qn();Gm(_,e.layoutBox,g.layoutBox,w);const x=qn();Gm(x,r,v.layoutBox,w),lT(_,x)||(f=!0),p.options.layoutRoot&&(t.relativeTarget=x,t.relativeTargetOrigin=_,t.relativeParent=p)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:u,layoutDelta:l,hasLayoutChanged:d,hasRelativeLayoutChanged:f})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function mU(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 gU(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function vU(t){t.clearSnapshot()}function mE(t){t.clearMeasurements()}function yU(t){t.isLayoutDirty=!0,t.updateLayout()}function gE(t){t.isLayoutDirty=!1}function _U(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function wU(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function vE(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function xU(t){t.resolveTargetDelta()}function bU(t){t.calcProjection()}function SU(t){t.resetSkewAndRotation()}function kU(t){t.removeLeadSnapshot()}function yE(t,e,n){t.translate=Gt(e.translate,0,n),t.scale=Gt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function _E(t,e,n,r){t.min=Gt(e.min,n.min,r),t.max=Gt(e.max,n.max,r)}function EU(t,e,n,r){_E(t.x,e.x,n.x,r),_E(t.y,e.y,n.y,r)}function CU(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const PU={duration:.45,ease:[.4,0,.1,1]},wE=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),xE=wE("applewebkit/")&&!wE("chrome/")?Math.round:Ws;function bE(t){t.min=xE(t.min),t.max=xE(t.max)}function RU(t){bE(t.x),bE(t.y)}function fT(t,e,n){return t==="position"||t==="preserve-aspect"&&!KB(uE(e),uE(n),.2)}function AU(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const TU=dT({attachResizeListener:(t,e)=>ch(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}),Ty={current:void 0},hT=dT({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Ty.current){const t=new TU({});t.mount(window),t.setOptions({layoutScroll:!0}),Ty.current=t}return Ty.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Vx=m.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function SE(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function IU(...t){return e=>{let n=!1;const r=t.map(s=>{const i=SE(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():SE(t[s],null)}}}}function MU(...t){return m.useCallback(IU(...t),t)}class OU extends m.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(G0(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=G0(r)&&r.offsetWidth||0,i=G0(r)&&r.offsetHeight||0,o=getComputedStyle(n),l=this.props.sizeRef.current;l.height=parseFloat(o.height),l.width=parseFloat(o.width),l.top=n.offsetTop,l.left=n.offsetLeft,l.right=s-l.width-l.left,l.bottom=i-l.height-l.top,l.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function LU({children:t,isPresent:e,anchorX:n,anchorY:r,root:s,pop:i}){var g;const o=m.useId(),l=m.useRef(null),u=m.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:d}=m.useContext(Vx),f=i!==!1?((g=t.props)==null?void 0:g.ref)??(t==null?void 0:t.ref):void 0,p=MU(l,f);return m.useInsertionEffect(()=>{const{width:v,height:w,top:_,left:x,right:b,bottom:E,direction:C}=u.current;if(e||i===!1||!l.current||!v||!w)return;const R=C==="rtl",A=n==="left"?R?`right: ${b}`:`left: ${x}`:R?`left: ${x}`:`right: ${b}`,I=r==="bottom"?`bottom: ${E}`:`top: ${_}`;l.current.dataset.motionPopId=o;const M=document.createElement("style");d&&(M.nonce=d);const T=s??document.head;return T.appendChild(M),M.sheet&&M.sheet.insertRule(`
|
|
64
|
-
[data-motion-pop-id="${o}"] {
|
|
65
|
-
position: absolute !important;
|
|
66
|
-
width: ${v}px !important;
|
|
67
|
-
height: ${w}px !important;
|
|
68
|
-
${A}px !important;
|
|
69
|
-
${I}px !important;
|
|
70
|
-
}
|
|
71
|
-
`),()=>{var L;(L=l.current)==null||L.removeAttribute("data-motion-pop-id"),T.contains(M)&&T.removeChild(M)}},[e]),S.jsx(OU,{isPresent:e,childRef:l,sizeRef:u,pop:i,children:i===!1?t:m.cloneElement(t,{ref:p})})}const NU=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:l,anchorY:u,root:d})=>{const f=px(DU),p=m.useId(),g=m.useRef(n),v=m.useRef(r);mx(()=>{g.current=n,v.current=r});let w=!0,_=m.useMemo(()=>(w=!1,{id:p,initial:e,isPresent:n,custom:s,onExitComplete:x=>{f.set(x,!0);for(const b of f.values())if(!b)return;r&&r()},register:x=>(f.set(x,!1),()=>{var b;f.delete(x),!g.current&&!f.size&&((b=v.current)==null||b.call(v))})}),[n,f,r]);return i&&w&&(_={..._}),m.useMemo(()=>{f.forEach((x,b)=>f.set(b,!1))},[n]),m.useEffect(()=>{!n&&!f.size&&r&&r()},[n]),t=S.jsx(LU,{pop:o==="popLayout",isPresent:n,anchorX:l,anchorY:u,root:d,children:t}),S.jsx(Cg.Provider,{value:_,children:t})};function DU(){return new Map}function pT(t=!0){const e=m.useContext(Cg);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=e,i=m.useId();m.useEffect(()=>{if(t)return s(i)},[t]);const o=m.useCallback(()=>t&&r&&r(i),[i,r,t]);return!n&&r?[!1,o]:[!0]}const v0=t=>t.key||"";function kE(t){const e=[];return m.Children.forEach(t,n=>{m.isValidElement(n)&&e.push(n)}),e}const ws=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:l="left",anchorY:u="top",root:d})=>{const[f,p]=pT(o),g=m.useMemo(()=>kE(t),[t]),v=o&&!f?[]:g.map(v0),w=m.useRef(!0),_=m.useRef(g),x=px(()=>new Map),b=m.useRef(new Set),[E,C]=m.useState(g),[R,A]=m.useState(g);mx(()=>{w.current=!1,_.current=g;for(let T=0;T<R.length;T++){const L=v0(R[T]);v.includes(L)?(x.delete(L),b.current.delete(L)):x.get(L)!==!0&&x.set(L,!1)}},[R,v.length,v.join("-")]);const I=[];if(g!==E){let T=[...g];for(let L=0;L<R.length;L++){const D=R[L],j=v0(D);v.includes(j)||(T.splice(L,0,D),I.push(D))}return i==="wait"&&I.length&&(T=I),A(kE(T)),C(g),null}const{forceRender:M}=m.useContext(hx);return S.jsx(S.Fragment,{children:R.map(T=>{const L=v0(T),D=o&&!f?!1:g===R||v.includes(L),j=()=>{if(b.current.has(L))return;if(x.has(L))b.current.add(L),x.set(L,!0);else return;let H=!0;x.forEach(Y=>{Y||(H=!1)}),H&&(M==null||M(),A(_.current),o&&(p==null||p()),r&&r())};return S.jsx(NU,{isPresent:D,initial:!w.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:d,onExitComplete:D?void 0:j,anchorX:l,anchorY:u,children:T},L)})})},mT=m.createContext({strict:!1}),EE={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 CE=!1;function $U(){if(CE)return;const t={};for(const e in EE)t[e]={isEnabled:n=>EE[e].some(r=>!!n[r])};ZA(t),CE=!0}function gT(){return $U(),xB()}function jU(t){const e=gT();for(const n in t)e[n]={...e[n],...t[n]};ZA(e)}const FU=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 Km(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||FU.has(t)}let vT=t=>!Km(t);function VU(t){typeof t=="function"&&(vT=e=>e.startsWith("on")?!Km(e):t(e))}try{VU(require("@emotion/is-prop-valid").default)}catch{}function HU(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||hr(t[s])||(vT(s)||n===!0&&Km(s)||!e&&!Km(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const Ig=m.createContext({});function zU(t,e){if(Tg(t)){const{initial:n,animate:r}=t;return{initial:n===!1||lh(n)?n:void 0,animate:lh(r)?r:void 0}}return t.inherit!==!1?e:{}}function BU(t){const{initial:e,animate:n}=zU(t,m.useContext(Ig));return m.useMemo(()=>({initial:e,animate:n}),[PE(e),PE(n)])}function PE(t){return Array.isArray(t)?t.join(" "):t}const Hx=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function yT(t,e,n){for(const r in e)!hr(e[r])&&!QA(r,n)&&(t[r]=e[r])}function UU({transformTemplate:t},e){return m.useMemo(()=>{const n=Hx();return jx(n,e,t),Object.assign({},n.vars,n.style)},[e])}function ZU(t,e){const n=t.style||{},r={};return yT(r,n,t),Object.assign(r,UU(t,e)),r}function WU(t,e){const n={},r=ZU(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 _T=()=>({...Hx(),attrs:{}});function qU(t,e,n,r){const s=m.useMemo(()=>{const i=_T();return JA(i,e,tT(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};yT(i,t.style,t),s.style={...i,...s.style}}return s}const GU=["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 zx(t){return typeof t!="string"||t.includes("-")?!1:!!(GU.indexOf(t)>-1||/[A-Z]/u.test(t))}function KU(t,e,n,{latestValues:r},s,i=!1,o){const u=(o??zx(t)?qU:WU)(e,r,s,t),d=HU(e,typeof t=="string",i),f=t!==m.Fragment?{...d,...u,ref:n}:{},{children:p}=e,g=m.useMemo(()=>hr(p)?p.get():p,[p]);return m.createElement(t,{...f,children:g})}function YU({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:XU(n,r,s,t),renderState:e()}}function XU(t,e,n,r){const s={},i=r(t,{});for(const g in i)s[g]=J0(i[g]);let{initial:o,animate:l}=t;const u=Tg(t),d=BA(t);e&&d&&!u&&t.inherit!==!1&&(o===void 0&&(o=e.initial),l===void 0&&(l=e.animate));let f=n?n.initial===!1:!1;f=f||o===!1;const p=f?l:o;if(p&&typeof p!="boolean"&&!Ag(p)){const g=Array.isArray(p)?p:[p];for(let v=0;v<g.length;v++){const w=Ax(t,g[v]);if(w){const{transitionEnd:_,transition:x,...b}=w;for(const E in b){let C=b[E];if(Array.isArray(C)){const R=f?C.length-1:0;C=C[R]}C!==null&&(s[E]=C)}for(const E in _)s[E]=_[E]}}}return s}const wT=t=>(e,n)=>{const r=m.useContext(Ig),s=m.useContext(Cg),i=()=>YU(t,e,r,s);return n?i():px(i)},QU=wT({scrapeMotionValuesFromProps:Fx,createRenderState:Hx}),JU=wT({scrapeMotionValuesFromProps:nT,createRenderState:_T}),eZ=Symbol.for("motionComponentSymbol");function tZ(t,e,n){const r=m.useRef(n);m.useInsertionEffect(()=>{r.current=n});const s=m.useRef(null);return m.useCallback(i=>{var l;i&&((l=t.onMount)==null||l.call(t,i)),e&&(i?e.mount(i):e.unmount());const o=r.current;if(typeof o=="function")if(i){const u=o(i);typeof u=="function"&&(s.current=u)}else s.current?(s.current(),s.current=null):o(i);else o&&(o.current=i)},[e])}const xT=m.createContext({});function lu(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function nZ(t,e,n,r,s,i){var C,R;const{visualElement:o}=m.useContext(Ig),l=m.useContext(mT),u=m.useContext(Cg),d=m.useContext(Vx),f=d.reducedMotion,p=d.skipAnimations,g=m.useRef(null),v=m.useRef(!1);r=r||l.renderer,!g.current&&r&&(g.current=r(t,{visualState:e,parent:o,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:f,skipAnimations:p,isSVG:i}),v.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const w=g.current,_=m.useContext(xT);w&&!w.projection&&s&&(w.type==="html"||w.type==="svg")&&rZ(g.current,n,s,_);const x=m.useRef(!1);m.useInsertionEffect(()=>{w&&x.current&&w.update(n,u)});const b=n[IA],E=m.useRef(!!b&&typeof window<"u"&&!((C=window.MotionHandoffIsComplete)!=null&&C.call(window,b))&&((R=window.MotionHasOptimisedAnimation)==null?void 0:R.call(window,b)));return mx(()=>{v.current=!0,w&&(x.current=!0,window.MotionIsMounted=!0,w.updateFeatures(),w.scheduleRenderMicrotask(),E.current&&w.animationState&&w.animationState.animateChanges())}),m.useEffect(()=>{w&&(!E.current&&w.animationState&&w.animationState.animateChanges(),E.current&&(queueMicrotask(()=>{var A;(A=window.MotionHandoffMarkAsComplete)==null||A.call(window,b)}),E.current=!1),w.enteringChildren=void 0)}),w}function rZ(t,e,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:l,layoutScroll:u,layoutRoot:d,layoutAnchor:f,layoutCrossfade:p}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:bT(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||l&&lu(l),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:u,layoutRoot:d,layoutAnchor:f})}function bT(t){if(t)return t.options.allowProjection!==!1?t.projection:bT(t.parent)}function Iy(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&jU(r);const i=n?n==="svg":zx(t),o=i?JU:QU;function l(d,f){let p;const g={...m.useContext(Vx),...d,layoutId:sZ(d)},{isStatic:v}=g,w=BU(d),_=o(d,v);if(!v&&typeof window<"u"){iZ();const x=oZ(g);p=x.MeasureLayout,w.visualElement=nZ(t,_,g,s,x.ProjectionNode,i)}return S.jsxs(Ig.Provider,{value:w,children:[p&&w.visualElement?S.jsx(p,{visualElement:w.visualElement,...g}):null,KU(t,d,tZ(_,w.visualElement,f),_,v,e,i)]})}l.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const u=m.forwardRef(l);return u[eZ]=t,u}function sZ({layoutId:t}){const e=m.useContext(hx).id;return e&&t!==void 0?e+"-"+t:t}function iZ(t,e){m.useContext(mT).strict}function oZ(t){const e=gT(),{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 aZ(t,e){if(typeof Proxy>"u")return Iy;const n=new Map,r=(i,o)=>Iy(i,o,t,e),s=(i,o)=>r(i,o);return new Proxy(s,{get:(i,o)=>o==="create"?r:(n.has(o)||n.set(o,Iy(o,void 0,t,e)),n.get(o))})}const lZ=(t,e)=>e.isSVG??zx(t)?new jB(e):new MB(e,{allowProjection:t!==m.Fragment});class cZ extends Ya{constructor(e){super(e),e.animationState||(e.animationState=BB(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Ag(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 uZ=0;class dZ extends Ya{constructor(){super(...arguments),this.id=uZ++,this.isExitComplete=!1}update(){var i;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;if(e&&r===!1){if(this.isExitComplete){const{initial:o,custom:l}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){const u=nc(this.node,o,l);if(u){const{transition:d,transitionEnd:f,...p}=u;for(const g in p)(i=this.node.getValue(g))==null||i.jump(p[g])}}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 fZ={animation:{Feature:cZ},exit:{Feature:dZ}};function Bh(t){return{point:{x:t.pageX,y:t.pageY}}}const hZ=t=>e=>Ox(e)&&t(e,Bh(e));function zf(t,e,n,r){return ch(t,e,hZ(n),r)}const ST=({current:t})=>t?t.ownerDocument.defaultView:null,RE=(t,e)=>Math.abs(t-e);function pZ(t,e){const n=RE(t.x,e.x),r=RE(t.y,e.y);return Math.sqrt(n**2+r**2)}const AE=new Set(["auto","scroll"]);class kT{constructor(e,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=w=>{this.handleScroll(w.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=y0(this.lastRawMoveEventInfo,this.transformPagePoint));const w=My(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,x=pZ(w.offset,{x:0,y:0})>=this.distanceThreshold;if(!_&&!x)return;const{point:b}=w,{timestamp:E}=ur;this.history.push({...b,timestamp:E});const{onStart:C,onMove:R}=this.handlers;_||(C&&C(this.lastMoveEvent,w),this.startEvent=this.lastMoveEvent),R&&R(this.lastMoveEvent,w)},this.handlePointerMove=(w,_)=>{this.lastMoveEvent=w,this.lastRawMoveEventInfo=_,this.lastMoveEventInfo=y0(_,this.transformPagePoint),Kt.update(this.updatePoint,!0)},this.handlePointerUp=(w,_)=>{this.end();const{onEnd:x,onSessionEnd:b,resumeAnimation:E}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const C=My(w.type==="pointercancel"?this.lastMoveEventInfo:y0(_,this.transformPagePoint),this.history);this.startEvent&&x&&x(w,C),b&&b(w,C)},!Ox(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const u=Bh(e),d=y0(u,this.transformPagePoint),{point:f}=d,{timestamp:p}=ur;this.history=[{...f,timestamp:p}];const{onSessionStart:g}=n;g&&g(e,My(d,this.history));const v={passive:!0,capture:!0};this.removeListeners=Vh(zf(this.contextWindow,"pointermove",this.handlePointerMove,v),zf(this.contextWindow,"pointerup",this.handlePointerUp,v),zf(this.contextWindow,"pointercancel",this.handlePointerUp,v)),l&&this.startScrollTracking(l)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(AE.has(r.overflowX)||AE.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),Kt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ha(this.updatePoint)}}function y0(t,e){return e?{point:e(t.point)}:t}function TE(t,e){return{x:t.x-e.x,y:t.y-e.y}}function My({point:t},e){return{point:t,delta:TE(t,ET(e)),offset:TE(t,mZ(e)),velocity:gZ(e,.1)}}function mZ(t){return t[0]}function ET(t){return t[t.length-1]}function gZ(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=ET(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>_s(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>_s(e)*2&&(r=t[1]);const i=zs(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function vZ(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?Gt(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?Gt(n,t,r.max):Math.min(t,n)),t}function IE(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function yZ(t,{top:e,left:n,bottom:r,right:s}){return{x:IE(t.x,n,s),y:IE(t.y,e,r)}}function ME(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 _Z(t,e){return{x:ME(t.x,e.x),y:ME(t.y,e.y)}}function wZ(t,e){let n=.5;const r=Nr(t),s=Nr(e);return s>r?n=oh(e.min,e.max-r,t.min):r>s&&(n=oh(t.min,t.max-s,e.min)),Ui(0,1,n)}function xZ(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 $2=.35;function bZ(t=$2){return t===!1?t=0:t===!0&&(t=$2),{x:OE(t,"left","right"),y:OE(t,"top","bottom")}}function OE(t,e,n){return{min:LE(t,e),max:LE(t,n)}}function LE(t,e){return typeof t=="number"?t:t[e]||0}const SZ=new WeakMap;class kZ{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=qn(),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(Bh(p).point),this.stopAnimation()},o=(p,g)=>{const{drag:v,dragPropagation:w,onDragStart:_}=this.getProps();if(v&&!w&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Qz(v),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=g,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ti(b=>{let E=this.getAxisMotionValue(b).get()||0;if(Hi.test(E)){const{projection:C}=this.visualElement;if(C&&C.layout){const R=C.layout.layoutBox[b];R&&(E=Nr(R)*(parseFloat(E)/100))}}this.originPoint[b]=E}),_&&Kt.update(()=>_(p,g),!1,!0),R2(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},l=(p,g)=>{this.latestPointerEvent=p,this.latestPanInfo=g;const{dragPropagation:v,dragDirectionLock:w,onDirectionLock:_,onDrag:x}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:b}=g;if(w&&this.currentDirection===null){this.currentDirection=CZ(b),this.currentDirection!==null&&_&&_(this.currentDirection);return}this.updateAxis("x",g.point,b),this.updateAxis("y",g.point,b),this.visualElement.render(),x&&Kt.update(()=>x(p,g),!1,!0)},u=(p,g)=>{this.latestPointerEvent=p,this.latestPanInfo=g,this.stop(p,g),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:f}=this.getProps();this.panSession=new kT(e,{onSessionStart:i,onStart:o,onMove:l,onSessionEnd:u,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,distanceThreshold:r,contextWindow:ST(this.visualElement),element:this.visualElement.current})}stop(e,n){const r=e||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&Kt.postRender(()=>l(r,s))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,r){const{drag:s}=this.getProps();if(!r||!_0(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=vZ(o,this.constraints[e],this.elastic[e])),i.set(o)}resolveConstraints(){var i;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;e&&lu(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=yZ(r.layoutBox,e):this.constraints=!1,this.elastic=bZ(n),s!==this.constraints&&!lu(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Ti(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=xZ(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!lu(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=CB(r,s.root,this.visualElement.getTransformPagePoint());let o=_Z(s.layout.layoutBox,i);if(n){const l=n(SB(o));this.hasMutatedConstraints=!!l,l&&(o=qA(l))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),u=this.constraints||{},d=Ti(f=>{if(!_0(f,n,this.currentDirection))return;let p=u&&u[f]||{};(o===!0||o===f)&&(p={min:0,max:0});const g=s?200:1e6,v=s?40:1e7,w={type:"inertia",velocity:r?e[f]:0,bounceStiffness:g,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...i,...p};return this.startAxisValueAnimation(f,w)});return Promise.all(d).then(l)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return R2(this.visualElement,e),r.start(Rx(e,r,0,n,this.visualElement,!1))}stopAnimation(){Ti(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){Ti(n=>{const{drag:r}=this.getProps();if(!_0(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[n],u=i.get()||0;i.set(e[n]-Gt(o,l,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!lu(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Ti(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const u=l.get();s[o]=wZ({min:u,max:u},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Ti(o=>{if(!_0(o,e,null))return;const l=this.getAxisMotionValue(o),{min:u,max:d}=this.constraints[o];l.set(Gt(u,d,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;SZ.set(this.visualElement,this);const e=this.visualElement.current,n=zf(e,"pointerdown",d=>{const{drag:f,dragListener:p=!0}=this.getProps(),g=d.target,v=g!==e&&sB(g);f&&p&&!v&&this.start(d)});let r;const s=()=>{const{dragConstraints:d}=this.getProps();lu(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=EZ(e,d.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Kt.read(s);const l=ch(window,"resize",()=>this.scalePositionWithinConstraints()),u=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:f})=>{this.isDragging&&f&&(Ti(p=>{const g=this.getAxisMotionValue(p);g&&(this.originPoint[p]+=d[p].translate,g.set(g.get()+d[p].translate))}),this.visualElement.render())}));return()=>{l(),n(),o(),u&&u(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=$2,dragMomentum:l=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:l}}}function NE(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function EZ(t,e,n){const r=zk(t,NE(n)),s=zk(e,NE(n));return()=>{r(),s()}}function _0(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function CZ(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class PZ extends Ya{constructor(e){super(e),this.removeGroupControls=Ws,this.removeListeners=Ws,this.controls=new kZ(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ws}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 Oy=t=>(e,n)=>{t&&Kt.update(()=>t(e,n),!1,!0)};class RZ extends Ya{constructor(){super(...arguments),this.removePointerDownListener=Ws}onPointerDown(e){this.session=new kT(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ST(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Oy(e),onStart:Oy(n),onMove:Oy(r),onEnd:(i,o)=>{delete this.session,s&&Kt.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=zf(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 Ly=!1;class AZ extends m.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),Ly&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),em.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),Ly=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||Kt.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),Mx.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;Ly=!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 CT(t){const[e,n]=pT(),r=m.useContext(hx);return S.jsx(AZ,{...t,layoutGroup:r,switchLayoutGroup:m.useContext(xT),isPresent:e,safeToRemove:n})}const TZ={pan:{Feature:RZ},drag:{Feature:PZ,ProjectionNode:hT,MeasureLayout:CT}};function DE(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&&Kt.postRender(()=>i(e,Bh(e)))}class IZ extends Ya{mount(){const{current:e}=this.node;e&&(this.unmount=eB(e,(n,r)=>(DE(this.node,r,"Start"),s=>DE(this.node,s,"End"))))}unmount(){}}class MZ extends Ya{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=Vh(ch(this.node.current,"focus",()=>this.onFocus()),ch(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function $E(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&&Kt.postRender(()=>i(e,Bh(e)))}class OZ extends Ya{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=oB(e,(s,i)=>($E(this.node,i,"Start"),(o,{success:l})=>$E(this.node,o,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const j2=new WeakMap,Ny=new WeakMap,LZ=t=>{const e=j2.get(t.target);e&&e(t)},NZ=t=>{t.forEach(LZ)};function DZ({root:t,...e}){const n=t||document;Ny.has(n)||Ny.set(n,{});const r=Ny.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(NZ,{root:t,...e})),r[s]}function $Z(t,e,n){const r=DZ(e);return j2.set(t,n),r.observe(t),()=>{j2.delete(t),r.unobserve(t)}}const jZ={some:0,all:1};class FZ extends Ya{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var u;(u=this.stopObserver)==null||u.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=e,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:jZ[s]},l=d=>{const{isIntersecting:f}=d;if(this.isInView===f||(this.isInView=f,i&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:p,onViewportLeave:g}=this.node.getProps(),v=f?p:g;v&&v(d)};this.stopObserver=$Z(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(VZ(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function VZ({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const HZ={inView:{Feature:FZ},tap:{Feature:OZ},focus:{Feature:MZ},hover:{Feature:IZ}},zZ={layout:{ProjectionNode:hT,MeasureLayout:CT}},BZ={...fZ,...HZ,...TZ,...zZ},Ao=aZ(BZ,lZ);function UZ(){!$x.current&&UA();const[t]=m.useState(Zm.current);return t}const gi=Ao;var Uh=$R();const ZZ=_g(Uh);function WZ(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 qZ=t=>{switch(t){case"success":return YZ;case"info":return QZ;case"warning":return XZ;case"error":return JZ;default:return null}},GZ=Array(12).fill(0),KZ=({visible:t,className:e})=>we.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},we.createElement("div",{className:"sonner-spinner"},GZ.map((n,r)=>we.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),YZ=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},we.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),XZ=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},we.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),QZ=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},we.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),JZ=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},we.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),eW=we.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},we.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),we.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),tW=()=>{const[t,e]=we.useState(document.hidden);return we.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),t};let nW=1;const rW=100,jE=t=>{var e;return typeof(t==null?void 0:t.id)=="number"||(t==null||(e=t.id)==null?void 0:e.length)>0?t.id:nW++};class sW{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(n=>e(n)),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-rW;e<=0||(this.toasts=this.toasts.filter(n=>e>0&&this.dismissedToasts.has(n.id)?(this.dismissedToasts.delete(n.id),e--,!1):!0))},this.create=e=>{const{message:n,...r}=e,s=jE(e),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const o=this.dismissedToasts.has(s),l=e.dismissible===void 0?!0:e.dismissible;return o&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(d=>d.id!==s)),(o?void 0:this.toasts.find(d=>d.id===s))?this.toasts=this.toasts.map(d=>d.id===s?(this.publish({...d,...e,id:s,title:n}),{...d,...e,id:s,dismissible:l,title:n}):d):this.addToast({title:n,...r,dismissible:l,id:s}),s},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);const n=this.pendingDismissals.get(e);return n!==void 0&&cancelAnimationFrame(n),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(r=>r({id:e,dismiss:!0}))})),e},this.message=(e,n)=>this.create({...n,message:e,type:void 0}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(e instanceof Function?e():e);let i=r!==void 0,o;const l=s.then(async d=>{if(o=["resolve",d],we.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(oW(d)&&!d.ok){i=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,w=typeof p=="object"&&!we.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:g,...w})}else if(d instanceof Error){i=!1;const p=typeof n.error=="function"?await n.error(d):n.error,g=typeof n.description=="function"?await n.description(d):n.description,w=typeof p=="object"&&!we.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:g,...w})}else if(n.success!==void 0){i=!1;const p=typeof n.success=="function"?await n.success(d):n.success,g=typeof n.description=="function"?await n.description(d):n.description,w=typeof p=="object"&&!we.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:g,...w})}}).catch(async d=>{if(o=["reject",d],n.error!==void 0){i=!1;const f=typeof n.error=="function"?await n.error(d):n.error,p=typeof n.description=="function"?await n.description(d):n.description,v=typeof f=="object"&&!we.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:p,...v})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((d,f)=>l.then(()=>o[0]==="reject"?f(o[1]):d(o[1])).catch(f));return typeof r!="string"&&typeof r!="number"?{unwrap:u}:Object.assign(r,{unwrap:u})},this.custom=(e,n)=>{const r=jE(n);return this.create({...n,jsx:e(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const Ur=new sW,iW=(t,e)=>Ur.message(t,e),oW=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",aW=iW,lW=()=>Ur.toasts,cW=()=>Ur.getActiveToasts(),Rt=Object.assign(aW,{success:Ur.success,info:Ur.info,warning:Ur.warning,error:Ur.error,custom:Ur.custom,message:Ur.message,promise:Ur.promise,dismiss:Ur.dismiss,loading:Ur.loading},{getHistory:lW,getToasts:cW});WZ("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function w0(t){return t.label!==void 0}const uW=3,dW="24px",fW="16px",FE=4e3,hW=356,pW=14,mW=45,gW=200;function ki(...t){return t.filter(Boolean).join(" ")}function vW(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const yW=t=>{var e,n,r,s,i,o,l,u,d;const{invert:f,toast:p,unstyled:g,interacting:v,setHeights:w,visibleToasts:_,heights:x,index:b,toasts:E,expanded:C,removeToast:R,defaultRichColors:A,closeButton:I,style:M,cancelButtonStyle:T,actionButtonStyle:L,className:D="",descriptionClassName:j="",duration:H,position:Y,gap:U,expandByDefault:z,classNames:Z,icons:Q,closeButtonAriaLabel:B="Close toast"}=t,[ee,W]=we.useState(null),[N,X]=we.useState(null),[oe,re]=we.useState(!1),[se,fe]=we.useState(!1),[_e,de]=we.useState(!1),[ae,Oe]=we.useState(!1),[ke,Ge]=we.useState(!1),[vt,It]=we.useState(0),[Yt,wt]=we.useState(0),yt=we.useRef(p.duration||H||FE),We=we.useRef(null),Ke=we.useRef(null),St=b===0,Re=b+1<=_,Ye=p.type,Mt=Ye??"default",qe=p.dismissible!==!1,kt=p.className||"",ns=p.descriptionClassName||"",mr=we.useMemo(()=>x.findIndex(Xe=>Xe.toastId===p.id)||0,[x,p.id]),Le=we.useMemo(()=>{var Xe;return(Xe=p.closeButton)!=null?Xe:I},[p.closeButton,I]),Bo=we.useMemo(()=>p.duration||H||FE,[p.duration,H]),Mn=we.useRef(0),Yn=we.useRef(0),rl=we.useRef(0),mn=we.useRef(null),[gn,gd]=Y.split("-"),Ps=we.useMemo(()=>x.reduce((Xe,Ot,Ft)=>Ft>=mr?Xe:Xe+Ot.height,0),[x,mr]),gr=tW(),Xn=we.useMemo(()=>{var Xe;return(Xe=t.swipeDirections)!=null?Xe:vW(Y)},[t.swipeDirections,Y]),Yi=p.invert||f,Gs=Ye==="loading";Yn.current=we.useMemo(()=>mr*U+Ps,[mr,Ps]),we.useEffect(()=>{yt.current=Bo},[Bo]),we.useEffect(()=>{re(!0)},[]),we.useEffect(()=>{const Xe=Ke.current;if(Xe){const Ot=Xe.getBoundingClientRect().height;return wt(Ot),w(Ft=>[{toastId:p.id,height:Ot,position:p.position},...Ft]),()=>w(Ft=>Ft.filter(zn=>zn.toastId!==p.id))}},[w,p.id]),we.useLayoutEffect(()=>{if(!oe)return;const Xe=Ke.current,Ot=Xe.style.height;Xe.style.height="auto";const Ft=Xe.getBoundingClientRect().height;Xe.style.height=Ot,wt(Ft),w(zn=>zn.find(Bt=>Bt.toastId===p.id)?zn.map(Bt=>Bt.toastId===p.id?{...Bt,height:Ft}:Bt):[{toastId:p.id,height:Ft,position:p.position},...zn])},[oe,p.title,p.description,w,p.id,p.jsx,p.action,p.cancel]);const On=we.useCallback(()=>{fe(!0),It(Yn.current),w(Xe=>Xe.filter(Ot=>Ot.toastId!==p.id)),setTimeout(()=>{R(p)},gW)},[p,R,w,Yn]);we.useEffect(()=>{if(p.promise&&Ye==="loading"||p.duration===1/0||p.type==="loading")return;let Xe;return C||v||gr?(()=>{if(rl.current<Mn.current){const zn=new Date().getTime()-Mn.current;yt.current=yt.current-zn}rl.current=new Date().getTime()})():(()=>{yt.current!==1/0&&(Mn.current=new Date().getTime(),Xe=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),On()},yt.current))})(),()=>clearTimeout(Xe)},[C,v,p,Ye,gr,On]),we.useEffect(()=>{p.delete&&(On(),p.onDismiss==null||p.onDismiss.call(p,p))},[On,p.delete]);function Rs(){var Xe;if(Q!=null&&Q.loading){var Ot;return we.createElement("div",{className:ki(Z==null?void 0:Z.loader,p==null||(Ot=p.classNames)==null?void 0:Ot.loader,"sonner-loader"),"data-visible":Ye==="loading"},Q.loading)}return we.createElement(KZ,{className:ki(Z==null?void 0:Z.loader,p==null||(Xe=p.classNames)==null?void 0:Xe.loader),visible:Ye==="loading"})}const sl=p.icon||(Q==null?void 0:Q[Ye])||qZ(Ye);var Xi,rs;return we.createElement("li",{tabIndex:0,ref:Ke,className:ki(D,kt,Z==null?void 0:Z.toast,p==null||(e=p.classNames)==null?void 0:e.toast,Z==null?void 0:Z[Mt],p==null||(n=p.classNames)==null?void 0:n[Mt]),"data-sonner-toast":"","data-rich-colors":(Xi=p.richColors)!=null?Xi:A,"data-styled":!(p.jsx||p.unstyled||g),"data-mounted":oe,"data-promise":!!p.promise,"data-swiped":ke,"data-removed":se,"data-visible":Re,"data-y-position":gn,"data-x-position":gd,"data-index":b,"data-front":St,"data-swiping":_e,"data-dismissible":qe,"data-type":Ye,"data-invert":Yi,"data-swipe-out":ae,"data-swipe-direction":N,"data-expanded":!!(C||z&&oe),"data-testid":p.testId,style:{"--index":b,"--toasts-before":b,"--z-index":E.length-b,"--offset":`${se?vt:Yn.current}px`,"--initial-height":z?"auto":`${Yt}px`,...M,...p.style},onDragEnd:()=>{de(!1),W(null),mn.current=null},onPointerDown:Xe=>{Xe.button!==2&&(Gs||!qe||(We.current=new Date,It(Yn.current),Xe.target.setPointerCapture(Xe.pointerId),Xe.target.tagName!=="BUTTON"&&(de(!0),mn.current={x:Xe.clientX,y:Xe.clientY})))},onPointerUp:()=>{var Xe,Ot,Ft;if(ae||!qe)return;mn.current=null;const zn=Number(((Xe=Ke.current)==null?void 0:Xe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ss=Number(((Ot=Ke.current)==null?void 0:Ot.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Bt=new Date().getTime()-((Ft=We.current)==null?void 0:Ft.getTime()),Ln=ee==="x"?zn:ss,$r=Math.abs(Ln)/Bt;if((ee==="x"?Xn.includes(zn>0?"right":"left"):Xn.includes(ss>0?"bottom":"top"))&&(Math.abs(Ln)>=mW||$r>.11)){It(Yn.current),p.onDismiss==null||p.onDismiss.call(p,p),X(ee==="x"?zn>0?"right":"left":ss>0?"down":"up"),On(),Oe(!0);return}else{var or,Pn;(or=Ke.current)==null||or.style.setProperty("--swipe-amount-x","0px"),(Pn=Ke.current)==null||Pn.style.setProperty("--swipe-amount-y","0px")}Ge(!1),de(!1),W(null)},onPointerMove:Xe=>{var Ot,Ft,zn;if(!mn.current||!qe||((Ot=window.getSelection())==null?void 0:Ot.toString().length)>0)return;const Bt=Xe.clientY-mn.current.y,Ln=Xe.clientX-mn.current.x;!ee&&(Math.abs(Ln)>1||Math.abs(Bt)>1)&&W(Math.abs(Ln)>Math.abs(Bt)?"x":"y");let $r={x:0,y:0};const Ks=or=>1/(1.5+Math.abs(or)/20);if(ee==="y"){if(Xn.includes("top")||Xn.includes("bottom"))if(Xn.includes("top")&&Bt<0||Xn.includes("bottom")&&Bt>0)$r.y=Bt;else{const or=Bt*Ks(Bt);$r.y=Math.abs(or)<Math.abs(Bt)?or:Bt}}else if(ee==="x"&&(Xn.includes("left")||Xn.includes("right")))if(Xn.includes("left")&&Ln<0||Xn.includes("right")&&Ln>0)$r.x=Ln;else{const or=Ln*Ks(Ln);$r.x=Math.abs(or)<Math.abs(Ln)?or:Ln}(Math.abs($r.x)>0||Math.abs($r.y)>0)&&Ge(!0),(Ft=Ke.current)==null||Ft.style.setProperty("--swipe-amount-x",`${$r.x}px`),(zn=Ke.current)==null||zn.style.setProperty("--swipe-amount-y",`${$r.y}px`)}},Le&&!p.jsx&&Ye!=="loading"?we.createElement("button",{"aria-label":B,"data-disabled":Gs,"data-close-button":!0,onClick:Gs||!qe?()=>{}:()=>{On(),p.onDismiss==null||p.onDismiss.call(p,p)},className:ki(Z==null?void 0:Z.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(rs=Q==null?void 0:Q.close)!=null?rs:eW):null,(Ye||p.icon||p.promise)&&p.icon!==null&&((Q==null?void 0:Q[Ye])!==null||p.icon)?we.createElement("div",{"data-icon":"",className:ki(Z==null?void 0:Z.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},Ye==="loading"?p.icon||Rs():p.promise?Rs():null,Ye!=="loading"?sl:null):null,we.createElement("div",{"data-content":"",className:ki(Z==null?void 0:Z.content,p==null||(i=p.classNames)==null?void 0:i.content)},we.createElement("div",{"data-title":"",className:ki(Z==null?void 0:Z.title,p==null||(o=p.classNames)==null?void 0:o.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?we.createElement("div",{"data-description":"",className:ki(j,ns,Z==null?void 0:Z.description,p==null||(l=p.classNames)==null?void 0:l.description)},typeof p.description=="function"?p.description():p.description):null),we.isValidElement(p.cancel)?p.cancel:p.cancel&&w0(p.cancel)?we.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||T,onClick:Xe=>{w0(p.cancel)&&qe&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Xe),On())},className:ki(Z==null?void 0:Z.cancelButton,p==null||(u=p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,we.isValidElement(p.action)?p.action:p.action&&w0(p.action)?we.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||L,onClick:Xe=>{w0(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Xe),!Xe.defaultPrevented&&On())},className:ki(Z==null?void 0:Z.actionButton,p==null||(d=p.classNames)==null?void 0:d.actionButton)},p.action.label):null)};function VE(){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 _W(t,e){const n={};return[t,e].forEach((r,s)=>{const i=s===1,o=i?"--mobile-offset":"--offset",l=i?fW:dW;function u(d){["top","right","bottom","left"].forEach(f=>{n[`${o}-${f}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${o}-${d}`]=l:n[`${o}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):u(l)}),n}const wW=we.forwardRef(function(e,n){const{id:r,invert:s,position:i="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:u,className:d,offset:f,mobileOffset:p,theme:g="light",richColors:v,duration:w,style:_,visibleToasts:x=uW,toastOptions:b,dir:E=VE(),gap:C=pW,icons:R,customAriaLabel:A,containerAriaLabel:I="Notifications"}=e,[M,T]=we.useState([]),L=we.useMemo(()=>r?M.filter(re=>re.toasterId===r):M.filter(re=>!re.toasterId),[M,r]),D=we.useMemo(()=>Array.from(new Set([i].concat(L.filter(re=>re.position).map(re=>re.position)))),[L,i]),[j,H]=we.useState([]),[Y,U]=we.useState(!1),[z,Z]=we.useState(!1),[Q,B]=we.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),ee=we.useRef(null),W=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),N=we.useRef(null),X=we.useRef(!1),oe=we.useCallback(re=>{T(se=>{var fe;return(fe=se.find(_e=>_e.id===re.id))!=null&&fe.delete||Ur.dismiss(re.id),se.filter(({id:_e})=>_e!==re.id)})},[]);return we.useEffect(()=>Ur.subscribe(re=>{if(re.dismiss){requestAnimationFrame(()=>{T(se=>se.map(fe=>fe.id===re.id?{...fe,delete:!0}:fe))});return}setTimeout(()=>{ZZ.flushSync(()=>{T(se=>{const fe=se.findIndex(_e=>_e.id===re.id);return fe!==-1?[...se.slice(0,fe),{...se[fe],...re},...se.slice(fe+1)]:[re,...se]})})})}),[]),we.useEffect(()=>{if(g!=="system"){B(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?B("dark"):B("light")),typeof window>"u")return;const re=window.matchMedia("(prefers-color-scheme: dark)");try{re.addEventListener("change",({matches:se})=>{B(se?"dark":"light")})}catch{re.addListener(({matches:fe})=>{try{B(fe?"dark":"light")}catch(_e){console.error(_e)}})}},[g]),we.useEffect(()=>{M.length<=1&&U(!1)},[M]),we.useEffect(()=>{const re=se=>{var fe;if(o.length>0&&o.every(ae=>se[ae]||se.code===ae)){var de;U(!0),(de=ee.current)==null||de.focus()}se.code==="Escape"&&(document.activeElement===ee.current||(fe=ee.current)!=null&&fe.contains(document.activeElement))&&U(!1)};return document.addEventListener("keydown",re),()=>document.removeEventListener("keydown",re)},[o]),we.useEffect(()=>{if(ee.current)return()=>{N.current&&(N.current.focus({preventScroll:!0}),N.current=null,X.current=!1)}},[ee.current]),we.createElement("section",{ref:n,"aria-label":A??`${I} ${W}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},D.map((re,se)=>{var fe;const[_e,de]=re.split("-");return L.length?we.createElement("ol",{key:re,dir:E==="auto"?VE():E,tabIndex:-1,ref:ee,className:d,"data-sonner-toaster":!0,"data-sonner-theme":Q,"data-y-position":_e,"data-x-position":de,style:{"--front-toast-height":`${((fe=j[0])==null?void 0:fe.height)||0}px`,"--width":`${hW}px`,"--gap":`${C}px`,..._,..._W(f,p)},onBlur:ae=>{X.current&&!ae.currentTarget.contains(ae.relatedTarget)&&(X.current=!1,N.current&&(N.current.focus({preventScroll:!0}),N.current=null))},onFocus:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||X.current||(X.current=!0,N.current=ae.relatedTarget)},onMouseEnter:()=>U(!0),onMouseMove:()=>U(!0),onMouseLeave:()=>{z||U(!1)},onDragEnd:()=>U(!1),onPointerDown:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||Z(!0)},onPointerUp:()=>Z(!1)},L.filter(ae=>!ae.position&&se===0||ae.position===re).map((ae,Oe)=>{var ke,Ge;return we.createElement(yW,{key:ae.id,icons:R,index:Oe,toast:ae,defaultRichColors:v,duration:(ke=b==null?void 0:b.duration)!=null?ke:w,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:s,visibleToasts:x,closeButton:(Ge=b==null?void 0:b.closeButton)!=null?Ge:u,interacting:z,position:re,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:oe,toasts:L.filter(vt=>vt.position==ae.position),heights:j.filter(vt=>vt.position==ae.position),setHeights:H,expandByDefault:l,gap:C,expanded:Y,swipeDirections:e.swipeDirections})})):null}))}),xW=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),bW=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),SW=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),kW=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),EW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M176,128,96,208V48Z",opacity:"0.2"}),m.createElement("path",{d:"M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z"}))]]),CW=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),PW=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),RW=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),AW=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,40V168H168V88H88V40Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),TW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z",opacity:"0.2"}),m.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z"}))]]),IW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M248.23,112.31A20,20,0,0,0,232,104H220V88a20,20,0,0,0-20-20H132L105.34,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V208a12,12,0,0,0,12,12H211.1a12,12,0,0,0,11.33-8l28.49-81.47.06-.17A20,20,0,0,0,248.23,112.31ZM92,68l28.8,21.6A12,12,0,0,0,128,92h68v12H69.77a20,20,0,0,0-18.94,13.58L44,137.15V68ZM202.59,196H48.89l23.72-68H226.37Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,88v24H69.77a8,8,0,0,0-7.59,5.47L32,208V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h72A8,8,0,0,1,208,88Z",opacity:"0.2"}),m.createElement("path",{d:"M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Zm112,136H43.1l26.67-80H232Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208h0a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M243.36,111.81A14,14,0,0,0,232,106H214V88a14,14,0,0,0-14-14H130L101.74,52.8a14.06,14.06,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V208a6,6,0,0,0,6,6H211.1a6,6,0,0,0,5.69-4.1l28.49-85.47A14,14,0,0,0,243.36,111.81ZM40,62H93.34a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h72a2,2,0,0,1,2,2v18H69.77a14,14,0,0,0-13.28,9.57L38,171V64A2,2,0,0,1,40,62Zm193.9,58.63L206.78,202H40.33l27.54-82.63a2,2,0,0,1,1.9-1.37H232a2,2,0,0,1,1.9,2.63Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M245,110.64A16,16,0,0,0,232,104H216V88a16,16,0,0,0-16-16H130.67L102.94,51.2a16.14,16.14,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V208h0a8,8,0,0,0,8,8H211.1a8,8,0,0,0,7.59-5.47l28.49-85.47A16.05,16.05,0,0,0,245,110.64ZM93.34,64,123.2,86.4A8,8,0,0,0,128,88h72v16H69.77a16,16,0,0,0-15.18,10.94L40,158.7V64Zm112,136H43.1l26.67-80H232Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M241.72,113a11.88,11.88,0,0,0-9.73-5H212V88a12,12,0,0,0-12-12H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V208a4,4,0,0,0,4,4H211.09a4,4,0,0,0,3.79-2.74l28.49-85.47A11.86,11.86,0,0,0,241.72,113ZM40,60H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h72a4,4,0,0,1,4,4v20H69.76a12,12,0,0,0-11.38,8.21L36,183.35V64A4,4,0,0,1,40,60Zm195.78,61.26L208.2,204H37.55L66,118.74A4,4,0,0,1,69.76,116H232a4,4,0,0,1,3.79,5.26Z"}))]]),MW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,68H132L105.33,48a20.12,20.12,0,0,0-12-4H40A20,20,0,0,0,20,64V200a20,20,0,0,0,20,20H216.89A19.13,19.13,0,0,0,236,200.89V88A20,20,0,0,0,216,68Zm-4,128H44V68H92l28.8,21.6A12,12,0,0,0,128,92h84Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,88V200.89a7.11,7.11,0,0,1-7.11,7.11H40a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H93.33a8,8,0,0,1,4.8,1.6L128,80h88A8,8,0,0,1,224,88Z",opacity:"0.2"}),m.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M232,88V200.89A15.13,15.13,0,0,1,216.89,216H40a16,16,0,0,1-16-16V64A16,16,0,0,1,40,48H93.33a16.12,16.12,0,0,1,9.6,3.2L130.67,72H216A16,16,0,0,1,232,88Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,74H130L101.73,52.8a14,14,0,0,0-8.4-2.8H40A14,14,0,0,0,26,64V200a14,14,0,0,0,14,14H216.89A13.12,13.12,0,0,0,230,200.89V88A14,14,0,0,0,216,74Zm2,126.89a1.11,1.11,0,0,1-1.11,1.11H40a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H93.33a2,2,0,0,1,1.2.4L124.4,84.8A6,6,0,0,0,128,86h88a2,2,0,0,1,2,2Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,72H130.67L102.93,51.2a16.12,16.12,0,0,0-9.6-3.2H40A16,16,0,0,0,24,64V200a16,16,0,0,0,16,16H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72Zm0,128H40V64H93.33L123.2,86.4A8,8,0,0,0,128,88h88Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M216,76H129.33l-28.8-21.6a12.05,12.05,0,0,0-7.2-2.4H40A12,12,0,0,0,28,64V200a12,12,0,0,0,12,12H216.89A11.12,11.12,0,0,0,228,200.89V88A12,12,0,0,0,216,76Zm4,124.89a3.12,3.12,0,0,1-3.11,3.11H40a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H93.33a4,4,0,0,1,2.4.8L125.6,83.2a4,4,0,0,0,2.4.8h88a4,4,0,0,1,4,4Z"}))]]),OW=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),LW=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),NW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M238.15,78.54,177.46,17.86a20,20,0,0,0-28.3,0L97.2,70c-12.43-3.33-36.68-5.72-61.74,14.5a20,20,0,0,0-1.6,29.73l45.46,45.47-39.8,39.8a12,12,0,0,0,17,17l39.8-39.81,45.47,45.46A20,20,0,0,0,155.91,228c.46,0,.93,0,1.4-.05A20,20,0,0,0,171.87,220c4.69-6.23,11-16.13,14.44-28s3.45-22.88.16-33.4l51.7-51.87A20,20,0,0,0,238.15,78.54Zm-74.26,68.79a12,12,0,0,0-2.23,13.84c3.43,6.86,6.9,21-6.28,40.65L54.08,100.53c21.09-14.59,39.53-6.64,41-6a11.67,11.67,0,0,0,13.81-2.29l54.43-54.61,55,55Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M229.66,98.34,172.39,155.8c11.46,22.93-1.72,45.86-10.11,57a8,8,0,0,1-12,.83L42.34,105.76A8,8,0,0,1,43,93.85c29.65-23.92,57.4-10,57.4-10l57.27-57.46a8,8,0,0,1,11.31,0L229.66,87A8,8,0,0,1,229.66,98.34Z",opacity:"0.2"}),m.createElement("path",{d:"M235.32,81.37,174.63,20.69a16,16,0,0,0-22.63,0L98.37,74.49c-10.66-3.34-35-7.37-60.4,13.14a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33c19.64-26.1,17.75-47.32,13.19-60L235.33,104A16,16,0,0,0,235.32,81.37ZM224,92.69h0l-57.27,57.46a8,8,0,0,0-1.49,9.22c9.46,18.93-1.8,38.59-9.34,48.62L48,100.08c12.08-9.74,23.64-12.31,32.48-12.31A40.13,40.13,0,0,1,96.81,91a8,8,0,0,0,9.25-1.51L163.32,32,224,92.68Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M235.33,104l-53.47,53.65c4.56,12.67,6.45,33.89-13.19,60A15.93,15.93,0,0,1,157,224c-.38,0-.75,0-1.13,0a16,16,0,0,1-11.32-4.69L96.29,171,53.66,213.66a8,8,0,0,1-11.32-11.32L85,159.71l-48.3-48.3A16,16,0,0,1,38,87.63c25.42-20.51,49.75-16.48,60.4-13.14L152,20.7a16,16,0,0,1,22.63,0l60.69,60.68A16,16,0,0,1,235.33,104Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M233.91,82.79,173.22,22.1a14,14,0,0,0-19.81,0L98.93,76.77c-9.52-3.25-34-8.34-59.71,12.41A14,14,0,0,0,38.1,110l49.71,49.71-44.05,44a6,6,0,1,0,8.48,8.48l44.05-44.05L146,217.89a14,14,0,0,0,9.9,4.11q.49,0,1,0a14,14,0,0,0,10.19-5.54c19.72-26.21,17.15-47.23,12.46-59.3l54.37-54.55A14,14,0,0,0,233.91,82.79ZM225.42,94.1h0l-57.27,57.46a6,6,0,0,0-1.11,6.92c9.94,19.88-1.71,40.32-9.54,50.72a2,2,0,0,1-3,.2L46.58,101.51a2,2,0,0,1,.18-3c12.5-10.09,24.5-12.76,33.7-12.76a42.13,42.13,0,0,1,17.25,3.41A6,6,0,0,0,104.64,88L161.9,30.59a2,2,0,0,1,2.83,0l60.69,60.68A2,2,0,0,1,225.42,94.1Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M235.32,81.37,174.63,20.69a16,16,0,0,0-22.63,0L98.37,74.49c-10.66-3.34-35-7.37-60.4,13.14a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33c19.64-26.1,17.75-47.32,13.19-60L235.33,104A16,16,0,0,0,235.32,81.37ZM224,92.69h0l-57.27,57.46a8,8,0,0,0-1.49,9.22c9.46,18.93-1.8,38.59-9.34,48.62L48,100.08c12.08-9.74,23.64-12.31,32.48-12.31A40.13,40.13,0,0,1,96.81,91a8,8,0,0,0,9.25-1.51L163.32,32,224,92.68Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M232.49,84.2,171.8,23.51a12,12,0,0,0-17,0L99.45,79.07c-8.08-3-32.79-9.45-59,11.67a12,12,0,0,0-1,17.84l51.13,51.13L45.17,205.17a4,4,0,0,0,5.66,5.66l45.46-45.47,51.12,51.12A12,12,0,0,0,155.9,220c.28,0,.57,0,.85,0a12,12,0,0,0,8.73-4.74c19.83-26.36,16.51-47.18,11.71-58.57l55.3-55.49A12,12,0,0,0,232.49,84.2Zm-5.66,11.31h0L169.56,153a4,4,0,0,0-.75,4.61c10.43,20.85-1.62,42-9.73,52.83a4,4,0,0,1-6,.4L45.17,102.93a4,4,0,0,1,.33-6C58.44,86.53,70.86,83.74,80.44,83.74A43.9,43.9,0,0,1,98.6,87.38a4,4,0,0,0,4.62-.75l57.27-57.46a4,4,0,0,1,5.66,0l60.68,60.69A4,4,0,0,1,226.83,95.51Z"}))]]),DW=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),$W=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M144.49,136.49l-40,40a12,12,0,0,1-17-17L107,140H24a12,12,0,0,1,0-24h83L87.51,96.49a12,12,0,0,1,17-17l40,40A12,12,0,0,1,144.49,136.49ZM200,28H136a12,12,0,0,0,0,24h52V204H136a12,12,0,0,0,0,24h64a12,12,0,0,0,12-12V40A12,12,0,0,0,200,28Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M200,40V216H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40Z",opacity:"0.2"}),m.createElement("path",{d:"M141.66,133.66l-40,40a8,8,0,0,1-11.32-11.32L116.69,136H24a8,8,0,0,1,0-16h92.69L90.34,93.66a8,8,0,0,1,11.32-11.32l40,40A8,8,0,0,1,141.66,133.66ZM200,32H136a8,8,0,0,0,0,16h56V208H136a8,8,0,0,0,0,16h64a8,8,0,0,0,8-8V40A8,8,0,0,0,200,32Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M141.66,133.66l-40,40A8,8,0,0,1,88,168V136H24a8,8,0,0,1,0-16H88V88a8,8,0,0,1,13.66-5.66l40,40A8,8,0,0,1,141.66,133.66ZM200,32H136a8,8,0,0,0,0,16h56V208H136a8,8,0,0,0,0,16h64a8,8,0,0,0,8-8V40A8,8,0,0,0,200,32Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M140.24,132.24l-40,40a6,6,0,0,1-8.48-8.48L121.51,134H24a6,6,0,0,1,0-12h97.51L91.76,92.24a6,6,0,0,1,8.48-8.48l40,40A6,6,0,0,1,140.24,132.24ZM200,34H136a6,6,0,0,0,0,12h58V210H136a6,6,0,0,0,0,12h64a6,6,0,0,0,6-6V40A6,6,0,0,0,200,34Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M141.66,133.66l-40,40a8,8,0,0,1-11.32-11.32L116.69,136H24a8,8,0,0,1,0-16h92.69L90.34,93.66a8,8,0,0,1,11.32-11.32l40,40A8,8,0,0,1,141.66,133.66ZM200,32H136a8,8,0,0,0,0,16h56V208H136a8,8,0,0,0,0,16h64a8,8,0,0,0,8-8V40A8,8,0,0,0,200,32Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M138.83,130.83l-40,40a4,4,0,0,1-5.66-5.66L126.34,132H24a4,4,0,0,1,0-8H126.34L93.17,90.83a4,4,0,0,1,5.66-5.66l40,40A4,4,0,0,1,138.83,130.83ZM200,36H136a4,4,0,0,0,0,8h60V212H136a4,4,0,0,0,0,8h64a4,4,0,0,0,4-4V40A4,4,0,0,0,200,36Z"}))]]),jW=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),FW=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),VW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M100,36H56A20,20,0,0,0,36,56v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V56A20,20,0,0,0,100,36ZM96,96H60V60H96ZM200,36H156a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,60H160V60h36Zm-96,40H56a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V156A20,20,0,0,0,100,136Zm-4,60H60V160H96Zm104-60H156a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V156A20,20,0,0,0,200,136Zm-4,60H160V160h36Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M112,56v48a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8h48A8,8,0,0,1,112,56Zm88-8H152a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V56A8,8,0,0,0,200,48Zm-96,96H56a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V152A8,8,0,0,0,104,144Zm96,0H152a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V152A8,8,0,0,0,200,144Z",opacity:"0.2"}),m.createElement("path",{d:"M200,136H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48ZM104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M120,56v48a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40h48A16,16,0,0,1,120,56Zm80-16H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm-96,96H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm96,0H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M104,42H56A14,14,0,0,0,42,56v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V56A14,14,0,0,0,104,42Zm2,62a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm94-62H152a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,62a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm-98,34H56a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V152A14,14,0,0,0,104,138Zm2,62a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm94-62H152a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V152A14,14,0,0,0,200,138Zm2,62a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M104,44H56A12,12,0,0,0,44,56v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V56A12,12,0,0,0,104,44Zm4,60a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Zm92-60H152a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,60a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4ZM104,140H56a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V152A12,12,0,0,0,104,140Zm4,60a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Zm92-60H152a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V152A12,12,0,0,0,200,140Zm4,60a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Z"}))]]),HW=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),zW=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),BW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M234.38,210a123.36,123.36,0,0,0-60.78-53.23,76,76,0,1,0-91.2,0A123.36,123.36,0,0,0,21.62,210a12,12,0,1,0,20.77,12c18.12-31.32,50.12-50,85.61-50s67.49,18.69,85.61,50a12,12,0,0,0,20.77-12ZM76,96a52,52,0,1,1,52,52A52.06,52.06,0,0,1,76,96Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M192,96a64,64,0,1,1-64-64A64,64,0,0,1,192,96Z",opacity:"0.2"}),m.createElement("path",{d:"M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M230.93,220a8,8,0,0,1-6.93,4H32a8,8,0,0,1-6.92-12c15.23-26.33,38.7-45.21,66.09-54.16a72,72,0,1,1,73.66,0c27.39,8.95,50.86,27.83,66.09,54.16A8,8,0,0,1,230.93,220Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M229.19,213c-15.81-27.32-40.63-46.49-69.47-54.62a70,70,0,1,0-63.44,0C67.44,166.5,42.62,185.67,26.81,213a6,6,0,1,0,10.38,6C56.4,185.81,90.34,166,128,166s71.6,19.81,90.81,53a6,6,0,1,0,10.38-6ZM70,96a58,58,0,1,1,58,58A58.07,58.07,0,0,1,70,96Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M227.46,214c-16.52-28.56-43-48.06-73.68-55.09a68,68,0,1,0-51.56,0c-30.64,7-57.16,26.53-73.68,55.09a4,4,0,0,0,6.92,4C55,184.19,89.62,164,128,164s73,20.19,92.54,54a4,4,0,0,0,3.46,2,3.93,3.93,0,0,0,2-.54A4,4,0,0,0,227.46,214ZM68,96a60,60,0,1,1,60,60A60.07,60.07,0,0,1,68,96Z"}))]]),UW=new Map([["bold",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}),m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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",m.createElement(m.Fragment,null,m.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"}))]]),ZW=new Map([["bold",m.createElement(m.Fragment,null,m.createElement("path",{d:"M218.12,209.56l-61-95.8,59.72-65.69a12,12,0,0,0-17.76-16.14L143.81,92.77,106.12,33.56A12,12,0,0,0,96,28H48A12,12,0,0,0,37.88,46.44l61,95.8L39.12,207.93a12,12,0,1,0,17.76,16.14l55.31-60.84,37.69,59.21A12,12,0,0,0,160,228h48a12,12,0,0,0,10.12-18.44ZM166.59,204,69.86,52H89.41l96.73,152Z"}))],["duotone",m.createElement(m.Fragment,null,m.createElement("path",{d:"M208,216H160L48,40H96Z",opacity:"0.2"}),m.createElement("path",{d:"M214.75,211.71l-62.6-98.38,61.77-67.95a8,8,0,0,0-11.84-10.76L143.24,99.34,102.75,35.71A8,8,0,0,0,96,32H48a8,8,0,0,0-6.75,12.3l62.6,98.37-61.77,68a8,8,0,1,0,11.84,10.76l58.84-64.72,40.49,63.63A8,8,0,0,0,160,224h48a8,8,0,0,0,6.75-12.29ZM164.39,208,62.57,48h29L193.43,208Z"}))],["fill",m.createElement(m.Fragment,null,m.createElement("path",{d:"M215,219.85a8,8,0,0,1-7,4.15H160a8,8,0,0,1-6.75-3.71l-40.49-63.63L53.92,221.38a8,8,0,0,1-11.84-10.76l61.77-68L41.25,44.3A8,8,0,0,1,48,32H96a8,8,0,0,1,6.75,3.71l40.49,63.63,58.84-64.72a8,8,0,0,1,11.84,10.76l-61.77,67.95,62.6,98.38A8,8,0,0,1,215,219.85Z"}))],["light",m.createElement(m.Fragment,null,m.createElement("path",{d:"M213.06,212.78l-63.42-99.66L212.44,44A6,6,0,1,0,203.56,36L143,102.62l-41.9-65.84A6,6,0,0,0,96,34H48a6,6,0,0,0-5.06,9.22l63.42,99.66L43.56,212A6,6,0,0,0,52.44,220L113,153.38l41.9,65.84A6,6,0,0,0,160,222h48a6,6,0,0,0,5.06-9.22ZM163.29,210,58.93,46H92.71L197.07,210Z"}))],["regular",m.createElement(m.Fragment,null,m.createElement("path",{d:"M214.75,211.71l-62.6-98.38,61.77-67.95a8,8,0,0,0-11.84-10.76L143.24,99.34,102.75,35.71A8,8,0,0,0,96,32H48a8,8,0,0,0-6.75,12.3l62.6,98.37-61.77,68a8,8,0,1,0,11.84,10.76l58.84-64.72,40.49,63.63A8,8,0,0,0,160,224h48a8,8,0,0,0,6.75-12.29ZM164.39,208,62.57,48h29L193.43,208Z"}))],["thin",m.createElement(m.Fragment,null,m.createElement("path",{d:"M211.37,213.85,147.13,112.9,211,42.69A4,4,0,0,0,205,37.31L142.68,105.9,99.38,37.85A4,4,0,0,0,96,36H48a4,4,0,0,0-3.37,6.15L108.87,143.1,45,213.31A4,4,0,1,0,51,218.69l62.36-68.59,43.3,68.05A4,4,0,0,0,160,220h48a4,4,0,0,0,3.37-6.15ZM162.2,212,55.29,44H93.8L200.71,212Z"}))]]),WW=m.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),Jt=m.forwardRef((t,e)=>{const{alt:n,color:r,size:s,weight:i,mirrored:o,children:l,weights:u,...d}=t,{color:f="currentColor",size:p,weight:g="regular",mirrored:v=!1,...w}=m.useContext(WW);return m.createElement("svg",{ref:e,xmlns:"http://www.w3.org/2000/svg",width:s??p,height:s??p,fill:r??f,viewBox:"0 0 256 256",transform:o||v?"scale(-1, 1)":void 0,...w,...d},!!n&&m.createElement("title",null,n),l,u.get(i??g))});Jt.displayName="IconBase";const PT=m.forwardRef((t,e)=>m.createElement(Jt,{ref:e,...t,weights:xW}));PT.displayName="ArrowLeftIcon";const qW=PT,RT=m.forwardRef((t,e)=>m.createElement(Jt,{ref:e,...t,weights:bW}));RT.displayName="ArrowSquareOutIcon";const GW=RT,AT=m.forwardRef((t,e)=>m.createElement(Jt,{ref:e,...t,weights:SW}));AT.displayName="ArrowUpIcon";const KW=AT,TT=m.forwardRef((t,e)=>m.createElement(Jt,{ref:e,...t,weights:kW}));TT.displayName="CaretDownIcon";const YW=TT,IT=m.forwardRef((t,e)=>m.createElement(Jt,{ref:e,...t,weights:EW}));IT.displayName="CaretRightIcon";const XW=IT,MT=m.forwardRef((t,e)=>m.createElement(Jt,{ref:e,...t,weights:CW}));MT.displayName="ChatCircleIcon";const QW=MT,OT=m.forwardRef((t,e)=>m.createElement(Jt,{ref:e,...t,weights:PW}));OT.displayName="CheckIcon";const LT=OT,NT=m.forwardRef((t,e)=>m.createElement(Jt,{ref:e,...t,weights:RW}));NT.displayName="CircleNotchIcon";const Mg=NT,DT=m.forwardRef((t,e)=>m.createElement(Jt,{ref:e,...t,weights:AW}));DT.displayName="CopyIcon";const uh=DT,$T=m.forwardRef((t,e)=>m.createElement(Jt,{ref:e,...t,weights:TW}));$T.displayName="DotsThreeIcon";const JW=$T,jT=m.forwardRef((t,e)=>m.createElement(Jt,{ref:e,...t,weights:IW}));jT.displayName="FolderOpenIcon";const eq=jT,FT=m.forwardRef((t,e)=>m.createElement(Jt,{ref:e,...t,weights:MW}));FT.displayName="FolderSimpleIcon";const tq=FT,VT=m.forwardRef((t,e)=>m.createElement(Jt,{ref:e,...t,weights:OW}));VT.displayName="MagnifyingGlassIcon";const nq=VT,HT=m.forwardRef((t,e)=>m.createElement(Jt,{ref:e,...t,weights:LW}));HT.displayName="PencilSimpleIcon";const zT=HT,BT=m.forwardRef((t,e)=>m.createElement(Jt,{ref:e,...t,weights:NW}));BT.displayName="PushPinIcon";const F2=BT,UT=m.forwardRef((t,e)=>m.createElement(Jt,{ref:e,...t,weights:DW}));UT.displayName="SidebarSimpleIcon";const rq=UT,ZT=m.forwardRef((t,e)=>m.createElement(Jt,{ref:e,...t,weights:$W}));ZT.displayName="SignInIcon";const sq=ZT,WT=m.forwardRef((t,e)=>m.createElement(Jt,{ref:e,...t,weights:jW}));WT.displayName="SignOutIcon";const iq=WT,qT=m.forwardRef((t,e)=>m.createElement(Jt,{ref:e,...t,weights:FW}));qT.displayName="SparkleIcon";const Dy=qT,GT=m.forwardRef((t,e)=>m.createElement(Jt,{ref:e,...t,weights:VW}));GT.displayName="SquaresFourIcon";const oq=GT,KT=m.forwardRef((t,e)=>m.createElement(Jt,{ref:e,...t,weights:HW}));KT.displayName="SwatchesIcon";const YT=KT,XT=m.forwardRef((t,e)=>m.createElement(Jt,{ref:e,...t,weights:zW}));XT.displayName="TrashIcon";const QT=XT,JT=m.forwardRef((t,e)=>m.createElement(Jt,{ref:e,...t,weights:BW}));JT.displayName="UserIcon";const aq=JT,eI=m.forwardRef((t,e)=>m.createElement(Jt,{ref:e,...t,weights:UW}));eI.displayName="XIcon";const tI=eI,nI=m.forwardRef((t,e)=>m.createElement(Jt,{ref:e,...t,weights:ZW}));nI.displayName="XLogoIcon";const lq=nI,cq="/assets/arena-Db0j1set.png",uq="data:image/svg+xml,%3csvg%20width='38'%20height='42'%20viewBox='0%200%2038%2042'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2543_2)'%3e%3cmask%20id='mask0_2543_2'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='38'%20height='42'%3e%3cpath%20d='M0%200H38V42H0V0Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_2543_2)'%3e%3cpath%20d='M19.025%2011.898C22.321%2011.898%2024.995%209.237%2024.995%205.949C24.995%202.661%2022.324%200%2019.025%200C15.726%200%2013.055%202.662%2013.055%205.95C13.055%209.237%2015.726%2011.898%2019.025%2011.898ZM19.025%2041.945C22.321%2041.945%2024.995%2039.283%2024.995%2035.995C24.995%2032.708%2022.324%2030.046%2019.025%2030.046C15.726%2030.046%2013.055%2032.708%2013.055%2035.996C13.055%2039.283%2015.726%2041.945%2019.025%2041.945ZM5.97%2019.41C9.266%2019.41%2011.94%2016.748%2011.94%2013.46C11.94%2010.173%209.268%207.511%205.97%207.511C2.67%207.511%200%2010.175%200%2013.463C0%2016.752%202.67%2019.413%205.97%2019.413V19.41ZM32.08%2034.434C35.376%2034.434%2038.05%2031.772%2038.05%2028.484C38.05%2025.197%2035.379%2022.535%2032.08%2022.535C28.781%2022.535%2026.11%2025.197%2026.11%2028.485C26.11%2031.772%2028.781%2034.434%2032.08%2034.434ZM32.08%2019.41C35.376%2019.41%2038.05%2016.748%2038.05%2013.46C38.05%2010.174%2035.379%207.512%2032.08%207.512C28.781%207.512%2026.11%2010.174%2026.11%2013.461C26.11%2016.748%2028.781%2019.41%2032.08%2019.41ZM5.97%2034.433C9.266%2034.433%2011.94%2031.771%2011.94%2028.483C11.94%2025.196%209.268%2022.535%205.97%2022.535C2.67%2022.535%200%2025.202%200%2028.486C0%2031.771%202.67%2034.436%205.97%2034.436V34.433Z'%20fill='white'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2543_2'%3e%3crect%20width='38'%20height='42'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";function rI(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=rI(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function sI(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=rI(t))&&(r&&(r+=" "),r+=e);return r}const dq=(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},fq=(t,e)=>({classGroupId:t,validator:e}),iI=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Ym="-",HE=[],hq="arbitrary..",pq=t=>{const e=gq(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return mq(o);const l=o.split(Ym),u=l[0]===""&&l.length>1?1:0;return oI(l,u,e)},getConflictingClassGroupIds:(o,l)=>{if(l){const u=r[o],d=n[o];return u?d?dq(d,u):u:d||HE}return n[o]||HE}}},oI=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const d=oI(t,e+1,i);if(d)return d}const o=n.validators;if(o===null)return;const l=e===0?t.join(Ym):t.slice(e).join(Ym),u=o.length;for(let d=0;d<u;d++){const f=o[d];if(f.validator(l))return f.classGroupId}},mq=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?hq+r:void 0})(),gq=t=>{const{theme:e,classGroups:n}=t;return vq(n,e)},vq=(t,e)=>{const n=iI();for(const r in t){const s=t[r];Bx(s,n,r,e)}return n},Bx=(t,e,n,r)=>{const s=t.length;for(let i=0;i<s;i++){const o=t[i];yq(o,e,n,r)}},yq=(t,e,n,r)=>{if(typeof t=="string"){_q(t,e,n);return}if(typeof t=="function"){wq(t,e,n,r);return}xq(t,e,n,r)},_q=(t,e,n)=>{const r=t===""?e:aI(e,t);r.classGroupId=n},wq=(t,e,n,r)=>{if(bq(t)){Bx(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(fq(n,t))},xq=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let o=0;o<i;o++){const[l,u]=s[o];Bx(u,aI(e,l),n,r)}},aI=(t,e)=>{let n=t;const r=e.split(Ym),s=r.length;for(let i=0;i<s;i++){const o=r[i];let l=n.nextPart.get(o);l||(l=iI(),n.nextPart.set(o,l)),n=l}return n},bq=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,Sq=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const s=(i,o)=>{n[i]=o,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(i){let o=n[i];if(o!==void 0)return o;if((o=r[i])!==void 0)return s(i,o),o},set(i,o){i in n?n[i]=o:s(i,o)}}},V2="!",zE=":",kq=[],BE=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),Eq=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let o=0,l=0,u=0,d;const f=s.length;for(let _=0;_<f;_++){const x=s[_];if(o===0&&l===0){if(x===zE){i.push(s.slice(u,_)),u=_+1;continue}if(x==="/"){d=_;continue}}x==="["?o++:x==="]"?o--:x==="("?l++:x===")"&&l--}const p=i.length===0?s:s.slice(u);let g=p,v=!1;p.endsWith(V2)?(g=p.slice(0,-1),v=!0):p.startsWith(V2)&&(g=p.slice(1),v=!0);const w=d&&d>u?d-u:void 0;return BE(i,v,g,w)};if(e){const s=e+zE,i=r;r=o=>o.startsWith(s)?i(o.slice(s.length)):BE(kq,!1,o,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},Cq=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let i=0;i<n.length;i++){const o=n[i],l=o[0]==="[",u=e.has(o);l||u?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(o)):s.push(o)}return s.length>0&&(s.sort(),r.push(...s)),r}},Pq=t=>({cache:Sq(t.cacheSize),parseClassName:Eq(t),sortModifiers:Cq(t),postfixLookupClassGroupIds:Rq(t),...pq(t)}),Rq=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},Aq=/\s+/,Tq=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:o}=e,l=[],u=t.trim().split(Aq);let d="";for(let f=u.length-1;f>=0;f-=1){const p=u[f],{isExternal:g,modifiers:v,hasImportantModifier:w,baseClassName:_,maybePostfixModifierPosition:x}=n(p);if(g){d=p+(d.length>0?" "+d:d);continue}let b=!!x,E;if(b){const M=_.substring(0,x);E=r(M);const T=E&&o[E]?r(_):void 0;T&&T!==E&&(E=T,b=!1)}else E=r(_);if(!E){if(!b){d=p+(d.length>0?" "+d:d);continue}if(E=r(_),!E){d=p+(d.length>0?" "+d:d);continue}b=!1}const C=v.length===0?"":v.length===1?v[0]:i(v).join(":"),R=w?C+V2:C,A=R+E;if(l.indexOf(A)>-1)continue;l.push(A);const I=s(E,b);for(let M=0;M<I.length;++M){const T=I[M];l.push(R+T)}d=p+(d.length>0?" "+d:d)}return d},Iq=(...t)=>{let e=0,n,r,s="";for(;e<t.length;)(n=t[e++])&&(r=lI(n))&&(s&&(s+=" "),s+=r);return s},lI=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=lI(t[r]))&&(n&&(n+=" "),n+=e);return n},Mq=(t,...e)=>{let n,r,s,i;const o=u=>{const d=e.reduce((f,p)=>p(f),t());return n=Pq(d),r=n.cache.get,s=n.cache.set,i=l,l(u)},l=u=>{const d=r(u);if(d)return d;const f=Tq(u,n);return s(u,f),f};return i=o,(...u)=>i(Iq(...u))},Oq=[],Zn=t=>{const e=n=>n[t]||Oq;return e.isThemeGetter=!0,e.themeKey=t,e},cI=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,uI=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Lq=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Nq=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Dq=/\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$/,$q=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,jq=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Fq=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fa=t=>Lq.test(t),ft=t=>!!t&&!Number.isNaN(Number(t)),Ei=t=>!!t&&Number.isInteger(Number(t)),$y=t=>t.endsWith("%")&&ft(t.slice(0,-1)),fo=t=>Nq.test(t),dI=()=>!0,Vq=t=>Dq.test(t)&&!$q.test(t),Ux=()=>!1,Hq=t=>jq.test(t),zq=t=>Fq.test(t),Bq=t=>!Me(t)&&!De(t),Uq=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)),Zq=t=>Xa(t,pI,Ux),Me=t=>cI.test(t),Cl=t=>Xa(t,mI,Vq),UE=t=>Xa(t,Jq,ft),Wq=t=>Xa(t,vI,dI),qq=t=>Xa(t,gI,Ux),ZE=t=>Xa(t,fI,Ux),Gq=t=>Xa(t,hI,zq),x0=t=>Xa(t,yI,Hq),De=t=>uI.test(t),pf=t=>pc(t,mI),Kq=t=>pc(t,gI),WE=t=>pc(t,fI),Yq=t=>pc(t,pI),Xq=t=>pc(t,hI),b0=t=>pc(t,yI,!0),Qq=t=>pc(t,vI,!0),Xa=(t,e,n)=>{const r=cI.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},pc=(t,e,n=!1)=>{const r=uI.exec(t);return r?r[1]?e(r[1]):n:!1},fI=t=>t==="position"||t==="percentage",hI=t=>t==="image"||t==="url",pI=t=>t==="length"||t==="size"||t==="bg-size",mI=t=>t==="length",Jq=t=>t==="number",gI=t=>t==="family-name",vI=t=>t==="number"||t==="weight",yI=t=>t==="shadow",eG=()=>{const t=Zn("color"),e=Zn("font"),n=Zn("text"),r=Zn("font-weight"),s=Zn("tracking"),i=Zn("leading"),o=Zn("breakpoint"),l=Zn("container"),u=Zn("spacing"),d=Zn("radius"),f=Zn("shadow"),p=Zn("inset-shadow"),g=Zn("text-shadow"),v=Zn("drop-shadow"),w=Zn("blur"),_=Zn("perspective"),x=Zn("aspect"),b=Zn("ease"),E=Zn("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...R(),De,Me],I=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],T=()=>[De,Me,u],L=()=>[fa,"full","auto",...T()],D=()=>[Ei,"none","subgrid",De,Me],j=()=>["auto",{span:["full",Ei,De,Me]},Ei,De,Me],H=()=>[Ei,"auto",De,Me],Y=()=>["auto","min","max","fr",De,Me],U=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],z=()=>["start","end","center","stretch","center-safe","end-safe"],Z=()=>["auto",...T()],Q=()=>[fa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],B=()=>[l,fa,"screen","full","dvw","lvw","svw","min","max","fit",...T()],ee=()=>[fa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],W=()=>[t,De,Me],N=()=>[...R(),WE,ZE,{position:[De,Me]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],oe=()=>["auto","cover","contain",Yq,Zq,{size:[De,Me]}],re=()=>[$y,pf,Cl],se=()=>["","none","full",d,De,Me],fe=()=>["",ft,pf,Cl],_e=()=>["solid","dashed","dotted","double"],de=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>[ft,$y,WE,ZE],Oe=()=>["","none",w,De,Me],ke=()=>["none",ft,De,Me],Ge=()=>["none",ft,De,Me],vt=()=>[ft,De,Me],It=()=>[fa,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[fo],breakpoint:[fo],color:[dI],container:[fo],"drop-shadow":[fo],ease:["in","out","in-out"],font:[Bq],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[fo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[fo],shadow:[fo],spacing:["px",ft],text:[fo],"text-shadow":[fo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",fa,Me,De,x]}],container:["container"],"container-type":[{"@container":["","normal","size",De,Me]}],"container-named":[Uq],columns:[{columns:[ft,"auto",Me,De,l]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:A()}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{"inset-s":L(),start:L()}],end:[{"inset-e":L(),end:L()}],"inset-bs":[{"inset-bs":L()}],"inset-be":[{"inset-be":L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[Ei,"auto",De,Me]}],basis:[{basis:[fa,"full","auto",l,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ft,fa,"auto","initial","none",Me]}],grow:[{grow:["",ft,De,Me]}],shrink:[{shrink:["",ft,De,Me]}],order:[{order:[Ei,"first","last","none",De,Me]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":H()}],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":H()}],"row-end":[{"row-end":H()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Y()}],"auto-rows":[{"auto-rows":Y()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...U(),"normal"]}],"justify-items":[{"justify-items":[...z(),"normal"]}],"justify-self":[{"justify-self":["auto",...z()]}],"align-content":[{content:["normal",...U()]}],"align-items":[{items:[...z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...z(),{baseline:["","last"]}]}],"place-content":[{"place-content":U()}],"place-items":[{"place-items":[...z(),"baseline"]}],"place-self":[{"place-self":["auto",...z()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:Z()}],mx:[{mx:Z()}],my:[{my:Z()}],ms:[{ms:Z()}],me:[{me:Z()}],mbs:[{mbs:Z()}],mbe:[{mbe:Z()}],mt:[{mt:Z()}],mr:[{mr:Z()}],mb:[{mb:Z()}],ml:[{ml:Z()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:Q()}],"inline-size":[{inline:["auto",...B()]}],"min-inline-size":[{"min-inline":["auto",...B()]}],"max-inline-size":[{"max-inline":["none",...B()]}],"block-size":[{block:["auto",...ee()]}],"min-block-size":[{"min-block":["auto",...ee()]}],"max-block-size":[{"max-block":["none",...ee()]}],w:[{w:[l,"screen",...Q()]}],"min-w":[{"min-w":[l,"screen","none",...Q()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...Q()]}],h:[{h:["screen","lh",...Q()]}],"min-h":[{"min-h":["screen","lh","none",...Q()]}],"max-h":[{"max-h":["screen","lh","none",...Q()]}],"font-size":[{text:["base",n,pf,Cl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Qq,Wq]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$y,Me]}],"font-family":[{font:[Kq,qq,e]}],"font-features":[{"font-features":[Me]}],"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,De,Me]}],"line-clamp":[{"line-clamp":[ft,"none",De,UE]}],leading:[{leading:["none",i,...T()]}],"list-image":[{"list-image":["none",De,Me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",De,Me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:W()}],"text-color":[{text:W()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[..._e(),"wavy"]}],"text-decoration-thickness":[{decoration:[ft,"from-font","auto",De,Cl]}],"text-decoration-color":[{decoration:W()}],"underline-offset":[{"underline-offset":[ft,"auto",De,Me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"tab-size":[{tab:[Ei,De,Me]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",De,Me]}],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",De,Me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ei,De,Me],radial:["",De,Me],conic:["",Ei,De,Me]},Xq,Gq]}],"bg-color":[{bg:W()}],"gradient-from-pos":[{from:re()}],"gradient-via-pos":[{via:re()}],"gradient-to-pos":[{to:re()}],"gradient-from":[{from:W()}],"gradient-via":[{via:W()}],"gradient-to":[{to:W()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:fe()}],"border-w-x":[{"border-x":fe()}],"border-w-y":[{"border-y":fe()}],"border-w-s":[{"border-s":fe()}],"border-w-e":[{"border-e":fe()}],"border-w-bs":[{"border-bs":fe()}],"border-w-be":[{"border-be":fe()}],"border-w-t":[{"border-t":fe()}],"border-w-r":[{"border-r":fe()}],"border-w-b":[{"border-b":fe()}],"border-w-l":[{"border-l":fe()}],"divide-x":[{"divide-x":fe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":fe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[..._e(),"hidden","none"]}],"divide-style":[{divide:[..._e(),"hidden","none"]}],"border-color":[{border:W()}],"border-color-x":[{"border-x":W()}],"border-color-y":[{"border-y":W()}],"border-color-s":[{"border-s":W()}],"border-color-e":[{"border-e":W()}],"border-color-bs":[{"border-bs":W()}],"border-color-be":[{"border-be":W()}],"border-color-t":[{"border-t":W()}],"border-color-r":[{"border-r":W()}],"border-color-b":[{"border-b":W()}],"border-color-l":[{"border-l":W()}],"divide-color":[{divide:W()}],"outline-style":[{outline:[..._e(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ft,De,Me]}],"outline-w":[{outline:["",ft,pf,Cl]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","inner","none",f,b0,x0]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",p,b0,x0]}],"inset-shadow-color":[{"inset-shadow":W()}],"ring-w":[{ring:fe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:W()}],"ring-offset-w":[{"ring-offset":[ft,Cl]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":fe()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",g,b0,x0]}],"text-shadow-color":[{"text-shadow":W()}],opacity:[{opacity:[ft,De,Me]}],"mix-blend":[{"mix-blend":[...de(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":de()}],"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":[ft]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":W()}],"mask-image-linear-to-color":[{"mask-linear-to":W()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":W()}],"mask-image-t-to-color":[{"mask-t-to":W()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":W()}],"mask-image-r-to-color":[{"mask-r-to":W()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":W()}],"mask-image-b-to-color":[{"mask-b-to":W()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":W()}],"mask-image-l-to-color":[{"mask-l-to":W()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":W()}],"mask-image-x-to-color":[{"mask-x-to":W()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":W()}],"mask-image-y-to-color":[{"mask-y-to":W()}],"mask-image-radial":[{"mask-radial":[De,Me]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":W()}],"mask-image-radial-to-color":[{"mask-radial-to":W()}],"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":R()}],"mask-image-conic-pos":[{"mask-conic":[ft]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":W()}],"mask-image-conic-to-color":[{"mask-conic-to":W()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",De,Me]}],filter:[{filter:["","none",De,Me]}],blur:[{blur:Oe()}],brightness:[{brightness:[ft,De,Me]}],contrast:[{contrast:[ft,De,Me]}],"drop-shadow":[{"drop-shadow":["","none",v,b0,x0]}],"drop-shadow-color":[{"drop-shadow":W()}],grayscale:[{grayscale:["",ft,De,Me]}],"hue-rotate":[{"hue-rotate":[ft,De,Me]}],invert:[{invert:["",ft,De,Me]}],saturate:[{saturate:[ft,De,Me]}],sepia:[{sepia:["",ft,De,Me]}],"backdrop-filter":[{"backdrop-filter":["","none",De,Me]}],"backdrop-blur":[{"backdrop-blur":Oe()}],"backdrop-brightness":[{"backdrop-brightness":[ft,De,Me]}],"backdrop-contrast":[{"backdrop-contrast":[ft,De,Me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ft,De,Me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ft,De,Me]}],"backdrop-invert":[{"backdrop-invert":["",ft,De,Me]}],"backdrop-opacity":[{"backdrop-opacity":[ft,De,Me]}],"backdrop-saturate":[{"backdrop-saturate":[ft,De,Me]}],"backdrop-sepia":[{"backdrop-sepia":["",ft,De,Me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",De,Me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ft,"initial",De,Me]}],ease:[{ease:["linear","initial",b,De,Me]}],delay:[{delay:[ft,De,Me]}],animate:[{animate:["none",E,De,Me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,De,Me]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:ke()}],"rotate-x":[{"rotate-x":ke()}],"rotate-y":[{"rotate-y":ke()}],"rotate-z":[{"rotate-z":ke()}],scale:[{scale:Ge()}],"scale-x":[{"scale-x":Ge()}],"scale-y":[{"scale-y":Ge()}],"scale-z":[{"scale-z":Ge()}],"scale-3d":["scale-3d"],skew:[{skew:vt()}],"skew-x":[{"skew-x":vt()}],"skew-y":[{"skew-y":vt()}],transform:[{transform:[De,Me,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:It()}],"translate-x":[{"translate-x":It()}],"translate-y":[{"translate-y":It()}],"translate-z":[{"translate-z":It()}],"translate-none":["translate-none"],zoom:[{zoom:[Ei,De,Me]}],accent:[{accent:W()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:W()}],"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",De,Me]}],"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":W()}],"scrollbar-track-color":[{"scrollbar-track":W()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",De,Me]}],fill:[{fill:["none",...W()]}],"stroke-w":[{stroke:[ft,pf,Cl,UE]}],stroke:[{stroke:["none",...W()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},tG=Mq(eG);function zt(...t){return tG(sI(t))}const tm=({provider:t,className:e})=>{if(t==="x")return S.jsx(lq,{className:zt("h-6 w-6",e),"aria-hidden":"true"});if(t==="pinterest")return S.jsx("svg",{viewBox:"0 0 24 24",className:zt("h-6 w-6",e),"aria-hidden":"true",children:S.jsx("path",{fill:"currentColor",d:"M12 0C5.373 0 0 5.372 0 12c0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.781c0-1.669.967-2.915 2.171-2.915 1.024 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.132 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.137.893 2.739.098.119.112.223.083.344-.091.379-.293 1.194-.333 1.361-.052.22-.174.266-.401.16-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.36-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146A12.004 12.004 0 0 0 12 24c6.627 0 12-5.373 12-12C24 5.372 18.627 0 12 0z"})});const n=t==="cosmos"?uq:cq;return S.jsx("span",{"aria-hidden":"true",className:zt("h-6 w-6",t==="cosmos"?"bg-current":"bg-[#b1b1b1]",e),style:{WebkitMaskImage:`url("${n}")`,maskImage:`url("${n}")`,WebkitMaskSize:"contain",maskSize:"contain",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center"}})};var Dt;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const i={};for(const o of s)i[o]=o;return i},t.getValidEnumValues=s=>{const i=t.objectKeys(s).filter(l=>typeof s[s[l]]!="number"),o={};for(const l of i)o[l]=s[l];return t.objectValues(o)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},t.find=(s,i)=>{for(const o of s)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(Dt||(Dt={}));var qE;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(qE||(qE={}));const He=Dt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ga=t=>{switch(typeof t){case"undefined":return He.undefined;case"string":return He.string;case"number":return Number.isNaN(t)?He.nan:He.number;case"boolean":return He.boolean;case"function":return He.function;case"bigint":return He.bigint;case"symbol":return He.symbol;case"object":return Array.isArray(t)?He.array:t===null?He.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?He.promise:typeof Map<"u"&&t instanceof Map?He.map:typeof Set<"u"&&t instanceof Set?He.set:typeof Date<"u"&&t instanceof Date?He.date:He.object;default:return He.unknown}},Se=Dt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Lo extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(i){return i.message},r={_errors:[]},s=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let l=r,u=0;for(;u<o.path.length;){const d=o.path[u];u===o.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(n(o))):l[d]=l[d]||{_errors:[]},l=l[d],u++}}};return s(this),r}static assert(e){if(!(e instanceof Lo))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Dt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];n[i]=n[i]||[],n[i].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Lo.create=t=>new Lo(t);const H2=(t,e)=>{let n;switch(t.code){case Se.invalid_type:t.received===He.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Se.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Dt.jsonStringifyReplacer)}`;break;case Se.unrecognized_keys:n=`Unrecognized key(s) in object: ${Dt.joinValues(t.keys,", ")}`;break;case Se.invalid_union:n="Invalid input";break;case Se.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Dt.joinValues(t.options)}`;break;case Se.invalid_enum_value:n=`Invalid enum value. Expected ${Dt.joinValues(t.options)}, received '${t.received}'`;break;case Se.invalid_arguments:n="Invalid function arguments";break;case Se.invalid_return_type:n="Invalid function return type";break;case Se.invalid_date:n="Invalid date";break;case Se.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Dt.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Se.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case Se.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case Se.custom:n="Invalid input";break;case Se.invalid_intersection_types:n="Intersection results could not be merged";break;case Se.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Se.not_finite:n="Number must be finite";break;default:n=e.defaultError,Dt.assertNever(t)}return{message:n}};let nG=H2;function rG(){return nG}const sG=t=>{const{data:e,path:n,errorMaps:r,issueData:s}=t,i=[...n,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let l="";const u=r.filter(d=>!!d).slice().reverse();for(const d of u)l=d(o,{data:e,defaultError:l}).message;return{...s,path:i,message:l}};function Ie(t,e){const n=rG(),r=sG({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===H2?void 0:H2].filter(s=>!!s)});t.common.issues.push(r)}class Ss{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const s of n){if(s.status==="aborted")return ot;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const s of n){const i=await s.key,o=await s.value;r.push({key:i,value:o})}return Ss.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const s of n){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return ot;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[i.value]=o.value)}return{status:e.value,value:r}}}const ot=Object.freeze({status:"aborted"}),xf=t=>({status:"dirty",value:t}),qs=t=>({status:"valid",value:t}),GE=t=>t.status==="aborted",KE=t=>t.status==="dirty",Yu=t=>t.status==="valid",Xm=t=>typeof Promise<"u"&&t instanceof Promise;var Be;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Be||(Be={}));class za{constructor(e,n,r,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const YE=(t,e)=>{if(Yu(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Lo(t.common.issues);return this._error=n,this._error}}};function gt(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:s}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,l)=>{const{message:u}=t;return o.code==="invalid_enum_value"?{message:u??l.defaultError}:typeof l.data>"u"?{message:u??r??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:u??n??l.defaultError}},description:s}}class Tt{get description(){return this._def.description}_getType(e){return ga(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:ga(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ss,ctx:{common:e.parent.common,data:e.data,parsedType:ga(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Xm(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ga(e)},s=this._parseSync({data:e,path:r.path,parent:r});return YE(r,s)}"~validate"(e){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ga(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return Yu(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(s=(r=i==null?void 0:i.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>Yu(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ga(e)},s=this._parse({data:e,path:r.path,parent:r}),i=await(Xm(s)?s:Promise.resolve(s));return YE(r,i)}refine(e,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,i)=>{const o=e(s),l=()=>i.addIssue({code:Se.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(e,n){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(e){return new Qu({schema:this,typeName:at.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return La.create(this,this._def)}nullable(){return Ju.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return zi.create(this)}promise(){return tg.create(this,this._def)}or(e){return Jm.create([this,e],this._def)}and(e){return eg.create(this,e,this._def)}transform(e){return new Qu({...gt(this._def),schema:this,typeName:at.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new B2({...gt(this._def),innerType:this,defaultValue:n,typeName:at.ZodDefault})}brand(){return new PG({typeName:at.ZodBranded,type:this,...gt(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new U2({...gt(this._def),innerType:this,catchValue:n,typeName:at.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Zx.create(this,e)}readonly(){return Z2.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const iG=/^c[^\s-]{8,}$/i,oG=/^[0-9a-z]+$/,aG=/^[0-9A-HJKMNP-TV-Z]{26}$/i,lG=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,cG=/^[a-z0-9_-]{21}$/i,uG=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,dG=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,fG=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hG="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let jy;const pG=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,mG=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,gG=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,vG=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,yG=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,_G=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,_I="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",wG=new RegExp(`^${_I}$`);function wI(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function xG(t){return new RegExp(`^${wI(t)}$`)}function bG(t){let e=`${_I}T${wI(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function SG(t,e){return!!((e==="v4"||!e)&&pG.test(t)||(e==="v6"||!e)&&gG.test(t))}function kG(t,e){if(!uG.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function EG(t,e){return!!((e==="v4"||!e)&&mG.test(t)||(e==="v6"||!e)&&vG.test(t))}class Aa extends Tt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==He.string){const i=this._getOrReturnCtx(e);return Ie(i,{code:Se.invalid_type,expected:He.string,received:i.parsedType}),ot}const r=new Ss;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),Ie(s,{code:Se.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),Ie(s,{code:Se.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,l=e.data.length<i.value;(o||l)&&(s=this._getOrReturnCtx(e,s),o?Ie(s,{code:Se.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&Ie(s,{code:Se.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")fG.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"email",code:Se.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")jy||(jy=new RegExp(hG,"u")),jy.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"emoji",code:Se.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")lG.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"uuid",code:Se.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")cG.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"nanoid",code:Se.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")iG.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"cuid",code:Se.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")oG.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"cuid2",code:Se.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")aG.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"ulid",code:Se.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),Ie(s,{validation:"url",code:Se.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"regex",code:Se.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),Ie(s,{code:Se.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),Ie(s,{code:Se.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),Ie(s,{code:Se.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?bG(i).test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{code:Se.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?wG.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{code:Se.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?xG(i).test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{code:Se.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?dG.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"duration",code:Se.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?SG(e.data,i.version)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"ip",code:Se.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?kG(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"jwt",code:Se.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?EG(e.data,i.version)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"cidr",code:Se.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?yG.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"base64",code:Se.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?_G.test(e.data)||(s=this._getOrReturnCtx(e,s),Ie(s,{validation:"base64url",code:Se.invalid_string,message:i.message}),r.dirty()):Dt.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:Se.invalid_string,...Be.errToObj(r)})}_addCheck(e){return new Aa({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Be.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Be.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Be.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Be.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Be.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Be.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Be.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Be.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Be.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Be.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Be.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Be.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Be.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...Be.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...Be.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Be.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Be.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...Be.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Be.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Be.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Be.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Be.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Be.errToObj(n)})}nonempty(e){return this.min(1,Be.errToObj(e))}trim(){return new Aa({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Aa({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Aa({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Aa.create=t=>new Aa({checks:[],typeName:at.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...gt(t)});function CG(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=n>r?n:r,i=Number.parseInt(t.toFixed(s).replace(".","")),o=Number.parseInt(e.toFixed(s).replace(".",""));return i%o/10**s}class dh extends Tt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==He.number){const i=this._getOrReturnCtx(e);return Ie(i,{code:Se.invalid_type,expected:He.number,received:i.parsedType}),ot}let r;const s=new Ss;for(const i of this._def.checks)i.kind==="int"?Dt.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Ie(r,{code:Se.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),Ie(r,{code:Se.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),Ie(r,{code:Se.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?CG(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),Ie(r,{code:Se.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Ie(r,{code:Se.not_finite,message:i.message}),s.dirty()):Dt.assertNever(i);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Be.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Be.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Be.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Be.toString(n))}setLimit(e,n,r,s){return new dh({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Be.toString(s)}]})}_addCheck(e){return new dh({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Be.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Be.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Be.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Be.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Be.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Be.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Be.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Be.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Be.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Dt.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}dh.create=t=>new dh({checks:[],typeName:at.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...gt(t)});class fh extends Tt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==He.bigint)return this._getInvalidInput(e);let r;const s=new Ss;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),Ie(r,{code:Se.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),Ie(r,{code:Se.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Ie(r,{code:Se.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):Dt.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Ie(n,{code:Se.invalid_type,expected:He.bigint,received:n.parsedType}),ot}gte(e,n){return this.setLimit("min",e,!0,Be.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Be.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Be.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Be.toString(n))}setLimit(e,n,r,s){return new fh({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Be.toString(s)}]})}_addCheck(e){return new fh({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Be.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Be.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Be.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Be.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Be.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}fh.create=t=>new fh({checks:[],typeName:at.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...gt(t)});class XE extends Tt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==He.boolean){const r=this._getOrReturnCtx(e);return Ie(r,{code:Se.invalid_type,expected:He.boolean,received:r.parsedType}),ot}return qs(e.data)}}XE.create=t=>new XE({typeName:at.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...gt(t)});class Qm extends Tt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==He.date){const i=this._getOrReturnCtx(e);return Ie(i,{code:Se.invalid_type,expected:He.date,received:i.parsedType}),ot}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return Ie(i,{code:Se.invalid_date}),ot}const r=new Ss;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),Ie(s,{code:Se.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),Ie(s,{code:Se.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Dt.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Qm({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Be.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Be.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Qm.create=t=>new Qm({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:at.ZodDate,...gt(t)});class QE extends Tt{_parse(e){if(this._getType(e)!==He.symbol){const r=this._getOrReturnCtx(e);return Ie(r,{code:Se.invalid_type,expected:He.symbol,received:r.parsedType}),ot}return qs(e.data)}}QE.create=t=>new QE({typeName:at.ZodSymbol,...gt(t)});class JE extends Tt{_parse(e){if(this._getType(e)!==He.undefined){const r=this._getOrReturnCtx(e);return Ie(r,{code:Se.invalid_type,expected:He.undefined,received:r.parsedType}),ot}return qs(e.data)}}JE.create=t=>new JE({typeName:at.ZodUndefined,...gt(t)});class eC extends Tt{_parse(e){if(this._getType(e)!==He.null){const r=this._getOrReturnCtx(e);return Ie(r,{code:Se.invalid_type,expected:He.null,received:r.parsedType}),ot}return qs(e.data)}}eC.create=t=>new eC({typeName:at.ZodNull,...gt(t)});class tC extends Tt{constructor(){super(...arguments),this._any=!0}_parse(e){return qs(e.data)}}tC.create=t=>new tC({typeName:at.ZodAny,...gt(t)});class nC extends Tt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return qs(e.data)}}nC.create=t=>new nC({typeName:at.ZodUnknown,...gt(t)});class Ba extends Tt{_parse(e){const n=this._getOrReturnCtx(e);return Ie(n,{code:Se.invalid_type,expected:He.never,received:n.parsedType}),ot}}Ba.create=t=>new Ba({typeName:at.ZodNever,...gt(t)});class rC extends Tt{_parse(e){if(this._getType(e)!==He.undefined){const r=this._getOrReturnCtx(e);return Ie(r,{code:Se.invalid_type,expected:He.void,received:r.parsedType}),ot}return qs(e.data)}}rC.create=t=>new rC({typeName:at.ZodVoid,...gt(t)});class zi extends Tt{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==He.array)return Ie(n,{code:Se.invalid_type,expected:He.array,received:n.parsedType}),ot;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,l=n.data.length<s.exactLength.value;(o||l)&&(Ie(n,{code:o?Se.too_big:Se.too_small,minimum:l?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(Ie(n,{code:Se.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(Ie(n,{code:Se.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,l)=>s.type._parseAsync(new za(n,o,n.path,l)))).then(o=>Ss.mergeArray(r,o));const i=[...n.data].map((o,l)=>s.type._parseSync(new za(n,o,n.path,l)));return Ss.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new zi({...this._def,minLength:{value:e,message:Be.toString(n)}})}max(e,n){return new zi({...this._def,maxLength:{value:e,message:Be.toString(n)}})}length(e,n){return new zi({...this._def,exactLength:{value:e,message:Be.toString(n)}})}nonempty(e){return this.min(1,e)}}zi.create=(t,e)=>new zi({type:t,minLength:null,maxLength:null,exactLength:null,typeName:at.ZodArray,...gt(e)});function cu(t){if(t instanceof Fn){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=La.create(cu(r))}return new Fn({...t._def,shape:()=>e})}else return t instanceof zi?new zi({...t._def,type:cu(t.element)}):t instanceof La?La.create(cu(t.unwrap())):t instanceof Ju?Ju.create(cu(t.unwrap())):t instanceof lc?lc.create(t.items.map(e=>cu(e))):t}class Fn extends Tt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Dt.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==He.object){const d=this._getOrReturnCtx(e);return Ie(d,{code:Se.invalid_type,expected:He.object,received:d.parsedType}),ot}const{status:r,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof Ba&&this._def.unknownKeys==="strip"))for(const d in s.data)o.includes(d)||l.push(d);const u=[];for(const d of o){const f=i[d],p=s.data[d];u.push({key:{status:"valid",value:d},value:f._parse(new za(s,p,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof Ba){const d=this._def.unknownKeys;if(d==="passthrough")for(const f of l)u.push({key:{status:"valid",value:f},value:{status:"valid",value:s.data[f]}});else if(d==="strict")l.length>0&&(Ie(s,{code:Se.unrecognized_keys,keys:l}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const f of l){const p=s.data[f];u.push({key:{status:"valid",value:f},value:d._parse(new za(s,p,s.path,f)),alwaysSet:f in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const d=[];for(const f of u){const p=await f.key,g=await f.value;d.push({key:p,value:g,alwaysSet:f.alwaysSet})}return d}).then(d=>Ss.mergeObjectSync(r,d)):Ss.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(e){return Be.errToObj,new Fn({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,o;const s=((o=(i=this._def).errorMap)==null?void 0:o.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Be.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new Fn({...this._def,unknownKeys:"strip"})}passthrough(){return new Fn({...this._def,unknownKeys:"passthrough"})}extend(e){return new Fn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Fn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:at.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Fn({...this._def,catchall:e})}pick(e){const n={};for(const r of Dt.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Fn({...this._def,shape:()=>n})}omit(e){const n={};for(const r of Dt.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new Fn({...this._def,shape:()=>n})}deepPartial(){return cu(this)}partial(e){const n={};for(const r of Dt.objectKeys(this.shape)){const s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional()}return new Fn({...this._def,shape:()=>n})}required(e){const n={};for(const r of Dt.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof La;)i=i._def.innerType;n[r]=i}return new Fn({...this._def,shape:()=>n})}keyof(){return xI(Dt.objectKeys(this.shape))}}Fn.create=(t,e)=>new Fn({shape:()=>t,unknownKeys:"strip",catchall:Ba.create(),typeName:at.ZodObject,...gt(e)});Fn.strictCreate=(t,e)=>new Fn({shape:()=>t,unknownKeys:"strict",catchall:Ba.create(),typeName:at.ZodObject,...gt(e)});Fn.lazycreate=(t,e)=>new Fn({shape:t,unknownKeys:"strip",catchall:Ba.create(),typeName:at.ZodObject,...gt(e)});class Jm extends Tt{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function s(i){for(const l of i)if(l.result.status==="valid")return l.result;for(const l of i)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const o=i.map(l=>new Lo(l.ctx.common.issues));return Ie(n,{code:Se.invalid_union,unionErrors:o}),ot}if(n.common.async)return Promise.all(r.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let i;const o=[];for(const u of r){const d={...n,common:{...n.common,issues:[]},parent:null},f=u._parseSync({data:n.data,path:n.path,parent:d});if(f.status==="valid")return f;f.status==="dirty"&&!i&&(i={result:f,ctx:d}),d.common.issues.length&&o.push(d.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const l=o.map(u=>new Lo(u));return Ie(n,{code:Se.invalid_union,unionErrors:l}),ot}}get options(){return this._def.options}}Jm.create=(t,e)=>new Jm({options:t,typeName:at.ZodUnion,...gt(e)});function z2(t,e){const n=ga(t),r=ga(e);if(t===e)return{valid:!0,data:t};if(n===He.object&&r===He.object){const s=Dt.objectKeys(e),i=Dt.objectKeys(t).filter(l=>s.indexOf(l)!==-1),o={...t,...e};for(const l of i){const u=z2(t[l],e[l]);if(!u.valid)return{valid:!1};o[l]=u.data}return{valid:!0,data:o}}else if(n===He.array&&r===He.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let i=0;i<t.length;i++){const o=t[i],l=e[i],u=z2(o,l);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return n===He.date&&r===He.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class eg extends Tt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(i,o)=>{if(GE(i)||GE(o))return ot;const l=z2(i.value,o.value);return l.valid?((KE(i)||KE(o))&&n.dirty(),{status:n.value,value:l.data}):(Ie(r,{code:Se.invalid_intersection_types}),ot)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}eg.create=(t,e,n)=>new eg({left:t,right:e,typeName:at.ZodIntersection,...gt(n)});class lc extends Tt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==He.array)return Ie(r,{code:Se.invalid_type,expected:He.array,received:r.parsedType}),ot;if(r.data.length<this._def.items.length)return Ie(r,{code:Se.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ot;!this._def.rest&&r.data.length>this._def.items.length&&(Ie(r,{code:Se.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((o,l)=>{const u=this._def.items[l]||this._def.rest;return u?u._parse(new za(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>Ss.mergeArray(n,o)):Ss.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new lc({...this._def,rest:e})}}lc.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new lc({items:t,typeName:at.ZodTuple,rest:null,...gt(e)})};class sC extends Tt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==He.map)return Ie(r,{code:Se.invalid_type,expected:He.map,received:r.parsedType}),ot;const s=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([l,u],d)=>({key:s._parse(new za(r,l,r.path,[d,"key"])),value:i._parse(new za(r,u,r.path,[d,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const u of o){const d=await u.key,f=await u.value;if(d.status==="aborted"||f.status==="aborted")return ot;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(d.value,f.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const u of o){const d=u.key,f=u.value;if(d.status==="aborted"||f.status==="aborted")return ot;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(d.value,f.value)}return{status:n.value,value:l}}}}sC.create=(t,e,n)=>new sC({valueType:e,keyType:t,typeName:at.ZodMap,...gt(n)});class hh extends Tt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==He.set)return Ie(r,{code:Se.invalid_type,expected:He.set,received:r.parsedType}),ot;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(Ie(r,{code:Se.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(Ie(r,{code:Se.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const i=this._def.valueType;function o(u){const d=new Set;for(const f of u){if(f.status==="aborted")return ot;f.status==="dirty"&&n.dirty(),d.add(f.value)}return{status:n.value,value:d}}const l=[...r.data.values()].map((u,d)=>i._parse(new za(r,u,r.path,d)));return r.common.async?Promise.all(l).then(u=>o(u)):o(l)}min(e,n){return new hh({...this._def,minSize:{value:e,message:Be.toString(n)}})}max(e,n){return new hh({...this._def,maxSize:{value:e,message:Be.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}hh.create=(t,e)=>new hh({valueType:t,minSize:null,maxSize:null,typeName:at.ZodSet,...gt(e)});class iC extends Tt{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}iC.create=(t,e)=>new iC({getter:t,typeName:at.ZodLazy,...gt(e)});class oC extends Tt{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Ie(n,{received:n.data,code:Se.invalid_literal,expected:this._def.value}),ot}return{status:"valid",value:e.data}}get value(){return this._def.value}}oC.create=(t,e)=>new oC({value:t,typeName:at.ZodLiteral,...gt(e)});function xI(t,e){return new Xu({values:t,typeName:at.ZodEnum,...gt(e)})}class Xu extends Tt{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Ie(n,{expected:Dt.joinValues(r),received:n.parsedType,code:Se.invalid_type}),ot}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return Ie(n,{received:n.data,code:Se.invalid_enum_value,options:r}),ot}return qs(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Xu.create(e,{...this._def,...n})}exclude(e,n=this._def){return Xu.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Xu.create=xI;class aC extends Tt{_parse(e){const n=Dt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==He.string&&r.parsedType!==He.number){const s=Dt.objectValues(n);return Ie(r,{expected:Dt.joinValues(s),received:r.parsedType,code:Se.invalid_type}),ot}if(this._cache||(this._cache=new Set(Dt.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=Dt.objectValues(n);return Ie(r,{received:r.data,code:Se.invalid_enum_value,options:s}),ot}return qs(e.data)}get enum(){return this._def.values}}aC.create=(t,e)=>new aC({values:t,typeName:at.ZodNativeEnum,...gt(e)});class tg extends Tt{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==He.promise&&n.common.async===!1)return Ie(n,{code:Se.invalid_type,expected:He.promise,received:n.parsedType}),ot;const r=n.parsedType===He.promise?n.data:Promise.resolve(n.data);return qs(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}tg.create=(t,e)=>new tg({type:t,typeName:at.ZodPromise,...gt(e)});class Qu extends Tt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===at.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:o=>{Ie(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const o=s.transform(r.data,i);if(r.common.async)return Promise.resolve(o).then(async l=>{if(n.value==="aborted")return ot;const u=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return u.status==="aborted"?ot:u.status==="dirty"||n.value==="dirty"?xf(u.value):u});{if(n.value==="aborted")return ot;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?ot:l.status==="dirty"||n.value==="dirty"?xf(l.value):l}}if(s.type==="refinement"){const o=l=>{const u=s.refinement(l,i);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?ot:(l.status==="dirty"&&n.dirty(),o(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?ot:(l.status==="dirty"&&n.dirty(),o(l.value).then(()=>({status:n.value,value:l.value}))))}if(s.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Yu(o))return ot;const l=s.transform(o.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Yu(o)?Promise.resolve(s.transform(o.value,i)).then(l=>({status:n.value,value:l})):ot);Dt.assertNever(s)}}Qu.create=(t,e,n)=>new Qu({schema:t,typeName:at.ZodEffects,effect:e,...gt(n)});Qu.createWithPreprocess=(t,e,n)=>new Qu({schema:e,effect:{type:"preprocess",transform:t},typeName:at.ZodEffects,...gt(n)});class La extends Tt{_parse(e){return this._getType(e)===He.undefined?qs(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}La.create=(t,e)=>new La({innerType:t,typeName:at.ZodOptional,...gt(e)});class Ju extends Tt{_parse(e){return this._getType(e)===He.null?qs(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ju.create=(t,e)=>new Ju({innerType:t,typeName:at.ZodNullable,...gt(e)});class B2 extends Tt{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===He.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}B2.create=(t,e)=>new B2({innerType:t,typeName:at.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...gt(e)});class U2 extends Tt{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Xm(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Lo(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Lo(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}U2.create=(t,e)=>new U2({innerType:t,typeName:at.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...gt(e)});class lC extends Tt{_parse(e){if(this._getType(e)!==He.nan){const r=this._getOrReturnCtx(e);return Ie(r,{code:Se.invalid_type,expected:He.nan,received:r.parsedType}),ot}return{status:"valid",value:e.data}}}lC.create=t=>new lC({typeName:at.ZodNaN,...gt(t)});class PG extends Tt{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Zx extends Tt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?ot:i.status==="dirty"?(n.dirty(),xf(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?ot:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,n){return new Zx({in:e,out:n,typeName:at.ZodPipeline})}}class Z2 extends Tt{_parse(e){const n=this._def.innerType._parse(e),r=s=>(Yu(s)&&(s.value=Object.freeze(s.value)),s);return Xm(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}Z2.create=(t,e)=>new Z2({innerType:t,typeName:at.ZodReadonly,...gt(e)});var at;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(at||(at={}));const bf=Aa.create;Ba.create;zi.create;const bI=Fn.create;Jm.create;eg.create;lc.create;const RG=Xu.create;tg.create;La.create;Ju.create;const AG=bI({hash:bf().regex(/^[a-f0-9]{64}$/),mimeType:RG(["image/png","image/jpeg","image/webp","image/gif","image/avif"])}),TG=bI({id:bf().min(1),title:bf().trim().min(1),url:bf().url().refine(t=>{try{const e=new URL(t);return["http:","https:"].includes(e.protocol)&&!e.username&&!e.password}catch{return!1}}).optional(),reason:bf().optional(),image:AG.optional().catch(void 0)}).refine(t=>!!(t.url||t.image),{message:"A reference requires a public URL or an image"}),IG=(...t)=>{const e=[],n=new Set,r=new Set;for(const s of t.flatMap(i=>i??[])){const i=TG.safeParse(s);if(!i.success)continue;const o=i.data,l=o.url?new URL(o.url).href:void 0;if(n.has(o.id)||l&&r.has(l)){const u=e.find(d=>d.url===l&&(l!==void 0||d.id===o.id));u&&!u.image&&o.image&&(u.id===o.id||!n.has(o.id))&&(u.id=o.id,u.image=o.image,n.add(o.id));continue}e.push({...o,...l?{url:l}:{}}),n.add(o.id),l&&r.add(l)}return e.length?e:void 0},MG=t=>{const e=new URL(t).hostname.replace(/^www\./,"");return e==="are.na"?"arena":e==="pinterest.com"||e==="pin.it"?"pinterest":e==="x.com"?"x":e==="cosmos.so"?"cosmos":null},OG=({reference:t,imageUrl:e,onOpen:n})=>{const[r,s]=m.useState(!1),i=!!e&&!r,o=t.url?MG(t.url):null,l=t.url??(i?e:void 0),u=l?"a":"span",d=i&&t.url?new URL(t.url).hostname:t.title;return S.jsxs(u,{href:l,target:l?"_blank":void 0,rel:l?"noopener noreferrer":void 0,"aria-label":t.title,onPointerDown:f=>f.stopPropagation(),onKeyDown:f=>{(f.key!=="ArrowUp"&&f.key!=="ArrowDown"||f.altKey||f.ctrlKey||f.metaKey||f.shiftKey)&&f.stopPropagation()},onClick:f=>{f.stopPropagation(),l&&n()},className:zt("border-main-border bg-main-input text-content hover:border-content-muted/50 flex max-w-full min-w-0 shrink-0 items-center gap-1.5 overflow-hidden rounded-md border pr-1.5 text-xs focus-visible:outline-2 focus-visible:-outline-offset-2",!i&&"py-1.5 pl-2"),children:[i?S.jsx("img",{src:e,alt:"",className:"h-8 w-12 shrink-0 object-contain",width:48,height:32,onError:()=>s(!0)}):null,o&&(i||o==="cosmos")?S.jsx(tm,{provider:o,className:zt("h-3.5 w-3.5 shrink-0",o==="pinterest"&&"text-[#e60023]")}):null,!i||!o?S.jsx("span",{className:"max-w-40 truncate",children:d}):null]})},LG=({references:t,source:e,sessionId:n,variantId:r,projectPath:s,className:i})=>{const o=Vo(),l=IG(t);return l?S.jsx("div",{className:zt("ph-no-capture flex min-w-0 flex-nowrap gap-1.5 overflow-x-auto pr-3 pb-2",i),"aria-label":"References",children:l.map(u=>{var p;const d=s?`?${new URLSearchParams({projectPath:s})}`:"",f=u.image&&n&&r?`/api/variants/${encodeURIComponent(n)}/${encodeURIComponent(r)}/references/${encodeURIComponent(u.id)}/image${d}`:void 0;return S.jsx(OG,{reference:u,imageUrl:f,onOpen:()=>o==null?void 0:o.capture("preview_reference_opened",{variant_source:e,reference_count:l.length})},`${u.id}:${((p=u.image)==null?void 0:p.hash)??""}:${f??""}`)})}):null},Rie=t=>{const e=t.pathname.split("/").filter(Boolean).map(decodeURIComponent),n=e[3];if(e[2]!=="projects"||!n)return{kind:"library"};const r=e[4]==="variants"?e[5]:void 0,s=e[4]==="variants"?e[6]:void 0,i=new URLSearchParams(t.search);return r&&s&&i.get("edit")!=="1"?{kind:"preview",projectId:n,sessionId:r,variantId:s}:{kind:"workspace",projectId:n,sessionId:r,variantId:s}},Aie=t=>{if(t.kind==="library"||!t.projectId)return"/rivet/library";const e=`/rivet/library/projects/${encodeURIComponent(t.projectId)}`;return t.sessionId&&t.variantId?`${e}/variants/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${t.kind==="workspace"?"?edit=1":""}`:e},NG=t=>{const e=new URLSearchParams(t),n=e.get("historySession"),r=e.get("historyVariant");return n&&r?{sessionId:n,variantId:r}:null},cC=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,uC=sI,DG=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return uC(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=e,o=Object.keys(s).map(d=>{const f=n==null?void 0:n[d],p=i==null?void 0:i[d];if(f===null)return null;const g=cC(f)||cC(p);return s[d][g]}),l=n&&Object.entries(n).reduce((d,f)=>{let[p,g]=f;return g===void 0||(d[p]=g),d},{}),u=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,f)=>{let{class:p,className:g,...v}=f;return Object.entries(v).every(w=>{let[_,x]=w;return Array.isArray(x)?x.includes({...i,...l}[_]):{...i,...l}[_]===x})?[...d,p,g]:d},[]);return uC(t,o,u,n==null?void 0:n.class,n==null?void 0:n.className)},SI={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"}},kI=m.createContext(null);function Zh(){const t=m.useContext(kI);return t?t.classes:SI.pill}function $G(t){const e=document.documentElement;e.classList.add("transitioning"),e.offsetHeight,t(),setTimeout(()=>e.classList.remove("transitioning"),200)}function jG({children:t,defaultShape:e="pill"}){const[n,r]=m.useState(e),s=m.useCallback(i=>{$G(()=>r(i))},[]);return S.jsx(kI.Provider,{value:{shape:n,setShape:s,classes:SI[n]},children:t})}const FG=DG(["group/button relative isolate inline-flex cursor-pointer items-center justify-center outline-none","transition-colors duration-80 motion-reduce:transition-none","disabled:pointer-events-none disabled:opacity-50","focus-visible:ring-1 focus-visible:ring-[color:var(--focus-ring,#6B97FF)]"],{variants:{variant:{primary:"text-background",secondary:"text-foreground",tertiary:"text-foreground",ghost:"text-muted-foreground hover:text-foreground aria-expanded:text-foreground aria-pressed:text-foreground"},size:{default:"h-9 gap-1.5 px-4 text-[13px]",compact:"h-7 gap-1 px-3 text-[12px]",icon:"h-9 w-9 p-0 [&_svg]:h-4 [&_svg]:w-4","icon-compact":"h-7 w-7 p-0 [&_svg]:h-3.5 [&_svg]:w-3.5"},iconLeft:{true:""},iconRight:{true:""}},compoundVariants:[{size:"compact",iconLeft:!0,className:"pl-2"},{size:"default",iconLeft:!0,className:"pl-3"},{size:"compact",iconRight:!0,className:"pr-2"},{size:"default",iconRight:!0,className:"pr-3"}],defaultVariants:{variant:"secondary",size:"default"}}),dC={default:16,compact:14},VG={primary:"[--btn-bg:var(--foreground)] group-hover/button:[--btn-bg:color-mix(in_oklab,var(--foreground)_90%,var(--background))] group-active/button:[--btn-bg:color-mix(in_oklab,var(--foreground)_80%,var(--background))] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--btn-bg)] group-active/button:shadow-[0_0_0_0px_var(--btn-bg)]",secondary:"[--btn-bg:var(--accent)] group-hover/button:[--btn-bg:color-mix(in_oklab,var(--accent)_80%,var(--background))] group-active/button:[--btn-bg:var(--accent)] bg-[var(--btn-bg)] shadow-[0_0_0_1px_var(--btn-bg)] group-active/button:shadow-[0_0_0_0px_var(--btn-bg)]",tertiary:"bg-transparent shadow-[0_0_0_1px_var(--border),inset_0_0_0_0px_var(--border)] group-hover/button:bg-hover group-active/button:bg-active group-active/button:shadow-[0_0_0_0px_var(--border),inset_0_0_0_1px_var(--border)]",ghost:"bg-transparent shadow-[0_0_0_1px_transparent] group-hover/button:bg-hover group-hover/button:shadow-[0_0_0_1px_var(--hover)] group-active/button:bg-active group-active/button:shadow-[0_0_0_0px_var(--active)] group-aria-expanded/button:bg-active group-aria-expanded/button:shadow-[0_0_0_0px_var(--active)] group-aria-pressed/button:bg-active group-aria-pressed/button:shadow-[0_0_0_0px_var(--active)]"},EI=m.forwardRef(({className:t,variant:e,size:n,isLoading:r=!1,leadingIcon:s,trailingIcon:i,disabled:o,children:l,type:u="button",...d},f)=>{const p=e??"secondary",g=n??"default",v=g==="icon"||g==="icon-compact",w=g==="compact"||g==="icon-compact",_=w?dC.compact:dC.default,x=Zh();return S.jsxs("button",{...d,ref:f,type:u,disabled:o||r,"aria-busy":r||d["aria-busy"],className:zt(FG({variant:p,size:g,iconLeft:!v&&!!s,iconRight:!v&&!!i}),x.button,t),children:[S.jsx("span",{"aria-hidden":!0,className:zt("absolute inset-px rounded-[inherit] transition-[box-shadow,background-color] [transition-duration:180ms,80ms] [transition-timing-function:cubic-bezier(0.23,1,0.32,1),ease] group-active/button:[transition-duration:80ms,80ms] motion-reduce:transition-none",VG[p])}),S.jsxs("span",{className:"relative inline-flex items-center justify-center gap-[inherit]",children:[S.jsxs("span",{className:zt("inline-flex items-center justify-center gap-[inherit]",r&&"opacity-0"),children:[s&&!v?S.jsx(s,{size:_,strokeWidth:1.5,"aria-hidden":!0}):null,S.jsx("span",{className:"[text-box:trim-both_cap_alphabetic]",children:l}),i&&!v?S.jsx(i,{size:_,strokeWidth:1.5,"aria-hidden":!0}):null]}),r?S.jsx("span",{"aria-hidden":!0,className:"absolute inset-0 flex items-center justify-center",children:S.jsx("svg",{className:w?"h-7 w-7":"h-9 w-9",viewBox:"0 0 24 24",fill:"none",children:S.jsx("path",{d:"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",stroke:"currentColor",strokeWidth:"1.125",strokeLinecap:"round",pathLength:"100",className:"motion-safe:animate-[spinner-move_2s_linear_infinite,spinner-dash_4s_ease-in-out_infinite]",style:{strokeDasharray:"15 85"}})})}):null]})]})});EI.displayName="Button";var HG=Object.defineProperty,fd=(t,e)=>HG(t,"name",{value:e,configurable:!0}),CI=!!(typeof window<"u"&&window.document&&window.document.createElement);function an(t,e,{checkForDefaultPrevented:n=!0}={}){return fd(function(s){if(t==null||t(s),n===!1||!s||!s.defaultPrevented)return e==null?void 0:e(s)},"handleEvent")}fd(an,"composeEventHandlers");function zG(t){var e;if(!CI)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}fd(zG,"getOwnerWindow");function W2(t){if(!CI)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}fd(W2,"getOwnerDocument");function PI(t,e=!1){const{activeElement:n}=W2(t);if(!(n!=null&&n.nodeName))return null;if(RI(n)&&n.contentDocument)return PI(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const s=W2(n).getElementById(r);if(s)return s}}return n}fd(PI,"getActiveElement");function RI(t){return t.tagName==="IFRAME"}fd(RI,"isFrame");var BG=Object.defineProperty,Wx=(t,e)=>BG(t,"name",{value:e,configurable:!0});function q2(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Wx(q2,"setRef");function AI(...t){return e=>{let n=!1;const r=t.map(s=>{const i=q2(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():q2(t[s],null)}}}}Wx(AI,"composeRefs");function cn(...t){return m.useCallback(AI(...t),t)}Wx(cn,"useComposedRefs");var UG=Object.defineProperty,Hs=(t,e)=>UG(t,"name",{value:e,configurable:!0});function ZG(t,e){const n=m.createContext(e);n.displayName=t+"Context";const r=Hs(i=>{const{children:o,...l}=i,u=m.useMemo(()=>l,Object.values(l));return S.jsx(n.Provider,{value:u,children:o})},"Provider");r.displayName=t+"Provider";function s(i,o={}){const{optional:l=!1}=o,u=m.useContext(n);if(u)return u;if(e!==void 0)return e;if(!l)throw new Error(`\`${i}\` must be used within \`${t}\``)}return Hs(s,"useContext"),[r,s]}Hs(ZG,"createContext");function Gi(t,e=[]){let n=[];function r(i,o){const l=m.createContext(o);l.displayName=i+"Context";const u=n.length;n=[...n,o];const d=Hs(p=>{var b;const{scope:g,children:v,...w}=p,_=((b=g==null?void 0:g[t])==null?void 0:b[u])||l,x=m.useMemo(()=>w,Object.values(w));return S.jsx(_.Provider,{value:x,children:v})},"Provider");d.displayName=i+"Provider";function f(p,g,v={}){var b;const{optional:w=!1}=v,_=((b=g==null?void 0:g[t])==null?void 0:b[u])||l,x=m.useContext(_);if(x)return x;if(o!==void 0)return o;if(!w)throw new Error(`\`${p}\` must be used within \`${i}\``)}return Hs(f,"useContext"),[d,f]}Hs(r,"createContext");const s=Hs(()=>{const i=n.map(o=>m.createContext(o));return Hs(function(l){const u=(l==null?void 0:l[t])||i;return m.useMemo(()=>({[`__scope${t}`]:{...l,[t]:u}}),[l,u])},"useScope")},"createScope");return s.scopeName=t,[r,TI(s,...e)]}Hs(Gi,"createContextScope");function TI(...t){const e=t[0];if(t.length===1)return e;const n=Hs(()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return Hs(function(i){const o=r.reduce((l,{useScope:u,scopeName:d})=>{const p=u(i)[`__scope${d}`];return{...l,...p}},{});return m.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}Hs(TI,"composeContextScopes");var WG=Object.defineProperty,vi=(t,e)=>WG(t,"name",{value:e,configurable:!0});function Ua(t){const e=m.forwardRef((n,r)=>{let{children:s,...i}=n,o=null,l=!1;const u=[];G2(s)&&typeof S0=="function"&&(s=S0(s._payload)),m.Children.forEach(s,g=>{var v;if(NI(g)){l=!0;const w=g;let _="child"in w.props?w.props.child:w.props.children;G2(_)&&typeof S0=="function"&&(_=S0(_._payload)),o=qG(w,_),u.push((v=o==null?void 0:o.props)==null?void 0:v.children)}else u.push(g)}),o?o=m.cloneElement(o,void 0,u):!l&&m.Children.count(s)===1&&m.isValidElement(s)&&(o=s);const d=o?LI(o):void 0,f=cn(r,d);if(!o){if(s||s===0)throw new Error(l?YG(t):KG(t));return s}const p=OI(i,o.props??{});return o.type!==m.Fragment&&(p.ref=r?f:d),m.cloneElement(o,p)});return e.displayName=`${t}.Slot`,e}vi(Ua,"createSlot");var II=Symbol.for("radix.slottable");function MI(t){const e=vi(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=II,e}vi(MI,"createSlottable");var qG=vi((t,e)=>{if("child"in t.props){const n=t.props.child;return m.isValidElement(n)?m.cloneElement(n,void 0,t.props.children(n.props.children)):null}return m.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function OI(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...l)=>{const u=i(...l);return s(...l),u}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}vi(OI,"mergeProps");function LI(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)}vi(LI,"getElementRef");function NI(t){return m.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===II}vi(NI,"isSlottable");var GG=Symbol.for("react.lazy");function G2(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===GG&&"_payload"in t&&DI(t._payload)}vi(G2,"isLazyComponent");function DI(t){return typeof t=="object"&&t!==null&&"then"in t}vi(DI,"isPromiseLike");var KG=vi(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),YG=vi(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),S0=Dh[" use ".trim().toString()],XG=Object.defineProperty,QG=(t,e)=>XG(t,"name",{value:e,configurable:!0}),JG=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],In=JG.reduce((t,e)=>{const n=Ua(`Primitive.${e}`),r=m.forwardRef((s,i)=>{const{asChild:o,...l}=s,u=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(u,{...l,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function $I(t,e){t&&Uh.flushSync(()=>t.dispatchEvent(e))}QG($I,"dispatchDiscreteCustomEvent");var eK=Object.defineProperty,tK=(t,e)=>eK(t,"name",{value:e,configurable:!0});function cc(t){const e=m.useRef(t);return m.useEffect(()=>{e.current=t}),m.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}tK(cc,"useCallbackRef");var nK=Object.defineProperty,nr=(t,e)=>nK(t,"name",{value:e,configurable:!0}),K2="dismissableLayer.update",rK="dismissableLayer.pointerDownOutside",sK="dismissableLayer.focusOutside",fC,jI=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),qx=m.forwardRef(nr(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:u,onDismiss:d,...f}=e,p=m.useContext(jI),[g,v]=m.useState(null),w=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,_]=m.useState({}),x=cn(n,v),b=Array.from(p.layers),[E]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),C=E?b.indexOf(E):-1,R=g?b.indexOf(g):-1,A=p.layersWithOutsidePointerEventsDisabled.size>0,I=R>=C,M=m.useRef(!1),T=VI(H=>{o==null||o(H),u==null||u(H),H.defaultPrevented||d==null||d()},{ownerDocument:w,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:M,dismissableSurfaces:p.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(H=>{if(!(H instanceof Node))return!1;const Y=[...p.branches].some(U=>U.contains(H));return I&&!Y},[p.branches,I])}),L=HI(H=>{if(s&&M.current)return;const Y=H.target;[...p.branches].some(z=>z.contains(Y))||(l==null||l(H),u==null||u(H),H.defaultPrevented||d==null||d())},w),D=g?R===b.length-1:!1,j=cc(H=>{H.key==="Escape"&&(i==null||i(H),!H.defaultPrevented&&d&&(H.preventDefault(),d()))});return m.useEffect(()=>{if(D)return w.addEventListener("keydown",j,{capture:!0}),()=>w.removeEventListener("keydown",j,{capture:!0})},[w,D,j]),m.useEffect(()=>{if(g)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(fC=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(g)),p.layers.add(g),Y2(),()=>{r&&(p.layersWithOutsidePointerEventsDisabled.delete(g),p.layersWithOutsidePointerEventsDisabled.size===0&&(w.body.style.pointerEvents=fC))}},[g,w,r,p]),m.useEffect(()=>()=>{g&&(p.layers.delete(g),p.layersWithOutsidePointerEventsDisabled.delete(g),Y2())},[g,p]),m.useEffect(()=>{const H=nr(()=>_({}),"handleUpdate");return document.addEventListener(K2,H),()=>document.removeEventListener(K2,H)},[]),S.jsx(In.div,{...f,ref:x,style:{pointerEvents:A?I?"auto":"none":void 0,...e.style},onFocusCapture:an(e.onFocusCapture,L.onFocusCapture),onBlurCapture:an(e.onBlurCapture,L.onBlurCapture),onPointerDownCapture:an(e.onPointerDownCapture,T.onPointerDownCapture)})},"DismissableLayer"));function FI(){const t=m.useContext(jI),[e,n]=m.useState(null);return m.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}nr(FI,"useDismissableLayerSurface");var iK=nr(()=>!0,"IS_TRUE");function VI(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:o=iK}=e,l=cc(t),u=m.useRef(!1),d=m.useRef(!1),f=m.useRef(new Map),p=m.useRef(()=>{});return m.useEffect(()=>{function g(){d.current=!1,s.current=!1,f.current.clear()}nr(g,"resetOutsideInteraction");function v(){return Array.from(f.current.values()).some(Boolean)}nr(v,"isOutsideInteractionIntercepted");function w(C){if(!d.current)return;const R=C.target;R instanceof Node&&[...i].some(I=>I.contains(R))||f.current.set(C.type,!0),C.type==="click"&&window.setTimeout(()=>{d.current&&p.current()},0)}nr(w,"handleInteractionCapture");function _(C){d.current&&f.current.set(C.type,!1)}nr(_,"handleInteractionBubble");const x=nr(C=>{if(C.target&&!u.current){let R=function(){n.removeEventListener("click",p.current);const I=v();g(),I||Gx(rK,l,A,{discrete:!0})};if(nr(R,"handleAndDispatchPointerDownOutsideEvent"),!o(C.target)){n.removeEventListener("click",p.current),g(),u.current=!1;return}const A={originalEvent:C};d.current=!0,s.current=r&&C.button===0,f.current.clear(),!r||C.button!==0?R():(n.removeEventListener("click",p.current),p.current=R,n.addEventListener("click",p.current,{once:!0}))}else n.removeEventListener("click",p.current),g();u.current=!1},"handlePointerDown"),b=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const C of b)n.addEventListener(C,w,!0),n.addEventListener(C,_);const E=window.setTimeout(()=>{n.addEventListener("pointerdown",x)},0);return()=>{window.clearTimeout(E),n.removeEventListener("pointerdown",x),n.removeEventListener("click",p.current);for(const C of b)n.removeEventListener(C,w,!0),n.removeEventListener(C,_)}},[n,l,r,s,i,o]),{onPointerDownCapture:nr(()=>u.current=!0,"onPointerDownCapture")}}nr(VI,"usePointerDownOutside");function HI(t,e=globalThis==null?void 0:globalThis.document){const n=cc(t),r=m.useRef(!1);return m.useEffect(()=>{const s=nr(i=>{i.target&&!r.current&&Gx(sK,n,{originalEvent:i},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:nr(()=>r.current=!0,"onFocusCapture"),onBlurCapture:nr(()=>r.current=!1,"onBlurCapture")}}nr(HI,"useFocusOutside");function Y2(){const t=new CustomEvent(K2);document.dispatchEvent(t)}nr(Y2,"dispatchUpdate");function Gx(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?$I(s,i):s.dispatchEvent(i)}nr(Gx,"handleAndDispatchCustomEvent");var Kr=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},oK=Object.defineProperty,aK=(t,e)=>oK(t,"name",{value:e,configurable:!0}),lK=Dh[" useId ".trim().toString()]||(()=>{}),cK=0;function Na(t){const[e,n]=m.useState(lK());return Kr(()=>{t||n(r=>r??String(cK++))},[t]),t||(e?`radix-${e}`:"")}aK(Na,"useId");const uK=["top","right","bottom","left"],Za=Math.min,To=Math.max,ng=Math.round,k0=Math.floor,Io=t=>({x:t,y:t}),dK={left:"right",right:"left",bottom:"top",top:"bottom"};function zI(t,e,n){return To(t,Za(e,n))}function No(t,e){return typeof t=="function"?t(e):t}function Wa(t){return t.split("-")[0]}function hd(t){return t.split("-")[1]}function Kx(t){return t==="x"?"y":"x"}function Yx(t){return t==="y"?"height":"width"}function Fi(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Xx(t){return Kx(Fi(t))}function fK(t,e,n){n===void 0&&(n=!1);const r=hd(t),s=Xx(t),i=Yx(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=rg(o)),[o,rg(o)]}function hK(t){const e=rg(t);return[X2(t),e,X2(e)]}function X2(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const hC=["left","right"],pC=["right","left"],pK=["top","bottom"],mK=["bottom","top"];function gK(t,e,n){switch(t){case"top":case"bottom":return n?e?pC:hC:e?hC:pC;case"left":case"right":return e?pK:mK;default:return[]}}function vK(t,e,n,r){const s=hd(t);let i=gK(Wa(t),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(X2)))),i}function rg(t){const e=Wa(t);return dK[e]+t.slice(e.length)}function yK(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 BI(t){return typeof t!="number"?yK(t):{top:t,right:t,bottom:t,left:t}}function sg(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 mC(t,e,n){let{reference:r,floating:s}=t;const i=Fi(e),o=Xx(e),l=Yx(o),u=Wa(e),d=i==="y",f=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,g=r[l]/2-s[l]/2;let v;switch(u){case"top":v={x:f,y:r.y-s.height};break;case"bottom":v={x:f,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:p};break;case"left":v={x:r.x-s.width,y:p};break;default:v={x:r.x,y:r.y}}const w=hd(e);return w&&(v[o]+=g*(w==="end"?1:-1)*(n&&d?-1:1)),v}async function _K(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:o,elements:l,strategy:u}=t,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:g=!1,padding:v=0}=No(e,t),w=BI(v),x=l[g?p==="floating"?"reference":"floating":p],b=sg(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:f,strategy:u})),E=p==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),R=await(i.isElement==null?void 0:i.isElement(C))&&await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1},A=sg(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:E,offsetParent:C,strategy:u}):E);return{top:(b.top-A.top+w.top)/R.y,bottom:(A.bottom-b.bottom+w.bottom)/R.y,left:(b.left-A.left+w.left)/R.x,right:(A.right-b.right+w.right)/R.x}}const wK=50,xK=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:_K},u=await(o.isRTL==null?void 0:o.isRTL(e));let d=await o.getElementRects({reference:t,floating:e,strategy:s}),{x:f,y:p}=mC(d,r,u),g=r,v=0;const w={};for(let _=0;_<i.length;_++){const x=i[_];if(!x)continue;const{name:b,fn:E}=x,{x:C,y:R,data:A,reset:I}=await E({x:f,y:p,initialPlacement:r,placement:g,strategy:s,middlewareData:w,rects:d,platform:l,elements:{reference:t,floating:e}});f=C??f,p=R??p,w[b]={...w[b],...A},I&&v<wK&&(v++,typeof I=="object"&&(I.placement&&(g=I.placement),I.rects&&(d=I.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:s}):I.rects),{x:f,y:p}=mC(d,g,u)),_=-1)}return{x:f,y:p,placement:g,strategy:s,middlewareData:w}},bK=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:o,elements:l,middlewareData:u}=e,{element:d,padding:f=0}=No(t,e)||{};if(d==null)return{};const p=BI(f),g={x:n,y:r},v=Xx(s),w=Yx(v),_=await o.getDimensions(d),x=v==="y",b=x?"top":"left",E=x?"bottom":"right",C=x?"clientHeight":"clientWidth",R=i.reference[w]+i.reference[v]-g[v]-i.floating[w],A=g[v]-i.reference[v],I=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let M=I?I[C]:0;(!M||!await(o.isElement==null?void 0:o.isElement(I)))&&(M=l.floating[C]||i.floating[w]);const T=R/2-A/2,L=M/2-_[w]/2-1,D=Za(p[b],L),j=Za(p[E],L),H=M-_[w]-j,Y=M/2-_[w]/2+T,U=zI(D,Y,H),z=!u.arrow&&hd(s)!=null&&Y!==U&&i.reference[w]/2-(Y<D?D:j)-_[w]/2<0,Z=z?Y<D?Y-D:Y-H:0;return{[v]:g[v]+Z,data:{[v]:U,centerOffset:Y-U-Z,...z&&{alignmentOffset:Z}},reset:z}}}),SK=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:l,platform:u,elements:d}=e,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:_=!0,...x}=No(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=Wa(s),E=Fi(l),C=Wa(l)===l,R=await(u.isRTL==null?void 0:u.isRTL(d.floating)),A=g||(C||!_?[rg(l)]:hK(l)),I=w!=="none";!g&&I&&A.push(...vK(l,_,w,R));const M=[l,...A],T=await u.detectOverflow(e,x),L=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&L.push(T[b]),p){const U=fK(s,o,R);L.push(T[U[0]],T[U[1]])}if(D=[...D,{placement:s,overflows:L}],!L.every(U=>U<=0)){var j,H;const U=(((j=i.flip)==null?void 0:j.index)||0)+1,z=M[U];if(z&&(!(p==="alignment"?E!==Fi(z):!1)||D.every(B=>Fi(B.placement)===E?B.overflows[0]>0:!0)))return{data:{index:U,overflows:D},reset:{placement:z}};let Z=(H=D.filter(Q=>Q.overflows[0]<=0).sort((Q,B)=>Q.overflows[1]-B.overflows[1])[0])==null?void 0:H.placement;if(!Z)switch(v){case"bestFit":{var Y;const Q=(Y=D.filter(B=>{if(I){const ee=Fi(B.placement);return ee===E||ee==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(ee=>ee>0).reduce((ee,W)=>ee+W,0)]).sort((B,ee)=>B[1]-ee[1])[0])==null?void 0:Y[0];Q&&(Z=Q);break}case"initialPlacement":Z=l;break}if(s!==Z)return{reset:{placement:Z}}}return{}}}};function gC(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function vC(t){return uK.some(e=>t[e]>=0)}const kK=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:s="referenceHidden",...i}=No(t,e);switch(s){case"referenceHidden":{const o=await r.detectOverflow(e,{...i,elementContext:"reference"}),l=gC(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:vC(l)}}}case"escaped":{const o=await r.detectOverflow(e,{...i,altBoundary:!0}),l=gC(o,n.floating);return{data:{escapedOffsets:l,escaped:vC(l)}}}default:return{}}}}},UI=new Set(["left","top"]);async function EK(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=Wa(n),l=hd(n),u=Fi(n)==="y",d=UI.has(o)?-1:1,f=i&&u?-1:1,p=No(e,t);let{mainAxis:g,crossAxis:v,alignmentAxis:w}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof w=="number"&&(v=l==="end"?w*-1:w),u?{x:v*f,y:g*d}:{x:g*d,y:v*f}}const CK=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:o,middlewareData:l}=e,u=await EK(e,t);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+u.x,y:i+u.y,data:{...u,placement:o}}}}},PK=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:s,platform:i}=e,{mainAxis:o=!0,crossAxis:l=!1,limiter:u={fn:E=>{let{x:C,y:R}=E;return{x:C,y:R}}},...d}=No(t,e),f={x:n,y:r},p=await i.detectOverflow(e,d),g=Fi(s),v=Kx(g);let w=f[v],_=f[g];const x=(E,C)=>zI(C+p[E==="y"?"top":"left"],C,C-p[E==="y"?"bottom":"right"]);o&&(w=x(v,w)),l&&(_=x(g,_));const b=u.fn({...e,[v]:w,[g]:_});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[v]:o,[g]:l}}}}}},RK=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:s,y:i,placement:o,rects:l,middlewareData:u}=e,{offset:d=0,mainAxis:f=!0,crossAxis:p=!0}=No(t,e),g={x:s,y:i},v=Fi(o),w=Kx(v);let _=g[w],x=g[v];const b=No(d,e),E=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:(n=b.mainAxis)!=null?n:0,crossAxis:(r=b.crossAxis)!=null?r:0};if(f){const A=w==="y"?"height":"width",I=l.reference[w]-l.floating[A]+E.mainAxis,M=l.reference[w]+l.reference[A]-E.mainAxis;_<I?_=I:_>M&&(_=M)}if(p){var C,R;const A=w==="y"?"width":"height",I=UI.has(Wa(o)),M=l.reference[v]-l.floating[A]+(I&&((C=u.offset)==null?void 0:C[v])||0)+(I?0:E.crossAxis),T=l.reference[v]+l.reference[A]+(I?0:((R=u.offset)==null?void 0:R[v])||0)-(I?E.crossAxis:0);x<M?x=M:x>T&&(x=T)}return{[w]:_,[v]:x}}}},AK=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:s,elements:i}=e,{apply:o=()=>{},...l}=No(t,e),u=await s.detectOverflow(e,l),d=Wa(n),f=hd(n),p=Fi(n)==="y",{width:g,height:v}=r.floating;let w,_;d==="top"||d==="bottom"?(w=d,_=f===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(_=d,w=f==="end"?"top":"bottom");const x=v-u.top-u.bottom,b=g-u.left-u.right,E=Za(v-u[w],x),C=Za(g-u[_],b),R=e.middlewareData.shift,A=!R;let I=E,M=C;R!=null&&R.enabled.x&&(M=b),R!=null&&R.enabled.y&&(I=x),A&&!f&&(p?M=g-2*To(u.left,u.right):I=v-2*To(u.top,u.bottom)),await o({...e,availableWidth:M,availableHeight:I});const T=await s.getDimensions(i.floating);return g!==T.width||v!==T.height?{reset:{rects:!0}}:{}}}};function Og(){return typeof window<"u"}function pd(t){return ZI(t)?(t.nodeName||"").toLowerCase():"#document"}function Yr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ho(t){var e;return(e=(ZI(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function ZI(t){return Og()?t instanceof Node||t instanceof Yr(t).Node:!1}function Zi(t){return Og()?t instanceof Element||t instanceof Yr(t).Element:!1}function Qa(t){return Og()?t instanceof HTMLElement||t instanceof Yr(t).HTMLElement:!1}function yC(t){return!Og()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Yr(t).ShadowRoot}function Lg(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=Wi(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&s!=="inline"&&s!=="contents"}function TK(t){return/^(table|td|th)$/.test(pd(t))}function Ng(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const IK=/transform|translate|scale|rotate|perspective|filter/,MK=/paint|layout|strict|content/,Pl=t=>!!t&&t!=="none";let Fy;function Qx(t){const e=Zi(t)?Wi(t):t;return Pl(e.transform)||Pl(e.translate)||Pl(e.scale)||Pl(e.rotate)||Pl(e.perspective)||!Jx()&&(Pl(e.backdropFilter)||Pl(e.filter))||IK.test(e.willChange||"")||MK.test(e.contain||"")}function OK(t){let e=uc(t);for(;Qa(e)&&!ph(e);){if(Qx(e))return e;if(Ng(e))return null;e=uc(e)}return null}function Jx(){return Fy==null&&(Fy=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Fy}function ph(t){return/^(html|body|#document)$/.test(pd(t))}function Wi(t){return Yr(t).getComputedStyle(t)}function Dg(t){return Zi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function uc(t){if(pd(t)==="html")return t;const e=t.assignedSlot||t.parentNode||yC(t)&&t.host||Ho(t);return yC(e)?e.host:e}function WI(t){const e=uc(t);return ph(e)?(t.ownerDocument||t).body:Qa(e)&&Lg(e)?e:WI(e)}function mh(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=WI(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),o=Yr(s);if(i){const l=Q2(o);return e.concat(o,o.visualViewport||[],Lg(s)?s:[],l&&n?mh(l):[])}else return e.concat(s,mh(s,[],n))}function Q2(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function qI(t){const e=Wi(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=Qa(t),i=s?t.offsetWidth:n,o=s?t.offsetHeight:r,l=ng(n)!==i||ng(r)!==o;return l&&(n=i,r=o),{width:n,height:r,$:l}}function eb(t){return Zi(t)?t:t.contextElement}function Su(t){const e=eb(t);if(!Qa(e))return Io(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=qI(e);let o=(i?ng(n.width):n.width)/r,l=(i?ng(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const LK=Io(0);function GI(t){const e=Yr(t);return!Jx()||!e.visualViewport?LK:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function NK(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Yr(t)}function dc(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=eb(t);let o=Io(1);e&&(r?Zi(r)&&(o=Su(r)):o=Su(t));const l=NK(i,n,r)?GI(i):Io(0);let u=(s.left+l.x)/o.x,d=(s.top+l.y)/o.y,f=s.width/o.x,p=s.height/o.y;if(i&&r){const g=Yr(i),v=Zi(r)?Yr(r):r;let w=g,_=Q2(w);for(;_&&v!==w;){const x=Su(_),b=_.getBoundingClientRect(),E=Wi(_),C=b.left+(_.clientLeft+parseFloat(E.paddingLeft))*x.x,R=b.top+(_.clientTop+parseFloat(E.paddingTop))*x.y;u*=x.x,d*=x.y,f*=x.x,p*=x.y,u+=C,d+=R,w=Yr(_),_=Q2(w)}}return sg({width:f,height:p,x:u,y:d})}function $g(t,e){const n=Dg(t).scrollLeft;return e?e.left+n:dc(Ho(t)).left+n}function KI(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-$g(t,n),s=n.top+e.scrollTop;return{x:r,y:s}}function DK(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",o=Ho(r),l=e?Ng(e.floating):!1;if(r===o||l&&i)return n;let u={scrollLeft:0,scrollTop:0},d=Io(1);const f=Io(0),p=Qa(r);if((p||!i)&&((pd(r)!=="body"||Lg(o))&&(u=Dg(r)),p)){const v=dc(r);d=Su(r),f.x=v.x+r.clientLeft,f.y=v.y+r.clientTop}const g=o&&!p&&!i?KI(o,u):Io(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+f.x+g.x,y:n.y*d.y-u.scrollTop*d.y+f.y+g.y}}function $K(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function jK(t){const e=Dg(t),n=t.ownerDocument.body,r=To(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=To(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+$g(t);const o=-e.scrollTop;return Wi(n).direction==="rtl"&&(i+=To(t.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:o}}const FK=25;function VK(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=Yr(t),i=Ho(t),o=s.visualViewport;let l=i.clientWidth,u=i.clientHeight,d=0,f=0;if(o){const g=!Jx()||e==="fixed";r?g||(d=-o.offsetLeft,f=-o.offsetTop):(l=o.width,u=o.height,g&&(d=o.offsetLeft,f=o.offsetTop))}if($g(i)<=0){const g=i.ownerDocument,v=g.body,w=getComputedStyle(v),_=g.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,x=Math.abs(i.clientWidth-v.clientWidth-_),b=getComputedStyle(i).scrollbarGutter==="stable both-edges"?x/2:x;b<=FK&&(l-=b)}return{width:l,height:u,x:d,y:f}}function HK(t,e){const n=dc(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Su(t),o=t.clientWidth*i.x,l=t.clientHeight*i.y,u=s*i.x,d=r*i.y;return{width:o,height:l,x:u,y:d}}function _C(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=VK(t,n,e);else if(e==="document")r=jK(Ho(t));else if(Zi(e))r=HK(e,n);else{const s=GI(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return sg(r)}function zK(t,e){const n=e.get(t);if(n)return n;let r=mh(t,[],!1).filter(l=>Zi(l)&&pd(l)!=="body"),s=null;const i=Wi(t).position==="fixed";let o=i?uc(t):t;for(;Zi(o)&&!ph(o);){const l=Wi(o),u=Qx(o),d=s?s.position:i?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&l.position==="static")?r=r.filter(p=>p!==o):s=l,o=uc(o)}return e.set(t,r),r}function BK(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const o=[...n==="clippingAncestors"?Ng(e)?[]:zK(e,this._c):[].concat(n),r],l=_C(e,o[0],s);let u=l.top,d=l.right,f=l.bottom,p=l.left;for(let g=1;g<o.length;g++){const v=_C(e,o[g],s);u=To(v.top,u),d=Za(v.right,d),f=Za(v.bottom,f),p=To(v.left,p)}return{width:d-p,height:f-u,x:p,y:u}}function UK(t){const{width:e,height:n}=qI(t);return{width:e,height:n}}function ZK(t,e,n){const r=Qa(e),s=Ho(e),i=n==="fixed",o=dc(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const u=Io(0);if((r||!i)&&((pd(e)!=="body"||Lg(s))&&(l=Dg(e)),r)){const g=dc(e,!0,i,e);u.x=g.x+e.clientLeft,u.y=g.y+e.clientTop}!r&&s&&(u.x=$g(s));const d=s&&!r&&!i?KI(s,l):Io(0),f=o.left+l.scrollLeft-u.x-d.x,p=o.top+l.scrollTop-u.y-d.y;return{x:f,y:p,width:o.width,height:o.height}}function Vy(t){return Wi(t).position==="static"}function wC(t,e){if(!Qa(t)||Wi(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Ho(t)===n&&(n=n.ownerDocument.body),n}function YI(t,e){const n=Yr(t);if(Ng(t))return n;if(!Qa(t)){let s=uc(t);for(;s&&!ph(s);){if(Zi(s)&&!Vy(s))return s;s=uc(s)}return n}let r=wC(t,e);for(;r&&TK(r)&&Vy(r);)r=wC(r,e);return r&&ph(r)&&Vy(r)&&!Qx(r)?n:r||OK(t)||n}const WK=async function(t){const e=this.getOffsetParent||YI,n=this.getDimensions,r=await n(t.floating);return{reference:ZK(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function qK(t){return Wi(t).direction==="rtl"}const GK={convertOffsetParentRelativeRectToViewportRelativeRect:DK,getDocumentElement:Ho,getClippingRect:BK,getOffsetParent:YI,getElementRects:WK,getClientRects:$K,getDimensions:UK,getScale:Su,isElement:Zi,isRTL:qK};function XI(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function KK(t,e,n){let r=null,s;const i=Ho(t);function o(){var f;clearTimeout(s),(f=r)==null||f.disconnect(),r=null}function l(f,p){f===void 0&&(f=!1),p===void 0&&(p=1),o();const g=t.getBoundingClientRect(),{left:v,top:w,width:_,height:x}=g;if(f||e(),!_||!x)return;const b=k0(w),E=k0(i.clientWidth-(v+_)),C=k0(i.clientHeight-(w+x)),R=k0(v),I={rootMargin:-b+"px "+-E+"px "+-C+"px "+-R+"px",threshold:To(0,Za(1,p))||1};let M=!0;function T(L){const D=L[0].intersectionRatio;if(!XI(g,t.getBoundingClientRect()))return l();if(D!==p){if(!M)return l();D?l(!1,D):s=setTimeout(()=>{l(!1,1e-7)},1e3)}M=!1}try{r=new IntersectionObserver(T,{...I,root:i.ownerDocument})}catch{r=new IntersectionObserver(T,I)}r.observe(t)}const u=Yr(t),d=()=>l(n);return u.addEventListener("resize",d),l(!0),()=>{u.removeEventListener("resize",d),o()}}function YK(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=eb(t),f=s||i?[...d?mh(d):[],...e?mh(e):[]]:[];f.forEach(b=>{s&&b.addEventListener("scroll",n),i&&b.addEventListener("resize",n)});const p=d&&l?KK(d,n,i):null;let g=-1,v=null;o&&(v=new ResizeObserver(b=>{let[E]=b;E&&E.target===d&&v&&e&&(v.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var C;(C=v)==null||C.observe(e)})),n()}),d&&!u&&v.observe(d),e&&v.observe(e));let w,_=u?dc(t):null;u&&x();function x(){const b=dc(t);_&&!XI(_,b)&&n(),_=b,w=requestAnimationFrame(x)}return n(),()=>{var b;f.forEach(E=>{s&&E.removeEventListener("scroll",n),i&&E.removeEventListener("resize",n)}),p==null||p(),(b=v)==null||b.disconnect(),v=null,u&&cancelAnimationFrame(w)}}const XK=CK,QK=PK,JK=SK,eY=AK,tY=kK,xC=bK,nY=RK,rY=(t,e,n)=>{const r=new Map,s=n??{},i={...GK,...s.platform,_c:r};return xK(t,e,{...s,platform:i})};var sY=typeof document<"u",iY=function(){},nm=sY?m.useLayoutEffect:iY;function ig(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(!ig(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)&&!ig(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function QI(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function bC(t,e){const n=QI(t);return Math.round(e*n)/n}function Hy(t){const e=m.useRef(t);return nm(()=>{e.current=t}),e}function oY(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:u,open:d}=t,[f,p]=m.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[g,v]=m.useState(r);ig(g,r)||v(r);const[w,_]=m.useState(null),[x,b]=m.useState(null),E=m.useCallback(B=>{B!==I.current&&(I.current=B,_(B))},[]),C=m.useCallback(B=>{B!==M.current&&(M.current=B,b(B))},[]),R=i||w,A=o||x,I=m.useRef(null),M=m.useRef(null),T=m.useRef(f),L=u!=null,D=Hy(u),j=Hy(s),H=Hy(d),Y=m.useCallback(()=>{if(!I.current||!M.current)return;const B={placement:e,strategy:n,middleware:g};j.current&&(B.platform=j.current),rY(I.current,M.current,B).then(ee=>{const W={...ee,isPositioned:H.current!==!1};U.current&&!ig(T.current,W)&&(T.current=W,Uh.flushSync(()=>{p(W)}))})},[g,e,n,j,H]);nm(()=>{d===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,p(B=>({...B,isPositioned:!1})))},[d]);const U=m.useRef(!1);nm(()=>(U.current=!0,()=>{U.current=!1}),[]),nm(()=>{if(R&&(I.current=R),A&&(M.current=A),R&&A){if(D.current)return D.current(R,A,Y);Y()}},[R,A,Y,D,L]);const z=m.useMemo(()=>({reference:I,floating:M,setReference:E,setFloating:C}),[E,C]),Z=m.useMemo(()=>({reference:R,floating:A}),[R,A]),Q=m.useMemo(()=>{const B={position:n,left:0,top:0};if(!Z.floating)return B;const ee=bC(Z.floating,f.x),W=bC(Z.floating,f.y);return l?{...B,transform:"translate("+ee+"px, "+W+"px)",...QI(Z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ee,top:W}},[n,l,Z.floating,f.x,f.y]);return m.useMemo(()=>({...f,update:Y,refs:z,elements:Z,floatingStyles:Q}),[f,Y,z,Z,Q])}const aY=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?xC({element:r.current,padding:s}).fn(n):{}:r?xC({element:r,padding:s}).fn(n):{}}}},lY=(t,e)=>{const n=XK(t);return{name:n.name,fn:n.fn,options:[t,e]}},cY=(t,e)=>{const n=QK(t);return{name:n.name,fn:n.fn,options:[t,e]}},uY=(t,e)=>({fn:nY(t).fn,options:[t,e]}),dY=(t,e)=>{const n=JK(t);return{name:n.name,fn:n.fn,options:[t,e]}},fY=(t,e)=>{const n=eY(t);return{name:n.name,fn:n.fn,options:[t,e]}},hY=(t,e)=>{const n=tY(t);return{name:n.name,fn:n.fn,options:[t,e]}},pY=(t,e)=>{const n=aY(t);return{name:n.name,fn:n.fn,options:[t,e]}};var mY=Object.defineProperty,gY=(t,e)=>mY(t,"name",{value:e,configurable:!0});function tb(t){const[e,n]=m.useState(void 0);return Kr(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,l;if("borderBoxSize"in i){const u=i.borderBoxSize,d=Array.isArray(u)?u[0]:u;o=d.inlineSize,l=d.blockSize}else o=t.offsetWidth,l=t.offsetHeight;n({width:o,height:l})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}gY(tb,"useSize");var vY=Object.defineProperty,Da=(t,e)=>vY(t,"name",{value:e,configurable:!0}),JI="Popper",[eM,jg]=Gi(JI),[yY,tM]=eM(JI),_Y=Da(t=>{const{__scopePopper:e,children:n}=t,[r,s]=m.useState(null),[i,o]=m.useState(void 0);return S.jsx(yY,{scope:e,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:o,children:n})},"Popper"),wY="PopperAnchor",xY=m.forwardRef(Da(function(e,n){const{__scopePopper:r,virtualRef:s,...i}=e,o=tM(wY,r),l=m.useRef(null),u=o.onAnchorChange,d=m.useCallback(_=>{l.current=_,_&&u(_)},[u]),f=cn(n,d),p=m.useRef(null);m.useEffect(()=>{if(!s)return;const _=p.current;p.current=s.current,_!==p.current&&u(p.current)});const g=o.placementState&&Fg(o.placementState),v=g==null?void 0:g[0],w=g==null?void 0:g[1];return s?null:S.jsx(In.div,{"data-radix-popper-side":v,"data-radix-popper-align":w,...i,ref:f})},"PopperAnchor")),nM="PopperContent",[bY,Tie]=eM(nM),SY=m.forwardRef(Da(function(e,n){var ae,Oe,ke,Ge,vt,It,Yt;const{__scopePopper:r,side:s="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:g="partial",hideWhenDetached:v=!1,updatePositionStrategy:w="optimized",onPlaced:_,...x}=e,b=tM(nM,r),[E,C]=m.useState(null),R=cn(n,C),[A,I]=m.useState(null),M=tb(A),T=(M==null?void 0:M.width)??0,L=(M==null?void 0:M.height)??0,D=s+(o!=="center"?"-"+o:""),j=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},H=Array.isArray(f)?f:[f],Y=H.length>0,U={padding:j,boundary:H.filter(rM),altBoundary:Y},{refs:z,floatingStyles:Z,placement:Q,isPositioned:B,middlewareData:ee}=oY({strategy:"fixed",placement:D,whileElementsMounted:Da((...wt)=>YK(...wt,{animationFrame:w==="always"}),"whileElementsMounted"),elements:{reference:b.anchor},middleware:[lY({mainAxis:i+L,alignmentAxis:l}),d&&cY({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?uY():void 0,...U}),d&&dY({...U}),fY({...U,apply:Da(({elements:wt,rects:yt,availableWidth:We,availableHeight:Ke})=>{const{width:St,height:Re}=yt.reference,Ye=wt.floating.style;Ye.setProperty("--radix-popper-available-width",`${We}px`),Ye.setProperty("--radix-popper-available-height",`${Ke}px`),Ye.setProperty("--radix-popper-anchor-width",`${St}px`),Ye.setProperty("--radix-popper-anchor-height",`${Re}px`)},"apply")}),A&&pY({element:A,padding:u}),kY({arrowWidth:T,arrowHeight:L}),v&&hY({strategy:"referenceHidden",...U,boundary:Y?U.boundary:void 0})]}),W=b.setPlacementState;Kr(()=>(W(Q),()=>{W(void 0)}),[Q,W]);const[N,X]=Fg(Q),oe=cc(_);Kr(()=>{B&&(oe==null||oe())},[B,oe]);const re=(ae=ee.arrow)==null?void 0:ae.x,se=(Oe=ee.arrow)==null?void 0:Oe.y,fe=((ke=ee.arrow)==null?void 0:ke.centerOffset)!==0,[_e,de]=m.useState();return Kr(()=>{E&&de(window.getComputedStyle(E).zIndex)},[E]),S.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:B?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:_e,"--radix-popper-transform-origin":[(Ge=ee.transformOrigin)==null?void 0:Ge.x,(vt=ee.transformOrigin)==null?void 0:vt.y].join(" "),...((It=ee.hide)==null?void 0:It.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:S.jsx(bY,{scope:r,placedSide:N,placedAlign:X,onArrowChange:I,arrowX:re,arrowY:se,shouldHideArrow:fe,children:S.jsx(In.div,{"data-side":N,"data-align":X,...x,ref:R,style:{...x.style,animation:B?(Yt=x.style)==null?void 0:Yt.animation:"none"}})})})},"PopperContent"));function rM(t){return t!==null}Da(rM,"isNotNull");var kY=Da(t=>({name:"transformOrigin",options:t,fn(e){var x,b,E;const{placement:n,rects:r,middlewareData:s}=e,o=((x=s.arrow)==null?void 0:x.centerOffset)!==0,l=o?0:t.arrowWidth,u=o?0:t.arrowHeight,[d,f]=Fg(n),p={start:"0%",center:"50%",end:"100%"}[f],g=(((b=s.arrow)==null?void 0:b.x)??0)+l/2,v=(((E=s.arrow)==null?void 0:E.y)??0)+u/2;let w="",_="";return d==="bottom"?(w=o?p:`${g}px`,_=`${-u}px`):d==="top"?(w=o?p:`${g}px`,_=`${r.floating.height+u}px`):d==="right"?(w=`${-u}px`,_=o?p:`${v}px`):d==="left"&&(w=`${r.floating.width+u}px`,_=o?p:`${v}px`),{data:{x:w,y:_}}}}),"transformOrigin");function Fg(t){const[e,n="center"]=t.split("-");return[e,n]}Da(Fg,"getSideAndAlignFromPlacement");var sM=_Y,iM=xY,oM=SY,EY=Object.defineProperty,CY=(t,e)=>EY(t,"name",{value:e,configurable:!0}),nb=m.forwardRef(CY(function(e,n){var u;const{container:r,...s}=e,[i,o]=m.useState(!1);Kr(()=>o(!0),[]);const l=r||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?Uh.createPortal(S.jsx(In.div,{...s,ref:n}),l):null},"Portal")),PY=Object.defineProperty,Do=(t,e)=>PY(t,"name",{value:e,configurable:!0});function aM(t,e){return m.useReducer((n,r)=>e[n][r]??n,t)}Do(aM,"useStateMachine");var Ja=Do(t=>{const{present:e,children:n}=t,r=lM(e),s=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=cM(r.ref,uM(s));return typeof n=="function"||r.isPresent?m.cloneElement(s,{ref:i}):null},"Presence");function lM(t){const[e,n]=m.useState(),r=m.useRef(null),s=m.useRef(t),i=m.useRef("none"),o=m.useRef(void 0),l=t?"mounted":"unmounted",[u,d]=aM(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{u==="mounted"?(i.current=o.current??uu(r.current),o.current=void 0):i.current="none"},[u]),Kr(()=>{const f=r.current,p=s.current;if(p!==t){const v=i.current,w=uu(f);t?(o.current=w,d("MOUNT")):w==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(p&&v!==w?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,d]),Kr(()=>{if(e){let f;const p=e.ownerDocument.defaultView??window,g=Do(w=>{const x=uu(r.current).includes(CSS.escape(w.animationName));if(w.target===e&&x&&(d("ANIMATION_END"),!s.current)){const b=e.style.animationFillMode;e.style.animationFillMode="forwards",f=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=b)})}},"handleAnimationEnd"),v=Do(w=>{w.target===e&&(i.current=uu(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",v),e.addEventListener("animationcancel",g),e.addEventListener("animationend",g),()=>{p.clearTimeout(f),e.removeEventListener("animationstart",v),e.removeEventListener("animationcancel",g),e.removeEventListener("animationend",g)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:m.useCallback(f=>{if(f){const p=getComputedStyle(f);r.current=p,o.current=uu(p)}else r.current=null;n(f)},[])}}Do(lM,"usePresence");function J2(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Do(J2,"setRef");function cM(...t){const e=m.useRef(t);return e.current=t,m.useCallback(n=>{const r=e.current;let s=!1;const i=r.map(o=>{const l=J2(o,n);return!s&&typeof l=="function"&&(s=!0),l});if(s)return()=>{for(let o=0;o<i.length;o++){const l=i[o];typeof l=="function"?l():J2(r[o],null)}}},[])}Do(cM,"useStableComposedRefs");function uu(t){return(t==null?void 0:t.animationName)||"none"}Do(uu,"getAnimationName");function uM(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)}Do(uM,"getElementRef");var RY=Object.defineProperty,AY=(t,e)=>RY(t,"name",{value:e,configurable:!0}),SC=Dh[" useEffectEvent ".trim().toString()],kC=Dh[" useInsertionEffect ".trim().toString()];function dM(t){if(typeof SC=="function")return SC(t);const e=m.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof kC=="function"?kC(()=>{e.current=t}):Kr(()=>{e.current=t}),m.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}AY(dM,"useEffectEvent");var TY=Object.defineProperty,Wh=(t,e)=>TY(t,"name",{value:e,configurable:!0}),IY=Dh[" useInsertionEffect ".trim().toString()]||Kr;function el({prop:t,defaultProp:e,onChange:n=Wh(()=>{},"onChange"),caller:r}){const[s,i,o]=fM({defaultProp:e,onChange:n}),l=t!==void 0,u=l?t:s,d=m.useCallback(f=>{var p;if(l){const g=hM(f)?f(t):f;g!==t&&((p=o.current)==null||p.call(o,g))}else i(f)},[l,t,i,o]);return[u,d]}Wh(el,"useControllableState");function fM({defaultProp:t,onChange:e}){const[n,r]=m.useState(t),s=m.useRef(n),i=m.useRef(e);return IY(()=>{i.current=e},[e]),m.useEffect(()=>{var o;s.current!==n&&((o=i.current)==null||o.call(i,n),s.current=n)},[n,s]),[n,r,i]}Wh(fM,"useUncontrolledState");function hM(t){return typeof t=="function"}Wh(hM,"isFunction");var EC=Symbol("RADIX:SYNC_STATE");function MY(t,e,n,r){const{prop:s,defaultProp:i,onChange:o,caller:l}=e,u=s!==void 0,d=dM(o),f=[{...n,state:i}];r&&f.push(r);const[p,g]=m.useReducer((x,b)=>{if(b.type===EC)return{...x,state:b.state};const E=t(x,b);return u&&!Object.is(E.state,x.state)&&d(E.state),E},...f),v=p.state,w=m.useRef(v);m.useEffect(()=>{w.current!==v&&(w.current=v,u||d(v))},[v,w,u]);const _=m.useMemo(()=>s!==void 0?{...p,state:s}:p,[p,s]);return m.useEffect(()=>{u&&!Object.is(s,p.state)&&g({type:EC,state:s})},[s,p.state,u]),[_,g]}Wh(MY,"useControllableStateReducer");var OY=Object.defineProperty,LY=(t,e)=>OY(t,"name",{value:e,configurable:!0}),NY=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"}),DY=m.forwardRef(LY(function(e,n){return S.jsx(In.span,{...e,ref:n,style:{...NY,...e.style}})},"VisuallyHidden")),$Y=DY,jY=Object.defineProperty,sr=(t,e)=>jY(t,"name",{value:e,configurable:!0}),[rb,Iie]=Gi("Tooltip",[jg]),sb=jg(),FY="TooltipProvider",VY=700,ew="tooltip.open",[HY,ib]=rb(FY),zY=sr(t=>{const{__scopeTooltip:e,delayDuration:n=VY,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,o=m.useRef(!0),l=m.useRef(!1),u=m.useRef(0);return m.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),S.jsx(HY,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:m.useCallback(()=>{r<=0||(window.clearTimeout(u.current),o.current=!1)},[r]),onClose:m.useCallback(()=>{r<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:i})},"TooltipProvider"),tw="Tooltip",[BY,qh]=rb(tw),UY=sr(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=t,u=ib(tw,t.__scopeTooltip),d=sb(e),[f,p]=m.useState(null),[g,v]=m.useState(void 0),w=Na(),_=m.useRef(0),x=o??u.disableHoverableContent,b=l??u.delayDuration,E=m.useRef(!1),[C,R]=el({prop:r,defaultProp:s??!1,onChange:sr(D=>{D?(u.onOpen(),document.dispatchEvent(new CustomEvent(ew))):u.onClose(),i==null||i(D)},"onChange"),caller:tw}),A=m.useMemo(()=>C?E.current?"delayed-open":"instant-open":"closed",[C]),I=m.useCallback(()=>{window.clearTimeout(_.current),_.current=0,E.current=!1,R(!0)},[R]),M=m.useCallback(()=>{window.clearTimeout(_.current),_.current=0,R(!1)},[R]),T=m.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{E.current=!0,R(!0),_.current=0},b)},[b,R]);m.useEffect(()=>()=>{_.current&&(window.clearTimeout(_.current),_.current=0)},[]);const L=g??w;return S.jsx(sM,{...d,children:S.jsx(BY,{scope:e,contentId:L,setContentId:v,open:C,stateAttribute:A,trigger:f,onTriggerChange:p,onTriggerEnter:m.useCallback(()=>{u.isOpenDelayedRef.current?T():I()},[u.isOpenDelayedRef,T,I]),onTriggerLeave:m.useCallback(()=>{x?M():(window.clearTimeout(_.current),_.current=0)},[M,x]),onOpen:I,onClose:M,disableHoverableContent:x,children:n})})},"Tooltip"),CC="TooltipTrigger",ZY=m.forwardRef(sr(function(e,n){const{__scopeTooltip:r,...s}=e,i=qh(CC,r),o=ib(CC,r),l=sb(r),u=m.useRef(null),d=cn(n,u,i.onTriggerChange),f=m.useRef(!1),p=m.useRef(!1),g=m.useCallback(()=>f.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),S.jsx(iM,{asChild:!0,...l,children:S.jsx(In.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...s,ref:d,onPointerMove:an(e.onPointerMove,v=>{v.pointerType!=="touch"&&!p.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:an(e.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:an(e.onPointerDown,()=>{i.open&&i.onClose(),f.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:an(e.onFocus,()=>{f.current||i.onOpen()}),onBlur:an(e.onBlur,i.onClose),onClick:an(e.onClick,i.onClose)})})},"TooltipTrigger")),pM="TooltipPortal",[WY,qY]=rb(pM,{forceMount:void 0}),GY=sr(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=qh(pM,e);return S.jsx(WY,{scope:e,forceMount:n,children:S.jsx(Ja,{present:n||i.open,children:S.jsx(nb,{asChild:!0,container:s,children:r})})})},"TooltipPortal"),gh="TooltipContent",KY=m.forwardRef(sr(function(e,n){const r=qY(gh,e.__scopeTooltip),{forceMount:s=r.forceMount,side:i="top",...o}=e,l=qh(gh,e.__scopeTooltip);return S.jsx(Ja,{present:s||l.open,children:l.disableHoverableContent?S.jsx(mM,{side:i,...o,ref:n}):S.jsx(YY,{side:i,...o,ref:n})})},"TooltipContent")),YY=m.forwardRef(sr(function(e,n){const r=qh(gh,e.__scopeTooltip),s=ib(gh,e.__scopeTooltip),i=m.useRef(null),o=cn(n,i),[l,u]=m.useState(null),{trigger:d,onClose:f}=r,p=i.current,{onPointerInTransitChange:g}=s,v=m.useCallback(()=>{u(null),g(!1)},[g]),w=m.useCallback((_,x)=>{const b=_.currentTarget,E={x:_.clientX,y:_.clientY},C=gM(E,b.getBoundingClientRect()),R=vM(E,C),A=yM(x.getBoundingClientRect()),I=wM([...R,...A]);u(I),g(!0)},[g]);return m.useEffect(()=>()=>v(),[v]),m.useEffect(()=>{if(d&&p){const _=sr(b=>w(b,p),"handleTriggerLeave"),x=sr(b=>w(b,d),"handleContentLeave");return d.addEventListener("pointerleave",_),p.addEventListener("pointerleave",x),()=>{d.removeEventListener("pointerleave",_),p.removeEventListener("pointerleave",x)}}},[d,p,w,v]),m.useEffect(()=>{if(l){const _=sr(x=>{const b=x.target,E={x:x.clientX,y:x.clientY},C=(d==null?void 0:d.contains(b))||(p==null?void 0:p.contains(b)),R=!_M(E,l);C?v():R&&(v(),f())},"handleTrackPointerGrace");return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[d,p,l,f,v]),S.jsx(mM,{...e,ref:o})},"TooltipContentHoverable")),XY=MI("TooltipContent"),mM=m.forwardRef(sr(function(e,n){const{__scopeTooltip:r,children:s,"aria-label":i,id:o,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,f=qh(gh,r),p=sb(r),{onClose:g}=f;m.useEffect(()=>(document.addEventListener(ew,g),()=>document.removeEventListener(ew,g)),[g]),m.useEffect(()=>{if(f.trigger){const w=sr(_=>{_.target instanceof Node&&_.target.contains(f.trigger)&&g()},"handleScroll");return window.addEventListener("scroll",w,{capture:!0}),()=>window.removeEventListener("scroll",w,{capture:!0})}},[f.trigger,g]);const{setContentId:v}=f;return Kr(()=>(v(o),()=>{v(void 0)}),[o,v]),S.jsx(qx,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:w=>w.preventDefault(),onDismiss:g,children:S.jsxs(oM,{"data-state":f.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:f.contentId,...p,...d,ref:n,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[S.jsx(XY,{children:s}),i?S.jsx($Y,{id:f.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl"));function gM(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")}}sr(gM,"getExitSideFromRect");function vM(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}sr(vM,"getPaddedExitPoints");function yM(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}]}sr(yM,"getPointsFromRect");function _M(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const l=e[i],u=e[o],d=l.x,f=l.y,p=u.x,g=u.y;f>r!=g>r&&n<(p-d)*(r-f)/(g-f)+d&&(s=!s)}return s}sr(_M,"isPointInPolygon");function wM(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),xM(e)}sr(wM,"getHull");function xM(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const s=t[r];for(;e.length>=2;){const i=e[e.length-1],o=e[e.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}sr(xM,"getHullPresorted");var QY=zY,JY=UY,eX=ZY,tX=GY,nX=KY;const Bf={normal:"'wght' 400",medium:"'wght' 450",semibold:"'wght' 550"},bM=m.createContext(null);function SM({value:t,children:e}){return S.jsx(bM.Provider,{value:t,children:e})}function rX(t){switch(t){case"top":return{y:4};case"bottom":return{y:-4};case"left":return{x:4};case"right":return{x:-4}}}function ob({content:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=200,className:i,forceOpen:o,onOpenChange:l}){const[u,d]=m.useState(!1),f=o!==void 0?o:u,[p,g]=m.useState(!1),v=Zh(),w=m.useContext(bM);m.useEffect(()=>{f&&g(!0)},[f]);const _=()=>{f||g(!1)},x=rX(n);return S.jsx(QY,{delayDuration:s,children:S.jsxs(JY,{open:f,onOpenChange:b=>{d(b),l==null||l(b)},children:[S.jsx(eX,{asChild:!0,children:e}),p&&S.jsx(tX,{forceMount:!0,container:w??void 0,children:S.jsx(nX,{side:n,sideOffset:r,forceMount:!0,className:"z-tooltip",children:S.jsx(Ao.div,{className:zt("bg-neutral-900 text-white text-[12px] px-2 py-1 border border-white/10 shadow-lg",v.bg,i),style:{fontVariationSettings:Bf.medium},initial:{opacity:0,scale:.8,...x},animate:{opacity:f?1:0,scale:f?1:.9,x:0,y:0},transition:f?{type:"spring",duration:.34,bounce:.55}:{duration:.1},onAnimationComplete:_,children:t})})})]})})}const Mo=m.forwardRef(({title:t,shortcut:e,...n},r)=>{const s=S.jsx(EI,{ref:r,...n});return t?S.jsx(ob,{content:S.jsxs("div",{className:"flex flex-row items-center gap-2",children:[S.jsx("span",{children:t}),e?S.jsx("span",{className:"rounded bg-white/15 px-1.5 py-0.5 text-[11px]",children:e}):null]}),children:s}):s});Mo.displayName="Button";var sX=Object.defineProperty,Dr=(t,e)=>sX(t,"name",{value:e,configurable:!0}),zy="focusScope.autoFocusOnMount",By="focusScope.autoFocusOnUnmount",PC={bubbles:!1,cancelable:!0},kM=m.forwardRef(Dr(function(e,n){const{loop:r=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[u,d]=m.useState(null),f=cc(i),p=cc(o),g=m.useRef(null),v=cn(n,d),w=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(s){let x=function(R){if(w.paused||!u)return;const A=R.target;u.contains(A)?g.current=A:_o(g.current,{select:!0})},b=function(R){if(w.paused||!u)return;const A=R.relatedTarget;A!==null&&(u.contains(A)||_o(g.current,{select:!0}))},E=function(R){if(document.activeElement===document.body)for(const I of R)I.removedNodes.length>0&&_o(u)};Dr(x,"handleFocusIn"),Dr(b,"handleFocusOut"),Dr(E,"handleMutations"),document.addEventListener("focusin",x),document.addEventListener("focusout",b);const C=new MutationObserver(E);return u&&C.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",b),C.disconnect()}}},[s,u,w.paused]),m.useEffect(()=>{if(u){RC.add(w);const x=document.activeElement;if(!u.contains(x)){const E=new CustomEvent(zy,PC);u.addEventListener(zy,f),u.dispatchEvent(E),E.defaultPrevented||(EM(TM(ab(u)),{select:!0}),document.activeElement===x&&_o(u))}return()=>{u.removeEventListener(zy,f),setTimeout(()=>{const E=new CustomEvent(By,PC);u.addEventListener(By,p),u.dispatchEvent(E),E.defaultPrevented||_o(x??document.body,{select:!0}),u.removeEventListener(By,p),RC.remove(w)},0)}}},[u,f,p,w]);const _=m.useCallback(x=>{if(!r&&!s||w.paused)return;const b=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,E=document.activeElement;if(b&&E){const C=x.currentTarget,[R,A]=CM(C);R&&A?!x.shiftKey&&E===A?(x.preventDefault(),r&&_o(R,{select:!0})):x.shiftKey&&E===R&&(x.preventDefault(),r&&_o(A,{select:!0})):E===C&&x.preventDefault()}},[r,s,w.paused]);return S.jsx(In.div,{tabIndex:-1,...l,ref:v,onKeyDown:_})},"FocusScope"));function EM(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(_o(r,{select:e}),document.activeElement!==n)return}Dr(EM,"focusFirst");function CM(t){const e=ab(t),n=nw(e,t),r=nw(e.reverse(),t);return[n,r]}Dr(CM,"getTabbableEdges");function ab(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:Dr(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}Dr(ab,"getTabbableCandidates");function nw(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):PM(r,{upTo:e})))return r}Dr(nw,"findVisible");function PM(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}Dr(PM,"isHidden");function RM(t){return t instanceof HTMLInputElement&&"select"in t}Dr(RM,"isSelectableInput");function _o(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&RM(t)&&e&&t.select()}}Dr(_o,"focus");var RC=AM();function AM(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=rw(t,e),t.unshift(e)},remove(e){var n;t=rw(t,e),(n=t[0])==null||n.resume()}}}Dr(AM,"createFocusScopesStack");function rw(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}Dr(rw,"arrayRemove");function TM(t){return t.filter(e=>e.tagName!=="A")}Dr(TM,"removeLinks");var iX=Object.defineProperty,lb=(t,e)=>iX(t,"name",{value:e,configurable:!0}),E0=0,Ci=null;function oX(t){return Vg(),t.children}lb(oX,"FocusGuards");function Vg(){m.useEffect(()=>{Ci||(Ci={start:sw(),end:sw()});const{start:t,end:e}=Ci;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),E0++,()=>{E0===1&&(Ci==null||Ci.start.remove(),Ci==null||Ci.end.remove(),Ci=null),E0=Math.max(0,E0-1)}},[])}lb(Vg,"useFocusGuards");function sw(){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}lb(sw,"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 IM(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 aX(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 rm="right-scroll-bar-position",sm="width-before-scroll-bar",lX="with-scroll-bars-hidden",cX="--removed-body-scroll-bar-size";function Uy(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function uX(t,e){var n=m.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 dX=typeof window<"u"?m.useLayoutEffect:m.useEffect,AC=new WeakMap;function fX(t,e){var n=uX(null,function(r){return t.forEach(function(s){return Uy(s,r)})});return dX(function(){var r=AC.get(n);if(r){var s=new Set(r),i=new Set(t),o=n.current;s.forEach(function(l){i.has(l)||Uy(l,null)}),i.forEach(function(l){s.has(l)||Uy(l,o)})}AC.set(n,t)},[t]),n}function hX(t){return t}function pX(t,e){e===void 0&&(e=hX);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(i){var o=e(i,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(i),o=n}var u=function(){var f=o;o=[],f.forEach(i)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(f){o.push(f),d()},filter:function(f){return o=o.filter(f),n}}}};return s}function mX(t){t===void 0&&(t={});var e=pX(null);return e.options=Di({async:!0,ssr:!1},t),e}var MM=function(t){var e=t.sideCar,n=IM(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 m.createElement(r,Di({},n))};MM.isSideCarExport=!0;function gX(t,e){return t.useMedium(e),MM}var OM=mX(),Zy=function(){},Hg=m.forwardRef(function(t,e){var n=m.useRef(null),r=m.useState({onScrollCapture:Zy,onWheelCapture:Zy,onTouchMoveCapture:Zy}),s=r[0],i=r[1],o=t.forwardProps,l=t.children,u=t.className,d=t.removeScrollBar,f=t.enabled,p=t.shards,g=t.sideCar,v=t.noRelative,w=t.noIsolation,_=t.inert,x=t.allowPinchZoom,b=t.as,E=b===void 0?"div":b,C=t.gapMode,R=IM(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=g,I=fX([n,e]),M=Di(Di({},R),s);return m.createElement(m.Fragment,null,f&&m.createElement(A,{sideCar:OM,removeScrollBar:d,shards:p,noRelative:v,noIsolation:w,inert:_,setCallbacks:i,allowPinchZoom:!!x,lockRef:n,gapMode:C}),o?m.cloneElement(m.Children.only(l),Di(Di({},M),{ref:I})):m.createElement(E,Di({},M,{className:u,ref:I}),l))});Hg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Hg.classNames={fullWidth:sm,zeroRight:rm};var vX=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function yX(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=vX();return e&&t.setAttribute("nonce",e),t}function _X(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function wX(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var xX=function(){var t=0,e=null;return{add:function(n){t==0&&(e=yX())&&(_X(e,n),wX(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},bX=function(){var t=xX();return function(e,n){m.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},LM=function(){var t=bX(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},SX={left:0,top:0,right:0,gap:0},Wy=function(t){return parseInt(t||"",10)||0},kX=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[Wy(n),Wy(r),Wy(s)]},EX=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return SX;var e=kX(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])}},CX=LM(),ku="data-scroll-locked",PX=function(t,e,n,r){var s=t.left,i=t.top,o=t.right,l=t.gap;return n===void 0&&(n="margin"),`
|
|
72
|
-
.`.concat(lX,` {
|
|
73
|
-
overflow: hidden `).concat(r,`;
|
|
74
|
-
padding-right: `).concat(l,"px ").concat(r,`;
|
|
75
|
-
}
|
|
76
|
-
body[`).concat(ku,`] {
|
|
77
|
-
overflow: hidden `).concat(r,`;
|
|
78
|
-
overscroll-behavior: contain;
|
|
79
|
-
`).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
80
|
-
padding-left: `.concat(s,`px;
|
|
81
|
-
padding-top: `).concat(i,`px;
|
|
82
|
-
padding-right: `).concat(o,`px;
|
|
83
|
-
margin-left:0;
|
|
84
|
-
margin-top:0;
|
|
85
|
-
margin-right: `).concat(l,"px ").concat(r,`;
|
|
86
|
-
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.`).concat(rm,` {
|
|
90
|
-
right: `).concat(l,"px ").concat(r,`;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.`).concat(sm,` {
|
|
94
|
-
margin-right: `).concat(l,"px ").concat(r,`;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.`).concat(rm," .").concat(rm,` {
|
|
98
|
-
right: 0 `).concat(r,`;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.`).concat(sm," .").concat(sm,` {
|
|
102
|
-
margin-right: 0 `).concat(r,`;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
body[`).concat(ku,`] {
|
|
106
|
-
`).concat(cX,": ").concat(l,`px;
|
|
107
|
-
}
|
|
108
|
-
`)},TC=function(){var t=parseInt(document.body.getAttribute(ku)||"0",10);return isFinite(t)?t:0},RX=function(){m.useEffect(function(){return document.body.setAttribute(ku,(TC()+1).toString()),function(){var t=TC()-1;t<=0?document.body.removeAttribute(ku):document.body.setAttribute(ku,t.toString())}},[])},AX=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;RX();var i=m.useMemo(function(){return EX(s)},[s]);return m.createElement(CX,{styles:PX(i,!e,s,n?"":"!important")})},iw=!1;if(typeof window<"u")try{var C0=Object.defineProperty({},"passive",{get:function(){return iw=!0,!0}});window.addEventListener("test",C0,C0),window.removeEventListener("test",C0,C0)}catch{iw=!1}var nu=iw?{passive:!1}:!1,TX=function(t){return t.tagName==="TEXTAREA"},NM=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!TX(t)&&n[e]==="visible")},IX=function(t){return NM(t,"overflowY")},MX=function(t){return NM(t,"overflowX")},IC=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=DM(t,r);if(s){var i=$M(t,r),o=i[1],l=i[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},OX=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},LX=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},DM=function(t,e){return t==="v"?IX(e):MX(e)},$M=function(t,e){return t==="v"?OX(e):LX(e)},NX=function(t,e){return t==="h"&&e==="rtl"?-1:1},DX=function(t,e,n,r,s){var i=NX(t,window.getComputedStyle(e).direction),o=i*r,l=n.target,u=e.contains(l),d=!1,f=o>0,p=0,g=0;do{if(!l)break;var v=$M(t,l),w=v[0],_=v[1],x=v[2],b=_-x-i*w;(w||b)&&DM(t,l)&&(p+=b,g+=w);var E=l.parentNode;l=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!u&&l!==document.body||u&&(e.contains(l)||e===l));return(f&&Math.abs(p)<1||!f&&Math.abs(g)<1)&&(d=!0),d},P0=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},MC=function(t){return[t.deltaX,t.deltaY]},OC=function(t){return t&&"current"in t?t.current:t},$X=function(t,e){return t[0]===e[0]&&t[1]===e[1]},jX=function(t){return`
|
|
109
|
-
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
110
|
-
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
111
|
-
`)},FX=0,ru=[];function VX(t){var e=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState(FX++)[0],i=m.useState(LM)[0],o=m.useRef(t);m.useEffect(function(){o.current=t},[t]),m.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var _=aX([t.lockRef.current],(t.shards||[]).map(OC),!0).filter(Boolean);return _.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),_.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var l=m.useCallback(function(_,x){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!o.current.allowPinchZoom;var b=P0(_),E=n.current,C="deltaX"in _?_.deltaX:E[0]-b[0],R="deltaY"in _?_.deltaY:E[1]-b[1],A,I=_.target,M=Math.abs(C)>Math.abs(R)?"h":"v";if("touches"in _&&M==="h"&&I.type==="range")return!1;var T=window.getSelection(),L=T&&T.anchorNode,D=L?L===I||L.contains(I):!1;if(D)return!1;var j=IC(M,I);if(!j)return!0;if(j?A=M:(A=M==="v"?"h":"v",j=IC(M,I)),!j)return!1;if(!r.current&&"changedTouches"in _&&(C||R)&&(r.current=A),!A)return!0;var H=r.current||A;return DX(H,x,_,H==="h"?C:R)},[]),u=m.useCallback(function(_){var x=_;if(!(!ru.length||ru[ru.length-1]!==i)){var b="deltaY"in x?MC(x):P0(x),E=e.current.filter(function(A){return A.name===x.type&&(A.target===x.target||x.target===A.shadowParent)&&$X(A.delta,b)})[0];if(E&&E.should){x.cancelable&&x.preventDefault();return}if(!E){var C=(o.current.shards||[]).map(OC).filter(Boolean).filter(function(A){return A.contains(x.target)}),R=C.length>0?l(x,C[0]):!o.current.noIsolation;R&&x.cancelable&&x.preventDefault()}}},[]),d=m.useCallback(function(_,x,b,E){var C={name:_,delta:x,target:b,should:E,shadowParent:HX(b)};e.current.push(C),setTimeout(function(){e.current=e.current.filter(function(R){return R!==C})},1)},[]),f=m.useCallback(function(_){n.current=P0(_),r.current=void 0},[]),p=m.useCallback(function(_){d(_.type,MC(_),_.target,l(_,t.lockRef.current))},[]),g=m.useCallback(function(_){d(_.type,P0(_),_.target,l(_,t.lockRef.current))},[]);m.useEffect(function(){return ru.push(i),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",u,nu),document.addEventListener("touchmove",u,nu),document.addEventListener("touchstart",f,nu),function(){ru=ru.filter(function(_){return _!==i}),document.removeEventListener("wheel",u,nu),document.removeEventListener("touchmove",u,nu),document.removeEventListener("touchstart",f,nu)}},[]);var v=t.removeScrollBar,w=t.inert;return m.createElement(m.Fragment,null,w?m.createElement(i,{styles:jX(s)}):null,v?m.createElement(AX,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function HX(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const zX=gX(OM,VX);var cb=m.forwardRef(function(t,e){return m.createElement(Hg,Di({},t,{ref:e,sideCar:zX}))});cb.classNames=Hg.classNames;var BX=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},su=new WeakMap,R0=new WeakMap,A0={},qy=0,jM=function(t){return t&&(t.host||jM(t.parentNode))},UX=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=jM(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})},ZX=function(t,e,n,r){var s=UX(e,Array.isArray(t)?t:[t]);A0[n]||(A0[n]=new WeakMap);var i=A0[n],o=[],l=new Set,u=new Set(s),d=function(p){!p||l.has(p)||(l.add(p),d(p.parentNode))};s.forEach(d);var f=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(g){if(l.has(g))f(g);else try{var v=g.getAttribute(r),w=v!==null&&v!=="false",_=(su.get(g)||0)+1,x=(i.get(g)||0)+1;su.set(g,_),i.set(g,x),o.push(g),_===1&&w&&R0.set(g,!0),x===1&&g.setAttribute(n,"true"),w||g.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",g,b)}})};return f(e),l.clear(),qy++,function(){o.forEach(function(p){var g=su.get(p)-1,v=i.get(p)-1;su.set(p,g),i.set(p,v),g||(R0.has(p)||p.removeAttribute(r),R0.delete(p)),v||p.removeAttribute(n)}),qy--,qy||(su=new WeakMap,su=new WeakMap,R0=new WeakMap,A0={})}},FM=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=BX(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),ZX(r,s,n,"aria-hidden")):function(){return null}},WX=Object.defineProperty,yi=(t,e)=>WX(t,"name",{value:e,configurable:!0}),ub="Dialog",[VM,Mie]=Gi(ub),[qX,zo]=VM(ub),db=yi(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=t,l=m.useRef(null),u=m.useRef(null),[d,f]=el({prop:r,defaultProp:s??!1,onChange:i,caller:ub}),[p,g]=m.useState(0),[v,w]=m.useState(0);return S.jsx(qX,{scope:e,triggerRef:l,contentRef:u,contentId:Na(),titleId:Na(),descriptionId:Na(),titlePresent:p>0,descriptionPresent:v>0,setTitleCount:g,setDescriptionCount:w,open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(_=>!_),[f]),modal:o,children:n})},"Dialog"),HM="DialogPortal",[GX,zM]=VM(HM,{forceMount:void 0}),fb=yi(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=zo(HM,e);return S.jsx(GX,{scope:e,forceMount:n,children:m.Children.map(r,o=>S.jsx(Ja,{present:n||i.open,children:S.jsx(nb,{asChild:!0,container:s,children:o})}))})},"DialogPortal"),ow="DialogOverlay",hb=m.forwardRef(yi(function(e,n){const r=zM(ow,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,o=zo(ow,e.__scopeDialog);return o.modal?S.jsx(Ja,{present:s||o.open,children:S.jsx(YX,{...i,ref:n})}):null},"DialogOverlay")),KX=Ua("DialogOverlay.RemoveScroll"),YX=m.forwardRef(yi(function(e,n){const{__scopeDialog:r,...s}=e,i=zo(ow,r),o=FI(),l=cn(n,o);return S.jsx(cb,{as:KX,allowPinchZoom:!0,shards:[i.contentRef],children:S.jsx(In.div,{"data-state":vb(i.open),...s,ref:l,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),vh="DialogContent",pb=m.forwardRef(yi(function(e,n){const r=zM(vh,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,o=zo(vh,e.__scopeDialog);return S.jsx(Ja,{present:s||o.open,children:o.modal?S.jsx(XX,{...i,ref:n}):S.jsx(QX,{...i,ref:n})})},"DialogContent")),XX=m.forwardRef(yi(function(e,n){const r=zo(vh,e.__scopeDialog),s=m.useRef(null),i=cn(n,r.contentRef,s);return m.useEffect(()=>{const o=s.current;if(o)return FM(o)},[]),S.jsx(BM,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:an(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:an(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:an(e.onFocusOutside,o=>o.preventDefault())})},"DialogContentModal")),QX=m.forwardRef(yi(function(e,n){const r=zo(vh,e.__scopeDialog),s=m.useRef(!1),i=m.useRef(!1);return S.jsx(BM,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(s.current||(u=r.triggerRef.current)==null||u.focus(),o.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:o=>{var d,f;(d=e.onInteractOutside)==null||d.call(e,o),o.defaultPrevented||(s.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((f=r.triggerRef.current)==null?void 0:f.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})},"DialogContentNonModal")),BM=m.forwardRef(yi(function(e,n){const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,u=zo(vh,r);return Vg(),S.jsx(S.Fragment,{children:S.jsx(kM,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(qx,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionPresent?u.descriptionId:void 0,"aria-labelledby":u.titlePresent?u.titleId:void 0,"data-state":vb(u.open),...l,ref:n,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})},"DialogContentImpl")),JX="DialogTitle",mb=m.forwardRef(yi(function(e,n){const{__scopeDialog:r,...s}=e,i=zo(JX,r),{setTitleCount:o}=i;return Kr(()=>(o(l=>l+1),()=>o(l=>l-1)),[o]),S.jsx(In.h2,{id:i.titleId,...s,ref:n})},"DialogTitle")),eQ="DialogDescription",gb=m.forwardRef(yi(function(e,n){const{__scopeDialog:r,...s}=e,i=zo(eQ,r),{setDescriptionCount:o}=i;return Kr(()=>(o(l=>l+1),()=>o(l=>l-1)),[o]),S.jsx(In.p,{id:i.descriptionId,...s,ref:n})},"DialogDescription"));function vb(t){return t?"open":"closed"}yi(vb,"getState");var tQ=Object.defineProperty,tl=(t,e)=>tQ(t,"name",{value:e,configurable:!0}),yb="Popover",[UM,Oie]=Gi(yb,[jg]),_b=jg(),[nQ,md]=UM(yb),rQ=tl(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!1}=t,l=_b(e),u=m.useRef(null),[d,f]=m.useState(!1),[p,g]=el({prop:r,defaultProp:s??!1,onChange:i,caller:yb});return S.jsx(sM,{...l,children:S.jsx(nQ,{scope:e,contentId:Na(),triggerRef:u,open:p,onOpenChange:g,onOpenToggle:m.useCallback(()=>g(v=>!v),[g]),hasCustomAnchor:d,onCustomAnchorAdd:m.useCallback(()=>f(!0),[]),onCustomAnchorRemove:m.useCallback(()=>f(!1),[]),modal:o,children:n})})},"Popover"),sQ="PopoverTrigger",iQ=m.forwardRef(tl(function(e,n){const{__scopePopover:r,...s}=e,i=md(sQ,r),o=_b(r),l=cn(n,i.triggerRef),u=S.jsx(In.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":wb(i.open),...s,ref:l,onClick:an(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?u:S.jsx(iM,{asChild:!0,...o,children:u})},"PopoverTrigger")),ZM="PopoverPortal",[oQ,aQ]=UM(ZM,{forceMount:void 0}),lQ=tl(t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=md(ZM,e);return S.jsx(oQ,{scope:e,forceMount:n,children:S.jsx(Ja,{present:n||i.open,children:S.jsx(nb,{asChild:!0,container:s,children:r})})})},"PopoverPortal"),yh="PopoverContent",cQ=m.forwardRef(tl(function(e,n){const r=aQ(yh,e.__scopePopover),{forceMount:s=r.forceMount,...i}=e,o=md(yh,e.__scopePopover);return S.jsx(Ja,{present:s||o.open,children:o.modal?S.jsx(dQ,{...i,ref:n}):S.jsx(fQ,{...i,ref:n})})},"PopoverContent")),uQ=Ua("PopoverContent.RemoveScroll"),dQ=m.forwardRef(tl(function(e,n){const r=md(yh,e.__scopePopover),s=m.useRef(null),i=cn(n,s),o=m.useRef(!1);return m.useEffect(()=>{const l=s.current;if(l)return FM(l)},[]),S.jsx(cb,{as:uQ,allowPinchZoom:!0,children:S.jsx(WM,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:an(e.onCloseAutoFocus,l=>{var u;l.preventDefault(),o.current||(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:an(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;o.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:an(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),fQ=m.forwardRef(tl(function(e,n){const r=md(yh,e.__scopePopover),s=m.useRef(!1),i=m.useRef(!1);return S.jsx(WM,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(s.current||(u=r.triggerRef.current)==null||u.focus(),o.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:o=>{var d,f;(d=e.onInteractOutside)==null||d.call(e,o),o.defaultPrevented||(s.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((f=r.triggerRef.current)==null?void 0:f.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})},"PopoverContentNonModal")),WM=m.forwardRef(tl(function(e,n){const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,...g}=e,v=md(yh,r),w=_b(r);return Vg(),S.jsx(kM,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(qx,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>v.onOpenChange(!1),deferPointerDownOutside:!0,children:S.jsx(oM,{"data-state":wb(v.open),role:"dialog",id:v.contentId,...w,...g,ref:n,style:{...g.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 wb(t){return t?"open":"closed"}tl(wb,"getState");var xb=rQ,bb=iQ,Sb=lQ,kb=cQ;const _h={fast:{type:"spring",duration:.08,bounce:0},moderate:{type:"spring",duration:.16,bounce:.15}},hQ="data-hover-dead-zone";function qM(t,e={}){const{axis:n="y",snapTolerancePx:r=1/0}=e,s=m.useRef(new Map),[i,o]=m.useState(null),[l,u]=m.useState([]),d=m.useRef([]),f=m.useRef(0),p=m.useRef(null),g=m.useRef(null),v=m.useCallback(()=>{const C=[];return s.current.forEach((R,A)=>{C[A]={top:R.offsetTop,height:R.offsetHeight,left:R.offsetLeft,width:R.offsetWidth}}),C},[]),w=m.useCallback(()=>{if(!t.current)return;const R=v();d.current=R,u(R)},[t,v]),_=m.useCallback((C,R)=>{R?s.current.set(C,R):s.current.delete(C),g.current!==null&&cancelAnimationFrame(g.current),g.current=requestAnimationFrame(()=>{g.current=null,w()})},[w]),x=m.useCallback(C=>{const R=C.clientX,A=C.clientY,I=C.target instanceof Element&&C.target.closest(`[${hQ}]`)!==null;p.current!==null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{p.current=null;const M=t.current;if(!M)return;if(I){o(null);return}const T=v(),L=d.current;(T.length!==L.length||T.some((oe,re)=>{const se=L[re];return!se||!oe||oe.top!==se.top||oe.height!==se.height||oe.left!==se.left||oe.width!==se.width}))&&(d.current=T,u(T));const j=M.getBoundingClientRect(),H=n==="x"?R:A;let Y=null,U=1/0,z=null;const Z=d.current,Q=n==="x"?M.scrollLeft:M.scrollTop,B=n==="x"?M.clientLeft:M.clientTop,ee=n==="x"?j.left:j.top,W=n==="x"?M.offsetWidth:M.offsetHeight,N=n==="x"?j.width:j.height,X=W>0?N/W:1;for(let oe=0;oe<Z.length;oe++){const re=Z[oe];if(!re)continue;const se=n==="x"?re.left:re.top,fe=ee+(B+se-Q)*X,_e=(n==="x"?re.width:re.height)*X,de=fe+_e;H>=fe&&H<=de&&(z=oe);let ae=0;H<fe?ae=fe-H:H>de&&(ae=H-de),ae<U&&(U=ae,Y=oe)}o(z??(U<=r?Y:null))})},[n,t,r,v]),b=m.useCallback(()=>{f.current+=1,w()},[w]),E=m.useCallback(()=>{p.current!==null&&(cancelAnimationFrame(p.current),p.current=null),o(null)},[]);return m.useEffect(()=>()=>{p.current!==null&&cancelAnimationFrame(p.current),g.current!==null&&cancelAnimationFrame(g.current)},[]),{activeIndex:i,setActiveIndex:o,itemRects:l,sessionRef:f,handlers:{onMouseMove:x,onMouseEnter:b,onMouseLeave:E},registerItem:_,measureItems:w}}function pQ(t,e,n){m.useEffect(()=>(t(e,n.current),()=>t(e,null)),[e,t,n])}let im=0;const mQ=()=>{im+=1;let t=!1;return()=>{t||(t=!0,im=Math.max(0,im-1))}},gQ=()=>im>0,vQ='[data-menu-item]:not([disabled]):not([aria-disabled="true"])',GM=({itemSelector:t=vQ,loop:e=!1,onDismiss:n}={})=>{const r=m.useRef(null),s=m.useRef(null),i=m.useRef(n),o=m.useRef(!1);i.current=n;const l=m.useCallback(f=>{var p;if(r.current=f,f){o.current=!1;const g=mQ(),v=f.ownerDocument.defaultView;let w;const _=()=>{v==null||v.clearTimeout(w),w=v==null?void 0:v.setTimeout(()=>{const x=f.ownerDocument.activeElement;(x==null?void 0:x.tagName)==="IFRAME"&&!f.contains(x)&&i.current&&(o.current=!0,i.current())})};v==null||v.addEventListener("blur",_),s.current=()=>{v==null||v.removeEventListener("blur",_),v==null||v.clearTimeout(w),g()}}else(p=s.current)==null||p.call(s),s.current=null},[]),u=f=>{o.current&&f.preventDefault()},d=m.useCallback(f=>{var E;const{key:p}=f;if(p!=="ArrowDown"&&p!=="ArrowUp"&&p!=="Home"&&p!=="End")return;const g=r.current;if(!g)return;const v=Array.from(g.querySelectorAll(t));if(v.length===0)return;f.preventDefault(),f.stopPropagation();const w=v.indexOf(document.activeElement),_=v.length-1,x=C=>{if(w===-1)return C===1?0:_;const R=w+C;return e?(R+v.length)%v.length:Math.min(Math.max(R,0),_)};let b;p==="Home"?b=0:p==="End"?b=_:p==="ArrowDown"?b=x(1):b=x(-1),(E=v[b])==null||E.focus()},[t,e]);return{containerRef:l,onKeyDown:d,onCloseAutoFocus:u}};var om={exports:{}},yQ=om.exports,LC;function _Q(){return LC||(LC=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(yQ,function(){var e=function(){},n="undefined",r=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),s=["trace","debug","info","warn","error"],i={},o=null;function l(_,x){var b=_[x];if(typeof b.bind=="function")return b.bind(_);try{return Function.prototype.bind.call(b,_)}catch{return function(){return Function.prototype.apply.apply(b,[_,arguments])}}}function u(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function d(_){return _==="debug"&&(_="log"),typeof console===n?!1:_==="trace"&&r?u:console[_]!==void 0?l(console,_):console.log!==void 0?l(console,"log"):e}function f(){for(var _=this.getLevel(),x=0;x<s.length;x++){var b=s[x];this[b]=x<_?e:this.methodFactory(b,_,this.name)}if(this.log=this.debug,typeof console===n&&_<this.levels.SILENT)return"No console available for logging"}function p(_){return function(){typeof console!==n&&(f.call(this),this[_].apply(this,arguments))}}function g(_,x,b){return d(_)||p.apply(this,arguments)}function v(_,x){var b=this,E,C,R,A="loglevel";typeof _=="string"?A+=":"+_:typeof _=="symbol"&&(A=void 0);function I(j){var H=(s[j]||"silent").toUpperCase();if(!(typeof window===n||!A)){try{window.localStorage[A]=H;return}catch{}try{window.document.cookie=encodeURIComponent(A)+"="+H+";"}catch{}}}function M(){var j;if(!(typeof window===n||!A)){try{j=window.localStorage[A]}catch{}if(typeof j===n)try{var H=window.document.cookie,Y=encodeURIComponent(A),U=H.indexOf(Y+"=");U!==-1&&(j=/^([^;]+)/.exec(H.slice(U+Y.length+1))[1])}catch{}return b.levels[j]===void 0&&(j=void 0),j}}function T(){if(!(typeof window===n||!A)){try{window.localStorage.removeItem(A)}catch{}try{window.document.cookie=encodeURIComponent(A)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function L(j){var H=j;if(typeof H=="string"&&b.levels[H.toUpperCase()]!==void 0&&(H=b.levels[H.toUpperCase()]),typeof H=="number"&&H>=0&&H<=b.levels.SILENT)return H;throw new TypeError("log.setLevel() called with invalid level: "+j)}b.name=_,b.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},b.methodFactory=x||g,b.getLevel=function(){return R??C??E},b.setLevel=function(j,H){return R=L(j),H!==!1&&I(R),f.call(b)},b.setDefaultLevel=function(j){C=L(j),M()||b.setLevel(j,!1)},b.resetLevel=function(){R=null,T(),f.call(b)},b.enableAll=function(j){b.setLevel(b.levels.TRACE,j)},b.disableAll=function(j){b.setLevel(b.levels.SILENT,j)},b.rebuild=function(){if(o!==b&&(E=L(o.getLevel())),f.call(b),o===b)for(var j in i)i[j].rebuild()},E=L(o?o.getLevel():"WARN");var D=M();D!=null&&(R=L(D)),f.call(b)}o=new v,o.getLogger=function(x){if(typeof x!="symbol"&&typeof x!="string"||x==="")throw new TypeError("You must supply a name when creating a logger.");var b=i[x];return b||(b=i[x]=new v(x,o.methodFactory)),b};var w=typeof window!==n?window.log:void 0;return o.noConflict=function(){return typeof window!==n&&window.log===o&&(window.log=w),o},o.getLoggers=function(){return i},o.default=o,o})})(om)),om.exports}var wQ=_Q();const ui=_g(wQ),xQ="INFO",bQ=xQ.toUpperCase();ui.setLevel(ui.levels[bQ]||ui.levels.INFO);const Cs=t=>{const e=t?`[${t}] `:"";return{trace:(n,...r)=>ui.trace(`${e}${n}`,...r),debug:(n,...r)=>ui.debug(`${e}${n}`,...r),info:(n,...r)=>ui.info(`${e}${n}`,...r),warn:(n,...r)=>ui.warn(`${e}${n}`,...r),error:(n,...r)=>{ui.error(`${e}${n}`,...r);try{const i=r.map(l=>l instanceof Error?l.message:String(l)).join(" ").slice(0,512),o={source:"ui",error_message:n,service:t??"unknown",error_type:"logged_error",url:window.location.pathname,error_args_count:r.length,...i?{error_detail:i}:{}};Ce.capture("logger_error",o)}catch(s){console.error("[logger] Failed to send logger_error to PostHog:",s)}},api:(n,...r)=>ui.info(`${e}API: ${n}`,...r),hook:(n,...r)=>ui.debug(`${e}Hook: ${n}`,...r),mount:(n,...r)=>ui.debug(`${e}Mount: ${n}`,...r)}},NC=Cs("useVariantsUiState"),SQ={groups:[],rows:{}},T0={pinned:[],order:SQ},Sf="pinned",kQ="top",Gy=t=>`rows:${t}`,DC=t=>e=>e.pinned.includes(t)?e:{...e,pinned:[...e.pinned,t]},EQ=t=>e=>({...e,pinned:e.pinned.filter(n=>n!==t)}),CQ=(t,e)=>n=>{if(t===Sf){const r=new Set(e);return{...n,pinned:[...e,...n.pinned.filter(s=>!r.has(s))]}}return t===kQ?{...n,order:{...n.order,groups:e}}:{...n,order:{...n.order,rows:{...n.order.rows,[t.slice(5)]:e}}}},PQ=t=>{const e=t?`?projectPath=${encodeURIComponent(t)}`:"",[n,r]=m.useState(T0),s=m.useRef(n);s.current=n;const i=m.useRef(!1),o=m.useRef([]),l=m.useCallback(v=>{t&&fetch(`/api/variants/ui-state${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({uiState:v})}).catch(w=>{NC.warn("persist failed — arrangement kept for this session only",w)})},[t,e]);m.useEffect(()=>{if(r(T0),s.current=T0,i.current=!1,o.current=[],!t)return;let v=!1;return(async()=>{try{const w=await fetch(`/api/variants/ui-state${e}`);if(!w.ok||v)return;const _=await w.json();if(v)return;let x=_.uiState??T0;const b=o.current;o.current=[];for(const E of b)x=E(x);i.current=!0,s.current=x,r(x),b.length>0&&l(x)}catch(w){NC.warn("load failed — arrangement is session-local until reload",w)}})(),()=>{v=!0}},[t,e,l]);const u=m.useCallback(v=>{const w=v(s.current);s.current=w,r(w),i.current?l(w):o.current.push(v)},[l]),d=m.useCallback(v=>{const w=!s.current.pinned.includes(v);u(w?DC(v):EQ(v))},[u]),f=m.useCallback(v=>{s.current.pinned.includes(v)||u(DC(v))},[u]),p=m.useCallback((v,w)=>{u(CQ(v,w))},[u]),g=m.useMemo(()=>new Set(n.pinned),[n.pinned]);return{pinnedKeys:n.pinned,pinnedKeySet:g,listOrder:n.order,togglePin:d,pinItem:f,reorder:p}},RQ=t=>{const{containerRef:e,dragged:n,yieldToSelector:r,restrictToSelector:s,onReorder:i}=t,[o,l]=m.useState(null),u=m.useCallback(p=>{const g=e.current;return g?Array.from(g.querySelectorAll(`[data-reorder-container="${CSS.escape(p)}"]`)):[]},[e]),d=m.useCallback(p=>{if(!n){o&&l(null);return}const g=e.current;if(!g)return;if(r){const b=g.querySelector(r);if(b){const E=b.getBoundingClientRect();if(p.clientY>=E.top&&p.clientY<=E.bottom){o&&l(null);return}}}if(s){const b=g.querySelector(s),E=b==null?void 0:b.getBoundingClientRect();if(!E||p.clientY<E.top||p.clientY>E.bottom){o&&l(null);return}}const v=u(n.container);if(v.length===0){o&&l(null);return}const w=g.getBoundingClientRect().top;let _=v.length;for(let b=0;b<v.length;b++){const E=v[b].getBoundingClientRect();if(p.clientY<E.top+E.height/2){_=b;break}}let x;_===0?x=v[0].getBoundingClientRect().top-w-1:_===v.length?x=v[v.length-1].getBoundingClientRect().bottom-w:x=(v[_-1].getBoundingClientRect().bottom+v[_].getBoundingClientRect().top)/2-w,(!o||o.index!==_||o.container!==n.container)&&l({container:n.container,index:_,top:x})},[e,n,o,u,r,s]),f=m.useCallback(()=>{if(!n||!o)return;l(null);const p=u(o.container).map(w=>w.dataset.reorderKey).filter(w=>!!w),g=p.indexOf(n.key);if(g===-1)return;p.splice(g,1);const v=o.index>g?o.index-1:o.index;p.splice(v,0,n.key),i(o.container,p)},[n,o,u,i]);return{dropTarget:o,onPointerMove:d,onPointerUp:f}},KM=(t,e)=>`style:${t}:${e}`,YM=t=>`text:${t}`,XM=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"]},QM=t=>XM(t)[0],I0=(t,e)=>XM(t).includes(e),AQ=t=>{const e=QM(t.elementId),n=t.batchId?`:${t.batchId}`:"";return t.type==="style"?`${KM(e,t.property)}${n}`:`${YM(e)}${n}`},cr=[];for(let t=0;t<256;++t)cr.push((t+256).toString(16).slice(1));function TQ(t,e=0){return(cr[t[e+0]]+cr[t[e+1]]+cr[t[e+2]]+cr[t[e+3]]+"-"+cr[t[e+4]]+cr[t[e+5]]+"-"+cr[t[e+6]]+cr[t[e+7]]+"-"+cr[t[e+8]]+cr[t[e+9]]+"-"+cr[t[e+10]]+cr[t[e+11]]+cr[t[e+12]]+cr[t[e+13]]+cr[t[e+14]]+cr[t[e+15]]).toLowerCase()}const IQ=new Uint8Array(16);function MQ(){return crypto.getRandomValues(IQ)}function $C(t,e,n){return crypto.randomUUID?crypto.randomUUID():OQ(t)}function OQ(t,e,n){var s;t=t||{};const r=t.random??((s=t.rng)==null?void 0:s.call(t))??MQ();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,TQ(r)}const LQ=300;class NQ{constructor(){ca(this,"history",{current:new Map,past:[],future:[]});ca(this,"pendingChanges",new Map);ca(this,"currentBatchId",null);ca(this,"debounceTimer",null);ca(this,"onChangeCallbacks",[]);ca(this,"stateBeforePending",null);ca(this,"transactionDepth",0)}recordChange(e){this.pendingChanges.size===0&&(this.currentBatchId=$C(),this.stateBeforePending=new Map(this.history.current)),this.currentBatchId&&(e.batchId=this.currentBatchId);const n=QM(e.elementId),r=e.type==="style"?KM(n,e.property):YM(n),s=Array.from(this.history.current.entries()).find(([o])=>o===r||o.startsWith(`${r}:`));if(s){const o=s[1];e.type==="style"&&o.type==="style"?e.oldValue=o.oldValue:e.type==="text"&&o.type==="text"&&(e.oldText=o.oldText)}const i=AQ(e);this.history.current.set(i,e),this.pendingChanges.set(i,e),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.commitPending()},LQ),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(){this.pendingChanges.size>0&&this.commitPending();const e=this.history.past.pop();if(!e)return null;const n=new Map(this.history.current);this.history.future.push(n),this.history.current=e,this.notifyChange();const r=[];for(const[s,i]of n)this.history.current.has(s)||r.push(i);return r}redo(){const e=this.history.future.pop();if(!e)return null;const n=new Map(this.history.current);this.history.past.push(n),this.history.current=e,this.notifyChange();const r=[];for(const[s,i]of this.history.current)n.has(s)||r.push(i);return r}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"&&I0(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"&&I0(r.elementId,e)).sort((r,s)=>s.timestamp-r.timestamp)[0]}hasChanges(e){return Array.from(this.history.current.values()).some(n=>I0(n.elementId,e))}getChangesForElement(e){return Array.from(this.history.current.values()).filter(n=>I0(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=$C(),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 og={kind:"base"};function wh(t){return t.kind==="base"?"base":`variant:${t.sessionId}:${t.variantId}`}function DQ(t,e){return t.kind==="base"&&e.kind,t.kind==="variant"&&e.kind==="variant"?t.sessionId===e.sessionId&&t.variantId===e.variantId:!1}const $Q={resize:{default:!1},variants:{default:!1},designSystemEditor:{default:!1},branchDiff:{default:!1},gitUi:{default:!0},createProject:{default:!1},deployPrototype:{default:!1},canvasShare:{default:!1},variantSend:{default:!1},generativeControls:{default:!1},refineMode:{default:!1},designContextViewer:{default:!1},variantReferences:{default:!1},inspectorUndoRedo:{default:!1}},JM=Object.fromEntries(Object.entries($Q).map(([t,e])=>[t,{isEnabled:e.default}]));dt("view");const eO=dt(!0),tO=dt(null),jQ=dt("chat"),nO=dt(0),FQ=dt({name:null,email:null}),jC=dt(og);dt(null);const xh=new Map,VQ=t=>{const e=wh(t);let n=xh.get(e);return n||(n=new NQ,xh.set(e,n)),n};dt(t=>VQ(t(jC)),(t,e,n)=>{xh.set(wh(t(jC)),n)});const HQ=t=>{for(const e of[...xh.keys()])e==="base"||t.has(e)||xh.delete(e)},bh=dt(new Map),FC=dt(null);dt(null);const aw=dt(0),ag=dt(null),lw=dt(!1),cw=dt(null),rO=dt(!1),sO=dt(!1),uw=dt(null),am=dt(null),ed=dt(null),Eb=dt(null),$o=dt(null),iO=dt(!1),Gh=dt({active:!1}),oO=dt([]),VC=dt(null),zQ=(t,e,n)=>{let r=!1;const s=new Map(t);for(const[i,o]of t)o.target&&DQ(o.target,e)&&(s.set(i,{...o,target:n}),r=!0);return r?s:t},BQ=dt(null,(t,e,n)=>{const r=u=>{const d=u??og;return d.kind==="variant"&&!n.has(wh(d))},s=t(bh);let i=null;for(const[u,d]of s)r(d.target)&&(i??(i=new Set)).add(u);if(i){const u=new Map(s);for(const d of i)u.delete(d);e(bh,u)}const o=t(FC);o&&r(o.target)&&(e(FC,null),e(GQ,!1));const l=t(VC);l&&(i!=null&&i.has(l.commentId))&&e(VC,null),HQ(n)}),dw=dt(JM),UQ=dt(!1),Cb=dt(null),zg=dt(!0),ZQ=dt(!1),aO=dt(!1),lO=dt(null),WQ=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},Bg=dt(WQ()),qQ=dt(null),GQ=dt(!1);dt(0);dt(0);function KQ(t){return t==="cursor"?"Cursor":t==="codex"?"Codex":t==="claude-desktop"?"Claude":"Claude Code"}const YQ=["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],Pb=({className:t,"data-testid":e}={})=>S.jsx("div",{className:`rivet-sparkle relative overflow-hidden font-mono leading-none ${t??"text-base text-primary"}`,style:{height:"1em",width:"4ch"},"aria-hidden":"true","data-testid":e,children:S.jsx("div",{className:"rivet-sparkle-strip",children:YQ.map((n,r)=>S.jsx("span",{className:"block",style:{height:"1em",lineHeight:"1em"},children:n},r))})}),cO=({primaryLabel:t,primaryIcon:e,primaryAction:n,isDisabled:r=!1,isDropdownDisabled:s=!1,isLoading:i=!1,loadingLabel:o,dropdownAriaLabel:l="More actions",dropdownItems:u})=>{const[d,f]=m.useState(!1),p=i?o??t:t,g=u.length>0;return S.jsxs("div",{className:"flex items-stretch",children:[S.jsxs("button",{onClick:n,disabled:r||i,className:`bg-main-hover hover:bg-main-input flex h-7 shrink-0 items-center gap-1.5 px-3 text-xs font-medium text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${g?"rounded-l-md":"rounded-md"}`,children:[e?S.jsx(e,{className:"h-3.5 w-3.5",weight:"bold"}):null,p]}),g?S.jsxs(xb,{open:d,onOpenChange:f,children:[S.jsx(bb,{asChild:!0,children:S.jsx("button",{"aria-label":l,disabled:s||i,title:l,className:"bg-main-hover hover:bg-main-input h-7 shrink-0 rounded-r-md border-l border-white/20 px-1.5 text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(YW,{className:"h-3.5 w-3.5",weight:"bold"})})}),S.jsx(Sb,{children:S.jsx(kb,{className:"border-divider bg-main z-[60] min-w-[140px] rounded-lg border p-1 shadow-lg",sideOffset:5,align:"end",children:u.map(v=>{const w=v.icon;return S.jsxs("button",{onClick:()=>{v.isDisabled||(v.onClick(),f(!1))},disabled:v.isDisabled,className:"text-content hover:bg-hover flex w-full items-center gap-2 rounded px-3 py-1.5 text-xs transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[w?S.jsx(w,{className:"h-3.5 w-3.5",weight:"bold"}):null,v.label]},v.label)})})})]}):null]})},fc=({label:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=300,disabled:i=!1,forceOpen:o})=>i?S.jsx(S.Fragment,{children:e}):S.jsx(ob,{content:t,side:n,sideOffset:r,delayDuration:s,forceOpen:o,children:e}),Ug="/__rivet/preview",HC=`${Ug}/variant/`,zC=`${Ug}/history/`,uO=t=>t?t.startsWith("/")?t:`/${t}`:"/",XQ=t=>`${Ug}/variant/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${uO(t.routePath)}`,QQ=t=>`${Ug}/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${uO(t.routePath)}`,JQ=t=>{try{const e=new URL(t,"http://localhost");return e.pathname.startsWith(HC)||e.pathname.startsWith(zC)}catch{return t.startsWith(HC)||t.startsWith(zC)}},BC=t=>{var s,i,o,l;const{sessionId:e,variant:n,projectContext:r}=t;return n.status!=="succeeded"?null:((s=n.preview)==null?void 0:s.kind)==="static_artifact"?n.preview.url:e&&(((i=n.preview)==null?void 0:i.kind)==="dev_server"||typeof n.port=="number")?XQ({sessionId:e,variantId:n.workItemId,routePath:t.routePath}):e&&(r==null?void 0:r.kind)==="fresh"&&((o=r.executionPlan)==null?void 0:o.mode)!=="vite_app"&&((l=n.preview)==null?void 0:l.kind)!=="dev_server"?`/api/variants/${e}/static/${n.workItemId}`:null},UC="/rivet/",dO=t=>{if(!t.startsWith(UC))return null;const e=t.slice(UC.length);return!e||e==="/"?null:`/${e}`},td=(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(()=>{})},eJ=(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),td(r,e))}},lg=(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}}},ZC=6,fO="original",Rb="Original",hO="The original state of your app before any variants were generated.",WC=200,pO="h-6 w-6 rounded",fw=[.33,1,.68,1],hw=.22,An=Cs("AgentVariantsPanel"),Ky=()=>{var t;(t=window.getSelection())==null||t.removeAllRanges()},iu=t=>{var e;return!!t.hasTree&&((e=t.serve)==null?void 0:e.kind)==="dev-server"},tJ=t=>{var e;return t?t.kind==="existing"?!0:((e=t.executionPlan)==null?void 0:e.mode)==="vite_app":!1};function Yy(t,...e){return t?e.some(n=>(n??"").toLowerCase().includes(t)):!0}const nJ=(t,e)=>{if(t.kind==="original")return null;const n=t.kind==="active"?t.variant.runLabel:t.entry.runLabel,r=n==null?void 0:n.trim();return r?t.kind==="active"?e?{label:r,run:t.variant.requestId?{sessionId:e,requestId:t.variant.requestId}:{sessionId:e,runLabel:r}}:null:{label:r,run:t.entry.requestId?{sessionId:t.entry.sessionId,requestId:t.entry.requestId}:{sessionId:t.entry.sessionId,runLabel:r}}:null},mO=t=>{const e="requestId"in t?["request",t.requestId]:["label",t.runLabel];return`run:${JSON.stringify([t.sessionId,...e])}`},rJ="original",pw="pinned-section";function gO(t){return`rivet:collapsedRuns:${t}`}function M0(t){try{const e=window.localStorage.getItem(gO(t)),n=e?JSON.parse(e):null;return Array.isArray(n)?new Set(n.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function Xy(t,e){try{window.localStorage.setItem(gO(t),JSON.stringify([...e]))}catch{}}const qC=(t,e)=>{const n=[],r=new Map;for(const s of t){const i=nJ(s,e);let o="";s.kind==="original"?o=rJ:i&&(o=mO(i.run));let l=r.get(o);l||(l={key:o,label:(i==null?void 0:i.label)??null,run:(i==null?void 0:i.run)??null,rows:[]},r.set(o,l),n.push(l)),l.rows.push(s)}return n};async function Pi(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 sJ=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},Uf=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")},vO=t=>{var e;return((e=t.previewUnavailable)==null?void 0:e.reason)==="idle_timeout"},iJ=t=>t.status==="succeeded"&&!Uf(t)&&(!t.previewUnavailable||vO(t)),Qy=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"},GC=(t,e,n)=>{const r=t.includes("?")?"&":"?";return`${t}${r}${encodeURIComponent(e)}=${encodeURIComponent(n)}`},oJ=t=>{var e;return sJ(t)&&((e=t.preview)==null?void 0:e.kind)==="static_artifact"},KC=(t,e)=>t.map(n=>`${n.workItemId}:${e[n.workItemId]??""}`).join("|"),aJ=(t,e)=>t.length===e.length&&t.every((n,r)=>{var i,o;const s=e[r];return n.sessionId===s.sessionId&&n.variantId===s.variantId&&n.requestId===s.requestId&&n.label===s.label&&n.brief===s.brief&&JSON.stringify(n.references)===JSON.stringify(s.references)&&n.runLabel===s.runLabel&&n.createdAt===s.createdAt&&((i=n.serve)==null?void 0:i.kind)===((o=s.serve)==null?void 0:o.kind)&&n.hasTree===s.hasTree}),lJ=()=>{var Wo,qo,Xs,op;const t=Eg(),e=ct(Gh),n=ct(iO),r=m.useRef(!1),s=ct(oO),i=ct(Cb),o=ct(zg),l=ct(dw),u=((Wo=l.deployPrototype)==null?void 0:Wo.isEnabled)??!1,d=((qo=l.canvasShare)==null?void 0:qo.isEnabled)??!1,f=((Xs=l.variantSend)==null?void 0:Xs.isEnabled)??!1,p=((op=l.designContextViewer)==null?void 0:op.isEnabled)??!1,g=ct(aO),v=ct(lO),w=mt(aw),_=mt(ag),x=mt(lw),b=mt(cw),E=mt(rO),C=mt(sO),R=mt(ed),A=ct(ed),I=mt(Eb),M=mt(tO);m.useEffect(()=>(M("Directions"),()=>M(null)),[M]);const T=ct($o),L=mt($o),D=m.useCallback(($=!1)=>{if(eJ(T),L(null),$&&T){const le=lg("ended",T);Ce.capture(le.event,le.properties)}},[L,T]),j=ct(uw),H=mt(uw),Y=ct(am),U=mt(am),z=Y?`${Y.sessionId}:${Y.variantId}`:null,[Z,Q]=m.useState(""),[B,ee]=m.useReducer($=>$+1,0),W=m.useMemo(()=>i!==null?M0(i):new Set,[i,B]),N=m.useCallback($=>{if(i===null)return;const le=new Set(M0(i));le.delete($)||le.add($),Xy(i,le),ee()},[i]),[X,oe]=m.useState(null),[re,se]=m.useState(null),[fe,_e]=m.useState(!1),[de,ae]=m.useState({}),[Oe,ke]=m.useState(null),[Ge,vt]=m.useState({}),[It,Yt]=m.useState(null),[wt,yt]=m.useState([]),We=m.useRef([]);We.current=wt;const[Ke,St]=m.useState(!1),[Re]=m.useState(()=>NG(window.location.search)),Ye=m.useRef(!1),Mt=m.useRef(!1);Mt.current=Re!==null||Y!==null||j!==null||Ke;const qe=m.useMemo(()=>e.active?e.variants:[],[e]),kt=m.useMemo(()=>qe.filter(oJ),[qe]),ns=m.useMemo(()=>KC(kt,de),[kt,de]),mr=(Oe==null?void 0:Oe.key)===ns?Oe.shareUrl:null,Le=e.active?e.sessionId:null,Bo=m.useMemo(()=>{const $=new Set;for(const le of qe)le.adoptedSource&&$.add(`${le.adoptedSource.sessionId}:${le.adoptedSource.variantId}`);return $},[qe]),Mn=m.useMemo(()=>[...wt.filter(le=>le.sessionId!==Le&&!Bo.has(`${le.sessionId}:${le.variantId}`))].sort((le,Ee)=>{const he=new Date(le.createdAt).getTime(),pe=new Date(Ee.createdAt).getTime();return(Number.isNaN(pe)?0:pe)-(Number.isNaN(he)?0:he)}),[Bo,wt,Le]),Yn=m.useMemo(()=>Y?qe.find($=>{var le,Ee;return((le=$.adoptedSource)==null?void 0:le.sessionId)===Y.sessionId&&((Ee=$.adoptedSource)==null?void 0:Ee.variantId)===Y.variantId})??null:null,[Y,qe]),rl=m.useMemo(()=>Y?Mn.find($=>$.sessionId===Y.sessionId&&$.variantId===Y.variantId)??null:null,[Y,Mn]),mn=e.active?e.projectContext:null,gn=(mn==null?void 0:mn.kind)==="fresh"?mn.workspacePath:i,gd=!e.active&&Mn.length>0&&Mn.every($=>$.projectKind==="fresh"),Ps=e.active?tJ(mn):!!i&&!gd,gr=m.useMemo(()=>gn?`?projectPath=${encodeURIComponent(gn)}`:"",[gn]),{pinnedKeys:Xn,pinnedKeySet:Yi,listOrder:Gs,togglePin:On,pinItem:Rs,reorder:sl}=PQ(gn),Xi=m.useRef(null),rs=m.useRef(null),Xe=typeof window>"u"?"/":dO(window.location.pathname)??"/",Ot=m.useRef(null),Ft=m.useRef(!1),zn=m.useCallback(($,le)=>{le.button!==0&&le.pointerType==="mouse"||(le.preventDefault(),Ky(),Ot.current={kind:"live",variantId:$,startX:le.clientX,startY:le.clientY,committed:!1})},[]),ss=m.useCallback(($,le)=>{le.button!==0&&le.pointerType==="mouse"||(le.preventDefault(),Ky(),Ot.current={kind:"past",entry:$,startX:le.clientX,startY:le.clientY,committed:!1})},[]);m.useEffect(()=>{const $=he=>{const pe=Ot.current;if(!pe)return;const be=he.clientX-pe.startX,Qe=he.clientY-pe.startY;if(!pe.committed){if(be*be+Qe*Qe<ZC*ZC)return;if(Ky(),pe.kind==="live"){const Pe=qe.find(vn=>vn.workItemId===pe.variantId);if(!Pe||Pe.status!=="succeeded"){Ot.current=null;return}const en=BC({sessionId:Le,variant:Pe,projectContext:mn,routePath:Xe});R({sessionId:Le??"",variantId:Pe.workItemId,label:Pe.label||"Direction",url:en,source:"live",runLabel:Pe.runLabel,description:Pe.description})}else{const{entry:Pe}=pe,en=iu(Pe),vn=en?QQ({sessionId:Pe.sessionId,variantId:Pe.variantId,routePath:Xe}):`/api/variants/history/${encodeURIComponent(Pe.sessionId)}/${encodeURIComponent(Pe.variantId)}/preview${gr}`;if(R({sessionId:Pe.sessionId,variantId:Pe.variantId,label:Pe.label||"Direction",url:vn,source:en?"history-dev-server":"history-static",runLabel:Pe.runLabel,description:Pe.brief}),en){const Er=GC(`/api/variants/history/${encodeURIComponent(Pe.sessionId)}/${encodeURIComponent(Pe.variantId)}/run${gr}`,"targetAddressed","1");(async()=>{try{if(!(await fetch(Er,{method:"POST"})).ok)return;const ls=GC(vn,"replay",String(Date.now()));R(lt=>!lt||lt.sessionId!==Pe.sessionId||lt.variantId!==Pe.variantId||lt.source!=="history-dev-server"?lt:{...lt,url:ls}),L(lt=>{if(!lt)return lt;const Vt=Qs=>!Qs||Qs.sessionId!==Pe.sessionId||Qs.variantId!==Pe.variantId?Qs:{...Qs,url:ls};return{...lt,left:Vt(lt.left),right:Vt(lt.right)}})}catch(as){An.warn("history replay drag boot failed",as)}})()}}pe.committed=!0}I({x:he.clientX,y:he.clientY})},le=()=>{const he=Ot.current;he!=null&&he.committed&&(Ft.current=!0,window.setTimeout(()=>{Ft.current=!1},0)),Ot.current=null,I(null)},Ee=he=>{if(he.key!=="Escape")return;const pe=Ot.current;pe!=null&&pe.committed&&(pe.kind==="past"&&iu(pe.entry)&&td({sessionId:pe.entry.sessionId,variantId:pe.entry.variantId,source:"history-dev-server"}),Ot.current=null,R(null),I(null))};return window.addEventListener("pointermove",$),window.addEventListener("pointerup",le),window.addEventListener("pointercancel",le),window.addEventListener("keydown",Ee),()=>{window.removeEventListener("pointermove",$),window.removeEventListener("pointerup",le),window.removeEventListener("pointercancel",le),window.removeEventListener("keydown",Ee)}},[qe,Le,mn,Xe,gr,R,I,L]);const Bt=m.useCallback(()=>{var $;($=Ot.current)!=null&&$.committed&&(Ft.current=!0,window.setTimeout(()=>{Ft.current=!1},0)),Ot.current=null,I(null),A&&(A.source==="history-dev-server"&&td({sessionId:A.sessionId,variantId:A.variantId,source:"history-dev-server"}),R(null))},[A,R,I]),Ln=m.useCallback(($,le)=>{const Ee=!Yi.has($);Ce.capture(Ee?"variants_panel.direction_pinned":"variants_panel.direction_unpinned",{method:le}),On($)},[Yi,On]),$r=m.useCallback(()=>{A&&(Ce.capture("variants_panel.direction_pinned",{method:"drag"}),Rs(`row:past:${A.sessionId}:${A.variantId}`),Bt())},[A,Bt,Rs]),Ks=m.useCallback($=>{Ce.capture("variants_panel.direction_unpinned",{method:"drag"}),On($),Bt()},[On,Bt]),or=m.useCallback(($,le)=>{sl($,le),Bt()},[sl,Bt]),Pn=m.useMemo(()=>{var le;if(Ke||z)return null;const $=j?qe.find(Ee=>Ee.workItemId===j):null;return j&&!$?null:$?Uf($)?$.workItemId:null:e.active?((le=qe.find(Ee=>{var he,pe;return Uf(Ee)&&(((he=Ee.preview)==null?void 0:he.kind)==="static_artifact"||((pe=Ee.preview)==null?void 0:pe.kind)==="dev_server")}))==null?void 0:le.workItemId)??null:null},[j,z,Ke,e,qe]),il=Ke||Ps&&j===null&&z===null&&Pn===null,gc=m.useCallback(async $=>{var Ee,he,pe,be;if(!Le)return;const le=($==null?void 0:$.workItemId)??null;oe({kind:"switch",variantId:le??void 0});try{if(((Ee=$==null?void 0:$.preview)==null?void 0:Ee.kind)==="static_artifact"){if(x(!1),b(null),((he=$.refinement)==null?void 0:he.status)==="succeeded"){const Pe=$.preview.url.includes("?")?"&":"?";_(`${$.preview.url}${Pe}refinement=${encodeURIComponent($.refinement.workItemId)}`)}else _($.preview.url);w(Pe=>Pe+1);return}if(le&&Le&&e.active&&e.projectContext.kind==="fresh"&&((pe=e.projectContext.executionPlan)==null?void 0:pe.mode)!=="vite_app"&&((be=$==null?void 0:$.preview)==null?void 0:be.kind)!=="dev_server"){x(!1),b(null),_(`/api/variants/${Le}/static/${le}`),w(Pe=>Pe+1);return}const Qe=$&&le?BC({sessionId:Le,variant:$,projectContext:e.active?e.projectContext:null,routePath:Xe}):null;if(Qe){x(!1),b(null),_(Qe),w(Pe=>Pe+1);return}Ce.capture("variants_panel.preview_display_failed",{sessionId:Le,variantId:le,previewKind:$?Qy($):"none",hasPreview:!!($!=null&&$.preview),hasPort:typeof($==null?void 0:$.port)=="number",errorMessage:"No addressable dev-server preview URL"}),x(!1),b(null)}catch(Qe){An.warn("preview display failed",Qe),Ce.capture("variants_panel.preview_display_failed",{sessionId:Le,variantId:le,previewKind:$?Qy($):"none",hasPreview:!!($!=null&&$.preview),hasPort:typeof($==null?void 0:$.port)=="number",errorMessage:Qe instanceof Error?Qe.message:String(Qe)}),x(!1),b(null)}finally{oe(null)}},[Le,e,Xe,w,_,x,b]),vc=m.useRef(!1),yc=m.useRef(null),As=m.useRef(0),Qi=m.useCallback(()=>{if(As.current++,E(!1),C(!1),!vc.current)return;const $=yc.current;vc.current=!1,yc.current=null;const le=$?new URLSearchParams({sessionId:$.sessionId,variantId:$.variantId}):null,Ee=le?`/api/variants/history/replay/stop?${le.toString()}`:"/api/variants/history/replay/stop";fetch(Ee,{method:"POST"}).catch(he=>An.warn("history replay stop failed",he))},[E,C]),vd=m.useCallback(async $=>{if(Le){oe({kind:"switch",variantId:$.workItemId});try{const le=await fetch(`/api/variants/${Le}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:$.workItemId})});if(!le.ok){const Ee=await Pi(le);throw new Error(Ee.message??`Preview restoration failed (${le.status})`)}}catch(le){An.warn("preview restoration failed",le),Ce.capture("variants_panel.preview_display_failed",{sessionId:Le,variantId:$.workItemId,previewKind:"dev_server",hasPreview:!1,hasPort:!1,errorMessage:le instanceof Error?le.message:String(le)})}finally{oe(null)}}},[Le]),_c=m.useCallback($=>{var be,Qe,Pe,en,vn;if(Ft.current){Ft.current=!1;return}const le=Uf($),Ee=$.status==="pending"||$.status==="running"||iJ($);Qi();const he=Qy($),pe=qe.find(Er=>Er.workItemId===j);Ce.capture("variants_panel.preview_requested",{sessionId:Le,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:$.workItemId,variantStatus:$.status,isPreviewReady:le,isArmed:Ee,previewKind:he,hasPreview:!!$.preview,hasPort:typeof $.port=="number",viewEnabled:((Qe=(be=$.actions)==null?void 0:be.view)==null?void 0:Qe.enabled)??null,previewUnavailableReason:((Pe=$.previewUnavailable)==null?void 0:Pe.reason)??null}),H($.workItemId),U(null),le?(rs.current=$.workItemId,St(!1),D(!0),gc($)):(rs.current=null,St(!1),_(null),x(!1),Ee&&Ce.capture("variants_panel.preview_armed",{sessionId:Le,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:$.workItemId,variantStatus:$.status,previewKind:he,hasPreview:!!$.preview,hasPort:typeof $.port=="number",viewEnabled:((vn=(en=$.actions)==null?void 0:en.view)==null?void 0:vn.enabled)??null}),vO($)&&vd($)),Ce.capture("variants_panel.preview_switched",{sessionId:Le,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:$.workItemId,armed:Ee})},[j,Le,D,H,U,Qi,vd,gc,qe,_,x]),yd=e.active?`${e.sessionId}:${e.stage}`:"inactive",wc=m.useRef(!1);m.useEffect(()=>{if(o)return;let $=!1;return(async()=>{try{const le=await fetch(`/api/variants/history${gr}`,{credentials:"same-origin"});if(!le.ok)return;const Ee=await le.json();if($)return;const he=(Ee.variants??[]).filter(pe=>{var be,Qe;return((be=pe.preview)==null?void 0:be.kind)==="static"||((Qe=pe.serve)==null?void 0:Qe.kind)==="static"||iu(pe)});if(!wc.current&&!Mt.current&&yd==="inactive"&&he.length>0&&he.every(pe=>pe.projectKind==="fresh")){const pe=[...he].sort((be,Qe)=>new Date(Qe.createdAt).getTime()-new Date(be.createdAt).getTime()).find(be=>!iu(be));pe&&(wc.current=!0,U({sessionId:pe.sessionId,variantId:pe.variantId,previewKind:"static",references:pe.references,projectPath:gn??void 0}),St(!1),_(`/api/variants/history/${encodeURIComponent(pe.sessionId)}/${encodeURIComponent(pe.variantId)}/preview${gr}`))}if(U(pe=>{if(!pe)return pe;const be=he.find(Qe=>Qe.sessionId===pe.sessionId&&Qe.variantId===pe.variantId);return!be||JSON.stringify(pe.references)===JSON.stringify(be.references)?pe:{...pe,references:be.references}}),aJ(We.current,he))return;We.current=he,yt(he)}catch(le){An.warn("Failed to load past variants",le)}})(),()=>{$=!0}},[o,gn,yd,gr,_,U]);const xc=m.useCallback(()=>{vc.current=!1,yc.current=null,E(!1),C(!1),U(null),H(null),St(!0),x(!1),b(null),_(null),w($=>$+1)},[H,E,C,w,_,b,U,x]),Uo=m.useCallback($=>{if(Ft.current){Ft.current=!1;return}if(D(!0),U({sessionId:$.sessionId,variantId:$.variantId,previewKind:iu($)?"dev_server":"static",references:$.references,projectPath:gn??void 0}),H(null),St(!1),iu($)){const le=++As.current;vc.current=!0,yc.current={sessionId:$.sessionId,variantId:$.variantId},E(!0),C(!0),(async()=>{oe({kind:"switch"}),Ce.capture("variants_panel.history_replay_started",{sessionId:$.sessionId,variantId:$.variantId});const Ee=he=>Ce.capture("variants_panel.history_replay_failed",{sessionId:$.sessionId,variantId:$.variantId,...he});try{const he=await fetch(`/api/variants/history/${encodeURIComponent($.sessionId)}/${encodeURIComponent($.variantId)}/run${gr}`,{method:"POST"});if(le!==As.current)return;if(!he.ok){const{errorCode:pe}=await Pi(he);An.warn(`history replay failed: HTTP ${he.status} ${pe??""}`),Ee({httpStatus:he.status,errorCode:pe}),xc();return}C(!1),x(!0),b(null),_(null),w(pe=>pe+1),Ce.capture("variants_panel.history_replay_ready",{sessionId:$.sessionId,variantId:$.variantId})}catch(he){if(le!==As.current)return;An.warn("history replay failed",he),Ee({errorMessage:he instanceof Error?he.message:String(he)}),xc()}finally{oe(null)}})();return}Qi(),x(!1),b(null),_(`/api/variants/history/${encodeURIComponent($.sessionId)}/${encodeURIComponent($.variantId)}/preview${gr}`)},[gn,xc,oe,E,C,w,U,H,_,b,D,x,Qi,gr]);m.useEffect(()=>{if(!Re||Ye.current)return;const $=wt.find(le=>le.sessionId===Re.sessionId&&le.variantId===Re.variantId);$&&(Ye.current=!0,Uo($))},[Re,wt,Uo]);const _d=m.useCallback(async()=>{Qi();const $=()=>{D(!0),H(null),U(null),St(!0),rs.current=null,x(!1),b(null),_(null),w(le=>le+1)};if(!Le){$();return}oe({kind:"switch"});try{const le=await fetch(`/api/variants/${Le}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})});if(!le.ok){An.warn(`switch to original failed: HTTP ${le.status}`);return}$(),x(!0),Ce.capture("variants_panel.preview_switched",{sessionId:Le,fromVariantId:j,toVariantId:null,target:"original",armed:!1})}catch(le){An.warn("preview-port original switch failed",le)}finally{oe(null)}},[j,Le,H,U,w,_,b,D,x,Qi]),Qg=m.useCallback(async $=>{var Ee,he;const le=((he=(Ee=$.actions)==null?void 0:Ee.commit)==null?void 0:he.enabled)??$.status==="succeeded";if(!(!Le||!le)){Ce.capture("variants_panel.commit_clicked",{sessionId:Le,variantId:$.workItemId,variantLabel:$.label}),oe({kind:"commit",variantId:$.workItemId});try{const pe=await fetch(`/api/variants/${Le}/commit`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:$.workItemId})});if(!pe.ok){const{message:Qe,errorCode:Pe}=await Pi(pe);An.warn(`commit failed: HTTP ${pe.status} ${Pe??""} ${Qe??""}`),Ce.capture("variants_panel.commit_failed",{sessionId:Le,variantId:$.workItemId,httpStatus:pe.status,errorCode:Pe??null,errorMessage:Qe??null}),Rt.error("Couldn't send direction",{description:Qe??`The server rejected the request (HTTP ${pe.status}). Try again, or pick a different direction.`});return}const be=await pe.json().catch(()=>null);Ce.capture("variants_panel.commit_succeeded",{sessionId:Le,variantId:$.workItemId,payloadKind:(be==null?void 0:be.payloadKind)??null,duplicate:(be==null?void 0:be.duplicate)??!1}),Rt.success(`Sent "${$.label}" to your project`,{description:(be==null?void 0:be.payloadKind)==="project-created"?`Project created at ${(be==null?void 0:be.destinationPath)??"destination"}.`:"Direction diff applied to your working tree (uncommitted)."}),(be==null?void 0:be.payloadKind)!=="project-created"&&(_(null),x(!1),w(Qe=>Qe+1))}catch(pe){An.warn("commit failed",pe),Ce.capture("variants_panel.commit_failed",{sessionId:Le,variantId:$.workItemId,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:pe instanceof Error?pe.message:String(pe)}),Rt.error("Couldn't send direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{oe(null)}}},[Le,w,_,x]),Xt=m.useCallback(async($,le,Ee)=>{Ce.capture("variants_panel.deploy_clicked",{sessionId:$,variantId:le,variantLabel:Ee});try{const he=await fetch(`/api/variants/${$}/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:le,...i?{projectPath:i}:{}})});if(!he.ok){const{message:Qe,errorCode:Pe}=await Pi(he);return An.warn(`deploy failed: HTTP ${he.status} ${Pe??""} ${Qe??""}`),Ce.capture("variants_panel.deploy_failed",{sessionId:$,variantId:le,httpStatus:he.status,errorCode:Pe??null,errorMessage:Qe??null}),Rt.error("Couldn't deploy this direction",{description:Qe??`The server rejected the request (HTTP ${he.status}). Try again.`}),null}const pe=await he.json().catch(()=>null),be=pe==null?void 0:pe.shareUrl;return be?(await navigator.clipboard.writeText(be).catch(()=>{}),Ce.capture("variants_panel.deploy_succeeded",{sessionId:$,variantId:le}),Rt.success(`"${Ee}" is live — link copied`,{action:{label:"Open",onClick:()=>window.open(be,"_blank","noopener")}}),be):(Rt.error("Couldn't deploy this direction",{description:"The deploy host returned an unexpected response."}),null)}catch(he){return An.warn("deploy failed",he),Ce.capture("variants_panel.deploy_failed",{sessionId:$,variantId:le,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:he instanceof Error?he.message:String(he)}),Rt.error("Couldn't deploy this direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."}),null}},[i]),Jg=m.useCallback(async $=>{if(!Le)return;const le=de[$.workItemId];if(le){await navigator.clipboard.writeText(le).catch(()=>{}),Rt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(le,"_blank","noopener")}});return}oe({kind:"deploy",variantId:$.workItemId});try{const Ee=await Xt(Le,$.workItemId,$.label);Ee&&ae(he=>({...he,[$.workItemId]:Ee}))}finally{oe(null)}},[Le,de,Xt]),wd=m.useCallback(async()=>{if(!(!Le||kt.length===0)){if(mr){await navigator.clipboard.writeText(mr).catch(()=>{}),Rt.success("Canvas link copied",{action:{label:"Open",onClick:()=>window.open(mr,"_blank","noopener")}});return}Ce.capture("variants_panel.deploy_clicked",{sessionId:Le,variantId:"canvas",variantLabel:"Canvas",variantCount:kt.length}),oe({kind:"deploy-canvas"});try{const $=await fetch(`/api/variants/${Le}/canvas/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantIds:kt.map(be=>be.workItemId),...i?{projectPath:i}:{}})});if(!$.ok){const{message:be,errorCode:Qe}=await Pi($);An.warn(`canvas deploy failed: HTTP ${$.status} ${Qe??""} ${be??""}`),Ce.capture("variants_panel.deploy_failed",{sessionId:Le,variantId:"canvas",httpStatus:$.status,errorCode:Qe??null,errorMessage:be??null,variantCount:kt.length}),Rt.error("Couldn't share this canvas",{description:be??`The server rejected the request (HTTP ${$.status}). Try again.`});return}const le=await $.json().catch(()=>null),Ee=le==null?void 0:le.shareUrl;if(!Ee){Rt.error("Couldn't share this canvas",{description:"The deploy host returned an unexpected response."});return}const he=Object.fromEntries(((le==null?void 0:le.variants)??[]).filter(be=>typeof be.variantId=="string"&&typeof be.shareUrl=="string").map(be=>[be.variantId,be.shareUrl])),pe=Object.keys(he).length>0?{...de,...he}:de;pe!==de&&ae(pe),await navigator.clipboard.writeText(Ee).catch(()=>{}),ke({key:KC(kt,pe),shareUrl:Ee}),Ce.capture("variants_panel.deploy_succeeded",{sessionId:Le,variantId:"canvas",variantCount:kt.length}),Rt.success("Canvas is live — link copied",{action:{label:"Open",onClick:()=>window.open(Ee,"_blank","noopener")}})}catch($){An.warn("canvas deploy failed",$),Ce.capture("variants_panel.deploy_failed",{sessionId:Le,variantId:"canvas",httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:$ instanceof Error?$.message:String($),variantCount:kt.length}),Rt.error("Couldn't share this canvas",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{oe(null)}}},[mr,kt,de,i,Le]),Jh=m.useCallback(async $=>{const le=`${$.sessionId}:${$.variantId}`,Ee=Ge[le];if(Ee){await navigator.clipboard.writeText(Ee).catch(()=>{}),Rt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(Ee,"_blank","noopener")}});return}Yt(le);try{const he=await Xt($.sessionId,$.variantId,$.label);he&&vt(pe=>({...pe,[le]:he}))}finally{Yt(null)}},[Ge,Xt]),Zo=m.useCallback(async $=>{if(Le){Ce.capture("variants_panel.remove_clicked",{sessionId:Le,variantId:$.workItemId,variantLabelLength:$.label.length}),oe({kind:"remove",variantId:$.workItemId});try{const le=await fetch(`/api/variants/${Le}/${$.workItemId}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!le.ok){const{message:Ee}=await Pi(le);An.warn(`remove failed: HTTP ${le.status} ${Ee??""}`),Rt.error("Couldn't remove direction",{description:Ee??`The server rejected the request (HTTP ${le.status}). Try again.`});return}($.workItemId===Pn||$.workItemId===j)&&(H(null),_(null),x(!1),w(Ee=>Ee+1))}catch(le){An.warn("remove failed",le),Rt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{oe(null)}}},[Le,j,Pn,H,_,x,w]),xd=m.useCallback(async $=>{if(!gn){Rt.error("Couldn't remove direction",{description:"No project path available."});return}Ce.capture("variants_panel.remove_past_clicked",{sessionId:$.sessionId,variantId:$.variantId});const le=`${$.sessionId}:${$.variantId}`,Ee=he=>he.sessionId===$.sessionId&&he.variantId===$.variantId;oe({kind:"remove",variantId:le}),yt(he=>he.filter(pe=>!Ee(pe))),z===le&&(U(null),_(null),x(!1),w(he=>he+1));try{const he=await fetch(`/api/variants/history/${encodeURIComponent($.sessionId)}/${encodeURIComponent($.variantId)}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectPath:gn})});if(!he.ok){const{message:pe}=await Pi(he);yt(be=>be.some(Ee)?be:[...be,$]),Rt.error("Couldn't remove direction",{description:pe??`The server rejected the request (HTTP ${he.status}). Try again.`})}}catch(he){An.warn("remove past failed",he),yt(pe=>pe.some(Ee)?pe:[...pe,$]),Rt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{oe(null)}},[gn,z,U,_,x,w]),bd=m.useCallback($=>{se($)},[]),bc=m.useCallback($=>{if(!$.label||!$.run)return;const le=$.rows.flatMap(he=>he.kind==="active"?[he.variant]:[]),Ee=$.rows.flatMap(he=>he.kind==="past"?[he.entry]:[]);le.length===0&&Ee.length===0||se({kind:"run",label:$.label,variants:le,entries:Ee})},[]),Ts=m.useCallback(async()=>{if(!(!re||fe)){_e(!0);try{if(re.kind==="active")await Zo(re.variant);else if(re.kind==="past")await xd(re.entry);else{for(const $ of re.variants)await Zo($);for(const $ of re.entries)await xd($)}}finally{_e(!1),se(null)}}},[re,fe,Zo,xd]),[ep,is]=m.useState(null),[ev,Sd]=m.useState(null),tv=m.useCallback($=>{Sd($)},[]),Sc=m.useCallback(()=>{Sd(null)},[]),kc=m.useCallback(async $=>{const le=$.trim();if(le)try{await navigator.clipboard.writeText(le),Rt.success("Copied")}catch{Rt.error("Couldn't copy")}},[]),ol=m.useCallback(async($,le)=>{Sd(null);const Ee=le.trim();if(!Ee||$.kind==="original")return;if($.kind==="active"){if(!Le||Ee===$.variant.label)return;Ce.capture("variants_panel.rename",{sessionId:Le,variantId:$.variant.workItemId,labelLength:Ee.length,past:!1});try{const be=await fetch(`/api/variants/${Le}/${$.variant.workItemId}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Ee})});if(!be.ok){const{message:Qe}=await Pi(be);Rt.error("Couldn't rename direction",{description:Qe??`The server rejected the request (HTTP ${be.status}). Try again.`})}}catch(be){An.warn("rename failed",be),Rt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}return}const{entry:he}=$;if(Ee===he.label.trim())return;if(!gn){Rt.error("Couldn't rename direction",{description:"No project path available."});return}Ce.capture("variants_panel.rename",{sessionId:he.sessionId,variantId:he.variantId,labelLength:Ee.length,past:!0});const pe=be=>be.sessionId===he.sessionId&&be.variantId===he.variantId;yt(be=>be.map(Qe=>pe(Qe)?{...Qe,label:Ee}:Qe));try{const be=await fetch(`/api/variants/history/${encodeURIComponent(he.sessionId)}/${encodeURIComponent(he.variantId)}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Ee,projectPath:gn})});if(!be.ok){const{message:Qe}=await Pi(be);yt(Pe=>Pe.map(en=>pe(en)?{...en,label:he.label}:en)),Rt.error("Couldn't rename direction",{description:Qe??`The server rejected the request (HTTP ${be.status}). Try again.`})}}catch(be){An.warn("rename failed",be),yt(Qe=>Qe.map(Pe=>pe(Pe)?{...Pe,label:he.label}:Pe)),Rt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}},[Le,gn]),[Ec,kd]=m.useState(null),nv=m.useCallback($=>{kd($)},[]),Ed=m.useCallback(()=>{kd(null)},[]),tp=m.useCallback(async($,le)=>{if(kd(null),!$.label||!$.run)return;const Ee=$.label,he=le.trim();if(!he||he===Ee)return;Ce.capture("variants_panel.rename_run",{runLabelLength:he.length});const pe="requestId"in $.run?$.run.requestId:void 0,be=pe?$.key:mO({sessionId:$.run.sessionId,runLabel:he}),Qe=be!==$.key;let Pe=!1,en=!1;if(i!==null&&Qe){const lt=M0(i);Pe=lt.has($.key),en=lt.has(be),Pe&&(lt.add(be),Xy(i,lt),ee())}const vn=lt=>{if(i===null||!Qe)return;const Vt=M0(i);lt?Vt.delete($.key):(Pe?Vt.add($.key):Vt.delete($.key),en?Vt.add(be):Vt.delete(be)),Xy(i,Vt),ee()},Er=new Set($.rows.flatMap(lt=>lt.kind==="past"?[`${lt.entry.sessionId}:${lt.entry.variantId}`]:[])),as=lt=>Er.has(`${lt.sessionId}:${lt.variantId}`);yt(lt=>lt.map(Vt=>as(Vt)?{...Vt,runLabel:he}:Vt));const ls=()=>yt(lt=>lt.map(Vt=>as(Vt)?{...Vt,runLabel:Ee}:Vt));try{const lt=await fetch("/api/variants/runs/rename",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:$.run.sessionId,...pe?{requestId:pe}:{},runLabel:Ee,label:he,...gn?{projectPath:gn}:{}})});if(lt.ok)vn(!0);else{const{message:Vt}=await Pi(lt);ls(),vn(!1),Rt.error("Couldn't rename run",{description:Vt??`The server rejected the request (HTTP ${lt.status}). Try again.`})}}catch(lt){An.warn("run rename failed",lt),ls(),vn(!1),Rt.error("Couldn't rename run",{description:"Network or server error. Try again."})}},[gn,i,yt]);m.useEffect(()=>{const $=n&&!r.current;if(r.current=n,Xi.current!==Le){const Ee=Xi.current===null;Xi.current=Le;const he=t.get(am);if($&&Re&&(he==null?void 0:he.sessionId)===Re.sessionId&&(he==null?void 0:he.variantId)===Re.variantId||(rs.current=null,ke(null),_(null),x(!1),b(null),D(),H(null),U(null),St(!1),wc.current=!1,!Ee))return}if(z||Ke||!Pn||e.active!==!0||rs.current===Pn)return;const le=qe.find(Ee=>Ee.workItemId===Pn);le&&(rs.current=Pn,D(),gc(le))},[Le,n,Re,t,z,Ke,Pn,e,qe,gc,D,H,U,_,b,x]),m.useEffect(()=>{!Y||!Yn||(rs.current=null,U(null),H(Yn.workItemId),St(!1))},[Yn,Y,Le,H,U]),m.useEffect(()=>{!Y||Yn||rl||U(null)},[Yn,Y,rl,Le,U,Mn]),m.useEffect(()=>{const $=Z.trim().toLowerCase(),le=[...qe.map(Pe=>({kind:"active",variant:Pe})),...Mn.map(Pe=>({kind:"past",entry:Pe})),...Ps?[{kind:"original"}]:[]],Ee=$?le.filter(Pe=>YC(Pe,$)):le,{pinned:he,unpinned:pe}=XC(JC(qC(Ee,Le),Gs),Xn,Le),be=[...W.has(pw)?[]:he,...pe.flatMap(Pe=>Pe.key!==""&&W.has(Pe.key)?[]:Pe.rows)];if(be.length===0)return;const Qe=Pe=>{if(gQ())return;if(Pe.key==="Enter"){const Vt=qe.find(Qs=>Qs.workItemId===ep);Vt&&(Pe.preventDefault(),_c(Vt));return}if(Pe.key!=="ArrowUp"&&Pe.key!=="ArrowDown")return;Pe.preventDefault();const en=j??Pn;let vn=en?`live:${en}`:null;z?vn=`past:${z}`:il&&(vn=fO);const Er=vn?be.findIndex(Vt=>nd(Vt)===vn):-1;let as;if(Er===-1?as=Pe.key==="ArrowDown"?0:be.length-1:Pe.key==="ArrowDown"?as=Math.min(Er+1,be.length-1):as=Math.max(Er-1,0),as===Er)return;const ls=be[as];ls.kind==="active"?_c(ls.variant):ls.kind==="past"?Uo(ls.entry):_d();const lt=document.querySelector(`[data-variant-key="${nd(ls)}"]`);lt instanceof HTMLElement&<.focus({preventScroll:!0})};return window.addEventListener("keydown",Qe),()=>window.removeEventListener("keydown",Qe)},[qe,Mn,Z,Ps,W,Xn,Gs,Le,j,z,il,Pn,ep,_c,Uo,_d]);const al=qe.find($=>$.workItemId===Pn)??null,Ji=z?Mn.find($=>`${$.sessionId}:${$.variantId}`===z)??null:null,np=!!Ji,Cd=e.active?e.artifacts??[]:[],eo=[...(e.active?qe:[]).map($=>({kind:"active",variant:$})),...Mn.map($=>({kind:"past",entry:$})),...Ps?[{kind:"original"}]:[]],Pd=Z.trim().toLowerCase(),ll=Pd?eo.filter($=>YC($,Pd)):eo,rp=JC(qC(ll,Le),Gs),{pinned:sp,unpinned:ip}=XC(rp,Xn,Le);let Cc=null;A&&(Cc=A.source==="live"?`live:${A.variantId}`:`past:${A.sessionId}:${A.variantId}`);const Pc=new Set(qe.map($=>$.requestId).filter(Boolean)),Ys=s.filter($=>!Pc.has($.requestId)),os=Ys.length>0,Is=o&&!os&&eo.length===0;return S.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[eo.length>0?S.jsx("div",{className:"pt-2 pr-5 pb-1 pl-3",children:S.jsxs("div",{className:"relative",children:[S.jsx(nq,{size:13,className:"text-content-muted pointer-events-none absolute top-1/2 left-2 -translate-y-1/2"}),S.jsx("input",{type:"text",value:Z,onChange:$=>Q($.target.value),placeholder:"Search directions…","aria-label":"Search directions",className:"border-main-border bg-main-input/40 text-content placeholder:text-content-muted focus:ring-content-muted/40 w-full rounded-md border py-1.5 pr-2 pl-7 text-xs focus:ring-1 focus:outline-none"})]})}):null,S.jsxs("div",{className:"flex-1 [scrollbar-gutter:stable] overflow-y-auto px-3 py-2",children:[os?S.jsx(kJ,{groups:Ys}):null,Is?S.jsx(EJ,{}):null,e.active&&eo.length===0&&!os&&!Is?S.jsx(CJ,{}):null,!e.active&&!os&&!Is&&Mn.length===0&&!Ps?S.jsx(PJ,{isMCPSession:g,mcpEditor:v}):null,eo.length>0&&ll.length===0?S.jsxs("p",{className:"text-content-muted px-1 py-6 text-center text-xs",children:["No directions match “",Z.trim(),"”."]}):null,ll.length>0?S.jsx(pJ,{groups:ip,pinned:sp,pinnedKeys:Yi,draggedRowKey:Cc,onDropPin:$r,onDropUnpin:Ks,onTogglePin:Ln,onReorder:or,collapsedRuns:W,onToggleRun:N,activeVariantId:j??Pn,activePastKey:z,isOriginalSelected:il,busy:X,editingKey:ev,onSelectActive:_c,onSelectPast:Uo,onSelectOriginal:_d,onActivePointerDown:zn,onPastPointerDown:ss,onHover:is,onRemove:$=>bd({kind:"active",variant:$}),onRemovePast:$=>bd({kind:"past",entry:$}),onStartRename:tv,onCommitRename:ol,onCancelRename:Sc,editingRunKey:Ec,onStartRunRename:nv,onCommitRunRename:tp,onCancelRunRename:Ed,onRemoveRun:bc,onCopyVariantContext:kc,activeSessionId:e.active?e.sessionId:null,projectPath:gn}):null,e.active&&p?S.jsx(wJ,{artifacts:Cd}):null]}),np&&Ji?S.jsx(vJ,{entry:Ji,deploying:It===z,deployedUrl:z?Ge[z]??null:null,onDeploy:Jh,isDeployDisabled:!u}):null,!np&&e.active?S.jsx(SJ,{selectedVariant:al,busy:X,onSend:Qg,onDeploy:Jg,onDeployCanvas:wd,canDeploy:u&&(mn==null?void 0:mn.kind)==="fresh",canDeployCanvas:u&&d&&(mn==null?void 0:mn.kind)==="fresh",canSendToAgent:f,canvasVariantCount:kt.length,canvasDeployedUrl:mr,deployedUrl:al?de[al.workItemId]??null:null}):null,S.jsx(uJ,{target:re,isConfirming:fe,onCancel:()=>se(null),onConfirm:Ts})]})},cJ=t=>t.kind==="active"?t.variant.label.trim()||"this direction":t.kind==="run"?t.label.trim()||"this run":t.entry.label.trim()||"this direction",uJ=({target:t,isConfirming:e,onCancel:n,onConfirm:r})=>{if(!t)return null;const s=cJ(t),i=t.kind==="run",o=i?t.variants.length+t.entries.length:0,l=i?"Remove run":"Remove direction";return S.jsx(db,{open:!0,onOpenChange:u=>{!u&&!e&&n()},children:S.jsxs(fb,{children:[S.jsx(hb,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(pb,{className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[360px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(mb,{className:"text-content text-base font-medium",children:i?"Remove run?":"Remove direction?"}),S.jsx(gb,{className:"text-content-subtle text-sm leading-5",children:i?`This removes all ${o} directions in “${s}”.`:`This removes “${s}” from the directions list.`}),S.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[S.jsx("button",{type:"button",onClick:n,disabled:e,className:"text-content-subtle hover:bg-main-hover hover:text-content rounded-md px-3 py-1.5 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),S.jsx("button",{type:"button","aria-label":"Confirm remove direction",onClick:r,disabled:e,className:"rounded-md bg-red-500/15 px-3 py-1.5 text-sm font-medium text-red-200 transition-colors hover:bg-red-500/25 disabled:cursor-not-allowed disabled:opacity-50",children:e?"Removing...":l})]})]})})]})})},nd=t=>t.kind==="active"?`live:${t.variant.workItemId}`:t.kind==="past"?`past:${t.entry.sessionId}:${t.entry.variantId}`:fO,YC=(t,e)=>t.kind==="active"?Yy(e,t.variant.label,t.variant.runLabel):t.kind==="past"?Yy(e,t.entry.label,t.entry.runLabel,t.entry.brief):Yy(e,Rb,hO),yO=(t,e)=>t.startsWith("live:")?`row:past:${e??""}:${t.slice(5)}`:`row:${t}`,_O=(t,e)=>yO(nd(t),e),XC=(t,e,n)=>{if(e.length===0)return{pinned:[],unpinned:t};const r=new Set(e),s=new Map,i=[];for(const l of t){const u=[];for(const d of l.rows){const f=_O(d,n);r.has(f)?s.set(f,d):u.push(d)}u.length>0&&i.push(u.length===l.rows.length?l:{...l,rows:u})}return{pinned:e.flatMap(l=>{const u=s.get(l);return u?[u]:[]}),unpinned:i}},QC=(t,e,n)=>{if(!e||e.length===0)return t;const r=new Map(e.map((o,l)=>[o,l])),s=t.filter(o=>!r.has(n(o)));if(s.length===t.length)return t;const i=t.flatMap(o=>{const l=r.get(n(o));return l===void 0?[]:[{item:o,index:l}]}).sort((o,l)=>o.index-l.index).map(({item:o})=>o);return[...s,...i]},JC=(t,e)=>{const n=t.map(r=>{const s=e.rows[r.key];return!s||s.length===0?r:{...r,rows:QC(r.rows,s,nd)}});return QC(n,e.groups,r=>r.key)},dJ=t=>t.length<=WC?t:`${t.slice(0,WC-1)}…`,fJ=(t,e)=>t.kind==="active"?e?`${e}:${t.variant.workItemId}`:null:t.kind==="past"?`${t.entry.sessionId}:${t.entry.variantId}`:null,hJ=t=>{var i,o;const e=[t.label.trim(),(i=t.description)==null?void 0:i.trim()].filter(l=>!!l).join(`
|
|
112
|
-
`);if(!t.reference)return e;const n=((o=t.projectPath)==null?void 0:o.trim())??"",r=n?` --project '${n.replace(/'/g,"'\\''")}'`:"",s=[`Rivet variant: ${t.reference}`,"To inspect the full variant context, run:",`rivet variants get ${t.reference}${r}`].join(`
|
|
113
|
-
`);return e?`${e}
|
|
114
|
-
|
|
115
|
-
${s}`:s},pJ=({groups:t,pinned:e,pinnedKeys:n,draggedRowKey:r,onDropPin:s,onDropUnpin:i,onTogglePin:o,onReorder:l,collapsedRuns:u,onToggleRun:d,activeVariantId:f,activePastKey:p,isOriginalSelected:g,busy:v,editingKey:w,onSelectActive:_,onSelectPast:x,onSelectOriginal:b,onActivePointerDown:E,onPastPointerDown:C,onHover:R,onRemove:A,onRemovePast:I,onStartRename:M,onCommitRename:T,onCancelRename:L,editingRunKey:D,onStartRunRename:j,onCommitRunRename:H,onCancelRunRename:Y,onRemoveRun:U,onCopyVariantContext:z,activeSessionId:Z,projectPath:Q})=>{const B=m.useRef(null),{activeIndex:ee,itemRects:W,sessionRef:N,handlers:X,registerItem:oe}=qM(B,{snapTolerancePx:5}),[re,se]=m.useState(!1),[fe,_e]=m.useState(!1),de=u.has(pw),ae=r!==null,Oe=m.useMemo(()=>{if(!r)return null;const Re=yO(r,Z);if(n.has(Re))return{container:Sf,key:Re};const Ye=t.find(Mt=>Mt.rows.some(qe=>nd(qe)===r));return Ye?{container:Gy(Ye.key),key:r}:null},[r,n,t,Z]),ke=(Oe==null?void 0:Oe.container)===Sf,{dropTarget:Ge,onPointerMove:vt,onPointerUp:It}=RQ({containerRef:B,dragged:Oe,yieldToSelector:ke?void 0:"[data-pinned-drop-zone]",restrictToSelector:ke?"[data-pinned-drop-zone]":void 0,onReorder:l}),Yt=ee!==null?W[ee]:null,wt=Re=>Re.kind==="active"?Re.variant.workItemId===f:Re.kind==="past"?`${Re.entry.sessionId}:${Re.entry.variantId}`===p:g,yt=(Re,Ye,Mt,qe)=>{const kt=nd(Re),ns=_O(Re,Z);return S.jsx(gJ,{rowKey:kt,row:Re,index:Ye,isSelected:wt(Re),isEditing:w===kt,isPinned:n.has(ns),onTogglePin:mr=>o(ns,mr),reorderContainer:Mt,reorderKey:Mt===Sf?ns:kt,isNested:qe,busy:v,registerItem:oe,onSelectActive:_,onSelectPast:x,onSelectOriginal:b,onActivePointerDown:E,onPastPointerDown:C,onHover:R,onRemove:A,onRemovePast:I,onStartRename:M,onCommitRename:T,onCancelRename:L,onCopyVariantContext:z,activeSessionId:Z,projectPath:Q},kt)};let We=0;const Ke=Re=>{if(Re.key==="")return Re.rows.map(kt=>yt(kt,We++,Gy(Re.key),!1));const Ye=u.has(Re.key),Mt=Ye?null:Re.rows.map(kt=>yt(kt,We++,Gy(Re.key),!0)),qe=Re.label;return S.jsx(mJ,{label:qe??Rb,collapsed:Ye,onToggle:()=>d(Re.key),directionCount:Re.rows.length,isEditing:qe!==null&&D===Re.key,onStartRename:qe!==null?()=>j(Re.key):void 0,onCommitRename:qe!==null?kt=>H(Re,kt):void 0,onCancelRename:Y,onRemove:qe!==null?()=>U(Re):void 0,children:Mt},Re.key)},St=e.length>0||ae;return S.jsxs("div",{ref:B,className:"relative",onMouseEnter:X.onMouseEnter,onMouseMove:X.onMouseMove,onMouseLeave:X.onMouseLeave,onPointerMove:vt,onPointerUp:Re=>{var Ye;if(ke&&Oe){const Mt=(Ye=B.current)==null?void 0:Ye.querySelector("[data-pinned-drop-zone]"),qe=Mt==null?void 0:Mt.getBoundingClientRect();if(!(qe!==void 0&&Re.clientY>=qe.top&&Re.clientY<=qe.bottom)){i(Oe.key);return}}It()},children:[Oe&&Ge?S.jsx("div",{className:"bg-content-muted pointer-events-none absolute right-1 left-1 z-20 h-0.5 rounded-full",style:{top:Ge.top}}):null,S.jsx(ws,{children:Yt&&S.jsx(gi.div,{className:"bg-hover pointer-events-none absolute z-0 rounded-md",initial:{opacity:0,top:Yt.top,left:Yt.left,width:Yt.width,height:Yt.height},animate:{opacity:1,top:Yt.top,left:Yt.left,width:Yt.width,height:Yt.height},exit:{opacity:0,transition:{duration:.06}},transition:{..._h.fast,opacity:{duration:.08}}},N.current)}),S.jsxs("ul",{className:"relative flex flex-col gap-2",children:[S.jsx(ws,{initial:!1,children:St?S.jsxs(gi.li,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:hw,ease:fw},"data-pinned-drop-zone":"",className:zt("overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",ae&&"ring-content-muted/30 ring-1",ae&&re&&"ring-content-muted/70 bg-white/[0.03]"),onPointerEnter:ae?()=>se(!0):void 0,onPointerLeave:ae?()=>se(!1):void 0,onPointerUp:ae?()=>{se(!1),s()}:void 0,children:[S.jsx("div",{"data-hover-dead-zone":"",children:S.jsxs("button",{type:"button",onClick:()=>d(pw),"aria-expanded":!de,"aria-label":`${de?"Expand":"Collapse"} pinned items`,className:"focus-visible:ring-content-muted/40 flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-white/[0.03] focus:outline-none focus-visible:ring-1 focus-visible:ring-inset",children:[S.jsx(F2,{size:13,weight:"fill",className:"text-content-muted shrink-0"}),S.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:"Pinned"})]})}),S.jsx(ws,{initial:!1,children:!de&&S.jsx(gi.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:hw,ease:fw},className:"overflow-hidden",children:e.length>0?S.jsx("ul",{className:"flex flex-col gap-2",children:e.map(Re=>yt(Re,We++,Sf,!1))}):null},"body")})]},"pinned-section"):null}),St&&t.length>0?S.jsxs("li",{className:zt("mt-2 overflow-hidden rounded-lg bg-white/[0.012] transition-shadow",ke&&"ring-content-muted/30 ring-1",ke&&fe&&"ring-content-muted/70 bg-white/[0.03]"),onPointerEnter:ke?()=>_e(!0):void 0,onPointerLeave:ke?()=>_e(!1):void 0,onPointerUp:ke?()=>_e(!1):void 0,children:[S.jsxs("div",{"data-hover-dead-zone":"",className:"flex w-full items-center gap-2 px-3 py-2",children:[S.jsx(oq,{size:13,weight:"fill",className:"text-content-muted shrink-0"}),S.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:"Directions"})]}),S.jsx("ul",{className:"flex flex-col gap-2",children:t.map(Re=>Ke(Re))})]}):t.map(Re=>Ke(Re))]})]})},wO=({open:t,onOpenChange:e,triggerLabel:n,actions:r})=>{const{containerRef:s,onKeyDown:i}=GM({onDismiss:()=>e(!1)});return S.jsxs(xb,{open:t,onOpenChange:e,children:[S.jsx(fc,{label:n,children:S.jsx(bb,{asChild:!0,children:S.jsx(Mo,{type:"button",variant:"ghost",size:"icon-compact","aria-label":n,onClick:o=>o.stopPropagation(),onPointerDown:o=>o.stopPropagation(),className:pO,children:S.jsx(JW,{size:15,weight:"bold"})})})}),S.jsx(Sb,{children:S.jsx(kb,{ref:s,onKeyDown:i,role:"menu",side:"bottom",align:"end",sideOffset:4,onCloseAutoFocus:o=>o.preventDefault(),className:"bg-popover shadow-surface-4 z-[60] min-w-[160px] rounded-lg p-1",children:r.map(o=>S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,disabled:o.disabled,onClick:l=>{l.stopPropagation(),e(!1),o.onSelect()},onPointerDown:l=>l.stopPropagation(),className:"text-content hover:bg-hover focus:bg-hover flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[o.icon,o.label]},o.key))})})]})},mJ=({label:t,collapsed:e,directionCount:n,onToggle:r,isEditing:s=!1,onStartRename:i,onCommitRename:o,onCancelRename:l,onRemove:u,children:d})=>{const f=Vo(),[p,g]=m.useState(!1),v=[...i?[{key:"rename",label:"Rename",icon:S.jsx(zT,{size:13,weight:"bold"}),onSelect:i}]:[],...u?[{key:"remove",label:"Remove",icon:S.jsx(QT,{size:13,weight:"bold"}),onSelect:u}]:[]],w=e?S.jsx(tq,{size:13,weight:"fill",className:"shrink-0 text-sky-400"}):S.jsx(eq,{size:13,weight:"fill",className:"shrink-0 text-sky-400"});return s&&o&&l?S.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[S.jsxs("div",{"data-hover-dead-zone":"",className:"bg-main-input flex w-full items-center gap-2 px-3 py-2",children:[w,S.jsx("span",{className:"min-w-0 flex-1",children:S.jsx(xO,{initial:t,onCommit:o,onCancel:l})})]}),S.jsx(ws,{initial:!1,children:!e&&S.jsx(gi.ul,{className:"overflow-hidden",children:d},"body")})]}):S.jsxs("li",{className:"overflow-hidden rounded-lg bg-white/[0.012]",children:[S.jsxs("div",{"data-hover-dead-zone":"",className:"group relative",children:[S.jsxs("button",{type:"button",onClick:_=>{if((_.metaKey||_.ctrlKey)&&v.length>0){g(!0);return}f==null||f.capture("variants_panel.folder_toggled",{isCollapsed:!e,directionCount:n}),r()},"aria-expanded":!e,"aria-label":`${e?"Expand":"Collapse"} ${t} directions`,className:"focus-visible:ring-content-muted/40 flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-white/[0.03] focus:outline-none focus-visible:ring-1 focus-visible:ring-inset",children:[w,S.jsx("span",{className:"text-content min-w-0 flex-1 truncate text-sm font-medium",children:t})]}),v.length>0&&S.jsx("div",{className:zt("absolute top-1.5 right-2 flex items-center gap-0.5 transition-opacity duration-150","pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 has-[:focus-visible]:pointer-events-auto has-[:focus-visible]:opacity-100",p&&"pointer-events-auto opacity-100"),children:S.jsx(wO,{open:p,onOpenChange:g,triggerLabel:`${t} run actions`,actions:v})})]}),S.jsx(ws,{initial:!1,children:!e&&S.jsx(gi.ul,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:hw,ease:fw},className:"overflow-hidden",children:d},"body")})]})},gJ=({rowKey:t,row:e,index:n,isSelected:r,isEditing:s,isPinned:i,onTogglePin:o,reorderContainer:l,reorderKey:u,isNested:d,busy:f,registerItem:p,onSelectActive:g,onSelectPast:v,onSelectOriginal:w,onActivePointerDown:_,onPastPointerDown:x,onHover:b,onRemove:E,onRemovePast:C,onStartRename:R,onCommitRename:A,onCancelRename:I,onCopyVariantContext:M,activeSessionId:T,projectPath:L})=>{var ae,Oe;const D=m.useRef(null);pQ(p,n,D);const[j,H]=m.useState(!1),Y=e.kind==="active",U=e.kind==="original",z=e.kind==="active"?e.variant:null,Z=e.kind==="past"?e.entry:null,Q=z?z.status==="succeeded":!0,B=z?Uf(z):!0,ee=z!==null&&(z.status==="pending"||z.status==="running"),W=(z==null?void 0:z.status)==="failed",N=(z==null?void 0:z.status)==="cancelled",X=z!==null&&(f==null?void 0:f.kind)==="remove"&&f.variantId===z.workItemId,oe=z!==null&&(((ae=z.refinement)==null?void 0:ae.status)==="pending"||((Oe=z.refinement)==null?void 0:Oe.status)==="running");let re=Rb;z?re=z.label||`Direction ${n+1}`:Z&&(re=Z.label.trim()||"Untitled direction");let se=hO;z?se=z.description:Z&&(se=Z.brief);const fe=se?dJ(se):null,_e=fJ(e,T),de=_e?"Copy variant reference":"Copy description";return s?S.jsx("li",{ref:D,"data-proximity-index":n,"data-reorder-container":l,"data-reorder-key":u,className:"group relative z-10",children:S.jsx("div",{className:zt("bg-main-input flex w-full items-start gap-2 rounded-md py-2 pr-3",d?"pl-[33px]":"pl-3"),children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsx(xO,{initial:re,onCommit:ke=>A(e,ke),onCancel:I}),fe&&S.jsx("span",{className:"text-content-muted mt-1 line-clamp-2 block text-xs leading-snug",children:fe})]})})}):S.jsxs("li",{ref:D,"data-proximity-index":n,"data-reorder-container":l,"data-reorder-key":u,className:zt("group relative z-10 rounded-md",r&&"bg-main-input"),onMouseEnter:z?()=>b(z.workItemId):void 0,onMouseLeave:Y?()=>b(null):void 0,children:[S.jsx("div",{role:"button",tabIndex:0,"data-variant-id":z==null?void 0:z.workItemId,"data-variant-key":t,onClick:ke=>{if(ke.metaKey||ke.ctrlKey){H(!0);return}const Ge=window.getSelection();Ge&&!Ge.isCollapsed||(e.kind==="active"?g(e.variant):e.kind==="past"?v(e.entry):w())},onKeyDown:ke=>{(ke.key==="Enter"||ke.key===" ")&&(ke.preventDefault(),ke.stopPropagation(),e.kind==="active"?g(e.variant):e.kind==="past"?v(e.entry):w())},onPointerDown:ke=>{ke.metaKey||ke.ctrlKey||(e.kind==="active"?B&&_(e.variant.workItemId,ke):e.kind==="past"&&x(e.entry,ke))},"aria-pressed":r,"aria-disabled":Y?!1:void 0,"aria-busy":ee||oe,className:zt("flex w-full items-start gap-2 rounded-md py-2 pr-3 text-left transition-colors focus:outline-none",d?"pl-[33px]":"pl-3",B&&"cursor-grab active:cursor-grabbing",!B&&"cursor-pointer"),style:B?{touchAction:"none"}:void 0,children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsxs("span",{className:"flex items-center gap-2 pr-12",children:[(ee||oe)&&S.jsx(Pb,{className:"text-content-muted shrink-0 text-sm","data-testid":oe&&!ee?"variant-refining":void 0}),S.jsx(fc,{label:"Double-click to rename",disabled:U,children:S.jsx("span",{onDoubleClick:ke=>{ke.stopPropagation(),U||R(t)},className:zt("min-w-0 flex-1 truncate text-sm font-medium select-text",U?"cursor-default":"cursor-text",Q||r?"text-content":"text-content-muted"),children:re})}),W&&S.jsx(fc,{label:(z==null?void 0:z.errorMessage)??(z==null?void 0:z.errorCode)??"Failed",disabled:!(z!=null&&z.errorMessage)&&!(z!=null&&z.errorCode),children:S.jsx("span",{className:"shrink-0",children:S.jsx(e3,{label:"Failed"})})}),N&&S.jsx(e3,{label:"Cancelled"})]}),fe&&S.jsx("span",{className:"text-content-muted mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug select-text",children:fe})]})}),U?null:S.jsx(LG,{references:(z==null?void 0:z.references)??(Z==null?void 0:Z.references),source:Y?"active":"history",sessionId:(Z==null?void 0:Z.sessionId)??T,variantId:(Z==null?void 0:Z.variantId)??(z==null?void 0:z.workItemId),projectPath:L,className:d?"pl-[33px]":"pl-3"}),S.jsxs("div",{className:zt("absolute top-1.5 right-2 flex items-center gap-0.5 transition-opacity duration-150 motion-reduce:transition-none","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",j&&"pointer-events-auto opacity-100"),children:[S.jsx(Mo,{variant:"ghost",size:"icon-compact",title:i?"Unpin direction":"Pin direction","aria-label":i?"Unpin direction":"Pin direction","aria-pressed":i,onPointerDown:ke=>ke.stopPropagation(),onKeyDown:ke=>{(ke.key!=="ArrowUp"&&ke.key!=="ArrowDown"||ke.altKey||ke.ctrlKey||ke.metaKey||ke.shiftKey)&&ke.stopPropagation()},onClick:ke=>{ke.stopPropagation(),o("button")},className:pO,children:S.jsx(F2,{weight:i?"fill":"bold"})}),S.jsx(wO,{open:j,onOpenChange:H,triggerLabel:"Direction actions",actions:[...se||_e?[{key:"copy",label:de,icon:S.jsx(uh,{size:13,weight:"bold"}),onSelect:()=>M(hJ({label:re,description:se,reference:_e,projectPath:L}))}]:[],{key:"pin",label:i?"Unpin":"Pin",icon:S.jsx(F2,{size:13,weight:"bold"}),onSelect:()=>o("menu")},...U?[]:[{key:"rename",label:"Rename",icon:S.jsx(zT,{size:13,weight:"bold"}),onSelect:()=>R(t)},{key:"remove",label:"Remove",icon:S.jsx(QT,{size:13,weight:"bold"}),disabled:X,onSelect:()=>{e.kind==="active"?E(e.variant):e.kind==="past"&&C(e.entry)}}]]})]})]})},xO=({initial:t,onCommit:e,onCancel:n})=>{const[r,s]=m.useState(t),i=m.useRef(!1),o=m.useCallback(u=>{u&&(u.focus(),u.select())},[]),l=u=>{i.current||(i.current=!0,u?e(r):n())};return S.jsx("input",{ref:o,type:"text",value:r,maxLength:120,"aria-label":"Rename direction",onChange:u=>s(u.target.value),onKeyDown:u=>{u.stopPropagation(),u.key==="Enter"?(u.preventDefault(),l(!0)):u.key==="Escape"&&(u.preventDefault(),l(!1))},onBlur:()=>l(!0),onClick:u=>u.stopPropagation(),onPointerDown:u=>u.stopPropagation(),className:"border-content-muted/40 bg-main text-content focus:ring-content-muted/50 w-full rounded border px-1.5 py-0.5 text-sm font-medium focus:ring-1 focus:outline-none"})},e3=({label:t})=>S.jsx("span",{className:"bg-main-input text-content-muted shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium tracking-wide uppercase",children:t}),vJ=({entry:t,deploying:e,deployedUrl:n,onDeploy:r,isDeployDisabled:s=!1})=>{const o=e?"Deploying…":n?"Copy link":"Share";return S.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 py-4",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),n?S.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}),S.jsxs("button",{type:"button",onClick:()=>r(t),disabled:e||s,title:n?`Copy share link (${n})`:"Deploy this direction and get a public link to share",className:"border-main-border text-content hover:bg-main-input flex shrink-0 items-center gap-1 rounded-md border px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:[n&&!e?S.jsx(uh,{size:12,weight:"bold"}):null,o]})]})},yJ={agent_browser:"Browser extracted",cache:"Cached",static:"Bundled catalog",manual:"Manual"},_J={design_context:"DESIGN.md",source_context:"Source",qa_report:"QA",asset:"Asset"},wJ=({artifacts:t})=>{const[e,n]=m.useState(null),r=m.useMemo(()=>e&&t.some(i=>i.id===e)?e:null,[t,e]);if(t.length===0)return null;const s=i=>{n(o=>o===i?null:i)};return S.jsxs("section",{"aria-label":"Directions session artifacts",className:"mt-4",children:[S.jsx("div",{className:"flex shrink-0 items-center px-3 py-2",children:S.jsx("span",{className:"text-content truncate text-sm font-medium",children:"Artifacts"})}),S.jsx("ul",{className:"mt-2 space-y-1 px-1",children:t.map(i=>S.jsx(xJ,{artifact:i,isExpanded:i.id===r,onToggle:()=>s(i.id)},i.id))})]})},xJ=({artifact:t,isExpanded:e,onToggle:n})=>{const r=_J[t.kind],s=t.source?yJ[t.source]:null,i=[t.kind==="design_context"?null:s,t.summary].filter(Boolean).join(" · "),o=t.kind==="design_context"&&!!t.viewUrl,l=`${e?"Hide":"View"} ${r} artifact${t.label?`: ${t.label}`:""}`;return o?S.jsx("li",{className:"border-main-border rounded-md border",children:S.jsxs("div",{className:"flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs",children:[S.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"border-content-muted/30 bg-main-input text-content-muted shrink-0 rounded-full border px-2 py-0.5 text-[9px] font-semibold tracking-wide uppercase",children:r}),S.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?S.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),S.jsx("a",{href:t.viewUrl,target:"_blank",rel:"noreferrer",onClick:()=>{Ce.capture("visual_editor_design_context_opened",{context_kind:"design_system",artifact_source:t.source})},"aria-label":`Open ${r} artifact${t.label?`: ${t.label}`:""}`,className:"text-content-muted hover:bg-main-input hover:text-content focus-visible:ring-content-muted/40 shrink-0 rounded p-1 transition-colors focus:outline-none focus-visible:ring-1",children:S.jsx(GW,{className:"h-3.5 w-3.5",weight:"bold"})})]})}):S.jsxs("li",{className:"border-main-border rounded-md border",children:[S.jsxs("button",{type:"button",onClick:n,"aria-expanded":e,"aria-label":l,className:"hover:bg-main-input flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs transition-colors",children:[S.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"text-content-muted text-[10px] font-semibold tracking-wide uppercase",children:r}),S.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?S.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),S.jsx("span",{className:"text-content-muted shrink-0 text-[11px]",children:e?"Hide":"View"})]}),e?S.jsx("div",{className:"border-main-border bg-main-light border-t px-3 py-2",children:S.jsx(bJ,{artifact:t})}):null]})},bJ=({artifact:t})=>S.jsxs("div",{className:"text-content-muted space-y-1 text-[11px]",children:[t.summary?S.jsx("p",{children:t.summary}):null,t.path?S.jsxs("p",{children:["Stored at ",t.path]}):null,!t.summary&&!t.path?S.jsx("p",{children:"No inline content available for this artifact."}):null]}),SJ=({selectedVariant:t,busy:e,onSend:n,onDeploy:r,onDeployCanvas:s,canDeploy:i,canDeployCanvas:o,canSendToAgent:l,canvasVariantCount:u,canvasDeployedUrl:d,deployedUrl:f})=>{var M,T,L,D;const p=t?((T=(M=t.actions)==null?void 0:M.commit)==null?void 0:T.enabled)??t.status==="succeeded":!1,g=p&&e===null,v=(e==null?void 0:e.kind)==="commit"&&e.variantId===(t==null?void 0:t.workItemId),w=(e==null?void 0:e.kind)==="deploy"&&e.variantId===(t==null?void 0:t.workItemId),_=(e==null?void 0:e.kind)==="deploy-canvas",x=!i||!p||e!==null,b=o&&u>0,C=w?"Deploying…":f?"Copy link":"Share",A=_?"Sharing…":d?"Copy canvas link":"Share canvas",I=v?"Applying…":"Apply to project";return S.jsxs("div",{className:"border-main-border bg-main-light flex shrink-0 items-center justify-between gap-3 border-t px-3 py-4",children:[S.jsx("div",{className:"min-w-0",children:t?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),f?S.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}):null}),S.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[S.jsx(cO,{primaryLabel:C,primaryIcon:f&&!w?uh:void 0,primaryAction:()=>{t&&r(t)},isDisabled:x,isDropdownDisabled:e!==null,isLoading:w,loadingLabel:"Deploying…",dropdownAriaLabel:"More share actions",dropdownItems:b?[{label:A,icon:d&&!_?uh:void 0,onClick:s,isDisabled:e!==null}]:[]}),l?S.jsx("button",{type:"button",onClick:()=>{t&&n(t)},disabled:!g,title:(D=(L=t==null?void 0:t.actions)==null?void 0:L.commit)==null?void 0:D.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:I}):null]})]})},bO=()=>S.jsx("div",{"data-testid":"direction-skeleton-row","aria-hidden":"true",className:"flex w-full items-start rounded-md px-3 py-2",children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[S.jsx(Pb,{className:"text-content-muted shrink-0 text-sm"}),S.jsx("span",{className:"bg-muted-foreground/15 h-3.5 w-28 animate-pulse rounded"})]}),S.jsx("span",{className:"mt-1.5 flex",children:S.jsx("span",{className:"bg-muted-foreground/10 h-2.5 w-full max-w-[14rem] animate-pulse rounded"})})]})}),kJ=({groups:t})=>S.jsx("div",{className:"space-y-0.5",children:t.flatMap(e=>Array.from({length:Math.max(1,e.count)}).map((n,r)=>S.jsx(bO,{},`${e.requestId}-${r}`)))}),EJ=()=>S.jsx("div",{"data-testid":"direction-boot-skeletons",className:"space-y-0.5",children:Array.from({length:3}).map((t,e)=>S.jsx(bO,{},e))}),CJ=()=>S.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[S.jsx("div",{className:"text-content text-sm",children:"No directions yet"}),S.jsx("div",{className:"text-content-muted text-xs",children:"They’ll appear here as they generate."})]}),t3="Try different ways to create a dropdown that feels fluid and dynamic",PJ=({isMCPSession:t=!1,mcpEditor:e=null})=>{const[n,r]=m.useState(!1),s=KQ(e),i=t?s:"your coding agent",o=()=>{navigator.clipboard.writeText(t3).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})};return S.jsxs("div",{className:"flex flex-col items-start gap-3 px-2 py-2",children:[S.jsx("p",{className:"text-content text-sm font-medium",children:"Create your first direction"}),S.jsxs("p",{className:"text-content-muted text-xs",children:["Use ",i," to generate directions."]}),S.jsxs("div",{className:"w-full",children:[S.jsx("p",{className:"text-content-muted mb-2 text-xs",children:"Here's a sample prompt to use:"}),S.jsxs("div",{className:"border-main-border bg-main-input relative rounded-md border px-3 py-2.5 pr-8",children:[S.jsxs("p",{className:"text-content-muted text-xs leading-snug",children:["“",t3,"”"]}),S.jsx("button",{type:"button",onClick:o,className:"text-content-muted hover:bg-main-border hover:text-content absolute top-2 right-2 rounded p-0.5 transition-colors",title:"Copy to clipboard",children:n?S.jsx(LT,{className:"h-3.5 w-3.5 text-emerald-500",weight:"bold"}):S.jsx(uh,{className:"h-3.5 w-3.5",weight:"bold"})})]})]})]})},RJ="rivet:show-projects",AJ=t=>{const e=new URLSearchParams(t),n=e.get("libraryOrigin");if(e.get("library")!=="1"||!n)return null;try{const r=new URL(n);return r.protocol!=="http:"&&r.protocol!=="https:"?null:r.origin}catch{return null}},TJ=({onClose:t})=>{const e=ct(tO),n=ct(Cb),r=AJ(window.location.search),s=(n==null?void 0:n.split(/[\\/]/).filter(Boolean).pop())??"Project";if(!t)return null;let i=e?S.jsx("span",{className:"text-content min-w-0 truncate text-sm font-medium",title:e,children:e}):S.jsx("span",{});return r&&(i=S.jsx("nav",{"aria-label":"Project breadcrumb",className:"ph-no-capture min-w-0 flex-1","data-rivet-private":!0,children:S.jsxs("ol",{className:"flex min-w-0 items-center gap-1 text-xs",children:[S.jsx("li",{className:"shrink-0",children:S.jsx("button",{onClick:()=>window.parent.postMessage(RJ,r),className:"text-content-subtle hover:bg-main-input hover:text-content focus-visible:outline-content rounded px-1 py-1 focus-visible:outline focus-visible:outline-2",children:"Projects"})}),S.jsx("li",{"aria-hidden":!0,className:"text-content-subtle shrink-0",children:S.jsx(XW,{className:"h-3 w-3"})}),S.jsx("li",{className:"min-w-0",children:S.jsx("span",{"aria-current":"page",title:s,className:"text-content block truncate font-medium",children:s})})]})})),S.jsxs("div",{className:"border-main-border bg-main-light z-10 flex flex-shrink-0 items-center justify-between gap-2 border-b px-2.5 py-2.5",children:[i,S.jsx(fc,{label:"Close panel",side:"bottom",children:S.jsx("button",{onClick:t,"aria-label":"Close panel",className:"text-content-subtle hover:bg-main-input hover:text-content flex h-6 w-6 flex-shrink-0 items-center justify-center rounded p-1 transition-colors",children:S.jsx(rq,{className:"h-4 w-4",weight:"bold"})})})]})},hc=(t,e={})=>{if(!window.location.pathname.startsWith("/rivet/library"))return fetch(t,e);const n=new Headers(e.headers);return n.set("Authorization",lV()),fetch(t,{...e,headers:n})},IJ=5e3,MJ=()=>{const t=window.location.pathname.startsWith("/rivet/library");return vm({queryKey:["rivet-account"],queryFn:async({signal:e})=>{const n=await hc(t?"/api/account":"/api/config",{signal:e});if(!n.ok)throw new Error("Could not load your account.");if(t)return n.json();const r=await n.json();return{isAuthenticated:r.agentModeAvailable,name:r.name,email:r.email,userId:r.userId}},refetchInterval:IJ,retry:!1})},cg="rivet_just_signed_in",OJ=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"},Jy=({outcome:t,authAttemptId:e,startedAt:n,now:r,failureReason:s,entryPoint:i="editor_gate"})=>({event:`visual_editor_auth_${t}`,properties:{auth_attempt_id:e,duration_ms:r-n,entry_point:i,method:"google_oauth",...s?{failure_reason:s}:{}}}),n3=Cs("useLogin"),LJ=2e3,NJ=60,r3="Connecting to Google...",s3="https://rivet-proxy.onrender.com",DJ=`<!doctype html>
|
|
116
|
-
<html lang="en">
|
|
117
|
-
<head>
|
|
118
|
-
<meta charset="utf-8" />
|
|
119
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
120
|
-
<title>${r3}</title>
|
|
121
|
-
<style>
|
|
122
|
-
:root { color-scheme: light dark; }
|
|
123
|
-
body {
|
|
124
|
-
margin: 0;
|
|
125
|
-
min-height: 100vh;
|
|
126
|
-
display: grid;
|
|
127
|
-
place-items: center;
|
|
128
|
-
font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
|
|
129
|
-
background: #111215;
|
|
130
|
-
color: #f3f4f6;
|
|
131
|
-
}
|
|
132
|
-
.panel {
|
|
133
|
-
border: 1px solid rgba(255, 255, 255, 0.16);
|
|
134
|
-
border-radius: 12px;
|
|
135
|
-
padding: 18px 22px;
|
|
136
|
-
background: rgba(255, 255, 255, 0.06);
|
|
137
|
-
font-size: 14px;
|
|
138
|
-
}
|
|
139
|
-
</style>
|
|
140
|
-
</head>
|
|
141
|
-
<body>
|
|
142
|
-
<div class="panel">${r3}</div>
|
|
143
|
-
</body>
|
|
144
|
-
</html>`,SO=(t="editor_gate")=>{const e=Vo(),[n,r]=m.useState(!1),[s,i]=m.useState(null);return{startLogin:m.useCallback(async()=>{var p;const l=globalThis.crypto.randomUUID(),u=Date.now();r(!0),i(null);const d=Jy({outcome:"started",authAttemptId:l,entryPoint:t,startedAt:u,now:u});e==null||e.capture(d.event,d.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(DJ),f.document.close()}catch(w){n3.warn("Failed to render loading state in auth popup:",w)}const g=await fetch(`${s3}/api/auth/google/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"core"})}),v=await g.json();if(!g.ok||!v.success||!v.authUrl||!v.sessionId||!v.pollSecret)throw new Error(v.error||v.message||"Failed to start Google login");if(f.closed)throw new Error("Sign-in window was closed before Google login started.");f.location.href=v.authUrl;for(let w=0;w<NJ;w+=1){if(f.closed)throw new Error("Sign-in window was closed before authentication completed.");const x=await(await fetch(`${s3}/api/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:v.sessionId,pollSecret:v.pollSecret})})).json();if(x.success&&x.token&&((p=x.user)!=null&&p.email)){if(!(await hc("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:x.user.email,token:x.token,refreshToken:x.refreshToken,userId:x.user.id})})).ok)throw new Error("Signed in, but failed to store session locally.");f.close(),window.sessionStorage.setItem(cg,"1");const E=Jy({outcome:"completed",authAttemptId:l,entryPoint:t,startedAt:u,now:Date.now()});e==null||e.capture(E.event,E.properties),window.location.reload();return}if(x.error&&x.error!=="Pending")throw new Error(x.error||"Google login failed");await new Promise(b=>setTimeout(b,LJ))}throw new Error("Authentication timed out. Please try again.")}catch(g){f&&!f.closed&&f.close();const v=g instanceof Error?g.message:"Failed to start login flow";n3.warn("Login failed:",v);const w=Jy({outcome:"failed",authAttemptId:l,entryPoint:t,startedAt:u,now:Date.now(),failureReason:OJ(v)});e==null||e.capture(w.event,w.properties),i(v),r(!1)}},[e,t]),isStartingLogin:n,loginError:s}},$J=Cs("useIntegrations"),e_=["integrations"],jJ="rivet:connect-result",FJ=t=>typeof t=="object"&&t!==null&&t.type===jJ,VJ=dt(null),i3=async()=>{const t=await hc("/api/integrations");if(!t.ok)throw new Error(`Failed to load integrations (${t.status})`);return(await t.json()).integrations??[]},HJ=()=>{const t=lP(),[e,n]=BR(VJ),r=vm({queryKey:e_,queryFn:i3,staleTime:1e4}),s=m.useCallback(async()=>(await t.invalidateQueries({queryKey:e_,refetchType:"none"}),t.fetchQuery({queryKey:e_,queryFn:i3})),[t]),i=m.useCallback(async l=>{const u=window.open("","_blank","width=560,height=720");if(!u)throw new Error("Popup blocked. Allow popups to connect.");n(l);try{const d=await hc(`/api/integrations/${l}/connect`,{method:"POST"}),f=await d.json().catch(()=>({}));if(!d.ok||!f.authUrl)throw u.close(),new Error(f.error||`Could not connect ${l}`);return u.location.href=f.authUrl,await new Promise(p=>{let g=!1,v=null;const w=async(x,b=!1)=>{if(!g){g=!0,window.removeEventListener("message",_),v&&clearInterval(v);try{const C=(await s()).some(R=>R.provider===l&&R.status==="connected");p(b&&C?"connected":x)}catch{p(x)}}},_=x=>{if(FJ(x.data)&&x.data.provider===l){if(x.data.status==="error"){$J.warn(`Connect failed for ${l}:`,x.data.message),w("failed");return}w("connected")}};window.addEventListener("message",_),v=setInterval(()=>{u.closed&&w("closed",!0)},500)})}finally{n(null)}},[s,n]),o=m.useCallback(async l=>{n(l);try{const u=await hc(`/api/integrations/${l}`,{method:"DELETE"});if(!u.ok){const d=await u.json().catch(()=>({}));throw new Error(d.error||`Could not disconnect ${l}`)}await s()}finally{n(null)}},[s,n]);return{integrations:r.data??[],isLoading:r.isPending,error:r.error instanceof Error?r.error.message:null,pendingProvider:e,connect:i,disconnect:o,refetch:s}},Rl=({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}:{}}}),o3=Cs("ConnectorsModal"),zJ=[{provider:"x",name:"X",description:"Save bookmarked posts and images as design inspiration.",tileClassName:"bg-black text-white",icon:S.jsx(tm,{provider:"x"})},{provider:"pinterest",name:"Pinterest",description:"Pull boards and pins in as visual references.",tileClassName:"bg-[#e60023] text-white",icon:S.jsx(tm,{provider:"pinterest"})},{provider:"arena",name:"Are.na",description:"Connect channels of collected blocks and links.",tileClassName:"bg-[#18181b] text-content",icon:S.jsx(tm,{provider:"arena"})}],BJ=({meta:t,integration:e,isPending:n,isHighlighted:r,onConnect:s,onDisconnect:i})=>{const o=(e==null?void 0:e.status)==="connected",l=e!=null&&e.externalUsername?`@${e.externalUsername}`:null;return S.jsxs("article",{className:`bg-main-light flex flex-col rounded-xl p-[18px] ${r?"ring-secondary ring-2":""}`,children:[S.jsx("span",{className:`grid h-[52px] w-[52px] flex-none place-items-center rounded-xl ${t.tileClassName}`,"aria-hidden":"true",children:t.icon}),S.jsxs("div",{className:"mt-4 flex-1",children:[S.jsxs("h2",{className:"text-content flex items-center gap-1.5 text-[15px] font-semibold",children:[t.name,o?S.jsx(LT,{className:"h-3.5 w-3.5",weight:"bold","aria-hidden":"true"}):null]}),S.jsx("p",{className:"text-content-subtle mt-1 text-[13px] leading-relaxed",children:t.description}),o&&l?S.jsx("p",{className:"text-content-muted mt-2.5 text-xs font-medium",children:l}):null]}),o?S.jsx("button",{type:"button",onClick:i,disabled:n,className:"active-push bg-main-input text-content-muted mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg px-3.5 text-[13px] font-semibold transition-colors hover:bg-red-500/10 hover:text-red-300 disabled:cursor-not-allowed disabled:opacity-50",children:n?"Disconnecting…":"Disconnect"}):S.jsx("button",{type:"button",onClick:s,disabled:n,className:"active-push bg-secondary text-secondary-foreground hover:bg-accent mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg px-3.5 text-[13px] font-semibold transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:n?"Connecting…":"Connect"})]})},mw=({isOpen:t,onClose:e,context:n="menu",highlightProvider:r=null})=>{const{integrations:s,isLoading:i,error:o,pendingProvider:l,connect:u,disconnect:d}=HJ(),f=Vo(),[p,g]=m.useState(null),v=b=>s.find(E=>E.provider===b),w=m.useCallback(b=>{const E=Date.now(),C=Rl({action:"connect",outcome:"started",provider:b,entryPoint:n});f==null||f.capture(C.event,C.properties),u(b).then(R=>{const A=Date.now()-E;if(R==="connected"){const M=Rl({action:"connect",outcome:"completed",provider:b,entryPoint:n,durationMs:A});f==null||f.capture(M.event,M.properties);return}const I=Rl({action:"connect",outcome:"failed",provider:b,entryPoint:n,durationMs:A,failureReason:R==="closed"?"popup_closed":"provider_failed"});f==null||f.capture(I.event,I.properties)}).catch(R=>{const A=R instanceof Error?R.message:"Could not connect.",I=Rl({action:"connect",outcome:"failed",provider:b,entryPoint:n,durationMs:Date.now()-E,failureReason:A.includes("Popup blocked")?"popup_blocked":"request_failed"});f==null||f.capture(I.event,I.properties),o3.warn(`Connect error for ${b}:`,A),Rt.error(A)})},[u,n,f]),_=m.useCallback(b=>{const E=Date.now(),C=Rl({action:"disconnect",outcome:"started",provider:b,entryPoint:n});f==null||f.capture(C.event,C.properties),d(b).then(()=>{const R=Rl({action:"disconnect",outcome:"completed",provider:b,entryPoint:n,durationMs:Date.now()-E});f==null||f.capture(R.event,R.properties)}).catch(R=>{const A=R instanceof Error?R.message:"Could not disconnect.",I=Rl({action:"disconnect",outcome:"failed",provider:b,entryPoint:n,durationMs:Date.now()-E,failureReason:"request_failed"});f==null||f.capture(I.event,I.properties),o3.warn(`Disconnect error for ${b}:`,A),Rt.error(A)})},[n,d,f]),x=n==="onboarding";return S.jsx(db,{open:t,onOpenChange:b=>!b&&e(),children:S.jsxs(fb,{children:[S.jsx(hb,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(pb,{ref:g,className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[560px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:S.jsxs(SM,{value:p,children:[S.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[S.jsx(mb,{className:"text-content text-base font-medium",children:"Connect design references"}),S.jsx(Mo,{onClick:e,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:S.jsx(tI,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[S.jsx(gb,{className:"text-content-subtle text-sm",children:"Connect your accounts to save design inspiration in Rivet."}),o?S.jsx("p",{className:"rounded-lg bg-red-500/10 px-4 py-3 text-[13px] font-medium text-red-300",children:o}):null,S.jsx("div",{className:"grid grid-cols-2 gap-4",children:zJ.map(b=>S.jsx(BJ,{meta:b,integration:v(b.provider),isPending:i||l===b.provider,isHighlighted:r===b.provider,onConnect:()=>w(b.provider),onDisconnect:()=>_(b.provider)},b.provider))}),x?S.jsxs("div",{className:"flex items-center justify-between gap-4",children:[S.jsx("p",{className:"text-content-subtle text-xs",children:"You can always do this later from the account menu."}),S.jsx("button",{type:"button",onClick:e,className:"active-push bg-secondary text-secondary-foreground hover:bg-accent flex-none rounded-lg px-3.5 py-2 text-[13px] font-medium transition-colors",children:"Skip for now"})]}):null]})]})})]})})},a3=({className:t=""})=>S.jsx("span",{"aria-hidden":"true",className:`rivet-skeleton block rounded ${t}`.trim()}),UJ=Cs("SupportTicketModal"),l3=5e3,t_="feedback",ZJ=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},WJ=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=ZJ(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}`},qJ=({isOpen:t,onClose:e,contactEmail:n})=>{const r=Vo(),[s,i]=m.useState(""),[o,l]=m.useState(!1),[u,d]=m.useState(null),f=m.useCallback(()=>{i("")},[]),p=m.useCallback(()=>{o||(f(),e())},[o,e,f]),g=m.useCallback(async()=>{const x=s.trim();if(!(!x||o)){l(!0);try{const b=typeof(r==null?void 0:r.get_session_id)=="function"?r.get_session_id():void 0,E=typeof(r==null?void 0:r.get_distinct_id)=="function"?r.get_distinct_id():void 0,C=n==null?void 0:n.trim(),R=await hc("/api/support/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:t_,message:x,contactEmail:C||void 0,metadata:{posthogSessionId:b??void 0,posthogDistinctId:E??void 0,appVersion:"0.18.4",appEnvironment:"production",pageUrl:window.location.href,userAgent:navigator.userAgent,submittedAt:new Date().toISOString()}})});if(!R.ok){const A=await WJ(R);throw new Error(A)}r==null||r.capture("support_ticket_submitted",{ticket_type:t_,has_posthog_session_id:!!b}),Rt.success("Feedback sent",{description:"Thanks for sharing this."}),f(),e()}catch(b){const E=b instanceof Error?b.message:"Failed to send message";r==null||r.capture("support_ticket_submit_failed",{ticket_type:t_,error:E}),UJ.error("Failed to submit support ticket:",E),Rt.error("Could not send feedback",{description:E})}finally{l(!1)}}},[n,o,s,e,r,f]),v=m.useCallback(x=>{x.key==="Enter"&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),g())},[g]),w=l3-s.length,_=o||s.trim().length===0;return S.jsx(db,{open:t,onOpenChange:x=>!x&&p(),children:S.jsxs(fb,{children:[S.jsx(hb,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(pb,{ref:d,className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[440px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:S.jsxs(SM,{value:u,children:[S.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[S.jsx(mb,{className:"text-content text-base font-medium",children:"Send feedback"}),S.jsx(Mo,{onClick:p,disabled:o,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:S.jsx(tI,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(gb,{className:"text-content-subtle text-sm",children:"Tell us what happened or what we can improve."}),S.jsxs("div",{className:"bg-main-input rounded-lg outline outline-1 outline-transparent transition-[outline-color] focus-within:outline-white/20",children:[S.jsx("textarea",{id:"support-ticket-message","aria-label":"Your feedback",value:s,onChange:x=>i(x.target.value),onKeyDown:v,maxLength:l3,rows:6,disabled:o,placeholder:"What happened?",className:"text-content placeholder-content-subtle max-h-64 w-full resize-none overflow-y-auto bg-transparent pt-3 pr-3 pb-1 pl-3 text-sm focus:outline-none disabled:opacity-50"}),S.jsxs("div",{className:"flex items-center justify-between px-3 pt-1 pb-3",children:[S.jsx("span",{className:"text-content-subtle text-xs",children:"Context details are included automatically."}),S.jsxs("div",{className:"flex items-center gap-2",children:[w<=500&&S.jsx("span",{className:"text-content-subtle text-xs",children:w}),S.jsx(Mo,{onClick:g,disabled:_,title:"Send feedback",shortcut:"⌘↵","aria-label":"Send feedback",size:"icon-compact",children:o?S.jsx(Mg,{className:"h-5 w-5 animate-spin",weight:"bold"}):S.jsx(KW,{className:"h-5 w-5",weight:"bold"})})]})]})]})]})]})})]})})},GJ=Cs("ProfileAvatar"),kO=(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):""},KJ=(t,e)=>kO(t,e).charAt(0).toUpperCase(),YJ=({className:t="",side:e="bottom",align:n="end"})=>{var Y,U,z;const r=MJ(),s=((Y=r.data)==null?void 0:Y.name)??null,i=((U=r.data)==null?void 0:U.email)??null,o=((z=r.data)==null?void 0:z.isAuthenticated)===!0,l=Vo(),{startLogin:u,isStartingLogin:d,loginError:f}=SO("account_menu"),[p,g]=m.useState(!1),[v,w]=m.useState(!1),[_,x]=m.useState(!1),[b,E]=m.useState(!1),{containerRef:C,onKeyDown:R,onCloseAutoFocus:A}=GM({onDismiss:()=>H(!1)}),I=KJ(s,i);if(r.isPending)return S.jsxs("span",{"data-testid":"profile-avatar-skeleton","aria-hidden":"true",className:`flex shrink-0 items-center gap-2 ${t}`.trim(),children:[S.jsx(a3,{className:"h-8 w-8 rounded-full"}),S.jsx(a3,{className:"h-3.5 w-16"})]});const M=kO(s,i),T=(s==null?void 0:s.trim())||null,L=(i==null?void 0:i.trim())||null,D=async()=>{E(!0);try{const Z=await hc("/api/auth/logout",{method:"POST",credentials:"same-origin"});if(!Z.ok)throw new Error(`Logout failed: ${Z.status}`)}catch(Z){GJ.warn("Logout request failed",Z),Rt.error("Could not log out. Please try again."),E(!1);return}window.location.reload()};let j="Log in";o&&(j=M||"Account"),r.error&&!r.data&&(j="Account unavailable");const H=Z=>{g(Z),l==null||l.capture(`visual_editor_account_menu_${Z?"opened":"closed"}`,{is_authenticated:o})};return S.jsxs(S.Fragment,{children:[S.jsxs(xb,{open:p,onOpenChange:H,children:[S.jsx(bb,{asChild:!0,children:S.jsxs("button",{type:"button","aria-label":"Account","data-rivet-private":!0,className:`ph-no-capture text-content-muted hover:text-content flex shrink-0 items-center gap-2 transition-colors select-none ${t}`,children:[S.jsx("span",{className:"border-main-border bg-main-input flex h-8 w-8 items-center justify-center rounded-full border text-xs leading-none font-semibold",children:I||S.jsx(aq,{className:"h-4 w-4",weight:"bold"})}),S.jsx("span",{className:"max-w-[8rem] truncate text-sm font-medium",children:j})]})}),S.jsx(Sb,{children:S.jsxs(kb,{"data-rivet-private":!0,ref:C,onKeyDown:R,onCloseAutoFocus:A,role:"menu",className:"ph-no-capture bg-popover shadow-surface-4 z-[60] min-w-[180px] rounded-lg p-1",side:e,sideOffset:6,align:n,children:[T||L?S.jsxs("div",{className:"border-main-border border-b px-3 py-2",children:[T?S.jsx("div",{className:"text-content truncate text-sm font-medium",children:T}):null,L?S.jsx("div",{className:"text-content-muted truncate text-xs",children:L}):null]}):null,S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{H(!1),w(!0)},disabled:!o,className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(YT,{className:"h-4 w-4",weight:"bold"}),"Connect design references"]}),S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{H(!1),x(!0)},className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors focus:outline-none",children:[S.jsx(QW,{className:"h-4 w-4",weight:"bold"}),"Share feedback"]}),o?S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:D,disabled:b,className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(iq,{className:"h-4 w-4",weight:"bold"}),b?"Logging out…":"Log out"]}):null,!o&&!r.error?S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{u()},disabled:d,className:"text-content hover:bg-hover focus-visible:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm focus:outline-none disabled:opacity-50",children:[S.jsx(sq,{className:"h-4 w-4",weight:"bold"}),d?"Logging in…":"Log in"]}):null,r.error?S.jsx("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{r.refetch()},className:"text-content mt-1 px-3 py-1.5 text-sm",children:"Retry account"}):null,f?S.jsx("p",{role:"alert",className:"max-w-64 px-3 py-2 text-sm text-red-300",children:f}):null]})})]}),v?S.jsx(mw,{isOpen:!0,onClose:()=>w(!1)}):null,S.jsx(qJ,{isOpen:_,onClose:()=>x(!1),contactEmail:i??void 0})]})},XJ=({onClose:t})=>S.jsxs("div",{className:"bg-main font-main scrollbar-hide relative flex h-full w-full cursor-auto flex-col overflow-hidden shadow-2xl","data-cy":"element-inspector",children:[S.jsx(TJ,{onClose:t}),S.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:S.jsx(lJ,{})}),S.jsx("div",{className:"border-main-border bg-main-light flex flex-shrink-0 items-center border-t px-2.5 py-2.5",children:S.jsx(YJ,{side:"top",align:"start"})})]});async function QJ(t,e){const{delaysMs:n,shouldRetry:r,onRetry:s}=e;for(let i=1;;i++)try{return await t(i)}catch(o){const l=n[i-1];if(l===void 0||r&&!r(o))throw o;s==null||s(o,i,l),await new Promise(u=>setTimeout(u,l))}}const c3=Cs("useServerConfig"),EO=[250,500,1e3,2e3,4e3],u3=EO.length+1,JJ=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}},eee=()=>{const[t,e]=m.useState(null),[n,r]=m.useState(!0),[s,i]=m.useState(null),o=m.useCallback(async()=>{try{r(!0),i(null);const l=await QJ(JJ,{delaysMs:EO,onRetry:(u,d,f)=>{c3.warn(`Server config fetch failed (attempt ${d}); retrying in ${f}ms`,u)}});return e(l),l}catch(l){const u=l instanceof Error?l.message:"Failed to fetch server config";throw i(u),c3.warn("Error fetching server config:",l),l}finally{r(!1)}},[]);return{config:t,fetchConfig:o,isLoading:n,error:s}},tee="#1C1C20",ho=[118,118,124],d3=.85,nee=3,ree=.15,O0=36,see=4.4,iee=.7,oee=3.5,aee=.8,f3=9,lee=11,cee=[1.35,1.12,.95,.85],uee=[0,1.1,2.3,3.1],dee=[0,.35,.16,.13],fee=[.9,.5,.4,.35],Al=3,n_=[[{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}]],L0=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},lm=t=>{const e=Math.min(1,Math.max(0,t));return e*e*(3-2*e)},Tl=(t,e)=>(Math.round(t/e-.5)+.5)*e,hee=Math.sin(Math.PI/3),h3=(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*hee;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()},pee=(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)-f3}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)-f3}return lm(.5-r/(2*lee))},CO=({className:t="",trackGlobalLoaderCount:e=!0})=>{const n=mt(nO),r=m.useRef(null),s=m.useCallback(i=>{var D;if((D=r.current)==null||D.call(r),r.current=null,!i)return;const o=i.getContext("2d");if(!o)return;e&&n(j=>j+1);const l=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let u=[],d=0,f=0,p=O0,g=O0,v=null,w=null,_=0,x=-1;const b=new Array(33),E=j=>{const H=Math.round(j*32);let Y=b[H];if(!Y){const U=H/32,z=Math.round(ho[0]+(255-ho[0])*U),Z=Math.round(ho[1]+(255-ho[1])*U),Q=Math.round(ho[2]+(255-ho[2])*U);Y=`rgba(${z}, ${Z}, ${Q}, ${d3})`,b[H]=Y}return Y},C=j=>{const H=1-.35*j,Y=Math.round(ho[0]*H),U=Math.round(ho[1]*H),z=Math.round(ho[2]*H);return`rgba(${Y}, ${U}, ${z}, ${d3})`},R=j=>{let H=Math.floor(Math.random()*n_.length);H===x&&(H=(H+1)%n_.length),x=H;const Y=[0,0,0,0],U=n_[H].map((N,X)=>{const oe=N.level,re=Y[oe]++,se=uee[oe]+re*dee[oe],fe=fee[oe]+L0(H*131+X*17+5)*.2;if(N.hline){const ae=Tl((N.y??0)*f,g);return{hline:!0,x1:Tl(N.x1*d,p),x2:Tl(N.x2*d,p),y1:ae,y2:ae,level:oe,start:se,dur:fe}}const _e=Tl(N.x1*d,p),de=Tl((N.y1??0)*f,g);return{hline:!1,x1:_e,y1:de,x2:Math.max(Tl(N.x2*d,p),_e+p),y2:Math.max(Tl((N.y2??0)*f,g),de+g),level:oe,start:se,dur:fe}}),z=U.reduce((N,X)=>Math.max(N,X.start+X.dur),0),Z=u.length,Q=new Float32Array(Z*Al),B=new Int16Array(Z*Al).fill(-1),ee=new Uint8Array(Z),W=U[0];for(let N=0;N<Z;N++){const X=u[N];X.x>W.x1&&X.x<W.x2&&X.y>W.y1&&X.y<W.y2&&(ee[N]=1);const oe=N*Al;for(let re=0;re<U.length;re++){const se=pee(X.x,X.y,U[re]);if(se<=.02)continue;let fe=oe;for(let _e=oe;_e<oe+Al;_e++){if(B[_e]===-1){fe=_e;break}Q[_e]<Q[fe]&&(fe=_e)}(B[fe]===-1||se>Q[fe])&&(Q[fe]=se,B[fe]=re)}}return{startT:j,buildEnd:z,els:U,frame:W,cellQ:Q,cellEl:B,inFrame:ee}},A=()=>{const j=i.getBoundingClientRect();d=Math.max(1,j.width),f=Math.max(1,j.height);const H=Math.min(2,window.devicePixelRatio||1);i.width=Math.round(d*H),i.height=Math.round(f*H),o.setTransform(H,0,0,H,0,0);const Y=Math.max(8,Math.round(d/O0)),U=Math.max(6,Math.round(f/O0));p=d/Y,g=f/U,u=[];for(let z=0;z<U;z++){const Z=U>1?z/(U-1):.5,Q=see*(1+iee*.4*(Z*2-1));for(let B=0;B<Y;B++){const ee=z*8191+B*131+1,W={x:(B+.5)*p,y:(z+.5)*g,size:Q,seed:ee,phase:L0(ee),kind:0};W.kind=Math.floor(L0(ee*97)*3),u.push(W)}}w=null,v=null},I=new Float32Array(32),M=j=>{o.fillStyle=tee,o.fillRect(0,0,d,f),v||(v=R(j+.2)),j>=v.startT+v.buildEnd+oee&&(w=v,_=j,v=R(j+.2));let H=0;w&&(H=1-lm((j-_)/aee),H<=0&&(w=null));const Y=v;for(let W=0;W<Y.els.length;W++){const N=Y.els[W];I[W]=lm(Math.min(1,Math.max(0,(j-Y.startT-N.start)/N.dur)))}const U=I[0],z=C(0),Z=C(U),Q=H>0?C(H):z,B=H>0?C(Math.max(U,H)):Z,ee=u.length;for(let W=0;W<ee;W++){const N=u[W];let X=0,oe=0;const re=W*Al;for(let ke=re;ke<re+Al;ke++){const Ge=Y.cellEl[ke];if(Ge<0)break;const vt=Y.cellQ[ke]*I[Ge];vt>X&&(X=vt,oe=Y.els[Ge].level)}if(w)for(let ke=re;ke<re+Al;ke++){const Ge=w.cellEl[ke];if(Ge<0)break;const vt=w.cellQ[ke]*H;vt>X&&(X=vt,oe=w.els[Ge].level)}const se=j/nee+N.phase,fe=Math.floor(se),_e=se-fe,de=lm(Math.min(_e,1-_e)/ree),ae=Math.floor(L0(N.seed*97+fe*7919)*3);ae!==N.kind&&X<.02&&de<.05&&(N.kind=ae);const Oe=Math.max(de*(1-X),X);if(!(Oe<.01))if(X<.02){const ke=Y.inFrame[W]===1,Ge=w?w.inFrame[W]===1:!1;ke?o.fillStyle=Ge?B:Z:o.fillStyle=Ge?Q:z;const vt=Math.max(ke?U:0,Ge?H:0);h3(o,N.kind,N.x,N.y,N.size*Oe*(1-.2*vt))}else{o.fillStyle=E(X);const ke=1+(cee[oe]-1)*X;h3(o,N.kind,N.x,N.y,N.size*Oe*ke)}}};A();let T=0;if(l)v=R(-100),M(0);else{const j=performance.now(),H=Y=>{M((Y-j)/1e3),T=requestAnimationFrame(H)};T=requestAnimationFrame(H)}const L=new ResizeObserver(()=>{A(),l&&(v=R(-100),M(0))});L.observe(i),r.current=()=>{cancelAnimationFrame(T),L.disconnect(),e&&n(j=>j-1)}},[e,n]);return S.jsx("canvas",{ref:s,"aria-hidden":"true",className:`h-full w-full ${t}`.trim()})},mee=async(t=null)=>{if(t)return gee(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 N0();if(!e.ok)return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null};let r;try{r=await e.json()}catch{return N0()}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}:N0()},PO=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}}},gee=t=>PO(t),N0=()=>PO("/"),r_=Cs("usePreviewUpstreamHealth"),vee=500,yee=4e3,_ee=15e3,wee=3,xee=(t,e={})=>{const n=m.useRef(null),r=m.useRef(null),s=e.probeMsWhileDown??vee,i=e.probeMsWhileUp??yee,o=e.firstUnreachableCaptureAfterMs??_ee,l=e.rerunProbeImmediatelyOnVersion,u=e.probePath??null,d=e.skip??!1,f=m.useRef(e.onPersistentUpstreamServerErrors);f.current=e.onPersistentUpstreamServerErrors;const[p,g]=m.useState(t==="static"),[v,w]=m.useState(0),[_,x]=m.useState(null),[b,E]=m.useState(0),[C,R]=m.useState(!1),[A,I]=m.useState(!1),[M,T]=m.useState(t==="static"?null:"upstream_unreachable");return m.useEffect(()=>{if(t==="static"){g(!0),x(null),E(0),R(!1),I(!0),T(null);return}if(d){g(!1),x(null),E(0),R(!1),I(!0),T("upstream_unreachable"),n.current=null;return}let L=!0;const D=Date.now();x(D),E(0),R(!1),g(!1),I(!1),T("upstream_unreachable");const j={current:!1},H={current:!1},Y={current:!1},U={current:null},z={current:!1},Z={current:!1},Q={current:0},B={current:!1},ee={current:null};let W=null;const N=()=>{Y.current||(Y.current=!0,L&&I(!0))},X=()=>{W!==null&&(clearTimeout(W),W=null)},oe=(se,fe)=>{X(),W=setTimeout(fe,se)},re=async()=>{var vt;if(!L)return;E(It=>It+1);const{isOk:se,unavailableReason:fe,upstreamStatus:_e}=await mee(u);if(!L)return;N(),ee.current=_e;const de=se&&_e!==null&&_e>=500;de&&Z.current?Q.current+=1:se&&!de&&(Q.current=0);const ae=Q.current>=wee;if(ae&&!B.current&&_e!==null&&(B.current=!0,Ce==null||Ce.capture("preview_upstream_error_responses",{framework:t,upstream_status:_e,consecutive_count:Q.current}),r_.warn(`Preview upstream is listening but has served ${Q.current} consecutive ${_e} responses`),(vt=f.current)==null||vt.call(f,{upstreamStatus:_e,consecutiveCount:Q.current})),se&&!ae){de||(Z.current=!0,B.current=!1);const It=!z.current;z.current=!0,g(!0),T(null),U.current=null,H.current=!1,R(!1),j.current?It&&(Ce==null||Ce.capture("preview_upstream_restored",{framework:t})):(j.current=!0,Ce==null||Ce.capture("preview_dev_server_ready",{framework:t,ready_after_ms:Date.now()-D})),oe(i,re);return}const ke=z.current;z.current=!1,g(!1),T(fe),U.current===null&&(U.current=Date.now(),H.current=!1,R(!1)),ke&&(Ce==null||Ce.capture("preview_upstream_lost",{framework:t,upstream_status:_e}),w(It=>It+1),r_.warn("Preview upstream became unavailable after it was ready"));const Ge=Date.now()-U.current;Ge>=o&&!H.current&&(H.current=!0,R(!0),Ce==null||Ce.capture("preview_dev_server_unreachable",{framework:t,elapsed_ms:Ge,upstream_status:ee.current}),r_.warn("Dev server did not become ready within timeout window")),oe(s,re)};return n.current=()=>oe(0,re),oe(0,re),()=>{L=!1,n.current=null,X()}},[t,s,i,o,u,d]),m.useEffect(()=>{var D;if(t==="static"||l===void 0)return;const L=r.current;r.current=l,L!==null&&L!==l&&((D=n.current)==null||D.call(n))},[t,l]),{isUpstreamReady:p,iframeRemountKey:v,probeStartedAt:_,probeAttemptCount:b,isFirstUnreachableWindowExceeded:C,initialProbeComplete:A,unavailableReason:M}};function bee(t){return t.enteringSplit&&t.isExistingSession&&t.hasActiveVariantProxy}const RO=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}`},AO=({agentApplyMode:t,url:e})=>e.startsWith("/")?`${RO(t)}${e}`:e,See="allow-scripts allow-same-origin allow-forms allow-popups allow-modals",kee=t=>See,Eee=Cs("PreviewSurface"),p3=(t,e)=>t==="about:blank"?"blank":t.includes("/api/variants/")?"static_artifact":e.kind==="variant"?"dev_server":"original",TO=({target:t,src:e,framework:n,remountKey:r})=>(ct(Bg),S.jsx("div",{className:"relative h-full w-full",children:S.jsx("iframe",{src:e,className:"h-full w-full border-none",title:"Project Preview",sandbox:kee(),onLoad:()=>{Ce==null||Ce.capture("preview_iframe_loaded",{framework:n,src:e}),t.kind==="variant"&&(Ce==null||Ce.capture("variants_panel.preview_displayed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:p3(e,t),framework:n}))},onError:()=>{Ce==null||Ce.capture("preview_iframe_load_failed",{framework:n,src:e}),t.kind==="variant"&&(Ce==null||Ce.capture("variants_panel.preview_display_failed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:p3(e,t),framework:n})),Eee.warn("Preview iframe failed to load",{framework:n,src:e})}},r)})),Cee=m.lazy(()=>oP(()=>Promise.resolve().then(()=>ane),void 0)),Pee={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"},Ree={sm:"text-lg font-semibold text-content",md:"text-2xl font-semibold text-content",lg:"text-3xl font-semibold text-content"},Aee={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"},Eu=({backdrop:t,media:e,title:n,description:r,actions:s,tone:i="neutral",fill:o="surface",size:l="md",children:u,state:d,role:f="status",busy:p=!1,className:g=""})=>{const v=m.useCallback(_=>{_&&d&&(Ce==null||Ce.capture("status_surface_shown",{state:d,tone:i,fill:o}))},[d,i,o]),w=!!(e||n||r||u||s!=null&&s.length);return S.jsxs("div",{ref:v,className:`${Pee[o]} ${g}`.trim(),role:f,"aria-live":"polite","aria-busy":p||void 0,"data-state":d,children:[t?S.jsx("div",{className:"absolute inset-0",children:t}):null,w?S.jsxs("div",{className:"relative z-10 flex max-w-sm flex-col items-center gap-5 text-center",children:[e,n?S.jsx("h2",{className:Ree[l],children:n}):null,r?S.jsx("p",{className:"text-content-muted text-base leading-relaxed",children:r}):null,u,s!=null&&s.length?S.jsx("div",{className:"flex flex-row items-center gap-3",children:s.map(_=>S.jsx("button",{type:"button",onClick:_.onClick,className:Aee[_.variant??"neutral"],children:_.label},_.label))}):null]}):null]})},gw=({loader:t="coalesce",trackGlobalLoaderCount:e,size:n="lg",...r})=>t==="coalesce"?S.jsx(Eu,{...r,size:n,busy:!0,backdrop:S.jsx(CO,{trackGlobalLoaderCount:e})}):t==="logo"?S.jsx(Eu,{...r,size:n,busy:!0,backdrop:S.jsx(m.Suspense,{fallback:null,children:S.jsx(Cee,{className:"absolute inset-0"})})}):S.jsx(Eu,{...r,size:n,busy:!0,media:S.jsx(Mg,{"aria-hidden":!0,className:"text-content h-8 w-8 shrink-0 animate-spin",weight:"bold"})}),IO=({icon:t,...e})=>S.jsx(Eu,{...e,tone:"neutral",media:t?S.jsx("div",{className:"text-content-muted",children:t}):void 0}),Ab=t=>S.jsx(Eu,{...t,tone:"error",role:"alert"}),m3="/static/",Tee=t=>{try{return new URL(t,"http://localhost").pathname.endsWith(m3)}catch{return t.endsWith(m3)}},Iee=t=>t==="spawn_error"?"The direction is saved, but its preview process didn’t start.":t==="exited"?"The direction is saved, but its preview stopped before it was ready.":t==="timeout"?"The direction is saved, but its preview took too long to become ready.":t==="dependency_install_failed"?"The direction is saved, but its dependencies couldn’t be prepared. Fix the installation error, then retry the preview.":t==="compile_error"?"The direction is saved, but its app couldn’t compile. Fix the app error, then retry the preview.":t==="missing_dev_script"?"The direction is saved, but Rivet couldn’t find a dev script to preview it.":t==="missing_static_entry"?"The direction is saved, but Rivet couldn’t find an HTML entry to preview it.":"The direction is saved, but Rivet couldn’t prepare its preview.",Mee=t=>t.status==="failed"&&t.errorCode==="VARIANT_VERIFICATION_UNAVAILABLE"?{state:"variant_verification_unavailable",title:"Rivet couldn’t verify this direction",description:"The worker completed, but Rivet couldn’t inspect its generated files.",detail:t.errorMessage??t.errorCode,isError:!0}:t.status==="failed"&&t.errorCode==="VARIANT_QA_FAILED"?{state:"variant_output_integrity_failed",title:"This direction couldn’t be verified",description:"The worker completed, but Rivet found a structural problem in the generated files.",detail:t.errorMessage??t.errorCode,isError:!0}:t.status==="failed"?{state:"variant_worker_failed",title:"This direction didn’t complete",description:"The worker stopped before producing a usable result.",detail:t.errorMessage??t.errorCode,isError:!0}:t.status==="cancelled"?{state:"variant_cancelled",title:"Direction was cancelled",description:"Rivet stopped before a preview was ready. Your other directions are unchanged.",isError:!1}:t.status==="succeeded"&&t.previewUnavailable&&t.previewUnavailable.reason!=="idle_timeout"?{state:"preview_unavailable",title:"Rivet couldn’t preview this direction",description:Iee(t.previewUnavailable.reason),detail:t.previewUnavailable.portInUse?"The preview port was already in use.":void 0,isError:!0}:null,Oee=({issue:t,retryTarget:e})=>{const n=Vo(),r=m.useRef(!1),[s,i]=m.useState(!1),[o,l]=m.useState(null),u=async()=>{if(!(!e||r.current)){r.current=!0,i(!0),l(null),n==null||n.capture("preview_retry_clicked",{session_id:e.sessionId,variant_id:e.variantId});try{const d=await fetch(`/api/variants/${encodeURIComponent(e.sessionId)}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:e.variantId,retry:!0})});if(!d.ok){const f=await d.json().catch(()=>({}));throw new Error(f.message??"The preview could not restart. Try again.")}}catch(d){l(d instanceof Error?d.message:"The preview could not restart. Try again.")}finally{r.current=!1,i(!1)}}};return S.jsxs(Eu,{fill:"overlay",size:"sm",state:t.state,role:t.isError?"alert":"status",tone:t.isError?"error":"neutral",title:t.title,description:t.description,busy:s,actions:e&&!s?[{label:"Retry preview",onClick:()=>void u()}]:void 0,children:[s?S.jsx("p",{className:"text-content-subtle text-xs",children:"Starting preview…"}):null,o?S.jsx("p",{className:"text-content-subtle text-xs",children:o}):null,t.detail?S.jsx("p",{className:"text-content-subtle text-xs leading-relaxed break-words",children:t.detail}):null]})},Lee=({isInteractionDisabled:t=!1,framework:e,userPort:n})=>{var yt;const r=ct(aw),s=mt(aw),i=ct(ag),o=mt(ag),l=ct(Gh),u=ct(Bg),d=ct(lw),f=ct(cw),p=ct(rO),g=ct(sO),v=mt(cw),w=ct($o),_=ct(am),x=mt(lw),b=l.active&&l.projectContext.kind==="fresh",E=ct(uw),C=l.active?l.variants.find(We=>We.workItemId===E&&(We.status==="pending"||We.status==="running"||We.status==="succeeded"&&!We.preview&&typeof We.port!="number"&&(!We.previewUnavailable||We.previewUnavailable.reason==="idle_timeout")))??null:null,R=l.active&&l.variants.some(We=>We.status==="pending"||We.status==="running"),A=b||R,I=l.active?l.variants.find(We=>We.workItemId===E)??null:null,M=I?Mee(I):null,T=e==="static"&&i!==null&&Tee(i);m.useEffect(()=>{l.active||x(!1)},[l.active,x]);const L=m.useRef(!1);m.useEffect(()=>{const We=!!(w!=null&&w.left||w!=null&&w.right),Ke=We&&!L.current;L.current=We;const St=l.active?l.sessionId:null;!St||!bee({enteringSplit:Ke,isExistingSession:l.active&&l.projectContext.kind==="existing",hasActiveVariantProxy:d&&f!==null})||(x(!1),v(null),s(Re=>Re+1),fetch(`/api/variants/${encodeURIComponent(St)}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(()=>{}))},[w,l,d,f,x,v,s]);const j=m.useMemo(()=>{var Mt;if(d||i&&!T||!l.active)return null;const{stage:We,variants:Ke}=l,St=We==="ready"||We==="degraded",Re=Ke.some(qe=>{var kt,ns;return((kt=qe.refinement)==null?void 0:kt.status)==="pending"||((ns=qe.refinement)==null?void 0:ns.status)==="running"});if(!St&&!Re)return null;const Ye=Ke.find(qe=>{var kt;return qe.status==="succeeded"&&((kt=qe.preview)==null?void 0:kt.kind)==="static_artifact"});return((Mt=Ye==null?void 0:Ye.preview)==null?void 0:Mt.kind)==="static_artifact"?Ye.preview.url:null},[T,i,d,l])??i,H=m.useMemo(()=>!l.active||!j?null:l.variants.find(We=>{var Ke;return((Ke=We.preview)==null?void 0:Ke.kind)==="static_artifact"&&j.startsWith(We.preview.url)})??null,[j,l]),Y=m.useMemo(()=>{if((_==null?void 0:_.previewKind)==="static")return{kind:"variant",sessionId:_.sessionId,variantId:_.variantId};if(!l.active)return og;if(H)return{kind:"variant",sessionId:l.sessionId,variantId:H.workItemId};if(j){const Ke=j.match(/\/__rivet\/preview\/variant\/([^/]+)\/([^/?#]+)/),St=Ke!=null&&Ke[1]?decodeURIComponent(Ke[1]):null,Re=Ke!=null&&Ke[2]?decodeURIComponent(Ke[2]):null;if(St===l.sessionId&&Re&&l.variants.some(qe=>qe.workItemId===Re))return{kind:"variant",sessionId:l.sessionId,variantId:Re};const Ye=j.match(/\/api\/variants\/[^/]+\/static\/([^/?#]+)/),Mt=Ye!=null&&Ye[1]?decodeURIComponent(Ye[1]):null;if(Mt&&l.variants.some(qe=>qe.workItemId===Mt))return{kind:"variant",sessionId:l.sessionId,variantId:Mt}}const We=!!(w!=null&&w.left||w!=null&&w.right);return(!We||b)&&!j&&d&&f&&l.variants.some(Ke=>Ke.workItemId===f)?{kind:"variant",sessionId:l.sessionId,variantId:f}:(!We||b)&&!j&&E&&l.variants.some(Ke=>Ke.workItemId===E)?{kind:"variant",sessionId:l.sessionId,variantId:E}:og},[_,H,l,d,f,j,w,b,E]),U=m.useRef(null);m.useEffect(()=>{var Re,Ye;if(!H||((Re=H.preview)==null?void 0:Re.kind)!=="static_artifact"||((Ye=H.refinement)==null?void 0:Ye.status)!=="succeeded")return;const We=`${H.workItemId}:${H.refinement.workItemId}`;if(U.current===We)return;U.current=We;const Ke=H.preview.url.includes("?")?"&":"?",St=`${H.preview.url}${Ke}refinement=${encodeURIComponent(H.refinement.workItemId)}`;j!==St&&(o(St),s(Mt=>Mt+1))},[j,H,s,o,l]);const z=j!==null&&JQ(j),Z=j!==null&&!z||b&&!d&&!z,{isUpstreamReady:Q,iframeRemountKey:B,probeAttemptCount:ee,initialProbeComplete:W}=xee(e,{rerunProbeImmediatelyOnVersion:r,probePath:z?j:null,skip:Z}),[N,X]=m.useState(()=>p&&Q?r:null),oe=m.useRef(null);m.useEffect(()=>{if(!p){oe.current=null,X(null);return}if(N===r){oe.current=null;return}const We=oe.current;if(!We||We.remountKey!==r){oe.current={remountKey:r,probeAttemptCount:ee};return}Q&&ee>We.probeAttemptCount&&(oe.current=null,X(r))},[N,r,p,ee,Q]);const se=j!==null&&!z||Q,_e=g||p&&N!==r||p&&!se,de=`${B}:${r}`,ae=dO(window.location.pathname),Oe=e==="static"?`/static${ae??"/"}`:ae??"/",ke=RO(u);let Ge=null;j&&(Ge=AO({agentApplyMode:u,url:j}));const It=C||M||_e?"about:blank":(z&&!se?"about:blank":Ge)??(se?`${ke}${Oe}`:"about:blank"),Yt=!!C||!!M||!se&&W;let wt=null;if(_e)wt=S.jsx(gw,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"preview_replay_boot"});else if(C)wt=S.jsx(gw,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"variant_building",children:S.jsx("span",{className:"sr-only",children:"Building your direction"})});else if(M){const We=l.active&&I&&M.state==="preview_unavailable"&&((yt=I.previewUnavailable)==null?void 0:yt.reason)!=="missing_static_entry"?{sessionId:l.sessionId,variantId:I.workItemId}:void 0;wt=S.jsx(Oee,{issue:M,retryTarget:We},I==null?void 0:I.workItemId)}else Yt&&(wt=A?S.jsx(IO,{fill:"overlay",state:"preview_no_selection",title:"Nothing to preview yet",description:"Pick a direction from the panel."}):S.jsx(Ab,{fill:"overlay",state:"preview_offline",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>window.location.reload()}]}));return S.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-col",children:S.jsxs("div",{className:"relative min-h-0 flex-1",children:[wt,S.jsx(TO,{target:Y,src:It,framework:e,remountKey:de})]})})};function g3({side:t,sessionId:e,variantId:n,url:r,label:s,source:i,isFallback:o=!1}){var C;const l=ct($o),u=mt($o),d=Vo(),f=ct(Gh),p=ct(Bg),g=m.useRef(!1),v=m.useCallback(()=>{g.current||(g.current=!0,td({source:i,sessionId:e,variantId:n}))},[i,e,n]),w=m.useCallback(()=>{if(o){u(null);const M=lg("ended",l);d==null||d.capture(M.event,M.properties);return}v();const R={...l};delete R[t];const A=R.left||R.right?R:null;u(A);const I=lg(A?"updated":"ended",A??l);d==null||d.capture(I.event,I.properties)},[o,d,u,t,l,v]),_=m.useMemo(()=>({kind:"variant",sessionId:e,variantId:n}),[e,n]),x=m.useMemo(()=>!f.active||f.sessionId!==e?null:f.variants.find(R=>R.workItemId===n)??null,[e,n,f]),b=m.useMemo(()=>{var A,I;let R=r;if(((A=x==null?void 0:x.preview)==null?void 0:A.kind)==="static_artifact"&&((I=x.refinement)==null?void 0:I.status)==="succeeded"){const M=x.preview.url.includes("?")?"&":"?";R=`${x.preview.url}${M}refinement=${encodeURIComponent(x.refinement.workItemId)}`}return AO({agentApplyMode:p,url:R})},[p,x,r]),E=((C=x==null?void 0:x.refinement)==null?void 0:C.status)==="succeeded"?`${n}:${x.refinement.workItemId}`:n;return S.jsxs("div",{className:"variant-split-secondary","data-cy":"variant-split-pane","data-variant-id":n,children:[S.jsxs("div",{className:"variant-split-secondary-toolbar",children:[S.jsx("span",{className:"variant-split-secondary-label",title:s,children:s}),S.jsx(fc,{label:"Collapse",children:S.jsx("button",{type:"button",className:"variant-split-secondary-close",onClick:w,"aria-label":"Collapse split view",children:S.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",focusable:"false",children:S.jsx("path",{d:"M2.5 2.5 L9.5 9.5 M9.5 2.5 L2.5 9.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})})]}),S.jsx("div",{className:"variant-split-secondary-body relative min-h-0 flex-1",children:S.jsx(TO,{target:_,src:b,framework:"static",remountKey:E})})]})}function Nee(){const t=ct(ed),e=ct(Eb);return!t||!e?null:Uh.createPortal(S.jsx("div",{"aria-hidden":"true",className:"border-main-border bg-main pointer-events-none fixed top-0 left-0 z-[70] flex max-w-60 items-center gap-2 rounded-md border px-3 py-1.5 shadow-lg",style:{transform:`translate3d(${e.x+12}px, ${e.y+12}px, 0)`},children:S.jsx("span",{className:"text-content truncate text-sm font-medium",children:t.label})}),document.body)}function Dee(){const t=ct(ed),e=ct(Eb),n=ct($o),r=mt(ed),s=mt($o),i=Vo(),o=m.useRef(null),[l,u]=m.useState(null),[d,f]=m.useState("hidden");m.useEffect(()=>{t||(f("hidden"),u(null))},[t]);const p=m.useCallback((v,w)=>{const _=o.current;if(!_)return null;const x=_.getBoundingClientRect();return v<x.left||v>x.right||w<x.top||w>x.bottom?null:v<(x.left+x.right)/2?"left":"right"},[]);if(m.useEffect(()=>{if(!t||!e)return;const v=p(e.x,e.y);u(w=>w===v?w:v),f(w=>{if(w==="exiting")return w;const _=v!==null?"visible":"hidden";return w===_?w:_})},[t,e,p]),m.useEffect(()=>{if(!t)return;const v=w=>{const _=p(w.clientX,w.clientY);if(_&&t.url){const x={sessionId:t.sessionId,variantId:t.variantId,label:t.label,url:t.url,source:t.source},b=n==null?void 0:n[_];b&&(b.sessionId!==x.sessionId||b.variantId!==x.variantId)&&td(b);const E={...n??{},[_]:x};s(E);const C=lg(n?"updated":"started",E);i==null||i.capture(C.event,C.properties),f("exiting"),window.setTimeout(()=>r(null),220)}else td(t),f("exiting"),window.setTimeout(()=>r(null),220)};return window.addEventListener("pointerup",v),window.addEventListener("pointercancel",v),()=>{window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v)}},[t,p,i,r,s,n]),!t)return null;const g=["variant-drop-zones",d==="visible"&&"is-visible",d==="exiting"&&"is-exiting"].filter(Boolean).join(" ");return S.jsxs("div",{ref:o,className:g,"aria-hidden":"true",children:[S.jsx(v3,{side:"left",hovered:l==="left",canDrop:!!t.url,label:t.label}),S.jsx(v3,{side:"right",hovered:l==="right",canDrop:!!t.url,label:t.label})]})}function v3({side:t,hovered:e,canDrop:n,label:r}){return S.jsxs("div",{className:["variant-drop-zone",`is-${t}`,e&&"is-hover",!n&&"is-disabled"].filter(Boolean).join(" "),children:[S.jsxs("div",{className:"variant-drop-zone-inner",children:[S.jsx("div",{className:`variant-drop-zone-icon is-${t}`}),S.jsx("div",{className:"variant-drop-zone-caption",children:n?`Add ${t} split`:"Split unavailable for this direction"})]}),S.jsx("div",{className:"variant-drop-zone-preview","aria-hidden":"true",children:S.jsx("div",{className:"variant-drop-zone-preview-label",children:r})}),S.jsx("div",{className:"variant-drop-zone-border"})]})}const MO=(t,e,n)=>{var i,o;if(!t.active||t.sessionId!==e)return null;const r=t.variants.find(l=>l.workItemId===n);if(((i=r==null?void 0:r.preview)==null?void 0:i.kind)!=="static_artifact")return null;if(((o=r.refinement)==null?void 0:o.status)!=="succeeded")return r.preview.url;const s=r.preview.url.includes("?")?"&":"?";return`${r.preview.url}${s}refinement=${encodeURIComponent(r.refinement.workItemId)}`},y3=(t,e)=>{if(!t)return;const n=MO(e,t.sessionId,t.variantId);return!n||n===t.url?t:{...t,url:n}},$ee=()=>S.jsx("div",{"data-testid":"preview-boot-skeleton",role:"status","aria-busy":"true","aria-label":"Loading preview",className:"bg-main flex h-full min-h-0 w-full flex-1 flex-col p-3",children:S.jsx("div",{className:"border-main-border relative min-h-0 flex-1 overflow-hidden rounded-lg border",children:S.jsx(CO,{trackGlobalLoaderCount:!1})})}),jee=({isLoading:t=!1,isInteractionDisabled:e=!1})=>{const{config:n,fetchConfig:r,isLoading:s,error:i}=eee();return m.useEffect(()=>{r().catch(o=>{Ce==null||Ce.capture("preview_config_load_failed",{message:o instanceof Error?o.message:"unknown_error",attempts:u3})})},[r]),s?S.jsx($ee,{}):i||!n?S.jsx(Ab,{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:()=>{Ce==null||Ce.capture("preview_config_retry_clicked"),r().catch(o=>{Ce==null||Ce.capture("preview_config_load_failed",{message:o instanceof Error?o.message:"unknown_error",attempts:u3})})}}]}):S.jsx(Fee,{isLoading:t,isInteractionDisabled:e,framework:n.framework,userPort:n.userPort})};function Fee(t){const e=ct($o),n=ct(ed),r=ct(Gh),s=ct(ag),i=e==null?void 0:e.left,o=e==null?void 0:e.right,l=m.useMemo(()=>{var A,I;if(!r.active||r.projectContext.kind!=="fresh"||!(!!i!=!!o))return;const _=(A=i??o)==null?void 0:A.variantId,x=r.variants.filter(M=>{var T;return M.status==="succeeded"&&((T=M.preview)==null?void 0:T.kind)==="static_artifact"&&M.workItemId!==_}),b=s==null?void 0:s.replace(/[?&]refinement=[^&]*$/,""),C=x.find(M=>{var T;return((T=M.preview)==null?void 0:T.kind)==="static_artifact"&&M.preview.url===b})??x[0];if(((I=C==null?void 0:C.preview)==null?void 0:I.kind)!=="static_artifact")return;const R=MO(r,r.sessionId,C.workItemId);if(R)return{sessionId:r.sessionId,variantId:C.workItemId,label:C.label,url:R,source:"live"}},[r,i,o,s]),u=y3(i,r)??(o?l:void 0),d=y3(o,r)??(i?l:void 0),f=!i&&!!u,p=!o&&!!d,g=!!(u||d),v=S.jsx(Lee,{isInteractionDisabled:t.isInteractionDisabled,framework:t.framework,userPort:t.userPort});return S.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-1 flex-col",children:S.jsxs("div",{className:`variant-preview-region relative flex h-full min-h-0 w-full flex-1 flex-col ${n?"is-dragging":""} ${g?"is-split":""}`,children:[S.jsxs("div",{className:"variant-preview-row flex h-full min-h-0 w-full flex-1",children:[u&&S.jsx(g3,{side:"left",sessionId:u.sessionId,variantId:u.variantId,url:u.url,label:u.label,source:u.source,isFallback:f},`left-${u.sessionId}:${u.variantId}:${u.url}`),!(u&&d)&&S.jsx("div",{className:"variant-preview-primary flex h-full min-h-0 flex-1 flex-col",children:v}),d&&S.jsx(g3,{side:"right",sessionId:d.sessionId,variantId:d.variantId,url:d.url,label:d.label,source:d.source,isFallback:p},`right-${d.sessionId}:${d.variantId}:${d.url}`)]}),S.jsx("div",{className:"variant-preview-atmosphere","aria-hidden":"true"}),S.jsx(Dee,{}),S.jsx(Nee,{})]})})}function wo(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function OO(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
|
|
145
|
-
* GSAP 3.15.0
|
|
146
|
-
* https://gsap.com
|
|
147
|
-
*
|
|
148
|
-
* @license Copyright 2008-2026, GreenSock. All rights reserved.
|
|
149
|
-
* Subject to the terms at https://gsap.com/standard-license
|
|
150
|
-
* @author: Jack Doyle, jack@greensock.com
|
|
151
|
-
*/var xs={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Sh={duration:.5,overwrite:!1,delay:0},Tb,pr,hn,Bs=1e8,Wt=1/Bs,vw=Math.PI*2,Vee=vw/4,Hee=0,LO=Math.sqrt,zee=Math.cos,Bee=Math.sin,ir=function(e){return typeof e=="string"},Cn=function(e){return typeof e=="function"},jo=function(e){return typeof e=="number"},Ib=function(e){return typeof e>"u"},qi=function(e){return typeof e=="object"},Xr=function(e){return e!==!1},Mb=function(){return typeof window<"u"},D0=function(e){return Cn(e)||ir(e)},NO=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},kr=Array.isArray,Uee=/random\([^)]+\)/g,Zee=/,\s*/g,_3=/(?:-?\.?\d|\.)+/gi,DO=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,yu=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,s_=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,$O=/[+-]=-?[.\d]+/,Wee=/[^,'"\[\]\s]+/gi,qee=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,bn,Ii,yw,Ob,ks={},ug={},jO,FO=function(e){return(ug=rd(e,ks))&&ts},Lb=function(e,n){return console.warn("Invalid property",e,"set to",n,"Missing plugin? gsap.registerPlugin()")},kh=function(e,n){return!n&&console.warn(e)},VO=function(e,n){return e&&(ks[e]=n)&&ug&&(ug[e]=n)||ks},Eh=function(){return 0},Gee={suppressEvents:!0,isStart:!0,kill:!1},cm={suppressEvents:!0,kill:!1},Kee={suppressEvents:!0},Nb={},$a=[],_w={},HO,ps={},i_={},w3=30,um=[],Db="",$b=function(e){var n=e[0],r,s;if(qi(n)||Cn(n)||(e=[e]),!(r=(n._gsap||{}).harness)){for(s=um.length;s--&&!um[s].targetTest(n););r=um[s]}for(s=e.length;s--;)e[s]&&(e[s]._gsap||(e[s]._gsap=new c9(e[s],r)))||e.splice(s,1);return e},rc=function(e){return e._gsap||$b(Us(e))[0]._gsap},zO=function(e,n,r){return(r=e[n])&&Cn(r)?e[n]():Ib(r)&&e.getAttribute&&e.getAttribute(n)||r},Qr=function(e,n){return(e=e.split(",")).forEach(n)||e},Tn=function(e){return Math.round(e*1e5)/1e5||0},xn=function(e){return Math.round(e*1e7)/1e7||0},Cu=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},Yee=function(e,n){for(var r=n.length,s=0;e.indexOf(n[s])<0&&++s<r;);return s<r},dg=function(){var e=$a.length,n=$a.slice(0),r,s;for(_w={},$a.length=0,r=0;r<e;r++)s=n[r],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},jb=function(e){return!!(e._initted||e._startAt||e.add)},BO=function(e,n,r,s){$a.length&&!pr&&dg(),e.render(n,r,!!(pr&&n<0&&jb(e))),$a.length&&!pr&&dg()},UO=function(e){var n=parseFloat(e);return(n||n===0)&&(e+"").match(Wee).length<2?n:ir(e)?e.trim():e},ZO=function(e){return e},Es=function(e,n){for(var r in n)r in e||(e[r]=n[r]);return e},Xee=function(e){return function(n,r){for(var s in r)s in n||s==="duration"&&e||s==="ease"||(n[s]=r[s])}},rd=function(e,n){for(var r in n)e[r]=n[r];return e},x3=function t(e,n){for(var r in n)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=qi(n[r])?t(e[r]||(e[r]={}),n[r]):n[r]);return e},fg=function(e,n){var r={},s;for(s in e)s in n||(r[s]=e[s]);return r},Zf=function(e){var n=e.parent||bn,r=e.keyframes?Xee(kr(e.keyframes)):Es;if(Xr(e.inherit))for(;n;)r(e,n.vars.defaults),n=n.parent||n._dp;return e},Qee=function(e,n){for(var r=e.length,s=r===n.length;s&&r--&&e[r]===n[r];);return r<0},WO=function(e,n,r,s,i){var o=e[s],l;if(i)for(l=n[i];o&&o[i]>l;)o=o._prev;return o?(n._next=o._next,o._next=n):(n._next=e[r],e[r]=n),n._next?n._next._prev=n:e[s]=n,n._prev=o,n.parent=n._dp=e,n},Zg=function(e,n,r,s){r===void 0&&(r="_first"),s===void 0&&(s="_last");var i=n._prev,o=n._next;i?i._next=o:e[r]===n&&(e[r]=o),o?o._prev=i:e[s]===n&&(e[s]=i),n._next=n._prev=n.parent=null},qa=function(e,n){e.parent&&(!n||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},sc=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},Jee=function(e){for(var n=e.parent;n&&n.parent;)n._dirty=1,n.totalDuration(),n=n.parent;return e},ww=function(e,n,r,s){return e._startAt&&(pr?e._startAt.revert(cm):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(n,!0,s))},ete=function t(e){return!e||e._ts&&t(e.parent)},b3=function(e){return e._repeat?sd(e._tTime,e=e.duration()+e._rDelay)*e:0},sd=function(e,n){var r=Math.floor(e=xn(e/n));return e&&r===e?r-1:r},hg=function(e,n){return(e-n._start)*n._ts+(n._ts>=0?0:n._dirty?n.totalDuration():n._tDur)},Wg=function(e){return e._end=xn(e._start+(e._tDur/Math.abs(e._ts||e._rts||Wt)||0))},qg=function(e,n){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=xn(r._time-(e._ts>0?n/e._ts:((e._dirty?e.totalDuration():e._tDur)-n)/-e._ts)),Wg(e),r._dirty||sc(r,e)),e},qO=function(e,n){var r;if((n._time||!n._dur&&n._initted||n._start<e._time&&(n._dur||!n.add))&&(r=hg(e.rawTime(),n),(!n._dur||Kh(0,n.totalDuration(),r)-n._tTime>Wt)&&n.render(r,!0)),sc(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=-Wt}},$i=function(e,n,r,s){return n.parent&&qa(n),n._start=xn((jo(r)?r:r||e!==bn?Fs(e,r,n):e._time)+n._delay),n._end=xn(n._start+(n.totalDuration()/Math.abs(n.timeScale())||0)),WO(e,n,"_first","_last",e._sort?"_start":0),xw(n)||(e._recent=n),s||qO(e,n),e._ts<0&&qg(e,e._tTime),e},GO=function(e,n){return(ks.ScrollTrigger||Lb("scrollTrigger",n))&&ks.ScrollTrigger.create(n,e)},KO=function(e,n,r,s,i){if(Vb(e,n,i),!e._initted)return 1;if(!r&&e._pt&&!pr&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&HO!==gs.frame)return $a.push(e),e._lazy=[i,s],1},tte=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},xw=function(e){var n=e.data;return n==="isFromStart"||n==="isStart"},nte=function(e,n,r,s){var i=e.ratio,o=n<0||!n&&(!e._start&&tte(e)&&!(!e._initted&&xw(e))||(e._ts<0||e._dp._ts<0)&&!xw(e))?0:1,l=e._rDelay,u=0,d,f,p;if(l&&e._repeat&&(u=Kh(0,e._tDur,n),f=sd(u,l),e._yoyo&&f&1&&(o=1-o),f!==sd(e._tTime,l)&&(i=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==i||pr||s||e._zTime===Wt||!n&&e._zTime){if(!e._initted&&KO(e,n,s,r,u))return;for(p=e._zTime,e._zTime=n||(r?Wt:0),r||(r=n&&!p),e.ratio=o,e._from&&(o=1-o),e._time=0,e._tTime=u,d=e._pt;d;)d.r(o,d.d),d=d._next;n<0&&ww(e,n,r,!0),e._onUpdate&&!r&&vs(e,"onUpdate"),u&&e._repeat&&!r&&e.parent&&vs(e,"onRepeat"),(n>=e._tDur||n<0)&&e.ratio===o&&(o&&qa(e,1),!r&&!pr&&(vs(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=n)},rte=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}},id=function(e,n,r,s){var i=e._repeat,o=xn(n)||0,l=e._tTime/e._tDur;return l&&!s&&(e._time*=o/e._dur),e._dur=o,e._tDur=i?i<0?1e10:xn(o*(i+1)+e._rDelay*i):o,l>0&&!s&&qg(e,e._tTime=e._tDur*l),e.parent&&Wg(e),r||sc(e.parent,e),e},S3=function(e){return e instanceof qr?sc(e):id(e,e._dur)},ste={_start:0,endTime:Eh,totalDuration:Eh},Fs=function t(e,n,r){var s=e.labels,i=e._recent||ste,o=e.duration()>=Bs?i.endTime(!1):e._dur,l,u,d;return ir(n)&&(isNaN(n)||n in s)?(u=n.charAt(0),d=n.substr(-1)==="%",l=n.indexOf("="),u==="<"||u===">"?(l>=0&&(n=n.replace(/=/,"")),(u==="<"?i._start:i.endTime(i._repeat>=0))+(parseFloat(n.substr(1))||0)*(d?(l<0?i:r).totalDuration()/100:1)):l<0?(n in s||(s[n]=o),s[n]):(u=parseFloat(n.charAt(l-1)+n.substr(l+1)),d&&r&&(u=u/100*(kr(r)?r[0]:r).totalDuration()),l>1?t(e,n.substr(0,l-1),r)+u:o+u)):n==null?o:+n},Wf=function(e,n,r){var s=jo(n[1]),i=(s?2:1)+(e<2?0:1),o=n[i],l,u;if(s&&(o.duration=n[1]),o.parent=r,e){for(l=o,u=r;u&&!("immediateRender"in l);)l=u.vars.defaults||{},u=Xr(u.vars.inherit)&&u.parent;o.immediateRender=Xr(l.immediateRender),e<2?o.runBackwards=1:o.startAt=n[i-1]}return new Hn(n[0],o,n[i+1])},nl=function(e,n){return e||e===0?n(e):n},Kh=function(e,n,r){return r<e?e:r>n?n:r},br=function(e,n){return!ir(e)||!(n=qee.exec(e))?"":n[1]},ite=function(e,n,r){return nl(r,function(s){return Kh(e,n,s)})},bw=[].slice,YO=function(e,n){return e&&qi(e)&&"length"in e&&(!n&&!e.length||e.length-1 in e&&qi(e[0]))&&!e.nodeType&&e!==Ii},ote=function(e,n,r){return r===void 0&&(r=[]),e.forEach(function(s){var i;return ir(s)&&!n||YO(s,1)?(i=r).push.apply(i,Us(s)):r.push(s)})||r},Us=function(e,n,r){return hn&&!n&&hn.selector?hn.selector(e):ir(e)&&!r&&(yw||!od())?bw.call((n||Ob).querySelectorAll(e),0):kr(e)?ote(e,r):YO(e)?bw.call(e,0):e?[e]:[]},Sw=function(e){return e=Us(e)[0]||kh("Invalid scope")||{},function(n){var r=e.current||e.nativeElement||e;return Us(n,r.querySelectorAll?r:r===e?kh("Invalid scope")||Ob.createElement("div"):e)}},XO=function(e){return e.sort(function(){return .5-Math.random()})},QO=function(e){if(Cn(e))return e;var n=qi(e)?e:{each:e},r=ic(n.ease),s=n.from||0,i=parseFloat(n.base)||0,o={},l=s>0&&s<1,u=isNaN(s)||l,d=n.axis,f=s,p=s;return ir(s)?f=p={center:.5,edges:.5,end:1}[s]||0:!l&&u&&(f=s[0],p=s[1]),function(g,v,w){var _=(w||n).length,x=o[_],b,E,C,R,A,I,M,T,L;if(!x){if(L=n.grid==="auto"?0:(n.grid||[1,Bs])[1],!L){for(M=-Bs;M<(M=w[L++].getBoundingClientRect().left)&&L<_;);L<_&&L--}for(x=o[_]=[],b=u?Math.min(L,_)*f-.5:s%L,E=L===Bs?0:u?_*p/L-.5:s/L|0,M=0,T=Bs,I=0;I<_;I++)C=I%L-b,R=E-(I/L|0),x[I]=A=d?Math.abs(d==="y"?R:C):LO(C*C+R*R),A>M&&(M=A),A<T&&(T=A);s==="random"&&XO(x),x.max=M-T,x.min=T,x.v=_=(parseFloat(n.amount)||parseFloat(n.each)*(L>_?_-1:d?d==="y"?_/L:L:Math.max(L,_/L))||0)*(s==="edges"?-1:1),x.b=_<0?i-_:i,x.u=br(n.amount||n.each)||0,r=r&&_<0?_te(r):r}return _=(x[g]-x.min)/x.max||0,xn(x.b+(r?r(_):_)*x.v)+x.u}},kw=function(e){var n=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var s=xn(Math.round(parseFloat(r)/e)*e*n);return(s-s%1)/n+(jo(r)?0:br(r))}},JO=function(e,n){var r=kr(e),s,i;return!r&&qi(e)&&(s=r=e.radius||Bs,e.values?(e=Us(e.values),(i=!jo(e[0]))&&(s*=s)):e=kw(e.increment)),nl(n,r?Cn(e)?function(o){return i=e(o),Math.abs(i-o)<=s?i:o}:function(o){for(var l=parseFloat(i?o.x:o),u=parseFloat(i?o.y:0),d=Bs,f=0,p=e.length,g,v;p--;)i?(g=e[p].x-l,v=e[p].y-u,g=g*g+v*v):g=Math.abs(e[p]-l),g<d&&(d=g,f=p);return f=!s||d<=s?e[f]:o,i||f===o||jo(o)?f:f+br(o)}:kw(e))},e9=function(e,n,r,s){return nl(kr(e)?!n:r===!0?!!(r=0):!s,function(){return kr(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})},ate=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return function(s){return n.reduce(function(i,o){return o(i)},s)}},lte=function(e,n){return function(r){return e(parseFloat(r))+(n||br(r))}},cte=function(e,n,r){return n9(e,n,0,1,r)},t9=function(e,n,r){return nl(r,function(s){return e[~~n(s)]})},ute=function t(e,n,r){var s=n-e;return kr(e)?t9(e,t(0,e.length),n):nl(r,function(i){return(s+(i-e)%s)%s+e})},dte=function t(e,n,r){var s=n-e,i=s*2;return kr(e)?t9(e,t(0,e.length-1),n):nl(r,function(o){return o=(i+(o-e)%i)%i||0,e+(o>s?i-o:o)})},Ch=function(e){return e.replace(Uee,function(n){var r=n.indexOf("[")+1,s=n.substring(r||7,r?n.indexOf("]"):n.length-1).split(Zee);return e9(r?s:+s[0],r?0:+s[1],+s[2]||1e-5)})},n9=function(e,n,r,s,i){var o=n-e,l=s-r;return nl(i,function(u){return r+((u-e)/o*l||0)})},fte=function t(e,n,r,s){var i=isNaN(e+n)?0:function(v){return(1-v)*e+v*n};if(!i){var o=ir(e),l={},u,d,f,p,g;if(r===!0&&(s=1)&&(r=null),o)e={p:e},n={p:n};else if(kr(e)&&!kr(n)){for(f=[],p=e.length,g=p-2,d=1;d<p;d++)f.push(t(e[d-1],e[d]));p--,i=function(w){w*=p;var _=Math.min(g,~~w);return f[_](w-_)},r=n}else s||(e=rd(kr(e)?[]:{},e));if(!f){for(u in n)Fb.call(l,e,u,"get",n[u]);i=function(w){return Bb(w,l)||(o?e.p:e)}}}return nl(r,i)},k3=function(e,n,r){var s=e.labels,i=Bs,o,l,u;for(o in s)l=s[o]-n,l<0==!!r&&l&&i>(l=Math.abs(l))&&(u=o,i=l);return u},vs=function(e,n,r){var s=e.vars,i=s[n],o=hn,l=e._ctx,u,d,f;if(i)return u=s[n+"Params"],d=s.callbackScope||e,r&&$a.length&&dg(),l&&(hn=l),f=u?i.apply(d,u):i.call(d),hn=o,f},kf=function(e){return qa(e),e.scrollTrigger&&e.scrollTrigger.kill(!!pr),e.progress()<1&&vs(e,"onInterrupt"),e},_u,r9=[],s9=function(e){if(e)if(e=!e.name&&e.default||e,Mb()||e.headless){var n=e.name,r=Cn(e),s=n&&!r&&e.init?function(){this._props=[]}:e,i={init:Eh,render:Bb,add:Fb,kill:Ate,modifier:Rte,rawVars:0},o={targetTest:0,get:0,getSetter:zb,aliases:{},register:0};if(od(),e!==s){if(ps[n])return;Es(s,Es(fg(e,i),o)),rd(s.prototype,rd(i,fg(e,o))),ps[s.prop=n]=s,e.targetTest&&(um.push(s),Nb[n]=1),n=(n==="css"?"CSS":n.charAt(0).toUpperCase()+n.substr(1))+"Plugin"}VO(n,s),e.register&&e.register(ts,s,Jr)}else r9.push(e)},Zt=255,Ef={aqua:[0,Zt,Zt],lime:[0,Zt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Zt],navy:[0,0,128],white:[Zt,Zt,Zt],olive:[128,128,0],yellow:[Zt,Zt,0],orange:[Zt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Zt,0,0],pink:[Zt,192,203],cyan:[0,Zt,Zt],transparent:[Zt,Zt,Zt,0]},o_=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)*Zt+.5|0},i9=function(e,n,r){var s=e?jo(e)?[e>>16,e>>8&Zt,e&Zt]:0:Ef.black,i,o,l,u,d,f,p,g,v,w;if(!s){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Ef[e])s=Ef[e];else if(e.charAt(0)==="#"){if(e.length<6&&(i=e.charAt(1),o=e.charAt(2),l=e.charAt(3),e="#"+i+i+o+o+l+l+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return s=parseInt(e.substr(1,6),16),[s>>16,s>>8&Zt,s&Zt,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),s=[e>>16,e>>8&Zt,e&Zt]}else if(e.substr(0,3)==="hsl"){if(s=w=e.match(_3),!n)u=+s[0]%360/360,d=+s[1]/100,f=+s[2]/100,o=f<=.5?f*(d+1):f+d-f*d,i=f*2-o,s.length>3&&(s[3]*=1),s[0]=o_(u+1/3,i,o),s[1]=o_(u,i,o),s[2]=o_(u-1/3,i,o);else if(~e.indexOf("="))return s=e.match(DO),r&&s.length<4&&(s[3]=1),s}else s=e.match(_3)||Ef.transparent;s=s.map(Number)}return n&&!w&&(i=s[0]/Zt,o=s[1]/Zt,l=s[2]/Zt,p=Math.max(i,o,l),g=Math.min(i,o,l),f=(p+g)/2,p===g?u=d=0:(v=p-g,d=f>.5?v/(2-p-g):v/(p+g),u=p===i?(o-l)/v+(o<l?6:0):p===o?(l-i)/v+2:(i-o)/v+4,u*=60),s[0]=~~(u+.5),s[1]=~~(d*100+.5),s[2]=~~(f*100+.5)),r&&s.length<4&&(s[3]=1),s},o9=function(e){var n=[],r=[],s=-1;return e.split(ja).forEach(function(i){var o=i.match(yu)||[];n.push.apply(n,o),r.push(s+=o.length+1)}),n.c=r,n},E3=function(e,n,r){var s="",i=(e+s).match(ja),o=n?"hsla(":"rgba(",l=0,u,d,f,p;if(!i)return e;if(i=i.map(function(g){return(g=i9(g,n,1))&&o+(n?g[0]+","+g[1]+"%,"+g[2]+"%,"+g[3]:g.join(","))+")"}),r&&(f=o9(e),u=r.c,u.join(s)!==f.c.join(s)))for(d=e.replace(ja,"1").split(yu),p=d.length-1;l<p;l++)s+=d[l]+(~u.indexOf(l)?i.shift()||o+"0,0,0,0)":(f.length?f:i.length?i:r).shift());if(!d)for(d=e.split(ja),p=d.length-1;l<p;l++)s+=d[l]+i[l];return s+d[p]},ja=(function(){var t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in Ef)t+="|"+e+"\\b";return new RegExp(t+")","gi")})(),hte=/hsl[a]?\(/,a9=function(e){var n=e.join(" "),r;if(ja.lastIndex=0,ja.test(n))return r=hte.test(n),e[1]=E3(e[1],r),e[0]=E3(e[0],r,o9(e[1])),!0},Ph,gs=(function(){var t=Date.now,e=500,n=33,r=t(),s=r,i=1e3/240,o=i,l=[],u,d,f,p,g,v,w=function _(x){var b=t()-s,E=x===!0,C,R,A,I;if((b>e||b<0)&&(r+=b-n),s+=b,A=s-r,C=A-o,(C>0||E)&&(I=++p.frame,g=A-p.time*1e3,p.time=A=A/1e3,o+=C+(C>=i?4:i-C),R=1),E||(u=d(_)),R)for(v=0;v<l.length;v++)l[v](A,g,I,x)};return p={time:0,frame:0,tick:function(){w(!0)},deltaRatio:function(x){return g/(1e3/(x||60))},wake:function(){jO&&(!yw&&Mb()&&(Ii=yw=window,Ob=Ii.document||{},ks.gsap=ts,(Ii.gsapVersions||(Ii.gsapVersions=[])).push(ts.version),FO(ug||Ii.GreenSockGlobals||!Ii.gsap&&Ii||{}),r9.forEach(s9)),f=typeof requestAnimationFrame<"u"&&requestAnimationFrame,u&&p.sleep(),d=f||function(x){return setTimeout(x,o-p.time*1e3+1|0)},Ph=1,w(2))},sleep:function(){(f?cancelAnimationFrame:clearTimeout)(u),Ph=0,d=Eh},lagSmoothing:function(x,b){e=x||1/0,n=Math.min(b||33,e)},fps:function(x){i=1e3/(x||240),o=p.time*1e3+i},add:function(x,b,E){var C=b?function(R,A,I,M){x(R,A,I,M),p.remove(C)}:x;return p.remove(x),l[E?"unshift":"push"](C),od(),C},remove:function(x,b){~(b=l.indexOf(x))&&l.splice(b,1)&&v>=b&&v--},_listeners:l},p})(),od=function(){return!Ph&&gs.wake()},bt={},pte=/^[\d.\-M][\d.\-,\s]/,mte=/["']/g,gte=function(e){for(var n={},r=e.substr(1,e.length-3).split(":"),s=r[0],i=1,o=r.length,l,u,d;i<o;i++)u=r[i],l=i!==o-1?u.lastIndexOf(","):u.length,d=u.substr(0,l),n[s]=isNaN(d)?d.replace(mte,"").trim():+d,s=u.substr(l+1).trim();return n},vte=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)},yte=function(e){var n=(e+"").split("("),r=bt[n[0]];return r&&n.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[gte(n[1])]:vte(e).split(",").map(UO)):bt._CE&&pte.test(e)?bt._CE("",e):r},_te=function(e){return function(n){return 1-e(1-n)}},ic=function(e,n){return e&&(Cn(e)?e:bt[e]||yte(e))||n},mc=function(e,n,r,s){r===void 0&&(r=function(u){return 1-n(1-u)}),s===void 0&&(s=function(u){return u<.5?n(u*2)/2:1-n((1-u)*2)/2});var i={easeIn:n,easeOut:r,easeInOut:s},o;return Qr(e,function(l){bt[l]=ks[l]=i,bt[o=l.toLowerCase()]=r;for(var u in i)bt[o+(u==="easeIn"?".in":u==="easeOut"?".out":".inOut")]=bt[l+"."+u]=i[u]}),i},l9=function(e){return function(n){return n<.5?(1-e(1-n*2))/2:.5+e((n-.5)*2)/2}},a_=function t(e,n,r){var s=n>=1?n:1,i=(r||(e?.3:.45))/(n<1?n:1),o=i/vw*(Math.asin(1/s)||0),l=function(f){return f===1?1:s*Math.pow(2,-10*f)*Bee((f-o)*i)+1},u=e==="out"?l:e==="in"?function(d){return 1-l(1-d)}:l9(l);return i=vw/i,u.config=function(d,f){return t(e,d,f)},u},l_=function t(e,n){n===void 0&&(n=1.70158);var r=function(o){return o?--o*o*((n+1)*o+n)+1:0},s=e==="out"?r:e==="in"?function(i){return 1-r(1-i)}:l9(r);return s.config=function(i){return t(e,i)},s};Qr("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var n=e<5?e+1:e;mc(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})});bt.Linear.easeNone=bt.none=bt.Linear.easeIn;mc("Elastic",a_("in"),a_("out"),a_());(function(t,e){var n=1/e,r=2*n,s=2.5*n,i=function(l){return l<n?t*l*l:l<r?t*Math.pow(l-1.5/e,2)+.75:l<s?t*(l-=2.25/e)*l+.9375:t*Math.pow(l-2.625/e,2)+.984375};mc("Bounce",function(o){return 1-i(1-o)},i)})(7.5625,2.75);mc("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)});mc("Circ",function(t){return-(LO(1-t*t)-1)});mc("Sine",function(t){return t===1?1:-zee(t*Vee)+1});mc("Back",l_("in"),l_("out"),l_());bt.SteppedEase=bt.steps=ks.SteppedEase={config:function(e,n){e===void 0&&(e=1);var r=1/e,s=e+(n?0:1),i=n?1:0,o=1-Wt;return function(l){return((s*Kh(0,o,l)|0)+i)*r}}};Sh.ease=bt["quad.out"];Qr("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return Db+=t+","+t+"Params,"});var c9=function(e,n){this.id=Hee++,e._gsap=this,this.target=e,this.harness=n,this.get=n?n.get:zO,this.set=n?n.getSetter:zb},Rh=(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,id(this,+n.duration,1,1),this.data=n.data,hn&&(this._ctx=hn,hn.data.push(this)),Ph||gs.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,id(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,s){if(od(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(qg(this,r),!i._dp||i.parent||qO(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)&&$i(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!s||this._initted&&Math.abs(this._zTime)===Wt||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),BO(this,r,s)),this},e.time=function(r,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+b3(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)+b3(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?sd(this._tTime,i)+1:1},e.timeScale=function(r,s){if(!arguments.length)return this._rts===-Wt?0:this._rts;if(this._rts===r)return this;var i=this.parent&&this._ts?hg(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-Wt?0:this._rts,this.totalTime(Kh(-Math.abs(this._delay),this.totalDuration(),i),s!==!1),Wg(this),Jee(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):(od(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Wt&&(this._tTime-=Wt)))),this):this._ps},e.startTime=function(r){if(arguments.length){this._start=xn(r);var s=this.parent||this._dp;return s&&(s._sort||!this.parent)&&$i(s,this,this._start-this._delay),this}return this._start},e.endTime=function(r){return this._start+(Xr(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?hg(s.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=Kee);var s=pr;return pr=r,jb(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),pr=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,S3(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var s=this._time;return this._rDelay=r,S3(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(Fs(this,r),Xr(s))},e.restart=function(r,s){return this.play().totalTime(r?-this._delay:0,Xr(s)),this._dur||(this._zTime=-Wt),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?-Wt:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-Wt,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)-Wt)},e.eventCallback=function(r,s,i){var o=this.vars;return arguments.length>1?(s?(o[r]=s,i&&(o[r+"Params"]=i),r==="onUpdate"&&(this._onUpdate=s)):delete o[r],this):o[r]},e.then=function(r){var s=this,i=s._prom;return new Promise(function(o){var l=Cn(r)?r:ZO,u=function(){var f=s.then;s.then=null,i&&i(),Cn(l)&&(l=l(s))&&(l.then||l===s)&&(s.then=f),o(l),s.then=f};s._initted&&s.totalProgress()===1&&s._ts>=0||!s._tTime&&s._ts<0?u():s._prom=u})},e.kill=function(){kf(this)},t})();Es(Rh.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:-Wt,_prom:0,_ps:!1,_rts:1});var qr=(function(t){OO(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=Xr(r.sortChildren),bn&&$i(r.parent||bn,wo(i),s),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&GO(wo(i),r.scrollTrigger),i}var n=e.prototype;return n.to=function(s,i,o){return Wf(0,arguments,this),this},n.from=function(s,i,o){return Wf(1,arguments,this),this},n.fromTo=function(s,i,o,l){return Wf(2,arguments,this),this},n.set=function(s,i,o){return i.duration=0,i.parent=this,Zf(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new Hn(s,i,Fs(this,o),1),this},n.call=function(s,i,o){return $i(this,Hn.delayedCall(0,s,i),o)},n.staggerTo=function(s,i,o,l,u,d,f){return o.duration=i,o.stagger=o.stagger||l,o.onComplete=d,o.onCompleteParams=f,o.parent=this,new Hn(s,o,Fs(this,u)),this},n.staggerFrom=function(s,i,o,l,u,d,f){return o.runBackwards=1,Zf(o).immediateRender=Xr(o.immediateRender),this.staggerTo(s,i,o,l,u,d,f)},n.staggerFromTo=function(s,i,o,l,u,d,f,p){return l.startAt=o,Zf(l).immediateRender=Xr(l.immediateRender),this.staggerTo(s,i,l,u,d,f,p)},n.render=function(s,i,o){var l=this._time,u=this._dirty?this.totalDuration():this._tDur,d=this._dur,f=s<=0?0:xn(s),p=this._zTime<0!=s<0&&(this._initted||!d),g,v,w,_,x,b,E,C,R,A,I,M;if(this!==bn&&f>u&&s>=0&&(f=u),f!==this._tTime||o||p){if(l!==this._time&&d&&(f+=this._time-l,s+=this._time-l),g=f,R=this._start,C=this._ts,b=!C,p&&(d||(l=this._zTime),(s||!i)&&(this._zTime=s)),this._repeat){if(I=this._yoyo,x=d+this._rDelay,this._repeat<-1&&s<0)return this.totalTime(x*100+s,i,o);if(g=xn(f%x),f===u?(_=this._repeat,g=d):(A=xn(f/x),_=~~A,_&&_===A&&(g=d,_--),g>d&&(g=d)),A=sd(this._tTime,x),!l&&this._tTime&&A!==_&&this._tTime-A*x-this._dur<=0&&(A=_),I&&_&1&&(g=d-g,M=1),_!==A&&!this._lock){var T=I&&A&1,L=T===(I&&_&1);if(_<A&&(T=!T),l=T?0:f%d?d:f,this._lock=1,this.render(l||(M?0:xn(_*x)),i,!d)._lock=0,this._tTime=f,!i&&this.parent&&vs(this,"onRepeat"),this.vars.repeatRefresh&&!M&&(this.invalidate()._lock=1,A=_),l&&l!==this._time||b!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(d=this._dur,u=this._tDur,L&&(this._lock=2,l=T?d:-1e-4,this.render(l,!0),this.vars.repeatRefresh&&!M&&this.invalidate()),this._lock=0,!this._ts&&!b)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(E=rte(this,xn(l),xn(g)),E&&(f-=g-(g=E._start))),this._tTime=f,this._time=g,this._act=!!C,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=s,l=0),!l&&f&&d&&!i&&!A&&(vs(this,"onStart"),this._tTime!==f))return this;if(g>=l&&s>=0)for(v=this._first;v;){if(w=v._next,(v._act||g>=v._start)&&v._ts&&E!==v){if(v.parent!==this)return this.render(s,i,o);if(v.render(v._ts>0?(g-v._start)*v._ts:(v._dirty?v.totalDuration():v._tDur)+(g-v._start)*v._ts,i,o),g!==this._time||!this._ts&&!b){E=0,w&&(f+=this._zTime=-Wt);break}}v=w}else{v=this._last;for(var D=s<0?s:g;v;){if(w=v._prev,(v._act||D<=v._end)&&v._ts&&E!==v){if(v.parent!==this)return this.render(s,i,o);if(v.render(v._ts>0?(D-v._start)*v._ts:(v._dirty?v.totalDuration():v._tDur)+(D-v._start)*v._ts,i,o||pr&&jb(v)),g!==this._time||!this._ts&&!b){E=0,w&&(f+=this._zTime=D?-Wt:Wt);break}}v=w}}if(E&&!i&&(this.pause(),E.render(g>=l?0:-Wt)._zTime=g>=l?1:-1,this._ts))return this._start=R,Wg(this),this.render(s,i,o);this._onUpdate&&!i&&vs(this,"onUpdate",!0),(f===u&&this._tTime>=this.totalDuration()||!f&&l)&&(R===this._start||Math.abs(C)!==Math.abs(this._ts))&&(this._lock||((s||!d)&&(f===u&&this._ts>0||!f&&this._ts<0)&&qa(this,1),!i&&!(s<0&&!l)&&(f||l||!u)&&(vs(this,f===u&&s>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(f<u&&this.timeScale()>0)&&this._prom())))}return this},n.add=function(s,i){var o=this;if(jo(i)||(i=Fs(this,i,s)),!(s instanceof Rh)){if(kr(s))return s.forEach(function(l){return o.add(l,i)}),this;if(ir(s))return this.addLabel(s,i);if(Cn(s))s=Hn.delayedCall(0,s);else return this}return this!==s?$i(this,s,i):this},n.getChildren=function(s,i,o,l){s===void 0&&(s=!0),i===void 0&&(i=!0),o===void 0&&(o=!0),l===void 0&&(l=-Bs);for(var u=[],d=this._first;d;)d._start>=l&&(d instanceof Hn?i&&u.push(d):(o&&u.push(d),s&&u.push.apply(u,d.getChildren(!0,i,o)))),d=d._next;return u},n.getById=function(s){for(var i=this.getChildren(1,1,1),o=i.length;o--;)if(i[o].vars.id===s)return i[o]},n.remove=function(s){return ir(s)?this.removeLabel(s):Cn(s)?this.killTweensOf(s):(s.parent===this&&Zg(this,s),s===this._recent&&(this._recent=this._last),sc(this))},n.totalTime=function(s,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=xn(gs.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]=Fs(this,i),this},n.removeLabel=function(s){return delete this.labels[s],this},n.addPause=function(s,i,o){var l=Hn.delayedCall(0,i||Eh,o);return l.data="isPause",this._hasPause=1,$i(this,l,Fs(this,s))},n.removePause=function(s){var i=this._first;for(s=Fs(this,s);i;)i._start===s&&i.data==="isPause"&&qa(i),i=i._next},n.killTweensOf=function(s,i,o){for(var l=this.getTweensOf(s,o),u=l.length;u--;)Ta!==l[u]&&l[u].kill(s,i);return this},n.getTweensOf=function(s,i){for(var o=[],l=Us(s),u=this._first,d=jo(i),f;u;)u instanceof Hn?Yee(u._targets,l)&&(d?(!Ta||u._initted&&u._ts)&&u.globalTime(0)<=i&&u.globalTime(u.totalDuration())>i:!i||u.isActive())&&o.push(u):(f=u.getTweensOf(l,i)).length&&o.push.apply(o,f),u=u._next;return o},n.tweenTo=function(s,i){i=i||{};var o=this,l=Fs(o,s),u=i,d=u.startAt,f=u.onStart,p=u.onStartParams,g=u.immediateRender,v,w=Hn.to(o,Es({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:l,overwrite:"auto",duration:i.duration||Math.abs((l-(d&&"time"in d?d.time:o._time))/o.timeScale())||Wt,onStart:function(){if(o.pause(),!v){var x=i.duration||Math.abs((l-(d&&"time"in d?d.time:o._time))/o.timeScale());w._dur!==x&&id(w,x,0,1).render(w._time,!0,!0),v=1}f&&f.apply(w,p||[])}},i));return g?w.render(0):w},n.tweenFromTo=function(s,i,o){return this.tweenTo(i,Es({startAt:{time:Fs(this,s)}},o))},n.recent=function(){return this._recent},n.nextLabel=function(s){return s===void 0&&(s=this._time),k3(this,Fs(this,s))},n.previousLabel=function(s){return s===void 0&&(s=this._time),k3(this,Fs(this,s),1)},n.currentLabel=function(s){return arguments.length?this.seek(s,!0):this.previousLabel(this._time+Wt)},n.shiftChildren=function(s,i,o){o===void 0&&(o=0);var l=this._first,u=this.labels,d;for(s=xn(s);l;)l._start>=o&&(l._start+=s,l._end+=s),l=l._next;if(i)for(d in u)u[d]>=o&&(u[d]+=s);return sc(this)},n.invalidate=function(s){var i=this._first;for(this._lock=0;i;)i.invalidate(s),i=i._next;return t.prototype.invalidate.call(this,s)},n.clear=function(s){s===void 0&&(s=!0);for(var i=this._first,o;i;)o=i._next,this.remove(i),i=o;return this._dp&&(this._time=this._tTime=this._pTime=0),s&&(this.labels={}),sc(this)},n.totalDuration=function(s){var i=0,o=this,l=o._last,u=Bs,d,f,p;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-s:s));if(o._dirty){for(p=o.parent;l;)d=l._prev,l._dirty&&l.totalDuration(),f=l._start,f>u&&o._sort&&l._ts&&!o._lock?(o._lock=1,$i(o,l,f-l._delay,1)._lock=0):u=f,f<0&&l._ts&&(i-=f,(!p&&!o._dp||p&&p.smoothChildTiming)&&(o._start+=xn(f/o._ts),o._time-=f,o._tTime-=f),o.shiftChildren(-f,!1,-1/0),u=0),l._end>i&&l._ts&&(i=l._end),l=d;id(o,o===bn&&o._time>i?o._time:i,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(s){if(bn._ts&&(BO(bn,hg(s,bn)),HO=gs.frame),gs.frame>=w3){w3+=xs.autoSleep||120;var i=bn._first;if((!i||!i._ts)&&xs.autoSleep&&gs._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||gs.sleep()}}},e})(Rh);Es(qr.prototype,{_lock:0,_hasPause:0,_forcing:0});var wte=function(e,n,r,s,i,o,l){var u=new Jr(this._pt,e,n,0,1,m9,null,i),d=0,f=0,p,g,v,w,_,x,b,E;for(u.b=r,u.e=s,r+="",s+="",(b=~s.indexOf("random("))&&(s=Ch(s)),o&&(E=[r,s],o(E,e,n),r=E[0],s=E[1]),g=r.match(s_)||[];p=s_.exec(s);)w=p[0],_=s.substring(d,p.index),v?v=(v+1)%5:_.substr(-5)==="rgba("&&(v=1),w!==g[f++]&&(x=parseFloat(g[f-1])||0,u._pt={_next:u._pt,p:_||f===1?_:",",s:x,c:w.charAt(1)==="="?Cu(x,w)-x:parseFloat(w)-x,m:v&&v<4?Math.round:0},d=s_.lastIndex);return u.c=d<s.length?s.substring(d,s.length):"",u.fp=l,($O.test(s)||b)&&(u.e=0),this._pt=u,u},Fb=function(e,n,r,s,i,o,l,u,d,f){Cn(s)&&(s=s(i||0,e,o));var p=e[n],g=r!=="get"?r:Cn(p)?d?e[n.indexOf("set")||!Cn(e["get"+n.substr(3)])?n:"get"+n.substr(3)](d):e[n]():p,v=Cn(p)?d?Ete:h9:Hb,w;if(ir(s)&&(~s.indexOf("random(")&&(s=Ch(s)),s.charAt(1)==="="&&(w=Cu(g,s)+(br(g)||0),(w||w===0)&&(s=w))),!f||g!==s||Ew)return!isNaN(g*s)&&s!==""?(w=new Jr(this._pt,e,n,+g||0,s-(g||0),typeof p=="boolean"?Pte:p9,0,v),d&&(w.fp=d),l&&w.modifier(l,this,e),this._pt=w):(!p&&!(n in e)&&Lb(n,s),wte.call(this,e,n,g,s,v,u||xs.stringFilter,d))},xte=function(e,n,r,s,i){if(Cn(e)&&(e=qf(e,i,n,r,s)),!qi(e)||e.style&&e.nodeType||kr(e)||NO(e))return ir(e)?qf(e,i,n,r,s):e;var o={},l;for(l in e)o[l]=qf(e[l],i,n,r,s);return o},u9=function(e,n,r,s,i,o){var l,u,d,f;if(ps[e]&&(l=new ps[e]).init(i,l.rawVars?n[e]:xte(n[e],s,i,o,r),r,s,o)!==!1&&(r._pt=u=new Jr(r._pt,i,e,0,1,l.render,l,0,l.priority),r!==_u))for(d=r._ptLookup[r._targets.indexOf(i)],f=l._props.length;f--;)d[l._props[f]]=u;return l},Ta,Ew,Vb=function t(e,n,r){var s=e.vars,i=s.ease,o=s.startAt,l=s.immediateRender,u=s.lazy,d=s.onUpdate,f=s.runBackwards,p=s.yoyoEase,g=s.keyframes,v=s.autoRevert,w=e._dur,_=e._startAt,x=e._targets,b=e.parent,E=b&&b.data==="nested"?b.vars.targets:x,C=e._overwrite==="auto"&&!Tb,R=e.timeline,A=s.easeReverse||p,I,M,T,L,D,j,H,Y,U,z,Z,Q,B;if(R&&(!g||!i)&&(i="none"),e._ease=ic(i,Sh.ease),e._rEase=A&&(ic(A)||e._ease),e._from=!R&&!!s.runBackwards,e._from&&(e.ratio=1),!R||g&&!s.stagger){if(Y=x[0]?rc(x[0]).harness:0,Q=Y&&s[Y.prop],I=fg(s,Nb),_&&(_._zTime<0&&_.progress(1),n<0&&f&&l&&!v?_.render(-1,!0):_.revert(f&&w?cm:Gee),_._lazy=0),o){if(qa(e._startAt=Hn.set(x,Es({data:"isStart",overwrite:!1,parent:b,immediateRender:!0,lazy:!_&&Xr(u),startAt:null,delay:0,onUpdate:d&&function(){return vs(e,"onUpdate")},stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,n<0&&(pr||!l&&!v)&&e._startAt.revert(cm),l&&w&&n<=0&&r<=0){n&&(e._zTime=n);return}}else if(f&&w&&!_){if(n&&(l=!1),T=Es({overwrite:!1,data:"isFromStart",lazy:l&&!_&&Xr(u),immediateRender:l,stagger:0,parent:b},I),Q&&(T[Y.prop]=Q),qa(e._startAt=Hn.set(x,T)),e._startAt._dp=0,e._startAt._sat=e,n<0&&(pr?e._startAt.revert(cm):e._startAt.render(-1,!0)),e._zTime=n,!l)t(e._startAt,Wt,Wt);else if(!n)return}for(e._pt=e._ptCache=0,u=w&&Xr(u)||u&&!w,M=0;M<x.length;M++){if(D=x[M],H=D._gsap||$b(x)[M]._gsap,e._ptLookup[M]=z={},_w[H.id]&&$a.length&&dg(),Z=E===x?M:E.indexOf(D),Y&&(U=new Y).init(D,Q||I,e,Z,E)!==!1&&(e._pt=L=new Jr(e._pt,D,U.name,0,1,U.render,U,0,U.priority),U._props.forEach(function(ee){z[ee]=L}),U.priority&&(j=1)),!Y||Q)for(T in I)ps[T]&&(U=u9(T,I,e,Z,D,E))?U.priority&&(j=1):z[T]=L=Fb.call(e,D,T,"get",I[T],Z,E,0,s.stringFilter);e._op&&e._op[M]&&e.kill(D,e._op[M]),C&&e._pt&&(Ta=e,bn.killTweensOf(D,z,e.globalTime(n)),B=!e.parent,Ta=0),e._pt&&u&&(_w[H.id]=1)}j&&g9(e),e._onInit&&e._onInit(e)}e._onUpdate=d,e._initted=(!e._op||e._pt)&&!B,g&&n<=0&&R.render(Bs,!0,!0)},bte=function(e,n,r,s,i,o,l,u){var d=(e._pt&&e._ptCache||(e._ptCache={}))[n],f,p,g,v;if(!d)for(d=e._ptCache[n]=[],g=e._ptLookup,v=e._targets.length;v--;){if(f=g[v][n],f&&f.d&&f.d._pt)for(f=f.d._pt;f&&f.p!==n&&f.fp!==n;)f=f._next;if(!f)return Ew=1,e.vars[n]="+=0",Vb(e,l),Ew=0,u?kh(n+" not eligible for reset. Try splitting into individual properties"):1;d.push(f)}for(v=d.length;v--;)p=d[v],f=p._pt||p,f.s=(s||s===0)&&!i?s:f.s+(s||0)+o*f.c,f.c=r-f.s,p.e&&(p.e=Tn(r)+br(p.e)),p.b&&(p.b=f.s+br(p.b))},Ste=function(e,n){var r=e[0]?rc(e[0]).harness:0,s=r&&r.aliases,i,o,l,u;if(!s)return n;i=rd({},n);for(o in s)if(o in i)for(u=s[o].split(","),l=u.length;l--;)i[u[l]]=i[o];return i},kte=function(e,n,r,s){var i=n.ease||s||"power1.inOut",o,l;if(kr(n))l=r[e]||(r[e]=[]),n.forEach(function(u,d){return l.push({t:d/(n.length-1)*100,v:u,e:i})});else for(o in n)l=r[o]||(r[o]=[]),o==="ease"||l.push({t:parseFloat(e),v:n[o],e:i})},qf=function(e,n,r,s,i){return Cn(e)?e.call(n,r,s,i):ir(e)&&~e.indexOf("random(")?Ch(e):e},d9=Db+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",f9={};Qr(d9+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return f9[t]=1});var Hn=(function(t){OO(e,t);function e(r,s,i,o){var l;typeof s=="number"&&(i.duration=s,s=i,i=null),l=t.call(this,o?s:Zf(s))||this;var u=l.vars,d=u.duration,f=u.delay,p=u.immediateRender,g=u.stagger,v=u.overwrite,w=u.keyframes,_=u.defaults,x=u.scrollTrigger,b=s.parent||bn,E=(kr(r)||NO(r)?jo(r[0]):"length"in s)?[r]:Us(r),C,R,A,I,M,T,L,D;if(l._targets=E.length?$b(E):kh("GSAP target "+r+" not found. https://gsap.com",!xs.nullTargetWarn)||[],l._ptLookup=[],l._overwrite=v,w||g||D0(d)||D0(f)){s=l.vars;var j=s.easeReverse||s.yoyoEase;if(C=l.timeline=new qr({data:"nested",defaults:_||{},targets:b&&b.data==="nested"?b.vars.targets:E}),C.kill(),C.parent=C._dp=wo(l),C._start=0,g||D0(d)||D0(f)){if(I=E.length,L=g&&QO(g),qi(g))for(M in g)~d9.indexOf(M)&&(D||(D={}),D[M]=g[M]);for(R=0;R<I;R++)A=fg(s,f9),A.stagger=0,j&&(A.easeReverse=j),D&&rd(A,D),T=E[R],A.duration=+qf(d,wo(l),R,T,E),A.delay=(+qf(f,wo(l),R,T,E)||0)-l._delay,!g&&I===1&&A.delay&&(l._delay=f=A.delay,l._start+=f,A.delay=0),C.to(T,A,L?L(R,T,E):0),C._ease=bt.none;C.duration()?d=f=0:l.timeline=0}else if(w){Zf(Es(C.vars.defaults,{ease:"none"})),C._ease=ic(w.ease||s.ease||"none");var H=0,Y,U,z;if(kr(w))w.forEach(function(Z){return C.to(E,Z,">")}),C.duration();else{A={};for(M in w)M==="ease"||M==="easeEach"||kte(M,w[M],A,w.easeEach);for(M in A)for(Y=A[M].sort(function(Z,Q){return Z.t-Q.t}),H=0,R=0;R<Y.length;R++)U=Y[R],z={ease:U.e,duration:(U.t-(R?Y[R-1].t:0))/100*d},z[M]=U.v,C.to(E,z,H),H+=z.duration;C.duration()<d&&C.to({},{duration:d-C.duration()})}}d||l.duration(d=C.duration())}else l.timeline=0;return v===!0&&!Tb&&(Ta=wo(l),bn.killTweensOf(E),Ta=0),$i(b,wo(l),i),s.reversed&&l.reverse(),s.paused&&l.paused(!0),(p||!d&&!w&&l._start===xn(b._time)&&Xr(p)&&ete(wo(l))&&b.data!=="nested")&&(l._tTime=-Wt,l.render(Math.max(0,-f)||0)),x&&GO(wo(l),x),l}var n=e.prototype;return n.render=function(s,i,o){var l=this._time,u=this._tDur,d=this._dur,f=s<0,p=s>u-Wt&&!f?u:s<Wt?0:s,g,v,w,_,x,b,E,C;if(!d)nte(this,s,i,o);else if(p!==this._tTime||!s||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==f||this._lazy){if(g=p,C=this.timeline,this._repeat){if(_=d+this._rDelay,this._repeat<-1&&f)return this.totalTime(_*100+s,i,o);if(g=xn(p%_),p===u?(w=this._repeat,g=d):(x=xn(p/_),w=~~x,w&&w===x?(g=d,w--):g>d&&(g=d)),b=this._yoyo&&w&1,b&&(g=d-g),x=sd(this._tTime,_),g===l&&!o&&this._initted&&w===x)return this._tTime=p,this;w!==x&&this.vars.repeatRefresh&&!b&&!this._lock&&g!==_&&this._initted&&(this._lock=o=1,this.render(xn(_*w),!0).invalidate()._lock=0)}if(!this._initted){if(KO(this,f?s:g,o,i,p))return this._tTime=0,this;if(l!==this._time&&!(o&&this.vars.repeatRefresh&&w!==x))return this;if(d!==this._dur)return this.render(s,i,o)}if(this._rEase){var R=g<l;if(R!==this._inv){var A=R?l:d-l;this._inv=R,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=l,this._invRecip=A?(R?-1:1)/A:0,this._invScale=R?-this.ratio:1-this.ratio,this._invEase=R?this._rEase:this._ease}this.ratio=E=this._invRatio+this._invScale*this._invEase((g-this._invTime)*this._invRecip)}else this.ratio=E=this._ease(g/d);if(this._from&&(this.ratio=E=1-E),this._tTime=p,this._time=g,!this._act&&this._ts&&(this._act=1,this._lazy=0),!l&&p&&!i&&!x&&(vs(this,"onStart"),this._tTime!==p))return this;for(v=this._pt;v;)v.r(E,v.d),v=v._next;C&&C.render(s<0?s:C._dur*C._ease(g/this._dur),i,o)||this._startAt&&(this._zTime=s),this._onUpdate&&!i&&(f&&ww(this,s,i,o),vs(this,"onUpdate")),this._repeat&&w!==x&&this.vars.onRepeat&&!i&&this.parent&&vs(this,"onRepeat"),(p===this._tDur||!p)&&this._tTime===p&&(f&&!this._onUpdate&&ww(this,s,!0,!0),(s||!d)&&(p===this._tDur&&this._ts>0||!p&&this._ts<0)&&qa(this,1),!i&&!(f&&!l)&&(p||l||b)&&(vs(this,p===u?"onComplete":"onReverseComplete",!0),this._prom&&!(p<u&&this.timeScale()>0)&&this._prom()))}return this},n.targets=function(){return this._targets},n.invalidate=function(s){return(!s||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(s),t.prototype.invalidate.call(this,s)},n.resetTo=function(s,i,o,l,u){Ph||gs.wake(),this._ts||this.play();var d=Math.min(this._dur,(this._dp._time-this._start)*this._ts),f;return this._initted||Vb(this,d),f=this._ease(d/this._dur),bte(this,s,i,o,l,f,d,u)?this.resetTo(s,i,o,l,1):(qg(this,0),this.parent||WO(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?kf(this):this.scrollTrigger&&this.scrollTrigger.kill(!!pr),this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(s,i,Ta&&Ta.vars.overwrite!==!0)._first||kf(this),this.parent&&o!==this.timeline.totalDuration()&&id(this,this._dur*this.timeline._tDur/o,0,1),this}var l=this._targets,u=s?Us(s):l,d=this._ptLookup,f=this._pt,p,g,v,w,_,x,b;if((!i||i==="all")&&Qee(l,u))return i==="all"&&(this._pt=0),kf(this);for(p=this._op=this._op||[],i!=="all"&&(ir(i)&&(_={},Qr(i,function(E){return _[E]=1}),i=_),i=Ste(l,i)),b=l.length;b--;)if(~u.indexOf(l[b])){g=d[b],i==="all"?(p[b]=i,w=g,v={}):(v=p[b]=p[b]||{},w=i);for(_ in w)x=g&&g[_],x&&((!("kill"in x.d)||x.d.kill(_)===!0)&&Zg(this,x,"_pt"),delete g[_]),v!=="all"&&(v[_]=1)}return this._initted&&!this._pt&&f&&kf(this),this},e.to=function(s,i){return new e(s,i,arguments[2])},e.from=function(s,i){return Wf(1,arguments)},e.delayedCall=function(s,i,o,l){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:s,onComplete:i,onReverseComplete:i,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:l})},e.fromTo=function(s,i,o){return Wf(2,arguments)},e.set=function(s,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new e(s,i)},e.killTweensOf=function(s,i,o){return bn.killTweensOf(s,i,o)},e})(Rh);Es(Hn.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});Qr("staggerTo,staggerFrom,staggerFromTo",function(t){Hn[t]=function(){var e=new qr,n=bw.call(arguments,0);return n.splice(t==="staggerFromTo"?5:4,0,0),e[t].apply(e,n)}});var Hb=function(e,n,r){return e[n]=r},h9=function(e,n,r){return e[n](r)},Ete=function(e,n,r,s){return e[n](s.fp,r)},Cte=function(e,n,r){return e.setAttribute(n,r)},zb=function(e,n){return Cn(e[n])?h9:Ib(e[n])&&e.setAttribute?Cte:Hb},p9=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e6)/1e6,n)},Pte=function(e,n){return n.set(n.t,n.p,!!(n.s+n.c*e),n)},m9=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)},Bb=function(e,n){for(var r=n._pt;r;)r.r(e,r.d),r=r._next},Rte=function(e,n,r,s){for(var i=this._pt,o;i;)o=i._next,i.p===s&&i.modifier(e,n,r),i=o},Ate=function(e){for(var n=this._pt,r,s;n;)s=n._next,n.p===e&&!n.op||n.op===e?Zg(this,n,"_pt"):n.dep||(r=1),n=s;return!r},Tte=function(e,n,r,s){s.mSet(e,n,s.m.call(s.tween,r,s.mt),s)},g9=function(e){for(var n=e._pt,r,s,i,o;n;){for(r=n._next,s=i;s&&s.pr>n.pr;)s=s._next;(n._prev=s?s._prev:o)?n._prev._next=n:i=n,(n._next=s)?s._prev=n:o=n,n=r}e._pt=i},Jr=(function(){function t(n,r,s,i,o,l,u,d,f){this.t=r,this.s=i,this.c=o,this.p=s,this.r=l||p9,this.d=u||this,this.set=d||Hb,this.pr=f||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=Tte,this.m=r,this.mt=i,this.tween=s},t})();Qr(Db+"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 Nb[t]=1});ks.TweenMax=ks.TweenLite=Hn;ks.TimelineLite=ks.TimelineMax=qr;bn=new qr({sortChildren:!1,defaults:Sh,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});xs.stringFilter=a9;var oc=[],dm={},Ite=[],C3=0,Mte=0,c_=function(e){return(dm[e]||Ite).map(function(n){return n()})},Cw=function(){var e=Date.now(),n=[];e-C3>2&&(c_("matchMediaInit"),oc.forEach(function(r){var s=r.queries,i=r.conditions,o,l,u,d;for(l in s)o=Ii.matchMedia(s[l]).matches,o&&(u=1),o!==i[l]&&(i[l]=o,d=1);d&&(r.revert(),u&&n.push(r))}),c_("matchMediaRevert"),n.forEach(function(r){return r.onMatch(r,function(s){return r.add(null,s)})}),C3=e,c_("matchMedia"))},v9=(function(){function t(n,r){this.selector=r&&Sw(r),this.data=[],this._r=[],this.isReverted=!1,this.id=Mte++,n&&this.add(n)}var e=t.prototype;return e.add=function(r,s,i){Cn(r)&&(i=s,s=r,r=Cn);var o=this,l=function(){var d=hn,f=o.selector,p;return d&&d!==o&&d.data.push(o),i&&(o.selector=Sw(i)),hn=o,p=s.apply(o,arguments),Cn(p)&&o._r.push(p),hn=d,o.selector=f,o.isReverted=!1,p};return o.last=l,r===Cn?l(o,function(u){return o.add(null,u)}):r?o[r]=l:l},e.ignore=function(r){var s=hn;hn=null,r(this),hn=s},e.getTweens=function(){var r=[];return this.data.forEach(function(s){return s instanceof t?r.push.apply(r,s.getTweens()):s instanceof Hn&&!(s.parent&&s.parent.data==="nested")&&r.push(s)}),r},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(r,s){var i=this;if(r?(function(){for(var l=i.getTweens(),u=i.data.length,d;u--;)d=i.data[u],d.data==="isFlip"&&(d.revert(),d.getChildren(!0,!0,!1).forEach(function(f){return l.splice(l.indexOf(f),1)}));for(l.map(function(f){return{g:f._dur||f._delay||f._sat&&!f._sat.vars.immediateRender?f.globalTime(0):-1/0,t:f}}).sort(function(f,p){return p.g-f.g||-1/0}).forEach(function(f){return f.t.revert(r)}),u=i.data.length;u--;)d=i.data[u],d instanceof qr?d.data!=="nested"&&(d.scrollTrigger&&d.scrollTrigger.revert(),d.kill()):!(d instanceof Hn)&&d.revert&&d.revert(r);i._r.forEach(function(f){return f(r,i)}),i.isReverted=!0})():this.data.forEach(function(l){return l.kill&&l.kill()}),this.clear(),s)for(var o=oc.length;o--;)oc[o].id===this.id&&oc.splice(o,1)},e.revert=function(r){this.kill(r||{})},t})(),Ote=(function(){function t(n){this.contexts=[],this.scope=n,hn&&hn.data.push(this)}var e=t.prototype;return e.add=function(r,s,i){qi(r)||(r={matches:r});var o=new v9(0,i||this.scope),l=o.conditions={},u,d,f;hn&&!o.selector&&(o.selector=hn.selector),this.contexts.push(o),s=o.add("onMatch",s),o.queries=r;for(d in r)d==="all"?f=1:(u=Ii.matchMedia(r[d]),u&&(oc.indexOf(o)<0&&oc.push(o),(l[d]=u.matches)&&(f=1),u.addListener?u.addListener(Cw):u.addEventListener("change",Cw)));return f&&s(o,function(p){return o.add(null,p)}),this},e.revert=function(r){this.kill(r||{})},e.kill=function(r){this.contexts.forEach(function(s){return s.kill(r,!0)})},t})(),pg={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 s9(s)})},timeline:function(e){return new qr(e)},getTweensOf:function(e,n){return bn.getTweensOf(e,n)},getProperty:function(e,n,r,s){ir(e)&&(e=Us(e)[0]);var i=rc(e||{}).get,o=r?ZO:UO;return r==="native"&&(r=""),e&&(n?o((ps[n]&&ps[n].get||i)(e,n,r,s)):function(l,u,d){return o((ps[l]&&ps[l].get||i)(e,l,u,d))})},quickSetter:function(e,n,r){if(e=Us(e),e.length>1){var s=e.map(function(f){return ts.quickSetter(f,n,r)}),i=s.length;return function(f){for(var p=i;p--;)s[p](f)}}e=e[0]||{};var o=ps[n],l=rc(e),u=l.harness&&(l.harness.aliases||{})[n]||n,d=o?function(f){var p=new o;_u._pt=0,p.init(e,r?f+r:f,_u,0,[e]),p.render(1,p),_u._pt&&Bb(1,_u)}:l.set(e,u);return o?d:function(f){return d(e,u,r?f+r:f,l,1)}},quickTo:function(e,n,r){var s,i=ts.to(e,Es((s={},s[n]="+=0.1",s.paused=!0,s.stagger=0,s),r||{})),o=function(u,d,f){return i.resetTo(n,u,d,f)};return o.tween=i,o},isTweening:function(e){return bn.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=ic(e.ease,Sh.ease)),x3(Sh,e||{})},config:function(e){return x3(xs,e||{})},registerEffect:function(e){var n=e.name,r=e.effect,s=e.plugins,i=e.defaults,o=e.extendTimeline;(s||"").split(",").forEach(function(l){return l&&!ps[l]&&!ks[l]&&kh(n+" effect requires "+l+" plugin.")}),i_[n]=function(l,u,d){return r(Us(l),Es(u||{},i),d)},o&&(qr.prototype[n]=function(l,u,d){return this.add(i_[n](l,qi(u)?u:(d=u)&&{},this),d)})},registerEase:function(e,n){bt[e]=ic(n)},parseEase:function(e,n){return arguments.length?ic(e,n):bt},getById:function(e){return bn.getById(e)},exportRoot:function(e,n){e===void 0&&(e={});var r=new qr(e),s,i;for(r.smoothChildTiming=Xr(e.smoothChildTiming),bn.remove(r),r._dp=0,r._time=r._tTime=bn._time,s=bn._first;s;)i=s._next,(n||!(!s._dur&&s instanceof Hn&&s.vars.onComplete===s._targets[0]))&&$i(r,s,s._start-s._delay),s=i;return $i(bn,r,0),r},context:function(e,n){return e?new v9(e,n):hn},matchMedia:function(e){return new Ote(e)},matchMediaRefresh:function(){return oc.forEach(function(e){var n=e.conditions,r,s;for(s in n)n[s]&&(n[s]=!1,r=1);r&&e.revert()})||Cw()},addEventListener:function(e,n){var r=dm[e]||(dm[e]=[]);~r.indexOf(n)||r.push(n)},removeEventListener:function(e,n){var r=dm[e],s=r&&r.indexOf(n);s>=0&&r.splice(s,1)},utils:{wrap:ute,wrapYoyo:dte,distribute:QO,random:e9,snap:JO,normalize:cte,getUnit:br,clamp:ite,splitColor:i9,toArray:Us,selector:Sw,mapRange:n9,pipe:ate,unitize:lte,interpolate:fte,shuffle:XO},install:FO,effects:i_,ticker:gs,updateRoot:qr.updateRoot,plugins:ps,globalTimeline:bn,core:{PropTween:Jr,globals:VO,Tween:Hn,Timeline:qr,Animation:Rh,getCache:rc,_removeLinkedListItem:Zg,reverting:function(){return pr},context:function(e){return e&&hn&&(hn.data.push(e),e._ctx=hn),hn},suppressOverwrites:function(e){return Tb=e}}};Qr("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return pg[t]=Hn[t]});gs.add(qr.updateRoot);_u=pg.to({},{duration:0});var Lte=function(e,n){for(var r=e._pt;r&&r.p!==n&&r.op!==n&&r.fp!==n;)r=r._next;return r},Nte=function(e,n){var r=e._targets,s,i,o;for(s in n)for(i=r.length;i--;)o=e._ptLookup[i][s],o&&(o=o.d)&&(o._pt&&(o=Lte(o,s)),o&&o.modifier&&o.modifier(n[s],e,r[i],s))},u_=function(e,n){return{name:e,headless:1,rawVars:1,init:function(s,i,o){o._onInit=function(l){var u,d;if(ir(i)&&(u={},Qr(i,function(f){return u[f]=1}),i=u),n){u={};for(d in i)u[d]=n(i[d]);i=u}Nte(l,i)}}}},ts=pg.registerPlugin({name:"attr",init:function(e,n,r,s,i){var o,l,u;this.tween=r;for(o in n)u=e.getAttribute(o)||"",l=this.add(e,"setAttribute",(u||0)+"",n[o],s,i,0,0,o),l.op=o,l.b=u,this._props.push(o)},render:function(e,n){for(var r=n._pt;r;)pr?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)}},u_("roundProps",kw),u_("modifiers"),u_("snap",JO))||pg;Hn.version=qr.version=ts.version="3.15.0";jO=1;Mb()&&od();bt.Power0;bt.Power1;bt.Power2;bt.Power3;bt.Power4;bt.Linear;bt.Quad;bt.Cubic;bt.Quart;bt.Quint;bt.Strong;bt.Elastic;bt.Back;bt.SteppedEase;bt.Bounce;bt.Sine;bt.Expo;bt.Circ;/*!
|
|
152
|
-
* CSSPlugin 3.15.0
|
|
153
|
-
* https://gsap.com
|
|
154
|
-
*
|
|
155
|
-
* Copyright 2008-2026, GreenSock. All rights reserved.
|
|
156
|
-
* Subject to the terms at https://gsap.com/standard-license
|
|
157
|
-
* @author: Jack Doyle, jack@greensock.com
|
|
158
|
-
*/var P3,Ia,Pu,Ub,zl,R3,Zb,Dte=function(){return typeof window<"u"},Fo={},jl=180/Math.PI,Ru=Math.PI/180,ou=Math.atan2,A3=1e8,Wb=/([A-Z])/g,$te=/(left|right|width|margin|padding|x)/i,jte=/[\s,\(]\S/,Vi={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Pw=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},Fte=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)},Vte=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)},Hte=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)},zte=function(e,n){var r=n.s+n.c*e;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},y9=function(e,n){return n.set(n.t,n.p,e?n.e:n.b,n)},_9=function(e,n){return n.set(n.t,n.p,e!==1?n.b:n.e,n)},Bte=function(e,n,r){return e.style[n]=r},Ute=function(e,n,r){return e.style.setProperty(n,r)},Zte=function(e,n,r){return e._gsap[n]=r},Wte=function(e,n,r){return e._gsap.scaleX=e._gsap.scaleY=r},qte=function(e,n,r,s,i){var o=e._gsap;o.scaleX=o.scaleY=r,o.renderTransform(i,o)},Gte=function(e,n,r,s,i){var o=e._gsap;o[n]=r,o.renderTransform(i,o)},Sn="transform",es=Sn+"Origin",Kte=function t(e,n){var r=this,s=this.target,i=s.style,o=s._gsap;if(e in Fo&&i){if(this.tfm=this.tfm||{},e!=="transform")e=Vi[e]||e,~e.indexOf(",")?e.split(",").forEach(function(l){return r.tfm[l]=xo(s,l)}):this.tfm[e]=o.x?o[e]:xo(s,e),e===es&&(this.tfm.zOrigin=o.zOrigin);else return Vi.transform.split(",").forEach(function(l){return t.call(r,l,n)});if(this.props.indexOf(Sn)>=0)return;o.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push(es,n,"")),e=Sn}(i||n)&&this.props.push(e,n,i[e])},w9=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},Yte=function(){var e=this.props,n=this.target,r=n.style,s=n._gsap,i,o;for(i=0;i<e.length;i+=3)e[i+1]?e[i+1]===2?n[e[i]](e[i+2]):n[e[i]]=e[i+2]:e[i+2]?r[e[i]]=e[i+2]:r.removeProperty(e[i].substr(0,2)==="--"?e[i]:e[i].replace(Wb,"-$1").toLowerCase());if(this.tfm){for(o in this.tfm)s[o]=this.tfm[o];s.svg&&(s.renderTransform(),n.setAttribute("data-svg-origin",this.svgo||"")),i=Zb(),(!i||!i.isStart)&&!r[Sn]&&(w9(r),s.zOrigin&&r[es]&&(r[es]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},x9=function(e,n){var r={target:e,props:[],revert:Yte,save:Kte};return e._gsap||ts.core.getCache(e),n&&e.style&&e.nodeType&&n.split(",").forEach(function(s){return r.save(s)}),r},b9,Rw=function(e,n){var r=Ia.createElementNS?Ia.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):Ia.createElement(e);return r&&r.style?r:Ia.createElement(e)},ys=function t(e,n,r){var s=getComputedStyle(e);return s[n]||s.getPropertyValue(n.replace(Wb,"-$1").toLowerCase())||s.getPropertyValue(n)||!r&&t(e,ad(n)||n,1)||""},T3="O,Moz,ms,Ms,Webkit".split(","),ad=function(e,n,r){var s=n||zl,i=s.style,o=5;if(e in i&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);o--&&!(T3[o]+e in i););return o<0?null:(o===3?"ms":o>=0?T3[o]:"")+e},Aw=function(){Dte()&&window.document&&(P3=window,Ia=P3.document,Pu=Ia.documentElement,zl=Rw("div")||{style:{}},Rw("div"),Sn=ad(Sn),es=Sn+"Origin",zl.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",b9=!!ad("perspective"),Zb=ts.core.reverting,Ub=1)},I3=function(e){var n=e.ownerSVGElement,r=Rw("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=e.cloneNode(!0),i;s.style.display="block",r.appendChild(s),Pu.appendChild(r);try{i=s.getBBox()}catch{}return r.removeChild(s),Pu.removeChild(r),i},M3=function(e,n){for(var r=n.length;r--;)if(e.hasAttribute(n[r]))return e.getAttribute(n[r])},S9=function(e){var n,r;try{n=e.getBBox()}catch{n=I3(e),r=1}return n&&(n.width||n.height)||r||(n=I3(e)),n&&!n.width&&!n.x&&!n.y?{x:+M3(e,["x","cx","x1"])||0,y:+M3(e,["y","cy","y1"])||0,width:0,height:0}:n},k9=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&S9(e))},Ga=function(e,n){if(n){var r=e.style,s;n in Fo&&n!==es&&(n=Sn),r.removeProperty?(s=n.substr(0,2),(s==="ms"||n.substr(0,6)==="webkit")&&(n="-"+n),r.removeProperty(s==="--"?n:n.replace(Wb,"-$1").toLowerCase())):r.removeAttribute(n)}},Ma=function(e,n,r,s,i,o){var l=new Jr(e._pt,n,r,0,1,o?_9:y9);return e._pt=l,l.b=s,l.e=i,e._props.push(r),l},O3={deg:1,rad:1,turn:1},Xte={grid:1,flex:1},Ka=function t(e,n,r,s){var i=parseFloat(r)||0,o=(r+"").trim().substr((i+"").length)||"px",l=zl.style,u=$te.test(n),d=e.tagName.toLowerCase()==="svg",f=(d?"client":"offset")+(u?"Width":"Height"),p=100,g=s==="px",v=s==="%",w,_,x,b;if(s===o||!i||O3[s]||O3[o])return i;if(o!=="px"&&!g&&(i=t(e,n,r,"px")),b=e.getCTM&&k9(e),(v||o==="%")&&(Fo[n]||~n.indexOf("adius")))return w=b?e.getBBox()[u?"width":"height"]:e[f],Tn(v?i/w*p:i/100*w);if(l[u?"width":"height"]=p+(g?o:s),_=s!=="rem"&&~n.indexOf("adius")||s==="em"&&e.appendChild&&!d?e:e.parentNode,b&&(_=(e.ownerSVGElement||{}).parentNode),(!_||_===Ia||!_.appendChild)&&(_=Ia.body),x=_._gsap,x&&v&&x.width&&u&&x.time===gs.time&&!x.uncache)return Tn(i/x.width*p);if(v&&(n==="height"||n==="width")){var E=e.style[n];e.style[n]=p+s,w=e[f],E?e.style[n]=E:Ga(e,n)}else(v||o==="%")&&!Xte[ys(_,"display")]&&(l.position=ys(e,"position")),_===e&&(l.position="static"),_.appendChild(zl),w=zl[f],_.removeChild(zl),l.position="absolute";return u&&v&&(x=rc(_),x.time=gs.time,x.width=_[f]),Tn(g?w*i/p:w&&i?p/w*i:0)},xo=function(e,n,r,s){var i;return Ub||Aw(),n in Vi&&n!=="transform"&&(n=Vi[n],~n.indexOf(",")&&(n=n.split(",")[0])),Fo[n]&&n!=="transform"?(i=Th(e,s),i=n!=="transformOrigin"?i[n]:i.svg?i.origin:gg(ys(e,es))+" "+i.zOrigin+"px"):(i=e.style[n],(!i||i==="auto"||s||~(i+"").indexOf("calc("))&&(i=mg[n]&&mg[n](e,n,r)||ys(e,n)||zO(e,n)||(n==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?Ka(e,n,i,r)+r:i},Qte=function(e,n,r,s){if(!r||r==="none"){var i=ad(n,e,1),o=i&&ys(e,i,1);o&&o!==r?(n=i,r=o):n==="borderColor"&&(r=ys(e,"borderTopColor"))}var l=new Jr(this._pt,e.style,n,0,1,m9),u=0,d=0,f,p,g,v,w,_,x,b,E,C,R,A;if(l.b=r,l.e=s,r+="",s+="",s.substring(0,6)==="var(--"&&(s=ys(e,s.substring(4,s.indexOf(")")))),s==="auto"&&(_=e.style[n],e.style[n]=s,s=ys(e,n)||s,_?e.style[n]=_:Ga(e,n)),f=[r,s],a9(f),r=f[0],s=f[1],g=r.match(yu)||[],A=s.match(yu)||[],A.length){for(;p=yu.exec(s);)x=p[0],E=s.substring(u,p.index),w?w=(w+1)%5:(E.substr(-5)==="rgba("||E.substr(-5)==="hsla(")&&(w=1),x!==(_=g[d++]||"")&&(v=parseFloat(_)||0,R=_.substr((v+"").length),x.charAt(1)==="="&&(x=Cu(v,x)+R),b=parseFloat(x),C=x.substr((b+"").length),u=yu.lastIndex-C.length,C||(C=C||xs.units[n]||R,u===s.length&&(s+=C,l.e+=C)),R!==C&&(v=Ka(e,n,_,C)||0),l._pt={_next:l._pt,p:E||d===1?E:",",s:v,c:b-v,m:w&&w<4||n==="zIndex"?Math.round:0});l.c=u<s.length?s.substring(u,s.length):""}else l.r=n==="display"&&s==="none"?_9:y9;return $O.test(s)&&(l.e=0),this._pt=l,l},L3={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},Jte=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]=L3[r]||r,n[1]=L3[s]||s,n.join(" ")},ene=function(e,n){if(n.tween&&n.tween._time===n.tween._dur){var r=n.t,s=r.style,i=n.u,o=r._gsap,l,u,d;if(i==="all"||i===!0)s.cssText="",u=1;else for(i=i.split(","),d=i.length;--d>-1;)l=i[d],Fo[l]&&(u=1,l=l==="transformOrigin"?es:Sn),Ga(r,l);u&&(Ga(r,Sn),o&&(o.svg&&r.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",Th(r,1),o.uncache=1,w9(s)))}},mg={clearProps:function(e,n,r,s,i){if(i.data!=="isFromStart"){var o=e._pt=new Jr(e._pt,n,r,0,0,ene);return o.u=s,o.pr=-10,o.tween=i,e._props.push(r),1}}},Ah=[1,0,0,1,0,0],E9={},C9=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},N3=function(e){var n=ys(e,Sn);return C9(n)?Ah:n.substr(7).match(DO).map(Tn)},qb=function(e,n){var r=e._gsap||rc(e),s=e.style,i=N3(e),o,l,u,d;return r.svg&&e.getAttribute("transform")?(u=e.transform.baseVal.consolidate().matrix,i=[u.a,u.b,u.c,u.d,u.e,u.f],i.join(",")==="1,0,0,1,0,0"?Ah:i):(i===Ah&&!e.offsetParent&&e!==Pu&&!r.svg&&(u=s.display,s.display="block",o=e.parentNode,(!o||!e.offsetParent&&!e.getBoundingClientRect().width)&&(d=1,l=e.nextElementSibling,Pu.appendChild(e)),i=N3(e),u?s.display=u:Ga(e,"display"),d&&(l?o.insertBefore(e,l):o?o.appendChild(e):Pu.removeChild(e))),n&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},Tw=function(e,n,r,s,i,o){var l=e._gsap,u=i||qb(e,!0),d=l.xOrigin||0,f=l.yOrigin||0,p=l.xOffset||0,g=l.yOffset||0,v=u[0],w=u[1],_=u[2],x=u[3],b=u[4],E=u[5],C=n.split(" "),R=parseFloat(C[0])||0,A=parseFloat(C[1])||0,I,M,T,L;r?u!==Ah&&(M=v*x-w*_)&&(T=R*(x/M)+A*(-_/M)+(_*E-x*b)/M,L=R*(-w/M)+A*(v/M)-(v*E-w*b)/M,R=T,A=L):(I=S9(e),R=I.x+(~C[0].indexOf("%")?R/100*I.width:R),A=I.y+(~(C[1]||C[0]).indexOf("%")?A/100*I.height:A)),s||s!==!1&&l.smooth?(b=R-d,E=A-f,l.xOffset=p+(b*v+E*_)-b,l.yOffset=g+(b*w+E*x)-E):l.xOffset=l.yOffset=0,l.xOrigin=R,l.yOrigin=A,l.smooth=!!s,l.origin=n,l.originIsAbsolute=!!r,e.style[es]="0px 0px",o&&(Ma(o,l,"xOrigin",d,R),Ma(o,l,"yOrigin",f,A),Ma(o,l,"xOffset",p,l.xOffset),Ma(o,l,"yOffset",g,l.yOffset)),e.setAttribute("data-svg-origin",R+" "+A)},Th=function(e,n){var r=e._gsap||new c9(e);if("x"in r&&!n&&!r.uncache)return r;var s=e.style,i=r.scaleX<0,o="px",l="deg",u=getComputedStyle(e),d=ys(e,es)||"0",f,p,g,v,w,_,x,b,E,C,R,A,I,M,T,L,D,j,H,Y,U,z,Z,Q,B,ee,W,N,X,oe,re,se;return f=p=g=_=x=b=E=C=R=0,v=w=1,r.svg=!!(e.getCTM&&k9(e)),u.translate&&((u.translate!=="none"||u.scale!=="none"||u.rotate!=="none")&&(s[Sn]=(u.translate!=="none"?"translate3d("+(u.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(u.rotate!=="none"?"rotate("+u.rotate+") ":"")+(u.scale!=="none"?"scale("+u.scale.split(" ").join(",")+") ":"")+(u[Sn]!=="none"?u[Sn]:"")),s.scale=s.rotate=s.translate="none"),M=qb(e,r.svg),r.svg&&(r.uncache?(B=e.getBBox(),d=r.xOrigin-B.x+"px "+(r.yOrigin-B.y)+"px",Q=""):Q=!n&&e.getAttribute("data-svg-origin"),Tw(e,Q||d,!!Q||r.originIsAbsolute,r.smooth!==!1,M)),A=r.xOrigin||0,I=r.yOrigin||0,M!==Ah&&(j=M[0],H=M[1],Y=M[2],U=M[3],f=z=M[4],p=Z=M[5],M.length===6?(v=Math.sqrt(j*j+H*H),w=Math.sqrt(U*U+Y*Y),_=j||H?ou(H,j)*jl:0,E=Y||U?ou(Y,U)*jl+_:0,E&&(w*=Math.abs(Math.cos(E*Ru))),r.svg&&(f-=A-(A*j+I*Y),p-=I-(A*H+I*U))):(se=M[6],oe=M[7],W=M[8],N=M[9],X=M[10],re=M[11],f=M[12],p=M[13],g=M[14],T=ou(se,X),x=T*jl,T&&(L=Math.cos(-T),D=Math.sin(-T),Q=z*L+W*D,B=Z*L+N*D,ee=se*L+X*D,W=z*-D+W*L,N=Z*-D+N*L,X=se*-D+X*L,re=oe*-D+re*L,z=Q,Z=B,se=ee),T=ou(-Y,X),b=T*jl,T&&(L=Math.cos(-T),D=Math.sin(-T),Q=j*L-W*D,B=H*L-N*D,ee=Y*L-X*D,re=U*D+re*L,j=Q,H=B,Y=ee),T=ou(H,j),_=T*jl,T&&(L=Math.cos(T),D=Math.sin(T),Q=j*L+H*D,B=z*L+Z*D,H=H*L-j*D,Z=Z*L-z*D,j=Q,z=B),x&&Math.abs(x)+Math.abs(_)>359.9&&(x=_=0,b=180-b),v=Tn(Math.sqrt(j*j+H*H+Y*Y)),w=Tn(Math.sqrt(Z*Z+se*se)),T=ou(z,Z),E=Math.abs(T)>2e-4?T*jl:0,R=re?1/(re<0?-re:re):0),r.svg&&(Q=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!C9(ys(e,Sn)),Q&&e.setAttribute("transform",Q))),Math.abs(E)>90&&Math.abs(E)<270&&(i?(v*=-1,E+=_<=0?180:-180,_+=_<=0?180:-180):(w*=-1,E+=E<=0?180:-180)),n=n||r.uncache,r.x=f-((r.xPercent=f&&(!n&&r.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-f)?-50:0)))?e.offsetWidth*r.xPercent/100:0)+o,r.y=p-((r.yPercent=p&&(!n&&r.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-p)?-50:0)))?e.offsetHeight*r.yPercent/100:0)+o,r.z=g+o,r.scaleX=Tn(v),r.scaleY=Tn(w),r.rotation=Tn(_)+l,r.rotationX=Tn(x)+l,r.rotationY=Tn(b)+l,r.skewX=E+l,r.skewY=C+l,r.transformPerspective=R+o,(r.zOrigin=parseFloat(d.split(" ")[2])||!n&&r.zOrigin||0)&&(s[es]=gg(d)),r.xOffset=r.yOffset=0,r.force3D=xs.force3D,r.renderTransform=r.svg?nne:b9?P9:tne,r.uncache=0,r},gg=function(e){return(e=e.split(" "))[0]+" "+e[1]},d_=function(e,n,r){var s=br(n);return Tn(parseFloat(n)+parseFloat(Ka(e,"x",r+"px",s)))+s},tne=function(e,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,P9(e,n)},Il="0deg",mf="0px",Ml=") ",P9=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,o=r.x,l=r.y,u=r.z,d=r.rotation,f=r.rotationY,p=r.rotationX,g=r.skewX,v=r.skewY,w=r.scaleX,_=r.scaleY,x=r.transformPerspective,b=r.force3D,E=r.target,C=r.zOrigin,R="",A=b==="auto"&&e&&e!==1||b===!0;if(C&&(p!==Il||f!==Il)){var I=parseFloat(f)*Ru,M=Math.sin(I),T=Math.cos(I),L;I=parseFloat(p)*Ru,L=Math.cos(I),o=d_(E,o,M*L*-C),l=d_(E,l,-Math.sin(I)*-C),u=d_(E,u,T*L*-C+C)}x!==mf&&(R+="perspective("+x+Ml),(s||i)&&(R+="translate("+s+"%, "+i+"%) "),(A||o!==mf||l!==mf||u!==mf)&&(R+=u!==mf||A?"translate3d("+o+", "+l+", "+u+") ":"translate("+o+", "+l+Ml),d!==Il&&(R+="rotate("+d+Ml),f!==Il&&(R+="rotateY("+f+Ml),p!==Il&&(R+="rotateX("+p+Ml),(g!==Il||v!==Il)&&(R+="skew("+g+", "+v+Ml),(w!==1||_!==1)&&(R+="scale("+w+", "+_+Ml),E.style[Sn]=R||"translate(0, 0)"},nne=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,o=r.x,l=r.y,u=r.rotation,d=r.skewX,f=r.skewY,p=r.scaleX,g=r.scaleY,v=r.target,w=r.xOrigin,_=r.yOrigin,x=r.xOffset,b=r.yOffset,E=r.forceCSS,C=parseFloat(o),R=parseFloat(l),A,I,M,T,L;u=parseFloat(u),d=parseFloat(d),f=parseFloat(f),f&&(f=parseFloat(f),d+=f,u+=f),u||d?(u*=Ru,d*=Ru,A=Math.cos(u)*p,I=Math.sin(u)*p,M=Math.sin(u-d)*-g,T=Math.cos(u-d)*g,d&&(f*=Ru,L=Math.tan(d-f),L=Math.sqrt(1+L*L),M*=L,T*=L,f&&(L=Math.tan(f),L=Math.sqrt(1+L*L),A*=L,I*=L)),A=Tn(A),I=Tn(I),M=Tn(M),T=Tn(T)):(A=p,T=g,I=M=0),(C&&!~(o+"").indexOf("px")||R&&!~(l+"").indexOf("px"))&&(C=Ka(v,"x",o,"px"),R=Ka(v,"y",l,"px")),(w||_||x||b)&&(C=Tn(C+w-(w*A+_*M)+x),R=Tn(R+_-(w*I+_*T)+b)),(s||i)&&(L=v.getBBox(),C=Tn(C+s/100*L.width),R=Tn(R+i/100*L.height)),L="matrix("+A+","+I+","+M+","+T+","+C+","+R+")",v.setAttribute("transform",L),E&&(v.style[Sn]=L)},rne=function(e,n,r,s,i){var o=360,l=ir(i),u=parseFloat(i)*(l&&~i.indexOf("rad")?jl:1),d=u-s,f=s+d+"deg",p,g;return l&&(p=i.split("_")[1],p==="short"&&(d%=o,d!==d%(o/2)&&(d+=d<0?o:-o)),p==="cw"&&d<0?d=(d+o*A3)%o-~~(d/o)*o:p==="ccw"&&d>0&&(d=(d-o*A3)%o-~~(d/o)*o)),e._pt=g=new Jr(e._pt,n,r,s,d,Fte),g.e=f,g.u="deg",e._props.push(r),g},D3=function(e,n){for(var r in n)e[r]=n[r];return e},sne=function(e,n,r){var s=D3({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",o=r.style,l,u,d,f,p,g,v,w;s.svg?(d=r.getAttribute("transform"),r.setAttribute("transform",""),o[Sn]=n,l=Th(r,1),Ga(r,Sn),r.setAttribute("transform",d)):(d=getComputedStyle(r)[Sn],o[Sn]=n,l=Th(r,1),o[Sn]=d);for(u in Fo)d=s[u],f=l[u],d!==f&&i.indexOf(u)<0&&(v=br(d),w=br(f),p=v!==w?Ka(r,u,d,w):parseFloat(d),g=parseFloat(f),e._pt=new Jr(e._pt,l,u,p,g-p,Pw),e._pt.u=w||0,e._props.push(u));D3(l,s)};Qr("padding,margin,Width,Radius",function(t,e){var n="Top",r="Right",s="Bottom",i="Left",o=(e<3?[n,r,s,i]:[n+i,n+r,s+r,s+i]).map(function(l){return e<2?t+l:"border"+l+t});mg[e>1?"border"+t:t]=function(l,u,d,f,p){var g,v;if(arguments.length<4)return g=o.map(function(w){return xo(l,w,d)}),v=g.join(" "),v.split(g[0]).length===5?g[0]:v;g=(f+"").split(" "),v={},o.forEach(function(w,_){return v[w]=g[_]=g[_]||g[(_-1)/2|0]}),l.init(u,v,p)}});var R9={name:"css",register:Aw,targetTest:function(e){return e.style&&e.nodeType},init:function(e,n,r,s,i){var o=this._props,l=e.style,u=r.vars.startAt,d,f,p,g,v,w,_,x,b,E,C,R,A,I,M,T,L;Ub||Aw(),this.styles=this.styles||x9(e),T=this.styles.props,this.tween=r;for(_ in n)if(_!=="autoRound"&&(f=n[_],!(ps[_]&&u9(_,n,r,s,e,i)))){if(v=typeof f,w=mg[_],v==="function"&&(f=f.call(r,s,e,i),v=typeof f),v==="string"&&~f.indexOf("random(")&&(f=Ch(f)),w)w(this,e,_,f,r)&&(M=1);else if(_.substr(0,2)==="--")d=(getComputedStyle(e).getPropertyValue(_)+"").trim(),f+="",ja.lastIndex=0,ja.test(d)||(x=br(d),b=br(f),b?x!==b&&(d=Ka(e,_,d,b)+b):x&&(f+=x)),this.add(l,"setProperty",d,f,s,i,0,0,_),o.push(_),T.push(_,0,l[_]);else if(v!=="undefined"){if(u&&_ in u?(d=typeof u[_]=="function"?u[_].call(r,s,e,i):u[_],ir(d)&&~d.indexOf("random(")&&(d=Ch(d)),br(d+"")||d==="auto"||(d+=xs.units[_]||br(xo(e,_))||""),(d+"").charAt(1)==="="&&(d=xo(e,_))):d=xo(e,_),g=parseFloat(d),E=v==="string"&&f.charAt(1)==="="&&f.substr(0,2),E&&(f=f.substr(2)),p=parseFloat(f),_ in Vi&&(_==="autoAlpha"&&(g===1&&xo(e,"visibility")==="hidden"&&p&&(g=0),T.push("visibility",0,l.visibility),Ma(this,l,"visibility",g?"inherit":"hidden",p?"inherit":"hidden",!p)),_!=="scale"&&_!=="transform"&&(_=Vi[_],~_.indexOf(",")&&(_=_.split(",")[0]))),C=_ in Fo,C){if(this.styles.save(_),L=f,v==="string"&&f.substring(0,6)==="var(--"){if(f=ys(e,f.substring(4,f.indexOf(")"))),f.substring(0,5)==="calc("){var D=e.style.perspective;e.style.perspective=f,f=ys(e,"perspective"),D?e.style.perspective=D:Ga(e,"perspective")}p=parseFloat(f)}if(R||(A=e._gsap,A.renderTransform&&!n.parseTransform||Th(e,n.parseTransform),I=n.smoothOrigin!==!1&&A.smooth,R=this._pt=new Jr(this._pt,l,Sn,0,1,A.renderTransform,A,0,-1),R.dep=1),_==="scale")this._pt=new Jr(this._pt,A,"scaleY",A.scaleY,(E?Cu(A.scaleY,E+p):p)-A.scaleY||0,Pw),this._pt.u=0,o.push("scaleY",_),_+="X";else if(_==="transformOrigin"){T.push(es,0,l[es]),f=Jte(f),A.svg?Tw(e,f,0,I,0,this):(b=parseFloat(f.split(" ")[2])||0,b!==A.zOrigin&&Ma(this,A,"zOrigin",A.zOrigin,b),Ma(this,l,_,gg(d),gg(f)));continue}else if(_==="svgOrigin"){Tw(e,f,1,I,0,this);continue}else if(_ in E9){rne(this,A,_,g,E?Cu(g,E+f):f);continue}else if(_==="smoothOrigin"){Ma(this,A,"smooth",A.smooth,f);continue}else if(_==="force3D"){A[_]=f;continue}else if(_==="transform"){sne(this,f,e);continue}}else _ in l||(_=ad(_)||_);if(C||(p||p===0)&&(g||g===0)&&!jte.test(f)&&_ in l)x=(d+"").substr((g+"").length),p||(p=0),b=br(f)||(_ in xs.units?xs.units[_]:x),x!==b&&(g=Ka(e,_,d,b)),this._pt=new Jr(this._pt,C?A:l,_,g,(E?Cu(g,E+p):p)-g,!C&&(b==="px"||_==="zIndex")&&n.autoRound!==!1?zte:Pw),this._pt.u=b||0,C&&L!==f?(this._pt.b=d,this._pt.e=L,this._pt.r=Hte):x!==b&&b!=="%"&&(this._pt.b=d,this._pt.r=Vte);else if(_ in l)Qte.call(this,e,_,d,E?E+f:f);else if(_ in e)this.add(e,_,d||e[_],E?E+f:f,s,i);else if(_!=="parseTransform"){Lb(_,f);continue}C||(_ in l?T.push(_,0,l[_]):typeof e[_]=="function"?T.push(_,2,e[_]()):T.push(_,1,d||e[_])),o.push(_)}}M&&g9(this)},render:function(e,n){if(n.tween._time||!Zb())for(var r=n._pt;r;)r.r(e,r.d),r=r._next;else n.styles.revert()},get:xo,aliases:Vi,getSetter:function(e,n,r){var s=Vi[n];return s&&s.indexOf(",")<0&&(n=s),n in Fo&&n!==es&&(e._gsap.x||xo(e,"x"))?r&&R3===r?n==="scale"?Wte:Zte:(R3=r||{})&&(n==="scale"?qte:Gte):e.style&&!Ib(e.style[n])?Bte:~n.indexOf("-")?Ute:zb(e,n)},core:{_removeProperty:Ga,_getMatrix:qb}};ts.utils.checkPrefix=ad;ts.core.getStyleSaver=x9;(function(t,e,n,r){var s=Qr(t+","+e+","+n,function(i){Fo[i]=1});Qr(e,function(i){xs.units[i]="deg",E9[i]=1}),Vi[s[13]]=t+","+e,Qr(r,function(i){var o=i.split(":");Vi[o[1]]=s[o[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");Qr("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){xs.units[t]="px"});ts.registerPlugin(R9);var li=ts.registerPlugin(R9)||ts;li.core.Tween;const fm="/assets/logo-animation",f_=1280,ine=[{id:"eraser",src:`${fm}/eraser.png`,cssW:189,cssH:74,rot:-90,fit:337,localX:60,localY:168,seaX:.2,seaY:.27,seaRot:-8},{id:"clasp",src:`${fm}/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:`${fm}/playdough.png`,cssW:236,cssH:206,rot:5,fit:150,localX:182,localY:277,seaX:.52,seaY:.79,seaRot:6}],one=[{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}],Iw=({className:t})=>{const e=m.useRef(null),n=m.useRef(null),r=m.useRef(null);return m.useEffect(()=>{const s=e.current,i=n.current,o=r.current;if(!s||!i||!o)return;const l=window.matchMedia("(prefers-reduced-motion: reduce)").matches,u=(b,E)=>b+Math.random()*(E-b);let d=null,f,p=1;const g=ine.map(b=>({...b})),v=()=>{s.querySelectorAll(".la-obj").forEach(T=>T.remove());const b=s.getBoundingClientRect(),E=b.width||f_,C=b.height||f_*.64;p=E/f_,i.style.width=`${242*p}px`,i.style.height=`${250*p}px`;const A=250*p/337,I=[],M=(T,L,D)=>{const j=document.createElement("div");return j.className="la-obj",j.style.width=`${L}px`,j.innerHTML=`<img src="${T}" alt="" style="${D?"transform:scaleX(-1)":""}">`,s.appendChild(j),j};return one.forEach((T,L)=>{const D=T.w*p,j=M(`${fm}/sea/${T.k}.png`,D,L%2===0);li.set(j,{x:T.x*E-D/2,y:T.y*C-D/2,rotation:T.r,opacity:1,scale:0,transformOrigin:"50% 50%"}),I.push({el:j,hero:!1,rest:1})}),g.forEach(T=>{const L=T.cssW*p;T.el=M(T.src,L,!!T.flip),T.finalScale=T.fit*A/(T.cssW*p),li.set(T.el,{x:T.seaX*E-L/2,y:T.seaY*C-T.cssH*p/2,rotation:T.seaRot,opacity:1,scale:0,transformOrigin:"50% 50%",zIndex:30}),I.push({el:T.el,hero:!0,rest:150/T.cssW})}),I},w=(b,E)=>{const C=s.getBoundingClientRect(),R=o.getBoundingClientRect();return{x:R.left-C.left+b/326*R.width,y:R.top-C.top+E/337*R.height}},_=()=>{d&&d.revert();const b=v();if(l){d=li.context(()=>{b.filter(R=>!R.hero).forEach(R=>li.set(R.el,{scale:0})),g.forEach(R=>{if(!R.el)return;const A=w(R.localX,R.localY);li.set(R.el,{x:A.x-R.cssW*p/2,y:A.y-R.cssH*p/2,rotation:R.rot,scale:R.finalScale})})},s);return}const E=[],C=[];d=li.context(()=>{const R=li.timeline();R.to(b.map(A=>A.el),{scale:A=>b[A].rest,duration:.5,ease:"steps(4)",stagger:{each:.045,from:"random"}}),R.add(()=>{b.forEach(({el:A,hero:I},M)=>{const T=I?E:C,L=M%2?1:-1;T.push(li.to(A,{rotation:"+="+u(2.5,6)*L,duration:u(.5,.9),repeat:-1,yoyo:!0,ease:"steps(2)",delay:u(0,.4)}),li.to(A,{y:"+="+u(5,11)*L,x:"+="+u(4,9)*-L,duration:u(.7,1.2),repeat:-1,yoyo:!0,ease:"steps(3)",delay:u(0,.4)}))})},"<0.1"),R.to({},{duration:1.1}),R.add("pick"),g.forEach((A,I)=>{A.el&&R.to(A.el,{scale:150/A.cssW*1.2,duration:.28,ease:"steps(3)",yoyo:!0,repeat:1},"pick+="+I*.08)}),R.add("clear","pick+=0.7"),R.add(()=>C.forEach(A=>A.kill()),"clear"),R.to(b.filter(A=>!A.hero).map(A=>A.el),{scale:0,rotation:"+=40",duration:.5,ease:"steps(5)",overwrite:"auto",stagger:{each:.025,from:"random"}},"clear"),R.add("assemble","clear+=0.25"),R.add(()=>E.forEach(A=>A.kill()),"assemble"),g.forEach((A,I)=>{if(!A.el||A.finalScale===void 0)return;const M=w(A.localX,A.localY);R.to(A.el,{x:M.x-A.cssW*p/2,y:M.y-A.cssH*p/2,rotation:A.rot,scale:A.finalScale,duration:1.05,ease:"steps(9)",overwrite:"auto"},"assemble+="+I*.12)}),g.forEach(A=>{!A.el||A.finalScale===void 0||R.to(A.el,{scale:A.finalScale*1.03,duration:.16,ease:"steps(2)",yoyo:!0,repeat:1},"assemble+=1.45")})},s)};li.ticker.fps(12),_();const x=()=>{clearTimeout(f),f=setTimeout(_,250)};return window.addEventListener("resize",x),()=>{window.removeEventListener("resize",x),clearTimeout(f),d==null||d.revert(),s.querySelectorAll(".la-obj").forEach(b=>b.remove())}},[]),S.jsx("div",{ref:e,className:`la-scene ${t??""}`,children:S.jsx("div",{ref:n,className:"la-logo-stage",children:S.jsx("svg",{ref:r,className:"la-mark",viewBox:"0 0 326 337","aria-hidden":"true"})})})},ane=Object.freeze(Object.defineProperty({__proto__:null,default:Iw},Symbol.toStringTag,{value:"Module"})),$3=({isSigningIn:t})=>t?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-current border-t-transparent"}),S.jsx("span",{children:"Signing in..."})]}):S.jsxs(S.Fragment,{children:[S.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"Google",className:"h-5 w-5"}),S.jsx("span",{children:"Sign in with Google"})]}),lne=({isSigningIn:t,onStartSignIn:e,errorMessage:n=null,displayMode:r="full"})=>r==="modal"?S.jsxs("div",{className:"glass-panel relative w-full max-w-sm overflow-hidden rounded-2xl border border-white/10 font-main text-white shadow-2xl",children:[S.jsx(Iw,{className:"relative z-0 h-44 w-full"}),S.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-6 px-8 pb-12 pt-8",children:[S.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[S.jsx("h1",{className:"text-xl font-medium text-content",children:"Welcome to Rivet"}),S.jsx("p",{className:"text-sm leading-relaxed text-content-muted",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),S.jsx("button",{onClick:e,disabled:t,className:"glass-panel active-push flex cursor-pointer items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium transition-colors hover:bg-main-hover disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx($3,{isSigningIn:t})}),n?S.jsx("p",{className:"text-center text-xs text-red-200",children:n}):null]})]}):S.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-white font-main text-[#18181b]",children:[S.jsx(Iw,{className:"absolute inset-0 z-0"}),S.jsxs("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 flex flex-col items-center gap-5 pb-[14vh]",children:[S.jsxs("div",{className:"flex flex-col items-center gap-2 px-6 text-center",children:[S.jsx("h1",{className:"text-xl font-medium tracking-tight text-[#18181b]",children:"Welcome to Rivet"}),S.jsx("p",{className:"max-w-md text-sm leading-relaxed text-[#71717a]",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),S.jsx("button",{onClick:e,disabled:t,className:"active-push pointer-events-auto flex cursor-pointer items-center gap-3 rounded-full border border-black/10 bg-white px-8 py-3.5 text-sm font-medium text-[#18181b] shadow-[0_8px_24px_rgba(40,33,28,0.14)] transition-colors hover:bg-[#faf9f7] disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx($3,{isSigningIn:t})}),n?S.jsx("p",{className:"text-center text-xs text-red-500",children:n}):null]})]}),cne="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",une=({message:t})=>S.jsx("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-[#1c1c20] font-main text-white",children:S.jsxs("div",{className:"flex flex-col items-center gap-10",children:[S.jsx("img",{src:cne,alt:"Rivet",className:"h-8 w-auto object-contain"}),S.jsxs("div",{className:"glass-panel flex items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium",children:[S.jsx(Mg,{className:"h-5 w-5 shrink-0 animate-spin text-primary",weight:"bold"}),S.jsx("span",{children:t})]})]})}),dne="data:image/svg+xml,%3csvg%20width='128'%20height='128'%20viewBox='0%200%20128%20128'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M70.5245%206.60961C66.8741%202.95923%2060.9556%202.95922%2057.3053%206.60961L8.61753%2055.2973C4.96715%2058.9477%204.96714%2064.8662%208.61752%2068.5166L26.3518%2086.2508C30.0022%2089.9012%2035.9206%2089.9012%2039.571%2086.2508L92.033%2033.7889C93.5989%2032.2229%2093.5989%2029.684%2092.033%2028.1181L70.5245%206.60961Z'%20fill='%23EC4423'%20fill-opacity='0.8'/%3e%3cpath%20d='M119.208%2068.5159C122.858%2064.8655%20122.858%2058.947%20119.208%2055.2966L70.5199%206.60891C66.8695%202.95853%2060.951%202.95851%2057.3007%206.6089L32.8391%2031.0705L88.1364%2086.3678C91.7868%2090.0182%2097.7053%2090.0182%20101.356%2086.3678L119.208%2068.5159Z'%20fill='%23EC4423'%20fill-opacity='0.8'/%3e%3cpath%20d='M64.0164%2077.3398L44.0436%2097.3127C41.1057%20100.251%2041.1057%20105.014%2044.0436%20107.952L58.5067%20122.415C61.4446%20125.353%2066.2079%20125.353%2069.1458%20122.415L83.7991%20107.762C86.737%20104.824%2086.737%20100.06%2083.7991%2097.1225L64.0164%2077.3398Z'%20fill='%23EC4423'%20fill-opacity='0.8'/%3e%3c/svg%3e",vg=44,gf=8,$0=16,fne=4,j3=-18,hne=.18,pne=[.22,1,.36,1],F3=.92,mne=1,gne=.95,vne=.4,yne=[.19,1,.22,1],h_=0,_ne=1,wne=0,xne=0,bne=0,A9=({position:t,viewport:e,boundsLeft:n=0})=>{const r=n+gf,s=Math.max(r,e.width-vg-gf),i=Math.max(gf,e.height-vg-gf);return{x:Math.min(s,Math.max(r,t.x)),y:Math.min(i,Math.max(gf,t.y))}},Gb=()=>({width:window.innerWidth,height:window.innerHeight}),Sne=({position:t,boundsLeftPx:e=0})=>A9({position:t,viewport:Gb(),boundsLeft:e}),kne=()=>{if(typeof window>"u")return{x:$0,y:$0};const t=Gb();return{x:t.width-vg-$0,y:t.height-vg-$0}},Ene=({deltaX:t,deltaY:e})=>Math.hypot(t,e)>=fne,Cne=t=>t.button===void 0||t.button<=bne,V3=t=>{const e=t.nativeEvent;return{x:Number.isFinite(t.clientX)?t.clientX:e.clientX,y:Number.isFinite(t.clientY)?t.clientY:e.clientY}},Pne=({isVisible:t,isPanelOpen:e,isReducedMotion:n,position:r,dragBoundsLeftPx:s=0,onToggle:i,onPositionChange:o})=>{const l=m.useRef(null),u=m.useRef(!1),[d,f]=m.useState(!1),[p,g]=m.useState(!1),v=n?!1:{opacity:h_,scale:F3,x:j3},w=n?{opacity:h_}:{opacity:h_,scale:F3,x:j3},_=n?{duration:xne}:{duration:hne,ease:pne,scale:{duration:vne,ease:yne}},x=m.useCallback(()=>{const A=l.current;A&&(u.current=A.hasMoved),l.current=null,f(!1)},[]),b=m.useCallback(A=>{const I=l.current;if(!I)return;const M=V3(A),T=M.x-I.startPointer.x,L=M.y-I.startPointer.y,D=I.hasMoved||Ene({deltaX:T,deltaY:L});l.current={...I,hasMoved:D},D&&o(A9({position:{x:I.startPosition.x+T,y:I.startPosition.y+L},viewport:Gb(),boundsLeft:s}))},[o,s]),E=m.useCallback(A=>{if(l.current||!Cne(A))return;const I=V3(A);l.current={startPointer:I,startPosition:r,hasMoved:!1},f(!0)},[r]),C=m.useCallback(()=>{if(u.current){u.current=!1;return}i()},[i]),R=e?"Close panel":"Open panel";return S.jsxs(S.Fragment,{children:[d?S.jsx("div",{className:"fixed inset-0 z-40 cursor-grabbing","data-cy":"rivet-panel-launcher-drag-surface",onPointerMove:b,onPointerUp:x,onPointerCancel:x,onMouseMove:b,onMouseUp:x}):null,S.jsx(ws,{children:t?S.jsx(fc,{label:R,side:"top",forceOpen:p&&!d?void 0:!1,children:S.jsx(gi.button,{type:"button","aria-label":R,"data-cy":"reopen-panel",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),initial:v,animate:{opacity:_ne,scale:mne,x:wne},whileTap:{scale:gne},exit:w,transition:_,onPointerDown:E,onMouseDown:E,onPointerMove:b,onPointerUp:x,onPointerCancel:x,onMouseMove:b,onMouseUp:x,onClick:C,className:`bg-main absolute z-50 flex h-11 w-11 touch-none select-none items-center justify-center overflow-hidden rounded-full border border-white/10 shadow-[0_2px_8px_rgba(0,0,0,0.2),0_4px_16px_rgba(0,0,0,0.1)] transition-[background-color,box-shadow] duration-150 hover:bg-[#2a2a2a] focus:outline-none focus-visible:ring-2 focus-visible:ring-white/75 ${d?"cursor-grabbing shadow-[0_4px_12px_rgba(0,0,0,0.28),0_10px_24px_rgba(0,0,0,0.16)]":"cursor-grab"}`,style:{left:r.x,top:r.y,willChange:"left, top, transform"},children:S.jsx("img",{src:dne,alt:"","aria-hidden":"true",draggable:!1,className:"h-4 w-4 brightness-0 invert"})})}):null})]})},p_=Cs("useConfig"),Rne=300*1e3,Ane=1800*1e3,Tne=60*1e3,Ine=300*1e3,Mne=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.queueAccessToken)??null},One=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},Lne=t=>({...JM,...t??{}}),Nne=()=>{const t=ct(dw),e=mt(dw),n=mt(aO),r=mt(lO),s=mt(Bg),i=mt(qQ),o=mt(ZQ),l=mt(UQ),u=mt(zg),d=mt(FQ),f=m.useCallback(b=>{o(b.agentModeAvailable),d({name:b.name??null,email:b.email??null}),b.isMCPSession&&n(!0),b.mcpEditor&&r(b.mcpEditor),s(b.agentApplyMode??One()??null),i(b.queueAccessToken??Mne())},[s,o,n,r,i,d]),p=vm({queryKey:["rivet-config"],queryFn:async()=>{const b=await fetch("/api/config");if(!b.ok)throw new Error(`Failed to fetch config: ${b.statusText}`);return await b.json()},staleTime:Rne,gcTime:Ane}),g=vm({queryKey:["rivet-feature-flags"],queryFn:async()=>{const b=await fetch("/api/feature-flags");if(!b.ok)throw new Error(`Failed to fetch feature flags: ${b.statusText}`);return await b.json()},staleTime:Tne,gcTime:Ine}),{refetch:v}=p,{refetch:w}=g;m.useLayoutEffect(()=>{p.data&&(f(p.data),u(!1),p_.info("Config loaded:",p.data)),g.data&&(e(Lne(g.data.featureFlags)),l(!0))},[p.data,g.data,f,u,e,l]),m.useLayoutEffect(()=>{p.error&&(l(!0),u(!1),p_.warn("Failed to load config:",p.error instanceof Error?p.error.message:"Failed to load config")),g.error&&(l(!0),p_.warn("Failed to load feature flags:",g.error instanceof Error?g.error.message:"Failed to load feature flags"))},[p.error,g.error,u,l]);const _=m.useCallback(async()=>{const[b]=await Promise.all([v(),w()]);return b.data?b.data:null},[v,w]);let x=null;return p.error instanceof Error?x=p.error.message:p.error&&(x="Failed to load config"),{config:p.data??null,featureFlags:t,loading:p.isPending||!p.error&&g.isPending,error:x,refetchConfig:_}},au=Cs("useOAuthCallback"),Dne="https://rivet-proxy.onrender.com",$ne=()=>{const[t,e]=m.useState({isProcessing:!1,isComplete:!1,error:null});return m.useEffect(()=>{const n=new AbortController;let r=!1;return(async()=>{var l,u,d;const i=window.location.hash,o=window.location.search;if(!(!i||!i.includes("access_token"))&&!r){e({isProcessing:!0,isComplete:!1,error:null});try{au.info("Processing OAuth callback...");const f=new URLSearchParams(i.substring(1)),p=f.get("access_token"),g=f.get("refresh_token"),w=new URLSearchParams(o).get("session");if(!p)throw new Error("No access token found in URL");if(!w)throw new Error("No session ID found in URL");au.info(`Completing OAuth with session: ${w}`);const _=await fetch(`${Dne}/api/auth/google/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:w,accessToken:p,refreshToken:g}),signal:n.signal}),x=await _.json();if(!_.ok||!x.success)throw new Error(x.error||x.message||"Failed to complete authentication");if(au.info("OAuth authentication completed successfully"),r)return;if((l=x.user)!=null&&l.id?(Ce.identify(x.user.id,{...x.user.email?{email:x.user.email}:{}}),x.user.email&&Ce.alias(x.user.email,x.user.id)):(u=x.user)!=null&&u.email&&Ce.identify(x.user.email,{email:x.user.email}),(d=x.user)!=null&&d.email&&p)try{const E=await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:x.user.email,token:p,refreshToken:g,userId:x.user.id}),signal:n.signal});E.ok||au.warn(`Local auth store returned ${E.status}`)}catch(E){if(r)return;au.warn("Failed to store auth locally:",E)}if(r)return;window.sessionStorage.setItem(cg,"1");const b=window.location.pathname;window.history.replaceState({},document.title,b),e({isProcessing:!1,isComplete:!0,error:null})}catch(f){if(r)return;const p=f instanceof Error?f.message:"Unknown error occurred";au.warn("OAuth callback error:",f),e({isProcessing:!1,isComplete:!1,error:p})}}})(),()=>{r=!0,n.abort()}},[]),t},m_=Cs("useAgentVariantsSession"),jne=t=>typeof t.pendingCount=="number"&&t.pendingCount===0&&(t.pendingVariantRequests??0)===0&&(t.leasedVariantRequests??0)===0&&(t.activeLeases??[]).length===0,H3=(t,e,n)=>{e.size===0&&!n||t.set(bh,r=>{if(r.size===0)return r;const s=new Map(r);let i=!1;for(const[o,l]of r)l.status==="sending"&&l.variantRequestId&&(e.has(l.variantRequestId)||n&&l.variantRequest!==void 0)&&(s.delete(o),i=!0);return i?s:r})},Fne=(t,e)=>{var s;if(t.size===0)return t;let n=!1;const r=new Map(t);for(const[i,o]of t){if(o.status!=="sending"||!o.awaitingSnapshotOutcome||o.variantRequest!==void 0)continue;const l=o.target;if(!l||l.kind!=="variant"||l.sessionId!==e.sessionId)continue;const u=(s=e.variants.find(d=>d.workItemId===l.variantId))==null?void 0:s.refinement;u&&(u.status==="succeeded"?(r.set(i,{...o,status:"complete",awaitingSnapshotOutcome:void 0}),n=!0):(u.status==="failed"||u.status==="cancelled")&&(r.set(i,{...o,status:"error",awaitingSnapshotOutcome:void 0}),n=!0))}return n?r:t},Vne=({enabled:t=!0}={})=>{const e=mt(Gh),n=mt(iO),r=mt(eO),s=mt(jQ),i=mt(oO),o=mt(BQ),l=Eg(),u=m.useRef(null);m.useEffect(()=>{if(n(!1),!t)return;const d=new EventSource("/api/variants/events");return d.onmessage=f=>{try{const p=JSON.parse(f.data),g=u.current;if(p.active){const _=new Set(p.variants.map(x=>x.requestId).filter(x=>!!x));i(x=>x.filter(E=>!_.has(E.requestId))),H3(l,_,!1),l.set(bh,x=>{let b=x;for(const E of p.variants){const C=E.adoptedSource;C&&(b=zQ(b,{kind:"variant",sessionId:C.sessionId,variantId:C.variantId},{kind:"variant",sessionId:p.sessionId,variantId:E.workItemId}))}return b}),l.set(bh,x=>Fne(x,p)),p.sessionId!==u.current&&(u.current=p.sessionId,r(!0),s("directions"))}else u.current=null,H3(l,new Set,jne(p));e(p),n(!0);const v=!p.active&&g!==null,w=p.active&&p.sessionId!==g;if(w&&fetch(`/api/variants/${p.sessionId}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(_=>m_.warn("failed to reset preview-port on session switch",_)),v||w){const _=new Set;if(p.active)for(const b of p.variants)_.add(wh({kind:"variant",sessionId:p.sessionId,variantId:b.workItemId}));const x=l.get($o);for(const b of[x==null?void 0:x.left,x==null?void 0:x.right])b&&_.add(wh({kind:"variant",sessionId:b.sessionId,variantId:b.variantId}));o(_)}}catch(p){m_.warn("failed to parse SSE event payload",p)}},d.onerror=f=>{m_.warn("SSE error (auto-reconnects)",f)},()=>{d.close()}},[t,e,n,r,s,i,o,l])};var Hne=Object.defineProperty,rr=(t,e)=>Hne(t,"name",{value:e,configurable:!0});function Kb(t){const e=t+"CollectionProvider",[n,r]=Gi(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=rr(_=>{const{scope:x,children:b}=_,E=m.useRef(null),C=m.useRef(new Map).current;return S.jsx(s,{scope:x,itemMap:C,collectionRef:E,children:b})},"CollectionProvider");o.displayName=e;const l=t+"CollectionSlot",u=Ua(l),d=m.forwardRef((_,x)=>{const{scope:b,children:E}=_,C=i(l,b),R=cn(x,C.collectionRef);return S.jsx(u,{ref:R,children:E})});d.displayName=l;const f=t+"CollectionItemSlot",p="data-radix-collection-item",g=Ua(f),v=m.forwardRef((_,x)=>{const{scope:b,children:E,...C}=_,R=m.useRef(null),A=cn(x,R),I=i(f,b);return m.useEffect(()=>(I.itemMap.set(R,{ref:R,...C}),()=>void I.itemMap.delete(R))),S.jsx(g,{[p]:"",ref:A,children:E})});v.displayName=f;function w(_){const x=i(t+"CollectionConsumer",_);return m.useCallback(()=>{const E=x.collectionRef.current;if(!E)return[];const C=Array.from(E.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((I,M)=>C.indexOf(I.ref.current)-C.indexOf(M.ref.current))},[x.collectionRef,x.itemMap])}return rr(w,"useCollection"),[{Provider:o,Slot:d,ItemSlot:v},w,r]}rr(Kb,"createCollection");var z3=new WeakMap,$n,hs,g_=(hs=class extends Map{constructor(n){super(n);tt(this,$n);Ae(this,$n,[...super.keys()]),z3.set(this,!0)}set(n,r){return z3.get(this)&&(this.has(n)?q(this,$n)[q(this,$n).indexOf(n)]=n:q(this,$n).push(n)),super.set(n,r),this}insert(n,r,s){const i=this.has(r),o=q(this,$n).length,l=Yb(n);let u=l>=0?l:o+l;const d=u<0||u>=o?-1:u;if(d===this.size||i&&d===this.size-1||d===-1)return this.set(r,s),this;const f=this.size+(i?0:1);l<0&&u++;const p=[...q(this,$n)];let g,v=!1;for(let w=u;w<f;w++)if(u===w){let _=p[w];p[w]===r&&(_=p[w+1]),i&&this.delete(r),g=this.get(_),this.set(r,s)}else{!v&&p[w-1]===r&&(v=!0);const _=p[v?w:w-1],x=g;g=this.get(_),this.delete(_),this.set(_,x)}return this}with(n,r,s){const i=new hs(this);return i.insert(n,r,s),i}before(n){const r=q(this,$n).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,s){const i=q(this,$n).indexOf(n);return i===-1?this:this.insert(i,r,s)}after(n){let r=q(this,$n).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=q(this,$n).indexOf(n);return i===-1?this:this.insert(i+1,r,s)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Ae(this,$n,[]),super.clear()}delete(n){const r=super.delete(n);return r&&q(this,$n).splice(q(this,$n).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=hm(q(this,$n),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=hm(q(this,$n),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return q(this,$n).indexOf(n)}keyAt(n){return hm(q(this,$n),n)}from(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return i;s++}}findIndex(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return s;s++}return-1}filter(n,r){const s=[];let i=0;for(const o of this)Reflect.apply(n,r,[o,i,this])&&s.push(o),i++;return new hs(s)}map(n,r){const s=[];let i=0;for(const o of this)s.push([o[0],Reflect.apply(n,r,[o,i,this])]),i++;return new hs(s)}reduce(...n){const[r,s]=n;let i=0,o=s??this.at(0);for(const l of this)i===0&&n.length===1?o=l:o=Reflect.apply(r,this,[o,l,i,this]),i++;return o}reduceRight(...n){const[r,s]=n;let i=s??this.at(-1);for(let o=this.size-1;o>=0;o--){const l=this.at(o);o===this.size-1&&n.length===1?i=l:i=Reflect.apply(r,this,[i,l,o,this])}return i}toSorted(n){const r=[...this.entries()].sort(n);return new hs(r)}toReversed(){const n=new hs;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 hs(r)}slice(n,r){const s=new hs;let i=this.size-1;if(n===void 0)return s;n<0&&(n=n+this.size),r!==void 0&&r>0&&(i=r-1);for(let o=n;o<=i;o++){const l=this.keyAt(o),u=this.get(l);s.set(l,u)}return s}every(n,r){let s=0;for(const i of this){if(!Reflect.apply(n,r,[i,s,this]))return!1;s++}return!0}some(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return!0;s++}return!1}},$n=new WeakMap,rr(hs,"OrderedDict"),hs);function hm(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=T9(t,e);return n===-1?void 0:t[n]}rr(hm,"at");function T9(t,e){const n=t.length,r=Yb(e),s=r>=0?r:n+r;return s<0||s>=n?-1:s}rr(T9,"toSafeIndex");function Yb(t){return t!==t||t===0?0:Math.trunc(t)}rr(Yb,"toSafeInteger");function zne(t){const e=t+"CollectionProvider",[n,r]=Gi(e),[s,i]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new g_,setItemMap:rr(()=>{},"setItemMap")}),o=rr(({state:C,...R})=>C?S.jsx(u,{...R,state:C}):S.jsx(l,{...R}),"CollectionProvider");o.displayName=e;const l=rr(C=>{const R=x();return S.jsx(u,{...C,state:R})},"CollectionInit");l.displayName=e+"Init";const u=rr(C=>{const{scope:R,children:A,state:I}=C,M=m.useRef(null),[T,L]=m.useState(null),D=cn(M,L),[j,H]=I;return m.useEffect(()=>{if(!T)return;const Y=O9(()=>{});return Y.observe(T,{childList:!0,subtree:!0}),()=>{Y.disconnect()}},[T]),S.jsx(s,{scope:R,itemMap:j,setItemMap:H,collectionRef:D,collectionRefObject:M,collectionElement:T,children:A})},"CollectionProviderImpl");u.displayName=e+"Impl";const d=t+"CollectionSlot",f=Ua(d),p=m.forwardRef((C,R)=>{const{scope:A,children:I}=C,M=i(d,A),T=cn(R,M.collectionRef);return S.jsx(f,{ref:T,children:I})});p.displayName=d;const g=t+"CollectionItemSlot",v="data-radix-collection-item",w=Ua(g),_=m.forwardRef((C,R)=>{const{scope:A,children:I,...M}=C,T=m.useRef(null),[L,D]=m.useState(null),j=cn(R,T,D),H=i(g,A),{setItemMap:Y}=H,U=m.useRef(M);I9(U.current,M)||(U.current=M);const z=U.current;return m.useEffect(()=>{const Z=z;return Y(Q=>L?Q.has(L)?Q.set(L,{...Z,element:L}).toSorted(Mw):(Q.set(L,{...Z,element:L}),Q.toSorted(Mw)):Q),()=>{Y(Q=>!L||!Q.has(L)?Q:(Q.delete(L),new g_(Q)))}},[L,z,Y]),S.jsx(w,{[v]:"",ref:j,children:I})});_.displayName=g;function x(){return m.useState(new g_)}rr(x,"useInitCollection");function b(C){const{itemMap:R}=i(t+"CollectionConsumer",C);return R}return rr(b,"useCollection"),[{Provider:o,Slot:p,ItemSlot:_},{createCollectionScope:r,useCollection:b,useInitCollection:x}]}rr(zne,"createCollection");function I9(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}rr(I9,"shallowEqual");function M9(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}rr(M9,"isElementPreceding");function Mw(t,e){return!t[1].element||!e[1].element?0:M9(t[1].element,e[1].element)?-1:1}rr(Mw,"sortByDocumentPosition");function O9(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}rr(O9,"getChildListObserver");var Bne=Object.defineProperty,Yh=(t,e)=>Bne(t,"name",{value:e,configurable:!0}),Xb="Collapsible",[Une,L9]=Gi(Xb),[Zne,Qb]=Une(Xb),Wne=m.forwardRef(Yh(function(e,n){const{__scopeCollapsible:r,open:s,defaultOpen:i,disabled:o,onOpenChange:l,...u}=e,[d,f]=el({prop:s,defaultProp:i??!1,onChange:l,caller:Xb});return S.jsx(Zne,{scope:r,disabled:o,contentId:Na(),open:d,onOpenToggle:m.useCallback(()=>f(p=>!p),[f]),children:S.jsx(In.div,{"data-state":Gg(d),"data-disabled":o?"":void 0,...u,ref:n})})},"Collapsible")),qne="CollapsibleTrigger",Gne=m.forwardRef(Yh(function(e,n){const{__scopeCollapsible:r,...s}=e,i=Qb(qne,r);return S.jsx(In.button,{type:"button","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":Gg(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...s,ref:n,onClick:an(e.onClick,i.onOpenToggle)})},"CollapsibleTrigger")),N9="CollapsibleContent",Kne=m.forwardRef(Yh(function(e,n){const{forceMount:r,...s}=e,i=Qb(N9,e.__scopeCollapsible);return S.jsx(Ja,{present:r||i.open,children:({present:o})=>S.jsx(Yne,{...s,ref:n,present:o})})},"CollapsibleContent")),Yne=m.forwardRef(Yh(function(e,n){const{__scopeCollapsible:r,present:s,children:i,...o}=e,l=Qb(N9,r),[u,d]=m.useState(s),f=m.useRef(null),p=cn(n,f),g=m.useRef(0),v=g.current,w=m.useRef(0),_=w.current,x=l.open||u,b=m.useRef(x),E=m.useRef(void 0);return m.useEffect(()=>{const C=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(C)},[]),Kr(()=>{const C=f.current;if(C){E.current=E.current||{transitionDuration:C.style.transitionDuration,animationName:C.style.animationName},C.style.transitionDuration="0s",C.style.animationName="none";const R=C.getBoundingClientRect();g.current=R.height,w.current=R.width,b.current||(C.style.transitionDuration=E.current.transitionDuration,C.style.animationName=E.current.animationName),d(s)}},[l.open,s]),S.jsx(In.div,{"data-state":Gg(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!x,...o,ref:p,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":_?`${_}px`:void 0,...e.style},children:x&&i})},"CollapsibleContentImpl"));function Gg(t){return t?"open":"closed"}Yh(Gg,"getState");var Xne=Wne,Qne=Gne,Jne=Kne,ere=Object.defineProperty,tre=(t,e)=>ere(t,"name",{value:e,configurable:!0}),nre=m.createContext(void 0);function Jb(t){const e=m.useContext(nre);return t||e||"ltr"}tre(Jb,"useDirection");var rre=Object.defineProperty,bs=(t,e)=>rre(t,"name",{value:e,configurable:!0}),Ki="Accordion",sre=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[e4,ire,ore]=Kb(Ki),[Kg,Lie]=Gi(Ki,[ore,L9]),t4=L9(),are=m.forwardRef(bs(function(e,n){const{type:r,...s}=e,i=s,o=s;return S.jsx(e4.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?S.jsx(dre,{...o,ref:n}):S.jsx(ure,{...i,ref:n})})},"Accordion")),[D9,lre]=Kg(Ki),[$9,cre]=Kg(Ki,{collapsible:!1}),ure=m.forwardRef(bs(function(e,n){const{value:r,defaultValue:s,onValueChange:i=bs(()=>{},"onValueChange"),collapsible:o=!1,...l}=e,[u,d]=el({prop:r,defaultProp:s??"",onChange:i,caller:Ki});return S.jsx(D9,{scope:e.__scopeAccordion,value:m.useMemo(()=>u?[u]:[],[u]),onItemOpen:d,onItemClose:m.useCallback(()=>o&&d(""),[o,d]),children:S.jsx($9,{scope:e.__scopeAccordion,collapsible:o,children:S.jsx(j9,{...l,ref:n})})})},"AccordionImplSingle")),dre=m.forwardRef(bs(function(e,n){const{value:r,defaultValue:s,onValueChange:i=bs(()=>{},"onValueChange"),...o}=e,[l,u]=el({prop:r,defaultProp:s??[],onChange:i,caller:Ki}),d=m.useCallback(p=>u((g=[])=>[...g,p]),[u]),f=m.useCallback(p=>u((g=[])=>g.filter(v=>v!==p)),[u]);return S.jsx(D9,{scope:e.__scopeAccordion,value:l,onItemOpen:d,onItemClose:f,children:S.jsx($9,{scope:e.__scopeAccordion,collapsible:!0,children:S.jsx(j9,{...o,ref:n})})})},"AccordionImplMultiple")),[fre,Yg]=Kg(Ki),j9=m.forwardRef(bs(function(e,n){const{__scopeAccordion:r,disabled:s,dir:i,orientation:o="vertical",...l}=e,u=m.useRef(null),d=cn(u,n),f=ire(r),g=Jb(i)==="ltr",v=an(e.onKeyDown,w=>{var L;if(!sre.includes(w.key))return;const _=w.target,x=f().filter(D=>{var j;return!((j=D.ref.current)!=null&&j.disabled)}),b=x.findIndex(D=>D.ref.current===_),E=x.length;if(b===-1)return;w.preventDefault();let C=b;const R=0,A=E-1,I=bs(()=>{C=b+1,C>A&&(C=R)},"moveNext"),M=bs(()=>{C=b-1,C<R&&(C=A)},"movePrev");switch(w.key){case"Home":C=R;break;case"End":C=A;break;case"ArrowRight":o==="horizontal"&&(g?I():M());break;case"ArrowDown":o==="vertical"&&I();break;case"ArrowLeft":o==="horizontal"&&(g?M():I());break;case"ArrowUp":o==="vertical"&&M();break}const T=C%E;(L=x[T].ref.current)==null||L.focus()});return S.jsx(fre,{scope:r,disabled:s,direction:i,orientation:o,children:S.jsx(e4.Slot,{scope:r,children:S.jsx(In.div,{...l,"data-orientation":o,ref:d,onKeyDown:s?void 0:v})})})},"AccordionImpl")),Ow="AccordionItem",[hre,n4]=Kg(Ow),pre=m.forwardRef(bs(function(e,n){const{__scopeAccordion:r,value:s,...i}=e,o=Yg(Ow,r),l=lre(Ow,r),u=t4(r),d=Na(),f=s&&l.value.includes(s)||!1,p=o.disabled||e.disabled;return S.jsx(hre,{scope:r,open:f,disabled:p,triggerId:d,children:S.jsx(Xne,{"data-orientation":o.orientation,"data-state":r4(f),...u,...i,ref:n,disabled:p,open:f,onOpenChange:g=>{g?l.onItemOpen(s):l.onItemClose(s)}})})},"AccordionItem")),mre="AccordionHeader",gre=m.forwardRef(bs(function(e,n){const{__scopeAccordion:r,...s}=e,i=Yg(Ki,r),o=n4(mre,r);return S.jsx(In.h3,{"data-orientation":i.orientation,"data-state":r4(o.open),"data-disabled":o.disabled?"":void 0,...s,ref:n})},"AccordionHeader")),B3="AccordionTrigger",vre=m.forwardRef(bs(function(e,n){const{__scopeAccordion:r,...s}=e,i=Yg(Ki,r),o=n4(B3,r),l=cre(B3,r),u=t4(r);return S.jsx(e4.ItemSlot,{scope:r,children:S.jsx(Qne,{"aria-disabled":o.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId,...u,...s,ref:n})})},"AccordionTrigger")),yre="AccordionContent",_re=m.forwardRef(bs(function(e,n){const{__scopeAccordion:r,...s}=e,i=Yg(Ki,r),o=n4(yre,r),l=t4(r);return S.jsx(Jne,{role:"region","aria-labelledby":o.triggerId,"data-orientation":i.orientation,...l,...s,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})},"AccordionContent"));function r4(t){return t?"open":"closed"}bs(r4,"getState");var F9=are,wre=pre,xre=gre,bre=vre,Sre=_re;/**
|
|
159
|
-
* @license lucide-react v1.48.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 kre=t=>t==null?void 0:t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
164
|
-
* @license lucide-react v1.48.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
|
-
*/function Ere(t,e,n=[]){if(e==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:kre(t),size:24,node:e,...n.length>0?{aliases:n}:{}}}/**
|
|
169
|
-
* @license lucide-react v1.48.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 Cre=t=>{let e="",n=!1;for(const r of t){if(r==="-"||r==="_"||r<=" "){n=e.length>0;continue}e.length===0?e+=r.toLowerCase():e+=n?r.toUpperCase():r,n=!1}return e};/**
|
|
174
|
-
* @license lucide-react v1.48.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 Pre=t=>{const e=Cre(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
|
|
179
|
-
* @license lucide-react v1.48.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 Lw=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
|
|
184
|
-
* @license lucide-react v1.48.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 Ol={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
|
|
189
|
-
* @license lucide-react v1.48.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
|
-
*/function v_(t){return t!=null}function Rre(t,e={}){var g,v;const n=e.attributeNames??{},r=w=>n[w]??w,s=t.size??t.width??Ol.width,i=t.size??t.height??Ol.height,o=((g=t.aliases)==null?void 0:g.filter(w=>typeof w=="string"&&w.trim()!=="").map(w=>`lucide-${w}`))??[],l=[...t.name?[`lucide-${t.name}`]:[],...o],u=((v=e.className)==null?void 0:v.split(" ").filter(Boolean))??[],d=e.includeDefaultClasses===!1?Lw(...u):Lw("lucide",...l,...u),f=e.absoluteStrokeWidth?Number(e.strokeWidth??Ol["stroke-width"])*Number(t.size??t.width??Ol.width)/Number(e.size??e.width??Ol.width):e.strokeWidth??Ol["stroke-width"];return["svg",{...Object.entries(Ol).reduce((w,[_,x])=>(w[r(_)]=x,w),{}),..."color"in e&&e.color&&{[r("stroke")]:e.color},..."size"in e&&v_(e.size)&&{[r("width")]:e.size,[r("height")]:e.size},..."width"in e&&v_(e.width)&&{[r("width")]:e.width},..."height"in e&&v_(e.height)&&{[r("height")]:e.height},[r("stroke-width")]:f,...d&&{[r("class")]:d},[r("viewBox")]:`0 0 ${s} ${i}`,...e.hasA11yProp===!1?{[r("aria-hidden")]:"true"}:{},..."attributes"in e&&e.attributes},t.node.map(w=>{const[_,x,b]=w,E=e.nonScalingStroke?{[r("vector-effect")]:"non-scaling-stroke",...x}:x;return b?[_,E,b]:[_,E]})]}/**
|
|
194
|
-
* @license lucide-react v1.48.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
|
-
*/function Are(t,e={}){return Rre(t,{...e,attributeNames:{...e.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
|
|
199
|
-
* @license lucide-react v1.48.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 Tre=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},Ire=m.createContext({}),Mre=()=>m.useContext(Ire),Ore=m.forwardRef(({color:t,size:e,width:n,height:r,strokeWidth:s,absoluteStrokeWidth:i,nonScalingStroke:o,className:l="",children:u,iconNode:d=[],icon:f={node:d,aliases:[],size:24},...p},g)=>{const{size:v=24,strokeWidth:w=2,absoluteStrokeWidth:_=!1,nonScalingStroke:x=!1,color:b="currentColor",className:E=""}=Mre()??{},C=!!u||Tre(p),[R,A,I=[]]=Are(f,{color:t??b,width:n??e??v,height:r??e??v,strokeWidth:s??w,absoluteStrokeWidth:i??_,nonScalingStroke:o??x,className:Lw(E,l),hasA11yProp:C,attributes:p});return m.createElement(R,{ref:g,...A},[...I.map(([M,T])=>m.createElement(M,T)),...Array.isArray(u)?u:[u]])});/**
|
|
204
|
-
* @license lucide-react v1.48.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
|
-
*/function st(t,e=[],n=[]){const r=typeof t=="string"?Ere(t,e,n):t,s=m.forwardRef(({className:i,...o},l)=>m.createElement(Ore,{ref:l,icon:r,className:i,...o}));return r.name&&(s.displayName=Pre(r.name)),s}/**
|
|
209
|
-
* @license lucide-react v1.48.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 V9={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};V9.node;const Lre=st(V9);/**
|
|
214
|
-
* @license lucide-react v1.48.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 H9={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};H9.node;const Nre=st(H9);/**
|
|
219
|
-
* @license lucide-react v1.48.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 z9={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};z9.node;const Dre=st(z9);/**
|
|
224
|
-
* @license lucide-react v1.48.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 B9={name:"bell",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]};B9.node;const $re=st(B9);/**
|
|
229
|
-
* @license lucide-react v1.48.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 U9={name:"brain",size:24,node:[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]};U9.node;const jre=st(U9);/**
|
|
234
|
-
* @license lucide-react v1.48.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 Z9={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};Z9.node;const Fre=st(Z9);/**
|
|
239
|
-
* @license lucide-react v1.48.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 W9={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};W9.node;const Vre=st(W9);/**
|
|
244
|
-
* @license lucide-react v1.48.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 q9={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};q9.node;const Hre=st(q9);/**
|
|
249
|
-
* @license lucide-react v1.48.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 G9={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};G9.node;const zre=st(G9);/**
|
|
254
|
-
* @license lucide-react v1.48.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 K9={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};K9.node;const Bre=st(K9);/**
|
|
259
|
-
* @license lucide-react v1.48.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 Y9={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};Y9.node;const Ure=st(Y9);/**
|
|
264
|
-
* @license lucide-react v1.48.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 X9={name:"dot",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]};X9.node;const Zre=st(X9);/**
|
|
269
|
-
* @license lucide-react v1.48.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 Q9={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};Q9.node;const Wre=st(Q9);/**
|
|
274
|
-
* @license lucide-react v1.48.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 J9={name:"heart",size:24,node:[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]};J9.node;const qre=st(J9);/**
|
|
279
|
-
* @license lucide-react v1.48.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 eL={name:"house",size:24,node:[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],aliases:["home"]};eL.node;const Gre=st(eL);/**
|
|
284
|
-
* @license lucide-react v1.48.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 tL={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};tL.node;const Kre=st(tL);/**
|
|
289
|
-
* @license lucide-react v1.48.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 nL={name:"inbox",size:24,node:[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]};nL.node;const Yre=st(nL);/**
|
|
294
|
-
* @license lucide-react v1.48.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 rL={name:"lightbulb",size:24,node:[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]};rL.node;const Xre=st(rL);/**
|
|
299
|
-
* @license lucide-react v1.48.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 sL={name:"link",size:24,node:[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]};sL.node;const Qre=st(sL);/**
|
|
304
|
-
* @license lucide-react v1.48.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 iL={name:"loader",size:24,node:[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]};iL.node;const Jre=st(iL);/**
|
|
309
|
-
* @license lucide-react v1.48.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 oL={name:"lock",size:24,node:[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]};oL.node;const ese=st(oL);/**
|
|
314
|
-
* @license lucide-react v1.48.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 aL={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};aL.node;const tse=st(aL);/**
|
|
319
|
-
* @license lucide-react v1.48.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 lL={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};lL.node;const nse=st(lL);/**
|
|
324
|
-
* @license lucide-react v1.48.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 cL={name:"message-circle",size:24,node:[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]};cL.node;const rse=st(cL);/**
|
|
329
|
-
* @license lucide-react v1.48.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 uL={name:"monitor",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]};uL.node;const sse=st(uL);/**
|
|
334
|
-
* @license lucide-react v1.48.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 dL={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};dL.node;const ise=st(dL);/**
|
|
339
|
-
* @license lucide-react v1.48.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 fL={name:"paintbrush",size:24,node:[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]]};fL.node;const ose=st(fL);/**
|
|
344
|
-
* @license lucide-react v1.48.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 hL={name:"palette",size:24,node:[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]};hL.node;const ase=st(hL);/**
|
|
349
|
-
* @license lucide-react v1.48.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 pL={name:"pause",size:24,node:[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]};pL.node;const lse=st(pL);/**
|
|
354
|
-
* @license lucide-react v1.48.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 mL={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};mL.node;const cse=st(mL);/**
|
|
359
|
-
* @license lucide-react v1.48.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 gL={name:"pipette",size:24,node:[["path",{d:"m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12",key:"1y3wsu"}],["path",{d:"m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z",key:"110lr1"}],["path",{d:"m2 22 .414-.414",key:"jhxm08"}]]};gL.node;const use=st(gL);/**
|
|
364
|
-
* @license lucide-react v1.48.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 vL={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};vL.node;const dse=st(vL);/**
|
|
369
|
-
* @license lucide-react v1.48.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 yL={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};yL.node;const fse=st(yL);/**
|
|
374
|
-
* @license lucide-react v1.48.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 _L={name:"rectangle-horizontal",size:24,node:[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]]};_L.node;const hse=st(_L);/**
|
|
379
|
-
* @license lucide-react v1.48.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 wL={name:"rocket",size:24,node:[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]};wL.node;const pse=st(wL);/**
|
|
384
|
-
* @license lucide-react v1.48.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 xL={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};xL.node;const mse=st(xL);/**
|
|
389
|
-
* @license lucide-react v1.48.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 bL={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};bL.node;const gse=st(bL);/**
|
|
394
|
-
* @license lucide-react v1.48.0 - ISC
|
|
395
|
-
*
|
|
396
|
-
* This source code is licensed under the ISC license.
|
|
397
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
398
|
-
*/const SL={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};SL.node;const vse=st(SL);/**
|
|
399
|
-
* @license lucide-react v1.48.0 - ISC
|
|
400
|
-
*
|
|
401
|
-
* This source code is licensed under the ISC license.
|
|
402
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
403
|
-
*/const kL={name:"shield",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]};kL.node;const yse=st(kL);/**
|
|
404
|
-
* @license lucide-react v1.48.0 - ISC
|
|
405
|
-
*
|
|
406
|
-
* This source code is licensed under the ISC license.
|
|
407
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
408
|
-
*/const EL={name:"skip-forward",size:24,node:[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]]};EL.node;const _se=st(EL);/**
|
|
409
|
-
* @license lucide-react v1.48.0 - ISC
|
|
410
|
-
*
|
|
411
|
-
* This source code is licensed under the ISC license.
|
|
412
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
413
|
-
*/const CL={name:"square-library",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 7v10",key:"d5nglc"}],["path",{d:"M11 7v10",key:"pptsnr"}],["path",{d:"m15 7 2 10",key:"1m7qm5"}]],aliases:["library-square"]};CL.node;const wse=st(CL);/**
|
|
414
|
-
* @license lucide-react v1.48.0 - ISC
|
|
415
|
-
*
|
|
416
|
-
* This source code is licensed under the ISC license.
|
|
417
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
418
|
-
*/const PL={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};PL.node;const xse=st(PL);/**
|
|
419
|
-
* @license lucide-react v1.48.0 - ISC
|
|
420
|
-
*
|
|
421
|
-
* This source code is licensed under the ISC license.
|
|
422
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
423
|
-
*/const RL={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};RL.node;const bse=st(RL);/**
|
|
424
|
-
* @license lucide-react v1.48.0 - ISC
|
|
425
|
-
*
|
|
426
|
-
* This source code is licensed under the ISC license.
|
|
427
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
428
|
-
*/const AL={name:"user",size:24,node:[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]};AL.node;const Sse=st(AL);/**
|
|
429
|
-
* @license lucide-react v1.48.0 - ISC
|
|
430
|
-
*
|
|
431
|
-
* This source code is licensed under the ISC license.
|
|
432
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
433
|
-
*/const TL={name:"users",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};TL.node;const kse=st(TL);/**
|
|
434
|
-
* @license lucide-react v1.48.0 - ISC
|
|
435
|
-
*
|
|
436
|
-
* This source code is licensed under the ISC license.
|
|
437
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
438
|
-
*/const IL={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};IL.node;const Ese=st(IL),Cse={"chevron-right":Hre,"chevron-down":Vre,pipette:use,x:Ese,copy:Ure,menu:nse,dot:Zre,monitor:sse,sun:bse,moon:ise,"rectangle-horizontal":hse,circle:zre,"square-library":wse,clock:Bre,star:xse,settings:vse,plus:fse,"arrow-left":Lre,"arrow-right":Nre,"arrow-up":Dre,search:gse,loader:Jre,users:kse,lock:ese,mail:tse,bell:$re,shield:yse,palette:ase,lightbulb:Xre,rocket:pse,heart:qre,paintbrush:ose,brain:jre,globe:Wre,user:Sse,image:Kre,link:Qre,check:Fre,"rotate-ccw":mse,play:dse,pause:lse,home:Gre,"message-circle":rse,inbox:Yre,pencil:cse,"skip-forward":_se},U3={lucide:Cse},ML=m.createContext(null);function Pse(t){const e=m.useContext(ML);return e?U3[e.iconLibrary][t]:U3.lucide[t]}function Rse({children:t,defaultLibrary:e="lucide"}){const[n,r]=m.useState(e),s=m.useCallback(i=>{r(i)},[]);return S.jsx(ML.Provider,{value:{iconLibrary:n,setIconLibrary:s},children:t})}const OL=m.createContext(null);function s4(){return m.useContext(OL)}const LL=m.createContext(null);function NL(){const t=m.useContext(LL);if(!t)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return t}const Ase=m.forwardRef((t,e)=>{const{children:n,type:r="single",className:s,...i}=t,o=m.useRef(null),l=m.useRef(new Map),[u,d]=m.useState(new Map),{activeIndex:f,setActiveIndex:p,itemRects:g,sessionRef:v,handlers:w,registerItem:_,measureItems:x}=qM(o),b=m.useCallback((de,ae)=>{ae?l.current.set(de,ae):l.current.delete(de)},[]),E=m.useCallback(()=>{if(!o.current)return;const de=new Map;l.current.forEach((ae,Oe)=>{de.set(Oe,{top:ae.offsetTop,left:ae.offsetLeft,width:ae.offsetWidth,height:ae.offsetHeight})}),d(de)},[]),[C,R]=m.useState(()=>r==="single"?t.defaultValue??"":""),[A,I]=m.useState(()=>r==="multiple"?t.defaultValue??[]:[]),M=t.onValueChange,T=t.onValueChange,L=t.value,D=new Set(r==="multiple"?t.value??A:(()=>{const de=t.value??C;return de?[de]:[]})()),j=m.useCallback(de=>{const ae=t;ae.onValueChange?ae.onValueChange(de):R(de)},[M]),H=m.useCallback(de=>{const ae=t;ae.onValueChange?ae.onValueChange(de):I(de)},[T]),Y=m.useCallback(de=>{if(r==="multiple"){const ae=t.value??A;H(ae.filter(Oe=>Oe!==de))}else j("")},[r,j,H,A,L]);m.useEffect(()=>{x(),E()},[x,E,n]);const U=[...D].join(",");m.useEffect(()=>{x(),E()},[x,E,U]);const[z,Z]=m.useState(null),Q=f!==null?g[f]:null,B=z!==null?g[z]:null,ee=f!==null&&!u.has(f),W=Zh(),{value:N,defaultValue:X,onValueChange:oe,collapsible:re,type:se,...fe}=i,_e=r==="multiple"?{type:"multiple",value:t.value??A,onValueChange:H}:{type:"single",collapsible:t.collapsible??!0,value:t.value??C,onValueChange:j};return S.jsx(OL.Provider,{value:{registerItem:_,registerFullItem:b,activeIndex:f,grouped:!0,remeasure:()=>{x(),E()},openValues:D,openItemRects:u,toggleValue:Y},children:S.jsx(F9,{..._e,asChild:!0,children:S.jsxs("div",{ref:de=>{o.current=de,typeof e=="function"?e(de):e&&(e.current=de)},onMouseEnter:w.onMouseEnter,onMouseMove:de=>{const ae=o.current;if(ae){const Oe=ae.getBoundingClientRect(),ke=ae.offsetHeight,Ge=Oe.height,vt=ke>0?Ge/ke:1,It=(de.clientY-Oe.top)/vt+ae.scrollTop;for(const[Yt,wt]of u){const yt=g[Yt];if(!yt)continue;const We=yt.top+yt.height,Ke=wt.top+wt.height;if(It>=We&&It<=Ke){p(null);return}}}w.onMouseMove(de)},onMouseLeave:w.onMouseLeave,onFocus:de=>{var Oe;const ae=(Oe=de.target.closest("[data-proximity-index]"))==null?void 0:Oe.getAttribute("data-proximity-index");if(ae!=null){const ke=Number(ae);p(ke),Z(de.target.matches(":focus-visible")?ke:null)}},onBlur:de=>{var ae;(ae=o.current)!=null&&ae.contains(de.relatedTarget)||(Z(null),p(null))},className:zt("relative flex flex-col gap-0.5 w-72 max-w-full",s),...fe,children:[S.jsx(ws,{children:[...u.entries()].map(([de,ae])=>S.jsx(Ao.div,{className:`absolute ${W.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:!1,animate:{top:ae.top,left:ae.left,width:ae.width,height:ae.height,opacity:ee?.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-${de}`))}),S.jsx(ws,{children:Q&&S.jsx(Ao.div,{className:`absolute ${W.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:{..._h.fast,opacity:{duration:.08}}},v.current)}),S.jsx(ws,{children:B&&S.jsx(Ao.div,{className:`absolute ${W.focusRing} pointer-events-none z-20 border border-[#6B97FF]`,initial:!1,animate:{left:B.left-2,top:B.top-2,width:B.width+4,height:B.height+4},exit:{opacity:0,transition:{duration:.06}},transition:{..._h.fast,opacity:{duration:.08}}})}),n]})})})});Ase.displayName="AccordionGroup";const DL=m.forwardRef(({children:t,type:e="single",collapsible:n=!0,defaultValue:r,value:s,onValueChange:i,className:o,...l},u)=>{const[d,f]=m.useState(()=>e==="single"?r??"":""),[p,g]=m.useState(()=>e==="multiple"?r??[]:[]),v=new Set(e==="multiple"?s??p:(()=>{const E=s??d;return E?[E]:[]})()),w=m.useCallback(E=>{i?i(E):f(E)},[i]),_=m.useCallback(E=>{i?i(E):g(E)},[i]),x=m.useCallback(E=>{e==="multiple"?_((s??p).filter(R=>R!==E)):w("")},[e,s,p,w,_]),b=e==="multiple"?{type:"multiple",value:s??p,defaultValue:r,onValueChange:_}:{type:"single",collapsible:n,value:s??d,defaultValue:r,onValueChange:w};return S.jsx(F9,{...b,asChild:!0,children:S.jsx("div",{ref:u,className:zt("w-72 max-w-full flex flex-col gap-0.5",o),...l,children:S.jsx($L.Provider,{value:v,children:S.jsx(jL.Provider,{value:x,children:t})})})})});DL.displayName="Accordion";const $L=m.createContext(new Set),jL=m.createContext(()=>{}),FL=m.forwardRef(({value:t,index:e,disabled:n,children:r,className:s,...i},o)=>{const l=m.useRef(null),u=s4(),d=m.useContext($L),f=m.useContext(jL),p=Zh(),g=u!=null&&u.grouped?u.openValues.has(t):d.has(t),v=m.useRef(null),w=m.useCallback(()=>{u!=null&&u.grouped?u.toggleValue(t):f(t)},[u,f,t]);return m.useEffect(()=>{if(u!=null&&u.grouped&&e!==void 0)return u.registerItem(e,v.current),()=>u.registerItem(e,null)},[e,u]),m.useEffect(()=>{if(u!=null&&u.grouped&&e!==void 0)return g?u.registerFullItem(e,l.current):u.registerFullItem(e,null),()=>u.registerFullItem(e,null)},[e,u,g]),S.jsx(LL.Provider,{value:{index:e,value:t,isOpen:g,onToggle:w,triggerRef:v},children:S.jsxs(wre,{ref:_=>{l.current=_,typeof o=="function"?o(_):o&&(o.current=_)},value:t,disabled:n,"data-proximity-index":e,className:zt(!(u!=null&&u.grouped)&&"relative",s),...i,children:[!(u!=null&&u.grouped)&&S.jsx(ws,{children:g&&S.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]})})});FL.displayName="AccordionItem";const VL=m.forwardRef(({children:t,className:e,...n},r)=>{const s=Pse("chevron-right"),i=s4(),{index:o,isOpen:l,triggerRef:u}=NL(),d=Zh(),[f,p]=m.useState(!1),g=i!=null&&i.grouped?i.activeIndex===o:f,v=S.jsx(xre,{asChild:!0,children:S.jsx("div",{children:S.jsxs(bre,{ref:r,className:zt(`relative z-10 flex items-center gap-2.5 ${d.item} px-3 py-2 w-full cursor-pointer outline-none select-none`,!(i!=null&&i.grouped)&&"focus-visible:ring-1 focus-visible:ring-[#6B97FF] focus-visible:ring-offset-0",e),...n,children:[S.jsxs("span",{className:"inline-grid text-[13px] flex-1 text-left",children:[S.jsx("span",{className:"col-start-1 row-start-1 invisible",style:{fontVariationSettings:Bf.semibold},"aria-hidden":"true",children:t}),S.jsx("span",{className:zt("col-start-1 row-start-1 transition-[color,font-variation-settings] duration-80",l||g?"text-foreground":"text-muted-foreground"),style:{fontVariationSettings:l?Bf.semibold:Bf.normal},children:t})]}),S.jsx(Ao.span,{className:"shrink-0 inline-flex items-center justify-center",animate:{rotate:l?90:0},transition:_h.fast,children:S.jsx(s,{size:16,strokeWidth:l||g?2:1.5,className:zt("transition-[color,stroke-width] duration-80",l||g?"text-foreground":"text-muted-foreground")})})]})})});return i!=null&&i.grouped?S.jsx("div",{ref:u,children:v}):S.jsxs("div",{className:"relative",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[S.jsx(ws,{children:f&&S.jsx(Ao.div,{className:`absolute inset-0 ${d.bg} bg-hover pointer-events-none`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.06}},transition:{duration:.08}})}),v]})});VL.displayName="AccordionTrigger";const HL=m.forwardRef(({children:t,className:e,...n},r)=>{const s=s4(),{isOpen:i}=NL();return S.jsx(ws,{initial:!1,children:i&&S.jsx(Sre,{forceMount:!0,asChild:!0,...n,children:S.jsx(Ao.div,{ref:r,className:zt("overflow-hidden",e),initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{..._h.moderate,bounce:0},onUpdate:()=>{s==null||s.remeasure()},onAnimationComplete:()=>{s==null||s.remeasure()},children:S.jsx("div",{className:"px-3 pb-3 pt-1 text-[13px] text-muted-foreground",children:t})})})})});HL.displayName="AccordionContent";const pm=({children:t,defaultValue:e=[],className:n=""})=>S.jsx(DL,{type:"multiple",defaultValue:e,className:zt("w-full",n),children:t}),Tse=({value:t,title:e,description:n,dataCy:r,icon:s,children:i,className:o=""})=>{const l=o.includes("first-item");return S.jsxs(FL,{value:t,className:zt("w-full",!l&&"border-t border-main-border"),children:[S.jsxs(VL,{"data-cy":r,children:[s?S.jsx("span",{className:"mr-1 inline-flex items-center",children:s}):null,e]}),S.jsxs(HL,{children:[n?S.jsx("p",{className:"pb-2 text-sm text-content-subtle",children:n}):null,i]})]})};pm.Item=Tse;const Ise=({message:t,isLoading:e=!0})=>S.jsxs("div",{className:"flex items-center gap-2 text-sm text-content",children:[e?S.jsx(Mg,{className:"h-4 w-4 shrink-0 animate-spin text-primary",weight:"bold"}):null,S.jsx("span",{className:"whitespace-pre-wrap font-sans",children:t})]}),Mse=()=>{const t=m.useRef(Date.now()),[e,n]=m.useState(0);return m.useEffect(()=>{const r=()=>n(Math.max(0,Math.floor((Date.now()-t.current)/1e3)));r();const s=setInterval(r,1e3);return()=>clearInterval(s)},[]),e},Ose=t=>{const e=Math.floor(t/60),n=t%60;return`${e}:${n.toString().padStart(2,"0")}`},Z3="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",W3="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",Lse="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",mm=["Applying","Thinking","Planning","Crafting"],Nse=mm.reduce((t,e)=>t.length>=e.length?t:e),Dse=20,$se="Still working — runs can take a few minutes.",jse=({hint:t,showElapsed:e=!0})=>{const[n,r]=m.useState(0),s=Mse();m.useEffect(()=>{const o=setInterval(()=>{r(l=>(l+1)%mm.length)},4e3);return()=>clearInterval(o)},[]);const i=t??(e&&s>=Dse?$se:null);return S.jsxs("div",{role:"status",className:"flex items-center gap-2 px-3 py-1","data-cy":"thinking-indicator",children:[S.jsx(gi.svg,{"aria-hidden":!0,width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0 text-muted-foreground",children:S.jsx(gi.path,{animate:{d:[Z3,W3,Lse,W3,Z3]},transition:{d:{duration:6,ease:"easeInOut",repeat:1/0,times:[0,.25,.5,.75,1]}}})}),S.jsxs("span",{className:"inline-grid overflow-hidden text-sm font-medium",style:{fontVariationSettings:Bf.medium},children:[S.jsx("span",{className:"shimmer-text invisible col-start-1 row-start-1","aria-hidden":"true",children:Nse}),S.jsx(ws,{mode:"popLayout",initial:!1,children:S.jsx(gi.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:mm[n]},mm[n])})]}),e?S.jsx("span",{className:"text-xs tabular-nums text-content-subtle","data-cy":"thinking-elapsed",children:Ose(s)}):null,i?S.jsx("span",{className:"text-xs text-content-subtle",children:i}):null]})};var Fse=Object.defineProperty,Vse=(t,e)=>Fse(t,"name",{value:e,configurable:!0});function i4(t,[e,n]){return Math.min(n,Math.max(e,t))}Vse(i4,"clamp");var Hse=Object.defineProperty,zse=(t,e)=>Hse(t,"name",{value:e,configurable:!0});function zL(t){const e=m.useRef({value:t,previous:t});return m.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}zse(zL,"usePrevious");var Bse=Object.defineProperty,Nt=(t,e)=>Bse(t,"name",{value:e,configurable:!0}),BL=["PageUp","PageDown"],UL=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ZL={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Xh="Slider",[Nw,Use,Zse]=Kb(Xh),[o4,Nie]=Gi(Xh,[Zse]),[Wse,Qh]=o4(Xh),qse=m.forwardRef(Nt(function(e,n){const{name:r,min:s=0,max:i=100,step:o=1,orientation:l="horizontal",disabled:u=!1,minStepsBetweenThumbs:d=0,defaultValue:f=[s],value:p,onValueChange:g=Nt(()=>{},"onValueChange"),onValueCommit:v=Nt(()=>{},"onValueCommit"),inverted:w=!1,form:_,...x}=e,b=m.useRef(new Set),E=m.useRef(0),C=m.useRef(!1),A=l==="horizontal"?Gse:Kse,[I,M]=m.useState(null),T=cn(n,M),[L=[],D]=el({prop:p,defaultProp:f,onChange:Nt(Q=>{var ee;(ee=[...b.current][E.current])==null||ee.focus({preventScroll:!0,focusVisible:C.current}),C.current=!1,g(Q)},"onChange")}),j=m.useRef(L),H=m.useRef(L);m.useEffect(()=>{const Q=_?I==null?void 0:I.ownerDocument.getElementById(_):I==null?void 0:I.closest("form");if(Q instanceof HTMLFormElement){const B=Nt(()=>D(H.current),"reset");return Q.addEventListener("reset",B),()=>Q.removeEventListener("reset",B)}},[I,_,D]);function Y(Q){const B=JL(L,Q);Z(Q,B)}Nt(Y,"handleSlideStart");function U(Q){Z(Q,E.current)}Nt(U,"handleSlideMove");function z(){String(L)!==String(j.current)&&v(L)}Nt(z,"handleSlideEnd");function Z(Q,B,{commit:ee}={commit:!1}){const W=l4(o),N=Gf(Math.round((Q-s)/o)*o+s,W),X=i4(N,[s,i]);D((oe=[])=>{const re=XL(oe,X,B);if(nN(re,d*o)){E.current=re.indexOf(X);const se=String(re)!==String(oe);return se&&ee&&v(re),se?re:oe}else return oe})}return Nt(Z,"updateValues"),S.jsx(Wse,{scope:e.__scopeSlider,name:r,disabled:u,min:s,max:i,valueIndexToChangeRef:E,thumbs:b.current,values:L,orientation:l,form:_,children:S.jsx(Nw.Provider,{scope:e.__scopeSlider,children:S.jsx(Nw.Slot,{scope:e.__scopeSlider,children:S.jsx(A,{"aria-disabled":u,"data-disabled":u?"":void 0,...x,ref:T,onPointerDown:an(x.onPointerDown,()=>{u||(j.current=L,C.current=!1)}),min:s,max:i,inverted:w,onSlideStart:u?void 0:Y,onSlideMove:u?void 0:U,onSlideEnd:u?void 0:z,onHomeKeyDown:()=>{u||(C.current=!0,Z(s,0,{commit:!0}))},onEndKeyDown:()=>{u||(C.current=!0,Z(i,L.length-1,{commit:!0}))},onStepKeyDown:({event:Q,direction:B})=>{if(!u){C.current=!0;const N=BL.includes(Q.key)||Q.shiftKey&&UL.includes(Q.key)?10:1,X=E.current,oe=L[X],re=rN(oe,{min:s,step:o,direction:B,multiplier:N});Z(re,X,{commit:!0})}}})})})})},"Slider")),[WL,qL]=o4(Xh,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Gse=m.forwardRef(Nt(function(e,n){const{min:r,max:s,dir:i,inverted:o,onSlideStart:l,onSlideMove:u,onSlideEnd:d,onStepKeyDown:f,...p}=e,[g,v]=m.useState(null),w=cn(n,v),_=m.useRef(void 0),x=Jb(i),b=x==="ltr",E=b&&!o||!b&&o;function C(R){const A=_.current||g.getBoundingClientRect(),I=[0,A.width],T=Xg(I,E?[r,s]:[s,r]);return _.current=A,T(R-A.left)}return Nt(C,"getValueFromPointer"),S.jsx(WL,{scope:e.__scopeSlider,startEdge:E?"left":"right",endEdge:E?"right":"left",direction:E?1:-1,size:"width",children:S.jsx(GL,{dir:x,"data-orientation":"horizontal",...p,ref:w,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:R=>{const A=C(R.clientX);l==null||l(A)},onSlideMove:R=>{const A=C(R.clientX);u==null||u(A)},onSlideEnd:()=>{_.current=void 0,d==null||d()},onStepKeyDown:R=>{const I=ZL[E?"from-left":"from-right"].includes(R.key);f==null||f({event:R,direction:I?-1:1})}})})},"SliderHorizontal")),Kse=m.forwardRef(Nt(function(e,n){const{min:r,max:s,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:u,onStepKeyDown:d,...f}=e,p=m.useRef(null),g=cn(n,p),v=m.useRef(void 0),w=!i;function _(x){const b=v.current||p.current.getBoundingClientRect(),E=[0,b.height],R=Xg(E,w?[s,r]:[r,s]);return v.current=b,R(x-b.top)}return Nt(_,"getValueFromPointer"),S.jsx(WL,{scope:e.__scopeSlider,startEdge:w?"bottom":"top",endEdge:w?"top":"bottom",size:"height",direction:w?1:-1,children:S.jsx(GL,{"data-orientation":"vertical",...f,ref:g,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:x=>{const b=_(x.clientY);o==null||o(b)},onSlideMove:x=>{const b=_(x.clientY);l==null||l(b)},onSlideEnd:()=>{v.current=void 0,u==null||u()},onStepKeyDown:x=>{const E=ZL[w?"from-bottom":"from-top"].includes(x.key);d==null||d({event:x,direction:E?-1:1})}})})},"SliderVertical")),GL=m.forwardRef(Nt(function(e,n){const{__scopeSlider:r,onSlideStart:s,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:u,onStepKeyDown:d,...f}=e,p=Qh(Xh,r);return S.jsx(In.span,{...f,ref:n,onKeyDown:an(e.onKeyDown,g=>{g.key==="Home"?(l(g),g.preventDefault()):g.key==="End"?(u(g),g.preventDefault()):BL.concat(UL).includes(g.key)&&(d(g),g.preventDefault())}),onPointerDown:an(e.onPointerDown,g=>{const v=g.target;v.setPointerCapture(g.pointerId),g.preventDefault(),p.thumbs.has(v)?v.focus({preventScroll:!0,focusVisible:!1}):s(g)}),onPointerMove:an(e.onPointerMove,g=>{g.target.hasPointerCapture(g.pointerId)&&i(g)}),onPointerUp:an(e.onPointerUp,g=>{const v=g.target;v.hasPointerCapture(g.pointerId)&&(v.releasePointerCapture(g.pointerId),o(g))})})},"SliderImpl")),Yse="SliderTrack",Xse=m.forwardRef(Nt(function(e,n){const{__scopeSlider:r,...s}=e,i=Qh(Yse,r);return S.jsx(In.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...s,ref:n})},"SliderTrack")),q3="SliderRange",Qse=m.forwardRef(Nt(function(e,n){const{__scopeSlider:r,...s}=e,i=Qh(q3,r),o=qL(q3,r),l=m.useRef(null),u=cn(n,l),d=i.values.length,f=i.values.map(v=>a4(v,i.min,i.max)),p=d>1?Math.min(...f):0,g=100-Math.max(...f);return S.jsx(In.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...s,ref:u,style:{...e.style,[o.startEdge]:p+"%",[o.endEdge]:g+"%"}})},"SliderRange")),Jse="SliderThumb",[eie,KL]=o4(Jse),tie="SliderThumbProvider";function YL(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:s}=t,i=Qh(tie,e),o=Use(e),[l,u]=m.useState(null),d=m.useMemo(()=>l?o().findIndex(x=>x.ref.current===l):-1,[o,l]),f=tb(l),p=l?!!i.form||!!l.closest("form"):!0,g=i.values[d],v=n??(i.name?i.name+(i.values.length>1?"[]":""):void 0),w=g===void 0?0:a4(g,i.min,i.max);m.useEffect(()=>{if(l)return i.thumbs.add(l),()=>{i.thumbs.delete(l)}},[l,i.thumbs]);const _={value:g,name:v,form:i.form,isFormControl:p,index:d,thumb:l,onThumbChange:u,percent:w,size:f};return S.jsx(eie,{scope:e,..._,children:sN(s)?s(_):r})}Nt(YL,"SliderThumbProvider");var y_="SliderThumbTrigger",nie=m.forwardRef(Nt(function(e,n){const{__scopeSlider:r,...s}=e,i=Qh(y_,r),o=qL(y_,r),{index:l,value:u,percent:d,size:f,onThumbChange:p}=KL(y_,r),g=cn(n,p),v=QL(l,i.values.length),w=f==null?void 0:f[o.size],_=w?eN(w,d,o.direction):0;return S.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[o.startEdge]:`calc(${d}% + ${_}px)`},children:S.jsx(Nw.ItemSlot,{scope:r,children:S.jsx(In.span,{role:"slider","aria-label":e["aria-label"]||v,"aria-valuemin":i.min,"aria-valuenow":u,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...s,ref:g,style:u===void 0?{display:"none"}:e.style,onFocus:an(e.onFocus,()=>{i.valueIndexToChangeRef.current=l})})})})},"SliderThumbTrigger")),rie=m.forwardRef(Nt(function(e,n){const{__scopeSlider:r,name:s,...i}=e;return S.jsx(YL,{__scopeSlider:r,name:s,internal_do_not_use_render:({index:o,isFormControl:l})=>S.jsxs(S.Fragment,{children:[S.jsx(nie,{...i,ref:n,__scopeSlider:r}),l?S.jsx(iie,{__scopeSlider:r},o):null]})})},"SliderThumb")),sie="SliderBubbleInput",iie=m.forwardRef(Nt(function({__scopeSlider:e,...n},r){const{value:s,name:i,form:o}=KL(sie,e),l=m.useRef(null),u=cn(l,r),d=zL(s);return m.useEffect(()=>{const f=l.current;if(!f)return;const p=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(p,"value").set;if(d!==s&&v){const w=new Event("input",{bubbles:!0});v.call(f,s),f.dispatchEvent(w)}},[d,s]),S.jsx(In.input,{style:{display:"none"},name:i,form:o,...n,ref:u,defaultValue:s})},"SliderBubbleInput"));function XL(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}Nt(XL,"getNextSortedValues");function a4(t,e,n){const i=100/(n-e)*(t-e);return i4(i,[0,100])}Nt(a4,"convertValueToPercentage");function QL(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}Nt(QL,"getLabel");function JL(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)}Nt(JL,"getClosestValueIndex");function eN(t,e,n){const r=t/2,i=Xg([0,50],[0,r]);return(r-i(e)*n)*n}Nt(eN,"getThumbInBoundsOffset");function tN(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}Nt(tN,"getStepsBetweenValues");function nN(t,e){if(e>0){const n=tN(t);return Math.min(...n)>=e}return!0}Nt(nN,"hasMinStepsBetweenValues");function Xg(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])}}Nt(Xg,"linearScale");function l4(t){if(!Number.isFinite(t))return 0;const e=t.toString();if(e.includes("e")){const[r,s]=e.split("e"),i=r.split(".")[1]||"",o=Number(s);return Math.max(0,i.length-o)}const n=e.split(".")[1];return n?n.length:0}Nt(l4,"getDecimalCount");function Gf(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}Nt(Gf,"roundValue");function rN(t,{min:e,step:n,direction:r,multiplier:s}){const i=l4(n),o=(t-e)/n,l=Math.round(o),u=Gf(l*n+e,i)===Gf(t,i);let d;return u?d=l+s*r:r>0?d=Math.ceil(o):d=Math.floor(o),Gf(d*n+e,i)}Nt(rN,"getNextStepValue");function sN(t){return typeof t=="function"}Nt(sN,"isFunction");const Dw=m.forwardRef(({className:t,...e},n)=>S.jsxs(qse,{ref:n,className:zt("relative flex w-full touch-none select-none items-center","data-[disabled]:opacity-50",t),...e,children:[S.jsx(Xse,{className:"relative h-1 w-full grow overflow-hidden rounded-full bg-input",children:S.jsx(Qse,{className:"absolute h-full bg-primary"})}),S.jsx(rie,{className:zt("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")})]}));Dw.displayName="Slider";const oie=[{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"}],aie=[{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"}],lie=[{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"}],j0=[{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:"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."}],cie=()=>{window.location.hash=""},po=({title:t,eyebrow:e,description:n,children:r})=>S.jsxs("section",{className:"border-border bg-card shadow-surface-3 rounded-2xl border p-5",children:[S.jsxs("div",{className:"mb-5 max-w-2xl",children:[S.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.18em] uppercase",children:e}),S.jsx("h2",{className:"text-foreground mt-2 text-xl font-semibold",children:t}),S.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:n})]}),r]}),G3=({swatches:t})=>S.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map(e=>S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-3",children:[S.jsx("div",{className:`h-16 rounded-lg ${e.className}`}),S.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3",children:[S.jsx("span",{className:"text-foreground text-sm font-medium",children:e.name}),S.jsx("code",{className:"bg-muted text-muted-foreground rounded px-2 py-1 text-xs",children:e.utility})]})]},e.name))}),uie=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",die=()=>{const t=j0.filter(n=>n.status==="showcased").length,e=j0.filter(n=>n.status==="cataloged").length;return S.jsx("main",{className:"bg-main font-main text-content h-screen overflow-y-auto",children:S.jsxs("div",{className:"mx-auto flex w-full max-w-6xl flex-col gap-6 px-6 py-6 lg:px-8",children:[S.jsxs("header",{className:"border-border bg-surface-2 shadow-surface-4 rounded-3xl border p-6",children:[S.jsxs("button",{type:"button",onClick:cie,className:"text-content-subtle hover:text-content mb-6 inline-flex items-center gap-2 text-sm transition-colors",children:[S.jsx(qW,{className:"h-4 w-4",weight:"bold"}),"Back to editor"]}),S.jsxs("div",{className:"flex flex-col gap-5 lg:flex-row lg:items-end lg:justify-between",children:[S.jsxs("div",{className:"max-w-3xl",children:[S.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.22em] uppercase",children:"Local component gallery"}),S.jsx("h1",{className:"text-foreground mt-3 text-4xl font-semibold tracking-tight",children:"Rivet design system"}),S.jsx("p",{className:"text-muted-foreground mt-3 text-base leading-7",children:"A Storybook-like route for checking the current UI primitives, tokens, and interaction states inside the Vite app."})]}),S.jsx("div",{className:"border-border bg-surface-3 rounded-2xl border p-4",children:S.jsxs("div",{className:"text-content-muted flex items-center gap-3 text-sm",children:[S.jsx(YT,{className:"text-primary h-5 w-5",weight:"bold"}),"Open with ",S.jsx("code",{className:"text-content",children:"#/design-system"})]})})]})]}),S.jsx(po,{eyebrow:"Controls",title:"Button, split button, and tooltip",description:"Rivet's shared Button exposes variants and sizes backed by Fluid Functionalism, alongside the split button and tooltip controls.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-[1fr_1fr]",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Rivet Button"}),S.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[S.jsx(Mo,{title:"Primary action",shortcut:"D",variant:"primary",children:"Design action"}),S.jsx(Mo,{title:"Secondary action",variant:"secondary",children:"Secondary"}),S.jsx(Mo,{title:"Disabled action",disabled:!0,variant:"tertiary",children:"Disabled"}),S.jsx(cO,{primaryLabel:"Ship",primaryIcon:Dy,primaryAction:()=>{},dropdownItems:[{label:"Create PR",onClick:()=>{}},{label:"Copy branch",onClick:()=>{}}]})]})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Tooltip states"}),S.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[S.jsx(fc,{label:"Rivet tooltip API",side:"bottom",children:S.jsx("button",{className:"border-border bg-surface-4 text-content rounded-lg border px-4 py-2 text-sm",children:"Hover target"})}),S.jsx(ob,{content:"Forced open preview",forceOpen:!0,side:"right",children:S.jsx("button",{className:"bg-selected text-content rounded-lg px-4 py-2 text-sm",children:"UI tooltip"})})]})]})]})}),S.jsx(po,{eyebrow:"Tokens",title:"Surface ladder",description:"Surface tokens move from the base app background toward raised panels without leaving the dark Rivet palette.",children:S.jsx(G3,{swatches:oie})}),S.jsx(po,{eyebrow:"Tokens",title:"Color roles",description:"Named roles should communicate purpose: brand, selection, neutral accent, and outcome colors.",children:S.jsx(G3,{swatches:aie})}),S.jsx(po,{eyebrow:"Type",title:"Typography",description:"Satoshi remains the default UI voice with clear hierarchy and muted support text.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-primary text-xs tracking-[0.18em] uppercase",children:"Display"}),S.jsx("p",{className:"text-foreground mt-2 text-3xl font-semibold tracking-tight",children:"Visual edits, quickly"})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground text-sm font-semibold",children:"Panel heading"}),S.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:"Body copy uses compact line height and muted contrast for dense inspector panels."})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs font-medium tracking-[0.16em] uppercase",children:"Micro label"}),S.jsx("code",{className:"bg-muted text-muted-foreground mt-3 block rounded-lg px-3 py-2 text-xs",children:"font-main text-content"})]})]})}),S.jsx(po,{eyebrow:"Layout",title:"Spacing rhythm",description:"A compact spacing scale keeps editor chrome dense while preserving scannable groupings.",children:S.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:S.jsx("div",{className:"flex flex-col gap-3",children:lie.map(n=>S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx("code",{className:"text-muted-foreground w-16 text-xs",children:n.name}),S.jsx("div",{className:`${n.className} bg-primary h-4 rounded`}),S.jsx("div",{className:"bg-border h-px flex-1"})]},n.name))})})}),S.jsx(po,{eyebrow:"Primitives",title:"Accordion and slider",description:"Representative Radix primitives styled through the local component layer.",children:S.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[S.jsxs(pm,{defaultValue:["foundations"],className:"border-border bg-surface-2 rounded-xl border p-2",children:[S.jsx(pm.Item,{value:"foundations",title:"Foundations",description:"Tokens, surfaces, type, and spacing.",className:"first-item",icon:S.jsx(Dy,{className:"text-primary h-4 w-4"}),children:S.jsx("p",{children:"Use these pieces before adding one-off visual rules."})}),S.jsx(pm.Item,{value:"components",title:"Components",description:"Buttons, tooltips, accordions, sliders.",children:S.jsx("p",{children:"Keep states visible in this route as the system evolves."})})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-5",children:[S.jsx("p",{className:"text-foreground mb-5 text-sm font-medium",children:"Slider states"}),S.jsxs("div",{className:"space-y-6",children:[S.jsx(Dw,{defaultValue:[64],max:100,step:1}),S.jsx(Dw,{defaultValue:[36],max:100,step:1,disabled:!0})]})]})]})}),S.jsx(po,{eyebrow:"Feedback",title:"Motion and loading",description:"Loading states use existing CSS animation utilities and avoid per-frame React work where possible.",children:S.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Progress"}),S.jsx(Ise,{message:"Applying visual change..."})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Sparkle strip"}),S.jsx(Pb,{className:"text-primary text-xl"})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Shimmer text"}),S.jsx("span",{className:"shimmer-text text-sm font-medium",children:"Generating variants"})]}),S.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4 sm:col-span-3",children:S.jsx(jse,{hint:"Reading selected elements"})})]})}),S.jsx(po,{eyebrow:"Feedback",title:"Status surfaces",description:"The unified full-surface system: one StatusSurface primitive with LoadingSurface / EmptyState / ErrorState wrappers. Every full-page loading, empty, and error state routes through these so they share layout, copy tone, and a single status_surface_shown impression event. Inline loaders (Sparkle, ThinkingIndicator, above) stay inline and are deliberately not part of this system.",children:S.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(gw,{fill:"surface",loader:"coalesce",trackGlobalLoaderCount:!1})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(IO,{icon:S.jsx(Dy,{size:32}),title:"Nothing to preview yet",description:"Pick a direction from the panel."})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(Ab,{fill:"surface",size:"sm",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>{}}]})})]})}),S.jsxs(po,{eyebrow:"Inventory",title:"Component coverage",description:"Every current component file is accounted for here. Reusable primitives are rendered above; app surfaces that need live editor, git, auth, iframe, or generated state are cataloged instead of mounted unsafely.",children:[S.jsxs("div",{className:"mb-4 grid gap-3 sm:grid-cols-3",children:[S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Total components"}),S.jsx("p",{className:"text-foreground mt-2 text-2xl font-semibold",children:j0.length})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Showcased"}),S.jsx("p",{className:"text-accent-success mt-2 text-2xl font-semibold",children:t})]}),S.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[S.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Cataloged"}),S.jsx("p",{className:"text-primary mt-2 text-2xl font-semibold",children:e})]})]}),S.jsxs("div",{className:"border-border overflow-hidden rounded-xl border",children:[S.jsxs("div",{className:"border-border bg-surface-3 text-content-subtle grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] border-b px-4 py-3 text-xs font-semibold tracking-[0.14em] uppercase",children:[S.jsx("span",{children:"Component"}),S.jsx("span",{children:"Status"}),S.jsx("span",{children:"Coverage note"})]}),S.jsx("div",{className:"divide-border bg-surface-2 divide-y",children:j0.map(n=>S.jsxs("div",{className:"grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] gap-3 px-4 py-3 text-sm",children:[S.jsxs("div",{children:[S.jsx("p",{className:"text-foreground font-medium",children:n.name}),S.jsx("code",{className:"text-muted-foreground text-xs",children:n.path})]}),S.jsx("div",{children:S.jsx("span",{className:`inline-flex rounded-full border px-2 py-1 text-xs font-medium ${uie(n.status)}`,children:n.status})}),S.jsx("p",{className:"text-muted-foreground",children:n.note})]},n.path))})]})]})]})})},fie=t=>(t.startsWith("#/")?t.slice(2):t.slice(1)).split("?")[0]==="design-system"?"design-system":"editor",$w=274,yg=395,__=Math.min(yg,Math.round(($w+yg)/2*1.1)),K3="rivet:panelWidth:v2",hie=t=>{if(!(t instanceof HTMLElement))return!1;const e=t.tagName.toLowerCase();return t.isContentEditable||e==="input"||e==="textarea"||e==="select"},pie=({projectPath:t})=>{const e=ct(nO)>0,[n,r]=BR(eO),s=UZ(),[i,o]=m.useState(()=>{if(typeof window>"u")return __;const R=Number(window.localStorage.getItem(K3));return Number.isFinite(R)&&R>=$w&&R<=yg?R:__}),[l,u]=m.useState(!1),[d,f]=m.useState(kne),p=n?i:0,[g,v]=m.useState(n);m.useEffect(()=>{if(!n){v(!1);return}f(R=>Sne({position:R,boundsLeftPx:i}))},[n,i]),m.useEffect(()=>{window.localStorage.setItem(K3,String(i))},[i]),m.useEffect(()=>{if(!n)return;const R=A=>{A.key==="Escape"&&(hie(A.target)||(A.preventDefault(),r(!1)))};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[n,r]);const w=m.useCallback(R=>{R.preventDefault(),R.stopPropagation();const A=R.clientX,I=i;u(!0);const M=L=>{const D=Math.min(yg,Math.max($w,I+(L.clientX-A)));o(D)},T=()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",T),window.removeEventListener("pointercancel",T),u(!1)};window.addEventListener("pointermove",M),window.addEventListener("pointerup",T),window.addEventListener("pointercancel",T)},[i]),_=m.useCallback(()=>o(__),[]),x=$ne(),b=ct(zg);Vne({enabled:!b});const E=x.isProcessing?"Completing authentication...":null,C=mt(Cb);return m.useEffect(()=>{C(t??null)},[t,C]),S.jsxs(gi.div,{className:"relative flex h-screen overflow-hidden",initial:!1,animate:{opacity:1},transition:{duration:.5,ease:"easeOut"},"data-cy":"rivet-app",children:[E!==null?S.jsx("div",{className:"absolute inset-0 z-50",children:S.jsx(une,{message:E})}):null,S.jsx("div",{className:"relative flex min-w-0 flex-1 flex-col",children:S.jsx(jee,{})}),S.jsx(S.Fragment,{children:e?null:S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"relative order-first h-full flex-shrink-0",style:{width:g?i:0},children:S.jsxs(gi.div,{className:"absolute inset-y-0 left-0 z-30",initial:!1,animate:{x:n?0:-i},transition:s?{duration:0}:{duration:.2,ease:[.22,1,.36,1]},onAnimationComplete:()=>{n&&v(!0)},style:{width:i,willChange:"transform"},children:[S.jsx(XJ,{onClose:()=>r(!1)}),S.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize panel",onPointerDown:w,onDoubleClick:_,className:"group/resize absolute inset-y-0 right-0 z-20 flex w-3 cursor-col-resize touch-none justify-end",children:S.jsx("span",{className:`h-full transition-all duration-150 ${l?"bg-content-muted w-0.5":"bg-divider group-hover/resize:bg-content-muted w-px group-hover/resize:w-0.5"}`})})]})}),l&&S.jsx("div",{className:"fixed inset-0 z-[100] cursor-col-resize"}),S.jsx(Pne,{isVisible:!0,isPanelOpen:n,isReducedMotion:!!s,position:d,dragBoundsLeftPx:p,onPositionChange:f,onToggle:()=>r(R=>!R)})]})}),S.jsx(wW,{duration:5e3,richColors:!0,toastOptions:{style:{maxHeight:"150px",overflow:"hidden"}}})]})},jw="rivet_connect_deep_link",mie=()=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search),e=t.get("connect"),n=e??window.sessionStorage.getItem(jw);if(n!=="pinterest"&&n!=="arena"&&n!=="x")return null;if(window.sessionStorage.setItem(jw,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},gie=mie(),vie=()=>{const[t,e]=m.useState(window.location.hash),[n]=m.useState(()=>typeof window<"u"&&window.sessionStorage.getItem(cg)==="1"),[r,s]=m.useState(!1),[i,o]=m.useState(gie);m.useEffect(()=>{n&&window.sessionStorage.removeItem(cg)},[n]);const{config:l,refetchConfig:u,loading:d,error:f}=Nne(),p=mt(zg),{startLogin:g,isStartingLogin:v,loginError:w}=SO(),[_,x]=m.useState(!1);m.useEffect(()=>{l!=null&&l.userId?(Ce.identify(l.userId,{...l.email?{email:l.email}:{}}),l.email&&Ce.alias(l.email,l.userId)):l!=null&&l.email&&Ce.identify(l.email,{email:l.email})},[l==null?void 0:l.userId,l==null?void 0:l.email]),m.useEffect(()=>{l&&Ce.register({source:"visual_editor",surface:"visual_editor"})},[l]);const b=l!=null&&l.agentModeAvailable!==!0,E=fie(t),C=m.useCallback(async()=>{x(!0),p(!0);try{await u()}finally{p(!1),x(!1)}},[u,p]);if(m.useEffect(()=>{const M=()=>{const T=window.location.hash;e(T)};return window.addEventListener("hashchange",M),()=>window.removeEventListener("hashchange",M)},[]),E==="design-system")return S.jsx(die,{});if(!d&&l===null&&!_){const M=f||"Could not load Rivet configuration.";return S.jsx("div",{className:"bg-main flex h-screen items-center justify-center px-6",children:S.jsxs("div",{className:"border-divider bg-main w-full max-w-md rounded-lg border p-6 text-center shadow-lg",children:[S.jsx("p",{className:"text-content text-sm font-medium",children:"We could not start Rivet yet."}),S.jsx("p",{className:"text-content-dim mt-2 text-xs",children:M}),S.jsx("button",{type:"button",className:"border-divider text-content hover:bg-main/80 mt-4 rounded-md border px-3 py-1.5 text-xs",onClick:()=>{C()},children:"Retry"})]})})}if(b)return S.jsx(lne,{isSigningIn:v,onStartSignIn:()=>{g()},errorMessage:w,displayMode:"full"});const A=(l==null?void 0:l.agentModeAvailable)===!0&&i!==null,I=(l==null?void 0:l.agentModeAvailable)===!0&&n&&!r&&!A;return S.jsxs(S.Fragment,{children:[S.jsx(pie,{projectPath:l==null?void 0:l.projectPath}),S.jsx(mw,{context:"onboarding",isOpen:I,onClose:()=>s(!0)}),S.jsx(mw,{context:"menu",isOpen:A,highlightProvider:i,onClose:()=>{window.sessionStorage.removeItem(jw),o(null)}})]})};cV();const yie=m.lazy(()=>oP(()=>import("./LibraryApp-Cxdyy4oV.js"),[])),_ie=window.location.pathname.startsWith("/rivet/library"),wie="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",xie=new h7,bie={session_recording:{maskAllInputs:!0,maskTextSelector:"[data-rivet-private]"}},Sie=()=>S.jsx("div",{style:{display:"flex",height:"100vh",alignItems:"center",justifyContent:"center"},children:S.jsx("p",{style:{fontSize:"14px",color:"#6b7280"},children:"Something went wrong. Please reload the page."})}),iN=document.getElementById("root");if(!iN)throw new Error("Rivet root element is missing");mV.createRoot(iN).render(S.jsx(we.StrictMode,{children:S.jsx(tV,{apiKey:wie,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",...bie,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.18.4",env:"production"})}},children:S.jsx(aV,{fallback:S.jsx(Sie,{}),children:S.jsx(HD,{client:xie,children:S.jsx(jG,{defaultShape:"rounded",children:S.jsx(Rse,{defaultLibrary:"lucide",children:_ie?S.jsx(m.Suspense,{fallback:S.jsx("div",{className:"bg-background h-screen"}),children:S.jsx(yie,{})}):S.jsx(vie,{})})})})})})}));export{mb as A,Mo as B,kb as C,db as D,gb as E,Rt as F,dne as G,gse as H,Cie as I,Rie as J,vm as K,Aie as L,Lre as M,YJ as N,wW as O,Sb as P,a7 as Q,xb as R,$h as S,bb as T,RJ as U,Ese as X,p7 as a,v7 as b,m as c,y7 as d,x7 as e,_7 as f,u7 as g,Kf as h,Zr as i,b7 as j,S7 as k,w7 as l,hP as m,dr as n,st as o,Vo as p,GM as q,dP as r,M1 as s,S as t,lP as u,F2 as v,cse as w,fb as x,hb as y,pb as z};
|