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
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
var BD=Object.defineProperty;var j8=t=>{throw TypeError(t)};var ZD=(t,e,n)=>e in t?BD(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var fa=(t,e,n)=>ZD(t,typeof e!="symbol"?e+"":e,n),U1=(t,e,n)=>e.has(t)||j8("Cannot "+n);var q=(t,e,n)=>(U1(t,e,"read from private field"),n?n.call(t):e.get(t)),tt=(t,e,n)=>e.has(t)?j8("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ae=(t,e,n,r)=>(U1(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),_t=(t,e,n)=>(U1(t,e,"access private method"),n);var l0=(t,e,n,r)=>({set _(s){Ae(t,e,s,n)},get _(){return q(t,e,r)}});function WD(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 qD="modulepreload",GD=function(t){return"/"+t},$8={},gP=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=GD(d),d in $8)return;$8[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":qD,f||(g.as="script"),g.crossOrigin="",g.href=d,u&&g.setAttribute("nonce",u),document.head.appendChild(g),f)return new Promise((v,x)=>{g.addEventListener("load",v),g.addEventListener("error",()=>x(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 Cg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var B1={exports:{}},sf={},Z1={exports:{}},pt={};/**
|
|
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 F8;function KD(){if(F8)return pt;F8=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(D){return D===null||typeof D!="object"?null:(D=p&&D[p]||D["@@iterator"],typeof D=="function"?D:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,_={};function w(D,X,oe){this.props=D,this.context=X,this.refs=_,this.updater=oe||v}w.prototype.isReactComponent={},w.prototype.setState=function(D,X){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,X,"setState")},w.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function b(){}b.prototype=w.prototype;function E(D,X,oe){this.props=D,this.context=X,this.refs=_,this.updater=oe||v}var C=E.prototype=new b;C.constructor=E,x(C,w.prototype),C.isPureReactComponent=!0;var R=Array.isArray,A=Object.prototype.hasOwnProperty,O={current:null},I={key:!0,ref:!0,__self:!0,__source:!0};function T(D,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)&&!I.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(D&&D.defaultProps)for(re in de=D.defaultProps,de)se[re]===void 0&&(se[re]=de[re]);return{$$typeof:t,type:D,key:fe,ref:_e,props:se,_owner:O.current}}function M(D,X){return{$$typeof:t,type:D.type,key:X,ref:D.ref,props:D.props,_owner:D._owner}}function N(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function j(D){var X={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(oe){return X[oe]})}var $=/\/+/g;function K(D,X){return typeof D=="object"&&D!==null&&D.key!=null?j(""+D.key):X.toString(36)}function B(D,X,oe,re,se){var fe=typeof D;(fe==="undefined"||fe==="boolean")&&(D=null);var _e=!1;if(D===null)_e=!0;else switch(fe){case"string":case"number":_e=!0;break;case"object":switch(D.$$typeof){case t:case e:_e=!0}}if(_e)return _e=D,se=se(_e),D=re===""?"."+K(_e,0):re,R(se)?(oe="",D!=null&&(oe=D.replace($,"$&/")+"/"),B(se,X,oe,"",function(Oe){return Oe})):se!=null&&(N(se)&&(se=M(se,oe+(!se.key||_e&&_e.key===se.key?"":(""+se.key).replace($,"$&/")+"/")+D)),X.push(se)),1;if(_e=0,re=re===""?".":re+":",R(D))for(var de=0;de<D.length;de++){fe=D[de];var ae=re+K(fe,de);_e+=B(fe,X,oe,ae,se)}else if(ae=g(D),typeof ae=="function")for(D=ae.call(D),de=0;!(fe=D.next()).done;)fe=fe.value,ae=re+K(fe,de++),_e+=B(fe,X,oe,ae,se);else if(fe==="object")throw X=String(D),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.");return _e}function z(D,X,oe){if(D==null)return D;var re=[],se=0;return B(D,re,"","",function(fe){return X.call(oe,fe,se++)}),re}function Z(D){if(D._status===-1){var X=D._result;X=X(),X.then(function(oe){(D._status===0||D._status===-1)&&(D._status=1,D._result=oe)},function(oe){(D._status===0||D._status===-1)&&(D._status=2,D._result=oe)}),D._status===-1&&(D._status=0,D._result=X)}if(D._status===1)return D._result.default;throw D._result}var Q={current:null},U={transition:null},ee={ReactCurrentDispatcher:Q,ReactCurrentBatchConfig:U,ReactCurrentOwner:O};function W(){throw Error("act(...) is not supported in production builds of React.")}return pt.Children={map:z,forEach:function(D,X,oe){z(D,function(){X.apply(this,arguments)},oe)},count:function(D){var X=0;return z(D,function(){X++}),X},toArray:function(D){return z(D,function(X){return X})||[]},only:function(D){if(!N(D))throw Error("React.Children.only expected to receive a single React element child.");return D}},pt.Component=w,pt.Fragment=n,pt.Profiler=s,pt.PureComponent=E,pt.StrictMode=r,pt.Suspense=u,pt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ee,pt.act=W,pt.cloneElement=function(D,X,oe){if(D==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+D+".");var re=x({},D.props),se=D.key,fe=D.ref,_e=D._owner;if(X!=null){if(X.ref!==void 0&&(fe=X.ref,_e=O.current),X.key!==void 0&&(se=""+X.key),D.type&&D.type.defaultProps)var de=D.type.defaultProps;for(ae in X)A.call(X,ae)&&!I.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:D.type,key:se,ref:fe,props:re,_owner:_e}},pt.createContext=function(D){return D={$$typeof:o,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},D.Provider={$$typeof:i,_context:D},D.Consumer=D},pt.createElement=T,pt.createFactory=function(D){var X=T.bind(null,D);return X.type=D,X},pt.createRef=function(){return{current:null}},pt.forwardRef=function(D){return{$$typeof:l,render:D}},pt.isValidElement=N,pt.lazy=function(D){return{$$typeof:f,_payload:{_status:-1,_result:D},_init:Z}},pt.memo=function(D,X){return{$$typeof:d,type:D,compare:X===void 0?null:X}},pt.startTransition=function(D){var X=U.transition;U.transition={};try{D()}finally{U.transition=X}},pt.unstable_act=W,pt.useCallback=function(D,X){return Q.current.useCallback(D,X)},pt.useContext=function(D){return Q.current.useContext(D)},pt.useDebugValue=function(){},pt.useDeferredValue=function(D){return Q.current.useDeferredValue(D)},pt.useEffect=function(D,X){return Q.current.useEffect(D,X)},pt.useId=function(){return Q.current.useId()},pt.useImperativeHandle=function(D,X,oe){return Q.current.useImperativeHandle(D,X,oe)},pt.useInsertionEffect=function(D,X){return Q.current.useInsertionEffect(D,X)},pt.useLayoutEffect=function(D,X){return Q.current.useLayoutEffect(D,X)},pt.useMemo=function(D,X){return Q.current.useMemo(D,X)},pt.useReducer=function(D,X,oe){return Q.current.useReducer(D,X,oe)},pt.useRef=function(D){return Q.current.useRef(D)},pt.useState=function(D){return Q.current.useState(D)},pt.useSyncExternalStore=function(D,X,oe){return Q.current.useSyncExternalStore(D,X,oe)},pt.useTransition=function(){return Q.current.useTransition()},pt.version="18.3.1",pt}var V8;function rw(){return V8||(V8=1,Z1.exports=KD()),Z1.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 H8;function YD(){if(H8)return sf;H8=1;var t=rw(),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 sf.Fragment=n,sf.jsx=o,sf.jsxs=o,sf}var z8;function XD(){return z8||(z8=1,B1.exports=YD()),B1.exports}var S=XD(),m=rw();const xe=Cg(m),Vh=WD({__proto__:null,default:xe},[m]),vP=m.createContext(void 0),yP=t=>{const e=m.useContext(vP);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},QD=({client:t,children:e})=>(m.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),S.jsx(vP.Provider,{value:t,children:e})),JD={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)};var xa,nw,oP,e7=(oP=class{constructor(){tt(this,xa,JD);tt(this,nw,!1)}setTimeoutProvider(t){Ae(this,xa,t)}setTimeout(t,e){return q(this,xa).setTimeout(t,e)}clearTimeout(t){q(this,xa).clearTimeout(t)}setInterval(t,e){return q(this,xa).setInterval(t,e)}clearInterval(t){q(this,xa).clearInterval(t)}},xa=new WeakMap,nw=new WeakMap,oP);const zl=new e7;function t7(t){setTimeout(t,0)}const n7=typeof window>"u"||"Deno"in globalThis;function Wr(){}function r7(t,e){return typeof t=="function"?t(e):t}function _P(t){return typeof t=="number"&&t>=0&&t!==1/0}function xP(t,e){return Math.max(t+(e||0)-Date.now(),0)}function fn(t,e){return typeof t=="function"?t(e):t}function U8(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:l}=t;if(o){if(r){if(e.queryHash!==sw(o,e.options))return!1}else if(!Gu(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 B8(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(Jf(e.options.mutationKey)!==Jf(i))return!1}else if(!Gu(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function sw(t,e){return((e==null?void 0:e.queryKeyHashFn)||Jf)(t)}function Jf(t){return JSON.stringify(t,(e,n)=>L_(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Gu(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(!Gu(t[r],e[r]))return!1;return!0}const n=Object.keys(e);for(const r of n)if(!Gu(t[r],e[r]))return!1;return!0}return!1}const s7=Object.prototype.hasOwnProperty;function wP(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=Z8(t)&&Z8(e);if(!r&&!(L_(t)&&L_(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:s7.call(t,f))&&u++;continue}if(p===null||g===null||typeof p!="object"||typeof g!="object"){l[f]=g;continue}const v=wP(p,g,n+1);l[f]=v,v===p&&u++}return s===o&&u===s?t:l}function W1(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 Z8(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function L_(t){if(!W8(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!(!W8(r)||!r.hasOwnProperty("isPrototypeOf")||e!==Object.prototype)}function W8(t){return Object.prototype.toString.call(t)==="[object Object]"}function i7(t){return new Promise(e=>{zl.setTimeout(e,t)})}function N_(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?wP(t,e):e}function o7(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function a7(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}const iw=Symbol();function bP(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===iw?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function SP(t,e){return typeof t=="function"?t(...e):!!t}function l7(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 c7=()=>n7;const ow=()=>c7();var Hh=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Wl,wa,Nu,aP,u7=(aP=class extends Hh{constructor(){super();tt(this,Wl);tt(this,wa);tt(this,Nu);Ae(this,Nu,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){q(this,wa)||this.setEventListener(q(this,Nu))}onUnsubscribe(){var e;this.hasListeners()||((e=q(this,wa))==null||e.call(this),Ae(this,wa,void 0))}setEventListener(e){var n;Ae(this,Nu,e),(n=q(this,wa))==null||n.call(this),Ae(this,wa,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){q(this,Wl)!==e&&(Ae(this,Wl,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof q(this,Wl)=="boolean"?q(this,Wl):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Wl=new WeakMap,wa=new WeakMap,Nu=new WeakMap,aP);const aw=new u7,d7=t7;function f7(){let t=[],e=0,n=l=>{l()},r=l=>{l()},s=d7;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 fr=f7();var Du,ba,ju,lP,h7=(lP=class extends Hh{constructor(){super();tt(this,Du,!0);tt(this,ba);tt(this,ju);Ae(this,ju,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,ba)||this.setEventListener(q(this,ju))}onUnsubscribe(){var e;this.hasListeners()||((e=q(this,ba))==null||e.call(this),Ae(this,ba,void 0))}setEventListener(e){var n;Ae(this,ju,e),(n=q(this,ba))==null||n.call(this),Ae(this,ba,e(this.setOnline.bind(this)))}setOnline(e){q(this,Du)!==e&&(Ae(this,Du,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return q(this,Du)}},Du=new WeakMap,ba=new WeakMap,ju=new WeakMap,lP);const xm=new h7;function p7(t){return Math.min(1e3*2**t,3e4)}function kP(t){return(t??"online")==="online"?xm.isOnline():!0}var D_=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function EP(t){let e=!1,n=0,r,s="pending",i,o;const l=new Promise((E,C)=>{i=E,o=C});l.catch(Wr);const u=()=>s!=="pending",d=E=>{var C;if(!u()){const R=new D_(E);_(R),(C=t.onCancel)==null||C.call(t,R)}},f=()=>{e=!0},p=()=>{e=!1},g=()=>aw.isFocused()&&(t.networkMode==="always"||xm.isOnline())&&t.canRun(),v=()=>kP(t.networkMode)&&t.canRun(),x=E=>{u()||(r==null||r(),s="resolved",i(E))},_=E=>{u()||(r==null||r(),s="rejected",o(E))},w=()=>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(x).catch(R=>{var M;if(u())return;const A=t.retry??(ow()?0:3),O=t.retryDelay??p7,I=typeof O=="function"?O(n,R):O,T=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,R);if(e||!T){_(R);return}n++,(M=t.onFail)==null||M.call(t,n,R),i7(I).then(()=>g()?void 0:w()).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():w().then(b),l)}}var ql,cP,CP=(cP=class{constructor(){tt(this,ql)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),_P(this.gcTime)&&Ae(this,ql,zl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(ow()?1/0:3e5))}clearGcTimeout(){q(this,ql)!==void 0&&(zl.clearTimeout(q(this,ql)),Ae(this,ql,void 0))}},ql=new WeakMap,cP);function m7(t){return{onFetch:(e,n)=>{var f,p,g,v,x;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=((x=e.state.data)==null?void 0:x.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const d=async()=>{let _=!1;const w=C=>{l7(C,()=>e.signal,()=>_=!0)},b=bP(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 I=(()=>{const j={client:e.client,queryKey:e.queryKey,pageParam:R,direction:A?"backward":"forward",meta:e.options.meta};return w(j),j})(),T=await b(I),{maxPages:M}=e.options,N=A?a7:o7;return{pages:N(C.pages,T,M),pageParams:N(C.pageParams,R,M)}};if(s&&i.length){const C=s==="backward",R=C?g7:q8,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:q8(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 _,w;return(w=(_=e.options).persister)==null?void 0:w.call(_,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=d}}}function q8(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 g7(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 $u,Gl,Fu,zs,Kl,Wn,Nh,Yl,hi,_o,uP,v7=(uP=class extends CP{constructor(e){super();tt(this,hi);tt(this,$u);tt(this,Gl);tt(this,Fu);tt(this,zs);tt(this,Kl);tt(this,Wn);tt(this,Nh);tt(this,Yl);Ae(this,Yl,!1),Ae(this,Nh,e.defaultOptions),this.setOptions(e.options),this.observers=[],Ae(this,Kl,e.client),Ae(this,zs,q(this,Kl).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Ae(this,Gl,K8(this.options)),this.state=e.state??q(this,Gl),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return q(this,$u)}get promise(){var e;return(e=q(this,Wn))==null?void 0:e.promise}setOptions(e){if(this.options={...q(this,Nh),...e},e!=null&&e._type&&Ae(this,$u,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=K8(this.options);n.data!==void 0&&(this.setState(G8(n.data,n.dataUpdatedAt)),Ae(this,Gl,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&q(this,zs).remove(this)}setData(e,n){const r=N_(this.state.data,e,this.options);return _t(this,hi,_o).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,hi,_o).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(Wr).catch(Wr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return q(this,Gl)}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===iw||!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:!xP(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,zs).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,Yl)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?q(this,Wn).cancel({revert:!0}):q(this,Wn).cancelRetry()),this.scheduleGc()),q(this,zs).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||_t(this,hi,_o).call(this,{type:"invalidate"})}async fetch(e,n){var d,f,p,g,v,x,_,w,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(O=>O.options.queryFn);A&&this.setOptions(A.options)}const r=new AbortController,s=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(Ae(this,Yl,!0),r.signal)})},i=()=>{const A=bP(this.options,n),I=(()=>{const T={client:q(this,Kl),queryKey:this.queryKey,meta:this.meta};return s(T),T})();return Ae(this,Yl,!1),this.options.persister?this.options.persister(A,I,this):A(I)},l=(()=>{const A={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:q(this,Kl),state:this.state,fetchFn:i};return s(A),A})();(f=q(this,$u)==="infinite"?m7(this.options.pages):this.options.behavior)==null||f.onFetch(l,this),Ae(this,Fu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=l.fetchOptions)==null?void 0:p.meta))&&_t(this,hi,_o).call(this,{type:"fetch",meta:(g=l.fetchOptions)==null?void 0:g.meta});const u=Ae(this,Wn,EP({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:A=>{A instanceof D_&&A.revert&&this.setState({...q(this,Fu),fetchStatus:"idle"}),r.abort()},onFail:(A,O)=>{_t(this,hi,_o).call(this,{type:"failed",failureCount:A,error:O})},onPause:()=>{_t(this,hi,_o).call(this,{type:"pause"})},onContinue:()=>{_t(this,hi,_o).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),(x=(v=q(this,zs).config).onSuccess)==null||x.call(v,A,this),(w=(_=q(this,zs).config).onSettled)==null||w.call(_,A,this.state.error,this),A}catch(A){if(A instanceof D_){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,hi,_o).call(this,{type:"error",error:A}),(E=(b=q(this,zs).config).onError)==null||E.call(b,A,this),(R=(C=q(this,zs).config).onSettled)==null||R.call(C,this.state.data,A,this),A}finally{q(this,Wn)===u&&Ae(this,Wn,void 0),this.scheduleGc()}}},$u=new WeakMap,Gl=new WeakMap,Fu=new WeakMap,zs=new WeakMap,Kl=new WeakMap,Wn=new WeakMap,Nh=new WeakMap,Yl=new WeakMap,hi=new WeakSet,_o=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,...PP(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...G8(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ae(this,Fu,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),fr.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),q(this,zs).notify({query:this,type:"updated",action:e})})},uP);function PP(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:kP(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function G8(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function K8(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 Tr,wt,Dh,Ir,Xl,Vu,Po,jh,Hu,zu,Ql,Jl,Sa,Uu,jt,wf,j_,$_,F_,V_,H_,z_,U_,B_,dP,y7=(dP=class extends Hh{constructor(e,n){super();tt(this,jt);tt(this,Tr);tt(this,wt);tt(this,Dh);tt(this,Ir);tt(this,Xl);tt(this,Vu);tt(this,Po);tt(this,jh);tt(this,Hu);tt(this,zu);tt(this,Ql);tt(this,Jl);tt(this,Sa);tt(this,Uu,new Set);this.options=n,Ae(this,Tr,e),Ae(this,Po,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(q(this,wt).addObserver(this),Y8(q(this,wt),this.options)?_t(this,jt,wf).call(this):this.updateResult(),_t(this,jt,H_).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Z_(q(this,wt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Z_(q(this,wt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,_t(this,jt,z_).call(this),_t(this,jt,U_).call(this),q(this,wt).removeObserver(this)}setOptions(e){const n=this.options,r=q(this,wt);if(this.options=q(this,Tr).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof fn(this.options.enabled,q(this,wt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");_t(this,jt,B_).call(this),q(this,wt).setOptions(this.options),n._defaulted&&!W1(this.options,n)&&q(this,Tr).getQueryCache().notify({type:"observerOptionsUpdated",query:q(this,wt),observer:this});const s=this.hasListeners();s&&X8(q(this,wt),r,this.options,n)&&_t(this,jt,wf).call(this),this.updateResult(),s&&(q(this,wt)!==r||fn(this.options.enabled,q(this,wt))!==fn(n.enabled,q(this,wt))||fn(this.options.staleTime,q(this,wt))!==fn(n.staleTime,q(this,wt)))&&_t(this,jt,$_).call(this);const i=_t(this,jt,F_).call(this);s&&(q(this,wt)!==r||fn(this.options.enabled,q(this,wt))!==fn(n.enabled,q(this,wt))||i!==q(this,Sa))&&_t(this,jt,V_).call(this,i)}getOptimisticResult(e){const n=q(this,Tr).getQueryCache().build(q(this,Tr),e),r=this.createResult(n,e);return W1(this.getCurrentResult(),r)||(Ae(this,Ir,r),Ae(this,Vu,this.options),Ae(this,Xl,q(this,wt).state)),r}getCurrentResult(){return q(this,Ir)}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,Uu).add(e)}getCurrentQuery(){return q(this,wt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=q(this,Tr).defaultQueryOptions(e),r=q(this,Tr).getQueryCache().build(q(this,Tr),n);let s=()=>{},i;const o=new Promise(l=>{i=l,s=q(this,Tr).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,jt,wf).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),q(this,Ir)))}createResult(e,n){var O;const r=q(this,wt),s=this.options,i=q(this,Ir),o=q(this,Xl),l=q(this,Vu),u=e!==r?e.state:q(this,Dh),{state:d}=e;let f={...d},p=!1,g;if(n._optimisticResults){const I=this.hasListeners(),T=!I&&Y8(e,n),M=I&&X8(e,r,n,s);(T||M)&&(f={...f,...PP(d.data,e.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:v,errorUpdatedAt:x,status:_}=f;g=f.data;let w=!1;if(n.placeholderData!==void 0&&g===void 0&&_==="pending"){let I;i!=null&&i.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(I=i.data,w=!0):I=typeof n.placeholderData=="function"?n.placeholderData((O=q(this,zu))==null?void 0:O.state.data,q(this,zu)):n.placeholderData,I!==void 0&&(_="success",g=N_(i==null?void 0:i.data,I,n),p=!0)}if(n.select&&g!==void 0&&!w)if(i&&g===(o==null?void 0:o.data)&&n.select===q(this,jh))g=q(this,Hu);else try{Ae(this,jh,n.select),g=n.select(g),g=N_(i==null?void 0:i.data,g,n),Ae(this,Hu,g),Ae(this,Po,null)}catch(I){Ae(this,Po,I)}else g===void 0&&Ae(this,Po,null);q(this,Po)&&(v=q(this,Po),g=q(this,Hu),x=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:x,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:lw(e,n),refetch:this.refetch,isEnabled:fn(n.enabled,e)!==!1}}updateResult(){const e=q(this,Ir),n=this.createResult(q(this,wt),this.options);if(Ae(this,Xl,q(this,wt).state),Ae(this,Vu,this.options),q(this,Xl).data!==void 0&&Ae(this,zu,q(this,wt)),W1(n,e))return;Ae(this,Ir,n);const s=(()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!q(this,Uu).size)return!0;const l=new Set(o??q(this,Uu));return this.options.throwOnError&&l.add("error"),Object.keys(q(this,Ir)).some(u=>{const d=u;return q(this,Ir)[d]!==e[d]&&l.has(d)})})();fr.batch(()=>{s&&this.listeners.forEach(i=>{i(q(this,Ir))}),q(this,Tr).getQueryCache().notify({query:q(this,wt),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&_t(this,jt,H_).call(this)}},Tr=new WeakMap,wt=new WeakMap,Dh=new WeakMap,Ir=new WeakMap,Xl=new WeakMap,Vu=new WeakMap,Po=new WeakMap,jh=new WeakMap,Hu=new WeakMap,zu=new WeakMap,Ql=new WeakMap,Jl=new WeakMap,Sa=new WeakMap,Uu=new WeakMap,jt=new WeakSet,wf=function(e){_t(this,jt,B_).call(this);let n=q(this,wt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Wr)),n},j_=function(e){return!ow()&&fn(this.options.enabled,q(this,wt))!==!1&&_P(e)},$_=function(){_t(this,jt,z_).call(this);const e=fn(this.options.staleTime,q(this,wt));if(q(this,Ir).isStale||!_t(this,jt,j_).call(this,e))return;const n=xP(q(this,Ir).dataUpdatedAt,e)+1;Ae(this,Ql,zl.setTimeout(()=>{q(this,Ir).isStale||this.updateResult()},n))},F_=function(){return fn(this.options.refetchInterval,q(this,wt))??!1},V_=function(e){_t(this,jt,U_).call(this),Ae(this,Sa,e),!(q(this,Sa)===0||!_t(this,jt,j_).call(this,q(this,Sa)))&&Ae(this,Jl,zl.setInterval(()=>{(this.options.refetchIntervalInBackground||aw.isFocused())&&_t(this,jt,wf).call(this)},q(this,Sa)))},H_=function(){_t(this,jt,$_).call(this),_t(this,jt,V_).call(this,_t(this,jt,F_).call(this))},z_=function(){q(this,Ql)!==void 0&&(zl.clearTimeout(q(this,Ql)),Ae(this,Ql,void 0))},U_=function(){q(this,Jl)!==void 0&&(zl.clearInterval(q(this,Jl)),Ae(this,Jl,void 0))},B_=function(){const e=q(this,Tr).getQueryCache().build(q(this,Tr),this.options);if(e===q(this,wt))return;const n=q(this,wt);Ae(this,wt,e),Ae(this,Dh,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},dP);function _7(t,e){return fn(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&fn(e.retryOnMount,t)===!1)}function Y8(t,e){return _7(t,e)||t.state.data!==void 0&&Z_(t,e,e.refetchOnMount)}function Z_(t,e,n){if(fn(e.enabled,t)!==!1&&fn(e.staleTime,t)!=="static"){const r=fn(n,t);return r==="always"||r!==!1&&lw(t,e)}return!1}function X8(t,e,n,r){return(t!==e||fn(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&lw(t,n)}function lw(t,e){return fn(e.enabled,t)!==!1&&t.isStaleByTime(fn(e.staleTime,t))}var $h,Li,br,ec,Ni,ga,fP,x7=(fP=class extends CP{constructor(e){super();tt(this,Ni);tt(this,$h);tt(this,Li);tt(this,br);tt(this,ec);Ae(this,$h,e.client),this.mutationId=e.mutationId,Ae(this,br,e.mutationCache),Ae(this,Li,[]),this.state=e.state||w7(),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,Li).includes(e)||(q(this,Li).push(e),this.clearGcTimeout(),q(this,br).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Ae(this,Li,q(this,Li).filter(n=>n!==e)),this.scheduleGc(),q(this,br).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){q(this,Li).length||(this.state.status==="pending"?this.scheduleGc():q(this,br).remove(this))}continue(){var e;return((e=q(this,ec))==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,x,_,w,b,E,C,R,A,O,I,T;const n=()=>{_t(this,Ni,ga).call(this,{type:"continue"})},r={client:q(this,$h),meta:this.options.meta,mutationKey:this.options.mutationKey},s=Ae(this,ec,EP({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(M,N)=>{_t(this,Ni,ga).call(this,{type:"failed",failureCount:M,error:N})},onPause:()=>{_t(this,Ni,ga).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>q(this,br).canRun(this)})),i=this.state.status==="pending",o=!s.canStart();try{if(i)n();else{_t(this,Ni,ga).call(this,{type:"pending",variables:e,isPaused:o}),q(this,br).config.onMutate&&await q(this,br).config.onMutate(e,this,r);const N=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,e,r));N!==this.state.context&&_t(this,Ni,ga).call(this,{type:"pending",context:N,variables:e,isPaused:o})}const M=await s.start();return await((f=(d=q(this,br).config).onSuccess)==null?void 0:f.call(d,M,e,this.state.context,this,r)),await((g=(p=this.options).onSuccess)==null?void 0:g.call(p,M,e,this.state.context,r)),await((x=(v=q(this,br).config).onSettled)==null?void 0:x.call(v,M,null,this.state.variables,this.state.context,this,r)),await((w=(_=this.options).onSettled)==null?void 0:w.call(_,M,null,e,this.state.context,r)),_t(this,Ni,ga).call(this,{type:"success",data:M}),M}catch(M){try{await((E=(b=q(this,br).config).onError)==null?void 0:E.call(b,M,e,this.state.context,this,r))}catch(N){Promise.reject(N)}try{await((R=(C=this.options).onError)==null?void 0:R.call(C,M,e,this.state.context,r))}catch(N){Promise.reject(N)}try{await((O=(A=q(this,br).config).onSettled)==null?void 0:O.call(A,void 0,M,this.state.variables,this.state.context,this,r))}catch(N){Promise.reject(N)}try{await((T=(I=this.options).onSettled)==null?void 0:T.call(I,void 0,M,e,this.state.context,r))}catch(N){Promise.reject(N)}throw _t(this,Ni,ga).call(this,{type:"error",error:M}),M}finally{q(this,ec)===s&&Ae(this,ec,void 0),q(this,br).runNext(this)}}},$h=new WeakMap,Li=new WeakMap,br=new WeakMap,ec=new WeakMap,Ni=new WeakSet,ga=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),fr.batch(()=>{q(this,Li).forEach(r=>{r.onMutationUpdate(e)}),q(this,br).notify({mutation:this,type:"updated",action:e})})},fP);function w7(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ro,pi,Fh,hP,b7=(hP=class extends Hh{constructor(e={}){super();tt(this,Ro);tt(this,pi);tt(this,Fh);this.config=e,Ae(this,Ro,new Set),Ae(this,pi,new Map),Ae(this,Fh,0)}build(e,n,r){const s=new x7({client:e,mutationCache:this,mutationId:++l0(this,Fh)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){q(this,Ro).add(e);const n=c0(e);if(typeof n=="string"){const r=q(this,pi).get(n);r?r.push(e):q(this,pi).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(q(this,Ro).delete(e)){const n=c0(e);if(typeof n=="string"){const r=q(this,pi).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,pi).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){var r;const n=c0(e);if(typeof n=="string"){const s=(r=q(this,pi).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=c0(e);return typeof n=="string"?((s=(r=q(this,pi).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){fr.batch(()=>{q(this,Ro).forEach(e=>{this.notify({type:"removed",mutation:e})}),q(this,Ro).clear(),q(this,pi).clear()})}getAll(){return Array.from(q(this,Ro))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>B8(n,r))}findAll(e={}){return this.getAll().filter(n=>B8(e,n))}notify(e){fr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return fr.batch(()=>Promise.all(e.map(n=>n.continue().catch(Wr))))}},Ro=new WeakMap,pi=new WeakMap,Fh=new WeakMap,hP);function c0(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Di,pP,S7=(pP=class extends Hh{constructor(e={}){super();tt(this,Di);this.config=e,Ae(this,Di,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??sw(s,n);let o=this.get(i);return o||(o=new v7({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){q(this,Di).has(e.queryHash)||(q(this,Di).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){q(this,Di).get(e.queryHash)===e&&(e.destroy(),q(this,Di).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){fr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return q(this,Di).get(e)}getAll(){return[...q(this,Di).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>U8(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>U8(e,r)):n}notify(e){fr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){fr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){fr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Di=new WeakMap,pP),xn,ka,Ea,Bu,Zu,Ca,Wu,qu,mP,k7=(mP=class{constructor(t={}){tt(this,xn);tt(this,ka);tt(this,Ea);tt(this,Bu);tt(this,Zu);tt(this,Ca);tt(this,Wu);tt(this,qu);Ae(this,xn,t.queryCache||new S7),Ae(this,ka,t.mutationCache||new b7),Ae(this,Ea,t.defaultOptions||{}),Ae(this,Bu,new Map),Ae(this,Zu,new Map),Ae(this,Ca,0)}mount(){l0(this,Ca)._++,q(this,Ca)===1&&(Ae(this,Wu,aw.subscribe(async t=>{t&&(await this.resumePausedMutations(),q(this,xn).onFocus())})),Ae(this,qu,xm.subscribe(async t=>{t&&(await this.resumePausedMutations(),q(this,xn).onOnline())})))}unmount(){var t,e;l0(this,Ca)._--,q(this,Ca)===0&&((t=q(this,Wu))==null||t.call(this),Ae(this,Wu,void 0),(e=q(this,qu))==null||e.call(this),Ae(this,qu,void 0))}isFetching(t){return q(this,xn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return q(this,ka).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=q(this,xn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=q(this,xn).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,xn).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,xn).get(r.queryHash))==null?void 0:o.state.data,i=r7(e,s);if(i!==void 0)return q(this,xn).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(t,e,n){return fr.batch(()=>q(this,xn).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,xn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=q(this,xn);fr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=q(this,xn);return fr.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=fr.batch(()=>q(this,xn).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Wr).catch(Wr)}invalidateQueries(t,e={}){return fr.batch(()=>(q(this,xn).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=fr.batch(()=>q(this,xn).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Wr)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Wr)}async query(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=q(this,xn).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,xn).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(Wr).catch(Wr)}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(Wr).catch(Wr)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return xm.isOnline()?q(this,ka).resumePausedMutations():Promise.resolve()}getQueryCache(){return q(this,xn)}getMutationCache(){return q(this,ka)}getDefaultOptions(){return q(this,Ea)}setDefaultOptions(t){Ae(this,Ea,t)}setQueryDefaults(t,e){q(this,Bu).set(Jf(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...q(this,Bu).values()],n={};return e.forEach(r=>{Gu(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){q(this,Zu).set(Jf(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...q(this,Zu).values()],n={};return e.forEach(r=>{Gu(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...q(this,Ea).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=sw(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===iw&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...q(this,Ea).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){q(this,xn).clear(),q(this,ka).clear()}},xn=new WeakMap,ka=new WeakMap,Ea=new WeakMap,Bu=new WeakMap,Zu=new WeakMap,Ca=new WeakMap,Wu=new WeakMap,qu=new WeakMap,mP);const RP=m.createContext(!1),E7=()=>m.useContext(RP);RP.Provider;function C7(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const P7=m.createContext(C7()),R7=()=>m.useContext(P7),A7=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?SP(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||r)&&(e.isReset()||(t.retryOnMount=!1))},T7=t=>{m.useEffect(()=>{t.clearReset()},[t])},I7=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||SP(n,[t.error,r])),M7=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))}},O7=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,L7=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function N7(t,e,n){const r=E7(),s=R7(),i=yP(),o=i.defaultQueryOptions(t),l=i.getQueryCache().get(o.queryHash),u=t.subscribed!==!1;o._optimisticResults=r?"isRestoring":u?"optimistic":void 0,M7(o),A7(o,s,l),T7(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(fr.batchCalls(g)):Wr;return d.updateResult(),v},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),m.useEffect(()=>{d.setOptions(o)},[o,d]),O7(o,f))throw L7(o,d,s);if(I7({result:f,errorResetBoundary:s,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw f.error;return o.notifyOnChangeProps?f:d.trackResult(f)}function eh(t,e){return N7(t,y7)}const J="u">typeof window?window:void 0,kr="u">typeof globalThis?globalThis:J,Yn=kr==null?void 0:kr.navigator,ue=kr==null?void 0:kr.document,an=kr==null?void 0:kr.location,th=kr==null?void 0:kr.fetch,cw=kr!=null&&kr.XMLHttpRequest&&"withCredentials"in new kr.XMLHttpRequest?kr.XMLHttpRequest:void 0,Q8=kr==null?void 0:kr.AbortController,D7=kr==null?void 0:kr.CompressionStream,Mr=Yn==null?void 0:Yn.userAgent;function AP(){return!(!J||J.navigator.onLine===!1)}const of=typeof globalThis<"u"?globalThis:J;of&&typeof self>"u"&&(of.self=of),of&&typeof File>"u"&&(of.File=function(){});const je=J??{},j7="0.9.0",Oo={DEBUG:!1,LIB_VERSION:j7,LIB_NAME:"browser-common"};var Ii=(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})({}),W_=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});const $7=["$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"],F7=["token"];function Ze(t,e){return t.indexOf(e)!==-1}const Pg=function(t){return t.trim()},q_=function(t){return t.replace(/^\$/,"")};function TP(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 IP=Object.prototype,uw=IP.hasOwnProperty,Rg=IP.toString,Be=Array.isArray||function(t){return Rg.call(t)==="[object Array]"},Gn=t=>typeof t=="function",ut=t=>t===Object(t)&&!Be(t),qr=t=>{if(ut(t)){for(const e in t)if(uw.call(t,e))return!1;return!0}return!1},ce=t=>t===void 0,at=t=>Rg.call(t)=="[object String]",Af=t=>at(t)&&t.trim().length===0,ln=t=>t===null,nt=t=>ce(t)||ln(t),pn=t=>Rg.call(t)=="[object Number]"&&t==t,xo=t=>pn(t)&&t>0,Lr=t=>Rg.call(t)==="[object Boolean]",V7=t=>Ze($7,t),H7=t=>Ze(F7,t);function MP(t){return t===null||typeof t!="object"}function wm(t,e){return{}.toString.call(t)===`[object ${e}]`}function fd(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 OP(t,Error)}}function dw(t){return"u">typeof Event&&OP(t,Event)}function OP(t,e){try{return t instanceof e}catch{return!1}}const z7=[!0,"true",1,"1","yes"],q1=t=>Ze(z7,t),U7=[!1,"false",0,"0","no"];function J8(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){J8(i,r,s,o,l,"next",u)}function l(u){J8(i,r,s,o,l,"throw",u)}o(void 0)})}}const B7=["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"],eS=function(t,e=[]){if(!t)return!1;const n=t.toLowerCase();return B7.concat(e).some(r=>{const s=r.toLowerCase();return n.indexOf(s)!==-1})};function Vi(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),Vi(s??n,e,n,r))}var Z7=class{constructor(t){this.C={},this.I=t.I,this.R=Vi(t.bucketSize,0,100,t.$),this.A=Vi(t.refillRate,0,this.R,t.$),this.O=Vi(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 Ku="Mobile",nh="Android",bm="Tablet",LP="Android Tablet",NP="iPad",DP="Apple Watch",B0="Safari",Ag="BlackBerry",jP="Samsung Internet",Z0="Chrome",$P="Chrome iOS",FP="Internet Explorer",VP="Internet Explorer Mobile",HP="Opera",zP="Microsoft Edge",W0="Firefox",UP="Firefox iOS",Sm="Nintendo",km="PlayStation",Tg="Xbox",BP="Android Mobile",ZP="Mobile Safari",G1="Windows",WP="Windows Phone",tS="Nokia",G_="Ouya",W7="Generic "+Ku.toLowerCase(),qP="Generic "+bm.toLowerCase(),K_="Konqueror",GP="Oculus Browser",KP="Vivaldi",YP="Yandex",XP="Whale",QP="DuckDuckGo",JP="Pale Moon",e5="Waterfox",Y_="Brave",t5="Claude",n5="Codex",r5="ChatGPT",s5="Google Search App",K1=new RegExp("Version/(\\d+(\\.\\d+)?)"),Y1=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),q7=new RegExp(Tg,"i"),G7=new RegExp("PlayStation \\w+","i"),K7=new RegExp("Nintendo \\w+","i"),fw=new RegExp("BlackBerry|PlayBook|BB10","i"),Y7={"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"},i5=function(t,e,n,r){return e=e||"",(function(i){return i!=null&&i.brave?Y_:null})(n)||(r!=null&&r.detectGoogleSearchApp&&Ze(t,"GSA/")?s5:Ze(t," OPR/")&&Ze(t,"Mini")?"Opera Mini":Ze(t," OPR/")?HP:fw.test(t)?Ag:Ze(t,"IEMobile")||Ze(t,"WPDesktop")?VP:Ze(t,"OculusBrowser")?GP:Ze(t,"SamsungBrowser")?jP:Ze(t,"Edge")||Ze(t,"Edg/")?zP:Ze(t,"Vivaldi/")?KP:Ze(t,"YaBrowser/")?YP:Ze(t,"Whale/")?XP:Ze(t,"DuckDuckGo/")||Ze(t,"Ddg/")?QP:Ze(t,"Claude/")?t5:Ze(t,"Codex/")?n5:Ze(t,"ChatGPT/")?r5:Ze(t,"FBIOS")?"Facebook Mobile":Ze(t,"UCWEB")||Ze(t,"UCBrowser")?"UC Browser":Ze(t,"CriOS")?$P:Ze(t,"CrMo")||Ze(t,Z0)?Z0:Ze(t,nh)&&Ze(t,B0)?BP:Ze(t,"FxiOS")?UP:Ze(t.toLowerCase(),K_.toLowerCase())?K_:Ze(t,"Brave/")?Y_:((i,o)=>o&&Ze(o,"Apple")||(function(l){return Ze(l,B0)&&!Ze(l,Z0)&&!Ze(l,nh)})(i))(t,e)?Ze(t,Ku)?ZP:B0:Ze(t,"PaleMoon/")?JP:Ze(t,"Waterfox/")?e5:Ze(t,W0)?W0:Ze(t,"MSIE")||Ze(t,"Trident/")?FP:Ze(t,"Gecko")?W0:"")},X7={[VP]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[zP]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[Z0]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[$P]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[B0]:[K1],[ZP]:[K1],[HP]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[W0]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[UP]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[K_]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[Ag]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),K1],[BP]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[jP]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[GP]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[KP]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[YP]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[XP]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[Y_]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[t5]:[Y1],[n5]:[Y1],[r5]:[Y1],[QP]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[JP]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[e5]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[s5]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[FP]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},Q7=function(t,e,n,r){const s=i5(t,e,n,r),i=X7[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},nS=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),t=>[Tg,t&&t[1]||""]],[new RegExp(Sm,"i"),[Sm,""]],[new RegExp(km,"i"),[km,""]],[fw,[Ag,""]],[new RegExp(G1,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[WP,""];if(new RegExp(Ku).test(e)&&!/IEMobile\b/.test(e))return["Windows Mobile",""];const n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){let r=Y7[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[G1,r]}return[G1,""]}],[/((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]?[nh,[t[2],t[3],t[4]||"0"].join(".")]:[nh,""]],[/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",""]]],o5=function(t){for(let e=0;nS.length>e;e++){const[n,r]=nS[e],s=n.exec(t),i=s&&(Gn(r)?r(s,t):r);if(i)return i}return["",""]},a5=function(t){return K7.test(t)?Sm:G7.test(t)?km:q7.test(t)?Tg:new RegExp(G_,"i").test(t)?G_:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?WP:/iPad/.test(t)?NP:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?DP:fw.test(t)?Ag:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(tS,"i").test(t)?tS:/(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(Ku).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)?nh:LP:new RegExp("(pda|Mobile)","i").test(t)?W7:new RegExp(bm,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?qP:""},J7=function(t,e){var n;const r=a5(t);return r===NP||r===LP||r==="Kobo"||r==="Kindle Fire"||r===qP?bm:r===Sm||r===Tg||r===km||r===G_?"Console":r===DP?"Wearable":r?Ku:(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)?Ku:bm:"Desktop";var s,i,o},X1=/\bFBAV\/(\d+(?:\.\d+)*)/i,rS=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",X1],[/\bFBAN\/EMA\b/i,"Facebook Lite",X1],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",X1],[/\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"]],X_="[Truncated]",zh="[Unserializable]";function Cu(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 l5(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=zh}Object.defineProperty(t,r,{value:s,enumerable:!0,writable:!0,configurable:!0})}return t}const q0=3e5;var c5=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,q0);if(!e)return this.ts=n,void(this.es=n+r);this.es=Math.max(this.es,Math.min(n+r,this.ts+q0))}remainingMs(){const t=Date.now();if(this.ts-5e3>t)return this.reset(),0;const e=Math.min(q0,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 ej=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function sS(t,e){return typeof(n=t)=="string"&&ej.test(n)?t:e();var n}function u5(t,e){const n=new Error(e);try{Object.defineProperty(n,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch{}return n}function Ha(t){return t&&t.split("#")[0]}function iS(t){try{return t()}catch{return}}function d5(t,e){const n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}function oS(t,e,n){return f5.apply(this,arguments)}function f5(){return(f5=qt(function*(t,e,n){let r;try{return yield Promise.race([t,new Promise((s,i)=>{r=d5(()=>{try{n==null||n(),s()}catch(o){i(o)}},e)})])}finally{clearTimeout(r)}})).apply(this,arguments)}let u0,aS,Q1;function tj(t){const e=globalThis._posthogChunkIds;if(!e)return;const n=Object.keys(e);return Q1&&n.length===aS||(aS=n.length,Q1=n.reduce((r,s)=>{u0||(u0={});const i=u0[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,u0[s]=[d,f];break}}}return r},{})),Q1}function Tf(t){return Tf=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},Tf(t)}function nj(t,e,n){return(e=(function(r){var s=(function(i){if(Tf(i)!="object"||!i)return i;var o=i[Symbol.toPrimitive];if(o!==void 0){var l=o.call(i,"string");if(Tf(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)})(r);return Tf(s)=="symbol"?s:s+""})(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lS(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 H(t){for(var e=1;arguments.length>e;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?lS(Object(n),!0).forEach(function(r){nj(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):lS(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var rj=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&&Be(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 H(H({},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?H(H({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:tj(this.stackParser),skipFirstLines:(e=t.skipFirstLines)!==null&&e!==void 0?e:1}}getAggregateErrors(t){try{if(fd(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 Be(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,x=0)=>{const _=f(v,x),w=_.apply;if(_.apply=O=>{l.push(g);try{return w(O)}finally{l.pop()}},x>4||x>0&&l.indexOf(g)!==-1)return this.coerceFallback(_);const b=typeof g=="object"&&g!==null||typeof g=="function";if(x===0&&r>=50||b&&o.has(g))return;b&&o.add(g),x===0&&r++;const E=this.getAggregateErrors(g);let C,R;i||(i=!!E);try{if(C=this.applyCoercers(g,_),!C)throw u}catch(O){if(O===u)return void(x===0&&r--);if(!i)throw O;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 O=0;50>r&&1e3>s&&R>O;O++){let I;s++;try{I=_.next(E[O])}catch{r++,I=this.coerceFallback(f(v+1))}I&&A.push(I)}return H(H({},C),{},{errors:A})},f=(g,v=0)=>H(H({},e),{},{syntheticException:g==0?e.syntheticException:void 0,mechanism:g==0?t:{},apply(x){const _=d(x,g,v+1);if(!_)throw u;return _},next:x=>d(x,g+1)}),p=f(n);return H(H({},p),{},{apply:g=>{var v;return(v=d(g,n))!==null&&v!==void 0?v:this.coerceFallback(p)}})}};const sj=/^([a-z][a-z0-9.+-]+):/i,ij=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function oj(t){if(!t||t==="<anonymous>")return!1;const e=sj.exec(t);return!e||ij.includes(e[1].toLowerCase())}function Q_(t,e,n,r,s){const i={platform:t,filename:e,function:n==="<anonymous>"?"?":n,in_app:oj(e)};return ce(r)||(i.lineno=r),ce(s)||(i.colno=s),i}const h5=(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]},aj=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,lj=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,cj=/\((\S*)(?::(\d+))(?::(\d+))\)/,uj=(t,e)=>{const n=aj.exec(t);if(n){const[,s,i,o]=n;return Q_(e,s,"?",+i,+o)}const r=lj.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){const o=cj.exec(r[2]);o&&(r[2]=o[1],r[3]=o[2],r[4]=o[3])}const[s,i]=h5(r[1]||"?",r[2]);return Q_(e,i,s,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},dj=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,fj=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,hj=(t,e)=>{const n=dj.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const i=fj.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]=h5(s,r),Q_(e,r,s,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},cS=/\(error: (.*)\)/;function hw(t,e){return t.filename===e.filename&&t.function===e.function&&t.module===e.module&&t.lineno===e.lineno&&t.colno===e.colno}function pj(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(!hw(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 mj(t,e){const n=e.start+e.length,r=m5(t,e);r&&t.splice(n+r===t.length?n:e.start,r)}function p5(t,e){let n=e.start;for(;n>0&&hw(t[n-1],t[n-1+e.length]);)n--;return e.start-n}function m5(t,e){const n=e.start+e.length;let r=n;for(;t.length>r&&hw(t[r],t[r-e.length]);)r++;return r-n}function gj(t,e){const n=e[0];let r=t.length-(n?p5(t,n):0);for(const s of e)r-=m5(t,s);return r}function vj(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 yj=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){const n=at(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 wm(t,"DOMException")}isDOMError(t){return wm(t,"DOMError")}},_j=class{match(t){return fd(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}}},xj=class{match(t){return!!wm(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 H(H({},r),{},{stack:(n=this.cr(t))!==null&&n!==void 0?n:r.stack,synthetic:!0})}ur(t){return at(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(at(r.filename)&&r.filename.length!==0&&s!==0)return`Error
|
|
18
|
+
at ${r.filename}:${s}:${i}`}};const wj=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var bj=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(wj);return r&&(e=r[1],n=r[2]),[e,n]}};const Sj=["fatal","error","warning","log","info","debug"];function g5(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 kj=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(dw(t))return t.constructor.name;const e="name"in t?t.name:void 0;return at(e)&&!Af(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: ${g5(t)}`}isSeverityLevel(t){return at(t)&&!Af(t)&&Sj.indexOf(t)>=0}getStack(t){try{return at(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:at(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(fd(n))return n}}getObjectClassName(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{return}}},Ej=class{match(t){return dw(t)}coerce(t,e){var n;const r=t.constructor.name;return{type:r,value:`${r} captured as exception with keys: ${g5(t)}`,stack:(n=e.syntheticException)===null||n===void 0?void 0:n.stack,synthetic:!0}}},Cj=class{match(t){return MP(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}}},Pj=class{match(t){return wm(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!dw(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 MP(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 Em="$message",Cm="$timestamp",Rj=new Set([Em,Cm]),J1={enabled:!0,max_bytes:32768};function Pm(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:J1.enabled,max_bytes:Tj(t.max_bytes,J1.max_bytes)}:H({},J1)}var Aj=class{constructor(t){this.ns=[],this.ss=0,this.Rr=Pm(t)}setConfig(t){this.Rr=Pm(t),this.rs()}add(t){const e=(function(r){let s;try{s=TP(r)}catch{return}try{const i=JSON.parse(s);if(!ut(i))return;const o=i,l=o[Em],u=o[Cm];return!at(l)||l.trim().length===0||!at(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 Tj(t,e){if(!pn(t)||t===1/0||t===-1/0)return e;const n=Math.floor(t);return 0>n?e:n}const uS=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function dS(t){return typeof t=="string"||t}function fS(t){return typeof t=="string"?t:void 0}const Ij=["$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"],v5="NativeGzipValidationError",J_=t=>t.length>=2&&t[0]===31&&t[1]===139,hS=(t,e)=>t===W_.GZipJS||e===W_.GZipJS||e==="gzip",pS=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError";let af;const d0=t=>{throw u5(v5,`Native gzip produced invalid output: ${t}`)},Mj=(mS=qt(function*(t,e){18>t.size&&d0("too-short");const n=new Uint8Array(yield t.slice(0,10).arrayBuffer());J_(n)&&n[2]===8||d0("invalid-header");const r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(i=>{const o=(()=>{if(af)return af;af=[];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;af[u]=d>>>0}return af})();let l=4294967295;for(let u=0;i.length>u;u++)l=o[255&(l^i[u])]^l>>>8;return(4294967295^l)>>>0})(e)&&d0("invalid-crc");const s=e.length>>>0;r.getUint32(4,!0)!==s&&d0("invalid-size")}),function(t,e){return mS.apply(this,arguments)});var mS;function e2(){return e2=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 Mj(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}),e2.apply(this,arguments)}function y5(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 Oj={}.propertyIsEnumerable;function Rm(t,e){try{return _5(t,e,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch{return[]}}function pw(t,e,n,r){if(0>=n.remainingNodes)return{stringValue:X_};if(n.remainingNodes--,Lr(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:Cu(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:X_};if(t instanceof Date){const s=t.getTime(),i=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:typeof i=="string"?Cu(i):String(i)}}n.ancestors.add(t);try{try{const s=t.toJSON;if(typeof s=="function")return pw(s.call(t),e,n,r+1)}catch{}return Be(t)?{arrayValue:{values:Lj(t,e,n,r+1)}}:{kvlistValue:{values:_5(t,e,n,r+1)}}}finally{n.ancestors.delete(t)}}return{stringValue:Cu(String(t))}}function Lj(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(pw(l,e,n,r))}catch{s.push({stringValue:zh})}return t.length>o&&s.push({stringValue:X_}),s}function _5(t,e,n,r){const s=[];for(const i in t)if(Oj.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(ln(o)||ce(o))continue;s.push({key:Cu(i),value:pw(o,e,n,r)})}catch{s.push({key:Cu(i),value:{stringValue:zh}})}}return s}function x5(t,e,n){return H(H(H(H({},l5({},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 Nj=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function w5(t,e){const n=l5({},t),r={};for(const s of Nj)({}).hasOwnProperty.call(n,s)&&(r[s]=n[s],delete n[s]);return[...Rm(n,e),...Rm(r,e)]}const gS={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"},b5={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}},Dj=b5.info;function jj(t){try{return Cu(String(t))}catch{return zh}}function $j(t,e,n,r){const s=t.level||"info",{text:i,number:o}=b5[s]||Dj,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=H({},u),f=t.attributes;if(f){let g=[];try{g=Object.keys(f)}catch{g=[]}for(const v of g){let x;try{x=f[v]}catch{x=zh}Object.defineProperty(d,v,{value:x,enumerable:!0,writable:!0,configurable:!0})}}const p={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:o,severityText:i,body:{stringValue:jj(t.body)},attributes:Rm(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 S5(t,e,n){return x5(t,e,n)}function k5(t,e,n,r){return{resourceLogs:[{resource:{attributes:w5(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}var E5=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=d5(()=>{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 C5(){return .75+.5*Math.random()}function P5(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 Fj=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 E5(()=>this.gs()),this.ys=null,this.bs=0,this._s=0,this.ws=new c5,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(Ii.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:$j(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=Be(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(Ii.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=k5(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(Ii.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(Ii.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(Ii.LogsQueue,s.slice(r)),yield e.vs()})()}qs(){return S5(this.Rr,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ls(t){var e;if(this._instance.optedOut)return;const n=(e=this._instance.getPersistedProperty(Ii.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(Ii.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(P5(this.Ms,this.ks,this.Ss,3e4),this.ws.remainingMs())}As(){const t=this._instance.getPersistedProperty(Ii.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 oS(n,t):yield n})()}flushWithTimeout(t){var e=this;return qt(function*(){const n=e.flush();yield oS(n,t,()=>{n.catch(()=>{})})})()}gs(){this.flush().then(()=>{this.ks=0,this.Ss=1},t=>{this.ks++,this.Ss=C5(),this.$.error("PostHog logs flush failed:",t)}).finally(()=>{!this._instance.isDisabled&&this.As()&&this.ps.armNoEarlierThan(this.Hs())})}};const ey=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function vS(t){return String(t)+"000000"}function yS(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 Vj=class{constructor(t,e,n){this._instance=t,this.Rr=e,this.$=n,this.zs=new Map,this.ps=new E5(()=>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 c5,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?H({},e.attributes):void 0,r=yS(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(ey.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,ey)]+=1;break}}}Os(t){const e=this.Rr.beforeSend;if(!e)return t;const n=Be(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(P5(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=C5()):(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 x5(i,o,l)})(this.Rr,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:w5(n)},scopeMetrics:[{scope:{name:r,version:s},metrics:e}]}]};var e,n,r,s}vo(t){const e=vS(Date.now()),n=new Map;for(const o of t.values()){var r;const l=yS(o.type,o.name,o.unit,void 0);let u=n.get(l);u||(u=H({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=Rm((r=o.attributes)!==null&&r!==void 0?r:{},this.$),f=vS(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:ey})}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 R5=(t,{debugEnabled:e}={})=>{const n={N(r,...s){J&&(Oo.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)=>R5(`${t} ${r}`,s)};return n},ve=R5("[PostHog.js]"),un=ve.createLogger,Hj=un("[ExternalScriptsLoader]"),Am=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]}},jl=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return Hj.warn(`${e} was requested but loading of external scripts is disabled.`),n("Loading of external scripts is disabled");const r=Am(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(Am(e))return jl(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)},ty={},_S=(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)};je.__PosthogExtensions__=je.__PosthogExtensions__||{},je.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e==="remote-config"){const s=t.requestRouter.endpointFor("assets",`/array/${t.config.token}/config.js`);return void jl(t,s,n)}const r=t.config.strict_script_versioning;if(r){const s=t.requestRouter.endpointFor("assets",`/static/${t.version}/${e}.js`),i=ty[s];if(r==="fallback"&&i){if(Am(i))return void jl(t,i,n);delete ty[s]}return void jl(t,s,r==="fallback"?(o,l)=>{if(o)if(typeof o=="string")n(o);else{var u;const d=_S(t,e);ty[s]=d;const f=Am(s);f==null||(u=f.parentNode)===null||u===void 0||u.removeChild(f),jl(t,d,n)}else n(void 0,l)}:n)}jl(t,_S(t,e),n)},je.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{const r=t.requestRouter.endpointFor("api",e);jl(t,r,n)},Oo.DEBUG=!1,Oo.LIB_VERSION="1.434.17",Oo.LIB_NAME="web";var Vn=Oo;const zj="$people_distinct_id",ci="distinct_id",mw="$device_id",ny="$device_model",Tm="__alias",Uj="__cmpns",xS="$fbc",Pu="$fbc_persistence",wS="$fbp",If="$fbp_persistence",t2="__timers",A5="$autocapture_disabled_server_side",n2="$heatmaps_enabled_server_side",r2="$exception_capture_enabled_server_side",T5="$error_tracking_suppression_rules",s2="$error_tracking_capture_extension_exceptions",i2="$web_vitals_enabled_server_side",gw="$dead_clicks_enabled_server_side",vw="$product_tours_enabled_server_side",I5="$logs_capture_enabled_server_side",M5="$web_vitals_allowed_metrics",Mf="$session_recording_remote_config",Bj="$session_recording_enabled_server_side",Zj="$replay_sample_rate",Wj="$replay_override_sampling",qj="$replay_override_linked_flag",Gj="$replay_override_url_trigger",Kj="$replay_override_event_trigger",vu="$sesid",O5="$session_is_sampled",Yj="$session_past_minimum_duration",Xj="$session_recording_url_trigger_activated_session",Qj="$session_recording_event_trigger_activated_session",Jj="$debug_first_full_snapshot_timestamp",e$="$sess_rec_flush_size",mi="$enabled_feature_flags",Ao="$active_feature_flags",o2="$early_access_features",tc="$feature_flag_details",Pa="$feature_flag_payloads",nc="$feature_flag_request_id",Of="$minimal_flag_called_events",Ti="$override_feature_flags",$l="$override_feature_flag_payloads",Ra="$stored_person_properties",Aa="$stored_group_properties",L5="$groups",a2="$surveys",Im="$surveys_loaded_at",N5="$surveys_activated",D5="$surveys_activated_session",j5="$surveys_activated_timestamps",l2="ph_product_tours",t$="$product_tours_activated",n$="$product_tours_activated_session",r$="$conversations_widget_session_id",s$="$conversations_ticket_id",i$="$conversations_widget_state",o$="$conversations_user_traits",Ta="$flag_call_reported",bf="$flag_call_reported_session_id",rh="$feature_flag_errors",Da="$feature_flag_evaluated_at",Or="$user_state",c2="$client_session_props",a$="$capture_rate_limit",$5="$initial_campaign_params",F5="$initial_referrer_info",yu="$initial_person_info",yw="$epp",ry="$posthog_cookieless",V5="$cookieless_mode",H5="$sdk_debug_extensions_init_method",z5="$sdk_debug_extensions_init_time_ms",U5="$sdk_debug_recording_script_not_loaded",B5="$sdk_debug_replay_stale_config",l$="$sdk_debug_replay_event_trigger_status",c$="$sdk_debug_replay_linked_flag_trigger_status",u$="$sdk_debug_replay_matched_recording_trigger_groups",d$="$sdk_debug_replay_pending_trigger_conditions",f$="$sdk_debug_replay_remote_trigger_matching_config",h$="$sdk_debug_replay_trigger_groups_count",p$="$sdk_debug_replay_url_trigger_status",m$="$session_recording_start_reason",_w="PostHog loadExternalDependency extension not found.",To="anonymous",G0="identified",Z5="identified_only",sh="visibilitychange",Mm="beforeunload",xw="$pageview",bS="$pageleave",W5="$identify",SS="$groupidentify";function _u(t,e){Be(t)&&t.forEach(e)}function Tt(t,e){if(!nt(t))if(Be(t))t.forEach(e);else if((n=>n instanceof FormData)(t))t.forEach((n,r)=>e(n,r));else for(const n in t)uw.call(t,n)&&e(t[n],n)}const Bt=function(t,...e){for(const n of e)for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t};function K0(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 g$=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)}}},ww=function(t){const e={};return Tt(t,function(n,r){(at(n)&&n.length>0||pn(n))&&(e[r]=n)}),e};function q5(t){const e=H({},t);for(const n of["name","message","stack","cause","errors"])try{n in t&&(e[n]=t[n])}catch{}return e}const v$=["herokuapp.com","vercel.app","netlify.app"];function y$(t){const e=t==null?void 0:t.hostname;if(!at(e))return!1;const n=e.split(".").slice(-2).join(".");for(const r of v$)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 u2(t){return t.name==="ph_toolbar_internal"}const Lf=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 _$=class d2{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 d2(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 d2(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}},x$=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 _$.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 w$}};let G5=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&&(G5=t=>crypto.getRandomValues(t));var w$=class{nextUint32(){return this.Rt.length>this.$t||(G5(this.Rt),this.$t=0),this.Rt[this.$t++]}constructor(){this.Rt=new Uint32Array(8),this.$t=1/0}};let kS;const gi=()=>b$().toString(),b$=()=>(kS||(kS=new x$)).generate();let lf="";const S$=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;let tu=null;const on={Et(){if(!ln(tu))return tu;if(tu=!1,ue)try{const t=`__ph_cookie_support_${gi()}`;on.At(t,"xyz"),tu=Lf(t)==='"xyz"',on.Lt(t)}catch{tu=!1}return tu},Pt(t){ve.error("cookieStore error: "+t)},Ot:Lf,Dt(t){let e;try{e=JSON.parse(on.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(lf)return lf;if(!v||["localhost","127.0.0.1"].includes(g))return"";const x=g.split(".");let _=Math.min(x.length,8);const w="dmn_chk_"+gi();for(;!lf&&_--;){const b=x.slice(_).join("."),E=w+"=1;domain=."+b+";path=/";v.cookie=E+";max-age=3",v.cookie.includes(w)&&(v.cookie=E+";max-age=0",lf=b)}return lf})(d);if(!p){const g=(v=>{const x=v.match(S$);return x?x[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||!ln(Lf(t))))try{on.At(t,"",-1,e)}catch{return}}};let sy=null;const mt={Et(){if(!ln(sy))return sy;let t=!0;if(ce(J))t=!1;else try{const e="__mplssupport__";mt.At(e,"xyz"),mt.Ot(e)!=='"xyz"'&&(t=!1),mt.Lt(e)}catch{t=!1}return t||ve.error("localStorage unsupported; falling back to cookie store"),sy=t,t},Pt(t){ve.error("localStorage error: "+t)},Ot(t){try{return J==null?void 0:J.localStorage.getItem(t)}catch(e){mt.Pt(e)}return null},Dt(t){try{return JSON.parse(mt.Ot(t))||{}}catch{}return null},At(t,e){try{return J==null||J.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){mt.Pt(n)}return!1},Lt(t){try{J==null||J.localStorage.removeItem(t)}catch(e){mt.Pt(e)}}},iy=[Ra,Ao,mi,tc,Pa,nc,Da,rh,Ta],Fl=[mw,ci,vu,O5,yw,yu,Pu,Or],Om=t=>t+"_cpm",k$=["__proto__","constructor","prototype"],oy=t=>{if(!ut(t))return{};const e={};return Object.keys(t).forEach(n=>{k$.indexOf(n)===-1&&(e[n]=t[n])}),e},ay=(t,e=[])=>{const n={};return[...Fl,...e].forEach(r=>{const s=t[r];ce(s)||ln(s)||s===""||(n[r]=s)}),n},K5=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)},ES=(t,e)=>({p:e,f:K5(JSON.stringify(t))}),CS=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{const n=on.Dt(Om(t)),r=(n==null?void 0:n.f)===K5(e)&&Be(n.p);return{properties:r?n.p:[],isValid:r}}catch{return{properties:[],isValid:!1}}},ly=(t,e)=>e+"|"+(on.Ot(Om(t))||""),nu={},f2={Et:()=>!0,Pt(t){ve.error("memoryStorage error: "+t)},Ot:t=>t in nu?nu[t]:null,Dt:t=>t in nu?nu[t]:null,At:(t,e)=>(nu[t]=e,!0),Lt(t){delete nu[t]}};let kl=null;const Ht={Et(){if(!ln(kl))return kl;if(kl=!0,ce(J))kl=!1;else try{const t="__support__";Ht.At(t,"xyz"),Ht.Ot(t)!=='"xyz"'&&(kl=!1),Ht.Lt(t)}catch{kl=!1}return kl},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 E$=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 q1(t)?1:Ze(U7,t)?0:-1}get qo(){const t=this.Rr.opt_out_capturing_persistence_type,e=t==="localStorage"?mt:on,n=e.Et()?e:f2;if(!this.Bo||this.Bo!==n){this.Bo=n;const r=t==="localStorage"?on:mt;r.Ot(this.jo)&&(this.Bo.Ot(this.jo)||this.optInOut(q1(r.Ot(this.jo))),r.Lt(this.jo,this.Rr.cross_subdomain_cookie))}return this.Bo}Lo(){return!!this.Rr.respect_dnt&&[Yn==null?void 0:Yn.doNotTrack,Yn==null?void 0:Yn.msDoNotTrack,je.doNotTrack,Yn==null?void 0:Yn.globalPrivacyControl].some(t=>q1(t))}};function Y5(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 at(s)&&s?s:e}catch(s){return ve.error("Error in get_current_url, falling back to window.location.href",s),e}}function PS(t){var e;return t instanceof Element&&(t.id==="__POSTHOG_TOOLBAR__"||!!(!((e=t.closest)===null||e===void 0)&&e.call(t,".toolbar-global-fade-container")))}function Wi(t){return!!t&&t.nodeType===1}function hr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function X5(t){return!!t&&t.nodeType===3}function bw(t){return!!t&&t.nodeType===11&&Wi(t.host)}function Sw(t){return t?Pg(t).split(/\s+/):[]}function RS(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:Y5(r,i)})(e);return!!(n&&t&&t.some(r=>n.match(r)))}function Yu(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 Sw(e)}function Q5(t){return nt(t)?null:Pg(t).split(/(\s+)/).filter(e=>Df(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ih(t){let e="";return Ru(t)&&!oh(t)&&t.childNodes&&t.childNodes.length&&Tt(t.childNodes,function(n){var r;X5(n)&&n.textContent&&(e+=(r=Q5(n.textContent))!==null&&r!==void 0?r:"")}),Pg(e)}function Nf(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 kw=["a","button","form","input","select","textarea","label"];function h2(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 p2(t,e){if(ce(e))return!0;for(const n of t)if(e.some(r=>h2(n,r)))return!0;return!1}function J5(t){const e=t.parentNode;return!(!e||!Wi(e))&&e}const cy=[".ph-no-autocapture","[data-ph-no-autocapture]"],eR=["next","previous","prev",">","<"],C$=[...eR,"+","-","−","–"],AS=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,TS=[".ph-no-rageclick",".ph-no-capture"],P$=["","text","search","email","password","url","tel","number"];function tR(t,e){if(!J||Ew(t))return!1;let n,r,s;var i,o;if(Lr(e)?(n=!!e&&TS,r=void 0,s=!1):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:TS,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||!Wi(u))&&(!!hr(u,"textarea")||(hr(u,"input")?Ze(P$,(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}=nR(t,!1);return!(function(u,d){if(u===!1||ce(u))return!1;let f;if(u===!0)f=eR;else{if(!Be(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=>AS(p,v)||AS(g,v)))})(r,l.map(u=>{var d;return{safeText:ih(u).toLowerCase(),ariaLabel:((d=u.getAttribute("aria-label"))===null||d===void 0?void 0:d.toLowerCase().trim())||""}}))&&!p2(l,n)}const Ew=t=>!t||hr(t,"html")||!Wi(t),nR=(t,e)=>{if(!J||Ew(t))return{parentIsUsefulElement:!1,targetElementList:[]};let n=!1;const r=[t];let s=t;for(;s.parentNode&&!hr(s,"body");){if(bw(s.parentNode)){r.push(s.parentNode.host),s=s.parentNode.host;continue}const i=J5(s);if(!i)break;if(e||kw.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 Ru(t){const e=new Set;let n=0;for(let i=t;i.parentNode&&!hr(i,"body");i=i.parentNode){if(n++>=1e3||e.has(i))return!1;e.add(i);const o=Yu(i);if(Ze(o,"ph-sensitive")||Ze(o,"ph-no-capture"))return!1}if(Ze(Yu(t),"ph-include"))return!0;const r=t.type||"";if(at(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}const s=t.name||t.id||"";return!at(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 oh(t){return!!(hr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||hr(t,"select")||hr(t,"textarea")||t.getAttribute("contenteditable")==="true")}const IS=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}))$"),MS=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,R$=[16,15,14,13],A$=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),OS=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),LS=/[0-9A-Za-z_]/;function T$(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 Df(t,e=!0){return!(nt(t)||at(t)&&(t=Pg(t),(e?IS.test((t||"").replace(/[- ]/g,"")):(function(n){let r;for(MS.lastIndex=0;r=MS.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 R$){const u=o+l;if(i.length>=u){const d=i.slice(o,u);if(IS.test(d)&&T$(d))return!0}}}return!1})(t))||(e?A$.test(t):(function(n){let r;for(OS.lastIndex=0;r=OS.exec(n);){const s=r[1],i=r[3];if(!(s&&i&&LS.test(s)&&LS.test(i)))return!0}return!1})(t))))}function NS(t){let e=ih(t);return e=`${e} ${rR(t)}`.trim(),Df(e)?e:""}function rR(t){let e="";return t&&t.childNodes&&t.childNodes.length&&Tt(t.childNodes,function(n){var r;if(n&&((r=n.tagName)===null||r===void 0?void 0:r.toLowerCase())==="span")try{const s=ih(n);e=`${e} ${s}`.trim(),n.childNodes&&n.childNodes.length&&(e=`${e} ${rR(n)}`.trim())}catch(s){ve.error("[AutoCapture]",s)}}),e}function DS(t){return t.replace(/"|\\"/g,'\\"')}function I$(t){const e=t.attr__class;if(e)return Be(e)?e:Sw(e)}const f0=un("[Dead Clicks]"),M$=()=>!0,O$=t=>{var e;const n=!!(!((e=t.instance.persistence)===null||e===void 0)&&e.get_property(gw)),r=t.instance.config.capture_dead_clicks;return Lr(r)?r:!!ut(r)||n};var jS=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({[gw]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.zo(()=>{this.Uo()}):this.stop()}zo(t){var e,n,r;!((e=je.__PosthogExtensions__)===null||e===void 0)&&e.initDeadClicksAutocapture?t():(n=je.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this.instance,"dead-clicks-autocapture",s=>{s?f0.error("failed to load script",s):t()})}Uo(){var t;if(ue){if(!this.Ho&&(!((t=je.__PosthogExtensions__)===null||t===void 0)&&t.initDeadClicksAutocapture)){const e=ut(this.instance.config.capture_dead_clicks)?H({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.Ho=je.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.Ho.start(ue),f0.info("starting...")}}else f0.error("`document` not found. Cannot start.")}stop(){this.Ho&&(this.Ho.stop(),this.Ho=void 0,f0.info("stopping..."))}};const cf=un("[SegmentIntegration]");function $S(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 x=()=>v.anonymousId()||gi();l.config.get_device_id=x,f&&v.id()&&(l.register({distinct_id:v.id(),$device_id:x()}),l.persistence.set_property(Or,G0)),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||cf.warn("This browser does not have Promise support, and can not use the segment integration");const p=(g,v)=>{if(!v)return g;const x=!!d&&g.event.anonymousId===d&&!g.event.userId;x||g.event.userId||g.event.anonymousId===u.get_distinct_id()||(cf.info("No userId set, resetting PostHog"),u.reset()),x||(d=void 0),g.event.userId&&g.event.userId!==u.get_distinct_id()&&(cf.info("UserId set, identifying with PostHog"),u.identify(g.event.userId));let _=u.calculateEventProperties(v,g.event.properties);if(!nt(f)){const w=g.event.properties||{},b={};for(const C of Object.keys(_))uw.call(w,C)||(b[C]=_[C]);const E=((C,R)=>{const A=Be(C)?C:[C];let O=H({},R);for(const I of A)try{if(O=I(O),nt(O))return null}catch(T){return cf.error("Error in Segment filterProperties:",T),null}return O})(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,xw)},identify(g){return p(g,W5)},screen(g){return p(g,"$screen")}}})(t,l,{filterProperties:i})).then(()=>{e()},u=>{cf.error("Failed to register the Segment integration",u),e()})},n)}const sR="posthog-js";function iR(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)||[],x=v.map(b=>H(H({},b),{},{stacktrace:b.stacktrace?H(H({},b.stacktrace),{},{type:"raw",frames:(b.stacktrace.frames||[]).map(E=>H(H({},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:x,$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 w;return e&&n&&(_.$sentry_url=(r||"https://sentry.io/organizations/")+e+"/issues/?project="+n+"&query="+o.event_id),i&&((w=t.exceptions)===null||w===void 0||w.sendExceptionEvent(_)),o}}var L$=class{constructor(t,e,n,r,s,i){this.name=sR,this.setupOnce=function(o){o(iR(t,{organization:e,projectId:n,prefix:r,severityAllowList:s,sendExceptionsToPostHog:i==null||i}))}}},FS=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?Vi(o/i,0,1,ve):1,g=i>1?Vi(l/i,0,1,ve):1,v=u>1?Vi(d/u,0,1,ve):1,x=u>1?Vi(f/u,0,1,ve):1;r=Bt(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:x})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(t.getTime()-n.timestamp.getTime())/1e3),r}};const uf=["flags","surveys"],N$={[zj]:{exposure:"hidden"},[Tm]:{exposure:"hidden"},[Uj]:{exposure:"hidden"},[t2]:{exposure:"hidden"},[Pu]:{exposure:"hidden"},[If]:{exposure:"hidden"},[A5]:{exposure:"event"},[n2]:{exposure:"hidden"},[I5]:{exposure:"hidden"},[r2]:{exposure:"event"},[T5]:{exposure:"hidden"},[s2]:{exposure:"event"},[i2]:{exposure:"event"},[gw]:{exposure:"event"},[vw]:{exposure:"hidden"},[M5]:{exposure:"event"},[Mf]:{exposure:"hidden"},[Bj]:{exposure:"hidden"},[vu]:{exposure:"hidden"},[O5]:{exposure:"event"},[Zj]:{exposure:"event",shouldSkipFromEventProperties:t=>ln(t)},[Yj]:{exposure:"event"},[Xj]:{exposure:"event"},[Qj]:{exposure:"event"},[Jj]:{exposure:"event"},[e$]:{exposure:"hidden"},[mi]:{exposure:"hidden",storageGroup:"flags"},[Ao]:{exposure:"hidden",storageGroup:"flags"},[o2]:{exposure:"hidden"},[tc]:{exposure:"hidden",storageGroup:"flags"},[Pa]:{exposure:"hidden",storageGroup:"flags"},[nc]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Of]:{exposure:"hidden",storageGroup:"flags"},[Ti]:{exposure:"hidden"},[$l]:{exposure:"hidden"},[Ra]:{exposure:"hidden"},[Aa]:{exposure:"hidden"},[a2]:{exposure:"hidden",storageGroup:"surveys"},[Im]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[N5]:{exposure:"event"},[D5]:{exposure:"hidden"},[j5]:{exposure:"hidden"},[l2]:{exposure:"hidden"},[t$]:{exposure:"hidden"},[n$]:{exposure:"hidden"},[r$]:{exposure:"event"},[s$]:{exposure:"event"},[i$]:{exposure:"event"},[o$]:{exposure:"event"},[Ta]:{exposure:"hidden"},[bf]:{exposure:"hidden"},[L5]:{exposure:"event"},[rh]:{exposure:"hidden"},[Da]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Or]:{exposure:"hidden"},[c2]:{exposure:"hidden"},[a$]:{exposure:"hidden"},[$5]:{exposure:"hidden"},[F5]:{exposure:"hidden"},[yu]:{exposure:"hidden"},[yw]:{exposure:"hidden"},[Wj]:{exposure:"event"},[qj]:{exposure:"event"},[Gj]:{exposure:"event"},[Kj]:{exposure:"event"},[H5]:{exposure:"event"},[z5]:{exposure:"event"},[U5]:{exposure:"event"},[B5]:{exposure:"event"},[l$]:{exposure:"event"},[c$]:{exposure:"event"},[u$]:{exposure:"event"},[d$]:{exposure:"event"},[f$]:{exposure:"event"},[h$]:{exposure:"event"},[p$]:{exposure:"event"},[m$]:{exposure:"event"}},D$=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],nr=t=>{const e=N$[t];if(e)return e;for(const[n,r]of D$)if(t.indexOf(n)===0)return r},xu=(t,e)=>{try{let n;return JSON.stringify(t,(r,s)=>{var i;return fd(s)?((i=n)!==null&&i!==void 0||(n=new WeakMap),n.has(s)||n.set(s,q5(s)),n.get(s)):typeof s=="bigint"?s.toString():s},e)}catch{return TP(t)}},$o=t=>{const e=ue==null?void 0:ue.createElement("a");return ce(e)?null:(e.href=t,e)},Xu=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(!Be(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," ")}},ah=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("=");Be(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},Lm=function(t,e){const n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},oR=(t,e)=>t>=e&&AP(),aR=(t,e,n,r)=>{if(t===0){if(AP()){const s=e+1;return s===n&&r(),s}return e}return 0},Qu=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],j$=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Qu],lh="<masked>",$$=["li_fat_id"];function lR(t,e,n){if(!ue)return{};const r=e?[...Qu,...n||[]]:[],s=cR(ah(ue.URL,r,lh),t),i=(function(){const o={};return Tt($$,function(l){const u=Lf(l);o[l]=u||null}),o})();return Bt(i,s)}function cR(t,e){const n=j$.concat(e||[]),r={};return Tt(n,function(s){const i=Xu(t,s);r[s]=i||null}),r}function uR(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(!ln(e)){r.$search_engine=e;const s=ue?Xu(ue.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function dR(){return navigator.language||navigator.userLanguage}function F$(){const t=dR();return typeof t=="string"?t.split("-")[0]:void 0}const Nm="$direct";function fR(){return(ue==null?void 0:ue.referrer)||Nm}function hR(t,e,n=!1){const r=t?[...Qu,...e||[]]:[],s=n?Ha(an==null?void 0:an.href):an==null?void 0:an.href,i=s==null?void 0:s.substring(0,1e3);return{r:fR().substring(0,1e3),u:i?ah(i,r,lh):void 0}}function pR(t,e=!1){var n;const{r,u:s}=t,i=e?Ha(s):s,o={$referrer:r,$referring_domain:r==null?void 0:r==Nm?Nm:(n=$o(r))===null||n===void 0?void 0:n.host};if(i){o.$current_url=i;const l=$o(i);o.$host=l==null?void 0:l.host,o.$pathname=l==null?void 0:l.pathname;const u=cR(i);Bt(o,u)}if(r){const l=uR(r);Bt(o,l)}return o}function mR(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function V$(){try{return new Date().getTimezoneOffset()}catch{return}}const H$={flags:Da,surveys:Im},z$=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],h0=t=>`${t}_cookie_identity_change_pending`,p0=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",wo=[mi,Ao,tc,Pa,nc,Da,Of,Ra],uy=t=>wo.indexOf(t)!==-1,gR=[Pu,If],VS=t=>gR.indexOf(t)!==-1,ha=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch{return t===e}},ru=t=>{if(!t)return{};const e=JSON.parse(t);return ut(e)?e:{}},HS=(t,e)=>{Tt(t,(n,r)=>{const s=nr(r);s&&s.exposure!=="event"||{}.hasOwnProperty.call(e,r)||delete t[r]})};var dy=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,H({},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=uf.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(!uy(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=mt.Ot(t),ln(s)){const l=this.ya(e);return l.storageValue=null,e!==Dn&&(l.persisted=!1),!1}r=ru(s)}catch{return!1}const i=e===Dn?r:mt.Dt(this.ha);if(i&&this.ba(i))return!1;const o=this._a(r,e,n);return e===Dn&&this.Yo&&!ha(this.wa().main,r)||this.ka(r,e,!0,s),o}ba(t){const e=this.props[ci],n=t[ci];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 wo.forEach(s=>{var i;const o=(i=nr(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&&ha(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=mt.Ot(this.ha),e=this.ya(Dn);let n,r=!1,s=!1;if(t!==e.storageValue)if(ln(t))e.storageValue=null;else{if(n=ru(t),this.ra=!this.sa&&this.ba(n),this.ra)return!1;s=this._a(n,Dn,!1),!this.Yo||ha(this.wa().main,n)?this.ka(n,Dn,!0,t):e.storageValue=t,r=!0}return this.Yo&&uf.forEach(i=>{const o=mt.Ot(this.pa(i)),l=this.ya(i),u=n||{},d=r&&wo.some(p=>{var g;return((g=nr(p))===null||g===void 0?void 0:g.storageGroup)===i&&p in u});if(o===l.storageValue&&!d)return;if(ln(o))return l.storageValue=null,l.persisted=!1,void(d&&(s=this._a(u,i,!1)||s));const f=ru(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=nr(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(){wo.forEach(t=>this.ia.set(t,!0))}va(){if(this.Ko)try{const t=mt.Ot(this.ha),e=ru(t);this.ya(Dn).storageValue=t,wo.forEach(n=>{var r;const s=this.Yo?(r=nr(n))===null||r===void 0?void 0:r.storageGroup:void 0,i=s?mt.Ot(this.pa(s)):null;if(s){const l=this.ya(s);l.storageValue=i,l.persisted=!ln(i)}const o=s&&!ln(i)?ru(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(Be(e)?e:[]),o=new Set(Be(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)?H({},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(!uy(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=nr(t))===null||i===void 0?void 0:i.storageGroup:void 0,u=l?this.pa(l):this.ha;s=ru(mt.Ot(u))[t]}catch{}const o=new Set(r||[]);if(t==="$active_feature_flags"){if(!ce(e)&&!Be(e)||!ce(s)&&!Be(s)||!Be(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(ha(s,n)?this.ia.delete(t):this.ma(t,!0));{if(!ce(e)&&!ut(e)||ce(e)&&qr(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&&ha(l[d],n[d])||o.add(d)}),o.forEach(d=>{d in u==d in n&&ha(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=ay(t,this.Rr.cookie_persisted_properties||[]),n=ES(e,this.Rr.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(n),s=on.Ot(this.ha)||void 0;s&&ly(this.ha,s)===r&&(this.Aa=r,this.Fa=s)}catch{}else try{const e=on.Ot(this.ha)||void 0;this.Aa=e?ly(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=on.Ot(this.ha)||void 0}catch{}if(!n||n===this.Fa)return!1;const r=ly(this.ha,n);let s;try{s=oy(JSON.parse(n))}catch{return!1}if((on.Ot(this.ha)||void 0)!==n)return!1;this.Aa=r,this.Fa=n;const i=CS(this.ha,n),o=[...Fl,...i.properties],l={};if(Object.keys(s).forEach(_=>{const w=s[_];(ce(w)||ln(w)||w===""||_==="$user_state"&&w!=="anonymous"&&w!=="identified")&&(l[_]=!0,delete s[_])}),qr(s))return!1;const u="distinct_id"in s||s.$user_state==="anonymous"||s.$user_state==="identified",d=this.props,f=d[ci],p=d[Or],g=Bt({},d);[...Fl,...t.cookie_persisted_properties||[]].forEach(_=>{if(o.indexOf(_)!==-1&&!(_ in s)&&!l[_]&&(u||_!=="distinct_id"&&_!=="$user_state")){const w=g[_];(i.isValid||Fl.indexOf(_)===-1||w!==!1&&w!==0)&&delete g[_]}}),this.props=Bt(g,s),wo.forEach(_=>{const w=_ in this.props;_ in d===w&&ha(d[_],this.props[_])||(w?this.Ea(_,d[_],this.props[_]):this.ma(_,!0))}),!u||"$user_state"in s||"$user_state"in this.props||this.Ca(Or,To);const v=this.props[ci],x=this.props[Or];return!u||v===f&&x===p||(this.sa=!0,this.ta=!0,Ht.At(h0(this.ha),!0),this.$a(Ra),this.$a(Ao),this.$a(mi),this.$a(tc),this.$a(Pa),this.$a(nc),this.$a(Da),this.$a(rh),this.$a(Ta),x!=="anonymous"||p!=="identified"&&s.$user_state!=="anonymous"&&(ce(f)||v===f)||(HS(this.props,s),this.$a(Aa)),x==="identified"?this.props.$user_id=v:delete this.props.$user_id,this.$a(Tm)),!0}consumeCookieIdentityChange(){const t=h0(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){z$.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=[...Fl,...o];return H(H({},mt),{},{Dt(d){try{let p,g={};try{p=on.Ot(d)||void 0,g=p?oy(JSON.parse(p)):{}}catch{}const v=JSON.parse(mt.Ot(d)||"{}");let x;if(l){const _=CS(d,p),w=[...Fl,..._.properties],b={};Object.keys(g).forEach(C=>{const R=g[C];ln(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[ci],R=(f=v.$user_state)!==null&&f!==void 0?f:To;u.forEach(A=>{if(w.indexOf(A)!==-1&&!(A in g)&&(E||A!=="distinct_id"&&A!=="$user_state")){const O=v[A];(_.isValid||Fl.indexOf(A)===-1||O!==!1&&O!==0)&&delete v[A]}}),!E||"$user_state"in g||"$user_state"in v||(v[Or]=To),!E||("distinct_id"in b?b[ci]:v[ci])===C&&("$user_state"in b?b[Or]:v[Or])===R||(iy.forEach(A=>delete v[A]),b.$user_state==="identified"&&"distinct_id"in b?v.$user_id=b[ci]:delete v.$user_id,b.$user_state!=="identified"&&(delete v[L5],delete v[Aa]),delete v.__alias)}x=Bt(v,b)}else x=Bt(g,v);return mt.At(d,x),x}catch{}return null},At(d,f,p,g,v,x){const _=mt.At(d,f,void 0,void 0,x);try{const w=ay(f,o);if(Object.keys(w).length){if(l){const b=Om(d),E=ES(w,o);if(on.At(b,E,p,g,v,x),on.Ot(b)!==JSON.stringify(E)){on.Lt(b,g);const C=ay(f);return on.At(d,C,p,g,v,x),_}}on.At(d,w,p,g,v,x)}}catch(w){mt.Pt(w)}return _},Lt(d,f){try{J==null||J.localStorage.removeItem(d),on.Lt(d,f),on.Lt(Om(d),f)}catch(p){mt.Pt(p)}}})})(t.cookie_persisted_properties||[],t.cookieWinsOnConflict);let n,r=!1,s=!1;const i=t.persistence.toLowerCase();return i==="localstorage"&&mt.Et()?(n=mt,s=!0):i==="localstorage+cookie"&&e.Et()?(n=e,s=!0,r=!0):i==="sessionstorage"&&Ht.Et()?n=Ht:i==="memory"?n=f2:i==="cookie"&&on.Et()?(n=on,r=!0):e.Et()?(n=e,s=!0,r=!0):on.Et()?(n=on,r=!0):n=f2,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 Tt(this.props,(e,n)=>{const r=nr(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?mt.Dt(this.ha):null;let r={};if(e)try{r=oy(on.Dt(this.ha)),Tt(r,(l,u)=>{(ce(l)||ln(l)||l==="")&&delete r[u]})}catch{}const s=this.qo.Dt(this.ha);if(s&&(this.props=Bt({},s)),this.Yo&&this.Ba(),e&&s){var i,o;const l=n==null?void 0:n[ci],u=(i=n==null?void 0:n.$user_state)!==null&&i!==void 0?i:To,d=s[ci],f=(o=s.$user_state)!==null&&o!==void 0?o:To;if(d!==l||f!==u){this.ta=!0,Ht.At(h0(this.ha),!0);const p=Bt({},this.props);iy.forEach(v=>delete p[v]),f!=="anonymous"||u!=="identified"&&r.$user_state!=="anonymous"&&(ce(l)||d===l)||(HS(p,r),delete p[Aa]),this.props=p;const g=new Set;iy.forEach(v=>{var x;const _=(x=nr(v))===null||x===void 0?void 0:x.storageGroup;_&&g.add(_)}),g.forEach(v=>{const x={};Tt(this.props,(_,w)=>{var b;((b=nr(w))===null||b===void 0?void 0:b.storageGroup)===v&&(x[w]=_)}),qr(x)?(mt.Lt(this.pa(v)),this.Jo[v]={}):mt.At(this.pa(v),x)&&(this.Jo[v]={persisted:!0,fingerprint:this.Sa(x,v)})})}}Ht.Ot(h0(this.ha))&&(this.ta=!0)}Ba(){for(const t of uf){const e=mt.Dt(this.pa(t));if(e&&!qr(e)){const n=this.ya(t);n.persisted=!0,this.Ha(t)||(n.fingerprint=this.Sa(e,t)),this.za(t,e)||Bt(this.props,e)}}}Ha(t){return Object.keys(this.props).some(e=>{var n;return((n=nr(e))===null||n===void 0?void 0:n.storageGroup)===t})}za(t,e){const n=H$[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=nr(t))===null||e===void 0?void 0:e.storageGroup:void 0,r=n?mt.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"||gR.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(),wo.forEach(s=>{var i;!((i=nr(s))===null||i===void 0)&&i.storageGroup||this.ia.delete(s)}));for(const s of uf){var r;const i=e[s];if(qr(i)&&!(!((r=this.Jo[s])===null||r===void 0)&&r.persisted)){wo.forEach(l=>{var u;((u=nr(l))===null||u===void 0?void 0:u.storageGroup)===s&&this.ia.delete(l)});continue}const o=this.Wa(mt,this.pa(s),i,s);o!=="failed"&&wo.forEach(l=>{const u=nr(l);(u==null?void 0:u.storageGroup)!==s||o!=="written"&&u.volatile||this.ia.delete(l)})}}wa(){const t={},e={flags:{},surveys:{}};return Tt(this.props,(n,r)=>{var s;const i=(s=nr(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 Tt(t,(r,s)=>{var i;n[s]=!((i=nr(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=mt.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 uf)mt.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(Tt(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(Tt(t,(r,s)=>{t.hasOwnProperty(s)&&(this.props[s]!==r||ut(r)||Be(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=lR(this.Rr.custom_campaign_params,this.Rr.mask_personal_data_properties,this.Rr.custom_personal_data_properties),n=!qr(ww(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?uR(t):{}})())}update_referrer_info(){var t;this.register_once({$referrer:fR(),$referring_domain:(ue==null?void 0:ue.referrer)&&((t=$o(ue.referrer))===null||t===void 0?void 0:t.host)||Nm},void 0)}set_initial_person_info(){if(this.props.$initial_campaign_params||this.props.$initial_referrer_info)return;const t=hR(this.Rr.mask_personal_data_properties,this.Rr.custom_personal_data_properties,this.Rr.disable_capture_url_hashes);this.register_once({[yu]:this.Xo?{r:p0(t.r),u:t.u?p0(t.u):void 0}:t},void 0)}get_initial_props(){const t={};Tt([F5,$5],n=>{const r=this.props[n];r&&Tt(r,function(s,i){t["$initial_"+q_(i)]=s})});const e=this.props[yu];if(e){const n=(function(r,s=!1){const i=pR(r,s),o={};return Tt(i,function(l,u){o[`$initial_${q_(u)}`]=l}),o})(e,this.Rr.disable_capture_url_hashes);Bt(t,n)}return t}safe_merge(t){return Tt(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,x)=>{if(v.length!==x.length)return!1;const _=[...v].sort(),w=[...x].sort();return _.every((b,E)=>b===w[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(H(H({},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[yu];if(!this.Xo||!ut(t)||typeof t.r!="string")return;const e=p0(t.r),n=typeof t.u=="string"?p0(t.u):t.u;e===t.r&&n===t.u||this.Ca(yu,H(H({},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(t2,n),this.save()}remove_event_timer(t){const e=this.props.__timers||{},n=e[t];return ce(n)||(delete e[t],this.Ca(t2,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),VS(t)&&!ha(s,e)&&this.oa.add(t),this.Ea(t,s,e),!((r=nr(t))===null||r===void 0)&&r.volatile||this.Ia(t))}$a(t,e=!0){delete this.props[t],e&&(uy(t)&&this.ma(t,!0),VS(t)&&this.oa.add(t),this.Ia(t))}Ia(t){var e;const n=(e=nr(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 gs={GZipJS:"gzip-js",Base64:"base64"},df={Activation:"events",Cancellation:"cancelEvents"},fy={Popover:"popover",API:"api",Widget:"widget"},Io={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},hy={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},m2={Popover:"popover",Inline:"inline"};function m0(t){let e=!0;return{dispose(){if(e){e=!1;const n=t();n&&Gn(n.then)&&n.then(void 0,()=>{})}}}}const U$={SHOWN:"product tour shown"},zS={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},US=un("[RateLimiter]");var B$=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=>{US.info(`${r||"events"} is quota limited.`),this.serverLimits[r]=new Date().getTime()+6e4})}catch(r){return void US.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!Be(e)||!e.includes(t)}Ya(){var t;if(this.Xa("$current_url")&&this.Xa("$pathname")&&(an!=null&&an.pathname))return`${(t=an.origin)!==null&&t!==void 0?t:""}${an.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 pa=un("[RemoteConfig]");var vR=class{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=je._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=je.__PosthogExtensions__)===null||e===void 0)&&e.loadExternalDependency?(n=je.__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 pa.info("Using preloaded remote config",this.remoteConfig),void this.il(this.remoteConfig);if(this._instance.nl())return void pa.warn("Remote config is disabled. Falling back to local config.");this.tl(t=>{if(!t)return pa.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){pa.error("Error loading remote config",t),this.il()}}il(t,e){!t&&e&&(e.statusCode===0?e.error||pa.warn("Failed to fetch remote config from PostHog."):pa.error("Failed to fetch remote config from PostHog."));try{this._instance.il(t?{ok:!0,config:t}:{ok:!1})}catch(r){pa.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){pa.error("Error loading feature flags",r)}}},qs=Uint8Array,Kr=Uint16Array,Ju=Uint32Array,Cw=new qs([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]),Pw=new qs([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]),BS=new qs([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),yR=function(t,e){for(var n=new Kr(31),r=0;31>r;++r)n[r]=e+=1<<t[r-1];var s=new Ju(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]},_R=yR(Cw,2),g2=_R[1];_R[0][28]=258,g2[258]=28;for(var ZS=yR(Pw,0)[1],xR=new Kr(32768),cn=0;32768>cn;++cn){var su=(43690&cn)>>>1|(21845&cn)<<1;xR[cn]=((65280&(su=(61680&(su=(52428&su)>>>2|(13107&su)<<2))>>>4|(3855&su)<<4))>>>8|(255&su)<<8)>>>1}var jf=function(t,e,n){for(var r=t.length,s=0,i=new Kr(e);r>s;++s)++i[t[s]-1];var o,l=new Kr(e);for(s=0;e>s;++s)l[s]=l[s-1]+i[s-1]<<1;for(o=new Kr(r),s=0;r>s;++s)o[s]=xR[l[t[s]-1]++]>>>15-t[s];return o},uc=new qs(288);for(cn=0;144>cn;++cn)uc[cn]=8;for(cn=144;256>cn;++cn)uc[cn]=9;for(cn=256;280>cn;++cn)uc[cn]=7;for(cn=280;288>cn;++cn)uc[cn]=8;var Dm=new qs(32);for(cn=0;32>cn;++cn)Dm[cn]=5;var Z$=jf(uc,9),W$=jf(Dm,5),wR=function(t){return(t/8|0)+(7&t&&1)},bR=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof Kr?Kr:t instanceof Ju?Ju:qs)(n-e);return r.set(t.subarray(e,n)),r},po=function(t,e,n){var r=e/8|0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},ff=function(t,e,n){var r=e/8|0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},py=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 qs(0),0];if(s==1){var o=new qs(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(A,O){return A.f-O.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 Kr(g+1),x=v2(n[f-1],v,0);if(x>e){r=0;var _=0,w=x-e,b=1<<w;for(i.sort(function(A,O){return v[O.s]-v[A.s]||A.f-O.f});s>r;++r){var E=i[r].s;if(e>=v[E])break;_+=b-(1<<x-v[E]),v[E]=e}for(_>>>=w;_>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],++_)}x=e}return[new qs(v),x]},v2=function(t,e,n){return t.s==-1?Math.max(v2(t.l,e,n+1),v2(t.r,e,n+1)):e[t.s]=n},WS=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Kr(++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]},hf=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},y2=function(t,e,n){var r=n.length,s=wR(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)},qS=function(t,e,n,r,s,i,o,l,u,d,f){po(e,f++,n),++s[256];for(var p=py(s,15),g=p[0],v=p[1],x=py(i,15),_=x[0],w=x[1],b=WS(g),E=b[0],C=b[1],R=WS(_),A=R[0],O=R[1],I=new Kr(19),T=0;E.length>T;++T)I[31&E[T]]++;for(T=0;A.length>T;++T)I[31&A[T]]++;for(var M=py(I,7),N=M[0],j=M[1],$=19;$>4&&!N[BS[$-1]];--$);var K,B,z,Z,Q=d+5<<3,U=hf(s,uc)+hf(i,Dm)+o,ee=hf(s,g)+hf(i,_)+o+14+3*$+hf(I,N)+(2*I[16]+3*I[17]+7*I[18]);if(U>=Q&&ee>=Q)return y2(e,f,t.subarray(u,u+d));if(po(e,f,1+(U>ee)),f+=2,U>ee){K=jf(g,v),B=g,z=jf(_,w),Z=_;var W=jf(N,j);for(po(e,f,C-257),po(e,f+5,O-1),po(e,f+10,$-4),f+=14,T=0;$>T;++T)po(e,f+3*T,N[BS[T]]);f+=3*$;for(var D=[E,A],X=0;2>X;++X){var oe=D[X];for(T=0;oe.length>T;++T)po(e,f,W[re=31&oe[T]]),f+=N[re],re>15&&(po(e,f,oe[T]>>>5&127),f+=oe[T]>>>12)}}else K=Z$,B=uc,z=W$,Z=Dm;for(T=0;l>T;++T)if(r[T]>255){var re;ff(e,f,K[257+(re=r[T]>>>18&31)]),f+=B[re+257],re>7&&(po(e,f,r[T]>>>23&31),f+=Cw[re]);var se=31&r[T];ff(e,f,z[se]),f+=Z[se],se>3&&(ff(e,f,r[T]>>>5&8191),f+=Pw[se])}else ff(e,f,K[r[T]]),f+=B[r[T]];return ff(e,f,K[256]),f+B[256]},q$=new Ju([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),G$=(function(){for(var t=new Ju(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),my=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function K$(t,e){e===void 0&&(e={});var n=(function(){var p=4294967295;return{p(g){for(var v=p,x=0;g.length>x;++x)v=G$[255&v^g[x]]^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,x,_,w){var b=p.length,E=new qs(x+b+5*(1+Math.floor(b/7e3))+_),C=E.subarray(x,E.length-_),R=0;if(!g||8>b)for(var A=0;b>=A;A+=65535){var O=A+65535;b>O?R=y2(C,R,p.subarray(A,O)):(C[A]=w,R=y2(C,R,p.subarray(A,b)))}else{for(var I=q$[g-1],T=I>>>13,M=8191&I,N=(1<<v)-1,j=new Kr(32768),$=new Kr(N+1),K=Math.ceil(v/3),B=2*K,z=function(Ot){return(p[Ot]^p[Ot+1]<<K^p[Ot+2]<<B)&N},Z=new Ju(25e3),Q=new Kr(288),U=new Kr(32),ee=0,W=0,D=(A=0,0),X=0,oe=0;b>A;++A){var re=z(A),se=32767&A,fe=$[re];if(j[se]=fe,$[re]=se,A>=X){var _e=b-A;if((ee>7e3||D>24576)&&_e>423){R=qS(p,C,0,Z,Q,U,W,D,oe,A-oe,R),D=ee=W=0,oe=A;for(var de=0;286>de;++de)Q[de]=0;for(de=0;30>de;++de)U[de]=0}var ae=2,Oe=0,ke=M,Ge=se-fe&32767;if(_e>2&&re==z(A-Ge))for(var vt=Math.min(T,_e)-1,Mt=Math.min(32767,A),Xt=Math.min(258,_e);Mt>=Ge&&--ke&&se!=fe;){if(p[A+ae]==p[A+ae-Ge]){for(var xt=0;Xt>xt&&p[A+xt]==p[A+xt-Ge];++xt);if(xt>ae){if(ae=xt,Oe=Ge,xt>vt)break;var yt=Math.min(Ge,xt-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[D++]=268435456|g2[ae]<<18|ZS[Oe];var Re=31&g2[ae],Ye=31&ZS[Oe];W+=Cw[Re]+Pw[Ye],++Q[257+Re],++U[Ye],X=A+ae,++ee}else Z[D++]=p[A],++Q[p[A]]}}R=qS(p,C,w,Z,Q,U,W,D,oe,A-oe,R)}return bR(E,0,x+wR(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&&my(p,4,Math.floor(new Date(g.mtime||Date.now())/1e3)),v){p[3]=8;for(var x=0;v.length>=x;++x)p[x+10]=v.charCodeAt(x)}})(d,e),my(d,f-8,n.d()),my(d,f-4,r),d}const Y$=!!cw||!!th,SR=new WeakMap,kR="text/plain";let gy=0,Y0=!1;const ER=(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}`:""}`},Uh=(t,e,n=!0)=>{var r;const[s,i]=t.split("?"),o=H({},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 Tt(d,function(x,_){ce(x)||ce(_)||_==="undefined"||(p=encodeURIComponent((w=>w instanceof File)(x)?x.name:x.toString()),g=encodeURIComponent(_),v[v.length]=g+"="+p)}),v.join(f)})(o);return u&&l.push(u),l.length>0?`${s}?${l.join("&")}`:s},vy=t=>{if(t.sl)return t.sl;const{data:e,compression:n}=t;if(!e)return;if(n===gs.GZipJS){const s=K$((function(i){var o=i.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(i);for(var l=new qs(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 qs(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 bR(l,0,u)})(xu(e)),{mtime:0});return{contentType:kR,body:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),estimatedSize:s.byteLength}}if(n===gs.Base64){const s=(function(o){return o&&btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,(l,u)=>String.fromCharCode(parseInt(u,16))))})(xu(e)),i=(o=>"data="+encodeURIComponent(typeof o=="string"?o:xu(o)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}const r=xu(e);return{contentType:"application/json",body:r,estimatedSize:new Blob([r]).size}},CR=t=>{const e=()=>t.transport==="sendBeacon"?{url:Uh(t.url,{compression:gs.Base64}),encodedBody:vy(H(H({},t),{},{compression:gs.Base64,sl:void 0}))}:{url:ER(t.url,"compression"),encodedBody:vy(H(H({},t),{},{compression:void 0,sl:void 0}))};let n;try{n=vy(t)}catch(s){if(hS(t.compression,Xu(t.url,"compression")))return ve.error("Failed to gzip request body, sending uncompressed payload",s),e();throw s}return n&&hS(t.compression,Xu(t.url,"compression"))&&!((r=n.body)instanceof ArrayBuffer?J_(new Uint8Array(r)):ArrayBuffer.isView(r)&&J_(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)))?(Y0=!0,e()):{url:t.url,encodedBody:n};var r},PR=t=>{try{return CR(t)}catch(n){var e;return ve.error(n),void((e=t.callback)===null||e===void 0||e.call(t,{statusCode:0,error:n}))}},X$=(function(){var t=qt(function*(e){const n=yield(function(s){return e2.apply(this,arguments)})(xu(e.data),Vn.DEBUG,{rethrow:!0});if(!n)return e;const r=yield n.arrayBuffer();return H(H({},e),{},{sl:{contentType:kR,body:r,estimatedSize:r.byteLength}})});return function(e){return t.apply(this,arguments)}})(),Q$=/Failed to fetch|NetworkError|Load failed/i,RR=t=>(t==null?void 0:t.name)==="TypeError"&&Q$.test((t==null?void 0:t.message)||""),AR=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,q0):void 0})(t());return ce(e)?void 0:Math.min(e,3e4)}catch{return}},TR=t=>{const e=PR(t);if(!e)return;const n=new cw;SR.set(n,!0);const{url:r,encodedBody:s}=e;n.open(t.method||"GET",r,!0);const{contentType:i,body:o}=s??{};Tt(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,AR(()=>n.getResponseHeader("Retry-After")))}},n.send(o)},IR=t=>{const e=PR(t);if(!e)return;const{url:n,encodedBody:r}=e,{contentType:s,body:i,estimatedSize:o}=r??{},l=new Headers;Tt(t.headers,function(x,_){l.append(_,x)}),s&&l.append("Content-Type",s);let u=null,d=!1;if(Q8){const x=new Q8;u={signal:x.signal,timeout:setTimeout(()=>{d=!0;try{x.abort(u5("AbortError","PostHog request timed out"+((_=t.timeout)?` after ${_}ms`:"")))}catch(w){p(w)}var _},t.timeout)}}let f=!1;const p=x=>{var _;f||(f=!0,d&&(x==null?void 0:x.name)==="AbortError"||RR(x)?ve.warn(x):ve.error(x),(_=t.callback)===null||_===void 0||_.call(t,{statusCode:0,error:x}))};let g=0;const v=()=>{gy-=g,g=0,u&&clearTimeout(u.timeout)};try{const x=H({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);x.keepalive=x.method==="POST"&&!t.rl&&x.keepalive!==!1&&x.body===i&&!ce(_)&&_>=0&&52428.8>gy+_,x.keepalive&&(g=_,gy+=g),th(n,x).then(w=>w.text().then(b=>{var E;if(f)return;const C={statusCode:w.status,text:b};if(w.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,AR(()=>w.headers.get("Retry-After")))})).catch(w=>{v(),p(w)}).finally(v)}catch(x){v(),p(x)}},_2=t=>{try{var e;const{url:n,encodedBody:r}=CR(t),{contentType:s,body:i,estimatedSize:o}=r??{};if(!i)return;const l=i instanceof Blob?i:new Blob([i],{type:s});if(Yn.sendBeacon(n,l))return;const u=Be(t.data)?t.data:(e=t.data)===null||e===void 0?void 0:e.batch;if(Be(u)&&u.length>1&&(o??0)>16384){const d=Math.ceil(u.length/2),f=p=>Be(t.data)?p:H(H({},t.data),{},{batch:p});return _2(H(H({},t),{},{data:f(u.slice(0,d))})),void _2(H(H({},t),{},{data:f(u.slice(d))}))}ve.warn(`Beacon of ~${o??0} bytes was rejected by the browser, falling back to ${th?"fetch":"XHR"}`),th?IR(H(H({},t),{},{rl:!0})):TR(t)}catch(n){ve.warn("Beacon send failed",n)}},GS=(t,e,n,r)=>{const s=r==="query"?e==="POST"?"sent_at":"_":void 0;return Uh(n===gs.GZipJS?ER(t,"compression"):t,H(H({},s?{[s]:Date.now().toString()}:{}),n===gs.GZipJS?{}:{compression:n}))},J$=(()=>{const t=[];return th&&t.push({transport:"fetch",method:IR}),cw&&t.push({transport:"XHR",method:TR}),Yn!=null&&Yn.sendBeacon&&t.push({transport:"sendBeacon",method:_2}),t})();let MR=!Y$&&(Mr==null?void 0:Mr.indexOf("MSIE"))===-1&&(Mr==null?void 0:Mr.indexOf("Mozilla"))===-1;function OR(t,e,n){var r,s,i;n&&(e=H(H({},e),{},{callback:o=>n(o)})),t.__loaded?MR?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=H(H({},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=H(H({},o),{},{callback:l??(w=>{var b;return(b=o.callback)===null||b===void 0?void 0:b.call(o,w)})});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=gs.Base64),p.method==="POST"&&p.data&&(p.timestampMode==="capture-body"?p.data=(w=>{var b,E;const C=(Be(w)?w:[w]).map(A=>H(H({},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=((w,b=new Date().toISOString())=>Be(w)?w.map(E=>H(H({},E),{},{sent_at:b})):H(H({},w),{},{sent_at:b}))(p.data))),p.url=GS(p.url,p.method,p.compression,p.timestampMode);const v=J$.filter(w=>!p.disableTransport||!w.transport||!p.disableTransport.includes(w.transport)),x=(d=(f=(function(w,b){for(let E=0;w.length>E;E++)if(b(w[E]))return w[E]})(v,w=>w.transport===g))===null||f===void 0?void 0:f.method)!==null&&d!==void 0?d:v[0].method;if(!x)throw new Error("No available transport method");const _=w=>{try{x(w)}catch(E){var b;RR(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===gs.GZipJS&&D7&&typeof Promise<"u"&&!Y0?X$(p).then(w=>{_(w)}).catch(w=>{if(pS(w))return Y0=!0,void _(H(H({},p),{},{compression:void 0,url:GS(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 pS(b)||E===v5})(w)&&(Y0=!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 eF=class{constructor(t,e){this.ol=!0,this.al=[],this.ll=Vi((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 Tt(this.al,e=>{var n;const r=e,s=((r?r.batchKey:null)||r.url)+(r.batchGroup?`:${r.batchGroup}`:"");ce(t[s])&&(t[s]=H(H({},r),{},{data:[]})),(n=t[s].data)===null||n===void 0||n.push(r.data)}),this.al=[],t}};const tF=["retriesPerformedSoFar"];var nF=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=y5(t,tF);xo(n)&&(r.url=Uh(r.url,{retry_count:n})),OR(this._instance,e?H(H({},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(H({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(H(H({},t),{},{transport:"sendBeacon"}))}catch(e){ve.error(e)}this.al=[]}},rF=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=Be(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 sF=t=>hR(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 KS=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({[c2]:o})},this._instance=t,this.El=e,this.Ml=n,this.Il=r||sF,this.El.onSessionId(this.Be)}Tl(){return this.Ml.props[c2]}getSetOnceProps(){var t;const e=(t=this.Tl())===null||t===void 0?void 0:t.props;return e?"r"in e?pR(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 Tt(ww(this.getSetOnceProps()),(e,n)=>{n==="$current_url"&&(n="url"),t[`$session_entry_${q_(n)}`]=e}),t}},jm=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 iu=un("[SessionId]"),YS=864e5;var XS=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 jm,this.Nl=(i,o)=>!(!xo(i)||!xo(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||gi,this.Bl=n||gi;const s=this.Rr.persistence_name||this.Rr.token;if(this._sessionTimeoutMs=1e3*Vi(this.Rr.session_idle_timeout_seconds||1800,60,36e3,iu.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!ln(e)&&!ln(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({[vu]:[e,t,n]}))}Kl(){var t;const e=(t=this.Rr)===null||t===void 0?void 0:t.persistence_save_debounce_ms;return xo(e)&&e>0}Xl(){this.Kl()?this.Ml.refreshKey(vu):(this.Ml.flush(),this.Ml.load())}Yl(){var t;if(ln(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({[vu]:[this._sessionActivityTimestamp,(t=this.Xt)!==null&&t!==void 0?t:null,this._sessionStartTimestamp]}),this.Ml.flush())}eu(){const[t]=this.tu(),e=xo(t)?t:0,n=xo(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[vu];return Be(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 iu.error("Bootstrap sessionID cannot be in the future"):i}catch(i){return void iu.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(Mm,this.Dl,{capture:!1}),this.Dl=void 0),this.Ol=[]}Vl(){this.Dl=()=>{this.Yl(),this.Wl()&&Ht.Lt(this.Ul)},Et(J,Mm,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(ln(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>YS),x=g?v:xo(u)&&Math.abs(r-u)>YS;let _=!1,w=d,b=!l||!!g;const E=l;let C=!b&&!t&&this.Nl(r,f);if(C&&(C=this.iu(r),C||iu.info("cross-tab refresh kept the session alive",{sessionId:l}),[,l,u]=this.tu(),C||(b=!l||!!g)),b||C||x){w=!1;const I=g&&!v;l=I?g.sessionId:this.jl(),p=this.Bl(),iu.info("new session ID assigned",{sessionId:l,windowId:p,bootstrapped:!!I,changeReason:{noSessionId:b,activityTimeout:C,sessionPastMaximumLength:x}}),u=I?g.sessionStartTimestamp:r,this.ql=void 0,_=!0}else p||(p=this.Bl(),_=!0),w=w||l!==E,w&&(iu.info("adopted cross-tab session id",{sessionId:l,windowId:p}),_=!0);const R=xo(f)&&t&&!x?f:r,A=xo(u)?u:new Date().getTime();this.Gl(p),this.Jl(l,R,A),t||this.Hl();const O={noSessionId:b,activityTimeout:C,sessionPastMaximumLength:x,crossTabAdoption:w};return _&&this.Ol.forEach(I=>I(l,p,O)),{sessionId:l,windowId:p,sessionStartTimestamp:A,changeReason:_?O: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 LR=function(t,e){if(!t)return!1;const n=t.userAgent;if(n&&eS(n,e))return!0;try{const r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some(s=>eS(s==null?void 0:s.brand,e)))return!0}catch{}return!!t.webdriver};function NR(){return(NR=qt(function*(){const t=Yn==null?void 0:Yn.userAgentData;if(t!=null&&t.getHighEntropyValues)try{const e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return at(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 iF(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 DR(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 $m=(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}},g0=t=>t.toLowerCase(),jR={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=>$m(n,r))),not_regex:(t,e)=>e.every(n=>t.every(r=>!$m(n,r))),icontains:(t,e)=>e.map(g0).some(n=>t.map(g0).some(r=>n.includes(r))),not_icontains:(t,e)=>e.map(g0).every(n=>t.map(g0).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 $R(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=jR[r.operator];return!!i&&i(r.values.map(String),[String(s)])})}function yy(t,e,n){return xu({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}const x2="custom",QS="i.posthog.com",oF=/^\/static\//,aF=["/s/","/e/","/i/"];var lF=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(`.${QS}`,".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":x2),this.su[this.apiHost]}ru(t){if(!oF.test(t))return;const e=this.instance.config.asset_host;return typeof e=="string"&&e.trim().replace(/\/$/,"")||void 0}ou(t){const e=$o(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=$o(n))===null||i===void 0?void 0:i.href)||n;r=s(new URL(o)).toString()}if(s&&t==="api"&&aF.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===x2)return this.au(t,e,this.apiHost+e);const n=QS+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 Rt=un("[Surveys]"),FR=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){Rt.error("Failed to persist survey seen state",e)}},cF=[fy.Popover,fy.Widget,fy.API],uF={ignoreConditions:!1,ignoreDelay:!1,displayType:m2.Popover},dF=un("[PostHog ExternalIntegrations]"),fF={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};var hF=class{constructor(t){this._instance=t}zo(t,e){var n,r;(n=je.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,t,s=>{if(s)return dF.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=je.__PosthogExtensions__)===null||e===void 0||(e=e.integrations)===null||e===void 0)&&e[s])&&this.zo(fF[s],()=>{var o;(o=je.__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=je.__PosthogExtensions__)===null||n===void 0||(n=n.integrations)===null||n===void 0)&&n[s])&&((r=je.__PosthogExtensions__)===null||r===void 0||(r=r.integrations)===null||r===void 0||(r=r[s])===null||r===void 0||r.stop())}}},pF=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)}}},mF=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 JS="extensionsRemoteConfig";var gF=class{constructor(t){this.instance=t,this.Io=!1,this.$=ve,this.cu=t.du,this.kv=new mF(t),this.onEvent=e=>m0(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 m0(()=>{});const n=s=>{try{e(s)}catch(i){this.$.error("Browser extension remote config listener failed",i)}},r=this.instance.vu.on(JS,n);return this.cu&&n(this.cu),m0(r)},this.fu=new pF(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(mw);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 m0(this.instance.pu(t))}handleRemoteConfig(t){this.Io||(this.cu=t,this.instance.vu.emit(JS,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?Uh(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"?W_.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 $f={};let _y=0;const Ff=()=>{},ek='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',pf="Surveys module not available",tk="sanitize_properties is deprecated. Use before_send instead",VR="Invalid value for property_denylist config: ",vF=/^[A-Za-z0-9_-]{1,400}$/,nk=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,rk=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,yF=["token","distinct_id",V5],Sf="posthog",_F=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},xy=t=>{var e;return H({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:y$(ue==null?void 0:ue.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Ff,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:an&&at(an==null?void 0:an.search)&&an.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:Z5,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:Ff},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:C$,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:_F(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))},xF=[["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"]],sk=t=>{const e={};for(const[s,i]of xF)ce(t[s])||(e[i]=t[s]);const n=Bt({},e,t),r=t.__preview_external_dependency_versioned_paths;return ce(r)||(ce(t.strict_script_versioning)&&(n.strict_script_versioning=!!r),at(r)&&ce(t.asset_host)&&(n.asset_host=r)),Be(t.property_blacklist)&&(ce(t.property_denylist)?n.property_denylist=t.property_blacklist:Be(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:ve.error(VR+t.property_denylist)),n};var wF=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}},Vf=class va{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(gi());this.register({distinct_id:r,$device_id:r}),e.set_property(Or,To)}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 wF,this.Iu=!1,this.version=Vn.LIB_VERSION,this.Mu=new Set,this.Eu="",this.vu=new jm,this.uu=[],this.Pu=[],this.ku=!1,this.wu=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=xy(),this.SentryIntegration=L$,this.sentryIntegration=r=>(function(s,i){const o=iR(s,i);return{name:sR,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 rF(this),this.pageViewManager=new FS(this),this.rateLimiter=new B$(this),this.requestRouter=new lF(this),this.consent=new E$(this),this.externalIntegrations=new hF(this);const n=(e=va.__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=at(r)?{[r]:s}:r;this.setPersonProperties(o),i==null||i({})},set_once:(r,s,i)=>{const o=at(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!==Sf){var s;const i=(s=$f[r])!==null&&s!==void 0?s:new va;return i._init(e,n,r),$f[r]=i,$f[Sf][r]=i,i}return this._init(e,n,r)}_init(e,n={},r){var s,i,o;const l=at(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=xy(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=xy(n.defaults),f=sk(n),p=Bt({},d,f,{name:r,token:l});ut(d.rageclick)&&ut(f.rageclick)&&(p.rageclick=Bt({},d.rageclick,f.rageclick)),ut(d.session_recording)&&ut(f.session_recording)&&(p.session_recording=Bt({},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:gs.GZipJS;const g=this.xu();if(this.persistence=new dy(this.config,g),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new dy(H(H({},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);Be(b)&&b.forEach(E=>{at(E)&&this.Mu.add(E)})}else Ht.Lt(this.Eu);const v=H({},this.persistence.props),x=H({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.qu=new eF((b,E)=>this.ju(b,E),this.config.request_queue_config),this.Bu=new nF(this),this.__request_queue=[];const _=this.bu();_||(this.sessionManager=new XS(this),this.sessionPropsManager=new KS(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:H({},this.config),p:v,s:x}),this.config.identity_distinct_id&&!(!((s=n.bootstrap)===null||s===void 0)&&s.distinctID)&&(n.bootstrap=H(H({},n.bootstrap),{},{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));const w=(i=n.bootstrap)===null||i===void 0?void 0:i.distinctID;if(this.ku=!!w&&!Af(w),(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(Or);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(gi()),A=n.bootstrap.isIdentifiedID?R:b;this.persistence.set_property(Or,n.bootstrap.isIdentifiedID?G0:To),this.register({distinct_id:b,$device_id:A})}}if(_)this.register_once({distinct_id:ry,$device_id:null},"");else if(!this.get_distinct_id()){const b=this.config.get_device_id(gi());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(Or,To)}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?$S(this,()=>this.Wu()):this.Wu(),Gn(this.config._onCapture)&&this.config._onCapture!==Ff&&(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 NR.apply(this,arguments)})().then(b=>{b&&this.register({[ny]:b})}).catch(Ff),this}Vu(e){const n=e;return at(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=va.__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=H(H({},va.__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,O$)),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 x;return(x=v.onRemoteConfig)===null||x===void 0?void 0:x.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({[H5]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[z5]: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,gs.GZipJS)?gs.GZipJS:Ze(s.supportedCompression,gs.Base64)?gs.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:Z5}),(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&&(an==null?void 0:an.hostname)){const e=an.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 vR(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()&&_u(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(bS),(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(bS,null,{transport:"sendBeacon"})}_send_request(e){OR(this,e)}ju(e,n){this.Bu?this.Bu.retriableRequest(e,n):this._send_request(n?H(H({},e),{},{transport:n}):e)}_execute_array(e){_y++;try{let n;const r=[],s=[],i=[];_u(e,l=>{if(l)if(n=l[0],Be(n))i.push(l);else if(Gn(l))try{l.call(this)}catch(u){ve.error("Error executing queued PostHog call",l,u)}else Be(l)&&n==="alias"?r.push(l):Be(l)&&n.indexOf("capture")!==-1&&Gn(this[n])?i.push(l):s.push(l)});const o=function(l,u){_u(l,function(d){try{if(Be(d[0])){let f=u;Tt(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{_y--}}push(e){if(_y>0&&Be(e)&&at(e[0])){const n=va.prototype[e[0]];return void(Gn(n)&&n.apply(this,e.slice(1)))}this._execute_array([e])}get nh(){return{property:xS,persistenceKey:Pu,cookieName:"_fbc",pattern:nk,register:(e,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[Pu]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(Pu)}}}get sh(){return{property:wS,persistenceKey:If,cookieName:"_fbp",pattern:rk,register:(e,n)=>{var r;return(r=this.persistence)===null||r===void 0?void 0:r.register({[If]:{value:e,delivered:n}})},unregister:()=>{var e;return(e=this.persistence)===null||e===void 0?void 0:e.unregister(If)}}}rh(e){var n;const r=(n=this.persistence)===null||n===void 0?void 0:n.get_property(e.persistenceKey);return at(r)&&e.pattern.test(r)?{value:r,delivered:!1}:ut(r)&&at(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=Lf(e.cookieName);return at(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 at(n)&&nk.test(n)?this.oh(i,n,o):void i.unregister();const l=at(e)&&vF.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 at(e)&&rk.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)||!at(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&&!at(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=sS(r==null?void 0:r.uuid,gi);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 x=ut(n==null?void 0:n.$set)?n.$set:void 0,_=Be(n==null?void 0:n.$unset)?n.$unset:[],w=(r==null?void 0:r.$unset)||[],b=B=>{var z;const Z=!!(r!=null&&r.$set)&&B in r.$set;return{hasProvided:Z||!!x&&B in x,provided:Z?r==null||(z=r.$set)===null||z===void 0?void 0:z[B]:x==null?void 0:x[B],unset:_.indexOf(B)!==-1||w.indexOf(B)!==-1}},E=b(xS),C=b(wS),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:B,hasProvided:z,update:Z}of R)Z&&g.properties.$process_person_profile===!0&&Z.pending&&!z&&!v&&(g.$set=H({[B.property]:Z.value},g.$set));const A=r==null?void 0:r.$unset;A&&(g.$unset=A);const O=v?void 0:this.ph(r==null?void 0:r.$set_once,e!==SS,e===W5);if(O&&(g.$set_once=O),r!=null&&r._noTruncate||(I=this.config.properties_string_max_length,g=(function(B,z){const Z=new Set;return(function Q(U,ee){if(U!==Object(U))return z?z(U):U;if(Z.has(U))return;let W;if(Z.add(U),Be(U))W=[],_u(U,D=>{W.push(Q(D))});else{const D={};Tt(fd(U)?q5(U):U,(X,oe)=>{Z.has(X)||(D[oe]=Q(X))}),W=D}return W})(B)})(g,B=>at(B)?B.slice(0,I):B)),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=((B,z=[])=>{const Z={},Q=U=>{B[U]!==void 0&&(Z[U]=B[U])};return Ij.forEach(Q),z.forEach(Q),Z})(g.properties,yF)),e===Io.DISMISSED||e===Io.SENT){const B=n==null?void 0:n[hy.SURVEY_ID],z=n==null?void 0:n[hy.SURVEY_ITERATION];FR({id:B,current_iteration:z}),g.$set=H(H({},g.$set),{},{[iF({id:B,current_iteration:z},e===Io.SENT?"responded":"dismissed")]:!0})}else e===Io.SHOWN&&(g.$set=H(H({},g.$set),{},{[hy.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var I;if(e===U$.SHOWN){const B=n==null?void 0:n[zS.TOUR_TYPE];B&&(g.$set=H(H({},g.$set),{},{[`${zS.TOUR_LAST_SEEN_DATE}/${B}`]:new Date().toISOString()}))}const T=H(H({},g.properties.$set),g.$set);if(qr(T)||this.setPersonPropertiesForFlags(T),!nt(this.config.before_send)){const B=this.Os(g);if(!B)return;g=B,g.uuid=sS(g.uuid,gi)}const M=R.filter(({channel:B,update:z})=>{var Z,Q,U;const ee=(Z=(Q=g.$set)===null||Q===void 0?void 0:Q[B.property])!==null&&Z!==void 0?Z:ut((U=g.properties)===null||U===void 0?void 0:U.$set)?g.properties.$set[B.property]:void 0;return(z==null?void 0:z.pending)&&ee===z.value});this.vu.emit("eventCaptured",g);const N=(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(N),$=H(H(H({method:"POST",url:N,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}:{}),M.length?{fireCallbackOnDrop:!0,callback:B=>{if(B.statusCode>=200&&300>B.statusCode)for(const{channel:z,update:Z}of M)this.dh(z,Z.value)}}:{});if(!this.config.request_batching||r&&!(r!=null&&r._batchKey)||r!=null&&r.send_instantly||M.length){var K;let B;!$.transport&&!$.callback&&qr((K=this.config.request_headers)!==null&&K!==void 0?K:{})&&this.$u&&(B="sendBeacon"),this.ju($,B)}else this.qu.enqueue($);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 gF(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=H({},n);if(l.token=this.config.token,l.$config_defaults=this.config.defaults,this.bu()&&(l[V5]=!0),e==="$snapshot"){const E=H(H({},this.persistence.properties()),this.sessionPersistence.properties());return l.distinct_id=E.distinct_id,(!at(l.distinct_id)&&!pn(l.distinct_id)||Af(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 O,I,T,M;if(!Mr)return{};const N=E?[...Qu,...C||[]]:[],[j,$]=o5(Mr),[K,B]=(function(re){for(let se=0;rS.length>se;se++){const[fe,_e,de]=rS[se],ae=re.match(fe);if(ae){const Oe=de&&re.match(de)||ae;return[_e,(Oe==null?void 0:Oe[1])||""]}}return["",""]})(Mr),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={},U=(O=navigator)===null||O===void 0||(O=O.userAgentData)===null||O===void 0?void 0:O.platform,ee=(I=navigator)===null||I===void 0?void 0:I.maxTouchPoints,W=J==null||(T=J.screen)===null||T===void 0?void 0:T.width,D=J==null||(M=J.screen)===null||M===void 0?void 0:M.height,X=J==null?void 0:J.devicePixelRatio;ce(U)||(Q.userAgentDataPlatform=U),ce(ee)||(Q.maxTouchPoints=ee),ce(W)||(Q.screenWidth=W),ce(D)||(Q.screenHeight=D),ce(X)||(Q.devicePixelRatio=X);const oe=Bt(ww({$os:j,$os_version:$,$browser:i5(Mr,navigator.vendor,z,Z),$webview_app:K,$webview_app_version:B,$device:a5(Mr),$device_type:J7(Mr,Q),$timezone:mR(),$timezone_offset:V$()}),{$current_url:ah(A?Ha(an==null?void 0:an.href):an==null?void 0:an.href,N,lh),$host:an==null?void 0:an.host,$pathname:an==null?void 0:an.pathname,$raw_user_agent:Mr.length>1e3?Mr.substring(0,997)+"...":Mr,$browser_version:Q7(Mr,navigator.vendor,z,Z),$browser_language:dR(),$browser_language_prefix:F$(),$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:Oo.LIB_NAME,$lib_version:Oo.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Oo.SDK_DIST_CHANNEL&&(oe.$sdk_dist_channel=Oo.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&&Bt(l,this.sessionPropsManager.getSessionProps());try{var d;this.sessionRecording&&Bt(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===x2&&(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=Bt(l,f),e==="$pageview"&&ue&&(l.title=ue.title),!ce(o)){const E=r.getTime()-o;l.$duration=parseFloat((E/1e3).toFixed(3))}Mr&&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,x=p.$groups;ut(v)&&!qr(v)&&(l.$groups=H(H({},ut(x)?x:{}),v)),Tt(["$referrer","$referring_domain"],E=>{E in p&&delete g[E]});const _={};if(this.Pu.length>0)for(const E of this.Pu.slice())try{Bt(_,E())}catch(C){ve.error("Failed to produce browser extension event properties",C)}l=Bt({},u,p,g,H(H({},_),l)),l.$is_identified=this._isIdentified(),Be(this.config.property_denylist)?Tt(this.config.property_denylist,function(E){delete l[E]}):ve.error(VR+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);const w=this.config.sanitize_properties;w&&(ve.error(tk),l=w(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=Bt({},i,o||{},e||{});const u=this.config.sanitize_properties;return u&&(ve.error(tk),l=u(l,"$set_once")),n&&(this.Iu=!0),qr(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:pf}),()=>{})}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:pf})}getActiveMatchingSurveys(e,n=!1){this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:pf})}renderSurvey(e,n){var r;(r=this.surveys)===null||r===void 0||r.renderSurvey(e,n)}displaySurvey(e,n=uF){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:pf}}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:pf})}wh(e){return!e||Af(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(Tm),this.register({distinct_id:e}));const p=(this.persistence.get_property("$user_state")||"anonymous")===To,g=e!==f,v=!g&&p;if(g&&p){var d;const x=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:f};this.persistence.set_property(Or,G0),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.La(),this.capture("$identify",x,{$set:n||{},$set_once:r||{}})&&(this.Ou=yy(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(Or,G0);const x=n||{},_=r||{};this.setPersonPropertiesForFlags({$set:x,$set_once:_},!1),this.config.cookieWinsOnConflict&&this.persistence.La(),this.capture("$set",{$set:x,$set_once:_})&&(this.Ou=yy(e,n,r))}else(n||r)&&this.setPersonProperties(n,r);g||i||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(Ta)):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=yy(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=(Be(e)?e:[e]).filter(s=>at(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:H(H({},i),{},{[e]:n})}),(o||r)&&this.yh()){const l={$group_type:e,$group_key:n};r&&(l.$group_set=r),this.capture(SS,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=Lr(e)?e:e==null?void 0:e.resetDeviceID,r=Lr(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(mw),g=this.get_property(ny),v=this.get_property(Mf);(l=this.sessionRecording)===null||l===void 0||l.flushBeforeIdentityReset();const x=this.is_capturing();this.consent.reset(),n||!x||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 w=!1;try{var b,E,C,R,A,O,I,T,M,N,j,$,K;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)||(N=this.persistence)===null||N===void 0||N.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(),(O=this.logs)===null||O===void 0||O.reset(),(I=this.metrics)===null||I===void 0||I.reset(),(T=this.persistence)===null||T===void 0||T.set_property("$user_state","anonymous"),(M=this.sessionManager)===null||M===void 0||M.resetSessionId(),this.Ou=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:ry,$device_id:null},"");else{const Z=this.config.get_device_id(gi());this.register_once({distinct_id:Z,$device_id:e?Z:p},""),e||ce(g)||this.register({[ny]:g})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),r&&(r.distinctID&&!this.bu()&&((K=this.persistence)===null||K===void 0||K.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)&&!(!(($=this.sessionManager)===null||$===void 0)&&$.setBootstrapSessionId(f,!0)))){const Z=H({},r);delete Z.sessionID,this.config.bootstrap=Z}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,w=!0}finally{var B,z;_&&((B=this.persistence)===null||B===void 0||(z=B.ja)===null||z===void 0||z.call(B,w))}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(Tm,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=H({},this.config);if(ut(e)){var r,s,i,o,l,u,d,f,p,g,v,x,_,w;Bt(this.config,sk(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 dy(H(H({},this.config),{},{persistence:"sessionStorage"}),E,!1);const C=this.Du(this.config.debug);var b;Lr(C)&&(this.config.debug=C),Lr(this.config.debug)&&(this.config.debug?(Vn.DEBUG=!0,mt.Et()&&mt.At("ph_debug",!0),ve.info("set_config",{config:e,oldConfig:n,newConfig:H({},this.config)})):(Vn.DEBUG=!1,mt.Et()&&mt.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(),(x=this.deadClicksAutocapture)===null||x===void 0||x.startIfEnabledOrStop(),(_=this.surveys)===null||_===void 0||_.loadIfEnabled(),this.Cu(),(w=this.externalIntegrations)===null||w===void 0||w.startIfEnabledOrStop(),!n.segment&&this.config.segment&&this.persistence&&$S(this,Ff,!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(H(H({},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:va.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:Sf;return n!==Sf&&(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()&&qr(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(yw,!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 XS(this),this.pageViewManager=new FS(this),this.persistence&&(this.sessionPropsManager=new KS(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=va.__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(ek)}opt_out_capturing(){if(this.config.cookieless_mode==="always")return void ve.warn(ek);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:ry,$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 Yn?LR(Yn,this.config.custom_blocked_useragents):void 0}th(){ue&&(ue.visibilityState==="visible"?this.Ru||(this.Ru=!0,this.capture(xw,{title:ue.title},{send_instantly:!0}),this.Au&&(ue.removeEventListener(sh,this.Au),this.Au=null)):this.Au||(this.Au=this.th.bind(this),Et(ue,sh,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(H7),s=Be(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 V7(e.event)?ve.warn(`${l}. This can cause unexpected behavior.`):ve.info(l),null}i.properties&&!qr(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=Lr(e)&&!e,r=mt.Et()&&mt.Ot("ph_debug")==="true";return!n&&(!!r||e)}};Vf.__defaultExtensionClasses={},Vf.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]]=g$(t.prototype[e[n]])})(Vf,["identify"]);var HR=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 wy="$copy_autocapture",by=un("[AutoCapture]");function Sy(t,e){return e.length>t?e.slice(0,t)+"...":e}function bF(t){if(t.previousElementSibling)return t.previousElementSibling;let e=t;do e=e.previousSibling;while(e&&!Wi(e));return e}function SF(t,{e,maskAllElementAttributes:n,maskAllText:r,elementAttributeIgnoreList:s,elementsChainAsString:i,disableCaptureUrlHashes:o}){var l,u;if(!Wi(t))return{props:{}};const d=[t],f=new Set([t]);let p=t;for(;p.parentNode&&!hr(p,"body")&&1e3>d.length;){if(bw(p.parentNode)){const O=p.parentNode.host;if(f.has(O))break;f.add(O),d.push(O),p=O;continue}if(!Wi(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(O=>hr(O,"button")||hr(O,"a")):-1;g>0&&(r=r||d.slice(0,g+1).some(O=>!Ru(O)||oh(O)));const v=[],x={};let _,w=!1,b=!1;if(Tt(d,O=>{const I=Ru(O);if(hr(O,"a")&&!n&&!(s!=null&&s.includes("href"))){const T=O.getAttribute("href");w=!!(I&&T&&Df(T))&&(o?Ha(T):T)}Ze(Yu(O),"ph-no-capture")&&(b=!0),v.push((function(T,M,N,j,$=!1){const K=T.tagName.toLowerCase(),B={tag_name:K};kw.indexOf(K)>-1&&!N&&(B.$el_text=K.toLowerCase()==="a"||K.toLowerCase()==="button"?Sy(1024,NS(T)):Sy(1024,ih(T)));const z=Yu(T);M||j!=null&&j.includes("class")||0>=z.length||(B.classes=z.filter(function(ee){return ee!==""})),Tt(T.attributes,function(ee){var W;if((!oh(T)||["name","id","class","aria-label"].indexOf(ee.name)!==-1)&&!(j!=null&&j.includes(ee.name))&&!M&&Df(ee.value)&&(!at(W=ee.name)||W.substring(0,10)!=="_ngcontent"&&W.substring(0,7)!=="_nghost")){let D=ee.value;ee.name==="class"&&(D=Sw(D).join(" ")),B["attr__"+ee.name]=Sy(1024,ee.name==="href"&&$?Ha(D):D)}});let Z=1,Q=1,U=T;for(;U=bF(U);)Z++,U.tagName===T.tagName&&Q++;return B.nth_child=Z,B.nth_of_type=Q,B})(O,n,r,s,o)),Tt((function(T){if(!Ru(T))return{};const M={};return Tt(T.attributes,function(N){if(N.name&&N.name.indexOf("data-ph-capture-attribute")===0){const j=N.name.replace("data-ph-capture-attribute-",""),$=N.value;j&&$&&Df($)&&(M[j]=$)}}),M})(O),(T,M)=>{({}).hasOwnProperty.call(x,M)||(x[M]=T)})}),b)return{props:{},explicitNoCapture:b};if(g>0&&(t=d[g],v.splice(0,g)),r||(v[0].$el_text=hr(t,"a")||hr(t,"button")?NS(t):ih(t)),w){var E,C;v[0].attr__href=w;const O=(E=$o(w))===null||E===void 0?void 0:E.host,I=J==null||(C=J.location)===null||C===void 0?void 0:C.host;O&&I&&O!==I&&(_=w)}return{props:Bt((A=e.type,{$event_type:A,$ce_version:1}),i?{}:{$elements:v},{$elements_chain:(R=v,Be(R)?(function(O){return O.map(I=>{var T,M;let N="";if(I.tag_name&&(N+=I.tag_name),I.attr_class){I.attr_class.sort();for(const K of I.attr_class)N+=`.${K.replace(/"/g,"")}`}const j=H(H(H(H({},I.text?{text:I.text}:{}),{},{"nth-child":(T=I.nth_child)!==null&&T!==void 0?T:0,"nth-of-type":(M=I.nth_of_type)!==null&&M!==void 0?M:0},I.href?{href:I.href}:{}),I.attr_id?{attr_id:I.attr_id}:{}),I.attributes),$={};return K0(j).sort(([K],[B])=>(function(z,Z){return Z>z?-1:z>Z?1:0})(K,B)).forEach(([K,B])=>$[DS(K.toString())]=DS(B.toString())),N+=":",N+=K0($).map(([K,B])=>`${K}="${B}"`).join(""),N}).join(";")})((function(O){return O.map(I=>{var T,M;const N={text:(T=I.$el_text)===null||T===void 0?void 0:T.slice(0,400),tag_name:I.tag_name,href:(M=I.attr__href)===null||M===void 0?void 0:M.slice(0,2048),attr_class:I$(I),attr_id:I.attr__id,nth_child:I.nth_child,nth_of_type:I.nth_of_type,attributes:{}};return K0(I).filter(([j])=>j.indexOf("attr__")===0).forEach(([j,$])=>N.attributes[j]=$),N})})(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:_}:{},x),target:t};var R,A}var kF=class{fo(){this.po=void 0,clearTimeout(this.mo),this.mo=void 0}yo(t){var e;if(!Ru(t))return!0;const n=(e=this.bo().css_selector_ignorelist)!==null&&e!==void 0?e:cy,r=new Set;let s=t;for(;s;){if(r.size>=1e3||r.has(s))return!0;r.add(s);const i=s,o=Yu(i);if(Ze(o,"ph-no-capture")||Ze(o,"ph-sensitive")||oh(i)||n.some(u=>h2(i,u)))return!0;const l=s.parentNode;s=bw(l)?l.host:l&&Wi(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=Nf(t);var e;return void(t.isPrimary&&t.button===0&&!t.ctrlKey&&r&&Wi(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=Nf(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&&(hr(r,"html")||hr(r,"body"))){var s;if(n.excluded)return null;const i=(s=this.bo().css_selector_ignorelist)!==null&&s!==void 0?s:cy;return[r,ue==null?void 0:ue.documentElement,ue==null?void 0:ue.body].some(o=>{if(!o)return!1;const l=Yu(o);return Ze(l,"ph-no-capture")||Ze(l,"ph-sensitive")||!Ru(o)||oh(o)||i.some(u=>h2(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 HR(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 by.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(ln(n))return;this.Oo(e,"$autocapture",n)}catch(n){by.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}),Tt(["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,wy)}catch(r){by.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),Tt(["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;Lr(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(A5),r=this.Co,s=this.bo();if(!s.remoteRequestsDisabled&&!this.$o)return!1;const i=s.remoteRequestsDisabled&&!this.$o;if(ln(r)&&!Lr(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||Nf(t);X5(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()))&&tR(r,s.rageclick)&&this.Oo(t,"$rageclick",n);const o=e===wy,l=o?H(H({},s),{},{dom_event_allowlist:void 0}):s;if(r&&(function(p,g,v,x,_,w){var b;if(!J||Ew(p)||v!=null&&v.url_allowlist&&!RS(v.url_allowlist,w)||v!=null&&v.url_ignorelist&&RS(v.url_ignorelist,w))return!1;if(v!=null&&v.dom_event_allowlist){const A=v.dom_event_allowlist;if(A&&!A.some(O=>g.type===O))return!1}const{parentIsUsefulElement:E,targetElementList:C}=nR(p,x);if(!(function(A,O){const I=O==null?void 0:O.element_allowlist;if(ce(I))return!0;for(const T of A)if(I.some(M=>T.tagName.toLowerCase()===M))return!0;return!1})(C,v)||!p2(C,v==null?void 0:v.css_selector_allowlist)||p2(C,(b=v==null?void 0:v.css_selector_ignorelist)!==null&&b!==void 0?b:cy))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&&(kw.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}=SF(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 x=this.getElementSelectors(r,v);if(x&&x.length>0&&(p.$element_selectors=x),e===wy){const _=t.type||"clipboard";if(_!=="paste"){var d,f;const w=J==null||(d=J.getSelection())===null||d===void 0?void 0:d.toString(),b=Q5(w);if(!b)return!1;p.$selected_content=b,p.$clipboard_text_length=(f=w==null?void 0:w.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)}},EF=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 mf=un("[ExceptionAutocapture]"),ik=()=>{},ok=t=>{var e;if(Gn(t))return(e=t.__posthog_layer__)!==null&&e!==void 0?e:t.__rrweb_layer__};function ch(t,e,n){try{if(!(e in t))return ik;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=ok(i);for(;o;){if(o.next===s)return void(o.next=r.next);i=o.next,o=ok(i)}}}catch{return ik}}const CF=un("[TracingHeaders]"),El=un("[Web Vitals]"),ak=9e5,lk=["CLS","FCP","INP","LCP"],PF=["INP","LCP"],RF=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],ky="disabled",ck="lazy_loading",mo=un("[SessionRecording]"),AF=un("[Heatmaps]");function Ey(t){return ut(t)&&"clientX"in t&&"clientY"in t&&pn(t.clientX)&&pn(t.clientY)}const v0=un("[Product Tours]"),Cy=t=>{var e;return!t.config.disable_product_tours&&!!(!((e=t.persistence)===null||e===void 0)&&e.get_property(vw))},TF=["$set_once","$set"],Ei=un("[SiteApps]"),uk="Error while initializing PostHog app with config id ",zR=(t,e)=>t!=null&&t.then?t.then(e):e(t),ou="SDK is not enabled or survey functionality is not yet loaded",dk="Disabled. Not loading surveys.";var IF=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 Rt.warn("Remote config unavailable. Not loading surveys.");const r=n.config.surveys;if(nt(r))return Rt.warn("Flags not loaded yet. Not loading surveys.");this.Ah=Lr(r)?r:r.length>0,Rt.info(`flags response received, isSurveysEnabled: ${this.Ah}`),this.loadIfEnabled()}}setup(t){if(!this.Io)return this.Fh=t,zR(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 Rt.info("Already initializing surveys, skipping...");if(t.disableSurveys)return void Rt.info(dk);if(t.cookielessMode&&this.So.isOptedOut())return void Rt.info("Not loading surveys in cookieless mode without consent.");const e=this.So.getExtensions();if(!e)return void Rt.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(_w),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(),Rt.info("Surveys loaded successfully"),this.Lh({isLoaded:!0}))}Dh(t,e){Rt.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 Rt.info(dk),t([]);const s=r.kv.get(a2);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=>Rt.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 Rt.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=>Rt.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(ou)}))}jh(t,e){if(this.Io)return{surveys:[],context:{isLoaded:!1,error:ou}};const n=e.statusCode;if(n!==200||!e.json){const o=`Surveys API could not be loaded, status: ${n}`;return n!==0?Rt.error(o):e.error||Rt.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)&&(DR(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({[a2]:r,[Im]: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(Im);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};FR(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){Rt.error("Error in survey callback",n)}}getActiveMatchingSurveys(t,e=!1){if(!nt(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Rt.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:ou};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:ou};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 Rt.warn("init was not called"),{visible:!1,disabledReason:ou};const e=this.Wh(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return nt(this._surveyManager)?(Rt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:ou})):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 Rt.warn("init was not called");const s=typeof t=="string"?this.zh(t):t;if(!(s!=null&&s.id))return void Rt.warn("Survey not found");if(!cF.includes(s.type))return void Rt.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){Rt.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()&&(Rt.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),Rt.info(`Survey ${s.id} rendered`))},1e3*s.appearance.surveyPopupDelaySeconds);return void this.Rh.add(o)}this._surveyManager.renderSurvey(s,i,n)}else Rt.warn("Survey element not found")}displaySurvey(t,e){var n;if(!this.So.isCapturing())return;if(nt(this._surveyManager))return void Rt.warn("init was not called");const r=this.zh(t);if(!r)return void Rt.warn("Survey not found");let s=r;if(!((n=r.appearance)===null||n===void 0)&&n.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=H(H({},r),{},{appearance:H(H({},r.appearance),{},{surveyPopupDelaySeconds:0})})),e.displayType!==m2.Popover&&e.initialResponses&&Rt.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 Rt.warn("Survey is not eligible to be displayed: ",i.reason)}e.displayType!==m2.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}cancelPendingSurvey(t){nt(this._surveyManager)?Rt.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 au(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 MF=class{constructor(t){this._instance=t,this.Vh=new Set,this.Gh=new Set,this.Zh=new jm,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 jm}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"||!au(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=>au(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&&au((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=>au(u.text,e.text,e.text_matching||"exact")||au(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=>au(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||$R(e.properties.reduce((n,r)=>{const s=Be(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)}},OF=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&&$R(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===df.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 MF(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,df.Activation),l=this._c(t,df.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,df.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,df.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(H(H({},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&&(qr(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}},LF=class extends OF{constructor(t){super(t)}zc(){return N5}Uc(){return D5}gc(){return j5}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 Io.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 Rt}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 DR(r)&&!!(!((s=r.conditions)===null||s===void 0||(s=s.events)===null||s===void 0)&&s.repeatedActivation)||r.schedule==="always"})(n)?t===Io.SHOWN?"consume":"ignore":t===Io.SHOWN?"persist":t===Io.DISMISSED||t===Io.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},NF=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)}},DF=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=je==null?void 0:je.__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 LF(this._instance)}};const jF=J!=null&&J.location?Lm(J.location.hash,"__posthog")||Lm(location.hash,"state"):null,fk="_postHogToolbarParams",hk=un("[Toolbar]"),pk=un("[FeatureFlags]");var $F=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:Be(n.flag_keys)?n.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.Jc||(pk.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)||Be(t.flag_keys)||pk.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.Kc}};const mk=un("[FeatureFlags]"),Cl=un("[FeatureFlags]",{debugEnabled:!0}),Py=`" failed. Feature flags didn't load in time.`,FF=[502,504],gk=["click","keydown","wheel","touchstart","pointerdown"],vk="connection_error",yk=t=>{const e={};for(let n=0;t.length>n;n++)e[t[n]]=!0;return e},_k=t=>{const e={};for(const[n,r]of K0(t||{}))r&&(e[n]=r);return e},xk=t=>fd(t)&&(t.name==="RangeError"&&t.message.indexOf("Maximum call stack size exceeded")===0||t.name==="InternalError"&&t.message==="too much recursion"),ai=un("[Error tracking]"),w2="webkit-masked-url:",VF=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],HF=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",w2],zF=["__firefox__","__gCrWeb"],wk="Refusing to render web experiment since the viewer is a likely bot",UF={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>$m(e,t),not_regex:(t,e)=>!$m(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t},Vs=un("[Conversations]"),Pl="Conversations not available yet.";function bk(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=H(H({},(function(){let x="",_="";try{const w=Yn==null?void 0:Yn.userAgent;w&&([x,_]=o5(w))}catch{}return(function(w,b){const E=(function(C){if(C)return{}.hasOwnProperty.call(gS,C)?gS[C]:C})(w);return H(H({},E?{"os.name":E}:{}),b?{"os.version":b}:{})})(x,_)})()),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 BF=["debug","log","warn","error","info"],ZF=t=>{for(;t!=null&&t.__rrweb_original__;)t=t.__rrweb_original__;return t},Sk="console",UR="__posthogHandledLogsRequestError",Ry=(t,e)=>{const n=t instanceof Error?t:new Error(e);return n[UR]=!0,n},kk=t=>!!t&&typeof t=="object"&&t[UR]===!0,Fm=un("[NetworkMetrics]"),Rw=()=>{var t;return!(J==null||(t=J.performance)===null||t===void 0)&&t.now?J.performance.now():Date.now()},WF={"http:":80,"https:":443},qF=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),BR=(t,e)=>{var n;const r=String(e);return{method:String(t).toUpperCase(),url:((n=$o(r))===null||n===void 0?void 0:n.href)||r}},b2=(t,e,n,r,s,i,o=!1)=>{try{var l,u;const d=s();if(!d)return;const f=n||void 0,p=Rw()-r,g=$o(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},x=Gn(d.name)?d.name(v):at(d.name)?d.name:"http.client.request.duration";if(!x)return;const _=o&&!f?void 0:((b,E)=>b?400>b?void 0:String(b):(E==null?void 0:E.name)||"_OTHER")(f,i),w=H(H(H(H(H({},(b=>{const E=qF.has(b)?b:"_OTHER";return H({"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)||WF[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(x,p,{unit:"ms",attributes:w})}catch(d){Fm.error("Failed to record network metric",d)}},ZR=()=>{},GF=(t,e)=>Gn(J==null?void 0:J.fetch)?ch(J,"fetch",n=>function(...r){const s=Rw(),i=n.apply(this,r);if(!e())return i;try{var o,l,u;const[d,f]=r,p=BR((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=>(b2(t,p,g==null?void 0:g.status,s,e,void 0,!0),g),g=>{throw b2(t,p,void 0,s,e,g),g})}catch(d){return Fm.error("Failed to observe fetch",d),i}}):ZR,KF=(t,e)=>{var n;const r=J==null||(n=J.XMLHttpRequest)===null||n===void 0?void 0:n.prototype;if(!r)return ZR;const s=new WeakMap,i=ch(r,"open",l=>function(...u){try{SR.has(this)||s.set(this,BR(u[0],u[1]))}catch(d){Fm.error("Failed to observe XHR open",d)}return l.apply(this,u)}),o=ch(r,"send",l=>function(...u){let d;try{const f=s.get(this);if(f&&e()){const p=Rw();d=()=>{this.removeEventListener("loadend",d),b2(t,f,this.status,p,e)},Et(this,"loadend",d)}}catch(f){Fm.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()}},Ig={featureFlags:class{constructor(t){this.name="featureFlags",this.Xc=!1,this.featureFlagEventHandlers=[],this.$=mk,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 $F(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]"),zR(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,sh,this.ln),_u(gk,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),_u(gk,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&&!Be(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,x=!!v||d,_=!!v||g,w={[Ao]:x,[mi]:x,[Pa]:_};t.$feature_flag_details&&(w[tc]=x);for(const b of[nc,Da,Of])ce(t[b])||(w[b]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(w)}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[Ao,Pa,nc,Ti]){const s=this.Fd(r);ce(s)||(t[r]=s)}this.Yc=t;const e=H({},t),n=this.Fd(mi);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(Da);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=H(H({},i),t),u=H(H({},o),e),d={};for(const[f,p]of Object.entries(l))d[f]={key:f,enabled:dS(p),variant:fS(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(tc),e=this.Fd(Ti),n=this.Fd($l);if(!n&&!e)return t||{};const r=Bt({},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=H(H({},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=H(H({},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:dS(r),variant:fS(r),payload:uS(e[n])}})}getFlagVariants(){const t=this.Fd(mi),e=this.Fd(Ti);if(!e)return t||{};const n=Bt({},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(Pa),e=this.Fd($l);if(!e)return t||{};const n=Bt({},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(Ta)}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:H(H(H({},e.initialPersonProperties),this.Fd("$stored_person_properties")||{}),{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Fd(Aa),timezone:mR()};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=x=>{var _,w;const b=(_=x.json)!==null&&_!==void 0?_:{},E=x.statusCode!==200;if(this.sd=!1,l!==this.rd)return void u();if(this.Wd(x.statusCode),E||this.ad||(this.$anon_distinct_id=void 0),n.disable_flags&&!this.ad)return;this.ld=!E;const C=[];x.error?C.push(x.error instanceof Error&&x.error.name==="AbortError"?"timeout":x.error instanceof Error?vk:"unknown_error"):x.statusCode!==200&&C.push(`api_error_${x.statusCode}`),b.errorsWhileComputingFlags&&C.push("errors_while_computing_flags");const R=!!(!((w=b.quotaLimited)===null||w===void 0)&&w.includes("feature_flags"));R&&C.push("quota_limited"),this.At({[rh]: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=x=>{this.sd=!1,l===this.rd&&(this.At({[rh]:[vk]}),this.$.error("Feature flag request failed",x),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(x=>{if((_=>FF.includes(_.statusCode)||(w=>w.statusCode===0&&w.error instanceof Error&&w.error.name==="AbortError")(_))(x)&&g())return p--,void setTimeout(v,500);d(x)}).catch(f)}catch(x){f(x)}};v()}vd(){return oR(this.hd,3)}Wd(t){this.hd=aR(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+Py);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+Py);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 M=(p=this.wo)===null||p===void 0?void 0:p.session.sessionId,N=this.Fd(bf);M&&M!==N&&(f={},d=M)}if(e.send_event||!("send_event"in e))if(t in f&&f[t].includes(o))d&&this.At({[Ta]:f,[bf]:d});else{var g,v,x,_,w,b,E,C,R,A,O,I;Be(f[t])?f[t].push(o):f[t]=[o],this.At(H({[Ta]:f},d?{[bf]:d}:{}));const M=this.getFeatureFlagDetails(t),N=[...(g=this.Fd("$feature_flag_errors"))!==null&&g!==void 0?g:[]];ce(s)&&N.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=(x=this.Rr.bootstrap)===null||x===void 0||(x=x.featureFlags)===null||x===void 0?void 0:x[t])!==null&&v!==void 0?v:null,$feature_flag_bootstrapped_payload:(_=(w=this.Rr.bootstrap)===null||w===void 0||(w=w.featureFlagPayloads)===null||w===void 0?void 0:w[t])!==null&&_!==void 0?_:null,$used_bootstrap_value:!this.ld};ce(M==null||(b=M.metadata)===null||b===void 0?void 0:b.has_experiment)||(j.$feature_flag_has_experiment=M.metadata.has_experiment),ce(M==null||(E=M.metadata)===null||E===void 0?void 0:E.version)||(j.$feature_flag_version=M.metadata.version);const $=(C=M==null||(R=M.reason)===null||R===void 0?void 0:R.description)!==null&&C!==void 0?C:M==null||(A=M.reason)===null||A===void 0?void 0:A.code;var T;$&&(j.$feature_flag_reason=$),!(M==null||(O=M.metadata)===null||O===void 0)&&O.id&&(j.$feature_flag_id=M.metadata.id),ce(M==null?void 0:M.original_variant)&&ce(M==null?void 0:M.original_enabled)||(j.$feature_flag_original_response=ce(M.original_variant)?M.original_enabled:M.original_variant),!(M==null||(I=M.metadata)===null||I===void 0)&&I.original_payload&&(j.$feature_flag_original_payload=M==null||(T=M.metadata)===null||T===void 0?void 0:T.original_payload),N.length&&(j.$feature_flag_error=N.join(",")),this.Vd(j)}else d&&this.At({[Ta]:f,[bf]:d});return r?{key:t,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:uS(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+Py),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=mk)=>{const f=((C,R)=>{const A=C.flags;if(A){const O=Object.fromEntries(Object.keys(A).map(T=>{var M;return[T,(M=A[T].variant)!==null&&M!==void 0?M:A[T].enabled]})),I=Object.fromEntries(Object.keys(A).filter(T=>A[T].enabled).filter(T=>{var M;return!ce((M=A[T].metadata)===null||M===void 0?void 0:M.payload)}).map(T=>{var M;return[T,(M=A[T].metadata)===null||M===void 0?void 0:M.payload]}));return H(H({},C),{},{featureFlags:O,featureFlagPayloads:I})}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 x=s.requestId,_=s.evaluatedAt;if(Be(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{[Ao]:g,[mi]:C,[Of]:!1}}let w=g,b=v,E=p;if(u!=null&&u.partialResponse){const C=Object.keys(w),R=b||{};w=H(H({},i),w),b=H(H({},o),R),C.forEach(A=>{A in R||b==null||delete b[A]}),E=H(H({},l),E)}else if(s.errorsWhileComputingFlags)if(p){const C=new Set(Object.keys(p).filter(A=>{var O;return!(!((O=p[A])===null||O===void 0)&&O.failed)}));w=H(H({},i),Object.fromEntries(Object.entries(w).filter(([A])=>C.has(A))));const R=Object.fromEntries(Object.entries(b||{}).filter(([A])=>C.has(A)));b=H(H({},o),R),C.forEach(A=>{A in R||b==null||delete b[A]}),E=H(H({},l),Object.fromEntries(Object.entries(E||{}).filter(([A])=>C.has(A))))}else w=H(H({},i),w),b=H(H({},o),b),E=H(H({},l),E);return H(H({[Ao]:Object.keys(_k(w)),[mi]:w||{},[Pa]:b||{},[tc]:E||{},[Of]:s.minimalFlagCalledEvents===!0},x?{[nc]:x}:{}),_?{[Da]:_}:{})})(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(mi));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([Ti,$l]),this.Md(),void Cl.info("All overrides cleared");if(Be(t))return this.At({[Ti]:yk(t)}),this.Md(),void Cl.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[Ti]=Be(s)?yk(s):s),i&&(r[$l]=i),Object.keys(r).length&&this.At(r),s===!1&&i===!1?this.Lt([Ti,$l]):s===!1?this.Lt(Ti):i===!1&&this.Lt($l),this.Md(),s===!1?Cl.info("Flag overrides cleared"):s&&Cl.info("Flag overrides set",{flags:s}),void(i===!1?Cl.info("Payload overrides cleared"):i&&Cl.info("Payload overrides set",{payloads:i}))}if(t&&typeof t=="object")return this.At({[Ti]:t}),this.Md(),void Cl.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=H(H({},this.getFlagVariants()),{},{[t]:e});(r=this._instance)===null||r===void 0||(r=r.persistence)===null||r===void 0||r.markCrossTabFeatureFlagChanges({$active_feature_flags:[t],$enabled_feature_flags:[t],$stored_person_properties:Object.keys(i)}),this.At({[Ao]:Object.keys(_k(l)),[mi]:l,[Ra]:H(H({},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(o2);!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({[o2]: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({[Ra]:H(H(H({},n),i),r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e=!0){const n=H({},this.Fd("$stored_person_properties")||{});t.forEach(r=>{delete n[r]}),this.At({[Ra]:n}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t=!0){this.Lt(Ra),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e=!0){const n=this.Fd("$stored_group_properties")||{},r=H({},n);for(const s of Object.keys(t))r[s]=H(H({},n[s]),t[s]);this.At({[Aa]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){const e=this.Fd("$stored_group_properties")||{};this.At({[Aa]:H(H({},e),{},{[t]:{}})})}else this.Lt(Aa)}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}}},YF={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=ky,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 mo.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),mo.info("starting")):(this.Yd=ky,this.stopRecording())}sv(t){var e,n;if(this.nv)if(this.Yd!=="awaiting_config"&&this.Yd!=="missing_config"&&(this.Yd=ck),(je==null||(e=je.__PosthogExtensions__)===null||e===void 0||(e=e.rrweb)===null||e===void 0?void 0:e.record)&&((n=je.__PosthogExtensions__)===null||n===void 0?void 0:n.initSessionRecording))this.rv(t);else{var r,s;const i=this._instance.sessionManager;(r=je.__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}),mo.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?(mo.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({[Mf]:H(H({cache_timestamp:Date.now(),enabled:!!o},o),{},{networkPayloadCapture:H({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({[B5]:!0}),mo.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):mo.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(Mf);return(n==null||(e=n.scriptConfig)===null||e===void 0?void 0:e.script)||"lazy-recorder"}hv(){const t=this._instance.get_property(Mf);if(!t)return!1;let e;try{e=typeof t=="object"?t:JSON.parse(t)}catch(n){return mo.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=je.__PosthogExtensions__)===null||e===void 0)&&e.initSessionRecording))return mo.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[U5]:!0});var s;if(this.Xd||(this.Xd=(s=je.__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",mo.info("persisted remote config is stale, requesting fresh config before starting"),void new vR(this._instance).load());this.Yd=ck,(n=(r=this.Xd).setDocumentWasEverVisible)===null||n===void 0||n.call(r,this.Xe),this.Xd.start(t)}else this.Yd=ky}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)}}},XF={autocapture:class extends kF{constructor(t){super(new EF(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;ch(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(xw,{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=$o(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[n2]),this.rageclicks=new HR(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;AF.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({[n2]:n}),this.Iv=n,this.startIfEnabled()}getAndClearBuffer(){const t=this.Rt;return this.Rt=void 0,t}Rv(t){Ey(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,Mm,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 jS(this.instance,M$,this.Rv.bind(this)),this.Lv.startIfEnabledOrStop(),this.Nv=this.ln.bind(this),Et(ue,sh,this.Nv),this.xo=!0)}Pv(){var t;J&&ue&&(this.Av&&J.removeEventListener(Mm,this.Av),this.Fv&&ue.removeEventListener("click",this.Fv,{capture:!0}),this.Ov&&ue.removeEventListener("mousemove",this.Ov,{capture:!0}),this.Nv&&ue.removeEventListener(sh,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&&Wi(d)&&!hr(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=J5(d)}return!1})(Nf(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(PS(t.target)||!Ey(t))return;const r=this.jv(t,e);!((n=this.rageclicks)===null||n===void 0)&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&tR(Nf(t),this.instance.config.rageclick)&&this.Zs(H(H({},r),{},{type:"rageclick"})),this.Zs(r)}Dv(t){!PS(t.target)&&Ey(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?Ha(J.location.href):J.location.href,n=this.Rr.custom_personal_data_properties,r=this.Rr.mask_personal_data_properties?[...Qu,...n||[]]:[],s=ah(e,r,lh);this.Rt=this.Rt||{},this.Rt[s]||(this.Rt[s]=[]),this.Rt[s].push(t)}bl(){this.Rt&&!qr(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:jS,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",H({$current_url:this.Rt.url},this.Rt.metrics.reduce((n,r)=>H(H({},n),{},{[`$web_vitals_${r.name}_event`]:H({},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 El.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 El.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=H(H(H({},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 RF){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=je.__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 El.error("web vitals callbacks not loaded - not starting");const f={reportSoftNavs:this.useSoftNavs},p=o&&this.attributionMetrics.indexOf("INP")>-1?H(H({},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[i2]),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)||lk: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 Lr(t)?t?lk:[]:Be(t)?t:PF}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:ak;return t>0&&6e4>=t?ak:t}get isEnabled(){const t=an==null?void 0:an.protocol;if(t!=="http:"&&t!=="https:")return El.info("Web Vitals are disabled on non-http/https protocols"),!1;const e=ut(this.Zv)?this.Zv.web_vitals:Lr(this.Zv)?this.Zv:void 0;return Lr(e)?e:this.Iv}startIfEnabled(){this.isEnabled&&!this.xo&&(El.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({[i2]:n}),this._instance.persistence.register({[M5]: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=je.__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?El.error("failed to load script",i):t()})}Uv(t){const e=t||(J==null?void 0:J.location.href);if(!e)return void El.error("Could not determine current URL");const n=this._instance.config.disable_capture_url_hashes?Ha(e):e,r=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...Qu,...r||[]]:[];return ah(n,s,lh)}}},QF={exceptionObserver:class{constructor(t){var e;this.Vv=()=>{var n;if(!J||!this.isEnabled||!(!((n=je.__PosthogExtensions__)===null||n===void 0)&&n.errorWrappingFunctions))return;const r=je.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=je.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=je.__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){mf.error("failed to start",o),this.Xv()}},this._instance=t,this.Yv=!!(!((e=this._instance.persistence)===null||e===void 0)&&e.props[r2]),this.wt=new Z7(H(H({},(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,$:mf})),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=H(H({},e),t):(ce(t)?this.Yv:t)&&(e=H(H({},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?(mf.info("enabled"),this.Xv(),this.zo(this.Vv)):this.Xv()}zo(t){var e,n,r;!((e=je.__PosthogExtensions__)===null||e===void 0)&&e.errorWrappingFunctions?t():(n=je.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"exception-autocapture",s=>{if(s)return mf.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({[r2]: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 mf.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 rj([new yj,new Pj,new xj,new _j,new Ej,new kj,new bj,new Cj],(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 x=u[v];if(x.length>1024)continue;const _=cS.test(x)?x.replace(cS,"$1"):x;if(!_.match(/\S*Error: /)){for(const w of s){const b=w(_,r);if(b){l.push(b);const E=pj(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(gj(l,f)>=50)break}}const p=[...f].sort((v,x)=>x.start-v.start),g=p[p.length-1];if(g){const v=p5(l,g);l.splice(g.start-v,v);for(const x of p)x.start-=v}for(const v of p)mj(l,v);return f.some(v=>v.start===0&&l.length===v.length)&&(function(v){const x=v.map(w=>`${w.function}|${w.filename}|${w.lineno}|${w.colno}|${w.module}`);let _=0;for(let w=1;x.length>w;w++)vj(x,w,_)&&(_=w);v.push(...v.splice(0,_))})(l),(function(v){if(!v.length)return[];const x=Array.from(v);return x.reverse(),x.slice(0,50).map(_=>{return H(H({},_),{},{filename:_.filename||(w=x,w[w.length-1]||{}).filename,function:_.function||"?"});var w})})(l)}})("web:javascript",uj,hj)),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=Pm(this.sf()),this.rf=new Aj(this.nf)}onConfigChange(){this.nf=Pm(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({[T5]:this.ef,[s2]:o})}get af(){var t;const e=!!this._instance.get_property(s2),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(!at(t)||t.trim().length===0)return void ai.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)=>Rj.has(l)?(i.push(l),o):(o[l]=s[l],o),{}),droppedKeys:i}})(this.lf(e));r.length>0&&ai.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.rf.add(H({[Em]:t,[Cm]:new Date().toISOString()},n))}catch(n){ai.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 ai.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 ai.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 ai.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 ai.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 xk(s)||ai.error("Failed to capture exception event. Dropping this exception.",s),void this.rf.clear()}}catch(e){return void(xk(e)||ai.error("Failed to process exception event. Ignoring this exception.",e))}}pf(t){try{const e=this.rf.getAttachable();return e.length===0?t:H(H({},t),{},{$exception_steps:e})}catch(e){return ai.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}cf(t){this.nf.enabled&&this.rf.add({[Em]:t,[Cm]:new Date().toISOString()})}lf(t){return ut(t)?H({},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})=>(at(r)&&r.length>0&&n.$exception_types.push(r),at(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=jR[s.operator],o=e[s.key];if(!i||!o)return!1;const l=Be(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 ai.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&&HF.some(s=>r.startsWith(s)));return n.length!==0&&(!n.every(({filename:r})=>!!r&&r.startsWith(w2))||t.some(({type:r,value:s})=>r==="NoResponse"||at(s)&&VF.some(({value:i,exact:o})=>o?s===i:s.includes(i)))&&!e.some(({in_app:r,filename:s})=>r&&!(s!=null&&s.startsWith(w2))))}vf(t){return t.some(({value:e})=>at(e)&&zF.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)&&Be(t)}}},JF=H({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({[vw]:!!e.productTours}),!Cy(this._instance))return!this.gf&&nt((n=this.Ml)===null||n===void 0?void 0:n.props.ph_product_tours)||v0.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&&Cy(this._instance)&&this.zo(()=>this.yf())}zo(t){var e,n,r;!((e=je.__PosthogExtensions__)===null||e===void 0)&&e.generateProductTours?t():(n=je.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"product-tours",s=>{s?v0.error("Could not load product tours script",s):t()})}yf(){var t;!this.gf&&(!((t=je.__PosthogExtensions__)===null||t===void 0)&&t.generateProductTours)&&(this.gf=je.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e=!1){if(Be(this.mf)&&!e)return void t(this.mf,{isLoaded:!0});const n=this.Ml;if(n){const r=n.props[l2];if(Be(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(!Cy(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||v0.warn(o):v0.error(o),void t([],{isLoaded:!1,error:o})}const i=Be(r.json.product_tours)?r.json.product_tours:[];this.mf=i,n&&n.register({[l2]: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)}}},Ig),eV={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=je._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,x]of Object.entries(f))u[v]={id:d[v],type:v,properties:x};const{$set_once:p,$set:g}=t;return{event:H(H({},y5(t,TF)),{},{properties:H(H(H({},t.properties),g?{$set:H(H({},(e=(n=t.properties)===null||n===void 0?void 0:n.$set)!==null&&e!==void 0?e:{}),g)}:{}),p?{$set_once:H(H({},(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)||(Ei.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)||(Ei.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=(w,b,E)=>{if(!(w!=null&&w[b]))return;const C=w[b];w[b]=E(C),f.push(()=>{w[b]=C})},x=w=>{if(g.has(w))return w;const b=p.Sf(w);return b&&g.add(b),b},_=w=>w.map(b=>typeof b=="string"?b:x(b)).filter(b=>!ln(b));return v(d,"appendChild",w=>function(b){const E=x(b);return E?w.call(this,E):b}),v(d,"insertBefore",w=>function(b,E){const C=x(b);return C?w.call(this,C,E):b}),v(d,"replaceChild",w=>function(b,E){const C=x(b);return C?w.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(w=>{v(w,"append",b=>function(...E){return b.apply(this,_(E))}),v(w,"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(w=>{v(w,"before",b=>function(...E){return b.apply(this,_(E))}),v(w,"after",b=>function(...E){return b.apply(this,_(E))}),v(w,"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",w=>function(b,E){const C=x(E);return C?w.call(this,b,C):null}),this.Cf=()=>{f.forEach(w=>w()),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&&(Ei.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,Ei.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){Ei.error(uk+t.id,i),s(!1)}if(r&&e.loaded)try{n()}catch(i){Ei.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){Ei.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 Ei.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;je[`__$$ph_site_app_${l}`]=this._instance,(i=je.__PosthogExtensions__)===null||i===void 0||(o=i.loadSiteApp)===null||o===void 0||o.call(i,this._instance,u,d=>{if(d)return Ei.error(uk+l,d)})}else Ei.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},tV={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=je.__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=je.__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=je.__PosthogExtensions__)===null||e===void 0)&&e.tracingHeadersPatchFns?t():(n=je.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this._instance,"tracing-headers",s=>{if(s)return CF.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 Be(t)?(Be(this.Rf)?this.Rf.splice(0,this.Rf.length,...t):this.Rf=[...t],t.length>0?this.Rf:void 0):(Be(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()}}},nV=H({surveys:class extends IF{constructor(t){var e;super(new DF(t),(e=t,{get projectToken(){return e.config.token},kv:new NF(e)})),this._instance=t}qh(t,e){const n=e.query?Uh(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})})}}},Ig),rV={toolbar:class{constructor(t){this.instance=t}Of(t){je.ph_toolbar_state=t}Df(){var t;return(t=je.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(u2(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=jF||Lm(t.hash,"__posthog")||Lm(t.hash,"state");let o;const l=i?iS(()=>JSON.parse(atob(decodeURIComponent(i))))||iS(()=>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(fk)||"{}"),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=je.ph_load_toolbar||je.ph_load_editor;!nt(e)&&Gn(e)?e(t,this.instance):hk.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=H(H({token:this.instance.config.token},t),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(J.localStorage.setItem(fk,JSON.stringify(H(H({},r),{},{source:void 0}))),this.Df()===2)this.Lf(r);else if(this.Df()===0){var s,i;this.Of(1),(s=je.__PosthogExtensions__)===null||s===void 0||(i=s.loadExternalDependency)===null||i===void 0||i.call(s,this.instance,"toolbar",o=>{if(o)return hk.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)}}},sV=H({experiments:class Ar{get Rr(){return this._instance.config}constructor(e){this._instance=e,this.getWebExperimentsAndEvaluateDisplayLogic=(n=!1)=>{this.getWebExperiments(r=>{Ar.qf("retrieved web experiments from the server"),this.jf=new Map,r.forEach(s=>{if(s.feature_flag_key){var i;this.jf&&(Ar.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);at(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];Ar.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())Ar.qf(wk);else if(!this.Rr.disable_web_experiments){if(nt(this.jf))return this.jf=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Ar.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=Ar.getWindowLocation();if(e!=null&&e.search){const n=Xu(e==null?void 0:e.search,"__experiment_id"),r=Xu(e==null?void 0:e.search,"__experiment_variant");n&&r&&(Ar.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&&(Ar.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)&&Ar.Uf(e,n)&&Ar.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=Ar.getWindowLocation();if(s){var i,o,l;const u=Y5(n,s.href);return!(!((i=e.conditions)===null||i===void 0)&&i.url)||UF[(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=lR();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,x=!(!((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&&x&&_&&v}return!1}static qf(e,...n){ve.info(`[WebExperiments] ${e}`,n)}Bf(e,n,r){this._is_bot()?Ar.qf(wk):n!=="control"?r.forEach(s=>{if(s.selector){var i;Ar.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)})}}):Ar.qf("Control variants leave the page unmodified.")}_is_bot(){return Yn&&this._instance?LR(Yn,this.Rr.custom_blocked_useragents):void 0}}},Ig),iV={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)||(Lr(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||u2(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())return;const t=je==null?void 0:je.__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(_w);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 Vs.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,Vs.info("Conversations loaded successfully")}catch(e){this.Kf("Error completing conversations initialization",e)}else Vs.error("Cannot complete initialization: remote config is null")}Kf(t,e){Vs.error(t,e),this._conversationsManager=null,this.Gf=!1,this.Zf=!0}show(){this._conversationsManager?this._conversationsManager.show():Vs.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Vf===!0&&!ln(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":u2(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":je!=null&&je.__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):(Vs.warn(Pl),null)})()}getMessages(t,e){var n=this;return qt(function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(Vs.warn(Pl),null)})()}markAsRead(t){var e=this;return qt(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(Vs.warn(Pl),null)})()}getTickets(t){var e=this;return qt(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(Vs.warn(Pl),null)})()}requestRestoreLink(t){var e=this;return qt(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(Vs.warn(Pl),null)})()}restoreFromToken(t){var e=this;return qt(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(Vs.warn(Pl),null)})()}restoreFromUrlToken(){var t=this;return qt(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Vs.warn(Pl),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()}}},oV={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=H(H({},this.$),{},{error:(...n)=>{n.some(kk)||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=bk((s=this._instance)===null||s===void 0||(s=s.config)===null||s===void 0?void 0:s.logs,n);return[new Fj(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},Sk)),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[I5])}_p(){var t,e,n;return!(!((t=this._instance)===null||t===void 0||(e=t.nl)===null||e===void 0)&&e.call(t))||!!(!((n=je._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||!(je!=null&&je.console))return;const e=bk((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 BF){let s;try{s=ZF(je.console[r])}catch{continue}s&&this.rp.push(ch(je.console,r,i=>{const o=(...l)=>{try{n&&this.$p(r,l,e)}catch{}return i.apply(je.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){kk(t)||this.$.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(this.Io||!this.Xf||this.Yf||this.tp)return;const t=je==null?void 0:je.__PosthogExtensions__;if(!t)return this.$.error("PostHog Extensions not found."),void this.Sp();const e=t.loadExternalDependency;if(!e)return this.$.error(_w),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===Ii.LogsQueue?t():void 0,setPersistedProperty(r,s){var i;r===Ii.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(oR(this.hd,3))return void e({kind:"fatal",error:Ry(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:Ry(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:Ry(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=aR(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,Sk,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=k5(i,S5(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(!(je==null||(t=je.location)===null||t===void 0)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?Ha(je.location.href):je.location.href),this._instance.featureFlags){const n=this._instance.featureFlags.getFlags();n&&n.length>0&&(e.activeFeatureFlags=n)}return e}}},aV={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=GF(n,s),o=KF(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 Vj(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(H(H({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)}}};Vf.__defaultExtensionClasses=H({},H(H(H(H(H(H(H(H(H(H(H(H(H({},Ig),YF),XF),QF),JF),eV),nV),tV),rV),sV),iV),oV),aV));const lV=(function(){Vn.SDK_DIST_CHANNEL="npm";const t=$f[Sf]=new Vf;return(function(){function e(){e.done||(e.done=!0,MR=!1,Tt($f,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=lV,cV=(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 uV=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})},y0,Ek="__POSTHOG_REACT_SHARED_STATE__",Ck=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},uh;try{uh=Ck[Ek]=Ck[Ek]||new WeakMap}catch{uh=new WeakMap}uh.has(m.createContext)||uh.set(m.createContext,{});var rc=uh.get(m.createContext),S2;function dV(t){(!rc.defaultPostHogInstance||rc.defaultPostHogInstance===S2)&&(rc.defaultPostHogInstance=t),S2=t}function k2(){return S2}rc.context||(rc.context=m.createContext({get client(){return k2()||rc.defaultPostHogInstance},bootstrap:void 0}));var Aw=rc.context;function WR(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)||!WR(t[l],e[l],n))return!1}return!0}function fV(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=k2();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=k2(),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&&!WR(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)]),xe.createElement(Aw.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 Ay=function(t){return typeof t=="function"},hV=function(t){return t===void 0},Xi=function(){var t=m.useContext(Aw).client;return t},X0=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]"},pV=function(t,e){try{Object.defineProperty(t,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch{}},mV=function(t,e){for(var n=new WeakSet,r=t;!n.has(r);){if(n.add(r),!X0(r.cause)){hV(r.cause)||(e.cause=r.cause),r.cause=e;return}r=r.cause}},gV=function(t,e){if(!e)return t;var n=new Error(X0(t)?t.message:"Primitive value captured as exception: ".concat(String(t)));return pV(n,"React ErrorBoundary ".concat(X0(t)?t.name:"Error")),n.stack=e,X0(t)?(mV(t,n),t):n},Pk={componentStack:null,exceptionEvent:null,error:null},vV={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},yV=(y0=(function(t){cV(e,t);function e(n){var r=t.call(this,n)||this;return r._resetError=function(){r.setState(Pk)},r.state=Pk,r}return e.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;Ay(s)?i=s(n,r):typeof s=="object"&&(i=s);var o=this.context.client,l=r.componentStack,u=o.captureException(gV(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 Ay(r)?r():r;var o=Ay(s)?xe.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent,resetError:this._resetError}):s;return xe.isValidElement(o)?o:(console.warn(vV.INVALID_FALLBACK),xe.createElement(xe.Fragment,null))},e})(xe.Component),uV(y0,"PostHogErrorBoundary"),(function(){y0.contextType=Aw})(),y0);dV(Ce);const Rk="rivet_library_token";let Hf="";const _V=()=>`Bearer ${Hf}`,xV=()=>{if(!window.location.pathname.startsWith("/rivet/library"))return;const t=new URLSearchParams(window.location.hash.slice(1)).get("token");if(t){Hf=t;try{window.sessionStorage.setItem(Rk,t)}catch{}window.history.replaceState(null,"",window.location.pathname+window.location.search)}else try{Hf=window.sessionStorage.getItem(Rk)??""}catch{Hf=""}},wV=async(t,e={})=>{const n=await fetch(`/api/library${t}`,{method:e.method??"GET",signal:e.signal,headers:{Authorization:`Bearer ${Hf}`,"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 _0={},Ty={exports:{}},Br={},Iy={exports:{}},My={};/**
|
|
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 Ak;function bV(){return Ak||(Ak=1,(function(t){function e(U,ee){var W=U.length;U.push(ee);e:for(;0<W;){var D=W-1>>>1,X=U[D];if(0<s(X,ee))U[D]=ee,U[W]=X,W=D;else break e}}function n(U){return U.length===0?null:U[0]}function r(U){if(U.length===0)return null;var ee=U[0],W=U.pop();if(W!==ee){U[0]=W;e:for(var D=0,X=U.length,oe=X>>>1;D<oe;){var re=2*(D+1)-1,se=U[re],fe=re+1,_e=U[fe];if(0>s(se,W))fe<X&&0>s(_e,se)?(U[D]=_e,U[fe]=W,D=fe):(U[D]=se,U[re]=W,D=re);else if(fe<X&&0>s(_e,W))U[D]=_e,U[fe]=W,D=fe;else break e}}return ee}function s(U,ee){var W=U.sortIndex-ee.sortIndex;return W!==0?W:U.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,x=!1,_=!1,w=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(U){for(var ee=n(d);ee!==null;){if(ee.callback===null)r(d);else if(ee.startTime<=U)r(d),ee.sortIndex=ee.expirationTime,e(u,ee);else break;ee=n(d)}}function R(U){if(_=!1,C(U),!x)if(n(u)!==null)x=!0,Z(A);else{var ee=n(d);ee!==null&&Q(R,ee.startTime-U)}}function A(U,ee){x=!1,_&&(_=!1,b(T),T=-1),v=!0;var W=g;try{for(C(ee),p=n(u);p!==null&&(!(p.expirationTime>ee)||U&&!j());){var D=p.callback;if(typeof D=="function"){p.callback=null,g=p.priorityLevel;var X=D(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 O=!1,I=null,T=-1,M=5,N=-1;function j(){return!(t.unstable_now()-N<M)}function $(){if(I!==null){var U=t.unstable_now();N=U;var ee=!0;try{ee=I(!0,U)}finally{ee?K():(O=!1,I=null)}}else O=!1}var K;if(typeof E=="function")K=function(){E($)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,z=B.port2;B.port1.onmessage=$,K=function(){z.postMessage(null)}}else K=function(){w($,0)};function Z(U){I=U,O||(O=!0,K())}function Q(U,ee){T=w(function(){U(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(U){U.callback=null},t.unstable_continueExecution=function(){x||v||(x=!0,Z(A))},t.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<U?Math.floor(1e3/U):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_getFirstCallbackNode=function(){return n(u)},t.unstable_next=function(U){switch(g){case 1:case 2:case 3:var ee=3;break;default:ee=g}var W=g;g=ee;try{return U()}finally{g=W}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(U,ee){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var W=g;g=U;try{return ee()}finally{g=W}},t.unstable_scheduleCallback=function(U,ee,W){var D=t.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?D+W:D):W=D,U){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,U={id:f++,callback:ee,priorityLevel:U,startTime:W,expirationTime:X,sortIndex:-1},W>D?(U.sortIndex=W,e(d,U),n(u)===null&&U===n(d)&&(_?(b(T),T=-1):_=!0,Q(R,W-D))):(U.sortIndex=X,e(u,U),x||v||(x=!0,Z(A))),U},t.unstable_shouldYield=j,t.unstable_wrapCallback=function(U){var ee=g;return function(){var W=g;g=ee;try{return U.apply(this,arguments)}finally{g=W}}}})(My)),My}var Tk;function SV(){return Tk||(Tk=1,Iy.exports=bV()),Iy.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 Ik;function kV(){if(Ik)return Br;Ik=1;var t=rw(),e=SV();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 x(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,L){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=L}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){w[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];w[c]=new _(c,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){w[a]=new _(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){w[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){w[a]=new _(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){w[a]=new _(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){w[a]=new _(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){w[a]=new _(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){w[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);w[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);w[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);w[c]=new _(c,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){w[a]=new _(a,1,!1,a.toLowerCase(),null,!1,!1)}),w.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){w[a]=new _(a,1,!1,a.toLowerCase(),null,!0,!0)});function C(a,c,h,y){var k=w.hasOwnProperty(c)?w[c]:null;(k!==null?k.type!==0:y||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(x(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"),O=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),N=Symbol.for("react.provider"),j=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),Q=Symbol.for("react.offscreen"),U=Symbol.iterator;function ee(a){return a===null||typeof a!="object"?null:(a=U&&a[U]||a["@@iterator"],typeof a=="function"?a:null)}var W=Object.assign,D;function X(a){if(D===void 0)try{throw Error()}catch(h){var c=h.stack.trim().match(/\n( *(at )?)/);D=c&&c[1]||""}return`
|
|
36
|
+
`+D+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
|
+
`),L=k.length-1,V=P.length-1;1<=L&&0<=V&&k[L]!==P[V];)V--;for(;1<=L&&0<=V;L--,V--)if(k[L]!==P[V]){if(L!==1||V!==1)do if(L--,V--,0>V||k[L]!==P[V]){var G=`
|
|
39
|
+
`+k[L].replace(" at new "," at ");return a.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",a.displayName)),G}while(1<=L&&0<=V);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 I:return"Fragment";case O:return"Portal";case M:return"Profiler";case T:return"StrictMode";case K:return"Suspense";case B:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case j:return(a.displayName||"Context")+".Consumer";case N:return(a._context.displayName||"Context")+".Provider";case $: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(L){y=""+L,P.call(this,L)}}),Object.defineProperty(a,c,{enumerable:h.enumerable}),{getValue:function(){return y},setValue:function(L){y=""+L},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 Mt(a,c){var h=c.checked;return W({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:h??a._wrapperState.initialChecked})}function Xt(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 xt(a,c){c=c.checked,c!=null&&C(a,"checked",c,!1)}function yt(a,c){xt(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 Ot(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 rs(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 gr(a,c){return a==null||a==="http://www.w3.org/1999/xhtml"?rs(c):a==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var Le,Wo=(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 Xn={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},ol=["Webkit","ms","Moz","O"];Object.keys(Xn).forEach(function(a){ol.forEach(function(c){c=c+a.charAt(0).toUpperCase()+a.substring(1),Xn[c]=Xn[a]})});function mn(a,c,h){return c==null||typeof c=="boolean"||c===""?"":h||typeof c!="number"||c===0||Xn.hasOwnProperty(a)&&Xn[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 xd=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 As(a,c){if(c){if(xd[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 vr(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 Qn=null;function eo(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Ys=null,On=null,Ts=null;function al(a){if(a=Ud(a)){if(typeof Ys!="function")throw Error(n(280));var c=a.stateNode;c&&(c=Sp(c),Ys(a.stateNode,a.type,c))}}function to(a){On?Ts?Ts.push(a):Ts=[a]:On=a}function ss(){if(On){var a=On,c=Ts;if(Ts=On=null,al(a),c)for(a=0;a<c.length;a++)al(c[a])}}function Xe(a,c){return a(c)}function Lt(){}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||Ts!==null)&&(Lt(),ss())}}function is(a,c){var h=a.stateNode;if(h===null)return null;var y=Sp(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 Ut=!1;if(l)try{var Ln={};Object.defineProperty(Ln,"passive",{get:function(){Ut=!0}}),window.addEventListener("test",Ln,Ln),window.removeEventListener("test",Ln,Ln)}catch{Ut=!1}function $r(a,c,h,y,k,P,L,V,G){var ie=Array.prototype.slice.call(arguments,3);try{c.apply(h,ie)}catch(ge){this.onError(ge)}}var Xs=!1,ar=null,Rn=!1,ll=null,bc={onError:function(a){Xs=!0,ar=a}};function Sc(a,c,h,y,k,P,L,V,G){Xs=!1,ar=null,$r.apply(bc,arguments)}function kc(a,c,h,y,k,P,L,V,G){if(Sc.apply(this,arguments),Xs){if(Xs){var ie=ar;Xs=!1,ar=null}else throw Error(n(198));Rn||(Rn=!0,ll=ie)}}function Is(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 no(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 wd(a){if(Is(a)!==a)throw Error(n(188))}function Ec(a){var c=a.alternate;if(!c){if(c=Is(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 wd(k),a;if(P===y)return wd(k),c;P=P.sibling}throw Error(n(188))}if(h.return!==y.return)h=k,y=P;else{for(var L=!1,V=k.child;V;){if(V===h){L=!0,h=k,y=P;break}if(V===y){L=!0,y=k,h=P;break}V=V.sibling}if(!L){for(V=P.child;V;){if(V===h){L=!0,h=P,y=k;break}if(V===y){L=!0,y=P,h=k;break}V=V.sibling}if(!L)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 bd(a){return a=Ec(a),a!==null?Cc(a):null}function Cc(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var c=Cc(a);if(c!==null)return c;a=a.sibling}return null}var Pc=e.unstable_scheduleCallback,qo=e.unstable_cancelCallback,Sd=e.unstable_shouldYield,fv=e.unstable_requestPaint,Qt=e.unstable_now,hv=e.unstable_getCurrentPriorityLevel,kd=e.unstable_ImmediatePriority,sp=e.unstable_UserBlockingPriority,Go=e.unstable_NormalPriority,Ed=e.unstable_LowPriority,Cd=e.unstable_IdlePriority,Rc=null,Ms=null;function ip(a){if(Ms&&typeof Ms.onCommitFiberRoot=="function")try{Ms.onCommitFiberRoot(Rc,a,void 0,(a.current.flags&128)===128)}catch{}}var os=Math.clz32?Math.clz32:mv,pv=Math.log,Pd=Math.LN2;function mv(a){return a>>>=0,a===0?32:31-(pv(a)/Pd|0)|0}var Ac=64,Tc=4194304;function cl(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 Ic(a,c){var h=a.pendingLanes;if(h===0)return 0;var y=0,k=a.suspendedLanes,P=a.pingedLanes,L=h&268435455;if(L!==0){var V=L&~k;V!==0?y=cl(V):(P&=L,P!==0&&(y=cl(P)))}else L=h&~k,L!==0?y=cl(L):P!==0&&(y=cl(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-os(c),k=1<<h,y|=a[h],c&=~k;return y}function Rd(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 gv(a,c){for(var h=a.suspendedLanes,y=a.pingedLanes,k=a.expirationTimes,P=a.pendingLanes;0<P;){var L=31-os(P),V=1<<L,G=k[L];G===-1?((V&h)===0||(V&y)!==0)&&(k[L]=Rd(V,c)):G<=c&&(a.expiredLanes|=V),P&=~V}}function Ad(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function op(){var a=Ac;return Ac<<=1,(Ac&4194240)===0&&(Ac=64),a}function ul(a){for(var c=[],h=0;31>h;h++)c.push(a);return c}function ro(a,c,h){a.pendingLanes|=c,c!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,c=31-os(c),a[c]=h}function ap(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-os(h),P=1<<k;c[k]=0,y[k]=-1,a[k]=-1,h&=~P}}function Td(a,c){var h=a.entangledLanes|=c;for(a=a.entanglements;h;){var y=31-os(h),k=1<<y;k&c|a[y]&c&&(a[y]|=c),h&=~k}}var $t=0;function so(a){return a&=-a,1<a?4<a?(a&268435455)!==0?16:536870912:4:1}var Id,dl,lp,cp,up,Mc=!1,Oc=[],Qs=null,as=null,Os=null,Ko=new Map,Yo=new Map,Js=[],dp="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 F(a,c){switch(a){case"focusin":case"focusout":Qs=null;break;case"dragenter":case"dragleave":as=null;break;case"mouseover":case"mouseout":Os=null;break;case"pointerover":case"pointerout":Ko.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":Yo.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=Ud(c),c!==null&&dl(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 Qs=le(Qs,a,c,h,y,k),!0;case"dragenter":return as=le(as,a,c,h,y,k),!0;case"mouseover":return Os=le(Os,a,c,h,y,k),!0;case"pointerover":var P=k.pointerId;return Ko.set(P,le(Ko.get(P)||null,a,c,h,y,k)),!0;case"gotpointercapture":return P=k.pointerId,Yo.set(P,le(Yo.get(P)||null,a,c,h,y,k)),!0}return!1}function he(a){var c=fl(a.target);if(c!==null){var h=Is(c);if(h!==null){if(c=h.tag,c===13){if(c=no(h),c!==null){a.blockedOn=c,up(a.priority,function(){lp(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=ei(a.domEventName,a.eventSystemFlags,c[0],a.nativeEvent);if(h===null){h=a.nativeEvent;var y=new h.constructor(h.type,h);Qn=y,h.target.dispatchEvent(y),Qn=null}else return c=Ud(h),c!==null&&dl(c),a.blockedOn=h,!1;c.shift()}return!0}function Se(a,c,h){pe(a)&&h.delete(c)}function Qe(){Mc=!1,Qs!==null&&pe(Qs)&&(Qs=null),as!==null&&pe(as)&&(as=null),Os!==null&&pe(Os)&&(Os=null),Ko.forEach(Se),Yo.forEach(Se)}function Pe(a,c){a.blockedOn===c&&(a.blockedOn=null,Mc||(Mc=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Qe)))}function nn(a){function c(k){return Pe(k,a)}if(0<Oc.length){Pe(Oc[0],a);for(var h=1;h<Oc.length;h++){var y=Oc[h];y.blockedOn===a&&(y.blockedOn=null)}}for(Qs!==null&&Pe(Qs,a),as!==null&&Pe(as,a),Os!==null&&Pe(Os,a),Ko.forEach(c),Yo.forEach(c),h=0;h<Js.length;h++)y=Js[h],y.blockedOn===a&&(y.blockedOn=null);for(;0<Js.length&&(h=Js[0],h.blockedOn===null);)he(h),h.blockedOn===null&&Js.shift()}var vn=R.ReactCurrentBatchConfig,Cr=!0;function ls(a,c,h,y){var k=$t,P=vn.transition;vn.transition=null;try{$t=1,lt(a,c,h,y)}finally{$t=k,vn.transition=P}}function cs(a,c,h,y){var k=$t,P=vn.transition;vn.transition=null;try{$t=4,lt(a,c,h,y)}finally{$t=k,vn.transition=P}}function lt(a,c,h,y){if(Cr){var k=ei(a,c,h,y);if(k===null)Ov(a,c,y,Vt,h),F(a,y);else if(Ee(k,a,c,h,y))y.stopPropagation();else if(F(a,y),c&4&&-1<dp.indexOf(a)){for(;k!==null;){var P=Ud(k);if(P!==null&&Id(P),P=ei(a,c,h,y),P===null&&Ov(a,c,y,Vt,h),P===k)break;k=P}k!==null&&y.stopPropagation()}else Ov(a,c,y,null,h)}}var Vt=null;function ei(a,c,h,y){if(Vt=null,a=eo(y),a=fl(a),a!==null)if(c=Is(a),c===null)a=null;else if(h=c.tag,h===13){if(a=no(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 S4(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(hv()){case kd:return 1;case sp:return 4;case Go:case Ed:return 16;case Cd:return 536870912;default:return 16}default:return 16}}var Xo=null,vv=null,fp=null;function k4(){if(fp)return fp;var a,c=vv,h=c.length,y,k="value"in Xo?Xo.value:Xo.textContent,P=k.length;for(a=0;a<h&&c[a]===k[a];a++);var L=h-a;for(y=1;y<=L&&c[h-y]===k[P-y];y++);return fp=k.slice(a,1<y?1-y:void 0)}function hp(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 pp(){return!0}function E4(){return!1}function us(a){function c(h,y,k,P,L){this._reactName=h,this._targetInst=k,this.type=y,this.nativeEvent=P,this.target=L,this.currentTarget=null;for(var V in a)a.hasOwnProperty(V)&&(h=a[V],this[V]=h?h(P):P[V]);return this.isDefaultPrevented=(P.defaultPrevented!=null?P.defaultPrevented:P.returnValue===!1)?pp:E4,this.isPropagationStopped=E4,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=pp)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=pp)},persist:function(){},isPersistent:pp}),c}var Lc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yv=us(Lc),Md=W({},Lc,{view:0,detail:0}),vN=us(Md),_v,xv,Od,mp=W({},Md,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bv,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!==Od&&(Od&&a.type==="mousemove"?(_v=a.screenX-Od.screenX,xv=a.screenY-Od.screenY):xv=_v=0,Od=a),_v)},movementY:function(a){return"movementY"in a?a.movementY:xv}}),C4=us(mp),yN=W({},mp,{dataTransfer:0}),_N=us(yN),xN=W({},Md,{relatedTarget:0}),wv=us(xN),wN=W({},Lc,{animationName:0,elapsedTime:0,pseudoElement:0}),bN=us(wN),SN=W({},Lc,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),kN=us(SN),EN=W({},Lc,{data:0}),P4=us(EN),CN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},PN={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"},RN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function AN(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=RN[a])?!!c[a]:!1}function bv(){return AN}var TN=W({},Md,{key:function(a){if(a.key){var c=CN[a.key]||a.key;if(c!=="Unidentified")return c}return a.type==="keypress"?(a=hp(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?PN[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bv,charCode:function(a){return a.type==="keypress"?hp(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?hp(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),IN=us(TN),MN=W({},mp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),R4=us(MN),ON=W({},Md,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bv}),LN=us(ON),NN=W({},Lc,{propertyName:0,elapsedTime:0,pseudoElement:0}),DN=us(NN),jN=W({},mp,{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}),$N=us(jN),FN=[9,13,27,32],Sv=l&&"CompositionEvent"in window,Ld=null;l&&"documentMode"in document&&(Ld=document.documentMode);var VN=l&&"TextEvent"in window&&!Ld,A4=l&&(!Sv||Ld&&8<Ld&&11>=Ld),T4=" ",I4=!1;function M4(a,c){switch(a){case"keyup":return FN.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function O4(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Nc=!1;function HN(a,c){switch(a){case"compositionend":return O4(c);case"keypress":return c.which!==32?null:(I4=!0,T4);case"textInput":return a=c.data,a===T4&&I4?null:a;default:return null}}function zN(a,c){if(Nc)return a==="compositionend"||!Sv&&M4(a,c)?(a=k4(),fp=vv=Xo=null,Nc=!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 A4&&c.locale!=="ko"?null:c.data;default:return null}}var UN={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 L4(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c==="input"?!!UN[a.type]:c==="textarea"}function N4(a,c,h,y){to(y),c=xp(c,"onChange"),0<c.length&&(h=new yv("onChange","change",null,h,y),a.push({event:h,listeners:c}))}var Nd=null,Dd=null;function BN(a){J4(a,0)}function gp(a){var c=Vc(a);if(Ge(c))return a}function ZN(a,c){if(a==="change")return c}var D4=!1;if(l){var kv;if(l){var Ev="oninput"in document;if(!Ev){var j4=document.createElement("div");j4.setAttribute("oninput","return;"),Ev=typeof j4.oninput=="function"}kv=Ev}else kv=!1;D4=kv&&(!document.documentMode||9<document.documentMode)}function $4(){Nd&&(Nd.detachEvent("onpropertychange",F4),Dd=Nd=null)}function F4(a){if(a.propertyName==="value"&&gp(Dd)){var c=[];N4(c,Dd,a,eo(a)),zn(BN,c)}}function WN(a,c,h){a==="focusin"?($4(),Nd=c,Dd=h,Nd.attachEvent("onpropertychange",F4)):a==="focusout"&&$4()}function qN(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return gp(Dd)}function GN(a,c){if(a==="click")return gp(c)}function KN(a,c){if(a==="input"||a==="change")return gp(c)}function YN(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var ti=typeof Object.is=="function"?Object.is:YN;function jd(a,c){if(ti(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)||!ti(a[k],c[k]))return!1}return!0}function V4(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function H4(a,c){var h=V4(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=V4(h)}}function z4(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?z4(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function U4(){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 Cv(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 XN(a){var c=U4(),h=a.focusedElem,y=a.selectionRange;if(c!==h&&h&&h.ownerDocument&&z4(h.ownerDocument.documentElement,h)){if(y!==null&&Cv(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=H4(h,P);var L=H4(h,y);k&&L&&(a.rangeCount!==1||a.anchorNode!==k.node||a.anchorOffset!==k.offset||a.focusNode!==L.node||a.focusOffset!==L.offset)&&(c=c.createRange(),c.setStart(k.node,k.offset),a.removeAllRanges(),P>y?(a.addRange(c),a.extend(L.node,L.offset)):(c.setEnd(L.node,L.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 QN=l&&"documentMode"in document&&11>=document.documentMode,Dc=null,Pv=null,$d=null,Rv=!1;function B4(a,c,h){var y=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Rv||Dc==null||Dc!==vt(y)||(y=Dc,"selectionStart"in y&&Cv(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}),$d&&jd($d,y)||($d=y,y=xp(Pv,"onSelect"),0<y.length&&(c=new yv("onSelect","select",null,c,h),a.push({event:c,listeners:y}),c.target=Dc)))}function vp(a,c){var h={};return h[a.toLowerCase()]=c.toLowerCase(),h["Webkit"+a]="webkit"+c,h["Moz"+a]="moz"+c,h}var jc={animationend:vp("Animation","AnimationEnd"),animationiteration:vp("Animation","AnimationIteration"),animationstart:vp("Animation","AnimationStart"),transitionend:vp("Transition","TransitionEnd")},Av={},Z4={};l&&(Z4=document.createElement("div").style,"AnimationEvent"in window||(delete jc.animationend.animation,delete jc.animationiteration.animation,delete jc.animationstart.animation),"TransitionEvent"in window||delete jc.transitionend.transition);function yp(a){if(Av[a])return Av[a];if(!jc[a])return a;var c=jc[a],h;for(h in c)if(c.hasOwnProperty(h)&&h in Z4)return Av[a]=c[h];return a}var W4=yp("animationend"),q4=yp("animationiteration"),G4=yp("animationstart"),K4=yp("transitionend"),Y4=new Map,X4="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 Qo(a,c){Y4.set(a,c),i(c,[a])}for(var Tv=0;Tv<X4.length;Tv++){var Iv=X4[Tv],JN=Iv.toLowerCase(),eD=Iv[0].toUpperCase()+Iv.slice(1);Qo(JN,"on"+eD)}Qo(W4,"onAnimationEnd"),Qo(q4,"onAnimationIteration"),Qo(G4,"onAnimationStart"),Qo("dblclick","onDoubleClick"),Qo("focusin","onFocus"),Qo("focusout","onBlur"),Qo(K4,"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 Fd="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(" "),tD=new Set("cancel close invalid load scroll toggle".split(" ").concat(Fd));function Q4(a,c,h){var y=a.type||"unknown-event";a.currentTarget=h,kc(y,c,void 0,a),a.currentTarget=null}function J4(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 L=y.length-1;0<=L;L--){var V=y[L],G=V.instance,ie=V.currentTarget;if(V=V.listener,G!==P&&k.isPropagationStopped())break e;Q4(k,V,ie),P=G}else for(L=0;L<y.length;L++){if(V=y[L],G=V.instance,ie=V.currentTarget,V=V.listener,G!==P&&k.isPropagationStopped())break e;Q4(k,V,ie),P=G}}}if(Rn)throw a=ll,Rn=!1,ll=null,a}function rn(a,c){var h=c[Fv];h===void 0&&(h=c[Fv]=new Set);var y=a+"__bubble";h.has(y)||(e6(c,a,2,!1),h.add(y))}function Mv(a,c,h){var y=0;c&&(y|=4),e6(h,a,y,c)}var _p="_reactListening"+Math.random().toString(36).slice(2);function Vd(a){if(!a[_p]){a[_p]=!0,r.forEach(function(h){h!=="selectionchange"&&(tD.has(h)||Mv(h,!1,a),Mv(h,!0,a))});var c=a.nodeType===9?a:a.ownerDocument;c===null||c[_p]||(c[_p]=!0,Mv("selectionchange",!1,c))}}function e6(a,c,h,y){switch(S4(c)){case 1:var k=ls;break;case 4:k=cs;break;default:k=lt}h=k.bind(null,c,h,a),k=void 0,!Ut||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 Ov(a,c,h,y,k){var P=y;if((c&1)===0&&(c&2)===0&&y!==null)e:for(;;){if(y===null)return;var L=y.tag;if(L===3||L===4){var V=y.stateNode.containerInfo;if(V===k||V.nodeType===8&&V.parentNode===k)break;if(L===4)for(L=y.return;L!==null;){var G=L.tag;if((G===3||G===4)&&(G=L.stateNode.containerInfo,G===k||G.nodeType===8&&G.parentNode===k))return;L=L.return}for(;V!==null;){if(L=fl(V),L===null)return;if(G=L.tag,G===5||G===6){y=P=L;continue e}V=V.parentNode}}y=y.return}zn(function(){var ie=P,ge=eo(h),ye=[];e:{var me=Y4.get(a);if(me!==void 0){var Ie=yv,$e=a;switch(a){case"keypress":if(hp(h)===0)break e;case"keydown":case"keyup":Ie=IN;break;case"focusin":$e="focus",Ie=wv;break;case"focusout":$e="blur",Ie=wv;break;case"beforeblur":case"afterblur":Ie=wv;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":Ie=C4;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ie=_N;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ie=LN;break;case W4:case q4:case G4:Ie=bN;break;case K4:Ie=DN;break;case"scroll":Ie=vN;break;case"wheel":Ie=$N;break;case"copy":case"cut":case"paste":Ie=kN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ie=R4}var He=(c&4)!==0,An=!He&&a==="scroll",te=He?me!==null?me+"Capture":null:me;He=[];for(var Y=ie,ne;Y!==null;){ne=Y;var be=ne.stateNode;if(ne.tag===5&&be!==null&&(ne=be,te!==null&&(be=is(Y,te),be!=null&&He.push(Hd(Y,be,ne)))),An)break;Y=Y.return}0<He.length&&(me=new Ie(me,$e,null,h,ge),ye.push({event:me,listeners:He}))}}if((c&7)===0){e:{if(me=a==="mouseover"||a==="pointerover",Ie=a==="mouseout"||a==="pointerout",me&&h!==Qn&&($e=h.relatedTarget||h.fromElement)&&(fl($e)||$e[io]))break e;if((Ie||me)&&(me=ge.window===ge?ge:(me=ge.ownerDocument)?me.defaultView||me.parentWindow:window,Ie?($e=h.relatedTarget||h.toElement,Ie=ie,$e=$e?fl($e):null,$e!==null&&(An=Is($e),$e!==An||$e.tag!==5&&$e.tag!==6)&&($e=null)):(Ie=null,$e=ie),Ie!==$e)){if(He=C4,be="onMouseLeave",te="onMouseEnter",Y="mouse",(a==="pointerout"||a==="pointerover")&&(He=R4,be="onPointerLeave",te="onPointerEnter",Y="pointer"),An=Ie==null?me:Vc(Ie),ne=$e==null?me:Vc($e),me=new He(be,Y+"leave",Ie,h,ge),me.target=An,me.relatedTarget=ne,be=null,fl(ge)===ie&&(He=new He(te,Y+"enter",$e,h,ge),He.target=ne,He.relatedTarget=An,be=He),An=be,Ie&&$e)t:{for(He=Ie,te=$e,Y=0,ne=He;ne;ne=$c(ne))Y++;for(ne=0,be=te;be;be=$c(be))ne++;for(;0<Y-ne;)He=$c(He),Y--;for(;0<ne-Y;)te=$c(te),ne--;for(;Y--;){if(He===te||te!==null&&He===te.alternate)break t;He=$c(He),te=$c(te)}He=null}else He=null;Ie!==null&&t6(ye,me,Ie,He,!1),$e!==null&&An!==null&&t6(ye,An,$e,He,!0)}}e:{if(me=ie?Vc(ie):window,Ie=me.nodeName&&me.nodeName.toLowerCase(),Ie==="select"||Ie==="input"&&me.type==="file")var ze=ZN;else if(L4(me))if(D4)ze=KN;else{ze=qN;var Je=WN}else(Ie=me.nodeName)&&Ie.toLowerCase()==="input"&&(me.type==="checkbox"||me.type==="radio")&&(ze=GN);if(ze&&(ze=ze(a,ie))){N4(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?Vc(ie):window,a){case"focusin":(L4(Je)||Je.contentEditable==="true")&&(Dc=Je,Pv=ie,$d=null);break;case"focusout":$d=Pv=Dc=null;break;case"mousedown":Rv=!0;break;case"contextmenu":case"mouseup":case"dragend":Rv=!1,B4(ye,h,ge);break;case"selectionchange":if(QN)break;case"keydown":case"keyup":B4(ye,h,ge)}var et;if(Sv)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 Nc?M4(a,h)&&(rt="onCompositionEnd"):a==="keydown"&&h.keyCode===229&&(rt="onCompositionStart");rt&&(A4&&h.locale!=="ko"&&(Nc||rt!=="onCompositionStart"?rt==="onCompositionEnd"&&Nc&&(et=k4()):(Xo=ge,vv="value"in Xo?Xo.value:Xo.textContent,Nc=!0)),Je=xp(ie,rt),0<Je.length&&(rt=new P4(rt,a,null,h,ge),ye.push({event:rt,listeners:Je}),et?rt.data=et:(et=O4(h),et!==null&&(rt.data=et)))),(et=VN?HN(a,h):zN(a,h))&&(ie=xp(ie,"onBeforeInput"),0<ie.length&&(ge=new P4("onBeforeInput","beforeinput",null,h,ge),ye.push({event:ge,listeners:ie}),ge.data=et))}J4(ye,c)})}function Hd(a,c,h){return{instance:a,listener:c,currentTarget:h}}function xp(a,c){for(var h=c+"Capture",y=[];a!==null;){var k=a,P=k.stateNode;k.tag===5&&P!==null&&(k=P,P=is(a,h),P!=null&&y.unshift(Hd(a,P,k)),P=is(a,c),P!=null&&y.push(Hd(a,P,k))),a=a.return}return y}function $c(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function t6(a,c,h,y,k){for(var P=c._reactName,L=[];h!==null&&h!==y;){var V=h,G=V.alternate,ie=V.stateNode;if(G!==null&&G===y)break;V.tag===5&&ie!==null&&(V=ie,k?(G=is(h,P),G!=null&&L.unshift(Hd(h,G,V))):k||(G=is(h,P),G!=null&&L.push(Hd(h,G,V)))),h=h.return}L.length!==0&&a.push({event:c,listeners:L})}var nD=/\r\n?/g,rD=/\u0000|\uFFFD/g;function n6(a){return(typeof a=="string"?a:""+a).replace(nD,`
|
|
40
|
+
`).replace(rD,"")}function wp(a,c,h){if(c=n6(c),n6(a)!==c&&h)throw Error(n(425))}function bp(){}var Lv=null,Nv=null;function Dv(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 jv=typeof setTimeout=="function"?setTimeout:void 0,sD=typeof clearTimeout=="function"?clearTimeout:void 0,r6=typeof Promise=="function"?Promise:void 0,iD=typeof queueMicrotask=="function"?queueMicrotask:typeof r6<"u"?function(a){return r6.resolve(null).then(a).catch(oD)}:jv;function oD(a){setTimeout(function(){throw a})}function $v(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),nn(c);return}y--}else h!=="$"&&h!=="$?"&&h!=="$!"||y++;h=k}while(h);nn(c)}function Jo(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 s6(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 Fc=Math.random().toString(36).slice(2),wi="__reactFiber$"+Fc,zd="__reactProps$"+Fc,io="__reactContainer$"+Fc,Fv="__reactEvents$"+Fc,aD="__reactListeners$"+Fc,lD="__reactHandles$"+Fc;function fl(a){var c=a[wi];if(c)return c;for(var h=a.parentNode;h;){if(c=h[io]||h[wi]){if(h=c.alternate,c.child!==null||h!==null&&h.child!==null)for(a=s6(a);a!==null;){if(h=a[wi])return h;a=s6(a)}return c}a=h,h=a.parentNode}return null}function Ud(a){return a=a[wi]||a[io],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function Vc(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(n(33))}function Sp(a){return a[zd]||null}var Vv=[],Hc=-1;function ea(a){return{current:a}}function sn(a){0>Hc||(a.current=Vv[Hc],Vv[Hc]=null,Hc--)}function Jt(a,c){Hc++,Vv[Hc]=a.current,a.current=c}var ta={},yr=ea(ta),Fr=ea(!1),hl=ta;function zc(a,c){var h=a.type.contextTypes;if(!h)return ta;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 Vr(a){return a=a.childContextTypes,a!=null}function kp(){sn(Fr),sn(yr)}function i6(a,c,h){if(yr.current!==ta)throw Error(n(168));Jt(yr,c),Jt(Fr,h)}function o6(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 Ep(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||ta,hl=yr.current,Jt(yr,a),Jt(Fr,Fr.current),!0}function a6(a,c,h){var y=a.stateNode;if(!y)throw Error(n(169));h?(a=o6(a,c,hl),y.__reactInternalMemoizedMergedChildContext=a,sn(Fr),sn(yr),Jt(yr,a)):sn(Fr),Jt(Fr,h)}var oo=null,Cp=!1,Hv=!1;function l6(a){oo===null?oo=[a]:oo.push(a)}function cD(a){Cp=!0,l6(a)}function na(){if(!Hv&&oo!==null){Hv=!0;var a=0,c=$t;try{var h=oo;for($t=1;a<h.length;a++){var y=h[a];do y=y(!0);while(y!==null)}oo=null,Cp=!1}catch(k){throw oo!==null&&(oo=oo.slice(a+1)),Pc(kd,na),k}finally{$t=c,Hv=!1}}return null}var Uc=[],Bc=0,Pp=null,Rp=0,Ls=[],Ns=0,pl=null,ao=1,lo="";function ml(a,c){Uc[Bc++]=Rp,Uc[Bc++]=Pp,Pp=a,Rp=c}function c6(a,c,h){Ls[Ns++]=ao,Ls[Ns++]=lo,Ls[Ns++]=pl,pl=a;var y=ao;a=lo;var k=32-os(y)-1;y&=~(1<<k),h+=1;var P=32-os(c)+k;if(30<P){var L=k-k%5;P=(y&(1<<L)-1).toString(32),y>>=L,k-=L,ao=1<<32-os(c)+k|h<<k|y,lo=P+a}else ao=1<<P|h<<k|y,lo=a}function zv(a){a.return!==null&&(ml(a,1),c6(a,1,0))}function Uv(a){for(;a===Pp;)Pp=Uc[--Bc],Uc[Bc]=null,Rp=Uc[--Bc],Uc[Bc]=null;for(;a===pl;)pl=Ls[--Ns],Ls[Ns]=null,lo=Ls[--Ns],Ls[Ns]=null,ao=Ls[--Ns],Ls[Ns]=null}var ds=null,fs=null,dn=!1,ni=null;function u6(a,c){var h=Fs(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 d6(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,ds=a,fs=Jo(c.firstChild),!0):!1;case 6:return c=a.pendingProps===""||c.nodeType!==3?null:c,c!==null?(a.stateNode=c,ds=a,fs=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(h=pl!==null?{id:ao,overflow:lo}:null,a.memoizedState={dehydrated:c,treeContext:h,retryLane:1073741824},h=Fs(18,null,null,0),h.stateNode=c,h.return=a,a.child=h,ds=a,fs=null,!0):!1;default:return!1}}function Bv(a){return(a.mode&1)!==0&&(a.flags&128)===0}function Zv(a){if(dn){var c=fs;if(c){var h=c;if(!d6(a,c)){if(Bv(a))throw Error(n(418));c=Jo(h.nextSibling);var y=ds;c&&d6(a,c)?u6(y,h):(a.flags=a.flags&-4097|2,dn=!1,ds=a)}}else{if(Bv(a))throw Error(n(418));a.flags=a.flags&-4097|2,dn=!1,ds=a}}}function f6(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;ds=a}function Ap(a){if(a!==ds)return!1;if(!dn)return f6(a),dn=!0,!1;var c;if((c=a.tag!==3)&&!(c=a.tag!==5)&&(c=a.type,c=c!=="head"&&c!=="body"&&!Dv(a.type,a.memoizedProps)),c&&(c=fs)){if(Bv(a))throw h6(),Error(n(418));for(;c;)u6(a,c),c=Jo(c.nextSibling)}if(f6(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){fs=Jo(a.nextSibling);break e}c--}else h!=="$"&&h!=="$!"&&h!=="$?"||c++}a=a.nextSibling}fs=null}}else fs=ds?Jo(a.stateNode.nextSibling):null;return!0}function h6(){for(var a=fs;a;)a=Jo(a.nextSibling)}function Zc(){fs=ds=null,dn=!1}function Wv(a){ni===null?ni=[a]:ni.push(a)}var uD=R.ReactCurrentBatchConfig;function Bd(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(L){var V=k.refs;L===null?delete V[P]:V[P]=L},c._stringRef=P,c)}if(typeof a!="string")throw Error(n(284));if(!h._owner)throw Error(n(290,a))}return a}function Tp(a,c){throw a=Object.prototype.toString.call(c),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":a))}function p6(a){var c=a._init;return c(a._payload)}function m6(a){function c(te,Y){if(a){var ne=te.deletions;ne===null?(te.deletions=[Y],te.flags|=16):ne.push(Y)}}function h(te,Y){if(!a)return null;for(;Y!==null;)c(te,Y),Y=Y.sibling;return null}function y(te,Y){for(te=new Map;Y!==null;)Y.key!==null?te.set(Y.key,Y):te.set(Y.index,Y),Y=Y.sibling;return te}function k(te,Y){return te=ua(te,Y),te.index=0,te.sibling=null,te}function P(te,Y,ne){return te.index=ne,a?(ne=te.alternate,ne!==null?(ne=ne.index,ne<Y?(te.flags|=2,Y):ne):(te.flags|=2,Y)):(te.flags|=1048576,Y)}function L(te){return a&&te.alternate===null&&(te.flags|=2),te}function V(te,Y,ne,be){return Y===null||Y.tag!==6?(Y=j1(ne,te.mode,be),Y.return=te,Y):(Y=k(Y,ne),Y.return=te,Y)}function G(te,Y,ne,be){var ze=ne.type;return ze===I?ge(te,Y,ne.props.children,be,ne.key):Y!==null&&(Y.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===Z&&p6(ze)===Y.type)?(be=k(Y,ne.props),be.ref=Bd(te,Y,ne),be.return=te,be):(be=e0(ne.type,ne.key,ne.props,null,te.mode,be),be.ref=Bd(te,Y,ne),be.return=te,be)}function ie(te,Y,ne,be){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==ne.containerInfo||Y.stateNode.implementation!==ne.implementation?(Y=$1(ne,te.mode,be),Y.return=te,Y):(Y=k(Y,ne.children||[]),Y.return=te,Y)}function ge(te,Y,ne,be,ze){return Y===null||Y.tag!==7?(Y=Sl(ne,te.mode,be,ze),Y.return=te,Y):(Y=k(Y,ne),Y.return=te,Y)}function ye(te,Y,ne){if(typeof Y=="string"&&Y!==""||typeof Y=="number")return Y=j1(""+Y,te.mode,ne),Y.return=te,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case A:return ne=e0(Y.type,Y.key,Y.props,null,te.mode,ne),ne.ref=Bd(te,null,Y),ne.return=te,ne;case O:return Y=$1(Y,te.mode,ne),Y.return=te,Y;case Z:var be=Y._init;return ye(te,be(Y._payload),ne)}if(St(Y)||ee(Y))return Y=Sl(Y,te.mode,ne,null),Y.return=te,Y;Tp(te,Y)}return null}function me(te,Y,ne,be){var ze=Y!==null?Y.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number")return ze!==null?null:V(te,Y,""+ne,be);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case A:return ne.key===ze?G(te,Y,ne,be):null;case O:return ne.key===ze?ie(te,Y,ne,be):null;case Z:return ze=ne._init,me(te,Y,ze(ne._payload),be)}if(St(ne)||ee(ne))return ze!==null?null:ge(te,Y,ne,be,null);Tp(te,ne)}return null}function Ie(te,Y,ne,be,ze){if(typeof be=="string"&&be!==""||typeof be=="number")return te=te.get(ne)||null,V(Y,te,""+be,ze);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case A:return te=te.get(be.key===null?ne:be.key)||null,G(Y,te,be,ze);case O:return te=te.get(be.key===null?ne:be.key)||null,ie(Y,te,be,ze);case Z:var Je=be._init;return Ie(te,Y,ne,Je(be._payload),ze)}if(St(be)||ee(be))return te=te.get(ne)||null,ge(Y,te,be,ze,null);Tp(Y,be)}return null}function $e(te,Y,ne,be){for(var ze=null,Je=null,et=Y,rt=Y=0,tr=null;et!==null&&rt<ne.length;rt++){et.index>rt?(tr=et,et=null):tr=et.sibling;var Nt=me(te,et,ne[rt],be);if(Nt===null){et===null&&(et=tr);break}a&&et&&Nt.alternate===null&&c(te,et),Y=P(Nt,Y,rt),Je===null?ze=Nt:Je.sibling=Nt,Je=Nt,et=tr}if(rt===ne.length)return h(te,et),dn&&ml(te,rt),ze;if(et===null){for(;rt<ne.length;rt++)et=ye(te,ne[rt],be),et!==null&&(Y=P(et,Y,rt),Je===null?ze=et:Je.sibling=et,Je=et);return dn&&ml(te,rt),ze}for(et=y(te,et);rt<ne.length;rt++)tr=Ie(et,te,rt,ne[rt],be),tr!==null&&(a&&tr.alternate!==null&&et.delete(tr.key===null?rt:tr.key),Y=P(tr,Y,rt),Je===null?ze=tr:Je.sibling=tr,Je=tr);return a&&et.forEach(function(da){return c(te,da)}),dn&&ml(te,rt),ze}function He(te,Y,ne,be){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=Y,rt=Y=0,tr=null,Nt=ne.next();et!==null&&!Nt.done;rt++,Nt=ne.next()){et.index>rt?(tr=et,et=null):tr=et.sibling;var da=me(te,et,Nt.value,be);if(da===null){et===null&&(et=tr);break}a&&et&&da.alternate===null&&c(te,et),Y=P(da,Y,rt),Je===null?ze=da:Je.sibling=da,Je=da,et=tr}if(Nt.done)return h(te,et),dn&&ml(te,rt),ze;if(et===null){for(;!Nt.done;rt++,Nt=ne.next())Nt=ye(te,Nt.value,be),Nt!==null&&(Y=P(Nt,Y,rt),Je===null?ze=Nt:Je.sibling=Nt,Je=Nt);return dn&&ml(te,rt),ze}for(et=y(te,et);!Nt.done;rt++,Nt=ne.next())Nt=Ie(et,te,rt,Nt.value,be),Nt!==null&&(a&&Nt.alternate!==null&&et.delete(Nt.key===null?rt:Nt.key),Y=P(Nt,Y,rt),Je===null?ze=Nt:Je.sibling=Nt,Je=Nt);return a&&et.forEach(function(UD){return c(te,UD)}),dn&&ml(te,rt),ze}function An(te,Y,ne,be){if(typeof ne=="object"&&ne!==null&&ne.type===I&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case A:e:{for(var ze=ne.key,Je=Y;Je!==null;){if(Je.key===ze){if(ze=ne.type,ze===I){if(Je.tag===7){h(te,Je.sibling),Y=k(Je,ne.props.children),Y.return=te,te=Y;break e}}else if(Je.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===Z&&p6(ze)===Je.type){h(te,Je.sibling),Y=k(Je,ne.props),Y.ref=Bd(te,Je,ne),Y.return=te,te=Y;break e}h(te,Je);break}else c(te,Je);Je=Je.sibling}ne.type===I?(Y=Sl(ne.props.children,te.mode,be,ne.key),Y.return=te,te=Y):(be=e0(ne.type,ne.key,ne.props,null,te.mode,be),be.ref=Bd(te,Y,ne),be.return=te,te=be)}return L(te);case O:e:{for(Je=ne.key;Y!==null;){if(Y.key===Je)if(Y.tag===4&&Y.stateNode.containerInfo===ne.containerInfo&&Y.stateNode.implementation===ne.implementation){h(te,Y.sibling),Y=k(Y,ne.children||[]),Y.return=te,te=Y;break e}else{h(te,Y);break}else c(te,Y);Y=Y.sibling}Y=$1(ne,te.mode,be),Y.return=te,te=Y}return L(te);case Z:return Je=ne._init,An(te,Y,Je(ne._payload),be)}if(St(ne))return $e(te,Y,ne,be);if(ee(ne))return He(te,Y,ne,be);Tp(te,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"?(ne=""+ne,Y!==null&&Y.tag===6?(h(te,Y.sibling),Y=k(Y,ne),Y.return=te,te=Y):(h(te,Y),Y=j1(ne,te.mode,be),Y.return=te,te=Y),L(te)):h(te,Y)}return An}var Wc=m6(!0),g6=m6(!1),Ip=ea(null),Mp=null,qc=null,qv=null;function Gv(){qv=qc=Mp=null}function Kv(a){var c=Ip.current;sn(Ip),a._currentValue=c}function Yv(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 Gc(a,c){Mp=a,qv=qc=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&c)!==0&&(Hr=!0),a.firstContext=null)}function Ds(a){var c=a._currentValue;if(qv!==a)if(a={context:a,memoizedValue:c,next:null},qc===null){if(Mp===null)throw Error(n(308));qc=a,Mp.dependencies={lanes:0,firstContext:a}}else qc=qc.next=a;return c}var gl=null;function Xv(a){gl===null?gl=[a]:gl.push(a)}function v6(a,c,h,y){var k=c.interleaved;return k===null?(h.next=h,Xv(c)):(h.next=k.next,k.next=h),c.interleaved=h,co(a,y)}function co(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 ra=!1;function Qv(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function y6(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 uo(a,c){return{eventTime:a,lane:c,tag:0,payload:null,callback:null,next:null}}function sa(a,c,h){var y=a.updateQueue;if(y===null)return null;if(y=y.shared,(Pt&2)!==0){var k=y.pending;return k===null?c.next=c:(c.next=k.next,k.next=c),y.pending=c,co(a,h)}return k=y.interleaved,k===null?(c.next=c,Xv(y)):(c.next=k.next,k.next=c),y.interleaved=c,co(a,h)}function Op(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,Td(a,h)}}function _6(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 L={eventTime:h.eventTime,lane:h.lane,tag:h.tag,payload:h.payload,callback:h.callback,next:null};P===null?k=P=L:P=P.next=L,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 Lp(a,c,h,y){var k=a.updateQueue;ra=!1;var P=k.firstBaseUpdate,L=k.lastBaseUpdate,V=k.shared.pending;if(V!==null){k.shared.pending=null;var G=V,ie=G.next;G.next=null,L===null?P=ie:L.next=ie,L=G;var ge=a.alternate;ge!==null&&(ge=ge.updateQueue,V=ge.lastBaseUpdate,V!==L&&(V===null?ge.firstBaseUpdate=ie:V.next=ie,ge.lastBaseUpdate=G))}if(P!==null){var ye=k.baseState;L=0,ge=ie=G=null,V=P;do{var me=V.lane,Ie=V.eventTime;if((y&me)===me){ge!==null&&(ge=ge.next={eventTime:Ie,lane:0,tag:V.tag,payload:V.payload,callback:V.callback,next:null});e:{var $e=a,He=V;switch(me=c,Ie=h,He.tag){case 1:if($e=He.payload,typeof $e=="function"){ye=$e.call(Ie,ye,me);break e}ye=$e;break e;case 3:$e.flags=$e.flags&-65537|128;case 0:if($e=He.payload,me=typeof $e=="function"?$e.call(Ie,ye,me):$e,me==null)break e;ye=W({},ye,me);break e;case 2:ra=!0}}V.callback!==null&&V.lane!==0&&(a.flags|=64,me=k.effects,me===null?k.effects=[V]:me.push(V))}else Ie={eventTime:Ie,lane:me,tag:V.tag,payload:V.payload,callback:V.callback,next:null},ge===null?(ie=ge=Ie,G=ye):ge=ge.next=Ie,L|=me;if(V=V.next,V===null){if(V=k.shared.pending,V===null)break;me=V,V=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 L|=k.lane,k=k.next;while(k!==c)}else P===null&&(k.shared.lanes=0);_l|=L,a.lanes=L,a.memoizedState=ye}}function x6(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 Zd={},bi=ea(Zd),Wd=ea(Zd),qd=ea(Zd);function vl(a){if(a===Zd)throw Error(n(174));return a}function Jv(a,c){switch(Jt(qd,c),Jt(Wd,a),Jt(bi,Zd),a=c.nodeType,a){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:gr(null,"");break;default:a=a===8?c.parentNode:c,c=a.namespaceURI||null,a=a.tagName,c=gr(c,a)}sn(bi),Jt(bi,c)}function Kc(){sn(bi),sn(Wd),sn(qd)}function w6(a){vl(qd.current);var c=vl(bi.current),h=gr(c,a.type);c!==h&&(Jt(Wd,a),Jt(bi,h))}function e1(a){Wd.current===a&&(sn(bi),sn(Wd))}var yn=ea(0);function Np(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 t1=[];function n1(){for(var a=0;a<t1.length;a++)t1[a]._workInProgressVersionPrimary=null;t1.length=0}var Dp=R.ReactCurrentDispatcher,r1=R.ReactCurrentBatchConfig,yl=0,_n=null,Un=null,Jn=null,jp=!1,Gd=!1,Kd=0,dD=0;function _r(){throw Error(n(321))}function s1(a,c){if(c===null)return!1;for(var h=0;h<c.length&&h<a.length;h++)if(!ti(a[h],c[h]))return!1;return!0}function i1(a,c,h,y,k,P){if(yl=P,_n=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Dp.current=a===null||a.memoizedState===null?mD:gD,a=h(y,k),Gd){P=0;do{if(Gd=!1,Kd=0,25<=P)throw Error(n(301));P+=1,Jn=Un=null,c.updateQueue=null,Dp.current=vD,a=h(y,k)}while(Gd)}if(Dp.current=Vp,c=Un!==null&&Un.next!==null,yl=0,Jn=Un=_n=null,jp=!1,c)throw Error(n(300));return a}function o1(){var a=Kd!==0;return Kd=0,a}function Si(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Jn===null?_n.memoizedState=Jn=a:Jn=Jn.next=a,Jn}function js(){if(Un===null){var a=_n.alternate;a=a!==null?a.memoizedState:null}else a=Un.next;var c=Jn===null?_n.memoizedState:Jn.next;if(c!==null)Jn=c,Un=a;else{if(a===null)throw Error(n(310));Un=a,a={memoizedState:Un.memoizedState,baseState:Un.baseState,baseQueue:Un.baseQueue,queue:Un.queue,next:null},Jn===null?_n.memoizedState=Jn=a:Jn=Jn.next=a}return Jn}function Yd(a,c){return typeof c=="function"?c(a):c}function a1(a){var c=js(),h=c.queue;if(h===null)throw Error(n(311));h.lastRenderedReducer=a;var y=Un,k=y.baseQueue,P=h.pending;if(P!==null){if(k!==null){var L=k.next;k.next=P.next,P.next=L}y.baseQueue=k=P,h.pending=null}if(k!==null){P=k.next,y=y.baseState;var V=L=null,G=null,ie=P;do{var ge=ie.lane;if((yl&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?(V=G=ye,L=y):G=G.next=ye,_n.lanes|=ge,_l|=ge}ie=ie.next}while(ie!==null&&ie!==P);G===null?L=y:G.next=V,ti(y,c.memoizedState)||(Hr=!0),c.memoizedState=y,c.baseState=L,c.baseQueue=G,h.lastRenderedState=y}if(a=h.interleaved,a!==null){k=a;do P=k.lane,_n.lanes|=P,_l|=P,k=k.next;while(k!==a)}else k===null&&(h.lanes=0);return[c.memoizedState,h.dispatch]}function l1(a){var c=js(),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 L=k=k.next;do P=a(P,L.action),L=L.next;while(L!==k);ti(P,c.memoizedState)||(Hr=!0),c.memoizedState=P,c.baseQueue===null&&(c.baseState=P),h.lastRenderedState=P}return[P,y]}function b6(){}function S6(a,c){var h=_n,y=js(),k=c(),P=!ti(y.memoizedState,k);if(P&&(y.memoizedState=k,Hr=!0),y=y.queue,c1(C6.bind(null,h,y,a),[a]),y.getSnapshot!==c||P||Jn!==null&&Jn.memoizedState.tag&1){if(h.flags|=2048,Xd(9,E6.bind(null,h,y,k,c),void 0,null),er===null)throw Error(n(349));(yl&30)!==0||k6(h,c,k)}return k}function k6(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 E6(a,c,h,y){c.value=h,c.getSnapshot=y,P6(c)&&R6(a)}function C6(a,c,h){return h(function(){P6(c)&&R6(a)})}function P6(a){var c=a.getSnapshot;a=a.value;try{var h=c();return!ti(a,h)}catch{return!0}}function R6(a){var c=co(a,1);c!==null&&oi(c,a,1,-1)}function A6(a){var c=Si();return typeof a=="function"&&(a=a()),c.memoizedState=c.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Yd,lastRenderedState:a},c.queue=a,a=a.dispatch=pD.bind(null,_n,a),[c.memoizedState,a]}function Xd(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 T6(){return js().memoizedState}function $p(a,c,h,y){var k=Si();_n.flags|=a,k.memoizedState=Xd(1|c,h,void 0,y===void 0?null:y)}function Fp(a,c,h,y){var k=js();y=y===void 0?null:y;var P=void 0;if(Un!==null){var L=Un.memoizedState;if(P=L.destroy,y!==null&&s1(y,L.deps)){k.memoizedState=Xd(c,h,P,y);return}}_n.flags|=a,k.memoizedState=Xd(1|c,h,P,y)}function I6(a,c){return $p(8390656,8,a,c)}function c1(a,c){return Fp(2048,8,a,c)}function M6(a,c){return Fp(4,2,a,c)}function O6(a,c){return Fp(4,4,a,c)}function L6(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 N6(a,c,h){return h=h!=null?h.concat([a]):null,Fp(4,4,L6.bind(null,c,a),h)}function u1(){}function D6(a,c){var h=js();c=c===void 0?null:c;var y=h.memoizedState;return y!==null&&c!==null&&s1(c,y[1])?y[0]:(h.memoizedState=[a,c],a)}function j6(a,c){var h=js();c=c===void 0?null:c;var y=h.memoizedState;return y!==null&&c!==null&&s1(c,y[1])?y[0]:(a=a(),h.memoizedState=[a,c],a)}function $6(a,c,h){return(yl&21)===0?(a.baseState&&(a.baseState=!1,Hr=!0),a.memoizedState=h):(ti(h,c)||(h=op(),_n.lanes|=h,_l|=h,a.baseState=!0),c)}function fD(a,c){var h=$t;$t=h!==0&&4>h?h:4,a(!0);var y=r1.transition;r1.transition={};try{a(!1),c()}finally{$t=h,r1.transition=y}}function F6(){return js().memoizedState}function hD(a,c,h){var y=la(a);if(h={lane:y,action:h,hasEagerState:!1,eagerState:null,next:null},V6(a))H6(c,h);else if(h=v6(a,c,h,y),h!==null){var k=Rr();oi(h,a,y,k),z6(h,c,y)}}function pD(a,c,h){var y=la(a),k={lane:y,action:h,hasEagerState:!1,eagerState:null,next:null};if(V6(a))H6(c,k);else{var P=a.alternate;if(a.lanes===0&&(P===null||P.lanes===0)&&(P=c.lastRenderedReducer,P!==null))try{var L=c.lastRenderedState,V=P(L,h);if(k.hasEagerState=!0,k.eagerState=V,ti(V,L)){var G=c.interleaved;G===null?(k.next=k,Xv(c)):(k.next=G.next,G.next=k),c.interleaved=k;return}}catch{}finally{}h=v6(a,c,k,y),h!==null&&(k=Rr(),oi(h,a,y,k),z6(h,c,y))}}function V6(a){var c=a.alternate;return a===_n||c!==null&&c===_n}function H6(a,c){Gd=jp=!0;var h=a.pending;h===null?c.next=c:(c.next=h.next,h.next=c),a.pending=c}function z6(a,c,h){if((h&4194240)!==0){var y=c.lanes;y&=a.pendingLanes,h|=y,c.lanes=h,Td(a,h)}}var Vp={readContext:Ds,useCallback:_r,useContext:_r,useEffect:_r,useImperativeHandle:_r,useInsertionEffect:_r,useLayoutEffect:_r,useMemo:_r,useReducer:_r,useRef:_r,useState:_r,useDebugValue:_r,useDeferredValue:_r,useTransition:_r,useMutableSource:_r,useSyncExternalStore:_r,useId:_r,unstable_isNewReconciler:!1},mD={readContext:Ds,useCallback:function(a,c){return Si().memoizedState=[a,c===void 0?null:c],a},useContext:Ds,useEffect:I6,useImperativeHandle:function(a,c,h){return h=h!=null?h.concat([a]):null,$p(4194308,4,L6.bind(null,c,a),h)},useLayoutEffect:function(a,c){return $p(4194308,4,a,c)},useInsertionEffect:function(a,c){return $p(4,2,a,c)},useMemo:function(a,c){var h=Si();return c=c===void 0?null:c,a=a(),h.memoizedState=[a,c],a},useReducer:function(a,c,h){var y=Si();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=hD.bind(null,_n,a),[y.memoizedState,a]},useRef:function(a){var c=Si();return a={current:a},c.memoizedState=a},useState:A6,useDebugValue:u1,useDeferredValue:function(a){return Si().memoizedState=a},useTransition:function(){var a=A6(!1),c=a[0];return a=fD.bind(null,a[1]),Si().memoizedState=a,[c,a]},useMutableSource:function(){},useSyncExternalStore:function(a,c,h){var y=_n,k=Si();if(dn){if(h===void 0)throw Error(n(407));h=h()}else{if(h=c(),er===null)throw Error(n(349));(yl&30)!==0||k6(y,c,h)}k.memoizedState=h;var P={value:h,getSnapshot:c};return k.queue=P,I6(C6.bind(null,y,P,a),[a]),y.flags|=2048,Xd(9,E6.bind(null,y,P,h,c),void 0,null),h},useId:function(){var a=Si(),c=er.identifierPrefix;if(dn){var h=lo,y=ao;h=(y&~(1<<32-os(y)-1)).toString(32)+h,c=":"+c+"R"+h,h=Kd++,0<h&&(c+="H"+h.toString(32)),c+=":"}else h=dD++,c=":"+c+"r"+h.toString(32)+":";return a.memoizedState=c},unstable_isNewReconciler:!1},gD={readContext:Ds,useCallback:D6,useContext:Ds,useEffect:c1,useImperativeHandle:N6,useInsertionEffect:M6,useLayoutEffect:O6,useMemo:j6,useReducer:a1,useRef:T6,useState:function(){return a1(Yd)},useDebugValue:u1,useDeferredValue:function(a){var c=js();return $6(c,Un.memoizedState,a)},useTransition:function(){var a=a1(Yd)[0],c=js().memoizedState;return[a,c]},useMutableSource:b6,useSyncExternalStore:S6,useId:F6,unstable_isNewReconciler:!1},vD={readContext:Ds,useCallback:D6,useContext:Ds,useEffect:c1,useImperativeHandle:N6,useInsertionEffect:M6,useLayoutEffect:O6,useMemo:j6,useReducer:l1,useRef:T6,useState:function(){return l1(Yd)},useDebugValue:u1,useDeferredValue:function(a){var c=js();return Un===null?c.memoizedState=a:$6(c,Un.memoizedState,a)},useTransition:function(){var a=l1(Yd)[0],c=js().memoizedState;return[a,c]},useMutableSource:b6,useSyncExternalStore:S6,useId:F6,unstable_isNewReconciler:!1};function ri(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 d1(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 Hp={isMounted:function(a){return(a=a._reactInternals)?Is(a)===a:!1},enqueueSetState:function(a,c,h){a=a._reactInternals;var y=Rr(),k=la(a),P=uo(y,k);P.payload=c,h!=null&&(P.callback=h),c=sa(a,P,k),c!==null&&(oi(c,a,k,y),Op(c,a,k))},enqueueReplaceState:function(a,c,h){a=a._reactInternals;var y=Rr(),k=la(a),P=uo(y,k);P.tag=1,P.payload=c,h!=null&&(P.callback=h),c=sa(a,P,k),c!==null&&(oi(c,a,k,y),Op(c,a,k))},enqueueForceUpdate:function(a,c){a=a._reactInternals;var h=Rr(),y=la(a),k=uo(h,y);k.tag=2,c!=null&&(k.callback=c),c=sa(a,k,y),c!==null&&(oi(c,a,y,h),Op(c,a,y))}};function U6(a,c,h,y,k,P,L){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(y,P,L):c.prototype&&c.prototype.isPureReactComponent?!jd(h,y)||!jd(k,P):!0}function B6(a,c,h){var y=!1,k=ta,P=c.contextType;return typeof P=="object"&&P!==null?P=Ds(P):(k=Vr(c)?hl:yr.current,y=c.contextTypes,P=(y=y!=null)?zc(a,k):ta),c=new c(h,P),a.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Hp,a.stateNode=c,c._reactInternals=a,y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=k,a.__reactInternalMemoizedMaskedChildContext=P),c}function Z6(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&&Hp.enqueueReplaceState(c,c.state,null)}function f1(a,c,h,y){var k=a.stateNode;k.props=h,k.state=a.memoizedState,k.refs={},Qv(a);var P=c.contextType;typeof P=="object"&&P!==null?k.context=Ds(P):(P=Vr(c)?hl:yr.current,k.context=zc(a,P)),k.state=a.memoizedState,P=c.getDerivedStateFromProps,typeof P=="function"&&(d1(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&&Hp.enqueueReplaceState(k,k.state,null),Lp(a,h,k,y),k.state=a.memoizedState),typeof k.componentDidMount=="function"&&(a.flags|=4194308)}function Yc(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 h1(a,c,h){return{value:a,source:null,stack:h??null,digest:c??null}}function p1(a,c){try{console.error(c.value)}catch(h){setTimeout(function(){throw h})}}var yD=typeof WeakMap=="function"?WeakMap:Map;function W6(a,c,h){h=uo(-1,h),h.tag=3,h.payload={element:null};var y=c.value;return h.callback=function(){Gp||(Gp=!0,A1=y),p1(a,c)},h}function q6(a,c,h){h=uo(-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(){p1(a,c)}}var P=a.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(h.callback=function(){p1(a,c),typeof y!="function"&&(oa===null?oa=new Set([this]):oa.add(this));var L=c.stack;this.componentDidCatch(c.value,{componentStack:L!==null?L:""})}),h}function G6(a,c,h){var y=a.pingCache;if(y===null){y=a.pingCache=new yD;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=MD.bind(null,a,c,h),c.then(a,a))}function K6(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 Y6(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=uo(-1,1),c.tag=2,sa(h,c,1))),h.lanes|=1),a):(a.flags|=65536,a.lanes=k,a)}var _D=R.ReactCurrentOwner,Hr=!1;function Pr(a,c,h,y){c.child=a===null?g6(c,null,h,y):Wc(c,a.child,h,y)}function X6(a,c,h,y,k){h=h.render;var P=c.ref;return Gc(c,k),y=i1(a,c,h,y,P,k),h=o1(),a!==null&&!Hr?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~k,fo(a,c,k)):(dn&&h&&zv(c),c.flags|=1,Pr(a,c,y,k),c.child)}function Q6(a,c,h,y,k){if(a===null){var P=h.type;return typeof P=="function"&&!D1(P)&&P.defaultProps===void 0&&h.compare===null&&h.defaultProps===void 0?(c.tag=15,c.type=P,J6(a,c,P,y,k)):(a=e0(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 L=P.memoizedProps;if(h=h.compare,h=h!==null?h:jd,h(L,y)&&a.ref===c.ref)return fo(a,c,k)}return c.flags|=1,a=ua(P,y),a.ref=c.ref,a.return=c,c.child=a}function J6(a,c,h,y,k){if(a!==null){var P=a.memoizedProps;if(jd(P,y)&&a.ref===c.ref)if(Hr=!1,c.pendingProps=y=P,(a.lanes&k)!==0)(a.flags&131072)!==0&&(Hr=!0);else return c.lanes=a.lanes,fo(a,c,k)}return m1(a,c,h,y,k)}function e8(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},Jt(Qc,hs),hs|=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,Jt(Qc,hs),hs|=a,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=P!==null?P.baseLanes:h,Jt(Qc,hs),hs|=y}else P!==null?(y=P.baseLanes|h,c.memoizedState=null):y=h,Jt(Qc,hs),hs|=y;return Pr(a,c,k,h),c.child}function t8(a,c){var h=c.ref;(a===null&&h!==null||a!==null&&a.ref!==h)&&(c.flags|=512,c.flags|=2097152)}function m1(a,c,h,y,k){var P=Vr(h)?hl:yr.current;return P=zc(c,P),Gc(c,k),h=i1(a,c,h,y,P,k),y=o1(),a!==null&&!Hr?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~k,fo(a,c,k)):(dn&&y&&zv(c),c.flags|=1,Pr(a,c,h,k),c.child)}function n8(a,c,h,y,k){if(Vr(h)){var P=!0;Ep(c)}else P=!1;if(Gc(c,k),c.stateNode===null)Up(a,c),B6(c,h,y),f1(c,h,y,k),y=!0;else if(a===null){var L=c.stateNode,V=c.memoizedProps;L.props=V;var G=L.context,ie=h.contextType;typeof ie=="object"&&ie!==null?ie=Ds(ie):(ie=Vr(h)?hl:yr.current,ie=zc(c,ie));var ge=h.getDerivedStateFromProps,ye=typeof ge=="function"||typeof L.getSnapshotBeforeUpdate=="function";ye||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(V!==y||G!==ie)&&Z6(c,L,y,ie),ra=!1;var me=c.memoizedState;L.state=me,Lp(c,y,L,k),G=c.memoizedState,V!==y||me!==G||Fr.current||ra?(typeof ge=="function"&&(d1(c,h,ge,y),G=c.memoizedState),(V=ra||U6(c,h,V,y,me,G,ie))?(ye||typeof L.UNSAFE_componentWillMount!="function"&&typeof L.componentWillMount!="function"||(typeof L.componentWillMount=="function"&&L.componentWillMount(),typeof L.UNSAFE_componentWillMount=="function"&&L.UNSAFE_componentWillMount()),typeof L.componentDidMount=="function"&&(c.flags|=4194308)):(typeof L.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=G),L.props=y,L.state=G,L.context=ie,y=V):(typeof L.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{L=c.stateNode,y6(a,c),V=c.memoizedProps,ie=c.type===c.elementType?V:ri(c.type,V),L.props=ie,ye=c.pendingProps,me=L.context,G=h.contextType,typeof G=="object"&&G!==null?G=Ds(G):(G=Vr(h)?hl:yr.current,G=zc(c,G));var Ie=h.getDerivedStateFromProps;(ge=typeof Ie=="function"||typeof L.getSnapshotBeforeUpdate=="function")||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(V!==ye||me!==G)&&Z6(c,L,y,G),ra=!1,me=c.memoizedState,L.state=me,Lp(c,y,L,k);var $e=c.memoizedState;V!==ye||me!==$e||Fr.current||ra?(typeof Ie=="function"&&(d1(c,h,Ie,y),$e=c.memoizedState),(ie=ra||U6(c,h,ie,y,me,$e,G)||!1)?(ge||typeof L.UNSAFE_componentWillUpdate!="function"&&typeof L.componentWillUpdate!="function"||(typeof L.componentWillUpdate=="function"&&L.componentWillUpdate(y,$e,G),typeof L.UNSAFE_componentWillUpdate=="function"&&L.UNSAFE_componentWillUpdate(y,$e,G)),typeof L.componentDidUpdate=="function"&&(c.flags|=4),typeof L.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof L.componentDidUpdate!="function"||V===a.memoizedProps&&me===a.memoizedState||(c.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||V===a.memoizedProps&&me===a.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=$e),L.props=y,L.state=$e,L.context=G,y=ie):(typeof L.componentDidUpdate!="function"||V===a.memoizedProps&&me===a.memoizedState||(c.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||V===a.memoizedProps&&me===a.memoizedState||(c.flags|=1024),y=!1)}return g1(a,c,h,y,P,k)}function g1(a,c,h,y,k,P){t8(a,c);var L=(c.flags&128)!==0;if(!y&&!L)return k&&a6(c,h,!1),fo(a,c,P);y=c.stateNode,_D.current=c;var V=L&&typeof h.getDerivedStateFromError!="function"?null:y.render();return c.flags|=1,a!==null&&L?(c.child=Wc(c,a.child,null,P),c.child=Wc(c,null,V,P)):Pr(a,c,V,P),c.memoizedState=y.state,k&&a6(c,h,!0),c.child}function r8(a){var c=a.stateNode;c.pendingContext?i6(a,c.pendingContext,c.pendingContext!==c.context):c.context&&i6(a,c.context,!1),Jv(a,c.containerInfo)}function s8(a,c,h,y,k){return Zc(),Wv(k),c.flags|=256,Pr(a,c,h,y),c.child}var v1={dehydrated:null,treeContext:null,retryLane:0};function y1(a){return{baseLanes:a,cachePool:null,transitions:null}}function i8(a,c,h){var y=c.pendingProps,k=yn.current,P=!1,L=(c.flags&128)!==0,V;if((V=L)||(V=a!==null&&a.memoizedState===null?!1:(k&2)!==0),V?(P=!0,c.flags&=-129):(a===null||a.memoizedState!==null)&&(k|=1),Jt(yn,k&1),a===null)return Zv(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):(L=y.children,a=y.fallback,P?(y=c.mode,P=c.child,L={mode:"hidden",children:L},(y&1)===0&&P!==null?(P.childLanes=0,P.pendingProps=L):P=t0(L,y,0,null),a=Sl(a,y,h,null),P.return=c,a.return=c,P.sibling=a,c.child=P,c.child.memoizedState=y1(h),c.memoizedState=v1,a):_1(c,L));if(k=a.memoizedState,k!==null&&(V=k.dehydrated,V!==null))return xD(a,c,L,y,V,k,h);if(P){P=y.fallback,L=c.mode,k=a.child,V=k.sibling;var G={mode:"hidden",children:y.children};return(L&1)===0&&c.child!==k?(y=c.child,y.childLanes=0,y.pendingProps=G,c.deletions=null):(y=ua(k,G),y.subtreeFlags=k.subtreeFlags&14680064),V!==null?P=ua(V,P):(P=Sl(P,L,h,null),P.flags|=2),P.return=c,y.return=c,y.sibling=P,c.child=y,y=P,P=c.child,L=a.child.memoizedState,L=L===null?y1(h):{baseLanes:L.baseLanes|h,cachePool:null,transitions:L.transitions},P.memoizedState=L,P.childLanes=a.childLanes&~h,c.memoizedState=v1,y}return P=a.child,a=P.sibling,y=ua(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 _1(a,c){return c=t0({mode:"visible",children:c},a.mode,0,null),c.return=a,a.child=c}function zp(a,c,h,y){return y!==null&&Wv(y),Wc(c,a.child,null,h),a=_1(c,c.pendingProps.children),a.flags|=2,c.memoizedState=null,a}function xD(a,c,h,y,k,P,L){if(h)return c.flags&256?(c.flags&=-257,y=h1(Error(n(422))),zp(a,c,L,y)):c.memoizedState!==null?(c.child=a.child,c.flags|=128,null):(P=y.fallback,k=c.mode,y=t0({mode:"visible",children:y.children},k,0,null),P=Sl(P,k,L,null),P.flags|=2,y.return=c,P.return=c,y.sibling=P,c.child=y,(c.mode&1)!==0&&Wc(c,a.child,null,L),c.child.memoizedState=y1(L),c.memoizedState=v1,P);if((c.mode&1)===0)return zp(a,c,L,null);if(k.data==="$!"){if(y=k.nextSibling&&k.nextSibling.dataset,y)var V=y.dgst;return y=V,P=Error(n(419)),y=h1(P,y,void 0),zp(a,c,L,y)}if(V=(L&a.childLanes)!==0,Hr||V){if(y=er,y!==null){switch(L&-L){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|L))!==0?0:k,k!==0&&k!==P.retryLane&&(P.retryLane=k,co(a,k),oi(y,a,k,-1))}return N1(),y=h1(Error(n(421))),zp(a,c,L,y)}return k.data==="$?"?(c.flags|=128,c.child=a.child,c=OD.bind(null,a),k._reactRetry=c,null):(a=P.treeContext,fs=Jo(k.nextSibling),ds=c,dn=!0,ni=null,a!==null&&(Ls[Ns++]=ao,Ls[Ns++]=lo,Ls[Ns++]=pl,ao=a.id,lo=a.overflow,pl=c),c=_1(c,y.children),c.flags|=4096,c)}function o8(a,c,h){a.lanes|=c;var y=a.alternate;y!==null&&(y.lanes|=c),Yv(a.return,c,h)}function x1(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 a8(a,c,h){var y=c.pendingProps,k=y.revealOrder,P=y.tail;if(Pr(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&&o8(a,h,c);else if(a.tag===19)o8(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(Jt(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&&Np(a)===null&&(k=h),h=h.sibling;h=k,h===null?(k=c.child,c.child=null):(k=h.sibling,h.sibling=null),x1(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&&Np(a)===null){c.child=k;break}a=k.sibling,k.sibling=h,h=k,k=a}x1(c,!0,h,null,P);break;case"together":x1(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Up(a,c){(c.mode&1)===0&&a!==null&&(a.alternate=null,c.alternate=null,c.flags|=2)}function fo(a,c,h){if(a!==null&&(c.dependencies=a.dependencies),_l|=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=ua(a,a.pendingProps),c.child=h,h.return=c;a.sibling!==null;)a=a.sibling,h=h.sibling=ua(a,a.pendingProps),h.return=c;h.sibling=null}return c.child}function wD(a,c,h){switch(c.tag){case 3:r8(c),Zc();break;case 5:w6(c);break;case 1:Vr(c.type)&&Ep(c);break;case 4:Jv(c,c.stateNode.containerInfo);break;case 10:var y=c.type._context,k=c.memoizedProps.value;Jt(Ip,y._currentValue),y._currentValue=k;break;case 13:if(y=c.memoizedState,y!==null)return y.dehydrated!==null?(Jt(yn,yn.current&1),c.flags|=128,null):(h&c.child.childLanes)!==0?i8(a,c,h):(Jt(yn,yn.current&1),a=fo(a,c,h),a!==null?a.sibling:null);Jt(yn,yn.current&1);break;case 19:if(y=(h&c.childLanes)!==0,(a.flags&128)!==0){if(y)return a8(a,c,h);c.flags|=128}if(k=c.memoizedState,k!==null&&(k.rendering=null,k.tail=null,k.lastEffect=null),Jt(yn,yn.current),y)break;return null;case 22:case 23:return c.lanes=0,e8(a,c,h)}return fo(a,c,h)}var l8,w1,c8,u8;l8=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}},w1=function(){},c8=function(a,c,h,y){var k=a.memoizedProps;if(k!==y){a=c.stateNode,vl(bi.current);var P=null;switch(h){case"input":k=Mt(a,k),y=Mt(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=bp)}As(h,y);var L;h=null;for(ie in k)if(!y.hasOwnProperty(ie)&&k.hasOwnProperty(ie)&&k[ie]!=null)if(ie==="style"){var V=k[ie];for(L in V)V.hasOwnProperty(L)&&(h||(h={}),h[L]="")}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(V=k!=null?k[ie]:void 0,y.hasOwnProperty(ie)&&G!==V&&(G!=null||V!=null))if(ie==="style")if(V){for(L in V)!V.hasOwnProperty(L)||G&&G.hasOwnProperty(L)||(h||(h={}),h[L]="");for(L in G)G.hasOwnProperty(L)&&V[L]!==G[L]&&(h||(h={}),h[L]=G[L])}else h||(P||(P=[]),P.push(ie,h)),h=G;else ie==="dangerouslySetInnerHTML"?(G=G?G.__html:void 0,V=V?V.__html:void 0,G!=null&&V!==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"&&rn("scroll",a),P||V===G||(P=[])):(P=P||[]).push(ie,G))}h&&(P=P||[]).push("style",h);var ie=P;(c.updateQueue=ie)&&(c.flags|=4)}},u8=function(a,c,h,y){h!==y&&(c.flags|=4)};function Qd(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 xr(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 bD(a,c,h){var y=c.pendingProps;switch(Uv(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xr(c),null;case 1:return Vr(c.type)&&kp(),xr(c),null;case 3:return y=c.stateNode,Kc(),sn(Fr),sn(yr),n1(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(a===null||a.child===null)&&(Ap(c)?c.flags|=4:a===null||a.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,ni!==null&&(M1(ni),ni=null))),w1(a,c),xr(c),null;case 5:e1(c);var k=vl(qd.current);if(h=c.type,a!==null&&c.stateNode!=null)c8(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 xr(c),null}if(a=vl(bi.current),Ap(c)){y=c.stateNode,h=c.type;var P=c.memoizedProps;switch(y[wi]=c,y[zd]=P,a=(c.mode&1)!==0,h){case"dialog":rn("cancel",y),rn("close",y);break;case"iframe":case"object":case"embed":rn("load",y);break;case"video":case"audio":for(k=0;k<Fd.length;k++)rn(Fd[k],y);break;case"source":rn("error",y);break;case"img":case"image":case"link":rn("error",y),rn("load",y);break;case"details":rn("toggle",y);break;case"input":Xt(y,P),rn("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!P.multiple},rn("invalid",y);break;case"textarea":Ot(y,P),rn("invalid",y)}As(h,P),k=null;for(var L in P)if(P.hasOwnProperty(L)){var V=P[L];L==="children"?typeof V=="string"?y.textContent!==V&&(P.suppressHydrationWarning!==!0&&wp(y.textContent,V,a),k=["children",V]):typeof V=="number"&&y.textContent!==""+V&&(P.suppressHydrationWarning!==!0&&wp(y.textContent,V,a),k=["children",""+V]):s.hasOwnProperty(L)&&V!=null&&L==="onScroll"&&rn("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=bp)}y=k,c.updateQueue=y,y!==null&&(c.flags|=4)}else{L=k.nodeType===9?k:k.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=rs(h)),a==="http://www.w3.org/1999/xhtml"?h==="script"?(a=L.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof y.is=="string"?a=L.createElement(h,{is:y.is}):(a=L.createElement(h),h==="select"&&(L=a,y.multiple?L.multiple=!0:y.size&&(L.size=y.size))):a=L.createElementNS(a,h),a[wi]=c,a[zd]=y,l8(a,c,!1,!1),c.stateNode=a;e:{switch(L=vr(h,y),h){case"dialog":rn("cancel",a),rn("close",a),k=y;break;case"iframe":case"object":case"embed":rn("load",a),k=y;break;case"video":case"audio":for(k=0;k<Fd.length;k++)rn(Fd[k],a);k=y;break;case"source":rn("error",a),k=y;break;case"img":case"image":case"link":rn("error",a),rn("load",a),k=y;break;case"details":rn("toggle",a),k=y;break;case"input":Xt(a,y),k=Mt(a,y),rn("invalid",a);break;case"option":k=y;break;case"select":a._wrapperState={wasMultiple:!!y.multiple},k=W({},y,{value:void 0}),rn("invalid",a);break;case"textarea":Ot(a,y),k=Ye(a,y),rn("invalid",a);break;default:k=y}As(h,k),V=k;for(P in V)if(V.hasOwnProperty(P)){var G=V[P];P==="style"?gn(a,G):P==="dangerouslySetInnerHTML"?(G=G?G.__html:void 0,G!=null&&Wo(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"&&rn("scroll",a):G!=null&&C(a,P,G,L))}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=bp)}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 xr(c),null;case 6:if(a&&c.stateNode!=null)u8(a,c,a.memoizedProps,y);else{if(typeof y!="string"&&c.stateNode===null)throw Error(n(166));if(h=vl(qd.current),vl(bi.current),Ap(c)){if(y=c.stateNode,h=c.memoizedProps,y[wi]=c,(P=y.nodeValue!==h)&&(a=ds,a!==null))switch(a.tag){case 3:wp(y.nodeValue,h,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&wp(y.nodeValue,h,(a.mode&1)!==0)}P&&(c.flags|=4)}else y=(h.nodeType===9?h:h.ownerDocument).createTextNode(y),y[wi]=c,c.stateNode=y}return xr(c),null;case 13:if(sn(yn),y=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(dn&&fs!==null&&(c.mode&1)!==0&&(c.flags&128)===0)h6(),Zc(),c.flags|=98560,P=!1;else if(P=Ap(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[wi]=c}else Zc(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;xr(c),P=!1}else ni!==null&&(M1(ni),ni=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?Bn===0&&(Bn=3):N1())),c.updateQueue!==null&&(c.flags|=4),xr(c),null);case 4:return Kc(),w1(a,c),a===null&&Vd(c.stateNode.containerInfo),xr(c),null;case 10:return Kv(c.type._context),xr(c),null;case 17:return Vr(c.type)&&kp(),xr(c),null;case 19:if(sn(yn),P=c.memoizedState,P===null)return xr(c),null;if(y=(c.flags&128)!==0,L=P.rendering,L===null)if(y)Qd(P,!1);else{if(Bn!==0||a!==null&&(a.flags&128)!==0)for(a=c.child;a!==null;){if(L=Np(a),L!==null){for(c.flags|=128,Qd(P,!1),y=L.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,L=P.alternate,L===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=L.childLanes,P.lanes=L.lanes,P.child=L.child,P.subtreeFlags=0,P.deletions=null,P.memoizedProps=L.memoizedProps,P.memoizedState=L.memoizedState,P.updateQueue=L.updateQueue,P.type=L.type,a=L.dependencies,P.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),h=h.sibling;return Jt(yn,yn.current&1|2),c.child}a=a.sibling}P.tail!==null&&Qt()>Jc&&(c.flags|=128,y=!0,Qd(P,!1),c.lanes=4194304)}else{if(!y)if(a=Np(L),a!==null){if(c.flags|=128,y=!0,h=a.updateQueue,h!==null&&(c.updateQueue=h,c.flags|=4),Qd(P,!0),P.tail===null&&P.tailMode==="hidden"&&!L.alternate&&!dn)return xr(c),null}else 2*Qt()-P.renderingStartTime>Jc&&h!==1073741824&&(c.flags|=128,y=!0,Qd(P,!1),c.lanes=4194304);P.isBackwards?(L.sibling=c.child,c.child=L):(h=P.last,h!==null?h.sibling=L:c.child=L,P.last=L)}return P.tail!==null?(c=P.tail,P.rendering=c,P.tail=c.sibling,P.renderingStartTime=Qt(),c.sibling=null,h=yn.current,Jt(yn,y?h&1|2:h&1),c):(xr(c),null);case 22:case 23:return L1(),y=c.memoizedState!==null,a!==null&&a.memoizedState!==null!==y&&(c.flags|=8192),y&&(c.mode&1)!==0?(hs&1073741824)!==0&&(xr(c),c.subtreeFlags&6&&(c.flags|=8192)):xr(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function SD(a,c){switch(Uv(c),c.tag){case 1:return Vr(c.type)&&kp(),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return Kc(),sn(Fr),sn(yr),n1(),a=c.flags,(a&65536)!==0&&(a&128)===0?(c.flags=a&-65537|128,c):null;case 5:return e1(c),null;case 13:if(sn(yn),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(n(340));Zc()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return sn(yn),null;case 4:return Kc(),null;case 10:return Kv(c.type._context),null;case 22:case 23:return L1(),null;case 24:return null;default:return null}}var Bp=!1,wr=!1,kD=typeof WeakSet=="function"?WeakSet:Set,Ne=null;function Xc(a,c){var h=a.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(y){En(a,c,y)}else h.current=null}function b1(a,c,h){try{h()}catch(y){En(a,c,y)}}var d8=!1;function ED(a,c){if(Lv=Cr,a=U4(),Cv(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 L=0,V=-1,G=-1,ie=0,ge=0,ye=a,me=null;t:for(;;){for(var Ie;ye!==h||k!==0&&ye.nodeType!==3||(V=L+k),ye!==P||y!==0&&ye.nodeType!==3||(G=L+y),ye.nodeType===3&&(L+=ye.nodeValue.length),(Ie=ye.firstChild)!==null;)me=ye,ye=Ie;for(;;){if(ye===a)break t;if(me===h&&++ie===k&&(V=L),me===P&&++ge===y&&(G=L),(Ie=ye.nextSibling)!==null)break;ye=me,me=ye.parentNode}ye=Ie}h=V===-1||G===-1?null:{start:V,end:G}}else h=null}h=h||{start:0,end:0}}else h=null;for(Nv={focusedElem:a,selectionRange:h},Cr=!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 $e=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if($e!==null){var He=$e.memoizedProps,An=$e.memoizedState,te=c.stateNode,Y=te.getSnapshotBeforeUpdate(c.elementType===c.type?He:ri(c.type,He),An);te.__reactInternalSnapshotBeforeUpdate=Y}break;case 3:var ne=c.stateNode.containerInfo;ne.nodeType===1?ne.textContent="":ne.nodeType===9&&ne.documentElement&&ne.removeChild(ne.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(be){En(c,c.return,be)}if(a=c.sibling,a!==null){a.return=c.return,Ne=a;break}Ne=c.return}return $e=d8,d8=!1,$e}function Jd(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&&b1(c,h,P)}k=k.next}while(k!==y)}}function Zp(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 S1(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 f8(a){var c=a.alternate;c!==null&&(a.alternate=null,f8(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&(delete c[wi],delete c[zd],delete c[Fv],delete c[aD],delete c[lD])),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 h8(a){return a.tag===5||a.tag===3||a.tag===4}function p8(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||h8(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 k1(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=bp));else if(y!==4&&(a=a.child,a!==null))for(k1(a,c,h),a=a.sibling;a!==null;)k1(a,c,h),a=a.sibling}function E1(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(E1(a,c,h),a=a.sibling;a!==null;)E1(a,c,h),a=a.sibling}var lr=null,si=!1;function ia(a,c,h){for(h=h.child;h!==null;)m8(a,c,h),h=h.sibling}function m8(a,c,h){if(Ms&&typeof Ms.onCommitFiberUnmount=="function")try{Ms.onCommitFiberUnmount(Rc,h)}catch{}switch(h.tag){case 5:wr||Xc(h,c);case 6:var y=lr,k=si;lr=null,ia(a,c,h),lr=y,si=k,lr!==null&&(si?(a=lr,h=h.stateNode,a.nodeType===8?a.parentNode.removeChild(h):a.removeChild(h)):lr.removeChild(h.stateNode));break;case 18:lr!==null&&(si?(a=lr,h=h.stateNode,a.nodeType===8?$v(a.parentNode,h):a.nodeType===1&&$v(a,h),nn(a)):$v(lr,h.stateNode));break;case 4:y=lr,k=si,lr=h.stateNode.containerInfo,si=!0,ia(a,c,h),lr=y,si=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,L=P.destroy;P=P.tag,L!==void 0&&((P&2)!==0||(P&4)!==0)&&b1(h,c,L),k=k.next}while(k!==y)}ia(a,c,h);break;case 1:if(!wr&&(Xc(h,c),y=h.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=h.memoizedProps,y.state=h.memoizedState,y.componentWillUnmount()}catch(V){En(h,c,V)}ia(a,c,h);break;case 21:ia(a,c,h);break;case 22:h.mode&1?(wr=(y=wr)||h.memoizedState!==null,ia(a,c,h),wr=y):ia(a,c,h);break;default:ia(a,c,h)}}function g8(a){var c=a.updateQueue;if(c!==null){a.updateQueue=null;var h=a.stateNode;h===null&&(h=a.stateNode=new kD),c.forEach(function(y){var k=LD.bind(null,a,y);h.has(y)||(h.add(y),y.then(k,k))})}}function ii(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,L=c,V=L;e:for(;V!==null;){switch(V.tag){case 5:lr=V.stateNode,si=!1;break e;case 3:lr=V.stateNode.containerInfo,si=!0;break e;case 4:lr=V.stateNode.containerInfo,si=!0;break e}V=V.return}if(lr===null)throw Error(n(160));m8(P,L,k),lr=null,si=!1;var G=k.alternate;G!==null&&(G.return=null),k.return=null}catch(ie){En(k,c,ie)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)v8(c,a),c=c.sibling}function v8(a,c){var h=a.alternate,y=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(ii(c,a),ki(a),y&4){try{Jd(3,a,a.return),Zp(3,a)}catch(He){En(a,a.return,He)}try{Jd(5,a,a.return)}catch(He){En(a,a.return,He)}}break;case 1:ii(c,a),ki(a),y&512&&h!==null&&Xc(h,h.return);break;case 5:if(ii(c,a),ki(a),y&512&&h!==null&&Xc(h,h.return),a.flags&32){var k=a.stateNode;try{Mn(k,"")}catch(He){En(a,a.return,He)}}if(y&4&&(k=a.stateNode,k!=null)){var P=a.memoizedProps,L=h!==null?h.memoizedProps:P,V=a.type,G=a.updateQueue;if(a.updateQueue=null,G!==null)try{V==="input"&&P.type==="radio"&&P.name!=null&&xt(k,P),vr(V,L);var ie=vr(V,P);for(L=0;L<G.length;L+=2){var ge=G[L],ye=G[L+1];ge==="style"?gn(k,ye):ge==="dangerouslySetInnerHTML"?Wo(k,ye):ge==="children"?Mn(k,ye):C(k,ge,ye,ie)}switch(V){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 Ie=P.value;Ie!=null?Re(k,!!P.multiple,Ie,!1):me!==!!P.multiple&&(P.defaultValue!=null?Re(k,!!P.multiple,P.defaultValue,!0):Re(k,!!P.multiple,P.multiple?[]:"",!1))}k[zd]=P}catch(He){En(a,a.return,He)}}break;case 6:if(ii(c,a),ki(a),y&4){if(a.stateNode===null)throw Error(n(162));k=a.stateNode,P=a.memoizedProps;try{k.nodeValue=P}catch(He){En(a,a.return,He)}}break;case 3:if(ii(c,a),ki(a),y&4&&h!==null&&h.memoizedState.isDehydrated)try{nn(c.containerInfo)}catch(He){En(a,a.return,He)}break;case 4:ii(c,a),ki(a);break;case 13:ii(c,a),ki(a),k=a.child,k.flags&8192&&(P=k.memoizedState!==null,k.stateNode.isHidden=P,!P||k.alternate!==null&&k.alternate.memoizedState!==null||(R1=Qt())),y&4&&g8(a);break;case 22:if(ge=h!==null&&h.memoizedState!==null,a.mode&1?(wr=(ie=wr)||ge,ii(c,a),wr=ie):ii(c,a),ki(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,Ie=me.child,me.tag){case 0:case 11:case 14:case 15:Jd(4,me,me.return);break;case 1:Xc(me,me.return);var $e=me.stateNode;if(typeof $e.componentWillUnmount=="function"){y=me,h=me.return;try{c=y,$e.props=c.memoizedProps,$e.state=c.memoizedState,$e.componentWillUnmount()}catch(He){En(y,h,He)}}break;case 5:Xc(me,me.return);break;case 22:if(me.memoizedState!==null){x8(ye);continue}}Ie!==null?(Ie.return=me,Ne=Ie):x8(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"):(V=ye.stateNode,G=ye.memoizedProps.style,L=G!=null&&G.hasOwnProperty("display")?G.display:null,V.style.display=mn("display",L))}catch(He){En(a,a.return,He)}}}else if(ye.tag===6){if(ge===null)try{ye.stateNode.nodeValue=ie?"":ye.memoizedProps}catch(He){En(a,a.return,He)}}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:ii(c,a),ki(a),y&4&&g8(a);break;case 21:break;default:ii(c,a),ki(a)}}function ki(a){var c=a.flags;if(c&2){try{e:{for(var h=a.return;h!==null;){if(h8(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=p8(a);E1(a,P,k);break;case 3:case 4:var L=y.stateNode.containerInfo,V=p8(a);k1(a,V,L);break;default:throw Error(n(161))}}catch(G){En(a,a.return,G)}a.flags&=-3}c&4096&&(a.flags&=-4097)}function CD(a,c,h){Ne=a,y8(a)}function y8(a,c,h){for(var y=(a.mode&1)!==0;Ne!==null;){var k=Ne,P=k.child;if(k.tag===22&&y){var L=k.memoizedState!==null||Bp;if(!L){var V=k.alternate,G=V!==null&&V.memoizedState!==null||wr;V=Bp;var ie=wr;if(Bp=L,(wr=G)&&!ie)for(Ne=k;Ne!==null;)L=Ne,G=L.child,L.tag===22&&L.memoizedState!==null?w8(k):G!==null?(G.return=L,Ne=G):w8(k);for(;P!==null;)Ne=P,y8(P),P=P.sibling;Ne=k,Bp=V,wr=ie}_8(a)}else(k.subtreeFlags&8772)!==0&&P!==null?(P.return=k,Ne=P):_8(a)}}function _8(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||Zp(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:ri(c.type,h.memoizedProps);y.componentDidUpdate(k,h.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var P=c.updateQueue;P!==null&&x6(c,P,y);break;case 3:var L=c.updateQueue;if(L!==null){if(h=null,c.child!==null)switch(c.child.tag){case 5:h=c.child.stateNode;break;case 1:h=c.child.stateNode}x6(c,L,h)}break;case 5:var V=c.stateNode;if(h===null&&c.flags&4){h=V;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&&nn(ye)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}wr||c.flags&512&&S1(c)}catch(me){En(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 x8(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 w8(a){for(;Ne!==null;){var c=Ne;try{switch(c.tag){case 0:case 11:case 15:var h=c.return;try{Zp(4,c)}catch(G){En(c,h,G)}break;case 1:var y=c.stateNode;if(typeof y.componentDidMount=="function"){var k=c.return;try{y.componentDidMount()}catch(G){En(c,k,G)}}var P=c.return;try{S1(c)}catch(G){En(c,P,G)}break;case 5:var L=c.return;try{S1(c)}catch(G){En(c,L,G)}}}catch(G){En(c,c.return,G)}if(c===a){Ne=null;break}var V=c.sibling;if(V!==null){V.return=c.return,Ne=V;break}Ne=c.return}}var PD=Math.ceil,Wp=R.ReactCurrentDispatcher,C1=R.ReactCurrentOwner,$s=R.ReactCurrentBatchConfig,Pt=0,er=null,Nn=null,cr=0,hs=0,Qc=ea(0),Bn=0,ef=null,_l=0,qp=0,P1=0,tf=null,zr=null,R1=0,Jc=1/0,ho=null,Gp=!1,A1=null,oa=null,Kp=!1,aa=null,Yp=0,nf=0,T1=null,Xp=-1,Qp=0;function Rr(){return(Pt&6)!==0?Qt():Xp!==-1?Xp:Xp=Qt()}function la(a){return(a.mode&1)===0?1:(Pt&2)!==0&&cr!==0?cr&-cr:uD.transition!==null?(Qp===0&&(Qp=op()),Qp):(a=$t,a!==0||(a=window.event,a=a===void 0?16:S4(a.type)),a)}function oi(a,c,h,y){if(50<nf)throw nf=0,T1=null,Error(n(185));ro(a,h,y),((Pt&2)===0||a!==er)&&(a===er&&((Pt&2)===0&&(qp|=h),Bn===4&&ca(a,cr)),Ur(a,y),h===1&&Pt===0&&(c.mode&1)===0&&(Jc=Qt()+500,Cp&&na()))}function Ur(a,c){var h=a.callbackNode;gv(a,c);var y=Ic(a,a===er?cr:0);if(y===0)h!==null&&qo(h),a.callbackNode=null,a.callbackPriority=0;else if(c=y&-y,a.callbackPriority!==c){if(h!=null&&qo(h),c===1)a.tag===0?cD(S8.bind(null,a)):l6(S8.bind(null,a)),iD(function(){(Pt&6)===0&&na()}),h=null;else{switch(so(y)){case 1:h=kd;break;case 4:h=sp;break;case 16:h=Go;break;case 536870912:h=Cd;break;default:h=Go}h=I8(h,b8.bind(null,a))}a.callbackPriority=c,a.callbackNode=h}}function b8(a,c){if(Xp=-1,Qp=0,(Pt&6)!==0)throw Error(n(327));var h=a.callbackNode;if(eu()&&a.callbackNode!==h)return null;var y=Ic(a,a===er?cr:0);if(y===0)return null;if((y&30)!==0||(y&a.expiredLanes)!==0||c)c=Jp(a,y);else{c=y;var k=Pt;Pt|=2;var P=E8();(er!==a||cr!==c)&&(ho=null,Jc=Qt()+500,wl(a,c));do try{TD();break}catch(V){k8(a,V)}while(!0);Gv(),Wp.current=P,Pt=k,Nn!==null?c=0:(er=null,cr=0,c=Bn)}if(c!==0){if(c===2&&(k=Ad(a),k!==0&&(y=k,c=I1(a,k))),c===1)throw h=ef,wl(a,0),ca(a,y),Ur(a,Qt()),h;if(c===6)ca(a,y);else{if(k=a.current.alternate,(y&30)===0&&!RD(k)&&(c=Jp(a,y),c===2&&(P=Ad(a),P!==0&&(y=P,c=I1(a,P))),c===1))throw h=ef,wl(a,0),ca(a,y),Ur(a,Qt()),h;switch(a.finishedWork=k,a.finishedLanes=y,c){case 0:case 1:throw Error(n(345));case 2:bl(a,zr,ho);break;case 3:if(ca(a,y),(y&130023424)===y&&(c=R1+500-Qt(),10<c)){if(Ic(a,0)!==0)break;if(k=a.suspendedLanes,(k&y)!==y){Rr(),a.pingedLanes|=a.suspendedLanes&k;break}a.timeoutHandle=jv(bl.bind(null,a,zr,ho),c);break}bl(a,zr,ho);break;case 4:if(ca(a,y),(y&4194240)===y)break;for(c=a.eventTimes,k=-1;0<y;){var L=31-os(y);P=1<<L,L=c[L],L>k&&(k=L),y&=~P}if(y=k,y=Qt()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*PD(y/1960))-y,10<y){a.timeoutHandle=jv(bl.bind(null,a,zr,ho),y);break}bl(a,zr,ho);break;case 5:bl(a,zr,ho);break;default:throw Error(n(329))}}}return Ur(a,Qt()),a.callbackNode===h?b8.bind(null,a):null}function I1(a,c){var h=tf;return a.current.memoizedState.isDehydrated&&(wl(a,c).flags|=256),a=Jp(a,c),a!==2&&(c=zr,zr=h,c!==null&&M1(c)),a}function M1(a){zr===null?zr=a:zr.push.apply(zr,a)}function RD(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(!ti(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 ca(a,c){for(c&=~P1,c&=~qp,a.suspendedLanes|=c,a.pingedLanes&=~c,a=a.expirationTimes;0<c;){var h=31-os(c),y=1<<h;a[h]=-1,c&=~y}}function S8(a){if((Pt&6)!==0)throw Error(n(327));eu();var c=Ic(a,0);if((c&1)===0)return Ur(a,Qt()),null;var h=Jp(a,c);if(a.tag!==0&&h===2){var y=Ad(a);y!==0&&(c=y,h=I1(a,y))}if(h===1)throw h=ef,wl(a,0),ca(a,c),Ur(a,Qt()),h;if(h===6)throw Error(n(345));return a.finishedWork=a.current.alternate,a.finishedLanes=c,bl(a,zr,ho),Ur(a,Qt()),null}function O1(a,c){var h=Pt;Pt|=1;try{return a(c)}finally{Pt=h,Pt===0&&(Jc=Qt()+500,Cp&&na())}}function xl(a){aa!==null&&aa.tag===0&&(Pt&6)===0&&eu();var c=Pt;Pt|=1;var h=$s.transition,y=$t;try{if($s.transition=null,$t=1,a)return a()}finally{$t=y,$s.transition=h,Pt=c,(Pt&6)===0&&na()}}function L1(){hs=Qc.current,sn(Qc)}function wl(a,c){a.finishedWork=null,a.finishedLanes=0;var h=a.timeoutHandle;if(h!==-1&&(a.timeoutHandle=-1,sD(h)),Nn!==null)for(h=Nn.return;h!==null;){var y=h;switch(Uv(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&kp();break;case 3:Kc(),sn(Fr),sn(yr),n1();break;case 5:e1(y);break;case 4:Kc();break;case 13:sn(yn);break;case 19:sn(yn);break;case 10:Kv(y.type._context);break;case 22:case 23:L1()}h=h.return}if(er=a,Nn=a=ua(a.current,null),cr=hs=c,Bn=0,ef=null,P1=qp=_l=0,zr=tf=null,gl!==null){for(c=0;c<gl.length;c++)if(h=gl[c],y=h.interleaved,y!==null){h.interleaved=null;var k=y.next,P=h.pending;if(P!==null){var L=P.next;P.next=k,y.next=L}h.pending=y}gl=null}return a}function k8(a,c){do{var h=Nn;try{if(Gv(),Dp.current=Vp,jp){for(var y=_n.memoizedState;y!==null;){var k=y.queue;k!==null&&(k.pending=null),y=y.next}jp=!1}if(yl=0,Jn=Un=_n=null,Gd=!1,Kd=0,C1.current=null,h===null||h.return===null){Bn=1,ef=c,Nn=null;break}e:{var P=a,L=h.return,V=h,G=c;if(c=cr,V.flags|=32768,G!==null&&typeof G=="object"&&typeof G.then=="function"){var ie=G,ge=V,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 Ie=K6(L);if(Ie!==null){Ie.flags&=-257,Y6(Ie,L,V,P,c),Ie.mode&1&&G6(P,ie,c),c=Ie,G=ie;var $e=c.updateQueue;if($e===null){var He=new Set;He.add(G),c.updateQueue=He}else $e.add(G);break e}else{if((c&1)===0){G6(P,ie,c),N1();break e}G=Error(n(426))}}else if(dn&&V.mode&1){var An=K6(L);if(An!==null){(An.flags&65536)===0&&(An.flags|=256),Y6(An,L,V,P,c),Wv(Yc(G,V));break e}}P=G=Yc(G,V),Bn!==4&&(Bn=2),tf===null?tf=[P]:tf.push(P),P=L;do{switch(P.tag){case 3:P.flags|=65536,c&=-c,P.lanes|=c;var te=W6(P,G,c);_6(P,te);break e;case 1:V=G;var Y=P.type,ne=P.stateNode;if((P.flags&128)===0&&(typeof Y.getDerivedStateFromError=="function"||ne!==null&&typeof ne.componentDidCatch=="function"&&(oa===null||!oa.has(ne)))){P.flags|=65536,c&=-c,P.lanes|=c;var be=q6(P,V,c);_6(P,be);break e}}P=P.return}while(P!==null)}P8(h)}catch(ze){c=ze,Nn===h&&h!==null&&(Nn=h=h.return);continue}break}while(!0)}function E8(){var a=Wp.current;return Wp.current=Vp,a===null?Vp:a}function N1(){(Bn===0||Bn===3||Bn===2)&&(Bn=4),er===null||(_l&268435455)===0&&(qp&268435455)===0||ca(er,cr)}function Jp(a,c){var h=Pt;Pt|=2;var y=E8();(er!==a||cr!==c)&&(ho=null,wl(a,c));do try{AD();break}catch(k){k8(a,k)}while(!0);if(Gv(),Pt=h,Wp.current=y,Nn!==null)throw Error(n(261));return er=null,cr=0,Bn}function AD(){for(;Nn!==null;)C8(Nn)}function TD(){for(;Nn!==null&&!Sd();)C8(Nn)}function C8(a){var c=T8(a.alternate,a,hs);a.memoizedProps=a.pendingProps,c===null?P8(a):Nn=c,C1.current=null}function P8(a){var c=a;do{var h=c.alternate;if(a=c.return,(c.flags&32768)===0){if(h=bD(h,c,hs),h!==null){Nn=h;return}}else{if(h=SD(h,c),h!==null){h.flags&=32767,Nn=h;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Bn=6,Nn=null;return}}if(c=c.sibling,c!==null){Nn=c;return}Nn=c=a}while(c!==null);Bn===0&&(Bn=5)}function bl(a,c,h){var y=$t,k=$s.transition;try{$s.transition=null,$t=1,ID(a,c,h,y)}finally{$s.transition=k,$t=y}return null}function ID(a,c,h,y){do eu();while(aa!==null);if((Pt&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(ap(a,P),a===er&&(Nn=er=null,cr=0),(h.subtreeFlags&2064)===0&&(h.flags&2064)===0||Kp||(Kp=!0,I8(Go,function(){return eu(),null})),P=(h.flags&15990)!==0,(h.subtreeFlags&15990)!==0||P){P=$s.transition,$s.transition=null;var L=$t;$t=1;var V=Pt;Pt|=4,C1.current=null,ED(a,h),v8(h,a),XN(Nv),Cr=!!Lv,Nv=Lv=null,a.current=h,CD(h),fv(),Pt=V,$t=L,$s.transition=P}else a.current=h;if(Kp&&(Kp=!1,aa=a,Yp=k),P=a.pendingLanes,P===0&&(oa=null),ip(h.stateNode),Ur(a,Qt()),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(Gp)throw Gp=!1,a=A1,A1=null,a;return(Yp&1)!==0&&a.tag!==0&&eu(),P=a.pendingLanes,(P&1)!==0?a===T1?nf++:(nf=0,T1=a):nf=0,na(),null}function eu(){if(aa!==null){var a=so(Yp),c=$s.transition,h=$t;try{if($s.transition=null,$t=16>a?16:a,aa===null)var y=!1;else{if(a=aa,aa=null,Yp=0,(Pt&6)!==0)throw Error(n(331));var k=Pt;for(Pt|=4,Ne=a.current;Ne!==null;){var P=Ne,L=P.child;if((Ne.flags&16)!==0){var V=P.deletions;if(V!==null){for(var G=0;G<V.length;G++){var ie=V[G];for(Ne=ie;Ne!==null;){var ge=Ne;switch(ge.tag){case 0:case 11:case 15:Jd(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,Ie=ge.return;if(f8(ge),ge===ie){Ne=null;break}if(me!==null){me.return=Ie,Ne=me;break}Ne=Ie}}}var $e=P.alternate;if($e!==null){var He=$e.child;if(He!==null){$e.child=null;do{var An=He.sibling;He.sibling=null,He=An}while(He!==null)}}Ne=P}}if((P.subtreeFlags&2064)!==0&&L!==null)L.return=P,Ne=L;else e:for(;Ne!==null;){if(P=Ne,(P.flags&2048)!==0)switch(P.tag){case 0:case 11:case 15:Jd(9,P,P.return)}var te=P.sibling;if(te!==null){te.return=P.return,Ne=te;break e}Ne=P.return}}var Y=a.current;for(Ne=Y;Ne!==null;){L=Ne;var ne=L.child;if((L.subtreeFlags&2064)!==0&&ne!==null)ne.return=L,Ne=ne;else e:for(L=Y;Ne!==null;){if(V=Ne,(V.flags&2048)!==0)try{switch(V.tag){case 0:case 11:case 15:Zp(9,V)}}catch(ze){En(V,V.return,ze)}if(V===L){Ne=null;break e}var be=V.sibling;if(be!==null){be.return=V.return,Ne=be;break e}Ne=V.return}}if(Pt=k,na(),Ms&&typeof Ms.onPostCommitFiberRoot=="function")try{Ms.onPostCommitFiberRoot(Rc,a)}catch{}y=!0}return y}finally{$t=h,$s.transition=c}}return!1}function R8(a,c,h){c=Yc(h,c),c=W6(a,c,1),a=sa(a,c,1),c=Rr(),a!==null&&(ro(a,1,c),Ur(a,c))}function En(a,c,h){if(a.tag===3)R8(a,a,h);else for(;c!==null;){if(c.tag===3){R8(c,a,h);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(oa===null||!oa.has(y))){a=Yc(h,a),a=q6(c,a,1),c=sa(c,a,1),a=Rr(),c!==null&&(ro(c,1,a),Ur(c,a));break}}c=c.return}}function MD(a,c,h){var y=a.pingCache;y!==null&&y.delete(c),c=Rr(),a.pingedLanes|=a.suspendedLanes&h,er===a&&(cr&h)===h&&(Bn===4||Bn===3&&(cr&130023424)===cr&&500>Qt()-R1?wl(a,0):P1|=h),Ur(a,c)}function A8(a,c){c===0&&((a.mode&1)===0?c=1:(c=Tc,Tc<<=1,(Tc&130023424)===0&&(Tc=4194304)));var h=Rr();a=co(a,c),a!==null&&(ro(a,c,h),Ur(a,h))}function OD(a){var c=a.memoizedState,h=0;c!==null&&(h=c.retryLane),A8(a,h)}function LD(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),A8(a,h)}var T8;T8=function(a,c,h){if(a!==null)if(a.memoizedProps!==c.pendingProps||Fr.current)Hr=!0;else{if((a.lanes&h)===0&&(c.flags&128)===0)return Hr=!1,wD(a,c,h);Hr=(a.flags&131072)!==0}else Hr=!1,dn&&(c.flags&1048576)!==0&&c6(c,Rp,c.index);switch(c.lanes=0,c.tag){case 2:var y=c.type;Up(a,c),a=c.pendingProps;var k=zc(c,yr.current);Gc(c,h),k=i1(null,c,y,a,k,h);var P=o1();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,Vr(y)?(P=!0,Ep(c)):P=!1,c.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,Qv(c),k.updater=Hp,c.stateNode=k,k._reactInternals=c,f1(c,y,a,h),c=g1(null,c,y,!0,P,h)):(c.tag=0,dn&&P&&zv(c),Pr(null,c,k,h),c=c.child),c;case 16:y=c.elementType;e:{switch(Up(a,c),a=c.pendingProps,k=y._init,y=k(y._payload),c.type=y,k=c.tag=DD(y),a=ri(y,a),k){case 0:c=m1(null,c,y,a,h);break e;case 1:c=n8(null,c,y,a,h);break e;case 11:c=X6(null,c,y,a,h);break e;case 14:c=Q6(null,c,y,ri(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:ri(y,k),m1(a,c,y,k,h);case 1:return y=c.type,k=c.pendingProps,k=c.elementType===y?k:ri(y,k),n8(a,c,y,k,h);case 3:e:{if(r8(c),a===null)throw Error(n(387));y=c.pendingProps,P=c.memoizedState,k=P.element,y6(a,c),Lp(c,y,null,h);var L=c.memoizedState;if(y=L.element,P.isDehydrated)if(P={element:y,isDehydrated:!1,cache:L.cache,pendingSuspenseBoundaries:L.pendingSuspenseBoundaries,transitions:L.transitions},c.updateQueue.baseState=P,c.memoizedState=P,c.flags&256){k=Yc(Error(n(423)),c),c=s8(a,c,y,h,k);break e}else if(y!==k){k=Yc(Error(n(424)),c),c=s8(a,c,y,h,k);break e}else for(fs=Jo(c.stateNode.containerInfo.firstChild),ds=c,dn=!0,ni=null,h=g6(c,null,y,h),c.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(Zc(),y===k){c=fo(a,c,h);break e}Pr(a,c,y,h)}c=c.child}return c;case 5:return w6(c),a===null&&Zv(c),y=c.type,k=c.pendingProps,P=a!==null?a.memoizedProps:null,L=k.children,Dv(y,k)?L=null:P!==null&&Dv(y,P)&&(c.flags|=32),t8(a,c),Pr(a,c,L,h),c.child;case 6:return a===null&&Zv(c),null;case 13:return i8(a,c,h);case 4:return Jv(c,c.stateNode.containerInfo),y=c.pendingProps,a===null?c.child=Wc(c,null,y,h):Pr(a,c,y,h),c.child;case 11:return y=c.type,k=c.pendingProps,k=c.elementType===y?k:ri(y,k),X6(a,c,y,k,h);case 7:return Pr(a,c,c.pendingProps,h),c.child;case 8:return Pr(a,c,c.pendingProps.children,h),c.child;case 12:return Pr(a,c,c.pendingProps.children,h),c.child;case 10:e:{if(y=c.type._context,k=c.pendingProps,P=c.memoizedProps,L=k.value,Jt(Ip,y._currentValue),y._currentValue=L,P!==null)if(ti(P.value,L)){if(P.children===k.children&&!Fr.current){c=fo(a,c,h);break e}}else for(P=c.child,P!==null&&(P.return=c);P!==null;){var V=P.dependencies;if(V!==null){L=P.child;for(var G=V.firstContext;G!==null;){if(G.context===y){if(P.tag===1){G=uo(-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),Yv(P.return,h,c),V.lanes|=h;break}G=G.next}}else if(P.tag===10)L=P.type===c.type?null:P.child;else if(P.tag===18){if(L=P.return,L===null)throw Error(n(341));L.lanes|=h,V=L.alternate,V!==null&&(V.lanes|=h),Yv(L,h,c),L=P.sibling}else L=P.child;if(L!==null)L.return=P;else for(L=P;L!==null;){if(L===c){L=null;break}if(P=L.sibling,P!==null){P.return=L.return,L=P;break}L=L.return}P=L}Pr(a,c,k.children,h),c=c.child}return c;case 9:return k=c.type,y=c.pendingProps.children,Gc(c,h),k=Ds(k),y=y(k),c.flags|=1,Pr(a,c,y,h),c.child;case 14:return y=c.type,k=ri(y,c.pendingProps),k=ri(y.type,k),Q6(a,c,y,k,h);case 15:return J6(a,c,c.type,c.pendingProps,h);case 17:return y=c.type,k=c.pendingProps,k=c.elementType===y?k:ri(y,k),Up(a,c),c.tag=1,Vr(y)?(a=!0,Ep(c)):a=!1,Gc(c,h),B6(c,y,k),f1(c,y,k,h),g1(null,c,y,!0,a,h);case 19:return a8(a,c,h);case 22:return e8(a,c,h)}throw Error(n(156,c.tag))};function I8(a,c){return Pc(a,c)}function ND(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 Fs(a,c,h,y){return new ND(a,c,h,y)}function D1(a){return a=a.prototype,!(!a||!a.isReactComponent)}function DD(a){if(typeof a=="function")return D1(a)?1:0;if(a!=null){if(a=a.$$typeof,a===$)return 11;if(a===z)return 14}return 2}function ua(a,c){var h=a.alternate;return h===null?(h=Fs(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 e0(a,c,h,y,k,P){var L=2;if(y=a,typeof a=="function")D1(a)&&(L=1);else if(typeof a=="string")L=5;else e:switch(a){case I:return Sl(h.children,k,P,c);case T:L=8,k|=8;break;case M:return a=Fs(12,h,c,k|2),a.elementType=M,a.lanes=P,a;case K:return a=Fs(13,h,c,k),a.elementType=K,a.lanes=P,a;case B:return a=Fs(19,h,c,k),a.elementType=B,a.lanes=P,a;case Q:return t0(h,k,P,c);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case N:L=10;break e;case j:L=9;break e;case $:L=11;break e;case z:L=14;break e;case Z:L=16,y=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return c=Fs(L,h,c,k),c.elementType=a,c.type=y,c.lanes=P,c}function Sl(a,c,h,y){return a=Fs(7,a,y,c),a.lanes=h,a}function t0(a,c,h,y){return a=Fs(22,a,y,c),a.elementType=Q,a.lanes=h,a.stateNode={isHidden:!1},a}function j1(a,c,h){return a=Fs(6,a,null,c),a.lanes=h,a}function $1(a,c,h){return c=Fs(4,a.children!==null?a.children:[],a.key,c),c.lanes=h,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function jD(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=ul(0),this.expirationTimes=ul(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ul(0),this.identifierPrefix=y,this.onRecoverableError=k,this.mutableSourceEagerHydrationData=null}function F1(a,c,h,y,k,P,L,V,G){return a=new jD(a,c,h,V,G),c===1?(c=1,P===!0&&(c|=8)):c=0,P=Fs(3,null,null,c),a.current=P,P.stateNode=a,P.memoizedState={element:y,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qv(P),a}function $D(a,c,h){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:O,key:y==null?null:""+y,children:a,containerInfo:c,implementation:h}}function M8(a){if(!a)return ta;a=a._reactInternals;e:{if(Is(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(Vr(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(Vr(h))return o6(a,h,c)}return c}function O8(a,c,h,y,k,P,L,V,G){return a=F1(h,y,!0,a,k,P,L,V,G),a.context=M8(null),h=a.current,y=Rr(),k=la(h),P=uo(y,k),P.callback=c??null,sa(h,P,k),a.current.lanes=k,ro(a,k,y),Ur(a,y),a}function n0(a,c,h,y){var k=c.current,P=Rr(),L=la(k);return h=M8(h),c.context===null?c.context=h:c.pendingContext=h,c=uo(P,L),c.payload={element:a},y=y===void 0?null:y,y!==null&&(c.callback=y),a=sa(k,c,L),a!==null&&(oi(a,k,L,P),Op(a,k,L)),L}function r0(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 L8(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var h=a.retryLane;a.retryLane=h!==0&&h<c?h:c}}function V1(a,c){L8(a,c),(a=a.alternate)&&L8(a,c)}function FD(){return null}var N8=typeof reportError=="function"?reportError:function(a){console.error(a)};function H1(a){this._internalRoot=a}s0.prototype.render=H1.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(n(409));n0(a,c,null,null)},s0.prototype.unmount=H1.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;xl(function(){n0(null,a,null,null)}),c[io]=null}};function s0(a){this._internalRoot=a}s0.prototype.unstable_scheduleHydration=function(a){if(a){var c=cp();a={blockedOn:null,target:a,priority:c};for(var h=0;h<Js.length&&c!==0&&c<Js[h].priority;h++);Js.splice(h,0,a),h===0&&he(a)}};function z1(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function i0(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function D8(){}function VD(a,c,h,y,k){if(k){if(typeof y=="function"){var P=y;y=function(){var ie=r0(L);P.call(ie)}}var L=O8(c,y,a,0,null,!1,!1,"",D8);return a._reactRootContainer=L,a[io]=L.current,Vd(a.nodeType===8?a.parentNode:a),xl(),L}for(;k=a.lastChild;)a.removeChild(k);if(typeof y=="function"){var V=y;y=function(){var ie=r0(G);V.call(ie)}}var G=F1(a,0,!1,null,null,!1,!1,"",D8);return a._reactRootContainer=G,a[io]=G.current,Vd(a.nodeType===8?a.parentNode:a),xl(function(){n0(c,G,h,y)}),G}function o0(a,c,h,y,k){var P=h._reactRootContainer;if(P){var L=P;if(typeof k=="function"){var V=k;k=function(){var G=r0(L);V.call(G)}}n0(c,L,a,k)}else L=VD(h,c,a,k,y);return r0(L)}Id=function(a){switch(a.tag){case 3:var c=a.stateNode;if(c.current.memoizedState.isDehydrated){var h=cl(c.pendingLanes);h!==0&&(Td(c,h|1),Ur(c,Qt()),(Pt&6)===0&&(Jc=Qt()+500,na()))}break;case 13:xl(function(){var y=co(a,1);if(y!==null){var k=Rr();oi(y,a,1,k)}}),V1(a,1)}},dl=function(a){if(a.tag===13){var c=co(a,134217728);if(c!==null){var h=Rr();oi(c,a,134217728,h)}V1(a,134217728)}},lp=function(a){if(a.tag===13){var c=la(a),h=co(a,c);if(h!==null){var y=Rr();oi(h,a,c,y)}V1(a,c)}},cp=function(){return $t},up=function(a,c){var h=$t;try{return $t=a,c()}finally{$t=h}},Ys=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=Sp(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=O1,Lt=xl;var HD={usingClientEntryPoint:!1,Events:[Ud,Vc,Sp,to,ss,O1]},rf={findFiberByHostInstance:fl,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},zD={bundleType:rf.bundleType,version:rf.version,rendererPackageName:rf.rendererPackageName,rendererConfig:rf.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=bd(a),a===null?null:a.stateNode},findFiberByHostInstance:rf.findFiberByHostInstance||FD,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 a0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!a0.isDisabled&&a0.supportsFiber)try{Rc=a0.inject(zD),Ms=a0}catch{}}return Br.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=HD,Br.createPortal=function(a,c){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!z1(c))throw Error(n(200));return $D(a,c,null,h)},Br.createRoot=function(a,c){if(!z1(a))throw Error(n(299));var h=!1,y="",k=N8;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onRecoverableError!==void 0&&(k=c.onRecoverableError)),c=F1(a,1,!1,null,null,h,!1,y,k),a[io]=c.current,Vd(a.nodeType===8?a.parentNode:a),new H1(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=bd(c),a=a===null?null:a.stateNode,a},Br.flushSync=function(a){return xl(a)},Br.hydrate=function(a,c,h){if(!i0(c))throw Error(n(200));return o0(null,a,c,!0,h)},Br.hydrateRoot=function(a,c,h){if(!z1(a))throw Error(n(405));var y=h!=null&&h.hydratedSources||null,k=!1,P="",L=N8;if(h!=null&&(h.unstable_strictMode===!0&&(k=!0),h.identifierPrefix!==void 0&&(P=h.identifierPrefix),h.onRecoverableError!==void 0&&(L=h.onRecoverableError)),c=O8(c,null,a,1,h??null,k,!1,P,L),a[io]=c.current,Vd(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 s0(c)},Br.render=function(a,c,h){if(!i0(c))throw Error(n(200));return o0(null,a,c,!1,h)},Br.unmountComponentAtNode=function(a){if(!i0(a))throw Error(n(40));return a._reactRootContainer?(xl(function(){o0(null,null,a,!1,function(){a._reactRootContainer=null,a[io]=null})}),!0):!1},Br.unstable_batchedUpdates=O1,Br.unstable_renderSubtreeIntoContainer=function(a,c,h,y){if(!i0(h))throw Error(n(200));if(a==null||a._reactInternals===void 0)throw Error(n(38));return o0(a,c,h,!1,y)},Br.version="18.3.1-next-f1338f8080-20240426",Br}var Mk;function qR(){if(Mk)return Ty.exports;Mk=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(),Ty.exports=kV(),Ty.exports}var Ok;function EV(){if(Ok)return _0;Ok=1;var t=qR();return _0.createRoot=t.createRoot,_0.hydrateRoot=t.hydrateRoot,_0}var CV=EV();const PV=Cg(CV),Mo={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function GR(t){return"init"in t}function E2(t){return typeof t.write=="function"}function RV(t){return!!t.onMount}function Lk(t){return"v"in t||"e"in t}function Vm(t){if("e"in t)throw t.e;if((Mo?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}function Hm(t){return typeof(t==null?void 0:t.then)=="function"}function AV(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 KR(t,e,n){if(!n.p.has(t)){n.p.add(t);const r=()=>n.p.delete(t);e.then(r,r)}}function YR(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 TV(t){return!!t.INTERNAL_onInit}const IV=(t,e,n,...r)=>n.read(...r),MV=(t,e,n,...r)=>n.write(...r),OV=(t,e,n)=>n.INTERNAL_onInit(e),LV=(t,e,n,r)=>{var s;return(s=n.onMount)==null?void 0:s.call(n,r)},NV=(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),TV(n)&&l(t,e,n)}return i},DV=(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 x of v)p.add(x)}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)},jV=(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 x of s)g.push(x),v.push(i(t,e,x));for(;g.length;){const x=g.length-1,_=g[x],w=v[x];if(p.has(_)){g.pop(),v.pop();continue}if(f.has(_)){if(r.get(_)===w.n)u.push(_),d.push(w);else if((Mo?"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 YR(_,w,n))f.has(b)||(g.push(b),v.push(i(t,e,b)))}for(let x=u.length-1;x>=0;--x){const _=u[x],w=d[x];let b=!1;for(const E of w.d.keys())if(E!==_&&s.has(E)){b=!0;break}b&&(r.set(_,w.n),o(t,e,_),l(t,e,_)),r.delete(_)}},C2=new WeakSet,$V=(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],x=t[16],_=t[17],w=t[20],b=t[26],E=t[28],C=f(t,e,n),R=E[0];if(Lk(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 O=new Set(C.d.keys()),I=()=>{for(const z of O)C.d.delete(z)},T=()=>{if(i.has(n)){const z=!l.size;_(t,e,n),z&&(g(t,e),p(t,e))}},M=z=>{var Z;if(z===n){const U=f(t,e,z);if(!Lk(U))if(GR(z))w(t,e,z,z.init);else throw new Error("no atom init");return Vm(U)}const Q=v(t,e,z);try{return Vm(Q)}finally{O.delete(z),C.d.set(z,Q.n),Hm(C.v)&&KR(n,C.v,Q),i.has(n)&&((Z=i.get(z))==null||Z.t.add(n)),A||T()}};let N,j;const $={get signal(){return N||(N=new AbortController),N.signal},get setSelf(){return(Mo?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(Mo?"production":void 0)!=="production"&&!E2(n)&&console.warn("setSelf function cannot be used with read-only atom"),!j&&E2(n)&&(j=(...z)=>{if((Mo?"production":void 0)!=="production"&&A&&console.warn("setSelf function cannot be called in sync"),!A)try{return x(t,e,n,z)}finally{g(t,e),p(t,e)}}),j}},K=C.n,B=o.get(n)===K;try{(Mo?"production":void 0)!=="production"&&C2.delete(e);const z=d(t,e,n,M,$);if((Mo?"production":void 0)!=="production"&&C2.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),w(t,e,n,z),Hm(z)){b(t,e,z,()=>N==null?void 0:N.abort());const Z=()=>{I(),T()};z.then(Z,Z)}else I();return(r=u.r)==null||r.call(u,n),C.m=R,C}catch(z){if(AV(z))throw z;return delete C.v,C.e=z,++C.n,C.m=R,C}finally{A=!1,C.n!==K&&B&&(o.set(n,C.n),l.add(n),(s=u.c)==null||s.call(u,n))}},FV=(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 YR(l,u,r)){const f=i(t,e,d);s.get(d)!==f.n&&(s.set(d,f.n),o.push(d))}}},VV=(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],x=t[20],_=t[28];let w=!0;const b=C=>Vm(f(t,e,C)),E=(C,...R)=>{var A;const O=l(t,e,C);try{if(C===n){if(!GR(C))throw new Error("atom not writable");(Mo?"production":void 0)!=="production"&&C2.add(e);const I=O.n,T=R[0];x(t,e,C,T),v(t,e,C),I!==O.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{w||(d(t,e),u(t,e))}};try{return o(t,e,n,b,E,...r)}finally{w=!1}},HV=(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,x]of p.d)if(!g.d.has(v)){const _=l(t,e,v);d(t,e,v).t.add(n),g.d.add(v),x!==_.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 x=f(t,e,v);x==null||x.t.delete(n)}}},zV=(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],x=u(t,e,n);let _=s.get(n);if(!_){p(t,e,n);for(const w of x.d.keys())v(t,e,w).t.add(n);if(_={l:new Set,d:new Set(x.d.keys()),t:new Set},s.set(n,_),E2(n)&&RV(n)){const w=()=>{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(w)}(r=o.m)==null||r.call(o,n)}return _},UV=(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 x=d(t,e,v);x==null||x.t.delete(n)}(s=l.u)==null||s.call(l,n);return}return p},BV=(t,e,n,r)=>{const s=t[11],i=t[27],o=s(t,e,n),l="v"in o,u=o.v;if(Hm(r))for(const d of o.d.keys())KR(n,r,s(t,e,d));o.v=r,delete o.e,(!l||!Object.is(u,o.v))&&(++o.n,Hm(u)&&i(t,e,u))},ZV=(t,e,n)=>{const r=t[14];return Vm(r(t,e,n))},WV=(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))}},qV=(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)}},GV=(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)},KV=(t,e,n)=>{const s=t[25].get(n);s==null||s.forEach(i=>i())},XR=new WeakMap;function YV(t){const e=XR.get(t);if((Mo?"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 XV(...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,{},IV,MV,OV,LV,NV,DV,jV,$V,FV,VV,HV,zV,UV,BV,ZV,WV,qV,void 0,new WeakMap,GV,KV,[0]].map((o,l)=>t[l]||o);XR.set(e,Object.freeze(n));const r=n[21],s=n[22],i=n[23];return e}const QR={};let QV=0;function dt(t,e){const n=`atom${++QV}`,r={toString(){return(QR?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=JV,r.write=eH),e&&(r.write=e),r}function JV(t){return t(this)}function eH(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function tH(){return XV()}let gf;function nH(){return gf||(gf=tH(),(QR?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=gf),globalThis.__JOTAI_DEFAULT_STORE__!==gf&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),gf}const rH={},sH=m.createContext(void 0);function Mg(t){return m.useContext(sH)||nH()}const P2=t=>typeof(t==null?void 0:t.then)=="function",R2=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},iH=xe.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(R2(t),t)}),Oy=new WeakMap,Nk=(t,e,n)=>{const r=YV(t),s=r[26];let i=Oy.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();P2(g)?(Oy.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)}),Oy.set(e,i)),i};function ct(t,e){const{delay:n,unstable_promiseStatus:r=!xe.use}={},s=Mg(),[[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);P2(p)&&R2(Nk(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),P2(d)){const f=Nk(s,d,()=>s.get(t));return r&&R2(f),iH(f)}return d}function gt(t,e){const n=Mg();return m.useCallback((...s)=>{if((rH?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...s)},[n,t])}function JR(t,e){return[ct(t),gt(t)]}const Tw=m.createContext({});function Iw(t){const e=m.useRef(null);return e.current===null&&(e.current=t()),e.current}const oH=typeof window<"u",Mw=oH?m.useLayoutEffect:m.useEffect,Og=m.createContext(null);function Ow(t,e){t.indexOf(e)===-1&&t.push(e)}function zm(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const qi=(t,e,n)=>n>e?e:n<t?t:n;let Lg=()=>{};const za={},eA=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),tA=t=>typeof t=="object"&&t!==null,nA=t=>/^0[^.\s]+$/u.test(t);function rA(t){let e;return()=>(e===void 0&&(e=t()),e)}const Gs=t=>t,Bh=(...t)=>t.reduce((e,n)=>r=>n(e(r))),dh=(t,e,n)=>{const r=e-t;return r?(n-t)/r:1};class Lw{constructor(){this.subscriptions=[]}add(e){return Ow(this.subscriptions,e),()=>zm(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 xs=t=>t*1e3,Bs=t=>t/1e3,sA=(t,e)=>e?t*(1e3/e):0,iA=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,aH=1e-7,lH=12;function cH(t,e,n,r,s){let i,o,l=0;do o=e+(n-e)/2,i=iA(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>aH&&++l<lH);return o}function Zh(t,e,n,r){if(t===e&&n===r)return Gs;const s=i=>cH(i,0,1,t,n);return i=>i===0||i===1?i:iA(s(i),e,r)}const oA=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,aA=t=>e=>1-t(1-e),lA=Zh(.33,1.53,.69,.99),Nw=aA(lA),cA=oA(Nw),uA=t=>t>=1?1:(t*=2)<1?.5*Nw(t):.5*(2-Math.pow(2,-10*(t-1))),Dw=t=>1-Math.sin(Math.acos(t)),dA=aA(Dw),fA=oA(Dw),uH=Zh(.42,0,1,1),dH=Zh(0,0,.58,1),hA=Zh(.42,0,.58,1),fH=t=>Array.isArray(t)&&typeof t[0]!="number",pA=t=>Array.isArray(t)&&typeof t[0]=="number",hH={linear:Gs,easeIn:uH,easeInOut:hA,easeOut:dH,circIn:Dw,circInOut:fA,circOut:dA,backIn:Nw,backInOut:cA,backOut:lA,anticipate:uA},pH=t=>typeof t=="string",Dk=t=>{if(pA(t)){Lg(t.length===4);const[e,n,r,s]=t;return Zh(e,n,r,s)}else if(pH(t))return hH[t];return t},x0=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function mH(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 gH=40;function mA(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=x0.reduce((C,R)=>(C[R]=mH(i),C),{}),{setup:l,read:u,resolveKeyframes:d,preUpdate:f,update:p,preRender:g,render:v,postRender:x}=o,_=()=>{const C=za.useManualTiming,R=C?s.timestamp:performance.now();n=!1,C||(s.delta=r?1e3/60:Math.max(Math.min(R-s.timestamp,gH),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),x.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(_))},w=()=>{n=!0,r=!0,s.isProcessing||t(_)};return{schedule:x0.reduce((C,R)=>{const A=o[R];return C[R]=(O,I=!1,T=!1)=>(n||w(),A.schedule(O,I,T)),C},{}),cancel:C=>{for(let R=0;R<x0.length;R++)o[x0[R]].cancel(C)},state:s,steps:o}}const{schedule:Yt,cancel:Ua,state:dr,steps:Ly}=mA(typeof requestAnimationFrame<"u"?requestAnimationFrame:Gs,!0);let Q0;function vH(){Q0=void 0}const Nr={now:()=>(Q0===void 0&&Nr.set(dr.isProcessing||za.useManualTiming?dr.timestamp:performance.now()),Q0),set:t=>{Q0=t,queueMicrotask(vH)}},gA=t=>e=>typeof e=="string"&&e.startsWith(t),vA=gA("--"),yH=gA("var(--"),jw=t=>yH(t)?_H.test(t.split("/*")[0].trim()):!1,_H=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function jk(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const hd={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},fh={...hd,transform:t=>qi(0,1,t)},w0={...hd,default:1},zf=t=>Math.round(t*1e5)/1e5,$w=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function xH(t){return t==null}const wH=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Fw=(t,e)=>n=>!!(typeof n=="string"&&wH.test(n)&&n.startsWith(t)||e&&!xH(n)&&Object.prototype.hasOwnProperty.call(n,e)),yA=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,l]=r.match($w);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},bH=t=>qi(0,255,t),Ny={...hd,transform:t=>Math.round(bH(t))},Ul={test:Fw("rgb","red"),parse:yA("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+Ny.transform(t)+", "+Ny.transform(e)+", "+Ny.transform(n)+", "+zf(fh.transform(r))+")"};function SH(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 A2={test:Fw("#"),parse:SH,transform:Ul.transform},Wh=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),bo=Wh("deg"),Ui=Wh("%"),Fe=Wh("px"),kH=Wh("vh"),EH=Wh("vw"),$k={...Ui,parse:t=>Ui.parse(t)/100,transform:t=>Ui.transform(t*100)},wu={test:Fw("hsl","hue"),parse:yA("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Ui.transform(zf(e))+", "+Ui.transform(zf(n))+", "+zf(fh.transform(r))+")"},$n={test:t=>Ul.test(t)||A2.test(t)||wu.test(t),parse:t=>Ul.test(t)?Ul.parse(t):wu.test(t)?wu.parse(t):A2.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Ul.transform(t):wu.transform(t),getAnimatableNone:t=>{const e=$n.parse(t);return e.alpha=0,$n.transform(e)}},CH=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function PH(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match($w))==null?void 0:e.length)||0)+(((n=t.match(CH))==null?void 0:n.length)||0)>0}const _A="number",xA="color",RH="var",AH="var(",Fk="${}",TH=/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 ed(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=e.replace(TH,u=>($n.test(u)?(r.color.push(i),s.push(xA),n.push($n.parse(u))):u.startsWith(AH)?(r.var.push(i),s.push(RH),n.push(u)):(r.number.push(i),s.push(_A),n.push(parseFloat(u))),++i,Fk)).split(Fk);return{values:n,split:l,indexes:r,types:s}}function IH(t){return ed(t).values}function wA({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===_A?s+=zf(r[i]):o===xA?s+=$n.transform(r[i]):s+=r[i]}return s}}function MH(t){return wA(ed(t))}const OH=t=>typeof t=="number"?0:$n.test(t)?$n.getAnimatableNone(t):t,LH=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:OH(t);function NH(t){const e=ed(t);return wA(e)(e.values.map((r,s)=>LH(r,e.split[s])))}const vi={test:PH,parse:IH,createTransformer:MH,getAnimatableNone:NH};function Dy(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 DH({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=Dy(u,l,t+1/3),i=Dy(u,l,t),o=Dy(u,l,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Um(t,e){return n=>n>0?e:t}const Kt=(t,e,n)=>t+(e-t)*n,jy=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},jH=[A2,Ul,wu],$H=t=>jH.find(e=>e.test(t));function Vk(t){const e=$H(t);if(!e)return!1;let n=e.parse(t);return e===wu&&(n=DH(n)),n}const Hk=(t,e)=>{const n=Vk(t),r=Vk(e);if(!n||!r)return Um(t,e);const s={...n};return i=>(s.red=jy(n.red,r.red,i),s.green=jy(n.green,r.green,i),s.blue=jy(n.blue,r.blue,i),s.alpha=Kt(n.alpha,r.alpha,i),Ul.transform(s))},T2=new Set(["none","hidden"]);function FH(t,e){return T2.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function VH(t,e){return n=>Kt(t,e,n)}function Vw(t){return typeof t=="number"?VH:typeof t=="string"?jw(t)?Um:$n.test(t)?Hk:UH:Array.isArray(t)?bA:typeof t=="object"?$n.test(t)?Hk:HH:Um}function bA(t,e){const n=[...t],r=n.length,s=t.map((i,o)=>Vw(i)(i,e[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function HH(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=Vw(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function zH(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 UH=(t,e)=>{const n=vi.createTransformer(e),r=ed(t),s=ed(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?T2.has(t)&&!s.values.length||T2.has(e)&&!r.values.length?FH(t,e):Bh(bA(zH(r,s),s.values),n):Um(t,e)};function SA(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Kt(t,e,n):Vw(t)(t,e)}const BH=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Yt.update(e,n),stop:()=>Ua(e),now:()=>dr.isProcessing?dr.timestamp:Nr.now()}},kA=(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)})`},Bm=2e4;function Hw(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Bm;)e+=n,r=t.next(e);return e>=Bm?1/0:e}function ZH(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(Hw(r),Bm);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:Bs(s)}}const Cn={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 I2(t,e){return t*Math.sqrt(1-e*e)}const WH=12;function qH(t,e,n){let r=n;for(let s=1;s<WH;s++)r=r-t(r)/e(r);return r}const $y=.001;function GH({duration:t=Cn.duration,bounce:e=Cn.bounce,velocity:n=Cn.velocity,mass:r=Cn.mass}){let s,i,o=1-e;o=qi(Cn.minDamping,Cn.maxDamping,o),t=qi(Cn.minDuration,Cn.maxDuration,Bs(t)),o<1?(s=d=>{const f=d*o,p=f*t,g=f-n,v=I2(d,o),x=Math.exp(-p);return $y-g/v*x},i=d=>{const p=d*o*t,g=p*n+n,v=Math.pow(o,2)*Math.pow(d,2)*t,x=Math.exp(-p),_=I2(Math.pow(d,2),o);return(-s(d)+$y>0?-1:1)*((g-v)*x)/_}):(s=d=>{const f=Math.exp(-d*t),p=(d-n)*t+1;return-$y+f*p},i=d=>{const f=Math.exp(-d*t),p=(n-d)*(t*t);return f*p});const l=5/t,u=qH(s,i,l);if(t=xs(t),isNaN(u))return{stiffness:Cn.stiffness,damping:Cn.damping,duration:t};{const d=Math.pow(u,2)*r;return{stiffness:d,damping:o*2*Math.sqrt(r*d),duration:t}}}const KH=["duration","bounce"],YH=["stiffness","damping","mass"];function zk(t,e){return e.some(n=>t[n]!==void 0)}function XH(t){let e={velocity:Cn.velocity,stiffness:Cn.stiffness,damping:Cn.damping,mass:Cn.mass,isResolvedFromDuration:!1,...t};if(!zk(t,YH)&&zk(t,KH))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*qi(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Cn.mass,stiffness:s,damping:i}}else{const n=GH({...t,velocity:0});e={...e,...n,mass:Cn.mass},e.isResolvedFromDuration=!0}return e}function Zm(t=Cn.visualDuration,e=Cn.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}=XH({...n,velocity:-Bs(n.velocity||0)}),x=g||0,_=d/(2*Math.sqrt(u*f)),w=o-i,b=Bs(Math.sqrt(u/f)),E=Math.abs(w)<5;r||(r=E?Cn.restSpeed.granular:Cn.restSpeed.default),s||(s=E?Cn.restDelta.granular:Cn.restDelta.default);let C,R,A,O,I,T;if(_<1)A=I2(b,_),O=(x+_*b*w)/A,C=N=>{const j=Math.exp(-_*b*N);return o-j*(O*Math.sin(A*N)+w*Math.cos(A*N))},I=_*b*O+w*A,T=_*b*w-O*A,R=N=>Math.exp(-_*b*N)*(I*Math.sin(A*N)+T*Math.cos(A*N));else if(_===1){C=j=>o-Math.exp(-b*j)*(w+(x+b*w)*j);const N=x+b*w;R=j=>Math.exp(-b*j)*(b*N*j-x)}else{const N=b*Math.sqrt(_*_-1);C=B=>{const z=Math.exp(-_*b*B),Z=Math.min(N*B,300);return o-z*((x+_*b*w)*Math.sinh(Z)+N*w*Math.cosh(Z))/N};const j=(x+_*b*w)/N,$=_*b*j-w*N,K=_*b*w-j*N;R=B=>{const z=Math.exp(-_*b*B),Z=Math.min(N*B,300);return z*($*Math.sinh(Z)+K*Math.cosh(Z))}}const M={calculatedDuration:v&&p||null,velocity:N=>xs(R(N)),next:N=>{if(!v&&_<1){const $=Math.exp(-_*b*N),K=Math.sin(A*N),B=Math.cos(A*N),z=o-$*(O*K+w*B),Z=xs($*(I*K+T*B));return l.done=Math.abs(Z)<=r&&Math.abs(o-z)<=s,l.value=l.done?o:z,l}const j=C(N);if(v)l.done=N>=p;else{const $=xs(R(N));l.done=Math.abs($)<=r&&Math.abs(o-j)<=s}return l.value=l.done?o:j,l},toString:()=>{const N=Math.min(Hw(M),Bm),j=kA($=>M.next(N*$).value,N,30);return N+"ms "+j},toTransition:()=>{}};return M}Zm.applyToOptions=t=>{const e=ZH(t,100,Zm);return t.ease=e.ease,t.duration=xs(e.duration),t.type="keyframes",t};const QH=5;function EA(t,e,n){const r=Math.max(e-QH,0);return sA(n-t(r),e-r)}function M2({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,x=T=>l===void 0?u:u===void 0||Math.abs(l-T)<Math.abs(u-T)?l:u;let _=n*e;const w=p+_,b=o===void 0?w:o(w);b!==w&&(_=b-p);const E=T=>-_*Math.exp(-T/r),C=T=>b+E(T),R=T=>{const M=E(T),N=C(T);g.done=Math.abs(M)<=d,g.value=g.done?b:N};let A,O;const I=T=>{v(g.value)&&(A=T,O=Zm({keyframes:[g.value,x(g.value)],velocity:EA(C,T,g.value),damping:s,stiffness:i,restDelta:d,restSpeed:f}))};return I(0),{calculatedDuration:null,next:T=>{let M=!1;return!O&&A===void 0&&(M=!0,R(T),I(T)),A!==void 0&&T>=A?O.next(T-A):(!M&&R(T),g)}}}function JH(t,e,n){const r=[],s=n||za.mix||SA,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]||Gs:e;l=Bh(u,l)}r.push(l)}return r}function ez(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(Lg(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=JH(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=dh(t[p],t[p+1],f);return l[p](g)};return n?f=>d(qi(t[0],t[i-1],f)):d}function tz(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=dh(0,e,r);t.push(Kt(n,1,s))}}function nz(t){const e=[0];return tz(e,t.length-1),e}function rz(t,e){return t.map(n=>n*e)}function sz(t,e){return t.map(()=>e||hA).splice(0,t.length-1)}function Uf({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=fH(r)?r.map(Dk):Dk(r),i={done:!1,value:e[0]},o=rz(n&&n.length===e.length?n:nz(e),t),l=ez(o,e,{ease:Array.isArray(s)?s:sz(e,s)});return{calculatedDuration:t,next:u=>(i.value=l(u),i.done=u>=t,i)}}const iz=t=>t!==null;function Ng(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(iz),l=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!l||r===void 0?i[l]:r}const oz={decay:M2,inertia:M2,tween:Uf,keyframes:Uf,spring:Zm};function CA(t){typeof t.type=="string"&&(t.type=oz[t.type])}class zw{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 az=t=>t/100;class Wm extends zw{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!==Nr.now()&&this.tick(Nr.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;CA(e);const{type:n=Uf,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=e;let{keyframes:l}=e;const u=n||Uf;u!==Uf&&typeof l[0]!="number"&&(this.mixKeyframes=Bh(az,SA(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=Hw(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:x,onUpdate:_,finalKeyframe:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const 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 M=Math.floor(T),N=T%1;!N&&T>=1&&(N=1),N===1&&M--,M=Math.min(M,p+1),!!(M%2)&&(g==="reverse"?(N=1-N,v&&(N-=v/l)):g==="mirror"&&(R=o)),C=qi(0,1,N)*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:O}=A;!E&&u!==null&&(O=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const I=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return I&&x!==M2&&(A.value=Ng(f,this.options,w,this.speed)),_&&_(A.value),I&&this.finish(),A}then(e,n){return this.finished.then(e,n)}get duration(){return Bs(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Bs(e)}get time(){return Bs(this.currentTime)}set time(e){e=xs(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 EA(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(Nr.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=Bs(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=BH,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(Nr.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 lz(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Bl=t=>t*180/Math.PI,O2=t=>{const e=Bl(Math.atan2(t[1],t[0]));return L2(e)},cz={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:O2,rotateZ:O2,skewX:t=>Bl(Math.atan(t[1])),skewY:t=>Bl(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},L2=t=>(t=t%360,t<0&&(t+=360),t),Uk=O2,Bk=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Zk=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),uz={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Bk,scaleY:Zk,scale:t=>(Bk(t)+Zk(t))/2,rotateX:t=>L2(Bl(Math.atan2(t[6],t[5]))),rotateY:t=>L2(Bl(Math.atan2(-t[2],t[0]))),rotateZ:Uk,rotate:Uk,skewX:t=>Bl(Math.atan(t[4])),skewY:t=>Bl(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function N2(t){return t.includes("scale")?1:0}function D2(t,e){if(!t||t==="none")return N2(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=uz,s=n;else{const l=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=cz,s=l}if(!s)return N2(e);const i=r[e],o=s[1].split(",").map(fz);return typeof i=="function"?i(o):o[i]}const dz=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return D2(n,e)};function fz(t){return parseFloat(t.trim())}const pd=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],md=new Set([...pd,"pathRotation"]),Wk=t=>t===hd||t===Fe,hz=new Set(["x","y","z"]),pz=pd.filter(t=>!hz.has(t));function mz(t){const e=[];return pz.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Ia={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})=>D2(e,"x"),y:(t,{transform:e})=>D2(e,"y")};Ia.translateX=Ia.x;Ia.translateY=Ia.y;const sc=new Set;let j2=!1,$2=!1,F2=!1;function PA(){if($2){const t=Array.from(sc).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=mz(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)})}$2=!1,j2=!1,sc.forEach(t=>t.complete(F2)),sc.clear()}function RA(){sc.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&($2=!0)})}function gz(){F2=!0,RA(),PA(),F2=!1}class Uw{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?(sc.add(this),j2||(j2=!0,Yt.read(RA),Yt.resolveKeyframes(PA))):(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])}lz(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),sc.delete(this)}cancel(){this.state==="scheduled"&&(sc.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const vz=t=>t.startsWith("--");function AA(t,e,n){vz(e)?t.style.setProperty(e,n):t.style[e]=n}const yz={};function TA(t,e){const n=rA(t);return()=>yz[e]??n()}const _z=TA(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),IA=TA(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),kf=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,qk={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:kf([0,.65,.55,1]),circOut:kf([.55,0,1,.45]),backIn:kf([.31,.01,.66,-.59]),backOut:kf([.33,1.53,.69,.99])};function MA(t,e){if(t)return typeof t=="function"?IA()?kA(t,e):"ease-out":pA(t)?kf(t):Array.isArray(t)?t.map(n=>MA(n,e)||qk.easeOut):qk[t]}function xz(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=MA(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 OA(t){return typeof t=="function"&&"applyToOptions"in t}function wz({type:t,...e}){return OA(t)&&IA()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class LA extends zw{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,Lg(typeof e.type!="string");const d=wz(e);this.animation=xz(n,r,s,d,i),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const f=Ng(s,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(f),AA(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 Bs(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Bs(e)}get time(){return Bs(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=xs(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&&_z()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Gs):s(this)}}const NA={anticipate:uA,backInOut:cA,circInOut:fA};function bz(t){return t in NA}function Sz(t){typeof t.ease=="string"&&bz(t.ease)&&(t.ease=NA[t.ease])}const Fy=10;class kz extends LA{constructor(e){Sz(e),CA(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 Wm({...o,autoplay:!1}),u=Math.max(Fy,Nr.now()-this.startTime),d=qi(0,Fy,u-Fy),f=l.sample(u).value,{name:p}=this.options;i&&p&&AA(i,p,f),n.setWithVelocity(l.sample(Math.max(0,u-d)).value,f,d),l.stop()}}const Gk=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(vi.test(t)||t==="0")&&!t.startsWith("url("));function Ez(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 Cz(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=Gk(s,e),l=Gk(i,e);return!o||!l?!1:Ez(t)||(n==="spring"||OA(n))&&r}function V2(t){t.duration=0,t.type="keyframes"}const DA=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Pz=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Rz(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&Pz.test(t[e]))return!0;return!1}const Az=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Tz=rA(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Iz(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 Tz()&&n&&(DA.has(n)||Az.has(n)&&Rz(l))&&(n!=="transform"||!f)&&!d&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const Mz=40;class Oz extends zw{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 x;super(),this.stop=()=>{var _,w;this._animation&&(this._animation.stop(),(_=this.stopTimeline)==null||_.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=Nr.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)||Uw;this.keyframeResolver=new v(l,(_,w,b)=>this.onKeyframesResolved(_,w,g,!b),u,d,f),(x=this.keyframeResolver)==null||x.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=Nr.now();let p=!0;Cz(e,i,o,l)||(p=!1,(za.instantAnimations||!u)&&(f==null||f(Ng(e,r,n))),e[0]=e[e.length-1],V2(r),r.repeat=0);const v={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>Mz?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},x=p&&!d&&Iz(v),_=(E=(b=v.motionValue)==null?void 0:b.owner)==null?void 0:E.current;let w;if(x)try{w=new kz({...v,element:_})}catch{w=new Wm(v)}else w=new Wm(v);w.finished.then(()=>{this.notifyFinished()}).catch(Gs),this.pendingTimeline&&(this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=w}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),gz()),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 jA(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 Kk=30,Lz=t=>!isNaN(parseFloat(t));class Nz{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=Nr.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=Nr.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Lz(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 Lw);const r=this.events[e].add(n);return e==="change"?()=>{r(),Yt.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=Nr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Kk)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Kk);return sA(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 td(t,e){return new Nz(t,e)}function $A(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function Bw(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?$A(n,t):n}const Dz={type:"spring",stiffness:500,damping:25,restSpeed:10},jz=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),$z={type:"keyframes",duration:.8},Fz={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Vz=(t,{keyframes:e})=>e.length>2?$z:md.has(t)?t.startsWith("scale")?jz(e[1]):Dz:Fz,Hz=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function zz(t){for(const e in t)if(!Hz.has(e))return!0;return!1}const Zw=(t,e,n,r={},s,i)=>o=>{const l=Bw(r,t)||{},u=l.delay||r.delay||0;let{elapsed:d=0}=r;d=d-xs(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};zz(l)||Object.assign(f,Vz(t,f)),f.duration&&(f.duration=xs(f.duration)),f.repeatDelay&&(f.repeatDelay=xs(f.repeatDelay)),f.from!==void 0&&(f.keyframes[0]=f.from);let p=!1;if((f.type===!1||f.duration===0&&!f.repeatDelay)&&(V2(f),f.delay===0&&(p=!0)),(za.instantAnimations||za.skipAnimations||s!=null&&s.shouldSkipAnimations||l.skipAnimations)&&(p=!0,V2(f),f.delay=0),f.allowFlatten=!l.type&&!l.ease,p&&!i&&e.get()!==void 0){const g=Ng(f.keyframes,l);if(g!==void 0){Yt.update(()=>{f.onUpdate(g),f.onComplete()});return}}return l.isSync?new Wm(f):new Oz(f)},Uz=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Bz(t){const e=Uz.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function FA(t,e,n=1){const[r,s]=Bz(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const o=i.trim();return eA(o)?parseFloat(o):o}return jw(s)?FA(s,e,n+1):s}function Yk(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function Ww(t,e,n,r){if(typeof e=="function"){const[s,i]=Yk(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]=Yk(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function ic(t,e,n){const r=t.getProps();return Ww(r,e,n!==void 0?n:r.custom,t)}const VA=new Set(["width","height","top","left","right","bottom",...pd]),H2=t=>Array.isArray(t);function Zz(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,td(n))}function Wz(t){return H2(t)?t[t.length-1]||0:t}function qz(t,e){const n=ic(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const l=Wz(i[o]);Zz(t,o,l)}}const pr=t=>!!(t&&t.getVelocity);function Gz(t){return!!(pr(t)&&t.add)}function z2(t,e){const n=t.getValue("willChange");if(Gz(n))return n.add(e);if(!n&&za.WillChange){const r=new za.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function qw(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Kz="framerAppearId",HA="data-"+qw(Kz);function zA(t){return t.props[HA]}function Yz({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function UA(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...l}=e;const u=t.getDefaultTransition();i=i?$A(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 x in l){const _=t.getValue(x,t.latestValues[x]??null),w=l[x];if(w===void 0||g&&Yz(g,x))continue;const b={delay:n,...Bw(i||{},x)};f&&(b.skipAnimations=!0);const E=_.get();if(E!==void 0&&!_.isAnimating()&&!Array.isArray(w)&&w===E&&!b.velocity){Yt.update(()=>_.set(w));continue}let C=!1;if(window.MotionHandoffAnimation){const O=zA(t);if(O){const I=window.MotionHandoffAnimation(O,x,Yt);I!==null&&(b.startTime=I,C=!0)}}z2(t,x);const R=d??t.shouldReduceMotion;_.start(Zw(x,_,w,R&&VA.has(x)?{type:!1}:b,t,C));const A=_.animation;A&&p.push(A)}if(o){const x=()=>Yt.update(()=>{o&&qz(t,o)});p.length?Promise.all(p).then(x):x()}return p}function U2(t,e,n={}){var u;const r=ic(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(UA(t,r,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(d=0)=>{const{delayChildren:f=0,staggerChildren:p,staggerDirection:g}=s;return Xz(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 Xz(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(U2(u,e,{...o,delay:n+(typeof r=="function"?0:r)+jA(t.variantChildren,u,r,s,i)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(l)}function Qz(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>U2(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=U2(t,e,n);else{const s=typeof e=="function"?ic(t,e,n.custom):e;r=Promise.all(UA(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const Jz={test:t=>t==="auto",parse:t=>t},BA=t=>e=>e.test(t),ZA=[hd,Fe,Ui,bo,EH,kH,Jz],Xk=t=>ZA.find(BA(t));function eU(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||nA(t):!0}const tU=new Set(["brightness","contrast","saturate","opacity"]);function nU(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match($w)||[];if(!r)return t;const s=n.replace(r,"");let i=tU.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const rU=/\b([a-z-]*)\(.*?\)/gu,B2={...vi,getAnimatableNone:t=>{const e=t.match(rU);return e?e.map(nU).join(" "):t}},Z2={...vi,getAnimatableNone:t=>{const e=vi.parse(t);return vi.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},Qk={...hd,transform:Math.round},sU={rotate:bo,pathRotation:bo,rotateX:bo,rotateY:bo,rotateZ:bo,scale:w0,scaleX:w0,scaleY:w0,scaleZ:w0,skew:bo,skewX:bo,skewY:bo,distance:Fe,translateX:Fe,translateY:Fe,translateZ:Fe,x:Fe,y:Fe,z:Fe,perspective:Fe,transformPerspective:Fe,opacity:fh,originX:$k,originY:$k,originZ:Fe},qm={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,...sU,zIndex:Qk,fillOpacity:fh,strokeOpacity:fh,numOctaves:Qk},iU={...qm,color:$n,backgroundColor:$n,outlineColor:$n,fill:$n,stroke:$n,borderColor:$n,borderTopColor:$n,borderRightColor:$n,borderBottomColor:$n,borderLeftColor:$n,filter:B2,WebkitFilter:B2,mask:Z2,WebkitMask:Z2},WA=t=>iU[t],oU=new Set([B2,Z2]);function qA(t,e){let n=WA(t);return oU.has(n)||(n=vi),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const aU=new Set(["auto","none","0"]);function lU(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!aU.has(i)&&ed(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=qA(n,s)}class cU extends Uw{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(),jw(p))){const g=FA(p,n.current);g!==void 0&&(e[f]=g),f===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!VA.has(r)||e.length!==2)return;const[s,i]=e,o=Xk(s),l=Xk(i),u=jk(s),d=jk(i);if(u!==d&&Ia[r]){this.needsMeasurement=!0;return}if(o!==l)if(Wk(o)&&Wk(l))for(let f=0;f<e.length;f++){const p=e[f];typeof p=="string"&&(e[f]=parseFloat(p))}else Ia[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||eU(e[s]))&&r.push(s);r.length&&lU(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=Ia[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]=Ia[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 Gw=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function GA(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 W2=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function J0(t){return tA(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Kw}=mA(queueMicrotask,!1),di={x:!1,y:!1};function KA(){return di.x||di.y}function uU(t){return t==="x"||t==="y"?di[t]?null:(di[t]=!0,()=>{di[t]=!1}):di.x||di.y?null:(di.x=di.y=!0,()=>{di.x=di.y=!1})}function YA(t,e){const n=GA(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function dU(t){return!(t.pointerType==="touch"||KA())}function fU(t,e,n={}){const[r,s,i]=YA(t,n);return r.forEach(o=>{let l=!1,u=!1,d;const f=()=>{o.removeEventListener("pointerleave",x)},p=w=>{d&&(d(w),d=void 0),f()},g=w=>{l=!1,window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",g),u&&(u=!1,p(w))},v=()=>{l=!0,window.addEventListener("pointerup",g,s),window.addEventListener("pointercancel",g,s)},x=w=>{if(w.pointerType!=="touch"){if(l){u=!0;return}p(w)}},_=w=>{if(!dU(w))return;u=!1;const b=e(o,w);typeof b=="function"&&(d=b,o.addEventListener("pointerleave",x,s))};o.addEventListener("pointerenter",_,s),o.addEventListener("pointerdown",v,s)}),i}const XA=(t,e)=>e?t===e?!0:XA(t,e.parentElement):!1,Yw=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,hU=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function pU(t){return hU.has(t.tagName)||t.isContentEditable===!0}const mU=new Set(["INPUT","SELECT","TEXTAREA"]);function gU(t){return mU.has(t.tagName)||t.isContentEditable===!0}const em=new WeakSet;function Jk(t){return e=>{e.key==="Enter"&&t(e)}}function Vy(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const vU=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=Jk(()=>{if(em.has(n))return;Vy(n,"down");const s=Jk(()=>{Vy(n,"up")}),i=()=>Vy(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 eE(t){return Yw(t)&&!KA()}const tE=new WeakSet;function yU(t,e,n={}){const[r,s,i]=YA(t,n),o=l=>{const u=l.currentTarget;if(!eE(l)||tE.has(l))return;em.add(u),n.stopPropagation&&tE.add(l);const d=e(u,l),f={...s,capture:!0},p=(x,_)=>{window.removeEventListener("pointerup",g,f),window.removeEventListener("pointercancel",v,f),em.has(u)&&em.delete(u),eE(x)&&typeof d=="function"&&d(x,{success:_})},g=x=>{p(x,u===window||u===document||n.useGlobalTarget||XA(u,x.target))},v=x=>{p(x,!1)};window.addEventListener("pointerup",g,f),window.addEventListener("pointercancel",v,f)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),J0(l)&&(l.addEventListener("focus",d=>vU(d,s)),!pU(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}function Xw(t){return tA(t)&&"ownerSVGElement"in t}const tm=new WeakMap;let ya;const QA=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:Xw(r)&&"getBBox"in r?r.getBBox()[e]:r[n],_U=QA("inline","width","offsetWidth"),xU=QA("block","height","offsetHeight");function wU({target:t,borderBoxSize:e}){var n;(n=tm.get(t))==null||n.forEach(r=>{r(t,{get width(){return _U(t,e)},get height(){return xU(t,e)}})})}function bU(t){t.forEach(wU)}function SU(){typeof ResizeObserver>"u"||(ya=new ResizeObserver(bU))}function kU(t,e){ya||SU();const n=GA(t);return n.forEach(r=>{let s=tm.get(r);s||(s=new Set,tm.set(r,s)),s.add(e),ya==null||ya.observe(r)}),()=>{n.forEach(r=>{const s=tm.get(r);s==null||s.delete(e),s!=null&&s.size||ya==null||ya.unobserve(r)})}}const nm=new Set;let bu;function EU(){bu=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};nm.forEach(e=>e(t))},window.addEventListener("resize",bu)}function CU(t){return nm.add(t),bu||EU(),()=>{nm.delete(t),!nm.size&&typeof bu=="function"&&(window.removeEventListener("resize",bu),bu=void 0)}}function nE(t,e){return typeof t=="function"?CU(t):kU(t,e)}function PU(t){return Xw(t)&&t.tagName==="svg"}const RU=[...ZA,$n,vi],AU=t=>RU.find(BA(t)),rE=()=>({translate:0,scale:1,origin:0,originPoint:0}),Su=()=>({x:rE(),y:rE()}),sE=()=>({min:0,max:0}),qn=()=>({x:sE(),y:sE()}),TU=new WeakMap;function Dg(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function hh(t){return typeof t=="string"||Array.isArray(t)}const Qw=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Jw=["initial",...Qw];function jg(t){return Dg(t.animate)||Jw.some(e=>hh(t[e]))}function JA(t){return!!(jg(t)||t.variants)}function IU(t,e,n){for(const r in e){const s=e[r],i=n[r];if(pr(s))t.addValue(r,s);else if(pr(i))t.addValue(r,td(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,td(o!==void 0?o:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const Gm={current:null},eb={current:!1},MU=typeof window<"u";function eT(){if(eb.current=!0,!!MU)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Gm.current=t.matches;t.addEventListener("change",e),e()}else Gm.current=!1}const iE=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Km={};function tT(t){Km=t}function OU(){return Km}class LU{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=Uw,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=Nr.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,Yt.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=jg(n),this.isVariantNode=JA(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 x=g[v];d[v]!==void 0&&pr(x)&&x.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,TU.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:(eb.current||eT(),this.shouldReduceMotion=Gm.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(),Ua(this.notifyUpdate),Ua(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&&DA.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:l,times:u,ease:d,duration:f}=n.accelerate,p=new LA({element:this.current,name:e,keyframes:l,times:u,ease:d,duration:xs(f)}),g=o(p);this.valueSubscriptions.set(e,()=>{g(),p.cancel()});return}const r=md.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&Yt.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 Km){const n=Km[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<iE.length;r++){const s=iE[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=IU(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=td(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"&&(eA(r)||nA(r))?r=parseFloat(r):!AU(r)&&vi.test(n)&&(r=qA(e,n)),this.setBaseTarget(e,pr(r)?r.get():r)),pr(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=Ww(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&&!pr(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 Lw),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Kw.render(this.render)}}class nT extends LU{constructor(){super(...arguments),this.KeyframeResolver=cU}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;pr(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Ja{constructor(e){this.isMounted=!1,this.node=e}update(){}}function rT({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function NU({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function DU(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 Hy(t){return t===void 0||t===1}function q2({scale:t,scaleX:e,scaleY:n}){return!Hy(t)||!Hy(e)||!Hy(n)}function Vl(t){return q2(t)||sT(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function sT(t){return oE(t.x)||oE(t.y)}function oE(t){return t&&t!=="0%"}function Ym(t,e,n){const r=t-n,s=e*r;return n+s}function aE(t,e,n,r,s){return s!==void 0&&(t=Ym(t,s,r)),Ym(t,n,r)+e}function G2(t,e=0,n=1,r,s){t.min=aE(t.min,e,n,r,s),t.max=aE(t.max,e,n,r,s)}function iT(t,{x:e,y:n}){G2(t.x,e.translate,e.scale,e.originPoint),G2(t.y,n.translate,n.scale,n.originPoint)}const lE=.999999999999,cE=1.0000000000001;function jU(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&&(ji(t.x,-i.scroll.offset.x),ji(t.y,-i.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,iT(t,o)),r&&Vl(i.latestValues)&&rm(t,i.latestValues,(l=i.layout)==null?void 0:l.layoutBox))}e.x<cE&&e.x>lE&&(e.x=1),e.y<cE&&e.y>lE&&(e.y=1)}function ji(t,e){t.min+=e,t.max+=e}function uE(t,e,n,r,s=.5){const i=Kt(t.min,t.max,s);G2(t,e,n,i,r)}function dE(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function rm(t,e,n){const r=n??t;uE(t.x,dE(e.x,r.x),e.scaleX,e.scale,e.originX),uE(t.y,dE(e.y,r.y),e.scaleY,e.scale,e.originY)}function oT(t,e){return rT(DU(t.getBoundingClientRect(),e))}function $U(t,e,n){const r=oT(t,n),{scroll:s}=e;return s&&(ji(r.x,s.offset.x),ji(r.y,s.offset.y)),r}const FU={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},VU=pd.length;function HU(t,e,n){let r="",s=!0;for(let o=0;o<VU;o++){const l=pd[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=W2(u,qm[l]);if(!d){s=!1;const p=FU[l]||l;r+=`${p}(${f}) `}n&&(e[l]=f)}}const i=t.pathRotation;return i&&(s=!1,r+=`rotate(${W2(i,qm.pathRotation)}) `),r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function tb(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(md.has(u)){o=!0;continue}else if(vA(u)){s[u]=d;continue}else{const f=W2(d,qm[u]);u.startsWith("origin")?(l=!0,i[u]=f):r[u]=f}}if(e.transform||(o||n?r.transform=HU(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 aT(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 fE(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const vf={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Fe.test(t))t=parseFloat(t);else return t;const n=fE(t,e.target.x),r=fE(t,e.target.y);return`${n}% ${r}%`}},zU={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=vi.parse(t);if(s.length>5)return r;const i=vi.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=Kt(l,u,.5);return typeof s[2+o]=="number"&&(s[2+o]/=d),typeof s[3+o]=="number"&&(s[3+o]/=d),i(s)}},K2={borderRadius:{...vf,applyTo:[...Gw]},borderTopLeftRadius:vf,borderTopRightRadius:vf,borderBottomLeftRadius:vf,borderBottomRightRadius:vf,boxShadow:zU};function lT(t,{layout:e,layoutId:n}){return md.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!K2[t]||t==="opacity")}function nb(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)(pr(r[l])||s&&pr(s[l])||lT(l,t)||((o=n==null?void 0:n.getValue(l))==null?void 0:o.liveStyle)!==void 0)&&(i[l]=r[l]);return i}function UU(t){return window.getComputedStyle(t)}class BU extends nT{constructor(){super(...arguments),this.type="html",this.renderInstance=aT}mount(e){Lg(!!e.style),super.mount(e)}readValueFromInstance(e,n){var r;if(md.has(n))return(r=this.projection)!=null&&r.isProjecting?N2(n):dz(e,n);{const s=UU(e),i=(vA(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return oT(e,n)}build(e,n,r){tb(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return nb(e,n,r)}}const ZU={offset:"stroke-dashoffset",array:"stroke-dasharray"},WU={offset:"strokeDashoffset",array:"strokeDasharray"};function qU(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?ZU:WU;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const GU=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function cT(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...l},u,d,f){if(tb(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 GU)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&&qU(p,s,i,o,!1)}const uT=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),dT=t=>typeof t=="string"&&t.toLowerCase()==="svg";function KU(t,e,n,r){aT(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(uT.has(s)?s:qw(s),e.attrs[s])}function fT(t,e,n){const r=nb(t,e,n);for(const s in t)if(pr(t[s])||pr(e[s])){const i=pd.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class YU extends nT{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=qn}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(md.has(n)){const r=WA(n);return r&&r.default||0}return n=uT.has(n)?n:qw(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return fT(e,n,r)}build(e,n,r){cT(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){KU(e,n,r,s)}mount(e){this.isSVGTag=dT(e.tagName),super.mount(e)}}const XU=Jw.length;function hT(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?hT(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<XU;n++){const r=Jw[n],s=t.props[r];(hh(s)||s===!1)&&(e[r]=s)}return e}function pT(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 QU=[...Qw].reverse(),JU=Qw.length;function eB(t){return e=>Promise.all(e.map(({animation:n,options:r})=>Qz(t,n,r)))}function tB(t){let e=eB(t),n=hE(),r=!0,s=!1;const i=d=>(f,p)=>{var v;const g=ic(t,p,d==="exit"?(v=t.presenceContext)==null?void 0:v.custom:void 0);if(g){const{transition:x,transitionEnd:_,...w}=g;f={...f,...w,..._}}return f};function o(d){e=d(t)}function l(d){const{props:f}=t,p=hT(t.parent)||{},g=[],v=new Set;let x={},_=1/0;for(let b=0;b<JU;b++){const E=QU[b],C=n[E],R=f[E]!==void 0?f[E]:p[E],A=hh(R),O=E===d?C.isActive:null;O===!1&&(_=b);let I=R===p[E]&&R!==f[E]&&A;if(I&&(r||s)&&t.manuallyAnimateOnMount&&(I=!1),C.protectedKeys={...x},!C.isActive&&O===null||!R&&!C.prevProp||Dg(R)||typeof R=="boolean")continue;if(E==="exit"&&C.isActive&&O!==!0){C.prevResolvedValues&&(x={...x,...C.prevResolvedValues});continue}const T=nB(C.prevProp,R);let M=T||E===d&&C.isActive&&!I&&A||b>_&&A,N=!1;const j=Array.isArray(R)?R:[R];let $=j.reduce(i(E),{});O===!1&&($={});const{prevResolvedValues:K={}}=C,B={...K,...$},z=U=>{M=!0,v.has(U)&&(N=!0,v.delete(U)),C.needsAnimating[U]=!0;const ee=t.getValue(U);ee&&(ee.liveStyle=!1)};for(const U in B){const ee=$[U],W=K[U];if(x.hasOwnProperty(U))continue;let D=!1;H2(ee)&&H2(W)?D=!pT(ee,W)||T:D=ee!==W,D?ee!=null?z(U):v.add(U):ee!==void 0&&v.has(U)?z(U):C.protectedKeys[U]=!0}C.prevProp=R,C.prevResolvedValues=$,C.isActive&&(x={...x,...$}),(r||s)&&t.blockInitialAnimation&&(M=!1);const Z=I&&T;M&&(!Z||N)&&g.push(...j.map(U=>{const ee={type:E};if(typeof U=="string"&&(r||s)&&!Z&&t.manuallyAnimateOnMount&&t.parent){const{parent:W}=t,D=ic(W,U);if(W.enteringChildren&&D){const{delayChildren:X}=D.transition||{};ee.delay=jA(W.enteringChildren,t,X)}}return{animation:U,options:ee}}))}if(v.size){const b={};if(typeof f.initial!="boolean"){const E=ic(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 w=!!g.length;return r&&(f.initial===!1||f.initial===f.animate)&&!t.manuallyAnimateOnMount&&(w=!1),r=!1,s=!1,w?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 x;return(x=v.animationState)==null?void 0:x.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=hE(),s=!0}}}function nB(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!pT(e,t):!1}function Rl(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function hE(){return{animate:Rl(!0),whileInView:Rl(),whileHover:Rl(),whileTap:Rl(),whileDrag:Rl(),whileFocus:Rl(),exit:Rl()}}function Y2(t,e){t.min=e.min,t.max=e.max}function li(t,e){Y2(t.x,e.x),Y2(t.y,e.y)}function pE(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const mT=1e-4,rB=1-mT,sB=1+mT,gT=.01,iB=0-gT,oB=0+gT;function Dr(t){return t.max-t.min}function aB(t,e,n){return Math.abs(t-e)<=n}function mE(t,e,n,r=.5){t.origin=r,t.originPoint=Kt(e.min,e.max,t.origin),t.scale=Dr(n)/Dr(e),t.translate=Kt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=rB&&t.scale<=sB||isNaN(t.scale))&&(t.scale=1),(t.translate>=iB&&t.translate<=oB||isNaN(t.translate))&&(t.translate=0)}function Bf(t,e,n,r){mE(t.x,e.x,n.x,r?r.originX:void 0),mE(t.y,e.y,n.y,r?r.originY:void 0)}function gE(t,e,n,r=0){const s=r?Kt(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+Dr(e)}function lB(t,e,n,r){gE(t.x,e.x,n.x,r==null?void 0:r.x),gE(t.y,e.y,n.y,r==null?void 0:r.y)}function vE(t,e,n,r=0){const s=r?Kt(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+Dr(e)}function Xm(t,e,n,r){vE(t.x,e.x,n.x,r==null?void 0:r.x),vE(t.y,e.y,n.y,r==null?void 0:r.y)}function yE(t,e,n,r,s){return t-=e,t=Ym(t,1/n,r),s!==void 0&&(t=Ym(t,1/s,r)),t}function cB(t,e=0,n=1,r=.5,s,i=t,o=t){if(Ui.test(e)&&(e=parseFloat(e),e=Kt(o.min,o.max,e/100)-o.min),typeof e!="number")return;let l=Kt(i.min,i.max,r);t===i&&(l-=e),t.min=yE(t.min,e,n,l,s),t.max=yE(t.max,e,n,l,s)}function _E(t,e,[n,r,s],i,o){cB(t,e[n],e[r],e[s],e.scale,i,o)}const uB=["x","scaleX","originX"],dB=["y","scaleY","originY"];function xE(t,e,n,r){_E(t.x,e,uB,n?n.x:void 0,r?r.x:void 0),_E(t.y,e,dB,n?n.y:void 0,r?r.y:void 0)}function wE(t){return t.translate===0&&t.scale===1}function vT(t){return wE(t.x)&&wE(t.y)}function bE(t,e){return t.min===e.min&&t.max===e.max}function fB(t,e){return bE(t.x,e.x)&&bE(t.y,e.y)}function SE(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function yT(t,e){return SE(t.x,e.x)&&SE(t.y,e.y)}function kE(t){return Dr(t.x)/Dr(t.y)}function EE(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Mi(t){return[t("x"),t("y")]}function hB(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:x,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) `),x&&(r+=`skewX(${x}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 pB=Gw.length,CE=t=>typeof t=="string"?parseFloat(t):t,PE=t=>typeof t=="number"||Fe.test(t);function mB(t,e,n,r,s,i){s?(t.opacity=Kt(0,n.opacity??1,gB(r)),t.opacityExit=Kt(e.opacity??1,0,vB(r))):i&&(t.opacity=Kt(e.opacity??1,n.opacity??1,r));for(let o=0;o<pB;o++){const l=Gw[o];let u=RE(e,l),d=RE(n,l);if(u===void 0&&d===void 0)continue;u||(u=0),d||(d=0),u===0||d===0||PE(u)===PE(d)?(t[l]=Math.max(Kt(CE(u),CE(d),r),0),(Ui.test(d)||Ui.test(u))&&(t[l]+="%")):t[l]=d}(e.rotate||n.rotate)&&(t.rotate=Kt(e.rotate||0,n.rotate||0,r))}function RE(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const gB=_T(0,.5,dA),vB=_T(.5,.95,Gs);function _T(t,e,n){return r=>r<t?0:r>e?1:n(dh(t,e,r))}function yB(t,e,n){const r=pr(t)?t:td(t);return r.start(Zw("",r,e,n)),r.animation}function ph(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}const _B=(t,e)=>t.depth-e.depth;class xB{constructor(){this.children=[],this.isDirty=!1}add(e){Ow(this.children,e),this.isDirty=!0}remove(e){zm(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(_B),this.isDirty=!1,this.children.forEach(e)}}function wB(t,e){const n=Nr.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(Ua(r),t(i-e))};return Yt.setup(r,!0),()=>Ua(r)}function sm(t){return pr(t)?t.get():t}class bB{constructor(){this.members=[]}add(e){Ow(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&&(zm(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(zm(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 im={hasAnimatedSinceResize:!0,hasEverUpdated:!1},zy=["","X","Y","Z"],SB=1e3;let kB=0;function Uy(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function xT(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=zA(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Yt,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&xT(r)}function wT({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=e==null?void 0:e()){this.id=kB++,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(PB),this.nodes.forEach(OB),this.nodes.forEach(LB),this.nodes.forEach(RB)},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 xB)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Lw),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=Xw(o)&&!PU(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;Yt.read(()=>{p=window.innerWidth}),t(o,()=>{const v=window.innerWidth;v!==p&&(p=v,this.root.updateBlockedByResize=!0,f&&f(),f=wB(g,250),im.hasAnimatedSinceResize&&(im.hasAnimatedSinceResize=!1,this.nodes.forEach(IE)))})}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 x=this.options.transition||d.getDefaultTransition()||FB,{onLayoutAnimationStart:_,onLayoutAnimationComplete:w}=d.getProps(),b=!this.targetLayout||!yT(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={...Bw(x,"layout"),onPlay:_,onComplete:w};(d.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C),this.setAnimationOrigin(f,E,C.path)}else p||IE(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(),Ua(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(NB),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&&xT(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(TB),this.nodes.forEach(AE);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(TE);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(IB),this.nodes.forEach(MB),this.nodes.forEach(EB),this.nodes.forEach(CB)):this.nodes.forEach(TE),this.clearAllSnapshots();const l=Nr.now();dr.delta=qi(0,1e3/60,l-dr.timestamp),dr.timestamp=l,dr.isProcessing=!0,Ly.update.process(dr),Ly.preRender.process(dr),Ly.render.process(dr),dr.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Kw.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(AB),this.sharedNodes.forEach(DB)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Yt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Yt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Dr(this.snapshot.measuredBox.x)&&!Dr(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&&!vT(this.projectionDelta),u=this.getTransformTemplate(),d=u?u(this.latestValues,""):void 0,f=d!==this.prevTransformTemplateValue;o&&this.instance&&(l||Vl(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)),VB(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(HB))){const{scroll:f}=this.root;f&&(ji(l.x,f.offset.x),ji(l.y,f.offset.y))}return l}removeElementScroll(o){var u;const l=qn();if(li(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&&li(l,o),ji(l.x,p.offset.x),ji(l.y,p.offset.y))}return l}applyTransform(o,l=!1,u){var f,p;const d=u||qn();li(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&&(ji(d.x,-v.scroll.offset.x),ji(d.y,-v.scroll.offset.y)),Vl(v.latestValues)&&rm(d,v.latestValues,(f=v.layout)==null?void 0:f.layoutBox)}return Vl(this.latestValues)&&rm(d,this.latestValues,(p=this.layout)==null?void 0:p.layoutBox),d}removeTransform(o){var u;const l=qn();li(l,o);for(let d=0;d<this.path.length;d++){const f=this.path[d];if(!Vl(f.latestValues))continue;let p;f.instance&&(q2(f.latestValues)&&f.updateSnapshot(),p=qn(),li(p,f.measurePageBox())),xE(l,f.latestValues,(u=f.snapshot)==null?void 0:u.layoutBox,p)}return Vl(this.latestValues)&&xE(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!==dr.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=dr.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(),lB(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):li(this.target,this.layout.layoutBox),iT(this.target,this.targetDelta)):li(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||q2(this.parent.latestValues)||sT(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(),Xm(this.relativeTargetOrigin,l,u,this.options.layoutAnchor||void 0),li(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var x;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let u=!0;if((this.isProjectionDirty||(x=this.parent)!=null&&x.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===dr.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;li(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,g=this.treeScale.y;jU(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():(pE(this.prevProjectionDelta.x,this.projectionDelta.x),pE(this.prevProjectionDelta.y,this.projectionDelta.y)),Bf(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==g||!EE(this.projectionDelta.x,this.prevProjectionDelta.x)||!EE(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=Su(),this.projectionDelta=Su(),this.projectionDeltaWithTransform=Su()}setAnimationOrigin(o,l=!1,u){const d=this.snapshot,f=d?d.latestValues:{},p={...this.latestValues},g=Su();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const v=qn(),x=d?d.source:void 0,_=this.layout?this.layout.source:void 0,w=x!==_,b=this.getStack(),E=!b||b.members.length<=1,C=!!(w&&!E&&this.options.crossfade===!0&&!this.path.some($B));this.animationProgress=0;let R;const A=u==null?void 0:u.interpolateProjection(o);this.mixTargetDelta=O=>{const I=O/1e3,T=A==null?void 0:A(I);T?(g.x.translate=T.x,g.x.scale=Kt(o.x.scale,1,I),g.x.origin=o.x.origin,g.x.originPoint=o.x.originPoint,g.y.translate=T.y,g.y.scale=Kt(o.y.scale,1,I),g.y.origin=o.y.origin,g.y.originPoint=o.y.originPoint):(ME(g.x,o.x,I),ME(g.y,o.y,I)),this.setTargetDelta(g),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Xm(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),jB(this.relativeTarget,this.relativeTargetOrigin,v,I),R&&fB(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=qn()),li(R,this.relativeTarget)),w&&(this.animationValues=p,mB(p,f,this.latestValues,I,C,E)),T&&T.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=T.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=I},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&&(Ua(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Yt.update(()=>{im.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=td(0)),this.motionValue.jump(0,!1),this.currentAnimation=yB(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(SB),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&&bT(this.options.animationType,this.layout.layoutBox,d.layoutBox)){u=this.target||qn();const p=Dr(this.layout.layoutBox.x);u.x.min=o.target.x.min,u.x.max=u.x.min+p;const g=Dr(this.layout.layoutBox.y);u.y.min=o.target.y.min,u.y.max=u.y.min+g}li(l,u),rm(l,f),Bf(this.projectionDeltaWithTransform,this.layoutCorrected,l,f)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new bB),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&&Uy("z",o,d,this.animationValues);for(let f=0;f<zy.length;f++)Uy(`rotate${zy[f]}`,o,d,this.animationValues),Uy(`skew${zy[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=sm(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=sm(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!Vl(this.latestValues)&&(o.transform=u?u({},""):"none",this.hasProjected=!1);return}o.visibility="";const f=d.animationValues||d.latestValues;this.applyTransformsToTarget();let p=hB(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 x in K2){if(f[x]===void 0)continue;const{correct:_,applyTo:w,isCSSVariable:b}=K2[x],E=p==="none"?f[x]:_(f[x],d);if(w){const C=w.length;for(let R=0;R<C;R++)o[w[R]]=E}else b?this.options.visualElement.renderState.vars[x]=E:o[x]=E}this.options.layoutId&&(o.pointerEvents=d===this?sm(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(AE),this.root.sharedNodes.clear()}}}function EB(t){t.updateLayout()}function CB(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")Mi(p=>{const g=o?e.measuredBox[p]:e.layoutBox[p],v=Dr(g);g.min=r[p].min,g.max=g.min+v});else if(i==="x"||i==="y"){const p=i==="x"?"y":"x";Y2(o?e.measuredBox[p]:e.layoutBox[p],r[p])}else bT(i,e.layoutBox,r)&&Mi(p=>{const g=o?e.measuredBox[p]:e.layoutBox[p],v=Dr(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=Su();Bf(l,r,e.layoutBox);const u=Su();o?Bf(u,t.applyTransform(s,!0),e.measuredBox):Bf(u,r,e.layoutBox);const d=!vT(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 x=t.options.layoutAnchor||void 0,_=qn();Xm(_,e.layoutBox,g.layoutBox,x);const w=qn();Xm(w,r,v.layoutBox,x),yT(_,w)||(f=!0),p.options.layoutRoot&&(t.relativeTarget=w,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 PB(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 RB(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function AB(t){t.clearSnapshot()}function AE(t){t.clearMeasurements()}function TB(t){t.isLayoutDirty=!0,t.updateLayout()}function TE(t){t.isLayoutDirty=!1}function IB(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function MB(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function IE(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function OB(t){t.resolveTargetDelta()}function LB(t){t.calcProjection()}function NB(t){t.resetSkewAndRotation()}function DB(t){t.removeLeadSnapshot()}function ME(t,e,n){t.translate=Kt(e.translate,0,n),t.scale=Kt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function OE(t,e,n,r){t.min=Kt(e.min,n.min,r),t.max=Kt(e.max,n.max,r)}function jB(t,e,n,r){OE(t.x,e.x,n.x,r),OE(t.y,e.y,n.y,r)}function $B(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const FB={duration:.45,ease:[.4,0,.1,1]},LE=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),NE=LE("applewebkit/")&&!LE("chrome/")?Math.round:Gs;function DE(t){t.min=NE(t.min),t.max=NE(t.max)}function VB(t){DE(t.x),DE(t.y)}function bT(t,e,n){return t==="position"||t==="preserve-aspect"&&!aB(kE(e),kE(n),.2)}function HB(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const zB=wT({attachResizeListener:(t,e)=>ph(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}),By={current:void 0},ST=wT({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!By.current){const t=new zB({});t.mount(window),t.setOptions({layoutScroll:!0}),By.current=t}return By.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),rb=m.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function jE(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function UB(...t){return e=>{let n=!1;const r=t.map(s=>{const i=jE(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():jE(t[s],null)}}}}function BB(...t){return m.useCallback(UB(...t),t)}class ZB extends m.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(J0(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=J0(r)&&r.offsetWidth||0,i=J0(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 WB({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(rb),f=i!==!1?((g=t.props)==null?void 0:g.ref)??(t==null?void 0:t.ref):void 0,p=BB(l,f);return m.useInsertionEffect(()=>{const{width:v,height:x,top:_,left:w,right:b,bottom:E,direction:C}=u.current;if(e||i===!1||!l.current||!v||!x)return;const R=C==="rtl",A=n==="left"?R?`right: ${b}`:`left: ${w}`:R?`left: ${w}`:`right: ${b}`,O=r==="bottom"?`bottom: ${E}`:`top: ${_}`;l.current.dataset.motionPopId=o;const I=document.createElement("style");d&&(I.nonce=d);const T=s??document.head;return T.appendChild(I),I.sheet&&I.sheet.insertRule(`
|
|
64
|
+
[data-motion-pop-id="${o}"] {
|
|
65
|
+
position: absolute !important;
|
|
66
|
+
width: ${v}px !important;
|
|
67
|
+
height: ${x}px !important;
|
|
68
|
+
${A}px !important;
|
|
69
|
+
${O}px !important;
|
|
70
|
+
}
|
|
71
|
+
`),()=>{var M;(M=l.current)==null||M.removeAttribute("data-motion-pop-id"),T.contains(I)&&T.removeChild(I)}},[e]),S.jsx(ZB,{isPresent:e,childRef:l,sizeRef:u,pop:i,children:i===!1?t:m.cloneElement(t,{ref:p})})}const qB=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:l,anchorY:u,root:d})=>{const f=Iw(GB),p=m.useId(),g=m.useRef(n),v=m.useRef(r);Mw(()=>{g.current=n,v.current=r});let x=!0,_=m.useMemo(()=>(x=!1,{id:p,initial:e,isPresent:n,custom:s,onExitComplete:w=>{f.set(w,!0);for(const b of f.values())if(!b)return;r&&r()},register:w=>(f.set(w,!1),()=>{var b;f.delete(w),!g.current&&!f.size&&((b=v.current)==null||b.call(v))})}),[n,f,r]);return i&&x&&(_={..._}),m.useMemo(()=>{f.forEach((w,b)=>f.set(b,!1))},[n]),m.useEffect(()=>{!n&&!f.size&&r&&r()},[n]),t=S.jsx(WB,{pop:o==="popLayout",isPresent:n,anchorX:l,anchorY:u,root:d,children:t}),S.jsx(Og.Provider,{value:_,children:t})};function GB(){return new Map}function kT(t=!0){const e=m.useContext(Og);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 b0=t=>t.key||"";function $E(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]=kT(o),g=m.useMemo(()=>$E(t),[t]),v=o&&!f?[]:g.map(b0),x=m.useRef(!0),_=m.useRef(g),w=Iw(()=>new Map),b=m.useRef(new Set),[E,C]=m.useState(g),[R,A]=m.useState(g);Mw(()=>{x.current=!1,_.current=g;for(let T=0;T<R.length;T++){const M=b0(R[T]);v.includes(M)?(w.delete(M),b.current.delete(M)):w.get(M)!==!0&&w.set(M,!1)}},[R,v.length,v.join("-")]);const O=[];if(g!==E){let T=[...g];for(let M=0;M<R.length;M++){const N=R[M],j=b0(N);v.includes(j)||(T.splice(M,0,N),O.push(N))}return i==="wait"&&O.length&&(T=O),A($E(T)),C(g),null}const{forceRender:I}=m.useContext(Tw);return S.jsx(S.Fragment,{children:R.map(T=>{const M=b0(T),N=o&&!f?!1:g===R||v.includes(M),j=()=>{if(b.current.has(M))return;if(w.has(M))b.current.add(M),w.set(M,!0);else return;let $=!0;w.forEach(K=>{K||($=!1)}),$&&(I==null||I(),A(_.current),o&&(p==null||p()),r&&r())};return S.jsx(qB,{isPresent:N,initial:!x.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:d,onExitComplete:N?void 0:j,anchorX:l,anchorY:u,children:T},M)})})},ET=m.createContext({strict:!1}),FE={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 VE=!1;function KB(){if(VE)return;const t={};for(const e in FE)t[e]={isEnabled:n=>FE[e].some(r=>!!n[r])};tT(t),VE=!0}function CT(){return KB(),OU()}function YB(t){const e=CT();for(const n in t)e[n]={...e[n],...t[n]};tT(e)}const XB=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 Qm(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||XB.has(t)}let PT=t=>!Qm(t);function QB(t){typeof t=="function"&&(PT=e=>e.startsWith("on")?!Qm(e):t(e))}try{QB(require("@emotion/is-prop-valid").default)}catch{}function JB(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||pr(t[s])||(PT(s)||n===!0&&Qm(s)||!e&&!Qm(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const $g=m.createContext({});function eZ(t,e){if(jg(t)){const{initial:n,animate:r}=t;return{initial:n===!1||hh(n)?n:void 0,animate:hh(r)?r:void 0}}return t.inherit!==!1?e:{}}function tZ(t){const{initial:e,animate:n}=eZ(t,m.useContext($g));return m.useMemo(()=>({initial:e,animate:n}),[HE(e),HE(n)])}function HE(t){return Array.isArray(t)?t.join(" "):t}const sb=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function RT(t,e,n){for(const r in e)!pr(e[r])&&!lT(r,n)&&(t[r]=e[r])}function nZ({transformTemplate:t},e){return m.useMemo(()=>{const n=sb();return tb(n,e,t),Object.assign({},n.vars,n.style)},[e])}function rZ(t,e){const n=t.style||{},r={};return RT(r,n,t),Object.assign(r,nZ(t,e)),r}function sZ(t,e){const n={},r=rZ(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 AT=()=>({...sb(),attrs:{}});function iZ(t,e,n,r){const s=m.useMemo(()=>{const i=AT();return cT(i,e,dT(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};RT(i,t.style,t),s.style={...i,...s.style}}return s}const oZ=["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 ib(t){return typeof t!="string"||t.includes("-")?!1:!!(oZ.indexOf(t)>-1||/[A-Z]/u.test(t))}function aZ(t,e,n,{latestValues:r},s,i=!1,o){const u=(o??ib(t)?iZ:sZ)(e,r,s,t),d=JB(e,typeof t=="string",i),f=t!==m.Fragment?{...d,...u,ref:n}:{},{children:p}=e,g=m.useMemo(()=>pr(p)?p.get():p,[p]);return m.createElement(t,{...f,children:g})}function lZ({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:cZ(n,r,s,t),renderState:e()}}function cZ(t,e,n,r){const s={},i=r(t,{});for(const g in i)s[g]=sm(i[g]);let{initial:o,animate:l}=t;const u=jg(t),d=JA(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"&&!Dg(p)){const g=Array.isArray(p)?p:[p];for(let v=0;v<g.length;v++){const x=Ww(t,g[v]);if(x){const{transitionEnd:_,transition:w,...b}=x;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 TT=t=>(e,n)=>{const r=m.useContext($g),s=m.useContext(Og),i=()=>lZ(t,e,r,s);return n?i():Iw(i)},uZ=TT({scrapeMotionValuesFromProps:nb,createRenderState:sb}),dZ=TT({scrapeMotionValuesFromProps:fT,createRenderState:AT}),fZ=Symbol.for("motionComponentSymbol");function hZ(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 IT=m.createContext({});function pu(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function pZ(t,e,n,r,s,i){var C,R;const{visualElement:o}=m.useContext($g),l=m.useContext(ET),u=m.useContext(Og),d=m.useContext(rb),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 x=g.current,_=m.useContext(IT);x&&!x.projection&&s&&(x.type==="html"||x.type==="svg")&&mZ(g.current,n,s,_);const w=m.useRef(!1);m.useInsertionEffect(()=>{x&&w.current&&x.update(n,u)});const b=n[HA],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 Mw(()=>{v.current=!0,x&&(w.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),E.current&&x.animationState&&x.animationState.animateChanges())}),m.useEffect(()=>{x&&(!E.current&&x.animationState&&x.animationState.animateChanges(),E.current&&(queueMicrotask(()=>{var A;(A=window.MotionHandoffMarkAsComplete)==null||A.call(window,b)}),E.current=!1),x.enteringChildren=void 0)}),x}function mZ(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:MT(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||l&&pu(l),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:u,layoutRoot:d,layoutAnchor:f})}function MT(t){if(t)return t.options.allowProjection!==!1?t.projection:MT(t.parent)}function Zy(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&YB(r);const i=n?n==="svg":ib(t),o=i?dZ:uZ;function l(d,f){let p;const g={...m.useContext(rb),...d,layoutId:gZ(d)},{isStatic:v}=g,x=tZ(d),_=o(d,v);if(!v&&typeof window<"u"){vZ();const w=yZ(g);p=w.MeasureLayout,x.visualElement=pZ(t,_,g,s,w.ProjectionNode,i)}return S.jsxs($g.Provider,{value:x,children:[p&&x.visualElement?S.jsx(p,{visualElement:x.visualElement,...g}):null,aZ(t,d,hZ(_,x.visualElement,f),_,v,e,i)]})}l.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const u=m.forwardRef(l);return u[fZ]=t,u}function gZ({layoutId:t}){const e=m.useContext(Tw).id;return e&&t!==void 0?e+"-"+t:t}function vZ(t,e){m.useContext(ET).strict}function yZ(t){const e=CT(),{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 _Z(t,e){if(typeof Proxy>"u")return Zy;const n=new Map,r=(i,o)=>Zy(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,Zy(o,void 0,t,e)),n.get(o))})}const xZ=(t,e)=>e.isSVG??ib(t)?new YU(e):new BU(e,{allowProjection:t!==m.Fragment});class wZ extends Ja{constructor(e){super(e),e.animationState||(e.animationState=tB(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Dg(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 bZ=0;class SZ extends Ja{constructor(){super(...arguments),this.id=bZ++,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=ic(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 kZ={animation:{Feature:wZ},exit:{Feature:SZ}};function qh(t){return{point:{x:t.pageX,y:t.pageY}}}const EZ=t=>e=>Yw(e)&&t(e,qh(e));function Zf(t,e,n,r){return ph(t,e,EZ(n),r)}const OT=({current:t})=>t?t.ownerDocument.defaultView:null,zE=(t,e)=>Math.abs(t-e);function CZ(t,e){const n=zE(t.x,e.x),r=zE(t.y,e.y);return Math.sqrt(n**2+r**2)}const UE=new Set(["auto","scroll"]);class LT{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=x=>{this.handleScroll(x.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=S0(this.lastRawMoveEventInfo,this.transformPagePoint));const x=Wy(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,w=CZ(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!_&&!w)return;const{point:b}=x,{timestamp:E}=dr;this.history.push({...b,timestamp:E});const{onStart:C,onMove:R}=this.handlers;_||(C&&C(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),R&&R(this.lastMoveEvent,x)},this.handlePointerMove=(x,_)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=_,this.lastMoveEventInfo=S0(_,this.transformPagePoint),Yt.update(this.updatePoint,!0)},this.handlePointerUp=(x,_)=>{this.end();const{onEnd:w,onSessionEnd:b,resumeAnimation:E}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const C=Wy(x.type==="pointercancel"?this.lastMoveEventInfo:S0(_,this.transformPagePoint),this.history);this.startEvent&&w&&w(x,C),b&&b(x,C)},!Yw(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const u=qh(e),d=S0(u,this.transformPagePoint),{point:f}=d,{timestamp:p}=dr;this.history=[{...f,timestamp:p}];const{onSessionStart:g}=n;g&&g(e,Wy(d,this.history));const v={passive:!0,capture:!0};this.removeListeners=Bh(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);(UE.has(r.overflowX)||UE.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),Yt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ua(this.updatePoint)}}function S0(t,e){return e?{point:e(t.point)}:t}function BE(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Wy({point:t},e){return{point:t,delta:BE(t,NT(e)),offset:BE(t,PZ(e)),velocity:RZ(e,.1)}}function PZ(t){return t[0]}function NT(t){return t[t.length-1]}function RZ(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=NT(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>xs(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>xs(e)*2&&(r=t[1]);const i=Bs(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 AZ(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?Kt(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?Kt(n,t,r.max):Math.min(t,n)),t}function ZE(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 TZ(t,{top:e,left:n,bottom:r,right:s}){return{x:ZE(t.x,n,s),y:ZE(t.y,e,r)}}function WE(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 IZ(t,e){return{x:WE(t.x,e.x),y:WE(t.y,e.y)}}function MZ(t,e){let n=.5;const r=Dr(t),s=Dr(e);return s>r?n=dh(e.min,e.max-r,t.min):r>s&&(n=dh(t.min,t.max-s,e.min)),qi(0,1,n)}function OZ(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 X2=.35;function LZ(t=X2){return t===!1?t=0:t===!0&&(t=X2),{x:qE(t,"left","right"),y:qE(t,"top","bottom")}}function qE(t,e,n){return{min:GE(t,e),max:GE(t,n)}}function GE(t,e){return typeof t=="number"?t:t[e]||0}const NZ=new WeakMap;class DZ{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(qh(p).point),this.stopAnimation()},o=(p,g)=>{const{drag:v,dragPropagation:x,onDragStart:_}=this.getProps();if(v&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=uU(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),Mi(b=>{let E=this.getAxisMotionValue(b).get()||0;if(Ui.test(E)){const{projection:C}=this.visualElement;if(C&&C.layout){const R=C.layout.layoutBox[b];R&&(E=Dr(R)*(parseFloat(E)/100))}}this.originPoint[b]=E}),_&&Yt.update(()=>_(p,g),!1,!0),z2(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},l=(p,g)=>{this.latestPointerEvent=p,this.latestPanInfo=g;const{dragPropagation:v,dragDirectionLock:x,onDirectionLock:_,onDrag:w}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:b}=g;if(x&&this.currentDirection===null){this.currentDirection=$Z(b),this.currentDirection!==null&&_&&_(this.currentDirection);return}this.updateAxis("x",g.point,b),this.updateAxis("y",g.point,b),this.visualElement.render(),w&&Yt.update(()=>w(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 LT(e,{onSessionStart:i,onStart:o,onMove:l,onSessionEnd:u,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,distanceThreshold:r,contextWindow:OT(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&&Yt.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||!k0(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=AZ(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&&pu(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=TZ(r.layoutBox,e):this.constraints=!1,this.elastic=LZ(n),s!==this.constraints&&!pu(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Mi(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=OZ(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!pu(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=$U(r,s.root,this.visualElement.getTransformPagePoint());let o=IZ(s.layout.layoutBox,i);if(n){const l=n(NU(o));this.hasMutatedConstraints=!!l,l&&(o=rT(l))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),u=this.constraints||{},d=Mi(f=>{if(!k0(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,x={type:"inertia",velocity:r?e[f]:0,bounceStiffness:g,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...i,...p};return this.startAxisValueAnimation(f,x)});return Promise.all(d).then(l)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return z2(this.visualElement,e),r.start(Zw(e,r,0,n,this.visualElement,!1))}stopAnimation(){Mi(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){Mi(n=>{const{drag:r}=this.getProps();if(!k0(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]-Kt(o,l,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!pu(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Mi(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const u=l.get();s[o]=MZ({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(),Mi(o=>{if(!k0(o,e,null))return;const l=this.getAxisMotionValue(o),{min:u,max:d}=this.constraints[o];l.set(Kt(u,d,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;NZ.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&&gU(g);f&&p&&!v&&this.start(d)});let r;const s=()=>{const{dragConstraints:d}=this.getProps();pu(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=jZ(e,d.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Yt.read(s);const l=ph(window,"resize",()=>this.scalePositionWithinConstraints()),u=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:f})=>{this.isDragging&&f&&(Mi(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=X2,dragMomentum:l=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:l}}}function KE(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function jZ(t,e,n){const r=nE(t,KE(n)),s=nE(e,KE(n));return()=>{r(),s()}}function k0(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function $Z(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class FZ extends Ja{constructor(e){super(e),this.removeGroupControls=Gs,this.removeListeners=Gs,this.controls=new DZ(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Gs}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 qy=t=>(e,n)=>{t&&Yt.update(()=>t(e,n),!1,!0)};class VZ extends Ja{constructor(){super(...arguments),this.removePointerDownListener=Gs}onPointerDown(e){this.session=new LT(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:OT(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:qy(e),onStart:qy(n),onMove:qy(r),onEnd:(i,o)=>{delete this.session,s&&Yt.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 Gy=!1;class HZ 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),Gy&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),im.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}),Gy=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||Yt.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(),Kw.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;Gy=!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 DT(t){const[e,n]=kT(),r=m.useContext(Tw);return S.jsx(HZ,{...t,layoutGroup:r,switchLayoutGroup:m.useContext(IT),isPresent:e,safeToRemove:n})}const zZ={pan:{Feature:VZ},drag:{Feature:FZ,ProjectionNode:ST,MeasureLayout:DT}};function YE(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&&Yt.postRender(()=>i(e,qh(e)))}class UZ extends Ja{mount(){const{current:e}=this.node;e&&(this.unmount=fU(e,(n,r)=>(YE(this.node,r,"Start"),s=>YE(this.node,s,"End"))))}unmount(){}}class BZ extends Ja{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=Bh(ph(this.node.current,"focus",()=>this.onFocus()),ph(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function XE(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&&Yt.postRender(()=>i(e,qh(e)))}class ZZ extends Ja{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=yU(e,(s,i)=>(XE(this.node,i,"Start"),(o,{success:l})=>XE(this.node,o,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Q2=new WeakMap,Ky=new WeakMap,WZ=t=>{const e=Q2.get(t.target);e&&e(t)},qZ=t=>{t.forEach(WZ)};function GZ({root:t,...e}){const n=t||document;Ky.has(n)||Ky.set(n,{});const r=Ky.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(qZ,{root:t,...e})),r[s]}function KZ(t,e,n){const r=GZ(e);return Q2.set(t,n),r.observe(t),()=>{Q2.delete(t),r.unobserve(t)}}const YZ={some:0,all:1};class XZ extends Ja{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:YZ[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=KZ(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(QZ(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function QZ({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const JZ={inView:{Feature:XZ},tap:{Feature:ZZ},focus:{Feature:BZ},hover:{Feature:UZ}},eW={layout:{ProjectionNode:ST,MeasureLayout:DT}},tW={...kZ,...JZ,...zZ,...eW},Lo=_Z(tW,xZ);function nW(){!eb.current&&eT();const[t]=m.useState(Gm.current);return t}const yi=Lo;var Gh=qR();const rW=Cg(Gh);function sW(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 iW=t=>{switch(t){case"success":return lW;case"info":return uW;case"warning":return cW;case"error":return dW;default:return null}},oW=Array(12).fill(0),aW=({visible:t,className:e})=>xe.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},xe.createElement("div",{className:"sonner-spinner"},oW.map((n,r)=>xe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),lW=xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},xe.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"})),cW=xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},xe.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"})),uW=xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},xe.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"})),dW=xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},xe.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"})),fW=xe.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"},xe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),xe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),hW=()=>{const[t,e]=xe.useState(document.hidden);return xe.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),t};let pW=1;const mW=100,QE=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:pW++};class gW{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-mW;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=QE(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],xe.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(yW(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,x=typeof p=="object"&&!xe.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:g,...x})}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,x=typeof p=="object"&&!xe.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:g,...x})}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,x=typeof p=="object"&&!xe.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:g,...x})}}).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"&&!xe.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=QE(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 Zr=new gW,vW=(t,e)=>Zr.message(t,e),yW=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",_W=vW,xW=()=>Zr.toasts,wW=()=>Zr.getActiveToasts(),At=Object.assign(_W,{success:Zr.success,info:Zr.info,warning:Zr.warning,error:Zr.error,custom:Zr.custom,message:Zr.message,promise:Zr.promise,dismiss:Zr.dismiss,loading:Zr.loading},{getHistory:xW,getToasts:wW});sW("[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 E0(t){return t.label!==void 0}const bW=3,SW="24px",kW="16px",JE=4e3,EW=356,CW=14,PW=45,RW=200;function Ci(...t){return t.filter(Boolean).join(" ")}function AW(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const TW=t=>{var e,n,r,s,i,o,l,u,d;const{invert:f,toast:p,unstyled:g,interacting:v,setHeights:x,visibleToasts:_,heights:w,index:b,toasts:E,expanded:C,removeToast:R,defaultRichColors:A,closeButton:O,style:I,cancelButtonStyle:T,actionButtonStyle:M,className:N="",descriptionClassName:j="",duration:$,position:K,gap:B,expandByDefault:z,classNames:Z,icons:Q,closeButtonAriaLabel:U="Close toast"}=t,[ee,W]=xe.useState(null),[D,X]=xe.useState(null),[oe,re]=xe.useState(!1),[se,fe]=xe.useState(!1),[_e,de]=xe.useState(!1),[ae,Oe]=xe.useState(!1),[ke,Ge]=xe.useState(!1),[vt,Mt]=xe.useState(0),[Xt,xt]=xe.useState(0),yt=xe.useRef(p.duration||$||JE),We=xe.useRef(null),Ke=xe.useRef(null),St=b===0,Re=b+1<=_,Ye=p.type,Ot=Ye??"default",qe=p.dismissible!==!1,kt=p.className||"",rs=p.descriptionClassName||"",gr=xe.useMemo(()=>w.findIndex(Xe=>Xe.toastId===p.id)||0,[w,p.id]),Le=xe.useMemo(()=>{var Xe;return(Xe=p.closeButton)!=null?Xe:O},[p.closeButton,O]),Wo=xe.useMemo(()=>p.duration||$||JE,[p.duration,$]),Mn=xe.useRef(0),Xn=xe.useRef(0),ol=xe.useRef(0),mn=xe.useRef(null),[gn,xd]=K.split("-"),As=xe.useMemo(()=>w.reduce((Xe,Lt,Ft)=>Ft>=gr?Xe:Xe+Lt.height,0),[w,gr]),vr=hW(),Qn=xe.useMemo(()=>{var Xe;return(Xe=t.swipeDirections)!=null?Xe:AW(K)},[t.swipeDirections,K]),eo=p.invert||f,Ys=Ye==="loading";Xn.current=xe.useMemo(()=>gr*B+As,[gr,As]),xe.useEffect(()=>{yt.current=Wo},[Wo]),xe.useEffect(()=>{re(!0)},[]),xe.useEffect(()=>{const Xe=Ke.current;if(Xe){const Lt=Xe.getBoundingClientRect().height;return xt(Lt),x(Ft=>[{toastId:p.id,height:Lt,position:p.position},...Ft]),()=>x(Ft=>Ft.filter(zn=>zn.toastId!==p.id))}},[x,p.id]),xe.useLayoutEffect(()=>{if(!oe)return;const Xe=Ke.current,Lt=Xe.style.height;Xe.style.height="auto";const Ft=Xe.getBoundingClientRect().height;Xe.style.height=Lt,xt(Ft),x(zn=>zn.find(Ut=>Ut.toastId===p.id)?zn.map(Ut=>Ut.toastId===p.id?{...Ut,height:Ft}:Ut):[{toastId:p.id,height:Ft,position:p.position},...zn])},[oe,p.title,p.description,x,p.id,p.jsx,p.action,p.cancel]);const On=xe.useCallback(()=>{fe(!0),Mt(Xn.current),x(Xe=>Xe.filter(Lt=>Lt.toastId!==p.id)),setTimeout(()=>{R(p)},RW)},[p,R,x,Xn]);xe.useEffect(()=>{if(p.promise&&Ye==="loading"||p.duration===1/0||p.type==="loading")return;let Xe;return C||v||vr?(()=>{if(ol.current<Mn.current){const zn=new Date().getTime()-Mn.current;yt.current=yt.current-zn}ol.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,vr,On]),xe.useEffect(()=>{p.delete&&(On(),p.onDismiss==null||p.onDismiss.call(p,p))},[On,p.delete]);function Ts(){var Xe;if(Q!=null&&Q.loading){var Lt;return xe.createElement("div",{className:Ci(Z==null?void 0:Z.loader,p==null||(Lt=p.classNames)==null?void 0:Lt.loader,"sonner-loader"),"data-visible":Ye==="loading"},Q.loading)}return xe.createElement(aW,{className:Ci(Z==null?void 0:Z.loader,p==null||(Xe=p.classNames)==null?void 0:Xe.loader),visible:Ye==="loading"})}const al=p.icon||(Q==null?void 0:Q[Ye])||iW(Ye);var to,ss;return xe.createElement("li",{tabIndex:0,ref:Ke,className:Ci(N,kt,Z==null?void 0:Z.toast,p==null||(e=p.classNames)==null?void 0:e.toast,Z==null?void 0:Z[Ot],p==null||(n=p.classNames)==null?void 0:n[Ot]),"data-sonner-toast":"","data-rich-colors":(to=p.richColors)!=null?to: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":xd,"data-index":b,"data-front":St,"data-swiping":_e,"data-dismissible":qe,"data-type":Ye,"data-invert":eo,"data-swipe-out":ae,"data-swipe-direction":D,"data-expanded":!!(C||z&&oe),"data-testid":p.testId,style:{"--index":b,"--toasts-before":b,"--z-index":E.length-b,"--offset":`${se?vt:Xn.current}px`,"--initial-height":z?"auto":`${Xt}px`,...I,...p.style},onDragEnd:()=>{de(!1),W(null),mn.current=null},onPointerDown:Xe=>{Xe.button!==2&&(Ys||!qe||(We.current=new Date,Mt(Xn.current),Xe.target.setPointerCapture(Xe.pointerId),Xe.target.tagName!=="BUTTON"&&(de(!0),mn.current={x:Xe.clientX,y:Xe.clientY})))},onPointerUp:()=>{var Xe,Lt,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),is=Number(((Lt=Ke.current)==null?void 0:Lt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ut=new Date().getTime()-((Ft=We.current)==null?void 0:Ft.getTime()),Ln=ee==="x"?zn:is,$r=Math.abs(Ln)/Ut;if((ee==="x"?Qn.includes(zn>0?"right":"left"):Qn.includes(is>0?"bottom":"top"))&&(Math.abs(Ln)>=PW||$r>.11)){Mt(Xn.current),p.onDismiss==null||p.onDismiss.call(p,p),X(ee==="x"?zn>0?"right":"left":is>0?"down":"up"),On(),Oe(!0);return}else{var ar,Rn;(ar=Ke.current)==null||ar.style.setProperty("--swipe-amount-x","0px"),(Rn=Ke.current)==null||Rn.style.setProperty("--swipe-amount-y","0px")}Ge(!1),de(!1),W(null)},onPointerMove:Xe=>{var Lt,Ft,zn;if(!mn.current||!qe||((Lt=window.getSelection())==null?void 0:Lt.toString().length)>0)return;const Ut=Xe.clientY-mn.current.y,Ln=Xe.clientX-mn.current.x;!ee&&(Math.abs(Ln)>1||Math.abs(Ut)>1)&&W(Math.abs(Ln)>Math.abs(Ut)?"x":"y");let $r={x:0,y:0};const Xs=ar=>1/(1.5+Math.abs(ar)/20);if(ee==="y"){if(Qn.includes("top")||Qn.includes("bottom"))if(Qn.includes("top")&&Ut<0||Qn.includes("bottom")&&Ut>0)$r.y=Ut;else{const ar=Ut*Xs(Ut);$r.y=Math.abs(ar)<Math.abs(Ut)?ar:Ut}}else if(ee==="x"&&(Qn.includes("left")||Qn.includes("right")))if(Qn.includes("left")&&Ln<0||Qn.includes("right")&&Ln>0)$r.x=Ln;else{const ar=Ln*Xs(Ln);$r.x=Math.abs(ar)<Math.abs(Ln)?ar: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"?xe.createElement("button",{"aria-label":U,"data-disabled":Ys,"data-close-button":!0,onClick:Ys||!qe?()=>{}:()=>{On(),p.onDismiss==null||p.onDismiss.call(p,p)},className:Ci(Z==null?void 0:Z.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(ss=Q==null?void 0:Q.close)!=null?ss:fW):null,(Ye||p.icon||p.promise)&&p.icon!==null&&((Q==null?void 0:Q[Ye])!==null||p.icon)?xe.createElement("div",{"data-icon":"",className:Ci(Z==null?void 0:Z.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},Ye==="loading"?p.icon||Ts():p.promise?Ts():null,Ye!=="loading"?al:null):null,xe.createElement("div",{"data-content":"",className:Ci(Z==null?void 0:Z.content,p==null||(i=p.classNames)==null?void 0:i.content)},xe.createElement("div",{"data-title":"",className:Ci(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?xe.createElement("div",{"data-description":"",className:Ci(j,rs,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),xe.isValidElement(p.cancel)?p.cancel:p.cancel&&E0(p.cancel)?xe.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||T,onClick:Xe=>{E0(p.cancel)&&qe&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Xe),On())},className:Ci(Z==null?void 0:Z.cancelButton,p==null||(u=p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,xe.isValidElement(p.action)?p.action:p.action&&E0(p.action)?xe.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||M,onClick:Xe=>{E0(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Xe),!Xe.defaultPrevented&&On())},className:Ci(Z==null?void 0:Z.actionButton,p==null||(d=p.classNames)==null?void 0:d.actionButton)},p.action.label):null)};function eC(){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 IW(t,e){const n={};return[t,e].forEach((r,s)=>{const i=s===1,o=i?"--mobile-offset":"--offset",l=i?kW:SW;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 MW=xe.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:x,style:_,visibleToasts:w=bW,toastOptions:b,dir:E=eC(),gap:C=CW,icons:R,customAriaLabel:A,containerAriaLabel:O="Notifications"}=e,[I,T]=xe.useState([]),M=xe.useMemo(()=>r?I.filter(re=>re.toasterId===r):I.filter(re=>!re.toasterId),[I,r]),N=xe.useMemo(()=>Array.from(new Set([i].concat(M.filter(re=>re.position).map(re=>re.position)))),[M,i]),[j,$]=xe.useState([]),[K,B]=xe.useState(!1),[z,Z]=xe.useState(!1),[Q,U]=xe.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),ee=xe.useRef(null),W=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),D=xe.useRef(null),X=xe.useRef(!1),oe=xe.useCallback(re=>{T(se=>{var fe;return(fe=se.find(_e=>_e.id===re.id))!=null&&fe.delete||Zr.dismiss(re.id),se.filter(({id:_e})=>_e!==re.id)})},[]);return xe.useEffect(()=>Zr.subscribe(re=>{if(re.dismiss){requestAnimationFrame(()=>{T(se=>se.map(fe=>fe.id===re.id?{...fe,delete:!0}:fe))});return}setTimeout(()=>{rW.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]})})})}),[]),xe.useEffect(()=>{if(g!=="system"){U(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;const re=window.matchMedia("(prefers-color-scheme: dark)");try{re.addEventListener("change",({matches:se})=>{U(se?"dark":"light")})}catch{re.addListener(({matches:fe})=>{try{U(fe?"dark":"light")}catch(_e){console.error(_e)}})}},[g]),xe.useEffect(()=>{I.length<=1&&B(!1)},[I]),xe.useEffect(()=>{const re=se=>{var fe;if(o.length>0&&o.every(ae=>se[ae]||se.code===ae)){var de;B(!0),(de=ee.current)==null||de.focus()}se.code==="Escape"&&(document.activeElement===ee.current||(fe=ee.current)!=null&&fe.contains(document.activeElement))&&B(!1)};return document.addEventListener("keydown",re),()=>document.removeEventListener("keydown",re)},[o]),xe.useEffect(()=>{if(ee.current)return()=>{D.current&&(D.current.focus({preventScroll:!0}),D.current=null,X.current=!1)}},[ee.current]),xe.createElement("section",{ref:n,"aria-label":A??`${O} ${W}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},N.map((re,se)=>{var fe;const[_e,de]=re.split("-");return M.length?xe.createElement("ol",{key:re,dir:E==="auto"?eC():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":`${EW}px`,"--gap":`${C}px`,..._,...IW(f,p)},onBlur:ae=>{X.current&&!ae.currentTarget.contains(ae.relatedTarget)&&(X.current=!1,D.current&&(D.current.focus({preventScroll:!0}),D.current=null))},onFocus:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||X.current||(X.current=!0,D.current=ae.relatedTarget)},onMouseEnter:()=>B(!0),onMouseMove:()=>B(!0),onMouseLeave:()=>{z||B(!1)},onDragEnd:()=>B(!1),onPointerDown:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||Z(!0)},onPointerUp:()=>Z(!1)},M.filter(ae=>!ae.position&&se===0||ae.position===re).map((ae,Oe)=>{var ke,Ge;return xe.createElement(TW,{key:ae.id,icons:R,index:Oe,toast:ae,defaultRichColors:v,duration:(ke=b==null?void 0:b.duration)!=null?ke:x,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:s,visibleToasts:w,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:M.filter(vt=>vt.position==ae.position),heights:j.filter(vt=>vt.position==ae.position),setHeights:$,expandByDefault:l,gap:C,expanded:K,swipeDirections:e.swipeDirections})})):null}))}),OW=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"}))]]),LW=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"}))]]),NW=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"}))]]),DW=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"}))]]),jW=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"}))]]),$W=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"}))]]),FW=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"}))]]),VW=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"}))]]),HW=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"}))]]),zW=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"}))]]),UW=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"}))]]),BW=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"}))]]),ZW=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"}))]]),WW=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"}))]]),qW=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"}))]]),GW=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"}))]]),KW=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"}))]]),YW=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"}))]]),XW=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"}))]]),QW=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"}))]]),JW=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"}))]]),eq=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"}))]]),tq=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"}))]]),nq=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"}))]]),rq=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"}))]]),sq=m.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),tn=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,...x}=m.useContext(sq);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,...x,...d},!!n&&m.createElement("title",null,n),l,u.get(i??g))});tn.displayName="IconBase";const jT=m.forwardRef((t,e)=>m.createElement(tn,{ref:e,...t,weights:OW}));jT.displayName="ArrowLeftIcon";const iq=jT,$T=m.forwardRef((t,e)=>m.createElement(tn,{ref:e,...t,weights:LW}));$T.displayName="ArrowSquareOutIcon";const oq=$T,FT=m.forwardRef((t,e)=>m.createElement(tn,{ref:e,...t,weights:NW}));FT.displayName="ArrowUpIcon";const aq=FT,VT=m.forwardRef((t,e)=>m.createElement(tn,{ref:e,...t,weights:DW}));VT.displayName="CaretDownIcon";const lq=VT,HT=m.forwardRef((t,e)=>m.createElement(tn,{ref:e,...t,weights:jW}));HT.displayName="CaretRightIcon";const cq=HT,zT=m.forwardRef((t,e)=>m.createElement(tn,{ref:e,...t,weights:$W}));zT.displayName="ChatCircleIcon";const uq=zT,UT=m.forwardRef((t,e)=>m.createElement(tn,{ref:e,...t,weights:FW}));UT.displayName="CheckIcon";const dq=UT,BT=m.forwardRef((t,e)=>m.createElement(tn,{ref:e,...t,weights:VW}));BT.displayName="CircleNotchIcon";const Fg=BT,ZT=m.forwardRef((t,e)=>m.createElement(tn,{ref:e,...t,weights:HW}));ZT.displayName="CopyIcon";const mh=ZT,WT=m.forwardRef((t,e)=>m.createElement(tn,{ref:e,...t,weights:zW}));WT.displayName="DotsThreeIcon";const fq=WT,qT=m.forwardRef((t,e)=>m.createElement(tn,{ref:e,...t,weights:UW}));qT.displayName="FolderOpenIcon";const hq=qT,GT=m.forwardRef((t,e)=>m.createElement(tn,{ref:e,...t,weights:BW}));GT.displayName="FolderSimpleIcon";const pq=GT,KT=m.forwardRef((t,e)=>m.createElement(tn,{ref:e,...t,weights:ZW}));KT.displayName="MagnifyingGlassIcon";const mq=KT,YT=m.forwardRef((t,e)=>m.createElement(tn,{ref:e,...t,weights:WW}));YT.displayName="PencilSimpleIcon";const XT=YT,QT=m.forwardRef((t,e)=>m.createElement(tn,{ref:e,...t,weights:qW}));QT.displayName="PushPinIcon";const J2=QT,JT=m.forwardRef((t,e)=>m.createElement(tn,{ref:e,...t,weights:GW}));JT.displayName="SidebarSimpleIcon";const gq=JT,eI=m.forwardRef((t,e)=>m.createElement(tn,{ref:e,...t,weights:KW}));eI.displayName="SignInIcon";const vq=eI,tI=m.forwardRef((t,e)=>m.createElement(tn,{ref:e,...t,weights:YW}));tI.displayName="SignOutIcon";const yq=tI,nI=m.forwardRef((t,e)=>m.createElement(tn,{ref:e,...t,weights:XW}));nI.displayName="SparkleIcon";const Yy=nI,rI=m.forwardRef((t,e)=>m.createElement(tn,{ref:e,...t,weights:QW}));rI.displayName="SquaresFourIcon";const _q=rI,sI=m.forwardRef((t,e)=>m.createElement(tn,{ref:e,...t,weights:JW}));sI.displayName="SwatchesIcon";const iI=sI,oI=m.forwardRef((t,e)=>m.createElement(tn,{ref:e,...t,weights:eq}));oI.displayName="TrashIcon";const aI=oI,lI=m.forwardRef((t,e)=>m.createElement(tn,{ref:e,...t,weights:tq}));lI.displayName="UserIcon";const xq=lI,cI=m.forwardRef((t,e)=>m.createElement(tn,{ref:e,...t,weights:nq}));cI.displayName="XIcon";const ob=cI,uI=m.forwardRef((t,e)=>m.createElement(tn,{ref:e,...t,weights:rq}));uI.displayName="XLogoIcon";const wq=uI,bq="/assets/arena-Db0j1set.png",Sq="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 dI(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=dI(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function fI(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=dI(t))&&(r&&(r+=" "),r+=e);return r}const kq=(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},Eq=(t,e)=>({classGroupId:t,validator:e}),hI=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Jm="-",tC=[],Cq="arbitrary..",Pq=t=>{const e=Aq(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return Rq(o);const l=o.split(Jm),u=l[0]===""&&l.length>1?1:0;return pI(l,u,e)},getConflictingClassGroupIds:(o,l)=>{if(l){const u=r[o],d=n[o];return u?d?kq(d,u):u:d||tC}return n[o]||tC}}},pI=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const d=pI(t,e+1,i);if(d)return d}const o=n.validators;if(o===null)return;const l=e===0?t.join(Jm):t.slice(e).join(Jm),u=o.length;for(let d=0;d<u;d++){const f=o[d];if(f.validator(l))return f.classGroupId}},Rq=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?Cq+r:void 0})(),Aq=t=>{const{theme:e,classGroups:n}=t;return Tq(n,e)},Tq=(t,e)=>{const n=hI();for(const r in t){const s=t[r];ab(s,n,r,e)}return n},ab=(t,e,n,r)=>{const s=t.length;for(let i=0;i<s;i++){const o=t[i];Iq(o,e,n,r)}},Iq=(t,e,n,r)=>{if(typeof t=="string"){Mq(t,e,n);return}if(typeof t=="function"){Oq(t,e,n,r);return}Lq(t,e,n,r)},Mq=(t,e,n)=>{const r=t===""?e:mI(e,t);r.classGroupId=n},Oq=(t,e,n,r)=>{if(Nq(t)){ab(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(Eq(n,t))},Lq=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let o=0;o<i;o++){const[l,u]=s[o];ab(u,mI(e,l),n,r)}},mI=(t,e)=>{let n=t;const r=e.split(Jm),s=r.length;for(let i=0;i<s;i++){const o=r[i];let l=n.nextPart.get(o);l||(l=hI(),n.nextPart.set(o,l)),n=l}return n},Nq=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,Dq=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)}}},ex="!",nC=":",jq=[],rC=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),$q=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 w=s[_];if(o===0&&l===0){if(w===nC){i.push(s.slice(u,_)),u=_+1;continue}if(w==="/"){d=_;continue}}w==="["?o++:w==="]"?o--:w==="("?l++:w===")"&&l--}const p=i.length===0?s:s.slice(u);let g=p,v=!1;p.endsWith(ex)?(g=p.slice(0,-1),v=!0):p.startsWith(ex)&&(g=p.slice(1),v=!0);const x=d&&d>u?d-u:void 0;return rC(i,v,g,x)};if(e){const s=e+nC,i=r;r=o=>o.startsWith(s)?i(o.slice(s.length)):rC(jq,!1,o,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},Fq=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}},Vq=t=>({cache:Dq(t.cacheSize),parseClassName:$q(t),sortModifiers:Fq(t),postfixLookupClassGroupIds:Hq(t),...Pq(t)}),Hq=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},zq=/\s+/,Uq=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:o}=e,l=[],u=t.trim().split(zq);let d="";for(let f=u.length-1;f>=0;f-=1){const p=u[f],{isExternal:g,modifiers:v,hasImportantModifier:x,baseClassName:_,maybePostfixModifierPosition:w}=n(p);if(g){d=p+(d.length>0?" "+d:d);continue}let b=!!w,E;if(b){const I=_.substring(0,w);E=r(I);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=x?C+ex:C,A=R+E;if(l.indexOf(A)>-1)continue;l.push(A);const O=s(E,b);for(let I=0;I<O.length;++I){const T=O[I];l.push(R+T)}d=p+(d.length>0?" "+d:d)}return d},Bq=(...t)=>{let e=0,n,r,s="";for(;e<t.length;)(n=t[e++])&&(r=gI(n))&&(s&&(s+=" "),s+=r);return s},gI=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=gI(t[r]))&&(n&&(n+=" "),n+=e);return n},Zq=(t,...e)=>{let n,r,s,i;const o=u=>{const d=e.reduce((f,p)=>p(f),t());return n=Vq(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=Uq(u,n);return s(u,f),f};return i=o,(...u)=>i(Bq(...u))},Wq=[],Zn=t=>{const e=n=>n[t]||Wq;return e.isThemeGetter=!0,e.themeKey=t,e},vI=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,yI=/^\((?:(\w[\w-]*):)?(.+)\)$/i,qq=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Gq=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Kq=/\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$/,Yq=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,Xq=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Qq=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ma=t=>qq.test(t),ft=t=>!!t&&!Number.isNaN(Number(t)),Pi=t=>!!t&&Number.isInteger(Number(t)),Xy=t=>t.endsWith("%")&&ft(t.slice(0,-1)),go=t=>Gq.test(t),_I=()=>!0,Jq=t=>Kq.test(t)&&!Yq.test(t),lb=()=>!1,eG=t=>Xq.test(t),tG=t=>Qq.test(t),nG=t=>!Me(t)&&!De(t),rG=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)),sG=t=>el(t,bI,lb),Me=t=>vI.test(t),Al=t=>el(t,SI,Jq),sC=t=>el(t,fG,ft),iG=t=>el(t,EI,_I),oG=t=>el(t,kI,lb),iC=t=>el(t,xI,lb),aG=t=>el(t,wI,tG),C0=t=>el(t,CI,eG),De=t=>yI.test(t),yf=t=>xc(t,SI),lG=t=>xc(t,kI),oC=t=>xc(t,xI),cG=t=>xc(t,bI),uG=t=>xc(t,wI),P0=t=>xc(t,CI,!0),dG=t=>xc(t,EI,!0),el=(t,e,n)=>{const r=vI.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},xc=(t,e,n=!1)=>{const r=yI.exec(t);return r?r[1]?e(r[1]):n:!1},xI=t=>t==="position"||t==="percentage",wI=t=>t==="image"||t==="url",bI=t=>t==="length"||t==="size"||t==="bg-size",SI=t=>t==="length",fG=t=>t==="number",kI=t=>t==="family-name",EI=t=>t==="number"||t==="weight",CI=t=>t==="shadow",hG=()=>{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"),x=Zn("blur"),_=Zn("perspective"),w=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],O=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],T=()=>[De,Me,u],M=()=>[ma,"full","auto",...T()],N=()=>[Pi,"none","subgrid",De,Me],j=()=>["auto",{span:["full",Pi,De,Me]},Pi,De,Me],$=()=>[Pi,"auto",De,Me],K=()=>["auto","min","max","fr",De,Me],B=()=>["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=()=>[ma,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],U=()=>[l,ma,"screen","full","dvw","lvw","svw","min","max","fit",...T()],ee=()=>[ma,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],W=()=>[t,De,Me],D=()=>[...R(),oC,iC,{position:[De,Me]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],oe=()=>["auto","cover","contain",cG,sG,{size:[De,Me]}],re=()=>[Xy,yf,Al],se=()=>["","none","full",d,De,Me],fe=()=>["",ft,yf,Al],_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,Xy,oC,iC],Oe=()=>["","none",x,De,Me],ke=()=>["none",ft,De,Me],Ge=()=>["none",ft,De,Me],vt=()=>[ft,De,Me],Mt=()=>[ma,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[go],breakpoint:[go],color:[_I],container:[go],"drop-shadow":[go],ease:["in","out","in-out"],font:[nG],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[go],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[go],shadow:[go],spacing:["px",ft],text:[go],"text-shadow":[go],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ma,Me,De,w]}],container:["container"],"container-type":[{"@container":["","normal","size",De,Me]}],"container-named":[rG],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:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[Pi,"auto",De,Me]}],basis:[{basis:[ma,"full","auto",l,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ft,ma,"auto","initial","none",Me]}],grow:[{grow:["",ft,De,Me]}],shrink:[{shrink:["",ft,De,Me]}],order:[{order:[Pi,"first","last","none",De,Me]}],"grid-cols":[{"grid-cols":N()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":N()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":K()}],"auto-rows":[{"auto-rows":K()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...B(),"normal"]}],"justify-items":[{"justify-items":[...z(),"normal"]}],"justify-self":[{"justify-self":["auto",...z()]}],"align-content":[{content:["normal",...B()]}],"align-items":[{items:[...z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...z(),{baseline:["","last"]}]}],"place-content":[{"place-content":B()}],"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",...U()]}],"min-inline-size":[{"min-inline":["auto",...U()]}],"max-inline-size":[{"max-inline":["none",...U()]}],"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,yf,Al]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,dG,iG]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Xy,Me]}],"font-family":[{font:[lG,oG,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,sC]}],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,Al]}],"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:[Pi,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:D()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Pi,De,Me],radial:["",De,Me],conic:["",Pi,De,Me]},uG,aG]}],"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,yf,Al]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","inner","none",f,P0,C0]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",p,P0,C0]}],"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,Al]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":fe()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",g,P0,C0]}],"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:D()}],"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,P0,C0]}],"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:Mt()}],"translate-x":[{"translate-x":Mt()}],"translate-y":[{"translate-y":Mt()}],"translate-z":[{"translate-z":Mt()}],"translate-none":["translate-none"],zoom:[{zoom:[Pi,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,yf,Al,sC]}],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"]}},pG=Zq(hG);function zt(...t){return pG(fI(t))}const Wf=({provider:t,className:e})=>{if(t==="x")return S.jsx(wq,{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"?Sq:bq;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 It;(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})(It||(It={}));var aC;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(aC||(aC={}));const Ve=It.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_a=t=>{switch(typeof t){case"undefined":return Ve.undefined;case"string":return Ve.string;case"number":return Number.isNaN(t)?Ve.nan:Ve.number;case"boolean":return Ve.boolean;case"function":return Ve.function;case"bigint":return Ve.bigint;case"symbol":return Ve.symbol;case"object":return Array.isArray(t)?Ve.array:t===null?Ve.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Ve.promise:typeof Map<"u"&&t instanceof Map?Ve.map:typeof Set<"u"&&t instanceof Set?Ve.set:typeof Date<"u"&&t instanceof Date?Ve.date:Ve.object;default:return Ve.unknown}},we=It.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 Fo 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 Fo))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,It.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()}}Fo.create=t=>new Fo(t);const tx=(t,e)=>{let n;switch(t.code){case we.invalid_type:t.received===Ve.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case we.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,It.jsonStringifyReplacer)}`;break;case we.unrecognized_keys:n=`Unrecognized key(s) in object: ${It.joinValues(t.keys,", ")}`;break;case we.invalid_union:n="Invalid input";break;case we.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${It.joinValues(t.options)}`;break;case we.invalid_enum_value:n=`Invalid enum value. Expected ${It.joinValues(t.options)}, received '${t.received}'`;break;case we.invalid_arguments:n="Invalid function arguments";break;case we.invalid_return_type:n="Invalid function return type";break;case we.invalid_date:n="Invalid date";break;case we.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}"`:It.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case we.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 we.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 we.custom:n="Invalid input";break;case we.invalid_intersection_types:n="Intersection results could not be merged";break;case we.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case we.not_finite:n="Number must be finite";break;default:n=e.defaultError,It.assertNever(t)}return{message:n}};let mG=tx;function gG(){return mG}const vG=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 Te(t,e){const n=gG(),r=vG({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===tx?void 0:tx].filter(s=>!!s)});t.common.issues.push(r)}class ks{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 st;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 ks.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 st;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 st=Object.freeze({status:"aborted"}),Ef=t=>({status:"dirty",value:t}),Ks=t=>({status:"valid",value:t}),lC=t=>t.status==="aborted",cC=t=>t.status==="dirty",nd=t=>t.status==="valid",eg=t=>typeof Promise<"u"&&t instanceof Promise;var Ue;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Ue||(Ue={}));class Ba{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 uC=(t,e)=>{if(nd(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 Fo(t.common.issues);return this._error=n,this._error}}};function ht(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 Ct{get description(){return this._def.description}_getType(e){return _a(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:_a(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ks,ctx:{common:e.parent.common,data:e.data,parsedType:_a(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(eg(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:_a(e)},s=this._parseSync({data:e,path:r.path,parent:r});return uC(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:_a(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return nd(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=>nd(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:_a(e)},s=this._parse({data:e,path:r.path,parent:r}),i=await(eg(s)?s:Promise.resolve(s));return uC(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:we.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 hc({schema:this,typeName:ot.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 No.create(this,this._def)}nullable(){return pc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Bi.create(this)}promise(){return ig.create(this,this._def)}or(e){return ng.create([this,e],this._def)}and(e){return rg.create(this,e,this._def)}transform(e){return new hc({...ht(this._def),schema:this,typeName:ot.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new og({...ht(this._def),innerType:this,defaultValue:n,typeName:ot.ZodDefault})}brand(){return new TI({typeName:ot.ZodBranded,type:this,...ht(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new ag({...ht(this._def),innerType:this,catchValue:n,typeName:ot.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return ub.create(this,e)}readonly(){return lg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const yG=/^c[^\s-]{8,}$/i,_G=/^[0-9a-z]+$/,xG=/^[0-9A-HJKMNP-TV-Z]{26}$/i,wG=/^[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,bG=/^[a-z0-9_-]{21}$/i,SG=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,kG=/^[-+]?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)?)??$/,EG=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,CG="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Qy;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])$/,RG=/^(?:(?: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])$/,AG=/^(([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]))$/,TG=/^(([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])$/,IG=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,MG=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,PI="((\\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])))",OG=new RegExp(`^${PI}$`);function RI(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 LG(t){return new RegExp(`^${RI(t)}$`)}function NG(t){let e=`${PI}T${RI(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 DG(t,e){return!!((e==="v4"||!e)&&PG.test(t)||(e==="v6"||!e)&&AG.test(t))}function jG(t,e){if(!SG.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 $G(t,e){return!!((e==="v4"||!e)&&RG.test(t)||(e==="v6"||!e)&&TG.test(t))}class Ma extends Ct{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Ve.string){const i=this._getOrReturnCtx(e);return Te(i,{code:we.invalid_type,expected:Ve.string,received:i.parsedType}),st}const r=new ks;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),Te(s,{code:we.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),Te(s,{code:we.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?Te(s,{code:we.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&Te(s,{code:we.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")EG.test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"email",code:we.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")Qy||(Qy=new RegExp(CG,"u")),Qy.test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"emoji",code:we.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")wG.test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"uuid",code:we.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")bG.test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"nanoid",code:we.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")yG.test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"cuid",code:we.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")_G.test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"cuid2",code:we.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")xG.test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"ulid",code:we.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),Te(s,{validation:"url",code:we.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),Te(s,{validation:"regex",code:we.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),Te(s,{code:we.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),Te(s,{code:we.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),Te(s,{code:we.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?NG(i).test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{code:we.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?OG.test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{code:we.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?LG(i).test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{code:we.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?kG.test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"duration",code:we.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?DG(e.data,i.version)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"ip",code:we.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?jG(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"jwt",code:we.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?$G(e.data,i.version)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"cidr",code:we.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?IG.test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"base64",code:we.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?MG.test(e.data)||(s=this._getOrReturnCtx(e,s),Te(s,{validation:"base64url",code:we.invalid_string,message:i.message}),r.dirty()):It.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:we.invalid_string,...Ue.errToObj(r)})}_addCheck(e){return new Ma({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ue.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ue.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ue.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ue.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ue.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ue.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ue.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ue.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ue.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Ue.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Ue.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ue.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Ue.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,...Ue.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,...Ue.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Ue.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Ue.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...Ue.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Ue.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Ue.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Ue.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Ue.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Ue.errToObj(n)})}nonempty(e){return this.min(1,Ue.errToObj(e))}trim(){return new Ma({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ma({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ma({...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}}Ma.create=t=>new Ma({checks:[],typeName:ot.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...ht(t)});function FG(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 rd extends Ct{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)!==Ve.number){const i=this._getOrReturnCtx(e);return Te(i,{code:we.invalid_type,expected:Ve.number,received:i.parsedType}),st}let r;const s=new ks;for(const i of this._def.checks)i.kind==="int"?It.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Te(r,{code:we.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),Te(r,{code:we.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),Te(r,{code:we.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?FG(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),Te(r,{code:we.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Te(r,{code:we.not_finite,message:i.message}),s.dirty()):It.assertNever(i);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Ue.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ue.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ue.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ue.toString(n))}setLimit(e,n,r,s){return new rd({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ue.toString(s)}]})}_addCheck(e){return new rd({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ue.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ue.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ue.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ue.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ue.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ue.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Ue.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ue.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ue.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"&&It.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)}}rd.create=t=>new rd({checks:[],typeName:ot.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...ht(t)});class gh extends Ct{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)!==Ve.bigint)return this._getInvalidInput(e);let r;const s=new ks;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),Te(r,{code:we.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),Te(r,{code:we.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),Te(r,{code:we.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):It.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Te(n,{code:we.invalid_type,expected:Ve.bigint,received:n.parsedType}),st}gte(e,n){return this.setLimit("min",e,!0,Ue.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ue.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ue.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ue.toString(n))}setLimit(e,n,r,s){return new gh({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ue.toString(s)}]})}_addCheck(e){return new gh({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ue.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ue.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ue.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ue.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ue.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}}gh.create=t=>new gh({checks:[],typeName:ot.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...ht(t)});class nx extends Ct{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Ve.boolean){const r=this._getOrReturnCtx(e);return Te(r,{code:we.invalid_type,expected:Ve.boolean,received:r.parsedType}),st}return Ks(e.data)}}nx.create=t=>new nx({typeName:ot.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...ht(t)});class tg extends Ct{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Ve.date){const i=this._getOrReturnCtx(e);return Te(i,{code:we.invalid_type,expected:Ve.date,received:i.parsedType}),st}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return Te(i,{code:we.invalid_date}),st}const r=new ks;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),Te(s,{code:we.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),Te(s,{code:we.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):It.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new tg({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Ue.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Ue.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}}tg.create=t=>new tg({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ot.ZodDate,...ht(t)});class dC extends Ct{_parse(e){if(this._getType(e)!==Ve.symbol){const r=this._getOrReturnCtx(e);return Te(r,{code:we.invalid_type,expected:Ve.symbol,received:r.parsedType}),st}return Ks(e.data)}}dC.create=t=>new dC({typeName:ot.ZodSymbol,...ht(t)});class rx extends Ct{_parse(e){if(this._getType(e)!==Ve.undefined){const r=this._getOrReturnCtx(e);return Te(r,{code:we.invalid_type,expected:Ve.undefined,received:r.parsedType}),st}return Ks(e.data)}}rx.create=t=>new rx({typeName:ot.ZodUndefined,...ht(t)});class sx extends Ct{_parse(e){if(this._getType(e)!==Ve.null){const r=this._getOrReturnCtx(e);return Te(r,{code:we.invalid_type,expected:Ve.null,received:r.parsedType}),st}return Ks(e.data)}}sx.create=t=>new sx({typeName:ot.ZodNull,...ht(t)});class fC extends Ct{constructor(){super(...arguments),this._any=!0}_parse(e){return Ks(e.data)}}fC.create=t=>new fC({typeName:ot.ZodAny,...ht(t)});class hC extends Ct{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ks(e.data)}}hC.create=t=>new hC({typeName:ot.ZodUnknown,...ht(t)});class Za extends Ct{_parse(e){const n=this._getOrReturnCtx(e);return Te(n,{code:we.invalid_type,expected:Ve.never,received:n.parsedType}),st}}Za.create=t=>new Za({typeName:ot.ZodNever,...ht(t)});class pC extends Ct{_parse(e){if(this._getType(e)!==Ve.undefined){const r=this._getOrReturnCtx(e);return Te(r,{code:we.invalid_type,expected:Ve.void,received:r.parsedType}),st}return Ks(e.data)}}pC.create=t=>new pC({typeName:ot.ZodVoid,...ht(t)});class Bi extends Ct{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==Ve.array)return Te(n,{code:we.invalid_type,expected:Ve.array,received:n.parsedType}),st;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,l=n.data.length<s.exactLength.value;(o||l)&&(Te(n,{code:o?we.too_big:we.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&&(Te(n,{code:we.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&&(Te(n,{code:we.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 Ba(n,o,n.path,l)))).then(o=>ks.mergeArray(r,o));const i=[...n.data].map((o,l)=>s.type._parseSync(new Ba(n,o,n.path,l)));return ks.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new Bi({...this._def,minLength:{value:e,message:Ue.toString(n)}})}max(e,n){return new Bi({...this._def,maxLength:{value:e,message:Ue.toString(n)}})}length(e,n){return new Bi({...this._def,exactLength:{value:e,message:Ue.toString(n)}})}nonempty(e){return this.min(1,e)}}Bi.create=(t,e)=>new Bi({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ot.ZodArray,...ht(e)});function mu(t){if(t instanceof Fn){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=No.create(mu(r))}return new Fn({...t._def,shape:()=>e})}else return t instanceof Bi?new Bi({...t._def,type:mu(t.element)}):t instanceof No?No.create(mu(t.unwrap())):t instanceof pc?pc.create(mu(t.unwrap())):t instanceof dc?dc.create(t.items.map(e=>mu(e))):t}class Fn extends Ct{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=It.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Ve.object){const d=this._getOrReturnCtx(e);return Te(d,{code:we.invalid_type,expected:Ve.object,received:d.parsedType}),st}const{status:r,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof Za&&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 Ba(s,p,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof Za){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&&(Te(s,{code:we.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 Ba(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=>ks.mergeObjectSync(r,d)):ks.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(e){return Ue.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:Ue.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:ot.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 It.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 It.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new Fn({...this._def,shape:()=>n})}deepPartial(){return mu(this)}partial(e){const n={};for(const r of It.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 It.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof No;)i=i._def.innerType;n[r]=i}return new Fn({...this._def,shape:()=>n})}keyof(){return AI(It.objectKeys(this.shape))}}Fn.create=(t,e)=>new Fn({shape:()=>t,unknownKeys:"strip",catchall:Za.create(),typeName:ot.ZodObject,...ht(e)});Fn.strictCreate=(t,e)=>new Fn({shape:()=>t,unknownKeys:"strict",catchall:Za.create(),typeName:ot.ZodObject,...ht(e)});Fn.lazycreate=(t,e)=>new Fn({shape:t,unknownKeys:"strip",catchall:Za.create(),typeName:ot.ZodObject,...ht(e)});class ng extends Ct{_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 Fo(l.ctx.common.issues));return Te(n,{code:we.invalid_union,unionErrors:o}),st}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 Fo(u));return Te(n,{code:we.invalid_union,unionErrors:l}),st}}get options(){return this._def.options}}ng.create=(t,e)=>new ng({options:t,typeName:ot.ZodUnion,...ht(e)});const So=t=>t instanceof ox?So(t.schema):t instanceof hc?So(t.innerType()):t instanceof sg?[t.value]:t instanceof fc?t.options:t instanceof ax?It.objectValues(t.enum):t instanceof og?So(t._def.innerType):t instanceof rx?[void 0]:t instanceof sx?[null]:t instanceof No?[void 0,...So(t.unwrap())]:t instanceof pc?[null,...So(t.unwrap())]:t instanceof TI||t instanceof lg?So(t.unwrap()):t instanceof ag?So(t._def.innerType):[];class cb extends Ct{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ve.object)return Te(n,{code:we.invalid_type,expected:Ve.object,received:n.parsedType}),st;const r=this.discriminator,s=n.data[r],i=this.optionsMap.get(s);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(Te(n,{code:we.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),st)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const s=new Map;for(const i of n){const o=So(i.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const l of o){if(s.has(l))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(l)}`);s.set(l,i)}}return new cb({typeName:ot.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...ht(r)})}}function ix(t,e){const n=_a(t),r=_a(e);if(t===e)return{valid:!0,data:t};if(n===Ve.object&&r===Ve.object){const s=It.objectKeys(e),i=It.objectKeys(t).filter(l=>s.indexOf(l)!==-1),o={...t,...e};for(const l of i){const u=ix(t[l],e[l]);if(!u.valid)return{valid:!1};o[l]=u.data}return{valid:!0,data:o}}else if(n===Ve.array&&r===Ve.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=ix(o,l);if(!u.valid)return{valid:!1};s.push(u.data)}return{valid:!0,data:s}}else return n===Ve.date&&r===Ve.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class rg extends Ct{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(i,o)=>{if(lC(i)||lC(o))return st;const l=ix(i.value,o.value);return l.valid?((cC(i)||cC(o))&&n.dirty(),{status:n.value,value:l.data}):(Te(r,{code:we.invalid_intersection_types}),st)};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}))}}rg.create=(t,e,n)=>new rg({left:t,right:e,typeName:ot.ZodIntersection,...ht(n)});class dc extends Ct{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ve.array)return Te(r,{code:we.invalid_type,expected:Ve.array,received:r.parsedType}),st;if(r.data.length<this._def.items.length)return Te(r,{code:we.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),st;!this._def.rest&&r.data.length>this._def.items.length&&(Te(r,{code:we.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 Ba(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>ks.mergeArray(n,o)):ks.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new dc({...this._def,rest:e})}}dc.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new dc({items:t,typeName:ot.ZodTuple,rest:null,...ht(e)})};class mC extends Ct{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!==Ve.map)return Te(r,{code:we.invalid_type,expected:Ve.map,received:r.parsedType}),st;const s=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([l,u],d)=>({key:s._parse(new Ba(r,l,r.path,[d,"key"])),value:i._parse(new Ba(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 st;(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 st;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(d.value,f.value)}return{status:n.value,value:l}}}}mC.create=(t,e,n)=>new mC({valueType:e,keyType:t,typeName:ot.ZodMap,...ht(n)});class vh extends Ct{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ve.set)return Te(r,{code:we.invalid_type,expected:Ve.set,received:r.parsedType}),st;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(Te(r,{code:we.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&&(Te(r,{code:we.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 st;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 Ba(r,u,r.path,d)));return r.common.async?Promise.all(l).then(u=>o(u)):o(l)}min(e,n){return new vh({...this._def,minSize:{value:e,message:Ue.toString(n)}})}max(e,n){return new vh({...this._def,maxSize:{value:e,message:Ue.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}vh.create=(t,e)=>new vh({valueType:t,minSize:null,maxSize:null,typeName:ot.ZodSet,...ht(e)});class ox extends Ct{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})}}ox.create=(t,e)=>new ox({getter:t,typeName:ot.ZodLazy,...ht(e)});class sg extends Ct{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Te(n,{received:n.data,code:we.invalid_literal,expected:this._def.value}),st}return{status:"valid",value:e.data}}get value(){return this._def.value}}sg.create=(t,e)=>new sg({value:t,typeName:ot.ZodLiteral,...ht(e)});function AI(t,e){return new fc({values:t,typeName:ot.ZodEnum,...ht(e)})}class fc extends Ct{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Te(n,{expected:It.joinValues(r),received:n.parsedType,code:we.invalid_type}),st}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 Te(n,{received:n.data,code:we.invalid_enum_value,options:r}),st}return Ks(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 fc.create(e,{...this._def,...n})}exclude(e,n=this._def){return fc.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}fc.create=AI;class ax extends Ct{_parse(e){const n=It.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Ve.string&&r.parsedType!==Ve.number){const s=It.objectValues(n);return Te(r,{expected:It.joinValues(s),received:r.parsedType,code:we.invalid_type}),st}if(this._cache||(this._cache=new Set(It.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=It.objectValues(n);return Te(r,{received:r.data,code:we.invalid_enum_value,options:s}),st}return Ks(e.data)}get enum(){return this._def.values}}ax.create=(t,e)=>new ax({values:t,typeName:ot.ZodNativeEnum,...ht(e)});class ig extends Ct{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ve.promise&&n.common.async===!1)return Te(n,{code:we.invalid_type,expected:Ve.promise,received:n.parsedType}),st;const r=n.parsedType===Ve.promise?n.data:Promise.resolve(n.data);return Ks(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ig.create=(t,e)=>new ig({type:t,typeName:ot.ZodPromise,...ht(e)});class hc extends Ct{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ot.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=>{Te(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 st;const u=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return u.status==="aborted"?st:u.status==="dirty"||n.value==="dirty"?Ef(u.value):u});{if(n.value==="aborted")return st;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?st:l.status==="dirty"||n.value==="dirty"?Ef(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"?st:(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"?st:(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(!nd(o))return st;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=>nd(o)?Promise.resolve(s.transform(o.value,i)).then(l=>({status:n.value,value:l})):st);It.assertNever(s)}}hc.create=(t,e,n)=>new hc({schema:t,typeName:ot.ZodEffects,effect:e,...ht(n)});hc.createWithPreprocess=(t,e,n)=>new hc({schema:e,effect:{type:"preprocess",transform:t},typeName:ot.ZodEffects,...ht(n)});class No extends Ct{_parse(e){return this._getType(e)===Ve.undefined?Ks(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}No.create=(t,e)=>new No({innerType:t,typeName:ot.ZodOptional,...ht(e)});class pc extends Ct{_parse(e){return this._getType(e)===Ve.null?Ks(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}pc.create=(t,e)=>new pc({innerType:t,typeName:ot.ZodNullable,...ht(e)});class og extends Ct{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===Ve.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}og.create=(t,e)=>new og({innerType:t,typeName:ot.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ht(e)});class ag extends Ct{_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 eg(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Fo(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Fo(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ag.create=(t,e)=>new ag({innerType:t,typeName:ot.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ht(e)});class gC extends Ct{_parse(e){if(this._getType(e)!==Ve.nan){const r=this._getOrReturnCtx(e);return Te(r,{code:we.invalid_type,expected:Ve.nan,received:r.parsedType}),st}return{status:"valid",value:e.data}}}gC.create=t=>new gC({typeName:ot.ZodNaN,...ht(t)});class TI extends Ct{_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 ub extends Ct{_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"?st:i.status==="dirty"?(n.dirty(),Ef(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"?st: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 ub({in:e,out:n,typeName:ot.ZodPipeline})}}class lg extends Ct{_parse(e){const n=this._def.innerType._parse(e),r=s=>(nd(s)&&(s.value=Object.freeze(s.value)),s);return eg(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}lg.create=(t,e)=>new lg({innerType:t,typeName:ot.ZodReadonly,...ht(e)});var ot;(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"})(ot||(ot={}));const Kn=Ma.create,II=rd.create,eoe=nx.create;Za.create;const db=Bi.create,mc=Fn.create;ng.create;const VG=cb.create;rg.create;dc.create;const vC=sg.create,fb=fc.create;ig.create;No.create;pc.create;const HG=st,zG=mc({hash:Kn().regex(/^[a-f0-9]{64}$/),mimeType:fb(["image/png","image/jpeg","image/webp","image/gif","image/avif"])}),UG=mc({id:Kn().min(1),title:Kn().trim().min(1),url:Kn().url().refine(t=>{try{const e=new URL(t);return["http:","https:"].includes(e.protocol)&&!e.username&&!e.password}catch{return!1}}).optional(),reason:Kn().optional(),image:zG.optional().catch(void 0)}).refine(t=>!!(t.url||t.image),{message:"A reference requires a public URL or an image"}),BG=(...t)=>{const e=[],n=new Set,r=new Set;for(const s of t.flatMap(i=>i??[])){const i=UG.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},ZG=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},WG=({reference:t,imageUrl:e,onOpen:n})=>{const[r,s]=m.useState(!1),i=!!e&&!r,o=t.url?ZG(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(Wf,{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]})},qG=({references:t,source:e,sessionId:n,variantId:r,projectPath:s,className:i})=>{const o=Xi(),l=BG(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(WG,{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},toe=t=>{const e=t.pathname.split("/").filter(Boolean).map(decodeURIComponent),n=e[3];if(e[2]==="references")return{kind:"references"};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}},noe=t=>{if(t.kind==="references")return"/rivet/library/references";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},GG=t=>{const e=new URLSearchParams(t),n=e.get("historySession"),r=e.get("historyVariant");return n&&r?{sessionId:n,variantId:r}:null},yC=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,_C=fI,KG=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return _C(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=yC(f)||yC(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(x=>{let[_,w]=x;return Array.isArray(w)?w.includes({...i,...l}[_]):{...i,...l}[_]===w})?[...d,p,g]:d},[]);return _C(t,o,u,n==null?void 0:n.class,n==null?void 0:n.className)},MI={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"}},OI=m.createContext(null);function Kh(){const t=m.useContext(OI);return t?t.classes:MI.pill}function YG(t){const e=document.documentElement;e.classList.add("transitioning"),e.offsetHeight,t(),setTimeout(()=>e.classList.remove("transitioning"),200)}function XG({children:t,defaultShape:e="pill"}){const[n,r]=m.useState(e),s=m.useCallback(i=>{YG(()=>r(i))},[]);return S.jsx(OI.Provider,{value:{shape:n,setShape:s,classes:MI[n]},children:t})}const QG=KG(["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"}}),xC={default:16,compact:14},JG={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)]"},LI=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",x=g==="compact"||g==="icon-compact",_=x?xC.compact:xC.default,w=Kh();return S.jsxs("button",{...d,ref:f,type:u,disabled:o||r,"aria-busy":r||d["aria-busy"],className:zt(QG({variant:p,size:g,iconLeft:!v&&!!s,iconRight:!v&&!!i}),w.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",JG[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:x?"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]})]})});LI.displayName="Button";var eK=Object.defineProperty,gd=(t,e)=>eK(t,"name",{value:e,configurable:!0}),NI=!!(typeof window<"u"&&window.document&&window.document.createElement);function Gt(t,e,{checkForDefaultPrevented:n=!0}={}){return gd(function(s){if(t==null||t(s),n===!1||!s||!s.defaultPrevented)return e==null?void 0:e(s)},"handleEvent")}gd(Gt,"composeEventHandlers");function tK(t){var e;if(!NI)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}gd(tK,"getOwnerWindow");function lx(t){if(!NI)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}gd(lx,"getOwnerDocument");function DI(t,e=!1){const{activeElement:n}=lx(t);if(!(n!=null&&n.nodeName))return null;if(jI(n)&&n.contentDocument)return DI(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const s=lx(n).getElementById(r);if(s)return s}}return n}gd(DI,"getActiveElement");function jI(t){return t.tagName==="IFRAME"}gd(jI,"isFrame");var nK=Object.defineProperty,hb=(t,e)=>nK(t,"name",{value:e,configurable:!0});function cx(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}hb(cx,"setRef");function $I(...t){return e=>{let n=!1;const r=t.map(s=>{const i=cx(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():cx(t[s],null)}}}}hb($I,"composeRefs");function en(...t){return m.useCallback($I(...t),t)}hb(en,"useComposedRefs");var rK=Object.defineProperty,Us=(t,e)=>rK(t,"name",{value:e,configurable:!0});function sK(t,e){const n=m.createContext(e);n.displayName=t+"Context";const r=Us(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 Us(s,"useContext"),[r,s]}Us(sK,"createContext");function Qi(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=Us(p=>{var b;const{scope:g,children:v,...x}=p,_=((b=g==null?void 0:g[t])==null?void 0:b[u])||l,w=m.useMemo(()=>x,Object.values(x));return S.jsx(_.Provider,{value:w,children:v})},"Provider");d.displayName=i+"Provider";function f(p,g,v={}){var b;const{optional:x=!1}=v,_=((b=g==null?void 0:g[t])==null?void 0:b[u])||l,w=m.useContext(_);if(w)return w;if(o!==void 0)return o;if(!x)throw new Error(`\`${p}\` must be used within \`${i}\``)}return Us(f,"useContext"),[d,f]}Us(r,"createContext");const s=Us(()=>{const i=n.map(o=>m.createContext(o));return Us(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,FI(s,...e)]}Us(Qi,"createContextScope");function FI(...t){const e=t[0];if(t.length===1)return e;const n=Us(()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return Us(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}Us(FI,"composeContextScopes");var iK=Object.defineProperty,_i=(t,e)=>iK(t,"name",{value:e,configurable:!0});function Wa(t){const e=m.forwardRef((n,r)=>{let{children:s,...i}=n,o=null,l=!1;const u=[];ux(s)&&typeof R0=="function"&&(s=R0(s._payload)),m.Children.forEach(s,g=>{var v;if(BI(g)){l=!0;const x=g;let _="child"in x.props?x.props.child:x.props.children;ux(_)&&typeof R0=="function"&&(_=R0(_._payload)),o=oK(x,_),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?UI(o):void 0,f=en(r,d);if(!o){if(s||s===0)throw new Error(l?cK(t):lK(t));return s}const p=zI(i,o.props??{});return o.type!==m.Fragment&&(p.ref=r?f:d),m.cloneElement(o,p)});return e.displayName=`${t}.Slot`,e}_i(Wa,"createSlot");var VI=Symbol.for("radix.slottable");function HI(t){const e=_i(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=VI,e}_i(HI,"createSlottable");var oK=_i((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 zI(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}}_i(zI,"mergeProps");function UI(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)}_i(UI,"getElementRef");function BI(t){return m.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===VI}_i(BI,"isSlottable");var aK=Symbol.for("react.lazy");function ux(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===aK&&"_payload"in t&&ZI(t._payload)}_i(ux,"isLazyComponent");function ZI(t){return typeof t=="object"&&t!==null&&"then"in t}_i(ZI,"isPromiseLike");var lK=_i(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),cK=_i(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),R0=Vh[" use ".trim().toString()],uK=Object.defineProperty,dK=(t,e)=>uK(t,"name",{value:e,configurable:!0}),fK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],kn=fK.reduce((t,e)=>{const n=Wa(`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 WI(t,e){t&&Gh.flushSync(()=>t.dispatchEvent(e))}dK(WI,"dispatchDiscreteCustomEvent");var hK=Object.defineProperty,pK=(t,e)=>hK(t,"name",{value:e,configurable:!0});function gc(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)}),[])}pK(gc,"useCallbackRef");var mK=Object.defineProperty,rr=(t,e)=>mK(t,"name",{value:e,configurable:!0}),dx="dismissableLayer.update",gK="dismissableLayer.pointerDownOutside",vK="dismissableLayer.focusOutside",wC,qI=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),pb=m.forwardRef(rr(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(qI),[g,v]=m.useState(null),x=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,_]=m.useState({}),w=en(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,O=R>=C,I=m.useRef(!1),T=KI($=>{o==null||o($),u==null||u($),$.defaultPrevented||d==null||d()},{ownerDocument:x,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:I,dismissableSurfaces:p.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback($=>{if(!($ instanceof Node))return!1;const K=[...p.branches].some(B=>B.contains($));return O&&!K},[p.branches,O])}),M=YI($=>{if(s&&I.current)return;const K=$.target;[...p.branches].some(z=>z.contains(K))||(l==null||l($),u==null||u($),$.defaultPrevented||d==null||d())},x),N=g?R===b.length-1:!1,j=gc($=>{$.key==="Escape"&&(i==null||i($),!$.defaultPrevented&&d&&($.preventDefault(),d()))});return m.useEffect(()=>{if(N)return x.addEventListener("keydown",j,{capture:!0}),()=>x.removeEventListener("keydown",j,{capture:!0})},[x,N,j]),m.useEffect(()=>{if(g)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(wC=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(g)),p.layers.add(g),fx(),()=>{r&&(p.layersWithOutsidePointerEventsDisabled.delete(g),p.layersWithOutsidePointerEventsDisabled.size===0&&(x.body.style.pointerEvents=wC))}},[g,x,r,p]),m.useEffect(()=>()=>{g&&(p.layers.delete(g),p.layersWithOutsidePointerEventsDisabled.delete(g),fx())},[g,p]),m.useEffect(()=>{const $=rr(()=>_({}),"handleUpdate");return document.addEventListener(dx,$),()=>document.removeEventListener(dx,$)},[]),S.jsx(kn.div,{...f,ref:w,style:{pointerEvents:A?O?"auto":"none":void 0,...e.style},onFocusCapture:Gt(e.onFocusCapture,M.onFocusCapture),onBlurCapture:Gt(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:Gt(e.onPointerDownCapture,T.onPointerDownCapture)})},"DismissableLayer"));function GI(){const t=m.useContext(qI),[e,n]=m.useState(null);return m.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}rr(GI,"useDismissableLayerSurface");var yK=rr(()=>!0,"IS_TRUE");function KI(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:o=yK}=e,l=gc(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()}rr(g,"resetOutsideInteraction");function v(){return Array.from(f.current.values()).some(Boolean)}rr(v,"isOutsideInteractionIntercepted");function x(C){if(!d.current)return;const R=C.target;R instanceof Node&&[...i].some(O=>O.contains(R))||f.current.set(C.type,!0),C.type==="click"&&window.setTimeout(()=>{d.current&&p.current()},0)}rr(x,"handleInteractionCapture");function _(C){d.current&&f.current.set(C.type,!1)}rr(_,"handleInteractionBubble");const w=rr(C=>{if(C.target&&!u.current){let R=function(){n.removeEventListener("click",p.current);const O=v();g(),O||mb(gK,l,A,{discrete:!0})};if(rr(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,x,!0),n.addEventListener(C,_);const E=window.setTimeout(()=>{n.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(E),n.removeEventListener("pointerdown",w),n.removeEventListener("click",p.current);for(const C of b)n.removeEventListener(C,x,!0),n.removeEventListener(C,_)}},[n,l,r,s,i,o]),{onPointerDownCapture:rr(()=>u.current=!0,"onPointerDownCapture")}}rr(KI,"usePointerDownOutside");function YI(t,e=globalThis==null?void 0:globalThis.document){const n=gc(t),r=m.useRef(!1);return m.useEffect(()=>{const s=rr(i=>{i.target&&!r.current&&mb(vK,n,{originalEvent:i},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:rr(()=>r.current=!0,"onFocusCapture"),onBlurCapture:rr(()=>r.current=!1,"onBlurCapture")}}rr(YI,"useFocusOutside");function fx(){const t=new CustomEvent(dx);document.dispatchEvent(t)}rr(fx,"dispatchUpdate");function mb(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?WI(s,i):s.dispatchEvent(i)}rr(mb,"handleAndDispatchCustomEvent");var Yr=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},_K=Object.defineProperty,xK=(t,e)=>_K(t,"name",{value:e,configurable:!0}),wK=Vh[" useId ".trim().toString()]||(()=>{}),bK=0;function ja(t){const[e,n]=m.useState(wK());return Yr(()=>{t||n(r=>r??String(bK++))},[t]),t||(e?`radix-${e}`:"")}xK(ja,"useId");const SK=["top","right","bottom","left"],qa=Math.min,Do=Math.max,cg=Math.round,A0=Math.floor,jo=t=>({x:t,y:t}),kK={left:"right",right:"left",bottom:"top",top:"bottom"};function XI(t,e,n){return Do(t,qa(e,n))}function Vo(t,e){return typeof t=="function"?t(e):t}function Ga(t){return t.split("-")[0]}function vd(t){return t.split("-")[1]}function gb(t){return t==="x"?"y":"x"}function vb(t){return t==="y"?"height":"width"}function Hi(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function yb(t){return gb(Hi(t))}function EK(t,e,n){n===void 0&&(n=!1);const r=vd(t),s=yb(t),i=vb(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=ug(o)),[o,ug(o)]}function CK(t){const e=ug(t);return[hx(t),e,hx(e)]}function hx(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const bC=["left","right"],SC=["right","left"],PK=["top","bottom"],RK=["bottom","top"];function AK(t,e,n){switch(t){case"top":case"bottom":return n?e?SC:bC:e?bC:SC;case"left":case"right":return e?PK:RK;default:return[]}}function TK(t,e,n,r){const s=vd(t);let i=AK(Ga(t),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(hx)))),i}function ug(t){const e=Ga(t);return kK[e]+t.slice(e.length)}function IK(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 QI(t){return typeof t!="number"?IK(t):{top:t,right:t,bottom:t,left:t}}function dg(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 kC(t,e,n){let{reference:r,floating:s}=t;const i=Hi(e),o=yb(e),l=vb(o),u=Ga(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 x=vd(e);return x&&(v[o]+=g*(x==="end"?1:-1)*(n&&d?-1:1)),v}async function MK(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}=Vo(e,t),x=QI(v),w=l[g?p==="floating"?"reference":"floating":p],b=dg(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(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=dg(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:E,offsetParent:C,strategy:u}):E);return{top:(b.top-A.top+x.top)/R.y,bottom:(A.bottom-b.bottom+x.bottom)/R.y,left:(b.left-A.left+x.left)/R.x,right:(A.right-b.right+x.right)/R.x}}const OK=50,LK=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:MK},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}=kC(d,r,u),g=r,v=0;const x={};for(let _=0;_<i.length;_++){const w=i[_];if(!w)continue;const{name:b,fn:E}=w,{x:C,y:R,data:A,reset:O}=await E({x:f,y:p,initialPlacement:r,placement:g,strategy:s,middlewareData:x,rects:d,platform:l,elements:{reference:t,floating:e}});f=C??f,p=R??p,x[b]={...x[b],...A},O&&v<OK&&(v++,typeof O=="object"&&(O.placement&&(g=O.placement),O.rects&&(d=O.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:s}):O.rects),{x:f,y:p}=kC(d,g,u)),_=-1)}return{x:f,y:p,placement:g,strategy:s,middlewareData:x}},NK=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}=Vo(t,e)||{};if(d==null)return{};const p=QI(f),g={x:n,y:r},v=yb(s),x=vb(v),_=await o.getDimensions(d),w=v==="y",b=w?"top":"left",E=w?"bottom":"right",C=w?"clientHeight":"clientWidth",R=i.reference[x]+i.reference[v]-g[v]-i.floating[x],A=g[v]-i.reference[v],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let I=O?O[C]:0;(!I||!await(o.isElement==null?void 0:o.isElement(O)))&&(I=l.floating[C]||i.floating[x]);const T=R/2-A/2,M=I/2-_[x]/2-1,N=qa(p[b],M),j=qa(p[E],M),$=I-_[x]-j,K=I/2-_[x]/2+T,B=XI(N,K,$),z=!u.arrow&&vd(s)!=null&&K!==B&&i.reference[x]/2-(K<N?N:j)-_[x]/2<0,Z=z?K<N?K-N:K-$:0;return{[v]:g[v]+Z,data:{[v]:B,centerOffset:K-B-Z,...z&&{alignmentOffset:Z}},reset:z}}}),DK=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:x="none",flipAlignment:_=!0,...w}=Vo(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=Ga(s),E=Hi(l),C=Ga(l)===l,R=await(u.isRTL==null?void 0:u.isRTL(d.floating)),A=g||(C||!_?[ug(l)]:CK(l)),O=x!=="none";!g&&O&&A.push(...TK(l,_,x,R));const I=[l,...A],T=await u.detectOverflow(e,w),M=[];let N=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&M.push(T[b]),p){const B=EK(s,o,R);M.push(T[B[0]],T[B[1]])}if(N=[...N,{placement:s,overflows:M}],!M.every(B=>B<=0)){var j,$;const B=(((j=i.flip)==null?void 0:j.index)||0)+1,z=I[B];if(z&&(!(p==="alignment"?E!==Hi(z):!1)||N.every(U=>Hi(U.placement)===E?U.overflows[0]>0:!0)))return{data:{index:B,overflows:N},reset:{placement:z}};let Z=($=N.filter(Q=>Q.overflows[0]<=0).sort((Q,U)=>Q.overflows[1]-U.overflows[1])[0])==null?void 0:$.placement;if(!Z)switch(v){case"bestFit":{var K;const Q=(K=N.filter(U=>{if(O){const ee=Hi(U.placement);return ee===E||ee==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(ee=>ee>0).reduce((ee,W)=>ee+W,0)]).sort((U,ee)=>U[1]-ee[1])[0])==null?void 0:K[0];Q&&(Z=Q);break}case"initialPlacement":Z=l;break}if(s!==Z)return{reset:{placement:Z}}}return{}}}};function EC(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function CC(t){return SK.some(e=>t[e]>=0)}const jK=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:s="referenceHidden",...i}=Vo(t,e);switch(s){case"referenceHidden":{const o=await r.detectOverflow(e,{...i,elementContext:"reference"}),l=EC(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:CC(l)}}}case"escaped":{const o=await r.detectOverflow(e,{...i,altBoundary:!0}),l=EC(o,n.floating);return{data:{escapedOffsets:l,escaped:CC(l)}}}default:return{}}}}},JI=new Set(["left","top"]);async function $K(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=Ga(n),l=vd(n),u=Hi(n)==="y",d=JI.has(o)?-1:1,f=i&&u?-1:1,p=Vo(e,t);let{mainAxis:g,crossAxis:v,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof x=="number"&&(v=l==="end"?x*-1:x),u?{x:v*f,y:g*d}:{x:g*d,y:v*f}}const FK=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 $K(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}}}}},VK=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}=Vo(t,e),f={x:n,y:r},p=await i.detectOverflow(e,d),g=Hi(s),v=gb(g);let x=f[v],_=f[g];const w=(E,C)=>XI(C+p[E==="y"?"top":"left"],C,C-p[E==="y"?"bottom":"right"]);o&&(x=w(v,x)),l&&(_=w(g,_));const b=u.fn({...e,[v]:x,[g]:_});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[v]:o,[g]:l}}}}}},HK=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}=Vo(t,e),g={x:s,y:i},v=Hi(o),x=gb(v);let _=g[x],w=g[v];const b=Vo(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=x==="y"?"height":"width",O=l.reference[x]-l.floating[A]+E.mainAxis,I=l.reference[x]+l.reference[A]-E.mainAxis;_<O?_=O:_>I&&(_=I)}if(p){var C,R;const A=x==="y"?"width":"height",O=JI.has(Ga(o)),I=l.reference[v]-l.floating[A]+(O&&((C=u.offset)==null?void 0:C[v])||0)+(O?0:E.crossAxis),T=l.reference[v]+l.reference[A]+(O?0:((R=u.offset)==null?void 0:R[v])||0)-(O?E.crossAxis:0);w<I?w=I:w>T&&(w=T)}return{[x]:_,[v]:w}}}},zK=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:s,elements:i}=e,{apply:o=()=>{},...l}=Vo(t,e),u=await s.detectOverflow(e,l),d=Ga(n),f=vd(n),p=Hi(n)==="y",{width:g,height:v}=r.floating;let x,_;d==="top"||d==="bottom"?(x=d,_=f===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(_=d,x=f==="end"?"top":"bottom");const w=v-u.top-u.bottom,b=g-u.left-u.right,E=qa(v-u[x],w),C=qa(g-u[_],b),R=e.middlewareData.shift,A=!R;let O=E,I=C;R!=null&&R.enabled.x&&(I=b),R!=null&&R.enabled.y&&(O=w),A&&!f&&(p?I=g-2*Do(u.left,u.right):O=v-2*Do(u.top,u.bottom)),await o({...e,availableWidth:I,availableHeight:O});const T=await s.getDimensions(i.floating);return g!==T.width||v!==T.height?{reset:{rects:!0}}:{}}}};function Vg(){return typeof window<"u"}function yd(t){return eM(t)?(t.nodeName||"").toLowerCase():"#document"}function Xr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Zo(t){var e;return(e=(eM(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function eM(t){return Vg()?t instanceof Node||t instanceof Xr(t).Node:!1}function Gi(t){return Vg()?t instanceof Element||t instanceof Xr(t).Element:!1}function tl(t){return Vg()?t instanceof HTMLElement||t instanceof Xr(t).HTMLElement:!1}function PC(t){return!Vg()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Xr(t).ShadowRoot}function Hg(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=Ki(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&s!=="inline"&&s!=="contents"}function UK(t){return/^(table|td|th)$/.test(yd(t))}function zg(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const BK=/transform|translate|scale|rotate|perspective|filter/,ZK=/paint|layout|strict|content/,Tl=t=>!!t&&t!=="none";let Jy;function _b(t){const e=Gi(t)?Ki(t):t;return Tl(e.transform)||Tl(e.translate)||Tl(e.scale)||Tl(e.rotate)||Tl(e.perspective)||!xb()&&(Tl(e.backdropFilter)||Tl(e.filter))||BK.test(e.willChange||"")||ZK.test(e.contain||"")}function WK(t){let e=vc(t);for(;tl(e)&&!yh(e);){if(_b(e))return e;if(zg(e))return null;e=vc(e)}return null}function xb(){return Jy==null&&(Jy=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Jy}function yh(t){return/^(html|body|#document)$/.test(yd(t))}function Ki(t){return Xr(t).getComputedStyle(t)}function Ug(t){return Gi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function vc(t){if(yd(t)==="html")return t;const e=t.assignedSlot||t.parentNode||PC(t)&&t.host||Zo(t);return PC(e)?e.host:e}function tM(t){const e=vc(t);return yh(e)?(t.ownerDocument||t).body:tl(e)&&Hg(e)?e:tM(e)}function _h(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=tM(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),o=Xr(s);if(i){const l=px(o);return e.concat(o,o.visualViewport||[],Hg(s)?s:[],l&&n?_h(l):[])}else return e.concat(s,_h(s,[],n))}function px(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function nM(t){const e=Ki(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=tl(t),i=s?t.offsetWidth:n,o=s?t.offsetHeight:r,l=cg(n)!==i||cg(r)!==o;return l&&(n=i,r=o),{width:n,height:r,$:l}}function wb(t){return Gi(t)?t:t.contextElement}function Au(t){const e=wb(t);if(!tl(e))return jo(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=nM(e);let o=(i?cg(n.width):n.width)/r,l=(i?cg(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const qK=jo(0);function rM(t){const e=Xr(t);return!xb()||!e.visualViewport?qK:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function GK(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Xr(t)}function yc(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=wb(t);let o=jo(1);e&&(r?Gi(r)&&(o=Au(r)):o=Au(t));const l=GK(i,n,r)?rM(i):jo(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=Xr(i),v=Gi(r)?Xr(r):r;let x=g,_=px(x);for(;_&&v!==x;){const w=Au(_),b=_.getBoundingClientRect(),E=Ki(_),C=b.left+(_.clientLeft+parseFloat(E.paddingLeft))*w.x,R=b.top+(_.clientTop+parseFloat(E.paddingTop))*w.y;u*=w.x,d*=w.y,f*=w.x,p*=w.y,u+=C,d+=R,x=Xr(_),_=px(x)}}return dg({width:f,height:p,x:u,y:d})}function Bg(t,e){const n=Ug(t).scrollLeft;return e?e.left+n:yc(Zo(t)).left+n}function sM(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-Bg(t,n),s=n.top+e.scrollTop;return{x:r,y:s}}function KK(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",o=Zo(r),l=e?zg(e.floating):!1;if(r===o||l&&i)return n;let u={scrollLeft:0,scrollTop:0},d=jo(1);const f=jo(0),p=tl(r);if((p||!i)&&((yd(r)!=="body"||Hg(o))&&(u=Ug(r)),p)){const v=yc(r);d=Au(r),f.x=v.x+r.clientLeft,f.y=v.y+r.clientTop}const g=o&&!p&&!i?sM(o,u):jo(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 YK(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function XK(t){const e=Ug(t),n=t.ownerDocument.body,r=Do(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=Do(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+Bg(t);const o=-e.scrollTop;return Ki(n).direction==="rtl"&&(i+=Do(t.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:o}}const QK=25;function JK(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=Xr(t),i=Zo(t),o=s.visualViewport;let l=i.clientWidth,u=i.clientHeight,d=0,f=0;if(o){const g=!xb()||e==="fixed";r?g||(d=-o.offsetLeft,f=-o.offsetTop):(l=o.width,u=o.height,g&&(d=o.offsetLeft,f=o.offsetTop))}if(Bg(i)<=0){const g=i.ownerDocument,v=g.body,x=getComputedStyle(v),_=g.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,w=Math.abs(i.clientWidth-v.clientWidth-_),b=getComputedStyle(i).scrollbarGutter==="stable both-edges"?w/2:w;b<=QK&&(l-=b)}return{width:l,height:u,x:d,y:f}}function eY(t,e){const n=yc(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Au(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 RC(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=JK(t,n,e);else if(e==="document")r=XK(Zo(t));else if(Gi(e))r=eY(e,n);else{const s=rM(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return dg(r)}function tY(t,e){const n=e.get(t);if(n)return n;let r=_h(t,[],!1).filter(l=>Gi(l)&&yd(l)!=="body"),s=null;const i=Ki(t).position==="fixed";let o=i?vc(t):t;for(;Gi(o)&&!yh(o);){const l=Ki(o),u=_b(o),d=s?s.position:i?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&l.position==="static")?r=r.filter(p=>p!==o):s=l,o=vc(o)}return e.set(t,r),r}function nY(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const o=[...n==="clippingAncestors"?zg(e)?[]:tY(e,this._c):[].concat(n),r],l=RC(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=RC(e,o[g],s);u=Do(v.top,u),d=qa(v.right,d),f=qa(v.bottom,f),p=Do(v.left,p)}return{width:d-p,height:f-u,x:p,y:u}}function rY(t){const{width:e,height:n}=nM(t);return{width:e,height:n}}function sY(t,e,n){const r=tl(e),s=Zo(e),i=n==="fixed",o=yc(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const u=jo(0);if((r||!i)&&((yd(e)!=="body"||Hg(s))&&(l=Ug(e)),r)){const g=yc(e,!0,i,e);u.x=g.x+e.clientLeft,u.y=g.y+e.clientTop}!r&&s&&(u.x=Bg(s));const d=s&&!r&&!i?sM(s,l):jo(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 e_(t){return Ki(t).position==="static"}function AC(t,e){if(!tl(t)||Ki(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Zo(t)===n&&(n=n.ownerDocument.body),n}function iM(t,e){const n=Xr(t);if(zg(t))return n;if(!tl(t)){let s=vc(t);for(;s&&!yh(s);){if(Gi(s)&&!e_(s))return s;s=vc(s)}return n}let r=AC(t,e);for(;r&&UK(r)&&e_(r);)r=AC(r,e);return r&&yh(r)&&e_(r)&&!_b(r)?n:r||WK(t)||n}const iY=async function(t){const e=this.getOffsetParent||iM,n=this.getDimensions,r=await n(t.floating);return{reference:sY(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function oY(t){return Ki(t).direction==="rtl"}const aY={convertOffsetParentRelativeRectToViewportRelativeRect:KK,getDocumentElement:Zo,getClippingRect:nY,getOffsetParent:iM,getElementRects:iY,getClientRects:YK,getDimensions:rY,getScale:Au,isElement:Gi,isRTL:oY};function oM(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function lY(t,e,n){let r=null,s;const i=Zo(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:x,width:_,height:w}=g;if(f||e(),!_||!w)return;const b=A0(x),E=A0(i.clientWidth-(v+_)),C=A0(i.clientHeight-(x+w)),R=A0(v),O={rootMargin:-b+"px "+-E+"px "+-C+"px "+-R+"px",threshold:Do(0,qa(1,p))||1};let I=!0;function T(M){const N=M[0].intersectionRatio;if(!oM(g,t.getBoundingClientRect()))return l();if(N!==p){if(!I)return l();N?l(!1,N):s=setTimeout(()=>{l(!1,1e-7)},1e3)}I=!1}try{r=new IntersectionObserver(T,{...O,root:i.ownerDocument})}catch{r=new IntersectionObserver(T,O)}r.observe(t)}const u=Xr(t),d=()=>l(n);return u.addEventListener("resize",d),l(!0),()=>{u.removeEventListener("resize",d),o()}}function cY(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=wb(t),f=s||i?[...d?_h(d):[],...e?_h(e):[]]:[];f.forEach(b=>{s&&b.addEventListener("scroll",n),i&&b.addEventListener("resize",n)});const p=d&&l?lY(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 x,_=u?yc(t):null;u&&w();function w(){const b=yc(t);_&&!oM(_,b)&&n(),_=b,x=requestAnimationFrame(w)}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(x)}}const uY=FK,dY=VK,fY=DK,hY=zK,pY=jK,TC=NK,mY=HK,gY=(t,e,n)=>{const r=new Map,s=n??{},i={...aY,...s.platform,_c:r};return LK(t,e,{...s,platform:i})};var vY=typeof document<"u",yY=function(){},om=vY?m.useLayoutEffect:yY;function fg(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(!fg(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)&&!fg(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function aM(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function IC(t,e){const n=aM(t);return Math.round(e*n)/n}function t_(t){const e=m.useRef(t);return om(()=>{e.current=t}),e}function _Y(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);fg(g,r)||v(r);const[x,_]=m.useState(null),[w,b]=m.useState(null),E=m.useCallback(U=>{U!==O.current&&(O.current=U,_(U))},[]),C=m.useCallback(U=>{U!==I.current&&(I.current=U,b(U))},[]),R=i||x,A=o||w,O=m.useRef(null),I=m.useRef(null),T=m.useRef(f),M=u!=null,N=t_(u),j=t_(s),$=t_(d),K=m.useCallback(()=>{if(!O.current||!I.current)return;const U={placement:e,strategy:n,middleware:g};j.current&&(U.platform=j.current),gY(O.current,I.current,U).then(ee=>{const W={...ee,isPositioned:$.current!==!1};B.current&&!fg(T.current,W)&&(T.current=W,Gh.flushSync(()=>{p(W)}))})},[g,e,n,j,$]);om(()=>{d===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,p(U=>({...U,isPositioned:!1})))},[d]);const B=m.useRef(!1);om(()=>(B.current=!0,()=>{B.current=!1}),[]),om(()=>{if(R&&(O.current=R),A&&(I.current=A),R&&A){if(N.current)return N.current(R,A,K);K()}},[R,A,K,N,M]);const z=m.useMemo(()=>({reference:O,floating:I,setReference:E,setFloating:C}),[E,C]),Z=m.useMemo(()=>({reference:R,floating:A}),[R,A]),Q=m.useMemo(()=>{const U={position:n,left:0,top:0};if(!Z.floating)return U;const ee=IC(Z.floating,f.x),W=IC(Z.floating,f.y);return l?{...U,transform:"translate("+ee+"px, "+W+"px)",...aM(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:K,refs:z,elements:Z,floatingStyles:Q}),[f,K,z,Z,Q])}const xY=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?TC({element:r.current,padding:s}).fn(n):{}:r?TC({element:r,padding:s}).fn(n):{}}}},wY=(t,e)=>{const n=uY(t);return{name:n.name,fn:n.fn,options:[t,e]}},bY=(t,e)=>{const n=dY(t);return{name:n.name,fn:n.fn,options:[t,e]}},SY=(t,e)=>({fn:mY(t).fn,options:[t,e]}),kY=(t,e)=>{const n=fY(t);return{name:n.name,fn:n.fn,options:[t,e]}},EY=(t,e)=>{const n=hY(t);return{name:n.name,fn:n.fn,options:[t,e]}},CY=(t,e)=>{const n=pY(t);return{name:n.name,fn:n.fn,options:[t,e]}},PY=(t,e)=>{const n=xY(t);return{name:n.name,fn:n.fn,options:[t,e]}};var RY=Object.defineProperty,AY=(t,e)=>RY(t,"name",{value:e,configurable:!0});function bb(t){const[e,n]=m.useState(void 0);return Yr(()=>{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}AY(bb,"useSize");var TY=Object.defineProperty,$a=(t,e)=>TY(t,"name",{value:e,configurable:!0}),lM="Popper",[cM,Zg]=Qi(lM),[IY,uM]=cM(lM),MY=$a(t=>{const{__scopePopper:e,children:n}=t,[r,s]=m.useState(null),[i,o]=m.useState(void 0);return S.jsx(IY,{scope:e,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:o,children:n})},"Popper"),OY="PopperAnchor",LY=m.forwardRef($a(function(e,n){const{__scopePopper:r,virtualRef:s,...i}=e,o=uM(OY,r),l=m.useRef(null),u=o.onAnchorChange,d=m.useCallback(_=>{l.current=_,_&&u(_)},[u]),f=en(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&&Wg(o.placementState),v=g==null?void 0:g[0],x=g==null?void 0:g[1];return s?null:S.jsx(kn.div,{"data-radix-popper-side":v,"data-radix-popper-align":x,...i,ref:f})},"PopperAnchor")),dM="PopperContent",[NY,roe]=cM(dM),DY=m.forwardRef($a(function(e,n){var ae,Oe,ke,Ge,vt,Mt,Xt;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:x="optimized",onPlaced:_,...w}=e,b=uM(dM,r),[E,C]=m.useState(null),R=en(n,C),[A,O]=m.useState(null),I=bb(A),T=(I==null?void 0:I.width)??0,M=(I==null?void 0:I.height)??0,N=s+(o!=="center"?"-"+o:""),j=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},$=Array.isArray(f)?f:[f],K=$.length>0,B={padding:j,boundary:$.filter(fM),altBoundary:K},{refs:z,floatingStyles:Z,placement:Q,isPositioned:U,middlewareData:ee}=_Y({strategy:"fixed",placement:N,whileElementsMounted:$a((...xt)=>cY(...xt,{animationFrame:x==="always"}),"whileElementsMounted"),elements:{reference:b.anchor},middleware:[wY({mainAxis:i+M,alignmentAxis:l}),d&&bY({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?SY():void 0,...B}),d&&kY({...B}),EY({...B,apply:$a(({elements:xt,rects:yt,availableWidth:We,availableHeight:Ke})=>{const{width:St,height:Re}=yt.reference,Ye=xt.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}),jY({arrowWidth:T,arrowHeight:M}),v&&CY({strategy:"referenceHidden",...B,boundary:K?B.boundary:void 0})]}),W=b.setPlacementState;Yr(()=>(W(Q),()=>{W(void 0)}),[Q,W]);const[D,X]=Wg(Q),oe=gc(_);Yr(()=>{U&&(oe==null||oe())},[U,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 Yr(()=>{E&&de(window.getComputedStyle(E).zIndex)},[E]),S.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:U?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(" "),...((Mt=ee.hide)==null?void 0:Mt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:S.jsx(NY,{scope:r,placedSide:D,placedAlign:X,onArrowChange:O,arrowX:re,arrowY:se,shouldHideArrow:fe,children:S.jsx(kn.div,{"data-side":D,"data-align":X,...w,ref:R,style:{...w.style,animation:U?(Xt=w.style)==null?void 0:Xt.animation:"none"}})})})},"PopperContent"));function fM(t){return t!==null}$a(fM,"isNotNull");var jY=$a(t=>({name:"transformOrigin",options:t,fn(e){var w,b,E;const{placement:n,rects:r,middlewareData:s}=e,o=((w=s.arrow)==null?void 0:w.centerOffset)!==0,l=o?0:t.arrowWidth,u=o?0:t.arrowHeight,[d,f]=Wg(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 x="",_="";return d==="bottom"?(x=o?p:`${g}px`,_=`${-u}px`):d==="top"?(x=o?p:`${g}px`,_=`${r.floating.height+u}px`):d==="right"?(x=`${-u}px`,_=o?p:`${v}px`):d==="left"&&(x=`${r.floating.width+u}px`,_=o?p:`${v}px`),{data:{x,y:_}}}}),"transformOrigin");function Wg(t){const[e,n="center"]=t.split("-");return[e,n]}$a(Wg,"getSideAndAlignFromPlacement");var hM=MY,pM=LY,mM=DY,$Y=Object.defineProperty,FY=(t,e)=>$Y(t,"name",{value:e,configurable:!0}),Sb=m.forwardRef(FY(function(e,n){var u;const{container:r,...s}=e,[i,o]=m.useState(!1);Yr(()=>o(!0),[]);const l=r||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?Gh.createPortal(S.jsx(kn.div,{...s,ref:n}),l):null},"Portal")),VY=Object.defineProperty,Ho=(t,e)=>VY(t,"name",{value:e,configurable:!0});function gM(t,e){return m.useReducer((n,r)=>e[n][r]??n,t)}Ho(gM,"useStateMachine");var nl=Ho(t=>{const{present:e,children:n}=t,r=vM(e),s=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=yM(r.ref,_M(s));return typeof n=="function"||r.isPresent?m.cloneElement(s,{ref:i}):null},"Presence");function vM(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]=gM(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??gu(r.current),o.current=void 0):i.current="none"},[u]),Yr(()=>{const f=r.current,p=s.current;if(p!==t){const v=i.current,x=gu(f);t?(o.current=x,d("MOUNT")):x==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(p&&v!==x?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,d]),Yr(()=>{if(e){let f;const p=e.ownerDocument.defaultView??window,g=Ho(x=>{const w=gu(r.current).includes(CSS.escape(x.animationName));if(x.target===e&&w&&(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=Ho(x=>{x.target===e&&(i.current=gu(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=gu(p)}else r.current=null;n(f)},[])}}Ho(vM,"usePresence");function mx(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Ho(mx,"setRef");function yM(...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=mx(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():mx(r[o],null)}}},[])}Ho(yM,"useStableComposedRefs");function gu(t){return(t==null?void 0:t.animationName)||"none"}Ho(gu,"getAnimationName");function _M(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)}Ho(_M,"getElementRef");var HY=Object.defineProperty,zY=(t,e)=>HY(t,"name",{value:e,configurable:!0}),MC=Vh[" useEffectEvent ".trim().toString()],OC=Vh[" useInsertionEffect ".trim().toString()];function xM(t){if(typeof MC=="function")return MC(t);const e=m.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof OC=="function"?OC(()=>{e.current=t}):Yr(()=>{e.current=t}),m.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}zY(xM,"useEffectEvent");var UY=Object.defineProperty,Yh=(t,e)=>UY(t,"name",{value:e,configurable:!0}),BY=Vh[" useInsertionEffect ".trim().toString()]||Yr;function rl({prop:t,defaultProp:e,onChange:n=Yh(()=>{},"onChange"),caller:r}){const[s,i,o]=wM({defaultProp:e,onChange:n}),l=t!==void 0,u=l?t:s,d=m.useCallback(f=>{var p;if(l){const g=bM(f)?f(t):f;g!==t&&((p=o.current)==null||p.call(o,g))}else i(f)},[l,t,i,o]);return[u,d]}Yh(rl,"useControllableState");function wM({defaultProp:t,onChange:e}){const[n,r]=m.useState(t),s=m.useRef(n),i=m.useRef(e);return BY(()=>{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]}Yh(wM,"useUncontrolledState");function bM(t){return typeof t=="function"}Yh(bM,"isFunction");var LC=Symbol("RADIX:SYNC_STATE");function ZY(t,e,n,r){const{prop:s,defaultProp:i,onChange:o,caller:l}=e,u=s!==void 0,d=xM(o),f=[{...n,state:i}];r&&f.push(r);const[p,g]=m.useReducer((w,b)=>{if(b.type===LC)return{...w,state:b.state};const E=t(w,b);return u&&!Object.is(E.state,w.state)&&d(E.state),E},...f),v=p.state,x=m.useRef(v);m.useEffect(()=>{x.current!==v&&(x.current=v,u||d(v))},[v,x,u]);const _=m.useMemo(()=>s!==void 0?{...p,state:s}:p,[p,s]);return m.useEffect(()=>{u&&!Object.is(s,p.state)&&g({type:LC,state:s})},[s,p.state,u]),[_,g]}Yh(ZY,"useControllableStateReducer");var WY=Object.defineProperty,qY=(t,e)=>WY(t,"name",{value:e,configurable:!0}),GY=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"}),KY=m.forwardRef(qY(function(e,n){return S.jsx(kn.span,{...e,ref:n,style:{...GY,...e.style}})},"VisuallyHidden")),YY=KY,XY=Object.defineProperty,ir=(t,e)=>XY(t,"name",{value:e,configurable:!0}),[kb,soe]=Qi("Tooltip",[Zg]),Eb=Zg(),QY="TooltipProvider",JY=700,gx="tooltip.open",[eX,Cb]=kb(QY),tX=ir(t=>{const{__scopeTooltip:e,delayDuration:n=JY,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(eX,{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"),vx="Tooltip",[nX,Xh]=kb(vx),rX=ir(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=t,u=Cb(vx,t.__scopeTooltip),d=Eb(e),[f,p]=m.useState(null),[g,v]=m.useState(void 0),x=ja(),_=m.useRef(0),w=o??u.disableHoverableContent,b=l??u.delayDuration,E=m.useRef(!1),[C,R]=rl({prop:r,defaultProp:s??!1,onChange:ir(N=>{N?(u.onOpen(),document.dispatchEvent(new CustomEvent(gx))):u.onClose(),i==null||i(N)},"onChange"),caller:vx}),A=m.useMemo(()=>C?E.current?"delayed-open":"instant-open":"closed",[C]),O=m.useCallback(()=>{window.clearTimeout(_.current),_.current=0,E.current=!1,R(!0)},[R]),I=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 M=g??x;return S.jsx(hM,{...d,children:S.jsx(nX,{scope:e,contentId:M,setContentId:v,open:C,stateAttribute:A,trigger:f,onTriggerChange:p,onTriggerEnter:m.useCallback(()=>{u.isOpenDelayedRef.current?T():O()},[u.isOpenDelayedRef,T,O]),onTriggerLeave:m.useCallback(()=>{w?I():(window.clearTimeout(_.current),_.current=0)},[I,w]),onOpen:O,onClose:I,disableHoverableContent:w,children:n})})},"Tooltip"),NC="TooltipTrigger",sX=m.forwardRef(ir(function(e,n){const{__scopeTooltip:r,...s}=e,i=Xh(NC,r),o=Cb(NC,r),l=Eb(r),u=m.useRef(null),d=en(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(pM,{asChild:!0,...l,children:S.jsx(kn.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...s,ref:d,onPointerMove:Gt(e.onPointerMove,v=>{v.pointerType!=="touch"&&!p.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:Gt(e.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:Gt(e.onPointerDown,()=>{i.open&&i.onClose(),f.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Gt(e.onFocus,()=>{f.current||i.onOpen()}),onBlur:Gt(e.onBlur,i.onClose),onClick:Gt(e.onClick,i.onClose)})})},"TooltipTrigger")),SM="TooltipPortal",[iX,oX]=kb(SM,{forceMount:void 0}),aX=ir(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=Xh(SM,e);return S.jsx(iX,{scope:e,forceMount:n,children:S.jsx(nl,{present:n||i.open,children:S.jsx(Sb,{asChild:!0,container:s,children:r})})})},"TooltipPortal"),xh="TooltipContent",lX=m.forwardRef(ir(function(e,n){const r=oX(xh,e.__scopeTooltip),{forceMount:s=r.forceMount,side:i="top",...o}=e,l=Xh(xh,e.__scopeTooltip);return S.jsx(nl,{present:s||l.open,children:l.disableHoverableContent?S.jsx(kM,{side:i,...o,ref:n}):S.jsx(cX,{side:i,...o,ref:n})})},"TooltipContent")),cX=m.forwardRef(ir(function(e,n){const r=Xh(xh,e.__scopeTooltip),s=Cb(xh,e.__scopeTooltip),i=m.useRef(null),o=en(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]),x=m.useCallback((_,w)=>{const b=_.currentTarget,E={x:_.clientX,y:_.clientY},C=EM(E,b.getBoundingClientRect()),R=CM(E,C),A=PM(w.getBoundingClientRect()),O=AM([...R,...A]);u(O),g(!0)},[g]);return m.useEffect(()=>()=>v(),[v]),m.useEffect(()=>{if(d&&p){const _=ir(b=>x(b,p),"handleTriggerLeave"),w=ir(b=>x(b,d),"handleContentLeave");return d.addEventListener("pointerleave",_),p.addEventListener("pointerleave",w),()=>{d.removeEventListener("pointerleave",_),p.removeEventListener("pointerleave",w)}}},[d,p,x,v]),m.useEffect(()=>{if(l){const _=ir(w=>{const b=w.target,E={x:w.clientX,y:w.clientY},C=(d==null?void 0:d.contains(b))||(p==null?void 0:p.contains(b)),R=!RM(E,l);C?v():R&&(v(),f())},"handleTrackPointerGrace");return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[d,p,l,f,v]),S.jsx(kM,{...e,ref:o})},"TooltipContentHoverable")),uX=HI("TooltipContent"),kM=m.forwardRef(ir(function(e,n){const{__scopeTooltip:r,children:s,"aria-label":i,id:o,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,f=Xh(xh,r),p=Eb(r),{onClose:g}=f;m.useEffect(()=>(document.addEventListener(gx,g),()=>document.removeEventListener(gx,g)),[g]),m.useEffect(()=>{if(f.trigger){const x=ir(_=>{_.target instanceof Node&&_.target.contains(f.trigger)&&g()},"handleScroll");return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[f.trigger,g]);const{setContentId:v}=f;return Yr(()=>(v(o),()=>{v(void 0)}),[o,v]),S.jsx(pb,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:x=>x.preventDefault(),onDismiss:g,children:S.jsxs(mM,{"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(uX,{children:s}),i?S.jsx(YY,{id:f.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl"));function EM(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")}}ir(EM,"getExitSideFromRect");function CM(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}ir(CM,"getPaddedExitPoints");function PM(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}]}ir(PM,"getPointsFromRect");function RM(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}ir(RM,"isPointInPolygon");function AM(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),TM(e)}ir(AM,"getHull");function TM(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)}ir(TM,"getHullPresorted");var dX=tX,fX=rX,hX=sX,pX=aX,mX=lX;const qf={normal:"'wght' 400",medium:"'wght' 450",semibold:"'wght' 550"},IM=m.createContext(null);function MM({value:t,children:e}){return S.jsx(IM.Provider,{value:t,children:e})}function gX(t){switch(t){case"top":return{y:4};case"bottom":return{y:-4};case"left":return{x:4};case"right":return{x:-4}}}function Pb({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=Kh(),x=m.useContext(IM);m.useEffect(()=>{f&&g(!0)},[f]);const _=()=>{f||g(!1)},w=gX(n);return S.jsx(dX,{delayDuration:s,children:S.jsxs(fX,{open:f,onOpenChange:b=>{d(b),l==null||l(b)},children:[S.jsx(hX,{asChild:!0,children:e}),p&&S.jsx(pX,{forceMount:!0,container:x??void 0,children:S.jsx(mX,{side:n,sideOffset:r,forceMount:!0,className:"z-tooltip",children:S.jsx(Lo.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:qf.medium},initial:{opacity:0,scale:.8,...w},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 Zi=m.forwardRef(({title:t,shortcut:e,...n},r)=>{const s=S.jsx(LI,{ref:r,...n});return t?S.jsx(Pb,{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});Zi.displayName="Button";var vX=Object.defineProperty,jr=(t,e)=>vX(t,"name",{value:e,configurable:!0}),n_="focusScope.autoFocusOnMount",r_="focusScope.autoFocusOnUnmount",DC={bubbles:!1,cancelable:!0},OM=m.forwardRef(jr(function(e,n){const{loop:r=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[u,d]=m.useState(null),f=gc(i),p=gc(o),g=m.useRef(null),v=en(n,d),x=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(s){let w=function(R){if(x.paused||!u)return;const A=R.target;u.contains(A)?g.current=A:ko(g.current,{select:!0})},b=function(R){if(x.paused||!u)return;const A=R.relatedTarget;A!==null&&(u.contains(A)||ko(g.current,{select:!0}))},E=function(R){if(document.activeElement===document.body)for(const O of R)O.removedNodes.length>0&&ko(u)};jr(w,"handleFocusIn"),jr(b,"handleFocusOut"),jr(E,"handleMutations"),document.addEventListener("focusin",w),document.addEventListener("focusout",b);const C=new MutationObserver(E);return u&&C.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",b),C.disconnect()}}},[s,u,x.paused]),m.useEffect(()=>{if(u){jC.add(x);const w=document.activeElement;if(!u.contains(w)){const E=new CustomEvent(n_,DC);u.addEventListener(n_,f),u.dispatchEvent(E),E.defaultPrevented||(LM(FM(Rb(u)),{select:!0}),document.activeElement===w&&ko(u))}return()=>{u.removeEventListener(n_,f),setTimeout(()=>{const E=new CustomEvent(r_,DC);u.addEventListener(r_,p),u.dispatchEvent(E),E.defaultPrevented||ko(w??document.body,{select:!0}),u.removeEventListener(r_,p),jC.remove(x)},0)}}},[u,f,p,x]);const _=m.useCallback(w=>{if(!r&&!s||x.paused)return;const b=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,E=document.activeElement;if(b&&E){const C=w.currentTarget,[R,A]=NM(C);R&&A?!w.shiftKey&&E===A?(w.preventDefault(),r&&ko(R,{select:!0})):w.shiftKey&&E===R&&(w.preventDefault(),r&&ko(A,{select:!0})):E===C&&w.preventDefault()}},[r,s,x.paused]);return S.jsx(kn.div,{tabIndex:-1,...l,ref:v,onKeyDown:_})},"FocusScope"));function LM(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(ko(r,{select:e}),document.activeElement!==n)return}jr(LM,"focusFirst");function NM(t){const e=Rb(t),n=yx(e,t),r=yx(e.reverse(),t);return[n,r]}jr(NM,"getTabbableEdges");function Rb(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:jr(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}jr(Rb,"getTabbableCandidates");function yx(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):DM(r,{upTo:e})))return r}jr(yx,"findVisible");function DM(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}jr(DM,"isHidden");function jM(t){return t instanceof HTMLInputElement&&"select"in t}jr(jM,"isSelectableInput");function ko(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&jM(t)&&e&&t.select()}}jr(ko,"focus");var jC=$M();function $M(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=_x(t,e),t.unshift(e)},remove(e){var n;t=_x(t,e),(n=t[0])==null||n.resume()}}}jr($M,"createFocusScopesStack");function _x(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}jr(_x,"arrayRemove");function FM(t){return t.filter(e=>e.tagName!=="A")}jr(FM,"removeLinks");var yX=Object.defineProperty,Ab=(t,e)=>yX(t,"name",{value:e,configurable:!0}),T0=0,Ri=null;function _X(t){return qg(),t.children}Ab(_X,"FocusGuards");function qg(){m.useEffect(()=>{Ri||(Ri={start:xx(),end:xx()});const{start:t,end:e}=Ri;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),T0++,()=>{T0===1&&(Ri==null||Ri.start.remove(),Ri==null||Ri.end.remove(),Ri=null),T0=Math.max(0,T0-1)}},[])}Ab(qg,"useFocusGuards");function xx(){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}Ab(xx,"createFocusGuard");var $i=function(){return $i=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},$i.apply(this,arguments)};function VM(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 xX(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 am="right-scroll-bar-position",lm="width-before-scroll-bar",wX="with-scroll-bars-hidden",bX="--removed-body-scroll-bar-size";function s_(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function SX(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 kX=typeof window<"u"?m.useLayoutEffect:m.useEffect,$C=new WeakMap;function EX(t,e){var n=SX(null,function(r){return t.forEach(function(s){return s_(s,r)})});return kX(function(){var r=$C.get(n);if(r){var s=new Set(r),i=new Set(t),o=n.current;s.forEach(function(l){i.has(l)||s_(l,null)}),i.forEach(function(l){s.has(l)||s_(l,o)})}$C.set(n,t)},[t]),n}function CX(t){return t}function PX(t,e){e===void 0&&(e=CX);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 RX(t){t===void 0&&(t={});var e=PX(null);return e.options=$i({async:!0,ssr:!1},t),e}var HM=function(t){var e=t.sideCar,n=VM(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,$i({},n))};HM.isSideCarExport=!0;function AX(t,e){return t.useMedium(e),HM}var zM=RX(),i_=function(){},Gg=m.forwardRef(function(t,e){var n=m.useRef(null),r=m.useState({onScrollCapture:i_,onWheelCapture:i_,onTouchMoveCapture:i_}),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,x=t.noIsolation,_=t.inert,w=t.allowPinchZoom,b=t.as,E=b===void 0?"div":b,C=t.gapMode,R=VM(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=g,O=EX([n,e]),I=$i($i({},R),s);return m.createElement(m.Fragment,null,f&&m.createElement(A,{sideCar:zM,removeScrollBar:d,shards:p,noRelative:v,noIsolation:x,inert:_,setCallbacks:i,allowPinchZoom:!!w,lockRef:n,gapMode:C}),o?m.cloneElement(m.Children.only(l),$i($i({},I),{ref:O})):m.createElement(E,$i({},I,{className:u,ref:O}),l))});Gg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Gg.classNames={fullWidth:lm,zeroRight:am};var TX=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function IX(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=TX();return e&&t.setAttribute("nonce",e),t}function MX(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function OX(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var LX=function(){var t=0,e=null;return{add:function(n){t==0&&(e=IX())&&(MX(e,n),OX(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},NX=function(){var t=LX();return function(e,n){m.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},UM=function(){var t=NX(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},DX={left:0,top:0,right:0,gap:0},o_=function(t){return parseInt(t||"",10)||0},jX=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[o_(n),o_(r),o_(s)]},$X=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return DX;var e=jX(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])}},FX=UM(),Tu="data-scroll-locked",VX=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(wX,` {
|
|
73
|
+
overflow: hidden `).concat(r,`;
|
|
74
|
+
padding-right: `).concat(l,"px ").concat(r,`;
|
|
75
|
+
}
|
|
76
|
+
body[`).concat(Tu,`] {
|
|
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(am,` {
|
|
90
|
+
right: `).concat(l,"px ").concat(r,`;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.`).concat(lm,` {
|
|
94
|
+
margin-right: `).concat(l,"px ").concat(r,`;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.`).concat(am," .").concat(am,` {
|
|
98
|
+
right: 0 `).concat(r,`;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.`).concat(lm," .").concat(lm,` {
|
|
102
|
+
margin-right: 0 `).concat(r,`;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
body[`).concat(Tu,`] {
|
|
106
|
+
`).concat(bX,": ").concat(l,`px;
|
|
107
|
+
}
|
|
108
|
+
`)},FC=function(){var t=parseInt(document.body.getAttribute(Tu)||"0",10);return isFinite(t)?t:0},HX=function(){m.useEffect(function(){return document.body.setAttribute(Tu,(FC()+1).toString()),function(){var t=FC()-1;t<=0?document.body.removeAttribute(Tu):document.body.setAttribute(Tu,t.toString())}},[])},zX=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;HX();var i=m.useMemo(function(){return $X(s)},[s]);return m.createElement(FX,{styles:VX(i,!e,s,n?"":"!important")})},wx=!1;if(typeof window<"u")try{var I0=Object.defineProperty({},"passive",{get:function(){return wx=!0,!0}});window.addEventListener("test",I0,I0),window.removeEventListener("test",I0,I0)}catch{wx=!1}var lu=wx?{passive:!1}:!1,UX=function(t){return t.tagName==="TEXTAREA"},BM=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!UX(t)&&n[e]==="visible")},BX=function(t){return BM(t,"overflowY")},ZX=function(t){return BM(t,"overflowX")},VC=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=ZM(t,r);if(s){var i=WM(t,r),o=i[1],l=i[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},WX=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},qX=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},ZM=function(t,e){return t==="v"?BX(e):ZX(e)},WM=function(t,e){return t==="v"?WX(e):qX(e)},GX=function(t,e){return t==="h"&&e==="rtl"?-1:1},KX=function(t,e,n,r,s){var i=GX(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=WM(t,l),x=v[0],_=v[1],w=v[2],b=_-w-i*x;(x||b)&&ZM(t,l)&&(p+=b,g+=x);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},M0=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},HC=function(t){return[t.deltaX,t.deltaY]},zC=function(t){return t&&"current"in t?t.current:t},YX=function(t,e){return t[0]===e[0]&&t[1]===e[1]},XX=function(t){return`
|
|
109
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
110
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
111
|
+
`)},QX=0,cu=[];function JX(t){var e=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState(QX++)[0],i=m.useState(UM)[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 _=xX([t.lockRef.current],(t.shards||[]).map(zC),!0).filter(Boolean);return _.forEach(function(w){return w.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),_.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var l=m.useCallback(function(_,w){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!o.current.allowPinchZoom;var b=M0(_),E=n.current,C="deltaX"in _?_.deltaX:E[0]-b[0],R="deltaY"in _?_.deltaY:E[1]-b[1],A,O=_.target,I=Math.abs(C)>Math.abs(R)?"h":"v";if("touches"in _&&I==="h"&&O.type==="range")return!1;var T=window.getSelection(),M=T&&T.anchorNode,N=M?M===O||M.contains(O):!1;if(N)return!1;var j=VC(I,O);if(!j)return!0;if(j?A=I:(A=I==="v"?"h":"v",j=VC(I,O)),!j)return!1;if(!r.current&&"changedTouches"in _&&(C||R)&&(r.current=A),!A)return!0;var $=r.current||A;return KX($,w,_,$==="h"?C:R)},[]),u=m.useCallback(function(_){var w=_;if(!(!cu.length||cu[cu.length-1]!==i)){var b="deltaY"in w?HC(w):M0(w),E=e.current.filter(function(A){return A.name===w.type&&(A.target===w.target||w.target===A.shadowParent)&&YX(A.delta,b)})[0];if(E&&E.should){w.cancelable&&w.preventDefault();return}if(!E){var C=(o.current.shards||[]).map(zC).filter(Boolean).filter(function(A){return A.contains(w.target)}),R=C.length>0?l(w,C[0]):!o.current.noIsolation;R&&w.cancelable&&w.preventDefault()}}},[]),d=m.useCallback(function(_,w,b,E){var C={name:_,delta:w,target:b,should:E,shadowParent:eQ(b)};e.current.push(C),setTimeout(function(){e.current=e.current.filter(function(R){return R!==C})},1)},[]),f=m.useCallback(function(_){n.current=M0(_),r.current=void 0},[]),p=m.useCallback(function(_){d(_.type,HC(_),_.target,l(_,t.lockRef.current))},[]),g=m.useCallback(function(_){d(_.type,M0(_),_.target,l(_,t.lockRef.current))},[]);m.useEffect(function(){return cu.push(i),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",u,lu),document.addEventListener("touchmove",u,lu),document.addEventListener("touchstart",f,lu),function(){cu=cu.filter(function(_){return _!==i}),document.removeEventListener("wheel",u,lu),document.removeEventListener("touchmove",u,lu),document.removeEventListener("touchstart",f,lu)}},[]);var v=t.removeScrollBar,x=t.inert;return m.createElement(m.Fragment,null,x?m.createElement(i,{styles:XX(s)}):null,v?m.createElement(zX,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function eQ(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const tQ=AX(zM,JX);var Tb=m.forwardRef(function(t,e){return m.createElement(Gg,$i({},t,{ref:e,sideCar:tQ}))});Tb.classNames=Gg.classNames;var nQ=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},uu=new WeakMap,O0=new WeakMap,L0={},a_=0,qM=function(t){return t&&(t.host||qM(t.parentNode))},rQ=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=qM(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})},sQ=function(t,e,n,r){var s=rQ(e,Array.isArray(t)?t:[t]);L0[n]||(L0[n]=new WeakMap);var i=L0[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),x=v!==null&&v!=="false",_=(uu.get(g)||0)+1,w=(i.get(g)||0)+1;uu.set(g,_),i.set(g,w),o.push(g),_===1&&x&&O0.set(g,!0),w===1&&g.setAttribute(n,"true"),x||g.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",g,b)}})};return f(e),l.clear(),a_++,function(){o.forEach(function(p){var g=uu.get(p)-1,v=i.get(p)-1;uu.set(p,g),i.set(p,v),g||(O0.has(p)||p.removeAttribute(r),O0.delete(p)),v||p.removeAttribute(n)}),a_--,a_||(uu=new WeakMap,uu=new WeakMap,O0=new WeakMap,L0={})}},GM=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=nQ(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),sQ(r,s,n,"aria-hidden")):function(){return null}},iQ=Object.defineProperty,Ps=(t,e)=>iQ(t,"name",{value:e,configurable:!0}),Ib="Dialog",[KM,ioe]=Qi(Ib),[oQ,xi]=KM(Ib),Kg=Ps(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]=rl({prop:r,defaultProp:s??!1,onChange:i,caller:Ib}),[p,g]=m.useState(0),[v,x]=m.useState(0);return S.jsx(oQ,{scope:e,triggerRef:l,contentRef:u,contentId:ja(),titleId:ja(),descriptionId:ja(),titlePresent:p>0,descriptionPresent:v>0,setTitleCount:g,setDescriptionCount:x,open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(_=>!_),[f]),modal:o,children:n})},"Dialog"),aQ="DialogTrigger",ooe=m.forwardRef(Ps(function(e,n){const{__scopeDialog:r,...s}=e,i=xi(aQ,r),o=en(n,i.triggerRef);return S.jsx(kn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":tv(i.open),...s,ref:o,onClick:Gt(e.onClick,i.onOpenToggle)})},"DialogTrigger")),YM="DialogPortal",[lQ,XM]=KM(YM,{forceMount:void 0}),Yg=Ps(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=xi(YM,e);return S.jsx(lQ,{scope:e,forceMount:n,children:m.Children.map(r,o=>S.jsx(nl,{present:n||i.open,children:S.jsx(Sb,{asChild:!0,container:s,children:o})}))})},"DialogPortal"),bx="DialogOverlay",Xg=m.forwardRef(Ps(function(e,n){const r=XM(bx,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,o=xi(bx,e.__scopeDialog);return o.modal?S.jsx(nl,{present:s||o.open,children:S.jsx(uQ,{...i,ref:n})}):null},"DialogOverlay")),cQ=Wa("DialogOverlay.RemoveScroll"),uQ=m.forwardRef(Ps(function(e,n){const{__scopeDialog:r,...s}=e,i=xi(bx,r),o=GI(),l=en(n,o);return S.jsx(Tb,{as:cQ,allowPinchZoom:!0,shards:[i.contentRef],children:S.jsx(kn.div,{"data-state":tv(i.open),...s,ref:l,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),wh="DialogContent",Qg=m.forwardRef(Ps(function(e,n){const r=XM(wh,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,o=xi(wh,e.__scopeDialog);return S.jsx(nl,{present:s||o.open,children:o.modal?S.jsx(dQ,{...i,ref:n}):S.jsx(fQ,{...i,ref:n})})},"DialogContent")),dQ=m.forwardRef(Ps(function(e,n){const r=xi(wh,e.__scopeDialog),s=m.useRef(null),i=en(n,r.contentRef,s);return m.useEffect(()=>{const o=s.current;if(o)return GM(o)},[]),S.jsx(QM,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Gt(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Gt(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:Gt(e.onFocusOutside,o=>o.preventDefault())})},"DialogContentModal")),fQ=m.forwardRef(Ps(function(e,n){const r=xi(wh,e.__scopeDialog),s=m.useRef(!1),i=m.useRef(!1);return S.jsx(QM,{...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")),QM=m.forwardRef(Ps(function(e,n){const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,u=xi(wh,r);return qg(),S.jsx(S.Fragment,{children:S.jsx(OM,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(pb,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionPresent?u.descriptionId:void 0,"aria-labelledby":u.titlePresent?u.titleId:void 0,"data-state":tv(u.open),...l,ref:n,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})},"DialogContentImpl")),hQ="DialogTitle",Jg=m.forwardRef(Ps(function(e,n){const{__scopeDialog:r,...s}=e,i=xi(hQ,r),{setTitleCount:o}=i;return Yr(()=>(o(l=>l+1),()=>o(l=>l-1)),[o]),S.jsx(kn.h2,{id:i.titleId,...s,ref:n})},"DialogTitle")),pQ="DialogDescription",ev=m.forwardRef(Ps(function(e,n){const{__scopeDialog:r,...s}=e,i=xi(pQ,r),{setDescriptionCount:o}=i;return Yr(()=>(o(l=>l+1),()=>o(l=>l-1)),[o]),S.jsx(kn.p,{id:i.descriptionId,...s,ref:n})},"DialogDescription")),mQ="DialogClose",aoe=m.forwardRef(Ps(function(e,n){const{__scopeDialog:r,...s}=e,i=xi(mQ,r);return S.jsx(kn.button,{type:"button",...s,ref:n,onClick:Gt(e.onClick,()=>i.onOpenChange(!1))})},"DialogClose"));function tv(t){return t?"open":"closed"}Ps(tv,"getState");var gQ=Object.defineProperty,sl=(t,e)=>gQ(t,"name",{value:e,configurable:!0}),Mb="Popover",[JM,loe]=Qi(Mb,[Zg]),Ob=Zg(),[vQ,_d]=JM(Mb),yQ=sl(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!1}=t,l=Ob(e),u=m.useRef(null),[d,f]=m.useState(!1),[p,g]=rl({prop:r,defaultProp:s??!1,onChange:i,caller:Mb});return S.jsx(hM,{...l,children:S.jsx(vQ,{scope:e,contentId:ja(),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"),_Q="PopoverTrigger",xQ=m.forwardRef(sl(function(e,n){const{__scopePopover:r,...s}=e,i=_d(_Q,r),o=Ob(r),l=en(n,i.triggerRef),u=S.jsx(kn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Lb(i.open),...s,ref:l,onClick:Gt(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?u:S.jsx(pM,{asChild:!0,...o,children:u})},"PopoverTrigger")),eO="PopoverPortal",[wQ,bQ]=JM(eO,{forceMount:void 0}),SQ=sl(t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=_d(eO,e);return S.jsx(wQ,{scope:e,forceMount:n,children:S.jsx(nl,{present:n||i.open,children:S.jsx(Sb,{asChild:!0,container:s,children:r})})})},"PopoverPortal"),bh="PopoverContent",kQ=m.forwardRef(sl(function(e,n){const r=bQ(bh,e.__scopePopover),{forceMount:s=r.forceMount,...i}=e,o=_d(bh,e.__scopePopover);return S.jsx(nl,{present:s||o.open,children:o.modal?S.jsx(CQ,{...i,ref:n}):S.jsx(PQ,{...i,ref:n})})},"PopoverContent")),EQ=Wa("PopoverContent.RemoveScroll"),CQ=m.forwardRef(sl(function(e,n){const r=_d(bh,e.__scopePopover),s=m.useRef(null),i=en(n,s),o=m.useRef(!1);return m.useEffect(()=>{const l=s.current;if(l)return GM(l)},[]),S.jsx(Tb,{as:EQ,allowPinchZoom:!0,children:S.jsx(tO,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Gt(e.onCloseAutoFocus,l=>{var u;l.preventDefault(),o.current||(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Gt(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:Gt(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),PQ=m.forwardRef(sl(function(e,n){const r=_d(bh,e.__scopePopover),s=m.useRef(!1),i=m.useRef(!1);return S.jsx(tO,{...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")),tO=m.forwardRef(sl(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=_d(bh,r),x=Ob(r);return qg(),S.jsx(OM,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(pb,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>v.onOpenChange(!1),deferPointerDownOutside:!0,children:S.jsx(mM,{"data-state":Lb(v.open),role:"dialog",id:v.contentId,...x,...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 Lb(t){return t?"open":"closed"}sl(Lb,"getState");var Nb=yQ,Db=xQ,jb=SQ,$b=kQ;const Sh={fast:{type:"spring",duration:.08,bounce:0},moderate:{type:"spring",duration:.16,bounce:.15}},RQ="data-hover-dead-zone";function nO(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},[]),x=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,x()})},[x]),w=m.useCallback(C=>{const R=C.clientX,A=C.clientY,O=C.target instanceof Element&&C.target.closest(`[${RQ}]`)!==null;p.current!==null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{p.current=null;const I=t.current;if(!I)return;if(O){o(null);return}const T=v(),M=d.current;(T.length!==M.length||T.some((oe,re)=>{const se=M[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=I.getBoundingClientRect(),$=n==="x"?R:A;let K=null,B=1/0,z=null;const Z=d.current,Q=n==="x"?I.scrollLeft:I.scrollTop,U=n==="x"?I.clientLeft:I.clientTop,ee=n==="x"?j.left:j.top,W=n==="x"?I.offsetWidth:I.offsetHeight,D=n==="x"?j.width:j.height,X=W>0?D/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+(U+se-Q)*X,_e=(n==="x"?re.width:re.height)*X,de=fe+_e;$>=fe&&$<=de&&(z=oe);let ae=0;$<fe?ae=fe-$:$>de&&(ae=$-de),ae<B&&(B=ae,K=oe)}o(z??(B<=r?K:null))})},[n,t,r,v]),b=m.useCallback(()=>{f.current+=1,x()},[x]),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:w,onMouseEnter:b,onMouseLeave:E},registerItem:_,measureItems:x}}function AQ(t,e,n){m.useEffect(()=>(t(e,n.current),()=>t(e,null)),[e,t,n])}let cm=0;const TQ=()=>{cm+=1;let t=!1;return()=>{t||(t=!0,cm=Math.max(0,cm-1))}},IQ=()=>cm>0,MQ='[data-menu-item]:not([disabled]):not([aria-disabled="true"])',rO=({itemSelector:t=MQ,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=TQ(),v=f.ownerDocument.defaultView;let x;const _=()=>{v==null||v.clearTimeout(x),x=v==null?void 0:v.setTimeout(()=>{const w=f.ownerDocument.activeElement;(w==null?void 0:w.tagName)==="IFRAME"&&!f.contains(w)&&i.current&&(o.current=!0,i.current())})};v==null||v.addEventListener("blur",_),s.current=()=>{v==null||v.removeEventListener("blur",_),v==null||v.clearTimeout(x),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 x=v.indexOf(document.activeElement),_=v.length-1,w=C=>{if(x===-1)return C===1?0:_;const R=x+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=w(1):b=w(-1),(E=v[b])==null||E.focus()},[t,e]);return{containerRef:l,onKeyDown:d,onCloseAutoFocus:u}};var um={exports:{}},OQ=um.exports,UC;function LQ(){return UC||(UC=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(OQ,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(_,w){var b=_[w];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(),w=0;w<s.length;w++){var b=s[w];this[b]=w<_?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(_,w,b){return d(_)||p.apply(this,arguments)}function v(_,w){var b=this,E,C,R,A="loglevel";typeof _=="string"?A+=":"+_:typeof _=="symbol"&&(A=void 0);function O(j){var $=(s[j]||"silent").toUpperCase();if(!(typeof window===n||!A)){try{window.localStorage[A]=$;return}catch{}try{window.document.cookie=encodeURIComponent(A)+"="+$+";"}catch{}}}function I(){var j;if(!(typeof window===n||!A)){try{j=window.localStorage[A]}catch{}if(typeof j===n)try{var $=window.document.cookie,K=encodeURIComponent(A),B=$.indexOf(K+"=");B!==-1&&(j=/^([^;]+)/.exec($.slice(B+K.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 M(j){var $=j;if(typeof $=="string"&&b.levels[$.toUpperCase()]!==void 0&&($=b.levels[$.toUpperCase()]),typeof $=="number"&&$>=0&&$<=b.levels.SILENT)return $;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=w||g,b.getLevel=function(){return R??C??E},b.setLevel=function(j,$){return R=M(j),$!==!1&&O(R),f.call(b)},b.setDefaultLevel=function(j){C=M(j),I()||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=M(o.getLevel())),f.call(b),o===b)for(var j in i)i[j].rebuild()},E=M(o?o.getLevel():"WARN");var N=I();N!=null&&(R=M(N)),f.call(b)}o=new v,o.getLogger=function(w){if(typeof w!="symbol"&&typeof w!="string"||w==="")throw new TypeError("You must supply a name when creating a logger.");var b=i[w];return b||(b=i[w]=new v(w,o.methodFactory)),b};var x=typeof window!==n?window.log:void 0;return o.noConflict=function(){return typeof window!==n&&window.log===o&&(window.log=x),o},o.getLoggers=function(){return i},o.default=o,o})})(um)),um.exports}var NQ=LQ();const fi=Cg(NQ),DQ="INFO",jQ=DQ.toUpperCase();fi.setLevel(fi.levels[jQ]||fi.levels.INFO);const Rs=t=>{const e=t?`[${t}] `:"";return{trace:(n,...r)=>fi.trace(`${e}${n}`,...r),debug:(n,...r)=>fi.debug(`${e}${n}`,...r),info:(n,...r)=>fi.info(`${e}${n}`,...r),warn:(n,...r)=>fi.warn(`${e}${n}`,...r),error:(n,...r)=>{fi.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)=>fi.info(`${e}API: ${n}`,...r),hook:(n,...r)=>fi.debug(`${e}Hook: ${n}`,...r),mount:(n,...r)=>fi.debug(`${e}Mount: ${n}`,...r)}},BC=Rs("useVariantsUiState"),$Q={groups:[],rows:{}},N0={pinned:[],order:$Q},Cf="pinned",FQ="top",l_=t=>`rows:${t}`,ZC=t=>e=>e.pinned.includes(t)?e:{...e,pinned:[...e.pinned,t]},VQ=t=>e=>({...e,pinned:e.pinned.filter(n=>n!==t)}),HQ=(t,e)=>n=>{if(t===Cf){const r=new Set(e);return{...n,pinned:[...e,...n.pinned.filter(s=>!r.has(s))]}}return t===FQ?{...n,order:{...n.order,groups:e}}:{...n,order:{...n.order,rows:{...n.order.rows,[t.slice(5)]:e}}}},zQ=t=>{const e=t?`?projectPath=${encodeURIComponent(t)}`:"",[n,r]=m.useState(N0),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(x=>{BC.warn("persist failed — arrangement kept for this session only",x)})},[t,e]);m.useEffect(()=>{if(r(N0),s.current=N0,i.current=!1,o.current=[],!t)return;let v=!1;return(async()=>{try{const x=await fetch(`/api/variants/ui-state${e}`);if(!x.ok||v)return;const _=await x.json();if(v)return;let w=_.uiState??N0;const b=o.current;o.current=[];for(const E of b)w=E(w);i.current=!0,s.current=w,r(w),b.length>0&&l(w)}catch(x){BC.warn("load failed — arrangement is session-local until reload",x)}})(),()=>{v=!0}},[t,e,l]);const u=m.useCallback(v=>{const x=v(s.current);s.current=x,r(x),i.current?l(x):o.current.push(v)},[l]),d=m.useCallback(v=>{const x=!s.current.pinned.includes(v);u(x?ZC(v):VQ(v))},[u]),f=m.useCallback(v=>{s.current.pinned.includes(v)||u(ZC(v))},[u]),p=m.useCallback((v,x)=>{u(HQ(v,x))},[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}},UQ=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 x=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 w;_===0?w=v[0].getBoundingClientRect().top-x-1:_===v.length?w=v[v.length-1].getBoundingClientRect().bottom-x:w=(v[_-1].getBoundingClientRect().bottom+v[_].getBoundingClientRect().top)/2-x,(!o||o.index!==_||o.container!==n.container)&&l({container:n.container,index:_,top:w})},[e,n,o,u,r,s]),f=m.useCallback(()=>{if(!n||!o)return;l(null);const p=u(o.container).map(x=>x.dataset.reorderKey).filter(x=>!!x),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}},sO=(t,e)=>`style:${t}:${e}`,iO=t=>`text:${t}`,oO=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"]},aO=t=>oO(t)[0],D0=(t,e)=>oO(t).includes(e),BQ=t=>{const e=aO(t.elementId),n=t.batchId?`:${t.batchId}`:"";return t.type==="style"?`${sO(e,t.property)}${n}`:`${iO(e)}${n}`},ur=[];for(let t=0;t<256;++t)ur.push((t+256).toString(16).slice(1));function ZQ(t,e=0){return(ur[t[e+0]]+ur[t[e+1]]+ur[t[e+2]]+ur[t[e+3]]+"-"+ur[t[e+4]]+ur[t[e+5]]+"-"+ur[t[e+6]]+ur[t[e+7]]+"-"+ur[t[e+8]]+ur[t[e+9]]+"-"+ur[t[e+10]]+ur[t[e+11]]+ur[t[e+12]]+ur[t[e+13]]+ur[t[e+14]]+ur[t[e+15]]).toLowerCase()}const WQ=new Uint8Array(16);function qQ(){return crypto.getRandomValues(WQ)}function WC(t,e,n){return crypto.randomUUID?crypto.randomUUID():GQ(t)}function GQ(t,e,n){var s;t=t||{};const r=t.random??((s=t.rng)==null?void 0:s.call(t))??qQ();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,ZQ(r)}const KQ=300;class YQ{constructor(){fa(this,"history",{current:new Map,past:[],future:[]});fa(this,"pendingChanges",new Map);fa(this,"currentBatchId",null);fa(this,"debounceTimer",null);fa(this,"onChangeCallbacks",[]);fa(this,"stateBeforePending",null);fa(this,"transactionDepth",0)}recordChange(e){this.pendingChanges.size===0&&(this.currentBatchId=WC(),this.stateBeforePending=new Map(this.history.current)),this.currentBatchId&&(e.batchId=this.currentBatchId);const n=aO(e.elementId),r=e.type==="style"?sO(n,e.property):iO(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=BQ(e);this.history.current.set(i,e),this.pendingChanges.set(i,e),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.commitPending()},KQ),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"&&D0(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"&&D0(r.elementId,e)).sort((r,s)=>s.timestamp-r.timestamp)[0]}hasChanges(e){return Array.from(this.history.current.values()).some(n=>D0(n.elementId,e))}getChangesForElement(e){return Array.from(this.history.current.values()).filter(n=>D0(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=WC(),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 hg={kind:"base"};function kh(t){return t.kind==="base"?"base":`variant:${t.sessionId}:${t.variantId}`}function XQ(t,e){return t.kind==="base"&&e.kind,t.kind==="variant"&&e.kind==="variant"?t.sessionId===e.sessionId&&t.variantId===e.variantId:!1}const QQ={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}},lO=Object.fromEntries(Object.entries(QQ).map(([t,e])=>[t,{isEnabled:e.default}]));dt("view");const cO=dt(!0),uO=dt(null),JQ=dt("chat"),dO=dt(0),eJ=dt({name:null,email:null}),qC=dt(hg);dt(null);const Eh=new Map,tJ=t=>{const e=kh(t);let n=Eh.get(e);return n||(n=new YQ,Eh.set(e,n)),n};dt(t=>tJ(t(qC)),(t,e,n)=>{Eh.set(kh(t(qC)),n)});const nJ=t=>{for(const e of[...Eh.keys()])e==="base"||t.has(e)||Eh.delete(e)},Ch=dt(new Map),GC=dt(null);dt(null);const Sx=dt(0),pg=dt(null),kx=dt(!1),Ex=dt(null),fO=dt(!1),hO=dt(!1),Cx=dt(null),dm=dt(null),sd=dt(null),Fb=dt(null),zo=dt(null),pO=dt(!1),Qh=dt({active:!1}),mO=dt([]),KC=dt(null),rJ=(t,e,n)=>{let r=!1;const s=new Map(t);for(const[i,o]of t)o.target&&XQ(o.target,e)&&(s.set(i,{...o,target:n}),r=!0);return r?s:t},sJ=dt(null,(t,e,n)=>{const r=u=>{const d=u??hg;return d.kind==="variant"&&!n.has(kh(d))},s=t(Ch);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(Ch,u)}const o=t(GC);o&&r(o.target)&&(e(GC,null),e(cJ,!1));const l=t(KC);l&&(i!=null&&i.has(l.commentId))&&e(KC,null),nJ(n)}),Px=dt(lO),iJ=dt(!1),Vb=dt(null),nv=dt(!0),oJ=dt(!1),gO=dt(!1),vO=dt(null),aJ=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},rv=dt(aJ()),lJ=dt(null),cJ=dt(!1);dt(0);dt(0);function uJ(t){return t==="cursor"?"Cursor":t==="codex"?"Codex":t==="claude-desktop"?"Claude":"Claude Code"}const dJ=["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],Hb=({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:dJ.map((n,r)=>S.jsx("span",{className:"block",style:{height:"1em",lineHeight:"1em"},children:n},r))})}),yO=({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(Nb,{open:d,onOpenChange:f,children:[S.jsx(Db,{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(lq,{className:"h-3.5 w-3.5",weight:"bold"})})}),S.jsx(jb,{children:S.jsx($b,{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 x=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:[x?S.jsx(x,{className:"h-3.5 w-3.5",weight:"bold"}):null,v.label]},v.label)})})})]}):null]})},_c=({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(Pb,{content:t,side:n,sideOffset:r,delayDuration:s,forceOpen:o,children:e}),sv="/__rivet/preview",YC=`${sv}/variant/`,XC=`${sv}/history/`,_O=t=>t?t.startsWith("/")?t:`/${t}`:"/",fJ=t=>`${sv}/variant/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${_O(t.routePath)}`,hJ=t=>`${sv}/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${_O(t.routePath)}`,pJ=t=>{try{const e=new URL(t,"http://localhost");return e.pathname.startsWith(YC)||e.pathname.startsWith(XC)}catch{return t.startsWith(YC)||t.startsWith(XC)}},QC=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")?fJ({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},JC="/rivet/",xO=t=>{if(!t.startsWith(JC))return null;const e=t.slice(JC.length);return!e||e==="/"?null:`/${e}`},id=(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(()=>{})},mJ=(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),id(r,e))}},mg=(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}}},e3=6,wO="original",zb="Original",bO="The original state of your app before any variants were generated.",t3=200,SO="h-6 w-6 rounded",Rx=[.33,1,.68,1],Ax=.22,Tn=Rs("AgentVariantsPanel"),c_=()=>{var t;(t=window.getSelection())==null||t.removeAllRanges()},du=t=>{var e;return!!t.hasTree&&((e=t.serve)==null?void 0:e.kind)==="dev-server"},gJ=t=>{var e;return t?t.kind==="existing"?!0:((e=t.executionPlan)==null?void 0:e.mode)==="vite_app":!1};function u_(t,...e){return t?e.some(n=>(n??"").toLowerCase().includes(t)):!0}const vJ=(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},kO=t=>{const e="requestId"in t?["request",t.requestId]:["label",t.runLabel];return`run:${JSON.stringify([t.sessionId,...e])}`},yJ="original",Tx="pinned-section";function EO(t){return`rivet:collapsedRuns:${t}`}function j0(t){try{const e=window.localStorage.getItem(EO(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 d_(t,e){try{window.localStorage.setItem(EO(t),JSON.stringify([...e]))}catch{}}const n3=(t,e)=>{const n=[],r=new Map;for(const s of t){const i=vJ(s,e);let o="";s.kind==="original"?o=yJ:i&&(o=kO(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 Ai(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 _J=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},Gf=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")},CO=t=>{var e;return((e=t.previewUnavailable)==null?void 0:e.reason)==="idle_timeout"},xJ=t=>t.status==="succeeded"&&!Gf(t)&&(!t.previewUnavailable||CO(t)),f_=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"},r3=(t,e,n)=>{const r=t.includes("?")?"&":"?";return`${t}${r}${encodeURIComponent(e)}=${encodeURIComponent(n)}`},wJ=t=>{var e;return _J(t)&&((e=t.preview)==null?void 0:e.kind)==="static_artifact"},s3=(t,e)=>t.map(n=>`${n.workItemId}:${e[n.workItemId]??""}`).join("|"),bJ=(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}),SJ=()=>{var Ko,Yo,Js,dp;const t=Mg(),e=ct(Qh),n=ct(pO),r=m.useRef(!1),s=ct(mO),i=ct(Vb),o=ct(nv),l=ct(Px),u=((Ko=l.deployPrototype)==null?void 0:Ko.isEnabled)??!1,d=((Yo=l.canvasShare)==null?void 0:Yo.isEnabled)??!1,f=((Js=l.variantSend)==null?void 0:Js.isEnabled)??!1,p=((dp=l.designContextViewer)==null?void 0:dp.isEnabled)??!1,g=ct(gO),v=ct(vO),x=gt(Sx),_=gt(pg),w=gt(kx),b=gt(Ex),E=gt(fO),C=gt(hO),R=gt(sd),A=ct(sd),O=gt(Fb),I=gt(uO);m.useEffect(()=>(I("Directions"),()=>I(null)),[I]);const T=ct(zo),M=gt(zo),N=m.useCallback((F=!1)=>{if(mJ(T),M(null),F&&T){const le=mg("ended",T);Ce.capture(le.event,le.properties)}},[M,T]),j=ct(Cx),$=gt(Cx),K=ct(dm),B=gt(dm),z=K?`${K.sessionId}:${K.variantId}`:null,[Z,Q]=m.useState(""),[U,ee]=m.useReducer(F=>F+1,0),W=m.useMemo(()=>i!==null?j0(i):new Set,[i,U]),D=m.useCallback(F=>{if(i===null)return;const le=new Set(j0(i));le.delete(F)||le.add(F),d_(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({}),[Mt,Xt]=m.useState(null),[xt,yt]=m.useState([]),We=m.useRef([]);We.current=xt;const[Ke,St]=m.useState(!1),[Re]=m.useState(()=>GG(window.location.search)),Ye=m.useRef(!1),Ot=m.useRef(!1);Ot.current=Re!==null||K!==null||j!==null||Ke;const qe=m.useMemo(()=>e.active?e.variants:[],[e]),kt=m.useMemo(()=>qe.filter(wJ),[qe]),rs=m.useMemo(()=>s3(kt,de),[kt,de]),gr=(Oe==null?void 0:Oe.key)===rs?Oe.shareUrl:null,Le=e.active?e.sessionId:null,Wo=m.useMemo(()=>{const F=new Set;for(const le of qe)le.adoptedSource&&F.add(`${le.adoptedSource.sessionId}:${le.adoptedSource.variantId}`);return F},[qe]),Mn=m.useMemo(()=>[...xt.filter(le=>le.sessionId!==Le&&!Wo.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)}),[Wo,xt,Le]),Xn=m.useMemo(()=>K?qe.find(F=>{var le,Ee;return((le=F.adoptedSource)==null?void 0:le.sessionId)===K.sessionId&&((Ee=F.adoptedSource)==null?void 0:Ee.variantId)===K.variantId})??null:null,[K,qe]),ol=m.useMemo(()=>K?Mn.find(F=>F.sessionId===K.sessionId&&F.variantId===K.variantId)??null:null,[K,Mn]),mn=e.active?e.projectContext:null,gn=(mn==null?void 0:mn.kind)==="fresh"?mn.workspacePath:i,xd=!e.active&&Mn.length>0&&Mn.every(F=>F.projectKind==="fresh"),As=e.active?gJ(mn):!!i&&!xd,vr=m.useMemo(()=>gn?`?projectPath=${encodeURIComponent(gn)}`:"",[gn]),{pinnedKeys:Qn,pinnedKeySet:eo,listOrder:Ys,togglePin:On,pinItem:Ts,reorder:al}=zQ(gn),to=m.useRef(null),ss=m.useRef(null),Xe=typeof window>"u"?"/":xO(window.location.pathname)??"/",Lt=m.useRef(null),Ft=m.useRef(!1),zn=m.useCallback((F,le)=>{le.button!==0&&le.pointerType==="mouse"||(le.preventDefault(),c_(),Lt.current={kind:"live",variantId:F,startX:le.clientX,startY:le.clientY,committed:!1})},[]),is=m.useCallback((F,le)=>{le.button!==0&&le.pointerType==="mouse"||(le.preventDefault(),c_(),Lt.current={kind:"past",entry:F,startX:le.clientX,startY:le.clientY,committed:!1})},[]);m.useEffect(()=>{const F=he=>{const pe=Lt.current;if(!pe)return;const Se=he.clientX-pe.startX,Qe=he.clientY-pe.startY;if(!pe.committed){if(Se*Se+Qe*Qe<e3*e3)return;if(c_(),pe.kind==="live"){const Pe=qe.find(vn=>vn.workItemId===pe.variantId);if(!Pe||Pe.status!=="succeeded"){Lt.current=null;return}const nn=QC({sessionId:Le,variant:Pe,projectContext:mn,routePath:Xe});R({sessionId:Le??"",variantId:Pe.workItemId,label:Pe.label||"Direction",url:nn,source:"live",runLabel:Pe.runLabel,description:Pe.description})}else{const{entry:Pe}=pe,nn=du(Pe),vn=nn?hJ({sessionId:Pe.sessionId,variantId:Pe.variantId,routePath:Xe}):`/api/variants/history/${encodeURIComponent(Pe.sessionId)}/${encodeURIComponent(Pe.variantId)}/preview${vr}`;if(R({sessionId:Pe.sessionId,variantId:Pe.variantId,label:Pe.label||"Direction",url:vn,source:nn?"history-dev-server":"history-static",runLabel:Pe.runLabel,description:Pe.brief}),nn){const Cr=r3(`/api/variants/history/${encodeURIComponent(Pe.sessionId)}/${encodeURIComponent(Pe.variantId)}/run${vr}`,"targetAddressed","1");(async()=>{try{if(!(await fetch(Cr,{method:"POST"})).ok)return;const cs=r3(vn,"replay",String(Date.now()));R(lt=>!lt||lt.sessionId!==Pe.sessionId||lt.variantId!==Pe.variantId||lt.source!=="history-dev-server"?lt:{...lt,url:cs}),M(lt=>{if(!lt)return lt;const Vt=ei=>!ei||ei.sessionId!==Pe.sessionId||ei.variantId!==Pe.variantId?ei:{...ei,url:cs};return{...lt,left:Vt(lt.left),right:Vt(lt.right)}})}catch(ls){Tn.warn("history replay drag boot failed",ls)}})()}}pe.committed=!0}O({x:he.clientX,y:he.clientY})},le=()=>{const he=Lt.current;he!=null&&he.committed&&(Ft.current=!0,window.setTimeout(()=>{Ft.current=!1},0)),Lt.current=null,O(null)},Ee=he=>{if(he.key!=="Escape")return;const pe=Lt.current;pe!=null&&pe.committed&&(pe.kind==="past"&&du(pe.entry)&&id({sessionId:pe.entry.sessionId,variantId:pe.entry.variantId,source:"history-dev-server"}),Lt.current=null,R(null),O(null))};return window.addEventListener("pointermove",F),window.addEventListener("pointerup",le),window.addEventListener("pointercancel",le),window.addEventListener("keydown",Ee),()=>{window.removeEventListener("pointermove",F),window.removeEventListener("pointerup",le),window.removeEventListener("pointercancel",le),window.removeEventListener("keydown",Ee)}},[qe,Le,mn,Xe,vr,R,O,M]);const Ut=m.useCallback(()=>{var F;(F=Lt.current)!=null&&F.committed&&(Ft.current=!0,window.setTimeout(()=>{Ft.current=!1},0)),Lt.current=null,O(null),A&&(A.source==="history-dev-server"&&id({sessionId:A.sessionId,variantId:A.variantId,source:"history-dev-server"}),R(null))},[A,R,O]),Ln=m.useCallback((F,le)=>{const Ee=!eo.has(F);Ce.capture(Ee?"variants_panel.direction_pinned":"variants_panel.direction_unpinned",{method:le}),On(F)},[eo,On]),$r=m.useCallback(()=>{A&&(Ce.capture("variants_panel.direction_pinned",{method:"drag"}),Ts(`row:past:${A.sessionId}:${A.variantId}`),Ut())},[A,Ut,Ts]),Xs=m.useCallback(F=>{Ce.capture("variants_panel.direction_unpinned",{method:"drag"}),On(F),Ut()},[On,Ut]),ar=m.useCallback((F,le)=>{al(F,le),Ut()},[al,Ut]),Rn=m.useMemo(()=>{var le;if(Ke||z)return null;const F=j?qe.find(Ee=>Ee.workItemId===j):null;return j&&!F?null:F?Gf(F)?F.workItemId:null:e.active?((le=qe.find(Ee=>{var he,pe;return Gf(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]),ll=Ke||As&&j===null&&z===null&&Rn===null,bc=m.useCallback(async F=>{var Ee,he,pe,Se;if(!Le)return;const le=(F==null?void 0:F.workItemId)??null;oe({kind:"switch",variantId:le??void 0});try{if(((Ee=F==null?void 0:F.preview)==null?void 0:Ee.kind)==="static_artifact"){if(w(!1),b(null),((he=F.refinement)==null?void 0:he.status)==="succeeded"){const Pe=F.preview.url.includes("?")?"&":"?";_(`${F.preview.url}${Pe}refinement=${encodeURIComponent(F.refinement.workItemId)}`)}else _(F.preview.url);x(Pe=>Pe+1);return}if(le&&Le&&e.active&&e.projectContext.kind==="fresh"&&((pe=e.projectContext.executionPlan)==null?void 0:pe.mode)!=="vite_app"&&((Se=F==null?void 0:F.preview)==null?void 0:Se.kind)!=="dev_server"){w(!1),b(null),_(`/api/variants/${Le}/static/${le}`),x(Pe=>Pe+1);return}const Qe=F&&le?QC({sessionId:Le,variant:F,projectContext:e.active?e.projectContext:null,routePath:Xe}):null;if(Qe){w(!1),b(null),_(Qe),x(Pe=>Pe+1);return}Ce.capture("variants_panel.preview_display_failed",{sessionId:Le,variantId:le,previewKind:F?f_(F):"none",hasPreview:!!(F!=null&&F.preview),hasPort:typeof(F==null?void 0:F.port)=="number",errorMessage:"No addressable dev-server preview URL"}),w(!1),b(null)}catch(Qe){Tn.warn("preview display failed",Qe),Ce.capture("variants_panel.preview_display_failed",{sessionId:Le,variantId:le,previewKind:F?f_(F):"none",hasPreview:!!(F!=null&&F.preview),hasPort:typeof(F==null?void 0:F.port)=="number",errorMessage:Qe instanceof Error?Qe.message:String(Qe)}),w(!1),b(null)}finally{oe(null)}},[Le,e,Xe,x,_,w,b]),Sc=m.useRef(!1),kc=m.useRef(null),Is=m.useRef(0),no=m.useCallback(()=>{if(Is.current++,E(!1),C(!1),!Sc.current)return;const F=kc.current;Sc.current=!1,kc.current=null;const le=F?new URLSearchParams({sessionId:F.sessionId,variantId:F.variantId}):null,Ee=le?`/api/variants/history/replay/stop?${le.toString()}`:"/api/variants/history/replay/stop";fetch(Ee,{method:"POST"}).catch(he=>Tn.warn("history replay stop failed",he))},[E,C]),wd=m.useCallback(async F=>{if(Le){oe({kind:"switch",variantId:F.workItemId});try{const le=await fetch(`/api/variants/${Le}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:F.workItemId})});if(!le.ok){const Ee=await Ai(le);throw new Error(Ee.message??`Preview restoration failed (${le.status})`)}}catch(le){Tn.warn("preview restoration failed",le),Ce.capture("variants_panel.preview_display_failed",{sessionId:Le,variantId:F.workItemId,previewKind:"dev_server",hasPreview:!1,hasPort:!1,errorMessage:le instanceof Error?le.message:String(le)})}finally{oe(null)}}},[Le]),Ec=m.useCallback(F=>{var Se,Qe,Pe,nn,vn;if(Ft.current){Ft.current=!1;return}const le=Gf(F),Ee=F.status==="pending"||F.status==="running"||xJ(F);no();const he=f_(F),pe=qe.find(Cr=>Cr.workItemId===j);Ce.capture("variants_panel.preview_requested",{sessionId:Le,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:F.workItemId,variantStatus:F.status,isPreviewReady:le,isArmed:Ee,previewKind:he,hasPreview:!!F.preview,hasPort:typeof F.port=="number",viewEnabled:((Qe=(Se=F.actions)==null?void 0:Se.view)==null?void 0:Qe.enabled)??null,previewUnavailableReason:((Pe=F.previewUnavailable)==null?void 0:Pe.reason)??null}),$(F.workItemId),B(null),le?(ss.current=F.workItemId,St(!1),N(!0),bc(F)):(ss.current=null,St(!1),_(null),w(!1),Ee&&Ce.capture("variants_panel.preview_armed",{sessionId:Le,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:F.workItemId,variantStatus:F.status,previewKind:he,hasPreview:!!F.preview,hasPort:typeof F.port=="number",viewEnabled:((vn=(nn=F.actions)==null?void 0:nn.view)==null?void 0:vn.enabled)??null}),CO(F)&&wd(F)),Ce.capture("variants_panel.preview_switched",{sessionId:Le,fromVariantId:pe==null?void 0:pe.workItemId,toVariantId:F.workItemId,armed:Ee})},[j,Le,N,$,B,no,wd,bc,qe,_,w]),bd=e.active?`${e.sessionId}:${e.stage}`:"inactive",Cc=m.useRef(!1);m.useEffect(()=>{if(o)return;let F=!1;return(async()=>{try{const le=await fetch(`/api/variants/history${vr}`,{credentials:"same-origin"});if(!le.ok)return;const Ee=await le.json();if(F)return;const he=(Ee.variants??[]).filter(pe=>{var Se,Qe;return((Se=pe.preview)==null?void 0:Se.kind)==="static"||((Qe=pe.serve)==null?void 0:Qe.kind)==="static"||du(pe)});if(!Cc.current&&!Ot.current&&bd==="inactive"&&he.length>0&&he.every(pe=>pe.projectKind==="fresh")){const pe=[...he].sort((Se,Qe)=>new Date(Qe.createdAt).getTime()-new Date(Se.createdAt).getTime()).find(Se=>!du(Se));pe&&(Cc.current=!0,B({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${vr}`))}if(B(pe=>{if(!pe)return pe;const Se=he.find(Qe=>Qe.sessionId===pe.sessionId&&Qe.variantId===pe.variantId);return!Se||JSON.stringify(pe.references)===JSON.stringify(Se.references)?pe:{...pe,references:Se.references}}),bJ(We.current,he))return;We.current=he,yt(he)}catch(le){Tn.warn("Failed to load past variants",le)}})(),()=>{F=!0}},[o,gn,bd,vr,_,B]);const Pc=m.useCallback(()=>{Sc.current=!1,kc.current=null,E(!1),C(!1),B(null),$(null),St(!0),w(!1),b(null),_(null),x(F=>F+1)},[$,E,C,x,_,b,B,w]),qo=m.useCallback(F=>{if(Ft.current){Ft.current=!1;return}if(N(!0),B({sessionId:F.sessionId,variantId:F.variantId,previewKind:du(F)?"dev_server":"static",references:F.references,projectPath:gn??void 0}),$(null),St(!1),du(F)){const le=++Is.current;Sc.current=!0,kc.current={sessionId:F.sessionId,variantId:F.variantId},E(!0),C(!0),(async()=>{oe({kind:"switch"}),Ce.capture("variants_panel.history_replay_started",{sessionId:F.sessionId,variantId:F.variantId});const Ee=he=>Ce.capture("variants_panel.history_replay_failed",{sessionId:F.sessionId,variantId:F.variantId,...he});try{const he=await fetch(`/api/variants/history/${encodeURIComponent(F.sessionId)}/${encodeURIComponent(F.variantId)}/run${vr}`,{method:"POST"});if(le!==Is.current)return;if(!he.ok){const{errorCode:pe}=await Ai(he);Tn.warn(`history replay failed: HTTP ${he.status} ${pe??""}`),Ee({httpStatus:he.status,errorCode:pe}),Pc();return}C(!1),w(!0),b(null),_(null),x(pe=>pe+1),Ce.capture("variants_panel.history_replay_ready",{sessionId:F.sessionId,variantId:F.variantId})}catch(he){if(le!==Is.current)return;Tn.warn("history replay failed",he),Ee({errorMessage:he instanceof Error?he.message:String(he)}),Pc()}finally{oe(null)}})();return}no(),w(!1),b(null),_(`/api/variants/history/${encodeURIComponent(F.sessionId)}/${encodeURIComponent(F.variantId)}/preview${vr}`)},[gn,Pc,oe,E,C,x,B,$,_,b,N,w,no,vr]);m.useEffect(()=>{if(!Re||Ye.current)return;const F=xt.find(le=>le.sessionId===Re.sessionId&&le.variantId===Re.variantId);F&&(Ye.current=!0,qo(F))},[Re,xt,qo]);const Sd=m.useCallback(async()=>{no();const F=()=>{N(!0),$(null),B(null),St(!0),ss.current=null,w(!1),b(null),_(null),x(le=>le+1)};if(!Le){F();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){Tn.warn(`switch to original failed: HTTP ${le.status}`);return}F(),w(!0),Ce.capture("variants_panel.preview_switched",{sessionId:Le,fromVariantId:j,toVariantId:null,target:"original",armed:!1})}catch(le){Tn.warn("preview-port original switch failed",le)}finally{oe(null)}},[j,Le,$,B,x,_,b,N,w,no]),fv=m.useCallback(async F=>{var Ee,he;const le=((he=(Ee=F.actions)==null?void 0:Ee.commit)==null?void 0:he.enabled)??F.status==="succeeded";if(!(!Le||!le)){Ce.capture("variants_panel.commit_clicked",{sessionId:Le,variantId:F.workItemId,variantLabel:F.label}),oe({kind:"commit",variantId:F.workItemId});try{const pe=await fetch(`/api/variants/${Le}/commit`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:F.workItemId})});if(!pe.ok){const{message:Qe,errorCode:Pe}=await Ai(pe);Tn.warn(`commit failed: HTTP ${pe.status} ${Pe??""} ${Qe??""}`),Ce.capture("variants_panel.commit_failed",{sessionId:Le,variantId:F.workItemId,httpStatus:pe.status,errorCode:Pe??null,errorMessage:Qe??null}),At.error("Couldn't send direction",{description:Qe??`The server rejected the request (HTTP ${pe.status}). Try again, or pick a different direction.`});return}const Se=await pe.json().catch(()=>null);Ce.capture("variants_panel.commit_succeeded",{sessionId:Le,variantId:F.workItemId,payloadKind:(Se==null?void 0:Se.payloadKind)??null,duplicate:(Se==null?void 0:Se.duplicate)??!1}),At.success(`Sent "${F.label}" to your project`,{description:(Se==null?void 0:Se.payloadKind)==="project-created"?`Project created at ${(Se==null?void 0:Se.destinationPath)??"destination"}.`:"Direction diff applied to your working tree (uncommitted)."}),(Se==null?void 0:Se.payloadKind)!=="project-created"&&(_(null),w(!1),x(Qe=>Qe+1))}catch(pe){Tn.warn("commit failed",pe),Ce.capture("variants_panel.commit_failed",{sessionId:Le,variantId:F.workItemId,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:pe instanceof Error?pe.message:String(pe)}),At.error("Couldn't send direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{oe(null)}}},[Le,x,_,w]),Qt=m.useCallback(async(F,le,Ee)=>{Ce.capture("variants_panel.deploy_clicked",{sessionId:F,variantId:le,variantLabel:Ee});try{const he=await fetch(`/api/variants/${F}/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 Ai(he);return Tn.warn(`deploy failed: HTTP ${he.status} ${Pe??""} ${Qe??""}`),Ce.capture("variants_panel.deploy_failed",{sessionId:F,variantId:le,httpStatus:he.status,errorCode:Pe??null,errorMessage:Qe??null}),At.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),Se=pe==null?void 0:pe.shareUrl;return Se?(await navigator.clipboard.writeText(Se).catch(()=>{}),Ce.capture("variants_panel.deploy_succeeded",{sessionId:F,variantId:le}),At.success(`"${Ee}" is live — link copied`,{action:{label:"Open",onClick:()=>window.open(Se,"_blank","noopener")}}),Se):(At.error("Couldn't deploy this direction",{description:"The deploy host returned an unexpected response."}),null)}catch(he){return Tn.warn("deploy failed",he),Ce.capture("variants_panel.deploy_failed",{sessionId:F,variantId:le,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:he instanceof Error?he.message:String(he)}),At.error("Couldn't deploy this direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."}),null}},[i]),hv=m.useCallback(async F=>{if(!Le)return;const le=de[F.workItemId];if(le){await navigator.clipboard.writeText(le).catch(()=>{}),At.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(le,"_blank","noopener")}});return}oe({kind:"deploy",variantId:F.workItemId});try{const Ee=await Qt(Le,F.workItemId,F.label);Ee&&ae(he=>({...he,[F.workItemId]:Ee}))}finally{oe(null)}},[Le,de,Qt]),kd=m.useCallback(async()=>{if(!(!Le||kt.length===0)){if(gr){await navigator.clipboard.writeText(gr).catch(()=>{}),At.success("Canvas link copied",{action:{label:"Open",onClick:()=>window.open(gr,"_blank","noopener")}});return}Ce.capture("variants_panel.deploy_clicked",{sessionId:Le,variantId:"canvas",variantLabel:"Canvas",variantCount:kt.length}),oe({kind:"deploy-canvas"});try{const F=await fetch(`/api/variants/${Le}/canvas/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantIds:kt.map(Se=>Se.workItemId),...i?{projectPath:i}:{}})});if(!F.ok){const{message:Se,errorCode:Qe}=await Ai(F);Tn.warn(`canvas deploy failed: HTTP ${F.status} ${Qe??""} ${Se??""}`),Ce.capture("variants_panel.deploy_failed",{sessionId:Le,variantId:"canvas",httpStatus:F.status,errorCode:Qe??null,errorMessage:Se??null,variantCount:kt.length}),At.error("Couldn't share this canvas",{description:Se??`The server rejected the request (HTTP ${F.status}). Try again.`});return}const le=await F.json().catch(()=>null),Ee=le==null?void 0:le.shareUrl;if(!Ee){At.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(Se=>typeof Se.variantId=="string"&&typeof Se.shareUrl=="string").map(Se=>[Se.variantId,Se.shareUrl])),pe=Object.keys(he).length>0?{...de,...he}:de;pe!==de&&ae(pe),await navigator.clipboard.writeText(Ee).catch(()=>{}),ke({key:s3(kt,pe),shareUrl:Ee}),Ce.capture("variants_panel.deploy_succeeded",{sessionId:Le,variantId:"canvas",variantCount:kt.length}),At.success("Canvas is live — link copied",{action:{label:"Open",onClick:()=>window.open(Ee,"_blank","noopener")}})}catch(F){Tn.warn("canvas deploy failed",F),Ce.capture("variants_panel.deploy_failed",{sessionId:Le,variantId:"canvas",httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:F instanceof Error?F.message:String(F),variantCount:kt.length}),At.error("Couldn't share this canvas",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{oe(null)}}},[gr,kt,de,i,Le]),sp=m.useCallback(async F=>{const le=`${F.sessionId}:${F.variantId}`,Ee=Ge[le];if(Ee){await navigator.clipboard.writeText(Ee).catch(()=>{}),At.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(Ee,"_blank","noopener")}});return}Xt(le);try{const he=await Qt(F.sessionId,F.variantId,F.label);he&&vt(pe=>({...pe,[le]:he}))}finally{Xt(null)}},[Ge,Qt]),Go=m.useCallback(async F=>{if(Le){Ce.capture("variants_panel.remove_clicked",{sessionId:Le,variantId:F.workItemId,variantLabelLength:F.label.length}),oe({kind:"remove",variantId:F.workItemId});try{const le=await fetch(`/api/variants/${Le}/${F.workItemId}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!le.ok){const{message:Ee}=await Ai(le);Tn.warn(`remove failed: HTTP ${le.status} ${Ee??""}`),At.error("Couldn't remove direction",{description:Ee??`The server rejected the request (HTTP ${le.status}). Try again.`});return}(F.workItemId===Rn||F.workItemId===j)&&($(null),_(null),w(!1),x(Ee=>Ee+1))}catch(le){Tn.warn("remove failed",le),At.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{oe(null)}}},[Le,j,Rn,$,_,w,x]),Ed=m.useCallback(async F=>{if(!gn){At.error("Couldn't remove direction",{description:"No project path available."});return}Ce.capture("variants_panel.remove_past_clicked",{sessionId:F.sessionId,variantId:F.variantId});const le=`${F.sessionId}:${F.variantId}`,Ee=he=>he.sessionId===F.sessionId&&he.variantId===F.variantId;oe({kind:"remove",variantId:le}),yt(he=>he.filter(pe=>!Ee(pe))),z===le&&(B(null),_(null),w(!1),x(he=>he+1));try{const he=await fetch(`/api/variants/history/${encodeURIComponent(F.sessionId)}/${encodeURIComponent(F.variantId)}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectPath:gn})});if(!he.ok){const{message:pe}=await Ai(he);yt(Se=>Se.some(Ee)?Se:[...Se,F]),At.error("Couldn't remove direction",{description:pe??`The server rejected the request (HTTP ${he.status}). Try again.`})}}catch(he){Tn.warn("remove past failed",he),yt(pe=>pe.some(Ee)?pe:[...pe,F]),At.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{oe(null)}},[gn,z,B,_,w,x]),Cd=m.useCallback(F=>{se(F)},[]),Rc=m.useCallback(F=>{if(!F.label||!F.run)return;const le=F.rows.flatMap(he=>he.kind==="active"?[he.variant]:[]),Ee=F.rows.flatMap(he=>he.kind==="past"?[he.entry]:[]);le.length===0&&Ee.length===0||se({kind:"run",label:F.label,variants:le,entries:Ee})},[]),Ms=m.useCallback(async()=>{if(!(!re||fe)){_e(!0);try{if(re.kind==="active")await Go(re.variant);else if(re.kind==="past")await Ed(re.entry);else{for(const F of re.variants)await Go(F);for(const F of re.entries)await Ed(F)}}finally{_e(!1),se(null)}}},[re,fe,Go,Ed]),[ip,os]=m.useState(null),[pv,Pd]=m.useState(null),mv=m.useCallback(F=>{Pd(F)},[]),Ac=m.useCallback(()=>{Pd(null)},[]),Tc=m.useCallback(async F=>{const le=F.trim();if(le)try{await navigator.clipboard.writeText(le),At.success("Copied")}catch{At.error("Couldn't copy")}},[]),cl=m.useCallback(async(F,le)=>{Pd(null);const Ee=le.trim();if(!Ee||F.kind==="original")return;if(F.kind==="active"){if(!Le||Ee===F.variant.label)return;Ce.capture("variants_panel.rename",{sessionId:Le,variantId:F.variant.workItemId,labelLength:Ee.length,past:!1});try{const Se=await fetch(`/api/variants/${Le}/${F.variant.workItemId}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Ee})});if(!Se.ok){const{message:Qe}=await Ai(Se);At.error("Couldn't rename direction",{description:Qe??`The server rejected the request (HTTP ${Se.status}). Try again.`})}}catch(Se){Tn.warn("rename failed",Se),At.error("Couldn't rename direction",{description:"Network or server error. Try again."})}return}const{entry:he}=F;if(Ee===he.label.trim())return;if(!gn){At.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=Se=>Se.sessionId===he.sessionId&&Se.variantId===he.variantId;yt(Se=>Se.map(Qe=>pe(Qe)?{...Qe,label:Ee}:Qe));try{const Se=await fetch(`/api/variants/history/${encodeURIComponent(he.sessionId)}/${encodeURIComponent(he.variantId)}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Ee,projectPath:gn})});if(!Se.ok){const{message:Qe}=await Ai(Se);yt(Pe=>Pe.map(nn=>pe(nn)?{...nn,label:he.label}:nn)),At.error("Couldn't rename direction",{description:Qe??`The server rejected the request (HTTP ${Se.status}). Try again.`})}}catch(Se){Tn.warn("rename failed",Se),yt(Qe=>Qe.map(Pe=>pe(Pe)?{...Pe,label:he.label}:Pe)),At.error("Couldn't rename direction",{description:"Network or server error. Try again."})}},[Le,gn]),[Ic,Rd]=m.useState(null),gv=m.useCallback(F=>{Rd(F)},[]),Ad=m.useCallback(()=>{Rd(null)},[]),op=m.useCallback(async(F,le)=>{if(Rd(null),!F.label||!F.run)return;const Ee=F.label,he=le.trim();if(!he||he===Ee)return;Ce.capture("variants_panel.rename_run",{runLabelLength:he.length});const pe="requestId"in F.run?F.run.requestId:void 0,Se=pe?F.key:kO({sessionId:F.run.sessionId,runLabel:he}),Qe=Se!==F.key;let Pe=!1,nn=!1;if(i!==null&&Qe){const lt=j0(i);Pe=lt.has(F.key),nn=lt.has(Se),Pe&&(lt.add(Se),d_(i,lt),ee())}const vn=lt=>{if(i===null||!Qe)return;const Vt=j0(i);lt?Vt.delete(F.key):(Pe?Vt.add(F.key):Vt.delete(F.key),nn?Vt.add(Se):Vt.delete(Se)),d_(i,Vt),ee()},Cr=new Set(F.rows.flatMap(lt=>lt.kind==="past"?[`${lt.entry.sessionId}:${lt.entry.variantId}`]:[])),ls=lt=>Cr.has(`${lt.sessionId}:${lt.variantId}`);yt(lt=>lt.map(Vt=>ls(Vt)?{...Vt,runLabel:he}:Vt));const cs=()=>yt(lt=>lt.map(Vt=>ls(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:F.run.sessionId,...pe?{requestId:pe}:{},runLabel:Ee,label:he,...gn?{projectPath:gn}:{}})});if(lt.ok)vn(!0);else{const{message:Vt}=await Ai(lt);cs(),vn(!1),At.error("Couldn't rename run",{description:Vt??`The server rejected the request (HTTP ${lt.status}). Try again.`})}}catch(lt){Tn.warn("run rename failed",lt),cs(),vn(!1),At.error("Couldn't rename run",{description:"Network or server error. Try again."})}},[gn,i,yt]);m.useEffect(()=>{const F=n&&!r.current;if(r.current=n,to.current!==Le){const Ee=to.current===null;to.current=Le;const he=t.get(dm);if(F&&Re&&(he==null?void 0:he.sessionId)===Re.sessionId&&(he==null?void 0:he.variantId)===Re.variantId||(ss.current=null,ke(null),_(null),w(!1),b(null),N(),$(null),B(null),St(!1),Cc.current=!1,!Ee))return}if(z||Ke||!Rn||e.active!==!0||ss.current===Rn)return;const le=qe.find(Ee=>Ee.workItemId===Rn);le&&(ss.current=Rn,N(),bc(le))},[Le,n,Re,t,z,Ke,Rn,e,qe,bc,N,$,B,_,b,w]),m.useEffect(()=>{!K||!Xn||(ss.current=null,B(null),$(Xn.workItemId),St(!1))},[Xn,K,Le,$,B]),m.useEffect(()=>{!K||Xn||ol||B(null)},[Xn,K,ol,Le,B,Mn]),m.useEffect(()=>{const F=Z.trim().toLowerCase(),le=[...qe.map(Pe=>({kind:"active",variant:Pe})),...Mn.map(Pe=>({kind:"past",entry:Pe})),...As?[{kind:"original"}]:[]],Ee=F?le.filter(Pe=>i3(Pe,F)):le,{pinned:he,unpinned:pe}=o3(l3(n3(Ee,Le),Ys),Qn,Le),Se=[...W.has(Tx)?[]:he,...pe.flatMap(Pe=>Pe.key!==""&&W.has(Pe.key)?[]:Pe.rows)];if(Se.length===0)return;const Qe=Pe=>{if(IQ())return;if(Pe.key==="Enter"){const Vt=qe.find(ei=>ei.workItemId===ip);Vt&&(Pe.preventDefault(),Ec(Vt));return}if(Pe.key!=="ArrowUp"&&Pe.key!=="ArrowDown")return;Pe.preventDefault();const nn=j??Rn;let vn=nn?`live:${nn}`:null;z?vn=`past:${z}`:ll&&(vn=wO);const Cr=vn?Se.findIndex(Vt=>od(Vt)===vn):-1;let ls;if(Cr===-1?ls=Pe.key==="ArrowDown"?0:Se.length-1:Pe.key==="ArrowDown"?ls=Math.min(Cr+1,Se.length-1):ls=Math.max(Cr-1,0),ls===Cr)return;const cs=Se[ls];cs.kind==="active"?Ec(cs.variant):cs.kind==="past"?qo(cs.entry):Sd();const lt=document.querySelector(`[data-variant-key="${od(cs)}"]`);lt instanceof HTMLElement&<.focus({preventScroll:!0})};return window.addEventListener("keydown",Qe),()=>window.removeEventListener("keydown",Qe)},[qe,Mn,Z,As,W,Qn,Ys,Le,j,z,ll,Rn,ip,Ec,qo,Sd]);const ul=qe.find(F=>F.workItemId===Rn)??null,ro=z?Mn.find(F=>`${F.sessionId}:${F.variantId}`===z)??null:null,ap=!!ro,Td=e.active?e.artifacts??[]:[],so=[...(e.active?qe:[]).map(F=>({kind:"active",variant:F})),...Mn.map(F=>({kind:"past",entry:F})),...As?[{kind:"original"}]:[]],Id=Z.trim().toLowerCase(),dl=Id?so.filter(F=>i3(F,Id)):so,lp=l3(n3(dl,Le),Ys),{pinned:cp,unpinned:up}=o3(lp,Qn,Le);let Mc=null;A&&(Mc=A.source==="live"?`live:${A.variantId}`:`past:${A.sessionId}:${A.variantId}`);const Oc=new Set(qe.map(F=>F.requestId).filter(Boolean)),Qs=s.filter(F=>!Oc.has(F.requestId)),as=Qs.length>0,Os=o&&!as&&so.length===0;return S.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[so.length>0?S.jsx("div",{className:"pt-2 pr-5 pb-1 pl-3",children:S.jsxs("div",{className:"relative",children:[S.jsx(mq,{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:F=>Q(F.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:[as?S.jsx(FJ,{groups:Qs}):null,Os?S.jsx(VJ,{}):null,e.active&&so.length===0&&!as&&!Os?S.jsx(HJ,{}):null,!e.active&&!as&&!Os&&Mn.length===0&&!As?S.jsx(zJ,{isMCPSession:g,mcpEditor:v}):null,so.length>0&&dl.length===0?S.jsxs("p",{className:"text-content-muted px-1 py-6 text-center text-xs",children:["No directions match “",Z.trim(),"”."]}):null,dl.length>0?S.jsx(AJ,{groups:up,pinned:cp,pinnedKeys:eo,draggedRowKey:Mc,onDropPin:$r,onDropUnpin:Xs,onTogglePin:Ln,onReorder:ar,collapsedRuns:W,onToggleRun:D,activeVariantId:j??Rn,activePastKey:z,isOriginalSelected:ll,busy:X,editingKey:pv,onSelectActive:Ec,onSelectPast:qo,onSelectOriginal:Sd,onActivePointerDown:zn,onPastPointerDown:is,onHover:os,onRemove:F=>Cd({kind:"active",variant:F}),onRemovePast:F=>Cd({kind:"past",entry:F}),onStartRename:mv,onCommitRename:cl,onCancelRename:Ac,editingRunKey:Ic,onStartRunRename:gv,onCommitRunRename:op,onCancelRunRename:Ad,onRemoveRun:Rc,onCopyVariantContext:Tc,activeSessionId:e.active?e.sessionId:null,projectPath:gn}):null,e.active&&p?S.jsx(NJ,{artifacts:Td}):null]}),ap&&ro?S.jsx(MJ,{entry:ro,deploying:Mt===z,deployedUrl:z?Ge[z]??null:null,onDeploy:sp,isDeployDisabled:!u}):null,!ap&&e.active?S.jsx($J,{selectedVariant:ul,busy:X,onSend:fv,onDeploy:hv,onDeployCanvas:kd,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:gr,deployedUrl:ul?de[ul.workItemId]??null:null}):null,S.jsx(EJ,{target:re,isConfirming:fe,onCancel:()=>se(null),onConfirm:Ms})]})},kJ=t=>t.kind==="active"?t.variant.label.trim()||"this direction":t.kind==="run"?t.label.trim()||"this run":t.entry.label.trim()||"this direction",EJ=({target:t,isConfirming:e,onCancel:n,onConfirm:r})=>{if(!t)return null;const s=kJ(t),i=t.kind==="run",o=i?t.variants.length+t.entries.length:0,l=i?"Remove run":"Remove direction";return S.jsx(Kg,{open:!0,onOpenChange:u=>{!u&&!e&&n()},children:S.jsxs(Yg,{children:[S.jsx(Xg,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(Qg,{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(Jg,{className:"text-content text-base font-medium",children:i?"Remove run?":"Remove direction?"}),S.jsx(ev,{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})]})]})})]})})},od=t=>t.kind==="active"?`live:${t.variant.workItemId}`:t.kind==="past"?`past:${t.entry.sessionId}:${t.entry.variantId}`:wO,i3=(t,e)=>t.kind==="active"?u_(e,t.variant.label,t.variant.runLabel):t.kind==="past"?u_(e,t.entry.label,t.entry.runLabel,t.entry.brief):u_(e,zb,bO),PO=(t,e)=>t.startsWith("live:")?`row:past:${e??""}:${t.slice(5)}`:`row:${t}`,RO=(t,e)=>PO(od(t),e),o3=(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=RO(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}},a3=(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]},l3=(t,e)=>{const n=t.map(r=>{const s=e.rows[r.key];return!s||s.length===0?r:{...r,rows:a3(r.rows,s,od)}});return a3(n,e.groups,r=>r.key)},CJ=t=>t.length<=t3?t:`${t.slice(0,t3-1)}…`,PJ=(t,e)=>t.kind==="active"?e?`${e}:${t.variant.workItemId}`:null:t.kind==="past"?`${t.entry.sessionId}:${t.entry.variantId}`:null,RJ=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},AJ=({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:x,onSelectActive:_,onSelectPast:w,onSelectOriginal:b,onActivePointerDown:E,onPastPointerDown:C,onHover:R,onRemove:A,onRemovePast:O,onStartRename:I,onCommitRename:T,onCancelRename:M,editingRunKey:N,onStartRunRename:j,onCommitRunRename:$,onCancelRunRename:K,onRemoveRun:B,onCopyVariantContext:z,activeSessionId:Z,projectPath:Q})=>{const U=m.useRef(null),{activeIndex:ee,itemRects:W,sessionRef:D,handlers:X,registerItem:oe}=nO(U,{snapTolerancePx:5}),[re,se]=m.useState(!1),[fe,_e]=m.useState(!1),de=u.has(Tx),ae=r!==null,Oe=m.useMemo(()=>{if(!r)return null;const Re=PO(r,Z);if(n.has(Re))return{container:Cf,key:Re};const Ye=t.find(Ot=>Ot.rows.some(qe=>od(qe)===r));return Ye?{container:l_(Ye.key),key:r}:null},[r,n,t,Z]),ke=(Oe==null?void 0:Oe.container)===Cf,{dropTarget:Ge,onPointerMove:vt,onPointerUp:Mt}=UQ({containerRef:U,dragged:Oe,yieldToSelector:ke?void 0:"[data-pinned-drop-zone]",restrictToSelector:ke?"[data-pinned-drop-zone]":void 0,onReorder:l}),Xt=ee!==null?W[ee]:null,xt=Re=>Re.kind==="active"?Re.variant.workItemId===f:Re.kind==="past"?`${Re.entry.sessionId}:${Re.entry.variantId}`===p:g,yt=(Re,Ye,Ot,qe)=>{const kt=od(Re),rs=RO(Re,Z);return S.jsx(IJ,{rowKey:kt,row:Re,index:Ye,isSelected:xt(Re),isEditing:x===kt,isPinned:n.has(rs),onTogglePin:gr=>o(rs,gr),reorderContainer:Ot,reorderKey:Ot===Cf?rs:kt,isNested:qe,busy:v,registerItem:oe,onSelectActive:_,onSelectPast:w,onSelectOriginal:b,onActivePointerDown:E,onPastPointerDown:C,onHover:R,onRemove:A,onRemovePast:O,onStartRename:I,onCommitRename:T,onCancelRename:M,onCopyVariantContext:z,activeSessionId:Z,projectPath:Q},kt)};let We=0;const Ke=Re=>{if(Re.key==="")return Re.rows.map(kt=>yt(kt,We++,l_(Re.key),!1));const Ye=u.has(Re.key),Ot=Ye?null:Re.rows.map(kt=>yt(kt,We++,l_(Re.key),!0)),qe=Re.label;return S.jsx(TJ,{label:qe??zb,collapsed:Ye,onToggle:()=>d(Re.key),directionCount:Re.rows.length,isEditing:qe!==null&&N===Re.key,onStartRename:qe!==null?()=>j(Re.key):void 0,onCommitRename:qe!==null?kt=>$(Re,kt):void 0,onCancelRename:K,onRemove:qe!==null?()=>B(Re):void 0,children:Ot},Re.key)},St=e.length>0||ae;return S.jsxs("div",{ref:U,className:"relative",onMouseEnter:X.onMouseEnter,onMouseMove:X.onMouseMove,onMouseLeave:X.onMouseLeave,onPointerMove:vt,onPointerUp:Re=>{var Ye;if(ke&&Oe){const Ot=(Ye=U.current)==null?void 0:Ye.querySelector("[data-pinned-drop-zone]"),qe=Ot==null?void 0:Ot.getBoundingClientRect();if(!(qe!==void 0&&Re.clientY>=qe.top&&Re.clientY<=qe.bottom)){i(Oe.key);return}}Mt()},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:Xt&&S.jsx(yi.div,{className:"bg-hover pointer-events-none absolute z-0 rounded-md",initial:{opacity:0,top:Xt.top,left:Xt.left,width:Xt.width,height:Xt.height},animate:{opacity:1,top:Xt.top,left:Xt.left,width:Xt.width,height:Xt.height},exit:{opacity:0,transition:{duration:.06}},transition:{...Sh.fast,opacity:{duration:.08}}},D.current)}),S.jsxs("ul",{className:"relative flex flex-col gap-2",children:[S.jsx(ws,{initial:!1,children:St?S.jsxs(yi.li,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:Ax,ease:Rx},"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(Tx),"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(J2,{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(yi.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:Ax,ease:Rx},className:"overflow-hidden",children:e.length>0?S.jsx("ul",{className:"flex flex-col gap-2",children:e.map(Re=>yt(Re,We++,Cf,!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(_q,{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))]})]})},AO=({open:t,onOpenChange:e,triggerLabel:n,actions:r})=>{const{containerRef:s,onKeyDown:i}=rO({onDismiss:()=>e(!1)});return S.jsxs(Nb,{open:t,onOpenChange:e,children:[S.jsx(_c,{label:n,children:S.jsx(Db,{asChild:!0,children:S.jsx(Zi,{type:"button",variant:"ghost",size:"icon-compact","aria-label":n,onClick:o=>o.stopPropagation(),onPointerDown:o=>o.stopPropagation(),className:SO,children:S.jsx(fq,{size:15,weight:"bold"})})})}),S.jsx(jb,{children:S.jsx($b,{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))})})]})},TJ=({label:t,collapsed:e,directionCount:n,onToggle:r,isEditing:s=!1,onStartRename:i,onCommitRename:o,onCancelRename:l,onRemove:u,children:d})=>{const f=Xi(),[p,g]=m.useState(!1),v=[...i?[{key:"rename",label:"Rename",icon:S.jsx(XT,{size:13,weight:"bold"}),onSelect:i}]:[],...u?[{key:"remove",label:"Remove",icon:S.jsx(aI,{size:13,weight:"bold"}),onSelect:u}]:[]],x=e?S.jsx(pq,{size:13,weight:"fill",className:"shrink-0 text-sky-400"}):S.jsx(hq,{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:[x,S.jsx("span",{className:"min-w-0 flex-1",children:S.jsx(TO,{initial:t,onCommit:o,onCancel:l})})]}),S.jsx(ws,{initial:!1,children:!e&&S.jsx(yi.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:[x,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(AO,{open:p,onOpenChange:g,triggerLabel:`${t} run actions`,actions:v})})]}),S.jsx(ws,{initial:!1,children:!e&&S.jsx(yi.ul,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:Ax,ease:Rx},className:"overflow-hidden",children:d},"body")})]})},IJ=({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:x,onActivePointerDown:_,onPastPointerDown:w,onHover:b,onRemove:E,onRemovePast:C,onStartRename:R,onCommitRename:A,onCancelRename:O,onCopyVariantContext:I,activeSessionId:T,projectPath:M})=>{var ae,Oe;const N=m.useRef(null);AQ(p,n,N);const[j,$]=m.useState(!1),K=e.kind==="active",B=e.kind==="original",z=e.kind==="active"?e.variant:null,Z=e.kind==="past"?e.entry:null,Q=z?z.status==="succeeded":!0,U=z?Gf(z):!0,ee=z!==null&&(z.status==="pending"||z.status==="running"),W=(z==null?void 0:z.status)==="failed",D=(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=zb;z?re=z.label||`Direction ${n+1}`:Z&&(re=Z.label.trim()||"Untitled direction");let se=bO;z?se=z.description:Z&&(se=Z.brief);const fe=se?CJ(se):null,_e=PJ(e,T),de=_e?"Copy variant reference":"Copy description";return s?S.jsx("li",{ref:N,"data-proximity-index":n,"data-reorder-container":l,"data-reorder-key":u,className:"group relative z-10",children:S.jsx("div",{className: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(TO,{initial:re,onCommit:ke=>A(e,ke),onCancel:O}),fe&&S.jsx("span",{className:"text-content-muted mt-1 line-clamp-2 block text-xs leading-snug",children:fe})]})})}):S.jsxs("li",{ref:N,"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:K?()=>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){$(!0);return}const Ge=window.getSelection();Ge&&!Ge.isCollapsed||(e.kind==="active"?g(e.variant):e.kind==="past"?v(e.entry):x())},onKeyDown:ke=>{(ke.key==="Enter"||ke.key===" ")&&(ke.preventDefault(),ke.stopPropagation(),e.kind==="active"?g(e.variant):e.kind==="past"?v(e.entry):x())},onPointerDown:ke=>{ke.metaKey||ke.ctrlKey||(e.kind==="active"?U&&_(e.variant.workItemId,ke):e.kind==="past"&&w(e.entry,ke))},"aria-pressed":r,"aria-disabled":K?!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",U&&"cursor-grab active:cursor-grabbing",!U&&"cursor-pointer"),style:U?{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(Hb,{className:"text-content-muted shrink-0 text-sm","data-testid":oe&&!ee?"variant-refining":void 0}),S.jsx(_c,{label:"Double-click to rename",disabled:B,children:S.jsx("span",{onDoubleClick:ke=>{ke.stopPropagation(),B||R(t)},className:zt("min-w-0 flex-1 truncate text-sm font-medium select-text",B?"cursor-default":"cursor-text",Q||r?"text-content":"text-content-muted"),children:re})}),W&&S.jsx(_c,{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(c3,{label:"Failed"})})}),D&&S.jsx(c3,{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})]})}),B?null:S.jsx(qG,{references:(z==null?void 0:z.references)??(Z==null?void 0:Z.references),source:K?"active":"history",sessionId:(Z==null?void 0:Z.sessionId)??T,variantId:(Z==null?void 0:Z.variantId)??(z==null?void 0:z.workItemId),projectPath:M,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(Zi,{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:SO,children:S.jsx(J2,{weight:i?"fill":"bold"})}),S.jsx(AO,{open:j,onOpenChange:$,triggerLabel:"Direction actions",actions:[...se||_e?[{key:"copy",label:de,icon:S.jsx(mh,{size:13,weight:"bold"}),onSelect:()=>I(RJ({label:re,description:se,reference:_e,projectPath:M}))}]:[],{key:"pin",label:i?"Unpin":"Pin",icon:S.jsx(J2,{size:13,weight:"bold"}),onSelect:()=>o("menu")},...B?[]:[{key:"rename",label:"Rename",icon:S.jsx(XT,{size:13,weight:"bold"}),onSelect:()=>R(t)},{key:"remove",label:"Remove",icon:S.jsx(aI,{size:13,weight:"bold"}),disabled:X,onSelect:()=>{e.kind==="active"?E(e.variant):e.kind==="past"&&C(e.entry)}}]]})]})]})},TO=({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"})},c3=({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}),MJ=({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(mh,{size:12,weight:"bold"}):null,o]})]})},OJ={agent_browser:"Browser extracted",cache:"Cached",static:"Bundled catalog",manual:"Manual"},LJ={design_context:"DESIGN.md",source_context:"Source",qa_report:"QA",asset:"Asset"},NJ=({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(DJ,{artifact:i,isExpanded:i.id===r,onToggle:()=>s(i.id)},i.id))})]})},DJ=({artifact:t,isExpanded:e,onToggle:n})=>{const r=LJ[t.kind],s=t.source?OJ[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(oq,{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(jJ,{artifact:t})}):null]})},jJ=({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]}),$J=({selectedVariant:t,busy:e,onSend:n,onDeploy:r,onDeployCanvas:s,canDeploy:i,canDeployCanvas:o,canSendToAgent:l,canvasVariantCount:u,canvasDeployedUrl:d,deployedUrl:f})=>{var I,T,M,N;const p=t?((T=(I=t.actions)==null?void 0:I.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),x=(e==null?void 0:e.kind)==="deploy"&&e.variantId===(t==null?void 0:t.workItemId),_=(e==null?void 0:e.kind)==="deploy-canvas",w=!i||!p||e!==null,b=o&&u>0,C=x?"Deploying…":f?"Copy link":"Share",A=_?"Sharing…":d?"Copy canvas link":"Share canvas",O=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(yO,{primaryLabel:C,primaryIcon:f&&!x?mh:void 0,primaryAction:()=>{t&&r(t)},isDisabled:w,isDropdownDisabled:e!==null,isLoading:x,loadingLabel:"Deploying…",dropdownAriaLabel:"More share actions",dropdownItems:b?[{label:A,icon:d&&!_?mh:void 0,onClick:s,isDisabled:e!==null}]:[]}),l?S.jsx("button",{type:"button",onClick:()=>{t&&n(t)},disabled:!g,title:(N=(M=t==null?void 0:t.actions)==null?void 0:M.commit)==null?void 0:N.reason,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:O}):null]})]})},IO=()=>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(Hb,{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"})})]})}),FJ=({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(IO,{},`${e.requestId}-${r}`)))}),VJ=()=>S.jsx("div",{"data-testid":"direction-boot-skeletons",className:"space-y-0.5",children:Array.from({length:3}).map((t,e)=>S.jsx(IO,{},e))}),HJ=()=>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."})]}),u3="Try different ways to create a dropdown that feels fluid and dynamic",zJ=({isMCPSession:t=!1,mcpEditor:e=null})=>{const[n,r]=m.useState(!1),s=uJ(e),i=t?s:"your coding agent",o=()=>{navigator.clipboard.writeText(u3).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:["“",u3,"”"]}),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(dq,{className:"h-3.5 w-3.5 text-emerald-500",weight:"bold"}):S.jsx(mh,{className:"h-3.5 w-3.5",weight:"bold"})})]})]})]})},UJ="rivet:show-projects",BJ=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}},ZJ=({onClose:t})=>{const e=ct(uO),n=ct(Vb),r=BJ(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(UJ,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(cq,{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(_c,{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(gq,{className:"h-4 w-4",weight:"bold"})})})]})},Ka=(t,e={})=>{if(!window.location.pathname.startsWith("/rivet/library"))return fetch(t,e);const n=new Headers(e.headers);return n.set("Authorization",_V()),fetch(t,{...e,headers:n})},WJ=5e3,qJ=()=>{const t=window.location.pathname.startsWith("/rivet/library");return eh({queryKey:["rivet-account"],queryFn:async({signal:e})=>{const n=await Ka(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:WJ,retry:!1})},gg="rivet_just_signed_in",GJ=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"},h_=({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}:{}}}),d3=Rs("useLogin"),KJ=2e3,YJ=60,f3="Connecting to Google...",h3="https://rivet-proxy.onrender.com",XJ=`<!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>${f3}</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">${f3}</div>
|
|
143
|
+
</body>
|
|
144
|
+
</html>`,MO=(t="editor_gate")=>{const e=Xi(),[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=h_({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(XJ),f.document.close()}catch(x){d3.warn("Failed to render loading state in auth popup:",x)}const g=await fetch(`${h3}/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 x=0;x<YJ;x+=1){if(f.closed)throw new Error("Sign-in window was closed before authentication completed.");const w=await(await fetch(`${h3}/api/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:v.sessionId,pollSecret:v.pollSecret})})).json();if(w.success&&w.token&&((p=w.user)!=null&&p.email)){if(!(await Ka("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:w.user.email,token:w.token,refreshToken:w.refreshToken,userId:w.user.id})})).ok)throw new Error("Signed in, but failed to store session locally.");f.close(),window.sessionStorage.setItem(gg,"1");const E=h_({outcome:"completed",authAttemptId:l,entryPoint:t,startedAt:u,now:Date.now()});e==null||e.capture(E.event,E.properties),window.location.reload();return}if(w.error&&w.error!=="Pending")throw new Error(w.error||"Google login failed");await new Promise(b=>setTimeout(b,KJ))}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";d3.warn("Login failed:",v);const x=h_({outcome:"failed",authAttemptId:l,entryPoint:t,startedAt:u,now:Date.now(),failureReason:GJ(v)});e==null||e.capture(x.event,x.properties),i(v),r(!1)}},[e,t]),isStartingLogin:n,loginError:s}},QJ=Rs("useIntegrations"),p_=["integrations"],JJ="rivet:connect-result",eee=t=>typeof t=="object"&&t!==null&&t.type===JJ,tee=dt(null),p3=async()=>{const t=await Ka("/api/integrations");if(!t.ok)throw new Error(`Failed to load integrations (${t.status})`);return(await t.json()).integrations??[]},nee=()=>{const t=yP(),[e,n]=JR(tee),r=eh({queryKey:p_,queryFn:p3,staleTime:1e4}),s=m.useCallback(async()=>(await t.invalidateQueries({queryKey:p_,refetchType:"none"}),t.fetchQuery({queryKey:p_,queryFn:p3})),[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 Ka(`/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 x=async(w,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":w)}catch{p(w)}}},_=w=>{if(eee(w.data)&&w.data.provider===l){if(w.data.status==="error"){QJ.warn(`Connect failed for ${l}:`,w.data.message),x("failed");return}x("connected")}};window.addEventListener("message",_),v=setInterval(()=>{u.closed&&x("closed",!0)},500)})}finally{n(null)}},[s,n]),o=m.useCallback(async l=>{n(l);try{const u=await Ka(`/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}},Il=({action:t,outcome:e,provider:n,entryPoint:r,durationMs:s,failureReason:i})=>({event:`visual_editor_reference_${t==="connect"?"connection":"disconnection"}_${e}`,properties:{provider:n,entry_point:r,...s!==void 0?{duration_ms:s}:{},...i?{failure_reason:i}:{}}}),Jh=async(t,e="GET",n)=>{if(window.location.pathname.startsWith("/rivet/library"))return wV(t,{method:e,body:n});const r=await Ka(t.replace(/^\/profile/,"/api/reference-profiles"),{method:e,headers:{"Content-Type":"application/json"},...n!==void 0?{body:JSON.stringify(n)}:{}}),s=await r.text();let i;try{i=JSON.parse(s)}catch{throw new Error(`Reference profile request failed (${r.status})`)}if(!r.ok)throw new Error(i.error??`Request failed (${r.status})`);return i},OO=()=>Jh("/profile"),ree=t=>eh({queryKey:["cosmos-profile"],queryFn:OO,enabled:t}),see=t=>Jh("/profile/discoveries","POST",{url:t}),iee=({discoveryId:t,collectionIds:e,runtime:n})=>Jh("/profile/import-plans","POST",{discoveryId:t,collectionIds:e,runtime:n}),oee=t=>Jh("/profile","PATCH",{isEnabled:!0,runtime:t}),aee=t=>Jh(`/profile/import-plans/${t.id}/imports`,"POST",{revision:t.revision,isApproved:!0}),Ix=Kn().regex(/^[1-9]\d{0,15}$/).refine(t=>Number.isSafeInteger(Number(t))),lee=Kn().min(1).max(4096),LO=t=>{const e=()=>new Error("Use an HTTPS Cosmos profile URL such as https://www.cosmos.so/username");let n;try{n=new URL(t)}catch{throw e()}const r=n.pathname.split("/").filter(Boolean);if(n.protocol!=="https:"||n.username||n.password||n.port||!["cosmos.so","www.cosmos.so"].includes(n.hostname)||r.length!==1)throw e();let s;try{s=decodeURIComponent(r[0])}catch{throw e()}if(!/^[a-zA-Z0-9_.-]{1,100}$/.test(s)||["e","login","signup","explore","search","collections","settings","api","profile"].includes(s.toLowerCase()))throw e();return{username:s,url:`https://www.cosmos.so/${encodeURIComponent(s)}`}};Kn().max(2048).transform((t,e)=>{try{return LO(t).url}catch(n){return e.addIssue({code:we.custom,message:n instanceof Error?n.message:"Invalid Cosmos profile URL"}),HG}});const cee=t=>{const e=()=>new Error("Use an HTTPS Cosmos collection URL such as https://www.cosmos.so/owner/collection");let n;try{n=new URL(t)}catch{throw e()}const r=n.pathname.split("/").filter(Boolean);if(n.protocol!=="https:"||n.username||n.password||n.port||!["cosmos.so","www.cosmos.so"].includes(n.hostname)||r.length<2||r.length>3||r[0]==="e")throw e();let s;try{s=r.map(i=>decodeURIComponent(i))}catch{throw e()}if(s.some(i=>!i.length||i.length>300||/[/\\\p{Cc}]/u.test(i)))throw e();return{ownerUsername:s[0],slug:s[1],subcollectionSlug:s[2],url:`https://www.cosmos.so/${s.map(encodeURIComponent).join("/")}`}},uee=Kn().url().refine(t=>{const e=new URL(t);return e.protocol==="https:"&&e.hostname==="cdn.cosmos.so"&&!e.username&&!e.password&&!e.port}),dee=mc({id:Ix,title:Kn().min(1).max(500),url:Kn().url().transform(t=>cee(t).url),children:db(Ix)}),fee=mc({id:Ix,url:Kn().url(),title:Kn().max(1e3),text:Kn().max(1e5),author:Kn().nullable(),owner:Kn().nullable(),sourceUrl:Kn().url().nullable(),images:db(mc({url:uee,representation:fb(["image","video-cover"])})).max(100),unsupportedReason:Kn().optional()}),hee=mc({collection:dee,elements:db(fee),total:II().int().nonnegative(),nextCursor:lee.nullable()});VG("status",[hee.extend({status:vC("ok")}),mc({status:vC("error"),message:Kn(),reason:fb(["rate_limited","provider_unavailable","collection_unavailable"]).optional(),retryAfterMs:II().nonnegative().optional()})]);const pee=({isOpen:t,onClose:e,onImported:n})=>{const[r,s]=m.useState(""),[i,o]=m.useState(null),[l,u]=m.useState([]),[d,f]=m.useState(""),[p,g]=m.useState(null),[v,x]=m.useState(null),[_,w]=m.useState(!1),b=m.useRef(0),E=Xi(),C=()=>{b.current+=1,s(""),o(null),u([]),f(""),g(null),x(null),w(!1)},R=()=>{E==null||E.capture("visual_editor_cosmos_modal_closed"),C(),e()},A=async M=>{M.preventDefault(),x(null);let N;try{N=LO(r.trim()).url}catch($){x($ instanceof Error?$.message:"Invalid Cosmos profile URL");return}E==null||E.capture("visual_editor_cosmos_discovery_started");const j=++b.current;w(!0);try{const $=await see(N);if(j!==b.current)return;o($),u([]),E==null||E.capture("visual_editor_cosmos_discovery_completed",{collection_count:$.collections.length})}catch($){if(j!==b.current)return;x($ instanceof Error?$.message:"Could not find Cosmos profile"),E==null||E.capture("visual_editor_cosmos_discovery_failed")}finally{j===b.current&&w(!1)}},O=async()=>{if(!i||l.length===0||!d)return;x(null),E==null||E.capture("visual_editor_cosmos_plan_started",{collection_count:l.length,runtime:d});const M=++b.current;w(!0);try{const N=await iee({discoveryId:i.id,collectionIds:l,runtime:d});if(M!==b.current)return;g(N),E==null||E.capture("visual_editor_cosmos_plan_completed",{collection_count:N.collectionCount,reference_count:N.referenceCount})}catch(N){if(M!==b.current)return;x(N instanceof Error?N.message:"Could not prepare import plan"),E==null||E.capture("visual_editor_cosmos_plan_failed")}finally{M===b.current&&w(!1)}},I=async()=>{if(!p||!d)return;x(null),E==null||E.capture("visual_editor_cosmos_import_started",{collection_count:p.collectionCount,reference_count:p.referenceCount});const M=++b.current;w(!0);try{if((await OO()).profile.isEnabled||await oee(d),await aee(p),E==null||E.capture("visual_editor_cosmos_import_completed",{reference_count:p.referenceCount}),n(),M!==b.current)return;C(),e()}catch(N){if(E==null||E.capture("visual_editor_cosmos_import_failed"),M!==b.current)return;x(N instanceof Error?N.message:"Could not start Cosmos import")}finally{M===b.current&&w(!1)}},T=M=>{u(N=>N.includes(M)?N.filter(j=>j!==M):[...N,M]),E==null||E.capture("visual_editor_cosmos_collection_toggled")};return S.jsx(Kg,{open:t,onOpenChange:M=>!M&&R(),children:S.jsxs(Yg,{children:[S.jsx(Xg,{className:"z-max fixed inset-0 bg-black/60"}),S.jsxs(Qg,{className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 max-h-[min(680px,calc(100vh-32px))] w-[min(440px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-lg border shadow-2xl outline-none",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(Jg,{className:"text-content text-base font-medium",children:"Connect Cosmos"}),S.jsx(Zi,{onClick:R,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:S.jsx(ob,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"space-y-4 p-4",children:[S.jsx(ev,{className:"text-content-subtle text-sm",children:"Add public collections from a Cosmos profile to your design references."}),i?null:S.jsxs("form",{onSubmit:M=>void A(M),className:"space-y-4",children:[S.jsx("label",{className:"text-content block text-sm font-medium",htmlFor:"cosmos-profile-url",children:"Cosmos profile URL"}),S.jsx("input",{id:"cosmos-profile-url",type:"url",required:!0,autoFocus:!0,value:r,onChange:M=>s(M.target.value),placeholder:"https://www.cosmos.so/username",className:"border-main-border bg-main-input text-content placeholder:text-content-muted focus:border-secondary w-full rounded-md border px-3 py-2 text-sm outline-none"}),S.jsx("button",{type:"submit",disabled:_,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50",children:_?"Finding collections…":"Continue"})]}),i&&!p?S.jsxs("div",{className:"space-y-4",children:[S.jsxs("p",{className:"text-content text-sm font-medium",children:["Choose collections from"," ",i.profile.title||i.profile.username]}),S.jsx("div",{className:"border-main-border max-h-60 divide-y overflow-y-auto rounded-md border",children:i.collections.map(M=>S.jsxs("label",{className:"text-content hover:bg-main-light flex cursor-pointer items-center gap-3 px-3 py-2 text-sm",children:[S.jsx("input",{type:"checkbox",checked:l.includes(M.id),disabled:_,onChange:()=>T(M.id)}),S.jsx("span",{className:"min-w-0 flex-1 truncate",children:M.title}),S.jsx("span",{className:"text-content-muted text-xs",children:M.total??"—"})]},M.id))}),i.collections.length===0?S.jsx("p",{className:"text-content-muted text-sm",children:"No public collections found for this profile."}):null,S.jsxs("label",{className:"text-content flex items-center justify-between gap-3 text-sm",children:["Analysis runtime",S.jsxs("select",{value:d,disabled:_,onChange:M=>{const N=M.target.value;f(N),E==null||E.capture("visual_editor_cosmos_runtime_selected",{runtime:N})},className:"border-main-border bg-main-input rounded-md border px-2 py-1.5",children:[S.jsx("option",{value:"",disabled:!0,children:"Select a runtime"}),S.jsx("option",{value:"codex",children:"Codex"}),S.jsx("option",{value:"claude",children:"Claude"}),S.jsx("option",{value:"cursor",children:"Cursor"})]})]}),S.jsx("button",{type:"button",onClick:()=>void O(),disabled:_||l.length===0||!d,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50",children:_?"Preparing plan…":"Review import plan"}),S.jsx("button",{type:"button",onClick:()=>{E==null||E.capture("visual_editor_cosmos_profile_changed"),C()},disabled:_,className:"text-content-muted hover:text-content ml-3 text-sm",children:"Use another profile"})]}):null,p?S.jsxs("div",{className:"space-y-4 text-sm",children:[S.jsxs("p",{className:"text-content",children:[p.collectionCount," ",p.collectionCount===1?"collection":"collections"," ·"," ",p.referenceCount," ",p.referenceCount===1?"reference":"references"," ·"," ",p.imageCount," ",p.imageCount===1?"image":"images"]}),S.jsx("p",{className:"text-content-subtle",children:p.scopeDisclosure}),S.jsx("p",{className:"text-content-subtle",children:p.usageDisclosure}),S.jsxs("p",{className:"text-content-muted text-xs",children:[p.reusableCount," reusable · ",p.unsupportedCount," ","unsupported · runtime: ",d]}),S.jsx("button",{type:"button",onClick:()=>void I(),disabled:_,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-4 py-2 text-sm font-medium disabled:opacity-50",children:_?"Starting import…":"Approve and import"}),S.jsx("button",{type:"button",onClick:()=>{E==null||E.capture("visual_editor_cosmos_plan_revised"),g(null)},disabled:_,className:"text-content-muted hover:text-content ml-3 text-sm",children:"Change selection"})]}):null,v?S.jsx("p",{role:"alert",className:"text-sm text-red-300",children:v}):null]})]})]})})},m3=Rs("ConnectorsModal"),mee=[{provider:"x",name:"X",iconClassName:"text-content",icon:S.jsx(Wf,{provider:"x"})},{provider:"pinterest",name:"Pinterest",iconClassName:"text-[#e60023]",icon:S.jsx(Wf,{provider:"pinterest"})},{provider:"arena",name:"Are.na",iconClassName:"text-content",icon:S.jsx(Wf,{provider:"arena"})}],gee={name:"Cosmos",iconClassName:"text-content",icon:S.jsx(Wf,{provider:"cosmos"})},g3=({meta:t,status:e,actionLabel:n,buttonLabel:r,isDisabled:s,isHighlighted:i,onAction:o})=>S.jsxs("li",{className:`flex min-h-[64px] items-center gap-3 py-3 ${i?"ring-secondary -mx-2 rounded-md px-2 ring-2":""}`,children:[S.jsx("span",{className:`grid h-7 w-7 flex-none place-items-center ${t.iconClassName}`,"aria-hidden":"true",children:t.icon}),S.jsxs("div",{className:"min-w-0 flex-1",children:[S.jsx("span",{className:"text-content block text-sm font-medium",children:t.name}),S.jsx("span",{className:"text-content-muted block truncate text-xs",children:e})]}),S.jsx("button",{type:"button","aria-label":n,onClick:o,disabled:s,className:"active-push bg-main-input text-content hover:bg-main-input/80 inline-flex min-h-8 w-24 flex-none items-center justify-center rounded-md px-3 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:r})]}),Mx=({isOpen:t,onClose:e,context:n="menu",highlightProvider:r=null})=>{var O;const{integrations:s,isLoading:i,error:o,pendingProvider:l,connect:u,disconnect:d}=nee(),f=Xi(),[p,g]=m.useState(null),[v,x]=m.useState(!1),_=ree(t),w=I=>s.find(T=>T.provider===I),b=m.useCallback(I=>{const T=Date.now(),M=Il({action:"connect",outcome:"started",provider:I,entryPoint:n});f==null||f.capture(M.event,M.properties),u(I).then(N=>{const j=Date.now()-T;if(N==="connected"){const K=Il({action:"connect",outcome:"completed",provider:I,entryPoint:n,durationMs:j});f==null||f.capture(K.event,K.properties);return}const $=Il({action:"connect",outcome:"failed",provider:I,entryPoint:n,durationMs:j,failureReason:N==="closed"?"popup_closed":"provider_failed"});f==null||f.capture($.event,$.properties)}).catch(N=>{const j=N instanceof Error?N.message:"Could not connect.",$=Il({action:"connect",outcome:"failed",provider:I,entryPoint:n,durationMs:Date.now()-T,failureReason:j.includes("Popup blocked")?"popup_blocked":"request_failed"});f==null||f.capture($.event,$.properties),m3.warn(`Connect error for ${I}:`,j),At.error(j)})},[u,n,f]),E=m.useCallback(I=>{const T=Date.now(),M=Il({action:"disconnect",outcome:"started",provider:I,entryPoint:n});f==null||f.capture(M.event,M.properties),d(I).then(()=>{const N=Il({action:"disconnect",outcome:"completed",provider:I,entryPoint:n,durationMs:Date.now()-T});f==null||f.capture(N.event,N.properties)}).catch(N=>{const j=N instanceof Error?N.message:"Could not disconnect.",$=Il({action:"disconnect",outcome:"failed",provider:I,entryPoint:n,durationMs:Date.now()-T,failureReason:"request_failed"});f==null||f.capture($.event,$.properties),m3.warn(`Disconnect error for ${I}:`,j),At.error(j)})},[n,d,f]),C=n==="onboarding",R=(O=_.data)==null?void 0:O.sources.some(I=>I.provider==="cosmos");let A=R?"Connected":"Not connected";return _.isError&&(A="Status unavailable"),_.isPending&&(A="Checking status…"),S.jsxs(S.Fragment,{children:[S.jsx(Kg,{open:t,onOpenChange:I=>!I&&e(),children:S.jsxs(Yg,{children:[S.jsx(Xg,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(Qg,{ref:g,className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[min(440px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:S.jsxs(MM,{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(Jg,{className:"text-content text-base font-medium",children:"Connect design references"}),S.jsx(Zi,{onClick:e,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:S.jsx(ob,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[S.jsx(ev,{className:"text-content-subtle text-sm",children:"Connect your references to add them to your Rivet library. Rivet can use them to inspire new design directions."}),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.jsxs("ul",{className:"divide-main-border divide-y","aria-label":"Design reference services",children:[mee.map(I=>{const T=w(I.provider),M=(T==null?void 0:T.status)==="connected",N=T==null?void 0:T.externalUsername;let j=M?`Connected${N?` as @${N}`:""}`:"Not connected";i&&(j="Checking status…");const $=l===I.provider,K=M?"Disconnect":"Connect";return S.jsx(g3,{meta:I,status:j,actionLabel:`${K} ${I.name}`,buttonLabel:$?`${K}ing…`:K,isDisabled:i||$,isHighlighted:r===I.provider,onAction:()=>M?E(I.provider):b(I.provider)},I.provider)}),S.jsx(g3,{meta:gee,status:A,actionLabel:R?"Add Cosmos profile":"Connect Cosmos",buttonLabel:R?"Add profile":"Connect",isDisabled:!1,isHighlighted:!1,onAction:()=>{f==null||f.capture("visual_editor_cosmos_modal_opened"),x(!0)}})]}),C?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]})]})})]})}),S.jsx(pee,{isOpen:v,onClose:()=>x(!1),onImported:()=>{_.refetch()}})]})},v3=({className:t=""})=>S.jsx("span",{"aria-hidden":"true",className:`rivet-skeleton block rounded ${t}`.trim()}),vee=Rs("SupportTicketModal"),y3=5e3,m_="feedback",yee=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},_ee=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=yee(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}`},xee=({isOpen:t,onClose:e,contactEmail:n})=>{const r=Xi(),[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 w=s.trim();if(!(!w||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 Ka("/api/support/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:m_,message:w,contactEmail:C||void 0,metadata:{posthogSessionId:b??void 0,posthogDistinctId:E??void 0,appVersion:"0.19.0",appEnvironment:"production",pageUrl:window.location.href,userAgent:navigator.userAgent,submittedAt:new Date().toISOString()}})});if(!R.ok){const A=await _ee(R);throw new Error(A)}r==null||r.capture("support_ticket_submitted",{ticket_type:m_,has_posthog_session_id:!!b}),At.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:m_,error:E}),vee.error("Failed to submit support ticket:",E),At.error("Could not send feedback",{description:E})}finally{l(!1)}}},[n,o,s,e,r,f]),v=m.useCallback(w=>{w.key==="Enter"&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),g())},[g]),x=y3-s.length,_=o||s.trim().length===0;return S.jsx(Kg,{open:t,onOpenChange:w=>!w&&p(),children:S.jsxs(Yg,{children:[S.jsx(Xg,{className:"z-max fixed inset-0 bg-black/40"}),S.jsx(Qg,{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(MM,{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(Jg,{className:"text-content text-base font-medium",children:"Send feedback"}),S.jsx(Zi,{onClick:p,disabled:o,title:"Close","aria-label":"Close",variant:"ghost",size:"icon-compact",children:S.jsx(ob,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(ev,{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:w=>i(w.target.value),onKeyDown:v,maxLength:y3,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:[x<=500&&S.jsx("span",{className:"text-content-subtle text-xs",children:x}),S.jsx(Zi,{onClick:g,disabled:_,title:"Send feedback",shortcut:"⌘↵","aria-label":"Send feedback",size:"icon-compact",children:o?S.jsx(Fg,{className:"h-5 w-5 animate-spin",weight:"bold"}):S.jsx(aq,{className:"h-5 w-5",weight:"bold"})})]})]})]})]})]})})]})})},wee=Rs("ProfileAvatar"),NO=(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):""},bee=(t,e)=>NO(t,e).charAt(0).toUpperCase(),See=({className:t="",side:e="bottom",align:n="end"})=>{var K,B,z;const r=qJ(),s=((K=r.data)==null?void 0:K.name)??null,i=((B=r.data)==null?void 0:B.email)??null,o=((z=r.data)==null?void 0:z.isAuthenticated)===!0,l=Xi(),{startLogin:u,isStartingLogin:d,loginError:f}=MO("account_menu"),[p,g]=m.useState(!1),[v,x]=m.useState(!1),[_,w]=m.useState(!1),[b,E]=m.useState(!1),{containerRef:C,onKeyDown:R,onCloseAutoFocus:A}=rO({onDismiss:()=>$(!1)}),O=bee(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(v3,{className:"h-8 w-8 rounded-full"}),S.jsx(v3,{className:"h-3.5 w-16"})]});const I=NO(s,i),T=(s==null?void 0:s.trim())||null,M=(i==null?void 0:i.trim())||null,N=async()=>{E(!0);try{const Z=await Ka("/api/auth/logout",{method:"POST",credentials:"same-origin"});if(!Z.ok)throw new Error(`Logout failed: ${Z.status}`)}catch(Z){wee.warn("Logout request failed",Z),At.error("Could not log out. Please try again."),E(!1);return}window.location.reload()};let j="Log in";o&&(j=I||"Account"),r.error&&!r.data&&(j="Account unavailable");const $=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(Nb,{open:p,onOpenChange:$,children:[S.jsx(Db,{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:O||S.jsx(xq,{className:"h-4 w-4",weight:"bold"})}),S.jsx("span",{className:"max-w-[8rem] truncate text-sm font-medium",children:j})]})}),S.jsx(jb,{children:S.jsxs($b,{"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||M?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,M?S.jsx("div",{className:"text-content-muted truncate text-xs",children:M}):null]}):null,S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{$(!1),x(!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(iI,{className:"h-4 w-4",weight:"bold"}),"Connect design references"]}),S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{$(!1),w(!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(uq,{className:"h-4 w-4",weight:"bold"}),"Share feedback"]}),o?S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:N,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(yq,{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(vq,{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(Mx,{isOpen:!0,onClose:()=>x(!1)}):null,S.jsx(xee,{isOpen:_,onClose:()=>w(!1),contactEmail:i??void 0})]})},kee=({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(ZJ,{onClose:t}),S.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:S.jsx(SJ,{})}),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(See,{side:"top",align:"start"})})]});async function Eee(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 _3=Rs("useServerConfig"),DO=[250,500,1e3,2e3,4e3],x3=DO.length+1,Cee=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}},Pee=()=>{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 Eee(Cee,{delaysMs:DO,onRetry:(u,d,f)=>{_3.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),_3.warn("Error fetching server config:",l),l}finally{r(!1)}},[]);return{config:t,fetchConfig:o,isLoading:n,error:s}},Ree="#1C1C20",vo=[118,118,124],w3=.85,Aee=3,Tee=.15,$0=36,Iee=4.4,Mee=.7,Oee=3.5,Lee=.8,b3=9,Nee=11,Dee=[1.35,1.12,.95,.85],jee=[0,1.1,2.3,3.1],$ee=[0,.35,.16,.13],Fee=[.9,.5,.4,.35],Ml=3,g_=[[{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}]],F0=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},fm=t=>{const e=Math.min(1,Math.max(0,t));return e*e*(3-2*e)},Ol=(t,e)=>(Math.round(t/e-.5)+.5)*e,Vee=Math.sin(Math.PI/3),S3=(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*Vee;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()},Hee=(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)-b3}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)-b3}return fm(.5-r/(2*Nee))},jO=({className:t="",trackGlobalLoaderCount:e=!0})=>{const n=gt(dO),r=m.useRef(null),s=m.useCallback(i=>{var N;if((N=r.current)==null||N.call(r),r.current=null,!i)return;const o=i.getContext("2d");if(!o)return;e&&n(j=>j+1);const l=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let u=[],d=0,f=0,p=$0,g=$0,v=null,x=null,_=0,w=-1;const b=new Array(33),E=j=>{const $=Math.round(j*32);let K=b[$];if(!K){const B=$/32,z=Math.round(vo[0]+(255-vo[0])*B),Z=Math.round(vo[1]+(255-vo[1])*B),Q=Math.round(vo[2]+(255-vo[2])*B);K=`rgba(${z}, ${Z}, ${Q}, ${w3})`,b[$]=K}return K},C=j=>{const $=1-.35*j,K=Math.round(vo[0]*$),B=Math.round(vo[1]*$),z=Math.round(vo[2]*$);return`rgba(${K}, ${B}, ${z}, ${w3})`},R=j=>{let $=Math.floor(Math.random()*g_.length);$===w&&($=($+1)%g_.length),w=$;const K=[0,0,0,0],B=g_[$].map((D,X)=>{const oe=D.level,re=K[oe]++,se=jee[oe]+re*$ee[oe],fe=Fee[oe]+F0($*131+X*17+5)*.2;if(D.hline){const ae=Ol((D.y??0)*f,g);return{hline:!0,x1:Ol(D.x1*d,p),x2:Ol(D.x2*d,p),y1:ae,y2:ae,level:oe,start:se,dur:fe}}const _e=Ol(D.x1*d,p),de=Ol((D.y1??0)*f,g);return{hline:!1,x1:_e,y1:de,x2:Math.max(Ol(D.x2*d,p),_e+p),y2:Math.max(Ol((D.y2??0)*f,g),de+g),level:oe,start:se,dur:fe}}),z=B.reduce((D,X)=>Math.max(D,X.start+X.dur),0),Z=u.length,Q=new Float32Array(Z*Ml),U=new Int16Array(Z*Ml).fill(-1),ee=new Uint8Array(Z),W=B[0];for(let D=0;D<Z;D++){const X=u[D];X.x>W.x1&&X.x<W.x2&&X.y>W.y1&&X.y<W.y2&&(ee[D]=1);const oe=D*Ml;for(let re=0;re<B.length;re++){const se=Hee(X.x,X.y,B[re]);if(se<=.02)continue;let fe=oe;for(let _e=oe;_e<oe+Ml;_e++){if(U[_e]===-1){fe=_e;break}Q[_e]<Q[fe]&&(fe=_e)}(U[fe]===-1||se>Q[fe])&&(Q[fe]=se,U[fe]=re)}}return{startT:j,buildEnd:z,els:B,frame:W,cellQ:Q,cellEl:U,inFrame:ee}},A=()=>{const j=i.getBoundingClientRect();d=Math.max(1,j.width),f=Math.max(1,j.height);const $=Math.min(2,window.devicePixelRatio||1);i.width=Math.round(d*$),i.height=Math.round(f*$),o.setTransform($,0,0,$,0,0);const K=Math.max(8,Math.round(d/$0)),B=Math.max(6,Math.round(f/$0));p=d/K,g=f/B,u=[];for(let z=0;z<B;z++){const Z=B>1?z/(B-1):.5,Q=Iee*(1+Mee*.4*(Z*2-1));for(let U=0;U<K;U++){const ee=z*8191+U*131+1,W={x:(U+.5)*p,y:(z+.5)*g,size:Q,seed:ee,phase:F0(ee),kind:0};W.kind=Math.floor(F0(ee*97)*3),u.push(W)}}x=null,v=null},O=new Float32Array(32),I=j=>{o.fillStyle=Ree,o.fillRect(0,0,d,f),v||(v=R(j+.2)),j>=v.startT+v.buildEnd+Oee&&(x=v,_=j,v=R(j+.2));let $=0;x&&($=1-fm((j-_)/Lee),$<=0&&(x=null));const K=v;for(let W=0;W<K.els.length;W++){const D=K.els[W];O[W]=fm(Math.min(1,Math.max(0,(j-K.startT-D.start)/D.dur)))}const B=O[0],z=C(0),Z=C(B),Q=$>0?C($):z,U=$>0?C(Math.max(B,$)):Z,ee=u.length;for(let W=0;W<ee;W++){const D=u[W];let X=0,oe=0;const re=W*Ml;for(let ke=re;ke<re+Ml;ke++){const Ge=K.cellEl[ke];if(Ge<0)break;const vt=K.cellQ[ke]*O[Ge];vt>X&&(X=vt,oe=K.els[Ge].level)}if(x)for(let ke=re;ke<re+Ml;ke++){const Ge=x.cellEl[ke];if(Ge<0)break;const vt=x.cellQ[ke]*$;vt>X&&(X=vt,oe=x.els[Ge].level)}const se=j/Aee+D.phase,fe=Math.floor(se),_e=se-fe,de=fm(Math.min(_e,1-_e)/Tee),ae=Math.floor(F0(D.seed*97+fe*7919)*3);ae!==D.kind&&X<.02&&de<.05&&(D.kind=ae);const Oe=Math.max(de*(1-X),X);if(!(Oe<.01))if(X<.02){const ke=K.inFrame[W]===1,Ge=x?x.inFrame[W]===1:!1;ke?o.fillStyle=Ge?U:Z:o.fillStyle=Ge?Q:z;const vt=Math.max(ke?B:0,Ge?$:0);S3(o,D.kind,D.x,D.y,D.size*Oe*(1-.2*vt))}else{o.fillStyle=E(X);const ke=1+(Dee[oe]-1)*X;S3(o,D.kind,D.x,D.y,D.size*Oe*ke)}}};A();let T=0;if(l)v=R(-100),I(0);else{const j=performance.now(),$=K=>{I((K-j)/1e3),T=requestAnimationFrame($)};T=requestAnimationFrame($)}const M=new ResizeObserver(()=>{A(),l&&(v=R(-100),I(0))});M.observe(i),r.current=()=>{cancelAnimationFrame(T),M.disconnect(),e&&n(j=>j-1)}},[e,n]);return S.jsx("canvas",{ref:s,"aria-hidden":"true",className:`h-full w-full ${t}`.trim()})},zee=async(t=null)=>{if(t)return Uee(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 V0();if(!e.ok)return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null};let r;try{r=await e.json()}catch{return V0()}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}:V0()},$O=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}}},Uee=t=>$O(t),V0=()=>$O("/"),v_=Rs("usePreviewUpstreamHealth"),Bee=500,Zee=4e3,Wee=15e3,qee=3,Gee=(t,e={})=>{const n=m.useRef(null),r=m.useRef(null),s=e.probeMsWhileDown??Bee,i=e.probeMsWhileUp??Zee,o=e.firstUnreachableCaptureAfterMs??Wee,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,x]=m.useState(0),[_,w]=m.useState(null),[b,E]=m.useState(0),[C,R]=m.useState(!1),[A,O]=m.useState(!1),[I,T]=m.useState(t==="static"?null:"upstream_unreachable");return m.useEffect(()=>{if(t==="static"){g(!0),w(null),E(0),R(!1),O(!0),T(null);return}if(d){g(!1),w(null),E(0),R(!1),O(!0),T("upstream_unreachable"),n.current=null;return}let M=!0;const N=Date.now();w(N),E(0),R(!1),g(!1),O(!1),T("upstream_unreachable");const j={current:!1},$={current:!1},K={current:!1},B={current:null},z={current:!1},Z={current:!1},Q={current:0},U={current:!1},ee={current:null};let W=null;const D=()=>{K.current||(K.current=!0,M&&O(!0))},X=()=>{W!==null&&(clearTimeout(W),W=null)},oe=(se,fe)=>{X(),W=setTimeout(fe,se)},re=async()=>{var vt;if(!M)return;E(Mt=>Mt+1);const{isOk:se,unavailableReason:fe,upstreamStatus:_e}=await zee(u);if(!M)return;D(),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>=qee;if(ae&&!U.current&&_e!==null&&(U.current=!0,Ce==null||Ce.capture("preview_upstream_error_responses",{framework:t,upstream_status:_e,consecutive_count:Q.current}),v_.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,U.current=!1);const Mt=!z.current;z.current=!0,g(!0),T(null),B.current=null,$.current=!1,R(!1),j.current?Mt&&(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()-N})),oe(i,re);return}const ke=z.current;z.current=!1,g(!1),T(fe),B.current===null&&(B.current=Date.now(),$.current=!1,R(!1)),ke&&(Ce==null||Ce.capture("preview_upstream_lost",{framework:t,upstream_status:_e}),x(Mt=>Mt+1),v_.warn("Preview upstream became unavailable after it was ready"));const Ge=Date.now()-B.current;Ge>=o&&!$.current&&($.current=!0,R(!0),Ce==null||Ce.capture("preview_dev_server_unreachable",{framework:t,elapsed_ms:Ge,upstream_status:ee.current}),v_.warn("Dev server did not become ready within timeout window")),oe(s,re)};return n.current=()=>oe(0,re),oe(0,re),()=>{M=!1,n.current=null,X()}},[t,s,i,o,u,d]),m.useEffect(()=>{var N;if(t==="static"||l===void 0)return;const M=r.current;r.current=l,M!==null&&M!==l&&((N=n.current)==null||N.call(n))},[t,l]),{isUpstreamReady:p,iframeRemountKey:v,probeStartedAt:_,probeAttemptCount:b,isFirstUnreachableWindowExceeded:C,initialProbeComplete:A,unavailableReason:I}};function Kee(t){return t.enteringSplit&&t.isExistingSession&&t.hasActiveVariantProxy}const FO=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}`},VO=({agentApplyMode:t,url:e})=>e.startsWith("/")?`${FO(t)}${e}`:e,Yee="allow-scripts allow-same-origin allow-forms allow-popups allow-modals",Xee=t=>Yee,Qee=Rs("PreviewSurface"),k3=(t,e)=>t==="about:blank"?"blank":t.includes("/api/variants/")?"static_artifact":e.kind==="variant"?"dev_server":"original",HO=({target:t,src:e,framework:n,remountKey:r})=>(ct(rv),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:Xee(),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:k3(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:k3(e,t),framework:n})),Qee.warn("Preview iframe failed to load",{framework:n,src:e})}},r)})),Jee=m.lazy(()=>gP(()=>Promise.resolve().then(()=>Lne),void 0)),ete={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"},tte={sm:"text-lg font-semibold text-content",md:"text-2xl font-semibold text-content",lg:"text-3xl font-semibold text-content"},nte={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"},Iu=({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]),x=!!(e||n||r||u||s!=null&&s.length);return S.jsxs("div",{ref:v,className:`${ete[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,x?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:tte[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:nte[_.variant??"neutral"],children:_.label},_.label))}):null]}):null]})},Ox=({loader:t="coalesce",trackGlobalLoaderCount:e,size:n="lg",...r})=>t==="coalesce"?S.jsx(Iu,{...r,size:n,busy:!0,backdrop:S.jsx(jO,{trackGlobalLoaderCount:e})}):t==="logo"?S.jsx(Iu,{...r,size:n,busy:!0,backdrop:S.jsx(m.Suspense,{fallback:null,children:S.jsx(Jee,{className:"absolute inset-0"})})}):S.jsx(Iu,{...r,size:n,busy:!0,media:S.jsx(Fg,{"aria-hidden":!0,className:"text-content h-8 w-8 shrink-0 animate-spin",weight:"bold"})}),zO=({icon:t,...e})=>S.jsx(Iu,{...e,tone:"neutral",media:t?S.jsx("div",{className:"text-content-muted",children:t}):void 0}),Ub=t=>S.jsx(Iu,{...t,tone:"error",role:"alert"}),E3="/static/",rte=t=>{try{return new URL(t,"http://localhost").pathname.endsWith(E3)}catch{return t.endsWith(E3)}},ste=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.",ite=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:ste(t.previewUnavailable.reason),detail:t.previewUnavailable.portInUse?"The preview port was already in use.":void 0,isError:!0}:null,ote=({issue:t,retryTarget:e})=>{const n=Xi(),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(Iu,{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]})},ate=({isInteractionDisabled:t=!1,framework:e,userPort:n})=>{var yt;const r=ct(Sx),s=gt(Sx),i=ct(pg),o=gt(pg),l=ct(Qh),u=ct(rv),d=ct(kx),f=ct(Ex),p=ct(fO),g=ct(hO),v=gt(Ex),x=ct(zo),_=ct(dm),w=gt(kx),b=l.active&&l.projectContext.kind==="fresh",E=ct(Cx),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,O=l.active?l.variants.find(We=>We.workItemId===E)??null:null,I=O?ite(O):null,T=e==="static"&&i!==null&&rte(i);m.useEffect(()=>{l.active||w(!1)},[l.active,w]);const M=m.useRef(!1);m.useEffect(()=>{const We=!!(x!=null&&x.left||x!=null&&x.right),Ke=We&&!M.current;M.current=We;const St=l.active?l.sessionId:null;!St||!Kee({enteringSplit:Ke,isExistingSession:l.active&&l.projectContext.kind==="existing",hasActiveVariantProxy:d&&f!==null})||(w(!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(()=>{}))},[x,l,d,f,w,v,s]);const j=m.useMemo(()=>{var Ot;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,rs;return((kt=qe.refinement)==null?void 0:kt.status)==="pending"||((rs=qe.refinement)==null?void 0:rs.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((Ot=Ye==null?void 0:Ye.preview)==null?void 0:Ot.kind)==="static_artifact"?Ye.preview.url:null},[T,i,d,l])??i,$=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]),K=m.useMemo(()=>{if((_==null?void 0:_.previewKind)==="static")return{kind:"variant",sessionId:_.sessionId,variantId:_.variantId};if(!l.active)return hg;if($)return{kind:"variant",sessionId:l.sessionId,variantId:$.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\/([^/?#]+)/),Ot=Ye!=null&&Ye[1]?decodeURIComponent(Ye[1]):null;if(Ot&&l.variants.some(qe=>qe.workItemId===Ot))return{kind:"variant",sessionId:l.sessionId,variantId:Ot}}const We=!!(x!=null&&x.left||x!=null&&x.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}:hg},[_,$,l,d,f,j,x,b,E]),B=m.useRef(null);m.useEffect(()=>{var Re,Ye;if(!$||((Re=$.preview)==null?void 0:Re.kind)!=="static_artifact"||((Ye=$.refinement)==null?void 0:Ye.status)!=="succeeded")return;const We=`${$.workItemId}:${$.refinement.workItemId}`;if(B.current===We)return;B.current=We;const Ke=$.preview.url.includes("?")?"&":"?",St=`${$.preview.url}${Ke}refinement=${encodeURIComponent($.refinement.workItemId)}`;j!==St&&(o(St),s(Ot=>Ot+1))},[j,$,s,o,l]);const z=j!==null&&pJ(j),Z=j!==null&&!z||b&&!d&&!z,{isUpstreamReady:Q,iframeRemountKey:U,probeAttemptCount:ee,initialProbeComplete:W}=Gee(e,{rerunProbeImmediatelyOnVersion:r,probePath:z?j:null,skip:Z}),[D,X]=m.useState(()=>p&&Q?r:null),oe=m.useRef(null);m.useEffect(()=>{if(!p){oe.current=null,X(null);return}if(D===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))},[D,r,p,ee,Q]);const se=j!==null&&!z||Q,_e=g||p&&D!==r||p&&!se,de=`${U}:${r}`,ae=xO(window.location.pathname),Oe=e==="static"?`/static${ae??"/"}`:ae??"/",ke=FO(u);let Ge=null;j&&(Ge=VO({agentApplyMode:u,url:j}));const Mt=C||I||_e?"about:blank":(z&&!se?"about:blank":Ge)??(se?`${ke}${Oe}`:"about:blank"),Xt=!!C||!!I||!se&&W;let xt=null;if(_e)xt=S.jsx(Ox,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"preview_replay_boot"});else if(C)xt=S.jsx(Ox,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"variant_building",children:S.jsx("span",{className:"sr-only",children:"Building your direction"})});else if(I){const We=l.active&&O&&I.state==="preview_unavailable"&&((yt=O.previewUnavailable)==null?void 0:yt.reason)!=="missing_static_entry"?{sessionId:l.sessionId,variantId:O.workItemId}:void 0;xt=S.jsx(ote,{issue:I,retryTarget:We},O==null?void 0:O.workItemId)}else Xt&&(xt=A?S.jsx(zO,{fill:"overlay",state:"preview_no_selection",title:"Nothing to preview yet",description:"Pick a direction from the panel."}):S.jsx(Ub,{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:[xt,S.jsx(HO,{target:K,src:Mt,framework:e,remountKey:de})]})})};function C3({side:t,sessionId:e,variantId:n,url:r,label:s,source:i,isFallback:o=!1}){var C;const l=ct(zo),u=gt(zo),d=Xi(),f=ct(Qh),p=ct(rv),g=m.useRef(!1),v=m.useCallback(()=>{g.current||(g.current=!0,id({source:i,sessionId:e,variantId:n}))},[i,e,n]),x=m.useCallback(()=>{if(o){u(null);const I=mg("ended",l);d==null||d.capture(I.event,I.properties);return}v();const R={...l};delete R[t];const A=R.left||R.right?R:null;u(A);const O=mg(A?"updated":"ended",A??l);d==null||d.capture(O.event,O.properties)},[o,d,u,t,l,v]),_=m.useMemo(()=>({kind:"variant",sessionId:e,variantId:n}),[e,n]),w=m.useMemo(()=>!f.active||f.sessionId!==e?null:f.variants.find(R=>R.workItemId===n)??null,[e,n,f]),b=m.useMemo(()=>{var A,O;let R=r;if(((A=w==null?void 0:w.preview)==null?void 0:A.kind)==="static_artifact"&&((O=w.refinement)==null?void 0:O.status)==="succeeded"){const I=w.preview.url.includes("?")?"&":"?";R=`${w.preview.url}${I}refinement=${encodeURIComponent(w.refinement.workItemId)}`}return VO({agentApplyMode:p,url:R})},[p,w,r]),E=((C=w==null?void 0:w.refinement)==null?void 0:C.status)==="succeeded"?`${n}:${w.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(_c,{label:"Collapse",children:S.jsx("button",{type:"button",className:"variant-split-secondary-close",onClick:x,"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(HO,{target:_,src:b,framework:"static",remountKey:E})})]})}function lte(){const t=ct(sd),e=ct(Fb);return!t||!e?null:Gh.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 cte(){const t=ct(sd),e=ct(Fb),n=ct(zo),r=gt(sd),s=gt(zo),i=Xi(),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,x)=>{const _=o.current;if(!_)return null;const w=_.getBoundingClientRect();return v<w.left||v>w.right||x<w.top||x>w.bottom?null:v<(w.left+w.right)/2?"left":"right"},[]);if(m.useEffect(()=>{if(!t||!e)return;const v=p(e.x,e.y);u(x=>x===v?x:v),f(x=>{if(x==="exiting")return x;const _=v!==null?"visible":"hidden";return x===_?x:_})},[t,e,p]),m.useEffect(()=>{if(!t)return;const v=x=>{const _=p(x.clientX,x.clientY);if(_&&t.url){const w={sessionId:t.sessionId,variantId:t.variantId,label:t.label,url:t.url,source:t.source},b=n==null?void 0:n[_];b&&(b.sessionId!==w.sessionId||b.variantId!==w.variantId)&&id(b);const E={...n??{},[_]:w};s(E);const C=mg(n?"updated":"started",E);i==null||i.capture(C.event,C.properties),f("exiting"),window.setTimeout(()=>r(null),220)}else id(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(P3,{side:"left",hovered:l==="left",canDrop:!!t.url,label:t.label}),S.jsx(P3,{side:"right",hovered:l==="right",canDrop:!!t.url,label:t.label})]})}function P3({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 UO=(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)}`},R3=(t,e)=>{if(!t)return;const n=UO(e,t.sessionId,t.variantId);return!n||n===t.url?t:{...t,url:n}},ute=()=>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(jO,{trackGlobalLoaderCount:!1})})}),dte=({isLoading:t=!1,isInteractionDisabled:e=!1})=>{const{config:n,fetchConfig:r,isLoading:s,error:i}=Pee();return m.useEffect(()=>{r().catch(o=>{Ce==null||Ce.capture("preview_config_load_failed",{message:o instanceof Error?o.message:"unknown_error",attempts:x3})})},[r]),s?S.jsx(ute,{}):i||!n?S.jsx(Ub,{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:x3})})}}]}):S.jsx(fte,{isLoading:t,isInteractionDisabled:e,framework:n.framework,userPort:n.userPort})};function fte(t){const e=ct(zo),n=ct(sd),r=ct(Qh),s=ct(pg),i=e==null?void 0:e.left,o=e==null?void 0:e.right,l=m.useMemo(()=>{var A,O;if(!r.active||r.projectContext.kind!=="fresh"||!(!!i!=!!o))return;const _=(A=i??o)==null?void 0:A.variantId,w=r.variants.filter(I=>{var T;return I.status==="succeeded"&&((T=I.preview)==null?void 0:T.kind)==="static_artifact"&&I.workItemId!==_}),b=s==null?void 0:s.replace(/[?&]refinement=[^&]*$/,""),C=w.find(I=>{var T;return((T=I.preview)==null?void 0:T.kind)==="static_artifact"&&I.preview.url===b})??w[0];if(((O=C==null?void 0:C.preview)==null?void 0:O.kind)!=="static_artifact")return;const R=UO(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=R3(i,r)??(o?l:void 0),d=R3(o,r)??(i?l:void 0),f=!i&&!!u,p=!o&&!!d,g=!!(u||d),v=S.jsx(ate,{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(C3,{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(C3,{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(cte,{}),S.jsx(lte,{})]})})}function Eo(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function BO(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 bs={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Ph={duration:.5,overwrite:!1,delay:0},Bb,mr,hn,Zs=1e8,Wt=1/Zs,Lx=Math.PI*2,hte=Lx/4,pte=0,ZO=Math.sqrt,mte=Math.cos,gte=Math.sin,or=function(e){return typeof e=="string"},Pn=function(e){return typeof e=="function"},Uo=function(e){return typeof e=="number"},Zb=function(e){return typeof e>"u"},Yi=function(e){return typeof e=="object"},Qr=function(e){return e!==!1},Wb=function(){return typeof window<"u"},H0=function(e){return Pn(e)||or(e)},WO=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Er=Array.isArray,vte=/random\([^)]+\)/g,yte=/,\s*/g,A3=/(?:-?\.?\d|\.)+/gi,qO=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,ku=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,y_=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,GO=/[+-]=-?[.\d]+/,_te=/[^,'"\[\]\s]+/gi,xte=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,bn,Oi,Nx,qb,Es={},vg={},KO,YO=function(e){return(vg=ad(e,Es))&&ns},Gb=function(e,n){return console.warn("Invalid property",e,"set to",n,"Missing plugin? gsap.registerPlugin()")},Rh=function(e,n){return!n&&console.warn(e)},XO=function(e,n){return e&&(Es[e]=n)&&vg&&(vg[e]=n)||Es},Ah=function(){return 0},wte={suppressEvents:!0,isStart:!0,kill:!1},hm={suppressEvents:!0,kill:!1},bte={suppressEvents:!0},Kb={},Fa=[],Dx={},QO,ms={},__={},T3=30,pm=[],Yb="",Xb=function(e){var n=e[0],r,s;if(Yi(n)||Pn(n)||(e=[e]),!(r=(n._gsap||{}).harness)){for(s=pm.length;s--&&!pm[s].targetTest(n););r=pm[s]}for(s=e.length;s--;)e[s]&&(e[s]._gsap||(e[s]._gsap=new x9(e[s],r)))||e.splice(s,1);return e},oc=function(e){return e._gsap||Xb(Ws(e))[0]._gsap},JO=function(e,n,r){return(r=e[n])&&Pn(r)?e[n]():Zb(r)&&e.getAttribute&&e.getAttribute(n)||r},Jr=function(e,n){return(e=e.split(",")).forEach(n)||e},In=function(e){return Math.round(e*1e5)/1e5||0},wn=function(e){return Math.round(e*1e7)/1e7||0},Mu=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},Ste=function(e,n){for(var r=n.length,s=0;e.indexOf(n[s])<0&&++s<r;);return s<r},yg=function(){var e=Fa.length,n=Fa.slice(0),r,s;for(Dx={},Fa.length=0,r=0;r<e;r++)s=n[r],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},Qb=function(e){return!!(e._initted||e._startAt||e.add)},e9=function(e,n,r,s){Fa.length&&!mr&&yg(),e.render(n,r,!!(mr&&n<0&&Qb(e))),Fa.length&&!mr&&yg()},t9=function(e){var n=parseFloat(e);return(n||n===0)&&(e+"").match(_te).length<2?n:or(e)?e.trim():e},n9=function(e){return e},Cs=function(e,n){for(var r in n)r in e||(e[r]=n[r]);return e},kte=function(e){return function(n,r){for(var s in r)s in n||s==="duration"&&e||s==="ease"||(n[s]=r[s])}},ad=function(e,n){for(var r in n)e[r]=n[r];return e},I3=function t(e,n){for(var r in n)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=Yi(n[r])?t(e[r]||(e[r]={}),n[r]):n[r]);return e},_g=function(e,n){var r={},s;for(s in e)s in n||(r[s]=e[s]);return r},Kf=function(e){var n=e.parent||bn,r=e.keyframes?kte(Er(e.keyframes)):Cs;if(Qr(e.inherit))for(;n;)r(e,n.vars.defaults),n=n.parent||n._dp;return e},Ete=function(e,n){for(var r=e.length,s=r===n.length;s&&r--&&e[r]===n[r];);return r<0},r9=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},iv=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},Ya=function(e,n){e.parent&&(!n||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},ac=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},Cte=function(e){for(var n=e.parent;n&&n.parent;)n._dirty=1,n.totalDuration(),n=n.parent;return e},jx=function(e,n,r,s){return e._startAt&&(mr?e._startAt.revert(hm):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(n,!0,s))},Pte=function t(e){return!e||e._ts&&t(e.parent)},M3=function(e){return e._repeat?ld(e._tTime,e=e.duration()+e._rDelay)*e:0},ld=function(e,n){var r=Math.floor(e=wn(e/n));return e&&r===e?r-1:r},xg=function(e,n){return(e-n._start)*n._ts+(n._ts>=0?0:n._dirty?n.totalDuration():n._tDur)},ov=function(e){return e._end=wn(e._start+(e._tDur/Math.abs(e._ts||e._rts||Wt)||0))},av=function(e,n){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=wn(r._time-(e._ts>0?n/e._ts:((e._dirty?e.totalDuration():e._tDur)-n)/-e._ts)),ov(e),r._dirty||ac(r,e)),e},s9=function(e,n){var r;if((n._time||!n._dur&&n._initted||n._start<e._time&&(n._dur||!n.add))&&(r=xg(e.rawTime(),n),(!n._dur||ep(0,n.totalDuration(),r)-n._tTime>Wt)&&n.render(r,!0)),ac(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}},Fi=function(e,n,r,s){return n.parent&&Ya(n),n._start=wn((Uo(r)?r:r||e!==bn?Hs(e,r,n):e._time)+n._delay),n._end=wn(n._start+(n.totalDuration()/Math.abs(n.timeScale())||0)),r9(e,n,"_first","_last",e._sort?"_start":0),$x(n)||(e._recent=n),s||s9(e,n),e._ts<0&&av(e,e._tTime),e},i9=function(e,n){return(Es.ScrollTrigger||Gb("scrollTrigger",n))&&Es.ScrollTrigger.create(n,e)},o9=function(e,n,r,s,i){if(e4(e,n,i),!e._initted)return 1;if(!r&&e._pt&&!mr&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&QO!==vs.frame)return Fa.push(e),e._lazy=[i,s],1},Rte=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},$x=function(e){var n=e.data;return n==="isFromStart"||n==="isStart"},Ate=function(e,n,r,s){var i=e.ratio,o=n<0||!n&&(!e._start&&Rte(e)&&!(!e._initted&&$x(e))||(e._ts<0||e._dp._ts<0)&&!$x(e))?0:1,l=e._rDelay,u=0,d,f,p;if(l&&e._repeat&&(u=ep(0,e._tDur,n),f=ld(u,l),e._yoyo&&f&1&&(o=1-o),f!==ld(e._tTime,l)&&(i=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==i||mr||s||e._zTime===Wt||!n&&e._zTime){if(!e._initted&&o9(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&&jx(e,n,r,!0),e._onUpdate&&!r&&ys(e,"onUpdate"),u&&e._repeat&&!r&&e.parent&&ys(e,"onRepeat"),(n>=e._tDur||n<0)&&e.ratio===o&&(o&&Ya(e,1),!r&&!mr&&(ys(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=n)},Tte=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}},cd=function(e,n,r,s){var i=e._repeat,o=wn(n)||0,l=e._tTime/e._tDur;return l&&!s&&(e._time*=o/e._dur),e._dur=o,e._tDur=i?i<0?1e10:wn(o*(i+1)+e._rDelay*i):o,l>0&&!s&&av(e,e._tTime=e._tDur*l),e.parent&&ov(e),r||ac(e.parent,e),e},O3=function(e){return e instanceof Gr?ac(e):cd(e,e._dur)},Ite={_start:0,endTime:Ah,totalDuration:Ah},Hs=function t(e,n,r){var s=e.labels,i=e._recent||Ite,o=e.duration()>=Zs?i.endTime(!1):e._dur,l,u,d;return or(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*(Er(r)?r[0]:r).totalDuration()),l>1?t(e,n.substr(0,l-1),r)+u:o+u)):n==null?o:+n},Yf=function(e,n,r){var s=Uo(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=Qr(u.vars.inherit)&&u.parent;o.immediateRender=Qr(l.immediateRender),e<2?o.runBackwards=1:o.startAt=n[i-1]}return new Hn(n[0],o,n[i+1])},il=function(e,n){return e||e===0?n(e):n},ep=function(e,n,r){return r<e?e:r>n?n:r},Sr=function(e,n){return!or(e)||!(n=xte.exec(e))?"":n[1]},Mte=function(e,n,r){return il(r,function(s){return ep(e,n,s)})},Fx=[].slice,a9=function(e,n){return e&&Yi(e)&&"length"in e&&(!n&&!e.length||e.length-1 in e&&Yi(e[0]))&&!e.nodeType&&e!==Oi},Ote=function(e,n,r){return r===void 0&&(r=[]),e.forEach(function(s){var i;return or(s)&&!n||a9(s,1)?(i=r).push.apply(i,Ws(s)):r.push(s)})||r},Ws=function(e,n,r){return hn&&!n&&hn.selector?hn.selector(e):or(e)&&!r&&(Nx||!ud())?Fx.call((n||qb).querySelectorAll(e),0):Er(e)?Ote(e,r):a9(e)?Fx.call(e,0):e?[e]:[]},Vx=function(e){return e=Ws(e)[0]||Rh("Invalid scope")||{},function(n){var r=e.current||e.nativeElement||e;return Ws(n,r.querySelectorAll?r:r===e?Rh("Invalid scope")||qb.createElement("div"):e)}},l9=function(e){return e.sort(function(){return .5-Math.random()})},c9=function(e){if(Pn(e))return e;var n=Yi(e)?e:{each:e},r=lc(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 or(s)?f=p={center:.5,edges:.5,end:1}[s]||0:!l&&u&&(f=s[0],p=s[1]),function(g,v,x){var _=(x||n).length,w=o[_],b,E,C,R,A,O,I,T,M;if(!w){if(M=n.grid==="auto"?0:(n.grid||[1,Zs])[1],!M){for(I=-Zs;I<(I=x[M++].getBoundingClientRect().left)&&M<_;);M<_&&M--}for(w=o[_]=[],b=u?Math.min(M,_)*f-.5:s%M,E=M===Zs?0:u?_*p/M-.5:s/M|0,I=0,T=Zs,O=0;O<_;O++)C=O%M-b,R=E-(O/M|0),w[O]=A=d?Math.abs(d==="y"?R:C):ZO(C*C+R*R),A>I&&(I=A),A<T&&(T=A);s==="random"&&l9(w),w.max=I-T,w.min=T,w.v=_=(parseFloat(n.amount)||parseFloat(n.each)*(M>_?_-1:d?d==="y"?_/M:M:Math.max(M,_/M))||0)*(s==="edges"?-1:1),w.b=_<0?i-_:i,w.u=Sr(n.amount||n.each)||0,r=r&&_<0?Wte(r):r}return _=(w[g]-w.min)/w.max||0,wn(w.b+(r?r(_):_)*w.v)+w.u}},Hx=function(e){var n=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var s=wn(Math.round(parseFloat(r)/e)*e*n);return(s-s%1)/n+(Uo(r)?0:Sr(r))}},u9=function(e,n){var r=Er(e),s,i;return!r&&Yi(e)&&(s=r=e.radius||Zs,e.values?(e=Ws(e.values),(i=!Uo(e[0]))&&(s*=s)):e=Hx(e.increment)),il(n,r?Pn(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=Zs,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||Uo(o)?f:f+Sr(o)}:Hx(e))},d9=function(e,n,r,s){return il(Er(e)?!n:r===!0?!!(r=0):!s,function(){return Er(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})},Lte=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)}},Nte=function(e,n){return function(r){return e(parseFloat(r))+(n||Sr(r))}},Dte=function(e,n,r){return h9(e,n,0,1,r)},f9=function(e,n,r){return il(r,function(s){return e[~~n(s)]})},jte=function t(e,n,r){var s=n-e;return Er(e)?f9(e,t(0,e.length),n):il(r,function(i){return(s+(i-e)%s)%s+e})},$te=function t(e,n,r){var s=n-e,i=s*2;return Er(e)?f9(e,t(0,e.length-1),n):il(r,function(o){return o=(i+(o-e)%i)%i||0,e+(o>s?i-o:o)})},Th=function(e){return e.replace(vte,function(n){var r=n.indexOf("[")+1,s=n.substring(r||7,r?n.indexOf("]"):n.length-1).split(yte);return d9(r?s:+s[0],r?0:+s[1],+s[2]||1e-5)})},h9=function(e,n,r,s,i){var o=n-e,l=s-r;return il(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=or(e),l={},u,d,f,p,g;if(r===!0&&(s=1)&&(r=null),o)e={p:e},n={p:n};else if(Er(e)&&!Er(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(x){x*=p;var _=Math.min(g,~~x);return f[_](x-_)},r=n}else s||(e=ad(Er(e)?[]:{},e));if(!f){for(u in n)Jb.call(l,e,u,"get",n[u]);i=function(x){return r4(x,l)||(o?e.p:e)}}}return il(r,i)},L3=function(e,n,r){var s=e.labels,i=Zs,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},ys=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&&Fa.length&&yg(),l&&(hn=l),f=u?i.apply(d,u):i.call(d),hn=o,f},Pf=function(e){return Ya(e),e.scrollTrigger&&e.scrollTrigger.kill(!!mr),e.progress()<1&&ys(e,"onInterrupt"),e},Eu,p9=[],m9=function(e){if(e)if(e=!e.name&&e.default||e,Wb()||e.headless){var n=e.name,r=Pn(e),s=n&&!r&&e.init?function(){this._props=[]}:e,i={init:Ah,render:r4,add:Jb,kill:nne,modifier:tne,rawVars:0},o={targetTest:0,get:0,getSetter:n4,aliases:{},register:0};if(ud(),e!==s){if(ms[n])return;Cs(s,Cs(_g(e,i),o)),ad(s.prototype,ad(i,_g(e,o))),ms[s.prop=n]=s,e.targetTest&&(pm.push(s),Kb[n]=1),n=(n==="css"?"CSS":n.charAt(0).toUpperCase()+n.substr(1))+"Plugin"}XO(n,s),e.register&&e.register(ns,s,es)}else p9.push(e)},Zt=255,Rf={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]},x_=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},g9=function(e,n,r){var s=e?Uo(e)?[e>>16,e>>8&Zt,e&Zt]:0:Rf.black,i,o,l,u,d,f,p,g,v,x;if(!s){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Rf[e])s=Rf[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=x=e.match(A3),!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]=x_(u+1/3,i,o),s[1]=x_(u,i,o),s[2]=x_(u-1/3,i,o);else if(~e.indexOf("="))return s=e.match(qO),r&&s.length<4&&(s[3]=1),s}else s=e.match(A3)||Rf.transparent;s=s.map(Number)}return n&&!x&&(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},v9=function(e){var n=[],r=[],s=-1;return e.split(Va).forEach(function(i){var o=i.match(ku)||[];n.push.apply(n,o),r.push(s+=o.length+1)}),n.c=r,n},N3=function(e,n,r){var s="",i=(e+s).match(Va),o=n?"hsla(":"rgba(",l=0,u,d,f,p;if(!i)return e;if(i=i.map(function(g){return(g=g9(g,n,1))&&o+(n?g[0]+","+g[1]+"%,"+g[2]+"%,"+g[3]:g.join(","))+")"}),r&&(f=v9(e),u=r.c,u.join(s)!==f.c.join(s)))for(d=e.replace(Va,"1").split(ku),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(Va),p=d.length-1;l<p;l++)s+=d[l]+i[l];return s+d[p]},Va=(function(){var t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in Rf)t+="|"+e+"\\b";return new RegExp(t+")","gi")})(),Vte=/hsl[a]?\(/,y9=function(e){var n=e.join(" "),r;if(Va.lastIndex=0,Va.test(n))return r=Vte.test(n),e[1]=N3(e[1],r),e[0]=N3(e[0],r,v9(e[1])),!0},Ih,vs=(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,x=function _(w){var b=t()-s,E=w===!0,C,R,A,O;if((b>e||b<0)&&(r+=b-n),s+=b,A=s-r,C=A-o,(C>0||E)&&(O=++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,O,w)};return p={time:0,frame:0,tick:function(){x(!0)},deltaRatio:function(w){return g/(1e3/(w||60))},wake:function(){KO&&(!Nx&&Wb()&&(Oi=Nx=window,qb=Oi.document||{},Es.gsap=ns,(Oi.gsapVersions||(Oi.gsapVersions=[])).push(ns.version),YO(vg||Oi.GreenSockGlobals||!Oi.gsap&&Oi||{}),p9.forEach(m9)),f=typeof requestAnimationFrame<"u"&&requestAnimationFrame,u&&p.sleep(),d=f||function(w){return setTimeout(w,o-p.time*1e3+1|0)},Ih=1,x(2))},sleep:function(){(f?cancelAnimationFrame:clearTimeout)(u),Ih=0,d=Ah},lagSmoothing:function(w,b){e=w||1/0,n=Math.min(b||33,e)},fps:function(w){i=1e3/(w||240),o=p.time*1e3+i},add:function(w,b,E){var C=b?function(R,A,O,I){w(R,A,O,I),p.remove(C)}:w;return p.remove(w),l[E?"unshift":"push"](C),ud(),C},remove:function(w,b){~(b=l.indexOf(w))&&l.splice(b,1)&&v>=b&&v--},_listeners:l},p})(),ud=function(){return!Ih&&vs.wake()},bt={},Hte=/^[\d.\-M][\d.\-,\s]/,zte=/["']/g,Ute=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(zte,"").trim():+d,s=u.substr(l+1).trim();return n},Bte=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)},Zte=function(e){var n=(e+"").split("("),r=bt[n[0]];return r&&n.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[Ute(n[1])]:Bte(e).split(",").map(t9)):bt._CE&&Hte.test(e)?bt._CE("",e):r},Wte=function(e){return function(n){return 1-e(1-n)}},lc=function(e,n){return e&&(Pn(e)?e:bt[e]||Zte(e))||n},wc=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 Jr(e,function(l){bt[l]=Es[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},_9=function(e){return function(n){return n<.5?(1-e(1-n*2))/2:.5+e((n-.5)*2)/2}},w_=function t(e,n,r){var s=n>=1?n:1,i=(r||(e?.3:.45))/(n<1?n:1),o=i/Lx*(Math.asin(1/s)||0),l=function(f){return f===1?1:s*Math.pow(2,-10*f)*gte((f-o)*i)+1},u=e==="out"?l:e==="in"?function(d){return 1-l(1-d)}:_9(l);return i=Lx/i,u.config=function(d,f){return t(e,d,f)},u},b_=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)}:_9(r);return s.config=function(i){return t(e,i)},s};Jr("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var n=e<5?e+1:e;wc(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;wc("Elastic",w_("in"),w_("out"),w_());(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};wc("Bounce",function(o){return 1-i(1-o)},i)})(7.5625,2.75);wc("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)});wc("Circ",function(t){return-(ZO(1-t*t)-1)});wc("Sine",function(t){return t===1?1:-mte(t*hte)+1});wc("Back",b_("in"),b_("out"),b_());bt.SteppedEase=bt.steps=Es.SteppedEase={config:function(e,n){e===void 0&&(e=1);var r=1/e,s=e+(n?0:1),i=n?1:0,o=1-Wt;return function(l){return((s*ep(0,o,l)|0)+i)*r}}};Ph.ease=bt["quad.out"];Jr("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return Yb+=t+","+t+"Params,"});var x9=function(e,n){this.id=pte++,e._gsap=this,this.target=e,this.harness=n,this.get=n?n.get:JO,this.set=n?n.getSetter:n4},Mh=(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,cd(this,+n.duration,1,1),this.data=n.data,hn&&(this._ctx=hn,hn.data.push(this)),Ih||vs.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,cd(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,s){if(ud(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(av(this,r),!i._dp||i.parent||s9(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&r<this._tDur||this._ts<0&&r>0||!this._tDur&&!r)&&Fi(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!s||this._initted&&Math.abs(this._zTime)===Wt||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),e9(this,r,s)),this},e.time=function(r,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+M3(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)+M3(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?ld(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?xg(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-Wt?0:this._rts,this.totalTime(ep(-Math.abs(this._delay),this.totalDuration(),i),s!==!1),ov(this),Cte(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):(ud(),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=wn(r);var s=this.parent||this._dp;return s&&(s._sort||!this.parent)&&Fi(s,this,this._start-this._delay),this}return this._start},e.endTime=function(r){return this._start+(Qr(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?xg(s.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=bte);var s=mr;return mr=r,Qb(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),mr=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,O3(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var s=this._time;return this._rDelay=r,O3(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(Hs(this,r),Qr(s))},e.restart=function(r,s){return this.play().totalTime(r?-this._delay:0,Qr(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=Pn(r)?r:n9,u=function(){var f=s.then;s.then=null,i&&i(),Pn(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(){Pf(this)},t})();Cs(Mh.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 Gr=(function(t){BO(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=Qr(r.sortChildren),bn&&Fi(r.parent||bn,Eo(i),s),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&i9(Eo(i),r.scrollTrigger),i}var n=e.prototype;return n.to=function(s,i,o){return Yf(0,arguments,this),this},n.from=function(s,i,o){return Yf(1,arguments,this),this},n.fromTo=function(s,i,o,l){return Yf(2,arguments,this),this},n.set=function(s,i,o){return i.duration=0,i.parent=this,Kf(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new Hn(s,i,Hs(this,o),1),this},n.call=function(s,i,o){return Fi(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,Hs(this,u)),this},n.staggerFrom=function(s,i,o,l,u,d,f){return o.runBackwards=1,Kf(o).immediateRender=Qr(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,Kf(l).immediateRender=Qr(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:wn(s),p=this._zTime<0!=s<0&&(this._initted||!d),g,v,x,_,w,b,E,C,R,A,O,I;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(O=this._yoyo,w=d+this._rDelay,this._repeat<-1&&s<0)return this.totalTime(w*100+s,i,o);if(g=wn(f%w),f===u?(_=this._repeat,g=d):(A=wn(f/w),_=~~A,_&&_===A&&(g=d,_--),g>d&&(g=d)),A=ld(this._tTime,w),!l&&this._tTime&&A!==_&&this._tTime-A*w-this._dur<=0&&(A=_),O&&_&1&&(g=d-g,I=1),_!==A&&!this._lock){var T=O&&A&1,M=T===(O&&_&1);if(_<A&&(T=!T),l=T?0:f%d?d:f,this._lock=1,this.render(l||(I?0:wn(_*w)),i,!d)._lock=0,this._tTime=f,!i&&this.parent&&ys(this,"onRepeat"),this.vars.repeatRefresh&&!I&&(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,M&&(this._lock=2,l=T?d:-1e-4,this.render(l,!0),this.vars.repeatRefresh&&!I&&this.invalidate()),this._lock=0,!this._ts&&!b)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(E=Tte(this,wn(l),wn(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&&(ys(this,"onStart"),this._tTime!==f))return this;if(g>=l&&s>=0)for(v=this._first;v;){if(x=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,x&&(f+=this._zTime=-Wt);break}}v=x}else{v=this._last;for(var N=s<0?s:g;v;){if(x=v._prev,(v._act||N<=v._end)&&v._ts&&E!==v){if(v.parent!==this)return this.render(s,i,o);if(v.render(v._ts>0?(N-v._start)*v._ts:(v._dirty?v.totalDuration():v._tDur)+(N-v._start)*v._ts,i,o||mr&&Qb(v)),g!==this._time||!this._ts&&!b){E=0,x&&(f+=this._zTime=N?-Wt:Wt);break}}v=x}}if(E&&!i&&(this.pause(),E.render(g>=l?0:-Wt)._zTime=g>=l?1:-1,this._ts))return this._start=R,ov(this),this.render(s,i,o);this._onUpdate&&!i&&ys(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)&&Ya(this,1),!i&&!(s<0&&!l)&&(f||l||!u)&&(ys(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(Uo(i)||(i=Hs(this,i,s)),!(s instanceof Mh)){if(Er(s))return s.forEach(function(l){return o.add(l,i)}),this;if(or(s))return this.addLabel(s,i);if(Pn(s))s=Hn.delayedCall(0,s);else return this}return this!==s?Fi(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=-Zs);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 or(s)?this.removeLabel(s):Pn(s)?this.killTweensOf(s):(s.parent===this&&iv(this,s),s===this._recent&&(this._recent=this._last),ac(this))},n.totalTime=function(s,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=wn(vs.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]=Hs(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||Ah,o);return l.data="isPause",this._hasPause=1,Fi(this,l,Hs(this,s))},n.removePause=function(s){var i=this._first;for(s=Hs(this,s);i;)i._start===s&&i.data==="isPause"&&Ya(i),i=i._next},n.killTweensOf=function(s,i,o){for(var l=this.getTweensOf(s,o),u=l.length;u--;)Oa!==l[u]&&l[u].kill(s,i);return this},n.getTweensOf=function(s,i){for(var o=[],l=Ws(s),u=this._first,d=Uo(i),f;u;)u instanceof Hn?Ste(u._targets,l)&&(d?(!Oa||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=Hs(o,s),u=i,d=u.startAt,f=u.onStart,p=u.onStartParams,g=u.immediateRender,v,x=Hn.to(o,Cs({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 w=i.duration||Math.abs((l-(d&&"time"in d?d.time:o._time))/o.timeScale());x._dur!==w&&cd(x,w,0,1).render(x._time,!0,!0),v=1}f&&f.apply(x,p||[])}},i));return g?x.render(0):x},n.tweenFromTo=function(s,i,o){return this.tweenTo(i,Cs({startAt:{time:Hs(this,s)}},o))},n.recent=function(){return this._recent},n.nextLabel=function(s){return s===void 0&&(s=this._time),L3(this,Hs(this,s))},n.previousLabel=function(s){return s===void 0&&(s=this._time),L3(this,Hs(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=wn(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 ac(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={}),ac(this)},n.totalDuration=function(s){var i=0,o=this,l=o._last,u=Zs,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,Fi(o,l,f-l._delay,1)._lock=0):u=f,f<0&&l._ts&&(i-=f,(!p&&!o._dp||p&&p.smoothChildTiming)&&(o._start+=wn(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;cd(o,o===bn&&o._time>i?o._time:i,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(s){if(bn._ts&&(e9(bn,xg(s,bn)),QO=vs.frame),vs.frame>=T3){T3+=bs.autoSleep||120;var i=bn._first;if((!i||!i._ts)&&bs.autoSleep&&vs._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||vs.sleep()}}},e})(Mh);Cs(Gr.prototype,{_lock:0,_hasPause:0,_forcing:0});var qte=function(e,n,r,s,i,o,l){var u=new es(this._pt,e,n,0,1,C9,null,i),d=0,f=0,p,g,v,x,_,w,b,E;for(u.b=r,u.e=s,r+="",s+="",(b=~s.indexOf("random("))&&(s=Th(s)),o&&(E=[r,s],o(E,e,n),r=E[0],s=E[1]),g=r.match(y_)||[];p=y_.exec(s);)x=p[0],_=s.substring(d,p.index),v?v=(v+1)%5:_.substr(-5)==="rgba("&&(v=1),x!==g[f++]&&(w=parseFloat(g[f-1])||0,u._pt={_next:u._pt,p:_||f===1?_:",",s:w,c:x.charAt(1)==="="?Mu(w,x)-w:parseFloat(x)-w,m:v&&v<4?Math.round:0},d=y_.lastIndex);return u.c=d<s.length?s.substring(d,s.length):"",u.fp=l,(GO.test(s)||b)&&(u.e=0),this._pt=u,u},Jb=function(e,n,r,s,i,o,l,u,d,f){Pn(s)&&(s=s(i||0,e,o));var p=e[n],g=r!=="get"?r:Pn(p)?d?e[n.indexOf("set")||!Pn(e["get"+n.substr(3)])?n:"get"+n.substr(3)](d):e[n]():p,v=Pn(p)?d?Qte:k9:t4,x;if(or(s)&&(~s.indexOf("random(")&&(s=Th(s)),s.charAt(1)==="="&&(x=Mu(g,s)+(Sr(g)||0),(x||x===0)&&(s=x))),!f||g!==s||zx)return!isNaN(g*s)&&s!==""?(x=new es(this._pt,e,n,+g||0,s-(g||0),typeof p=="boolean"?ene:E9,0,v),d&&(x.fp=d),l&&x.modifier(l,this,e),this._pt=x):(!p&&!(n in e)&&Gb(n,s),qte.call(this,e,n,g,s,v,u||bs.stringFilter,d))},Gte=function(e,n,r,s,i){if(Pn(e)&&(e=Xf(e,i,n,r,s)),!Yi(e)||e.style&&e.nodeType||Er(e)||WO(e))return or(e)?Xf(e,i,n,r,s):e;var o={},l;for(l in e)o[l]=Xf(e[l],i,n,r,s);return o},w9=function(e,n,r,s,i,o){var l,u,d,f;if(ms[e]&&(l=new ms[e]).init(i,l.rawVars?n[e]:Gte(n[e],s,i,o,r),r,s,o)!==!1&&(r._pt=u=new es(r._pt,i,e,0,1,l.render,l,0,l.priority),r!==Eu))for(d=r._ptLookup[r._targets.indexOf(i)],f=l._props.length;f--;)d[l._props[f]]=u;return l},Oa,zx,e4=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,x=e._dur,_=e._startAt,w=e._targets,b=e.parent,E=b&&b.data==="nested"?b.vars.targets:w,C=e._overwrite==="auto"&&!Bb,R=e.timeline,A=s.easeReverse||p,O,I,T,M,N,j,$,K,B,z,Z,Q,U;if(R&&(!g||!i)&&(i="none"),e._ease=lc(i,Ph.ease),e._rEase=A&&(lc(A)||e._ease),e._from=!R&&!!s.runBackwards,e._from&&(e.ratio=1),!R||g&&!s.stagger){if(K=w[0]?oc(w[0]).harness:0,Q=K&&s[K.prop],O=_g(s,Kb),_&&(_._zTime<0&&_.progress(1),n<0&&f&&l&&!v?_.render(-1,!0):_.revert(f&&x?hm:wte),_._lazy=0),o){if(Ya(e._startAt=Hn.set(w,Cs({data:"isStart",overwrite:!1,parent:b,immediateRender:!0,lazy:!_&&Qr(u),startAt:null,delay:0,onUpdate:d&&function(){return ys(e,"onUpdate")},stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,n<0&&(mr||!l&&!v)&&e._startAt.revert(hm),l&&x&&n<=0&&r<=0){n&&(e._zTime=n);return}}else if(f&&x&&!_){if(n&&(l=!1),T=Cs({overwrite:!1,data:"isFromStart",lazy:l&&!_&&Qr(u),immediateRender:l,stagger:0,parent:b},O),Q&&(T[K.prop]=Q),Ya(e._startAt=Hn.set(w,T)),e._startAt._dp=0,e._startAt._sat=e,n<0&&(mr?e._startAt.revert(hm):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=x&&Qr(u)||u&&!x,I=0;I<w.length;I++){if(N=w[I],$=N._gsap||Xb(w)[I]._gsap,e._ptLookup[I]=z={},Dx[$.id]&&Fa.length&&yg(),Z=E===w?I:E.indexOf(N),K&&(B=new K).init(N,Q||O,e,Z,E)!==!1&&(e._pt=M=new es(e._pt,N,B.name,0,1,B.render,B,0,B.priority),B._props.forEach(function(ee){z[ee]=M}),B.priority&&(j=1)),!K||Q)for(T in O)ms[T]&&(B=w9(T,O,e,Z,N,E))?B.priority&&(j=1):z[T]=M=Jb.call(e,N,T,"get",O[T],Z,E,0,s.stringFilter);e._op&&e._op[I]&&e.kill(N,e._op[I]),C&&e._pt&&(Oa=e,bn.killTweensOf(N,z,e.globalTime(n)),U=!e.parent,Oa=0),e._pt&&u&&(Dx[$.id]=1)}j&&P9(e),e._onInit&&e._onInit(e)}e._onUpdate=d,e._initted=(!e._op||e._pt)&&!U,g&&n<=0&&R.render(Zs,!0,!0)},Kte=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 zx=1,e.vars[n]="+=0",e4(e,l),zx=0,u?Rh(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=In(r)+Sr(p.e)),p.b&&(p.b=f.s+Sr(p.b))},Yte=function(e,n){var r=e[0]?oc(e[0]).harness:0,s=r&&r.aliases,i,o,l,u;if(!s)return n;i=ad({},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},Xte=function(e,n,r,s){var i=n.ease||s||"power1.inOut",o,l;if(Er(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})},Xf=function(e,n,r,s,i){return Pn(e)?e.call(n,r,s,i):or(e)&&~e.indexOf("random(")?Th(e):e},b9=Yb+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",S9={};Jr(b9+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return S9[t]=1});var Hn=(function(t){BO(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:Kf(s))||this;var u=l.vars,d=u.duration,f=u.delay,p=u.immediateRender,g=u.stagger,v=u.overwrite,x=u.keyframes,_=u.defaults,w=u.scrollTrigger,b=s.parent||bn,E=(Er(r)||WO(r)?Uo(r[0]):"length"in s)?[r]:Ws(r),C,R,A,O,I,T,M,N;if(l._targets=E.length?Xb(E):Rh("GSAP target "+r+" not found. https://gsap.com",!bs.nullTargetWarn)||[],l._ptLookup=[],l._overwrite=v,x||g||H0(d)||H0(f)){s=l.vars;var j=s.easeReverse||s.yoyoEase;if(C=l.timeline=new Gr({data:"nested",defaults:_||{},targets:b&&b.data==="nested"?b.vars.targets:E}),C.kill(),C.parent=C._dp=Eo(l),C._start=0,g||H0(d)||H0(f)){if(O=E.length,M=g&&c9(g),Yi(g))for(I in g)~b9.indexOf(I)&&(N||(N={}),N[I]=g[I]);for(R=0;R<O;R++)A=_g(s,S9),A.stagger=0,j&&(A.easeReverse=j),N&&ad(A,N),T=E[R],A.duration=+Xf(d,Eo(l),R,T,E),A.delay=(+Xf(f,Eo(l),R,T,E)||0)-l._delay,!g&&O===1&&A.delay&&(l._delay=f=A.delay,l._start+=f,A.delay=0),C.to(T,A,M?M(R,T,E):0),C._ease=bt.none;C.duration()?d=f=0:l.timeline=0}else if(x){Kf(Cs(C.vars.defaults,{ease:"none"})),C._ease=lc(x.ease||s.ease||"none");var $=0,K,B,z;if(Er(x))x.forEach(function(Z){return C.to(E,Z,">")}),C.duration();else{A={};for(I in x)I==="ease"||I==="easeEach"||Xte(I,x[I],A,x.easeEach);for(I in A)for(K=A[I].sort(function(Z,Q){return Z.t-Q.t}),$=0,R=0;R<K.length;R++)B=K[R],z={ease:B.e,duration:(B.t-(R?K[R-1].t:0))/100*d},z[I]=B.v,C.to(E,z,$),$+=z.duration;C.duration()<d&&C.to({},{duration:d-C.duration()})}}d||l.duration(d=C.duration())}else l.timeline=0;return v===!0&&!Bb&&(Oa=Eo(l),bn.killTweensOf(E),Oa=0),Fi(b,Eo(l),i),s.reversed&&l.reverse(),s.paused&&l.paused(!0),(p||!d&&!x&&l._start===wn(b._time)&&Qr(p)&&Pte(Eo(l))&&b.data!=="nested")&&(l._tTime=-Wt,l.render(Math.max(0,-f)||0)),w&&i9(Eo(l),w),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,x,_,w,b,E,C;if(!d)Ate(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=wn(p%_),p===u?(x=this._repeat,g=d):(w=wn(p/_),x=~~w,x&&x===w?(g=d,x--):g>d&&(g=d)),b=this._yoyo&&x&1,b&&(g=d-g),w=ld(this._tTime,_),g===l&&!o&&this._initted&&x===w)return this._tTime=p,this;x!==w&&this.vars.repeatRefresh&&!b&&!this._lock&&g!==_&&this._initted&&(this._lock=o=1,this.render(wn(_*x),!0).invalidate()._lock=0)}if(!this._initted){if(o9(this,f?s:g,o,i,p))return this._tTime=0,this;if(l!==this._time&&!(o&&this.vars.repeatRefresh&&x!==w))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&&!w&&(ys(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&&jx(this,s,i,o),ys(this,"onUpdate")),this._repeat&&x!==w&&this.vars.onRepeat&&!i&&this.parent&&ys(this,"onRepeat"),(p===this._tDur||!p)&&this._tTime===p&&(f&&!this._onUpdate&&jx(this,s,!0,!0),(s||!d)&&(p===this._tDur&&this._ts>0||!p&&this._ts<0)&&Ya(this,1),!i&&!(f&&!l)&&(p||l||b)&&(ys(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){Ih||vs.wake(),this._ts||this.play();var d=Math.min(this._dur,(this._dp._time-this._start)*this._ts),f;return this._initted||e4(this,d),f=this._ease(d/this._dur),Kte(this,s,i,o,l,f,d,u)?this.resetTo(s,i,o,l,1):(av(this,0),this.parent||r9(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?Pf(this):this.scrollTrigger&&this.scrollTrigger.kill(!!mr),this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(s,i,Oa&&Oa.vars.overwrite!==!0)._first||Pf(this),this.parent&&o!==this.timeline.totalDuration()&&cd(this,this._dur*this.timeline._tDur/o,0,1),this}var l=this._targets,u=s?Ws(s):l,d=this._ptLookup,f=this._pt,p,g,v,x,_,w,b;if((!i||i==="all")&&Ete(l,u))return i==="all"&&(this._pt=0),Pf(this);for(p=this._op=this._op||[],i!=="all"&&(or(i)&&(_={},Jr(i,function(E){return _[E]=1}),i=_),i=Yte(l,i)),b=l.length;b--;)if(~u.indexOf(l[b])){g=d[b],i==="all"?(p[b]=i,x=g,v={}):(v=p[b]=p[b]||{},x=i);for(_ in x)w=g&&g[_],w&&((!("kill"in w.d)||w.d.kill(_)===!0)&&iv(this,w,"_pt"),delete g[_]),v!=="all"&&(v[_]=1)}return this._initted&&!this._pt&&f&&Pf(this),this},e.to=function(s,i){return new e(s,i,arguments[2])},e.from=function(s,i){return Yf(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 Yf(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})(Mh);Cs(Hn.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});Jr("staggerTo,staggerFrom,staggerFromTo",function(t){Hn[t]=function(){var e=new Gr,n=Fx.call(arguments,0);return n.splice(t==="staggerFromTo"?5:4,0,0),e[t].apply(e,n)}});var t4=function(e,n,r){return e[n]=r},k9=function(e,n,r){return e[n](r)},Qte=function(e,n,r,s){return e[n](s.fp,r)},Jte=function(e,n,r){return e.setAttribute(n,r)},n4=function(e,n){return Pn(e[n])?k9:Zb(e[n])&&e.setAttribute?Jte:t4},E9=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e6)/1e6,n)},ene=function(e,n){return n.set(n.t,n.p,!!(n.s+n.c*e),n)},C9=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)},r4=function(e,n){for(var r=n._pt;r;)r.r(e,r.d),r=r._next},tne=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},nne=function(e){for(var n=this._pt,r,s;n;)s=n._next,n.p===e&&!n.op||n.op===e?iv(this,n,"_pt"):n.dep||(r=1),n=s;return!r},rne=function(e,n,r,s){s.mSet(e,n,s.m.call(s.tween,r,s.mt),s)},P9=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},es=(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||E9,this.d=u||this,this.set=d||t4,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=rne,this.m=r,this.mt=i,this.tween=s},t})();Jr(Yb+"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 Kb[t]=1});Es.TweenMax=Es.TweenLite=Hn;Es.TimelineLite=Es.TimelineMax=Gr;bn=new Gr({sortChildren:!1,defaults:Ph,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});bs.stringFilter=y9;var cc=[],mm={},sne=[],D3=0,ine=0,S_=function(e){return(mm[e]||sne).map(function(n){return n()})},Ux=function(){var e=Date.now(),n=[];e-D3>2&&(S_("matchMediaInit"),cc.forEach(function(r){var s=r.queries,i=r.conditions,o,l,u,d;for(l in s)o=Oi.matchMedia(s[l]).matches,o&&(u=1),o!==i[l]&&(i[l]=o,d=1);d&&(r.revert(),u&&n.push(r))}),S_("matchMediaRevert"),n.forEach(function(r){return r.onMatch(r,function(s){return r.add(null,s)})}),D3=e,S_("matchMedia"))},R9=(function(){function t(n,r){this.selector=r&&Vx(r),this.data=[],this._r=[],this.isReverted=!1,this.id=ine++,n&&this.add(n)}var e=t.prototype;return e.add=function(r,s,i){Pn(r)&&(i=s,s=r,r=Pn);var o=this,l=function(){var d=hn,f=o.selector,p;return d&&d!==o&&d.data.push(o),i&&(o.selector=Vx(i)),hn=o,p=s.apply(o,arguments),Pn(p)&&o._r.push(p),hn=d,o.selector=f,o.isReverted=!1,p};return o.last=l,r===Pn?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 Gr?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=cc.length;o--;)cc[o].id===this.id&&cc.splice(o,1)},e.revert=function(r){this.kill(r||{})},t})(),one=(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){Yi(r)||(r={matches:r});var o=new R9(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=Oi.matchMedia(r[d]),u&&(cc.indexOf(o)<0&&cc.push(o),(l[d]=u.matches)&&(f=1),u.addListener?u.addListener(Ux):u.addEventListener("change",Ux)));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})(),wg={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 m9(s)})},timeline:function(e){return new Gr(e)},getTweensOf:function(e,n){return bn.getTweensOf(e,n)},getProperty:function(e,n,r,s){or(e)&&(e=Ws(e)[0]);var i=oc(e||{}).get,o=r?n9:t9;return r==="native"&&(r=""),e&&(n?o((ms[n]&&ms[n].get||i)(e,n,r,s)):function(l,u,d){return o((ms[l]&&ms[l].get||i)(e,l,u,d))})},quickSetter:function(e,n,r){if(e=Ws(e),e.length>1){var s=e.map(function(f){return ns.quickSetter(f,n,r)}),i=s.length;return function(f){for(var p=i;p--;)s[p](f)}}e=e[0]||{};var o=ms[n],l=oc(e),u=l.harness&&(l.harness.aliases||{})[n]||n,d=o?function(f){var p=new o;Eu._pt=0,p.init(e,r?f+r:f,Eu,0,[e]),p.render(1,p),Eu._pt&&r4(1,Eu)}: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=ns.to(e,Cs((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=lc(e.ease,Ph.ease)),I3(Ph,e||{})},config:function(e){return I3(bs,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&&!ms[l]&&!Es[l]&&Rh(n+" effect requires "+l+" plugin.")}),__[n]=function(l,u,d){return r(Ws(l),Cs(u||{},i),d)},o&&(Gr.prototype[n]=function(l,u,d){return this.add(__[n](l,Yi(u)?u:(d=u)&&{},this),d)})},registerEase:function(e,n){bt[e]=lc(n)},parseEase:function(e,n){return arguments.length?lc(e,n):bt},getById:function(e){return bn.getById(e)},exportRoot:function(e,n){e===void 0&&(e={});var r=new Gr(e),s,i;for(r.smoothChildTiming=Qr(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]))&&Fi(r,s,s._start-s._delay),s=i;return Fi(bn,r,0),r},context:function(e,n){return e?new R9(e,n):hn},matchMedia:function(e){return new one(e)},matchMediaRefresh:function(){return cc.forEach(function(e){var n=e.conditions,r,s;for(s in n)n[s]&&(n[s]=!1,r=1);r&&e.revert()})||Ux()},addEventListener:function(e,n){var r=mm[e]||(mm[e]=[]);~r.indexOf(n)||r.push(n)},removeEventListener:function(e,n){var r=mm[e],s=r&&r.indexOf(n);s>=0&&r.splice(s,1)},utils:{wrap:jte,wrapYoyo:$te,distribute:c9,random:d9,snap:u9,normalize:Dte,getUnit:Sr,clamp:Mte,splitColor:g9,toArray:Ws,selector:Vx,mapRange:h9,pipe:Lte,unitize:Nte,interpolate:Fte,shuffle:l9},install:YO,effects:__,ticker:vs,updateRoot:Gr.updateRoot,plugins:ms,globalTimeline:bn,core:{PropTween:es,globals:XO,Tween:Hn,Timeline:Gr,Animation:Mh,getCache:oc,_removeLinkedListItem:iv,reverting:function(){return mr},context:function(e){return e&&hn&&(hn.data.push(e),e._ctx=hn),hn},suppressOverwrites:function(e){return Bb=e}}};Jr("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return wg[t]=Hn[t]});vs.add(Gr.updateRoot);Eu=wg.to({},{duration:0});var ane=function(e,n){for(var r=e._pt;r&&r.p!==n&&r.op!==n&&r.fp!==n;)r=r._next;return r},lne=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=ane(o,s)),o&&o.modifier&&o.modifier(n[s],e,r[i],s))},k_=function(e,n){return{name:e,headless:1,rawVars:1,init:function(s,i,o){o._onInit=function(l){var u,d;if(or(i)&&(u={},Jr(i,function(f){return u[f]=1}),i=u),n){u={};for(d in i)u[d]=n(i[d]);i=u}lne(l,i)}}}},ns=wg.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;)mr?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)}},k_("roundProps",Hx),k_("modifiers"),k_("snap",u9))||wg;Hn.version=Gr.version=ns.version="3.15.0";KO=1;Wb()&&ud();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 j3,La,Ou,s4,Zl,$3,i4,cne=function(){return typeof window<"u"},Bo={},Hl=180/Math.PI,Lu=Math.PI/180,fu=Math.atan2,F3=1e8,o4=/([A-Z])/g,une=/(left|right|width|margin|padding|x)/i,dne=/[\s,\(]\S/,zi={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Bx=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},fne=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)},hne=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)},pne=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)},mne=function(e,n){var r=n.s+n.c*e;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},A9=function(e,n){return n.set(n.t,n.p,e?n.e:n.b,n)},T9=function(e,n){return n.set(n.t,n.p,e!==1?n.b:n.e,n)},gne=function(e,n,r){return e.style[n]=r},vne=function(e,n,r){return e.style.setProperty(n,r)},yne=function(e,n,r){return e._gsap[n]=r},_ne=function(e,n,r){return e._gsap.scaleX=e._gsap.scaleY=r},xne=function(e,n,r,s,i){var o=e._gsap;o.scaleX=o.scaleY=r,o.renderTransform(i,o)},wne=function(e,n,r,s,i){var o=e._gsap;o[n]=r,o.renderTransform(i,o)},Sn="transform",ts=Sn+"Origin",bne=function t(e,n){var r=this,s=this.target,i=s.style,o=s._gsap;if(e in Bo&&i){if(this.tfm=this.tfm||{},e!=="transform")e=zi[e]||e,~e.indexOf(",")?e.split(",").forEach(function(l){return r.tfm[l]=Co(s,l)}):this.tfm[e]=o.x?o[e]:Co(s,e),e===ts&&(this.tfm.zOrigin=o.zOrigin);else return zi.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(ts,n,"")),e=Sn}(i||n)&&this.props.push(e,n,i[e])},I9=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},Sne=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(o4,"-$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=i4(),(!i||!i.isStart)&&!r[Sn]&&(I9(r),s.zOrigin&&r[ts]&&(r[ts]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},M9=function(e,n){var r={target:e,props:[],revert:Sne,save:bne};return e._gsap||ns.core.getCache(e),n&&e.style&&e.nodeType&&n.split(",").forEach(function(s){return r.save(s)}),r},O9,Zx=function(e,n){var r=La.createElementNS?La.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):La.createElement(e);return r&&r.style?r:La.createElement(e)},_s=function t(e,n,r){var s=getComputedStyle(e);return s[n]||s.getPropertyValue(n.replace(o4,"-$1").toLowerCase())||s.getPropertyValue(n)||!r&&t(e,dd(n)||n,1)||""},V3="O,Moz,ms,Ms,Webkit".split(","),dd=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--&&!(V3[o]+e in i););return o<0?null:(o===3?"ms":o>=0?V3[o]:"")+e},Wx=function(){cne()&&window.document&&(j3=window,La=j3.document,Ou=La.documentElement,Zl=Zx("div")||{style:{}},Zx("div"),Sn=dd(Sn),ts=Sn+"Origin",Zl.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",O9=!!dd("perspective"),i4=ns.core.reverting,s4=1)},H3=function(e){var n=e.ownerSVGElement,r=Zx("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=e.cloneNode(!0),i;s.style.display="block",r.appendChild(s),Ou.appendChild(r);try{i=s.getBBox()}catch{}return r.removeChild(s),Ou.removeChild(r),i},z3=function(e,n){for(var r=n.length;r--;)if(e.hasAttribute(n[r]))return e.getAttribute(n[r])},L9=function(e){var n,r;try{n=e.getBBox()}catch{n=H3(e),r=1}return n&&(n.width||n.height)||r||(n=H3(e)),n&&!n.width&&!n.x&&!n.y?{x:+z3(e,["x","cx","x1"])||0,y:+z3(e,["y","cy","y1"])||0,width:0,height:0}:n},N9=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&L9(e))},Xa=function(e,n){if(n){var r=e.style,s;n in Bo&&n!==ts&&(n=Sn),r.removeProperty?(s=n.substr(0,2),(s==="ms"||n.substr(0,6)==="webkit")&&(n="-"+n),r.removeProperty(s==="--"?n:n.replace(o4,"-$1").toLowerCase())):r.removeAttribute(n)}},Na=function(e,n,r,s,i,o){var l=new es(e._pt,n,r,0,1,o?T9:A9);return e._pt=l,l.b=s,l.e=i,e._props.push(r),l},U3={deg:1,rad:1,turn:1},kne={grid:1,flex:1},Qa=function t(e,n,r,s){var i=parseFloat(r)||0,o=(r+"").trim().substr((i+"").length)||"px",l=Zl.style,u=une.test(n),d=e.tagName.toLowerCase()==="svg",f=(d?"client":"offset")+(u?"Width":"Height"),p=100,g=s==="px",v=s==="%",x,_,w,b;if(s===o||!i||U3[s]||U3[o])return i;if(o!=="px"&&!g&&(i=t(e,n,r,"px")),b=e.getCTM&&N9(e),(v||o==="%")&&(Bo[n]||~n.indexOf("adius")))return x=b?e.getBBox()[u?"width":"height"]:e[f],In(v?i/x*p:i/100*x);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),(!_||_===La||!_.appendChild)&&(_=La.body),w=_._gsap,w&&v&&w.width&&u&&w.time===vs.time&&!w.uncache)return In(i/w.width*p);if(v&&(n==="height"||n==="width")){var E=e.style[n];e.style[n]=p+s,x=e[f],E?e.style[n]=E:Xa(e,n)}else(v||o==="%")&&!kne[_s(_,"display")]&&(l.position=_s(e,"position")),_===e&&(l.position="static"),_.appendChild(Zl),x=Zl[f],_.removeChild(Zl),l.position="absolute";return u&&v&&(w=oc(_),w.time=vs.time,w.width=_[f]),In(g?x*i/p:x&&i?p/x*i:0)},Co=function(e,n,r,s){var i;return s4||Wx(),n in zi&&n!=="transform"&&(n=zi[n],~n.indexOf(",")&&(n=n.split(",")[0])),Bo[n]&&n!=="transform"?(i=Lh(e,s),i=n!=="transformOrigin"?i[n]:i.svg?i.origin:Sg(_s(e,ts))+" "+i.zOrigin+"px"):(i=e.style[n],(!i||i==="auto"||s||~(i+"").indexOf("calc("))&&(i=bg[n]&&bg[n](e,n,r)||_s(e,n)||JO(e,n)||(n==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?Qa(e,n,i,r)+r:i},Ene=function(e,n,r,s){if(!r||r==="none"){var i=dd(n,e,1),o=i&&_s(e,i,1);o&&o!==r?(n=i,r=o):n==="borderColor"&&(r=_s(e,"borderTopColor"))}var l=new es(this._pt,e.style,n,0,1,C9),u=0,d=0,f,p,g,v,x,_,w,b,E,C,R,A;if(l.b=r,l.e=s,r+="",s+="",s.substring(0,6)==="var(--"&&(s=_s(e,s.substring(4,s.indexOf(")")))),s==="auto"&&(_=e.style[n],e.style[n]=s,s=_s(e,n)||s,_?e.style[n]=_:Xa(e,n)),f=[r,s],y9(f),r=f[0],s=f[1],g=r.match(ku)||[],A=s.match(ku)||[],A.length){for(;p=ku.exec(s);)w=p[0],E=s.substring(u,p.index),x?x=(x+1)%5:(E.substr(-5)==="rgba("||E.substr(-5)==="hsla(")&&(x=1),w!==(_=g[d++]||"")&&(v=parseFloat(_)||0,R=_.substr((v+"").length),w.charAt(1)==="="&&(w=Mu(v,w)+R),b=parseFloat(w),C=w.substr((b+"").length),u=ku.lastIndex-C.length,C||(C=C||bs.units[n]||R,u===s.length&&(s+=C,l.e+=C)),R!==C&&(v=Qa(e,n,_,C)||0),l._pt={_next:l._pt,p:E||d===1?E:",",s:v,c:b-v,m:x&&x<4||n==="zIndex"?Math.round:0});l.c=u<s.length?s.substring(u,s.length):""}else l.r=n==="display"&&s==="none"?T9:A9;return GO.test(s)&&(l.e=0),this._pt=l,l},B3={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},Cne=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]=B3[r]||r,n[1]=B3[s]||s,n.join(" ")},Pne=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],Bo[l]&&(u=1,l=l==="transformOrigin"?ts:Sn),Xa(r,l);u&&(Xa(r,Sn),o&&(o.svg&&r.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",Lh(r,1),o.uncache=1,I9(s)))}},bg={clearProps:function(e,n,r,s,i){if(i.data!=="isFromStart"){var o=e._pt=new es(e._pt,n,r,0,0,Pne);return o.u=s,o.pr=-10,o.tween=i,e._props.push(r),1}}},Oh=[1,0,0,1,0,0],D9={},j9=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},Z3=function(e){var n=_s(e,Sn);return j9(n)?Oh:n.substr(7).match(qO).map(In)},a4=function(e,n){var r=e._gsap||oc(e),s=e.style,i=Z3(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"?Oh:i):(i===Oh&&!e.offsetParent&&e!==Ou&&!r.svg&&(u=s.display,s.display="block",o=e.parentNode,(!o||!e.offsetParent&&!e.getBoundingClientRect().width)&&(d=1,l=e.nextElementSibling,Ou.appendChild(e)),i=Z3(e),u?s.display=u:Xa(e,"display"),d&&(l?o.insertBefore(e,l):o?o.appendChild(e):Ou.removeChild(e))),n&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},qx=function(e,n,r,s,i,o){var l=e._gsap,u=i||a4(e,!0),d=l.xOrigin||0,f=l.yOrigin||0,p=l.xOffset||0,g=l.yOffset||0,v=u[0],x=u[1],_=u[2],w=u[3],b=u[4],E=u[5],C=n.split(" "),R=parseFloat(C[0])||0,A=parseFloat(C[1])||0,O,I,T,M;r?u!==Oh&&(I=v*w-x*_)&&(T=R*(w/I)+A*(-_/I)+(_*E-w*b)/I,M=R*(-x/I)+A*(v/I)-(v*E-x*b)/I,R=T,A=M):(O=L9(e),R=O.x+(~C[0].indexOf("%")?R/100*O.width:R),A=O.y+(~(C[1]||C[0]).indexOf("%")?A/100*O.height:A)),s||s!==!1&&l.smooth?(b=R-d,E=A-f,l.xOffset=p+(b*v+E*_)-b,l.yOffset=g+(b*x+E*w)-E):l.xOffset=l.yOffset=0,l.xOrigin=R,l.yOrigin=A,l.smooth=!!s,l.origin=n,l.originIsAbsolute=!!r,e.style[ts]="0px 0px",o&&(Na(o,l,"xOrigin",d,R),Na(o,l,"yOrigin",f,A),Na(o,l,"xOffset",p,l.xOffset),Na(o,l,"yOffset",g,l.yOffset)),e.setAttribute("data-svg-origin",R+" "+A)},Lh=function(e,n){var r=e._gsap||new x9(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=_s(e,ts)||"0",f,p,g,v,x,_,w,b,E,C,R,A,O,I,T,M,N,j,$,K,B,z,Z,Q,U,ee,W,D,X,oe,re,se;return f=p=g=_=w=b=E=C=R=0,v=x=1,r.svg=!!(e.getCTM&&N9(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"),I=a4(e,r.svg),r.svg&&(r.uncache?(U=e.getBBox(),d=r.xOrigin-U.x+"px "+(r.yOrigin-U.y)+"px",Q=""):Q=!n&&e.getAttribute("data-svg-origin"),qx(e,Q||d,!!Q||r.originIsAbsolute,r.smooth!==!1,I)),A=r.xOrigin||0,O=r.yOrigin||0,I!==Oh&&(j=I[0],$=I[1],K=I[2],B=I[3],f=z=I[4],p=Z=I[5],I.length===6?(v=Math.sqrt(j*j+$*$),x=Math.sqrt(B*B+K*K),_=j||$?fu($,j)*Hl:0,E=K||B?fu(K,B)*Hl+_:0,E&&(x*=Math.abs(Math.cos(E*Lu))),r.svg&&(f-=A-(A*j+O*K),p-=O-(A*$+O*B))):(se=I[6],oe=I[7],W=I[8],D=I[9],X=I[10],re=I[11],f=I[12],p=I[13],g=I[14],T=fu(se,X),w=T*Hl,T&&(M=Math.cos(-T),N=Math.sin(-T),Q=z*M+W*N,U=Z*M+D*N,ee=se*M+X*N,W=z*-N+W*M,D=Z*-N+D*M,X=se*-N+X*M,re=oe*-N+re*M,z=Q,Z=U,se=ee),T=fu(-K,X),b=T*Hl,T&&(M=Math.cos(-T),N=Math.sin(-T),Q=j*M-W*N,U=$*M-D*N,ee=K*M-X*N,re=B*N+re*M,j=Q,$=U,K=ee),T=fu($,j),_=T*Hl,T&&(M=Math.cos(T),N=Math.sin(T),Q=j*M+$*N,U=z*M+Z*N,$=$*M-j*N,Z=Z*M-z*N,j=Q,z=U),w&&Math.abs(w)+Math.abs(_)>359.9&&(w=_=0,b=180-b),v=In(Math.sqrt(j*j+$*$+K*K)),x=In(Math.sqrt(Z*Z+se*se)),T=fu(z,Z),E=Math.abs(T)>2e-4?T*Hl:0,R=re?1/(re<0?-re:re):0),r.svg&&(Q=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!j9(_s(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):(x*=-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=In(v),r.scaleY=In(x),r.rotation=In(_)+l,r.rotationX=In(w)+l,r.rotationY=In(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[ts]=Sg(d)),r.xOffset=r.yOffset=0,r.force3D=bs.force3D,r.renderTransform=r.svg?Ane:O9?$9:Rne,r.uncache=0,r},Sg=function(e){return(e=e.split(" "))[0]+" "+e[1]},E_=function(e,n,r){var s=Sr(n);return In(parseFloat(n)+parseFloat(Qa(e,"x",r+"px",s)))+s},Rne=function(e,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,$9(e,n)},Ll="0deg",_f="0px",Nl=") ",$9=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,x=r.scaleX,_=r.scaleY,w=r.transformPerspective,b=r.force3D,E=r.target,C=r.zOrigin,R="",A=b==="auto"&&e&&e!==1||b===!0;if(C&&(p!==Ll||f!==Ll)){var O=parseFloat(f)*Lu,I=Math.sin(O),T=Math.cos(O),M;O=parseFloat(p)*Lu,M=Math.cos(O),o=E_(E,o,I*M*-C),l=E_(E,l,-Math.sin(O)*-C),u=E_(E,u,T*M*-C+C)}w!==_f&&(R+="perspective("+w+Nl),(s||i)&&(R+="translate("+s+"%, "+i+"%) "),(A||o!==_f||l!==_f||u!==_f)&&(R+=u!==_f||A?"translate3d("+o+", "+l+", "+u+") ":"translate("+o+", "+l+Nl),d!==Ll&&(R+="rotate("+d+Nl),f!==Ll&&(R+="rotateY("+f+Nl),p!==Ll&&(R+="rotateX("+p+Nl),(g!==Ll||v!==Ll)&&(R+="skew("+g+", "+v+Nl),(x!==1||_!==1)&&(R+="scale("+x+", "+_+Nl),E.style[Sn]=R||"translate(0, 0)"},Ane=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,x=r.xOrigin,_=r.yOrigin,w=r.xOffset,b=r.yOffset,E=r.forceCSS,C=parseFloat(o),R=parseFloat(l),A,O,I,T,M;u=parseFloat(u),d=parseFloat(d),f=parseFloat(f),f&&(f=parseFloat(f),d+=f,u+=f),u||d?(u*=Lu,d*=Lu,A=Math.cos(u)*p,O=Math.sin(u)*p,I=Math.sin(u-d)*-g,T=Math.cos(u-d)*g,d&&(f*=Lu,M=Math.tan(d-f),M=Math.sqrt(1+M*M),I*=M,T*=M,f&&(M=Math.tan(f),M=Math.sqrt(1+M*M),A*=M,O*=M)),A=In(A),O=In(O),I=In(I),T=In(T)):(A=p,T=g,O=I=0),(C&&!~(o+"").indexOf("px")||R&&!~(l+"").indexOf("px"))&&(C=Qa(v,"x",o,"px"),R=Qa(v,"y",l,"px")),(x||_||w||b)&&(C=In(C+x-(x*A+_*I)+w),R=In(R+_-(x*O+_*T)+b)),(s||i)&&(M=v.getBBox(),C=In(C+s/100*M.width),R=In(R+i/100*M.height)),M="matrix("+A+","+O+","+I+","+T+","+C+","+R+")",v.setAttribute("transform",M),E&&(v.style[Sn]=M)},Tne=function(e,n,r,s,i){var o=360,l=or(i),u=parseFloat(i)*(l&&~i.indexOf("rad")?Hl: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*F3)%o-~~(d/o)*o:p==="ccw"&&d>0&&(d=(d-o*F3)%o-~~(d/o)*o)),e._pt=g=new es(e._pt,n,r,s,d,fne),g.e=f,g.u="deg",e._props.push(r),g},W3=function(e,n){for(var r in n)e[r]=n[r];return e},Ine=function(e,n,r){var s=W3({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",o=r.style,l,u,d,f,p,g,v,x;s.svg?(d=r.getAttribute("transform"),r.setAttribute("transform",""),o[Sn]=n,l=Lh(r,1),Xa(r,Sn),r.setAttribute("transform",d)):(d=getComputedStyle(r)[Sn],o[Sn]=n,l=Lh(r,1),o[Sn]=d);for(u in Bo)d=s[u],f=l[u],d!==f&&i.indexOf(u)<0&&(v=Sr(d),x=Sr(f),p=v!==x?Qa(r,u,d,x):parseFloat(d),g=parseFloat(f),e._pt=new es(e._pt,l,u,p,g-p,Bx),e._pt.u=x||0,e._props.push(u));W3(l,s)};Jr("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});bg[e>1?"border"+t:t]=function(l,u,d,f,p){var g,v;if(arguments.length<4)return g=o.map(function(x){return Co(l,x,d)}),v=g.join(" "),v.split(g[0]).length===5?g[0]:v;g=(f+"").split(" "),v={},o.forEach(function(x,_){return v[x]=g[_]=g[_]||g[(_-1)/2|0]}),l.init(u,v,p)}});var F9={name:"css",register:Wx,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,x,_,w,b,E,C,R,A,O,I,T,M;s4||Wx(),this.styles=this.styles||M9(e),T=this.styles.props,this.tween=r;for(_ in n)if(_!=="autoRound"&&(f=n[_],!(ms[_]&&w9(_,n,r,s,e,i)))){if(v=typeof f,x=bg[_],v==="function"&&(f=f.call(r,s,e,i),v=typeof f),v==="string"&&~f.indexOf("random(")&&(f=Th(f)),x)x(this,e,_,f,r)&&(I=1);else if(_.substr(0,2)==="--")d=(getComputedStyle(e).getPropertyValue(_)+"").trim(),f+="",Va.lastIndex=0,Va.test(d)||(w=Sr(d),b=Sr(f),b?w!==b&&(d=Qa(e,_,d,b)+b):w&&(f+=w)),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[_],or(d)&&~d.indexOf("random(")&&(d=Th(d)),Sr(d+"")||d==="auto"||(d+=bs.units[_]||Sr(Co(e,_))||""),(d+"").charAt(1)==="="&&(d=Co(e,_))):d=Co(e,_),g=parseFloat(d),E=v==="string"&&f.charAt(1)==="="&&f.substr(0,2),E&&(f=f.substr(2)),p=parseFloat(f),_ in zi&&(_==="autoAlpha"&&(g===1&&Co(e,"visibility")==="hidden"&&p&&(g=0),T.push("visibility",0,l.visibility),Na(this,l,"visibility",g?"inherit":"hidden",p?"inherit":"hidden",!p)),_!=="scale"&&_!=="transform"&&(_=zi[_],~_.indexOf(",")&&(_=_.split(",")[0]))),C=_ in Bo,C){if(this.styles.save(_),M=f,v==="string"&&f.substring(0,6)==="var(--"){if(f=_s(e,f.substring(4,f.indexOf(")"))),f.substring(0,5)==="calc("){var N=e.style.perspective;e.style.perspective=f,f=_s(e,"perspective"),N?e.style.perspective=N:Xa(e,"perspective")}p=parseFloat(f)}if(R||(A=e._gsap,A.renderTransform&&!n.parseTransform||Lh(e,n.parseTransform),O=n.smoothOrigin!==!1&&A.smooth,R=this._pt=new es(this._pt,l,Sn,0,1,A.renderTransform,A,0,-1),R.dep=1),_==="scale")this._pt=new es(this._pt,A,"scaleY",A.scaleY,(E?Mu(A.scaleY,E+p):p)-A.scaleY||0,Bx),this._pt.u=0,o.push("scaleY",_),_+="X";else if(_==="transformOrigin"){T.push(ts,0,l[ts]),f=Cne(f),A.svg?qx(e,f,0,O,0,this):(b=parseFloat(f.split(" ")[2])||0,b!==A.zOrigin&&Na(this,A,"zOrigin",A.zOrigin,b),Na(this,l,_,Sg(d),Sg(f)));continue}else if(_==="svgOrigin"){qx(e,f,1,O,0,this);continue}else if(_ in D9){Tne(this,A,_,g,E?Mu(g,E+f):f);continue}else if(_==="smoothOrigin"){Na(this,A,"smooth",A.smooth,f);continue}else if(_==="force3D"){A[_]=f;continue}else if(_==="transform"){Ine(this,f,e);continue}}else _ in l||(_=dd(_)||_);if(C||(p||p===0)&&(g||g===0)&&!dne.test(f)&&_ in l)w=(d+"").substr((g+"").length),p||(p=0),b=Sr(f)||(_ in bs.units?bs.units[_]:w),w!==b&&(g=Qa(e,_,d,b)),this._pt=new es(this._pt,C?A:l,_,g,(E?Mu(g,E+p):p)-g,!C&&(b==="px"||_==="zIndex")&&n.autoRound!==!1?mne:Bx),this._pt.u=b||0,C&&M!==f?(this._pt.b=d,this._pt.e=M,this._pt.r=pne):w!==b&&b!=="%"&&(this._pt.b=d,this._pt.r=hne);else if(_ in l)Ene.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"){Gb(_,f);continue}C||(_ in l?T.push(_,0,l[_]):typeof e[_]=="function"?T.push(_,2,e[_]()):T.push(_,1,d||e[_])),o.push(_)}}I&&P9(this)},render:function(e,n){if(n.tween._time||!i4())for(var r=n._pt;r;)r.r(e,r.d),r=r._next;else n.styles.revert()},get:Co,aliases:zi,getSetter:function(e,n,r){var s=zi[n];return s&&s.indexOf(",")<0&&(n=s),n in Bo&&n!==ts&&(e._gsap.x||Co(e,"x"))?r&&$3===r?n==="scale"?_ne:yne:($3=r||{})&&(n==="scale"?xne:wne):e.style&&!Zb(e.style[n])?gne:~n.indexOf("-")?vne:n4(e,n)},core:{_removeProperty:Xa,_getMatrix:a4}};ns.utils.checkPrefix=dd;ns.core.getStyleSaver=M9;(function(t,e,n,r){var s=Jr(t+","+e+","+n,function(i){Bo[i]=1});Jr(e,function(i){bs.units[i]="deg",D9[i]=1}),zi[s[13]]=t+","+e,Jr(r,function(i){var o=i.split(":");zi[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");Jr("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){bs.units[t]="px"});ns.registerPlugin(F9);var ui=ns.registerPlugin(F9)||ns;ui.core.Tween;const gm="/assets/logo-animation",C_=1280,Mne=[{id:"eraser",src:`${gm}/eraser.png`,cssW:189,cssH:74,rot:-90,fit:337,localX:60,localY:168,seaX:.2,seaY:.27,seaRot:-8},{id:"clasp",src:`${gm}/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:`${gm}/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}],Gx=({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=Mne.map(b=>({...b})),v=()=>{s.querySelectorAll(".la-obj").forEach(T=>T.remove());const b=s.getBoundingClientRect(),E=b.width||C_,C=b.height||C_*.64;p=E/C_,i.style.width=`${242*p}px`,i.style.height=`${250*p}px`;const A=250*p/337,O=[],I=(T,M,N)=>{const j=document.createElement("div");return j.className="la-obj",j.style.width=`${M}px`,j.innerHTML=`<img src="${T}" alt="" style="${N?"transform:scaleX(-1)":""}">`,s.appendChild(j),j};return One.forEach((T,M)=>{const N=T.w*p,j=I(`${gm}/sea/${T.k}.png`,N,M%2===0);ui.set(j,{x:T.x*E-N/2,y:T.y*C-N/2,rotation:T.r,opacity:1,scale:0,transformOrigin:"50% 50%"}),O.push({el:j,hero:!1,rest:1})}),g.forEach(T=>{const M=T.cssW*p;T.el=I(T.src,M,!!T.flip),T.finalScale=T.fit*A/(T.cssW*p),ui.set(T.el,{x:T.seaX*E-M/2,y:T.seaY*C-T.cssH*p/2,rotation:T.seaRot,opacity:1,scale:0,transformOrigin:"50% 50%",zIndex:30}),O.push({el:T.el,hero:!0,rest:150/T.cssW})}),O},x=(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=ui.context(()=>{b.filter(R=>!R.hero).forEach(R=>ui.set(R.el,{scale:0})),g.forEach(R=>{if(!R.el)return;const A=x(R.localX,R.localY);ui.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=ui.context(()=>{const R=ui.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:O},I)=>{const T=O?E:C,M=I%2?1:-1;T.push(ui.to(A,{rotation:"+="+u(2.5,6)*M,duration:u(.5,.9),repeat:-1,yoyo:!0,ease:"steps(2)",delay:u(0,.4)}),ui.to(A,{y:"+="+u(5,11)*M,x:"+="+u(4,9)*-M,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,O)=>{A.el&&R.to(A.el,{scale:150/A.cssW*1.2,duration:.28,ease:"steps(3)",yoyo:!0,repeat:1},"pick+="+O*.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,O)=>{if(!A.el||A.finalScale===void 0)return;const I=x(A.localX,A.localY);R.to(A.el,{x:I.x-A.cssW*p/2,y:I.y-A.cssH*p/2,rotation:A.rot,scale:A.finalScale,duration:1.05,ease:"steps(9)",overwrite:"auto"},"assemble+="+O*.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)};ui.ticker.fps(12),_();const w=()=>{clearTimeout(f),f=setTimeout(_,250)};return window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w),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"})})})},Lne=Object.freeze(Object.defineProperty({__proto__:null,default:Gx},Symbol.toStringTag,{value:"Module"})),q3=({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"})]}),Nne=({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(Gx,{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(q3,{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(Gx,{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(q3,{isSigningIn:t})}),n?S.jsx("p",{className:"text-center text-xs text-red-500",children:n}):null]})]}),Dne="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",jne=({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:Dne,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(Fg,{className:"h-5 w-5 shrink-0 animate-spin text-primary",weight:"bold"}),S.jsx("span",{children:t})]})]})}),$ne="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",kg=44,xf=8,z0=16,Fne=4,G3=-18,Vne=.18,Hne=[.22,1,.36,1],K3=.92,zne=1,Une=.95,Bne=.4,Zne=[.19,1,.22,1],P_=0,Wne=1,qne=0,Gne=0,Kne=0,V9=({position:t,viewport:e,boundsLeft:n=0})=>{const r=n+xf,s=Math.max(r,e.width-kg-xf),i=Math.max(xf,e.height-kg-xf);return{x:Math.min(s,Math.max(r,t.x)),y:Math.min(i,Math.max(xf,t.y))}},l4=()=>({width:window.innerWidth,height:window.innerHeight}),Yne=({position:t,boundsLeftPx:e=0})=>V9({position:t,viewport:l4(),boundsLeft:e}),Xne=()=>{if(typeof window>"u")return{x:z0,y:z0};const t=l4();return{x:t.width-kg-z0,y:t.height-kg-z0}},Qne=({deltaX:t,deltaY:e})=>Math.hypot(t,e)>=Fne,Jne=t=>t.button===void 0||t.button<=Kne,Y3=t=>{const e=t.nativeEvent;return{x:Number.isFinite(t.clientX)?t.clientX:e.clientX,y:Number.isFinite(t.clientY)?t.clientY:e.clientY}},ere=({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:P_,scale:K3,x:G3},x=n?{opacity:P_}:{opacity:P_,scale:K3,x:G3},_=n?{duration:Gne}:{duration:Vne,ease:Hne,scale:{duration:Bne,ease:Zne}},w=m.useCallback(()=>{const A=l.current;A&&(u.current=A.hasMoved),l.current=null,f(!1)},[]),b=m.useCallback(A=>{const O=l.current;if(!O)return;const I=Y3(A),T=I.x-O.startPointer.x,M=I.y-O.startPointer.y,N=O.hasMoved||Qne({deltaX:T,deltaY:M});l.current={...O,hasMoved:N},N&&o(V9({position:{x:O.startPosition.x+T,y:O.startPosition.y+M},viewport:l4(),boundsLeft:s}))},[o,s]),E=m.useCallback(A=>{if(l.current||!Jne(A))return;const O=Y3(A);l.current={startPointer:O,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:w,onPointerCancel:w,onMouseMove:b,onMouseUp:w}):null,S.jsx(ws,{children:t?S.jsx(_c,{label:R,side:"top",forceOpen:p&&!d?void 0:!1,children:S.jsx(yi.button,{type:"button","aria-label":R,"data-cy":"reopen-panel",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),initial:v,animate:{opacity:Wne,scale:zne,x:qne},whileTap:{scale:Une},exit:x,transition:_,onPointerDown:E,onMouseDown:E,onPointerMove:b,onPointerUp:w,onPointerCancel:w,onMouseMove:b,onMouseUp:w,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:$ne,alt:"","aria-hidden":"true",draggable:!1,className:"h-4 w-4 brightness-0 invert"})})}):null})]})},R_=Rs("useConfig"),tre=300*1e3,nre=1800*1e3,rre=60*1e3,sre=300*1e3,ire=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.queueAccessToken)??null},ore=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},are=t=>({...lO,...t??{}}),lre=()=>{const t=ct(Px),e=gt(Px),n=gt(gO),r=gt(vO),s=gt(rv),i=gt(lJ),o=gt(oJ),l=gt(iJ),u=gt(nv),d=gt(eJ),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??ore()??null),i(b.queueAccessToken??ire())},[s,o,n,r,i,d]),p=eh({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:tre,gcTime:nre}),g=eh({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:rre,gcTime:sre}),{refetch:v}=p,{refetch:x}=g;m.useLayoutEffect(()=>{p.data&&(f(p.data),u(!1),R_.info("Config loaded:",p.data)),g.data&&(e(are(g.data.featureFlags)),l(!0))},[p.data,g.data,f,u,e,l]),m.useLayoutEffect(()=>{p.error&&(l(!0),u(!1),R_.warn("Failed to load config:",p.error instanceof Error?p.error.message:"Failed to load config")),g.error&&(l(!0),R_.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(),x()]);return b.data?b.data:null},[v,x]);let w=null;return p.error instanceof Error?w=p.error.message:p.error&&(w="Failed to load config"),{config:p.data??null,featureFlags:t,loading:p.isPending||!p.error&&g.isPending,error:w,refetchConfig:_}},hu=Rs("useOAuthCallback"),cre="https://rivet-proxy.onrender.com",ure=()=>{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{hu.info("Processing OAuth callback...");const f=new URLSearchParams(i.substring(1)),p=f.get("access_token"),g=f.get("refresh_token"),x=new URLSearchParams(o).get("session");if(!p)throw new Error("No access token found in URL");if(!x)throw new Error("No session ID found in URL");hu.info(`Completing OAuth with session: ${x}`);const _=await fetch(`${cre}/api/auth/google/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:x,accessToken:p,refreshToken:g}),signal:n.signal}),w=await _.json();if(!_.ok||!w.success)throw new Error(w.error||w.message||"Failed to complete authentication");if(hu.info("OAuth authentication completed successfully"),r)return;if((l=w.user)!=null&&l.id?(Ce.identify(w.user.id,{...w.user.email?{email:w.user.email}:{}}),w.user.email&&Ce.alias(w.user.email,w.user.id)):(u=w.user)!=null&&u.email&&Ce.identify(w.user.email,{email:w.user.email}),(d=w.user)!=null&&d.email&&p)try{const E=await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:w.user.email,token:p,refreshToken:g,userId:w.user.id}),signal:n.signal});E.ok||hu.warn(`Local auth store returned ${E.status}`)}catch(E){if(r)return;hu.warn("Failed to store auth locally:",E)}if(r)return;window.sessionStorage.setItem(gg,"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";hu.warn("OAuth callback error:",f),e({isProcessing:!1,isComplete:!1,error:p})}}})(),()=>{r=!0,n.abort()}},[]),t},A_=Rs("useAgentVariantsSession"),dre=t=>typeof t.pendingCount=="number"&&t.pendingCount===0&&(t.pendingVariantRequests??0)===0&&(t.leasedVariantRequests??0)===0&&(t.activeLeases??[]).length===0,X3=(t,e,n)=>{e.size===0&&!n||t.set(Ch,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})},fre=(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},hre=({enabled:t=!0}={})=>{const e=gt(Qh),n=gt(pO),r=gt(cO),s=gt(JQ),i=gt(mO),o=gt(sJ),l=Mg(),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(w=>w.requestId).filter(w=>!!w));i(w=>w.filter(E=>!_.has(E.requestId))),X3(l,_,!1),l.set(Ch,w=>{let b=w;for(const E of p.variants){const C=E.adoptedSource;C&&(b=rJ(b,{kind:"variant",sessionId:C.sessionId,variantId:C.variantId},{kind:"variant",sessionId:p.sessionId,variantId:E.workItemId}))}return b}),l.set(Ch,w=>fre(w,p)),p.sessionId!==u.current&&(u.current=p.sessionId,r(!0),s("directions"))}else u.current=null,X3(l,new Set,dre(p));e(p),n(!0);const v=!p.active&&g!==null,x=p.active&&p.sessionId!==g;if(x&&fetch(`/api/variants/${p.sessionId}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(_=>A_.warn("failed to reset preview-port on session switch",_)),v||x){const _=new Set;if(p.active)for(const b of p.variants)_.add(kh({kind:"variant",sessionId:p.sessionId,variantId:b.workItemId}));const w=l.get(zo);for(const b of[w==null?void 0:w.left,w==null?void 0:w.right])b&&_.add(kh({kind:"variant",sessionId:b.sessionId,variantId:b.variantId}));o(_)}}catch(p){A_.warn("failed to parse SSE event payload",p)}},d.onerror=f=>{A_.warn("SSE error (auto-reconnects)",f)},()=>{d.close()}},[t,e,n,r,s,i,o,l])};var pre=Object.defineProperty,sr=(t,e)=>pre(t,"name",{value:e,configurable:!0});function c4(t){const e=t+"CollectionProvider",[n,r]=Qi(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=sr(_=>{const{scope:w,children:b}=_,E=m.useRef(null),C=m.useRef(new Map).current;return S.jsx(s,{scope:w,itemMap:C,collectionRef:E,children:b})},"CollectionProvider");o.displayName=e;const l=t+"CollectionSlot",u=Wa(l),d=m.forwardRef((_,w)=>{const{scope:b,children:E}=_,C=i(l,b),R=en(w,C.collectionRef);return S.jsx(u,{ref:R,children:E})});d.displayName=l;const f=t+"CollectionItemSlot",p="data-radix-collection-item",g=Wa(f),v=m.forwardRef((_,w)=>{const{scope:b,children:E,...C}=_,R=m.useRef(null),A=en(w,R),O=i(f,b);return m.useEffect(()=>(O.itemMap.set(R,{ref:R,...C}),()=>void O.itemMap.delete(R))),S.jsx(g,{[p]:"",ref:A,children:E})});v.displayName=f;function x(_){const w=i(t+"CollectionConsumer",_);return m.useCallback(()=>{const E=w.collectionRef.current;if(!E)return[];const C=Array.from(E.querySelectorAll(`[${p}]`));return Array.from(w.itemMap.values()).sort((O,I)=>C.indexOf(O.ref.current)-C.indexOf(I.ref.current))},[w.collectionRef,w.itemMap])}return sr(x,"useCollection"),[{Provider:o,Slot:d,ItemSlot:v},x,r]}sr(c4,"createCollection");var Q3=new WeakMap,jn,ps,T_=(ps=class extends Map{constructor(n){super(n);tt(this,jn);Ae(this,jn,[...super.keys()]),Q3.set(this,!0)}set(n,r){return Q3.get(this)&&(this.has(n)?q(this,jn)[q(this,jn).indexOf(n)]=n:q(this,jn).push(n)),super.set(n,r),this}insert(n,r,s){const i=this.has(r),o=q(this,jn).length,l=u4(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,jn)];let g,v=!1;for(let x=u;x<f;x++)if(u===x){let _=p[x];p[x]===r&&(_=p[x+1]),i&&this.delete(r),g=this.get(_),this.set(r,s)}else{!v&&p[x-1]===r&&(v=!0);const _=p[v?x:x-1],w=g;g=this.get(_),this.delete(_),this.set(_,w)}return this}with(n,r,s){const i=new ps(this);return i.insert(n,r,s),i}before(n){const r=q(this,jn).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,s){const i=q(this,jn).indexOf(n);return i===-1?this:this.insert(i,r,s)}after(n){let r=q(this,jn).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,jn).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,jn,[]),super.clear()}delete(n){const r=super.delete(n);return r&&q(this,jn).splice(q(this,jn).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=vm(q(this,jn),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=vm(q(this,jn),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return q(this,jn).indexOf(n)}keyAt(n){return vm(q(this,jn),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 ps(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 ps(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 ps(r)}toReversed(){const n=new ps;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 ps(r)}slice(n,r){const s=new ps;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}},jn=new WeakMap,sr(ps,"OrderedDict"),ps);function vm(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=H9(t,e);return n===-1?void 0:t[n]}sr(vm,"at");function H9(t,e){const n=t.length,r=u4(e),s=r>=0?r:n+r;return s<0||s>=n?-1:s}sr(H9,"toSafeIndex");function u4(t){return t!==t||t===0?0:Math.trunc(t)}sr(u4,"toSafeInteger");function mre(t){const e=t+"CollectionProvider",[n,r]=Qi(e),[s,i]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new T_,setItemMap:sr(()=>{},"setItemMap")}),o=sr(({state:C,...R})=>C?S.jsx(u,{...R,state:C}):S.jsx(l,{...R}),"CollectionProvider");o.displayName=e;const l=sr(C=>{const R=w();return S.jsx(u,{...C,state:R})},"CollectionInit");l.displayName=e+"Init";const u=sr(C=>{const{scope:R,children:A,state:O}=C,I=m.useRef(null),[T,M]=m.useState(null),N=en(I,M),[j,$]=O;return m.useEffect(()=>{if(!T)return;const K=B9(()=>{});return K.observe(T,{childList:!0,subtree:!0}),()=>{K.disconnect()}},[T]),S.jsx(s,{scope:R,itemMap:j,setItemMap:$,collectionRef:N,collectionRefObject:I,collectionElement:T,children:A})},"CollectionProviderImpl");u.displayName=e+"Impl";const d=t+"CollectionSlot",f=Wa(d),p=m.forwardRef((C,R)=>{const{scope:A,children:O}=C,I=i(d,A),T=en(R,I.collectionRef);return S.jsx(f,{ref:T,children:O})});p.displayName=d;const g=t+"CollectionItemSlot",v="data-radix-collection-item",x=Wa(g),_=m.forwardRef((C,R)=>{const{scope:A,children:O,...I}=C,T=m.useRef(null),[M,N]=m.useState(null),j=en(R,T,N),$=i(g,A),{setItemMap:K}=$,B=m.useRef(I);z9(B.current,I)||(B.current=I);const z=B.current;return m.useEffect(()=>{const Z=z;return K(Q=>M?Q.has(M)?Q.set(M,{...Z,element:M}).toSorted(Kx):(Q.set(M,{...Z,element:M}),Q.toSorted(Kx)):Q),()=>{K(Q=>!M||!Q.has(M)?Q:(Q.delete(M),new T_(Q)))}},[M,z,K]),S.jsx(x,{[v]:"",ref:j,children:O})});_.displayName=g;function w(){return m.useState(new T_)}sr(w,"useInitCollection");function b(C){const{itemMap:R}=i(t+"CollectionConsumer",C);return R}return sr(b,"useCollection"),[{Provider:o,Slot:p,ItemSlot:_},{createCollectionScope:r,useCollection:b,useInitCollection:w}]}sr(mre,"createCollection");function z9(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}sr(z9,"shallowEqual");function U9(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}sr(U9,"isElementPreceding");function Kx(t,e){return!t[1].element||!e[1].element?0:U9(t[1].element,e[1].element)?-1:1}sr(Kx,"sortByDocumentPosition");function B9(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}sr(B9,"getChildListObserver");var gre=Object.defineProperty,tp=(t,e)=>gre(t,"name",{value:e,configurable:!0}),d4="Collapsible",[vre,Z9]=Qi(d4),[yre,f4]=vre(d4),_re=m.forwardRef(tp(function(e,n){const{__scopeCollapsible:r,open:s,defaultOpen:i,disabled:o,onOpenChange:l,...u}=e,[d,f]=rl({prop:s,defaultProp:i??!1,onChange:l,caller:d4});return S.jsx(yre,{scope:r,disabled:o,contentId:ja(),open:d,onOpenToggle:m.useCallback(()=>f(p=>!p),[f]),children:S.jsx(kn.div,{"data-state":lv(d),"data-disabled":o?"":void 0,...u,ref:n})})},"Collapsible")),xre="CollapsibleTrigger",wre=m.forwardRef(tp(function(e,n){const{__scopeCollapsible:r,...s}=e,i=f4(xre,r);return S.jsx(kn.button,{type:"button","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":lv(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...s,ref:n,onClick:Gt(e.onClick,i.onOpenToggle)})},"CollapsibleTrigger")),W9="CollapsibleContent",bre=m.forwardRef(tp(function(e,n){const{forceMount:r,...s}=e,i=f4(W9,e.__scopeCollapsible);return S.jsx(nl,{present:r||i.open,children:({present:o})=>S.jsx(Sre,{...s,ref:n,present:o})})},"CollapsibleContent")),Sre=m.forwardRef(tp(function(e,n){const{__scopeCollapsible:r,present:s,children:i,...o}=e,l=f4(W9,r),[u,d]=m.useState(s),f=m.useRef(null),p=en(n,f),g=m.useRef(0),v=g.current,x=m.useRef(0),_=x.current,w=l.open||u,b=m.useRef(w),E=m.useRef(void 0);return m.useEffect(()=>{const C=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(C)},[]),Yr(()=>{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,x.current=R.width,b.current||(C.style.transitionDuration=E.current.transitionDuration,C.style.animationName=E.current.animationName),d(s)}},[l.open,s]),S.jsx(kn.div,{"data-state":lv(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!w,...o,ref:p,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":_?`${_}px`:void 0,...e.style},children:w&&i})},"CollapsibleContentImpl"));function lv(t){return t?"open":"closed"}tp(lv,"getState");var kre=_re,Ere=wre,Cre=bre,Pre=Object.defineProperty,Rre=(t,e)=>Pre(t,"name",{value:e,configurable:!0}),Are=m.createContext(void 0);function h4(t){const e=m.useContext(Are);return t||e||"ltr"}Rre(h4,"useDirection");var Tre=Object.defineProperty,Ss=(t,e)=>Tre(t,"name",{value:e,configurable:!0}),Ji="Accordion",Ire=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[p4,Mre,Ore]=c4(Ji),[cv,coe]=Qi(Ji,[Ore,Z9]),m4=Z9(),Lre=m.forwardRef(Ss(function(e,n){const{type:r,...s}=e,i=s,o=s;return S.jsx(p4.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?S.jsx($re,{...o,ref:n}):S.jsx(jre,{...i,ref:n})})},"Accordion")),[q9,Nre]=cv(Ji),[G9,Dre]=cv(Ji,{collapsible:!1}),jre=m.forwardRef(Ss(function(e,n){const{value:r,defaultValue:s,onValueChange:i=Ss(()=>{},"onValueChange"),collapsible:o=!1,...l}=e,[u,d]=rl({prop:r,defaultProp:s??"",onChange:i,caller:Ji});return S.jsx(q9,{scope:e.__scopeAccordion,value:m.useMemo(()=>u?[u]:[],[u]),onItemOpen:d,onItemClose:m.useCallback(()=>o&&d(""),[o,d]),children:S.jsx(G9,{scope:e.__scopeAccordion,collapsible:o,children:S.jsx(K9,{...l,ref:n})})})},"AccordionImplSingle")),$re=m.forwardRef(Ss(function(e,n){const{value:r,defaultValue:s,onValueChange:i=Ss(()=>{},"onValueChange"),...o}=e,[l,u]=rl({prop:r,defaultProp:s??[],onChange:i,caller:Ji}),d=m.useCallback(p=>u((g=[])=>[...g,p]),[u]),f=m.useCallback(p=>u((g=[])=>g.filter(v=>v!==p)),[u]);return S.jsx(q9,{scope:e.__scopeAccordion,value:l,onItemOpen:d,onItemClose:f,children:S.jsx(G9,{scope:e.__scopeAccordion,collapsible:!0,children:S.jsx(K9,{...o,ref:n})})})},"AccordionImplMultiple")),[Fre,uv]=cv(Ji),K9=m.forwardRef(Ss(function(e,n){const{__scopeAccordion:r,disabled:s,dir:i,orientation:o="vertical",...l}=e,u=m.useRef(null),d=en(u,n),f=Mre(r),g=h4(i)==="ltr",v=Gt(e.onKeyDown,x=>{var M;if(!Ire.includes(x.key))return;const _=x.target,w=f().filter(N=>{var j;return!((j=N.ref.current)!=null&&j.disabled)}),b=w.findIndex(N=>N.ref.current===_),E=w.length;if(b===-1)return;x.preventDefault();let C=b;const R=0,A=E-1,O=Ss(()=>{C=b+1,C>A&&(C=R)},"moveNext"),I=Ss(()=>{C=b-1,C<R&&(C=A)},"movePrev");switch(x.key){case"Home":C=R;break;case"End":C=A;break;case"ArrowRight":o==="horizontal"&&(g?O():I());break;case"ArrowDown":o==="vertical"&&O();break;case"ArrowLeft":o==="horizontal"&&(g?I():O());break;case"ArrowUp":o==="vertical"&&I();break}const T=C%E;(M=w[T].ref.current)==null||M.focus()});return S.jsx(Fre,{scope:r,disabled:s,direction:i,orientation:o,children:S.jsx(p4.Slot,{scope:r,children:S.jsx(kn.div,{...l,"data-orientation":o,ref:d,onKeyDown:s?void 0:v})})})},"AccordionImpl")),Yx="AccordionItem",[Vre,g4]=cv(Yx),Hre=m.forwardRef(Ss(function(e,n){const{__scopeAccordion:r,value:s,...i}=e,o=uv(Yx,r),l=Nre(Yx,r),u=m4(r),d=ja(),f=s&&l.value.includes(s)||!1,p=o.disabled||e.disabled;return S.jsx(Vre,{scope:r,open:f,disabled:p,triggerId:d,children:S.jsx(kre,{"data-orientation":o.orientation,"data-state":v4(f),...u,...i,ref:n,disabled:p,open:f,onOpenChange:g=>{g?l.onItemOpen(s):l.onItemClose(s)}})})},"AccordionItem")),zre="AccordionHeader",Ure=m.forwardRef(Ss(function(e,n){const{__scopeAccordion:r,...s}=e,i=uv(Ji,r),o=g4(zre,r);return S.jsx(kn.h3,{"data-orientation":i.orientation,"data-state":v4(o.open),"data-disabled":o.disabled?"":void 0,...s,ref:n})},"AccordionHeader")),J3="AccordionTrigger",Bre=m.forwardRef(Ss(function(e,n){const{__scopeAccordion:r,...s}=e,i=uv(Ji,r),o=g4(J3,r),l=Dre(J3,r),u=m4(r);return S.jsx(p4.ItemSlot,{scope:r,children:S.jsx(Ere,{"aria-disabled":o.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId,...u,...s,ref:n})})},"AccordionTrigger")),Zre="AccordionContent",Wre=m.forwardRef(Ss(function(e,n){const{__scopeAccordion:r,...s}=e,i=uv(Ji,r),o=g4(Zre,r),l=m4(r);return S.jsx(Cre,{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 v4(t){return t?"open":"closed"}Ss(v4,"getState");var Y9=Lre,qre=Hre,Gre=Ure,Kre=Bre,Yre=Wre;/**
|
|
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 Xre=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 Qre(t,e,n=[]){if(e==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:Xre(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 Jre=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 ese=t=>{const e=Jre(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 Xx=(...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 Dl={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 I_(t){return t!=null}function tse(t,e={}){var g,v;const n=e.attributeNames??{},r=x=>n[x]??x,s=t.size??t.width??Dl.width,i=t.size??t.height??Dl.height,o=((g=t.aliases)==null?void 0:g.filter(x=>typeof x=="string"&&x.trim()!=="").map(x=>`lucide-${x}`))??[],l=[...t.name?[`lucide-${t.name}`]:[],...o],u=((v=e.className)==null?void 0:v.split(" ").filter(Boolean))??[],d=e.includeDefaultClasses===!1?Xx(...u):Xx("lucide",...l,...u),f=e.absoluteStrokeWidth?Number(e.strokeWidth??Dl["stroke-width"])*Number(t.size??t.width??Dl.width)/Number(e.size??e.width??Dl.width):e.strokeWidth??Dl["stroke-width"];return["svg",{...Object.entries(Dl).reduce((x,[_,w])=>(x[r(_)]=w,x),{}),..."color"in e&&e.color&&{[r("stroke")]:e.color},..."size"in e&&I_(e.size)&&{[r("width")]:e.size,[r("height")]:e.size},..."width"in e&&I_(e.width)&&{[r("width")]:e.width},..."height"in e&&I_(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(x=>{const[_,w,b]=x,E=e.nonScalingStroke?{[r("vector-effect")]:"non-scaling-stroke",...w}:w;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 nse(t,e={}){return tse(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 rse=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},sse=m.createContext({}),ise=()=>m.useContext(sse),ose=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:x=2,absoluteStrokeWidth:_=!1,nonScalingStroke:w=!1,color:b="currentColor",className:E=""}=ise()??{},C=!!u||rse(p),[R,A,O=[]]=nse(f,{color:t??b,width:n??e??v,height:r??e??v,strokeWidth:s??x,absoluteStrokeWidth:i??_,nonScalingStroke:o??w,className:Xx(E,l),hasA11yProp:C,attributes:p});return m.createElement(R,{ref:g,...A},[...O.map(([I,T])=>m.createElement(I,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 it(t,e=[],n=[]){const r=typeof t=="string"?Qre(t,e,n):t,s=m.forwardRef(({className:i,...o},l)=>m.createElement(ose,{ref:l,icon:r,className:i,...o}));return r.name&&(s.displayName=ese(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 X9={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};X9.node;const ase=it(X9);/**
|
|
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 Q9={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};Q9.node;const lse=it(Q9);/**
|
|
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 J9={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};J9.node;const cse=it(J9);/**
|
|
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 eL={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"}]]};eL.node;const use=it(eL);/**
|
|
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 tL={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"}]]};tL.node;const dse=it(tL);/**
|
|
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 nL={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};nL.node;const fse=it(nL);/**
|
|
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 rL={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};rL.node;const hse=it(rL);/**
|
|
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 sL={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};sL.node;const pse=it(sL);/**
|
|
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 iL={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};iL.node;const mse=it(iL);/**
|
|
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 oL={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};oL.node;const gse=it(oL);/**
|
|
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 aL={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"}]]};aL.node;const vse=it(aL);/**
|
|
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 lL={name:"dot",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]};lL.node;const yse=it(lL);/**
|
|
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 cL={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"}]]};cL.node;const _se=it(cL);/**
|
|
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 uL={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"}]]};uL.node;const xse=it(uL);/**
|
|
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 dL={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"]};dL.node;const wse=it(dL);/**
|
|
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 fL={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"}]]};fL.node;const bse=it(fL);/**
|
|
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 hL={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"}]]};hL.node;const Sse=it(hL);/**
|
|
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 pL={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"}]]};pL.node;const kse=it(pL);/**
|
|
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 mL={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"}]]};mL.node;const Ese=it(mL);/**
|
|
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 gL={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"}]]};gL.node;const Cse=it(gL);/**
|
|
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 vL={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"}]]};vL.node;const Pse=it(vL);/**
|
|
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 yL={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"}]]};yL.node;const Rse=it(yL);/**
|
|
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 _L={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};_L.node;const Ase=it(_L);/**
|
|
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 xL={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"}]]};xL.node;const Tse=it(xL);/**
|
|
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 wL={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"}]]};wL.node;const Ise=it(wL);/**
|
|
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 bL={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"}]]};bL.node;const Mse=it(bL);/**
|
|
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 SL={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"}]]};SL.node;const Ose=it(SL);/**
|
|
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 kL={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"}]]};kL.node;const Lse=it(kL);/**
|
|
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 EL={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"}]]};EL.node;const Nse=it(EL);/**
|
|
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 CL={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"}]]};CL.node;const Dse=it(CL);/**
|
|
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 PL={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"}]]};PL.node;const jse=it(PL);/**
|
|
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 RL={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"}]]};RL.node;const $se=it(RL);/**
|
|
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 AL={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};AL.node;const Fse=it(AL);/**
|
|
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 TL={name:"rectangle-horizontal",size:24,node:[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]]};TL.node;const Vse=it(TL);/**
|
|
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 IL={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"}]]};IL.node;const Hse=it(IL);/**
|
|
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 ML={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"}]]};ML.node;const zse=it(ML);/**
|
|
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 OL={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};OL.node;const Use=it(OL);/**
|
|
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 LL={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"}]]};LL.node;const Bse=it(LL);/**
|
|
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 NL={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"}]]};NL.node;const Zse=it(NL);/**
|
|
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 DL={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"}]]};DL.node;const Wse=it(DL);/**
|
|
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 jL={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"]};jL.node;const qse=it(jL);/**
|
|
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 $L={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"}]]};$L.node;const Gse=it($L);/**
|
|
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 FL={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"}]]};FL.node;const Kse=it(FL);/**
|
|
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 VL={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"}]]};VL.node;const Yse=it(VL);/**
|
|
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 HL={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"}]]};HL.node;const Xse=it(HL);/**
|
|
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 zL={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};zL.node;const Qse=it(zL),Jse={"chevron-right":pse,"chevron-down":hse,pipette:jse,x:Qse,copy:vse,menu:Ase,dot:yse,monitor:Ise,sun:Kse,moon:Mse,"rectangle-horizontal":Vse,circle:mse,"square-library":qse,clock:gse,star:Gse,settings:Bse,plus:Fse,"arrow-left":ase,"arrow-right":lse,"arrow-up":cse,search:Use,loader:Cse,users:Xse,lock:Pse,mail:Rse,bell:use,shield:Zse,palette:Lse,lightbulb:kse,rocket:Hse,heart:xse,paintbrush:Ose,brain:dse,globe:_se,user:Yse,image:bse,link:Ese,check:fse,"rotate-ccw":zse,play:$se,pause:Nse,home:wse,"message-circle":Tse,inbox:Sse,pencil:Dse,"skip-forward":Wse},eP={lucide:Jse},UL=m.createContext(null);function eie(t){const e=m.useContext(UL);return e?eP[e.iconLibrary][t]:eP.lucide[t]}function tie({children:t,defaultLibrary:e="lucide"}){const[n,r]=m.useState(e),s=m.useCallback(i=>{r(i)},[]);return S.jsx(UL.Provider,{value:{iconLibrary:n,setIconLibrary:s},children:t})}const BL=m.createContext(null);function y4(){return m.useContext(BL)}const ZL=m.createContext(null);function WL(){const t=m.useContext(ZL);if(!t)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return t}const nie=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:x,registerItem:_,measureItems:w}=nO(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,O]=m.useState(()=>r==="multiple"?t.defaultValue??[]:[]),I=t.onValueChange,T=t.onValueChange,M=t.value,N=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)},[I]),$=m.useCallback(de=>{const ae=t;ae.onValueChange?ae.onValueChange(de):O(de)},[T]),K=m.useCallback(de=>{if(r==="multiple"){const ae=t.value??A;$(ae.filter(Oe=>Oe!==de))}else j("")},[r,j,$,A,M]);m.useEffect(()=>{w(),E()},[w,E,n]);const B=[...N].join(",");m.useEffect(()=>{w(),E()},[w,E,B]);const[z,Z]=m.useState(null),Q=f!==null?g[f]:null,U=z!==null?g[z]:null,ee=f!==null&&!u.has(f),W=Kh(),{value:D,defaultValue:X,onValueChange:oe,collapsible:re,type:se,...fe}=i,_e=r==="multiple"?{type:"multiple",value:t.value??A,onValueChange:$}:{type:"single",collapsible:t.collapsible??!0,value:t.value??C,onValueChange:j};return S.jsx(BL.Provider,{value:{registerItem:_,registerFullItem:b,activeIndex:f,grouped:!0,remeasure:()=>{w(),E()},openValues:N,openItemRects:u,toggleValue:K},children:S.jsx(Y9,{..._e,asChild:!0,children:S.jsxs("div",{ref:de=>{o.current=de,typeof e=="function"?e(de):e&&(e.current=de)},onMouseEnter:x.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,Mt=(de.clientY-Oe.top)/vt+ae.scrollTop;for(const[Xt,xt]of u){const yt=g[Xt];if(!yt)continue;const We=yt.top+yt.height,Ke=xt.top+xt.height;if(Mt>=We&&Mt<=Ke){p(null);return}}}x.onMouseMove(de)},onMouseLeave:x.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(Lo.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(Lo.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:{...Sh.fast,opacity:{duration:.08}}},v.current)}),S.jsx(ws,{children:U&&S.jsx(Lo.div,{className:`absolute ${W.focusRing} pointer-events-none z-20 border border-[#6B97FF]`,initial:!1,animate:{left:U.left-2,top:U.top-2,width:U.width+4,height:U.height+4},exit:{opacity:0,transition:{duration:.06}},transition:{...Sh.fast,opacity:{duration:.08}}})}),n]})})})});nie.displayName="AccordionGroup";const qL=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]:[]})()),x=m.useCallback(E=>{i?i(E):f(E)},[i]),_=m.useCallback(E=>{i?i(E):g(E)},[i]),w=m.useCallback(E=>{e==="multiple"?_((s??p).filter(R=>R!==E)):x("")},[e,s,p,x,_]),b=e==="multiple"?{type:"multiple",value:s??p,defaultValue:r,onValueChange:_}:{type:"single",collapsible:n,value:s??d,defaultValue:r,onValueChange:x};return S.jsx(Y9,{...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(GL.Provider,{value:v,children:S.jsx(KL.Provider,{value:w,children:t})})})})});qL.displayName="Accordion";const GL=m.createContext(new Set),KL=m.createContext(()=>{}),YL=m.forwardRef(({value:t,index:e,disabled:n,children:r,className:s,...i},o)=>{const l=m.useRef(null),u=y4(),d=m.useContext(GL),f=m.useContext(KL),p=Kh(),g=u!=null&&u.grouped?u.openValues.has(t):d.has(t),v=m.useRef(null),x=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(ZL.Provider,{value:{index:e,value:t,isOpen:g,onToggle:x,triggerRef:v},children:S.jsxs(qre,{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(Lo.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]})})});YL.displayName="AccordionItem";const XL=m.forwardRef(({children:t,className:e,...n},r)=>{const s=eie("chevron-right"),i=y4(),{index:o,isOpen:l,triggerRef:u}=WL(),d=Kh(),[f,p]=m.useState(!1),g=i!=null&&i.grouped?i.activeIndex===o:f,v=S.jsx(Gre,{asChild:!0,children:S.jsx("div",{children:S.jsxs(Kre,{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:qf.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?qf.semibold:qf.normal},children:t})]}),S.jsx(Lo.span,{className:"shrink-0 inline-flex items-center justify-center",animate:{rotate:l?90:0},transition:Sh.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(Lo.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]})});XL.displayName="AccordionTrigger";const QL=m.forwardRef(({children:t,className:e,...n},r)=>{const s=y4(),{isOpen:i}=WL();return S.jsx(ws,{initial:!1,children:i&&S.jsx(Yre,{forceMount:!0,asChild:!0,...n,children:S.jsx(Lo.div,{ref:r,className:zt("overflow-hidden",e),initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{...Sh.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})})})})});QL.displayName="AccordionContent";const ym=({children:t,defaultValue:e=[],className:n=""})=>S.jsx(qL,{type:"multiple",defaultValue:e,className:zt("w-full",n),children:t}),rie=({value:t,title:e,description:n,dataCy:r,icon:s,children:i,className:o=""})=>{const l=o.includes("first-item");return S.jsxs(YL,{value:t,className:zt("w-full",!l&&"border-t border-main-border"),children:[S.jsxs(XL,{"data-cy":r,children:[s?S.jsx("span",{className:"mr-1 inline-flex items-center",children:s}):null,e]}),S.jsxs(QL,{children:[n?S.jsx("p",{className:"pb-2 text-sm text-content-subtle",children:n}):null,i]})]})};ym.Item=rie;const sie=({message:t,isLoading:e=!0})=>S.jsxs("div",{className:"flex items-center gap-2 text-sm text-content",children:[e?S.jsx(Fg,{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})]}),iie=()=>{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},oie=t=>{const e=Math.floor(t/60),n=t%60;return`${e}:${n.toString().padStart(2,"0")}`},tP="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",nP="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",aie="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",_m=["Applying","Thinking","Planning","Crafting"],lie=_m.reduce((t,e)=>t.length>=e.length?t:e),cie=20,uie="Still working — runs can take a few minutes.",die=({hint:t,showElapsed:e=!0})=>{const[n,r]=m.useState(0),s=iie();m.useEffect(()=>{const o=setInterval(()=>{r(l=>(l+1)%_m.length)},4e3);return()=>clearInterval(o)},[]);const i=t??(e&&s>=cie?uie:null);return S.jsxs("div",{role:"status",className:"flex items-center gap-2 px-3 py-1","data-cy":"thinking-indicator",children:[S.jsx(yi.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(yi.path,{animate:{d:[tP,nP,aie,nP,tP]},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:qf.medium},children:[S.jsx("span",{className:"shimmer-text invisible col-start-1 row-start-1","aria-hidden":"true",children:lie}),S.jsx(ws,{mode:"popLayout",initial:!1,children:S.jsx(yi.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:_m[n]},_m[n])})]}),e?S.jsx("span",{className:"text-xs tabular-nums text-content-subtle","data-cy":"thinking-elapsed",children:oie(s)}):null,i?S.jsx("span",{className:"text-xs text-content-subtle",children:i}):null]})};var fie=Object.defineProperty,hie=(t,e)=>fie(t,"name",{value:e,configurable:!0});function _4(t,[e,n]){return Math.min(n,Math.max(e,t))}hie(_4,"clamp");var pie=Object.defineProperty,mie=(t,e)=>pie(t,"name",{value:e,configurable:!0});function JL(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])}mie(JL,"usePrevious");var gie=Object.defineProperty,Dt=(t,e)=>gie(t,"name",{value:e,configurable:!0}),eN=["PageUp","PageDown"],tN=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],nN={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},np="Slider",[Qx,vie,yie]=c4(np),[x4,uoe]=Qi(np,[yie]),[_ie,rp]=x4(np),xie=m.forwardRef(Dt(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=Dt(()=>{},"onValueChange"),onValueCommit:v=Dt(()=>{},"onValueCommit"),inverted:x=!1,form:_,...w}=e,b=m.useRef(new Set),E=m.useRef(0),C=m.useRef(!1),A=l==="horizontal"?wie:bie,[O,I]=m.useState(null),T=en(n,I),[M=[],N]=rl({prop:p,defaultProp:f,onChange:Dt(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(M),$=m.useRef(M);m.useEffect(()=>{const Q=_?O==null?void 0:O.ownerDocument.getElementById(_):O==null?void 0:O.closest("form");if(Q instanceof HTMLFormElement){const U=Dt(()=>N($.current),"reset");return Q.addEventListener("reset",U),()=>Q.removeEventListener("reset",U)}},[O,_,N]);function K(Q){const U=uN(M,Q);Z(Q,U)}Dt(K,"handleSlideStart");function B(Q){Z(Q,E.current)}Dt(B,"handleSlideMove");function z(){String(M)!==String(j.current)&&v(M)}Dt(z,"handleSlideEnd");function Z(Q,U,{commit:ee}={commit:!1}){const W=b4(o),D=Qf(Math.round((Q-s)/o)*o+s,W),X=_4(D,[s,i]);N((oe=[])=>{const re=lN(oe,X,U);if(hN(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 Dt(Z,"updateValues"),S.jsx(_ie,{scope:e.__scopeSlider,name:r,disabled:u,min:s,max:i,valueIndexToChangeRef:E,thumbs:b.current,values:M,orientation:l,form:_,children:S.jsx(Qx.Provider,{scope:e.__scopeSlider,children:S.jsx(Qx.Slot,{scope:e.__scopeSlider,children:S.jsx(A,{"aria-disabled":u,"data-disabled":u?"":void 0,...w,ref:T,onPointerDown:Gt(w.onPointerDown,()=>{u||(j.current=M,C.current=!1)}),min:s,max:i,inverted:x,onSlideStart:u?void 0:K,onSlideMove:u?void 0:B,onSlideEnd:u?void 0:z,onHomeKeyDown:()=>{u||(C.current=!0,Z(s,0,{commit:!0}))},onEndKeyDown:()=>{u||(C.current=!0,Z(i,M.length-1,{commit:!0}))},onStepKeyDown:({event:Q,direction:U})=>{if(!u){C.current=!0;const D=eN.includes(Q.key)||Q.shiftKey&&tN.includes(Q.key)?10:1,X=E.current,oe=M[X],re=pN(oe,{min:s,step:o,direction:U,multiplier:D});Z(re,X,{commit:!0})}}})})})})},"Slider")),[rN,sN]=x4(np,{startEdge:"left",endEdge:"right",size:"width",direction:1}),wie=m.forwardRef(Dt(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),x=en(n,v),_=m.useRef(void 0),w=h4(i),b=w==="ltr",E=b&&!o||!b&&o;function C(R){const A=_.current||g.getBoundingClientRect(),O=[0,A.width],T=dv(O,E?[r,s]:[s,r]);return _.current=A,T(R-A.left)}return Dt(C,"getValueFromPointer"),S.jsx(rN,{scope:e.__scopeSlider,startEdge:E?"left":"right",endEdge:E?"right":"left",direction:E?1:-1,size:"width",children:S.jsx(iN,{dir:w,"data-orientation":"horizontal",...p,ref:x,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 O=nN[E?"from-left":"from-right"].includes(R.key);f==null||f({event:R,direction:O?-1:1})}})})},"SliderHorizontal")),bie=m.forwardRef(Dt(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=en(n,p),v=m.useRef(void 0),x=!i;function _(w){const b=v.current||p.current.getBoundingClientRect(),E=[0,b.height],R=dv(E,x?[s,r]:[r,s]);return v.current=b,R(w-b.top)}return Dt(_,"getValueFromPointer"),S.jsx(rN,{scope:e.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:S.jsx(iN,{"data-orientation":"vertical",...f,ref:g,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const b=_(w.clientY);o==null||o(b)},onSlideMove:w=>{const b=_(w.clientY);l==null||l(b)},onSlideEnd:()=>{v.current=void 0,u==null||u()},onStepKeyDown:w=>{const E=nN[x?"from-bottom":"from-top"].includes(w.key);d==null||d({event:w,direction:E?-1:1})}})})},"SliderVertical")),iN=m.forwardRef(Dt(function(e,n){const{__scopeSlider:r,onSlideStart:s,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:u,onStepKeyDown:d,...f}=e,p=rp(np,r);return S.jsx(kn.span,{...f,ref:n,onKeyDown:Gt(e.onKeyDown,g=>{g.key==="Home"?(l(g),g.preventDefault()):g.key==="End"?(u(g),g.preventDefault()):eN.concat(tN).includes(g.key)&&(d(g),g.preventDefault())}),onPointerDown:Gt(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:Gt(e.onPointerMove,g=>{g.target.hasPointerCapture(g.pointerId)&&i(g)}),onPointerUp:Gt(e.onPointerUp,g=>{const v=g.target;v.hasPointerCapture(g.pointerId)&&(v.releasePointerCapture(g.pointerId),o(g))})})},"SliderImpl")),Sie="SliderTrack",kie=m.forwardRef(Dt(function(e,n){const{__scopeSlider:r,...s}=e,i=rp(Sie,r);return S.jsx(kn.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...s,ref:n})},"SliderTrack")),rP="SliderRange",Eie=m.forwardRef(Dt(function(e,n){const{__scopeSlider:r,...s}=e,i=rp(rP,r),o=sN(rP,r),l=m.useRef(null),u=en(n,l),d=i.values.length,f=i.values.map(v=>w4(v,i.min,i.max)),p=d>1?Math.min(...f):0,g=100-Math.max(...f);return S.jsx(kn.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...s,ref:u,style:{...e.style,[o.startEdge]:p+"%",[o.endEdge]:g+"%"}})},"SliderRange")),Cie="SliderThumb",[Pie,oN]=x4(Cie),Rie="SliderThumbProvider";function aN(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:s}=t,i=rp(Rie,e),o=vie(e),[l,u]=m.useState(null),d=m.useMemo(()=>l?o().findIndex(w=>w.ref.current===l):-1,[o,l]),f=bb(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),x=g===void 0?0:w4(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:x,size:f};return S.jsx(Pie,{scope:e,..._,children:mN(s)?s(_):r})}Dt(aN,"SliderThumbProvider");var M_="SliderThumbTrigger",Aie=m.forwardRef(Dt(function(e,n){const{__scopeSlider:r,...s}=e,i=rp(M_,r),o=sN(M_,r),{index:l,value:u,percent:d,size:f,onThumbChange:p}=oN(M_,r),g=en(n,p),v=cN(l,i.values.length),x=f==null?void 0:f[o.size],_=x?dN(x,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(Qx.ItemSlot,{scope:r,children:S.jsx(kn.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:Gt(e.onFocus,()=>{i.valueIndexToChangeRef.current=l})})})})},"SliderThumbTrigger")),Tie=m.forwardRef(Dt(function(e,n){const{__scopeSlider:r,name:s,...i}=e;return S.jsx(aN,{__scopeSlider:r,name:s,internal_do_not_use_render:({index:o,isFormControl:l})=>S.jsxs(S.Fragment,{children:[S.jsx(Aie,{...i,ref:n,__scopeSlider:r}),l?S.jsx(Mie,{__scopeSlider:r},o):null]})})},"SliderThumb")),Iie="SliderBubbleInput",Mie=m.forwardRef(Dt(function({__scopeSlider:e,...n},r){const{value:s,name:i,form:o}=oN(Iie,e),l=m.useRef(null),u=en(l,r),d=JL(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 x=new Event("input",{bubbles:!0});v.call(f,s),f.dispatchEvent(x)}},[d,s]),S.jsx(kn.input,{style:{display:"none"},name:i,form:o,...n,ref:u,defaultValue:s})},"SliderBubbleInput"));function lN(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}Dt(lN,"getNextSortedValues");function w4(t,e,n){const i=100/(n-e)*(t-e);return _4(i,[0,100])}Dt(w4,"convertValueToPercentage");function cN(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}Dt(cN,"getLabel");function uN(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)}Dt(uN,"getClosestValueIndex");function dN(t,e,n){const r=t/2,i=dv([0,50],[0,r]);return(r-i(e)*n)*n}Dt(dN,"getThumbInBoundsOffset");function fN(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}Dt(fN,"getStepsBetweenValues");function hN(t,e){if(e>0){const n=fN(t);return Math.min(...n)>=e}return!0}Dt(hN,"hasMinStepsBetweenValues");function dv(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])}}Dt(dv,"linearScale");function b4(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}Dt(b4,"getDecimalCount");function Qf(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}Dt(Qf,"roundValue");function pN(t,{min:e,step:n,direction:r,multiplier:s}){const i=b4(n),o=(t-e)/n,l=Math.round(o),u=Qf(l*n+e,i)===Qf(t,i);let d;return u?d=l+s*r:r>0?d=Math.ceil(o):d=Math.floor(o),Qf(d*n+e,i)}Dt(pN,"getNextStepValue");function mN(t){return typeof t=="function"}Dt(mN,"isFunction");const Jx=m.forwardRef(({className:t,...e},n)=>S.jsxs(xie,{ref:n,className:zt("relative flex w-full touch-none select-none items-center","data-[disabled]:opacity-50",t),...e,children:[S.jsx(kie,{className:"relative h-1 w-full grow overflow-hidden rounded-full bg-input",children:S.jsx(Eie,{className:"absolute h-full bg-primary"})}),S.jsx(Tie,{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")})]}));Jx.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"}],Lie=[{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"}],Nie=[{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"}],U0=[{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."}],Die=()=>{window.location.hash=""},yo=({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]}),sP=({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))}),jie=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",$ie=()=>{const t=U0.filter(n=>n.status==="showcased").length,e=U0.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:Die,className:"text-content-subtle hover:text-content mb-6 inline-flex items-center gap-2 text-sm transition-colors",children:[S.jsx(iq,{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(iI,{className:"text-primary h-5 w-5",weight:"bold"}),"Open with ",S.jsx("code",{className:"text-content",children:"#/design-system"})]})})]})]}),S.jsx(yo,{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(Zi,{title:"Primary action",shortcut:"D",variant:"primary",children:"Design action"}),S.jsx(Zi,{title:"Secondary action",variant:"secondary",children:"Secondary"}),S.jsx(Zi,{title:"Disabled action",disabled:!0,variant:"tertiary",children:"Disabled"}),S.jsx(yO,{primaryLabel:"Ship",primaryIcon:Yy,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(_c,{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(Pb,{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(yo,{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(sP,{swatches:Oie})}),S.jsx(yo,{eyebrow:"Tokens",title:"Color roles",description:"Named roles should communicate purpose: brand, selection, neutral accent, and outcome colors.",children:S.jsx(sP,{swatches:Lie})}),S.jsx(yo,{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(yo,{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:Nie.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(yo,{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(ym,{defaultValue:["foundations"],className:"border-border bg-surface-2 rounded-xl border p-2",children:[S.jsx(ym.Item,{value:"foundations",title:"Foundations",description:"Tokens, surfaces, type, and spacing.",className:"first-item",icon:S.jsx(Yy,{className:"text-primary h-4 w-4"}),children:S.jsx("p",{children:"Use these pieces before adding one-off visual rules."})}),S.jsx(ym.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(Jx,{defaultValue:[64],max:100,step:1}),S.jsx(Jx,{defaultValue:[36],max:100,step:1,disabled:!0})]})]})]})}),S.jsx(yo,{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(sie,{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(Hb,{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(die,{hint:"Reading selected elements"})})]})}),S.jsx(yo,{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(Ox,{fill:"surface",loader:"coalesce",trackGlobalLoaderCount:!1})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(zO,{icon:S.jsx(Yy,{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(Ub,{fill:"surface",size:"sm",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>{}}]})})]})}),S.jsxs(yo,{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:U0.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:U0.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 ${jie(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",ew=274,Eg=395,O_=Math.min(Eg,Math.round((ew+Eg)/2*1.1)),iP="rivet:panelWidth:v2",Vie=t=>{if(!(t instanceof HTMLElement))return!1;const e=t.tagName.toLowerCase();return t.isContentEditable||e==="input"||e==="textarea"||e==="select"},Hie=({projectPath:t})=>{const e=ct(dO)>0,[n,r]=JR(cO),s=nW(),[i,o]=m.useState(()=>{if(typeof window>"u")return O_;const R=Number(window.localStorage.getItem(iP));return Number.isFinite(R)&&R>=ew&&R<=Eg?R:O_}),[l,u]=m.useState(!1),[d,f]=m.useState(Xne),p=n?i:0,[g,v]=m.useState(n);m.useEffect(()=>{if(!n){v(!1);return}f(R=>Yne({position:R,boundsLeftPx:i}))},[n,i]),m.useEffect(()=>{window.localStorage.setItem(iP,String(i))},[i]),m.useEffect(()=>{if(!n)return;const R=A=>{A.key==="Escape"&&(Vie(A.target)||(A.preventDefault(),r(!1)))};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[n,r]);const x=m.useCallback(R=>{R.preventDefault(),R.stopPropagation();const A=R.clientX,O=i;u(!0);const I=M=>{const N=Math.min(Eg,Math.max(ew,O+(M.clientX-A)));o(N)},T=()=>{window.removeEventListener("pointermove",I),window.removeEventListener("pointerup",T),window.removeEventListener("pointercancel",T),u(!1)};window.addEventListener("pointermove",I),window.addEventListener("pointerup",T),window.addEventListener("pointercancel",T)},[i]),_=m.useCallback(()=>o(O_),[]),w=ure(),b=ct(nv);hre({enabled:!b});const E=w.isProcessing?"Completing authentication...":null,C=gt(Vb);return m.useEffect(()=>{C(t??null)},[t,C]),S.jsxs(yi.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(jne,{message:E})}):null,S.jsx("div",{className:"relative flex min-w-0 flex-1 flex-col",children:S.jsx(dte,{})}),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(yi.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(kee,{onClose:()=>r(!1)}),S.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize panel",onPointerDown:x,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(ere,{isVisible:!0,isPanelOpen:n,isReducedMotion:!!s,position:d,dragBoundsLeftPx:p,onPositionChange:f,onToggle:()=>r(R=>!R)})]})}),S.jsx(MW,{duration:5e3,richColors:!0,toastOptions:{style:{maxHeight:"150px",overflow:"hidden"}}})]})},tw="rivet_connect_deep_link",zie=()=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search),e=t.get("connect"),n=e??window.sessionStorage.getItem(tw);if(n!=="pinterest"&&n!=="arena"&&n!=="x")return null;if(window.sessionStorage.setItem(tw,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},Uie=zie(),Bie=()=>{const[t,e]=m.useState(window.location.hash),[n]=m.useState(()=>typeof window<"u"&&window.sessionStorage.getItem(gg)==="1"),[r,s]=m.useState(!1),[i,o]=m.useState(Uie);m.useEffect(()=>{n&&window.sessionStorage.removeItem(gg)},[n]);const{config:l,refetchConfig:u,loading:d,error:f}=lre(),p=gt(nv),{startLogin:g,isStartingLogin:v,loginError:x}=MO(),[_,w]=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()=>{w(!0),p(!0);try{await u()}finally{p(!1),w(!1)}},[u,p]);if(m.useEffect(()=>{const I=()=>{const T=window.location.hash;e(T)};return window.addEventListener("hashchange",I),()=>window.removeEventListener("hashchange",I)},[]),E==="design-system")return S.jsx($ie,{});if(!d&&l===null&&!_){const I=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:I}),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(Nne,{isSigningIn:v,onStartSignIn:()=>{g()},errorMessage:x,displayMode:"full"});const A=(l==null?void 0:l.agentModeAvailable)===!0&&i!==null,O=(l==null?void 0:l.agentModeAvailable)===!0&&n&&!r&&!A;return S.jsxs(S.Fragment,{children:[S.jsx(Hie,{projectPath:l==null?void 0:l.projectPath}),S.jsx(Mx,{context:"onboarding",isOpen:O,onClose:()=>s(!0)}),S.jsx(Mx,{context:"menu",isOpen:A,highlightProvider:i,onClose:()=>{window.sessionStorage.removeItem(tw),o(null)}})]})};xV();const Zie=m.lazy(()=>gP(()=>import("./LibraryApp-B4ztVk52.js"),[])),Wie=window.location.pathname.startsWith("/rivet/library"),qie="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",Gie=new k7,Kie={session_recording:{maskAllInputs:!0,maskTextSelector:"[data-rivet-private]"}},Yie=()=>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."})}),gN=document.getElementById("root");if(!gN)throw new Error("Rivet root element is missing");PV.createRoot(gN).render(S.jsx(xe.StrictMode,{children:S.jsx(fV,{apiKey:qie,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",...Kie,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.19.0",env:"production"})}},children:S.jsx(yV,{fallback:S.jsx(Yie,{}),children:S.jsx(QD,{client:Gie,children:S.jsx(XG,{defaultShape:"rounded",children:S.jsx(tie,{defaultLibrary:"lucide",children:Wie?S.jsx(m.Suspense,{fallback:S.jsx("div",{className:"bg-background h-screen"}),children:S.jsx(Zie,{})}):S.jsx(Bie,{})})})})})})}));export{wV as $,Jg as A,Zi as B,$b as C,Kg as D,ev as E,At as F,$ne as G,Gh as H,Use as I,_V as J,eh as K,fI as L,Wf as M,fse as N,Kn as O,jb as P,y7 as Q,Nb as R,Hh as S,Db as T,mc as U,eoe as V,db as W,Qse as X,ooe as Y,aoe as Z,qJ as _,E7 as a,zt as a0,toe as a1,noe as a2,ase as a3,See as a4,MW as a5,UJ as a6,R7 as b,m as c,A7 as d,M7 as e,T7 as f,w7 as g,Jf as h,Wr as i,O7 as j,L7 as k,I7 as l,SP as m,fr as n,it as o,Xi as p,rO as q,wP as r,W1 as s,S as t,yP as u,J2 as v,Dse as w,Yg as x,Xg as y,Qg as z};
|